diff --git a/jhub_apps/static/js/index.js b/jhub_apps/static/js/index.js index e448e9e9..5ae1def7 100644 --- a/jhub_apps/static/js/index.js +++ b/jhub_apps/static/js/index.js @@ -187,7 +187,7 @@ Error generating stack: `+s.message+` `).forEach(function(i){o=i.indexOf(":"),n=i.substring(0,o).trim().toLowerCase(),r=i.substring(o+1).trim(),!(!n||t[n]&&mQ[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},u1=Symbol("internals");function Bl(e){return e&&String(e).trim().toLowerCase()}function Lf(e){return e===!1||e==null?e:$.isArray(e)?e.map(Lf):String(e)}function PQ(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const gQ=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Eh(e,t,n,r,o){if($.isFunction(r))return r.call(this,t,n);if(o&&(t=n),!!$.isString(t)){if($.isString(r))return t.indexOf(r)!==-1;if($.isRegExp(r))return r.test(t)}}function yQ(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function bQ(e,t){const n=$.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(o,s,i){return this[r].call(this,t,o,s,i)},configurable:!0})})}class Ev{constructor(t){t&&this.set(t)}set(t,n,r){const o=this;function s(a,l,c){const u=Bl(l);if(!u)throw new Error("header name must be a non-empty string");const d=$.findKey(o,u);(!d||o[d]===void 0||c===!0||c===void 0&&o[d]!==!1)&&(o[d||l]=Lf(a))}const i=(a,l)=>$.forEach(a,(c,u)=>s(c,u,l));if($.isPlainObject(t)||t instanceof this.constructor)i(t,n);else if($.isString(t)&&(t=t.trim())&&!gQ(t))i(AQ(t),n);else if($.isHeaders(t))for(const[a,l]of t.entries())s(l,a,r);else t!=null&&s(n,t,r);return this}get(t,n){if(t=Bl(t),t){const r=$.findKey(this,t);if(r){const o=this[r];if(!n)return o;if(n===!0)return PQ(o);if($.isFunction(n))return n.call(this,o,r);if($.isRegExp(n))return n.exec(o);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Bl(t),t){const r=$.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Eh(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let o=!1;function s(i){if(i=Bl(i),i){const a=$.findKey(r,i);a&&(!n||Eh(r,r[a],a,n))&&(delete r[a],o=!0)}}return $.isArray(t)?t.forEach(s):s(t),o}clear(t){const n=Object.keys(this);let r=n.length,o=!1;for(;r--;){const s=n[r];(!t||Eh(this,this[s],s,t,!0))&&(delete this[s],o=!0)}return o}normalize(t){const n=this,r={};return $.forEach(this,(o,s)=>{const i=$.findKey(r,s);if(i){n[i]=Lf(o),delete n[s];return}const a=t?yQ(s):String(s).trim();a!==s&&delete n[s],n[a]=Lf(o),r[a]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return $.forEach(this,(r,o)=>{r!=null&&r!==!1&&(n[o]=t&&$.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(o=>r.set(o)),r}static accessor(t){const r=(this[u1]=this[u1]={accessors:{}}).accessors,o=this.prototype;function s(i){const a=Bl(i);r[a]||(bQ(o,i),r[a]=!0)}return $.isArray(t)?t.forEach(s):s(t),this}}Ev.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);$.reduceDescriptors(Ev.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});$.freezeMethods(Ev);const _r=Ev;function Mh(e,t){const n=this||$g,r=t||n,o=_r.from(r.headers);let s=r.data;return $.forEach(e,function(a){s=a.call(n,s,o.normalize(),t?t.status:void 0)}),o.normalize(),s}function e3(e){return!!(e&&e.__CANCEL__)}function hl(e,t,n){Ke.call(this,e??"canceled",Ke.ERR_CANCELED,t,n),this.name="CanceledError"}$.inherits(hl,Ke,{__CANCEL__:!0});function t3(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ke("Request failed with status code "+n.status,[Ke.ERR_BAD_REQUEST,Ke.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function xQ(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function wQ(e,t){e=e||10;const n=new Array(e),r=new Array(e);let o=0,s=0,i;return t=t!==void 0?t:1e3,function(l){const c=Date.now(),u=r[s];i||(i=c),n[o]=l,r[o]=c;let d=s,p=0;for(;d!==o;)p+=n[d++],d=d%e;if(o=(o+1)%e,o===s&&(s=(s+1)%e),c-i{n=u,o=null,s&&(clearTimeout(s),s=null),e.apply(null,c)};return[(...c)=>{const u=Date.now(),d=u-n;d>=r?i(c,u):(o=c,s||(s=setTimeout(()=>{s=null,i(o)},r-d)))},()=>o&&i(o)]}const Dd=(e,t,n=3)=>{let r=0;const o=wQ(50,250);return HQ(s=>{const i=s.loaded,a=s.lengthComputable?s.total:void 0,l=i-r,c=o(l),u=i<=a;r=i;const d={loaded:i,total:a,progress:a?i/a:void 0,bytes:l,rate:c||void 0,estimated:c&&a&&u?(a-i)/c:void 0,event:s,lengthComputable:a!=null,[t?"download":"upload"]:!0};e(d)},n)},f1=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},d1=e=>(...t)=>$.asap(()=>e(...t)),jQ=Kr.hasStandardBrowserEnv?function(){const t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");let r;function o(s){let i=s;return t&&(n.setAttribute("href",i),i=n.href),n.setAttribute("href",i),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:n.pathname.charAt(0)==="/"?n.pathname:"/"+n.pathname}}return r=o(window.location.href),function(i){const a=$.isString(i)?o(i):i;return a.protocol===r.protocol&&a.host===r.host}}():function(){return function(){return!0}}(),zQ=Kr.hasStandardBrowserEnv?{write(e,t,n,r,o,s){const i=[e+"="+encodeURIComponent(t)];$.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),$.isString(r)&&i.push("path="+r),$.isString(o)&&i.push("domain="+o),s===!0&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function OQ(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function CQ(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function n3(e,t){return e&&!OQ(t)?CQ(e,t):t}const p1=e=>e instanceof _r?{...e}:e;function Ti(e,t){t=t||{};const n={};function r(c,u,d){return $.isPlainObject(c)&&$.isPlainObject(u)?$.merge.call({caseless:d},c,u):$.isPlainObject(u)?$.merge({},u):$.isArray(u)?u.slice():u}function o(c,u,d){if($.isUndefined(u)){if(!$.isUndefined(c))return r(void 0,c,d)}else return r(c,u,d)}function s(c,u){if(!$.isUndefined(u))return r(void 0,u)}function i(c,u){if($.isUndefined(u)){if(!$.isUndefined(c))return r(void 0,c)}else return r(void 0,u)}function a(c,u,d){if(d in t)return r(c,u);if(d in e)return r(void 0,c)}const l={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(c,u)=>o(p1(c),p1(u),!0)};return $.forEach(Object.keys(Object.assign({},e,t)),function(u){const d=l[u]||o,p=d(e[u],t[u],u);$.isUndefined(p)&&d!==a||(n[u]=p)}),n}const r3=e=>{const t=Ti({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:o,xsrfCookieName:s,headers:i,auth:a}=t;t.headers=i=_r.from(i),t.url=K5(n3(t.baseURL,t.url),e.params,e.paramsSerializer),a&&i.set("Authorization","Basic "+btoa((a.username||"")+":"+(a.password?unescape(encodeURIComponent(a.password)):"")));let l;if($.isFormData(n)){if(Kr.hasStandardBrowserEnv||Kr.hasStandardBrowserWebWorkerEnv)i.setContentType(void 0);else if((l=i.getContentType())!==!1){const[c,...u]=l?l.split(";").map(d=>d.trim()).filter(Boolean):[];i.setContentType([c||"multipart/form-data",...u].join("; "))}}if(Kr.hasStandardBrowserEnv&&(r&&$.isFunction(r)&&(r=r(t)),r||r!==!1&&jQ(t.url))){const c=o&&s&&zQ.read(s);c&&i.set(o,c)}return t},DQ=typeof XMLHttpRequest<"u",SQ=DQ&&function(e){return new Promise(function(n,r){const o=r3(e);let s=o.data;const i=_r.from(o.headers).normalize();let{responseType:a,onUploadProgress:l,onDownloadProgress:c}=o,u,d,p,y,h;function P(){y&&y(),h&&h(),o.cancelToken&&o.cancelToken.unsubscribe(u),o.signal&&o.signal.removeEventListener("abort",u)}let x=new XMLHttpRequest;x.open(o.method.toUpperCase(),o.url,!0),x.timeout=o.timeout;function A(){if(!x)return;const m=_r.from("getAllResponseHeaders"in x&&x.getAllResponseHeaders()),j={data:!a||a==="text"||a==="json"?x.responseText:x.response,status:x.status,statusText:x.statusText,headers:m,config:e,request:x};t3(function(H){n(H),P()},function(H){r(H),P()},j),x=null}"onloadend"in x?x.onloadend=A:x.onreadystatechange=function(){!x||x.readyState!==4||x.status===0&&!(x.responseURL&&x.responseURL.indexOf("file:")===0)||setTimeout(A)},x.onabort=function(){x&&(r(new Ke("Request aborted",Ke.ECONNABORTED,e,x)),x=null)},x.onerror=function(){r(new Ke("Network Error",Ke.ERR_NETWORK,e,x)),x=null},x.ontimeout=function(){let w=o.timeout?"timeout of "+o.timeout+"ms exceeded":"timeout exceeded";const j=o.transitional||_5;o.timeoutErrorMessage&&(w=o.timeoutErrorMessage),r(new Ke(w,j.clarifyTimeoutError?Ke.ETIMEDOUT:Ke.ECONNABORTED,e,x)),x=null},s===void 0&&i.setContentType(null),"setRequestHeader"in x&&$.forEach(i.toJSON(),function(w,j){x.setRequestHeader(j,w)}),$.isUndefined(o.withCredentials)||(x.withCredentials=!!o.withCredentials),a&&a!=="json"&&(x.responseType=o.responseType),c&&([p,h]=Dd(c,!0),x.addEventListener("progress",p)),l&&x.upload&&([d,y]=Dd(l),x.upload.addEventListener("progress",d),x.upload.addEventListener("loadend",y)),(o.cancelToken||o.signal)&&(u=m=>{x&&(r(!m||m.type?new hl(null,e,x):m),x.abort(),x=null)},o.cancelToken&&o.cancelToken.subscribe(u),o.signal&&(o.signal.aborted?u():o.signal.addEventListener("abort",u)));const v=xQ(o.url);if(v&&Kr.protocols.indexOf(v)===-1){r(new Ke("Unsupported protocol "+v+":",Ke.ERR_BAD_REQUEST,e));return}x.send(s||null)})},TQ=(e,t)=>{let n=new AbortController,r;const o=function(l){if(!r){r=!0,i();const c=l instanceof Error?l:this.reason;n.abort(c instanceof Ke?c:new hl(c instanceof Error?c.message:c))}};let s=t&&setTimeout(()=>{o(new Ke(`timeout ${t} of ms exceeded`,Ke.ETIMEDOUT))},t);const i=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(l=>{l&&(l.removeEventListener?l.removeEventListener("abort",o):l.unsubscribe(o))}),e=null)};e.forEach(l=>l&&l.addEventListener&&l.addEventListener("abort",o));const{signal:a}=n;return a.unsubscribe=i,[a,()=>{s&&clearTimeout(s),s=null}]},RQ=function*(e,t){let n=e.byteLength;if(!t||n{const s=kQ(e,t,o);let i=0,a,l=c=>{a||(a=!0,r&&r(c))};return new ReadableStream({async pull(c){try{const{done:u,value:d}=await s.next();if(u){l(),c.close();return}let p=d.byteLength;if(n){let y=i+=p;n(y)}c.enqueue(new Uint8Array(d))}catch(u){throw l(u),u}},cancel(c){return l(c),s.return()}},{highWaterMark:2})},Mv=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",o3=Mv&&typeof ReadableStream=="function",zA=Mv&&(typeof TextEncoder=="function"?(e=>t=>e.encode(t))(new TextEncoder):async e=>new Uint8Array(await new Response(e).arrayBuffer())),s3=(e,...t)=>{try{return!!e(...t)}catch{return!1}},EQ=o3&&s3(()=>{let e=!1;const t=new Request(Kr.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),h1=64*1024,OA=o3&&s3(()=>$.isReadableStream(new Response("").body)),Sd={stream:OA&&(e=>e.body)};Mv&&(e=>{["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Sd[t]&&(Sd[t]=$.isFunction(e[t])?n=>n[t]():(n,r)=>{throw new Ke(`Response type '${t}' is not supported`,Ke.ERR_NOT_SUPPORT,r)})})})(new Response);const MQ=async e=>{if(e==null)return 0;if($.isBlob(e))return e.size;if($.isSpecCompliantForm(e))return(await new Request(e).arrayBuffer()).byteLength;if($.isArrayBufferView(e)||$.isArrayBuffer(e))return e.byteLength;if($.isURLSearchParams(e)&&(e=e+""),$.isString(e))return(await zA(e)).byteLength},LQ=async(e,t)=>{const n=$.toFiniteNumber(e.getContentLength());return n??MQ(t)},XQ=Mv&&(async e=>{let{url:t,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=r3(e);c=c?(c+"").toLowerCase():"text";let[y,h]=o||s||i?TQ([o,s],i):[],P,x;const A=()=>{!P&&setTimeout(()=>{y&&y.unsubscribe()}),P=!0};let v;try{if(l&&EQ&&n!=="get"&&n!=="head"&&(v=await LQ(u,r))!==0){let z=new Request(t,{method:"POST",body:r,duplex:"half"}),H;if($.isFormData(r)&&(H=z.headers.get("content-type"))&&u.setContentType(H),z.body){const[O,D]=f1(v,Dd(d1(l)));r=v1(z.body,h1,O,D,zA)}}$.isString(d)||(d=d?"include":"omit"),x=new Request(t,{...p,signal:y,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:d});let m=await fetch(x);const w=OA&&(c==="stream"||c==="response");if(OA&&(a||w)){const z={};["status","statusText","headers"].forEach(S=>{z[S]=m[S]});const H=$.toFiniteNumber(m.headers.get("content-length")),[O,D]=a&&f1(H,Dd(d1(a),!0))||[];m=new Response(v1(m.body,h1,O,()=>{D&&D(),w&&A()},zA),z)}c=c||"text";let j=await Sd[$.findKey(Sd,c)||"text"](m,e);return!w&&A(),h&&h(),await new Promise((z,H)=>{t3(z,H,{data:j,headers:_r.from(m.headers),status:m.status,statusText:m.statusText,config:e,request:x})})}catch(m){throw A(),m&&m.name==="TypeError"&&/fetch/i.test(m.message)?Object.assign(new Ke("Network Error",Ke.ERR_NETWORK,e,x),{cause:m.cause||m}):Ke.from(m,m&&m.code,e,x)}}),CA={http:eQ,xhr:SQ,fetch:XQ};$.forEach(CA,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const m1=e=>`- ${e}`,NQ=e=>$.isFunction(e)||e===null||e===!1,i3={getAdapter:e=>{e=$.isArray(e)?e:[e];const{length:t}=e;let n,r;const o={};for(let s=0;s`adapter ${a} `+(l===!1?"is not supported by the environment":"is not available in the build"));let i=t?s.length>1?`since : `+s.map(m1).join(` -`):" "+m1(s[0]):"as no adapter specified";throw new Ke("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:CA};function Lh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hl(null,e)}function A1(e){return Lh(e),e.headers=_r.from(e.headers),e.data=Mh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),i3.getAdapter(e.adapter||$g.adapter)(e).then(function(r){return Lh(e),r.data=Mh.call(e,e.transformResponse,r),r.headers=_r.from(r.headers),r},function(r){return e3(r)||(Lh(e),r&&r.response&&(r.response.data=Mh.call(e,e.transformResponse,r.response),r.response.headers=_r.from(r.response.headers))),Promise.reject(r)})}const a3="1.7.3",ey={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ey[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const P1={};ey.transitional=function(t,n,r){function o(s,i){return"[Axios v"+a3+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new Ke(o(i," has been removed"+(n?" in "+n:"")),Ke.ERR_DEPRECATED);return n&&!P1[i]&&(P1[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}};function BQ(e,t,n){if(typeof e!="object")throw new Ke("options must be an object",Ke.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],l=a===void 0||i(a,s,e);if(l!==!0)throw new Ke("option "+s+" must be "+l,Ke.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ke("Unknown option "+s,Ke.ERR_BAD_OPTION)}}const DA={assertOptions:BQ,validators:ey},es=DA.validators;class Td{constructor(t){this.defaults=t,this.interceptors={request:new c1,response:new c1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` +`):" "+m1(s[0]):"as no adapter specified";throw new Ke("There is no suitable adapter to dispatch the request "+i,"ERR_NOT_SUPPORT")}return r},adapters:CA};function Lh(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new hl(null,e)}function A1(e){return Lh(e),e.headers=_r.from(e.headers),e.data=Mh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),i3.getAdapter(e.adapter||$g.adapter)(e).then(function(r){return Lh(e),r.data=Mh.call(e,e.transformResponse,r),r.headers=_r.from(r.headers),r},function(r){return e3(r)||(Lh(e),r&&r.response&&(r.response.data=Mh.call(e,e.transformResponse,r.response),r.response.headers=_r.from(r.response.headers))),Promise.reject(r)})}const a3="1.7.4",ey={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{ey[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const P1={};ey.transitional=function(t,n,r){function o(s,i){return"[Axios v"+a3+"] Transitional option '"+s+"'"+i+(r?". "+r:"")}return(s,i,a)=>{if(t===!1)throw new Ke(o(i," has been removed"+(n?" in "+n:"")),Ke.ERR_DEPRECATED);return n&&!P1[i]&&(P1[i]=!0,console.warn(o(i," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(s,i,a):!0}};function BQ(e,t,n){if(typeof e!="object")throw new Ke("options must be an object",Ke.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let o=r.length;for(;o-- >0;){const s=r[o],i=t[s];if(i){const a=e[s],l=a===void 0||i(a,s,e);if(l!==!0)throw new Ke("option "+s+" must be "+l,Ke.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ke("Unknown option "+s,Ke.ERR_BAD_OPTION)}}const DA={assertOptions:BQ,validators:ey},es=DA.validators;class Td{constructor(t){this.defaults=t,this.interceptors={request:new c1,response:new c1}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;const s=o.stack?o.stack.replace(/^.+\n/,""):"";try{r.stack?s&&!String(r.stack).endsWith(s.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+s):r.stack=s}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ti(this.defaults,n);const{transitional:r,paramsSerializer:o,headers:s}=n;r!==void 0&&DA.assertOptions(r,{silentJSONParsing:es.transitional(es.boolean),forcedJSONParsing:es.transitional(es.boolean),clarifyTimeoutError:es.transitional(es.boolean)},!1),o!=null&&($.isFunction(o)?n.paramsSerializer={serialize:o}:DA.assertOptions(o,{encode:es.function,serialize:es.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let i=s&&$.merge(s.common,s[n.method]);s&&$.forEach(["delete","get","head","post","put","patch","common"],h=>{delete s[h]}),n.headers=_r.concat(i,s);const a=[];let l=!0;this.interceptors.request.forEach(function(P){typeof P.runWhen=="function"&&P.runWhen(n)===!1||(l=l&&P.synchronous,a.unshift(P.fulfilled,P.rejected))});const c=[];this.interceptors.response.forEach(function(P){c.push(P.fulfilled,P.rejected)});let u,d=0,p;if(!l){const h=[A1.bind(this),void 0];for(h.unshift.apply(h,a),h.push.apply(h,c),p=h.length,u=Promise.resolve(n);d{if(!r._listeners)return;let s=r._listeners.length;for(;s-- >0;)r._listeners[s](o);r._listeners=null}),this.promise.then=o=>{let s;const i=new Promise(a=>{r.subscribe(a),s=a}).then(o);return i.cancel=function(){r.unsubscribe(s)},i},t(function(s,i,a){r.reason||(r.reason=new hl(s,i,a),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new ty(function(o){t=o}),cancel:t}}}const VQ=ty;function IQ(e){return function(n){return e.apply(null,n)}}function WQ(e){return $.isObject(e)&&e.isAxiosError===!0}const SA={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(SA).forEach(([e,t])=>{SA[t]=e});const JQ=SA;function l3(e){const t=new Xf(e),n=B5(Xf.prototype.request,t);return $.extend(n,Xf.prototype,t,{allOwnKeys:!0}),$.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return l3(Ti(e,o))},n}const en=l3($g);en.Axios=Xf;en.CanceledError=hl;en.CancelToken=VQ;en.isCancel=e3;en.VERSION=a3;en.toFormData=kv;en.AxiosError=Ke;en.Cancel=en.CanceledError;en.all=function(t){return Promise.all(t)};en.spread=IQ;en.isAxiosError=WQ;en.mergeConfig=Ti;en.AxiosHeaders=_r;en.formToJSON=e=>$5($.isHTMLForm(e)?new FormData(e):e);en.getAdapter=i3.getAdapter;en.HttpStatusCode=JQ;en.default=en;const Yt=en.create({baseURL:"/services/japps",headers:{"Content-Type":"application/json"}});Yt.interceptors.response.use(e=>e,e=>{const t=e.response.status;(e.response.status===401||t===403)&&(window.location.href="/services/japps/jhub-login")});var Ou=e=>e.type==="checkbox",fa=e=>e instanceof Date,Mn=e=>e==null;const c3=e=>typeof e=="object";var cn=e=>!Mn(e)&&!Array.isArray(e)&&c3(e)&&!fa(e),u3=e=>cn(e)&&e.target?Ou(e.target)?e.target.checked:e.target.value:e,FQ=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,f3=(e,t)=>e.has(FQ(t)),YQ=e=>{const t=e.constructor&&e.constructor.prototype;return cn(t)&&t.hasOwnProperty("isPrototypeOf")},ny=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function In(e){let t;const n=Array.isArray(e);if(e instanceof Date)t=new Date(e);else if(e instanceof Set)t=new Set(e);else if(!(ny&&(e instanceof Blob||e instanceof FileList))&&(n||cn(e)))if(t=n?[]:{},!n&&!YQ(e))t=e;else for(const r in e)e.hasOwnProperty(r)&&(t[r]=In(e[r]));else return e;return t}var Lv=e=>Array.isArray(e)?e.filter(Boolean):[],Ft=e=>e===void 0,ye=(e,t,n)=>{if(!t||!cn(e))return n;const r=Lv(t.split(/[,[\].]+?/)).reduce((o,s)=>Mn(o)?o:o[s],e);return Ft(r)||r===e?Ft(e[t])?n:e[t]:r},po=e=>typeof e=="boolean",ry=e=>/^\w*$/.test(e),d3=e=>Lv(e.replace(/["|']|\]/g,"").split(/\.|\[/)),xt=(e,t,n)=>{let r=-1;const o=ry(t)?[t]:d3(t),s=o.length,i=s-1;for(;++rOe.useContext(qQ);var p3=(e,t,n,r=!0)=>{const o={defaultValues:t._defaultValues};for(const s in e)Object.defineProperty(o,s,{get:()=>{const i=s;return t._proxyFormState[i]!==Zr.all&&(t._proxyFormState[i]=!r||Zr.all),n&&(n[i]=!0),e[i]}});return o},Fn=e=>cn(e)&&!Object.keys(e).length,v3=(e,t,n,r)=>{n(e);const{name:o,...s}=e;return Fn(s)||Object.keys(s).length>=Object.keys(t).length||Object.keys(s).find(i=>t[i]===(!r||Zr.all))},xc=e=>Array.isArray(e)?e:[e],h3=(e,t,n)=>!e||!t||e===t||xc(e).some(r=>r&&(n?r===t:r.startsWith(t)||t.startsWith(r)));function sy(e){const t=Oe.useRef(e);t.current=e,Oe.useEffect(()=>{const n=!e.disabled&&t.current.subject&&t.current.subject.subscribe({next:t.current.next});return()=>{n&&n.unsubscribe()}},[e.disabled])}function ZQ(e){const t=oy(),{control:n=t.control,disabled:r,name:o,exact:s}=e||{},[i,a]=Oe.useState(n._formState),l=Oe.useRef(!0),c=Oe.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),u=Oe.useRef(o);return u.current=o,sy({disabled:r,next:d=>l.current&&h3(u.current,d.name,s)&&v3(d,c.current,n._updateFormState)&&a({...n._formState,...d}),subject:n._subjects.state}),Oe.useEffect(()=>(l.current=!0,c.current.isValid&&n._updateValid(!0),()=>{l.current=!1}),[n]),p3(i,n,c.current,!1)}var ho=e=>typeof e=="string",m3=(e,t,n,r,o)=>ho(e)?(r&&t.watch.add(e),ye(n,e,o)):Array.isArray(e)?e.map(s=>(r&&t.watch.add(s),ye(n,s))):(r&&(t.watchAll=!0),n);function GQ(e){const t=oy(),{control:n=t.control,name:r,defaultValue:o,disabled:s,exact:i}=e||{},a=Oe.useRef(r);a.current=r,sy({disabled:s,subject:n._subjects.values,next:u=>{h3(a.current,u.name,i)&&c(In(m3(a.current,n._names,u.values||n._formValues,!1,o)))}});const[l,c]=Oe.useState(n._getWatch(r,o));return Oe.useEffect(()=>n._removeUnmounted()),l}function UQ(e){const t=oy(),{name:n,disabled:r,control:o=t.control,shouldUnregister:s}=e,i=f3(o._names.array,n),a=GQ({control:o,name:n,defaultValue:ye(o._formValues,n,ye(o._defaultValues,n,e.defaultValue)),exact:!0}),l=ZQ({control:o,name:n,exact:!0}),c=Oe.useRef(o.register(n,{...e.rules,value:a,...po(e.disabled)?{disabled:e.disabled}:{}}));return Oe.useEffect(()=>{const u=o._options.shouldUnregister||s,d=(p,y)=>{const h=ye(o._fields,p);h&&h._f&&(h._f.mount=y)};if(d(n,!0),u){const p=In(ye(o._options.defaultValues,n));xt(o._defaultValues,n,p),Ft(ye(o._formValues,n))&&xt(o._formValues,n,p)}return()=>{(i?u&&!o._state.action:u)?o.unregister(n):d(n,!1)}},[n,o,i,s]),Oe.useEffect(()=>{ye(o._fields,n)&&o._updateDisabledField({disabled:r,fields:o._fields,name:n,value:ye(o._fields,n)._f.value})},[r,n,o]),{field:{name:n,value:a,...po(r)||l.disabled?{disabled:l.disabled||r}:{},onChange:Oe.useCallback(u=>c.current.onChange({target:{value:u3(u),name:n},type:Rd.CHANGE}),[n]),onBlur:Oe.useCallback(()=>c.current.onBlur({target:{value:ye(o._formValues,n),name:n},type:Rd.BLUR}),[n,o]),ref:Oe.useCallback(u=>{const d=ye(o._fields,n);d&&u&&(d._f.ref={focus:()=>u.focus(),select:()=>u.select(),setCustomValidity:p=>u.setCustomValidity(p),reportValidity:()=>u.reportValidity()})},[o._fields,n])},formState:l,fieldState:Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!ye(l.errors,n)},isDirty:{enumerable:!0,get:()=>!!ye(l.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!ye(l.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!ye(l.validatingFields,n)},error:{enumerable:!0,get:()=>ye(l.errors,n)}})}}const ts=e=>e.render(UQ(e));var QQ=(e,t,n,r,o)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:o||!0}}:{},g1=e=>({isOnSubmit:!e||e===Zr.onSubmit,isOnBlur:e===Zr.onBlur,isOnChange:e===Zr.onChange,isOnAll:e===Zr.all,isOnTouch:e===Zr.onTouched}),y1=(e,t,n)=>!n&&(t.watchAll||t.watch.has(e)||[...t.watch].some(r=>e.startsWith(r)&&/^\.\w+/.test(e.slice(r.length))));const wc=(e,t,n,r)=>{for(const o of n||Object.keys(e)){const s=ye(e,o);if(s){const{_f:i,...a}=s;if(i){if(i.refs&&i.refs[0]&&t(i.refs[0],o)&&!r)break;if(i.ref&&t(i.ref,i.name)&&!r)break;wc(a,t)}else cn(a)&&wc(a,t)}}};var KQ=(e,t,n)=>{const r=xc(ye(e,n));return xt(r,"root",t[n]),xt(e,n,r),e},iy=e=>e.type==="file",ws=e=>typeof e=="function",kd=e=>{if(!ny)return!1;const t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Nf=e=>ho(e),ay=e=>e.type==="radio",Ed=e=>e instanceof RegExp;const b1={value:!1,isValid:!1},x1={value:!0,isValid:!0};var A3=e=>{if(Array.isArray(e)){if(e.length>1){const t=e.filter(n=>n&&n.checked&&!n.disabled).map(n=>n.value);return{value:t,isValid:!!t.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ft(e[0].attributes.value)?Ft(e[0].value)||e[0].value===""?x1:{value:e[0].value,isValid:!0}:x1:b1}return b1};const w1={isValid:!1,value:null};var P3=e=>Array.isArray(e)?e.reduce((t,n)=>n&&n.checked&&!n.disabled?{isValid:!0,value:n.value}:t,w1):w1;function H1(e,t,n="validate"){if(Nf(e)||Array.isArray(e)&&e.every(Nf)||po(e)&&!e)return{type:n,message:Nf(e)?e:"",ref:t}}var qi=e=>cn(e)&&!Ed(e)?e:{value:e,message:""},j1=async(e,t,n,r,o)=>{const{ref:s,refs:i,required:a,maxLength:l,minLength:c,min:u,max:d,pattern:p,validate:y,name:h,valueAsNumber:P,mount:x,disabled:A}=e._f,v=ye(t,h);if(!x||A)return{};const m=i?i[0]:s,w=R=>{r&&m.reportValidity&&(m.setCustomValidity(po(R)?"":R||""),m.reportValidity())},j={},z=ay(s),H=Ou(s),O=z||H,D=(P||iy(s))&&Ft(s.value)&&Ft(v)||kd(s)&&s.value===""||v===""||Array.isArray(v)&&!v.length,S=QQ.bind(null,h,n,j),I=(R,M,W,N=So.maxLength,Z=So.minLength)=>{const J=R?M:W;j[h]={type:R?N:Z,message:J,ref:s,...S(R?N:Z,J)}};if(o?!Array.isArray(v)||!v.length:a&&(!O&&(D||Mn(v))||po(v)&&!v||H&&!A3(i).isValid||z&&!P3(i).isValid)){const{value:R,message:M}=Nf(a)?{value:!!a,message:a}:qi(a);if(R&&(j[h]={type:So.required,message:M,ref:m,...S(So.required,M)},!n))return w(M),j}if(!D&&(!Mn(u)||!Mn(d))){let R,M;const W=qi(d),N=qi(u);if(!Mn(v)&&!isNaN(v)){const Z=s.valueAsNumber||v&&+v;Mn(W.value)||(R=Z>W.value),Mn(N.value)||(M=Znew Date(new Date().toDateString()+" "+K),T=s.type=="time",B=s.type=="week";ho(W.value)&&v&&(R=T?J(v)>J(W.value):B?v>W.value:Z>new Date(W.value)),ho(N.value)&&v&&(M=T?J(v)+R.value,N=!Mn(M.value)&&v.length<+M.value;if((W||N)&&(I(W,R.message,M.message),!n))return w(j[h].message),j}if(p&&!D&&ho(v)){const{value:R,message:M}=qi(p);if(Ed(R)&&!v.match(R)&&(j[h]={type:So.pattern,message:M,ref:s,...S(So.pattern,M)},!n))return w(M),j}if(y){if(ws(y)){const R=await y(v,t),M=H1(R,m);if(M&&(j[h]={...M,...S(So.validate,M.message)},!n))return w(M.message),j}else if(cn(y)){let R={};for(const M in y){if(!Fn(R)&&!n)break;const W=H1(await y[M](v,t),m,M);W&&(R={...W,...S(M,W.message)},w(W.message),n&&(j[h]=R))}if(!Fn(R)&&(j[h]={ref:m,...R},!n))return j}}return w(!0),j};function _Q(e,t){const n=t.slice(0,-1).length;let r=0;for(;r{let e=[];return{get observers(){return e},next:o=>{for(const s of e)s.next&&s.next(o)},subscribe:o=>(e.push(o),{unsubscribe:()=>{e=e.filter(s=>s!==o)}}),unsubscribe:()=>{e=[]}}},Md=e=>Mn(e)||!c3(e);function si(e,t){if(Md(e)||Md(t))return e===t;if(fa(e)&&fa(t))return e.getTime()===t.getTime();const n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(const o of n){const s=e[o];if(!r.includes(o))return!1;if(o!=="ref"){const i=t[o];if(fa(s)&&fa(i)||cn(s)&&cn(i)||Array.isArray(s)&&Array.isArray(i)?!si(s,i):s!==i)return!1}}return!0}var g3=e=>e.type==="select-multiple",eK=e=>ay(e)||Ou(e),Nh=e=>kd(e)&&e.isConnected,y3=e=>{for(const t in e)if(ws(e[t]))return!0;return!1};function Ld(e,t={}){const n=Array.isArray(e);if(cn(e)||n)for(const r in e)Array.isArray(e[r])||cn(e[r])&&!y3(e[r])?(t[r]=Array.isArray(e[r])?[]:{},Ld(e[r],t[r])):Mn(e[r])||(t[r]=!0);return t}function b3(e,t,n){const r=Array.isArray(e);if(cn(e)||r)for(const o in e)Array.isArray(e[o])||cn(e[o])&&!y3(e[o])?Ft(t)||Md(n[o])?n[o]=Array.isArray(e[o])?Ld(e[o],[]):{...Ld(e[o])}:b3(e[o],Mn(t)?{}:t[o],n[o]):n[o]=!si(e[o],t[o]);return n}var uf=(e,t)=>b3(e,t,Ld(t)),x3=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>Ft(e)?e:t?e===""?NaN:e&&+e:n&&ho(e)?new Date(e):r?r(e):e;function Bh(e){const t=e.ref;if(!(e.refs?e.refs.every(n=>n.disabled):t.disabled))return iy(t)?t.files:ay(t)?P3(e.refs).value:g3(t)?[...t.selectedOptions].map(({value:n})=>n):Ou(t)?A3(e.refs).value:x3(Ft(t.value)?e.ref.value:t.value,e)}var tK=(e,t,n,r)=>{const o={};for(const s of e){const i=ye(t,s);i&&xt(o,s,i._f)}return{criteriaMode:n,names:[...e],fields:o,shouldUseNativeValidation:r}},Vl=e=>Ft(e)?e:Ed(e)?e.source:cn(e)?Ed(e.value)?e.value.source:e.value:e,nK=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate);function z1(e,t,n){const r=ye(e,n);if(r||ry(n))return{error:r,name:n};const o=n.split(".");for(;o.length;){const s=o.join("."),i=ye(t,s),a=ye(e,s);if(i&&!Array.isArray(i)&&n!==s)return{name:n};if(a&&a.type)return{name:s,error:a};o.pop()}return{name:n}}var rK=(e,t,n,r,o)=>o.isOnAll?!1:!n&&o.isOnTouch?!(t||e):(n?r.isOnBlur:o.isOnBlur)?!e:(n?r.isOnChange:o.isOnChange)?e:!0,oK=(e,t)=>!Lv(ye(e,t)).length&&nn(e,t);const sK={mode:Zr.onSubmit,reValidateMode:Zr.onChange,shouldFocusError:!0};function iK(e={}){let t={...sK,...e},n={submitCount:0,isDirty:!1,isLoading:ws(t.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:t.errors||{},disabled:t.disabled||!1},r={},o=cn(t.defaultValues)||cn(t.values)?In(t.defaultValues||t.values)||{}:{},s=t.shouldUnregister?{}:In(o),i={action:!1,mount:!1,watch:!1},a={mount:new Set,unMount:new Set,array:new Set,watch:new Set},l,c=0;const u={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={values:Xh(),array:Xh(),state:Xh()},p=g1(t.mode),y=g1(t.reValidateMode),h=t.criteriaMode===Zr.all,P=C=>V=>{clearTimeout(c),c=setTimeout(C,V)},x=async C=>{if(u.isValid||C){const V=t.resolver?Fn((await O()).errors):await S(r,!0);V!==n.isValid&&d.state.next({isValid:V})}},A=(C,V)=>{(u.isValidating||u.validatingFields)&&((C||Array.from(a.mount)).forEach(Y=>{Y&&(V?xt(n.validatingFields,Y,V):nn(n.validatingFields,Y))}),d.state.next({validatingFields:n.validatingFields,isValidating:!Fn(n.validatingFields)}))},v=(C,V=[],Y,F,Q=!0,U=!0)=>{if(F&&Y){if(i.action=!0,U&&Array.isArray(ye(r,C))){const oe=Y(ye(r,C),F.argA,F.argB);Q&&xt(r,C,oe)}if(U&&Array.isArray(ye(n.errors,C))){const oe=Y(ye(n.errors,C),F.argA,F.argB);Q&&xt(n.errors,C,oe),oK(n.errors,C)}if(u.touchedFields&&U&&Array.isArray(ye(n.touchedFields,C))){const oe=Y(ye(n.touchedFields,C),F.argA,F.argB);Q&&xt(n.touchedFields,C,oe)}u.dirtyFields&&(n.dirtyFields=uf(o,s)),d.state.next({name:C,isDirty:R(C,V),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else xt(s,C,V)},m=(C,V)=>{xt(n.errors,C,V),d.state.next({errors:n.errors})},w=C=>{n.errors=C,d.state.next({errors:n.errors,isValid:!1})},j=(C,V,Y,F)=>{const Q=ye(r,C);if(Q){const U=ye(s,C,Ft(Y)?ye(o,C):Y);Ft(U)||F&&F.defaultChecked||V?xt(s,C,V?U:Bh(Q._f)):N(C,U),i.mount&&x()}},z=(C,V,Y,F,Q)=>{let U=!1,oe=!1;const ke={name:C},Je=!!(ye(r,C)&&ye(r,C)._f&&ye(r,C)._f.disabled);if(!Y||F){u.isDirty&&(oe=n.isDirty,n.isDirty=ke.isDirty=R(),U=oe!==ke.isDirty);const tt=Je||si(ye(o,C),V);oe=!!(!Je&&ye(n.dirtyFields,C)),tt||Je?nn(n.dirtyFields,C):xt(n.dirtyFields,C,!0),ke.dirtyFields=n.dirtyFields,U=U||u.dirtyFields&&oe!==!tt}if(Y){const tt=ye(n.touchedFields,C);tt||(xt(n.touchedFields,C,Y),ke.touchedFields=n.touchedFields,U=U||u.touchedFields&&tt!==Y)}return U&&Q&&d.state.next(ke),U?ke:{}},H=(C,V,Y,F)=>{const Q=ye(n.errors,C),U=u.isValid&&po(V)&&n.isValid!==V;if(e.delayError&&Y?(l=P(()=>m(C,Y)),l(e.delayError)):(clearTimeout(c),l=null,Y?xt(n.errors,C,Y):nn(n.errors,C)),(Y?!si(Q,Y):Q)||!Fn(F)||U){const oe={...F,...U&&po(V)?{isValid:V}:{},errors:n.errors,name:C};n={...n,...oe},d.state.next(oe)}},O=async C=>{A(C,!0);const V=await t.resolver(s,t.context,tK(C||a.mount,r,t.criteriaMode,t.shouldUseNativeValidation));return A(C),V},D=async C=>{const{errors:V}=await O(C);if(C)for(const Y of C){const F=ye(V,Y);F?xt(n.errors,Y,F):nn(n.errors,Y)}else n.errors=V;return V},S=async(C,V,Y={valid:!0})=>{for(const F in C){const Q=C[F];if(Q){const{_f:U,...oe}=Q;if(U){const ke=a.array.has(U.name);A([F],!0);const Je=await j1(Q,s,h,t.shouldUseNativeValidation&&!V,ke);if(A([F]),Je[U.name]&&(Y.valid=!1,V))break;!V&&(ye(Je,U.name)?ke?KQ(n.errors,Je,U.name):xt(n.errors,U.name,Je[U.name]):nn(n.errors,U.name))}!Fn(oe)&&await S(oe,V,Y)}}return Y.valid},I=()=>{for(const C of a.unMount){const V=ye(r,C);V&&(V._f.refs?V._f.refs.every(Y=>!Nh(Y)):!Nh(V._f.ref))&&re(C)}a.unMount=new Set},R=(C,V)=>(C&&V&&xt(s,C,V),!si(fe(),o)),M=(C,V,Y)=>m3(C,a,{...i.mount?s:Ft(V)?o:ho(C)?{[C]:V}:V},Y,V),W=C=>Lv(ye(i.mount?s:o,C,e.shouldUnregister?ye(o,C,[]):[])),N=(C,V,Y={})=>{const F=ye(r,C);let Q=V;if(F){const U=F._f;U&&(!U.disabled&&xt(s,C,x3(V,U)),Q=kd(U.ref)&&Mn(V)?"":V,g3(U.ref)?[...U.ref.options].forEach(oe=>oe.selected=Q.includes(oe.value)):U.refs?Ou(U.ref)?U.refs.length>1?U.refs.forEach(oe=>(!oe.defaultChecked||!oe.disabled)&&(oe.checked=Array.isArray(Q)?!!Q.find(ke=>ke===oe.value):Q===oe.value)):U.refs[0]&&(U.refs[0].checked=!!Q):U.refs.forEach(oe=>oe.checked=oe.value===Q):iy(U.ref)?U.ref.value="":(U.ref.value=Q,U.ref.type||d.values.next({name:C,values:{...s}})))}(Y.shouldDirty||Y.shouldTouch)&&z(C,Q,Y.shouldTouch,Y.shouldDirty,!0),Y.shouldValidate&&K(C)},Z=(C,V,Y)=>{for(const F in V){const Q=V[F],U=`${C}.${F}`,oe=ye(r,U);(a.array.has(C)||!Md(Q)||oe&&!oe._f)&&!fa(Q)?Z(U,Q,Y):N(U,Q,Y)}},J=(C,V,Y={})=>{const F=ye(r,C),Q=a.array.has(C),U=In(V);xt(s,C,U),Q?(d.array.next({name:C,values:{...s}}),(u.isDirty||u.dirtyFields)&&Y.shouldDirty&&d.state.next({name:C,dirtyFields:uf(o,s),isDirty:R(C,U)})):F&&!F._f&&!Mn(U)?Z(C,U,Y):N(C,U,Y),y1(C,a)&&d.state.next({...n}),d.values.next({name:i.mount?C:void 0,values:{...s}})},T=async C=>{i.mount=!0;const V=C.target;let Y=V.name,F=!0;const Q=ye(r,Y),U=()=>V.type?Bh(Q._f):u3(C),oe=ke=>{F=Number.isNaN(ke)||ke===ye(s,Y,ke)};if(Q){let ke,Je;const tt=U(),Xe=C.type===Rd.BLUR||C.type===Rd.FOCUS_OUT,he=!nK(Q._f)&&!t.resolver&&!ye(n.errors,Y)&&!Q._f.deps||rK(Xe,ye(n.touchedFields,Y),n.isSubmitted,y,p),Qe=y1(Y,a,Xe);xt(s,Y,tt),Xe?(Q._f.onBlur&&Q._f.onBlur(C),l&&l(0)):Q._f.onChange&&Q._f.onChange(C);const mt=z(Y,tt,Xe,!1),jt=!Fn(mt)||Qe;if(!Xe&&d.values.next({name:Y,type:C.type,values:{...s}}),he)return u.isValid&&x(),jt&&d.state.next({name:Y,...Qe?{}:mt});if(!Xe&&Qe&&d.state.next({...n}),t.resolver){const{errors:je}=await O([Y]);if(oe(tt),F){const Ge=z1(n.errors,r,Y),X=z1(je,r,Ge.name||Y);ke=X.error,Y=X.name,Je=Fn(je)}}else A([Y],!0),ke=(await j1(Q,s,h,t.shouldUseNativeValidation))[Y],A([Y]),oe(tt),F&&(ke?Je=!1:u.isValid&&(Je=await S(r,!0)));F&&(Q._f.deps&&K(Q._f.deps),H(Y,Je,ke,mt))}},B=(C,V)=>{if(ye(n.errors,V)&&C.focus)return C.focus(),1},K=async(C,V={})=>{let Y,F;const Q=xc(C);if(t.resolver){const U=await D(Ft(C)?C:Q);Y=Fn(U),F=C?!Q.some(oe=>ye(U,oe)):Y}else C?(F=(await Promise.all(Q.map(async U=>{const oe=ye(r,U);return await S(oe&&oe._f?{[U]:oe}:oe)}))).every(Boolean),!(!F&&!n.isValid)&&x()):F=Y=await S(r);return d.state.next({...!ho(C)||u.isValid&&Y!==n.isValid?{}:{name:C},...t.resolver||!C?{isValid:Y}:{},errors:n.errors}),V.shouldFocus&&!F&&wc(r,B,C?Q:a.mount),F},fe=C=>{const V={...i.mount?s:o};return Ft(C)?V:ho(C)?ye(V,C):C.map(Y=>ye(V,Y))},E=(C,V)=>({invalid:!!ye((V||n).errors,C),isDirty:!!ye((V||n).dirtyFields,C),error:ye((V||n).errors,C),isValidating:!!ye(n.validatingFields,C),isTouched:!!ye((V||n).touchedFields,C)}),ee=C=>{C&&xc(C).forEach(V=>nn(n.errors,V)),d.state.next({errors:C?n.errors:{}})},G=(C,V,Y)=>{const F=(ye(r,C,{_f:{}})._f||{}).ref,Q=ye(n.errors,C)||{},{ref:U,message:oe,type:ke,...Je}=Q;xt(n.errors,C,{...Je,...V,ref:F}),d.state.next({name:C,errors:n.errors,isValid:!1}),Y&&Y.shouldFocus&&F&&F.focus&&F.focus()},ie=(C,V)=>ws(C)?d.values.subscribe({next:Y=>C(M(void 0,V),Y)}):M(C,V,!0),re=(C,V={})=>{for(const Y of C?xc(C):a.mount)a.mount.delete(Y),a.array.delete(Y),V.keepValue||(nn(r,Y),nn(s,Y)),!V.keepError&&nn(n.errors,Y),!V.keepDirty&&nn(n.dirtyFields,Y),!V.keepTouched&&nn(n.touchedFields,Y),!V.keepIsValidating&&nn(n.validatingFields,Y),!t.shouldUnregister&&!V.keepDefaultValue&&nn(o,Y);d.values.next({values:{...s}}),d.state.next({...n,...V.keepDirty?{isDirty:R()}:{}}),!V.keepIsValid&&x()},me=({disabled:C,name:V,field:Y,fields:F,value:Q})=>{if(po(C)&&i.mount||C){const U=C?void 0:Ft(Q)?Bh(Y?Y._f:ye(F,V)._f):Q;xt(s,V,U),z(V,U,!1,!1,!0)}},ue=(C,V={})=>{let Y=ye(r,C);const F=po(V.disabled);return xt(r,C,{...Y||{},_f:{...Y&&Y._f?Y._f:{ref:{name:C}},name:C,mount:!0,...V}}),a.mount.add(C),Y?me({field:Y,disabled:V.disabled,name:C,value:V.value}):j(C,!0,V.value),{...F?{disabled:V.disabled}:{},...t.progressive?{required:!!V.required,min:Vl(V.min),max:Vl(V.max),minLength:Vl(V.minLength),maxLength:Vl(V.maxLength),pattern:Vl(V.pattern)}:{},name:C,onChange:T,onBlur:T,ref:Q=>{if(Q){ue(C,V),Y=ye(r,C);const U=Ft(Q.value)&&Q.querySelectorAll&&Q.querySelectorAll("input,select,textarea")[0]||Q,oe=eK(U),ke=Y._f.refs||[];if(oe?ke.find(Je=>Je===U):U===Y._f.ref)return;xt(r,C,{_f:{...Y._f,...oe?{refs:[...ke.filter(Nh),U,...Array.isArray(ye(o,C))?[{}]:[]],ref:{type:U.type,name:C}}:{ref:U}}}),j(C,!1,void 0,U)}else Y=ye(r,C,{}),Y._f&&(Y._f.mount=!1),(t.shouldUnregister||V.shouldUnregister)&&!(f3(a.array,C)&&i.action)&&a.unMount.add(C)}}},se=()=>t.shouldFocusError&&wc(r,B,a.mount),de=C=>{po(C)&&(d.state.next({disabled:C}),wc(r,(V,Y)=>{const F=ye(r,Y);F&&(V.disabled=F._f.disabled||C,Array.isArray(F._f.refs)&&F._f.refs.forEach(Q=>{Q.disabled=F._f.disabled||C}))},0,!1))},He=(C,V)=>async Y=>{let F;Y&&(Y.preventDefault&&Y.preventDefault(),Y.persist&&Y.persist());let Q=In(s);if(d.state.next({isSubmitting:!0}),t.resolver){const{errors:U,values:oe}=await O();n.errors=U,Q=oe}else await S(r);if(nn(n.errors,"root"),Fn(n.errors)){d.state.next({errors:{}});try{await C(Q,Y)}catch(U){F=U}}else V&&await V({...n.errors},Y),se(),setTimeout(se);if(d.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Fn(n.errors)&&!F,submitCount:n.submitCount+1,errors:n.errors}),F)throw F},we=(C,V={})=>{ye(r,C)&&(Ft(V.defaultValue)?J(C,In(ye(o,C))):(J(C,V.defaultValue),xt(o,C,In(V.defaultValue))),V.keepTouched||nn(n.touchedFields,C),V.keepDirty||(nn(n.dirtyFields,C),n.isDirty=V.defaultValue?R(C,In(ye(o,C))):R()),V.keepError||(nn(n.errors,C),u.isValid&&x()),d.state.next({...n}))},be=(C,V={})=>{const Y=C?In(C):o,F=In(Y),Q=Fn(C),U=Q?o:F;if(V.keepDefaultValues||(o=Y),!V.keepValues){if(V.keepDirtyValues)for(const oe of a.mount)ye(n.dirtyFields,oe)?xt(U,oe,ye(s,oe)):J(oe,ye(U,oe));else{if(ny&&Ft(C))for(const oe of a.mount){const ke=ye(r,oe);if(ke&&ke._f){const Je=Array.isArray(ke._f.refs)?ke._f.refs[0]:ke._f.ref;if(kd(Je)){const tt=Je.closest("form");if(tt){tt.reset();break}}}}r={}}s=e.shouldUnregister?V.keepDefaultValues?In(o):{}:In(U),d.array.next({values:{...U}}),d.values.next({values:{...U}})}a={mount:V.keepDirtyValues?a.mount:new Set,unMount:new Set,array:new Set,watch:new Set,watchAll:!1,focus:""},i.mount=!u.isValid||!!V.keepIsValid||!!V.keepDirtyValues,i.watch=!!e.shouldUnregister,d.state.next({submitCount:V.keepSubmitCount?n.submitCount:0,isDirty:Q?!1:V.keepDirty?n.isDirty:!!(V.keepDefaultValues&&!si(C,o)),isSubmitted:V.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:Q?{}:V.keepDirtyValues?V.keepDefaultValues&&s?uf(o,s):n.dirtyFields:V.keepDefaultValues&&C?uf(o,C):V.keepDirty?n.dirtyFields:{},touchedFields:V.keepTouched?n.touchedFields:{},errors:V.keepErrors?n.errors:{},isSubmitSuccessful:V.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1})},Ie=(C,V)=>be(ws(C)?C(s):C,V);return{control:{register:ue,unregister:re,getFieldState:E,handleSubmit:He,setError:G,_executeSchema:O,_getWatch:M,_getDirty:R,_updateValid:x,_removeUnmounted:I,_updateFieldArray:v,_updateDisabledField:me,_getFieldArray:W,_reset:be,_resetDefaultValues:()=>ws(t.defaultValues)&&t.defaultValues().then(C=>{Ie(C,t.resetOptions),d.state.next({isLoading:!1})}),_updateFormState:C=>{n={...n,...C}},_disableForm:de,_subjects:d,_proxyFormState:u,_setErrors:w,get _fields(){return r},get _formValues(){return s},get _state(){return i},set _state(C){i=C},get _defaultValues(){return o},get _names(){return a},set _names(C){a=C},get _formState(){return n},set _formState(C){n=C},get _options(){return t},set _options(C){t={...t,...C}}},trigger:K,register:ue,handleSubmit:He,watch:ie,setValue:J,getValues:fe,reset:Ie,resetField:we,clearErrors:ee,unregister:re,setError:G,setFocus:(C,V={})=>{const Y=ye(r,C),F=Y&&Y._f;if(F){const Q=F.refs?F.refs[0]:F.ref;Q.focus&&(Q.focus(),V.shouldSelect&&Q.select())}},getFieldState:E}}function aK(e={}){const t=Oe.useRef(),n=Oe.useRef(),[r,o]=Oe.useState({isDirty:!1,isValidating:!1,isLoading:ws(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ws(e.defaultValues)?void 0:e.defaultValues});t.current||(t.current={...iK(e),formState:r});const s=t.current.control;return s._options=e,sy({subject:s._subjects.state,next:i=>{v3(i,s._proxyFormState,s._updateFormState,!0)&&o({...s._formState})}}),Oe.useEffect(()=>s._disableForm(e.disabled),[s,e.disabled]),Oe.useEffect(()=>{if(s._proxyFormState.isDirty){const i=s._getDirty();i!==r.isDirty&&s._subjects.state.next({isDirty:i})}},[s,r.isDirty]),Oe.useEffect(()=>{e.values&&!si(e.values,n.current)?(s._reset(e.values,s._options.resetOptions),n.current=e.values,o(i=>({...i}))):s._resetDefaultValues()},[e.values,s]),Oe.useEffect(()=>{e.errors&&s._setErrors(e.errors)},[e.errors,s]),Oe.useEffect(()=>{s._state.mount||(s._updateValid(),s._state.mount=!0),s._state.watch&&(s._state.watch=!1,s._subjects.state.next({...s._formState})),s._removeUnmounted()}),Oe.useEffect(()=>{e.shouldUnregister&&s._subjects.values.next({values:s._getWatch()})},[e.shouldUnregister,s]),t.current.formState=p3(r,s),t.current}const Ki=_("div")(()=>({paddingBottom:"30px"})),lK=({label:e,required:t,style:n})=>f.jsxs("span",{style:{backgroundColor:"#fafafa",padding:"0 2px",...n},children:[t&&f.jsx("span",{style:{color:(n==null?void 0:n.requiredColor)||"inherit"},children:"*"}),e]}),w3=({id:e})=>{var Y;const t=hg(),[n,r]=g.useState(!1),[o]=Ve(Ko),[s,i]=g.useState(""),a=g.useRef(null),l=g.useRef(null),[c,u]=g.useState(!1),d=g.useRef(null),p=g.useRef(null),y=F=>{F&&(F.style.height="auto",F.style.height=F.scrollHeight+"px")},[,h]=Ve(eo),[P,x]=Ve(x5),[A,v]=Ve(b5),[m,w]=Ve(H5),[j,z]=Ve(w5),[H,O]=g.useState(!1),[D,S]=g.useState([]),[I,R]=g.useState([]),[M,W]=g.useState(!1),[N,Z]=g.useState(null),{data:J,error:T}=Ln({queryKey:["app-form",e],queryFn:()=>Yt.get(`/server/${e}`).then(F=>F.data),enabled:!!e}),{data:B,isLoading:K}=Ln({queryKey:["app-frameworks"],queryFn:()=>Yt.get("/frameworks/").then(F=>F.data)}),{data:fe,isLoading:E}=Ln({queryKey:["app-environments"],queryFn:()=>Yt.get("/conda-environments/").then(F=>F.data)}),{data:ee,isLoading:G}=Ln({queryKey:["app-profiles"],queryFn:()=>Yt.get("/spawner-profiles/").then(F=>F.data)}),{control:ie,handleSubmit:re,setFocus:me,reset:ue,watch:se,formState:{errors:de}}=aK({defaultValues:{display_name:"",description:"",framework:"",thumbnail:"",filepath:"",conda_env:"",custom_command:"",profile:"",is_public:!1,keep_alive:!1}}),He=se("framework");g.useEffect(()=>{const F=a.current,Q=()=>{l.current&&a.current&&(l.current.scrollTop=a.current.scrollTop)};return F==null||F.addEventListener("scroll",Q),()=>F==null?void 0:F.removeEventListener("scroll",Q)},[]);const we=()=>{const F=s.slice(0,200),Q=s.slice(200);return f.jsxs(f.Fragment,{children:[F,f.jsx("span",{style:{color:"red"},children:Q})]})};function be(F){u(F)}const Ie=({display_name:F,description:Q,framework:U,thumbnail:oe,filepath:ke,conda_env:Je,custom_command:tt,profile:Xe})=>{const he=_G(F);if(ee&&ee.length>0){const Qe={jhub_app:!0,display_name:he,description:Q,framework:U,thumbnail:oe,filepath:ke,conda_env:Je,env:xA(N),custom_command:tt,profile:Xe,is_public:H,share_with:{users:D,groups:I},keep_alive:M};x(Qe),t(`/server-types${e?`?id=${e}`:""}`)}else{const Qe={servername:A||he,user_options:{jhub_app:!0,name:A||he,display_name:he,description:Q||"",framework:U,thumbnail:oe||"",filepath:ke||"",conda_env:Je||"",env:xA(N),custom_command:tt||"",profile:Xe||"",public:H,share_with:{users:D,groups:I},keep_alive:M}};r(!0),e?C(Qe,{onSuccess:async()=>{window.location.assign($t)},onError:async mt=>{r(!1),h(mt.message)}}):nt(Qe,{onSuccess:async mt=>{const jt=o==null?void 0:o.name;if(jt&&(mt==null?void 0:mt.length)>1){const je=mt[1];window.location.assign(`${$t}/spawn-pending/${jt}/${je}`)}},onError:async mt=>{r(!1),h(mt.message)}})}},Ee=async({servername:F,user_options:Q})=>{const U={accept:"application/json","Content-Type":"multipart/form-data"},oe=new FormData;return oe.append("data",JSON.stringify({servername:F,user_options:Q})),m&&oe.append("thumbnail",m),(await Yt.post("/server",oe,{headers:U})).data},ge=async({servername:F,user_options:Q})=>{const U={accept:"application/json","Content-Type":"multipart/form-data"},oe=new FormData;return oe.append("data",JSON.stringify({servername:F,user_options:Q})),m?oe.append("thumbnail",m):j&&oe.append("thumbnail_data_url",j),(await Yt.put(`/server/${F}`,oe,{headers:U})).data},{mutate:nt}=$a({mutationFn:Ee,retry:1}),{mutate:C}=$a({mutationFn:ge,retry:1});g.useEffect(()=>{var F,Q;J!=null&&J.name&&(J!=null&&J.user_options)&&(v(J.name),i(J.user_options.description),ue({...J.user_options}),O(J.user_options.public),W(J.user_options.keep_alive),Z(J.user_options.env||null),z(J.user_options.thumbnail),S((F=J.user_options.share_with)==null?void 0:F.users),R((Q=J.user_options.share_with)==null?void 0:Q.groups))},[J,J==null?void 0:J.name,J==null?void 0:J.user_options,ue,z,v]),g.useEffect(()=>{var F,Q;P&&(ue({display_name:P.display_name||"",description:P.description||"",framework:P.framework||"",filepath:P.filepath||"",conda_env:P.conda_env||"",custom_command:P.custom_command||"",profile:P.profile||""}),O(P.is_public),W(P.keep_alive),Z(P.env||null),z(P.thumbnail),S((F=P.share_with)==null?void 0:F.users),R((Q=P.share_with)==null?void 0:Q.groups))},[P,ue,z,v]),g.useEffect(()=>{T&&h(T.message)},[T,h]);const V=g.useCallback(()=>{const F=Q=>{if(Q){const oe=Q.getBoundingClientRect(),ke=window.scrollY||window.scrollY,Je=oe.top+ke-120;window.scrollTo({top:Je,behavior:"smooth"}),setTimeout(()=>{},500)}};setTimeout(()=>{requestAnimationFrame(()=>{de.display_name?(F(document.getElementById("display_name")),me("display_name")):de.framework?(F(document.getElementById("framework")),me("framework")):de.custom_command?(F(document.getElementById("custom_command")),me("custom_command")):de.conda_env&&(F(document.getElementById("conda_env")),me("conda_env"))})},0)},[de,me]);return g.useEffect(()=>{Object.keys(de).length>0&&V()},[de,V]),f.jsxs("form",{id:"app-form",onSubmit:re(Ie,V),className:"form",noValidate:!0,children:[f.jsxs(Ki,{ref:p,children:[f.jsx(Ue,{component:"h2",variant:"subtitle1",children:"App Info"}),f.jsx(ts,{name:"display_name",control:ie,rules:{required:!0},render:({field:{ref:F,...Q}})=>f.jsxs(Ro,{error:!!de.display_name,children:[de.display_name&&f.jsxs(Fe,{display:"flex",alignItems:"center",color:"error.main",mb:2,children:[f.jsx(ec,{fontSize:"small"}),f.jsx(Ue,{variant:"body2",color:"error",ml:1,children:"Enter an app name"})]}),f.jsx(Rs,{...Q,id:"display_name",label:f.jsx(lK,{label:"Name",required:!0}),placeholder:"Add app name",inputRef:U=>{F(U),de.display_name&&(d.current=U)},autoFocus:!0,error:!!de.display_name,inputProps:{maxLength:255},helperText:f.jsx("span",{style:{fontSize:"12px",color:de.display_name?"error":"textSecondary"},children:"*Required"}),InputLabelProps:{shrink:!0},InputProps:{startAdornment:f.jsx(og,{position:"start"})}})]})}),f.jsx(ts,{name:"description",control:ie,render:({field:F})=>f.jsxs(Ro,{fullWidth:!0,className:"form-control outer-div",variant:"outlined",style:{position:"relative"},children:[f.jsx("label",{htmlFor:"description",className:"description-label",style:{position:"absolute",top:"0",left:"10px",transform:"translate(0, -50%)",color:c?"#ba18da":"#646464",backgroundColor:"#fafafa",padding:"0 4px",zIndex:1},children:"Description"}),f.jsx("textarea",{...F,ref:a,id:"description",value:s,onChange:Q=>{i(Q.target.value),F.onChange(Q.target.value),y(Q.target)},onFocus:()=>be(!0),onBlur:()=>{F.onBlur(),be(!1)},className:"description_text-field",placeholder:"Add app description (max. 200 characters)",style:{paddingBottom:"8px",borderColor:c?"#ba18da":"#ccc",letterSpacing:".15px",backgroundColor:"#FAFAFA"}}),f.jsx("div",{ref:l,className:"overlay-text",children:we()}),f.jsxs(Sf,{className:"form-helper-text",style:{textAlign:"right",marginRight:"0",fontSize:"1rem",color:s.length>200?"red":"inherit"},children:[s.length,"/200"]})]})})]}),f.jsxs(Ki,{children:[f.jsx(Ue,{component:"h2",variant:"subtitle1",children:"Configuration"}),f.jsx(ts,{name:"framework",control:ie,rules:{required:!0},render:({field:{ref:F,...Q}})=>f.jsxs(Ro,{error:!!de.framework,fullWidth:!0,variant:"outlined",children:[de.framework&&f.jsxs(Fe,{display:"flex",alignItems:"center",color:"error.main",mb:2,children:[f.jsx(ec,{fontSize:"small"}),f.jsx(Ue,{variant:"body2",color:"error",ml:1,children:"Select a framework"})]}),f.jsx(qm,{id:"framework-label",shrink:!0,sx:{fontSize:"1rem",transform:"translate(14px, -6px) scale(0.75)",color:de.framework?"#f44336":"rgba(0, 0, 0, 0.54)",top:de.framework?"33px":"0",left:"-4px",padding:"0 4px",zIndex:1,position:"absolute",pointerEvents:"none",transition:"color 0.3s ease"},children:"*Framework"}),f.jsxs(yd,{...Q,id:"framework",error:!!de.framework,displayEmpty:!0,labelId:"framework-label",label:"Framework",sx:{"& .MuiOutlinedInput-notchedOutline":{borderColor:de.framework?"#f44336":"rgba(0, 0, 0, 0.23)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:de.framework?"#f44336":"rgba(0, 0, 0, 0.87)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:de.framework?"#f44336":"#BA18DA"}},inputProps:{"aria-label":"Select framework"},children:[f.jsx(vo,{value:"",disabled:!0,children:"Select framework"}),B==null?void 0:B.map(U=>f.jsx(vo,{value:U.name,children:U.display_name},U.name))]}),f.jsx(Sf,{children:"*Required"})]})}),He==="custom"?f.jsx(ts,{name:"custom_command",control:ie,rules:{required:!0},render:({field:{ref:F,...Q}})=>f.jsxs(Ro,{error:!!de.custom_command,fullWidth:!0,variant:"outlined",sx:{mb:3},children:[de.custom_command&&f.jsxs(Fe,{display:"flex",alignItems:"center",color:"error.main",mb:2,children:[f.jsx(ec,{fontSize:"small"}),f.jsx(Ue,{variant:"body2",color:"error",ml:1,children:"Enter a custom command"})]}),f.jsx(Rs,{...Q,id:"custom_command",label:"*Custom Command",placeholder:"Enter custom command",inputRef:U=>{F(U),de.custom_command&&(d.current=U)},autoFocus:!!de.custom_command,error:!!de.custom_command,inputProps:{maxLength:255},helperText:f.jsx("span",{style:{fontSize:"12px",color:de.custom_command?"error":"textSecondary"},children:"*Required"}),InputProps:{style:de.custom_command?{borderColor:"#d32f2f"}:{}},InputLabelProps:{style:{fontSize:"1rem",transform:"translate(14px, -6px) scale(0.75)",color:de.custom_command?"#d32f2f":"rgba(0, 0, 0, 0.54)",top:"-3px",position:"absolute",pointerEvents:"none",transition:"color 0.3s ease"},shrink:!0},onFocus:()=>u(!0),onBlur:()=>u(!1)})]})}):f.jsx(f.Fragment,{}),fe&&fe.length>0?f.jsx(ts,{name:"conda_env",control:ie,rules:{required:!0},render:({field:{ref:F,...Q}})=>f.jsxs(Ro,{error:!!de.conda_env,fullWidth:!0,variant:"outlined",children:[de.conda_env&&f.jsxs(Fe,{display:"flex",alignItems:"center",color:"error.main",mb:2,children:[f.jsx(ec,{fontSize:"small"}),f.jsx(Ue,{variant:"body2",color:"error",ml:1,children:"Select a software environment"})]}),f.jsx(qm,{id:"conda_env-label",shrink:!0,sx:{fontSize:"1rem",transform:"translate(14px, -6px) scale(0.75)",color:de.conda_env?"#f44336":"rgba(0, 0, 0, 0.54)",top:de.conda_env?"33px":"-2px",left:"-5px",padding:"0 4px",zIndex:1},children:"*Software Environment"}),f.jsxs(yd,{...Q,id:"conda_env",error:!!de.conda_env,displayEmpty:!0,labelId:"conda_env-label",label:"Software Environment",sx:{"& .MuiOutlinedInput-notchedOutline":{borderColor:de.conda_env?"#f44336":"rgba(0, 0, 0, 0.23)"},"&:hover .MuiOutlinedInput-notchedOutline":{borderColor:de.conda_env?"#f44336":"rgba(0, 0, 0, 0.87)"},"&.Mui-focused .MuiOutlinedInput-notchedOutline":{borderColor:de.conda_env?"#f44336":"#BA18DA"}},inputProps:{"aria-label":"Select software environment"},children:[f.jsx(vo,{value:"",disabled:!0,children:"Select software environment"}),fe.map(U=>f.jsx(vo,{value:U,children:U},U))]}),f.jsx(Sf,{children:"*Required"})]})}):f.jsx(f.Fragment,{}),f.jsx(ts,{name:"filepath",control:ie,render:({field:{ref:F,...Q}})=>f.jsx(Ro,{children:f.jsx(Rs,{...Q,id:"filepath",label:"File path",placeholder:'Enter the path to the file, e.g. "/shared/users/panel_basic.py"',error:!!de.filepath})})}),f.jsxs(Fe,{sx:{display:"flex",flexDirection:"row"},children:[f.jsx(ag,{placement:"bottom-start",title:f.jsx("span",{style:{fontSize:"10px",fontWeight:600},children:"Keep alive prevents the app from being suspended even when not in active use. Your app will be instantly available, but it will consume resources until manually stopped."}),children:f.jsx(N5,{fontSize:"small",sx:{position:"relative",top:"9px",left:"2px",color:"#0F10158F"}})}),f.jsx(ts,{name:"keep_alive",control:ie,render:({field:{ref:F,value:Q,onChange:U,...oe}})=>f.jsx(Ro,{sx:{flexDirection:"row"},children:f.jsx(ri,{control:f.jsx(w9,{...oe,id:"keep_alive",checked:M,onChange:()=>{W(!M)}}),label:"Keep app alive",labelPlacement:"start"})})})]})]}),f.jsxs(Ki,{children:[f.jsx(Ue,{component:"h2",variant:"subtitle1",children:"Environment Variables"}),f.jsx(TK,{variables:N,setVariables:Z})]}),f.jsxs(Ki,{children:[f.jsx(Ue,{component:"h2",variant:"subtitle1",children:"Sharing"}),f.jsx(xK,{url:J==null?void 0:J.url,permissions:(Y=J==null?void 0:J.user_options)==null?void 0:Y.share_with,isPublic:H,setCurrentUserPermissions:S,setCurrentGroupPermissions:R,setIsPublic:O})]}),f.jsxs(Ki,{sx:{pb:"36px"},children:[f.jsx(Ue,{component:"h2",variant:"subtitle1",children:"Custom Thumbnail"}),f.jsx(ts,{name:"thumbnail",control:ie,render:({field:{ref:F,value:Q,onChange:U,...oe}})=>f.jsx(Ro,{sx:{pb:0},children:f.jsx(i_,{...oe,id:"thumbnail",currentImage:j,setCurrentImage:z,currentFile:m,setCurrentFile:w})})})]}),f.jsx("hr",{}),f.jsxs("div",{className:"button-section",children:[f.jsx("div",{className:"prev",children:f.jsx(at,{id:"cancel-btn",type:"button",variant:"text",color:"primary",onClick:()=>Bo(`${$t}`),children:"Cancel"})}),f.jsx("div",{className:"next",children:f.jsx(at,{id:"submit-btn",type:"submit",variant:"contained",color:"primary",disabled:K||E||G||n||s.length>200,children:ee&&ee.length>0?f.jsx(f.Fragment,{children:"Next"}):e?f.jsx(f.Fragment,{children:"Save"}):f.jsx(f.Fragment,{children:"Deploy App"})})})]})]})};var ly={},cK=ct;Object.defineProperty(ly,"__esModule",{value:!0});var H3=ly.default=void 0,uK=cK(ut()),fK=f;H3=ly.default=(0,uK.default)((0,fK.jsx)("path",{d:"M15 20H5V7c0-.55-.45-1-1-1s-1 .45-1 1v13c0 1.1.9 2 2 2h10c.55 0 1-.45 1-1s-.45-1-1-1m5-4V4c0-1.1-.9-2-2-2H9c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h9c1.1 0 2-.9 2-2m-2 0H9V4h9z"}),"ContentCopyRounded");var cy={},dK=ct;Object.defineProperty(cy,"__esModule",{value:!0});var j3=cy.default=void 0,pK=dK(ut()),vK=f;j3=cy.default=(0,pK.default)((0,vK.jsx)("path",{d:"M15.41 16.59 10.83 12l4.58-4.59L14 6l-6 6 6 6z"}),"KeyboardArrowLeft");var uy={},hK=ct;Object.defineProperty(uy,"__esModule",{value:!0});var z3=uy.default=void 0,mK=hK(ut()),AK=f;z3=uy.default=(0,mK.default)((0,AK.jsx)("path",{d:"M8.59 16.59 13.17 12 8.59 7.41 10 6l6 6-6 6z"}),"KeyboardArrowRight");var fy={},PK=ct;Object.defineProperty(fy,"__esModule",{value:!0});var O3=fy.default=void 0,gK=PK(ut()),yK=f;O3=fy.default=(0,gK.default)((0,yK.jsx)("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3M12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1m1 4h-2v-2h2z"}),"WarningRounded");const ot=_("div")(({theme:e})=>({padding:e.spacing(0)}));function bK(e){const{count:t,page:n,rowsPerPage:r,onPageChange:o}=e,s=a=>{o(a,n-1)},i=a=>{o(a,n+1)};return f.jsxs(Fe,{sx:{flexShrink:0,ml:2.5},children:[f.jsx(Zn,{onClick:s,disabled:n===0,"aria-label":"previous page","data-testid":"previous-page",children:f.jsx(j3,{})}),f.jsx(Zn,{onClick:i,disabled:n>=Math.ceil(t/r)-1,"aria-label":"next page","data-testid":"next-page",children:f.jsx(z3,{})})]})}const xK=({url:e,permissions:t,isPublic:n,setCurrentUserPermissions:r,setCurrentGroupPermissions:o,setIsPublic:s})=>{const[i]=Ve(Ko),[a]=g.useState("Adding individuals or groups will allow others to access this app."),[l,c]=g.useState(!1),[u,d]=g.useState([]),[p,y]=g.useState([]),[h,P]=g.useState([]),[x,A]=g.useState(0),[v]=g.useState(5),[m,w]=g.useState([]),j=()=>{if(p.length>0){const H=[...new Set([...h,...p])];P(H),o(()=>H.filter(O=>O.type==="group").map(O=>O.name)),r(()=>H.filter(O=>O.type==="user").map(O=>O.name))}w([])},z=(H,O)=>{H&&A(O)};return g.useEffect(()=>{if(i&&i.share_permissions){const H=[];H.push(...i.share_permissions.users.map(O=>({name:O,type:"user"}))),H.push(...i.share_permissions.groups.map(O=>({name:O,type:"group"}))),d(H)}},[i]),g.useEffect(()=>{if(t){const H=[];H.push(...t.users.map(O=>({name:O,type:"user"}))),H.push(...t.groups.map(O=>({name:O,type:"group"}))),P(H)}},[t]),f.jsx(Fe,{id:"app-sharing",children:f.jsxs(Ho,{direction:"column",children:[i!=null&&i.share_permissions?f.jsxs(f.Fragment,{children:[f.jsx(ot,{children:f.jsx(ZP,{id:"sharing-notification",severity:"warning",icon:f.jsx(O3,{sx:{color:"#EAB54E",top:"-2px",position:"relative"}}),sx:{mb:"16px",position:"relative"},children:a})}),f.jsxs(ot,{sx:{pb:"8px"},children:[f.jsx(Ue,{variant:"subtitle1",sx:{fontWeight:400,pb:0},children:"Individuals and group access"}),f.jsxs(Fe,{sx:{display:"flex",flexDirection:"row",width:"100%",gap:"8px",py:"16px"},children:[f.jsx(Fe,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-start"},children:f.jsx(nk,{disablePortal:!0,id:"share-permissions-autocomplete",options:u,getOptionLabel:H=>H.type==="user"?H.name:`${H.name} (Group)`,multiple:!0,disableCloseOnSelect:!0,clearOnBlur:!0,limitTags:2,sx:{width:510},renderInput:H=>f.jsx(Rs,{...H,placeholder:m.length>0?void 0:"Search one or more usernames or group names"}),value:m,onChange:(H,O)=>{H&&O&&(y(O),w(O))}})}),f.jsx(Fe,{sx:{display:"flex",flexDirection:"row",justifyContent:"flex-end",margin:"auto auto"},children:f.jsx(at,{variant:"contained",color:"primary",onClick:j,disabled:p.length===0,sx:{height:"42px",px:"22px",py:"8px"},children:"Share"})})]})]}),h.length>0?f.jsx(ot,{sx:{pb:"20px"},children:f.jsx(hr,{elevation:0,children:f.jsx(O9,{children:f.jsxs(j9,{"aria-label":"Individuals and Groups",size:"small",children:[f.jsx(z9,{children:h.slice(x*v,x*v+v).map(H=>f.jsxs(bd,{sx:{"&:last-child td, &:last-child th":{border:0}},children:[f.jsxs(kn,{component:"td",scope:"row",sx:{fontSize:"16px"},children:[H.name," ",H.type==="group"?f.jsxs("span",{style:{fontWeight:600},children:[" ","(Group)"]}):f.jsx(f.Fragment,{})]}),f.jsx(kn,{align:"right",children:f.jsx(at,{variant:"text",color:"error",size:"small",sx:{fontWeight:"600",fontSize:"14px"},onClick:()=>{P(O=>O.filter(D=>D.name!==H.name)),H.type==="group"?o(O=>O.filter(D=>D!==H.name)):r(O=>O.filter(D=>D!==H.name))},children:"Remove"})})]},H.name))}),f.jsx(aB,{children:f.jsx(bd,{children:f.jsx(BB,{colSpan:2,count:h.length,rowsPerPage:v,rowsPerPageOptions:[5,10,25,{label:"All",value:-1}],page:x,showFirstButton:!1,showLastButton:!1,width:"500px",slotProps:{select:{inputProps:{"aria-label":"rows per page",width:"500px"},native:!1}},onPageChange:z,ActionsComponent:bK})})})]})})})}):f.jsx(f.Fragment,{})]}):f.jsx(f.Fragment,{}),f.jsx(ot,{children:f.jsx(Fe,{children:f.jsx(hr,{elevation:0,children:f.jsxs(Ho,{direction:"column",children:[f.jsx(ot,{sx:{pt:"8px"},children:f.jsx(ri,{control:f.jsx(w9,{id:"is-public",checked:n,onChange:()=>s(!n)}),label:"Public access",labelPlacement:"start"})}),f.jsx(ot,{sx:{px:"16px",pt:"16px",pb:"4px"},children:f.jsx(Fe,{sx:{display:"flex",flexDirection:"row",gap:"8px",pb:"8px"},children:n?f.jsxs(f.Fragment,{children:[f.jsx(jv,{sx:{fontSize:"24px"}}),f.jsx(Ue,{variant:"body1",children:"Link sharing public"})]}):f.jsxs(f.Fragment,{children:[f.jsx(Hv,{sx:{fontSize:"24px"}}),f.jsx(Ue,{variant:"body1",children:"Link sharing restricted"})]})})}),f.jsx(ot,{sx:{pl:"16px",pb:"16px"},children:n?f.jsxs(Ue,{variant:"body2",children:["This app is accessible to"," ",f.jsx(Ue,{component:"span",variant:"body2",color:"error",children:"anyone via its link and sign in is not required."})]}):f.jsx(Ue,{variant:"body2",children:"This app is accessible to you and the people added above via its link."})}),e?f.jsx(ot,{sx:{p:"16px",pt:0},children:f.jsx(Rs,{id:"sharing-link",placeholder:"http://","aria-label":"Sharing link",fullWidth:!0,InputProps:{endAdornment:f.jsx(og,{position:"end",children:f.jsx(E2,{onClickAway:()=>c(!1),children:f.jsx(ag,{PopperProps:{disablePortal:!0},onClose:()=>c(!1),open:l,disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,title:"Copied to clipboard!",placement:"top",children:f.jsx(Zn,{id:"copy-to-clipboard",onClick:()=>{e&&window.isSecureContext&&(navigator.clipboard.writeText(r1(e)),c(!0))},children:f.jsx(H3,{})})})})})},value:r1(e)})}):f.jsx(f.Fragment,{})]})})})})]})})};var C3={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see diff --git a/ui/package-lock.json b/ui/package-lock.json index 4094050e..2826ece2 100644 --- a/ui/package-lock.json +++ b/ui/package-lock.json @@ -14,7 +14,7 @@ "@mui/lab": "^5.0.0-alpha.170", "@mui/material": "5.15.10", "@tanstack/react-query": "5.51.23", - "axios": "1.7.3", + "axios": "1.7.4", "axios-mock-adapter": "2.0.0", "classnames": "^2.5.1", "react": "18.2.0", @@ -2817,9 +2817,9 @@ } }, "node_modules/axios": { - "version": "1.7.3", - "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz", - "integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==", + "version": "1.7.4", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.4.tgz", + "integrity": "sha512-DukmaFRnY6AzAALSH4J2M3k6PkaC+MfaAGdEERRWcC9q3/TWQwLpHR8ZRLKTdQ3aBDL64EdluRDjJqKw+BPZEw==", "dependencies": { "follow-redirects": "^1.15.6", "form-data": "^4.0.0", diff --git a/ui/package.json b/ui/package.json index 8170165b..5d698fc9 100644 --- a/ui/package.json +++ b/ui/package.json @@ -23,7 +23,7 @@ "@mui/lab": "^5.0.0-alpha.170", "@mui/material": "5.15.10", "@tanstack/react-query": "5.51.23", - "axios": "1.7.3", + "axios": "1.7.4", "axios-mock-adapter": "2.0.0", "classnames": "^2.5.1", "react": "18.2.0",