ode-explorer 2.3.0-develop-pedago.202510061918 → 2.3.0-develop-pedago.202510091826
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 +9 -9
- 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(...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({...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;if(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)):""))),utils$4.isFormData(rt)){if(platform.hasStandardBrowserEnv||platform.hasStandardBrowserWebWorkerEnv)at.setContentType(void 0);else if(utils$4.isFunction(rt.getHeaders)){const ut=rt.getHeaders(),ct=["content-type","content-length"];Object.entries(ut).forEach(([dt,ht])=>{ct.includes(dt.toLowerCase())&&at.set(dt,ht)})}}if(platform.hasStandardBrowserEnv&&(st&&utils$4.isFunction(st)&&(st=st(et)),st||st!==!1&&isURLSameOrigin(et.url))){const ut=nt&&ot&&cookies.read(ot);ut&&at.set(nt,ut)}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,vt;function yt(){xt&&xt(),vt&&vt(),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(jt){rt(jt),yt()},function(jt){st(jt),yt()},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(Rt){const Ct=Rt&&Rt.message?Rt.message:"Network Error",It=new AxiosError$1(Ct,AxiosError$1.ERR_NETWORK,tt,Et);It.event=Rt||null,st(It),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,vt]=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})},DEFAULT_CHUNK_SIZE=64*1024,{isFunction:isFunction$1}=utils$4,globalFetchAPI=(({Request:tt,Response:et})=>({Request:tt,Response:et}))(utils$4.global),{ReadableStream:ReadableStream$1,TextEncoder}=utils$4.global,test=(tt,...et)=>{try{return!!tt(...et)}catch{return!1}},factory=tt=>{tt=utils$4.merge.call({skipUndefined:!0},globalFetchAPI,tt);const{fetch:et,Request:rt,Response:st}=tt,nt=et?isFunction$1(et):typeof fetch=="function",ot=isFunction$1(rt),at=isFunction$1(st);if(!nt)return!1;const lt=nt&&isFunction$1(ReadableStream$1),ut=nt&&(typeof TextEncoder=="function"?(vt=>yt=>vt.encode(yt))(new TextEncoder):async vt=>new Uint8Array(await new rt(vt).arrayBuffer())),ct=ot&<&&test(()=>{let vt=!1;const yt=new rt(platform.origin,{body:new ReadableStream$1,method:"POST",get duplex(){return vt=!0,"half"}}).headers.has("Content-Type");return vt&&!yt}),dt=at&<&&test(()=>utils$4.isReadableStream(new st("").body)),ht={stream:dt&&(vt=>vt.body)};nt&&["text","arrayBuffer","blob","formData","stream"].forEach(vt=>{!ht[vt]&&(ht[vt]=(yt,Et)=>{let bt=yt&&yt[vt];if(bt)return bt.call(yt);throw new AxiosError$1(`Response type '${vt}' is not supported`,AxiosError$1.ERR_NOT_SUPPORT,Et)})});const ft=async vt=>{if(vt==null)return 0;if(utils$4.isBlob(vt))return vt.size;if(utils$4.isSpecCompliantForm(vt))return(await new rt(platform.origin,{method:"POST",body:vt}).arrayBuffer()).byteLength;if(utils$4.isArrayBufferView(vt)||utils$4.isArrayBuffer(vt))return vt.byteLength;if(utils$4.isURLSearchParams(vt)&&(vt=vt+""),utils$4.isString(vt))return(await ut(vt)).byteLength},xt=async(vt,yt)=>{const Et=utils$4.toFiniteNumber(vt.getContentLength());return Et??ft(yt)};return async vt=>{let{url:yt,method:Et,data:bt,signal:wt,cancelToken:St,timeout:Rt,onDownloadProgress:Ct,onUploadProgress:It,responseType:jt,headers:Pt,withCredentials:Ot="same-origin",fetchOptions:Ut}=resolveConfig(vt),Nt=et||fetch;jt=jt?(jt+"").toLowerCase():"text";let Ht=composeSignals([wt,St&&St.toAbortSignal()],Rt),Lt=null;const kt=Ht&&Ht.unsubscribe&&(()=>{Ht.unsubscribe()});let $t;try{if(It&&ct&&Et!=="get"&&Et!=="head"&&($t=await xt(Pt,bt))!==0){let qt=new rt(yt,{method:"POST",body:bt,duplex:"half"}),Qt;if(utils$4.isFormData(bt)&&(Qt=qt.headers.get("content-type"))&&Pt.setContentType(Qt),qt.body){const[Yt,tr]=progressEventDecorator($t,progressEventReducer(asyncDecorator(It)));bt=trackStream(qt.body,DEFAULT_CHUNK_SIZE,Yt,tr)}}utils$4.isString(Ot)||(Ot=Ot?"include":"omit");const Ft=ot&&"credentials"in rt.prototype,Gt={...Ut,signal:Ht,method:Et.toUpperCase(),headers:Pt.normalize().toJSON(),body:bt,duplex:"half",credentials:Ft?Ot:void 0};Lt=ot&&new rt(yt,Gt);let Mt=await(ot?Nt(Lt,Ut):Nt(yt,Gt));const Vt=dt&&(jt==="stream"||jt==="response");if(dt&&(Ct||Vt&&kt)){const qt={};["status","statusText","headers"].forEach(lr=>{qt[lr]=Mt[lr]});const Qt=utils$4.toFiniteNumber(Mt.headers.get("content-length")),[Yt,tr]=Ct&&progressEventDecorator(Qt,progressEventReducer(asyncDecorator(Ct),!0))||[];Mt=new st(trackStream(Mt.body,DEFAULT_CHUNK_SIZE,Yt,()=>{tr&&tr(),kt&&kt()}),qt)}jt=jt||"text";let Bt=await ht[utils$4.findKey(ht,jt)||"text"](Mt,vt);return!Vt&&kt&&kt(),await new Promise((qt,Qt)=>{settle(qt,Qt,{data:Bt,headers:AxiosHeaders$1.from(Mt.headers),status:Mt.status,statusText:Mt.statusText,config:vt,request:Lt})})}catch(Ft){throw kt&&kt(),Ft&&Ft.name==="TypeError"&&/Load failed|fetch/i.test(Ft.message)?Object.assign(new AxiosError$1("Network Error",AxiosError$1.ERR_NETWORK,vt,Lt),{cause:Ft.cause||Ft}):AxiosError$1.from(Ft,Ft&&Ft.code,vt,Lt)}}},seedCache=new Map,getFetch=tt=>{let et=tt?tt.env:{};const{fetch:rt,Request:st,Response:nt}=et,ot=[st,nt,rt];let at=ot.length,lt=at,ut,ct,dt=seedCache;for(;lt--;)ut=ot[lt],ct=dt.get(ut),ct===void 0&&dt.set(ut,ct=lt?new Map:factory(et)),dt=ct;return ct};getFetch();const knownAdapters={http:httpAdapter,xhr:xhrAdapter,fetch:{get:getFetch}};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,et)=>{tt=utils$4.isArray(tt)?tt:[tt];const{length:rt}=tt;let st,nt;const ot={};for(let at=0;at<rt;at++){st=tt[at];let lt;if(nt=st,!isResolvedHandle(st)&&(nt=knownAdapters[(lt=String(st)).toLowerCase()],nt===void 0))throw new AxiosError$1(`Unknown adapter '${lt}'`);if(nt&&(utils$4.isFunction(nt)||(nt=nt.get(et))))break;ot[lt||"#"+at]=nt}if(!nt){const at=Object.entries(ot).map(([ut,ct])=>`adapter ${ut} `+(ct===!1?"is not supported by the environment":"is not available in the build"));let lt=rt?at.length>1?`since :
|
|
48
48
|
`+at.map(renderReason).join(`
|
|
49
49
|
`):" "+renderReason(at[0]):"as no adapter specified";throw new AxiosError$1("There is no suitable adapter to dispatch the request "+lt,"ERR_NOT_SUPPORT")}return nt},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)(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.12.2",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"],vt=>{delete ot[vt]}),rt.headers=AxiosHeaders$1.concat(at,ot);const lt=[];let ut=!0;this.interceptors.request.forEach(function(yt){typeof yt.runWhen=="function"&&yt.runWhen(rt)===!1||(ut=ut&&yt.synchronous,lt.unshift(yt.fulfilled,yt.rejected))});const ct=[];this.interceptors.response.forEach(function(yt){ct.push(yt.fulfilled,yt.rejected)});let dt,ht=0,ft;if(!ut){const vt=[dispatchRequest.bind(this),void 0];for(vt.unshift(...lt),vt.push(...ct),ft=vt.length,dt=Promise.resolve(rt);ht<ft;)dt=dt.then(vt[ht++],vt[ht++]);return dt}ft=lt.length;let xt=rt;for(;ht<ft;){const vt=lt[ht++],yt=lt[ht++];try{xt=vt(xt)}catch(Et){yt.call(this,Et);break}}try{dt=dispatchRequest.call(this,xt)}catch(vt){return Promise.reject(vt)}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$3(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$2=(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((vt,yt)=>{ut.toBlob(Et=>{Et?vt(new File([Et],rt,{type:ct,lastModified:new Date().getTime()})):yt()},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$5=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$5(this,"wordExtensions",new Set),n$5(this,"excelExtensions",new Set),n$5(this,"pptExtensions",new Set),n$5(this,"fileExtensionMap",new Map),n$5(this,"csvContentType",new Set),n$5(this,"csvExtensions",new Set),n$5(this,"txtExtensions",new Set),n$5(this,"mdExtensions",new Set),n$5(this,"PDF","application/pdf"),n$5(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$5(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$4=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$2=Object.defineProperty,T$1=(tt,et,rt)=>et in tt?v$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$3=(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$3(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$3(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$3(this,"_resolution"),n$3(this,"_rejection"),n$3(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$3(this,"promises",{}),n$3(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$3(this,"axios"),n$3(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$3(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$3(this,"_me",null),n$3(this,"_currentLanguage",""),n$3(this,"_notLoggedIn",!0),n$3(this,"_description"),n$3(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$3(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$3(this,"_conf"),n$3(this,"_loaded"),n$3(this,"skinName",""),n$3(this,"themeName",""),n$3(this,"skin","raw"),n$3(this,"themeUrl","/assets/themes/raw/default/"),n$3(this,"templateOverrides",{}),n$3(this,"portalTemplate","/assets/themes/raw/portal.html"),n$3(this,"basePath",""),n$3(this,"logoutCallback",""),n$3(this,"skins",[]),n$3(this,"is1D",!1),n$3(this,"is2D",!1),n$3(this,"_onSkinReady",notify.onSkinReady()),n$3(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$3(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$3(this,"_me",null),n$3(this,"_keepOpenOnLogout",!1),n$3(this,"_preferences",new UserPreferences),n$3(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$3(this,"_publicConf",{}),n$3(this,"_currentApp"),n$3(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$3(this,"_status","void"),n$3(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$3(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$3(this,"School",{}),n$3(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 m$2=class{constructor(et){n$3(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$3(m$2,"registry",new ServiceRegistry),n$3(m$2,"register",m$2.registry.register.bind(m$2.registry)),n$3(m$2,"findService",m$2.registry.findService.bind(m$2.registry)),n$3(m$2,"findMainService",m$2.registry.findMainService.bind(m$2.registry)),n$3(m$2,"isRegistered",m$2.registry.isRegistered.bind(m$2.registry));let ResourceService=m$2;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,nbUsers:ut})=>({nbUsers:ut,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:vt,users:yt}=await this.getBookMarkById(ht),Et=yt.map(wt=>wt.id),bt=xt.map(wt=>wt.id);return{displayName:ft,id:vt,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$3(this,"axios"),n$3(this,"baseUrl"),n$3(this,"headers",{}),n$3(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 patch(et,rt,st){try{const nt=await this.axios.patch(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchFile(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.patch(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.patch(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(),vt=StringUtils.removeAccents(ut||"").toLowerCase(),yt=StringUtils.removeAccents(ht||"").toLowerCase();return vt.includes(nt)||xt.includes(nt)||ft.includes(nt)||yt.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(vt=>vt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const vt=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:vt.map(yt=>{const Et=lt[yt];return{displayName:yt,id:yt,priority:Et.priority}})}}).sort((xt,vt)=>(xt.displayName||"").localeCompare(vt.displayName)),ct=Object.keys(ot.groups.checked).map(xt=>ot.groups.visibles.find(vt=>vt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const vt=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:vt.map(yt=>{const Et=lt[yt];return{displayName:yt,id:yt,priority:Et.priority}})}}).sort((xt,vt)=>(xt.displayName||"").localeCompare(vt.displayName)),dt=[...ut,...ct],ht=ot.groups.visibles.map(({groupDisplayName:xt,id:vt,name:yt,labels:Et})=>({labels:Et,displayName:xt||yt,id:vt})),ft=ot.users.visibles.map(({id:xt,profile:vt,username:yt,firstName:Et,lastName:bt,login:wt})=>({displayName:yt,firstName:Et,lastName:bt,login:wt,profile:vt,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$1=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$3(R$1,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=R$1;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 b$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$3(b$1,"MAX_WEIGHT",50),n$3(b$1,"MAX_DURATION",3);let VideoService=b$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$3(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$3(this,"APP","actualites"),n$3(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$3(this,"APP","blog"),n$3(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$3(this,"APP","collaborativewall"),n$3(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$3(this,"APP","community"),n$3(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$3(this,"APP","exercizer"),n$3(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$3(this,"APP","formulaire"),n$3(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$3(this,"APP","forum"),n$3(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$3(this,"APP","homeworks"),n$3(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$3(this,"APP","magneto"),n$3(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$3(this,"APP","mindmap"),n$3(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$3(this,"APP","pages"),n$3(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$3(this,"APP","poll"),n$3(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$3(this,"APP","scrapbook"),n$3(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$3(this,"APP","timelinegenerator"),n$3(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$3(this,"APP","wiki"),n$3(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$3(this,"APP","workspace"),n$3(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 w$3=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 registerCustomBehaviour(et,rt,st){this.registry.register({application:et,resourceType:rt},st)}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$3(w$3,"registry",new ServiceRegistry),n$3(w$3,"findBehaviour",w$3.registry.findService.bind(w$3.registry)),n$3(w$3,"hasBehaviour",w$3.registry.isRegistered.bind(w$3.registry)),n$3(w$3,"resourceProducingApps",[]);let SnipletsService=w$3;const SEND_ALL="*";class WebBroker{constructor(et){n$3(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$3(this,"_webBroker"),n$3(this,"app"),n$3(this,"user"),n$3(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:this.app||"video",video_id:et,browser:at,duration:Math.round(rt),weight:st,source:nt?"CAPTURED":"UPLOADED",url:ot});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$3(this,"_analytics"),n$3(this,"_cache"),n$3(this,"_conf"),n$3(this,"_data"),n$3(this,"_directory"),n$3(this,"_http"),n$3(this,"_idiom"),n$3(this,"_notify"),n$3(this,"_rights"),n$3(this,"_session"),n$3(this,"_share"),n$3(this,"_video"),n$3(this,"_workspace"),n$3(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$3(this,"_initialized"),n$3(this,"_widgets",[]),n$3(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$3(this,"_schoolConf",{}),n$3(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})},vt=tt.section?16:12,{t:yt}=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))},It=Pt=>jsxRuntimeExports.jsx(Pt?SvgIconRafterDown:SvgIconRafterRight,{title:yt("foldUnfold"),width:vt,height:vt}),jt=()=>{var Pt;const Ot=!((Pt=nt==null?void 0:nt.current)!=null&&Pt.has(tt.id)),Ut=Array.isArray(tt.children)&&tt.children.length>0;return dt||Ot&&Ut};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":yt("foldUnfold"),children:jt()&&It(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:yt("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,vt]=reactExports.useState(void 0),yt=ut??rt;function Et(Nt){var Ht;Array.isArray(Nt)?Nt.forEach(Lt=>{const kt=new Set(ft.current);Nt.filter(({id:$t})=>$t!==Lt.id).some($t=>$t.children&&$t.children.length>0)&&kt.add(Lt.id),Lt.children&&Lt.children.length>0&&Lt.children.forEach($t=>{var Ft;const Gt=(Ft=Lt.children)==null?void 0:Ft.filter(({id:Mt})=>Mt!==$t.id);Gt!=null&&Gt.some(Mt=>Mt.children&&Mt.children.length>0)&&kt.add($t.id),Et($t)})}):(Ht=Nt.children)==null||Ht.forEach(Lt=>{var kt;const $t=new Set(ft.current),Ft=(kt=Nt.children)==null?void 0:kt.filter(Gt=>Gt.id!==Lt.id);Ft!=null&&Ft.some(Gt=>Gt.children&&Gt.children.length>0)&&($t.add(Lt.id),ft.current=$t),Et(Lt)})}const bt=Nt=>{const Ht=new Set("");tt&&Array.isArray(tt)&&Nt&&(tt.forEach(Lt=>{Ht.add(Lt.id)}),ht(Ht))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{st!=null&&st.isOver&&st.isTreeview?(st.overId&&Ut(st.overId),vt(st.overId)):vt(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,yt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ht=>ot==null?void 0:ot(Ht));return}Rt(Nt)},Rt=Nt=>{const Ht=new Set(dt),Lt=findPathById(tt,Nt),kt=Array.from(Ht);Lt.forEach($t=>{const Ft=kt.indexOf($t);Ft>-1&&kt.splice(Ft,1),kt.push($t)}),Ht.clear(),kt.forEach($t=>Ht.add($t)),Ht.forEach($t=>ot==null?void 0:ot($t)),ht(Ht)},Ct=Nt=>{const Ht=new Set(dt);Ht.delete(Nt),Ht.forEach(Lt=>at==null?void 0:at(Lt)),ht(Ht)},It=Nt=>{dt.has(Nt)?Ct(Nt):Rt(Nt)},jt=Nt=>{yt!==Nt&&ct(Nt)},Pt=Nt=>{jt(Nt),Rt(Nt),lt==null||lt(Nt)},Ot=Nt=>{It(Nt)},Ut=Nt=>{findNodeById(tt,rt)&&Rt(Nt)};return{selectedNodeId:yt,expandedNodes:dt,siblingsNodes:ft,draggedNodeId:xt,handleItemClick:Pt,handleFoldUnfold:Ot}},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:vt,handleItemClick:yt,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:vt,handleItemClick:yt,handleToggleNode:Et,handleItemAction:at},bt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,showIcon:ut,draggedNodeId:vt,handleItemClick:yt,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.41",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",ft="model",xt="name",vt="type",yt="vendor",Et="version",bt="architecture",wt="console",St="mobile",Rt="tablet",Ct="smarttv",It="wearable",jt="embedded",Pt=500,Ot="Amazon",Ut="Apple",Nt="ASUS",Ht="BlackBerry",Lt="Browser",kt="Chrome",$t="Edge",Ft="Firefox",Gt="Google",Mt="Honor",Vt="Huawei",Bt="Lenovo",qt="LG",Qt="Microsoft",Yt="Motorola",tr="Nvidia",lr="OnePlus",ur="Opera",mr="OPPO",yr="Samsung",or="Sharp",hr="Sony",pr="Xiaomi",_r="Zebra",Ar="Facebook",Hr="Chromium OS",Ur="Mac OS",os=" Browser",Gs=function(Ir,Br){var kr={};for(var Wr in Ir)Br[Wr]&&Br[Wr].length%2===0?kr[Wr]=Br[Wr].concat(Ir[Wr]):kr[Wr]=Ir[Wr];return kr},Es=function(Ir){for(var Br={},kr=0;kr<Ir.length;kr++)Br[Ir[kr].toUpperCase()]=Ir[kr];return Br},Ws=function(Ir,Br){return typeof Ir===dt?Xt(Br).indexOf(Xt(Ir))!==-1:!1},Xt=function(Ir){return Ir.toLowerCase()},er=function(Ir){return typeof Ir===dt?Ir.replace(/[^\d\.]/g,ot).split(".")[0]:st},sr=function(Ir,Br){if(typeof Ir===dt)return Ir=Ir.replace(/^\s\s*/,ot),typeof Br===ut?Ir:Ir.substring(0,Pt)},br=function(Ir,Br){for(var kr=0,Wr,bs,ps,zr,$r,Ls;kr<Br.length&&!$r;){var Zo=Br[kr],Pl=Br[kr+1];for(Wr=bs=0;Wr<Zo.length&&!$r&&Zo[Wr];)if($r=Zo[Wr++].exec(Ir),$r)for(ps=0;ps<Pl.length;ps++)Ls=$r[++bs],zr=Pl[ps],typeof zr===ct&&zr.length>0?zr.length===2?typeof zr[1]==lt?this[zr[0]]=zr[1].call(this,Ls):this[zr[0]]=zr[1]:zr.length===3?typeof zr[1]===lt&&!(zr[1].exec&&zr[1].test)?this[zr[0]]=Ls?zr[1].call(this,Ls,zr[2]):st:this[zr[0]]=Ls?Ls.replace(zr[1],zr[2]):st:zr.length===4&&(this[zr[0]]=Ls?zr[3].call(this,Ls.replace(zr[1],zr[2])):st):this[zr]=Ls||st;kr+=2}},gr=function(Ir,Br){for(var kr in Br)if(typeof Br[kr]===ct&&Br[kr].length>0){for(var Wr=0;Wr<Br[kr].length;Wr++)if(Ws(Br[kr][Wr],Ir))return kr===at?st:kr}else if(Ws(Br[kr],Ir))return kr===at?st:kr;return Br.hasOwnProperty("*")?Br["*"]:Ir},vr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Tr={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"},Lr={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,ur+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,ur+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,ur]],[/\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,Ft+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,ur+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,ur+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+os]],[/fxios\/([\w\.-]+)/i],[Et,[xt,Ft]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+os],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,yr+" 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,Ar],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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,gr,vr]],[/(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,Ft+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[bt,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[bt,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[bt,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[bt,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[bt,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[bt,/ower/,ot,Xt]],[/ sun4\w[;\)]/i],[[bt,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[bt,Xt]]],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,[yt,yr],[vt,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,[yt,yr],[vt,St]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[ft,[yt,Ut],[vt,St]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[ft,[yt,Ut],[vt,Rt]],[/(macintosh);/i],[ft,[yt,Ut]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ft,[yt,or],[vt,St]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[ft,[yt,Mt],[vt,Rt]],[/honor([-\w ]+)[;\)]/i],[ft,[yt,Mt],[vt,St]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[ft,[yt,Vt],[vt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[ft,[yt,Vt],[vt,St]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[ft,/_/g," "],[yt,pr],[vt,Rt]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[ft,/_/g," "],[yt,pr],[vt,St]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ft,[yt,mr],[vt,St]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[ft,[yt,gr,{OnePlus:["304","403","203"],"*":mr}],[vt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ft,[yt,"Vivo"],[vt,St]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ft,[yt,"Realme"],[vt,St]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[ft,[yt,Yt],[vt,St]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ft,[yt,Yt],[vt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ft,[yt,qt],[vt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[ft,[yt,qt],[vt,St]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[ft,[yt,Bt],[vt,Rt]],[/(nokia) (t[12][01])/i],[yt,ft,[vt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[ft,/_/g," "],[vt,St],[yt,"Nokia"]],[/(pixel (c|tablet))\b/i],[ft,[yt,Gt],[vt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[ft,[yt,Gt],[vt,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,[yt,hr],[vt,St]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ft,"Xperia Tablet"],[yt,hr],[vt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ft,[yt,lr],[vt,St]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ft,[yt,Ot],[vt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ft,/(.+)/g,"Fire Phone $1"],[yt,Ot],[vt,St]],[/(playbook);[-\w\),; ]+(rim)/i],[ft,yt,[vt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[ft,[yt,Ht],[vt,St]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ft,[yt,Nt],[vt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ft,[yt,Nt],[vt,St]],[/(nexus 9)/i],[ft,[yt,"HTC"],[vt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[yt,[ft,/_/g," "],[vt,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,[yt,"TCL"],[vt,Rt]],[/(itel) ((\w+))/i],[[yt,Xt],ft,[vt,gr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ft,[yt,"Acer"],[vt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ft,[yt,"Meizu"],[vt,St]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ft,[yt,"Ulefone"],[vt,St]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ft,[yt,"Energizer"],[vt,St]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ft,[yt,"Cat"],[vt,St]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ft,[yt,"Smartfren"],[vt,St]],[/droid.+; (a(?:015|06[35]|142p?))/i],[ft,[yt,"Nothing"],[vt,St]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[ft,[yt,"Archos"],[vt,Rt]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[ft,[yt,"Archos"],[vt,St]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[yt,ft,[vt,Rt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[yt,ft,[vt,St]],[/(kobo)\s(ereader|touch)/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],[yt,ft,[vt,Rt]],[/(surface duo)/i],[ft,[yt,Qt],[vt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ft,[yt,"Fairphone"],[vt,St]],[/(u304aa)/i],[ft,[yt,"AT&T"],[vt,St]],[/\bsie-(\w*)/i],[ft,[yt,"Siemens"],[vt,St]],[/\b(rct\w+) b/i],[ft,[yt,"RCA"],[vt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[ft,[yt,"Dell"],[vt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[ft,[yt,"Verizon"],[vt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[ft,[yt,"Barnes & Noble"],[vt,Rt]],[/\b(tm\d{3}\w+) b/i],[ft,[yt,"NuVision"],[vt,Rt]],[/\b(k88) b/i],[ft,[yt,"ZTE"],[vt,Rt]],[/\b(nx\d{3}j) b/i],[ft,[yt,"ZTE"],[vt,St]],[/\b(gen\d{3}) b.+49h/i],[ft,[yt,"Swiss"],[vt,St]],[/\b(zur\d{3}) b/i],[ft,[yt,"Swiss"],[vt,Rt]],[/\b((zeki)?tb.*\b) b/i],[ft,[yt,"Zeki"],[vt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[yt,"Dragon Touch"],ft,[vt,Rt]],[/\b(ns-?\w{0,9}) b/i],[ft,[yt,"Insignia"],[vt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[ft,[yt,"NextBook"],[vt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[yt,"Voice"],ft,[vt,St]],[/\b(lvtel\-)?(v1[12]) b/i],[[yt,"LvTel"],ft,[vt,St]],[/\b(ph-1) /i],[ft,[yt,"Essential"],[vt,St]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[ft,[yt,"Envizen"],[vt,Rt]],[/\b(trio[-\w\. ]+) b/i],[ft,[yt,"MachSpeed"],[vt,Rt]],[/\btu_(1491) b/i],[ft,[yt,"Rotor"],[vt,Rt]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[ft,[yt,tr],[vt,Rt]],[/(sprint) (\w+)/i],[yt,ft,[vt,St]],[/(kin\.[onetw]{3})/i],[[ft,/\./g," "],[yt,Qt],[vt,St]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ft,[yt,_r],[vt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ft,[yt,_r],[vt,St]],[/smart-tv.+(samsung)/i],[yt,[vt,Ct]],[/hbbtv.+maple;(\d+)/i],[[ft,/^/,"SmartTV"],[yt,yr],[vt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[yt,qt],[vt,Ct]],[/(apple) ?tv/i],[yt,[ft,Ut+" TV"],[vt,Ct]],[/crkey/i],[[ft,kt+"cast"],[yt,Gt],[vt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[ft,[yt,Ot],[vt,Ct]],[/(shield \w+ tv)/i],[ft,[yt,tr],[vt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ft,[yt,or],[vt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[ft,[yt,hr],[vt,Ct]],[/(mi(tv|box)-?\w+) bui/i],[ft,[yt,pr],[vt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[yt,ft,[vt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[yt,sr],[ft,sr],[vt,Ct]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[ft,[vt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[vt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[yt,ft,[vt,wt]],[/droid.+; (shield)( bui|\))/i],[ft,[yt,tr],[vt,wt]],[/(playstation \w+)/i],[ft,[yt,hr],[vt,wt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ft,[yt,Qt],[vt,wt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[ft,[yt,yr],[vt,It]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[yt,ft,[vt,It]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[ft,[yt,mr],[vt,It]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ft,[yt,Ut],[vt,It]],[/(opwwe\d{3})/i],[ft,[yt,lr],[vt,It]],[/(moto 360)/i],[ft,[yt,Yt],[vt,It]],[/(smartwatch 3)/i],[ft,[yt,hr],[vt,It]],[/(g watch r)/i],[ft,[yt,qt],[vt,It]],[/droid.+; (wt63?0{2,3})\)/i],[ft,[yt,_r],[vt,It]],[/droid.+; (glass) \d/i],[ft,[yt,Gt],[vt,It]],[/(pico) (4|neo3(?: link|pro)?)/i],[yt,ft,[vt,It]],[/; (quest( \d| pro)?)/i],[ft,[yt,Ar],[vt,It]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[yt,[vt,jt]],[/(aeobc)\b/i],[ft,[yt,Ot],[vt,jt]],[/(homepod).+mac os/i],[ft,[yt,Ut],[vt,jt]],[/windows iot/i],[[vt,jt]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[ft,[vt,St]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[ft,[vt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[vt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[vt,St]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[ft,[yt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,$t+"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],[/ladybird\//i],[[xt,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,gr,Tr]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,gr,Tr],[xt,"Windows"]],[/[adehimnop]{4,7}\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,Ur],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(ubuntu) ([\w\.]+) like android/i],[[xt,/(.+)/,"$1 Touch"],Et],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ht]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,Ft+" 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,Hr],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)(?: arm\w*| x86\w*| ?)([\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]]},Dr=function(Ir,Br){if(typeof Ir===ct&&(Br=Ir,Ir=st),!(this instanceof Dr))return new Dr(Ir,Br).getResult();var kr=typeof rt!==ut&&rt.navigator?rt.navigator:st,Wr=Ir||(kr&&kr.userAgent?kr.userAgent:ot),bs=kr&&kr.userAgentData?kr.userAgentData:st,ps=Br?Gs(Lr,Br):Lr,zr=kr&&kr.userAgent==Wr;return this.getBrowser=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.browser),$r[ht]=er($r[Et]),zr&&kr&&kr.brave&&typeof kr.brave.isBrave==lt&&($r[xt]="Brave"),$r},this.getCPU=function(){var $r={};return $r[bt]=st,br.call($r,Wr,ps.cpu),$r},this.getDevice=function(){var $r={};return $r[yt]=st,$r[ft]=st,$r[vt]=st,br.call($r,Wr,ps.device),zr&&!$r[vt]&&bs&&bs.mobile&&($r[vt]=St),zr&&$r[ft]=="Macintosh"&&kr&&typeof kr.standalone!==ut&&kr.maxTouchPoints&&kr.maxTouchPoints>2&&($r[ft]="iPad",$r[vt]=Rt),$r},this.getEngine=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.engine),$r},this.getOS=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.os),zr&&!$r[xt]&&bs&&bs.platform&&bs.platform!="Unknown"&&($r[xt]=bs.platform.replace(/chrome os/i,Hr).replace(/macos/i,Ur)),$r},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 Wr},this.setUA=function($r){return Wr=typeof $r===dt&&$r.length>Pt?sr($r,Pt):$r,this},this.setUA(Wr),this};Dr.VERSION=nt,Dr.BROWSER=Es([xt,Et,ht]),Dr.CPU=Es([bt]),Dr.DEVICE=Es([ft,yt,vt,wt,St,Ct,Rt,It,jt]),Dr.ENGINE=Dr.OS=Es([xt,Et]),tt.exports&&(et=tt.exports=Dr),et.UAParser=Dr;var Zr=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(Zr&&!Zr.ua){var ks=new Dr;Zr.ua=ks.getResult(),Zr.ua.get=function(){return ks.getUA()},Zr.ua.set=function(Ir){ks.setUA(Ir);var Br=ks.getResult();for(var kr in Br)Zr.ua[kr]=Br[kr]}}})(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 wl,Ho,Zl,Wp,FocusManager=(Wp=class extends Subscribable{constructor(){super();Or(this,wl);Or(this,Ho);Or(this,Zl);Sr(this,Zl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Ho)||this.setEventListener(Kt(this,Zl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Ho))==null||et.call(this),Sr(this,Ho,void 0))}setEventListener(et){var rt;Sr(this,Zl,et),(rt=Kt(this,Ho))==null||rt.call(this),Sr(this,Ho,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,wl)!==et&&(Sr(this,wl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,wl)=="boolean"?Kt(this,wl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},wl=new WeakMap,Ho=new WeakMap,Zl=new WeakMap,Wp),focusManager=new FocusManager,Jl,Vo,eu,qp,OnlineManager=(qp=class extends Subscribable{constructor(){super();Or(this,Jl,!0);Or(this,Vo);Or(this,eu);Sr(this,eu,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,Vo)||this.setEventListener(Kt(this,eu))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Vo))==null||et.call(this),Sr(this,Vo,void 0))}setEventListener(et){var rt;Sr(this,eu,et),(rt=Kt(this,Vo))==null||rt.call(this),Sr(this,Vo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Jl)!==et&&(Sr(this,Jl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Jl)}},Jl=new WeakMap,Vo=new WeakMap,eu=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=yt=>{var Et;st||(ft(new CancelledError(yt)),(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=yt=>{var Et;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,yt),nt==null||nt(),ot.resolve(yt))},ft=yt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,yt),nt==null||nt(),ot.reject(yt))},xt=()=>new Promise(yt=>{var Et;nt=bt=>{(st||ct())&&yt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var yt;nt=void 0,st||(yt=tt.onContinue)==null||yt.call(tt)}),vt=()=>{if(st)return;let yt;const Et=rt===0?tt.initialPromise:void 0;try{yt=Et??tt.fn()}catch(bt){yt=Promise.reject(bt)}Promise.resolve(yt).then(ht).catch(bt=>{var It;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++,(It=tt.onFail)==null||It.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(bt):vt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?vt():xt().then(vt),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(),Sl,Xp,Removable=(Xp=class{constructor(){Or(this,Sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Sr(this,Sl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,Sl)&&(clearTimeout(Kt(this,Sl)),Sr(this,Sl,void 0))}},Sl=new WeakMap,Xp),tu,ru,qn,js,Lu,_l,eo,Co,Yp,Query=(Yp=class extends Removable{constructor(et){super();Or(this,eo);Or(this,tu);Or(this,ru);Or(this,qn);Or(this,js);Or(this,Lu);Or(this,_l);Sr(this,_l,!1),Sr(this,Lu,et.defaultOptions),this.setOptions(et.options),this.observers=[],Sr(this,qn,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Sr(this,tu,getDefaultState$1(this.options)),this.state=et.state??Kt(this,tu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,js))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Lu),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,qn).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Fr(this,eo,Co).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Fr(this,eo,Co).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,js))==null?void 0:st.promise;return(nt=Kt(this,js))==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,tu))}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,js))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,qn).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,js)&&(Kt(this,_l)?Kt(this,js).cancel({revert:!0}):Kt(this,js).cancelRetry()),this.scheduleGc()),Kt(this,qn).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fr(this,eo,Co).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,js))return Kt(this,js).continueRetry(),Kt(this,js).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:()=>(Sr(this,_l,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Sr(this,_l,!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),Sr(this,ru,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Fr(this,eo,Co).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,vt,yt;isCancelledError(ht)&&ht.silent||Fr(this,eo,Co).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,qn).config).onError)==null||xt.call(ft,ht,this),(yt=(vt=Kt(this,qn).config).onSettled)==null||yt.call(vt,this.state.data,ht,this)),this.scheduleGc()};return Sr(this,js,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,xt,vt,yt;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,qn).config).onSuccess)==null||xt.call(ft,ht,this),(yt=(vt=Kt(this,qn).config).onSettled)==null||yt.call(vt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Fr(this,eo,Co).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Fr(this,eo,Co).call(this,{type:"pause"})},onContinue:()=>{Fr(this,eo,Co).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,js).start()}},tu=new WeakMap,ru=new WeakMap,qn=new WeakMap,js=new WeakMap,Lu=new WeakMap,_l=new WeakMap,eo=new WeakSet,Co=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,ru)?{...Kt(this,ru),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,qn).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 xo,Kp,QueryCache=(Kp=class extends Subscribable{constructor(et={}){super();Or(this,xo);this.config=et,Sr(this,xo,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,xo).has(et.queryHash)||(Kt(this,xo).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,xo).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,xo).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,xo).get(et)}getAll(){return[...Kt(this,xo).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()})})}},xo=new WeakMap,Kp),vo,Os,Rl,yo,Uo,Qp,Mutation=(Qp=class extends Removable{constructor(et){super();Or(this,yo);Or(this,vo);Or(this,Os);Or(this,Rl);this.mutationId=et.mutationId,Sr(this,Os,et.mutationCache),Sr(this,vo,[]),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,vo).includes(et)||(Kt(this,vo).push(et),this.clearGcTimeout(),Kt(this,Os).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Sr(this,vo,Kt(this,vo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,Os).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,vo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,Os).remove(this))}continue(){var et;return((et=Kt(this,Rl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,vt,yt,Et,bt,wt,St,Rt,Ct,It,jt;Sr(this,Rl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Pt,Ot)=>{Fr(this,yo,Uo).call(this,{type:"failed",failureCount:Pt,error:Ot})},onPause:()=>{Fr(this,yo,Uo).call(this,{type:"pause"})},onContinue:()=>{Fr(this,yo,Uo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,Os).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,Rl).canStart();try{if(!rt){Fr(this,yo,Uo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,Os).config).onMutate)==null?void 0:ot.call(nt,et,this));const Ot=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Ot!==this.state.context&&Fr(this,yo,Uo).call(this,{type:"pending",context:Ot,variables:et,isPaused:st})}const Pt=await Kt(this,Rl).start();return await((ct=(ut=Kt(this,Os).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,Os).config).onSettled)==null?void 0:xt.call(ft,Pt,null,this.state.variables,this.state.context,this)),await((yt=(vt=this.options).onSettled)==null?void 0:yt.call(vt,Pt,null,et,this.state.context)),Fr(this,yo,Uo).call(this,{type:"success",data:Pt}),Pt}catch(Pt){try{throw await((bt=(Et=Kt(this,Os).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,Os).config).onSettled)==null?void 0:Ct.call(Rt,void 0,Pt,this.state.variables,this.state.context,this)),await((jt=(It=this.options).onSettled)==null?void 0:jt.call(It,void 0,Pt,et,this.state.context)),Pt}finally{Fr(this,yo,Uo).call(this,{type:"error",error:Pt})}}finally{Kt(this,Os).runNext(this)}}},vo=new WeakMap,Os=new WeakMap,Rl=new WeakMap,yo=new WeakSet,Uo=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,vo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,Os).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 Js,Nu,Zp,MutationCache=(Zp=class extends Subscribable{constructor(et={}){super();Or(this,Js);Or(this,Nu);this.config=et,Sr(this,Js,new Map),Sr(this,Nu,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++A1(this,Nu)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Js).get(rt)??[];st.push(et),Kt(this,Js).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Js).has(rt)){const nt=(st=Kt(this,Js).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Js).delete(rt):Kt(this,Js).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Js).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,Js).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,Js).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))))}},Js=new WeakMap,Nu=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,vt;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=((vt=et.state.data)==null?void 0:vt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let yt=!1;const Et=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?yt=!0:et.signal.addEventListener("abort",()=>{yt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),wt=async(St,Rt,Ct)=>{if(yt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const It={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(It);const jt=await bt(It),{maxPages:Pt}=et.options,Ot=Ct?addToStart:addToEnd;return{pages:Ot(St.pages,jt,Pt),pageParams:Ot(St.pageParams,Rt,Pt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},It=Rt(st,Ct);lt=await wt(Ct,It,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 yt,Et;return(Et=(yt=et.options).persister)==null?void 0:Et.call(yt,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 us,Go,Wo,su,nu,qo,iu,ou,Jp,QueryClient=(Jp=class{constructor(tt={}){Or(this,us);Or(this,Go);Or(this,Wo);Or(this,su);Or(this,nu);Or(this,qo);Or(this,iu);Or(this,ou);Sr(this,us,tt.queryCache||new QueryCache),Sr(this,Go,tt.mutationCache||new MutationCache),Sr(this,Wo,tt.defaultOptions||{}),Sr(this,su,new Map),Sr(this,nu,new Map),Sr(this,qo,0)}mount(){A1(this,qo)._++,Kt(this,qo)===1&&(Sr(this,iu,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onFocus())})),Sr(this,ou,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onOnline())})))}unmount(){var tt,et;A1(this,qo)._--,Kt(this,qo)===0&&((tt=Kt(this,iu))==null||tt.call(this),Sr(this,iu,void 0),(et=Kt(this,ou))==null||et.call(this),Sr(this,ou,void 0))}isFetching(tt){return Kt(this,us).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Go).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,us).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,us).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,us).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,us).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,us).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,us).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,us);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,us),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,us).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,us).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,us).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,us).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,Go).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,us)}getMutationCache(){return Kt(this,Go)}getDefaultOptions(){return Kt(this,Wo)}setDefaultOptions(tt){Sr(this,Wo,tt)}setQueryDefaults(tt,et){Kt(this,su).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,su).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,nu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,nu).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,Wo).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,Wo).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,us).clear(),Kt(this,Go).clear()}},us=new WeakMap,Go=new WeakMap,Wo=new WeakMap,su=new WeakMap,nu=new WeakMap,qo=new WeakMap,iu=new WeakMap,ou=new WeakMap,Jp),Hs,Gr,Fu,Ds,Tl,au,Xo,Eo,Bu,lu,uu,Cl,Al,Yo,cu,Qr,Iu,Y0,K0,Q0,Z0,J0,_d,e2,nm,em,QueryObserver=(em=class extends Subscribable{constructor(et,rt){super();Or(this,Qr);Or(this,Hs);Or(this,Gr);Or(this,Fu);Or(this,Ds);Or(this,Tl);Or(this,au);Or(this,Xo);Or(this,Eo);Or(this,Bu);Or(this,lu);Or(this,uu);Or(this,Cl);Or(this,Al);Or(this,Yo);Or(this,cu,new Set);this.options=rt,Sr(this,Hs,et),Sr(this,Eo,null),Sr(this,Xo,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Xo).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,Gr).addObserver(this),shouldFetchOnMount(Kt(this,Gr),this.options)?Fr(this,Qr,Iu).call(this):this.updateResult(),Fr(this,Qr,Z0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fr(this,Qr,J0).call(this),Fr(this,Qr,_d).call(this),Kt(this,Gr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Gr);if(this.options=Kt(this,Hs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Gr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fr(this,Qr,e2).call(this),Kt(this,Gr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Hs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Gr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Gr),nt,this.options,st)&&Fr(this,Qr,Iu).call(this),this.updateResult(rt),ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||resolveStaleTime(this.options.staleTime,Kt(this,Gr))!==resolveStaleTime(st.staleTime,Kt(this,Gr)))&&Fr(this,Qr,Y0).call(this);const at=Fr(this,Qr,K0).call(this);ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||at!==Kt(this,Yo))&&Fr(this,Qr,Q0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Sr(this,Ds,st),Sr(this,au,this.options),Sr(this,Tl,Kt(this,Gr).state)),st}getCurrentResult(){return Kt(this,Ds)}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,cu).add(et)}getCurrentQuery(){return Kt(this,Gr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Hs).defaultQueryOptions(et),st=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Fr(this,Qr,Iu).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Ds)))}createResult(et,rt){var Pt;const st=Kt(this,Gr),nt=this.options,ot=Kt(this,Ds),at=Kt(this,Tl),lt=Kt(this,au),ct=et!==st?et.state:Kt(this,Fu),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const Ot=this.hasListeners(),Ut=!Ot&&shouldFetchOnMount(et,rt),Nt=Ot&&shouldFetchOptionally(et,st,rt,nt);(Ut||Nt)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:vt,errorUpdatedAt:yt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,Bu))xt=Kt(this,lu);else try{Sr(this,Bu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Sr(this,lu,xt),Sr(this,Eo,null)}catch(Ot){Sr(this,Eo,Ot)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Ot;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Ot=ot.data;else if(Ot=typeof rt.placeholderData=="function"?rt.placeholderData((Pt=Kt(this,uu))==null?void 0:Pt.state.data,Kt(this,uu)):rt.placeholderData,rt.select&&Ot!==void 0)try{Ot=rt.select(Ot),Sr(this,Eo,null)}catch(Ut){Sr(this,Eo,Ut)}Ot!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Ot,rt),ft=!0)}Kt(this,Eo)&&(vt=Kt(this,Eo),xt=Kt(this,lu),yt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",wt=Et==="pending",St=Et==="error",Rt=wt&&bt,Ct=xt!==void 0,jt={status:Et,fetchStatus:ht.fetchStatus,isPending:wt,isSuccess:Et==="success",isError:St,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:vt,errorUpdatedAt:yt,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,Xo)};if(this.options.experimental_prefetchInRender){const Ot=Ht=>{jt.status==="error"?Ht.reject(jt.error):jt.data!==void 0&&Ht.resolve(jt.data)},Ut=()=>{const Ht=Sr(this,Xo,jt.promise=pendingThenable());Ot(Ht)},Nt=Kt(this,Xo);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&Ot(Nt);break;case"fulfilled":(jt.status==="error"||jt.data!==Nt.value)&&Ut();break;case"rejected":(jt.status!=="error"||jt.error!==Nt.reason)&&Ut();break}}return jt}updateResult(et){const rt=Kt(this,Ds),st=this.createResult(Kt(this,Gr),this.options);if(Sr(this,Tl,Kt(this,Gr).state),Sr(this,au,this.options),Kt(this,Tl).data!==void 0&&Sr(this,uu,Kt(this,Gr)),shallowEqualObjects(st,rt))return;Sr(this,Ds,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,cu).size)return!0;const ut=new Set(lt??Kt(this,cu));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Ds)).some(ct=>{const dt=ct;return Kt(this,Ds)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Fr(this,Qr,nm).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fr(this,Qr,Z0).call(this)}},Hs=new WeakMap,Gr=new WeakMap,Fu=new WeakMap,Ds=new WeakMap,Tl=new WeakMap,au=new WeakMap,Xo=new WeakMap,Eo=new WeakMap,Bu=new WeakMap,lu=new WeakMap,uu=new WeakMap,Cl=new WeakMap,Al=new WeakMap,Yo=new WeakMap,cu=new WeakMap,Qr=new WeakSet,Iu=function(et){Fr(this,Qr,e2).call(this);let rt=Kt(this,Gr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},Y0=function(){Fr(this,Qr,J0).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Gr));if(isServer||Kt(this,Ds).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Ds).dataUpdatedAt,et)+1;Sr(this,Cl,setTimeout(()=>{Kt(this,Ds).isStale||this.updateResult()},st))},K0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Gr)):this.options.refetchInterval)??!1},Q0=function(et){Fr(this,Qr,_d).call(this),Sr(this,Yo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Gr))===!1||!isValidTimeout(Kt(this,Yo))||Kt(this,Yo)===0)&&Sr(this,Al,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Fr(this,Qr,Iu).call(this)},Kt(this,Yo)))},Z0=function(){Fr(this,Qr,Y0).call(this),Fr(this,Qr,Q0).call(this,Fr(this,Qr,K0).call(this))},J0=function(){Kt(this,Cl)&&(clearTimeout(Kt(this,Cl)),Sr(this,Cl,void 0))},_d=function(){Kt(this,Al)&&(clearInterval(Kt(this,Al)),Sr(this,Al,void 0))},e2=function(){const et=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),this.options);if(et===Kt(this,Gr))return;const rt=Kt(this,Gr);Sr(this,Gr,et),Sr(this,Fu,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,Ds))}),Kt(this,Hs).getQueryCache().notify({query:Kt(this,Gr),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 vt,yt;const{state:rt}=tt,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(yt=(vt=rt.fetchMeta)==null?void 0:vt.fetchMore)==null?void 0:yt.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}}},Ko,Qo,Vs,Po,jo,P1,t2,tm,MutationObserver$1=(tm=class extends Subscribable{constructor(rt,st){super();Or(this,jo);Or(this,Ko);Or(this,Qo);Or(this,Vs);Or(this,Po);Sr(this,Ko,rt),this.setOptions(st),this.bindMethods(),Fr(this,jo,P1).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,Ko).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,Ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,Vs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,Vs))==null?void 0:nt.state.status)==="pending"&&Kt(this,Vs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,Vs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Fr(this,jo,P1).call(this),Fr(this,jo,t2).call(this,rt)}getCurrentResult(){return Kt(this,Qo)}reset(){var rt;(rt=Kt(this,Vs))==null||rt.removeObserver(this),Sr(this,Vs,void 0),Fr(this,jo,P1).call(this),Fr(this,jo,t2).call(this)}mutate(rt,st){var nt;return Sr(this,Po,st),(nt=Kt(this,Vs))==null||nt.removeObserver(this),Sr(this,Vs,Kt(this,Ko).getMutationCache().build(Kt(this,Ko),this.options)),Kt(this,Vs).addObserver(this),Kt(this,Vs).execute(rt)}},Ko=new WeakMap,Qo=new WeakMap,Vs=new WeakMap,Po=new WeakMap,jo=new WeakSet,P1=function(){var st;const rt=((st=Kt(this,Vs))==null?void 0:st.state)??getDefaultState();Sr(this,Qo,{...rt,isPending:rt.status==="pending",isSuccess:rt.status==="success",isError:rt.status==="error",isIdle:rt.status==="idle",mutate:this.mutate,reset:this.reset})},t2=function(rt){notifyManager.batch(()=>{var st,nt,ot,at,lt,ut,ct,dt;if(Kt(this,Po)&&this.hasListeners()){const ht=Kt(this,Qo).variables,ft=Kt(this,Qo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,Po)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,Po)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,Po)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,Po)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}this.listeners.forEach(ht=>{ht(Kt(this,Qo))})})},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,vt;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(yt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(yt));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 yt=lt?fetchOptimistic(at,ut,ot):(vt=st.getQueryCache().get(at.queryHash))==null?void 0:vt.promise;yt==null||yt.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",vt="date",yt="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 $t=["th","st","nd","rd"],Ft=kt%100;return"["+kt+($t[(Ft-20)%10]||$t[Ft]||$t[0])+"]"}},St=function(kt,$t,Ft){var Gt=String(kt);return!Gt||Gt.length>=$t?kt:""+Array($t+1-Gt.length).join(Ft)+kt},Rt={s:St,z:function(kt){var $t=-kt.utcOffset(),Ft=Math.abs($t),Gt=Math.floor(Ft/60),Mt=Ft%60;return($t<=0?"+":"-")+St(Gt,2,"0")+":"+St(Mt,2,"0")},m:function kt($t,Ft){if($t.date()<Ft.date())return-kt(Ft,$t);var Gt=12*(Ft.year()-$t.year())+(Ft.month()-$t.month()),Mt=$t.clone().add(Gt,ht),Vt=Ft-Mt<0,Bt=$t.clone().add(Gt+(Vt?-1:1),ht);return+(-(Gt+(Ft-Mt)/(Vt?Mt-Bt:Bt-Mt))||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:vt,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",It={};It[Ct]=wt;var jt="$isDayjsObject",Pt=function(kt){return kt instanceof Ht||!(!kt||!kt[jt])},Ot=function kt($t,Ft,Gt){var Mt;if(!$t)return Ct;if(typeof $t=="string"){var Vt=$t.toLowerCase();It[Vt]&&(Mt=Vt),Ft&&(It[Vt]=Ft,Mt=Vt);var Bt=$t.split("-");if(!Mt&&Bt.length>1)return kt(Bt[0])}else{var qt=$t.name;It[qt]=$t,Mt=qt}return!Gt&&Mt&&(Ct=Mt),Mt||!Gt&&Ct},Ut=function(kt,$t){if(Pt(kt))return kt.clone();var Ft=typeof $t=="object"?$t:{};return Ft.date=kt,Ft.args=arguments,new Ht(Ft)},Nt=Rt;Nt.l=Ot,Nt.i=Pt,Nt.w=function(kt,$t){return Ut(kt,{locale:$t.$L,utc:$t.$u,x:$t.$x,$offset:$t.$offset})};var Ht=function(){function kt(Ft){this.$L=Ot(Ft.locale,null,!0),this.parse(Ft),this.$x=this.$x||Ft.x||{},this[jt]=!0}var $t=kt.prototype;return $t.parse=function(Ft){this.$d=function(Gt){var Mt=Gt.date,Vt=Gt.utc;if(Mt===null)return new Date(NaN);if(Nt.u(Mt))return new Date;if(Mt instanceof Date)return new Date(Mt);if(typeof Mt=="string"&&!/Z$/i.test(Mt)){var Bt=Mt.match(Et);if(Bt){var qt=Bt[2]-1||0,Qt=(Bt[7]||"0").substring(0,3);return Vt?new Date(Date.UTC(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)):new Date(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)}}return new Date(Mt)}(Ft),this.init()},$t.init=function(){var Ft=this.$d;this.$y=Ft.getFullYear(),this.$M=Ft.getMonth(),this.$D=Ft.getDate(),this.$W=Ft.getDay(),this.$H=Ft.getHours(),this.$m=Ft.getMinutes(),this.$s=Ft.getSeconds(),this.$ms=Ft.getMilliseconds()},$t.$utils=function(){return Nt},$t.isValid=function(){return this.$d.toString()!==yt},$t.isSame=function(Ft,Gt){var Mt=Ut(Ft);return this.startOf(Gt)<=Mt&&Mt<=this.endOf(Gt)},$t.isAfter=function(Ft,Gt){return Ut(Ft)<this.startOf(Gt)},$t.isBefore=function(Ft,Gt){return this.endOf(Gt)<Ut(Ft)},$t.$g=function(Ft,Gt,Mt){return Nt.u(Ft)?this[Gt]:this.set(Mt,Ft)},$t.unix=function(){return Math.floor(this.valueOf()/1e3)},$t.valueOf=function(){return this.$d.getTime()},$t.startOf=function(Ft,Gt){var Mt=this,Vt=!!Nt.u(Gt)||Gt,Bt=Nt.p(Ft),qt=function(or,hr){var pr=Nt.w(Mt.$u?Date.UTC(Mt.$y,hr,or):new Date(Mt.$y,hr,or),Mt);return Vt?pr:pr.endOf(ct)},Qt=function(or,hr){return Nt.w(Mt.toDate()[or].apply(Mt.toDate("s"),(Vt?[0,0,0,0]:[23,59,59,999]).slice(hr)),Mt)},Yt=this.$W,tr=this.$M,lr=this.$D,ur="set"+(this.$u?"UTC":"");switch(Bt){case xt:return Vt?qt(1,0):qt(31,11);case ht:return Vt?qt(1,tr):qt(0,tr+1);case dt:var mr=this.$locale().weekStart||0,yr=(Yt<mr?Yt+7:Yt)-mr;return qt(Vt?lr-yr:lr+(6-yr),tr);case ct:case vt:return Qt(ur+"Hours",0);case ut:return Qt(ur+"Minutes",1);case lt:return Qt(ur+"Seconds",2);case at:return Qt(ur+"Milliseconds",3);default:return this.clone()}},$t.endOf=function(Ft){return this.startOf(Ft,!1)},$t.$set=function(Ft,Gt){var Mt,Vt=Nt.p(Ft),Bt="set"+(this.$u?"UTC":""),qt=(Mt={},Mt[ct]=Bt+"Date",Mt[vt]=Bt+"Date",Mt[ht]=Bt+"Month",Mt[xt]=Bt+"FullYear",Mt[ut]=Bt+"Hours",Mt[lt]=Bt+"Minutes",Mt[at]=Bt+"Seconds",Mt[ot]=Bt+"Milliseconds",Mt)[Vt],Qt=Vt===ct?this.$D+(Gt-this.$W):Gt;if(Vt===ht||Vt===xt){var Yt=this.clone().set(vt,1);Yt.$d[qt](Qt),Yt.init(),this.$d=Yt.set(vt,Math.min(this.$D,Yt.daysInMonth())).$d}else qt&&this.$d[qt](Qt);return this.init(),this},$t.set=function(Ft,Gt){return this.clone().$set(Ft,Gt)},$t.get=function(Ft){return this[Nt.p(Ft)]()},$t.add=function(Ft,Gt){var Mt,Vt=this;Ft=Number(Ft);var Bt=Nt.p(Gt),qt=function(tr){var lr=Ut(Vt);return Nt.w(lr.date(lr.date()+Math.round(tr*Ft)),Vt)};if(Bt===ht)return this.set(ht,this.$M+Ft);if(Bt===xt)return this.set(xt,this.$y+Ft);if(Bt===ct)return qt(1);if(Bt===dt)return qt(7);var Qt=(Mt={},Mt[lt]=st,Mt[ut]=nt,Mt[at]=rt,Mt)[Bt]||1,Yt=this.$d.getTime()+Ft*Qt;return Nt.w(Yt,this)},$t.subtract=function(Ft,Gt){return this.add(-1*Ft,Gt)},$t.format=function(Ft){var Gt=this,Mt=this.$locale();if(!this.isValid())return Mt.invalidDate||yt;var Vt=Ft||"YYYY-MM-DDTHH:mm:ssZ",Bt=Nt.z(this),qt=this.$H,Qt=this.$m,Yt=this.$M,tr=Mt.weekdays,lr=Mt.months,ur=Mt.meridiem,mr=function(hr,pr,_r,Ar){return hr&&(hr[pr]||hr(Gt,Vt))||_r[pr].slice(0,Ar)},yr=function(hr){return Nt.s(qt%12||12,hr,"0")},or=ur||function(hr,pr,_r){var Ar=hr<12?"AM":"PM";return _r?Ar.toLowerCase():Ar};return Vt.replace(bt,function(hr,pr){return pr||function(_r){switch(_r){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Nt.s(Gt.$y,4,"0");case"M":return Yt+1;case"MM":return Nt.s(Yt+1,2,"0");case"MMM":return mr(Mt.monthsShort,Yt,lr,3);case"MMMM":return mr(lr,Yt);case"D":return Gt.$D;case"DD":return Nt.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return mr(Mt.weekdaysMin,Gt.$W,tr,2);case"ddd":return mr(Mt.weekdaysShort,Gt.$W,tr,3);case"dddd":return tr[Gt.$W];case"H":return String(qt);case"HH":return Nt.s(qt,2,"0");case"h":return yr(1);case"hh":return yr(2);case"a":return or(qt,Qt,!0);case"A":return or(qt,Qt,!1);case"m":return String(Qt);case"mm":return Nt.s(Qt,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 Bt}return null}(hr)||Bt.replace(":","")})},$t.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$t.diff=function(Ft,Gt,Mt){var Vt,Bt=this,qt=Nt.p(Gt),Qt=Ut(Ft),Yt=(Qt.utcOffset()-this.utcOffset())*st,tr=this-Qt,lr=function(){return Nt.m(Bt,Qt)};switch(qt){case xt:Vt=lr()/12;break;case ht:Vt=lr();break;case ft:Vt=lr()/3;break;case dt:Vt=(tr-Yt)/6048e5;break;case ct:Vt=(tr-Yt)/864e5;break;case ut:Vt=tr/nt;break;case lt:Vt=tr/st;break;case at:Vt=tr/rt;break;default:Vt=tr}return Mt?Vt:Nt.a(Vt)},$t.daysInMonth=function(){return this.endOf(ht).$D},$t.$locale=function(){return It[this.$L]},$t.locale=function(Ft,Gt){if(!Ft)return this.$L;var Mt=this.clone(),Vt=Ot(Ft,Gt,!0);return Vt&&(Mt.$L=Vt),Mt},$t.clone=function(){return Nt.w(this.$d,this)},$t.toDate=function(){return new Date(this.valueOf())},$t.toJSON=function(){return this.isValid()?this.toISOString():null},$t.toISOString=function(){return this.$d.toISOString()},$t.toString=function(){return this.$d.toUTCString()},kt}(),Lt=Ht.prototype;return Ut.prototype=Lt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",vt]].forEach(function(kt){Lt[kt[1]]=function($t){return this.$g($t,kt[0],kt[1])}}),Ut.extend=function(kt,$t){return kt.$i||(kt($t,Ht,Ut),kt.$i=!0),Ut},Ut.locale=Ot,Ut.isDayjs=Pt,Ut.unix=function(kt){return Ut(1e3*kt)},Ut.en=It[Ct],Ut.Ls=It,Ut.p={},Ut})})(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(yt){return(yt=+yt)+(yt>68?1900:2e3)},ct=function(yt){return function(Et){this[yt]=+Et}},dt=[/[+-]\d\d:?(\d\d)?|Z/,function(yt){(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}(yt)}],ht=function(yt){var Et=lt[yt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},ft=function(yt,Et){var bt,wt=lt.meridiem;if(wt){for(var St=1;St<=24;St+=1)if(yt.indexOf(wt(St,0,Et))>-1){bt=St>12;break}}else bt=yt===(Et?"pm":"PM");return bt},xt={A:[at,function(yt){this.afternoon=ft(yt,!1)}],a:[at,function(yt){this.afternoon=ft(yt,!0)}],S:[/\d/,function(yt){this.milliseconds=100*+yt}],SS:[nt,function(yt){this.milliseconds=10*+yt}],SSS:[/\d{3}/,function(yt){this.milliseconds=+yt}],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(yt){var Et=lt.ordinal,bt=yt.match(/\d+/);if(this.day=bt[0],Et)for(var wt=1;wt<=31;wt+=1)Et(wt).replace(/\[|\]/g,"")===yt&&(this.day=wt)}],M:[ot,ct("month")],MM:[nt,ct("month")],MMM:[at,function(yt){var Et=ht("months"),bt=(ht("monthsShort")||Et.map(function(wt){return wt.slice(0,3)})).indexOf(yt)+1;if(bt<1)throw new Error;this.month=bt%12||bt}],MMMM:[at,function(yt){var Et=ht("months").indexOf(yt)+1;if(Et<1)throw new Error;this.month=Et%12||Et}],Y:[/[+-]?\d+/,ct("year")],YY:[nt,function(yt){this.year=ut(yt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function vt(yt){var Et,bt;Et=yt,bt=lt&<.formats;for(var wt=(yt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Ot,Ut,Nt){var Ht=Nt&&Nt.toUpperCase();return Ut||bt[Nt]||rt[Nt]||bt[Ht].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Lt,kt,$t){return kt||$t.slice(1)})})).match(st),St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt],It=xt[Ct],jt=It&&It[0],Pt=It&&It[1];wt[Rt]=Pt?{regex:jt,parser:Pt}:Ct.replace(/^\[|\]$/g,"")}return function(Ot){for(var Ut={},Nt=0,Ht=0;Nt<St;Nt+=1){var Lt=wt[Nt];if(typeof Lt=="string")Ht+=Lt.length;else{var kt=Lt.regex,$t=Lt.parser,Ft=Ot.slice(Ht),Gt=kt.exec(Ft)[0];$t.call(Ut,Gt),Ot=Ot.replace(Gt,"")}}return function(Mt){var Vt=Mt.afternoon;if(Vt!==void 0){var Bt=Mt.hours;Vt?Bt<12&&(Mt.hours+=12):Bt===12&&(Mt.hours=0),delete Mt.afternoon}}(Ut),Ut}}return function(yt,Et,bt){bt.p.customParseFormat=!0,yt&&yt.parseTwoDigitYear&&(ut=yt.parseTwoDigitYear);var wt=Et.prototype,St=wt.parse;wt.parse=function(Rt){var Ct=Rt.date,It=Rt.utc,jt=Rt.args;this.$u=It;var Pt=jt[1];if(typeof Pt=="string"){var Ot=jt[2]===!0,Ut=jt[3]===!0,Nt=Ot||Ut,Ht=jt[2];Ut&&(Ht=jt[2]),lt=this.$locale(),!Ot&&Ht&&(lt=bt.Ls[Ht]),this.$d=function(Ft,Gt,Mt){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*Ft);var Vt=vt(Gt)(Ft),Bt=Vt.year,qt=Vt.month,Qt=Vt.day,Yt=Vt.hours,tr=Vt.minutes,lr=Vt.seconds,ur=Vt.milliseconds,mr=Vt.zone,yr=new Date,or=Qt||(Bt||qt?1:yr.getDate()),hr=Bt||yr.getFullYear(),pr=0;Bt&&!qt||(pr=qt>0?qt-1:yr.getMonth());var _r=Yt||0,Ar=tr||0,Hr=lr||0,Ur=ur||0;return mr?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur+60*mr.offset*1e3)):Mt?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur)):new Date(hr,pr,or,_r,Ar,Hr,Ur)}catch{return new Date("")}}(Ct,Pt,It),this.init(),Ht&&Ht!==!0&&(this.$L=this.locale(Ht).$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){jt[1]=Pt[kt-1];var $t=bt.apply(this,jt);if($t.isValid()){this.$d=$t.$d,this.$L=$t.$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,vt,yt){var Et=yt&&yt.toUpperCase();return vt||ft[yt]||rt[yt]||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 vt,yt,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&&(vt=ft?nt(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var It=(rt.rounding||Math.round)(Math.abs(vt));if(Et=vt>0,It<=Ct.r||!Ct.r){It<=1&&Rt>0&&(Ct=wt[Rt-1]);var jt=bt[Ct.l];xt&&(It=xt(""+It)),yt=typeof jt=="string"?jt.replace("%d",It):jt(It,dt,Ct.l,Et);break}}if(dt)return yt;var Pt=Et?bt.future:bt.past;return typeof Pt=="function"?Pt(yt):Pt.replace("%s",yt)},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=>{if(typeof window=="object"){let et=(tt?tt.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return et.nonce=window.__nonce__,et.parentNode||(tt||document.head).appendChild(et),et.firstChild}return tt||e$1},l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$2=/\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$1={},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$1[ot]||(c$1[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$1[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$2," ").trim(),ft.unshift(ft[0][ht]=ft[0][ht]||{})):ft[0][dt[1]]=dt[2].replace(n$2," ").trim();return ft[0]})(tt);c$1[at]=o$1(nt?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$1.g?c$1.g:null;return rt&&(c$1.g=c$1[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$1[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$1(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$1.bind({g:1});let h$2=u$1.bind({k:1});function m$1(tt,et,rt,st){o$1.p=et,d$1=tt,f$2=rt,g$1=st}function w$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$1.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 Z$1=tt=>typeof tt=="function",h$1=(tt,et)=>Z$1(tt)?tt(et):tt,W$2=(()=>{let tt=0;return()=>(++tt).toString()})(),E$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),re$1=20,k$2="default",H$3=(tt,et)=>{let{toastLimit:rt}=tt.settings;switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,rt)};case 1:return{...tt,toasts:tt.toasts.map(at=>at.id===et.toast.id?{...at,...et.toast}:at)};case 2:let{toast:st}=et;return H$3(tt,{type:tt.toasts.find(at=>at.id===st.id)?1:0,toast:st});case 3:let{toastId:nt}=et;return{...tt,toasts:tt.toasts.map(at=>at.id===nt||nt===void 0?{...at,dismissed:!0,visible:!1}:at)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(at=>at.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let ot=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(at=>({...at,pauseDuration:at.pauseDuration+ot}))}}},v$1=[],j$2={toasts:[],pausedAt:void 0,settings:{toastLimit:re$1}},f$1={},Y$1=(tt,et=k$2)=>{f$1[et]=H$3(f$1[et]||j$2,tt),v$1.forEach(([rt,st])=>{rt===et&&st(f$1[et])})},_$1=tt=>Object.keys(f$1).forEach(et=>Y$1(tt,et)),Q$1=tt=>Object.keys(f$1).find(et=>f$1[et].toasts.some(rt=>rt.id===tt)),S$1=(tt=k$2)=>et=>{Y$1(et,tt)},se$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},V$1=(tt={},et=k$2)=>{let[rt,st]=reactExports.useState(f$1[et]||j$2),nt=reactExports.useRef(f$1[et]);reactExports.useEffect(()=>(nt.current!==f$1[et]&&st(f$1[et]),v$1.push([et,st]),()=>{let at=v$1.findIndex(([lt])=>lt===et);at>-1&&v$1.splice(at,1)}),[et]);let ot=rt.toasts.map(at=>{var lt,ut,ct;return{...tt,...tt[at.type],...at,removeDelay:at.removeDelay||((lt=tt[at.type])==null?void 0:lt.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:at.duration||((ut=tt[at.type])==null?void 0:ut.duration)||(tt==null?void 0:tt.duration)||se$1[at.type],style:{...tt.style,...(ct=tt[at.type])==null?void 0:ct.style,...at.style}}});return{...rt,toasts:ot}},ie$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)||W$2()}),P$1=tt=>(et,rt)=>{let st=ie$1(et,tt,rt);return S$1(st.toasterId||Q$1(st.id))({type:2,toast:st}),st.id},n$1=(tt,et)=>P$1("blank")(tt,et);n$1.error=P$1("error");n$1.success=P$1("success");n$1.loading=P$1("loading");n$1.custom=P$1("custom");n$1.dismiss=(tt,et)=>{let rt={type:3,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.dismissAll=tt=>n$1.dismiss(void 0,tt);n$1.remove=(tt,et)=>{let rt={type:4,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.removeAll=tt=>n$1.remove(void 0,tt);n$1.promise=(tt,et,rt)=>{let st=n$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(nt=>{let ot=et.success?h$1(et.success,nt):void 0;return ot?n$1.success(ot,{id:st,...rt,...rt==null?void 0:rt.success}):n$1.dismiss(st),nt}).catch(nt=>{let ot=et.error?h$1(et.error,nt):void 0;ot?n$1.error(ot,{id:st,...rt,...rt==null?void 0:rt.error}):n$1.dismiss(st)}),tt};var ce$1=1e3,w$1=(tt,et="default")=>{let{toasts:rt,pausedAt:st}=V$1(tt,et),nt=reactExports.useRef(new Map).current,ot=reactExports.useCallback((ht,ft=ce$1)=>{if(nt.has(ht))return;let xt=setTimeout(()=>{nt.delete(ht),at({type:4,toastId:ht})},ft);nt.set(ht,xt)},[]);reactExports.useEffect(()=>{if(st)return;let ht=Date.now(),ft=rt.map(xt=>{if(xt.duration===1/0)return;let vt=(xt.duration||0)+xt.pauseDuration-(ht-xt.createdAt);if(vt<0){xt.visible&&n$1.dismiss(xt.id);return}return setTimeout(()=>n$1.dismiss(xt.id,et),vt)});return()=>{ft.forEach(xt=>xt&&clearTimeout(xt))}},[rt,st,et]);let at=reactExports.useCallback(S$1(et),[et]),lt=reactExports.useCallback(()=>{at({type:5,time:Date.now()})},[at]),ut=reactExports.useCallback((ht,ft)=>{at({type:1,toast:{id:ht,height:ft}})},[at]),ct=reactExports.useCallback(()=>{st&&at({type:6,time:Date.now()})},[st,at]),dt=reactExports.useCallback((ht,ft)=>{let{reverseOrder:xt=!1,gutter:vt=8,defaultPosition:yt}=ft||{},Et=rt.filter(St=>(St.position||yt)===(ht.position||yt)&&St.height),bt=Et.findIndex(St=>St.id===ht.id),wt=Et.filter((St,Rt)=>Rt<bt&&St.visible).length;return Et.filter(St=>St.visible).slice(...xt?[wt+1]:[0,wt]).reduce((St,Rt)=>St+(Rt.height||0)+vt,0)},[rt]);return reactExports.useEffect(()=>{rt.forEach(ht=>{if(ht.dismissed)ot(ht.id,ht.removeDelay);else{let ft=nt.get(ht.id);ft&&(clearTimeout(ft),nt.delete(ht.id))}})},[rt,ot]),{toasts:rt,handlers:{updateHeight:ut,startPause:lt,endPause:ct,calculateOffset:dt}}},de$1=h$2`
|
|
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"],vt=>{delete ot[vt]}),rt.headers=AxiosHeaders$1.concat(at,ot);const lt=[];let ut=!0;this.interceptors.request.forEach(function(yt){typeof yt.runWhen=="function"&&yt.runWhen(rt)===!1||(ut=ut&&yt.synchronous,lt.unshift(yt.fulfilled,yt.rejected))});const ct=[];this.interceptors.response.forEach(function(yt){ct.push(yt.fulfilled,yt.rejected)});let dt,ht=0,ft;if(!ut){const vt=[dispatchRequest.bind(this),void 0];for(vt.unshift(...lt),vt.push(...ct),ft=vt.length,dt=Promise.resolve(rt);ht<ft;)dt=dt.then(vt[ht++],vt[ht++]);return dt}ft=lt.length;let xt=rt;for(;ht<ft;){const vt=lt[ht++],yt=lt[ht++];try{xt=vt(xt)}catch(Et){yt.call(this,Et);break}}try{dt=dispatchRequest.call(this,xt)}catch(vt){return Promise.reject(vt)}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$3(tt){const et=new Date().getTime(),rt=tt.includes("?")?"&":"?";return`${tt}${rt}timestamp=${et}`}const c$2=(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((vt,yt)=>{ut.toBlob(Et=>{Et?vt(new File([Et],rt,{type:ct,lastModified:new Date().getTime()})):yt()},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$5=(tt,et,rt)=>d$2(tt,typeof et!="symbol"?et+"":et,rt);const o$3=class{constructor(){n$5(this,"wordExtensions",new Set),n$5(this,"excelExtensions",new Set),n$5(this,"pptExtensions",new Set),n$5(this,"fileExtensionMap",new Map),n$5(this,"csvContentType",new Set),n$5(this,"csvExtensions",new Set),n$5(this,"txtExtensions",new Set),n$5(this,"mdExtensions",new Set),n$5(this,"PDF","application/pdf"),n$5(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$5(o$3,"INSTANCE",new o$3);let a$2=o$3;const n$4=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$2=Object.defineProperty,T$1=(tt,et,rt)=>et in tt?v$2(tt,et,{enumerable:!0,configurable:!0,writable:!0,value:rt}):tt[et]=rt,n$3=(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$3(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$3(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$3(this,"_resolution"),n$3(this,"_rejection"),n$3(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$3(this,"promises",{}),n$3(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$3(this,"axios"),n$3(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$3(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$3(this,"_me",null),n$3(this,"_currentLanguage",""),n$3(this,"_notLoggedIn",!0),n$3(this,"_description"),n$3(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$3(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$3(this,"_conf"),n$3(this,"_loaded"),n$3(this,"skinName",""),n$3(this,"themeName",""),n$3(this,"skin","raw"),n$3(this,"themeUrl","/assets/themes/raw/default/"),n$3(this,"templateOverrides",{}),n$3(this,"portalTemplate","/assets/themes/raw/portal.html"),n$3(this,"basePath",""),n$3(this,"logoutCallback",""),n$3(this,"skins",[]),n$3(this,"is1D",!1),n$3(this,"is2D",!1),n$3(this,"_onSkinReady",notify.onSkinReady()),n$3(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$3(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$3(this,"_me",null),n$3(this,"_keepOpenOnLogout",!1),n$3(this,"_preferences",new UserPreferences),n$3(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$3(this,"_publicConf",{}),n$3(this,"_currentApp"),n$3(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$3(this,"_status","void"),n$3(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$3(this,"Platform",{deploymentTag:"",cdnDomain:"",apps:new AppConf,theme:new Theme,analytics:new Analytics,idiom:new Idiom,listLanguages:()=>transport.http.get("/languages")}),n$3(this,"School",{}),n$3(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 m$2=class{constructor(et){n$3(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$3(m$2,"registry",new ServiceRegistry),n$3(m$2,"register",m$2.registry.register.bind(m$2.registry)),n$3(m$2,"findService",m$2.registry.findService.bind(m$2.registry)),n$3(m$2,"findMainService",m$2.registry.findMainService.bind(m$2.registry)),n$3(m$2,"isRegistered",m$2.registry.isRegistered.bind(m$2.registry));let ResourceService=m$2;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,nbUsers:ut})=>({nbUsers:ut,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:vt,users:yt}=await this.getBookMarkById(ht),Et=yt.map(wt=>wt.id),bt=xt.map(wt=>wt.id);return{displayName:ft,id:vt,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$3(this,"axios"),n$3(this,"baseUrl"),n$3(this,"headers",{}),n$3(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 patch(et,rt,st){try{const nt=await this.axios.patch(this.fixBaseUrl(et),rt,this.toAxiosConfig(st));return this.mapAxiosResponse(nt,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchFile(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.patch(this.fixBaseUrl(et),rt,{...nt,headers:{"Content-Type":"multipart/form-data"}});return this.mapAxiosResponse(ot,st)}catch(nt){throw this.mapAxiosError(nt,st)}}async patchJson(et,rt,st){const nt=this.toAxiosConfig(st);nt.headers&&(nt.headers["Content-Type"]="application/json");try{const ot=await this.axios.patch(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(),vt=StringUtils.removeAccents(ut||"").toLowerCase(),yt=StringUtils.removeAccents(ht||"").toLowerCase();return vt.includes(nt)||xt.includes(nt)||ft.includes(nt)||yt.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(vt=>vt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const vt=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:vt.map(yt=>{const Et=lt[yt];return{displayName:yt,id:yt,priority:Et.priority}})}}).sort((xt,vt)=>(xt.displayName||"").localeCompare(vt.displayName)),ct=Object.keys(ot.groups.checked).map(xt=>ot.groups.visibles.find(vt=>vt.id===xt)).filter(xt=>xt!==void 0).map(xt=>{const vt=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:vt.map(yt=>{const Et=lt[yt];return{displayName:yt,id:yt,priority:Et.priority}})}}).sort((xt,vt)=>(xt.displayName||"").localeCompare(vt.displayName)),dt=[...ut,...ct],ht=ot.groups.visibles.map(({groupDisplayName:xt,id:vt,name:yt,labels:Et})=>({labels:Et,displayName:xt||yt,id:vt})),ft=ot.users.visibles.map(({id:xt,profile:vt,username:yt,firstName:Et,lastName:bt,login:wt})=>({displayName:yt,firstName:Et,lastName:bt,login:wt,profile:vt,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$1=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$3(R$1,"roleMappers",[tt=>Object.keys(defaultMappers).find(et=>defaultMappers[et](tt))]);let DocumentHelper=R$1;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 b$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$3(b$1,"MAX_WEIGHT",50),n$3(b$1,"MAX_DURATION",3);let VideoService=b$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$3(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$3(this,"APP","actualites"),n$3(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$3(this,"APP","blog"),n$3(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$3(this,"APP","collaborativewall"),n$3(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$3(this,"APP","community"),n$3(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$3(this,"APP","exercizer"),n$3(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$3(this,"APP","formulaire"),n$3(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$3(this,"APP","forum"),n$3(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$3(this,"APP","homeworks"),n$3(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$3(this,"APP","magneto"),n$3(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$3(this,"APP","mindmap"),n$3(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$3(this,"APP","pages"),n$3(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$3(this,"APP","poll"),n$3(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$3(this,"APP","scrapbook"),n$3(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$3(this,"APP","timelinegenerator"),n$3(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$3(this,"APP","wiki"),n$3(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$3(this,"APP","workspace"),n$3(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 w$3=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 registerCustomBehaviour(et,rt,st){this.registry.register({application:et,resourceType:rt},st)}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$3(w$3,"registry",new ServiceRegistry),n$3(w$3,"findBehaviour",w$3.registry.findService.bind(w$3.registry)),n$3(w$3,"hasBehaviour",w$3.registry.isRegistered.bind(w$3.registry)),n$3(w$3,"resourceProducingApps",[]);let SnipletsService=w$3;const SEND_ALL="*";class WebBroker{constructor(et){n$3(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$3(this,"_webBroker"),n$3(this,"app"),n$3(this,"user"),n$3(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:this.app||"video",video_id:et,browser:at,duration:Math.round(rt),weight:st,source:nt?"CAPTURED":"UPLOADED",url:ot});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$3(this,"_analytics"),n$3(this,"_cache"),n$3(this,"_conf"),n$3(this,"_data"),n$3(this,"_directory"),n$3(this,"_http"),n$3(this,"_idiom"),n$3(this,"_notify"),n$3(this,"_rights"),n$3(this,"_session"),n$3(this,"_share"),n$3(this,"_video"),n$3(this,"_workspace"),n$3(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$3(this,"_initialized"),n$3(this,"_widgets",[]),n$3(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$3(this,"_schoolConf",{}),n$3(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})},vt=tt.section?16:12,{t:yt}=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))},It=Pt=>jsxRuntimeExports.jsx(Pt?SvgIconRafterDown:SvgIconRafterRight,{title:yt("foldUnfold"),width:vt,height:vt}),jt=()=>{var Pt;const Ot=!((Pt=nt==null?void 0:nt.current)!=null&&Pt.has(tt.id)),Ut=Array.isArray(tt.children)&&tt.children.length>0;return dt||Ot&&Ut};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":yt("foldUnfold"),children:jt()&&It(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:yt("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,vt]=reactExports.useState(void 0),yt=ut??rt;function Et(Nt){var Ht;Array.isArray(Nt)?Nt.forEach(Lt=>{const kt=new Set(ft.current);Nt.filter(({id:$t})=>$t!==Lt.id).some($t=>$t.children&&$t.children.length>0)&&kt.add(Lt.id),Lt.children&&Lt.children.length>0&&Lt.children.forEach($t=>{var Ft;const Gt=(Ft=Lt.children)==null?void 0:Ft.filter(({id:Mt})=>Mt!==$t.id);Gt!=null&&Gt.some(Mt=>Mt.children&&Mt.children.length>0)&&kt.add($t.id),Et($t)})}):(Ht=Nt.children)==null||Ht.forEach(Lt=>{var kt;const $t=new Set(ft.current),Ft=(kt=Nt.children)==null?void 0:kt.filter(Gt=>Gt.id!==Lt.id);Ft!=null&&Ft.some(Gt=>Gt.children&&Gt.children.length>0)&&($t.add(Lt.id),ft.current=$t),Et(Lt)})}const bt=Nt=>{const Ht=new Set("");tt&&Array.isArray(tt)&&Nt&&(tt.forEach(Lt=>{Ht.add(Lt.id)}),ht(Ht))};reactExports.useEffect(()=>{tt&&Et(tt)},[tt]),reactExports.useEffect(()=>{st!=null&&st.isOver&&st.isTreeview?(st.overId&&Ut(st.overId),vt(st.overId)):vt(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,yt)){ct(void 0);return}if(rt==="default"){dt.forEach(Ht=>ot==null?void 0:ot(Ht));return}Rt(Nt)},Rt=Nt=>{const Ht=new Set(dt),Lt=findPathById(tt,Nt),kt=Array.from(Ht);Lt.forEach($t=>{const Ft=kt.indexOf($t);Ft>-1&&kt.splice(Ft,1),kt.push($t)}),Ht.clear(),kt.forEach($t=>Ht.add($t)),Ht.forEach($t=>ot==null?void 0:ot($t)),ht(Ht)},Ct=Nt=>{const Ht=new Set(dt);Ht.delete(Nt),Ht.forEach(Lt=>at==null?void 0:at(Lt)),ht(Ht)},It=Nt=>{dt.has(Nt)?Ct(Nt):Rt(Nt)},jt=Nt=>{yt!==Nt&&ct(Nt)},Pt=Nt=>{jt(Nt),Rt(Nt),lt==null||lt(Nt)},Ot=Nt=>{It(Nt)},Ut=Nt=>{findNodeById(tt,rt)&&Rt(Nt)};return{selectedNodeId:yt,expandedNodes:dt,siblingsNodes:ft,draggedNodeId:xt,handleItemClick:Pt,handleFoldUnfold:Ot}},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:vt,handleItemClick:yt,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:vt,handleItemClick:yt,handleToggleNode:Et,handleItemAction:at},bt.id)):jsxRuntimeExports.jsx(TreeNode,{node:rt,selectedNodeId:ht,expandedNodes:ft,siblingsNodes:xt,showIcon:ut,draggedNodeId:vt,handleItemClick:yt,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.41",ot="",at="?",lt="function",ut="undefined",ct="object",dt="string",ht="major",ft="model",xt="name",vt="type",yt="vendor",Et="version",bt="architecture",wt="console",St="mobile",Rt="tablet",Ct="smarttv",It="wearable",jt="embedded",Pt=500,Ot="Amazon",Ut="Apple",Nt="ASUS",Ht="BlackBerry",Lt="Browser",kt="Chrome",$t="Edge",Ft="Firefox",Gt="Google",Mt="Honor",Vt="Huawei",Bt="Lenovo",qt="LG",Qt="Microsoft",Yt="Motorola",tr="Nvidia",lr="OnePlus",ur="Opera",mr="OPPO",yr="Samsung",or="Sharp",hr="Sony",pr="Xiaomi",_r="Zebra",Ar="Facebook",Hr="Chromium OS",Ur="Mac OS",os=" Browser",Gs=function(Ir,Br){var kr={};for(var Wr in Ir)Br[Wr]&&Br[Wr].length%2===0?kr[Wr]=Br[Wr].concat(Ir[Wr]):kr[Wr]=Ir[Wr];return kr},Es=function(Ir){for(var Br={},kr=0;kr<Ir.length;kr++)Br[Ir[kr].toUpperCase()]=Ir[kr];return Br},Ws=function(Ir,Br){return typeof Ir===dt?Xt(Br).indexOf(Xt(Ir))!==-1:!1},Xt=function(Ir){return Ir.toLowerCase()},er=function(Ir){return typeof Ir===dt?Ir.replace(/[^\d\.]/g,ot).split(".")[0]:st},sr=function(Ir,Br){if(typeof Ir===dt)return Ir=Ir.replace(/^\s\s*/,ot),typeof Br===ut?Ir:Ir.substring(0,Pt)},br=function(Ir,Br){for(var kr=0,Wr,bs,ps,zr,$r,Ls;kr<Br.length&&!$r;){var Zo=Br[kr],Pl=Br[kr+1];for(Wr=bs=0;Wr<Zo.length&&!$r&&Zo[Wr];)if($r=Zo[Wr++].exec(Ir),$r)for(ps=0;ps<Pl.length;ps++)Ls=$r[++bs],zr=Pl[ps],typeof zr===ct&&zr.length>0?zr.length===2?typeof zr[1]==lt?this[zr[0]]=zr[1].call(this,Ls):this[zr[0]]=zr[1]:zr.length===3?typeof zr[1]===lt&&!(zr[1].exec&&zr[1].test)?this[zr[0]]=Ls?zr[1].call(this,Ls,zr[2]):st:this[zr[0]]=Ls?Ls.replace(zr[1],zr[2]):st:zr.length===4&&(this[zr[0]]=Ls?zr[3].call(this,Ls.replace(zr[1],zr[2])):st):this[zr]=Ls||st;kr+=2}},gr=function(Ir,Br){for(var kr in Br)if(typeof Br[kr]===ct&&Br[kr].length>0){for(var Wr=0;Wr<Br[kr].length;Wr++)if(Ws(Br[kr][Wr],Ir))return kr===at?st:kr}else if(Ws(Br[kr],Ir))return kr===at?st:kr;return Br.hasOwnProperty("*")?Br["*"]:Ir},vr={"1.0":"/8","1.2":"/1","1.3":"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"},Tr={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"},Lr={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,ur+" Mini"]],[/\bop(?:rg)?x\/([\w\.]+)/i],[Et,[xt,ur+" GX"]],[/\bopr\/([\w\.]+)/i],[Et,[xt,ur]],[/\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,Ft+" Focus"]],[/\bopt\/([\w\.]+)/i],[Et,[xt,ur+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[Et,[xt,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[Et,[xt,"Dolphin"]],[/coast\/([\w\.]+)/i],[Et,[xt,ur+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[Et,[xt,"MIUI"+os]],[/fxios\/([\w\.-]+)/i],[Et,[xt,Ft]],[/\bqihoobrowser\/?([\w\.]*)/i],[Et,[xt,"360"]],[/\b(qq)\/([\w\.]+)/i],[[xt,/(.+)/,"$1Browser"],Et],[/(oculus|sailfish|huawei|vivo|pico)browser\/([\w\.]+)/i],[[xt,/(.+)/,"$1"+os],Et],[/samsungbrowser\/([\w\.]+)/i],[Et,[xt,yr+" 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,Ar],Et],[/(Klarna)\/([\w\.]+)/i,/(kakao(?:talk|story))[\/ ]([\w\.]+)/i,/(naver)\(.*?(\d+\.[\w\.]+).*\)/i,/(daum)apps[\/ ]([\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,gr,vr]],[/(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,Ft+" 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,/(amaya|dillo|doris|icab|ladybird|lynx|mosaic|netsurf|obigo|polaris|w3m|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/\b(links) \(([\w\.]+)/i],[xt,[Et,/_/g,"."]],[/(cobalt)\/([\w\.]+)/i],[xt,[Et,/master.|lts./,""]]],cpu:[[/\b((amd|x|x86[-_]?|wow|win)64)\b/i],[[bt,"amd64"]],[/(ia32(?=;))/i,/\b((i[346]|x)86)(pc)?\b/i],[[bt,"ia32"]],[/\b(aarch64|arm(v?[89]e?l?|_?64))\b/i],[[bt,"arm64"]],[/\b(arm(v[67])?ht?n?[fl]p?)\b/i],[[bt,"armhf"]],[/( (ce|mobile); ppc;|\/[\w\.]+arm\b)/i],[[bt,"arm"]],[/((ppc|powerpc)(64)?)( mac|;|\))/i],[[bt,/ower/,ot,Xt]],[/ sun4\w[;\)]/i],[[bt,"sparc"]],[/\b(avr32|ia64(?=;)|68k(?=\))|\barm(?=v([1-7]|[5-7]1)l?|;|eabi)|(irix|mips|sparc)(64)?\b|pa-risc)/i],[[bt,Xt]]],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,[yt,yr],[vt,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,[yt,yr],[vt,St]],[/(?:\/|\()(ip(?:hone|od)[\w, ]*)(?:\/|;)/i],[ft,[yt,Ut],[vt,St]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[ft,[yt,Ut],[vt,Rt]],[/(macintosh);/i],[ft,[yt,Ut]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[ft,[yt,or],[vt,St]],[/\b((?:brt|eln|hey2?|gdi|jdn)-a?[lnw]09|(?:ag[rm]3?|jdn2|kob2)-a?[lw]0[09]hn)(?: bui|\)|;)/i],[ft,[yt,Mt],[vt,Rt]],[/honor([-\w ]+)[;\)]/i],[ft,[yt,Mt],[vt,St]],[/\b((?:ag[rs][2356]?k?|bah[234]?|bg[2o]|bt[kv]|cmr|cpn|db[ry]2?|jdn2|got|kob2?k?|mon|pce|scm|sht?|[tw]gr|vrd)-[ad]?[lw][0125][09]b?|605hw|bg2-u03|(?:gem|fdr|m2|ple|t1)-[7a]0[1-4][lu]|t1-a2[13][lw]|mediapad[\w\. ]*(?= bui|\)))\b(?!.+d\/s)/i],[ft,[yt,Vt],[vt,Rt]],[/(?:huawei)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[ft,[yt,Vt],[vt,St]],[/oid[^\)]+; (2[\dbc]{4}(182|283|rp\w{2})[cgl]|m2105k81a?c)(?: bui|\))/i,/\b((?:red)?mi[-_ ]?pad[\w- ]*)(?: bui|\))/i],[[ft,/_/g," "],[yt,pr],[vt,Rt]],[/\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,/ ([\w ]+) miui\/v?\d/i],[[ft,/_/g," "],[yt,pr],[vt,St]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[ft,[yt,mr],[vt,St]],[/\b(opd2(\d{3}a?))(?: bui|\))/i],[ft,[yt,gr,{OnePlus:["304","403","203"],"*":mr}],[vt,Rt]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[ft,[yt,"Vivo"],[vt,St]],[/\b(rmx[1-3]\d{3})(?: bui|;|\))/i],[ft,[yt,"Realme"],[vt,St]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto(?! 360)[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[ft,[yt,Yt],[vt,St]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[ft,[yt,Yt],[vt,Rt]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[ft,[yt,qt],[vt,Rt]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv|watch)\w+)/i,/\blg-?([\d\w]+) bui/i],[ft,[yt,qt],[vt,St]],[/(ideatab[-\w ]+|602lv|d-42a|a101lv|a2109a|a3500-hv|s[56]000|pb-6505[my]|tb-?x?\d{3,4}(?:f[cu]|xu|[av])|yt\d?-[jx]?\d+[lfmx])( bui|;|\)|\/)/i,/lenovo ?(b[68]0[08]0-?[hf]?|tab(?:[\w- ]+?)|tb[\w-]{6,7})( bui|;|\)|\/)/i],[ft,[yt,Bt],[vt,Rt]],[/(nokia) (t[12][01])/i],[yt,ft,[vt,Rt]],[/(?:maemo|nokia).*(n900|lumia \d+|rm-\d+)/i,/nokia[-_ ]?(([-\w\. ]*))/i],[[ft,/_/g," "],[vt,St],[yt,"Nokia"]],[/(pixel (c|tablet))\b/i],[ft,[yt,Gt],[vt,Rt]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[ft,[yt,Gt],[vt,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,[yt,hr],[vt,St]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[ft,"Xperia Tablet"],[yt,hr],[vt,Rt]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[ft,[yt,lr],[vt,St]],[/(alexa)webm/i,/(kf[a-z]{2}wi|aeo(?!bc)\w\w)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[ft,[yt,Ot],[vt,Rt]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[ft,/(.+)/g,"Fire Phone $1"],[yt,Ot],[vt,St]],[/(playbook);[-\w\),; ]+(rim)/i],[ft,yt,[vt,Rt]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[ft,[yt,Ht],[vt,St]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[ft,[yt,Nt],[vt,Rt]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[ft,[yt,Nt],[vt,St]],[/(nexus 9)/i],[ft,[yt,"HTC"],[vt,Rt]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic(?!(?:;|\.))|sony(?!-bra))[-_ ]?([-\w]*)/i],[yt,[ft,/_/g," "],[vt,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,[yt,"TCL"],[vt,Rt]],[/(itel) ((\w+))/i],[[yt,Xt],ft,[vt,gr,{tablet:["p10001l","w7001"],"*":"mobile"}]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[ft,[yt,"Acer"],[vt,Rt]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[ft,[yt,"Meizu"],[vt,St]],[/; ((?:power )?armor(?:[\w ]{0,8}))(?: bui|\))/i],[ft,[yt,"Ulefone"],[vt,St]],[/; (energy ?\w+)(?: bui|\))/i,/; energizer ([\w ]+)(?: bui|\))/i],[ft,[yt,"Energizer"],[vt,St]],[/; cat (b35);/i,/; (b15q?|s22 flip|s48c|s62 pro)(?: bui|\))/i],[ft,[yt,"Cat"],[vt,St]],[/((?:new )?andromax[\w- ]+)(?: bui|\))/i],[ft,[yt,"Smartfren"],[vt,St]],[/droid.+; (a(?:015|06[35]|142p?))/i],[ft,[yt,"Nothing"],[vt,St]],[/; (x67 5g|tikeasy \w+|ac[1789]\d\w+)( b|\))/i,/archos ?(5|gamepad2?|([\w ]*[t1789]|hello) ?\d+[\w ]*)( b|\))/i],[ft,[yt,"Archos"],[vt,Rt]],[/archos ([\w ]+)( b|\))/i,/; (ac[3-6]\d\w{2,8})( b|\))/i],[ft,[yt,"Archos"],[vt,St]],[/(imo) (tab \w+)/i,/(infinix) (x1101b?)/i],[yt,ft,[vt,Rt]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus(?! zenw)|dell|jolla|meizu|motorola|polytron|infinix|tecno|micromax|advan)[-_ ]?([-\w]*)/i,/; (hmd|imo) ([\w ]+?)(?: bui|\))/i,/(hp) ([\w ]+\w)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w ]+?)(?: bui|\)|\/)/i,/(oppo) ?([\w ]+) bui/i],[yt,ft,[vt,St]],[/(kobo)\s(ereader|touch)/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],[yt,ft,[vt,Rt]],[/(surface duo)/i],[ft,[yt,Qt],[vt,Rt]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[ft,[yt,"Fairphone"],[vt,St]],[/(u304aa)/i],[ft,[yt,"AT&T"],[vt,St]],[/\bsie-(\w*)/i],[ft,[yt,"Siemens"],[vt,St]],[/\b(rct\w+) b/i],[ft,[yt,"RCA"],[vt,Rt]],[/\b(venue[\d ]{2,7}) b/i],[ft,[yt,"Dell"],[vt,Rt]],[/\b(q(?:mv|ta)\w+) b/i],[ft,[yt,"Verizon"],[vt,Rt]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[ft,[yt,"Barnes & Noble"],[vt,Rt]],[/\b(tm\d{3}\w+) b/i],[ft,[yt,"NuVision"],[vt,Rt]],[/\b(k88) b/i],[ft,[yt,"ZTE"],[vt,Rt]],[/\b(nx\d{3}j) b/i],[ft,[yt,"ZTE"],[vt,St]],[/\b(gen\d{3}) b.+49h/i],[ft,[yt,"Swiss"],[vt,St]],[/\b(zur\d{3}) b/i],[ft,[yt,"Swiss"],[vt,Rt]],[/\b((zeki)?tb.*\b) b/i],[ft,[yt,"Zeki"],[vt,Rt]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[yt,"Dragon Touch"],ft,[vt,Rt]],[/\b(ns-?\w{0,9}) b/i],[ft,[yt,"Insignia"],[vt,Rt]],[/\b((nxa|next)-?\w{0,9}) b/i],[ft,[yt,"NextBook"],[vt,Rt]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[yt,"Voice"],ft,[vt,St]],[/\b(lvtel\-)?(v1[12]) b/i],[[yt,"LvTel"],ft,[vt,St]],[/\b(ph-1) /i],[ft,[yt,"Essential"],[vt,St]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[ft,[yt,"Envizen"],[vt,Rt]],[/\b(trio[-\w\. ]+) b/i],[ft,[yt,"MachSpeed"],[vt,Rt]],[/\btu_(1491) b/i],[ft,[yt,"Rotor"],[vt,Rt]],[/((?:tegranote|shield t(?!.+d tv))[\w- ]*?)(?: b|\))/i],[ft,[yt,tr],[vt,Rt]],[/(sprint) (\w+)/i],[yt,ft,[vt,St]],[/(kin\.[onetw]{3})/i],[[ft,/\./g," "],[yt,Qt],[vt,St]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[ft,[yt,_r],[vt,Rt]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[ft,[yt,_r],[vt,St]],[/smart-tv.+(samsung)/i],[yt,[vt,Ct]],[/hbbtv.+maple;(\d+)/i],[[ft,/^/,"SmartTV"],[yt,yr],[vt,Ct]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[yt,qt],[vt,Ct]],[/(apple) ?tv/i],[yt,[ft,Ut+" TV"],[vt,Ct]],[/crkey/i],[[ft,kt+"cast"],[yt,Gt],[vt,Ct]],[/droid.+aft(\w+)( bui|\))/i],[ft,[yt,Ot],[vt,Ct]],[/(shield \w+ tv)/i],[ft,[yt,tr],[vt,Ct]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[ft,[yt,or],[vt,Ct]],[/(bravia[\w ]+)( bui|\))/i],[ft,[yt,hr],[vt,Ct]],[/(mi(tv|box)-?\w+) bui/i],[ft,[yt,pr],[vt,Ct]],[/Hbbtv.*(technisat) (.*);/i],[yt,ft,[vt,Ct]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w\+ ]*; *([\w\d][^;]*);([^;]*)/i],[[yt,sr],[ft,sr],[vt,Ct]],[/droid.+; ([\w- ]+) (?:android tv|smart[- ]?tv)/i],[ft,[vt,Ct]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[vt,Ct]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[yt,ft,[vt,wt]],[/droid.+; (shield)( bui|\))/i],[ft,[yt,tr],[vt,wt]],[/(playstation \w+)/i],[ft,[yt,hr],[vt,wt]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[ft,[yt,Qt],[vt,wt]],[/\b(sm-[lr]\d\d[0156][fnuw]?s?|gear live)\b/i],[ft,[yt,yr],[vt,It]],[/((pebble))app/i,/(asus|google|lg|oppo) ((pixel |zen)?watch[\w ]*)( bui|\))/i],[yt,ft,[vt,It]],[/(ow(?:19|20)?we?[1-3]{1,3})/i],[ft,[yt,mr],[vt,It]],[/(watch)(?: ?os[,\/]|\d,\d\/)[\d\.]+/i],[ft,[yt,Ut],[vt,It]],[/(opwwe\d{3})/i],[ft,[yt,lr],[vt,It]],[/(moto 360)/i],[ft,[yt,Yt],[vt,It]],[/(smartwatch 3)/i],[ft,[yt,hr],[vt,It]],[/(g watch r)/i],[ft,[yt,qt],[vt,It]],[/droid.+; (wt63?0{2,3})\)/i],[ft,[yt,_r],[vt,It]],[/droid.+; (glass) \d/i],[ft,[yt,Gt],[vt,It]],[/(pico) (4|neo3(?: link|pro)?)/i],[yt,ft,[vt,It]],[/; (quest( \d| pro)?)/i],[ft,[yt,Ar],[vt,It]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[yt,[vt,jt]],[/(aeobc)\b/i],[ft,[yt,Ot],[vt,jt]],[/(homepod).+mac os/i],[ft,[yt,Ut],[vt,jt]],[/windows iot/i],[[vt,jt]],[/droid .+?; ([^;]+?)(?: bui|; wv\)|\) applew).+? mobile safari/i],[ft,[vt,St]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[ft,[vt,Rt]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[vt,Rt]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[vt,St]],[/droid .+?; ([\w\. -]+)( bui|\))/i],[ft,[yt,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[Et,[xt,$t+"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],[/ladybird\//i],[[xt,"LibWeb"]],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[Et,xt]],os:[[/microsoft (windows) (vista|xp)/i],[xt,Et],[/(windows (?:phone(?: os)?|mobile|iot))[\/ ]?([\d\.\w ]*)/i],[xt,[Et,gr,Tr]],[/windows nt 6\.2; (arm)/i,/windows[\/ ]([ntce\d\. ]+\w)(?!.+xbox)/i,/(?:win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[Et,gr,Tr],[xt,"Windows"]],[/[adehimnop]{4,7}\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,Ur],[Et,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[Et,xt],[/(ubuntu) ([\w\.]+) like android/i],[[xt,/(.+)/,"$1 Touch"],Et],[/(android|bada|blackberry|kaios|maemo|meego|openharmony|qnx|rim tablet os|sailfish|series40|symbian|tizen|webos)\w*[-\/; ]?([\d\.]*)/i],[xt,Et],[/\(bb(10);/i],[Et,[xt,Ht]],[/(?:symbian ?os|symbos|s60(?=;)|series ?60)[-\/ ]?([\w\.]*)/i],[Et,[xt,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[Et,[xt,Ft+" 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,Hr],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)(?: arm\w*| x86\w*| ?)([\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]]},Dr=function(Ir,Br){if(typeof Ir===ct&&(Br=Ir,Ir=st),!(this instanceof Dr))return new Dr(Ir,Br).getResult();var kr=typeof rt!==ut&&rt.navigator?rt.navigator:st,Wr=Ir||(kr&&kr.userAgent?kr.userAgent:ot),bs=kr&&kr.userAgentData?kr.userAgentData:st,ps=Br?Gs(Lr,Br):Lr,zr=kr&&kr.userAgent==Wr;return this.getBrowser=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.browser),$r[ht]=er($r[Et]),zr&&kr&&kr.brave&&typeof kr.brave.isBrave==lt&&($r[xt]="Brave"),$r},this.getCPU=function(){var $r={};return $r[bt]=st,br.call($r,Wr,ps.cpu),$r},this.getDevice=function(){var $r={};return $r[yt]=st,$r[ft]=st,$r[vt]=st,br.call($r,Wr,ps.device),zr&&!$r[vt]&&bs&&bs.mobile&&($r[vt]=St),zr&&$r[ft]=="Macintosh"&&kr&&typeof kr.standalone!==ut&&kr.maxTouchPoints&&kr.maxTouchPoints>2&&($r[ft]="iPad",$r[vt]=Rt),$r},this.getEngine=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.engine),$r},this.getOS=function(){var $r={};return $r[xt]=st,$r[Et]=st,br.call($r,Wr,ps.os),zr&&!$r[xt]&&bs&&bs.platform&&bs.platform!="Unknown"&&($r[xt]=bs.platform.replace(/chrome os/i,Hr).replace(/macos/i,Ur)),$r},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 Wr},this.setUA=function($r){return Wr=typeof $r===dt&&$r.length>Pt?sr($r,Pt):$r,this},this.setUA(Wr),this};Dr.VERSION=nt,Dr.BROWSER=Es([xt,Et,ht]),Dr.CPU=Es([bt]),Dr.DEVICE=Es([ft,yt,vt,wt,St,Ct,Rt,It,jt]),Dr.ENGINE=Dr.OS=Es([xt,Et]),tt.exports&&(et=tt.exports=Dr),et.UAParser=Dr;var Zr=typeof rt!==ut&&(rt.jQuery||rt.Zepto);if(Zr&&!Zr.ua){var ks=new Dr;Zr.ua=ks.getResult(),Zr.ua.get=function(){return ks.getUA()},Zr.ua.set=function(Ir){ks.setUA(Ir);var Br=ks.getResult();for(var kr in Br)Zr.ua[kr]=Br[kr]}}})(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 wl,Ho,Zl,Wp,FocusManager=(Wp=class extends Subscribable{constructor(){super();Or(this,wl);Or(this,Ho);Or(this,Zl);Sr(this,Zl,et=>{if(!isServer&&window.addEventListener){const rt=()=>et();return window.addEventListener("visibilitychange",rt,!1),()=>{window.removeEventListener("visibilitychange",rt)}}})}onSubscribe(){Kt(this,Ho)||this.setEventListener(Kt(this,Zl))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Ho))==null||et.call(this),Sr(this,Ho,void 0))}setEventListener(et){var rt;Sr(this,Zl,et),(rt=Kt(this,Ho))==null||rt.call(this),Sr(this,Ho,et(st=>{typeof st=="boolean"?this.setFocused(st):this.onFocus()}))}setFocused(et){Kt(this,wl)!==et&&(Sr(this,wl,et),this.onFocus())}onFocus(){const et=this.isFocused();this.listeners.forEach(rt=>{rt(et)})}isFocused(){var et;return typeof Kt(this,wl)=="boolean"?Kt(this,wl):((et=globalThis.document)==null?void 0:et.visibilityState)!=="hidden"}},wl=new WeakMap,Ho=new WeakMap,Zl=new WeakMap,Wp),focusManager=new FocusManager,Jl,Vo,eu,qp,OnlineManager=(qp=class extends Subscribable{constructor(){super();Or(this,Jl,!0);Or(this,Vo);Or(this,eu);Sr(this,eu,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,Vo)||this.setEventListener(Kt(this,eu))}onUnsubscribe(){var et;this.hasListeners()||((et=Kt(this,Vo))==null||et.call(this),Sr(this,Vo,void 0))}setEventListener(et){var rt;Sr(this,eu,et),(rt=Kt(this,Vo))==null||rt.call(this),Sr(this,Vo,et(this.setOnline.bind(this)))}setOnline(et){Kt(this,Jl)!==et&&(Sr(this,Jl,et),this.listeners.forEach(st=>{st(et)}))}isOnline(){return Kt(this,Jl)}},Jl=new WeakMap,Vo=new WeakMap,eu=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=yt=>{var Et;st||(ft(new CancelledError(yt)),(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=yt=>{var Et;st||(st=!0,(Et=tt.onSuccess)==null||Et.call(tt,yt),nt==null||nt(),ot.resolve(yt))},ft=yt=>{var Et;st||(st=!0,(Et=tt.onError)==null||Et.call(tt,yt),nt==null||nt(),ot.reject(yt))},xt=()=>new Promise(yt=>{var Et;nt=bt=>{(st||ct())&&yt(bt)},(Et=tt.onPause)==null||Et.call(tt)}).then(()=>{var yt;nt=void 0,st||(yt=tt.onContinue)==null||yt.call(tt)}),vt=()=>{if(st)return;let yt;const Et=rt===0?tt.initialPromise:void 0;try{yt=Et??tt.fn()}catch(bt){yt=Promise.reject(bt)}Promise.resolve(yt).then(ht).catch(bt=>{var It;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++,(It=tt.onFail)==null||It.call(tt,rt,bt),sleep(Rt).then(()=>ct()?void 0:xt()).then(()=>{et?ft(bt):vt()})})};return{promise:ot,cancel:at,continue:()=>(nt==null||nt(),ot),cancelRetry:lt,continueRetry:ut,canStart:dt,start:()=>(dt()?vt():xt().then(vt),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(),Sl,Xp,Removable=(Xp=class{constructor(){Or(this,Sl)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),isValidTimeout(this.gcTime)&&Sr(this,Sl,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(tt){this.gcTime=Math.max(this.gcTime||0,tt??(isServer?1/0:5*60*1e3))}clearGcTimeout(){Kt(this,Sl)&&(clearTimeout(Kt(this,Sl)),Sr(this,Sl,void 0))}},Sl=new WeakMap,Xp),tu,ru,qn,js,Lu,_l,eo,Co,Yp,Query=(Yp=class extends Removable{constructor(et){super();Or(this,eo);Or(this,tu);Or(this,ru);Or(this,qn);Or(this,js);Or(this,Lu);Or(this,_l);Sr(this,_l,!1),Sr(this,Lu,et.defaultOptions),this.setOptions(et.options),this.observers=[],Sr(this,qn,et.cache),this.queryKey=et.queryKey,this.queryHash=et.queryHash,Sr(this,tu,getDefaultState$1(this.options)),this.state=et.state??Kt(this,tu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var et;return(et=Kt(this,js))==null?void 0:et.promise}setOptions(et){this.options={...Kt(this,Lu),...et},this.updateGcTime(this.options.gcTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Kt(this,qn).remove(this)}setData(et,rt){const st=replaceData(this.state.data,et,this.options);return Fr(this,eo,Co).call(this,{data:st,type:"success",dataUpdatedAt:rt==null?void 0:rt.updatedAt,manual:rt==null?void 0:rt.manual}),st}setState(et,rt){Fr(this,eo,Co).call(this,{type:"setState",state:et,setStateOptions:rt})}cancel(et){var st,nt;const rt=(st=Kt(this,js))==null?void 0:st.promise;return(nt=Kt(this,js))==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,tu))}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,js))==null||rt.continue()}onOnline(){var rt;const et=this.observers.find(st=>st.shouldFetchOnReconnect());et==null||et.refetch({cancelRefetch:!1}),(rt=Kt(this,js))==null||rt.continue()}addObserver(et){this.observers.includes(et)||(this.observers.push(et),this.clearGcTimeout(),Kt(this,qn).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,js)&&(Kt(this,_l)?Kt(this,js).cancel({revert:!0}):Kt(this,js).cancelRetry()),this.scheduleGc()),Kt(this,qn).notify({type:"observerRemoved",query:this,observer:et}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Fr(this,eo,Co).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,js))return Kt(this,js).continueRetry(),Kt(this,js).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:()=>(Sr(this,_l,!0),st.signal)})},ot=()=>{const ht=ensureQueryFn(this.options,rt),ft={queryKey:this.queryKey,meta:this.meta};return nt(ft),Sr(this,_l,!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),Sr(this,ru,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((ct=at.fetchOptions)==null?void 0:ct.meta))&&Fr(this,eo,Co).call(this,{type:"fetch",meta:(dt=at.fetchOptions)==null?void 0:dt.meta});const lt=ht=>{var ft,xt,vt,yt;isCancelledError(ht)&&ht.silent||Fr(this,eo,Co).call(this,{type:"error",error:ht}),isCancelledError(ht)||((xt=(ft=Kt(this,qn).config).onError)==null||xt.call(ft,ht,this),(yt=(vt=Kt(this,qn).config).onSettled)==null||yt.call(vt,this.state.data,ht,this)),this.scheduleGc()};return Sr(this,js,createRetryer({initialPromise:rt==null?void 0:rt.initialPromise,fn:at.fetchFn,abort:st.abort.bind(st),onSuccess:ht=>{var ft,xt,vt,yt;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,qn).config).onSuccess)==null||xt.call(ft,ht,this),(yt=(vt=Kt(this,qn).config).onSettled)==null||yt.call(vt,ht,this.state.error,this),this.scheduleGc()},onError:lt,onFail:(ht,ft)=>{Fr(this,eo,Co).call(this,{type:"failed",failureCount:ht,error:ft})},onPause:()=>{Fr(this,eo,Co).call(this,{type:"pause"})},onContinue:()=>{Fr(this,eo,Co).call(this,{type:"continue"})},retry:at.options.retry,retryDelay:at.options.retryDelay,networkMode:at.options.networkMode,canRun:()=>!0})),Kt(this,js).start()}},tu=new WeakMap,ru=new WeakMap,qn=new WeakMap,js=new WeakMap,Lu=new WeakMap,_l=new WeakMap,eo=new WeakSet,Co=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,ru)?{...Kt(this,ru),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,qn).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 xo,Kp,QueryCache=(Kp=class extends Subscribable{constructor(et={}){super();Or(this,xo);this.config=et,Sr(this,xo,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,xo).has(et.queryHash)||(Kt(this,xo).set(et.queryHash,et),this.notify({type:"added",query:et}))}remove(et){const rt=Kt(this,xo).get(et.queryHash);rt&&(et.destroy(),rt===et&&Kt(this,xo).delete(et.queryHash),this.notify({type:"removed",query:et}))}clear(){notifyManager.batch(()=>{this.getAll().forEach(et=>{this.remove(et)})})}get(et){return Kt(this,xo).get(et)}getAll(){return[...Kt(this,xo).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()})})}},xo=new WeakMap,Kp),vo,Os,Rl,yo,Uo,Qp,Mutation=(Qp=class extends Removable{constructor(et){super();Or(this,yo);Or(this,vo);Or(this,Os);Or(this,Rl);this.mutationId=et.mutationId,Sr(this,Os,et.mutationCache),Sr(this,vo,[]),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,vo).includes(et)||(Kt(this,vo).push(et),this.clearGcTimeout(),Kt(this,Os).notify({type:"observerAdded",mutation:this,observer:et}))}removeObserver(et){Sr(this,vo,Kt(this,vo).filter(rt=>rt!==et)),this.scheduleGc(),Kt(this,Os).notify({type:"observerRemoved",mutation:this,observer:et})}optionalRemove(){Kt(this,vo).length||(this.state.status==="pending"?this.scheduleGc():Kt(this,Os).remove(this))}continue(){var et;return((et=Kt(this,Rl))==null?void 0:et.continue())??this.execute(this.state.variables)}async execute(et){var nt,ot,at,lt,ut,ct,dt,ht,ft,xt,vt,yt,Et,bt,wt,St,Rt,Ct,It,jt;Sr(this,Rl,createRetryer({fn:()=>this.options.mutationFn?this.options.mutationFn(et):Promise.reject(new Error("No mutationFn found")),onFail:(Pt,Ot)=>{Fr(this,yo,Uo).call(this,{type:"failed",failureCount:Pt,error:Ot})},onPause:()=>{Fr(this,yo,Uo).call(this,{type:"pause"})},onContinue:()=>{Fr(this,yo,Uo).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Kt(this,Os).canRun(this)}));const rt=this.state.status==="pending",st=!Kt(this,Rl).canStart();try{if(!rt){Fr(this,yo,Uo).call(this,{type:"pending",variables:et,isPaused:st}),await((ot=(nt=Kt(this,Os).config).onMutate)==null?void 0:ot.call(nt,et,this));const Ot=await((lt=(at=this.options).onMutate)==null?void 0:lt.call(at,et));Ot!==this.state.context&&Fr(this,yo,Uo).call(this,{type:"pending",context:Ot,variables:et,isPaused:st})}const Pt=await Kt(this,Rl).start();return await((ct=(ut=Kt(this,Os).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,Os).config).onSettled)==null?void 0:xt.call(ft,Pt,null,this.state.variables,this.state.context,this)),await((yt=(vt=this.options).onSettled)==null?void 0:yt.call(vt,Pt,null,et,this.state.context)),Fr(this,yo,Uo).call(this,{type:"success",data:Pt}),Pt}catch(Pt){try{throw await((bt=(Et=Kt(this,Os).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,Os).config).onSettled)==null?void 0:Ct.call(Rt,void 0,Pt,this.state.variables,this.state.context,this)),await((jt=(It=this.options).onSettled)==null?void 0:jt.call(It,void 0,Pt,et,this.state.context)),Pt}finally{Fr(this,yo,Uo).call(this,{type:"error",error:Pt})}}finally{Kt(this,Os).runNext(this)}}},vo=new WeakMap,Os=new WeakMap,Rl=new WeakMap,yo=new WeakSet,Uo=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,vo).forEach(st=>{st.onMutationUpdate(et)}),Kt(this,Os).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 Js,Nu,Zp,MutationCache=(Zp=class extends Subscribable{constructor(et={}){super();Or(this,Js);Or(this,Nu);this.config=et,Sr(this,Js,new Map),Sr(this,Nu,Date.now())}build(et,rt,st){const nt=new Mutation({mutationCache:this,mutationId:++A1(this,Nu)._,options:et.defaultMutationOptions(rt),state:st});return this.add(nt),nt}add(et){const rt=scopeFor(et),st=Kt(this,Js).get(rt)??[];st.push(et),Kt(this,Js).set(rt,st),this.notify({type:"added",mutation:et})}remove(et){var st;const rt=scopeFor(et);if(Kt(this,Js).has(rt)){const nt=(st=Kt(this,Js).get(rt))==null?void 0:st.filter(ot=>ot!==et);nt&&(nt.length===0?Kt(this,Js).delete(rt):Kt(this,Js).set(rt,nt))}this.notify({type:"removed",mutation:et})}canRun(et){var st;const rt=(st=Kt(this,Js).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,Js).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,Js).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))))}},Js=new WeakMap,Nu=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,vt;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=((vt=et.state.data)==null?void 0:vt.pageParams)||[];let lt={pages:[],pageParams:[]},ut=0;const ct=async()=>{let yt=!1;const Et=St=>{Object.defineProperty(St,"signal",{enumerable:!0,get:()=>(et.signal.aborted?yt=!0:et.signal.addEventListener("abort",()=>{yt=!0}),et.signal)})},bt=ensureQueryFn(et.options,et.fetchOptions),wt=async(St,Rt,Ct)=>{if(yt)return Promise.reject();if(Rt==null&&St.pages.length)return Promise.resolve(St);const It={queryKey:et.queryKey,pageParam:Rt,direction:Ct?"backward":"forward",meta:et.options.meta};Et(It);const jt=await bt(It),{maxPages:Pt}=et.options,Ot=Ct?addToStart:addToEnd;return{pages:Ot(St.pages,jt,Pt),pageParams:Ot(St.pageParams,Rt,Pt)}};if(nt&&ot.length){const St=nt==="backward",Rt=St?getPreviousPageParam:getNextPageParam,Ct={pages:ot,pageParams:at},It=Rt(st,Ct);lt=await wt(Ct,It,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 yt,Et;return(Et=(yt=et.options).persister)==null?void 0:Et.call(yt,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 us,Go,Wo,su,nu,qo,iu,ou,Jp,QueryClient=(Jp=class{constructor(tt={}){Or(this,us);Or(this,Go);Or(this,Wo);Or(this,su);Or(this,nu);Or(this,qo);Or(this,iu);Or(this,ou);Sr(this,us,tt.queryCache||new QueryCache),Sr(this,Go,tt.mutationCache||new MutationCache),Sr(this,Wo,tt.defaultOptions||{}),Sr(this,su,new Map),Sr(this,nu,new Map),Sr(this,qo,0)}mount(){A1(this,qo)._++,Kt(this,qo)===1&&(Sr(this,iu,focusManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onFocus())})),Sr(this,ou,onlineManager.subscribe(async tt=>{tt&&(await this.resumePausedMutations(),Kt(this,us).onOnline())})))}unmount(){var tt,et;A1(this,qo)._--,Kt(this,qo)===0&&((tt=Kt(this,iu))==null||tt.call(this),Sr(this,iu,void 0),(et=Kt(this,ou))==null||et.call(this),Sr(this,ou,void 0))}isFetching(tt){return Kt(this,us).findAll({...tt,fetchStatus:"fetching"}).length}isMutating(tt){return Kt(this,Go).findAll({...tt,status:"pending"}).length}getQueryData(tt){var rt;const et=this.defaultQueryOptions({queryKey:tt});return(rt=Kt(this,us).get(et.queryHash))==null?void 0:rt.state.data}ensureQueryData(tt){const et=this.defaultQueryOptions(tt),rt=Kt(this,us).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,us).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,us).get(st.queryHash),ot=nt==null?void 0:nt.state.data,at=functionalUpdate(et,ot);if(at!==void 0)return Kt(this,us).build(this,st).setData(at,{...rt,manual:!0})}setQueriesData(tt,et,rt){return notifyManager.batch(()=>Kt(this,us).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,us).get(et.queryHash))==null?void 0:rt.state}removeQueries(tt){const et=Kt(this,us);notifyManager.batch(()=>{et.findAll(tt).forEach(rt=>{et.remove(rt)})})}resetQueries(tt,et){const rt=Kt(this,us),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,us).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,us).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,us).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,us).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,Go).resumePausedMutations():Promise.resolve()}getQueryCache(){return Kt(this,us)}getMutationCache(){return Kt(this,Go)}getDefaultOptions(){return Kt(this,Wo)}setDefaultOptions(tt){Sr(this,Wo,tt)}setQueryDefaults(tt,et){Kt(this,su).set(hashKey(tt),{queryKey:tt,defaultOptions:et})}getQueryDefaults(tt){const et=[...Kt(this,su).values()],rt={};return et.forEach(st=>{partialMatchKey(tt,st.queryKey)&&Object.assign(rt,st.defaultOptions)}),rt}setMutationDefaults(tt,et){Kt(this,nu).set(hashKey(tt),{mutationKey:tt,defaultOptions:et})}getMutationDefaults(tt){const et=[...Kt(this,nu).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,Wo).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,Wo).mutations,...(tt==null?void 0:tt.mutationKey)&&this.getMutationDefaults(tt.mutationKey),...tt,_defaulted:!0}}clear(){Kt(this,us).clear(),Kt(this,Go).clear()}},us=new WeakMap,Go=new WeakMap,Wo=new WeakMap,su=new WeakMap,nu=new WeakMap,qo=new WeakMap,iu=new WeakMap,ou=new WeakMap,Jp),Hs,Gr,Fu,Ds,Tl,au,Xo,Eo,Bu,lu,uu,Cl,Al,Yo,cu,Qr,Iu,Y0,K0,Q0,Z0,J0,_d,_h,nm,em,QueryObserver=(em=class extends Subscribable{constructor(et,rt){super();Or(this,Qr);Or(this,Hs);Or(this,Gr);Or(this,Fu);Or(this,Ds);Or(this,Tl);Or(this,au);Or(this,Xo);Or(this,Eo);Or(this,Bu);Or(this,lu);Or(this,uu);Or(this,Cl);Or(this,Al);Or(this,Yo);Or(this,cu,new Set);this.options=rt,Sr(this,Hs,et),Sr(this,Eo,null),Sr(this,Xo,pendingThenable()),this.options.experimental_prefetchInRender||Kt(this,Xo).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,Gr).addObserver(this),shouldFetchOnMount(Kt(this,Gr),this.options)?Fr(this,Qr,Iu).call(this):this.updateResult(),Fr(this,Qr,Z0).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return shouldFetchOn(Kt(this,Gr),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Fr(this,Qr,J0).call(this),Fr(this,Qr,_d).call(this),Kt(this,Gr).removeObserver(this)}setOptions(et,rt){const st=this.options,nt=Kt(this,Gr);if(this.options=Kt(this,Hs).defaultQueryOptions(et),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof resolveEnabled(this.options.enabled,Kt(this,Gr))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Fr(this,Qr,_h).call(this),Kt(this,Gr).setOptions(this.options),st._defaulted&&!shallowEqualObjects(this.options,st)&&Kt(this,Hs).getQueryCache().notify({type:"observerOptionsUpdated",query:Kt(this,Gr),observer:this});const ot=this.hasListeners();ot&&shouldFetchOptionally(Kt(this,Gr),nt,this.options,st)&&Fr(this,Qr,Iu).call(this),this.updateResult(rt),ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||resolveStaleTime(this.options.staleTime,Kt(this,Gr))!==resolveStaleTime(st.staleTime,Kt(this,Gr)))&&Fr(this,Qr,Y0).call(this);const at=Fr(this,Qr,K0).call(this);ot&&(Kt(this,Gr)!==nt||resolveEnabled(this.options.enabled,Kt(this,Gr))!==resolveEnabled(st.enabled,Kt(this,Gr))||at!==Kt(this,Yo))&&Fr(this,Qr,Q0).call(this,at)}getOptimisticResult(et){const rt=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),et),st=this.createResult(rt,et);return shouldAssignObserverCurrentProperties(this,st)&&(Sr(this,Ds,st),Sr(this,au,this.options),Sr(this,Tl,Kt(this,Gr).state)),st}getCurrentResult(){return Kt(this,Ds)}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,cu).add(et)}getCurrentQuery(){return Kt(this,Gr)}refetch({...et}={}){return this.fetch({...et})}fetchOptimistic(et){const rt=Kt(this,Hs).defaultQueryOptions(et),st=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),rt);return st.fetch().then(()=>this.createResult(st,rt))}fetch(et){return Fr(this,Qr,Iu).call(this,{...et,cancelRefetch:et.cancelRefetch??!0}).then(()=>(this.updateResult(),Kt(this,Ds)))}createResult(et,rt){var Pt;const st=Kt(this,Gr),nt=this.options,ot=Kt(this,Ds),at=Kt(this,Tl),lt=Kt(this,au),ct=et!==st?et.state:Kt(this,Fu),{state:dt}=et;let ht={...dt},ft=!1,xt;if(rt._optimisticResults){const Ot=this.hasListeners(),Ut=!Ot&&shouldFetchOnMount(et,rt),Nt=Ot&&shouldFetchOptionally(et,st,rt,nt);(Ut||Nt)&&(ht={...ht,...fetchState(dt.data,et.options)}),rt._optimisticResults==="isRestoring"&&(ht.fetchStatus="idle")}let{error:vt,errorUpdatedAt:yt,status:Et}=ht;if(rt.select&&ht.data!==void 0)if(ot&&ht.data===(at==null?void 0:at.data)&&rt.select===Kt(this,Bu))xt=Kt(this,lu);else try{Sr(this,Bu,rt.select),xt=rt.select(ht.data),xt=replaceData(ot==null?void 0:ot.data,xt,rt),Sr(this,lu,xt),Sr(this,Eo,null)}catch(Ot){Sr(this,Eo,Ot)}else xt=ht.data;if(rt.placeholderData!==void 0&&xt===void 0&&Et==="pending"){let Ot;if(ot!=null&&ot.isPlaceholderData&&rt.placeholderData===(lt==null?void 0:lt.placeholderData))Ot=ot.data;else if(Ot=typeof rt.placeholderData=="function"?rt.placeholderData((Pt=Kt(this,uu))==null?void 0:Pt.state.data,Kt(this,uu)):rt.placeholderData,rt.select&&Ot!==void 0)try{Ot=rt.select(Ot),Sr(this,Eo,null)}catch(Ut){Sr(this,Eo,Ut)}Ot!==void 0&&(Et="success",xt=replaceData(ot==null?void 0:ot.data,Ot,rt),ft=!0)}Kt(this,Eo)&&(vt=Kt(this,Eo),xt=Kt(this,lu),yt=Date.now(),Et="error");const bt=ht.fetchStatus==="fetching",wt=Et==="pending",St=Et==="error",Rt=wt&&bt,Ct=xt!==void 0,jt={status:Et,fetchStatus:ht.fetchStatus,isPending:wt,isSuccess:Et==="success",isError:St,isInitialLoading:Rt,isLoading:Rt,data:xt,dataUpdatedAt:ht.dataUpdatedAt,error:vt,errorUpdatedAt:yt,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,Xo)};if(this.options.experimental_prefetchInRender){const Ot=Ht=>{jt.status==="error"?Ht.reject(jt.error):jt.data!==void 0&&Ht.resolve(jt.data)},Ut=()=>{const Ht=Sr(this,Xo,jt.promise=pendingThenable());Ot(Ht)},Nt=Kt(this,Xo);switch(Nt.status){case"pending":et.queryHash===st.queryHash&&Ot(Nt);break;case"fulfilled":(jt.status==="error"||jt.data!==Nt.value)&&Ut();break;case"rejected":(jt.status!=="error"||jt.error!==Nt.reason)&&Ut();break}}return jt}updateResult(et){const rt=Kt(this,Ds),st=this.createResult(Kt(this,Gr),this.options);if(Sr(this,Tl,Kt(this,Gr).state),Sr(this,au,this.options),Kt(this,Tl).data!==void 0&&Sr(this,uu,Kt(this,Gr)),shallowEqualObjects(st,rt))return;Sr(this,Ds,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,cu).size)return!0;const ut=new Set(lt??Kt(this,cu));return this.options.throwOnError&&ut.add("error"),Object.keys(Kt(this,Ds)).some(ct=>{const dt=ct;return Kt(this,Ds)[dt]!==rt[dt]&&ut.has(dt)})};(et==null?void 0:et.listeners)!==!1&&ot()&&(nt.listeners=!0),Fr(this,Qr,nm).call(this,{...nt,...et})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Fr(this,Qr,Z0).call(this)}},Hs=new WeakMap,Gr=new WeakMap,Fu=new WeakMap,Ds=new WeakMap,Tl=new WeakMap,au=new WeakMap,Xo=new WeakMap,Eo=new WeakMap,Bu=new WeakMap,lu=new WeakMap,uu=new WeakMap,Cl=new WeakMap,Al=new WeakMap,Yo=new WeakMap,cu=new WeakMap,Qr=new WeakSet,Iu=function(et){Fr(this,Qr,_h).call(this);let rt=Kt(this,Gr).fetch(this.options,et);return et!=null&&et.throwOnError||(rt=rt.catch(noop$1)),rt},Y0=function(){Fr(this,Qr,J0).call(this);const et=resolveStaleTime(this.options.staleTime,Kt(this,Gr));if(isServer||Kt(this,Ds).isStale||!isValidTimeout(et))return;const st=timeUntilStale(Kt(this,Ds).dataUpdatedAt,et)+1;Sr(this,Cl,setTimeout(()=>{Kt(this,Ds).isStale||this.updateResult()},st))},K0=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Kt(this,Gr)):this.options.refetchInterval)??!1},Q0=function(et){Fr(this,Qr,_d).call(this),Sr(this,Yo,et),!(isServer||resolveEnabled(this.options.enabled,Kt(this,Gr))===!1||!isValidTimeout(Kt(this,Yo))||Kt(this,Yo)===0)&&Sr(this,Al,setInterval(()=>{(this.options.refetchIntervalInBackground||focusManager.isFocused())&&Fr(this,Qr,Iu).call(this)},Kt(this,Yo)))},Z0=function(){Fr(this,Qr,Y0).call(this),Fr(this,Qr,Q0).call(this,Fr(this,Qr,K0).call(this))},J0=function(){Kt(this,Cl)&&(clearTimeout(Kt(this,Cl)),Sr(this,Cl,void 0))},_d=function(){Kt(this,Al)&&(clearInterval(Kt(this,Al)),Sr(this,Al,void 0))},_h=function(){const et=Kt(this,Hs).getQueryCache().build(Kt(this,Hs),this.options);if(et===Kt(this,Gr))return;const rt=Kt(this,Gr);Sr(this,Gr,et),Sr(this,Fu,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,Ds))}),Kt(this,Hs).getQueryCache().notify({query:Kt(this,Gr),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 vt,yt;const{state:rt}=tt,st=super.createResult(tt,et),{isFetching:nt,isRefetching:ot,isError:at,isRefetchError:lt}=st,ut=(yt=(vt=rt.fetchMeta)==null?void 0:vt.fetchMore)==null?void 0:yt.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}}},Ko,Qo,Vs,Po,jo,P1,e2,tm,MutationObserver$1=(tm=class extends Subscribable{constructor(rt,st){super();Or(this,jo);Or(this,Ko);Or(this,Qo);Or(this,Vs);Or(this,Po);Sr(this,Ko,rt),this.setOptions(st),this.bindMethods(),Fr(this,jo,P1).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,Ko).defaultMutationOptions(rt),shallowEqualObjects(this.options,st)||Kt(this,Ko).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Kt(this,Vs),observer:this}),st!=null&&st.mutationKey&&this.options.mutationKey&&hashKey(st.mutationKey)!==hashKey(this.options.mutationKey)?this.reset():((nt=Kt(this,Vs))==null?void 0:nt.state.status)==="pending"&&Kt(this,Vs).setOptions(this.options)}onUnsubscribe(){var rt;this.hasListeners()||(rt=Kt(this,Vs))==null||rt.removeObserver(this)}onMutationUpdate(rt){Fr(this,jo,P1).call(this),Fr(this,jo,e2).call(this,rt)}getCurrentResult(){return Kt(this,Qo)}reset(){var rt;(rt=Kt(this,Vs))==null||rt.removeObserver(this),Sr(this,Vs,void 0),Fr(this,jo,P1).call(this),Fr(this,jo,e2).call(this)}mutate(rt,st){var nt;return Sr(this,Po,st),(nt=Kt(this,Vs))==null||nt.removeObserver(this),Sr(this,Vs,Kt(this,Ko).getMutationCache().build(Kt(this,Ko),this.options)),Kt(this,Vs).addObserver(this),Kt(this,Vs).execute(rt)}},Ko=new WeakMap,Qo=new WeakMap,Vs=new WeakMap,Po=new WeakMap,jo=new WeakSet,P1=function(){var st;const rt=((st=Kt(this,Vs))==null?void 0:st.state)??getDefaultState();Sr(this,Qo,{...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,Po)&&this.hasListeners()){const ht=Kt(this,Qo).variables,ft=Kt(this,Qo).context;(rt==null?void 0:rt.type)==="success"?((nt=(st=Kt(this,Po)).onSuccess)==null||nt.call(st,rt.data,ht,ft),(at=(ot=Kt(this,Po)).onSettled)==null||at.call(ot,rt.data,null,ht,ft)):(rt==null?void 0:rt.type)==="error"&&((ut=(lt=Kt(this,Po)).onError)==null||ut.call(lt,rt.error,ht,ft),(dt=(ct=Kt(this,Po)).onSettled)==null||dt.call(ct,void 0,rt.error,ht,ft))}this.listeners.forEach(ht=>{ht(Kt(this,Qo))})})},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,vt;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(yt=>{const Et=nt?noop:ut.subscribe(notifyManager.batchCalls(yt));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 yt=lt?fetchOptimistic(at,ut,ot):(vt=st.getQueryCache().get(at.queryHash))==null?void 0:vt.promise;yt==null||yt.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",vt="date",yt="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 $t=["th","st","nd","rd"],Ft=kt%100;return"["+kt+($t[(Ft-20)%10]||$t[Ft]||$t[0])+"]"}},St=function(kt,$t,Ft){var Gt=String(kt);return!Gt||Gt.length>=$t?kt:""+Array($t+1-Gt.length).join(Ft)+kt},Rt={s:St,z:function(kt){var $t=-kt.utcOffset(),Ft=Math.abs($t),Gt=Math.floor(Ft/60),Mt=Ft%60;return($t<=0?"+":"-")+St(Gt,2,"0")+":"+St(Mt,2,"0")},m:function kt($t,Ft){if($t.date()<Ft.date())return-kt(Ft,$t);var Gt=12*(Ft.year()-$t.year())+(Ft.month()-$t.month()),Mt=$t.clone().add(Gt,ht),Vt=Ft-Mt<0,Bt=$t.clone().add(Gt+(Vt?-1:1),ht);return+(-(Gt+(Ft-Mt)/(Vt?Mt-Bt:Bt-Mt))||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:vt,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",It={};It[Ct]=wt;var jt="$isDayjsObject",Pt=function(kt){return kt instanceof Ht||!(!kt||!kt[jt])},Ot=function kt($t,Ft,Gt){var Mt;if(!$t)return Ct;if(typeof $t=="string"){var Vt=$t.toLowerCase();It[Vt]&&(Mt=Vt),Ft&&(It[Vt]=Ft,Mt=Vt);var Bt=$t.split("-");if(!Mt&&Bt.length>1)return kt(Bt[0])}else{var qt=$t.name;It[qt]=$t,Mt=qt}return!Gt&&Mt&&(Ct=Mt),Mt||!Gt&&Ct},Ut=function(kt,$t){if(Pt(kt))return kt.clone();var Ft=typeof $t=="object"?$t:{};return Ft.date=kt,Ft.args=arguments,new Ht(Ft)},Nt=Rt;Nt.l=Ot,Nt.i=Pt,Nt.w=function(kt,$t){return Ut(kt,{locale:$t.$L,utc:$t.$u,x:$t.$x,$offset:$t.$offset})};var Ht=function(){function kt(Ft){this.$L=Ot(Ft.locale,null,!0),this.parse(Ft),this.$x=this.$x||Ft.x||{},this[jt]=!0}var $t=kt.prototype;return $t.parse=function(Ft){this.$d=function(Gt){var Mt=Gt.date,Vt=Gt.utc;if(Mt===null)return new Date(NaN);if(Nt.u(Mt))return new Date;if(Mt instanceof Date)return new Date(Mt);if(typeof Mt=="string"&&!/Z$/i.test(Mt)){var Bt=Mt.match(Et);if(Bt){var qt=Bt[2]-1||0,Qt=(Bt[7]||"0").substring(0,3);return Vt?new Date(Date.UTC(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)):new Date(Bt[1],qt,Bt[3]||1,Bt[4]||0,Bt[5]||0,Bt[6]||0,Qt)}}return new Date(Mt)}(Ft),this.init()},$t.init=function(){var Ft=this.$d;this.$y=Ft.getFullYear(),this.$M=Ft.getMonth(),this.$D=Ft.getDate(),this.$W=Ft.getDay(),this.$H=Ft.getHours(),this.$m=Ft.getMinutes(),this.$s=Ft.getSeconds(),this.$ms=Ft.getMilliseconds()},$t.$utils=function(){return Nt},$t.isValid=function(){return this.$d.toString()!==yt},$t.isSame=function(Ft,Gt){var Mt=Ut(Ft);return this.startOf(Gt)<=Mt&&Mt<=this.endOf(Gt)},$t.isAfter=function(Ft,Gt){return Ut(Ft)<this.startOf(Gt)},$t.isBefore=function(Ft,Gt){return this.endOf(Gt)<Ut(Ft)},$t.$g=function(Ft,Gt,Mt){return Nt.u(Ft)?this[Gt]:this.set(Mt,Ft)},$t.unix=function(){return Math.floor(this.valueOf()/1e3)},$t.valueOf=function(){return this.$d.getTime()},$t.startOf=function(Ft,Gt){var Mt=this,Vt=!!Nt.u(Gt)||Gt,Bt=Nt.p(Ft),qt=function(or,hr){var pr=Nt.w(Mt.$u?Date.UTC(Mt.$y,hr,or):new Date(Mt.$y,hr,or),Mt);return Vt?pr:pr.endOf(ct)},Qt=function(or,hr){return Nt.w(Mt.toDate()[or].apply(Mt.toDate("s"),(Vt?[0,0,0,0]:[23,59,59,999]).slice(hr)),Mt)},Yt=this.$W,tr=this.$M,lr=this.$D,ur="set"+(this.$u?"UTC":"");switch(Bt){case xt:return Vt?qt(1,0):qt(31,11);case ht:return Vt?qt(1,tr):qt(0,tr+1);case dt:var mr=this.$locale().weekStart||0,yr=(Yt<mr?Yt+7:Yt)-mr;return qt(Vt?lr-yr:lr+(6-yr),tr);case ct:case vt:return Qt(ur+"Hours",0);case ut:return Qt(ur+"Minutes",1);case lt:return Qt(ur+"Seconds",2);case at:return Qt(ur+"Milliseconds",3);default:return this.clone()}},$t.endOf=function(Ft){return this.startOf(Ft,!1)},$t.$set=function(Ft,Gt){var Mt,Vt=Nt.p(Ft),Bt="set"+(this.$u?"UTC":""),qt=(Mt={},Mt[ct]=Bt+"Date",Mt[vt]=Bt+"Date",Mt[ht]=Bt+"Month",Mt[xt]=Bt+"FullYear",Mt[ut]=Bt+"Hours",Mt[lt]=Bt+"Minutes",Mt[at]=Bt+"Seconds",Mt[ot]=Bt+"Milliseconds",Mt)[Vt],Qt=Vt===ct?this.$D+(Gt-this.$W):Gt;if(Vt===ht||Vt===xt){var Yt=this.clone().set(vt,1);Yt.$d[qt](Qt),Yt.init(),this.$d=Yt.set(vt,Math.min(this.$D,Yt.daysInMonth())).$d}else qt&&this.$d[qt](Qt);return this.init(),this},$t.set=function(Ft,Gt){return this.clone().$set(Ft,Gt)},$t.get=function(Ft){return this[Nt.p(Ft)]()},$t.add=function(Ft,Gt){var Mt,Vt=this;Ft=Number(Ft);var Bt=Nt.p(Gt),qt=function(tr){var lr=Ut(Vt);return Nt.w(lr.date(lr.date()+Math.round(tr*Ft)),Vt)};if(Bt===ht)return this.set(ht,this.$M+Ft);if(Bt===xt)return this.set(xt,this.$y+Ft);if(Bt===ct)return qt(1);if(Bt===dt)return qt(7);var Qt=(Mt={},Mt[lt]=st,Mt[ut]=nt,Mt[at]=rt,Mt)[Bt]||1,Yt=this.$d.getTime()+Ft*Qt;return Nt.w(Yt,this)},$t.subtract=function(Ft,Gt){return this.add(-1*Ft,Gt)},$t.format=function(Ft){var Gt=this,Mt=this.$locale();if(!this.isValid())return Mt.invalidDate||yt;var Vt=Ft||"YYYY-MM-DDTHH:mm:ssZ",Bt=Nt.z(this),qt=this.$H,Qt=this.$m,Yt=this.$M,tr=Mt.weekdays,lr=Mt.months,ur=Mt.meridiem,mr=function(hr,pr,_r,Ar){return hr&&(hr[pr]||hr(Gt,Vt))||_r[pr].slice(0,Ar)},yr=function(hr){return Nt.s(qt%12||12,hr,"0")},or=ur||function(hr,pr,_r){var Ar=hr<12?"AM":"PM";return _r?Ar.toLowerCase():Ar};return Vt.replace(bt,function(hr,pr){return pr||function(_r){switch(_r){case"YY":return String(Gt.$y).slice(-2);case"YYYY":return Nt.s(Gt.$y,4,"0");case"M":return Yt+1;case"MM":return Nt.s(Yt+1,2,"0");case"MMM":return mr(Mt.monthsShort,Yt,lr,3);case"MMMM":return mr(lr,Yt);case"D":return Gt.$D;case"DD":return Nt.s(Gt.$D,2,"0");case"d":return String(Gt.$W);case"dd":return mr(Mt.weekdaysMin,Gt.$W,tr,2);case"ddd":return mr(Mt.weekdaysShort,Gt.$W,tr,3);case"dddd":return tr[Gt.$W];case"H":return String(qt);case"HH":return Nt.s(qt,2,"0");case"h":return yr(1);case"hh":return yr(2);case"a":return or(qt,Qt,!0);case"A":return or(qt,Qt,!1);case"m":return String(Qt);case"mm":return Nt.s(Qt,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 Bt}return null}(hr)||Bt.replace(":","")})},$t.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},$t.diff=function(Ft,Gt,Mt){var Vt,Bt=this,qt=Nt.p(Gt),Qt=Ut(Ft),Yt=(Qt.utcOffset()-this.utcOffset())*st,tr=this-Qt,lr=function(){return Nt.m(Bt,Qt)};switch(qt){case xt:Vt=lr()/12;break;case ht:Vt=lr();break;case ft:Vt=lr()/3;break;case dt:Vt=(tr-Yt)/6048e5;break;case ct:Vt=(tr-Yt)/864e5;break;case ut:Vt=tr/nt;break;case lt:Vt=tr/st;break;case at:Vt=tr/rt;break;default:Vt=tr}return Mt?Vt:Nt.a(Vt)},$t.daysInMonth=function(){return this.endOf(ht).$D},$t.$locale=function(){return It[this.$L]},$t.locale=function(Ft,Gt){if(!Ft)return this.$L;var Mt=this.clone(),Vt=Ot(Ft,Gt,!0);return Vt&&(Mt.$L=Vt),Mt},$t.clone=function(){return Nt.w(this.$d,this)},$t.toDate=function(){return new Date(this.valueOf())},$t.toJSON=function(){return this.isValid()?this.toISOString():null},$t.toISOString=function(){return this.$d.toISOString()},$t.toString=function(){return this.$d.toUTCString()},kt}(),Lt=Ht.prototype;return Ut.prototype=Lt,[["$ms",ot],["$s",at],["$m",lt],["$H",ut],["$W",ct],["$M",ht],["$y",xt],["$D",vt]].forEach(function(kt){Lt[kt[1]]=function($t){return this.$g($t,kt[0],kt[1])}}),Ut.extend=function(kt,$t){return kt.$i||(kt($t,Ht,Ut),kt.$i=!0),Ut},Ut.locale=Ot,Ut.isDayjs=Pt,Ut.unix=function(kt){return Ut(1e3*kt)},Ut.en=It[Ct],Ut.Ls=It,Ut.p={},Ut})})(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(yt){return(yt=+yt)+(yt>68?1900:2e3)},ct=function(yt){return function(Et){this[yt]=+Et}},dt=[/[+-]\d\d:?(\d\d)?|Z/,function(yt){(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}(yt)}],ht=function(yt){var Et=lt[yt];return Et&&(Et.indexOf?Et:Et.s.concat(Et.f))},ft=function(yt,Et){var bt,wt=lt.meridiem;if(wt){for(var St=1;St<=24;St+=1)if(yt.indexOf(wt(St,0,Et))>-1){bt=St>12;break}}else bt=yt===(Et?"pm":"PM");return bt},xt={A:[at,function(yt){this.afternoon=ft(yt,!1)}],a:[at,function(yt){this.afternoon=ft(yt,!0)}],S:[/\d/,function(yt){this.milliseconds=100*+yt}],SS:[nt,function(yt){this.milliseconds=10*+yt}],SSS:[/\d{3}/,function(yt){this.milliseconds=+yt}],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(yt){var Et=lt.ordinal,bt=yt.match(/\d+/);if(this.day=bt[0],Et)for(var wt=1;wt<=31;wt+=1)Et(wt).replace(/\[|\]/g,"")===yt&&(this.day=wt)}],M:[ot,ct("month")],MM:[nt,ct("month")],MMM:[at,function(yt){var Et=ht("months"),bt=(ht("monthsShort")||Et.map(function(wt){return wt.slice(0,3)})).indexOf(yt)+1;if(bt<1)throw new Error;this.month=bt%12||bt}],MMMM:[at,function(yt){var Et=ht("months").indexOf(yt)+1;if(Et<1)throw new Error;this.month=Et%12||Et}],Y:[/[+-]?\d+/,ct("year")],YY:[nt,function(yt){this.year=ut(yt)}],YYYY:[/\d{4}/,ct("year")],Z:dt,ZZ:dt};function vt(yt){var Et,bt;Et=yt,bt=lt&<.formats;for(var wt=(yt=Et.replace(/(\[[^\]]+])|(LTS?|l{1,4}|L{1,4})/g,function(Ot,Ut,Nt){var Ht=Nt&&Nt.toUpperCase();return Ut||bt[Nt]||rt[Nt]||bt[Ht].replace(/(\[[^\]]+])|(MMMM|MM|DD|dddd)/g,function(Lt,kt,$t){return kt||$t.slice(1)})})).match(st),St=wt.length,Rt=0;Rt<St;Rt+=1){var Ct=wt[Rt],It=xt[Ct],jt=It&&It[0],Pt=It&&It[1];wt[Rt]=Pt?{regex:jt,parser:Pt}:Ct.replace(/^\[|\]$/g,"")}return function(Ot){for(var Ut={},Nt=0,Ht=0;Nt<St;Nt+=1){var Lt=wt[Nt];if(typeof Lt=="string")Ht+=Lt.length;else{var kt=Lt.regex,$t=Lt.parser,Ft=Ot.slice(Ht),Gt=kt.exec(Ft)[0];$t.call(Ut,Gt),Ot=Ot.replace(Gt,"")}}return function(Mt){var Vt=Mt.afternoon;if(Vt!==void 0){var Bt=Mt.hours;Vt?Bt<12&&(Mt.hours+=12):Bt===12&&(Mt.hours=0),delete Mt.afternoon}}(Ut),Ut}}return function(yt,Et,bt){bt.p.customParseFormat=!0,yt&&yt.parseTwoDigitYear&&(ut=yt.parseTwoDigitYear);var wt=Et.prototype,St=wt.parse;wt.parse=function(Rt){var Ct=Rt.date,It=Rt.utc,jt=Rt.args;this.$u=It;var Pt=jt[1];if(typeof Pt=="string"){var Ot=jt[2]===!0,Ut=jt[3]===!0,Nt=Ot||Ut,Ht=jt[2];Ut&&(Ht=jt[2]),lt=this.$locale(),!Ot&&Ht&&(lt=bt.Ls[Ht]),this.$d=function(Ft,Gt,Mt){try{if(["x","X"].indexOf(Gt)>-1)return new Date((Gt==="X"?1e3:1)*Ft);var Vt=vt(Gt)(Ft),Bt=Vt.year,qt=Vt.month,Qt=Vt.day,Yt=Vt.hours,tr=Vt.minutes,lr=Vt.seconds,ur=Vt.milliseconds,mr=Vt.zone,yr=new Date,or=Qt||(Bt||qt?1:yr.getDate()),hr=Bt||yr.getFullYear(),pr=0;Bt&&!qt||(pr=qt>0?qt-1:yr.getMonth());var _r=Yt||0,Ar=tr||0,Hr=lr||0,Ur=ur||0;return mr?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur+60*mr.offset*1e3)):Mt?new Date(Date.UTC(hr,pr,or,_r,Ar,Hr,Ur)):new Date(hr,pr,or,_r,Ar,Hr,Ur)}catch{return new Date("")}}(Ct,Pt,It),this.init(),Ht&&Ht!==!0&&(this.$L=this.locale(Ht).$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){jt[1]=Pt[kt-1];var $t=bt.apply(this,jt);if($t.isValid()){this.$d=$t.$d,this.$L=$t.$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,vt,yt){var Et=yt&&yt.toUpperCase();return vt||ft[yt]||rt[yt]||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 vt,yt,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&&(vt=ft?nt(ct).diff(ht,Ct.d,!0):ht.diff(ct,Ct.d,!0));var It=(rt.rounding||Math.round)(Math.abs(vt));if(Et=vt>0,It<=Ct.r||!Ct.r){It<=1&&Rt>0&&(Ct=wt[Rt-1]);var jt=bt[Ct.l];xt&&(It=xt(""+It)),yt=typeof jt=="string"?jt.replace("%d",It):jt(It,dt,Ct.l,Et);break}}if(dt)return yt;var Pt=Et?bt.future:bt.past;return typeof Pt=="function"?Pt(yt):Pt.replace("%s",yt)},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=>{if(typeof window=="object"){let et=(tt?tt.querySelector("#_goober"):window._goober)||Object.assign(document.createElement("style"),{innerHTML:" ",id:"_goober"});return et.nonce=window.__nonce__,et.parentNode||(tt||document.head).appendChild(et),et.firstChild}return tt||e$1},l$1=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,a$1=/\/\*[^]*?\*\/| +/g,n$2=/\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$1={},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$1[ot]||(c$1[ot]=(ut=>{let ct=0,dt=11;for(;ct<ut.length;)dt=101*dt+ut.charCodeAt(ct++)>>>0;return"go"+dt})(ot));if(!c$1[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$2," ").trim(),ft.unshift(ft[0][ht]=ft[0][ht]||{})):ft[0][dt[1]]=dt[2].replace(n$2," ").trim();return ft[0]})(tt);c$1[at]=o$1(nt?{["@keyframes "+at]:ut}:ut,rt?"":"."+at)}let lt=rt&&c$1.g?c$1.g:null;return rt&&(c$1.g=c$1[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$1[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$1(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$1.bind({g:1});let h$2=u$1.bind({k:1});function m$1(tt,et,rt,st){o$1.p=et,d$1=tt,f$2=rt,g$1=st}function w$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$1.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 Z$1=tt=>typeof tt=="function",h$1=(tt,et)=>Z$1(tt)?tt(et):tt,W$2=(()=>{let tt=0;return()=>(++tt).toString()})(),E$1=(()=>{let tt;return()=>{if(tt===void 0&&typeof window<"u"){let et=matchMedia("(prefers-reduced-motion: reduce)");tt=!et||et.matches}return tt}})(),re$1=20,k$2="default",H$3=(tt,et)=>{let{toastLimit:rt}=tt.settings;switch(et.type){case 0:return{...tt,toasts:[et.toast,...tt.toasts].slice(0,rt)};case 1:return{...tt,toasts:tt.toasts.map(at=>at.id===et.toast.id?{...at,...et.toast}:at)};case 2:let{toast:st}=et;return H$3(tt,{type:tt.toasts.find(at=>at.id===st.id)?1:0,toast:st});case 3:let{toastId:nt}=et;return{...tt,toasts:tt.toasts.map(at=>at.id===nt||nt===void 0?{...at,dismissed:!0,visible:!1}:at)};case 4:return et.toastId===void 0?{...tt,toasts:[]}:{...tt,toasts:tt.toasts.filter(at=>at.id!==et.toastId)};case 5:return{...tt,pausedAt:et.time};case 6:let ot=et.time-(tt.pausedAt||0);return{...tt,pausedAt:void 0,toasts:tt.toasts.map(at=>({...at,pauseDuration:at.pauseDuration+ot}))}}},v$1=[],j$2={toasts:[],pausedAt:void 0,settings:{toastLimit:re$1}},f$1={},Y$1=(tt,et=k$2)=>{f$1[et]=H$3(f$1[et]||j$2,tt),v$1.forEach(([rt,st])=>{rt===et&&st(f$1[et])})},_$1=tt=>Object.keys(f$1).forEach(et=>Y$1(tt,et)),Q$1=tt=>Object.keys(f$1).find(et=>f$1[et].toasts.some(rt=>rt.id===tt)),S$1=(tt=k$2)=>et=>{Y$1(et,tt)},se$1={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},V$1=(tt={},et=k$2)=>{let[rt,st]=reactExports.useState(f$1[et]||j$2),nt=reactExports.useRef(f$1[et]);reactExports.useEffect(()=>(nt.current!==f$1[et]&&st(f$1[et]),v$1.push([et,st]),()=>{let at=v$1.findIndex(([lt])=>lt===et);at>-1&&v$1.splice(at,1)}),[et]);let ot=rt.toasts.map(at=>{var lt,ut,ct;return{...tt,...tt[at.type],...at,removeDelay:at.removeDelay||((lt=tt[at.type])==null?void 0:lt.removeDelay)||(tt==null?void 0:tt.removeDelay),duration:at.duration||((ut=tt[at.type])==null?void 0:ut.duration)||(tt==null?void 0:tt.duration)||se$1[at.type],style:{...tt.style,...(ct=tt[at.type])==null?void 0:ct.style,...at.style}}});return{...rt,toasts:ot}},ie$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)||W$2()}),P$1=tt=>(et,rt)=>{let st=ie$1(et,tt,rt);return S$1(st.toasterId||Q$1(st.id))({type:2,toast:st}),st.id},n$1=(tt,et)=>P$1("blank")(tt,et);n$1.error=P$1("error");n$1.success=P$1("success");n$1.loading=P$1("loading");n$1.custom=P$1("custom");n$1.dismiss=(tt,et)=>{let rt={type:3,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.dismissAll=tt=>n$1.dismiss(void 0,tt);n$1.remove=(tt,et)=>{let rt={type:4,toastId:tt};et?S$1(et)(rt):_$1(rt)};n$1.removeAll=tt=>n$1.remove(void 0,tt);n$1.promise=(tt,et,rt)=>{let st=n$1.loading(et.loading,{...rt,...rt==null?void 0:rt.loading});return typeof tt=="function"&&(tt=tt()),tt.then(nt=>{let ot=et.success?h$1(et.success,nt):void 0;return ot?n$1.success(ot,{id:st,...rt,...rt==null?void 0:rt.success}):n$1.dismiss(st),nt}).catch(nt=>{let ot=et.error?h$1(et.error,nt):void 0;ot?n$1.error(ot,{id:st,...rt,...rt==null?void 0:rt.error}):n$1.dismiss(st)}),tt};var ce$1=1e3,w$1=(tt,et="default")=>{let{toasts:rt,pausedAt:st}=V$1(tt,et),nt=reactExports.useRef(new Map).current,ot=reactExports.useCallback((ht,ft=ce$1)=>{if(nt.has(ht))return;let xt=setTimeout(()=>{nt.delete(ht),at({type:4,toastId:ht})},ft);nt.set(ht,xt)},[]);reactExports.useEffect(()=>{if(st)return;let ht=Date.now(),ft=rt.map(xt=>{if(xt.duration===1/0)return;let vt=(xt.duration||0)+xt.pauseDuration-(ht-xt.createdAt);if(vt<0){xt.visible&&n$1.dismiss(xt.id);return}return setTimeout(()=>n$1.dismiss(xt.id,et),vt)});return()=>{ft.forEach(xt=>xt&&clearTimeout(xt))}},[rt,st,et]);let at=reactExports.useCallback(S$1(et),[et]),lt=reactExports.useCallback(()=>{at({type:5,time:Date.now()})},[at]),ut=reactExports.useCallback((ht,ft)=>{at({type:1,toast:{id:ht,height:ft}})},[at]),ct=reactExports.useCallback(()=>{st&&at({type:6,time:Date.now()})},[st,at]),dt=reactExports.useCallback((ht,ft)=>{let{reverseOrder:xt=!1,gutter:vt=8,defaultPosition:yt}=ft||{},Et=rt.filter(St=>(St.position||yt)===(ht.position||yt)&&St.height),bt=Et.findIndex(St=>St.id===ht.id),wt=Et.filter((St,Rt)=>Rt<bt&&St.visible).length;return Et.filter(St=>St.visible).slice(...xt?[wt+1]:[0,wt]).reduce((St,Rt)=>St+(Rt.height||0)+vt,0)},[rt]);return reactExports.useEffect(()=>{rt.forEach(ht=>{if(ht.dismissed)ot(ht.id,ht.removeDelay);else{let ft=nt.get(ht.id);ft&&(clearTimeout(ft),nt.delete(ht.id))}})},[rt,ot]),{toasts:rt,handlers:{updateHeight:ut,startPause:lt,endPause:ct,calculateOffset:dt}}},de$1=h$2`
|
|
51
51
|
from {
|
|
52
52
|
transform: scale(0) rotate(45deg);
|
|
53
53
|
opacity: 0;
|
|
@@ -711,7 +711,7 @@ void main(void)
|
|
|
711
711
|
`)}}return ot.push(`
|
|
712
712
|
renderer.buffer.update(buffer);
|
|
713
713
|
`),{size:nt,syncFunc:new Function("ud","uv","renderer","syncData","buffer",ot.join(`
|
|
714
|
-
`))}}let UID=0;const defaultSyncData={textureCount:0,uboCount:0};class ShaderSystem{constructor(et){this.destroyed=!1,this.renderer=et,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=UID++}systemCheck(){if(!unsafeEvalSupported())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(et){this.gl=et,this.reset()}bind(et,rt){et.disposeRunner.add(this),et.uniforms.globals=this.renderer.globalUniforms;const st=et.program,nt=st.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(et);return this.shader=et,this.program!==st&&(this.program=st,this.gl.useProgram(nt.program)),rt||(defaultSyncData.textureCount=0,defaultSyncData.uboCount=0,this.syncUniformGroup(et.uniformGroup,defaultSyncData)),nt}setUniforms(et){const rt=this.shader.program,st=rt.glPrograms[this.renderer.CONTEXT_UID];rt.syncUniforms(st.uniformData,et,this.renderer)}syncUniformGroup(et,rt){const st=this.getGlProgram();(!et.static||et.dirtyId!==st.uniformDirtyGroups[et.id])&&(st.uniformDirtyGroups[et.id]=et.dirtyId,this.syncUniforms(et,st,rt))}syncUniforms(et,rt,st){(et.syncUniforms[this.shader.program.id]||this.createSyncGroups(et))(rt.uniformData,et.uniforms,this.renderer,st)}createSyncGroups(et){const rt=this.getSignature(et,this.shader.program.uniformData,"u");return this.cache[rt]||(this.cache[rt]=generateUniformsSync(et,this.shader.program.uniformData)),et.syncUniforms[this.shader.program.id]=this.cache[rt],et.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(et,rt){const st=this.getGlProgram();if(!et.static||et.dirtyId!==0||!st.uniformGroups[et.id]){et.dirtyId=0;const nt=st.uniformGroups[et.id]||this.createSyncBufferGroup(et,st,rt);et.buffer.update(),nt(st.uniformData,et.uniforms,this.renderer,defaultSyncData,et.buffer)}this.renderer.buffer.bindBufferBase(et.buffer,st.uniformBufferBindings[rt])}createSyncBufferGroup(et,rt,st){const{gl:nt}=this.renderer;this.renderer.buffer.bind(et.buffer);const ot=this.gl.getUniformBlockIndex(rt.program,st);rt.uniformBufferBindings[st]=this.shader.uniformBindCount,nt.uniformBlockBinding(rt.program,ot,this.shader.uniformBindCount),this.shader.uniformBindCount++;const at=this.getSignature(et,this.shader.program.uniformData,"ubo");let lt=this._uboCache[at];if(lt||(lt=this._uboCache[at]=generateUniformBufferSync(et,this.shader.program.uniformData)),et.autoManage){const ut=new Float32Array(lt.size/4);et.buffer.update(ut)}return rt.uniformGroups[et.id]=lt.syncFunc,rt.uniformGroups[et.id]}getSignature(et,rt,st){const nt=et.uniforms,ot=[`${st}-`];for(const at in nt)ot.push(at),rt[at]&&ot.push(rt[at].type);return ot.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(et){const rt=this.gl,st=et.program,nt=generateProgram(rt,st);return st.glPrograms[this.renderer.CONTEXT_UID]=nt,nt}reset(){this.program=null,this.shader=null}disposeShader(et){this.shader===et&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}ShaderSystem.extension={type:ExtensionType.RendererSystem,name:"shader"};extensions$1.add(ShaderSystem);class StartupSystem{constructor(et){this.renderer=et}run(et){const{renderer:rt}=this;rt.runners.init.emit(rt.options),et.hello&&console.log(`PixiJS 7.4.2 - ${rt.rendererLogId} - https://pixijs.com`),rt.resize(rt.screen.width,rt.screen.height)}destroy(){}}StartupSystem.defaultOptions={hello:!1},StartupSystem.extension={type:[ExtensionType.RendererSystem,ExtensionType.CanvasRendererSystem],name:"startup"};extensions$1.add(StartupSystem);function mapWebGLBlendModesToPixi(tt,et=[]){return et[BLEND_MODES.NORMAL]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.ADD]=[tt.ONE,tt.ONE],et[BLEND_MODES.MULTIPLY]=[tt.DST_COLOR,tt.ONE_MINUS_SRC_ALPHA,tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SCREEN]=[tt.ONE,tt.ONE_MINUS_SRC_COLOR,tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.OVERLAY]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.DARKEN]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.LIGHTEN]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.COLOR_DODGE]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.COLOR_BURN]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.HARD_LIGHT]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SOFT_LIGHT]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.DIFFERENCE]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.EXCLUSION]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.HUE]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SATURATION]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.COLOR]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.LUMINOSITY]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.NONE]=[0,0],et[BLEND_MODES.NORMAL_NPM]=[tt.SRC_ALPHA,tt.ONE_MINUS_SRC_ALPHA,tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.ADD_NPM]=[tt.SRC_ALPHA,tt.ONE,tt.ONE,tt.ONE],et[BLEND_MODES.SCREEN_NPM]=[tt.SRC_ALPHA,tt.ONE_MINUS_SRC_COLOR,tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SRC_IN]=[tt.DST_ALPHA,tt.ZERO],et[BLEND_MODES.SRC_OUT]=[tt.ONE_MINUS_DST_ALPHA,tt.ZERO],et[BLEND_MODES.SRC_ATOP]=[tt.DST_ALPHA,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.DST_OVER]=[tt.ONE_MINUS_DST_ALPHA,tt.ONE],et[BLEND_MODES.DST_IN]=[tt.ZERO,tt.SRC_ALPHA],et[BLEND_MODES.DST_OUT]=[tt.ZERO,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.DST_ATOP]=[tt.ONE_MINUS_DST_ALPHA,tt.SRC_ALPHA],et[BLEND_MODES.XOR]=[tt.ONE_MINUS_DST_ALPHA,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SUBTRACT]=[tt.ONE,tt.ONE,tt.ONE,tt.ONE,tt.FUNC_REVERSE_SUBTRACT,tt.FUNC_ADD],et}const BLEND=0,OFFSET=1,CULLING=2,DEPTH_TEST=3,WINDING=4,DEPTH_MASK=5,_StateSystem=class r2{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=BLEND_MODES.NONE,this._blendEq=!1,this.map=[],this.map[BLEND]=this.setBlend,this.map[OFFSET]=this.setOffset,this.map[CULLING]=this.setCullFace,this.map[DEPTH_TEST]=this.setDepthTest,this.map[WINDING]=this.setFrontFace,this.map[DEPTH_MASK]=this.setDepthMask,this.checks=[],this.defaultState=new State,this.defaultState.blend=!0}contextChange(et){this.gl=et,this.blendModes=mapWebGLBlendModesToPixi(et),this.set(this.defaultState),this.reset()}set(et){if(et=et||this.defaultState,this.stateId!==et.data){let rt=this.stateId^et.data,st=0;for(;rt;)rt&1&&this.map[st].call(this,!!(et.data&1<<st)),rt=rt>>1,st++;this.stateId=et.data}for(let rt=0;rt<this.checks.length;rt++)this.checks[rt](this,et)}forceState(et){et=et||this.defaultState;for(let rt=0;rt<this.map.length;rt++)this.map[rt].call(this,!!(et.data&1<<rt));for(let rt=0;rt<this.checks.length;rt++)this.checks[rt](this,et);this.stateId=et.data}setBlend(et){this.updateCheck(r2.checkBlendMode,et),this.gl[et?"enable":"disable"](this.gl.BLEND)}setOffset(et){this.updateCheck(r2.checkPolygonOffset,et),this.gl[et?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(et){this.gl[et?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(et){this.gl.depthMask(et)}setCullFace(et){this.gl[et?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(et){this.gl.frontFace(this.gl[et?"CW":"CCW"])}setBlendMode(et){if(et===this.blendMode)return;this.blendMode=et;const rt=this.blendModes[et],st=this.gl;rt.length===2?st.blendFunc(rt[0],rt[1]):st.blendFuncSeparate(rt[0],rt[1],rt[2],rt[3]),rt.length===6?(this._blendEq=!0,st.blendEquationSeparate(rt[4],rt[5])):this._blendEq&&(this._blendEq=!1,st.blendEquationSeparate(st.FUNC_ADD,st.FUNC_ADD))}setPolygonOffset(et,rt){this.gl.polygonOffset(et,rt)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(et,rt){const st=this.checks.indexOf(et);rt&&st===-1?this.checks.push(et):!rt&&st!==-1&&this.checks.splice(st,1)}static checkBlendMode(et,rt){et.setBlendMode(rt.blendMode)}static checkPolygonOffset(et,rt){et.setPolygonOffset(1,rt.polygonOffset)}destroy(){this.gl=null}};_StateSystem.extension={type:ExtensionType.RendererSystem,name:"state"};let StateSystem=_StateSystem;extensions$1.add(StateSystem);class SystemManager extends EventEmitter{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(et){this.addRunners(...et.runners);const rt=(et.priority??[]).filter(nt=>et.systems[nt]),st=[...rt,...Object.keys(et.systems).filter(nt=>!rt.includes(nt))];for(const nt of st)this.addSystem(et.systems[nt],nt)}addRunners(...et){et.forEach(rt=>{this.runners[rt]=new Runner(rt)})}addSystem(et,rt){const st=new et(this);if(this[rt])throw new Error(`Whoops! The name "${rt}" is already in use`);this[rt]=st,this._systemsHash[rt]=st;for(const nt in this.runners)this.runners[nt].add(st);return this}emitWithCustomOptions(et,rt){const st=Object.keys(this._systemsHash);et.items.forEach(nt=>{const ot=st.find(at=>this._systemsHash[at]===nt);nt[et.name](rt[ot])})}destroy(){Object.values(this.runners).forEach(et=>{et.destroy()}),this._systemsHash={}}}const _TextureGCSystem=class M1{constructor(et){this.renderer=et,this.count=0,this.checkCount=0,this.maxIdle=M1.defaultMaxIdle,this.checkCountMax=M1.defaultCheckCountMax,this.mode=M1.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==GC_MODES.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const et=this.renderer.texture,rt=et.managedTextures;let st=!1;for(let nt=0;nt<rt.length;nt++){const ot=rt[nt];ot.resource&&this.count-ot.touched>this.maxIdle&&(et.destroyTexture(ot,!0),rt[nt]=null,st=!0)}if(st){let nt=0;for(let ot=0;ot<rt.length;ot++)rt[ot]!==null&&(rt[nt++]=rt[ot]);rt.length=nt}}unload(et){const rt=this.renderer.texture,st=et._texture;st&&!st.framebuffer&&rt.destroyTexture(st);for(let nt=et.children.length-1;nt>=0;nt--)this.unload(et.children[nt])}destroy(){this.renderer=null}};_TextureGCSystem.defaultMode=GC_MODES.AUTO,_TextureGCSystem.defaultMaxIdle=60*60,_TextureGCSystem.defaultCheckCountMax=60*10,_TextureGCSystem.extension={type:ExtensionType.RendererSystem,name:"textureGC"};let TextureGCSystem=_TextureGCSystem;extensions$1.add(TextureGCSystem);class GLTexture{constructor(et){this.texture=et,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=TYPES.UNSIGNED_BYTE,this.internalFormat=FORMATS.RGBA,this.samplerType=0}}function mapInternalFormatToSamplerType(tt){let et;return"WebGL2RenderingContext"in globalThis&&tt instanceof globalThis.WebGL2RenderingContext?et={[tt.RGB]:SAMPLER_TYPES.FLOAT,[tt.RGBA]:SAMPLER_TYPES.FLOAT,[tt.ALPHA]:SAMPLER_TYPES.FLOAT,[tt.LUMINANCE]:SAMPLER_TYPES.FLOAT,[tt.LUMINANCE_ALPHA]:SAMPLER_TYPES.FLOAT,[tt.R8]:SAMPLER_TYPES.FLOAT,[tt.R8_SNORM]:SAMPLER_TYPES.FLOAT,[tt.RG8]:SAMPLER_TYPES.FLOAT,[tt.RG8_SNORM]:SAMPLER_TYPES.FLOAT,[tt.RGB8]:SAMPLER_TYPES.FLOAT,[tt.RGB8_SNORM]:SAMPLER_TYPES.FLOAT,[tt.RGB565]:SAMPLER_TYPES.FLOAT,[tt.RGBA4]:SAMPLER_TYPES.FLOAT,[tt.RGB5_A1]:SAMPLER_TYPES.FLOAT,[tt.RGBA8]:SAMPLER_TYPES.FLOAT,[tt.RGBA8_SNORM]:SAMPLER_TYPES.FLOAT,[tt.RGB10_A2]:SAMPLER_TYPES.FLOAT,[tt.RGB10_A2UI]:SAMPLER_TYPES.FLOAT,[tt.SRGB8]:SAMPLER_TYPES.FLOAT,[tt.SRGB8_ALPHA8]:SAMPLER_TYPES.FLOAT,[tt.R16F]:SAMPLER_TYPES.FLOAT,[tt.RG16F]:SAMPLER_TYPES.FLOAT,[tt.RGB16F]:SAMPLER_TYPES.FLOAT,[tt.RGBA16F]:SAMPLER_TYPES.FLOAT,[tt.R32F]:SAMPLER_TYPES.FLOAT,[tt.RG32F]:SAMPLER_TYPES.FLOAT,[tt.RGB32F]:SAMPLER_TYPES.FLOAT,[tt.RGBA32F]:SAMPLER_TYPES.FLOAT,[tt.R11F_G11F_B10F]:SAMPLER_TYPES.FLOAT,[tt.RGB9_E5]:SAMPLER_TYPES.FLOAT,[tt.R8I]:SAMPLER_TYPES.INT,[tt.R8UI]:SAMPLER_TYPES.UINT,[tt.R16I]:SAMPLER_TYPES.INT,[tt.R16UI]:SAMPLER_TYPES.UINT,[tt.R32I]:SAMPLER_TYPES.INT,[tt.R32UI]:SAMPLER_TYPES.UINT,[tt.RG8I]:SAMPLER_TYPES.INT,[tt.RG8UI]:SAMPLER_TYPES.UINT,[tt.RG16I]:SAMPLER_TYPES.INT,[tt.RG16UI]:SAMPLER_TYPES.UINT,[tt.RG32I]:SAMPLER_TYPES.INT,[tt.RG32UI]:SAMPLER_TYPES.UINT,[tt.RGB8I]:SAMPLER_TYPES.INT,[tt.RGB8UI]:SAMPLER_TYPES.UINT,[tt.RGB16I]:SAMPLER_TYPES.INT,[tt.RGB16UI]:SAMPLER_TYPES.UINT,[tt.RGB32I]:SAMPLER_TYPES.INT,[tt.RGB32UI]:SAMPLER_TYPES.UINT,[tt.RGBA8I]:SAMPLER_TYPES.INT,[tt.RGBA8UI]:SAMPLER_TYPES.UINT,[tt.RGBA16I]:SAMPLER_TYPES.INT,[tt.RGBA16UI]:SAMPLER_TYPES.UINT,[tt.RGBA32I]:SAMPLER_TYPES.INT,[tt.RGBA32UI]:SAMPLER_TYPES.UINT,[tt.DEPTH_COMPONENT16]:SAMPLER_TYPES.FLOAT,[tt.DEPTH_COMPONENT24]:SAMPLER_TYPES.FLOAT,[tt.DEPTH_COMPONENT32F]:SAMPLER_TYPES.FLOAT,[tt.DEPTH_STENCIL]:SAMPLER_TYPES.FLOAT,[tt.DEPTH24_STENCIL8]:SAMPLER_TYPES.FLOAT,[tt.DEPTH32F_STENCIL8]:SAMPLER_TYPES.FLOAT}:et={[tt.RGB]:SAMPLER_TYPES.FLOAT,[tt.RGBA]:SAMPLER_TYPES.FLOAT,[tt.ALPHA]:SAMPLER_TYPES.FLOAT,[tt.LUMINANCE]:SAMPLER_TYPES.FLOAT,[tt.LUMINANCE_ALPHA]:SAMPLER_TYPES.FLOAT,[tt.DEPTH_STENCIL]:SAMPLER_TYPES.FLOAT},et}function mapTypeAndFormatToInternalFormat(tt){let et;return"WebGL2RenderingContext"in globalThis&&tt instanceof globalThis.WebGL2RenderingContext?et={[TYPES.UNSIGNED_BYTE]:{[FORMATS.RGBA]:tt.RGBA8,[FORMATS.RGB]:tt.RGB8,[FORMATS.RG]:tt.RG8,[FORMATS.RED]:tt.R8,[FORMATS.RGBA_INTEGER]:tt.RGBA8UI,[FORMATS.RGB_INTEGER]:tt.RGB8UI,[FORMATS.RG_INTEGER]:tt.RG8UI,[FORMATS.RED_INTEGER]:tt.R8UI,[FORMATS.ALPHA]:tt.ALPHA,[FORMATS.LUMINANCE]:tt.LUMINANCE,[FORMATS.LUMINANCE_ALPHA]:tt.LUMINANCE_ALPHA},[TYPES.BYTE]:{[FORMATS.RGBA]:tt.RGBA8_SNORM,[FORMATS.RGB]:tt.RGB8_SNORM,[FORMATS.RG]:tt.RG8_SNORM,[FORMATS.RED]:tt.R8_SNORM,[FORMATS.RGBA_INTEGER]:tt.RGBA8I,[FORMATS.RGB_INTEGER]:tt.RGB8I,[FORMATS.RG_INTEGER]:tt.RG8I,[FORMATS.RED_INTEGER]:tt.R8I},[TYPES.UNSIGNED_SHORT]:{[FORMATS.RGBA_INTEGER]:tt.RGBA16UI,[FORMATS.RGB_INTEGER]:tt.RGB16UI,[FORMATS.RG_INTEGER]:tt.RG16UI,[FORMATS.RED_INTEGER]:tt.R16UI,[FORMATS.DEPTH_COMPONENT]:tt.DEPTH_COMPONENT16},[TYPES.SHORT]:{[FORMATS.RGBA_INTEGER]:tt.RGBA16I,[FORMATS.RGB_INTEGER]:tt.RGB16I,[FORMATS.RG_INTEGER]:tt.RG16I,[FORMATS.RED_INTEGER]:tt.R16I},[TYPES.UNSIGNED_INT]:{[FORMATS.RGBA_INTEGER]:tt.RGBA32UI,[FORMATS.RGB_INTEGER]:tt.RGB32UI,[FORMATS.RG_INTEGER]:tt.RG32UI,[FORMATS.RED_INTEGER]:tt.R32UI,[FORMATS.DEPTH_COMPONENT]:tt.DEPTH_COMPONENT24},[TYPES.INT]:{[FORMATS.RGBA_INTEGER]:tt.RGBA32I,[FORMATS.RGB_INTEGER]:tt.RGB32I,[FORMATS.RG_INTEGER]:tt.RG32I,[FORMATS.RED_INTEGER]:tt.R32I},[TYPES.FLOAT]:{[FORMATS.RGBA]:tt.RGBA32F,[FORMATS.RGB]:tt.RGB32F,[FORMATS.RG]:tt.RG32F,[FORMATS.RED]:tt.R32F,[FORMATS.DEPTH_COMPONENT]:tt.DEPTH_COMPONENT32F},[TYPES.HALF_FLOAT]:{[FORMATS.RGBA]:tt.RGBA16F,[FORMATS.RGB]:tt.RGB16F,[FORMATS.RG]:tt.RG16F,[FORMATS.RED]:tt.R16F},[TYPES.UNSIGNED_SHORT_5_6_5]:{[FORMATS.RGB]:tt.RGB565},[TYPES.UNSIGNED_SHORT_4_4_4_4]:{[FORMATS.RGBA]:tt.RGBA4},[TYPES.UNSIGNED_SHORT_5_5_5_1]:{[FORMATS.RGBA]:tt.RGB5_A1},[TYPES.UNSIGNED_INT_2_10_10_10_REV]:{[FORMATS.RGBA]:tt.RGB10_A2,[FORMATS.RGBA_INTEGER]:tt.RGB10_A2UI},[TYPES.UNSIGNED_INT_10F_11F_11F_REV]:{[FORMATS.RGB]:tt.R11F_G11F_B10F},[TYPES.UNSIGNED_INT_5_9_9_9_REV]:{[FORMATS.RGB]:tt.RGB9_E5},[TYPES.UNSIGNED_INT_24_8]:{[FORMATS.DEPTH_STENCIL]:tt.DEPTH24_STENCIL8},[TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[FORMATS.DEPTH_STENCIL]:tt.DEPTH32F_STENCIL8}}:et={[TYPES.UNSIGNED_BYTE]:{[FORMATS.RGBA]:tt.RGBA,[FORMATS.RGB]:tt.RGB,[FORMATS.ALPHA]:tt.ALPHA,[FORMATS.LUMINANCE]:tt.LUMINANCE,[FORMATS.LUMINANCE_ALPHA]:tt.LUMINANCE_ALPHA},[TYPES.UNSIGNED_SHORT_5_6_5]:{[FORMATS.RGB]:tt.RGB},[TYPES.UNSIGNED_SHORT_4_4_4_4]:{[FORMATS.RGBA]:tt.RGBA},[TYPES.UNSIGNED_SHORT_5_5_5_1]:{[FORMATS.RGBA]:tt.RGBA}},et}class TextureSystem{constructor(et){this.renderer=et,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new BaseTexture,this.hasIntegerTextures=!1}contextChange(){const et=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=mapTypeAndFormatToInternalFormat(et),this.samplerTypes=mapInternalFormatToSamplerType(et);const rt=et.getParameter(et.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=rt;for(let nt=0;nt<rt;nt++)this.boundTextures[nt]=null;this.emptyTextures={};const st=new GLTexture(et.createTexture());et.bindTexture(et.TEXTURE_2D,st.texture),et.texImage2D(et.TEXTURE_2D,0,et.RGBA,1,1,0,et.RGBA,et.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[et.TEXTURE_2D]=st,this.emptyTextures[et.TEXTURE_CUBE_MAP]=new GLTexture(et.createTexture()),et.bindTexture(et.TEXTURE_CUBE_MAP,this.emptyTextures[et.TEXTURE_CUBE_MAP].texture);for(let nt=0;nt<6;nt++)et.texImage2D(et.TEXTURE_CUBE_MAP_POSITIVE_X+nt,0,et.RGBA,1,1,0,et.RGBA,et.UNSIGNED_BYTE,null);et.texParameteri(et.TEXTURE_CUBE_MAP,et.TEXTURE_MAG_FILTER,et.LINEAR),et.texParameteri(et.TEXTURE_CUBE_MAP,et.TEXTURE_MIN_FILTER,et.LINEAR);for(let nt=0;nt<this.boundTextures.length;nt++)this.bind(null,nt)}bind(et,rt=0){const{gl:st}=this;if(et=et==null?void 0:et.castToBaseTexture(),(et==null?void 0:et.valid)&&!et.parentTextureArray){et.touched=this.renderer.textureGC.count;const nt=et._glTextures[this.CONTEXT_UID]||this.initTexture(et);this.boundTextures[rt]!==et&&(this.currentLocation!==rt&&(this.currentLocation=rt,st.activeTexture(st.TEXTURE0+rt)),st.bindTexture(et.target,nt.texture)),nt.dirtyId!==et.dirtyId?(this.currentLocation!==rt&&(this.currentLocation=rt,st.activeTexture(st.TEXTURE0+rt)),this.updateTexture(et)):nt.dirtyStyleId!==et.dirtyStyleId&&this.updateTextureStyle(et),this.boundTextures[rt]=et}else this.currentLocation!==rt&&(this.currentLocation=rt,st.activeTexture(st.TEXTURE0+rt)),st.bindTexture(st.TEXTURE_2D,this.emptyTextures[st.TEXTURE_2D].texture),this.boundTextures[rt]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let et=0;et<this.boundTextures.length;et++)this.boundTextures[et]=this.unknownTexture}unbind(et){const{gl:rt,boundTextures:st}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let nt=0;nt<st.length;nt++)st[nt]===this.unknownTexture&&this.bind(null,nt)}for(let nt=0;nt<st.length;nt++)st[nt]===et&&(this.currentLocation!==nt&&(rt.activeTexture(rt.TEXTURE0+nt),this.currentLocation=nt),rt.bindTexture(et.target,this.emptyTextures[et.target].texture),st[nt]=null)}ensureSamplerType(et){const{boundTextures:rt,hasIntegerTextures:st,CONTEXT_UID:nt}=this;if(st)for(let ot=et-1;ot>=0;--ot){const at=rt[ot];at&&at._glTextures[nt].samplerType!==SAMPLER_TYPES.FLOAT&&this.renderer.texture.unbind(at)}}initTexture(et){const rt=new GLTexture(this.gl.createTexture());return rt.dirtyId=-1,et._glTextures[this.CONTEXT_UID]=rt,this.managedTextures.push(et),et.on("dispose",this.destroyTexture,this),rt}initTextureType(et,rt){var st;rt.internalFormat=((st=this.internalFormats[et.type])==null?void 0:st[et.format])??et.format,rt.samplerType=this.samplerTypes[rt.internalFormat]??SAMPLER_TYPES.FLOAT,this.webGLVersion===2&&et.type===TYPES.HALF_FLOAT?rt.type=this.gl.HALF_FLOAT:rt.type=et.type}updateTexture(et){var nt;const rt=et._glTextures[this.CONTEXT_UID];if(!rt)return;const st=this.renderer;if(this.initTextureType(et,rt),(nt=et.resource)==null?void 0:nt.upload(st,et,rt))rt.samplerType!==SAMPLER_TYPES.FLOAT&&(this.hasIntegerTextures=!0);else{const ot=et.realWidth,at=et.realHeight,lt=st.gl;(rt.width!==ot||rt.height!==at||rt.dirtyId<0)&&(rt.width=ot,rt.height=at,lt.texImage2D(et.target,0,rt.internalFormat,ot,at,0,et.format,rt.type,null))}et.dirtyStyleId!==rt.dirtyStyleId&&this.updateTextureStyle(et),rt.dirtyId=et.dirtyId}destroyTexture(et,rt){const{gl:st}=this;if(et=et.castToBaseTexture(),et._glTextures[this.CONTEXT_UID]&&(this.unbind(et),st.deleteTexture(et._glTextures[this.CONTEXT_UID].texture),et.off("dispose",this.destroyTexture,this),delete et._glTextures[this.CONTEXT_UID],!rt)){const nt=this.managedTextures.indexOf(et);nt!==-1&&removeItems(this.managedTextures,nt,1)}}updateTextureStyle(et){var st;const rt=et._glTextures[this.CONTEXT_UID];rt&&((et.mipmap===MIPMAP_MODES.POW2||this.webGLVersion!==2)&&!et.isPowerOfTwo?rt.mipmap=!1:rt.mipmap=et.mipmap>=1,this.webGLVersion!==2&&!et.isPowerOfTwo?rt.wrapMode=WRAP_MODES.CLAMP:rt.wrapMode=et.wrapMode,(st=et.resource)!=null&&st.style(this.renderer,et,rt)||this.setStyle(et,rt),rt.dirtyStyleId=et.dirtyStyleId)}setStyle(et,rt){const st=this.gl;if(rt.mipmap&&et.mipmap!==MIPMAP_MODES.ON_MANUAL&&st.generateMipmap(et.target),st.texParameteri(et.target,st.TEXTURE_WRAP_S,rt.wrapMode),st.texParameteri(et.target,st.TEXTURE_WRAP_T,rt.wrapMode),rt.mipmap){st.texParameteri(et.target,st.TEXTURE_MIN_FILTER,et.scaleMode===SCALE_MODES.LINEAR?st.LINEAR_MIPMAP_LINEAR:st.NEAREST_MIPMAP_NEAREST);const nt=this.renderer.context.extensions.anisotropicFiltering;if(nt&&et.anisotropicLevel>0&&et.scaleMode===SCALE_MODES.LINEAR){const ot=Math.min(et.anisotropicLevel,st.getParameter(nt.MAX_TEXTURE_MAX_ANISOTROPY_EXT));st.texParameterf(et.target,nt.TEXTURE_MAX_ANISOTROPY_EXT,ot)}}else st.texParameteri(et.target,st.TEXTURE_MIN_FILTER,et.scaleMode===SCALE_MODES.LINEAR?st.LINEAR:st.NEAREST);st.texParameteri(et.target,st.TEXTURE_MAG_FILTER,et.scaleMode===SCALE_MODES.LINEAR?st.LINEAR:st.NEAREST)}destroy(){this.renderer=null}}TextureSystem.extension={type:ExtensionType.RendererSystem,name:"texture"};extensions$1.add(TextureSystem);class TransformFeedbackSystem{constructor(et){this.renderer=et}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(et){const{gl:rt,CONTEXT_UID:st}=this,nt=et._glTransformFeedbacks[st]||this.createGLTransformFeedback(et);rt.bindTransformFeedback(rt.TRANSFORM_FEEDBACK,nt)}unbind(){const{gl:et}=this;et.bindTransformFeedback(et.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(et,rt){const{gl:st,renderer:nt}=this;rt&&nt.shader.bind(rt),st.beginTransformFeedback(et)}endTransformFeedback(){const{gl:et}=this;et.endTransformFeedback()}createGLTransformFeedback(et){const{gl:rt,renderer:st,CONTEXT_UID:nt}=this,ot=rt.createTransformFeedback();et._glTransformFeedbacks[nt]=ot,rt.bindTransformFeedback(rt.TRANSFORM_FEEDBACK,ot);for(let at=0;at<et.buffers.length;at++){const lt=et.buffers[at];lt&&(st.buffer.update(lt),lt._glBuffers[nt].refCount++,rt.bindBufferBase(rt.TRANSFORM_FEEDBACK_BUFFER,at,lt._glBuffers[nt].buffer||null))}return rt.bindTransformFeedback(rt.TRANSFORM_FEEDBACK,null),et.disposeRunner.add(this),ot}disposeTransformFeedback(et,rt){const st=et._glTransformFeedbacks[this.CONTEXT_UID],nt=this.gl;et.disposeRunner.remove(this);const ot=this.renderer.buffer;if(ot)for(let at=0;at<et.buffers.length;at++){const lt=et.buffers[at];if(!lt)continue;const ut=lt._glBuffers[this.CONTEXT_UID];ut&&(ut.refCount--,ut.refCount===0&&!rt&&ot.dispose(lt,rt))}st&&(rt||nt.deleteTransformFeedback(st),delete et._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}TransformFeedbackSystem.extension={type:ExtensionType.RendererSystem,name:"transformFeedback"};extensions$1.add(TransformFeedbackSystem);class ViewSystem{constructor(et){this.renderer=et}init(et){this.screen=new Rectangle(0,0,et.width,et.height),this.element=et.view||settings.ADAPTER.createCanvas(),this.resolution=et.resolution||settings.RESOLUTION,this.autoDensity=!!et.autoDensity}resizeView(et,rt){this.element.width=Math.round(et*this.resolution),this.element.height=Math.round(rt*this.resolution);const st=this.element.width/this.resolution,nt=this.element.height/this.resolution;this.screen.width=st,this.screen.height=nt,this.autoDensity&&(this.element.style.width=`${st}px`,this.element.style.height=`${nt}px`),this.renderer.emit("resize",st,nt),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(et){var rt;et&&((rt=this.element.parentNode)==null||rt.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}ViewSystem.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},ViewSystem.extension={type:[ExtensionType.RendererSystem,ExtensionType.CanvasRendererSystem],name:"_view"};extensions$1.add(ViewSystem);settings.PREFER_ENV=ENV.WEBGL2;settings.STRICT_TEXTURE_CACHE=!1;settings.RENDER_OPTIONS={...ContextSystem.defaultOptions,...BackgroundSystem.defaultOptions,...ViewSystem.defaultOptions,...StartupSystem.defaultOptions};Object.defineProperties(settings,{WRAP_MODE:{get(){return BaseTexture.defaultOptions.wrapMode},set(tt){deprecation("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),BaseTexture.defaultOptions.wrapMode=tt}},SCALE_MODE:{get(){return BaseTexture.defaultOptions.scaleMode},set(tt){deprecation("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),BaseTexture.defaultOptions.scaleMode=tt}},MIPMAP_TEXTURES:{get(){return BaseTexture.defaultOptions.mipmap},set(tt){deprecation("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),BaseTexture.defaultOptions.mipmap=tt}},ANISOTROPIC_LEVEL:{get(){return BaseTexture.defaultOptions.anisotropicLevel},set(tt){deprecation("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),BaseTexture.defaultOptions.anisotropicLevel=tt}},FILTER_RESOLUTION:{get(){return deprecation("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Filter.defaultResolution},set(tt){Filter.defaultResolution=tt}},FILTER_MULTISAMPLE:{get(){return deprecation("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Filter.defaultMultisample},set(tt){Filter.defaultMultisample=tt}},SPRITE_MAX_TEXTURES:{get(){return BatchRenderer.defaultMaxTextures},set(tt){deprecation("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),BatchRenderer.defaultMaxTextures=tt}},SPRITE_BATCH_SIZE:{get(){return BatchRenderer.defaultBatchSize},set(tt){deprecation("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),BatchRenderer.defaultBatchSize=tt}},CAN_UPLOAD_SAME_BUFFER:{get(){return BatchRenderer.canUploadSameBuffer},set(tt){deprecation("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),BatchRenderer.canUploadSameBuffer=tt}},GC_MODE:{get(){return TextureGCSystem.defaultMode},set(tt){deprecation("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),TextureGCSystem.defaultMode=tt}},GC_MAX_IDLE:{get(){return TextureGCSystem.defaultMaxIdle},set(tt){deprecation("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),TextureGCSystem.defaultMaxIdle=tt}},GC_MAX_CHECK_COUNT:{get(){return TextureGCSystem.defaultCheckCountMax},set(tt){deprecation("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),TextureGCSystem.defaultCheckCountMax=tt}},PRECISION_VERTEX:{get(){return Program.defaultVertexPrecision},set(tt){deprecation("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Program.defaultVertexPrecision=tt}},PRECISION_FRAGMENT:{get(){return Program.defaultFragmentPrecision},set(tt){deprecation("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Program.defaultFragmentPrecision=tt}}});var UPDATE_PRIORITY=(tt=>(tt[tt.INTERACTION=50]="INTERACTION",tt[tt.HIGH=25]="HIGH",tt[tt.NORMAL=0]="NORMAL",tt[tt.LOW=-25]="LOW",tt[tt.UTILITY=-50]="UTILITY",tt))(UPDATE_PRIORITY||{});class TickerListener{constructor(et,rt=null,st=0,nt=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=et,this.context=rt,this.priority=st,this.once=nt}match(et,rt=null){return this.fn===et&&this.context===rt}emit(et){this.fn&&(this.context?this.fn.call(this.context,et):this.fn(et));const rt=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),rt}connect(et){this.previous=et,et.next&&(et.next.previous=this),this.next=et.next,et.next=this}destroy(et=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const rt=this.next;return this.next=et?null:rt,this.previous=null,rt}}const _Ticker=class Zs{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new TickerListener(null,null,1/0),this.deltaMS=1/Zs.targetFPMS,this.elapsedMS=1/Zs.targetFPMS,this._tick=et=>{this._requestId=null,this.started&&(this.update(et),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(et,rt,st=UPDATE_PRIORITY.NORMAL){return this._addListener(new TickerListener(et,rt,st))}addOnce(et,rt,st=UPDATE_PRIORITY.NORMAL){return this._addListener(new TickerListener(et,rt,st,!0))}_addListener(et){let rt=this._head.next,st=this._head;if(!rt)et.connect(st);else{for(;rt;){if(et.priority>rt.priority){et.connect(st);break}st=rt,rt=rt.next}et.previous||et.connect(st)}return this._startIfPossible(),this}remove(et,rt){let st=this._head.next;for(;st;)st.match(et,rt)?st=st.destroy():st=st.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let et=0,rt=this._head;for(;rt=rt.next;)et++;return et}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let et=this._head.next;for(;et;)et=et.destroy(!0);this._head.destroy(),this._head=null}}update(et=performance.now()){let rt;if(et>this.lastTime){if(rt=this.elapsedMS=et-this.lastTime,rt>this._maxElapsedMS&&(rt=this._maxElapsedMS),rt*=this.speed,this._minElapsedMS){const ot=et-this._lastFrame|0;if(ot<this._minElapsedMS)return;this._lastFrame=et-ot%this._minElapsedMS}this.deltaMS=rt,this.deltaTime=this.deltaMS*Zs.targetFPMS;const st=this._head;let nt=st.next;for(;nt;)nt=nt.emit(this.deltaTime);st.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=et}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(et){const rt=Math.min(this.maxFPS,et),st=Math.min(Math.max(0,rt)/1e3,Zs.targetFPMS);this._maxElapsedMS=1/st}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(et){if(et===0)this._minElapsedMS=0;else{const rt=Math.max(this.minFPS,et);this._minElapsedMS=1/(rt/1e3)}}static get shared(){if(!Zs._shared){const et=Zs._shared=new Zs;et.autoStart=!0,et._protected=!0}return Zs._shared}static get system(){if(!Zs._system){const et=Zs._system=new Zs;et.autoStart=!0,et._protected=!0}return Zs._system}};_Ticker.targetFPMS=.06;let Ticker=_Ticker;Object.defineProperties(settings,{TARGET_FPMS:{get(){return Ticker.targetFPMS},set(tt){deprecation("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),Ticker.targetFPMS=tt}}});class TickerPlugin{static init(et){et=Object.assign({autoStart:!0,sharedTicker:!1},et),Object.defineProperty(this,"ticker",{set(rt){this._ticker&&this._ticker.remove(this.render,this),this._ticker=rt,rt&&rt.add(this.render,this,UPDATE_PRIORITY.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=et.sharedTicker?Ticker.shared:new Ticker,et.autoStart&&this.start()}static destroy(){if(this._ticker){const et=this._ticker;this.ticker=null,et.destroy()}}}TickerPlugin.extension=ExtensionType.Application;extensions$1.add(TickerPlugin);const renderers=[];extensions$1.handleByList(ExtensionType.Renderer,renderers);function autoDetectRenderer(tt){for(const et of renderers)if(et.test(tt))return new et(tt);throw new Error("Unable to auto-detect a suitable renderer.")}var $defaultVertex=`attribute vec2 aVertexPosition;
|
|
714
|
+
`))}}let UID=0;const defaultSyncData={textureCount:0,uboCount:0};class ShaderSystem{constructor(et){this.destroyed=!1,this.renderer=et,this.systemCheck(),this.gl=null,this.shader=null,this.program=null,this.cache={},this._uboCache={},this.id=UID++}systemCheck(){if(!unsafeEvalSupported())throw new Error("Current environment does not allow unsafe-eval, please use @pixi/unsafe-eval module to enable support.")}contextChange(et){this.gl=et,this.reset()}bind(et,rt){et.disposeRunner.add(this),et.uniforms.globals=this.renderer.globalUniforms;const st=et.program,nt=st.glPrograms[this.renderer.CONTEXT_UID]||this.generateProgram(et);return this.shader=et,this.program!==st&&(this.program=st,this.gl.useProgram(nt.program)),rt||(defaultSyncData.textureCount=0,defaultSyncData.uboCount=0,this.syncUniformGroup(et.uniformGroup,defaultSyncData)),nt}setUniforms(et){const rt=this.shader.program,st=rt.glPrograms[this.renderer.CONTEXT_UID];rt.syncUniforms(st.uniformData,et,this.renderer)}syncUniformGroup(et,rt){const st=this.getGlProgram();(!et.static||et.dirtyId!==st.uniformDirtyGroups[et.id])&&(st.uniformDirtyGroups[et.id]=et.dirtyId,this.syncUniforms(et,st,rt))}syncUniforms(et,rt,st){(et.syncUniforms[this.shader.program.id]||this.createSyncGroups(et))(rt.uniformData,et.uniforms,this.renderer,st)}createSyncGroups(et){const rt=this.getSignature(et,this.shader.program.uniformData,"u");return this.cache[rt]||(this.cache[rt]=generateUniformsSync(et,this.shader.program.uniformData)),et.syncUniforms[this.shader.program.id]=this.cache[rt],et.syncUniforms[this.shader.program.id]}syncUniformBufferGroup(et,rt){const st=this.getGlProgram();if(!et.static||et.dirtyId!==0||!st.uniformGroups[et.id]){et.dirtyId=0;const nt=st.uniformGroups[et.id]||this.createSyncBufferGroup(et,st,rt);et.buffer.update(),nt(st.uniformData,et.uniforms,this.renderer,defaultSyncData,et.buffer)}this.renderer.buffer.bindBufferBase(et.buffer,st.uniformBufferBindings[rt])}createSyncBufferGroup(et,rt,st){const{gl:nt}=this.renderer;this.renderer.buffer.bind(et.buffer);const ot=this.gl.getUniformBlockIndex(rt.program,st);rt.uniformBufferBindings[st]=this.shader.uniformBindCount,nt.uniformBlockBinding(rt.program,ot,this.shader.uniformBindCount),this.shader.uniformBindCount++;const at=this.getSignature(et,this.shader.program.uniformData,"ubo");let lt=this._uboCache[at];if(lt||(lt=this._uboCache[at]=generateUniformBufferSync(et,this.shader.program.uniformData)),et.autoManage){const ut=new Float32Array(lt.size/4);et.buffer.update(ut)}return rt.uniformGroups[et.id]=lt.syncFunc,rt.uniformGroups[et.id]}getSignature(et,rt,st){const nt=et.uniforms,ot=[`${st}-`];for(const at in nt)ot.push(at),rt[at]&&ot.push(rt[at].type);return ot.join("-")}getGlProgram(){return this.shader?this.shader.program.glPrograms[this.renderer.CONTEXT_UID]:null}generateProgram(et){const rt=this.gl,st=et.program,nt=generateProgram(rt,st);return st.glPrograms[this.renderer.CONTEXT_UID]=nt,nt}reset(){this.program=null,this.shader=null}disposeShader(et){this.shader===et&&(this.shader=null)}destroy(){this.renderer=null,this.destroyed=!0}}ShaderSystem.extension={type:ExtensionType.RendererSystem,name:"shader"};extensions$1.add(ShaderSystem);class StartupSystem{constructor(et){this.renderer=et}run(et){const{renderer:rt}=this;rt.runners.init.emit(rt.options),et.hello&&console.log(`PixiJS 7.4.2 - ${rt.rendererLogId} - https://pixijs.com`),rt.resize(rt.screen.width,rt.screen.height)}destroy(){}}StartupSystem.defaultOptions={hello:!1},StartupSystem.extension={type:[ExtensionType.RendererSystem,ExtensionType.CanvasRendererSystem],name:"startup"};extensions$1.add(StartupSystem);function mapWebGLBlendModesToPixi(tt,et=[]){return et[BLEND_MODES.NORMAL]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.ADD]=[tt.ONE,tt.ONE],et[BLEND_MODES.MULTIPLY]=[tt.DST_COLOR,tt.ONE_MINUS_SRC_ALPHA,tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SCREEN]=[tt.ONE,tt.ONE_MINUS_SRC_COLOR,tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.OVERLAY]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.DARKEN]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.LIGHTEN]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.COLOR_DODGE]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.COLOR_BURN]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.HARD_LIGHT]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SOFT_LIGHT]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.DIFFERENCE]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.EXCLUSION]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.HUE]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SATURATION]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.COLOR]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.LUMINOSITY]=[tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.NONE]=[0,0],et[BLEND_MODES.NORMAL_NPM]=[tt.SRC_ALPHA,tt.ONE_MINUS_SRC_ALPHA,tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.ADD_NPM]=[tt.SRC_ALPHA,tt.ONE,tt.ONE,tt.ONE],et[BLEND_MODES.SCREEN_NPM]=[tt.SRC_ALPHA,tt.ONE_MINUS_SRC_COLOR,tt.ONE,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SRC_IN]=[tt.DST_ALPHA,tt.ZERO],et[BLEND_MODES.SRC_OUT]=[tt.ONE_MINUS_DST_ALPHA,tt.ZERO],et[BLEND_MODES.SRC_ATOP]=[tt.DST_ALPHA,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.DST_OVER]=[tt.ONE_MINUS_DST_ALPHA,tt.ONE],et[BLEND_MODES.DST_IN]=[tt.ZERO,tt.SRC_ALPHA],et[BLEND_MODES.DST_OUT]=[tt.ZERO,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.DST_ATOP]=[tt.ONE_MINUS_DST_ALPHA,tt.SRC_ALPHA],et[BLEND_MODES.XOR]=[tt.ONE_MINUS_DST_ALPHA,tt.ONE_MINUS_SRC_ALPHA],et[BLEND_MODES.SUBTRACT]=[tt.ONE,tt.ONE,tt.ONE,tt.ONE,tt.FUNC_REVERSE_SUBTRACT,tt.FUNC_ADD],et}const BLEND=0,OFFSET=1,CULLING=2,DEPTH_TEST=3,WINDING=4,DEPTH_MASK=5,_StateSystem=class t2{constructor(){this.gl=null,this.stateId=0,this.polygonOffset=0,this.blendMode=BLEND_MODES.NONE,this._blendEq=!1,this.map=[],this.map[BLEND]=this.setBlend,this.map[OFFSET]=this.setOffset,this.map[CULLING]=this.setCullFace,this.map[DEPTH_TEST]=this.setDepthTest,this.map[WINDING]=this.setFrontFace,this.map[DEPTH_MASK]=this.setDepthMask,this.checks=[],this.defaultState=new State,this.defaultState.blend=!0}contextChange(et){this.gl=et,this.blendModes=mapWebGLBlendModesToPixi(et),this.set(this.defaultState),this.reset()}set(et){if(et=et||this.defaultState,this.stateId!==et.data){let rt=this.stateId^et.data,st=0;for(;rt;)rt&1&&this.map[st].call(this,!!(et.data&1<<st)),rt=rt>>1,st++;this.stateId=et.data}for(let rt=0;rt<this.checks.length;rt++)this.checks[rt](this,et)}forceState(et){et=et||this.defaultState;for(let rt=0;rt<this.map.length;rt++)this.map[rt].call(this,!!(et.data&1<<rt));for(let rt=0;rt<this.checks.length;rt++)this.checks[rt](this,et);this.stateId=et.data}setBlend(et){this.updateCheck(t2.checkBlendMode,et),this.gl[et?"enable":"disable"](this.gl.BLEND)}setOffset(et){this.updateCheck(t2.checkPolygonOffset,et),this.gl[et?"enable":"disable"](this.gl.POLYGON_OFFSET_FILL)}setDepthTest(et){this.gl[et?"enable":"disable"](this.gl.DEPTH_TEST)}setDepthMask(et){this.gl.depthMask(et)}setCullFace(et){this.gl[et?"enable":"disable"](this.gl.CULL_FACE)}setFrontFace(et){this.gl.frontFace(this.gl[et?"CW":"CCW"])}setBlendMode(et){if(et===this.blendMode)return;this.blendMode=et;const rt=this.blendModes[et],st=this.gl;rt.length===2?st.blendFunc(rt[0],rt[1]):st.blendFuncSeparate(rt[0],rt[1],rt[2],rt[3]),rt.length===6?(this._blendEq=!0,st.blendEquationSeparate(rt[4],rt[5])):this._blendEq&&(this._blendEq=!1,st.blendEquationSeparate(st.FUNC_ADD,st.FUNC_ADD))}setPolygonOffset(et,rt){this.gl.polygonOffset(et,rt)}reset(){this.gl.pixelStorei(this.gl.UNPACK_FLIP_Y_WEBGL,!1),this.forceState(this.defaultState),this._blendEq=!0,this.blendMode=-1,this.setBlendMode(0)}updateCheck(et,rt){const st=this.checks.indexOf(et);rt&&st===-1?this.checks.push(et):!rt&&st!==-1&&this.checks.splice(st,1)}static checkBlendMode(et,rt){et.setBlendMode(rt.blendMode)}static checkPolygonOffset(et,rt){et.setPolygonOffset(1,rt.polygonOffset)}destroy(){this.gl=null}};_StateSystem.extension={type:ExtensionType.RendererSystem,name:"state"};let StateSystem=_StateSystem;extensions$1.add(StateSystem);class SystemManager extends EventEmitter{constructor(){super(...arguments),this.runners={},this._systemsHash={}}setup(et){this.addRunners(...et.runners);const rt=(et.priority??[]).filter(nt=>et.systems[nt]),st=[...rt,...Object.keys(et.systems).filter(nt=>!rt.includes(nt))];for(const nt of st)this.addSystem(et.systems[nt],nt)}addRunners(...et){et.forEach(rt=>{this.runners[rt]=new Runner(rt)})}addSystem(et,rt){const st=new et(this);if(this[rt])throw new Error(`Whoops! The name "${rt}" is already in use`);this[rt]=st,this._systemsHash[rt]=st;for(const nt in this.runners)this.runners[nt].add(st);return this}emitWithCustomOptions(et,rt){const st=Object.keys(this._systemsHash);et.items.forEach(nt=>{const ot=st.find(at=>this._systemsHash[at]===nt);nt[et.name](rt[ot])})}destroy(){Object.values(this.runners).forEach(et=>{et.destroy()}),this._systemsHash={}}}const _TextureGCSystem=class M1{constructor(et){this.renderer=et,this.count=0,this.checkCount=0,this.maxIdle=M1.defaultMaxIdle,this.checkCountMax=M1.defaultCheckCountMax,this.mode=M1.defaultMode}postrender(){this.renderer.objectRenderer.renderingToScreen&&(this.count++,this.mode!==GC_MODES.MANUAL&&(this.checkCount++,this.checkCount>this.checkCountMax&&(this.checkCount=0,this.run())))}run(){const et=this.renderer.texture,rt=et.managedTextures;let st=!1;for(let nt=0;nt<rt.length;nt++){const ot=rt[nt];ot.resource&&this.count-ot.touched>this.maxIdle&&(et.destroyTexture(ot,!0),rt[nt]=null,st=!0)}if(st){let nt=0;for(let ot=0;ot<rt.length;ot++)rt[ot]!==null&&(rt[nt++]=rt[ot]);rt.length=nt}}unload(et){const rt=this.renderer.texture,st=et._texture;st&&!st.framebuffer&&rt.destroyTexture(st);for(let nt=et.children.length-1;nt>=0;nt--)this.unload(et.children[nt])}destroy(){this.renderer=null}};_TextureGCSystem.defaultMode=GC_MODES.AUTO,_TextureGCSystem.defaultMaxIdle=60*60,_TextureGCSystem.defaultCheckCountMax=60*10,_TextureGCSystem.extension={type:ExtensionType.RendererSystem,name:"textureGC"};let TextureGCSystem=_TextureGCSystem;extensions$1.add(TextureGCSystem);class GLTexture{constructor(et){this.texture=et,this.width=-1,this.height=-1,this.dirtyId=-1,this.dirtyStyleId=-1,this.mipmap=!1,this.wrapMode=33071,this.type=TYPES.UNSIGNED_BYTE,this.internalFormat=FORMATS.RGBA,this.samplerType=0}}function mapInternalFormatToSamplerType(tt){let et;return"WebGL2RenderingContext"in globalThis&&tt instanceof globalThis.WebGL2RenderingContext?et={[tt.RGB]:SAMPLER_TYPES.FLOAT,[tt.RGBA]:SAMPLER_TYPES.FLOAT,[tt.ALPHA]:SAMPLER_TYPES.FLOAT,[tt.LUMINANCE]:SAMPLER_TYPES.FLOAT,[tt.LUMINANCE_ALPHA]:SAMPLER_TYPES.FLOAT,[tt.R8]:SAMPLER_TYPES.FLOAT,[tt.R8_SNORM]:SAMPLER_TYPES.FLOAT,[tt.RG8]:SAMPLER_TYPES.FLOAT,[tt.RG8_SNORM]:SAMPLER_TYPES.FLOAT,[tt.RGB8]:SAMPLER_TYPES.FLOAT,[tt.RGB8_SNORM]:SAMPLER_TYPES.FLOAT,[tt.RGB565]:SAMPLER_TYPES.FLOAT,[tt.RGBA4]:SAMPLER_TYPES.FLOAT,[tt.RGB5_A1]:SAMPLER_TYPES.FLOAT,[tt.RGBA8]:SAMPLER_TYPES.FLOAT,[tt.RGBA8_SNORM]:SAMPLER_TYPES.FLOAT,[tt.RGB10_A2]:SAMPLER_TYPES.FLOAT,[tt.RGB10_A2UI]:SAMPLER_TYPES.FLOAT,[tt.SRGB8]:SAMPLER_TYPES.FLOAT,[tt.SRGB8_ALPHA8]:SAMPLER_TYPES.FLOAT,[tt.R16F]:SAMPLER_TYPES.FLOAT,[tt.RG16F]:SAMPLER_TYPES.FLOAT,[tt.RGB16F]:SAMPLER_TYPES.FLOAT,[tt.RGBA16F]:SAMPLER_TYPES.FLOAT,[tt.R32F]:SAMPLER_TYPES.FLOAT,[tt.RG32F]:SAMPLER_TYPES.FLOAT,[tt.RGB32F]:SAMPLER_TYPES.FLOAT,[tt.RGBA32F]:SAMPLER_TYPES.FLOAT,[tt.R11F_G11F_B10F]:SAMPLER_TYPES.FLOAT,[tt.RGB9_E5]:SAMPLER_TYPES.FLOAT,[tt.R8I]:SAMPLER_TYPES.INT,[tt.R8UI]:SAMPLER_TYPES.UINT,[tt.R16I]:SAMPLER_TYPES.INT,[tt.R16UI]:SAMPLER_TYPES.UINT,[tt.R32I]:SAMPLER_TYPES.INT,[tt.R32UI]:SAMPLER_TYPES.UINT,[tt.RG8I]:SAMPLER_TYPES.INT,[tt.RG8UI]:SAMPLER_TYPES.UINT,[tt.RG16I]:SAMPLER_TYPES.INT,[tt.RG16UI]:SAMPLER_TYPES.UINT,[tt.RG32I]:SAMPLER_TYPES.INT,[tt.RG32UI]:SAMPLER_TYPES.UINT,[tt.RGB8I]:SAMPLER_TYPES.INT,[tt.RGB8UI]:SAMPLER_TYPES.UINT,[tt.RGB16I]:SAMPLER_TYPES.INT,[tt.RGB16UI]:SAMPLER_TYPES.UINT,[tt.RGB32I]:SAMPLER_TYPES.INT,[tt.RGB32UI]:SAMPLER_TYPES.UINT,[tt.RGBA8I]:SAMPLER_TYPES.INT,[tt.RGBA8UI]:SAMPLER_TYPES.UINT,[tt.RGBA16I]:SAMPLER_TYPES.INT,[tt.RGBA16UI]:SAMPLER_TYPES.UINT,[tt.RGBA32I]:SAMPLER_TYPES.INT,[tt.RGBA32UI]:SAMPLER_TYPES.UINT,[tt.DEPTH_COMPONENT16]:SAMPLER_TYPES.FLOAT,[tt.DEPTH_COMPONENT24]:SAMPLER_TYPES.FLOAT,[tt.DEPTH_COMPONENT32F]:SAMPLER_TYPES.FLOAT,[tt.DEPTH_STENCIL]:SAMPLER_TYPES.FLOAT,[tt.DEPTH24_STENCIL8]:SAMPLER_TYPES.FLOAT,[tt.DEPTH32F_STENCIL8]:SAMPLER_TYPES.FLOAT}:et={[tt.RGB]:SAMPLER_TYPES.FLOAT,[tt.RGBA]:SAMPLER_TYPES.FLOAT,[tt.ALPHA]:SAMPLER_TYPES.FLOAT,[tt.LUMINANCE]:SAMPLER_TYPES.FLOAT,[tt.LUMINANCE_ALPHA]:SAMPLER_TYPES.FLOAT,[tt.DEPTH_STENCIL]:SAMPLER_TYPES.FLOAT},et}function mapTypeAndFormatToInternalFormat(tt){let et;return"WebGL2RenderingContext"in globalThis&&tt instanceof globalThis.WebGL2RenderingContext?et={[TYPES.UNSIGNED_BYTE]:{[FORMATS.RGBA]:tt.RGBA8,[FORMATS.RGB]:tt.RGB8,[FORMATS.RG]:tt.RG8,[FORMATS.RED]:tt.R8,[FORMATS.RGBA_INTEGER]:tt.RGBA8UI,[FORMATS.RGB_INTEGER]:tt.RGB8UI,[FORMATS.RG_INTEGER]:tt.RG8UI,[FORMATS.RED_INTEGER]:tt.R8UI,[FORMATS.ALPHA]:tt.ALPHA,[FORMATS.LUMINANCE]:tt.LUMINANCE,[FORMATS.LUMINANCE_ALPHA]:tt.LUMINANCE_ALPHA},[TYPES.BYTE]:{[FORMATS.RGBA]:tt.RGBA8_SNORM,[FORMATS.RGB]:tt.RGB8_SNORM,[FORMATS.RG]:tt.RG8_SNORM,[FORMATS.RED]:tt.R8_SNORM,[FORMATS.RGBA_INTEGER]:tt.RGBA8I,[FORMATS.RGB_INTEGER]:tt.RGB8I,[FORMATS.RG_INTEGER]:tt.RG8I,[FORMATS.RED_INTEGER]:tt.R8I},[TYPES.UNSIGNED_SHORT]:{[FORMATS.RGBA_INTEGER]:tt.RGBA16UI,[FORMATS.RGB_INTEGER]:tt.RGB16UI,[FORMATS.RG_INTEGER]:tt.RG16UI,[FORMATS.RED_INTEGER]:tt.R16UI,[FORMATS.DEPTH_COMPONENT]:tt.DEPTH_COMPONENT16},[TYPES.SHORT]:{[FORMATS.RGBA_INTEGER]:tt.RGBA16I,[FORMATS.RGB_INTEGER]:tt.RGB16I,[FORMATS.RG_INTEGER]:tt.RG16I,[FORMATS.RED_INTEGER]:tt.R16I},[TYPES.UNSIGNED_INT]:{[FORMATS.RGBA_INTEGER]:tt.RGBA32UI,[FORMATS.RGB_INTEGER]:tt.RGB32UI,[FORMATS.RG_INTEGER]:tt.RG32UI,[FORMATS.RED_INTEGER]:tt.R32UI,[FORMATS.DEPTH_COMPONENT]:tt.DEPTH_COMPONENT24},[TYPES.INT]:{[FORMATS.RGBA_INTEGER]:tt.RGBA32I,[FORMATS.RGB_INTEGER]:tt.RGB32I,[FORMATS.RG_INTEGER]:tt.RG32I,[FORMATS.RED_INTEGER]:tt.R32I},[TYPES.FLOAT]:{[FORMATS.RGBA]:tt.RGBA32F,[FORMATS.RGB]:tt.RGB32F,[FORMATS.RG]:tt.RG32F,[FORMATS.RED]:tt.R32F,[FORMATS.DEPTH_COMPONENT]:tt.DEPTH_COMPONENT32F},[TYPES.HALF_FLOAT]:{[FORMATS.RGBA]:tt.RGBA16F,[FORMATS.RGB]:tt.RGB16F,[FORMATS.RG]:tt.RG16F,[FORMATS.RED]:tt.R16F},[TYPES.UNSIGNED_SHORT_5_6_5]:{[FORMATS.RGB]:tt.RGB565},[TYPES.UNSIGNED_SHORT_4_4_4_4]:{[FORMATS.RGBA]:tt.RGBA4},[TYPES.UNSIGNED_SHORT_5_5_5_1]:{[FORMATS.RGBA]:tt.RGB5_A1},[TYPES.UNSIGNED_INT_2_10_10_10_REV]:{[FORMATS.RGBA]:tt.RGB10_A2,[FORMATS.RGBA_INTEGER]:tt.RGB10_A2UI},[TYPES.UNSIGNED_INT_10F_11F_11F_REV]:{[FORMATS.RGB]:tt.R11F_G11F_B10F},[TYPES.UNSIGNED_INT_5_9_9_9_REV]:{[FORMATS.RGB]:tt.RGB9_E5},[TYPES.UNSIGNED_INT_24_8]:{[FORMATS.DEPTH_STENCIL]:tt.DEPTH24_STENCIL8},[TYPES.FLOAT_32_UNSIGNED_INT_24_8_REV]:{[FORMATS.DEPTH_STENCIL]:tt.DEPTH32F_STENCIL8}}:et={[TYPES.UNSIGNED_BYTE]:{[FORMATS.RGBA]:tt.RGBA,[FORMATS.RGB]:tt.RGB,[FORMATS.ALPHA]:tt.ALPHA,[FORMATS.LUMINANCE]:tt.LUMINANCE,[FORMATS.LUMINANCE_ALPHA]:tt.LUMINANCE_ALPHA},[TYPES.UNSIGNED_SHORT_5_6_5]:{[FORMATS.RGB]:tt.RGB},[TYPES.UNSIGNED_SHORT_4_4_4_4]:{[FORMATS.RGBA]:tt.RGBA},[TYPES.UNSIGNED_SHORT_5_5_5_1]:{[FORMATS.RGBA]:tt.RGBA}},et}class TextureSystem{constructor(et){this.renderer=et,this.boundTextures=[],this.currentLocation=-1,this.managedTextures=[],this._unknownBoundTextures=!1,this.unknownTexture=new BaseTexture,this.hasIntegerTextures=!1}contextChange(){const et=this.gl=this.renderer.gl;this.CONTEXT_UID=this.renderer.CONTEXT_UID,this.webGLVersion=this.renderer.context.webGLVersion,this.internalFormats=mapTypeAndFormatToInternalFormat(et),this.samplerTypes=mapInternalFormatToSamplerType(et);const rt=et.getParameter(et.MAX_TEXTURE_IMAGE_UNITS);this.boundTextures.length=rt;for(let nt=0;nt<rt;nt++)this.boundTextures[nt]=null;this.emptyTextures={};const st=new GLTexture(et.createTexture());et.bindTexture(et.TEXTURE_2D,st.texture),et.texImage2D(et.TEXTURE_2D,0,et.RGBA,1,1,0,et.RGBA,et.UNSIGNED_BYTE,new Uint8Array(4)),this.emptyTextures[et.TEXTURE_2D]=st,this.emptyTextures[et.TEXTURE_CUBE_MAP]=new GLTexture(et.createTexture()),et.bindTexture(et.TEXTURE_CUBE_MAP,this.emptyTextures[et.TEXTURE_CUBE_MAP].texture);for(let nt=0;nt<6;nt++)et.texImage2D(et.TEXTURE_CUBE_MAP_POSITIVE_X+nt,0,et.RGBA,1,1,0,et.RGBA,et.UNSIGNED_BYTE,null);et.texParameteri(et.TEXTURE_CUBE_MAP,et.TEXTURE_MAG_FILTER,et.LINEAR),et.texParameteri(et.TEXTURE_CUBE_MAP,et.TEXTURE_MIN_FILTER,et.LINEAR);for(let nt=0;nt<this.boundTextures.length;nt++)this.bind(null,nt)}bind(et,rt=0){const{gl:st}=this;if(et=et==null?void 0:et.castToBaseTexture(),(et==null?void 0:et.valid)&&!et.parentTextureArray){et.touched=this.renderer.textureGC.count;const nt=et._glTextures[this.CONTEXT_UID]||this.initTexture(et);this.boundTextures[rt]!==et&&(this.currentLocation!==rt&&(this.currentLocation=rt,st.activeTexture(st.TEXTURE0+rt)),st.bindTexture(et.target,nt.texture)),nt.dirtyId!==et.dirtyId?(this.currentLocation!==rt&&(this.currentLocation=rt,st.activeTexture(st.TEXTURE0+rt)),this.updateTexture(et)):nt.dirtyStyleId!==et.dirtyStyleId&&this.updateTextureStyle(et),this.boundTextures[rt]=et}else this.currentLocation!==rt&&(this.currentLocation=rt,st.activeTexture(st.TEXTURE0+rt)),st.bindTexture(st.TEXTURE_2D,this.emptyTextures[st.TEXTURE_2D].texture),this.boundTextures[rt]=null}reset(){this._unknownBoundTextures=!0,this.hasIntegerTextures=!1,this.currentLocation=-1;for(let et=0;et<this.boundTextures.length;et++)this.boundTextures[et]=this.unknownTexture}unbind(et){const{gl:rt,boundTextures:st}=this;if(this._unknownBoundTextures){this._unknownBoundTextures=!1;for(let nt=0;nt<st.length;nt++)st[nt]===this.unknownTexture&&this.bind(null,nt)}for(let nt=0;nt<st.length;nt++)st[nt]===et&&(this.currentLocation!==nt&&(rt.activeTexture(rt.TEXTURE0+nt),this.currentLocation=nt),rt.bindTexture(et.target,this.emptyTextures[et.target].texture),st[nt]=null)}ensureSamplerType(et){const{boundTextures:rt,hasIntegerTextures:st,CONTEXT_UID:nt}=this;if(st)for(let ot=et-1;ot>=0;--ot){const at=rt[ot];at&&at._glTextures[nt].samplerType!==SAMPLER_TYPES.FLOAT&&this.renderer.texture.unbind(at)}}initTexture(et){const rt=new GLTexture(this.gl.createTexture());return rt.dirtyId=-1,et._glTextures[this.CONTEXT_UID]=rt,this.managedTextures.push(et),et.on("dispose",this.destroyTexture,this),rt}initTextureType(et,rt){var st;rt.internalFormat=((st=this.internalFormats[et.type])==null?void 0:st[et.format])??et.format,rt.samplerType=this.samplerTypes[rt.internalFormat]??SAMPLER_TYPES.FLOAT,this.webGLVersion===2&&et.type===TYPES.HALF_FLOAT?rt.type=this.gl.HALF_FLOAT:rt.type=et.type}updateTexture(et){var nt;const rt=et._glTextures[this.CONTEXT_UID];if(!rt)return;const st=this.renderer;if(this.initTextureType(et,rt),(nt=et.resource)==null?void 0:nt.upload(st,et,rt))rt.samplerType!==SAMPLER_TYPES.FLOAT&&(this.hasIntegerTextures=!0);else{const ot=et.realWidth,at=et.realHeight,lt=st.gl;(rt.width!==ot||rt.height!==at||rt.dirtyId<0)&&(rt.width=ot,rt.height=at,lt.texImage2D(et.target,0,rt.internalFormat,ot,at,0,et.format,rt.type,null))}et.dirtyStyleId!==rt.dirtyStyleId&&this.updateTextureStyle(et),rt.dirtyId=et.dirtyId}destroyTexture(et,rt){const{gl:st}=this;if(et=et.castToBaseTexture(),et._glTextures[this.CONTEXT_UID]&&(this.unbind(et),st.deleteTexture(et._glTextures[this.CONTEXT_UID].texture),et.off("dispose",this.destroyTexture,this),delete et._glTextures[this.CONTEXT_UID],!rt)){const nt=this.managedTextures.indexOf(et);nt!==-1&&removeItems(this.managedTextures,nt,1)}}updateTextureStyle(et){var st;const rt=et._glTextures[this.CONTEXT_UID];rt&&((et.mipmap===MIPMAP_MODES.POW2||this.webGLVersion!==2)&&!et.isPowerOfTwo?rt.mipmap=!1:rt.mipmap=et.mipmap>=1,this.webGLVersion!==2&&!et.isPowerOfTwo?rt.wrapMode=WRAP_MODES.CLAMP:rt.wrapMode=et.wrapMode,(st=et.resource)!=null&&st.style(this.renderer,et,rt)||this.setStyle(et,rt),rt.dirtyStyleId=et.dirtyStyleId)}setStyle(et,rt){const st=this.gl;if(rt.mipmap&&et.mipmap!==MIPMAP_MODES.ON_MANUAL&&st.generateMipmap(et.target),st.texParameteri(et.target,st.TEXTURE_WRAP_S,rt.wrapMode),st.texParameteri(et.target,st.TEXTURE_WRAP_T,rt.wrapMode),rt.mipmap){st.texParameteri(et.target,st.TEXTURE_MIN_FILTER,et.scaleMode===SCALE_MODES.LINEAR?st.LINEAR_MIPMAP_LINEAR:st.NEAREST_MIPMAP_NEAREST);const nt=this.renderer.context.extensions.anisotropicFiltering;if(nt&&et.anisotropicLevel>0&&et.scaleMode===SCALE_MODES.LINEAR){const ot=Math.min(et.anisotropicLevel,st.getParameter(nt.MAX_TEXTURE_MAX_ANISOTROPY_EXT));st.texParameterf(et.target,nt.TEXTURE_MAX_ANISOTROPY_EXT,ot)}}else st.texParameteri(et.target,st.TEXTURE_MIN_FILTER,et.scaleMode===SCALE_MODES.LINEAR?st.LINEAR:st.NEAREST);st.texParameteri(et.target,st.TEXTURE_MAG_FILTER,et.scaleMode===SCALE_MODES.LINEAR?st.LINEAR:st.NEAREST)}destroy(){this.renderer=null}}TextureSystem.extension={type:ExtensionType.RendererSystem,name:"texture"};extensions$1.add(TextureSystem);class TransformFeedbackSystem{constructor(et){this.renderer=et}contextChange(){this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(et){const{gl:rt,CONTEXT_UID:st}=this,nt=et._glTransformFeedbacks[st]||this.createGLTransformFeedback(et);rt.bindTransformFeedback(rt.TRANSFORM_FEEDBACK,nt)}unbind(){const{gl:et}=this;et.bindTransformFeedback(et.TRANSFORM_FEEDBACK,null)}beginTransformFeedback(et,rt){const{gl:st,renderer:nt}=this;rt&&nt.shader.bind(rt),st.beginTransformFeedback(et)}endTransformFeedback(){const{gl:et}=this;et.endTransformFeedback()}createGLTransformFeedback(et){const{gl:rt,renderer:st,CONTEXT_UID:nt}=this,ot=rt.createTransformFeedback();et._glTransformFeedbacks[nt]=ot,rt.bindTransformFeedback(rt.TRANSFORM_FEEDBACK,ot);for(let at=0;at<et.buffers.length;at++){const lt=et.buffers[at];lt&&(st.buffer.update(lt),lt._glBuffers[nt].refCount++,rt.bindBufferBase(rt.TRANSFORM_FEEDBACK_BUFFER,at,lt._glBuffers[nt].buffer||null))}return rt.bindTransformFeedback(rt.TRANSFORM_FEEDBACK,null),et.disposeRunner.add(this),ot}disposeTransformFeedback(et,rt){const st=et._glTransformFeedbacks[this.CONTEXT_UID],nt=this.gl;et.disposeRunner.remove(this);const ot=this.renderer.buffer;if(ot)for(let at=0;at<et.buffers.length;at++){const lt=et.buffers[at];if(!lt)continue;const ut=lt._glBuffers[this.CONTEXT_UID];ut&&(ut.refCount--,ut.refCount===0&&!rt&&ot.dispose(lt,rt))}st&&(rt||nt.deleteTransformFeedback(st),delete et._glTransformFeedbacks[this.CONTEXT_UID])}destroy(){this.renderer=null}}TransformFeedbackSystem.extension={type:ExtensionType.RendererSystem,name:"transformFeedback"};extensions$1.add(TransformFeedbackSystem);class ViewSystem{constructor(et){this.renderer=et}init(et){this.screen=new Rectangle(0,0,et.width,et.height),this.element=et.view||settings.ADAPTER.createCanvas(),this.resolution=et.resolution||settings.RESOLUTION,this.autoDensity=!!et.autoDensity}resizeView(et,rt){this.element.width=Math.round(et*this.resolution),this.element.height=Math.round(rt*this.resolution);const st=this.element.width/this.resolution,nt=this.element.height/this.resolution;this.screen.width=st,this.screen.height=nt,this.autoDensity&&(this.element.style.width=`${st}px`,this.element.style.height=`${nt}px`),this.renderer.emit("resize",st,nt),this.renderer.runners.resize.emit(this.screen.width,this.screen.height)}destroy(et){var rt;et&&((rt=this.element.parentNode)==null||rt.removeChild(this.element)),this.renderer=null,this.element=null,this.screen=null}}ViewSystem.defaultOptions={width:800,height:600,resolution:void 0,autoDensity:!1},ViewSystem.extension={type:[ExtensionType.RendererSystem,ExtensionType.CanvasRendererSystem],name:"_view"};extensions$1.add(ViewSystem);settings.PREFER_ENV=ENV.WEBGL2;settings.STRICT_TEXTURE_CACHE=!1;settings.RENDER_OPTIONS={...ContextSystem.defaultOptions,...BackgroundSystem.defaultOptions,...ViewSystem.defaultOptions,...StartupSystem.defaultOptions};Object.defineProperties(settings,{WRAP_MODE:{get(){return BaseTexture.defaultOptions.wrapMode},set(tt){deprecation("7.1.0","settings.WRAP_MODE is deprecated, use BaseTexture.defaultOptions.wrapMode"),BaseTexture.defaultOptions.wrapMode=tt}},SCALE_MODE:{get(){return BaseTexture.defaultOptions.scaleMode},set(tt){deprecation("7.1.0","settings.SCALE_MODE is deprecated, use BaseTexture.defaultOptions.scaleMode"),BaseTexture.defaultOptions.scaleMode=tt}},MIPMAP_TEXTURES:{get(){return BaseTexture.defaultOptions.mipmap},set(tt){deprecation("7.1.0","settings.MIPMAP_TEXTURES is deprecated, use BaseTexture.defaultOptions.mipmap"),BaseTexture.defaultOptions.mipmap=tt}},ANISOTROPIC_LEVEL:{get(){return BaseTexture.defaultOptions.anisotropicLevel},set(tt){deprecation("7.1.0","settings.ANISOTROPIC_LEVEL is deprecated, use BaseTexture.defaultOptions.anisotropicLevel"),BaseTexture.defaultOptions.anisotropicLevel=tt}},FILTER_RESOLUTION:{get(){return deprecation("7.1.0","settings.FILTER_RESOLUTION is deprecated, use Filter.defaultResolution"),Filter.defaultResolution},set(tt){Filter.defaultResolution=tt}},FILTER_MULTISAMPLE:{get(){return deprecation("7.1.0","settings.FILTER_MULTISAMPLE is deprecated, use Filter.defaultMultisample"),Filter.defaultMultisample},set(tt){Filter.defaultMultisample=tt}},SPRITE_MAX_TEXTURES:{get(){return BatchRenderer.defaultMaxTextures},set(tt){deprecation("7.1.0","settings.SPRITE_MAX_TEXTURES is deprecated, use BatchRenderer.defaultMaxTextures"),BatchRenderer.defaultMaxTextures=tt}},SPRITE_BATCH_SIZE:{get(){return BatchRenderer.defaultBatchSize},set(tt){deprecation("7.1.0","settings.SPRITE_BATCH_SIZE is deprecated, use BatchRenderer.defaultBatchSize"),BatchRenderer.defaultBatchSize=tt}},CAN_UPLOAD_SAME_BUFFER:{get(){return BatchRenderer.canUploadSameBuffer},set(tt){deprecation("7.1.0","settings.CAN_UPLOAD_SAME_BUFFER is deprecated, use BatchRenderer.canUploadSameBuffer"),BatchRenderer.canUploadSameBuffer=tt}},GC_MODE:{get(){return TextureGCSystem.defaultMode},set(tt){deprecation("7.1.0","settings.GC_MODE is deprecated, use TextureGCSystem.defaultMode"),TextureGCSystem.defaultMode=tt}},GC_MAX_IDLE:{get(){return TextureGCSystem.defaultMaxIdle},set(tt){deprecation("7.1.0","settings.GC_MAX_IDLE is deprecated, use TextureGCSystem.defaultMaxIdle"),TextureGCSystem.defaultMaxIdle=tt}},GC_MAX_CHECK_COUNT:{get(){return TextureGCSystem.defaultCheckCountMax},set(tt){deprecation("7.1.0","settings.GC_MAX_CHECK_COUNT is deprecated, use TextureGCSystem.defaultCheckCountMax"),TextureGCSystem.defaultCheckCountMax=tt}},PRECISION_VERTEX:{get(){return Program.defaultVertexPrecision},set(tt){deprecation("7.1.0","settings.PRECISION_VERTEX is deprecated, use Program.defaultVertexPrecision"),Program.defaultVertexPrecision=tt}},PRECISION_FRAGMENT:{get(){return Program.defaultFragmentPrecision},set(tt){deprecation("7.1.0","settings.PRECISION_FRAGMENT is deprecated, use Program.defaultFragmentPrecision"),Program.defaultFragmentPrecision=tt}}});var UPDATE_PRIORITY=(tt=>(tt[tt.INTERACTION=50]="INTERACTION",tt[tt.HIGH=25]="HIGH",tt[tt.NORMAL=0]="NORMAL",tt[tt.LOW=-25]="LOW",tt[tt.UTILITY=-50]="UTILITY",tt))(UPDATE_PRIORITY||{});class TickerListener{constructor(et,rt=null,st=0,nt=!1){this.next=null,this.previous=null,this._destroyed=!1,this.fn=et,this.context=rt,this.priority=st,this.once=nt}match(et,rt=null){return this.fn===et&&this.context===rt}emit(et){this.fn&&(this.context?this.fn.call(this.context,et):this.fn(et));const rt=this.next;return this.once&&this.destroy(!0),this._destroyed&&(this.next=null),rt}connect(et){this.previous=et,et.next&&(et.next.previous=this),this.next=et.next,et.next=this}destroy(et=!1){this._destroyed=!0,this.fn=null,this.context=null,this.previous&&(this.previous.next=this.next),this.next&&(this.next.previous=this.previous);const rt=this.next;return this.next=et?null:rt,this.previous=null,rt}}const _Ticker=class Zs{constructor(){this.autoStart=!1,this.deltaTime=1,this.lastTime=-1,this.speed=1,this.started=!1,this._requestId=null,this._maxElapsedMS=100,this._minElapsedMS=0,this._protected=!1,this._lastFrame=-1,this._head=new TickerListener(null,null,1/0),this.deltaMS=1/Zs.targetFPMS,this.elapsedMS=1/Zs.targetFPMS,this._tick=et=>{this._requestId=null,this.started&&(this.update(et),this.started&&this._requestId===null&&this._head.next&&(this._requestId=requestAnimationFrame(this._tick)))}}_requestIfNeeded(){this._requestId===null&&this._head.next&&(this.lastTime=performance.now(),this._lastFrame=this.lastTime,this._requestId=requestAnimationFrame(this._tick))}_cancelIfNeeded(){this._requestId!==null&&(cancelAnimationFrame(this._requestId),this._requestId=null)}_startIfPossible(){this.started?this._requestIfNeeded():this.autoStart&&this.start()}add(et,rt,st=UPDATE_PRIORITY.NORMAL){return this._addListener(new TickerListener(et,rt,st))}addOnce(et,rt,st=UPDATE_PRIORITY.NORMAL){return this._addListener(new TickerListener(et,rt,st,!0))}_addListener(et){let rt=this._head.next,st=this._head;if(!rt)et.connect(st);else{for(;rt;){if(et.priority>rt.priority){et.connect(st);break}st=rt,rt=rt.next}et.previous||et.connect(st)}return this._startIfPossible(),this}remove(et,rt){let st=this._head.next;for(;st;)st.match(et,rt)?st=st.destroy():st=st.next;return this._head.next||this._cancelIfNeeded(),this}get count(){if(!this._head)return 0;let et=0,rt=this._head;for(;rt=rt.next;)et++;return et}start(){this.started||(this.started=!0,this._requestIfNeeded())}stop(){this.started&&(this.started=!1,this._cancelIfNeeded())}destroy(){if(!this._protected){this.stop();let et=this._head.next;for(;et;)et=et.destroy(!0);this._head.destroy(),this._head=null}}update(et=performance.now()){let rt;if(et>this.lastTime){if(rt=this.elapsedMS=et-this.lastTime,rt>this._maxElapsedMS&&(rt=this._maxElapsedMS),rt*=this.speed,this._minElapsedMS){const ot=et-this._lastFrame|0;if(ot<this._minElapsedMS)return;this._lastFrame=et-ot%this._minElapsedMS}this.deltaMS=rt,this.deltaTime=this.deltaMS*Zs.targetFPMS;const st=this._head;let nt=st.next;for(;nt;)nt=nt.emit(this.deltaTime);st.next||this._cancelIfNeeded()}else this.deltaTime=this.deltaMS=this.elapsedMS=0;this.lastTime=et}get FPS(){return 1e3/this.elapsedMS}get minFPS(){return 1e3/this._maxElapsedMS}set minFPS(et){const rt=Math.min(this.maxFPS,et),st=Math.min(Math.max(0,rt)/1e3,Zs.targetFPMS);this._maxElapsedMS=1/st}get maxFPS(){return this._minElapsedMS?Math.round(1e3/this._minElapsedMS):0}set maxFPS(et){if(et===0)this._minElapsedMS=0;else{const rt=Math.max(this.minFPS,et);this._minElapsedMS=1/(rt/1e3)}}static get shared(){if(!Zs._shared){const et=Zs._shared=new Zs;et.autoStart=!0,et._protected=!0}return Zs._shared}static get system(){if(!Zs._system){const et=Zs._system=new Zs;et.autoStart=!0,et._protected=!0}return Zs._system}};_Ticker.targetFPMS=.06;let Ticker=_Ticker;Object.defineProperties(settings,{TARGET_FPMS:{get(){return Ticker.targetFPMS},set(tt){deprecation("7.1.0","settings.TARGET_FPMS is deprecated, use Ticker.targetFPMS"),Ticker.targetFPMS=tt}}});class TickerPlugin{static init(et){et=Object.assign({autoStart:!0,sharedTicker:!1},et),Object.defineProperty(this,"ticker",{set(rt){this._ticker&&this._ticker.remove(this.render,this),this._ticker=rt,rt&&rt.add(this.render,this,UPDATE_PRIORITY.LOW)},get(){return this._ticker}}),this.stop=()=>{this._ticker.stop()},this.start=()=>{this._ticker.start()},this._ticker=null,this.ticker=et.sharedTicker?Ticker.shared:new Ticker,et.autoStart&&this.start()}static destroy(){if(this._ticker){const et=this._ticker;this.ticker=null,et.destroy()}}}TickerPlugin.extension=ExtensionType.Application;extensions$1.add(TickerPlugin);const renderers=[];extensions$1.handleByList(ExtensionType.Renderer,renderers);function autoDetectRenderer(tt){for(const et of renderers)if(et.test(tt))return new et(tt);throw new Error("Unable to auto-detect a suitable renderer.")}var $defaultVertex=`attribute vec2 aVertexPosition;
|
|
715
715
|
attribute vec2 aTextureCoord;
|
|
716
716
|
|
|
717
717
|
uniform mat3 projectionMatrix;
|
|
@@ -748,8 +748,8 @@ void main(void)
|
|
|
748
748
|
gl_Position = filterVertexPosition();
|
|
749
749
|
vTextureCoord = filterTextureCoord();
|
|
750
750
|
}
|
|
751
|
-
`;const defaultVertex=$defaultVertex,defaultFilterVertex=$defaultFilterVertex;class MultisampleSystem{constructor(et){this.renderer=et}contextChange(et){let rt;if(this.renderer.context.webGLVersion===1){const st=et.getParameter(et.FRAMEBUFFER_BINDING);et.bindFramebuffer(et.FRAMEBUFFER,null),rt=et.getParameter(et.SAMPLES),et.bindFramebuffer(et.FRAMEBUFFER,st)}else{const st=et.getParameter(et.DRAW_FRAMEBUFFER_BINDING);et.bindFramebuffer(et.DRAW_FRAMEBUFFER,null),rt=et.getParameter(et.SAMPLES),et.bindFramebuffer(et.DRAW_FRAMEBUFFER,st)}rt>=MSAA_QUALITY.HIGH?this.multisample=MSAA_QUALITY.HIGH:rt>=MSAA_QUALITY.MEDIUM?this.multisample=MSAA_QUALITY.MEDIUM:rt>=MSAA_QUALITY.LOW?this.multisample=MSAA_QUALITY.LOW:this.multisample=MSAA_QUALITY.NONE}destroy(){}}MultisampleSystem.extension={type:ExtensionType.RendererSystem,name:"_multisample"};extensions$1.add(MultisampleSystem);class GLBuffer{constructor(et){this.buffer=et||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class BufferSystem{constructor(et){this.renderer=et,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(et){const{gl:rt,CONTEXT_UID:st}=this,nt=et._glBuffers[st]||this.createGLBuffer(et);rt.bindBuffer(et.type,nt.buffer)}unbind(et){const{gl:rt}=this;rt.bindBuffer(et,null)}bindBufferBase(et,rt){const{gl:st,CONTEXT_UID:nt}=this;if(this.boundBufferBases[rt]!==et){const ot=et._glBuffers[nt]||this.createGLBuffer(et);this.boundBufferBases[rt]=et,st.bindBufferBase(st.UNIFORM_BUFFER,rt,ot.buffer)}}bindBufferRange(et,rt,st){const{gl:nt,CONTEXT_UID:ot}=this;st=st||0;const at=et._glBuffers[ot]||this.createGLBuffer(et);nt.bindBufferRange(nt.UNIFORM_BUFFER,rt||0,at.buffer,st*256,256)}update(et){const{gl:rt,CONTEXT_UID:st}=this,nt=et._glBuffers[st]||this.createGLBuffer(et);if(et._updateID!==nt.updateID)if(nt.updateID=et._updateID,rt.bindBuffer(et.type,nt.buffer),nt.byteLength>=et.data.byteLength)rt.bufferSubData(et.type,0,et.data);else{const ot=et.static?rt.STATIC_DRAW:rt.DYNAMIC_DRAW;nt.byteLength=et.data.byteLength,rt.bufferData(et.type,et.data,ot)}}dispose(et,rt){if(!this.managedBuffers[et.id])return;delete this.managedBuffers[et.id];const st=et._glBuffers[this.CONTEXT_UID],nt=this.gl;et.disposeRunner.remove(this),st&&(rt||nt.deleteBuffer(st.buffer),delete et._glBuffers[this.CONTEXT_UID])}disposeAll(et){const rt=Object.keys(this.managedBuffers);for(let st=0;st<rt.length;st++)this.dispose(this.managedBuffers[rt[st]],et)}createGLBuffer(et){const{CONTEXT_UID:rt,gl:st}=this;return et._glBuffers[rt]=new GLBuffer(st.createBuffer()),this.managedBuffers[et.id]=et,et.disposeRunner.add(this),et._glBuffers[rt]}}BufferSystem.extension={type:ExtensionType.RendererSystem,name:"buffer"};extensions$1.add(BufferSystem);class ObjectRendererSystem{constructor(et){this.renderer=et}render(et,rt){const st=this.renderer;let nt,ot,at,lt;if(rt&&(nt=rt.renderTexture,ot=rt.clear,at=rt.transform,lt=rt.skipUpdateTransform),this.renderingToScreen=!nt,st.runners.prerender.emit(),st.emit("prerender"),st.projection.transform=at,!st.context.isLost){if(nt||(this.lastObjectRendered=et),!lt){const ut=et.enableTempParent();et.updateTransform(),et.disableTempParent(ut)}st.renderTexture.bind(nt),st.batch.currentRenderer.start(),(ot??st.background.clearBeforeRender)&&st.renderTexture.clear(),et.render(st),st.batch.currentRenderer.flush(),nt&&(rt.blit&&st.framebuffer.blit(),nt.baseTexture.update()),st.runners.postrender.emit(),st.projection.transform=null,st.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}ObjectRendererSystem.extension={type:ExtensionType.RendererSystem,name:"objectRenderer"};extensions$1.add(ObjectRendererSystem);const _Renderer=class s2 extends SystemManager{constructor(et){super(),this.type=RENDERER_TYPE.WEBGL,et=Object.assign({},settings.RENDER_OPTIONS,et),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new UniformGroup({projectionMatrix:new Matrix},!0);const rt={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:s2.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(rt),"useContextAlpha"in et&&(deprecation("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),et.premultipliedAlpha=et.useContextAlpha&&et.useContextAlpha!=="notMultiplied",et.backgroundAlpha=et.useContextAlpha===!1?1:et.backgroundAlpha),this._plugin.rendererPlugins=s2.__plugins,this.options=et,this.startup.run(this.options)}static test(et){return et!=null&&et.forceCanvas?!1:isWebGLSupported()}render(et,rt){this.objectRenderer.render(et,rt)}resize(et,rt){this._view.resizeView(et,rt)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(et=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:et}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(et){this._view.resolution=et,this.runners.resolutionChange.emit(et)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return deprecation("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return deprecation("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return deprecation("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return deprecation("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(et){deprecation("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=et}get backgroundAlpha(){return deprecation("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(et){deprecation("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=et}get powerPreference(){return deprecation("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(et,rt){return this.textureGenerator.generateTexture(et,rt)}};_Renderer.extension={type:ExtensionType.Renderer,priority:1},_Renderer.__plugins={},_Renderer.__systems={};let Renderer=_Renderer;extensions$1.handleByMap(ExtensionType.RendererPlugin,Renderer.__plugins);extensions$1.handleByMap(ExtensionType.RendererSystem,Renderer.__systems);extensions$1.add(Renderer);class AbstractMultiResource extends Resource{constructor(et,rt){const{width:st,height:nt}=rt||{};super(st,nt),this.items=[],this.itemDirtyIds=[];for(let ot=0;ot<et;ot++){const at=new BaseTexture;this.items.push(at),this.itemDirtyIds.push(-2)}this.length=et,this._load=null,this.baseTexture=null}initFromArray(et,rt){for(let st=0;st<this.length;st++)et[st]&&(et[st].castToBaseTexture?this.addBaseTextureAt(et[st].castToBaseTexture(),st):et[st]instanceof Resource?this.addResourceAt(et[st],st):this.addResourceAt(autoDetectResource(et[st],rt),st))}dispose(){for(let et=0,rt=this.length;et<rt;et++)this.items[et].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(et,rt){if(!this.items[rt])throw new Error(`Index ${rt} is out of bounds`);return et.valid&&!this.valid&&this.resize(et.width,et.height),this.items[rt].setResource(et),this}bind(et){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(et);for(let rt=0;rt<this.length;rt++)this.items[rt].parentTextureArray=et,this.items[rt].on("update",et.update,et)}unbind(et){super.unbind(et);for(let rt=0;rt<this.length;rt++)this.items[rt].parentTextureArray=null,this.items[rt].off("update",et.update,et)}load(){if(this._load)return this._load;const et=this.items.map(rt=>rt.resource).filter(rt=>rt).map(rt=>rt.load());return this._load=Promise.all(et).then(()=>{const{realWidth:rt,realHeight:st}=this.items[0];return this.resize(rt,st),this.update(),Promise.resolve(this)}),this._load}}class ArrayResource extends AbstractMultiResource{constructor(et,rt){const{width:st,height:nt}=rt||{};let ot,at;Array.isArray(et)?(ot=et,at=et.length):at=et,super(at,{width:st,height:nt}),ot&&this.initFromArray(ot,rt)}addBaseTextureAt(et,rt){if(et.resource)this.addResourceAt(et.resource,rt);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(et){super.bind(et),et.target=TARGETS.TEXTURE_2D_ARRAY}upload(et,rt,st){const{length:nt,itemDirtyIds:ot,items:at}=this,{gl:lt}=et;st.dirtyId<0&<.texImage3D(lt.TEXTURE_2D_ARRAY,0,st.internalFormat,this._width,this._height,nt,0,rt.format,st.type,null);for(let ut=0;ut<nt;ut++){const ct=at[ut];ot[ut]<ct.dirtyId&&(ot[ut]=ct.dirtyId,ct.valid&<.texSubImage3D(lt.TEXTURE_2D_ARRAY,0,0,0,ut,ct.resource.width,ct.resource.height,1,rt.format,st.type,ct.resource.source))}return!0}}class CanvasResource extends BaseImageResource{constructor(et){super(et)}static test(et){const{OffscreenCanvas:rt}=globalThis;return rt&&et instanceof rt?!0:globalThis.HTMLCanvasElement&&et instanceof HTMLCanvasElement}}const _CubeResource=class $u extends AbstractMultiResource{constructor(et,rt){const{width:st,height:nt,autoLoad:ot,linkBaseTexture:at}=rt||{};if(et&&et.length!==$u.SIDES)throw new Error(`Invalid length. Got ${et.length}, expected 6`);super(6,{width:st,height:nt});for(let lt=0;lt<$u.SIDES;lt++)this.items[lt].target=TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+lt;this.linkBaseTexture=at!==!1,et&&this.initFromArray(et,rt),ot!==!1&&this.load()}bind(et){super.bind(et),et.target=TARGETS.TEXTURE_CUBE_MAP}addBaseTextureAt(et,rt,st){if(st===void 0&&(st=this.linkBaseTexture),!this.items[rt])throw new Error(`Index ${rt} is out of bounds`);if(!this.linkBaseTexture||et.parentTextureArray||Object.keys(et._glTextures).length>0)if(et.resource)this.addResourceAt(et.resource,rt);else throw new Error("CubeResource does not support copying of renderTexture.");else et.target=TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+rt,et.parentTextureArray=this.baseTexture,this.items[rt]=et;return et.valid&&!this.valid&&this.resize(et.realWidth,et.realHeight),this.items[rt]=et,this}upload(et,rt,st){const nt=this.itemDirtyIds;for(let ot=0;ot<$u.SIDES;ot++){const at=this.items[ot];(nt[ot]<at.dirtyId||st.dirtyId<rt.dirtyId)&&(at.valid&&at.resource?(at.resource.upload(et,at,st),nt[ot]=at.dirtyId):nt[ot]<-1&&(et.gl.texImage2D(at.target,0,st.internalFormat,rt.realWidth,rt.realHeight,0,rt.format,st.type,null),nt[ot]=-1))}return!0}static test(et){return Array.isArray(et)&&et.length===$u.SIDES}};_CubeResource.SIDES=6;let CubeResource=_CubeResource;class ImageBitmapResource extends BaseImageResource{constructor(et,rt){rt=rt||{};let st,nt,ot;typeof et=="string"?(st=ImageBitmapResource.EMPTY,nt=et,ot=!0):(st=et,nt=null,ot=!1),super(st),this.url=nt,this.crossOrigin=rt.crossOrigin??!0,this.alphaMode=typeof rt.alphaMode=="number"?rt.alphaMode:null,this.ownsImageBitmap=rt.ownsImageBitmap??ot,this._load=null,rt.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(et,rt)=>{if(this.url===null){et(this);return}try{const st=await settings.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const nt=await st.blob();if(this.destroyed)return;const ot=await createImageBitmap(nt,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===ALPHA_MODES.UNPACK?"premultiply":"none"});if(this.destroyed){ot.close();return}this.source=ot,this.update(),et(this)}catch(st){if(this.destroyed)return;rt(st),this.onError.emit(st)}}),this._load)}upload(et,rt,st){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(rt.alphaMode=this.alphaMode),super.upload(et,rt,st)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(et){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof et=="string"||et instanceof ImageBitmap)}static get EMPTY(){return ImageBitmapResource._EMPTY=ImageBitmapResource._EMPTY??settings.ADAPTER.createCanvas(0,0),ImageBitmapResource._EMPTY}}const _SVGResource=class $1 extends BaseImageResource{constructor(et,rt){rt=rt||{},super(settings.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=et,this.scale=rt.scale||1,this._overrideWidth=rt.width,this._overrideHeight=rt.height,this._resolve=null,this._crossorigin=rt.crossorigin,this._load=null,rt.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(et=>{if(this._resolve=()=>{this.update(),et(this)},$1.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const et=new Image;BaseImageResource.crossOrigin(et,this.svg,this._crossorigin),et.src=this.svg,et.onerror=rt=>{this._resolve&&(et.onerror=null,this.onError.emit(rt))},et.onload=()=>{if(!this._resolve)return;const rt=et.width,st=et.height;if(!rt||!st)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let nt=rt*this.scale,ot=st*this.scale;(this._overrideWidth||this._overrideHeight)&&(nt=this._overrideWidth||this._overrideHeight/st*rt,ot=this._overrideHeight||this._overrideWidth/rt*st),nt=Math.round(nt),ot=Math.round(ot);const at=this.source;at.width=nt,at.height=ot,at._pixiId=`canvas_${uid()}`,at.getContext("2d").drawImage(et,0,0,rt,st,0,0,nt,ot),this._resolve(),this._resolve=null}}static getSize(et){const rt=$1.SVG_SIZE.exec(et),st={};return rt&&(st[rt[1]]=Math.round(parseFloat(rt[3])),st[rt[5]]=Math.round(parseFloat(rt[7]))),st}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(et,rt){return rt==="svg"||typeof et=="string"&&et.startsWith("data:image/svg+xml")||typeof et=="string"&&$1.SVG_XML.test(et)}};_SVGResource.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,_SVGResource.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let SVGResource=_SVGResource;class VideoFrameResource extends BaseImageResource{constructor(et){super(et)}static test(et){return!!globalThis.VideoFrame&&et instanceof globalThis.VideoFrame}}const _VideoResource=class n2 extends BaseImageResource{constructor(et,rt){if(rt=rt||{},!(et instanceof HTMLVideoElement)){const st=document.createElement("video");rt.autoLoad!==!1&&st.setAttribute("preload","auto"),rt.playsinline!==!1&&(st.setAttribute("webkit-playsinline",""),st.setAttribute("playsinline","")),rt.muted===!0&&(st.setAttribute("muted",""),st.muted=!0),rt.loop===!0&&st.setAttribute("loop",""),rt.autoPlay!==!1&&st.setAttribute("autoplay",""),typeof et=="string"&&(et=[et]);const nt=et[0].src||et[0];BaseImageResource.crossOrigin(st,nt,rt.crossorigin);for(let ot=0;ot<et.length;++ot){const at=document.createElement("source");let{src:lt,mime:ut}=et[ot];if(lt=lt||et[ot],lt.startsWith("data:"))ut=lt.slice(5,lt.indexOf(";"));else if(!lt.startsWith("blob:")){const ct=lt.split("?").shift().toLowerCase(),dt=ct.slice(ct.lastIndexOf(".")+1);ut=ut||n2.MIME_TYPES[dt]||`video/${dt}`}at.src=lt,ut&&(at.type=ut),st.appendChild(at)}et=st}super(et),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=rt.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=rt.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),rt.autoLoad!==!1&&this.load()}update(et=0){if(!this.destroyed){if(this._updateFPS){const rt=Ticker.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-rt)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const et=this.source;return(et.readyState===et.HAVE_ENOUGH_DATA||et.readyState===et.HAVE_FUTURE_DATA)&&et.width&&et.height&&(et.complete=!0),et.addEventListener("play",this._onPlayStart),et.addEventListener("pause",this._onPlayStop),et.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(et.addEventListener("canplay",this._onCanPlay),et.addEventListener("canplaythrough",this._onCanPlay),et.addEventListener("error",this._onError,!0)),this._load=new Promise((rt,st)=>{this.valid?rt(this):(this._resolve=rt,this._reject=st,et.load())}),this._load}_onError(et){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(et),this._reject&&(this._reject(et),this._reject=null,this._resolve=null)}_isSourcePlaying(){const et=this.source;return!et.paused&&!et.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const et=this.source;et.removeEventListener("canplay",this._onCanPlay),et.removeEventListener("canplaythrough",this._onCanPlay);const rt=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!rt&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&et.play()}dispose(){this._configureAutoUpdate();const et=this.source;et&&(et.removeEventListener("play",this._onPlayStart),et.removeEventListener("pause",this._onPlayStop),et.removeEventListener("seeked",this._onSeeked),et.removeEventListener("canplay",this._onCanPlay),et.removeEventListener("canplaythrough",this._onCanPlay),et.removeEventListener("error",this._onError,!0),et.pause(),et.src="",et.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(et){et!==this._autoUpdate&&(this._autoUpdate=et,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(et){et!==this._updateFPS&&(this._updateFPS=et,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Ticker.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(et,rt){return globalThis.HTMLVideoElement&&et instanceof HTMLVideoElement||n2.TYPES.includes(rt)}};_VideoResource.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],_VideoResource.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let VideoResource=_VideoResource;INSTALLED.push(ImageBitmapResource,ImageResource,CanvasResource,VideoResource,VideoFrameResource,SVGResource,BufferResource,CubeResource,ArrayResource);class Bounds{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(et){return this.minX>this.maxX||this.minY>this.maxY?Rectangle.EMPTY:(et=et||new Rectangle(0,0,1,1),et.x=this.minX,et.y=this.minY,et.width=this.maxX-this.minX,et.height=this.maxY-this.minY,et)}addPoint(et){this.minX=Math.min(this.minX,et.x),this.maxX=Math.max(this.maxX,et.x),this.minY=Math.min(this.minY,et.y),this.maxY=Math.max(this.maxY,et.y)}addPointMatrix(et,rt){const{a:st,b:nt,c:ot,d:at,tx:lt,ty:ut}=et,ct=st*rt.x+ot*rt.y+lt,dt=nt*rt.x+at*rt.y+ut;this.minX=Math.min(this.minX,ct),this.maxX=Math.max(this.maxX,ct),this.minY=Math.min(this.minY,dt),this.maxY=Math.max(this.maxY,dt)}addQuad(et){let rt=this.minX,st=this.minY,nt=this.maxX,ot=this.maxY,at=et[0],lt=et[1];rt=at<rt?at:rt,st=lt<st?lt:st,nt=at>nt?at:nt,ot=lt>ot?lt:ot,at=et[2],lt=et[3],rt=at<rt?at:rt,st=lt<st?lt:st,nt=at>nt?at:nt,ot=lt>ot?lt:ot,at=et[4],lt=et[5],rt=at<rt?at:rt,st=lt<st?lt:st,nt=at>nt?at:nt,ot=lt>ot?lt:ot,at=et[6],lt=et[7],rt=at<rt?at:rt,st=lt<st?lt:st,nt=at>nt?at:nt,ot=lt>ot?lt:ot,this.minX=rt,this.minY=st,this.maxX=nt,this.maxY=ot}addFrame(et,rt,st,nt,ot){this.addFrameMatrix(et.worldTransform,rt,st,nt,ot)}addFrameMatrix(et,rt,st,nt,ot){const at=et.a,lt=et.b,ut=et.c,ct=et.d,dt=et.tx,ht=et.ty;let ft=this.minX,xt=this.minY,vt=this.maxX,yt=this.maxY,Et=at*rt+ut*st+dt,bt=lt*rt+ct*st+ht;ft=Et<ft?Et:ft,xt=bt<xt?bt:xt,vt=Et>vt?Et:vt,yt=bt>yt?bt:yt,Et=at*nt+ut*st+dt,bt=lt*nt+ct*st+ht,ft=Et<ft?Et:ft,xt=bt<xt?bt:xt,vt=Et>vt?Et:vt,yt=bt>yt?bt:yt,Et=at*rt+ut*ot+dt,bt=lt*rt+ct*ot+ht,ft=Et<ft?Et:ft,xt=bt<xt?bt:xt,vt=Et>vt?Et:vt,yt=bt>yt?bt:yt,Et=at*nt+ut*ot+dt,bt=lt*nt+ct*ot+ht,ft=Et<ft?Et:ft,xt=bt<xt?bt:xt,vt=Et>vt?Et:vt,yt=bt>yt?bt:yt,this.minX=ft,this.minY=xt,this.maxX=vt,this.maxY=yt}addVertexData(et,rt,st){let nt=this.minX,ot=this.minY,at=this.maxX,lt=this.maxY;for(let ut=rt;ut<st;ut+=2){const ct=et[ut],dt=et[ut+1];nt=ct<nt?ct:nt,ot=dt<ot?dt:ot,at=ct>at?ct:at,lt=dt>lt?dt:lt}this.minX=nt,this.minY=ot,this.maxX=at,this.maxY=lt}addVertices(et,rt,st,nt){this.addVerticesMatrix(et.worldTransform,rt,st,nt)}addVerticesMatrix(et,rt,st,nt,ot=0,at=ot){const lt=et.a,ut=et.b,ct=et.c,dt=et.d,ht=et.tx,ft=et.ty;let xt=this.minX,vt=this.minY,yt=this.maxX,Et=this.maxY;for(let bt=st;bt<nt;bt+=2){const wt=rt[bt],St=rt[bt+1],Rt=lt*wt+ct*St+ht,Ct=dt*St+ut*wt+ft;xt=Math.min(xt,Rt-ot),yt=Math.max(yt,Rt+ot),vt=Math.min(vt,Ct-at),Et=Math.max(Et,Ct+at)}this.minX=xt,this.minY=vt,this.maxX=yt,this.maxY=Et}addBounds(et){const rt=this.minX,st=this.minY,nt=this.maxX,ot=this.maxY;this.minX=et.minX<rt?et.minX:rt,this.minY=et.minY<st?et.minY:st,this.maxX=et.maxX>nt?et.maxX:nt,this.maxY=et.maxY>ot?et.maxY:ot}addBoundsMask(et,rt){const st=et.minX>rt.minX?et.minX:rt.minX,nt=et.minY>rt.minY?et.minY:rt.minY,ot=et.maxX<rt.maxX?et.maxX:rt.maxX,at=et.maxY<rt.maxY?et.maxY:rt.maxY;if(st<=ot&&nt<=at){const lt=this.minX,ut=this.minY,ct=this.maxX,dt=this.maxY;this.minX=st<lt?st:lt,this.minY=nt<ut?nt:ut,this.maxX=ot>ct?ot:ct,this.maxY=at>dt?at:dt}}addBoundsMatrix(et,rt){this.addFrameMatrix(rt,et.minX,et.minY,et.maxX,et.maxY)}addBoundsArea(et,rt){const st=et.minX>rt.x?et.minX:rt.x,nt=et.minY>rt.y?et.minY:rt.y,ot=et.maxX<rt.x+rt.width?et.maxX:rt.x+rt.width,at=et.maxY<rt.y+rt.height?et.maxY:rt.y+rt.height;if(st<=ot&&nt<=at){const lt=this.minX,ut=this.minY,ct=this.maxX,dt=this.maxY;this.minX=st<lt?st:lt,this.minY=nt<ut?nt:ut,this.maxX=ot>ct?ot:ct,this.maxY=at>dt?at:dt}}pad(et=0,rt=et){this.isEmpty()||(this.minX-=et,this.maxX+=et,this.minY-=rt,this.maxY+=rt)}addFramePad(et,rt,st,nt,ot,at){et-=ot,rt-=at,st+=ot,nt+=at,this.minX=this.minX<et?this.minX:et,this.maxX=this.maxX>st?this.maxX:st,this.minY=this.minY<rt?this.minY:rt,this.maxY=this.maxY>nt?this.maxY:nt}}class DisplayObject extends EventEmitter{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Transform,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Bounds,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(et){const rt=Object.keys(et);for(let st=0;st<rt.length;++st){const nt=rt[st];Object.defineProperty(DisplayObject.prototype,nt,Object.getOwnPropertyDescriptor(et,nt))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(et,rt){return et||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),rt||(this._boundsRect||(this._boundsRect=new Rectangle),rt=this._boundsRect),this._bounds.getRectangle(rt)}getLocalBounds(et){et||(this._localBoundsRect||(this._localBoundsRect=new Rectangle),et=this._localBoundsRect),this._localBounds||(this._localBounds=new Bounds);const rt=this.transform,st=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=(st==null?void 0:st.worldAlpha)??1,this.transform=this._tempDisplayObjectParent.transform;const nt=this._bounds,ot=this._boundsID;this._bounds=this._localBounds;const at=this.getBounds(!1,et);return this.parent=st,this.transform=rt,this._bounds=nt,this._bounds.updateID+=this._boundsID-ot,at}toGlobal(et,rt,st=!1){return st||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(et,rt)}toLocal(et,rt,st,nt){return rt&&(et=rt.toGlobal(et,st,nt)),nt||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(et,st)}setParent(et){if(!et||!et.addChild)throw new Error("setParent: Argument must be a Container");return et.addChild(this),et}removeFromParent(){var et;(et=this.parent)==null||et.removeChild(this)}setTransform(et=0,rt=0,st=1,nt=1,ot=0,at=0,lt=0,ut=0,ct=0){return this.position.x=et,this.position.y=rt,this.scale.x=st||1,this.scale.y=nt||1,this.rotation=ot,this.skew.x=at,this.skew.y=lt,this.pivot.x=ut,this.pivot.y=ct,this}destroy(et){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new TemporaryDisplayObject),this.tempDisplayObjectParent}enableTempParent(){const et=this.parent;return this.parent=this._tempDisplayObjectParent,et}disableTempParent(et){this.parent=et}get x(){return this.position.x}set x(et){this.transform.position.x=et}get y(){return this.position.y}set y(et){this.transform.position.y=et}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(et){this.transform.position.copyFrom(et)}get scale(){return this.transform.scale}set scale(et){this.transform.scale.copyFrom(et)}get pivot(){return this.transform.pivot}set pivot(et){this.transform.pivot.copyFrom(et)}get skew(){return this.transform.skew}set skew(et){this.transform.skew.copyFrom(et)}get rotation(){return this.transform.rotation}set rotation(et){this.transform.rotation=et}get angle(){return this.transform.rotation*RAD_TO_DEG}set angle(et){this.transform.rotation=et*DEG_TO_RAD}get zIndex(){return this._zIndex}set zIndex(et){this._zIndex!==et&&(this._zIndex=et,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let et=this;do{if(!et.visible)return!1;et=et.parent}while(et);return!0}get mask(){return this._mask}set mask(et){if(this._mask!==et){if(this._mask){const rt=this._mask.isMaskData?this._mask.maskObject:this._mask;rt&&(rt._maskRefCount--,rt._maskRefCount===0&&(rt.renderable=!0,rt.isMask=!1))}if(this._mask=et,this._mask){const rt=this._mask.isMaskData?this._mask.maskObject:this._mask;rt&&(rt._maskRefCount===0&&(rt.renderable=!1,rt.isMask=!0),rt._maskRefCount++)}}}}class TemporaryDisplayObject extends DisplayObject{constructor(){super(...arguments),this.sortDirty=null}}DisplayObject.prototype.displayObjectUpdateTransform=DisplayObject.prototype.updateTransform;const tempMatrix=new Matrix;function sortChildren(tt,et){return tt.zIndex===et.zIndex?tt._lastSortedIndex-et._lastSortedIndex:tt.zIndex-et.zIndex}const _Container=class i2 extends DisplayObject{constructor(){super(),this.children=[],this.sortableChildren=i2.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(et){}addChild(...et){if(et.length>1)for(let rt=0;rt<et.length;rt++)this.addChild(et[rt]);else{const rt=et[0];rt.parent&&rt.parent.removeChild(rt),rt.parent=this,this.sortDirty=!0,rt.transform._parentID=-1,this.children.push(rt),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",rt,this,this.children.length-1),rt.emit("added",this)}return et[0]}addChildAt(et,rt){if(rt<0||rt>this.children.length)throw new Error(`${et}addChildAt: The index ${rt} supplied is out of bounds ${this.children.length}`);return et.parent&&et.parent.removeChild(et),et.parent=this,this.sortDirty=!0,et.transform._parentID=-1,this.children.splice(rt,0,et),this._boundsID++,this.onChildrenChange(rt),et.emit("added",this),this.emit("childAdded",et,this,rt),et}swapChildren(et,rt){if(et===rt)return;const st=this.getChildIndex(et),nt=this.getChildIndex(rt);this.children[st]=rt,this.children[nt]=et,this.onChildrenChange(st<nt?st:nt)}getChildIndex(et){const rt=this.children.indexOf(et);if(rt===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return rt}setChildIndex(et,rt){if(rt<0||rt>=this.children.length)throw new Error(`The index ${rt} supplied is out of bounds ${this.children.length}`);const st=this.getChildIndex(et);removeItems(this.children,st,1),this.children.splice(rt,0,et),this.onChildrenChange(rt)}getChildAt(et){if(et<0||et>=this.children.length)throw new Error(`getChildAt: Index (${et}) does not exist.`);return this.children[et]}removeChild(...et){if(et.length>1)for(let rt=0;rt<et.length;rt++)this.removeChild(et[rt]);else{const rt=et[0],st=this.children.indexOf(rt);if(st===-1)return null;rt.parent=null,rt.transform._parentID=-1,removeItems(this.children,st,1),this._boundsID++,this.onChildrenChange(st),rt.emit("removed",this),this.emit("childRemoved",rt,this,st)}return et[0]}removeChildAt(et){const rt=this.getChildAt(et);return rt.parent=null,rt.transform._parentID=-1,removeItems(this.children,et,1),this._boundsID++,this.onChildrenChange(et),rt.emit("removed",this),this.emit("childRemoved",rt,this,et),rt}removeChildren(et=0,rt=this.children.length){const st=et,nt=rt,ot=nt-st;let at;if(ot>0&&ot<=nt){at=this.children.splice(st,ot);for(let lt=0;lt<at.length;++lt)at[lt].parent=null,at[lt].transform&&(at[lt].transform._parentID=-1);this._boundsID++,this.onChildrenChange(et);for(let lt=0;lt<at.length;++lt)at[lt].emit("removed",this),this.emit("childRemoved",at[lt],this,lt);return at}else if(ot===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let et=!1;for(let rt=0,st=this.children.length;rt<st;++rt){const nt=this.children[rt];nt._lastSortedIndex=rt,!et&&nt.zIndex!==0&&(et=!0)}et&&this.children.length>1&&this.children.sort(sortChildren),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let et=0,rt=this.children.length;et<rt;++et){const st=this.children[et];st.visible&&st.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let et=0;et<this.children.length;et++){const rt=this.children[et];if(!(!rt.visible||!rt.renderable))if(rt.calculateBounds(),rt._mask){const st=rt._mask.isMaskData?rt._mask.maskObject:rt._mask;st?(st.calculateBounds(),this._bounds.addBoundsMask(rt._bounds,st._bounds)):this._bounds.addBounds(rt._bounds)}else rt.filterArea?this._bounds.addBoundsArea(rt._bounds,rt.filterArea):this._bounds.addBounds(rt._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(et,rt=!1){const st=super.getLocalBounds(et);if(!rt)for(let nt=0,ot=this.children.length;nt<ot;++nt){const at=this.children[nt];at.visible&&at.updateTransform()}return st}_calculateBounds(){}_renderWithCulling(et){const rt=et.renderTexture.sourceFrame;if(!(rt.width>0&&rt.height>0))return;let st,nt;this.cullArea?(st=this.cullArea,nt=this.worldTransform):this._render!==i2.prototype._render&&(st=this.getBounds(!0));const ot=et.projection.transform;if(ot&&(nt?(nt=tempMatrix.copyFrom(nt),nt.prepend(ot)):nt=ot),st&&rt.intersects(st,nt))this._render(et);else if(this.cullArea)return;for(let at=0,lt=this.children.length;at<lt;++at){const ut=this.children[at],ct=ut.cullable;ut.cullable=ct||!this.cullArea,ut.render(et),ut.cullable=ct}}render(et){var rt;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(rt=this.filters)!=null&&rt.length)this.renderAdvanced(et);else if(this.cullable)this._renderWithCulling(et);else{this._render(et);for(let st=0,nt=this.children.length;st<nt;++st)this.children[st].render(et)}}renderAdvanced(et){var ot,at,lt;const rt=this.filters,st=this._mask;if(rt){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let ut=0;ut<rt.length;ut++)rt[ut].enabled&&this._enabledFilters.push(rt[ut])}const nt=rt&&((ot=this._enabledFilters)==null?void 0:ot.length)||st&&(!st.isMaskData||st.enabled&&(st.autoDetect||st.type!==MASK_TYPES.NONE));if(nt&&et.batch.flush(),rt&&((at=this._enabledFilters)!=null&&at.length)&&et.filter.push(this,this._enabledFilters),st&&et.mask.push(this,this._mask),this.cullable)this._renderWithCulling(et);else{this._render(et);for(let ut=0,ct=this.children.length;ut<ct;++ut)this.children[ut].render(et)}nt&&et.batch.flush(),st&&et.mask.pop(this),rt&&((lt=this._enabledFilters)!=null&<.length)&&et.filter.pop()}_render(et){}destroy(et){super.destroy(),this.sortDirty=!1;const rt=typeof et=="boolean"?et:et==null?void 0:et.children,st=this.removeChildren(0,this.children.length);if(rt)for(let nt=0;nt<st.length;++nt)st[nt].destroy(et)}get width(){return this.scale.x*this.getLocalBounds().width}set width(et){const rt=this.getLocalBounds().width;rt!==0?this.scale.x=et/rt:this.scale.x=1,this._width=et}get height(){return this.scale.y*this.getLocalBounds().height}set height(et){const rt=this.getLocalBounds().height;rt!==0?this.scale.y=et/rt:this.scale.y=1,this._height=et}};_Container.defaultSortableChildren=!1;let Container=_Container;Container.prototype.containerUpdateTransform=Container.prototype.updateTransform;Object.defineProperties(settings,{SORTABLE_CHILDREN:{get(){return Container.defaultSortableChildren},set(tt){deprecation("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Container.defaultSortableChildren=tt}}});var TEXT_GRADIENT=(tt=>(tt[tt.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",tt[tt.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",tt))(TEXT_GRADIENT||{});const tempPoint$2=new Point,indices=new Uint16Array([0,1,2,0,2,3]);class Sprite extends Container{constructor(et){super(),this._anchor=new ObservablePoint(this._onAnchorUpdate,this,et?et.defaultAnchor.x:0,et?et.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new Color(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=BLEND_MODES.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=et||Texture.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=indices,this.pluginName="batch",this.isSprite=!0,this._roundPixels=settings.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=sign(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const et=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===et._updateID)return;this._textureID!==et._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=et._updateID;const rt=this.transform.worldTransform,st=rt.a,nt=rt.b,ot=rt.c,at=rt.d,lt=rt.tx,ut=rt.ty,ct=this.vertexData,dt=et.trim,ht=et.orig,ft=this._anchor;let xt=0,vt=0,yt=0,Et=0;if(dt?(vt=dt.x-ft._x*ht.width,xt=vt+dt.width,Et=dt.y-ft._y*ht.height,yt=Et+dt.height):(vt=-ft._x*ht.width,xt=vt+ht.width,Et=-ft._y*ht.height,yt=Et+ht.height),ct[0]=st*vt+ot*Et+lt,ct[1]=at*Et+nt*vt+ut,ct[2]=st*xt+ot*Et+lt,ct[3]=at*Et+nt*xt+ut,ct[4]=st*xt+ot*yt+lt,ct[5]=at*yt+nt*xt+ut,ct[6]=st*vt+ot*yt+lt,ct[7]=at*yt+nt*vt+ut,this._roundPixels){const bt=settings.RESOLUTION;for(let wt=0;wt<ct.length;++wt)ct[wt]=Math.round(ct[wt]*bt)/bt}}calculateTrimmedVertices(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const et=this._texture,rt=this.vertexTrimmedData,st=et.orig,nt=this._anchor,ot=this.transform.worldTransform,at=ot.a,lt=ot.b,ut=ot.c,ct=ot.d,dt=ot.tx,ht=ot.ty,ft=-nt._x*st.width,xt=ft+st.width,vt=-nt._y*st.height,yt=vt+st.height;if(rt[0]=at*ft+ut*vt+dt,rt[1]=ct*vt+lt*ft+ht,rt[2]=at*xt+ut*vt+dt,rt[3]=ct*vt+lt*xt+ht,rt[4]=at*xt+ut*yt+dt,rt[5]=ct*yt+lt*xt+ht,rt[6]=at*ft+ut*yt+dt,rt[7]=ct*yt+lt*ft+ht,this._roundPixels){const Et=settings.RESOLUTION;for(let bt=0;bt<rt.length;++bt)rt[bt]=Math.round(rt[bt]*Et)/Et}}_render(et){this.calculateVertices(),et.batch.setObjectRenderer(et.plugins[this.pluginName]),et.plugins[this.pluginName].render(this)}_calculateBounds(){const et=this._texture.trim,rt=this._texture.orig;!et||et.width===rt.width&&et.height===rt.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(et){return this.children.length===0?(this._localBounds||(this._localBounds=new Bounds),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),et||(this._localBoundsRect||(this._localBoundsRect=new Rectangle),et=this._localBoundsRect),this._localBounds.getRectangle(et)):super.getLocalBounds.call(this,et)}containsPoint(et){this.worldTransform.applyInverse(et,tempPoint$2);const rt=this._texture.orig.width,st=this._texture.orig.height,nt=-rt*this.anchor.x;let ot=0;return tempPoint$2.x>=nt&&tempPoint$2.x<nt+rt&&(ot=-st*this.anchor.y,tempPoint$2.y>=ot&&tempPoint$2.y<ot+st)}destroy(et){if(super.destroy(et),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof et=="boolean"?et:et==null?void 0:et.texture){const rt=typeof et=="boolean"?et:et==null?void 0:et.baseTexture;this._texture.destroy(!!rt)}this._texture=null}static from(et,rt){const st=et instanceof Texture?et:Texture.from(et,rt);return new Sprite(st)}set roundPixels(et){this._roundPixels!==et&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=et}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(et){const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._texture.orig.width,this._width=et}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(et){const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._texture.orig.height,this._height=et}get anchor(){return this._anchor}set anchor(et){this._anchor.copyFrom(et)}get tint(){return this._tintColor.value}set tint(et){this._tintColor.setValue(et),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(et){this._texture!==et&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=et||Texture.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,et&&(et.baseTexture.valid?this._onTextureUpdate():et.once("update",this._onTextureUpdate,this)))}}const contextSettings={willReadFrequently:!0},_TextMetrics=class jr{static get experimentalLetterSpacingSupported(){let et=jr._experimentalLetterSpacingSupported;if(et!==void 0){const rt=settings.ADAPTER.getCanvasRenderingContext2D().prototype;et=jr._experimentalLetterSpacingSupported="letterSpacing"in rt||"textLetterSpacing"in rt}return et}constructor(et,rt,st,nt,ot,at,lt,ut,ct){this.text=et,this.style=rt,this.width=st,this.height=nt,this.lines=ot,this.lineWidths=at,this.lineHeight=lt,this.maxLineWidth=ut,this.fontProperties=ct}static measureText(et,rt,st,nt=jr._canvas){st=st??rt.wordWrap;const ot=rt.toFontString(),at=jr.measureFont(ot);at.fontSize===0&&(at.fontSize=rt.fontSize,at.ascent=rt.fontSize);const lt=nt.getContext("2d",contextSettings);lt.font=ot;const ut=(st?jr.wordWrap(et,rt,nt):et).split(/(?:\r\n|\r|\n)/),ct=new Array(ut.length);let dt=0;for(let vt=0;vt<ut.length;vt++){const yt=jr._measureText(ut[vt],rt.letterSpacing,lt);ct[vt]=yt,dt=Math.max(dt,yt)}let ht=dt+rt.strokeThickness;rt.dropShadow&&(ht+=rt.dropShadowDistance);const ft=rt.lineHeight||at.fontSize+rt.strokeThickness;let xt=Math.max(ft,at.fontSize+rt.strokeThickness*2)+rt.leading+(ut.length-1)*(ft+rt.leading);return rt.dropShadow&&(xt+=rt.dropShadowDistance),new jr(et,rt,ht,xt,ut,ct,ft+rt.leading,dt,at)}static _measureText(et,rt,st){let nt=!1;jr.experimentalLetterSpacingSupported&&(jr.experimentalLetterSpacing?(st.letterSpacing=`${rt}px`,st.textLetterSpacing=`${rt}px`,nt=!0):(st.letterSpacing="0px",st.textLetterSpacing="0px"));let ot=st.measureText(et).width;return ot>0&&(nt?ot-=rt:ot+=(jr.graphemeSegmenter(et).length-1)*rt),ot}static wordWrap(et,rt,st=jr._canvas){const nt=st.getContext("2d",contextSettings);let ot=0,at="",lt="";const ut=Object.create(null),{letterSpacing:ct,whiteSpace:dt}=rt,ht=jr.collapseSpaces(dt),ft=jr.collapseNewlines(dt);let xt=!ht;const vt=rt.wordWrapWidth+ct,yt=jr.tokenize(et);for(let Et=0;Et<yt.length;Et++){let bt=yt[Et];if(jr.isNewline(bt)){if(!ft){lt+=jr.addLine(at),xt=!ht,at="",ot=0;continue}bt=" "}if(ht){const St=jr.isBreakingSpace(bt),Rt=jr.isBreakingSpace(at[at.length-1]);if(St&&Rt)continue}const wt=jr.getFromCache(bt,ct,ut,nt);if(wt>vt)if(at!==""&&(lt+=jr.addLine(at),at="",ot=0),jr.canBreakWords(bt,rt.breakWords)){const St=jr.wordWrapSplit(bt);for(let Rt=0;Rt<St.length;Rt++){let Ct=St[Rt],It=Ct,jt=1;for(;St[Rt+jt];){const Ot=St[Rt+jt];if(!jr.canBreakChars(It,Ot,bt,Rt,rt.breakWords))Ct+=Ot;else break;It=Ot,jt++}Rt+=jt-1;const Pt=jr.getFromCache(Ct,ct,ut,nt);Pt+ot>vt&&(lt+=jr.addLine(at),xt=!1,at="",ot=0),at+=Ct,ot+=Pt}}else{at.length>0&&(lt+=jr.addLine(at),at="",ot=0);const St=Et===yt.length-1;lt+=jr.addLine(bt,!St),xt=!1,at="",ot=0}else wt+ot>vt&&(xt=!1,lt+=jr.addLine(at),at="",ot=0),(at.length>0||!jr.isBreakingSpace(bt)||xt)&&(at+=bt,ot+=wt)}return lt+=jr.addLine(at,!1),lt}static addLine(et,rt=!0){return et=jr.trimRight(et),et=rt?`${et}
|
|
752
|
-
`:et,et}static getFromCache(et,rt,st,nt){let ot=st[et];return typeof ot!="number"&&(ot=jr._measureText(et,rt,nt)+rt,st[et]=ot),ot}static collapseSpaces(et){return et==="normal"||et==="pre-line"}static collapseNewlines(et){return et==="normal"}static trimRight(et){if(typeof et!="string")return"";for(let rt=et.length-1;rt>=0;rt--){const st=et[rt];if(!jr.isBreakingSpace(st))break;et=et.slice(0,-1)}return et}static isNewline(et){return typeof et!="string"?!1:jr._newlines.includes(et.charCodeAt(0))}static isBreakingSpace(et,rt){return typeof et!="string"?!1:jr._breakingSpaces.includes(et.charCodeAt(0))}static tokenize(et){const rt=[];let st="";if(typeof et!="string")return rt;for(let nt=0;nt<et.length;nt++){const ot=et[nt],at=et[nt+1];if(jr.isBreakingSpace(ot,at)||jr.isNewline(ot)){st!==""&&(rt.push(st),st=""),rt.push(ot);continue}st+=ot}return st!==""&&rt.push(st),rt}static canBreakWords(et,rt){return rt}static canBreakChars(et,rt,st,nt,ot){return!0}static wordWrapSplit(et){return jr.graphemeSegmenter(et)}static measureFont(et){if(jr._fonts[et])return jr._fonts[et];const rt={ascent:0,descent:0,fontSize:0},st=jr._canvas,nt=jr._context;nt.font=et;const ot=jr.METRICS_STRING+jr.BASELINE_SYMBOL,at=Math.ceil(nt.measureText(ot).width);let lt=Math.ceil(nt.measureText(jr.BASELINE_SYMBOL).width);const ut=Math.ceil(jr.HEIGHT_MULTIPLIER*lt);if(lt=lt*jr.BASELINE_MULTIPLIER|0,at===0||ut===0)return jr._fonts[et]=rt,rt;st.width=at,st.height=ut,nt.fillStyle="#f00",nt.fillRect(0,0,at,ut),nt.font=et,nt.textBaseline="alphabetic",nt.fillStyle="#000",nt.fillText(ot,0,lt);const ct=nt.getImageData(0,0,at,ut).data,dt=ct.length,ht=at*4;let ft=0,xt=0,vt=!1;for(ft=0;ft<lt;++ft){for(let yt=0;yt<ht;yt+=4)if(ct[xt+yt]!==255){vt=!0;break}if(!vt)xt+=ht;else break}for(rt.ascent=lt-ft,xt=dt-ht,vt=!1,ft=ut;ft>lt;--ft){for(let yt=0;yt<ht;yt+=4)if(ct[xt+yt]!==255){vt=!0;break}if(!vt)xt-=ht;else break}return rt.descent=ft-lt,rt.fontSize=rt.ascent+rt.descent,jr._fonts[et]=rt,rt}static clearMetrics(et=""){et?delete jr._fonts[et]:jr._fonts={}}static get _canvas(){var et;if(!jr.__canvas){let rt;try{const st=new OffscreenCanvas(0,0);if((et=st.getContext("2d",contextSettings))!=null&&et.measureText)return jr.__canvas=st,st;rt=settings.ADAPTER.createCanvas()}catch{rt=settings.ADAPTER.createCanvas()}rt.width=rt.height=10,jr.__canvas=rt}return jr.__canvas}static get _context(){return jr.__context||(jr.__context=jr._canvas.getContext("2d",contextSettings)),jr.__context}};_TextMetrics.METRICS_STRING="|ÉqÅ",_TextMetrics.BASELINE_SYMBOL="M",_TextMetrics.BASELINE_MULTIPLIER=1.4,_TextMetrics.HEIGHT_MULTIPLIER=2,_TextMetrics.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const tt=new Intl.Segmenter;return et=>[...tt.segment(et)].map(rt=>rt.segment)}return tt=>[...tt]})(),_TextMetrics.experimentalLetterSpacing=!1,_TextMetrics._fonts={},_TextMetrics._newlines=[10,13],_TextMetrics._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let TextMetrics=_TextMetrics;const genericFontFamilies=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],_TextStyle=class Ou{constructor(et){this.styleID=0,this.reset(),deepCopyProperties(this,et,et)}clone(){const et={};return deepCopyProperties(et,this,Ou.defaultStyle),new Ou(et)}reset(){deepCopyProperties(this,Ou.defaultStyle,Ou.defaultStyle)}get align(){return this._align}set align(et){this._align!==et&&(this._align=et,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(et){this._breakWords!==et&&(this._breakWords=et,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(et){this._dropShadow!==et&&(this._dropShadow=et,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(et){this._dropShadowAlpha!==et&&(this._dropShadowAlpha=et,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(et){this._dropShadowAngle!==et&&(this._dropShadowAngle=et,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(et){this._dropShadowBlur!==et&&(this._dropShadowBlur=et,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(et){const rt=getColor(et);this._dropShadowColor!==rt&&(this._dropShadowColor=rt,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(et){this._dropShadowDistance!==et&&(this._dropShadowDistance=et,this.styleID++)}get fill(){return this._fill}set fill(et){const rt=getColor(et);this._fill!==rt&&(this._fill=rt,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(et){this._fillGradientType!==et&&(this._fillGradientType=et,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(et){areArraysEqual(this._fillGradientStops,et)||(this._fillGradientStops=et,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(et){this.fontFamily!==et&&(this._fontFamily=et,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(et){this._fontSize!==et&&(this._fontSize=et,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(et){this._fontStyle!==et&&(this._fontStyle=et,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(et){this._fontVariant!==et&&(this._fontVariant=et,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(et){this._fontWeight!==et&&(this._fontWeight=et,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(et){this._letterSpacing!==et&&(this._letterSpacing=et,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(et){this._lineHeight!==et&&(this._lineHeight=et,this.styleID++)}get leading(){return this._leading}set leading(et){this._leading!==et&&(this._leading=et,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(et){this._lineJoin!==et&&(this._lineJoin=et,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(et){this._miterLimit!==et&&(this._miterLimit=et,this.styleID++)}get padding(){return this._padding}set padding(et){this._padding!==et&&(this._padding=et,this.styleID++)}get stroke(){return this._stroke}set stroke(et){const rt=getColor(et);this._stroke!==rt&&(this._stroke=rt,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(et){this._strokeThickness!==et&&(this._strokeThickness=et,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(et){this._textBaseline!==et&&(this._textBaseline=et,this.styleID++)}get trim(){return this._trim}set trim(et){this._trim!==et&&(this._trim=et,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(et){this._whiteSpace!==et&&(this._whiteSpace=et,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(et){this._wordWrap!==et&&(this._wordWrap=et,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(et){this._wordWrapWidth!==et&&(this._wordWrapWidth=et,this.styleID++)}toFontString(){const et=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let rt=this.fontFamily;Array.isArray(this.fontFamily)||(rt=this.fontFamily.split(","));for(let st=rt.length-1;st>=0;st--){let nt=rt[st].trim();!/([\"\'])[^\'\"]+\1/.test(nt)&&!genericFontFamilies.includes(nt)&&(nt=`"${nt}"`),rt[st]=nt}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${et} ${rt.join(",")}`}};_TextStyle.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:TEXT_GRADIENT.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let TextStyle=_TextStyle;function getColor(tt){const et=Color.shared,rt=st=>{const nt=et.setValue(st);return nt.alpha===1?nt.toHex():nt.toRgbaString()};return Array.isArray(tt)?tt.map(rt):rt(tt)}function areArraysEqual(tt,et){if(!Array.isArray(tt)||!Array.isArray(et)||tt.length!==et.length)return!1;for(let rt=0;rt<tt.length;++rt)if(tt[rt]!==et[rt])return!1;return!0}function deepCopyProperties(tt,et,rt){for(const st in rt)Array.isArray(et[st])?tt[st]=et[st].slice():tt[st]=et[st]}const defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_Text=class o2 extends Sprite{constructor(et,rt,st){let nt=!1;st||(st=settings.ADAPTER.createCanvas(),nt=!0),st.width=3,st.height=3;const ot=Texture.from(st);ot.orig=new Rectangle,ot.trim=new Rectangle,super(ot),this._ownCanvas=nt,this.canvas=st,this.context=st.getContext("2d",{willReadFrequently:!0}),this._resolution=o2.defaultResolution??settings.RESOLUTION,this._autoResolution=o2.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=et,this.style=rt,this.localStyleID=-1}static get experimentalLetterSpacing(){return TextMetrics.experimentalLetterSpacing}static set experimentalLetterSpacing(et){deprecation("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),TextMetrics.experimentalLetterSpacing=et}updateText(et){const rt=this._style;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;this._font=this._style.toFontString();const st=this.context,nt=TextMetrics.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),ot=nt.width,at=nt.height,lt=nt.lines,ut=nt.lineHeight,ct=nt.lineWidths,dt=nt.maxLineWidth,ht=nt.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,ot)+rt.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,at)+rt.padding*2)*this._resolution),st.scale(this._resolution,this._resolution),st.clearRect(0,0,this.canvas.width,this.canvas.height),st.font=this._font,st.lineWidth=rt.strokeThickness,st.textBaseline=rt.textBaseline,st.lineJoin=rt.lineJoin,st.miterLimit=rt.miterLimit;let ft,xt;const vt=rt.dropShadow?2:1;for(let yt=0;yt<vt;++yt){const Et=rt.dropShadow&&yt===0,bt=Et?Math.ceil(Math.max(1,at)+rt.padding*2):0,wt=bt*this._resolution;if(Et){st.fillStyle="black",st.strokeStyle="black";const Rt=rt.dropShadowColor,Ct=rt.dropShadowBlur*this._resolution,It=rt.dropShadowDistance*this._resolution;st.shadowColor=Color.shared.setValue(Rt).setAlpha(rt.dropShadowAlpha).toRgbaString(),st.shadowBlur=Ct,st.shadowOffsetX=Math.cos(rt.dropShadowAngle)*It,st.shadowOffsetY=Math.sin(rt.dropShadowAngle)*It+wt}else st.fillStyle=this._generateFillStyle(rt,lt,nt),st.strokeStyle=rt.stroke,st.shadowColor="black",st.shadowBlur=0,st.shadowOffsetX=0,st.shadowOffsetY=0;let St=(ut-ht.fontSize)/2;ut-ht.fontSize<0&&(St=0);for(let Rt=0;Rt<lt.length;Rt++)ft=rt.strokeThickness/2,xt=rt.strokeThickness/2+Rt*ut+ht.ascent+St,rt.align==="right"?ft+=dt-ct[Rt]:rt.align==="center"&&(ft+=(dt-ct[Rt])/2),rt.stroke&&rt.strokeThickness&&this.drawLetterSpacing(lt[Rt],ft+rt.padding,xt+rt.padding-bt,!0),rt.fill&&this.drawLetterSpacing(lt[Rt],ft+rt.padding,xt+rt.padding-bt)}this.updateTexture()}drawLetterSpacing(et,rt,st,nt=!1){const ot=this._style.letterSpacing;let at=!1;if(TextMetrics.experimentalLetterSpacingSupported&&(TextMetrics.experimentalLetterSpacing?(this.context.letterSpacing=`${ot}px`,this.context.textLetterSpacing=`${ot}px`,at=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),ot===0||at){nt?this.context.strokeText(et,rt,st):this.context.fillText(et,rt,st);return}let lt=rt;const ut=TextMetrics.graphemeSegmenter(et);let ct=this.context.measureText(et).width,dt=0;for(let ht=0;ht<ut.length;++ht){const ft=ut[ht];nt?this.context.strokeText(ft,lt,st):this.context.fillText(ft,lt,st);let xt="";for(let vt=ht+1;vt<ut.length;++vt)xt+=ut[vt];dt=this.context.measureText(xt).width,lt+=ct-dt+ot,ct=dt}}updateTexture(){const et=this.canvas;if(this._style.trim){const at=trimCanvas(et);at.data&&(et.width=at.width,et.height=at.height,this.context.putImageData(at.data,0,0))}const rt=this._texture,st=this._style,nt=st.trim?0:st.padding,ot=rt.baseTexture;rt.trim.width=rt._frame.width=et.width/this._resolution,rt.trim.height=rt._frame.height=et.height/this._resolution,rt.trim.x=-nt,rt.trim.y=-nt,rt.orig.width=rt._frame.width-nt*2,rt.orig.height=rt._frame.height-nt*2,this._onTextureUpdate(),ot.setRealSize(et.width,et.height,this._resolution),rt.updateUvs(),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(et,rt){return this.updateText(!0),this._textureID===-1&&(et=!1),super.getBounds(et,rt)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds.call(this,et)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(et,rt,st){const nt=et.fill;if(Array.isArray(nt)){if(nt.length===1)return nt[0]}else return nt;let ot;const at=et.dropShadow?et.dropShadowDistance:0,lt=et.padding||0,ut=this.canvas.width/this._resolution-at-lt*2,ct=this.canvas.height/this._resolution-at-lt*2,dt=nt.slice(),ht=et.fillGradientStops.slice();if(!ht.length){const ft=dt.length+1;for(let xt=1;xt<ft;++xt)ht.push(xt/ft)}if(dt.unshift(nt[0]),ht.unshift(0),dt.push(nt[nt.length-1]),ht.push(1),et.fillGradientType===TEXT_GRADIENT.LINEAR_VERTICAL){ot=this.context.createLinearGradient(ut/2,lt,ut/2,ct+lt);const ft=st.fontProperties.fontSize+et.strokeThickness;for(let xt=0;xt<rt.length;xt++){const vt=st.lineHeight*(xt-1)+ft,yt=st.lineHeight*xt;let Et=yt;xt>0&&vt>yt&&(Et=(yt+vt)/2);const bt=yt+ft,wt=st.lineHeight*(xt+1);let St=bt;xt+1<rt.length&&wt<bt&&(St=(bt+wt)/2);const Rt=(St-Et)/ct;for(let Ct=0;Ct<dt.length;Ct++){let It=0;typeof ht[Ct]=="number"?It=ht[Ct]:It=Ct/dt.length;let jt=Math.min(1,Math.max(0,Et/ct+It*Rt));jt=Number(jt.toFixed(5)),ot.addColorStop(jt,dt[Ct])}}}else{ot=this.context.createLinearGradient(lt,ct/2,ut+lt,ct/2);const ft=dt.length+1;let xt=1;for(let vt=0;vt<dt.length;vt++){let yt;typeof ht[vt]=="number"?yt=ht[vt]:yt=xt/ft,ot.addColorStop(yt,dt[vt]),xt++}}return ot}destroy(et){typeof et=="boolean"&&(et={children:et}),et=Object.assign({},defaultDestroyOptions,et),super.destroy(et),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._texture.orig.width,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._texture.orig.height,this._height=et}get style(){return this._style}set style(et){et=et||{},et instanceof TextStyle?this._style=et:this._style=new TextStyle(et),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(et){et=String(et??""),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}};_Text.defaultAutoResolution=!0;let Text$2=_Text;class BitmapFontData{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class TextFormat{static test(et){return typeof et=="string"&&et.startsWith("info face=")}static parse(et){const rt=et.match(/^[a-z]+\s+.+$/gm),st={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const ot in rt){const at=rt[ot].match(/^[a-z]+/gm)[0],lt=rt[ot].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),ut={};for(const ct in lt){const dt=lt[ct].split("="),ht=dt[0],ft=dt[1].replace(/"/gm,""),xt=parseFloat(ft),vt=isNaN(xt)?ft:xt;ut[ht]=vt}st[at].push(ut)}const nt=new BitmapFontData;return st.info.forEach(ot=>nt.info.push({face:ot.face,size:parseInt(ot.size,10)})),st.common.forEach(ot=>nt.common.push({lineHeight:parseInt(ot.lineHeight,10)})),st.page.forEach(ot=>nt.page.push({id:parseInt(ot.id,10),file:ot.file})),st.char.forEach(ot=>nt.char.push({id:parseInt(ot.id,10),page:parseInt(ot.page,10),x:parseInt(ot.x,10),y:parseInt(ot.y,10),width:parseInt(ot.width,10),height:parseInt(ot.height,10),xoffset:parseInt(ot.xoffset,10),yoffset:parseInt(ot.yoffset,10),xadvance:parseInt(ot.xadvance,10)})),st.kerning.forEach(ot=>nt.kerning.push({first:parseInt(ot.first,10),second:parseInt(ot.second,10),amount:parseInt(ot.amount,10)})),st.distanceField.forEach(ot=>nt.distanceField.push({distanceRange:parseInt(ot.distanceRange,10),fieldType:ot.fieldType})),nt}}class XMLFormat{static test(et){const rt=et;return typeof et!="string"&&"getElementsByTagName"in et&&rt.getElementsByTagName("page").length&&rt.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(et){const rt=new BitmapFontData,st=et.getElementsByTagName("info"),nt=et.getElementsByTagName("common"),ot=et.getElementsByTagName("page"),at=et.getElementsByTagName("char"),lt=et.getElementsByTagName("kerning"),ut=et.getElementsByTagName("distanceField");for(let ct=0;ct<st.length;ct++)rt.info.push({face:st[ct].getAttribute("face"),size:parseInt(st[ct].getAttribute("size"),10)});for(let ct=0;ct<nt.length;ct++)rt.common.push({lineHeight:parseInt(nt[ct].getAttribute("lineHeight"),10)});for(let ct=0;ct<ot.length;ct++)rt.page.push({id:parseInt(ot[ct].getAttribute("id"),10)||0,file:ot[ct].getAttribute("file")});for(let ct=0;ct<at.length;ct++){const dt=at[ct];rt.char.push({id:parseInt(dt.getAttribute("id"),10),page:parseInt(dt.getAttribute("page"),10)||0,x:parseInt(dt.getAttribute("x"),10),y:parseInt(dt.getAttribute("y"),10),width:parseInt(dt.getAttribute("width"),10),height:parseInt(dt.getAttribute("height"),10),xoffset:parseInt(dt.getAttribute("xoffset"),10),yoffset:parseInt(dt.getAttribute("yoffset"),10),xadvance:parseInt(dt.getAttribute("xadvance"),10)})}for(let ct=0;ct<lt.length;ct++)rt.kerning.push({first:parseInt(lt[ct].getAttribute("first"),10),second:parseInt(lt[ct].getAttribute("second"),10),amount:parseInt(lt[ct].getAttribute("amount"),10)});for(let ct=0;ct<ut.length;ct++)rt.distanceField.push({fieldType:ut[ct].getAttribute("fieldType"),distanceRange:parseInt(ut[ct].getAttribute("distanceRange"),10)});return rt}}class XMLStringFormat{static test(et){return typeof et=="string"&&et.includes("<font>")?XMLFormat.test(settings.ADAPTER.parseXML(et)):!1}static parse(et){return XMLFormat.parse(settings.ADAPTER.parseXML(et))}}const formats=[TextFormat,XMLFormat,XMLStringFormat];function autoDetectFormat(tt){for(let et=0;et<formats.length;et++)if(formats[et].test(tt))return formats[et];return null}function generateFillStyle(tt,et,rt,st,nt,ot){const at=rt.fill;if(Array.isArray(at)){if(at.length===1)return at[0]}else return at;let lt;const ut=rt.dropShadow?rt.dropShadowDistance:0,ct=rt.padding||0,dt=tt.width/st-ut-ct*2,ht=tt.height/st-ut-ct*2,ft=at.slice(),xt=rt.fillGradientStops.slice();if(!xt.length){const vt=ft.length+1;for(let yt=1;yt<vt;++yt)xt.push(yt/vt)}if(ft.unshift(at[0]),xt.unshift(0),ft.push(at[at.length-1]),xt.push(1),rt.fillGradientType===TEXT_GRADIENT.LINEAR_VERTICAL){lt=et.createLinearGradient(dt/2,ct,dt/2,ht+ct);let vt=0;const yt=(ot.fontProperties.fontSize+rt.strokeThickness)/ht;for(let Et=0;Et<nt.length;Et++){const bt=ot.lineHeight*Et;for(let wt=0;wt<ft.length;wt++){let St=0;typeof xt[wt]=="number"?St=xt[wt]:St=wt/ft.length;const Rt=bt/ht+St*yt;let Ct=Math.max(vt,Rt);Ct=Math.min(Ct,1),lt.addColorStop(Ct,ft[wt]),vt=Ct}}}else{lt=et.createLinearGradient(ct,ht/2,dt+ct,ht/2);const vt=ft.length+1;let yt=1;for(let Et=0;Et<ft.length;Et++){let bt;typeof xt[Et]=="number"?bt=xt[Et]:bt=yt/vt,lt.addColorStop(bt,ft[Et]),yt++}}return lt}function drawGlyph(tt,et,rt,st,nt,ot,at){const lt=rt.text,ut=rt.fontProperties;et.translate(st,nt),et.scale(ot,ot);const ct=at.strokeThickness/2,dt=-(at.strokeThickness/2);if(et.font=at.toFontString(),et.lineWidth=at.strokeThickness,et.textBaseline=at.textBaseline,et.lineJoin=at.lineJoin,et.miterLimit=at.miterLimit,et.fillStyle=generateFillStyle(tt,et,at,ot,[lt],rt),et.strokeStyle=at.stroke,at.dropShadow){const ht=at.dropShadowColor,ft=at.dropShadowBlur*ot,xt=at.dropShadowDistance*ot;et.shadowColor=Color.shared.setValue(ht).setAlpha(at.dropShadowAlpha).toRgbaString(),et.shadowBlur=ft,et.shadowOffsetX=Math.cos(at.dropShadowAngle)*xt,et.shadowOffsetY=Math.sin(at.dropShadowAngle)*xt}else et.shadowColor="black",et.shadowBlur=0,et.shadowOffsetX=0,et.shadowOffsetY=0;at.stroke&&at.strokeThickness&&et.strokeText(lt,ct,dt+rt.lineHeight-ut.descent),at.fill&&et.fillText(lt,ct,dt+rt.lineHeight-ut.descent),et.setTransform(1,0,0,1,0,0),et.fillStyle="rgba(0, 0, 0, 0)"}function extractCharCode(tt){return tt.codePointAt?tt.codePointAt(0):tt.charCodeAt(0)}function splitTextToCharacters(tt){return Array.from?Array.from(tt):tt.split("")}function resolveCharacters(tt){typeof tt=="string"&&(tt=[tt]);const et=[];for(let rt=0,st=tt.length;rt<st;rt++){const nt=tt[rt];if(Array.isArray(nt)){if(nt.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${nt.length}.`);const ot=nt[0].charCodeAt(0),at=nt[1].charCodeAt(0);if(at<ot)throw new Error("[BitmapFont]: Invalid character range.");for(let lt=ot,ut=at;lt<=ut;lt++)et.push(String.fromCharCode(lt))}else et.push(...splitTextToCharacters(nt))}if(et.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return et}const _BitmapFont=class go{constructor(et,rt,st){var dt;const[nt]=et.info,[ot]=et.common,[at]=et.page,[lt]=et.distanceField,ut=getResolutionOfUrl(at.file),ct={};this._ownsTextures=st,this.font=nt.face,this.size=nt.size,this.lineHeight=ot.lineHeight/ut,this.chars={},this.pageTextures=ct;for(let ht=0;ht<et.page.length;ht++){const{id:ft,file:xt}=et.page[ht];ct[ft]=rt instanceof Array?rt[ht]:rt[xt],lt!=null&<.fieldType&<.fieldType!=="none"&&(ct[ft].baseTexture.alphaMode=ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,ct[ft].baseTexture.mipmap=MIPMAP_MODES.OFF)}for(let ht=0;ht<et.char.length;ht++){const{id:ft,page:xt}=et.char[ht];let{x:vt,y:yt,width:Et,height:bt,xoffset:wt,yoffset:St,xadvance:Rt}=et.char[ht];vt/=ut,yt/=ut,Et/=ut,bt/=ut,wt/=ut,St/=ut,Rt/=ut;const Ct=new Rectangle(vt+ct[xt].frame.x/ut,yt+ct[xt].frame.y/ut,Et,bt);this.chars[ft]={xOffset:wt,yOffset:St,xAdvance:Rt,kerning:{},texture:new Texture(ct[xt].baseTexture,Ct),page:xt}}for(let ht=0;ht<et.kerning.length;ht++){let{first:ft,second:xt,amount:vt}=et.kerning[ht];ft/=ut,xt/=ut,vt/=ut,this.chars[xt]&&(this.chars[xt].kerning[ft]=vt)}this.distanceFieldRange=lt==null?void 0:lt.distanceRange,this.distanceFieldType=((dt=lt==null?void 0:lt.fieldType)==null?void 0:dt.toLowerCase())??"none"}destroy(){for(const et in this.chars)this.chars[et].texture.destroy(),this.chars[et].texture=null;for(const et in this.pageTextures)this._ownsTextures&&this.pageTextures[et].destroy(!0),this.pageTextures[et]=null;this.chars=null,this.pageTextures=null}static install(et,rt,st){let nt;if(et instanceof BitmapFontData)nt=et;else{const at=autoDetectFormat(et);if(!at)throw new Error("Unrecognized data format for font.");nt=at.parse(et)}rt instanceof Texture&&(rt=[rt]);const ot=new go(nt,rt,st);return go.available[ot.font]=ot,ot}static uninstall(et){const rt=go.available[et];if(!rt)throw new Error(`No font found named '${et}'`);rt.destroy(),delete go.available[et]}static from(et,rt,st){if(!et)throw new Error("[BitmapFont] Property `name` is required.");const{chars:nt,padding:ot,resolution:at,textureWidth:lt,textureHeight:ut,...ct}=Object.assign({},go.defaultOptions,st),dt=resolveCharacters(nt),ht=rt instanceof TextStyle?rt:new TextStyle(rt),ft=lt,xt=new BitmapFontData;xt.info[0]={face:ht.fontFamily,size:ht.fontSize},xt.common[0]={lineHeight:ht.fontSize};let vt=0,yt=0,Et,bt,wt,St=0;const Rt=[];for(let It=0;It<dt.length;It++){Et||(Et=settings.ADAPTER.createCanvas(),Et.width=lt,Et.height=ut,bt=Et.getContext("2d"),wt=new BaseTexture(Et,{resolution:at,...ct}),Rt.push(new Texture(wt)),xt.page.push({id:Rt.length-1,file:""}));const jt=dt[It],Pt=TextMetrics.measureText(jt,ht,!1,Et),Ot=Pt.width,Ut=Math.ceil(Pt.height),Nt=Math.ceil((ht.fontStyle==="italic"?2:1)*Ot);if(yt>=ut-Ut*at){if(yt===0)throw new Error(`[BitmapFont] textureHeight ${ut}px is too small (fontFamily: '${ht.fontFamily}', fontSize: ${ht.fontSize}px, char: '${jt}')`);--It,Et=null,bt=null,wt=null,yt=0,vt=0,St=0;continue}if(St=Math.max(Ut+Pt.fontProperties.descent,St),Nt*at+vt>=ft){if(vt===0)throw new Error(`[BitmapFont] textureWidth ${lt}px is too small (fontFamily: '${ht.fontFamily}', fontSize: ${ht.fontSize}px, char: '${jt}')`);--It,yt+=St*at,yt=Math.ceil(yt),vt=0,St=0;continue}drawGlyph(Et,bt,Pt,vt,yt,at,ht);const Ht=extractCharCode(Pt.text);xt.char.push({id:Ht,page:Rt.length-1,x:vt/at,y:yt/at,width:Nt,height:Ut,xoffset:0,yoffset:0,xadvance:Ot-(ht.dropShadow?ht.dropShadowDistance:0)-(ht.stroke?ht.strokeThickness:0)}),vt+=(Nt+2*ot)*at,vt=Math.ceil(vt)}if(!(st!=null&&st.skipKerning))for(let It=0,jt=dt.length;It<jt;It++){const Pt=dt[It];for(let Ot=0;Ot<jt;Ot++){const Ut=dt[Ot],Nt=bt.measureText(Pt).width,Ht=bt.measureText(Ut).width,Lt=bt.measureText(Pt+Ut).width-(Nt+Ht);Lt&&xt.kerning.push({first:extractCharCode(Pt),second:extractCharCode(Ut),amount:Lt})}}const Ct=new go(xt,Rt,!0);return go.available[et]!==void 0&&go.uninstall(et),go.available[et]=Ct,Ct}};_BitmapFont.ALPHA=[["a","z"],["A","Z"]," "],_BitmapFont.NUMERIC=[["0","9"]],_BitmapFont.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],_BitmapFont.ASCII=[[" ","~"]],_BitmapFont.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:_BitmapFont.ALPHANUMERIC},_BitmapFont.available={};let BitmapFont=_BitmapFont;class MeshBatchUvs{constructor(et,rt){this.uvBuffer=et,this.uvMatrix=rt,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(et){if(!et&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const rt=this.uvBuffer.data;(!this.data||this.data.length!==rt.length)&&(this.data=new Float32Array(rt.length)),this.uvMatrix.multiplyUvs(rt,this.data),this._updateID++}}const tempPoint$1=new Point,tempPolygon=new Polygon,_Mesh=class om extends Container{constructor(et,rt,st,nt=DRAW_MODES.TRIANGLES){super(),this.geometry=et,this.shader=rt,this.state=st||State.for2d(),this.drawMode=nt,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=settings.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(et){this._geometry!==et&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=et,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(et){this.shader=et}get material(){return this.shader}set blendMode(et){this.state.blendMode=et}get blendMode(){return this.state.blendMode}set roundPixels(et){this._roundPixels!==et&&(this._transformID=-1),this._roundPixels=et}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(et){this.shader.tint=et}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(et){this.shader.texture=et}_render(et){const rt=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===DRAW_MODES.TRIANGLES&&rt.length<om.BATCHABLE_SIZE*2?this._renderToBatch(et):this._renderDefault(et)}_renderDefault(et){const rt=this.shader;rt.alpha=this.worldAlpha,rt.update&&rt.update(),et.batch.flush(),rt.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),et.shader.bind(rt),et.state.set(this.state),et.geometry.bind(this.geometry,rt),et.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(et){const rt=this.geometry,st=this.shader;st.uvMatrix&&(st.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=rt.indexBuffer.data,this._tintRGB=st._tintRGB,this._texture=st.texture;const nt=this.material.pluginName;et.batch.setObjectRenderer(et.plugins[nt]),et.plugins[nt].render(this)}calculateVertices(){const et=this.geometry.buffers[0],rt=et.data,st=et._updateID;if(st===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==rt.length&&(this.vertexData=new Float32Array(rt.length));const nt=this.transform.worldTransform,ot=nt.a,at=nt.b,lt=nt.c,ut=nt.d,ct=nt.tx,dt=nt.ty,ht=this.vertexData;for(let ft=0;ft<ht.length/2;ft++){const xt=rt[ft*2],vt=rt[ft*2+1];ht[ft*2]=ot*xt+lt*vt+ct,ht[ft*2+1]=at*xt+ut*vt+dt}if(this._roundPixels){const ft=settings.RESOLUTION;for(let xt=0;xt<ht.length;++xt)ht[xt]=Math.round(ht[xt]*ft)/ft}this.vertexDirty=st}calculateUvs(){const et=this.geometry.buffers[1],rt=this.shader;rt.uvMatrix.isSimple?this.uvs=et.data:(this.batchUvs||(this.batchUvs=new MeshBatchUvs(et,rt.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(et){if(!this.getBounds().contains(et.x,et.y))return!1;this.worldTransform.applyInverse(et,tempPoint$1);const rt=this.geometry.getBuffer("aVertexPosition").data,st=tempPolygon.points,nt=this.geometry.getIndex().data,ot=nt.length,at=this.drawMode===4?3:1;for(let lt=0;lt+2<ot;lt+=at){const ut=nt[lt]*2,ct=nt[lt+1]*2,dt=nt[lt+2]*2;if(st[0]=rt[ut],st[1]=rt[ut+1],st[2]=rt[ct],st[3]=rt[ct+1],st[4]=rt[dt],st[5]=rt[dt+1],tempPolygon.contains(tempPoint$1.x,tempPoint$1.y))return!0}return!1}destroy(et){super.destroy(et),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};_Mesh.BATCHABLE_SIZE=100;let Mesh=_Mesh;class MeshGeometry extends Geometry{constructor(et,rt,st){super();const nt=new Buffer$1(et),ot=new Buffer$1(rt,!0),at=new Buffer$1(st,!0,!0);this.addAttribute("aVertexPosition",nt,2,!1,TYPES.FLOAT).addAttribute("aTextureCoord",ot,2,!1,TYPES.FLOAT).addIndex(at),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var fragment$6=`varying vec2 vTextureCoord;
|
|
751
|
+
`;const defaultVertex=$defaultVertex,defaultFilterVertex=$defaultFilterVertex;class MultisampleSystem{constructor(et){this.renderer=et}contextChange(et){let rt;if(this.renderer.context.webGLVersion===1){const st=et.getParameter(et.FRAMEBUFFER_BINDING);et.bindFramebuffer(et.FRAMEBUFFER,null),rt=et.getParameter(et.SAMPLES),et.bindFramebuffer(et.FRAMEBUFFER,st)}else{const st=et.getParameter(et.DRAW_FRAMEBUFFER_BINDING);et.bindFramebuffer(et.DRAW_FRAMEBUFFER,null),rt=et.getParameter(et.SAMPLES),et.bindFramebuffer(et.DRAW_FRAMEBUFFER,st)}rt>=MSAA_QUALITY.HIGH?this.multisample=MSAA_QUALITY.HIGH:rt>=MSAA_QUALITY.MEDIUM?this.multisample=MSAA_QUALITY.MEDIUM:rt>=MSAA_QUALITY.LOW?this.multisample=MSAA_QUALITY.LOW:this.multisample=MSAA_QUALITY.NONE}destroy(){}}MultisampleSystem.extension={type:ExtensionType.RendererSystem,name:"_multisample"};extensions$1.add(MultisampleSystem);class GLBuffer{constructor(et){this.buffer=et||null,this.updateID=-1,this.byteLength=-1,this.refCount=0}}class BufferSystem{constructor(et){this.renderer=et,this.managedBuffers={},this.boundBufferBases={}}destroy(){this.renderer=null}contextChange(){this.disposeAll(!0),this.gl=this.renderer.gl,this.CONTEXT_UID=this.renderer.CONTEXT_UID}bind(et){const{gl:rt,CONTEXT_UID:st}=this,nt=et._glBuffers[st]||this.createGLBuffer(et);rt.bindBuffer(et.type,nt.buffer)}unbind(et){const{gl:rt}=this;rt.bindBuffer(et,null)}bindBufferBase(et,rt){const{gl:st,CONTEXT_UID:nt}=this;if(this.boundBufferBases[rt]!==et){const ot=et._glBuffers[nt]||this.createGLBuffer(et);this.boundBufferBases[rt]=et,st.bindBufferBase(st.UNIFORM_BUFFER,rt,ot.buffer)}}bindBufferRange(et,rt,st){const{gl:nt,CONTEXT_UID:ot}=this;st=st||0;const at=et._glBuffers[ot]||this.createGLBuffer(et);nt.bindBufferRange(nt.UNIFORM_BUFFER,rt||0,at.buffer,st*256,256)}update(et){const{gl:rt,CONTEXT_UID:st}=this,nt=et._glBuffers[st]||this.createGLBuffer(et);if(et._updateID!==nt.updateID)if(nt.updateID=et._updateID,rt.bindBuffer(et.type,nt.buffer),nt.byteLength>=et.data.byteLength)rt.bufferSubData(et.type,0,et.data);else{const ot=et.static?rt.STATIC_DRAW:rt.DYNAMIC_DRAW;nt.byteLength=et.data.byteLength,rt.bufferData(et.type,et.data,ot)}}dispose(et,rt){if(!this.managedBuffers[et.id])return;delete this.managedBuffers[et.id];const st=et._glBuffers[this.CONTEXT_UID],nt=this.gl;et.disposeRunner.remove(this),st&&(rt||nt.deleteBuffer(st.buffer),delete et._glBuffers[this.CONTEXT_UID])}disposeAll(et){const rt=Object.keys(this.managedBuffers);for(let st=0;st<rt.length;st++)this.dispose(this.managedBuffers[rt[st]],et)}createGLBuffer(et){const{CONTEXT_UID:rt,gl:st}=this;return et._glBuffers[rt]=new GLBuffer(st.createBuffer()),this.managedBuffers[et.id]=et,et.disposeRunner.add(this),et._glBuffers[rt]}}BufferSystem.extension={type:ExtensionType.RendererSystem,name:"buffer"};extensions$1.add(BufferSystem);class ObjectRendererSystem{constructor(et){this.renderer=et}render(et,rt){const st=this.renderer;let nt,ot,at,lt;if(rt&&(nt=rt.renderTexture,ot=rt.clear,at=rt.transform,lt=rt.skipUpdateTransform),this.renderingToScreen=!nt,st.runners.prerender.emit(),st.emit("prerender"),st.projection.transform=at,!st.context.isLost){if(nt||(this.lastObjectRendered=et),!lt){const ut=et.enableTempParent();et.updateTransform(),et.disableTempParent(ut)}st.renderTexture.bind(nt),st.batch.currentRenderer.start(),(ot??st.background.clearBeforeRender)&&st.renderTexture.clear(),et.render(st),st.batch.currentRenderer.flush(),nt&&(rt.blit&&st.framebuffer.blit(),nt.baseTexture.update()),st.runners.postrender.emit(),st.projection.transform=null,st.emit("postrender")}}destroy(){this.renderer=null,this.lastObjectRendered=null}}ObjectRendererSystem.extension={type:ExtensionType.RendererSystem,name:"objectRenderer"};extensions$1.add(ObjectRendererSystem);const _Renderer=class r2 extends SystemManager{constructor(et){super(),this.type=RENDERER_TYPE.WEBGL,et=Object.assign({},settings.RENDER_OPTIONS,et),this.gl=null,this.CONTEXT_UID=0,this.globalUniforms=new UniformGroup({projectionMatrix:new Matrix},!0);const rt={runners:["init","destroy","contextChange","resolutionChange","reset","update","postrender","prerender","resize"],systems:r2.__systems,priority:["_view","textureGenerator","background","_plugin","startup","context","state","texture","buffer","geometry","framebuffer","transformFeedback","mask","scissor","stencil","projection","textureGC","filter","renderTexture","batch","objectRenderer","_multisample"]};this.setup(rt),"useContextAlpha"in et&&(deprecation("7.0.0","options.useContextAlpha is deprecated, use options.premultipliedAlpha and options.backgroundAlpha instead"),et.premultipliedAlpha=et.useContextAlpha&&et.useContextAlpha!=="notMultiplied",et.backgroundAlpha=et.useContextAlpha===!1?1:et.backgroundAlpha),this._plugin.rendererPlugins=r2.__plugins,this.options=et,this.startup.run(this.options)}static test(et){return et!=null&&et.forceCanvas?!1:isWebGLSupported()}render(et,rt){this.objectRenderer.render(et,rt)}resize(et,rt){this._view.resizeView(et,rt)}reset(){return this.runners.reset.emit(),this}clear(){this.renderTexture.bind(),this.renderTexture.clear()}destroy(et=!1){this.runners.destroy.items.reverse(),this.emitWithCustomOptions(this.runners.destroy,{_view:et}),super.destroy()}get plugins(){return this._plugin.plugins}get multisample(){return this._multisample.multisample}get width(){return this._view.element.width}get height(){return this._view.element.height}get resolution(){return this._view.resolution}set resolution(et){this._view.resolution=et,this.runners.resolutionChange.emit(et)}get autoDensity(){return this._view.autoDensity}get view(){return this._view.element}get screen(){return this._view.screen}get lastObjectRendered(){return this.objectRenderer.lastObjectRendered}get renderingToScreen(){return this.objectRenderer.renderingToScreen}get rendererLogId(){return`WebGL ${this.context.webGLVersion}`}get clearBeforeRender(){return deprecation("7.0.0","renderer.clearBeforeRender has been deprecated, please use renderer.background.clearBeforeRender instead."),this.background.clearBeforeRender}get useContextAlpha(){return deprecation("7.0.0","renderer.useContextAlpha has been deprecated, please use renderer.context.premultipliedAlpha instead."),this.context.useContextAlpha}get preserveDrawingBuffer(){return deprecation("7.0.0","renderer.preserveDrawingBuffer has been deprecated, we cannot truly know this unless pixi created the context"),this.context.preserveDrawingBuffer}get backgroundColor(){return deprecation("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color}set backgroundColor(et){deprecation("7.0.0","renderer.backgroundColor has been deprecated, use renderer.background.color instead."),this.background.color=et}get backgroundAlpha(){return deprecation("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha}set backgroundAlpha(et){deprecation("7.0.0","renderer.backgroundAlpha has been deprecated, use renderer.background.alpha instead."),this.background.alpha=et}get powerPreference(){return deprecation("7.0.0","renderer.powerPreference has been deprecated, we can only know this if pixi creates the context"),this.context.powerPreference}generateTexture(et,rt){return this.textureGenerator.generateTexture(et,rt)}};_Renderer.extension={type:ExtensionType.Renderer,priority:1},_Renderer.__plugins={},_Renderer.__systems={};let Renderer=_Renderer;extensions$1.handleByMap(ExtensionType.RendererPlugin,Renderer.__plugins);extensions$1.handleByMap(ExtensionType.RendererSystem,Renderer.__systems);extensions$1.add(Renderer);class AbstractMultiResource extends Resource{constructor(et,rt){const{width:st,height:nt}=rt||{};super(st,nt),this.items=[],this.itemDirtyIds=[];for(let ot=0;ot<et;ot++){const at=new BaseTexture;this.items.push(at),this.itemDirtyIds.push(-2)}this.length=et,this._load=null,this.baseTexture=null}initFromArray(et,rt){for(let st=0;st<this.length;st++)et[st]&&(et[st].castToBaseTexture?this.addBaseTextureAt(et[st].castToBaseTexture(),st):et[st]instanceof Resource?this.addResourceAt(et[st],st):this.addResourceAt(autoDetectResource(et[st],rt),st))}dispose(){for(let et=0,rt=this.length;et<rt;et++)this.items[et].destroy();this.items=null,this.itemDirtyIds=null,this._load=null}addResourceAt(et,rt){if(!this.items[rt])throw new Error(`Index ${rt} is out of bounds`);return et.valid&&!this.valid&&this.resize(et.width,et.height),this.items[rt].setResource(et),this}bind(et){if(this.baseTexture!==null)throw new Error("Only one base texture per TextureArray is allowed");super.bind(et);for(let rt=0;rt<this.length;rt++)this.items[rt].parentTextureArray=et,this.items[rt].on("update",et.update,et)}unbind(et){super.unbind(et);for(let rt=0;rt<this.length;rt++)this.items[rt].parentTextureArray=null,this.items[rt].off("update",et.update,et)}load(){if(this._load)return this._load;const et=this.items.map(rt=>rt.resource).filter(rt=>rt).map(rt=>rt.load());return this._load=Promise.all(et).then(()=>{const{realWidth:rt,realHeight:st}=this.items[0];return this.resize(rt,st),this.update(),Promise.resolve(this)}),this._load}}class ArrayResource extends AbstractMultiResource{constructor(et,rt){const{width:st,height:nt}=rt||{};let ot,at;Array.isArray(et)?(ot=et,at=et.length):at=et,super(at,{width:st,height:nt}),ot&&this.initFromArray(ot,rt)}addBaseTextureAt(et,rt){if(et.resource)this.addResourceAt(et.resource,rt);else throw new Error("ArrayResource does not support RenderTexture");return this}bind(et){super.bind(et),et.target=TARGETS.TEXTURE_2D_ARRAY}upload(et,rt,st){const{length:nt,itemDirtyIds:ot,items:at}=this,{gl:lt}=et;st.dirtyId<0&<.texImage3D(lt.TEXTURE_2D_ARRAY,0,st.internalFormat,this._width,this._height,nt,0,rt.format,st.type,null);for(let ut=0;ut<nt;ut++){const ct=at[ut];ot[ut]<ct.dirtyId&&(ot[ut]=ct.dirtyId,ct.valid&<.texSubImage3D(lt.TEXTURE_2D_ARRAY,0,0,0,ut,ct.resource.width,ct.resource.height,1,rt.format,st.type,ct.resource.source))}return!0}}class CanvasResource extends BaseImageResource{constructor(et){super(et)}static test(et){const{OffscreenCanvas:rt}=globalThis;return rt&&et instanceof rt?!0:globalThis.HTMLCanvasElement&&et instanceof HTMLCanvasElement}}const _CubeResource=class $u extends AbstractMultiResource{constructor(et,rt){const{width:st,height:nt,autoLoad:ot,linkBaseTexture:at}=rt||{};if(et&&et.length!==$u.SIDES)throw new Error(`Invalid length. Got ${et.length}, expected 6`);super(6,{width:st,height:nt});for(let lt=0;lt<$u.SIDES;lt++)this.items[lt].target=TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+lt;this.linkBaseTexture=at!==!1,et&&this.initFromArray(et,rt),ot!==!1&&this.load()}bind(et){super.bind(et),et.target=TARGETS.TEXTURE_CUBE_MAP}addBaseTextureAt(et,rt,st){if(st===void 0&&(st=this.linkBaseTexture),!this.items[rt])throw new Error(`Index ${rt} is out of bounds`);if(!this.linkBaseTexture||et.parentTextureArray||Object.keys(et._glTextures).length>0)if(et.resource)this.addResourceAt(et.resource,rt);else throw new Error("CubeResource does not support copying of renderTexture.");else et.target=TARGETS.TEXTURE_CUBE_MAP_POSITIVE_X+rt,et.parentTextureArray=this.baseTexture,this.items[rt]=et;return et.valid&&!this.valid&&this.resize(et.realWidth,et.realHeight),this.items[rt]=et,this}upload(et,rt,st){const nt=this.itemDirtyIds;for(let ot=0;ot<$u.SIDES;ot++){const at=this.items[ot];(nt[ot]<at.dirtyId||st.dirtyId<rt.dirtyId)&&(at.valid&&at.resource?(at.resource.upload(et,at,st),nt[ot]=at.dirtyId):nt[ot]<-1&&(et.gl.texImage2D(at.target,0,st.internalFormat,rt.realWidth,rt.realHeight,0,rt.format,st.type,null),nt[ot]=-1))}return!0}static test(et){return Array.isArray(et)&&et.length===$u.SIDES}};_CubeResource.SIDES=6;let CubeResource=_CubeResource;class ImageBitmapResource extends BaseImageResource{constructor(et,rt){rt=rt||{};let st,nt,ot;typeof et=="string"?(st=ImageBitmapResource.EMPTY,nt=et,ot=!0):(st=et,nt=null,ot=!1),super(st),this.url=nt,this.crossOrigin=rt.crossOrigin??!0,this.alphaMode=typeof rt.alphaMode=="number"?rt.alphaMode:null,this.ownsImageBitmap=rt.ownsImageBitmap??ot,this._load=null,rt.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(async(et,rt)=>{if(this.url===null){et(this);return}try{const st=await settings.ADAPTER.fetch(this.url,{mode:this.crossOrigin?"cors":"no-cors"});if(this.destroyed)return;const nt=await st.blob();if(this.destroyed)return;const ot=await createImageBitmap(nt,{premultiplyAlpha:this.alphaMode===null||this.alphaMode===ALPHA_MODES.UNPACK?"premultiply":"none"});if(this.destroyed){ot.close();return}this.source=ot,this.update(),et(this)}catch(st){if(this.destroyed)return;rt(st),this.onError.emit(st)}}),this._load)}upload(et,rt,st){return this.source instanceof ImageBitmap?(typeof this.alphaMode=="number"&&(rt.alphaMode=this.alphaMode),super.upload(et,rt,st)):(this.load(),!1)}dispose(){this.ownsImageBitmap&&this.source instanceof ImageBitmap&&this.source.close(),super.dispose(),this._load=null}static test(et){return!!globalThis.createImageBitmap&&typeof ImageBitmap<"u"&&(typeof et=="string"||et instanceof ImageBitmap)}static get EMPTY(){return ImageBitmapResource._EMPTY=ImageBitmapResource._EMPTY??settings.ADAPTER.createCanvas(0,0),ImageBitmapResource._EMPTY}}const _SVGResource=class $1 extends BaseImageResource{constructor(et,rt){rt=rt||{},super(settings.ADAPTER.createCanvas()),this._width=0,this._height=0,this.svg=et,this.scale=rt.scale||1,this._overrideWidth=rt.width,this._overrideHeight=rt.height,this._resolve=null,this._crossorigin=rt.crossorigin,this._load=null,rt.autoLoad!==!1&&this.load()}load(){return this._load?this._load:(this._load=new Promise(et=>{if(this._resolve=()=>{this.update(),et(this)},$1.SVG_XML.test(this.svg.trim())){if(!btoa)throw new Error("Your browser doesn't support base64 conversions.");this.svg=`data:image/svg+xml;base64,${btoa(unescape(encodeURIComponent(this.svg)))}`}this._loadSvg()}),this._load)}_loadSvg(){const et=new Image;BaseImageResource.crossOrigin(et,this.svg,this._crossorigin),et.src=this.svg,et.onerror=rt=>{this._resolve&&(et.onerror=null,this.onError.emit(rt))},et.onload=()=>{if(!this._resolve)return;const rt=et.width,st=et.height;if(!rt||!st)throw new Error("The SVG image must have width and height defined (in pixels), canvas API needs them.");let nt=rt*this.scale,ot=st*this.scale;(this._overrideWidth||this._overrideHeight)&&(nt=this._overrideWidth||this._overrideHeight/st*rt,ot=this._overrideHeight||this._overrideWidth/rt*st),nt=Math.round(nt),ot=Math.round(ot);const at=this.source;at.width=nt,at.height=ot,at._pixiId=`canvas_${uid()}`,at.getContext("2d").drawImage(et,0,0,rt,st,0,0,nt,ot),this._resolve(),this._resolve=null}}static getSize(et){const rt=$1.SVG_SIZE.exec(et),st={};return rt&&(st[rt[1]]=Math.round(parseFloat(rt[3])),st[rt[5]]=Math.round(parseFloat(rt[7]))),st}dispose(){super.dispose(),this._resolve=null,this._crossorigin=null}static test(et,rt){return rt==="svg"||typeof et=="string"&&et.startsWith("data:image/svg+xml")||typeof et=="string"&&$1.SVG_XML.test(et)}};_SVGResource.SVG_XML=/^(<\?xml[^?]+\?>)?\s*(<!--[^(-->)]*-->)?\s*\<svg/m,_SVGResource.SVG_SIZE=/<svg[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*(?:\s(width|height)=('|")(\d*(?:\.\d+)?)(?:px)?('|"))[^>]*>/i;let SVGResource=_SVGResource;class VideoFrameResource extends BaseImageResource{constructor(et){super(et)}static test(et){return!!globalThis.VideoFrame&&et instanceof globalThis.VideoFrame}}const _VideoResource=class s2 extends BaseImageResource{constructor(et,rt){if(rt=rt||{},!(et instanceof HTMLVideoElement)){const st=document.createElement("video");rt.autoLoad!==!1&&st.setAttribute("preload","auto"),rt.playsinline!==!1&&(st.setAttribute("webkit-playsinline",""),st.setAttribute("playsinline","")),rt.muted===!0&&(st.setAttribute("muted",""),st.muted=!0),rt.loop===!0&&st.setAttribute("loop",""),rt.autoPlay!==!1&&st.setAttribute("autoplay",""),typeof et=="string"&&(et=[et]);const nt=et[0].src||et[0];BaseImageResource.crossOrigin(st,nt,rt.crossorigin);for(let ot=0;ot<et.length;++ot){const at=document.createElement("source");let{src:lt,mime:ut}=et[ot];if(lt=lt||et[ot],lt.startsWith("data:"))ut=lt.slice(5,lt.indexOf(";"));else if(!lt.startsWith("blob:")){const ct=lt.split("?").shift().toLowerCase(),dt=ct.slice(ct.lastIndexOf(".")+1);ut=ut||s2.MIME_TYPES[dt]||`video/${dt}`}at.src=lt,ut&&(at.type=ut),st.appendChild(at)}et=st}super(et),this.noSubImage=!0,this._autoUpdate=!0,this._isConnectedToTicker=!1,this._updateFPS=rt.updateFPS||0,this._msToNextUpdate=0,this.autoPlay=rt.autoPlay!==!1,this._videoFrameRequestCallback=this._videoFrameRequestCallback.bind(this),this._videoFrameRequestCallbackHandle=null,this._load=null,this._resolve=null,this._reject=null,this._onCanPlay=this._onCanPlay.bind(this),this._onError=this._onError.bind(this),this._onPlayStart=this._onPlayStart.bind(this),this._onPlayStop=this._onPlayStop.bind(this),this._onSeeked=this._onSeeked.bind(this),rt.autoLoad!==!1&&this.load()}update(et=0){if(!this.destroyed){if(this._updateFPS){const rt=Ticker.shared.elapsedMS*this.source.playbackRate;this._msToNextUpdate=Math.floor(this._msToNextUpdate-rt)}(!this._updateFPS||this._msToNextUpdate<=0)&&(super.update(),this._msToNextUpdate=this._updateFPS?Math.floor(1e3/this._updateFPS):0)}}_videoFrameRequestCallback(){this.update(),this.destroyed?this._videoFrameRequestCallbackHandle=null:this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback)}load(){if(this._load)return this._load;const et=this.source;return(et.readyState===et.HAVE_ENOUGH_DATA||et.readyState===et.HAVE_FUTURE_DATA)&&et.width&&et.height&&(et.complete=!0),et.addEventListener("play",this._onPlayStart),et.addEventListener("pause",this._onPlayStop),et.addEventListener("seeked",this._onSeeked),this._isSourceReady()?this._onCanPlay():(et.addEventListener("canplay",this._onCanPlay),et.addEventListener("canplaythrough",this._onCanPlay),et.addEventListener("error",this._onError,!0)),this._load=new Promise((rt,st)=>{this.valid?rt(this):(this._resolve=rt,this._reject=st,et.load())}),this._load}_onError(et){this.source.removeEventListener("error",this._onError,!0),this.onError.emit(et),this._reject&&(this._reject(et),this._reject=null,this._resolve=null)}_isSourcePlaying(){const et=this.source;return!et.paused&&!et.ended}_isSourceReady(){return this.source.readyState>2}_onPlayStart(){this.valid||this._onCanPlay(),this._configureAutoUpdate()}_onPlayStop(){this._configureAutoUpdate()}_onSeeked(){this._autoUpdate&&!this._isSourcePlaying()&&(this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0)}_onCanPlay(){const et=this.source;et.removeEventListener("canplay",this._onCanPlay),et.removeEventListener("canplaythrough",this._onCanPlay);const rt=this.valid;this._msToNextUpdate=0,this.update(),this._msToNextUpdate=0,!rt&&this._resolve&&(this._resolve(this),this._resolve=null,this._reject=null),this._isSourcePlaying()?this._onPlayStart():this.autoPlay&&et.play()}dispose(){this._configureAutoUpdate();const et=this.source;et&&(et.removeEventListener("play",this._onPlayStart),et.removeEventListener("pause",this._onPlayStop),et.removeEventListener("seeked",this._onSeeked),et.removeEventListener("canplay",this._onCanPlay),et.removeEventListener("canplaythrough",this._onCanPlay),et.removeEventListener("error",this._onError,!0),et.pause(),et.src="",et.load()),super.dispose()}get autoUpdate(){return this._autoUpdate}set autoUpdate(et){et!==this._autoUpdate&&(this._autoUpdate=et,this._configureAutoUpdate())}get updateFPS(){return this._updateFPS}set updateFPS(et){et!==this._updateFPS&&(this._updateFPS=et,this._configureAutoUpdate())}_configureAutoUpdate(){this._autoUpdate&&this._isSourcePlaying()?!this._updateFPS&&this.source.requestVideoFrameCallback?(this._isConnectedToTicker&&(Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0),this._videoFrameRequestCallbackHandle===null&&(this._videoFrameRequestCallbackHandle=this.source.requestVideoFrameCallback(this._videoFrameRequestCallback))):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker||(Ticker.shared.add(this.update,this),this._isConnectedToTicker=!0,this._msToNextUpdate=0)):(this._videoFrameRequestCallbackHandle!==null&&(this.source.cancelVideoFrameCallback(this._videoFrameRequestCallbackHandle),this._videoFrameRequestCallbackHandle=null),this._isConnectedToTicker&&(Ticker.shared.remove(this.update,this),this._isConnectedToTicker=!1,this._msToNextUpdate=0))}static test(et,rt){return globalThis.HTMLVideoElement&&et instanceof HTMLVideoElement||s2.TYPES.includes(rt)}};_VideoResource.TYPES=["mp4","m4v","webm","ogg","ogv","h264","avi","mov"],_VideoResource.MIME_TYPES={ogv:"video/ogg",mov:"video/quicktime",m4v:"video/mp4"};let VideoResource=_VideoResource;INSTALLED.push(ImageBitmapResource,ImageResource,CanvasResource,VideoResource,VideoFrameResource,SVGResource,BufferResource,CubeResource,ArrayResource);class Bounds{constructor(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0,this.rect=null,this.updateID=-1}isEmpty(){return this.minX>this.maxX||this.minY>this.maxY}clear(){this.minX=1/0,this.minY=1/0,this.maxX=-1/0,this.maxY=-1/0}getRectangle(et){return this.minX>this.maxX||this.minY>this.maxY?Rectangle.EMPTY:(et=et||new Rectangle(0,0,1,1),et.x=this.minX,et.y=this.minY,et.width=this.maxX-this.minX,et.height=this.maxY-this.minY,et)}addPoint(et){this.minX=Math.min(this.minX,et.x),this.maxX=Math.max(this.maxX,et.x),this.minY=Math.min(this.minY,et.y),this.maxY=Math.max(this.maxY,et.y)}addPointMatrix(et,rt){const{a:st,b:nt,c:ot,d:at,tx:lt,ty:ut}=et,ct=st*rt.x+ot*rt.y+lt,dt=nt*rt.x+at*rt.y+ut;this.minX=Math.min(this.minX,ct),this.maxX=Math.max(this.maxX,ct),this.minY=Math.min(this.minY,dt),this.maxY=Math.max(this.maxY,dt)}addQuad(et){let rt=this.minX,st=this.minY,nt=this.maxX,ot=this.maxY,at=et[0],lt=et[1];rt=at<rt?at:rt,st=lt<st?lt:st,nt=at>nt?at:nt,ot=lt>ot?lt:ot,at=et[2],lt=et[3],rt=at<rt?at:rt,st=lt<st?lt:st,nt=at>nt?at:nt,ot=lt>ot?lt:ot,at=et[4],lt=et[5],rt=at<rt?at:rt,st=lt<st?lt:st,nt=at>nt?at:nt,ot=lt>ot?lt:ot,at=et[6],lt=et[7],rt=at<rt?at:rt,st=lt<st?lt:st,nt=at>nt?at:nt,ot=lt>ot?lt:ot,this.minX=rt,this.minY=st,this.maxX=nt,this.maxY=ot}addFrame(et,rt,st,nt,ot){this.addFrameMatrix(et.worldTransform,rt,st,nt,ot)}addFrameMatrix(et,rt,st,nt,ot){const at=et.a,lt=et.b,ut=et.c,ct=et.d,dt=et.tx,ht=et.ty;let ft=this.minX,xt=this.minY,vt=this.maxX,yt=this.maxY,Et=at*rt+ut*st+dt,bt=lt*rt+ct*st+ht;ft=Et<ft?Et:ft,xt=bt<xt?bt:xt,vt=Et>vt?Et:vt,yt=bt>yt?bt:yt,Et=at*nt+ut*st+dt,bt=lt*nt+ct*st+ht,ft=Et<ft?Et:ft,xt=bt<xt?bt:xt,vt=Et>vt?Et:vt,yt=bt>yt?bt:yt,Et=at*rt+ut*ot+dt,bt=lt*rt+ct*ot+ht,ft=Et<ft?Et:ft,xt=bt<xt?bt:xt,vt=Et>vt?Et:vt,yt=bt>yt?bt:yt,Et=at*nt+ut*ot+dt,bt=lt*nt+ct*ot+ht,ft=Et<ft?Et:ft,xt=bt<xt?bt:xt,vt=Et>vt?Et:vt,yt=bt>yt?bt:yt,this.minX=ft,this.minY=xt,this.maxX=vt,this.maxY=yt}addVertexData(et,rt,st){let nt=this.minX,ot=this.minY,at=this.maxX,lt=this.maxY;for(let ut=rt;ut<st;ut+=2){const ct=et[ut],dt=et[ut+1];nt=ct<nt?ct:nt,ot=dt<ot?dt:ot,at=ct>at?ct:at,lt=dt>lt?dt:lt}this.minX=nt,this.minY=ot,this.maxX=at,this.maxY=lt}addVertices(et,rt,st,nt){this.addVerticesMatrix(et.worldTransform,rt,st,nt)}addVerticesMatrix(et,rt,st,nt,ot=0,at=ot){const lt=et.a,ut=et.b,ct=et.c,dt=et.d,ht=et.tx,ft=et.ty;let xt=this.minX,vt=this.minY,yt=this.maxX,Et=this.maxY;for(let bt=st;bt<nt;bt+=2){const wt=rt[bt],St=rt[bt+1],Rt=lt*wt+ct*St+ht,Ct=dt*St+ut*wt+ft;xt=Math.min(xt,Rt-ot),yt=Math.max(yt,Rt+ot),vt=Math.min(vt,Ct-at),Et=Math.max(Et,Ct+at)}this.minX=xt,this.minY=vt,this.maxX=yt,this.maxY=Et}addBounds(et){const rt=this.minX,st=this.minY,nt=this.maxX,ot=this.maxY;this.minX=et.minX<rt?et.minX:rt,this.minY=et.minY<st?et.minY:st,this.maxX=et.maxX>nt?et.maxX:nt,this.maxY=et.maxY>ot?et.maxY:ot}addBoundsMask(et,rt){const st=et.minX>rt.minX?et.minX:rt.minX,nt=et.minY>rt.minY?et.minY:rt.minY,ot=et.maxX<rt.maxX?et.maxX:rt.maxX,at=et.maxY<rt.maxY?et.maxY:rt.maxY;if(st<=ot&&nt<=at){const lt=this.minX,ut=this.minY,ct=this.maxX,dt=this.maxY;this.minX=st<lt?st:lt,this.minY=nt<ut?nt:ut,this.maxX=ot>ct?ot:ct,this.maxY=at>dt?at:dt}}addBoundsMatrix(et,rt){this.addFrameMatrix(rt,et.minX,et.minY,et.maxX,et.maxY)}addBoundsArea(et,rt){const st=et.minX>rt.x?et.minX:rt.x,nt=et.minY>rt.y?et.minY:rt.y,ot=et.maxX<rt.x+rt.width?et.maxX:rt.x+rt.width,at=et.maxY<rt.y+rt.height?et.maxY:rt.y+rt.height;if(st<=ot&&nt<=at){const lt=this.minX,ut=this.minY,ct=this.maxX,dt=this.maxY;this.minX=st<lt?st:lt,this.minY=nt<ut?nt:ut,this.maxX=ot>ct?ot:ct,this.maxY=at>dt?at:dt}}pad(et=0,rt=et){this.isEmpty()||(this.minX-=et,this.maxX+=et,this.minY-=rt,this.maxY+=rt)}addFramePad(et,rt,st,nt,ot,at){et-=ot,rt-=at,st+=ot,nt+=at,this.minX=this.minX<et?this.minX:et,this.maxX=this.maxX>st?this.maxX:st,this.minY=this.minY<rt?this.minY:rt,this.maxY=this.maxY>nt?this.maxY:nt}}class DisplayObject extends EventEmitter{constructor(){super(),this.tempDisplayObjectParent=null,this.transform=new Transform,this.alpha=1,this.visible=!0,this.renderable=!0,this.cullable=!1,this.cullArea=null,this.parent=null,this.worldAlpha=1,this._lastSortedIndex=0,this._zIndex=0,this.filterArea=null,this.filters=null,this._enabledFilters=null,this._bounds=new Bounds,this._localBounds=null,this._boundsID=0,this._boundsRect=null,this._localBoundsRect=null,this._mask=null,this._maskRefCount=0,this._destroyed=!1,this.isSprite=!1,this.isMask=!1}static mixin(et){const rt=Object.keys(et);for(let st=0;st<rt.length;++st){const nt=rt[st];Object.defineProperty(DisplayObject.prototype,nt,Object.getOwnPropertyDescriptor(et,nt))}}get destroyed(){return this._destroyed}_recursivePostUpdateTransform(){this.parent?(this.parent._recursivePostUpdateTransform(),this.transform.updateTransform(this.parent.transform)):this.transform.updateTransform(this._tempDisplayObjectParent.transform)}updateTransform(){this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha}getBounds(et,rt){return et||(this.parent?(this._recursivePostUpdateTransform(),this.updateTransform()):(this.parent=this._tempDisplayObjectParent,this.updateTransform(),this.parent=null)),this._bounds.updateID!==this._boundsID&&(this.calculateBounds(),this._bounds.updateID=this._boundsID),rt||(this._boundsRect||(this._boundsRect=new Rectangle),rt=this._boundsRect),this._bounds.getRectangle(rt)}getLocalBounds(et){et||(this._localBoundsRect||(this._localBoundsRect=new Rectangle),et=this._localBoundsRect),this._localBounds||(this._localBounds=new Bounds);const rt=this.transform,st=this.parent;this.parent=null,this._tempDisplayObjectParent.worldAlpha=(st==null?void 0:st.worldAlpha)??1,this.transform=this._tempDisplayObjectParent.transform;const nt=this._bounds,ot=this._boundsID;this._bounds=this._localBounds;const at=this.getBounds(!1,et);return this.parent=st,this.transform=rt,this._bounds=nt,this._bounds.updateID+=this._boundsID-ot,at}toGlobal(et,rt,st=!1){return st||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.apply(et,rt)}toLocal(et,rt,st,nt){return rt&&(et=rt.toGlobal(et,st,nt)),nt||(this._recursivePostUpdateTransform(),this.parent?this.displayObjectUpdateTransform():(this.parent=this._tempDisplayObjectParent,this.displayObjectUpdateTransform(),this.parent=null)),this.worldTransform.applyInverse(et,st)}setParent(et){if(!et||!et.addChild)throw new Error("setParent: Argument must be a Container");return et.addChild(this),et}removeFromParent(){var et;(et=this.parent)==null||et.removeChild(this)}setTransform(et=0,rt=0,st=1,nt=1,ot=0,at=0,lt=0,ut=0,ct=0){return this.position.x=et,this.position.y=rt,this.scale.x=st||1,this.scale.y=nt||1,this.rotation=ot,this.skew.x=at,this.skew.y=lt,this.pivot.x=ut,this.pivot.y=ct,this}destroy(et){this.removeFromParent(),this._destroyed=!0,this.transform=null,this.parent=null,this._bounds=null,this.mask=null,this.cullArea=null,this.filters=null,this.filterArea=null,this.hitArea=null,this.eventMode="auto",this.interactiveChildren=!1,this.emit("destroyed"),this.removeAllListeners()}get _tempDisplayObjectParent(){return this.tempDisplayObjectParent===null&&(this.tempDisplayObjectParent=new TemporaryDisplayObject),this.tempDisplayObjectParent}enableTempParent(){const et=this.parent;return this.parent=this._tempDisplayObjectParent,et}disableTempParent(et){this.parent=et}get x(){return this.position.x}set x(et){this.transform.position.x=et}get y(){return this.position.y}set y(et){this.transform.position.y=et}get worldTransform(){return this.transform.worldTransform}get localTransform(){return this.transform.localTransform}get position(){return this.transform.position}set position(et){this.transform.position.copyFrom(et)}get scale(){return this.transform.scale}set scale(et){this.transform.scale.copyFrom(et)}get pivot(){return this.transform.pivot}set pivot(et){this.transform.pivot.copyFrom(et)}get skew(){return this.transform.skew}set skew(et){this.transform.skew.copyFrom(et)}get rotation(){return this.transform.rotation}set rotation(et){this.transform.rotation=et}get angle(){return this.transform.rotation*RAD_TO_DEG}set angle(et){this.transform.rotation=et*DEG_TO_RAD}get zIndex(){return this._zIndex}set zIndex(et){this._zIndex!==et&&(this._zIndex=et,this.parent&&(this.parent.sortDirty=!0))}get worldVisible(){let et=this;do{if(!et.visible)return!1;et=et.parent}while(et);return!0}get mask(){return this._mask}set mask(et){if(this._mask!==et){if(this._mask){const rt=this._mask.isMaskData?this._mask.maskObject:this._mask;rt&&(rt._maskRefCount--,rt._maskRefCount===0&&(rt.renderable=!0,rt.isMask=!1))}if(this._mask=et,this._mask){const rt=this._mask.isMaskData?this._mask.maskObject:this._mask;rt&&(rt._maskRefCount===0&&(rt.renderable=!1,rt.isMask=!0),rt._maskRefCount++)}}}}class TemporaryDisplayObject extends DisplayObject{constructor(){super(...arguments),this.sortDirty=null}}DisplayObject.prototype.displayObjectUpdateTransform=DisplayObject.prototype.updateTransform;const tempMatrix=new Matrix;function sortChildren(tt,et){return tt.zIndex===et.zIndex?tt._lastSortedIndex-et._lastSortedIndex:tt.zIndex-et.zIndex}const _Container=class n2 extends DisplayObject{constructor(){super(),this.children=[],this.sortableChildren=n2.defaultSortableChildren,this.sortDirty=!1}onChildrenChange(et){}addChild(...et){if(et.length>1)for(let rt=0;rt<et.length;rt++)this.addChild(et[rt]);else{const rt=et[0];rt.parent&&rt.parent.removeChild(rt),rt.parent=this,this.sortDirty=!0,rt.transform._parentID=-1,this.children.push(rt),this._boundsID++,this.onChildrenChange(this.children.length-1),this.emit("childAdded",rt,this,this.children.length-1),rt.emit("added",this)}return et[0]}addChildAt(et,rt){if(rt<0||rt>this.children.length)throw new Error(`${et}addChildAt: The index ${rt} supplied is out of bounds ${this.children.length}`);return et.parent&&et.parent.removeChild(et),et.parent=this,this.sortDirty=!0,et.transform._parentID=-1,this.children.splice(rt,0,et),this._boundsID++,this.onChildrenChange(rt),et.emit("added",this),this.emit("childAdded",et,this,rt),et}swapChildren(et,rt){if(et===rt)return;const st=this.getChildIndex(et),nt=this.getChildIndex(rt);this.children[st]=rt,this.children[nt]=et,this.onChildrenChange(st<nt?st:nt)}getChildIndex(et){const rt=this.children.indexOf(et);if(rt===-1)throw new Error("The supplied DisplayObject must be a child of the caller");return rt}setChildIndex(et,rt){if(rt<0||rt>=this.children.length)throw new Error(`The index ${rt} supplied is out of bounds ${this.children.length}`);const st=this.getChildIndex(et);removeItems(this.children,st,1),this.children.splice(rt,0,et),this.onChildrenChange(rt)}getChildAt(et){if(et<0||et>=this.children.length)throw new Error(`getChildAt: Index (${et}) does not exist.`);return this.children[et]}removeChild(...et){if(et.length>1)for(let rt=0;rt<et.length;rt++)this.removeChild(et[rt]);else{const rt=et[0],st=this.children.indexOf(rt);if(st===-1)return null;rt.parent=null,rt.transform._parentID=-1,removeItems(this.children,st,1),this._boundsID++,this.onChildrenChange(st),rt.emit("removed",this),this.emit("childRemoved",rt,this,st)}return et[0]}removeChildAt(et){const rt=this.getChildAt(et);return rt.parent=null,rt.transform._parentID=-1,removeItems(this.children,et,1),this._boundsID++,this.onChildrenChange(et),rt.emit("removed",this),this.emit("childRemoved",rt,this,et),rt}removeChildren(et=0,rt=this.children.length){const st=et,nt=rt,ot=nt-st;let at;if(ot>0&&ot<=nt){at=this.children.splice(st,ot);for(let lt=0;lt<at.length;++lt)at[lt].parent=null,at[lt].transform&&(at[lt].transform._parentID=-1);this._boundsID++,this.onChildrenChange(et);for(let lt=0;lt<at.length;++lt)at[lt].emit("removed",this),this.emit("childRemoved",at[lt],this,lt);return at}else if(ot===0&&this.children.length===0)return[];throw new RangeError("removeChildren: numeric values are outside the acceptable range.")}sortChildren(){let et=!1;for(let rt=0,st=this.children.length;rt<st;++rt){const nt=this.children[rt];nt._lastSortedIndex=rt,!et&&nt.zIndex!==0&&(et=!0)}et&&this.children.length>1&&this.children.sort(sortChildren),this.sortDirty=!1}updateTransform(){this.sortableChildren&&this.sortDirty&&this.sortChildren(),this._boundsID++,this.transform.updateTransform(this.parent.transform),this.worldAlpha=this.alpha*this.parent.worldAlpha;for(let et=0,rt=this.children.length;et<rt;++et){const st=this.children[et];st.visible&&st.updateTransform()}}calculateBounds(){this._bounds.clear(),this._calculateBounds();for(let et=0;et<this.children.length;et++){const rt=this.children[et];if(!(!rt.visible||!rt.renderable))if(rt.calculateBounds(),rt._mask){const st=rt._mask.isMaskData?rt._mask.maskObject:rt._mask;st?(st.calculateBounds(),this._bounds.addBoundsMask(rt._bounds,st._bounds)):this._bounds.addBounds(rt._bounds)}else rt.filterArea?this._bounds.addBoundsArea(rt._bounds,rt.filterArea):this._bounds.addBounds(rt._bounds)}this._bounds.updateID=this._boundsID}getLocalBounds(et,rt=!1){const st=super.getLocalBounds(et);if(!rt)for(let nt=0,ot=this.children.length;nt<ot;++nt){const at=this.children[nt];at.visible&&at.updateTransform()}return st}_calculateBounds(){}_renderWithCulling(et){const rt=et.renderTexture.sourceFrame;if(!(rt.width>0&&rt.height>0))return;let st,nt;this.cullArea?(st=this.cullArea,nt=this.worldTransform):this._render!==n2.prototype._render&&(st=this.getBounds(!0));const ot=et.projection.transform;if(ot&&(nt?(nt=tempMatrix.copyFrom(nt),nt.prepend(ot)):nt=ot),st&&rt.intersects(st,nt))this._render(et);else if(this.cullArea)return;for(let at=0,lt=this.children.length;at<lt;++at){const ut=this.children[at],ct=ut.cullable;ut.cullable=ct||!this.cullArea,ut.render(et),ut.cullable=ct}}render(et){var rt;if(!(!this.visible||this.worldAlpha<=0||!this.renderable))if(this._mask||(rt=this.filters)!=null&&rt.length)this.renderAdvanced(et);else if(this.cullable)this._renderWithCulling(et);else{this._render(et);for(let st=0,nt=this.children.length;st<nt;++st)this.children[st].render(et)}}renderAdvanced(et){var ot,at,lt;const rt=this.filters,st=this._mask;if(rt){this._enabledFilters||(this._enabledFilters=[]),this._enabledFilters.length=0;for(let ut=0;ut<rt.length;ut++)rt[ut].enabled&&this._enabledFilters.push(rt[ut])}const nt=rt&&((ot=this._enabledFilters)==null?void 0:ot.length)||st&&(!st.isMaskData||st.enabled&&(st.autoDetect||st.type!==MASK_TYPES.NONE));if(nt&&et.batch.flush(),rt&&((at=this._enabledFilters)!=null&&at.length)&&et.filter.push(this,this._enabledFilters),st&&et.mask.push(this,this._mask),this.cullable)this._renderWithCulling(et);else{this._render(et);for(let ut=0,ct=this.children.length;ut<ct;++ut)this.children[ut].render(et)}nt&&et.batch.flush(),st&&et.mask.pop(this),rt&&((lt=this._enabledFilters)!=null&<.length)&&et.filter.pop()}_render(et){}destroy(et){super.destroy(),this.sortDirty=!1;const rt=typeof et=="boolean"?et:et==null?void 0:et.children,st=this.removeChildren(0,this.children.length);if(rt)for(let nt=0;nt<st.length;++nt)st[nt].destroy(et)}get width(){return this.scale.x*this.getLocalBounds().width}set width(et){const rt=this.getLocalBounds().width;rt!==0?this.scale.x=et/rt:this.scale.x=1,this._width=et}get height(){return this.scale.y*this.getLocalBounds().height}set height(et){const rt=this.getLocalBounds().height;rt!==0?this.scale.y=et/rt:this.scale.y=1,this._height=et}};_Container.defaultSortableChildren=!1;let Container=_Container;Container.prototype.containerUpdateTransform=Container.prototype.updateTransform;Object.defineProperties(settings,{SORTABLE_CHILDREN:{get(){return Container.defaultSortableChildren},set(tt){deprecation("7.1.0","settings.SORTABLE_CHILDREN is deprecated, use Container.defaultSortableChildren"),Container.defaultSortableChildren=tt}}});var TEXT_GRADIENT=(tt=>(tt[tt.LINEAR_VERTICAL=0]="LINEAR_VERTICAL",tt[tt.LINEAR_HORIZONTAL=1]="LINEAR_HORIZONTAL",tt))(TEXT_GRADIENT||{});const tempPoint$2=new Point,indices=new Uint16Array([0,1,2,0,2,3]);class Sprite extends Container{constructor(et){super(),this._anchor=new ObservablePoint(this._onAnchorUpdate,this,et?et.defaultAnchor.x:0,et?et.defaultAnchor.y:0),this._texture=null,this._width=0,this._height=0,this._tintColor=new Color(16777215),this._tintRGB=null,this.tint=16777215,this.blendMode=BLEND_MODES.NORMAL,this._cachedTint=16777215,this.uvs=null,this.texture=et||Texture.EMPTY,this.vertexData=new Float32Array(8),this.vertexTrimmedData=null,this._transformID=-1,this._textureID=-1,this._transformTrimmedID=-1,this._textureTrimmedID=-1,this.indices=indices,this.pluginName="batch",this.isSprite=!0,this._roundPixels=settings.ROUND_PIXELS}_onTextureUpdate(){this._textureID=-1,this._textureTrimmedID=-1,this._cachedTint=16777215,this._width&&(this.scale.x=sign(this.scale.x)*this._width/this._texture.orig.width),this._height&&(this.scale.y=sign(this.scale.y)*this._height/this._texture.orig.height)}_onAnchorUpdate(){this._transformID=-1,this._transformTrimmedID=-1}calculateVertices(){const et=this._texture;if(this._transformID===this.transform._worldID&&this._textureID===et._updateID)return;this._textureID!==et._updateID&&(this.uvs=this._texture._uvs.uvsFloat32),this._transformID=this.transform._worldID,this._textureID=et._updateID;const rt=this.transform.worldTransform,st=rt.a,nt=rt.b,ot=rt.c,at=rt.d,lt=rt.tx,ut=rt.ty,ct=this.vertexData,dt=et.trim,ht=et.orig,ft=this._anchor;let xt=0,vt=0,yt=0,Et=0;if(dt?(vt=dt.x-ft._x*ht.width,xt=vt+dt.width,Et=dt.y-ft._y*ht.height,yt=Et+dt.height):(vt=-ft._x*ht.width,xt=vt+ht.width,Et=-ft._y*ht.height,yt=Et+ht.height),ct[0]=st*vt+ot*Et+lt,ct[1]=at*Et+nt*vt+ut,ct[2]=st*xt+ot*Et+lt,ct[3]=at*Et+nt*xt+ut,ct[4]=st*xt+ot*yt+lt,ct[5]=at*yt+nt*xt+ut,ct[6]=st*vt+ot*yt+lt,ct[7]=at*yt+nt*vt+ut,this._roundPixels){const bt=settings.RESOLUTION;for(let wt=0;wt<ct.length;++wt)ct[wt]=Math.round(ct[wt]*bt)/bt}}calculateTrimmedVertices(){if(!this.vertexTrimmedData)this.vertexTrimmedData=new Float32Array(8);else if(this._transformTrimmedID===this.transform._worldID&&this._textureTrimmedID===this._texture._updateID)return;this._transformTrimmedID=this.transform._worldID,this._textureTrimmedID=this._texture._updateID;const et=this._texture,rt=this.vertexTrimmedData,st=et.orig,nt=this._anchor,ot=this.transform.worldTransform,at=ot.a,lt=ot.b,ut=ot.c,ct=ot.d,dt=ot.tx,ht=ot.ty,ft=-nt._x*st.width,xt=ft+st.width,vt=-nt._y*st.height,yt=vt+st.height;if(rt[0]=at*ft+ut*vt+dt,rt[1]=ct*vt+lt*ft+ht,rt[2]=at*xt+ut*vt+dt,rt[3]=ct*vt+lt*xt+ht,rt[4]=at*xt+ut*yt+dt,rt[5]=ct*yt+lt*xt+ht,rt[6]=at*ft+ut*yt+dt,rt[7]=ct*yt+lt*ft+ht,this._roundPixels){const Et=settings.RESOLUTION;for(let bt=0;bt<rt.length;++bt)rt[bt]=Math.round(rt[bt]*Et)/Et}}_render(et){this.calculateVertices(),et.batch.setObjectRenderer(et.plugins[this.pluginName]),et.plugins[this.pluginName].render(this)}_calculateBounds(){const et=this._texture.trim,rt=this._texture.orig;!et||et.width===rt.width&&et.height===rt.height?(this.calculateVertices(),this._bounds.addQuad(this.vertexData)):(this.calculateTrimmedVertices(),this._bounds.addQuad(this.vertexTrimmedData))}getLocalBounds(et){return this.children.length===0?(this._localBounds||(this._localBounds=new Bounds),this._localBounds.minX=this._texture.orig.width*-this._anchor._x,this._localBounds.minY=this._texture.orig.height*-this._anchor._y,this._localBounds.maxX=this._texture.orig.width*(1-this._anchor._x),this._localBounds.maxY=this._texture.orig.height*(1-this._anchor._y),et||(this._localBoundsRect||(this._localBoundsRect=new Rectangle),et=this._localBoundsRect),this._localBounds.getRectangle(et)):super.getLocalBounds.call(this,et)}containsPoint(et){this.worldTransform.applyInverse(et,tempPoint$2);const rt=this._texture.orig.width,st=this._texture.orig.height,nt=-rt*this.anchor.x;let ot=0;return tempPoint$2.x>=nt&&tempPoint$2.x<nt+rt&&(ot=-st*this.anchor.y,tempPoint$2.y>=ot&&tempPoint$2.y<ot+st)}destroy(et){if(super.destroy(et),this._texture.off("update",this._onTextureUpdate,this),this._anchor=null,typeof et=="boolean"?et:et==null?void 0:et.texture){const rt=typeof et=="boolean"?et:et==null?void 0:et.baseTexture;this._texture.destroy(!!rt)}this._texture=null}static from(et,rt){const st=et instanceof Texture?et:Texture.from(et,rt);return new Sprite(st)}set roundPixels(et){this._roundPixels!==et&&(this._transformID=-1,this._transformTrimmedID=-1),this._roundPixels=et}get roundPixels(){return this._roundPixels}get width(){return Math.abs(this.scale.x)*this._texture.orig.width}set width(et){const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._texture.orig.width,this._width=et}get height(){return Math.abs(this.scale.y)*this._texture.orig.height}set height(et){const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._texture.orig.height,this._height=et}get anchor(){return this._anchor}set anchor(et){this._anchor.copyFrom(et)}get tint(){return this._tintColor.value}set tint(et){this._tintColor.setValue(et),this._tintRGB=this._tintColor.toLittleEndianNumber()}get tintValue(){return this._tintColor.toNumber()}get texture(){return this._texture}set texture(et){this._texture!==et&&(this._texture&&this._texture.off("update",this._onTextureUpdate,this),this._texture=et||Texture.EMPTY,this._cachedTint=16777215,this._textureID=-1,this._textureTrimmedID=-1,et&&(et.baseTexture.valid?this._onTextureUpdate():et.once("update",this._onTextureUpdate,this)))}}const contextSettings={willReadFrequently:!0},_TextMetrics=class jr{static get experimentalLetterSpacingSupported(){let et=jr._experimentalLetterSpacingSupported;if(et!==void 0){const rt=settings.ADAPTER.getCanvasRenderingContext2D().prototype;et=jr._experimentalLetterSpacingSupported="letterSpacing"in rt||"textLetterSpacing"in rt}return et}constructor(et,rt,st,nt,ot,at,lt,ut,ct){this.text=et,this.style=rt,this.width=st,this.height=nt,this.lines=ot,this.lineWidths=at,this.lineHeight=lt,this.maxLineWidth=ut,this.fontProperties=ct}static measureText(et,rt,st,nt=jr._canvas){st=st??rt.wordWrap;const ot=rt.toFontString(),at=jr.measureFont(ot);at.fontSize===0&&(at.fontSize=rt.fontSize,at.ascent=rt.fontSize);const lt=nt.getContext("2d",contextSettings);lt.font=ot;const ut=(st?jr.wordWrap(et,rt,nt):et).split(/(?:\r\n|\r|\n)/),ct=new Array(ut.length);let dt=0;for(let vt=0;vt<ut.length;vt++){const yt=jr._measureText(ut[vt],rt.letterSpacing,lt);ct[vt]=yt,dt=Math.max(dt,yt)}let ht=dt+rt.strokeThickness;rt.dropShadow&&(ht+=rt.dropShadowDistance);const ft=rt.lineHeight||at.fontSize+rt.strokeThickness;let xt=Math.max(ft,at.fontSize+rt.strokeThickness*2)+rt.leading+(ut.length-1)*(ft+rt.leading);return rt.dropShadow&&(xt+=rt.dropShadowDistance),new jr(et,rt,ht,xt,ut,ct,ft+rt.leading,dt,at)}static _measureText(et,rt,st){let nt=!1;jr.experimentalLetterSpacingSupported&&(jr.experimentalLetterSpacing?(st.letterSpacing=`${rt}px`,st.textLetterSpacing=`${rt}px`,nt=!0):(st.letterSpacing="0px",st.textLetterSpacing="0px"));let ot=st.measureText(et).width;return ot>0&&(nt?ot-=rt:ot+=(jr.graphemeSegmenter(et).length-1)*rt),ot}static wordWrap(et,rt,st=jr._canvas){const nt=st.getContext("2d",contextSettings);let ot=0,at="",lt="";const ut=Object.create(null),{letterSpacing:ct,whiteSpace:dt}=rt,ht=jr.collapseSpaces(dt),ft=jr.collapseNewlines(dt);let xt=!ht;const vt=rt.wordWrapWidth+ct,yt=jr.tokenize(et);for(let Et=0;Et<yt.length;Et++){let bt=yt[Et];if(jr.isNewline(bt)){if(!ft){lt+=jr.addLine(at),xt=!ht,at="",ot=0;continue}bt=" "}if(ht){const St=jr.isBreakingSpace(bt),Rt=jr.isBreakingSpace(at[at.length-1]);if(St&&Rt)continue}const wt=jr.getFromCache(bt,ct,ut,nt);if(wt>vt)if(at!==""&&(lt+=jr.addLine(at),at="",ot=0),jr.canBreakWords(bt,rt.breakWords)){const St=jr.wordWrapSplit(bt);for(let Rt=0;Rt<St.length;Rt++){let Ct=St[Rt],It=Ct,jt=1;for(;St[Rt+jt];){const Ot=St[Rt+jt];if(!jr.canBreakChars(It,Ot,bt,Rt,rt.breakWords))Ct+=Ot;else break;It=Ot,jt++}Rt+=jt-1;const Pt=jr.getFromCache(Ct,ct,ut,nt);Pt+ot>vt&&(lt+=jr.addLine(at),xt=!1,at="",ot=0),at+=Ct,ot+=Pt}}else{at.length>0&&(lt+=jr.addLine(at),at="",ot=0);const St=Et===yt.length-1;lt+=jr.addLine(bt,!St),xt=!1,at="",ot=0}else wt+ot>vt&&(xt=!1,lt+=jr.addLine(at),at="",ot=0),(at.length>0||!jr.isBreakingSpace(bt)||xt)&&(at+=bt,ot+=wt)}return lt+=jr.addLine(at,!1),lt}static addLine(et,rt=!0){return et=jr.trimRight(et),et=rt?`${et}
|
|
752
|
+
`:et,et}static getFromCache(et,rt,st,nt){let ot=st[et];return typeof ot!="number"&&(ot=jr._measureText(et,rt,nt)+rt,st[et]=ot),ot}static collapseSpaces(et){return et==="normal"||et==="pre-line"}static collapseNewlines(et){return et==="normal"}static trimRight(et){if(typeof et!="string")return"";for(let rt=et.length-1;rt>=0;rt--){const st=et[rt];if(!jr.isBreakingSpace(st))break;et=et.slice(0,-1)}return et}static isNewline(et){return typeof et!="string"?!1:jr._newlines.includes(et.charCodeAt(0))}static isBreakingSpace(et,rt){return typeof et!="string"?!1:jr._breakingSpaces.includes(et.charCodeAt(0))}static tokenize(et){const rt=[];let st="";if(typeof et!="string")return rt;for(let nt=0;nt<et.length;nt++){const ot=et[nt],at=et[nt+1];if(jr.isBreakingSpace(ot,at)||jr.isNewline(ot)){st!==""&&(rt.push(st),st=""),rt.push(ot);continue}st+=ot}return st!==""&&rt.push(st),rt}static canBreakWords(et,rt){return rt}static canBreakChars(et,rt,st,nt,ot){return!0}static wordWrapSplit(et){return jr.graphemeSegmenter(et)}static measureFont(et){if(jr._fonts[et])return jr._fonts[et];const rt={ascent:0,descent:0,fontSize:0},st=jr._canvas,nt=jr._context;nt.font=et;const ot=jr.METRICS_STRING+jr.BASELINE_SYMBOL,at=Math.ceil(nt.measureText(ot).width);let lt=Math.ceil(nt.measureText(jr.BASELINE_SYMBOL).width);const ut=Math.ceil(jr.HEIGHT_MULTIPLIER*lt);if(lt=lt*jr.BASELINE_MULTIPLIER|0,at===0||ut===0)return jr._fonts[et]=rt,rt;st.width=at,st.height=ut,nt.fillStyle="#f00",nt.fillRect(0,0,at,ut),nt.font=et,nt.textBaseline="alphabetic",nt.fillStyle="#000",nt.fillText(ot,0,lt);const ct=nt.getImageData(0,0,at,ut).data,dt=ct.length,ht=at*4;let ft=0,xt=0,vt=!1;for(ft=0;ft<lt;++ft){for(let yt=0;yt<ht;yt+=4)if(ct[xt+yt]!==255){vt=!0;break}if(!vt)xt+=ht;else break}for(rt.ascent=lt-ft,xt=dt-ht,vt=!1,ft=ut;ft>lt;--ft){for(let yt=0;yt<ht;yt+=4)if(ct[xt+yt]!==255){vt=!0;break}if(!vt)xt-=ht;else break}return rt.descent=ft-lt,rt.fontSize=rt.ascent+rt.descent,jr._fonts[et]=rt,rt}static clearMetrics(et=""){et?delete jr._fonts[et]:jr._fonts={}}static get _canvas(){var et;if(!jr.__canvas){let rt;try{const st=new OffscreenCanvas(0,0);if((et=st.getContext("2d",contextSettings))!=null&&et.measureText)return jr.__canvas=st,st;rt=settings.ADAPTER.createCanvas()}catch{rt=settings.ADAPTER.createCanvas()}rt.width=rt.height=10,jr.__canvas=rt}return jr.__canvas}static get _context(){return jr.__context||(jr.__context=jr._canvas.getContext("2d",contextSettings)),jr.__context}};_TextMetrics.METRICS_STRING="|ÉqÅ",_TextMetrics.BASELINE_SYMBOL="M",_TextMetrics.BASELINE_MULTIPLIER=1.4,_TextMetrics.HEIGHT_MULTIPLIER=2,_TextMetrics.graphemeSegmenter=(()=>{if(typeof(Intl==null?void 0:Intl.Segmenter)=="function"){const tt=new Intl.Segmenter;return et=>[...tt.segment(et)].map(rt=>rt.segment)}return tt=>[...tt]})(),_TextMetrics.experimentalLetterSpacing=!1,_TextMetrics._fonts={},_TextMetrics._newlines=[10,13],_TextMetrics._breakingSpaces=[9,32,8192,8193,8194,8195,8196,8197,8198,8200,8201,8202,8287,12288];let TextMetrics=_TextMetrics;const genericFontFamilies=["serif","sans-serif","monospace","cursive","fantasy","system-ui"],_TextStyle=class Ou{constructor(et){this.styleID=0,this.reset(),deepCopyProperties(this,et,et)}clone(){const et={};return deepCopyProperties(et,this,Ou.defaultStyle),new Ou(et)}reset(){deepCopyProperties(this,Ou.defaultStyle,Ou.defaultStyle)}get align(){return this._align}set align(et){this._align!==et&&(this._align=et,this.styleID++)}get breakWords(){return this._breakWords}set breakWords(et){this._breakWords!==et&&(this._breakWords=et,this.styleID++)}get dropShadow(){return this._dropShadow}set dropShadow(et){this._dropShadow!==et&&(this._dropShadow=et,this.styleID++)}get dropShadowAlpha(){return this._dropShadowAlpha}set dropShadowAlpha(et){this._dropShadowAlpha!==et&&(this._dropShadowAlpha=et,this.styleID++)}get dropShadowAngle(){return this._dropShadowAngle}set dropShadowAngle(et){this._dropShadowAngle!==et&&(this._dropShadowAngle=et,this.styleID++)}get dropShadowBlur(){return this._dropShadowBlur}set dropShadowBlur(et){this._dropShadowBlur!==et&&(this._dropShadowBlur=et,this.styleID++)}get dropShadowColor(){return this._dropShadowColor}set dropShadowColor(et){const rt=getColor(et);this._dropShadowColor!==rt&&(this._dropShadowColor=rt,this.styleID++)}get dropShadowDistance(){return this._dropShadowDistance}set dropShadowDistance(et){this._dropShadowDistance!==et&&(this._dropShadowDistance=et,this.styleID++)}get fill(){return this._fill}set fill(et){const rt=getColor(et);this._fill!==rt&&(this._fill=rt,this.styleID++)}get fillGradientType(){return this._fillGradientType}set fillGradientType(et){this._fillGradientType!==et&&(this._fillGradientType=et,this.styleID++)}get fillGradientStops(){return this._fillGradientStops}set fillGradientStops(et){areArraysEqual(this._fillGradientStops,et)||(this._fillGradientStops=et,this.styleID++)}get fontFamily(){return this._fontFamily}set fontFamily(et){this.fontFamily!==et&&(this._fontFamily=et,this.styleID++)}get fontSize(){return this._fontSize}set fontSize(et){this._fontSize!==et&&(this._fontSize=et,this.styleID++)}get fontStyle(){return this._fontStyle}set fontStyle(et){this._fontStyle!==et&&(this._fontStyle=et,this.styleID++)}get fontVariant(){return this._fontVariant}set fontVariant(et){this._fontVariant!==et&&(this._fontVariant=et,this.styleID++)}get fontWeight(){return this._fontWeight}set fontWeight(et){this._fontWeight!==et&&(this._fontWeight=et,this.styleID++)}get letterSpacing(){return this._letterSpacing}set letterSpacing(et){this._letterSpacing!==et&&(this._letterSpacing=et,this.styleID++)}get lineHeight(){return this._lineHeight}set lineHeight(et){this._lineHeight!==et&&(this._lineHeight=et,this.styleID++)}get leading(){return this._leading}set leading(et){this._leading!==et&&(this._leading=et,this.styleID++)}get lineJoin(){return this._lineJoin}set lineJoin(et){this._lineJoin!==et&&(this._lineJoin=et,this.styleID++)}get miterLimit(){return this._miterLimit}set miterLimit(et){this._miterLimit!==et&&(this._miterLimit=et,this.styleID++)}get padding(){return this._padding}set padding(et){this._padding!==et&&(this._padding=et,this.styleID++)}get stroke(){return this._stroke}set stroke(et){const rt=getColor(et);this._stroke!==rt&&(this._stroke=rt,this.styleID++)}get strokeThickness(){return this._strokeThickness}set strokeThickness(et){this._strokeThickness!==et&&(this._strokeThickness=et,this.styleID++)}get textBaseline(){return this._textBaseline}set textBaseline(et){this._textBaseline!==et&&(this._textBaseline=et,this.styleID++)}get trim(){return this._trim}set trim(et){this._trim!==et&&(this._trim=et,this.styleID++)}get whiteSpace(){return this._whiteSpace}set whiteSpace(et){this._whiteSpace!==et&&(this._whiteSpace=et,this.styleID++)}get wordWrap(){return this._wordWrap}set wordWrap(et){this._wordWrap!==et&&(this._wordWrap=et,this.styleID++)}get wordWrapWidth(){return this._wordWrapWidth}set wordWrapWidth(et){this._wordWrapWidth!==et&&(this._wordWrapWidth=et,this.styleID++)}toFontString(){const et=typeof this.fontSize=="number"?`${this.fontSize}px`:this.fontSize;let rt=this.fontFamily;Array.isArray(this.fontFamily)||(rt=this.fontFamily.split(","));for(let st=rt.length-1;st>=0;st--){let nt=rt[st].trim();!/([\"\'])[^\'\"]+\1/.test(nt)&&!genericFontFamilies.includes(nt)&&(nt=`"${nt}"`),rt[st]=nt}return`${this.fontStyle} ${this.fontVariant} ${this.fontWeight} ${et} ${rt.join(",")}`}};_TextStyle.defaultStyle={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fillGradientType:TEXT_GRADIENT.LINEAR_VERTICAL,fillGradientStops:[],fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",leading:0,letterSpacing:0,lineHeight:0,lineJoin:"miter",miterLimit:10,padding:0,stroke:"black",strokeThickness:0,textBaseline:"alphabetic",trim:!1,whiteSpace:"pre",wordWrap:!1,wordWrapWidth:100};let TextStyle=_TextStyle;function getColor(tt){const et=Color.shared,rt=st=>{const nt=et.setValue(st);return nt.alpha===1?nt.toHex():nt.toRgbaString()};return Array.isArray(tt)?tt.map(rt):rt(tt)}function areArraysEqual(tt,et){if(!Array.isArray(tt)||!Array.isArray(et)||tt.length!==et.length)return!1;for(let rt=0;rt<tt.length;++rt)if(tt[rt]!==et[rt])return!1;return!0}function deepCopyProperties(tt,et,rt){for(const st in rt)Array.isArray(et[st])?tt[st]=et[st].slice():tt[st]=et[st]}const defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_Text=class i2 extends Sprite{constructor(et,rt,st){let nt=!1;st||(st=settings.ADAPTER.createCanvas(),nt=!0),st.width=3,st.height=3;const ot=Texture.from(st);ot.orig=new Rectangle,ot.trim=new Rectangle,super(ot),this._ownCanvas=nt,this.canvas=st,this.context=st.getContext("2d",{willReadFrequently:!0}),this._resolution=i2.defaultResolution??settings.RESOLUTION,this._autoResolution=i2.defaultAutoResolution,this._text=null,this._style=null,this._styleListener=null,this._font="",this.text=et,this.style=rt,this.localStyleID=-1}static get experimentalLetterSpacing(){return TextMetrics.experimentalLetterSpacing}static set experimentalLetterSpacing(et){deprecation("7.1.0","Text.experimentalLetterSpacing is deprecated, use TextMetrics.experimentalLetterSpacing"),TextMetrics.experimentalLetterSpacing=et}updateText(et){const rt=this._style;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;this._font=this._style.toFontString();const st=this.context,nt=TextMetrics.measureText(this._text||" ",this._style,this._style.wordWrap,this.canvas),ot=nt.width,at=nt.height,lt=nt.lines,ut=nt.lineHeight,ct=nt.lineWidths,dt=nt.maxLineWidth,ht=nt.fontProperties;this.canvas.width=Math.ceil(Math.ceil(Math.max(1,ot)+rt.padding*2)*this._resolution),this.canvas.height=Math.ceil(Math.ceil(Math.max(1,at)+rt.padding*2)*this._resolution),st.scale(this._resolution,this._resolution),st.clearRect(0,0,this.canvas.width,this.canvas.height),st.font=this._font,st.lineWidth=rt.strokeThickness,st.textBaseline=rt.textBaseline,st.lineJoin=rt.lineJoin,st.miterLimit=rt.miterLimit;let ft,xt;const vt=rt.dropShadow?2:1;for(let yt=0;yt<vt;++yt){const Et=rt.dropShadow&&yt===0,bt=Et?Math.ceil(Math.max(1,at)+rt.padding*2):0,wt=bt*this._resolution;if(Et){st.fillStyle="black",st.strokeStyle="black";const Rt=rt.dropShadowColor,Ct=rt.dropShadowBlur*this._resolution,It=rt.dropShadowDistance*this._resolution;st.shadowColor=Color.shared.setValue(Rt).setAlpha(rt.dropShadowAlpha).toRgbaString(),st.shadowBlur=Ct,st.shadowOffsetX=Math.cos(rt.dropShadowAngle)*It,st.shadowOffsetY=Math.sin(rt.dropShadowAngle)*It+wt}else st.fillStyle=this._generateFillStyle(rt,lt,nt),st.strokeStyle=rt.stroke,st.shadowColor="black",st.shadowBlur=0,st.shadowOffsetX=0,st.shadowOffsetY=0;let St=(ut-ht.fontSize)/2;ut-ht.fontSize<0&&(St=0);for(let Rt=0;Rt<lt.length;Rt++)ft=rt.strokeThickness/2,xt=rt.strokeThickness/2+Rt*ut+ht.ascent+St,rt.align==="right"?ft+=dt-ct[Rt]:rt.align==="center"&&(ft+=(dt-ct[Rt])/2),rt.stroke&&rt.strokeThickness&&this.drawLetterSpacing(lt[Rt],ft+rt.padding,xt+rt.padding-bt,!0),rt.fill&&this.drawLetterSpacing(lt[Rt],ft+rt.padding,xt+rt.padding-bt)}this.updateTexture()}drawLetterSpacing(et,rt,st,nt=!1){const ot=this._style.letterSpacing;let at=!1;if(TextMetrics.experimentalLetterSpacingSupported&&(TextMetrics.experimentalLetterSpacing?(this.context.letterSpacing=`${ot}px`,this.context.textLetterSpacing=`${ot}px`,at=!0):(this.context.letterSpacing="0px",this.context.textLetterSpacing="0px")),ot===0||at){nt?this.context.strokeText(et,rt,st):this.context.fillText(et,rt,st);return}let lt=rt;const ut=TextMetrics.graphemeSegmenter(et);let ct=this.context.measureText(et).width,dt=0;for(let ht=0;ht<ut.length;++ht){const ft=ut[ht];nt?this.context.strokeText(ft,lt,st):this.context.fillText(ft,lt,st);let xt="";for(let vt=ht+1;vt<ut.length;++vt)xt+=ut[vt];dt=this.context.measureText(xt).width,lt+=ct-dt+ot,ct=dt}}updateTexture(){const et=this.canvas;if(this._style.trim){const at=trimCanvas(et);at.data&&(et.width=at.width,et.height=at.height,this.context.putImageData(at.data,0,0))}const rt=this._texture,st=this._style,nt=st.trim?0:st.padding,ot=rt.baseTexture;rt.trim.width=rt._frame.width=et.width/this._resolution,rt.trim.height=rt._frame.height=et.height/this._resolution,rt.trim.x=-nt,rt.trim.y=-nt,rt.orig.width=rt._frame.width-nt*2,rt.orig.height=rt._frame.height-nt*2,this._onTextureUpdate(),ot.setRealSize(et.width,et.height,this._resolution),rt.updateUvs(),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}updateTransform(){this.updateText(!0),super.updateTransform()}getBounds(et,rt){return this.updateText(!0),this._textureID===-1&&(et=!1),super.getBounds(et,rt)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds.call(this,et)}_calculateBounds(){this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_generateFillStyle(et,rt,st){const nt=et.fill;if(Array.isArray(nt)){if(nt.length===1)return nt[0]}else return nt;let ot;const at=et.dropShadow?et.dropShadowDistance:0,lt=et.padding||0,ut=this.canvas.width/this._resolution-at-lt*2,ct=this.canvas.height/this._resolution-at-lt*2,dt=nt.slice(),ht=et.fillGradientStops.slice();if(!ht.length){const ft=dt.length+1;for(let xt=1;xt<ft;++xt)ht.push(xt/ft)}if(dt.unshift(nt[0]),ht.unshift(0),dt.push(nt[nt.length-1]),ht.push(1),et.fillGradientType===TEXT_GRADIENT.LINEAR_VERTICAL){ot=this.context.createLinearGradient(ut/2,lt,ut/2,ct+lt);const ft=st.fontProperties.fontSize+et.strokeThickness;for(let xt=0;xt<rt.length;xt++){const vt=st.lineHeight*(xt-1)+ft,yt=st.lineHeight*xt;let Et=yt;xt>0&&vt>yt&&(Et=(yt+vt)/2);const bt=yt+ft,wt=st.lineHeight*(xt+1);let St=bt;xt+1<rt.length&&wt<bt&&(St=(bt+wt)/2);const Rt=(St-Et)/ct;for(let Ct=0;Ct<dt.length;Ct++){let It=0;typeof ht[Ct]=="number"?It=ht[Ct]:It=Ct/dt.length;let jt=Math.min(1,Math.max(0,Et/ct+It*Rt));jt=Number(jt.toFixed(5)),ot.addColorStop(jt,dt[Ct])}}}else{ot=this.context.createLinearGradient(lt,ct/2,ut+lt,ct/2);const ft=dt.length+1;let xt=1;for(let vt=0;vt<dt.length;vt++){let yt;typeof ht[vt]=="number"?yt=ht[vt]:yt=xt/ft,ot.addColorStop(yt,dt[vt]),xt++}}return ot}destroy(et){typeof et=="boolean"&&(et={children:et}),et=Object.assign({},defaultDestroyOptions,et),super.destroy(et),this._ownCanvas&&(this.canvas.height=this.canvas.width=0),this.context=null,this.canvas=null,this._style=null}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._texture.orig.width}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._texture.orig.width,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._texture.orig.height}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._texture.orig.height,this._height=et}get style(){return this._style}set style(et){et=et||{},et instanceof TextStyle?this._style=et:this._style=new TextStyle(et),this.localStyleID=-1,this.dirty=!0}get text(){return this._text}set text(et){et=String(et??""),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}};_Text.defaultAutoResolution=!0;let Text$2=_Text;class BitmapFontData{constructor(){this.info=[],this.common=[],this.page=[],this.char=[],this.kerning=[],this.distanceField=[]}}class TextFormat{static test(et){return typeof et=="string"&&et.startsWith("info face=")}static parse(et){const rt=et.match(/^[a-z]+\s+.+$/gm),st={info:[],common:[],page:[],char:[],chars:[],kerning:[],kernings:[],distanceField:[]};for(const ot in rt){const at=rt[ot].match(/^[a-z]+/gm)[0],lt=rt[ot].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm),ut={};for(const ct in lt){const dt=lt[ct].split("="),ht=dt[0],ft=dt[1].replace(/"/gm,""),xt=parseFloat(ft),vt=isNaN(xt)?ft:xt;ut[ht]=vt}st[at].push(ut)}const nt=new BitmapFontData;return st.info.forEach(ot=>nt.info.push({face:ot.face,size:parseInt(ot.size,10)})),st.common.forEach(ot=>nt.common.push({lineHeight:parseInt(ot.lineHeight,10)})),st.page.forEach(ot=>nt.page.push({id:parseInt(ot.id,10),file:ot.file})),st.char.forEach(ot=>nt.char.push({id:parseInt(ot.id,10),page:parseInt(ot.page,10),x:parseInt(ot.x,10),y:parseInt(ot.y,10),width:parseInt(ot.width,10),height:parseInt(ot.height,10),xoffset:parseInt(ot.xoffset,10),yoffset:parseInt(ot.yoffset,10),xadvance:parseInt(ot.xadvance,10)})),st.kerning.forEach(ot=>nt.kerning.push({first:parseInt(ot.first,10),second:parseInt(ot.second,10),amount:parseInt(ot.amount,10)})),st.distanceField.forEach(ot=>nt.distanceField.push({distanceRange:parseInt(ot.distanceRange,10),fieldType:ot.fieldType})),nt}}class XMLFormat{static test(et){const rt=et;return typeof et!="string"&&"getElementsByTagName"in et&&rt.getElementsByTagName("page").length&&rt.getElementsByTagName("info")[0].getAttribute("face")!==null}static parse(et){const rt=new BitmapFontData,st=et.getElementsByTagName("info"),nt=et.getElementsByTagName("common"),ot=et.getElementsByTagName("page"),at=et.getElementsByTagName("char"),lt=et.getElementsByTagName("kerning"),ut=et.getElementsByTagName("distanceField");for(let ct=0;ct<st.length;ct++)rt.info.push({face:st[ct].getAttribute("face"),size:parseInt(st[ct].getAttribute("size"),10)});for(let ct=0;ct<nt.length;ct++)rt.common.push({lineHeight:parseInt(nt[ct].getAttribute("lineHeight"),10)});for(let ct=0;ct<ot.length;ct++)rt.page.push({id:parseInt(ot[ct].getAttribute("id"),10)||0,file:ot[ct].getAttribute("file")});for(let ct=0;ct<at.length;ct++){const dt=at[ct];rt.char.push({id:parseInt(dt.getAttribute("id"),10),page:parseInt(dt.getAttribute("page"),10)||0,x:parseInt(dt.getAttribute("x"),10),y:parseInt(dt.getAttribute("y"),10),width:parseInt(dt.getAttribute("width"),10),height:parseInt(dt.getAttribute("height"),10),xoffset:parseInt(dt.getAttribute("xoffset"),10),yoffset:parseInt(dt.getAttribute("yoffset"),10),xadvance:parseInt(dt.getAttribute("xadvance"),10)})}for(let ct=0;ct<lt.length;ct++)rt.kerning.push({first:parseInt(lt[ct].getAttribute("first"),10),second:parseInt(lt[ct].getAttribute("second"),10),amount:parseInt(lt[ct].getAttribute("amount"),10)});for(let ct=0;ct<ut.length;ct++)rt.distanceField.push({fieldType:ut[ct].getAttribute("fieldType"),distanceRange:parseInt(ut[ct].getAttribute("distanceRange"),10)});return rt}}class XMLStringFormat{static test(et){return typeof et=="string"&&et.includes("<font>")?XMLFormat.test(settings.ADAPTER.parseXML(et)):!1}static parse(et){return XMLFormat.parse(settings.ADAPTER.parseXML(et))}}const formats=[TextFormat,XMLFormat,XMLStringFormat];function autoDetectFormat(tt){for(let et=0;et<formats.length;et++)if(formats[et].test(tt))return formats[et];return null}function generateFillStyle(tt,et,rt,st,nt,ot){const at=rt.fill;if(Array.isArray(at)){if(at.length===1)return at[0]}else return at;let lt;const ut=rt.dropShadow?rt.dropShadowDistance:0,ct=rt.padding||0,dt=tt.width/st-ut-ct*2,ht=tt.height/st-ut-ct*2,ft=at.slice(),xt=rt.fillGradientStops.slice();if(!xt.length){const vt=ft.length+1;for(let yt=1;yt<vt;++yt)xt.push(yt/vt)}if(ft.unshift(at[0]),xt.unshift(0),ft.push(at[at.length-1]),xt.push(1),rt.fillGradientType===TEXT_GRADIENT.LINEAR_VERTICAL){lt=et.createLinearGradient(dt/2,ct,dt/2,ht+ct);let vt=0;const yt=(ot.fontProperties.fontSize+rt.strokeThickness)/ht;for(let Et=0;Et<nt.length;Et++){const bt=ot.lineHeight*Et;for(let wt=0;wt<ft.length;wt++){let St=0;typeof xt[wt]=="number"?St=xt[wt]:St=wt/ft.length;const Rt=bt/ht+St*yt;let Ct=Math.max(vt,Rt);Ct=Math.min(Ct,1),lt.addColorStop(Ct,ft[wt]),vt=Ct}}}else{lt=et.createLinearGradient(ct,ht/2,dt+ct,ht/2);const vt=ft.length+1;let yt=1;for(let Et=0;Et<ft.length;Et++){let bt;typeof xt[Et]=="number"?bt=xt[Et]:bt=yt/vt,lt.addColorStop(bt,ft[Et]),yt++}}return lt}function drawGlyph(tt,et,rt,st,nt,ot,at){const lt=rt.text,ut=rt.fontProperties;et.translate(st,nt),et.scale(ot,ot);const ct=at.strokeThickness/2,dt=-(at.strokeThickness/2);if(et.font=at.toFontString(),et.lineWidth=at.strokeThickness,et.textBaseline=at.textBaseline,et.lineJoin=at.lineJoin,et.miterLimit=at.miterLimit,et.fillStyle=generateFillStyle(tt,et,at,ot,[lt],rt),et.strokeStyle=at.stroke,at.dropShadow){const ht=at.dropShadowColor,ft=at.dropShadowBlur*ot,xt=at.dropShadowDistance*ot;et.shadowColor=Color.shared.setValue(ht).setAlpha(at.dropShadowAlpha).toRgbaString(),et.shadowBlur=ft,et.shadowOffsetX=Math.cos(at.dropShadowAngle)*xt,et.shadowOffsetY=Math.sin(at.dropShadowAngle)*xt}else et.shadowColor="black",et.shadowBlur=0,et.shadowOffsetX=0,et.shadowOffsetY=0;at.stroke&&at.strokeThickness&&et.strokeText(lt,ct,dt+rt.lineHeight-ut.descent),at.fill&&et.fillText(lt,ct,dt+rt.lineHeight-ut.descent),et.setTransform(1,0,0,1,0,0),et.fillStyle="rgba(0, 0, 0, 0)"}function extractCharCode(tt){return tt.codePointAt?tt.codePointAt(0):tt.charCodeAt(0)}function splitTextToCharacters(tt){return Array.from?Array.from(tt):tt.split("")}function resolveCharacters(tt){typeof tt=="string"&&(tt=[tt]);const et=[];for(let rt=0,st=tt.length;rt<st;rt++){const nt=tt[rt];if(Array.isArray(nt)){if(nt.length!==2)throw new Error(`[BitmapFont]: Invalid character range length, expecting 2 got ${nt.length}.`);const ot=nt[0].charCodeAt(0),at=nt[1].charCodeAt(0);if(at<ot)throw new Error("[BitmapFont]: Invalid character range.");for(let lt=ot,ut=at;lt<=ut;lt++)et.push(String.fromCharCode(lt))}else et.push(...splitTextToCharacters(nt))}if(et.length===0)throw new Error("[BitmapFont]: Empty set when resolving characters.");return et}const _BitmapFont=class go{constructor(et,rt,st){var dt;const[nt]=et.info,[ot]=et.common,[at]=et.page,[lt]=et.distanceField,ut=getResolutionOfUrl(at.file),ct={};this._ownsTextures=st,this.font=nt.face,this.size=nt.size,this.lineHeight=ot.lineHeight/ut,this.chars={},this.pageTextures=ct;for(let ht=0;ht<et.page.length;ht++){const{id:ft,file:xt}=et.page[ht];ct[ft]=rt instanceof Array?rt[ht]:rt[xt],lt!=null&<.fieldType&<.fieldType!=="none"&&(ct[ft].baseTexture.alphaMode=ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,ct[ft].baseTexture.mipmap=MIPMAP_MODES.OFF)}for(let ht=0;ht<et.char.length;ht++){const{id:ft,page:xt}=et.char[ht];let{x:vt,y:yt,width:Et,height:bt,xoffset:wt,yoffset:St,xadvance:Rt}=et.char[ht];vt/=ut,yt/=ut,Et/=ut,bt/=ut,wt/=ut,St/=ut,Rt/=ut;const Ct=new Rectangle(vt+ct[xt].frame.x/ut,yt+ct[xt].frame.y/ut,Et,bt);this.chars[ft]={xOffset:wt,yOffset:St,xAdvance:Rt,kerning:{},texture:new Texture(ct[xt].baseTexture,Ct),page:xt}}for(let ht=0;ht<et.kerning.length;ht++){let{first:ft,second:xt,amount:vt}=et.kerning[ht];ft/=ut,xt/=ut,vt/=ut,this.chars[xt]&&(this.chars[xt].kerning[ft]=vt)}this.distanceFieldRange=lt==null?void 0:lt.distanceRange,this.distanceFieldType=((dt=lt==null?void 0:lt.fieldType)==null?void 0:dt.toLowerCase())??"none"}destroy(){for(const et in this.chars)this.chars[et].texture.destroy(),this.chars[et].texture=null;for(const et in this.pageTextures)this._ownsTextures&&this.pageTextures[et].destroy(!0),this.pageTextures[et]=null;this.chars=null,this.pageTextures=null}static install(et,rt,st){let nt;if(et instanceof BitmapFontData)nt=et;else{const at=autoDetectFormat(et);if(!at)throw new Error("Unrecognized data format for font.");nt=at.parse(et)}rt instanceof Texture&&(rt=[rt]);const ot=new go(nt,rt,st);return go.available[ot.font]=ot,ot}static uninstall(et){const rt=go.available[et];if(!rt)throw new Error(`No font found named '${et}'`);rt.destroy(),delete go.available[et]}static from(et,rt,st){if(!et)throw new Error("[BitmapFont] Property `name` is required.");const{chars:nt,padding:ot,resolution:at,textureWidth:lt,textureHeight:ut,...ct}=Object.assign({},go.defaultOptions,st),dt=resolveCharacters(nt),ht=rt instanceof TextStyle?rt:new TextStyle(rt),ft=lt,xt=new BitmapFontData;xt.info[0]={face:ht.fontFamily,size:ht.fontSize},xt.common[0]={lineHeight:ht.fontSize};let vt=0,yt=0,Et,bt,wt,St=0;const Rt=[];for(let It=0;It<dt.length;It++){Et||(Et=settings.ADAPTER.createCanvas(),Et.width=lt,Et.height=ut,bt=Et.getContext("2d"),wt=new BaseTexture(Et,{resolution:at,...ct}),Rt.push(new Texture(wt)),xt.page.push({id:Rt.length-1,file:""}));const jt=dt[It],Pt=TextMetrics.measureText(jt,ht,!1,Et),Ot=Pt.width,Ut=Math.ceil(Pt.height),Nt=Math.ceil((ht.fontStyle==="italic"?2:1)*Ot);if(yt>=ut-Ut*at){if(yt===0)throw new Error(`[BitmapFont] textureHeight ${ut}px is too small (fontFamily: '${ht.fontFamily}', fontSize: ${ht.fontSize}px, char: '${jt}')`);--It,Et=null,bt=null,wt=null,yt=0,vt=0,St=0;continue}if(St=Math.max(Ut+Pt.fontProperties.descent,St),Nt*at+vt>=ft){if(vt===0)throw new Error(`[BitmapFont] textureWidth ${lt}px is too small (fontFamily: '${ht.fontFamily}', fontSize: ${ht.fontSize}px, char: '${jt}')`);--It,yt+=St*at,yt=Math.ceil(yt),vt=0,St=0;continue}drawGlyph(Et,bt,Pt,vt,yt,at,ht);const Ht=extractCharCode(Pt.text);xt.char.push({id:Ht,page:Rt.length-1,x:vt/at,y:yt/at,width:Nt,height:Ut,xoffset:0,yoffset:0,xadvance:Ot-(ht.dropShadow?ht.dropShadowDistance:0)-(ht.stroke?ht.strokeThickness:0)}),vt+=(Nt+2*ot)*at,vt=Math.ceil(vt)}if(!(st!=null&&st.skipKerning))for(let It=0,jt=dt.length;It<jt;It++){const Pt=dt[It];for(let Ot=0;Ot<jt;Ot++){const Ut=dt[Ot],Nt=bt.measureText(Pt).width,Ht=bt.measureText(Ut).width,Lt=bt.measureText(Pt+Ut).width-(Nt+Ht);Lt&&xt.kerning.push({first:extractCharCode(Pt),second:extractCharCode(Ut),amount:Lt})}}const Ct=new go(xt,Rt,!0);return go.available[et]!==void 0&&go.uninstall(et),go.available[et]=Ct,Ct}};_BitmapFont.ALPHA=[["a","z"],["A","Z"]," "],_BitmapFont.NUMERIC=[["0","9"]],_BitmapFont.ALPHANUMERIC=[["a","z"],["A","Z"],["0","9"]," "],_BitmapFont.ASCII=[[" ","~"]],_BitmapFont.defaultOptions={resolution:1,textureWidth:512,textureHeight:512,padding:4,chars:_BitmapFont.ALPHANUMERIC},_BitmapFont.available={};let BitmapFont=_BitmapFont;class MeshBatchUvs{constructor(et,rt){this.uvBuffer=et,this.uvMatrix=rt,this.data=null,this._bufferUpdateId=-1,this._textureUpdateId=-1,this._updateID=0}update(et){if(!et&&this._bufferUpdateId===this.uvBuffer._updateID&&this._textureUpdateId===this.uvMatrix._updateID)return;this._bufferUpdateId=this.uvBuffer._updateID,this._textureUpdateId=this.uvMatrix._updateID;const rt=this.uvBuffer.data;(!this.data||this.data.length!==rt.length)&&(this.data=new Float32Array(rt.length)),this.uvMatrix.multiplyUvs(rt,this.data),this._updateID++}}const tempPoint$1=new Point,tempPolygon=new Polygon,_Mesh=class om extends Container{constructor(et,rt,st,nt=DRAW_MODES.TRIANGLES){super(),this.geometry=et,this.shader=rt,this.state=st||State.for2d(),this.drawMode=nt,this.start=0,this.size=0,this.uvs=null,this.indices=null,this.vertexData=new Float32Array(1),this.vertexDirty=-1,this._transformID=-1,this._roundPixels=settings.ROUND_PIXELS,this.batchUvs=null}get geometry(){return this._geometry}set geometry(et){this._geometry!==et&&(this._geometry&&(this._geometry.refCount--,this._geometry.refCount===0&&this._geometry.dispose()),this._geometry=et,this._geometry&&this._geometry.refCount++,this.vertexDirty=-1)}get uvBuffer(){return this.geometry.buffers[1]}get verticesBuffer(){return this.geometry.buffers[0]}set material(et){this.shader=et}get material(){return this.shader}set blendMode(et){this.state.blendMode=et}get blendMode(){return this.state.blendMode}set roundPixels(et){this._roundPixels!==et&&(this._transformID=-1),this._roundPixels=et}get roundPixels(){return this._roundPixels}get tint(){return"tint"in this.shader?this.shader.tint:null}set tint(et){this.shader.tint=et}get tintValue(){return this.shader.tintValue}get texture(){return"texture"in this.shader?this.shader.texture:null}set texture(et){this.shader.texture=et}_render(et){const rt=this.geometry.buffers[0].data;this.shader.batchable&&this.drawMode===DRAW_MODES.TRIANGLES&&rt.length<om.BATCHABLE_SIZE*2?this._renderToBatch(et):this._renderDefault(et)}_renderDefault(et){const rt=this.shader;rt.alpha=this.worldAlpha,rt.update&&rt.update(),et.batch.flush(),rt.uniforms.translationMatrix=this.transform.worldTransform.toArray(!0),et.shader.bind(rt),et.state.set(this.state),et.geometry.bind(this.geometry,rt),et.geometry.draw(this.drawMode,this.size,this.start,this.geometry.instanceCount)}_renderToBatch(et){const rt=this.geometry,st=this.shader;st.uvMatrix&&(st.uvMatrix.update(),this.calculateUvs()),this.calculateVertices(),this.indices=rt.indexBuffer.data,this._tintRGB=st._tintRGB,this._texture=st.texture;const nt=this.material.pluginName;et.batch.setObjectRenderer(et.plugins[nt]),et.plugins[nt].render(this)}calculateVertices(){const et=this.geometry.buffers[0],rt=et.data,st=et._updateID;if(st===this.vertexDirty&&this._transformID===this.transform._worldID)return;this._transformID=this.transform._worldID,this.vertexData.length!==rt.length&&(this.vertexData=new Float32Array(rt.length));const nt=this.transform.worldTransform,ot=nt.a,at=nt.b,lt=nt.c,ut=nt.d,ct=nt.tx,dt=nt.ty,ht=this.vertexData;for(let ft=0;ft<ht.length/2;ft++){const xt=rt[ft*2],vt=rt[ft*2+1];ht[ft*2]=ot*xt+lt*vt+ct,ht[ft*2+1]=at*xt+ut*vt+dt}if(this._roundPixels){const ft=settings.RESOLUTION;for(let xt=0;xt<ht.length;++xt)ht[xt]=Math.round(ht[xt]*ft)/ft}this.vertexDirty=st}calculateUvs(){const et=this.geometry.buffers[1],rt=this.shader;rt.uvMatrix.isSimple?this.uvs=et.data:(this.batchUvs||(this.batchUvs=new MeshBatchUvs(et,rt.uvMatrix)),this.batchUvs.update(),this.uvs=this.batchUvs.data)}_calculateBounds(){this.calculateVertices(),this._bounds.addVertexData(this.vertexData,0,this.vertexData.length)}containsPoint(et){if(!this.getBounds().contains(et.x,et.y))return!1;this.worldTransform.applyInverse(et,tempPoint$1);const rt=this.geometry.getBuffer("aVertexPosition").data,st=tempPolygon.points,nt=this.geometry.getIndex().data,ot=nt.length,at=this.drawMode===4?3:1;for(let lt=0;lt+2<ot;lt+=at){const ut=nt[lt]*2,ct=nt[lt+1]*2,dt=nt[lt+2]*2;if(st[0]=rt[ut],st[1]=rt[ut+1],st[2]=rt[ct],st[3]=rt[ct+1],st[4]=rt[dt],st[5]=rt[dt+1],tempPolygon.contains(tempPoint$1.x,tempPoint$1.y))return!0}return!1}destroy(et){super.destroy(et),this._cachedTexture&&(this._cachedTexture.destroy(),this._cachedTexture=null),this.geometry=null,this.shader=null,this.state=null,this.uvs=null,this.indices=null,this.vertexData=null}};_Mesh.BATCHABLE_SIZE=100;let Mesh=_Mesh;class MeshGeometry extends Geometry{constructor(et,rt,st){super();const nt=new Buffer$1(et),ot=new Buffer$1(rt,!0),at=new Buffer$1(st,!0,!0);this.addAttribute("aVertexPosition",nt,2,!1,TYPES.FLOAT).addAttribute("aTextureCoord",ot,2,!1,TYPES.FLOAT).addIndex(at),this._updateId=-1}get vertexDirtyId(){return this.buffers[0]._updateID}}var fragment$6=`varying vec2 vTextureCoord;
|
|
753
753
|
uniform vec4 uColor;
|
|
754
754
|
|
|
755
755
|
uniform sampler2D uSampler;
|
|
@@ -1022,7 +1022,7 @@ void main(void)
|
|
|
1022
1022
|
vec4 texSample = texture2D(uSampler, vTextureCoord);
|
|
1023
1023
|
gl_FragColor = texSample * uColor;
|
|
1024
1024
|
}
|
|
1025
|
-
`;const tempMat=new Matrix;class TilingSpriteRenderer extends ObjectRenderer{constructor(et){super(et),et.runners.contextChange.add(this),this.quad=new QuadUv,this.state=State.for2d()}contextChange(){const et=this.renderer,rt={globals:et.globalUniforms};this.simpleShader=Shader.from(gl1VertexSrc,fragmentSimpleSrc,rt),this.shader=et.context.webGLVersion>1?Shader.from(gl2VertexSrc,gl2FragmentSrc,rt):Shader.from(gl1VertexSrc,gl1FragmentSrc,rt)}render(et){const rt=this.renderer,st=this.quad;let nt=st.vertices;nt[0]=nt[6]=et._width*-et.anchor.x,nt[1]=nt[3]=et._height*-et.anchor.y,nt[2]=nt[4]=et._width*(1-et.anchor.x),nt[5]=nt[7]=et._height*(1-et.anchor.y);const ot=et.uvRespectAnchor?et.anchor.x:0,at=et.uvRespectAnchor?et.anchor.y:0;nt=st.uvs,nt[0]=nt[6]=-ot,nt[1]=nt[3]=-at,nt[2]=nt[4]=1-ot,nt[5]=nt[7]=1-at,st.invalidate();const lt=et._texture,ut=lt.baseTexture,ct=ut.alphaMode>0,dt=et.tileTransform.localTransform,ht=et.uvMatrix;let ft=ut.isPowerOfTwo&<.frame.width===ut.width&<.frame.height===ut.height;ft&&(ut._glTextures[rt.CONTEXT_UID]?ft=ut.wrapMode!==WRAP_MODES.CLAMP:ut.wrapMode===WRAP_MODES.CLAMP&&(ut.wrapMode=WRAP_MODES.REPEAT));const xt=ft?this.simpleShader:this.shader,vt=lt.width,yt=lt.height,Et=et._width,bt=et._height;tempMat.set(dt.a*vt/Et,dt.b*vt/bt,dt.c*yt/Et,dt.d*yt/bt,dt.tx/Et,dt.ty/bt),tempMat.invert(),ft?tempMat.prepend(ht.mapCoord):(xt.uniforms.uMapCoord=ht.mapCoord.toArray(!0),xt.uniforms.uClampFrame=ht.uClampFrame,xt.uniforms.uClampOffset=ht.uClampOffset),xt.uniforms.uTransform=tempMat.toArray(!0),xt.uniforms.uColor=Color.shared.setValue(et.tint).premultiply(et.worldAlpha,ct).toArray(xt.uniforms.uColor),xt.uniforms.translationMatrix=et.transform.worldTransform.toArray(!0),xt.uniforms.uSampler=lt,rt.shader.bind(xt),rt.geometry.bind(st),this.state.blendMode=correctBlendMode(et.blendMode,ct),rt.state.set(this.state),rt.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}TilingSpriteRenderer.extension={name:"tilingSprite",type:ExtensionType.RendererPlugin};extensions$1.add(TilingSpriteRenderer);const _Application=class
|
|
1025
|
+
`;const tempMat=new Matrix;class TilingSpriteRenderer extends ObjectRenderer{constructor(et){super(et),et.runners.contextChange.add(this),this.quad=new QuadUv,this.state=State.for2d()}contextChange(){const et=this.renderer,rt={globals:et.globalUniforms};this.simpleShader=Shader.from(gl1VertexSrc,fragmentSimpleSrc,rt),this.shader=et.context.webGLVersion>1?Shader.from(gl2VertexSrc,gl2FragmentSrc,rt):Shader.from(gl1VertexSrc,gl1FragmentSrc,rt)}render(et){const rt=this.renderer,st=this.quad;let nt=st.vertices;nt[0]=nt[6]=et._width*-et.anchor.x,nt[1]=nt[3]=et._height*-et.anchor.y,nt[2]=nt[4]=et._width*(1-et.anchor.x),nt[5]=nt[7]=et._height*(1-et.anchor.y);const ot=et.uvRespectAnchor?et.anchor.x:0,at=et.uvRespectAnchor?et.anchor.y:0;nt=st.uvs,nt[0]=nt[6]=-ot,nt[1]=nt[3]=-at,nt[2]=nt[4]=1-ot,nt[5]=nt[7]=1-at,st.invalidate();const lt=et._texture,ut=lt.baseTexture,ct=ut.alphaMode>0,dt=et.tileTransform.localTransform,ht=et.uvMatrix;let ft=ut.isPowerOfTwo&<.frame.width===ut.width&<.frame.height===ut.height;ft&&(ut._glTextures[rt.CONTEXT_UID]?ft=ut.wrapMode!==WRAP_MODES.CLAMP:ut.wrapMode===WRAP_MODES.CLAMP&&(ut.wrapMode=WRAP_MODES.REPEAT));const xt=ft?this.simpleShader:this.shader,vt=lt.width,yt=lt.height,Et=et._width,bt=et._height;tempMat.set(dt.a*vt/Et,dt.b*vt/bt,dt.c*yt/Et,dt.d*yt/bt,dt.tx/Et,dt.ty/bt),tempMat.invert(),ft?tempMat.prepend(ht.mapCoord):(xt.uniforms.uMapCoord=ht.mapCoord.toArray(!0),xt.uniforms.uClampFrame=ht.uClampFrame,xt.uniforms.uClampOffset=ht.uClampOffset),xt.uniforms.uTransform=tempMat.toArray(!0),xt.uniforms.uColor=Color.shared.setValue(et.tint).premultiply(et.worldAlpha,ct).toArray(xt.uniforms.uColor),xt.uniforms.translationMatrix=et.transform.worldTransform.toArray(!0),xt.uniforms.uSampler=lt,rt.shader.bind(xt),rt.geometry.bind(st),this.state.blendMode=correctBlendMode(et.blendMode,ct),rt.state.set(this.state),rt.geometry.draw(this.renderer.gl.TRIANGLES,6,0)}}TilingSpriteRenderer.extension={name:"tilingSprite",type:ExtensionType.RendererPlugin};extensions$1.add(TilingSpriteRenderer);const _Application=class o2{constructor(et){this.stage=new Container,et=Object.assign({forceCanvas:!1},et),this.renderer=autoDetectRenderer(et),o2._plugins.forEach(rt=>{rt.init.call(this,et)})}render(){this.renderer.render(this.stage)}get view(){var et;return(et=this.renderer)==null?void 0:et.view}get screen(){var et;return(et=this.renderer)==null?void 0:et.screen}destroy(et,rt){const st=o2._plugins.slice(0);st.reverse(),st.forEach(nt=>{nt.destroy.call(this)}),this.stage.destroy(rt),this.stage=null,this.renderer.destroy(et),this.renderer=null}};_Application._plugins=[];let Application=_Application;extensions$1.handleByList(ExtensionType.Application,Application._plugins);class ResizePlugin{static init(et){Object.defineProperty(this,"resizeTo",{set(rt){globalThis.removeEventListener("resize",this.queueResize),this._resizeTo=rt,rt&&(globalThis.addEventListener("resize",this.queueResize),this.resize())},get(){return this._resizeTo}}),this.queueResize=()=>{this._resizeTo&&(this.cancelResize(),this._resizeId=requestAnimationFrame(()=>this.resize()))},this.cancelResize=()=>{this._resizeId&&(cancelAnimationFrame(this._resizeId),this._resizeId=null)},this.resize=()=>{if(!this._resizeTo)return;this.cancelResize();let rt,st;if(this._resizeTo===globalThis.window)rt=globalThis.innerWidth,st=globalThis.innerHeight;else{const{clientWidth:nt,clientHeight:ot}=this._resizeTo;rt=nt,st=ot}this.renderer.resize(rt,st),this.render()},this._resizeId=null,this._resizeTo=null,this.resizeTo=et.resizeTo||null}static destroy(){globalThis.removeEventListener("resize",this.queueResize),this.cancelResize(),this.cancelResize=null,this.queueResize=null,this.resizeTo=null,this.resize=null}}ResizePlugin.extension=ExtensionType.Application;extensions$1.add(ResizePlugin);var propTypes={exports:{}},ReactPropTypesSecret$1="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",ReactPropTypesSecret_1=ReactPropTypesSecret$1,ReactPropTypesSecret=ReactPropTypesSecret_1;function emptyFunction(){}function emptyFunctionWithReset(){}emptyFunctionWithReset.resetWarningCache=emptyFunction;var factoryWithThrowingShims=function(){function tt(st,nt,ot,at,lt,ut){if(ut!==ReactPropTypesSecret){var ct=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw ct.name="Invariant Violation",ct}}tt.isRequired=tt;function et(){return tt}var rt={array:tt,bigint:tt,bool:tt,func:tt,number:tt,object:tt,string:tt,symbol:tt,any:tt,arrayOf:et,element:tt,elementType:tt,instanceOf:et,node:tt,objectOf:et,oneOf:et,oneOfType:et,shape:et,exact:et,checkPropTypes:emptyFunctionWithReset,resetWarningCache:emptyFunction};return rt.PropTypes=rt,rt};propTypes.exports=factoryWithThrowingShims();var propTypesExports=propTypes.exports;const k=getDefaultExportFromCjs(propTypesExports);function P(tt){return P=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(et){return typeof et}:function(et){return et&&typeof Symbol=="function"&&et.constructor===Symbol&&et!==Symbol.prototype?"symbol":typeof et},P(tt)}function E(tt){var et=function(rt,st){if(P(rt)!=="object"||rt===null)return rt;var nt=rt[Symbol.toPrimitive];if(nt!==void 0){var ot=nt.call(rt,st);if(P(ot)!=="object")return ot;throw new TypeError("@@toPrimitive must return a primitive value.")}return(st==="string"?String:Number)(rt)}(tt,"string");return P(et)==="symbol"?et:String(et)}function _(tt,et,rt){return(et=E(et))in tt?Object.defineProperty(tt,et,{value:rt,enumerable:!0,configurable:!0,writable:!0}):tt[et]=rt,tt}function C(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var rt=0,st=new Array(et);rt<et;rt++)st[rt]=tt[rt];return st}function z(tt){return function(et){if(Array.isArray(et))return C(et)}(tt)||function(et){if(typeof Symbol<"u"&&et[Symbol.iterator]!=null||et["@@iterator"]!=null)return Array.from(et)}(tt)||function(et,rt){if(et){if(typeof et=="string")return C(et,rt);var st=Object.prototype.toString.call(et).slice(8,-1);return st==="Object"&&et.constructor&&(st=et.constructor.name),st==="Map"||st==="Set"?Array.from(et):st==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(st)?C(et,rt):void 0}}(tt)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1026
1026
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function N(tt,et){for(var rt=arguments.length,st=new Array(rt>2?rt-2:0),nt=2;nt<rt;nt++)st[nt-2]=arguments[nt]}var T=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function I(tt){return tt&&tt.__esModule&&Object.prototype.hasOwnProperty.call(tt,"default")?tt.default:tt}var R=function(tt){return tt==null};function O(tt){var et=[];if(tt===void 0)return et;if(typeof tt=="string")et=tt.split(",");else if(typeof tt=="number")et=[tt];else if(Array.isArray(tt))et=z(tt);else{if(tt===null||P(tt)!=="object")return et;et=[tt&&(tt==null?void 0:tt.x)||0,tt&&(tt==null?void 0:tt.y)||0]}return et.filter(function(rt){return!R(rt)&&!isNaN(rt)}).map(Number)}function j(tt,et){if(tt.length!==et.length)return!1;for(var rt=0;rt<tt.length;rt++)if(tt[rt]!==et[rt])return!1;return!0}function L(tt){return tt instanceof Point||tt instanceof ObservablePoint}var D=["click","mousedown","mousemove","mouseout","mouseover","mouseup","mouseupoutside","tap","touchstart","touchmove","touchend","touchendoutside","pointercancel","pointerout","pointerover","pointertap","pointerdown","pointerup","pointerupoutside","pointermove","rightclick","rightdown","rightup","rightupoutside","touchcancel","touchendoutside","touchmove","touchstart"];function M(tt,et,rt){if(L(tt[et])&&L(rt))tt[et].copyFrom(rt);else if(L(tt[et])){var st=O(rt);N(st!==void 0&&st.length>0&&st.length<3,"The property `%s` is a `Point` and must be set to a comma-separated string of either coordinates, an array containing coordinates, or a Point.",et,JSON.stringify(rt),P(rt)),tt[et].set(st.shift(),st.shift())}else tt[et]=rt}var U,F=function(tt){var et,rt=tt;if(!Array.isArray(rt)){if(et=tt,Object.prototype.toString.call(et)!=="[object Object]")throw new Error("collection needs to be an Array or Object");rt=Object.keys(tt)}var st={};return rt.forEach(function(nt){st[nt]=!0}),function(nt){return st[nt]!==void 0}},A=function(tt){return function(){return!tt.apply(void 0,arguments)}},Q="children",H$1=(_(U={},Q,!0),_(U,"parent",!0),_(U,"worldAlpha",!0),_(U,"worldTransform",!0),_(U,"worldVisible",!0),U),B={alpha:1,buttonMode:!1,cacheAsBitmap:!1,cursor:null,filterArea:null,filters:null,hitArea:null,interactive:!1,mask:null,pivot:0,position:0,renderable:!0,rotation:0,scale:1,skew:0,transform:null,visible:!0,x:0,y:0},W$1=function(tt,et){var rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},st=function(lt){return requestAnimationFrame(function(){var ut,ct;lt==null||(ut=lt.__reactpixi)===null||ut===void 0||(ct=ut.root)===null||ct===void 0||ct.emit("__REACT_PIXI_REQUEST_RENDER__")})},nt=function(lt,ut){if(rt.hasOwnProperty(lt))return N(ut.typeofs.some(function(ct){return P(rt[lt])===ct})||ut.instanceofs.some(function(ct){return rt[lt]instanceof ct}),"".concat(tt," ").concat(lt," prop is invalid")),rt[lt]};if(rt.texture)return N(rt.texture instanceof Texture,"".concat(tt," texture needs to be typeof `Texture`")),rt.texture;var ot=nt("image",{typeofs:["string"],instanceofs:[HTMLImageElement]})||nt("video",{typeofs:["string"],instanceofs:[HTMLVideoElement]})||nt("source",{typeofs:["string","number"],instanceofs:[HTMLImageElement,HTMLVideoElement,HTMLCanvasElement,Texture]});N(!!ot,"".concat(tt," could not get texture from props"));var at=Texture.from(ot);return at.__reactpixi={root:et},at.once("update",st),at.once("loaded",st),at.valid&&st(at),at},$=A(F([].concat(z(Object.keys(H$1)),z(D))));function V(tt,et,rt){var st=!1;if(N(DisplayObject.prototype.isPrototypeOf(tt),"instance needs to be typeof `DisplayObject`, got `%s`",P(tt)),!rt.ignoreEvents)for(var nt=typeof tt.removeListener=="function",ot=typeof tt.on=="function",at=0;at<D.length;at++){var lt=D[at];et[lt]!==rt[lt]&&(st=!0,typeof et[lt]=="function"&&nt&&tt.removeListener(lt,et[lt]),typeof rt[lt]=="function"&&ot&&tt.on(lt,rt[lt]))}var ut=Object.keys(rt||{});if(rt.overwriteProps){for(var ct=0;ct<ut.length;ct++){var dt=ut[ct];et[dt]!==rt[dt]&&(st=!0,M(tt,dt,rt[dt]))}return st}for(var ht=ut.filter($),ft=0;ft<ht.length;ft++){var xt=ht[ft],vt=rt[xt];rt[xt]!==et[xt]&&(st=!0),vt!==void 0?M(tt,xt,vt):xt in B?(console.warn("setting default value: ".concat(xt,", from: ").concat(tt[xt]," to: ").concat(vt," for"),tt),st=!0,M(tt,xt,B[xt])):console.warn("ignoring prop: ".concat(xt,", from ").concat(tt[xt]," to ").concat(vt," for"),tt)}return st}var q=function(tt,et){var rt=et.text,st=et.style;return new BitmapText(rt,st)},X=function(){return new Container};function G(tt,et){if(tt==null)return{};var rt,st,nt=function(at,lt){if(at==null)return{};var ut,ct,dt={},ht=Object.keys(at);for(ct=0;ct<ht.length;ct++)ut=ht[ct],lt.indexOf(ut)>=0||(dt[ut]=at[ut]);return dt}(tt,et);if(Object.getOwnPropertySymbols){var ot=Object.getOwnPropertySymbols(tt);for(st=0;st<ot.length;st++)rt=ot[st],et.indexOf(rt)>=0||Object.prototype.propertyIsEnumerable.call(tt,rt)&&(nt[rt]=tt[rt])}return nt}var Y=["draw","geometry"],K$1=function(tt,et){var rt=et.geometry;N(!rt||rt instanceof Graphics,"Graphics geometry needs to be a `Graphics`");var st=rt?new Graphics(rt.geometry):new Graphics;return st.applyProps=function(nt,ot,at){var lt=at.draw;at.geometry;var ut=V(nt,ot,G(at,Y));return ot.draw!==lt&&typeof lt=="function"&&(ut=!0,lt.call(st,st)),ut},st},J=["image","texture"],Z=function(tt,et){var rt=et.leftWidth,st=rt===void 0?10:rt,nt=et.topHeight,ot=nt===void 0?10:nt,at=et.rightWidth,lt=at===void 0?10:at,ut=et.bottomHeight,ct=ut===void 0?10:ut,dt=W$1("NineSlicePlane",tt,et),ht=new NineSlicePlane(dt,st,ot,lt,ct);return ht.applyProps=function(ft,xt,vt){var yt=vt.image,Et=vt.texture,bt=V(ft,xt,G(vt,J));return(yt||Et)&&(Et!==xt.texture&&(bt=!0),ft.texture=W$1("NineSlicePlane",tt,vt)),bt},ht};function ee(tt,et){var rt=Object.keys(tt);if(Object.getOwnPropertySymbols){var st=Object.getOwnPropertySymbols(tt);et&&(st=st.filter(function(nt){return Object.getOwnPropertyDescriptor(tt,nt).enumerable})),rt.push.apply(rt,st)}return rt}function ne(tt){for(var et=1;et<arguments.length;et++){var rt=arguments[et]!=null?arguments[et]:{};et%2?ee(Object(rt),!0).forEach(function(st){_(tt,st,rt[st])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(rt)):ee(Object(rt)).forEach(function(st){Object.defineProperty(tt,st,Object.getOwnPropertyDescriptor(rt,st))})}return tt}var te=function(tt,et){var rt=et.maxSize,st=rt===void 0?1500:rt,nt=et.batchSize,ot=nt===void 0?16384:nt,at=et.autoResize,lt=at!==void 0&&at,ut=ne(ne({},{vertices:!1,scale:!0,position:!0,rotation:!0,uvs:!0,tint:!0}),et.properties||{}),ct=ne(ne({},{children:!1,texture:!1,baseTexture:!1}),et.destroyOptions||{}),dt=new ParticleContainer(st,ut,ot,lt);return dt.willUnmount=function(ht,ft,xt){ht.destroy(ct)},dt},re=["image","texture"],le=function(tt,et){var rt=new Sprite(W$1("Sprite",tt,et));return rt.applyProps=function(st,nt,ot){var at=ot.image,lt=ot.texture,ut=V(st,nt,G(ot,re));return(lt&&nt.texture!==ot.texture||at&&nt.image!==ot.image)&&(nt.texture!==ot.texture&&(ut=!0),st.texture=W$1("Sprite",tt,ot)),ut},rt},ae=["textures","isPlaying","initialFrame","images"],ie=function(tt,et){var rt=et.textures,st=et.images,nt=et.isPlaying,ot=nt===void 0||nt,at=et.initialFrame,lt=function(ct){return ct.map(function(dt){return N(dt instanceof Texture||(dt==null?void 0:dt.texture),"AnimationSprite texture needs to be an array of `Texture` or `{ texture: Texture, time:\n number }`"),dt})},ut=st?AnimatedSprite.fromImages(st):new AnimatedSprite(lt(rt));return ut[ot?"gotoAndPlay":"gotoAndStop"](at||0),ut.applyProps=function(ct,dt,ht){var ft=ht.textures,xt=ht.isPlaying,vt=ht.initialFrame,yt=ht.images,Et=V(ct,dt,G(ht,ae));if(yt&&dt.images!==yt){for(var bt=[],wt=0;wt<yt.length;++wt)bt.push(Texture.from(yt[wt]));ct.textures=bt,Et=!0}if(ft&&dt.textures!==ft&&(ct.textures=lt(ft),Et=!0),xt!==dt.isPlaying||vt!==dt.initialFrame){var St=typeof vt=="number"?vt:ut.currentFrame||0;ut[xt?"gotoAndPlay":"gotoAndStop"](St),Et=!0}return Et},ut},oe=function(tt,et){var rt=et.text,st=rt===void 0?"":rt,nt=et.style,ot=nt===void 0?{}:nt,at=et.isSprite,lt=new Text$2(st,ot);return at?(lt.updateText(),new Sprite(lt.texture)):lt},ue=["tileScale","tilePosition","image","texture"],se=function(tt,et){var rt=et.width,st=rt===void 0?100:rt,nt=et.height,ot=nt===void 0?100:nt,at=W$1("TilingSprite",tt,et),lt=new TilingSprite(at,st,ot);return lt.applyProps=function(ut,ct,dt){var ht=dt.tileScale,ft=dt.tilePosition,xt=dt.image,vt=dt.texture,yt=V(ut,ct,G(dt,ue));if(ft){var Et,bt=O(ft);(Et=ut.tilePosition).set.apply(Et,z(bt)),yt=!j(O(ct.tilePosition),bt)||yt}if(ht){var wt,St=O(ht);(wt=ut.tileScale).set.apply(wt,z(St)),yt=!j(O(ct.tileScale),St)||yt}return(xt||vt)&&(vt!==ct.texture&&(yt=!0),ut.texture=W$1("Sprite",tt,dt)),yt},lt},ce=["image","texture"],fe=function(tt,et){var rt=W$1("Mesh",tt,et),st=et.vertices,nt=et.uvs,ot=et.indices,at=et.drawMode,lt=at===void 0?DRAW_MODES.TRIANGLES:at,ut=new SimpleMesh(rt,st,nt,ot,lt);return ut.applyProps=function(ct,dt,ht){var ft=ht.image,xt=ht.texture,vt=V(ct,dt,G(ht,ce));return(ft||xt)&&(xt!==dt.texture&&(vt=!0),ct.texture=W$1("Mesh",tt,ht)),vt},ut},de=["image","texture"],pe=function(tt,et){var rt=W$1("SimpleRope",tt,et),st=et.points,nt=new SimpleRope(rt,st);return nt.applyProps=function(ot,at,lt){var ut=lt.image,ct=lt.texture,dt=G(lt,de);N(Array.isArray(lt.points),"SimpleRope points needs to be %s","Array<Point>");var ht=V(ot,at,dt);return(ut||ct)&&(ct!==at.texture&&(ht=!0),ot.texture=W$1("SimpleRope",tt,lt)),ht},nt},me=Object.freeze({__proto__:null,BitmapText:q,Container:X,Graphics:K$1,NineSlicePlane:Z,ParticleContainer:te,Sprite:le,Text:oe,TilingSprite:se,SimpleMesh:fe,SimpleRope:pe,AnimatedSprite:ie});function he(tt,et){var rt=Object.keys(tt);if(Object.getOwnPropertySymbols){var st=Object.getOwnPropertySymbols(tt);et&&(st=st.filter(function(nt){return Object.getOwnPropertyDescriptor(tt,nt).enumerable})),rt.push.apply(rt,st)}return rt}function ge(tt){for(var et=1;et<arguments.length;et++){var rt=arguments[et]!=null?arguments[et]:{};et%2?he(Object(rt),!0).forEach(function(st){_(tt,st,rt[st])}):Object.getOwnPropertyDescriptors?Object.defineProperties(tt,Object.getOwnPropertyDescriptors(rt)):he(Object(rt)).forEach(function(st){Object.defineProperty(tt,st,Object.getOwnPropertyDescriptor(rt,st))})}return tt}var ve={BitmapText:"BitmapText",Container:"Container",Graphics:"Graphics",NineSlicePlane:"NineSlicePlane",ParticleContainer:"ParticleContainer",Sprite:"Sprite",AnimatedSprite:"AnimatedSprite",Text:"Text",TilingSprite:"TilingSprite",SimpleMesh:"SimpleMesh",SimpleRope:"SimpleRope"},ye=Object.keys(ve).reduce(function(tt,et){return ge(ge({},tt),{},_({},et,me[et]))},{}),be={};function Se(tt,et){return N(!!tt,"Expect type to be defined, got `%s`",tt),N(!ve[tt],"Component `%s` could not be created, already exists in default components.",tt),be[tt]=et,tt}var xe,we,ke,Pe,Ee={},_e={},Ce={get exports(){return _e},set exports(tt){_e=tt}},ze={};function Ne(){return we||(we=1,Ce.exports=(xe||(xe=1,function(tt){function et(Mt,Vt){var Bt=Mt.length;Mt.push(Vt);e:for(;0<Bt;){var qt=Bt-1>>>1,Qt=Mt[qt];if(!(0<nt(Qt,Vt)))break e;Mt[qt]=Vt,Mt[Bt]=Qt,Bt=qt}}function rt(Mt){return Mt.length===0?null:Mt[0]}function st(Mt){if(Mt.length===0)return null;var Vt=Mt[0],Bt=Mt.pop();if(Bt!==Vt){Mt[0]=Bt;e:for(var qt=0,Qt=Mt.length,Yt=Qt>>>1;qt<Yt;){var tr=2*(qt+1)-1,lr=Mt[tr],ur=tr+1,mr=Mt[ur];if(0>nt(lr,Bt))ur<Qt&&0>nt(mr,lr)?(Mt[qt]=mr,Mt[ur]=Bt,qt=ur):(Mt[qt]=lr,Mt[tr]=Bt,qt=tr);else{if(!(ur<Qt&&0>nt(mr,Bt)))break e;Mt[qt]=mr,Mt[ur]=Bt,qt=ur}}}return Vt}function nt(Mt,Vt){var Bt=Mt.sortIndex-Vt.sortIndex;return Bt!==0?Bt:Mt.id-Vt.id}if(typeof performance=="object"&&typeof performance.now=="function"){var ot=performance;tt.unstable_now=function(){return ot.now()}}else{var at=Date,lt=at.now();tt.unstable_now=function(){return at.now()-lt}}var ut=[],ct=[],dt=1,ht=null,ft=3,xt=!1,vt=!1,yt=!1,Et=typeof setTimeout=="function"?setTimeout:null,bt=typeof clearTimeout=="function"?clearTimeout:null,wt=typeof setImmediate<"u"?setImmediate:null;function St(Mt){for(var Vt=rt(ct);Vt!==null;){if(Vt.callback===null)st(ct);else{if(!(Vt.startTime<=Mt))break;st(ct),Vt.sortIndex=Vt.expirationTime,et(ut,Vt)}Vt=rt(ct)}}function Rt(Mt){if(yt=!1,St(Mt),!vt)if(rt(ut)!==null)vt=!0,Ft(Ct);else{var Vt=rt(ct);Vt!==null&&Gt(Rt,Vt.startTime-Mt)}}function Ct(Mt,Vt){vt=!1,yt&&(yt=!1,bt(Ot),Ot=-1),xt=!0;var Bt=ft;try{for(St(Vt),ht=rt(ut);ht!==null&&(!(ht.expirationTime>Vt)||Mt&&!Ht());){var qt=ht.callback;if(typeof qt=="function"){ht.callback=null,ft=ht.priorityLevel;var Qt=qt(ht.expirationTime<=Vt);Vt=tt.unstable_now(),typeof Qt=="function"?ht.callback=Qt:ht===rt(ut)&&st(ut),St(Vt)}else st(ut);ht=rt(ut)}if(ht!==null)var Yt=!0;else{var tr=rt(ct);tr!==null&&Gt(Rt,tr.startTime-Vt),Yt=!1}return Yt}finally{ht=null,ft=Bt,xt=!1}}typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);var It,jt=!1,Pt=null,Ot=-1,Ut=5,Nt=-1;function Ht(){return!(tt.unstable_now()-Nt<Ut)}function Lt(){if(Pt!==null){var Mt=tt.unstable_now();Nt=Mt;var Vt=!0;try{Vt=Pt(!0,Mt)}finally{Vt?It():(jt=!1,Pt=null)}}else jt=!1}if(typeof wt=="function")It=function(){wt(Lt)};else if(typeof MessageChannel<"u"){var kt=new MessageChannel,$t=kt.port2;kt.port1.onmessage=Lt,It=function(){$t.postMessage(null)}}else It=function(){Et(Lt,0)};function Ft(Mt){Pt=Mt,jt||(jt=!0,It())}function Gt(Mt,Vt){Ot=Et(function(){Mt(tt.unstable_now())},Vt)}tt.unstable_IdlePriority=5,tt.unstable_ImmediatePriority=1,tt.unstable_LowPriority=4,tt.unstable_NormalPriority=3,tt.unstable_Profiling=null,tt.unstable_UserBlockingPriority=2,tt.unstable_cancelCallback=function(Mt){Mt.callback=null},tt.unstable_continueExecution=function(){vt||xt||(vt=!0,Ft(Ct))},tt.unstable_forceFrameRate=function(Mt){0>Mt||125<Mt?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Ut=0<Mt?Math.floor(1e3/Mt):5},tt.unstable_getCurrentPriorityLevel=function(){return ft},tt.unstable_getFirstCallbackNode=function(){return rt(ut)},tt.unstable_next=function(Mt){switch(ft){case 1:case 2:case 3:var Vt=3;break;default:Vt=ft}var Bt=ft;ft=Vt;try{return Mt()}finally{ft=Bt}},tt.unstable_pauseExecution=function(){},tt.unstable_requestPaint=function(){},tt.unstable_runWithPriority=function(Mt,Vt){switch(Mt){case 1:case 2:case 3:case 4:case 5:break;default:Mt=3}var Bt=ft;ft=Mt;try{return Vt()}finally{ft=Bt}},tt.unstable_scheduleCallback=function(Mt,Vt,Bt){var qt=tt.unstable_now();switch(Bt=typeof Bt=="object"&&Bt!==null&&typeof(Bt=Bt.delay)=="number"&&0<Bt?qt+Bt:qt,Mt){case 1:var Qt=-1;break;case 2:Qt=250;break;case 5:Qt=1073741823;break;case 4:Qt=1e4;break;default:Qt=5e3}return Mt={id:dt++,callback:Vt,priorityLevel:Mt,startTime:Bt,expirationTime:Qt=Bt+Qt,sortIndex:-1},Bt>qt?(Mt.sortIndex=Bt,et(ct,Mt),rt(ut)===null&&Mt===rt(ct)&&(yt?(bt(Ot),Ot=-1):yt=!0,Gt(Rt,Bt-qt))):(Mt.sortIndex=Qt,et(ut,Mt),vt||xt||(vt=!0,Ft(Ct))),Mt},tt.unstable_shouldYield=Ht,tt.unstable_wrapCallback=function(Mt){var Vt=ft;return function(){var Bt=ft;ft=Vt;try{return Mt.apply(this,arguments)}finally{ft=Bt}}}}(ze)),ze)),_e}/**
|
|
1027
1027
|
* @license React
|
|
1028
1028
|
* react-reconciler.production.min.js
|
|
@@ -1035,9 +1035,9 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
1035
1035
|
`+kt+mt}var D1=!1;function k1(mt,gt){if(!mt||D1)return"";D1=!0;var _t=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(gt)if(gt=function(){throw Error()},Object.defineProperty(gt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(gt,[])}catch(ir){var Tt=ir}Reflect.construct(mt,[],gt)}else{try{gt.call()}catch(ir){Tt=ir}mt.call(gt.prototype)}else{try{throw Error()}catch(ir){Tt=ir}mt()}}catch(ir){if(ir&&Tt&&typeof ir.stack=="string"){for(var At=ir.stack.split(`
|
|
1036
1036
|
`),Dt=Tt.stack.split(`
|
|
1037
1037
|
`),Wt=At.length-1,Zt=Dt.length-1;1<=Wt&&0<=Zt&&At[Wt]!==Dt[Zt];)Zt--;for(;1<=Wt&&0<=Zt;Wt--,Zt--)if(At[Wt]!==Dt[Zt]){if(Wt!==1||Zt!==1)do if(Wt--,0>--Zt||At[Wt]!==Dt[Zt]){var rr=`
|
|
1038
|
-
`+At[Wt].replace(" at new "," at ");return mt.displayName&&rr.includes("<anonymous>")&&(rr=rr.replace("<anonymous>",mt.displayName)),rr}while(1<=Wt&&0<=Zt);break}}}finally{D1=!1,Error.prepareStackTrace=_t}return(mt=mt?mt.displayName||mt.name:"")?hu(mt):""}var Sm=Object.prototype.hasOwnProperty,L1=[],Il=-1;function Io(mt){return{current:mt}}function rs(mt){0>Il||(mt.current=L1[Il],L1[Il]=null,Il--)}function Jr(mt,gt){Il++,L1[Il]=mt.current,mt.current=gt}var Mo={},Ts=Io(Mo),Fs=Io(!1),na=Mo;function Ml(mt,gt){var _t=mt.type.contextTypes;if(!_t)return Mo;var Tt=mt.stateNode;if(Tt&&Tt.__reactInternalMemoizedUnmaskedChildContext===gt)return Tt.__reactInternalMemoizedMaskedChildContext;var At,Dt={};for(At in _t)Dt[At]=gt[At];return Tt&&((mt=mt.stateNode).__reactInternalMemoizedUnmaskedChildContext=gt,mt.__reactInternalMemoizedMaskedChildContext=Dt),Dt}function Xs(mt){return(mt=mt.childContextTypes)!=null}function N1(){rs(Fs),rs(Ts)}function u2(mt,gt,_t){if(Ts.current!==Mo)throw Error(ot(168));Jr(Ts,gt),Jr(Fs,_t)}function c2(mt,gt,_t){var Tt=mt.stateNode;if(gt=gt.childContextTypes,typeof Tt.getChildContext!="function")return _t;for(var At in Tt=Tt.getChildContext())if(!(At in gt))throw Error(ot(108,jt(mt)||"Unknown",At));return nt({},_t,Tt)}function zu(mt){return mt=(mt=mt.stateNode)&&mt.__reactInternalMemoizedMergedChildContext||Mo,na=Ts.current,Jr(Ts,mt),Jr(Fs,Fs.current),!0}function d2(mt,gt,_t){var Tt=mt.stateNode;if(!Tt)throw Error(ot(169));_t?(mt=c2(mt,gt,na),Tt.__reactInternalMemoizedMergedChildContext=mt,rs(Fs),rs(Ts),Jr(Ts,mt)):rs(Fs),Jr(Fs,_t)}var Yn=Math.clz32?Math.clz32:function(mt){return(mt>>>=0)===0?32:31-(_m(mt)/Rm|0)|0},_m=Math.log,Rm=Math.LN2,F1=64,B1=4194304;function fu(mt){switch(mt&-mt){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&mt;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&mt;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return mt}}function Uu(mt,gt){var _t=mt.pendingLanes;if(_t===0)return 0;var Tt=0,At=mt.suspendedLanes,Dt=mt.pingedLanes,Wt=268435455&_t;if(Wt!==0){var Zt=Wt&~At;Zt!==0?Tt=fu(Zt):(Dt&=Wt)!==0&&(Tt=fu(Dt))}else(Wt=_t&~At)!==0?Tt=fu(Wt):Dt!==0&&(Tt=fu(Dt));if(Tt===0)return 0;if(gt!==0&>!==Tt&&!(gt&At)&&((At=Tt&-Tt)>=(Dt=gt&-gt)||At===16&&4194240&Dt))return gt;if(4&Tt&&(Tt|=16&_t),(gt=mt.entangledLanes)!==0)for(mt=mt.entanglements,gt&=Tt;0<gt;)At=1<<(_t=31-Yn(gt)),Tt|=mt[_t],gt&=~At;return Tt}function Tm(mt,gt){switch(mt){case 1:case 2:case 4:return gt+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return gt+5e3;default:return-1}}function z1(mt){return(mt=-1073741825&mt.pendingLanes)!==0?mt:1073741824&mt?1073741824:0}function h2(){var mt=F1;return!(4194240&(F1<<=1))&&(F1=64),mt}function U1(mt){for(var gt=[],_t=0;31>_t;_t++)gt.push(mt);return gt}function pu(mt,gt,_t){mt.pendingLanes|=gt,gt!==536870912&&(mt.suspendedLanes=0,mt.pingedLanes=0),(mt=mt.eventTimes)[gt=31-Yn(gt)]=_t}function H1(mt,gt){var _t=mt.entangledLanes|=gt;for(mt=mt.entanglements;_t;){var Tt=31-Yn(_t),At=1<<Tt;At>|mt[Tt]>&&(mt[Tt]|=gt),_t&=~At}}var qr=0;function f2(mt){return 1<(mt&=-mt)?4<mt?268435455&mt?16:536870912:4:1}var V1=st.unstable_scheduleCallback,p2=st.unstable_cancelCallback,Cm=st.unstable_shouldYield,Am=st.unstable_requestPaint,gs=st.unstable_now,G1=st.unstable_ImmediatePriority,Pm=st.unstable_UserBlockingPriority,m2=st.unstable_NormalPriority,jm=st.unstable_IdlePriority,Hu=null,io=null,Kn=typeof Object.is=="function"?Object.is:function(mt,gt){return mt===gt&&(mt!==0||1/mt==1/gt)||mt!=mt&>!=gt},So=null,Vu=!1,W1=!1;function g2(mt){So===null?So=[mt]:So.push(mt)}function oo(){if(!W1&&So!==null){W1=!0;var mt=0,gt=qr;try{var _t=So;for(qr=1;mt<_t.length;mt++){var Tt=_t[mt];do Tt=Tt(!0);while(Tt!==null)}So=null,Vu=!1}catch(At){throw So!==null&&(So=So.slice(mt+1)),V1(G1,oo),At}finally{qr=gt,W1=!1}}return null}var $l=[],Ol=0,Gu=null,Wu=0,$n=[],Fn=0,ga=null,ao=1,_o="";function xa(mt,gt){$l[Ol++]=Wu,$l[Ol++]=Gu,Gu=mt,Wu=gt}function x2(mt,gt,_t){$n[Fn++]=ao,$n[Fn++]=_o,$n[Fn++]=ga,ga=mt;var Tt=ao;mt=_o;var At=32-Yn(Tt)-1;Tt&=~(1<<At),_t+=1;var Dt=32-Yn(gt)+At;if(30<Dt){var Wt=At-At%5;Dt=(Tt&(1<<Wt)-1).toString(32),Tt>>=Wt,At-=Wt,ao=1<<32-Yn(gt)+At|_t<<At|Tt,_o=Dt+mt}else ao=1<<Dt|_t<<At|Tt,_o=mt}function q1(mt){mt.return!==null&&(xa(mt,1),x2(mt,1,0))}function X1(mt){for(;mt===Gu;)Gu=$l[--Ol],$l[Ol]=null,Wu=$l[--Ol],$l[Ol]=null;for(;mt===ga;)ga=$n[--Fn],$n[Fn]=null,_o=$n[--Fn],$n[Fn]=null,ao=$n[--Fn],$n[Fn]=null}var Ys=null,Bn=null,ss=!1,mu=!1,Qn=null;function v2(mt,gt){var _t=Wn(5,null,null,0);_t.elementType="DELETED",_t.stateNode=gt,_t.return=mt,(gt=mt.deletions)===null?(mt.deletions=[_t],mt.flags|=16):gt.push(_t)}function y2(mt,gt){switch(mt.tag){case 5:return(gt=hs(gt,mt.type,mt.pendingProps))!==null&&(mt.stateNode=gt,Ys=mt,Bn=du(gt),!0);case 6:return(gt=ro(gt,mt.pendingProps))!==null&&(mt.stateNode=gt,Ys=mt,Bn=null,!0);case 13:if((gt=An(gt))!==null){var _t=ga!==null?{id:ao,overflow:_o}:null;return mt.memoizedState={dehydrated:gt,treeContext:_t,retryLane:1073741824},(_t=Wn(18,null,null,0)).stateNode=gt,_t.return=mt,mt.child=_t,Ys=mt,Bn=null,!0}return!1;default:return!1}}function Y1(mt){return(1&mt.mode)!=0&&(128&mt.flags)==0}function K1(mt){if(ss){var gt=Bn;if(gt){var _t=gt;if(!y2(mt,gt)){if(Y1(mt))throw Error(ot(418));gt=no(_t);var Tt=Ys;gt&&y2(mt,gt)?v2(Tt,_t):(mt.flags=-4097&mt.flags|2,ss=!1,Ys=mt)}}else{if(Y1(mt))throw Error(ot(418));mt.flags=-4097&mt.flags|2,ss=!1,Ys=mt}}}function E2(mt){for(mt=mt.return;mt!==null&&mt.tag!==5&&mt.tag!==3&&mt.tag!==13;)mt=mt.return;Ys=mt}function qu(mt){if(!Ar||mt!==Ys)return!1;if(!ss)return E2(mt),ss=!0,!1;if(mt.tag!==3&&(mt.tag!==5||Em(mt.type)&&!lr(mt.type,mt.memoizedProps))){var gt=Bn;if(gt){if(Y1(mt))throw b2(),Error(ot(418));for(;gt;)v2(mt,gt),gt=no(gt)}}if(E2(mt),mt.tag===13){if(!Ar)throw Error(ot(316));if(!(mt=(mt=mt.memoizedState)!==null?mt.dehydrated:null))throw Error(ot(317));Bn=mm(mt)}else Bn=Ys?no(mt.stateNode):null;return!0}function b2(){for(var mt=Bn;mt;)mt=no(mt)}function Dl(){Ar&&(Bn=Ys=null,mu=ss=!1)}function Q1(mt){Qn===null?Qn=[mt]:Qn.push(mt)}var Im=at.ReactCurrentBatchConfig;function Xu(mt,gt){if(Kn(mt,gt))return!0;if(typeof mt!="object"||mt===null||typeof gt!="object"||gt===null)return!1;var _t=Object.keys(mt),Tt=Object.keys(gt);if(_t.length!==Tt.length)return!1;for(Tt=0;Tt<_t.length;Tt++){var At=_t[Tt];if(!Sm.call(gt,At)||!Kn(mt[At],gt[At]))return!1}return!0}function Mm(mt){switch(mt.tag){case 5:return hu(mt.type);case 16:return hu("Lazy");case 13:return hu("Suspense");case 19:return hu("SuspenseList");case 0:case 2:case 15:return mt=k1(mt.type,!1);case 11:return mt=k1(mt.type.render,!1);case 1:return mt=k1(mt.type,!0);default:return""}}function Zn(mt,gt){if(mt&&mt.defaultProps){for(var _t in gt=nt({},gt),mt=mt.defaultProps)gt[_t]===void 0&&(gt[_t]=mt[_t]);return gt}return gt}var Yu=Io(null),Ku=null,Ll=null,Z1=null;function J1(){Z1=Ll=Ku=null}function w2(mt,gt,_t){hr?(Jr(Yu,gt._currentValue),gt._currentValue=_t):(Jr(Yu,gt._currentValue2),gt._currentValue2=_t)}function e0(mt){var gt=Yu.current;rs(Yu),hr?mt._currentValue=gt:mt._currentValue2=gt}function t0(mt,gt,_t){for(;mt!==null;){var Tt=mt.alternate;if((mt.childLanes>)!==gt?(mt.childLanes|=gt,Tt!==null&&(Tt.childLanes|=gt)):Tt!==null&&(Tt.childLanes>)!==gt&&(Tt.childLanes|=gt),mt===_t)break;mt=mt.return}}function Nl(mt,gt){Ku=mt,Z1=Ll=null,(mt=mt.dependencies)!==null&&mt.firstContext!==null&&(mt.lanes>&&(Bs=!0),mt.firstContext=null)}function Un(mt){var gt=hr?mt._currentValue:mt._currentValue2;if(Z1!==mt)if(mt={context:mt,memoizedValue:gt,next:null},Ll===null){if(Ku===null)throw Error(ot(308));Ll=mt,Ku.dependencies={lanes:0,firstContext:mt}}else Ll=Ll.next=mt;return gt}var ba=null;function r0(mt){ba===null?ba=[mt]:ba.push(mt)}function S2(mt,gt,_t,Tt){var At=gt.interleaved;return At===null?(_t.next=_t,r0(gt)):(_t.next=At.next,At.next=_t),gt.interleaved=_t,lo(mt,Tt)}function lo(mt,gt){mt.lanes|=gt;var _t=mt.alternate;for(_t!==null&&(_t.lanes|=gt),_t=mt,mt=mt.return;mt!==null;)mt.childLanes|=gt,(_t=mt.alternate)!==null&&(_t.childLanes|=gt),_t=mt,mt=mt.return;return _t.tag===3?_t.stateNode:null}var $o=!1;function s0(mt){mt.updateQueue={baseState:mt.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function _2(mt,gt){mt=mt.updateQueue,gt.updateQueue===mt&&(gt.updateQueue={baseState:mt.baseState,firstBaseUpdate:mt.firstBaseUpdate,lastBaseUpdate:mt.lastBaseUpdate,shared:mt.shared,effects:mt.effects})}function Ro(mt,gt){return{eventTime:mt,lane:gt,tag:0,payload:null,callback:null,next:null}}function Oo(mt,gt,_t){var Tt=mt.updateQueue;if(Tt===null)return null;if(Tt=Tt.shared,(2&Vr)!=0){var At=Tt.pending;return At===null?gt.next=gt:(gt.next=At.next,At.next=gt),Tt.pending=gt,lo(mt,_t)}return(At=Tt.interleaved)===null?(gt.next=gt,r0(Tt)):(gt.next=At.next,At.next=gt),Tt.interleaved=gt,lo(mt,_t)}function Qu(mt,gt,_t){if((gt=gt.updateQueue)!==null&&(gt=gt.shared,(4194240&_t)!=0)){var Tt=gt.lanes;_t|=Tt&=mt.pendingLanes,gt.lanes=_t,H1(mt,_t)}}function R2(mt,gt){var _t=mt.updateQueue,Tt=mt.alternate;if(Tt!==null&&_t===(Tt=Tt.updateQueue)){var At=null,Dt=null;if((_t=_t.firstBaseUpdate)!==null){do{var Wt={eventTime:_t.eventTime,lane:_t.lane,tag:_t.tag,payload:_t.payload,callback:_t.callback,next:null};Dt===null?At=Dt=Wt:Dt=Dt.next=Wt,_t=_t.next}while(_t!==null);Dt===null?At=Dt=gt:Dt=Dt.next=gt}else At=Dt=gt;return _t={baseState:Tt.baseState,firstBaseUpdate:At,lastBaseUpdate:Dt,shared:Tt.shared,effects:Tt.effects},void(mt.updateQueue=_t)}(mt=_t.lastBaseUpdate)===null?_t.firstBaseUpdate=gt:mt.next=gt,_t.lastBaseUpdate=gt}function Zu(mt,gt,_t,Tt){var At=mt.updateQueue;$o=!1;var Dt=At.firstBaseUpdate,Wt=At.lastBaseUpdate,Zt=At.shared.pending;if(Zt!==null){At.shared.pending=null;var rr=Zt,ir=rr.next;rr.next=null,Wt===null?Dt=ir:Wt.next=ir,Wt=rr;var cr=mt.alternate;cr!==null&&(Zt=(cr=cr.updateQueue).lastBaseUpdate)!==Wt&&(Zt===null?cr.firstBaseUpdate=ir:Zt.next=ir,cr.lastBaseUpdate=rr)}if(Dt!==null){var wr=At.baseState;for(Wt=0,cr=ir=rr=null,Zt=Dt;;){var ar=Zt.lane,Er=Zt.eventTime;if((Tt&ar)===ar){cr!==null&&(cr=cr.next={eventTime:Er,lane:0,tag:Zt.tag,payload:Zt.payload,callback:Zt.callback,next:null});e:{var Cr=mt,Nr=Zt;switch(ar=gt,Er=_t,Nr.tag){case 1:if(typeof(Cr=Nr.payload)=="function"){wr=Cr.call(Er,wr,ar);break e}wr=Cr;break e;case 3:Cr.flags=-65537&Cr.flags|128;case 0:if((ar=typeof(Cr=Nr.payload)=="function"?Cr.call(Er,wr,ar):Cr)==null)break e;wr=nt({},wr,ar);break e;case 2:$o=!0}}Zt.callback!==null&&Zt.lane!==0&&(mt.flags|=64,(ar=At.effects)===null?At.effects=[Zt]:ar.push(Zt))}else Er={eventTime:Er,lane:ar,tag:Zt.tag,payload:Zt.payload,callback:Zt.callback,next:null},cr===null?(ir=cr=Er,rr=wr):cr=cr.next=Er,Wt|=ar;if((Zt=Zt.next)===null){if((Zt=At.shared.pending)===null)break;Zt=(ar=Zt).next,ar.next=null,At.lastBaseUpdate=ar,At.shared.pending=null}}if(cr===null&&(rr=wr),At.baseState=rr,At.firstBaseUpdate=ir,At.lastBaseUpdate=cr,(gt=At.shared.interleaved)!==null){At=gt;do Wt|=At.lane,At=At.next;while(At!==gt)}else Dt===null&&(At.shared.lanes=0);$a|=Wt,mt.lanes=Wt,mt.memoizedState=wr}}function T2(mt,gt,_t){if(mt=gt.effects,gt.effects=null,mt!==null)for(gt=0;gt<mt.length;gt++){var Tt=mt[gt],At=Tt.callback;if(At!==null){if(Tt.callback=null,Tt=_t,typeof At!="function")throw Error(ot(191,At));At.call(Tt)}}}var C2=new rt.Component().refs;function n0(mt,gt,_t,Tt){_t=(_t=_t(Tt,gt=mt.memoizedState))==null?gt:nt({},gt,_t),mt.memoizedState=_t,mt.lanes===0&&(mt.updateQueue.baseState=_t)}var Ju={isMounted:function(mt){return!!(mt=mt._reactInternals)&&Pt(mt)===mt},enqueueSetState:function(mt,gt,_t){mt=mt._reactInternals;var Tt=Ps(),At=No(mt),Dt=Ro(Tt,At);Dt.payload=gt,_t!=null&&(Dt.callback=_t),(gt=Oo(mt,Dt,At))!==null&&(Gn(gt,mt,At,Tt),Qu(gt,mt,At))},enqueueReplaceState:function(mt,gt,_t){mt=mt._reactInternals;var Tt=Ps(),At=No(mt),Dt=Ro(Tt,At);Dt.tag=1,Dt.payload=gt,_t!=null&&(Dt.callback=_t),(gt=Oo(mt,Dt,At))!==null&&(Gn(gt,mt,At,Tt),Qu(gt,mt,At))},enqueueForceUpdate:function(mt,gt){mt=mt._reactInternals;var _t=Ps(),Tt=No(mt),At=Ro(_t,Tt);At.tag=2,gt!=null&&(At.callback=gt),(gt=Oo(mt,At,Tt))!==null&&(Gn(gt,mt,Tt,_t),Qu(gt,mt,Tt))}};function A2(mt,gt,_t,Tt,At,Dt,Wt){return typeof(mt=mt.stateNode).shouldComponentUpdate=="function"?mt.shouldComponentUpdate(Tt,Dt,Wt):!gt.prototype||!gt.prototype.isPureReactComponent||!Xu(_t,Tt)||!Xu(At,Dt)}function P2(mt,gt,_t){var Tt=!1,At=Mo,Dt=gt.contextType;return typeof Dt=="object"&&Dt!==null?Dt=Un(Dt):(At=Xs(gt)?na:Ts.current,Dt=(Tt=(Tt=gt.contextTypes)!=null)?Ml(mt,At):Mo),gt=new gt(_t,Dt),mt.memoizedState=gt.state!==null&>.state!==void 0?gt.state:null,gt.updater=Ju,mt.stateNode=gt,gt._reactInternals=mt,Tt&&((mt=mt.stateNode).__reactInternalMemoizedUnmaskedChildContext=At,mt.__reactInternalMemoizedMaskedChildContext=Dt),gt}function j2(mt,gt,_t,Tt){mt=gt.state,typeof gt.componentWillReceiveProps=="function"&>.componentWillReceiveProps(_t,Tt),typeof gt.UNSAFE_componentWillReceiveProps=="function"&>.UNSAFE_componentWillReceiveProps(_t,Tt),gt.state!==mt&&Ju.enqueueReplaceState(gt,gt.state,null)}function i0(mt,gt,_t,Tt){var At=mt.stateNode;At.props=_t,At.state=mt.memoizedState,At.refs=C2,s0(mt);var Dt=gt.contextType;typeof Dt=="object"&&Dt!==null?At.context=Un(Dt):(Dt=Xs(gt)?na:Ts.current,At.context=Ml(mt,Dt)),At.state=mt.memoizedState,typeof(Dt=gt.getDerivedStateFromProps)=="function"&&(n0(mt,gt,Dt,_t),At.state=mt.memoizedState),typeof gt.getDerivedStateFromProps=="function"||typeof At.getSnapshotBeforeUpdate=="function"||typeof At.UNSAFE_componentWillMount!="function"&&typeof At.componentWillMount!="function"||(gt=At.state,typeof At.componentWillMount=="function"&&At.componentWillMount(),typeof At.UNSAFE_componentWillMount=="function"&&At.UNSAFE_componentWillMount(),gt!==At.state&&Ju.enqueueReplaceState(At,At.state,null),Zu(mt,_t,At,Tt),At.state=mt.memoizedState),typeof At.componentDidMount=="function"&&(mt.flags|=4194308)}function gu(mt,gt,_t){if((mt=_t.ref)!==null&&typeof mt!="function"&&typeof mt!="object"){if(_t._owner){if(_t=_t._owner){if(_t.tag!==1)throw Error(ot(309));var Tt=_t.stateNode}if(!Tt)throw Error(ot(147,mt));var At=Tt,Dt=""+mt;return gt!==null&>.ref!==null&&typeof gt.ref=="function"&>.ref._stringRef===Dt?gt.ref:(gt=function(Wt){var Zt=At.refs;Zt===C2&&(Zt=At.refs={}),Wt===null?delete Zt[Dt]:Zt[Dt]=Wt},gt._stringRef=Dt,gt)}if(typeof mt!="string")throw Error(ot(284));if(!_t._owner)throw Error(ot(290,mt))}return mt}function _c(mt,gt){throw mt=Object.prototype.toString.call(gt),Error(ot(31,mt==="[object Object]"?"object with keys {"+Object.keys(gt).join(", ")+"}":mt))}function I2(mt){return(0,mt._init)(mt._payload)}function M2(mt){function gt(dr,Jt){if(mt){var nr=dr.deletions;nr===null?(dr.deletions=[Jt],dr.flags|=16):nr.push(Jt)}}function _t(dr,Jt){if(!mt)return null;for(;Jt!==null;)gt(dr,Jt),Jt=Jt.sibling;return null}function Tt(dr,Jt){for(dr=new Map;Jt!==null;)Jt.key!==null?dr.set(Jt.key,Jt):dr.set(Jt.index,Jt),Jt=Jt.sibling;return dr}function At(dr,Jt){return(dr=Bo(dr,Jt)).index=0,dr.sibling=null,dr}function Dt(dr,Jt,nr){return dr.index=nr,mt?(nr=dr.alternate)!==null?(nr=nr.index)<Jt?(dr.flags|=2,Jt):nr:(dr.flags|=2,Jt):(dr.flags|=1048576,Jt)}function Wt(dr){return mt&&dr.alternate===null&&(dr.flags|=2),dr}function Zt(dr,Jt,nr,xr){return Jt===null||Jt.tag!==6?((Jt=G0(nr,dr.mode,xr)).return=dr,Jt):((Jt=At(Jt,nr)).return=dr,Jt)}function rr(dr,Jt,nr,xr){var Mr=nr.type;return Mr===ct?cr(dr,Jt,nr.props.children,xr,nr.key):Jt!==null&&(Jt.elementType===Mr||typeof Mr=="object"&&Mr!==null&&Mr.$$typeof===wt&&I2(Mr)===Jt.type)?((xr=At(Jt,nr.props)).ref=gu(dr,Jt,nr),xr.return=dr,xr):((xr=R1(nr.type,nr.key,nr.props,null,dr.mode,xr)).ref=gu(dr,Jt,nr),xr.return=dr,xr)}function ir(dr,Jt,nr,xr){return Jt===null||Jt.tag!==4||Jt.stateNode.containerInfo!==nr.containerInfo||Jt.stateNode.implementation!==nr.implementation?((Jt=W0(nr,dr.mode,xr)).return=dr,Jt):((Jt=At(Jt,nr.children||[])).return=dr,Jt)}function cr(dr,Jt,nr,xr,Mr){return Jt===null||Jt.tag!==7?((Jt=El(nr,dr.mode,xr,Mr)).return=dr,Jt):((Jt=At(Jt,nr)).return=dr,Jt)}function wr(dr,Jt,nr){if(typeof Jt=="string"&&Jt!==""||typeof Jt=="number")return(Jt=G0(""+Jt,dr.mode,nr)).return=dr,Jt;if(typeof Jt=="object"&&Jt!==null){switch(Jt.$$typeof){case lt:return(nr=R1(Jt.type,Jt.key,Jt.props,null,dr.mode,nr)).ref=gu(dr,null,Jt),nr.return=dr,nr;case ut:return(Jt=W0(Jt,dr.mode,nr)).return=dr,Jt;case wt:return wr(dr,(0,Jt._init)(Jt._payload),nr)}if($t(Jt)||Ct(Jt))return(Jt=El(Jt,dr.mode,nr,null)).return=dr,Jt;_c(dr,Jt)}return null}function ar(dr,Jt,nr,xr){var Mr=Jt!==null?Jt.key:null;if(typeof nr=="string"&&nr!==""||typeof nr=="number")return Mr!==null?null:Zt(dr,Jt,""+nr,xr);if(typeof nr=="object"&&nr!==null){switch(nr.$$typeof){case lt:return nr.key===Mr?rr(dr,Jt,nr,xr):null;case ut:return nr.key===Mr?ir(dr,Jt,nr,xr):null;case wt:return ar(dr,Jt,(Mr=nr._init)(nr._payload),xr)}if($t(nr)||Ct(nr))return Mr!==null?null:cr(dr,Jt,nr,xr,null);_c(dr,nr)}return null}function Er(dr,Jt,nr,xr,Mr){if(typeof xr=="string"&&xr!==""||typeof xr=="number")return Zt(Jt,dr=dr.get(nr)||null,""+xr,Mr);if(typeof xr=="object"&&xr!==null){switch(xr.$$typeof){case lt:return rr(Jt,dr=dr.get(xr.key===null?nr:xr.key)||null,xr,Mr);case ut:return ir(Jt,dr=dr.get(xr.key===null?nr:xr.key)||null,xr,Mr);case wt:return Er(dr,Jt,nr,(0,xr._init)(xr._payload),Mr)}if($t(xr)||Ct(xr))return cr(Jt,dr=dr.get(nr)||null,xr,Mr,null);_c(Jt,xr)}return null}function Cr(dr,Jt,nr,xr){for(var Mr=null,Yr=null,Pr=Jt,Xr=Jt=0,_s=null;Pr!==null&&Xr<nr.length;Xr++){Pr.index>Xr?(_s=Pr,Pr=null):_s=Pr.sibling;var Kr=ar(dr,Pr,nr[Xr],xr);if(Kr===null){Pr===null&&(Pr=_s);break}mt&&Pr&&Kr.alternate===null&>(dr,Pr),Jt=Dt(Kr,Jt,Xr),Yr===null?Mr=Kr:Yr.sibling=Kr,Yr=Kr,Pr=_s}if(Xr===nr.length)return _t(dr,Pr),ss&&xa(dr,Xr),Mr;if(Pr===null){for(;Xr<nr.length;Xr++)(Pr=wr(dr,nr[Xr],xr))!==null&&(Jt=Dt(Pr,Jt,Xr),Yr===null?Mr=Pr:Yr.sibling=Pr,Yr=Pr);return ss&&xa(dr,Xr),Mr}for(Pr=Tt(dr,Pr);Xr<nr.length;Xr++)(_s=Er(Pr,dr,Xr,nr[Xr],xr))!==null&&(mt&&_s.alternate!==null&&Pr.delete(_s.key===null?Xr:_s.key),Jt=Dt(_s,Jt,Xr),Yr===null?Mr=_s:Yr.sibling=_s,Yr=_s);return mt&&Pr.forEach(function(zo){return gt(dr,zo)}),ss&&xa(dr,Xr),Mr}function Nr(dr,Jt,nr,xr){var Mr=Ct(nr);if(typeof Mr!="function")throw Error(ot(150));if((nr=Mr.call(nr))==null)throw Error(ot(151));for(var Yr=Mr=null,Pr=Jt,Xr=Jt=0,_s=null,Kr=nr.next();Pr!==null&&!Kr.done;Xr++,Kr=nr.next()){Pr.index>Xr?(_s=Pr,Pr=null):_s=Pr.sibling;var zo=ar(dr,Pr,Kr.value,xr);if(zo===null){Pr===null&&(Pr=_s);break}mt&&Pr&&zo.alternate===null&>(dr,Pr),Jt=Dt(zo,Jt,Xr),Yr===null?Mr=zo:Yr.sibling=zo,Yr=zo,Pr=_s}if(Kr.done)return _t(dr,Pr),ss&&xa(dr,Xr),Mr;if(Pr===null){for(;!Kr.done;Xr++,Kr=nr.next())(Kr=wr(dr,Kr.value,xr))!==null&&(Jt=Dt(Kr,Jt,Xr),Yr===null?Mr=Kr:Yr.sibling=Kr,Yr=Kr);return ss&&xa(dr,Xr),Mr}for(Pr=Tt(dr,Pr);!Kr.done;Xr++,Kr=nr.next())(Kr=Er(Pr,dr,Xr,Kr.value,xr))!==null&&(mt&&Kr.alternate!==null&&Pr.delete(Kr.key===null?Xr:Kr.key),Jt=Dt(Kr,Jt,Xr),Yr===null?Mr=Kr:Yr.sibling=Kr,Yr=Kr);return mt&&Pr.forEach(function(r3){return gt(dr,r3)}),ss&&xa(dr,Xr),Mr}return function dr(Jt,nr,xr,Mr){if(typeof xr=="object"&&xr!==null&&xr.type===ct&&xr.key===null&&(xr=xr.props.children),typeof xr=="object"&&xr!==null){switch(xr.$$typeof){case lt:e:{for(var Yr=xr.key,Pr=nr;Pr!==null;){if(Pr.key===Yr){if((Yr=xr.type)===ct){if(Pr.tag===7){_t(Jt,Pr.sibling),(nr=At(Pr,xr.props.children)).return=Jt,Jt=nr;break e}}else if(Pr.elementType===Yr||typeof Yr=="object"&&Yr!==null&&Yr.$$typeof===wt&&I2(Yr)===Pr.type){_t(Jt,Pr.sibling),(nr=At(Pr,xr.props)).ref=gu(Jt,Pr,xr),nr.return=Jt,Jt=nr;break e}_t(Jt,Pr);break}gt(Jt,Pr),Pr=Pr.sibling}xr.type===ct?((nr=El(xr.props.children,Jt.mode,Mr,xr.key)).return=Jt,Jt=nr):((Mr=R1(xr.type,xr.key,xr.props,null,Jt.mode,Mr)).ref=gu(Jt,nr,xr),Mr.return=Jt,Jt=Mr)}return Wt(Jt);case ut:e:{for(Pr=xr.key;nr!==null;){if(nr.key===Pr){if(nr.tag===4&&nr.stateNode.containerInfo===xr.containerInfo&&nr.stateNode.implementation===xr.implementation){_t(Jt,nr.sibling),(nr=At(nr,xr.children||[])).return=Jt,Jt=nr;break e}_t(Jt,nr);break}gt(Jt,nr),nr=nr.sibling}(nr=W0(xr,Jt.mode,Mr)).return=Jt,Jt=nr}return Wt(Jt);case wt:return dr(Jt,nr,(Pr=xr._init)(xr._payload),Mr)}if($t(xr))return Cr(Jt,nr,xr,Mr);if(Ct(xr))return Nr(Jt,nr,xr,Mr);_c(Jt,xr)}return typeof xr=="string"&&xr!==""||typeof xr=="number"?(xr=""+xr,nr!==null&&nr.tag===6?(_t(Jt,nr.sibling),(nr=At(nr,xr)).return=Jt,Jt=nr):(_t(Jt,nr),(nr=G0(xr,Jt.mode,Mr)).return=Jt,Jt=nr),Wt(Jt)):_t(Jt,nr)}}var Fl=M2(!0),$2=M2(!1),xu={},Hn=Io(xu),vu=Io(xu),Bl=Io(xu);function uo(mt){if(mt===xu)throw Error(ot(174));return mt}function o0(mt,gt){Jr(Bl,gt),Jr(vu,mt),Jr(Hn,xu),mt=Gt(gt),rs(Hn),Jr(Hn,mt)}function zl(){rs(Hn),rs(vu),rs(Bl)}function O2(mt){var gt=uo(Bl.current),_t=uo(Hn.current);_t!==(gt=Mt(_t,mt.type,gt))&&(Jr(vu,mt),Jr(Hn,gt))}function a0(mt){vu.current===mt&&(rs(Hn),rs(vu))}var ls=Io(0);function e1(mt){for(var gt=mt;gt!==null;){if(gt.tag===13){var _t=gt.memoizedState;if(_t!==null&&((_t=_t.dehydrated)===null||Mn(_t)||wo(_t)))return gt}else if(gt.tag===19&>.memoizedProps.revealOrder!==void 0){if(128>.flags)return gt}else if(gt.child!==null){gt.child.return=gt,gt=gt.child;continue}if(gt===mt)break;for(;gt.sibling===null;){if(gt.return===null||gt.return===mt)return null;gt=gt.return}gt.sibling.return=gt.return,gt=gt.sibling}return null}var l0=[];function u0(){for(var mt=0;mt<l0.length;mt++){var gt=l0[mt];hr?gt._workInProgressVersionPrimary=null:gt._workInProgressVersionSecondary=null}l0.length=0}var t1=at.ReactCurrentDispatcher,c0=at.ReactCurrentBatchConfig,_a=0,as=null,xs=null,vs=null,r1=!1,yu=!1,Eu=0,$m=0;function Cs(){throw Error(ot(321))}function d0(mt,gt){if(gt===null)return!1;for(var _t=0;_t<gt.length&&_t<mt.length;_t++)if(!Kn(mt[_t],gt[_t]))return!1;return!0}function h0(mt,gt,_t,Tt,At,Dt){if(_a=Dt,as=gt,gt.memoizedState=null,gt.updateQueue=null,gt.lanes=0,t1.current=mt===null||mt.memoizedState===null?Lm:Nm,mt=_t(Tt,At),yu){Dt=0;do{if(yu=!1,Eu=0,25<=Dt)throw Error(ot(301));Dt+=1,vs=xs=null,gt.updateQueue=null,t1.current=Fm,mt=_t(Tt,At)}while(yu)}if(t1.current=i1,gt=xs!==null&&xs.next!==null,_a=0,vs=xs=as=null,r1=!1,gt)throw Error(ot(300));return mt}function f0(){var mt=Eu!==0;return Eu=0,mt}function co(){var mt={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vs===null?as.memoizedState=vs=mt:vs=vs.next=mt,vs}function Vn(){if(xs===null){var mt=as.alternate;mt=mt!==null?mt.memoizedState:null}else mt=xs.next;var gt=vs===null?as.memoizedState:vs.next;if(gt!==null)vs=gt,xs=mt;else{if(mt===null)throw Error(ot(310));mt={memoizedState:(xs=mt).memoizedState,baseState:xs.baseState,baseQueue:xs.baseQueue,queue:xs.queue,next:null},vs===null?as.memoizedState=vs=mt:vs=vs.next=mt}return vs}function bu(mt,gt){return typeof gt=="function"?gt(mt):gt}function p0(mt){var gt=Vn(),_t=gt.queue;if(_t===null)throw Error(ot(311));_t.lastRenderedReducer=mt;var Tt=xs,At=Tt.baseQueue,Dt=_t.pending;if(Dt!==null){if(At!==null){var Wt=At.next;At.next=Dt.next,Dt.next=Wt}Tt.baseQueue=At=Dt,_t.pending=null}if(At!==null){Dt=At.next,Tt=Tt.baseState;var Zt=Wt=null,rr=null,ir=Dt;do{var cr=ir.lane;if((_a&cr)===cr)rr!==null&&(rr=rr.next={lane:0,action:ir.action,hasEagerState:ir.hasEagerState,eagerState:ir.eagerState,next:null}),Tt=ir.hasEagerState?ir.eagerState:mt(Tt,ir.action);else{var wr={lane:cr,action:ir.action,hasEagerState:ir.hasEagerState,eagerState:ir.eagerState,next:null};rr===null?(Zt=rr=wr,Wt=Tt):rr=rr.next=wr,as.lanes|=cr,$a|=cr}ir=ir.next}while(ir!==null&&ir!==Dt);rr===null?Wt=Tt:rr.next=Zt,Kn(Tt,gt.memoizedState)||(Bs=!0),gt.memoizedState=Tt,gt.baseState=Wt,gt.baseQueue=rr,_t.lastRenderedState=Tt}if((mt=_t.interleaved)!==null){At=mt;do Dt=At.lane,as.lanes|=Dt,$a|=Dt,At=At.next;while(At!==mt)}else At===null&&(_t.lanes=0);return[gt.memoizedState,_t.dispatch]}function m0(mt){var gt=Vn(),_t=gt.queue;if(_t===null)throw Error(ot(311));_t.lastRenderedReducer=mt;var Tt=_t.dispatch,At=_t.pending,Dt=gt.memoizedState;if(At!==null){_t.pending=null;var Wt=At=At.next;do Dt=mt(Dt,Wt.action),Wt=Wt.next;while(Wt!==At);Kn(Dt,gt.memoizedState)||(Bs=!0),gt.memoizedState=Dt,gt.baseQueue===null&&(gt.baseState=Dt),_t.lastRenderedState=Dt}return[Dt,Tt]}function D2(){}function k2(mt,gt){var _t=as,Tt=Vn(),At=gt(),Dt=!Kn(Tt.memoizedState,At);if(Dt&&(Tt.memoizedState=At,Bs=!0),Tt=Tt.queue,g0(F2.bind(null,_t,Tt,mt),[mt]),Tt.getSnapshot!==gt||Dt||vs!==null&&1&vs.memoizedState.tag){if(_t.flags|=2048,wu(9,N2.bind(null,_t,Tt,At,gt),void 0,null),ys===null)throw Error(ot(349));30&_a||L2(_t,gt,At)}return At}function L2(mt,gt,_t){mt.flags|=16384,mt={getSnapshot:gt,value:_t},(gt=as.updateQueue)===null?(gt={lastEffect:null,stores:null},as.updateQueue=gt,gt.stores=[mt]):(_t=gt.stores)===null?gt.stores=[mt]:_t.push(mt)}function N2(mt,gt,_t,Tt){gt.value=_t,gt.getSnapshot=Tt,B2(gt)&&z2(mt)}function F2(mt,gt,_t){return _t(function(){B2(gt)&&z2(mt)})}function B2(mt){var gt=mt.getSnapshot;mt=mt.value;try{var _t=gt();return!Kn(mt,_t)}catch{return!0}}function z2(mt){var gt=lo(mt,1);gt!==null&&Gn(gt,mt,1,-1)}function U2(mt){var gt=co();return typeof mt=="function"&&(mt=mt()),gt.memoizedState=gt.baseState=mt,mt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bu,lastRenderedState:mt},gt.queue=mt,mt=mt.dispatch=km.bind(null,as,mt),[gt.memoizedState,mt]}function wu(mt,gt,_t,Tt){return mt={tag:mt,create:gt,destroy:_t,deps:Tt,next:null},(gt=as.updateQueue)===null?(gt={lastEffect:null,stores:null},as.updateQueue=gt,gt.lastEffect=mt.next=mt):(_t=gt.lastEffect)===null?gt.lastEffect=mt.next=mt:(Tt=_t.next,_t.next=mt,mt.next=Tt,gt.lastEffect=mt),mt}function H2(){return Vn().memoizedState}function s1(mt,gt,_t,Tt){var At=co();as.flags|=mt,At.memoizedState=wu(1|gt,_t,void 0,Tt===void 0?null:Tt)}function n1(mt,gt,_t,Tt){var At=Vn();Tt=Tt===void 0?null:Tt;var Dt=void 0;if(xs!==null){var Wt=xs.memoizedState;if(Dt=Wt.destroy,Tt!==null&&d0(Tt,Wt.deps))return void(At.memoizedState=wu(gt,_t,Dt,Tt))}as.flags|=mt,At.memoizedState=wu(1|gt,_t,Dt,Tt)}function V2(mt,gt){return s1(8390656,8,mt,gt)}function g0(mt,gt){return n1(2048,8,mt,gt)}function G2(mt,gt){return n1(4,2,mt,gt)}function W2(mt,gt){return n1(4,4,mt,gt)}function q2(mt,gt){return typeof gt=="function"?(mt=mt(),gt(mt),function(){gt(null)}):gt!=null?(mt=mt(),gt.current=mt,function(){gt.current=null}):void 0}function X2(mt,gt,_t){return _t=_t!=null?_t.concat([mt]):null,n1(4,4,q2.bind(null,gt,mt),_t)}function x0(){}function Y2(mt,gt){var _t=Vn();gt=gt===void 0?null:gt;var Tt=_t.memoizedState;return Tt!==null&>!==null&&d0(gt,Tt[1])?Tt[0]:(_t.memoizedState=[mt,gt],mt)}function K2(mt,gt){var _t=Vn();gt=gt===void 0?null:gt;var Tt=_t.memoizedState;return Tt!==null&>!==null&&d0(gt,Tt[1])?Tt[0]:(mt=mt(),_t.memoizedState=[mt,gt],mt)}function Q2(mt,gt,_t){return 21&_a?(Kn(_t,gt)||(_t=h2(),as.lanes|=_t,$a|=_t,mt.baseState=!0),gt):(mt.baseState&&(mt.baseState=!1,Bs=!0),mt.memoizedState=_t)}function Om(mt,gt){var _t=qr;qr=_t!==0&&4>_t?_t:4,mt(!0);var Tt=c0.transition;c0.transition={};try{mt(!1),gt()}finally{qr=_t,c0.transition=Tt}}function Z2(){return Vn().memoizedState}function Dm(mt,gt,_t){var Tt=No(mt);_t={lane:Tt,action:_t,hasEagerState:!1,eagerState:null,next:null},J2(mt)?_h(gt,_t):(_t=S2(mt,gt,_t,Tt))!==null&&(Gn(_t,mt,Tt,Ps()),_f(_t,gt,Tt))}function km(mt,gt,_t){var Tt=No(mt),At={lane:Tt,action:_t,hasEagerState:!1,eagerState:null,next:null};if(J2(mt))_h(gt,At);else{var Dt=mt.alternate;if(mt.lanes===0&&(Dt===null||Dt.lanes===0)&&(Dt=gt.lastRenderedReducer)!==null)try{var Wt=gt.lastRenderedState,Zt=Dt(Wt,_t);if(At.hasEagerState=!0,At.eagerState=Zt,Kn(Zt,Wt)){var rr=gt.interleaved;return rr===null?(At.next=At,r0(gt)):(At.next=rr.next,rr.next=At),void(gt.interleaved=At)}}catch{}(_t=S2(mt,gt,At,Tt))!==null&&(Gn(_t,mt,Tt,At=Ps()),_f(_t,gt,Tt))}}function J2(mt){var gt=mt.alternate;return mt===as||gt!==null&>===as}function _h(mt,gt){yu=r1=!0;var _t=mt.pending;_t===null?gt.next=gt:(gt.next=_t.next,_t.next=gt),mt.pending=gt}function _f(mt,gt,_t){if(4194240&_t){var Tt=gt.lanes;_t|=Tt&=mt.pendingLanes,gt.lanes=_t,H1(mt,_t)}}var i1={readContext:Un,useCallback:Cs,useContext:Cs,useEffect:Cs,useImperativeHandle:Cs,useInsertionEffect:Cs,useLayoutEffect:Cs,useMemo:Cs,useReducer:Cs,useRef:Cs,useState:Cs,useDebugValue:Cs,useDeferredValue:Cs,useTransition:Cs,useMutableSource:Cs,useSyncExternalStore:Cs,useId:Cs,unstable_isNewReconciler:!1},Lm={readContext:Un,useCallback:function(mt,gt){return co().memoizedState=[mt,gt===void 0?null:gt],mt},useContext:Un,useEffect:V2,useImperativeHandle:function(mt,gt,_t){return _t=_t!=null?_t.concat([mt]):null,s1(4194308,4,q2.bind(null,gt,mt),_t)},useLayoutEffect:function(mt,gt){return s1(4194308,4,mt,gt)},useInsertionEffect:function(mt,gt){return s1(4,2,mt,gt)},useMemo:function(mt,gt){var _t=co();return gt=gt===void 0?null:gt,mt=mt(),_t.memoizedState=[mt,gt],mt},useReducer:function(mt,gt,_t){var Tt=co();return gt=_t!==void 0?_t(gt):gt,Tt.memoizedState=Tt.baseState=gt,mt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mt,lastRenderedState:gt},Tt.queue=mt,mt=mt.dispatch=Dm.bind(null,as,mt),[Tt.memoizedState,mt]},useRef:function(mt){return mt={current:mt},co().memoizedState=mt},useState:U2,useDebugValue:x0,useDeferredValue:function(mt){return co().memoizedState=mt},useTransition:function(){var mt=U2(!1),gt=mt[0];return mt=Om.bind(null,mt[1]),co().memoizedState=mt,[gt,mt]},useMutableSource:function(){},useSyncExternalStore:function(mt,gt,_t){var Tt=as,At=co();if(ss){if(_t===void 0)throw Error(ot(407));_t=_t()}else{if(_t=gt(),ys===null)throw Error(ot(349));30&_a||L2(Tt,gt,_t)}At.memoizedState=_t;var Dt={value:_t,getSnapshot:gt};return At.queue=Dt,V2(F2.bind(null,Tt,Dt,mt),[mt]),Tt.flags|=2048,wu(9,N2.bind(null,Tt,Dt,_t,gt),void 0,null),_t},useId:function(){var mt=co(),gt=ys.identifierPrefix;if(ss){var _t=_o;gt=":"+gt+"R"+(_t=(ao&~(1<<32-Yn(ao)-1)).toString(32)+_t),0<(_t=Eu++)&&(gt+="H"+_t.toString(32)),gt+=":"}else gt=":"+gt+"r"+(_t=$m++).toString(32)+":";return mt.memoizedState=gt},unstable_isNewReconciler:!1},Nm={readContext:Un,useCallback:Y2,useContext:Un,useEffect:g0,useImperativeHandle:X2,useInsertionEffect:G2,useLayoutEffect:W2,useMemo:K2,useReducer:p0,useRef:H2,useState:function(){return p0(bu)},useDebugValue:x0,useDeferredValue:function(mt){return Q2(Vn(),xs.memoizedState,mt)},useTransition:function(){return[p0(bu)[0],Vn().memoizedState]},useMutableSource:D2,useSyncExternalStore:k2,useId:Z2,unstable_isNewReconciler:!1},Fm={readContext:Un,useCallback:Y2,useContext:Un,useEffect:g0,useImperativeHandle:X2,useInsertionEffect:G2,useLayoutEffect:W2,useMemo:K2,useReducer:m0,useRef:H2,useState:function(){return m0(bu)},useDebugValue:x0,useDeferredValue:function(mt){var gt=Vn();return xs===null?gt.memoizedState=mt:Q2(gt,xs.memoizedState,mt)},useTransition:function(){return[m0(bu)[0],Vn().memoizedState]},useMutableSource:D2,useSyncExternalStore:k2,useId:Z2,unstable_isNewReconciler:!1};function Ul(mt,gt){try{var _t="",Tt=gt;do _t+=Mm(Tt),Tt=Tt.return;while(Tt);var At=_t}catch(Dt){At=`
|
|
1038
|
+
`+At[Wt].replace(" at new "," at ");return mt.displayName&&rr.includes("<anonymous>")&&(rr=rr.replace("<anonymous>",mt.displayName)),rr}while(1<=Wt&&0<=Zt);break}}}finally{D1=!1,Error.prepareStackTrace=_t}return(mt=mt?mt.displayName||mt.name:"")?hu(mt):""}var Sm=Object.prototype.hasOwnProperty,L1=[],Il=-1;function Io(mt){return{current:mt}}function rs(mt){0>Il||(mt.current=L1[Il],L1[Il]=null,Il--)}function Jr(mt,gt){Il++,L1[Il]=mt.current,mt.current=gt}var Mo={},Ts=Io(Mo),Fs=Io(!1),na=Mo;function Ml(mt,gt){var _t=mt.type.contextTypes;if(!_t)return Mo;var Tt=mt.stateNode;if(Tt&&Tt.__reactInternalMemoizedUnmaskedChildContext===gt)return Tt.__reactInternalMemoizedMaskedChildContext;var At,Dt={};for(At in _t)Dt[At]=gt[At];return Tt&&((mt=mt.stateNode).__reactInternalMemoizedUnmaskedChildContext=gt,mt.__reactInternalMemoizedMaskedChildContext=Dt),Dt}function Xs(mt){return(mt=mt.childContextTypes)!=null}function N1(){rs(Fs),rs(Ts)}function l2(mt,gt,_t){if(Ts.current!==Mo)throw Error(ot(168));Jr(Ts,gt),Jr(Fs,_t)}function u2(mt,gt,_t){var Tt=mt.stateNode;if(gt=gt.childContextTypes,typeof Tt.getChildContext!="function")return _t;for(var At in Tt=Tt.getChildContext())if(!(At in gt))throw Error(ot(108,jt(mt)||"Unknown",At));return nt({},_t,Tt)}function zu(mt){return mt=(mt=mt.stateNode)&&mt.__reactInternalMemoizedMergedChildContext||Mo,na=Ts.current,Jr(Ts,mt),Jr(Fs,Fs.current),!0}function c2(mt,gt,_t){var Tt=mt.stateNode;if(!Tt)throw Error(ot(169));_t?(mt=u2(mt,gt,na),Tt.__reactInternalMemoizedMergedChildContext=mt,rs(Fs),rs(Ts),Jr(Ts,mt)):rs(Fs),Jr(Fs,_t)}var Yn=Math.clz32?Math.clz32:function(mt){return(mt>>>=0)===0?32:31-(_m(mt)/Rm|0)|0},_m=Math.log,Rm=Math.LN2,F1=64,B1=4194304;function fu(mt){switch(mt&-mt){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&mt;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&mt;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return mt}}function Uu(mt,gt){var _t=mt.pendingLanes;if(_t===0)return 0;var Tt=0,At=mt.suspendedLanes,Dt=mt.pingedLanes,Wt=268435455&_t;if(Wt!==0){var Zt=Wt&~At;Zt!==0?Tt=fu(Zt):(Dt&=Wt)!==0&&(Tt=fu(Dt))}else(Wt=_t&~At)!==0?Tt=fu(Wt):Dt!==0&&(Tt=fu(Dt));if(Tt===0)return 0;if(gt!==0&>!==Tt&&!(gt&At)&&((At=Tt&-Tt)>=(Dt=gt&-gt)||At===16&&4194240&Dt))return gt;if(4&Tt&&(Tt|=16&_t),(gt=mt.entangledLanes)!==0)for(mt=mt.entanglements,gt&=Tt;0<gt;)At=1<<(_t=31-Yn(gt)),Tt|=mt[_t],gt&=~At;return Tt}function Tm(mt,gt){switch(mt){case 1:case 2:case 4:return gt+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return gt+5e3;default:return-1}}function z1(mt){return(mt=-1073741825&mt.pendingLanes)!==0?mt:1073741824&mt?1073741824:0}function d2(){var mt=F1;return!(4194240&(F1<<=1))&&(F1=64),mt}function U1(mt){for(var gt=[],_t=0;31>_t;_t++)gt.push(mt);return gt}function pu(mt,gt,_t){mt.pendingLanes|=gt,gt!==536870912&&(mt.suspendedLanes=0,mt.pingedLanes=0),(mt=mt.eventTimes)[gt=31-Yn(gt)]=_t}function H1(mt,gt){var _t=mt.entangledLanes|=gt;for(mt=mt.entanglements;_t;){var Tt=31-Yn(_t),At=1<<Tt;At>|mt[Tt]>&&(mt[Tt]|=gt),_t&=~At}}var qr=0;function h2(mt){return 1<(mt&=-mt)?4<mt?268435455&mt?16:536870912:4:1}var V1=st.unstable_scheduleCallback,f2=st.unstable_cancelCallback,Cm=st.unstable_shouldYield,Am=st.unstable_requestPaint,gs=st.unstable_now,G1=st.unstable_ImmediatePriority,Pm=st.unstable_UserBlockingPriority,p2=st.unstable_NormalPriority,jm=st.unstable_IdlePriority,Hu=null,io=null,Kn=typeof Object.is=="function"?Object.is:function(mt,gt){return mt===gt&&(mt!==0||1/mt==1/gt)||mt!=mt&>!=gt},So=null,Vu=!1,W1=!1;function m2(mt){So===null?So=[mt]:So.push(mt)}function oo(){if(!W1&&So!==null){W1=!0;var mt=0,gt=qr;try{var _t=So;for(qr=1;mt<_t.length;mt++){var Tt=_t[mt];do Tt=Tt(!0);while(Tt!==null)}So=null,Vu=!1}catch(At){throw So!==null&&(So=So.slice(mt+1)),V1(G1,oo),At}finally{qr=gt,W1=!1}}return null}var $l=[],Ol=0,Gu=null,Wu=0,$n=[],Fn=0,ga=null,ao=1,_o="";function xa(mt,gt){$l[Ol++]=Wu,$l[Ol++]=Gu,Gu=mt,Wu=gt}function g2(mt,gt,_t){$n[Fn++]=ao,$n[Fn++]=_o,$n[Fn++]=ga,ga=mt;var Tt=ao;mt=_o;var At=32-Yn(Tt)-1;Tt&=~(1<<At),_t+=1;var Dt=32-Yn(gt)+At;if(30<Dt){var Wt=At-At%5;Dt=(Tt&(1<<Wt)-1).toString(32),Tt>>=Wt,At-=Wt,ao=1<<32-Yn(gt)+At|_t<<At|Tt,_o=Dt+mt}else ao=1<<Dt|_t<<At|Tt,_o=mt}function q1(mt){mt.return!==null&&(xa(mt,1),g2(mt,1,0))}function X1(mt){for(;mt===Gu;)Gu=$l[--Ol],$l[Ol]=null,Wu=$l[--Ol],$l[Ol]=null;for(;mt===ga;)ga=$n[--Fn],$n[Fn]=null,_o=$n[--Fn],$n[Fn]=null,ao=$n[--Fn],$n[Fn]=null}var Ys=null,Bn=null,ss=!1,mu=!1,Qn=null;function x2(mt,gt){var _t=Wn(5,null,null,0);_t.elementType="DELETED",_t.stateNode=gt,_t.return=mt,(gt=mt.deletions)===null?(mt.deletions=[_t],mt.flags|=16):gt.push(_t)}function v2(mt,gt){switch(mt.tag){case 5:return(gt=hs(gt,mt.type,mt.pendingProps))!==null&&(mt.stateNode=gt,Ys=mt,Bn=du(gt),!0);case 6:return(gt=ro(gt,mt.pendingProps))!==null&&(mt.stateNode=gt,Ys=mt,Bn=null,!0);case 13:if((gt=An(gt))!==null){var _t=ga!==null?{id:ao,overflow:_o}:null;return mt.memoizedState={dehydrated:gt,treeContext:_t,retryLane:1073741824},(_t=Wn(18,null,null,0)).stateNode=gt,_t.return=mt,mt.child=_t,Ys=mt,Bn=null,!0}return!1;default:return!1}}function Y1(mt){return(1&mt.mode)!=0&&(128&mt.flags)==0}function K1(mt){if(ss){var gt=Bn;if(gt){var _t=gt;if(!v2(mt,gt)){if(Y1(mt))throw Error(ot(418));gt=no(_t);var Tt=Ys;gt&&v2(mt,gt)?x2(Tt,_t):(mt.flags=-4097&mt.flags|2,ss=!1,Ys=mt)}}else{if(Y1(mt))throw Error(ot(418));mt.flags=-4097&mt.flags|2,ss=!1,Ys=mt}}}function y2(mt){for(mt=mt.return;mt!==null&&mt.tag!==5&&mt.tag!==3&&mt.tag!==13;)mt=mt.return;Ys=mt}function qu(mt){if(!Ar||mt!==Ys)return!1;if(!ss)return y2(mt),ss=!0,!1;if(mt.tag!==3&&(mt.tag!==5||Em(mt.type)&&!lr(mt.type,mt.memoizedProps))){var gt=Bn;if(gt){if(Y1(mt))throw E2(),Error(ot(418));for(;gt;)x2(mt,gt),gt=no(gt)}}if(y2(mt),mt.tag===13){if(!Ar)throw Error(ot(316));if(!(mt=(mt=mt.memoizedState)!==null?mt.dehydrated:null))throw Error(ot(317));Bn=mm(mt)}else Bn=Ys?no(mt.stateNode):null;return!0}function E2(){for(var mt=Bn;mt;)mt=no(mt)}function Dl(){Ar&&(Bn=Ys=null,mu=ss=!1)}function Q1(mt){Qn===null?Qn=[mt]:Qn.push(mt)}var Im=at.ReactCurrentBatchConfig;function Xu(mt,gt){if(Kn(mt,gt))return!0;if(typeof mt!="object"||mt===null||typeof gt!="object"||gt===null)return!1;var _t=Object.keys(mt),Tt=Object.keys(gt);if(_t.length!==Tt.length)return!1;for(Tt=0;Tt<_t.length;Tt++){var At=_t[Tt];if(!Sm.call(gt,At)||!Kn(mt[At],gt[At]))return!1}return!0}function Mm(mt){switch(mt.tag){case 5:return hu(mt.type);case 16:return hu("Lazy");case 13:return hu("Suspense");case 19:return hu("SuspenseList");case 0:case 2:case 15:return mt=k1(mt.type,!1);case 11:return mt=k1(mt.type.render,!1);case 1:return mt=k1(mt.type,!0);default:return""}}function Zn(mt,gt){if(mt&&mt.defaultProps){for(var _t in gt=nt({},gt),mt=mt.defaultProps)gt[_t]===void 0&&(gt[_t]=mt[_t]);return gt}return gt}var Yu=Io(null),Ku=null,Ll=null,Z1=null;function J1(){Z1=Ll=Ku=null}function b2(mt,gt,_t){hr?(Jr(Yu,gt._currentValue),gt._currentValue=_t):(Jr(Yu,gt._currentValue2),gt._currentValue2=_t)}function e0(mt){var gt=Yu.current;rs(Yu),hr?mt._currentValue=gt:mt._currentValue2=gt}function t0(mt,gt,_t){for(;mt!==null;){var Tt=mt.alternate;if((mt.childLanes>)!==gt?(mt.childLanes|=gt,Tt!==null&&(Tt.childLanes|=gt)):Tt!==null&&(Tt.childLanes>)!==gt&&(Tt.childLanes|=gt),mt===_t)break;mt=mt.return}}function Nl(mt,gt){Ku=mt,Z1=Ll=null,(mt=mt.dependencies)!==null&&mt.firstContext!==null&&(mt.lanes>&&(Bs=!0),mt.firstContext=null)}function Un(mt){var gt=hr?mt._currentValue:mt._currentValue2;if(Z1!==mt)if(mt={context:mt,memoizedValue:gt,next:null},Ll===null){if(Ku===null)throw Error(ot(308));Ll=mt,Ku.dependencies={lanes:0,firstContext:mt}}else Ll=Ll.next=mt;return gt}var ba=null;function r0(mt){ba===null?ba=[mt]:ba.push(mt)}function w2(mt,gt,_t,Tt){var At=gt.interleaved;return At===null?(_t.next=_t,r0(gt)):(_t.next=At.next,At.next=_t),gt.interleaved=_t,lo(mt,Tt)}function lo(mt,gt){mt.lanes|=gt;var _t=mt.alternate;for(_t!==null&&(_t.lanes|=gt),_t=mt,mt=mt.return;mt!==null;)mt.childLanes|=gt,(_t=mt.alternate)!==null&&(_t.childLanes|=gt),_t=mt,mt=mt.return;return _t.tag===3?_t.stateNode:null}var $o=!1;function s0(mt){mt.updateQueue={baseState:mt.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function S2(mt,gt){mt=mt.updateQueue,gt.updateQueue===mt&&(gt.updateQueue={baseState:mt.baseState,firstBaseUpdate:mt.firstBaseUpdate,lastBaseUpdate:mt.lastBaseUpdate,shared:mt.shared,effects:mt.effects})}function Ro(mt,gt){return{eventTime:mt,lane:gt,tag:0,payload:null,callback:null,next:null}}function Oo(mt,gt,_t){var Tt=mt.updateQueue;if(Tt===null)return null;if(Tt=Tt.shared,(2&Vr)!=0){var At=Tt.pending;return At===null?gt.next=gt:(gt.next=At.next,At.next=gt),Tt.pending=gt,lo(mt,_t)}return(At=Tt.interleaved)===null?(gt.next=gt,r0(Tt)):(gt.next=At.next,At.next=gt),Tt.interleaved=gt,lo(mt,_t)}function Qu(mt,gt,_t){if((gt=gt.updateQueue)!==null&&(gt=gt.shared,(4194240&_t)!=0)){var Tt=gt.lanes;_t|=Tt&=mt.pendingLanes,gt.lanes=_t,H1(mt,_t)}}function _2(mt,gt){var _t=mt.updateQueue,Tt=mt.alternate;if(Tt!==null&&_t===(Tt=Tt.updateQueue)){var At=null,Dt=null;if((_t=_t.firstBaseUpdate)!==null){do{var Wt={eventTime:_t.eventTime,lane:_t.lane,tag:_t.tag,payload:_t.payload,callback:_t.callback,next:null};Dt===null?At=Dt=Wt:Dt=Dt.next=Wt,_t=_t.next}while(_t!==null);Dt===null?At=Dt=gt:Dt=Dt.next=gt}else At=Dt=gt;return _t={baseState:Tt.baseState,firstBaseUpdate:At,lastBaseUpdate:Dt,shared:Tt.shared,effects:Tt.effects},void(mt.updateQueue=_t)}(mt=_t.lastBaseUpdate)===null?_t.firstBaseUpdate=gt:mt.next=gt,_t.lastBaseUpdate=gt}function Zu(mt,gt,_t,Tt){var At=mt.updateQueue;$o=!1;var Dt=At.firstBaseUpdate,Wt=At.lastBaseUpdate,Zt=At.shared.pending;if(Zt!==null){At.shared.pending=null;var rr=Zt,ir=rr.next;rr.next=null,Wt===null?Dt=ir:Wt.next=ir,Wt=rr;var cr=mt.alternate;cr!==null&&(Zt=(cr=cr.updateQueue).lastBaseUpdate)!==Wt&&(Zt===null?cr.firstBaseUpdate=ir:Zt.next=ir,cr.lastBaseUpdate=rr)}if(Dt!==null){var wr=At.baseState;for(Wt=0,cr=ir=rr=null,Zt=Dt;;){var ar=Zt.lane,Er=Zt.eventTime;if((Tt&ar)===ar){cr!==null&&(cr=cr.next={eventTime:Er,lane:0,tag:Zt.tag,payload:Zt.payload,callback:Zt.callback,next:null});e:{var Cr=mt,Nr=Zt;switch(ar=gt,Er=_t,Nr.tag){case 1:if(typeof(Cr=Nr.payload)=="function"){wr=Cr.call(Er,wr,ar);break e}wr=Cr;break e;case 3:Cr.flags=-65537&Cr.flags|128;case 0:if((ar=typeof(Cr=Nr.payload)=="function"?Cr.call(Er,wr,ar):Cr)==null)break e;wr=nt({},wr,ar);break e;case 2:$o=!0}}Zt.callback!==null&&Zt.lane!==0&&(mt.flags|=64,(ar=At.effects)===null?At.effects=[Zt]:ar.push(Zt))}else Er={eventTime:Er,lane:ar,tag:Zt.tag,payload:Zt.payload,callback:Zt.callback,next:null},cr===null?(ir=cr=Er,rr=wr):cr=cr.next=Er,Wt|=ar;if((Zt=Zt.next)===null){if((Zt=At.shared.pending)===null)break;Zt=(ar=Zt).next,ar.next=null,At.lastBaseUpdate=ar,At.shared.pending=null}}if(cr===null&&(rr=wr),At.baseState=rr,At.firstBaseUpdate=ir,At.lastBaseUpdate=cr,(gt=At.shared.interleaved)!==null){At=gt;do Wt|=At.lane,At=At.next;while(At!==gt)}else Dt===null&&(At.shared.lanes=0);$a|=Wt,mt.lanes=Wt,mt.memoizedState=wr}}function R2(mt,gt,_t){if(mt=gt.effects,gt.effects=null,mt!==null)for(gt=0;gt<mt.length;gt++){var Tt=mt[gt],At=Tt.callback;if(At!==null){if(Tt.callback=null,Tt=_t,typeof At!="function")throw Error(ot(191,At));At.call(Tt)}}}var T2=new rt.Component().refs;function n0(mt,gt,_t,Tt){_t=(_t=_t(Tt,gt=mt.memoizedState))==null?gt:nt({},gt,_t),mt.memoizedState=_t,mt.lanes===0&&(mt.updateQueue.baseState=_t)}var Ju={isMounted:function(mt){return!!(mt=mt._reactInternals)&&Pt(mt)===mt},enqueueSetState:function(mt,gt,_t){mt=mt._reactInternals;var Tt=Ps(),At=No(mt),Dt=Ro(Tt,At);Dt.payload=gt,_t!=null&&(Dt.callback=_t),(gt=Oo(mt,Dt,At))!==null&&(Gn(gt,mt,At,Tt),Qu(gt,mt,At))},enqueueReplaceState:function(mt,gt,_t){mt=mt._reactInternals;var Tt=Ps(),At=No(mt),Dt=Ro(Tt,At);Dt.tag=1,Dt.payload=gt,_t!=null&&(Dt.callback=_t),(gt=Oo(mt,Dt,At))!==null&&(Gn(gt,mt,At,Tt),Qu(gt,mt,At))},enqueueForceUpdate:function(mt,gt){mt=mt._reactInternals;var _t=Ps(),Tt=No(mt),At=Ro(_t,Tt);At.tag=2,gt!=null&&(At.callback=gt),(gt=Oo(mt,At,Tt))!==null&&(Gn(gt,mt,Tt,_t),Qu(gt,mt,Tt))}};function C2(mt,gt,_t,Tt,At,Dt,Wt){return typeof(mt=mt.stateNode).shouldComponentUpdate=="function"?mt.shouldComponentUpdate(Tt,Dt,Wt):!gt.prototype||!gt.prototype.isPureReactComponent||!Xu(_t,Tt)||!Xu(At,Dt)}function A2(mt,gt,_t){var Tt=!1,At=Mo,Dt=gt.contextType;return typeof Dt=="object"&&Dt!==null?Dt=Un(Dt):(At=Xs(gt)?na:Ts.current,Dt=(Tt=(Tt=gt.contextTypes)!=null)?Ml(mt,At):Mo),gt=new gt(_t,Dt),mt.memoizedState=gt.state!==null&>.state!==void 0?gt.state:null,gt.updater=Ju,mt.stateNode=gt,gt._reactInternals=mt,Tt&&((mt=mt.stateNode).__reactInternalMemoizedUnmaskedChildContext=At,mt.__reactInternalMemoizedMaskedChildContext=Dt),gt}function P2(mt,gt,_t,Tt){mt=gt.state,typeof gt.componentWillReceiveProps=="function"&>.componentWillReceiveProps(_t,Tt),typeof gt.UNSAFE_componentWillReceiveProps=="function"&>.UNSAFE_componentWillReceiveProps(_t,Tt),gt.state!==mt&&Ju.enqueueReplaceState(gt,gt.state,null)}function i0(mt,gt,_t,Tt){var At=mt.stateNode;At.props=_t,At.state=mt.memoizedState,At.refs=T2,s0(mt);var Dt=gt.contextType;typeof Dt=="object"&&Dt!==null?At.context=Un(Dt):(Dt=Xs(gt)?na:Ts.current,At.context=Ml(mt,Dt)),At.state=mt.memoizedState,typeof(Dt=gt.getDerivedStateFromProps)=="function"&&(n0(mt,gt,Dt,_t),At.state=mt.memoizedState),typeof gt.getDerivedStateFromProps=="function"||typeof At.getSnapshotBeforeUpdate=="function"||typeof At.UNSAFE_componentWillMount!="function"&&typeof At.componentWillMount!="function"||(gt=At.state,typeof At.componentWillMount=="function"&&At.componentWillMount(),typeof At.UNSAFE_componentWillMount=="function"&&At.UNSAFE_componentWillMount(),gt!==At.state&&Ju.enqueueReplaceState(At,At.state,null),Zu(mt,_t,At,Tt),At.state=mt.memoizedState),typeof At.componentDidMount=="function"&&(mt.flags|=4194308)}function gu(mt,gt,_t){if((mt=_t.ref)!==null&&typeof mt!="function"&&typeof mt!="object"){if(_t._owner){if(_t=_t._owner){if(_t.tag!==1)throw Error(ot(309));var Tt=_t.stateNode}if(!Tt)throw Error(ot(147,mt));var At=Tt,Dt=""+mt;return gt!==null&>.ref!==null&&typeof gt.ref=="function"&>.ref._stringRef===Dt?gt.ref:(gt=function(Wt){var Zt=At.refs;Zt===T2&&(Zt=At.refs={}),Wt===null?delete Zt[Dt]:Zt[Dt]=Wt},gt._stringRef=Dt,gt)}if(typeof mt!="string")throw Error(ot(284));if(!_t._owner)throw Error(ot(290,mt))}return mt}function _c(mt,gt){throw mt=Object.prototype.toString.call(gt),Error(ot(31,mt==="[object Object]"?"object with keys {"+Object.keys(gt).join(", ")+"}":mt))}function j2(mt){return(0,mt._init)(mt._payload)}function I2(mt){function gt(dr,Jt){if(mt){var nr=dr.deletions;nr===null?(dr.deletions=[Jt],dr.flags|=16):nr.push(Jt)}}function _t(dr,Jt){if(!mt)return null;for(;Jt!==null;)gt(dr,Jt),Jt=Jt.sibling;return null}function Tt(dr,Jt){for(dr=new Map;Jt!==null;)Jt.key!==null?dr.set(Jt.key,Jt):dr.set(Jt.index,Jt),Jt=Jt.sibling;return dr}function At(dr,Jt){return(dr=Bo(dr,Jt)).index=0,dr.sibling=null,dr}function Dt(dr,Jt,nr){return dr.index=nr,mt?(nr=dr.alternate)!==null?(nr=nr.index)<Jt?(dr.flags|=2,Jt):nr:(dr.flags|=2,Jt):(dr.flags|=1048576,Jt)}function Wt(dr){return mt&&dr.alternate===null&&(dr.flags|=2),dr}function Zt(dr,Jt,nr,xr){return Jt===null||Jt.tag!==6?((Jt=G0(nr,dr.mode,xr)).return=dr,Jt):((Jt=At(Jt,nr)).return=dr,Jt)}function rr(dr,Jt,nr,xr){var Mr=nr.type;return Mr===ct?cr(dr,Jt,nr.props.children,xr,nr.key):Jt!==null&&(Jt.elementType===Mr||typeof Mr=="object"&&Mr!==null&&Mr.$$typeof===wt&&j2(Mr)===Jt.type)?((xr=At(Jt,nr.props)).ref=gu(dr,Jt,nr),xr.return=dr,xr):((xr=R1(nr.type,nr.key,nr.props,null,dr.mode,xr)).ref=gu(dr,Jt,nr),xr.return=dr,xr)}function ir(dr,Jt,nr,xr){return Jt===null||Jt.tag!==4||Jt.stateNode.containerInfo!==nr.containerInfo||Jt.stateNode.implementation!==nr.implementation?((Jt=W0(nr,dr.mode,xr)).return=dr,Jt):((Jt=At(Jt,nr.children||[])).return=dr,Jt)}function cr(dr,Jt,nr,xr,Mr){return Jt===null||Jt.tag!==7?((Jt=El(nr,dr.mode,xr,Mr)).return=dr,Jt):((Jt=At(Jt,nr)).return=dr,Jt)}function wr(dr,Jt,nr){if(typeof Jt=="string"&&Jt!==""||typeof Jt=="number")return(Jt=G0(""+Jt,dr.mode,nr)).return=dr,Jt;if(typeof Jt=="object"&&Jt!==null){switch(Jt.$$typeof){case lt:return(nr=R1(Jt.type,Jt.key,Jt.props,null,dr.mode,nr)).ref=gu(dr,null,Jt),nr.return=dr,nr;case ut:return(Jt=W0(Jt,dr.mode,nr)).return=dr,Jt;case wt:return wr(dr,(0,Jt._init)(Jt._payload),nr)}if($t(Jt)||Ct(Jt))return(Jt=El(Jt,dr.mode,nr,null)).return=dr,Jt;_c(dr,Jt)}return null}function ar(dr,Jt,nr,xr){var Mr=Jt!==null?Jt.key:null;if(typeof nr=="string"&&nr!==""||typeof nr=="number")return Mr!==null?null:Zt(dr,Jt,""+nr,xr);if(typeof nr=="object"&&nr!==null){switch(nr.$$typeof){case lt:return nr.key===Mr?rr(dr,Jt,nr,xr):null;case ut:return nr.key===Mr?ir(dr,Jt,nr,xr):null;case wt:return ar(dr,Jt,(Mr=nr._init)(nr._payload),xr)}if($t(nr)||Ct(nr))return Mr!==null?null:cr(dr,Jt,nr,xr,null);_c(dr,nr)}return null}function Er(dr,Jt,nr,xr,Mr){if(typeof xr=="string"&&xr!==""||typeof xr=="number")return Zt(Jt,dr=dr.get(nr)||null,""+xr,Mr);if(typeof xr=="object"&&xr!==null){switch(xr.$$typeof){case lt:return rr(Jt,dr=dr.get(xr.key===null?nr:xr.key)||null,xr,Mr);case ut:return ir(Jt,dr=dr.get(xr.key===null?nr:xr.key)||null,xr,Mr);case wt:return Er(dr,Jt,nr,(0,xr._init)(xr._payload),Mr)}if($t(xr)||Ct(xr))return cr(Jt,dr=dr.get(nr)||null,xr,Mr,null);_c(Jt,xr)}return null}function Cr(dr,Jt,nr,xr){for(var Mr=null,Yr=null,Pr=Jt,Xr=Jt=0,_s=null;Pr!==null&&Xr<nr.length;Xr++){Pr.index>Xr?(_s=Pr,Pr=null):_s=Pr.sibling;var Kr=ar(dr,Pr,nr[Xr],xr);if(Kr===null){Pr===null&&(Pr=_s);break}mt&&Pr&&Kr.alternate===null&>(dr,Pr),Jt=Dt(Kr,Jt,Xr),Yr===null?Mr=Kr:Yr.sibling=Kr,Yr=Kr,Pr=_s}if(Xr===nr.length)return _t(dr,Pr),ss&&xa(dr,Xr),Mr;if(Pr===null){for(;Xr<nr.length;Xr++)(Pr=wr(dr,nr[Xr],xr))!==null&&(Jt=Dt(Pr,Jt,Xr),Yr===null?Mr=Pr:Yr.sibling=Pr,Yr=Pr);return ss&&xa(dr,Xr),Mr}for(Pr=Tt(dr,Pr);Xr<nr.length;Xr++)(_s=Er(Pr,dr,Xr,nr[Xr],xr))!==null&&(mt&&_s.alternate!==null&&Pr.delete(_s.key===null?Xr:_s.key),Jt=Dt(_s,Jt,Xr),Yr===null?Mr=_s:Yr.sibling=_s,Yr=_s);return mt&&Pr.forEach(function(zo){return gt(dr,zo)}),ss&&xa(dr,Xr),Mr}function Nr(dr,Jt,nr,xr){var Mr=Ct(nr);if(typeof Mr!="function")throw Error(ot(150));if((nr=Mr.call(nr))==null)throw Error(ot(151));for(var Yr=Mr=null,Pr=Jt,Xr=Jt=0,_s=null,Kr=nr.next();Pr!==null&&!Kr.done;Xr++,Kr=nr.next()){Pr.index>Xr?(_s=Pr,Pr=null):_s=Pr.sibling;var zo=ar(dr,Pr,Kr.value,xr);if(zo===null){Pr===null&&(Pr=_s);break}mt&&Pr&&zo.alternate===null&>(dr,Pr),Jt=Dt(zo,Jt,Xr),Yr===null?Mr=zo:Yr.sibling=zo,Yr=zo,Pr=_s}if(Kr.done)return _t(dr,Pr),ss&&xa(dr,Xr),Mr;if(Pr===null){for(;!Kr.done;Xr++,Kr=nr.next())(Kr=wr(dr,Kr.value,xr))!==null&&(Jt=Dt(Kr,Jt,Xr),Yr===null?Mr=Kr:Yr.sibling=Kr,Yr=Kr);return ss&&xa(dr,Xr),Mr}for(Pr=Tt(dr,Pr);!Kr.done;Xr++,Kr=nr.next())(Kr=Er(Pr,dr,Xr,Kr.value,xr))!==null&&(mt&&Kr.alternate!==null&&Pr.delete(Kr.key===null?Xr:Kr.key),Jt=Dt(Kr,Jt,Xr),Yr===null?Mr=Kr:Yr.sibling=Kr,Yr=Kr);return mt&&Pr.forEach(function(r3){return gt(dr,r3)}),ss&&xa(dr,Xr),Mr}return function dr(Jt,nr,xr,Mr){if(typeof xr=="object"&&xr!==null&&xr.type===ct&&xr.key===null&&(xr=xr.props.children),typeof xr=="object"&&xr!==null){switch(xr.$$typeof){case lt:e:{for(var Yr=xr.key,Pr=nr;Pr!==null;){if(Pr.key===Yr){if((Yr=xr.type)===ct){if(Pr.tag===7){_t(Jt,Pr.sibling),(nr=At(Pr,xr.props.children)).return=Jt,Jt=nr;break e}}else if(Pr.elementType===Yr||typeof Yr=="object"&&Yr!==null&&Yr.$$typeof===wt&&j2(Yr)===Pr.type){_t(Jt,Pr.sibling),(nr=At(Pr,xr.props)).ref=gu(Jt,Pr,xr),nr.return=Jt,Jt=nr;break e}_t(Jt,Pr);break}gt(Jt,Pr),Pr=Pr.sibling}xr.type===ct?((nr=El(xr.props.children,Jt.mode,Mr,xr.key)).return=Jt,Jt=nr):((Mr=R1(xr.type,xr.key,xr.props,null,Jt.mode,Mr)).ref=gu(Jt,nr,xr),Mr.return=Jt,Jt=Mr)}return Wt(Jt);case ut:e:{for(Pr=xr.key;nr!==null;){if(nr.key===Pr){if(nr.tag===4&&nr.stateNode.containerInfo===xr.containerInfo&&nr.stateNode.implementation===xr.implementation){_t(Jt,nr.sibling),(nr=At(nr,xr.children||[])).return=Jt,Jt=nr;break e}_t(Jt,nr);break}gt(Jt,nr),nr=nr.sibling}(nr=W0(xr,Jt.mode,Mr)).return=Jt,Jt=nr}return Wt(Jt);case wt:return dr(Jt,nr,(Pr=xr._init)(xr._payload),Mr)}if($t(xr))return Cr(Jt,nr,xr,Mr);if(Ct(xr))return Nr(Jt,nr,xr,Mr);_c(Jt,xr)}return typeof xr=="string"&&xr!==""||typeof xr=="number"?(xr=""+xr,nr!==null&&nr.tag===6?(_t(Jt,nr.sibling),(nr=At(nr,xr)).return=Jt,Jt=nr):(_t(Jt,nr),(nr=G0(xr,Jt.mode,Mr)).return=Jt,Jt=nr),Wt(Jt)):_t(Jt,nr)}}var Fl=I2(!0),M2=I2(!1),xu={},Hn=Io(xu),vu=Io(xu),Bl=Io(xu);function uo(mt){if(mt===xu)throw Error(ot(174));return mt}function o0(mt,gt){Jr(Bl,gt),Jr(vu,mt),Jr(Hn,xu),mt=Gt(gt),rs(Hn),Jr(Hn,mt)}function zl(){rs(Hn),rs(vu),rs(Bl)}function $2(mt){var gt=uo(Bl.current),_t=uo(Hn.current);_t!==(gt=Mt(_t,mt.type,gt))&&(Jr(vu,mt),Jr(Hn,gt))}function a0(mt){vu.current===mt&&(rs(Hn),rs(vu))}var ls=Io(0);function e1(mt){for(var gt=mt;gt!==null;){if(gt.tag===13){var _t=gt.memoizedState;if(_t!==null&&((_t=_t.dehydrated)===null||Mn(_t)||wo(_t)))return gt}else if(gt.tag===19&>.memoizedProps.revealOrder!==void 0){if(128>.flags)return gt}else if(gt.child!==null){gt.child.return=gt,gt=gt.child;continue}if(gt===mt)break;for(;gt.sibling===null;){if(gt.return===null||gt.return===mt)return null;gt=gt.return}gt.sibling.return=gt.return,gt=gt.sibling}return null}var l0=[];function u0(){for(var mt=0;mt<l0.length;mt++){var gt=l0[mt];hr?gt._workInProgressVersionPrimary=null:gt._workInProgressVersionSecondary=null}l0.length=0}var t1=at.ReactCurrentDispatcher,c0=at.ReactCurrentBatchConfig,_a=0,as=null,xs=null,vs=null,r1=!1,yu=!1,Eu=0,$m=0;function Cs(){throw Error(ot(321))}function d0(mt,gt){if(gt===null)return!1;for(var _t=0;_t<gt.length&&_t<mt.length;_t++)if(!Kn(mt[_t],gt[_t]))return!1;return!0}function h0(mt,gt,_t,Tt,At,Dt){if(_a=Dt,as=gt,gt.memoizedState=null,gt.updateQueue=null,gt.lanes=0,t1.current=mt===null||mt.memoizedState===null?Lm:Nm,mt=_t(Tt,At),yu){Dt=0;do{if(yu=!1,Eu=0,25<=Dt)throw Error(ot(301));Dt+=1,vs=xs=null,gt.updateQueue=null,t1.current=Fm,mt=_t(Tt,At)}while(yu)}if(t1.current=i1,gt=xs!==null&&xs.next!==null,_a=0,vs=xs=as=null,r1=!1,gt)throw Error(ot(300));return mt}function f0(){var mt=Eu!==0;return Eu=0,mt}function co(){var mt={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vs===null?as.memoizedState=vs=mt:vs=vs.next=mt,vs}function Vn(){if(xs===null){var mt=as.alternate;mt=mt!==null?mt.memoizedState:null}else mt=xs.next;var gt=vs===null?as.memoizedState:vs.next;if(gt!==null)vs=gt,xs=mt;else{if(mt===null)throw Error(ot(310));mt={memoizedState:(xs=mt).memoizedState,baseState:xs.baseState,baseQueue:xs.baseQueue,queue:xs.queue,next:null},vs===null?as.memoizedState=vs=mt:vs=vs.next=mt}return vs}function bu(mt,gt){return typeof gt=="function"?gt(mt):gt}function p0(mt){var gt=Vn(),_t=gt.queue;if(_t===null)throw Error(ot(311));_t.lastRenderedReducer=mt;var Tt=xs,At=Tt.baseQueue,Dt=_t.pending;if(Dt!==null){if(At!==null){var Wt=At.next;At.next=Dt.next,Dt.next=Wt}Tt.baseQueue=At=Dt,_t.pending=null}if(At!==null){Dt=At.next,Tt=Tt.baseState;var Zt=Wt=null,rr=null,ir=Dt;do{var cr=ir.lane;if((_a&cr)===cr)rr!==null&&(rr=rr.next={lane:0,action:ir.action,hasEagerState:ir.hasEagerState,eagerState:ir.eagerState,next:null}),Tt=ir.hasEagerState?ir.eagerState:mt(Tt,ir.action);else{var wr={lane:cr,action:ir.action,hasEagerState:ir.hasEagerState,eagerState:ir.eagerState,next:null};rr===null?(Zt=rr=wr,Wt=Tt):rr=rr.next=wr,as.lanes|=cr,$a|=cr}ir=ir.next}while(ir!==null&&ir!==Dt);rr===null?Wt=Tt:rr.next=Zt,Kn(Tt,gt.memoizedState)||(Bs=!0),gt.memoizedState=Tt,gt.baseState=Wt,gt.baseQueue=rr,_t.lastRenderedState=Tt}if((mt=_t.interleaved)!==null){At=mt;do Dt=At.lane,as.lanes|=Dt,$a|=Dt,At=At.next;while(At!==mt)}else At===null&&(_t.lanes=0);return[gt.memoizedState,_t.dispatch]}function m0(mt){var gt=Vn(),_t=gt.queue;if(_t===null)throw Error(ot(311));_t.lastRenderedReducer=mt;var Tt=_t.dispatch,At=_t.pending,Dt=gt.memoizedState;if(At!==null){_t.pending=null;var Wt=At=At.next;do Dt=mt(Dt,Wt.action),Wt=Wt.next;while(Wt!==At);Kn(Dt,gt.memoizedState)||(Bs=!0),gt.memoizedState=Dt,gt.baseQueue===null&&(gt.baseState=Dt),_t.lastRenderedState=Dt}return[Dt,Tt]}function O2(){}function D2(mt,gt){var _t=as,Tt=Vn(),At=gt(),Dt=!Kn(Tt.memoizedState,At);if(Dt&&(Tt.memoizedState=At,Bs=!0),Tt=Tt.queue,g0(N2.bind(null,_t,Tt,mt),[mt]),Tt.getSnapshot!==gt||Dt||vs!==null&&1&vs.memoizedState.tag){if(_t.flags|=2048,wu(9,L2.bind(null,_t,Tt,At,gt),void 0,null),ys===null)throw Error(ot(349));30&_a||k2(_t,gt,At)}return At}function k2(mt,gt,_t){mt.flags|=16384,mt={getSnapshot:gt,value:_t},(gt=as.updateQueue)===null?(gt={lastEffect:null,stores:null},as.updateQueue=gt,gt.stores=[mt]):(_t=gt.stores)===null?gt.stores=[mt]:_t.push(mt)}function L2(mt,gt,_t,Tt){gt.value=_t,gt.getSnapshot=Tt,F2(gt)&&B2(mt)}function N2(mt,gt,_t){return _t(function(){F2(gt)&&B2(mt)})}function F2(mt){var gt=mt.getSnapshot;mt=mt.value;try{var _t=gt();return!Kn(mt,_t)}catch{return!0}}function B2(mt){var gt=lo(mt,1);gt!==null&&Gn(gt,mt,1,-1)}function z2(mt){var gt=co();return typeof mt=="function"&&(mt=mt()),gt.memoizedState=gt.baseState=mt,mt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:bu,lastRenderedState:mt},gt.queue=mt,mt=mt.dispatch=km.bind(null,as,mt),[gt.memoizedState,mt]}function wu(mt,gt,_t,Tt){return mt={tag:mt,create:gt,destroy:_t,deps:Tt,next:null},(gt=as.updateQueue)===null?(gt={lastEffect:null,stores:null},as.updateQueue=gt,gt.lastEffect=mt.next=mt):(_t=gt.lastEffect)===null?gt.lastEffect=mt.next=mt:(Tt=_t.next,_t.next=mt,mt.next=Tt,gt.lastEffect=mt),mt}function U2(){return Vn().memoizedState}function s1(mt,gt,_t,Tt){var At=co();as.flags|=mt,At.memoizedState=wu(1|gt,_t,void 0,Tt===void 0?null:Tt)}function n1(mt,gt,_t,Tt){var At=Vn();Tt=Tt===void 0?null:Tt;var Dt=void 0;if(xs!==null){var Wt=xs.memoizedState;if(Dt=Wt.destroy,Tt!==null&&d0(Tt,Wt.deps))return void(At.memoizedState=wu(gt,_t,Dt,Tt))}as.flags|=mt,At.memoizedState=wu(1|gt,_t,Dt,Tt)}function H2(mt,gt){return s1(8390656,8,mt,gt)}function g0(mt,gt){return n1(2048,8,mt,gt)}function V2(mt,gt){return n1(4,2,mt,gt)}function G2(mt,gt){return n1(4,4,mt,gt)}function W2(mt,gt){return typeof gt=="function"?(mt=mt(),gt(mt),function(){gt(null)}):gt!=null?(mt=mt(),gt.current=mt,function(){gt.current=null}):void 0}function q2(mt,gt,_t){return _t=_t!=null?_t.concat([mt]):null,n1(4,4,W2.bind(null,gt,mt),_t)}function x0(){}function X2(mt,gt){var _t=Vn();gt=gt===void 0?null:gt;var Tt=_t.memoizedState;return Tt!==null&>!==null&&d0(gt,Tt[1])?Tt[0]:(_t.memoizedState=[mt,gt],mt)}function Y2(mt,gt){var _t=Vn();gt=gt===void 0?null:gt;var Tt=_t.memoizedState;return Tt!==null&>!==null&&d0(gt,Tt[1])?Tt[0]:(mt=mt(),_t.memoizedState=[mt,gt],mt)}function K2(mt,gt,_t){return 21&_a?(Kn(_t,gt)||(_t=d2(),as.lanes|=_t,$a|=_t,mt.baseState=!0),gt):(mt.baseState&&(mt.baseState=!1,Bs=!0),mt.memoizedState=_t)}function Om(mt,gt){var _t=qr;qr=_t!==0&&4>_t?_t:4,mt(!0);var Tt=c0.transition;c0.transition={};try{mt(!1),gt()}finally{qr=_t,c0.transition=Tt}}function Q2(){return Vn().memoizedState}function Dm(mt,gt,_t){var Tt=No(mt);_t={lane:Tt,action:_t,hasEagerState:!1,eagerState:null,next:null},Z2(mt)?J2(gt,_t):(_t=w2(mt,gt,_t,Tt))!==null&&(Gn(_t,mt,Tt,Ps()),_f(_t,gt,Tt))}function km(mt,gt,_t){var Tt=No(mt),At={lane:Tt,action:_t,hasEagerState:!1,eagerState:null,next:null};if(Z2(mt))J2(gt,At);else{var Dt=mt.alternate;if(mt.lanes===0&&(Dt===null||Dt.lanes===0)&&(Dt=gt.lastRenderedReducer)!==null)try{var Wt=gt.lastRenderedState,Zt=Dt(Wt,_t);if(At.hasEagerState=!0,At.eagerState=Zt,Kn(Zt,Wt)){var rr=gt.interleaved;return rr===null?(At.next=At,r0(gt)):(At.next=rr.next,rr.next=At),void(gt.interleaved=At)}}catch{}(_t=w2(mt,gt,At,Tt))!==null&&(Gn(_t,mt,Tt,At=Ps()),_f(_t,gt,Tt))}}function Z2(mt){var gt=mt.alternate;return mt===as||gt!==null&>===as}function J2(mt,gt){yu=r1=!0;var _t=mt.pending;_t===null?gt.next=gt:(gt.next=_t.next,_t.next=gt),mt.pending=gt}function _f(mt,gt,_t){if(4194240&_t){var Tt=gt.lanes;_t|=Tt&=mt.pendingLanes,gt.lanes=_t,H1(mt,_t)}}var i1={readContext:Un,useCallback:Cs,useContext:Cs,useEffect:Cs,useImperativeHandle:Cs,useInsertionEffect:Cs,useLayoutEffect:Cs,useMemo:Cs,useReducer:Cs,useRef:Cs,useState:Cs,useDebugValue:Cs,useDeferredValue:Cs,useTransition:Cs,useMutableSource:Cs,useSyncExternalStore:Cs,useId:Cs,unstable_isNewReconciler:!1},Lm={readContext:Un,useCallback:function(mt,gt){return co().memoizedState=[mt,gt===void 0?null:gt],mt},useContext:Un,useEffect:H2,useImperativeHandle:function(mt,gt,_t){return _t=_t!=null?_t.concat([mt]):null,s1(4194308,4,W2.bind(null,gt,mt),_t)},useLayoutEffect:function(mt,gt){return s1(4194308,4,mt,gt)},useInsertionEffect:function(mt,gt){return s1(4,2,mt,gt)},useMemo:function(mt,gt){var _t=co();return gt=gt===void 0?null:gt,mt=mt(),_t.memoizedState=[mt,gt],mt},useReducer:function(mt,gt,_t){var Tt=co();return gt=_t!==void 0?_t(gt):gt,Tt.memoizedState=Tt.baseState=gt,mt={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:mt,lastRenderedState:gt},Tt.queue=mt,mt=mt.dispatch=Dm.bind(null,as,mt),[Tt.memoizedState,mt]},useRef:function(mt){return mt={current:mt},co().memoizedState=mt},useState:z2,useDebugValue:x0,useDeferredValue:function(mt){return co().memoizedState=mt},useTransition:function(){var mt=z2(!1),gt=mt[0];return mt=Om.bind(null,mt[1]),co().memoizedState=mt,[gt,mt]},useMutableSource:function(){},useSyncExternalStore:function(mt,gt,_t){var Tt=as,At=co();if(ss){if(_t===void 0)throw Error(ot(407));_t=_t()}else{if(_t=gt(),ys===null)throw Error(ot(349));30&_a||k2(Tt,gt,_t)}At.memoizedState=_t;var Dt={value:_t,getSnapshot:gt};return At.queue=Dt,H2(N2.bind(null,Tt,Dt,mt),[mt]),Tt.flags|=2048,wu(9,L2.bind(null,Tt,Dt,_t,gt),void 0,null),_t},useId:function(){var mt=co(),gt=ys.identifierPrefix;if(ss){var _t=_o;gt=":"+gt+"R"+(_t=(ao&~(1<<32-Yn(ao)-1)).toString(32)+_t),0<(_t=Eu++)&&(gt+="H"+_t.toString(32)),gt+=":"}else gt=":"+gt+"r"+(_t=$m++).toString(32)+":";return mt.memoizedState=gt},unstable_isNewReconciler:!1},Nm={readContext:Un,useCallback:X2,useContext:Un,useEffect:g0,useImperativeHandle:q2,useInsertionEffect:V2,useLayoutEffect:G2,useMemo:Y2,useReducer:p0,useRef:U2,useState:function(){return p0(bu)},useDebugValue:x0,useDeferredValue:function(mt){return K2(Vn(),xs.memoizedState,mt)},useTransition:function(){return[p0(bu)[0],Vn().memoizedState]},useMutableSource:O2,useSyncExternalStore:D2,useId:Q2,unstable_isNewReconciler:!1},Fm={readContext:Un,useCallback:X2,useContext:Un,useEffect:g0,useImperativeHandle:q2,useInsertionEffect:V2,useLayoutEffect:G2,useMemo:Y2,useReducer:m0,useRef:U2,useState:function(){return m0(bu)},useDebugValue:x0,useDeferredValue:function(mt){var gt=Vn();return xs===null?gt.memoizedState=mt:K2(gt,xs.memoizedState,mt)},useTransition:function(){return[m0(bu)[0],Vn().memoizedState]},useMutableSource:O2,useSyncExternalStore:D2,useId:Q2,unstable_isNewReconciler:!1};function Ul(mt,gt){try{var _t="",Tt=gt;do _t+=Mm(Tt),Tt=Tt.return;while(Tt);var At=_t}catch(Dt){At=`
|
|
1039
1039
|
Error generating stack: `+Dt.message+`
|
|
1040
|
-
`+Dt.stack}return{value:mt,source:gt,stack:At,digest:null}}function v0(mt,gt,_t){return{value:mt,source:null,stack:_t??null,digest:gt??null}}function y0(mt,gt){try{console.error(gt.value)}catch(_t){setTimeout(function(){throw _t})}}var Bm=typeof WeakMap=="function"?WeakMap:Map;function ep(mt,gt,_t){(_t=Ro(-1,_t)).tag=3,_t.payload={element:null};var Tt=gt.value;return _t.callback=function(){y1||(y1=!0,N0=Tt),y0(0,gt)},_t}function tp(mt,gt,_t){(_t=Ro(-1,_t)).tag=3;var Tt=mt.type.getDerivedStateFromError;if(typeof Tt=="function"){var At=gt.value;_t.payload=function(){return Tt(At)},_t.callback=function(){y0(0,gt)}}var Dt=mt.stateNode;return Dt!==null&&typeof Dt.componentDidCatch=="function"&&(_t.callback=function(){y0(0,gt),typeof Tt!="function"&&(ko===null?ko=new Set([this]):ko.add(this));var Wt=gt.stack;this.componentDidCatch(gt.value,{componentStack:Wt!==null?Wt:""})}),_t}function rp(mt,gt,_t){var Tt=mt.pingCache;if(Tt===null){Tt=mt.pingCache=new Bm;var At=new Set;Tt.set(gt,At)}else(At=Tt.get(gt))===void 0&&(At=new Set,Tt.set(gt,At));At.has(_t)||(At.add(_t),mt=Ym.bind(null,mt,gt,_t),gt.then(mt,mt))}function sp(mt){do{var gt;if((gt=mt.tag===13)&&(gt=(gt=mt.memoizedState)===null||gt.dehydrated!==null),gt)return mt;mt=mt.return}while(mt!==null);return null}function np(mt,gt,_t,Tt,At){return 1&mt.mode?(mt.flags|=65536,mt.lanes=At,mt):(mt===gt?mt.flags|=65536:(mt.flags|=128,_t.flags|=131072,_t.flags&=-52805,_t.tag===1&&(_t.alternate===null?_t.tag=17:((gt=Ro(-1,1)).tag=2,Oo(_t,gt,1))),_t.lanes|=1),mt)}var zm=at.ReactCurrentOwner,Bs=!1;function zs(mt,gt,_t,Tt){gt.child=mt===null?$2(gt,null,_t,Tt):Fl(gt,mt.child,_t,Tt)}function ip(mt,gt,_t,Tt,At){_t=_t.render;var Dt=gt.ref;return Nl(gt,At),Tt=h0(mt,gt,_t,Tt,Dt,At),_t=f0(),mt===null||Bs?(ss&&_t&&q1(gt),gt.flags|=1,zs(mt,gt,Tt,At),gt.child):(gt.updateQueue=mt.updateQueue,gt.flags&=-2053,mt.lanes&=~At,To(mt,gt,At))}function op(mt,gt,_t,Tt,At){if(mt===null){var Dt=_t.type;return typeof Dt!="function"||V0(Dt)||Dt.defaultProps!==void 0||_t.compare!==null||_t.defaultProps!==void 0?((mt=R1(_t.type,null,Tt,gt,gt.mode,At)).ref=gt.ref,mt.return=gt,gt.child=mt):(gt.tag=15,gt.type=Dt,ap(mt,gt,Dt,Tt,At))}if(Dt=mt.child,(mt.lanes&At)==0){var Wt=Dt.memoizedProps;if((_t=(_t=_t.compare)!==null?_t:Xu)(Wt,Tt)&&mt.ref===gt.ref)return To(mt,gt,At)}return gt.flags|=1,(mt=Bo(Dt,Tt)).ref=gt.ref,mt.return=gt,gt.child=mt}function ap(mt,gt,_t,Tt,At){if(mt!==null){var Dt=mt.memoizedProps;if(Xu(Dt,Tt)&&mt.ref===gt.ref){if(Bs=!1,gt.pendingProps=Tt=Dt,(mt.lanes&At)==0)return gt.lanes=mt.lanes,To(mt,gt,At);131072&mt.flags&&(Bs=!0)}}return E0(mt,gt,_t,Tt,At)}function lp(mt,gt,_t){var Tt=gt.pendingProps,At=Tt.children,Dt=mt!==null?mt.memoizedState:null;if(Tt.mode==="hidden")if(!(1>.mode))gt.memoizedState={baseLanes:0,cachePool:null,transitions:null},Jr(Vl,Ks),Ks|=_t;else{if(!(1073741824&_t))return mt=Dt!==null?Dt.baseLanes|_t:_t,gt.lanes=gt.childLanes=1073741824,gt.memoizedState={baseLanes:mt,cachePool:null,transitions:null},gt.updateQueue=null,Jr(Vl,Ks),Ks|=mt,null;gt.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt=Dt!==null?Dt.baseLanes:_t,Jr(Vl,Ks),Ks|=Tt}else Dt!==null?(Tt=Dt.baseLanes|_t,gt.memoizedState=null):Tt=_t,Jr(Vl,Ks),Ks|=Tt;return zs(mt,gt,At,_t),gt.child}function up(mt,gt){var _t=gt.ref;(mt===null&&_t!==null||mt!==null&&mt.ref!==_t)&&(gt.flags|=512,gt.flags|=2097152)}function E0(mt,gt,_t,Tt,At){var Dt=Xs(_t)?na:Ts.current;return Dt=Ml(gt,Dt),Nl(gt,At),_t=h0(mt,gt,_t,Tt,Dt,At),Tt=f0(),mt===null||Bs?(ss&&Tt&&q1(gt),gt.flags|=1,zs(mt,gt,_t,At),gt.child):(gt.updateQueue=mt.updateQueue,gt.flags&=-2053,mt.lanes&=~At,To(mt,gt,At))}function cp(mt,gt,_t,Tt,At){if(Xs(_t)){var Dt=!0;zu(gt)}else Dt=!1;if(Nl(gt,At),gt.stateNode===null)u1(mt,gt),P2(gt,_t,Tt),i0(gt,_t,Tt,At),Tt=!0;else if(mt===null){var Wt=gt.stateNode,Zt=gt.memoizedProps;Wt.props=Zt;var rr=Wt.context,ir=_t.contextType;typeof ir=="object"&&ir!==null?ir=Un(ir):ir=Ml(gt,ir=Xs(_t)?na:Ts.current);var cr=_t.getDerivedStateFromProps,wr=typeof cr=="function"||typeof Wt.getSnapshotBeforeUpdate=="function";wr||typeof Wt.UNSAFE_componentWillReceiveProps!="function"&&typeof Wt.componentWillReceiveProps!="function"||(Zt!==Tt||rr!==ir)&&j2(gt,Wt,Tt,ir),$o=!1;var ar=gt.memoizedState;Wt.state=ar,Zu(gt,Tt,Wt,At),rr=gt.memoizedState,Zt!==Tt||ar!==rr||Fs.current||$o?(typeof cr=="function"&&(n0(gt,_t,cr,Tt),rr=gt.memoizedState),(Zt=$o||A2(gt,_t,Zt,Tt,ar,rr,ir))?(wr||typeof Wt.UNSAFE_componentWillMount!="function"&&typeof Wt.componentWillMount!="function"||(typeof Wt.componentWillMount=="function"&&Wt.componentWillMount(),typeof Wt.UNSAFE_componentWillMount=="function"&&Wt.UNSAFE_componentWillMount()),typeof Wt.componentDidMount=="function"&&(gt.flags|=4194308)):(typeof Wt.componentDidMount=="function"&&(gt.flags|=4194308),gt.memoizedProps=Tt,gt.memoizedState=rr),Wt.props=Tt,Wt.state=rr,Wt.context=ir,Tt=Zt):(typeof Wt.componentDidMount=="function"&&(gt.flags|=4194308),Tt=!1)}else{Wt=gt.stateNode,_2(mt,gt),Zt=gt.memoizedProps,ir=gt.type===gt.elementType?Zt:Zn(gt.type,Zt),Wt.props=ir,wr=gt.pendingProps,ar=Wt.context,typeof(rr=_t.contextType)=="object"&&rr!==null?rr=Un(rr):rr=Ml(gt,rr=Xs(_t)?na:Ts.current);var Er=_t.getDerivedStateFromProps;(cr=typeof Er=="function"||typeof Wt.getSnapshotBeforeUpdate=="function")||typeof Wt.UNSAFE_componentWillReceiveProps!="function"&&typeof Wt.componentWillReceiveProps!="function"||(Zt!==wr||ar!==rr)&&j2(gt,Wt,Tt,rr),$o=!1,ar=gt.memoizedState,Wt.state=ar,Zu(gt,Tt,Wt,At);var Cr=gt.memoizedState;Zt!==wr||ar!==Cr||Fs.current||$o?(typeof Er=="function"&&(n0(gt,_t,Er,Tt),Cr=gt.memoizedState),(ir=$o||A2(gt,_t,ir,Tt,ar,Cr,rr)||!1)?(cr||typeof Wt.UNSAFE_componentWillUpdate!="function"&&typeof Wt.componentWillUpdate!="function"||(typeof Wt.componentWillUpdate=="function"&&Wt.componentWillUpdate(Tt,Cr,rr),typeof Wt.UNSAFE_componentWillUpdate=="function"&&Wt.UNSAFE_componentWillUpdate(Tt,Cr,rr)),typeof Wt.componentDidUpdate=="function"&&(gt.flags|=4),typeof Wt.getSnapshotBeforeUpdate=="function"&&(gt.flags|=1024)):(typeof Wt.componentDidUpdate!="function"||Zt===mt.memoizedProps&&ar===mt.memoizedState||(gt.flags|=4),typeof Wt.getSnapshotBeforeUpdate!="function"||Zt===mt.memoizedProps&&ar===mt.memoizedState||(gt.flags|=1024),gt.memoizedProps=Tt,gt.memoizedState=Cr),Wt.props=Tt,Wt.state=Cr,Wt.context=rr,Tt=ir):(typeof Wt.componentDidUpdate!="function"||Zt===mt.memoizedProps&&ar===mt.memoizedState||(gt.flags|=4),typeof Wt.getSnapshotBeforeUpdate!="function"||Zt===mt.memoizedProps&&ar===mt.memoizedState||(gt.flags|=1024),Tt=!1)}return b0(mt,gt,_t,Tt,Dt,At)}function b0(mt,gt,_t,Tt,At,Dt){up(mt,gt);var Wt=(128>.flags)!=0;if(!Tt&&!Wt)return At&&d2(gt,_t,!1),To(mt,gt,Dt);Tt=gt.stateNode,zm.current=gt;var Zt=Wt&&typeof _t.getDerivedStateFromError!="function"?null:Tt.render();return gt.flags|=1,mt!==null&&Wt?(gt.child=Fl(gt,mt.child,null,Dt),gt.child=Fl(gt,null,Zt,Dt)):zs(mt,gt,Zt,Dt),gt.memoizedState=Tt.state,At&&d2(gt,_t,!0),gt.child}function dp(mt){var gt=mt.stateNode;gt.pendingContext?u2(0,gt.pendingContext,gt.pendingContext!==gt.context):gt.context&&u2(0,gt.context,!1),o0(mt,gt.containerInfo)}function hp(mt,gt,_t,Tt,At){return Dl(),Q1(At),gt.flags|=256,zs(mt,gt,_t,Tt),gt.child}var Su,_u,o1,a1,w0={dehydrated:null,treeContext:null,retryLane:0};function S0(mt){return{baseLanes:mt,cachePool:null,transitions:null}}function fp(mt,gt,_t){var Tt,At=gt.pendingProps,Dt=ls.current,Wt=!1,Zt=(128>.flags)!=0;if((Tt=Zt)||(Tt=(mt===null||mt.memoizedState!==null)&&(2&Dt)!=0),Tt?(Wt=!0,gt.flags&=-129):mt!==null&&mt.memoizedState===null||(Dt|=1),Jr(ls,1&Dt),mt===null)return K1(gt),(mt=gt.memoizedState)!==null&&(mt=mt.dehydrated)!==null?(1>.mode?wo(mt)?gt.lanes=8:gt.lanes=1073741824:gt.lanes=1,null):(Zt=At.children,mt=At.fallback,Wt?(At=gt.mode,Wt=gt.child,Zt={mode:"hidden",children:Zt},!(1&At)&&Wt!==null?(Wt.childLanes=0,Wt.pendingProps=Zt):Wt=T1(Zt,At,0,null),mt=El(mt,At,_t,null),Wt.return=gt,mt.return=gt,Wt.sibling=mt,gt.child=Wt,gt.child.memoizedState=S0(_t),gt.memoizedState=w0,mt):_0(gt,Zt));if((Dt=mt.memoizedState)!==null&&(Tt=Dt.dehydrated)!==null)return function(ir,cr,wr,ar,Er,Cr,Nr){if(wr)return 256&cr.flags?(cr.flags&=-257,l1(ir,cr,Nr,ar=v0(Error(ot(422))))):cr.memoizedState!==null?(cr.child=ir.child,cr.flags|=128,null):(Cr=ar.fallback,Er=cr.mode,ar=T1({mode:"visible",children:ar.children},Er,0,null),(Cr=El(Cr,Er,Nr,null)).flags|=2,ar.return=cr,Cr.return=cr,ar.sibling=Cr,cr.child=ar,1&cr.mode&&Fl(cr,ir.child,null,Nr),cr.child.memoizedState=S0(Nr),cr.memoizedState=w0,Cr);if(!(1&cr.mode))return l1(ir,cr,Nr,null);if(wo(Er))return ar=Jo(Er).digest,Cr=Error(ot(419)),ar=v0(Cr,ar,void 0),l1(ir,cr,Nr,ar);if(wr=(Nr&ir.childLanes)!=0,Bs||wr){if((ar=ys)!==null){switch(Nr&-Nr){case 4:Er=2;break;case 16:Er=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:Er=32;break;case 536870912:Er=268435456;break;default:Er=0}(Er=Er&(ar.suspendedLanes|Nr)?0:Er)!==0&&Er!==Cr.retryLane&&(Cr.retryLane=Er,lo(ir,Er),Gn(ar,ir,Er,-1))}return H0(),l1(ir,cr,Nr,ar=v0(Error(ot(421))))}return Mn(Er)?(cr.flags|=128,cr.child=ir.child,cr=Km.bind(null,ir),so(Er,cr),null):(ir=Cr.treeContext,Ar&&(Bn=dm(Er),Ys=cr,ss=!0,Qn=null,mu=!1,ir!==null&&($n[Fn++]=ao,$n[Fn++]=_o,$n[Fn++]=ga,ao=ir.id,_o=ir.overflow,ga=cr)),cr=_0(cr,ar.children),cr.flags|=4096,cr)}(mt,gt,Zt,At,Tt,Dt,_t);if(Wt){Wt=At.fallback,Zt=gt.mode,Tt=(Dt=mt.child).sibling;var rr={mode:"hidden",children:At.children};return!(1&Zt)&>.child!==Dt?((At=gt.child).childLanes=0,At.pendingProps=rr,gt.deletions=null):(At=Bo(Dt,rr)).subtreeFlags=14680064&Dt.subtreeFlags,Tt!==null?Wt=Bo(Tt,Wt):(Wt=El(Wt,Zt,_t,null)).flags|=2,Wt.return=gt,At.return=gt,At.sibling=Wt,gt.child=At,At=Wt,Wt=gt.child,Zt=(Zt=mt.child.memoizedState)===null?S0(_t):{baseLanes:Zt.baseLanes|_t,cachePool:null,transitions:Zt.transitions},Wt.memoizedState=Zt,Wt.childLanes=mt.childLanes&~_t,gt.memoizedState=w0,At}return mt=(Wt=mt.child).sibling,At=Bo(Wt,{mode:"visible",children:At.children}),!(1>.mode)&&(At.lanes=_t),At.return=gt,At.sibling=null,mt!==null&&((_t=gt.deletions)===null?(gt.deletions=[mt],gt.flags|=16):_t.push(mt)),gt.child=At,gt.memoizedState=null,At}function _0(mt,gt){return(gt=T1({mode:"visible",children:gt},mt.mode,0,null)).return=mt,mt.child=gt}function l1(mt,gt,_t,Tt){return Tt!==null&&Q1(Tt),Fl(gt,mt.child,null,_t),(mt=_0(gt,gt.pendingProps.children)).flags|=2,gt.memoizedState=null,mt}function pp(mt,gt,_t){mt.lanes|=gt;var Tt=mt.alternate;Tt!==null&&(Tt.lanes|=gt),t0(mt.return,gt,_t)}function R0(mt,gt,_t,Tt,At){var Dt=mt.memoizedState;Dt===null?mt.memoizedState={isBackwards:gt,rendering:null,renderingStartTime:0,last:Tt,tail:_t,tailMode:At}:(Dt.isBackwards=gt,Dt.rendering=null,Dt.renderingStartTime=0,Dt.last=Tt,Dt.tail=_t,Dt.tailMode=At)}function mp(mt,gt,_t){var Tt=gt.pendingProps,At=Tt.revealOrder,Dt=Tt.tail;if(zs(mt,gt,Tt.children,_t),(2&(Tt=ls.current))!=0)Tt=1&Tt|2,gt.flags|=128;else{if(mt!==null&&128&mt.flags)e:for(mt=gt.child;mt!==null;){if(mt.tag===13)mt.memoizedState!==null&&pp(mt,_t,gt);else if(mt.tag===19)pp(mt,_t,gt);else if(mt.child!==null){mt.child.return=mt,mt=mt.child;continue}if(mt===gt)break e;for(;mt.sibling===null;){if(mt.return===null||mt.return===gt)break e;mt=mt.return}mt.sibling.return=mt.return,mt=mt.sibling}Tt&=1}if(Jr(ls,Tt),(1>.mode)==0)gt.memoizedState=null;else switch(At){case"forwards":for(_t=gt.child,At=null;_t!==null;)(mt=_t.alternate)!==null&&e1(mt)===null&&(At=_t),_t=_t.sibling;(_t=At)===null?(At=gt.child,gt.child=null):(At=_t.sibling,_t.sibling=null),R0(gt,!1,At,_t,Dt);break;case"backwards":for(_t=null,At=gt.child,gt.child=null;At!==null;){if((mt=At.alternate)!==null&&e1(mt)===null){gt.child=At;break}mt=At.sibling,At.sibling=_t,_t=At,At=mt}R0(gt,!0,_t,null,Dt);break;case"together":R0(gt,!1,null,null,void 0);break;default:gt.memoizedState=null}return gt.child}function u1(mt,gt){!(1>.mode)&&mt!==null&&(mt.alternate=null,gt.alternate=null,gt.flags|=2)}function To(mt,gt,_t){if(mt!==null&&(gt.dependencies=mt.dependencies),$a|=gt.lanes,(_t>.childLanes)==0)return null;if(mt!==null&>.child!==mt.child)throw Error(ot(153));if(gt.child!==null){for(_t=Bo(mt=gt.child,mt.pendingProps),gt.child=_t,_t.return=gt;mt.sibling!==null;)mt=mt.sibling,(_t=_t.sibling=Bo(mt,mt.pendingProps)).return=gt;_t.sibling=null}return gt.child}function ho(mt){mt.flags|=4}function gp(mt,gt){if(mt!==null&&mt.child===gt.child)return!0;if(16>.flags)return!1;for(mt=gt.child;mt!==null;){if(12854&mt.flags||12854&mt.subtreeFlags)return!1;mt=mt.sibling}return!0}if(pr)Su=function(mt,gt){for(var _t=gt.child;_t!==null;){if(_t.tag===5||_t.tag===6)Qt(mt,_t.stateNode);else if(_t.tag!==4&&_t.child!==null){_t.child.return=_t,_t=_t.child;continue}if(_t===gt)break;for(;_t.sibling===null;){if(_t.return===null||_t.return===gt)return;_t=_t.return}_t.sibling.return=_t.return,_t=_t.sibling}},_u=function(){},o1=function(mt,gt,_t,Tt,At){if((mt=mt.memoizedProps)!==Tt){var Dt=gt.stateNode,Wt=uo(Hn.current);_t=tr(Dt,_t,mt,Tt,At,Wt),(gt.updateQueue=_t)&&ho(gt)}},a1=function(mt,gt,_t,Tt){_t!==Tt&&ho(gt)};else if(_r){Su=function(mt,gt,_t,Tt){for(var At=gt.child;At!==null;){if(At.tag===5){var Dt=At.stateNode;_t&&Tt&&(Dt=qs(Dt,At.type,At.memoizedProps,At)),Qt(mt,Dt)}else if(At.tag===6)Dt=At.stateNode,_t&&Tt&&(Dt=bo(Dt,At.memoizedProps,At)),Qt(mt,Dt);else if(At.tag!==4){if(At.tag===22&&At.memoizedState!==null)(Dt=At.child)!==null&&(Dt.return=At),Su(mt,At,!0,!0);else if(At.child!==null){At.child.return=At,At=At.child;continue}}if(At===gt)break;for(;At.sibling===null;){if(At.return===null||At.return===gt)return;At=At.return}At.sibling.return=At.return,At=At.sibling}};var xp=function(mt,gt,_t,Tt){for(var At=gt.child;At!==null;){if(At.tag===5){var Dt=At.stateNode;_t&&Tt&&(Dt=qs(Dt,At.type,At.memoizedProps,At)),Xn(mt,Dt)}else if(At.tag===6)Dt=At.stateNode,_t&&Tt&&(Dt=bo(Dt,At.memoizedProps,At)),Xn(mt,Dt);else if(At.tag!==4){if(At.tag===22&&At.memoizedState!==null)(Dt=At.child)!==null&&(Dt.return=At),xp(mt,At,!0,!0);else if(At.child!==null){At.child.return=At,At=At.child;continue}}if(At===gt)break;for(;At.sibling===null;){if(At.return===null||At.return===gt)return;At=At.return}At.sibling.return=At.return,At=At.sibling}};_u=function(mt,gt){var _t=gt.stateNode;if(!gp(mt,gt)){mt=_t.containerInfo;var Tt=Rs(mt);xp(Tt,gt,!1,!1),_t.pendingChildren=Tt,ho(gt),Ns(mt,Tt)}},o1=function(mt,gt,_t,Tt,At){var Dt=mt.stateNode,Wt=mt.memoizedProps;if((mt=gp(mt,gt))&&Wt===Tt)gt.stateNode=Dt;else{var Zt=gt.stateNode,rr=uo(Hn.current),ir=null;Wt!==Tt&&(ir=tr(Zt,_t,Wt,Tt,At,rr)),mt&&ir===null?gt.stateNode=Dt:(Dt=Is(Dt,ir,_t,Wt,Tt,gt,mt,Zt),Yt(Dt,_t,Tt,At,rr)&&ho(gt),gt.stateNode=Dt,mt?ho(gt):Su(Dt,gt,!1,!1))}},a1=function(mt,gt,_t,Tt){_t!==Tt?(mt=uo(Bl.current),_t=uo(Hn.current),gt.stateNode=ur(Tt,mt,_t,gt),ho(gt)):gt.stateNode=mt.stateNode}}else _u=function(){},o1=function(){},a1=function(){};function Ru(mt,gt){if(!ss)switch(mt.tailMode){case"hidden":gt=mt.tail;for(var _t=null;gt!==null;)gt.alternate!==null&&(_t=gt),gt=gt.sibling;_t===null?mt.tail=null:_t.sibling=null;break;case"collapsed":_t=mt.tail;for(var Tt=null;_t!==null;)_t.alternate!==null&&(Tt=_t),_t=_t.sibling;Tt===null?gt||mt.tail===null?mt.tail=null:mt.tail.sibling=null:Tt.sibling=null}}function Ms(mt){var gt=mt.alternate!==null&&mt.alternate.child===mt.child,_t=0,Tt=0;if(gt)for(var At=mt.child;At!==null;)_t|=At.lanes|At.childLanes,Tt|=14680064&At.subtreeFlags,Tt|=14680064&At.flags,At.return=mt,At=At.sibling;else for(At=mt.child;At!==null;)_t|=At.lanes|At.childLanes,Tt|=At.subtreeFlags,Tt|=At.flags,At.return=mt,At=At.sibling;return mt.subtreeFlags|=Tt,mt.childLanes=_t,gt}function Um(mt,gt,_t){var Tt=gt.pendingProps;switch(X1(gt),gt.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ms(gt),null;case 1:case 17:return Xs(gt.type)&&N1(),Ms(gt),null;case 3:return _t=gt.stateNode,zl(),rs(Fs),rs(Ts),u0(),_t.pendingContext&&(_t.context=_t.pendingContext,_t.pendingContext=null),mt!==null&&mt.child!==null||(qu(gt)?ho(gt):mt===null||mt.memoizedState.isDehydrated&&!(256>.flags)||(gt.flags|=1024,Qn!==null&&(z0(Qn),Qn=null))),_u(mt,gt),Ms(gt),null;case 5:a0(gt),_t=uo(Bl.current);var At=gt.type;if(mt!==null&>.stateNode!=null)o1(mt,gt,At,Tt,_t),mt.ref!==gt.ref&&(gt.flags|=512,gt.flags|=2097152);else{if(!Tt){if(gt.stateNode===null)throw Error(ot(166));return Ms(gt),null}if(mt=uo(Hn.current),qu(gt)){if(!Ar)throw Error(ot(175));mt=hm(gt.stateNode,gt.type,gt.memoizedProps,_t,mt,gt,!mu),gt.updateQueue=mt,mt!==null&&ho(gt)}else{var Dt=qt(At,Tt,_t,mt,gt);Su(Dt,gt,!1,!1),gt.stateNode=Dt,Yt(Dt,At,Tt,_t,mt)&&ho(gt)}gt.ref!==null&&(gt.flags|=512,gt.flags|=2097152)}return Ms(gt),null;case 6:if(mt&>.stateNode!=null)a1(mt,gt,mt.memoizedProps,Tt);else{if(typeof Tt!="string"&>.stateNode===null)throw Error(ot(166));if(mt=uo(Bl.current),_t=uo(Hn.current),qu(gt)){if(!Ar)throw Error(ot(176));if(mt=gt.stateNode,_t=gt.memoizedProps,(Tt=fm(mt,_t,gt,!mu))&&(At=Ys)!==null)switch(At.tag){case 3:bm(At.stateNode.containerInfo,mt,_t,(1&At.mode)!=0);break;case 5:wm(At.type,At.memoizedProps,At.stateNode,mt,_t,(1&At.mode)!=0)}Tt&&ho(gt)}else gt.stateNode=ur(Tt,mt,_t,gt)}return Ms(gt),null;case 13:if(rs(ls),Tt=gt.memoizedState,mt===null||mt.memoizedState!==null&&mt.memoizedState.dehydrated!==null){if(ss&&Bn!==null&&1>.mode&&!(128>.flags))b2(),Dl(),gt.flags|=98560,At=!1;else if(At=qu(gt),Tt!==null&&Tt.dehydrated!==null){if(mt===null){if(!At)throw Error(ot(318));if(!Ar)throw Error(ot(344));if(!(At=(At=gt.memoizedState)!==null?At.dehydrated:null))throw Error(ot(317));pm(At,gt)}else Dl(),!(128>.flags)&&(gt.memoizedState=null),gt.flags|=4;Ms(gt),At=!1}else Qn!==null&&(z0(Qn),Qn=null),At=!0;if(!At)return 65536>.flags?gt:null}return 128>.flags?(gt.lanes=_t,gt):((_t=Tt!==null)!=(mt!==null&&mt.memoizedState!==null)&&_t&&(gt.child.flags|=8192,1>.mode&&(mt===null||1&ls.current?fs===0&&(fs=3):H0())),gt.updateQueue!==null&&(gt.flags|=4),Ms(gt),null);case 4:return zl(),_u(mt,gt),mt===null&&Ur(gt.stateNode.containerInfo),Ms(gt),null;case 10:return e0(gt.type._context),Ms(gt),null;case 19:if(rs(ls),(At=gt.memoizedState)===null)return Ms(gt),null;if(Tt=(128>.flags)!=0,(Dt=At.rendering)===null)if(Tt)Ru(At,!1);else{if(fs!==0||mt!==null&&128&mt.flags)for(mt=gt.child;mt!==null;){if((Dt=e1(mt))!==null){for(gt.flags|=128,Ru(At,!1),(mt=Dt.updateQueue)!==null&&(gt.updateQueue=mt,gt.flags|=4),gt.subtreeFlags=0,mt=_t,_t=gt.child;_t!==null;)At=mt,(Tt=_t).flags&=14680066,(Dt=Tt.alternate)===null?(Tt.childLanes=0,Tt.lanes=At,Tt.child=null,Tt.subtreeFlags=0,Tt.memoizedProps=null,Tt.memoizedState=null,Tt.updateQueue=null,Tt.dependencies=null,Tt.stateNode=null):(Tt.childLanes=Dt.childLanes,Tt.lanes=Dt.lanes,Tt.child=Dt.child,Tt.subtreeFlags=0,Tt.deletions=null,Tt.memoizedProps=Dt.memoizedProps,Tt.memoizedState=Dt.memoizedState,Tt.updateQueue=Dt.updateQueue,Tt.type=Dt.type,At=Dt.dependencies,Tt.dependencies=At===null?null:{lanes:At.lanes,firstContext:At.firstContext}),_t=_t.sibling;return Jr(ls,1&ls.current|2),gt.child}mt=mt.sibling}At.tail!==null&&gs()>L0&&(gt.flags|=128,Tt=!0,Ru(At,!1),gt.lanes=4194304)}else{if(!Tt)if((mt=e1(Dt))!==null){if(gt.flags|=128,Tt=!0,(mt=mt.updateQueue)!==null&&(gt.updateQueue=mt,gt.flags|=4),Ru(At,!0),At.tail===null&&At.tailMode==="hidden"&&!Dt.alternate&&!ss)return Ms(gt),null}else 2*gs()-At.renderingStartTime>L0&&_t!==1073741824&&(gt.flags|=128,Tt=!0,Ru(At,!1),gt.lanes=4194304);At.isBackwards?(Dt.sibling=gt.child,gt.child=Dt):((mt=At.last)!==null?mt.sibling=Dt:gt.child=Dt,At.last=Dt)}return At.tail!==null?(gt=At.tail,At.rendering=gt,At.tail=gt.sibling,At.renderingStartTime=gs(),gt.sibling=null,mt=ls.current,Jr(ls,Tt?1&mt|2:1&mt),gt):(Ms(gt),null);case 22:case 23:return U0(),_t=gt.memoizedState!==null,mt!==null&&mt.memoizedState!==null!==_t&&(gt.flags|=8192),_t&&1>.mode?1073741824&Ks&&(Ms(gt),pr&&6>.subtreeFlags&&(gt.flags|=8192)):Ms(gt),null;case 24:case 25:return null}throw Error(ot(156,gt.tag))}function Hm(mt,gt){switch(X1(gt),gt.tag){case 1:return Xs(gt.type)&&N1(),65536&(mt=gt.flags)?(gt.flags=-65537&mt|128,gt):null;case 3:return zl(),rs(Fs),rs(Ts),u0(),65536&(mt=gt.flags)&&!(128&mt)?(gt.flags=-65537&mt|128,gt):null;case 5:return a0(gt),null;case 13:if(rs(ls),(mt=gt.memoizedState)!==null&&mt.dehydrated!==null){if(gt.alternate===null)throw Error(ot(340));Dl()}return 65536&(mt=gt.flags)?(gt.flags=-65537&mt|128,gt):null;case 19:return rs(ls),null;case 4:return zl(),null;case 10:return e0(gt.type._context),null;case 22:case 23:return U0(),null;default:return null}}var c1=!1,As=!1,Vm=typeof WeakSet=="function"?WeakSet:Set,Rr=null;function Hl(mt,gt){var _t=mt.ref;if(_t!==null)if(typeof _t=="function")try{_t(null)}catch(Tt){ns(mt,gt,Tt)}else _t.current=null}function vp(mt,gt,_t){try{_t()}catch(Tt){ns(mt,gt,Tt)}}var yp=!1;function Tu(mt,gt,_t){var Tt=gt.updateQueue;if((Tt=Tt!==null?Tt.lastEffect:null)!==null){var At=Tt=Tt.next;do{if((At.tag&mt)===mt){var Dt=At.destroy;At.destroy=void 0,Dt!==void 0&&vp(gt,_t,Dt)}At=At.next}while(At!==Tt)}}function d1(mt,gt){if((gt=(gt=gt.updateQueue)!==null?gt.lastEffect:null)!==null){var _t=gt=gt.next;do{if((_t.tag&mt)===mt){var Tt=_t.create;_t.destroy=Tt()}_t=_t.next}while(_t!==gt)}}function T0(mt){var gt=mt.ref;if(gt!==null){var _t=mt.stateNode;mt.tag===5?mt=Ft(_t):mt=_t,typeof gt=="function"?gt(mt):gt.current=mt}}function Ep(mt){var gt=mt.alternate;gt!==null&&(mt.alternate=null,Ep(gt)),mt.child=null,mt.deletions=null,mt.sibling=null,mt.tag===5&&(gt=mt.stateNode)!==null&&Gs(gt),mt.stateNode=null,mt.return=null,mt.dependencies=null,mt.memoizedProps=null,mt.memoizedState=null,mt.pendingProps=null,mt.stateNode=null,mt.updateQueue=null}function bp(mt){return mt.tag===5||mt.tag===3||mt.tag===4}function wp(mt){e:for(;;){for(;mt.sibling===null;){if(mt.return===null||bp(mt.return))return null;mt=mt.return}for(mt.sibling.return=mt.return,mt=mt.sibling;mt.tag!==5&&mt.tag!==6&&mt.tag!==18;){if(2&mt.flags||mt.child===null||mt.tag===4)continue e;mt.child.return=mt,mt=mt.child}if(!(2&mt.flags))return mt.stateNode}}function C0(mt,gt,_t){var Tt=mt.tag;if(Tt===5||Tt===6)mt=mt.stateNode,gt?Wr(_t,mt,gt):Zr(_t,mt);else if(Tt!==4&&(mt=mt.child)!==null)for(C0(mt,gt,_t),mt=mt.sibling;mt!==null;)C0(mt,gt,_t),mt=mt.sibling}function A0(mt,gt,_t){var Tt=mt.tag;if(Tt===5||Tt===6)mt=mt.stateNode,gt?kr(_t,mt,gt):Dr(_t,mt);else if(Tt!==4&&(mt=mt.child)!==null)for(A0(mt,gt,_t),mt=mt.sibling;mt!==null;)A0(mt,gt,_t),mt=mt.sibling}var $s=null,fo=!1;function po(mt,gt,_t){for(_t=_t.child;_t!==null;)P0(mt,gt,_t),_t=_t.sibling}function P0(mt,gt,_t){if(io&&typeof io.onCommitFiberUnmount=="function")try{io.onCommitFiberUnmount(Hu,_t)}catch{}switch(_t.tag){case 5:As||Hl(_t,gt);case 6:if(pr){var Tt=$s,At=fo;$s=null,po(mt,gt,_t),fo=At,($s=Tt)!==null&&(fo?ps($s,_t.stateNode):bs($s,_t.stateNode))}else po(mt,gt,_t);break;case 18:pr&&$s!==null&&(fo?ym($s,_t.stateNode):vm($s,_t.stateNode));break;case 4:pr?(Tt=$s,At=fo,$s=_t.stateNode.containerInfo,fo=!0,po(mt,gt,_t),$s=Tt,fo=At):(_r&&(Tt=_t.stateNode.containerInfo,At=Rs(Tt),ws(Tt,At)),po(mt,gt,_t));break;case 0:case 11:case 14:case 15:if(!As&&(Tt=_t.updateQueue)!==null&&(Tt=Tt.lastEffect)!==null){At=Tt=Tt.next;do{var Dt=At,Wt=Dt.destroy;Dt=Dt.tag,Wt!==void 0&&(2&Dt||4&Dt)&&vp(_t,gt,Wt),At=At.next}while(At!==Tt)}po(mt,gt,_t);break;case 1:if(!As&&(Hl(_t,gt),typeof(Tt=_t.stateNode).componentWillUnmount=="function"))try{Tt.props=_t.memoizedProps,Tt.state=_t.memoizedState,Tt.componentWillUnmount()}catch(Zt){ns(_t,gt,Zt)}po(mt,gt,_t);break;case 21:po(mt,gt,_t);break;case 22:1&_t.mode?(As=(Tt=As)||_t.memoizedState!==null,po(mt,gt,_t),As=Tt):po(mt,gt,_t);break;default:po(mt,gt,_t)}}function Sp(mt){var gt=mt.updateQueue;if(gt!==null){mt.updateQueue=null;var _t=mt.stateNode;_t===null&&(_t=mt.stateNode=new Vm),gt.forEach(function(Tt){var At=Qm.bind(null,mt,Tt);_t.has(Tt)||(_t.add(Tt),Tt.then(At,At))})}}function Jn(mt,gt){var _t=gt.deletions;if(_t!==null)for(var Tt=0;Tt<_t.length;Tt++){var At=_t[Tt];try{var Dt=mt,Wt=gt;if(pr){var Zt=Wt;e:for(;Zt!==null;){switch(Zt.tag){case 5:$s=Zt.stateNode,fo=!1;break e;case 3:case 4:$s=Zt.stateNode.containerInfo,fo=!0;break e}Zt=Zt.return}if($s===null)throw Error(ot(160));P0(Dt,Wt,At),$s=null,fo=!1}else P0(Dt,Wt,At);var rr=At.alternate;rr!==null&&(rr.return=null),At.return=null}catch(ir){ns(At,gt,ir)}}if(12854>.subtreeFlags)for(gt=gt.child;gt!==null;)_p(gt,mt),gt=gt.sibling}function _p(mt,gt){var _t=mt.alternate,Tt=mt.flags;switch(mt.tag){case 0:case 11:case 14:case 15:if(Jn(gt,mt),mo(mt),4&Tt){try{Tu(3,mt,mt.return),d1(3,mt)}catch(ar){ns(mt,mt.return,ar)}try{Tu(5,mt,mt.return)}catch(ar){ns(mt,mt.return,ar)}}break;case 1:Jn(gt,mt),mo(mt),512&Tt&&_t!==null&&Hl(_t,_t.return);break;case 5:if(Jn(gt,mt),mo(mt),512&Tt&&_t!==null&&Hl(_t,_t.return),pr){if(32&mt.flags){var At=mt.stateNode;try{zr(At)}catch(ar){ns(mt,mt.return,ar)}}if(4&Tt&&(At=mt.stateNode)!=null){var Dt=mt.memoizedProps;if(_t=_t!==null?_t.memoizedProps:Dt,Tt=mt.type,gt=mt.updateQueue,mt.updateQueue=null,gt!==null)try{Br(At,gt,Tt,_t,Dt,mt)}catch(ar){ns(mt,mt.return,ar)}}}break;case 6:if(Jn(gt,mt),mo(mt),4&Tt&&pr){if(mt.stateNode===null)throw Error(ot(162));At=mt.stateNode,Dt=mt.memoizedProps,_t=_t!==null?_t.memoizedProps:Dt;try{ks(At,_t,Dt)}catch(ar){ns(mt,mt.return,ar)}}break;case 3:if(Jn(gt,mt),mo(mt),4&Tt){if(pr&&Ar&&_t!==null&&_t.memoizedState.isDehydrated)try{gm(gt.containerInfo)}catch(ar){ns(mt,mt.return,ar)}if(_r){At=gt.containerInfo,Dt=gt.pendingChildren;try{ws(At,Dt)}catch(ar){ns(mt,mt.return,ar)}}}break;case 4:if(Jn(gt,mt),mo(mt),4&Tt&&_r){At=(Dt=mt.stateNode).containerInfo,Dt=Dt.pendingChildren;try{ws(At,Dt)}catch(ar){ns(mt,mt.return,ar)}}break;case 13:Jn(gt,mt),mo(mt),8192&(At=mt.child).flags&&(Dt=At.memoizedState!==null,At.stateNode.isHidden=Dt,!Dt||At.alternate!==null&&At.alternate.memoizedState!==null||(k0=gs())),4&Tt&&Sp(mt);break;case 22:var Wt=_t!==null&&_t.memoizedState!==null;if(1&mt.mode?(As=(_t=As)||Wt,Jn(gt,mt),As=_t):Jn(gt,mt),mo(mt),8192&Tt){if(_t=mt.memoizedState!==null,(mt.stateNode.isHidden=_t)&&!Wt&&(1&mt.mode)!=0)for(Rr=mt,Tt=mt.child;Tt!==null;){for(gt=Rr=Tt;Rr!==null;){var Zt=(Wt=Rr).child;switch(Wt.tag){case 0:case 11:case 14:case 15:Tu(4,Wt,Wt.return);break;case 1:Hl(Wt,Wt.return);var rr=Wt.stateNode;if(typeof rr.componentWillUnmount=="function"){var ir=Wt,cr=Wt.return;try{var wr=ir;rr.props=wr.memoizedProps,rr.state=wr.memoizedState,rr.componentWillUnmount()}catch(ar){ns(ir,cr,ar)}}break;case 5:Hl(Wt,Wt.return);break;case 22:if(Wt.memoizedState!==null){Cp(gt);continue}}Zt!==null?(Zt.return=Wt,Rr=Zt):Cp(gt)}Tt=Tt.sibling}if(pr){e:if(Tt=null,pr)for(gt=mt;;){if(gt.tag===5){if(Tt===null){Tt=gt;try{At=gt.stateNode,_t?$r(At):Zo(gt.stateNode,gt.memoizedProps)}catch(ar){ns(mt,mt.return,ar)}}}else if(gt.tag===6){if(Tt===null)try{Dt=gt.stateNode,_t?Ls(Dt):Pl(Dt,gt.memoizedProps)}catch(ar){ns(mt,mt.return,ar)}}else if((gt.tag!==22&>.tag!==23||gt.memoizedState===null||gt===mt)&>.child!==null){gt.child.return=gt,gt=gt.child;continue}if(gt===mt)break e;for(;gt.sibling===null;){if(gt.return===null||gt.return===mt)break e;Tt===gt&&(Tt=null),gt=gt.return}Tt===gt&&(Tt=null),gt.sibling.return=gt.return,gt=gt.sibling}}}break;case 19:Jn(gt,mt),mo(mt),4&Tt&&Sp(mt);break;case 21:break;default:Jn(gt,mt),mo(mt)}}function mo(mt){var gt=mt.flags;if(2>){try{if(pr){e:{for(var _t=mt.return;_t!==null;){if(bp(_t)){var Tt=_t;break e}_t=_t.return}throw Error(ot(160))}switch(Tt.tag){case 5:var At=Tt.stateNode;32&Tt.flags&&(zr(At),Tt.flags&=-33),A0(mt,wp(mt),At);break;case 3:case 4:var Dt=Tt.stateNode.containerInfo;C0(mt,wp(mt),Dt);break;default:throw Error(ot(161))}}}catch(Wt){ns(mt,mt.return,Wt)}mt.flags&=-3}4096>&&(mt.flags&=-4097)}function Gm(mt,gt,_t){Rr=mt,Rp(mt)}function Rp(mt,gt,_t){for(var Tt=(1&mt.mode)!=0;Rr!==null;){var At=Rr,Dt=At.child;if(At.tag===22&&Tt){var Wt=At.memoizedState!==null||c1;if(!Wt){var Zt=At.alternate,rr=Zt!==null&&Zt.memoizedState!==null||As;Zt=c1;var ir=As;if(c1=Wt,(As=rr)&&!ir)for(Rr=At;Rr!==null;)rr=(Wt=Rr).child,Wt.tag===22&&Wt.memoizedState!==null?Ap(At):rr!==null?(rr.return=Wt,Rr=rr):Ap(At);for(;Dt!==null;)Rr=Dt,Rp(Dt),Dt=Dt.sibling;Rr=At,c1=Zt,As=ir}Tp(mt)}else 8772&At.subtreeFlags&&Dt!==null?(Dt.return=At,Rr=Dt):Tp(mt)}}function Tp(mt){for(;Rr!==null;){var gt=Rr;if(8772>.flags){var _t=gt.alternate;try{if(8772>.flags)switch(gt.tag){case 0:case 11:case 15:As||d1(5,gt);break;case 1:var Tt=gt.stateNode;if(4>.flags&&!As)if(_t===null)Tt.componentDidMount();else{var At=gt.elementType===gt.type?_t.memoizedProps:Zn(gt.type,_t.memoizedProps);Tt.componentDidUpdate(At,_t.memoizedState,Tt.__reactInternalSnapshotBeforeUpdate)}var Dt=gt.updateQueue;Dt!==null&&T2(gt,Dt,Tt);break;case 3:var Wt=gt.updateQueue;if(Wt!==null){if(_t=null,gt.child!==null)switch(gt.child.tag){case 5:_t=Ft(gt.child.stateNode);break;case 1:_t=gt.child.stateNode}T2(gt,Wt,_t)}break;case 5:var Zt=gt.stateNode;_t===null&&4>.flags&&Ir(Zt,gt.type,gt.memoizedProps,gt);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(Ar&>.memoizedState===null){var rr=gt.alternate;if(rr!==null){var ir=rr.memoizedState;if(ir!==null){var cr=ir.dehydrated;cr!==null&&xm(cr)}}}break;default:throw Error(ot(163))}As||512>.flags&&T0(gt)}catch(wr){ns(gt,gt.return,wr)}}if(gt===mt){Rr=null;break}if((_t=gt.sibling)!==null){_t.return=gt.return,Rr=_t;break}Rr=gt.return}}function Cp(mt){for(;Rr!==null;){var gt=Rr;if(gt===mt){Rr=null;break}var _t=gt.sibling;if(_t!==null){_t.return=gt.return,Rr=_t;break}Rr=gt.return}}function Ap(mt){for(;Rr!==null;){var gt=Rr;try{switch(gt.tag){case 0:case 11:case 15:var _t=gt.return;try{d1(4,gt)}catch(rr){ns(gt,_t,rr)}break;case 1:var Tt=gt.stateNode;if(typeof Tt.componentDidMount=="function"){var At=gt.return;try{Tt.componentDidMount()}catch(rr){ns(gt,At,rr)}}var Dt=gt.return;try{T0(gt)}catch(rr){ns(gt,Dt,rr)}break;case 5:var Wt=gt.return;try{T0(gt)}catch(rr){ns(gt,Wt,rr)}}}catch(rr){ns(gt,gt.return,rr)}if(gt===mt){Rr=null;break}var Zt=gt.sibling;if(Zt!==null){Zt.return=gt.return,Rr=Zt;break}Rr=gt.return}}var h1=0,f1=1,p1=2,m1=3,g1=4;if(typeof Symbol=="function"&&Symbol.for){var Cu=Symbol.for;h1=Cu("selector.component"),f1=Cu("selector.has_pseudo_class"),p1=Cu("selector.role"),m1=Cu("selector.test_id"),g1=Cu("selector.text")}function j0(mt){var gt=Hr(mt);if(gt!=null){if(typeof gt.memoizedProps["data-testname"]!="string")throw Error(ot(364));return gt}if((mt=er(mt))===null)throw Error(ot(362));return mt.stateNode.current}function I0(mt,gt){switch(gt.$$typeof){case h1:if(mt.type===gt.value)return!0;break;case f1:e:{gt=gt.value,mt=[mt,0];for(var _t=0;_t<mt.length;){var Tt=mt[_t++],At=mt[_t++],Dt=gt[At];if(Tt.tag!==5||!gr(Tt)){for(;Dt!=null&&I0(Tt,Dt);)Dt=gt[++At];if(At===gt.length){gt=!0;break e}for(Tt=Tt.child;Tt!==null;)mt.push(Tt,At),Tt=Tt.sibling}}gt=!1}return gt;case p1:if(mt.tag===5&&vr(mt.stateNode,gt.value))return!0;break;case g1:if((mt.tag===5||mt.tag===6)&&(mt=br(mt))!==null&&0<=mt.indexOf(gt.value))return!0;break;case m1:if(mt.tag===5&&typeof(mt=mt.memoizedProps["data-testname"])=="string"&&mt.toLowerCase()===gt.value.toLowerCase())return!0;break;default:throw Error(ot(365))}return!1}function M0(mt){switch(mt.$$typeof){case h1:return"<"+(It(mt.value)||"Unknown")+">";case f1:return":has("+(M0(mt)||"")+")";case p1:return'[role="'+mt.value+'"]';case g1:return'"'+mt.value+'"';case m1:return'[data-testname="'+mt.value+'"]';default:throw Error(ot(365))}}function Pp(mt,gt){var _t=[];mt=[mt,0];for(var Tt=0;Tt<mt.length;){var At=mt[Tt++],Dt=mt[Tt++],Wt=gt[Dt];if(At.tag!==5||!gr(At)){for(;Wt!=null&&I0(At,Wt);)Wt=gt[++Dt];if(Dt===gt.length)_t.push(At);else for(At=At.child;At!==null;)mt.push(At,Dt),At=At.sibling}}return _t}function $0(mt,gt){if(!Xt)throw Error(ot(363));mt=Pp(mt=j0(mt),gt),gt=[],mt=Array.from(mt);for(var _t=0;_t<mt.length;){var Tt=mt[_t++];if(Tt.tag===5)gr(Tt)||gt.push(Tt.stateNode);else for(Tt=Tt.child;Tt!==null;)mt.push(Tt),Tt=Tt.sibling}return gt}var Wm=Math.ceil,x1=at.ReactCurrentDispatcher,O0=at.ReactCurrentOwner,cs=at.ReactCurrentBatchConfig,Vr=0,ys=null,ds=null,Ss=0,Ks=0,Vl=Io(0),fs=0,Au=null,$a=0,v1=0,D0=0,Pu=null,Qs=null,k0=0,L0=1/0,Do=null;function Gl(){L0=gs()+500}var jp,y1=!1,N0=null,ko=null,E1=!1,Lo=null,b1=0,ju=0,F0=null,w1=-1,S1=0;function Ps(){return 6&Vr?gs():w1!==-1?w1:w1=gs()}function No(mt){return 1&mt.mode?2&Vr&&Ss!==0?Ss&-Ss:Im.transition!==null?(S1===0&&(S1=h2()),S1):(mt=qr)!==0?mt:os():1}function Gn(mt,gt,_t,Tt){if(50<ju)throw ju=0,F0=null,Error(ot(185));pu(mt,_t,Tt),2&Vr&&mt===ys||(mt===ys&&(!(2&Vr)&&(v1|=_t),fs===4&&Fo(mt,Ss)),Us(mt,Tt),_t===1&&Vr===0&&!(1>.mode)&&(Gl(),Vu&&oo()))}function Us(mt,gt){var _t=mt.callbackNode;(function(At,Dt){for(var Wt=At.suspendedLanes,Zt=At.pingedLanes,rr=At.expirationTimes,ir=At.pendingLanes;0<ir;){var cr=31-Yn(ir),wr=1<<cr,ar=rr[cr];ar===-1?wr&Wt&&!(wr&Zt)||(rr[cr]=Tm(wr,Dt)):ar<=Dt&&(At.expiredLanes|=wr),ir&=~wr}})(mt,gt);var Tt=Uu(mt,mt===ys?Ss:0);if(Tt===0)_t!==null&&p2(_t),mt.callbackNode=null,mt.callbackPriority=0;else if(gt=Tt&-Tt,mt.callbackPriority!==gt){if(_t!=null&&p2(_t),gt===1)mt.tag===0?function(At){Vu=!0,g2(At)}(Mp.bind(null,mt)):g2(Mp.bind(null,mt)),Es?Ws(function(){!(6&Vr)&&oo()}):V1(G1,oo),_t=null;else{switch(f2(Tt)){case 1:_t=G1;break;case 4:_t=Pm;break;case 16:default:_t=m2;break;case 536870912:_t=jm}_t=Bp(_t,Ip.bind(null,mt))}mt.callbackPriority=gt,mt.callbackNode=_t}}function Ip(mt,gt){if(w1=-1,S1=0,(6&Vr)!=0)throw Error(ot(327));var _t=mt.callbackNode;if(yl()&&mt.callbackNode!==_t)return null;var Tt=Uu(mt,mt===ys?Ss:0);if(Tt===0)return null;if(30&Tt||Tt&mt.expiredLanes||gt)gt=_1(mt,Tt);else{gt=Tt;var At=Vr;Vr|=2;var Dt=Dp();for(ys===mt&&Ss===gt||(Do=null,Gl(),xl(mt,gt));;)try{Xm();break}catch(Zt){Op(mt,Zt)}J1(),x1.current=Dt,Vr=At,ds!==null?gt=0:(ys=null,Ss=0,gt=fs)}if(gt!==0){if(gt===2&&(At=z1(mt))!==0&&(Tt=At,gt=B0(mt,At)),gt===1)throw _t=Au,xl(mt,0),Fo(mt,Tt),Us(mt,gs()),_t;if(gt===6)Fo(mt,Tt);else{if(At=mt.current.alternate,(30&Tt)==0&&!function(Zt){for(var rr=Zt;;){if(16384&rr.flags){var ir=rr.updateQueue;if(ir!==null&&(ir=ir.stores)!==null)for(var cr=0;cr<ir.length;cr++){var wr=ir[cr],ar=wr.getSnapshot;wr=wr.value;try{if(!Kn(ar(),wr))return!1}catch{return!1}}}if(ir=rr.child,16384&rr.subtreeFlags&&ir!==null)ir.return=rr,rr=ir;else{if(rr===Zt)break;for(;rr.sibling===null;){if(rr.return===null||rr.return===Zt)return!0;rr=rr.return}rr.sibling.return=rr.return,rr=rr.sibling}}return!0}(At)&&((gt=_1(mt,Tt))===2&&(Dt=z1(mt))!==0&&(Tt=Dt,gt=B0(mt,Dt)),gt===1))throw _t=Au,xl(mt,0),Fo(mt,Tt),Us(mt,gs()),_t;switch(mt.finishedWork=At,mt.finishedLanes=Tt,gt){case 0:case 1:throw Error(ot(345));case 2:case 5:Wl(mt,Qs,Do);break;case 3:if(Fo(mt,Tt),(130023424&Tt)===Tt&&10<(gt=k0+500-gs())){if(Uu(mt,0)!==0)break;if(((At=mt.suspendedLanes)&Tt)!==Tt){Ps(),mt.pingedLanes|=mt.suspendedLanes&At;break}mt.timeoutHandle=mr(Wl.bind(null,mt,Qs,Do),gt);break}Wl(mt,Qs,Do);break;case 4:if(Fo(mt,Tt),(4194240&Tt)===Tt)break;for(gt=mt.eventTimes,At=-1;0<Tt;){var Wt=31-Yn(Tt);Dt=1<<Wt,(Wt=gt[Wt])>At&&(At=Wt),Tt&=~Dt}if(Tt=At,10<(Tt=(120>(Tt=gs()-Tt)?120:480>Tt?480:1080>Tt?1080:1920>Tt?1920:3e3>Tt?3e3:4320>Tt?4320:1960*Wm(Tt/1960))-Tt)){mt.timeoutHandle=mr(Wl.bind(null,mt,Qs,Do),Tt);break}Wl(mt,Qs,Do);break;default:throw Error(ot(329))}}}return Us(mt,gs()),mt.callbackNode===_t?Ip.bind(null,mt):null}function B0(mt,gt){var _t=Pu;return mt.current.memoizedState.isDehydrated&&(xl(mt,gt).flags|=256),(mt=_1(mt,gt))!==2&&(gt=Qs,Qs=_t,gt!==null&&z0(gt)),mt}function z0(mt){Qs===null?Qs=mt:Qs.push.apply(Qs,mt)}function Fo(mt,gt){for(gt&=~D0,gt&=~v1,mt.suspendedLanes|=gt,mt.pingedLanes&=~gt,mt=mt.expirationTimes;0<gt;){var _t=31-Yn(gt),Tt=1<<_t;mt[_t]=-1,gt&=~Tt}}function Mp(mt){if(6&Vr)throw Error(ot(327));yl();var gt=Uu(mt,0);if(!(1>))return Us(mt,gs()),null;var _t=_1(mt,gt);if(mt.tag!==0&&_t===2){var Tt=z1(mt);Tt!==0&&(gt=Tt,_t=B0(mt,Tt))}if(_t===1)throw _t=Au,xl(mt,0),Fo(mt,gt),Us(mt,gs()),_t;if(_t===6)throw Error(ot(345));return mt.finishedWork=mt.current.alternate,mt.finishedLanes=gt,Wl(mt,Qs,Do),Us(mt,gs()),null}function $p(mt){Lo!==null&&Lo.tag===0&&!(6&Vr)&&yl();var gt=Vr;Vr|=1;var _t=cs.transition,Tt=qr;try{if(cs.transition=null,qr=1,mt)return mt()}finally{qr=Tt,cs.transition=_t,!(6&(Vr=gt))&&oo()}}function U0(){Ks=Vl.current,rs(Vl)}function xl(mt,gt){mt.finishedWork=null,mt.finishedLanes=0;var _t=mt.timeoutHandle;if(_t!==or&&(mt.timeoutHandle=or,yr(_t)),ds!==null)for(_t=ds.return;_t!==null;){var Tt=_t;switch(X1(Tt),Tt.tag){case 1:(Tt=Tt.type.childContextTypes)!=null&&N1();break;case 3:zl(),rs(Fs),rs(Ts),u0();break;case 5:a0(Tt);break;case 4:zl();break;case 13:case 19:rs(ls);break;case 10:e0(Tt.type._context);break;case 22:case 23:U0()}_t=_t.return}if(ys=mt,ds=mt=Bo(mt.current,null),Ss=Ks=gt,fs=0,Au=null,D0=v1=$a=0,Qs=Pu=null,ba!==null){for(gt=0;gt<ba.length;gt++)if((Tt=(_t=ba[gt]).interleaved)!==null){_t.interleaved=null;var At=Tt.next,Dt=_t.pending;if(Dt!==null){var Wt=Dt.next;Dt.next=At,Tt.next=Wt}_t.pending=Tt}ba=null}return mt}function Op(mt,gt){for(;;){var _t=ds;try{if(J1(),t1.current=i1,r1){for(var Tt=as.memoizedState;Tt!==null;){var At=Tt.queue;At!==null&&(At.pending=null),Tt=Tt.next}r1=!1}if(_a=0,vs=xs=as=null,yu=!1,Eu=0,O0.current=null,_t===null||_t.return===null){fs=1,Au=gt,ds=null;break}e:{var Dt=mt,Wt=_t.return,Zt=_t,rr=gt;if(gt=Ss,Zt.flags|=32768,rr!==null&&typeof rr=="object"&&typeof rr.then=="function"){var ir=rr,cr=Zt,wr=cr.tag;if(!(1&cr.mode)&&(wr===0||wr===11||wr===15)){var ar=cr.alternate;ar?(cr.updateQueue=ar.updateQueue,cr.memoizedState=ar.memoizedState,cr.lanes=ar.lanes):(cr.updateQueue=null,cr.memoizedState=null)}var Er=sp(Wt);if(Er!==null){Er.flags&=-257,np(Er,Wt,Zt,0,gt),1&Er.mode&&rp(Dt,ir,gt),rr=ir;var Cr=(gt=Er).updateQueue;if(Cr===null){var Nr=new Set;Nr.add(rr),gt.updateQueue=Nr}else Cr.add(rr);break e}if(!(1>)){rp(Dt,ir,gt),H0();break e}rr=Error(ot(426))}else if(ss&&1&Zt.mode){var dr=sp(Wt);if(dr!==null){!(65536&dr.flags)&&(dr.flags|=256),np(dr,Wt,Zt,0,gt),Q1(Ul(rr,Zt));break e}}Dt=rr=Ul(rr,Zt),fs!==4&&(fs=2),Pu===null?Pu=[Dt]:Pu.push(Dt),Dt=Wt;do{switch(Dt.tag){case 3:Dt.flags|=65536,gt&=-gt,Dt.lanes|=gt,R2(Dt,ep(0,rr,gt));break e;case 1:Zt=rr;var Jt=Dt.type,nr=Dt.stateNode;if(!(128&Dt.flags)&&(typeof Jt.getDerivedStateFromError=="function"||nr!==null&&typeof nr.componentDidCatch=="function"&&(ko===null||!ko.has(nr)))){Dt.flags|=65536,gt&=-gt,Dt.lanes|=gt,R2(Dt,tp(Dt,Zt,gt));break e}}Dt=Dt.return}while(Dt!==null)}Lp(_t)}catch(xr){gt=xr,ds===_t&&_t!==null&&(ds=_t=_t.return);continue}break}}function Dp(){var mt=x1.current;return x1.current=i1,mt===null?i1:mt}function H0(){fs!==0&&fs!==3&&fs!==2||(fs=4),ys===null||!(268435455&$a)&&!(268435455&v1)||Fo(ys,Ss)}function _1(mt,gt){var _t=Vr;Vr|=2;var Tt=Dp();for(ys===mt&&Ss===gt||(Do=null,xl(mt,gt));;)try{qm();break}catch(At){Op(mt,At)}if(J1(),Vr=_t,x1.current=Tt,ds!==null)throw Error(ot(261));return ys=null,Ss=0,fs}function qm(){for(;ds!==null;)kp(ds)}function Xm(){for(;ds!==null&&!Cm();)kp(ds)}function kp(mt){var gt=jp(mt.alternate,mt,Ks);mt.memoizedProps=mt.pendingProps,gt===null?Lp(mt):ds=gt,O0.current=null}function Lp(mt){var gt=mt;do{var _t=gt.alternate;if(mt=gt.return,(32768>.flags)==0){if((_t=Um(_t,gt,Ks))!==null)return void(ds=_t)}else{if((_t=Hm(_t,gt))!==null)return _t.flags&=32767,void(ds=_t);if(mt===null)return fs=6,void(ds=null);mt.flags|=32768,mt.subtreeFlags=0,mt.deletions=null}if((gt=gt.sibling)!==null)return void(ds=gt);ds=gt=mt}while(gt!==null);fs===0&&(fs=5)}function Wl(mt,gt,_t){var Tt=qr,At=cs.transition;try{cs.transition=null,qr=1,function(Dt,Wt,Zt,rr){do yl();while(Lo!==null);if(6&Vr)throw Error(ot(327));Zt=Dt.finishedWork;var ir=Dt.finishedLanes;if(Zt===null)return null;if(Dt.finishedWork=null,Dt.finishedLanes=0,Zt===Dt.current)throw Error(ot(177));Dt.callbackNode=null,Dt.callbackPriority=0;var cr=Zt.lanes|Zt.childLanes;if(function(Er,Cr){var Nr=Er.pendingLanes&~Cr;Er.pendingLanes=Cr,Er.suspendedLanes=0,Er.pingedLanes=0,Er.expiredLanes&=Cr,Er.mutableReadLanes&=Cr,Er.entangledLanes&=Cr,Cr=Er.entanglements;var dr=Er.eventTimes;for(Er=Er.expirationTimes;0<Nr;){var Jt=31-Yn(Nr),nr=1<<Jt;Cr[Jt]=0,dr[Jt]=-1,Er[Jt]=-1,Nr&=~nr}}(Dt,cr),Dt===ys&&(ds=ys=null,Ss=0),!(2064&Zt.subtreeFlags)&&!(2064&Zt.flags)||E1||(E1=!0,Bp(m2,function(){return yl(),null})),cr=(15990&Zt.flags)!=0,(15990&Zt.subtreeFlags)!=0||cr){cr=cs.transition,cs.transition=null;var wr=qr;qr=1;var ar=Vr;Vr|=4,O0.current=null,function(Er,Cr){for(Vt(Er.containerInfo),Rr=Cr;Rr!==null;)if(Cr=(Er=Rr).child,(1028&Er.subtreeFlags)!=0&&Cr!==null)Cr.return=Er,Rr=Cr;else for(;Rr!==null;){Er=Rr;try{var Nr=Er.alternate;if(1024&Er.flags)switch(Er.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(Nr!==null){var dr=Nr.memoizedProps,Jt=Nr.memoizedState,nr=Er.stateNode,xr=nr.getSnapshotBeforeUpdate(Er.elementType===Er.type?dr:Zn(Er.type,dr),Jt);nr.__reactInternalSnapshotBeforeUpdate=xr}break;case 3:pr&&ms(Er.stateNode.containerInfo);break;default:throw Error(ot(163))}}catch(Mr){ns(Er,Er.return,Mr)}if((Cr=Er.sibling)!==null){Cr.return=Er.return,Rr=Cr;break}Rr=Er.return}Nr=yp,yp=!1}(Dt,Zt),_p(Zt,Dt),Bt(Dt.containerInfo),Dt.current=Zt,Gm(Zt),Am(),Vr=ar,qr=wr,cs.transition=cr}else Dt.current=Zt;if(E1&&(E1=!1,Lo=Dt,b1=ir),cr=Dt.pendingLanes,cr===0&&(ko=null),function(Er){if(io&&typeof io.onCommitFiberRoot=="function")try{io.onCommitFiberRoot(Hu,Er,void 0,(128&Er.current.flags)==128)}catch{}}(Zt.stateNode),Us(Dt,gs()),Wt!==null)for(rr=Dt.onRecoverableError,Zt=0;Zt<Wt.length;Zt++)ir=Wt[Zt],rr(ir.value,{componentStack:ir.stack,digest:ir.digest});if(y1)throw y1=!1,Dt=N0,N0=null,Dt;1&b1&&Dt.tag!==0&&yl(),cr=Dt.pendingLanes,1&cr?Dt===F0?ju++:(ju=0,F0=Dt):ju=0,oo()}(mt,gt,_t,Tt)}finally{cs.transition=At,qr=Tt}return null}function yl(){if(Lo!==null){var mt=f2(b1),gt=cs.transition,_t=qr;try{if(cs.transition=null,qr=16>mt?16:mt,Lo===null)var Tt=!1;else{if(mt=Lo,Lo=null,b1=0,(6&Vr)!=0)throw Error(ot(331));var At=Vr;for(Vr|=4,Rr=mt.current;Rr!==null;){var Dt=Rr,Wt=Dt.child;if(16&Rr.flags){var Zt=Dt.deletions;if(Zt!==null){for(var rr=0;rr<Zt.length;rr++){var ir=Zt[rr];for(Rr=ir;Rr!==null;){var cr=Rr;switch(cr.tag){case 0:case 11:case 15:Tu(8,cr,Dt)}var wr=cr.child;if(wr!==null)wr.return=cr,Rr=wr;else for(;Rr!==null;){var ar=(cr=Rr).sibling,Er=cr.return;if(Ep(cr),cr===ir){Rr=null;break}if(ar!==null){ar.return=Er,Rr=ar;break}Rr=Er}}}var Cr=Dt.alternate;if(Cr!==null){var Nr=Cr.child;if(Nr!==null){Cr.child=null;do{var dr=Nr.sibling;Nr.sibling=null,Nr=dr}while(Nr!==null)}}Rr=Dt}}if(2064&Dt.subtreeFlags&&Wt!==null)Wt.return=Dt,Rr=Wt;else e:for(;Rr!==null;){if(2048&(Dt=Rr).flags)switch(Dt.tag){case 0:case 11:case 15:Tu(9,Dt,Dt.return)}var Jt=Dt.sibling;if(Jt!==null){Jt.return=Dt.return,Rr=Jt;break e}Rr=Dt.return}}var nr=mt.current;for(Rr=nr;Rr!==null;){var xr=(Wt=Rr).child;if(2064&Wt.subtreeFlags&&xr!==null)xr.return=Wt,Rr=xr;else e:for(Wt=nr;Rr!==null;){if(2048&(Zt=Rr).flags)try{switch(Zt.tag){case 0:case 11:case 15:d1(9,Zt)}}catch(Yr){ns(Zt,Zt.return,Yr)}if(Zt===Wt){Rr=null;break e}var Mr=Zt.sibling;if(Mr!==null){Mr.return=Zt.return,Rr=Mr;break e}Rr=Zt.return}}if(Vr=At,oo(),io&&typeof io.onPostCommitFiberRoot=="function")try{io.onPostCommitFiberRoot(Hu,mt)}catch{}Tt=!0}return Tt}finally{qr=_t,cs.transition=gt}}return!1}function Np(mt,gt,_t){mt=Oo(mt,gt=ep(0,gt=Ul(_t,gt),1),1),gt=Ps(),mt!==null&&(pu(mt,1,gt),Us(mt,gt))}function ns(mt,gt,_t){if(mt.tag===3)Np(mt,mt,_t);else for(;gt!==null;){if(gt.tag===3){Np(gt,mt,_t);break}if(gt.tag===1){var Tt=gt.stateNode;if(typeof gt.type.getDerivedStateFromError=="function"||typeof Tt.componentDidCatch=="function"&&(ko===null||!ko.has(Tt))){gt=Oo(gt,mt=tp(gt,mt=Ul(_t,mt),1),1),mt=Ps(),gt!==null&&(pu(gt,1,mt),Us(gt,mt));break}}gt=gt.return}}function Ym(mt,gt,_t){var Tt=mt.pingCache;Tt!==null&&Tt.delete(gt),gt=Ps(),mt.pingedLanes|=mt.suspendedLanes&_t,ys===mt&&(Ss&_t)===_t&&(fs===4||fs===3&&(130023424&Ss)===Ss&&500>gs()-k0?xl(mt,0):D0|=_t),Us(mt,gt)}function Fp(mt,gt){gt===0&&(1&mt.mode?(gt=B1,!(130023424&(B1<<=1))&&(B1=4194304)):gt=1);var _t=Ps();(mt=lo(mt,gt))!==null&&(pu(mt,gt,_t),Us(mt,_t))}function Km(mt){var gt=mt.memoizedState,_t=0;gt!==null&&(_t=gt.retryLane),Fp(mt,_t)}function Qm(mt,gt){var _t=0;switch(mt.tag){case 13:var Tt=mt.stateNode,At=mt.memoizedState;At!==null&&(_t=At.retryLane);break;case 19:Tt=mt.stateNode;break;default:throw Error(ot(314))}Tt!==null&&Tt.delete(gt),Fp(mt,_t)}function Bp(mt,gt){return V1(mt,gt)}function Zm(mt,gt,_t,Tt){this.tag=mt,this.key=_t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=gt,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=Tt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(mt,gt,_t,Tt){return new Zm(mt,gt,_t,Tt)}function V0(mt){return!(!(mt=mt.prototype)||!mt.isReactComponent)}function Bo(mt,gt){var _t=mt.alternate;return _t===null?((_t=Wn(mt.tag,gt,mt.key,mt.mode)).elementType=mt.elementType,_t.type=mt.type,_t.stateNode=mt.stateNode,_t.alternate=mt,mt.alternate=_t):(_t.pendingProps=gt,_t.type=mt.type,_t.flags=0,_t.subtreeFlags=0,_t.deletions=null),_t.flags=14680064&mt.flags,_t.childLanes=mt.childLanes,_t.lanes=mt.lanes,_t.child=mt.child,_t.memoizedProps=mt.memoizedProps,_t.memoizedState=mt.memoizedState,_t.updateQueue=mt.updateQueue,gt=mt.dependencies,_t.dependencies=gt===null?null:{lanes:gt.lanes,firstContext:gt.firstContext},_t.sibling=mt.sibling,_t.index=mt.index,_t.ref=mt.ref,_t}function R1(mt,gt,_t,Tt,At,Dt){var Wt=2;if(Tt=mt,typeof mt=="function")V0(mt)&&(Wt=1);else if(typeof mt=="string")Wt=5;else e:switch(mt){case ct:return El(_t.children,At,Dt,gt);case dt:Wt=8,At|=8;break;case ht:return(mt=Wn(12,_t,gt,2|At)).elementType=ht,mt.lanes=Dt,mt;case yt:return(mt=Wn(13,_t,gt,At)).elementType=yt,mt.lanes=Dt,mt;case Et:return(mt=Wn(19,_t,gt,At)).elementType=Et,mt.lanes=Dt,mt;case St:return T1(_t,At,Dt,gt);default:if(typeof mt=="object"&&mt!==null)switch(mt.$$typeof){case ft:Wt=10;break e;case xt:Wt=9;break e;case vt:Wt=11;break e;case bt:Wt=14;break e;case wt:Wt=16,Tt=null;break e}throw Error(ot(130,mt==null?mt:typeof mt,""))}return(gt=Wn(Wt,_t,gt,At)).elementType=mt,gt.type=Tt,gt.lanes=Dt,gt}function El(mt,gt,_t,Tt){return(mt=Wn(7,mt,Tt,gt)).lanes=_t,mt}function T1(mt,gt,_t,Tt){return(mt=Wn(22,mt,Tt,gt)).elementType=St,mt.lanes=_t,mt.stateNode={isHidden:!1},mt}function G0(mt,gt,_t){return(mt=Wn(6,mt,null,gt)).lanes=_t,mt}function W0(mt,gt,_t){return(gt=Wn(4,mt.children!==null?mt.children:[],mt.key,gt)).lanes=_t,gt.stateNode={containerInfo:mt.containerInfo,pendingChildren:null,implementation:mt.implementation},gt}function Jm(mt,gt,_t,Tt,At){this.tag=gt,this.containerInfo=mt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=or,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=U1(0),this.expirationTimes=U1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=U1(0),this.identifierPrefix=Tt,this.onRecoverableError=At,Ar&&(this.mutableSourceEagerHydrationData=null)}function zp(mt,gt,_t,Tt,At,Dt,Wt,Zt,rr){return mt=new Jm(mt,gt,_t,Zt,rr),gt===1?(gt=1,Dt===!0&&(gt|=8)):gt=0,Dt=Wn(3,null,null,gt),mt.current=Dt,Dt.stateNode=mt,Dt.memoizedState={element:Tt,isDehydrated:_t,cache:null,transitions:null,pendingSuspenseBoundaries:null},s0(Dt),mt}function Up(mt){if(!mt)return Mo;e:{if(Pt(mt=mt._reactInternals)!==mt||mt.tag!==1)throw Error(ot(170));var gt=mt;do{switch(gt.tag){case 3:gt=gt.stateNode.context;break e;case 1:if(Xs(gt.type)){gt=gt.stateNode.__reactInternalMemoizedMergedChildContext;break e}}gt=gt.return}while(gt!==null);throw Error(ot(171))}if(mt.tag===1){var _t=mt.type;if(Xs(_t))return c2(mt,_t,gt)}return gt}function Hp(mt){var gt=mt._reactInternals;if(gt===void 0)throw typeof mt.render=="function"?Error(ot(188)):(mt=Object.keys(mt).join(","),Error(ot(268,mt)));return(mt=Nt(gt))===null?null:mt.stateNode}function Vp(mt,gt){if((mt=mt.memoizedState)!==null&&mt.dehydrated!==null){var _t=mt.retryLane;mt.retryLane=_t!==0&&_t<gt?_t:gt}}function C1(mt,gt){Vp(mt,gt),(mt=mt.alternate)&&Vp(mt,gt)}function e3(mt){return(mt=Nt(mt))===null?null:mt.stateNode}function t3(){return null}return jp=function(mt,gt,_t){if(mt!==null)if(mt.memoizedProps!==gt.pendingProps||Fs.current)Bs=!0;else{if(!(mt.lanes&_t)&&!(128>.flags))return Bs=!1,function(wr,ar,Er){switch(ar.tag){case 3:dp(ar),Dl();break;case 5:O2(ar);break;case 1:Xs(ar.type)&&zu(ar);break;case 4:o0(ar,ar.stateNode.containerInfo);break;case 10:w2(0,ar.type._context,ar.memoizedProps.value);break;case 13:var Cr=ar.memoizedState;if(Cr!==null)return Cr.dehydrated!==null?(Jr(ls,1&ls.current),ar.flags|=128,null):Er&ar.child.childLanes?fp(wr,ar,Er):(Jr(ls,1&ls.current),(wr=To(wr,ar,Er))!==null?wr.sibling:null);Jr(ls,1&ls.current);break;case 19:if(Cr=(Er&ar.childLanes)!=0,(128&wr.flags)!=0){if(Cr)return mp(wr,ar,Er);ar.flags|=128}var Nr=ar.memoizedState;if(Nr!==null&&(Nr.rendering=null,Nr.tail=null,Nr.lastEffect=null),Jr(ls,ls.current),Cr)break;return null;case 22:case 23:return ar.lanes=0,lp(wr,ar,Er)}return To(wr,ar,Er)}(mt,gt,_t);Bs=(131072&mt.flags)!=0}else Bs=!1,ss&&1048576>.flags&&x2(gt,Wu,gt.index);switch(gt.lanes=0,gt.tag){case 2:var Tt=gt.type;u1(mt,gt),mt=gt.pendingProps;var At=Ml(gt,Ts.current);Nl(gt,_t),At=h0(null,gt,Tt,mt,At,_t);var Dt=f0();return gt.flags|=1,typeof At=="object"&&At!==null&&typeof At.render=="function"&&At.$$typeof===void 0?(gt.tag=1,gt.memoizedState=null,gt.updateQueue=null,Xs(Tt)?(Dt=!0,zu(gt)):Dt=!1,gt.memoizedState=At.state!==null&&At.state!==void 0?At.state:null,s0(gt),At.updater=Ju,gt.stateNode=At,At._reactInternals=gt,i0(gt,Tt,mt,_t),gt=b0(null,gt,Tt,!0,Dt,_t)):(gt.tag=0,ss&&Dt&&q1(gt),zs(null,gt,At,_t),gt=gt.child),gt;case 16:Tt=gt.elementType;e:{switch(u1(mt,gt),mt=gt.pendingProps,Tt=(At=Tt._init)(Tt._payload),gt.type=Tt,At=gt.tag=function(wr){if(typeof wr=="function")return V0(wr)?1:0;if(wr!=null){if((wr=wr.$$typeof)===vt)return 11;if(wr===bt)return 14}return 2}(Tt),mt=Zn(Tt,mt),At){case 0:gt=E0(null,gt,Tt,mt,_t);break e;case 1:gt=cp(null,gt,Tt,mt,_t);break e;case 11:gt=ip(null,gt,Tt,mt,_t);break e;case 14:gt=op(null,gt,Tt,Zn(Tt.type,mt),_t);break e}throw Error(ot(306,Tt,""))}return gt;case 0:return Tt=gt.type,At=gt.pendingProps,E0(mt,gt,Tt,At=gt.elementType===Tt?At:Zn(Tt,At),_t);case 1:return Tt=gt.type,At=gt.pendingProps,cp(mt,gt,Tt,At=gt.elementType===Tt?At:Zn(Tt,At),_t);case 3:e:{if(dp(gt),mt===null)throw Error(ot(387));Tt=gt.pendingProps,At=(Dt=gt.memoizedState).element,_2(mt,gt),Zu(gt,Tt,null,_t);var Wt=gt.memoizedState;if(Tt=Wt.element,Ar&&Dt.isDehydrated){if(Dt={element:Tt,isDehydrated:!1,cache:Wt.cache,pendingSuspenseBoundaries:Wt.pendingSuspenseBoundaries,transitions:Wt.transitions},gt.updateQueue.baseState=Dt,gt.memoizedState=Dt,256>.flags){gt=hp(mt,gt,Tt,_t,At=Ul(Error(ot(423)),gt));break e}if(Tt!==At){gt=hp(mt,gt,Tt,_t,At=Ul(Error(ot(424)),gt));break e}for(Ar&&(Bn=cm(gt.stateNode.containerInfo),Ys=gt,ss=!0,Qn=null,mu=!1),_t=$2(gt,null,Tt,_t),gt.child=_t;_t;)_t.flags=-3&_t.flags|4096,_t=_t.sibling}else{if(Dl(),Tt===At){gt=To(mt,gt,_t);break e}zs(mt,gt,Tt,_t)}gt=gt.child}return gt;case 5:return O2(gt),mt===null&&K1(gt),Tt=gt.type,At=gt.pendingProps,Dt=mt!==null?mt.memoizedProps:null,Wt=At.children,lr(Tt,At)?Wt=null:Dt!==null&&lr(Tt,Dt)&&(gt.flags|=32),up(mt,gt),zs(mt,gt,Wt,_t),gt.child;case 6:return mt===null&&K1(gt),null;case 13:return fp(mt,gt,_t);case 4:return o0(gt,gt.stateNode.containerInfo),Tt=gt.pendingProps,mt===null?gt.child=Fl(gt,null,Tt,_t):zs(mt,gt,Tt,_t),gt.child;case 11:return Tt=gt.type,At=gt.pendingProps,ip(mt,gt,Tt,At=gt.elementType===Tt?At:Zn(Tt,At),_t);case 7:return zs(mt,gt,gt.pendingProps,_t),gt.child;case 8:case 12:return zs(mt,gt,gt.pendingProps.children,_t),gt.child;case 10:e:{if(Tt=gt.type._context,At=gt.pendingProps,Dt=gt.memoizedProps,w2(0,Tt,Wt=At.value),Dt!==null)if(Kn(Dt.value,Wt)){if(Dt.children===At.children&&!Fs.current){gt=To(mt,gt,_t);break e}}else for((Dt=gt.child)!==null&&(Dt.return=gt);Dt!==null;){var Zt=Dt.dependencies;if(Zt!==null){Wt=Dt.child;for(var rr=Zt.firstContext;rr!==null;){if(rr.context===Tt){if(Dt.tag===1){(rr=Ro(-1,_t&-_t)).tag=2;var ir=Dt.updateQueue;if(ir!==null){var cr=(ir=ir.shared).pending;cr===null?rr.next=rr:(rr.next=cr.next,cr.next=rr),ir.pending=rr}}Dt.lanes|=_t,(rr=Dt.alternate)!==null&&(rr.lanes|=_t),t0(Dt.return,_t,gt),Zt.lanes|=_t;break}rr=rr.next}}else if(Dt.tag===10)Wt=Dt.type===gt.type?null:Dt.child;else if(Dt.tag===18){if((Wt=Dt.return)===null)throw Error(ot(341));Wt.lanes|=_t,(Zt=Wt.alternate)!==null&&(Zt.lanes|=_t),t0(Wt,_t,gt),Wt=Dt.sibling}else Wt=Dt.child;if(Wt!==null)Wt.return=Dt;else for(Wt=Dt;Wt!==null;){if(Wt===gt){Wt=null;break}if((Dt=Wt.sibling)!==null){Dt.return=Wt.return,Wt=Dt;break}Wt=Wt.return}Dt=Wt}zs(mt,gt,At.children,_t),gt=gt.child}return gt;case 9:return At=gt.type,Tt=gt.pendingProps.children,Nl(gt,_t),Tt=Tt(At=Un(At)),gt.flags|=1,zs(mt,gt,Tt,_t),gt.child;case 14:return At=Zn(Tt=gt.type,gt.pendingProps),op(mt,gt,Tt,At=Zn(Tt.type,At),_t);case 15:return ap(mt,gt,gt.type,gt.pendingProps,_t);case 17:return Tt=gt.type,At=gt.pendingProps,At=gt.elementType===Tt?At:Zn(Tt,At),u1(mt,gt),gt.tag=1,Xs(Tt)?(mt=!0,zu(gt)):mt=!1,Nl(gt,_t),P2(gt,Tt,At),i0(gt,Tt,At,_t),b0(null,gt,Tt,!0,mt,_t);case 19:return mp(mt,gt,_t);case 22:return lp(mt,gt,_t)}throw Error(ot(156,gt.tag))},et.attemptContinuousHydration=function(mt){if(mt.tag===13){var gt=lo(mt,134217728);gt!==null&&Gn(gt,mt,134217728,Ps()),C1(mt,134217728)}},et.attemptDiscreteHydration=function(mt){if(mt.tag===13){var gt=lo(mt,1);gt!==null&&Gn(gt,mt,1,Ps()),C1(mt,1)}},et.attemptHydrationAtCurrentPriority=function(mt){if(mt.tag===13){var gt=No(mt),_t=lo(mt,gt);_t!==null&&Gn(_t,mt,gt,Ps()),C1(mt,gt)}},et.attemptSynchronousHydration=function(mt){switch(mt.tag){case 3:var gt=mt.stateNode;if(gt.current.memoizedState.isDehydrated){var _t=fu(gt.pendingLanes);_t!==0&&(H1(gt,1|_t),Us(gt,gs()),!(6&Vr)&&(Gl(),oo()))}break;case 13:$p(function(){var Tt=lo(mt,1);if(Tt!==null){var At=Ps();Gn(Tt,mt,1,At)}}),C1(mt,1)}},et.batchedUpdates=function(mt,gt){var _t=Vr;Vr|=1;try{return mt(gt)}finally{(Vr=_t)===0&&(Gl(),Vu&&oo())}},et.createComponentSelector=function(mt){return{$$typeof:h1,value:mt}},et.createContainer=function(mt,gt,_t,Tt,At,Dt,Wt){return zp(mt,gt,!1,null,0,Tt,0,Dt,Wt)},et.createHasPseudoClassSelector=function(mt){return{$$typeof:f1,value:mt}},et.createHydrationContainer=function(mt,gt,_t,Tt,At,Dt,Wt,Zt,rr){return(mt=zp(_t,Tt,!0,mt,0,Dt,0,Zt,rr)).context=Up(null),_t=mt.current,(Dt=Ro(Tt=Ps(),At=No(_t))).callback=gt??null,Oo(_t,Dt,At),mt.current.lanes=At,pu(mt,At,Tt),Us(mt,Tt),mt},et.createPortal=function(mt,gt,_t){var Tt=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ut,key:Tt==null?null:""+Tt,children:mt,containerInfo:gt,implementation:_t}},et.createRoleSelector=function(mt){return{$$typeof:p1,value:mt}},et.createTestNameSelector=function(mt){return{$$typeof:m1,value:mt}},et.createTextSelector=function(mt){return{$$typeof:g1,value:mt}},et.deferredUpdates=function(mt){var gt=qr,_t=cs.transition;try{return cs.transition=null,qr=16,mt()}finally{qr=gt,cs.transition=_t}},et.discreteUpdates=function(mt,gt,_t,Tt,At){var Dt=qr,Wt=cs.transition;try{return cs.transition=null,qr=1,mt(gt,_t,Tt,At)}finally{qr=Dt,cs.transition=Wt,Vr===0&&Gl()}},et.findAllNodes=$0,et.findBoundingRects=function(mt,gt){if(!Xt)throw Error(ot(363));gt=$0(mt,gt),mt=[];for(var _t=0;_t<gt.length;_t++)mt.push(sr(gt[_t]));for(gt=mt.length-1;0<gt;gt--)for(var Tt=(_t=mt[gt]).x,At=Tt+_t.width,Dt=_t.y,Wt=Dt+_t.height,Zt=gt-1;0<=Zt;Zt--)if(gt!==Zt){var rr=mt[Zt],ir=rr.x,cr=ir+rr.width,wr=rr.y,ar=wr+rr.height;if(Tt>=ir&&Dt>=wr&&At<=cr&&Wt<=ar){mt.splice(gt,1);break}if(!(Tt!==ir||_t.width!==rr.width||ar<Dt||wr>Wt)){wr>Dt&&(rr.height+=wr-Dt,rr.y=Dt),ar<Wt&&(rr.height=Wt-wr),mt.splice(gt,1);break}if(!(Dt!==wr||_t.height!==rr.height||cr<Tt||ir>At)){ir>Tt&&(rr.width+=ir-Tt,rr.x=Tt),cr<At&&(rr.width=At-ir),mt.splice(gt,1);break}}return mt},et.findHostInstance=Hp,et.findHostInstanceWithNoPortals=function(mt){return(mt=(mt=Ut(mt))!==null?Lt(mt):null)===null?null:mt.stateNode},et.findHostInstanceWithWarning=function(mt){return Hp(mt)},et.flushControlled=function(mt){var gt=Vr;Vr|=1;var _t=cs.transition,Tt=qr;try{cs.transition=null,qr=1,mt()}finally{qr=Tt,cs.transition=_t,(Vr=gt)===0&&(Gl(),oo())}},et.flushPassiveEffects=yl,et.flushSync=$p,et.focusWithin=function(mt,gt){if(!Xt)throw Error(ot(363));for(gt=Pp(mt=j0(mt),gt),gt=Array.from(gt),mt=0;mt<gt.length;){var _t=gt[mt++];if(!gr(_t)){if(_t.tag===5&&Tr(_t.stateNode))return!0;for(_t=_t.child;_t!==null;)gt.push(_t),_t=_t.sibling}}return!1},et.getCurrentUpdatePriority=function(){return qr},et.getFindAllNodesFailureDescription=function(mt,gt){if(!Xt)throw Error(ot(363));var _t=0,Tt=[];mt=[j0(mt),0];for(var At=0;At<mt.length;){var Dt=mt[At++],Wt=mt[At++],Zt=gt[Wt];if((Dt.tag!==5||!gr(Dt))&&(I0(Dt,Zt)&&(Tt.push(M0(Zt)),++Wt>_t&&(_t=Wt)),Wt<gt.length))for(Dt=Dt.child;Dt!==null;)mt.push(Dt,Wt),Dt=Dt.sibling}if(_t<gt.length){for(mt=[];_t<gt.length;_t++)mt.push(M0(gt[_t]));return`findAllNodes was able to match part of the selector:
|
|
1040
|
+
`+Dt.stack}return{value:mt,source:gt,stack:At,digest:null}}function v0(mt,gt,_t){return{value:mt,source:null,stack:_t??null,digest:gt??null}}function y0(mt,gt){try{console.error(gt.value)}catch(_t){setTimeout(function(){throw _t})}}var Bm=typeof WeakMap=="function"?WeakMap:Map;function ep(mt,gt,_t){(_t=Ro(-1,_t)).tag=3,_t.payload={element:null};var Tt=gt.value;return _t.callback=function(){y1||(y1=!0,N0=Tt),y0(0,gt)},_t}function tp(mt,gt,_t){(_t=Ro(-1,_t)).tag=3;var Tt=mt.type.getDerivedStateFromError;if(typeof Tt=="function"){var At=gt.value;_t.payload=function(){return Tt(At)},_t.callback=function(){y0(0,gt)}}var Dt=mt.stateNode;return Dt!==null&&typeof Dt.componentDidCatch=="function"&&(_t.callback=function(){y0(0,gt),typeof Tt!="function"&&(ko===null?ko=new Set([this]):ko.add(this));var Wt=gt.stack;this.componentDidCatch(gt.value,{componentStack:Wt!==null?Wt:""})}),_t}function rp(mt,gt,_t){var Tt=mt.pingCache;if(Tt===null){Tt=mt.pingCache=new Bm;var At=new Set;Tt.set(gt,At)}else(At=Tt.get(gt))===void 0&&(At=new Set,Tt.set(gt,At));At.has(_t)||(At.add(_t),mt=Ym.bind(null,mt,gt,_t),gt.then(mt,mt))}function sp(mt){do{var gt;if((gt=mt.tag===13)&&(gt=(gt=mt.memoizedState)===null||gt.dehydrated!==null),gt)return mt;mt=mt.return}while(mt!==null);return null}function np(mt,gt,_t,Tt,At){return 1&mt.mode?(mt.flags|=65536,mt.lanes=At,mt):(mt===gt?mt.flags|=65536:(mt.flags|=128,_t.flags|=131072,_t.flags&=-52805,_t.tag===1&&(_t.alternate===null?_t.tag=17:((gt=Ro(-1,1)).tag=2,Oo(_t,gt,1))),_t.lanes|=1),mt)}var zm=at.ReactCurrentOwner,Bs=!1;function zs(mt,gt,_t,Tt){gt.child=mt===null?M2(gt,null,_t,Tt):Fl(gt,mt.child,_t,Tt)}function ip(mt,gt,_t,Tt,At){_t=_t.render;var Dt=gt.ref;return Nl(gt,At),Tt=h0(mt,gt,_t,Tt,Dt,At),_t=f0(),mt===null||Bs?(ss&&_t&&q1(gt),gt.flags|=1,zs(mt,gt,Tt,At),gt.child):(gt.updateQueue=mt.updateQueue,gt.flags&=-2053,mt.lanes&=~At,To(mt,gt,At))}function op(mt,gt,_t,Tt,At){if(mt===null){var Dt=_t.type;return typeof Dt!="function"||V0(Dt)||Dt.defaultProps!==void 0||_t.compare!==null||_t.defaultProps!==void 0?((mt=R1(_t.type,null,Tt,gt,gt.mode,At)).ref=gt.ref,mt.return=gt,gt.child=mt):(gt.tag=15,gt.type=Dt,ap(mt,gt,Dt,Tt,At))}if(Dt=mt.child,(mt.lanes&At)==0){var Wt=Dt.memoizedProps;if((_t=(_t=_t.compare)!==null?_t:Xu)(Wt,Tt)&&mt.ref===gt.ref)return To(mt,gt,At)}return gt.flags|=1,(mt=Bo(Dt,Tt)).ref=gt.ref,mt.return=gt,gt.child=mt}function ap(mt,gt,_t,Tt,At){if(mt!==null){var Dt=mt.memoizedProps;if(Xu(Dt,Tt)&&mt.ref===gt.ref){if(Bs=!1,gt.pendingProps=Tt=Dt,(mt.lanes&At)==0)return gt.lanes=mt.lanes,To(mt,gt,At);131072&mt.flags&&(Bs=!0)}}return E0(mt,gt,_t,Tt,At)}function lp(mt,gt,_t){var Tt=gt.pendingProps,At=Tt.children,Dt=mt!==null?mt.memoizedState:null;if(Tt.mode==="hidden")if(!(1>.mode))gt.memoizedState={baseLanes:0,cachePool:null,transitions:null},Jr(Vl,Ks),Ks|=_t;else{if(!(1073741824&_t))return mt=Dt!==null?Dt.baseLanes|_t:_t,gt.lanes=gt.childLanes=1073741824,gt.memoizedState={baseLanes:mt,cachePool:null,transitions:null},gt.updateQueue=null,Jr(Vl,Ks),Ks|=mt,null;gt.memoizedState={baseLanes:0,cachePool:null,transitions:null},Tt=Dt!==null?Dt.baseLanes:_t,Jr(Vl,Ks),Ks|=Tt}else Dt!==null?(Tt=Dt.baseLanes|_t,gt.memoizedState=null):Tt=_t,Jr(Vl,Ks),Ks|=Tt;return zs(mt,gt,At,_t),gt.child}function up(mt,gt){var _t=gt.ref;(mt===null&&_t!==null||mt!==null&&mt.ref!==_t)&&(gt.flags|=512,gt.flags|=2097152)}function E0(mt,gt,_t,Tt,At){var Dt=Xs(_t)?na:Ts.current;return Dt=Ml(gt,Dt),Nl(gt,At),_t=h0(mt,gt,_t,Tt,Dt,At),Tt=f0(),mt===null||Bs?(ss&&Tt&&q1(gt),gt.flags|=1,zs(mt,gt,_t,At),gt.child):(gt.updateQueue=mt.updateQueue,gt.flags&=-2053,mt.lanes&=~At,To(mt,gt,At))}function cp(mt,gt,_t,Tt,At){if(Xs(_t)){var Dt=!0;zu(gt)}else Dt=!1;if(Nl(gt,At),gt.stateNode===null)u1(mt,gt),A2(gt,_t,Tt),i0(gt,_t,Tt,At),Tt=!0;else if(mt===null){var Wt=gt.stateNode,Zt=gt.memoizedProps;Wt.props=Zt;var rr=Wt.context,ir=_t.contextType;typeof ir=="object"&&ir!==null?ir=Un(ir):ir=Ml(gt,ir=Xs(_t)?na:Ts.current);var cr=_t.getDerivedStateFromProps,wr=typeof cr=="function"||typeof Wt.getSnapshotBeforeUpdate=="function";wr||typeof Wt.UNSAFE_componentWillReceiveProps!="function"&&typeof Wt.componentWillReceiveProps!="function"||(Zt!==Tt||rr!==ir)&&P2(gt,Wt,Tt,ir),$o=!1;var ar=gt.memoizedState;Wt.state=ar,Zu(gt,Tt,Wt,At),rr=gt.memoizedState,Zt!==Tt||ar!==rr||Fs.current||$o?(typeof cr=="function"&&(n0(gt,_t,cr,Tt),rr=gt.memoizedState),(Zt=$o||C2(gt,_t,Zt,Tt,ar,rr,ir))?(wr||typeof Wt.UNSAFE_componentWillMount!="function"&&typeof Wt.componentWillMount!="function"||(typeof Wt.componentWillMount=="function"&&Wt.componentWillMount(),typeof Wt.UNSAFE_componentWillMount=="function"&&Wt.UNSAFE_componentWillMount()),typeof Wt.componentDidMount=="function"&&(gt.flags|=4194308)):(typeof Wt.componentDidMount=="function"&&(gt.flags|=4194308),gt.memoizedProps=Tt,gt.memoizedState=rr),Wt.props=Tt,Wt.state=rr,Wt.context=ir,Tt=Zt):(typeof Wt.componentDidMount=="function"&&(gt.flags|=4194308),Tt=!1)}else{Wt=gt.stateNode,S2(mt,gt),Zt=gt.memoizedProps,ir=gt.type===gt.elementType?Zt:Zn(gt.type,Zt),Wt.props=ir,wr=gt.pendingProps,ar=Wt.context,typeof(rr=_t.contextType)=="object"&&rr!==null?rr=Un(rr):rr=Ml(gt,rr=Xs(_t)?na:Ts.current);var Er=_t.getDerivedStateFromProps;(cr=typeof Er=="function"||typeof Wt.getSnapshotBeforeUpdate=="function")||typeof Wt.UNSAFE_componentWillReceiveProps!="function"&&typeof Wt.componentWillReceiveProps!="function"||(Zt!==wr||ar!==rr)&&P2(gt,Wt,Tt,rr),$o=!1,ar=gt.memoizedState,Wt.state=ar,Zu(gt,Tt,Wt,At);var Cr=gt.memoizedState;Zt!==wr||ar!==Cr||Fs.current||$o?(typeof Er=="function"&&(n0(gt,_t,Er,Tt),Cr=gt.memoizedState),(ir=$o||C2(gt,_t,ir,Tt,ar,Cr,rr)||!1)?(cr||typeof Wt.UNSAFE_componentWillUpdate!="function"&&typeof Wt.componentWillUpdate!="function"||(typeof Wt.componentWillUpdate=="function"&&Wt.componentWillUpdate(Tt,Cr,rr),typeof Wt.UNSAFE_componentWillUpdate=="function"&&Wt.UNSAFE_componentWillUpdate(Tt,Cr,rr)),typeof Wt.componentDidUpdate=="function"&&(gt.flags|=4),typeof Wt.getSnapshotBeforeUpdate=="function"&&(gt.flags|=1024)):(typeof Wt.componentDidUpdate!="function"||Zt===mt.memoizedProps&&ar===mt.memoizedState||(gt.flags|=4),typeof Wt.getSnapshotBeforeUpdate!="function"||Zt===mt.memoizedProps&&ar===mt.memoizedState||(gt.flags|=1024),gt.memoizedProps=Tt,gt.memoizedState=Cr),Wt.props=Tt,Wt.state=Cr,Wt.context=rr,Tt=ir):(typeof Wt.componentDidUpdate!="function"||Zt===mt.memoizedProps&&ar===mt.memoizedState||(gt.flags|=4),typeof Wt.getSnapshotBeforeUpdate!="function"||Zt===mt.memoizedProps&&ar===mt.memoizedState||(gt.flags|=1024),Tt=!1)}return b0(mt,gt,_t,Tt,Dt,At)}function b0(mt,gt,_t,Tt,At,Dt){up(mt,gt);var Wt=(128>.flags)!=0;if(!Tt&&!Wt)return At&&c2(gt,_t,!1),To(mt,gt,Dt);Tt=gt.stateNode,zm.current=gt;var Zt=Wt&&typeof _t.getDerivedStateFromError!="function"?null:Tt.render();return gt.flags|=1,mt!==null&&Wt?(gt.child=Fl(gt,mt.child,null,Dt),gt.child=Fl(gt,null,Zt,Dt)):zs(mt,gt,Zt,Dt),gt.memoizedState=Tt.state,At&&c2(gt,_t,!0),gt.child}function dp(mt){var gt=mt.stateNode;gt.pendingContext?l2(0,gt.pendingContext,gt.pendingContext!==gt.context):gt.context&&l2(0,gt.context,!1),o0(mt,gt.containerInfo)}function hp(mt,gt,_t,Tt,At){return Dl(),Q1(At),gt.flags|=256,zs(mt,gt,_t,Tt),gt.child}var Su,_u,o1,a1,w0={dehydrated:null,treeContext:null,retryLane:0};function S0(mt){return{baseLanes:mt,cachePool:null,transitions:null}}function fp(mt,gt,_t){var Tt,At=gt.pendingProps,Dt=ls.current,Wt=!1,Zt=(128>.flags)!=0;if((Tt=Zt)||(Tt=(mt===null||mt.memoizedState!==null)&&(2&Dt)!=0),Tt?(Wt=!0,gt.flags&=-129):mt!==null&&mt.memoizedState===null||(Dt|=1),Jr(ls,1&Dt),mt===null)return K1(gt),(mt=gt.memoizedState)!==null&&(mt=mt.dehydrated)!==null?(1>.mode?wo(mt)?gt.lanes=8:gt.lanes=1073741824:gt.lanes=1,null):(Zt=At.children,mt=At.fallback,Wt?(At=gt.mode,Wt=gt.child,Zt={mode:"hidden",children:Zt},!(1&At)&&Wt!==null?(Wt.childLanes=0,Wt.pendingProps=Zt):Wt=T1(Zt,At,0,null),mt=El(mt,At,_t,null),Wt.return=gt,mt.return=gt,Wt.sibling=mt,gt.child=Wt,gt.child.memoizedState=S0(_t),gt.memoizedState=w0,mt):_0(gt,Zt));if((Dt=mt.memoizedState)!==null&&(Tt=Dt.dehydrated)!==null)return function(ir,cr,wr,ar,Er,Cr,Nr){if(wr)return 256&cr.flags?(cr.flags&=-257,l1(ir,cr,Nr,ar=v0(Error(ot(422))))):cr.memoizedState!==null?(cr.child=ir.child,cr.flags|=128,null):(Cr=ar.fallback,Er=cr.mode,ar=T1({mode:"visible",children:ar.children},Er,0,null),(Cr=El(Cr,Er,Nr,null)).flags|=2,ar.return=cr,Cr.return=cr,ar.sibling=Cr,cr.child=ar,1&cr.mode&&Fl(cr,ir.child,null,Nr),cr.child.memoizedState=S0(Nr),cr.memoizedState=w0,Cr);if(!(1&cr.mode))return l1(ir,cr,Nr,null);if(wo(Er))return ar=Jo(Er).digest,Cr=Error(ot(419)),ar=v0(Cr,ar,void 0),l1(ir,cr,Nr,ar);if(wr=(Nr&ir.childLanes)!=0,Bs||wr){if((ar=ys)!==null){switch(Nr&-Nr){case 4:Er=2;break;case 16:Er=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:Er=32;break;case 536870912:Er=268435456;break;default:Er=0}(Er=Er&(ar.suspendedLanes|Nr)?0:Er)!==0&&Er!==Cr.retryLane&&(Cr.retryLane=Er,lo(ir,Er),Gn(ar,ir,Er,-1))}return H0(),l1(ir,cr,Nr,ar=v0(Error(ot(421))))}return Mn(Er)?(cr.flags|=128,cr.child=ir.child,cr=Km.bind(null,ir),so(Er,cr),null):(ir=Cr.treeContext,Ar&&(Bn=dm(Er),Ys=cr,ss=!0,Qn=null,mu=!1,ir!==null&&($n[Fn++]=ao,$n[Fn++]=_o,$n[Fn++]=ga,ao=ir.id,_o=ir.overflow,ga=cr)),cr=_0(cr,ar.children),cr.flags|=4096,cr)}(mt,gt,Zt,At,Tt,Dt,_t);if(Wt){Wt=At.fallback,Zt=gt.mode,Tt=(Dt=mt.child).sibling;var rr={mode:"hidden",children:At.children};return!(1&Zt)&>.child!==Dt?((At=gt.child).childLanes=0,At.pendingProps=rr,gt.deletions=null):(At=Bo(Dt,rr)).subtreeFlags=14680064&Dt.subtreeFlags,Tt!==null?Wt=Bo(Tt,Wt):(Wt=El(Wt,Zt,_t,null)).flags|=2,Wt.return=gt,At.return=gt,At.sibling=Wt,gt.child=At,At=Wt,Wt=gt.child,Zt=(Zt=mt.child.memoizedState)===null?S0(_t):{baseLanes:Zt.baseLanes|_t,cachePool:null,transitions:Zt.transitions},Wt.memoizedState=Zt,Wt.childLanes=mt.childLanes&~_t,gt.memoizedState=w0,At}return mt=(Wt=mt.child).sibling,At=Bo(Wt,{mode:"visible",children:At.children}),!(1>.mode)&&(At.lanes=_t),At.return=gt,At.sibling=null,mt!==null&&((_t=gt.deletions)===null?(gt.deletions=[mt],gt.flags|=16):_t.push(mt)),gt.child=At,gt.memoizedState=null,At}function _0(mt,gt){return(gt=T1({mode:"visible",children:gt},mt.mode,0,null)).return=mt,mt.child=gt}function l1(mt,gt,_t,Tt){return Tt!==null&&Q1(Tt),Fl(gt,mt.child,null,_t),(mt=_0(gt,gt.pendingProps.children)).flags|=2,gt.memoizedState=null,mt}function pp(mt,gt,_t){mt.lanes|=gt;var Tt=mt.alternate;Tt!==null&&(Tt.lanes|=gt),t0(mt.return,gt,_t)}function R0(mt,gt,_t,Tt,At){var Dt=mt.memoizedState;Dt===null?mt.memoizedState={isBackwards:gt,rendering:null,renderingStartTime:0,last:Tt,tail:_t,tailMode:At}:(Dt.isBackwards=gt,Dt.rendering=null,Dt.renderingStartTime=0,Dt.last=Tt,Dt.tail=_t,Dt.tailMode=At)}function mp(mt,gt,_t){var Tt=gt.pendingProps,At=Tt.revealOrder,Dt=Tt.tail;if(zs(mt,gt,Tt.children,_t),(2&(Tt=ls.current))!=0)Tt=1&Tt|2,gt.flags|=128;else{if(mt!==null&&128&mt.flags)e:for(mt=gt.child;mt!==null;){if(mt.tag===13)mt.memoizedState!==null&&pp(mt,_t,gt);else if(mt.tag===19)pp(mt,_t,gt);else if(mt.child!==null){mt.child.return=mt,mt=mt.child;continue}if(mt===gt)break e;for(;mt.sibling===null;){if(mt.return===null||mt.return===gt)break e;mt=mt.return}mt.sibling.return=mt.return,mt=mt.sibling}Tt&=1}if(Jr(ls,Tt),(1>.mode)==0)gt.memoizedState=null;else switch(At){case"forwards":for(_t=gt.child,At=null;_t!==null;)(mt=_t.alternate)!==null&&e1(mt)===null&&(At=_t),_t=_t.sibling;(_t=At)===null?(At=gt.child,gt.child=null):(At=_t.sibling,_t.sibling=null),R0(gt,!1,At,_t,Dt);break;case"backwards":for(_t=null,At=gt.child,gt.child=null;At!==null;){if((mt=At.alternate)!==null&&e1(mt)===null){gt.child=At;break}mt=At.sibling,At.sibling=_t,_t=At,At=mt}R0(gt,!0,_t,null,Dt);break;case"together":R0(gt,!1,null,null,void 0);break;default:gt.memoizedState=null}return gt.child}function u1(mt,gt){!(1>.mode)&&mt!==null&&(mt.alternate=null,gt.alternate=null,gt.flags|=2)}function To(mt,gt,_t){if(mt!==null&&(gt.dependencies=mt.dependencies),$a|=gt.lanes,(_t>.childLanes)==0)return null;if(mt!==null&>.child!==mt.child)throw Error(ot(153));if(gt.child!==null){for(_t=Bo(mt=gt.child,mt.pendingProps),gt.child=_t,_t.return=gt;mt.sibling!==null;)mt=mt.sibling,(_t=_t.sibling=Bo(mt,mt.pendingProps)).return=gt;_t.sibling=null}return gt.child}function ho(mt){mt.flags|=4}function gp(mt,gt){if(mt!==null&&mt.child===gt.child)return!0;if(16>.flags)return!1;for(mt=gt.child;mt!==null;){if(12854&mt.flags||12854&mt.subtreeFlags)return!1;mt=mt.sibling}return!0}if(pr)Su=function(mt,gt){for(var _t=gt.child;_t!==null;){if(_t.tag===5||_t.tag===6)Qt(mt,_t.stateNode);else if(_t.tag!==4&&_t.child!==null){_t.child.return=_t,_t=_t.child;continue}if(_t===gt)break;for(;_t.sibling===null;){if(_t.return===null||_t.return===gt)return;_t=_t.return}_t.sibling.return=_t.return,_t=_t.sibling}},_u=function(){},o1=function(mt,gt,_t,Tt,At){if((mt=mt.memoizedProps)!==Tt){var Dt=gt.stateNode,Wt=uo(Hn.current);_t=tr(Dt,_t,mt,Tt,At,Wt),(gt.updateQueue=_t)&&ho(gt)}},a1=function(mt,gt,_t,Tt){_t!==Tt&&ho(gt)};else if(_r){Su=function(mt,gt,_t,Tt){for(var At=gt.child;At!==null;){if(At.tag===5){var Dt=At.stateNode;_t&&Tt&&(Dt=qs(Dt,At.type,At.memoizedProps,At)),Qt(mt,Dt)}else if(At.tag===6)Dt=At.stateNode,_t&&Tt&&(Dt=bo(Dt,At.memoizedProps,At)),Qt(mt,Dt);else if(At.tag!==4){if(At.tag===22&&At.memoizedState!==null)(Dt=At.child)!==null&&(Dt.return=At),Su(mt,At,!0,!0);else if(At.child!==null){At.child.return=At,At=At.child;continue}}if(At===gt)break;for(;At.sibling===null;){if(At.return===null||At.return===gt)return;At=At.return}At.sibling.return=At.return,At=At.sibling}};var xp=function(mt,gt,_t,Tt){for(var At=gt.child;At!==null;){if(At.tag===5){var Dt=At.stateNode;_t&&Tt&&(Dt=qs(Dt,At.type,At.memoizedProps,At)),Xn(mt,Dt)}else if(At.tag===6)Dt=At.stateNode,_t&&Tt&&(Dt=bo(Dt,At.memoizedProps,At)),Xn(mt,Dt);else if(At.tag!==4){if(At.tag===22&&At.memoizedState!==null)(Dt=At.child)!==null&&(Dt.return=At),xp(mt,At,!0,!0);else if(At.child!==null){At.child.return=At,At=At.child;continue}}if(At===gt)break;for(;At.sibling===null;){if(At.return===null||At.return===gt)return;At=At.return}At.sibling.return=At.return,At=At.sibling}};_u=function(mt,gt){var _t=gt.stateNode;if(!gp(mt,gt)){mt=_t.containerInfo;var Tt=Rs(mt);xp(Tt,gt,!1,!1),_t.pendingChildren=Tt,ho(gt),Ns(mt,Tt)}},o1=function(mt,gt,_t,Tt,At){var Dt=mt.stateNode,Wt=mt.memoizedProps;if((mt=gp(mt,gt))&&Wt===Tt)gt.stateNode=Dt;else{var Zt=gt.stateNode,rr=uo(Hn.current),ir=null;Wt!==Tt&&(ir=tr(Zt,_t,Wt,Tt,At,rr)),mt&&ir===null?gt.stateNode=Dt:(Dt=Is(Dt,ir,_t,Wt,Tt,gt,mt,Zt),Yt(Dt,_t,Tt,At,rr)&&ho(gt),gt.stateNode=Dt,mt?ho(gt):Su(Dt,gt,!1,!1))}},a1=function(mt,gt,_t,Tt){_t!==Tt?(mt=uo(Bl.current),_t=uo(Hn.current),gt.stateNode=ur(Tt,mt,_t,gt),ho(gt)):gt.stateNode=mt.stateNode}}else _u=function(){},o1=function(){},a1=function(){};function Ru(mt,gt){if(!ss)switch(mt.tailMode){case"hidden":gt=mt.tail;for(var _t=null;gt!==null;)gt.alternate!==null&&(_t=gt),gt=gt.sibling;_t===null?mt.tail=null:_t.sibling=null;break;case"collapsed":_t=mt.tail;for(var Tt=null;_t!==null;)_t.alternate!==null&&(Tt=_t),_t=_t.sibling;Tt===null?gt||mt.tail===null?mt.tail=null:mt.tail.sibling=null:Tt.sibling=null}}function Ms(mt){var gt=mt.alternate!==null&&mt.alternate.child===mt.child,_t=0,Tt=0;if(gt)for(var At=mt.child;At!==null;)_t|=At.lanes|At.childLanes,Tt|=14680064&At.subtreeFlags,Tt|=14680064&At.flags,At.return=mt,At=At.sibling;else for(At=mt.child;At!==null;)_t|=At.lanes|At.childLanes,Tt|=At.subtreeFlags,Tt|=At.flags,At.return=mt,At=At.sibling;return mt.subtreeFlags|=Tt,mt.childLanes=_t,gt}function Um(mt,gt,_t){var Tt=gt.pendingProps;switch(X1(gt),gt.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ms(gt),null;case 1:case 17:return Xs(gt.type)&&N1(),Ms(gt),null;case 3:return _t=gt.stateNode,zl(),rs(Fs),rs(Ts),u0(),_t.pendingContext&&(_t.context=_t.pendingContext,_t.pendingContext=null),mt!==null&&mt.child!==null||(qu(gt)?ho(gt):mt===null||mt.memoizedState.isDehydrated&&!(256>.flags)||(gt.flags|=1024,Qn!==null&&(z0(Qn),Qn=null))),_u(mt,gt),Ms(gt),null;case 5:a0(gt),_t=uo(Bl.current);var At=gt.type;if(mt!==null&>.stateNode!=null)o1(mt,gt,At,Tt,_t),mt.ref!==gt.ref&&(gt.flags|=512,gt.flags|=2097152);else{if(!Tt){if(gt.stateNode===null)throw Error(ot(166));return Ms(gt),null}if(mt=uo(Hn.current),qu(gt)){if(!Ar)throw Error(ot(175));mt=hm(gt.stateNode,gt.type,gt.memoizedProps,_t,mt,gt,!mu),gt.updateQueue=mt,mt!==null&&ho(gt)}else{var Dt=qt(At,Tt,_t,mt,gt);Su(Dt,gt,!1,!1),gt.stateNode=Dt,Yt(Dt,At,Tt,_t,mt)&&ho(gt)}gt.ref!==null&&(gt.flags|=512,gt.flags|=2097152)}return Ms(gt),null;case 6:if(mt&>.stateNode!=null)a1(mt,gt,mt.memoizedProps,Tt);else{if(typeof Tt!="string"&>.stateNode===null)throw Error(ot(166));if(mt=uo(Bl.current),_t=uo(Hn.current),qu(gt)){if(!Ar)throw Error(ot(176));if(mt=gt.stateNode,_t=gt.memoizedProps,(Tt=fm(mt,_t,gt,!mu))&&(At=Ys)!==null)switch(At.tag){case 3:bm(At.stateNode.containerInfo,mt,_t,(1&At.mode)!=0);break;case 5:wm(At.type,At.memoizedProps,At.stateNode,mt,_t,(1&At.mode)!=0)}Tt&&ho(gt)}else gt.stateNode=ur(Tt,mt,_t,gt)}return Ms(gt),null;case 13:if(rs(ls),Tt=gt.memoizedState,mt===null||mt.memoizedState!==null&&mt.memoizedState.dehydrated!==null){if(ss&&Bn!==null&&1>.mode&&!(128>.flags))E2(),Dl(),gt.flags|=98560,At=!1;else if(At=qu(gt),Tt!==null&&Tt.dehydrated!==null){if(mt===null){if(!At)throw Error(ot(318));if(!Ar)throw Error(ot(344));if(!(At=(At=gt.memoizedState)!==null?At.dehydrated:null))throw Error(ot(317));pm(At,gt)}else Dl(),!(128>.flags)&&(gt.memoizedState=null),gt.flags|=4;Ms(gt),At=!1}else Qn!==null&&(z0(Qn),Qn=null),At=!0;if(!At)return 65536>.flags?gt:null}return 128>.flags?(gt.lanes=_t,gt):((_t=Tt!==null)!=(mt!==null&&mt.memoizedState!==null)&&_t&&(gt.child.flags|=8192,1>.mode&&(mt===null||1&ls.current?fs===0&&(fs=3):H0())),gt.updateQueue!==null&&(gt.flags|=4),Ms(gt),null);case 4:return zl(),_u(mt,gt),mt===null&&Ur(gt.stateNode.containerInfo),Ms(gt),null;case 10:return e0(gt.type._context),Ms(gt),null;case 19:if(rs(ls),(At=gt.memoizedState)===null)return Ms(gt),null;if(Tt=(128>.flags)!=0,(Dt=At.rendering)===null)if(Tt)Ru(At,!1);else{if(fs!==0||mt!==null&&128&mt.flags)for(mt=gt.child;mt!==null;){if((Dt=e1(mt))!==null){for(gt.flags|=128,Ru(At,!1),(mt=Dt.updateQueue)!==null&&(gt.updateQueue=mt,gt.flags|=4),gt.subtreeFlags=0,mt=_t,_t=gt.child;_t!==null;)At=mt,(Tt=_t).flags&=14680066,(Dt=Tt.alternate)===null?(Tt.childLanes=0,Tt.lanes=At,Tt.child=null,Tt.subtreeFlags=0,Tt.memoizedProps=null,Tt.memoizedState=null,Tt.updateQueue=null,Tt.dependencies=null,Tt.stateNode=null):(Tt.childLanes=Dt.childLanes,Tt.lanes=Dt.lanes,Tt.child=Dt.child,Tt.subtreeFlags=0,Tt.deletions=null,Tt.memoizedProps=Dt.memoizedProps,Tt.memoizedState=Dt.memoizedState,Tt.updateQueue=Dt.updateQueue,Tt.type=Dt.type,At=Dt.dependencies,Tt.dependencies=At===null?null:{lanes:At.lanes,firstContext:At.firstContext}),_t=_t.sibling;return Jr(ls,1&ls.current|2),gt.child}mt=mt.sibling}At.tail!==null&&gs()>L0&&(gt.flags|=128,Tt=!0,Ru(At,!1),gt.lanes=4194304)}else{if(!Tt)if((mt=e1(Dt))!==null){if(gt.flags|=128,Tt=!0,(mt=mt.updateQueue)!==null&&(gt.updateQueue=mt,gt.flags|=4),Ru(At,!0),At.tail===null&&At.tailMode==="hidden"&&!Dt.alternate&&!ss)return Ms(gt),null}else 2*gs()-At.renderingStartTime>L0&&_t!==1073741824&&(gt.flags|=128,Tt=!0,Ru(At,!1),gt.lanes=4194304);At.isBackwards?(Dt.sibling=gt.child,gt.child=Dt):((mt=At.last)!==null?mt.sibling=Dt:gt.child=Dt,At.last=Dt)}return At.tail!==null?(gt=At.tail,At.rendering=gt,At.tail=gt.sibling,At.renderingStartTime=gs(),gt.sibling=null,mt=ls.current,Jr(ls,Tt?1&mt|2:1&mt),gt):(Ms(gt),null);case 22:case 23:return U0(),_t=gt.memoizedState!==null,mt!==null&&mt.memoizedState!==null!==_t&&(gt.flags|=8192),_t&&1>.mode?1073741824&Ks&&(Ms(gt),pr&&6>.subtreeFlags&&(gt.flags|=8192)):Ms(gt),null;case 24:case 25:return null}throw Error(ot(156,gt.tag))}function Hm(mt,gt){switch(X1(gt),gt.tag){case 1:return Xs(gt.type)&&N1(),65536&(mt=gt.flags)?(gt.flags=-65537&mt|128,gt):null;case 3:return zl(),rs(Fs),rs(Ts),u0(),65536&(mt=gt.flags)&&!(128&mt)?(gt.flags=-65537&mt|128,gt):null;case 5:return a0(gt),null;case 13:if(rs(ls),(mt=gt.memoizedState)!==null&&mt.dehydrated!==null){if(gt.alternate===null)throw Error(ot(340));Dl()}return 65536&(mt=gt.flags)?(gt.flags=-65537&mt|128,gt):null;case 19:return rs(ls),null;case 4:return zl(),null;case 10:return e0(gt.type._context),null;case 22:case 23:return U0(),null;default:return null}}var c1=!1,As=!1,Vm=typeof WeakSet=="function"?WeakSet:Set,Rr=null;function Hl(mt,gt){var _t=mt.ref;if(_t!==null)if(typeof _t=="function")try{_t(null)}catch(Tt){ns(mt,gt,Tt)}else _t.current=null}function vp(mt,gt,_t){try{_t()}catch(Tt){ns(mt,gt,Tt)}}var yp=!1;function Tu(mt,gt,_t){var Tt=gt.updateQueue;if((Tt=Tt!==null?Tt.lastEffect:null)!==null){var At=Tt=Tt.next;do{if((At.tag&mt)===mt){var Dt=At.destroy;At.destroy=void 0,Dt!==void 0&&vp(gt,_t,Dt)}At=At.next}while(At!==Tt)}}function d1(mt,gt){if((gt=(gt=gt.updateQueue)!==null?gt.lastEffect:null)!==null){var _t=gt=gt.next;do{if((_t.tag&mt)===mt){var Tt=_t.create;_t.destroy=Tt()}_t=_t.next}while(_t!==gt)}}function T0(mt){var gt=mt.ref;if(gt!==null){var _t=mt.stateNode;mt.tag===5?mt=Ft(_t):mt=_t,typeof gt=="function"?gt(mt):gt.current=mt}}function Ep(mt){var gt=mt.alternate;gt!==null&&(mt.alternate=null,Ep(gt)),mt.child=null,mt.deletions=null,mt.sibling=null,mt.tag===5&&(gt=mt.stateNode)!==null&&Gs(gt),mt.stateNode=null,mt.return=null,mt.dependencies=null,mt.memoizedProps=null,mt.memoizedState=null,mt.pendingProps=null,mt.stateNode=null,mt.updateQueue=null}function bp(mt){return mt.tag===5||mt.tag===3||mt.tag===4}function wp(mt){e:for(;;){for(;mt.sibling===null;){if(mt.return===null||bp(mt.return))return null;mt=mt.return}for(mt.sibling.return=mt.return,mt=mt.sibling;mt.tag!==5&&mt.tag!==6&&mt.tag!==18;){if(2&mt.flags||mt.child===null||mt.tag===4)continue e;mt.child.return=mt,mt=mt.child}if(!(2&mt.flags))return mt.stateNode}}function C0(mt,gt,_t){var Tt=mt.tag;if(Tt===5||Tt===6)mt=mt.stateNode,gt?Wr(_t,mt,gt):Zr(_t,mt);else if(Tt!==4&&(mt=mt.child)!==null)for(C0(mt,gt,_t),mt=mt.sibling;mt!==null;)C0(mt,gt,_t),mt=mt.sibling}function A0(mt,gt,_t){var Tt=mt.tag;if(Tt===5||Tt===6)mt=mt.stateNode,gt?kr(_t,mt,gt):Dr(_t,mt);else if(Tt!==4&&(mt=mt.child)!==null)for(A0(mt,gt,_t),mt=mt.sibling;mt!==null;)A0(mt,gt,_t),mt=mt.sibling}var $s=null,fo=!1;function po(mt,gt,_t){for(_t=_t.child;_t!==null;)P0(mt,gt,_t),_t=_t.sibling}function P0(mt,gt,_t){if(io&&typeof io.onCommitFiberUnmount=="function")try{io.onCommitFiberUnmount(Hu,_t)}catch{}switch(_t.tag){case 5:As||Hl(_t,gt);case 6:if(pr){var Tt=$s,At=fo;$s=null,po(mt,gt,_t),fo=At,($s=Tt)!==null&&(fo?ps($s,_t.stateNode):bs($s,_t.stateNode))}else po(mt,gt,_t);break;case 18:pr&&$s!==null&&(fo?ym($s,_t.stateNode):vm($s,_t.stateNode));break;case 4:pr?(Tt=$s,At=fo,$s=_t.stateNode.containerInfo,fo=!0,po(mt,gt,_t),$s=Tt,fo=At):(_r&&(Tt=_t.stateNode.containerInfo,At=Rs(Tt),ws(Tt,At)),po(mt,gt,_t));break;case 0:case 11:case 14:case 15:if(!As&&(Tt=_t.updateQueue)!==null&&(Tt=Tt.lastEffect)!==null){At=Tt=Tt.next;do{var Dt=At,Wt=Dt.destroy;Dt=Dt.tag,Wt!==void 0&&(2&Dt||4&Dt)&&vp(_t,gt,Wt),At=At.next}while(At!==Tt)}po(mt,gt,_t);break;case 1:if(!As&&(Hl(_t,gt),typeof(Tt=_t.stateNode).componentWillUnmount=="function"))try{Tt.props=_t.memoizedProps,Tt.state=_t.memoizedState,Tt.componentWillUnmount()}catch(Zt){ns(_t,gt,Zt)}po(mt,gt,_t);break;case 21:po(mt,gt,_t);break;case 22:1&_t.mode?(As=(Tt=As)||_t.memoizedState!==null,po(mt,gt,_t),As=Tt):po(mt,gt,_t);break;default:po(mt,gt,_t)}}function Sp(mt){var gt=mt.updateQueue;if(gt!==null){mt.updateQueue=null;var _t=mt.stateNode;_t===null&&(_t=mt.stateNode=new Vm),gt.forEach(function(Tt){var At=Qm.bind(null,mt,Tt);_t.has(Tt)||(_t.add(Tt),Tt.then(At,At))})}}function Jn(mt,gt){var _t=gt.deletions;if(_t!==null)for(var Tt=0;Tt<_t.length;Tt++){var At=_t[Tt];try{var Dt=mt,Wt=gt;if(pr){var Zt=Wt;e:for(;Zt!==null;){switch(Zt.tag){case 5:$s=Zt.stateNode,fo=!1;break e;case 3:case 4:$s=Zt.stateNode.containerInfo,fo=!0;break e}Zt=Zt.return}if($s===null)throw Error(ot(160));P0(Dt,Wt,At),$s=null,fo=!1}else P0(Dt,Wt,At);var rr=At.alternate;rr!==null&&(rr.return=null),At.return=null}catch(ir){ns(At,gt,ir)}}if(12854>.subtreeFlags)for(gt=gt.child;gt!==null;)_p(gt,mt),gt=gt.sibling}function _p(mt,gt){var _t=mt.alternate,Tt=mt.flags;switch(mt.tag){case 0:case 11:case 14:case 15:if(Jn(gt,mt),mo(mt),4&Tt){try{Tu(3,mt,mt.return),d1(3,mt)}catch(ar){ns(mt,mt.return,ar)}try{Tu(5,mt,mt.return)}catch(ar){ns(mt,mt.return,ar)}}break;case 1:Jn(gt,mt),mo(mt),512&Tt&&_t!==null&&Hl(_t,_t.return);break;case 5:if(Jn(gt,mt),mo(mt),512&Tt&&_t!==null&&Hl(_t,_t.return),pr){if(32&mt.flags){var At=mt.stateNode;try{zr(At)}catch(ar){ns(mt,mt.return,ar)}}if(4&Tt&&(At=mt.stateNode)!=null){var Dt=mt.memoizedProps;if(_t=_t!==null?_t.memoizedProps:Dt,Tt=mt.type,gt=mt.updateQueue,mt.updateQueue=null,gt!==null)try{Br(At,gt,Tt,_t,Dt,mt)}catch(ar){ns(mt,mt.return,ar)}}}break;case 6:if(Jn(gt,mt),mo(mt),4&Tt&&pr){if(mt.stateNode===null)throw Error(ot(162));At=mt.stateNode,Dt=mt.memoizedProps,_t=_t!==null?_t.memoizedProps:Dt;try{ks(At,_t,Dt)}catch(ar){ns(mt,mt.return,ar)}}break;case 3:if(Jn(gt,mt),mo(mt),4&Tt){if(pr&&Ar&&_t!==null&&_t.memoizedState.isDehydrated)try{gm(gt.containerInfo)}catch(ar){ns(mt,mt.return,ar)}if(_r){At=gt.containerInfo,Dt=gt.pendingChildren;try{ws(At,Dt)}catch(ar){ns(mt,mt.return,ar)}}}break;case 4:if(Jn(gt,mt),mo(mt),4&Tt&&_r){At=(Dt=mt.stateNode).containerInfo,Dt=Dt.pendingChildren;try{ws(At,Dt)}catch(ar){ns(mt,mt.return,ar)}}break;case 13:Jn(gt,mt),mo(mt),8192&(At=mt.child).flags&&(Dt=At.memoizedState!==null,At.stateNode.isHidden=Dt,!Dt||At.alternate!==null&&At.alternate.memoizedState!==null||(k0=gs())),4&Tt&&Sp(mt);break;case 22:var Wt=_t!==null&&_t.memoizedState!==null;if(1&mt.mode?(As=(_t=As)||Wt,Jn(gt,mt),As=_t):Jn(gt,mt),mo(mt),8192&Tt){if(_t=mt.memoizedState!==null,(mt.stateNode.isHidden=_t)&&!Wt&&(1&mt.mode)!=0)for(Rr=mt,Tt=mt.child;Tt!==null;){for(gt=Rr=Tt;Rr!==null;){var Zt=(Wt=Rr).child;switch(Wt.tag){case 0:case 11:case 14:case 15:Tu(4,Wt,Wt.return);break;case 1:Hl(Wt,Wt.return);var rr=Wt.stateNode;if(typeof rr.componentWillUnmount=="function"){var ir=Wt,cr=Wt.return;try{var wr=ir;rr.props=wr.memoizedProps,rr.state=wr.memoizedState,rr.componentWillUnmount()}catch(ar){ns(ir,cr,ar)}}break;case 5:Hl(Wt,Wt.return);break;case 22:if(Wt.memoizedState!==null){Cp(gt);continue}}Zt!==null?(Zt.return=Wt,Rr=Zt):Cp(gt)}Tt=Tt.sibling}if(pr){e:if(Tt=null,pr)for(gt=mt;;){if(gt.tag===5){if(Tt===null){Tt=gt;try{At=gt.stateNode,_t?$r(At):Zo(gt.stateNode,gt.memoizedProps)}catch(ar){ns(mt,mt.return,ar)}}}else if(gt.tag===6){if(Tt===null)try{Dt=gt.stateNode,_t?Ls(Dt):Pl(Dt,gt.memoizedProps)}catch(ar){ns(mt,mt.return,ar)}}else if((gt.tag!==22&>.tag!==23||gt.memoizedState===null||gt===mt)&>.child!==null){gt.child.return=gt,gt=gt.child;continue}if(gt===mt)break e;for(;gt.sibling===null;){if(gt.return===null||gt.return===mt)break e;Tt===gt&&(Tt=null),gt=gt.return}Tt===gt&&(Tt=null),gt.sibling.return=gt.return,gt=gt.sibling}}}break;case 19:Jn(gt,mt),mo(mt),4&Tt&&Sp(mt);break;case 21:break;default:Jn(gt,mt),mo(mt)}}function mo(mt){var gt=mt.flags;if(2>){try{if(pr){e:{for(var _t=mt.return;_t!==null;){if(bp(_t)){var Tt=_t;break e}_t=_t.return}throw Error(ot(160))}switch(Tt.tag){case 5:var At=Tt.stateNode;32&Tt.flags&&(zr(At),Tt.flags&=-33),A0(mt,wp(mt),At);break;case 3:case 4:var Dt=Tt.stateNode.containerInfo;C0(mt,wp(mt),Dt);break;default:throw Error(ot(161))}}}catch(Wt){ns(mt,mt.return,Wt)}mt.flags&=-3}4096>&&(mt.flags&=-4097)}function Gm(mt,gt,_t){Rr=mt,Rp(mt)}function Rp(mt,gt,_t){for(var Tt=(1&mt.mode)!=0;Rr!==null;){var At=Rr,Dt=At.child;if(At.tag===22&&Tt){var Wt=At.memoizedState!==null||c1;if(!Wt){var Zt=At.alternate,rr=Zt!==null&&Zt.memoizedState!==null||As;Zt=c1;var ir=As;if(c1=Wt,(As=rr)&&!ir)for(Rr=At;Rr!==null;)rr=(Wt=Rr).child,Wt.tag===22&&Wt.memoizedState!==null?Ap(At):rr!==null?(rr.return=Wt,Rr=rr):Ap(At);for(;Dt!==null;)Rr=Dt,Rp(Dt),Dt=Dt.sibling;Rr=At,c1=Zt,As=ir}Tp(mt)}else 8772&At.subtreeFlags&&Dt!==null?(Dt.return=At,Rr=Dt):Tp(mt)}}function Tp(mt){for(;Rr!==null;){var gt=Rr;if(8772>.flags){var _t=gt.alternate;try{if(8772>.flags)switch(gt.tag){case 0:case 11:case 15:As||d1(5,gt);break;case 1:var Tt=gt.stateNode;if(4>.flags&&!As)if(_t===null)Tt.componentDidMount();else{var At=gt.elementType===gt.type?_t.memoizedProps:Zn(gt.type,_t.memoizedProps);Tt.componentDidUpdate(At,_t.memoizedState,Tt.__reactInternalSnapshotBeforeUpdate)}var Dt=gt.updateQueue;Dt!==null&&R2(gt,Dt,Tt);break;case 3:var Wt=gt.updateQueue;if(Wt!==null){if(_t=null,gt.child!==null)switch(gt.child.tag){case 5:_t=Ft(gt.child.stateNode);break;case 1:_t=gt.child.stateNode}R2(gt,Wt,_t)}break;case 5:var Zt=gt.stateNode;_t===null&&4>.flags&&Ir(Zt,gt.type,gt.memoizedProps,gt);break;case 6:case 4:case 12:case 19:case 17:case 21:case 22:case 23:case 25:break;case 13:if(Ar&>.memoizedState===null){var rr=gt.alternate;if(rr!==null){var ir=rr.memoizedState;if(ir!==null){var cr=ir.dehydrated;cr!==null&&xm(cr)}}}break;default:throw Error(ot(163))}As||512>.flags&&T0(gt)}catch(wr){ns(gt,gt.return,wr)}}if(gt===mt){Rr=null;break}if((_t=gt.sibling)!==null){_t.return=gt.return,Rr=_t;break}Rr=gt.return}}function Cp(mt){for(;Rr!==null;){var gt=Rr;if(gt===mt){Rr=null;break}var _t=gt.sibling;if(_t!==null){_t.return=gt.return,Rr=_t;break}Rr=gt.return}}function Ap(mt){for(;Rr!==null;){var gt=Rr;try{switch(gt.tag){case 0:case 11:case 15:var _t=gt.return;try{d1(4,gt)}catch(rr){ns(gt,_t,rr)}break;case 1:var Tt=gt.stateNode;if(typeof Tt.componentDidMount=="function"){var At=gt.return;try{Tt.componentDidMount()}catch(rr){ns(gt,At,rr)}}var Dt=gt.return;try{T0(gt)}catch(rr){ns(gt,Dt,rr)}break;case 5:var Wt=gt.return;try{T0(gt)}catch(rr){ns(gt,Wt,rr)}}}catch(rr){ns(gt,gt.return,rr)}if(gt===mt){Rr=null;break}var Zt=gt.sibling;if(Zt!==null){Zt.return=gt.return,Rr=Zt;break}Rr=gt.return}}var h1=0,f1=1,p1=2,m1=3,g1=4;if(typeof Symbol=="function"&&Symbol.for){var Cu=Symbol.for;h1=Cu("selector.component"),f1=Cu("selector.has_pseudo_class"),p1=Cu("selector.role"),m1=Cu("selector.test_id"),g1=Cu("selector.text")}function j0(mt){var gt=Hr(mt);if(gt!=null){if(typeof gt.memoizedProps["data-testname"]!="string")throw Error(ot(364));return gt}if((mt=er(mt))===null)throw Error(ot(362));return mt.stateNode.current}function I0(mt,gt){switch(gt.$$typeof){case h1:if(mt.type===gt.value)return!0;break;case f1:e:{gt=gt.value,mt=[mt,0];for(var _t=0;_t<mt.length;){var Tt=mt[_t++],At=mt[_t++],Dt=gt[At];if(Tt.tag!==5||!gr(Tt)){for(;Dt!=null&&I0(Tt,Dt);)Dt=gt[++At];if(At===gt.length){gt=!0;break e}for(Tt=Tt.child;Tt!==null;)mt.push(Tt,At),Tt=Tt.sibling}}gt=!1}return gt;case p1:if(mt.tag===5&&vr(mt.stateNode,gt.value))return!0;break;case g1:if((mt.tag===5||mt.tag===6)&&(mt=br(mt))!==null&&0<=mt.indexOf(gt.value))return!0;break;case m1:if(mt.tag===5&&typeof(mt=mt.memoizedProps["data-testname"])=="string"&&mt.toLowerCase()===gt.value.toLowerCase())return!0;break;default:throw Error(ot(365))}return!1}function M0(mt){switch(mt.$$typeof){case h1:return"<"+(It(mt.value)||"Unknown")+">";case f1:return":has("+(M0(mt)||"")+")";case p1:return'[role="'+mt.value+'"]';case g1:return'"'+mt.value+'"';case m1:return'[data-testname="'+mt.value+'"]';default:throw Error(ot(365))}}function Pp(mt,gt){var _t=[];mt=[mt,0];for(var Tt=0;Tt<mt.length;){var At=mt[Tt++],Dt=mt[Tt++],Wt=gt[Dt];if(At.tag!==5||!gr(At)){for(;Wt!=null&&I0(At,Wt);)Wt=gt[++Dt];if(Dt===gt.length)_t.push(At);else for(At=At.child;At!==null;)mt.push(At,Dt),At=At.sibling}}return _t}function $0(mt,gt){if(!Xt)throw Error(ot(363));mt=Pp(mt=j0(mt),gt),gt=[],mt=Array.from(mt);for(var _t=0;_t<mt.length;){var Tt=mt[_t++];if(Tt.tag===5)gr(Tt)||gt.push(Tt.stateNode);else for(Tt=Tt.child;Tt!==null;)mt.push(Tt),Tt=Tt.sibling}return gt}var Wm=Math.ceil,x1=at.ReactCurrentDispatcher,O0=at.ReactCurrentOwner,cs=at.ReactCurrentBatchConfig,Vr=0,ys=null,ds=null,Ss=0,Ks=0,Vl=Io(0),fs=0,Au=null,$a=0,v1=0,D0=0,Pu=null,Qs=null,k0=0,L0=1/0,Do=null;function Gl(){L0=gs()+500}var jp,y1=!1,N0=null,ko=null,E1=!1,Lo=null,b1=0,ju=0,F0=null,w1=-1,S1=0;function Ps(){return 6&Vr?gs():w1!==-1?w1:w1=gs()}function No(mt){return 1&mt.mode?2&Vr&&Ss!==0?Ss&-Ss:Im.transition!==null?(S1===0&&(S1=d2()),S1):(mt=qr)!==0?mt:os():1}function Gn(mt,gt,_t,Tt){if(50<ju)throw ju=0,F0=null,Error(ot(185));pu(mt,_t,Tt),2&Vr&&mt===ys||(mt===ys&&(!(2&Vr)&&(v1|=_t),fs===4&&Fo(mt,Ss)),Us(mt,Tt),_t===1&&Vr===0&&!(1>.mode)&&(Gl(),Vu&&oo()))}function Us(mt,gt){var _t=mt.callbackNode;(function(At,Dt){for(var Wt=At.suspendedLanes,Zt=At.pingedLanes,rr=At.expirationTimes,ir=At.pendingLanes;0<ir;){var cr=31-Yn(ir),wr=1<<cr,ar=rr[cr];ar===-1?wr&Wt&&!(wr&Zt)||(rr[cr]=Tm(wr,Dt)):ar<=Dt&&(At.expiredLanes|=wr),ir&=~wr}})(mt,gt);var Tt=Uu(mt,mt===ys?Ss:0);if(Tt===0)_t!==null&&f2(_t),mt.callbackNode=null,mt.callbackPriority=0;else if(gt=Tt&-Tt,mt.callbackPriority!==gt){if(_t!=null&&f2(_t),gt===1)mt.tag===0?function(At){Vu=!0,m2(At)}(Mp.bind(null,mt)):m2(Mp.bind(null,mt)),Es?Ws(function(){!(6&Vr)&&oo()}):V1(G1,oo),_t=null;else{switch(h2(Tt)){case 1:_t=G1;break;case 4:_t=Pm;break;case 16:default:_t=p2;break;case 536870912:_t=jm}_t=Bp(_t,Ip.bind(null,mt))}mt.callbackPriority=gt,mt.callbackNode=_t}}function Ip(mt,gt){if(w1=-1,S1=0,(6&Vr)!=0)throw Error(ot(327));var _t=mt.callbackNode;if(yl()&&mt.callbackNode!==_t)return null;var Tt=Uu(mt,mt===ys?Ss:0);if(Tt===0)return null;if(30&Tt||Tt&mt.expiredLanes||gt)gt=_1(mt,Tt);else{gt=Tt;var At=Vr;Vr|=2;var Dt=Dp();for(ys===mt&&Ss===gt||(Do=null,Gl(),xl(mt,gt));;)try{Xm();break}catch(Zt){Op(mt,Zt)}J1(),x1.current=Dt,Vr=At,ds!==null?gt=0:(ys=null,Ss=0,gt=fs)}if(gt!==0){if(gt===2&&(At=z1(mt))!==0&&(Tt=At,gt=B0(mt,At)),gt===1)throw _t=Au,xl(mt,0),Fo(mt,Tt),Us(mt,gs()),_t;if(gt===6)Fo(mt,Tt);else{if(At=mt.current.alternate,(30&Tt)==0&&!function(Zt){for(var rr=Zt;;){if(16384&rr.flags){var ir=rr.updateQueue;if(ir!==null&&(ir=ir.stores)!==null)for(var cr=0;cr<ir.length;cr++){var wr=ir[cr],ar=wr.getSnapshot;wr=wr.value;try{if(!Kn(ar(),wr))return!1}catch{return!1}}}if(ir=rr.child,16384&rr.subtreeFlags&&ir!==null)ir.return=rr,rr=ir;else{if(rr===Zt)break;for(;rr.sibling===null;){if(rr.return===null||rr.return===Zt)return!0;rr=rr.return}rr.sibling.return=rr.return,rr=rr.sibling}}return!0}(At)&&((gt=_1(mt,Tt))===2&&(Dt=z1(mt))!==0&&(Tt=Dt,gt=B0(mt,Dt)),gt===1))throw _t=Au,xl(mt,0),Fo(mt,Tt),Us(mt,gs()),_t;switch(mt.finishedWork=At,mt.finishedLanes=Tt,gt){case 0:case 1:throw Error(ot(345));case 2:case 5:Wl(mt,Qs,Do);break;case 3:if(Fo(mt,Tt),(130023424&Tt)===Tt&&10<(gt=k0+500-gs())){if(Uu(mt,0)!==0)break;if(((At=mt.suspendedLanes)&Tt)!==Tt){Ps(),mt.pingedLanes|=mt.suspendedLanes&At;break}mt.timeoutHandle=mr(Wl.bind(null,mt,Qs,Do),gt);break}Wl(mt,Qs,Do);break;case 4:if(Fo(mt,Tt),(4194240&Tt)===Tt)break;for(gt=mt.eventTimes,At=-1;0<Tt;){var Wt=31-Yn(Tt);Dt=1<<Wt,(Wt=gt[Wt])>At&&(At=Wt),Tt&=~Dt}if(Tt=At,10<(Tt=(120>(Tt=gs()-Tt)?120:480>Tt?480:1080>Tt?1080:1920>Tt?1920:3e3>Tt?3e3:4320>Tt?4320:1960*Wm(Tt/1960))-Tt)){mt.timeoutHandle=mr(Wl.bind(null,mt,Qs,Do),Tt);break}Wl(mt,Qs,Do);break;default:throw Error(ot(329))}}}return Us(mt,gs()),mt.callbackNode===_t?Ip.bind(null,mt):null}function B0(mt,gt){var _t=Pu;return mt.current.memoizedState.isDehydrated&&(xl(mt,gt).flags|=256),(mt=_1(mt,gt))!==2&&(gt=Qs,Qs=_t,gt!==null&&z0(gt)),mt}function z0(mt){Qs===null?Qs=mt:Qs.push.apply(Qs,mt)}function Fo(mt,gt){for(gt&=~D0,gt&=~v1,mt.suspendedLanes|=gt,mt.pingedLanes&=~gt,mt=mt.expirationTimes;0<gt;){var _t=31-Yn(gt),Tt=1<<_t;mt[_t]=-1,gt&=~Tt}}function Mp(mt){if(6&Vr)throw Error(ot(327));yl();var gt=Uu(mt,0);if(!(1>))return Us(mt,gs()),null;var _t=_1(mt,gt);if(mt.tag!==0&&_t===2){var Tt=z1(mt);Tt!==0&&(gt=Tt,_t=B0(mt,Tt))}if(_t===1)throw _t=Au,xl(mt,0),Fo(mt,gt),Us(mt,gs()),_t;if(_t===6)throw Error(ot(345));return mt.finishedWork=mt.current.alternate,mt.finishedLanes=gt,Wl(mt,Qs,Do),Us(mt,gs()),null}function $p(mt){Lo!==null&&Lo.tag===0&&!(6&Vr)&&yl();var gt=Vr;Vr|=1;var _t=cs.transition,Tt=qr;try{if(cs.transition=null,qr=1,mt)return mt()}finally{qr=Tt,cs.transition=_t,!(6&(Vr=gt))&&oo()}}function U0(){Ks=Vl.current,rs(Vl)}function xl(mt,gt){mt.finishedWork=null,mt.finishedLanes=0;var _t=mt.timeoutHandle;if(_t!==or&&(mt.timeoutHandle=or,yr(_t)),ds!==null)for(_t=ds.return;_t!==null;){var Tt=_t;switch(X1(Tt),Tt.tag){case 1:(Tt=Tt.type.childContextTypes)!=null&&N1();break;case 3:zl(),rs(Fs),rs(Ts),u0();break;case 5:a0(Tt);break;case 4:zl();break;case 13:case 19:rs(ls);break;case 10:e0(Tt.type._context);break;case 22:case 23:U0()}_t=_t.return}if(ys=mt,ds=mt=Bo(mt.current,null),Ss=Ks=gt,fs=0,Au=null,D0=v1=$a=0,Qs=Pu=null,ba!==null){for(gt=0;gt<ba.length;gt++)if((Tt=(_t=ba[gt]).interleaved)!==null){_t.interleaved=null;var At=Tt.next,Dt=_t.pending;if(Dt!==null){var Wt=Dt.next;Dt.next=At,Tt.next=Wt}_t.pending=Tt}ba=null}return mt}function Op(mt,gt){for(;;){var _t=ds;try{if(J1(),t1.current=i1,r1){for(var Tt=as.memoizedState;Tt!==null;){var At=Tt.queue;At!==null&&(At.pending=null),Tt=Tt.next}r1=!1}if(_a=0,vs=xs=as=null,yu=!1,Eu=0,O0.current=null,_t===null||_t.return===null){fs=1,Au=gt,ds=null;break}e:{var Dt=mt,Wt=_t.return,Zt=_t,rr=gt;if(gt=Ss,Zt.flags|=32768,rr!==null&&typeof rr=="object"&&typeof rr.then=="function"){var ir=rr,cr=Zt,wr=cr.tag;if(!(1&cr.mode)&&(wr===0||wr===11||wr===15)){var ar=cr.alternate;ar?(cr.updateQueue=ar.updateQueue,cr.memoizedState=ar.memoizedState,cr.lanes=ar.lanes):(cr.updateQueue=null,cr.memoizedState=null)}var Er=sp(Wt);if(Er!==null){Er.flags&=-257,np(Er,Wt,Zt,0,gt),1&Er.mode&&rp(Dt,ir,gt),rr=ir;var Cr=(gt=Er).updateQueue;if(Cr===null){var Nr=new Set;Nr.add(rr),gt.updateQueue=Nr}else Cr.add(rr);break e}if(!(1>)){rp(Dt,ir,gt),H0();break e}rr=Error(ot(426))}else if(ss&&1&Zt.mode){var dr=sp(Wt);if(dr!==null){!(65536&dr.flags)&&(dr.flags|=256),np(dr,Wt,Zt,0,gt),Q1(Ul(rr,Zt));break e}}Dt=rr=Ul(rr,Zt),fs!==4&&(fs=2),Pu===null?Pu=[Dt]:Pu.push(Dt),Dt=Wt;do{switch(Dt.tag){case 3:Dt.flags|=65536,gt&=-gt,Dt.lanes|=gt,_2(Dt,ep(0,rr,gt));break e;case 1:Zt=rr;var Jt=Dt.type,nr=Dt.stateNode;if(!(128&Dt.flags)&&(typeof Jt.getDerivedStateFromError=="function"||nr!==null&&typeof nr.componentDidCatch=="function"&&(ko===null||!ko.has(nr)))){Dt.flags|=65536,gt&=-gt,Dt.lanes|=gt,_2(Dt,tp(Dt,Zt,gt));break e}}Dt=Dt.return}while(Dt!==null)}Lp(_t)}catch(xr){gt=xr,ds===_t&&_t!==null&&(ds=_t=_t.return);continue}break}}function Dp(){var mt=x1.current;return x1.current=i1,mt===null?i1:mt}function H0(){fs!==0&&fs!==3&&fs!==2||(fs=4),ys===null||!(268435455&$a)&&!(268435455&v1)||Fo(ys,Ss)}function _1(mt,gt){var _t=Vr;Vr|=2;var Tt=Dp();for(ys===mt&&Ss===gt||(Do=null,xl(mt,gt));;)try{qm();break}catch(At){Op(mt,At)}if(J1(),Vr=_t,x1.current=Tt,ds!==null)throw Error(ot(261));return ys=null,Ss=0,fs}function qm(){for(;ds!==null;)kp(ds)}function Xm(){for(;ds!==null&&!Cm();)kp(ds)}function kp(mt){var gt=jp(mt.alternate,mt,Ks);mt.memoizedProps=mt.pendingProps,gt===null?Lp(mt):ds=gt,O0.current=null}function Lp(mt){var gt=mt;do{var _t=gt.alternate;if(mt=gt.return,(32768>.flags)==0){if((_t=Um(_t,gt,Ks))!==null)return void(ds=_t)}else{if((_t=Hm(_t,gt))!==null)return _t.flags&=32767,void(ds=_t);if(mt===null)return fs=6,void(ds=null);mt.flags|=32768,mt.subtreeFlags=0,mt.deletions=null}if((gt=gt.sibling)!==null)return void(ds=gt);ds=gt=mt}while(gt!==null);fs===0&&(fs=5)}function Wl(mt,gt,_t){var Tt=qr,At=cs.transition;try{cs.transition=null,qr=1,function(Dt,Wt,Zt,rr){do yl();while(Lo!==null);if(6&Vr)throw Error(ot(327));Zt=Dt.finishedWork;var ir=Dt.finishedLanes;if(Zt===null)return null;if(Dt.finishedWork=null,Dt.finishedLanes=0,Zt===Dt.current)throw Error(ot(177));Dt.callbackNode=null,Dt.callbackPriority=0;var cr=Zt.lanes|Zt.childLanes;if(function(Er,Cr){var Nr=Er.pendingLanes&~Cr;Er.pendingLanes=Cr,Er.suspendedLanes=0,Er.pingedLanes=0,Er.expiredLanes&=Cr,Er.mutableReadLanes&=Cr,Er.entangledLanes&=Cr,Cr=Er.entanglements;var dr=Er.eventTimes;for(Er=Er.expirationTimes;0<Nr;){var Jt=31-Yn(Nr),nr=1<<Jt;Cr[Jt]=0,dr[Jt]=-1,Er[Jt]=-1,Nr&=~nr}}(Dt,cr),Dt===ys&&(ds=ys=null,Ss=0),!(2064&Zt.subtreeFlags)&&!(2064&Zt.flags)||E1||(E1=!0,Bp(p2,function(){return yl(),null})),cr=(15990&Zt.flags)!=0,(15990&Zt.subtreeFlags)!=0||cr){cr=cs.transition,cs.transition=null;var wr=qr;qr=1;var ar=Vr;Vr|=4,O0.current=null,function(Er,Cr){for(Vt(Er.containerInfo),Rr=Cr;Rr!==null;)if(Cr=(Er=Rr).child,(1028&Er.subtreeFlags)!=0&&Cr!==null)Cr.return=Er,Rr=Cr;else for(;Rr!==null;){Er=Rr;try{var Nr=Er.alternate;if(1024&Er.flags)switch(Er.tag){case 0:case 11:case 15:case 5:case 6:case 4:case 17:break;case 1:if(Nr!==null){var dr=Nr.memoizedProps,Jt=Nr.memoizedState,nr=Er.stateNode,xr=nr.getSnapshotBeforeUpdate(Er.elementType===Er.type?dr:Zn(Er.type,dr),Jt);nr.__reactInternalSnapshotBeforeUpdate=xr}break;case 3:pr&&ms(Er.stateNode.containerInfo);break;default:throw Error(ot(163))}}catch(Mr){ns(Er,Er.return,Mr)}if((Cr=Er.sibling)!==null){Cr.return=Er.return,Rr=Cr;break}Rr=Er.return}Nr=yp,yp=!1}(Dt,Zt),_p(Zt,Dt),Bt(Dt.containerInfo),Dt.current=Zt,Gm(Zt),Am(),Vr=ar,qr=wr,cs.transition=cr}else Dt.current=Zt;if(E1&&(E1=!1,Lo=Dt,b1=ir),cr=Dt.pendingLanes,cr===0&&(ko=null),function(Er){if(io&&typeof io.onCommitFiberRoot=="function")try{io.onCommitFiberRoot(Hu,Er,void 0,(128&Er.current.flags)==128)}catch{}}(Zt.stateNode),Us(Dt,gs()),Wt!==null)for(rr=Dt.onRecoverableError,Zt=0;Zt<Wt.length;Zt++)ir=Wt[Zt],rr(ir.value,{componentStack:ir.stack,digest:ir.digest});if(y1)throw y1=!1,Dt=N0,N0=null,Dt;1&b1&&Dt.tag!==0&&yl(),cr=Dt.pendingLanes,1&cr?Dt===F0?ju++:(ju=0,F0=Dt):ju=0,oo()}(mt,gt,_t,Tt)}finally{cs.transition=At,qr=Tt}return null}function yl(){if(Lo!==null){var mt=h2(b1),gt=cs.transition,_t=qr;try{if(cs.transition=null,qr=16>mt?16:mt,Lo===null)var Tt=!1;else{if(mt=Lo,Lo=null,b1=0,(6&Vr)!=0)throw Error(ot(331));var At=Vr;for(Vr|=4,Rr=mt.current;Rr!==null;){var Dt=Rr,Wt=Dt.child;if(16&Rr.flags){var Zt=Dt.deletions;if(Zt!==null){for(var rr=0;rr<Zt.length;rr++){var ir=Zt[rr];for(Rr=ir;Rr!==null;){var cr=Rr;switch(cr.tag){case 0:case 11:case 15:Tu(8,cr,Dt)}var wr=cr.child;if(wr!==null)wr.return=cr,Rr=wr;else for(;Rr!==null;){var ar=(cr=Rr).sibling,Er=cr.return;if(Ep(cr),cr===ir){Rr=null;break}if(ar!==null){ar.return=Er,Rr=ar;break}Rr=Er}}}var Cr=Dt.alternate;if(Cr!==null){var Nr=Cr.child;if(Nr!==null){Cr.child=null;do{var dr=Nr.sibling;Nr.sibling=null,Nr=dr}while(Nr!==null)}}Rr=Dt}}if(2064&Dt.subtreeFlags&&Wt!==null)Wt.return=Dt,Rr=Wt;else e:for(;Rr!==null;){if(2048&(Dt=Rr).flags)switch(Dt.tag){case 0:case 11:case 15:Tu(9,Dt,Dt.return)}var Jt=Dt.sibling;if(Jt!==null){Jt.return=Dt.return,Rr=Jt;break e}Rr=Dt.return}}var nr=mt.current;for(Rr=nr;Rr!==null;){var xr=(Wt=Rr).child;if(2064&Wt.subtreeFlags&&xr!==null)xr.return=Wt,Rr=xr;else e:for(Wt=nr;Rr!==null;){if(2048&(Zt=Rr).flags)try{switch(Zt.tag){case 0:case 11:case 15:d1(9,Zt)}}catch(Yr){ns(Zt,Zt.return,Yr)}if(Zt===Wt){Rr=null;break e}var Mr=Zt.sibling;if(Mr!==null){Mr.return=Zt.return,Rr=Mr;break e}Rr=Zt.return}}if(Vr=At,oo(),io&&typeof io.onPostCommitFiberRoot=="function")try{io.onPostCommitFiberRoot(Hu,mt)}catch{}Tt=!0}return Tt}finally{qr=_t,cs.transition=gt}}return!1}function Np(mt,gt,_t){mt=Oo(mt,gt=ep(0,gt=Ul(_t,gt),1),1),gt=Ps(),mt!==null&&(pu(mt,1,gt),Us(mt,gt))}function ns(mt,gt,_t){if(mt.tag===3)Np(mt,mt,_t);else for(;gt!==null;){if(gt.tag===3){Np(gt,mt,_t);break}if(gt.tag===1){var Tt=gt.stateNode;if(typeof gt.type.getDerivedStateFromError=="function"||typeof Tt.componentDidCatch=="function"&&(ko===null||!ko.has(Tt))){gt=Oo(gt,mt=tp(gt,mt=Ul(_t,mt),1),1),mt=Ps(),gt!==null&&(pu(gt,1,mt),Us(gt,mt));break}}gt=gt.return}}function Ym(mt,gt,_t){var Tt=mt.pingCache;Tt!==null&&Tt.delete(gt),gt=Ps(),mt.pingedLanes|=mt.suspendedLanes&_t,ys===mt&&(Ss&_t)===_t&&(fs===4||fs===3&&(130023424&Ss)===Ss&&500>gs()-k0?xl(mt,0):D0|=_t),Us(mt,gt)}function Fp(mt,gt){gt===0&&(1&mt.mode?(gt=B1,!(130023424&(B1<<=1))&&(B1=4194304)):gt=1);var _t=Ps();(mt=lo(mt,gt))!==null&&(pu(mt,gt,_t),Us(mt,_t))}function Km(mt){var gt=mt.memoizedState,_t=0;gt!==null&&(_t=gt.retryLane),Fp(mt,_t)}function Qm(mt,gt){var _t=0;switch(mt.tag){case 13:var Tt=mt.stateNode,At=mt.memoizedState;At!==null&&(_t=At.retryLane);break;case 19:Tt=mt.stateNode;break;default:throw Error(ot(314))}Tt!==null&&Tt.delete(gt),Fp(mt,_t)}function Bp(mt,gt){return V1(mt,gt)}function Zm(mt,gt,_t,Tt){this.tag=mt,this.key=_t,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=gt,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=Tt,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wn(mt,gt,_t,Tt){return new Zm(mt,gt,_t,Tt)}function V0(mt){return!(!(mt=mt.prototype)||!mt.isReactComponent)}function Bo(mt,gt){var _t=mt.alternate;return _t===null?((_t=Wn(mt.tag,gt,mt.key,mt.mode)).elementType=mt.elementType,_t.type=mt.type,_t.stateNode=mt.stateNode,_t.alternate=mt,mt.alternate=_t):(_t.pendingProps=gt,_t.type=mt.type,_t.flags=0,_t.subtreeFlags=0,_t.deletions=null),_t.flags=14680064&mt.flags,_t.childLanes=mt.childLanes,_t.lanes=mt.lanes,_t.child=mt.child,_t.memoizedProps=mt.memoizedProps,_t.memoizedState=mt.memoizedState,_t.updateQueue=mt.updateQueue,gt=mt.dependencies,_t.dependencies=gt===null?null:{lanes:gt.lanes,firstContext:gt.firstContext},_t.sibling=mt.sibling,_t.index=mt.index,_t.ref=mt.ref,_t}function R1(mt,gt,_t,Tt,At,Dt){var Wt=2;if(Tt=mt,typeof mt=="function")V0(mt)&&(Wt=1);else if(typeof mt=="string")Wt=5;else e:switch(mt){case ct:return El(_t.children,At,Dt,gt);case dt:Wt=8,At|=8;break;case ht:return(mt=Wn(12,_t,gt,2|At)).elementType=ht,mt.lanes=Dt,mt;case yt:return(mt=Wn(13,_t,gt,At)).elementType=yt,mt.lanes=Dt,mt;case Et:return(mt=Wn(19,_t,gt,At)).elementType=Et,mt.lanes=Dt,mt;case St:return T1(_t,At,Dt,gt);default:if(typeof mt=="object"&&mt!==null)switch(mt.$$typeof){case ft:Wt=10;break e;case xt:Wt=9;break e;case vt:Wt=11;break e;case bt:Wt=14;break e;case wt:Wt=16,Tt=null;break e}throw Error(ot(130,mt==null?mt:typeof mt,""))}return(gt=Wn(Wt,_t,gt,At)).elementType=mt,gt.type=Tt,gt.lanes=Dt,gt}function El(mt,gt,_t,Tt){return(mt=Wn(7,mt,Tt,gt)).lanes=_t,mt}function T1(mt,gt,_t,Tt){return(mt=Wn(22,mt,Tt,gt)).elementType=St,mt.lanes=_t,mt.stateNode={isHidden:!1},mt}function G0(mt,gt,_t){return(mt=Wn(6,mt,null,gt)).lanes=_t,mt}function W0(mt,gt,_t){return(gt=Wn(4,mt.children!==null?mt.children:[],mt.key,gt)).lanes=_t,gt.stateNode={containerInfo:mt.containerInfo,pendingChildren:null,implementation:mt.implementation},gt}function Jm(mt,gt,_t,Tt,At){this.tag=gt,this.containerInfo=mt,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=or,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=U1(0),this.expirationTimes=U1(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=U1(0),this.identifierPrefix=Tt,this.onRecoverableError=At,Ar&&(this.mutableSourceEagerHydrationData=null)}function zp(mt,gt,_t,Tt,At,Dt,Wt,Zt,rr){return mt=new Jm(mt,gt,_t,Zt,rr),gt===1?(gt=1,Dt===!0&&(gt|=8)):gt=0,Dt=Wn(3,null,null,gt),mt.current=Dt,Dt.stateNode=mt,Dt.memoizedState={element:Tt,isDehydrated:_t,cache:null,transitions:null,pendingSuspenseBoundaries:null},s0(Dt),mt}function Up(mt){if(!mt)return Mo;e:{if(Pt(mt=mt._reactInternals)!==mt||mt.tag!==1)throw Error(ot(170));var gt=mt;do{switch(gt.tag){case 3:gt=gt.stateNode.context;break e;case 1:if(Xs(gt.type)){gt=gt.stateNode.__reactInternalMemoizedMergedChildContext;break e}}gt=gt.return}while(gt!==null);throw Error(ot(171))}if(mt.tag===1){var _t=mt.type;if(Xs(_t))return u2(mt,_t,gt)}return gt}function Hp(mt){var gt=mt._reactInternals;if(gt===void 0)throw typeof mt.render=="function"?Error(ot(188)):(mt=Object.keys(mt).join(","),Error(ot(268,mt)));return(mt=Nt(gt))===null?null:mt.stateNode}function Vp(mt,gt){if((mt=mt.memoizedState)!==null&&mt.dehydrated!==null){var _t=mt.retryLane;mt.retryLane=_t!==0&&_t<gt?_t:gt}}function C1(mt,gt){Vp(mt,gt),(mt=mt.alternate)&&Vp(mt,gt)}function e3(mt){return(mt=Nt(mt))===null?null:mt.stateNode}function t3(){return null}return jp=function(mt,gt,_t){if(mt!==null)if(mt.memoizedProps!==gt.pendingProps||Fs.current)Bs=!0;else{if(!(mt.lanes&_t)&&!(128>.flags))return Bs=!1,function(wr,ar,Er){switch(ar.tag){case 3:dp(ar),Dl();break;case 5:$2(ar);break;case 1:Xs(ar.type)&&zu(ar);break;case 4:o0(ar,ar.stateNode.containerInfo);break;case 10:b2(0,ar.type._context,ar.memoizedProps.value);break;case 13:var Cr=ar.memoizedState;if(Cr!==null)return Cr.dehydrated!==null?(Jr(ls,1&ls.current),ar.flags|=128,null):Er&ar.child.childLanes?fp(wr,ar,Er):(Jr(ls,1&ls.current),(wr=To(wr,ar,Er))!==null?wr.sibling:null);Jr(ls,1&ls.current);break;case 19:if(Cr=(Er&ar.childLanes)!=0,(128&wr.flags)!=0){if(Cr)return mp(wr,ar,Er);ar.flags|=128}var Nr=ar.memoizedState;if(Nr!==null&&(Nr.rendering=null,Nr.tail=null,Nr.lastEffect=null),Jr(ls,ls.current),Cr)break;return null;case 22:case 23:return ar.lanes=0,lp(wr,ar,Er)}return To(wr,ar,Er)}(mt,gt,_t);Bs=(131072&mt.flags)!=0}else Bs=!1,ss&&1048576>.flags&&g2(gt,Wu,gt.index);switch(gt.lanes=0,gt.tag){case 2:var Tt=gt.type;u1(mt,gt),mt=gt.pendingProps;var At=Ml(gt,Ts.current);Nl(gt,_t),At=h0(null,gt,Tt,mt,At,_t);var Dt=f0();return gt.flags|=1,typeof At=="object"&&At!==null&&typeof At.render=="function"&&At.$$typeof===void 0?(gt.tag=1,gt.memoizedState=null,gt.updateQueue=null,Xs(Tt)?(Dt=!0,zu(gt)):Dt=!1,gt.memoizedState=At.state!==null&&At.state!==void 0?At.state:null,s0(gt),At.updater=Ju,gt.stateNode=At,At._reactInternals=gt,i0(gt,Tt,mt,_t),gt=b0(null,gt,Tt,!0,Dt,_t)):(gt.tag=0,ss&&Dt&&q1(gt),zs(null,gt,At,_t),gt=gt.child),gt;case 16:Tt=gt.elementType;e:{switch(u1(mt,gt),mt=gt.pendingProps,Tt=(At=Tt._init)(Tt._payload),gt.type=Tt,At=gt.tag=function(wr){if(typeof wr=="function")return V0(wr)?1:0;if(wr!=null){if((wr=wr.$$typeof)===vt)return 11;if(wr===bt)return 14}return 2}(Tt),mt=Zn(Tt,mt),At){case 0:gt=E0(null,gt,Tt,mt,_t);break e;case 1:gt=cp(null,gt,Tt,mt,_t);break e;case 11:gt=ip(null,gt,Tt,mt,_t);break e;case 14:gt=op(null,gt,Tt,Zn(Tt.type,mt),_t);break e}throw Error(ot(306,Tt,""))}return gt;case 0:return Tt=gt.type,At=gt.pendingProps,E0(mt,gt,Tt,At=gt.elementType===Tt?At:Zn(Tt,At),_t);case 1:return Tt=gt.type,At=gt.pendingProps,cp(mt,gt,Tt,At=gt.elementType===Tt?At:Zn(Tt,At),_t);case 3:e:{if(dp(gt),mt===null)throw Error(ot(387));Tt=gt.pendingProps,At=(Dt=gt.memoizedState).element,S2(mt,gt),Zu(gt,Tt,null,_t);var Wt=gt.memoizedState;if(Tt=Wt.element,Ar&&Dt.isDehydrated){if(Dt={element:Tt,isDehydrated:!1,cache:Wt.cache,pendingSuspenseBoundaries:Wt.pendingSuspenseBoundaries,transitions:Wt.transitions},gt.updateQueue.baseState=Dt,gt.memoizedState=Dt,256>.flags){gt=hp(mt,gt,Tt,_t,At=Ul(Error(ot(423)),gt));break e}if(Tt!==At){gt=hp(mt,gt,Tt,_t,At=Ul(Error(ot(424)),gt));break e}for(Ar&&(Bn=cm(gt.stateNode.containerInfo),Ys=gt,ss=!0,Qn=null,mu=!1),_t=M2(gt,null,Tt,_t),gt.child=_t;_t;)_t.flags=-3&_t.flags|4096,_t=_t.sibling}else{if(Dl(),Tt===At){gt=To(mt,gt,_t);break e}zs(mt,gt,Tt,_t)}gt=gt.child}return gt;case 5:return $2(gt),mt===null&&K1(gt),Tt=gt.type,At=gt.pendingProps,Dt=mt!==null?mt.memoizedProps:null,Wt=At.children,lr(Tt,At)?Wt=null:Dt!==null&&lr(Tt,Dt)&&(gt.flags|=32),up(mt,gt),zs(mt,gt,Wt,_t),gt.child;case 6:return mt===null&&K1(gt),null;case 13:return fp(mt,gt,_t);case 4:return o0(gt,gt.stateNode.containerInfo),Tt=gt.pendingProps,mt===null?gt.child=Fl(gt,null,Tt,_t):zs(mt,gt,Tt,_t),gt.child;case 11:return Tt=gt.type,At=gt.pendingProps,ip(mt,gt,Tt,At=gt.elementType===Tt?At:Zn(Tt,At),_t);case 7:return zs(mt,gt,gt.pendingProps,_t),gt.child;case 8:case 12:return zs(mt,gt,gt.pendingProps.children,_t),gt.child;case 10:e:{if(Tt=gt.type._context,At=gt.pendingProps,Dt=gt.memoizedProps,b2(0,Tt,Wt=At.value),Dt!==null)if(Kn(Dt.value,Wt)){if(Dt.children===At.children&&!Fs.current){gt=To(mt,gt,_t);break e}}else for((Dt=gt.child)!==null&&(Dt.return=gt);Dt!==null;){var Zt=Dt.dependencies;if(Zt!==null){Wt=Dt.child;for(var rr=Zt.firstContext;rr!==null;){if(rr.context===Tt){if(Dt.tag===1){(rr=Ro(-1,_t&-_t)).tag=2;var ir=Dt.updateQueue;if(ir!==null){var cr=(ir=ir.shared).pending;cr===null?rr.next=rr:(rr.next=cr.next,cr.next=rr),ir.pending=rr}}Dt.lanes|=_t,(rr=Dt.alternate)!==null&&(rr.lanes|=_t),t0(Dt.return,_t,gt),Zt.lanes|=_t;break}rr=rr.next}}else if(Dt.tag===10)Wt=Dt.type===gt.type?null:Dt.child;else if(Dt.tag===18){if((Wt=Dt.return)===null)throw Error(ot(341));Wt.lanes|=_t,(Zt=Wt.alternate)!==null&&(Zt.lanes|=_t),t0(Wt,_t,gt),Wt=Dt.sibling}else Wt=Dt.child;if(Wt!==null)Wt.return=Dt;else for(Wt=Dt;Wt!==null;){if(Wt===gt){Wt=null;break}if((Dt=Wt.sibling)!==null){Dt.return=Wt.return,Wt=Dt;break}Wt=Wt.return}Dt=Wt}zs(mt,gt,At.children,_t),gt=gt.child}return gt;case 9:return At=gt.type,Tt=gt.pendingProps.children,Nl(gt,_t),Tt=Tt(At=Un(At)),gt.flags|=1,zs(mt,gt,Tt,_t),gt.child;case 14:return At=Zn(Tt=gt.type,gt.pendingProps),op(mt,gt,Tt,At=Zn(Tt.type,At),_t);case 15:return ap(mt,gt,gt.type,gt.pendingProps,_t);case 17:return Tt=gt.type,At=gt.pendingProps,At=gt.elementType===Tt?At:Zn(Tt,At),u1(mt,gt),gt.tag=1,Xs(Tt)?(mt=!0,zu(gt)):mt=!1,Nl(gt,_t),A2(gt,Tt,At),i0(gt,Tt,At,_t),b0(null,gt,Tt,!0,mt,_t);case 19:return mp(mt,gt,_t);case 22:return lp(mt,gt,_t)}throw Error(ot(156,gt.tag))},et.attemptContinuousHydration=function(mt){if(mt.tag===13){var gt=lo(mt,134217728);gt!==null&&Gn(gt,mt,134217728,Ps()),C1(mt,134217728)}},et.attemptDiscreteHydration=function(mt){if(mt.tag===13){var gt=lo(mt,1);gt!==null&&Gn(gt,mt,1,Ps()),C1(mt,1)}},et.attemptHydrationAtCurrentPriority=function(mt){if(mt.tag===13){var gt=No(mt),_t=lo(mt,gt);_t!==null&&Gn(_t,mt,gt,Ps()),C1(mt,gt)}},et.attemptSynchronousHydration=function(mt){switch(mt.tag){case 3:var gt=mt.stateNode;if(gt.current.memoizedState.isDehydrated){var _t=fu(gt.pendingLanes);_t!==0&&(H1(gt,1|_t),Us(gt,gs()),!(6&Vr)&&(Gl(),oo()))}break;case 13:$p(function(){var Tt=lo(mt,1);if(Tt!==null){var At=Ps();Gn(Tt,mt,1,At)}}),C1(mt,1)}},et.batchedUpdates=function(mt,gt){var _t=Vr;Vr|=1;try{return mt(gt)}finally{(Vr=_t)===0&&(Gl(),Vu&&oo())}},et.createComponentSelector=function(mt){return{$$typeof:h1,value:mt}},et.createContainer=function(mt,gt,_t,Tt,At,Dt,Wt){return zp(mt,gt,!1,null,0,Tt,0,Dt,Wt)},et.createHasPseudoClassSelector=function(mt){return{$$typeof:f1,value:mt}},et.createHydrationContainer=function(mt,gt,_t,Tt,At,Dt,Wt,Zt,rr){return(mt=zp(_t,Tt,!0,mt,0,Dt,0,Zt,rr)).context=Up(null),_t=mt.current,(Dt=Ro(Tt=Ps(),At=No(_t))).callback=gt??null,Oo(_t,Dt,At),mt.current.lanes=At,pu(mt,At,Tt),Us(mt,Tt),mt},et.createPortal=function(mt,gt,_t){var Tt=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:ut,key:Tt==null?null:""+Tt,children:mt,containerInfo:gt,implementation:_t}},et.createRoleSelector=function(mt){return{$$typeof:p1,value:mt}},et.createTestNameSelector=function(mt){return{$$typeof:m1,value:mt}},et.createTextSelector=function(mt){return{$$typeof:g1,value:mt}},et.deferredUpdates=function(mt){var gt=qr,_t=cs.transition;try{return cs.transition=null,qr=16,mt()}finally{qr=gt,cs.transition=_t}},et.discreteUpdates=function(mt,gt,_t,Tt,At){var Dt=qr,Wt=cs.transition;try{return cs.transition=null,qr=1,mt(gt,_t,Tt,At)}finally{qr=Dt,cs.transition=Wt,Vr===0&&Gl()}},et.findAllNodes=$0,et.findBoundingRects=function(mt,gt){if(!Xt)throw Error(ot(363));gt=$0(mt,gt),mt=[];for(var _t=0;_t<gt.length;_t++)mt.push(sr(gt[_t]));for(gt=mt.length-1;0<gt;gt--)for(var Tt=(_t=mt[gt]).x,At=Tt+_t.width,Dt=_t.y,Wt=Dt+_t.height,Zt=gt-1;0<=Zt;Zt--)if(gt!==Zt){var rr=mt[Zt],ir=rr.x,cr=ir+rr.width,wr=rr.y,ar=wr+rr.height;if(Tt>=ir&&Dt>=wr&&At<=cr&&Wt<=ar){mt.splice(gt,1);break}if(!(Tt!==ir||_t.width!==rr.width||ar<Dt||wr>Wt)){wr>Dt&&(rr.height+=wr-Dt,rr.y=Dt),ar<Wt&&(rr.height=Wt-wr),mt.splice(gt,1);break}if(!(Dt!==wr||_t.height!==rr.height||cr<Tt||ir>At)){ir>Tt&&(rr.width+=ir-Tt,rr.x=Tt),cr<At&&(rr.width=At-ir),mt.splice(gt,1);break}}return mt},et.findHostInstance=Hp,et.findHostInstanceWithNoPortals=function(mt){return(mt=(mt=Ut(mt))!==null?Lt(mt):null)===null?null:mt.stateNode},et.findHostInstanceWithWarning=function(mt){return Hp(mt)},et.flushControlled=function(mt){var gt=Vr;Vr|=1;var _t=cs.transition,Tt=qr;try{cs.transition=null,qr=1,mt()}finally{qr=Tt,cs.transition=_t,(Vr=gt)===0&&(Gl(),oo())}},et.flushPassiveEffects=yl,et.flushSync=$p,et.focusWithin=function(mt,gt){if(!Xt)throw Error(ot(363));for(gt=Pp(mt=j0(mt),gt),gt=Array.from(gt),mt=0;mt<gt.length;){var _t=gt[mt++];if(!gr(_t)){if(_t.tag===5&&Tr(_t.stateNode))return!0;for(_t=_t.child;_t!==null;)gt.push(_t),_t=_t.sibling}}return!1},et.getCurrentUpdatePriority=function(){return qr},et.getFindAllNodesFailureDescription=function(mt,gt){if(!Xt)throw Error(ot(363));var _t=0,Tt=[];mt=[j0(mt),0];for(var At=0;At<mt.length;){var Dt=mt[At++],Wt=mt[At++],Zt=gt[Wt];if((Dt.tag!==5||!gr(Dt))&&(I0(Dt,Zt)&&(Tt.push(M0(Zt)),++Wt>_t&&(_t=Wt)),Wt<gt.length))for(Dt=Dt.child;Dt!==null;)mt.push(Dt,Wt),Dt=Dt.sibling}if(_t<gt.length){for(mt=[];_t<gt.length;_t++)mt.push(M0(gt[_t]));return`findAllNodes was able to match part of the selector:
|
|
1041
1041
|
`+Tt.join(" > ")+`
|
|
1042
1042
|
|
|
1043
1043
|
No matching component was found for:
|
|
@@ -1381,14 +1381,14 @@ void main()
|
|
|
1381
1381
|
|
|
1382
1382
|
gl_FragColor = color;
|
|
1383
1383
|
}
|
|
1384
|
-
`;class NoiseFilter extends Filter{constructor(et=.5,rt=Math.random()){super(defaultFilterVertex,fragment,{uNoise:0,uSeed:0}),this.noise=et,this.seed=rt}get noise(){return this.uniforms.uNoise}set noise(et){this.uniforms.uNoise=et}get seed(){return this.uniforms.uSeed}set seed(et){this.uniforms.uSeed=et}}const filters={AlphaFilter,BlurFilter,BlurFilterPass,ColorMatrixFilter,DisplacementFilter,FXAAFilter,NoiseFilter};Object.entries(filters).forEach(([tt,et])=>{Object.defineProperty(filters,tt,{get(){return deprecation("7.1.0",`filters.${tt} has moved to ${tt}`),et}})});class EventsTickerClass{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(et){this.removeTickerListener(),this.events=et,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(et){this._pauseUpdate=et}addTickerListener(){this.tickerAdded||!this.domElement||(Ticker.system.add(this.tickerUpdate,this,UPDATE_PRIORITY.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Ticker.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const et=this.events.rootPointerEvent;this.events.supportsTouchEvents&&et.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:et.clientX,clientY:et.clientY}))}tickerUpdate(et){this._deltaTime+=et,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}}const EventsTicker=new EventsTickerClass;class FederatedEvent{constructor(et){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=FederatedEvent.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Point,this.page=new Point,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=et}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(et,rt,st){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(et,rt,st,nt,ot){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class FederatedMouseEvent extends FederatedEvent{constructor(){super(...arguments),this.client=new Point,this.movement=new Point,this.offset=new Point,this.global=new Point,this.screen=new Point}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(et,rt,st){return et.worldTransform.applyInverse(st||this.global,rt)}getModifierState(et){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(et)}initMouseEvent(et,rt,st,nt,ot,at,lt,ut,ct,dt,ht,ft,xt,vt,yt){throw new Error("Method not implemented.")}}class FederatedPointerEvent extends FederatedMouseEvent{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class FederatedWheelEvent extends FederatedMouseEvent{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}FederatedWheelEvent.DOM_DELTA_PIXEL=0,FederatedWheelEvent.DOM_DELTA_LINE=1,FederatedWheelEvent.DOM_DELTA_PAGE=2;const PROPAGATION_LIMIT=2048,tempHitLocation=new Point,tempLocalMapping=new Point;class EventBoundary{constructor(et){this.dispatch=new EventEmitter,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=et,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(et,rt){this.mappingTable[et]||(this.mappingTable[et]=[]),this.mappingTable[et].push({fn:rt,priority:0}),this.mappingTable[et].sort((st,nt)=>st.priority-nt.priority)}dispatchEvent(et,rt){et.propagationStopped=!1,et.propagationImmediatelyStopped=!1,this.propagate(et,rt),this.dispatch.emit(rt||et.type,et)}mapEvent(et){if(!this.rootTarget)return;const rt=this.mappingTable[et.type];if(rt)for(let st=0,nt=rt.length;st<nt;st++)rt[st].fn(et);else console.warn(`[EventBoundary]: Event mapping not defined for ${et.type}`)}hitTest(et,rt){EventsTicker.pauseUpdate=!0;const st=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",nt=this[st](this.rootTarget,this.rootTarget.eventMode,tempHitLocation.set(et,rt),this.hitTestFn,this.hitPruneFn);return nt&&nt[0]}propagate(et,rt){if(!et.target)return;const st=et.composedPath();et.eventPhase=et.CAPTURING_PHASE;for(let nt=0,ot=st.length-1;nt<ot;nt++)if(et.currentTarget=st[nt],this.notifyTarget(et,rt),et.propagationStopped||et.propagationImmediatelyStopped)return;if(et.eventPhase=et.AT_TARGET,et.currentTarget=et.target,this.notifyTarget(et,rt),!(et.propagationStopped||et.propagationImmediatelyStopped)){et.eventPhase=et.BUBBLING_PHASE;for(let nt=st.length-2;nt>=0;nt--)if(et.currentTarget=st[nt],this.notifyTarget(et,rt),et.propagationStopped||et.propagationImmediatelyStopped)return}}all(et,rt,st=this._allInteractiveElements){if(st.length===0)return;et.eventPhase=et.BUBBLING_PHASE;const nt=Array.isArray(rt)?rt:[rt];for(let ot=st.length-1;ot>=0;ot--)nt.forEach(at=>{et.currentTarget=st[ot],this.notifyTarget(et,at)})}propagationPath(et){const rt=[et];for(let st=0;st<PROPAGATION_LIMIT&&et!==this.rootTarget;st++){if(!et.parent)throw new Error("Cannot find propagation path to disconnected target");rt.push(et.parent),et=et.parent}return rt.reverse(),rt}hitTestMoveRecursive(et,rt,st,nt,ot,at=!1){let lt=!1;if(this._interactivePrune(et))return null;if((et.eventMode==="dynamic"||rt==="dynamic")&&(EventsTicker.pauseUpdate=!1),et.interactiveChildren&&et.children){const dt=et.children;for(let ht=dt.length-1;ht>=0;ht--){const ft=dt[ht],xt=this.hitTestMoveRecursive(ft,this._isInteractive(rt)?rt:ft.eventMode,st,nt,ot,at||ot(et,st));if(xt){if(xt.length>0&&!xt[xt.length-1].parent)continue;const vt=et.isInteractive();(xt.length>0||vt)&&(vt&&this._allInteractiveElements.push(et),xt.push(et)),this._hitElements.length===0&&(this._hitElements=xt),lt=!0}}}const ut=this._isInteractive(rt),ct=et.isInteractive();return ut&&ct&&this._allInteractiveElements.push(et),at||this._hitElements.length>0?null:lt?this._hitElements:ut&&!ot(et,st)&&nt(et,st)?ct?[et]:[]:null}hitTestRecursive(et,rt,st,nt,ot){if(this._interactivePrune(et)||ot(et,st))return null;if((et.eventMode==="dynamic"||rt==="dynamic")&&(EventsTicker.pauseUpdate=!1),et.interactiveChildren&&et.children){const ut=et.children;for(let ct=ut.length-1;ct>=0;ct--){const dt=ut[ct],ht=this.hitTestRecursive(dt,this._isInteractive(rt)?rt:dt.eventMode,st,nt,ot);if(ht){if(ht.length>0&&!ht[ht.length-1].parent)continue;const ft=et.isInteractive();return(ht.length>0||ft)&&ht.push(et),ht}}}const at=this._isInteractive(rt),lt=et.isInteractive();return at&&nt(et,st)?lt?[et]:[]:null}_isInteractive(et){return et==="static"||et==="dynamic"}_interactivePrune(et){return!!(!et||et.isMask||!et.visible||!et.renderable||et.eventMode==="none"||et.eventMode==="passive"&&!et.interactiveChildren||et.isMask)}hitPruneFn(et,rt){var st;if(et.hitArea&&(et.worldTransform.applyInverse(rt,tempLocalMapping),!et.hitArea.contains(tempLocalMapping.x,tempLocalMapping.y)))return!0;if(et._mask){const nt=et._mask.isMaskData?et._mask.maskObject:et._mask;if(nt&&!((st=nt.containsPoint)!=null&&st.call(nt,rt)))return!0}return!1}hitTestFn(et,rt){return et.eventMode==="passive"?!1:et.hitArea?!0:et.containsPoint?et.containsPoint(rt):!1}notifyTarget(et,rt){var ot,at;rt=rt??et.type;const st=`on${rt}`;(at=(ot=et.currentTarget)[st])==null||at.call(ot,et);const nt=et.eventPhase===et.CAPTURING_PHASE||et.eventPhase===et.AT_TARGET?`${rt}capture`:rt;this.notifyListeners(et,nt),et.eventPhase===et.AT_TARGET&&this.notifyListeners(et,rt)}mapPointerDown(et){if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=this.createPointerEvent(et);if(this.dispatchEvent(rt,"pointerdown"),rt.pointerType==="touch")this.dispatchEvent(rt,"touchstart");else if(rt.pointerType==="mouse"||rt.pointerType==="pen"){const nt=rt.button===2;this.dispatchEvent(rt,nt?"rightdown":"mousedown")}const st=this.trackingData(et.pointerId);st.pressTargetsByButton[et.button]=rt.composedPath(),this.freeEvent(rt)}mapPointerMove(et){var ut,ct;if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const rt=this.createPointerEvent(et);this._isPointerMoveEvent=!1;const st=rt.pointerType==="mouse"||rt.pointerType==="pen",nt=this.trackingData(et.pointerId),ot=this.findMountedTarget(nt.overTargets);if(((ut=nt.overTargets)==null?void 0:ut.length)>0&&ot!==rt.target){const dt=et.type==="mousemove"?"mouseout":"pointerout",ht=this.createPointerEvent(et,dt,ot);if(this.dispatchEvent(ht,"pointerout"),st&&this.dispatchEvent(ht,"mouseout"),!rt.composedPath().includes(ot)){const ft=this.createPointerEvent(et,"pointerleave",ot);for(ft.eventPhase=ft.AT_TARGET;ft.target&&!rt.composedPath().includes(ft.target);)ft.currentTarget=ft.target,this.notifyTarget(ft),st&&this.notifyTarget(ft,"mouseleave"),ft.target=ft.target.parent;this.freeEvent(ft)}this.freeEvent(ht)}if(ot!==rt.target){const dt=et.type==="mousemove"?"mouseover":"pointerover",ht=this.clonePointerEvent(rt,dt);this.dispatchEvent(ht,"pointerover"),st&&this.dispatchEvent(ht,"mouseover");let ft=ot==null?void 0:ot.parent;for(;ft&&ft!==this.rootTarget.parent&&ft!==rt.target;)ft=ft.parent;if(!ft||ft===this.rootTarget.parent){const xt=this.clonePointerEvent(rt,"pointerenter");for(xt.eventPhase=xt.AT_TARGET;xt.target&&xt.target!==ot&&xt.target!==this.rootTarget.parent;)xt.currentTarget=xt.target,this.notifyTarget(xt),st&&this.notifyTarget(xt,"mouseenter"),xt.target=xt.target.parent;this.freeEvent(xt)}this.freeEvent(ht)}const at=[],lt=this.enableGlobalMoveEvents??!0;this.moveOnAll?at.push("pointermove"):this.dispatchEvent(rt,"pointermove"),lt&&at.push("globalpointermove"),rt.pointerType==="touch"&&(this.moveOnAll?at.splice(1,0,"touchmove"):this.dispatchEvent(rt,"touchmove"),lt&&at.push("globaltouchmove")),st&&(this.moveOnAll?at.splice(1,0,"mousemove"):this.dispatchEvent(rt,"mousemove"),lt&&at.push("globalmousemove"),this.cursor=(ct=rt.target)==null?void 0:ct.cursor),at.length>0&&this.all(rt,at),this._allInteractiveElements.length=0,this._hitElements.length=0,nt.overTargets=rt.composedPath(),this.freeEvent(rt)}mapPointerOver(et){var at;if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=this.trackingData(et.pointerId),st=this.createPointerEvent(et),nt=st.pointerType==="mouse"||st.pointerType==="pen";this.dispatchEvent(st,"pointerover"),nt&&this.dispatchEvent(st,"mouseover"),st.pointerType==="mouse"&&(this.cursor=(at=st.target)==null?void 0:at.cursor);const ot=this.clonePointerEvent(st,"pointerenter");for(ot.eventPhase=ot.AT_TARGET;ot.target&&ot.target!==this.rootTarget.parent;)ot.currentTarget=ot.target,this.notifyTarget(ot),nt&&this.notifyTarget(ot,"mouseenter"),ot.target=ot.target.parent;rt.overTargets=st.composedPath(),this.freeEvent(st),this.freeEvent(ot)}mapPointerOut(et){if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=this.trackingData(et.pointerId);if(rt.overTargets){const st=et.pointerType==="mouse"||et.pointerType==="pen",nt=this.findMountedTarget(rt.overTargets),ot=this.createPointerEvent(et,"pointerout",nt);this.dispatchEvent(ot),st&&this.dispatchEvent(ot,"mouseout");const at=this.createPointerEvent(et,"pointerleave",nt);for(at.eventPhase=at.AT_TARGET;at.target&&at.target!==this.rootTarget.parent;)at.currentTarget=at.target,this.notifyTarget(at),st&&this.notifyTarget(at,"mouseleave"),at.target=at.target.parent;rt.overTargets=null,this.freeEvent(ot),this.freeEvent(at)}this.cursor=null}mapPointerUp(et){if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=performance.now(),st=this.createPointerEvent(et);if(this.dispatchEvent(st,"pointerup"),st.pointerType==="touch")this.dispatchEvent(st,"touchend");else if(st.pointerType==="mouse"||st.pointerType==="pen"){const lt=st.button===2;this.dispatchEvent(st,lt?"rightup":"mouseup")}const nt=this.trackingData(et.pointerId),ot=this.findMountedTarget(nt.pressTargetsByButton[et.button]);let at=ot;if(ot&&!st.composedPath().includes(ot)){let lt=ot;for(;lt&&!st.composedPath().includes(lt);){if(st.currentTarget=lt,this.notifyTarget(st,"pointerupoutside"),st.pointerType==="touch")this.notifyTarget(st,"touchendoutside");else if(st.pointerType==="mouse"||st.pointerType==="pen"){const ut=st.button===2;this.notifyTarget(st,ut?"rightupoutside":"mouseupoutside")}lt=lt.parent}delete nt.pressTargetsByButton[et.button],at=lt}if(at){const lt=this.clonePointerEvent(st,"click");lt.target=at,lt.path=null,nt.clicksByButton[et.button]||(nt.clicksByButton[et.button]={clickCount:0,target:lt.target,timeStamp:rt});const ut=nt.clicksByButton[et.button];if(ut.target===lt.target&&rt-ut.timeStamp<200?++ut.clickCount:ut.clickCount=1,ut.target=lt.target,ut.timeStamp=rt,lt.detail=ut.clickCount,lt.pointerType==="mouse"){const ct=lt.button===2;this.dispatchEvent(lt,ct?"rightclick":"click")}else lt.pointerType==="touch"&&this.dispatchEvent(lt,"tap");this.dispatchEvent(lt,"pointertap"),this.freeEvent(lt)}this.freeEvent(st)}mapPointerUpOutside(et){if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=this.trackingData(et.pointerId),st=this.findMountedTarget(rt.pressTargetsByButton[et.button]),nt=this.createPointerEvent(et);if(st){let ot=st;for(;ot;)nt.currentTarget=ot,this.notifyTarget(nt,"pointerupoutside"),nt.pointerType==="touch"?this.notifyTarget(nt,"touchendoutside"):(nt.pointerType==="mouse"||nt.pointerType==="pen")&&this.notifyTarget(nt,nt.button===2?"rightupoutside":"mouseupoutside"),ot=ot.parent;delete rt.pressTargetsByButton[et.button]}this.freeEvent(nt)}mapWheel(et){if(!(et instanceof FederatedWheelEvent)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const rt=this.createWheelEvent(et);this.dispatchEvent(rt),this.freeEvent(rt)}findMountedTarget(et){if(!et)return null;let rt=et[0];for(let st=1;st<et.length&&et[st].parent===rt;st++)rt=et[st];return rt}createPointerEvent(et,rt,st){const nt=this.allocateEvent(FederatedPointerEvent);return this.copyPointerData(et,nt),this.copyMouseData(et,nt),this.copyData(et,nt),nt.nativeEvent=et.nativeEvent,nt.originalEvent=et,nt.target=st??this.hitTest(nt.global.x,nt.global.y)??this._hitElements[0],typeof rt=="string"&&(nt.type=rt),nt}createWheelEvent(et){const rt=this.allocateEvent(FederatedWheelEvent);return this.copyWheelData(et,rt),this.copyMouseData(et,rt),this.copyData(et,rt),rt.nativeEvent=et.nativeEvent,rt.originalEvent=et,rt.target=this.hitTest(rt.global.x,rt.global.y),rt}clonePointerEvent(et,rt){const st=this.allocateEvent(FederatedPointerEvent);return st.nativeEvent=et.nativeEvent,st.originalEvent=et.originalEvent,this.copyPointerData(et,st),this.copyMouseData(et,st),this.copyData(et,st),st.target=et.target,st.path=et.composedPath().slice(),st.type=rt??st.type,st}copyWheelData(et,rt){rt.deltaMode=et.deltaMode,rt.deltaX=et.deltaX,rt.deltaY=et.deltaY,rt.deltaZ=et.deltaZ}copyPointerData(et,rt){et instanceof FederatedPointerEvent&&rt instanceof FederatedPointerEvent&&(rt.pointerId=et.pointerId,rt.width=et.width,rt.height=et.height,rt.isPrimary=et.isPrimary,rt.pointerType=et.pointerType,rt.pressure=et.pressure,rt.tangentialPressure=et.tangentialPressure,rt.tiltX=et.tiltX,rt.tiltY=et.tiltY,rt.twist=et.twist)}copyMouseData(et,rt){et instanceof FederatedMouseEvent&&rt instanceof FederatedMouseEvent&&(rt.altKey=et.altKey,rt.button=et.button,rt.buttons=et.buttons,rt.client.copyFrom(et.client),rt.ctrlKey=et.ctrlKey,rt.metaKey=et.metaKey,rt.movement.copyFrom(et.movement),rt.screen.copyFrom(et.screen),rt.shiftKey=et.shiftKey,rt.global.copyFrom(et.global))}copyData(et,rt){rt.isTrusted=et.isTrusted,rt.srcElement=et.srcElement,rt.timeStamp=performance.now(),rt.type=et.type,rt.detail=et.detail,rt.view=et.view,rt.which=et.which,rt.layer.copyFrom(et.layer),rt.page.copyFrom(et.page)}trackingData(et){return this.mappingState.trackingData[et]||(this.mappingState.trackingData[et]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[et]}allocateEvent(et){this.eventPool.has(et)||this.eventPool.set(et,[]);const rt=this.eventPool.get(et).pop()||new et(this);return rt.eventPhase=rt.NONE,rt.currentTarget=null,rt.path=null,rt.target=null,rt}freeEvent(et){if(et.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const rt=et.constructor;this.eventPool.has(rt)||this.eventPool.set(rt,[]),this.eventPool.get(rt).push(et)}notifyListeners(et,rt){const st=et.currentTarget._events[rt];if(st&&et.currentTarget.isInteractive())if("fn"in st)st.once&&et.currentTarget.removeListener(rt,st.fn,void 0,!0),st.fn.call(st.context,et);else for(let nt=0,ot=st.length;nt<ot&&!et.propagationImmediatelyStopped;nt++)st[nt].once&&et.currentTarget.removeListener(rt,st[nt].fn,void 0,!0),st[nt].fn.call(st[nt].context,et)}}const MOUSE_POINTER_ID=1,TOUCH_TO_POINTER={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},_EventSystem=class l2{constructor(et){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=et,this.rootBoundary=new EventBoundary(null),EventsTicker.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new FederatedPointerEvent(null),this.rootWheelEvent=new FederatedWheelEvent(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...l2.defaultEventFeatures},{set:(rt,st,nt)=>(st==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=nt),rt[st]=nt,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(et){const{view:rt,resolution:st}=this.renderer;this.setTargetElement(rt),this.resolution=st,l2._defaultEventMode=et.eventMode??"auto",Object.assign(this.features,et.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(et){this.resolution=et}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(et){et=et||"default";let rt=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(rt=!1),this.currentCursor===et)return;this.currentCursor=et;const st=this.cursorStyles[et];if(st)switch(typeof st){case"string":rt&&(this.domElement.style.cursor=st);break;case"function":st(et);break;case"object":rt&&Object.assign(this.domElement.style,st);break}else rt&&typeof et=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,et)&&(this.domElement.style.cursor=et)}get pointer(){return this.rootPointerEvent}onPointerDown(et){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const rt=this.normalizeToPointerData(et);this.autoPreventDefault&&rt[0].isNormalized&&(et.cancelable||!("cancelable"in et))&&et.preventDefault();for(let st=0,nt=rt.length;st<nt;st++){const ot=rt[st],at=this.bootstrapEvent(this.rootPointerEvent,ot);this.rootBoundary.mapEvent(at)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(et){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,EventsTicker.pointerMoved();const rt=this.normalizeToPointerData(et);for(let st=0,nt=rt.length;st<nt;st++){const ot=this.bootstrapEvent(this.rootPointerEvent,rt[st]);this.rootBoundary.mapEvent(ot)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(et){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let rt=et.target;et.composedPath&&et.composedPath().length>0&&(rt=et.composedPath()[0]);const st=rt!==this.domElement?"outside":"",nt=this.normalizeToPointerData(et);for(let ot=0,at=nt.length;ot<at;ot++){const lt=this.bootstrapEvent(this.rootPointerEvent,nt[ot]);lt.type+=st,this.rootBoundary.mapEvent(lt)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(et){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const rt=this.normalizeToPointerData(et);for(let st=0,nt=rt.length;st<nt;st++){const ot=this.bootstrapEvent(this.rootPointerEvent,rt[st]);this.rootBoundary.mapEvent(ot)}this.setCursor(this.rootBoundary.cursor)}onWheel(et){if(!this.features.wheel)return;const rt=this.normalizeWheelEvent(et);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(rt)}setTargetElement(et){this.removeEvents(),this.domElement=et,EventsTicker.domElement=et,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;EventsTicker.addTickerListener();const et=this.domElement.style;et&&(globalThis.navigator.msPointerEnabled?(et.msContentZooming="none",et.msTouchAction="none"):this.supportsPointerEvents&&(et.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;EventsTicker.removeTickerListener();const et=this.domElement.style;globalThis.navigator.msPointerEnabled?(et.msContentZooming="",et.msTouchAction=""):this.supportsPointerEvents&&(et.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(et,rt,st){const nt=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},ot=1/this.resolution;et.x=(rt-nt.left)*(this.domElement.width/nt.width)*ot,et.y=(st-nt.top)*(this.domElement.height/nt.height)*ot}normalizeToPointerData(et){const rt=[];if(this.supportsTouchEvents&&et instanceof TouchEvent)for(let st=0,nt=et.changedTouches.length;st<nt;st++){const ot=et.changedTouches[st];typeof ot.button>"u"&&(ot.button=0),typeof ot.buttons>"u"&&(ot.buttons=1),typeof ot.isPrimary>"u"&&(ot.isPrimary=et.touches.length===1&&et.type==="touchstart"),typeof ot.width>"u"&&(ot.width=ot.radiusX||1),typeof ot.height>"u"&&(ot.height=ot.radiusY||1),typeof ot.tiltX>"u"&&(ot.tiltX=0),typeof ot.tiltY>"u"&&(ot.tiltY=0),typeof ot.pointerType>"u"&&(ot.pointerType="touch"),typeof ot.pointerId>"u"&&(ot.pointerId=ot.identifier||0),typeof ot.pressure>"u"&&(ot.pressure=ot.force||.5),typeof ot.twist>"u"&&(ot.twist=0),typeof ot.tangentialPressure>"u"&&(ot.tangentialPressure=0),typeof ot.layerX>"u"&&(ot.layerX=ot.offsetX=ot.clientX),typeof ot.layerY>"u"&&(ot.layerY=ot.offsetY=ot.clientY),ot.isNormalized=!0,ot.type=et.type,rt.push(ot)}else if(!globalThis.MouseEvent||et instanceof MouseEvent&&(!this.supportsPointerEvents||!(et instanceof globalThis.PointerEvent))){const st=et;typeof st.isPrimary>"u"&&(st.isPrimary=!0),typeof st.width>"u"&&(st.width=1),typeof st.height>"u"&&(st.height=1),typeof st.tiltX>"u"&&(st.tiltX=0),typeof st.tiltY>"u"&&(st.tiltY=0),typeof st.pointerType>"u"&&(st.pointerType="mouse"),typeof st.pointerId>"u"&&(st.pointerId=MOUSE_POINTER_ID),typeof st.pressure>"u"&&(st.pressure=.5),typeof st.twist>"u"&&(st.twist=0),typeof st.tangentialPressure>"u"&&(st.tangentialPressure=0),st.isNormalized=!0,rt.push(st)}else rt.push(et);return rt}normalizeWheelEvent(et){const rt=this.rootWheelEvent;return this.transferMouseData(rt,et),rt.deltaX=et.deltaX,rt.deltaY=et.deltaY,rt.deltaZ=et.deltaZ,rt.deltaMode=et.deltaMode,this.mapPositionToPoint(rt.screen,et.clientX,et.clientY),rt.global.copyFrom(rt.screen),rt.offset.copyFrom(rt.screen),rt.nativeEvent=et,rt.type=et.type,rt}bootstrapEvent(et,rt){return et.originalEvent=null,et.nativeEvent=rt,et.pointerId=rt.pointerId,et.width=rt.width,et.height=rt.height,et.isPrimary=rt.isPrimary,et.pointerType=rt.pointerType,et.pressure=rt.pressure,et.tangentialPressure=rt.tangentialPressure,et.tiltX=rt.tiltX,et.tiltY=rt.tiltY,et.twist=rt.twist,this.transferMouseData(et,rt),this.mapPositionToPoint(et.screen,rt.clientX,rt.clientY),et.global.copyFrom(et.screen),et.offset.copyFrom(et.screen),et.isTrusted=rt.isTrusted,et.type==="pointerleave"&&(et.type="pointerout"),et.type.startsWith("mouse")&&(et.type=et.type.replace("mouse","pointer")),et.type.startsWith("touch")&&(et.type=TOUCH_TO_POINTER[et.type]||et.type),et}transferMouseData(et,rt){et.isTrusted=rt.isTrusted,et.srcElement=rt.srcElement,et.timeStamp=performance.now(),et.type=rt.type,et.altKey=rt.altKey,et.button=rt.button,et.buttons=rt.buttons,et.client.x=rt.clientX,et.client.y=rt.clientY,et.ctrlKey=rt.ctrlKey,et.metaKey=rt.metaKey,et.movement.x=rt.movementX,et.movement.y=rt.movementY,et.page.x=rt.pageX,et.page.y=rt.pageY,et.relatedTarget=null,et.shiftKey=rt.shiftKey}};_EventSystem.extension={name:"events",type:[ExtensionType.RendererSystem,ExtensionType.CanvasRendererSystem]},_EventSystem.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let EventSystem=_EventSystem;extensions$1.add(EventSystem);function convertEventModeToInteractiveMode(tt){return tt==="dynamic"||tt==="static"}const FederatedDisplayObject={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??convertEventModeToInteractiveMode(EventSystem.defaultEventMode)},set interactive(tt){deprecation("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=tt,this.eventMode=tt?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??EventSystem.defaultEventMode},set eventMode(tt){this._internalInteractive=convertEventModeToInteractiveMode(tt),this._internalEventMode=tt},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(tt,et,rt){const st=typeof rt=="boolean"&&rt||typeof rt=="object"&&rt.capture,nt=typeof rt=="object"?rt.signal:void 0,ot=typeof rt=="object"?rt.once===!0:!1,at=typeof et=="function"?void 0:et;tt=st?`${tt}capture`:tt;const lt=typeof et=="function"?et:et.handleEvent,ut=this;nt&&nt.addEventListener("abort",()=>{ut.off(tt,lt,at)}),ot?ut.once(tt,lt,at):ut.on(tt,lt,at)},removeEventListener(tt,et,rt){const st=typeof rt=="boolean"&&rt||typeof rt=="object"&&rt.capture,nt=typeof et=="function"?void 0:et;tt=st?`${tt}capture`:tt,et=typeof et=="function"?et:et.handleEvent,this.off(tt,et,nt)},dispatchEvent(tt){if(!(tt instanceof FederatedEvent))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return tt.defaultPrevented=!1,tt.path=null,tt.target=this,tt.manager.dispatchEvent(tt),!tt.defaultPrevented}};DisplayObject.mixin(FederatedDisplayObject);const accessibleTarget={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};DisplayObject.mixin(accessibleTarget);const KEY_CODE_TAB=9,DIV_TOUCH_SIZE=100,DIV_TOUCH_POS_X=0,DIV_TOUCH_POS_Y=0,DIV_TOUCH_ZINDEX=2,DIV_HOOK_SIZE=1,DIV_HOOK_POS_X=-1e3,DIV_HOOK_POS_Y=-1e3,DIV_HOOK_ZINDEX=2;class AccessibilityManager{constructor(et){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(isMobile.tablet||isMobile.phone)&&this.createTouchHook();const rt=document.createElement("div");rt.style.width=`${DIV_TOUCH_SIZE}px`,rt.style.height=`${DIV_TOUCH_SIZE}px`,rt.style.position="absolute",rt.style.top=`${DIV_TOUCH_POS_X}px`,rt.style.left=`${DIV_TOUCH_POS_Y}px`,rt.style.zIndex=DIV_TOUCH_ZINDEX.toString(),this.div=rt,this.renderer=et,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const et=document.createElement("button");et.style.width=`${DIV_HOOK_SIZE}px`,et.style.height=`${DIV_HOOK_SIZE}px`,et.style.position="absolute",et.style.top=`${DIV_HOOK_POS_X}px`,et.style.left=`${DIV_HOOK_POS_Y}px`,et.style.zIndex=DIV_HOOK_ZINDEX.toString(),et.style.backgroundColor="#FF0000",et.title="select to enable accessibility for this content",et.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(et),this._hookDiv=et}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var et;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(et=this.renderer.view.parentNode)==null||et.appendChild(this.div))}deactivate(){var et;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(et=this.div.parentNode)==null||et.removeChild(this.div))}updateAccessibleObjects(et){if(!et.visible||!et.accessibleChildren)return;et.accessible&&et.isInteractive()&&(et._accessibleActive||this.addChild(et),et.renderId=this.renderId);const rt=et.children;if(rt)for(let st=0;st<rt.length;st++)this.updateAccessibleObjects(rt[st])}update(){const et=performance.now();if(isMobile.android.device&&et<this.androidUpdateCount||(this.androidUpdateCount=et+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:rt,y:st,width:nt,height:ot}=this.renderer.view.getBoundingClientRect(),{width:at,height:lt,resolution:ut}=this.renderer,ct=nt/at*ut,dt=ot/lt*ut;let ht=this.div;ht.style.left=`${rt}px`,ht.style.top=`${st}px`,ht.style.width=`${at}px`,ht.style.height=`${lt}px`;for(let ft=0;ft<this.children.length;ft++){const xt=this.children[ft];if(xt.renderId!==this.renderId)xt._accessibleActive=!1,removeItems(this.children,ft,1),this.div.removeChild(xt._accessibleDiv),this.pool.push(xt._accessibleDiv),xt._accessibleDiv=null,ft--;else{ht=xt._accessibleDiv;let vt=xt.hitArea;const yt=xt.worldTransform;xt.hitArea?(ht.style.left=`${(yt.tx+vt.x*yt.a)*ct}px`,ht.style.top=`${(yt.ty+vt.y*yt.d)*dt}px`,ht.style.width=`${vt.width*yt.a*ct}px`,ht.style.height=`${vt.height*yt.d*dt}px`):(vt=xt.getBounds(),this.capHitArea(vt),ht.style.left=`${vt.x*ct}px`,ht.style.top=`${vt.y*dt}px`,ht.style.width=`${vt.width*ct}px`,ht.style.height=`${vt.height*dt}px`,ht.title!==xt.accessibleTitle&&xt.accessibleTitle!==null&&(ht.title=xt.accessibleTitle),ht.getAttribute("aria-label")!==xt.accessibleHint&&xt.accessibleHint!==null&&ht.setAttribute("aria-label",xt.accessibleHint)),(xt.accessibleTitle!==ht.title||xt.tabIndex!==ht.tabIndex)&&(ht.title=xt.accessibleTitle,ht.tabIndex=xt.tabIndex,this.debug&&this.updateDebugHTML(ht))}}this.renderId++}updateDebugHTML(et){et.innerHTML=`type: ${et.type}</br> title : ${et.title}</br> tabIndex: ${et.tabIndex}`}capHitArea(et){et.x<0&&(et.width+=et.x,et.x=0),et.y<0&&(et.height+=et.y,et.y=0);const{width:rt,height:st}=this.renderer;et.x+et.width>rt&&(et.width=rt-et.x),et.y+et.height>st&&(et.height=st-et.y)}addChild(et){let rt=this.pool.pop();rt||(rt=document.createElement("button"),rt.style.width=`${DIV_TOUCH_SIZE}px`,rt.style.height=`${DIV_TOUCH_SIZE}px`,rt.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",rt.style.position="absolute",rt.style.zIndex=DIV_TOUCH_ZINDEX.toString(),rt.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?rt.setAttribute("aria-live","off"):rt.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?rt.setAttribute("aria-relevant","additions"):rt.setAttribute("aria-relevant","text"),rt.addEventListener("click",this._onClick.bind(this)),rt.addEventListener("focus",this._onFocus.bind(this)),rt.addEventListener("focusout",this._onFocusOut.bind(this))),rt.style.pointerEvents=et.accessiblePointerEvents,rt.type=et.accessibleType,et.accessibleTitle&&et.accessibleTitle!==null?rt.title=et.accessibleTitle:(!et.accessibleHint||et.accessibleHint===null)&&(rt.title=`displayObject ${et.tabIndex}`),et.accessibleHint&&et.accessibleHint!==null&&rt.setAttribute("aria-label",et.accessibleHint),this.debug&&this.updateDebugHTML(rt),et._accessibleActive=!0,et._accessibleDiv=rt,rt.displayObject=et,this.children.push(et),this.div.appendChild(et._accessibleDiv),et._accessibleDiv.tabIndex=et.tabIndex}_dispatchEvent(et,rt){const{displayObject:st}=et.target,nt=this.renderer.events.rootBoundary,ot=Object.assign(new FederatedEvent(nt),{target:st});nt.rootTarget=this.renderer.lastObjectRendered,rt.forEach(at=>nt.dispatchEvent(ot,at))}_onClick(et){this._dispatchEvent(et,["click","pointertap","tap"])}_onFocus(et){et.target.getAttribute("aria-live")||et.target.setAttribute("aria-live","assertive"),this._dispatchEvent(et,["mouseover"])}_onFocusOut(et){et.target.getAttribute("aria-live")||et.target.setAttribute("aria-live","polite"),this._dispatchEvent(et,["mouseout"])}_onKeyDown(et){et.keyCode===KEY_CODE_TAB&&this.activate()}_onMouseMove(et){et.movementX===0&&et.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}AccessibilityManager.extension={name:"accessibility",type:[ExtensionType.RendererPlugin,ExtensionType.CanvasRendererPlugin]};extensions$1.add(AccessibilityManager);var INTERNAL_FORMATS=(tt=>(tt[tt.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",tt[tt.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",tt[tt.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",tt[tt.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",tt[tt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",tt[tt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",tt[tt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",tt[tt.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",tt[tt.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",tt[tt.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",tt[tt.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",tt[tt.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",tt[tt.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",tt[tt.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",tt[tt.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",tt[tt.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",tt[tt.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",tt[tt.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",tt[tt.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",tt[tt.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",tt[tt.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",tt[tt.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",tt[tt.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",tt[tt.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",tt[tt.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",tt[tt.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",tt[tt.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",tt[tt.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",tt[tt.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",tt[tt.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",tt[tt.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",tt))(INTERNAL_FORMATS||{});const INTERNAL_FORMAT_TO_BYTES_PER_PIXEL={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let storedGl,extensions;function getCompressedTextureExtensions(){extensions={bptc:storedGl.getExtension("EXT_texture_compression_bptc"),astc:storedGl.getExtension("WEBGL_compressed_texture_astc"),etc:storedGl.getExtension("WEBGL_compressed_texture_etc"),s3tc:storedGl.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:storedGl.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:storedGl.getExtension("WEBGL_compressed_texture_pvrtc")||storedGl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:storedGl.getExtension("WEBGL_compressed_texture_etc1"),atc:storedGl.getExtension("WEBGL_compressed_texture_atc")}}const detectCompressedTextures={extension:{type:ExtensionType.DetectionParser,priority:2},test:async()=>{const tt=settings.ADAPTER.createCanvas().getContext("webgl");return tt?(storedGl=tt,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async tt=>{extensions||getCompressedTextureExtensions();const et=[];for(const rt in extensions)extensions[rt]&&et.push(rt);return[...et,...tt]},remove:async tt=>(extensions||getCompressedTextureExtensions(),tt.filter(et=>!(et in extensions)))};extensions$1.add(detectCompressedTextures);class BlobResource extends BufferResource{constructor(et,rt={width:1,height:1,autoLoad:!0}){let st,nt;typeof et=="string"?(st=et,nt=new Uint8Array):(st=null,nt=et),super(nt,rt),this.origin=st,this.buffer=nt?new ViewableBuffer(nt):null,this._load=null,this.loaded=!1,this.origin!==null&&rt.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(et){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(et=>et.blob()).then(et=>et.arrayBuffer()).then(et=>(this.data=new Uint32Array(et),this.buffer=new ViewableBuffer(et),this.loaded=!0,this.onBlobLoaded(et),this.update(),this)),this._load)}}class CompressedTextureResource extends BlobResource{constructor(et,rt){super(et,rt),this.format=rt.format,this.levels=rt.levels||1,this._width=rt.width,this._height=rt.height,this._extension=CompressedTextureResource._formatToExtension(this.format),(rt.levelBuffers||this.buffer)&&(this._levelBuffers=rt.levelBuffers||CompressedTextureResource._createLevelBuffers(et instanceof Uint8Array?et:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(et,rt,st){const nt=et.gl;if(!et.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;nt.pixelStorei(nt.UNPACK_ALIGNMENT,4);for(let ot=0,at=this.levels;ot<at;ot++){const{levelID:lt,levelWidth:ut,levelHeight:ct,levelBuffer:dt}=this._levelBuffers[ot];nt.compressedTexImage2D(nt.TEXTURE_2D,lt,this.format,ut,ct,0,dt)}return!0}onBlobLoaded(){this._levelBuffers=CompressedTextureResource._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(et){if(et>=33776&&et<=33779)return"s3tc";if(et>=35916&&et<=35919)return"s3tc_sRGB";if(et>=37488&&et<=37497)return"etc";if(et>=35840&&et<=35843)return"pvrtc";if(et===36196)return"etc1";if(et===35986||et===35987||et===34798)return"atc";if(et>=36492&&et<=36495)return"bptc";if(et===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${et}`)}static _createLevelBuffers(et,rt,st,nt,ot,at,lt){const ut=new Array(st);let ct=et.byteOffset,dt=at,ht=lt,ft=dt+nt-1&~(nt-1),xt=ht+ot-1&~(ot-1),vt=ft*xt*INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[rt];for(let yt=0;yt<st;yt++)ut[yt]={levelID:yt,levelWidth:st>1?dt:ft,levelHeight:st>1?ht:xt,levelBuffer:new Uint8Array(et.buffer,ct,vt)},ct+=vt,dt=dt>>1||1,ht=ht>>1||1,ft=dt+nt-1&~(nt-1),xt=ht+ot-1&~(ot-1),vt=ft*xt*INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[rt];return ut}}const DDS_MAGIC_SIZE=4,DDS_HEADER_SIZE=124,DDS_HEADER_PF_SIZE=32,DDS_HEADER_DX10_SIZE=20,DDS_MAGIC=542327876,DDS_FIELDS={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},DDS_PF_FIELDS={FOURCC:2},DDS_DX10_FIELDS={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},PF_FLAGS=1,DDPF_ALPHA=2,DDPF_FOURCC=4,DDPF_RGB=64,DDPF_YUV=512,DDPF_LUMINANCE=131072,FOURCC_DXT1=827611204,FOURCC_DXT3=861165636,FOURCC_DXT5=894720068,FOURCC_DX10=808540228,DDS_RESOURCE_MISC_TEXTURECUBE=4,FOURCC_TO_FORMAT={[FOURCC_DXT1]:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,[FOURCC_DXT3]:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,[FOURCC_DXT5]:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT},DXGI_TO_FORMAT={70:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:INTERNAL_FORMATS.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function parseDDS(tt){const et=new Uint32Array(tt);if(et[0]!==DDS_MAGIC)throw new Error("Invalid DDS file magic word");const rt=new Uint32Array(tt,0,DDS_HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT),st=rt[DDS_FIELDS.HEIGHT],nt=rt[DDS_FIELDS.WIDTH],ot=rt[DDS_FIELDS.MIPMAP_COUNT],at=new Uint32Array(tt,DDS_FIELDS.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,DDS_HEADER_PF_SIZE/Uint32Array.BYTES_PER_ELEMENT),lt=at[PF_FLAGS];if(lt&DDPF_FOURCC){const ut=at[DDS_PF_FIELDS.FOURCC];if(ut!==FOURCC_DX10){const wt=FOURCC_TO_FORMAT[ut],St=DDS_MAGIC_SIZE+DDS_HEADER_SIZE,Rt=new Uint8Array(tt,St);return[new CompressedTextureResource(Rt,{format:wt,width:nt,height:st,levels:ot})]}const ct=DDS_MAGIC_SIZE+DDS_HEADER_SIZE,dt=new Uint32Array(et.buffer,ct,DDS_HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT),ht=dt[DDS_DX10_FIELDS.DXGI_FORMAT],ft=dt[DDS_DX10_FIELDS.RESOURCE_DIMENSION],xt=dt[DDS_DX10_FIELDS.MISC_FLAG],vt=dt[DDS_DX10_FIELDS.ARRAY_SIZE],yt=DXGI_TO_FORMAT[ht];if(yt===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${ht}`);if(xt===DDS_RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(ft===6)throw new Error("DDSParser does not supported 3D texture data");const Et=new Array,bt=DDS_MAGIC_SIZE+DDS_HEADER_SIZE+DDS_HEADER_DX10_SIZE;if(vt===1)Et.push(new Uint8Array(tt,bt));else{const wt=INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[yt];let St=0,Rt=nt,Ct=st;for(let jt=0;jt<ot;jt++){const Pt=Math.max(1,Rt+3&-4),Ot=Math.max(1,Ct+3&-4),Ut=Pt*Ot*wt;St+=Ut,Rt=Rt>>>1,Ct=Ct>>>1}let It=bt;for(let jt=0;jt<vt;jt++)Et.push(new Uint8Array(tt,It,St)),It+=St}return Et.map(wt=>new CompressedTextureResource(wt,{format:yt,width:nt,height:st,levels:ot}))}throw lt&DDPF_RGB?new Error("DDSParser does not support uncompressed texture data."):lt&DDPF_YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):lt&DDPF_LUMINANCE?new Error("DDSParser does not support single-channel (lumninance) texture data!"):lt&DDPF_ALPHA?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const FILE_IDENTIFIER=[171,75,84,88,32,49,49,187,13,10,26,10],ENDIANNESS=67305985,KTX_FIELDS={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},FILE_HEADER_SIZE=64,TYPES_TO_BYTES_PER_COMPONENT={[TYPES.UNSIGNED_BYTE]:1,[TYPES.UNSIGNED_SHORT]:2,[TYPES.INT]:4,[TYPES.UNSIGNED_INT]:4,[TYPES.FLOAT]:4,[TYPES.HALF_FLOAT]:8},FORMATS_TO_COMPONENTS={[FORMATS.RGBA]:4,[FORMATS.RGB]:3,[FORMATS.RG]:2,[FORMATS.RED]:1,[FORMATS.LUMINANCE]:1,[FORMATS.LUMINANCE_ALPHA]:2,[FORMATS.ALPHA]:1},TYPES_TO_BYTES_PER_PIXEL={[TYPES.UNSIGNED_SHORT_4_4_4_4]:2,[TYPES.UNSIGNED_SHORT_5_5_5_1]:2,[TYPES.UNSIGNED_SHORT_5_6_5]:2};function parseKTX(tt,et,rt=!1){const st=new DataView(et);if(!validate(tt,st))return null;const nt=st.getUint32(KTX_FIELDS.ENDIANNESS,!0)===ENDIANNESS,ot=st.getUint32(KTX_FIELDS.GL_TYPE,nt),at=st.getUint32(KTX_FIELDS.GL_FORMAT,nt),lt=st.getUint32(KTX_FIELDS.GL_INTERNAL_FORMAT,nt),ut=st.getUint32(KTX_FIELDS.PIXEL_WIDTH,nt),ct=st.getUint32(KTX_FIELDS.PIXEL_HEIGHT,nt)||1,dt=st.getUint32(KTX_FIELDS.PIXEL_DEPTH,nt)||1,ht=st.getUint32(KTX_FIELDS.NUMBER_OF_ARRAY_ELEMENTS,nt)||1,ft=st.getUint32(KTX_FIELDS.NUMBER_OF_FACES,nt),xt=st.getUint32(KTX_FIELDS.NUMBER_OF_MIPMAP_LEVELS,nt),vt=st.getUint32(KTX_FIELDS.BYTES_OF_KEY_VALUE_DATA,nt);if(ct===0||dt!==1)throw new Error("Only 2D textures are supported");if(ft!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(ht!==1)throw new Error("WebGL does not support array textures");const yt=4,Et=4,bt=ut+3&-4,wt=ct+3&-4,St=new Array(ht);let Rt=ut*ct;ot===0&&(Rt=bt*wt);let Ct;if(ot!==0?TYPES_TO_BYTES_PER_COMPONENT[ot]?Ct=TYPES_TO_BYTES_PER_COMPONENT[ot]*FORMATS_TO_COMPONENTS[at]:Ct=TYPES_TO_BYTES_PER_PIXEL[ot]:Ct=INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[lt],Ct===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const It=rt?parseKvData(st,vt,nt):null;let jt=Rt*Ct,Pt=ut,Ot=ct,Ut=bt,Nt=wt,Ht=FILE_HEADER_SIZE+vt;for(let Lt=0;Lt<xt;Lt++){const kt=st.getUint32(Ht,nt);let $t=Ht+4;for(let Ft=0;Ft<ht;Ft++){let Gt=St[Ft];Gt||(Gt=St[Ft]=new Array(xt)),Gt[Lt]={levelID:Lt,levelWidth:xt>1||ot!==0?Pt:Ut,levelHeight:xt>1||ot!==0?Ot:Nt,levelBuffer:new Uint8Array(et,$t,jt)},$t+=jt}Ht+=kt+4,Ht=Ht%4!==0?Ht+4-Ht%4:Ht,Pt=Pt>>1||1,Ot=Ot>>1||1,Ut=Pt+yt-1&-4,Nt=Ot+Et-1&-4,jt=Ut*Nt*Ct}return ot!==0?{uncompressed:St.map(Lt=>{let kt=Lt[0].levelBuffer,$t=!1;return ot===TYPES.FLOAT?kt=new Float32Array(Lt[0].levelBuffer.buffer,Lt[0].levelBuffer.byteOffset,Lt[0].levelBuffer.byteLength/4):ot===TYPES.UNSIGNED_INT?($t=!0,kt=new Uint32Array(Lt[0].levelBuffer.buffer,Lt[0].levelBuffer.byteOffset,Lt[0].levelBuffer.byteLength/4)):ot===TYPES.INT&&($t=!0,kt=new Int32Array(Lt[0].levelBuffer.buffer,Lt[0].levelBuffer.byteOffset,Lt[0].levelBuffer.byteLength/4)),{resource:new BufferResource(kt,{width:Lt[0].levelWidth,height:Lt[0].levelHeight}),type:ot,format:$t?convertFormatToInteger(at):at}}),kvData:It}:{compressed:St.map(Lt=>new CompressedTextureResource(null,{format:lt,width:ut,height:ct,levels:xt,levelBuffers:Lt})),kvData:It}}function validate(tt,et){for(let rt=0;rt<FILE_IDENTIFIER.length;rt++)if(et.getUint8(rt)!==FILE_IDENTIFIER[rt])return console.error(`${tt} is not a valid *.ktx file!`),!1;return!0}function convertFormatToInteger(tt){switch(tt){case FORMATS.RGBA:return FORMATS.RGBA_INTEGER;case FORMATS.RGB:return FORMATS.RGB_INTEGER;case FORMATS.RG:return FORMATS.RG_INTEGER;case FORMATS.RED:return FORMATS.RED_INTEGER;default:return tt}}function parseKvData(tt,et,rt){const st=new Map;let nt=0;for(;nt<et;){const ot=tt.getUint32(FILE_HEADER_SIZE+nt,rt),at=FILE_HEADER_SIZE+nt+4,lt=3-(ot+3)%4;if(ot===0||ot>et-nt){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let ut=0;for(;ut<ot&&tt.getUint8(at+ut)!==0;ut++);if(ut===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const ct=new TextDecoder().decode(new Uint8Array(tt.buffer,at,ut)),dt=new DataView(tt.buffer,at+ut+1,ot-ut-1);st.set(ct,dt),nt+=4+ot+lt}return st}const loadDDS={extension:{type:ExtensionType.LoadParser,priority:LoaderParserPriority.High},name:"loadDDS",test(tt){return checkExtension(tt,".dds")},async load(tt,et,rt){const st=await(await settings.ADAPTER.fetch(tt)).arrayBuffer(),nt=parseDDS(st).map(ot=>{const at=new BaseTexture(ot,{mipmap:MIPMAP_MODES.OFF,alphaMode:ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:getResolutionOfUrl(tt),...et.data});return createTexture(at,rt,tt)});return nt.length===1?nt[0]:nt},unload(tt){Array.isArray(tt)?tt.forEach(et=>et.destroy(!0)):tt.destroy(!0)}};extensions$1.add(loadDDS);const loadKTX={extension:{type:ExtensionType.LoadParser,priority:LoaderParserPriority.High},name:"loadKTX",test(tt){return checkExtension(tt,".ktx")},async load(tt,et,rt){const st=await(await settings.ADAPTER.fetch(tt)).arrayBuffer(),{compressed:nt,uncompressed:ot,kvData:at}=parseKTX(tt,st),lt=nt??ot,ut={mipmap:MIPMAP_MODES.OFF,alphaMode:ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:getResolutionOfUrl(tt),...et.data},ct=lt.map(dt=>{lt===ot&&Object.assign(ut,{type:dt.type,format:dt.format});const ht=dt.resource??dt,ft=new BaseTexture(ht,ut);return ft.ktxKeyValueData=at,createTexture(ft,rt,tt)});return ct.length===1?ct[0]:ct},unload(tt){Array.isArray(tt)?tt.forEach(et=>et.destroy(!0)):tt.destroy(!0)}};extensions$1.add(loadKTX);const knownFormats=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],resolveCompressedTextureUrl={extension:ExtensionType.ResolveParser,test:tt=>{const et=path.extname(tt).slice(1);return["basis","ktx","dds"].includes(et)},parse:tt=>{var st,nt;const et=tt.split("."),rt=et.pop();if(["ktx","dds"].includes(rt)){const ot=et.pop();if(knownFormats.includes(ot))return{resolution:parseFloat(((st=settings.RETINA_PREFIX.exec(tt))==null?void 0:st[1])??"1"),format:ot,src:tt}}return{resolution:parseFloat(((nt=settings.RETINA_PREFIX.exec(tt))==null?void 0:nt[1])??"1"),format:rt,src:tt}}};extensions$1.add(resolveCompressedTextureUrl);const TEMP_RECT=new Rectangle,BYTES_PER_PIXEL=4,_Extract=class Du{constructor(et){this.renderer=et,this._rendererPremultipliedAlpha=!1}contextChange(){var rt;const et=(rt=this.renderer)==null?void 0:rt.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(et&&et.alpha&&et.premultipliedAlpha)}async image(et,rt,st,nt){const ot=new Image;return ot.src=await this.base64(et,rt,st,nt),ot}async base64(et,rt,st,nt){const ot=this.canvas(et,nt);if(ot.toBlob!==void 0)return new Promise((at,lt)=>{ot.toBlob(ut=>{if(!ut){lt(new Error("ICanvas.toBlob failed!"));return}const ct=new FileReader;ct.onload=()=>at(ct.result),ct.onerror=lt,ct.readAsDataURL(ut)},rt,st)});if(ot.toDataURL!==void 0)return ot.toDataURL(rt,st);if(ot.convertToBlob!==void 0){const at=await ot.convertToBlob({type:rt,quality:st});return new Promise((lt,ut)=>{const ct=new FileReader;ct.onload=()=>lt(ct.result),ct.onerror=ut,ct.readAsDataURL(at)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(et,rt){const{pixels:st,width:nt,height:ot,flipY:at,premultipliedAlpha:lt}=this._rawPixels(et,rt);at&&Du._flipY(st,nt,ot),lt&&Du._unpremultiplyAlpha(st);const ut=new CanvasRenderTarget(nt,ot,1),ct=new ImageData(new Uint8ClampedArray(st.buffer),nt,ot);return ut.context.putImageData(ct,0,0),ut.canvas}pixels(et,rt){const{pixels:st,width:nt,height:ot,flipY:at,premultipliedAlpha:lt}=this._rawPixels(et,rt);return at&&Du._flipY(st,nt,ot),lt&&Du._unpremultiplyAlpha(st),st}_rawPixels(et,rt){const st=this.renderer;if(!st)throw new Error("The Extract has already been destroyed");let nt,ot=!1,at=!1,lt,ut=!1;et&&(et instanceof RenderTexture?lt=et:(lt=st.generateTexture(et,{region:rt,resolution:st.resolution,multisample:st.multisample}),ut=!0,rt&&(TEMP_RECT.width=rt.width,TEMP_RECT.height=rt.height,rt=TEMP_RECT)));const ct=st.gl;if(lt){if(nt=lt.baseTexture.resolution,rt=rt??lt.frame,ot=!1,at=lt.baseTexture.alphaMode>0&<.baseTexture.format===FORMATS.RGBA,!ut){st.renderTexture.bind(lt);const xt=lt.framebuffer.glFramebuffers[st.CONTEXT_UID];xt.blitFramebuffer&&st.framebuffer.bind(xt.blitFramebuffer)}}else nt=st.resolution,rt||(rt=TEMP_RECT,rt.width=st.width/nt,rt.height=st.height/nt),ot=!0,at=this._rendererPremultipliedAlpha,st.renderTexture.bind();const dt=Math.max(Math.round(rt.width*nt),1),ht=Math.max(Math.round(rt.height*nt),1),ft=new Uint8Array(BYTES_PER_PIXEL*dt*ht);return ct.readPixels(Math.round(rt.x*nt),Math.round(rt.y*nt),dt,ht,ct.RGBA,ct.UNSIGNED_BYTE,ft),ut&&(lt==null||lt.destroy(!0)),{pixels:ft,width:dt,height:ht,flipY:ot,premultipliedAlpha:at}}destroy(){this.renderer=null}static _flipY(et,rt,st){const nt=rt<<2,ot=st>>1,at=new Uint8Array(nt);for(let lt=0;lt<ot;lt++){const ut=lt*nt,ct=(st-lt-1)*nt;at.set(et.subarray(ut,ut+nt)),et.copyWithin(ut,ct,ct+nt),et.set(at,ct)}}static _unpremultiplyAlpha(et){et instanceof Uint8ClampedArray&&(et=new Uint8Array(et.buffer));const rt=et.length;for(let st=0;st<rt;st+=4){const nt=et[st+3];if(nt!==0){const ot=255.001/nt;et[st]=et[st]*ot+.5,et[st+1]=et[st+1]*ot+.5,et[st+2]=et[st+2]*ot+.5}}}};_Extract.extension={name:"extract",type:ExtensionType.RendererSystem};let Extract=_Extract;extensions$1.add(Extract);class CountLimiter{constructor(et){this.maxItemsPerFrame=et,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function findMultipleBaseTextures(tt,et){var st;let rt=!1;if((st=tt==null?void 0:tt._textures)!=null&&st.length){for(let nt=0;nt<tt._textures.length;nt++)if(tt._textures[nt]instanceof Texture){const ot=tt._textures[nt].baseTexture;et.includes(ot)||(et.push(ot),rt=!0)}}return rt}function findBaseTexture(tt,et){if(tt.baseTexture instanceof BaseTexture){const rt=tt.baseTexture;return et.includes(rt)||et.push(rt),!0}return!1}function findTexture(tt,et){if(tt._texture&&tt._texture instanceof Texture){const rt=tt._texture.baseTexture;return et.includes(rt)||et.push(rt),!0}return!1}function drawText(tt,et){return et instanceof Text$2?(et.updateText(!0),!0):!1}function calculateTextStyle(tt,et){if(et instanceof TextStyle){const rt=et.toFontString();return TextMetrics.measureFont(rt),!0}return!1}function findText(tt,et){if(tt instanceof Text$2){et.includes(tt.style)||et.push(tt.style),et.includes(tt)||et.push(tt);const rt=tt._texture.baseTexture;return et.includes(rt)||et.push(rt),!0}return!1}function findTextStyle(tt,et){return tt instanceof TextStyle?(et.includes(tt)||et.push(tt),!0):!1}const _BasePrepare=class um{constructor(et){this.limiter=new CountLimiter(um.uploadsPerFrame),this.renderer=et,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(findText),this.registerFindHook(findTextStyle),this.registerFindHook(findMultipleBaseTextures),this.registerFindHook(findBaseTexture),this.registerFindHook(findTexture),this.registerUploadHook(drawText),this.registerUploadHook(calculateTextStyle)}upload(et){return new Promise(rt=>{et&&this.add(et),this.queue.length?(this.completes.push(rt),this.ticking||(this.ticking=!0,Ticker.system.addOnce(this.tick,this,UPDATE_PRIORITY.UTILITY))):rt()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const et=this.queue[0];let rt=!1;if(et&&!et._destroyed){for(let st=0,nt=this.uploadHooks.length;st<nt;st++)if(this.uploadHooks[st](this.uploadHookHelper,et)){this.queue.shift(),rt=!0;break}}rt||this.queue.shift()}if(this.queue.length)Ticker.system.addOnce(this.tick,this,UPDATE_PRIORITY.UTILITY);else{this.ticking=!1;const et=this.completes.slice(0);this.completes.length=0;for(let rt=0,st=et.length;rt<st;rt++)et[rt]()}}registerFindHook(et){return et&&this.addHooks.push(et),this}registerUploadHook(et){return et&&this.uploadHooks.push(et),this}add(et){for(let rt=0,st=this.addHooks.length;rt<st&&!this.addHooks[rt](et,this.queue);rt++);if(et instanceof Container)for(let rt=et.children.length-1;rt>=0;rt--)this.add(et.children[rt]);return this}destroy(){this.ticking&&Ticker.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};_BasePrepare.uploadsPerFrame=4;let BasePrepare=_BasePrepare;Object.defineProperties(settings,{UPLOADS_PER_FRAME:{get(){return BasePrepare.uploadsPerFrame},set(tt){deprecation("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),BasePrepare.uploadsPerFrame=tt}}});function uploadBaseTextures(tt,et){return et instanceof BaseTexture?(et._glTextures[tt.CONTEXT_UID]||tt.texture.bind(et),!0):!1}function uploadGraphics(tt,et){if(!(et instanceof Graphics))return!1;const{geometry:rt}=et;et.finishPoly(),rt.updateBatches();const{batches:st}=rt;for(let nt=0;nt<st.length;nt++){const{texture:ot}=st[nt].style;ot&&uploadBaseTextures(tt,ot.baseTexture)}return rt.batchable||tt.geometry.bind(rt,et._resolveDirectShader(tt)),!0}function findGraphics(tt,et){return tt instanceof Graphics?(et.push(tt),!0):!1}class Prepare extends BasePrepare{constructor(et){super(et),this.uploadHookHelper=this.renderer,this.registerFindHook(findGraphics),this.registerUploadHook(uploadBaseTextures),this.registerUploadHook(uploadGraphics)}}Prepare.extension={name:"prepare",type:ExtensionType.RendererSystem};extensions$1.add(Prepare);const _Spritesheet=class ku{constructor(et,rt,st){this.linkedSheets=[],(et instanceof BaseTexture||et instanceof Texture)&&(et={texture:et,data:rt,resolutionFilename:st});const{texture:nt,data:ot,resolutionFilename:at=null,cachePrefix:lt=""}=et;this.cachePrefix=lt,this._texture=nt instanceof Texture?nt:null,this.baseTexture=nt instanceof BaseTexture?nt:this._texture.baseTexture,this.textures={},this.animations={},this.data=ot;const ut=this.baseTexture.resource;this.resolution=this._updateResolution(at||(ut?ut.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(et=null){const{scale:rt}=this.data.meta;let st=getResolutionOfUrl(et,null);return st===null&&(st=typeof rt=="number"?rt:parseFloat(rt??"1")),st!==1&&this.baseTexture.setResolution(st),st}parse(){return new Promise(et=>{this._callback=et,this._batchIndex=0,this._frameKeys.length<=ku.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(et){let rt=et;const st=ku.BATCH_SIZE;for(;rt-et<st&&rt<this._frameKeys.length;){const nt=this._frameKeys[rt],ot=this._frames[nt],at=ot.frame;if(at){let lt=null,ut=null;const ct=ot.trimmed!==!1&&ot.sourceSize?ot.sourceSize:ot.frame,dt=new Rectangle(0,0,Math.floor(ct.w)/this.resolution,Math.floor(ct.h)/this.resolution);ot.rotated?lt=new Rectangle(Math.floor(at.x)/this.resolution,Math.floor(at.y)/this.resolution,Math.floor(at.h)/this.resolution,Math.floor(at.w)/this.resolution):lt=new Rectangle(Math.floor(at.x)/this.resolution,Math.floor(at.y)/this.resolution,Math.floor(at.w)/this.resolution,Math.floor(at.h)/this.resolution),ot.trimmed!==!1&&ot.spriteSourceSize&&(ut=new Rectangle(Math.floor(ot.spriteSourceSize.x)/this.resolution,Math.floor(ot.spriteSourceSize.y)/this.resolution,Math.floor(at.w)/this.resolution,Math.floor(at.h)/this.resolution)),this.textures[nt]=new Texture(this.baseTexture,lt,dt,ut,ot.rotated?2:0,ot.anchor,ot.borders),Texture.addToCache(this.textures[nt],this.cachePrefix+nt.toString())}rt++}}_processAnimations(){const et=this.data.animations||{};for(const rt in et){this.animations[rt]=[];for(let st=0;st<et[rt].length;st++){const nt=et[rt][st];this.animations[rt].push(this.textures[nt])}}}_parseComplete(){const et=this._callback;this._callback=null,this._batchIndex=0,et.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*ku.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*ku.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(et=!1){var rt;for(const st in this.textures)this.textures[st].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,et&&((rt=this._texture)==null||rt.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};_Spritesheet.BATCH_SIZE=1e3;let Spritesheet=_Spritesheet;const validImages=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function getCacheableAssets(tt,et,rt){const st={};if(tt.forEach(nt=>{st[nt]=et}),Object.keys(et.textures).forEach(nt=>{st[`${et.cachePrefix}${nt}`]=et.textures[nt]}),!rt){const nt=path.dirname(tt[0]);et.linkedSheets.forEach((ot,at)=>{Object.assign(st,getCacheableAssets([`${nt}/${et.data.meta.related_multi_packs[at]}`],ot,!0))})}return st}const spritesheetAsset={extension:ExtensionType.Asset,cache:{test:tt=>tt instanceof Spritesheet,getCacheableAssets:(tt,et)=>getCacheableAssets(tt,et,!1)},resolver:{test:tt=>{const et=tt.split("?")[0].split("."),rt=et.pop(),st=et.pop();return rt==="json"&&validImages.includes(st)},parse:tt=>{var rt;const et=tt.split(".");return{resolution:parseFloat(((rt=settings.RETINA_PREFIX.exec(tt))==null?void 0:rt[1])??"1"),format:et[et.length-2],src:tt}}},loader:{name:"spritesheetLoader",extension:{type:ExtensionType.LoadParser,priority:LoaderParserPriority.Normal},async testParse(tt,et){return path.extname(et.src).toLowerCase()===".json"&&!!tt.frames},async parse(tt,et,rt){var dt,ht;const{texture:st,imageFilename:nt,cachePrefix:ot}=(et==null?void 0:et.data)??{};let at=path.dirname(et.src);at&&at.lastIndexOf("/")!==at.length-1&&(at+="/");let lt;if(st&&st.baseTexture)lt=st;else{const ft=copySearchParams(at+(nt??tt.meta.image),et.src);lt=(await rt.load([ft]))[ft]}const ut=new Spritesheet({texture:lt.baseTexture,data:tt,resolutionFilename:et.src,cachePrefix:ot});await ut.parse();const ct=(dt=tt==null?void 0:tt.meta)==null?void 0:dt.related_multi_packs;if(Array.isArray(ct)){const ft=[];for(const vt of ct){if(typeof vt!="string")continue;let yt=at+vt;(ht=et.data)!=null&&ht.ignoreMultiPack||(yt=copySearchParams(yt,et.src),ft.push(rt.load({src:yt,data:{ignoreMultiPack:!0}})))}const xt=await Promise.all(ft);ut.linkedSheets=xt,xt.forEach(vt=>{vt.linkedSheets=[ut].concat(ut.linkedSheets.filter(yt=>yt!==vt))})}return ut},unload(tt){tt.destroy(!0)}}};extensions$1.add(spritesheetAsset);const _HTMLTextStyle=class Kl extends TextStyle{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(et){return new Kl(Object.keys(Kl.defaultOptions).reduce((rt,st)=>({...rt,[st]:et[st]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(et=>{URL.revokeObjectURL(et.src),et.refs--,et.refs===0&&(et.fontFace&&document.fonts.delete(et.fontFace),delete Kl.availableFonts[et.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(et,rt={}){const{availableFonts:st}=Kl;if(st[et]){const nt=st[et];return this._fonts.push(nt),nt.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return settings.ADAPTER.fetch(et).then(nt=>nt.blob()).then(async nt=>new Promise((ot,at)=>{const lt=URL.createObjectURL(nt),ut=new FileReader;ut.onload=()=>ot([lt,ut.result]),ut.onerror=at,ut.readAsDataURL(nt)})).then(async([nt,ot])=>{const at=Object.assign({family:path.basename(et,path.extname(et)),weight:"normal",style:"normal",display:"auto",src:nt,dataSrc:ot,refs:1,originalUrl:et,fontFace:null},rt);st[et]=at,this._fonts.push(at),this.styleID++;const lt=new FontFace(at.family,`url(${at.src})`,{weight:at.weight,style:at.style,display:at.display});at.fontFace=lt,await lt.load(),document.fonts.add(lt),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...et){const rt=et.filter(st=>!this._overrides.includes(st));rt.length>0&&(this._overrides.push(...rt),this.styleID++)}removeOverride(...et){const rt=et.filter(st=>this._overrides.includes(st));rt.length>0&&(this._overrides=this._overrides.filter(st=>!rt.includes(st)),this.styleID++)}toCSS(et){return[`transform: scale(${et})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((et,rt)=>`${et}
|
|
1384
|
+
`;class NoiseFilter extends Filter{constructor(et=.5,rt=Math.random()){super(defaultFilterVertex,fragment,{uNoise:0,uSeed:0}),this.noise=et,this.seed=rt}get noise(){return this.uniforms.uNoise}set noise(et){this.uniforms.uNoise=et}get seed(){return this.uniforms.uSeed}set seed(et){this.uniforms.uSeed=et}}const filters={AlphaFilter,BlurFilter,BlurFilterPass,ColorMatrixFilter,DisplacementFilter,FXAAFilter,NoiseFilter};Object.entries(filters).forEach(([tt,et])=>{Object.defineProperty(filters,tt,{get(){return deprecation("7.1.0",`filters.${tt} has moved to ${tt}`),et}})});class EventsTickerClass{constructor(){this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}init(et){this.removeTickerListener(),this.events=et,this.interactionFrequency=10,this._deltaTime=0,this._didMove=!1,this.tickerAdded=!1,this._pauseUpdate=!0}get pauseUpdate(){return this._pauseUpdate}set pauseUpdate(et){this._pauseUpdate=et}addTickerListener(){this.tickerAdded||!this.domElement||(Ticker.system.add(this.tickerUpdate,this,UPDATE_PRIORITY.INTERACTION),this.tickerAdded=!0)}removeTickerListener(){this.tickerAdded&&(Ticker.system.remove(this.tickerUpdate,this),this.tickerAdded=!1)}pointerMoved(){this._didMove=!0}update(){if(!this.domElement||this._pauseUpdate)return;if(this._didMove){this._didMove=!1;return}const et=this.events.rootPointerEvent;this.events.supportsTouchEvents&&et.pointerType==="touch"||globalThis.document.dispatchEvent(new PointerEvent("pointermove",{clientX:et.clientX,clientY:et.clientY}))}tickerUpdate(et){this._deltaTime+=et,!(this._deltaTime<this.interactionFrequency)&&(this._deltaTime=0,this.update())}}const EventsTicker=new EventsTickerClass;class FederatedEvent{constructor(et){this.bubbles=!0,this.cancelBubble=!0,this.cancelable=!1,this.composed=!1,this.defaultPrevented=!1,this.eventPhase=FederatedEvent.prototype.NONE,this.propagationStopped=!1,this.propagationImmediatelyStopped=!1,this.layer=new Point,this.page=new Point,this.NONE=0,this.CAPTURING_PHASE=1,this.AT_TARGET=2,this.BUBBLING_PHASE=3,this.manager=et}get layerX(){return this.layer.x}get layerY(){return this.layer.y}get pageX(){return this.page.x}get pageY(){return this.page.y}get data(){return this}composedPath(){return this.manager&&(!this.path||this.path[this.path.length-1]!==this.target)&&(this.path=this.target?this.manager.propagationPath(this.target):[]),this.path}initEvent(et,rt,st){throw new Error("initEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}initUIEvent(et,rt,st,nt,ot){throw new Error("initUIEvent() is a legacy DOM API. It is not implemented in the Federated Events API.")}preventDefault(){this.nativeEvent instanceof Event&&this.nativeEvent.cancelable&&this.nativeEvent.preventDefault(),this.defaultPrevented=!0}stopImmediatePropagation(){this.propagationImmediatelyStopped=!0}stopPropagation(){this.propagationStopped=!0}}class FederatedMouseEvent extends FederatedEvent{constructor(){super(...arguments),this.client=new Point,this.movement=new Point,this.offset=new Point,this.global=new Point,this.screen=new Point}get clientX(){return this.client.x}get clientY(){return this.client.y}get x(){return this.clientX}get y(){return this.clientY}get movementX(){return this.movement.x}get movementY(){return this.movement.y}get offsetX(){return this.offset.x}get offsetY(){return this.offset.y}get globalX(){return this.global.x}get globalY(){return this.global.y}get screenX(){return this.screen.x}get screenY(){return this.screen.y}getLocalPosition(et,rt,st){return et.worldTransform.applyInverse(st||this.global,rt)}getModifierState(et){return"getModifierState"in this.nativeEvent&&this.nativeEvent.getModifierState(et)}initMouseEvent(et,rt,st,nt,ot,at,lt,ut,ct,dt,ht,ft,xt,vt,yt){throw new Error("Method not implemented.")}}class FederatedPointerEvent extends FederatedMouseEvent{constructor(){super(...arguments),this.width=0,this.height=0,this.isPrimary=!1}getCoalescedEvents(){return this.type==="pointermove"||this.type==="mousemove"||this.type==="touchmove"?[this]:[]}getPredictedEvents(){throw new Error("getPredictedEvents is not supported!")}}class FederatedWheelEvent extends FederatedMouseEvent{constructor(){super(...arguments),this.DOM_DELTA_PIXEL=0,this.DOM_DELTA_LINE=1,this.DOM_DELTA_PAGE=2}}FederatedWheelEvent.DOM_DELTA_PIXEL=0,FederatedWheelEvent.DOM_DELTA_LINE=1,FederatedWheelEvent.DOM_DELTA_PAGE=2;const PROPAGATION_LIMIT=2048,tempHitLocation=new Point,tempLocalMapping=new Point;class EventBoundary{constructor(et){this.dispatch=new EventEmitter,this.moveOnAll=!1,this.enableGlobalMoveEvents=!0,this.mappingState={trackingData:{}},this.eventPool=new Map,this._allInteractiveElements=[],this._hitElements=[],this._isPointerMoveEvent=!1,this.rootTarget=et,this.hitPruneFn=this.hitPruneFn.bind(this),this.hitTestFn=this.hitTestFn.bind(this),this.mapPointerDown=this.mapPointerDown.bind(this),this.mapPointerMove=this.mapPointerMove.bind(this),this.mapPointerOut=this.mapPointerOut.bind(this),this.mapPointerOver=this.mapPointerOver.bind(this),this.mapPointerUp=this.mapPointerUp.bind(this),this.mapPointerUpOutside=this.mapPointerUpOutside.bind(this),this.mapWheel=this.mapWheel.bind(this),this.mappingTable={},this.addEventMapping("pointerdown",this.mapPointerDown),this.addEventMapping("pointermove",this.mapPointerMove),this.addEventMapping("pointerout",this.mapPointerOut),this.addEventMapping("pointerleave",this.mapPointerOut),this.addEventMapping("pointerover",this.mapPointerOver),this.addEventMapping("pointerup",this.mapPointerUp),this.addEventMapping("pointerupoutside",this.mapPointerUpOutside),this.addEventMapping("wheel",this.mapWheel)}addEventMapping(et,rt){this.mappingTable[et]||(this.mappingTable[et]=[]),this.mappingTable[et].push({fn:rt,priority:0}),this.mappingTable[et].sort((st,nt)=>st.priority-nt.priority)}dispatchEvent(et,rt){et.propagationStopped=!1,et.propagationImmediatelyStopped=!1,this.propagate(et,rt),this.dispatch.emit(rt||et.type,et)}mapEvent(et){if(!this.rootTarget)return;const rt=this.mappingTable[et.type];if(rt)for(let st=0,nt=rt.length;st<nt;st++)rt[st].fn(et);else console.warn(`[EventBoundary]: Event mapping not defined for ${et.type}`)}hitTest(et,rt){EventsTicker.pauseUpdate=!0;const st=this._isPointerMoveEvent&&this.enableGlobalMoveEvents?"hitTestMoveRecursive":"hitTestRecursive",nt=this[st](this.rootTarget,this.rootTarget.eventMode,tempHitLocation.set(et,rt),this.hitTestFn,this.hitPruneFn);return nt&&nt[0]}propagate(et,rt){if(!et.target)return;const st=et.composedPath();et.eventPhase=et.CAPTURING_PHASE;for(let nt=0,ot=st.length-1;nt<ot;nt++)if(et.currentTarget=st[nt],this.notifyTarget(et,rt),et.propagationStopped||et.propagationImmediatelyStopped)return;if(et.eventPhase=et.AT_TARGET,et.currentTarget=et.target,this.notifyTarget(et,rt),!(et.propagationStopped||et.propagationImmediatelyStopped)){et.eventPhase=et.BUBBLING_PHASE;for(let nt=st.length-2;nt>=0;nt--)if(et.currentTarget=st[nt],this.notifyTarget(et,rt),et.propagationStopped||et.propagationImmediatelyStopped)return}}all(et,rt,st=this._allInteractiveElements){if(st.length===0)return;et.eventPhase=et.BUBBLING_PHASE;const nt=Array.isArray(rt)?rt:[rt];for(let ot=st.length-1;ot>=0;ot--)nt.forEach(at=>{et.currentTarget=st[ot],this.notifyTarget(et,at)})}propagationPath(et){const rt=[et];for(let st=0;st<PROPAGATION_LIMIT&&et!==this.rootTarget;st++){if(!et.parent)throw new Error("Cannot find propagation path to disconnected target");rt.push(et.parent),et=et.parent}return rt.reverse(),rt}hitTestMoveRecursive(et,rt,st,nt,ot,at=!1){let lt=!1;if(this._interactivePrune(et))return null;if((et.eventMode==="dynamic"||rt==="dynamic")&&(EventsTicker.pauseUpdate=!1),et.interactiveChildren&&et.children){const dt=et.children;for(let ht=dt.length-1;ht>=0;ht--){const ft=dt[ht],xt=this.hitTestMoveRecursive(ft,this._isInteractive(rt)?rt:ft.eventMode,st,nt,ot,at||ot(et,st));if(xt){if(xt.length>0&&!xt[xt.length-1].parent)continue;const vt=et.isInteractive();(xt.length>0||vt)&&(vt&&this._allInteractiveElements.push(et),xt.push(et)),this._hitElements.length===0&&(this._hitElements=xt),lt=!0}}}const ut=this._isInteractive(rt),ct=et.isInteractive();return ut&&ct&&this._allInteractiveElements.push(et),at||this._hitElements.length>0?null:lt?this._hitElements:ut&&!ot(et,st)&&nt(et,st)?ct?[et]:[]:null}hitTestRecursive(et,rt,st,nt,ot){if(this._interactivePrune(et)||ot(et,st))return null;if((et.eventMode==="dynamic"||rt==="dynamic")&&(EventsTicker.pauseUpdate=!1),et.interactiveChildren&&et.children){const ut=et.children;for(let ct=ut.length-1;ct>=0;ct--){const dt=ut[ct],ht=this.hitTestRecursive(dt,this._isInteractive(rt)?rt:dt.eventMode,st,nt,ot);if(ht){if(ht.length>0&&!ht[ht.length-1].parent)continue;const ft=et.isInteractive();return(ht.length>0||ft)&&ht.push(et),ht}}}const at=this._isInteractive(rt),lt=et.isInteractive();return at&&nt(et,st)?lt?[et]:[]:null}_isInteractive(et){return et==="static"||et==="dynamic"}_interactivePrune(et){return!!(!et||et.isMask||!et.visible||!et.renderable||et.eventMode==="none"||et.eventMode==="passive"&&!et.interactiveChildren||et.isMask)}hitPruneFn(et,rt){var st;if(et.hitArea&&(et.worldTransform.applyInverse(rt,tempLocalMapping),!et.hitArea.contains(tempLocalMapping.x,tempLocalMapping.y)))return!0;if(et._mask){const nt=et._mask.isMaskData?et._mask.maskObject:et._mask;if(nt&&!((st=nt.containsPoint)!=null&&st.call(nt,rt)))return!0}return!1}hitTestFn(et,rt){return et.eventMode==="passive"?!1:et.hitArea?!0:et.containsPoint?et.containsPoint(rt):!1}notifyTarget(et,rt){var ot,at;rt=rt??et.type;const st=`on${rt}`;(at=(ot=et.currentTarget)[st])==null||at.call(ot,et);const nt=et.eventPhase===et.CAPTURING_PHASE||et.eventPhase===et.AT_TARGET?`${rt}capture`:rt;this.notifyListeners(et,nt),et.eventPhase===et.AT_TARGET&&this.notifyListeners(et,rt)}mapPointerDown(et){if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=this.createPointerEvent(et);if(this.dispatchEvent(rt,"pointerdown"),rt.pointerType==="touch")this.dispatchEvent(rt,"touchstart");else if(rt.pointerType==="mouse"||rt.pointerType==="pen"){const nt=rt.button===2;this.dispatchEvent(rt,nt?"rightdown":"mousedown")}const st=this.trackingData(et.pointerId);st.pressTargetsByButton[et.button]=rt.composedPath(),this.freeEvent(rt)}mapPointerMove(et){var ut,ct;if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}this._allInteractiveElements.length=0,this._hitElements.length=0,this._isPointerMoveEvent=!0;const rt=this.createPointerEvent(et);this._isPointerMoveEvent=!1;const st=rt.pointerType==="mouse"||rt.pointerType==="pen",nt=this.trackingData(et.pointerId),ot=this.findMountedTarget(nt.overTargets);if(((ut=nt.overTargets)==null?void 0:ut.length)>0&&ot!==rt.target){const dt=et.type==="mousemove"?"mouseout":"pointerout",ht=this.createPointerEvent(et,dt,ot);if(this.dispatchEvent(ht,"pointerout"),st&&this.dispatchEvent(ht,"mouseout"),!rt.composedPath().includes(ot)){const ft=this.createPointerEvent(et,"pointerleave",ot);for(ft.eventPhase=ft.AT_TARGET;ft.target&&!rt.composedPath().includes(ft.target);)ft.currentTarget=ft.target,this.notifyTarget(ft),st&&this.notifyTarget(ft,"mouseleave"),ft.target=ft.target.parent;this.freeEvent(ft)}this.freeEvent(ht)}if(ot!==rt.target){const dt=et.type==="mousemove"?"mouseover":"pointerover",ht=this.clonePointerEvent(rt,dt);this.dispatchEvent(ht,"pointerover"),st&&this.dispatchEvent(ht,"mouseover");let ft=ot==null?void 0:ot.parent;for(;ft&&ft!==this.rootTarget.parent&&ft!==rt.target;)ft=ft.parent;if(!ft||ft===this.rootTarget.parent){const xt=this.clonePointerEvent(rt,"pointerenter");for(xt.eventPhase=xt.AT_TARGET;xt.target&&xt.target!==ot&&xt.target!==this.rootTarget.parent;)xt.currentTarget=xt.target,this.notifyTarget(xt),st&&this.notifyTarget(xt,"mouseenter"),xt.target=xt.target.parent;this.freeEvent(xt)}this.freeEvent(ht)}const at=[],lt=this.enableGlobalMoveEvents??!0;this.moveOnAll?at.push("pointermove"):this.dispatchEvent(rt,"pointermove"),lt&&at.push("globalpointermove"),rt.pointerType==="touch"&&(this.moveOnAll?at.splice(1,0,"touchmove"):this.dispatchEvent(rt,"touchmove"),lt&&at.push("globaltouchmove")),st&&(this.moveOnAll?at.splice(1,0,"mousemove"):this.dispatchEvent(rt,"mousemove"),lt&&at.push("globalmousemove"),this.cursor=(ct=rt.target)==null?void 0:ct.cursor),at.length>0&&this.all(rt,at),this._allInteractiveElements.length=0,this._hitElements.length=0,nt.overTargets=rt.composedPath(),this.freeEvent(rt)}mapPointerOver(et){var at;if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=this.trackingData(et.pointerId),st=this.createPointerEvent(et),nt=st.pointerType==="mouse"||st.pointerType==="pen";this.dispatchEvent(st,"pointerover"),nt&&this.dispatchEvent(st,"mouseover"),st.pointerType==="mouse"&&(this.cursor=(at=st.target)==null?void 0:at.cursor);const ot=this.clonePointerEvent(st,"pointerenter");for(ot.eventPhase=ot.AT_TARGET;ot.target&&ot.target!==this.rootTarget.parent;)ot.currentTarget=ot.target,this.notifyTarget(ot),nt&&this.notifyTarget(ot,"mouseenter"),ot.target=ot.target.parent;rt.overTargets=st.composedPath(),this.freeEvent(st),this.freeEvent(ot)}mapPointerOut(et){if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=this.trackingData(et.pointerId);if(rt.overTargets){const st=et.pointerType==="mouse"||et.pointerType==="pen",nt=this.findMountedTarget(rt.overTargets),ot=this.createPointerEvent(et,"pointerout",nt);this.dispatchEvent(ot),st&&this.dispatchEvent(ot,"mouseout");const at=this.createPointerEvent(et,"pointerleave",nt);for(at.eventPhase=at.AT_TARGET;at.target&&at.target!==this.rootTarget.parent;)at.currentTarget=at.target,this.notifyTarget(at),st&&this.notifyTarget(at,"mouseleave"),at.target=at.target.parent;rt.overTargets=null,this.freeEvent(ot),this.freeEvent(at)}this.cursor=null}mapPointerUp(et){if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=performance.now(),st=this.createPointerEvent(et);if(this.dispatchEvent(st,"pointerup"),st.pointerType==="touch")this.dispatchEvent(st,"touchend");else if(st.pointerType==="mouse"||st.pointerType==="pen"){const lt=st.button===2;this.dispatchEvent(st,lt?"rightup":"mouseup")}const nt=this.trackingData(et.pointerId),ot=this.findMountedTarget(nt.pressTargetsByButton[et.button]);let at=ot;if(ot&&!st.composedPath().includes(ot)){let lt=ot;for(;lt&&!st.composedPath().includes(lt);){if(st.currentTarget=lt,this.notifyTarget(st,"pointerupoutside"),st.pointerType==="touch")this.notifyTarget(st,"touchendoutside");else if(st.pointerType==="mouse"||st.pointerType==="pen"){const ut=st.button===2;this.notifyTarget(st,ut?"rightupoutside":"mouseupoutside")}lt=lt.parent}delete nt.pressTargetsByButton[et.button],at=lt}if(at){const lt=this.clonePointerEvent(st,"click");lt.target=at,lt.path=null,nt.clicksByButton[et.button]||(nt.clicksByButton[et.button]={clickCount:0,target:lt.target,timeStamp:rt});const ut=nt.clicksByButton[et.button];if(ut.target===lt.target&&rt-ut.timeStamp<200?++ut.clickCount:ut.clickCount=1,ut.target=lt.target,ut.timeStamp=rt,lt.detail=ut.clickCount,lt.pointerType==="mouse"){const ct=lt.button===2;this.dispatchEvent(lt,ct?"rightclick":"click")}else lt.pointerType==="touch"&&this.dispatchEvent(lt,"tap");this.dispatchEvent(lt,"pointertap"),this.freeEvent(lt)}this.freeEvent(st)}mapPointerUpOutside(et){if(!(et instanceof FederatedPointerEvent)){console.warn("EventBoundary cannot map a non-pointer event as a pointer event");return}const rt=this.trackingData(et.pointerId),st=this.findMountedTarget(rt.pressTargetsByButton[et.button]),nt=this.createPointerEvent(et);if(st){let ot=st;for(;ot;)nt.currentTarget=ot,this.notifyTarget(nt,"pointerupoutside"),nt.pointerType==="touch"?this.notifyTarget(nt,"touchendoutside"):(nt.pointerType==="mouse"||nt.pointerType==="pen")&&this.notifyTarget(nt,nt.button===2?"rightupoutside":"mouseupoutside"),ot=ot.parent;delete rt.pressTargetsByButton[et.button]}this.freeEvent(nt)}mapWheel(et){if(!(et instanceof FederatedWheelEvent)){console.warn("EventBoundary cannot map a non-wheel event as a wheel event");return}const rt=this.createWheelEvent(et);this.dispatchEvent(rt),this.freeEvent(rt)}findMountedTarget(et){if(!et)return null;let rt=et[0];for(let st=1;st<et.length&&et[st].parent===rt;st++)rt=et[st];return rt}createPointerEvent(et,rt,st){const nt=this.allocateEvent(FederatedPointerEvent);return this.copyPointerData(et,nt),this.copyMouseData(et,nt),this.copyData(et,nt),nt.nativeEvent=et.nativeEvent,nt.originalEvent=et,nt.target=st??this.hitTest(nt.global.x,nt.global.y)??this._hitElements[0],typeof rt=="string"&&(nt.type=rt),nt}createWheelEvent(et){const rt=this.allocateEvent(FederatedWheelEvent);return this.copyWheelData(et,rt),this.copyMouseData(et,rt),this.copyData(et,rt),rt.nativeEvent=et.nativeEvent,rt.originalEvent=et,rt.target=this.hitTest(rt.global.x,rt.global.y),rt}clonePointerEvent(et,rt){const st=this.allocateEvent(FederatedPointerEvent);return st.nativeEvent=et.nativeEvent,st.originalEvent=et.originalEvent,this.copyPointerData(et,st),this.copyMouseData(et,st),this.copyData(et,st),st.target=et.target,st.path=et.composedPath().slice(),st.type=rt??st.type,st}copyWheelData(et,rt){rt.deltaMode=et.deltaMode,rt.deltaX=et.deltaX,rt.deltaY=et.deltaY,rt.deltaZ=et.deltaZ}copyPointerData(et,rt){et instanceof FederatedPointerEvent&&rt instanceof FederatedPointerEvent&&(rt.pointerId=et.pointerId,rt.width=et.width,rt.height=et.height,rt.isPrimary=et.isPrimary,rt.pointerType=et.pointerType,rt.pressure=et.pressure,rt.tangentialPressure=et.tangentialPressure,rt.tiltX=et.tiltX,rt.tiltY=et.tiltY,rt.twist=et.twist)}copyMouseData(et,rt){et instanceof FederatedMouseEvent&&rt instanceof FederatedMouseEvent&&(rt.altKey=et.altKey,rt.button=et.button,rt.buttons=et.buttons,rt.client.copyFrom(et.client),rt.ctrlKey=et.ctrlKey,rt.metaKey=et.metaKey,rt.movement.copyFrom(et.movement),rt.screen.copyFrom(et.screen),rt.shiftKey=et.shiftKey,rt.global.copyFrom(et.global))}copyData(et,rt){rt.isTrusted=et.isTrusted,rt.srcElement=et.srcElement,rt.timeStamp=performance.now(),rt.type=et.type,rt.detail=et.detail,rt.view=et.view,rt.which=et.which,rt.layer.copyFrom(et.layer),rt.page.copyFrom(et.page)}trackingData(et){return this.mappingState.trackingData[et]||(this.mappingState.trackingData[et]={pressTargetsByButton:{},clicksByButton:{},overTarget:null}),this.mappingState.trackingData[et]}allocateEvent(et){this.eventPool.has(et)||this.eventPool.set(et,[]);const rt=this.eventPool.get(et).pop()||new et(this);return rt.eventPhase=rt.NONE,rt.currentTarget=null,rt.path=null,rt.target=null,rt}freeEvent(et){if(et.manager!==this)throw new Error("It is illegal to free an event not managed by this EventBoundary!");const rt=et.constructor;this.eventPool.has(rt)||this.eventPool.set(rt,[]),this.eventPool.get(rt).push(et)}notifyListeners(et,rt){const st=et.currentTarget._events[rt];if(st&&et.currentTarget.isInteractive())if("fn"in st)st.once&&et.currentTarget.removeListener(rt,st.fn,void 0,!0),st.fn.call(st.context,et);else for(let nt=0,ot=st.length;nt<ot&&!et.propagationImmediatelyStopped;nt++)st[nt].once&&et.currentTarget.removeListener(rt,st[nt].fn,void 0,!0),st[nt].fn.call(st[nt].context,et)}}const MOUSE_POINTER_ID=1,TOUCH_TO_POINTER={touchstart:"pointerdown",touchend:"pointerup",touchendoutside:"pointerupoutside",touchmove:"pointermove",touchcancel:"pointercancel"},_EventSystem=class a2{constructor(et){this.supportsTouchEvents="ontouchstart"in globalThis,this.supportsPointerEvents=!!globalThis.PointerEvent,this.domElement=null,this.resolution=1,this.renderer=et,this.rootBoundary=new EventBoundary(null),EventsTicker.init(this),this.autoPreventDefault=!0,this.eventsAdded=!1,this.rootPointerEvent=new FederatedPointerEvent(null),this.rootWheelEvent=new FederatedWheelEvent(null),this.cursorStyles={default:"inherit",pointer:"pointer"},this.features=new Proxy({...a2.defaultEventFeatures},{set:(rt,st,nt)=>(st==="globalMove"&&(this.rootBoundary.enableGlobalMoveEvents=nt),rt[st]=nt,!0)}),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOverOut=this.onPointerOverOut.bind(this),this.onWheel=this.onWheel.bind(this)}static get defaultEventMode(){return this._defaultEventMode}init(et){const{view:rt,resolution:st}=this.renderer;this.setTargetElement(rt),this.resolution=st,a2._defaultEventMode=et.eventMode??"auto",Object.assign(this.features,et.eventFeatures??{}),this.rootBoundary.enableGlobalMoveEvents=this.features.globalMove}resolutionChange(et){this.resolution=et}destroy(){this.setTargetElement(null),this.renderer=null}setCursor(et){et=et||"default";let rt=!0;if(globalThis.OffscreenCanvas&&this.domElement instanceof OffscreenCanvas&&(rt=!1),this.currentCursor===et)return;this.currentCursor=et;const st=this.cursorStyles[et];if(st)switch(typeof st){case"string":rt&&(this.domElement.style.cursor=st);break;case"function":st(et);break;case"object":rt&&Object.assign(this.domElement.style,st);break}else rt&&typeof et=="string"&&!Object.prototype.hasOwnProperty.call(this.cursorStyles,et)&&(this.domElement.style.cursor=et)}get pointer(){return this.rootPointerEvent}onPointerDown(et){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const rt=this.normalizeToPointerData(et);this.autoPreventDefault&&rt[0].isNormalized&&(et.cancelable||!("cancelable"in et))&&et.preventDefault();for(let st=0,nt=rt.length;st<nt;st++){const ot=rt[st],at=this.bootstrapEvent(this.rootPointerEvent,ot);this.rootBoundary.mapEvent(at)}this.setCursor(this.rootBoundary.cursor)}onPointerMove(et){if(!this.features.move)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,EventsTicker.pointerMoved();const rt=this.normalizeToPointerData(et);for(let st=0,nt=rt.length;st<nt;st++){const ot=this.bootstrapEvent(this.rootPointerEvent,rt[st]);this.rootBoundary.mapEvent(ot)}this.setCursor(this.rootBoundary.cursor)}onPointerUp(et){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;let rt=et.target;et.composedPath&&et.composedPath().length>0&&(rt=et.composedPath()[0]);const st=rt!==this.domElement?"outside":"",nt=this.normalizeToPointerData(et);for(let ot=0,at=nt.length;ot<at;ot++){const lt=this.bootstrapEvent(this.rootPointerEvent,nt[ot]);lt.type+=st,this.rootBoundary.mapEvent(lt)}this.setCursor(this.rootBoundary.cursor)}onPointerOverOut(et){if(!this.features.click)return;this.rootBoundary.rootTarget=this.renderer.lastObjectRendered;const rt=this.normalizeToPointerData(et);for(let st=0,nt=rt.length;st<nt;st++){const ot=this.bootstrapEvent(this.rootPointerEvent,rt[st]);this.rootBoundary.mapEvent(ot)}this.setCursor(this.rootBoundary.cursor)}onWheel(et){if(!this.features.wheel)return;const rt=this.normalizeWheelEvent(et);this.rootBoundary.rootTarget=this.renderer.lastObjectRendered,this.rootBoundary.mapEvent(rt)}setTargetElement(et){this.removeEvents(),this.domElement=et,EventsTicker.domElement=et,this.addEvents()}addEvents(){if(this.eventsAdded||!this.domElement)return;EventsTicker.addTickerListener();const et=this.domElement.style;et&&(globalThis.navigator.msPointerEnabled?(et.msContentZooming="none",et.msTouchAction="none"):this.supportsPointerEvents&&(et.touchAction="none")),this.supportsPointerEvents?(globalThis.document.addEventListener("pointermove",this.onPointerMove,!0),this.domElement.addEventListener("pointerdown",this.onPointerDown,!0),this.domElement.addEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.addEventListener("pointerover",this.onPointerOverOut,!0),globalThis.addEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.addEventListener("mousemove",this.onPointerMove,!0),this.domElement.addEventListener("mousedown",this.onPointerDown,!0),this.domElement.addEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.addEventListener("mouseover",this.onPointerOverOut,!0),globalThis.addEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.addEventListener("touchstart",this.onPointerDown,!0),this.domElement.addEventListener("touchend",this.onPointerUp,!0),this.domElement.addEventListener("touchmove",this.onPointerMove,!0))),this.domElement.addEventListener("wheel",this.onWheel,{passive:!0,capture:!0}),this.eventsAdded=!0}removeEvents(){if(!this.eventsAdded||!this.domElement)return;EventsTicker.removeTickerListener();const et=this.domElement.style;globalThis.navigator.msPointerEnabled?(et.msContentZooming="",et.msTouchAction=""):this.supportsPointerEvents&&(et.touchAction=""),this.supportsPointerEvents?(globalThis.document.removeEventListener("pointermove",this.onPointerMove,!0),this.domElement.removeEventListener("pointerdown",this.onPointerDown,!0),this.domElement.removeEventListener("pointerleave",this.onPointerOverOut,!0),this.domElement.removeEventListener("pointerover",this.onPointerOverOut,!0),globalThis.removeEventListener("pointerup",this.onPointerUp,!0)):(globalThis.document.removeEventListener("mousemove",this.onPointerMove,!0),this.domElement.removeEventListener("mousedown",this.onPointerDown,!0),this.domElement.removeEventListener("mouseout",this.onPointerOverOut,!0),this.domElement.removeEventListener("mouseover",this.onPointerOverOut,!0),globalThis.removeEventListener("mouseup",this.onPointerUp,!0),this.supportsTouchEvents&&(this.domElement.removeEventListener("touchstart",this.onPointerDown,!0),this.domElement.removeEventListener("touchend",this.onPointerUp,!0),this.domElement.removeEventListener("touchmove",this.onPointerMove,!0))),this.domElement.removeEventListener("wheel",this.onWheel,!0),this.domElement=null,this.eventsAdded=!1}mapPositionToPoint(et,rt,st){const nt=this.domElement.isConnected?this.domElement.getBoundingClientRect():{width:this.domElement.width,height:this.domElement.height,left:0,top:0},ot=1/this.resolution;et.x=(rt-nt.left)*(this.domElement.width/nt.width)*ot,et.y=(st-nt.top)*(this.domElement.height/nt.height)*ot}normalizeToPointerData(et){const rt=[];if(this.supportsTouchEvents&&et instanceof TouchEvent)for(let st=0,nt=et.changedTouches.length;st<nt;st++){const ot=et.changedTouches[st];typeof ot.button>"u"&&(ot.button=0),typeof ot.buttons>"u"&&(ot.buttons=1),typeof ot.isPrimary>"u"&&(ot.isPrimary=et.touches.length===1&&et.type==="touchstart"),typeof ot.width>"u"&&(ot.width=ot.radiusX||1),typeof ot.height>"u"&&(ot.height=ot.radiusY||1),typeof ot.tiltX>"u"&&(ot.tiltX=0),typeof ot.tiltY>"u"&&(ot.tiltY=0),typeof ot.pointerType>"u"&&(ot.pointerType="touch"),typeof ot.pointerId>"u"&&(ot.pointerId=ot.identifier||0),typeof ot.pressure>"u"&&(ot.pressure=ot.force||.5),typeof ot.twist>"u"&&(ot.twist=0),typeof ot.tangentialPressure>"u"&&(ot.tangentialPressure=0),typeof ot.layerX>"u"&&(ot.layerX=ot.offsetX=ot.clientX),typeof ot.layerY>"u"&&(ot.layerY=ot.offsetY=ot.clientY),ot.isNormalized=!0,ot.type=et.type,rt.push(ot)}else if(!globalThis.MouseEvent||et instanceof MouseEvent&&(!this.supportsPointerEvents||!(et instanceof globalThis.PointerEvent))){const st=et;typeof st.isPrimary>"u"&&(st.isPrimary=!0),typeof st.width>"u"&&(st.width=1),typeof st.height>"u"&&(st.height=1),typeof st.tiltX>"u"&&(st.tiltX=0),typeof st.tiltY>"u"&&(st.tiltY=0),typeof st.pointerType>"u"&&(st.pointerType="mouse"),typeof st.pointerId>"u"&&(st.pointerId=MOUSE_POINTER_ID),typeof st.pressure>"u"&&(st.pressure=.5),typeof st.twist>"u"&&(st.twist=0),typeof st.tangentialPressure>"u"&&(st.tangentialPressure=0),st.isNormalized=!0,rt.push(st)}else rt.push(et);return rt}normalizeWheelEvent(et){const rt=this.rootWheelEvent;return this.transferMouseData(rt,et),rt.deltaX=et.deltaX,rt.deltaY=et.deltaY,rt.deltaZ=et.deltaZ,rt.deltaMode=et.deltaMode,this.mapPositionToPoint(rt.screen,et.clientX,et.clientY),rt.global.copyFrom(rt.screen),rt.offset.copyFrom(rt.screen),rt.nativeEvent=et,rt.type=et.type,rt}bootstrapEvent(et,rt){return et.originalEvent=null,et.nativeEvent=rt,et.pointerId=rt.pointerId,et.width=rt.width,et.height=rt.height,et.isPrimary=rt.isPrimary,et.pointerType=rt.pointerType,et.pressure=rt.pressure,et.tangentialPressure=rt.tangentialPressure,et.tiltX=rt.tiltX,et.tiltY=rt.tiltY,et.twist=rt.twist,this.transferMouseData(et,rt),this.mapPositionToPoint(et.screen,rt.clientX,rt.clientY),et.global.copyFrom(et.screen),et.offset.copyFrom(et.screen),et.isTrusted=rt.isTrusted,et.type==="pointerleave"&&(et.type="pointerout"),et.type.startsWith("mouse")&&(et.type=et.type.replace("mouse","pointer")),et.type.startsWith("touch")&&(et.type=TOUCH_TO_POINTER[et.type]||et.type),et}transferMouseData(et,rt){et.isTrusted=rt.isTrusted,et.srcElement=rt.srcElement,et.timeStamp=performance.now(),et.type=rt.type,et.altKey=rt.altKey,et.button=rt.button,et.buttons=rt.buttons,et.client.x=rt.clientX,et.client.y=rt.clientY,et.ctrlKey=rt.ctrlKey,et.metaKey=rt.metaKey,et.movement.x=rt.movementX,et.movement.y=rt.movementY,et.page.x=rt.pageX,et.page.y=rt.pageY,et.relatedTarget=null,et.shiftKey=rt.shiftKey}};_EventSystem.extension={name:"events",type:[ExtensionType.RendererSystem,ExtensionType.CanvasRendererSystem]},_EventSystem.defaultEventFeatures={move:!0,globalMove:!0,click:!0,wheel:!0};let EventSystem=_EventSystem;extensions$1.add(EventSystem);function convertEventModeToInteractiveMode(tt){return tt==="dynamic"||tt==="static"}const FederatedDisplayObject={onclick:null,onmousedown:null,onmouseenter:null,onmouseleave:null,onmousemove:null,onglobalmousemove:null,onmouseout:null,onmouseover:null,onmouseup:null,onmouseupoutside:null,onpointercancel:null,onpointerdown:null,onpointerenter:null,onpointerleave:null,onpointermove:null,onglobalpointermove:null,onpointerout:null,onpointerover:null,onpointertap:null,onpointerup:null,onpointerupoutside:null,onrightclick:null,onrightdown:null,onrightup:null,onrightupoutside:null,ontap:null,ontouchcancel:null,ontouchend:null,ontouchendoutside:null,ontouchmove:null,onglobaltouchmove:null,ontouchstart:null,onwheel:null,_internalInteractive:void 0,get interactive(){return this._internalInteractive??convertEventModeToInteractiveMode(EventSystem.defaultEventMode)},set interactive(tt){deprecation("7.2.0","Setting interactive is deprecated, use eventMode = 'none'/'passive'/'auto'/'static'/'dynamic' instead."),this._internalInteractive=tt,this.eventMode=tt?"static":"auto"},_internalEventMode:void 0,get eventMode(){return this._internalEventMode??EventSystem.defaultEventMode},set eventMode(tt){this._internalInteractive=convertEventModeToInteractiveMode(tt),this._internalEventMode=tt},isInteractive(){return this.eventMode==="static"||this.eventMode==="dynamic"},interactiveChildren:!0,hitArea:null,addEventListener(tt,et,rt){const st=typeof rt=="boolean"&&rt||typeof rt=="object"&&rt.capture,nt=typeof rt=="object"?rt.signal:void 0,ot=typeof rt=="object"?rt.once===!0:!1,at=typeof et=="function"?void 0:et;tt=st?`${tt}capture`:tt;const lt=typeof et=="function"?et:et.handleEvent,ut=this;nt&&nt.addEventListener("abort",()=>{ut.off(tt,lt,at)}),ot?ut.once(tt,lt,at):ut.on(tt,lt,at)},removeEventListener(tt,et,rt){const st=typeof rt=="boolean"&&rt||typeof rt=="object"&&rt.capture,nt=typeof et=="function"?void 0:et;tt=st?`${tt}capture`:tt,et=typeof et=="function"?et:et.handleEvent,this.off(tt,et,nt)},dispatchEvent(tt){if(!(tt instanceof FederatedEvent))throw new Error("DisplayObject cannot propagate events outside of the Federated Events API");return tt.defaultPrevented=!1,tt.path=null,tt.target=this,tt.manager.dispatchEvent(tt),!tt.defaultPrevented}};DisplayObject.mixin(FederatedDisplayObject);const accessibleTarget={accessible:!1,accessibleTitle:null,accessibleHint:null,tabIndex:0,_accessibleActive:!1,_accessibleDiv:null,accessibleType:"button",accessiblePointerEvents:"auto",accessibleChildren:!0,renderId:-1};DisplayObject.mixin(accessibleTarget);const KEY_CODE_TAB=9,DIV_TOUCH_SIZE=100,DIV_TOUCH_POS_X=0,DIV_TOUCH_POS_Y=0,DIV_TOUCH_ZINDEX=2,DIV_HOOK_SIZE=1,DIV_HOOK_POS_X=-1e3,DIV_HOOK_POS_Y=-1e3,DIV_HOOK_ZINDEX=2;class AccessibilityManager{constructor(et){this.debug=!1,this._isActive=!1,this._isMobileAccessibility=!1,this.pool=[],this.renderId=0,this.children=[],this.androidUpdateCount=0,this.androidUpdateFrequency=500,this._hookDiv=null,(isMobile.tablet||isMobile.phone)&&this.createTouchHook();const rt=document.createElement("div");rt.style.width=`${DIV_TOUCH_SIZE}px`,rt.style.height=`${DIV_TOUCH_SIZE}px`,rt.style.position="absolute",rt.style.top=`${DIV_TOUCH_POS_X}px`,rt.style.left=`${DIV_TOUCH_POS_Y}px`,rt.style.zIndex=DIV_TOUCH_ZINDEX.toString(),this.div=rt,this.renderer=et,this._onKeyDown=this._onKeyDown.bind(this),this._onMouseMove=this._onMouseMove.bind(this),globalThis.addEventListener("keydown",this._onKeyDown,!1)}get isActive(){return this._isActive}get isMobileAccessibility(){return this._isMobileAccessibility}createTouchHook(){const et=document.createElement("button");et.style.width=`${DIV_HOOK_SIZE}px`,et.style.height=`${DIV_HOOK_SIZE}px`,et.style.position="absolute",et.style.top=`${DIV_HOOK_POS_X}px`,et.style.left=`${DIV_HOOK_POS_Y}px`,et.style.zIndex=DIV_HOOK_ZINDEX.toString(),et.style.backgroundColor="#FF0000",et.title="select to enable accessibility for this content",et.addEventListener("focus",()=>{this._isMobileAccessibility=!0,this.activate(),this.destroyTouchHook()}),document.body.appendChild(et),this._hookDiv=et}destroyTouchHook(){this._hookDiv&&(document.body.removeChild(this._hookDiv),this._hookDiv=null)}activate(){var et;this._isActive||(this._isActive=!0,globalThis.document.addEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown,!1),this.renderer.on("postrender",this.update,this),(et=this.renderer.view.parentNode)==null||et.appendChild(this.div))}deactivate(){var et;!this._isActive||this._isMobileAccessibility||(this._isActive=!1,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.addEventListener("keydown",this._onKeyDown,!1),this.renderer.off("postrender",this.update),(et=this.div.parentNode)==null||et.removeChild(this.div))}updateAccessibleObjects(et){if(!et.visible||!et.accessibleChildren)return;et.accessible&&et.isInteractive()&&(et._accessibleActive||this.addChild(et),et.renderId=this.renderId);const rt=et.children;if(rt)for(let st=0;st<rt.length;st++)this.updateAccessibleObjects(rt[st])}update(){const et=performance.now();if(isMobile.android.device&&et<this.androidUpdateCount||(this.androidUpdateCount=et+this.androidUpdateFrequency,!this.renderer.renderingToScreen))return;this.renderer.lastObjectRendered&&this.updateAccessibleObjects(this.renderer.lastObjectRendered);const{x:rt,y:st,width:nt,height:ot}=this.renderer.view.getBoundingClientRect(),{width:at,height:lt,resolution:ut}=this.renderer,ct=nt/at*ut,dt=ot/lt*ut;let ht=this.div;ht.style.left=`${rt}px`,ht.style.top=`${st}px`,ht.style.width=`${at}px`,ht.style.height=`${lt}px`;for(let ft=0;ft<this.children.length;ft++){const xt=this.children[ft];if(xt.renderId!==this.renderId)xt._accessibleActive=!1,removeItems(this.children,ft,1),this.div.removeChild(xt._accessibleDiv),this.pool.push(xt._accessibleDiv),xt._accessibleDiv=null,ft--;else{ht=xt._accessibleDiv;let vt=xt.hitArea;const yt=xt.worldTransform;xt.hitArea?(ht.style.left=`${(yt.tx+vt.x*yt.a)*ct}px`,ht.style.top=`${(yt.ty+vt.y*yt.d)*dt}px`,ht.style.width=`${vt.width*yt.a*ct}px`,ht.style.height=`${vt.height*yt.d*dt}px`):(vt=xt.getBounds(),this.capHitArea(vt),ht.style.left=`${vt.x*ct}px`,ht.style.top=`${vt.y*dt}px`,ht.style.width=`${vt.width*ct}px`,ht.style.height=`${vt.height*dt}px`,ht.title!==xt.accessibleTitle&&xt.accessibleTitle!==null&&(ht.title=xt.accessibleTitle),ht.getAttribute("aria-label")!==xt.accessibleHint&&xt.accessibleHint!==null&&ht.setAttribute("aria-label",xt.accessibleHint)),(xt.accessibleTitle!==ht.title||xt.tabIndex!==ht.tabIndex)&&(ht.title=xt.accessibleTitle,ht.tabIndex=xt.tabIndex,this.debug&&this.updateDebugHTML(ht))}}this.renderId++}updateDebugHTML(et){et.innerHTML=`type: ${et.type}</br> title : ${et.title}</br> tabIndex: ${et.tabIndex}`}capHitArea(et){et.x<0&&(et.width+=et.x,et.x=0),et.y<0&&(et.height+=et.y,et.y=0);const{width:rt,height:st}=this.renderer;et.x+et.width>rt&&(et.width=rt-et.x),et.y+et.height>st&&(et.height=st-et.y)}addChild(et){let rt=this.pool.pop();rt||(rt=document.createElement("button"),rt.style.width=`${DIV_TOUCH_SIZE}px`,rt.style.height=`${DIV_TOUCH_SIZE}px`,rt.style.backgroundColor=this.debug?"rgba(255,255,255,0.5)":"transparent",rt.style.position="absolute",rt.style.zIndex=DIV_TOUCH_ZINDEX.toString(),rt.style.borderStyle="none",navigator.userAgent.toLowerCase().includes("chrome")?rt.setAttribute("aria-live","off"):rt.setAttribute("aria-live","polite"),navigator.userAgent.match(/rv:.*Gecko\//)?rt.setAttribute("aria-relevant","additions"):rt.setAttribute("aria-relevant","text"),rt.addEventListener("click",this._onClick.bind(this)),rt.addEventListener("focus",this._onFocus.bind(this)),rt.addEventListener("focusout",this._onFocusOut.bind(this))),rt.style.pointerEvents=et.accessiblePointerEvents,rt.type=et.accessibleType,et.accessibleTitle&&et.accessibleTitle!==null?rt.title=et.accessibleTitle:(!et.accessibleHint||et.accessibleHint===null)&&(rt.title=`displayObject ${et.tabIndex}`),et.accessibleHint&&et.accessibleHint!==null&&rt.setAttribute("aria-label",et.accessibleHint),this.debug&&this.updateDebugHTML(rt),et._accessibleActive=!0,et._accessibleDiv=rt,rt.displayObject=et,this.children.push(et),this.div.appendChild(et._accessibleDiv),et._accessibleDiv.tabIndex=et.tabIndex}_dispatchEvent(et,rt){const{displayObject:st}=et.target,nt=this.renderer.events.rootBoundary,ot=Object.assign(new FederatedEvent(nt),{target:st});nt.rootTarget=this.renderer.lastObjectRendered,rt.forEach(at=>nt.dispatchEvent(ot,at))}_onClick(et){this._dispatchEvent(et,["click","pointertap","tap"])}_onFocus(et){et.target.getAttribute("aria-live")||et.target.setAttribute("aria-live","assertive"),this._dispatchEvent(et,["mouseover"])}_onFocusOut(et){et.target.getAttribute("aria-live")||et.target.setAttribute("aria-live","polite"),this._dispatchEvent(et,["mouseout"])}_onKeyDown(et){et.keyCode===KEY_CODE_TAB&&this.activate()}_onMouseMove(et){et.movementX===0&&et.movementY===0||this.deactivate()}destroy(){this.destroyTouchHook(),this.div=null,globalThis.document.removeEventListener("mousemove",this._onMouseMove,!0),globalThis.removeEventListener("keydown",this._onKeyDown),this.pool=null,this.children=null,this.renderer=null}}AccessibilityManager.extension={name:"accessibility",type:[ExtensionType.RendererPlugin,ExtensionType.CanvasRendererPlugin]};extensions$1.add(AccessibilityManager);var INTERNAL_FORMATS=(tt=>(tt[tt.COMPRESSED_RGB_S3TC_DXT1_EXT=33776]="COMPRESSED_RGB_S3TC_DXT1_EXT",tt[tt.COMPRESSED_RGBA_S3TC_DXT1_EXT=33777]="COMPRESSED_RGBA_S3TC_DXT1_EXT",tt[tt.COMPRESSED_RGBA_S3TC_DXT3_EXT=33778]="COMPRESSED_RGBA_S3TC_DXT3_EXT",tt[tt.COMPRESSED_RGBA_S3TC_DXT5_EXT=33779]="COMPRESSED_RGBA_S3TC_DXT5_EXT",tt[tt.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT=35917]="COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT",tt[tt.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT=35918]="COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT",tt[tt.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT=35919]="COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT",tt[tt.COMPRESSED_SRGB_S3TC_DXT1_EXT=35916]="COMPRESSED_SRGB_S3TC_DXT1_EXT",tt[tt.COMPRESSED_R11_EAC=37488]="COMPRESSED_R11_EAC",tt[tt.COMPRESSED_SIGNED_R11_EAC=37489]="COMPRESSED_SIGNED_R11_EAC",tt[tt.COMPRESSED_RG11_EAC=37490]="COMPRESSED_RG11_EAC",tt[tt.COMPRESSED_SIGNED_RG11_EAC=37491]="COMPRESSED_SIGNED_RG11_EAC",tt[tt.COMPRESSED_RGB8_ETC2=37492]="COMPRESSED_RGB8_ETC2",tt[tt.COMPRESSED_RGBA8_ETC2_EAC=37496]="COMPRESSED_RGBA8_ETC2_EAC",tt[tt.COMPRESSED_SRGB8_ETC2=37493]="COMPRESSED_SRGB8_ETC2",tt[tt.COMPRESSED_SRGB8_ALPHA8_ETC2_EAC=37497]="COMPRESSED_SRGB8_ALPHA8_ETC2_EAC",tt[tt.COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2=37494]="COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2",tt[tt.COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2=37495]="COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2",tt[tt.COMPRESSED_RGB_PVRTC_4BPPV1_IMG=35840]="COMPRESSED_RGB_PVRTC_4BPPV1_IMG",tt[tt.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG=35842]="COMPRESSED_RGBA_PVRTC_4BPPV1_IMG",tt[tt.COMPRESSED_RGB_PVRTC_2BPPV1_IMG=35841]="COMPRESSED_RGB_PVRTC_2BPPV1_IMG",tt[tt.COMPRESSED_RGBA_PVRTC_2BPPV1_IMG=35843]="COMPRESSED_RGBA_PVRTC_2BPPV1_IMG",tt[tt.COMPRESSED_RGB_ETC1_WEBGL=36196]="COMPRESSED_RGB_ETC1_WEBGL",tt[tt.COMPRESSED_RGB_ATC_WEBGL=35986]="COMPRESSED_RGB_ATC_WEBGL",tt[tt.COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL=35987]="COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL",tt[tt.COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL=34798]="COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL",tt[tt.COMPRESSED_RGBA_ASTC_4x4_KHR=37808]="COMPRESSED_RGBA_ASTC_4x4_KHR",tt[tt.COMPRESSED_RGBA_BPTC_UNORM_EXT=36492]="COMPRESSED_RGBA_BPTC_UNORM_EXT",tt[tt.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT=36493]="COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT",tt[tt.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT=36494]="COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT",tt[tt.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT=36495]="COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT",tt))(INTERNAL_FORMATS||{});const INTERNAL_FORMAT_TO_BYTES_PER_PIXEL={33776:.5,33777:.5,33778:1,33779:1,35916:.5,35917:.5,35918:1,35919:1,37488:.5,37489:.5,37490:1,37491:1,37492:.5,37496:1,37493:.5,37497:1,37494:.5,37495:.5,35840:.5,35842:.5,35841:.25,35843:.25,36196:.5,35986:.5,35987:1,34798:1,37808:1,36492:1,36493:1,36494:1,36495:1};let storedGl,extensions;function getCompressedTextureExtensions(){extensions={bptc:storedGl.getExtension("EXT_texture_compression_bptc"),astc:storedGl.getExtension("WEBGL_compressed_texture_astc"),etc:storedGl.getExtension("WEBGL_compressed_texture_etc"),s3tc:storedGl.getExtension("WEBGL_compressed_texture_s3tc"),s3tc_sRGB:storedGl.getExtension("WEBGL_compressed_texture_s3tc_srgb"),pvrtc:storedGl.getExtension("WEBGL_compressed_texture_pvrtc")||storedGl.getExtension("WEBKIT_WEBGL_compressed_texture_pvrtc"),etc1:storedGl.getExtension("WEBGL_compressed_texture_etc1"),atc:storedGl.getExtension("WEBGL_compressed_texture_atc")}}const detectCompressedTextures={extension:{type:ExtensionType.DetectionParser,priority:2},test:async()=>{const tt=settings.ADAPTER.createCanvas().getContext("webgl");return tt?(storedGl=tt,!0):(console.warn("WebGL not available for compressed textures."),!1)},add:async tt=>{extensions||getCompressedTextureExtensions();const et=[];for(const rt in extensions)extensions[rt]&&et.push(rt);return[...et,...tt]},remove:async tt=>(extensions||getCompressedTextureExtensions(),tt.filter(et=>!(et in extensions)))};extensions$1.add(detectCompressedTextures);class BlobResource extends BufferResource{constructor(et,rt={width:1,height:1,autoLoad:!0}){let st,nt;typeof et=="string"?(st=et,nt=new Uint8Array):(st=null,nt=et),super(nt,rt),this.origin=st,this.buffer=nt?new ViewableBuffer(nt):null,this._load=null,this.loaded=!1,this.origin!==null&&rt.autoLoad!==!1&&this.load(),this.origin===null&&this.buffer&&(this._load=Promise.resolve(this),this.loaded=!0,this.onBlobLoaded(this.buffer.rawBinaryData))}onBlobLoaded(et){}load(){return this._load?this._load:(this._load=fetch(this.origin).then(et=>et.blob()).then(et=>et.arrayBuffer()).then(et=>(this.data=new Uint32Array(et),this.buffer=new ViewableBuffer(et),this.loaded=!0,this.onBlobLoaded(et),this.update(),this)),this._load)}}class CompressedTextureResource extends BlobResource{constructor(et,rt){super(et,rt),this.format=rt.format,this.levels=rt.levels||1,this._width=rt.width,this._height=rt.height,this._extension=CompressedTextureResource._formatToExtension(this.format),(rt.levelBuffers||this.buffer)&&(this._levelBuffers=rt.levelBuffers||CompressedTextureResource._createLevelBuffers(et instanceof Uint8Array?et:this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height))}upload(et,rt,st){const nt=et.gl;if(!et.context.extensions[this._extension])throw new Error(`${this._extension} textures are not supported on the current machine`);if(!this._levelBuffers)return!1;nt.pixelStorei(nt.UNPACK_ALIGNMENT,4);for(let ot=0,at=this.levels;ot<at;ot++){const{levelID:lt,levelWidth:ut,levelHeight:ct,levelBuffer:dt}=this._levelBuffers[ot];nt.compressedTexImage2D(nt.TEXTURE_2D,lt,this.format,ut,ct,0,dt)}return!0}onBlobLoaded(){this._levelBuffers=CompressedTextureResource._createLevelBuffers(this.buffer.uint8View,this.format,this.levels,4,4,this.width,this.height)}static _formatToExtension(et){if(et>=33776&&et<=33779)return"s3tc";if(et>=35916&&et<=35919)return"s3tc_sRGB";if(et>=37488&&et<=37497)return"etc";if(et>=35840&&et<=35843)return"pvrtc";if(et===36196)return"etc1";if(et===35986||et===35987||et===34798)return"atc";if(et>=36492&&et<=36495)return"bptc";if(et===37808)return"astc";throw new Error(`Invalid (compressed) texture format given: ${et}`)}static _createLevelBuffers(et,rt,st,nt,ot,at,lt){const ut=new Array(st);let ct=et.byteOffset,dt=at,ht=lt,ft=dt+nt-1&~(nt-1),xt=ht+ot-1&~(ot-1),vt=ft*xt*INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[rt];for(let yt=0;yt<st;yt++)ut[yt]={levelID:yt,levelWidth:st>1?dt:ft,levelHeight:st>1?ht:xt,levelBuffer:new Uint8Array(et.buffer,ct,vt)},ct+=vt,dt=dt>>1||1,ht=ht>>1||1,ft=dt+nt-1&~(nt-1),xt=ht+ot-1&~(ot-1),vt=ft*xt*INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[rt];return ut}}const DDS_MAGIC_SIZE=4,DDS_HEADER_SIZE=124,DDS_HEADER_PF_SIZE=32,DDS_HEADER_DX10_SIZE=20,DDS_MAGIC=542327876,DDS_FIELDS={HEIGHT:3,WIDTH:4,MIPMAP_COUNT:7,PIXEL_FORMAT:19},DDS_PF_FIELDS={FOURCC:2},DDS_DX10_FIELDS={DXGI_FORMAT:0,RESOURCE_DIMENSION:1,MISC_FLAG:2,ARRAY_SIZE:3},PF_FLAGS=1,DDPF_ALPHA=2,DDPF_FOURCC=4,DDPF_RGB=64,DDPF_YUV=512,DDPF_LUMINANCE=131072,FOURCC_DXT1=827611204,FOURCC_DXT3=861165636,FOURCC_DXT5=894720068,FOURCC_DX10=808540228,DDS_RESOURCE_MISC_TEXTURECUBE=4,FOURCC_TO_FORMAT={[FOURCC_DXT1]:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,[FOURCC_DXT3]:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,[FOURCC_DXT5]:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT},DXGI_TO_FORMAT={70:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,71:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT1_EXT,73:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,74:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT3_EXT,76:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,77:INTERNAL_FORMATS.COMPRESSED_RGBA_S3TC_DXT5_EXT,72:INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT,75:INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT,78:INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT,96:INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_SIGNED_FLOAT_EXT,95:INTERNAL_FORMATS.COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_EXT,98:INTERNAL_FORMATS.COMPRESSED_RGBA_BPTC_UNORM_EXT,99:INTERNAL_FORMATS.COMPRESSED_SRGB_ALPHA_BPTC_UNORM_EXT};function parseDDS(tt){const et=new Uint32Array(tt);if(et[0]!==DDS_MAGIC)throw new Error("Invalid DDS file magic word");const rt=new Uint32Array(tt,0,DDS_HEADER_SIZE/Uint32Array.BYTES_PER_ELEMENT),st=rt[DDS_FIELDS.HEIGHT],nt=rt[DDS_FIELDS.WIDTH],ot=rt[DDS_FIELDS.MIPMAP_COUNT],at=new Uint32Array(tt,DDS_FIELDS.PIXEL_FORMAT*Uint32Array.BYTES_PER_ELEMENT,DDS_HEADER_PF_SIZE/Uint32Array.BYTES_PER_ELEMENT),lt=at[PF_FLAGS];if(lt&DDPF_FOURCC){const ut=at[DDS_PF_FIELDS.FOURCC];if(ut!==FOURCC_DX10){const wt=FOURCC_TO_FORMAT[ut],St=DDS_MAGIC_SIZE+DDS_HEADER_SIZE,Rt=new Uint8Array(tt,St);return[new CompressedTextureResource(Rt,{format:wt,width:nt,height:st,levels:ot})]}const ct=DDS_MAGIC_SIZE+DDS_HEADER_SIZE,dt=new Uint32Array(et.buffer,ct,DDS_HEADER_DX10_SIZE/Uint32Array.BYTES_PER_ELEMENT),ht=dt[DDS_DX10_FIELDS.DXGI_FORMAT],ft=dt[DDS_DX10_FIELDS.RESOURCE_DIMENSION],xt=dt[DDS_DX10_FIELDS.MISC_FLAG],vt=dt[DDS_DX10_FIELDS.ARRAY_SIZE],yt=DXGI_TO_FORMAT[ht];if(yt===void 0)throw new Error(`DDSParser cannot parse texture data with DXGI format ${ht}`);if(xt===DDS_RESOURCE_MISC_TEXTURECUBE)throw new Error("DDSParser does not support cubemap textures");if(ft===6)throw new Error("DDSParser does not supported 3D texture data");const Et=new Array,bt=DDS_MAGIC_SIZE+DDS_HEADER_SIZE+DDS_HEADER_DX10_SIZE;if(vt===1)Et.push(new Uint8Array(tt,bt));else{const wt=INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[yt];let St=0,Rt=nt,Ct=st;for(let jt=0;jt<ot;jt++){const Pt=Math.max(1,Rt+3&-4),Ot=Math.max(1,Ct+3&-4),Ut=Pt*Ot*wt;St+=Ut,Rt=Rt>>>1,Ct=Ct>>>1}let It=bt;for(let jt=0;jt<vt;jt++)Et.push(new Uint8Array(tt,It,St)),It+=St}return Et.map(wt=>new CompressedTextureResource(wt,{format:yt,width:nt,height:st,levels:ot}))}throw lt&DDPF_RGB?new Error("DDSParser does not support uncompressed texture data."):lt&DDPF_YUV?new Error("DDSParser does not supported YUV uncompressed texture data."):lt&DDPF_LUMINANCE?new Error("DDSParser does not support single-channel (lumninance) texture data!"):lt&DDPF_ALPHA?new Error("DDSParser does not support single-channel (alpha) texture data!"):new Error("DDSParser failed to load a texture file due to an unknown reason!")}const FILE_IDENTIFIER=[171,75,84,88,32,49,49,187,13,10,26,10],ENDIANNESS=67305985,KTX_FIELDS={ENDIANNESS:12,GL_TYPE:16,GL_FORMAT:24,GL_INTERNAL_FORMAT:28,PIXEL_WIDTH:36,PIXEL_HEIGHT:40,PIXEL_DEPTH:44,NUMBER_OF_ARRAY_ELEMENTS:48,NUMBER_OF_FACES:52,NUMBER_OF_MIPMAP_LEVELS:56,BYTES_OF_KEY_VALUE_DATA:60},FILE_HEADER_SIZE=64,TYPES_TO_BYTES_PER_COMPONENT={[TYPES.UNSIGNED_BYTE]:1,[TYPES.UNSIGNED_SHORT]:2,[TYPES.INT]:4,[TYPES.UNSIGNED_INT]:4,[TYPES.FLOAT]:4,[TYPES.HALF_FLOAT]:8},FORMATS_TO_COMPONENTS={[FORMATS.RGBA]:4,[FORMATS.RGB]:3,[FORMATS.RG]:2,[FORMATS.RED]:1,[FORMATS.LUMINANCE]:1,[FORMATS.LUMINANCE_ALPHA]:2,[FORMATS.ALPHA]:1},TYPES_TO_BYTES_PER_PIXEL={[TYPES.UNSIGNED_SHORT_4_4_4_4]:2,[TYPES.UNSIGNED_SHORT_5_5_5_1]:2,[TYPES.UNSIGNED_SHORT_5_6_5]:2};function parseKTX(tt,et,rt=!1){const st=new DataView(et);if(!validate(tt,st))return null;const nt=st.getUint32(KTX_FIELDS.ENDIANNESS,!0)===ENDIANNESS,ot=st.getUint32(KTX_FIELDS.GL_TYPE,nt),at=st.getUint32(KTX_FIELDS.GL_FORMAT,nt),lt=st.getUint32(KTX_FIELDS.GL_INTERNAL_FORMAT,nt),ut=st.getUint32(KTX_FIELDS.PIXEL_WIDTH,nt),ct=st.getUint32(KTX_FIELDS.PIXEL_HEIGHT,nt)||1,dt=st.getUint32(KTX_FIELDS.PIXEL_DEPTH,nt)||1,ht=st.getUint32(KTX_FIELDS.NUMBER_OF_ARRAY_ELEMENTS,nt)||1,ft=st.getUint32(KTX_FIELDS.NUMBER_OF_FACES,nt),xt=st.getUint32(KTX_FIELDS.NUMBER_OF_MIPMAP_LEVELS,nt),vt=st.getUint32(KTX_FIELDS.BYTES_OF_KEY_VALUE_DATA,nt);if(ct===0||dt!==1)throw new Error("Only 2D textures are supported");if(ft!==1)throw new Error("CubeTextures are not supported by KTXLoader yet!");if(ht!==1)throw new Error("WebGL does not support array textures");const yt=4,Et=4,bt=ut+3&-4,wt=ct+3&-4,St=new Array(ht);let Rt=ut*ct;ot===0&&(Rt=bt*wt);let Ct;if(ot!==0?TYPES_TO_BYTES_PER_COMPONENT[ot]?Ct=TYPES_TO_BYTES_PER_COMPONENT[ot]*FORMATS_TO_COMPONENTS[at]:Ct=TYPES_TO_BYTES_PER_PIXEL[ot]:Ct=INTERNAL_FORMAT_TO_BYTES_PER_PIXEL[lt],Ct===void 0)throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");const It=rt?parseKvData(st,vt,nt):null;let jt=Rt*Ct,Pt=ut,Ot=ct,Ut=bt,Nt=wt,Ht=FILE_HEADER_SIZE+vt;for(let Lt=0;Lt<xt;Lt++){const kt=st.getUint32(Ht,nt);let $t=Ht+4;for(let Ft=0;Ft<ht;Ft++){let Gt=St[Ft];Gt||(Gt=St[Ft]=new Array(xt)),Gt[Lt]={levelID:Lt,levelWidth:xt>1||ot!==0?Pt:Ut,levelHeight:xt>1||ot!==0?Ot:Nt,levelBuffer:new Uint8Array(et,$t,jt)},$t+=jt}Ht+=kt+4,Ht=Ht%4!==0?Ht+4-Ht%4:Ht,Pt=Pt>>1||1,Ot=Ot>>1||1,Ut=Pt+yt-1&-4,Nt=Ot+Et-1&-4,jt=Ut*Nt*Ct}return ot!==0?{uncompressed:St.map(Lt=>{let kt=Lt[0].levelBuffer,$t=!1;return ot===TYPES.FLOAT?kt=new Float32Array(Lt[0].levelBuffer.buffer,Lt[0].levelBuffer.byteOffset,Lt[0].levelBuffer.byteLength/4):ot===TYPES.UNSIGNED_INT?($t=!0,kt=new Uint32Array(Lt[0].levelBuffer.buffer,Lt[0].levelBuffer.byteOffset,Lt[0].levelBuffer.byteLength/4)):ot===TYPES.INT&&($t=!0,kt=new Int32Array(Lt[0].levelBuffer.buffer,Lt[0].levelBuffer.byteOffset,Lt[0].levelBuffer.byteLength/4)),{resource:new BufferResource(kt,{width:Lt[0].levelWidth,height:Lt[0].levelHeight}),type:ot,format:$t?convertFormatToInteger(at):at}}),kvData:It}:{compressed:St.map(Lt=>new CompressedTextureResource(null,{format:lt,width:ut,height:ct,levels:xt,levelBuffers:Lt})),kvData:It}}function validate(tt,et){for(let rt=0;rt<FILE_IDENTIFIER.length;rt++)if(et.getUint8(rt)!==FILE_IDENTIFIER[rt])return console.error(`${tt} is not a valid *.ktx file!`),!1;return!0}function convertFormatToInteger(tt){switch(tt){case FORMATS.RGBA:return FORMATS.RGBA_INTEGER;case FORMATS.RGB:return FORMATS.RGB_INTEGER;case FORMATS.RG:return FORMATS.RG_INTEGER;case FORMATS.RED:return FORMATS.RED_INTEGER;default:return tt}}function parseKvData(tt,et,rt){const st=new Map;let nt=0;for(;nt<et;){const ot=tt.getUint32(FILE_HEADER_SIZE+nt,rt),at=FILE_HEADER_SIZE+nt+4,lt=3-(ot+3)%4;if(ot===0||ot>et-nt){console.error("KTXLoader: keyAndValueByteSize out of bounds");break}let ut=0;for(;ut<ot&&tt.getUint8(at+ut)!==0;ut++);if(ut===-1){console.error("KTXLoader: Failed to find null byte terminating kvData key");break}const ct=new TextDecoder().decode(new Uint8Array(tt.buffer,at,ut)),dt=new DataView(tt.buffer,at+ut+1,ot-ut-1);st.set(ct,dt),nt+=4+ot+lt}return st}const loadDDS={extension:{type:ExtensionType.LoadParser,priority:LoaderParserPriority.High},name:"loadDDS",test(tt){return checkExtension(tt,".dds")},async load(tt,et,rt){const st=await(await settings.ADAPTER.fetch(tt)).arrayBuffer(),nt=parseDDS(st).map(ot=>{const at=new BaseTexture(ot,{mipmap:MIPMAP_MODES.OFF,alphaMode:ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:getResolutionOfUrl(tt),...et.data});return createTexture(at,rt,tt)});return nt.length===1?nt[0]:nt},unload(tt){Array.isArray(tt)?tt.forEach(et=>et.destroy(!0)):tt.destroy(!0)}};extensions$1.add(loadDDS);const loadKTX={extension:{type:ExtensionType.LoadParser,priority:LoaderParserPriority.High},name:"loadKTX",test(tt){return checkExtension(tt,".ktx")},async load(tt,et,rt){const st=await(await settings.ADAPTER.fetch(tt)).arrayBuffer(),{compressed:nt,uncompressed:ot,kvData:at}=parseKTX(tt,st),lt=nt??ot,ut={mipmap:MIPMAP_MODES.OFF,alphaMode:ALPHA_MODES.NO_PREMULTIPLIED_ALPHA,resolution:getResolutionOfUrl(tt),...et.data},ct=lt.map(dt=>{lt===ot&&Object.assign(ut,{type:dt.type,format:dt.format});const ht=dt.resource??dt,ft=new BaseTexture(ht,ut);return ft.ktxKeyValueData=at,createTexture(ft,rt,tt)});return ct.length===1?ct[0]:ct},unload(tt){Array.isArray(tt)?tt.forEach(et=>et.destroy(!0)):tt.destroy(!0)}};extensions$1.add(loadKTX);const knownFormats=["s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"],resolveCompressedTextureUrl={extension:ExtensionType.ResolveParser,test:tt=>{const et=path.extname(tt).slice(1);return["basis","ktx","dds"].includes(et)},parse:tt=>{var st,nt;const et=tt.split("."),rt=et.pop();if(["ktx","dds"].includes(rt)){const ot=et.pop();if(knownFormats.includes(ot))return{resolution:parseFloat(((st=settings.RETINA_PREFIX.exec(tt))==null?void 0:st[1])??"1"),format:ot,src:tt}}return{resolution:parseFloat(((nt=settings.RETINA_PREFIX.exec(tt))==null?void 0:nt[1])??"1"),format:rt,src:tt}}};extensions$1.add(resolveCompressedTextureUrl);const TEMP_RECT=new Rectangle,BYTES_PER_PIXEL=4,_Extract=class Du{constructor(et){this.renderer=et,this._rendererPremultipliedAlpha=!1}contextChange(){var rt;const et=(rt=this.renderer)==null?void 0:rt.gl.getContextAttributes();this._rendererPremultipliedAlpha=!!(et&&et.alpha&&et.premultipliedAlpha)}async image(et,rt,st,nt){const ot=new Image;return ot.src=await this.base64(et,rt,st,nt),ot}async base64(et,rt,st,nt){const ot=this.canvas(et,nt);if(ot.toBlob!==void 0)return new Promise((at,lt)=>{ot.toBlob(ut=>{if(!ut){lt(new Error("ICanvas.toBlob failed!"));return}const ct=new FileReader;ct.onload=()=>at(ct.result),ct.onerror=lt,ct.readAsDataURL(ut)},rt,st)});if(ot.toDataURL!==void 0)return ot.toDataURL(rt,st);if(ot.convertToBlob!==void 0){const at=await ot.convertToBlob({type:rt,quality:st});return new Promise((lt,ut)=>{const ct=new FileReader;ct.onload=()=>lt(ct.result),ct.onerror=ut,ct.readAsDataURL(at)})}throw new Error("Extract.base64() requires ICanvas.toDataURL, ICanvas.toBlob, or ICanvas.convertToBlob to be implemented")}canvas(et,rt){const{pixels:st,width:nt,height:ot,flipY:at,premultipliedAlpha:lt}=this._rawPixels(et,rt);at&&Du._flipY(st,nt,ot),lt&&Du._unpremultiplyAlpha(st);const ut=new CanvasRenderTarget(nt,ot,1),ct=new ImageData(new Uint8ClampedArray(st.buffer),nt,ot);return ut.context.putImageData(ct,0,0),ut.canvas}pixels(et,rt){const{pixels:st,width:nt,height:ot,flipY:at,premultipliedAlpha:lt}=this._rawPixels(et,rt);return at&&Du._flipY(st,nt,ot),lt&&Du._unpremultiplyAlpha(st),st}_rawPixels(et,rt){const st=this.renderer;if(!st)throw new Error("The Extract has already been destroyed");let nt,ot=!1,at=!1,lt,ut=!1;et&&(et instanceof RenderTexture?lt=et:(lt=st.generateTexture(et,{region:rt,resolution:st.resolution,multisample:st.multisample}),ut=!0,rt&&(TEMP_RECT.width=rt.width,TEMP_RECT.height=rt.height,rt=TEMP_RECT)));const ct=st.gl;if(lt){if(nt=lt.baseTexture.resolution,rt=rt??lt.frame,ot=!1,at=lt.baseTexture.alphaMode>0&<.baseTexture.format===FORMATS.RGBA,!ut){st.renderTexture.bind(lt);const xt=lt.framebuffer.glFramebuffers[st.CONTEXT_UID];xt.blitFramebuffer&&st.framebuffer.bind(xt.blitFramebuffer)}}else nt=st.resolution,rt||(rt=TEMP_RECT,rt.width=st.width/nt,rt.height=st.height/nt),ot=!0,at=this._rendererPremultipliedAlpha,st.renderTexture.bind();const dt=Math.max(Math.round(rt.width*nt),1),ht=Math.max(Math.round(rt.height*nt),1),ft=new Uint8Array(BYTES_PER_PIXEL*dt*ht);return ct.readPixels(Math.round(rt.x*nt),Math.round(rt.y*nt),dt,ht,ct.RGBA,ct.UNSIGNED_BYTE,ft),ut&&(lt==null||lt.destroy(!0)),{pixels:ft,width:dt,height:ht,flipY:ot,premultipliedAlpha:at}}destroy(){this.renderer=null}static _flipY(et,rt,st){const nt=rt<<2,ot=st>>1,at=new Uint8Array(nt);for(let lt=0;lt<ot;lt++){const ut=lt*nt,ct=(st-lt-1)*nt;at.set(et.subarray(ut,ut+nt)),et.copyWithin(ut,ct,ct+nt),et.set(at,ct)}}static _unpremultiplyAlpha(et){et instanceof Uint8ClampedArray&&(et=new Uint8Array(et.buffer));const rt=et.length;for(let st=0;st<rt;st+=4){const nt=et[st+3];if(nt!==0){const ot=255.001/nt;et[st]=et[st]*ot+.5,et[st+1]=et[st+1]*ot+.5,et[st+2]=et[st+2]*ot+.5}}}};_Extract.extension={name:"extract",type:ExtensionType.RendererSystem};let Extract=_Extract;extensions$1.add(Extract);class CountLimiter{constructor(et){this.maxItemsPerFrame=et,this.itemsLeft=0}beginFrame(){this.itemsLeft=this.maxItemsPerFrame}allowedToUpload(){return this.itemsLeft-- >0}}function findMultipleBaseTextures(tt,et){var st;let rt=!1;if((st=tt==null?void 0:tt._textures)!=null&&st.length){for(let nt=0;nt<tt._textures.length;nt++)if(tt._textures[nt]instanceof Texture){const ot=tt._textures[nt].baseTexture;et.includes(ot)||(et.push(ot),rt=!0)}}return rt}function findBaseTexture(tt,et){if(tt.baseTexture instanceof BaseTexture){const rt=tt.baseTexture;return et.includes(rt)||et.push(rt),!0}return!1}function findTexture(tt,et){if(tt._texture&&tt._texture instanceof Texture){const rt=tt._texture.baseTexture;return et.includes(rt)||et.push(rt),!0}return!1}function drawText(tt,et){return et instanceof Text$2?(et.updateText(!0),!0):!1}function calculateTextStyle(tt,et){if(et instanceof TextStyle){const rt=et.toFontString();return TextMetrics.measureFont(rt),!0}return!1}function findText(tt,et){if(tt instanceof Text$2){et.includes(tt.style)||et.push(tt.style),et.includes(tt)||et.push(tt);const rt=tt._texture.baseTexture;return et.includes(rt)||et.push(rt),!0}return!1}function findTextStyle(tt,et){return tt instanceof TextStyle?(et.includes(tt)||et.push(tt),!0):!1}const _BasePrepare=class um{constructor(et){this.limiter=new CountLimiter(um.uploadsPerFrame),this.renderer=et,this.uploadHookHelper=null,this.queue=[],this.addHooks=[],this.uploadHooks=[],this.completes=[],this.ticking=!1,this.delayedTick=()=>{this.queue&&this.prepareItems()},this.registerFindHook(findText),this.registerFindHook(findTextStyle),this.registerFindHook(findMultipleBaseTextures),this.registerFindHook(findBaseTexture),this.registerFindHook(findTexture),this.registerUploadHook(drawText),this.registerUploadHook(calculateTextStyle)}upload(et){return new Promise(rt=>{et&&this.add(et),this.queue.length?(this.completes.push(rt),this.ticking||(this.ticking=!0,Ticker.system.addOnce(this.tick,this,UPDATE_PRIORITY.UTILITY))):rt()})}tick(){setTimeout(this.delayedTick,0)}prepareItems(){for(this.limiter.beginFrame();this.queue.length&&this.limiter.allowedToUpload();){const et=this.queue[0];let rt=!1;if(et&&!et._destroyed){for(let st=0,nt=this.uploadHooks.length;st<nt;st++)if(this.uploadHooks[st](this.uploadHookHelper,et)){this.queue.shift(),rt=!0;break}}rt||this.queue.shift()}if(this.queue.length)Ticker.system.addOnce(this.tick,this,UPDATE_PRIORITY.UTILITY);else{this.ticking=!1;const et=this.completes.slice(0);this.completes.length=0;for(let rt=0,st=et.length;rt<st;rt++)et[rt]()}}registerFindHook(et){return et&&this.addHooks.push(et),this}registerUploadHook(et){return et&&this.uploadHooks.push(et),this}add(et){for(let rt=0,st=this.addHooks.length;rt<st&&!this.addHooks[rt](et,this.queue);rt++);if(et instanceof Container)for(let rt=et.children.length-1;rt>=0;rt--)this.add(et.children[rt]);return this}destroy(){this.ticking&&Ticker.system.remove(this.tick,this),this.ticking=!1,this.addHooks=null,this.uploadHooks=null,this.renderer=null,this.completes=null,this.queue=null,this.limiter=null,this.uploadHookHelper=null}};_BasePrepare.uploadsPerFrame=4;let BasePrepare=_BasePrepare;Object.defineProperties(settings,{UPLOADS_PER_FRAME:{get(){return BasePrepare.uploadsPerFrame},set(tt){deprecation("7.1.0","settings.UPLOADS_PER_FRAME is deprecated, use prepare.BasePrepare.uploadsPerFrame"),BasePrepare.uploadsPerFrame=tt}}});function uploadBaseTextures(tt,et){return et instanceof BaseTexture?(et._glTextures[tt.CONTEXT_UID]||tt.texture.bind(et),!0):!1}function uploadGraphics(tt,et){if(!(et instanceof Graphics))return!1;const{geometry:rt}=et;et.finishPoly(),rt.updateBatches();const{batches:st}=rt;for(let nt=0;nt<st.length;nt++){const{texture:ot}=st[nt].style;ot&&uploadBaseTextures(tt,ot.baseTexture)}return rt.batchable||tt.geometry.bind(rt,et._resolveDirectShader(tt)),!0}function findGraphics(tt,et){return tt instanceof Graphics?(et.push(tt),!0):!1}class Prepare extends BasePrepare{constructor(et){super(et),this.uploadHookHelper=this.renderer,this.registerFindHook(findGraphics),this.registerUploadHook(uploadBaseTextures),this.registerUploadHook(uploadGraphics)}}Prepare.extension={name:"prepare",type:ExtensionType.RendererSystem};extensions$1.add(Prepare);const _Spritesheet=class ku{constructor(et,rt,st){this.linkedSheets=[],(et instanceof BaseTexture||et instanceof Texture)&&(et={texture:et,data:rt,resolutionFilename:st});const{texture:nt,data:ot,resolutionFilename:at=null,cachePrefix:lt=""}=et;this.cachePrefix=lt,this._texture=nt instanceof Texture?nt:null,this.baseTexture=nt instanceof BaseTexture?nt:this._texture.baseTexture,this.textures={},this.animations={},this.data=ot;const ut=this.baseTexture.resource;this.resolution=this._updateResolution(at||(ut?ut.url:null)),this._frames=this.data.frames,this._frameKeys=Object.keys(this._frames),this._batchIndex=0,this._callback=null}_updateResolution(et=null){const{scale:rt}=this.data.meta;let st=getResolutionOfUrl(et,null);return st===null&&(st=typeof rt=="number"?rt:parseFloat(rt??"1")),st!==1&&this.baseTexture.setResolution(st),st}parse(){return new Promise(et=>{this._callback=et,this._batchIndex=0,this._frameKeys.length<=ku.BATCH_SIZE?(this._processFrames(0),this._processAnimations(),this._parseComplete()):this._nextBatch()})}_processFrames(et){let rt=et;const st=ku.BATCH_SIZE;for(;rt-et<st&&rt<this._frameKeys.length;){const nt=this._frameKeys[rt],ot=this._frames[nt],at=ot.frame;if(at){let lt=null,ut=null;const ct=ot.trimmed!==!1&&ot.sourceSize?ot.sourceSize:ot.frame,dt=new Rectangle(0,0,Math.floor(ct.w)/this.resolution,Math.floor(ct.h)/this.resolution);ot.rotated?lt=new Rectangle(Math.floor(at.x)/this.resolution,Math.floor(at.y)/this.resolution,Math.floor(at.h)/this.resolution,Math.floor(at.w)/this.resolution):lt=new Rectangle(Math.floor(at.x)/this.resolution,Math.floor(at.y)/this.resolution,Math.floor(at.w)/this.resolution,Math.floor(at.h)/this.resolution),ot.trimmed!==!1&&ot.spriteSourceSize&&(ut=new Rectangle(Math.floor(ot.spriteSourceSize.x)/this.resolution,Math.floor(ot.spriteSourceSize.y)/this.resolution,Math.floor(at.w)/this.resolution,Math.floor(at.h)/this.resolution)),this.textures[nt]=new Texture(this.baseTexture,lt,dt,ut,ot.rotated?2:0,ot.anchor,ot.borders),Texture.addToCache(this.textures[nt],this.cachePrefix+nt.toString())}rt++}}_processAnimations(){const et=this.data.animations||{};for(const rt in et){this.animations[rt]=[];for(let st=0;st<et[rt].length;st++){const nt=et[rt][st];this.animations[rt].push(this.textures[nt])}}}_parseComplete(){const et=this._callback;this._callback=null,this._batchIndex=0,et.call(this,this.textures)}_nextBatch(){this._processFrames(this._batchIndex*ku.BATCH_SIZE),this._batchIndex++,setTimeout(()=>{this._batchIndex*ku.BATCH_SIZE<this._frameKeys.length?this._nextBatch():(this._processAnimations(),this._parseComplete())},0)}destroy(et=!1){var rt;for(const st in this.textures)this.textures[st].destroy();this._frames=null,this._frameKeys=null,this.data=null,this.textures=null,et&&((rt=this._texture)==null||rt.destroy(),this.baseTexture.destroy()),this._texture=null,this.baseTexture=null,this.linkedSheets=[]}};_Spritesheet.BATCH_SIZE=1e3;let Spritesheet=_Spritesheet;const validImages=["jpg","png","jpeg","avif","webp","s3tc","s3tc_sRGB","etc","etc1","pvrtc","atc","astc","bptc"];function getCacheableAssets(tt,et,rt){const st={};if(tt.forEach(nt=>{st[nt]=et}),Object.keys(et.textures).forEach(nt=>{st[`${et.cachePrefix}${nt}`]=et.textures[nt]}),!rt){const nt=path.dirname(tt[0]);et.linkedSheets.forEach((ot,at)=>{Object.assign(st,getCacheableAssets([`${nt}/${et.data.meta.related_multi_packs[at]}`],ot,!0))})}return st}const spritesheetAsset={extension:ExtensionType.Asset,cache:{test:tt=>tt instanceof Spritesheet,getCacheableAssets:(tt,et)=>getCacheableAssets(tt,et,!1)},resolver:{test:tt=>{const et=tt.split("?")[0].split("."),rt=et.pop(),st=et.pop();return rt==="json"&&validImages.includes(st)},parse:tt=>{var rt;const et=tt.split(".");return{resolution:parseFloat(((rt=settings.RETINA_PREFIX.exec(tt))==null?void 0:rt[1])??"1"),format:et[et.length-2],src:tt}}},loader:{name:"spritesheetLoader",extension:{type:ExtensionType.LoadParser,priority:LoaderParserPriority.Normal},async testParse(tt,et){return path.extname(et.src).toLowerCase()===".json"&&!!tt.frames},async parse(tt,et,rt){var dt,ht;const{texture:st,imageFilename:nt,cachePrefix:ot}=(et==null?void 0:et.data)??{};let at=path.dirname(et.src);at&&at.lastIndexOf("/")!==at.length-1&&(at+="/");let lt;if(st&&st.baseTexture)lt=st;else{const ft=copySearchParams(at+(nt??tt.meta.image),et.src);lt=(await rt.load([ft]))[ft]}const ut=new Spritesheet({texture:lt.baseTexture,data:tt,resolutionFilename:et.src,cachePrefix:ot});await ut.parse();const ct=(dt=tt==null?void 0:tt.meta)==null?void 0:dt.related_multi_packs;if(Array.isArray(ct)){const ft=[];for(const vt of ct){if(typeof vt!="string")continue;let yt=at+vt;(ht=et.data)!=null&&ht.ignoreMultiPack||(yt=copySearchParams(yt,et.src),ft.push(rt.load({src:yt,data:{ignoreMultiPack:!0}})))}const xt=await Promise.all(ft);ut.linkedSheets=xt,xt.forEach(vt=>{vt.linkedSheets=[ut].concat(ut.linkedSheets.filter(yt=>yt!==vt))})}return ut},unload(tt){tt.destroy(!0)}}};extensions$1.add(spritesheetAsset);const _HTMLTextStyle=class Kl extends TextStyle{constructor(){super(...arguments),this._fonts=[],this._overrides=[],this._stylesheet="",this.fontsDirty=!1}static from(et){return new Kl(Object.keys(Kl.defaultOptions).reduce((rt,st)=>({...rt,[st]:et[st]}),{}))}cleanFonts(){this._fonts.length>0&&(this._fonts.forEach(et=>{URL.revokeObjectURL(et.src),et.refs--,et.refs===0&&(et.fontFace&&document.fonts.delete(et.fontFace),delete Kl.availableFonts[et.originalUrl])}),this.fontFamily="Arial",this._fonts.length=0,this.styleID++,this.fontsDirty=!0)}loadFont(et,rt={}){const{availableFonts:st}=Kl;if(st[et]){const nt=st[et];return this._fonts.push(nt),nt.refs++,this.styleID++,this.fontsDirty=!0,Promise.resolve()}return settings.ADAPTER.fetch(et).then(nt=>nt.blob()).then(async nt=>new Promise((ot,at)=>{const lt=URL.createObjectURL(nt),ut=new FileReader;ut.onload=()=>ot([lt,ut.result]),ut.onerror=at,ut.readAsDataURL(nt)})).then(async([nt,ot])=>{const at=Object.assign({family:path.basename(et,path.extname(et)),weight:"normal",style:"normal",display:"auto",src:nt,dataSrc:ot,refs:1,originalUrl:et,fontFace:null},rt);st[et]=at,this._fonts.push(at),this.styleID++;const lt=new FontFace(at.family,`url(${at.src})`,{weight:at.weight,style:at.style,display:at.display});at.fontFace=lt,await lt.load(),document.fonts.add(lt),await document.fonts.ready,this.styleID++,this.fontsDirty=!0})}addOverride(...et){const rt=et.filter(st=>!this._overrides.includes(st));rt.length>0&&(this._overrides.push(...rt),this.styleID++)}removeOverride(...et){const rt=et.filter(st=>this._overrides.includes(st));rt.length>0&&(this._overrides=this._overrides.filter(st=>!rt.includes(st)),this.styleID++)}toCSS(et){return[`transform: scale(${et})`,"transform-origin: top left","display: inline-block",`color: ${this.normalizeColor(this.fill)}`,`font-size: ${this.fontSize}px`,`font-family: ${this.fontFamily}`,`font-weight: ${this.fontWeight}`,`font-style: ${this.fontStyle}`,`font-variant: ${this.fontVariant}`,`letter-spacing: ${this.letterSpacing}px`,`text-align: ${this.align}`,`padding: ${this.padding}px`,`white-space: ${this.whiteSpace}`,...this.lineHeight?[`line-height: ${this.lineHeight}px`]:[],...this.wordWrap?[`word-wrap: ${this.breakWords?"break-all":"break-word"}`,`max-width: ${this.wordWrapWidth}px`]:[],...this.strokeThickness?[`-webkit-text-stroke-width: ${this.strokeThickness}px`,`-webkit-text-stroke-color: ${this.normalizeColor(this.stroke)}`,`text-stroke-width: ${this.strokeThickness}px`,`text-stroke-color: ${this.normalizeColor(this.stroke)}`,"paint-order: stroke"]:[],...this.dropShadow?[this.dropShadowToCSS()]:[],...this._overrides].join(";")}toGlobalCSS(){return this._fonts.reduce((et,rt)=>`${et}
|
|
1385
1385
|
@font-face {
|
|
1386
1386
|
font-family: "${rt.family}";
|
|
1387
1387
|
src: url('${rt.dataSrc}');
|
|
1388
1388
|
font-weight: ${rt.weight};
|
|
1389
1389
|
font-style: ${rt.style};
|
|
1390
1390
|
font-display: ${rt.display};
|
|
1391
|
-
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(et){this._stylesheet!==et&&(this._stylesheet=et,this.styleID++)}normalizeColor(et){return Array.isArray(et)&&(et=rgb2hex(et)),typeof et=="number"?hex2string(et):et}dropShadowToCSS(){let et=this.normalizeColor(this.dropShadowColor);const rt=this.dropShadowAlpha,st=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),nt=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);et.startsWith("#")&&rt<1&&(et+=(rt*255|0).toString(16).padStart(2,"0"));const ot=`${st}px ${nt}px`;return this.dropShadowBlur>0?`text-shadow: ${ot} ${this.dropShadowBlur}px ${et}`:`text-shadow: ${ot} ${et}`}reset(){Object.assign(this,Kl.defaultOptions)}onBeforeDraw(){const{fontsDirty:et}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&et?new Promise(rt=>setTimeout(rt,100)):Promise.resolve()}get isSafari(){const{userAgent:et}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(et)}set fillGradientStops(et){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(et){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(et){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(et){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(et){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(et){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(et){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_HTMLTextStyle.availableFonts={},_HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let HTMLTextStyle=_HTMLTextStyle;const _HTMLText=class Ql extends Sprite{constructor(et="",rt={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const st=new Image,nt=Texture.from(st,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});nt.orig=new Rectangle,nt.trim=new Rectangle,this.texture=nt;const ot="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",lt=document.createElementNS(ot,"svg"),ut=document.createElementNS(ot,"foreignObject"),ct=document.createElementNS(at,"div"),dt=document.createElementNS(at,"style");ut.setAttribute("width","10000"),ut.setAttribute("height","10000"),ut.style.overflow="hidden",lt.appendChild(ut),this.maxWidth=Ql.defaultMaxWidth,this.maxHeight=Ql.defaultMaxHeight,this._domElement=ct,this._styleElement=dt,this._svgRoot=lt,this._foreignObject=ut,this._foreignObject.appendChild(dt),this._foreignObject.appendChild(ct),this._image=st,this._loadImage=new Image,this._autoResolution=Ql.defaultAutoResolution,this._resolution=Ql.defaultResolution??settings.RESOLUTION,this.text=et,this.style=rt}measureText(et){var dt,ht;const{text:rt,style:st,resolution:nt}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},et);Object.assign(this._domElement,{innerHTML:rt,style:st.toCSS(nt)}),this._styleElement.textContent=st.toGlobalCSS(),document.body.appendChild(this._svgRoot);const ot=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:at,height:lt}=ot;(at>this.maxWidth||lt>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const ut=Math.min(this.maxWidth,Math.ceil(at)),ct=Math.min(this.maxHeight,Math.ceil(lt));return this._svgRoot.setAttribute("width",ut.toString()),this._svgRoot.setAttribute("height",ct.toString()),rt!==this._text&&(this._domElement.innerHTML=this._text),st!==this._style&&(Object.assign(this._domElement,{style:(dt=this._style)==null?void 0:dt.toCSS(nt)}),this._styleElement.textContent=(ht=this._style)==null?void 0:ht.toGlobalCSS()),{width:ut+st.padding*2,height:ct+st.padding*2}}async updateText(et=!0){const{style:rt,_image:st,_loadImage:nt}=this;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;const{width:ot,height:at}=this.measureText();st.width=nt.width=Math.ceil(Math.max(1,ot)),st.height=nt.height=Math.ceil(Math.max(1,at)),this._updateID++;const lt=this._updateID;await new Promise(ut=>{nt.onload=async()=>{if(lt<this._updateID){ut();return}await rt.onBeforeDraw(),st.src=nt.src,nt.onload=null,nt.src="",this.updateTexture(),ut()};const ct=new XMLSerializer().serializeToString(this._svgRoot);nt.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ct)}`})}get source(){return this._image}updateTexture(){const{style:et,texture:rt,_image:st,resolution:nt}=this,{padding:ot}=et,{baseTexture:at}=rt;rt.trim.width=rt._frame.width=st.width/nt,rt.trim.height=rt._frame.height=st.height/nt,rt.trim.x=-ot,rt.trim.y=-ot,rt.orig.width=rt._frame.width-ot*2,rt.orig.height=rt._frame.height-ot*2,this._onTextureUpdate(),at.setRealSize(st.width,st.height,nt),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}_renderCanvas(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(et)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds(et)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(et){var st,nt,ot,at,lt;typeof et=="boolean"&&(et={children:et}),et=Object.assign({},Ql.defaultDestroyOptions,et),super.destroy(et);const rt=null;this.ownsStyle&&((st=this._style)==null||st.cleanFonts()),this._style=rt,(nt=this._svgRoot)==null||nt.remove(),this._svgRoot=rt,(ot=this._domElement)==null||ot.remove(),this._domElement=rt,(at=this._foreignObject)==null||at.remove(),this._foreignObject=rt,(lt=this._styleElement)==null||lt.remove(),this._styleElement=rt,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=rt,this._image.src="",this._image=rt}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._image.width/this.resolution,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._image.height/this.resolution,this._height=et}get style(){return this._style}set style(et){this._style!==et&&(et=et||{},et instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=et):et instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(et)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(et)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(et){et=String(et===""||et===null||et===void 0?" ":et),et=this.sanitiseText(et),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}sanitiseText(et){return et.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};_HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_HTMLText.defaultMaxWidth=2024,_HTMLText.defaultMaxHeight=2024,_HTMLText.defaultAutoResolution=!0;const MIN_HEIGHT=100,MIN_WIDTH=100,MODAL_VERTICAL_PADDING=450,MODAL_HORIZONTAL_PADDING=64,DEFAULT_QUALITY=.5,DEFAULT_SPRITE_NAME="image";function updateImageFromBlob(tt,{spriteName:et,imgDatasource:rt,settings:st}){const nt=URL.createObjectURL(rt),ot=new Image;return ot.src=nt,new Promise(at=>{ot.onload=async()=>{await updateImage(tt,{spriteName:et,imgDatasource:ot,settings:st});const lt=tt==null?void 0:tt.stage.getChildByName(et,!0);at(lt)}})}async function updateImage(tt,{spriteName:et,imgDatasource:rt,settings:st}){if(tt===void 0||tt.stage===null)return;const nt=tt.stage.getChildByName(et,!0);nt==null||nt.removeFromParent();const ot=rt instanceof HTMLImageElement?Texture.from(rt):rt instanceof Sprite?rt:await Texture.fromURL(rt),at=ot instanceof Sprite?ot:Sprite.from(ot,{});if(at.interactive=!0,at.name=et,st){const{sprite:{anchor:lt,position:ut,scale:ct,size:dt,rotation:ht},stage:{size:ft}}=st,xt=ht%Math.PI!==0;at.anchor.x=lt.x,at.anchor.y=lt.y,at.position.x=ut.x,at.position.y=ut.y,at.scale.x=ct.x,at.scale.y=ct.y,at.width=xt?dt.height:dt.width,at.height=xt?dt.width:dt.height,tt.stage.height=ft.height,tt.stage.width=ft.width,tt.renderer.resize(ft.width,ft.height),tt.stage.addChild(at)}else tt.stage.addChild(at),tt.renderer.resize(at.width,at.height);autoResize(tt,at)}function autoResize(tt,et){var rt;const st=tt.view.parentNode,nt=window.innerWidth-MODAL_HORIZONTAL_PADDING,ot=Math.max((st==null?void 0:st.offsetWidth)??0,MIN_WIDTH),at=constraintSize({width:et.width,height:et.height},{width:{max:Math.min(ot,nt),min:MIN_WIDTH},height:{min:MIN_HEIGHT,max:window.innerHeight-MODAL_VERTICAL_PADDING}}),{height:lt,width:ut}=at;(rt=tt.view)!=null&&rt.style&&(tt.view.style.width=`${ut}px`,tt.view.style.height=`${lt}px`)}function constraintSize(tt,et){const{height:rt,width:st}=tt,nt=st/rt,{height:ot,width:at}=et;let lt=at.max,ut=at.max/nt;return st>at.max&&(lt=at.max,ut=lt/nt),ut>ot.max&&(ut=ot.max,lt=ut*nt),lt<at.min&&(lt=at.min,ut=lt/nt),ut<ot.min&&(ut=ot.min,lt=ut*nt),{width:lt,height:ut}}function saveAsBlob(tt){return new Promise((et,rt)=>{var st;(st=tt==null?void 0:tt.view)!=null&&st.toBlob?tt.view.toBlob(nt=>{nt?et(nt):rt("EXTRACT_FAILED")},"image/jpeg",DEFAULT_QUALITY):rt("EXTRACT_FAILED")})}function saveAsDataURL(tt){var et,rt;return(rt=(et=tt.view).toDataURL)==null?void 0:rt.call(et)}function getApplicationScale(tt){return tt.view.getBoundingClientRect?tt.view.getBoundingClientRect().width/tt.view.width:1}function toBlob(tt){return new Promise((et,rt)=>{var st,nt;(nt=(st=tt.view).toBlob)==null||nt.call(st,ot=>{ot?et(ot):rt("EXTRACT_FAIL")},"image/png",1)})}function createImageSettings({application:tt,sprite:et}){return{sprite:{rotation:et.rotation,size:{width:et.width,height:et.height},position:{x:et.position.x,y:et.position.y},scale:{x:et.scale.x,y:et.scale.y},anchor:{x:et.anchor.x,y:et.anchor.y}},stage:{size:{width:tt.stage.width,height:tt.stage.height},scale:{x:tt.stage.scale.x,y:tt.stage.scale.y}}}}function resizeStage({application:tt,sprite:et,newHeight:rt,newWidth:st}){et.anchor.x=.5,et.anchor.y=.5,et.position=new Point(st/2,rt/2),tt.stage.height=rt,tt.stage.width=st,tt.renderer.resize(st,rt)}const DEFAULT_MAX_HISTORY=20,useHistoryTool=({maxSize:tt=DEFAULT_MAX_HISTORY,application:et,spriteName:rt,onRestore:st})=>{const[nt,ot]=reactExports.useState([]);reactExports.useEffect(()=>{ot([])},[et]);const at=async()=>{const ct=nt.pop();ct&&(st(await ct.backup,ct),ot(nt.filter(dt=>dt!==ct)))},lt=ct=>(ct.length>tt&&ct.splice(0,ct.length-tt),ct),ut=async ct=>{{if(!et)return;const dt=et.stage.getChildByName(rt,!0);if(dt==null)return;const ht=toBlob(et),ft={backup:ht,sprite:{rotation:dt.rotation,size:{width:dt.width,height:dt.height},position:{x:dt.position.x,y:dt.position.y},scale:{x:dt.scale.x,y:dt.scale.y},anchor:{x:dt.anchor.x,y:dt.anchor.y}},stage:{size:{width:et.stage.width,height:et.stage.height},scale:{x:et.stage.scale.x,y:et.stage.scale.y}}};return ot([...lt(nt),ft]),await ht,ct.call(ct)}};return{historyCount:nt.length,restore:at,historize:ut}};function aggregate(tt,et,rt){let st;const nt=[];return function(ot){nt.push(et(ot)),!st&&(st=setTimeout(()=>{const at=[...nt];nt.splice(0,nt.length),rt(at),st=void 0},tt))}}const BRUSH_SIZE=20,DEBOUNCE=50,CURSOR_NAME="BRUSH_CURSOR";function drawBrush(tt,et){const rt=new Graphics;for(const st of tt)st&&(rt.beginFill(16777215,1),rt.drawCircle(st.x,st.y,BRUSH_SIZE/et),rt.lineStyle(0),rt.endFill());return rt}function drawBlurListener(tt,{spriteName:et}){return aggregate(DEBOUNCE,rt=>tt.stage.toLocal(rt.global),rt=>{const st=tt.stage.getChildByName(et),nt=getApplicationScale(tt);if(st==null)return;const ot=new Sprite(st.texture);ot.filters=[new BlurFilter(8,4,Math.min(nt,1))],ot.width=st.width,ot.height=st.height,ot.scale=new Point(1,1),ot.anchor=st.anchor,ot.mask=drawBrush(rt,nt),st.addChild(ot)})}function drawCursor(tt){removeCursor(tt);const et=getApplicationScale(tt),rt=new Graphics;return rt.lineStyle(Math.max(1,1/et),16711680),rt.drawCircle(0,0,BRUSH_SIZE/et),rt.endFill(),rt.name=CURSOR_NAME,tt.stage.addChild(rt),rt}function removeCursor(tt){const et=tt.stage.getChildByName(CURSOR_NAME);et&&et.removeFromParent()}function moveCursorListener(tt){return et=>{if(!tt)return;const rt=tt.stage.toLocal(et.global),st=tt.stage.getChildByName(CURSOR_NAME,!0);st&&(st.position.x=rt.x,st.position.y=rt.y)}}function start$2(tt,{spriteName:et}){tt.stage.interactive=!0;const rt=drawCursor(tt),st=moveCursorListener(tt);tt.stage.on("pointermove",st);const nt=drawBlurListener(tt,{spriteName:et});tt.stage.on("pointerdown",()=>{tt.stage.on("pointermove",nt)});const ot=()=>{var at;(at=tt==null?void 0:tt.stage)==null||at.off("pointermove",nt)};globalThis.addEventListener("pointerup",ot),rt.once("destroyed",()=>{globalThis.removeEventListener("pointerup",ot)})}function stop$2(tt){removeCursor(tt),tt.stage.off("pointerdown"),tt.stage.off("pointermove")}const CORNERS=["TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT"],PADDING=0,POINT_RADIUS$1=20,CROP_BACKGROUND_NAME="CROP_BACKGROUND_NAME",CROP_MASK_NAME="CROP_MASK_NAME";function getCornerName$1(tt){return"CROP_CORNER_"+tt}function drawBackground(tt,{spriteName:et}){removeBackground(tt);const rt=tt.stage.getChildByName(et);if(rt==null)return;const st=rt.getBounds(),nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);ot.height=st.height,ot.width=st.width,ot.position=new Point(0,0);const at=new Graphics;at.beginFill(16777215,.5),at.drawRect(0,0,st.width,st.height),at.endFill(),at.name=CROP_BACKGROUND_NAME,at.position=new Point(st.x,st.y);const lt=new Graphics;lt.beginFill(0,1),lt.drawRect(0,0,st.width-2*PADDING,st.height-2*PADDING),lt.endFill(),lt.position=new Point(PADDING,PADDING),lt.name=CROP_MASK_NAME,ot.mask=lt,tt.stage.addChild(at),at.addChild(lt),at.addChild(ot)}function removeBackground(tt){const et=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0);et==null||et.removeFromParent()}function computeCornerPosition$1(tt,et){switch(tt){case"TOP_LEFT":return{x:et.x,y:et.y,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:et.x+et.width,y:et.y,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:et.x,y:et.y+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:et.x+et.width,y:et.y+et.height,start:Math.PI,end:3*Math.PI/2}}}function refreshCorners(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);et!=null&&CORNERS.forEach(rt=>{const st=tt.stage.getChildByName(getCornerName$1(rt),!0);if(st==null)return;const nt=computeCornerPosition$1(rt,{height:et.height,width:et.width,x:et.x,y:et.y});st.position=new Point(nt.x,nt.y)})}function drawCorner$1(tt,et,{spriteName:rt}){const st=tt.stage.getChildByName(getCornerName$1(et),!0),nt=getApplicationScale(tt);st==null||st.removeFromParent();const ot=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0),at=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(tt.stage.getChildByName(rt)==null||ot===null||ot===void 0||at===void 0||at===null)return;const ut=computeCornerPosition$1(et,{height:at.height,width:at.width,x:at.x,y:at.y}),ct=new Graphics;ct.beginFill(4960213,1),ct.arc(0,0,POINT_RADIUS$1/nt,ut.start,ut.end),ct.lineTo(0,0),ct.endFill(),ct.position=new Point(ut.x,ut.y),ct.name=getCornerName$1(et),ct.interactive=!0;let dt=!1;tt.stage.on("pointermove",xt=>{if(dt===!1)return;const vt=ot.toLocal(xt.global);ct.position.x=vt.x,ct.position.y=vt.y,moveMask(tt,et,vt)});const ht=()=>{dt=!0};ct.on("pointerdown",ht);const ft=()=>{dt=!1};globalThis.addEventListener("pointerup",ft),ct.once("destroyed",()=>{ct.off("pointerdown"),globalThis.removeEventListener("pointerup",ft)}),ot.addChild(ct)}function moveMask(tt,et,rt){const st=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(st==null)return;const nt=st.position.x+st.width,ot=st.position.y+st.height;switch(et){case"TOP_LEFT":{st.position.x=rt.x,st.position.y=rt.y,st.width=nt-rt.x,st.height=ot-rt.y;break}case"TOP_RIGHT":{st.position.y=rt.y,st.width=rt.x-st.position.x,st.height=ot-rt.y;break}case"BOTTOM_LEFT":{st.position.x=rt.x,st.width=nt-rt.x,st.height=rt.y-st.position.y;break}case"BOTTOM_RIGHT":{st.width=rt.x-st.position.x,st.height=rt.y-st.position.y;break}}refreshCorners(tt)}function start$1(tt,{spriteName:et}){stop$1(tt),tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,drawBackground(tt,{spriteName:et}),drawCorner$1(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner$1(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner$1(tt,"TOP_LEFT",{spriteName:et}),drawCorner$1(tt,"TOP_RIGHT",{spriteName:et})}function stop$1(tt){removeBackground(tt),tt.stage.off("pointermove"),tt.render()}function save$1(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(et==null)return;stop$1(tt);const rt=tt.renderer.generateTexture(tt.stage).clone(),st=new Sprite(rt),nt=et.getBounds(),ot=new Rectangle(Math.floor(nt.x),Math.floor(nt.y),Math.floor(nt.width),Math.floor(nt.height)),at=new Texture(st.texture.baseTexture,ot);return new Sprite(at)}const POINT_RADIUS=20,CONTROL_NAME="CONTROL_NAME";function getCornerName(tt){return"RESIZE_CORNER_"+tt}function computeCornerPosition(tt,et){const rt=et.x,st=et.y;switch(tt){case"TOP_LEFT":return{x:rt,y:st,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:rt+et.width,y:st,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:rt,y:st+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:rt+et.width,y:st+et.height,start:Math.PI,end:3*Math.PI/2}}}function resizeContainer(tt,{container:et,cornerType:rt,position:st,spriteName:nt}){const ot=tt.stage.getChildByName(nt,!0);if(ot==null)return;const at=ot.rotation%Math.PI!==0,lt=at?ot.height:ot.width,ut=at?ot.width:ot.height;switch(rt){case"TOP_LEFT":{et.position=new Point(st.x,st.y),et.width=lt-2*st.x,et.height=ut-2*st.y;break}case"TOP_RIGHT":{const ct=lt-st.x;et.position=new Point(ct,st.y),et.width=lt-2*ct,et.height=ut-2*st.y;break}case"BOTTOM_LEFT":{const ct=ut-st.y;et.position=new Point(st.x,ct),et.width=lt-2*st.x,et.height=ut-2*ct;break}case"BOTTOM_RIGHT":{const ct=ut-st.y,dt=lt-st.x;et.position=new Point(dt,ct),et.width=lt-2*dt,et.height=ut-2*ct;break}}}function removeCorner(tt,et){const rt=tt.stage.getChildByName(getCornerName(et),!0);rt==null||rt.removeFromParent()}function drawCorner(tt,et,{spriteName:rt}){removeCorner(tt,et);const st=tt.stage.getChildByName(rt,!0),nt=tt.stage.getChildByName(CONTROL_NAME,!0);if(st==null||nt===null||nt===void 0)return;const ot=computeCornerPosition(et,nt),at=new Graphics;at.beginFill(4960213,1),at.arc(0,0,POINT_RADIUS,ot.start,ot.end),at.lineTo(0,0),at.endFill(),at.position=new Point(ot.x,ot.y),at.name=getCornerName(et),at.interactive=!0;let lt=!1;tt.stage.on("pointermove",dt=>{if(lt===!1)return;const ht=tt.stage.toLocal(dt.global);resizeContainer(tt,{cornerType:et,position:ht,container:nt,spriteName:rt})});const ut=()=>{lt=!1};globalThis.addEventListener("pointerup",ut),at.once("destroyed",()=>{at.off("pointerdown"),globalThis.removeEventListener("pointerup",ut)});const ct=()=>{lt=!0};at.on("pointerdown",ct),nt.addChild(at)}function drawContainer(tt,et){removeContainer(tt);const rt=tt.stage.getChildByName(et,!0);if(rt==null)return;const st=tt.renderer.generateTexture(tt.stage),nt=new Sprite(st);tt.stage.children.forEach(at=>{at.alpha=0});const ot=new Graphics;ot.drawRect(0,0,rt.width,rt.height),ot.name=CONTROL_NAME,ot.interactive=!0,ot.interactiveChildren=!0,tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,tt.stage.addChild(ot),ot.addChild(nt)}function removeContainer(tt){const et=tt.stage.getChildByName(CONTROL_NAME,!0);et==null||et.removeFromParent(),tt.stage.children.forEach(rt=>{rt.alpha=1})}function drawControl(tt,et){drawContainer(tt,et),drawCorner(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner(tt,"TOP_LEFT",{spriteName:et}),drawCorner(tt,"TOP_RIGHT",{spriteName:et})}function removeControl(tt){removeContainer(tt),removeCorner(tt,"BOTTOM_LEFT"),removeCorner(tt,"BOTTOM_RIGHT"),removeCorner(tt,"TOP_LEFT"),removeCorner(tt,"TOP_RIGHT"),tt.stage.off("pointermove")}function start(tt,et){drawControl(tt,et)}function stop(tt){removeControl(tt),tt.stage.off("pointermove"),tt.render()}function save(tt){var et;const rt=(et=tt==null?void 0:tt.stage)==null?void 0:et.getChildByName(CONTROL_NAME,!0),st=rt?{height:rt.height,width:rt.width}:void 0;if(removeControl(tt),st){const nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);return ot.width=st.width,ot.height=st.height,ot}else return}async function rotate(tt,et){const rt=tt==null?void 0:tt.stage.getChildByName(et,!0);if(tt&&rt){if(!tt)return;const st=await toBlob(tt),nt=await updateImageFromBlob(tt,{imgDatasource:st,spriteName:et,settings:createImageSettings({application:tt,sprite:rt})});if(!nt)return;let ot,at;const lt=tt.view;lt.style&&(ot=lt.style.maxHeight??"",at=lt.style.visibility??"",lt.style.maxHeight=`${lt.clientHeight}px`,lt.style.visibility="hidden"),nt.rotation+=Math.PI/2,resizeStage({application:tt,sprite:nt,newHeight:nt.width,newWidth:nt.height}),tt.render();const ut=await toBlob(tt);ot!==void 0&&(lt.style.maxHeight=ot),at!==void 0&&(lt.style.visibility=at),await updateImageFromBlob(tt,{imgDatasource:ut,spriteName:et})}}function useImageEffects({application:tt,spriteName:et,onSave:rt}){return{rotate:async()=>{tt&&await rotate(tt,et)},startCrop:()=>{tt&&start$1(tt,{spriteName:et})},stopCrop:st=>{if(tt){if(st){const nt=save$1(tt);nt&&rt(nt)}stop$1(tt)}},startBlur:()=>{tt&&start$2(tt,{spriteName:et})},stopBlur:()=>{tt&&stop$2(tt)},startResize:()=>{tt&&start(tt,et)},stopResize:st=>{if(tt){if(st){const nt=save(tt);nt&&rt(nt)}stop(tt)}}}}function useImageEditor({imageSrc:tt,spriteName:et=DEFAULT_SPRITE_NAME}){const[rt,st]=reactExports.useState(void 0),[nt,ot]=reactExports.useState(!0),{rotate:at,startBlur:lt,startCrop:ut,startResize:ct,stopBlur:dt,stopCrop:ht,stopResize:ft}=useImageEffects({spriteName:et,application:rt,onSave(wt){rt&&updateImage(rt,{imgDatasource:wt,spriteName:et})}}),xt=()=>rt?saveAsBlob(rt):Promise.resolve(void 0),vt=()=>{if(rt)return saveAsDataURL(rt)},{restore:yt,historize:Et,historyCount:bt}=useHistoryTool({application:rt,spriteName:et,onRestore(wt,St){rt&&updateImageFromBlob(rt,{imgDatasource:wt,spriteName:et,settings:St})}});return reactExports.useEffect(()=>{rt&&(ot(!0),updateImage(rt,{spriteName:et,imgDatasource:tt}).finally(()=>ot(!1)))},[rt,tt,et]),{historyCount:bt,setApplication:st,restore:yt,stopCrop:ht,stopBlur:dt,stopResize:ft,startResize:async()=>{ot(!0),await Et(ct),ot(!1)},startCrop:async()=>{ot(!0),await Et(ut),ot(!1)},startBlur:async()=>{ot(!0),await Et(lt),ot(!1)},rotate:async()=>{ot(!0),await Et(at),ot(!1)},toBlob:xt,toDataURL:vt,loading:nt}}const SvgIconBlur=({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("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-blur_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M17.504 1.673a1 1 0 0 1 .932.491c.37.63.9 1.935 1.404 3.18l.08.197c.502 1.24.994 2.457 1.369 3.205l-.895.447.895-.447c.561 1.122 1.962 4.049 2.136 6.753.087 1.364-.125 2.839-1.094 3.978-.987 1.16-2.573 1.76-4.757 1.76-2.186 0-3.777-.6-4.777-1.752-.983-1.134-1.221-2.604-1.152-3.973.138-2.711 1.514-5.636 2.13-6.79.86-1.611 2.414-5.32 2.874-6.433a1 1 0 0 1 .855-.616m.104 3.492c-.657 1.533-1.496 3.425-2.07 4.5-.59 1.106-1.781 3.703-1.895 5.949-.057 1.11.158 1.976.665 2.56.49.565 1.427 1.063 3.266 1.063 1.84 0 2.76-.498 3.233-1.055.492-.579.694-1.44.622-2.555-.145-2.253-1.36-4.848-1.929-5.986-.412-.823-.932-2.108-1.417-3.308l-.097-.238q-.196-.487-.378-.93M12.843 22.535a1 1 0 0 1-1.034.964l-.259-.009a1 1 0 0 1-.257-.042q-.125.029-.26.024l-.257-.009a11 11 0 0 1-2.102-.279 1 1 0 0 1 .457-1.947 9 9 0 0 0 1.715.228l.258.009q.134.004.257.042.125-.028.26-.024l.257.009a1 1 0 0 1 .965 1.034m-6.615-1.329a1 1 0 0 1-1.396.226 10.9 10.9 0 0 1-2.877-3.086 1 1 0 1 1 1.7-1.054 8.9 8.9 0 0 0 2.347 2.518 1 1 0 0 1 .226 1.396M1.622 15.22a1 1 0 0 1-1.147-.827 10.9 10.9 0 0 1 .148-4.218 1 1 0 0 1 1.947.457 8.9 8.9 0 0 0-.12 3.441 1 1 0 0 1-.828 1.147m.978-7.49a1 1 0 0 1-.226-1.397A10.9 10.9 0 0 1 5.46 3.455a1 1 0 0 1 1.054 1.7 8.9 8.9 0 0 0-2.518 2.347 1 1 0 0 1-1.396.226m5.988-4.607a1 1 0 0 1 .827-1.147 11 11 0 0 1 2.116-.132l.258.01q.135.004.257.042.125-.03.26-.025l.258.01a1 1 0 0 1-.07 1.998l-.258-.009a1 1 0 0 1-.258-.043q-.125.03-.259.025l-.258-.009a9 9 0 0 0-1.727.108 1 1 0 0 1-1.146-.828"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-blur_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconCrop=({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("g",{clipPath:"url(#icon-crop_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.13 1.009a1 1 0 1 0-2-.018l-.036 4.103-4.103.036a1 1 0 1 0 .018 2l4.068-.035L5 15.99V16a3 3 0 0 0 3 3h9v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V8a3 3 0 0 0-3-3l-8.905.077zm-.053 6.068L7 16.004A1 1 0 0 0 8 17h9V8a1 1 0 0 0-.996-1z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-crop_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconUndo=({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:"M9.707 13.707a1 1 0 0 0 0-1.414L5.414 8l4.293-4.293a1 1 0 0 0-1.414-1.414l-5 5a1 1 0 0 0 0 1.414l5 5a1 1 0 0 0 1.414 0",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 20a1 1 0 0 0 1-1v-7a5 5 0 0 0-5-5H4a1 1 0 1 0 0 2h12a3 3 0 0 1 3 3v7a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),ImageEditorToolbar=({historyCount:tt,handle:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(void 0),ot=lt=>{nt(lt),et(lt)},at=[{type:"button",name:"undo",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconUndo,{}),"aria-label":rt("cancel"),children:rt("cancel"),onClick:()=>ot("UNDO"),disabled:tt===0},tooltip:rt("cancel")},{type:"divider",name:"div-1"},{type:"button",name:"reset",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),"aria-label":rt("rotate"),children:rt("rotate"),onClick:()=>ot("ROTATE")},tooltip:rt("rotate")},{type:"button",name:"crop",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconCrop,{}),"aria-label":rt("crop"),children:rt("crop"),className:st==="CROP"?"is-selected":"",onClick:()=>ot("CROP")},tooltip:rt("crop")},{type:"button",name:"blur",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBlur,{}),"aria-label":rt("blur"),children:rt("blur"),className:st==="BLUR"?"is-selected":"",onClick:()=>ot("BLUR")},tooltip:rt("blur")}];return jsxRuntimeExports.jsx(Toolbar,{variant:"no-shadow",align:"left",isBlock:!0,items:at})},ImageEditor=({altText:tt,legend:et,image:rt,isOpen:st,onCancel:nt,onError:ot,onSave:at})=>{const{t:lt}=useTranslation(),[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(!1),[ft,xt]=reactExports.useState(tt??""),[vt,yt]=reactExports.useState(et??""),[Et,bt]=reactExports.useState(!1),{toBlob:wt,setApplication:St,startBlur:Rt,stopBlur:Ct,restore:It,rotate:jt,startCrop:Pt,stopCrop:Ot,startResize:Ut,stopResize:Nt,historyCount:Ht,loading:Lt}=useImageEditor({imageSrc:rt}),kt=()=>{Ct(),Ot(ut==="CROP"),Nt(ut==="RESIZE")},$t=async()=>{try{ht(!0),kt();const Mt=await wt();Mt&&await at({blob:Mt,legend:vt,altText:ft})}catch(Mt){ot==null||ot(`${Mt}`)}finally{ht(!1)}},Ft=()=>{nt()},Gt=async Mt=>{switch(kt(),ct(Mt),bt(!0),Mt){case"ROTATE":{await jt();break}case"UNDO":{await It();break}case"CROP":{Pt();break}case"RESIZE":{await Ut();break}case"BLUR":{await Rt();break}}};return jsxRuntimeExports.jsxs(Modal,{id:"image-editor",isOpen:st,onModalClose:Ft,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Ft,children:jsxRuntimeExports.jsx("span",{className:"h2",children:lt("imageeditor.title")})}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex flex-column align-items-center",children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-12 w-100 flex-grow-1",children:[jsxRuntimeExports.jsx(ImageEditorToolbar,{handle:Gt,historyCount:Ht}),jsxRuntimeExports.jsxs("div",{className:"position-relative d-flex flex-column align-items-center justify-content-center flex-grow-1 w-100 image-editor",children:[jsxRuntimeExports.jsx(moduleExports.Stage,{onMount:Mt=>St(Mt),options:{preserveDrawingBuffer:!0,backgroundAlpha:0,resolution:1}}),!!Lt&&jsxRuntimeExports.jsx("div",{className:"position-absolute top-0 start-0 bottom-0 end-0 m-10 d-flex align-items-center justify-content-center bg-black opacity-25",children:jsxRuntimeExports.jsx(LoadingScreen,{})})]}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row m-10 gap-12 w-100",children:[jsxRuntimeExports.jsxs(FormControl,{id:"alt",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("alttext")}),jsxRuntimeExports.jsx(Input,{value:ft,onChange:Mt=>{bt(!0),xt(Mt.target.value)},placeholder:lt("alttext.help"),size:"md",type:"text"})]}),jsxRuntimeExports.jsxs(FormControl,{id:"legend",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("legend")}),jsxRuntimeExports.jsx(Input,{value:vt,onChange:Mt=>{bt(!0),yt(Mt.target.value)},placeholder:lt("legend.help"),size:"md",type:"text"})]})]})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:Ft,type:"button",variant:"ghost",children:lt("imageeditor.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:$t,type:"button",variant:"filled",isLoading:dt,disabled:dt||!Et,children:lt("imageeditor.save")})]})]})},UploadFiles=({onFilesChange:tt,visibility:et="protected"})=>{const{files:rt,uploadedFiles:st,getUploadStatus:nt,uploadFile:ot,removeFile:at,updateImage:lt,editingImage:ut,setEditingImage:ct,getUrl:dt}=useUploadFiles({handleOnChange:tt,application:"media-library",visibility:et}),ht=reactExports.useRef(new Map);reactExports.useEffect(()=>{const vt=ht.current;return()=>{vt.forEach(yt=>URL.revokeObjectURL(yt)),vt.clear()}},[]);const ft=vt=>{const yt=vt.type.startsWith("image")?ht.current.get(vt.name):"";return ht.current.has(vt.name)||ht.current.set(vt.name,URL.createObjectURL(vt)),{name:vt.name,info:{type:vt.type,weight:c$2(vt.size||0,1)},src:yt}},xt=vt=>{const yt=ht.current.get(vt.name);yt&&(URL.revokeObjectURL(yt),ht.current.delete(vt.name)),at(vt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[rt.map(vt=>{const yt=st.find(Et=>Et.name===vt.name);return jsxRuntimeExports.jsx(UploadCard,{status:nt(vt),item:ft(vt),onEdit:()=>ct(yt),onRetry:()=>ot(vt),onDelete:()=>xt(vt)},vt.name)}),ut&&jsxRuntimeExports.jsx(ImageEditor,{altText:ut.alt,legend:ut.title,image:dt(ut,!0),isOpen:!!ut,onCancel:()=>ct(void 0),onSave:lt,onError:console.error})]})},acceptedTypes=tt=>{const et=[];switch(tt){case"audio":et.push("audio/*");break;case"video":et.push("video/*");break;case"image":et.push("image/png"),et.push("image/jpeg"),et.push("image/webp"),et.push("image/gif"),et.push("image/avif");break}return et},Upload=()=>{const{type:tt,visibility:et,multiple:rt,setResult:st,setResultCounter:nt,setCancellable:ot}=useMediaLibraryContext(),at=lt=>{lt.length?(ot(lt),nt(lt.length),st(lt)):(ot([]),nt(void 0),st(void 0))};return jsxRuntimeExports.jsx("div",{className:"py-8 flex-grow-1",children:jsxRuntimeExports.jsx(Dropzone,{multiple:rt,accept:acceptedTypes(tt??"embedder"),children:jsxRuntimeExports.jsx(UploadFiles,{onFilesChange:at,visibility:et})})})},VIDEO_HEIGHT=9,VIDEO_WIDTH=16;function useCameras(){const{device:tt}=useBrowserInfo(navigator.userAgent),{t:et}=useTranslation(),[rt,st]=reactExports.useState([]),[nt,ot]=reactExports.useState({audio:!0,video:!0}),[at,lt]=reactExports.useState();async function ut(){return(await navigator.mediaDevices.enumerateDevices()).filter(ft=>ft.kind==="videoinput")}const ct=async ft=>{try{const xt=await navigator.mediaDevices.getUserMedia(ft);lt(xt)}catch(xt){console.error(xt)}},dt=()=>{at==null||at.getTracks().forEach(ft=>ft.stop()),ct(nt)},ht=ft=>{let xt={};ft!=null&&ft.deviceId?(ft.deviceId==="environment"||ft.deviceId==="user"?xt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,facingMode:ft==null?void 0:ft.deviceId}}:xt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,deviceId:{exact:ft.deviceId}}},ot(xt)):console.error("Selected input device id is null")};return reactExports.useEffect(()=>{dt()},[nt]),reactExports.useEffect(()=>{async function ft(){await ct(nt);const xt=await ut();switch(tt.type){case"mobile":case"tablet":{const vt={deviceId:"environment",label:et("video.back.camera"),groupId:"",kind:"videoinput"},yt={deviceId:"user",label:et("video.front.camera"),groupId:"",kind:"videoinput"};(xt==null?void 0:xt.length)>1?st([vt,yt]):st([vt]);break}default:st(xt);break}}ft()},[]),{inputDevices:rt,setPreferedDevice:ht,stream:at,restartStream:dt}}const SvgIconRecordStop=({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",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4z"})]}),VideoRecorderToolbar=({playing:tt,recording:et,recorded:rt,saving:st,saved:nt,hideSaveAction:ot,handleRecord:at,handleStop:lt,handlePlayPause:ut,handleReset:ct,handleSave:dt})=>{const{t:ht}=useTranslation(),ft=[{type:"icon",name:"record",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{color:et||rt?"":"red"}),color:"danger",disabled:et||rt||st,onClick:at,"aria-label":ht("bbm.video.record.start")},tooltip:ht("bbm.video.record.start")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordStop,{}),disabled:!et||rt||st,onClick:lt,"aria-label":ht("bbm.video.record.stop")},tooltip:ht("bbm.video.record.stop")},{type:"icon",name:"play",visibility:tt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:!rt||st,onClick:ut,"aria-label":ht("bbm.video.play.start")},tooltip:ht("bbm.video.play.start")},{type:"icon",name:"pause",visibility:tt?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),disabled:!rt||st,onClick:ut,"aria-label":ht("bbm.video.play.pause")},tooltip:ht("bbm.video.play.pause")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:!rt||st,onClick:ct,"aria-label":ht("bbm.video.record.reset")},tooltip:ht("bbm.video.record.reset")},{type:"icon",name:"save",visibility:ot?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:!rt||st||nt,onClick:dt,"aria-label":ht("bbm.video.record.save")},tooltip:ht("bbm.video.record.save")}];return jsxRuntimeExports.jsx(Toolbar,{items:ft,className:"position-absolute bottom-0 start-50 bg-white"})},VideoRecorder=reactExports.forwardRef(({appCode:tt,caption:et,onSuccess:rt,onError:st,onRecordUpdated:nt,hideSaveAction:ot=!1},at)=>{const{inputDevices:lt,setPreferedDevice:ut,restartStream:ct,stream:dt}=useCameras(),[ht,ft]=reactExports.useState(18e4),[xt,vt]=reactExports.useState(!1),[yt,Et]=reactExports.useState(!1),[bt,wt]=reactExports.useState(!1),[St,Rt]=reactExports.useState(!1),[Ct,It]=reactExports.useState(!1),[jt,Pt]=reactExports.useState(""),[Ot,Ut]=reactExports.useState([]),[Nt,Ht]=reactExports.useState(),[Lt,kt]=reactExports.useState(0),[$t,Ft]=reactExports.useState(0),Gt=reactExports.useRef(null),Mt=reactExports.useRef(null),{uploadBlob:Vt}=useUpload(void 0,tt);reactExports.useImperativeHandle(at,()=>({save:ur}));const{t:Bt}=useTranslation();reactExports.useEffect(()=>{qt()},[]);async function qt(){try{const or=await odeServices.video().getVideoConf();ft(or.maxDuration*60*1e3)}catch{ft(3*60*1e3)}}reactExports.useEffect(()=>{try{Gt.current&&(Gt.current.src&&(window.URL.revokeObjectURL(Gt.current.src),Gt.current.src=""),Gt.current.srcObject instanceof MediaStream&&(Gt.current.srcObject=null),dt&&(Gt.current.srcObject=dt,Gt.current.autoplay=!0,Gt.current.volume=1,Gt.current.muted=!0,Gt.current.load()))}catch(or){console.error(or)}},[dt]),reactExports.useEffect(()=>{if(Ot.length&&!xt&&Gt.current){const or=new Blob(Ot,{type:jt});if(Ht(or),nt){const hr=window.URL.createObjectURL(or);nt(hr)}Gt.current.autoplay=!1,Gt.current.srcObject=null,Gt.current.src=window.URL.createObjectURL(or)}},[xt,Ot]),reactExports.useEffect(()=>{if(xt){const or=Date.now(),hr=window.setInterval(()=>kt(Date.now()-or),500);return()=>{window.clearInterval(hr)}}},[xt]),reactExports.useEffect(()=>{if(bt){const or=window.setInterval(()=>Ft(hr=>hr+500),500);return()=>{window.clearInterval(or)}}},[bt]);const Qt=reactExports.useCallback(()=>{vt(!0),Gt&&Gt.current&&(Gt.current.muted=!0);const or=o$2();Pt(or),dt&&(Mt.current=new MediaRecorder(dt,{mimeType:or}),Mt.current.ondataavailable=({data:hr})=>{hr.size>0&&Ut(pr=>[...pr,hr])},Mt.current.onerror=hr=>console.error(hr),Mt.current.start(1e3))},[dt]),Yt=reactExports.useCallback(()=>{var or;vt(!1),Et(!0),((or=Mt.current)==null?void 0:or.state)==="recording"&&(Mt.current.requestData(),Mt.current.stop())},[Mt]),tr=reactExports.useCallback(()=>{var or,hr;Gt&&Gt.current&&(Gt.current.muted=!1),bt?((hr=Gt==null?void 0:Gt.current)==null||hr.pause(),wt(!1)):((or=Gt==null?void 0:Gt.current)==null||or.play(),wt(!0))},[bt]),lr=()=>{Et(!1),vt(!1),wt(!1),It(!1),kt(0),Ut([]),Ht(void 0),ct(),nt&&nt()},ur=async()=>{var or;if((or=Gt==null?void 0:Gt.current)==null||or.pause(),Rt(!0),!Nt){console.error("Error while saving video: recorded video is undefined.");return}const hr=await Vt(Nt,{duration:Lt});if(hr!=null)return rt==null||rt([hr]),Rt(!1),It(!0),[hr];st("Error while uploading video"),Rt(!1),It(!0)},mr=()=>{wt(!1),Ft(0),Gt.current&&(Gt.current.currentTime=0)},yr=or=>{var hr;const pr=lt.find(_r=>_r.label===or);((hr=Mt.current)==null?void 0:hr.state)==="recording"&&(Mt.current.requestData(),Mt.current.stop()),ut(pr)};return reactExports.useEffect(()=>{Lt>=ht&&Yt()},[Lt,Yt]),jsxRuntimeExports.jsxs("div",{className:"video-recorder d-flex flex-fill flex-column align-items-center pb-8",children:[jsxRuntimeExports.jsx("div",{className:"video-recorder-caption d-none d-md-block",children:et}),lt.length>1&&jsxRuntimeExports.jsx("div",{className:"video-recorder-devices mb-12",children:jsxRuntimeExports.jsxs(FormControl,{id:"selectInputDevice",children:[jsxRuntimeExports.jsx(Label,{className:"d-none d-md-block",children:Bt("bbm.video.record.select.devices.label")}),jsxRuntimeExports.jsx(Select,{placeholderOption:Bt("bbm.video.record.select.devices.placeholder"),options:lt.map(or=>or.label),onValueChange:yr})]})}),jsxRuntimeExports.jsxs("div",{className:"video-recorder-video-container position-relative align-self-stretch",children:[jsxRuntimeExports.jsx("video",{ref:Gt,playsInline:!0,autoPlay:!0,controls:!1,muted:!0,onEnded:mr,className:"rounded",children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),(xt||yt)&&jsxRuntimeExports.jsxs("div",{className:"video-recorder-time d-flex align-items-center font-monospace fs-6 text-bg-dark rounded",children:[xt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,color:"red",className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$4(Lt),"/",n$4(ht)]})]}),yt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecordVideo,{width:14,height:14,className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$4($t),"/",n$4(Lt)]})]})]}),dt&&jsxRuntimeExports.jsx(VideoRecorderToolbar,{playing:bt,recording:xt,recorded:yt,saving:St,saved:Ct,hideSaveAction:ot,handleRecord:Qt,handleStop:Yt,handlePlayPause:tr,handleReset:lr,handleSave:ur})]}),St&&jsxRuntimeExports.jsx(LoadingScreen,{position:!1,caption:Bt("bbm.video.save.loader.caption")})]})}),Video=()=>{const{appCode:tt,setResult:et,setPreSuccess:rt}=useMediaLibraryContext(),{t:st}=useTranslation(),nt=reactExports.useRef(null),ot=lt=>{lt?(et(lt),rt(()=>nt.current.save)):et()},at=lt=>{console.error(lt)};return jsxRuntimeExports.jsx(VideoRecorder,{ref:nt,appCode:tt,caption:st("bbm.video.caption"),onRecordUpdated:ot,onError:at,hideSaveAction:!0})},SvgIconArrowRight=({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 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 12l-6.293-6.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"})]}),illuError="/assets/js/ode-explorer/illu-error.svg",illuError$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuError},Symbol.toStringTag,{value:"Module"})),VideoEmbed=({switchType:tt,onSuccess:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(),[ot,at]=reactExports.useState(),[lt,ut]=reactExports.useState(void 0),[ct,dt]=reactExports.useState(),ht=useDebounce(st||"",300),ft=reactExports.useId();reactExports.useEffect(()=>{xt()},[]),reactExports.useEffect(()=>{if(ct&&ht){const bt=odeServices.embedder().getProviderFromUrl(ct,ht);if(bt){ut(bt);const wt=odeServices.embedder().getEmbedCodeForProvider(bt,ht);at(wt),et(wt)}else ut(void 0),et()}},[ht,ct]);const xt=async()=>{const bt=await Promise.all([odeServices.embedder().getDefault(),odeServices.embedder().getCustom()]).then(wt=>wt.flat());dt(bt)};function vt(bt){const wt=bt.currentTarget.value;nt(wt),et(wt!=null&&wt.length?wt:void 0)}function yt(){tt==null||tt("embedder")}const Et=()=>ht?lt?jsxRuntimeExports.jsxs("div",{className:"mx-auto mt-16",children:[jsxRuntimeExports.jsxs("div",{className:"video-embed-provider d-flex align-items-center",children:[jsxRuntimeExports.jsx(Image$1,{src:lt.logo,alt:"Logo "+lt.displayName,className:"video-embed-provider-logo"}),lt.displayName]}),ot&&jsxRuntimeExports.jsx("div",{className:"video-embed-preview mt-12",dangerouslySetInnerHTML:{__html:ot}})]}):jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column align-items-center m-16",children:[jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,title:rt("bbm.video.previewError.title"),text:rt("bbm.video.previewError.text")}),tt&&jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:yt,className:"align-items-start mt-16",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]}):tt&&jsxRuntimeExports.jsx("div",{className:"d-flex my-16 align-items-start",children:jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:yt,className:"align-items-start",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})});return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill video-embed",children:[jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconGlobe,{className:"me-8"}),rt("bbm.video.url.title")]}),jsxRuntimeExports.jsx(FormControl,{id:ft,children:jsxRuntimeExports.jsx(Input,{size:"md",type:"text",placeholder:rt("bbm.video.url.placeholder"),onChange:vt})}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et()})]})},VideoEmbedder=()=>{const{switchType:tt,setResult:et}=useMediaLibraryContext();return jsxRuntimeExports.jsx(VideoEmbed,{switchType:tt,onSuccess:rt=>{et(rt)}})},SvgIconSortAscendingLetters=({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:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 16.293a1 1 0 0 1 1.414 0L7 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 4a1 1 0 0 1 1 1v15a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconSortDescendingLetters=({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:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 8.707a1 1 0 0 0 1.414 0L7 6.414l2.293 2.293a1 1 0 0 0 1.414-1.414l-3-3a1 1 0 0 0-1.414 0l-3 3a1 1 0 0 0 0 1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 21a1 1 0 0 0 1-1V5a1 1 0 0 0-2 0v15a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),SvgIconSortTime=({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:"M13.509 6.027a6.138 6.138 0 1 1-.28 12.099 1 1 0 1 0-.383 1.963A8.138 8.138 0 1 0 9.653 5.488a1 1 0 1 0 1.168 1.624 6.1 6.1 0 0 1 2.688-1.085",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.38 8.252a1 1 0 0 0-1 1v3.8a1 1 0 0 0 .456.838l2.052 1.332a1 1 0 0 0 1.089-1.678l-1.597-1.036V9.252a1 1 0 0 0-1-1M1.793 16.293a1 1 0 0 1 1.414 0L5.5 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 4a1 1 0 0 0-1 1v15a1 1 0 1 0 2 0V5a1 1 0 0 0-1-1",clipRule:"evenodd"})]}),illuTrash="/assets/js/ode-explorer/illu-trash.svg",illuTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTrash},Symbol.toStringTag,{value:"Module"})),Grid=({children:tt,className:et,...rt})=>{const st=clsx("grid",et);return jsxRuntimeExports.jsx("div",{className:st,...rt,children:tt})},Column=({sm:tt,md:et,lg:rt,xl:st,children:nt,className:ot,as:at,...lt})=>{const ut=at||"div",ct=clsx({[`g-col-${tt}`]:tt,[et?`g-col-md-${et}`:""]:et,[rt?`g-col-lg-${rt}`:""]:rt,[st?`g-col-xl-${st}`:""]:st},ot);return jsxRuntimeExports.jsx(ut,{className:ct,...lt,children:nt})};Grid.Col=Column;const SvgIconLandscape=({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.222 5.037c-.895 0-1.222.555-1.222.792v12.675c0 .237.327.792 1.222.792h1.364l9.707-9.886a.987.987 0 0 1 1.414 0L21 13.782V5.829c0-.237-.328-.792-1.222-.792zM23 16.224V5.829C23 4.066 21.337 3 19.778 3H4.222C2.662 3 1 4.066 1 5.83v12.674c0 1.763 1.662 2.829 3.222 2.829h15.556c1.56 0 3.222-1.066 3.222-2.83v-2.279m-2 .439-5-5.093-7.585 7.726h11.363c.894 0 1.222-.555 1.222-.792zM8 8.093c-.552 0-1 .455-1 1.018a1.01 1.01 0 0 0 1 1.018c.552 0 1-.456 1-1.018a1.01 1.01 0 0 0-1-1.019M5 9.11c0-1.688 1.343-3.056 3-3.056s3 1.368 3 3.056-1.343 3.055-3 3.055-3-1.368-3-3.055",clipRule:"evenodd"})]}),SvgIconTextPage=({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:"M6.286 3c-.35 0-.68.135-.92.368-.238.231-.366.54-.366.854v15.556c0 .315.128.623.367.854.239.233.569.368.919.368h11.428c.35 0 .68-.135.92-.368.238-.231.366-.54.366-.854V8h-3a2 2 0 0 1-2-2V3zM16 6h1.986L16 4.08zm5 13.778V6.556a1 1 0 0 0-.305-.72L15.98 1.281A1 1 0 0 0 15.286 1h-9a3.32 3.32 0 0 0-2.314.934A3.2 3.2 0 0 0 3 4.222v15.556c0 .864.353 1.686.972 2.288S5.423 23 6.286 23h11.428c.863 0 1.695-.333 2.314-.934.619-.602.972-1.424.972-2.288M8 6a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm-1 6a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1m5 4a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2z",clipRule:"evenodd"})]}),SvgIconVideo=({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 4.962C4 4.376 4.435 4 4.853 4H6.5v2H4zM4 8h2.5v3H4zm-2 4V4.962C2 3.381 3.224 2 4.853 2h13.294C19.776 2 21 3.38 21 4.962v14.076C21 20.619 19.776 22 18.147 22H4.853C3.224 22 2 20.62 2 19.038zm17-6V4.962c0-.586-.435-.962-.853-.962H16.5v2zm0 2h-2.5v3H19zm-2.5 5H19v3h-2.5zm0 5H19v1.038c0 .586-.435.962-.853.962H16.5zm-2-7V4h-6v7zm-6 2h6v7h-6zm-2 5v2H4.853C4.435 20 4 19.624 4 19.038V18zm0-2v-3H4v3z",clipRule:"evenodd"})]}),FileIcon=({type:tt,roleMap:et})=>{const rt=typeof(et==null?void 0:et.icon)!="string"&&tt!=="unknown"&&(et==null?void 0:et.hasShadow)!==!1,st=clsx("position-absolute top-50 start-50 translate-middle",{"p-12 rounded-circle shadow":rt},et==null?void 0:et.color);return jsxRuntimeExports.jsx("div",{className:st,children:(et==null?void 0:et.icon)??jsxRuntimeExports.jsx(SvgIconPaperclip,{})})};var observerMap=new Map,RootIds=new WeakMap,rootId=0,unsupportedValue=void 0;function getRootId(tt){return tt?(RootIds.has(tt)||(rootId+=1,RootIds.set(tt,rootId.toString())),RootIds.get(tt)):"0"}function optionsToId(tt){return Object.keys(tt).sort().filter(et=>tt[et]!==void 0).map(et=>`${et}_${et==="root"?getRootId(tt.root):tt[et]}`).toString()}function createObserver(tt){let et=optionsToId(tt),rt=observerMap.get(et);if(!rt){const st=new Map;let nt;const ot=new IntersectionObserver(at=>{at.forEach(lt=>{var ut;const ct=lt.isIntersecting&&nt.some(dt=>lt.intersectionRatio>=dt);tt.trackVisibility&&typeof lt.isVisible>"u"&&(lt.isVisible=ct),(ut=st.get(lt.target))==null||ut.forEach(dt=>{dt(ct,lt)})})},tt);nt=ot.thresholds||(Array.isArray(tt.threshold)?tt.threshold:[tt.threshold||0]),rt={id:et,observer:ot,elements:st},observerMap.set(et,rt)}return rt}function observe(tt,et,rt={},st=unsupportedValue){if(typeof window.IntersectionObserver>"u"&&st!==void 0){const ut=tt.getBoundingClientRect();return et(st,{isIntersecting:st,target:tt,intersectionRatio:typeof rt.threshold=="number"?rt.threshold:0,time:0,boundingClientRect:ut,intersectionRect:ut,rootBounds:ut}),()=>{}}const{id:nt,observer:ot,elements:at}=createObserver(rt);let lt=at.get(tt)||[];return at.has(tt)||at.set(tt,lt),lt.push(et),ot.observe(tt),function(){lt.splice(lt.indexOf(et),1),lt.length===0&&(at.delete(tt),ot.unobserve(tt)),at.size===0&&(ot.disconnect(),observerMap.delete(nt))}}function useInView({threshold:tt,delay:et,trackVisibility:rt,rootMargin:st,root:nt,triggerOnce:ot,skip:at,initialInView:lt,fallbackInView:ut,onChange:ct}={}){var dt;const[ht,ft]=reactExports.useState(null),xt=reactExports.useRef(),[vt,yt]=reactExports.useState({inView:!!lt,entry:void 0});xt.current=ct,reactExports.useEffect(()=>{if(at||!ht)return;let St;return St=observe(ht,(Rt,Ct)=>{yt({inView:Rt,entry:Ct}),xt.current&&xt.current(Rt,Ct),Ct.isIntersecting&&ot&&St&&(St(),St=void 0)},{root:nt,rootMargin:st,threshold:tt,trackVisibility:rt,delay:et},ut),()=>{St&&St()}},[Array.isArray(tt)?tt.toString():tt,ht,nt,st,ot,at,rt,ut,et]);const Et=(dt=vt.entry)==null?void 0:dt.target,bt=reactExports.useRef();!ht&&Et&&!ot&&!at&&bt.current!==Et&&(bt.current=Et,yt({inView:!!lt,entry:void 0}));const wt=[ft,vt.inView,vt.entry];return wt.ref=wt[0],wt.inView=wt[1],wt.entry=wt[2],wt}function useThumbnail(tt,et){const[rt,st]=reactExports.useState(null),{ref:nt,inView:ot}=useInView({triggerOnce:!0,...et==null?void 0:et.intersectionOptions});return reactExports.useEffect(()=>{var at;(at=et==null?void 0:et.ref)!=null&&at.current&&(nt==null||nt(et.ref.current))},[et==null?void 0:et.ref,nt]),reactExports.useEffect(()=>{if((et==null?void 0:et.ref)===void 0||ot){const at=new Image;return at.src=tt,at.onload=()=>{st(!0)},at.onerror=()=>{st(!1)},()=>{at.onload=null,at.onerror=null,st(null)}}},[ot]),rt}const FileCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:st=!1,onClick:nt,className:ot,onSelect:at,isFocused:lt,app:ut,customIcon:ct,customColor:dt})=>{const ht=reactExports.useRef(null),ft=DocumentHelper.getRole(tt);function xt(St){if(ct!==void 0||dt!==void 0)return{icon:ct||jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:dt||"bg-gray-300",hasShadow:!1};const Rt={csv:{icon:".CSV",color:"bg-orange-200"},xls:{icon:".XLS",color:"bg-green-200"},doc:{icon:".DOC",color:"bg-blue-200"},txt:{icon:".TXT",color:"bg-blue-200"},pdf:{icon:".PDF",color:"bg-red-200"},audio:{icon:jsxRuntimeExports.jsx(SvgIconMic,{width:22,height:22}),color:"bg-red-200"},ppt:{icon:".PPT",color:"bg-yellow-200"},img:{icon:jsxRuntimeExports.jsx(SvgIconLandscape,{width:22,height:22}),color:"bg-green-200"},video:{icon:jsxRuntimeExports.jsx(SvgIconVideo,{width:22,height:22}),color:"bg-purple-200"},zip:{icon:".ZIP",color:"bg-gray-300"},md:{icon:".MD",color:"bg-blue-200"},unknown:{icon:jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:"bg-gray-300"}};return Rt[St]||Rt.unknown}const vt=xt(ft??"unknown"),yt=clsx("file position-relative rounded",(vt==null?void 0:vt.color)??"bg-yellow-200"),Et=ft==="img"||ft==="video"?odeServices.workspace().getThumbnailUrl(tt):null,bt=useThumbnail(Et,{ref:ht}),wt=bt&&{backgroundImage:`url(${Et})`,backgroundSize:"cover"};return jsxRuntimeExports.jsx(Card,{className:clsx("card-file",ot),isClickable:et,isSelectable:rt,isSelected:st,onClick:nt,app:ut,isFocused:lt,onSelect:at,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{ref:ht,className:yt,style:{aspectRatio:"16/10",...wt},children:ft!=="img"||ft==="img"&&!bt?jsxRuntimeExports.jsx(FileIcon,{type:ft,roleMap:vt}):null}),jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.ownerName})]})]})})},Workspace$1=({roles:tt,onSelect:et,multiple:rt=!0,className:st,defaultFolder:nt,showPublicFolder:ot})=>{const{t:at}=useTranslation(),{root:lt,loadContent:ut}=useWorkspaceSearch("root",at("workspace.tree.owner"),"owner",tt),{root:ct,loadContent:dt}=useWorkspaceSearch("root",at("workspace.tree.shared"),"shared",tt),{root:ht,loadContent:ft}=useWorkspaceSearch("root",at("workspace.tree.protected"),"protected",tt),{root:xt,loadContent:vt}=useWorkspaceSearch("root",at("workspace.tree.public"),"public",tt),yt=reactExports.useRef(null),Et=reactExports.useRef(null),bt=reactExports.useRef(null),wt=reactExports.useRef(null),[St,Rt]=reactExports.useState(()=>nt==="public"?ot?nt:"protected":nt==="protected"||nt==="shared"?nt:"owner"),[Ct,It]=reactExports.useState(()=>nt==="public"?ot?xt:ht:nt==="protected"?ht:nt==="shared"?ct:lt),[jt,Pt]=reactExports.useState(),[Ot,Ut]=reactExports.useState(null),[Nt,Ht]=reactExports.useState(["modified","desc"]),[Lt,kt]=reactExports.useState([]),$t=reactExports.useCallback(Yt=>{switch(Yt){case"owner":return{root:lt,othersRef:[Et,bt,wt]};case"shared":return{root:ct,othersRef:[yt,bt,wt]};case"protected":return{root:ht,othersRef:[yt,Et,wt]};case"public":return{root:xt,othersRef:[yt,Et,bt]};default:throw"no.root.node"}},[lt,ct,ht,xt]),Ft=reactExports.useCallback(()=>{switch(St){case"owner":ut(Ct.id);break;case"shared":dt(Ct.id);break;case"protected":ft(Ct.id);break;case"public":vt(Ct.id);break;default:throw"no.way"}},[St,Ct.id,ut,ft,vt,dt]);function Gt(Yt,tr){Rt(Yt);const{root:lr,othersRef:ur}=$t(Yt),mr=findTreeNode(lr,yr=>yr.id===tr);mr&&(It(mr),ur.forEach(yr=>{var or;return(or=yr.current)==null?void 0:or.unselectAll()}))}reactExports.useEffect(()=>{var Yt;let tr;switch(St){case"owner":tr=yt;break;case"shared":tr=Et;break;case"protected":tr=bt;break;case"public":tr=wt;break;default:return}(Yt=tr==null?void 0:tr.current)==null||Yt.select("root")},[St]),reactExports.useEffect(Ft,[Ft]),reactExports.useEffect(()=>{if(Ct.files){let Yt=[].concat(Ct.files);Ot&&(Yt=Yt.filter(lr=>lr.name.indexOf(Ot)>=0));const tr=Nt[0]==="name"?Nt[1]==="asc"?(lr,ur)=>Vt(lr.name,ur.name):(lr,ur)=>Vt(ur.name,lr.name):(lr,ur)=>Vt(ur.modified,lr.modified);Pt(()=>Yt.sort(tr))}else Pt(void 0)},[Ct,lt,ht,ct,xt,Ot,Nt]);const Mt=reactExports.useCallback(Yt=>{Ut(Yt.target.value)},[Ut]);function Vt(Yt,tr){return Yt?tr?Yt.localeCompare(tr):1:-1}function Bt(){return Nt[0]==="name"?Nt[1]==="asc"?at("sort.order.alpha.asc"):at("sort.order.alpha.desc"):at("sort.order.modify.desc")}function qt(Yt){let tr=[...Lt];rt?tr.includes(Yt)?tr=tr.filter(lr=>lr._id!==Yt._id):tr=[...tr,Yt]:tr=[Yt],kt(tr),et(tr)}const Qt=clsx("workspace flex-grow-1 gap-0",st);return jsxRuntimeExports.jsxs(Grid,{className:Qt,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"3",xl:"4",className:"workspace-folders p-12 pt-0 gap-12",children:jsxRuntimeExports.jsxs("div",{style:{position:"sticky",top:0,paddingTop:"1.2rem"},children:[jsxRuntimeExports.jsx(TreeView,{ref:yt,data:lt,onTreeItemClick:Yt=>Gt("owner",Yt),onTreeItemUnfold:Yt=>Gt("owner",Yt)}),jsxRuntimeExports.jsx(TreeView,{ref:Et,data:ct,onTreeItemClick:Yt=>Gt("shared",Yt),onTreeItemUnfold:Yt=>Gt("shared",Yt)}),jsxRuntimeExports.jsx(TreeView,{ref:bt,data:ht,onTreeItemClick:Yt=>Gt("protected",Yt),onTreeItemUnfold:Yt=>Gt("protected",Yt)}),ot&&jsxRuntimeExports.jsx(TreeView,{ref:wt,data:xt,onTreeItemClick:Yt=>Gt("public",Yt),onTreeItemUnfold:Yt=>Gt("public",Yt)})]})}),jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"5",xl:"8",children:jsxRuntimeExports.jsxs(Grid,{className:"flex-grow-1 gap-0",children:[jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",xl:"12",children:[jsxRuntimeExports.jsx("div",{className:"workspace-search px-16 py-8 ",children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,className:"gap-16",onChange:Mt})}),jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center justify-content-end px-8 py-4",children:[jsxRuntimeExports.jsx("small",{className:"text-muted",children:at("workspace.search.order")}),jsxRuntimeExports.jsxs(Dropdown,{children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"sm",label:Bt(),variant:"ghost"}),jsxRuntimeExports.jsxs(Dropdown.Menu,{children:[jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortTime,{}),onClick:()=>Ht(["modified","desc"]),children:at("sort.order.modify.desc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortAscendingLetters,{}),onClick:()=>Ht(["name","asc"]),children:at("sort.order.alpha.asc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortDescendingLetters,{}),onClick:()=>Ht(["name","desc"]),children:at("sort.order.alpha.desc")})]})]})]})]}),jsxRuntimeExports.jsx(Grid.Col,{sm:"4",md:"8",xl:"12",className:"p-8 gap-8",children:jt?jt.length!==0?jsxRuntimeExports.jsx("div",{className:"grid grid-workspace",children:jt.map(Yt=>{const tr=Lt.includes(Yt);return jsxRuntimeExports.jsx(FileCard,{doc:Yt,isSelected:tr,onClick:()=>qt(Yt)},Yt._id)})}):jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,text:at("workspace.empty.docSpace"),title:at("explorer.emptyScreen.trash.title")}):jsxRuntimeExports.jsx(LoadingScreen,{})})]})})]})},Workspace=()=>{const{type:tt,setResultCounter:et,setResult:rt,multiple:st,visibility:nt}=useMediaLibraryContext();function ot(){switch(tt){case"image":return"img";case"audio":return"audio";case"video":return"video";default:return null}}function at(lt){et(lt.length),lt.length?rt(lt):rt()}return jsxRuntimeExports.jsx(Workspace$1,{roles:ot(),onSelect:at,multiple:st,className:"border rounded overflow-y-auto",defaultFolder:nt,showPublicFolder:nt==="public"})},InnerTabs={Audio,Video,Upload,ExternalLink,Workspace,InternalLink,Iframe,VideoEmbedder},TabsContext=reactExports.createContext(null);function useTabsContext(){const tt=reactExports.useContext(TabsContext);if(!tt)throw new Error("Tabs compound components cannot be rendered outside the Tabs component");return tt}const useTabs=({defaultId:tt,items:et,onChange:rt})=>{const[st,nt]=reactExports.useState(tt||""),[ot,at]=reactExports.useState(0),[lt,ut]=reactExports.useState(0),ct=reactExports.useRef([]),dt=reactExports.useCallback(vt=>{nt(vt)},[]);reactExports.useEffect(()=>{const vt=et.find(yt=>yt.id===st);vt&&(rt==null||rt(vt))},[st]),reactExports.useEffect(()=>{function vt(){var yt;if(((yt=document==null?void 0:document.activeElement)==null?void 0:yt.tagName)!=="INPUT"){const Et=et.findIndex(wt=>wt.id===st);Et===-1&&tt&&nt(tt);const bt=ct.current[Et];bt&&(bt.focus(),ut((bt==null?void 0:bt.offsetLeft)??0),at((bt==null?void 0:bt.clientWidth)??0))}}return vt(),window.addEventListener("resize",vt),()=>window.removeEventListener("resize",vt)},[st,et,tt]);const ht=reactExports.useCallback(vt=>{var yt,Et,bt;const wt=et.findIndex(St=>St.id===vt);vt===((yt=et[0])==null?void 0:yt.id)?nt((Et=et[et.length-1])==null?void 0:Et.id):nt((bt=et[wt-1])==null?void 0:bt.id)},[et]),ft=reactExports.useCallback(vt=>{var yt,Et,bt;const wt=et.findIndex(St=>St.id===vt);vt===((yt=et[et.length-1])==null?void 0:yt.id)?nt((Et=et[0])==null?void 0:Et.id):nt((bt=et[wt+1])==null?void 0:bt.id)},[et]),xt=reactExports.useCallback(vt=>{var yt,Et;switch(vt.code){case"ArrowLeft":ht(st);break;case"ArrowRight":ft(st);break;case"Home":nt((yt=et[0])==null?void 0:yt.id);break;case"End":nt((Et=et[et.length-1])==null?void 0:Et.id);break}},[st,et,ft,ht]);return{activeTab:st,setSelectedTab:dt,tabsRef:ct,tabUnderlineLeft:lt,tabUnderlineWidth:ot,onKeyDown:xt}},TabsItem=({icon:tt,badge:et,label:rt,id:st,order:nt})=>{const{activeTab:ot,setSelectedTab:at,onKeyDown:lt,tabsRef:ut}=useTabsContext(),{t:ct}=useTranslation(),dt=clsx("nav-link d-inline-flex gap-8 border-0",ot===st?"selected":"");return jsxRuntimeExports.jsx("li",{className:"nav-item flex-shrink-0",role:"presentation",children:jsxRuntimeExports.jsxs("button",{ref:ht=>ut.current[nt]=ht,type:"button",id:`tab-${st}`,className:dt,onClick:()=>at(st),onKeyDown:ht=>lt(ht),role:"tab","aria-controls":`tabpanel-${st}`,"aria-selected":ot===st,tabIndex:ot===st?0:-1,children:[tt,jsxRuntimeExports.jsxs("small",{children:[ct(rt)," ",et]})]})})},TabsList=tt=>{const{items:et,tabUnderlineLeft:rt,tabUnderlineWidth:st}=useTabsContext(),{className:nt,fullWidth:ot,isSticky:at,stickyTop:lt,...ut}=tt,ct=clsx("nav nav-tabs flex-nowrap",{"w-100":ot}),dt=clsx(" flex-shrink-0 overflow-x-auto",{"position-sticky z-1":at,"position-relative":!at},nt);return jsxRuntimeExports.jsx("div",{className:dt,...ut,style:at?{top:lt}:void 0,children:jsxRuntimeExports.jsxs("ul",{className:ct,role:"tablist",children:[et.map((ht,ft)=>jsxRuntimeExports.jsx(Tabs.Item,{order:ft,...ht},ht.id)),jsxRuntimeExports.jsx("span",{className:"nav-slide",style:{left:rt,width:st}})]})})},TabsPanel=({children:tt,currentItem:et,fullHeight:rt,className:st})=>{const{activeTab:nt}=useTabsContext(),ot=clsx("tab-content d-flex flex-fill w-100",{"position-relative h-100":rt},st);return jsxRuntimeExports.jsx("div",{className:ot,children:jsxRuntimeExports.jsx("div",{className:`tab-pane flex-fill w-100 fade ${nt===(et==null?void 0:et.id)?"show active":""}`,id:`tabpanel-${et==null?void 0:et.id}`,role:"tabpanel","aria-labelledby":`tab-${et==null?void 0:et.id}`,tabIndex:0,children:tt})})},Tabs=({defaultId:tt,items:et,fullWidth:rt=!1,fullHeight:st=!1,onChange:nt,children:ot,isSticky:at=!1,stickyTop:lt=0,headerClassName:ut,contentClassName:ct})=>{const{activeTab:dt,setSelectedTab:ht,tabsRef:ft,tabUnderlineLeft:xt,tabUnderlineWidth:vt,onKeyDown:yt}=useTabs({defaultId:tt,items:et,onChange:nt}),Et=reactExports.useMemo(()=>({activeTab:dt,items:et,setSelectedTab:ht,tabsRef:ft,tabUnderlineLeft:xt,tabUnderlineWidth:vt,onKeyDown:yt}),[dt,et,yt,ht,xt,vt,ft]),bt=et.find(wt=>wt.id===dt);return jsxRuntimeExports.jsx(TabsContext.Provider,{value:Et,children:typeof ot=="function"?ot(bt):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tabs.List,{fullWidth:rt,isSticky:at,stickyTop:lt,className:ut}),jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:bt,fullHeight:st,className:ct,children:bt==null?void 0:bt.content})]})})};Tabs.Item=TabsItem;Tabs.Panel=TabsPanel;Tabs.List=TabsList;const orderedTabs=["audio-capture","video-capture","internal-link","external-link","iframe","upload","workspace","video-embedder"],mediaLibraryTypes={none:null,audio:{title:"bbm.audio.modal.title",defaultTab:"audio-capture"},video:{title:"bbm.video.modal.title",defaultTab:"video-capture"},image:{title:"bbm.image.modal.title",defaultTab:"workspace"},attachment:{title:"bbm.attachment.modal.title",defaultTab:"workspace"},hyperlink:{title:"bbm.link.modal.title",defaultTab:"linker"},embedder:{title:"bbm.embed.modal.title",defaultTab:"iframe"},studio:{title:"bbm.studio.modal.title",defaultTab:"audio-capture"}},MediaLibrary=reactExports.forwardRef(({appCode:tt,visibility:et,multiple:rt,onSuccess:st,onCancel:nt,onTabChange:ot},at)=>{var lt;const ut=reactExports.useRef(),ct=reactExports.useRef(null);reactExports.useImperativeHandle(at,()=>({show:kt,hide:$t,showLink:Ft,type:xt,...ct.current})),useHttpErrorToast({isDismissible:!0,duration:1/0});const{t:dt}=useTranslation(),ht=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"),ft=useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),[xt,vt]=reactExports.useState(null),yt={workspace:{id:"workspace",icon:jsxRuntimeExports.jsx(SvgIconFolder,{}),label:dt("bbm.workspace"),content:jsxRuntimeExports.jsx(InnerTabs.Workspace,{}),availableFor:["audio","video","image","attachment"],isEnable:null},upload:{id:"upload",icon:jsxRuntimeExports.jsx(SvgIconSmartphone,{}),label:dt("bbm.device"),content:jsxRuntimeExports.jsx(InnerTabs.Upload,{}),availableFor:["audio","video","image","attachment"],isEnable:()=>!!ht},"video-capture":{id:"video-capture",icon:jsxRuntimeExports.jsx(SvgIconRecordVideo,{}),label:dt("bbm.video"),content:jsxRuntimeExports.jsx(InnerTabs.Video,{}),availableFor:["video","studio"],isEnable:()=>!!ft},"audio-capture":{id:"audio-capture",icon:jsxRuntimeExports.jsx(SvgIconMic,{}),label:dt("bbm.audio"),content:jsxRuntimeExports.jsx(InnerTabs.Audio,{}),availableFor:["audio","studio"],isEnable:()=>!!ht},"external-link":{id:"external-link",icon:jsxRuntimeExports.jsx(SvgIconGlobe,{}),label:dt("bbm.linker.ext"),content:jsxRuntimeExports.jsx(InnerTabs.ExternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},"internal-link":{id:"internal-link",icon:jsxRuntimeExports.jsx(SvgIconApplications,{}),label:dt("bbm.linker.int"),content:jsxRuntimeExports.jsx(InnerTabs.InternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},iframe:{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.Iframe,{}),availableFor:["embedder"],isEnable:null},"video-embedder":{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.VideoEmbedder,{}),availableFor:["video"],isEnable:null}},Et=reactExports.useMemo(()=>orderedTabs.map(Qt=>yt[Qt]).filter(Qt=>{var Yt;return((Yt=Qt.isEnable)==null?void 0:Yt.call(Qt))!==!1&&(Qt.availableFor.length===0||Qt.availableFor.includes(xt))}),[xt]),[bt,wt]=reactExports.useState(),St=reactExports.useMemo(()=>{const Qt=Et.findIndex(Yt=>Yt.id===bt);return 0>Qt||Qt>=Et.length?0:Qt},[Et,bt]),[Rt,Ct]=reactExports.useState(),[It,jt]=reactExports.useState(),[Pt,Ot]=reactExports.useState([]),[Ut,Nt]=reactExports.useState();function Ht(Qt){throw Et.findIndex(Yt=>Yt.id===Qt)<0?"tab.not.visible":"not.implemented.yet"}function Lt(Qt){ut.current=void 0,wt(void 0),vt(Qt)}const kt=Qt=>{vt(Qt)},$t=()=>{vt(null)},Ft=Qt=>{ut.current=Qt,"resourceId"in Qt||"appPrefix"in Qt||wt("external-link"),vt("hyperlink")};reactExports.useEffect(()=>{var Qt,Yt;const tr=xt||"none";!bt&&typeof((Qt=mediaLibraryTypes[tr])==null?void 0:Qt.defaultTab)=="string"&&wt((Yt=mediaLibraryTypes[tr])==null?void 0:Yt.defaultTab)},[bt,xt]);const Gt=dt(((lt=mediaLibraryTypes[xt??"none"])==null?void 0:lt.title)??"bbm"),Mt=()=>{ut.current=void 0,jt(void 0),Ct(void 0),wt(void 0),Nt(void 0),Ot([])},Vt=Qt=>{ot==null||ot(Qt,Pt),Mt()},Bt=reactExports.useCallback(()=>{const Qt=async Yt=>{Yt instanceof Array&&["protected","public"].findIndex(tr=>tr===et)>=0&&(Yt=await odeServices.workspace().transferDocuments(Yt,tt??"media-library",et)),st(Yt)};Ut?Ut().then(Yt=>{Qt(Yt)}):It&&Qt(It),Mt()},[Ut,It,st,et,tt]),qt=()=>{nt(Pt),Mt()};return xt&&jsxRuntimeExports.jsx(MediaLibraryContext.Provider,{value:{appCode:tt,visibility:et,multiple:rt,type:xt,setResultCounter:Ct,setResult:jt,setCancellable:Qt=>Ot([...Qt]),setVisibleTab:Ht,switchType:Lt,setPreSuccess:Nt},children:jsxRuntimeExports.jsxs(Modal,{id:"media-library",isOpen:xt!==null,onModalClose:qt,size:"lg",viewport:!0,scrollable:!0,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:qt,children:Gt}),jsxRuntimeExports.jsx(Tabs,{items:Et,defaultId:Et[St].id,onChange:Vt,children:Qt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Et.length>1&&jsxRuntimeExports.jsx(Tabs.List,{className:"mt-16"}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex",children:jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:Qt,children:Qt==null?void 0:Qt.content})})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:qt,children:dt("cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",disabled:typeof It>"u",onClick:Bt,children:Rt&&Rt>1?dt("addMultiple",{number:Rt}):dt("add")})]})]})})});function PublishModal$2({isOpen:tt,resourceId:et,onSuccess:rt,onCancel:st}){const{appCode:nt,currentApp:ot}=useEdificeClient(),{ref:at,libraryMedia:lt,...ut}=useMediaLibrary(),{t:ct}=useTranslation(),dt=useResource(nt,et),{control:ht,cover:ft,formState:{isDirty:xt,isValid:vt,isSubmitting:yt},handleDeleteImage:Et,handleSubmit:bt,handleUploadImage:wt,handlePublish:St,register:Rt,selectActivities:Ct,selectedActivities:It,selectedSubjectAreas:jt,selectSubjects:Pt}=usePublishModal({resource:dt,onSuccess:rt});return dt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:st,id:"libraryModal",size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:st,children:ct("bpr.publish")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:ct("bpr.form.tip")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.general")}),jsxRuntimeExports.jsxs("form",{id:"libraryModalForm",onSubmit:bt(St),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[jsxRuntimeExports.jsxs("div",{style:{maxWidth:"160px"},children:[jsxRuntimeExports.jsx("div",{className:"form-label",children:ct("bpr.form.publication.cover.title")}),jsxRuntimeExports.jsx(ImagePicker,{app:ot,src:dt==null?void 0:dt.thumbnail,addButtonLabel:ct("bpr.form.publication.cover.upload.add"),deleteButtonLabel:ct("bpr.form.publication.cover.upload.remove"),onUploadImage:wt,onDeleteImage:Et,className:"align-self-center",libraryMedia:lt,mediaLibraryRef:at}),!ft&&jsxRuntimeExports.jsx("p",{className:"form-text is-invalid",children:jsxRuntimeExports.jsx("em",{children:ct("bpr.form.publication.cover.upload.required.image")})})]}),jsxRuntimeExports.jsxs("div",{className:"flex-fill",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:dt==null?void 0:dt.name,...Rt("title",{required:!0}),placeholder:ct("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.description")}),jsxRuntimeExports.jsx(TextArea,{...Rt("description",{required:!0}),placeholder:ct("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.infos")}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[jsxRuntimeExports.jsx(ActivitiesDropdown,{control:ht,selectedActivities:It,selectActivities:Ct}),jsxRuntimeExports.jsx(SubjectsDropdown,{control:ht,selectedSubjectAreas:jt,selectSubjects:Pt}),jsxRuntimeExports.jsx(LangSelect,{control:ht})]}),jsxRuntimeExports.jsxs("div",{className:"mb-24",children:[jsxRuntimeExports.jsx("label",{htmlFor:"",className:"form-label",children:ct("bpr.form.publication.age")}),jsxRuntimeExports.jsxs("div",{className:"d-flex gap-8",children:[jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(Nt,Ht)=>parseInt(Nt)<=parseInt(Ht.ageMax)})}),jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(Nt,Ht)=>parseInt(Nt)>=parseInt(Ht.ageMin)})})]})]}),jsxRuntimeExports.jsx("div",{className:"mb-24",children:jsxRuntimeExports.jsxs(FormControl,{id:"keywords",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.keywords")}),jsxRuntimeExports.jsx(Input,{type:"text",...Rt("keyWords"),size:"md",placeholder:ct("bpr.form.publication.keywords.placeholder")})]})}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.licence.text")}),jsxRuntimeExports.jsx(PublishModalFooter,{})]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:st,type:"button",variant:"ghost",children:ct("cancel")}),jsxRuntimeExports.jsx(Button,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:yt,disabled:!ft||yt||!xt||!vt,children:ct("bpr.form.submit")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:nt,ref:at,multiple:!1,visibility:"protected",...ut})]}),document.getElementById("portal")):jsxRuntimeExports.jsx(LoadingScreen,{})}const SvgIconCopy=({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:"M6.676 3c.284-.672.853-1 1.263-1h11.423c.566 0 1.438.628 1.438 1.923v13.154c0 1.056-.58 1.668-1.1 1.858V6.923C19.7 4.99 18.3 3 16.061 3zm-2.272.007C4.765 1.41 6.056 0 7.939 0h11.423C21.599 0 23 1.99 23 3.923v13.154c0 1.865-1.303 3.782-3.403 3.916C19.235 22.59 17.944 24 16.06 24H4.638C2.401 24 1 22.01 1 20.077V6.923c0-1.865 1.303-3.782 3.404-3.916M3.2 6.923C3.2 5.628 4.072 5 4.638 5h11.423c.567 0 1.439.628 1.439 1.923v13.154c0 1.295-.872 1.923-1.439 1.923H4.638c-.566 0-1.438-.628-1.438-1.923z",clipRule:"evenodd"})]}),defaults=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function objectHash(tt,et){et?et={...defaults,...et}:et=defaults;const rt=createHasher(et);return rt.dispatch(tt),rt.toString()}const defaultPrototypesKeys=Object.freeze(["prototype","__proto__","constructor"]);function createHasher(tt){let et="",rt=new Map;const st=nt=>{et+=nt};return{toString(){return et},getContext(){return rt},dispatch(nt){return tt.replacer&&(nt=tt.replacer(nt)),this[nt===null?"null":typeof nt](nt)},object(nt){if(nt&&typeof nt.toJSON=="function")return this.object(nt.toJSON());const ot=Object.prototype.toString.call(nt);let at="";const lt=ot.length;lt<10?at="unknown:["+ot+"]":at=ot.slice(8,lt-1),at=at.toLowerCase();let ut=null;if((ut=rt.get(nt))===void 0)rt.set(nt,rt.size);else return this.dispatch("[CIRCULAR:"+ut+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(nt))return st("buffer:"),st(nt.toString("utf8"));if(at!=="object"&&at!=="function"&&at!=="asyncfunction")this[at]?this[at](nt):tt.ignoreUnknown||this.unkown(nt,at);else{let ct=Object.keys(nt);tt.unorderedObjects&&(ct=ct.sort());let dt=[];tt.respectType!==!1&&!isNativeFunction(nt)&&(dt=defaultPrototypesKeys),tt.excludeKeys&&(ct=ct.filter(ft=>!tt.excludeKeys(ft)),dt=dt.filter(ft=>!tt.excludeKeys(ft))),st("object:"+(ct.length+dt.length)+":");const ht=ft=>{this.dispatch(ft),st(":"),tt.excludeValues||this.dispatch(nt[ft]),st(",")};for(const ft of ct)ht(ft);for(const ft of dt)ht(ft)}},array(nt,ot){if(ot=ot===void 0?tt.unorderedArrays!==!1:ot,st("array:"+nt.length+":"),!ot||nt.length<=1){for(const ut of nt)this.dispatch(ut);return}const at=new Map,lt=nt.map(ut=>{const ct=createHasher(tt);ct.dispatch(ut);for(const[dt,ht]of ct.getContext())at.set(dt,ht);return ct.toString()});return rt=at,lt.sort(),this.array(lt,!1)},date(nt){return st("date:"+nt.toJSON())},symbol(nt){return st("symbol:"+nt.toString())},unkown(nt,ot){if(st(ot),!!nt&&(st(":"),nt&&typeof nt.entries=="function"))return this.array(Array.from(nt.entries()),!0)},error(nt){return st("error:"+nt.toString())},boolean(nt){return st("bool:"+nt)},string(nt){st("string:"+nt.length+":"),st(nt)},function(nt){st("fn:"),isNativeFunction(nt)?this.dispatch("[native]"):this.dispatch(nt.toString()),tt.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(nt.name)),tt.respectFunctionProperties&&this.object(nt)},number(nt){return st("number:"+nt)},xml(nt){return st("xml:"+nt.toString())},null(){return st("Null")},undefined(){return st("Undefined")},regexp(nt){return st("regex:"+nt.toString())},uint8array(nt){return st("uint8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint8clampedarray(nt){return st("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(nt))},int8array(nt){return st("int8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint16array(nt){return st("uint16array:"),this.dispatch(Array.prototype.slice.call(nt))},int16array(nt){return st("int16array:"),this.dispatch(Array.prototype.slice.call(nt))},uint32array(nt){return st("uint32array:"),this.dispatch(Array.prototype.slice.call(nt))},int32array(nt){return st("int32array:"),this.dispatch(Array.prototype.slice.call(nt))},float32array(nt){return st("float32array:"),this.dispatch(Array.prototype.slice.call(nt))},float64array(nt){return st("float64array:"),this.dispatch(Array.prototype.slice.call(nt))},arraybuffer(nt){return st("arraybuffer:"),this.dispatch(new Uint8Array(nt))},url(nt){return st("url:"+nt.toString())},map(nt){st("map:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},set(nt){st("set:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},file(nt){return st("file:"),this.dispatch([nt.name,nt.size,nt.type,nt.lastModfied])},blob(){if(tt.ignoreUnknown)return st("[blob]");throw new Error(`Hashing Blob objects is currently not supported
|
|
1391
|
+
}`,this._stylesheet)}get stylesheet(){return this._stylesheet}set stylesheet(et){this._stylesheet!==et&&(this._stylesheet=et,this.styleID++)}normalizeColor(et){return Array.isArray(et)&&(et=rgb2hex(et)),typeof et=="number"?hex2string(et):et}dropShadowToCSS(){let et=this.normalizeColor(this.dropShadowColor);const rt=this.dropShadowAlpha,st=Math.round(Math.cos(this.dropShadowAngle)*this.dropShadowDistance),nt=Math.round(Math.sin(this.dropShadowAngle)*this.dropShadowDistance);et.startsWith("#")&&rt<1&&(et+=(rt*255|0).toString(16).padStart(2,"0"));const ot=`${st}px ${nt}px`;return this.dropShadowBlur>0?`text-shadow: ${ot} ${this.dropShadowBlur}px ${et}`:`text-shadow: ${ot} ${et}`}reset(){Object.assign(this,Kl.defaultOptions)}onBeforeDraw(){const{fontsDirty:et}=this;return this.fontsDirty=!1,this.isSafari&&this._fonts.length>0&&et?new Promise(rt=>setTimeout(rt,100)):Promise.resolve()}get isSafari(){const{userAgent:et}=settings.ADAPTER.getNavigator();return/^((?!chrome|android).)*safari/i.test(et)}set fillGradientStops(et){console.warn("[HTMLTextStyle] fillGradientStops is not supported by HTMLText")}get fillGradientStops(){return super.fillGradientStops}set fillGradientType(et){console.warn("[HTMLTextStyle] fillGradientType is not supported by HTMLText")}get fillGradientType(){return super.fillGradientType}set miterLimit(et){console.warn("[HTMLTextStyle] miterLimit is not supported by HTMLText")}get miterLimit(){return super.miterLimit}set trim(et){console.warn("[HTMLTextStyle] trim is not supported by HTMLText")}get trim(){return super.trim}set textBaseline(et){console.warn("[HTMLTextStyle] textBaseline is not supported by HTMLText")}get textBaseline(){return super.textBaseline}set leading(et){console.warn("[HTMLTextStyle] leading is not supported by HTMLText")}get leading(){return super.leading}set lineJoin(et){console.warn("[HTMLTextStyle] lineJoin is not supported by HTMLText")}get lineJoin(){return super.lineJoin}};_HTMLTextStyle.availableFonts={},_HTMLTextStyle.defaultOptions={align:"left",breakWords:!1,dropShadow:!1,dropShadowAlpha:1,dropShadowAngle:Math.PI/6,dropShadowBlur:0,dropShadowColor:"black",dropShadowDistance:5,fill:"black",fontFamily:"Arial",fontSize:26,fontStyle:"normal",fontVariant:"normal",fontWeight:"normal",letterSpacing:0,lineHeight:0,padding:0,stroke:"black",strokeThickness:0,whiteSpace:"normal",wordWrap:!1,wordWrapWidth:100};let HTMLTextStyle=_HTMLTextStyle;const _HTMLText=class Ql extends Sprite{constructor(et="",rt={}){super(Texture.EMPTY),this._text=null,this._style=null,this._autoResolution=!0,this.localStyleID=-1,this.dirty=!1,this._updateID=0,this.ownsStyle=!1;const st=new Image,nt=Texture.from(st,{scaleMode:settings.SCALE_MODE,resourceOptions:{autoLoad:!1}});nt.orig=new Rectangle,nt.trim=new Rectangle,this.texture=nt;const ot="http://www.w3.org/2000/svg",at="http://www.w3.org/1999/xhtml",lt=document.createElementNS(ot,"svg"),ut=document.createElementNS(ot,"foreignObject"),ct=document.createElementNS(at,"div"),dt=document.createElementNS(at,"style");ut.setAttribute("width","10000"),ut.setAttribute("height","10000"),ut.style.overflow="hidden",lt.appendChild(ut),this.maxWidth=Ql.defaultMaxWidth,this.maxHeight=Ql.defaultMaxHeight,this._domElement=ct,this._styleElement=dt,this._svgRoot=lt,this._foreignObject=ut,this._foreignObject.appendChild(dt),this._foreignObject.appendChild(ct),this._image=st,this._loadImage=new Image,this._autoResolution=Ql.defaultAutoResolution,this._resolution=Ql.defaultResolution??settings.RESOLUTION,this.text=et,this.style=rt}measureText(et){var dt,ht;const{text:rt,style:st,resolution:nt}=Object.assign({text:this._text,style:this._style,resolution:this._resolution},et);Object.assign(this._domElement,{innerHTML:rt,style:st.toCSS(nt)}),this._styleElement.textContent=st.toGlobalCSS(),document.body.appendChild(this._svgRoot);const ot=this._domElement.getBoundingClientRect();this._svgRoot.remove();const{width:at,height:lt}=ot;(at>this.maxWidth||lt>this.maxHeight)&&console.warn("[HTMLText] Large expanse of text, increase HTMLText.maxWidth or HTMLText.maxHeight property.");const ut=Math.min(this.maxWidth,Math.ceil(at)),ct=Math.min(this.maxHeight,Math.ceil(lt));return this._svgRoot.setAttribute("width",ut.toString()),this._svgRoot.setAttribute("height",ct.toString()),rt!==this._text&&(this._domElement.innerHTML=this._text),st!==this._style&&(Object.assign(this._domElement,{style:(dt=this._style)==null?void 0:dt.toCSS(nt)}),this._styleElement.textContent=(ht=this._style)==null?void 0:ht.toGlobalCSS()),{width:ut+st.padding*2,height:ct+st.padding*2}}async updateText(et=!0){const{style:rt,_image:st,_loadImage:nt}=this;if(this.localStyleID!==rt.styleID&&(this.dirty=!0,this.localStyleID=rt.styleID),!this.dirty&&et)return;const{width:ot,height:at}=this.measureText();st.width=nt.width=Math.ceil(Math.max(1,ot)),st.height=nt.height=Math.ceil(Math.max(1,at)),this._updateID++;const lt=this._updateID;await new Promise(ut=>{nt.onload=async()=>{if(lt<this._updateID){ut();return}await rt.onBeforeDraw(),st.src=nt.src,nt.onload=null,nt.src="",this.updateTexture(),ut()};const ct=new XMLSerializer().serializeToString(this._svgRoot);nt.src=`data:image/svg+xml;charset=utf8,${encodeURIComponent(ct)}`})}get source(){return this._image}updateTexture(){const{style:et,texture:rt,_image:st,resolution:nt}=this,{padding:ot}=et,{baseTexture:at}=rt;rt.trim.width=rt._frame.width=st.width/nt,rt.trim.height=rt._frame.height=st.height/nt,rt.trim.x=-ot,rt.trim.y=-ot,rt.orig.width=rt._frame.width-ot*2,rt.orig.height=rt._frame.height-ot*2,this._onTextureUpdate(),at.setRealSize(st.width,st.height,nt),this.dirty=!1}_render(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._render(et)}_renderCanvas(et){this._autoResolution&&this._resolution!==et.resolution&&(this._resolution=et.resolution,this.dirty=!0),this.updateText(!0),super._renderCanvas(et)}getLocalBounds(et){return this.updateText(!0),super.getLocalBounds(et)}_calculateBounds(){this.updateText(!0),this.calculateVertices(),this._bounds.addQuad(this.vertexData)}_onStyleChange(){this.dirty=!0}destroy(et){var st,nt,ot,at,lt;typeof et=="boolean"&&(et={children:et}),et=Object.assign({},Ql.defaultDestroyOptions,et),super.destroy(et);const rt=null;this.ownsStyle&&((st=this._style)==null||st.cleanFonts()),this._style=rt,(nt=this._svgRoot)==null||nt.remove(),this._svgRoot=rt,(ot=this._domElement)==null||ot.remove(),this._domElement=rt,(at=this._foreignObject)==null||at.remove(),this._foreignObject=rt,(lt=this._styleElement)==null||lt.remove(),this._styleElement=rt,this._loadImage.src="",this._loadImage.onload=null,this._loadImage=rt,this._image.src="",this._image=rt}get width(){return this.updateText(!0),Math.abs(this.scale.x)*this._image.width/this.resolution}set width(et){this.updateText(!0);const rt=sign(this.scale.x)||1;this.scale.x=rt*et/this._image.width/this.resolution,this._width=et}get height(){return this.updateText(!0),Math.abs(this.scale.y)*this._image.height/this.resolution}set height(et){this.updateText(!0);const rt=sign(this.scale.y)||1;this.scale.y=rt*et/this._image.height/this.resolution,this._height=et}get style(){return this._style}set style(et){this._style!==et&&(et=et||{},et instanceof HTMLTextStyle?(this.ownsStyle=!1,this._style=et):et instanceof TextStyle?(console.warn("[HTMLText] Cloning TextStyle, if this is not what you want, use HTMLTextStyle"),this.ownsStyle=!0,this._style=HTMLTextStyle.from(et)):(this.ownsStyle=!0,this._style=new HTMLTextStyle(et)),this.localStyleID=-1,this.dirty=!0)}get text(){return this._text}set text(et){et=String(et===""||et===null||et===void 0?" ":et),et=this.sanitiseText(et),this._text!==et&&(this._text=et,this.dirty=!0)}get resolution(){return this._resolution}set resolution(et){this._autoResolution=!1,this._resolution!==et&&(this._resolution=et,this.dirty=!0)}sanitiseText(et){return et.replace(/<br>/gi,"<br/>").replace(/<hr>/gi,"<hr/>").replace(/ /gi," ")}};_HTMLText.defaultDestroyOptions={texture:!0,children:!1,baseTexture:!0},_HTMLText.defaultMaxWidth=2024,_HTMLText.defaultMaxHeight=2024,_HTMLText.defaultAutoResolution=!0;const MIN_HEIGHT=100,MIN_WIDTH=100,MODAL_VERTICAL_PADDING=450,MODAL_HORIZONTAL_PADDING=64,DEFAULT_QUALITY=.5,DEFAULT_SPRITE_NAME="image";function updateImageFromBlob(tt,{spriteName:et,imgDatasource:rt,settings:st}){const nt=URL.createObjectURL(rt),ot=new Image;return ot.src=nt,new Promise(at=>{ot.onload=async()=>{await updateImage(tt,{spriteName:et,imgDatasource:ot,settings:st});const lt=tt==null?void 0:tt.stage.getChildByName(et,!0);at(lt)}})}async function updateImage(tt,{spriteName:et,imgDatasource:rt,settings:st}){if(tt===void 0||tt.stage===null)return;const nt=tt.stage.getChildByName(et,!0);nt==null||nt.removeFromParent();const ot=rt instanceof HTMLImageElement?Texture.from(rt):rt instanceof Sprite?rt:await Texture.fromURL(rt),at=ot instanceof Sprite?ot:Sprite.from(ot,{});if(at.interactive=!0,at.name=et,st){const{sprite:{anchor:lt,position:ut,scale:ct,size:dt,rotation:ht},stage:{size:ft}}=st,xt=ht%Math.PI!==0;at.anchor.x=lt.x,at.anchor.y=lt.y,at.position.x=ut.x,at.position.y=ut.y,at.scale.x=ct.x,at.scale.y=ct.y,at.width=xt?dt.height:dt.width,at.height=xt?dt.width:dt.height,tt.stage.height=ft.height,tt.stage.width=ft.width,tt.renderer.resize(ft.width,ft.height),tt.stage.addChild(at)}else tt.stage.addChild(at),tt.renderer.resize(at.width,at.height);autoResize(tt,at)}function autoResize(tt,et){var rt;const st=tt.view.parentNode,nt=window.innerWidth-MODAL_HORIZONTAL_PADDING,ot=Math.max((st==null?void 0:st.offsetWidth)??0,MIN_WIDTH),at=constraintSize({width:et.width,height:et.height},{width:{max:Math.min(ot,nt),min:MIN_WIDTH},height:{min:MIN_HEIGHT,max:window.innerHeight-MODAL_VERTICAL_PADDING}}),{height:lt,width:ut}=at;(rt=tt.view)!=null&&rt.style&&(tt.view.style.width=`${ut}px`,tt.view.style.height=`${lt}px`)}function constraintSize(tt,et){const{height:rt,width:st}=tt,nt=st/rt,{height:ot,width:at}=et;let lt=at.max,ut=at.max/nt;return st>at.max&&(lt=at.max,ut=lt/nt),ut>ot.max&&(ut=ot.max,lt=ut*nt),lt<at.min&&(lt=at.min,ut=lt/nt),ut<ot.min&&(ut=ot.min,lt=ut*nt),{width:lt,height:ut}}function saveAsBlob(tt){return new Promise((et,rt)=>{var st;(st=tt==null?void 0:tt.view)!=null&&st.toBlob?tt.view.toBlob(nt=>{nt?et(nt):rt("EXTRACT_FAILED")},"image/jpeg",DEFAULT_QUALITY):rt("EXTRACT_FAILED")})}function saveAsDataURL(tt){var et,rt;return(rt=(et=tt.view).toDataURL)==null?void 0:rt.call(et)}function getApplicationScale(tt){return tt.view.getBoundingClientRect?tt.view.getBoundingClientRect().width/tt.view.width:1}function toBlob(tt){return new Promise((et,rt)=>{var st,nt;(nt=(st=tt.view).toBlob)==null||nt.call(st,ot=>{ot?et(ot):rt("EXTRACT_FAIL")},"image/png",1)})}function createImageSettings({application:tt,sprite:et}){return{sprite:{rotation:et.rotation,size:{width:et.width,height:et.height},position:{x:et.position.x,y:et.position.y},scale:{x:et.scale.x,y:et.scale.y},anchor:{x:et.anchor.x,y:et.anchor.y}},stage:{size:{width:tt.stage.width,height:tt.stage.height},scale:{x:tt.stage.scale.x,y:tt.stage.scale.y}}}}function resizeStage({application:tt,sprite:et,newHeight:rt,newWidth:st}){et.anchor.x=.5,et.anchor.y=.5,et.position=new Point(st/2,rt/2),tt.stage.height=rt,tt.stage.width=st,tt.renderer.resize(st,rt)}const DEFAULT_MAX_HISTORY=20,useHistoryTool=({maxSize:tt=DEFAULT_MAX_HISTORY,application:et,spriteName:rt,onRestore:st})=>{const[nt,ot]=reactExports.useState([]);reactExports.useEffect(()=>{ot([])},[et]);const at=async()=>{const ct=nt.pop();ct&&(st(await ct.backup,ct),ot(nt.filter(dt=>dt!==ct)))},lt=ct=>(ct.length>tt&&ct.splice(0,ct.length-tt),ct),ut=async ct=>{{if(!et)return;const dt=et.stage.getChildByName(rt,!0);if(dt==null)return;const ht=toBlob(et),ft={backup:ht,sprite:{rotation:dt.rotation,size:{width:dt.width,height:dt.height},position:{x:dt.position.x,y:dt.position.y},scale:{x:dt.scale.x,y:dt.scale.y},anchor:{x:dt.anchor.x,y:dt.anchor.y}},stage:{size:{width:et.stage.width,height:et.stage.height},scale:{x:et.stage.scale.x,y:et.stage.scale.y}}};return ot([...lt(nt),ft]),await ht,ct.call(ct)}};return{historyCount:nt.length,restore:at,historize:ut}};function aggregate(tt,et,rt){let st;const nt=[];return function(ot){nt.push(et(ot)),!st&&(st=setTimeout(()=>{const at=[...nt];nt.splice(0,nt.length),rt(at),st=void 0},tt))}}const BRUSH_SIZE=20,DEBOUNCE=50,CURSOR_NAME="BRUSH_CURSOR";function drawBrush(tt,et){const rt=new Graphics;for(const st of tt)st&&(rt.beginFill(16777215,1),rt.drawCircle(st.x,st.y,BRUSH_SIZE/et),rt.lineStyle(0),rt.endFill());return rt}function drawBlurListener(tt,{spriteName:et}){return aggregate(DEBOUNCE,rt=>tt.stage.toLocal(rt.global),rt=>{const st=tt.stage.getChildByName(et),nt=getApplicationScale(tt);if(st==null)return;const ot=new Sprite(st.texture);ot.filters=[new BlurFilter(8,4,Math.min(nt,1))],ot.width=st.width,ot.height=st.height,ot.scale=new Point(1,1),ot.anchor=st.anchor,ot.mask=drawBrush(rt,nt),st.addChild(ot)})}function drawCursor(tt){removeCursor(tt);const et=getApplicationScale(tt),rt=new Graphics;return rt.lineStyle(Math.max(1,1/et),16711680),rt.drawCircle(0,0,BRUSH_SIZE/et),rt.endFill(),rt.name=CURSOR_NAME,tt.stage.addChild(rt),rt}function removeCursor(tt){const et=tt.stage.getChildByName(CURSOR_NAME);et&&et.removeFromParent()}function moveCursorListener(tt){return et=>{if(!tt)return;const rt=tt.stage.toLocal(et.global),st=tt.stage.getChildByName(CURSOR_NAME,!0);st&&(st.position.x=rt.x,st.position.y=rt.y)}}function start$2(tt,{spriteName:et}){tt.stage.interactive=!0;const rt=drawCursor(tt),st=moveCursorListener(tt);tt.stage.on("pointermove",st);const nt=drawBlurListener(tt,{spriteName:et});tt.stage.on("pointerdown",()=>{tt.stage.on("pointermove",nt)});const ot=()=>{var at;(at=tt==null?void 0:tt.stage)==null||at.off("pointermove",nt)};globalThis.addEventListener("pointerup",ot),rt.once("destroyed",()=>{globalThis.removeEventListener("pointerup",ot)})}function stop$2(tt){removeCursor(tt),tt.stage.off("pointerdown"),tt.stage.off("pointermove")}const CORNERS=["TOP_LEFT","TOP_RIGHT","BOTTOM_LEFT","BOTTOM_RIGHT"],PADDING=0,POINT_RADIUS$1=20,CROP_BACKGROUND_NAME="CROP_BACKGROUND_NAME",CROP_MASK_NAME="CROP_MASK_NAME";function getCornerName$1(tt){return"CROP_CORNER_"+tt}function drawBackground(tt,{spriteName:et}){removeBackground(tt);const rt=tt.stage.getChildByName(et);if(rt==null)return;const st=rt.getBounds(),nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);ot.height=st.height,ot.width=st.width,ot.position=new Point(0,0);const at=new Graphics;at.beginFill(16777215,.5),at.drawRect(0,0,st.width,st.height),at.endFill(),at.name=CROP_BACKGROUND_NAME,at.position=new Point(st.x,st.y);const lt=new Graphics;lt.beginFill(0,1),lt.drawRect(0,0,st.width-2*PADDING,st.height-2*PADDING),lt.endFill(),lt.position=new Point(PADDING,PADDING),lt.name=CROP_MASK_NAME,ot.mask=lt,tt.stage.addChild(at),at.addChild(lt),at.addChild(ot)}function removeBackground(tt){const et=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0);et==null||et.removeFromParent()}function computeCornerPosition$1(tt,et){switch(tt){case"TOP_LEFT":return{x:et.x,y:et.y,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:et.x+et.width,y:et.y,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:et.x,y:et.y+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:et.x+et.width,y:et.y+et.height,start:Math.PI,end:3*Math.PI/2}}}function refreshCorners(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);et!=null&&CORNERS.forEach(rt=>{const st=tt.stage.getChildByName(getCornerName$1(rt),!0);if(st==null)return;const nt=computeCornerPosition$1(rt,{height:et.height,width:et.width,x:et.x,y:et.y});st.position=new Point(nt.x,nt.y)})}function drawCorner$1(tt,et,{spriteName:rt}){const st=tt.stage.getChildByName(getCornerName$1(et),!0),nt=getApplicationScale(tt);st==null||st.removeFromParent();const ot=tt.stage.getChildByName(CROP_BACKGROUND_NAME,!0),at=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(tt.stage.getChildByName(rt)==null||ot===null||ot===void 0||at===void 0||at===null)return;const ut=computeCornerPosition$1(et,{height:at.height,width:at.width,x:at.x,y:at.y}),ct=new Graphics;ct.beginFill(4960213,1),ct.arc(0,0,POINT_RADIUS$1/nt,ut.start,ut.end),ct.lineTo(0,0),ct.endFill(),ct.position=new Point(ut.x,ut.y),ct.name=getCornerName$1(et),ct.interactive=!0;let dt=!1;tt.stage.on("pointermove",xt=>{if(dt===!1)return;const vt=ot.toLocal(xt.global);ct.position.x=vt.x,ct.position.y=vt.y,moveMask(tt,et,vt)});const ht=()=>{dt=!0};ct.on("pointerdown",ht);const ft=()=>{dt=!1};globalThis.addEventListener("pointerup",ft),ct.once("destroyed",()=>{ct.off("pointerdown"),globalThis.removeEventListener("pointerup",ft)}),ot.addChild(ct)}function moveMask(tt,et,rt){const st=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(st==null)return;const nt=st.position.x+st.width,ot=st.position.y+st.height;switch(et){case"TOP_LEFT":{st.position.x=rt.x,st.position.y=rt.y,st.width=nt-rt.x,st.height=ot-rt.y;break}case"TOP_RIGHT":{st.position.y=rt.y,st.width=rt.x-st.position.x,st.height=ot-rt.y;break}case"BOTTOM_LEFT":{st.position.x=rt.x,st.width=nt-rt.x,st.height=rt.y-st.position.y;break}case"BOTTOM_RIGHT":{st.width=rt.x-st.position.x,st.height=rt.y-st.position.y;break}}refreshCorners(tt)}function start$1(tt,{spriteName:et}){stop$1(tt),tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,drawBackground(tt,{spriteName:et}),drawCorner$1(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner$1(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner$1(tt,"TOP_LEFT",{spriteName:et}),drawCorner$1(tt,"TOP_RIGHT",{spriteName:et})}function stop$1(tt){removeBackground(tt),tt.stage.off("pointermove"),tt.render()}function save$1(tt){const et=tt.stage.getChildByName(CROP_MASK_NAME,!0);if(et==null)return;stop$1(tt);const rt=tt.renderer.generateTexture(tt.stage).clone(),st=new Sprite(rt),nt=et.getBounds(),ot=new Rectangle(Math.floor(nt.x),Math.floor(nt.y),Math.floor(nt.width),Math.floor(nt.height)),at=new Texture(st.texture.baseTexture,ot);return new Sprite(at)}const POINT_RADIUS=20,CONTROL_NAME="CONTROL_NAME";function getCornerName(tt){return"RESIZE_CORNER_"+tt}function computeCornerPosition(tt,et){const rt=et.x,st=et.y;switch(tt){case"TOP_LEFT":return{x:rt,y:st,start:0,end:Math.PI/2};case"TOP_RIGHT":return{x:rt+et.width,y:st,start:Math.PI/2,end:Math.PI};case"BOTTOM_LEFT":return{x:rt,y:st+et.height,start:3*Math.PI/2,end:2*Math.PI};case"BOTTOM_RIGHT":return{x:rt+et.width,y:st+et.height,start:Math.PI,end:3*Math.PI/2}}}function resizeContainer(tt,{container:et,cornerType:rt,position:st,spriteName:nt}){const ot=tt.stage.getChildByName(nt,!0);if(ot==null)return;const at=ot.rotation%Math.PI!==0,lt=at?ot.height:ot.width,ut=at?ot.width:ot.height;switch(rt){case"TOP_LEFT":{et.position=new Point(st.x,st.y),et.width=lt-2*st.x,et.height=ut-2*st.y;break}case"TOP_RIGHT":{const ct=lt-st.x;et.position=new Point(ct,st.y),et.width=lt-2*ct,et.height=ut-2*st.y;break}case"BOTTOM_LEFT":{const ct=ut-st.y;et.position=new Point(st.x,ct),et.width=lt-2*st.x,et.height=ut-2*ct;break}case"BOTTOM_RIGHT":{const ct=ut-st.y,dt=lt-st.x;et.position=new Point(dt,ct),et.width=lt-2*dt,et.height=ut-2*ct;break}}}function removeCorner(tt,et){const rt=tt.stage.getChildByName(getCornerName(et),!0);rt==null||rt.removeFromParent()}function drawCorner(tt,et,{spriteName:rt}){removeCorner(tt,et);const st=tt.stage.getChildByName(rt,!0),nt=tt.stage.getChildByName(CONTROL_NAME,!0);if(st==null||nt===null||nt===void 0)return;const ot=computeCornerPosition(et,nt),at=new Graphics;at.beginFill(4960213,1),at.arc(0,0,POINT_RADIUS,ot.start,ot.end),at.lineTo(0,0),at.endFill(),at.position=new Point(ot.x,ot.y),at.name=getCornerName(et),at.interactive=!0;let lt=!1;tt.stage.on("pointermove",dt=>{if(lt===!1)return;const ht=tt.stage.toLocal(dt.global);resizeContainer(tt,{cornerType:et,position:ht,container:nt,spriteName:rt})});const ut=()=>{lt=!1};globalThis.addEventListener("pointerup",ut),at.once("destroyed",()=>{at.off("pointerdown"),globalThis.removeEventListener("pointerup",ut)});const ct=()=>{lt=!0};at.on("pointerdown",ct),nt.addChild(at)}function drawContainer(tt,et){removeContainer(tt);const rt=tt.stage.getChildByName(et,!0);if(rt==null)return;const st=tt.renderer.generateTexture(tt.stage),nt=new Sprite(st);tt.stage.children.forEach(at=>{at.alpha=0});const ot=new Graphics;ot.drawRect(0,0,rt.width,rt.height),ot.name=CONTROL_NAME,ot.interactive=!0,ot.interactiveChildren=!0,tt.stage.interactive=!0,tt.stage.interactiveChildren=!0,tt.stage.addChild(ot),ot.addChild(nt)}function removeContainer(tt){const et=tt.stage.getChildByName(CONTROL_NAME,!0);et==null||et.removeFromParent(),tt.stage.children.forEach(rt=>{rt.alpha=1})}function drawControl(tt,et){drawContainer(tt,et),drawCorner(tt,"BOTTOM_LEFT",{spriteName:et}),drawCorner(tt,"BOTTOM_RIGHT",{spriteName:et}),drawCorner(tt,"TOP_LEFT",{spriteName:et}),drawCorner(tt,"TOP_RIGHT",{spriteName:et})}function removeControl(tt){removeContainer(tt),removeCorner(tt,"BOTTOM_LEFT"),removeCorner(tt,"BOTTOM_RIGHT"),removeCorner(tt,"TOP_LEFT"),removeCorner(tt,"TOP_RIGHT"),tt.stage.off("pointermove")}function start(tt,et){drawControl(tt,et)}function stop(tt){removeControl(tt),tt.stage.off("pointermove"),tt.render()}function save(tt){var et;const rt=(et=tt==null?void 0:tt.stage)==null?void 0:et.getChildByName(CONTROL_NAME,!0),st=rt?{height:rt.height,width:rt.width}:void 0;if(removeControl(tt),st){const nt=tt.renderer.generateTexture(tt.stage).clone(),ot=new Sprite(nt);return ot.width=st.width,ot.height=st.height,ot}else return}async function rotate(tt,et){const rt=tt==null?void 0:tt.stage.getChildByName(et,!0);if(tt&&rt){if(!tt)return;const st=await toBlob(tt),nt=await updateImageFromBlob(tt,{imgDatasource:st,spriteName:et,settings:createImageSettings({application:tt,sprite:rt})});if(!nt)return;let ot,at;const lt=tt.view;lt.style&&(ot=lt.style.maxHeight??"",at=lt.style.visibility??"",lt.style.maxHeight=`${lt.clientHeight}px`,lt.style.visibility="hidden"),nt.rotation+=Math.PI/2,resizeStage({application:tt,sprite:nt,newHeight:nt.width,newWidth:nt.height}),tt.render();const ut=await toBlob(tt);ot!==void 0&&(lt.style.maxHeight=ot),at!==void 0&&(lt.style.visibility=at),await updateImageFromBlob(tt,{imgDatasource:ut,spriteName:et})}}function useImageEffects({application:tt,spriteName:et,onSave:rt}){return{rotate:async()=>{tt&&await rotate(tt,et)},startCrop:()=>{tt&&start$1(tt,{spriteName:et})},stopCrop:st=>{if(tt){if(st){const nt=save$1(tt);nt&&rt(nt)}stop$1(tt)}},startBlur:()=>{tt&&start$2(tt,{spriteName:et})},stopBlur:()=>{tt&&stop$2(tt)},startResize:()=>{tt&&start(tt,et)},stopResize:st=>{if(tt){if(st){const nt=save(tt);nt&&rt(nt)}stop(tt)}}}}function useImageEditor({imageSrc:tt,spriteName:et=DEFAULT_SPRITE_NAME}){const[rt,st]=reactExports.useState(void 0),[nt,ot]=reactExports.useState(!0),{rotate:at,startBlur:lt,startCrop:ut,startResize:ct,stopBlur:dt,stopCrop:ht,stopResize:ft}=useImageEffects({spriteName:et,application:rt,onSave(wt){rt&&updateImage(rt,{imgDatasource:wt,spriteName:et})}}),xt=()=>rt?saveAsBlob(rt):Promise.resolve(void 0),vt=()=>{if(rt)return saveAsDataURL(rt)},{restore:yt,historize:Et,historyCount:bt}=useHistoryTool({application:rt,spriteName:et,onRestore(wt,St){rt&&updateImageFromBlob(rt,{imgDatasource:wt,spriteName:et,settings:St})}});return reactExports.useEffect(()=>{rt&&(ot(!0),updateImage(rt,{spriteName:et,imgDatasource:tt}).finally(()=>ot(!1)))},[rt,tt,et]),{historyCount:bt,setApplication:st,restore:yt,stopCrop:ht,stopBlur:dt,stopResize:ft,startResize:async()=>{ot(!0),await Et(ct),ot(!1)},startCrop:async()=>{ot(!0),await Et(ut),ot(!1)},startBlur:async()=>{ot(!0),await Et(lt),ot(!1)},rotate:async()=>{ot(!0),await Et(at),ot(!1)},toBlob:xt,toDataURL:vt,loading:nt}}const SvgIconBlur=({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("g",{fill:"currentColor",fillRule:"evenodd",clipPath:"url(#icon-blur_svg__a)",clipRule:"evenodd",children:jsxRuntimeExports.jsx("path",{d:"M17.504 1.673a1 1 0 0 1 .932.491c.37.63.9 1.935 1.404 3.18l.08.197c.502 1.24.994 2.457 1.369 3.205l-.895.447.895-.447c.561 1.122 1.962 4.049 2.136 6.753.087 1.364-.125 2.839-1.094 3.978-.987 1.16-2.573 1.76-4.757 1.76-2.186 0-3.777-.6-4.777-1.752-.983-1.134-1.221-2.604-1.152-3.973.138-2.711 1.514-5.636 2.13-6.79.86-1.611 2.414-5.32 2.874-6.433a1 1 0 0 1 .855-.616m.104 3.492c-.657 1.533-1.496 3.425-2.07 4.5-.59 1.106-1.781 3.703-1.895 5.949-.057 1.11.158 1.976.665 2.56.49.565 1.427 1.063 3.266 1.063 1.84 0 2.76-.498 3.233-1.055.492-.579.694-1.44.622-2.555-.145-2.253-1.36-4.848-1.929-5.986-.412-.823-.932-2.108-1.417-3.308l-.097-.238q-.196-.487-.378-.93M12.843 22.535a1 1 0 0 1-1.034.964l-.259-.009a1 1 0 0 1-.257-.042q-.125.029-.26.024l-.257-.009a11 11 0 0 1-2.102-.279 1 1 0 0 1 .457-1.947 9 9 0 0 0 1.715.228l.258.009q.134.004.257.042.125-.028.26-.024l.257.009a1 1 0 0 1 .965 1.034m-6.615-1.329a1 1 0 0 1-1.396.226 10.9 10.9 0 0 1-2.877-3.086 1 1 0 1 1 1.7-1.054 8.9 8.9 0 0 0 2.347 2.518 1 1 0 0 1 .226 1.396M1.622 15.22a1 1 0 0 1-1.147-.827 10.9 10.9 0 0 1 .148-4.218 1 1 0 0 1 1.947.457 8.9 8.9 0 0 0-.12 3.441 1 1 0 0 1-.828 1.147m.978-7.49a1 1 0 0 1-.226-1.397A10.9 10.9 0 0 1 5.46 3.455a1 1 0 0 1 1.054 1.7 8.9 8.9 0 0 0-2.518 2.347 1 1 0 0 1-1.396.226m5.988-4.607a1 1 0 0 1 .827-1.147 11 11 0 0 1 2.116-.132l.258.01q.135.004.257.042.125-.03.26-.025l.258.01a1 1 0 0 1-.07 1.998l-.258-.009a1 1 0 0 1-.258-.043q-.125.03-.259.025l-.258-.009a9 9 0 0 0-1.727.108 1 1 0 0 1-1.146-.828"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-blur_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconCrop=({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("g",{clipPath:"url(#icon-crop_svg__a)",children:jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7.13 1.009a1 1 0 1 0-2-.018l-.036 4.103-4.103.036a1 1 0 1 0 .018 2l4.068-.035L5 15.99V16a3 3 0 0 0 3 3h9v4a1 1 0 1 0 2 0v-4h4a1 1 0 1 0 0-2h-4V8a3 3 0 0 0-3-3l-8.905.077zm-.053 6.068L7 16.004A1 1 0 0 0 8 17h9V8a1 1 0 0 0-.996-1z",clipRule:"evenodd"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"icon-crop_svg__a",children:jsxRuntimeExports.jsx("path",{fill:"#fff",d:"M0 0h24v24H0z"})})})]}),SvgIconUndo=({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:"M9.707 13.707a1 1 0 0 0 0-1.414L5.414 8l4.293-4.293a1 1 0 0 0-1.414-1.414l-5 5a1 1 0 0 0 0 1.414l5 5a1 1 0 0 0 1.414 0",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M20 20a1 1 0 0 0 1-1v-7a5 5 0 0 0-5-5H4a1 1 0 1 0 0 2h12a3 3 0 0 1 3 3v7a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),ImageEditorToolbar=({historyCount:tt,handle:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(void 0),ot=lt=>{nt(lt),et(lt)},at=[{type:"button",name:"undo",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconUndo,{}),"aria-label":rt("cancel"),children:rt("cancel"),onClick:()=>ot("UNDO"),disabled:tt===0},tooltip:rt("cancel")},{type:"divider",name:"div-1"},{type:"button",name:"reset",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconReset,{}),"aria-label":rt("rotate"),children:rt("rotate"),onClick:()=>ot("ROTATE")},tooltip:rt("rotate")},{type:"button",name:"crop",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconCrop,{}),"aria-label":rt("crop"),children:rt("crop"),className:st==="CROP"?"is-selected":"",onClick:()=>ot("CROP")},tooltip:rt("crop")},{type:"button",name:"blur",props:{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBlur,{}),"aria-label":rt("blur"),children:rt("blur"),className:st==="BLUR"?"is-selected":"",onClick:()=>ot("BLUR")},tooltip:rt("blur")}];return jsxRuntimeExports.jsx(Toolbar,{variant:"no-shadow",align:"left",isBlock:!0,items:at})},ImageEditor=({altText:tt,legend:et,image:rt,isOpen:st,onCancel:nt,onError:ot,onSave:at})=>{const{t:lt}=useTranslation(),[ut,ct]=reactExports.useState(void 0),[dt,ht]=reactExports.useState(!1),[ft,xt]=reactExports.useState(tt??""),[vt,yt]=reactExports.useState(et??""),[Et,bt]=reactExports.useState(!1),{toBlob:wt,setApplication:St,startBlur:Rt,stopBlur:Ct,restore:It,rotate:jt,startCrop:Pt,stopCrop:Ot,startResize:Ut,stopResize:Nt,historyCount:Ht,loading:Lt}=useImageEditor({imageSrc:rt}),kt=()=>{Ct(),Ot(ut==="CROP"),Nt(ut==="RESIZE")},$t=async()=>{try{ht(!0),kt();const Mt=await wt();Mt&&await at({blob:Mt,legend:vt,altText:ft})}catch(Mt){ot==null||ot(`${Mt}`)}finally{ht(!1)}},Ft=()=>{nt()},Gt=async Mt=>{switch(kt(),ct(Mt),bt(!0),Mt){case"ROTATE":{await jt();break}case"UNDO":{await It();break}case"CROP":{Pt();break}case"RESIZE":{await Ut();break}case"BLUR":{await Rt();break}}};return jsxRuntimeExports.jsxs(Modal,{id:"image-editor",isOpen:st,onModalClose:Ft,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:Ft,children:jsxRuntimeExports.jsx("span",{className:"h2",children:lt("imageeditor.title")})}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex flex-column align-items-center",children:jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column gap-12 w-100 flex-grow-1",children:[jsxRuntimeExports.jsx(ImageEditorToolbar,{handle:Gt,historyCount:Ht}),jsxRuntimeExports.jsxs("div",{className:"position-relative d-flex flex-column align-items-center justify-content-center flex-grow-1 w-100 image-editor",children:[jsxRuntimeExports.jsx(moduleExports.Stage,{onMount:Mt=>St(Mt),options:{preserveDrawingBuffer:!0,backgroundAlpha:0,resolution:1}}),!!Lt&&jsxRuntimeExports.jsx("div",{className:"position-absolute top-0 start-0 bottom-0 end-0 m-10 d-flex align-items-center justify-content-center bg-black opacity-25",children:jsxRuntimeExports.jsx(LoadingScreen,{})})]}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row m-10 gap-12 w-100",children:[jsxRuntimeExports.jsxs(FormControl,{id:"alt",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("alttext")}),jsxRuntimeExports.jsx(Input,{value:ft,onChange:Mt=>{bt(!0),xt(Mt.target.value)},placeholder:lt("alttext.help"),size:"md",type:"text"})]}),jsxRuntimeExports.jsxs(FormControl,{id:"legend",className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Label,{children:lt("legend")}),jsxRuntimeExports.jsx(Input,{value:vt,onChange:Mt=>{bt(!0),yt(Mt.target.value)},placeholder:lt("legend.help"),size:"md",type:"text"})]})]})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:Ft,type:"button",variant:"ghost",children:lt("imageeditor.cancel")}),jsxRuntimeExports.jsx(Button,{color:"primary",onClick:$t,type:"button",variant:"filled",isLoading:dt,disabled:dt||!Et,children:lt("imageeditor.save")})]})]})},UploadFiles=({onFilesChange:tt,visibility:et="protected"})=>{const{files:rt,uploadedFiles:st,getUploadStatus:nt,uploadFile:ot,removeFile:at,updateImage:lt,editingImage:ut,setEditingImage:ct,getUrl:dt}=useUploadFiles({handleOnChange:tt,application:"media-library",visibility:et}),ht=reactExports.useRef(new Map);reactExports.useEffect(()=>{const vt=ht.current;return()=>{vt.forEach(yt=>URL.revokeObjectURL(yt)),vt.clear()}},[]);const ft=vt=>{const yt=vt.type.startsWith("image")?ht.current.get(vt.name):"";return ht.current.has(vt.name)||ht.current.set(vt.name,URL.createObjectURL(vt)),{name:vt.name,info:{type:vt.type,weight:c$2(vt.size||0,1)},src:yt}},xt=vt=>{const yt=ht.current.get(vt.name);yt&&(URL.revokeObjectURL(yt),ht.current.delete(vt.name)),at(vt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[rt.map(vt=>{const yt=st.find(Et=>Et.name===vt.name);return jsxRuntimeExports.jsx(UploadCard,{status:nt(vt),item:ft(vt),onEdit:()=>ct(yt),onRetry:()=>ot(vt),onDelete:()=>xt(vt)},vt.name)}),ut&&jsxRuntimeExports.jsx(ImageEditor,{altText:ut.alt,legend:ut.title,image:dt(ut,!0),isOpen:!!ut,onCancel:()=>ct(void 0),onSave:lt,onError:console.error})]})},acceptedTypes=tt=>{const et=[];switch(tt){case"audio":et.push("audio/*");break;case"video":et.push("video/*");break;case"image":et.push("image/png"),et.push("image/jpeg"),et.push("image/webp"),et.push("image/gif"),et.push("image/avif");break}return et},Upload=()=>{const{t:tt}=useTranslation(),{type:et,visibility:rt,multiple:st,setResult:nt,setResultCounter:ot,setCancellable:at}=useMediaLibraryContext(),lt=ut=>{ut.length?(at(ut),ot(ut.length),nt(ut)):(at([]),ot(void 0),nt(void 0))};return jsxRuntimeExports.jsxs("div",{className:"flex-grow-1",children:[jsxRuntimeExports.jsx(Alert,{type:"info",className:"flex-shrink-0 mb-16",children:tt("bbm.upload.alert")}),jsxRuntimeExports.jsx(Dropzone,{multiple:st,accept:acceptedTypes(et??"embedder"),children:jsxRuntimeExports.jsx(UploadFiles,{onFilesChange:lt,visibility:rt})})]})},VIDEO_HEIGHT=9,VIDEO_WIDTH=16;function useCameras(){const{device:tt}=useBrowserInfo(navigator.userAgent),{t:et}=useTranslation(),[rt,st]=reactExports.useState([]),[nt,ot]=reactExports.useState({audio:!0,video:!0}),[at,lt]=reactExports.useState();async function ut(){return(await navigator.mediaDevices.enumerateDevices()).filter(ft=>ft.kind==="videoinput")}const ct=async ft=>{try{const xt=await navigator.mediaDevices.getUserMedia(ft);lt(xt)}catch(xt){console.error(xt)}},dt=()=>{at==null||at.getTracks().forEach(ft=>ft.stop()),ct(nt)},ht=ft=>{let xt={};ft!=null&&ft.deviceId?(ft.deviceId==="environment"||ft.deviceId==="user"?xt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,facingMode:ft==null?void 0:ft.deviceId}}:xt={audio:!0,video:{aspectRatio:VIDEO_WIDTH/VIDEO_HEIGHT,deviceId:{exact:ft.deviceId}}},ot(xt)):console.error("Selected input device id is null")};return reactExports.useEffect(()=>{dt()},[nt]),reactExports.useEffect(()=>{async function ft(){await ct(nt);const xt=await ut();switch(tt.type){case"mobile":case"tablet":{const vt={deviceId:"environment",label:et("video.back.camera"),groupId:"",kind:"videoinput"},yt={deviceId:"user",label:et("video.front.camera"),groupId:"",kind:"videoinput"};(xt==null?void 0:xt.length)>1?st([vt,yt]):st([vt]);break}default:st(xt);break}}ft()},[]),{inputDevices:rt,setPreferedDevice:ht,stream:at,restartStream:dt}}const SvgIconRecordStop=({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",d:"M2 6a4 4 0 0 1 4-4h12a4 4 0 0 1 4 4v12a4 4 0 0 1-4 4H6a4 4 0 0 1-4-4z"})]}),VideoRecorderToolbar=({playing:tt,recording:et,recorded:rt,saving:st,saved:nt,hideSaveAction:ot,handleRecord:at,handleStop:lt,handlePlayPause:ut,handleReset:ct,handleSave:dt})=>{const{t:ht}=useTranslation(),ft=[{type:"icon",name:"record",props:{icon:jsxRuntimeExports.jsx(SvgIconRecord,{color:et||rt?"":"red"}),color:"danger",disabled:et||rt||st,onClick:at,"aria-label":ht("bbm.video.record.start")},tooltip:ht("bbm.video.record.start")},{type:"icon",name:"stop",props:{icon:jsxRuntimeExports.jsx(SvgIconRecordStop,{}),disabled:!et||rt||st,onClick:lt,"aria-label":ht("bbm.video.record.stop")},tooltip:ht("bbm.video.record.stop")},{type:"icon",name:"play",visibility:tt?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconPlayFilled,{}),disabled:!rt||st,onClick:ut,"aria-label":ht("bbm.video.play.start")},tooltip:ht("bbm.video.play.start")},{type:"icon",name:"pause",visibility:tt?"show":"hide",props:{icon:jsxRuntimeExports.jsx(SvgIconPause,{}),disabled:!rt||st,onClick:ut,"aria-label":ht("bbm.video.play.pause")},tooltip:ht("bbm.video.play.pause")},{type:"divider"},{type:"icon",name:"reset",props:{icon:jsxRuntimeExports.jsx(SvgIconRefresh,{}),disabled:!rt||st,onClick:ct,"aria-label":ht("bbm.video.record.reset")},tooltip:ht("bbm.video.record.reset")},{type:"icon",name:"save",visibility:ot?"hide":"show",props:{icon:jsxRuntimeExports.jsx(SvgIconSave,{}),disabled:!rt||st||nt,onClick:dt,"aria-label":ht("bbm.video.record.save")},tooltip:ht("bbm.video.record.save")}];return jsxRuntimeExports.jsx(Toolbar,{items:ft,className:"position-absolute bottom-0 start-50 bg-white"})},VideoRecorder=reactExports.forwardRef(({appCode:tt,caption:et,onSuccess:rt,onError:st,onRecordUpdated:nt,hideSaveAction:ot=!1},at)=>{const{inputDevices:lt,setPreferedDevice:ut,restartStream:ct,stream:dt}=useCameras(),[ht,ft]=reactExports.useState(18e4),[xt,vt]=reactExports.useState(!1),[yt,Et]=reactExports.useState(!1),[bt,wt]=reactExports.useState(!1),[St,Rt]=reactExports.useState(!1),[Ct,It]=reactExports.useState(!1),[jt,Pt]=reactExports.useState(""),[Ot,Ut]=reactExports.useState([]),[Nt,Ht]=reactExports.useState(),[Lt,kt]=reactExports.useState(0),[$t,Ft]=reactExports.useState(0),Gt=reactExports.useRef(null),Mt=reactExports.useRef(null),{uploadBlob:Vt}=useUpload(void 0,tt);reactExports.useImperativeHandle(at,()=>({save:ur}));const{t:Bt}=useTranslation();reactExports.useEffect(()=>{qt()},[]);async function qt(){try{const or=await odeServices.video().getVideoConf();ft(or.maxDuration*60*1e3)}catch{ft(3*60*1e3)}}reactExports.useEffect(()=>{try{Gt.current&&(Gt.current.src&&(window.URL.revokeObjectURL(Gt.current.src),Gt.current.src=""),Gt.current.srcObject instanceof MediaStream&&(Gt.current.srcObject=null),dt&&(Gt.current.srcObject=dt,Gt.current.autoplay=!0,Gt.current.volume=1,Gt.current.muted=!0,Gt.current.load()))}catch(or){console.error(or)}},[dt]),reactExports.useEffect(()=>{if(Ot.length&&!xt&&Gt.current){const or=new Blob(Ot,{type:jt});if(Ht(or),nt){const hr=window.URL.createObjectURL(or);nt(hr)}Gt.current.autoplay=!1,Gt.current.srcObject=null,Gt.current.src=window.URL.createObjectURL(or)}},[xt,Ot]),reactExports.useEffect(()=>{if(xt){const or=Date.now(),hr=window.setInterval(()=>kt(Date.now()-or),500);return()=>{window.clearInterval(hr)}}},[xt]),reactExports.useEffect(()=>{if(bt){const or=window.setInterval(()=>Ft(hr=>hr+500),500);return()=>{window.clearInterval(or)}}},[bt]);const Qt=reactExports.useCallback(()=>{vt(!0),Gt&&Gt.current&&(Gt.current.muted=!0);const or=o$2();Pt(or),dt&&(Mt.current=new MediaRecorder(dt,{mimeType:or}),Mt.current.ondataavailable=({data:hr})=>{hr.size>0&&Ut(pr=>[...pr,hr])},Mt.current.onerror=hr=>console.error(hr),Mt.current.start(1e3))},[dt]),Yt=reactExports.useCallback(()=>{var or;vt(!1),Et(!0),((or=Mt.current)==null?void 0:or.state)==="recording"&&(Mt.current.requestData(),Mt.current.stop())},[Mt]),tr=reactExports.useCallback(()=>{var or,hr;Gt&&Gt.current&&(Gt.current.muted=!1),bt?((hr=Gt==null?void 0:Gt.current)==null||hr.pause(),wt(!1)):((or=Gt==null?void 0:Gt.current)==null||or.play(),wt(!0))},[bt]),lr=()=>{Et(!1),vt(!1),wt(!1),It(!1),kt(0),Ut([]),Ht(void 0),ct(),nt&&nt()},ur=async()=>{var or;if((or=Gt==null?void 0:Gt.current)==null||or.pause(),Rt(!0),!Nt){console.error("Error while saving video: recorded video is undefined.");return}const hr=await Vt(Nt,{duration:Lt});if(hr!=null)return rt==null||rt([hr]),Rt(!1),It(!0),[hr];st("Error while uploading video"),Rt(!1),It(!0)},mr=()=>{wt(!1),Ft(0),Gt.current&&(Gt.current.currentTime=0)},yr=or=>{var hr;const pr=lt.find(_r=>_r.label===or);((hr=Mt.current)==null?void 0:hr.state)==="recording"&&(Mt.current.requestData(),Mt.current.stop()),ut(pr)};return reactExports.useEffect(()=>{Lt>=ht&&Yt()},[Lt,Yt]),jsxRuntimeExports.jsxs("div",{className:"video-recorder d-flex flex-fill flex-column align-items-center pb-8",children:[jsxRuntimeExports.jsx("div",{className:"video-recorder-caption d-none d-md-block",children:et}),lt.length>1&&jsxRuntimeExports.jsx("div",{className:"video-recorder-devices mb-12",children:jsxRuntimeExports.jsxs(FormControl,{id:"selectInputDevice",children:[jsxRuntimeExports.jsx(Label,{className:"d-none d-md-block",children:Bt("bbm.video.record.select.devices.label")}),jsxRuntimeExports.jsx(Select,{placeholderOption:Bt("bbm.video.record.select.devices.placeholder"),options:lt.map(or=>or.label),onValueChange:yr})]})}),jsxRuntimeExports.jsxs("div",{className:"video-recorder-video-container position-relative align-self-stretch",children:[jsxRuntimeExports.jsx("video",{ref:Gt,playsInline:!0,autoPlay:!0,controls:!1,muted:!0,onEnded:mr,className:"rounded",children:jsxRuntimeExports.jsx("track",{default:!0,kind:"captions",srcLang:"fr",src:""})}),(xt||yt)&&jsxRuntimeExports.jsxs("div",{className:"video-recorder-time d-flex align-items-center font-monospace fs-6 text-bg-dark rounded",children:[xt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecord,{width:12,height:12,color:"red",className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$4(Lt),"/",n$4(ht)]})]}),yt&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(SvgIconRecordVideo,{width:14,height:14,className:"me-4"}),jsxRuntimeExports.jsxs("span",{children:[n$4($t),"/",n$4(Lt)]})]})]}),dt&&jsxRuntimeExports.jsx(VideoRecorderToolbar,{playing:bt,recording:xt,recorded:yt,saving:St,saved:Ct,hideSaveAction:ot,handleRecord:Qt,handleStop:Yt,handlePlayPause:tr,handleReset:lr,handleSave:ur})]}),St&&jsxRuntimeExports.jsx(LoadingScreen,{position:!1,caption:Bt("bbm.video.save.loader.caption")})]})}),Video=()=>{const{appCode:tt,setResult:et,setPreSuccess:rt}=useMediaLibraryContext(),{t:st}=useTranslation(),nt=reactExports.useRef(null),ot=lt=>{lt?(et(lt),rt(()=>nt.current.save)):et()},at=lt=>{console.error(lt)};return jsxRuntimeExports.jsx(VideoRecorder,{ref:nt,appCode:tt,caption:st("bbm.video.caption"),onRecordUpdated:ot,onError:at,hideSaveAction:!0})},SvgIconArrowRight=({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 12a1 1 0 0 1 1-1h14a1 1 0 1 1 0 2H5a1 1 0 0 1-1-1",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M11.293 4.293a1 1 0 0 1 1.414 0l7 7a1 1 0 0 1 0 1.414l-7 7a1 1 0 0 1-1.414-1.414L17.586 12l-6.293-6.293a1 1 0 0 1 0-1.414",clipRule:"evenodd"})]}),illuError="/assets/js/ode-explorer/illu-error.svg",illuError$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuError},Symbol.toStringTag,{value:"Module"})),VideoEmbed=({switchType:tt,onSuccess:et})=>{const{t:rt}=useTranslation(),[st,nt]=reactExports.useState(),[ot,at]=reactExports.useState(),[lt,ut]=reactExports.useState(void 0),[ct,dt]=reactExports.useState(),ht=useDebounce(st||"",300),ft=reactExports.useId();reactExports.useEffect(()=>{xt()},[]),reactExports.useEffect(()=>{if(ct&&ht){const bt=odeServices.embedder().getProviderFromUrl(ct,ht);if(bt){ut(bt);const wt=odeServices.embedder().getEmbedCodeForProvider(bt,ht);at(wt),et(wt)}else ut(void 0),et()}},[ht,ct]);const xt=async()=>{const bt=await Promise.all([odeServices.embedder().getDefault(),odeServices.embedder().getCustom()]).then(wt=>wt.flat());dt(bt)};function vt(bt){const wt=bt.currentTarget.value;nt(wt),et(wt!=null&&wt.length?wt:void 0)}function yt(){tt==null||tt("embedder")}const Et=()=>ht?lt?jsxRuntimeExports.jsxs("div",{className:"mx-auto mt-16",children:[jsxRuntimeExports.jsxs("div",{className:"video-embed-provider d-flex align-items-center",children:[jsxRuntimeExports.jsx(Image$1,{src:lt.logo,alt:"Logo "+lt.displayName,className:"video-embed-provider-logo"}),lt.displayName]}),ot&&jsxRuntimeExports.jsx("div",{className:"video-embed-preview mt-12",dangerouslySetInnerHTML:{__html:ot}})]}):jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column align-items-center m-16",children:[jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuError,title:rt("bbm.video.previewError.title"),text:rt("bbm.video.previewError.text")}),tt&&jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:yt,className:"align-items-start mt-16",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})]}):tt&&jsxRuntimeExports.jsx("div",{className:"d-flex my-16 align-items-start",children:jsxRuntimeExports.jsxs(Button,{variant:"ghost",color:"primary",onClick:yt,className:"align-items-start",children:[rt("bbm.video.useEmbedCode")," ",jsxRuntimeExports.jsx(SvgIconArrowRight,{})]})});return jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-fill video-embed",children:[jsxRuntimeExports.jsxs("div",{className:"mb-8 d-flex",children:[jsxRuntimeExports.jsx(SvgIconGlobe,{className:"me-8"}),rt("bbm.video.url.title")]}),jsxRuntimeExports.jsx(FormControl,{id:ft,children:jsxRuntimeExports.jsx(Input,{size:"md",type:"text",placeholder:rt("bbm.video.url.placeholder"),onChange:vt})}),jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:Et()})]})},VideoEmbedder=()=>{const{switchType:tt,setResult:et}=useMediaLibraryContext();return jsxRuntimeExports.jsx(VideoEmbed,{switchType:tt,onSuccess:rt=>{et(rt)}})},SvgIconSortAscendingLetters=({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:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 16.293a1 1 0 0 1 1.414 0L7 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 4a1 1 0 0 1 1 1v15a1 1 0 1 1-2 0V5a1 1 0 0 1 1-1",clipRule:"evenodd"})]}),SvgIconSortDescendingLetters=({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:"M16.133 6.173c-.026.023-.133.118-.133.541v.715h2v-.715c0-.423-.107-.518-.133-.541C17.805 6.12 17.594 6 17 6s-.805.12-.867.173M20 6.714c0-.76-.203-1.521-.832-2.06C18.575 4.145 17.786 4 17 4s-1.575.145-2.168.654c-.629.539-.832 1.3-.832 2.06V11a1 1 0 1 0 2 0V9.429h2V11a1 1 0 1 0 2 0zM14 14a1 1 0 0 1 1-1h4a1 1 0 0 1 .832 1.555L16.87 19H19a1 1 0 1 1 0 2h-4a1 1 0 0 1-.832-1.555L17.132 15H15a1 1 0 0 1-1-1M3.293 8.707a1 1 0 0 0 1.414 0L7 6.414l2.293 2.293a1 1 0 0 0 1.414-1.414l-3-3a1 1 0 0 0-1.414 0l-3 3a1 1 0 0 0 0 1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M7 21a1 1 0 0 0 1-1V5a1 1 0 0 0-2 0v15a1 1 0 0 0 1 1",clipRule:"evenodd"})]}),SvgIconSortTime=({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:"M13.509 6.027a6.138 6.138 0 1 1-.28 12.099 1 1 0 1 0-.383 1.963A8.138 8.138 0 1 0 9.653 5.488a1 1 0 1 0 1.168 1.624 6.1 6.1 0 0 1 2.688-1.085",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M14.38 8.252a1 1 0 0 0-1 1v3.8a1 1 0 0 0 .456.838l2.052 1.332a1 1 0 0 0 1.089-1.678l-1.597-1.036V9.252a1 1 0 0 0-1-1M1.793 16.293a1 1 0 0 1 1.414 0L5.5 18.586l2.293-2.293a1 1 0 0 1 1.414 1.414l-3 3a1 1 0 0 1-1.414 0l-3-3a1 1 0 0 1 0-1.414",clipRule:"evenodd"}),jsxRuntimeExports.jsx("path",{fill:"currentColor",fillRule:"evenodd",d:"M5.5 4a1 1 0 0 0-1 1v15a1 1 0 1 0 2 0V5a1 1 0 0 0-1-1",clipRule:"evenodd"})]}),illuTrash="/assets/js/ode-explorer/illu-trash.svg",illuTrash$1=Object.freeze(Object.defineProperty({__proto__:null,default:illuTrash},Symbol.toStringTag,{value:"Module"})),Grid=({children:tt,className:et,...rt})=>{const st=clsx("grid",et);return jsxRuntimeExports.jsx("div",{className:st,...rt,children:tt})},Column=({sm:tt,md:et,lg:rt,xl:st,children:nt,className:ot,as:at,...lt})=>{const ut=at||"div",ct=clsx({[`g-col-${tt}`]:tt,[et?`g-col-md-${et}`:""]:et,[rt?`g-col-lg-${rt}`:""]:rt,[st?`g-col-xl-${st}`:""]:st},ot);return jsxRuntimeExports.jsx(ut,{className:ct,...lt,children:nt})};Grid.Col=Column;const SvgIconLandscape=({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.222 5.037c-.895 0-1.222.555-1.222.792v12.675c0 .237.327.792 1.222.792h1.364l9.707-9.886a.987.987 0 0 1 1.414 0L21 13.782V5.829c0-.237-.328-.792-1.222-.792zM23 16.224V5.829C23 4.066 21.337 3 19.778 3H4.222C2.662 3 1 4.066 1 5.83v12.674c0 1.763 1.662 2.829 3.222 2.829h15.556c1.56 0 3.222-1.066 3.222-2.83v-2.279m-2 .439-5-5.093-7.585 7.726h11.363c.894 0 1.222-.555 1.222-.792zM8 8.093c-.552 0-1 .455-1 1.018a1.01 1.01 0 0 0 1 1.018c.552 0 1-.456 1-1.018a1.01 1.01 0 0 0-1-1.019M5 9.11c0-1.688 1.343-3.056 3-3.056s3 1.368 3 3.056-1.343 3.055-3 3.055-3-1.368-3-3.055",clipRule:"evenodd"})]}),SvgIconTextPage=({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:"M6.286 3c-.35 0-.68.135-.92.368-.238.231-.366.54-.366.854v15.556c0 .315.128.623.367.854.239.233.569.368.919.368h11.428c.35 0 .68-.135.92-.368.238-.231.366-.54.366-.854V8h-3a2 2 0 0 1-2-2V3zM16 6h1.986L16 4.08zm5 13.778V6.556a1 1 0 0 0-.305-.72L15.98 1.281A1 1 0 0 0 15.286 1h-9a3.32 3.32 0 0 0-2.314.934A3.2 3.2 0 0 0 3 4.222v15.556c0 .864.353 1.686.972 2.288S5.423 23 6.286 23h11.428c.863 0 1.695-.333 2.314-.934.619-.602.972-1.424.972-2.288M8 6a1 1 0 0 0 0 2h3a1 1 0 1 0 0-2zm-1 6a1 1 0 0 1 1-1h8a1 1 0 1 1 0 2H8a1 1 0 0 1-1-1m5 4a1 1 0 1 0 0 2h4a1 1 0 1 0 0-2z",clipRule:"evenodd"})]}),SvgIconVideo=({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 4.962C4 4.376 4.435 4 4.853 4H6.5v2H4zM4 8h2.5v3H4zm-2 4V4.962C2 3.381 3.224 2 4.853 2h13.294C19.776 2 21 3.38 21 4.962v14.076C21 20.619 19.776 22 18.147 22H4.853C3.224 22 2 20.62 2 19.038zm17-6V4.962c0-.586-.435-.962-.853-.962H16.5v2zm0 2h-2.5v3H19zm-2.5 5H19v3h-2.5zm0 5H19v1.038c0 .586-.435.962-.853.962H16.5zm-2-7V4h-6v7zm-6 2h6v7h-6zm-2 5v2H4.853C4.435 20 4 19.624 4 19.038V18zm0-2v-3H4v3z",clipRule:"evenodd"})]}),FileIcon=({type:tt,roleMap:et})=>{const rt=typeof(et==null?void 0:et.icon)!="string"&&tt!=="unknown"&&(et==null?void 0:et.hasShadow)!==!1,st=clsx("position-absolute top-50 start-50 translate-middle",{"p-12 rounded-circle shadow":rt},et==null?void 0:et.color);return jsxRuntimeExports.jsx("div",{className:st,children:(et==null?void 0:et.icon)??jsxRuntimeExports.jsx(SvgIconPaperclip,{})})};var observerMap=new Map,RootIds=new WeakMap,rootId=0,unsupportedValue=void 0;function getRootId(tt){return tt?(RootIds.has(tt)||(rootId+=1,RootIds.set(tt,rootId.toString())),RootIds.get(tt)):"0"}function optionsToId(tt){return Object.keys(tt).sort().filter(et=>tt[et]!==void 0).map(et=>`${et}_${et==="root"?getRootId(tt.root):tt[et]}`).toString()}function createObserver(tt){let et=optionsToId(tt),rt=observerMap.get(et);if(!rt){const st=new Map;let nt;const ot=new IntersectionObserver(at=>{at.forEach(lt=>{var ut;const ct=lt.isIntersecting&&nt.some(dt=>lt.intersectionRatio>=dt);tt.trackVisibility&&typeof lt.isVisible>"u"&&(lt.isVisible=ct),(ut=st.get(lt.target))==null||ut.forEach(dt=>{dt(ct,lt)})})},tt);nt=ot.thresholds||(Array.isArray(tt.threshold)?tt.threshold:[tt.threshold||0]),rt={id:et,observer:ot,elements:st},observerMap.set(et,rt)}return rt}function observe(tt,et,rt={},st=unsupportedValue){if(typeof window.IntersectionObserver>"u"&&st!==void 0){const ut=tt.getBoundingClientRect();return et(st,{isIntersecting:st,target:tt,intersectionRatio:typeof rt.threshold=="number"?rt.threshold:0,time:0,boundingClientRect:ut,intersectionRect:ut,rootBounds:ut}),()=>{}}const{id:nt,observer:ot,elements:at}=createObserver(rt);let lt=at.get(tt)||[];return at.has(tt)||at.set(tt,lt),lt.push(et),ot.observe(tt),function(){lt.splice(lt.indexOf(et),1),lt.length===0&&(at.delete(tt),ot.unobserve(tt)),at.size===0&&(ot.disconnect(),observerMap.delete(nt))}}function useInView({threshold:tt,delay:et,trackVisibility:rt,rootMargin:st,root:nt,triggerOnce:ot,skip:at,initialInView:lt,fallbackInView:ut,onChange:ct}={}){var dt;const[ht,ft]=reactExports.useState(null),xt=reactExports.useRef(),[vt,yt]=reactExports.useState({inView:!!lt,entry:void 0});xt.current=ct,reactExports.useEffect(()=>{if(at||!ht)return;let St;return St=observe(ht,(Rt,Ct)=>{yt({inView:Rt,entry:Ct}),xt.current&&xt.current(Rt,Ct),Ct.isIntersecting&&ot&&St&&(St(),St=void 0)},{root:nt,rootMargin:st,threshold:tt,trackVisibility:rt,delay:et},ut),()=>{St&&St()}},[Array.isArray(tt)?tt.toString():tt,ht,nt,st,ot,at,rt,ut,et]);const Et=(dt=vt.entry)==null?void 0:dt.target,bt=reactExports.useRef();!ht&&Et&&!ot&&!at&&bt.current!==Et&&(bt.current=Et,yt({inView:!!lt,entry:void 0}));const wt=[ft,vt.inView,vt.entry];return wt.ref=wt[0],wt.inView=wt[1],wt.entry=wt[2],wt}function useThumbnail(tt,et){const[rt,st]=reactExports.useState(null),{ref:nt,inView:ot}=useInView({triggerOnce:!0,...et==null?void 0:et.intersectionOptions});return reactExports.useEffect(()=>{var at;(at=et==null?void 0:et.ref)!=null&&at.current&&(nt==null||nt(et.ref.current))},[et==null?void 0:et.ref,nt]),reactExports.useEffect(()=>{if((et==null?void 0:et.ref)===void 0||ot){const at=new Image;return at.src=tt,at.onload=()=>{st(!0)},at.onerror=()=>{st(!1)},()=>{at.onload=null,at.onerror=null,st(null)}}},[ot]),rt}const FileCard=({doc:tt,isClickable:et=!0,isSelectable:rt=!1,isSelected:st=!1,onClick:nt,className:ot,onSelect:at,isFocused:lt,app:ut,customIcon:ct,customColor:dt})=>{const ht=reactExports.useRef(null),ft=DocumentHelper.getRole(tt);function xt(St){if(ct!==void 0||dt!==void 0)return{icon:ct||jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:dt||"bg-gray-300",hasShadow:!1};const Rt={csv:{icon:".CSV",color:"bg-orange-200"},xls:{icon:".XLS",color:"bg-green-200"},doc:{icon:".DOC",color:"bg-blue-200"},txt:{icon:".TXT",color:"bg-blue-200"},pdf:{icon:".PDF",color:"bg-red-200"},audio:{icon:jsxRuntimeExports.jsx(SvgIconMic,{width:22,height:22}),color:"bg-red-200"},ppt:{icon:".PPT",color:"bg-yellow-200"},img:{icon:jsxRuntimeExports.jsx(SvgIconLandscape,{width:22,height:22}),color:"bg-green-200"},video:{icon:jsxRuntimeExports.jsx(SvgIconVideo,{width:22,height:22}),color:"bg-purple-200"},zip:{icon:".ZIP",color:"bg-gray-300"},md:{icon:".MD",color:"bg-blue-200"},unknown:{icon:jsxRuntimeExports.jsx(SvgIconTextPage,{width:22,height:22}),color:"bg-gray-300"}};return Rt[St]||Rt.unknown}const vt=xt(ft??"unknown"),yt=clsx("file position-relative rounded",(vt==null?void 0:vt.color)??"bg-yellow-200"),Et=ft==="img"||ft==="video"?odeServices.workspace().getThumbnailUrl(tt):null,bt=useThumbnail(Et,{ref:ht}),wt=bt&&{backgroundImage:`url(${Et})`,backgroundSize:"cover"};return jsxRuntimeExports.jsx(Card,{className:clsx("card-file",ot),isClickable:et,isSelectable:rt,isSelected:st,onClick:nt,app:ut,isFocused:lt,onSelect:at,children:jsxRuntimeExports.jsxs(Card.Body,{space:"8",children:[jsxRuntimeExports.jsx("div",{ref:ht,className:yt,style:{aspectRatio:"16/10",...wt},children:ft!=="img"||ft==="img"&&!bt?jsxRuntimeExports.jsx(FileIcon,{type:ft,roleMap:vt}):null}),jsxRuntimeExports.jsxs("div",{className:"mt-4",children:[jsxRuntimeExports.jsx(Card.Text,{children:tt.name}),jsxRuntimeExports.jsx(Card.Text,{className:"text-black-50",children:tt==null?void 0:tt.ownerName})]})]})})},Workspace$1=({roles:tt,onSelect:et,multiple:rt=!0,className:st,defaultFolder:nt,showPublicFolder:ot})=>{const{t:at}=useTranslation(),{root:lt,loadContent:ut}=useWorkspaceSearch("root",at("workspace.tree.owner"),"owner",tt),{root:ct,loadContent:dt}=useWorkspaceSearch("root",at("workspace.tree.shared"),"shared",tt),{root:ht,loadContent:ft}=useWorkspaceSearch("root",at("workspace.tree.protected"),"protected",tt),{root:xt,loadContent:vt}=useWorkspaceSearch("root",at("workspace.tree.public"),"public",tt),yt=reactExports.useRef(null),Et=reactExports.useRef(null),bt=reactExports.useRef(null),wt=reactExports.useRef(null),[St,Rt]=reactExports.useState(()=>nt==="public"?ot?nt:"protected":nt==="protected"||nt==="shared"?nt:"owner"),[Ct,It]=reactExports.useState(()=>nt==="public"?ot?xt:ht:nt==="protected"?ht:nt==="shared"?ct:lt),[jt,Pt]=reactExports.useState(),[Ot,Ut]=reactExports.useState(null),[Nt,Ht]=reactExports.useState(["modified","desc"]),[Lt,kt]=reactExports.useState([]),$t=reactExports.useCallback(Yt=>{switch(Yt){case"owner":return{root:lt,othersRef:[Et,bt,wt]};case"shared":return{root:ct,othersRef:[yt,bt,wt]};case"protected":return{root:ht,othersRef:[yt,Et,wt]};case"public":return{root:xt,othersRef:[yt,Et,bt]};default:throw"no.root.node"}},[lt,ct,ht,xt]),Ft=reactExports.useCallback(()=>{switch(St){case"owner":ut(Ct.id);break;case"shared":dt(Ct.id);break;case"protected":ft(Ct.id);break;case"public":vt(Ct.id);break;default:throw"no.way"}},[St,Ct.id,ut,ft,vt,dt]);function Gt(Yt,tr){Rt(Yt);const{root:lr,othersRef:ur}=$t(Yt),mr=findTreeNode(lr,yr=>yr.id===tr);mr&&(It(mr),ur.forEach(yr=>{var or;return(or=yr.current)==null?void 0:or.unselectAll()}))}reactExports.useEffect(()=>{var Yt;let tr;switch(St){case"owner":tr=yt;break;case"shared":tr=Et;break;case"protected":tr=bt;break;case"public":tr=wt;break;default:return}(Yt=tr==null?void 0:tr.current)==null||Yt.select("root")},[St]),reactExports.useEffect(Ft,[Ft]),reactExports.useEffect(()=>{if(Ct.files){let Yt=[].concat(Ct.files);Ot&&(Yt=Yt.filter(lr=>lr.name.indexOf(Ot)>=0));const tr=Nt[0]==="name"?Nt[1]==="asc"?(lr,ur)=>Vt(lr.name,ur.name):(lr,ur)=>Vt(ur.name,lr.name):(lr,ur)=>Vt(ur.modified,lr.modified);Pt(()=>Yt.sort(tr))}else Pt(void 0)},[Ct,lt,ht,ct,xt,Ot,Nt]);const Mt=reactExports.useCallback(Yt=>{Ut(Yt.target.value)},[Ut]);function Vt(Yt,tr){return Yt?tr?Yt.localeCompare(tr):1:-1}function Bt(){return Nt[0]==="name"?Nt[1]==="asc"?at("sort.order.alpha.asc"):at("sort.order.alpha.desc"):at("sort.order.modify.desc")}function qt(Yt){let tr=[...Lt];rt?tr.includes(Yt)?tr=tr.filter(lr=>lr._id!==Yt._id):tr=[...tr,Yt]:tr=[Yt],kt(tr),et(tr)}const Qt=clsx("workspace flex-grow-1 gap-0",st);return jsxRuntimeExports.jsxs(Grid,{className:Qt,children:[jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"3",xl:"4",className:"workspace-folders p-12 pt-0 gap-12",children:jsxRuntimeExports.jsxs("div",{style:{position:"sticky",top:0,paddingTop:"1.2rem"},children:[jsxRuntimeExports.jsx(TreeView,{ref:yt,data:lt,onTreeItemClick:Yt=>Gt("owner",Yt),onTreeItemUnfold:Yt=>Gt("owner",Yt)}),jsxRuntimeExports.jsx(TreeView,{ref:Et,data:ct,onTreeItemClick:Yt=>Gt("shared",Yt),onTreeItemUnfold:Yt=>Gt("shared",Yt)}),jsxRuntimeExports.jsx(TreeView,{ref:bt,data:ht,onTreeItemClick:Yt=>Gt("protected",Yt),onTreeItemUnfold:Yt=>Gt("protected",Yt)}),ot&&jsxRuntimeExports.jsx(TreeView,{ref:wt,data:xt,onTreeItemClick:Yt=>Gt("public",Yt),onTreeItemUnfold:Yt=>Gt("public",Yt)})]})}),jsxRuntimeExports.jsx(Grid.Col,{sm:"12",md:"5",xl:"8",children:jsxRuntimeExports.jsxs(Grid,{className:"flex-grow-1 gap-0",children:[jsxRuntimeExports.jsxs(Grid.Col,{sm:"4",md:"8",xl:"12",children:[jsxRuntimeExports.jsx("div",{className:"workspace-search px-16 py-8 ",children:jsxRuntimeExports.jsx(SearchBar,{isVariant:!0,className:"gap-16",onChange:Mt})}),jsxRuntimeExports.jsxs("div",{className:"d-flex align-items-center justify-content-end px-8 py-4",children:[jsxRuntimeExports.jsx("small",{className:"text-muted",children:at("workspace.search.order")}),jsxRuntimeExports.jsxs(Dropdown,{children:[jsxRuntimeExports.jsx(Dropdown.Trigger,{size:"sm",label:Bt(),variant:"ghost"}),jsxRuntimeExports.jsxs(Dropdown.Menu,{children:[jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortTime,{}),onClick:()=>Ht(["modified","desc"]),children:at("sort.order.modify.desc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortAscendingLetters,{}),onClick:()=>Ht(["name","asc"]),children:at("sort.order.alpha.asc")}),jsxRuntimeExports.jsx(Dropdown.Item,{icon:jsxRuntimeExports.jsx(SvgIconSortDescendingLetters,{}),onClick:()=>Ht(["name","desc"]),children:at("sort.order.alpha.desc")})]})]})]})]}),jsxRuntimeExports.jsx(Grid.Col,{sm:"4",md:"8",xl:"12",className:"p-8 gap-8",children:jt?jt.length!==0?jsxRuntimeExports.jsx("div",{className:"grid grid-workspace",children:jt.map(Yt=>{const tr=Lt.includes(Yt);return jsxRuntimeExports.jsx(FileCard,{doc:Yt,isSelected:tr,onClick:()=>qt(Yt)},Yt._id)})}):jsxRuntimeExports.jsx(EmptyScreen,{imageSrc:illuTrash,text:at("workspace.empty.docSpace"),title:at("explorer.emptyScreen.trash.title")}):jsxRuntimeExports.jsx(LoadingScreen,{})})]})})]})},Workspace=()=>{const{type:tt,setResultCounter:et,setResult:rt,multiple:st,visibility:nt}=useMediaLibraryContext();function ot(){switch(tt){case"image":return"img";case"audio":return"audio";case"video":return"video";default:return null}}function at(lt){et(lt.length),lt.length?rt(lt):rt()}return jsxRuntimeExports.jsx(Workspace$1,{roles:ot(),onSelect:at,multiple:st,className:"border rounded overflow-y-auto",defaultFolder:nt,showPublicFolder:nt==="public"})},InnerTabs={Audio,Video,Upload,ExternalLink,Workspace,InternalLink,Iframe,VideoEmbedder},TabsContext=reactExports.createContext(null);function useTabsContext(){const tt=reactExports.useContext(TabsContext);if(!tt)throw new Error("Tabs compound components cannot be rendered outside the Tabs component");return tt}const useTabs=({defaultId:tt,items:et,onChange:rt})=>{const[st,nt]=reactExports.useState(tt||""),[ot,at]=reactExports.useState(0),[lt,ut]=reactExports.useState(0),ct=reactExports.useRef([]),dt=reactExports.useCallback(vt=>{nt(vt)},[]);reactExports.useEffect(()=>{const vt=et.find(yt=>yt.id===st);vt&&(rt==null||rt(vt))},[st]),reactExports.useEffect(()=>{function vt(){var yt;if(((yt=document==null?void 0:document.activeElement)==null?void 0:yt.tagName)!=="INPUT"){const Et=et.findIndex(wt=>wt.id===st);Et===-1&&tt&&nt(tt);const bt=ct.current[Et];bt&&(bt.focus(),ut((bt==null?void 0:bt.offsetLeft)??0),at((bt==null?void 0:bt.clientWidth)??0))}}return vt(),window.addEventListener("resize",vt),()=>window.removeEventListener("resize",vt)},[st,et,tt]);const ht=reactExports.useCallback(vt=>{var yt,Et,bt;const wt=et.findIndex(St=>St.id===vt);vt===((yt=et[0])==null?void 0:yt.id)?nt((Et=et[et.length-1])==null?void 0:Et.id):nt((bt=et[wt-1])==null?void 0:bt.id)},[et]),ft=reactExports.useCallback(vt=>{var yt,Et,bt;const wt=et.findIndex(St=>St.id===vt);vt===((yt=et[et.length-1])==null?void 0:yt.id)?nt((Et=et[0])==null?void 0:Et.id):nt((bt=et[wt+1])==null?void 0:bt.id)},[et]),xt=reactExports.useCallback(vt=>{var yt,Et;switch(vt.code){case"ArrowLeft":ht(st);break;case"ArrowRight":ft(st);break;case"Home":nt((yt=et[0])==null?void 0:yt.id);break;case"End":nt((Et=et[et.length-1])==null?void 0:Et.id);break}},[st,et,ft,ht]);return{activeTab:st,setSelectedTab:dt,tabsRef:ct,tabUnderlineLeft:lt,tabUnderlineWidth:ot,onKeyDown:xt}},TabsItem=({icon:tt,badge:et,label:rt,id:st,order:nt})=>{const{activeTab:ot,setSelectedTab:at,onKeyDown:lt,tabsRef:ut}=useTabsContext(),{t:ct}=useTranslation(),dt=clsx("nav-link d-inline-flex gap-8 border-0",ot===st?"selected":"");return jsxRuntimeExports.jsx("li",{className:"nav-item flex-shrink-0",role:"presentation",children:jsxRuntimeExports.jsxs("button",{ref:ht=>ut.current[nt]=ht,type:"button",id:`tab-${st}`,className:dt,onClick:()=>at(st),onKeyDown:ht=>lt(ht),role:"tab","aria-controls":`tabpanel-${st}`,"aria-selected":ot===st,tabIndex:ot===st?0:-1,children:[tt,jsxRuntimeExports.jsxs("small",{children:[ct(rt)," ",et]})]})})},TabsList=tt=>{const{items:et,tabUnderlineLeft:rt,tabUnderlineWidth:st}=useTabsContext(),{className:nt,fullWidth:ot,isSticky:at,stickyTop:lt,...ut}=tt,ct=clsx("nav nav-tabs flex-nowrap",{"w-100":ot}),dt=clsx(" flex-shrink-0 overflow-x-auto",{"position-sticky z-1":at,"position-relative":!at},nt);return jsxRuntimeExports.jsx("div",{className:dt,...ut,style:at?{top:lt}:void 0,children:jsxRuntimeExports.jsxs("ul",{className:ct,role:"tablist",children:[et.map((ht,ft)=>jsxRuntimeExports.jsx(Tabs.Item,{order:ft,...ht},ht.id)),jsxRuntimeExports.jsx("span",{className:"nav-slide",style:{left:rt,width:st}})]})})},TabsPanel=({children:tt,currentItem:et,fullHeight:rt,className:st})=>{const{activeTab:nt}=useTabsContext(),ot=clsx("tab-content d-flex flex-fill w-100",{"position-relative h-100":rt},st);return jsxRuntimeExports.jsx("div",{className:ot,children:jsxRuntimeExports.jsx("div",{className:`tab-pane flex-fill w-100 fade ${nt===(et==null?void 0:et.id)?"show active":""}`,id:`tabpanel-${et==null?void 0:et.id}`,role:"tabpanel","aria-labelledby":`tab-${et==null?void 0:et.id}`,tabIndex:0,children:tt})})},Tabs=({defaultId:tt,items:et,fullWidth:rt=!1,fullHeight:st=!1,onChange:nt,children:ot,isSticky:at=!1,stickyTop:lt=0,headerClassName:ut,contentClassName:ct})=>{const{activeTab:dt,setSelectedTab:ht,tabsRef:ft,tabUnderlineLeft:xt,tabUnderlineWidth:vt,onKeyDown:yt}=useTabs({defaultId:tt,items:et,onChange:nt}),Et=reactExports.useMemo(()=>({activeTab:dt,items:et,setSelectedTab:ht,tabsRef:ft,tabUnderlineLeft:xt,tabUnderlineWidth:vt,onKeyDown:yt}),[dt,et,yt,ht,xt,vt,ft]),bt=et.find(wt=>wt.id===dt);return jsxRuntimeExports.jsx(TabsContext.Provider,{value:Et,children:typeof ot=="function"?ot(bt):jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Tabs.List,{fullWidth:rt,isSticky:at,stickyTop:lt,className:ut}),jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:bt,fullHeight:st,className:ct,children:bt==null?void 0:bt.content})]})})};Tabs.Item=TabsItem;Tabs.Panel=TabsPanel;Tabs.List=TabsList;const orderedTabs=["audio-capture","video-capture","internal-link","external-link","iframe","upload","workspace","video-embedder"],mediaLibraryTypes={none:null,audio:{title:"bbm.audio.modal.title",defaultTab:"audio-capture"},video:{title:"bbm.video.modal.title",defaultTab:"video-capture"},image:{title:"bbm.image.modal.title",defaultTab:"workspace"},attachment:{title:"bbm.attachment.modal.title",defaultTab:"workspace"},hyperlink:{title:"bbm.link.modal.title",defaultTab:"linker"},embedder:{title:"bbm.embed.modal.title",defaultTab:"iframe"},studio:{title:"bbm.studio.modal.title",defaultTab:"audio-capture"}},MediaLibrary=reactExports.forwardRef(({appCode:tt,visibility:et,multiple:rt,onSuccess:st,onCancel:nt,onTabChange:ot},at)=>{var lt;const ut=reactExports.useRef(),ct=reactExports.useRef(null);reactExports.useImperativeHandle(at,()=>({show:kt,hide:$t,showLink:Ft,type:xt,...ct.current})),useHttpErrorToast({isDismissible:!0,duration:1/0});const{t:dt}=useTranslation(),ht=useHasWorkflow("org.entcore.workspace.controllers.WorkspaceController|addDocument"),ft=useHasWorkflow("com.opendigitaleducation.video.controllers.VideoController|capture"),[xt,vt]=reactExports.useState(null),yt={workspace:{id:"workspace",icon:jsxRuntimeExports.jsx(SvgIconFolder,{}),label:dt("bbm.workspace"),content:jsxRuntimeExports.jsx(InnerTabs.Workspace,{}),availableFor:["audio","video","image","attachment"],isEnable:null},upload:{id:"upload",icon:jsxRuntimeExports.jsx(SvgIconSmartphone,{}),label:dt("bbm.device"),content:jsxRuntimeExports.jsx(InnerTabs.Upload,{}),availableFor:["audio","video","image","attachment"],isEnable:()=>!!ht},"video-capture":{id:"video-capture",icon:jsxRuntimeExports.jsx(SvgIconRecordVideo,{}),label:dt("bbm.video"),content:jsxRuntimeExports.jsx(InnerTabs.Video,{}),availableFor:["video","studio"],isEnable:()=>!!ft},"audio-capture":{id:"audio-capture",icon:jsxRuntimeExports.jsx(SvgIconMic,{}),label:dt("bbm.audio"),content:jsxRuntimeExports.jsx(InnerTabs.Audio,{}),availableFor:["audio","studio"],isEnable:()=>!!ht},"external-link":{id:"external-link",icon:jsxRuntimeExports.jsx(SvgIconGlobe,{}),label:dt("bbm.linker.ext"),content:jsxRuntimeExports.jsx(InnerTabs.ExternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},"internal-link":{id:"internal-link",icon:jsxRuntimeExports.jsx(SvgIconApplications,{}),label:dt("bbm.linker.int"),content:jsxRuntimeExports.jsx(InnerTabs.InternalLink,{...ut.current}),availableFor:["hyperlink"],isEnable:null},iframe:{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.Iframe,{}),availableFor:["embedder"],isEnable:null},"video-embedder":{id:"iframe",icon:jsxRuntimeExports.jsx(SvgIconCode,{}),label:dt("bbm.embed"),content:jsxRuntimeExports.jsx(InnerTabs.VideoEmbedder,{}),availableFor:["video"],isEnable:null}},Et=reactExports.useMemo(()=>orderedTabs.map(Qt=>yt[Qt]).filter(Qt=>{var Yt;return((Yt=Qt.isEnable)==null?void 0:Yt.call(Qt))!==!1&&(Qt.availableFor.length===0||Qt.availableFor.includes(xt))}),[xt]),[bt,wt]=reactExports.useState(),St=reactExports.useMemo(()=>{const Qt=Et.findIndex(Yt=>Yt.id===bt);return 0>Qt||Qt>=Et.length?0:Qt},[Et,bt]),[Rt,Ct]=reactExports.useState(),[It,jt]=reactExports.useState(),[Pt,Ot]=reactExports.useState([]),[Ut,Nt]=reactExports.useState();function Ht(Qt){throw Et.findIndex(Yt=>Yt.id===Qt)<0?"tab.not.visible":"not.implemented.yet"}function Lt(Qt){ut.current=void 0,wt(void 0),vt(Qt)}const kt=Qt=>{vt(Qt)},$t=()=>{vt(null)},Ft=Qt=>{ut.current=Qt,"resourceId"in Qt||"appPrefix"in Qt||wt("external-link"),vt("hyperlink")};reactExports.useEffect(()=>{var Qt,Yt;const tr=xt||"none";!bt&&typeof((Qt=mediaLibraryTypes[tr])==null?void 0:Qt.defaultTab)=="string"&&wt((Yt=mediaLibraryTypes[tr])==null?void 0:Yt.defaultTab)},[bt,xt]);const Gt=dt(((lt=mediaLibraryTypes[xt??"none"])==null?void 0:lt.title)??"bbm"),Mt=()=>{ut.current=void 0,jt(void 0),Ct(void 0),wt(void 0),Nt(void 0),Ot([])},Vt=Qt=>{ot==null||ot(Qt,Pt),Mt()},Bt=reactExports.useCallback(()=>{const Qt=async Yt=>{Yt instanceof Array&&["protected","public"].findIndex(tr=>tr===et)>=0&&(Yt=await odeServices.workspace().transferDocuments(Yt,tt??"media-library",et)),st(Yt)};Ut?Ut().then(Yt=>{Qt(Yt)}):It&&Qt(It),Mt()},[Ut,It,st,et,tt]),qt=()=>{nt(Pt),Mt()};return xt&&jsxRuntimeExports.jsx(MediaLibraryContext.Provider,{value:{appCode:tt,visibility:et,multiple:rt,type:xt,setResultCounter:Ct,setResult:jt,setCancellable:Qt=>Ot([...Qt]),setVisibleTab:Ht,switchType:Lt,setPreSuccess:Nt},children:jsxRuntimeExports.jsxs(Modal,{id:"media-library",isOpen:xt!==null,onModalClose:qt,size:"lg",viewport:!0,scrollable:!0,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:qt,children:Gt}),jsxRuntimeExports.jsx(Tabs,{items:Et,defaultId:Et[St].id,onChange:Vt,children:Qt=>jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[Et.length>1&&jsxRuntimeExports.jsx(Tabs.List,{className:"mt-16"}),jsxRuntimeExports.jsx(Modal.Body,{className:"d-flex",children:jsxRuntimeExports.jsx(Tabs.Panel,{currentItem:Qt,children:Qt==null?void 0:Qt.content})})]})}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:qt,children:dt("cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",disabled:typeof It>"u",onClick:Bt,children:Rt&&Rt>1?dt("addMultiple",{number:Rt}):dt("add")})]})]})})});function PublishModal$2({isOpen:tt,resourceId:et,onSuccess:rt,onCancel:st}){const{appCode:nt,currentApp:ot}=useEdificeClient(),{ref:at,libraryMedia:lt,...ut}=useMediaLibrary(),{t:ct}=useTranslation(),dt=useResource(nt,et),{control:ht,cover:ft,formState:{isDirty:xt,isValid:vt,isSubmitting:yt},handleDeleteImage:Et,handleSubmit:bt,handleUploadImage:wt,handlePublish:St,register:Rt,selectActivities:Ct,selectedActivities:It,selectedSubjectAreas:jt,selectSubjects:Pt}=usePublishModal({resource:dt,onSuccess:rt});return dt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{isOpen:tt,onModalClose:st,id:"libraryModal",size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:st,children:ct("bpr.publish")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:ct("bpr.form.tip")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.general")}),jsxRuntimeExports.jsxs("form",{id:"libraryModalForm",onSubmit:bt(St),children:[jsxRuntimeExports.jsxs("div",{className:"d-block d-md-flex mb-24 gap-24",children:[jsxRuntimeExports.jsxs("div",{style:{maxWidth:"160px"},children:[jsxRuntimeExports.jsx("div",{className:"form-label",children:ct("bpr.form.publication.cover.title")}),jsxRuntimeExports.jsx(ImagePicker,{app:ot,src:dt==null?void 0:dt.thumbnail,addButtonLabel:ct("bpr.form.publication.cover.upload.add"),deleteButtonLabel:ct("bpr.form.publication.cover.upload.remove"),onUploadImage:wt,onDeleteImage:Et,className:"align-self-center",libraryMedia:lt,mediaLibraryRef:at}),!ft&&jsxRuntimeExports.jsx("p",{className:"form-text is-invalid",children:jsxRuntimeExports.jsx("em",{children:ct("bpr.form.publication.cover.upload.required.image")})})]}),jsxRuntimeExports.jsxs("div",{className:"flex-fill",children:[jsxRuntimeExports.jsxs(FormControl,{id:"title",className:"mb-16",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.title")}),jsxRuntimeExports.jsx(Input,{type:"text",defaultValue:dt==null?void 0:dt.name,...Rt("title",{required:!0}),placeholder:ct("bpr.form.publication.title.placeholder"),size:"md","aria-required":!0})]}),jsxRuntimeExports.jsxs(FormControl,{id:"description",isRequired:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.description")}),jsxRuntimeExports.jsx(TextArea,{...Rt("description",{required:!0}),placeholder:ct("bpr.form.publication.description.placeholder"),size:"md"})]})]})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.heading.infos")}),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-column flex-md-row gap-16 row mb-24",children:[jsxRuntimeExports.jsx(ActivitiesDropdown,{control:ht,selectedActivities:It,selectActivities:Ct}),jsxRuntimeExports.jsx(SubjectsDropdown,{control:ht,selectedSubjectAreas:jt,selectSubjects:Pt}),jsxRuntimeExports.jsx(LangSelect,{control:ht})]}),jsxRuntimeExports.jsxs("div",{className:"mb-24",children:[jsxRuntimeExports.jsx("label",{htmlFor:"",className:"form-label",children:ct("bpr.form.publication.age")}),jsxRuntimeExports.jsxs("div",{className:"d-flex gap-8",children:[jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMin",placeholderOption:"bpr.form.publication.age.min",validate:(Nt,Ht)=>parseInt(Nt)<=parseInt(Ht.ageMax)})}),jsxRuntimeExports.jsx("div",{className:"col col-md-2 d-flex",children:jsxRuntimeExports.jsx(AgeSelect,{control:ht,name:"ageMax",placeholderOption:"bpr.form.publication.age.max",validate:(Nt,Ht)=>parseInt(Nt)>=parseInt(Ht.ageMin)})})]})]}),jsxRuntimeExports.jsx("div",{className:"mb-24",children:jsxRuntimeExports.jsxs(FormControl,{id:"keywords",isOptional:!0,children:[jsxRuntimeExports.jsx(Label,{children:ct("bpr.form.publication.keywords")}),jsxRuntimeExports.jsx(Input,{type:"text",...Rt("keyWords"),size:"md",placeholder:ct("bpr.form.publication.keywords.placeholder")})]})}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:ct("bpr.form.publication.licence.text")}),jsxRuntimeExports.jsx(PublishModalFooter,{})]})]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",onClick:st,type:"button",variant:"ghost",children:ct("cancel")}),jsxRuntimeExports.jsx(Button,{form:"libraryModalForm",type:"submit",color:"primary",variant:"filled",isLoading:yt,disabled:!ft||yt||!xt||!vt,children:ct("bpr.form.submit")})]}),jsxRuntimeExports.jsx(MediaLibrary,{appCode:nt,ref:at,multiple:!1,visibility:"protected",...ut})]}),document.getElementById("portal")):jsxRuntimeExports.jsx(LoadingScreen,{})}const SvgIconCopy=({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:"M6.676 3c.284-.672.853-1 1.263-1h11.423c.566 0 1.438.628 1.438 1.923v13.154c0 1.056-.58 1.668-1.1 1.858V6.923C19.7 4.99 18.3 3 16.061 3zm-2.272.007C4.765 1.41 6.056 0 7.939 0h11.423C21.599 0 23 1.99 23 3.923v13.154c0 1.865-1.303 3.782-3.403 3.916C19.235 22.59 17.944 24 16.06 24H4.638C2.401 24 1 22.01 1 20.077V6.923c0-1.865 1.303-3.782 3.404-3.916M3.2 6.923C3.2 5.628 4.072 5 4.638 5h11.423c.567 0 1.439.628 1.439 1.923v13.154c0 1.295-.872 1.923-1.439 1.923H4.638c-.566 0-1.438-.628-1.438-1.923z",clipRule:"evenodd"})]}),defaults=Object.freeze({ignoreUnknown:!1,respectType:!1,respectFunctionNames:!1,respectFunctionProperties:!1,unorderedObjects:!0,unorderedArrays:!1,unorderedSets:!1,excludeKeys:void 0,excludeValues:void 0,replacer:void 0});function objectHash(tt,et){et?et={...defaults,...et}:et=defaults;const rt=createHasher(et);return rt.dispatch(tt),rt.toString()}const defaultPrototypesKeys=Object.freeze(["prototype","__proto__","constructor"]);function createHasher(tt){let et="",rt=new Map;const st=nt=>{et+=nt};return{toString(){return et},getContext(){return rt},dispatch(nt){return tt.replacer&&(nt=tt.replacer(nt)),this[nt===null?"null":typeof nt](nt)},object(nt){if(nt&&typeof nt.toJSON=="function")return this.object(nt.toJSON());const ot=Object.prototype.toString.call(nt);let at="";const lt=ot.length;lt<10?at="unknown:["+ot+"]":at=ot.slice(8,lt-1),at=at.toLowerCase();let ut=null;if((ut=rt.get(nt))===void 0)rt.set(nt,rt.size);else return this.dispatch("[CIRCULAR:"+ut+"]");if(typeof Buffer<"u"&&Buffer.isBuffer&&Buffer.isBuffer(nt))return st("buffer:"),st(nt.toString("utf8"));if(at!=="object"&&at!=="function"&&at!=="asyncfunction")this[at]?this[at](nt):tt.ignoreUnknown||this.unkown(nt,at);else{let ct=Object.keys(nt);tt.unorderedObjects&&(ct=ct.sort());let dt=[];tt.respectType!==!1&&!isNativeFunction(nt)&&(dt=defaultPrototypesKeys),tt.excludeKeys&&(ct=ct.filter(ft=>!tt.excludeKeys(ft)),dt=dt.filter(ft=>!tt.excludeKeys(ft))),st("object:"+(ct.length+dt.length)+":");const ht=ft=>{this.dispatch(ft),st(":"),tt.excludeValues||this.dispatch(nt[ft]),st(",")};for(const ft of ct)ht(ft);for(const ft of dt)ht(ft)}},array(nt,ot){if(ot=ot===void 0?tt.unorderedArrays!==!1:ot,st("array:"+nt.length+":"),!ot||nt.length<=1){for(const ut of nt)this.dispatch(ut);return}const at=new Map,lt=nt.map(ut=>{const ct=createHasher(tt);ct.dispatch(ut);for(const[dt,ht]of ct.getContext())at.set(dt,ht);return ct.toString()});return rt=at,lt.sort(),this.array(lt,!1)},date(nt){return st("date:"+nt.toJSON())},symbol(nt){return st("symbol:"+nt.toString())},unkown(nt,ot){if(st(ot),!!nt&&(st(":"),nt&&typeof nt.entries=="function"))return this.array(Array.from(nt.entries()),!0)},error(nt){return st("error:"+nt.toString())},boolean(nt){return st("bool:"+nt)},string(nt){st("string:"+nt.length+":"),st(nt)},function(nt){st("fn:"),isNativeFunction(nt)?this.dispatch("[native]"):this.dispatch(nt.toString()),tt.respectFunctionNames!==!1&&this.dispatch("function-name:"+String(nt.name)),tt.respectFunctionProperties&&this.object(nt)},number(nt){return st("number:"+nt)},xml(nt){return st("xml:"+nt.toString())},null(){return st("Null")},undefined(){return st("Undefined")},regexp(nt){return st("regex:"+nt.toString())},uint8array(nt){return st("uint8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint8clampedarray(nt){return st("uint8clampedarray:"),this.dispatch(Array.prototype.slice.call(nt))},int8array(nt){return st("int8array:"),this.dispatch(Array.prototype.slice.call(nt))},uint16array(nt){return st("uint16array:"),this.dispatch(Array.prototype.slice.call(nt))},int16array(nt){return st("int16array:"),this.dispatch(Array.prototype.slice.call(nt))},uint32array(nt){return st("uint32array:"),this.dispatch(Array.prototype.slice.call(nt))},int32array(nt){return st("int32array:"),this.dispatch(Array.prototype.slice.call(nt))},float32array(nt){return st("float32array:"),this.dispatch(Array.prototype.slice.call(nt))},float64array(nt){return st("float64array:"),this.dispatch(Array.prototype.slice.call(nt))},arraybuffer(nt){return st("arraybuffer:"),this.dispatch(new Uint8Array(nt))},url(nt){return st("url:"+nt.toString())},map(nt){st("map:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},set(nt){st("set:");const ot=[...nt];return this.array(ot,tt.unorderedSets!==!1)},file(nt){return st("file:"),this.dispatch([nt.name,nt.size,nt.type,nt.lastModfied])},blob(){if(tt.ignoreUnknown)return st("[blob]");throw new Error(`Hashing Blob objects is currently not supported
|
|
1392
1392
|
Use "options.replacer" or "options.ignoreUnknown"
|
|
1393
1393
|
`)},domwindow(){return st("domwindow")},bigint(nt){return st("bigint:"+nt.toString())},process(){return st("process")},timer(){return st("timer")},pipe(){return st("pipe")},tcp(){return st("tcp")},udp(){return st("udp")},tty(){return st("tty")},statwatcher(){return st("statwatcher")},securecontext(){return st("securecontext")},connection(){return st("connection")},zlib(){return st("zlib")},context(){return st("context")},nodescript(){return st("nodescript")},httpparser(){return st("httpparser")},dataview(){return st("dataview")},signal(){return st("signal")},fsevent(){return st("fsevent")},tlswrap(){return st("tlswrap")}}}const nativeFunc="[native code] }",nativeFuncLength=nativeFunc.length;function isNativeFunction(tt){return typeof tt!="function"?!1:Function.prototype.toString.call(tt).slice(-nativeFuncLength)===nativeFunc}class WordArray{constructor(et,rt){et=this.words=et||[],this.sigBytes=rt===void 0?et.length*4:rt}toString(et){return(et||Hex).stringify(this)}concat(et){if(this.clamp(),this.sigBytes%4)for(let rt=0;rt<et.sigBytes;rt++){const st=et.words[rt>>>2]>>>24-rt%4*8&255;this.words[this.sigBytes+rt>>>2]|=st<<24-(this.sigBytes+rt)%4*8}else for(let rt=0;rt<et.sigBytes;rt+=4)this.words[this.sigBytes+rt>>>2]=et.words[rt>>>2];return this.sigBytes+=et.sigBytes,this}clamp(){this.words[this.sigBytes>>>2]&=4294967295<<32-this.sigBytes%4*8,this.words.length=Math.ceil(this.sigBytes/4)}clone(){return new WordArray([...this.words])}}const Hex={stringify(tt){const et=[];for(let rt=0;rt<tt.sigBytes;rt++){const st=tt.words[rt>>>2]>>>24-rt%4*8&255;et.push((st>>>4).toString(16),(st&15).toString(16))}return et.join("")}},Base64={stringify(tt){const et="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",rt=[];for(let st=0;st<tt.sigBytes;st+=3){const nt=tt.words[st>>>2]>>>24-st%4*8&255,ot=tt.words[st+1>>>2]>>>24-(st+1)%4*8&255,at=tt.words[st+2>>>2]>>>24-(st+2)%4*8&255,lt=nt<<16|ot<<8|at;for(let ut=0;ut<4&&st*8+ut*6<tt.sigBytes*8;ut++)rt.push(et.charAt(lt>>>6*(3-ut)&63))}return rt.join("")}},Latin1={parse(tt){const et=tt.length,rt=[];for(let st=0;st<et;st++)rt[st>>>2]|=(tt.charCodeAt(st)&255)<<24-st%4*8;return new WordArray(rt,et)}},Utf8={parse(tt){return Latin1.parse(unescape(encodeURIComponent(tt)))}};class BufferedBlockAlgorithm{constructor(){this._data=new WordArray,this._nDataBytes=0,this._minBufferSize=0,this.blockSize=512/32}reset(){this._data=new WordArray,this._nDataBytes=0}_append(et){typeof et=="string"&&(et=Utf8.parse(et)),this._data.concat(et),this._nDataBytes+=et.sigBytes}_doProcessBlock(et,rt){}_process(et){let rt,st=this._data.sigBytes/(this.blockSize*4);et?st=Math.ceil(st):st=Math.max((st|0)-this._minBufferSize,0);const nt=st*this.blockSize,ot=Math.min(nt*4,this._data.sigBytes);if(nt){for(let at=0;at<nt;at+=this.blockSize)this._doProcessBlock(this._data.words,at);rt=this._data.words.splice(0,nt),this._data.sigBytes-=ot}return new WordArray(rt,ot)}}class Hasher extends BufferedBlockAlgorithm{update(et){return this._append(et),this._process(),this}finalize(et){et&&this._append(et)}}const H=[1779033703,-1150833019,1013904242,-1521486534,1359893119,-1694144372,528734635,1541459225],K=[1116352408,1899447441,-1245643825,-373957723,961987163,1508970993,-1841331548,-1424204075,-670586216,310598401,607225278,1426881987,1925078388,-2132889090,-1680079193,-1046744716,-459576895,-272742522,264347078,604807628,770255983,1249150122,1555081692,1996064986,-1740746414,-1473132947,-1341970488,-1084653625,-958395405,-710438585,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,-2117940946,-1838011259,-1564481375,-1474664885,-1035236496,-949202525,-778901479,-694614492,-200395387,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,-2067236844,-1933114872,-1866530822,-1538233109,-1090935817,-965641998],W=[];class SHA256 extends Hasher{constructor(){super(...arguments),this._hash=new WordArray([...H])}reset(){super.reset(),this._hash=new WordArray([...H])}_doProcessBlock(et,rt){const st=this._hash.words;let nt=st[0],ot=st[1],at=st[2],lt=st[3],ut=st[4],ct=st[5],dt=st[6],ht=st[7];for(let ft=0;ft<64;ft++){if(ft<16)W[ft]=et[rt+ft]|0;else{const St=W[ft-15],Rt=(St<<25|St>>>7)^(St<<14|St>>>18)^St>>>3,Ct=W[ft-2],It=(Ct<<15|Ct>>>17)^(Ct<<13|Ct>>>19)^Ct>>>10;W[ft]=Rt+W[ft-7]+It+W[ft-16]}const xt=ut&ct^~ut&dt,vt=nt&ot^nt&at^ot&at,yt=(nt<<30|nt>>>2)^(nt<<19|nt>>>13)^(nt<<10|nt>>>22),Et=(ut<<26|ut>>>6)^(ut<<21|ut>>>11)^(ut<<7|ut>>>25),bt=ht+Et+xt+K[ft]+W[ft],wt=yt+vt;ht=dt,dt=ct,ct=ut,ut=lt+bt|0,lt=at,at=ot,ot=nt,nt=bt+wt|0}st[0]=st[0]+nt|0,st[1]=st[1]+ot|0,st[2]=st[2]+at|0,st[3]=st[3]+lt|0,st[4]=st[4]+ut|0,st[5]=st[5]+ct|0,st[6]=st[6]+dt|0,st[7]=st[7]+ht|0}finalize(et){super.finalize(et);const rt=this._nDataBytes*8,st=this._data.sigBytes*8;return this._data.words[st>>>5]|=128<<24-st%32,this._data.words[(st+64>>>9<<4)+14]=Math.floor(rt/4294967296),this._data.words[(st+64>>>9<<4)+15]=rt,this._data.sigBytes=this._data.words.length*4,this._process(),this._hash}}function sha256base64(tt){return new SHA256().finalize(tt).toString(Base64)}function hash(tt,et={}){const rt=typeof tt=="string"?tt:objectHash(tt,et);return sha256base64(rt).slice(0,10)}var slugify$1={};Object.defineProperty(slugify$1,"__esModule",{value:!0});const stripAccents=tt=>{const et="ÀÁÂÃÄÅĄĀàáâãäåąāÒÓÔÕÕÖØòóôõöøÈÉÊËĘĒèéêëðęēÇĆČçćčÐÌÍÎÏĪìíîïīÙÚÛÜŪùúûüūÑŅñņŠŚšśŸÿýŽŹŻžźżŁĻłļŃŅńņàáãảạăằắẳẵặâầấẩẫậèéẻẽẹêềếểễệđùúủũụưừứửữựòóỏõọôồốổỗộơờớởỡợìíỉĩịäëïîüûñçýỳỹỵỷğışĞİŞĢģĶķ",rt="AAAAAAAAaaaaaaaaOOOOOOOooooooEEEEEEeeeeeeeCCCcccDIIIIIiiiiiUUUUUuuuuuNNnnSSssYyyZZZzzzLLllNNnnaaaaaaaaaaaaaaaaaeeeeeeeeeeeduuuuuuuuuuuoooooooooooooooooiiiiiaeiiuuncyyyyygisGISGgKk",st=et.split("").join("|"),nt=new RegExp(`(${st})`,"g");function ot(at){return rt[et.indexOf(at)]||""}return tt.replace(nt,ot)},getSafeRegexpString=tt=>tt.split("").map(et=>`\\${et}`).join(""),harmonize=(tt,et,rt=!1)=>{const st=stripAccents(tt).trim().toLowerCase(),nt=getSafeRegexpString(et);return rt?st.replace(/\s+/g,et):st.replace(new RegExp(`[^a-z0-9${nt}]+`,"g"),et).replace(new RegExp(`${nt}+`,"g"),et).replace(new RegExp(`^${nt}`,"g"),"").replace(new RegExp(`${nt}$`,"g"),"")},slugify=(tt,et={delimiter:"-",prefix:""})=>{if(et.delimiter||(et.delimiter="-"),et.prefix||(et.prefix=""),!tt||typeof tt=="boolean")return"";const{delimiter:rt,prefix:st}=et;if(typeof tt=="boolean")return"";if(typeof tt=="string"||typeof tt=="number"){const nt=harmonize(st,rt,!0),ot=harmonize(String(tt),rt);return nt?`${nt}${rt}${ot}`:ot}return"children"in tt?slugify(tt.children):"type"in tt?slugify(tt.props.children,et):Symbol.iterator in tt?slugify(Array.from(tt).map(nt=>slugify(nt,{delimiter:rt})).join(rt),et):""};var _default=slugify$1.default=slugify;const useSlug=({watch:tt,setValue:et,selectedResource:rt})=>{const[st,nt]=reactExports.useState(""),[ot,at]=reactExports.useState((rt==null?void 0:rt.public)||!1),lt=reactExports.useId(),ut=tt("title"),{t:ct}=useTranslation(),dt=useToast();reactExports.useEffect(()=>{if(ot){let xt="";rt?xt=rt.slug?rt.slug:`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`:xt=`${hash({foo:`${ut}${lt}`})}-${_default(ut)}`,et("formSlug",xt),nt(xt)}},[ot,ut]);function ht(xt){at(xt)}function ft(xt){navigator.clipboard.writeText(`${window.location.origin}${xt||window.location.pathname}/pub/${st}`),dt.success(ct("explorer.copy.clipboard"))}return{slug:st,uniqueId:lt,isPublic:ot,resourceName:ut,onPublicChange:ht,onCopyToClipBoard:ft}},BlogPublic=({appCode:tt,isUpdating:et,resource:rt,watch:st,register:nt,setValue:ot})=>{const{t:at}=useTranslation(),{slug:lt,isPublic:ut,resourceName:ct,onPublicChange:dt,onCopyToClipBoard:ht}=useSlug({watch:st,setValue:ot,selectedResource:et?rt:void 0});return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:[at("explorer.resource.editModal.heading.access"),tt]}),jsxRuntimeExports.jsx(Alert,{type:"info",children:at("explorer.resource.editModal.access.alert")}),jsxRuntimeExports.jsxs(FormControl,{id:"flexSwitchCheckDefault",className:"form-switch d-flex gap-8 mt-16 mb-8",children:[jsxRuntimeExports.jsx(FormControl.Input,{type:"checkbox",role:"switch",defaultChecked:et?rt.public:!1,...nt("enablePublic",{disabled:!ct,onChange:ft=>{const xt=ft.target.checked;dt(xt)}}),className:"form-check-input mt-0",size:"md"}),jsxRuntimeExports.jsx(FormControl.Label,{className:"form-check-label mb-0",children:at("explorer.resource.editModal.access.flexSwitchCheckDefault.label")})]}),ut&&jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(FormControl,{id:"formSlug",children:jsxRuntimeExports.jsx(Input,{type:"text",hidden:!0,defaultValue:et?lt:"",...nt("formSlug"),size:"sm"})},lt),jsxRuntimeExports.jsxs("div",{className:"d-flex flex-wrap align-items-center gap-4",children:[jsxRuntimeExports.jsxs("p",{className:"text-break",children:[window.location.origin,"/blog/pub/",lt]}),jsxRuntimeExports.jsx(Button,{color:"primary",disabled:!ut,onClick:()=>ht("/blog"),type:"button",leftIcon:jsxRuntimeExports.jsx(SvgIconCopy,{}),variant:"ghost",className:"text-nowrap",children:at("explorer.resource.editModal.access.url.button")})]})]})]})},useUpdateMutation=({application:tt,options:et})=>useMutation({mutationFn:async rt=>await odeServices.resource(tt).update(rt),...et}),SvgIconBookmark=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M7 4a1 1 0 0 0-1 1v14.06l5.42-3.87a1 1 0 0 1 1.16 0L18 19.06V5a1 1 0 0 0-1-1zM4.88 2.88A3 3 0 0 1 7 2h10a3 3 0 0 1 3 3v16a1 1 0 0 1-1.58.81L12 17.23 5.58 21.8A1 1 0 0 1 4 21V5a3 3 0 0 1 .88-2.12"})]}),ShareBookmark=({bookmark:tt,refBookmark:et,onBookmarkChange:rt,onSave:st})=>{const{t:nt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"mt-16",children:jsxRuntimeExports.jsxs(FormControl,{id:"bookmarkName",className:"d-flex flex-wrap align-items-center gap-16",children:[jsxRuntimeExports.jsx("div",{className:"flex-fill",children:jsxRuntimeExports.jsx(FormControl.Input,{ref:et,onChange:rt,placeholder:nt("explorer.modal.share.sharebookmark.placeholder"),size:"sm",type:"text"},tt.id)}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"ghost",disabled:tt.name.length===0,leftIcon:jsxRuntimeExports.jsx(SvgIconSave,{}),onClick:st,className:"text-nowrap",children:nt("explorer.modal.share.sharebookmark.save")})]})})},hasRight=(tt,et)=>tt.actions.filter(rt=>et.id===rt.id).length>0,showShareRightLine=(tt,et)=>tt.isBookmarkMember&&et||!tt.isBookmarkMember,DISABLED_GROUP_LABELS=["CommunityMemberGroup","CommunityAdminGroup"],useShareRightDisabled=()=>({isShareRightDisabled:(tt,et)=>{if(tt.type!=="group")return!1;const rt=et.visibleGroups.find(st=>st.id===tt.id);return!rt||!rt.labels||!Array.isArray(rt.labels)?!1:!!rt.labels.some(st=>DISABLED_GROUP_LABELS.includes(st))}}),HIDDEN_GROUP_LABELS=["CommunityAdminGroup"],useShareRightVisible=()=>({isShareRightVisible:(tt,et)=>{if(tt.type!=="group")return!0;const rt=et.visibleGroups.find(st=>st.id===tt.id);return!rt||!rt.labels||!Array.isArray(rt.labels)?!0:!rt.labels.some(st=>HIDDEN_GROUP_LABELS.includes(st))}}),ShareBookmarkLine=({shareRights:tt,showBookmark:et,toggleBookmark:rt,shareRightActions:st,toggleRight:nt,onDeleteRow:ot})=>{const{t:at}=useTranslation(),{isShareRightDisabled:lt}=useShareRightDisabled(),{isShareRightVisible:ut}=useShareRightVisible();return tt==null?void 0:tt.rights.map(ct=>{const dt={user:jsxRuntimeExports.jsx(Avatar,{alt:at("explorer.modal.share.avatar.shared.alt"),size:"xs",src:ct.avatarUrl,variant:"circle"}),group:jsxRuntimeExports.jsx("div",{className:"avatar-xs bg-primary-200 justify-content-center d-flex rounded-circle",children:jsxRuntimeExports.jsx(SvgIconUsers,{width:16})}),sharebookmark:jsxRuntimeExports.jsx(SvgIconBookmark,{})}[ct.type]||null,ht=ct.type==="sharebookmark",ft=ct.type==="user",xt=lt(ct,tt);return ut(ct,tt)?showShareRightLine(ct,et)&&jsxRuntimeExports.jsxs("tr",{className:ct.isBookmarkMember?"bg-light":"",children:[jsxRuntimeExports.jsx("td",{children:dt}),jsxRuntimeExports.jsx("td",{children:jsxRuntimeExports.jsxs("div",{className:"d-flex",children:[ht&&jsxRuntimeExports.jsx(Button,{color:"tertiary",rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:at("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:et?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal ps-0",onClick:rt,children:ct.displayName}),!ht&&ct.displayName,ft&&` (${at(ct.profile||"")})`]})}),st.map(vt=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:hasRight(ct,vt),onChange:()=>nt(ct,vt.id),disabled:xt})},vt.displayName)),jsxRuntimeExports.jsx("td",{children:!ct.isBookmarkMember&&!xt&&jsxRuntimeExports.jsx(IconButton,{"aria-label":at("close"),color:"tertiary",icon:jsxRuntimeExports.jsx(SvgIconClose,{}),type:"button",variant:"ghost",title:at("close"),onClick:()=>ot(ct)})})]},ct.id):null})},initialState$2={searchInputValue:"",searchResults:[],searchAPIResults:[],isSearching:!1};function reducer$1(tt,et){switch(et.type){case"onChange":return{...tt,searchInputValue:et.payload};case"isSearching":return{...tt,isSearching:et.payload};case"addResult":return{...tt,searchResults:et.payload};case"addApiResult":return{...tt,searchAPIResults:et.payload};case"updateSearchResult":return{...tt,searchResults:et.payload};case"emptyResult":return{...tt,searchResults:et.payload};default:throw new Error("Unhandled action type")}}const defaultActions=[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}],useSearch=({resourceId:tt,resourceCreatorId:et,shareRights:rt,shareDispatch:st})=>{const[nt,ot]=reactExports.useReducer(reducer$1,initialState$2),at=useDebounce(nt.searchInputValue,500),{isAdml:lt}=useIsAdml(),{appCode:ut}=useEdificeClient(),{t:ct}=useTranslation();reactExports.useEffect(()=>{ht(at)},[at]);const dt=ft=>{const xt=ft.target.value;ot({type:"onChange",payload:xt})},ht=async ft=>{if(tt){if(ot({type:"isSearching",payload:!0}),!lt&&ft.length>=1||lt&&ft.length>=3){const xt=await odeServices.share().searchShareSubjects(ut,tt,ft);ot({type:"addApiResult",payload:xt});const vt=xt.filter(yt=>!rt.rights.find(Et=>Et.id===yt.id)).filter(yt=>!(yt.type==="user"&&yt.id===et)).map(yt=>{let Et=yt.displayName;return yt.type==="user"&&yt.profile?Et=`${Et} (${ct(yt.profile)})`:yt.type==="group"&&yt.structureName&&(Et=`${Et} (${yt.structureName})`),{value:yt.id,label:Et,icon:yt.type==="sharebookmark"?jsxRuntimeExports.jsx(SvgIconBookmark,{}):null}});ot({type:"addResult",payload:vt})}else ot({type:"emptyResult",payload:[]}),Promise.resolve();ot({type:"isSearching",payload:!1})}};return{state:nt,showSearchAdmlHint:()=>lt&&nt.searchInputValue.length<3,showSearchLoading:()=>nt.isSearching,showSearchNoResults:()=>!nt.isSearching&&!lt&&at.length>0&&nt.searchResults.length===0||!nt.isSearching&<&&at.length>3&&nt.searchResults.length===0,getSearchMinLength:()=>lt?3:1,handleSearchInputChange:dt,handleSearchResultsChange:async ft=>{const xt=nt.searchAPIResults.find(vt=>vt.id===ft[0]);if(xt){let vt=[];if(xt.type==="sharebookmark"){const yt=await odeServices.directory().getBookMarkById(xt.id);vt.push({...yt,type:"sharebookmark",avatarUrl:"",directoryUrl:"",actions:defaultActions}),yt==null||yt.users.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{vt.push({...Et,type:"user",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})}),yt.groups.filter(Et=>!rt.rights.find(bt=>bt.id===Et.id)).forEach(Et=>{vt.push({...Et,type:"group",avatarUrl:"",directoryUrl:"",actions:defaultActions,isBookmarkMember:!0})})}else vt=[{...xt,actions:[{id:"read",displayName:"read"},{id:"comment",displayName:"comment"}]}];st({type:"updateShareRights",payload:{...rt,rights:[...rt.rights,...vt]}}),ot({type:"updateSearchResult",payload:nt.searchResults.filter(yt=>yt.value!==ft[0])})}}}},initialState$1={isSharing:!1,shareRights:{rights:[],visibleBookmarks:[],visibleGroups:[],visibleUsers:[]},shareRightActions:[]};function reducer(tt,et){switch(et.type){case"init":return{...tt,...et.payload};case"deleteRow":return{...tt,shareRights:et.payload};case"updateShareRights":return{...tt,shareRights:et.payload};case"toggleRight":return{...tt,shareRights:et.payload};case"isSharing":return{...tt,isSharing:et.payload};default:throw new Error("Unhandled action type")}}function useShare({resourceId:tt,resourceRights:et,resourceCreatorId:rt,shareResource:st,setIsLoading:nt,onSuccess:ot}){const{appCode:at}=useEdificeClient(),{user:lt,avatar:ut}=useUser(),ct=useToast(),{t:dt}=useTranslation(),[ht,ft]=reactExports.useReducer(reducer,initialState$1);reactExports.useEffect(()=>{tt&&(async()=>{try{const[yt,Et]=await Promise.all([odeServices.share().getActionsForApp(at),odeServices.share().getRightsForResource(at,tt)]);ft({type:"init",payload:{shareRightActions:yt,shareRights:Et}})}catch(yt){console.error(yt)}nt(!1)})()},[tt]);const xt=(yt,Et)=>{var bt,wt;const{rights:St,...Rt}=ht.shareRights,Ct=[...St],It=Ct.findIndex(Pt=>Pt.id===yt.id),jt=ht.shareRightActions.filter(Pt=>Pt.id===Et)[0];if(Ct[It].actions.findIndex(Pt=>Pt.id===Et)>-1){let Pt=Ct[It].actions.filter(Ut=>Ut.id!==Et);const Ot=ht.shareRightActions.filter(Ut=>{var Nt;return(Nt=Ut.requires)==null?void 0:Nt.includes(Et)});Pt=Pt.filter(Ut=>!Ot.find(Nt=>Nt.id===Ut.id)),Ct[It]={...Ct[It],actions:Pt}}else{const Pt=ht.shareRightActions.filter(Ot=>{var Ut;return((Ut=jt.requires)==null?void 0:Ut.includes(Ot.id))&&!Ct[It].actions.find(Nt=>Nt.id===Ot.id)});Ct[It]={...Ct[It],actions:[...Ct[It].actions,jt,...Pt]}}yt.type==="sharebookmark"&&((bt=Ct[It].users)==null||bt.forEach(Pt=>{const Ot=Ct.findIndex(Ut=>Ut.id===Pt.id);Ct[Ot]={...Ct[Ot],actions:Ct[It].actions}}),(wt=Ct[It].groups)==null||wt.forEach(Pt=>{const Ot=Ct.findIndex(Ut=>Ut.id===Pt.id);Ct[Ot]={...Ct[Ot],actions:Ct[It].actions}})),ft({type:"toggleRight",payload:{rights:Ct,...Rt}})},vt=yt=>{Object.keys(yt)[0]==="error"?(ct.error(dt("explorer.shared.status.error")),console.error("Failed to save share",yt)):ct.success(dt("explorer.shared.status.saved"))};return{state:ht,dispatch:ft,currentIsAuthor:()=>rt===(lt==null?void 0:lt.userId),myAvatar:ut,handleDeleteRow:yt=>{ft({type:"deleteRow",payload:{...ht.shareRights,rights:ht.shareRights.rights.filter(Et=>{var bt,wt;return Et.id!==yt.id&&!((bt=yt.users)!=null&&bt.find(St=>St.id===Et.id))&&!((wt=yt.groups)!=null&&wt.find(St=>St.id===Et.id))})}})},handleShare:async()=>{ft({type:"isSharing",payload:!0});try{const yt=et.filter(bt=>lt&&bt.includes(`user:${lt.userId}`)).map(bt=>bt.split(":")[2]).filter(bt=>!!bt),Et=[...ht.shareRights.rights];if(yt.length>0){const bt=yt.map(wt=>({displayName:wt,id:wt}));Et.push({actions:bt,avatarUrl:"",directoryUrl:"",displayName:lt.username,id:lt.userId,type:"user"})}if(st){const bt=await st.mutateAsync({resourceId:tt,rights:Et});vt(bt)}else{const bt=await odeServices.share().saveRights(at,tt,Et);vt(bt)}ot()}catch(yt){typeof yt=="string"&&ct.error(dt("explorer.shared.status.error")),typeof yt=="object"&&ct.error(dt((yt==null?void 0:yt.error)||"explorer.shared.status.error")),console.error("Failed to save share",yt)}finally{ft({type:"isSharing",payload:!1})}},toggleRight:xt}}const useShareBookmark=({shareRights:tt,shareDispatch:et})=>{const rt=useToast(),{t:st}=useTranslation(),nt=reactExports.useRef(null),[ot,at]=reactExports.useState({name:"",id:reactExports.useId()}),[lt,ut]=useToggle$1(!1),[ct,dt]=reactExports.useState(!1),ht=()=>{ut()},ft=()=>{at(vt=>{var yt;return{...vt,name:((yt=nt.current)==null?void 0:yt.value)||""}})},xt=async vt=>{try{const yt=await odeServices.directory().saveBookmarks(vt,{users:tt.rights.filter(Et=>Et.type==="user").map(Et=>Et.id),groups:tt.rights.filter(Et=>Et.type==="group").map(Et=>Et.id),bookmarks:tt.rights.filter(Et=>Et.type==="sharebookmark").map(Et=>Et.id)});rt.success(st("explorer.bookmarked.status.saved")),et({type:"updateShareRights",payload:{...tt,visibleBookmarks:[...tt.visibleBookmarks,{displayName:vt,id:yt.id}]}}),at(Et=>({...Et,bookmarkId:Et.id+new Date().getTime().toString()})),dt(!1)}catch(yt){console.error("Failed to save bookmark",yt),rt.error(st("explorer.bookmarked.status.error"))}};return{refBookmark:nt,showBookmark:lt,showBookmarkInput:ct,bookmark:ot,handleBookmarkChange:ft,setBookmark:at,handleOnSave:()=>{var vt;const yt=((vt=nt.current)==null?void 0:vt.value)||"";xt(yt)},toggleBookmark:ht,toggleBookmarkInput:dt}};function ShareResourceModal({isOpen:tt,shareOptions:et,shareResource:rt,children:st,onSuccess:nt,onCancel:ot}){const{resourceId:at,resourceCreatorId:lt,resourceRights:ut}=et,[ct,dt]=reactExports.useState(!0),{state:{isSharing:ht,shareRights:ft,shareRightActions:xt},dispatch:vt,myAvatar:yt,currentIsAuthor:Et,handleShare:bt,toggleRight:wt,handleDeleteRow:St}=useShare({resourceId:at,resourceCreatorId:lt,resourceRights:ut,shareResource:rt,setIsLoading:dt,onSuccess:nt}),{state:{searchResults:Rt,searchInputValue:Ct},showSearchAdmlHint:It,showSearchLoading:jt,showSearchNoResults:Pt,getSearchMinLength:Ot,handleSearchInputChange:Ut,handleSearchResultsChange:Nt}=useSearch({resourceId:at,resourceCreatorId:lt,shareRights:ft,shareDispatch:vt}),{refBookmark:Ht,showBookmark:Lt,handleBookmarkChange:kt,toggleBookmark:$t,bookmark:Ft,handleOnSave:Gt,showBookmarkInput:Mt,toggleBookmarkInput:Vt}=useShareBookmark({shareRights:ft,shareDispatch:vt}),{t:Bt}=useTranslation(),qt=It()?Bt("explorer.search.adml.hint"):Bt("explorer.modal.share.search.placeholder");return reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"share_modal",size:"lg",isOpen:tt,onModalClose:ot,children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:ot,children:Bt("share.title")}),jsxRuntimeExports.jsxs(Modal.Body,{children:[jsxRuntimeExports.jsx(Alert,{type:"info",className:"mb-16",children:Bt("explorer.modal.share.alert.community")}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:Bt("explorer.modal.share.usersWithAccess")}),jsxRuntimeExports.jsx("div",{className:"table-responsive",children:ct?jsxRuntimeExports.jsx(LoadingScreen,{}):jsxRuntimeExports.jsxs("table",{className:"table border align-middle mb-0",children:[jsxRuntimeExports.jsx("thead",{className:"bg-secondary",children:jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"col",className:"w-32",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("explorer.modal.share.avatar.shared.alt")})}),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("explorer.modal.share.search.placeholder")})}),xt.map(Qt=>jsxRuntimeExports.jsx("th",{scope:"col",className:"text-center text-white",children:Bt(Qt.displayName)},Qt.displayName)),jsxRuntimeExports.jsx("th",{scope:"col",children:jsxRuntimeExports.jsx(VisuallyHidden,{children:Bt("close")})})]})}),jsxRuntimeExports.jsxs("tbody",{children:[Et()&&jsxRuntimeExports.jsxs("tr",{children:[jsxRuntimeExports.jsx("th",{scope:"row",children:jsxRuntimeExports.jsx(Avatar,{alt:Bt("explorer.modal.share.avatar.me.alt"),size:"xs",src:yt,variant:"circle"})}),jsxRuntimeExports.jsx("td",{children:Bt("share.me")}),xt.map(Qt=>jsxRuntimeExports.jsx("td",{style:{width:"80px"},className:"text-center text-white",children:jsxRuntimeExports.jsx(Checkbox,{checked:!0,disabled:!0})},Qt.displayName)),jsxRuntimeExports.jsx("td",{})]}),jsxRuntimeExports.jsx(ShareBookmarkLine,{showBookmark:Lt,shareRightActions:xt,shareRights:ft,onDeleteRow:St,toggleRight:wt,toggleBookmark:$t})]})]})}),jsxRuntimeExports.jsxs("div",{className:"mt-16",children:[jsxRuntimeExports.jsx(Button,{color:"tertiary",leftIcon:jsxRuntimeExports.jsx(SvgIconBookmark,{}),rightIcon:jsxRuntimeExports.jsx(SvgIconRafterDown,{title:Bt("show"),className:"w-16 min-w-0",style:{transition:"rotate 0.2s ease-out",rotate:Mt?"-180deg":"0deg"}}),type:"button",variant:"ghost",className:"fw-normal",onClick:()=>Vt(!Mt),children:Bt("share.save.sharebookmark")}),Mt&&jsxRuntimeExports.jsx(ShareBookmark,{refBookmark:Ht,bookmark:Ft,onBookmarkChange:kt,onSave:Gt})]}),jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsxs(Heading,{headingStyle:"h4",level:"h3",className:"mb-16 d-flex align-items-center",children:[jsxRuntimeExports.jsx("div",{className:"me-8",children:Bt("explorer.modal.share.search")}),jsxRuntimeExports.jsx(Tooltip,{message:"Vos favoris de partage s’affichent en priorité dans votre liste lorsque vous recherchez un groupe ou une personne, vous pouvez les retrouver dans l’annuaire.",placement:"top",children:jsxRuntimeExports.jsx(SvgIconInfoCircle,{className:"c-pointer",height:"18"})})]}),jsxRuntimeExports.jsx("div",{className:"row",children:jsxRuntimeExports.jsx("div",{className:"col-10",children:jsxRuntimeExports.jsx(Combobox,{value:Ct,placeholder:qt,isLoading:jt(),noResult:Pt(),options:Rt,searchMinLength:Ot(),onSearchInputChange:Ut,onSearchResultsChange:Nt})})}),st]}),jsxRuntimeExports.jsxs(Modal.Footer,{children:[jsxRuntimeExports.jsx(Button,{type:"button",color:"tertiary",variant:"ghost",onClick:ot,children:Bt("explorer.cancel")}),jsxRuntimeExports.jsx(Button,{type:"button",color:"primary",variant:"filled",isLoading:ht,onClick:bt,disabled:ht,children:Bt("share")})]})]}),document.getElementById("portal"))}function ShareBlog({resourceId:tt,updateResource:et}){const{appCode:rt}=useEdificeClient(),{t:st}=useTranslation(rt),nt=useResource("blog",tt),ot=nt&&nt["publish-type"],[at,lt]=reactExports.useState(ot??"RESTRAINT");reactExports.useEffect(()=>{ot&<(ot)},[ot]);const ut=async ct=>{const dt=ct.target.value,ht={description:nt.description||"",entId:nt.assetId,name:nt.name,public:!!nt.public,slug:nt.slug||"",thumbnail:nt.thumbnail,trashed:nt.trashed,"publish-type":dt};et?await et.mutateAsync(ht):await odeServices.resource("blog").update(ht),lt(dt)};return jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("hr",{}),jsxRuntimeExports.jsx(Heading,{headingStyle:"h4",level:"h3",className:"mb-16",children:st("explorer.publication.steps")}),jsxRuntimeExports.jsx(Radio,{label:st("explorer.immediat.publication"),id:"publication-now",name:"publication",value:"IMMEDIATE",model:at,checked:at==="IMMEDIATE",onChange:ut}),jsxRuntimeExports.jsx(Radio,{label:st("explorer.validate.publication"),id:"publication-validate",name:"publication",value:"RESTRAINT",checked:at==="RESTRAINT",model:at,onChange:ut})]})}const useShareMutation=({application:tt,options:et})=>useMutation({mutationFn:async({resourceId:rt,rights:st})=>await odeServices.share().saveRights(tt,rt,st),...et}),SvgIconCommunity=({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",d:"M19.935 17.51q1.088 0 1.868.792.78.794.78 1.898 0 1.106-.78 1.898-.78.793-1.844.793t-1.869-.793a2.52 2.52 0 0 1-.78-1.922q0-.432.19-.936l-3.997-2.931q-1.16 1.2-2.79 1.2-1.633 0-2.791-1.176-1.16-1.177-1.183-2.86 0-.215.071-.624l-3.168-1.057a1.25 1.25 0 0 1-.852.337q-.567 0-.946-.385a1.32 1.32 0 0 1-.378-.96q0-.578.378-.938.38-.36.946-.384.474 0 .804.312.33.313.45.745l3.192 1.08a3.8 3.8 0 0 1 1.443-1.56 3.84 3.84 0 0 1 2.033-.577q1.23 0 2.27.745l4.706-4.781q-.378-.72-.378-1.321 0-1.106.78-1.898.78-.793 1.869-.793t1.844.793q.758.792.78 1.898a2.42 2.42 0 0 1-.78 1.873q-.804.77-1.868.793-.616 0-1.3-.408l-4.707 4.805q.734 1.056.733 2.306 0 .888-.402 1.753l3.997 2.907q.78-.624 1.679-.624"})]}),SvgIconDisconnect=({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",d:"M22.996 13.153q0 2.09-.873 3.987a10.6 10.6 0 0 1-2.336 3.292q-1.462 1.393-3.516 2.21t-4.26.817-4.287-.817-3.49-2.21a12.3 12.3 0 0 1-2.362-3.291A8.1 8.1 0 0 1 1 13.153q0-2.451 1.155-4.589t3.234-3.627q.616-.433 1.386-.337t1.181.673q.462.553.36 1.273-.104.72-.72 1.13a7 7 0 0 0-2.155 2.426 6.38 6.38 0 0 0-.18 5.717 7 7 0 0 0 1.566 2.186q.975.913 2.335 1.466a7.5 7.5 0 0 0 2.85.552 7.3 7.3 0 0 0 2.823-.552 8.3 8.3 0 0 0 2.36-1.466 6.04 6.04 0 0 0 1.567-2.186q.538-1.274.564-2.666 0-1.635-.77-3.051T16.4 7.675a1.75 1.75 0 0 1-.719-1.129q-.128-.697.36-1.273.436-.577 1.206-.673t1.36.337q2.079 1.466 3.234 3.627a9.6 9.6 0 0 1 1.155 4.589M13.833 2.846v8.6q0 .698-.54 1.202-.538.505-1.283.505t-1.309-.505q-.564-.505-.539-1.201v-8.6q0-.697.54-1.202.538-.504 1.308-.504t1.284.504.539 1.201"})]}),SvgIconHome=({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",d:"M20.584 13.536v7.458q0 .42-.294.699a1.06 1.06 0 0 1-.667.307H13.91v-5.978h-3.817V22H4.383a.85.85 0 0 1-.668-.307 1.16 1.16 0 0 1-.293-.699v-7.569l8.567-7.375 8.568 7.375q.027.027.027.111m3.31-1.09-.908 1.146a.54.54 0 0 1-.32.168h-.054a.6.6 0 0 1-.32-.084L11.989 4.682 1.687 13.676a.5.5 0 0 1-.347.084.54.54 0 0 1-.32-.168l-.935-1.145a.52.52 0 0 1-.08-.363.6.6 0 0 1 .16-.335l10.703-9.33q.48-.42 1.121-.419.64 0 1.148.419l3.63 3.156V2.56q0-.224.133-.363a.46.46 0 0 1 .347-.14h2.856q.214 0 .347.14a.5.5 0 0 1 .134.363v6.34l3.256 2.85q.16.111.16.335 0 .223-.107.363"})]}),SvgIconMyApps=({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",d:"M1.898 22.555c-.072-.145-.096-1.37-.048-2.691l.048-2.402h5.261v5.26l-2.595.049c-1.994.048-2.594 0-2.666-.216m7.76 0c-.049-.145-.073-1.37-.049-2.691l.072-2.402h5.238v5.26l-2.571.049c-2.018.048-2.595 0-2.69-.216m7.759 0c-.048-.145-.072-1.37-.048-2.691l.072-2.402h5.237v5.26l-2.57.049c-1.994.048-2.595 0-2.691-.216m-15.52-7.76c-.071-.168-.095-1.37-.047-2.69l.048-2.403h5.261v5.261l-2.595.048c-1.994.048-2.594 0-2.666-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.238v5.261l-2.571.048c-2.018.048-2.595 0-2.69-.216m7.76 0c-.048-.168-.072-1.37-.048-2.69l.072-2.403h5.237v5.261l-2.57.048c-1.994.048-2.595 0-2.691-.216M1.897 7.011c-.071-.144-.095-1.345-.047-2.666l.048-2.402h5.261V7.18l-2.595.072c-1.994.048-2.594 0-2.666-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.238V7.18l-2.571.072c-2.018.048-2.595 0-2.69-.24m7.76 0c-.048-.144-.072-1.345-.048-2.666l.072-2.402h5.237V7.18l-2.57.072c-1.994.048-2.595 0-2.691-.24"})]}),SvgIconNeoAssistance=({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:"M12 24c6.627 0 12-5.373 12-12S18.627 0 12 0 0 5.373 0 12s5.373 12 12 12M7.123 7.667C8.276 5.958 9.745 5 12.013 5 14.425 5 17 6.941 17 9.5c0 2.113-1.377 2.932-2.418 3.552-.633.376-1.142.68-1.142 1.154v.169a.693.693 0 0 1-.682.703h-2.06a.693.693 0 0 1-.681-.703v-.287c0-1.768 1.269-2.5 2.266-3.075l.073-.042c.863-.499 1.392-.838 1.392-1.499 0-.874-1.082-1.454-1.956-1.454-1.112 0-1.64.53-2.351 1.449a.67.67 0 0 1-.945.121L7.27 8.63a.72.72 0 0 1-.147-.963M9.76 17.97c0-1.12.883-2.03 1.969-2.03 1.085 0 1.968.91 1.968 2.03S12.814 20 11.73 20c-1.086 0-1.969-.91-1.969-2.03",clipRule:"evenodd"})]}),SvgIconNeoMessaging=({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",d:"m.5 21.257 7.46-8.216 4.052 2.403 4.052-2.403 7.46 8.216zm0-2.738V8.573l5.848 3.531zm0-12.084V3.048h23.024v3.387l-11.512 6.847zm17.176 5.67 5.848-3.532v9.946z"})]}),SvgIconNewRelease=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M13.07 13.07V6.54h-2.14v6.53zm0 4.4v-2.2h-2.14v2.2zM24 12l-2.65 3.01.35 4.04-3.93.86-2.04 3.48L12 21.8l-3.73 1.6-2.04-3.42-3.93-.92.35-4.04L0 12l2.65-3.06-.35-3.99 3.93-.86L8.27.6 12 2.2 15.73.6l2.04 3.48 3.93.86L21.34 9z"})]}),SvgIconOneAssistance=({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",d:"M11.685 2C8.66 2 6.7 3.277 5.164 5.556A.96.96 0 0 0 5.36 6.84l1.634 1.278a.89.89 0 0 0 1.26-.162c.95-1.226 1.653-1.932 3.136-1.932 1.165 0 2.607.773 2.607 1.939 0 .88-.705 1.333-1.856 1.998-1.342.776-3.118 1.742-3.118 4.157v.382c0 .518.407.938.909.938h2.746c.502 0 .91-.42.91-.938v-.226c0-1.674 4.745-1.743 4.745-6.274 0-3.412-3.432-6-6.648-6m-.38 14.588c-1.447 0-2.625 1.214-2.625 2.706S9.858 22 11.305 22s2.624-1.214 2.624-2.706-1.177-2.706-2.624-2.706"})]}),SvgIconOneMessaging=({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:"M5.051 12.366a456 456 0 0 1-2.746-1.822A6.5 6.5 0 0 1 .74 9.067q-.737-.94-.737-1.745a2.7 2.7 0 0 1 .141-.905c.098-.286.242-.542.424-.752Q1.12 5 2.15 5h19.7c.541-.016 1.071.195 1.507.6q.636.6.636 1.446 0 1.01-.657 1.93a6.2 6.2 0 0 1-1.632 1.567q-5.037 3.338-6.267 4.156l-.242.167-.323.222q-.436.303-.724.487-.288.183-.696.415a4 4 0 0 1-.77.345 2.2 2.2 0 0 1-.67.115h-.026a2.2 2.2 0 0 1-.67-.116 4 4 0 0 1-.77-.344q-.41-.23-.697-.415a30 30 0 0 1-.723-.487q-.433-.3-.565-.389-1.215-.817-3.51-2.334m10.943 3.962q2.276-1.578 6.667-4.416c.478-.306.927-.68 1.339-1.113v10.16q0 .845-.63 1.446c-.437.405-.97.614-1.512.594H2.149c-.545.02-1.08-.192-1.52-.601C.21 21.996 0 21.52 0 20.95V10.8c.416.437.871.81 1.356 1.113q4.848 3.148 6.656 4.416.768.537 1.243.837a7.7 7.7 0 0 0 1.265.614c.475.198.97.303 1.47.313h.026c.5-.01.995-.115 1.47-.313a7.7 7.7 0 0 0 1.265-.614q.48-.3 1.243-.837",clipRule:"evenodd"})]}),SvgIconUserbook=({title:tt,titleId:et,...rt})=>jsxRuntimeExports.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",width:"24",height:"24","aria-hidden":"true","aria-labelledby":et,...rt,children:[tt?jsxRuntimeExports.jsx("title",{id:et,children:tt}):null,jsxRuntimeExports.jsx("path",{fill:"currentColor",d:"M0 24.58V.53h24.05v4.28h-2.62V7.1h2.62v4.28h-2.62v2.35h2.62V18h-2.62v2.3h2.62v4.29H0zm4.64-6.85h12.12V14l-4.5-2.67q.9-.46 1.4-1.3t.53-1.85q0-1.4-1.01-2.43T10.7 4.72 8.25 5.75 7.24 8.18q0 1.03.53 1.85t1.4 1.3L4.63 14v3.73z"})]});function useHeader({user:tt,avatar:et}){const{appCode:rt}=useEdificeClient(),{t:st}=useTranslation(),nt=st(rt),[ot,at]=reactExports.useState(!0),[lt,ut]=useHover$1(),ct=reactExports.useId(),dt=reactExports.useId(),ht=et,ft=tt==null?void 0:tt.username,xt=st("welcome",{username:tt==null?void 0:tt.firstName}),vt=useBookmark(),yt=useHasWorkflow("net.atos.entng.community.controllers.CommunityController|view"),Et=useHasWorkflow("org.entcore.conversation.controllers.ConversationController|view"),bt=useHasWorkflow("fr.openent.searchengine.controllers.SearchEngineController|view"),wt=reactExports.useCallback(()=>{at(!ot)},[ot]);return reactExports.useMemo(()=>({title:nt,bookmarkedApps:vt,appsRef:lt,isAppsHovered:ut,popoverAppsId:ct,popoverSearchId:dt,userAvatar:ht,userName:ft,welcomeUser:xt,communityWorkflow:yt,conversationWorflow:Et,searchWorkflow:bt,isCollapsed:ot,toggleCollapsedNav:wt}),[lt,vt,yt,Et,ut,ot,ct,dt,bt,nt,wt,ht,ft,xt])}function Help({isHelpOpen:tt,setIsHelpOpen:et,parsedHeadline:rt,parsedContent:st,error:nt}){const{t:ot}=useTranslation(),at=()=>{et(!1)};return tt?reactDomExports.createPortal(jsxRuntimeExports.jsxs(Modal,{id:"help-modal",isOpen:tt,onModalClose:at,scrollable:!0,size:"lg",children:[jsxRuntimeExports.jsx(Modal.Header,{onModalClose:at,children:ot("navbar.help")}),jsxRuntimeExports.jsx(Modal.Subtitle,{children:nt?ot("help.notfound.title"):rt}),jsxRuntimeExports.jsx(Modal.Body,{className:nt?"d-flex":null,children:nt?ot("help.notfound.text"):st})]}),document.getElementById("portal")):null}function Navbar({children:tt,className:et,...rt}){const st=clsx("navbar",et);return jsxRuntimeExports.jsx("nav",{className:st,...rt,children:tt})}function NavBarNav({children:tt,className:et,...rt}){const st=clsx("navbar-nav",et);return jsxRuntimeExports.jsx("ul",{className:st,...rt,children:tt})}const NavItem=reactExports.forwardRef(({children:tt,className:et,...rt},st)=>{const nt=clsx("nav-item",et);return jsxRuntimeExports.jsx("li",{ref:st,className:nt,...rt,children:tt})});function NavLink({link:tt,className:et,children:rt,translate:st,...nt}){const ot=clsx("nav-link",et);return jsxRuntimeExports.jsxs("a",{href:tt,className:ot,...nt,children:[rt,st&&jsxRuntimeExports.jsx(VisuallyHidden,{children:jsxRuntimeExports.jsx("span",{className:"nav-text",children:st})})]})}const SvgIconSearch=({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",d:"M1.27 11.552a7.75 7.75 0 0 1 0-4.156Q1.84 5.33 3.42 3.792a7.9 7.9 0 0 1 2.716-1.777q1.53-.6 3.161-.6 1.605 0 3.136.6 1.53.6 2.716 1.777a7.9 7.9 0 0 1 1.902 2.86 7.8 7.8 0 0 1 .518 3.29 7.65 7.65 0 0 1-.889 3.171q.692.192 1.21.697l4.297 4.156q.864.84.864 2.042t-.864 2.042-2.099.841-2.099-.84l-4.272-4.18a2.42 2.42 0 0 1-.74-1.178 8.3 8.3 0 0 1-3.68.84q-1.63 0-3.16-.6a8.1 8.1 0 0 1-2.717-1.753 7.85 7.85 0 0 1-2.149-3.628m2.495-2.066q0 2.235 1.605 3.796 1.63 1.56 3.926 1.561 2.272 0 3.877-1.561 1.605-1.562 1.63-3.796t-1.63-3.796q-1.63-1.585-3.877-1.585-2.272 0-3.926 1.585-1.605 1.561-1.605 3.796"})]}),PopoverBody=({children:tt,className:et})=>{const rt=clsx("popover-body",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},PopoverFooter=({children:tt,className:et})=>{const rt=clsx("popover-footer p-8",et);return jsxRuntimeExports.jsx("div",{className:rt,children:tt})},Popover=reactExports.forwardRef(({children:tt,className:et,id:rt,isVisible:st,...nt},ot)=>{const at=clsx("popover d-block position-absolute top-100 start-50 translate-middle-x",et);return useTransition(st,{from:{opacity:0},enter:{opacity:1},leave:{opacity:0},config:{duration:0}})((lt,ut)=>ut&&jsxRuntimeExports.jsx(animated.div,{ref:ot,"aria-labelledby":rt,className:at,role:"tooltip",style:lt,...nt,children:tt}))}),SearchEngine=()=>{const[tt,et]=useHover(),rt=reactExports.useRef(null),st=reactExports.useId(),{t:nt}=useTranslation();function ot(){if(rt.current){const at=rt.current.value;window.location.href=`/searchengine#/${at}`}}return jsxRuntimeExports.jsxs(NavItem,{id:st,ref:tt,className:"position-relative","aria-haspopup":"true","aria-expanded":et,children:[jsxRuntimeExports.jsxs("a",{href:"/searchengine",className:"nav-link dropdown-item",children:[jsxRuntimeExports.jsx(SvgIconSearch,{className:"icon search"}),jsxRuntimeExports.jsx("span",{className:"nav-text",children:nt("navbar.search")})]}),jsxRuntimeExports.jsx(Popover,{id:st,isVisible:et,className:"d-none d-md-flex",children:jsxRuntimeExports.jsxs(FormControl,{id:"my-search-input",className:"search-text input-group py-8 px-12",children:[jsxRuntimeExports.jsx(FormControl.Input,{ref:rt,size:"sm",type:"text",name:"my-search-input",placeholder:"Rechercher"}),jsxRuntimeExports.jsx(SearchButton,{type:"submit",size:"sm",onClick:ot,"aria-label":nt("navbar.search")})]})})]})},WidgetAppsFooter=()=>{const{t:tt}=useTranslation();return jsxRuntimeExports.jsx("div",{className:"widget-footer",children:jsxRuntimeExports.jsx("div",{className:"widget-footer-action",children:jsxRuntimeExports.jsx("a",{href:"/welcome",className:"link",children:tt("plus")})})})},WidgetAppsBody=({bookmarkedApps:tt})=>{const{t:et}=useTranslation();return jsxRuntimeExports.jsxs("div",{className:"widget-body d-flex flex-wrap",children:[!tt.length&&jsxRuntimeExports.jsx("div",{className:"text-dark",children:et("navbar.myapps.more")}),tt.slice(0,6).map((rt,st)=>jsxRuntimeExports.jsx("a",{href:rt.address,className:"bookmarked-app",target:rt.isExternal||rt.category==="connector"?"_blank":void 0,children:jsxRuntimeExports.jsx(AppIcon,{app:rt,size:"32"})},st))]})};var lib$2={},lib$1={};(function(tt){Object.defineProperty(tt,"__esModule",{value:!0}),tt.Doctype=tt.CDATA=tt.Tag=tt.Style=tt.Script=tt.Comment=tt.Directive=tt.Text=tt.Root=tt.isTag=tt.ElementType=void 0;var et;(function(st){st.Root="root",st.Text="text",st.Directive="directive",st.Comment="comment",st.Script="script",st.Style="style",st.Tag="tag",st.CDATA="cdata",st.Doctype="doctype"})(et=tt.ElementType||(tt.ElementType={}));function rt(st){return st.type===et.Tag||st.type===et.Script||st.type===et.Style}tt.isTag=rt,tt.Root=et.Root,tt.Text=et.Text,tt.Directive=et.Directive,tt.Comment=et.Comment,tt.Script=et.Script,tt.Style=et.Style,tt.Tag=et.Tag,tt.CDATA=et.CDATA,tt.Doctype=et.Doctype})(lib$1);var node={},__extends=commonjsGlobal&&commonjsGlobal.__extends||function(){var tt=function(et,rt){return tt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(st,nt){st.__proto__=nt}||function(st,nt){for(var ot in nt)Object.prototype.hasOwnProperty.call(nt,ot)&&(st[ot]=nt[ot])},tt(et,rt)};return function(et,rt){if(typeof rt!="function"&&rt!==null)throw new TypeError("Class extends value "+String(rt)+" is not a constructor or null");tt(et,rt);function st(){this.constructor=et}et.prototype=rt===null?Object.create(rt):(st.prototype=rt.prototype,new st)}}(),__assign=commonjsGlobal&&commonjsGlobal.__assign||function(){return __assign=Object.assign||function(tt){for(var et,rt=1,st=arguments.length;rt<st;rt++){et=arguments[rt];for(var nt in et)Object.prototype.hasOwnProperty.call(et,nt)&&(tt[nt]=et[nt])}return tt},__assign.apply(this,arguments)};Object.defineProperty(node,"__esModule",{value:!0});node.cloneNode=node.hasChildren=node.isDocument=node.isDirective=node.isComment=node.isText=node.isCDATA=node.isTag=node.Element=node.Document=node.CDATA=node.NodeWithChildren=node.ProcessingInstruction=node.Comment=node.Text=node.DataNode=node.Node=void 0;var domelementtype_1=lib$1,Node$1=function(){function tt(){this.parent=null,this.prev=null,this.next=null,this.startIndex=null,this.endIndex=null}return Object.defineProperty(tt.prototype,"parentNode",{get:function(){return this.parent},set:function(et){this.parent=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"previousSibling",{get:function(){return this.prev},set:function(et){this.prev=et},enumerable:!1,configurable:!0}),Object.defineProperty(tt.prototype,"nextSibling",{get:function(){return this.next},set:function(et){this.next=et},enumerable:!1,configurable:!0}),tt.prototype.cloneNode=function(et){return et===void 0&&(et=!1),cloneNode(this,et)},tt}();node.Node=Node$1;var DataNode=function(tt){__extends(et,tt);function et(rt){var st=tt.call(this)||this;return st.data=rt,st}return Object.defineProperty(et.prototype,"nodeValue",{get:function(){return this.data},set:function(rt){this.data=rt},enumerable:!1,configurable:!0}),et}(Node$1);node.DataNode=DataNode;var Text$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Text,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 3},enumerable:!1,configurable:!0}),et}(DataNode);node.Text=Text$1;var Comment$1=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Comment,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 8},enumerable:!1,configurable:!0}),et}(DataNode);node.Comment=Comment$1;var ProcessingInstruction$1=function(tt){__extends(et,tt);function et(rt,st){var nt=tt.call(this,st)||this;return nt.name=rt,nt.type=domelementtype_1.ElementType.Directive,nt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),et}(DataNode);node.ProcessingInstruction=ProcessingInstruction$1;var NodeWithChildren=function(tt){__extends(et,tt);function et(rt){var st=tt.call(this)||this;return st.children=rt,st}return Object.defineProperty(et.prototype,"firstChild",{get:function(){var rt;return(rt=this.children[0])!==null&&rt!==void 0?rt:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"lastChild",{get:function(){return this.children.length>0?this.children[this.children.length-1]:null},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"childNodes",{get:function(){return this.children},set:function(rt){this.children=rt},enumerable:!1,configurable:!0}),et}(Node$1);node.NodeWithChildren=NodeWithChildren;var CDATA=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.CDATA,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 4},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.CDATA=CDATA;var Document=function(tt){__extends(et,tt);function et(){var rt=tt!==null&&tt.apply(this,arguments)||this;return rt.type=domelementtype_1.ElementType.Root,rt}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 9},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Document=Document;var Element$2=function(tt){__extends(et,tt);function et(rt,st,nt,ot){nt===void 0&&(nt=[]),ot===void 0&&(ot=rt==="script"?domelementtype_1.ElementType.Script:rt==="style"?domelementtype_1.ElementType.Style:domelementtype_1.ElementType.Tag);var at=tt.call(this,nt)||this;return at.name=rt,at.attribs=st,at.type=ot,at}return Object.defineProperty(et.prototype,"nodeType",{get:function(){return 1},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"tagName",{get:function(){return this.name},set:function(rt){this.name=rt},enumerable:!1,configurable:!0}),Object.defineProperty(et.prototype,"attributes",{get:function(){var rt=this;return Object.keys(this.attribs).map(function(st){var nt,ot;return{name:st,value:rt.attribs[st],namespace:(nt=rt["x-attribsNamespace"])===null||nt===void 0?void 0:nt[st],prefix:(ot=rt["x-attribsPrefix"])===null||ot===void 0?void 0:ot[st]}})},enumerable:!1,configurable:!0}),et}(NodeWithChildren);node.Element=Element$2;function isTag(tt){return(0,domelementtype_1.isTag)(tt)}node.isTag=isTag;function isCDATA(tt){return tt.type===domelementtype_1.ElementType.CDATA}node.isCDATA=isCDATA;function isText(tt){return tt.type===domelementtype_1.ElementType.Text}node.isText=isText;function isComment(tt){return tt.type===domelementtype_1.ElementType.Comment}node.isComment=isComment;function isDirective(tt){return tt.type===domelementtype_1.ElementType.Directive}node.isDirective=isDirective;function isDocument(tt){return tt.type===domelementtype_1.ElementType.Root}node.isDocument=isDocument;function hasChildren(tt){return Object.prototype.hasOwnProperty.call(tt,"children")}node.hasChildren=hasChildren;function cloneNode(tt,et){et===void 0&&(et=!1);var rt;if(isText(tt))rt=new Text$1(tt.data);else if(isComment(tt))rt=new Comment$1(tt.data);else if(isTag(tt)){var st=et?cloneChildren(tt.children):[],nt=new Element$2(tt.name,__assign({},tt.attribs),st);st.forEach(function(ut){return ut.parent=nt}),tt.namespace!=null&&(nt.namespace=tt.namespace),tt["x-attribsNamespace"]&&(nt["x-attribsNamespace"]=__assign({},tt["x-attribsNamespace"])),tt["x-attribsPrefix"]&&(nt["x-attribsPrefix"]=__assign({},tt["x-attribsPrefix"])),rt=nt}else if(isCDATA(tt)){var st=et?cloneChildren(tt.children):[],ot=new CDATA(st);st.forEach(function(ct){return ct.parent=ot}),rt=ot}else if(isDocument(tt)){var st=et?cloneChildren(tt.children):[],at=new Document(st);st.forEach(function(ct){return ct.parent=at}),tt["x-mode"]&&(at["x-mode"]=tt["x-mode"]),rt=at}else if(isDirective(tt)){var lt=new ProcessingInstruction$1(tt.name,tt.data);tt["x-name"]!=null&&(lt["x-name"]=tt["x-name"],lt["x-publicId"]=tt["x-publicId"],lt["x-systemId"]=tt["x-systemId"]),rt=lt}else throw new Error("Not implemented yet: ".concat(tt.type));return rt.startIndex=tt.startIndex,rt.endIndex=tt.endIndex,tt.sourceCodeLocation!=null&&(rt.sourceCodeLocation=tt.sourceCodeLocation),rt}node.cloneNode=cloneNode;function cloneChildren(tt){for(var et=tt.map(function(st){return cloneNode(st,!0)}),rt=1;rt<et.length;rt++)et[rt].prev=et[rt-1],et[rt-1].next=et[rt];return et}(function(tt){var et=commonjsGlobal&&commonjsGlobal.__createBinding||(Object.create?function(lt,ut,ct,dt){dt===void 0&&(dt=ct);var ht=Object.getOwnPropertyDescriptor(ut,ct);(!ht||("get"in ht?!ut.__esModule:ht.writable||ht.configurable))&&(ht={enumerable:!0,get:function(){return ut[ct]}}),Object.defineProperty(lt,dt,ht)}:function(lt,ut,ct,dt){dt===void 0&&(dt=ct),lt[dt]=ut[ct]}),rt=commonjsGlobal&&commonjsGlobal.__exportStar||function(lt,ut){for(var ct in lt)ct!=="default"&&!Object.prototype.hasOwnProperty.call(ut,ct)&&et(ut,lt,ct)};Object.defineProperty(tt,"__esModule",{value:!0}),tt.DomHandler=void 0;var st=lib$1,nt=node;rt(node,tt);var ot={withStartIndices:!1,withEndIndices:!1,xmlMode:!1},at=function(){function lt(ut,ct,dt){this.dom=[],this.root=new nt.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null,typeof ct=="function"&&(dt=ct,ct=ot),typeof ut=="object"&&(ct=ut,ut=void 0),this.callback=ut??null,this.options=ct??ot,this.elementCB=dt??null}return lt.prototype.onparserinit=function(ut){this.parser=ut},lt.prototype.onreset=function(){this.dom=[],this.root=new nt.Document(this.dom),this.done=!1,this.tagStack=[this.root],this.lastNode=null,this.parser=null},lt.prototype.onend=function(){this.done||(this.done=!0,this.parser=null,this.handleCallback(null))},lt.prototype.onerror=function(ut){this.handleCallback(ut)},lt.prototype.onclosetag=function(){this.lastNode=null;var ut=this.tagStack.pop();this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),this.elementCB&&this.elementCB(ut)},lt.prototype.onopentag=function(ut,ct){var dt=this.options.xmlMode?st.ElementType.Tag:void 0,ht=new nt.Element(ut,ct,void 0,dt);this.addNode(ht),this.tagStack.push(ht)},lt.prototype.ontext=function(ut){var ct=this.lastNode;if(ct&&ct.type===st.ElementType.Text)ct.data+=ut,this.options.withEndIndices&&(ct.endIndex=this.parser.endIndex);else{var dt=new nt.Text(ut);this.addNode(dt),this.lastNode=dt}},lt.prototype.oncomment=function(ut){if(this.lastNode&&this.lastNode.type===st.ElementType.Comment){this.lastNode.data+=ut;return}var ct=new nt.Comment(ut);this.addNode(ct),this.lastNode=ct},lt.prototype.oncommentend=function(){this.lastNode=null},lt.prototype.oncdatastart=function(){var ut=new nt.Text(""),ct=new nt.CDATA([ut]);this.addNode(ct),ut.parent=ct,this.lastNode=ut},lt.prototype.oncdataend=function(){this.lastNode=null},lt.prototype.onprocessinginstruction=function(ut,ct){var dt=new nt.ProcessingInstruction(ut,ct);this.addNode(dt)},lt.prototype.handleCallback=function(ut){if(typeof this.callback=="function")this.callback(ut,this.dom);else if(ut)throw ut},lt.prototype.addNode=function(ut){var ct=this.tagStack[this.tagStack.length-1],dt=ct.children[ct.children.length-1];this.options.withStartIndices&&(ut.startIndex=this.parser.startIndex),this.options.withEndIndices&&(ut.endIndex=this.parser.endIndex),ct.children.push(ut),dt&&(ut.prev=dt,dt.next=ut),ut.parent=ct,this.lastNode=null},lt}();tt.DomHandler=at,tt.default=at})(lib$2);var HTML="html",HEAD="head",BODY="body",FIRST_TAG_REGEX=/<([a-zA-Z]+[0-9]?)/,HEAD_TAG_REGEX=/<head[^]*>/i,BODY_TAG_REGEX=/<body[^]*>/i,parseFromDocument=function(){throw new Error("This browser does not support `document.implementation.createHTMLDocument`")},parseFromString=function(){throw new Error("This browser does not support `DOMParser.prototype.parseFromString`")},DOMParser$1=typeof window=="object"&&window.DOMParser;if(typeof DOMParser$1=="function"){var domParser=new DOMParser$1,mimeType="text/html";parseFromString=function(tt,et){return et&&(tt="<"+et+">"+tt+"</"+et+">"),domParser.parseFromString(tt,mimeType)},parseFromDocument=parseFromString}if(typeof document=="object"&&document.implementation){var doc=document.implementation.createHTMLDocument();parseFromDocument=function(tt,et){if(et){var rt=doc.documentElement.querySelector(et);return rt.innerHTML=tt,doc}return doc.documentElement.innerHTML=tt,doc}}var template=typeof document=="object"?document.createElement("template"):{},parseFromTemplate;template.content&&(parseFromTemplate=function(tt){return template.innerHTML=tt,template.content.childNodes});function domparser$1(tt){var et,rt=tt.match(FIRST_TAG_REGEX);rt&&rt[1]&&(et=rt[1].toLowerCase());var st,nt,ot;switch(et){case HTML:return st=parseFromString(tt),HEAD_TAG_REGEX.test(tt)||(nt=st.querySelector(HEAD),nt&&nt.parentNode.removeChild(nt)),BODY_TAG_REGEX.test(tt)||(nt=st.querySelector(BODY),nt&&nt.parentNode.removeChild(nt)),st.querySelectorAll(HTML);case HEAD:case BODY:return st=parseFromDocument(tt),ot=st.querySelectorAll(et),BODY_TAG_REGEX.test(tt)&&HEAD_TAG_REGEX.test(tt)?ot[0].parentNode.childNodes:ot;default:return parseFromTemplate?parseFromTemplate(tt):(nt=parseFromDocument(tt,BODY).querySelector(BODY),nt.childNodes)}}var domparser_1=domparser$1,utilities$5={},constants$1={};constants$1.CASE_SENSITIVE_TAG_NAMES=["animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","linearGradient","radialGradient","textPath"];var domhandler$1=lib$2,constants=constants$1,CASE_SENSITIVE_TAG_NAMES=constants.CASE_SENSITIVE_TAG_NAMES,Comment=domhandler$1.Comment,Element$1=domhandler$1.Element,ProcessingInstruction=domhandler$1.ProcessingInstruction,Text=domhandler$1.Text,caseSensitiveTagNamesMap={},tagName;for(var i=0,len=CASE_SENSITIVE_TAG_NAMES.length;i<len;i++)tagName=CASE_SENSITIVE_TAG_NAMES[i],caseSensitiveTagNamesMap[tagName.toLowerCase()]=tagName;function getCaseSensitiveTagName(tt){return caseSensitiveTagNamesMap[tt]}function formatAttributes(tt){for(var et={},rt,st=0,nt=tt.length;st<nt;st++)rt=tt[st],et[rt.name]=rt.value;return et}function formatTagName(tt){tt=tt.toLowerCase();var et=getCaseSensitiveTagName(tt);return et||tt}function formatDOM$1(tt,et,rt){et=et||null;for(var st=[],nt,ot=0,at=tt.length;ot<at;ot++){var lt=tt[ot],ut;switch(lt.nodeType){case 1:nt=formatTagName(lt.nodeName),ut=new Element$1(nt,formatAttributes(lt.attributes)),ut.children=formatDOM$1(nt==="template"?lt.content.childNodes:lt.childNodes,ut);break;case 3:ut=new Text(lt.nodeValue);break;case 8:ut=new Comment(lt.nodeValue);break;default:continue}var ct=st[ot-1]||null;ct&&(ct.next=ut),ut.parent=et,ut.prev=ct,ut.next=null,st.push(ut)}return rt&&(ut=new ProcessingInstruction(rt.substring(0,rt.indexOf(" ")).toLowerCase(),rt),ut.next=st[0]||null,ut.parent=et,st.unshift(ut),st[1]&&(st[1].prev=st[0])),st}utilities$5.formatAttributes=formatAttributes;utilities$5.formatDOM=formatDOM$1;var domparser=domparser_1,utilities$4=utilities$5,formatDOM=utilities$4.formatDOM,DIRECTIVE_REGEX=/<(![a-zA-Z\s]+)>/;function HTMLDOMParser(tt){if(typeof tt!="string")throw new TypeError("First argument must be a string");if(tt==="")return[];var et=tt.match(DIRECTIVE_REGEX),rt;return et&&et[1]&&(rt=et[1]),formatDOM(domparser(tt),null,rt)}var htmlToDom=HTMLDOMParser,lib={},possibleStandardNamesOptimized$1={},SAME$1=0;possibleStandardNamesOptimized$1.SAME=SAME$1;var CAMELCASE$1=1;possibleStandardNamesOptimized$1.CAMELCASE=CAMELCASE$1;possibleStandardNamesOptimized$1.possibleStandardNames={accept:0,acceptCharset:1,"accept-charset":"acceptCharset",accessKey:1,action:0,allowFullScreen:1,alt:0,as:0,async:0,autoCapitalize:1,autoComplete:1,autoCorrect:1,autoFocus:1,autoPlay:1,autoSave:1,capture:0,cellPadding:1,cellSpacing:1,challenge:0,charSet:1,checked:0,children:0,cite:0,class:"className",classID:1,className:1,cols:0,colSpan:1,content:0,contentEditable:1,contextMenu:1,controls:0,controlsList:1,coords:0,crossOrigin:1,dangerouslySetInnerHTML:1,data:0,dateTime:1,default:0,defaultChecked:1,defaultValue:1,defer:0,dir:0,disabled:0,disablePictureInPicture:1,disableRemotePlayback:1,download:0,draggable:0,encType:1,enterKeyHint:1,for:"htmlFor",form:0,formMethod:1,formAction:1,formEncType:1,formNoValidate:1,formTarget:1,frameBorder:1,headers:0,height:0,hidden:0,high:0,href:0,hrefLang:1,htmlFor:1,httpEquiv:1,"http-equiv":"httpEquiv",icon:0,id:0,innerHTML:1,inputMode:1,integrity:0,is:0,itemID:1,itemProp:1,itemRef:1,itemScope:1,itemType:1,keyParams:1,keyType:1,kind:0,label:0,lang:0,list:0,loop:0,low:0,manifest:0,marginWidth:1,marginHeight:1,max:0,maxLength:1,media:0,mediaGroup:1,method:0,min:0,minLength:1,multiple:0,muted:0,name:0,noModule:1,nonce:0,noValidate:1,open:0,optimum:0,pattern:0,placeholder:0,playsInline:1,poster:0,preload:0,profile:0,radioGroup:1,readOnly:1,referrerPolicy:1,rel:0,required:0,reversed:0,role:0,rows:0,rowSpan:1,sandbox:0,scope:0,scoped:0,scrolling:0,seamless:0,selected:0,shape:0,size:0,sizes:0,span:0,spellCheck:1,src:0,srcDoc:1,srcLang:1,srcSet:1,start:0,step:0,style:0,summary:0,tabIndex:1,target:0,title:0,type:0,useMap:1,value:0,width:0,wmode:0,wrap:0,about:0,accentHeight:1,"accent-height":"accentHeight",accumulate:0,additive:0,alignmentBaseline:1,"alignment-baseline":"alignmentBaseline",allowReorder:1,alphabetic:0,amplitude:0,arabicForm:1,"arabic-form":"arabicForm",ascent:0,attributeName:1,attributeType:1,autoReverse:1,azimuth:0,baseFrequency:1,baselineShift:1,"baseline-shift":"baselineShift",baseProfile:1,bbox:0,begin:0,bias:0,by:0,calcMode:1,capHeight:1,"cap-height":"capHeight",clip:0,clipPath:1,"clip-path":"clipPath",clipPathUnits:1,clipRule:1,"clip-rule":"clipRule",color:0,colorInterpolation:1,"color-interpolation":"colorInterpolation",colorInterpolationFilters:1,"color-interpolation-filters":"colorInterpolationFilters",colorProfile:1,"color-profile":"colorProfile",colorRendering:1,"color-rendering":"colorRendering",contentScriptType:1,contentStyleType:1,cursor:0,cx:0,cy:0,d:0,datatype:0,decelerate:0,descent:0,diffuseConstant:1,direction:0,display:0,divisor:0,dominantBaseline:1,"dominant-baseline":"dominantBaseline",dur:0,dx:0,dy:0,edgeMode:1,elevation:0,enableBackground:1,"enable-background":"enableBackground",end:0,exponent:0,externalResourcesRequired:1,fill:0,fillOpacity:1,"fill-opacity":"fillOpacity",fillRule:1,"fill-rule":"fillRule",filter:0,filterRes:1,filterUnits:1,floodOpacity:1,"flood-opacity":"floodOpacity",floodColor:1,"flood-color":"floodColor",focusable:0,fontFamily:1,"font-family":"fontFamily",fontSize:1,"font-size":"fontSize",fontSizeAdjust:1,"font-size-adjust":"fontSizeAdjust",fontStretch:1,"font-stretch":"fontStretch",fontStyle:1,"font-style":"fontStyle",fontVariant:1,"font-variant":"fontVariant",fontWeight:1,"font-weight":"fontWeight",format:0,from:0,fx:0,fy:0,g1:0,g2:0,glyphName:1,"glyph-name":"glyphName",glyphOrientationHorizontal:1,"glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphOrientationVertical:1,"glyph-orientation-vertical":"glyphOrientationVertical",glyphRef:1,gradientTransform:1,gradientUnits:1,hanging:0,horizAdvX:1,"horiz-adv-x":"horizAdvX",horizOriginX:1,"horiz-origin-x":"horizOriginX",ideographic:0,imageRendering:1,"image-rendering":"imageRendering",in2:0,in:0,inlist:0,intercept:0,k1:0,k2:0,k3:0,k4:0,k:0,kernelMatrix:1,kernelUnitLength:1,kerning:0,keyPoints:1,keySplines:1,keyTimes:1,lengthAdjust:1,letterSpacing:1,"letter-spacing":"letterSpacing",lightingColor:1,"lighting-color":"lightingColor",limitingConeAngle:1,local:0,markerEnd:1,"marker-end":"markerEnd",markerHeight:1,markerMid:1,"marker-mid":"markerMid",markerStart:1,"marker-start":"markerStart",markerUnits:1,markerWidth:1,mask:0,maskContentUnits:1,maskUnits:1,mathematical:0,mode:0,numOctaves:1,offset:0,opacity:0,operator:0,order:0,orient:0,orientation:0,origin:0,overflow:0,overlinePosition:1,"overline-position":"overlinePosition",overlineThickness:1,"overline-thickness":"overlineThickness",paintOrder:1,"paint-order":"paintOrder",panose1:0,"panose-1":"panose1",pathLength:1,patternContentUnits:1,patternTransform:1,patternUnits:1,pointerEvents:1,"pointer-events":"pointerEvents",points:0,pointsAtX:1,pointsAtY:1,pointsAtZ:1,prefix:0,preserveAlpha:1,preserveAspectRatio:1,primitiveUnits:1,property:0,r:0,radius:0,refX:1,refY:1,renderingIntent:1,"rendering-intent":"renderingIntent",repeatCount:1,repeatDur:1,requiredExtensions:1,requiredFeatures:1,resource:0,restart:0,result:0,results:0,rotate:0,rx:0,ry:0,scale:0,security:0,seed:0,shapeRendering:1,"shape-rendering":"shapeRendering",slope:0,spacing:0,specularConstant:1,specularExponent:1,speed:0,spreadMethod:1,startOffset:1,stdDeviation:1,stemh:0,stemv:0,stitchTiles:1,stopColor:1,"stop-color":"stopColor",stopOpacity:1,"stop-opacity":"stopOpacity",strikethroughPosition:1,"strikethrough-position":"strikethroughPosition",strikethroughThickness:1,"strikethrough-thickness":"strikethroughThickness",string:0,stroke:0,strokeDasharray:1,"stroke-dasharray":"strokeDasharray",strokeDashoffset:1,"stroke-dashoffset":"strokeDashoffset",strokeLinecap:1,"stroke-linecap":"strokeLinecap",strokeLinejoin:1,"stroke-linejoin":"strokeLinejoin",strokeMiterlimit:1,"stroke-miterlimit":"strokeMiterlimit",strokeWidth:1,"stroke-width":"strokeWidth",strokeOpacity:1,"stroke-opacity":"strokeOpacity",suppressContentEditableWarning:1,suppressHydrationWarning:1,surfaceScale:1,systemLanguage:1,tableValues:1,targetX:1,targetY:1,textAnchor:1,"text-anchor":"textAnchor",textDecoration:1,"text-decoration":"textDecoration",textLength:1,textRendering:1,"text-rendering":"textRendering",to:0,transform:0,typeof:0,u1:0,u2:0,underlinePosition:1,"underline-position":"underlinePosition",underlineThickness:1,"underline-thickness":"underlineThickness",unicode:0,unicodeBidi:1,"unicode-bidi":"unicodeBidi",unicodeRange:1,"unicode-range":"unicodeRange",unitsPerEm:1,"units-per-em":"unitsPerEm",unselectable:0,vAlphabetic:1,"v-alphabetic":"vAlphabetic",values:0,vectorEffect:1,"vector-effect":"vectorEffect",version:0,vertAdvY:1,"vert-adv-y":"vertAdvY",vertOriginX:1,"vert-origin-x":"vertOriginX",vertOriginY:1,"vert-origin-y":"vertOriginY",vHanging:1,"v-hanging":"vHanging",vIdeographic:1,"v-ideographic":"vIdeographic",viewBox:1,viewTarget:1,visibility:0,vMathematical:1,"v-mathematical":"vMathematical",vocab:0,widths:0,wordSpacing:1,"word-spacing":"wordSpacing",writingMode:1,"writing-mode":"writingMode",x1:0,x2:0,x:0,xChannelSelector:1,xHeight:1,"x-height":"xHeight",xlinkActuate:1,"xlink:actuate":"xlinkActuate",xlinkArcrole:1,"xlink:arcrole":"xlinkArcrole",xlinkHref:1,"xlink:href":"xlinkHref",xlinkRole:1,"xlink:role":"xlinkRole",xlinkShow:1,"xlink:show":"xlinkShow",xlinkTitle:1,"xlink:title":"xlinkTitle",xlinkType:1,"xlink:type":"xlinkType",xmlBase:1,"xml:base":"xmlBase",xmlLang:1,"xml:lang":"xmlLang",xmlns:0,"xml:space":"xmlSpace",xmlnsXlink:1,"xmlns:xlink":"xmlnsXlink",xmlSpace:1,y1:0,y2:0,y:0,yChannelSelector:1,z:0,zoomAndPan:1};Object.defineProperty(lib,"__esModule",{value:!0});function _slicedToArray(tt,et){return _arrayWithHoles(tt)||_iterableToArrayLimit(tt,et)||_unsupportedIterableToArray(tt,et)||_nonIterableRest()}function _arrayWithHoles(tt){if(Array.isArray(tt))return tt}function _iterableToArrayLimit(tt,et){var rt=tt==null?null:typeof Symbol<"u"&&tt[Symbol.iterator]||tt["@@iterator"];if(rt!=null){var st=[],nt=!0,ot=!1,at,lt;try{for(rt=rt.call(tt);!(nt=(at=rt.next()).done)&&(st.push(at.value),!(et&&st.length===et));nt=!0);}catch(ut){ot=!0,lt=ut}finally{try{!nt&&rt.return!=null&&rt.return()}finally{if(ot)throw lt}}return st}}function _unsupportedIterableToArray(tt,et){if(tt){if(typeof tt=="string")return _arrayLikeToArray(tt,et);var rt=Object.prototype.toString.call(tt).slice(8,-1);if(rt==="Object"&&tt.constructor&&(rt=tt.constructor.name),rt==="Map"||rt==="Set")return Array.from(tt);if(rt==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(rt))return _arrayLikeToArray(tt,et)}}function _arrayLikeToArray(tt,et){(et==null||et>tt.length)&&(et=tt.length);for(var rt=0,st=new Array(et);rt<et;rt++)st[rt]=tt[rt];return st}function _nonIterableRest(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1394
1394
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var RESERVED=0,STRING=1,BOOLEANISH_STRING=2,BOOLEAN=3,OVERLOADED_BOOLEAN=4,NUMERIC=5,POSITIVE_NUMERIC=6;function getPropertyInfo(tt){return properties.hasOwnProperty(tt)?properties[tt]:null}function PropertyInfoRecord(tt,et,rt,st,nt,ot,at){this.acceptsBooleans=et===BOOLEANISH_STRING||et===BOOLEAN||et===OVERLOADED_BOOLEAN,this.attributeName=st,this.attributeNamespace=nt,this.mustUseProperty=rt,this.propertyName=tt,this.type=et,this.sanitizeURL=ot,this.removeEmptyString=at}var properties={},reservedProps=["children","dangerouslySetInnerHTML","defaultValue","defaultChecked","innerHTML","suppressContentEditableWarning","suppressHydrationWarning","style"];reservedProps.forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,RESERVED,!1,tt,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(tt){var et=_slicedToArray(tt,2),rt=et[0],st=et[1];properties[rt]=new PropertyInfoRecord(rt,STRING,!1,st,null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEANISH_STRING,!1,tt.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEANISH_STRING,!1,tt,null,!1,!1)});["allowFullScreen","async","autoFocus","autoPlay","controls","default","defer","disabled","disablePictureInPicture","disableRemotePlayback","formNoValidate","hidden","loop","noModule","noValidate","open","playsInline","readOnly","required","reversed","scoped","seamless","itemScope"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEAN,!1,tt.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,BOOLEAN,!0,tt,null,!1,!1)});["capture","download"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,OVERLOADED_BOOLEAN,!1,tt,null,!1,!1)});["cols","rows","size","span"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,POSITIVE_NUMERIC,!1,tt,null,!1,!1)});["rowSpan","start"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,NUMERIC,!1,tt.toLowerCase(),null,!1,!1)});var CAMELIZE=/[\-\:]([a-z])/g,capitalize$1=function tt(et){return et[1].toUpperCase()};["accent-height","alignment-baseline","arabic-form","baseline-shift","cap-height","clip-path","clip-rule","color-interpolation","color-interpolation-filters","color-profile","color-rendering","dominant-baseline","enable-background","fill-opacity","fill-rule","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","glyph-name","glyph-orientation-horizontal","glyph-orientation-vertical","horiz-adv-x","horiz-origin-x","image-rendering","letter-spacing","lighting-color","marker-end","marker-mid","marker-start","overline-position","overline-thickness","paint-order","panose-1","pointer-events","rendering-intent","shape-rendering","stop-color","stop-opacity","strikethrough-position","strikethrough-thickness","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","text-anchor","text-decoration","text-rendering","underline-position","underline-thickness","unicode-bidi","unicode-range","units-per-em","v-alphabetic","v-hanging","v-ideographic","v-mathematical","vector-effect","vert-adv-y","vert-origin-x","vert-origin-y","word-spacing","writing-mode","xmlns:xlink","x-height"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,null,!1,!1)});["xlink:actuate","xlink:arcrole","xlink:role","xlink:show","xlink:title","xlink:type"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(tt){var et=tt.replace(CAMELIZE,capitalize$1);properties[et]=new PropertyInfoRecord(et,STRING,!1,tt,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,STRING,!1,tt.toLowerCase(),null,!1,!1)});var xlinkHref="xlinkHref";properties[xlinkHref]=new PropertyInfoRecord("xlinkHref",STRING,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(tt){properties[tt]=new PropertyInfoRecord(tt,STRING,!1,tt.toLowerCase(),null,!0,!0)});var _require=possibleStandardNamesOptimized$1,CAMELCASE=_require.CAMELCASE,SAME=_require.SAME,possibleStandardNamesOptimized=_require.possibleStandardNames,ATTRIBUTE_NAME_START_CHAR=":A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",ATTRIBUTE_NAME_CHAR=ATTRIBUTE_NAME_START_CHAR+"\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",isCustomAttribute=RegExp.prototype.test.bind(new RegExp("^(data|aria)-["+ATTRIBUTE_NAME_CHAR+"]*$")),possibleStandardNames=Object.keys(possibleStandardNamesOptimized).reduce(function(tt,et){var rt=possibleStandardNamesOptimized[et];return rt===SAME?tt[et]=et:rt===CAMELCASE?tt[et.toLowerCase()]=et:tt[et]=rt,tt},{});lib.BOOLEAN=BOOLEAN;lib.BOOLEANISH_STRING=BOOLEANISH_STRING;lib.NUMERIC=NUMERIC;lib.OVERLOADED_BOOLEAN=OVERLOADED_BOOLEAN;lib.POSITIVE_NUMERIC=POSITIVE_NUMERIC;lib.RESERVED=RESERVED;lib.STRING=STRING;lib.getPropertyInfo=getPropertyInfo;lib.isCustomAttribute=isCustomAttribute;lib.possibleStandardNames=possibleStandardNames;var cjs={},styleToObject={exports:{}},COMMENT_REGEX=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,NEWLINE_REGEX=/\n/g,WHITESPACE_REGEX=/^\s*/,PROPERTY_REGEX=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,COLON_REGEX=/^:\s*/,VALUE_REGEX=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,SEMICOLON_REGEX=/^[;\s]*/,TRIM_REGEX=/^\s+|\s+$/g,NEWLINE=`
|