ode-explorer 2.2.9-develop.202507101525 → 2.2.9-develop.202507151123
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ Error generating stack: `+ot.message+`
|
|
|
47
47
|
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(et){return et instanceof this?et:new this(et)}static concat(et,...rt){const st=new this(et);return rt.forEach(nt=>st.set(nt)),st}static accessor(et){const st=(this[$internals]=this[$internals]={accessors:{}}).accessors,nt=this.prototype;function ot(at){const lt=normalizeHeader(at);st[lt]||(buildAccessors(nt,at),st[lt]=!0)}return utils$4.isArray(et)?et.forEach(ot):ot(et),this}};AxiosHeaders$1.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);utils$4.reduceDescriptors(AxiosHeaders$1.prototype,({value:tt},et)=>{let rt=et[0].toUpperCase()+et.slice(1);return{get:()=>tt,set(st){this[rt]=st}}});utils$4.freezeMethods(AxiosHeaders$1);function transformData(tt,et){const rt=this||defaults$4,st=et||rt,nt=AxiosHeaders$1.from(st.headers);let ot=st.data;return utils$4.forEach(tt,function(lt){ot=lt.call(rt,ot,nt.normalize(),et?et.status:void 0)}),nt.normalize(),ot}function isCancel$1(tt){return!!(tt&&tt.__CANCEL__)}function CanceledError$1(tt,et,rt){AxiosError$1.call(this,tt??"canceled",AxiosError$1.ERR_CANCELED,et,rt),this.name="CanceledError"}utils$4.inherits(CanceledError$1,AxiosError$1,{__CANCEL__:!0});function settle(tt,et,rt){const st=rt.config.validateStatus;!rt.status||!st||st(rt.status)?tt(rt):et(new AxiosError$1("Request failed with status code "+rt.status,[AxiosError$1.ERR_BAD_REQUEST,AxiosError$1.ERR_BAD_RESPONSE][Math.floor(rt.status/100)-4],rt.config,rt.request,rt))}function parseProtocol(tt){const et=/^([-+\w]{1,25})(:?\/\/|:)/.exec(tt);return et&&et[1]||""}function speedometer(tt,et){tt=tt||10;const rt=new Array(tt),st=new Array(tt);let nt=0,ot=0,at;return et=et!==void 0?et:1e3,function(ut){const ct=Date.now(),dt=st[ot];at||(at=ct),rt[nt]=ut,st[nt]=ct;let ht=ot,ft=0;for(;ht!==nt;)ft+=rt[ht++],ht=ht%tt;if(nt=(nt+1)%tt,nt===ot&&(ot=(ot+1)%tt),ct-at<et)return;const xt=dt&&ct-dt;return xt?Math.round(ft*1e3/xt):void 0}}function throttle(tt,et){let rt=0,st=1e3/et,nt,ot;const at=(ct,dt=Date.now())=>{rt=dt,nt=null,ot&&(clearTimeout(ot),ot=null),tt.apply(null,ct)};return[(...ct)=>{const dt=Date.now(),ht=dt-rt;ht>=st?at(ct,dt):(nt=ct,ot||(ot=setTimeout(()=>{ot=null,at(nt)},st-ht)))},()=>nt&&at(nt)]}const progressEventReducer=(tt,et,rt=3)=>{let st=0;const nt=speedometer(50,250);return throttle(ot=>{const at=ot.loaded,lt=ot.lengthComputable?ot.total:void 0,ut=at-st,ct=nt(ut),dt=at<=lt;st=at;const ht={loaded:at,total:lt,progress:lt?at/lt:void 0,bytes:ut,rate:ct||void 0,estimated:ct&<&&dt?(lt-at)/ct:void 0,event:ot,lengthComputable:lt!=null,[et?"download":"upload"]:!0};tt(ht)},rt)},progressEventDecorator=(tt,et)=>{const rt=tt!=null;return[st=>et[0]({lengthComputable:rt,total:tt,loaded:st}),et[1]]},asyncDecorator=tt=>(...et)=>utils$4.asap(()=>tt(...et)),isURLSameOrigin=platform.hasStandardBrowserEnv?((tt,et)=>rt=>(rt=new URL(rt,platform.origin),tt.protocol===rt.protocol&&tt.host===rt.host&&(et||tt.port===rt.port)))(new URL(platform.origin),platform.navigator&&/(msie|trident)/i.test(platform.navigator.userAgent)):()=>!0,cookies=platform.hasStandardBrowserEnv?{write(tt,et,rt,st,nt,ot){const at=[tt+"="+encodeURIComponent(et)];utils$4.isNumber(rt)&&at.push("expires="+new Date(rt).toGMTString()),utils$4.isString(st)&&at.push("path="+st),utils$4.isString(nt)&&at.push("domain="+nt),ot===!0&&at.push("secure"),document.cookie=at.join("; ")},read(tt){const et=document.cookie.match(new RegExp("(^|;\\s*)("+tt+")=([^;]*)"));return et?decodeURIComponent(et[3]):null},remove(tt){this.write(tt,"",Date.now()-864e5)}}:{write(){},read(){return null},remove(){}};function isAbsoluteURL(tt){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(tt)}function combineURLs(tt,et){return et?tt.replace(/\/?\/$/,"")+"/"+et.replace(/^\/+/,""):tt}function buildFullPath(tt,et,rt){let st=!isAbsoluteURL(et);return tt&&(st||rt==!1)?combineURLs(tt,et):et}const headersToObject=tt=>tt instanceof AxiosHeaders$1?{...tt}:tt;function mergeConfig$1(tt,et){et=et||{};const rt={};function st(ct,dt,ht,ft){return utils$4.isPlainObject(ct)&&utils$4.isPlainObject(dt)?utils$4.merge.call({caseless:ft},ct,dt):utils$4.isPlainObject(dt)?utils$4.merge({},dt):utils$4.isArray(dt)?dt.slice():dt}function nt(ct,dt,ht,ft){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return st(void 0,ct,ht,ft)}else return st(ct,dt,ht,ft)}function ot(ct,dt){if(!utils$4.isUndefined(dt))return st(void 0,dt)}function at(ct,dt){if(utils$4.isUndefined(dt)){if(!utils$4.isUndefined(ct))return st(void 0,ct)}else return st(void 0,dt)}function lt(ct,dt,ht){if(ht in et)return st(ct,dt);if(ht in tt)return st(void 0,ct)}const ut={url:ot,method:ot,data:ot,baseURL:at,transformRequest:at,transformResponse:at,paramsSerializer:at,timeout:at,timeoutMessage:at,withCredentials:at,withXSRFToken:at,adapter:at,responseType:at,xsrfCookieName:at,xsrfHeaderName:at,onUploadProgress:at,onDownloadProgress:at,decompress:at,maxContentLength:at,maxBodyLength:at,beforeRedirect:at,transport:at,httpAgent:at,httpsAgent:at,cancelToken:at,socketPath:at,responseEncoding:at,validateStatus:lt,headers:(ct,dt,ht)=>nt(headersToObject(ct),headersToObject(dt),ht,!0)};return utils$4.forEach(Object.keys(Object.assign({},tt,et)),function(dt){const ht=ut[dt]||nt,ft=ht(tt[dt],et[dt],dt);utils$4.isUndefined(ft)&&ht!==lt||(rt[dt]=ft)}),rt}const resolveConfig=tt=>{const et=mergeConfig$1({},tt);let{data:rt,withXSRFToken:st,xsrfHeaderName:nt,xsrfCookieName:ot,headers:at,auth:lt}=et;et.headers=at=AxiosHeaders$1.from(at),et.url=buildURL(buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls),tt.params,tt.paramsSerializer),lt&&at.set("Authorization","Basic "+btoa((lt.username||"")+":"+(lt.password?unescape(encodeURIComponent(lt.password)):"")));let ut;if(utils$4.isFormData(rt)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)at.setContentType(void 0);else if((ut=at.getContentType())!==!1){const[ct,...dt]=ut?ut.split(";").map(ht=>ht.trim()).filter(Boolean):[];at.setContentType([ct||"multipart/form-data",...dt].join("; "))}}if(platform.hasStandardBrowserEnv&&(st&&utils$4.isFunction(st)&&(st=st(et)),st||st!==!1&&isURLSameOrigin(et.url))){const ct=nt&&ot&&cookies.read(ot);ct&&at.set(nt,ct)}return et},isXHRAdapterSupported=typeof XMLHttpRequest<"u",xhrAdapter=isXHRAdapterSupported&&function(tt){return new Promise(function(rt,st){const nt=resolveConfig(tt);let ot=nt.data;const at=AxiosHeaders$1.from(nt.headers).normalize();let{responseType:lt,onUploadProgress:ut,onDownloadProgress:ct}=nt,dt,ht,ft,xt,yt;function vt(){xt&&xt(),yt&&yt(),nt.cancelToken&&nt.cancelToken.unsubscribe(dt),nt.signal&&nt.signal.removeEventListener("abort",dt)}let Et=new XMLHttpRequest;Et.open(nt.method.toUpperCase(),nt.url,!0),Et.timeout=nt.timeout;function bt(){if(!Et)return;const St=AxiosHeaders$1.from("getAllResponseHeaders"in Et&&Et.getAllResponseHeaders()),Ct={data:!lt||lt==="text"||lt==="json"?Et.responseText:Et.response,status:Et.status,statusText:Et.statusText,headers:St,config:tt,request:Et};settle(function(It){rt(It),vt()},function(It){st(It),vt()},Ct),Et=null}"onloadend"in Et?Et.onloadend=bt:Et.onreadystatechange=function(){!Et||Et.readyState!==4||Et.status===0&&!(Et.responseURL&&Et.responseURL.indexOf("file:")===0)||setTimeout(bt)},Et.onabort=function(){Et&&(st(new AxiosError$1("Request aborted",AxiosError$1.ECONNABORTED,tt,Et)),Et=null)},Et.onerror=function(){st(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,tt,Et)),Et=null},Et.ontimeout=function(){let Rt=nt.timeout?"timeout of "+nt.timeout+"ms exceeded":"timeout exceeded";const Ct=nt.transitional||transitionalDefaults;nt.timeoutErrorMessage&&(Rt=nt.timeoutErrorMessage),st(new AxiosError$1(Rt,Ct.clarifyTimeoutError?AxiosError$1.ETIMEDOUT:AxiosError$1.ECONNABORTED,tt,Et)),Et=null},ot===void 0&&at.setContentType(null),"setRequestHeader"in Et&&utils$4.forEach(at.toJSON(),function(Rt,Ct){Et.setRequestHeader(Ct,Rt)}),utils$4.isUndefined(nt.withCredentials)||(Et.withCredentials=!!nt.withCredentials),lt&<!=="json"&&(Et.responseType=nt.responseType),ct&&([ft,yt]=progressEventReducer(ct,!0),Et.addEventListener("progress",ft)),ut&&Et.upload&&([ht,xt]=progressEventReducer(ut),Et.upload.addEventListener("progress",ht),Et.upload.addEventListener("loadend",xt)),(nt.cancelToken||nt.signal)&&(dt=St=>{Et&&(st(!St||St.type?new CanceledError$1(null,tt,Et):St),Et.abort(),Et=null)},nt.cancelToken&&nt.cancelToken.subscribe(dt),nt.signal&&(nt.signal.aborted?dt():nt.signal.addEventListener("abort",dt)));const wt=parseProtocol(nt.url);if(wt&&platform.protocols.indexOf(wt)===-1){st(new AxiosError$1("Unsupported protocol "+wt+":",AxiosError$1.ERR_BAD_REQUEST,tt));return}Et.send(ot||null)})},composeSignals=(tt,et)=>{const{length:rt}=tt=tt?tt.filter(Boolean):[];if(et||rt){let st=new AbortController,nt;const ot=function(ct){if(!nt){nt=!0,lt();const dt=ct instanceof Error?ct:this.reason;st.abort(dt instanceof AxiosError$1?dt:new CanceledError$1(dt instanceof Error?dt.message:dt))}};let at=et&&setTimeout(()=>{at=null,ot(new AxiosError$1(`timeout ${et} of ms exceeded`,AxiosError$1.ETIMEDOUT))},et);const lt=()=>{tt&&(at&&clearTimeout(at),at=null,tt.forEach(ct=>{ct.unsubscribe?ct.unsubscribe(ot):ct.removeEventListener("abort",ot)}),tt=null)};tt.forEach(ct=>ct.addEventListener("abort",ot));const{signal:ut}=st;return ut.unsubscribe=()=>utils$4.asap(lt),ut}},streamChunk=function*(tt,et){let rt=tt.byteLength;if(rt<et){yield tt;return}let st=0,nt;for(;st<rt;)nt=st+et,yield tt.slice(st,nt),st=nt},readBytes=async function*(tt,et){for await(const rt of readStream(tt))yield*streamChunk(rt,et)},readStream=async function*(tt){if(tt[Symbol.asyncIterator]){yield*tt;return}const et=tt.getReader();try{for(;;){const{done:rt,value:st}=await et.read();if(rt)break;yield st}}finally{await et.cancel()}},trackStream=(tt,et,rt,st)=>{const nt=readBytes(tt,et);let ot=0,at,lt=ut=>{at||(at=!0,st&&st(ut))};return new ReadableStream({async pull(ut){try{const{done:ct,value:dt}=await nt.next();if(ct){lt(),ut.close();return}let ht=dt.byteLength;if(rt){let ft=ot+=ht;rt(ft)}ut.enqueue(new Uint8Array(dt))}catch(ct){throw lt(ct),ct}},cancel(ut){return lt(ut),nt.return()}},{highWaterMark:2})},isFetchSupported=typeof fetch=="function"&&typeof Request=="function"&&typeof Response=="function",isReadableStreamSupported=isFetchSupported&&typeof ReadableStream=="function",encodeText=isFetchSupported&&(typeof TextEncoder=="function"?(tt=>et=>tt.encode(et))(new TextEncoder):async tt=>new Uint8Array(await new Response(tt).arrayBuffer())),test=(tt,...et)=>{try{return!!tt(...et)}catch{return!1}},supportsRequestStream=isReadableStreamSupported&&test(()=>{let tt=!1;const et=new Request(platform.origin,{body:new ReadableStream,method:"POST",get duplex(){return tt=!0,"half"}}).headers.has("Content-Type");return tt&&!et}),DEFAULT_CHUNK_SIZE=64*1024,supportsResponseStream=isReadableStreamSupported&&test(()=>utils$4.isReadableStream(new Response("").body)),resolvers={stream:supportsResponseStream&&(tt=>tt.body)};isFetchSupported&&(tt=>{["text","arrayBuffer","blob","formData","stream"].forEach(et=>{!resolvers[et]&&(resolvers[et]=utils$4.isFunction(tt[et])?rt=>rt[et]():(rt,st)=>{throw new AxiosError$1(`Response type '${et}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,st)})})})(new Response);const getBodyLength=async tt=>{if(tt==null)return 0;if(utils$4.isBlob(tt))return tt.size;if(utils$4.isSpecCompliantForm(tt))return(await new Request(platform.origin,{method:"POST",body:tt}).arrayBuffer()).byteLength;if(utils$4.isArrayBufferView(tt)||utils$4.isArrayBuffer(tt))return tt.byteLength;if(utils$4.isURLSearchParams(tt)&&(tt=tt+""),utils$4.isString(tt))return(await encodeText(tt)).byteLength},resolveBodyLength=async(tt,et)=>{const rt=utils$4.toFiniteNumber(tt.getContentLength());return rt??getBodyLength(et)},fetchAdapter=isFetchSupported&&(async tt=>{let{url:et,method:rt,data:st,signal:nt,cancelToken:ot,timeout:at,onDownloadProgress:lt,onUploadProgress:ut,responseType:ct,headers:dt,withCredentials:ht="same-origin",fetchOptions:ft}=resolveConfig(tt);ct=ct?(ct+"").toLowerCase():"text";let xt=composeSignals([nt,ot&&ot.toAbortSignal()],at),yt;const vt=xt&&xt.unsubscribe&&(()=>{xt.unsubscribe()});let Et;try{if(ut&&supportsRequestStream&&rt!=="get"&&rt!=="head"&&(Et=await resolveBodyLength(dt,st))!==0){let Ct=new Request(et,{method:"POST",body:st,duplex:"half"}),jt;if(utils$4.isFormData(st)&&(jt=Ct.headers.get("content-type"))&&dt.setContentType(jt),Ct.body){const[It,Pt]=progressEventDecorator(Et,progressEventReducer(asyncDecorator(ut)));st=trackStream(Ct.body,DEFAULT_CHUNK_SIZE,It,Pt)}}utils$4.isString(ht)||(ht=ht?"include":"omit");const bt="credentials"in Request.prototype;yt=new Request(et,{...ft,signal:xt,method:rt.toUpperCase(),headers:dt.normalize().toJSON(),body:st,duplex:"half",credentials:bt?ht:void 0});let wt=await fetch(yt,ft);const St=supportsResponseStream&&(ct==="stream"||ct==="response");if(supportsResponseStream&&(lt||St&&vt)){const Ct={};["status","statusText","headers"].forEach($t=>{Ct[$t]=wt[$t]});const jt=utils$4.toFiniteNumber(wt.headers.get("content-length")),[It,Pt]=lt&&progressEventDecorator(jt,progressEventReducer(asyncDecorator(lt),!0))||[];wt=new Response(trackStream(wt.body,DEFAULT_CHUNK_SIZE,It,()=>{Pt&&Pt(),vt&&vt()}),Ct)}ct=ct||"text";let Rt=await resolvers[utils$4.findKey(resolvers,ct)||"text"](wt,tt);return!St&&vt&&vt(),await new Promise((Ct,jt)=>{settle(Ct,jt,{data:Rt,headers:AxiosHeaders$1.from(wt.headers),status:wt.status,statusText:wt.statusText,config:tt,request:yt})})}catch(bt){throw vt&&vt(),bt&&bt.name==="TypeError"&&/Load failed|fetch/i.test(bt.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,tt,yt),{cause:bt.cause||bt}):AxiosError$1.from(bt,bt&&bt.code,tt,yt)}}),knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:fetchAdapter};utils$4.forEach(knownAdapters,(tt,et)=>{if(tt){try{Object.defineProperty(tt,"name",{value:et})}catch{}Object.defineProperty(tt,"adapterName",{value:et})}});const renderReason=tt=>`- ${tt}`,isResolvedHandle=tt=>utils$4.isFunction(tt)||tt===null||tt===!1,adapters={getAdapter:tt=>{tt=utils$4.isArray(tt)?tt:[tt];const{length:et}=tt;let rt,st;const nt={};for(let ot=0;ot<et;ot++){rt=tt[ot];let at;if(st=rt,!isResolvedHandle(rt)&&(st=knownAdapters[(at=String(rt)).toLowerCase()],st===void 0))throw new AxiosError$1(`Unknown adapter '${at}'`);if(st)break;nt[at||"#"+ot]=st}if(!st){const ot=Object.entries(nt).map(([lt,ut])=>`adapter ${lt} `+(ut===!1?"is not supported by the environment":"is not available in the build"));let at=et?ot.length>1?`since :
|
|
48
48
|
`+ot.map(renderReason).join(`
|
|
49
49
|
`):" "+renderReason(ot[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+at,"ERR_NOT_SUPPORT")}return st},adapters:knownAdapters};function throwIfCancellationRequested(tt){if(tt.cancelToken&&tt.cancelToken.throwIfRequested(),tt.signal&&tt.signal.aborted)throw new CanceledError$1(null,tt)}function dispatchRequest(tt){return throwIfCancellationRequested(tt),tt.headers=AxiosHeaders$1.from(tt.headers),tt.data=transformData.call(tt,tt.transformRequest),["post","put","patch"].indexOf(tt.method)!==-1&&tt.headers.setContentType("application/x-www-form-urlencoded",!1),adapters.getAdapter(tt.adapter||defaults$4.adapter)(tt).then(function(st){return throwIfCancellationRequested(tt),st.data=transformData.call(tt,tt.transformResponse,st),st.headers=AxiosHeaders$1.from(st.headers),st},function(st){return isCancel$1(st)||(throwIfCancellationRequested(tt),st&&st.response&&(st.response.data=transformData.call(tt,tt.transformResponse,st.response),st.response.headers=AxiosHeaders$1.from(st.response.headers))),Promise.reject(st)})}const VERSION$1="1.10.0",validators$1={};["object","boolean","number","function","string","symbol"].forEach((tt,et)=>{validators$1[tt]=function(st){return typeof st===tt||"a"+(et<1?"n ":" ")+tt}});const deprecatedWarnings={};validators$1.transitional=function(et,rt,st){function nt(ot,at){return"[Axios v"+VERSION$1+"] Transitional option '"+ot+"'"+at+(st?". "+st:"")}return(ot,at,lt)=>{if(et===!1)throw new AxiosError$1(nt(at," has been removed"+(rt?" in "+rt:"")),AxiosError$1.ERR_DEPRECATED);return rt&&!deprecatedWarnings[at]&&(deprecatedWarnings[at]=!0,console.warn(nt(at," has been deprecated since v"+rt+" and will be removed in the near future"))),et?et(ot,at,lt):!0}};validators$1.spelling=function(et){return(rt,st)=>(console.warn(`${st} is likely a misspelling of ${et}`),!0)};function assertOptions(tt,et,rt){if(typeof tt!="object")throw new AxiosError$1("options must be an object",AxiosError$1.ERR_BAD_OPTION_VALUE);const st=Object.keys(tt);let nt=st.length;for(;nt-- >0;){const ot=st[nt],at=et[ot];if(at){const lt=tt[ot],ut=lt===void 0||at(lt,ot,tt);if(ut!==!0)throw new AxiosError$1("option "+ot+" must be "+ut,AxiosError$1.ERR_BAD_OPTION_VALUE);continue}if(rt!==!0)throw new AxiosError$1("Unknown option "+ot,AxiosError$1.ERR_BAD_OPTION)}}const validator={assertOptions,validators:validators$1},validators=validator.validators;let Axios$1=class{constructor(et){this.defaults=et||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(et,rt){try{return await this._request(et,rt)}catch(st){if(st instanceof Error){let nt={};Error.captureStackTrace?Error.captureStackTrace(nt):nt=new Error;const ot=nt.stack?nt.stack.replace(/^.+\n/,""):"";try{st.stack?ot&&!String(st.stack).endsWith(ot.replace(/^.+\n.+\n/,""))&&(st.stack+=`
|
|
50
|
-
`+ot):st.stack=ot}catch{}}throw st}}_request(et,rt){typeof et=="string"?(rt=rt||{},rt.url=et):rt=et||{},rt=mergeConfig$1(this.defaults,rt);const{transitional:st,paramsSerializer:nt,headers:ot}=rt;st!==void 0&&validator.assertOptions(st,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),nt!=null&&(utils$4.isFunction(nt)?rt.paramsSerializer={serialize:nt}:validator.assertOptions(nt,{encode:validators.function,serialize:validators.function},!0)),rt.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?rt.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:rt.allowAbsoluteUrls=!0),validator.assertOptions(rt,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),rt.method=(rt.method||this.defaults.method||"get").toLowerCase();let at=ot&&utils$4.merge(ot.common,ot[rt.method]);ot&&utils$4.forEach(["delete","get","head","post","put","patch","common"],yt=>{delete ot[yt]}),rt.headers=AxiosHeaders$1.concat(at,ot);const lt=[];let ut=!0;this.interceptors.request.forEach(function(vt){typeof vt.runWhen=="function"&&vt.runWhen(rt)===!1||(ut=ut&&vt.synchronous,lt.unshift(vt.fulfilled,vt.rejected))});const ct=[];this.interceptors.response.forEach(function(vt){ct.push(vt.fulfilled,vt.rejected)});let dt,ht=0,ft;if(!ut){const yt=[dispatchRequest.bind(this),void 0];for(yt.unshift.apply(yt,lt),yt.push.apply(yt,ct),ft=yt.length,dt=Promise.resolve(rt);ht<ft;)dt=dt.then(yt[ht++],yt[ht++]);return dt}ft=lt.length;let xt=rt;for(ht=0;ht<ft;){const yt=lt[ht++],vt=lt[ht++];try{xt=yt(xt)}catch(Et){vt.call(this,Et);break}}try{dt=dispatchRequest.call(this,xt)}catch(yt){return Promise.reject(yt)}for(ht=0,ft=ct.length;ht<ft;)dt=dt.then(ct[ht++],ct[ht++]);return dt}getUri(et){et=mergeConfig$1(this.defaults,et);const rt=buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls);return buildURL(rt,et.params,et.paramsSerializer)}};utils$4.forEach(["delete","get","head","options"],function(et){Axios$1.prototype[et]=function(rt,st){return this.request(mergeConfig$1(st||{},{method:et,url:rt,data:(st||{}).data}))}});utils$4.forEach(["post","put","patch"],function(et){function rt(st){return function(ot,at,lt){return this.request(mergeConfig$1(lt||{},{method:et,headers:st?{"Content-Type":"multipart/form-data"}:{},url:ot,data:at}))}}Axios$1.prototype[et]=rt(),Axios$1.prototype[et+"Form"]=rt(!0)});let CancelToken$1=class rm{constructor(et){if(typeof et!="function")throw new TypeError("executor must be a function.");let rt;this.promise=new Promise(function(ot){rt=ot});const st=this;this.promise.then(nt=>{if(!st._listeners)return;let ot=st._listeners.length;for(;ot-- >0;)st._listeners[ot](nt);st._listeners=null}),this.promise.then=nt=>{let ot;const at=new Promise(lt=>{st.subscribe(lt),ot=lt}).then(nt);return at.cancel=function(){st.unsubscribe(ot)},at},et(function(ot,at,lt){st.reason||(st.reason=new CanceledError$1(ot,at,lt),rt(st.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(et){if(this.reason){et(this.reason);return}this._listeners?this._listeners.push(et):this._listeners=[et]}unsubscribe(et){if(!this._listeners)return;const rt=this._listeners.indexOf(et);rt!==-1&&this._listeners.splice(rt,1)}toAbortSignal(){const et=new AbortController,rt=st=>{et.abort(st)};return this.subscribe(rt),et.signal.unsubscribe=()=>this.unsubscribe(rt),et.signal}static source(){let et;return{token:new rm(function(nt){et=nt}),cancel:et}}};function spread$1(tt){return function(rt){return tt.apply(null,rt)}}function isAxiosError$1(tt){return utils$4.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode$1={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(HttpStatusCode$1).forEach(([tt,et])=>{HttpStatusCode$1[et]=tt});function createInstance(tt){const et=new Axios$1(tt),rt=bind$3(Axios$1.prototype.request,et);return utils$4.extend(rt,Axios$1.prototype,et,{allOwnKeys:!0}),utils$4.extend(rt,et,null,{allOwnKeys:!0}),rt.create=function(nt){return createInstance(mergeConfig$1(tt,nt))},rt}const axios=createInstance(defaults$4);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function(et){return Promise.all(et)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=tt=>formDataToJSON(utils$4.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function m$2(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$3=(tt,et)=>{if(tt==0)return"0 octets";const rt=1e3,st=et,nt=["octets","Ko","Mo","Go"],ot=Math.floor(Math.log(tt)/Math.log(rt));return parseFloat((tt/Math.pow(rt,ot)).toFixed(st))+" "+nt[ot]};let s$3=class{static isLocalURL(et){return et.length>0&&et.charAt(0)==="/"}static startWithHttp(et){return/^https?:\/\//gi.test(et)}static toCounter(et){return et>999?`${Number(et/1e3).toFixed(1)} k`:""+et}static generateVirtualId(){return"xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16))}};const s$2=(tt,et)=>{const rt="virtualID";if(!Object.hasOwnProperty.apply(tt,[rt])){const st=et??`${s$3.generateVirtualId()}#${tt.size}`;Object.defineProperty(tt,rt,{value:st,writable:!1})}return tt[rt]};let p$3=class{static changeDimension(et,rt,st,nt){return st>nt&&(et=Math.round(et*nt/st),st=nt),et>rt&&(st=Math.round(st*rt/et),et=rt),{height:et,width:st}}static renameFileNameExtension(et,rt){const st=et.split(".");return st.pop(),st.join(".")+"."+rt}static resizeImage(et,rt,st,nt,ot="jpeg",at=80){const lt=at/100,ut=document.createElement("canvas"),ct=`image/${ot}`;let dt=et.width,ht=et.height;const ft=this.changeDimension(ht,nt,dt,st);dt=ft.width,ht=ft.height;const xt=ut.getContext("2d");return xt&&(ut.width=dt,ut.height=ht,xt.fillStyle="white",xt.fillRect(0,0,ut.width,ut.height),xt.imageSmoothingEnabled&&xt.imageSmoothingQuality&&(xt.imageSmoothingQuality="high"),xt.drawImage(et,0,0,dt,ht)),new Promise((yt,vt)=>{ut.toBlob(Et=>{Et?yt(new File([Et],rt,{type:ct,lastModified:new Date().getTime()})):vt()},ct,lt)})}static async resizeImageFile(et,rt=1440,st=1440,nt=80){if(!et)throw Error("Image resizer: file not found!");if(!et.type||!et.type.startsWith("image/"))throw Error("Image resizer: the file given is not an image.");const ot="jpeg";return new Promise(at=>{const lt=new Image;lt.setAttribute("style","max-width: none;"),lt.src=URL.createObjectURL(et),lt.onload=async()=>{const ut=await this.resizeImage(lt,this.renameFileNameExtension(et.name,ot),rt,st,ot,nt);at(ut)},lt.onerror=ut=>{throw Error("Image Loading Error: "+ut)}})}};const e$3={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};var p$2=Object.defineProperty,d$2=(tt,et,rt)=>et in tt?p$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$4=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$4(this,"wordExtensions",new Set),n$4(this,"excelExtensions",new Set),n$4(this,"pptExtensions",new Set),n$4(this,"fileExtensionMap",new Map),n$4(this,"csvContentType",new Set),n$4(this,"csvExtensions",new Set),n$4(this,"txtExtensions",new Set),n$4(this,"mdExtensions",new Set),n$4(this,"PDF","application/pdf"),n$4(this,"OCTET_STREAM","application/octet-stream"),this.txtExtensions.add("txt"),this.mdExtensions.add("md"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.fileExtensionMap.set("md","text/markdown"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(et){return this.fileExtensionMap.has(et)?this.fileExtensionMap.get(et)??null:null}getExtensionForContentType(et){for(const rt of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(rt)||"").toLowerCase()==(et||"").toLowerCase())return rt;return null}isWordLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.wordExtensions.has(st):et==this.OCTET_STREAM&&rt?this.wordExtensions.has(rt):!1}isExcelLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.excelExtensions.has(st):et==this.OCTET_STREAM&&rt?this.excelExtensions.has(rt):!1}isCsvLike(et,rt){return this.csvContentType.has(et)?!0:et==this.OCTET_STREAM&&rt?this.csvExtensions.has(rt):!1}isPowerpointLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.pptExtensions.has(st):et==this.OCTET_STREAM&&rt?this.pptExtensions.has(rt):!1}isTxtLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.txtExtensions.has(st):et==this.OCTET_STREAM&&rt?this.txtExtensions.has(rt):!1}isMdLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.mdExtensions.has(st):et==this.OCTET_STREAM&&rt?this.mdExtensions.has(rt):!1}};n$4(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$3=tt=>{if(tt>0){let et=Math.floor(tt/1e3),rt=Math.floor(et/60);return et=et%60,rt=rt%60,e$2(rt)+":"+e$2(et)}return"00:00"},e$2=tt=>tt.toString().padStart(2,"0"),o$2=()=>MediaRecorder.isTypeSupported?["video/webm;codecs=vp9",'video/mp4; codecs="avc1.424028, mp4a.40.2"',"video/webm;codecs=vp8,opus","video/webm"].find(tt=>MediaRecorder.isTypeSupported(tt)?!0:(console.error(`${tt} is not Supported`),!1))||"video/ogg":"video/webm;codecs=vp8,opus";var v$1=Object.defineProperty,T$1=(tt,et,rt)=>et in tt?v$1(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$2=(tt,et,rt)=>T$1(tt,typeof et!="symbol"?et+"":et,rt);const ERROR_CODE={SUCCESS:"0000",UNKNOWN:"0010",NOT_INITIALIZED:"0020",NOT_SUPPORTED:"0030",APP_NOT_FOUND:"0040",AGENT_NOT_FOUND:"0050",TRANSPORT_ERROR:"0060",TIME_OUT:"0070",MALFORMED_DATA:"0080",NOT_LOGGED_IN:"0090"},APP$4={VIDEO:"video"};class Subscription{constructor(et,rt){n$2(this,"revoke"),this._channel=et,this.revoke=this.setReceiver(st=>rt==null?void 0:rt(st.data))}setReceiver(et){var rt;return(rt=this._channel)==null||rt.addEventListener("message",et),()=>{this._channel&&(this._channel.removeEventListener("message",et),this._channel.close(),delete this._channel)}}}class Subject{constructor(){n$2(this,"publishChannels",new Map)}getChannelName(et){return"Subject:"+et}getPublishChannel(et){const rt=this.getChannelName(et);let st=this.publishChannels.get(rt);return st||(st=this.newChannel(et),this.publishChannels.set(rt,st)),st}newChannel(et){const rt=this.getChannelName(et),st=new BroadcastChannel(rt);return st.addEventListener("messageerror",nt=>console.log(nt.data)),st}publish(et,rt){typeof et=="string"&&this.getPublishChannel(et).postMessage(rt)}subscribe(et,rt){if(typeof et=="string"){const st=this.newChannel(et);return new Subscription(st,rt)}else return new Subscription}}const ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady",APPCONF_READY:"appConfReady"};class Promisified{constructor(){n$2(this,"_resolution"),n$2(this,"_rejection"),n$2(this,"_promise",new Promise((et,rt)=>{this._resolution=et,this._rejection=rt}))}get promise(){return this._promise}resolve(et){this._resolution&&this._resolution(et)}reject(et){this._rejection&&this._rejection(et)}}class NotifyFramework{constructor(){n$2(this,"promises",{}),n$2(this,"subject",new Subject)}asyncData(et){return typeof this.promises[et]>"u"&&(this.promises[et]=new Promisified),this.promises[et]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}onAppConfReady(){return this.asyncData(ASYNC_DATA_NAME.APPCONF_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework,loadedScripts$1={};class Http{constructor(et){n$2(this,"axios"),n$2(this,"_latestResponse"),this.axios=axios.create(et)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);return et.headers&&(rt.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams)),rt}else return this.axios.defaults}toCdnUrl(et){const rt=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((rt==null?void 0:rt.length)>0&&et!=="/conf/public"){const st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}return et}mapAxiosError(et,rt){return et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!rt||rt.disableNotifications,this._latestResponse}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}get(et,rt){return this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}post(et,rt,st){return this.axios.post(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}postFile(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"],this.axios.post(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}postJson(et,rt,st){const nt=this.toAxiosConfig();return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.post(et,rt,this.toAxiosConfig(st)).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}put(et,rt,st){return this.axios.put(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}putJson(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.put(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}delete(et,rt){return this.axios.delete(et,this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}deleteJson(et,rt){return this.axios.delete(et,{data:rt}).then(st=>this.mapAxiosResponse(st)).catch(st=>this.mapAxiosError(st))}getScript(et,rt,st){const nt=st??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${nt.split(".")[0]}={};${at};return ${nt};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts$1[et]?Promise.resolve():this.getScript(et,rt).then(st=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){n$2(this,"_http",new Http)}get http(){return this._http}newHttpInstance(et){return new Http(et)}}const transport=new TransportFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}const http$2=transport.http;class Session{constructor(){n$2(this,"_me",null),n$2(this,"_currentLanguage",""),n$2(this,"_notLoggedIn",!0),n$2(this,"_description"),n$2(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let et=this.description.photo;return(!et||et==="no-avatar.jpg"||et==="no-avatar.svg")&&(et=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),et}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(et=>{if(http$2.isResponseError()||typeof et=="string")throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(et),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(et=>(this.setCurrentLanguage(et),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(et=>{if(et===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(et)})}setCurrentModel(et){this._me=et,this._notLoggedIn=!(et&&et.sessionMetadata&&et.sessionMetadata.userId)}hasWorkflow(et){var rt;return et===void 0||((rt=this._me)==null?void 0:rt.authorizedActions.findIndex(st=>st.name===et))!==-1}hasRight(et,rt){if(rt==="owner")return et.owner&&et.owner.userId===this._me.userId;const st=rt.right||rt,nt=et.shared.filter(at=>(this._me.groupsIds||[]).indexOf(at.groupId)!==-1||at.userId===this._me.userId).find(at=>at[st]||at.manager)!==void 0,ot=rt.workflow?this.hasWorkflow(rt.workflow):!0;return nt&&ot}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(et=>(this._description&&(this._description.quota=et.quota,this._description.storage=et.storage),et)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(et){this._currentLanguage=et,notify.onLangReady().resolve(et)}loadDefaultLanguage(){return http$2.get("/locale").then(et=>et.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(et=>(et[0].status==="ok"&&et[0].result&&et[0].result.length>0?this._description=et[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,et[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(et=>et.result).then(et=>this._profile=et[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(et=>{try{return JSON.parse(et.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(et){return http$2.put("/directory/user/mailstate",{email:et})}tryEmailValidation(et){return http$2.post("/directory/user/mailstate",{key:et})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(et){return http$2.put("/directory/user/mobilestate",{mobile:et})}tryMobileValidation(et){return http$2.post("/directory/user/mobilestate",{key:et})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(et){return http$2.post("/auth/user/mfa/code",{key:et})}}class SessionFramework{constructor(){n$2(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),transport.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){n$2(this,"_conf"),n$2(this,"_loaded"),n$2(this,"skinName",""),n$2(this,"themeName",""),n$2(this,"skin","raw"),n$2(this,"themeUrl","/assets/themes/raw/default/"),n$2(this,"templateOverrides",{}),n$2(this,"portalTemplate","/assets/themes/raw/portal.html"),n$2(this,"basePath",""),n$2(this,"logoutCallback","/"),n$2(this,"skins",[]),n$2(this,"is1D",!1),n$2(this,"is2D",!1),n$2(this,"_onSkinReady",notify.onSkinReady()),n$2(this,"_onOverrideReady",notify.onOverridesReady())}initialize(et){return notify.onSessionReady().promise.then(()=>this.load(et))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(et){return this._conf=this._conf??await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:et??this.version}},"exports.conf"),this._conf}load(et){return et=et??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(et):this.loadConnected(et)).then(async()=>{var rt,st;const nt=await this.listSkins();this.is1D=((rt=nt.find(ot=>ot.child===this.skin))==null?void 0:rt.parent)==="panda",this.is2D=((st=nt.find(ot=>ot.child===this.skin))==null?void 0:st.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((rt,st)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(nt=>{this.skin=nt.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${nt.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${nt.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(ot=>{this.templateOverrides=ot,this._onOverrideReady.resolve(ot),rt()}).catch(ot=>{if(transport.http.latestResponse.status===404)rt();else throw ot})}).catch(nt=>{this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt),st()})})}loadConnected(et){return new Promise((rt,st)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(nt=>{this.templateOverrides=nt,this._onOverrideReady.resolve(nt),rt()}).catch(nt=>{if(transport.http.latestResponse.status===404)rt(),this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt);else throw nt})})})}async loadDefaultTheme(et){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:et}}).then(rt=>{this.skinName=rt.skinName,this.themeName=rt.themeName,this.themeUrl=rt.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=rt.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(et){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+et._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(et=>{const rt=et.overriding.find(st=>st.child===this.skin);return rt!=null&&rt.group?this.skins=this.skins.concat(et.overriding.filter(st=>st.group===rt.group)):this.skins=this.skins.concat(et.overriding),this.skins})}async getHelpPath(){const et=(await this.listSkins()).find(rt=>rt.child===this.skin);return(et==null?void 0:et.help)??"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(et,rt){et=et??"";let st=bundle$1[et]===void 0?et:bundle$1[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et){return this.loadBundlePromise(session.session.currentLanguage,et)}addBundle(et,rt){this.loadBundle(session.session.currentLanguage,et,rt)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises$1[rt]}loadBundle(et,rt,st){const nt=promises$1[rt];if(nt)st&&nt.then(st).catch(st);else{const ot=new Promisified;promises$1[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),transport.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle$1,lt),typeof st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle$1[rt]!="string"&&(bundle$1[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap$1.length;rt++)et=et.replace(defaultDiacriticsRemovalMap$1[rt].letters,defaultDiacriticsRemovalMap$1[rt].base);return et}}class UserPreferences{constructor(){n$2(this,"data",{})}get(et){return this.data[et]}load(et,rt){return transport.http.get("/userbook/preference/"+et).then(st=>{try{return JSON.parse(st.preference)}catch{return rt??{}}}).then(st=>(this.data[et]=st??{},st))}update(et,rt){return rt!==void 0&&(this.data[et]=rt),this}save(et){return transport.http.putJson("/userbook/preference/"+et,this.data[et])}}class User{constructor(){n$2(this,"_me",null),n$2(this,"_keepOpenOnLogout",!1),n$2(this,"_preferences",new UserPreferences),n$2(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(et){return this.loadPublicConf(),notify.onSessionReady().promise.then(rt=>{rt&&this.setCurrentModel(rt)})}setCurrentModel(et){this._me=et,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(et=>(this._keepOpenOnLogout=(et==null?void 0:et.keepOpenOnLogout)||!1,et))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(et=>{et.preference||(et.preference=null);const rt=JSON.parse(et.preference);let st;if(rt&&rt.length&&typeof rt.concat=="function"){this._bookmarkedApps=rt,st={bookmarks:rt.map(at=>at.name),applications:[]},transport.http.putJson("/userbook/preference/apps",st);return}else st=rt;st||(st={bookmarks:[],applications:[]});let nt=!0;const ot=[];st.bookmarks.forEach((at,lt)=>{const ut=this._me.apps.find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);this._bookmarkedApps.push(ct)}else ot.push(at),nt=!1}),ot.forEach(at=>{const lt=st.bookmarks.indexOf(at);lt!==-1&&st.bookmarks.splice(lt,1)}),nt||transport.http.putJson("/userbook/preference/apps",st)})}loadAppPrefs(et){return this.preferences.load(et,{})}saveAppPrefs(et){return this.preferences.save(et)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(et=>et["default-domain"])}saveLanguage(et){return this.preferences.update("language",{"default-domain":et}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){n$2(this,"_publicConf",{}),n$2(this,"_currentApp"),n$2(this,"_appConf",{})}get currentApp(){return this._currentApp??null}setCurrentApp(et){return this._currentApp=et,this}async initialize(et,rt=!1){rt||this.setCurrentApp(et),await Promise.all([this.getPublicConf(et),this.loadI18n(et)])}async getPublicConf(et){return this._publicConf[et]||(this._publicConf[et]=await http$1.get(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[et]}async getWebAppConf(et){let rt;return this._appConf[et]||(await http$1.get("/applications-list")).apps.forEach(st=>{if(st!=null&&st.prefix){const nt=st.prefix.replace("/","");this._appConf[nt]=st}else st!=null&&st.name&&st.name.toLowerCase()==et&&(rt=st)}),this._appConf[et]??rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){n$2(this,"_status","void"),n$2(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(et){return this.parametersWithCheck(et,!0)}async parametersWithCheck(et,rt){return this.initialize().promise.then(st=>!rt||st.type===et||st.type==="multiple"?st[et]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async et=>{var rt;if(!et||!et[0]||!et[0].type)throw ERROR_CODE.MALFORMED_DATA;et[1]&&et[1].active&&(et[0].xiti=await this.initializeXiti(et[1])),(rt=this._params)==null||rt.resolve(et[0]),this._status="ready"}).catch(et=>{var rt;throw this._status="failed",(rt=this._params)==null||rt.reject(),et})),this._params}async initializeXiti(et){if(!et.structureMap||!configure.Platform.apps.currentApp)return;const rt=await notify.onSessionReady().promise,st=session.session.description;let nt;for(const ct of rt.structures){const dt=et.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:et.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st.profiles&&st.profiles.length>0?ut[st.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){n$2(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$2(this,"School",{}),n$2(this,"User",new User)}async initialize(et,rt){if(!et){const nt=ct=>(ct<10?"0":"")+ct.toFixed(0),ot=new Date,at=ot.getFullYear(),lt=ot.getMonth()+1,ut=ot.getDate();et=`${at}${nt(lt)}${nt(ut)}`}const st=et;this.Platform.deploymentTag=et,typeof rt=="string"&&rt.length>0&&(this.Platform.cdnDomain=rt),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(st),notify.onSessionReady().promise.then(nt=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(st)])}}const configure=new ConfigurationFramework;transport==null||transport.http;var _$2;(_$2=session==null?void 0:session.session)==null||_$2.user;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",TRANSPORT:"transport",WEB_DATA:"webDataPipeline"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",ERROR_OCCURED:"error",DATA_TRACKED:"track"};class ServiceRegistry extends Map{register({application:et,resourceType:rt},st){this.set(`${et}:main`,st),this.set(`${et}:${rt}`,st)}findService(et,rt){return this.lookupService(et,rt)}findMainService({application:et},rt){return this.lookupService({application:et,resourceType:"main"},rt)}isRegistered({application:et,resourceType:rt}){return this.get(`${et}:${rt}`)!==void 0}lookupService({application:et,resourceType:rt},st){const nt=this.get(`${et}:${rt}`);if(nt===void 0)throw`Service not found: ${et}:${rt}`;return nt(st)}}const f$3=class{constructor(et){n$2(this,"checkHttpResponse",rt=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return rt}),this.context=et}get http(){return this.context.http()}async copy(et){const rt=await this.http.post("/archive/duplicate",{application:et.application,resourceId:et.resourceId});return this.checkHttpResponse(rt)}async publish(et){const rt=new FormData;return rt.append("title",et.title),rt.append("cover",et.cover),rt.append("coverName",et.cover.name),rt.append("coverType",et.cover.type),rt.append("teacherAvatar",et.teacherAvatar),rt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),rt.append("teacherAvatarType",et.teacherAvatar.type),rt.append("language",et.language),et.activityType.forEach(st=>{rt.append("activityType[]",st)}),et.subjectArea.forEach(st=>{rt.append("subjectArea[]",st)}),et.age.forEach(st=>{rt.append("age[]",st.toString())}),rt.append("description",et.description),et.keyWords.split(",").forEach(st=>{rt.append("keyWords[]",st.trim())}),rt.append("licence",et.licence),rt.append("pdfUri",`${window.location.origin}${this.getPrintUrl(et.resourceEntId)}`),rt.append("application",et.application?et.application:""),rt.append("resourceId",et.resourceId),rt.append("teacherSchool",et.userStructureName),await this.http.post("/appregistry/library/resource",rt,{headers:{"Content-Type":"multipart/form-data"}})}async createContext(et){const rt=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchContext(et){const rt=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchResource(et){const rt=await this.http.get(`/explorer/resources/${et.id}`,{queryParams:this.getResourceParams(et)});return this.checkHttpResponse(rt)}async createFolder(et){const rt=await this.http.post("/explorer/folders",this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async updateFolder(et){const rt=await this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async moveToFolder(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const st=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(st)}async listSubfolders(et){const rt=await this.http.get(`/explorer/folders/${et}`);return this.checkHttpResponse(rt)}async deleteAll(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const st=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(st)}async trashAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/trash",rt);return this.checkHttpResponse(nt)}async restoreAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/restore",rt);return this.checkHttpResponse(nt)}async mapAssetIdToIds({application:et,assetIds:rt}){const st=await this.searchContext({application:et,pagination:{startIdx:0,pageSize:rt.length+1},types:[],filters:{},asset_id:rt});return rt.map(nt=>{const ot=st.resources.find(at=>at.assetId===nt);if(ot===void 0)throw"explorer.assetid.notfound";return ot.id})}async getThumbnailPath(et){if(typeof et>"u")return et;if(typeof et=="string")if(et.startsWith("blob:")){const rt=await fetch(et).then(st=>st.blob());return`/workspace/document/${(await this.context.workspace().saveFile(rt,{visibility:"protected",application:this.getApplication()}))._id}`}else return et;else return`/workspace/document/${(await this.context.workspace().saveFile(et,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(et){const rt={application:et.application,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,trashed:et.trashed};if(et.types.length>0&&(rt.resource_type=et.types[0]),et.orders&&Object.entries(et.orders).length){const[[st,nt]]=Object.entries(et.orders);rt.order_by=`${st}:${nt}`}return et.filters&&Object.assign(rt,et.filters),typeof et.search=="string"&&(rt.search=et.search),typeof et.asset_id<"u"&&(rt.asset_id=[...et.asset_id]),typeof et.id<"u"&&(rt.id=et.id),rt}getResourceParams(et){return{application:et.application}}createFolderToBodyParams(et){return{application:et.application,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.getResourceType(),resourceIds:et.resourceIds,folderIds:et.folderIds}}};n$2(f$3,"registry",new ServiceRegistry),n$2(f$3,"register",f$3.registry.register.bind(f$3.registry)),n$2(f$3,"findService",f$3.registry.findService.bind(f$3.registry)),n$2(f$3,"findMainService",f$3.registry.findMainService.bind(f$3.registry)),n$2(f$3,"isRegistered",f$3.registry.isRegistered.bind(f$3.registry));let ResourceService=f$3;const APP$3="scrapbook",RESOURCE$3="scrapbook";class ScrapbookResourceService extends ResourceService{create(et){throw new Error("Method not implemented.")}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/scrapbook/${et.entId}`,{trashed:et.trashed?1:0,title:et.name,icon:rt,subTitle:et.description});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$3}getApplication(){return APP$3}getFormUrl(et){return et?`/scrapbook?folderid=${et}#/create-scrapbook/`:"/scrapbook#/create-scrapbook/"}getViewUrl(et){return`/scrapbook#/view-scrapbook/${et}`}getPrintUrl(et){return`/scrapbook/print#/print-scrapbook/${et}`}getEditUrl(et){return`/scrapbook#/edit-scrapbook/${et}`}getExportUrl(et){return`/scrapbook/exportHtml/${et}`}}ResourceService.register({application:RESOURCE$3,resourceType:RESOURCE$3},tt=>new ScrapbookResourceService(tt));const APP$2="homeworks",RESOURCE$2="homeworks";class HomeworksResourceService extends ResourceService{async create(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.post("/homeworks",{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats,folder:et.folder});return this.checkHttpResponse(st),{thumbnail:rt,entId:st._id}}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/homeworks/${et.entId}`,{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$2}getApplication(){return APP$2}getFormUrl(et){return et?`/homeworks?folderid=${et}#/create-homeworks/`:"/homeworks#/create-homeworks/"}getViewUrl(et){return`/homeworks#/view-homeworks/${et}`}getPrintUrl(et){return`/homeworks/print#/print-homeworks/${et}`}getEditUrl(et){return`/homeworks#/edit-homeworks/${et}`}getExportUrl(){throw new Error("Export not implemented.")}}ResourceService.register({application:RESOURCE$2,resourceType:RESOURCE$2},tt=>new HomeworksResourceService(tt));const APP$1="timelinegenerator",RESOURCE$1="timelinegenerator";class TimelineGeneratorResourceService extends ResourceService{async create(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",st=await this.http.post("/timelinegenerator/timelines",{headline:et.name,text:et.description,icon:rt,type:"default",folder:et.folder});return this.checkHttpResponse(st),st}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/timelinegenerator/timeline/${et.entId}`,{headline:et.name,text:et.description,icon:rt,trashed:!!et.trashed,_id:et.entId,type:"default"});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$1}getApplication(){return APP$1}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/timelinegenerator#/view/${et}`}getPrintUrl(et){return`/timelinegenerator/print#/print/${et}`}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$1,resourceType:RESOURCE$1},tt=>new TimelineGeneratorResourceService(tt));const APP$5="collaborativeeditor",RESOURCE$4="collaborativeeditor";class CollaborativeEditorResourceService extends ResourceService{async create(et){const{name:rt,description:st,thumbnail:nt,folder:ot}=et,at=nt?await this.getThumbnailPath(nt):"",lt=await this.http.post("/collaborativeeditor",{name:rt,description:st,thumbnail:at,folder:ot});return this.checkHttpResponse(lt),lt}async update(et){const{name:rt,description:st,thumbnail:nt,entId:ot}=et,at=await this.getThumbnailPath(nt),lt=await this.http.put(`/collaborativeeditor/${ot}`,{name:rt,description:st,thumbnail:at});return this.checkHttpResponse(lt),{thumbnail:at,entId:ot}}getResourceType(){return RESOURCE$4}getApplication(){return APP$5}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/collaborativeeditor#/view/${et}`}getPrintUrl(){throw new Error("Method not implemented.")}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$4,resourceType:RESOURCE$4},tt=>new CollaborativeEditorResourceService(tt));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,rt,st){if(mutexPromise[et]!==void 0&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const nt=rt();mutexPromise[et]=nt;const ot=await nt;return st(ot)&&(globalCache[et]=ot),ot}catch(nt){throw console.error(`Failed to retrieve value for: ${et}`,nt),nt}}clearCache(et){if(et)delete globalCache[et];else for(const rt in globalCache)globalCache.hasOwnProperty(rt)&&delete globalCache[rt]}async httpGet(et,rt){return this.fromCacheIfPossible(et,async()=>{const st=await this.http.get(et,rt),nt={...this.http.latestResponse};return{value:st,response:nt}},({response:st})=>!(st.status<200||st.status>=300))}async httpGetJson(et,rt){const{response:st,value:nt}=await this.httpGet(et,rt);if(st.status<200||st.status>=300)throw`Bad http status (${st.status}) for url: ${et}`;return nt}}class ConfService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get cdnDomain(){return configure.Platform.cdnDomain}get notify(){return this.context.notify()}async getConf(et){const[rt,st]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[nt,ot]=await Promise.all([this.getTheme({conf:rt,publicTheme:st===void 0}),this.getWebAppConf({app:et,applications:st??[]})]),at={app:et,applications:st??[],conf:rt,currentApp:ot,theme:nt};return this.notify.onAppConfReady().resolve(at),at}async getPublicConf(et){const{response:rt,value:st}=await this.cache.httpGet(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.APP_NOT_FOUND;return st}getCdnUrl(){}async savePreference(et,rt){this.http.putJson(`/userbook/preference/${et}`,rt)}async getPreference(et){const rt=await this.http.get(`/userbook/preference/${et}`);return this.http.isResponseError()||typeof rt=="string"?{}:JSON.parse(rt.preference)}async getThemeConf(et){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:et}},"exports.conf")}async getApplicationsList(){const et=await this.http.get("/applications-list");if(!(this.http.isResponseError()||typeof et=="string"))return et.apps}async getWebAppConf({app:et,applications:rt}){return rt.find(st=>{if(st!=null&&st.prefix)return(st==null?void 0:st.prefix.replace("/",""))===et})}async getTheme({version:et,conf:rt,publicTheme:st}){var nt;const ot=await this.http.get("/theme"),at=(nt=rt==null?void 0:rt.overriding)==null?void 0:nt.find(ft=>st?ft.parent==="theme-open-ent"&&ft.bootstrapVersion==="ode-bootstrap-neo":ft.child===(ot==null?void 0:ot.themeName)),lt=st?"default":(ot==null?void 0:ot.skinName)||(at==null?void 0:at.skins[0]),ut=(ot==null?void 0:ot.skin)||`/assets/themes/${at==null?void 0:at.child}/skins/${lt}/`,ct=at==null?void 0:at.skins,dt=at==null?void 0:at.bootstrapVersion.split("-").slice(-1)[0],ht=(at==null?void 0:at.parent)==="panda";return{basePath:`${this.cdnDomain}${ut}../../`,bootstrapVersion:dt,is1d:ht,logoutCallback:(ot==null?void 0:ot.logoutCallback)||"/",skin:at==null?void 0:at.child,skinName:lt,skins:ct,themeName:at==null?void 0:at.child,themeUrl:ut,npmTheme:(at==null?void 0:at.npmTheme)??void 0}}async getLogoutCallback(et){const{response:rt,value:st}=await this.cache.httpGet("/theme",{queryParams:{_:et}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return st.logoutCallback}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,rt,st="100x100"){return rt==="user"?`/userbook/avatar/${et}?thumbnail=${st}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(et,rt){return rt==="user"?`/userbook/annuaire#/${et}`:`/userbook/annuaire#/group-view/${et}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:et,name:rt})=>({id:et,displayName:rt,members:[]}))}async getBookMarkById(et){const{groups:rt,id:st,name:nt,users:ot}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:st,displayName:nt,groups:rt.map(({name:at,id:lt})=>({displayName:at,id:lt})),users:ot.map(({displayName:at,id:lt,profile:ut})=>({profile:ut,displayName:at,firstName:"",lastName:"",login:"",id:lt}))}}async saveBookmarks(et,{bookmarks:rt,groups:st,users:nt}){this.cache.clearCache("/directory/sharebookmark/all");const ot=nt.map(ht=>typeof ht=="string"?ht:ht.id),at=st.map(ht=>typeof ht=="string"?ht:ht.id),lt=rt.map(async ht=>{if(typeof ht=="string"){const{displayName:ft,groups:xt,id:yt,users:vt}=await this.getBookMarkById(ht),Et=vt.map(wt=>wt.id),bt=xt.map(wt=>wt.id);return{displayName:ft,id:yt,members:[...bt,...Et]}}else return Promise.resolve(ht)}),ut=(await Promise.all(lt)).map(ht=>ht.members).reduce((ht,ft)=>[...ht,...ft],[]),ct={name:et,members:[...ot,...at,...ut]},{id:dt}=await this.http.postJson("/directory/sharebookmark",ct);return{id:dt,displayName:et,members:ct.members}}}const loadedScripts={};class HttpService{constructor(et,rt){n$2(this,"axios"),n$2(this,"baseUrl"),n$2(this,"headers",{}),n$2(this,"_latestResponse"),this.context=et,this.axios=axios.create(rt)}fixBaseUrl(et){return et.startsWith("http://")||et.startsWith("https://")?et:this.baseUrl?this.baseUrl.endsWith("/")||et.startsWith("/")?`${this.baseUrl}${et}`:`${this.baseUrl}/${et}`:et}useBaseUrl(et){return this.baseUrl=et,this}useHeaders(et){return this.headers=et,this}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);et.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams));const st=rt.headers??{};return rt.headers={...st,...this.headers},rt}else return this.axios.defaults}toCdnUrl(et){et=this.fixBaseUrl(et);const rt=this.context.conf().getCdnUrl()||"";if(rt.length>0&&et!=="/conf/public"){const st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}return et}mapAxiosError(et,rt){et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN};const{status:st,statusText:nt,headers:ot,data:at}=this._latestResponse;return rt!=null&&rt.disableNotifications||notify.events().publish(LAYER_NAME.TRANSPORT,{name:EVENT_NAME.ERROR_OCCURED,data:{params:rt,response:{status:st,statusText:nt,headers:ot},payload:at}}),at}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}async get(et,rt){try{const st=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async post(et,rt,st){try{const nt=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async postFile(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async postJson(et,rt,st){const nt=this.toAxiosConfig();nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async put(et,rt,st){try{const nt=await this.axios.put(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.put(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.put(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async delete(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async deleteJson(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),{data:rt});return this.mapAxiosResponse(st)}catch(st){throw this.mapAxiosError(st)}}getScript(et,rt,st){const nt=st??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${nt.split(".")[0]}={};${at};return ${nt};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts[et]?Promise.resolve():this.getScript(et,rt).then(st=>{loadedScripts[et]=!0})}}class RightService{constructor(et){this.context=et}get session(){return this.context.session()}parseResourceRight(et){const rt=et.split(":");if(rt.length===2){if(rt[0]==="creator")return{id:rt[1],right:"creator",type:"creator"}}else return rt.length===3?{id:rt[1],right:rt[2],type:rt[0]}:void 0}parseResourceRights(et){return et.map(rt=>this.parseResourceRight(rt)).filter(rt=>rt!==void 0)}hasResourceRight({id:et,groupIds:rt},st,nt){const ot=nt.map(at=>typeof at=="string"?this.parseResourceRight(at):at).filter(at=>at!==void 0);for(const at of ot)if(at.id===et&&at.type==="creator"||at.id===et&&at.type==="user"&&at.right===st||rt.includes(at.id)&&at.type==="group"&&at.right===st)return!0;return!1}async sessionHasResourceRight(et,rt){try{const st=await this.session.getUser();return!!st&&this.hasResourceRight({groupIds:st.groupsIds,id:st.userId},et,rt)}catch(st){return console.error(`Unexpected error ${st} in sessionHasResourceRight()`),!1}}async sessionHasAtLeastOneResourceRight(et,rt){for(const st of et)if(await this.sessionHasResourceRight(st,rt))return!0;return!1}async sessionHasResourceRightForEachList(et,rt){let st=0;for(const nt of rt)await this.sessionHasResourceRight(et,nt)&&st++;return st===rt.length}async sessionHasAtLeastOneResourceRightForEachList(et,rt){for(const st of et){let nt=0;for(const ot of rt)await this.sessionHasResourceRight(st,ot)&&nt++;if(nt===rt.length)return!0}return!1}hasWorkflowRight(et,rt){return rt.findIndex(st=>st===et)!==-1}async sessionHasWorkflowRight(et){try{const rt=await this.session.getUser();return!!rt&&this.hasWorkflowRight(et,rt.authorizedActions.map(st=>st.name))}catch(rt){return console.error(`Unexpected error ${rt} in sessionHasWorkflowRight()`),!1}}async sessionHasWorkflowRights(et){const rt={};try{const st=await this.session.getUser();for(const nt of et)rt[nt]=!!st&&this.hasWorkflowRight(nt,st.authorizedActions.map(ot=>ot.name))}catch(st){console.error(`Unexpected error ${st} in sessionHasWorkflowRights()`);for(const nt of et)rt[nt]=!1}return rt}}class SessionService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get conf(){return this.context.conf()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const et=await this.getUser(),[rt,st,nt,ot,at]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:st,currentLanguage:rt,userDescription:nt,userProfile:ot,bookmarkedApps:at}}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),this.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}async logout(){const et=await this.conf.getLogoutCallback();return this.http.get("/auth/logout?callback="+et).finally(()=>{})}async latestQuotaAndUsage(et){const rt={quota:0,storage:0};if(!et)return rt;try{return await this.http.get(`/workspace/quota/user/${et==null?void 0:et.userId}`)}catch(st){return console.error(st),rt}}async getCurrentLanguage(et){const rt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let st;return rt?st=await this.loadUserLanguage():st=await this.loadDefaultLanguage(),st}catch(st){console.error(st)}}async loadUserLanguage(){try{const et=await this.http.get("/userbook/preference/language");return JSON.parse(et.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:et,value:rt}=await this.cache.httpGet("/auth/oauth2/userinfo");if(!(et.status<200||et.status>=300)&&typeof rt=="object")return rt;throw ERROR_CODE.NOT_LOGGED_IN}hasWorkflow({workflowName:et,user:rt}){return et===void 0||(rt==null?void 0:rt.authorizedActions.findIndex(st=>st.name===et))!==-1}async loadDescription(et){if(!et)return{};try{const[rt,st]=await Promise.all([this.getUserProfile({options:{requestName:"refreshAvatar"}}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...st,profiles:rt}}catch(rt){return console.error(rt),{}}}async getBookmarks(et){if(!et)return[];const rt=await this.http.get("/userbook/preference/apps");rt.preference||(rt.preference=null);const st=JSON.parse(rt.preference);let nt;nt=st,nt||(nt={bookmarks:[],applications:[]});const ot=[];return nt.bookmarks.forEach((at,lt)=>{const ut=((et==null?void 0:et.apps)||[]).find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);ot.push(ct)}}),ot}async getUserProfile(et={}){var rt,st;const{options:nt={},params:ot={}}=et,at=new URLSearchParams(ot).toString(),lt=`/userbook/api/person${at?`?${at}`:""}`,{response:ut,value:ct}=await this.cache.httpGet(lt,nt);return ut.status<200||ut.status>=300||typeof ct=="string"?["Guest"]:((st=(rt=ct==null?void 0:ct.result)==null?void 0:rt[0])==null?void 0:st.type)||["Guest"]}async isAdml(){const et=await this.getUser();return(et==null?void 0:et.functions.ADMIN_LOCAL)!==void 0}async getWebApp(et){const rt=await this.getUser();return rt==null?void 0:rt.apps.find(st=>{var nt;return st!=null&&st.prefix?(st==null?void 0:st.prefix.replace("/",""))===et||!1:st!=null&&st.address&&((nt=st.address)==null?void 0:nt.split("/")[1])===et||!1})}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(et){this.context=et}get http(){return this.context.http()}async getIdiom(et,rt){await Promise.all([this.addBundlePromise(et,"/i18n"),this.addBundlePromise(et,`/${rt}/i18n`)])}translate(et,rt){et=et??"";let st=bundle[et]===void 0?et:bundle[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et,rt){return this.loadBundlePromise(et,rt)}addBundle(et,rt,st){this.loadBundle(et,rt,st)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises[rt]}loadBundle(et,rt,st){const nt=promises[rt];if(nt)st&&nt.then(st).catch(st);else{const ot=new Promisified;promises[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),this.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle,lt),typeof st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle[rt]!="string"&&(bundle[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class StringUtils{static removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class ShareService{constructor(et){this.context=et}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(et,rt,st){const nt=StringUtils.removeAccents(st).toLowerCase(),ot=await this.cache.httpGetJson(`/${et}/share/json/${rt}?search=${st}`),at=ot.users.visibles.filter(({username:ut,firstName:ct,lastName:dt,login:ht})=>{const ft=StringUtils.removeAccents(dt||"").toLowerCase(),xt=StringUtils.removeAccents(ct||"").toLowerCase(),yt=StringUtils.removeAccents(ut||"").toLowerCase(),vt=StringUtils.removeAccents(ht||"").toLowerCase();return yt.includes(nt)||xt.includes(nt)||ft.includes(nt)||vt.includes(nt)}).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"user"),displayName:ut.username,id:ut.id,profile:ut.profile,type:"user"})),lt=ot.groups.visibles.filter(({name:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"group"),displayName:ut.name,id:ut.id,type:"group",structureName:ut.structureName}));return[...(await this.directory.getBookMarks()).filter(({displayName:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:ut.displayName,id:ut.id,type:"sharebookmark"})),...at,...lt]}async getShareMapping(et){const rt=await this.cache.httpGetJson(`/${et}/rights/sharing`);for(const st of Object.keys(rt))if(st.includes(".")){const nt=st.split(".")[1],ot=rt[st];delete rt[st],rt[nt]=ot}return rt}getActionsAvailableFor({id:et,type:rt},st,nt){const ot=(rt==="user"?st.users.checked[et]:st.groups.checked[et])||[],at=Object.keys(nt),lt=[];for(const ut of at)nt[ut].filter(ct=>ot.includes(ct)).length>0&<.push(ut);return lt}async getRightsForResource(et,rt){const st=await this.directory.getBookMarks(),nt=`/${et}/share/json/${rt}?search=`,ot=await this.cache.httpGetJson(nt),at=await this.getShareMapping(et),lt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),ut=Object.keys(ot.users.checked).map(xt=>ot.users.visibles.find(yt=>yt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const yt=this.getActionsAvailableFor({id:xt.id,type:"user"},ot,at);return{id:xt.id,type:"user",displayName:xt.username,profile:xt.profile,avatarUrl:this.directory.getAvatarUrl(xt.id,"user"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"user"),actions:yt.map(vt=>{const Et=lt[vt];return{displayName:vt,id:vt,priority:Et.priority}})}}).sort((xt,yt)=>(xt.displayName||"").localeCompare(yt.displayName)),ct=Object.keys(ot.groups.checked).map(xt=>ot.groups.visibles.find(yt=>yt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const yt=this.getActionsAvailableFor({id:xt.id,type:"group"},ot,at);return{id:xt.id,type:"group",displayName:xt.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(xt.id,"group"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"group"),actions:yt.map(vt=>{const Et=lt[vt];return{displayName:vt,id:vt,priority:Et.priority}})}}).sort((xt,yt)=>(xt.displayName||"").localeCompare(yt.displayName)),dt=[...ut,...ct],ht=ot.groups.visibles.map(({groupDisplayName:xt,id:yt,name:vt})=>({displayName:xt||vt,id:yt})),ft=ot.users.visibles.map(({id:xt,profile:yt,username:vt,firstName:Et,lastName:bt,login:wt})=>({displayName:vt,firstName:Et,lastName:bt,login:wt,profile:yt,id:xt}));return{rights:dt,visibleBookmarks:st,visibleGroups:ht,visibleUsers:ft}}async saveRights(et,rt,st){const nt=await this.getShareMapping(et),ot={bookmarks:{},groups:{},users:{}};for(const lt of st){const ut=lt.actions.map(dt=>nt[dt.id]).reduce((dt,ht)=>Array.isArray(ht)?[...dt,...ht]:dt,[]),ct=[...new Set(ut)];ct.length>0&&(lt.type==="user"?ot.users[lt.id]=ct:lt.type==="group"?ot.groups[lt.id]=ct:ot.bookmarks[lt.id]=ct)}const at=`/${et}/share/resource/${rt}`;return this.cache.clearCache(`/${et}/share/json/${rt}?search=`),await this.http.putJson(at,ot)}async getActionsForApp(et){const rt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),st=await this.getShareMapping(et);return Object.keys(rt).map(nt=>{const ot=rt[nt];return{displayName:nt,id:nt,priority:ot.priority,requires:ot.requires}}).filter(nt=>{var ot;return((ot=st[nt.id])==null?void 0:ot.length)>0}).sort((nt,ot)=>nt.priority-ot.priority)}}const defaultMappers={csv:function({type:tt,extension:et}){return a$2.INSTANCE.isCsvLike(tt,et)},doc:function({type:tt,extension:et}){return a$2.INSTANCE.isWordLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("wordprocessing")!==-1},xls:function({type:tt,extension:et}){return a$2.INSTANCE.isExcelLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("spreadsheet")!==-1||tt.indexOf("ms-excel")!==-1},img:function({type:tt}){return tt.indexOf("image")!==-1},pdf:function({type:tt}){return tt.indexOf("pdf")!==-1||tt==="application/x-download"},ppt:function({type:tt,extension:et}){return a$2.INSTANCE.isPowerpointLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("presentation")!==-1||tt.indexOf("powerpoint")!==-1},txt:function({type:tt,extension:et}){return a$2.INSTANCE.isTxtLike(tt,et)},md:function({type:tt,extension:et}){return a$2.INSTANCE.isMdLike(tt,et)},video:function({type:tt}){return tt.indexOf("video")!==-1},audio:function({type:tt}){return tt.indexOf("audio")!==-1},zip:function({type:tt}){return tt.indexOf("zip")!==-1||tt.indexOf("rar")!==-1||tt.indexOf("tar")!==-1||tt.indexOf("7z")!==-1}},R$2=class sm{static getRole(et){var rt,st;return sm.role((rt=et.metadata)==null?void 0:rt["content-type"],!1,(st=et.metadata)==null?void 0:st.extension)}static role(et,rt=!1,st){if(st&&(st=st.trim()),!et)return"unknown";this.roleMappers||console.warn("[DocumentHelper.role] should not have empty roles",this);const nt={type:et,previewRole:rt,extension:st};for(const ot of this.roleMappers){const at=ot(nt);if(at)return at}return"unknown"}};n$2(R$2,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=R$2;class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}extractMetadata(et){const rt=et.name||"",st=rt.split("."),nt=et.type||"application/octet-stream",ot=st.length>1?st[st.length-1]:"",at={"content-type":nt,filename:rt,size:et.size,extension:ot,role:DocumentHelper.role(nt,!1,ot)},lt=rt.replace("."+at.extension,""),ut=at.extension?lt+"."+at.extension:lt;return{basename:lt,fullname:ut,metadata:at}}async saveFile(et,rt){const{fullname:st,metadata:nt}=this.extractMetadata(et),ot=new FormData;ot.append("file",et,st);const at=[];((rt==null?void 0:rt.visibility)==="public"||(rt==null?void 0:rt.visibility)==="protected")&&at.push(`${rt.visibility}=true`),rt!=null&&rt.application&&at.push(`application=${rt.application}`),nt.role==="img"&&at.push("quality=1"),rt!=null&&rt.parentId&&at.push(`parentId=${rt.parentId}`);const lt=await this.http.postFile(`/workspace/document?${at.join("&")}`,ot);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return lt}async updateFile(et,rt,st){const{fullname:nt,metadata:ot}=this.extractMetadata(rt),at=new FormData;at.append("file",rt,nt);const lt=[];ot.role==="img"&<.push("quality=1"),st!=null&&st.alt&<.push(`alt=${st.alt}`),st!=null&&st.legend&<.push(`legend=${st.legend}`),st!=null&&st.name&<.push(`name=${st.name}`);const ut=await this.http.putFile(`/workspace/document/${et}?${lt.join("&")}`,at);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return ut}async deleteFile(et){const rt=et.map(st=>st._id);if(rt.length==0)Promise.resolve(null);else if(await this.http.deleteJson("/workspace/documents",{ids:rt}),this.http.isResponseError())throw this.http.latestResponse.statusText}async acceptDocuments(et){const rt=await this.context.session().getUser();return st=>st.deleted&&st.trasher?(rt==null?void 0:rt.userId)==st.trasher:!0}async searchDocuments(et){const rt=et.filter!=="external"||et.parentId?await this.http.get("/workspace/documents",{queryParams:{...et,_:new Date().getTime()}}):[],st=await this.acceptDocuments(et);return rt.filter(st)}async listDocuments(et,rt){return this.searchDocuments({filter:et,parentId:rt,includeall:!0})}async transferDocuments(et,rt,st="protected"){const nt=[];if(et.forEach(ot=>{(st==="public"&&!ot.public||!ot.public&&!ot.protected)&&nt.push(ot)}),nt.length>0){const ot=await this.http.post("/workspace/documents/transfer",{application:rt,visibility:st,ids:nt.map(at=>at._id)});if(this.http.isResponseError())throw this.http.latestResponse.statusText;return nt.forEach((at,lt)=>{const ut=et.findIndex(ct=>ct._id===at._id);0<=ut&&ut<et.length&&(et[ut]=ot[lt])}),et.filter(at=>!!at)}return et}getThumbnailUrl(et,rt=0,st=0){var nt,ot;const at=rt>0||st>0?`${rt}x${st}`:"120x120";if(typeof et=="string")return et.includes("data:image")||et.includes("thumbnail")?et:`${et}${et.includes("?")?"&":"?"}thumbnail=${at}`;{const lt=`/workspace/${et.public?"pub/":""}document/${et._id}?thumbnail=`,ut=et.thumbnails;if((ot=(nt=et.metadata)==null?void 0:nt["content-type"])!=null&&ot.includes("video")){const ct=ut&&Object.keys(ut).length>0?Object.keys(ut)[0]:null;return ct?lt+ct:null}else return lt+at}}listFolder(et,rt=!1,st,nt){const ot={filter:et,hierarchical:rt,parentId:st,directShared:nt};return this.http.get("/workspace/folders/list",{queryParams:ot})}listOwnerFolders(et,rt){return this.listFolder("owner",et,rt)}listSharedFolders(et,rt){return this.listFolder("shared",et,rt,!0)}createFolder(et,rt){const st=new FormData;return st.append("name",et),rt&&st.append("parentFolderId",rt),this.http.postFile("/workspace/folder",st)}}let ATTag;class AnalyticsService{constructor(tt){this.context=tt}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(tt,et){const[rt]=await Promise.all([this.getXitiConfig(et.name.toLowerCase()),this.loadXitiScript()]);if(!rt||!ATInternet)return;let st=rt.LIBELLE_SERVICE.default||null;for(const nt in rt.LIBELLE_SERVICE)if(nt!=="default"&&tt.indexOf(nt)>=0){st=rt.LIBELLE_SERVICE[nt];break}ATTag=new ATInternet.Tracker.Tag({site:rt.STRUCT_ID}),ATTag.setProps({SERVICE:st,TYPE:rt.TYPE,OUTIL:rt.OUTIL,UAI:rt.STRUCT_UAI,PROJET:rt.PROJET,EXPLOITANT:rt.EXPLOITANT,PLATEFORME:rt.PLATFORME,PROFIL:rt.PROFILE},!0),ATTag.identifiedVisitor.set({id:rt.ID_PERSO,category:rt.PROFILE}),ATTag.page.set({name:(et==null?void 0:et.prefix)==="userbook"?"directory":et==null?void 0:et.prefix,chapter1:"",chapter2:"",chapter3:"",level2:rt.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(tt){const[et,rt]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(et!=null&&et.type))throw ERROR_CODE.MALFORMED_DATA;return rt!=null&&rt.active&&(et.xiti=await this.getXitiTrackingParams(rt,tt)),et.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(tt,et){if(!tt.structureMap||!et)return;const rt=await this.session.getUser(),st=await this.session.getUserProfile();let nt;if(!(rt!=null&&rt.structures))return;for(const ct of rt.structures){const dt=tt.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:tt.ID_PROJET,EXPLOITANT:tt.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:tt.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st&&st.length>0?ut[st[0]]??"":""}}}const w$1=class X0{constructor(et){this.context=et}get http(){return this.context.http()}get conf(){return this.context.conf()}async getVideoConf(){var et;const rt=await this.conf.getPublicConf(APP$4.VIDEO);return{maxWeight:(rt==null?void 0:rt["max-videosize-mbytes"])??X0.MAX_WEIGHT,maxDuration:(rt==null?void 0:rt["max-videoduration-minutes"])??X0.MAX_DURATION,acceptVideoUploadExtensions:((et=rt==null?void 0:rt["accept-videoupload-extensions"])==null?void 0:et.map(st=>st.toUpperCase()))??[]}}async upload({data:et,appCode:rt,captation:st,duration:nt}){if(!et.file)throw new Error("Invalid video file.");if(!et.filename)throw new Error("Invalid video filename");const ot=`${et.browser.name} ${et.browser.version}`,at=new FormData;at.append("device",et.device||""),at.append("browser",ot),at.append("url",et.url),at.append("app",rt),at.append("file",et.file,et.filename),at.append("weight",""+et.file.size),at.append("captation",""+st);let lt=`/video/encode?captation=${st}`;nt&&(lt+=`&duration=${nt}`);const ut=await this.http.post(lt,at,{headers:{"Content-Type":"multipart/form-data"}});if(ut.state=="running"){let ct=0,dt=1;do{const ht=dt+ct;await new Promise(xt=>setTimeout(xt,ht*1e3)),ct=dt,dt=Math.min(8,ht);const ft=await this.http.get(`/video/status/${ut.processid}`);if(ft.state=="succeed")return ft.videoworkspaceid&&ft.videosize&&this.context.data().trackVideoSave(ft.videoworkspaceid,Math.round(nt),ft.videosize,st,et.url,ot,et.device),ft;if(ft.state=="error")break}while(!0)}throw new Error("Video cannot be uploaded.")}};n$2(w$1,"MAX_WEIGHT",50),n$2(w$1,"MAX_DURATION",3);let VideoService=w$1;class EmbedderService{constructor(et){this.context=et}get http(){return this.context.http()}async getDefault(){return this.http.get("/infra/embed/default")}async getCustom(){return this.http.get("/infra/embed/custom")}getProviderFromUrl(et,rt){for(const st of et)if(this.isUrlFromProvider(rt,st))return st}urlIsFromPattern(et,rt){const st=new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)","g"),nt=new RegExp("{[^}]*}","g");let ot=!0;const at=rt.match(st)||[],lt=[];return(rt.match(nt)||[]).forEach((ut,ct)=>{ut.includes("ignore")||lt.push(at[ct])}),lt.forEach(ut=>{if(!et.includes(ut)){ot=!1;return}}),ot}isUrlFromProvider(et,rt){typeof rt.url=="string"&&(rt.url=[rt.url]);for(const st of rt.url)if(this.urlIsFromPattern(et,st))return!0;return!1}getEmbedCodeForProvider(et,rt){for(const st of et.url)if(this.urlIsFromPattern(rt,st)){const nt=new RegExp("{[a-zA-Z0-9_.]+}","g"),ot=st.match(nt)||[];let at=et.embed;for(const lt of ot){let ut=st.split(lt)[0];const ct=ut.split("}");ct.length>1&&(ut=ct[ct.length-1]);let dt=rt.split(ut)[1];if(!dt)continue;const ht=st.split(lt)[1].split("{")[0];ht&&(dt=dt.split(ht)[0]);const ft=new RegExp("\\"+lt.replace(/}/,"\\}"),"g");at=at.replace(ft,dt)}return at}return""}}class AbstractBehaviourService{constructor(et){n$2(this,"_cache"),this.context=et,this._cache=new CacheService(this.context)}getApplication(){return this.APP}getResourceType(){return this.RESOURCE}httpGet(et,rt){return this._cache.httpGetJson(et,rt)}dataToResource({modified:et,...rt}){const st=typeof et=="string"?et:et!=null&&et.$date?""+et.$date:"";return{application:this.RESOURCE,name:rt.title,creatorId:rt.owner,creatorName:rt.ownerName,thumbnail:rt.icon,assetId:rt._id,modifiedAt:st,shared:rt.shared,path:rt.path}}}class ActualitesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","actualites"),n$2(this,"RESOURCE","actualites")}async loadResources(){return(await this.httpGet("/actualites/linker/infos")).map(et=>{let rt;return et.thread_icon?rt=et.thread_icon+"?thumbnail=48x48":rt="/img/icons/glyphicons_036_file.png",this.dataToResource({title:et.title+" ["+et.thread_title+"]",ownerName:et.username,owner:et.owner,icon:rt,path:"/actualites#/view/thread/"+et.thread_id+"/info/"+et._id,_id:`${et.thread_id}#${et._id}`,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class BlogBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","blog"),n$2(this,"RESOURCE","blog")}loadResources(){return new Promise(async(et,rt)=>{try{const st=await this.httpGet("/blog/linker"),nt=[];st.forEach(ot=>{ot.thumbnail?ot.thumbnail=ot.thumbnail+"?thumbnail=48x48":ot.thumbnail="/img/illustrations/blog.svg";const at=ot.fetchPosts.map(lt=>this.dataToResource({owner:ot.author.userId,ownerName:ot.author.username,title:lt.title+" ["+ot.title+"]",_id:`${ot._id}#${lt._id}`,icon:ot.thumbnail,path:`/blog/id/${ot._id}/post/${lt._id}`,shared:!!(ot.shared&&ot.shared.length>=0),modified:ot.modified}));nt.push(...at)}),et(nt)}catch(st){rt(st)}})}}class CollaborativewallBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","collaborativewall"),n$2(this,"RESOURCE","collaborativewall")}async loadResources(){return(await this.httpGet("/collaborativewall/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.icon?et.icon:"/img/illustrations/collaborative-wall-default.png",path:"/collaborativewall#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class CommunityBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","community"),n$2(this,"RESOURCE","community")}async loadResources(){return(await this.httpGet("/community/listallpages")).map(et=>{let rt;return typeof et.thumbnail>"u"||et.thumbnail===""?rt="/img/icons/glyphicons_036_file.png":rt=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:et.name,icon:rt,path:"/community#/view/"+et.id,_id:et.id,owner:"",ownerName:"",shared:!!(et.shared&&et.shared.length>=0),modified:et.name})})}}class ExercizerBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","exercizer"),n$2(this,"RESOURCE","exercizer")}async loadResources(){return(await this.httpGet("/exercizer/subjects-scheduled")).map(et=>{const rt=et.picture?et.picture+"?thumbnail=48x48":"/img/illustrations/exercizer.svg";let st,nt=!1;const ot=JSON.parse(et.scheduled_at);return ot.groupList.length>0?(nt=!0,st=ot.groupList[0].name):ot.userList.length>0?(nt=!0,st=ot.userList[0].name):st="",ot.groupList.length+ot.userList.length>1&&(st+="..."),this.dataToResource({title:et.title,owner:et.owner,ownerName:st,icon:rt,path:"/exercizer#/linker/"+et.id,_id:""+et.id,shared:nt,modified:et.modified})})}}class FormulaireBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","formulaire"),n$2(this,"RESOURCE","formulaire")}async loadResources(){return(await this.httpGet("/formulaire/forms/linker")).map(et=>(et.picture||(et.picture="/formulaire/public/img/logo.svg"),this.dataToResource({_id:""+et.id,icon:et.picture,title:et.title,ownerName:et.owner_name,owner:et.owner_id,path:et.is_public?`${window.location.origin}/formulaire-public#/form/${et.public_key}`:`${window.location.origin}/formulaire#/form/${et.id}/${et.rgpd?"rgpd":"new"}`,shared:!!(et.shared&&et.shared.length>=0),modified:""+et.date_modification})))}}class ForumBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","forum"),n$2(this,"RESOURCE","forum")}async loadResources(){return(await this.httpGet("/forum/categories")).map(et=>this.dataToResource({_id:et._id,title:et.name,icon:et.icon||"/img/illustrations/forum.svg",path:"/forum#/view/"+et._id,ownerName:et.owner.displayName,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class HomeworksBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","homeworks"),n$2(this,"RESOURCE","homeworks")}async loadResources(){return(await this.httpGet("/homeworks/list")).filter(et=>et.owner&&et.trashed===0).map(et=>this.dataToResource({title:et.title,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/homeworks.svg",path:"/homeworks#/view-homeworks/"+et._id,_id:""+et._id,shared:typeof et.shared<"u",modified:et.modified}))}}class MagnetoBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","magneto"),n$2(this,"RESOURCE","magneto")}async loadResources(){const{all:et}=await this.httpGet("/magneto/boards/editable");return et.map(rt=>this.dataToResource({_id:rt._id,title:rt.title,icon:rt.imageUrl,owner:rt.ownerId,ownerName:rt.ownerName,path:`/magneto#/board/${rt._id}/view`,shared:!!(rt.shared&&rt.shared.length>=0),modified:""+rt.modificationDate}))}}class MindmapBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","mindmap"),n$2(this,"RESOURCE","mindmap")}async loadResources(){return(await this.httpGet("/mindmap/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/mindmap-default.png",path:"/mindmap#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class PagesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","pages"),n$2(this,"RESOURCE","pages")}async loadResources(){const et=await this.httpGet("/pages/list/all"),rt=[];return et.forEach(st=>{var nt;const ot=st.thumbnail?st.thumbnail+"?thumbnail=48x48":"/img/illustrations/pages.svg";rt.push(this.dataToResource({title:st.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id,_id:st._id,shared:typeof st.shared<"u",modified:st.modified})),(nt=st.pages)==null||nt.forEach(at=>{rt.push(this.dataToResource({title:at.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id+"/"+at.titleLink,_id:st._id+"/"+at.titleLink,shared:typeof st.shared<"u",modified:st.modified}))})}),rt}}class PollBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","poll"),n$2(this,"RESOURCE","poll")}async loadResources(){return(await this.httpGet("/poll/list/all")).map(et=>{const rt=et.icon?et.icon+"?thumbnail=48x48":"/img/icons/glyphicons_036_file.png";return this.dataToResource({title:et.question,ownerName:et.owner.displayName,icon:rt,path:"/poll#/view/"+et._id,_id:et._id,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class ScrapbookBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","scrapbook"),n$2(this,"RESOURCE","scrapbook")}async loadResources(){return(await this.httpGet("/scrapbook/list/all")).map(et=>{const rt=et.icon||"/img/illustrations/scrapbook.svg";return this.dataToResource({title:et.name,owner:et.owner.userId,ownerName:et.owner.displayName,icon:rt,path:"/scrapbook#/view-scrapbook/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class TimelinegeneratorBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","timelinegenerator"),n$2(this,"RESOURCE","timelinegenerator")}loadResources(){return new Promise(async(et,rt)=>{try{const st=(await this.httpGet("/timelinegenerator/timelines")).map(nt=>{const ot=nt.icon||"/img/illustrations/timeline-default.png";return this.dataToResource({title:nt.headline,ownerName:nt.owner.displayName,owner:nt.owner.userId,icon:ot,path:"/timelinegenerator#/view/"+nt._id,_id:nt._id,shared:typeof nt.shared<"u",modified:nt.modified})});et(st)}catch(st){rt(st)}})}}class WikiBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","wiki"),n$2(this,"RESOURCE","wiki")}async loadResources(){return(await this.httpGet("/wiki/listallpages?visible=true")).map(et=>et.pages.map(rt=>{let st;return typeof et.thumbnail>"u"||et.thumbnail===""?st="/img/icons/glyphicons_036_file.png":st=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:rt.title+" ["+et.title+"]",ownerName:et.owner.displayName,owner:et.owner.userId,icon:st,path:"/wiki#/view/"+et._id+"/"+rt._id,_id:`${et._id}#${rt._id}`,shared:typeof et.shared<"u",modified:rt.modified})})).flat()}}class WorkspaceBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","workspace"),n$2(this,"RESOURCE","workspace")}loadResources({search:et,asset_id:rt}){return new Promise(async(st,nt)=>{try{let ot="/workspace/documents?filter=all&hierarchical=true";rt&&rt.length?ot+=`&search=${et}`:et&&et.length&&(ot+=`&search=${et}`);const at=(await this.httpGet(ot)).filter(lt=>!lt.deleted).map(lt=>{const ut=lt.metadata["content-type"]&<.metadata["content-type"].indexOf("image")!==-1?`/workspace/document/${lt._id}?thumbnail=120x120`:"/img/icons/unknown-large.png";return this.dataToResource({title:lt.name,ownerName:lt.ownerName,owner:lt.owner,icon:ut,path:`/workspace/document/${lt._id}`,_id:lt._id,shared:!!(lt.shared&<.shared.length>=0),modified:lt.modified})});st(at)}catch(ot){nt(ot)}})}}const y$2=class{static async initialize(et,rt){const st=et.http();if(!this.resourceProducingApps.length){this.resourceProducingApps=[rt,"workspace"];try{const[nt,ot]=await Promise.all([st.get("/resources-applications"),et.session().getUser()]);ot!=null&&ot.apps&&nt!=null&&nt.length&&(this.resourceProducingApps=nt.filter(at=>ot.apps.some(lt=>lt.address.includes(at))))}catch(nt){console.warn("Failed to load resource-producing apps:",nt)}}return this.resourceProducingApps}static async registerBehaviours(et){this.resourceProducingApps.forEach(rt=>{const st={application:et,resourceType:rt};this.registry.register(st,nt=>this.serviceFor(nt,et,rt))})}static serviceFor(et,rt,st){let nt;switch(st){case"timelinegenerator":nt=new TimelinegeneratorBehaviour(et);break;case"workspace":nt=new WorkspaceBehaviour(et);break;case"blog":nt=new BlogBehaviour(et);break;case"actualites":nt=new ActualitesBehaviour(et);break;case"wiki":nt=new WikiBehaviour(et);break;case"pages":nt=new PagesBehaviour(et);break;case"poll":nt=new PollBehaviour(et);break;case"community":nt=new CommunityBehaviour(et);break;case"mindmap":nt=new MindmapBehaviour(et);break;case"forum":nt=new ForumBehaviour(et);break;case"homeworks":nt=new HomeworksBehaviour(et);break;case"scrapbook":nt=new ScrapbookBehaviour(et);break;case"collaborativewall":nt=new CollaborativewallBehaviour(et);break;case"exercizer":nt=new ExercizerBehaviour(et);break;case"formulaire":nt=new FormulaireBehaviour(et);break;case"magneto":nt=new MagnetoBehaviour(et);break;default:throw ERROR_CODE.NOT_SUPPORTED}return nt.APP=rt,nt}};n$2(y$2,"registry",new ServiceRegistry),n$2(y$2,"findBehaviour",y$2.registry.findService.bind(y$2.registry)),n$2(y$2,"hasBehaviour",y$2.registry.isRegistered.bind(y$2.registry)),n$2(y$2,"resourceProducingApps",[]);let SnipletsService=y$2;const SEND_ALL="*";class WebBroker{constructor(et){n$2(this,"subscription"),this.odeServices=et}get http(){return this.odeServices.http()}get events(){return this.odeServices.notify().events()}dispatchEvent(et,rt){rt.findIndex(st=>SEND_ALL===st||et.data["event-type"]===st)>=0&&this.http.post("/infra/event/web/store",et.data,{disableNotifications:!0})}initialize(et){if(et===void 0||et.send===void 0||et.send.length>0){const rt=(et==null?void 0:et.send)??[SEND_ALL];this.subscription=this.events.subscribe(LAYER_NAME.WEB_DATA,st=>this.dispatchEvent(st,rt))}return this}destroy(){this.subscription&&(this.subscription.revoke(),delete this.subscription)}}class DataService{constructor(et){n$2(this,"_webBroker"),n$2(this,"app"),n$2(this,"user"),n$2(this,"profile"),this.odeServices=et}get conf(){return this.odeServices.conf()}get notify(){return this.odeServices.notify()}async initialize(){try{const{app:et}=await this.notify.onAppConfReady().promise;this.app=et,this.user=await this.odeServices.session().getUser(),this.profile=await this.odeServices.session().getUserProfile();const{["data-service"]:rt}=await this.conf.getPublicConf(et);this._webBroker=new WebBroker(this.odeServices).initialize(rt==null?void 0:rt.web)}catch{console.log("DataService not initialized, usage data unavailable.")}}predestroy(){this._webBroker&&(this._webBroker.destroy(),delete this._webBroker)}trackWebEvent(et){this.notify.events().publish(LAYER_NAME.WEB_DATA,{name:EVENT_NAME.DATA_TRACKED,data:et})}addUserInfos(et){return this.user&&(et.userId=this.user.userId,et.structure=this.user.structureNames[0]),this.profile&&(et.profil=this.profile[0]),et}trackVideoSave(et,rt,st,nt,ot,at,lt){const ut=this.addUserInfos({"event-type":"VIDEO_SAVE",module:"video",video_id:et,browser:at,duration:Math.round(rt),weight:st,source:nt?"CAPTURED":"UPLOADED",url:ot});this.app&&(ut["override-module"]=this.app),lt&&(ut.device_type=lt),this.trackWebEvent(ut)}trackVideoRead(et,rt,st,nt,ot){const at=this.addUserInfos({"event-type":"VIDEO_READ",module:"video",video_id:et,browser:nt,source:rt?"CAPTURED":"UPLOADED",url:st});this.app&&(at["override-module"]=this.app),ot&&(at.device_type=ot),this.trackWebEvent(at)}trackSpeechAndText(et){const rt=this.addUserInfos({"event-type":"SPEECH_AND_TEXT",function:et});this.app&&(rt.module=this.app),this.trackWebEvent(rt)}trackAccessLibraryFromExplorer(){const et=this.addUserInfos({"event-type":"ACCESS_LIBRARY_FROM_EXPLORER"});this.app&&(et.module=this.app),this.trackWebEvent(et)}}class ReactionsService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get http(){return this.context.http()}async loadAvailableReactions(){try{const{"reaction-types":et}=await this.context.conf().getPublicConf("audience");return Array.isArray(et)?et:void 0}catch{console.error("Audience configuration not found");return}}async loadReactionSummaries(et){const rt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt.reactionsByResource}async loadReactionDetails(et,rt,st){const nt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}/${et}?page=${rt}&size=${st}`);return this.http.isResponseError()?void 0:nt}async deleteReaction(et){await this.http.delete(`/audience/reactions/${this.module}/${this.resourceType}/${et}`)}async updateReaction(et,rt){await this.http.putJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}async createReaction(et,rt){await this.http.postJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}}class ViewsService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get http(){return this.context.http()}async getCounters(et){const rt=await this.http.get(`/audience/views/count/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt}async getDetails(et){const rt=await this.http.get(`/audience/views/details/${this.module}/${this.resourceType}/${et}`);return this.http.isResponseError()?void 0:rt}trigger(et){return this.http.post(`/audience/views/${this.module}/${this.resourceType}/${et}`)}}class AudienceService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get views(){return new ViewsService(this.context,this.module,this.resourceType)}get reactions(){return new ReactionsService(this.context,this.module,this.resourceType)}}class OdeServices{constructor(){n$2(this,"_analytics"),n$2(this,"_cache"),n$2(this,"_conf"),n$2(this,"_data"),n$2(this,"_directory"),n$2(this,"_http"),n$2(this,"_idiom"),n$2(this,"_notify"),n$2(this,"_rights"),n$2(this,"_session"),n$2(this,"_share"),n$2(this,"_video"),n$2(this,"_workspace"),n$2(this,"_embedder"),this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._data=new DataService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._notify=NotifyFrameworkFactory.instance(),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._video=new VideoService(this),this._workspace=new WorkspaceService(this),this._embedder=new EmbedderService(this)}initialize(){return this._data.initialize(),this}analytics(){return this._analytics}audience(et,rt){return new AudienceService(this,et,rt)}cache(){return this._cache}conf(){return this._conf}data(){return this._data}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}notify(){return this._notify}resource(et,rt){return rt?ResourceService.findService({application:et,resourceType:rt},this):ResourceService.findMainService({application:et},this)}behaviour(et,rt){return SnipletsService.findBehaviour({application:et,resourceType:rt},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}video(){return this._video}workspace(){return this._workspace}embedder(){return this._embedder}}const ACTION={OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",DELETE:"delete",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PUBLISH:"publish"},FOLDER={BIN:"bin",DEFAULT:"default"},SORT_ORDER={DESC:"desc"},odeServices=new OdeServices().initialize(),WIDGET_POSITION={LEFT:"left",RIGHT:"right"},isActionAvailable=(tt,et)=>{const rt=et==null?void 0:et.filter(st=>st.id===tt&&st.available);return rt&&rt.length>0},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140};class WidgetFramework{constructor(){n$2(this,"_initialized"),n$2(this,"_widgets",[]),n$2(this,"_userPrefs",{})}initialize(et,rt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(st=>{var nt;st&&st.widgets?(st.widgets.forEach(ot=>{this._widgets.push(new Widget(ot))}),this.loadUserPrefs().then(()=>{var ot;(ot=this._initialized)==null||ot.resolve()}).catch(ot=>{var at;(at=this._initialized)==null||at.reject()})):(nt=this._initialized)==null||nt.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(et){return this._widgets.find(rt=>rt.platformConf.name===et)}lookupDefaultPosition(et){return defaultWidgetPosition[et]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(et=>this.applyUserPrefs(et))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().publish(LAYER_NAME.WIDGETS,{name:EVENT_NAME.USERPREF_CHANGED})})}async applyUserPrefs(et){this._userPrefs=et??this._userPrefs;const rt=configure.Platform.theme,st=[];rt.listSkins().then(nt=>{var ot;const at=((ot=nt.find(ut=>ut.child===rt.skin))==null?void 0:ot.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((ut,ct)=>{const dt=ut.platformConf.name;return at.indexOf(dt)!==-1?!1:(this._userPrefs[dt]||(this._userPrefs[dt]={index:defaultWidgetOrder[dt]??999,show:!0,position:ut.platformConf.position}),ut.platformConf.mandatory&&(this._userPrefs[dt].show=!0,this._userPrefs[dt].index=defaultWidgetOrder[dt]??999),ut.platformConf.i18n&&st.push(ut.platformConf.i18n),ut.applyUserPref(this._userPrefs[dt]),!0)});const lt=new Idiom;this._widgets=this._widgets.sort((ut,ct)=>{const dt=lt.translate(`timeline.settings.${ut.platformConf.name}`).toLowerCase(),ht=lt.translate(`timeline.settings.${ct.platformConf.name}`).toLowerCase();return dt<ht?-1:dt>ht?1:0})})}}class Widget{constructor(et){n$2(this,"_schoolConf",{}),n$2(this,"_userPref"),this._platformConf=et,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(et){this._userPref=et,this._userPref.position=this._userPref.position??widgets.lookupDefaultPosition(this._platformConf.name)??"left"}}const widgets=new WidgetFramework,SvgIconFolder=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.057 5.5A.057.057 0 0 0 3 5.557v13.03h18V7.875h-8.697a1 1 0 0 1-1-1c0-.759-.615-1.374-1.374-1.374zM1 5.557C1 4.42 1.92 3.5 3.057 3.5h6.872c1.515 0 2.797.999 3.223 2.374H21a2 2 0 0 1 2 2v10.714a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2z",clipRule:"evenodd"})]}),SvgIconRafterDown=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.012 7.871a1.5 1.5 0 0 1 2.117.141L12 14.722l5.871-6.71a1.5 1.5 0 1 1 2.258 1.976l-7 8a1.5 1.5 0 0 1-2.258 0l-7-8a1.5 1.5 0 0 1 .141-2.117",clipRule:"evenodd"})]}),TreeNode=({node:tt,showIcon:et,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt,handleItemAction:ut})=>{const ct=st.has(tt.id),dt=nt==null?void 0:nt.current.has(tt.id),ht=rt===tt.id,ft=ot===tt.id,xt={action:clsx("action-container d-flex align-items-center gap-8 px-2",{"drag-focus":ft,"py-4":!tt.section}),arrow:clsx({"py-4":!tt.section,"py-8":tt.section,invisible:!Array.isArray(tt.children)||tt.children.length===0}),button:clsx("flex-fill d-flex align-items-center text-truncate gap-8",{"py-8":tt.section})},yt=tt.section?16:12,{t:vt}=useTranslation(),{setNodeRef:Et}=useDroppable({id:reactExports.useId(),data:{id:tt.id,name:tt.name,isTreeview:!0,accepts:["folder","resource"]}}),bt=Pt=>at==null?void 0:at(Pt),wt=Pt=>lt==null?void 0:lt(Pt),St=Pt=>ut==null?void 0:ut(Pt),Rt=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),at==null||at(tt.id))},Ct=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),lt==null||lt(tt.id))},jt=Pt=>jsxRuntimeExports.jsx(Pt?SvgIconRafterDown:SvgIconRafterRight,{title:vt("foldUnfold"),width:yt,height:yt}),It=()=>{var Pt;const $t=!((Pt=nt==null?void 0:nt.current)!=null&&Pt.has(tt.id)),zt=Array.isArray(tt.children)&&tt.children.length>0;return dt||$t&&zt};return jsxRuntimeExports.jsx("li",{ref:Et,id:`treeitem-${tt.id}`,role:"treeitem","aria-selected":ht&&ht,"aria-expanded":ct&&ct,children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:xt.action,children:[jsxRuntimeExports.jsx("div",{className:xt.arrow,tabIndex:0,role:"button",onClick:()=>wt(tt.id),onKeyDown:Ct,"aria-label":vt("foldUnfold"),children:It()&&jt(ct)}),jsxRuntimeExports.jsxs("div",{tabIndex:0,role:"button",className:xt.button,onClick:()=>bt(tt.id),onKeyDown:Rt,children:[tt.section&&et&&jsxRuntimeExports.jsx(SvgIconFolder,{title:vt("folder"),width:20,height:20}),jsxRuntimeExports.jsx("span",{className:"text-truncate",children:tt.name})]}),tt.section&&ut&&jsxRuntimeExports.jsx("button",{className:"tree-btn mx-8",onClick:()=>St(tt.id),children:jsxRuntimeExports.jsx(SvgIconPlus,{height:16,width:16})})]}),Array.isArray(tt.children)&&!!tt.children.length&&ct&&jsxRuntimeExports.jsx("ul",{role:"group",children:tt.children.map(Pt=>jsxRuntimeExports.jsx(TreeNode,{node:Pt,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt},Pt.id))})]})},tt.id)};var __defProp=Object.defineProperty,__defNormalProp=(tt,et,rt)=>et in tt?__defProp(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,__publicField=(tt,et,rt)=>__defNormalProp(tt,typeof et!="symbol"?et+"":et,rt);function findTreeNode(tt,et){if(et(tt))return tt;if(Array.isArray(tt.children))for(const rt of tt.children){const st=findTreeNode(rt,et);if(st)return st}}function findNodeById(tt,et){if(Array.isArray(tt))for(const rt of tt){const st=findNodeById(rt,et);if(st)return st}else{if(tt.id===et)return tt;if(tt.children)for(const rt of tt.children){const st=findNodeById(rt,et);if(st)return st}}}function addNode(tt,{parentId:et,newFolder:rt}){return modifyNode(tt,st=>{var nt;if(st.id===et){const ot=[...((nt=st.folder)==null?void 0:nt.ancestors)||[]],at=arrayUnique([...ot,st.id]);return{...st,children:[...st.children||[],new TreeNodeFolderWrapper({...rt,ancestors:at})]}}else return st})}function arrayUnique(tt){return tt.filter((et,rt)=>tt.indexOf(et)===rt)}function deleteNode(tt,{folders:et}){return modifyNode(tt,rt=>{if(!et.includes(rt.id))return rt})}const findParentNode=(tt,et)=>{if(tt.children)for(const rt of tt.children){if(rt.id===et)return tt;const st=findParentNode(rt,et);if(st)return st}};function getAncestors(tt,et){var rt;const st=findNodeById(tt,et);return(rt=st==null?void 0:st.folder)!=null&&rt.ancestors?[...(st==null?void 0:st.folder.ancestors)||[],et]:et===FOLDER.BIN?[FOLDER.BIN]:[FOLDER.DEFAULT]}function modifyNode(tt,et){return doModify(tt,et)||tt}function doModify(tt,et,rt){var st;const nt=et(tt,rt);if((st=nt==null?void 0:nt.children)!=null&&st.length){const ot=[];for(const at of(nt==null?void 0:nt.children)||[]){const lt=doModify(at,et,nt);lt&&ot.push(lt)}return{...nt,children:ot}}return nt}function moveNode(tt,{destinationId:et,folders:rt}){return modifyNode(tt,(st,nt)=>{var ot,at;if(et===st.id){const lt=[...((ot=st.folder)==null?void 0:ot.ancestors)||[]],ut=arrayUnique([...lt,st.id]),ct=[...st.children||[]],dt=((at=st.children)==null?void 0:at.map(ht=>ht.id))||[];for(const ht of rt)if(!dt.includes(ht)){const ft=findNodeById(st,ht);ft&&ct.push({...ft,folder:{...ft==null?void 0:ft.folder,ancestors:ut}})}return{...st,children:ct}}else return rt.includes(st.id)&&et!==(nt==null?void 0:nt.id)?void 0:st})}const wrapTreeNode=(tt,et,rt)=>modifyNode(tt,st=>(st.id===rt&&(st.children=et==null?void 0:et.map(nt=>new TreeNodeFolderWrapper(nt))),st));function updateNode(tt,{folderId:et,newFolder:rt}){return modifyNode(tt,st=>st.id===et?new TreeNodeFolderWrapper(rt):st)}function findPathById(tt,et){let rt=[];function st(ot,at){if(ot.id===et)return rt=at.concat(ot.id),!0;if(ot.children){for(const lt of ot.children)if(st(lt,at.concat(ot.id)))return!0}return!1}function nt(ot){if(Array.isArray(ot)){for(const at of ot)if(st(at,[]))break}else st(ot,[])}return nt(tt),rt}class TreeNodeFolderWrapper{constructor(et){__publicField(this,"id"),__publicField(this,"name"),__publicField(this,"childNumber"),__publicField(this,"section",!1),__publicField(this,"children",[]),this.folder=et,this.id=et.id,this.name=et.name,this.childNumber=et.childNumber}}const useTreeView=({data:tt,ref:et,externalSelectedNodeId:rt,draggedNode:st,allExpandedNodes:nt,onTreeItemUnfold:ot,onTreeItemFold:at,onTreeItemClick:lt})=>{const[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(new Set),ft=reactExports.useRef(new Set),[xt,yt]=reactExports.useState(void 0),vt=ut??rt;function Et(Nt){var Ut;Array.isArray(Nt)?Nt.forEach(Lt=>{const kt=new Set(ft.current);Nt.filter(({id:Mt})=>Mt!==Lt.id).some(Mt=>Mt.children&&Mt.children.length>0)&&kt.add(Lt.id),Lt.children&&Lt.children.length>0&&Lt.children.forEach(Mt=>{var Bt;const Gt=(Bt=Lt.children)==null?void 0:Bt.filter(({id:Ot})=>Ot!==Mt.id);Gt!=null&&Gt.some(Ot=>Ot.children&&Ot.children.length>0)&&kt.add(Mt.id),Et(Mt)})}):(Ut=Nt.children)==null||Ut.forEach(Lt=>{var kt;const Mt=new Set(ft.current),Bt=(kt=Nt.children)==null?void 0:kt.filter(Gt=>Gt.id!==Lt.id);Bt!=null&&Bt.some(Gt=>Gt.children&&Gt.children.length>0)&&(Mt.add(Lt.id),ft.current=Mt),Et(Lt)})}const bt=Nt=>{const Ut=new Set("");tt&&Array.isArray(tt)&&Nt&&(tt.forEach(Lt=>{Ut.add(Lt.id)}),ht(Ut))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{st!=null&&st.isOver&&st.isTreeview?(st.overId&&zt(st.overId),yt(st.overId)):yt(void 0)},[st]);const wt=reactExports.useMemo(()=>({unselectAll(){ct(void 0)},select(Nt){Pt(Nt)},allExpandedNodes(){bt(nt)}}),[]);reactExports.useImperativeHandle(et,()=>wt,[wt]),reactExports.useEffect(()=>{bt(nt)},[]),reactExports.useEffect(()=>{rt&&!nt?(St(rt),ct(rt)):ct(void 0)},[rt]);const St=Nt=>{if(!findNodeById(tt,vt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ut=>ot==null?void 0:ot(Ut));return}Rt(Nt)},Rt=Nt=>{const Ut=new Set(dt),Lt=findPathById(tt,Nt),kt=Array.from(Ut);Lt.forEach(Mt=>{const Bt=kt.indexOf(Mt);Bt>-1&&kt.splice(Bt,1),kt.push(Mt)}),Ut.clear(),kt.forEach(Mt=>Ut.add(Mt)),Ut.forEach(Mt=>ot==null?void 0:ot(Mt)),ht(Ut)},Ct=Nt=>{const Ut=new Set(dt);Ut.delete(Nt),Ut.forEach(Lt=>at==null?void 0:at(Lt)),ht(Ut)},jt=Nt=>{dt.has(Nt)?Ct(Nt):Rt(Nt)},It=Nt=>{vt!==Nt&&ct(Nt)},Pt=Nt=>{It(Nt),Rt(Nt),lt==null||lt(Nt)},$t=Nt=>{jt(Nt)},zt=Nt=>{findNodeById(tt,rt)&&Rt(Nt)};return{selectedNodeId:vt,expandedNodes:dt,siblingsNodes:ft,draggedNodeId:xt,handleItemClick:Pt,handleFoldUnfold:$t}},TreeView=reactExports.forwardRef((tt,et)=>{const{data:rt,onTreeItemClick:st,onTreeItemUnfold:nt,onTreeItemFold:ot,onTreeItemAction:at,draggedNode:lt,showIcon:ut=!0,allExpandedNodes:ct=!1,selectedNodeId:dt}=tt,{selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleFoldUnfold:Et}=useTreeView({data:rt,ref:et,externalSelectedNodeId:dt,draggedNode:lt,allExpandedNodes:ct,onTreeItemClick:st,onTreeItemFold:ot,onTreeItemUnfold:nt});return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:Array.isArray(rt)?rt.map(bt=>jsxRuntimeExports.jsx(TreeNode,{node:bt,showIcon:ut,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et,handleItemAction:at},bt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,showIcon:ut,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et})})})}),VisuallyHidden=reactExports.forwardRef(({children:tt},et)=>jsxRuntimeExports.jsx("span",{className:"visually-hidden",ref:et,children:tt})),EdificeClientContext=reactExports.createContext(null);function useEdificeClient(){const tt=reactExports.useContext(EdificeClientContext);if(!tt)throw new Error("Cannot be used outside of EdificeClientProvider");return tt}function useBookmark(){var tt;const{sessionQuery:et}=useEdificeClient(),rt=new Set;return(tt=et==null?void 0:et.data)==null?void 0:tt.bookmarkedApps.filter(st=>{const nt=rt.has(st.displayName);return rt.add(st.displayName),!nt})}function useDebounce(tt,et){const[rt,st]=reactExports.useState(tt);return reactExports.useEffect(()=>{const nt=setTimeout(()=>{st(tt)},et);return()=>{clearTimeout(nt)}},[tt,et]),rt}function useHover$1(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=reactExports.useCallback(()=>{et(!0)},[]),nt=reactExports.useCallback(()=>{et(!1)},[]);return[reactExports.useCallback(at=>{var lt;((lt=rt.current)==null?void 0:lt.nodeType)===Node.ELEMENT_NODE&&(rt.current.removeEventListener("mouseenter",st),rt.current.removeEventListener("mouseleave",nt)),(at==null?void 0:at.nodeType)===Node.ELEMENT_NODE&&(at.addEventListener("mouseenter",st),at.addEventListener("mouseleave",nt)),rt.current=at},[st,nt]),tt]}function useMediaQuery(tt){const et=reactExports.useCallback(nt=>{const ot=window.matchMedia(tt);return ot.addEventListener("change",nt),()=>{ot.removeEventListener("change",nt)}},[tt]),rt=()=>window.matchMedia(tt).matches,st=()=>{throw Error("useMediaQuery is a client-only hook")};return reactExports.useSyncExternalStore(et,rt,st)}function useToggle$1(tt){const[et,rt]=reactExports.useState(()=>tt),st=reactExports.useCallback(nt=>rt(typeof nt=="boolean"?nt:ot=>!ot),[]);return[et,st]}function useBreakpoint(){return{xs:useMediaQuery("only screen and (min-width: 0)"),sm:useMediaQuery("only screen and (min-width: 375px)"),md:useMediaQuery("only screen and (min-width: 768px)"),lg:useMediaQuery("only screen and (min-width: 1024px)"),xl:useMediaQuery("only screen and (min-width: 1280px)"),xxl:useMediaQuery("only screen and (min-width: 1400px)")}}var uaParser={exports:{}};(function(tt,et){(function(rt,st){var nt="1.0.40",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",ft="model",xt="name",yt="type",vt="vendor",Et="version",bt="architecture",wt="console",St="mobile",Rt="tablet",Ct="smarttv",jt="wearable",It="embedded",Pt=500,$t="Amazon",zt="Apple",Nt="ASUS",Ut="BlackBerry",Lt="Browser",kt="Chrome",Mt="Edge",Bt="Firefox",Gt="Google",Ot="Huawei",Ht="LG",Ft="Microsoft",Yt="Motorola",Zt="Opera",Xt="Samsung",rr="Sharp",ur="Sony",cr="Xiaomi",xr="Zebra",Er="Facebook",wr="Chromium OS",Sr="Mac OS",dr=" Browser",Pr=function(hr,Tr){var br={};for(var Nr in hr)Tr[Nr]&&Tr[Nr].length%2===0?br[Nr]=Tr[Nr].concat(hr[Nr]):br[Nr]=hr[Nr];return br},Ir=function(hr){for(var Tr={},br=0;br<hr.length;br++)Tr[hr[br].toUpperCase()]=hr[br];return Tr},zr=function(hr,Tr){return typeof hr===dt?Rr(Tr).indexOf(Rr(hr))!==-1:!1},Rr=function(hr){return hr.toLowerCase()},Dr=function(hr){return typeof hr===dt?hr.replace(/[^\d\.]/g,ot).split(".")[0]:st},Qr=function(hr,Tr){if(typeof hr===dt)return hr=hr.replace(/^\s\s*/,ot),typeof Tr===ut?hr:hr.substring(0,Pt)},ns=function(hr,Tr){for(var br=0,Nr,hs,qr,Ur,kr,ms;br<Tr.length&&!kr;){var Hn=Tr[br],Zn=Tr[br+1];for(Nr=hs=0;Nr<Hn.length&&!kr&&Hn[Nr];)if(kr=Hn[Nr++].exec(hr),kr)for(qr=0;qr<Zn.length;qr++)ms=kr[++hs],Ur=Zn[qr],typeof Ur===ct&&Ur.length>0?Ur.length===2?typeof Ur[1]==lt?this[Ur[0]]=Ur[1].call(this,ms):this[Ur[0]]=Ur[1]:Ur.length===3?typeof Ur[1]===lt&&!(Ur[1].exec&&Ur[1].test)?this[Ur[0]]=ms?Ur[1].call(this,ms,Ur[2]):st:this[Ur[0]]=ms?ms.replace(Ur[1],Ur[2]):st:Ur.length===4&&(this[Ur[0]]=ms?Ur[3].call(this,ms.replace(Ur[1],Ur[2])):st):this[Ur]=ms||st;br+=2}},ds=function(hr,Tr){for(var br in Tr)if(typeof Tr[br]===ct&&Tr[br].length>0){for(var Nr=0;Nr<Tr[br].length;Nr++)if(zr(Tr[br][Nr],hr))return br===at?st:br}else if(zr(Tr[br],hr))return br===at?st:br;return Tr.hasOwnProperty("*")?Tr["*"]:hr},qt={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},er={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},sr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Et,[xt,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Et,[xt,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[xt,Et],[/opios[\/ ]+([\w\.]+)/i],[Et,[xt,Zt+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,Zt+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,Zt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[Et,[xt,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[Et,[xt,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[xt,Et],[/quark(?:pc)?\/([-\w\.]+)/i],[Et,[xt,"Quark"]],[/\bddg\/([\w\.]+)/i],[Et,[xt,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Et,[xt,"UC"+Lt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[Et,[xt,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Et,[xt,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Et,[xt,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[Et,[xt,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[Et,[xt,"Smart Lenovo "+Lt]],[/(avast|avg)\/([\w\.]+)/i],[[xt,/(.+)/,"$1 Secure "+Lt],Et],[/\bfocus\/([\w\.]+)/i],[Et,[xt,Bt+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,Zt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,Zt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+dr]],[/fxios\/([\w\.-]+)/i],[Et,[xt,Bt]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+dr],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,Xt+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[Et,[xt,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[xt,"Sogou Mobile"],Et],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[xt,Et],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[xt],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[Et,xt],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[xt,Er],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[xt,Et],[/\bgsa\/([\w\.]+) .*safari\//i],[Et,[xt,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[Et,[xt,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[Et,[xt,kt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[xt,kt+" WebView"],Et],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Et,[xt,"Android "+Lt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[xt,Et],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[Et,[xt,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[Et,xt],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[xt,[Et,ds,qt]],[/(webkit|khtml)\/([\w\.]+)/i],[xt,Et],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[xt,"Netscape"],Et],[/(wolvic|librewolf)\/([\w\.]+)/i],[xt,Et],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Et,[xt,Bt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[bt,"amd64"]],[/(ia32(?=;))/i],[[bt,Rr]],[/((?:i[346]|x)86)[;\)]/i],[[bt,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[bt,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[bt,"armhf"]],[/windows (ce|mobile); ppc;/i],[[bt,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[bt,/ower/,ot,Rr]],[/(sun4\w)[;\)]/i],[[bt,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[bt,Rr]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[ft,[vt,Xt],[yt,Rt]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[ft,[vt,Xt],[yt,St]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[ft,[vt,zt],[yt,St]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[ft,[vt,zt],[yt,Rt]],[/(macintosh);/i],[ft,[vt,zt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ft,[vt,rr],[yt,St]],[/(?:honor)([-\w ]+)[;\)]/i],[ft,[vt,"Honor"],[yt,St]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[ft,[vt,Ot],[yt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[ft,[vt,Ot],[yt,St]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[ft,/_/g," "],[vt,cr],[yt,St]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[ft,/_/g," "],[vt,cr],[yt,Rt]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ft,[vt,"OPPO"],[yt,St]],[/\b(opd2\d{3}a?) bui/i],[ft,[vt,"OPPO"],[yt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ft,[vt,"Vivo"],[yt,St]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ft,[vt,"Realme"],[yt,St]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[ft,[vt,Yt],[yt,St]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ft,[vt,Yt],[yt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ft,[vt,Ht],[yt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[ft,[vt,Ht],[yt,St]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[ft,[vt,"Lenovo"],[yt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[ft,/_/g," "],[vt,"Nokia"],[yt,St]],[/(pixel c)\b/i],[ft,[vt,Gt],[yt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[ft,[vt,Gt],[yt,St]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[ft,[vt,ur],[yt,St]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ft,"Xperia Tablet"],[vt,ur],[yt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ft,[vt,"OnePlus"],[yt,St]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ft,[vt,$t],[yt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ft,/(.+)/g,"Fire Phone $1"],[vt,$t],[yt,St]],[/(playbook);[-\w\),; ]+(rim)/i],[ft,vt,[yt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[ft,[vt,Ut],[yt,St]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ft,[vt,Nt],[yt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ft,[vt,Nt],[yt,St]],[/(nexus 9)/i],[ft,[vt,"HTC"],[yt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[vt,[ft,/_/g," "],[yt,St]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[ft,[vt,"TCL"],[yt,Rt]],[/(itel) ((\w+))/i],[[vt,Rr],ft,[yt,ds,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ft,[vt,"Acer"],[yt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ft,[vt,"Meizu"],[yt,St]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ft,[vt,"Ulefone"],[yt,St]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ft,[vt,"Energizer"],[yt,St]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ft,[vt,"Cat"],[yt,St]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ft,[vt,"Smartfren"],[yt,St]],[/droid.+; (a(?:015|06[35]|142p?))/i],[ft,[vt,"Nothing"],[yt,St]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[vt,ft,[yt,St]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[vt,ft,[yt,Rt]],[/(surface duo)/i],[ft,[vt,Ft],[yt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ft,[vt,"Fairphone"],[yt,St]],[/(u304aa)/i],[ft,[vt,"AT&T"],[yt,St]],[/\bsie-(\w*)/i],[ft,[vt,"Siemens"],[yt,St]],[/\b(rct\w+) b/i],[ft,[vt,"RCA"],[yt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[ft,[vt,"Dell"],[yt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[ft,[vt,"Verizon"],[yt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[ft,[vt,"Barnes & Noble"],[yt,Rt]],[/\b(tm\d{3}\w+) b/i],[ft,[vt,"NuVision"],[yt,Rt]],[/\b(k88) b/i],[ft,[vt,"ZTE"],[yt,Rt]],[/\b(nx\d{3}j) b/i],[ft,[vt,"ZTE"],[yt,St]],[/\b(gen\d{3}) b.+49h/i],[ft,[vt,"Swiss"],[yt,St]],[/\b(zur\d{3}) b/i],[ft,[vt,"Swiss"],[yt,Rt]],[/\b((zeki)?tb.*\b) b/i],[ft,[vt,"Zeki"],[yt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[vt,"Dragon Touch"],ft,[yt,Rt]],[/\b(ns-?\w{0,9}) b/i],[ft,[vt,"Insignia"],[yt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[ft,[vt,"NextBook"],[yt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[vt,"Voice"],ft,[yt,St]],[/\b(lvtel\-)?(v1[12]) b/i],[[vt,"LvTel"],ft,[yt,St]],[/\b(ph-1) /i],[ft,[vt,"Essential"],[yt,St]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[ft,[vt,"Envizen"],[yt,Rt]],[/\b(trio[-\w\. ]+) b/i],[ft,[vt,"MachSpeed"],[yt,Rt]],[/\btu_(1491) b/i],[ft,[vt,"Rotor"],[yt,Rt]],[/(shield[\w ]+) b/i],[ft,[vt,"Nvidia"],[yt,Rt]],[/(sprint) (\w+)/i],[vt,ft,[yt,St]],[/(kin\.[onetw]{3})/i],[[ft,/\./g," "],[vt,Ft],[yt,St]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ft,[vt,xr],[yt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ft,[vt,xr],[yt,St]],[/smart-tv.+(samsung)/i],[vt,[yt,Ct]],[/hbbtv.+maple;(\d+)/i],[[ft,/^/,"SmartTV"],[vt,Xt],[yt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[vt,Ht],[yt,Ct]],[/(apple) ?tv/i],[vt,[ft,zt+" TV"],[yt,Ct]],[/crkey/i],[[ft,kt+"cast"],[vt,Gt],[yt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[ft,[vt,$t],[yt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ft,[vt,rr],[yt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[ft,[vt,ur],[yt,Ct]],[/(mitv-\w{5}) bui/i],[ft,[vt,cr],[yt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[vt,ft,[yt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[vt,Qr],[ft,Qr],[yt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[yt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[vt,ft,[yt,wt]],[/droid.+; (shield) bui/i],[ft,[vt,"Nvidia"],[yt,wt]],[/(playstation [345portablevi]+)/i],[ft,[vt,ur],[yt,wt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ft,[vt,Ft],[yt,wt]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[ft,[vt,Xt],[yt,jt]],[/((pebble))app/i],[vt,ft,[yt,jt]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ft,[vt,zt],[yt,jt]],[/droid.+; (glass) \d/i],[ft,[vt,Gt],[yt,jt]],[/droid.+; (wt63?0{2,3})\)/i],[ft,[vt,xr],[yt,jt]],[/droid.+; (glass) \d/i],[ft,[vt,Gt],[yt,jt]],[/(pico) (4|neo3(?: link|pro)?)/i],[vt,ft,[yt,jt]],[/; (quest( \d| pro)?)/i],[ft,[vt,Er],[yt,jt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[vt,[yt,It]],[/(aeobc)\b/i],[ft,[vt,$t],[yt,It]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[ft,[yt,St]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[ft,[yt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[yt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[yt,St]],[/(android[-\w\. ]{0,9});.+buil/i],[ft,[vt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,Mt+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[xt,Et],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Et,[xt,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[xt,Et],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,ds,er]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,ds,er],[xt,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[Et,/_/g,"."],[xt,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[xt,Sr],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ut]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,Bt+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Et,[xt,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[Et,[xt,"watchOS"]],[/crkey\/([\d\.]+)/i],[Et,[xt,kt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[xt,wr],Et],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[xt,Et],[/(sunos) ?([\w\.\d]*)/i],[[xt,"Solaris"],Et],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[xt,Et]]},yr=function(hr,Tr){if(typeof hr===ct&&(Tr=hr,hr=st),!(this instanceof yr))return new yr(hr,Tr).getResult();var br=typeof rt!==ut&&rt.navigator?rt.navigator:st,Nr=hr||(br&&br.userAgent?br.userAgent:ot),hs=br&&br.userAgentData?br.userAgentData:st,qr=Tr?Pr(sr,Tr):sr,Ur=br&&br.userAgent==Nr;return this.getBrowser=function(){var kr={};return kr[xt]=st,kr[Et]=st,ns.call(kr,Nr,qr.browser),kr[ht]=Dr(kr[Et]),Ur&&br&&br.brave&&typeof br.brave.isBrave==lt&&(kr[xt]="Brave"),kr},this.getCPU=function(){var kr={};return kr[bt]=st,ns.call(kr,Nr,qr.cpu),kr},this.getDevice=function(){var kr={};return kr[vt]=st,kr[ft]=st,kr[yt]=st,ns.call(kr,Nr,qr.device),Ur&&!kr[yt]&&hs&&hs.mobile&&(kr[yt]=St),Ur&&kr[ft]=="Macintosh"&&br&&typeof br.standalone!==ut&&br.maxTouchPoints&&br.maxTouchPoints>2&&(kr[ft]="iPad",kr[yt]=Rt),kr},this.getEngine=function(){var kr={};return kr[xt]=st,kr[Et]=st,ns.call(kr,Nr,qr.engine),kr},this.getOS=function(){var kr={};return kr[xt]=st,kr[Et]=st,ns.call(kr,Nr,qr.os),Ur&&!kr[xt]&&hs&&hs.platform&&hs.platform!="Unknown"&&(kr[xt]=hs.platform.replace(/chrome os/i,wr).replace(/macos/i,Sr)),kr},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Nr},this.setUA=function(kr){return Nr=typeof kr===dt&&kr.length>Pt?Qr(kr,Pt):kr,this},this.setUA(Nr),this};yr.VERSION=nt,yr.BROWSER=Ir([xt,Et,ht]),yr.CPU=Ir([bt]),yr.DEVICE=Ir([ft,vt,yt,wt,St,Ct,Rt,jt,It]),yr.ENGINE=yr.OS=Ir([xt,Et]),tt.exports&&(et=tt.exports=yr),et.UAParser=yr;var mr=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(mr&&!mr.ua){var gr=new yr;mr.ua=gr.getResult(),mr.ua.get=function(){return gr.getUA()},mr.ua.set=function(hr){gr.setUA(hr);var Tr=gr.getResult();for(var br in Tr)mr.ua[br]=Tr[br]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);function useBrowserInfo(tt){var et,rt,st;const nt=new UAParser(tt),ot=nt.getOS(),at=nt.getDevice(),lt=nt.getBrowser(),ut=((et=at.model)==null?void 0:et.indexOf("iPhone"))!=-1,ct=((rt=at.model)==null?void 0:rt.indexOf("iPod"))!=-1,dt=((st=at.model)==null?void 0:st.indexOf("iPad"))!=-1;return{os:ot,device:at,browser:lt,isIphone:ut,isIpod:ct,isIpad:dt}}function useHasWorkflow(tt){const[et,rt]=reactExports.useState();return reactExports.useEffect(()=>{(async()=>{let st;typeof tt=="string"?st=await odeServices.rights().sessionHasWorkflowRight(tt):st=await odeServices.rights().sessionHasWorkflowRights(tt),rt(st)})()},[tt]),et}function useCantoo(){const tt=useHasWorkflow("org.entcore.portal.controllers.PortalController|optionalFeatureCantoo");return reactExports.useEffect(()=>{tt&&!document.getElementById("cantoo-edifice-script")&&(async()=>{const et=await odeServices.http().get("/optionalFeature/cantoo");if(et&&et.scriptPath){const rt=document.createElement("script");rt.id="cantoo-edifice-script",rt.src=et.scriptPath,rt.async=!0,document.body.appendChild(rt)}})()},[tt]),null}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(tt){return this.listeners.add(tt),this.onSubscribe(),()=>{this.listeners.delete(tt),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$1(){}function functionalUpdate(tt,et){return typeof tt=="function"?tt(et):tt}function isValidTimeout(tt){return typeof tt=="number"&&tt>=0&&tt!==1/0}function timeUntilStale(tt,et){return Math.max(tt+(et||0)-Date.now(),0)}function resolveStaleTime(tt,et){return typeof tt=="function"?tt(et):tt}function resolveEnabled(tt,et){return typeof tt=="function"?tt(et):tt}function matchQuery(tt,et){const{type:rt="all",exact:st,fetchStatus:nt,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(st){if(et.queryHash!==hashQueryKeyByOptions(at,et.options))return!1}else if(!partialMatchKey(et.queryKey,at))return!1}if(rt!=="all"){const ut=et.isActive();if(rt==="active"&&!ut||rt==="inactive"&&ut)return!1}return!(typeof lt=="boolean"&&et.isStale()!==lt||nt&&nt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:st,predicate:nt,mutationKey:ot}=tt;if(ot){if(!et.options.mutationKey)return!1;if(rt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(st&&et.state.status!==st||nt&&!nt(et))}function hashQueryKeyByOptions(tt,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(tt)}function hashKey(tt){return JSON.stringify(tt,(et,rt)=>isPlainObject$1(rt)?Object.keys(rt).sort().reduce((st,nt)=>(st[nt]=rt[nt],st),{}):rt)}function partialMatchKey(tt,et){return tt===et?!0:typeof tt!=typeof et?!1:tt&&et&&typeof tt=="object"&&typeof et=="object"?!Object.keys(et).some(rt=>!partialMatchKey(tt[rt],et[rt])):!1}function replaceEqualDeep(tt,et){if(tt===et)return tt;const rt=isPlainArray(tt)&&isPlainArray(et);if(rt||isPlainObject$1(tt)&&isPlainObject$1(et)){const st=rt?tt:Object.keys(tt),nt=st.length,ot=rt?et:Object.keys(et),at=ot.length,lt=rt?[]:{};let ut=0;for(let ct=0;ct<at;ct++){const dt=rt?ct:ot[ct];(!rt&&st.includes(dt)||rt)&&tt[dt]===void 0&&et[dt]===void 0?(lt[dt]=void 0,ut++):(lt[dt]=replaceEqualDeep(tt[dt],et[dt]),lt[dt]===tt[dt]&&tt[dt]!==void 0&&ut++)}return nt===at&&ut===nt?tt:lt}return et}function shallowEqualObjects(tt,et){if(!et||Object.keys(tt).length!==Object.keys(et).length)return!1;for(const rt in tt)if(tt[rt]!==et[rt])return!1;return!0}function isPlainArray(tt){return Array.isArray(tt)&&tt.length===Object.keys(tt).length}function isPlainObject$1(tt){if(!hasObjectPrototype(tt))return!1;const et=tt.constructor;if(et===void 0)return!0;const rt=et.prototype;return!(!hasObjectPrototype(rt)||!rt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(tt)!==Object.prototype)}function hasObjectPrototype(tt){return Object.prototype.toString.call(tt)==="[object Object]"}function sleep(tt){return new Promise(et=>{setTimeout(et,tt)})}function replaceData(tt,et,rt){return typeof rt.structuralSharing=="function"?rt.structuralSharing(tt,et):rt.structuralSharing!==!1?replaceEqualDeep(tt,et):et}function addToEnd(tt,et,rt=0){const st=[...tt,et];return rt&&st.length>rt?st.slice(1):st}function addToStart(tt,et,rt=0){const st=[et,...tt];return rt&&st.length>rt?st.slice(0,-1):st}var skipToken=Symbol();function ensureQueryFn(tt,et){return!tt.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!tt.queryFn||tt.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${tt.queryHash}'`)):tt.queryFn}var xl,Bo,Yl,Wp,FocusManager=(Wp=class extends Subscribable{constructor(){super();Lr(this,xl);Lr(this,Bo);Lr(this,Yl);Cr(this,Yl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Bo)||this.setEventListener(Kt(this,Yl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Bo))==null||et.call(this),Cr(this,Bo,void 0))}setEventListener(et){var rt;Cr(this,Yl,et),(rt=Kt(this,Bo))==null||rt.call(this),Cr(this,Bo,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,xl)!==et&&(Cr(this,xl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,xl)=="boolean"?Kt(this,xl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},xl=new WeakMap,Bo=new WeakMap,Yl=new WeakMap,Wp),focusManager=new FocusManager,Kl,zo,Ql,qp,OnlineManager=(qp=class extends Subscribable{constructor(){super();Lr(this,Kl,!0);Lr(this,zo);Lr(this,Ql);Cr(this,Ql,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),st=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",st,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",st)}}})}onSubscribe(){Kt(this,zo)||this.setEventListener(Kt(this,Ql))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,zo))==null||et.call(this),Cr(this,zo,void 0))}setEventListener(et){var rt;Cr(this,Ql,et),(rt=Kt(this,zo))==null||rt.call(this),Cr(this,zo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Kl)!==et&&(Cr(this,Kl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Kl)}},Kl=new WeakMap,zo=new WeakMap,Ql=new WeakMap,qp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((nt,ot)=>{tt=nt,et=ot});rt.status="pending",rt.catch(()=>{});function st(nt){Object.assign(rt,nt),delete rt.resolve,delete rt.reject}return rt.resolve=nt=>{st({status:"fulfilled",value:nt}),tt(nt)},rt.reject=nt=>{st({status:"rejected",reason:nt}),et(nt)},rt}function defaultRetryDelay(tt){return Math.min(1e3*2**tt,3e4)}function canFetch(tt){return(tt??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(tt){super("CancelledError"),this.revert=tt==null?void 0:tt.revert,this.silent=tt==null?void 0:tt.silent}};function isCancelledError(tt){return tt instanceof CancelledError}function createRetryer(tt){let et=!1,rt=0,st=!1,nt;const ot=pendingThenable(),at=vt=>{var Et;st||(ft(new CancelledError(vt)),(Et=tt.abort)==null||Et.call(tt))},lt=()=>{et=!0},ut=()=>{et=!1},ct=()=>focusManager.isFocused()&&(tt.networkMode==="always"||onlineManager.isOnline())&&tt.canRun(),dt=()=>canFetch(tt.networkMode)&&tt.canRun(),ht=vt=>{var Et;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,vt),nt==null||nt(),ot.resolve(vt))},ft=vt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,vt),nt==null||nt(),ot.reject(vt))},xt=()=>new Promise(vt=>{var Et;nt=bt=>{(st||ct())&&vt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var vt;nt=void 0,st||(vt=tt.onContinue)==null||vt.call(tt)}),yt=()=>{if(st)return;let vt;const Et=rt===0?tt.initialPromise:void 0;try{vt=Et??tt.fn()}catch(bt){vt=Promise.reject(bt)}Promise.resolve(vt).then(ht).catch(bt=>{var jt;if(st)return;const wt=tt.retry??(isServer?0:3),St=tt.retryDelay??defaultRetryDelay,Rt=typeof St=="function"?St(rt,bt):St,Ct=wt===!0||typeof wt=="number"&&rt<wt||typeof wt=="function"&&wt(rt,bt);if(et||!Ct){ft(bt);return}rt++,(jt=tt.onFail)==null||jt.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(bt):yt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?yt():xt().then(yt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},st=lt=>{lt()},nt=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):nt(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&nt(()=>{st(()=>{lt.forEach(ut=>{rt(ut)})})})};return{batch:lt=>{let ut;et++;try{ut=lt()}finally{et--,et||at()}return ut},batchCalls:lt=>(...ut)=>{ot(()=>{lt(...ut)})},schedule:ot,setNotifyFunction:lt=>{rt=lt},setBatchNotifyFunction:lt=>{st=lt},setScheduler:lt=>{nt=lt}}}var notifyManager=createNotifyManager(),yl,Xp,Removable=(Xp=class{constructor(){Lr(this,yl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Cr(this,yl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,yl)&&(clearTimeout(Kt(this,yl)),Cr(this,yl,void 0))}},yl=new WeakMap,Xp),Zl,Jl,Un,Ps,Ou,El,Qn,_o,Yp,Query=(Yp=class extends Removable{constructor(et){super();Lr(this,Qn);Lr(this,Zl);Lr(this,Jl);Lr(this,Un);Lr(this,Ps);Lr(this,Ou);Lr(this,El);Cr(this,El,!1),Cr(this,Ou,et.defaultOptions),this.setOptions(et.options),this.observers=[],Cr(this,Un,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Cr(this,Zl,getDefaultState$1(this.options)),this.state=et.state??Kt(this,Zl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,Ps))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Ou),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,Un).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Br(this,Qn,_o).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Br(this,Qn,_o).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,Ps))==null?void 0:st.promise;return(nt=Kt(this,Ps))==null||nt.cancel(et),rt?rt.then(noop$1).catch(noop$1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,Zl))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var rt;const et=this.observers.find(st=>st.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,Ps))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,Ps))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,Un).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(rt=>rt!==et),this.observers.length||(Kt(this,Ps)&&(Kt(this,El)?Kt(this,Ps).cancel({revert:!0}):Kt(this,Ps).cancelRetry()),this.scheduleGc()),Kt(this,Un).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Br(this,Qn,_o).call(this,{type:"invalidate"})}fetch(et,rt){var ut,ct,dt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rt!=null&&rt.cancelRefetch))this.cancel({silent:!0});else if(Kt(this,Ps))return Kt(this,Ps).continueRetry(),Kt(this,Ps).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(ft=>ft.options.queryFn);ht&&this.setOptions(ht.options)}const st=new AbortController,nt=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Cr(this,El,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Cr(this,El,!1),this.options.persister?this.options.persister(ht,ft,this):ht(ft)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Cr(this,Jl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Br(this,Qn,_o).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,yt,vt;isCancelledError(ht)&&ht.silent||Br(this,Qn,_o).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,Un).config).onError)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,Un).config).onSettled)==null||vt.call(yt,this.state.data,ht,this)),this.scheduleGc()};return Cr(this,Ps,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,xt,yt,vt;if(ht===void 0){lt(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(ht)}catch(Et){lt(Et);return}(xt=(ft=Kt(this,Un).config).onSuccess)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,Un).config).onSettled)==null||vt.call(yt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Br(this,Qn,_o).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Br(this,Qn,_o).call(this,{type:"pause"})},onContinue:()=>{Br(this,Qn,_o).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,Ps).start()}},Zl=new WeakMap,Jl=new WeakMap,Un=new WeakMap,Ps=new WeakMap,Ou=new WeakMap,El=new WeakMap,Qn=new WeakSet,_o=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...st,fetchStatus:"paused"};case"continue":return{...st,fetchStatus:"fetching"};case"fetch":return{...st,...fetchState(st.data,this.options),fetchMeta:et.meta??null};case"success":return{...st,data:et.data,dataUpdateCount:st.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=et.error;return isCancelledError(nt)&&nt.revert&&Kt(this,Jl)?{...Kt(this,Jl),fetchStatus:"idle"}:{...st,error:nt,errorUpdateCount:st.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:st.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...st,isInvalidated:!0};case"setState":return{...st,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(st=>{st.onQueryUpdate()}),Kt(this,Un).notify({query:this,type:"updated",action:et})})},Yp);function fetchState(tt,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...tt===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(tt){const et=typeof tt.initialData=="function"?tt.initialData():tt.initialData,rt=et!==void 0,st=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?st??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var po,Kp,QueryCache=(Kp=class extends Subscribable{constructor(et={}){super();Lr(this,po);this.config=et,Cr(this,po,new Map)}build(et,rt,st){const nt=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(nt,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:nt,queryHash:ot,options:et.defaultQueryOptions(rt),state:st,defaultOptions:et.getQueryDefaults(nt)}),this.add(at)),at}add(et){Kt(this,po).has(et.queryHash)||(Kt(this,po).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,po).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,po).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,po).get(et)}getAll(){return[...Kt(this,po).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchQuery(rt,st))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(st=>matchQuery(et,st)):rt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},po=new WeakMap,Kp),mo,$s,wl,go,Fo,Qp,Mutation=(Qp=class extends Removable{constructor(et){super();Lr(this,go);Lr(this,mo);Lr(this,$s);Lr(this,wl);this.mutationId=et.mutationId,Cr(this,$s,et.mutationCache),Cr(this,mo,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Kt(this,mo).includes(et)||(Kt(this,mo).push(et),this.clearGcTimeout(),Kt(this,$s).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Cr(this,mo,Kt(this,mo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,$s).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,mo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,$s).remove(this))}continue(){var et;return((et=Kt(this,wl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,yt,vt,Et,bt,wt,St,Rt,Ct,jt,It;Cr(this,wl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Pt,$t)=>{Br(this,go,Fo).call(this,{type:"failed",failureCount:Pt,error:$t})},onPause:()=>{Br(this,go,Fo).call(this,{type:"pause"})},onContinue:()=>{Br(this,go,Fo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,$s).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,wl).canStart();try{if(!rt){Br(this,go,Fo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,$s).config).onMutate)==null?void 0:ot.call(nt,et,this));const $t=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));$t!==this.state.context&&Br(this,go,Fo).call(this,{type:"pending",context:$t,variables:et,isPaused:st})}const Pt=await Kt(this,wl).start();return await((ct=(ut=Kt(this,$s).config).onSuccess)==null?void 0:ct.call(ut,Pt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,Pt,et,this.state.context)),await((xt=(ft=Kt(this,$s).config).onSettled)==null?void 0:xt.call(ft,Pt,null,this.state.variables,this.state.context,this)),await((vt=(yt=this.options).onSettled)==null?void 0:vt.call(yt,Pt,null,et,this.state.context)),Br(this,go,Fo).call(this,{type:"success",data:Pt}),Pt}catch(Pt){try{throw await((bt=(Et=Kt(this,$s).config).onError)==null?void 0:bt.call(Et,Pt,et,this.state.context,this)),await((St=(wt=this.options).onError)==null?void 0:St.call(wt,Pt,et,this.state.context)),await((Ct=(Rt=Kt(this,$s).config).onSettled)==null?void 0:Ct.call(Rt,void 0,Pt,this.state.variables,this.state.context,this)),await((It=(jt=this.options).onSettled)==null?void 0:It.call(jt,void 0,Pt,et,this.state.context)),Pt}finally{Br(this,go,Fo).call(this,{type:"error",error:Pt})}}finally{Kt(this,$s).runNext(this)}}},mo=new WeakMap,$s=new WeakMap,wl=new WeakMap,go=new WeakSet,Fo=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...st,isPaused:!0};case"continue":return{...st,isPaused:!1};case"pending":return{...st,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...st,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...st,data:void 0,error:et.error,failureCount:st.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,mo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,$s).notify({mutation:this,type:"updated",action:et})})},Qp);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xs,Du,Zp,MutationCache=(Zp=class extends Subscribable{constructor(et={}){super();Lr(this,Xs);Lr(this,Du);this.config=et,Cr(this,Xs,new Map),Cr(this,Du,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++R1(this,Du)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Xs).get(rt)??[];st.push(et),Kt(this,Xs).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Xs).has(rt)){const nt=(st=Kt(this,Xs).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Xs).delete(rt):Kt(this,Xs).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Xs).get(scopeFor(et)))==null?void 0:st.find(nt=>nt.state.status==="pending");return!rt||rt===et}runNext(et){var st;const rt=(st=Kt(this,Xs).get(scopeFor(et)))==null?void 0:st.find(nt=>nt!==et&&nt.state.isPaused);return(rt==null?void 0:rt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Kt(this,Xs).values()].flat()}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchMutation(rt,st))}findAll(et={}){return this.getAll().filter(rt=>matchMutation(et,rt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}resumePausedMutations(){const et=this.getAll().filter(rt=>rt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(rt=>rt.continue().catch(noop$1))))}},Xs=new WeakMap,Du=new WeakMap,Zp);function scopeFor(tt){var et;return((et=tt.options.scope)==null?void 0:et.id)??String(tt.mutationId)}function infiniteQueryBehavior(tt){return{onFetch:(et,rt)=>{var dt,ht,ft,xt,yt;const st=et.options,nt=(ft=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:ft.direction,ot=((xt=et.state.data)==null?void 0:xt.pages)||[],at=((yt=et.state.data)==null?void 0:yt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let vt=!1;const Et=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?vt=!0:et.signal.addEventListener("abort",()=>{vt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),wt=async(St,Rt,Ct)=>{if(vt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const jt={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(jt);const It=await bt(jt),{maxPages:Pt}=et.options,$t=Ct?addToStart:addToEnd;return{pages:$t(St.pages,It,Pt),pageParams:$t(St.pageParams,Rt,Pt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},jt=Rt(st,Ct);lt=await wt(Ct,jt,St)}else{const St=tt??ot.length;do{const Rt=ut===0?at[0]??st.initialPageParam:getNextPageParam(st,lt);if(ut>0&&Rt==null)break;lt=await wt(lt,Rt),ut++}while(ut<St)}return lt};et.options.persister?et.fetchFn=()=>{var vt,Et;return(Et=(vt=et.options).persister)==null?void 0:Et.call(vt,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},rt)}:et.fetchFn=ct}}}function getNextPageParam(tt,{pages:et,pageParams:rt}){const st=et.length-1;return et.length>0?tt.getNextPageParam(et[st],et,rt[st],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var st;return et.length>0?(st=tt.getPreviousPageParam)==null?void 0:st.call(tt,et[0],et,rt[0],rt):void 0}function hasNextPage(tt,et){return et?getNextPageParam(tt,et)!=null:!1}function hasPreviousPage(tt,et){return!et||!tt.getPreviousPageParam?!1:getPreviousPageParam(tt,et)!=null}var ls,Uo,Ho,eu,tu,Vo,ru,su,Jp,QueryClient=(Jp=class{constructor(tt={}){Lr(this,ls);Lr(this,Uo);Lr(this,Ho);Lr(this,eu);Lr(this,tu);Lr(this,Vo);Lr(this,ru);Lr(this,su);Cr(this,ls,tt.queryCache||new QueryCache),Cr(this,Uo,tt.mutationCache||new MutationCache),Cr(this,Ho,tt.defaultOptions||{}),Cr(this,eu,new Map),Cr(this,tu,new Map),Cr(this,Vo,0)}mount(){R1(this,Vo)._++,Kt(this,Vo)===1&&(Cr(this,ru,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,ls).onFocus())})),Cr(this,su,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,ls).onOnline())})))}unmount(){var tt,et;R1(this,Vo)._--,Kt(this,Vo)===0&&((tt=Kt(this,ru))==null||tt.call(this),Cr(this,ru,void 0),(et=Kt(this,su))==null||et.call(this),Cr(this,su,void 0))}isFetching(tt){return Kt(this,ls).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Uo).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,ls).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,ls).build(this,et),st=rt.state.data;return st===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(st))}getQueriesData(tt){return Kt(this,ls).findAll(tt).map(({queryKey:et,state:rt})=>{const st=rt.data;return[et,st]})}setQueryData(tt,et,rt){const st=this.defaultQueryOptions({queryKey:tt}),nt=Kt(this,ls).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,ls).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,ls).findAll(tt).map(({queryKey:st})=>[st,this.setQueryData(st,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,ls).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,ls);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,ls),st={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(nt=>{nt.reset()}),this.refetchQueries(st,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},st=notifyManager.batch(()=>Kt(this,ls).findAll(tt).map(nt=>nt.cancel(rt)));return Promise.all(st).then(noop$1).catch(noop$1)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,ls).findAll(tt).forEach(st=>{st.invalidate()}),(tt==null?void 0:tt.refetchType)==="none")return Promise.resolve();const rt={...tt,type:(tt==null?void 0:tt.refetchType)??(tt==null?void 0:tt.type)??"active"};return this.refetchQueries(rt,et)})}refetchQueries(tt,et={}){const rt={...et,cancelRefetch:et.cancelRefetch??!0},st=notifyManager.batch(()=>Kt(this,ls).findAll(tt).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$1)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(st).then(noop$1)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,ls).build(this,et);return rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))?rt.fetch(et):Promise.resolve(rt.state.data)}prefetchQuery(tt){return this.fetchQuery(tt).then(noop$1).catch(noop$1)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$1).catch(noop$1)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,Uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,ls)}getMutationCache(){return Kt(this,Uo)}getDefaultOptions(){return Kt(this,Ho)}setDefaultOptions(tt){Cr(this,Ho,tt)}setQueryDefaults(tt,et){Kt(this,eu).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,eu).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,tu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,tu).values()];let rt={};return et.forEach(st=>{partialMatchKey(tt,st.mutationKey)&&(rt={...rt,...st.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Ho).queries,...this.getQueryDefaults(tt.queryKey),...tt,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(tt){return tt!=null&&tt._defaulted?tt:{...Kt(this,Ho).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,ls).clear(),Kt(this,Uo).clear()}},ls=new WeakMap,Uo=new WeakMap,Ho=new WeakMap,eu=new WeakMap,tu=new WeakMap,Vo=new WeakMap,ru=new WeakMap,su=new WeakMap,Jp),Bs,Vr,ku,Os,Sl,nu,Go,xo,Lu,iu,ou,_l,Rl,Wo,au,Kr,Au,Y0,K0,Q0,Z0,J0,_d,_h,nm,em,QueryObserver=(em=class extends Subscribable{constructor(et,rt){super();Lr(this,Kr);Lr(this,Bs);Lr(this,Vr);Lr(this,ku);Lr(this,Os);Lr(this,Sl);Lr(this,nu);Lr(this,Go);Lr(this,xo);Lr(this,Lu);Lr(this,iu);Lr(this,ou);Lr(this,_l);Lr(this,Rl);Lr(this,Wo);Lr(this,au,new Set);this.options=rt,Cr(this,Bs,et),Cr(this,xo,null),Cr(this,Go,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Go).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(rt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Kt(this,Vr).addObserver(this),shouldFetchOnMount(Kt(this,Vr),this.options)?Br(this,Kr,Au).call(this):this.updateResult(),Br(this,Kr,Z0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Vr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Vr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Br(this,Kr,J0).call(this),Br(this,Kr,_d).call(this),Kt(this,Vr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Vr);if(this.options=Kt(this,Bs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Vr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Br(this,Kr,_h).call(this),Kt(this,Vr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Bs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Vr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Vr),nt,this.options,st)&&Br(this,Kr,Au).call(this),this.updateResult(rt),ot&&(Kt(this,Vr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Vr))!==resolveEnabled(st.enabled,Kt(this,Vr))||resolveStaleTime(this.options.staleTime,Kt(this,Vr))!==resolveStaleTime(st.staleTime,Kt(this,Vr)))&&Br(this,Kr,Y0).call(this);const at=Br(this,Kr,K0).call(this);ot&&(Kt(this,Vr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Vr))!==resolveEnabled(st.enabled,Kt(this,Vr))||at!==Kt(this,Wo))&&Br(this,Kr,Q0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Cr(this,Os,st),Cr(this,nu,this.options),Cr(this,Sl,Kt(this,Vr).state)),st}getCurrentResult(){return Kt(this,Os)}trackResult(et,rt){const st={};return Object.keys(et).forEach(nt=>{Object.defineProperty(st,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),rt==null||rt(nt),et[nt])})}),st}trackProp(et){Kt(this,au).add(et)}getCurrentQuery(){return Kt(this,Vr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Bs).defaultQueryOptions(et),st=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Br(this,Kr,Au).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Os)))}createResult(et,rt){var Pt;const st=Kt(this,Vr),nt=this.options,ot=Kt(this,Os),at=Kt(this,Sl),lt=Kt(this,nu),ct=et!==st?et.state:Kt(this,ku),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const $t=this.hasListeners(),zt=!$t&&shouldFetchOnMount(et,rt),Nt=$t&&shouldFetchOptionally(et,st,rt,nt);(zt||Nt)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:yt,errorUpdatedAt:vt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,Lu))xt=Kt(this,iu);else try{Cr(this,Lu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Cr(this,iu,xt),Cr(this,xo,null)}catch($t){Cr(this,xo,$t)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let $t;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))$t=ot.data;else if($t=typeof rt.placeholderData=="function"?rt.placeholderData((Pt=Kt(this,ou))==null?void 0:Pt.state.data,Kt(this,ou)):rt.placeholderData,rt.select&&$t!==void 0)try{$t=rt.select($t),Cr(this,xo,null)}catch(zt){Cr(this,xo,zt)}$t!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,$t,rt),ft=!0)}Kt(this,xo)&&(yt=Kt(this,xo),xt=Kt(this,iu),vt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",wt=Et==="pending",St=Et==="error",Rt=wt&&bt,Ct=xt!==void 0,It={status:Et,fetchStatus:ht.fetchStatus,isPending:wt,isSuccess:Et==="success",isError:St,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:yt,errorUpdatedAt:vt,failureCount:ht.fetchFailureCount,failureReason:ht.fetchFailureReason,errorUpdateCount:ht.errorUpdateCount,isFetched:ht.dataUpdateCount>0||ht.errorUpdateCount>0,isFetchedAfterMount:ht.dataUpdateCount>ct.dataUpdateCount||ht.errorUpdateCount>ct.errorUpdateCount,isFetching:bt,isRefetching:bt&&!wt,isLoadingError:St&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:ft,isRefetchError:St&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Go)};if(this.options.experimental_prefetchInRender){const $t=Ut=>{It.status==="error"?Ut.reject(It.error):It.data!==void 0&&Ut.resolve(It.data)},zt=()=>{const Ut=Cr(this,Go,It.promise=pendingThenable());$t(Ut)},Nt=Kt(this,Go);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&$t(Nt);break;case"fulfilled":(It.status==="error"||It.data!==Nt.value)&&zt();break;case"rejected":(It.status!=="error"||It.error!==Nt.reason)&&zt();break}}return It}updateResult(et){const rt=Kt(this,Os),st=this.createResult(Kt(this,Vr),this.options);if(Cr(this,Sl,Kt(this,Vr).state),Cr(this,nu,this.options),Kt(this,Sl).data!==void 0&&Cr(this,ou,Kt(this,Vr)),shallowEqualObjects(st,rt))return;Cr(this,Os,st);const nt={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,au).size)return!0;const ut=new Set(lt??Kt(this,au));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Os)).some(ct=>{const dt=ct;return Kt(this,Os)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Br(this,Kr,nm).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Br(this,Kr,Z0).call(this)}},Bs=new WeakMap,Vr=new WeakMap,ku=new WeakMap,Os=new WeakMap,Sl=new WeakMap,nu=new WeakMap,Go=new WeakMap,xo=new WeakMap,Lu=new WeakMap,iu=new WeakMap,ou=new WeakMap,_l=new WeakMap,Rl=new WeakMap,Wo=new WeakMap,au=new WeakMap,Kr=new WeakSet,Au=function(et){Br(this,Kr,_h).call(this);let rt=Kt(this,Vr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},Y0=function(){Br(this,Kr,J0).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Vr));if(isServer||Kt(this,Os).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Os).dataUpdatedAt,et)+1;Cr(this,_l,setTimeout(()=>{Kt(this,Os).isStale||this.updateResult()},st))},K0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Vr)):this.options.refetchInterval)??!1},Q0=function(et){Br(this,Kr,_d).call(this),Cr(this,Wo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Vr))===!1||!isValidTimeout(Kt(this,Wo))||Kt(this,Wo)===0)&&Cr(this,Rl,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Br(this,Kr,Au).call(this)},Kt(this,Wo)))},Z0=function(){Br(this,Kr,Y0).call(this),Br(this,Kr,Q0).call(this,Br(this,Kr,K0).call(this))},J0=function(){Kt(this,_l)&&(clearTimeout(Kt(this,_l)),Cr(this,_l,void 0))},_d=function(){Kt(this,Rl)&&(clearInterval(Kt(this,Rl)),Cr(this,Rl,void 0))},_h=function(){const et=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),this.options);if(et===Kt(this,Vr))return;const rt=Kt(this,Vr);Cr(this,Vr,et),Cr(this,ku,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},nm=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,Os))}),Kt(this,Bs).getQueryCache().notify({query:Kt(this,Vr),type:"observerResultsUpdated"})})},em);function shouldLoadOnMount(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.state.data===void 0&&!(tt.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(tt,et){return shouldLoadOnMount(tt,et)||tt.state.data!==void 0&&shouldFetchOn(tt,et,et.refetchOnMount)}function shouldFetchOn(tt,et,rt){if(resolveEnabled(et.enabled,tt)!==!1){const st=typeof rt=="function"?rt(tt):rt;return st==="always"||st!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,st){return(tt!==et||resolveEnabled(st.enabled,tt)===!1)&&(!rt.suspense||tt.state.status!=="error")&&isStale(tt,rt)}function isStale(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))}function shouldAssignObserverCurrentProperties(tt,et){return!shallowEqualObjects(tt.getCurrentResult(),et)}var InfiniteQueryObserver=class extends QueryObserver{constructor(tt,et){super(tt,et)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(tt,et){super.setOptions({...tt,behavior:infiniteQueryBehavior()},et)}getOptimisticResult(tt){return tt.behavior=infiniteQueryBehavior(),super.getOptimisticResult(tt)}fetchNextPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"backward"}}})}createResult(tt,et){var yt,vt;const{state:rt}=tt,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(vt=(yt=rt.fetchMeta)==null?void 0:yt.fetchMore)==null?void 0:vt.direction,ct=at&&ut==="forward",dt=nt&&ut==="forward",ht=at&&ut==="backward",ft=nt&&ut==="backward";return{...st,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:ft,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!ft}}},qo,Xo,zs,To,Co,T1,e2,tm,MutationObserver$1=(tm=class extends Subscribable{constructor(rt,st){super();Lr(this,Co);Lr(this,qo);Lr(this,Xo);Lr(this,zs);Lr(this,To);Cr(this,qo,rt),this.setOptions(st),this.bindMethods(),Br(this,Co,T1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var nt;const st=this.options;this.options=Kt(this,qo).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,qo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,zs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,zs))==null?void 0:nt.state.status)==="pending"&&Kt(this,zs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,zs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Br(this,Co,T1).call(this),Br(this,Co,e2).call(this,rt)}getCurrentResult(){return Kt(this,Xo)}reset(){var rt;(rt=Kt(this,zs))==null||rt.removeObserver(this),Cr(this,zs,void 0),Br(this,Co,T1).call(this),Br(this,Co,e2).call(this)}mutate(rt,st){var nt;return Cr(this,To,st),(nt=Kt(this,zs))==null||nt.removeObserver(this),Cr(this,zs,Kt(this,qo).getMutationCache().build(Kt(this,qo),this.options)),Kt(this,zs).addObserver(this),Kt(this,zs).execute(rt)}},qo=new WeakMap,Xo=new WeakMap,zs=new WeakMap,To=new WeakMap,Co=new WeakSet,T1=function(){var st;const rt=((st=Kt(this,zs))==null?void 0:st.state)??getDefaultState();Cr(this,Xo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},e2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,To)&&this.hasListeners()){const ht=Kt(this,Xo).variables,ft=Kt(this,Xo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,To)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,To)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,To)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,To)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}this.listeners.forEach(ht=>{ht(Kt(this,Xo))})})},tm),QueryClientContext=reactExports.createContext(void 0),useQueryClient=tt=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:tt,children:et})=>(reactExports.useEffect(()=>(tt.mount(),()=>{tt.unmount()}),[tt]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:tt,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let tt=!1;return{clearReset:()=>{tt=!1},reset:()=>{tt=!0},isReset:()=>tt}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(tt,et){return typeof tt=="function"?tt(...et):!!tt}function noop(){}var ensurePreventErrorBoundaryRetry=(tt,et)=>{(tt.suspense||tt.throwOnError||tt.experimental_prefetchInRender)&&(et.isReset()||(tt.retryOnMount=!1))},useClearResetErrorBoundary=tt=>{reactExports.useEffect(()=>{tt.clearReset()},[tt])},getHasError=({result:tt,errorResetBoundary:et,throwOnError:rt,query:st})=>tt.isError&&!et.isReset()&&!tt.isFetching&&st&&shouldThrowError(rt,[tt.error,st]),ensureSuspenseTimers=tt=>{tt.suspense&&(tt.staleTime===void 0&&(tt.staleTime=1e3),typeof tt.gcTime=="number"&&(tt.gcTime=Math.max(tt.gcTime,1e3)))},willFetch=(tt,et)=>tt.isLoading&&tt.isFetching&&!et,shouldSuspend=(tt,et)=>(tt==null?void 0:tt.suspense)&&et.isPending,fetchOptimistic=(tt,et,rt)=>et.fetchOptimistic(tt).catch(()=>{rt.clearReset()});function useBaseQuery(tt,et,rt){var dt,ht,ft,xt,yt;const st=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=st.defaultQueryOptions(tt);(ht=(dt=st.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!st.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(st,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(vt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(vt));return ut.updateResult(),Et},[ut,nt]),()=>ut.getCurrentResult(),()=>ut.getCurrentResult()),reactExports.useEffect(()=>{ut.setOptions(at,{listeners:!1})},[at,ut]),shouldSuspend(at,ct))throw fetchOptimistic(at,ut,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:at.throwOnError,query:st.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(ft=st.getDefaultOptions().queries)==null?void 0:ft._experimental_afterQuery)==null||xt.call(ft,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const vt=lt?fetchOptimistic(at,ut,ot):(yt=st.getQueryCache().get(at.queryHash))==null?void 0:yt.promise;vt==null||vt.catch(noop).finally(()=>{ut.updateResult()})}return at.notifyOnChangeProps?ct:ut.trackResult(ct)}function useQuery(tt,et){return useBaseQuery(tt,QueryObserver)}function queryOptions(tt){return tt}function useMutation(tt,et){const rt=useQueryClient(),[st]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{st.setOptions(tt)},[st,tt]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(at=>st.subscribe(notifyManager.batchCalls(at)),[st]),()=>st.getCurrentResult(),()=>st.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{st.mutate(at,lt).catch(noop)},[st]);if(nt.error&&shouldThrowError(st.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}const useConversation=()=>{const tt=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"),et=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"),[rt,st]=reactExports.useState(""),nt={unread:!0,_:new Date().getTime()},{data:ot}=useQuery({queryKey:["folder","count","inbox"],queryFn:async()=>await odeServices.http().get(tt?"/zimbra/count/INBOX":"/conversation/count/inbox",{queryParams:nt}),staleTime:5*60*1e3}),at=async()=>{const lt="/zimbra/zimbra";try{const{preference:ut}=await odeServices.http().get("/userbook/preference/zimbra"),ct=ut?JSON.parse(ut).modeExpert:!1;st(ct&&et?"/zimbra/preauth":window.location.origin+lt)}catch(ut){console.error(ut),st(window.location.origin+lt)}};return reactExports.useEffect(()=>{at()},[]),{messages:ot?ot.count:0,msgLink:rt,zimbraWorkflow:tt}};var dayjs_min={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt=1e3,st=6e4,nt=36e5,ot="millisecond",at="second",lt="minute",ut="hour",ct="day",dt="week",ht="month",ft="quarter",xt="year",yt="date",vt="Invalid Date",Et=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,bt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,wt={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(kt){var Mt=["th","st","nd","rd"],Bt=kt%100;return"["+kt+(Mt[(Bt-20)%10]||Mt[Bt]||Mt[0])+"]"}},St=function(kt,Mt,Bt){var Gt=String(kt);return!Gt||Gt.length>=Mt?kt:""+Array(Mt+1-Gt.length).join(Bt)+kt},Rt={s:St,z:function(kt){var Mt=-kt.utcOffset(),Bt=Math.abs(Mt),Gt=Math.floor(Bt/60),Ot=Bt%60;return(Mt<=0?"+":"-")+St(Gt,2,"0")+":"+St(Ot,2,"0")},m:function kt(Mt,Bt){if(Mt.date()<Bt.date())return-kt(Bt,Mt);var Gt=12*(Bt.year()-Mt.year())+(Bt.month()-Mt.month()),Ot=Mt.clone().add(Gt,ht),Ht=Bt-Ot<0,Ft=Mt.clone().add(Gt+(Ht?-1:1),ht);return+(-(Gt+(Bt-Ot)/(Ht?Ot-Ft:Ft-Ot))||0)},a:function(kt){return kt<0?Math.ceil(kt)||0:Math.floor(kt)},p:function(kt){return{M:ht,y:xt,w:dt,d:ct,D:yt,h:ut,m:lt,s:at,ms:ot,Q:ft}[kt]||String(kt||"").toLowerCase().replace(/s$/,"")},u:function(kt){return kt===void 0}},Ct="en",jt={};jt[Ct]=wt;var It="$isDayjsObject",Pt=function(kt){return kt instanceof Ut||!(!kt||!kt[It])},$t=function kt(Mt,Bt,Gt){var Ot;if(!Mt)return Ct;if(typeof Mt=="string"){var Ht=Mt.toLowerCase();jt[Ht]&&(Ot=Ht),Bt&&(jt[Ht]=Bt,Ot=Ht);var Ft=Mt.split("-");if(!Ot&&Ft.length>1)return kt(Ft[0])}else{var Yt=Mt.name;jt[Yt]=Mt,Ot=Yt}return!Gt&&Ot&&(Ct=Ot),Ot||!Gt&&Ct},zt=function(kt,Mt){if(Pt(kt))return kt.clone();var Bt=typeof Mt=="object"?Mt:{};return Bt.date=kt,Bt.args=arguments,new Ut(Bt)},Nt=Rt;Nt.l=$t,Nt.i=Pt,Nt.w=function(kt,Mt){return zt(kt,{locale:Mt.$L,utc:Mt.$u,x:Mt.$x,$offset:Mt.$offset})};var Ut=function(){function kt(Bt){this.$L=$t(Bt.locale,null,!0),this.parse(Bt),this.$x=this.$x||Bt.x||{},this[It]=!0}var Mt=kt.prototype;return Mt.parse=function(Bt){this.$d=function(Gt){var Ot=Gt.date,Ht=Gt.utc;if(Ot===null)return new Date(NaN);if(Nt.u(Ot))return new Date;if(Ot instanceof Date)return new Date(Ot);if(typeof Ot=="string"&&!/Z$/i.test(Ot)){var Ft=Ot.match(Et);if(Ft){var Yt=Ft[2]-1||0,Zt=(Ft[7]||"0").substring(0,3);return Ht?new Date(Date.UTC(Ft[1],Yt,Ft[3]||1,Ft[4]||0,Ft[5]||0,Ft[6]||0,Zt)):new Date(Ft[1],Yt,Ft[3]||1,Ft[4]||0,Ft[5]||0,Ft[6]||0,Zt)}}return new Date(Ot)}(Bt),this.init()},Mt.init=function(){var Bt=this.$d;this.$y=Bt.getFullYear(),this.$M=Bt.getMonth(),this.$D=Bt.getDate(),this.$W=Bt.getDay(),this.$H=Bt.getHours(),this.$m=Bt.getMinutes(),this.$s=Bt.getSeconds(),this.$ms=Bt.getMilliseconds()},Mt.$utils=function(){return Nt},Mt.isValid=function(){return this.$d.toString()!==vt},Mt.isSame=function(Bt,Gt){var Ot=zt(Bt);return this.startOf(Gt)<=Ot&&Ot<=this.endOf(Gt)},Mt.isAfter=function(Bt,Gt){return zt(Bt)<this.startOf(Gt)},Mt.isBefore=function(Bt,Gt){return this.endOf(Gt)<zt(Bt)},Mt.$g=function(Bt,Gt,Ot){return Nt.u(Bt)?this[Gt]:this.set(Ot,Bt)},Mt.unix=function(){return Math.floor(this.valueOf()/1e3)},Mt.valueOf=function(){return this.$d.getTime()},Mt.startOf=function(Bt,Gt){var Ot=this,Ht=!!Nt.u(Gt)||Gt,Ft=Nt.p(Bt),Yt=function(wr,Sr){var dr=Nt.w(Ot.$u?Date.UTC(Ot.$y,Sr,wr):new Date(Ot.$y,Sr,wr),Ot);return Ht?dr:dr.endOf(ct)},Zt=function(wr,Sr){return Nt.w(Ot.toDate()[wr].apply(Ot.toDate("s"),(Ht?[0,0,0,0]:[23,59,59,999]).slice(Sr)),Ot)},Xt=this.$W,rr=this.$M,ur=this.$D,cr="set"+(this.$u?"UTC":"");switch(Ft){case xt:return Ht?Yt(1,0):Yt(31,11);case ht:return Ht?Yt(1,rr):Yt(0,rr+1);case dt:var xr=this.$locale().weekStart||0,Er=(Xt<xr?Xt+7:Xt)-xr;return Yt(Ht?ur-Er:ur+(6-Er),rr);case ct:case yt:return Zt(cr+"Hours",0);case ut:return Zt(cr+"Minutes",1);case lt:return Zt(cr+"Seconds",2);case at:return Zt(cr+"Milliseconds",3);default:return this.clone()}},Mt.endOf=function(Bt){return this.startOf(Bt,!1)},Mt.$set=function(Bt,Gt){var Ot,Ht=Nt.p(Bt),Ft="set"+(this.$u?"UTC":""),Yt=(Ot={},Ot[ct]=Ft+"Date",Ot[yt]=Ft+"Date",Ot[ht]=Ft+"Month",Ot[xt]=Ft+"FullYear",Ot[ut]=Ft+"Hours",Ot[lt]=Ft+"Minutes",Ot[at]=Ft+"Seconds",Ot[ot]=Ft+"Milliseconds",Ot)[Ht],Zt=Ht===ct?this.$D+(Gt-this.$W):Gt;if(Ht===ht||Ht===xt){var Xt=this.clone().set(yt,1);Xt.$d[Yt](Zt),Xt.init(),this.$d=Xt.set(yt,Math.min(this.$D,Xt.daysInMonth())).$d}else Yt&&this.$d[Yt](Zt);return this.init(),this},Mt.set=function(Bt,Gt){return this.clone().$set(Bt,Gt)},Mt.get=function(Bt){return this[Nt.p(Bt)]()},Mt.add=function(Bt,Gt){var Ot,Ht=this;Bt=Number(Bt);var Ft=Nt.p(Gt),Yt=function(rr){var ur=zt(Ht);return Nt.w(ur.date(ur.date()+Math.round(rr*Bt)),Ht)};if(Ft===ht)return this.set(ht,this.$M+Bt);if(Ft===xt)return this.set(xt,this.$y+Bt);if(Ft===ct)return Yt(1);if(Ft===dt)return Yt(7);var Zt=(Ot={},Ot[lt]=st,Ot[ut]=nt,Ot[at]=rt,Ot)[Ft]||1,Xt=this.$d.getTime()+Bt*Zt;return Nt.w(Xt,this)},Mt.subtract=function(Bt,Gt){return this.add(-1*Bt,Gt)},Mt.format=function(Bt){var Gt=this,Ot=this.$locale();if(!this.isValid())return Ot.invalidDate||vt;var Ht=Bt||"YYYY-MM-DDTHH:mm:ssZ",Ft=Nt.z(this),Yt=this.$H,Zt=this.$m,Xt=this.$M,rr=Ot.weekdays,ur=Ot.months,cr=Ot.meridiem,xr=function(Sr,dr,Pr,Ir){return Sr&&(Sr[dr]||Sr(Gt,Ht))||Pr[dr].slice(0,Ir)},Er=function(Sr){return Nt.s(Yt%12||12,Sr,"0")},wr=cr||function(Sr,dr,Pr){var Ir=Sr<12?"AM":"PM";return Pr?Ir.toLowerCase():Ir};return Ht.replace(bt,function(Sr,dr){return dr||function(Pr){switch(Pr){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Nt.s(Gt.$y,4,"0");case"M":return Xt+1;case"MM":return Nt.s(Xt+1,2,"0");case"MMM":return xr(Ot.monthsShort,Xt,ur,3);case"MMMM":return xr(ur,Xt);case"D":return Gt.$D;case"DD":return Nt.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return xr(Ot.weekdaysMin,Gt.$W,rr,2);case"ddd":return xr(Ot.weekdaysShort,Gt.$W,rr,3);case"dddd":return rr[Gt.$W];case"H":return String(Yt);case"HH":return Nt.s(Yt,2,"0");case"h":return Er(1);case"hh":return Er(2);case"a":return wr(Yt,Zt,!0);case"A":return wr(Yt,Zt,!1);case"m":return String(Zt);case"mm":return Nt.s(Zt,2,"0");case"s":return String(Gt.$s);case"ss":return Nt.s(Gt.$s,2,"0");case"SSS":return Nt.s(Gt.$ms,3,"0");case"Z":return Ft}return null}(Sr)||Ft.replace(":","")})},Mt.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Mt.diff=function(Bt,Gt,Ot){var Ht,Ft=this,Yt=Nt.p(Gt),Zt=zt(Bt),Xt=(Zt.utcOffset()-this.utcOffset())*st,rr=this-Zt,ur=function(){return Nt.m(Ft,Zt)};switch(Yt){case xt:Ht=ur()/12;break;case ht:Ht=ur();break;case ft:Ht=ur()/3;break;case dt:Ht=(rr-Xt)/6048e5;break;case ct:Ht=(rr-Xt)/864e5;break;case ut:Ht=rr/nt;break;case lt:Ht=rr/st;break;case at:Ht=rr/rt;break;default:Ht=rr}return Ot?Ht:Nt.a(Ht)},Mt.daysInMonth=function(){return this.endOf(ht).$D},Mt.$locale=function(){return jt[this.$L]},Mt.locale=function(Bt,Gt){if(!Bt)return this.$L;var Ot=this.clone(),Ht=$t(Bt,Gt,!0);return Ht&&(Ot.$L=Ht),Ot},Mt.clone=function(){return Nt.w(this.$d,this)},Mt.toDate=function(){return new Date(this.valueOf())},Mt.toJSON=function(){return this.isValid()?this.toISOString():null},Mt.toISOString=function(){return this.$d.toISOString()},Mt.toString=function(){return this.$d.toUTCString()},kt}(),Lt=Ut.prototype;return zt.prototype=Lt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",yt]].forEach(function(kt){Lt[kt[1]]=function(Mt){return this.$g(Mt,kt[0],kt[1])}}),zt.extend=function(kt,Mt){return kt.$i||(kt(Mt,Ut,zt),kt.$i=!0),zt},zt.locale=$t,zt.isDayjs=Pt,zt.unix=function(kt){return zt(1e3*kt)},zt.en=jt[Ct],zt.Ls=jt,zt.p={},zt})})(dayjs_min);var dayjs_minExports=dayjs_min.exports;const dayjs=getDefaultExportFromCjs(dayjs_minExports);var customParseFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},st=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,nt=/\d\d/,ot=/\d\d?/,at=/\d*[^-_:/,()\s\d]+/,lt={},ut=function(vt){return(vt=+vt)+(vt>68?1900:2e3)},ct=function(vt){return function(Et){this[vt]=+Et}},dt=[/[+-]\d\d:?(\d\d)?|Z/,function(vt){(this.zone||(this.zone={})).offset=function(Et){if(!Et||Et==="Z")return 0;var bt=Et.match(/([+-]|\d\d)/g),wt=60*bt[1]+(+bt[2]||0);return wt===0?0:bt[0]==="+"?-wt:wt}(vt)}],ht=function(vt){var Et=lt[vt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},ft=function(vt,Et){var bt,wt=lt.meridiem;if(wt){for(var St=1;St<=24;St+=1)if(vt.indexOf(wt(St,0,Et))>-1){bt=St>12;break}}else bt=vt===(Et?"pm":"PM");return bt},xt={A:[at,function(vt){this.afternoon=ft(vt,!1)}],a:[at,function(vt){this.afternoon=ft(vt,!0)}],S:[/\d/,function(vt){this.milliseconds=100*+vt}],SS:[nt,function(vt){this.milliseconds=10*+vt}],SSS:[/\d{3}/,function(vt){this.milliseconds=+vt}],s:[ot,ct("seconds")],ss:[ot,ct("seconds")],m:[ot,ct("minutes")],mm:[ot,ct("minutes")],H:[ot,ct("hours")],h:[ot,ct("hours")],HH:[ot,ct("hours")],hh:[ot,ct("hours")],D:[ot,ct("day")],DD:[nt,ct("day")],Do:[at,function(vt){var Et=lt.ordinal,bt=vt.match(/\d+/);if(this.day=bt[0],Et)for(var wt=1;wt<=31;wt+=1)Et(wt).replace(/\[|\]/g,"")===vt&&(this.day=wt)}],M:[ot,ct("month")],MM:[nt,ct("month")],MMM:[at,function(vt){var Et=ht("months"),bt=(ht("monthsShort")||Et.map(function(wt){return wt.slice(0,3)})).indexOf(vt)+1;if(bt<1)throw new Error;this.month=bt%12||bt}],MMMM:[at,function(vt){var Et=ht("months").indexOf(vt)+1;if(Et<1)throw new Error;this.month=Et%12||Et}],Y:[/[+-]?\d+/,ct("year")],YY:[nt,function(vt){this.year=ut(vt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function yt(vt){var Et,bt;Et=vt,bt=lt&<.formats;for(var wt=(vt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function($t,zt,Nt){var Ut=Nt&&Nt.toUpperCase();return zt||bt[Nt]||rt[Nt]||bt[Ut].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Lt,kt,Mt){return kt||Mt.slice(1)})})).match(st),St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt],jt=xt[Ct],It=jt&&jt[0],Pt=jt&&jt[1];wt[Rt]=Pt?{regex:It,parser:Pt}:Ct.replace(/^\[|\]$/g,"")}return function($t){for(var zt={},Nt=0,Ut=0;Nt<St;Nt+=1){var Lt=wt[Nt];if(typeof Lt=="string")Ut+=Lt.length;else{var kt=Lt.regex,Mt=Lt.parser,Bt=$t.slice(Ut),Gt=kt.exec(Bt)[0];Mt.call(zt,Gt),$t=$t.replace(Gt,"")}}return function(Ot){var Ht=Ot.afternoon;if(Ht!==void 0){var Ft=Ot.hours;Ht?Ft<12&&(Ot.hours+=12):Ft===12&&(Ot.hours=0),delete Ot.afternoon}}(zt),zt}}return function(vt,Et,bt){bt.p.customParseFormat=!0,vt&&vt.parseTwoDigitYear&&(ut=vt.parseTwoDigitYear);var wt=Et.prototype,St=wt.parse;wt.parse=function(Rt){var Ct=Rt.date,jt=Rt.utc,It=Rt.args;this.$u=jt;var Pt=It[1];if(typeof Pt=="string"){var $t=It[2]===!0,zt=It[3]===!0,Nt=$t||zt,Ut=It[2];zt&&(Ut=It[2]),lt=this.$locale(),!$t&&Ut&&(lt=bt.Ls[Ut]),this.$d=function(Bt,Gt,Ot){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*Bt);var Ht=yt(Gt)(Bt),Ft=Ht.year,Yt=Ht.month,Zt=Ht.day,Xt=Ht.hours,rr=Ht.minutes,ur=Ht.seconds,cr=Ht.milliseconds,xr=Ht.zone,Er=new Date,wr=Zt||(Ft||Yt?1:Er.getDate()),Sr=Ft||Er.getFullYear(),dr=0;Ft&&!Yt||(dr=Yt>0?Yt-1:Er.getMonth());var Pr=Xt||0,Ir=rr||0,zr=ur||0,Rr=cr||0;return xr?new Date(Date.UTC(Sr,dr,wr,Pr,Ir,zr,Rr+60*xr.offset*1e3)):Ot?new Date(Date.UTC(Sr,dr,wr,Pr,Ir,zr,Rr)):new Date(Sr,dr,wr,Pr,Ir,zr,Rr)}catch{return new Date("")}}(Ct,Pt,jt),this.init(),Ut&&Ut!==!0&&(this.$L=this.locale(Ut).$L),Nt&&Ct!=this.format(Pt)&&(this.$d=new Date("")),lt={}}else if(Pt instanceof Array)for(var Lt=Pt.length,kt=1;kt<=Lt;kt+=1){It[1]=Pt[kt-1];var Mt=bt.apply(this,It);if(Mt.isValid()){this.$d=Mt.$d,this.$L=Mt.$L,this.init();break}kt===Lt&&(this.$d=new Date(""))}else St.call(this,Rt)}}})})(customParseFormat$1);var customParseFormatExports=customParseFormat$1.exports;const customParseFormat=getDefaultExportFromCjs(customParseFormatExports);var localizedFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(st,nt,ot){var at=nt.prototype,lt=at.format;ot.en.formats=rt,at.format=function(ut){ut===void 0&&(ut="YYYY-MM-DDTHH:mm:ssZ");var ct=this.$locale().formats,dt=function(ht,ft){return ht.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(xt,yt,vt){var Et=vt&&vt.toUpperCase();return yt||ft[vt]||rt[vt]||ft[Et].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(bt,wt,St){return wt||St.slice(1)})})}(ut,ct===void 0?{}:ct);return lt.call(this,dt)}}})})(localizedFormat$1);var localizedFormatExports=localizedFormat$1.exports;const localizedFormat=getDefaultExportFromCjs(localizedFormatExports);var relativeTime$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){return function(rt,st,nt){rt=rt||{};var ot=st.prototype,at={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function lt(ct,dt,ht,ft){return ot.fromToBase(ct,dt,ht,ft)}nt.en.relativeTime=at,ot.fromToBase=function(ct,dt,ht,ft,xt){for(var yt,vt,Et,bt=ht.$locale().relativeTime||at,wt=rt.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt];Ct.d&&(yt=ft?nt(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var jt=(rt.rounding||Math.round)(Math.abs(yt));if(Et=yt>0,jt<=Ct.r||!Ct.r){jt<=1&&Rt>0&&(Ct=wt[Rt-1]);var It=bt[Ct.l];xt&&(jt=xt(""+jt)),vt=typeof It=="string"?It.replace("%d",jt):It(jt,dt,Ct.l,Et);break}}if(dt)return vt;var Pt=Et?bt.future:bt.past;return typeof Pt=="function"?Pt(vt):Pt.replace("%s",vt)},ot.to=function(ct,dt){return lt(ct,dt,this,!0)},ot.from=function(ct,dt){return lt(ct,dt,this)};var ut=function(ct){return ct.$u?nt.utc():nt()};ot.toNow=function(ct){return this.to(ut(this),ct)},ot.fromNow=function(ct){return this.from(ut(this),ct)}}})})(relativeTime$1);var relativeTimeExports=relativeTime$1.exports;const relativeTime=getDefaultExportFromCjs(relativeTimeExports);var de$2={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(ut){return ut&&typeof ut=="object"&&"default"in ut?ut:{default:ut}}var nt=st(rt),ot={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function at(ut,ct,dt){var ht=ot[dt];return Array.isArray(ht)&&(ht=ht[ct?0:1]),ht.replace("%d",ut)}var lt={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(ut){return ut+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:at,m:at,mm:at,h:at,hh:at,d:at,dd:at,M:at,MM:at,y:at,yy:at}};return nt.default.locale(lt,null,!0),lt})})(de$2);var es={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(at){return at+"º"}};return nt.default.locale(ot,null,!0),ot})})(es);var fr={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(at){return""+at+(at===1?"er":"")}};return nt.default.locale(ot,null,!0),ot})})(fr);var it={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(at){return at+"º"}};return nt.default.locale(ot,null,!0),ot})})(it);var pt={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(dayjs_minExports)})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(at){return at+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return nt.default.locale(ot,null,!0),ot})})(pt);dayjs.extend(relativeTime);dayjs.extend(customParseFormat);dayjs.extend(localizedFormat);function useDate(){const{currentLanguage:tt}=useEdificeClient(),{t:et}=useTranslation(),rt=reactExports.useCallback((lt,ut)=>{if(lt.length<11)return dayjs(lt,["YYYY-MM-DD"],ut);if(lt.split("").findIndex(ct=>"0">ct||ct>"9")<0)return dayjs(Number.parseInt(lt)).locale(tt);{let ct=dayjs(lt).locale(tt);return ct.isValid()||(ct=dayjs(lt,["YYYY-MM-DD HH:mm:ss.SSS"]).locale(tt)),ct}},[tt]),st=reactExports.useCallback(lt=>{let ut=dayjs();try{return typeof lt>"u"?void 0:(typeof lt=="string"?ut=rt(lt):typeof lt=="number"?ut=dayjs(lt).locale(tt):typeof lt.$date=="number"?ut=dayjs(new Date(lt.$date)).locale(tt):typeof lt.$date=="string"&&(ut=rt(lt.$date)),ut)}catch(ct){console.error(ct)}return ut},[tt,rt]),nt=reactExports.useCallback(lt=>{const ut=st(lt);if(!(ut!=null&&ut.isValid()))return"";const ct=dayjs();return ut.isSame(ct,"date")?ut.fromNow():ut.isSame(ct.subtract(1,"day"),"date")?et("date.format.yesterday"):ct.diff(ut,"days")<=7?ut.format(et("date.format.currentWeek")):ut.isSame(ct,"year")?ut.format(et("date.format.currentYear")):ut.format(et("date.format.previousYear"))},[tt,rt]),ot=reactExports.useCallback(lt=>{const ut=st(lt);return ut!=null&&ut.isValid()?ut.fromNow():""},[tt,rt]),at=reactExports.useCallback((lt,ut="short")=>{const ct=st(lt);let dt="";switch(ut){case"short":dt="L";break;case"long":dt="LL";break;case"abbr":dt="ll";break;default:dt=ut}return ct!=null&&ct.isValid()?ct.locale(tt).format(dt):""},[tt,rt]);return{fromNow:ot,formatDate:at,formatTimeAgo:nt}}function useHover(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=()=>{et(!0)},nt=()=>{et(!1)};return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return ot.addEventListener("mouseover",st),ot.addEventListener("mouseout",nt),()=>{ot.removeEventListener("mouseover",st),ot.removeEventListener("mouseout",nt)}},[rt]),[rt,tt]}let e$1={data:""},t$1=tt=>typeof window=="object"?((tt?tt.querySelector("#_goober"):window._goober)||Object.assign((tt||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:tt||e$1,l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o$1=(tt,et)=>{let rt="",st="",nt="";for(let ot in tt){let at=tt[ot];ot[0]=="@"?ot[1]=="i"?rt=ot+" "+at+";":st+=ot[1]=="f"?o$1(at,ot):ot+"{"+o$1(at,ot[1]=="k"?"":et)+"}":typeof at=="object"?st+=o$1(at,et?et.replace(/([^,])+/g,lt=>ot.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,ut=>/&/.test(ut)?ut.replace(/&/g,lt):lt?lt+" "+ut:ut)):ot):at!=null&&(ot=/^--/.test(ot)?ot:ot.replace(/[A-Z]/g,"-$&").toLowerCase(),nt+=o$1.p?o$1.p(ot,at):ot+":"+at+";")}return rt+(et&&nt?et+"{"+nt+"}":nt)+st},c$2={},s$1=tt=>{if(typeof tt=="object"){let et="";for(let rt in tt)et+=rt+s$1(tt[rt]);return et}return tt},i$2=(tt,et,rt,st,nt)=>{let ot=s$1(tt),at=c$2[ot]||(c$2[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$2[at]){let ut=ot!==tt?tt:(ct=>{let dt,ht,ft=[{}];for(;dt=l$1.exec(ct.replace(a$1,""));)dt[4]?ft.shift():dt[3]?(ht=dt[3].replace(n$1," ").trim(),ft.unshift(ft[0][ht]=ft[0][ht]||{})):ft[0][dt[1]]=dt[2].replace(n$1," ").trim();return ft[0]})(tt);c$2[at]=o$1(nt?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$2.g?c$2.g:null;return rt&&(c$2.g=c$2[at]),((ut,ct,dt,ht)=>{ht?ct.data=ct.data.replace(ht,ut):ct.data.indexOf(ut)===-1&&(ct.data=dt?ut+ct.data:ct.data+ut)})(c$2[at],et,st,lt),at},p$1=(tt,et,rt)=>tt.reduce((st,nt,ot)=>{let at=et[ot];if(at&&at.call){let lt=at(rt),ut=lt&<.props&<.props.className||/^go/.test(lt)&<at=ut?"."+ut:lt&&typeof lt=="object"?lt.props?"":o$1(lt,""):lt===!1?"":lt}return st+nt+(at??"")},"");function u$2(tt){let et=this||{},rt=tt.call?tt(et.p):tt;return i$2(rt.unshift?rt.raw?p$1(rt,[].slice.call(arguments,1),et.p):rt.reduce((st,nt)=>Object.assign(st,nt&&nt.call?nt(et.p):nt),{}):rt,t$1(et.target),et.g,et.o,et.k)}let d$1,f$2,g$1;u$2.bind({g:1});let h$1=u$2.bind({k:1});function m$1(tt,et,rt,st){o$1.p=et,d$1=tt,f$2=rt,g$1=st}function j$2(tt,et){let rt=this||{};return function(){let st=arguments;function nt(ot,at){let lt=Object.assign({},ot),ut=lt.className||nt.className;rt.p=Object.assign({theme:f$2&&f$2()},lt),rt.o=/ *go\d+/.test(ut),lt.className=u$2.apply(rt,st)+(ut?" "+ut:"");let ct=tt;return tt[0]&&(ct=lt.as||tt,delete lt.as),g$1&&ct[0]&&g$1(lt),d$1(ct,lt)}return et?et(nt):nt}}var W$2=tt=>typeof tt=="function",f$1=(tt,et)=>W$2(tt)?tt(et):tt,F$1=(()=>{let tt=0;return()=>(++tt).toString()})(),A$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),Y$1=20,U$1=(tt,et)=>{switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,Y$1)};case 1:return{...tt,toasts:tt.toasts.map(ot=>ot.id===et.toast.id?{...ot,...et.toast}:ot)};case 2:let{toast:rt}=et;return U$1(tt,{type:tt.toasts.find(ot=>ot.id===rt.id)?1:0,toast:rt});case 3:let{toastId:st}=et;return{...tt,toasts:tt.toasts.map(ot=>ot.id===st||st===void 0?{...ot,dismissed:!0,visible:!1}:ot)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(ot=>ot.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let nt=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(ot=>({...ot,pauseDuration:ot.pauseDuration+nt}))}}},P$1=[],y$1={toasts:[],pausedAt:void 0},u$1=tt=>{y$1=U$1(y$1,tt),P$1.forEach(et=>{et(y$1)})},q$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},D$1=(tt={})=>{let[et,rt]=reactExports.useState(y$1),st=reactExports.useRef(y$1);reactExports.useEffect(()=>(st.current!==y$1&&rt(y$1),P$1.push(rt),()=>{let ot=P$1.indexOf(rt);ot>-1&&P$1.splice(ot,1)}),[]);let nt=et.toasts.map(ot=>{var at,lt,ut;return{...tt,...tt[ot.type],...ot,removeDelay:ot.removeDelay||((at=tt[ot.type])==null?void 0:at.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:ot.duration||((lt=tt[ot.type])==null?void 0:lt.duration)||(tt==null?void 0:tt.duration)||q$1[ot.type],style:{...tt.style,...(ut=tt[ot.type])==null?void 0:ut.style,...ot.style}}});return{...et,toasts:nt}},J$1=(tt,et="blank",rt)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:et,ariaProps:{role:"status","aria-live":"polite"},message:tt,pauseDuration:0,...rt,id:(rt==null?void 0:rt.id)||F$1()}),x$1=tt=>(et,rt)=>{let st=J$1(et,tt,rt);return u$1({type:2,toast:st}),st.id},c$1=(tt,et)=>x$1("blank")(tt,et);c$1.error=x$1("error");c$1.success=x$1("success");c$1.loading=x$1("loading");c$1.custom=x$1("custom");c$1.dismiss=tt=>{u$1({type:3,toastId:tt})};c$1.remove=tt=>u$1({type:4,toastId:tt});c$1.promise=(tt,et,rt)=>{let st=c$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(nt=>{let ot=et.success?f$1(et.success,nt):void 0;return ot?c$1.success(ot,{id:st,...rt,...rt==null?void 0:rt.success}):c$1.dismiss(st),nt}).catch(nt=>{let ot=et.error?f$1(et.error,nt):void 0;ot?c$1.error(ot,{id:st,...rt,...rt==null?void 0:rt.error}):c$1.dismiss(st)}),tt};var K$2=(tt,et)=>{u$1({type:1,toast:{id:tt,height:et}})},X$1=()=>{u$1({type:5,time:Date.now()})},b$1=new Map,Z$1=1e3,ee$1=(tt,et=Z$1)=>{if(b$1.has(tt))return;let rt=setTimeout(()=>{b$1.delete(tt),u$1({type:4,toastId:tt})},et);b$1.set(tt,rt)},O$1=tt=>{let{toasts:et,pausedAt:rt}=D$1(tt);reactExports.useEffect(()=>{if(rt)return;let ot=Date.now(),at=et.map(lt=>{if(lt.duration===1/0)return;let ut=(lt.duration||0)+lt.pauseDuration-(ot-lt.createdAt);if(ut<0){lt.visible&&c$1.dismiss(lt.id);return}return setTimeout(()=>c$1.dismiss(lt.id),ut)});return()=>{at.forEach(lt=>lt&&clearTimeout(lt))}},[et,rt]);let st=reactExports.useCallback(()=>{rt&&u$1({type:6,time:Date.now()})},[rt]),nt=reactExports.useCallback((ot,at)=>{let{reverseOrder:lt=!1,gutter:ut=8,defaultPosition:ct}=at||{},dt=et.filter(xt=>(xt.position||ct)===(ot.position||ct)&&xt.height),ht=dt.findIndex(xt=>xt.id===ot.id),ft=dt.filter((xt,yt)=>yt<ht&&xt.visible).length;return dt.filter(xt=>xt.visible).slice(...lt?[ft+1]:[0,ft]).reduce((xt,yt)=>xt+(yt.height||0)+ut,0)},[et]);return reactExports.useEffect(()=>{et.forEach(ot=>{if(ot.dismissed)ee$1(ot.id,ot.removeDelay);else{let at=b$1.get(ot.id);at&&(clearTimeout(at),b$1.delete(ot.id))}})},[et]),{toasts:et,handlers:{updateHeight:K$2,startPause:X$1,endPause:st,calculateOffset:nt}}},oe$1=h$1`
|
|
50
|
+
`+ot):st.stack=ot}catch{}}throw st}}_request(et,rt){typeof et=="string"?(rt=rt||{},rt.url=et):rt=et||{},rt=mergeConfig$1(this.defaults,rt);const{transitional:st,paramsSerializer:nt,headers:ot}=rt;st!==void 0&&validator.assertOptions(st,{silentJSONParsing:validators.transitional(validators.boolean),forcedJSONParsing:validators.transitional(validators.boolean),clarifyTimeoutError:validators.transitional(validators.boolean)},!1),nt!=null&&(utils$4.isFunction(nt)?rt.paramsSerializer={serialize:nt}:validator.assertOptions(nt,{encode:validators.function,serialize:validators.function},!0)),rt.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?rt.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:rt.allowAbsoluteUrls=!0),validator.assertOptions(rt,{baseUrl:validators.spelling("baseURL"),withXsrfToken:validators.spelling("withXSRFToken")},!0),rt.method=(rt.method||this.defaults.method||"get").toLowerCase();let at=ot&&utils$4.merge(ot.common,ot[rt.method]);ot&&utils$4.forEach(["delete","get","head","post","put","patch","common"],yt=>{delete ot[yt]}),rt.headers=AxiosHeaders$1.concat(at,ot);const lt=[];let ut=!0;this.interceptors.request.forEach(function(vt){typeof vt.runWhen=="function"&&vt.runWhen(rt)===!1||(ut=ut&&vt.synchronous,lt.unshift(vt.fulfilled,vt.rejected))});const ct=[];this.interceptors.response.forEach(function(vt){ct.push(vt.fulfilled,vt.rejected)});let dt,ht=0,ft;if(!ut){const yt=[dispatchRequest.bind(this),void 0];for(yt.unshift.apply(yt,lt),yt.push.apply(yt,ct),ft=yt.length,dt=Promise.resolve(rt);ht<ft;)dt=dt.then(yt[ht++],yt[ht++]);return dt}ft=lt.length;let xt=rt;for(ht=0;ht<ft;){const yt=lt[ht++],vt=lt[ht++];try{xt=yt(xt)}catch(Et){vt.call(this,Et);break}}try{dt=dispatchRequest.call(this,xt)}catch(yt){return Promise.reject(yt)}for(ht=0,ft=ct.length;ht<ft;)dt=dt.then(ct[ht++],ct[ht++]);return dt}getUri(et){et=mergeConfig$1(this.defaults,et);const rt=buildFullPath(et.baseURL,et.url,et.allowAbsoluteUrls);return buildURL(rt,et.params,et.paramsSerializer)}};utils$4.forEach(["delete","get","head","options"],function(et){Axios$1.prototype[et]=function(rt,st){return this.request(mergeConfig$1(st||{},{method:et,url:rt,data:(st||{}).data}))}});utils$4.forEach(["post","put","patch"],function(et){function rt(st){return function(ot,at,lt){return this.request(mergeConfig$1(lt||{},{method:et,headers:st?{"Content-Type":"multipart/form-data"}:{},url:ot,data:at}))}}Axios$1.prototype[et]=rt(),Axios$1.prototype[et+"Form"]=rt(!0)});let CancelToken$1=class rm{constructor(et){if(typeof et!="function")throw new TypeError("executor must be a function.");let rt;this.promise=new Promise(function(ot){rt=ot});const st=this;this.promise.then(nt=>{if(!st._listeners)return;let ot=st._listeners.length;for(;ot-- >0;)st._listeners[ot](nt);st._listeners=null}),this.promise.then=nt=>{let ot;const at=new Promise(lt=>{st.subscribe(lt),ot=lt}).then(nt);return at.cancel=function(){st.unsubscribe(ot)},at},et(function(ot,at,lt){st.reason||(st.reason=new CanceledError$1(ot,at,lt),rt(st.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(et){if(this.reason){et(this.reason);return}this._listeners?this._listeners.push(et):this._listeners=[et]}unsubscribe(et){if(!this._listeners)return;const rt=this._listeners.indexOf(et);rt!==-1&&this._listeners.splice(rt,1)}toAbortSignal(){const et=new AbortController,rt=st=>{et.abort(st)};return this.subscribe(rt),et.signal.unsubscribe=()=>this.unsubscribe(rt),et.signal}static source(){let et;return{token:new rm(function(nt){et=nt}),cancel:et}}};function spread$1(tt){return function(rt){return tt.apply(null,rt)}}function isAxiosError$1(tt){return utils$4.isObject(tt)&&tt.isAxiosError===!0}const HttpStatusCode$1={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(HttpStatusCode$1).forEach(([tt,et])=>{HttpStatusCode$1[et]=tt});function createInstance(tt){const et=new Axios$1(tt),rt=bind$3(Axios$1.prototype.request,et);return utils$4.extend(rt,Axios$1.prototype,et,{allOwnKeys:!0}),utils$4.extend(rt,et,null,{allOwnKeys:!0}),rt.create=function(nt){return createInstance(mergeConfig$1(tt,nt))},rt}const axios=createInstance(defaults$4);axios.Axios=Axios$1;axios.CanceledError=CanceledError$1;axios.CancelToken=CancelToken$1;axios.isCancel=isCancel$1;axios.VERSION=VERSION$1;axios.toFormData=toFormData$1;axios.AxiosError=AxiosError$1;axios.Cancel=axios.CanceledError;axios.all=function(et){return Promise.all(et)};axios.spread=spread$1;axios.isAxiosError=isAxiosError$1;axios.mergeConfig=mergeConfig$1;axios.AxiosHeaders=AxiosHeaders$1;axios.formToJSON=tt=>formDataToJSON(utils$4.isHTMLForm(tt)?new FormData(tt):tt);axios.getAdapter=adapters.getAdapter;axios.HttpStatusCode=HttpStatusCode$1;axios.default=axios;const{Axios,AxiosError,CanceledError,isCancel,CancelToken,VERSION,all,Cancel,isAxiosError,spread,toFormData,AxiosHeaders,HttpStatusCode,formToJSON,getAdapter,mergeConfig}=axios;function m$2(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$3=(tt,et)=>{if(tt==0)return"0 octets";const rt=1e3,st=et,nt=["octets","Ko","Mo","Go"],ot=Math.floor(Math.log(tt)/Math.log(rt));return parseFloat((tt/Math.pow(rt,ot)).toFixed(st))+" "+nt[ot]};let s$3=class{static isLocalURL(et){return et.length>0&&et.charAt(0)==="/"}static startWithHttp(et){return/^https?:\/\//gi.test(et)}static toCounter(et){return et>999?`${Number(et/1e3).toFixed(1)} k`:""+et}static generateVirtualId(){return"xxxx-xxxx-xxx-xxxx".replace(/[x]/g,()=>Math.floor(Math.random()*16).toString(16))}};const s$2=(tt,et)=>{const rt="virtualID";if(!Object.hasOwnProperty.apply(tt,[rt])){const st=et??`${s$3.generateVirtualId()}#${tt.size}`;Object.defineProperty(tt,rt,{value:st,writable:!1})}return tt[rt]};let p$3=class{static changeDimension(et,rt,st,nt){return st>nt&&(et=Math.round(et*nt/st),st=nt),et>rt&&(st=Math.round(st*rt/et),et=rt),{height:et,width:st}}static renameFileNameExtension(et,rt){const st=et.split(".");return st.pop(),st.join(".")+"."+rt}static resizeImage(et,rt,st,nt,ot="jpeg",at=80){const lt=at/100,ut=document.createElement("canvas"),ct=`image/${ot}`;let dt=et.width,ht=et.height;const ft=this.changeDimension(ht,nt,dt,st);dt=ft.width,ht=ft.height;const xt=ut.getContext("2d");return xt&&(ut.width=dt,ut.height=ht,xt.fillStyle="white",xt.fillRect(0,0,ut.width,ut.height),xt.imageSmoothingEnabled&&xt.imageSmoothingQuality&&(xt.imageSmoothingQuality="high"),xt.drawImage(et,0,0,dt,ht)),new Promise((yt,vt)=>{ut.toBlob(Et=>{Et?yt(new File([Et],rt,{type:ct,lastModified:new Date().getTime()})):vt()},ct,lt)})}static async resizeImageFile(et,rt=1440,st=1440,nt=80){if(!et)throw Error("Image resizer: file not found!");if(!et.type||!et.type.startsWith("image/"))throw Error("Image resizer: the file given is not an image.");const ot="jpeg";return new Promise(at=>{const lt=new Image;lt.setAttribute("style","max-width: none;"),lt.src=URL.createObjectURL(et),lt.onload=async()=>{const ut=await this.resizeImage(lt,this.renameFileNameExtension(et.name,ot),rt,st,ot,nt);at(ut)},lt.onerror=ut=>{throw Error("Image Loading Error: "+ut)}})}};const e$3={blog:"Blog",mindmap:"MindMap",scrapbook:"ScrapBook",collaborativewall:"CollaborativeWall",timelinegenerator:"TimelineGenerator",wiki:"Wiki",exercizer:"Exercizer"};var p$2=Object.defineProperty,d$2=(tt,et,rt)=>et in tt?p$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$4=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$4(this,"wordExtensions",new Set),n$4(this,"excelExtensions",new Set),n$4(this,"pptExtensions",new Set),n$4(this,"fileExtensionMap",new Map),n$4(this,"csvContentType",new Set),n$4(this,"csvExtensions",new Set),n$4(this,"txtExtensions",new Set),n$4(this,"mdExtensions",new Set),n$4(this,"PDF","application/pdf"),n$4(this,"OCTET_STREAM","application/octet-stream"),this.txtExtensions.add("txt"),this.mdExtensions.add("md"),this.wordExtensions.add("doc"),this.wordExtensions.add("dot"),this.wordExtensions.add("docx"),this.wordExtensions.add("dotx"),this.wordExtensions.add("docm"),this.wordExtensions.add("dotm"),this.wordExtensions.add("odt"),this.wordExtensions.add("ott"),this.wordExtensions.add("oth"),this.wordExtensions.add("odm"),this.excelExtensions.add("xls"),this.excelExtensions.add("xlt"),this.excelExtensions.add("xla"),this.excelExtensions.add("xlsx"),this.excelExtensions.add("xltx"),this.excelExtensions.add("xlsm"),this.excelExtensions.add("xltm"),this.excelExtensions.add("xlam"),this.excelExtensions.add("xlsb"),this.excelExtensions.add("ods"),this.excelExtensions.add("ots"),this.pptExtensions.add("ppt"),this.pptExtensions.add("pot"),this.pptExtensions.add("pps"),this.pptExtensions.add("ppa"),this.pptExtensions.add("pptx"),this.pptExtensions.add("potx"),this.pptExtensions.add("ppsx"),this.pptExtensions.add("ppam"),this.pptExtensions.add("pptm"),this.pptExtensions.add("potm"),this.pptExtensions.add("ppsm"),this.pptExtensions.add("odp"),this.pptExtensions.add("otp"),this.csvExtensions.add("csv"),this.fileExtensionMap.set("doc","application/msword"),this.fileExtensionMap.set("dot","application/msword"),this.fileExtensionMap.set("docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"),this.fileExtensionMap.set("dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"),this.fileExtensionMap.set("docm","application/vnd.ms-word.document.macroEnabled.12"),this.fileExtensionMap.set("dotm","application/vnd.ms-word.template.macroEnabled.12"),this.fileExtensionMap.set("xls","application/vnd.ms-excel"),this.fileExtensionMap.set("xlt","application/vnd.ms-excel"),this.fileExtensionMap.set("xla","application/vnd.ms-excel"),this.fileExtensionMap.set("xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),this.fileExtensionMap.set("xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"),this.fileExtensionMap.set("xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"),this.fileExtensionMap.set("xltm","application/vnd.ms-excel.template.macroEnabled.12"),this.fileExtensionMap.set("xlam","application/vnd.ms-excel.addin.macroEnabled.12"),this.fileExtensionMap.set("xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"),this.fileExtensionMap.set("ppt","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pot","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pps","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("ppa","application/vnd.ms-powerpoint"),this.fileExtensionMap.set("pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"),this.fileExtensionMap.set("potx","application/vnd.openxmlformats-officedocument.presentationml.template"),this.fileExtensionMap.set("ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"),this.fileExtensionMap.set("ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"),this.fileExtensionMap.set("pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"),this.fileExtensionMap.set("ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"),this.fileExtensionMap.set("odt","application/vnd.oasis.opendocument.text"),this.fileExtensionMap.set("ott","application/vnd.oasis.opendocument.text-template"),this.fileExtensionMap.set("oth","application/vnd.oasis.opendocument.text-web"),this.fileExtensionMap.set("odm","application/vnd.oasis.opendocument.text-master"),this.fileExtensionMap.set("odg","application/vnd.oasis.opendocument.graphics"),this.fileExtensionMap.set("otg","application/vnd.oasis.opendocument.graphics-template"),this.fileExtensionMap.set("odp","application/vnd.oasis.opendocument.presentation"),this.fileExtensionMap.set("otp","application/vnd.oasis.opendocument.presentation-template"),this.fileExtensionMap.set("ods","application/vnd.oasis.opendocument.spreadsheet"),this.fileExtensionMap.set("ots","application/vnd.oasis.opendocument.spreadsheet-template"),this.fileExtensionMap.set("odc","application/vnd.oasis.opendocument.chart"),this.fileExtensionMap.set("odf","application/vnd.oasis.opendocument.formula"),this.fileExtensionMap.set("odb","application/vnd.oasis.opendocument.database"),this.fileExtensionMap.set("odi","application/vnd.oasis.opendocument.image"),this.fileExtensionMap.set("oxt","application/vnd.openofficeorg.extension"),this.fileExtensionMap.set("txt","text/plain"),this.fileExtensionMap.set("md","text/markdown"),this.csvContentType.add("text/comma-separated-values"),this.csvContentType.add("text/csv"),this.csvContentType.add("application/csv")}getContentTypeForExtension(et){return this.fileExtensionMap.has(et)?this.fileExtensionMap.get(et)??null:null}getExtensionForContentType(et){for(const rt of Array.from(this.fileExtensionMap.keys()))if((this.fileExtensionMap.get(rt)||"").toLowerCase()==(et||"").toLowerCase())return rt;return null}isWordLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.wordExtensions.has(st):et==this.OCTET_STREAM&&rt?this.wordExtensions.has(rt):!1}isExcelLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.excelExtensions.has(st):et==this.OCTET_STREAM&&rt?this.excelExtensions.has(rt):!1}isCsvLike(et,rt){return this.csvContentType.has(et)?!0:et==this.OCTET_STREAM&&rt?this.csvExtensions.has(rt):!1}isPowerpointLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.pptExtensions.has(st):et==this.OCTET_STREAM&&rt?this.pptExtensions.has(rt):!1}isTxtLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.txtExtensions.has(st):et==this.OCTET_STREAM&&rt?this.txtExtensions.has(rt):!1}isMdLike(et,rt){const st=this.getExtensionForContentType(et);return st?this.mdExtensions.has(st):et==this.OCTET_STREAM&&rt?this.mdExtensions.has(rt):!1}};n$4(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$3=tt=>{if(tt>0){let et=Math.floor(tt/1e3),rt=Math.floor(et/60);return et=et%60,rt=rt%60,e$2(rt)+":"+e$2(et)}return"00:00"},e$2=tt=>tt.toString().padStart(2,"0"),o$2=()=>MediaRecorder.isTypeSupported?["video/webm;codecs=vp9",'video/mp4; codecs="avc1.424028, mp4a.40.2"',"video/webm;codecs=vp8,opus","video/webm"].find(tt=>MediaRecorder.isTypeSupported(tt)?!0:(console.error(`${tt} is not Supported`),!1))||"video/ogg":"video/webm;codecs=vp8,opus";var v$1=Object.defineProperty,T$1=(tt,et,rt)=>et in tt?v$1(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$2=(tt,et,rt)=>T$1(tt,typeof et!="symbol"?et+"":et,rt);const ERROR_CODE={SUCCESS:"0000",UNKNOWN:"0010",NOT_INITIALIZED:"0020",NOT_SUPPORTED:"0030",APP_NOT_FOUND:"0040",AGENT_NOT_FOUND:"0050",TRANSPORT_ERROR:"0060",TIME_OUT:"0070",MALFORMED_DATA:"0080",NOT_LOGGED_IN:"0090"},APP$4={VIDEO:"video"};class Subscription{constructor(et,rt){n$2(this,"revoke"),this._channel=et,this.revoke=this.setReceiver(st=>rt==null?void 0:rt(st.data))}setReceiver(et){var rt;return(rt=this._channel)==null||rt.addEventListener("message",et),()=>{this._channel&&(this._channel.removeEventListener("message",et),this._channel.close(),delete this._channel)}}}class Subject{constructor(){n$2(this,"publishChannels",new Map)}getChannelName(et){return"Subject:"+et}getPublishChannel(et){const rt=this.getChannelName(et);let st=this.publishChannels.get(rt);return st||(st=this.newChannel(et),this.publishChannels.set(rt,st)),st}newChannel(et){const rt=this.getChannelName(et),st=new BroadcastChannel(rt);return st.addEventListener("messageerror",nt=>console.log(nt.data)),st}publish(et,rt){typeof et=="string"&&this.getPublishChannel(et).postMessage(rt)}subscribe(et,rt){if(typeof et=="string"){const st=this.newChannel(et);return new Subscription(st,rt)}else return new Subscription}}const ASYNC_DATA_NAME={SESSION_READY:"sessionReady",LANG_READY:"langReady",SKIN_READY:"skinReady",OVERRIDE_READY:"overrideReady",APPCONF_READY:"appConfReady"};class Promisified{constructor(){n$2(this,"_resolution"),n$2(this,"_rejection"),n$2(this,"_promise",new Promise((et,rt)=>{this._resolution=et,this._rejection=rt}))}get promise(){return this._promise}resolve(et){this._resolution&&this._resolution(et)}reject(et){this._rejection&&this._rejection(et)}}class NotifyFramework{constructor(){n$2(this,"promises",{}),n$2(this,"subject",new Subject)}asyncData(et){return typeof this.promises[et]>"u"&&(this.promises[et]=new Promisified),this.promises[et]}onSessionReady(){return this.asyncData(ASYNC_DATA_NAME.SESSION_READY)}onLangReady(){return this.asyncData(ASYNC_DATA_NAME.LANG_READY)}onSkinReady(){return this.asyncData(ASYNC_DATA_NAME.SKIN_READY)}onOverridesReady(){return this.asyncData(ASYNC_DATA_NAME.OVERRIDE_READY)}onAppConfReady(){return this.asyncData(ASYNC_DATA_NAME.APPCONF_READY)}promisify(){return new Promisified}events(){return this.subject}}const notify=new NotifyFramework,loadedScripts$1={};class Http{constructor(et){n$2(this,"axios"),n$2(this,"_latestResponse"),this.axios=axios.create(et)}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);return et.headers&&(rt.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers)),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams)),rt}else return this.axios.defaults}toCdnUrl(et){const rt=ConfigurationFrameworkFactory.instance().Platform.cdnDomain;if((rt==null?void 0:rt.length)>0&&et!=="/conf/public"){const st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}return et}mapAxiosError(et,rt){return et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN},!rt||rt.disableNotifications,this._latestResponse}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}get(et,rt){return this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}post(et,rt,st){return this.axios.post(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}postFile(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"],this.axios.post(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}postJson(et,rt,st){const nt=this.toAxiosConfig();return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.post(et,rt,this.toAxiosConfig(st)).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}put(et,rt,st){return this.axios.put(et,rt,this.toAxiosConfig(st)).then(nt=>this.mapAxiosResponse(nt,st)).catch(nt=>this.mapAxiosError(nt,st))}putJson(et,rt,st){const nt=this.toAxiosConfig(st);return nt.headers&&(nt.headers["Content-Type"]="application/json"),this.axios.put(et,rt,nt).then(ot=>this.mapAxiosResponse(ot,st)).catch(ot=>this.mapAxiosError(ot,st))}delete(et,rt){return this.axios.delete(et,this.toAxiosConfig(rt)).then(st=>this.mapAxiosResponse(st,rt)).catch(st=>this.mapAxiosError(st,rt))}deleteJson(et,rt){return this.axios.delete(et,{data:rt}).then(st=>this.mapAxiosResponse(st)).catch(st=>this.mapAxiosError(st))}getScript(et,rt,st){const nt=st??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${nt.split(".")[0]}={};${at};return ${nt};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts$1[et]?Promise.resolve():this.getScript(et,rt).then(st=>{loadedScripts$1[et]=!0})}}class TransportFramework{constructor(){n$2(this,"_http",new Http)}get http(){return this._http}newHttpInstance(et){return new Http(et)}}const transport=new TransportFramework;class ConfigurationFrameworkFactory{static instance(){return configure}}const http$2=transport.http;class Session{constructor(){n$2(this,"_me",null),n$2(this,"_currentLanguage",""),n$2(this,"_notLoggedIn",!0),n$2(this,"_description"),n$2(this,"_profile")}get currentLanguage(){return this._currentLanguage}get notLoggedIn(){return this._notLoggedIn}get description(){return this._description}get avatarUrl(){let et=this.description.photo;return(!et||et==="no-avatar.jpg"||et==="no-avatar.svg")&&(et=ConfigurationFrameworkFactory.instance().Platform.theme.basePath+"/img/illustrations/no-avatar.svg"),et}get user(){return this._me}get currentApp(){return configure.Platform.apps.currentApp}async initialize(){return http$2.get("/auth/oauth2/userinfo").then(et=>{if(http$2.isResponseError()||typeof et=="string")throw ERROR_CODE.NOT_LOGGED_IN;return this.setCurrentModel(et),this._notLoggedIn?this.loadDefaultLanguage():this.loadUserLanguage()}).then(et=>(this.setCurrentLanguage(et),this.loadDescription())).then(()=>this.getUserProfile()).then(()=>{notify.onSessionReady().resolve(this._me)}).catch(et=>{if(et===ERROR_CODE.NOT_LOGGED_IN)return Promise.resolve();notify.onSessionReady().reject(et)})}setCurrentModel(et){this._me=et,this._notLoggedIn=!(et&&et.sessionMetadata&&et.sessionMetadata.userId)}hasWorkflow(et){var rt;return et===void 0||((rt=this._me)==null?void 0:rt.authorizedActions.findIndex(st=>st.name===et))!==-1}hasRight(et,rt){if(rt==="owner")return et.owner&&et.owner.userId===this._me.userId;const st=rt.right||rt,nt=et.shared.filter(at=>(this._me.groupsIds||[]).indexOf(at.groupId)!==-1||at.userId===this._me.userId).find(at=>at[st]||at.manager)!==void 0,ot=rt.workflow?this.hasWorkflow(rt.workflow):!0;return nt&&ot}get latestQuotaAndUsage(){return http$2.get(`/workspace/quota/user/${this._me.userId}`).then(et=>(this._description&&(this._description.quota=et.quota,this._description.storage=et.storage),et)).catch(()=>({quota:0,storage:0}))}setCurrentLanguage(et){this._currentLanguage=et,notify.onLangReady().resolve(et)}loadDefaultLanguage(){return http$2.get("/locale").then(et=>et.locale).catch(()=>this._currentLanguage)}loadDescription(){return Promise.all([http$2.get("/userbook/api/person",{requestName:"refreshAvatar"}),http$2.get("/directory/userbook/"+this._me.userId)]).then(et=>(et[0].status==="ok"&&et[0].result&&et[0].result.length>0?this._description=et[0].result[0]:this._description={},this._description.type&&!this._description.profiles&&(this._description.profiles=this._description.type),Object.assign(this._description,et[1]),this._description))}get profile(){return this._profile}getUserProfile(){return http$2.get("/userbook/api/person").then(et=>et.result).then(et=>this._profile=et[0].type)}loadUserLanguage(){return http$2.get("/userbook/preference/language").then(et=>{try{return JSON.parse(et.preference)["default-domain"]}catch{return this.loadDefaultLanguage()}}).catch(()=>this.loadDefaultLanguage())}getEmailValidationInfos(){return http$2.get("/directory/user/mailstate")}checkEmail(et){return http$2.put("/directory/user/mailstate",{email:et})}tryEmailValidation(et){return http$2.post("/directory/user/mailstate",{key:et})}getMobileValidationInfos(){return http$2.get("/directory/user/mobilestate")}checkMobile(et){return http$2.put("/directory/user/mobilestate",{mobile:et})}tryMobileValidation(et){return http$2.post("/directory/user/mobilestate",{key:et})}getMfaInfos(){return http$2.get("/auth/user/mfa/code")}tryMfaCode(et){return http$2.post("/auth/user/mfa/code",{key:et})}}class SessionFramework{constructor(){n$2(this,"session",new Session)}initialize(){return this.session.initialize()}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),transport.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(transport.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}logout(){return transport.http.get("/auth/logout").finally(()=>{})}}const session=new SessionFramework;class Theme{constructor(){n$2(this,"_conf"),n$2(this,"_loaded"),n$2(this,"skinName",""),n$2(this,"themeName",""),n$2(this,"skin","raw"),n$2(this,"themeUrl","/assets/themes/raw/default/"),n$2(this,"templateOverrides",{}),n$2(this,"portalTemplate","/assets/themes/raw/portal.html"),n$2(this,"basePath",""),n$2(this,"logoutCallback","/"),n$2(this,"skins",[]),n$2(this,"is1D",!1),n$2(this,"is2D",!1),n$2(this,"_onSkinReady",notify.onSkinReady()),n$2(this,"_onOverrideReady",notify.onOverridesReady())}initialize(et){return notify.onSessionReady().promise.then(()=>this.load(et))}get version(){return configure.Platform.deploymentTag}get cdnDomain(){return configure.Platform.cdnDomain}async onFullyReady(){return await this._loaded,this}onSkinReady(){return this._onSkinReady.promise}onOverrideReady(){return this._onOverrideReady.promise}async getConf(et){return this._conf=this._conf??await transport.http.getScript("/assets/theme-conf.js",{queryParams:{v:et??this.version}},"exports.conf"),this._conf}load(et){return et=et??this.version,this._loaded||(this._loaded=(session.session.notLoggedIn?this.loadDisconnected(et):this.loadConnected(et)).then(async()=>{var rt,st;const nt=await this.listSkins();this.is1D=((rt=nt.find(ot=>ot.child===this.skin))==null?void 0:rt.parent)==="panda",this.is2D=((st=nt.find(ot=>ot.child===this.skin))==null?void 0:st.parent)==="theme-open-ent"})),this._loaded}loadDisconnected(et){return new Promise((rt,st)=>{transport.http.get("/skin",{queryParams:{v:this.version}}).then(nt=>{this.skin=nt.skin,this.themeUrl=`${this.cdnDomain}/assets/themes/${nt.skin}/skins/default/`,this.basePath=this.themeUrl+"../../",this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${nt.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(ot=>{this.templateOverrides=ot,this._onOverrideReady.resolve(ot),rt()}).catch(ot=>{if(transport.http.latestResponse.status===404)rt();else throw ot})}).catch(nt=>{this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt),st()})})}loadConnected(et){return new Promise((rt,st)=>{this.loadDefaultTheme(et).then(()=>{this._onSkinReady.resolve(this),transport.http.get(`/assets/themes/${this.skin}/template/override.json`,{disableNotifications:!0,queryParams:{v:et}}).then(nt=>{this.templateOverrides=nt,this._onOverrideReady.resolve(nt),rt()}).catch(nt=>{if(transport.http.latestResponse.status===404)rt(),this._onSkinReady.reject(nt),this._onOverrideReady.reject(nt);else throw nt})})})}async loadDefaultTheme(et){return session.session.notLoggedIn?Promise.reject():transport.http.get("/theme",{queryParams:{_:et}}).then(rt=>{this.skinName=rt.skinName,this.themeName=rt.themeName,this.themeUrl=rt.skin,this.basePath=`${this.cdnDomain}${this.themeUrl}../../`,this.skin=this.themeUrl.split("/assets/themes/")[1].split("/")[0],this.portalTemplate=`${this.cdnDomain}/assets/themes/${this.skin}/portal.html`,this.logoutCallback=rt.logoutCallback})}listThemes(){return transport.http.get("/themes")}async setDefaultTheme(et){await transport.http.get("/userbook/api/edit-userbook-info?prop=theme-"+this.skin+"&value="+et._id),await this.loadDefaultTheme(this.version)}listSkins(){return this.skins.length>0?Promise.resolve(this.skins):this.getConf().then(et=>{const rt=et.overriding.find(st=>st.child===this.skin);return rt!=null&&rt.group?this.skins=this.skins.concat(et.overriding.filter(st=>st.group===rt.group)):this.skins=this.skins.concat(et.overriding),this.skins})}async getHelpPath(){const et=(await this.listSkins()).find(rt=>rt.child===this.skin);return(et==null?void 0:et.help)??"/help"}}const bundle$1={},promises$1={},defaultDiacriticsRemovalMap$1=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class Idiom{translate(et,rt){et=et??"";let st=bundle$1[et]===void 0?et:bundle$1[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et){return this.loadBundlePromise(session.session.currentLanguage,et)}addBundle(et,rt){this.loadBundle(session.session.currentLanguage,et,rt)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises$1[rt]}loadBundle(et,rt,st){const nt=promises$1[rt];if(nt)st&&nt.then(st).catch(st);else{const ot=new Promisified;promises$1[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),transport.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle$1,lt),typeof st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle$1[rt]!="string"&&(bundle$1[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap$1.length;rt++)et=et.replace(defaultDiacriticsRemovalMap$1[rt].letters,defaultDiacriticsRemovalMap$1[rt].base);return et}}class UserPreferences{constructor(){n$2(this,"data",{})}get(et){return this.data[et]}load(et,rt){return transport.http.get("/userbook/preference/"+et).then(st=>{try{return JSON.parse(st.preference)}catch{return rt??{}}}).then(st=>(this.data[et]=st??{},st))}update(et,rt){return rt!==void 0&&(this.data[et]=rt),this}save(et){return transport.http.putJson("/userbook/preference/"+et,this.data[et])}}class User{constructor(){n$2(this,"_me",null),n$2(this,"_keepOpenOnLogout",!1),n$2(this,"_preferences",new UserPreferences),n$2(this,"_bookmarkedApps",[])}get keepOpenOnLogout(){return this._keepOpenOnLogout}get preferences(){return this._preferences}get bookmarkedApps(){return this._bookmarkedApps}initialize(et){return this.loadPublicConf(),notify.onSessionReady().promise.then(rt=>{rt&&this.setCurrentModel(rt)})}setCurrentModel(et){this._me=et,this._preferences=new UserPreferences,this.loadBookmarks()}loadPublicConf(){return transport.http.get("/conf/public").then(et=>(this._keepOpenOnLogout=(et==null?void 0:et.keepOpenOnLogout)||!1,et))}async loadBookmarks(){await transport.http.get("/userbook/preference/apps").then(et=>{et.preference||(et.preference=null);const rt=JSON.parse(et.preference);let st;if(rt&&rt.length&&typeof rt.concat=="function"){this._bookmarkedApps=rt,st={bookmarks:rt.map(at=>at.name),applications:[]},transport.http.putJson("/userbook/preference/apps",st);return}else st=rt;st||(st={bookmarks:[],applications:[]});let nt=!0;const ot=[];st.bookmarks.forEach((at,lt)=>{const ut=this._me.apps.find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);this._bookmarkedApps.push(ct)}else ot.push(at),nt=!1}),ot.forEach(at=>{const lt=st.bookmarks.indexOf(at);lt!==-1&&st.bookmarks.splice(lt,1)}),nt||transport.http.putJson("/userbook/preference/apps",st)})}loadAppPrefs(et){return this.preferences.load(et,{})}saveAppPrefs(et){return this.preferences.save(et)}loadLanguage(){return this.preferences.load("language",{"default-domain":session.session.currentLanguage}).then(et=>et["default-domain"])}saveLanguage(et){return this.preferences.update("language",{"default-domain":et}).save("language")}}const http$1=transport==null?void 0:transport.http;class AppConf{constructor(){n$2(this,"_publicConf",{}),n$2(this,"_currentApp"),n$2(this,"_appConf",{})}get currentApp(){return this._currentApp??null}setCurrentApp(et){return this._currentApp=et,this}async initialize(et,rt=!1){rt||this.setCurrentApp(et),await Promise.all([this.getPublicConf(et),this.loadI18n(et)])}async getPublicConf(et){return this._publicConf[et]||(this._publicConf[et]=await http$1.get(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}})),this._publicConf[et]}async getWebAppConf(et){let rt;return this._appConf[et]||(await http$1.get("/applications-list")).apps.forEach(st=>{if(st!=null&&st.prefix){const nt=st.prefix.replace("/","");this._appConf[nt]=st}else st!=null&&st.name&&st.name.toLowerCase()==et&&(rt=st)}),this._appConf[et]??rt}async loadI18n(et){return await notify.onLangReady().promise,configure.Platform.idiom.addBundlePromise(`/${et}/i18n`)}}class Analytics{constructor(){n$2(this,"_status","void"),n$2(this,"_params")}get status(){return this._status}xiti(){return this.parametersWithCheck("xiti",!1)}parameters(et){return this.parametersWithCheck(et,!0)}async parametersWithCheck(et,rt){return this.initialize().promise.then(st=>!rt||st.type===et||st.type==="multiple"?st[et]:void 0)}initialize(){return this._params||(this._params=notify.promisify(),this._status="pending",Promise.all([transport.http.get("/analyticsConf"),transport.http.get("/xiti/config")]).then(async et=>{var rt;if(!et||!et[0]||!et[0].type)throw ERROR_CODE.MALFORMED_DATA;et[1]&&et[1].active&&(et[0].xiti=await this.initializeXiti(et[1])),(rt=this._params)==null||rt.resolve(et[0]),this._status="ready"}).catch(et=>{var rt;throw this._status="failed",(rt=this._params)==null||rt.reject(),et})),this._params}async initializeXiti(et){if(!et.structureMap||!configure.Platform.apps.currentApp)return;const rt=await notify.onSessionReady().promise,st=session.session.description;let nt;for(const ct of rt.structures){const dt=et.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(configure.Platform.apps.currentApp);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:et.ID_PROJET,EXPLOITANT:et.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:et.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st.profiles&&st.profiles.length>0?ut[st.profiles[0]]??"":""}}}class ConfigurationFramework{constructor(){n$2(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$2(this,"School",{}),n$2(this,"User",new User)}async initialize(et,rt){if(!et){const nt=ct=>(ct<10?"0":"")+ct.toFixed(0),ot=new Date,at=ot.getFullYear(),lt=ot.getMonth()+1,ut=ot.getDate();et=`${at}${nt(lt)}${nt(ut)}`}const st=et;this.Platform.deploymentTag=et,typeof rt=="string"&&rt.length>0&&(this.Platform.cdnDomain=rt),transport.http.setCdn(this.Platform.cdnDomain),await Promise.all([this.Platform.theme.initialize(st),notify.onSessionReady().promise.then(nt=>this.Platform.idiom.addBundlePromise("/i18n")),this.User.initialize(st)])}}const configure=new ConfigurationFramework;transport==null||transport.http;var _$2;(_$2=session==null?void 0:session.session)==null||_$2.user;class NotifyFrameworkFactory{static instance(){return notify}}const LAYER_NAME={WIDGETS:"widgets",TRANSPORT:"transport",WEB_DATA:"webDataPipeline"},EVENT_NAME={USERPREF_CHANGED:"userprefChanged",ERROR_OCCURED:"error",DATA_TRACKED:"track"};class ServiceRegistry extends Map{register({application:et,resourceType:rt},st){this.set(`${et}:main`,st),this.set(`${et}:${rt}`,st)}findService(et,rt){return this.lookupService(et,rt)}findMainService({application:et},rt){return this.lookupService({application:et,resourceType:"main"},rt)}isRegistered({application:et,resourceType:rt}){return this.get(`${et}:${rt}`)!==void 0}lookupService({application:et,resourceType:rt},st){const nt=this.get(`${et}:${rt}`);if(nt===void 0)throw`Service not found: ${et}:${rt}`;return nt(st)}}const f$3=class{constructor(et){n$2(this,"checkHttpResponse",rt=>{if(this.http.latestResponse.status>=300)throw this.http.latestResponse.statusText;return rt}),this.context=et}get http(){return this.context.http()}async copy(et){const rt=await this.http.post("/archive/duplicate",{application:et.application,resourceId:et.resourceId});return this.checkHttpResponse(rt)}async publish(et){const rt=new FormData;return rt.append("title",et.title),rt.append("cover",et.cover),rt.append("coverName",et.cover.name),rt.append("coverType",et.cover.type),rt.append("teacherAvatar",et.teacherAvatar),rt.append("teacherAvatarName",et.teacherAvatar.name||`teacherAvatar_${et.userId}`),rt.append("teacherAvatarType",et.teacherAvatar.type),rt.append("language",et.language),et.activityType.forEach(st=>{rt.append("activityType[]",st)}),et.subjectArea.forEach(st=>{rt.append("subjectArea[]",st)}),et.age.forEach(st=>{rt.append("age[]",st.toString())}),rt.append("description",et.description),et.keyWords.split(",").forEach(st=>{rt.append("keyWords[]",st.trim())}),rt.append("licence",et.licence),rt.append("pdfUri",`${window.location.origin}${this.getPrintUrl(et.resourceEntId)}`),rt.append("application",et.application?et.application:""),rt.append("resourceId",et.resourceId),rt.append("teacherSchool",et.userStructureName),await this.http.post("/appregistry/library/resource",rt,{headers:{"Content-Type":"multipart/form-data"}})}async createContext(et){const rt=await this.http.get("/explorer/context",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchContext(et){const rt=await this.http.get("/explorer/resources",{queryParams:this.toQueryParams(et)});return this.checkHttpResponse(rt)}async searchResource(et){const rt=await this.http.get(`/explorer/resources/${et.id}`,{queryParams:this.getResourceParams(et)});return this.checkHttpResponse(rt)}async createFolder(et){const rt=await this.http.post("/explorer/folders",this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async updateFolder(et){const rt=await this.http.put(`/explorer/folders/${et.folderId}`,this.createFolderToBodyParams(et));return this.checkHttpResponse(rt)}async moveToFolder(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const st=await this.http.post(`/explorer/folders/${et.folderId}/move`,this.moveToBodyParams(et));return this.checkHttpResponse(st)}async listSubfolders(et){const rt=await this.http.get(`/explorer/folders/${et}`);return this.checkHttpResponse(rt)}async deleteAll(et,rt=!1){et.resourceIds=rt?await this.mapAssetIdToIds({application:et.application,assetIds:et.resourceIds}):et.resourceIds;const st=await this.http.deleteJson("/explorer",et);return this.checkHttpResponse(st)}async trashAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/trash",rt);return this.checkHttpResponse(nt)}async restoreAll({resourceType:et,...rt},st=!1){rt.resourceIds=st?await this.mapAssetIdToIds({application:rt.application,assetIds:rt.resourceIds}):rt.resourceIds;const nt=await this.http.putJson("/explorer/restore",rt);return this.checkHttpResponse(nt)}async mapAssetIdToIds({application:et,assetIds:rt}){const st=await this.searchContext({application:et,pagination:{startIdx:0,pageSize:rt.length+1},types:[],filters:{},asset_id:rt});return rt.map(nt=>{const ot=st.resources.find(at=>at.assetId===nt);if(ot===void 0)throw"explorer.assetid.notfound";return ot.id})}async getThumbnailPath(et){if(typeof et>"u")return et;if(typeof et=="string")if(et.startsWith("blob:")){const rt=await fetch(et).then(st=>st.blob());return`/workspace/document/${(await this.context.workspace().saveFile(rt,{visibility:"protected",application:this.getApplication()}))._id}`}else return et;else return`/workspace/document/${(await this.context.workspace().saveFile(et,{visibility:"protected",application:this.getApplication()}))._id}`}toQueryParams(et){const rt={application:et.application,start_idx:et.pagination.startIdx,page_size:et.pagination.pageSize,trashed:et.trashed};if(et.types.length>0&&(rt.resource_type=et.types[0]),et.orders&&Object.entries(et.orders).length){const[[st,nt]]=Object.entries(et.orders);rt.order_by=`${st}:${nt}`}return et.filters&&Object.assign(rt,et.filters),typeof et.search=="string"&&(rt.search=et.search),typeof et.asset_id<"u"&&(rt.asset_id=[...et.asset_id]),typeof et.id<"u"&&(rt.id=et.id),rt}getResourceParams(et){return{application:et.application}}createFolderToBodyParams(et){return{application:et.application,resourceType:et.type,parentId:et.parentId,name:et.name}}moveToBodyParams(et){return{application:et.application,resourceType:this.getResourceType(),resourceIds:et.resourceIds,folderIds:et.folderIds}}};n$2(f$3,"registry",new ServiceRegistry),n$2(f$3,"register",f$3.registry.register.bind(f$3.registry)),n$2(f$3,"findService",f$3.registry.findService.bind(f$3.registry)),n$2(f$3,"findMainService",f$3.registry.findMainService.bind(f$3.registry)),n$2(f$3,"isRegistered",f$3.registry.isRegistered.bind(f$3.registry));let ResourceService=f$3;const APP$3="scrapbook",RESOURCE$3="scrapbook";class ScrapbookResourceService extends ResourceService{create(et){throw new Error("Method not implemented.")}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/scrapbook/${et.entId}`,{trashed:et.trashed?1:0,title:et.name,icon:rt,subTitle:et.description});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$3}getApplication(){return APP$3}getFormUrl(et){return et?`/scrapbook?folderid=${et}#/create-scrapbook/`:"/scrapbook#/create-scrapbook/"}getViewUrl(et){return`/scrapbook#/view-scrapbook/${et}`}getPrintUrl(et){return`/scrapbook/print#/print-scrapbook/${et}`}getEditUrl(et){return`/scrapbook#/edit-scrapbook/${et}`}getExportUrl(et){return`/scrapbook/exportHtml/${et}`}}ResourceService.register({application:RESOURCE$3,resourceType:RESOURCE$3},tt=>new ScrapbookResourceService(tt));const APP$2="homeworks",RESOURCE$2="homeworks";class HomeworksResourceService extends ResourceService{async create(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.post("/homeworks",{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats,folder:et.folder});return this.checkHttpResponse(st),{thumbnail:rt,entId:st._id}}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/homeworks/${et.entId}`,{title:et.name,thumbnail:rt,description:et.description,repeats:et.repeats});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$2}getApplication(){return APP$2}getFormUrl(et){return et?`/homeworks?folderid=${et}#/create-homeworks/`:"/homeworks#/create-homeworks/"}getViewUrl(et){return`/homeworks#/view-homeworks/${et}`}getPrintUrl(et){return`/homeworks/print#/print-homeworks/${et}`}getEditUrl(et){return`/homeworks#/edit-homeworks/${et}`}getExportUrl(){throw new Error("Export not implemented.")}}ResourceService.register({application:RESOURCE$2,resourceType:RESOURCE$2},tt=>new HomeworksResourceService(tt));const APP$1="timelinegenerator",RESOURCE$1="timelinegenerator";class TimelineGeneratorResourceService extends ResourceService{async create(et){const rt=et.thumbnail?await this.getThumbnailPath(et.thumbnail):"",st=await this.http.post("/timelinegenerator/timelines",{headline:et.name,text:et.description,icon:rt,type:"default",folder:et.folder});return this.checkHttpResponse(st),st}async update(et){const rt=await this.getThumbnailPath(et.thumbnail),st=await this.http.put(`/timelinegenerator/timeline/${et.entId}`,{headline:et.name,text:et.description,icon:rt,trashed:!!et.trashed,_id:et.entId,type:"default"});return this.checkHttpResponse(st),{thumbnail:rt,entId:et.entId}}getResourceType(){return RESOURCE$1}getApplication(){return APP$1}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/timelinegenerator#/view/${et}`}getPrintUrl(et){return`/timelinegenerator/print#/print/${et}`}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$1,resourceType:RESOURCE$1},tt=>new TimelineGeneratorResourceService(tt));const APP$5="collaborativeeditor",RESOURCE$4="collaborativeeditor";class CollaborativeEditorResourceService extends ResourceService{async create(et){const{name:rt,description:st,thumbnail:nt,folder:ot}=et,at=nt?await this.getThumbnailPath(nt):"",lt=await this.http.post("/collaborativeeditor",{name:rt,description:st,thumbnail:at,folder:ot});return this.checkHttpResponse(lt),lt}async update(et){const{name:rt,description:st,thumbnail:nt,entId:ot}=et,at=await this.getThumbnailPath(nt),lt=await this.http.put(`/collaborativeeditor/${ot}`,{name:rt,description:st,thumbnail:at});return this.checkHttpResponse(lt),{thumbnail:at,entId:ot}}getResourceType(){return RESOURCE$4}getApplication(){return APP$5}getFormUrl(){throw new Error("Method not implemented.")}getViewUrl(et){return`/collaborativeeditor#/view/${et}`}getPrintUrl(){throw new Error("Method not implemented.")}getEditUrl(){throw new Error("Method not implemented.")}getExportUrl(){throw new Error("Method not implemented.")}}ResourceService.register({application:RESOURCE$4,resourceType:RESOURCE$4},tt=>new CollaborativeEditorResourceService(tt));const globalCache={},mutexPromise={};class CacheService{constructor(et){this.context=et}get http(){return this.context.http()}async fromCacheIfPossible(et,rt,st){if(mutexPromise[et]!==void 0&&await mutexPromise[et],globalCache[et])return globalCache[et];try{const nt=rt();mutexPromise[et]=nt;const ot=await nt;return st(ot)&&(globalCache[et]=ot),ot}catch(nt){throw console.error(`Failed to retrieve value for: ${et}`,nt),nt}}clearCache(et){if(et)delete globalCache[et];else for(const rt in globalCache)globalCache.hasOwnProperty(rt)&&delete globalCache[rt]}async httpGet(et,rt){return this.fromCacheIfPossible(et,async()=>{const st=await this.http.get(et,rt),nt={...this.http.latestResponse};return{value:st,response:nt}},({response:st})=>!(st.status<200||st.status>=300))}async httpGetJson(et,rt){const{response:st,value:nt}=await this.httpGet(et,rt);if(st.status<200||st.status>=300)throw`Bad http status (${st.status}) for url: ${et}`;return nt}}class ConfService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get cdnDomain(){return configure.Platform.cdnDomain}get notify(){return this.context.notify()}async getConf(et){const[rt,st]=await Promise.all([this.getThemeConf(),this.getApplicationsList()]),[nt,ot]=await Promise.all([this.getTheme({conf:rt,publicTheme:st===void 0}),this.getWebAppConf({app:et,applications:st??[]})]),at={app:et,applications:st??[],conf:rt,currentApp:ot,theme:nt};return this.notify.onAppConfReady().resolve(at),at}async getPublicConf(et){const{response:rt,value:st}=await this.cache.httpGet(`/${et}/conf/public`,{queryParams:{_:configure.Platform.deploymentTag}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.APP_NOT_FOUND;return st}getCdnUrl(){}async savePreference(et,rt){this.http.putJson(`/userbook/preference/${et}`,rt)}async getPreference(et){const rt=await this.http.get(`/userbook/preference/${et}`);return this.http.isResponseError()||typeof rt=="string"?{}:JSON.parse(rt.preference)}async getThemeConf(et){return await this.http.getScript("/assets/theme-conf.js",{queryParams:{v:et}},"exports.conf")}async getApplicationsList(){const et=await this.http.get("/applications-list");if(!(this.http.isResponseError()||typeof et=="string"))return et.apps}async getWebAppConf({app:et,applications:rt}){return rt.find(st=>{if(st!=null&&st.prefix)return(st==null?void 0:st.prefix.replace("/",""))===et})}async getTheme({version:et,conf:rt,publicTheme:st}){var nt;const ot=await this.http.get("/theme"),at=(nt=rt==null?void 0:rt.overriding)==null?void 0:nt.find(ft=>st?ft.parent==="theme-open-ent"&&ft.bootstrapVersion==="ode-bootstrap-neo":ft.child===(ot==null?void 0:ot.themeName)),lt=st?"default":(ot==null?void 0:ot.skinName)||(at==null?void 0:at.skins[0]),ut=(ot==null?void 0:ot.skin)||`/assets/themes/${at==null?void 0:at.child}/skins/${lt}/`,ct=at==null?void 0:at.skins,dt=at==null?void 0:at.bootstrapVersion.split("-").slice(-1)[0],ht=(at==null?void 0:at.parent)==="panda";return{basePath:`${this.cdnDomain}${ut}../../`,bootstrapVersion:dt,is1d:ht,logoutCallback:(ot==null?void 0:ot.logoutCallback)||"/",skin:at==null?void 0:at.child,skinName:lt,skins:ct,themeName:at==null?void 0:at.child,themeUrl:ut,npmTheme:(at==null?void 0:at.npmTheme)??void 0}}async getLogoutCallback(et){const{response:rt,value:st}=await this.cache.httpGet("/theme",{queryParams:{_:et}});if(rt.status<200||rt.status>=300)throw ERROR_CODE.NOT_LOGGED_IN;return st.logoutCallback}}class DirectoryService{constructor(et){this.odeServices=et}get http(){return this.odeServices.http()}get cache(){return this.odeServices.cache()}getAvatarUrl(et,rt,st="100x100"){return rt==="user"?`/userbook/avatar/${et}?thumbnail=${st}`:"/assets/img/illustrations/group-avatar.svg"}getDirectoryUrl(et,rt){return rt==="user"?`/userbook/annuaire#/${et}`:`/userbook/annuaire#/group-view/${et}`}async getBookMarks(){return(await this.cache.httpGetJson("/directory/sharebookmark/all")).map(({id:et,name:rt})=>({id:et,displayName:rt,members:[]}))}async getBookMarkById(et){const{groups:rt,id:st,name:nt,users:ot}=await this.http.get(`/directory/sharebookmark/${et}`);return{id:st,displayName:nt,groups:rt.map(({name:at,id:lt})=>({displayName:at,id:lt})),users:ot.map(({displayName:at,id:lt,profile:ut})=>({profile:ut,displayName:at,firstName:"",lastName:"",login:"",id:lt}))}}async saveBookmarks(et,{bookmarks:rt,groups:st,users:nt}){this.cache.clearCache("/directory/sharebookmark/all");const ot=nt.map(ht=>typeof ht=="string"?ht:ht.id),at=st.map(ht=>typeof ht=="string"?ht:ht.id),lt=rt.map(async ht=>{if(typeof ht=="string"){const{displayName:ft,groups:xt,id:yt,users:vt}=await this.getBookMarkById(ht),Et=vt.map(wt=>wt.id),bt=xt.map(wt=>wt.id);return{displayName:ft,id:yt,members:[...bt,...Et]}}else return Promise.resolve(ht)}),ut=(await Promise.all(lt)).map(ht=>ht.members).reduce((ht,ft)=>[...ht,...ft],[]),ct={name:et,members:[...ot,...at,...ut]},{id:dt}=await this.http.postJson("/directory/sharebookmark",ct);return{id:dt,displayName:et,members:ct.members}}}const loadedScripts={};class HttpService{constructor(et,rt){n$2(this,"axios"),n$2(this,"baseUrl"),n$2(this,"headers",{}),n$2(this,"_latestResponse"),this.context=et,this.axios=axios.create(rt)}fixBaseUrl(et){return et.startsWith("http://")||et.startsWith("https://")?et:this.baseUrl?this.baseUrl.endsWith("/")||et.startsWith("/")?`${this.baseUrl}${et}`:`${this.baseUrl}/${et}`:et}useBaseUrl(et){return this.baseUrl=et,this}useHeaders(et){return this.headers=et,this}setCdn(et){et&&XMLHttpRequest&&!XMLHttpRequest.prototype.cdnUrl&&(XMLHttpRequest.prototype.cdnUrl=et,XMLHttpRequest.prototype.baseOpen=XMLHttpRequest.prototype.open,XMLHttpRequest.prototype.open=function(){const rt=arguments[1];return rt.startsWith("/infra/public")&&(arguments[1]=et+rt),/^\/([^\/]*)\/public/.test(rt)&&(arguments[1]=et+rt),rt.startsWith("/assets")&&(arguments[1]=et+rt),rt=="/conf/public"&&(arguments[1]=rt),rt.startsWith("http")&&(arguments[1]=rt),this.baseOpen.apply(this,arguments)})}toAxiosConfig(et){if(et){const rt=Object.assign({},this.axios.defaults);et.headers&&(rt.headers=Object.assign({},this.axios.defaults.headers),Object.assign(rt.headers,et.headers)),et.responseType&&(rt.responseType=et.responseType),et.queryParams&&(rt.params=Object.assign({},et.queryParams));const st=rt.headers??{};return rt.headers={...st,...this.headers},rt}else return this.axios.defaults}toCdnUrl(et){et=this.fixBaseUrl(et);const rt=this.context.conf().getCdnUrl()||"";if(rt.length>0&&et!=="/conf/public"){const st=""+et;(st.startsWith("/infra/public")||st.startsWith("/assets")||/^\/([^\/]*)\/public/.test(st))&&(et=rt+st)}return et}mapAxiosError(et,rt){et.response?this._latestResponse=et.response:et.request?this._latestResponse={status:408,statusText:ERROR_CODE.TIME_OUT}:this._latestResponse={status:500,statusText:ERROR_CODE.UNKNOWN};const{status:st,statusText:nt,headers:ot,data:at}=this._latestResponse;return rt!=null&&rt.disableNotifications||notify.events().publish(LAYER_NAME.TRANSPORT,{name:EVENT_NAME.ERROR_OCCURED,data:{params:rt,response:{status:st,statusText:nt,headers:ot},payload:at}}),at}mapAxiosResponse(et,rt){return this._latestResponse=et,et.data}get latestResponse(){return this._latestResponse}isResponseError(){return this.latestResponse.status<200||this.latestResponse.status>=300}async get(et,rt){try{const st=await this.axios.get(this.toCdnUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async post(et,rt,st){try{const nt=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async postFile(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async postJson(et,rt,st){const nt=this.toAxiosConfig();nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.post(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async put(et,rt,st){try{const nt=await this.axios.put(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putFile(et,rt,st){try{const nt=this.toAxiosConfig(st);nt.headers&&nt.headers["Content-Type"]&&delete nt.headers["Content-Type"];const ot=await this.axios.put(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async putJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.put(this.fixBaseUrl(et),rt,nt);return this.mapAxiosResponse(ot,st)}catch(ot){throw this.mapAxiosError(ot,st)}}async delete(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),this.toAxiosConfig(rt));return this.mapAxiosResponse(st,rt)}catch(st){throw this.mapAxiosError(st,rt)}}async deleteJson(et,rt){try{const st=await this.axios.delete(this.fixBaseUrl(et),{data:rt});return this.mapAxiosResponse(st)}catch(st){throw this.mapAxiosError(st)}}getScript(et,rt,st){const nt=st??"exports",ot=this.toAxiosConfig(rt);return ot.headers&&(ot.headers.Accept="application/javascript"),this.axios.get(this.toCdnUrl(et),ot).then(at=>this.mapAxiosResponse(at,rt)).then(at=>{try{const lt=`"use strict";var ${nt.split(".")[0]}={};${at};return ${nt};`;return Function(lt)()}catch{return at}}).catch(at=>{throw this.mapAxiosError(at,rt),at})}loadScript(et,rt){return loadedScripts[et]?Promise.resolve():this.getScript(et,rt).then(st=>{loadedScripts[et]=!0})}}class RightService{constructor(et){this.context=et}get session(){return this.context.session()}parseResourceRight(et){const rt=et.split(":");if(rt.length===2){if(rt[0]==="creator")return{id:rt[1],right:"creator",type:"creator"}}else return rt.length===3?{id:rt[1],right:rt[2],type:rt[0]}:void 0}parseResourceRights(et){return et.map(rt=>this.parseResourceRight(rt)).filter(rt=>rt!==void 0)}hasResourceRight({id:et,groupIds:rt},st,nt){const ot=nt.map(at=>typeof at=="string"?this.parseResourceRight(at):at).filter(at=>at!==void 0);for(const at of ot)if(at.id===et&&at.type==="creator"||at.id===et&&at.type==="user"&&at.right===st||rt.includes(at.id)&&at.type==="group"&&at.right===st)return!0;return!1}async sessionHasResourceRight(et,rt){try{const st=await this.session.getUser();return!!st&&this.hasResourceRight({groupIds:st.groupsIds,id:st.userId},et,rt)}catch(st){return console.error(`Unexpected error ${st} in sessionHasResourceRight()`),!1}}async sessionHasAtLeastOneResourceRight(et,rt){for(const st of et)if(await this.sessionHasResourceRight(st,rt))return!0;return!1}async sessionHasResourceRightForEachList(et,rt){let st=0;for(const nt of rt)await this.sessionHasResourceRight(et,nt)&&st++;return st===rt.length}async sessionHasAtLeastOneResourceRightForEachList(et,rt){for(const st of et){let nt=0;for(const ot of rt)await this.sessionHasResourceRight(st,ot)&&nt++;if(nt===rt.length)return!0}return!1}hasWorkflowRight(et,rt){return rt.findIndex(st=>st===et)!==-1}async sessionHasWorkflowRight(et){try{const rt=await this.session.getUser();return!!rt&&this.hasWorkflowRight(et,rt.authorizedActions.map(st=>st.name))}catch(rt){return console.error(`Unexpected error ${rt} in sessionHasWorkflowRight()`),!1}}async sessionHasWorkflowRights(et){const rt={};try{const st=await this.session.getUser();for(const nt of et)rt[nt]=!!st&&this.hasWorkflowRight(nt,st.authorizedActions.map(ot=>ot.name))}catch(st){console.error(`Unexpected error ${st} in sessionHasWorkflowRights()`);for(const nt of et)rt[nt]=!1}return rt}}class SessionService{constructor(et){this.context=et}get http(){return this.context.http()}get cache(){return this.context.cache()}get conf(){return this.context.conf()}onLogout(){this.cache.clearCache()}onRefreshSession(){this.cache.clearCache()}async getSession(){const et=await this.getUser(),[rt,st,nt,ot,at]=await Promise.all([this.getCurrentLanguage(et),this.latestQuotaAndUsage(et),this.loadDescription(et),this.getUserProfile(),this.getBookmarks(et)]);return{user:et,quotaAndUsage:st,currentLanguage:rt,userDescription:nt,userProfile:ot,bookmarkedApps:at}}login(et,rt,st,nt){const ot=new FormData;return ot.append("email",et),ot.append("password",rt),typeof st<"u"&&ot.append("rememberMe",""+st),typeof nt<"u"&&ot.append("secureLocation",""+nt),this.http.post("/auth/login",ot,{headers:{"content-type":"application/x-www-form-urlencoded"}}).finally(()=>{switch(this.http.latestResponse.status){case 200:throw ERROR_CODE.MALFORMED_DATA}})}async logout(){const et=await this.conf.getLogoutCallback();return this.http.get("/auth/logout?callback="+et).finally(()=>{})}async latestQuotaAndUsage(et){const rt={quota:0,storage:0};if(!et)return rt;try{return await this.http.get(`/workspace/quota/user/${et==null?void 0:et.userId}`)}catch(st){return console.error(st),rt}}async getCurrentLanguage(et){const rt=(et==null?void 0:et.sessionMetadata)&&(et==null?void 0:et.sessionMetadata.userId);try{let st;return rt?st=await this.loadUserLanguage():st=await this.loadDefaultLanguage(),st}catch(st){console.error(st)}}async loadUserLanguage(){try{const et=await this.http.get("/userbook/preference/language");return JSON.parse(et.preference)["default-domain"]}catch{return await this.loadDefaultLanguage()}}async loadDefaultLanguage(){return(await this.cache.httpGetJson("/locale")).locale}async getUser(){const{response:et,value:rt}=await this.cache.httpGet("/auth/oauth2/userinfo");if(!(et.status<200||et.status>=300)&&typeof rt=="object")return rt;throw ERROR_CODE.NOT_LOGGED_IN}hasWorkflow({workflowName:et,user:rt}){return et===void 0||(rt==null?void 0:rt.authorizedActions.findIndex(st=>st.name===et))!==-1}async loadDescription(et){if(!et)return{};try{const[rt,st]=await Promise.all([this.getUserProfile({options:{requestName:"refreshAvatar"}}),this.http.get("/directory/userbook/"+(et==null?void 0:et.userId))]);return{...st,profiles:rt}}catch(rt){return console.error(rt),{}}}async getBookmarks(et){if(!et)return[];const rt=await this.http.get("/userbook/preference/apps");rt.preference||(rt.preference=null);const st=JSON.parse(rt.preference);let nt;nt=st,nt||(nt={bookmarks:[],applications:[]});const ot=[];return nt.bookmarks.forEach((at,lt)=>{const ut=((et==null?void 0:et.apps)||[]).find(ct=>ct.name===at);if(ut){const ct=Object.assign({},ut);ot.push(ct)}}),ot}async getUserProfile(et={}){var rt,st;const{options:nt={},params:ot={}}=et,at=new URLSearchParams(ot).toString(),lt=`/userbook/api/person${at?`?${at}`:""}`,{response:ut,value:ct}=await this.cache.httpGet(lt,nt);return ut.status<200||ut.status>=300||typeof ct=="string"?["Guest"]:((st=(rt=ct==null?void 0:ct.result)==null?void 0:rt[0])==null?void 0:st.type)||["Guest"]}async isAdml(){const et=await this.getUser();return(et==null?void 0:et.functions.ADMIN_LOCAL)!==void 0}async getWebApp(et){const rt=await this.getUser();return rt==null?void 0:rt.apps.find(st=>{var nt;return st!=null&&st.prefix?(st==null?void 0:st.prefix.replace("/",""))===et||!1:st!=null&&st.address&&((nt=st.address)==null?void 0:nt.split("/")[1])===et||!1})}}const bundle={},promises={},defaultDiacriticsRemovalMap=[{base:"A",letters:/[\u0041\u24B6\uFF21\u00C0\u00C1\u00C2\u1EA6\u1EA4\u1EAA\u1EA8\u00C3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\u00C4\u01DE\u1EA2\u00C5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F]/g},{base:"AA",letters:/[\uA732]/g},{base:"AE",letters:/[\u00C6\u01FC\u01E2]/g},{base:"AO",letters:/[\uA734]/g},{base:"AU",letters:/[\uA736]/g},{base:"AV",letters:/[\uA738\uA73A]/g},{base:"AY",letters:/[\uA73C]/g},{base:"B",letters:/[\u0042\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181]/g},{base:"C",letters:/[\u0043\u24B8\uFF23\u0106\u0108\u010A\u010C\u00C7\u1E08\u0187\u023B\uA73E]/g},{base:"D",letters:/[\u0044\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779]/g},{base:"DZ",letters:/[\u01F1\u01C4]/g},{base:"Dz",letters:/[\u01F2\u01C5]/g},{base:"E",letters:/[\u0045\u24BA\uFF25\u00C8\u00C9\u00CA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\u00CB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E]/g},{base:"F",letters:/[\u0046\u24BB\uFF26\u1E1E\u0191\uA77B]/g},{base:"G",letters:/[\u0047\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E]/g},{base:"H",letters:/[\u0048\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D]/g},{base:"I",letters:/[\u0049\u24BE\uFF29\u00CC\u00CD\u00CE\u0128\u012A\u012C\u0130\u00CF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197]/g},{base:"J",letters:/[\u004A\u24BF\uFF2A\u0134\u0248]/g},{base:"K",letters:/[\u004B\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2]/g},{base:"L",letters:/[\u004C\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780]/g},{base:"LJ",letters:/[\u01C7]/g},{base:"Lj",letters:/[\u01C8]/g},{base:"M",letters:/[\u004D\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C]/g},{base:"N",letters:/[\u004E\u24C3\uFF2E\u01F8\u0143\u00D1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4]/g},{base:"NJ",letters:/[\u01CA]/g},{base:"Nj",letters:/[\u01CB]/g},{base:"O",letters:/[\u004F\u24C4\uFF2F\u00D2\u00D3\u00D4\u1ED2\u1ED0\u1ED6\u1ED4\u00D5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\u00D6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\u00D8\u01FE\u0186\u019F\uA74A\uA74C]/g},{base:"OI",letters:/[\u01A2]/g},{base:"OO",letters:/[\uA74E]/g},{base:"OU",letters:/[\u0222]/g},{base:"P",letters:/[\u0050\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754]/g},{base:"Q",letters:/[\u0051\u24C6\uFF31\uA756\uA758\u024A]/g},{base:"R",letters:/[\u0052\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782]/g},{base:"S",letters:/[\u0053\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784]/g},{base:"T",letters:/[\u0054\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786]/g},{base:"TZ",letters:/[\uA728]/g},{base:"U",letters:/[\u0055\u24CA\uFF35\u00D9\u00DA\u00DB\u0168\u1E78\u016A\u1E7A\u016C\u00DC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244]/g},{base:"V",letters:/[\u0056\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245]/g},{base:"VY",letters:/[\uA760]/g},{base:"W",letters:/[\u0057\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72]/g},{base:"X",letters:/[\u0058\u24CD\uFF38\u1E8A\u1E8C]/g},{base:"Y",letters:/[\u0059\u24CE\uFF39\u1EF2\u00DD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE]/g},{base:"Z",letters:/[\u005A\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762]/g},{base:"a",letters:/[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/g},{base:"aa",letters:/[\uA733]/g},{base:"ae",letters:/[\u00E6\u01FD\u01E3]/g},{base:"ao",letters:/[\uA735]/g},{base:"au",letters:/[\uA737]/g},{base:"av",letters:/[\uA739\uA73B]/g},{base:"ay",letters:/[\uA73D]/g},{base:"b",letters:/[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/g},{base:"c",letters:/[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/g},{base:"d",letters:/[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/g},{base:"dz",letters:/[\u01F3\u01C6]/g},{base:"e",letters:/[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/g},{base:"f",letters:/[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/g},{base:"g",letters:/[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/g},{base:"h",letters:/[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/g},{base:"hv",letters:/[\u0195]/g},{base:"i",letters:/[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/g},{base:"j",letters:/[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/g},{base:"k",letters:/[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/g},{base:"l",letters:/[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/g},{base:"lj",letters:/[\u01C9]/g},{base:"m",letters:/[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/g},{base:"n",letters:/[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/g},{base:"nj",letters:/[\u01CC]/g},{base:"o",letters:/[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/g},{base:"oi",letters:/[\u01A3]/g},{base:"ou",letters:/[\u0223]/g},{base:"oo",letters:/[\uA74F]/g},{base:"p",letters:/[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/g},{base:"q",letters:/[\u0071\u24E0\uFF51\u024B\uA757\uA759]/g},{base:"r",letters:/[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/g},{base:"s",letters:/[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B]/g},{base:"t",letters:/[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/g},{base:"tz",letters:/[\uA729]/g},{base:"u",letters:/[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/g},{base:"v",letters:/[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/g},{base:"vy",letters:/[\uA761]/g},{base:"w",letters:/[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/g},{base:"x",letters:/[\u0078\u24E7\uFF58\u1E8B\u1E8D]/g},{base:"y",letters:/[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/g},{base:"z",letters:/[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/g}];class IdiomService{constructor(et){this.context=et}get http(){return this.context.http()}async getIdiom(et,rt){await Promise.all([this.addBundlePromise(et,"/i18n"),this.addBundlePromise(et,`/${rt}/i18n`)])}translate(et,rt){et=et??"";let st=bundle[et]===void 0?et:bundle[et];if(rt&&typeof rt=="object")for(const nt in rt)typeof rt[nt]<"u"&&(st=st.replace(new RegExp("\\${"+nt+"}","g"),""+rt[nt]));return st}addBundlePromise(et,rt){return this.loadBundlePromise(et,rt)}addBundle(et,rt,st){this.loadBundle(et,rt,st)}loadBundlePromise(et,rt){return this.loadBundle(et,rt),promises[rt]}loadBundle(et,rt,st){const nt=promises[rt];if(nt)st&&nt.then(st).catch(st);else{const ot=new Promisified;promises[rt]=ot.promise;const at={};et&&(at["Accept-Language"]=et),this.http.get(rt,{headers:at}).then(lt=>{Object.assign(bundle,lt),typeof st=="function"&&st(),ot.resolve()}).catch(lt=>{typeof st=="function"&&st(),ot.reject()})}}addTranslations(et,rt){notify.onLangReady().promise.then(st=>{this.loadBundle(st,et+"/"+st+".json",rt)})}addAllTranslations(et){return et&&et.length>0?notify.onLangReady().promise.then(rt=>Promise.all(et.map(st=>this.loadBundlePromise(rt,st+"/"+rt+".json")))).then(()=>{}):Promise.reject()}addKeys(et){for(const rt in et)typeof bundle[rt]!="string"&&(bundle[rt]=et[rt])}removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class StringUtils{static removeAccents(et){for(let rt=0;rt<defaultDiacriticsRemovalMap.length;rt++)et=et.replace(defaultDiacriticsRemovalMap[rt].letters,defaultDiacriticsRemovalMap[rt].base);return et}}class ShareService{constructor(et){this.context=et}get directory(){return this.context.directory()}get http(){return this.context.http()}get cache(){return this.context.cache()}async searchShareSubjects(et,rt,st){const nt=StringUtils.removeAccents(st).toLowerCase(),ot=await this.cache.httpGetJson(`/${et}/share/json/${rt}?search=${st}`),at=ot.users.visibles.filter(({username:ut,firstName:ct,lastName:dt,login:ht})=>{const ft=StringUtils.removeAccents(dt||"").toLowerCase(),xt=StringUtils.removeAccents(ct||"").toLowerCase(),yt=StringUtils.removeAccents(ut||"").toLowerCase(),vt=StringUtils.removeAccents(ht||"").toLowerCase();return yt.includes(nt)||xt.includes(nt)||ft.includes(nt)||vt.includes(nt)}).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"user"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"user"),displayName:ut.username,id:ut.id,profile:ut.profile,type:"user"})),lt=ot.groups.visibles.filter(({name:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:this.directory.getAvatarUrl(ut.id,"group"),directoryUrl:this.directory.getDirectoryUrl(ut.id,"group"),displayName:ut.name,id:ut.id,type:"group",structureName:ut.structureName}));return[...(await this.directory.getBookMarks()).filter(({displayName:ut})=>StringUtils.removeAccents(ut||"").toLowerCase().includes(nt)).map(ut=>({avatarUrl:"",directoryUrl:"",profile:"",displayName:ut.displayName,id:ut.id,type:"sharebookmark"})),...at,...lt]}async getShareMapping(et){const rt=await this.cache.httpGetJson(`/${et}/rights/sharing`);for(const st of Object.keys(rt))if(st.includes(".")){const nt=st.split(".")[1],ot=rt[st];delete rt[st],rt[nt]=ot}return rt}getActionsAvailableFor({id:et,type:rt},st,nt){const ot=(rt==="user"?st.users.checked[et]:st.groups.checked[et])||[],at=Object.keys(nt),lt=[];for(const ut of at)nt[ut].filter(ct=>ot.includes(ct)).length>0&<.push(ut);return lt}async getRightsForResource(et,rt){const st=await this.directory.getBookMarks(),nt=`/${et}/share/json/${rt}?search=`,ot=await this.cache.httpGetJson(nt),at=await this.getShareMapping(et),lt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),ut=Object.keys(ot.users.checked).map(xt=>ot.users.visibles.find(yt=>yt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const yt=this.getActionsAvailableFor({id:xt.id,type:"user"},ot,at);return{id:xt.id,type:"user",displayName:xt.username,profile:xt.profile,avatarUrl:this.directory.getAvatarUrl(xt.id,"user"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"user"),actions:yt.map(vt=>{const Et=lt[vt];return{displayName:vt,id:vt,priority:Et.priority}})}}).sort((xt,yt)=>(xt.displayName||"").localeCompare(yt.displayName)),ct=Object.keys(ot.groups.checked).map(xt=>ot.groups.visibles.find(yt=>yt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const yt=this.getActionsAvailableFor({id:xt.id,type:"group"},ot,at);return{id:xt.id,type:"group",displayName:xt.name,profile:void 0,avatarUrl:this.directory.getAvatarUrl(xt.id,"group"),directoryUrl:this.directory.getDirectoryUrl(xt.id,"group"),actions:yt.map(vt=>{const Et=lt[vt];return{displayName:vt,id:vt,priority:Et.priority}})}}).sort((xt,yt)=>(xt.displayName||"").localeCompare(yt.displayName)),dt=[...ut,...ct],ht=ot.groups.visibles.map(({groupDisplayName:xt,id:yt,name:vt})=>({displayName:xt||vt,id:yt})),ft=ot.users.visibles.map(({id:xt,profile:yt,username:vt,firstName:Et,lastName:bt,login:wt})=>({displayName:vt,firstName:Et,lastName:bt,login:wt,profile:yt,id:xt}));return{rights:dt,visibleBookmarks:st,visibleGroups:ht,visibleUsers:ft}}async saveRights(et,rt,st){const nt=await this.getShareMapping(et),ot={bookmarks:{},groups:{},users:{}};for(const lt of st){const ut=lt.actions.map(dt=>nt[dt.id]).reduce((dt,ht)=>Array.isArray(ht)?[...dt,...ht]:dt,[]),ct=[...new Set(ut)];ct.length>0&&(lt.type==="user"?ot.users[lt.id]=ct:lt.type==="group"?ot.groups[lt.id]=ct:ot.bookmarks[lt.id]=ct)}const at=`/${et}/share/resource/${rt}`;return this.cache.clearCache(`/${et}/share/json/${rt}?search=`),await this.http.putJson(at,ot)}async getActionsForApp(et){const rt=await this.cache.httpGetJson("/infra/public/json/sharing-rights.json"),st=await this.getShareMapping(et);return Object.keys(rt).map(nt=>{const ot=rt[nt];return{displayName:nt,id:nt,priority:ot.priority,requires:ot.requires}}).filter(nt=>{var ot;return((ot=st[nt.id])==null?void 0:ot.length)>0}).sort((nt,ot)=>nt.priority-ot.priority)}}const defaultMappers={csv:function({type:tt,extension:et}){return a$2.INSTANCE.isCsvLike(tt,et)},doc:function({type:tt,extension:et}){return a$2.INSTANCE.isWordLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("wordprocessing")!==-1},xls:function({type:tt,extension:et}){return a$2.INSTANCE.isExcelLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("spreadsheet")!==-1||tt.indexOf("ms-excel")!==-1},img:function({type:tt}){return tt.indexOf("image")!==-1},pdf:function({type:tt}){return tt.indexOf("pdf")!==-1||tt==="application/x-download"},ppt:function({type:tt,extension:et}){return a$2.INSTANCE.isPowerpointLike(tt,et)?!0:tt.indexOf("document")!==-1&&tt.indexOf("presentation")!==-1||tt.indexOf("powerpoint")!==-1},txt:function({type:tt,extension:et}){return a$2.INSTANCE.isTxtLike(tt,et)},md:function({type:tt,extension:et}){return a$2.INSTANCE.isMdLike(tt,et)},video:function({type:tt}){return tt.indexOf("video")!==-1},audio:function({type:tt}){return tt.indexOf("audio")!==-1},zip:function({type:tt}){return tt.indexOf("zip")!==-1||tt.indexOf("rar")!==-1||tt.indexOf("tar")!==-1||tt.indexOf("7z")!==-1}},R$2=class sm{static getRole(et){var rt,st;return sm.role((rt=et.metadata)==null?void 0:rt["content-type"],!1,(st=et.metadata)==null?void 0:st.extension)}static role(et,rt=!1,st){if(st&&(st=st.trim()),!et)return"unknown";this.roleMappers||console.warn("[DocumentHelper.role] should not have empty roles",this);const nt={type:et,previewRole:rt,extension:st};for(const ot of this.roleMappers){const at=ot(nt);if(at)return at}return"unknown"}};n$2(R$2,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=R$2;class WorkspaceService{constructor(et){this.context=et}get http(){return this.context.http()}extractMetadata(et){const rt=et.name||"",st=rt.split("."),nt=et.type||"application/octet-stream",ot=st.length>1?st[st.length-1]:"",at={"content-type":nt,filename:rt,size:et.size,extension:ot,role:DocumentHelper.role(nt,!1,ot)},lt=rt.replace("."+at.extension,""),ut=at.extension?lt+"."+at.extension:lt;return{basename:lt,fullname:ut,metadata:at}}async saveFile(et,rt){const{fullname:st,metadata:nt}=this.extractMetadata(et),ot=new FormData;ot.append("file",et,st);const at=[];((rt==null?void 0:rt.visibility)==="public"||(rt==null?void 0:rt.visibility)==="protected")&&at.push(`${rt.visibility}=true`),rt!=null&&rt.application&&at.push(`application=${rt.application}`),nt.role==="img"&&at.push("quality=1"),rt!=null&&rt.parentId&&at.push(`parentId=${rt.parentId}`);const lt=await this.http.postFile(`/workspace/document?${at.join("&")}`,ot);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return lt}async updateFile(et,rt,st){const{fullname:nt,metadata:ot}=this.extractMetadata(rt),at=new FormData;at.append("file",rt,nt);const lt=[];ot.role==="img"&<.push("quality=1"),st!=null&&st.alt&<.push(`alt=${st.alt}`),st!=null&&st.legend&<.push(`legend=${st.legend}`),st!=null&&st.name&<.push(`name=${st.name}`);const ut=await this.http.putFile(`/workspace/document/${et}?${lt.join("&")}`,at);if(this.http.isResponseError())throw this.http.latestResponse.statusText;return ut}async deleteFile(et){const rt=et.map(st=>st._id);if(rt.length==0)Promise.resolve(null);else if(await this.http.deleteJson("/workspace/documents",{ids:rt}),this.http.isResponseError())throw this.http.latestResponse.statusText}async acceptDocuments(et){const rt=await this.context.session().getUser();return st=>st.deleted&&st.trasher?(rt==null?void 0:rt.userId)==st.trasher:!0}async searchDocuments(et){const rt=et.filter!=="external"||et.parentId?await this.http.get("/workspace/documents",{queryParams:{...et,_:new Date().getTime()}}):[],st=await this.acceptDocuments(et);return rt.filter(st)}async listDocuments(et,rt){return this.searchDocuments({filter:et,parentId:rt,includeall:!0})}async transferDocuments(et,rt,st="protected"){const nt=[];if(et.forEach(ot=>{(st==="public"&&!ot.public||!ot.public&&!ot.protected)&&nt.push(ot)}),nt.length>0){const ot=await this.http.post("/workspace/documents/transfer",{application:rt,visibility:st,ids:nt.map(at=>at._id)});if(this.http.isResponseError())throw this.http.latestResponse.statusText;return nt.forEach((at,lt)=>{const ut=et.findIndex(ct=>ct._id===at._id);0<=ut&&ut<et.length&&(et[ut]=ot[lt])}),et.filter(at=>!!at)}return et}getThumbnailUrl(et,rt=0,st=0){var nt,ot;const at=rt>0||st>0?`${rt}x${st}`:"120x120";if(typeof et=="string")return et.includes("data:image")||et.includes("thumbnail")?et:`${et}${et.includes("?")?"&":"?"}thumbnail=${at}`;{const lt=`/workspace/${et.public?"pub/":""}document/${et._id}?thumbnail=`,ut=et.thumbnails;if((ot=(nt=et.metadata)==null?void 0:nt["content-type"])!=null&&ot.includes("video")){const ct=ut&&Object.keys(ut).length>0?Object.keys(ut)[0]:null;return ct?lt+ct:null}else return lt+at}}listFolder(et,rt=!1,st,nt){const ot={filter:et,hierarchical:rt,parentId:st,directShared:nt};return this.http.get("/workspace/folders/list",{queryParams:ot})}listOwnerFolders(et,rt){return this.listFolder("owner",et,rt)}listSharedFolders(et,rt){return this.listFolder("shared",et,rt,!0)}createFolder(et,rt){const st=new FormData;return st.append("name",et),rt&&st.append("parentFolderId",rt),this.http.postFile("/workspace/folder",st)}}let ATTag;class AnalyticsService{constructor(tt){this.context=tt}get http(){return this.context.http()}get session(){return this.context.session()}async trackPageLoad(tt,et){const[rt]=await Promise.all([this.getXitiConfig(et.name.toLowerCase()),this.loadXitiScript()]);if(!rt||!ATInternet)return;let st=rt.LIBELLE_SERVICE.default||null;for(const nt in rt.LIBELLE_SERVICE)if(nt!=="default"&&tt.indexOf(nt)>=0){st=rt.LIBELLE_SERVICE[nt];break}ATTag=new ATInternet.Tracker.Tag({site:rt.STRUCT_ID}),ATTag.setProps({SERVICE:st,TYPE:rt.TYPE,OUTIL:rt.OUTIL,UAI:rt.STRUCT_UAI,PROJET:rt.PROJET,EXPLOITANT:rt.EXPLOITANT,PLATEFORME:rt.PLATFORME,PROFIL:rt.PROFILE},!0),ATTag.identifiedVisitor.set({id:rt.ID_PERSO,category:rt.PROFILE}),ATTag.page.set({name:(et==null?void 0:et.prefix)==="userbook"?"directory":et==null?void 0:et.prefix,chapter1:"",chapter2:"",chapter3:"",level2:rt.STRUCT_UAI}),ATTag.dispatch()}async getXitiConfig(tt){const[et,rt]=await Promise.all([this.http.get("/analyticsConf"),this.http.get("/xiti/config")]);if(!(et!=null&&et.type))throw ERROR_CODE.MALFORMED_DATA;return rt!=null&&rt.active&&(et.xiti=await this.getXitiTrackingParams(rt,tt)),et.xiti}async loadXitiScript(){if(typeof ATInternet>"u"){const scriptPath="/xiti/public/js/lib/smarttag_ENT.js",response=await this.http.get(scriptPath,{headers:{Accept:"application/javascript"}});if(this.http.latestResponse.status!=200)throw"Error while loading XiTi script";eval(response)}}async getXitiTrackingParams(tt,et){if(!tt.structureMap||!et)return;const rt=await this.session.getUser(),st=await this.session.getUserProfile();let nt;if(!(rt!=null&&rt.structures))return;for(const ct of rt.structures){const dt=tt.structureMap[ct];if(dt&&dt.collectiviteId&&dt.UAI){nt=dt;break}}if(!nt||!nt.active)return;const ot=await configure.Platform.apps.getPublicConf(et);if(!ot)return;const at=ot.xiti;if(!at||!at.LIBELLE_SERVICE||!nt.UAI)return;function lt(ct){let dt="";for(let ht=0;ht<ct.length;ht++)dt+=ct.charCodeAt(ht);return dt}const ut={Student:"ELEVE",Teacher:"ENSEIGNANT",Relative:"PARENT",Personnel:"ADMIN_VIE_SCOL_TECH",Guest:"AUTRE"};return{LIBELLE_SERVICE:at.LIBELLE_SERVICE,TYPE:at.OUTIL?"TIERS":"NATIF",OUTIL:at.OUTIL?at.OUTIL:"",STRUCT_ID:nt.collectiviteId,STRUCT_UAI:nt.UAI,PROJET:nt.projetId?nt.projetId:tt.ID_PROJET,EXPLOITANT:tt.ID_EXPLOITANT,PLATFORME:nt.plateformeId?nt.plateformeId:tt.ID_PLATEFORME,ID_PERSO:lt(rt.userId),PROFILE:st&&st.length>0?ut[st[0]]??"":""}}}const w$1=class X0{constructor(et){this.context=et}get http(){return this.context.http()}get conf(){return this.context.conf()}async getVideoConf(){var et;const rt=await this.conf.getPublicConf(APP$4.VIDEO);return{maxWeight:(rt==null?void 0:rt["max-videosize-mbytes"])??X0.MAX_WEIGHT,maxDuration:(rt==null?void 0:rt["max-videoduration-minutes"])??X0.MAX_DURATION,acceptVideoUploadExtensions:((et=rt==null?void 0:rt["accept-videoupload-extensions"])==null?void 0:et.map(st=>st.toUpperCase()))??[]}}async upload({data:et,appCode:rt,captation:st,duration:nt}){if(!et.file)throw new Error("Invalid video file.");if(!et.filename)throw new Error("Invalid video filename");const ot=`${et.browser.name} ${et.browser.version}`,at=new FormData;at.append("device",et.device||""),at.append("browser",ot),at.append("url",et.url),at.append("app",rt),at.append("file",et.file,et.filename),at.append("weight",""+et.file.size),at.append("captation",""+st);let lt=`/video/encode?captation=${st}`;nt&&(lt+=`&duration=${nt}`);const ut=await this.http.post(lt,at,{headers:{"Content-Type":"multipart/form-data"}});if(ut.state=="running"){let ct=0,dt=1;do{const ht=dt+ct;await new Promise(xt=>setTimeout(xt,ht*1e3)),ct=dt,dt=Math.min(8,ht);const ft=await this.http.get(`/video/status/${ut.processid}`);if(ft.state=="succeed")return ft.videoworkspaceid&&ft.videosize&&this.context.data().trackVideoSave(ft.videoworkspaceid,Math.round(nt),ft.videosize,st,et.url,ot,et.device),ft;if(ft.state=="error")break}while(!0)}throw new Error("Video cannot be uploaded.")}};n$2(w$1,"MAX_WEIGHT",50),n$2(w$1,"MAX_DURATION",3);let VideoService=w$1;class EmbedderService{constructor(et){this.context=et}get http(){return this.context.http()}async getDefault(){return this.http.get("/infra/embed/default")}async getCustom(){return this.http.get("/infra/embed/custom")}getProviderFromUrl(et,rt){for(const st of et)if(this.isUrlFromProvider(rt,st))return st}urlIsFromPattern(et,rt){const st=new RegExp("[^{}]+(?=(?:[^{}]*{[^}]*})*[^}]*$)","g"),nt=new RegExp("{[^}]*}","g");let ot=!0;const at=rt.match(st)||[],lt=[];return(rt.match(nt)||[]).forEach((ut,ct)=>{ut.includes("ignore")||lt.push(at[ct])}),lt.forEach(ut=>{if(!et.includes(ut)){ot=!1;return}}),ot}isUrlFromProvider(et,rt){typeof rt.url=="string"&&(rt.url=[rt.url]);for(const st of rt.url)if(this.urlIsFromPattern(et,st))return!0;return!1}getEmbedCodeForProvider(et,rt){for(const st of et.url)if(this.urlIsFromPattern(rt,st)){const nt=new RegExp("{[a-zA-Z0-9_.]+}","g"),ot=st.match(nt)||[];let at=et.embed;for(const lt of ot){let ut=st.split(lt)[0];const ct=ut.split("}");ct.length>1&&(ut=ct[ct.length-1]);let dt=rt.split(ut)[1];if(!dt)continue;const ht=st.split(lt)[1].split("{")[0];ht&&(dt=dt.split(ht)[0]);const ft=new RegExp("\\"+lt.replace(/}/,"\\}"),"g");at=at.replace(ft,dt)}return at}return""}}class AbstractBehaviourService{constructor(et){n$2(this,"_cache"),this.context=et,this._cache=new CacheService(this.context)}getApplication(){return this.APP}getResourceType(){return this.RESOURCE}httpGet(et,rt){return this._cache.httpGetJson(et,rt)}dataToResource({modified:et,...rt}){const st=typeof et=="string"?et:et!=null&&et.$date?""+et.$date:"";return{application:this.RESOURCE,name:rt.title,creatorId:rt.owner,creatorName:rt.ownerName,thumbnail:rt.icon,assetId:rt._id,modifiedAt:st,shared:rt.shared,path:rt.path}}}class ActualitesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","actualites"),n$2(this,"RESOURCE","actualites")}async loadResources(){return(await this.httpGet("/actualites/linker/infos")).map(et=>{let rt;return et.thread_icon?rt=et.thread_icon+"?thumbnail=48x48":rt="/img/icons/glyphicons_036_file.png",this.dataToResource({title:et.title+" ["+et.thread_title+"]",ownerName:et.username,owner:et.owner,icon:rt,path:"/actualites#/view/thread/"+et.thread_id+"/info/"+et._id,_id:`${et.thread_id}#${et._id}`,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class BlogBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","blog"),n$2(this,"RESOURCE","blog")}loadResources(){return new Promise(async(et,rt)=>{try{const st=await this.httpGet("/blog/linker"),nt=[];st.forEach(ot=>{ot.thumbnail?ot.thumbnail=ot.thumbnail+"?thumbnail=48x48":ot.thumbnail="/img/illustrations/blog.svg";const at=ot.fetchPosts.map(lt=>this.dataToResource({owner:ot.author.userId,ownerName:ot.author.username,title:lt.title+" ["+ot.title+"]",_id:`${ot._id}#${lt._id}`,icon:ot.thumbnail,path:`/blog/id/${ot._id}/post/${lt._id}`,shared:!!(ot.shared&&ot.shared.length>=0),modified:ot.modified}));nt.push(...at)}),et(nt)}catch(st){rt(st)}})}}class CollaborativewallBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","collaborativewall"),n$2(this,"RESOURCE","collaborativewall")}async loadResources(){return(await this.httpGet("/collaborativewall/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.icon?et.icon:"/img/illustrations/collaborative-wall-default.png",path:"/collaborativewall#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class CommunityBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","community"),n$2(this,"RESOURCE","community")}async loadResources(){return(await this.httpGet("/community/listallpages")).map(et=>{let rt;return typeof et.thumbnail>"u"||et.thumbnail===""?rt="/img/icons/glyphicons_036_file.png":rt=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:et.name,icon:rt,path:"/community#/view/"+et.id,_id:et.id,owner:"",ownerName:"",shared:!!(et.shared&&et.shared.length>=0),modified:et.name})})}}class ExercizerBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","exercizer"),n$2(this,"RESOURCE","exercizer")}async loadResources(){return(await this.httpGet("/exercizer/subjects-scheduled")).map(et=>{const rt=et.picture?et.picture+"?thumbnail=48x48":"/img/illustrations/exercizer.svg";let st,nt=!1;const ot=JSON.parse(et.scheduled_at);return ot.groupList.length>0?(nt=!0,st=ot.groupList[0].name):ot.userList.length>0?(nt=!0,st=ot.userList[0].name):st="",ot.groupList.length+ot.userList.length>1&&(st+="..."),this.dataToResource({title:et.title,owner:et.owner,ownerName:st,icon:rt,path:"/exercizer#/linker/"+et.id,_id:""+et.id,shared:nt,modified:et.modified})})}}class FormulaireBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","formulaire"),n$2(this,"RESOURCE","formulaire")}async loadResources(){return(await this.httpGet("/formulaire/forms/linker")).map(et=>(et.picture||(et.picture="/formulaire/public/img/logo.svg"),this.dataToResource({_id:""+et.id,icon:et.picture,title:et.title,ownerName:et.owner_name,owner:et.owner_id,path:et.is_public?`${window.location.origin}/formulaire-public#/form/${et.public_key}`:`${window.location.origin}/formulaire#/form/${et.id}/${et.rgpd?"rgpd":"new"}`,shared:!!(et.shared&&et.shared.length>=0),modified:""+et.date_modification})))}}class ForumBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","forum"),n$2(this,"RESOURCE","forum")}async loadResources(){return(await this.httpGet("/forum/categories")).map(et=>this.dataToResource({_id:et._id,title:et.name,icon:et.icon||"/img/illustrations/forum.svg",path:"/forum#/view/"+et._id,ownerName:et.owner.displayName,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class HomeworksBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","homeworks"),n$2(this,"RESOURCE","homeworks")}async loadResources(){return(await this.httpGet("/homeworks/list")).filter(et=>et.owner&&et.trashed===0).map(et=>this.dataToResource({title:et.title,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/homeworks.svg",path:"/homeworks#/view-homeworks/"+et._id,_id:""+et._id,shared:typeof et.shared<"u",modified:et.modified}))}}class MagnetoBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","magneto"),n$2(this,"RESOURCE","magneto")}async loadResources(){const{all:et}=await this.httpGet("/magneto/boards/editable");return et.map(rt=>this.dataToResource({_id:rt._id,title:rt.title,icon:rt.imageUrl,owner:rt.ownerId,ownerName:rt.ownerName,path:`/magneto#/board/${rt._id}/view`,shared:!!(rt.shared&&rt.shared.length>=0),modified:""+rt.modificationDate}))}}class MindmapBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","mindmap"),n$2(this,"RESOURCE","mindmap")}async loadResources(){return(await this.httpGet("/mindmap/list/all")).map(et=>this.dataToResource({title:et.name,ownerName:et.owner.displayName,owner:et.owner.userId,icon:et.thumbnail||"/img/illustrations/mindmap-default.png",path:"/mindmap#/view/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified}))}}class PagesBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","pages"),n$2(this,"RESOURCE","pages")}async loadResources(){const et=await this.httpGet("/pages/list/all"),rt=[];return et.forEach(st=>{var nt;const ot=st.thumbnail?st.thumbnail+"?thumbnail=48x48":"/img/illustrations/pages.svg";rt.push(this.dataToResource({title:st.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id,_id:st._id,shared:typeof st.shared<"u",modified:st.modified})),(nt=st.pages)==null||nt.forEach(at=>{rt.push(this.dataToResource({title:at.title,owner:st.owner.userId,ownerName:st.owner.displayName,icon:ot,path:"/pages#/website/"+st._id+"/"+at.titleLink,_id:st._id+"/"+at.titleLink,shared:typeof st.shared<"u",modified:st.modified}))})}),rt}}class PollBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","poll"),n$2(this,"RESOURCE","poll")}async loadResources(){return(await this.httpGet("/poll/list/all")).map(et=>{const rt=et.icon?et.icon+"?thumbnail=48x48":"/img/icons/glyphicons_036_file.png";return this.dataToResource({title:et.question,ownerName:et.owner.displayName,icon:rt,path:"/poll#/view/"+et._id,_id:et._id,owner:et.owner.userId,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class ScrapbookBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","scrapbook"),n$2(this,"RESOURCE","scrapbook")}async loadResources(){return(await this.httpGet("/scrapbook/list/all")).map(et=>{const rt=et.icon||"/img/illustrations/scrapbook.svg";return this.dataToResource({title:et.name,owner:et.owner.userId,ownerName:et.owner.displayName,icon:rt,path:"/scrapbook#/view-scrapbook/"+et._id,_id:et._id,shared:!!(et.shared&&et.shared.length>=0),modified:et.modified})})}}class TimelinegeneratorBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","timelinegenerator"),n$2(this,"RESOURCE","timelinegenerator")}loadResources(){return new Promise(async(et,rt)=>{try{const st=(await this.httpGet("/timelinegenerator/timelines")).map(nt=>{const ot=nt.icon||"/img/illustrations/timeline-default.png";return this.dataToResource({title:nt.headline,ownerName:nt.owner.displayName,owner:nt.owner.userId,icon:ot,path:"/timelinegenerator#/view/"+nt._id,_id:nt._id,shared:typeof nt.shared<"u",modified:nt.modified})});et(st)}catch(st){rt(st)}})}}class WikiBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","wiki"),n$2(this,"RESOURCE","wiki")}async loadResources(){return(await this.httpGet("/wiki/listallpages?visible=true")).map(et=>et.pages.map(rt=>{let st;return typeof et.thumbnail>"u"||et.thumbnail===""?st="/img/icons/glyphicons_036_file.png":st=et.thumbnail+"?thumbnail=48x48",this.dataToResource({title:rt.title+" ["+et.title+"]",ownerName:et.owner.displayName,owner:et.owner.userId,icon:st,path:"/wiki#/view/"+et._id+"/"+rt._id,_id:`${et._id}#${rt._id}`,shared:typeof et.shared<"u",modified:rt.modified})})).flat()}}class WorkspaceBehaviour extends AbstractBehaviourService{constructor(){super(...arguments),n$2(this,"APP","workspace"),n$2(this,"RESOURCE","workspace")}loadResources({search:et,asset_id:rt}){return new Promise(async(st,nt)=>{try{let ot="/workspace/documents?filter=all&hierarchical=true";rt&&rt.length?ot+=`&search=${et}`:et&&et.length&&(ot+=`&search=${et}`);const at=(await this.httpGet(ot)).filter(lt=>!lt.deleted).map(lt=>{const ut=lt.metadata["content-type"]&<.metadata["content-type"].indexOf("image")!==-1?`/workspace/document/${lt._id}?thumbnail=120x120`:"/img/icons/unknown-large.png";return this.dataToResource({title:lt.name,ownerName:lt.ownerName,owner:lt.owner,icon:ut,path:`/workspace/document/${lt._id}`,_id:lt._id,shared:!!(lt.shared&<.shared.length>=0),modified:lt.modified})});st(at)}catch(ot){nt(ot)}})}}const y$2=class{static async initialize(et,rt){const st=et.http();if(!this.resourceProducingApps.length){this.resourceProducingApps=[rt,"workspace"];try{const[nt,ot]=await Promise.all([st.get("/resources-applications"),et.session().getUser()]);ot!=null&&ot.apps&&nt!=null&&nt.length&&(this.resourceProducingApps=nt.filter(at=>ot.apps.some(lt=>lt.address.includes(at))))}catch(nt){console.warn("Failed to load resource-producing apps:",nt)}}return this.resourceProducingApps}static async registerBehaviours(et){this.resourceProducingApps.forEach(rt=>{const st={application:et,resourceType:rt};this.registry.register(st,nt=>this.serviceFor(nt,et,rt))})}static serviceFor(et,rt,st){let nt;switch(st){case"timelinegenerator":nt=new TimelinegeneratorBehaviour(et);break;case"workspace":nt=new WorkspaceBehaviour(et);break;case"blog":nt=new BlogBehaviour(et);break;case"actualites":nt=new ActualitesBehaviour(et);break;case"wiki":nt=new WikiBehaviour(et);break;case"pages":nt=new PagesBehaviour(et);break;case"poll":nt=new PollBehaviour(et);break;case"community":nt=new CommunityBehaviour(et);break;case"mindmap":nt=new MindmapBehaviour(et);break;case"forum":nt=new ForumBehaviour(et);break;case"homeworks":nt=new HomeworksBehaviour(et);break;case"scrapbook":nt=new ScrapbookBehaviour(et);break;case"collaborativewall":nt=new CollaborativewallBehaviour(et);break;case"exercizer":nt=new ExercizerBehaviour(et);break;case"formulaire":nt=new FormulaireBehaviour(et);break;case"magneto":nt=new MagnetoBehaviour(et);break;default:throw ERROR_CODE.NOT_SUPPORTED}return nt.APP=rt,nt}};n$2(y$2,"registry",new ServiceRegistry),n$2(y$2,"findBehaviour",y$2.registry.findService.bind(y$2.registry)),n$2(y$2,"hasBehaviour",y$2.registry.isRegistered.bind(y$2.registry)),n$2(y$2,"resourceProducingApps",[]);let SnipletsService=y$2;const SEND_ALL="*";class WebBroker{constructor(et){n$2(this,"subscription"),this.odeServices=et}get http(){return this.odeServices.http()}get events(){return this.odeServices.notify().events()}dispatchEvent(et,rt){rt.findIndex(st=>SEND_ALL===st||et.data["event-type"]===st)>=0&&this.http.post("/infra/event/web/store",et.data,{disableNotifications:!0})}initialize(et){if(et===void 0||et.send===void 0||et.send.length>0){const rt=(et==null?void 0:et.send)??[SEND_ALL];this.subscription=this.events.subscribe(LAYER_NAME.WEB_DATA,st=>this.dispatchEvent(st,rt))}return this}destroy(){this.subscription&&(this.subscription.revoke(),delete this.subscription)}}class DataService{constructor(et){n$2(this,"_webBroker"),n$2(this,"app"),n$2(this,"user"),n$2(this,"profile"),this.odeServices=et}get conf(){return this.odeServices.conf()}get notify(){return this.odeServices.notify()}async initialize(){try{const{app:et}=await this.notify.onAppConfReady().promise;this.app=et,this.user=await this.odeServices.session().getUser(),this.profile=await this.odeServices.session().getUserProfile();const{["data-service"]:rt}=await this.conf.getPublicConf(et);this._webBroker=new WebBroker(this.odeServices).initialize(rt==null?void 0:rt.web)}catch{console.log("DataService not initialized, usage data unavailable.")}}predestroy(){this._webBroker&&(this._webBroker.destroy(),delete this._webBroker)}trackWebEvent(et){this.notify.events().publish(LAYER_NAME.WEB_DATA,{name:EVENT_NAME.DATA_TRACKED,data:et})}addUserInfos(et){return this.user&&(et.userId=this.user.userId,et.structure=this.user.structureNames[0]),this.profile&&(et.profil=this.profile[0]),et}trackVideoSave(et,rt,st,nt,ot,at,lt){const ut=this.addUserInfos({"event-type":"VIDEO_SAVE",module:"video",video_id:et,browser:at,duration:Math.round(rt),weight:st,source:nt?"CAPTURED":"UPLOADED",url:ot});this.app&&(ut["override-module"]=this.app),lt&&(ut.device_type=lt),this.trackWebEvent(ut)}trackVideoRead(et,rt,st,nt,ot){const at=this.addUserInfos({"event-type":"VIDEO_READ",module:"video",video_id:et,browser:nt,source:rt?"CAPTURED":"UPLOADED",url:st});this.app&&(at["override-module"]=this.app),ot&&(at.device_type=ot),this.trackWebEvent(at)}trackSpeechAndText(et){const rt=this.addUserInfos({"event-type":"SPEECH_AND_TEXT",function:et});this.app&&(rt.module=this.app),this.trackWebEvent(rt)}trackAccessLibraryFromExplorer(){const et=this.addUserInfos({"event-type":"ACCESS_LIBRARY_FROM_EXPLORER"});this.app&&(et.module=this.app),this.trackWebEvent(et)}}class ReactionsService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get http(){return this.context.http()}async loadAvailableReactions(){try{const{"reaction-types":et}=await this.context.conf().getPublicConf("audience");return Array.isArray(et)?et:void 0}catch{console.error("Audience configuration not found");return}}async loadReactionSummaries(et){const rt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt.reactionsByResource}async loadReactionDetails(et,rt,st){const nt=await this.http.get(`/audience/reactions/${this.module}/${this.resourceType}/${et}?page=${rt}&size=${st}`);return this.http.isResponseError()?void 0:nt}async deleteReaction(et){await this.http.delete(`/audience/reactions/${this.module}/${this.resourceType}/${et}`)}async updateReaction(et,rt){await this.http.putJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}async createReaction(et,rt){await this.http.postJson(`/audience/reactions/${this.module}/${this.resourceType}`,{resourceId:et,reactionType:rt})}}class ViewsService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get http(){return this.context.http()}async getCounters(et){const rt=await this.http.get(`/audience/views/count/${this.module}/${this.resourceType}?resourceIds=${et.join(",")}`);return this.http.isResponseError()?{}:rt}async getDetails(et){const rt=await this.http.get(`/audience/views/details/${this.module}/${this.resourceType}/${et}`);return this.http.isResponseError()?void 0:rt}trigger(et){return this.http.post(`/audience/views/${this.module}/${this.resourceType}/${et}`)}}class AudienceService{constructor(et,rt,st){this.context=et,this.module=rt,this.resourceType=st}get views(){return new ViewsService(this.context,this.module,this.resourceType)}get reactions(){return new ReactionsService(this.context,this.module,this.resourceType)}}class OdeServices{constructor(){n$2(this,"_analytics"),n$2(this,"_cache"),n$2(this,"_conf"),n$2(this,"_data"),n$2(this,"_directory"),n$2(this,"_http"),n$2(this,"_idiom"),n$2(this,"_notify"),n$2(this,"_rights"),n$2(this,"_session"),n$2(this,"_share"),n$2(this,"_video"),n$2(this,"_workspace"),n$2(this,"_embedder"),this._analytics=new AnalyticsService(this),this._cache=new CacheService(this),this._conf=new ConfService(this),this._data=new DataService(this),this._directory=new DirectoryService(this),this._http=new HttpService(this),this._idiom=new IdiomService(this),this._notify=NotifyFrameworkFactory.instance(),this._rights=new RightService(this),this._session=new SessionService(this),this._share=new ShareService(this),this._video=new VideoService(this),this._workspace=new WorkspaceService(this),this._embedder=new EmbedderService(this)}initialize(){return this._data.initialize(),this}analytics(){return this._analytics}audience(et,rt){return new AudienceService(this,et,rt)}cache(){return this._cache}conf(){return this._conf}data(){return this._data}directory(){return this._directory}http(){return this._http}idiom(){return this._idiom}notify(){return this._notify}resource(et,rt){return rt?ResourceService.findService({application:et,resourceType:rt},this):ResourceService.findMainService({application:et},this)}behaviour(et,rt){return SnipletsService.findBehaviour({application:et,resourceType:rt},this)}rights(){return this._rights}session(){return this._session}share(){return this._share}video(){return this._video}workspace(){return this._workspace}embedder(){return this._embedder}}const ACTION={OPEN:"open",MANAGE:"manage",UPD_PROPS:"properties",DELETE:"delete",RESTORE:"restore",MOVE:"move",COPY:"copy",EXPORT:"export",SHARE:"share",PRINT:"print",PUBLISH:"publish"},FOLDER={BIN:"bin",DEFAULT:"default"},SORT_ORDER={DESC:"desc"},odeServices=new OdeServices().initialize(),WIDGET_POSITION={LEFT:"left",RIGHT:"right"},isActionAvailable=(tt,et)=>{const rt=et==null?void 0:et.filter(st=>st.id===tt&&st.available);return rt&&rt.length>0},firstLevelWidgets=["birthday","mood","calendar-widget","notes"],secondLevelWidgets=["agenda-widget","carnet-de-bord","my-apps","rss-widget","bookmark-widget","cursus-widget","maxicours-widget","school-widget"],defaultWidgetPosition={"last-infos-widget":WIDGET_POSITION.LEFT,birthday:WIDGET_POSITION.LEFT,"calendar-widget":WIDGET_POSITION.RIGHT,"carnet-de-bord":WIDGET_POSITION.LEFT,"record-me":WIDGET_POSITION.RIGHT,mood:WIDGET_POSITION.LEFT,"my-apps":WIDGET_POSITION.RIGHT,notes:WIDGET_POSITION.RIGHT,"rss-widget":WIDGET_POSITION.LEFT,"bookmark-widget":WIDGET_POSITION.RIGHT,qwant:WIDGET_POSITION.RIGHT,"qwant-junior":WIDGET_POSITION.LEFT,"agenda-widget":WIDGET_POSITION.LEFT,"cursus-widget":WIDGET_POSITION.LEFT,"maxicours-widget":WIDGET_POSITION.RIGHT,"universalis-widget":WIDGET_POSITION.RIGHT,"briefme-widget":WIDGET_POSITION.LEFT,"school-widget":WIDGET_POSITION.LEFT},defaultWidgetOrder={"school-widget":0,"my-apps":10,"record-me":15,"last-infos-widget":20,qwant:30,"qwant-junior":30,"universalis-widget":35,"agenda-widget":40,"bookmark-widget":50,"carnet-de-bord":60,"maxicours-widget":70,"cursus-widget":80,"briefme-widget":90,"rss-widget":100,mood:110,birthday:120,"calendar-widget":130,notes:140};class WidgetFramework{constructor(){n$2(this,"_initialized"),n$2(this,"_widgets",[]),n$2(this,"_userPrefs",{})}initialize(et,rt){return this._initialized||(this._initialized=new Promisified,notify.onSessionReady().promise.then(st=>{var nt;st&&st.widgets?(st.widgets.forEach(ot=>{this._widgets.push(new Widget(ot))}),this.loadUserPrefs().then(()=>{var ot;(ot=this._initialized)==null||ot.resolve()}).catch(ot=>{var at;(at=this._initialized)==null||at.reject()})):(nt=this._initialized)==null||nt.reject()})),this._initialized.promise}get list(){return this._widgets}lookup(et){return this._widgets.find(rt=>rt.platformConf.name===et)}lookupDefaultPosition(et){return defaultWidgetPosition[et]}get userPrefs(){return this._userPrefs}async loadUserPrefs(){await configure.User.preferences.load("widgets",{}).then(et=>this.applyUserPrefs(et))}saveUserPrefs(){return configure.User.preferences.update("widgets",this._userPrefs).save("widgets").then(()=>{notify.events().publish(LAYER_NAME.WIDGETS,{name:EVENT_NAME.USERPREF_CHANGED})})}async applyUserPrefs(et){this._userPrefs=et??this._userPrefs;const rt=configure.Platform.theme,st=[];rt.listSkins().then(nt=>{var ot;const at=((ot=nt.find(ut=>ut.child===rt.skin))==null?void 0:ot.parent)==="panda"?secondLevelWidgets:firstLevelWidgets;this._widgets=this._widgets.filter((ut,ct)=>{const dt=ut.platformConf.name;return at.indexOf(dt)!==-1?!1:(this._userPrefs[dt]||(this._userPrefs[dt]={index:defaultWidgetOrder[dt]??999,show:!0,position:ut.platformConf.position}),ut.platformConf.mandatory&&(this._userPrefs[dt].show=!0,this._userPrefs[dt].index=defaultWidgetOrder[dt]??999),ut.platformConf.i18n&&st.push(ut.platformConf.i18n),ut.applyUserPref(this._userPrefs[dt]),!0)});const lt=new Idiom;this._widgets=this._widgets.sort((ut,ct)=>{const dt=lt.translate(`timeline.settings.${ut.platformConf.name}`).toLowerCase(),ht=lt.translate(`timeline.settings.${ct.platformConf.name}`).toLowerCase();return dt<ht?-1:dt>ht?1:0})})}}class Widget{constructor(et){n$2(this,"_schoolConf",{}),n$2(this,"_userPref"),this._platformConf=et,this._userPref=null}get platformConf(){return this._platformConf}get schoolConf(){return this._schoolConf}get userPref(){return this._userPref}applyUserPref(et){this._userPref=et,this._userPref.position=this._userPref.position??widgets.lookupDefaultPosition(this._platformConf.name)??"left"}}const widgets=new WidgetFramework,SvgIconFolder=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M3.057 5.5A.057.057 0 0 0 3 5.557v13.03h18V7.875h-8.697a1 1 0 0 1-1-1c0-.759-.615-1.374-1.374-1.374zM1 5.557C1 4.42 1.92 3.5 3.057 3.5h6.872c1.515 0 2.797.999 3.223 2.374H21a2 2 0 0 1 2 2v10.714a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2z",clipRule:"evenodd"})]}),SvgIconRafterDown=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",viewBox:"0 0 24 24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M4.012 7.871a1.5 1.5 0 0 1 2.117.141L12 14.722l5.871-6.71a1.5 1.5 0 1 1 2.258 1.976l-7 8a1.5 1.5 0 0 1-2.258 0l-7-8a1.5 1.5 0 0 1 .141-2.117",clipRule:"evenodd"})]}),TreeNode=({node:tt,showIcon:et,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt,handleItemAction:ut})=>{const ct=st.has(tt.id),dt=nt==null?void 0:nt.current.has(tt.id),ht=rt===tt.id,ft=ot===tt.id,xt={action:clsx("action-container d-flex align-items-center gap-8 px-2",{"drag-focus":ft,"py-4":!tt.section}),arrow:clsx({"py-4":!tt.section,"py-8":tt.section,invisible:!Array.isArray(tt.children)||tt.children.length===0}),button:clsx("flex-fill d-flex align-items-center text-truncate gap-8",{"py-8":tt.section})},yt=tt.section?16:12,{t:vt}=useTranslation(),{setNodeRef:Et}=useDroppable({id:reactExports.useId(),data:{id:tt.id,name:tt.name,isTreeview:!0,accepts:["folder","resource"]}}),bt=Pt=>at==null?void 0:at(Pt),wt=Pt=>lt==null?void 0:lt(Pt),St=Pt=>ut==null?void 0:ut(Pt),Rt=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),at==null||at(tt.id))},Ct=Pt=>{(Pt.code==="Enter"||Pt.code==="Space")&&(Pt.preventDefault(),Pt.stopPropagation(),lt==null||lt(tt.id))},jt=Pt=>jsxRuntimeExports.jsx(Pt?SvgIconRafterDown:SvgIconRafterRight,{title:vt("foldUnfold"),width:yt,height:yt}),It=()=>{var Pt;const $t=!((Pt=nt==null?void 0:nt.current)!=null&&Pt.has(tt.id)),zt=Array.isArray(tt.children)&&tt.children.length>0;return dt||$t&&zt};return jsxRuntimeExports.jsx("li",{ref:Et,id:`treeitem-${tt.id}`,role:"treeitem","aria-selected":ht&&ht,"aria-expanded":ct&&ct,children:jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("div",{className:xt.action,children:[jsxRuntimeExports.jsx("div",{className:xt.arrow,tabIndex:0,role:"button",onClick:()=>wt(tt.id),onKeyDown:Ct,"aria-label":vt("foldUnfold"),children:It()&&jt(ct)}),jsxRuntimeExports.jsxs("div",{tabIndex:0,role:"button",className:xt.button,onClick:()=>bt(tt.id),onKeyDown:Rt,children:[tt.section&&et&&jsxRuntimeExports.jsx(SvgIconFolder,{title:vt("folder"),width:20,height:20}),jsxRuntimeExports.jsx("span",{className:"text-truncate",children:tt.name})]}),tt.section&&ut&&jsxRuntimeExports.jsx("button",{className:"tree-btn mx-8",onClick:()=>St(tt.id),children:jsxRuntimeExports.jsx(SvgIconPlus,{height:16,width:16})})]}),Array.isArray(tt.children)&&!!tt.children.length&&ct&&jsxRuntimeExports.jsx("ul",{role:"group",children:tt.children.map(Pt=>jsxRuntimeExports.jsx(TreeNode,{node:Pt,selectedNodeId:rt,expandedNodes:st,siblingsNodes:nt,draggedNodeId:ot,handleItemClick:at,handleToggleNode:lt},Pt.id))})]})},tt.id)};var __defProp=Object.defineProperty,__defNormalProp=(tt,et,rt)=>et in tt?__defProp(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,__publicField=(tt,et,rt)=>__defNormalProp(tt,typeof et!="symbol"?et+"":et,rt);function findTreeNode(tt,et){if(et(tt))return tt;if(Array.isArray(tt.children))for(const rt of tt.children){const st=findTreeNode(rt,et);if(st)return st}}function findNodeById(tt,et){if(Array.isArray(tt))for(const rt of tt){const st=findNodeById(rt,et);if(st)return st}else{if(tt.id===et)return tt;if(tt.children)for(const rt of tt.children){const st=findNodeById(rt,et);if(st)return st}}}function addNode(tt,{parentId:et,newFolder:rt}){return modifyNode(tt,st=>{var nt;if(st.id===et){const ot=[...((nt=st.folder)==null?void 0:nt.ancestors)||[]],at=arrayUnique([...ot,st.id]);return{...st,children:[...st.children||[],new TreeNodeFolderWrapper({...rt,ancestors:at})]}}else return st})}function arrayUnique(tt){return tt.filter((et,rt)=>tt.indexOf(et)===rt)}function deleteNode(tt,{folders:et}){return modifyNode(tt,rt=>{if(!et.includes(rt.id))return rt})}const findParentNode=(tt,et)=>{if(tt.children)for(const rt of tt.children){if(rt.id===et)return tt;const st=findParentNode(rt,et);if(st)return st}};function getAncestors(tt,et){var rt;const st=findNodeById(tt,et);return(rt=st==null?void 0:st.folder)!=null&&rt.ancestors?[...(st==null?void 0:st.folder.ancestors)||[],et]:et===FOLDER.BIN?[FOLDER.BIN]:[FOLDER.DEFAULT]}function modifyNode(tt,et){return doModify(tt,et)||tt}function doModify(tt,et,rt){var st;const nt=et(tt,rt);if((st=nt==null?void 0:nt.children)!=null&&st.length){const ot=[];for(const at of(nt==null?void 0:nt.children)||[]){const lt=doModify(at,et,nt);lt&&ot.push(lt)}return{...nt,children:ot}}return nt}function moveNode(tt,{destinationId:et,folders:rt}){return modifyNode(tt,(st,nt)=>{var ot,at;if(et===st.id){const lt=[...((ot=st.folder)==null?void 0:ot.ancestors)||[]],ut=arrayUnique([...lt,st.id]),ct=[...st.children||[]],dt=((at=st.children)==null?void 0:at.map(ht=>ht.id))||[];for(const ht of rt)if(!dt.includes(ht)){const ft=findNodeById(st,ht);ft&&ct.push({...ft,folder:{...ft==null?void 0:ft.folder,ancestors:ut}})}return{...st,children:ct}}else return rt.includes(st.id)&&et!==(nt==null?void 0:nt.id)?void 0:st})}const wrapTreeNode=(tt,et,rt)=>modifyNode(tt,st=>(st.id===rt&&(st.children=et==null?void 0:et.map(nt=>new TreeNodeFolderWrapper(nt))),st));function updateNode(tt,{folderId:et,newFolder:rt}){return modifyNode(tt,st=>st.id===et?new TreeNodeFolderWrapper(rt):st)}function findPathById(tt,et){let rt=[];function st(ot,at){if(ot.id===et)return rt=at.concat(ot.id),!0;if(ot.children){for(const lt of ot.children)if(st(lt,at.concat(ot.id)))return!0}return!1}function nt(ot){if(Array.isArray(ot)){for(const at of ot)if(st(at,[]))break}else st(ot,[])}return nt(tt),rt}class TreeNodeFolderWrapper{constructor(et){__publicField(this,"id"),__publicField(this,"name"),__publicField(this,"childNumber"),__publicField(this,"section",!1),__publicField(this,"children",[]),this.folder=et,this.id=et.id,this.name=et.name,this.childNumber=et.childNumber}}const useTreeView=({data:tt,ref:et,externalSelectedNodeId:rt,draggedNode:st,allExpandedNodes:nt,onTreeItemUnfold:ot,onTreeItemFold:at,onTreeItemClick:lt})=>{const[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(new Set),ft=reactExports.useRef(new Set),[xt,yt]=reactExports.useState(void 0),vt=ut??rt;function Et(Nt){var Ut;Array.isArray(Nt)?Nt.forEach(Lt=>{const kt=new Set(ft.current);Nt.filter(({id:Mt})=>Mt!==Lt.id).some(Mt=>Mt.children&&Mt.children.length>0)&&kt.add(Lt.id),Lt.children&&Lt.children.length>0&&Lt.children.forEach(Mt=>{var Bt;const Gt=(Bt=Lt.children)==null?void 0:Bt.filter(({id:Ot})=>Ot!==Mt.id);Gt!=null&&Gt.some(Ot=>Ot.children&&Ot.children.length>0)&&kt.add(Mt.id),Et(Mt)})}):(Ut=Nt.children)==null||Ut.forEach(Lt=>{var kt;const Mt=new Set(ft.current),Bt=(kt=Nt.children)==null?void 0:kt.filter(Gt=>Gt.id!==Lt.id);Bt!=null&&Bt.some(Gt=>Gt.children&&Gt.children.length>0)&&(Mt.add(Lt.id),ft.current=Mt),Et(Lt)})}const bt=Nt=>{const Ut=new Set("");tt&&Array.isArray(tt)&&Nt&&(tt.forEach(Lt=>{Ut.add(Lt.id)}),ht(Ut))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{st!=null&&st.isOver&&st.isTreeview?(st.overId&&zt(st.overId),yt(st.overId)):yt(void 0)},[st]);const wt=reactExports.useMemo(()=>({unselectAll(){ct(void 0)},select(Nt){Pt(Nt)},allExpandedNodes(){bt(nt)}}),[]);reactExports.useImperativeHandle(et,()=>wt,[wt]),reactExports.useEffect(()=>{bt(nt)},[]),reactExports.useEffect(()=>{rt&&!nt?(St(rt),ct(rt)):ct(void 0)},[rt]);const St=Nt=>{if(!findNodeById(tt,vt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ut=>ot==null?void 0:ot(Ut));return}Rt(Nt)},Rt=Nt=>{const Ut=new Set(dt),Lt=findPathById(tt,Nt),kt=Array.from(Ut);Lt.forEach(Mt=>{const Bt=kt.indexOf(Mt);Bt>-1&&kt.splice(Bt,1),kt.push(Mt)}),Ut.clear(),kt.forEach(Mt=>Ut.add(Mt)),Ut.forEach(Mt=>ot==null?void 0:ot(Mt)),ht(Ut)},Ct=Nt=>{const Ut=new Set(dt);Ut.delete(Nt),Ut.forEach(Lt=>at==null?void 0:at(Lt)),ht(Ut)},jt=Nt=>{dt.has(Nt)?Ct(Nt):Rt(Nt)},It=Nt=>{vt!==Nt&&ct(Nt)},Pt=Nt=>{It(Nt),Rt(Nt),lt==null||lt(Nt)},$t=Nt=>{jt(Nt)},zt=Nt=>{findNodeById(tt,rt)&&Rt(Nt)};return{selectedNodeId:vt,expandedNodes:dt,siblingsNodes:ft,draggedNodeId:xt,handleItemClick:Pt,handleFoldUnfold:$t}},TreeView=reactExports.forwardRef((tt,et)=>{const{data:rt,onTreeItemClick:st,onTreeItemUnfold:nt,onTreeItemFold:ot,onTreeItemAction:at,draggedNode:lt,showIcon:ut=!0,allExpandedNodes:ct=!1,selectedNodeId:dt}=tt,{selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleFoldUnfold:Et}=useTreeView({data:rt,ref:et,externalSelectedNodeId:dt,draggedNode:lt,allExpandedNodes:ct,onTreeItemClick:st,onTreeItemFold:ot,onTreeItemUnfold:nt});return jsxRuntimeExports.jsx("div",{className:"treeview",children:jsxRuntimeExports.jsx("ul",{role:"tree",className:"m-0 p-0",children:Array.isArray(rt)?rt.map(bt=>jsxRuntimeExports.jsx(TreeNode,{node:bt,showIcon:ut,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et,handleItemAction:at},bt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,showIcon:ut,draggedNodeId:yt,handleItemClick:vt,handleToggleNode:Et})})})}),VisuallyHidden=reactExports.forwardRef(({children:tt},et)=>jsxRuntimeExports.jsx("span",{className:"visually-hidden",ref:et,children:tt})),EdificeClientContext=reactExports.createContext(null);function useEdificeClient(){const tt=reactExports.useContext(EdificeClientContext);if(!tt)throw new Error("Cannot be used outside of EdificeClientProvider");return tt}function useBookmark(){var tt;const{sessionQuery:et}=useEdificeClient(),rt=new Set;return(tt=et==null?void 0:et.data)==null?void 0:tt.bookmarkedApps.filter(st=>{const nt=rt.has(st.displayName);return rt.add(st.displayName),!nt})}function useDebounce(tt,et){const[rt,st]=reactExports.useState(tt);return reactExports.useEffect(()=>{const nt=setTimeout(()=>{st(tt)},et);return()=>{clearTimeout(nt)}},[tt,et]),rt}function useHover$1(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=reactExports.useCallback(()=>{et(!0)},[]),nt=reactExports.useCallback(()=>{et(!1)},[]);return[reactExports.useCallback(at=>{var lt;((lt=rt.current)==null?void 0:lt.nodeType)===Node.ELEMENT_NODE&&(rt.current.removeEventListener("mouseenter",st),rt.current.removeEventListener("mouseleave",nt)),(at==null?void 0:at.nodeType)===Node.ELEMENT_NODE&&(at.addEventListener("mouseenter",st),at.addEventListener("mouseleave",nt)),rt.current=at},[st,nt]),tt]}function useMediaQuery(tt){const et=reactExports.useCallback(nt=>{const ot=window.matchMedia(tt);return ot.addEventListener("change",nt),()=>{ot.removeEventListener("change",nt)}},[tt]),rt=()=>window.matchMedia(tt).matches,st=()=>{throw Error("useMediaQuery is a client-only hook")};return reactExports.useSyncExternalStore(et,rt,st)}function useToggle$1(tt){const[et,rt]=reactExports.useState(()=>tt),st=reactExports.useCallback(nt=>rt(typeof nt=="boolean"?nt:ot=>!ot),[]);return[et,st]}function useBreakpoint(){return{xs:useMediaQuery("only screen and (min-width: 0)"),sm:useMediaQuery("only screen and (min-width: 375px)"),md:useMediaQuery("only screen and (min-width: 768px)"),lg:useMediaQuery("only screen and (min-width: 1024px)"),xl:useMediaQuery("only screen and (min-width: 1280px)"),xxl:useMediaQuery("only screen and (min-width: 1400px)")}}var uaParser={exports:{}};(function(tt,et){(function(rt,st){var nt="1.0.40",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",ft="model",xt="name",yt="type",vt="vendor",Et="version",bt="architecture",wt="console",St="mobile",Rt="tablet",Ct="smarttv",jt="wearable",It="embedded",Pt=500,$t="Amazon",zt="Apple",Nt="ASUS",Ut="BlackBerry",Lt="Browser",kt="Chrome",Mt="Edge",Bt="Firefox",Gt="Google",Ot="Huawei",Ht="LG",Ft="Microsoft",Yt="Motorola",Zt="Opera",Xt="Samsung",rr="Sharp",ur="Sony",cr="Xiaomi",xr="Zebra",Er="Facebook",wr="Chromium OS",Sr="Mac OS",dr=" Browser",Pr=function(hr,Tr){var br={};for(var Nr in hr)Tr[Nr]&&Tr[Nr].length%2===0?br[Nr]=Tr[Nr].concat(hr[Nr]):br[Nr]=hr[Nr];return br},Ir=function(hr){for(var Tr={},br=0;br<hr.length;br++)Tr[hr[br].toUpperCase()]=hr[br];return Tr},zr=function(hr,Tr){return typeof hr===dt?Rr(Tr).indexOf(Rr(hr))!==-1:!1},Rr=function(hr){return hr.toLowerCase()},Dr=function(hr){return typeof hr===dt?hr.replace(/[^\d\.]/g,ot).split(".")[0]:st},Qr=function(hr,Tr){if(typeof hr===dt)return hr=hr.replace(/^\s\s*/,ot),typeof Tr===ut?hr:hr.substring(0,Pt)},ns=function(hr,Tr){for(var br=0,Nr,hs,qr,Ur,kr,ms;br<Tr.length&&!kr;){var Hn=Tr[br],Zn=Tr[br+1];for(Nr=hs=0;Nr<Hn.length&&!kr&&Hn[Nr];)if(kr=Hn[Nr++].exec(hr),kr)for(qr=0;qr<Zn.length;qr++)ms=kr[++hs],Ur=Zn[qr],typeof Ur===ct&&Ur.length>0?Ur.length===2?typeof Ur[1]==lt?this[Ur[0]]=Ur[1].call(this,ms):this[Ur[0]]=Ur[1]:Ur.length===3?typeof Ur[1]===lt&&!(Ur[1].exec&&Ur[1].test)?this[Ur[0]]=ms?Ur[1].call(this,ms,Ur[2]):st:this[Ur[0]]=ms?ms.replace(Ur[1],Ur[2]):st:Ur.length===4&&(this[Ur[0]]=ms?Ur[3].call(this,ms.replace(Ur[1],Ur[2])):st):this[Ur]=ms||st;br+=2}},ds=function(hr,Tr){for(var br in Tr)if(typeof Tr[br]===ct&&Tr[br].length>0){for(var Nr=0;Nr<Tr[br].length;Nr++)if(zr(Tr[br][Nr],hr))return br===at?st:br}else if(zr(Tr[br],hr))return br===at?st:br;return Tr.hasOwnProperty("*")?Tr["*"]:hr},qt={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},er={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2","8.1":"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},sr={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[Et,[xt,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[Et,[xt,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[xt,Et],[/opios[\/ ]+([\w\.]+)/i],[Et,[xt,Zt+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,Zt+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,Zt]],[/\bb[ai]*d(?:uhd|[ub]*[aekoprswx]{5,6})[\/ ]?([\w\.]+)/i],[Et,[xt,"Baidu"]],[/\b(?:mxbrowser|mxios|myie2)\/?([-\w\.]*)\b/i],[Et,[xt,"Maxthon"]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer|sleipnir)[\/ ]?([\w\.]*)/i,/(avant|iemobile|slim(?:browser|boat|jet))[\/ ]?([\d\.]*)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|qupzilla|falkon|rekonq|puffin|brave|whale(?!.+naver)|qqbrowserlite|duckduckgo|klar|helio|(?=comodo_)?dragon)\/([-\w\.]+)/i,/(heytap|ovi|115)browser\/([\d\.]+)/i,/(weibo)__([\d\.]+)/i],[xt,Et],[/quark(?:pc)?\/([-\w\.]+)/i],[Et,[xt,"Quark"]],[/\bddg\/([\w\.]+)/i],[Et,[xt,"DuckDuckGo"]],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[Et,[xt,"UC"+Lt]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i,/micromessenger\/([\w\.]+)/i],[Et,[xt,"WeChat"]],[/konqueror\/([\w\.]+)/i],[Et,[xt,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[Et,[xt,"IE"]],[/ya(?:search)?browser\/([\w\.]+)/i],[Et,[xt,"Yandex"]],[/slbrowser\/([\w\.]+)/i],[Et,[xt,"Smart Lenovo "+Lt]],[/(avast|avg)\/([\w\.]+)/i],[[xt,/(.+)/,"$1 Secure "+Lt],Et],[/\bfocus\/([\w\.]+)/i],[Et,[xt,Bt+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,Zt+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,Zt+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+dr]],[/fxios\/([\w\.-]+)/i],[Et,[xt,Bt]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+dr],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,Xt+" Internet"]],[/metasr[\/ ]?([\d\.]+)/i],[Et,[xt,"Sogou Explorer"]],[/(sogou)mo\w+\/([\d\.]+)/i],[[xt,"Sogou Mobile"],Et],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|2345(?=browser|chrome|explorer))\w*[\/ ]?v?([\w\.]+)/i],[xt,Et],[/(lbbrowser|rekonq)/i,/\[(linkedin)app\]/i],[xt],[/ome\/([\w\.]+) \w* ?(iron) saf/i,/ome\/([\w\.]+).+qihu (360)[es]e/i],[Et,xt],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[xt,Er],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(alipay)client\/([\w\.]+)/i,/(twitter)(?:and| f.+e\/([\w\.]+))/i,/(chromium|instagram|snapchat)[\/ ]([-\w\.]+)/i],[xt,Et],[/\bgsa\/([\w\.]+) .*safari\//i],[Et,[xt,"GSA"]],[/musical_ly(?:.+app_?version\/|_)([\w\.]+)/i],[Et,[xt,"TikTok"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[Et,[xt,kt+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[xt,kt+" WebView"],Et],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[Et,[xt,"Android "+Lt]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[xt,Et],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[Et,[xt,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[Et,xt],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[xt,[Et,ds,qt]],[/(webkit|khtml)\/([\w\.]+)/i],[xt,Et],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[xt,"Netscape"],Et],[/(wolvic|librewolf)\/([\w\.]+)/i],[xt,Et],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[Et,[xt,Bt+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[bt,"amd64"]],[/(ia32(?=;))/i],[[bt,Rr]],[/((?:i[346]|x)86)[;\)]/i],[[bt,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[bt,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[bt,"armhf"]],[/windows (ce|mobile); ppc;/i],[[bt,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[bt,/ower/,ot,Rr]],[/(sun4\w)[;\)]/i],[[bt,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[bt,Rr]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[ft,[vt,Xt],[yt,Rt]],[/\b((?:s[cgp]h|gt|sm)-(?![lr])\w+|sc[g-]?[\d]+a?|galaxy nexus)/i,/samsung[- ]((?!sm-[lr])[-\w]+)/i,/sec-(sgh\w+)/i],[ft,[vt,Xt],[yt,St]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[ft,[vt,zt],[yt,St]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[ft,[vt,zt],[yt,Rt]],[/(macintosh);/i],[ft,[vt,zt]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ft,[vt,rr],[yt,St]],[/(?:honor)([-\w ]+)[;\)]/i],[ft,[vt,"Honor"],[yt,St]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[ft,[vt,Ot],[yt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[ft,[vt,Ot],[yt,St]],[/\b(poco[\w ]+|m2\d{3}j\d\d[a-z]{2})(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/oid[^\)]+; (m?[12][0-389][01]\w{3,6}[c-y])( bui|; wv|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite|pro)?)(?: bui|\))/i],[[ft,/_/g," "],[vt,cr],[yt,St]],[/oid[^\)]+; (2\d{4}(283|rpbf)[cgl])( bui|\))/i,/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[ft,/_/g," "],[vt,cr],[yt,Rt]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ft,[vt,"OPPO"],[yt,St]],[/\b(opd2\d{3}a?) bui/i],[ft,[vt,"OPPO"],[yt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ft,[vt,"Vivo"],[yt,St]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ft,[vt,"Realme"],[yt,St]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[ft,[vt,Yt],[yt,St]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ft,[vt,Yt],[yt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ft,[vt,Ht],[yt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[ft,[vt,Ht],[yt,St]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[ft,[vt,"Lenovo"],[yt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[ft,/_/g," "],[vt,"Nokia"],[yt,St]],[/(pixel c)\b/i],[ft,[vt,Gt],[yt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[ft,[vt,Gt],[yt,St]],[/droid.+; (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[ft,[vt,ur],[yt,St]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ft,"Xperia Tablet"],[vt,ur],[yt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ft,[vt,"OnePlus"],[yt,St]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ft,[vt,$t],[yt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ft,/(.+)/g,"Fire Phone $1"],[vt,$t],[yt,St]],[/(playbook);[-\w\),; ]+(rim)/i],[ft,vt,[yt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[ft,[vt,Ut],[yt,St]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ft,[vt,Nt],[yt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ft,[vt,Nt],[yt,St]],[/(nexus 9)/i],[ft,[vt,"HTC"],[yt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[vt,[ft,/_/g," "],[yt,St]],[/droid [\w\.]+; ((?:8[14]9[16]|9(?:0(?:48|60|8[01])|1(?:3[27]|66)|2(?:6[69]|9[56])|466))[gqswx])\w*(\)| bui)/i],[ft,[vt,"TCL"],[yt,Rt]],[/(itel) ((\w+))/i],[[vt,Rr],ft,[yt,ds,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ft,[vt,"Acer"],[yt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ft,[vt,"Meizu"],[yt,St]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ft,[vt,"Ulefone"],[yt,St]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ft,[vt,"Energizer"],[yt,St]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ft,[vt,"Cat"],[yt,St]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ft,[vt,"Smartfren"],[yt,St]],[/droid.+; (a(?:015|06[35]|142p?))/i],[ft,[vt,"Nothing"],[yt,St]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (imo) ((?!tab)[\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[vt,ft,[yt,St]],[/(imo) (tab \w+)/i,/(kobo)\s(ereader|touch)/i,/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[vt,ft,[yt,Rt]],[/(surface duo)/i],[ft,[vt,Ft],[yt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ft,[vt,"Fairphone"],[yt,St]],[/(u304aa)/i],[ft,[vt,"AT&T"],[yt,St]],[/\bsie-(\w*)/i],[ft,[vt,"Siemens"],[yt,St]],[/\b(rct\w+) b/i],[ft,[vt,"RCA"],[yt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[ft,[vt,"Dell"],[yt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[ft,[vt,"Verizon"],[yt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[ft,[vt,"Barnes & Noble"],[yt,Rt]],[/\b(tm\d{3}\w+) b/i],[ft,[vt,"NuVision"],[yt,Rt]],[/\b(k88) b/i],[ft,[vt,"ZTE"],[yt,Rt]],[/\b(nx\d{3}j) b/i],[ft,[vt,"ZTE"],[yt,St]],[/\b(gen\d{3}) b.+49h/i],[ft,[vt,"Swiss"],[yt,St]],[/\b(zur\d{3}) b/i],[ft,[vt,"Swiss"],[yt,Rt]],[/\b((zeki)?tb.*\b) b/i],[ft,[vt,"Zeki"],[yt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[vt,"Dragon Touch"],ft,[yt,Rt]],[/\b(ns-?\w{0,9}) b/i],[ft,[vt,"Insignia"],[yt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[ft,[vt,"NextBook"],[yt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[vt,"Voice"],ft,[yt,St]],[/\b(lvtel\-)?(v1[12]) b/i],[[vt,"LvTel"],ft,[yt,St]],[/\b(ph-1) /i],[ft,[vt,"Essential"],[yt,St]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[ft,[vt,"Envizen"],[yt,Rt]],[/\b(trio[-\w\. ]+) b/i],[ft,[vt,"MachSpeed"],[yt,Rt]],[/\btu_(1491) b/i],[ft,[vt,"Rotor"],[yt,Rt]],[/(shield[\w ]+) b/i],[ft,[vt,"Nvidia"],[yt,Rt]],[/(sprint) (\w+)/i],[vt,ft,[yt,St]],[/(kin\.[onetw]{3})/i],[[ft,/\./g," "],[vt,Ft],[yt,St]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ft,[vt,xr],[yt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ft,[vt,xr],[yt,St]],[/smart-tv.+(samsung)/i],[vt,[yt,Ct]],[/hbbtv.+maple;(\d+)/i],[[ft,/^/,"SmartTV"],[vt,Xt],[yt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[vt,Ht],[yt,Ct]],[/(apple) ?tv/i],[vt,[ft,zt+" TV"],[yt,Ct]],[/crkey/i],[[ft,kt+"cast"],[vt,Gt],[yt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[ft,[vt,$t],[yt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ft,[vt,rr],[yt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[ft,[vt,ur],[yt,Ct]],[/(mitv-\w{5}) bui/i],[ft,[vt,cr],[yt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[vt,ft,[yt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[vt,Qr],[ft,Qr],[yt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[yt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[vt,ft,[yt,wt]],[/droid.+; (shield) bui/i],[ft,[vt,"Nvidia"],[yt,wt]],[/(playstation [345portablevi]+)/i],[ft,[vt,ur],[yt,wt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ft,[vt,Ft],[yt,wt]],[/\b(sm-[lr]\d\d[05][fnuw]?s?)\b/i],[ft,[vt,Xt],[yt,jt]],[/((pebble))app/i],[vt,ft,[yt,jt]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ft,[vt,zt],[yt,jt]],[/droid.+; (glass) \d/i],[ft,[vt,Gt],[yt,jt]],[/droid.+; (wt63?0{2,3})\)/i],[ft,[vt,xr],[yt,jt]],[/droid.+; (glass) \d/i],[ft,[vt,Gt],[yt,jt]],[/(pico) (4|neo3(?: link|pro)?)/i],[vt,ft,[yt,jt]],[/; (quest( \d| pro)?)/i],[ft,[vt,Er],[yt,jt]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[vt,[yt,It]],[/(aeobc)\b/i],[ft,[vt,$t],[yt,It]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[ft,[yt,St]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[ft,[yt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[yt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[yt,St]],[/(android[-\w\. ]{0,9});.+buil/i],[ft,[vt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,Mt+"HTML"]],[/(arkweb)\/([\w\.]+)/i],[xt,Et],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[Et,[xt,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna|servo)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i,/\b(libweb)/i],[xt,Et],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,ds,er]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,ds,er],[xt,"Windows"]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/(?:ios;fbsv\/|iphone.+ios[\/ ])([\d\.]+)/i,/cfnetwork\/.+darwin/i],[[Et,/_/g,"."],[xt,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[xt,Sr],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish|openharmony)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ut]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,Bt+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[Et,[xt,"webOS"]],[/watch(?: ?os[,\/]|\d,\d\/)([\d\.]+)/i],[Et,[xt,"watchOS"]],[/crkey\/([\d\.]+)/i],[Et,[xt,kt+"cast"]],[/(cros) [\w]+(?:\)| ([\w\.]+)\b)/i],[[xt,wr],Et],[/panasonic;(viera)/i,/(netrange)mmh/i,/(nettv)\/(\d+\.[\w\.]+)/i,/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[xt,Et],[/(sunos) ?([\w\.\d]*)/i],[[xt,"Solaris"],Et],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux|serenityos)/i,/(unix) ?([\w\.]*)/i],[xt,Et]]},yr=function(hr,Tr){if(typeof hr===ct&&(Tr=hr,hr=st),!(this instanceof yr))return new yr(hr,Tr).getResult();var br=typeof rt!==ut&&rt.navigator?rt.navigator:st,Nr=hr||(br&&br.userAgent?br.userAgent:ot),hs=br&&br.userAgentData?br.userAgentData:st,qr=Tr?Pr(sr,Tr):sr,Ur=br&&br.userAgent==Nr;return this.getBrowser=function(){var kr={};return kr[xt]=st,kr[Et]=st,ns.call(kr,Nr,qr.browser),kr[ht]=Dr(kr[Et]),Ur&&br&&br.brave&&typeof br.brave.isBrave==lt&&(kr[xt]="Brave"),kr},this.getCPU=function(){var kr={};return kr[bt]=st,ns.call(kr,Nr,qr.cpu),kr},this.getDevice=function(){var kr={};return kr[vt]=st,kr[ft]=st,kr[yt]=st,ns.call(kr,Nr,qr.device),Ur&&!kr[yt]&&hs&&hs.mobile&&(kr[yt]=St),Ur&&kr[ft]=="Macintosh"&&br&&typeof br.standalone!==ut&&br.maxTouchPoints&&br.maxTouchPoints>2&&(kr[ft]="iPad",kr[yt]=Rt),kr},this.getEngine=function(){var kr={};return kr[xt]=st,kr[Et]=st,ns.call(kr,Nr,qr.engine),kr},this.getOS=function(){var kr={};return kr[xt]=st,kr[Et]=st,ns.call(kr,Nr,qr.os),Ur&&!kr[xt]&&hs&&hs.platform&&hs.platform!="Unknown"&&(kr[xt]=hs.platform.replace(/chrome os/i,wr).replace(/macos/i,Sr)),kr},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return Nr},this.setUA=function(kr){return Nr=typeof kr===dt&&kr.length>Pt?Qr(kr,Pt):kr,this},this.setUA(Nr),this};yr.VERSION=nt,yr.BROWSER=Ir([xt,Et,ht]),yr.CPU=Ir([bt]),yr.DEVICE=Ir([ft,vt,yt,wt,St,Ct,Rt,jt,It]),yr.ENGINE=yr.OS=Ir([xt,Et]),tt.exports&&(et=tt.exports=yr),et.UAParser=yr;var mr=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(mr&&!mr.ua){var gr=new yr;mr.ua=gr.getResult(),mr.ua.get=function(){return gr.getUA()},mr.ua.set=function(hr){gr.setUA(hr);var Tr=gr.getResult();for(var br in Tr)mr.ua[br]=Tr[br]}}})(typeof window=="object"?window:commonjsGlobal)})(uaParser,uaParser.exports);var uaParserExports=uaParser.exports;const UAParser=getDefaultExportFromCjs(uaParserExports);function useBrowserInfo(tt){var et,rt,st;const nt=new UAParser(tt),ot=nt.getOS(),at=nt.getDevice(),lt=nt.getBrowser(),ut=((et=at.model)==null?void 0:et.indexOf("iPhone"))!=-1,ct=((rt=at.model)==null?void 0:rt.indexOf("iPod"))!=-1,dt=((st=at.model)==null?void 0:st.indexOf("iPad"))!=-1;return{os:ot,device:at,browser:lt,isIphone:ut,isIpod:ct,isIpad:dt}}function useHasWorkflow(tt){const[et,rt]=reactExports.useState();return reactExports.useEffect(()=>{(async()=>{let st;typeof tt=="string"?st=await odeServices.rights().sessionHasWorkflowRight(tt):st=await odeServices.rights().sessionHasWorkflowRights(tt),rt(st)})()},[tt]),et}function useCantoo(){const tt=useHasWorkflow("org.entcore.portal.controllers.PortalController|optionalFeatureCantoo");return reactExports.useEffect(()=>{tt&&!document.getElementById("cantoo-edifice-script")&&(async()=>{const et=await odeServices.http().get("/optionalFeature/cantoo");if(et&&et.scriptPath){const rt=document.createElement("script");rt.id="cantoo-edifice-script",rt.src=et.scriptPath,rt.async=!0,document.body.appendChild(rt)}})()},[tt]),null}var Subscribable=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(tt){return this.listeners.add(tt),this.onSubscribe(),()=>{this.listeners.delete(tt),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},isServer=typeof window>"u"||"Deno"in globalThis;function noop$1(){}function functionalUpdate(tt,et){return typeof tt=="function"?tt(et):tt}function isValidTimeout(tt){return typeof tt=="number"&&tt>=0&&tt!==1/0}function timeUntilStale(tt,et){return Math.max(tt+(et||0)-Date.now(),0)}function resolveStaleTime(tt,et){return typeof tt=="function"?tt(et):tt}function resolveEnabled(tt,et){return typeof tt=="function"?tt(et):tt}function matchQuery(tt,et){const{type:rt="all",exact:st,fetchStatus:nt,predicate:ot,queryKey:at,stale:lt}=tt;if(at){if(st){if(et.queryHash!==hashQueryKeyByOptions(at,et.options))return!1}else if(!partialMatchKey(et.queryKey,at))return!1}if(rt!=="all"){const ut=et.isActive();if(rt==="active"&&!ut||rt==="inactive"&&ut)return!1}return!(typeof lt=="boolean"&&et.isStale()!==lt||nt&&nt!==et.state.fetchStatus||ot&&!ot(et))}function matchMutation(tt,et){const{exact:rt,status:st,predicate:nt,mutationKey:ot}=tt;if(ot){if(!et.options.mutationKey)return!1;if(rt){if(hashKey(et.options.mutationKey)!==hashKey(ot))return!1}else if(!partialMatchKey(et.options.mutationKey,ot))return!1}return!(st&&et.state.status!==st||nt&&!nt(et))}function hashQueryKeyByOptions(tt,et){return((et==null?void 0:et.queryKeyHashFn)||hashKey)(tt)}function hashKey(tt){return JSON.stringify(tt,(et,rt)=>isPlainObject$1(rt)?Object.keys(rt).sort().reduce((st,nt)=>(st[nt]=rt[nt],st),{}):rt)}function partialMatchKey(tt,et){return tt===et?!0:typeof tt!=typeof et?!1:tt&&et&&typeof tt=="object"&&typeof et=="object"?!Object.keys(et).some(rt=>!partialMatchKey(tt[rt],et[rt])):!1}function replaceEqualDeep(tt,et){if(tt===et)return tt;const rt=isPlainArray(tt)&&isPlainArray(et);if(rt||isPlainObject$1(tt)&&isPlainObject$1(et)){const st=rt?tt:Object.keys(tt),nt=st.length,ot=rt?et:Object.keys(et),at=ot.length,lt=rt?[]:{};let ut=0;for(let ct=0;ct<at;ct++){const dt=rt?ct:ot[ct];(!rt&&st.includes(dt)||rt)&&tt[dt]===void 0&&et[dt]===void 0?(lt[dt]=void 0,ut++):(lt[dt]=replaceEqualDeep(tt[dt],et[dt]),lt[dt]===tt[dt]&&tt[dt]!==void 0&&ut++)}return nt===at&&ut===nt?tt:lt}return et}function shallowEqualObjects(tt,et){if(!et||Object.keys(tt).length!==Object.keys(et).length)return!1;for(const rt in tt)if(tt[rt]!==et[rt])return!1;return!0}function isPlainArray(tt){return Array.isArray(tt)&&tt.length===Object.keys(tt).length}function isPlainObject$1(tt){if(!hasObjectPrototype(tt))return!1;const et=tt.constructor;if(et===void 0)return!0;const rt=et.prototype;return!(!hasObjectPrototype(rt)||!rt.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(tt)!==Object.prototype)}function hasObjectPrototype(tt){return Object.prototype.toString.call(tt)==="[object Object]"}function sleep(tt){return new Promise(et=>{setTimeout(et,tt)})}function replaceData(tt,et,rt){return typeof rt.structuralSharing=="function"?rt.structuralSharing(tt,et):rt.structuralSharing!==!1?replaceEqualDeep(tt,et):et}function addToEnd(tt,et,rt=0){const st=[...tt,et];return rt&&st.length>rt?st.slice(1):st}function addToStart(tt,et,rt=0){const st=[et,...tt];return rt&&st.length>rt?st.slice(0,-1):st}var skipToken=Symbol();function ensureQueryFn(tt,et){return!tt.queryFn&&(et!=null&&et.initialPromise)?()=>et.initialPromise:!tt.queryFn||tt.queryFn===skipToken?()=>Promise.reject(new Error(`Missing queryFn: '${tt.queryHash}'`)):tt.queryFn}var xl,Bo,Yl,Wp,FocusManager=(Wp=class extends Subscribable{constructor(){super();Lr(this,xl);Lr(this,Bo);Lr(this,Yl);Cr(this,Yl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Bo)||this.setEventListener(Kt(this,Yl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Bo))==null||et.call(this),Cr(this,Bo,void 0))}setEventListener(et){var rt;Cr(this,Yl,et),(rt=Kt(this,Bo))==null||rt.call(this),Cr(this,Bo,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,xl)!==et&&(Cr(this,xl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,xl)=="boolean"?Kt(this,xl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},xl=new WeakMap,Bo=new WeakMap,Yl=new WeakMap,Wp),focusManager=new FocusManager,Kl,zo,Ql,qp,OnlineManager=(qp=class extends Subscribable{constructor(){super();Lr(this,Kl,!0);Lr(this,zo);Lr(this,Ql);Cr(this,Ql,et=>{if(!isServer&&window.addEventListener){const rt=()=>et(!0),st=()=>et(!1);return window.addEventListener("online",rt,!1),window.addEventListener("offline",st,!1),()=>{window.removeEventListener("online",rt),window.removeEventListener("offline",st)}}})}onSubscribe(){Kt(this,zo)||this.setEventListener(Kt(this,Ql))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,zo))==null||et.call(this),Cr(this,zo,void 0))}setEventListener(et){var rt;Cr(this,Ql,et),(rt=Kt(this,zo))==null||rt.call(this),Cr(this,zo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Kl)!==et&&(Cr(this,Kl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Kl)}},Kl=new WeakMap,zo=new WeakMap,Ql=new WeakMap,qp),onlineManager=new OnlineManager;function pendingThenable(){let tt,et;const rt=new Promise((nt,ot)=>{tt=nt,et=ot});rt.status="pending",rt.catch(()=>{});function st(nt){Object.assign(rt,nt),delete rt.resolve,delete rt.reject}return rt.resolve=nt=>{st({status:"fulfilled",value:nt}),tt(nt)},rt.reject=nt=>{st({status:"rejected",reason:nt}),et(nt)},rt}function defaultRetryDelay(tt){return Math.min(1e3*2**tt,3e4)}function canFetch(tt){return(tt??"online")==="online"?onlineManager.isOnline():!0}var CancelledError=class extends Error{constructor(tt){super("CancelledError"),this.revert=tt==null?void 0:tt.revert,this.silent=tt==null?void 0:tt.silent}};function isCancelledError(tt){return tt instanceof CancelledError}function createRetryer(tt){let et=!1,rt=0,st=!1,nt;const ot=pendingThenable(),at=vt=>{var Et;st||(ft(new CancelledError(vt)),(Et=tt.abort)==null||Et.call(tt))},lt=()=>{et=!0},ut=()=>{et=!1},ct=()=>focusManager.isFocused()&&(tt.networkMode==="always"||onlineManager.isOnline())&&tt.canRun(),dt=()=>canFetch(tt.networkMode)&&tt.canRun(),ht=vt=>{var Et;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,vt),nt==null||nt(),ot.resolve(vt))},ft=vt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,vt),nt==null||nt(),ot.reject(vt))},xt=()=>new Promise(vt=>{var Et;nt=bt=>{(st||ct())&&vt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var vt;nt=void 0,st||(vt=tt.onContinue)==null||vt.call(tt)}),yt=()=>{if(st)return;let vt;const Et=rt===0?tt.initialPromise:void 0;try{vt=Et??tt.fn()}catch(bt){vt=Promise.reject(bt)}Promise.resolve(vt).then(ht).catch(bt=>{var jt;if(st)return;const wt=tt.retry??(isServer?0:3),St=tt.retryDelay??defaultRetryDelay,Rt=typeof St=="function"?St(rt,bt):St,Ct=wt===!0||typeof wt=="number"&&rt<wt||typeof wt=="function"&&wt(rt,bt);if(et||!Ct){ft(bt);return}rt++,(jt=tt.onFail)==null||jt.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(bt):yt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?yt():xt().then(yt),ot)}}function createNotifyManager(){let tt=[],et=0,rt=lt=>{lt()},st=lt=>{lt()},nt=lt=>setTimeout(lt,0);const ot=lt=>{et?tt.push(lt):nt(()=>{rt(lt)})},at=()=>{const lt=tt;tt=[],lt.length&&nt(()=>{st(()=>{lt.forEach(ut=>{rt(ut)})})})};return{batch:lt=>{let ut;et++;try{ut=lt()}finally{et--,et||at()}return ut},batchCalls:lt=>(...ut)=>{ot(()=>{lt(...ut)})},schedule:ot,setNotifyFunction:lt=>{rt=lt},setBatchNotifyFunction:lt=>{st=lt},setScheduler:lt=>{nt=lt}}}var notifyManager=createNotifyManager(),yl,Xp,Removable=(Xp=class{constructor(){Lr(this,yl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Cr(this,yl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,yl)&&(clearTimeout(Kt(this,yl)),Cr(this,yl,void 0))}},yl=new WeakMap,Xp),Zl,Jl,Un,Ps,Ou,El,Qn,_o,Yp,Query=(Yp=class extends Removable{constructor(et){super();Lr(this,Qn);Lr(this,Zl);Lr(this,Jl);Lr(this,Un);Lr(this,Ps);Lr(this,Ou);Lr(this,El);Cr(this,El,!1),Cr(this,Ou,et.defaultOptions),this.setOptions(et.options),this.observers=[],Cr(this,Un,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Cr(this,Zl,getDefaultState$1(this.options)),this.state=et.state??Kt(this,Zl),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,Ps))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Ou),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,Un).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Br(this,Qn,_o).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Br(this,Qn,_o).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,Ps))==null?void 0:st.promise;return(nt=Kt(this,Ps))==null||nt.cancel(et),rt?rt.then(noop$1).catch(noop$1):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(Kt(this,Zl))}isActive(){return this.observers.some(et=>resolveEnabled(et.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===skipToken||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStale(){return this.state.isInvalidated?!0:this.getObserversCount()>0?this.observers.some(et=>et.getCurrentResult().isStale):this.state.data===void 0}isStaleByTime(et=0){return this.state.isInvalidated||this.state.data===void 0||!timeUntilStale(this.state.dataUpdatedAt,et)}onFocus(){var rt;const et=this.observers.find(st=>st.shouldFetchOnWindowFocus());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,Ps))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,Ps))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,Un).notify({type:"observerAdded",query:this,observer:et}))}removeObserver(et){this.observers.includes(et)&&(this.observers=this.observers.filter(rt=>rt!==et),this.observers.length||(Kt(this,Ps)&&(Kt(this,El)?Kt(this,Ps).cancel({revert:!0}):Kt(this,Ps).cancelRetry()),this.scheduleGc()),Kt(this,Un).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Br(this,Qn,_o).call(this,{type:"invalidate"})}fetch(et,rt){var ut,ct,dt;if(this.state.fetchStatus!=="idle"){if(this.state.data!==void 0&&(rt!=null&&rt.cancelRefetch))this.cancel({silent:!0});else if(Kt(this,Ps))return Kt(this,Ps).continueRetry(),Kt(this,Ps).promise}if(et&&this.setOptions(et),!this.options.queryFn){const ht=this.observers.find(ft=>ft.options.queryFn);ht&&this.setOptions(ht.options)}const st=new AbortController,nt=ht=>{Object.defineProperty(ht,"signal",{enumerable:!0,get:()=>(Cr(this,El,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Cr(this,El,!1),this.options.persister?this.options.persister(ht,ft,this):ht(ft)},at={fetchOptions:rt,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:ot};nt(at),(ut=this.options.behavior)==null||ut.onFetch(at,this),Cr(this,Jl,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Br(this,Qn,_o).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,yt,vt;isCancelledError(ht)&&ht.silent||Br(this,Qn,_o).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,Un).config).onError)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,Un).config).onSettled)==null||vt.call(yt,this.state.data,ht,this)),this.scheduleGc()};return Cr(this,Ps,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,xt,yt,vt;if(ht===void 0){lt(new Error(`${this.queryHash} data is undefined`));return}try{this.setData(ht)}catch(Et){lt(Et);return}(xt=(ft=Kt(this,Un).config).onSuccess)==null||xt.call(ft,ht,this),(vt=(yt=Kt(this,Un).config).onSettled)==null||vt.call(yt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Br(this,Qn,_o).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Br(this,Qn,_o).call(this,{type:"pause"})},onContinue:()=>{Br(this,Qn,_o).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,Ps).start()}},Zl=new WeakMap,Jl=new WeakMap,Un=new WeakMap,Ps=new WeakMap,Ou=new WeakMap,El=new WeakMap,Qn=new WeakSet,_o=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,fetchFailureCount:et.failureCount,fetchFailureReason:et.error};case"pause":return{...st,fetchStatus:"paused"};case"continue":return{...st,fetchStatus:"fetching"};case"fetch":return{...st,...fetchState(st.data,this.options),fetchMeta:et.meta??null};case"success":return{...st,data:et.data,dataUpdateCount:st.dataUpdateCount+1,dataUpdatedAt:et.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!et.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const nt=et.error;return isCancelledError(nt)&&nt.revert&&Kt(this,Jl)?{...Kt(this,Jl),fetchStatus:"idle"}:{...st,error:nt,errorUpdateCount:st.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:st.fetchFailureCount+1,fetchFailureReason:nt,fetchStatus:"idle",status:"error"};case"invalidate":return{...st,isInvalidated:!0};case"setState":return{...st,...et.state}}};this.state=rt(this.state),notifyManager.batch(()=>{this.observers.forEach(st=>{st.onQueryUpdate()}),Kt(this,Un).notify({query:this,type:"updated",action:et})})},Yp);function fetchState(tt,et){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:canFetch(et.networkMode)?"fetching":"paused",...tt===void 0&&{error:null,status:"pending"}}}function getDefaultState$1(tt){const et=typeof tt.initialData=="function"?tt.initialData():tt.initialData,rt=et!==void 0,st=rt?typeof tt.initialDataUpdatedAt=="function"?tt.initialDataUpdatedAt():tt.initialDataUpdatedAt:0;return{data:et,dataUpdateCount:0,dataUpdatedAt:rt?st??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:rt?"success":"pending",fetchStatus:"idle"}}var po,Kp,QueryCache=(Kp=class extends Subscribable{constructor(et={}){super();Lr(this,po);this.config=et,Cr(this,po,new Map)}build(et,rt,st){const nt=rt.queryKey,ot=rt.queryHash??hashQueryKeyByOptions(nt,rt);let at=this.get(ot);return at||(at=new Query({cache:this,queryKey:nt,queryHash:ot,options:et.defaultQueryOptions(rt),state:st,defaultOptions:et.getQueryDefaults(nt)}),this.add(at)),at}add(et){Kt(this,po).has(et.queryHash)||(Kt(this,po).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,po).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,po).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,po).get(et)}getAll(){return[...Kt(this,po).values()]}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchQuery(rt,st))}findAll(et={}){const rt=this.getAll();return Object.keys(et).length>0?rt.filter(st=>matchQuery(et,st)):rt}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}onFocus(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onFocus()})})}onOnline(){notifyManager.batch(()=>{this.getAll().forEach(et=>{et.onOnline()})})}},po=new WeakMap,Kp),mo,$s,wl,go,Fo,Qp,Mutation=(Qp=class extends Removable{constructor(et){super();Lr(this,go);Lr(this,mo);Lr(this,$s);Lr(this,wl);this.mutationId=et.mutationId,Cr(this,$s,et.mutationCache),Cr(this,mo,[]),this.state=et.state||getDefaultState(),this.setOptions(et.options),this.scheduleGc()}setOptions(et){this.options=et,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(et){Kt(this,mo).includes(et)||(Kt(this,mo).push(et),this.clearGcTimeout(),Kt(this,$s).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Cr(this,mo,Kt(this,mo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,$s).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,mo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,$s).remove(this))}continue(){var et;return((et=Kt(this,wl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,yt,vt,Et,bt,wt,St,Rt,Ct,jt,It;Cr(this,wl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Pt,$t)=>{Br(this,go,Fo).call(this,{type:"failed",failureCount:Pt,error:$t})},onPause:()=>{Br(this,go,Fo).call(this,{type:"pause"})},onContinue:()=>{Br(this,go,Fo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,$s).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,wl).canStart();try{if(!rt){Br(this,go,Fo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,$s).config).onMutate)==null?void 0:ot.call(nt,et,this));const $t=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));$t!==this.state.context&&Br(this,go,Fo).call(this,{type:"pending",context:$t,variables:et,isPaused:st})}const Pt=await Kt(this,wl).start();return await((ct=(ut=Kt(this,$s).config).onSuccess)==null?void 0:ct.call(ut,Pt,et,this.state.context,this)),await((ht=(dt=this.options).onSuccess)==null?void 0:ht.call(dt,Pt,et,this.state.context)),await((xt=(ft=Kt(this,$s).config).onSettled)==null?void 0:xt.call(ft,Pt,null,this.state.variables,this.state.context,this)),await((vt=(yt=this.options).onSettled)==null?void 0:vt.call(yt,Pt,null,et,this.state.context)),Br(this,go,Fo).call(this,{type:"success",data:Pt}),Pt}catch(Pt){try{throw await((bt=(Et=Kt(this,$s).config).onError)==null?void 0:bt.call(Et,Pt,et,this.state.context,this)),await((St=(wt=this.options).onError)==null?void 0:St.call(wt,Pt,et,this.state.context)),await((Ct=(Rt=Kt(this,$s).config).onSettled)==null?void 0:Ct.call(Rt,void 0,Pt,this.state.variables,this.state.context,this)),await((It=(jt=this.options).onSettled)==null?void 0:It.call(jt,void 0,Pt,et,this.state.context)),Pt}finally{Br(this,go,Fo).call(this,{type:"error",error:Pt})}}finally{Kt(this,$s).runNext(this)}}},mo=new WeakMap,$s=new WeakMap,wl=new WeakMap,go=new WeakSet,Fo=function(et){const rt=st=>{switch(et.type){case"failed":return{...st,failureCount:et.failureCount,failureReason:et.error};case"pause":return{...st,isPaused:!0};case"continue":return{...st,isPaused:!1};case"pending":return{...st,context:et.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:et.isPaused,status:"pending",variables:et.variables,submittedAt:Date.now()};case"success":return{...st,data:et.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...st,data:void 0,error:et.error,failureCount:st.failureCount+1,failureReason:et.error,isPaused:!1,status:"error"}}};this.state=rt(this.state),notifyManager.batch(()=>{Kt(this,mo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,$s).notify({mutation:this,type:"updated",action:et})})},Qp);function getDefaultState(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Xs,Du,Zp,MutationCache=(Zp=class extends Subscribable{constructor(et={}){super();Lr(this,Xs);Lr(this,Du);this.config=et,Cr(this,Xs,new Map),Cr(this,Du,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++R1(this,Du)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Xs).get(rt)??[];st.push(et),Kt(this,Xs).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Xs).has(rt)){const nt=(st=Kt(this,Xs).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Xs).delete(rt):Kt(this,Xs).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Xs).get(scopeFor(et)))==null?void 0:st.find(nt=>nt.state.status==="pending");return!rt||rt===et}runNext(et){var st;const rt=(st=Kt(this,Xs).get(scopeFor(et)))==null?void 0:st.find(nt=>nt!==et&&nt.state.isPaused);return(rt==null?void 0:rt.continue())??Promise.resolve()}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}getAll(){return[...Kt(this,Xs).values()].flat()}find(et){const rt={exact:!0,...et};return this.getAll().find(st=>matchMutation(rt,st))}findAll(et={}){return this.getAll().filter(rt=>matchMutation(et,rt))}notify(et){notifyManager.batch(()=>{this.listeners.forEach(rt=>{rt(et)})})}resumePausedMutations(){const et=this.getAll().filter(rt=>rt.state.isPaused);return notifyManager.batch(()=>Promise.all(et.map(rt=>rt.continue().catch(noop$1))))}},Xs=new WeakMap,Du=new WeakMap,Zp);function scopeFor(tt){var et;return((et=tt.options.scope)==null?void 0:et.id)??String(tt.mutationId)}function infiniteQueryBehavior(tt){return{onFetch:(et,rt)=>{var dt,ht,ft,xt,yt;const st=et.options,nt=(ft=(ht=(dt=et.fetchOptions)==null?void 0:dt.meta)==null?void 0:ht.fetchMore)==null?void 0:ft.direction,ot=((xt=et.state.data)==null?void 0:xt.pages)||[],at=((yt=et.state.data)==null?void 0:yt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let vt=!1;const Et=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?vt=!0:et.signal.addEventListener("abort",()=>{vt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),wt=async(St,Rt,Ct)=>{if(vt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const jt={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(jt);const It=await bt(jt),{maxPages:Pt}=et.options,$t=Ct?addToStart:addToEnd;return{pages:$t(St.pages,It,Pt),pageParams:$t(St.pageParams,Rt,Pt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},jt=Rt(st,Ct);lt=await wt(Ct,jt,St)}else{const St=tt??ot.length;do{const Rt=ut===0?at[0]??st.initialPageParam:getNextPageParam(st,lt);if(ut>0&&Rt==null)break;lt=await wt(lt,Rt),ut++}while(ut<St)}return lt};et.options.persister?et.fetchFn=()=>{var vt,Et;return(Et=(vt=et.options).persister)==null?void 0:Et.call(vt,ct,{queryKey:et.queryKey,meta:et.options.meta,signal:et.signal},rt)}:et.fetchFn=ct}}}function getNextPageParam(tt,{pages:et,pageParams:rt}){const st=et.length-1;return et.length>0?tt.getNextPageParam(et[st],et,rt[st],rt):void 0}function getPreviousPageParam(tt,{pages:et,pageParams:rt}){var st;return et.length>0?(st=tt.getPreviousPageParam)==null?void 0:st.call(tt,et[0],et,rt[0],rt):void 0}function hasNextPage(tt,et){return et?getNextPageParam(tt,et)!=null:!1}function hasPreviousPage(tt,et){return!et||!tt.getPreviousPageParam?!1:getPreviousPageParam(tt,et)!=null}var ls,Uo,Ho,eu,tu,Vo,ru,su,Jp,QueryClient=(Jp=class{constructor(tt={}){Lr(this,ls);Lr(this,Uo);Lr(this,Ho);Lr(this,eu);Lr(this,tu);Lr(this,Vo);Lr(this,ru);Lr(this,su);Cr(this,ls,tt.queryCache||new QueryCache),Cr(this,Uo,tt.mutationCache||new MutationCache),Cr(this,Ho,tt.defaultOptions||{}),Cr(this,eu,new Map),Cr(this,tu,new Map),Cr(this,Vo,0)}mount(){R1(this,Vo)._++,Kt(this,Vo)===1&&(Cr(this,ru,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,ls).onFocus())})),Cr(this,su,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,ls).onOnline())})))}unmount(){var tt,et;R1(this,Vo)._--,Kt(this,Vo)===0&&((tt=Kt(this,ru))==null||tt.call(this),Cr(this,ru,void 0),(et=Kt(this,su))==null||et.call(this),Cr(this,su,void 0))}isFetching(tt){return Kt(this,ls).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Uo).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,ls).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,ls).build(this,et),st=rt.state.data;return st===void 0?this.fetchQuery(tt):(tt.revalidateIfStale&&rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))&&this.prefetchQuery(et),Promise.resolve(st))}getQueriesData(tt){return Kt(this,ls).findAll(tt).map(({queryKey:et,state:rt})=>{const st=rt.data;return[et,st]})}setQueryData(tt,et,rt){const st=this.defaultQueryOptions({queryKey:tt}),nt=Kt(this,ls).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,ls).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,ls).findAll(tt).map(({queryKey:st})=>[st,this.setQueryData(st,et,rt)]))}getQueryState(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,ls).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,ls);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,ls),st={type:"active",...tt};return notifyManager.batch(()=>(rt.findAll(tt).forEach(nt=>{nt.reset()}),this.refetchQueries(st,et)))}cancelQueries(tt,et={}){const rt={revert:!0,...et},st=notifyManager.batch(()=>Kt(this,ls).findAll(tt).map(nt=>nt.cancel(rt)));return Promise.all(st).then(noop$1).catch(noop$1)}invalidateQueries(tt,et={}){return notifyManager.batch(()=>{if(Kt(this,ls).findAll(tt).forEach(st=>{st.invalidate()}),(tt==null?void 0:tt.refetchType)==="none")return Promise.resolve();const rt={...tt,type:(tt==null?void 0:tt.refetchType)??(tt==null?void 0:tt.type)??"active"};return this.refetchQueries(rt,et)})}refetchQueries(tt,et={}){const rt={...et,cancelRefetch:et.cancelRefetch??!0},st=notifyManager.batch(()=>Kt(this,ls).findAll(tt).filter(nt=>!nt.isDisabled()).map(nt=>{let ot=nt.fetch(void 0,rt);return rt.throwOnError||(ot=ot.catch(noop$1)),nt.state.fetchStatus==="paused"?Promise.resolve():ot}));return Promise.all(st).then(noop$1)}fetchQuery(tt){const et=this.defaultQueryOptions(tt);et.retry===void 0&&(et.retry=!1);const rt=Kt(this,ls).build(this,et);return rt.isStaleByTime(resolveStaleTime(et.staleTime,rt))?rt.fetch(et):Promise.resolve(rt.state.data)}prefetchQuery(tt){return this.fetchQuery(tt).then(noop$1).catch(noop$1)}fetchInfiniteQuery(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.fetchQuery(tt)}prefetchInfiniteQuery(tt){return this.fetchInfiniteQuery(tt).then(noop$1).catch(noop$1)}ensureInfiniteQueryData(tt){return tt.behavior=infiniteQueryBehavior(tt.pages),this.ensureQueryData(tt)}resumePausedMutations(){return onlineManager.isOnline()?Kt(this,Uo).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,ls)}getMutationCache(){return Kt(this,Uo)}getDefaultOptions(){return Kt(this,Ho)}setDefaultOptions(tt){Cr(this,Ho,tt)}setQueryDefaults(tt,et){Kt(this,eu).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,eu).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,tu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,tu).values()];let rt={};return et.forEach(st=>{partialMatchKey(tt,st.mutationKey)&&(rt={...rt,...st.defaultOptions})}),rt}defaultQueryOptions(tt){if(tt._defaulted)return tt;const et={...Kt(this,Ho).queries,...this.getQueryDefaults(tt.queryKey),...tt,_defaulted:!0};return et.queryHash||(et.queryHash=hashQueryKeyByOptions(et.queryKey,et)),et.refetchOnReconnect===void 0&&(et.refetchOnReconnect=et.networkMode!=="always"),et.throwOnError===void 0&&(et.throwOnError=!!et.suspense),!et.networkMode&&et.persister&&(et.networkMode="offlineFirst"),et.queryFn===skipToken&&(et.enabled=!1),et}defaultMutationOptions(tt){return tt!=null&&tt._defaulted?tt:{...Kt(this,Ho).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,ls).clear(),Kt(this,Uo).clear()}},ls=new WeakMap,Uo=new WeakMap,Ho=new WeakMap,eu=new WeakMap,tu=new WeakMap,Vo=new WeakMap,ru=new WeakMap,su=new WeakMap,Jp),Bs,Vr,ku,Os,Sl,nu,Go,xo,Lu,iu,ou,_l,Rl,Wo,au,Kr,Au,Y0,K0,Q0,Z0,J0,_d,_h,nm,em,QueryObserver=(em=class extends Subscribable{constructor(et,rt){super();Lr(this,Kr);Lr(this,Bs);Lr(this,Vr);Lr(this,ku);Lr(this,Os);Lr(this,Sl);Lr(this,nu);Lr(this,Go);Lr(this,xo);Lr(this,Lu);Lr(this,iu);Lr(this,ou);Lr(this,_l);Lr(this,Rl);Lr(this,Wo);Lr(this,au,new Set);this.options=rt,Cr(this,Bs,et),Cr(this,xo,null),Cr(this,Go,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Go).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),this.bindMethods(),this.setOptions(rt)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Kt(this,Vr).addObserver(this),shouldFetchOnMount(Kt(this,Vr),this.options)?Br(this,Kr,Au).call(this):this.updateResult(),Br(this,Kr,Z0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Vr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Vr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Br(this,Kr,J0).call(this),Br(this,Kr,_d).call(this),Kt(this,Vr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Vr);if(this.options=Kt(this,Bs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Vr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Br(this,Kr,_h).call(this),Kt(this,Vr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Bs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Vr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Vr),nt,this.options,st)&&Br(this,Kr,Au).call(this),this.updateResult(rt),ot&&(Kt(this,Vr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Vr))!==resolveEnabled(st.enabled,Kt(this,Vr))||resolveStaleTime(this.options.staleTime,Kt(this,Vr))!==resolveStaleTime(st.staleTime,Kt(this,Vr)))&&Br(this,Kr,Y0).call(this);const at=Br(this,Kr,K0).call(this);ot&&(Kt(this,Vr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Vr))!==resolveEnabled(st.enabled,Kt(this,Vr))||at!==Kt(this,Wo))&&Br(this,Kr,Q0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Cr(this,Os,st),Cr(this,nu,this.options),Cr(this,Sl,Kt(this,Vr).state)),st}getCurrentResult(){return Kt(this,Os)}trackResult(et,rt){const st={};return Object.keys(et).forEach(nt=>{Object.defineProperty(st,nt,{configurable:!1,enumerable:!0,get:()=>(this.trackProp(nt),rt==null||rt(nt),et[nt])})}),st}trackProp(et){Kt(this,au).add(et)}getCurrentQuery(){return Kt(this,Vr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Bs).defaultQueryOptions(et),st=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Br(this,Kr,Au).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Os)))}createResult(et,rt){var Pt;const st=Kt(this,Vr),nt=this.options,ot=Kt(this,Os),at=Kt(this,Sl),lt=Kt(this,nu),ct=et!==st?et.state:Kt(this,ku),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const $t=this.hasListeners(),zt=!$t&&shouldFetchOnMount(et,rt),Nt=$t&&shouldFetchOptionally(et,st,rt,nt);(zt||Nt)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:yt,errorUpdatedAt:vt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,Lu))xt=Kt(this,iu);else try{Cr(this,Lu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Cr(this,iu,xt),Cr(this,xo,null)}catch($t){Cr(this,xo,$t)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let $t;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))$t=ot.data;else if($t=typeof rt.placeholderData=="function"?rt.placeholderData((Pt=Kt(this,ou))==null?void 0:Pt.state.data,Kt(this,ou)):rt.placeholderData,rt.select&&$t!==void 0)try{$t=rt.select($t),Cr(this,xo,null)}catch(zt){Cr(this,xo,zt)}$t!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,$t,rt),ft=!0)}Kt(this,xo)&&(yt=Kt(this,xo),xt=Kt(this,iu),vt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",wt=Et==="pending",St=Et==="error",Rt=wt&&bt,Ct=xt!==void 0,It={status:Et,fetchStatus:ht.fetchStatus,isPending:wt,isSuccess:Et==="success",isError:St,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:yt,errorUpdatedAt:vt,failureCount:ht.fetchFailureCount,failureReason:ht.fetchFailureReason,errorUpdateCount:ht.errorUpdateCount,isFetched:ht.dataUpdateCount>0||ht.errorUpdateCount>0,isFetchedAfterMount:ht.dataUpdateCount>ct.dataUpdateCount||ht.errorUpdateCount>ct.errorUpdateCount,isFetching:bt,isRefetching:bt&&!wt,isLoadingError:St&&!Ct,isPaused:ht.fetchStatus==="paused",isPlaceholderData:ft,isRefetchError:St&&Ct,isStale:isStale(et,rt),refetch:this.refetch,promise:Kt(this,Go)};if(this.options.experimental_prefetchInRender){const $t=Ut=>{It.status==="error"?Ut.reject(It.error):It.data!==void 0&&Ut.resolve(It.data)},zt=()=>{const Ut=Cr(this,Go,It.promise=pendingThenable());$t(Ut)},Nt=Kt(this,Go);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&$t(Nt);break;case"fulfilled":(It.status==="error"||It.data!==Nt.value)&&zt();break;case"rejected":(It.status!=="error"||It.error!==Nt.reason)&&zt();break}}return It}updateResult(et){const rt=Kt(this,Os),st=this.createResult(Kt(this,Vr),this.options);if(Cr(this,Sl,Kt(this,Vr).state),Cr(this,nu,this.options),Kt(this,Sl).data!==void 0&&Cr(this,ou,Kt(this,Vr)),shallowEqualObjects(st,rt))return;Cr(this,Os,st);const nt={},ot=()=>{if(!rt)return!0;const{notifyOnChangeProps:at}=this.options,lt=typeof at=="function"?at():at;if(lt==="all"||!lt&&!Kt(this,au).size)return!0;const ut=new Set(lt??Kt(this,au));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Os)).some(ct=>{const dt=ct;return Kt(this,Os)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Br(this,Kr,nm).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Br(this,Kr,Z0).call(this)}},Bs=new WeakMap,Vr=new WeakMap,ku=new WeakMap,Os=new WeakMap,Sl=new WeakMap,nu=new WeakMap,Go=new WeakMap,xo=new WeakMap,Lu=new WeakMap,iu=new WeakMap,ou=new WeakMap,_l=new WeakMap,Rl=new WeakMap,Wo=new WeakMap,au=new WeakMap,Kr=new WeakSet,Au=function(et){Br(this,Kr,_h).call(this);let rt=Kt(this,Vr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},Y0=function(){Br(this,Kr,J0).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Vr));if(isServer||Kt(this,Os).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Os).dataUpdatedAt,et)+1;Cr(this,_l,setTimeout(()=>{Kt(this,Os).isStale||this.updateResult()},st))},K0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Vr)):this.options.refetchInterval)??!1},Q0=function(et){Br(this,Kr,_d).call(this),Cr(this,Wo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Vr))===!1||!isValidTimeout(Kt(this,Wo))||Kt(this,Wo)===0)&&Cr(this,Rl,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Br(this,Kr,Au).call(this)},Kt(this,Wo)))},Z0=function(){Br(this,Kr,Y0).call(this),Br(this,Kr,Q0).call(this,Br(this,Kr,K0).call(this))},J0=function(){Kt(this,_l)&&(clearTimeout(Kt(this,_l)),Cr(this,_l,void 0))},_d=function(){Kt(this,Rl)&&(clearInterval(Kt(this,Rl)),Cr(this,Rl,void 0))},_h=function(){const et=Kt(this,Bs).getQueryCache().build(Kt(this,Bs),this.options);if(et===Kt(this,Vr))return;const rt=Kt(this,Vr);Cr(this,Vr,et),Cr(this,ku,et.state),this.hasListeners()&&(rt==null||rt.removeObserver(this),et.addObserver(this))},nm=function(et){notifyManager.batch(()=>{et.listeners&&this.listeners.forEach(rt=>{rt(Kt(this,Os))}),Kt(this,Bs).getQueryCache().notify({query:Kt(this,Vr),type:"observerResultsUpdated"})})},em);function shouldLoadOnMount(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.state.data===void 0&&!(tt.state.status==="error"&&et.retryOnMount===!1)}function shouldFetchOnMount(tt,et){return shouldLoadOnMount(tt,et)||tt.state.data!==void 0&&shouldFetchOn(tt,et,et.refetchOnMount)}function shouldFetchOn(tt,et,rt){if(resolveEnabled(et.enabled,tt)!==!1){const st=typeof rt=="function"?rt(tt):rt;return st==="always"||st!==!1&&isStale(tt,et)}return!1}function shouldFetchOptionally(tt,et,rt,st){return(tt!==et||resolveEnabled(st.enabled,tt)===!1)&&(!rt.suspense||tt.state.status!=="error")&&isStale(tt,rt)}function isStale(tt,et){return resolveEnabled(et.enabled,tt)!==!1&&tt.isStaleByTime(resolveStaleTime(et.staleTime,tt))}function shouldAssignObserverCurrentProperties(tt,et){return!shallowEqualObjects(tt.getCurrentResult(),et)}var InfiniteQueryObserver=class extends QueryObserver{constructor(tt,et){super(tt,et)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(tt,et){super.setOptions({...tt,behavior:infiniteQueryBehavior()},et)}getOptimisticResult(tt){return tt.behavior=infiniteQueryBehavior(),super.getOptimisticResult(tt)}fetchNextPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(tt){return this.fetch({...tt,meta:{fetchMore:{direction:"backward"}}})}createResult(tt,et){var yt,vt;const{state:rt}=tt,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(vt=(yt=rt.fetchMeta)==null?void 0:yt.fetchMore)==null?void 0:vt.direction,ct=at&&ut==="forward",dt=nt&&ut==="forward",ht=at&&ut==="backward",ft=nt&&ut==="backward";return{...st,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:hasNextPage(et,rt.data),hasPreviousPage:hasPreviousPage(et,rt.data),isFetchNextPageError:ct,isFetchingNextPage:dt,isFetchPreviousPageError:ht,isFetchingPreviousPage:ft,isRefetchError:lt&&!ct&&!ht,isRefetching:ot&&!dt&&!ft}}},qo,Xo,zs,To,Co,T1,e2,tm,MutationObserver$1=(tm=class extends Subscribable{constructor(rt,st){super();Lr(this,Co);Lr(this,qo);Lr(this,Xo);Lr(this,zs);Lr(this,To);Cr(this,qo,rt),this.setOptions(st),this.bindMethods(),Br(this,Co,T1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(rt){var nt;const st=this.options;this.options=Kt(this,qo).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,qo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,zs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,zs))==null?void 0:nt.state.status)==="pending"&&Kt(this,zs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,zs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Br(this,Co,T1).call(this),Br(this,Co,e2).call(this,rt)}getCurrentResult(){return Kt(this,Xo)}reset(){var rt;(rt=Kt(this,zs))==null||rt.removeObserver(this),Cr(this,zs,void 0),Br(this,Co,T1).call(this),Br(this,Co,e2).call(this)}mutate(rt,st){var nt;return Cr(this,To,st),(nt=Kt(this,zs))==null||nt.removeObserver(this),Cr(this,zs,Kt(this,qo).getMutationCache().build(Kt(this,qo),this.options)),Kt(this,zs).addObserver(this),Kt(this,zs).execute(rt)}},qo=new WeakMap,Xo=new WeakMap,zs=new WeakMap,To=new WeakMap,Co=new WeakSet,T1=function(){var st;const rt=((st=Kt(this,zs))==null?void 0:st.state)??getDefaultState();Cr(this,Xo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},e2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,To)&&this.hasListeners()){const ht=Kt(this,Xo).variables,ft=Kt(this,Xo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,To)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,To)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,To)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,To)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}this.listeners.forEach(ht=>{ht(Kt(this,Xo))})})},tm),QueryClientContext=reactExports.createContext(void 0),useQueryClient=tt=>{const et=reactExports.useContext(QueryClientContext);if(!et)throw new Error("No QueryClient set, use QueryClientProvider to set one");return et},QueryClientProvider=({client:tt,children:et})=>(reactExports.useEffect(()=>(tt.mount(),()=>{tt.unmount()}),[tt]),jsxRuntimeExports.jsx(QueryClientContext.Provider,{value:tt,children:et})),IsRestoringContext=reactExports.createContext(!1),useIsRestoring=()=>reactExports.useContext(IsRestoringContext);IsRestoringContext.Provider;function createValue(){let tt=!1;return{clearReset:()=>{tt=!1},reset:()=>{tt=!0},isReset:()=>tt}}var QueryErrorResetBoundaryContext=reactExports.createContext(createValue()),useQueryErrorResetBoundary=()=>reactExports.useContext(QueryErrorResetBoundaryContext);function shouldThrowError(tt,et){return typeof tt=="function"?tt(...et):!!tt}function noop(){}var ensurePreventErrorBoundaryRetry=(tt,et)=>{(tt.suspense||tt.throwOnError||tt.experimental_prefetchInRender)&&(et.isReset()||(tt.retryOnMount=!1))},useClearResetErrorBoundary=tt=>{reactExports.useEffect(()=>{tt.clearReset()},[tt])},getHasError=({result:tt,errorResetBoundary:et,throwOnError:rt,query:st})=>tt.isError&&!et.isReset()&&!tt.isFetching&&st&&shouldThrowError(rt,[tt.error,st]),ensureSuspenseTimers=tt=>{tt.suspense&&(tt.staleTime===void 0&&(tt.staleTime=1e3),typeof tt.gcTime=="number"&&(tt.gcTime=Math.max(tt.gcTime,1e3)))},willFetch=(tt,et)=>tt.isLoading&&tt.isFetching&&!et,shouldSuspend=(tt,et)=>(tt==null?void 0:tt.suspense)&&et.isPending,fetchOptimistic=(tt,et,rt)=>et.fetchOptimistic(tt).catch(()=>{rt.clearReset()});function useBaseQuery(tt,et,rt){var dt,ht,ft,xt,yt;const st=useQueryClient(),nt=useIsRestoring(),ot=useQueryErrorResetBoundary(),at=st.defaultQueryOptions(tt);(ht=(dt=st.getDefaultOptions().queries)==null?void 0:dt._experimental_beforeQuery)==null||ht.call(dt,at),at._optimisticResults=nt?"isRestoring":"optimistic",ensureSuspenseTimers(at),ensurePreventErrorBoundaryRetry(at,ot),useClearResetErrorBoundary(ot);const lt=!st.getQueryCache().get(at.queryHash),[ut]=reactExports.useState(()=>new et(st,at)),ct=ut.getOptimisticResult(at);if(reactExports.useSyncExternalStore(reactExports.useCallback(vt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(vt));return ut.updateResult(),Et},[ut,nt]),()=>ut.getCurrentResult(),()=>ut.getCurrentResult()),reactExports.useEffect(()=>{ut.setOptions(at,{listeners:!1})},[at,ut]),shouldSuspend(at,ct))throw fetchOptimistic(at,ut,ot);if(getHasError({result:ct,errorResetBoundary:ot,throwOnError:at.throwOnError,query:st.getQueryCache().get(at.queryHash)}))throw ct.error;if((xt=(ft=st.getDefaultOptions().queries)==null?void 0:ft._experimental_afterQuery)==null||xt.call(ft,at,ct),at.experimental_prefetchInRender&&!isServer&&willFetch(ct,nt)){const vt=lt?fetchOptimistic(at,ut,ot):(yt=st.getQueryCache().get(at.queryHash))==null?void 0:yt.promise;vt==null||vt.catch(noop).finally(()=>{ut.updateResult()})}return at.notifyOnChangeProps?ct:ut.trackResult(ct)}function useQuery(tt,et){return useBaseQuery(tt,QueryObserver)}function queryOptions(tt){return tt}function useMutation(tt,et){const rt=useQueryClient(),[st]=reactExports.useState(()=>new MutationObserver$1(rt,tt));reactExports.useEffect(()=>{st.setOptions(tt)},[st,tt]);const nt=reactExports.useSyncExternalStore(reactExports.useCallback(at=>st.subscribe(notifyManager.batchCalls(at)),[st]),()=>st.getCurrentResult(),()=>st.getCurrentResult()),ot=reactExports.useCallback((at,lt)=>{st.mutate(at,lt).catch(noop)},[st]);if(nt.error&&shouldThrowError(st.options.throwOnError,[nt.error]))throw nt.error;return{...nt,mutate:ot,mutateAsync:nt.mutate}}function useInfiniteQuery(tt,et){return useBaseQuery(tt,InfiniteQueryObserver)}const useConversation=()=>{const tt=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|view"),et=useHasWorkflow("fr.openent.zimbra.controllers.ZimbraController|preauth"),[rt,st]=reactExports.useState(""),nt={unread:!0,_:new Date().getTime()},{data:ot}=useQuery({queryKey:["folder","count","inbox"],queryFn:async()=>await odeServices.http().get(tt?"/zimbra/count/INBOX":"/conversation/count/inbox",{queryParams:nt}),staleTime:5*60*1e3}),at=async()=>{const lt="/zimbra/zimbra";try{const{preference:ut}=await odeServices.http().get("/userbook/preference/zimbra"),ct=ut?JSON.parse(ut).modeExpert:!1;st(ct&&et?"/zimbra/preauth":window.location.origin+lt)}catch(ut){console.error(ut),st(window.location.origin+lt)}};return reactExports.useEffect(()=>{at()},[]),{messages:ot?ot.count:0,msgLink:rt,zimbraWorkflow:tt}};var dayjs_min={exports:{}},hasRequiredDayjs_min;function requireDayjs_min(){return hasRequiredDayjs_min||(hasRequiredDayjs_min=1,function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt=1e3,st=6e4,nt=36e5,ot="millisecond",at="second",lt="minute",ut="hour",ct="day",dt="week",ht="month",ft="quarter",xt="year",yt="date",vt="Invalid Date",Et=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,bt=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,wt={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(kt){var Mt=["th","st","nd","rd"],Bt=kt%100;return"["+kt+(Mt[(Bt-20)%10]||Mt[Bt]||Mt[0])+"]"}},St=function(kt,Mt,Bt){var Gt=String(kt);return!Gt||Gt.length>=Mt?kt:""+Array(Mt+1-Gt.length).join(Bt)+kt},Rt={s:St,z:function(kt){var Mt=-kt.utcOffset(),Bt=Math.abs(Mt),Gt=Math.floor(Bt/60),Ot=Bt%60;return(Mt<=0?"+":"-")+St(Gt,2,"0")+":"+St(Ot,2,"0")},m:function kt(Mt,Bt){if(Mt.date()<Bt.date())return-kt(Bt,Mt);var Gt=12*(Bt.year()-Mt.year())+(Bt.month()-Mt.month()),Ot=Mt.clone().add(Gt,ht),Ht=Bt-Ot<0,Ft=Mt.clone().add(Gt+(Ht?-1:1),ht);return+(-(Gt+(Bt-Ot)/(Ht?Ot-Ft:Ft-Ot))||0)},a:function(kt){return kt<0?Math.ceil(kt)||0:Math.floor(kt)},p:function(kt){return{M:ht,y:xt,w:dt,d:ct,D:yt,h:ut,m:lt,s:at,ms:ot,Q:ft}[kt]||String(kt||"").toLowerCase().replace(/s$/,"")},u:function(kt){return kt===void 0}},Ct="en",jt={};jt[Ct]=wt;var It="$isDayjsObject",Pt=function(kt){return kt instanceof Ut||!(!kt||!kt[It])},$t=function kt(Mt,Bt,Gt){var Ot;if(!Mt)return Ct;if(typeof Mt=="string"){var Ht=Mt.toLowerCase();jt[Ht]&&(Ot=Ht),Bt&&(jt[Ht]=Bt,Ot=Ht);var Ft=Mt.split("-");if(!Ot&&Ft.length>1)return kt(Ft[0])}else{var Yt=Mt.name;jt[Yt]=Mt,Ot=Yt}return!Gt&&Ot&&(Ct=Ot),Ot||!Gt&&Ct},zt=function(kt,Mt){if(Pt(kt))return kt.clone();var Bt=typeof Mt=="object"?Mt:{};return Bt.date=kt,Bt.args=arguments,new Ut(Bt)},Nt=Rt;Nt.l=$t,Nt.i=Pt,Nt.w=function(kt,Mt){return zt(kt,{locale:Mt.$L,utc:Mt.$u,x:Mt.$x,$offset:Mt.$offset})};var Ut=function(){function kt(Bt){this.$L=$t(Bt.locale,null,!0),this.parse(Bt),this.$x=this.$x||Bt.x||{},this[It]=!0}var Mt=kt.prototype;return Mt.parse=function(Bt){this.$d=function(Gt){var Ot=Gt.date,Ht=Gt.utc;if(Ot===null)return new Date(NaN);if(Nt.u(Ot))return new Date;if(Ot instanceof Date)return new Date(Ot);if(typeof Ot=="string"&&!/Z$/i.test(Ot)){var Ft=Ot.match(Et);if(Ft){var Yt=Ft[2]-1||0,Zt=(Ft[7]||"0").substring(0,3);return Ht?new Date(Date.UTC(Ft[1],Yt,Ft[3]||1,Ft[4]||0,Ft[5]||0,Ft[6]||0,Zt)):new Date(Ft[1],Yt,Ft[3]||1,Ft[4]||0,Ft[5]||0,Ft[6]||0,Zt)}}return new Date(Ot)}(Bt),this.init()},Mt.init=function(){var Bt=this.$d;this.$y=Bt.getFullYear(),this.$M=Bt.getMonth(),this.$D=Bt.getDate(),this.$W=Bt.getDay(),this.$H=Bt.getHours(),this.$m=Bt.getMinutes(),this.$s=Bt.getSeconds(),this.$ms=Bt.getMilliseconds()},Mt.$utils=function(){return Nt},Mt.isValid=function(){return this.$d.toString()!==vt},Mt.isSame=function(Bt,Gt){var Ot=zt(Bt);return this.startOf(Gt)<=Ot&&Ot<=this.endOf(Gt)},Mt.isAfter=function(Bt,Gt){return zt(Bt)<this.startOf(Gt)},Mt.isBefore=function(Bt,Gt){return this.endOf(Gt)<zt(Bt)},Mt.$g=function(Bt,Gt,Ot){return Nt.u(Bt)?this[Gt]:this.set(Ot,Bt)},Mt.unix=function(){return Math.floor(this.valueOf()/1e3)},Mt.valueOf=function(){return this.$d.getTime()},Mt.startOf=function(Bt,Gt){var Ot=this,Ht=!!Nt.u(Gt)||Gt,Ft=Nt.p(Bt),Yt=function(wr,Sr){var dr=Nt.w(Ot.$u?Date.UTC(Ot.$y,Sr,wr):new Date(Ot.$y,Sr,wr),Ot);return Ht?dr:dr.endOf(ct)},Zt=function(wr,Sr){return Nt.w(Ot.toDate()[wr].apply(Ot.toDate("s"),(Ht?[0,0,0,0]:[23,59,59,999]).slice(Sr)),Ot)},Xt=this.$W,rr=this.$M,ur=this.$D,cr="set"+(this.$u?"UTC":"");switch(Ft){case xt:return Ht?Yt(1,0):Yt(31,11);case ht:return Ht?Yt(1,rr):Yt(0,rr+1);case dt:var xr=this.$locale().weekStart||0,Er=(Xt<xr?Xt+7:Xt)-xr;return Yt(Ht?ur-Er:ur+(6-Er),rr);case ct:case yt:return Zt(cr+"Hours",0);case ut:return Zt(cr+"Minutes",1);case lt:return Zt(cr+"Seconds",2);case at:return Zt(cr+"Milliseconds",3);default:return this.clone()}},Mt.endOf=function(Bt){return this.startOf(Bt,!1)},Mt.$set=function(Bt,Gt){var Ot,Ht=Nt.p(Bt),Ft="set"+(this.$u?"UTC":""),Yt=(Ot={},Ot[ct]=Ft+"Date",Ot[yt]=Ft+"Date",Ot[ht]=Ft+"Month",Ot[xt]=Ft+"FullYear",Ot[ut]=Ft+"Hours",Ot[lt]=Ft+"Minutes",Ot[at]=Ft+"Seconds",Ot[ot]=Ft+"Milliseconds",Ot)[Ht],Zt=Ht===ct?this.$D+(Gt-this.$W):Gt;if(Ht===ht||Ht===xt){var Xt=this.clone().set(yt,1);Xt.$d[Yt](Zt),Xt.init(),this.$d=Xt.set(yt,Math.min(this.$D,Xt.daysInMonth())).$d}else Yt&&this.$d[Yt](Zt);return this.init(),this},Mt.set=function(Bt,Gt){return this.clone().$set(Bt,Gt)},Mt.get=function(Bt){return this[Nt.p(Bt)]()},Mt.add=function(Bt,Gt){var Ot,Ht=this;Bt=Number(Bt);var Ft=Nt.p(Gt),Yt=function(rr){var ur=zt(Ht);return Nt.w(ur.date(ur.date()+Math.round(rr*Bt)),Ht)};if(Ft===ht)return this.set(ht,this.$M+Bt);if(Ft===xt)return this.set(xt,this.$y+Bt);if(Ft===ct)return Yt(1);if(Ft===dt)return Yt(7);var Zt=(Ot={},Ot[lt]=st,Ot[ut]=nt,Ot[at]=rt,Ot)[Ft]||1,Xt=this.$d.getTime()+Bt*Zt;return Nt.w(Xt,this)},Mt.subtract=function(Bt,Gt){return this.add(-1*Bt,Gt)},Mt.format=function(Bt){var Gt=this,Ot=this.$locale();if(!this.isValid())return Ot.invalidDate||vt;var Ht=Bt||"YYYY-MM-DDTHH:mm:ssZ",Ft=Nt.z(this),Yt=this.$H,Zt=this.$m,Xt=this.$M,rr=Ot.weekdays,ur=Ot.months,cr=Ot.meridiem,xr=function(Sr,dr,Pr,Ir){return Sr&&(Sr[dr]||Sr(Gt,Ht))||Pr[dr].slice(0,Ir)},Er=function(Sr){return Nt.s(Yt%12||12,Sr,"0")},wr=cr||function(Sr,dr,Pr){var Ir=Sr<12?"AM":"PM";return Pr?Ir.toLowerCase():Ir};return Ht.replace(bt,function(Sr,dr){return dr||function(Pr){switch(Pr){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Nt.s(Gt.$y,4,"0");case"M":return Xt+1;case"MM":return Nt.s(Xt+1,2,"0");case"MMM":return xr(Ot.monthsShort,Xt,ur,3);case"MMMM":return xr(ur,Xt);case"D":return Gt.$D;case"DD":return Nt.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return xr(Ot.weekdaysMin,Gt.$W,rr,2);case"ddd":return xr(Ot.weekdaysShort,Gt.$W,rr,3);case"dddd":return rr[Gt.$W];case"H":return String(Yt);case"HH":return Nt.s(Yt,2,"0");case"h":return Er(1);case"hh":return Er(2);case"a":return wr(Yt,Zt,!0);case"A":return wr(Yt,Zt,!1);case"m":return String(Zt);case"mm":return Nt.s(Zt,2,"0");case"s":return String(Gt.$s);case"ss":return Nt.s(Gt.$s,2,"0");case"SSS":return Nt.s(Gt.$ms,3,"0");case"Z":return Ft}return null}(Sr)||Ft.replace(":","")})},Mt.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},Mt.diff=function(Bt,Gt,Ot){var Ht,Ft=this,Yt=Nt.p(Gt),Zt=zt(Bt),Xt=(Zt.utcOffset()-this.utcOffset())*st,rr=this-Zt,ur=function(){return Nt.m(Ft,Zt)};switch(Yt){case xt:Ht=ur()/12;break;case ht:Ht=ur();break;case ft:Ht=ur()/3;break;case dt:Ht=(rr-Xt)/6048e5;break;case ct:Ht=(rr-Xt)/864e5;break;case ut:Ht=rr/nt;break;case lt:Ht=rr/st;break;case at:Ht=rr/rt;break;default:Ht=rr}return Ot?Ht:Nt.a(Ht)},Mt.daysInMonth=function(){return this.endOf(ht).$D},Mt.$locale=function(){return jt[this.$L]},Mt.locale=function(Bt,Gt){if(!Bt)return this.$L;var Ot=this.clone(),Ht=$t(Bt,Gt,!0);return Ht&&(Ot.$L=Ht),Ot},Mt.clone=function(){return Nt.w(this.$d,this)},Mt.toDate=function(){return new Date(this.valueOf())},Mt.toJSON=function(){return this.isValid()?this.toISOString():null},Mt.toISOString=function(){return this.$d.toISOString()},Mt.toString=function(){return this.$d.toUTCString()},kt}(),Lt=Ut.prototype;return zt.prototype=Lt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",yt]].forEach(function(kt){Lt[kt[1]]=function(Mt){return this.$g(Mt,kt[0],kt[1])}}),zt.extend=function(kt,Mt){return kt.$i||(kt(Mt,Ut,zt),kt.$i=!0),zt},zt.locale=$t,zt.isDayjs=Pt,zt.unix=function(kt){return zt(1e3*kt)},zt.en=jt[Ct],zt.Ls=jt,zt.p={},zt})}(dayjs_min)),dayjs_min.exports}var dayjs_minExports=requireDayjs_min();const dayjs=getDefaultExportFromCjs(dayjs_minExports);var customParseFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},st=/(\[[^[]*\])|([-_:/.,()\s]+)|(A|a|YYYY|YY?|MM?M?M?|Do|DD?|hh?|HH?|mm?|ss?|S{1,3}|z|ZZ?)/g,nt=/\d\d/,ot=/\d\d?/,at=/\d*[^-_:/,()\s\d]+/,lt={},ut=function(vt){return(vt=+vt)+(vt>68?1900:2e3)},ct=function(vt){return function(Et){this[vt]=+Et}},dt=[/[+-]\d\d:?(\d\d)?|Z/,function(vt){(this.zone||(this.zone={})).offset=function(Et){if(!Et||Et==="Z")return 0;var bt=Et.match(/([+-]|\d\d)/g),wt=60*bt[1]+(+bt[2]||0);return wt===0?0:bt[0]==="+"?-wt:wt}(vt)}],ht=function(vt){var Et=lt[vt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},ft=function(vt,Et){var bt,wt=lt.meridiem;if(wt){for(var St=1;St<=24;St+=1)if(vt.indexOf(wt(St,0,Et))>-1){bt=St>12;break}}else bt=vt===(Et?"pm":"PM");return bt},xt={A:[at,function(vt){this.afternoon=ft(vt,!1)}],a:[at,function(vt){this.afternoon=ft(vt,!0)}],S:[/\d/,function(vt){this.milliseconds=100*+vt}],SS:[nt,function(vt){this.milliseconds=10*+vt}],SSS:[/\d{3}/,function(vt){this.milliseconds=+vt}],s:[ot,ct("seconds")],ss:[ot,ct("seconds")],m:[ot,ct("minutes")],mm:[ot,ct("minutes")],H:[ot,ct("hours")],h:[ot,ct("hours")],HH:[ot,ct("hours")],hh:[ot,ct("hours")],D:[ot,ct("day")],DD:[nt,ct("day")],Do:[at,function(vt){var Et=lt.ordinal,bt=vt.match(/\d+/);if(this.day=bt[0],Et)for(var wt=1;wt<=31;wt+=1)Et(wt).replace(/\[|\]/g,"")===vt&&(this.day=wt)}],M:[ot,ct("month")],MM:[nt,ct("month")],MMM:[at,function(vt){var Et=ht("months"),bt=(ht("monthsShort")||Et.map(function(wt){return wt.slice(0,3)})).indexOf(vt)+1;if(bt<1)throw new Error;this.month=bt%12||bt}],MMMM:[at,function(vt){var Et=ht("months").indexOf(vt)+1;if(Et<1)throw new Error;this.month=Et%12||Et}],Y:[/[+-]?\d+/,ct("year")],YY:[nt,function(vt){this.year=ut(vt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function yt(vt){var Et,bt;Et=vt,bt=lt&<.formats;for(var wt=(vt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function($t,zt,Nt){var Ut=Nt&&Nt.toUpperCase();return zt||bt[Nt]||rt[Nt]||bt[Ut].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Lt,kt,Mt){return kt||Mt.slice(1)})})).match(st),St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt],jt=xt[Ct],It=jt&&jt[0],Pt=jt&&jt[1];wt[Rt]=Pt?{regex:It,parser:Pt}:Ct.replace(/^\[|\]$/g,"")}return function($t){for(var zt={},Nt=0,Ut=0;Nt<St;Nt+=1){var Lt=wt[Nt];if(typeof Lt=="string")Ut+=Lt.length;else{var kt=Lt.regex,Mt=Lt.parser,Bt=$t.slice(Ut),Gt=kt.exec(Bt)[0];Mt.call(zt,Gt),$t=$t.replace(Gt,"")}}return function(Ot){var Ht=Ot.afternoon;if(Ht!==void 0){var Ft=Ot.hours;Ht?Ft<12&&(Ot.hours+=12):Ft===12&&(Ot.hours=0),delete Ot.afternoon}}(zt),zt}}return function(vt,Et,bt){bt.p.customParseFormat=!0,vt&&vt.parseTwoDigitYear&&(ut=vt.parseTwoDigitYear);var wt=Et.prototype,St=wt.parse;wt.parse=function(Rt){var Ct=Rt.date,jt=Rt.utc,It=Rt.args;this.$u=jt;var Pt=It[1];if(typeof Pt=="string"){var $t=It[2]===!0,zt=It[3]===!0,Nt=$t||zt,Ut=It[2];zt&&(Ut=It[2]),lt=this.$locale(),!$t&&Ut&&(lt=bt.Ls[Ut]),this.$d=function(Bt,Gt,Ot){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*Bt);var Ht=yt(Gt)(Bt),Ft=Ht.year,Yt=Ht.month,Zt=Ht.day,Xt=Ht.hours,rr=Ht.minutes,ur=Ht.seconds,cr=Ht.milliseconds,xr=Ht.zone,Er=new Date,wr=Zt||(Ft||Yt?1:Er.getDate()),Sr=Ft||Er.getFullYear(),dr=0;Ft&&!Yt||(dr=Yt>0?Yt-1:Er.getMonth());var Pr=Xt||0,Ir=rr||0,zr=ur||0,Rr=cr||0;return xr?new Date(Date.UTC(Sr,dr,wr,Pr,Ir,zr,Rr+60*xr.offset*1e3)):Ot?new Date(Date.UTC(Sr,dr,wr,Pr,Ir,zr,Rr)):new Date(Sr,dr,wr,Pr,Ir,zr,Rr)}catch{return new Date("")}}(Ct,Pt,jt),this.init(),Ut&&Ut!==!0&&(this.$L=this.locale(Ut).$L),Nt&&Ct!=this.format(Pt)&&(this.$d=new Date("")),lt={}}else if(Pt instanceof Array)for(var Lt=Pt.length,kt=1;kt<=Lt;kt+=1){It[1]=Pt[kt-1];var Mt=bt.apply(this,It);if(Mt.isValid()){this.$d=Mt.$d,this.$L=Mt.$L,this.init();break}kt===Lt&&(this.$d=new Date(""))}else St.call(this,Rt)}}})})(customParseFormat$1);var customParseFormatExports=customParseFormat$1.exports;const customParseFormat=getDefaultExportFromCjs(customParseFormatExports);var localizedFormat$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){var rt={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};return function(st,nt,ot){var at=nt.prototype,lt=at.format;ot.en.formats=rt,at.format=function(ut){ut===void 0&&(ut="YYYY-MM-DDTHH:mm:ssZ");var ct=this.$locale().formats,dt=function(ht,ft){return ht.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(xt,yt,vt){var Et=vt&&vt.toUpperCase();return yt||ft[vt]||rt[vt]||ft[Et].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(bt,wt,St){return wt||St.slice(1)})})}(ut,ct===void 0?{}:ct);return lt.call(this,dt)}}})})(localizedFormat$1);var localizedFormatExports=localizedFormat$1.exports;const localizedFormat=getDefaultExportFromCjs(localizedFormatExports);var relativeTime$1={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st()})(commonjsGlobal,function(){return function(rt,st,nt){rt=rt||{};var ot=st.prototype,at={future:"in %s",past:"%s ago",s:"a few seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function lt(ct,dt,ht,ft){return ot.fromToBase(ct,dt,ht,ft)}nt.en.relativeTime=at,ot.fromToBase=function(ct,dt,ht,ft,xt){for(var yt,vt,Et,bt=ht.$locale().relativeTime||at,wt=rt.thresholds||[{l:"s",r:44,d:"second"},{l:"m",r:89},{l:"mm",r:44,d:"minute"},{l:"h",r:89},{l:"hh",r:21,d:"hour"},{l:"d",r:35},{l:"dd",r:25,d:"day"},{l:"M",r:45},{l:"MM",r:10,d:"month"},{l:"y",r:17},{l:"yy",d:"year"}],St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt];Ct.d&&(yt=ft?nt(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var jt=(rt.rounding||Math.round)(Math.abs(yt));if(Et=yt>0,jt<=Ct.r||!Ct.r){jt<=1&&Rt>0&&(Ct=wt[Rt-1]);var It=bt[Ct.l];xt&&(jt=xt(""+jt)),vt=typeof It=="string"?It.replace("%d",jt):It(jt,dt,Ct.l,Et);break}}if(dt)return vt;var Pt=Et?bt.future:bt.past;return typeof Pt=="function"?Pt(vt):Pt.replace("%s",vt)},ot.to=function(ct,dt){return lt(ct,dt,this,!0)},ot.from=function(ct,dt){return lt(ct,dt,this)};var ut=function(ct){return ct.$u?nt.utc():nt()};ot.toNow=function(ct){return this.to(ut(this),ct)},ot.fromNow=function(ct){return this.from(ut(this),ct)}}})})(relativeTime$1);var relativeTimeExports=relativeTime$1.exports;const relativeTime=getDefaultExportFromCjs(relativeTimeExports);var de$2={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(requireDayjs_min())})(commonjsGlobal,function(rt){function st(ut){return ut&&typeof ut=="object"&&"default"in ut?ut:{default:ut}}var nt=st(rt),ot={s:"ein paar Sekunden",m:["eine Minute","einer Minute"],mm:"%d Minuten",h:["eine Stunde","einer Stunde"],hh:"%d Stunden",d:["ein Tag","einem Tag"],dd:["%d Tage","%d Tagen"],M:["ein Monat","einem Monat"],MM:["%d Monate","%d Monaten"],y:["ein Jahr","einem Jahr"],yy:["%d Jahre","%d Jahren"]};function at(ut,ct,dt){var ht=ot[dt];return Array.isArray(ht)&&(ht=ht[ct?0:1]),ht.replace("%d",ut)}var lt={name:"de",weekdays:"Sonntag_Montag_Dienstag_Mittwoch_Donnerstag_Freitag_Samstag".split("_"),weekdaysShort:"So._Mo._Di._Mi._Do._Fr._Sa.".split("_"),weekdaysMin:"So_Mo_Di_Mi_Do_Fr_Sa".split("_"),months:"Januar_Februar_März_April_Mai_Juni_Juli_August_September_Oktober_November_Dezember".split("_"),monthsShort:"Jan._Feb._März_Apr._Mai_Juni_Juli_Aug._Sept._Okt._Nov._Dez.".split("_"),ordinal:function(ut){return ut+"."},weekStart:1,yearStart:4,formats:{LTS:"HH:mm:ss",LT:"HH:mm",L:"DD.MM.YYYY",LL:"D. MMMM YYYY",LLL:"D. MMMM YYYY HH:mm",LLLL:"dddd, D. MMMM YYYY HH:mm"},relativeTime:{future:"in %s",past:"vor %s",s:at,m:at,mm:at,h:at,hh:at,d:at,dd:at,M:at,MM:at,y:at,yy:at}};return nt.default.locale(lt,null,!0),lt})})(de$2);var es={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(requireDayjs_min())})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"es",monthsShort:"ene_feb_mar_abr_may_jun_jul_ago_sep_oct_nov_dic".split("_"),weekdays:"domingo_lunes_martes_miércoles_jueves_viernes_sábado".split("_"),weekdaysShort:"dom._lun._mar._mié._jue._vie._sáb.".split("_"),weekdaysMin:"do_lu_ma_mi_ju_vi_sá".split("_"),months:"enero_febrero_marzo_abril_mayo_junio_julio_agosto_septiembre_octubre_noviembre_diciembre".split("_"),weekStart:1,formats:{LT:"H:mm",LTS:"H:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY H:mm",LLLL:"dddd, D [de] MMMM [de] YYYY H:mm"},relativeTime:{future:"en %s",past:"hace %s",s:"unos segundos",m:"un minuto",mm:"%d minutos",h:"una hora",hh:"%d horas",d:"un día",dd:"%d días",M:"un mes",MM:"%d meses",y:"un año",yy:"%d años"},ordinal:function(at){return at+"º"}};return nt.default.locale(ot,null,!0),ot})})(es);var fr={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(requireDayjs_min())})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"fr",weekdays:"dimanche_lundi_mardi_mercredi_jeudi_vendredi_samedi".split("_"),weekdaysShort:"dim._lun._mar._mer._jeu._ven._sam.".split("_"),weekdaysMin:"di_lu_ma_me_je_ve_sa".split("_"),months:"janvier_février_mars_avril_mai_juin_juillet_août_septembre_octobre_novembre_décembre".split("_"),monthsShort:"janv._févr._mars_avr._mai_juin_juil._août_sept._oct._nov._déc.".split("_"),weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"dans %s",past:"il y a %s",s:"quelques secondes",m:"une minute",mm:"%d minutes",h:"une heure",hh:"%d heures",d:"un jour",dd:"%d jours",M:"un mois",MM:"%d mois",y:"un an",yy:"%d ans"},ordinal:function(at){return""+at+(at===1?"er":"")}};return nt.default.locale(ot,null,!0),ot})})(fr);var it={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(requireDayjs_min())})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"it",weekdays:"domenica_lunedì_martedì_mercoledì_giovedì_venerdì_sabato".split("_"),weekdaysShort:"dom_lun_mar_mer_gio_ven_sab".split("_"),weekdaysMin:"do_lu_ma_me_gi_ve_sa".split("_"),months:"gennaio_febbraio_marzo_aprile_maggio_giugno_luglio_agosto_settembre_ottobre_novembre_dicembre".split("_"),weekStart:1,monthsShort:"gen_feb_mar_apr_mag_giu_lug_ago_set_ott_nov_dic".split("_"),formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D MMMM YYYY",LLL:"D MMMM YYYY HH:mm",LLLL:"dddd D MMMM YYYY HH:mm"},relativeTime:{future:"tra %s",past:"%s fa",s:"qualche secondo",m:"un minuto",mm:"%d minuti",h:"un' ora",hh:"%d ore",d:"un giorno",dd:"%d giorni",M:"un mese",MM:"%d mesi",y:"un anno",yy:"%d anni"},ordinal:function(at){return at+"º"}};return nt.default.locale(ot,null,!0),ot})})(it);var pt={exports:{}};(function(tt,et){(function(rt,st){tt.exports=st(requireDayjs_min())})(commonjsGlobal,function(rt){function st(at){return at&&typeof at=="object"&&"default"in at?at:{default:at}}var nt=st(rt),ot={name:"pt",weekdays:"domingo_segunda-feira_terça-feira_quarta-feira_quinta-feira_sexta-feira_sábado".split("_"),weekdaysShort:"dom_seg_ter_qua_qui_sex_sab".split("_"),weekdaysMin:"Do_2ª_3ª_4ª_5ª_6ª_Sa".split("_"),months:"janeiro_fevereiro_março_abril_maio_junho_julho_agosto_setembro_outubro_novembro_dezembro".split("_"),monthsShort:"jan_fev_mar_abr_mai_jun_jul_ago_set_out_nov_dez".split("_"),ordinal:function(at){return at+"º"},weekStart:1,yearStart:4,formats:{LT:"HH:mm",LTS:"HH:mm:ss",L:"DD/MM/YYYY",LL:"D [de] MMMM [de] YYYY",LLL:"D [de] MMMM [de] YYYY [às] HH:mm",LLLL:"dddd, D [de] MMMM [de] YYYY [às] HH:mm"},relativeTime:{future:"em %s",past:"há %s",s:"alguns segundos",m:"um minuto",mm:"%d minutos",h:"uma hora",hh:"%d horas",d:"um dia",dd:"%d dias",M:"um mês",MM:"%d meses",y:"um ano",yy:"%d anos"}};return nt.default.locale(ot,null,!0),ot})})(pt);dayjs.extend(relativeTime);dayjs.extend(customParseFormat);dayjs.extend(localizedFormat);function useDate(){const{currentLanguage:tt}=useEdificeClient(),{t:et}=useTranslation(),rt=reactExports.useCallback((lt,ut)=>{if(lt.length<11)return dayjs(lt,["YYYY-MM-DD"],ut);if(lt.split("").findIndex(ct=>"0">ct||ct>"9")<0)return dayjs(Number.parseInt(lt)).locale(tt);{let ct=dayjs(lt).locale(tt);return ct.isValid()||(ct=dayjs(lt,["YYYY-MM-DD HH:mm:ss.SSS"]).locale(tt)),ct}},[tt]),st=reactExports.useCallback(lt=>{let ut=dayjs();try{return typeof lt>"u"?void 0:(typeof lt=="string"?ut=rt(lt):typeof lt=="number"?ut=dayjs(lt).locale(tt):typeof lt.$date=="number"?ut=dayjs(new Date(lt.$date)).locale(tt):typeof lt.$date=="string"&&(ut=rt(lt.$date)),ut)}catch(ct){console.error(ct)}return ut},[tt,rt]),nt=reactExports.useCallback(lt=>{const ut=st(lt);if(!(ut!=null&&ut.isValid()))return"";const ct=dayjs();return ut.isSame(ct,"date")?ut.fromNow():ut.isSame(ct.subtract(1,"day"),"date")?et("date.format.yesterday"):ct.diff(ut,"days")<=7?ut.format(et("date.format.currentWeek")):ut.isSame(ct,"year")?ut.format(et("date.format.currentYear")):ut.format(et("date.format.previousYear"))},[tt,rt]),ot=reactExports.useCallback(lt=>{const ut=st(lt);return ut!=null&&ut.isValid()?ut.fromNow():""},[tt,rt]),at=reactExports.useCallback((lt,ut="short")=>{const ct=st(lt);let dt="";switch(ut){case"short":dt="L";break;case"long":dt="LL";break;case"abbr":dt="ll";break;default:dt=ut}return ct!=null&&ct.isValid()?ct.locale(tt).format(dt):""},[tt,rt]);return{fromNow:ot,formatDate:at,formatTimeAgo:nt}}function useHover(){const[tt,et]=reactExports.useState(!1),rt=reactExports.useRef(null),st=()=>{et(!0)},nt=()=>{et(!1)};return reactExports.useEffect(()=>{const ot=rt.current;if(ot)return ot.addEventListener("mouseover",st),ot.addEventListener("mouseout",nt),()=>{ot.removeEventListener("mouseover",st),ot.removeEventListener("mouseout",nt)}},[rt]),[rt,tt]}let e$1={data:""},t$1=tt=>typeof window=="object"?((tt?tt.querySelector("#_goober"):window._goober)||Object.assign((tt||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:tt||e$1,l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$1=/\n+/g,o$1=(tt,et)=>{let rt="",st="",nt="";for(let ot in tt){let at=tt[ot];ot[0]=="@"?ot[1]=="i"?rt=ot+" "+at+";":st+=ot[1]=="f"?o$1(at,ot):ot+"{"+o$1(at,ot[1]=="k"?"":et)+"}":typeof at=="object"?st+=o$1(at,et?et.replace(/([^,])+/g,lt=>ot.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,ut=>/&/.test(ut)?ut.replace(/&/g,lt):lt?lt+" "+ut:ut)):ot):at!=null&&(ot=/^--/.test(ot)?ot:ot.replace(/[A-Z]/g,"-$&").toLowerCase(),nt+=o$1.p?o$1.p(ot,at):ot+":"+at+";")}return rt+(et&&nt?et+"{"+nt+"}":nt)+st},c$2={},s$1=tt=>{if(typeof tt=="object"){let et="";for(let rt in tt)et+=rt+s$1(tt[rt]);return et}return tt},i$2=(tt,et,rt,st,nt)=>{let ot=s$1(tt),at=c$2[ot]||(c$2[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$2[at]){let ut=ot!==tt?tt:(ct=>{let dt,ht,ft=[{}];for(;dt=l$1.exec(ct.replace(a$1,""));)dt[4]?ft.shift():dt[3]?(ht=dt[3].replace(n$1," ").trim(),ft.unshift(ft[0][ht]=ft[0][ht]||{})):ft[0][dt[1]]=dt[2].replace(n$1," ").trim();return ft[0]})(tt);c$2[at]=o$1(nt?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$2.g?c$2.g:null;return rt&&(c$2.g=c$2[at]),((ut,ct,dt,ht)=>{ht?ct.data=ct.data.replace(ht,ut):ct.data.indexOf(ut)===-1&&(ct.data=dt?ut+ct.data:ct.data+ut)})(c$2[at],et,st,lt),at},p$1=(tt,et,rt)=>tt.reduce((st,nt,ot)=>{let at=et[ot];if(at&&at.call){let lt=at(rt),ut=lt&<.props&<.props.className||/^go/.test(lt)&<at=ut?"."+ut:lt&&typeof lt=="object"?lt.props?"":o$1(lt,""):lt===!1?"":lt}return st+nt+(at??"")},"");function u$2(tt){let et=this||{},rt=tt.call?tt(et.p):tt;return i$2(rt.unshift?rt.raw?p$1(rt,[].slice.call(arguments,1),et.p):rt.reduce((st,nt)=>Object.assign(st,nt&&nt.call?nt(et.p):nt),{}):rt,t$1(et.target),et.g,et.o,et.k)}let d$1,f$2,g$1;u$2.bind({g:1});let h$1=u$2.bind({k:1});function m$1(tt,et,rt,st){o$1.p=et,d$1=tt,f$2=rt,g$1=st}function j$2(tt,et){let rt=this||{};return function(){let st=arguments;function nt(ot,at){let lt=Object.assign({},ot),ut=lt.className||nt.className;rt.p=Object.assign({theme:f$2&&f$2()},lt),rt.o=/ *go\d+/.test(ut),lt.className=u$2.apply(rt,st)+(ut?" "+ut:"");let ct=tt;return tt[0]&&(ct=lt.as||tt,delete lt.as),g$1&&ct[0]&&g$1(lt),d$1(ct,lt)}return et?et(nt):nt}}var W$2=tt=>typeof tt=="function",f$1=(tt,et)=>W$2(tt)?tt(et):tt,F$1=(()=>{let tt=0;return()=>(++tt).toString()})(),A$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),Y$1=20,U$1=(tt,et)=>{switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,Y$1)};case 1:return{...tt,toasts:tt.toasts.map(ot=>ot.id===et.toast.id?{...ot,...et.toast}:ot)};case 2:let{toast:rt}=et;return U$1(tt,{type:tt.toasts.find(ot=>ot.id===rt.id)?1:0,toast:rt});case 3:let{toastId:st}=et;return{...tt,toasts:tt.toasts.map(ot=>ot.id===st||st===void 0?{...ot,dismissed:!0,visible:!1}:ot)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(ot=>ot.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let nt=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(ot=>({...ot,pauseDuration:ot.pauseDuration+nt}))}}},P$1=[],y$1={toasts:[],pausedAt:void 0},u$1=tt=>{y$1=U$1(y$1,tt),P$1.forEach(et=>{et(y$1)})},q$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},D$1=(tt={})=>{let[et,rt]=reactExports.useState(y$1),st=reactExports.useRef(y$1);reactExports.useEffect(()=>(st.current!==y$1&&rt(y$1),P$1.push(rt),()=>{let ot=P$1.indexOf(rt);ot>-1&&P$1.splice(ot,1)}),[]);let nt=et.toasts.map(ot=>{var at,lt,ut;return{...tt,...tt[ot.type],...ot,removeDelay:ot.removeDelay||((at=tt[ot.type])==null?void 0:at.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:ot.duration||((lt=tt[ot.type])==null?void 0:lt.duration)||(tt==null?void 0:tt.duration)||q$1[ot.type],style:{...tt.style,...(ut=tt[ot.type])==null?void 0:ut.style,...ot.style}}});return{...et,toasts:nt}},J$1=(tt,et="blank",rt)=>({createdAt:Date.now(),visible:!0,dismissed:!1,type:et,ariaProps:{role:"status","aria-live":"polite"},message:tt,pauseDuration:0,...rt,id:(rt==null?void 0:rt.id)||F$1()}),x$1=tt=>(et,rt)=>{let st=J$1(et,tt,rt);return u$1({type:2,toast:st}),st.id},c$1=(tt,et)=>x$1("blank")(tt,et);c$1.error=x$1("error");c$1.success=x$1("success");c$1.loading=x$1("loading");c$1.custom=x$1("custom");c$1.dismiss=tt=>{u$1({type:3,toastId:tt})};c$1.remove=tt=>u$1({type:4,toastId:tt});c$1.promise=(tt,et,rt)=>{let st=c$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(nt=>{let ot=et.success?f$1(et.success,nt):void 0;return ot?c$1.success(ot,{id:st,...rt,...rt==null?void 0:rt.success}):c$1.dismiss(st),nt}).catch(nt=>{let ot=et.error?f$1(et.error,nt):void 0;ot?c$1.error(ot,{id:st,...rt,...rt==null?void 0:rt.error}):c$1.dismiss(st)}),tt};var K$2=(tt,et)=>{u$1({type:1,toast:{id:tt,height:et}})},X$1=()=>{u$1({type:5,time:Date.now()})},b$1=new Map,Z$1=1e3,ee$1=(tt,et=Z$1)=>{if(b$1.has(tt))return;let rt=setTimeout(()=>{b$1.delete(tt),u$1({type:4,toastId:tt})},et);b$1.set(tt,rt)},O$1=tt=>{let{toasts:et,pausedAt:rt}=D$1(tt);reactExports.useEffect(()=>{if(rt)return;let ot=Date.now(),at=et.map(lt=>{if(lt.duration===1/0)return;let ut=(lt.duration||0)+lt.pauseDuration-(ot-lt.createdAt);if(ut<0){lt.visible&&c$1.dismiss(lt.id);return}return setTimeout(()=>c$1.dismiss(lt.id),ut)});return()=>{at.forEach(lt=>lt&&clearTimeout(lt))}},[et,rt]);let st=reactExports.useCallback(()=>{rt&&u$1({type:6,time:Date.now()})},[rt]),nt=reactExports.useCallback((ot,at)=>{let{reverseOrder:lt=!1,gutter:ut=8,defaultPosition:ct}=at||{},dt=et.filter(xt=>(xt.position||ct)===(ot.position||ct)&&xt.height),ht=dt.findIndex(xt=>xt.id===ot.id),ft=dt.filter((xt,yt)=>yt<ht&&xt.visible).length;return dt.filter(xt=>xt.visible).slice(...lt?[ft+1]:[0,ft]).reduce((xt,yt)=>xt+(yt.height||0)+ut,0)},[et]);return reactExports.useEffect(()=>{et.forEach(ot=>{if(ot.dismissed)ee$1(ot.id,ot.removeDelay);else{let at=b$1.get(ot.id);at&&(clearTimeout(at),b$1.delete(ot.id))}})},[et]),{toasts:et,handlers:{updateHeight:K$2,startPause:X$1,endPause:st,calculateOffset:nt}}},oe$1=h$1`
|
|
51
51
|
from {
|
|
52
52
|
transform: scale(0) rotate(45deg);
|
|
53
53
|
opacity: 0;
|