@xwiki/cristal-sharedworker-impl 0.8.0
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/CHANGELOG.md +29 -0
- package/LICENSE +505 -0
- package/dist/assets/worker-D2exZhnK.js +231 -0
- package/dist/assets/worker-D2exZhnK.js.map +1 -0
- package/dist/components/componentsInit.d.ts +5 -0
- package/dist/components/defaultQueueWorker.d.ts +15 -0
- package/dist/components/worker.d.ts +22 -0
- package/dist/components/workerCristalApp.d.ts +36 -0
- package/dist/components/workerQueueWorker.d.ts +10 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.es.js +107 -0
- package/dist/index.es.js.map +1 -0
- package/dist/index.umd.js +25 -0
- package/dist/index.umd.js.map +1 -0
- package/package.json +49 -0
- package/src/components/componentsInit.ts +34 -0
- package/src/components/defaultQueueWorker.ts +129 -0
- package/src/components/worker.ts +225 -0
- package/src/components/workerCristalApp.ts +146 -0
- package/src/components/workerQueueWorker.ts +50 -0
- package/src/index.ts +29 -0
- package/src/vite-env.d.ts +27 -0
- package/src/vue.d.ts +32 -0
- package/tsconfig.json +10 -0
- package/vite-env.d.ts +26 -0
- package/vite.config.ts +38 -0
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
(function(){"use strict";/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2019 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/const Go=Symbol("Comlink.proxy"),ou=Symbol("Comlink.endpoint"),au=Symbol("Comlink.releaseProxy"),wi=Symbol("Comlink.finalizer"),tr=Symbol("Comlink.thrown"),Yo=e=>typeof e=="object"&&e!==null||typeof e=="function",su={canHandle:e=>Yo(e)&&e[Go],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Ei(e,t),[n,[n]]},deserialize(e){return e.start(),fu(e)}},uu={canHandle:e=>Yo(e)&&tr in e,serialize({value:e}){let t;return e instanceof Error?t={isError:!0,value:{message:e.message,name:e.name,stack:e.stack}}:t={isError:!1,value:e},[t,[]]},deserialize(e){throw e.isError?Object.assign(new Error(e.value.message),e.value):e.value}},Qo=new Map([["proxy",su],["throw",uu]]);function cu(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function Ei(e,t=globalThis,n=["*"]){t.addEventListener("message",function o(a){if(!a||!a.data)return;if(!cu(n,a.origin)){console.warn(`Invalid origin '${a.origin}' for comlink proxy`);return}const{id:u,type:f,path:g}=Object.assign({path:[]},a.data),S=(a.data.argumentList||[]).map(Bt);let p;try{const I=g.slice(0,-1).reduce((B,Q)=>B[Q],e),P=g.reduce((B,Q)=>B[Q],e);switch(f){case"GET":p=P;break;case"SET":I[g.slice(-1)[0]]=Bt(a.data.value),p=!0;break;case"APPLY":p=P.apply(I,S);break;case"CONSTRUCT":{const B=new P(...S);p=vu(B)}break;case"ENDPOINT":{const{port1:B,port2:Q}=new MessageChannel;Ei(e,Q),p=gu(B,[B])}break;case"RELEASE":p=void 0;break;default:return}}catch(I){p={value:I,[tr]:0}}Promise.resolve(p).catch(I=>({value:I,[tr]:0})).then(I=>{const[P,B]=or(I);t.postMessage(Object.assign(Object.assign({},P),{id:u}),B),f==="RELEASE"&&(t.removeEventListener("message",o),Jo(t),wi in e&&typeof e[wi]=="function"&&e[wi]())}).catch(I=>{const[P,B]=or({value:new TypeError("Unserializable return value"),[tr]:0});t.postMessage(Object.assign(Object.assign({},P),{id:u}),B)})}),t.start&&t.start()}function lu(e){return e.constructor.name==="MessagePort"}function Jo(e){lu(e)&&e.close()}function fu(e,t){return Si(e,[],t)}function nr(e){if(e)throw new Error("Proxy has been released and is not useable")}function Xo(e){return on(e,{type:"RELEASE"}).then(()=>{Jo(e)})}const rr=new WeakMap,ir="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(rr.get(e)||0)-1;rr.set(e,t),t===0&&Xo(e)});function hu(e,t){const n=(rr.get(t)||0)+1;rr.set(t,n),ir&&ir.register(e,t,e)}function du(e){ir&&ir.unregister(e)}function Si(e,t=[],n=function(){}){let o=!1;const a=new Proxy(n,{get(u,f){if(nr(o),f===au)return()=>{du(a),Xo(e),o=!0};if(f==="then"){if(t.length===0)return{then:()=>a};const g=on(e,{type:"GET",path:t.map(S=>S.toString())}).then(Bt);return g.then.bind(g)}return Si(e,[...t,f])},set(u,f,g){nr(o);const[S,p]=or(g);return on(e,{type:"SET",path:[...t,f].map(I=>I.toString()),value:S},p).then(Bt)},apply(u,f,g){nr(o);const S=t[t.length-1];if(S===ou)return on(e,{type:"ENDPOINT"}).then(Bt);if(S==="bind")return Si(e,t.slice(0,-1));const[p,I]=Zo(g);return on(e,{type:"APPLY",path:t.map(P=>P.toString()),argumentList:p},I).then(Bt)},construct(u,f){nr(o);const[g,S]=Zo(f);return on(e,{type:"CONSTRUCT",path:t.map(p=>p.toString()),argumentList:g},S).then(Bt)}});return hu(a,e),a}function pu(e){return Array.prototype.concat.apply([],e)}function Zo(e){const t=e.map(or);return[t.map(n=>n[0]),pu(t.map(n=>n[1]))]}const ea=new WeakMap;function gu(e,t){return ea.set(e,t),e}function vu(e){return Object.assign(e,{[Go]:!0})}function or(e){for(const[t,n]of Qo)if(n.canHandle(e)){const[o,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:o},a]}return[{type:"RAW",value:e},ea.get(e)||[]]}function Bt(e){switch(e.type){case"HANDLER":return Qo.get(e.name).deserialize(e.value);case"RAW":return e.value}}function on(e,t,n){return new Promise(o=>{const a=yu();e.addEventListener("message",function u(f){!f.data||!f.data.id||f.data.id!==a||(e.removeEventListener("message",u),o(f.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),n)})}function yu(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}var qe="named",ta="name",ar="unmanaged",na="optional",sr="inject",xn="multi_inject",ra="inversify:tagged",ia="inversify:tagged_props",Oi="inversify:paramtypes",mu="design:paramtypes",oa="post_construct",xi="pre_destroy";function bu(){return[sr,xn,ta,ar,qe,na]}var aa=bu(),Ee={Request:"Request",Singleton:"Singleton",Transient:"Transient"},pe={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},An={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},_u=0;function Cn(){return _u++}var wu=function(){function e(t,n){this.id=Cn(),this.activated=!1,this.serviceIdentifier=t,this.scope=n,this.type=pe.Invalid,this.constraint=function(o){return!0},this.implementationType=null,this.cache=null,this.factory=null,this.provider=null,this.onActivation=null,this.onDeactivation=null,this.dynamicValue=null}return e.prototype.clone=function(){var t=new e(this.serviceIdentifier,this.scope);return t.activated=t.scope===Ee.Singleton?this.activated:!1,t.implementationType=this.implementationType,t.dynamicValue=this.dynamicValue,t.scope=this.scope,t.type=this.type,t.factory=this.factory,t.provider=this.provider,t.constraint=this.constraint,t.onActivation=this.onActivation,t.onDeactivation=this.onDeactivation,t.cache=this.cache,t},e}(),Eu="Cannot apply @injectable decorator multiple times.",sa="Metadata key was used more than once in a parameter:",Pn="NULL argument",ua="Key Not Found",Su="Ambiguous match found for serviceIdentifier:",Ou="Could not unbind serviceIdentifier:",xu="No matching bindings found for serviceIdentifier:",ca="Missing required @injectable annotation in:",Au="Missing required @inject or @multiInject annotation in:",Cu=function(e){return"@inject called with undefined this could mean that the class "+e+" has a circular dependency problem. You can use a LazyServiceIdentifier to overcome this limitation."},Pu="Circular dependency found:",Tu="Invalid binding type:",Iu="No snapshot available to restore.",Du="Invalid return type in middleware. Middleware must return!",Nu="Value provided to function binding must be a function!",Ru=function(e){return"You are attempting to construct '"+e+`' in a synchronous way
|
|
6
|
+
but it has asynchronous dependencies.`},Mu="The toSelf function can only be applied when a constructor is used as service identifier",la="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",ku=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+(e[0]+" must be >= than the number of constructor arguments of its base class.")},ju="Invalid Container constructor argument. Container options must be an object.",Lu='Invalid Container option. Default scope must be a string ("singleton" or "transient").',Fu="Invalid Container option. Auto bind injectable must be a boolean",Bu="Invalid Container option. Skip base check must be a boolean",Ku="Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)",Vu=function(e,t){return"@postConstruct error in class "+e+": "+t},Wu=function(e,t){return"@preDestroy error in class "+e+": "+t},Ai=function(e,t){return"onDeactivation() error in class "+e+": "+t},$u=function(e,t){return"It looks like there is a circular dependency in one of the '"+e+"' bindings. Please investigate bindings with "+("service identifier '"+t+"'.")},Uu="Maximum call stack size exceeded",qu=function(){function e(){}return e.prototype.getConstructorMetadata=function(t){var n=Reflect.getMetadata(Oi,t),o=Reflect.getMetadata(ra,t);return{compilerGeneratedMetadata:n,userGeneratedMetadata:o||{}}},e.prototype.getPropertiesMetadata=function(t){var n=Reflect.getMetadata(ia,t)||[];return n},e}(),ur={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function fa(e){return e instanceof RangeError||e.message===Uu}var zu=function(e,t){try{return e()}catch(n){throw fa(n)&&(n=t()),n}};function Tn(e){if(typeof e=="function"){var t=e;return t.name}else{if(typeof e=="symbol")return e.toString();var t=e;return t}}function ha(e,t,n){var o="",a=n(e,t);return a.length!==0&&(o=`
|
|
7
|
+
Registered bindings:`,a.forEach(function(u){var f="Object";u.implementationType!==null&&(f=cr(u.implementationType)),o=o+`
|
|
8
|
+
`+f,u.constraint.metaData&&(o=o+" - "+u.constraint.metaData)})),o}function da(e,t){return e.parentRequest===null?!1:e.parentRequest.serviceIdentifier===t?!0:da(e.parentRequest,t)}function Hu(e){function t(o,a){a===void 0&&(a=[]);var u=Tn(o.serviceIdentifier);return a.push(u),o.parentRequest!==null?t(o.parentRequest,a):a}var n=t(e);return n.reverse().join(" --> ")}function pa(e){e.childRequests.forEach(function(t){if(da(t,t.serviceIdentifier)){var n=Hu(t);throw new Error(Pu+" "+n)}else pa(t)})}function Gu(e,t){if(t.isTagged()||t.isNamed()){var n="",o=t.getNamedTag(),a=t.getCustomTags();return o!==null&&(n+=o.toString()+`
|
|
9
|
+
`),a!==null&&a.forEach(function(u){n+=u.toString()+`
|
|
10
|
+
`})," "+e+`
|
|
11
|
+
`+e+" - "+n}else return" "+e}function cr(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: "+t}function Yu(e){return e.toString().slice(7,-1)}var ga=function(){function e(t){this.id=Cn(),this.container=t}return e.prototype.addPlan=function(t){this.plan=t},e.prototype.setCurrentRequest=function(t){this.currentRequest=t},e}(),dt=function(){function e(t,n){this.key=t,this.value=n}return e.prototype.toString=function(){return this.key===qe?"named: "+String(this.value).toString()+" ":"tagged: { key:"+this.key.toString()+", value: "+String(this.value)+" }"},e}(),Qu=function(){function e(t,n){this.parentContext=t,this.rootRequest=n}return e}(),Ju=function(){function e(t){this._cb=t}return e.prototype.unwrap=function(){return this._cb()},e}(),Xu=function(){function e(t){this.str=t}return e.prototype.startsWith=function(t){return this.str.indexOf(t)===0},e.prototype.endsWith=function(t){var n="",o=t.split("").reverse().join("");return n=this.str.split("").reverse().join(""),this.startsWith.call({str:n},o)},e.prototype.contains=function(t){return this.str.indexOf(t)!==-1},e.prototype.equals=function(t){return this.str===t},e.prototype.value=function(){return this.str},e}(),lr=function(){function e(t,n,o,a){this.id=Cn(),this.type=t,this.serviceIdentifier=o;var u=typeof n=="symbol"?Yu(n):n;this.name=new Xu(u||""),this.identifier=n,this.metadata=new Array;var f=null;typeof a=="string"?f=new dt(qe,a):a instanceof dt&&(f=a),f!==null&&this.metadata.push(f)}return e.prototype.hasTag=function(t){for(var n=0,o=this.metadata;n<o.length;n++){var a=o[n];if(a.key===t)return!0}return!1},e.prototype.isArray=function(){return this.hasTag(xn)},e.prototype.matchesArray=function(t){return this.matchesTag(xn)(t)},e.prototype.isNamed=function(){return this.hasTag(qe)},e.prototype.isTagged=function(){return this.metadata.some(function(t){return aa.every(function(n){return t.key!==n})})},e.prototype.isOptional=function(){return this.matchesTag(na)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(t){return t.key===qe})[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(t){return aa.every(function(n){return t.key!==n})}):null},e.prototype.matchesNamedTag=function(t){return this.matchesTag(qe)(t)},e.prototype.matchesTag=function(t){var n=this;return function(o){for(var a=0,u=n.metadata;a<u.length;a++){var f=u[a];if(f.key===t&&f.value===o)return!0}return!1}},e}(),fr=function(e,t,n){if(n||arguments.length===2)for(var o=0,a=t.length,u;o<a;o++)(u||!(o in t))&&(u||(u=Array.prototype.slice.call(t,0,o)),u[o]=t[o]);return e.concat(u||Array.prototype.slice.call(t))};function Zu(e,t){var n=cr(t);return va(e,n,t,!1)}function va(e,t,n,o){var a=e.getConstructorMetadata(n),u=a.compilerGeneratedMetadata;if(u===void 0){var f=ca+" "+t+".";throw new Error(f)}var g=a.userGeneratedMetadata,S=Object.keys(g),p=n.length===0&&S.length>0,I=S.length>n.length,P=p||I?S.length:n.length,B=tc(o,t,u,g,P),Q=ya(e,n,t),Z=fr(fr([],B,!0),Q,!0);return Z}function ec(e,t,n,o,a){var u=a[e.toString()]||[],f=ba(u),g=f.unmanaged!==!0,S=o[e],p=f.inject||f.multiInject;if(S=p||S,S instanceof Ju&&(S=S.unwrap()),g){var I=S===Object,P=S===Function,B=S===void 0,Q=I||P||B;if(!t&&Q){var Z=Au+" argument "+e+" in class "+n+".";throw new Error(Z)}var fe=new lr(An.ConstructorArgument,f.targetName,S);return fe.metadata=u,fe}return null}function tc(e,t,n,o,a){for(var u=[],f=0;f<a;f++){var g=f,S=ec(g,e,t,n,o);S!==null&&u.push(S)}return u}function nc(e,t,n,o){var a=e||t;if(a===void 0){var u=ca+" for property "+String(n)+" in class "+o+".";throw new Error(u)}return a}function ya(e,t,n){for(var o=e.getPropertiesMetadata(t),a=[],u=Object.getOwnPropertySymbols(o),f=Object.keys(o),g=f.concat(u),S=0,p=g;S<p.length;S++){var I=p[S],P=o[I],B=ba(P),Q=B.targetName||I,Z=nc(B.inject,B.multiInject,I,n),fe=new lr(An.ClassProperty,Q,Z);fe.metadata=P,a.push(fe)}var ze=Object.getPrototypeOf(t.prototype).constructor;if(ze!==Object){var We=ya(e,ze,n);a=fr(fr([],a,!0),We,!0)}return a}function ma(e,t){var n=Object.getPrototypeOf(t.prototype).constructor;if(n!==Object){var o=cr(n),a=va(e,o,n,!0),u=a.map(function(S){return S.metadata.filter(function(p){return p.key===ar})}),f=[].concat.apply([],u).length,g=a.length-f;return g>0?g:ma(e,n)}else return 0}function ba(e){var t={};return e.forEach(function(n){t[n.key.toString()]=n.value}),{inject:t[sr],multiInject:t[xn],targetName:t[ta],unmanaged:t[ar]}}var Ci=function(){function e(t,n,o,a,u){this.id=Cn(),this.serviceIdentifier=t,this.parentContext=n,this.parentRequest=o,this.target=u,this.childRequests=[],this.bindings=Array.isArray(a)?a:[a],this.requestScope=o===null?new Map:null}return e.prototype.addChildRequest=function(t,n,o){var a=new e(t,this.parentContext,this,n,o);return this.childRequests.push(a),a},e}();function hr(e){return e._bindingDictionary}function rc(e,t,n,o,a,u){var f=e?xn:sr,g=new dt(f,n),S=new lr(t,o,n,g);if(a!==void 0){var p=new dt(a,u);S.metadata.push(p)}return S}function _a(e,t,n,o,a){var u=In(n.container,a.serviceIdentifier),f=[];return u.length===ur.NoBindingsAvailable&&n.container.options.autoBindInjectable&&typeof a.serviceIdentifier=="function"&&e.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),u=In(n.container,a.serviceIdentifier)),t?f=u:f=u.filter(function(g){var S=new Ci(g.serviceIdentifier,n,o,g,a);return g.constraint(S)}),ic(a.serviceIdentifier,f,a,n.container),f}function ic(e,t,n,o){switch(t.length){case ur.NoBindingsAvailable:if(n.isOptional())return t;var a=Tn(e),u=xu;throw u+=Gu(a,n),u+=ha(o,a,In),new Error(u);case ur.OnlyOneBindingAvailable:return t;case ur.MultipleBindingsAvailable:default:if(n.isArray())return t;var a=Tn(e),u=Su+" "+a;throw u+=ha(o,a,In),new Error(u)}}function wa(e,t,n,o,a,u){var f,g;if(a===null){f=_a(e,t,o,null,u),g=new Ci(n,o,null,f,u);var S=new Qu(o,g);o.addPlan(S)}else f=_a(e,t,o,a,u),g=a.addChildRequest(u.serviceIdentifier,f,u);f.forEach(function(p){var I=null;if(u.isArray())I=g.addChildRequest(p.serviceIdentifier,p,u);else{if(p.cache)return;I=g}if(p.type===pe.Instance&&p.implementationType!==null){var P=Zu(e,p.implementationType);if(!o.container.options.skipBaseClassChecks){var B=ma(e,p.implementationType);if(P.length<B){var Q=ku(cr(p.implementationType));throw new Error(Q)}}P.forEach(function(Z){wa(e,!1,Z.serviceIdentifier,o,I,Z)})}})}function In(e,t){var n=[],o=hr(e);return o.hasKey(t)?n=o.get(t):e.parent!==null&&(n=In(e.parent,t)),n}function oc(e,t,n,o,a,u,f,g){g===void 0&&(g=!1);var S=new ga(t),p=rc(n,o,a,"",u,f);try{return wa(e,g,a,S,null,p),S}catch(I){throw fa(I)&&pa(S.plan.rootRequest),I}}function ac(e,t,n,o){var a=new lr(An.Variable,"",t,new dt(n,o)),u=new ga(e),f=new Ci(t,u,null,[],a);return f}function Be(e){var t=typeof e=="object"&&e!==null||typeof e=="function";return t&&typeof e.then=="function"}function Ea(e){return Be(e)?!0:Array.isArray(e)&&e.some(Be)}var sc=function(e,t,n,o){function a(u){return u instanceof n?u:new n(function(f){f(u)})}return new(n||(n=Promise))(function(u,f){function g(I){try{p(o.next(I))}catch(P){f(P)}}function S(I){try{p(o.throw(I))}catch(P){f(P)}}function p(I){I.done?u(I.value):a(I.value).then(g,S)}p((o=o.apply(e,t||[])).next())})},uc=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(p){return function(I){return S([p,I])}}function S(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=p[0]&2?a.return:p[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,p[1])).done)return u;switch(a=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){n.label=p[1];break}if(p[0]===6&&n.label<u[1]){n.label=u[1],u=p;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(p);break}u[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(I){p=[6,I],a=0}finally{o=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},cc=function(e,t){return t.scope===Ee.Singleton&&t.activated?t.cache:t.scope===Ee.Request&&e.has(t.id)?e.get(t.id):null},lc=function(e,t,n){t.scope===Ee.Singleton&&hc(t,n),t.scope===Ee.Request&&fc(e,t,n)},fc=function(e,t,n){e.has(t.id)||e.set(t.id,n)},hc=function(e,t){e.cache=t,e.activated=!0,Be(t)&&dc(e,t)},dc=function(e,t){return sc(void 0,void 0,void 0,function(){var n,o;return uc(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,t];case 1:return n=a.sent(),e.cache=n,[3,3];case 2:throw o=a.sent(),e.cache=null,e.activated=!1,o;case 3:return[2]}})})},Dn;(function(e){e.DynamicValue="toDynamicValue",e.Factory="toFactory",e.Provider="toProvider"})(Dn||(Dn={}));var pc=function(e){var t=null;switch(e.type){case pe.ConstantValue:case pe.Function:t=e.cache;break;case pe.Constructor:case pe.Instance:t=e.implementationType;break;case pe.DynamicValue:t=e.dynamicValue;break;case pe.Provider:t=e.provider;break;case pe.Factory:t=e.factory;break}if(t===null){var n=Tn(e.serviceIdentifier);throw new Error(Tu+" "+n)}},gc=function(e){switch(e.type){case pe.Factory:return{factory:e.factory,factoryType:Dn.Factory};case pe.Provider:return{factory:e.provider,factoryType:Dn.Provider};case pe.DynamicValue:return{factory:e.dynamicValue,factoryType:Dn.DynamicValue};default:throw new Error("Unexpected factory type "+e.type)}},an=function(){return an=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},an.apply(this,arguments)},Sa=function(e,t,n,o){function a(u){return u instanceof n?u:new n(function(f){f(u)})}return new(n||(n=Promise))(function(u,f){function g(I){try{p(o.next(I))}catch(P){f(P)}}function S(I){try{p(o.throw(I))}catch(P){f(P)}}function p(I){I.done?u(I.value):a(I.value).then(g,S)}p((o=o.apply(e,t||[])).next())})},Oa=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(p){return function(I){return S([p,I])}}function S(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=p[0]&2?a.return:p[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,p[1])).done)return u;switch(a=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){n.label=p[1];break}if(p[0]===6&&n.label<u[1]){n.label=u[1],u=p;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(p);break}u[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(I){p=[6,I],a=0}finally{o=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},vc=function(e,t,n){if(n||arguments.length===2)for(var o=0,a=t.length,u;o<a;o++)(u||!(o in t))&&(u||(u=Array.prototype.slice.call(t,0,o)),u[o]=t[o]);return e.concat(u||Array.prototype.slice.call(t))};function yc(e,t){return e.reduce(function(n,o){var a=t(o),u=o.target.type;return u===An.ConstructorArgument?n.constructorInjections.push(a):(n.propertyRequests.push(o),n.propertyInjections.push(a)),n.isAsync||(n.isAsync=Ea(a)),n},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function mc(e,t,n){var o;if(t.length>0){var a=yc(t,n),u=an(an({},a),{constr:e});a.isAsync?o=bc(u):o=xa(u)}else o=new e;return o}function xa(e){var t,n=new((t=e.constr).bind.apply(t,vc([void 0],e.constructorInjections,!1)));return e.propertyRequests.forEach(function(o,a){var u=o.target.identifier,f=e.propertyInjections[a];(!o.target.isOptional()||f!==void 0)&&(n[u]=f)}),n}function bc(e){return Sa(this,void 0,void 0,function(){var t,n;return Oa(this,function(o){switch(o.label){case 0:return[4,Aa(e.constructorInjections)];case 1:return t=o.sent(),[4,Aa(e.propertyInjections)];case 2:return n=o.sent(),[2,xa(an(an({},e),{constructorInjections:t,propertyInjections:n}))]}})})}function Aa(e){return Sa(this,void 0,void 0,function(){var t,n,o,a;return Oa(this,function(u){for(t=[],n=0,o=e;n<o.length;n++)a=o[n],Array.isArray(a)?t.push(Promise.all(a)):t.push(a);return[2,Promise.all(t)]})})}function Ca(e,t){var n=_c(e,t);return Be(n)?n.then(function(){return t}):t}function _c(e,t){var n,o;if(Reflect.hasMetadata(oa,e)){var a=Reflect.getMetadata(oa,e);try{return(o=(n=t)[a.value])===null||o===void 0?void 0:o.call(n)}catch(u){if(u instanceof Error)throw new Error(Vu(e.name,u.message))}}}function wc(e,t){e.scope!==Ee.Singleton&&Ec(e,t)}function Ec(e,t){var n="Class cannot be instantiated in "+(e.scope===Ee.Request?"request":"transient")+" scope.";if(typeof e.onDeactivation=="function")throw new Error(Ai(t.name,n));if(Reflect.hasMetadata(xi,t))throw new Error(Wu(t.name,n))}function Sc(e,t,n,o){wc(e,t);var a=mc(t,n,o);return Be(a)?a.then(function(u){return Ca(t,u)}):Ca(t,a)}var Oc=function(e,t,n,o){function a(u){return u instanceof n?u:new n(function(f){f(u)})}return new(n||(n=Promise))(function(u,f){function g(I){try{p(o.next(I))}catch(P){f(P)}}function S(I){try{p(o.throw(I))}catch(P){f(P)}}function p(I){I.done?u(I.value):a(I.value).then(g,S)}p((o=o.apply(e,t||[])).next())})},xc=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(p){return function(I){return S([p,I])}}function S(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=p[0]&2?a.return:p[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,p[1])).done)return u;switch(a=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){n.label=p[1];break}if(p[0]===6&&n.label<u[1]){n.label=u[1],u=p;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(p);break}u[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(I){p=[6,I],a=0}finally{o=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Pi=function(e){return function(t){t.parentContext.setCurrentRequest(t);var n=t.bindings,o=t.childRequests,a=t.target&&t.target.isArray(),u=!t.parentRequest||!t.parentRequest.target||!t.target||!t.parentRequest.target.matchesArray(t.target.serviceIdentifier);if(a&&u)return o.map(function(g){var S=Pi(e);return S(g)});if(t.target.isOptional()&&n.length===0)return;var f=n[0];return Tc(e,t,f)}},Ac=function(e,t){var n=gc(e);return zu(function(){return n.factory.bind(e)(t)},function(){return new Error($u(n.factoryType,t.currentRequest.serviceIdentifier.toString()))})},Cc=function(e,t,n){var o,a=t.childRequests;switch(pc(n),n.type){case pe.ConstantValue:case pe.Function:o=n.cache;break;case pe.Constructor:o=n.implementationType;break;case pe.Instance:o=Sc(n,n.implementationType,a,Pi(e));break;default:o=Ac(n,t.parentContext)}return o},Pc=function(e,t,n){var o=cc(e,t);return o!==null||(o=n(),lc(e,t,o)),o},Tc=function(e,t,n){return Pc(e,n,function(){var o=Cc(e,t,n);return Be(o)?o=o.then(function(a){return Pa(t,n,a)}):o=Pa(t,n,o),o})};function Pa(e,t,n){var o=Ic(e.parentContext,t,n),a=Rc(e.parentContext.container),u,f=a.next();do{u=f.value;var g=e.parentContext,S=e.serviceIdentifier,p=Nc(u,S);Be(o)?o=Ta(p,g,o):o=Dc(p,g,o),f=a.next()}while(f.done!==!0&&!hr(u).hasKey(e.serviceIdentifier));return o}var Ic=function(e,t,n){var o;return typeof t.onActivation=="function"?o=t.onActivation(e,n):o=n,o},Dc=function(e,t,n){for(var o=e.next();!o.done;){if(n=o.value(t,n),Be(n))return Ta(e,t,n);o=e.next()}return n},Ta=function(e,t,n){return Oc(void 0,void 0,void 0,function(){var o,a;return xc(this,function(u){switch(u.label){case 0:return[4,n];case 1:o=u.sent(),a=e.next(),u.label=2;case 2:return a.done?[3,4]:[4,a.value(t,o)];case 3:return o=u.sent(),a=e.next(),[3,2];case 4:return[2,o]}})})},Nc=function(e,t){var n=e._activations;return n.hasKey(t)?n.get(t).values():[].values()},Rc=function(e){for(var t=[e],n=e.parent;n!==null;)t.push(n),n=n.parent;var o=function(){var u=t.pop();return u!==void 0?{done:!1,value:u}:{done:!0,value:void 0}},a={next:o};return a};function Mc(e){var t=Pi(e.plan.rootRequest.requestScope);return t(e.plan.rootRequest)}var pt=function(e,t){var n=e.parentRequest;return n!==null?t(n)?!0:pt(n,t):!1},Nn=function(e){return function(t){var n=function(o){return o!==null&&o.target!==null&&o.target.matchesTag(e)(t)};return n.metaData=new dt(e,t),n}},dr=Nn(qe),Ti=function(e){return function(t){var n=null;if(t!==null)if(n=t.bindings[0],typeof e=="string"){var o=n.serviceIdentifier;return o===e}else{var a=t.bindings[0].implementationType;return e===a}return!1}},pr=function(){function e(t){this._binding=t}return e.prototype.when=function(t){return this._binding.constraint=t,new Ie(this._binding)},e.prototype.whenTargetNamed=function(t){return this._binding.constraint=dr(t),new Ie(this._binding)},e.prototype.whenTargetIsDefault=function(){return this._binding.constraint=function(t){if(t===null)return!1;var n=t.target!==null&&!t.target.isNamed()&&!t.target.isTagged();return n},new Ie(this._binding)},e.prototype.whenTargetTagged=function(t,n){return this._binding.constraint=Nn(t)(n),new Ie(this._binding)},e.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(n){return n!==null&&Ti(t)(n.parentRequest)},new Ie(this._binding)},e.prototype.whenParentNamed=function(t){return this._binding.constraint=function(n){return n!==null&&dr(t)(n.parentRequest)},new Ie(this._binding)},e.prototype.whenParentTagged=function(t,n){return this._binding.constraint=function(o){return o!==null&&Nn(t)(n)(o.parentRequest)},new Ie(this._binding)},e.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(n){return n!==null&&pt(n,Ti(t))},new Ie(this._binding)},e.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(n){return n!==null&&!pt(n,Ti(t))},new Ie(this._binding)},e.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(n){return n!==null&&pt(n,dr(t))},new Ie(this._binding)},e.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(n){return n!==null&&!pt(n,dr(t))},new Ie(this._binding)},e.prototype.whenAnyAncestorTagged=function(t,n){return this._binding.constraint=function(o){return o!==null&&pt(o,Nn(t)(n))},new Ie(this._binding)},e.prototype.whenNoAncestorTagged=function(t,n){return this._binding.constraint=function(o){return o!==null&&!pt(o,Nn(t)(n))},new Ie(this._binding)},e.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(n){return n!==null&&pt(n,t)},new Ie(this._binding)},e.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(n){return n!==null&&!pt(n,t)},new Ie(this._binding)},e}(),Ie=function(){function e(t){this._binding=t}return e.prototype.onActivation=function(t){return this._binding.onActivation=t,new pr(this._binding)},e.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new pr(this._binding)},e}(),gt=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new pr(this._binding),this._bindingOnSyntax=new Ie(this._binding)}return e.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},e.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(t,n){return this._bindingWhenSyntax.whenTargetTagged(t,n)},e.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},e.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},e.prototype.whenParentTagged=function(t,n){return this._bindingWhenSyntax.whenParentTagged(t,n)},e.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},e.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},e.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},e.prototype.whenAnyAncestorTagged=function(t,n){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,n)},e.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},e.prototype.whenNoAncestorTagged=function(t,n){return this._bindingWhenSyntax.whenNoAncestorTagged(t,n)},e.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},e.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},e.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},e.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},e}(),kc=function(){function e(t){this._binding=t}return e.prototype.inRequestScope=function(){return this._binding.scope=Ee.Request,new gt(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=Ee.Transient,new gt(this._binding)},e}(),Ia=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new pr(this._binding),this._bindingOnSyntax=new Ie(this._binding),this._bindingInSyntax=new kc(t)}return e.prototype.inRequestScope=function(){return this._bindingInSyntax.inRequestScope()},e.prototype.inSingletonScope=function(){return this._bindingInSyntax.inSingletonScope()},e.prototype.inTransientScope=function(){return this._bindingInSyntax.inTransientScope()},e.prototype.when=function(t){return this._bindingWhenSyntax.when(t)},e.prototype.whenTargetNamed=function(t){return this._bindingWhenSyntax.whenTargetNamed(t)},e.prototype.whenTargetIsDefault=function(){return this._bindingWhenSyntax.whenTargetIsDefault()},e.prototype.whenTargetTagged=function(t,n){return this._bindingWhenSyntax.whenTargetTagged(t,n)},e.prototype.whenInjectedInto=function(t){return this._bindingWhenSyntax.whenInjectedInto(t)},e.prototype.whenParentNamed=function(t){return this._bindingWhenSyntax.whenParentNamed(t)},e.prototype.whenParentTagged=function(t,n){return this._bindingWhenSyntax.whenParentTagged(t,n)},e.prototype.whenAnyAncestorIs=function(t){return this._bindingWhenSyntax.whenAnyAncestorIs(t)},e.prototype.whenNoAncestorIs=function(t){return this._bindingWhenSyntax.whenNoAncestorIs(t)},e.prototype.whenAnyAncestorNamed=function(t){return this._bindingWhenSyntax.whenAnyAncestorNamed(t)},e.prototype.whenAnyAncestorTagged=function(t,n){return this._bindingWhenSyntax.whenAnyAncestorTagged(t,n)},e.prototype.whenNoAncestorNamed=function(t){return this._bindingWhenSyntax.whenNoAncestorNamed(t)},e.prototype.whenNoAncestorTagged=function(t,n){return this._bindingWhenSyntax.whenNoAncestorTagged(t,n)},e.prototype.whenAnyAncestorMatches=function(t){return this._bindingWhenSyntax.whenAnyAncestorMatches(t)},e.prototype.whenNoAncestorMatches=function(t){return this._bindingWhenSyntax.whenNoAncestorMatches(t)},e.prototype.onActivation=function(t){return this._bindingOnSyntax.onActivation(t)},e.prototype.onDeactivation=function(t){return this._bindingOnSyntax.onDeactivation(t)},e}(),jc=function(){function e(t){this._binding=t}return e.prototype.to=function(t){return this._binding.type=pe.Instance,this._binding.implementationType=t,new Ia(this._binding)},e.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error(""+Mu);var t=this._binding.serviceIdentifier;return this.to(t)},e.prototype.toConstantValue=function(t){return this._binding.type=pe.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toDynamicValue=function(t){return this._binding.type=pe.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new Ia(this._binding)},e.prototype.toConstructor=function(t){return this._binding.type=pe.Constructor,this._binding.implementationType=t,this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toFactory=function(t){return this._binding.type=pe.Factory,this._binding.factory=t,this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toFunction=function(t){if(typeof t!="function")throw new Error(Nu);var n=this.toConstantValue(t);return this._binding.type=pe.Function,this._binding.scope=Ee.Singleton,n},e.prototype.toAutoFactory=function(t){return this._binding.type=pe.Factory,this._binding.factory=function(n){var o=function(){return n.container.get(t)};return o},this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toAutoNamedFactory=function(t){return this._binding.type=pe.Factory,this._binding.factory=function(n){return function(o){return n.container.getNamed(t,o)}},new gt(this._binding)},e.prototype.toProvider=function(t){return this._binding.type=pe.Provider,this._binding.provider=t,this._binding.scope=Ee.Singleton,new gt(this._binding)},e.prototype.toService=function(t){this.toDynamicValue(function(n){return n.container.get(t)})},e}(),Lc=function(){function e(){}return e.of=function(t,n,o,a,u){var f=new e;return f.bindings=t,f.middleware=n,f.deactivations=a,f.activations=o,f.moduleActivationStore=u,f},e}();function Fc(e){return typeof e=="object"&&e!==null&&"clone"in e&&typeof e.clone=="function"}var Kt=function(){function e(){this._map=new Map}return e.prototype.getMap=function(){return this._map},e.prototype.add=function(t,n){if(t==null)throw new Error(Pn);if(n==null)throw new Error(Pn);var o=this._map.get(t);o!==void 0?o.push(n):this._map.set(t,[n])},e.prototype.get=function(t){if(t==null)throw new Error(Pn);var n=this._map.get(t);if(n!==void 0)return n;throw new Error(ua)},e.prototype.remove=function(t){if(t==null)throw new Error(Pn);if(!this._map.delete(t))throw new Error(ua)},e.prototype.removeIntersection=function(t){var n=this;this.traverse(function(o,a){var u=t.hasKey(o)?t.get(o):void 0;if(u!==void 0){var f=a.filter(function(g){return!u.some(function(S){return g===S})});n._setValue(o,f)}})},e.prototype.removeByCondition=function(t){var n=this,o=[];return this._map.forEach(function(a,u){for(var f=[],g=0,S=a;g<S.length;g++){var p=S[g],I=t(p);I?o.push(p):f.push(p)}n._setValue(u,f)}),o},e.prototype.hasKey=function(t){if(t==null)throw new Error(Pn);return this._map.has(t)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(n,o){n.forEach(function(a){return t.add(o,Fc(a)?a.clone():a)})}),t},e.prototype.traverse=function(t){this._map.forEach(function(n,o){t(o,n)})},e.prototype._setValue=function(t,n){n.length>0?this._map.set(t,n):this._map.delete(t)},e}(),Bc=function(){function e(){this._map=new Map}return e.prototype.remove=function(t){if(this._map.has(t)){var n=this._map.get(t);return this._map.delete(t),n}return this._getEmptyHandlersStore()},e.prototype.addDeactivation=function(t,n,o){this._getModuleActivationHandlers(t).onDeactivations.add(n,o)},e.prototype.addActivation=function(t,n,o){this._getModuleActivationHandlers(t).onActivations.add(n,o)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(n,o){t._map.set(o,{onActivations:n.onActivations.clone(),onDeactivations:n.onDeactivations.clone()})}),t},e.prototype._getModuleActivationHandlers=function(t){var n=this._map.get(t);return n===void 0&&(n=this._getEmptyHandlersStore(),this._map.set(t,n)),n},e.prototype._getEmptyHandlersStore=function(){var t={onActivations:new Kt,onDeactivations:new Kt};return t},e}(),gr=function(){return gr=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},gr.apply(this,arguments)},Je=function(e,t,n,o){function a(u){return u instanceof n?u:new n(function(f){f(u)})}return new(n||(n=Promise))(function(u,f){function g(I){try{p(o.next(I))}catch(P){f(P)}}function S(I){try{p(o.throw(I))}catch(P){f(P)}}function p(I){I.done?u(I.value):a(I.value).then(g,S)}p((o=o.apply(e,t||[])).next())})},Xe=function(e,t){var n={label:0,sent:function(){if(u[0]&1)throw u[1];return u[1]},trys:[],ops:[]},o,a,u,f;return f={next:g(0),throw:g(1),return:g(2)},typeof Symbol=="function"&&(f[Symbol.iterator]=function(){return this}),f;function g(p){return function(I){return S([p,I])}}function S(p){if(o)throw new TypeError("Generator is already executing.");for(;n;)try{if(o=1,a&&(u=p[0]&2?a.return:p[0]?a.throw||((u=a.return)&&u.call(a),0):a.next)&&!(u=u.call(a,p[1])).done)return u;switch(a=0,u&&(p=[p[0]&2,u.value]),p[0]){case 0:case 1:u=p;break;case 4:return n.label++,{value:p[1],done:!1};case 5:n.label++,a=p[1],p=[0];continue;case 7:p=n.ops.pop(),n.trys.pop();continue;default:if(u=n.trys,!(u=u.length>0&&u[u.length-1])&&(p[0]===6||p[0]===2)){n=0;continue}if(p[0]===3&&(!u||p[1]>u[0]&&p[1]<u[3])){n.label=p[1];break}if(p[0]===6&&n.label<u[1]){n.label=u[1],u=p;break}if(u&&n.label<u[2]){n.label=u[2],n.ops.push(p);break}u[2]&&n.ops.pop(),n.trys.pop();continue}p=t.call(e,n)}catch(I){p=[6,I],a=0}finally{o=u=0}if(p[0]&5)throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}},Kc=function(e,t,n){if(n||arguments.length===2)for(var o=0,a=t.length,u;o<a;o++)(u||!(o in t))&&(u||(u=Array.prototype.slice.call(t,0,o)),u[o]=t[o]);return e.concat(u||Array.prototype.slice.call(t))},Vc=function(){function e(t){var n=t||{};if(typeof n!="object")throw new Error(""+ju);if(n.defaultScope===void 0)n.defaultScope=Ee.Transient;else if(n.defaultScope!==Ee.Singleton&&n.defaultScope!==Ee.Transient&&n.defaultScope!==Ee.Request)throw new Error(""+Lu);if(n.autoBindInjectable===void 0)n.autoBindInjectable=!1;else if(typeof n.autoBindInjectable!="boolean")throw new Error(""+Fu);if(n.skipBaseClassChecks===void 0)n.skipBaseClassChecks=!1;else if(typeof n.skipBaseClassChecks!="boolean")throw new Error(""+Bu);this.options={autoBindInjectable:n.autoBindInjectable,defaultScope:n.defaultScope,skipBaseClassChecks:n.skipBaseClassChecks},this.id=Cn(),this._bindingDictionary=new Kt,this._snapshots=[],this._middleware=null,this._activations=new Kt,this._deactivations=new Kt,this.parent=null,this._metadataReader=new qu,this._moduleActivationStore=new Bc}return e.merge=function(t,n){for(var o=[],a=2;a<arguments.length;a++)o[a-2]=arguments[a];var u=new e,f=Kc([t,n],o,!0).map(function(p){return hr(p)}),g=hr(u);function S(p,I){p.traverse(function(P,B){B.forEach(function(Q){I.add(Q.serviceIdentifier,Q.clone())})})}return f.forEach(function(p){S(p,g)}),u},e.prototype.load=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var o=this._getContainerModuleHelpersFactory(),a=0,u=t;a<u.length;a++){var f=u[a],g=o(f.id);f.registry(g.bindFunction,g.unbindFunction,g.isboundFunction,g.rebindFunction,g.unbindAsyncFunction,g.onActivationFunction,g.onDeactivationFunction)}},e.prototype.loadAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Je(this,void 0,void 0,function(){var o,a,u,f,g;return Xe(this,function(S){switch(S.label){case 0:o=this._getContainerModuleHelpersFactory(),a=0,u=t,S.label=1;case 1:return a<u.length?(f=u[a],g=o(f.id),[4,f.registry(g.bindFunction,g.unbindFunction,g.isboundFunction,g.rebindFunction,g.unbindAsyncFunction,g.onActivationFunction,g.onDeactivationFunction)]):[3,4];case 2:S.sent(),S.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},e.prototype.unload=function(){for(var t=this,n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];n.forEach(function(a){var u=t._removeModuleBindings(a.id);t._deactivateSingletons(u),t._removeModuleHandlers(a.id)})},e.prototype.unloadAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return Je(this,void 0,void 0,function(){var o,a,u,f;return Xe(this,function(g){switch(g.label){case 0:o=0,a=t,g.label=1;case 1:return o<a.length?(u=a[o],f=this._removeModuleBindings(u.id),[4,this._deactivateSingletonsAsync(f)]):[3,4];case 2:g.sent(),this._removeModuleHandlers(u.id),g.label=3;case 3:return o++,[3,1];case 4:return[2]}})})},e.prototype.bind=function(t){var n=this.options.defaultScope||Ee.Transient,o=new wu(t,n);return this._bindingDictionary.add(t,o),new jc(o)},e.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},e.prototype.rebindAsync=function(t){return Je(this,void 0,void 0,function(){return Xe(this,function(n){switch(n.label){case 0:return[4,this.unbindAsync(t)];case 1:return n.sent(),[2,this.bind(t)]}})})},e.prototype.unbind=function(t){if(this._bindingDictionary.hasKey(t)){var n=this._bindingDictionary.get(t);this._deactivateSingletons(n)}this._removeServiceFromDictionary(t)},e.prototype.unbindAsync=function(t){return Je(this,void 0,void 0,function(){var n;return Xe(this,function(o){switch(o.label){case 0:return this._bindingDictionary.hasKey(t)?(n=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(n)]):[3,2];case 1:o.sent(),o.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}})})},e.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse(function(n,o){t._deactivateSingletons(o)}),this._bindingDictionary=new Kt},e.prototype.unbindAllAsync=function(){return Je(this,void 0,void 0,function(){var t,n=this;return Xe(this,function(o){switch(o.label){case 0:return t=[],this._bindingDictionary.traverse(function(a,u){t.push(n._deactivateSingletonsAsync(u))}),[4,Promise.all(t)];case 1:return o.sent(),this._bindingDictionary=new Kt,[2]}})})},e.prototype.onActivation=function(t,n){this._activations.add(t,n)},e.prototype.onDeactivation=function(t,n){this._deactivations.add(t,n)},e.prototype.isBound=function(t){var n=this._bindingDictionary.hasKey(t);return!n&&this.parent&&(n=this.parent.isBound(t)),n},e.prototype.isCurrentBound=function(t){return this._bindingDictionary.hasKey(t)},e.prototype.isBoundNamed=function(t,n){return this.isBoundTagged(t,qe,n)},e.prototype.isBoundTagged=function(t,n,o){var a=!1;if(this._bindingDictionary.hasKey(t)){var u=this._bindingDictionary.get(t),f=ac(this,t,n,o);a=u.some(function(g){return g.constraint(f)})}return!a&&this.parent&&(a=this.parent.isBoundTagged(t,n,o)),a},e.prototype.snapshot=function(){this._snapshots.push(Lc.of(this._bindingDictionary.clone(),this._middleware,this._activations.clone(),this._deactivations.clone(),this._moduleActivationStore.clone()))},e.prototype.restore=function(){var t=this._snapshots.pop();if(t===void 0)throw new Error(Iu);this._bindingDictionary=t.bindings,this._activations=t.activations,this._deactivations=t.deactivations,this._middleware=t.middleware,this._moduleActivationStore=t.moduleActivationStore},e.prototype.createChild=function(t){var n=new e(t||this.options);return n.parent=this,n},e.prototype.applyMiddleware=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var o=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce(function(a,u){return u(a)},o)},e.prototype.applyCustomMetadataReader=function(t){this._metadataReader=t},e.prototype.get=function(t){var n=this._getNotAllArgs(t,!1);return this._getButThrowIfAsync(n)},e.prototype.getAsync=function(t){return Je(this,void 0,void 0,function(){var n;return Xe(this,function(o){return n=this._getNotAllArgs(t,!1),[2,this._get(n)]})})},e.prototype.getTagged=function(t,n,o){var a=this._getNotAllArgs(t,!1,n,o);return this._getButThrowIfAsync(a)},e.prototype.getTaggedAsync=function(t,n,o){return Je(this,void 0,void 0,function(){var a;return Xe(this,function(u){return a=this._getNotAllArgs(t,!1,n,o),[2,this._get(a)]})})},e.prototype.getNamed=function(t,n){return this.getTagged(t,qe,n)},e.prototype.getNamedAsync=function(t,n){return this.getTaggedAsync(t,qe,n)},e.prototype.getAll=function(t){var n=this._getAllArgs(t);return this._getButThrowIfAsync(n)},e.prototype.getAllAsync=function(t){var n=this._getAllArgs(t);return this._getAll(n)},e.prototype.getAllTagged=function(t,n,o){var a=this._getNotAllArgs(t,!0,n,o);return this._getButThrowIfAsync(a)},e.prototype.getAllTaggedAsync=function(t,n,o){var a=this._getNotAllArgs(t,!0,n,o);return this._getAll(a)},e.prototype.getAllNamed=function(t,n){return this.getAllTagged(t,qe,n)},e.prototype.getAllNamedAsync=function(t,n){return this.getAllTaggedAsync(t,qe,n)},e.prototype.resolve=function(t){var n=this.isBound(t);n||this.bind(t).toSelf();var o=this.get(t);return n||this.unbind(t),o},e.prototype._preDestroy=function(t,n){var o,a;if(Reflect.hasMetadata(xi,t)){var u=Reflect.getMetadata(xi,t);return(a=(o=n)[u.value])===null||a===void 0?void 0:a.call(o)}},e.prototype._removeModuleHandlers=function(t){var n=this._moduleActivationStore.remove(t);this._activations.removeIntersection(n.onActivations),this._deactivations.removeIntersection(n.onDeactivations)},e.prototype._removeModuleBindings=function(t){return this._bindingDictionary.removeByCondition(function(n){return n.moduleId===t})},e.prototype._deactivate=function(t,n){var o=this,a=Object.getPrototypeOf(n).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var u=this._deactivateContainer(n,this._deactivations.get(t.serviceIdentifier).values());if(Be(u))return this._handleDeactivationError(u.then(function(){return o._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,n,a)}),a)}var f=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,n,a);if(Be(f))return this._handleDeactivationError(f,a)}catch(g){if(g instanceof Error)throw new Error(Ai(a.name,g.message))}},e.prototype._handleDeactivationError=function(t,n){return Je(this,void 0,void 0,function(){var o;return Xe(this,function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,t];case 1:return a.sent(),[3,3];case 2:if(o=a.sent(),o instanceof Error)throw new Error(Ai(n.name,o.message));return[3,3];case 3:return[2]}})})},e.prototype._deactivateContainer=function(t,n){for(var o=this,a=n.next();a.value;){var u=a.value(t);if(Be(u))return u.then(function(){return o._deactivateContainerAsync(t,n)});a=n.next()}},e.prototype._deactivateContainerAsync=function(t,n){return Je(this,void 0,void 0,function(){var o;return Xe(this,function(a){switch(a.label){case 0:o=n.next(),a.label=1;case 1:return o.value?[4,o.value(t)]:[3,3];case 2:return a.sent(),o=n.next(),[3,1];case 3:return[2]}})})},e.prototype._getContainerModuleHelpersFactory=function(){var t=this,n=function(I,P){I._binding.moduleId=P},o=function(I){return function(P){var B=t.bind(P);return n(B,I),B}},a=function(){return function(I){return t.unbind(I)}},u=function(){return function(I){return t.unbindAsync(I)}},f=function(){return function(I){return t.isBound(I)}},g=function(I){return function(P){var B=t.rebind(P);return n(B,I),B}},S=function(I){return function(P,B){t._moduleActivationStore.addActivation(I,P,B),t.onActivation(P,B)}},p=function(I){return function(P,B){t._moduleActivationStore.addDeactivation(I,P,B),t.onDeactivation(P,B)}};return function(I){return{bindFunction:o(I),isboundFunction:f(),onActivationFunction:S(I),onDeactivationFunction:p(I),rebindFunction:g(I),unbindFunction:a(),unbindAsyncFunction:u()}}},e.prototype._getAll=function(t){return Promise.all(this._get(t))},e.prototype._get=function(t){var n=gr(gr({},t),{contextInterceptor:function(a){return a},targetType:An.Variable});if(this._middleware){var o=this._middleware(n);if(o==null)throw new Error(Du);return o}return this._planAndResolve()(n)},e.prototype._getButThrowIfAsync=function(t){var n=this._get(t);if(Ea(n))throw new Error(Ru(t.serviceIdentifier));return n},e.prototype._getAllArgs=function(t){var n={avoidConstraints:!0,isMultiInject:!0,serviceIdentifier:t};return n},e.prototype._getNotAllArgs=function(t,n,o,a){var u={avoidConstraints:!1,isMultiInject:n,serviceIdentifier:t,key:o,value:a};return u},e.prototype._planAndResolve=function(){var t=this;return function(n){var o=oc(t._metadataReader,t,n.isMultiInject,n.targetType,n.serviceIdentifier,n.key,n.value,n.avoidConstraints);o=n.contextInterceptor(o);var a=Mc(o);return a}},e.prototype._deactivateIfSingleton=function(t){var n=this;if(t.activated)return Be(t.cache)?t.cache.then(function(o){return n._deactivate(t,o)}):this._deactivate(t,t.cache)},e.prototype._deactivateSingletons=function(t){for(var n=0,o=t;n<o.length;n++){var a=o[n],u=this._deactivateIfSingleton(a);if(Be(u))throw new Error(Ku)}},e.prototype._deactivateSingletonsAsync=function(t){return Je(this,void 0,void 0,function(){var n=this;return Xe(this,function(o){switch(o.label){case 0:return[4,Promise.all(t.map(function(a){return n._deactivateIfSingleton(a)}))];case 1:return o.sent(),[2]}})})},e.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,n,o){return this.parent?this._deactivate.bind(this.parent)(t,n):this._bindingDeactivationAndPreDestroy(t,n,o)},e.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,n,o){return Je(this,void 0,void 0,function(){return Xe(this,function(a){switch(a.label){case 0:return this.parent?[4,this._deactivate.bind(this.parent)(t,n)]:[3,2];case 1:return a.sent(),[3,4];case 2:return[4,this._bindingDeactivationAndPreDestroyAsync(t,n,o)];case 3:a.sent(),a.label=4;case 4:return[2]}})})},e.prototype._removeServiceFromDictionary=function(t){try{this._bindingDictionary.remove(t)}catch{throw new Error(Ou+" "+Tn(t))}},e.prototype._bindingDeactivationAndPreDestroy=function(t,n,o){var a=this;if(typeof t.onDeactivation=="function"){var u=t.onDeactivation(n);if(Be(u))return u.then(function(){return a._preDestroy(o,n)})}return this._preDestroy(o,n)},e.prototype._bindingDeactivationAndPreDestroyAsync=function(t,n,o){return Je(this,void 0,void 0,function(){return Xe(this,function(a){switch(a.label){case 0:return typeof t.onDeactivation!="function"?[3,2]:[4,t.onDeactivation(n)];case 1:a.sent(),a.label=2;case 2:return[4,this._preDestroy(o,n)];case 3:return a.sent(),[2]}})})},e}();function Wc(e){for(var t=new Set,n=0,o=e;n<o.length;n++){var a=o[n];if(t.has(a))return a;t.add(a)}}function $c(e){return e.prototype!==void 0}function Uc(e){if(e!==void 0)throw new Error(la)}function Da(e,t,n,o){Uc(t),Na(ra,e,n.toString(),o)}function qc(e,t,n){if($c(e))throw new Error(la);Na(ia,e.constructor,t,n)}function zc(e){var t=[];if(Array.isArray(e)){t=e;var n=Wc(t.map(function(o){return o.key}));if(n!==void 0)throw new Error(sa+" "+n.toString())}else t=[e];return t}function Na(e,t,n,o){var a=zc(o),u={};Reflect.hasOwnMetadata(e,t)&&(u=Reflect.getMetadata(e,t));var f=u[n];if(f===void 0)f=[];else for(var g=function(P){if(a.some(function(B){return B.key===P.key}))throw new Error(sa+" "+P.key.toString())},S=0,p=f;S<p.length;S++){var I=p[S];g(I)}f.push.apply(f,a),u[n]=f,Reflect.defineMetadata(e,u,t)}function Ra(e){return function(t,n,o){typeof o=="number"?Da(t,n,o,e):qc(t,n,e)}}function Ke(){return function(e){if(Reflect.hasOwnMetadata(Oi,e))throw new Error(Eu);var t=Reflect.getMetadata(mu,e)||[];return Reflect.defineMetadata(Oi,t,e),e}}function Ma(e){return Ra(new dt(qe,e))}function Hc(e){return function(t){return function(n,o,a){if(t===void 0){var u=typeof n=="function"?n.name:n.constructor.name;throw new Error(Cu(u))}return Ra(new dt(e,t))(n,o,a)}}}var je=Hc(sr);function Gc(){return function(e,t,n){var o=new dt(ar,!0);Da(e,t,n,o)}}var vr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yc(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}/*! *****************************************************************************
|
|
12
|
+
Copyright (C) Microsoft. All rights reserved.
|
|
13
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
14
|
+
this file except in compliance with the License. You may obtain a copy of the
|
|
15
|
+
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
+
|
|
17
|
+
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
18
|
+
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
19
|
+
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
20
|
+
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
21
|
+
|
|
22
|
+
See the Apache Version 2.0 License for specific language governing permissions
|
|
23
|
+
and limitations under the License.
|
|
24
|
+
***************************************************************************** */var ka;(function(e){(function(t){var n=typeof globalThis=="object"?globalThis:typeof vr=="object"?vr:typeof self=="object"?self:typeof this=="object"?this:g(),o=a(e);typeof n.Reflect<"u"&&(o=a(n.Reflect,o)),t(o,n),typeof n.Reflect>"u"&&(n.Reflect=e);function a(S,p){return function(I,P){Object.defineProperty(S,I,{configurable:!0,writable:!0,value:P}),p&&p(I,P)}}function u(){try{return Function("return this;")()}catch{}}function f(){try{return(0,eval)("(function() { return this; })()")}catch{}}function g(){return u()||f()}})(function(t,n){var o=Object.prototype.hasOwnProperty,a=typeof Symbol=="function",u=a&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",f=a&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",g=typeof Object.create=="function",S={__proto__:[]}instanceof Array,p=!g&&!S,I={create:g?function(){return Dt(Object.create(null))}:S?function(){return Dt({__proto__:null})}:function(){return Dt({})},has:p?function(C,D){return o.call(C,D)}:function(C,D){return D in C},get:p?function(C,D){return o.call(C,D)?C[D]:void 0}:function(C,D){return C[D]}},P=Object.getPrototypeOf(Function),B=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Un(),Q=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Jt(),Z=typeof WeakMap=="function"?WeakMap:qn(),fe=a?Symbol.for("@reflect-metadata:registry"):void 0,ze=Yt(),We=Jr(ze);function $e(C,D,j,K){if(J(j)){if(!Gt(C))throw new TypeError;if(!It(D))throw new TypeError;return zt(C,D)}else{if(!Gt(C))throw new TypeError;if(!ye(D))throw new TypeError;if(!ye(K)&&!J(K)&&!He(K))throw new TypeError;return He(K)&&(K=void 0),j=Ge(j),ct(C,D,j,K)}}t("decorate",$e);function mt(C,D){function j(K,F){if(!ye(K))throw new TypeError;if(!J(F)&&!yo(F))throw new TypeError;lt(C,D,K,F)}return j}t("metadata",mt);function Se(C,D,j,K){if(!ye(j))throw new TypeError;return J(K)||(K=Ge(K)),lt(C,D,j,K)}t("defineMetadata",Se);function Pt(C,D,j){if(!ye(D))throw new TypeError;return J(j)||(j=Ge(j)),Wr(C,D,j)}t("hasMetadata",Pt);function te(C,D,j){if(!ye(D))throw new TypeError;return J(j)||(j=Ge(j)),Ht(C,D,j)}t("hasOwnMetadata",te);function Ce(C,D,j){if(!ye(D))throw new TypeError;return J(j)||(j=Ge(j)),yn(C,D,j)}t("getMetadata",Ce);function vn(C,D,j){if(!ye(D))throw new TypeError;return J(j)||(j=Ge(j)),$r(C,D,j)}t("getOwnMetadata",vn);function vo(C,D){if(!ye(C))throw new TypeError;return J(D)||(D=Ge(D)),bt(C,D)}t("getMetadataKeys",vo);function Kr(C,D){if(!ye(C))throw new TypeError;return J(D)||(D=Ge(D)),et(C,D)}t("getOwnMetadataKeys",Kr);function Vr(C,D,j){if(!ye(D))throw new TypeError;if(J(j)||(j=Ge(j)),!ye(D))throw new TypeError;J(j)||(j=Ge(j));var K=at(D,j,!1);return J(K)?!1:K.OrdinaryDeleteMetadata(C,D,j)}t("deleteMetadata",Vr);function zt(C,D){for(var j=C.length-1;j>=0;--j){var K=C[j],F=K(D);if(!J(F)&&!He(F)){if(!It(F))throw new TypeError;D=F}}return D}function ct(C,D,j,K){for(var F=C.length-1;F>=0;--F){var me=C[F],de=me(D,j,K);if(!J(de)&&!He(de)){if(!ye(de))throw new TypeError;K=de}}return K}function Wr(C,D,j){var K=Ht(C,D,j);if(K)return!0;var F=Ue(D);return He(F)?!1:Wr(C,F,j)}function Ht(C,D,j){var K=at(D,j,!1);return J(K)?!1:qr(K.OrdinaryHasOwnMetadata(C,D,j))}function yn(C,D,j){var K=Ht(C,D,j);if(K)return $r(C,D,j);var F=Ue(D);if(!He(F))return yn(C,F,j)}function $r(C,D,j){var K=at(D,j,!1);if(!J(K))return K.OrdinaryGetOwnMetadata(C,D,j)}function lt(C,D,j,K){var F=at(j,K,!0);F.OrdinaryDefineOwnMetadata(C,D,j,K)}function bt(C,D){var j=et(C,D),K=Ue(C);if(K===null)return j;var F=bt(K,D);if(F.length<=0)return j;if(j.length<=0)return F;for(var me=new Q,de=[],ee=0,R=j;ee<R.length;ee++){var z=R[ee],H=me.has(z);H||(me.add(z),de.push(z))}for(var G=0,ne=F;G<ne.length;G++){var z=ne[G],H=me.has(z);H||(me.add(z),de.push(z))}return de}function et(C,D){var j=at(C,D,!1);return j?j.OrdinaryOwnMetadataKeys(C,D):[]}function mn(C){if(C===null)return 1;switch(typeof C){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return C===null?1:6;default:return 6}}function J(C){return C===void 0}function He(C){return C===null}function Ur(C){return typeof C=="symbol"}function ye(C){return typeof C=="object"?C!==null:typeof C=="function"}function Tt(C,D){switch(mn(C)){case 0:return C;case 1:return C;case 2:return C;case 3:return C;case 4:return C;case 5:return C}var j="string",K=zr(C,u);if(K!==void 0){var F=K.call(C,j);if(ye(F))throw new TypeError;return F}return $n(C)}function $n(C,D){var j,K;{var F=C.toString;if(se(F)){var K=F.call(C);if(!ye(K))return K}var j=C.valueOf;if(se(j)){var K=j.call(C);if(!ye(K))return K}}throw new TypeError}function qr(C){return!!C}function Y(C){return""+C}function Ge(C){var D=Tt(C);return Ur(D)?D:Y(D)}function Gt(C){return Array.isArray?Array.isArray(C):C instanceof Object?C instanceof Array:Object.prototype.toString.call(C)==="[object Array]"}function se(C){return typeof C=="function"}function It(C){return typeof C=="function"}function yo(C){switch(mn(C)){case 3:return!0;case 4:return!0;default:return!1}}function ot(C,D){return C===D||C!==C&&D!==D}function zr(C,D){var j=C[D];if(j!=null){if(!se(j))throw new TypeError;return j}}function Hr(C){var D=zr(C,f);if(!se(D))throw new TypeError;var j=D.call(C);if(!ye(j))throw new TypeError;return j}function Gr(C){return C.value}function Yr(C){var D=C.next();return D.done?!1:D}function bn(C){var D=C.return;D&&D.call(C)}function Ue(C){var D=Object.getPrototypeOf(C);if(typeof C!="function"||C===P||D!==P)return D;var j=C.prototype,K=j&&Object.getPrototypeOf(j);if(K==null||K===Object.prototype)return D;var F=K.constructor;return typeof F!="function"||F===C?D:F}function Qr(){var C;!J(fe)&&typeof n.Reflect<"u"&&!(fe in n.Reflect)&&typeof n.Reflect.defineMetadata=="function"&&(C=Qt(n.Reflect));var D,j,K,F=new Z,me={registerProvider:de,getProvider:R,setProvider:H};return me;function de(G){if(!Object.isExtensible(me))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case C===G:break;case J(D):D=G;break;case D===G:break;case J(j):j=G;break;case j===G:break;default:K===void 0&&(K=new Q),K.add(G);break}}function ee(G,ne){if(!J(D)){if(D.isProviderFor(G,ne))return D;if(!J(j)){if(j.isProviderFor(G,ne))return D;if(!J(K))for(var he=Hr(K);;){var we=Yr(he);if(!we)return;var Ye=Gr(we);if(Ye.isProviderFor(G,ne))return bn(he),Ye}}}if(!J(C)&&C.isProviderFor(G,ne))return C}function R(G,ne){var he=F.get(G),we;return J(he)||(we=he.get(ne)),J(we)&&(we=ee(G,ne),J(we)||(J(he)&&(he=new B,F.set(G,he)),he.set(ne,we))),we}function z(G){if(J(G))throw new TypeError;return D===G||j===G||!J(K)&&K.has(G)}function H(G,ne,he){if(!z(he))throw new Error("Metadata provider not registered.");var we=R(G,ne);if(we!==he){if(!J(we))return!1;var Ye=F.get(G);J(Ye)&&(Ye=new B,F.set(G,Ye)),Ye.set(ne,he)}return!0}}function Yt(){var C;return!J(fe)&&ye(n.Reflect)&&Object.isExtensible(n.Reflect)&&(C=n.Reflect[fe]),J(C)&&(C=Qr()),!J(fe)&&ye(n.Reflect)&&Object.isExtensible(n.Reflect)&&Object.defineProperty(n.Reflect,fe,{enumerable:!1,configurable:!1,writable:!1,value:C}),C}function Jr(C){var D=new Z,j={isProviderFor:function(z,H){var G=D.get(z);return J(G)?!1:G.has(H)},OrdinaryDefineOwnMetadata:de,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:me,OrdinaryOwnMetadataKeys:ee,OrdinaryDeleteMetadata:R};return ze.registerProvider(j),j;function K(z,H,G){var ne=D.get(z),he=!1;if(J(ne)){if(!G)return;ne=new B,D.set(z,ne),he=!0}var we=ne.get(H);if(J(we)){if(!G)return;if(we=new B,ne.set(H,we),!C.setProvider(z,H,j))throw ne.delete(H),he&&D.delete(z),new Error("Wrong provider for target.")}return we}function F(z,H,G){var ne=K(H,G,!1);return J(ne)?!1:qr(ne.has(z))}function me(z,H,G){var ne=K(H,G,!1);if(!J(ne))return ne.get(z)}function de(z,H,G,ne){var he=K(G,ne,!0);he.set(z,H)}function ee(z,H){var G=[],ne=K(z,H,!1);if(J(ne))return G;for(var he=ne.keys(),we=Hr(he),Ye=0;;){var _t=Yr(we);if(!_t)return G.length=Ye,G;var Nt=Gr(_t);try{G[Ye]=Nt}catch(zn){try{bn(we)}finally{throw zn}}Ye++}}function R(z,H,G){var ne=K(H,G,!1);if(J(ne)||!ne.delete(z))return!1;if(ne.size===0){var he=D.get(H);J(he)||(he.delete(G),he.size===0&&D.delete(he))}return!0}}function Qt(C){var D=C.defineMetadata,j=C.hasOwnMetadata,K=C.getOwnMetadata,F=C.getOwnMetadataKeys,me=C.deleteMetadata,de=new Z,ee={isProviderFor:function(R,z){var H=de.get(R);return!J(H)&&H.has(z)?!0:F(R,z).length?(J(H)&&(H=new Q,de.set(R,H)),H.add(z),!0):!1},OrdinaryDefineOwnMetadata:D,OrdinaryHasOwnMetadata:j,OrdinaryGetOwnMetadata:K,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:me};return ee}function at(C,D,j){var K=ze.getProvider(C,D);if(!J(K))return K;if(j){if(ze.setProvider(C,D,We))return We;throw new Error("Illegal state.")}}function Un(){var C={},D=[],j=function(){function ee(R,z,H){this._index=0,this._keys=R,this._values=z,this._selector=H}return ee.prototype["@@iterator"]=function(){return this},ee.prototype[f]=function(){return this},ee.prototype.next=function(){var R=this._index;if(R>=0&&R<this._keys.length){var z=this._selector(this._keys[R],this._values[R]);return R+1>=this._keys.length?(this._index=-1,this._keys=D,this._values=D):this._index++,{value:z,done:!1}}return{value:void 0,done:!0}},ee.prototype.throw=function(R){throw this._index>=0&&(this._index=-1,this._keys=D,this._values=D),R},ee.prototype.return=function(R){return this._index>=0&&(this._index=-1,this._keys=D,this._values=D),{value:R,done:!0}},ee}(),K=function(){function ee(){this._keys=[],this._values=[],this._cacheKey=C,this._cacheIndex=-2}return Object.defineProperty(ee.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ee.prototype.has=function(R){return this._find(R,!1)>=0},ee.prototype.get=function(R){var z=this._find(R,!1);return z>=0?this._values[z]:void 0},ee.prototype.set=function(R,z){var H=this._find(R,!0);return this._values[H]=z,this},ee.prototype.delete=function(R){var z=this._find(R,!1);if(z>=0){for(var H=this._keys.length,G=z+1;G<H;G++)this._keys[G-1]=this._keys[G],this._values[G-1]=this._values[G];return this._keys.length--,this._values.length--,ot(R,this._cacheKey)&&(this._cacheKey=C,this._cacheIndex=-2),!0}return!1},ee.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=C,this._cacheIndex=-2},ee.prototype.keys=function(){return new j(this._keys,this._values,F)},ee.prototype.values=function(){return new j(this._keys,this._values,me)},ee.prototype.entries=function(){return new j(this._keys,this._values,de)},ee.prototype["@@iterator"]=function(){return this.entries()},ee.prototype[f]=function(){return this.entries()},ee.prototype._find=function(R,z){if(!ot(this._cacheKey,R)){this._cacheIndex=-1;for(var H=0;H<this._keys.length;H++)if(ot(this._keys[H],R)){this._cacheIndex=H;break}}return this._cacheIndex<0&&z&&(this._cacheIndex=this._keys.length,this._keys.push(R),this._values.push(void 0)),this._cacheIndex},ee}();return K;function F(ee,R){return ee}function me(ee,R){return R}function de(ee,R){return[ee,R]}}function Jt(){var C=function(){function D(){this._map=new B}return Object.defineProperty(D.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),D.prototype.has=function(j){return this._map.has(j)},D.prototype.add=function(j){return this._map.set(j,j),this},D.prototype.delete=function(j){return this._map.delete(j)},D.prototype.clear=function(){this._map.clear()},D.prototype.keys=function(){return this._map.keys()},D.prototype.values=function(){return this._map.keys()},D.prototype.entries=function(){return this._map.entries()},D.prototype["@@iterator"]=function(){return this.keys()},D.prototype[f]=function(){return this.keys()},D}();return C}function qn(){var C=16,D=I.create(),j=K();return function(){function R(){this._key=K()}return R.prototype.has=function(z){var H=F(z,!1);return H!==void 0?I.has(H,this._key):!1},R.prototype.get=function(z){var H=F(z,!1);return H!==void 0?I.get(H,this._key):void 0},R.prototype.set=function(z,H){var G=F(z,!0);return G[this._key]=H,this},R.prototype.delete=function(z){var H=F(z,!1);return H!==void 0?delete H[this._key]:!1},R.prototype.clear=function(){this._key=K()},R}();function K(){var R;do R="@@WeakMap@@"+ee();while(I.has(D,R));return D[R]=!0,R}function F(R,z){if(!o.call(R,j)){if(!z)return;Object.defineProperty(R,j,{value:I.create()})}return R[j]}function me(R,z){for(var H=0;H<z;++H)R[H]=Math.random()*255|0;return R}function de(R){if(typeof Uint8Array=="function"){var z=new Uint8Array(R);return typeof crypto<"u"?crypto.getRandomValues(z):typeof msCrypto<"u"?msCrypto.getRandomValues(z):me(z,R),z}return me(new Array(R),R)}function ee(){var R=de(C);R[6]=R[6]&79|64,R[8]=R[8]&191|128;for(var z="",H=0;H<C;++H){var G=R[H];(H===4||H===6||H===8)&&(z+="-"),G<16&&(z+="0"),z+=G.toString(16).toLowerCase()}return z}}function Dt(C){return C.__=void 0,delete C.__,C}})})(ka||(ka={}));var Qc=Object.defineProperty,Jc=Object.getOwnPropertyDescriptor,Xc=(e,t,n,o)=>{for(var a=o>1?void 0:o?Jc(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Qc(t,n,a),a};let Ii=class{constructor(){this.name="component.name",this.hint="default",this.priority=1e3,this.singleton=!1}getName(){return this.name}getHint(){return this.hint}getPriority(){return this.priority}isSingleton(){return this.singleton}};Ii=Xc([Ke()],Ii);/**
|
|
25
|
+
* See the LICENSE file distributed with this work for additional
|
|
26
|
+
* information regarding copyright ownership.
|
|
27
|
+
*
|
|
28
|
+
* This is free software; you can redistribute it and/or modify it
|
|
29
|
+
* under the terms of the GNU Affero General Public License as
|
|
30
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
31
|
+
* the License, or (at your option) any later version.
|
|
32
|
+
*
|
|
33
|
+
* This software is distributed in the hope that it will be useful,
|
|
34
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
35
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
36
|
+
* Lesser General Public License for more details.
|
|
37
|
+
*
|
|
38
|
+
* You should have received a copy of the GNU Affero General Public
|
|
39
|
+
* License along with this software; if not, write to the Free
|
|
40
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
41
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
42
|
+
*
|
|
43
|
+
* This file is part of the Cristal Wiki software prototype
|
|
44
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
45
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
46
|
+
*
|
|
47
|
+
**/class Zc{constructor(t,n,o){this.name=t,this.entryFile=n,this.staticModule=o}}var el=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,nl=(e,t,n,o)=>{for(var a=o>1?void 0:o?tl(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&el(t,n,a),a},rl=(e,t)=>(n,o)=>t(n,o,e);let Di=class extends Ii{constructor(e){super(),this.remoteExtensions=new Map,this.remoteExtensionDefaultURL="/apps/",this.remoteExtensionDefaultEntryFile="main.bundle.js",this.logger=e,this.logger.setModule("extensionmanager.components.defaultExtensionManager")}addRemoteExtension(e,t,n){this.remoteExtensions.set(e,new Zc(e,t,n))}setRemoteExtensionsConfig(e,t){this.remoteExtensionDefaultURL=e,this.remoteExtensionDefaultEntryFile=t}async loadExtension(e,t){var n,o,a,u,f;try{const g=this.remoteExtensions.get(e),S=g&&g.entryFile?g.entryFile:this.remoteExtensionDefaultEntryFile,p=this.remoteExtensionDefaultURL+e+"/"+S,I=this.remoteExtensionDefaultURL+e+"/style.css";(n=this.logger)==null||n.debug("Ready to import ",p);try{const B=await import(I);document.adoptedStyleSheets=[B.default]}catch{}const P=await import(p);if(P!=null){(o=this.logger)==null||o.debug("Found components Init for ",e,P);const B=P.ComponentInit;new B(t),(a=this.logger)==null||a.debug("Succesfull components Init for ",e)}else(u=this.logger)==null||u.debug("No components to load for ",e);return}catch(g){(f=this.logger)==null||f.error("Exception while loading components from ",e,g)}}async loadExtensions(e){for(const t of this.remoteExtensions.keys())await this.loadExtension(t,e)}};Di=nl([Ke(),rl(0,je("Logger"))],Di);/**
|
|
48
|
+
* See the LICENSE file distributed with this work for additional
|
|
49
|
+
* information regarding copyright ownership.
|
|
50
|
+
*
|
|
51
|
+
* This is free software; you can redistribute it and/or modify it
|
|
52
|
+
* under the terms of the GNU Affero General Public License as
|
|
53
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
54
|
+
* the License, or (at your option) any later version.
|
|
55
|
+
*
|
|
56
|
+
* This software is distributed in the hope that it will be useful,
|
|
57
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
58
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
59
|
+
* Lesser General Public License for more details.
|
|
60
|
+
*
|
|
61
|
+
* You should have received a copy of the GNU Affero General Public
|
|
62
|
+
* License along with this software; if not, write to the Free
|
|
63
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
64
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
65
|
+
*
|
|
66
|
+
* This file is part of the Cristal Wiki software prototype
|
|
67
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
68
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
69
|
+
*
|
|
70
|
+
**/let il=class{constructor(t){var n,o;this.logger=t.get("Logger"),this.logger.setModule("extensionmanager.components.componentsInit"),(n=this.logger)==null||n.debug("Init Extension Manager components begin"),t.bind("ExtensionManager").to(Di),(o=this.logger)==null||o.debug("Init Extension Manager components end")}};/**
|
|
71
|
+
* @vue/shared v3.4.27
|
|
72
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
73
|
+
* @license MIT
|
|
74
|
+
**//*! #__NO_SIDE_EFFECTS__ */function ol(e,t){const n=new Set(e.split(","));return o=>n.has(o)}const ut=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Vt=()=>{},al=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),nt=Object.assign,sl=Object.prototype.hasOwnProperty,Ae=(e,t)=>sl.call(e,t),ge=Array.isArray,sn=e=>yr(e)==="[object Map]",ul=e=>yr(e)==="[object Set]",De=e=>typeof e=="function",rt=e=>typeof e=="string",Rn=e=>typeof e=="symbol",Ve=e=>e!==null&&typeof e=="object",cl=e=>(Ve(e)||De(e))&&De(e.then)&&De(e.catch),ll=Object.prototype.toString,yr=e=>ll.call(e),ja=e=>yr(e).slice(8,-1),fl=e=>yr(e)==="[object Object]",Ni=e=>rt(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,hl=(e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),un=(e,t)=>!Object.is(e,t),dl=(e,t,n,o=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:o,value:n})};let La;const Fa=()=>La||(La=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ri(e){if(ge(e)){const t={};for(let n=0;n<e.length;n++){const o=e[n],a=rt(o)?yl(o):Ri(o);if(a)for(const u in a)t[u]=a[u]}return t}else if(rt(e)||Ve(e))return e}const pl=/;(?![^(]*\))/g,gl=/:([^]+)/,vl=/\/\*[^]*?\*\//g;function yl(e){const t={};return e.replace(vl,"").split(pl).forEach(n=>{if(n){const o=n.split(gl);o.length>1&&(t[o[0].trim()]=o[1].trim())}}),t}function Mi(e){let t="";if(rt(e))t=e;else if(ge(e))for(let n=0;n<e.length;n++){const o=Mi(e[n]);o&&(t+=o+" ")}else if(Ve(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
|
|
75
|
+
* @vue/reactivity v3.4.27
|
|
76
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
77
|
+
* @license MIT
|
|
78
|
+
**/function Mn(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let ml;function bl(e,t=ml){t&&t.active&&t.effects.push(e)}let kn;class _l{constructor(t,n,o,a){this.fn=t,this.trigger=n,this.scheduler=o,this.active=!0,this.deps=[],this._dirtyLevel=4,this._trackId=0,this._runnings=0,this._shouldSchedule=!1,this._depsLength=0,bl(this,a)}get dirty(){if(this._dirtyLevel===2||this._dirtyLevel===3){this._dirtyLevel=1,mr();for(let t=0;t<this._depsLength;t++){const n=this.deps[t];if(n.computed&&(wl(n.computed),this._dirtyLevel>=4))break}this._dirtyLevel===1&&(this._dirtyLevel=0),br()}return this._dirtyLevel>=4}set dirty(t){this._dirtyLevel=t?4:0}run(){if(this._dirtyLevel=0,!this.active)return this.fn();let t=Wt,n=kn;try{return Wt=!0,kn=this,this._runnings++,Ba(this),this.fn()}finally{Ka(this),this._runnings--,kn=n,Wt=t}}stop(){this.active&&(Ba(this),Ka(this),this.onStop&&this.onStop(),this.active=!1)}}function wl(e){return e.value}function Ba(e){e._trackId++,e._depsLength=0}function Ka(e){if(e.deps.length>e._depsLength){for(let t=e._depsLength;t<e.deps.length;t++)Va(e.deps[t],e);e.deps.length=e._depsLength}}function Va(e,t){const n=e.get(t);n!==void 0&&t._trackId!==n&&(e.delete(t),e.size===0&&e.cleanup())}let Wt=!0,ki=0;const Wa=[];function mr(){Wa.push(Wt),Wt=!1}function br(){const e=Wa.pop();Wt=e===void 0?!0:e}function ji(){ki++}function Li(){for(ki--;!ki&&Fi.length;)Fi.shift()()}function El(e,t,n){var o;if(t.get(e)!==e._trackId){t.set(e,e._trackId);const a=e.deps[e._depsLength];a!==t?(a&&Va(a,e),e.deps[e._depsLength++]=t):e._depsLength++,process.env.NODE_ENV!=="production"&&((o=e.onTrack)==null||o.call(e,nt({effect:e},n)))}}const Fi=[];function Sl(e,t,n){var o;ji();for(const a of e.keys()){let u;a._dirtyLevel<t&&(u??(u=e.get(a)===a._trackId))&&(a._shouldSchedule||(a._shouldSchedule=a._dirtyLevel===0),a._dirtyLevel=t),a._shouldSchedule&&(u??(u=e.get(a)===a._trackId))&&(process.env.NODE_ENV!=="production"&&((o=a.onTrigger)==null||o.call(a,nt({effect:a},n))),a.trigger(),(!a._runnings||a.allowRecurse)&&a._dirtyLevel!==2&&(a._shouldSchedule=!1,a.scheduler&&Fi.push(a.scheduler)))}Li()}const Ol=(e,t)=>{const n=new Map;return n.cleanup=e,n.computed=t,n},Bi=new WeakMap,$t=Symbol(process.env.NODE_ENV!=="production"?"iterate":""),Ki=Symbol(process.env.NODE_ENV!=="production"?"Map key iterate":"");function Ne(e,t,n){if(Wt&&kn){let o=Bi.get(e);o||Bi.set(e,o=new Map);let a=o.get(n);a||o.set(n,a=Ol(()=>o.delete(n))),El(kn,a,process.env.NODE_ENV!=="production"?{target:e,type:t,key:n}:void 0)}}function Ot(e,t,n,o,a,u){const f=Bi.get(e);if(!f)return;let g=[];if(t==="clear")g=[...f.values()];else if(n==="length"&&ge(e)){const S=Number(o);f.forEach((p,I)=>{(I==="length"||!Rn(I)&&I>=S)&&g.push(p)})}else switch(n!==void 0&&g.push(f.get(n)),t){case"add":ge(e)?Ni(n)&&g.push(f.get("length")):(g.push(f.get($t)),sn(e)&&g.push(f.get(Ki)));break;case"delete":ge(e)||(g.push(f.get($t)),sn(e)&&g.push(f.get(Ki)));break;case"set":sn(e)&&g.push(f.get($t));break}ji();for(const S of g)S&&Sl(S,4,process.env.NODE_ENV!=="production"?{target:e,type:t,key:n,newValue:o,oldValue:a,oldTarget:u}:void 0);Li()}const xl=ol("__proto__,__v_isRef,__isVue"),$a=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Rn)),Ua=Al();function Al(){const e={};return["includes","indexOf","lastIndexOf"].forEach(t=>{e[t]=function(...n){const o=ce(this);for(let u=0,f=this.length;u<f;u++)Ne(o,"get",u+"");const a=o[t](...n);return a===-1||a===!1?o[t](...n.map(ce)):a}}),["push","pop","shift","unshift","splice"].forEach(t=>{e[t]=function(...n){mr(),ji();const o=ce(this)[t].apply(this,n);return Li(),br(),o}}),e}function Cl(e){Rn(e)||(e=String(e));const t=ce(this);return Ne(t,"has",e),t.hasOwnProperty(e)}class qa{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,o){const a=this._isReadonly,u=this._isShallow;if(n==="__v_isReactive")return!a;if(n==="__v_isReadonly")return a;if(n==="__v_isShallow")return u;if(n==="__v_raw")return o===(a?u?es:Za:u?Kl:Xa).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(o)?t:void 0;const f=ge(t);if(!a){if(f&&Ae(Ua,n))return Reflect.get(Ua,n,o);if(n==="hasOwnProperty")return Cl}const g=Reflect.get(t,n,o);return(Rn(n)?$a.has(n):xl(n))||(a||Ne(t,"get",n),u)?g:Ze(g)?f&&Ni(n)?g:g.value:Ve(g)?a?ns(g):ts(g):g}}class Pl extends qa{constructor(t=!1){super(!1,t)}set(t,n,o,a){let u=t[n];if(!this._isShallow){const S=ln(u);if(!fn(o)&&!ln(o)&&(u=ce(u),o=ce(o)),!ge(t)&&Ze(u)&&!Ze(o))return S?!1:(u.value=o,!0)}const f=ge(t)&&Ni(n)?Number(n)<t.length:Ae(t,n),g=Reflect.set(t,n,o,a);return t===ce(a)&&(f?un(o,u)&&Ot(t,"set",n,o,u):Ot(t,"add",n,o)),g}deleteProperty(t,n){const o=Ae(t,n),a=t[n],u=Reflect.deleteProperty(t,n);return u&&o&&Ot(t,"delete",n,void 0,a),u}has(t,n){const o=Reflect.has(t,n);return(!Rn(n)||!$a.has(n))&&Ne(t,"has",n),o}ownKeys(t){return Ne(t,"iterate",ge(t)?"length":$t),Reflect.ownKeys(t)}}class za extends qa{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&Mn(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&Mn(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Tl=new Pl,Il=new za,Dl=new za(!0),Vi=e=>e,_r=e=>Reflect.getPrototypeOf(e);function wr(e,t,n=!1,o=!1){e=e.__v_raw;const a=ce(e),u=ce(t);n||(un(t,u)&&Ne(a,"get",t),Ne(a,"get",u));const{has:f}=_r(a),g=o?Vi:n?zi:qi;if(f.call(a,t))return g(e.get(t));if(f.call(a,u))return g(e.get(u));e!==a&&e.get(t)}function Er(e,t=!1){const n=this.__v_raw,o=ce(n),a=ce(e);return t||(un(e,a)&&Ne(o,"has",e),Ne(o,"has",a)),e===a?n.has(e):n.has(e)||n.has(a)}function Sr(e,t=!1){return e=e.__v_raw,!t&&Ne(ce(e),"iterate",$t),Reflect.get(e,"size",e)}function Ha(e){e=ce(e);const t=ce(this);return _r(t).has.call(t,e)||(t.add(e),Ot(t,"add",e,e)),this}function Ga(e,t){t=ce(t);const n=ce(this),{has:o,get:a}=_r(n);let u=o.call(n,e);u?process.env.NODE_ENV!=="production"&&Ja(n,o,e):(e=ce(e),u=o.call(n,e));const f=a.call(n,e);return n.set(e,t),u?un(t,f)&&Ot(n,"set",e,t,f):Ot(n,"add",e,t),this}function Ya(e){const t=ce(this),{has:n,get:o}=_r(t);let a=n.call(t,e);a?process.env.NODE_ENV!=="production"&&Ja(t,n,e):(e=ce(e),a=n.call(t,e));const u=o?o.call(t,e):void 0,f=t.delete(e);return a&&Ot(t,"delete",e,void 0,u),f}function Qa(){const e=ce(this),t=e.size!==0,n=process.env.NODE_ENV!=="production"?sn(e)?new Map(e):new Set(e):void 0,o=e.clear();return t&&Ot(e,"clear",void 0,void 0,n),o}function Or(e,t){return function(o,a){const u=this,f=u.__v_raw,g=ce(f),S=t?Vi:e?zi:qi;return!e&&Ne(g,"iterate",$t),f.forEach((p,I)=>o.call(a,S(p),S(I),u))}}function xr(e,t,n){return function(...o){const a=this.__v_raw,u=ce(a),f=sn(u),g=e==="entries"||e===Symbol.iterator&&f,S=e==="keys"&&f,p=a[e](...o),I=n?Vi:t?zi:qi;return!t&&Ne(u,"iterate",S?Ki:$t),{next(){const{value:P,done:B}=p.next();return B?{value:P,done:B}:{value:g?[I(P[0]),I(P[1])]:I(P),done:B}},[Symbol.iterator](){return this}}}}function xt(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";Mn(`${hl(e)} operation ${n}failed: target is readonly.`,ce(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function Nl(){const e={get(u){return wr(this,u)},get size(){return Sr(this)},has:Er,add:Ha,set:Ga,delete:Ya,clear:Qa,forEach:Or(!1,!1)},t={get(u){return wr(this,u,!1,!0)},get size(){return Sr(this)},has:Er,add:Ha,set:Ga,delete:Ya,clear:Qa,forEach:Or(!1,!0)},n={get(u){return wr(this,u,!0)},get size(){return Sr(this,!0)},has(u){return Er.call(this,u,!0)},add:xt("add"),set:xt("set"),delete:xt("delete"),clear:xt("clear"),forEach:Or(!0,!1)},o={get(u){return wr(this,u,!0,!0)},get size(){return Sr(this,!0)},has(u){return Er.call(this,u,!0)},add:xt("add"),set:xt("set"),delete:xt("delete"),clear:xt("clear"),forEach:Or(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(u=>{e[u]=xr(u,!1,!1),n[u]=xr(u,!0,!1),t[u]=xr(u,!1,!0),o[u]=xr(u,!0,!0)}),[e,n,t,o]}const[Rl,Ml,kl,jl]=Nl();function Wi(e,t){const n=t?e?jl:kl:e?Ml:Rl;return(o,a,u)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?o:Reflect.get(Ae(n,a)&&a in o?n:o,a,u)}const Ll={get:Wi(!1,!1)},Fl={get:Wi(!0,!1)},Bl={get:Wi(!0,!0)};function Ja(e,t,n){const o=ce(n);if(o!==n&&t.call(e,o)){const a=ja(e);Mn(`Reactive ${a} contains both the raw and reactive versions of the same object${a==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}const Xa=new WeakMap,Kl=new WeakMap,Za=new WeakMap,es=new WeakMap;function Vl(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function Wl(e){return e.__v_skip||!Object.isExtensible(e)?0:Vl(ja(e))}function ts(e){return ln(e)?e:$i(e,!1,Tl,Ll,Xa)}function ns(e){return $i(e,!0,Il,Fl,Za)}function Ar(e){return $i(e,!0,Dl,Bl,es)}function $i(e,t,n,o,a){if(!Ve(e))return process.env.NODE_ENV!=="production"&&Mn(`value cannot be made reactive: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const u=a.get(e);if(u)return u;const f=Wl(e);if(f===0)return e;const g=new Proxy(e,f===2?o:n);return a.set(e,g),g}function cn(e){return ln(e)?cn(e.__v_raw):!!(e&&e.__v_isReactive)}function ln(e){return!!(e&&e.__v_isReadonly)}function fn(e){return!!(e&&e.__v_isShallow)}function Ui(e){return e?!!e.__v_raw:!1}function ce(e){const t=e&&e.__v_raw;return t?ce(t):e}function $l(e){return Object.isExtensible(e)&&dl(e,"__v_skip",!0),e}const qi=e=>Ve(e)?ts(e):e,zi=e=>Ve(e)?ns(e):e;function Ze(e){return!!(e&&e.__v_isRef===!0)}function Ul(e){return Ze(e)?e.value:e}const ql={get:(e,t,n)=>Ul(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const a=e[t];return Ze(a)&&!Ze(n)?(a.value=n,!0):Reflect.set(e,t,n,o)}};function zl(e){return cn(e)?e:new Proxy(e,ql)}/**
|
|
79
|
+
* @vue/runtime-core v3.4.27
|
|
80
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
81
|
+
* @license MIT
|
|
82
|
+
**/const Ut=[];function Hl(e){Ut.push(e)}function Gl(){Ut.pop()}function _e(e,...t){mr();const n=Ut.length?Ut[Ut.length-1].component:null,o=n&&n.appContext.config.warnHandler,a=Yl();if(o)qt(o,n,11,[e+t.map(u=>{var f,g;return(g=(f=u.toString)==null?void 0:f.call(u))!=null?g:JSON.stringify(u)}).join(""),n&&n.proxy,a.map(({vnode:u})=>`at <${xs(n,u.type)}>`).join(`
|
|
83
|
+
`),a]);else{const u=[`[Vue warn]: ${e}`,...t];a.length&&u.push(`
|
|
84
|
+
`,...Ql(a)),console.warn(...u)}br()}function Yl(){let e=Ut[Ut.length-1];if(!e)return[];const t=[];for(;e;){const n=t[0];n&&n.vnode===e?n.recurseCount++:t.push({vnode:e,recurseCount:0});const o=e.component&&e.component.parent;e=o&&o.vnode}return t}function Ql(e){const t=[];return e.forEach((n,o)=>{t.push(...o===0?[]:[`
|
|
85
|
+
`],...Jl(n))}),t}function Jl({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",o=e.component?e.component.parent==null:!1,a=` at <${xs(e.component,e.type,o)}`,u=">"+n;return e.props?[a,...Xl(e.props),u]:[a+u]}function Xl(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(o=>{t.push(...rs(o,e[o]))}),n.length>3&&t.push(" ..."),t}function rs(e,t,n){return rt(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Ze(t)?(t=rs(e,ce(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):De(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ce(t),n?t:[`${e}=`,t])}const is={sp:"serverPrefetch hook",bc:"beforeCreate hook",c:"created hook",bm:"beforeMount hook",m:"mounted hook",bu:"beforeUpdate hook",u:"updated",bum:"beforeUnmount hook",um:"unmounted hook",a:"activated hook",da:"deactivated hook",ec:"errorCaptured hook",rtc:"renderTracked hook",rtg:"renderTriggered hook",0:"setup function",1:"render function",2:"watcher getter",3:"watcher callback",4:"watcher cleanup function",5:"native event handler",6:"component event handler",7:"vnode hook",8:"directive hook",9:"transition hook",10:"app errorHandler",11:"app warnHandler",12:"ref function",13:"async component loader",14:"scheduler flush. This is likely a Vue internals bug. Please open an issue at https://github.com/vuejs/core ."};function qt(e,t,n,o){try{return o?e(...o):e()}catch(a){Hi(a,t,n)}}function Cr(e,t,n,o){if(De(e)){const a=qt(e,t,n,o);return a&&cl(a)&&a.catch(u=>{Hi(u,t,n)}),a}if(ge(e)){const a=[];for(let u=0;u<e.length;u++)a.push(Cr(e[u],t,n,o));return a}else process.env.NODE_ENV!=="production"&&_e(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function Hi(e,t,n,o=!0){const a=t?t.vnode:null;if(t){let u=t.parent;const f=t.proxy,g=process.env.NODE_ENV!=="production"?is[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;u;){const p=u.ec;if(p){for(let I=0;I<p.length;I++)if(p[I](e,f,g)===!1)return}u=u.parent}const S=t.appContext.config.errorHandler;if(S){mr(),qt(S,null,10,[e,f,g]),br();return}}Zl(e,n,a,o)}function Zl(e,t,n,o=!0){if(process.env.NODE_ENV!=="production"){const a=is[t];if(n&&Hl(n),_e(`Unhandled error${a?` during execution of ${a}`:""}`),n&&Gl(),o)throw e;console.error(e)}else console.error(e)}let Pr=!1,Gi=!1;const it=[];let At=0;const hn=[];let vt=null,Ct=0;const os=Promise.resolve();let Yi=null;const ef=100;function tf(e){const t=Yi||os;return e?t.then(this?e.bind(this):e):t}function nf(e){let t=At+1,n=it.length;for(;t<n;){const o=t+n>>>1,a=it[o],u=jn(a);u<e||u===e&&a.pre?t=o+1:n=o}return t}function Qi(e){(!it.length||!it.includes(e,Pr&&e.allowRecurse?At+1:At))&&(e.id==null?it.push(e):it.splice(nf(e.id),0,e),as())}function as(){!Pr&&!Gi&&(Gi=!0,Yi=os.then(us))}function ss(e){ge(e)?hn.push(...e):(!vt||!vt.includes(e,e.allowRecurse?Ct+1:Ct))&&hn.push(e),as()}function rf(e){if(hn.length){const t=[...new Set(hn)].sort((n,o)=>jn(n)-jn(o));if(hn.length=0,vt){vt.push(...t);return}for(vt=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),Ct=0;Ct<vt.length;Ct++)process.env.NODE_ENV!=="production"&&cs(e,vt[Ct])||vt[Ct]();vt=null,Ct=0}}const jn=e=>e.id==null?1/0:e.id,of=(e,t)=>{const n=jn(e)-jn(t);if(n===0){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function us(e){Gi=!1,Pr=!0,process.env.NODE_ENV!=="production"&&(e=e||new Map),it.sort(of);const t=process.env.NODE_ENV!=="production"?n=>cs(e,n):Vt;try{for(At=0;At<it.length;At++){const n=it[At];if(n&&n.active!==!1){if(process.env.NODE_ENV!=="production"&&t(n))continue;qt(n,null,14)}}}finally{At=0,it.length=0,rf(e),Pr=!1,Yi=null,(it.length||hn.length)&&us(e)}}function cs(e,t){if(!e.has(t))e.set(t,1);else{const n=e.get(t);if(n>ef){const o=t.ownerInstance,a=o&&Os(o.type);return Hi(`Maximum recursive updates exceeded${a?` in component <${a}>`:""}. This means you have a reactive effect that is mutating its own dependencies and thus recursively triggering itself. Possible sources include component template, render function, updated hook or watcher source function.`,null,10),!0}else e.set(t,n+1)}}const Ln=new Set;process.env.NODE_ENV!=="production"&&(Fa().__VUE_HMR_RUNTIME__={createRecord:Ji(af),rerender:Ji(sf),reload:Ji(uf)});const Tr=new Map;function af(e,t){return Tr.has(e)?!1:(Tr.set(e,{initialDef:Fn(t),instances:new Set}),!0)}function Fn(e){return As(e)?e.__vccOpts:e}function sf(e,t){const n=Tr.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(o=>{t&&(o.render=t,Fn(o.type).render=t),o.renderCache=[],o.effect.dirty=!0,o.update()}))}function uf(e,t){const n=Tr.get(e);if(!n)return;t=Fn(t),ls(n.initialDef,t);const o=[...n.instances];for(const a of o){const u=Fn(a.type);Ln.has(u)||(u!==n.initialDef&&ls(u,t),Ln.add(u)),a.appContext.propsCache.delete(a.type),a.appContext.emitsCache.delete(a.type),a.appContext.optionsCache.delete(a.type),a.ceReload?(Ln.add(u),a.ceReload(t.styles),Ln.delete(u)):a.parent?(a.parent.effect.dirty=!0,Qi(a.parent.update)):a.appContext.reload?a.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required.")}ss(()=>{for(const a of o)Ln.delete(Fn(a.type))})}function ls(e,t){nt(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function Ji(e){return(t,n)=>{try{return e(t,n)}catch(o){console.error(o),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let dn,Ir=[];function fs(e,t){var n,o;dn=e,dn?(dn.enabled=!0,Ir.forEach(({event:a,args:u})=>dn.emit(a,...u)),Ir=[]):typeof window<"u"&&window.HTMLElement&&!((o=(n=window.navigator)==null?void 0:n.userAgent)!=null&&o.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(u=>{fs(u,t)}),setTimeout(()=>{dn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Ir=[])},3e3)):Ir=[]}let yt=null,cf=null;function od(){}const lf=Symbol.for("v-ndc"),ff=e=>e.__isSuspense;function hf(e,t){t&&t.pendingBranch?ge(e)?t.effects.push(...e):t.effects.push(e):ss(e)}const df=Symbol.for("v-scx"),pf=()=>{{const e=xf(df);return e||process.env.NODE_ENV!=="production"&&_e("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}},Dr={};function gf(e,t,{immediate:n,deep:o,flush:a,once:u,onTrack:f,onTrigger:g}=ut){if(t&&u){const te=t;t=(...Ce)=>{te(...Ce),Pt()}}process.env.NODE_ENV!=="production"&&o!==void 0&&typeof o=="number"&&_e('watch() "deep" option with number value will be used as watch depth in future versions. Please use a boolean instead to avoid potential breakage.'),process.env.NODE_ENV!=="production"&&!t&&(n!==void 0&&_e('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),o!==void 0&&_e('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),u!==void 0&&_e('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const S=te=>{_e("Invalid watch source: ",te,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},p=kr,I=te=>o===!0?te:pn(te,o===!1?1:void 0);let P,B=!1,Q=!1;if(Ze(e)?(P=()=>e.value,B=fn(e)):cn(e)?(P=()=>I(e),B=!0):ge(e)?(Q=!0,B=e.some(te=>cn(te)||fn(te)),P=()=>e.map(te=>{if(Ze(te))return te.value;if(cn(te))return I(te);if(De(te))return qt(te,p,2);process.env.NODE_ENV!=="production"&&S(te)})):De(e)?t?P=()=>qt(e,p,2):P=()=>(Z&&Z(),Cr(e,p,3,[fe])):(P=Vt,process.env.NODE_ENV!=="production"&&S(e)),t&&o){const te=P;P=()=>pn(te())}let Z,fe=te=>{Z=Se.onStop=()=>{qt(te,p,4),Z=Se.onStop=void 0}},ze;if(Ss)if(fe=Vt,t?n&&Cr(t,p,3,[P(),Q?[]:void 0,fe]):P(),a==="sync"){const te=pf();ze=te.__watcherHandles||(te.__watcherHandles=[])}else return Vt;let We=Q?new Array(e.length).fill(Dr):Dr;const $e=()=>{if(!(!Se.active||!Se.dirty))if(t){const te=Se.run();(o||B||(Q?te.some((Ce,vn)=>un(Ce,We[vn])):un(te,We)))&&(Z&&Z(),Cr(t,p,3,[te,We===Dr?void 0:Q&&We[0]===Dr?[]:We,fe]),We=te)}else Se.run()};$e.allowRecurse=!!t;let mt;a==="sync"?mt=$e:a==="post"?mt=()=>ms($e,p&&p.suspense):($e.pre=!0,p&&($e.id=p.uid),mt=()=>Qi($e));const Se=new _l(P,Vt,mt),Pt=()=>{Se.stop()};return process.env.NODE_ENV!=="production"&&(Se.onTrack=f,Se.onTrigger=g),t?n?$e():We=Se.run():a==="post"?ms(Se.run.bind(Se),p&&p.suspense):Se.run(),ze&&ze.push(Pt),Pt}function vf(e,t,n){const o=this.proxy,a=rt(e)?e.includes(".")?yf(o,e):()=>o[e]:e.bind(o,o);let u;De(t)?u=t:(u=t.handler,n=t);const f=Lf(this),g=gf(a,u.bind(o),n);return f(),g}function yf(e,t){const n=t.split(".");return()=>{let o=e;for(let a=0;a<n.length&&o;a++)o=o[n[a]];return o}}function pn(e,t=1/0,n){if(t<=0||!Ve(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,Ze(e))pn(e.value,t,n);else if(ge(e))for(let o=0;o<e.length;o++)pn(e[o],t,n);else if(ul(e)||sn(e))e.forEach(o=>{pn(o,t,n)});else if(fl(e))for(const o in e)pn(e[o],t,n);return e}const Xi=e=>e?Ff(e)?Bf(e)||e.proxy:Xi(e.parent):null,Bn=nt(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?Ar(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?Ar(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?Ar(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?Ar(e.refs):e.refs,$parent:e=>Xi(e.parent),$root:e=>Xi(e.root),$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?wf(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{e.effect.dirty=!0,Qi(e.update)}),$nextTick:e=>e.n||(e.n=tf.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?vf.bind(e):Vt}),mf=e=>e==="_"||e==="$",Zi=(e,t)=>e!==ut&&!e.__isScriptSetup&&Ae(e,t),bf={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:o,data:a,props:u,accessCache:f,type:g,appContext:S}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let p;if(t[0]!=="$"){const Q=f[t];if(Q!==void 0)switch(Q){case 1:return o[t];case 2:return a[t];case 4:return n[t];case 3:return u[t]}else{if(Zi(o,t))return f[t]=1,o[t];if(a!==ut&&Ae(a,t))return f[t]=2,a[t];if((p=e.propsOptions[0])&&Ae(p,t))return f[t]=3,u[t];if(n!==ut&&Ae(n,t))return f[t]=4,n[t];(!__VUE_OPTIONS_API__||_f)&&(f[t]=0)}}const I=Bn[t];let P,B;if(I)return t==="$attrs"?(Ne(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&t==="$slots"&&Ne(e,"get",t),I(e);if((P=g.__cssModules)&&(P=P[t]))return P;if(n!==ut&&Ae(n,t))return f[t]=4,n[t];if(B=S.config.globalProperties,Ae(B,t))return B[t];process.env.NODE_ENV!=="production"&&yt&&(!rt(t)||t.indexOf("__v")!==0)&&(a!==ut&&mf(t[0])&&Ae(a,t)?_e(`Property ${JSON.stringify(t)} must be accessed via $data because it starts with a reserved character ("$" or "_") and is not proxied on the render context.`):e===yt&&_e(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,n){const{data:o,setupState:a,ctx:u}=e;return Zi(a,t)?(a[t]=n,!0):process.env.NODE_ENV!=="production"&&a.__isScriptSetup&&Ae(a,t)?(_e(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):o!==ut&&Ae(o,t)?(o[t]=n,!0):Ae(e.props,t)?(process.env.NODE_ENV!=="production"&&_e(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&_e(`Attempting to mutate public property "${t}". Properties starting with $ are reserved and readonly.`),!1):(process.env.NODE_ENV!=="production"&&t in e.appContext.config.globalProperties?Object.defineProperty(u,t,{enumerable:!0,configurable:!0,value:n}):u[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:o,appContext:a,propsOptions:u}},f){let g;return!!n[f]||e!==ut&&Ae(e,f)||Zi(t,f)||(g=u[0])&&Ae(g,f)||Ae(o,f)||Ae(Bn,f)||Ae(a.config.globalProperties,f)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ae(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};process.env.NODE_ENV!=="production"&&(bf.ownKeys=e=>(_e("Avoid app logic that relies on enumerating keys on a component instance. The keys will be empty in production mode to avoid performance overhead."),Reflect.ownKeys(e)));function hs(e){return ge(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let _f=!0;function wf(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:a,optionsCache:u,config:{optionMergeStrategies:f}}=e.appContext,g=u.get(t);let S;return g?S=g:!a.length&&!n&&!o?S=t:(S={},a.length&&a.forEach(p=>Nr(S,p,f,!0)),Nr(S,t,f)),Ve(t)&&u.set(t,S),S}function Nr(e,t,n,o=!1){const{mixins:a,extends:u}=t;u&&Nr(e,u,n,!0),a&&a.forEach(f=>Nr(e,f,n,!0));for(const f in t)if(o&&f==="expose")process.env.NODE_ENV!=="production"&&_e('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const g=Ef[f]||n&&n[f];e[f]=g?g(e[f],t[f]):t[f]}return e}const Ef={data:ds,props:gs,emits:gs,methods:Kn,computed:Kn,beforeCreate:Le,created:Le,beforeMount:Le,mounted:Le,beforeUpdate:Le,updated:Le,beforeDestroy:Le,beforeUnmount:Le,destroyed:Le,unmounted:Le,activated:Le,deactivated:Le,errorCaptured:Le,serverPrefetch:Le,components:Kn,directives:Kn,watch:Of,provide:ds,inject:Sf};function ds(e,t){return t?e?function(){return nt(De(e)?e.call(this,this):e,De(t)?t.call(this,this):t)}:t:e}function Sf(e,t){return Kn(ps(e),ps(t))}function ps(e){if(ge(e)){const t={};for(let n=0;n<e.length;n++)t[e[n]]=e[n];return t}return e}function Le(e,t){return e?[...new Set([].concat(e,t))]:t}function Kn(e,t){return e?nt(Object.create(null),e,t):t}function gs(e,t){return e?ge(e)&&ge(t)?[...new Set([...e,...t])]:nt(Object.create(null),hs(e),hs(t??{})):t}function Of(e,t){if(!e)return t;if(!t)return e;const n=nt(Object.create(null),e);for(const o in t)n[o]=Le(e[o],t[o]);return n}let vs=null;function xf(e,t,n=!1){const o=kr||yt;if(o||vs){const a=o?o.parent==null?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:vs._context.provides;if(a&&e in a)return a[e];if(arguments.length>1)return n&&De(t)?t.call(o&&o.proxy):t;process.env.NODE_ENV!=="production"&&_e(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&_e("inject() can only be used inside setup() or functional components.")}const Af={},ys=e=>Object.getPrototypeOf(e)===Af,ms=hf,Cf=e=>e.__isTeleport,bs=Symbol.for("v-fgt"),Pf=Symbol.for("v-txt"),Tf=Symbol.for("v-cmt");let gn=null;function If(e){return e?e.__v_isVNode===!0:!1}const Df=(...e)=>ws(...e),_s=({key:e})=>e??null,Rr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?rt(e)||Ze(e)||De(e)?{i:yt,r:e,k:t,f:!!n}:e:null);function Nf(e,t=null,n=null,o=0,a=null,u=e===bs?0:1,f=!1,g=!1){const S={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&_s(t),ref:t&&Rr(t),scopeId:cf,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:u,patchFlag:o,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:yt};return g?(eo(S,n),u&128&&e.normalize(S)):n&&(S.shapeFlag|=rt(n)?8:16),process.env.NODE_ENV!=="production"&&S.key!==S.key&&_e("VNode created with invalid key (NaN). VNode type:",S.type),!f&&gn&&(S.patchFlag>0||u&6)&&S.patchFlag!==32&&gn.push(S),S}const Rf=process.env.NODE_ENV!=="production"?Df:ws;function ws(e,t=null,n=null,o=0,a=null,u=!1){if((!e||e===lf)&&(process.env.NODE_ENV!=="production"&&!e&&_e(`Invalid vnode type when creating vnode: ${e}.`),e=Tf),If(e)){const g=Mr(e,t,!0);return n&&eo(g,n),!u&&gn&&(g.shapeFlag&6?gn[gn.indexOf(e)]=g:gn.push(g)),g.patchFlag|=-2,g}if(As(e)&&(e=e.__vccOpts),t){t=Mf(t);let{class:g,style:S}=t;g&&!rt(g)&&(t.class=Mi(g)),Ve(S)&&(Ui(S)&&!ge(S)&&(S=nt({},S)),t.style=Ri(S))}const f=rt(e)?1:ff(e)?128:Cf(e)?64:Ve(e)?4:De(e)?2:0;return process.env.NODE_ENV!=="production"&&f&4&&Ui(e)&&(e=ce(e),_e("Vue received a Component that was made a reactive object. This can lead to unnecessary performance overhead and should be avoided by marking the component with `markRaw` or using `shallowRef` instead of `ref`.",`
|
|
86
|
+
Component that was made reactive: `,e)),Nf(e,t,n,o,a,f,u,!0)}function Mf(e){return e?Ui(e)||ys(e)?nt({},e):e:null}function Mr(e,t,n=!1,o=!1){const{props:a,ref:u,patchFlag:f,children:g,transition:S}=e,p=t?jf(a||{},t):a,I={__v_isVNode:!0,__v_skip:!0,type:e.type,props:p,key:p&&_s(p),ref:t&&t.ref?n&&u?ge(u)?u.concat(Rr(t)):[u,Rr(t)]:Rr(t):u,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&f===-1&&ge(g)?g.map(Es):g,target:e.target,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==bs?f===-1?16:f|16:f,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:S,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&Mr(e.ssContent),ssFallback:e.ssFallback&&Mr(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return S&&o&&(I.transition=S.clone(I)),I}function Es(e){const t=Mr(e);return ge(e.children)&&(t.children=e.children.map(Es)),t}function kf(e=" ",t=0){return Rf(Pf,null,e,t)}function eo(e,t){let n=0;const{shapeFlag:o}=e;if(t==null)t=null;else if(ge(t))n=16;else if(typeof t=="object")if(o&65){const a=t.default;a&&(a._c&&(a._d=!1),eo(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!ys(t)?t._ctx=yt:a===3&&yt&&(yt.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else De(t)?(t={default:t,_ctx:yt},n=32):(t=String(t),o&64?(n=16,t=[kf(t)]):n=8);e.children=t,e.shapeFlag|=n}function jf(...e){const t={};for(let n=0;n<e.length;n++){const o=e[n];for(const a in o)if(a==="class")t.class!==o.class&&(t.class=Mi([t.class,o.class]));else if(a==="style")t.style=Ri([t.style,o.style]);else if(al(a)){const u=t[a],f=o[a];f&&u!==f&&!(ge(u)&&u.includes(f))&&(t[a]=u?[].concat(u,f):f)}else a!==""&&(t[a]=o[a])}return t}let kr=null,to;{const e=Fa(),t=(n,o)=>{let a;return(a=e[n])||(a=e[n]=[]),a.push(o),u=>{a.length>1?a.forEach(f=>f(u)):a[0](u)}};to=t("__VUE_INSTANCE_SETTERS__",n=>kr=n),t("__VUE_SSR_SETTERS__",n=>Ss=n)}const Lf=e=>{const t=kr;return to(e),e.scope.on(),()=>{e.scope.off(),to(t)}};function Ff(e){return e.vnode.shapeFlag&4}let Ss=!1;process.env.NODE_ENV;function Bf(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(zl($l(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Bn)return Bn[n](e)},has(t,n){return n in t||n in Bn}}))}const Kf=/(?:^|[-_])(\w)/g,Vf=e=>e.replace(Kf,t=>t.toUpperCase()).replace(/[-_]/g,"");function Os(e,t=!0){return De(e)?e.displayName||e.name:e.name||t&&e.__name}function xs(e,t,n=!1){let o=Os(t);if(!o&&t.__file){const a=t.__file.match(/([^/\\]+)\.\w+$/);a&&(o=a[1])}if(!o&&e&&e.parent){const a=u=>{for(const f in u)if(u[f]===t)return f};o=a(e.components||e.parent.type.components)||a(e.appContext.components)}return o?Vf(o):n?"App":"Anonymous"}function As(e){return De(e)&&"__vccOpts"in e}function Wf(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},o={style:"color:#eb2f96"},a={header(P){return Ve(P)?P.__isVue?["div",e,"VueInstance"]:Ze(P)?["div",{},["span",e,I(P)],"<",g(P.value),">"]:cn(P)?["div",{},["span",e,fn(P)?"ShallowReactive":"Reactive"],"<",g(P),`>${ln(P)?" (readonly)":""}`]:ln(P)?["div",{},["span",e,fn(P)?"ShallowReadonly":"Readonly"],"<",g(P),">"]:null:null},hasBody(P){return P&&P.__isVue},body(P){if(P&&P.__isVue)return["div",{},...u(P.$)]}};function u(P){const B=[];P.type.props&&P.props&&B.push(f("props",ce(P.props))),P.setupState!==ut&&B.push(f("setup",P.setupState)),P.data!==ut&&B.push(f("data",ce(P.data)));const Q=S(P,"computed");Q&&B.push(f("computed",Q));const Z=S(P,"inject");return Z&&B.push(f("injected",Z)),B.push(["div",{},["span",{style:o.style+";opacity:0.66"},"$ (internal): "],["object",{object:P}]]),B}function f(P,B){return B=nt({},B),Object.keys(B).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},P],["div",{style:"padding-left:1.25em"},...Object.keys(B).map(Q=>["div",{},["span",o,Q+": "],g(B[Q],!1)])]]:["span",{}]}function g(P,B=!0){return typeof P=="number"?["span",t,P]:typeof P=="string"?["span",n,JSON.stringify(P)]:typeof P=="boolean"?["span",o,P]:Ve(P)?["object",{object:B?ce(P):P}]:["span",n,String(P)]}function S(P,B){const Q=P.type;if(De(Q))return;const Z={};for(const fe in P.ctx)p(Q,fe,B)&&(Z[fe]=P.ctx[fe]);return Z}function p(P,B,Q){const Z=P[Q];if(ge(Z)&&Z.includes(B)||Ve(Z)&&B in Z||P.extends&&p(P.extends,B,Q)||P.mixins&&P.mixins.some(fe=>p(fe,B,Q)))return!0}function I(P){return fn(P)?"ShallowRef":P.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(a):window.devtoolsFormatters=[a]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;/**
|
|
87
|
+
* vue v3.4.27
|
|
88
|
+
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
89
|
+
* @license MIT
|
|
90
|
+
**/function $f(){Wf()}process.env.NODE_ENV!=="production"&&$f();/**
|
|
91
|
+
* See the LICENSE file distributed with this work for additional
|
|
92
|
+
* information regarding copyright ownership.
|
|
93
|
+
*
|
|
94
|
+
* This is free software; you can redistribute it and/or modify it
|
|
95
|
+
* under the terms of the GNU Affero General Public License as
|
|
96
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
97
|
+
* the License, or (at your option) any later version.
|
|
98
|
+
*
|
|
99
|
+
* This software is distributed in the hope that it will be useful,
|
|
100
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
101
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
102
|
+
* Lesser General Public License for more details.
|
|
103
|
+
*
|
|
104
|
+
* You should have received a copy of the GNU Affero General Public
|
|
105
|
+
* License along with this software; if not, write to the Free
|
|
106
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
107
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
108
|
+
*
|
|
109
|
+
* This file is part of the Cristal Wiki software prototype
|
|
110
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
111
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
112
|
+
*
|
|
113
|
+
**/class no{constructor(t){this.jsonld=t}getIdentifier(){return this.jsonld.identifier}setIdentifier(t){this.jsonld.identifier=t}getName(){return this.jsonld.name}setName(t){this.jsonld.name=t}getText(){return this.jsonld.text}setText(t){this.jsonld.text=t}get(t){return this.jsonld[t]}set(t,n){this.jsonld[t]=n}getSource(){return this.jsonld}}/**
|
|
114
|
+
* See the LICENSE file distributed with this work for additional
|
|
115
|
+
* information regarding copyright ownership.
|
|
116
|
+
*
|
|
117
|
+
* This is free software; you can redistribute it and/or modify it
|
|
118
|
+
* under the terms of the GNU Affero General Public License as
|
|
119
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
120
|
+
* the License, or (at your option) any later version.
|
|
121
|
+
*
|
|
122
|
+
* This software is distributed in the hope that it will be useful,
|
|
123
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
124
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
125
|
+
* Lesser General Public License for more details.
|
|
126
|
+
*
|
|
127
|
+
* You should have received a copy of the GNU Affero General Public
|
|
128
|
+
* License along with this software; if not, write to the Free
|
|
129
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
130
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
131
|
+
*
|
|
132
|
+
* This file is part of the Cristal Wiki software prototype
|
|
133
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
134
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
135
|
+
*
|
|
136
|
+
**/class Vn{constructor(t="",n="",o="",a=""){this.document=new no({}),this.source=o,this.syntax=a,this.html="",this.name=n,this.id=t,this.css=[],this.js=[],this.version=""}toObject(){return{id:this.id,name:this.name,source:this.source,syntax:this.syntax,html:this.html,document:this.document.getSource(),css:this.css,js:this.js,version:this.version}}fromObject(t){this.id=t.id,this.name=t.name,this.source=t.source,this.syntax=t.syntax,this.html=t.html,this.document=new no(t.document),this.css=t.css,this.js=t.js,this.version=t.version}}var Uf=Object.defineProperty,qf=Object.getOwnPropertyDescriptor,zf=(e,t,n,o)=>{for(var a=o>1?void 0:o?qf(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Uf(t,n,a),a},Hf=(e,t)=>(n,o)=>t(n,o,e);let jr=class{constructor(e){this.logger=e,this.logger.setModule("storage.components.defaultWikiStorage"),this.offlineSetup=!1}setConfig(e,t,n,o,a,u,f){this.name=e,this.baseURL=t,this.baseRestURL=n,this.homePage=o,this.serverRendering=a,this.designSystem=u,this.offline=f}setConfigFromObject(e){this.name=e.name,this.baseURL=e.baseURL,this.baseRestURL=e.baseRestURL,this.homePage=e.homePage,this.serverRendering=e.serverRendering,this.offline=e.offline,this.designSystem=e.designSystem}setupOfflineStorage(){if(this.logger.debug("Checking offline storage"),this.offline&&this.cristal){this.logger.debug("Looking for wrapping offline storage");const e=this.cristal.getContainer().get("WrappingStorage");e?(this.logger.debug("Offline local storage is ready"),e.setStorage(this.storage),e.setWikiConfig(this.storage.getWikiConfig()),this.storage=e):this.logger.debug("Failed Looking for wrapping offline storage")}else this.cristal||this.logger.debug("Cristal not initialized"),this.offline||this.logger.debug("Offline mode not activated")}isSupported(e){return e=="html"}initialize(){this.offline&&!this.offlineSetup&&(this.setupOfflineStorage(),this.offlineSetup=!0,this.storage.isStorageReady())}defaultPageName(){return"index"}};jr=zf([Ke(),Hf(0,je("Logger"))],jr);var Gf=Object.defineProperty,Yf=Object.getOwnPropertyDescriptor,Cs=(e,t,n,o)=>{for(var a=o>1?void 0:o?Yf(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Gf(t,n,a),a};let Wn=class{setModule(e){this.module=e}debug(...e){(!this.loggerConfig||this.loggerConfig.hasLevelId(this.module,4))&&e.unshift(this.module+":"),console.debug.apply(null,e)}info(...e){e.unshift(this.module+":"),console.info.apply(null,e)}warn(...e){e.unshift(this.module+":"),console.warn.apply(null,e)}error(...e){e.unshift(this.module+":"),console.error.apply(null,e)}};Cs([je("LoggerConfig")],Wn.prototype,"loggerConfig",2),Wn=Cs([Ke()],Wn);var Qf=Object.defineProperty,Jf=Object.getOwnPropertyDescriptor,Xf=(e,t,n,o)=>{for(var a=o>1?void 0:o?Jf(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Qf(t,n,a),a};let ro=class{constructor(e="error"){this.levels=new Map,this.config=new Map,this.defaultLevel=e,this.computedConfig=new Map,this.levels.set("error",1),this.levels.set("warn",2),this.levels.set("info",3),this.levels.set("debug",4)}addLevel(e,t){const n=this.levels.get(t);n!=null&&this.config.forEach(o=>{if(o.startsWith(e)){const a=this.computedConfig.get(o);(a==null||n&&n>a)&&n&&this.computedConfig.set(o,n)}})}getLevels(){return this.config}getLevel(e){let t=this.config.get(e);return t||(t=this.defaultLevel),t}getLevelId(e){const t=this.levels.get(e);return t||10}setDefaultLevel(e){this.defaultLevel=e,this.defaultLevelId=this.getLevelId(this.defaultLevel)}getDefaultLevel(){return this.defaultLevel}getDefaultLevelId(){return this.defaultLevelId?this.defaultLevelId:(this.defaultLevelId=this.getLevelId(this.defaultLevel),this.defaultLevelId)}hasLevel(e,t){let n=this.computedConfig.get(e);n||(n=this.getDefaultLevelId());const o=this.getLevelId(t);return!!(o&&n>=o)}hasLevelId(e,t){let n=this.computedConfig.get(e);n||(n=this.getDefaultLevelId());const o=t;return!!(o&&n>=o)}};ro=Xf([Ke()],ro);/**
|
|
137
|
+
* See the LICENSE file distributed with this work for additional
|
|
138
|
+
* information regarding copyright ownership.
|
|
139
|
+
*
|
|
140
|
+
* This is free software; you can redistribute it and/or modify it
|
|
141
|
+
* under the terms of the GNU Affero General Public License as
|
|
142
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
143
|
+
* the License, or (at your option) any later version.
|
|
144
|
+
*
|
|
145
|
+
* This software is distributed in the hope that it will be useful,
|
|
146
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
147
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
148
|
+
* Lesser General Public License for more details.
|
|
149
|
+
*
|
|
150
|
+
* You should have received a copy of the GNU Affero General Public
|
|
151
|
+
* License along with this software; if not, write to the Free
|
|
152
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
153
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
154
|
+
*
|
|
155
|
+
* This file is part of the Cristal Wiki software prototype
|
|
156
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
157
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
158
|
+
*
|
|
159
|
+
**/class Zf{constructor(t){this.extensionList=t}getLogger(t){let n=this.container.get("Logger");return n||(n=new Wn),n.setModule(t),n}async loadExtensionManager(t){var a,u,f,g,S,p;const n="extension-manager",o="/apps/"+n+"/main.bundle.dev.js";try{if(t)(a=this.logger)==null||a.debug("Loading static extension Manager"),new il(this.container);else{(u=this.logger)==null||u.debug("Dynamic extension Manager. Ready to import ",o);const I=await import(o);if(I!=null){(f=this.logger)==null||f.debug("Found components Init for ",n,I);const P=I.ComponentInit;new P(this.container),(g=this.logger)==null||g.debug("Succesfull components Init for ",n)}else(S=this.logger)==null||S.debug("No components to load for ",n)}}catch(I){(p=this.logger)==null||p.error("Exception while loading extension Manager from ",o,I)}}async loadExtensions(t,n){var a,u,f,g;(a=this.logger)==null||a.debug("Start app"),await this.loadExtensionManager(t);const o=this.container.get("ExtensionManager");if((u=this.logger)==null||u.debug("Extension Manager is ",o),o!=null){if(!n){o.setRemoteExtensionsConfig("/apps/","main.bundle.dev.js");for(const S in this.extensionList)o.addRemoteExtension(S,"",!0);await o.loadExtensions(this.container)}(f=this.logger)==null||f.debug("After extensions loading")}else(g=this.logger)==null||g.debug("Could not start extension Manager");return o}initializeContainer(){var n;this.container=new Vc,this.container.bind("LoggerConfig").to(ro).inSingletonScope(),this.container.bind("Logger").to(Wn);const t=this.container.get("LoggerConfig");t&&t.setDefaultLevel("debug"),this.logger=this.getLogger("index.ts"),(n=this.logger)==null||n.info("Logging initialized")}getConfigFromPathName(t){let n="";if(t.startsWith("/")){const o=t.indexOf("/",1);o!=-1&&(n=t.substring(1,o))}return(n==null||n=="")&&(n="XWiki"),n}}var eh=Object.defineProperty,th=Object.getOwnPropertyDescriptor,nh=(e,t,n,o)=>{for(var a=o>1?void 0:o?th(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&eh(t,n,a),a},rh=(e,t)=>(n,o)=>t(n,o,e);let Lr=class{constructor(e,t){this.logger=e,this.logger.setModule(t)}setWikiConfig(e){this.logger.debug("Setting wiki Config: ",e),this.wikiConfig=e}getWikiConfig(){return this.wikiConfig}};Lr=nh([Ke(),rh(0,Gc())],Lr);var ih=Object.defineProperty,oh=Object.getOwnPropertyDescriptor,ah=(e,t,n,o)=>{for(var a=o>1?void 0:o?oh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&ih(t,n,a),a},sh=(e,t)=>(n,o)=>t(n,o,e);let io=class extends Lr{constructor(e){super(e,"storage.components.xwikiStorage")}async isStorageReady(){return!0}getPageRestURL(e,t){var n;return(n=this.logger)==null||n.debug("XWiki Loading page",e),this.wikiConfig.baseURL+this.wikiConfig.baseRestURL+"&page="+e+"&format="+t}getPageFromViewURL(e){let t;return e.startsWith(this.wikiConfig.baseURL)?(t=e.replace(this.wikiConfig.baseURL,"").replace("/bin","").replace("/view/","").replaceAll("/","."),t.endsWith(".")&&(t+="WebHome")):t=null,t}getImageURL(e,t){var o;e==""&&(e="Main.WebHome");const n=this.wikiConfig.baseURL+"/bin/download/"+e.replace(".","/")+"/"+t;return(o=this.logger)==null||o.debug("final image url ",n),n}async getPageContent(e,t){var p,I,P,B,Q,Z;(p=this.logger)==null||p.debug("XWiki Loading page",e),e==""&&(e="Main.WebHome");const n=this.getPageRestURL(e,t);(I=this.logger)==null||I.debug("XWiki Loading url",n);const a=await(await fetch(n,{cache:"no-store"})).json();let u="",f="",g={};t=="jsonld"?(g=a,this.wikiConfig.serverRendering?((P=this.logger)==null||P.debug("Using server side rendering for jsonld"),u=a.source,f=a.html):((B=this.logger)==null||B.debug("Using client side rendering for jsonld"),u=a.source,f="")):t=="html"?this.wikiConfig.serverRendering?((Q=this.logger)==null||Q.debug("Using server side rendering for html"),u=a.source,f=""):((Z=this.logger)==null||Z.debug("Using client side rendering for html"),u=a.source,f=""):(u="",f="");const S=new Vn;return S.source=u,S.syntax="xwiki",S.html=f,S.document=new no(g),S.css=a.css,S.js=a.js,S.version=S.document.get("version"),S.headlineRaw=a.headlineRaw,S.headline=a.headline,S.name=a.name,S}async getPanelContent(e,t){var f;const n=this.wikiConfig.baseURL+"/rest/cristal/panel?media=json&page="+t+"&panel="+e;(f=this.logger)==null||f.debug("XWiki Loading url",n);const a=await(await fetch(n,{cache:"no-store"})).json(),u=new Vn;return u.source=a.source,u.syntax="xwiki",u.html=a.content,u.css=a.css,u.js=a.js,u}async getEditField(e,t){var n,o;try{const a=e.get("xwikiMapping")[t];let u=a.type,f=a.fieldName;u==null&&(u="document"),f==null&&(f=t);const g=this.wikiConfig.baseURL+"/bin/get/"+e.getIdentifier().replaceAll(".","/")+"?xpage=display&mode=edit&type="+u+"&property="+e.get("className")+"."+f;return(n=this.logger)==null||n.debug("XWiki Loading Field url",g),await(await fetch(g,{cache:"no-store"})).text()}catch(a){return(o=this.logger)==null||o.error("Exception looking for edit field for field",t,a),""}}async save(e,t,n){const o=this.wikiConfig.baseURL,a=["rest","wikis","xwiki"],u=e.split(".");for(let g=0;g<u.length;g++){const S=g<u.length-1?"spaces":"pages";a.push(S),a.push(u[g])}const f=`${o}/${a.join("/")}`;await fetch(f,{method:"PUT",headers:{"Content-Type":"application/json",Authorization:`Basic ${btoa("Test:xwikirox")}`},body:JSON.stringify({content:t,title:n,syntax:"markdown/1.2"})})}};io=ah([Ke(),sh(0,je("Logger"))],io);var uh=Object.defineProperty,ch=Object.getOwnPropertyDescriptor,lh=(e,t,n,o)=>{for(var a=o>1?void 0:o?ch(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&uh(t,n,a),a},Fr=(e,t)=>(n,o)=>t(n,o,e);let oo=class extends jr{constructor(e,t,n){super(e),this.cristal=n,this.storage=t,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="Main.WebHome")}isSupported(e){return e=="html"||e=="jsonld"}defaultPageName(){return"Main.WebHome"}};oo=lh([Ke(),Fr(0,je("Logger")),Fr(1,je("Storage")),Fr(1,Ma("XWiki")),Fr(2,je("CristalApp"))],oo);var fh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,dh=(e,t,n,o)=>{for(var a=o>1?void 0:o?hh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&fh(t,n,a),a},ph=(e,t)=>(n,o)=>t(n,o,e);let ao=class extends Lr{constructor(e){super(e,"storage.components.githubStorage"),this.hashCode=function(t){let n=0,o,a;if(t.length===0)return""+n;for(o=0;o<t.length;o++)a=t.charCodeAt(o),n=(n<<5)-n+a,n|=0;return""+n}}async isStorageReady(){return!0}getPageRestURL(e,t){var n;return(n=this.logger)==null||n.debug("GitHub Loading page",e),this.wikiConfig.baseRestURL+e}getPageFromViewURL(e){let t=null;return e.startsWith(this.wikiConfig.baseURL)&&(t=e.replace(this.wikiConfig.baseURL,"")),t}getImageURL(e,t){return this.wikiConfig.baseRestURL+t}async getPageContent(e,t){var g;(g=this.logger)==null||g.debug("GitHub Loading page",e);const n=this.getPageRestURL(e,t),a=await(await fetch(n,{cache:"no-store"})).text();let u="";t=="json"?u="":t=="md"||t=="html"?u=a:u="";const f=new Vn;return f.source=u,f.syntax="md",f.css=[],f.version=this.hashCode(u),f}async getPanelContent(){return new Vn}async getEditField(){return""}save(){throw new Error("Save not supported")}};ao=dh([Ke(),ph(0,je("Logger"))],ao);var gh=Object.defineProperty,vh=Object.getOwnPropertyDescriptor,yh=(e,t,n,o)=>{for(var a=o>1?void 0:o?vh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&gh(t,n,a),a},Br=(e,t)=>(n,o)=>t(n,o,e);let so=class extends jr{constructor(e,t,n){super(e),this.storage=t,this.cristal=n,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="README.md")}defaultPageName(){return"README"}};so=yh([Ke(),Br(0,je("Logger")),Br(1,je("Storage")),Br(1,Ma("GitHub")),Br(2,je("CristalApp"))],so);var mh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,_h=(e,t,n,o)=>{for(var a=o>1?void 0:o?bh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&mh(t,n,a),a},uo=(e,t)=>(n,o)=>t(n,o,e);let co=class{constructor(e,t,n){this.logger=e,this.logger.setModule("storage.components.wrappingOfflineStorage"),this.offlineStorage=t,this.queueWorker=n}setStorage(e){this.storage=e}getStorage(){return this.storage}setWikiConfig(e){return this.storage.setWikiConfig(e)}getWikiConfig(){return this.storage.getWikiConfig()}async isStorageReady(){return this.storage.isStorageReady()}getPageRestURL(e,t){return this.storage.getPageRestURL(e,t)}getPageFromViewURL(e){return this.storage.getPageFromViewURL(e)}getImageURL(e,t){return this.storage.getImageURL(e,t)}async getPageContent(e,t,n){if(this.logger.debug("Trying to get data for page ",e),this.offlineStorage){this.logger.debug("Asking offline storage for ",e);const o=await this.offlineStorage.getPage(this.getWikiConfig().name,e+"_"+t);return o!=null&&o!=null?(this.logger.debug("Loading data from local storage for page",e),(n==null||n)&&this.queueWorker.addToQueue(this.getWikiConfig().name+":"+e+"_"+t),o):(this.logger.debug("Could not find data in local storage for page",e),this.savePageContent(e,t))}else return this.logger.debug("No offline local storage available"),this.storage.getPageContent(e,t)}async savePageContent(e,t){const n=await this.storage.getPageContent(e,t);if(n)return n.id=e+"_"+t,this.logger.debug("Saving page to offline storage",e),this.offlineStorage.savePage(this.getWikiConfig().name,e+"_"+t,n),n;throw new Error("Can't save missing page.")}async updatePageContent(e,t){const n=await this.offlineStorage.getPage(this.getWikiConfig().name,e+"_"+t),o=await this.storage.getPageContent(e,t);return n&&o?(o.id=e+"_"+t,this.logger.debug("Saving page to offline storage",e),this.offlineStorage.savePage(this.getWikiConfig().name,e+"_"+t,o),!0):(n==null?void 0:n.version)!=(o==null?void 0:o.version)&&o?(o.id=e+"_"+t,this.logger.debug("Updating page to offline storage",e),this.offlineStorage.updatePage(this.getWikiConfig().name,e+"_"+t,o),!0):(this.logger.debug("Local storage not updated, because version are identical"),!1)}async getPanelContent(e,t,n){return this.storage.getPanelContent(e,t,n)}async getEditField(e,t){return await this.storage.getEditField(e,t)}save(e,t,n,o){return this.storage.save(e,t,n,o)}};co=_h([Ke(),uo(0,je("Logger")),uo(1,je("OfflineStorage")),uo(2,je("QueueWorker"))],co);var Ps={exports:{}};(function(e,t){(function(n,o){e.exports=o()})(vr,function(){var n=function(r,i){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,c){s.__proto__=c}||function(s,c){for(var l in c)Object.prototype.hasOwnProperty.call(c,l)&&(s[l]=c[l])})(r,i)},o=function(){return(o=Object.assign||function(r){for(var i,s=1,c=arguments.length;s<c;s++)for(var l in i=arguments[s])Object.prototype.hasOwnProperty.call(i,l)&&(r[l]=i[l]);return r}).apply(this,arguments)};function a(r,i,s){for(var c,l=0,h=i.length;l<h;l++)!c&&l in i||((c=c||Array.prototype.slice.call(i,0,l))[l]=i[l]);return r.concat(c||Array.prototype.slice.call(i))}var u=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:vr,f=Object.keys,g=Array.isArray;function S(r,i){return typeof i!="object"||f(i).forEach(function(s){r[s]=i[s]}),r}typeof Promise>"u"||u.Promise||(u.Promise=Promise);var p=Object.getPrototypeOf,I={}.hasOwnProperty;function P(r,i){return I.call(r,i)}function B(r,i){typeof i=="function"&&(i=i(p(r))),(typeof Reflect>"u"?f:Reflect.ownKeys)(i).forEach(function(s){Z(r,s,i[s])})}var Q=Object.defineProperty;function Z(r,i,s,c){Q(r,i,S(s&&P(s,"get")&&typeof s.get=="function"?{get:s.get,set:s.set,configurable:!0}:{value:s,configurable:!0,writable:!0},c))}function fe(r){return{from:function(i){return r.prototype=Object.create(i.prototype),Z(r.prototype,"constructor",r),{extend:B.bind(null,r.prototype)}}}}var ze=Object.getOwnPropertyDescriptor,We=[].slice;function $e(r,i,s){return We.call(r,i,s)}function mt(r,i){return i(r)}function Se(r){if(!r)throw new Error("Assertion Failed")}function Pt(r){u.setImmediate?setImmediate(r):setTimeout(r,0)}function te(r,i){if(typeof i=="string"&&P(r,i))return r[i];if(!i)return r;if(typeof i!="string"){for(var s=[],c=0,l=i.length;c<l;++c){var h=te(r,i[c]);s.push(h)}return s}var d=i.indexOf(".");if(d!==-1){var v=r[i.substr(0,d)];return v==null?void 0:te(v,i.substr(d+1))}}function Ce(r,i,s){if(r&&i!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof i!="string"&&"length"in i){Se(typeof s!="string"&&"length"in s);for(var c=0,l=i.length;c<l;++c)Ce(r,i[c],s[c])}else{var h,d,v=i.indexOf(".");v!==-1?(h=i.substr(0,v),(d=i.substr(v+1))===""?s===void 0?g(r)&&!isNaN(parseInt(h))?r.splice(h,1):delete r[h]:r[h]=s:Ce(v=!(v=r[h])||!P(r,h)?r[h]={}:v,d,s)):s===void 0?g(r)&&!isNaN(parseInt(i))?r.splice(i,1):delete r[i]:r[i]=s}}function vn(r){var i,s={};for(i in r)P(r,i)&&(s[i]=r[i]);return s}var vo=[].concat;function Kr(r){return vo.apply([],r)}var Et="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Kr([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(i){return i+r+"Array"})}))).filter(function(r){return u[r]}),Vr=new Set(Et.map(function(r){return u[r]})),zt=null;function ct(r){return zt=new WeakMap,r=function i(s){if(!s||typeof s!="object")return s;var c=zt.get(s);if(c)return c;if(g(s)){c=[],zt.set(s,c);for(var l=0,h=s.length;l<h;++l)c.push(i(s[l]))}else if(Vr.has(s.constructor))c=s;else{var d,v=p(s);for(d in c=v===Object.prototype?{}:Object.create(v),zt.set(s,c),s)P(s,d)&&(c[d]=i(s[d]))}return c}(r),zt=null,r}var Wr={}.toString;function Ht(r){return Wr.call(r).slice(8,-1)}var yn=typeof Symbol<"u"?Symbol.iterator:"@@iterator",$r=typeof yn=="symbol"?function(r){var i;return r!=null&&(i=r[yn])&&i.apply(r)}:function(){return null};function lt(r,i){return i=r.indexOf(i),0<=i&&r.splice(i,1),0<=i}var bt={};function et(r){var i,s,c,l;if(arguments.length===1){if(g(r))return r.slice();if(this===bt&&typeof r=="string")return[r];if(l=$r(r)){for(s=[];!(c=l.next()).done;)s.push(c.value);return s}if(r==null)return[r];if(typeof(i=r.length)!="number")return[r];for(s=new Array(i);i--;)s[i]=r[i];return s}for(i=arguments.length,s=new Array(i);i--;)s[i]=arguments[i];return s}var mn=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},Qt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],tt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Qt),J={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed",MissingAPI:"IndexedDB API missing. Please visit https://tinyurl.com/y2uuvskb"};function He(r,i){this.name=r,this.message=i}function Ur(r,i){return r+". Errors: "+Object.keys(i).map(function(s){return i[s].toString()}).filter(function(s,c,l){return l.indexOf(s)===c}).join(`
|
|
160
|
+
`)}function ye(r,i,s,c){this.failures=i,this.failedKeys=c,this.successCount=s,this.message=Ur(r,i)}function Tt(r,i){this.name="BulkError",this.failures=Object.keys(i).map(function(s){return i[s]}),this.failuresByPos=i,this.message=Ur(r,this.failures)}fe(He).from(Error).extend({toString:function(){return this.name+": "+this.message}}),fe(ye).from(He),fe(Tt).from(He);var $n=tt.reduce(function(r,i){return r[i]=i+"Error",r},{}),qr=He,Y=tt.reduce(function(r,i){var s=i+"Error";function c(l,h){this.name=s,l?typeof l=="string"?(this.message="".concat(l).concat(h?`
|
|
161
|
+
`+h:""),this.inner=h||null):typeof l=="object"&&(this.message="".concat(l.name," ").concat(l.message),this.inner=l):(this.message=J[i]||s,this.inner=null)}return fe(c).from(qr),r[i]=c,r},{});Y.Syntax=SyntaxError,Y.Type=TypeError,Y.Range=RangeError;var Ge=Qt.reduce(function(r,i){return r[i+"Error"]=Y[i],r},{}),Gt=tt.reduce(function(r,i){return["Syntax","Type","Range"].indexOf(i)===-1&&(r[i+"Error"]=Y[i]),r},{});function se(){}function It(r){return r}function yo(r,i){return r==null||r===It?i:function(s){return i(r(s))}}function ot(r,i){return function(){r.apply(this,arguments),i.apply(this,arguments)}}function zr(r,i){return r===se?i:function(){var s=r.apply(this,arguments);s!==void 0&&(arguments[0]=s);var c=this.onsuccess,l=this.onerror;this.onsuccess=null,this.onerror=null;var h=i.apply(this,arguments);return c&&(this.onsuccess=this.onsuccess?ot(c,this.onsuccess):c),l&&(this.onerror=this.onerror?ot(l,this.onerror):l),h!==void 0?h:s}}function Hr(r,i){return r===se?i:function(){r.apply(this,arguments);var s=this.onsuccess,c=this.onerror;this.onsuccess=this.onerror=null,i.apply(this,arguments),s&&(this.onsuccess=this.onsuccess?ot(s,this.onsuccess):s),c&&(this.onerror=this.onerror?ot(c,this.onerror):c)}}function Gr(r,i){return r===se?i:function(s){var c=r.apply(this,arguments);S(s,c);var l=this.onsuccess,h=this.onerror;return this.onsuccess=null,this.onerror=null,s=i.apply(this,arguments),l&&(this.onsuccess=this.onsuccess?ot(l,this.onsuccess):l),h&&(this.onerror=this.onerror?ot(h,this.onerror):h),c===void 0?s===void 0?void 0:s:S(c,s)}}function Yr(r,i){return r===se?i:function(){return i.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function bn(r,i){return r===se?i:function(){var s=r.apply(this,arguments);if(s&&typeof s.then=="function"){for(var c=this,l=arguments.length,h=new Array(l);l--;)h[l]=arguments[l];return s.then(function(){return i.apply(c,h)})}return i.apply(this,arguments)}}Gt.ModifyError=ye,Gt.DexieError=He,Gt.BulkError=Tt;var Ue=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Qr(r){Ue=r}var Yt={},Jr=100,Et=typeof Promise>"u"?[]:function(){var r=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[r,p(r),r];var i=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[i,p(i),r]}(),Qt=Et[0],tt=Et[1],Et=Et[2],tt=tt&&tt.then,at=Qt&&Qt.constructor,Un=!!Et,Jt=function(r,i){me.push([r,i]),Dt&&(queueMicrotask(Ye),Dt=!1)},qn=!0,Dt=!0,C=[],D=[],j=It,K={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:se,pgp:!1,env:{},finalize:se},F=K,me=[],de=0,ee=[];function R(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var i=this._PSD=F;if(typeof r!="function"){if(r!==Yt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&G(this,this._value))}this._state=null,this._value=null,++i.ref,function s(c,l){try{l(function(h){if(c._state===null){if(h===c)throw new TypeError("A promise cannot be resolved with itself.");var d=c._lib&&_t();h&&typeof h.then=="function"?s(c,function(v,_){h instanceof R?h._then(v,_):h.then(v,_)}):(c._state=!0,c._value=h,ne(c)),d&&Nt()}},G.bind(null,c))}catch(h){G(c,h)}}(this,r)}var z={get:function(){var r=F,i=ti;function s(c,l){var h=this,d=!r.global&&(r!==F||i!==ti),v=d&&!Mt(),_=new R(function(m,O){he(h,new H(Ns(c,r,d,v),Ns(l,r,d,v),m,O,r))});return this._consoleTask&&(_._consoleTask=this._consoleTask),_}return s.prototype=Yt,s},set:function(r){Z(this,"then",r&&r.prototype===Yt?z:{get:function(){return r},set:z.set})}};function H(r,i,s,c,l){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof i=="function"?i:null,this.resolve=s,this.reject=c,this.psd=l}function G(r,i){var s,c;D.push(i),r._state===null&&(s=r._lib&&_t(),i=j(i),r._state=!1,r._value=i,c=r,C.some(function(l){return l._value===c._value})||C.push(c),ne(r),s&&Nt())}function ne(r){var i=r._listeners;r._listeners=[];for(var s=0,c=i.length;s<c;++s)he(r,i[s]);var l=r._PSD;--l.ref||l.finalize(),de===0&&(++de,Jt(function(){--de==0&&zn()},[]))}function he(r,i){if(r._state!==null){var s=r._state?i.onFulfilled:i.onRejected;if(s===null)return(r._state?i.resolve:i.reject)(r._value);++i.psd.ref,++de,Jt(we,[s,r,i])}else r._listeners.push(i)}function we(r,i,s){try{var c,l=i._value;!i._state&&D.length&&(D=[]),c=Ue&&i._consoleTask?i._consoleTask.run(function(){return r(l)}):r(l),i._state||D.indexOf(l)!==-1||function(h){for(var d=C.length;d;)if(C[--d]._value===h._value)return C.splice(d,1)}(i),s.resolve(c)}catch(h){s.reject(h)}finally{--de==0&&zn(),--s.psd.ref||s.psd.finalize()}}function Ye(){Xt(K,function(){_t()&&Nt()})}function _t(){var r=qn;return Dt=qn=!1,r}function Nt(){var r,i,s;do for(;0<me.length;)for(r=me,me=[],s=r.length,i=0;i<s;++i){var c=r[i];c[0].apply(null,c[1])}while(0<me.length);Dt=qn=!0}function zn(){var r=C;C=[],r.forEach(function(c){c._PSD.onunhandled.call(null,c._value,c)});for(var i=ee.slice(0),s=i.length;s;)i[--s]()}function Xr(r){return new R(Yt,!1,r)}function be(r,i){var s=F;return function(){var c=_t(),l=F;try{return kt(s,!0),r.apply(this,arguments)}catch(h){i&&i(h)}finally{kt(l,!1),c&&Nt()}}}B(R.prototype,{then:z,_then:function(r,i){he(this,new H(null,null,r,i,F))},catch:function(r){if(arguments.length===1)return this.then(null,r);var i=r,s=arguments[1];return typeof i=="function"?this.then(null,function(c){return(c instanceof i?s:Xr)(c)}):this.then(null,function(c){return(c&&c.name===i?s:Xr)(c)})},finally:function(r){return this.then(function(i){return R.resolve(r()).then(function(){return i})},function(i){return R.resolve(r()).then(function(){return Xr(i)})})},timeout:function(r,i){var s=this;return r<1/0?new R(function(c,l){var h=setTimeout(function(){return l(new Y.Timeout(i))},r);s.then(c,l).finally(clearTimeout.bind(null,h))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&Z(R.prototype,Symbol.toStringTag,"Dexie.Promise"),K.env=Ds(),B(R,{all:function(){var r=et.apply(null,arguments).map(ni);return new R(function(i,s){r.length===0&&i([]);var c=r.length;r.forEach(function(l,h){return R.resolve(l).then(function(d){r[h]=d,--c||i(r)},s)})})},resolve:function(r){return r instanceof R?r:r&&typeof r.then=="function"?new R(function(i,s){r.then(i,s)}):new R(Yt,!0,r)},reject:Xr,race:function(){var r=et.apply(null,arguments).map(ni);return new R(function(i,s){r.map(function(c){return R.resolve(c).then(i,s)})})},PSD:{get:function(){return F},set:function(r){return F=r}},totalEchoes:{get:function(){return ti}},newPSD:Rt,usePSD:Xt,scheduler:{get:function(){return Jt},set:function(r){Jt=r}},rejectionMapper:{get:function(){return j},set:function(r){j=r}},follow:function(r,i){return new R(function(s,c){return Rt(function(l,h){var d=F;d.unhandleds=[],d.onunhandled=h,d.finalize=ot(function(){var v,_=this;v=function(){_.unhandleds.length===0?l():h(_.unhandleds[0])},ee.push(function m(){v(),ee.splice(ee.indexOf(m),1)}),++de,Jt(function(){--de==0&&zn()},[])},d.finalize),r()},i,s,c)})}}),at&&(at.allSettled&&Z(R,"allSettled",function(){var r=et.apply(null,arguments).map(ni);return new R(function(i){r.length===0&&i([]);var s=r.length,c=new Array(s);r.forEach(function(l,h){return R.resolve(l).then(function(d){return c[h]={status:"fulfilled",value:d}},function(d){return c[h]={status:"rejected",reason:d}}).then(function(){return--s||i(c)})})})}),at.any&&typeof AggregateError<"u"&&Z(R,"any",function(){var r=et.apply(null,arguments).map(ni);return new R(function(i,s){r.length===0&&s(new AggregateError([]));var c=r.length,l=new Array(c);r.forEach(function(h,d){return R.resolve(h).then(function(v){return i(v)},function(v){l[d]=v,--c||s(new AggregateError(l))})})})}));var Pe={awaits:0,echoes:0,id:0},kh=0,Zr=[],ei=0,ti=0,jh=0;function Rt(r,i,s,c){var l=F,h=Object.create(l);return h.parent=l,h.ref=0,h.global=!1,h.id=++jh,K.env,h.env=Un?{Promise:R,PromiseProp:{value:R,configurable:!0,writable:!0},all:R.all,race:R.race,allSettled:R.allSettled,any:R.any,resolve:R.resolve,reject:R.reject}:{},i&&S(h,i),++l.ref,h.finalize=function(){--this.parent.ref||this.parent.finalize()},c=Xt(h,r,s,c),h.ref===0&&h.finalize(),c}function _n(){return Pe.id||(Pe.id=++kh),++Pe.awaits,Pe.echoes+=Jr,Pe.id}function Mt(){return!!Pe.awaits&&(--Pe.awaits==0&&(Pe.id=0),Pe.echoes=Pe.awaits*Jr,!0)}function ni(r){return Pe.echoes&&r&&r.constructor===at?(_n(),r.then(function(i){return Mt(),i},function(i){return Mt(),Oe(i)})):r}function Lh(){var r=Zr[Zr.length-1];Zr.pop(),kt(r,!1)}function kt(r,i){var s,c=F;(i?!Pe.echoes||ei++&&r===F:!ei||--ei&&r===F)||queueMicrotask(i?(function(l){++ti,Pe.echoes&&--Pe.echoes!=0||(Pe.echoes=Pe.awaits=Pe.id=0),Zr.push(F),kt(l,!0)}).bind(null,r):Lh),r!==F&&(F=r,c===K&&(K.env=Ds()),Un&&(s=K.env.Promise,i=r.env,(c.global||r.global)&&(Object.defineProperty(u,"Promise",i.PromiseProp),s.all=i.all,s.race=i.race,s.resolve=i.resolve,s.reject=i.reject,i.allSettled&&(s.allSettled=i.allSettled),i.any&&(s.any=i.any))))}function Ds(){var r=u.Promise;return Un?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(u,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function Xt(r,i,s,c,l){var h=F;try{return kt(r,!0),i(s,c,l)}finally{kt(h,!1)}}function Ns(r,i,s,c){return typeof r!="function"?r:function(){var l=F;s&&_n(),kt(i,!0);try{return r.apply(this,arguments)}finally{kt(l,!1),c&&queueMicrotask(Mt)}}}function mo(r){Promise===at&&Pe.echoes===0?ei===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+tt).indexOf("[native code]")===-1&&(_n=Mt=se);var Oe=R.reject,Zt="",wt="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Rs="String expected.",wn=[],ri="__dbnames",bo="readonly",_o="readwrite";function en(r,i){return r?i?function(){return r.apply(this,arguments)&&i.apply(this,arguments)}:r:i}var Ms={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function ii(r){return typeof r!="string"||/\./.test(r)?function(i){return i}:function(i){return i[r]===void 0&&r in i&&delete(i=ct(i))[r],i}}function ks(){throw Y.Type()}function le(r,i){try{var s=js(r),c=js(i);if(s!==c)return s==="Array"?1:c==="Array"?-1:s==="binary"?1:c==="binary"?-1:s==="string"?1:c==="string"?-1:s==="Date"?1:c!=="Date"?NaN:-1;switch(s){case"number":case"Date":case"string":return i<r?1:r<i?-1:0;case"binary":return function(l,h){for(var d=l.length,v=h.length,_=d<v?d:v,m=0;m<_;++m)if(l[m]!==h[m])return l[m]<h[m]?-1:1;return d===v?0:d<v?-1:1}(Ls(r),Ls(i));case"Array":return function(l,h){for(var d=l.length,v=h.length,_=d<v?d:v,m=0;m<_;++m){var O=le(l[m],h[m]);if(O!==0)return O}return d===v?0:d<v?-1:1}(r,i)}}catch{}return NaN}function js(r){var i=typeof r;return i!="object"?i:ArrayBuffer.isView(r)?"binary":(r=Ht(r),r==="ArrayBuffer"?"binary":r)}function Ls(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}var Fs=(ve.prototype._trans=function(r,i,s){var c=this._tx||F.trans,l=this.name,h=Ue&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function d(m,O,y){if(!y.schema[l])throw new Y.NotFound("Table "+l+" not part of transaction");return i(y.idbtrans,y)}var v=_t();try{var _=c&&c.db._novip===this.db._novip?c===F.trans?c._promise(r,d,s):Rt(function(){return c._promise(r,d,s)},{trans:c,transless:F.transless||F}):function m(O,y,x,b){if(O.idbdb&&(O._state.openComplete||F.letThrough||O._vip)){var E=O._createTransaction(y,x,O._dbSchema);try{E.create(),O._state.PR1398_maxLoop=3}catch(A){return A.name===$n.InvalidState&&O.isOpen()&&0<--O._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),O.close({disableAutoOpen:!1}),O.open().then(function(){return m(O,y,x,b)})):Oe(A)}return E._promise(y,function(A,w){return Rt(function(){return F.trans=E,b(A,w,E)})}).then(function(A){if(y==="readwrite")try{E.idbtrans.commit()}catch{}return y==="readonly"?A:E._completion.then(function(){return A})})}if(O._state.openComplete)return Oe(new Y.DatabaseClosed(O._state.dbOpenError));if(!O._state.isBeingOpened){if(!O._state.autoOpen)return Oe(new Y.DatabaseClosed);O.open().catch(se)}return O._state.dbReadyPromise.then(function(){return m(O,y,x,b)})}(this.db,r,[this.name],d);return h&&(_._consoleTask=h,_=_.catch(function(m){return console.trace(m),Oe(m)})),_}finally{v&&Nt()}},ve.prototype.get=function(r,i){var s=this;return r&&r.constructor===Object?this.where(r).first(i):r==null?Oe(new Y.Type("Invalid argument to Table.get()")):this._trans("readonly",function(c){return s.core.get({trans:c,key:r}).then(function(l){return s.hook.reading.fire(l)})}).then(i)},ve.prototype.where=function(r){if(typeof r=="string")return new this.db.WhereClause(this,r);if(g(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var i=f(r);if(i.length===1)return this.where(i[0]).equals(r[i[0]]);var s=this.schema.indexes.concat(this.schema.primKey).filter(function(_){if(_.compound&&i.every(function(O){return 0<=_.keyPath.indexOf(O)})){for(var m=0;m<i.length;++m)if(i.indexOf(_.keyPath[m])===-1)return!1;return!0}return!1}).sort(function(_,m){return _.keyPath.length-m.keyPath.length})[0];if(s&&this.db._maxKey!==Zt){var d=s.keyPath.slice(0,i.length);return this.where(d).equals(d.map(function(m){return r[m]}))}!s&&Ue&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(i.join("+"),"]"));var c=this.schema.idxByName,l=this.db._deps.indexedDB;function h(_,m){return l.cmp(_,m)===0}var v=i.reduce(function(x,m){var O=x[0],y=x[1],x=c[m],b=r[m];return[O||x,O||!x?en(y,x&&x.multi?function(E){return E=te(E,m),g(E)&&E.some(function(A){return h(b,A)})}:function(E){return h(b,te(E,m))}):y]},[null,null]),d=v[0],v=v[1];return d?this.where(d.name).equals(r[d.keyPath]).filter(v):s?this.filter(v):this.where(i).equals("")},ve.prototype.filter=function(r){return this.toCollection().and(r)},ve.prototype.count=function(r){return this.toCollection().count(r)},ve.prototype.offset=function(r){return this.toCollection().offset(r)},ve.prototype.limit=function(r){return this.toCollection().limit(r)},ve.prototype.each=function(r){return this.toCollection().each(r)},ve.prototype.toArray=function(r){return this.toCollection().toArray(r)},ve.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},ve.prototype.orderBy=function(r){return new this.db.Collection(new this.db.WhereClause(this,g(r)?"[".concat(r.join("+"),"]"):r))},ve.prototype.reverse=function(){return this.toCollection().reverse()},ve.prototype.mapToClass=function(r){var i,s=this.db,c=this.name;function l(){return i!==null&&i.apply(this,arguments)||this}(this.schema.mappedClass=r).prototype instanceof ks&&(function(_,m){if(typeof m!="function"&&m!==null)throw new TypeError("Class extends value "+String(m)+" is not a constructor or null");function O(){this.constructor=_}n(_,m),_.prototype=m===null?Object.create(m):(O.prototype=m.prototype,new O)}(l,i=r),Object.defineProperty(l.prototype,"db",{get:function(){return s},enumerable:!1,configurable:!0}),l.prototype.table=function(){return c},r=l);for(var h=new Set,d=r.prototype;d;d=p(d))Object.getOwnPropertyNames(d).forEach(function(_){return h.add(_)});function v(_){if(!_)return _;var m,O=Object.create(r.prototype);for(m in _)if(!h.has(m))try{O[m]=_[m]}catch{}return O}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=v,this.hook("reading",v),r},ve.prototype.defineClass=function(){return this.mapToClass(function(r){S(this,r)})},ve.prototype.add=function(r,i){var s=this,c=this.schema.primKey,l=c.auto,h=c.keyPath,d=r;return h&&l&&(d=ii(h)(r)),this._trans("readwrite",function(v){return s.core.mutate({trans:v,type:"add",keys:i!=null?[i]:null,values:[d]})}).then(function(v){return v.numFailures?R.reject(v.failures[0]):v.lastResult}).then(function(v){if(h)try{Ce(r,h,v)}catch{}return v})},ve.prototype.update=function(r,i){return typeof r!="object"||g(r)?this.where(":id").equals(r).modify(i):(r=te(r,this.schema.primKey.keyPath),r===void 0?Oe(new Y.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(i))},ve.prototype.put=function(r,i){var s=this,c=this.schema.primKey,l=c.auto,h=c.keyPath,d=r;return h&&l&&(d=ii(h)(r)),this._trans("readwrite",function(v){return s.core.mutate({trans:v,type:"put",values:[d],keys:i!=null?[i]:null})}).then(function(v){return v.numFailures?R.reject(v.failures[0]):v.lastResult}).then(function(v){if(h)try{Ce(r,h,v)}catch{}return v})},ve.prototype.delete=function(r){var i=this;return this._trans("readwrite",function(s){return i.core.mutate({trans:s,type:"delete",keys:[r]})}).then(function(s){return s.numFailures?R.reject(s.failures[0]):void 0})},ve.prototype.clear=function(){var r=this;return this._trans("readwrite",function(i){return r.core.mutate({trans:i,type:"deleteRange",range:Ms})}).then(function(i){return i.numFailures?R.reject(i.failures[0]):void 0})},ve.prototype.bulkGet=function(r){var i=this;return this._trans("readonly",function(s){return i.core.getMany({keys:r,trans:s}).then(function(c){return c.map(function(l){return i.hook.reading.fire(l)})})})},ve.prototype.bulkAdd=function(r,i,s){var c=this,l=Array.isArray(i)?i:void 0,h=(s=s||(l?void 0:i))?s.allKeys:void 0;return this._trans("readwrite",function(d){var m=c.schema.primKey,v=m.auto,m=m.keyPath;if(m&&l)throw new Y.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(l&&l.length!==r.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var _=r.length,m=m&&v?r.map(ii(m)):r;return c.core.mutate({trans:d,type:"add",keys:l,values:m,wantResults:h}).then(function(E){var y=E.numFailures,x=E.results,b=E.lastResult,E=E.failures;if(y===0)return h?x:b;throw new Tt("".concat(c.name,".bulkAdd(): ").concat(y," of ").concat(_," operations failed"),E)})})},ve.prototype.bulkPut=function(r,i,s){var c=this,l=Array.isArray(i)?i:void 0,h=(s=s||(l?void 0:i))?s.allKeys:void 0;return this._trans("readwrite",function(d){var m=c.schema.primKey,v=m.auto,m=m.keyPath;if(m&&l)throw new Y.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(l&&l.length!==r.length)throw new Y.InvalidArgument("Arguments objects and keys must have the same length");var _=r.length,m=m&&v?r.map(ii(m)):r;return c.core.mutate({trans:d,type:"put",keys:l,values:m,wantResults:h}).then(function(E){var y=E.numFailures,x=E.results,b=E.lastResult,E=E.failures;if(y===0)return h?x:b;throw new Tt("".concat(c.name,".bulkPut(): ").concat(y," of ").concat(_," operations failed"),E)})})},ve.prototype.bulkUpdate=function(r){var i=this,s=this.core,c=r.map(function(d){return d.key}),l=r.map(function(d){return d.changes}),h=[];return this._trans("readwrite",function(d){return s.getMany({trans:d,keys:c,cache:"clone"}).then(function(v){var _=[],m=[];r.forEach(function(y,x){var b=y.key,E=y.changes,A=v[x];if(A){for(var w=0,T=Object.keys(E);w<T.length;w++){var N=T[w],M=E[N];if(N===i.schema.primKey.keyPath){if(le(M,b)!==0)throw new Y.Constraint("Cannot update primary key in bulkUpdate()")}else Ce(A,N,M)}h.push(x),_.push(b),m.push(A)}});var O=_.length;return s.mutate({trans:d,type:"put",keys:_,values:m,updates:{keys:c,changeSpecs:l}}).then(function(y){var x=y.numFailures,b=y.failures;if(x===0)return O;for(var E=0,A=Object.keys(b);E<A.length;E++){var w,T=A[E],N=h[Number(T)];N!=null&&(w=b[T],delete b[T],b[N]=w)}throw new Tt("".concat(i.name,".bulkUpdate(): ").concat(x," of ").concat(O," operations failed"),b)})})})},ve.prototype.bulkDelete=function(r){var i=this,s=r.length;return this._trans("readwrite",function(c){return i.core.mutate({trans:c,type:"delete",keys:r})}).then(function(d){var l=d.numFailures,h=d.lastResult,d=d.failures;if(l===0)return h;throw new Tt("".concat(i.name,".bulkDelete(): ").concat(l," of ").concat(s," operations failed"),d)})},ve);function ve(){}function Hn(r){function i(d,v){if(v){for(var _=arguments.length,m=new Array(_-1);--_;)m[_-1]=arguments[_];return s[d].subscribe.apply(null,m),r}if(typeof d=="string")return s[d]}var s={};i.addEventType=h;for(var c=1,l=arguments.length;c<l;++c)h(arguments[c]);return i;function h(d,v,_){if(typeof d!="object"){var m;v=v||Yr;var O={subscribers:[],fire:_=_||se,subscribe:function(y){O.subscribers.indexOf(y)===-1&&(O.subscribers.push(y),O.fire=v(O.fire,y))},unsubscribe:function(y){O.subscribers=O.subscribers.filter(function(x){return x!==y}),O.fire=O.subscribers.reduce(v,_)}};return s[d]=i[d]=O}f(m=d).forEach(function(y){var x=m[y];if(g(x))h(y,m[y][0],m[y][1]);else{if(x!=="asap")throw new Y.InvalidArgument("Invalid event config");var b=h(y,It,function(){for(var E=arguments.length,A=new Array(E);E--;)A[E]=arguments[E];b.subscribers.forEach(function(w){Pt(function(){w.apply(null,A)})})})}})}}function Gn(r,i){return fe(i).from({prototype:r}),i}function En(r,i){return!(r.filter||r.algorithm||r.or)&&(i?r.justLimit:!r.replayFilter)}function wo(r,i){r.filter=en(r.filter,i)}function Eo(r,i,s){var c=r.replayFilter;r.replayFilter=c?function(){return en(c(),i())}:i,r.justLimit=s&&!c}function oi(r,i){if(r.isPrimKey)return i.primaryKey;var s=i.getIndexByKeyPath(r.index);if(!s)throw new Y.Schema("KeyPath "+r.index+" on object store "+i.name+" is not indexed");return s}function Bs(r,i,s){var c=oi(r,i.schema);return i.openCursor({trans:s,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:c,range:r.range}})}function ai(r,i,s,c){var l=r.replayFilter?en(r.filter,r.replayFilter()):r.filter;if(r.or){var h={},d=function(v,_,m){var O,y;l&&!l(_,m,function(x){return _.stop(x)},function(x){return _.fail(x)})||((y=""+(O=_.primaryKey))=="[object ArrayBuffer]"&&(y=""+new Uint8Array(O)),P(h,y)||(h[y]=!0,i(v,_,m)))};return Promise.all([r.or._iterate(d,s),Ks(Bs(r,c,s),r.algorithm,d,!r.keysOnly&&r.valueMapper)])}return Ks(Bs(r,c,s),en(r.algorithm,l),i,!r.keysOnly&&r.valueMapper)}function Ks(r,i,s,c){var l=be(c?function(h,d,v){return s(c(h),d,v)}:s);return r.then(function(h){if(h)return h.start(function(){var d=function(){return h.continue()};i&&!i(h,function(v){return d=v},function(v){h.stop(v),d=se},function(v){h.fail(v),d=se})||l(h.value,h,function(v){return d=v}),d()})})}var Et=Symbol(),So=(Vs.prototype.execute=function(r){var i=(i=this.replacePrefix)===null||i===void 0?void 0:i[0];return i&&typeof r=="string"&&r.startsWith(i)?this.replacePrefix[1]+r.substring(i.length):r},Vs);function Vs(r){Object.assign(this,r)}var Fh=(ue.prototype._read=function(r,i){var s=this._ctx;return s.error?s.table._trans(null,Oe.bind(null,s.error)):s.table._trans("readonly",r).then(i)},ue.prototype._write=function(r){var i=this._ctx;return i.error?i.table._trans(null,Oe.bind(null,i.error)):i.table._trans("readwrite",r,"locked")},ue.prototype._addAlgorithm=function(r){var i=this._ctx;i.algorithm=en(i.algorithm,r)},ue.prototype._iterate=function(r,i){return ai(this._ctx,r,i,this._ctx.table.core)},ue.prototype.clone=function(r){var i=Object.create(this.constructor.prototype),s=Object.create(this._ctx);return r&&S(s,r),i._ctx=s,i},ue.prototype.raw=function(){return this._ctx.valueMapper=null,this},ue.prototype.each=function(r){var i=this._ctx;return this._read(function(s){return ai(i,r,s,i.table.core)})},ue.prototype.count=function(r){var i=this;return this._read(function(s){var c=i._ctx,l=c.table.core;if(En(c,!0))return l.count({trans:s,query:{index:oi(c,l.schema),range:c.range}}).then(function(d){return Math.min(d,c.limit)});var h=0;return ai(c,function(){return++h,!1},s,l).then(function(){return h})}).then(r)},ue.prototype.sortBy=function(r,i){var s=r.split(".").reverse(),c=s[0],l=s.length-1;function h(_,m){return m?h(_[s[m]],m-1):_[c]}var d=this._ctx.dir==="next"?1:-1;function v(_,m){return _=h(_,l),m=h(m,l),_<m?-d:m<_?d:0}return this.toArray(function(_){return _.sort(v)}).then(i)},ue.prototype.toArray=function(r){var i=this;return this._read(function(s){var c=i._ctx;if(c.dir==="next"&&En(c,!0)&&0<c.limit){var l=c.valueMapper,h=oi(c,c.table.core.schema);return c.table.core.query({trans:s,limit:c.limit,values:!0,query:{index:h,range:c.range}}).then(function(v){return v=v.result,l?v.map(l):v})}var d=[];return ai(c,function(v){return d.push(v)},s,c.table.core).then(function(){return d})},r)},ue.prototype.offset=function(r){var i=this._ctx;return r<=0||(i.offset+=r,En(i)?Eo(i,function(){var s=r;return function(c,l){return s===0||(s===1?--s:l(function(){c.advance(s),s=0}),!1)}}):Eo(i,function(){var s=r;return function(){return--s<0}})),this},ue.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),Eo(this._ctx,function(){var i=r;return function(s,c,l){return--i<=0&&c(l),0<=i}},!0),this},ue.prototype.until=function(r,i){return wo(this._ctx,function(s,c,l){return!r(s.value)||(c(l),i)}),this},ue.prototype.first=function(r){return this.limit(1).toArray(function(i){return i[0]}).then(r)},ue.prototype.last=function(r){return this.reverse().first(r)},ue.prototype.filter=function(r){var i;return wo(this._ctx,function(s){return r(s.value)}),(i=this._ctx).isMatch=en(i.isMatch,r),this},ue.prototype.and=function(r){return this.filter(r)},ue.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},ue.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},ue.prototype.desc=function(){return this.reverse()},ue.prototype.eachKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(s,c){r(c.key,c)})},ue.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},ue.prototype.eachPrimaryKey=function(r){var i=this._ctx;return i.keysOnly=!i.isMatch,this.each(function(s,c){r(c.primaryKey,c)})},ue.prototype.keys=function(r){var i=this._ctx;i.keysOnly=!i.isMatch;var s=[];return this.each(function(c,l){s.push(l.key)}).then(function(){return s}).then(r)},ue.prototype.primaryKeys=function(r){var i=this._ctx;if(i.dir==="next"&&En(i,!0)&&0<i.limit)return this._read(function(c){var l=oi(i,i.table.core.schema);return i.table.core.query({trans:c,values:!1,limit:i.limit,query:{index:l,range:i.range}})}).then(function(c){return c.result}).then(r);i.keysOnly=!i.isMatch;var s=[];return this.each(function(c,l){s.push(l.primaryKey)}).then(function(){return s}).then(r)},ue.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},ue.prototype.firstKey=function(r){return this.limit(1).keys(function(i){return i[0]}).then(r)},ue.prototype.lastKey=function(r){return this.reverse().firstKey(r)},ue.prototype.distinct=function(){var r=this._ctx,r=r.index&&r.table.schema.idxByName[r.index];if(!r||!r.multi)return this;var i={};return wo(this._ctx,function(l){var c=l.primaryKey.toString(),l=P(i,c);return i[c]=!0,!l}),this},ue.prototype.modify=function(r){var i=this,s=this._ctx;return this._write(function(c){var l,h,d;d=typeof r=="function"?r:(l=f(r),h=l.length,function(w){for(var T=!1,N=0;N<h;++N){var M=l[N],k=r[M],L=te(w,M);k instanceof So?(Ce(w,M,k.execute(L)),T=!0):L!==k&&(Ce(w,M,k),T=!0)}return T});function v(w,M){var N=M.failures,M=M.numFailures;E+=w-M;for(var k=0,L=f(N);k<L.length;k++){var $=L[k];b.push(N[$])}}var _=s.table.core,m=_.schema.primaryKey,O=m.outbound,y=m.extractKey,x=i.db._options.modifyChunkSize||200,b=[],E=0,A=[];return i.clone().primaryKeys().then(function(w){function T(N){var M=Math.min(x,w.length-N);return _.getMany({trans:c,keys:w.slice(N,N+M),cache:"immutable"}).then(function(k){for(var L=[],$=[],V=O?[]:null,W=[],U=0;U<M;++U){var q=k[U],X={value:ct(q),primKey:w[N+U]};d.call(X,X.value,X)!==!1&&(X.value==null?W.push(w[N+U]):O||le(y(q),y(X.value))===0?($.push(X.value),O&&V.push(w[N+U])):(W.push(w[N+U]),L.push(X.value)))}var re=En(s)&&s.limit===1/0&&(typeof r!="function"||r===Oo)&&{index:s.index,range:s.range};return Promise.resolve(0<L.length&&_.mutate({trans:c,type:"add",values:L}).then(function(ae){for(var ie in ae.failures)W.splice(parseInt(ie),1);v(L.length,ae)})).then(function(){return(0<$.length||re&&typeof r=="object")&&_.mutate({trans:c,type:"put",keys:V,values:$,criteria:re,changeSpec:typeof r!="function"&&r}).then(function(ae){return v($.length,ae)})}).then(function(){return(0<W.length||re&&r===Oo)&&_.mutate({trans:c,type:"delete",keys:W,criteria:re}).then(function(ae){return v(W.length,ae)})}).then(function(){return w.length>N+M&&T(N+x)})})}return T(0).then(function(){if(0<b.length)throw new ye("Error modifying one or more objects",b,E,A);return w.length})})})},ue.prototype.delete=function(){var r=this._ctx,i=r.range;return En(r)&&(r.isPrimKey||i.type===3)?this._write(function(s){var c=r.table.core.schema.primaryKey,l=i;return r.table.core.count({trans:s,query:{index:c,range:l}}).then(function(h){return r.table.core.mutate({trans:s,type:"deleteRange",range:l}).then(function(d){var v=d.failures;if(d.lastResult,d.results,d=d.numFailures,d)throw new ye("Could not delete some values",Object.keys(v).map(function(_){return v[_]}),h-d);return h-d})})}):this.modify(Oo)},ue);function ue(){}var Oo=function(r,i){return i.value=null};function Bh(r,i){return r<i?-1:r===i?0:1}function Kh(r,i){return i<r?-1:r===i?0:1}function Qe(r,i,s){return r=r instanceof $s?new r.Collection(r):r,r._ctx.error=new(s||TypeError)(i),r}function Sn(r){return new r.Collection(r,function(){return Ws("")}).limit(0)}function si(r,i,s,c){var l,h,d,v,_,m,O,y=s.length;if(!s.every(function(E){return typeof E=="string"}))return Qe(r,Rs);function x(E){l=E==="next"?function(w){return w.toUpperCase()}:function(w){return w.toLowerCase()},h=E==="next"?function(w){return w.toLowerCase()}:function(w){return w.toUpperCase()},d=E==="next"?Bh:Kh;var A=s.map(function(w){return{lower:h(w),upper:l(w)}}).sort(function(w,T){return d(w.lower,T.lower)});v=A.map(function(w){return w.upper}),_=A.map(function(w){return w.lower}),O=(m=E)==="next"?"":c}x("next"),r=new r.Collection(r,function(){return jt(v[0],_[y-1]+c)}),r._ondirectionchange=function(E){x(E)};var b=0;return r._addAlgorithm(function(E,A,w){var T=E.key;if(typeof T!="string")return!1;var N=h(T);if(i(N,_,b))return!0;for(var M=null,k=b;k<y;++k){var L=function($,V,W,U,q,X){for(var re=Math.min($.length,U.length),ae=-1,ie=0;ie<re;++ie){var st=V[ie];if(st!==U[ie])return q($[ie],W[ie])<0?$.substr(0,ie)+W[ie]+W.substr(ie+1):q($[ie],U[ie])<0?$.substr(0,ie)+U[ie]+W.substr(ie+1):0<=ae?$.substr(0,ae)+V[ae]+W.substr(ae+1):null;q($[ie],st)<0&&(ae=ie)}return re<U.length&&X==="next"?$+W.substr($.length):re<$.length&&X==="prev"?$.substr(0,W.length):ae<0?null:$.substr(0,ae)+U[ae]+W.substr(ae+1)}(T,N,v[k],_[k],d,m);L===null&&M===null?b=k+1:(M===null||0<d(M,L))&&(M=L)}return A(M!==null?function(){E.continue(M+O)}:w),!1}),r}function jt(r,i,s,c){return{type:2,lower:r,upper:i,lowerOpen:s,upperOpen:c}}function Ws(r){return{type:1,lower:r,upper:r}}var $s=(Object.defineProperty(Te.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Te.prototype.between=function(r,i,s,c){s=s!==!1,c=c===!0;try{return 0<this._cmp(r,i)||this._cmp(r,i)===0&&(s||c)&&(!s||!c)?Sn(this):new this.Collection(this,function(){return jt(r,i,!s,!c)})}catch{return Qe(this,wt)}},Te.prototype.equals=function(r){return r==null?Qe(this,wt):new this.Collection(this,function(){return Ws(r)})},Te.prototype.above=function(r){return r==null?Qe(this,wt):new this.Collection(this,function(){return jt(r,void 0,!0)})},Te.prototype.aboveOrEqual=function(r){return r==null?Qe(this,wt):new this.Collection(this,function(){return jt(r,void 0,!1)})},Te.prototype.below=function(r){return r==null?Qe(this,wt):new this.Collection(this,function(){return jt(void 0,r,!1,!0)})},Te.prototype.belowOrEqual=function(r){return r==null?Qe(this,wt):new this.Collection(this,function(){return jt(void 0,r)})},Te.prototype.startsWith=function(r){return typeof r!="string"?Qe(this,Rs):this.between(r,r+Zt,!0,!0)},Te.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):si(this,function(i,s){return i.indexOf(s[0])===0},[r],Zt)},Te.prototype.equalsIgnoreCase=function(r){return si(this,function(i,s){return i===s[0]},[r],"")},Te.prototype.anyOfIgnoreCase=function(){var r=et.apply(bt,arguments);return r.length===0?Sn(this):si(this,function(i,s){return s.indexOf(i)!==-1},r,"")},Te.prototype.startsWithAnyOfIgnoreCase=function(){var r=et.apply(bt,arguments);return r.length===0?Sn(this):si(this,function(i,s){return s.some(function(c){return i.indexOf(c)===0})},r,Zt)},Te.prototype.anyOf=function(){var r=this,i=et.apply(bt,arguments),s=this._cmp;try{i.sort(s)}catch{return Qe(this,wt)}if(i.length===0)return Sn(this);var c=new this.Collection(this,function(){return jt(i[0],i[i.length-1])});c._ondirectionchange=function(h){s=h==="next"?r._ascending:r._descending,i.sort(s)};var l=0;return c._addAlgorithm(function(h,d,v){for(var _=h.key;0<s(_,i[l]);)if(++l===i.length)return d(v),!1;return s(_,i[l])===0||(d(function(){h.continue(i[l])}),!1)}),c},Te.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Te.prototype.noneOf=function(){var r=et.apply(bt,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return Qe(this,wt)}var i=r.reduce(function(s,c){return s?s.concat([[s[s.length-1][1],c]]):[[-1/0,c]]},null);return i.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(i,{includeLowers:!1,includeUppers:!1})},Te.prototype.inAnyRange=function(T,i){var s=this,c=this._cmp,l=this._ascending,h=this._descending,d=this._min,v=this._max;if(T.length===0)return Sn(this);if(!T.every(function(N){return N[0]!==void 0&&N[1]!==void 0&&l(N[0],N[1])<=0}))return Qe(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Y.InvalidArgument);var _=!i||i.includeLowers!==!1,m=i&&i.includeUppers===!0,O,y=l;function x(N,M){return y(N[0],M[0])}try{(O=T.reduce(function(N,M){for(var k=0,L=N.length;k<L;++k){var $=N[k];if(c(M[0],$[1])<0&&0<c(M[1],$[0])){$[0]=d($[0],M[0]),$[1]=v($[1],M[1]);break}}return k===L&&N.push(M),N},[])).sort(x)}catch{return Qe(this,wt)}var b=0,E=m?function(N){return 0<l(N,O[b][1])}:function(N){return 0<=l(N,O[b][1])},A=_?function(N){return 0<h(N,O[b][0])}:function(N){return 0<=h(N,O[b][0])},w=E,T=new this.Collection(this,function(){return jt(O[0][0],O[O.length-1][1],!_,!m)});return T._ondirectionchange=function(N){y=N==="next"?(w=E,l):(w=A,h),O.sort(x)},T._addAlgorithm(function(N,M,k){for(var L,$=N.key;w($);)if(++b===O.length)return M(k),!1;return!E(L=$)&&!A(L)||(s._cmp($,O[b][1])===0||s._cmp($,O[b][0])===0||M(function(){y===l?N.continue(O[b][0]):N.continue(O[b][1])}),!1)}),T},Te.prototype.startsWithAnyOf=function(){var r=et.apply(bt,arguments);return r.every(function(i){return typeof i=="string"})?r.length===0?Sn(this):this.inAnyRange(r.map(function(i){return[i,i+Zt]})):Qe(this,"startsWithAnyOf() only works with strings")},Te);function Te(){}function ft(r){return be(function(i){return Yn(i),r(i.target.error),!1})}function Yn(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var Qn="storagemutated",xo="x-storagemutated-1",Lt=Hn(null,Qn),Vh=(ht.prototype._lock=function(){return Se(!F.global),++this._reculock,this._reculock!==1||F.global||(F.lockOwnerFor=this),this},ht.prototype._unlock=function(){if(Se(!F.global),--this._reculock==0)for(F.global||(F.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{Xt(r[1],r[0])}catch{}}return this},ht.prototype._locked=function(){return this._reculock&&F.lockOwnerFor!==this},ht.prototype.create=function(r){var i=this;if(!this.mode)return this;var s=this.db.idbdb,c=this.db._state.dbOpenError;if(Se(!this.idbtrans),!r&&!s)switch(c&&c.name){case"DatabaseClosedError":throw new Y.DatabaseClosed(c);case"MissingAPIError":throw new Y.MissingAPI(c.message,c);default:throw new Y.OpenFailed(c)}if(!this.active)throw new Y.TransactionInactive;return Se(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||s).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=be(function(l){Yn(l),i._reject(r.error)}),r.onabort=be(function(l){Yn(l),i.active&&i._reject(new Y.Abort(r.error)),i.active=!1,i.on("abort").fire(l)}),r.oncomplete=be(function(){i.active=!1,i._resolve(),"mutatedParts"in r&&Lt.storagemutated.fire(r.mutatedParts)}),this},ht.prototype._promise=function(r,i,s){var c=this;if(r==="readwrite"&&this.mode!=="readwrite")return Oe(new Y.ReadOnly("Transaction is readonly"));if(!this.active)return Oe(new Y.TransactionInactive);if(this._locked())return new R(function(h,d){c._blockedFuncs.push([function(){c._promise(r,i,s).then(h,d)},F])});if(s)return Rt(function(){var h=new R(function(d,v){c._lock();var _=i(d,v,c);_&&_.then&&_.then(d,v)});return h.finally(function(){return c._unlock()}),h._lib=!0,h});var l=new R(function(h,d){var v=i(h,d,c);v&&v.then&&v.then(h,d)});return l._lib=!0,l},ht.prototype._root=function(){return this.parent?this.parent._root():this},ht.prototype.waitFor=function(r){var i,s=this._root(),c=R.resolve(r);s._waitingFor?s._waitingFor=s._waitingFor.then(function(){return c}):(s._waitingFor=c,s._waitingQueue=[],i=s.idbtrans.objectStore(s.storeNames[0]),function h(){for(++s._spinCount;s._waitingQueue.length;)s._waitingQueue.shift()();s._waitingFor&&(i.get(-1/0).onsuccess=h)}());var l=s._waitingFor;return new R(function(h,d){c.then(function(v){return s._waitingQueue.push(be(h.bind(null,v)))},function(v){return s._waitingQueue.push(be(d.bind(null,v)))}).finally(function(){s._waitingFor===l&&(s._waitingFor=null)})})},ht.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Y.Abort))},ht.prototype.table=function(r){var i=this._memoizedTables||(this._memoizedTables={});if(P(i,r))return i[r];var s=this.schema[r];if(!s)throw new Y.NotFound("Table "+r+" not part of transaction");return s=new this.db.Table(r,s,this),s.core=this.db.core.table(r),i[r]=s},ht);function ht(){}function Ao(r,i,s,c,l,h,d){return{name:r,keyPath:i,unique:s,multi:c,auto:l,compound:h,src:(s&&!d?"&":"")+(c?"*":"")+(l?"++":"")+Us(i)}}function Us(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Co(r,i,s){return{name:r,primKey:i,indexes:s,mappedClass:null,idxByName:(c=function(l){return[l.name,l]},s.reduce(function(l,h,d){return d=c(h,d),d&&(l[d[0]]=d[1]),l},{}))};var c}var Jn=function(r){try{return r.only([[]]),Jn=function(){return[[]]},[[]]}catch{return Jn=function(){return Zt},Zt}};function Po(r){return r==null?function(){}:typeof r=="string"?(i=r).split(".").length===1?function(s){return s[i]}:function(s){return te(s,i)}:function(s){return te(s,r)};var i}function qs(r){return[].slice.call(r)}var Wh=0;function Xn(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function $h(r,i,_){function c(w){if(w.type===3)return null;if(w.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var b=w.lower,E=w.upper,A=w.lowerOpen,w=w.upperOpen;return b===void 0?E===void 0?null:i.upperBound(E,!!w):E===void 0?i.lowerBound(b,!!A):i.bound(b,E,!!A,!!w)}function l(x){var b,E=x.name;return{name:E,schema:x,mutate:function(A){var w=A.trans,T=A.type,N=A.keys,M=A.values,k=A.range;return new Promise(function(L,$){L=be(L);var V=w.objectStore(E),W=V.keyPath==null,U=T==="put"||T==="add";if(!U&&T!=="delete"&&T!=="deleteRange")throw new Error("Invalid operation type: "+T);var q,X=(N||M||{length:1}).length;if(N&&M&&N.length!==M.length)throw new Error("Given keys array must have same length as given values array.");if(X===0)return L({numFailures:0,failures:{},results:[],lastResult:void 0});function re(Fe){++st,Yn(Fe)}var ae=[],ie=[],st=0;if(T==="deleteRange"){if(k.type===4)return L({numFailures:st,failures:ie,results:[],lastResult:void 0});k.type===3?ae.push(q=V.clear()):ae.push(q=V.delete(c(k)))}else{var W=U?W?[M,N]:[M,null]:[N,null],oe=W[0],Me=W[1];if(U)for(var ke=0;ke<X;++ke)ae.push(q=Me&&Me[ke]!==void 0?V[T](oe[ke],Me[ke]):V[T](oe[ke])),q.onerror=re;else for(ke=0;ke<X;++ke)ae.push(q=V[T](oe[ke])),q.onerror=re}function _i(Fe){Fe=Fe.target.result,ae.forEach(function(rn,Ho){return rn.error!=null&&(ie[Ho]=rn.error)}),L({numFailures:st,failures:ie,results:T==="delete"?N:ae.map(function(rn){return rn.result}),lastResult:Fe})}q.onerror=function(Fe){re(Fe),_i(Fe)},q.onsuccess=_i})},getMany:function(A){var w=A.trans,T=A.keys;return new Promise(function(N,M){N=be(N);for(var k,L=w.objectStore(E),$=T.length,V=new Array($),W=0,U=0,q=function(ae){ae=ae.target,V[ae._pos]=ae.result,++U===W&&N(V)},X=ft(M),re=0;re<$;++re)T[re]!=null&&((k=L.get(T[re]))._pos=re,k.onsuccess=q,k.onerror=X,++W);W===0&&N(V)})},get:function(A){var w=A.trans,T=A.key;return new Promise(function(N,M){N=be(N);var k=w.objectStore(E).get(T);k.onsuccess=function(L){return N(L.target.result)},k.onerror=ft(M)})},query:(b=m,function(A){return new Promise(function(w,T){w=be(w);var N,M,k,W=A.trans,L=A.values,$=A.limit,q=A.query,V=$===1/0?void 0:$,U=q.index,q=q.range,W=W.objectStore(E),U=U.isPrimaryKey?W:W.index(U.name),q=c(q);if($===0)return w({result:[]});b?((V=L?U.getAll(q,V):U.getAllKeys(q,V)).onsuccess=function(X){return w({result:X.target.result})},V.onerror=ft(T)):(N=0,M=!L&&"openKeyCursor"in U?U.openKeyCursor(q):U.openCursor(q),k=[],M.onsuccess=function(X){var re=M.result;return re?(k.push(L?re.value:re.primaryKey),++N===$?w({result:k}):void re.continue()):w({result:k})},M.onerror=ft(T))})}),openCursor:function(A){var w=A.trans,T=A.values,N=A.query,M=A.reverse,k=A.unique;return new Promise(function(L,$){L=be(L);var U=N.index,V=N.range,W=w.objectStore(E),W=U.isPrimaryKey?W:W.index(U.name),U=M?k?"prevunique":"prev":k?"nextunique":"next",q=!T&&"openKeyCursor"in W?W.openKeyCursor(c(V),U):W.openCursor(c(V),U);q.onerror=ft($),q.onsuccess=be(function(X){var re,ae,ie,st,oe=q.result;oe?(oe.___id=++Wh,oe.done=!1,re=oe.continue.bind(oe),ae=(ae=oe.continuePrimaryKey)&&ae.bind(oe),ie=oe.advance.bind(oe),st=function(){throw new Error("Cursor not stopped")},oe.trans=w,oe.stop=oe.continue=oe.continuePrimaryKey=oe.advance=function(){throw new Error("Cursor not started")},oe.fail=be($),oe.next=function(){var Me=this,ke=1;return this.start(function(){return ke--?Me.continue():Me.stop()}).then(function(){return Me})},oe.start=function(Me){function ke(){if(q.result)try{Me()}catch(Fe){oe.fail(Fe)}else oe.done=!0,oe.start=function(){throw new Error("Cursor behind last entry")},oe.stop()}var _i=new Promise(function(Fe,rn){Fe=be(Fe),q.onerror=ft(rn),oe.fail=rn,oe.stop=function(Ho){oe.stop=oe.continue=oe.continuePrimaryKey=oe.advance=st,Fe(Ho)}});return q.onsuccess=be(function(Fe){q.onsuccess=ke,ke()}),oe.continue=re,oe.continuePrimaryKey=ae,oe.advance=ie,ke(),_i},L(oe)):L(null)},$)})},count:function(A){var w=A.query,T=A.trans,N=w.index,M=w.range;return new Promise(function(k,L){var $=T.objectStore(E),V=N.isPrimaryKey?$:$.index(N.name),$=c(M),V=$?V.count($):V.count();V.onsuccess=be(function(W){return k(W.target.result)}),V.onerror=ft(L)})}}}var h,d,v,O=(d=_,v=qs((h=r).objectStoreNames),{schema:{name:h.name,tables:v.map(function(x){return d.objectStore(x)}).map(function(x){var b=x.keyPath,w=x.autoIncrement,E=g(b),A={},w={name:x.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:b==null,compound:E,keyPath:b,autoIncrement:w,unique:!0,extractKey:Po(b)},indexes:qs(x.indexNames).map(function(T){return x.index(T)}).map(function(k){var N=k.name,M=k.unique,L=k.multiEntry,k=k.keyPath,L={name:N,compound:g(k),keyPath:k,unique:M,multiEntry:L,extractKey:Po(k)};return A[Xn(k)]=L}),getIndexByKeyPath:function(T){return A[Xn(T)]}};return A[":id"]=w.primaryKey,b!=null&&(A[Xn(b)]=w.primaryKey),w})},hasGetAll:0<v.length&&"getAll"in d.objectStore(v[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),_=O.schema,m=O.hasGetAll,O=_.tables.map(l),y={};return O.forEach(function(x){return y[x.name]=x}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(x){if(!y[x])throw new Error("Table '".concat(x,"' not found"));return y[x]},MIN_KEY:-1/0,MAX_KEY:Jn(i),schema:_}}function Uh(r,i,s,c){var l=s.IDBKeyRange;return s.indexedDB,{dbcore:(c=$h(i,l,c),r.dbcore.reduce(function(h,d){return d=d.create,o(o({},h),d(h))},c))}}function ui(r,c){var s=c.db,c=Uh(r._middlewares,s,r._deps,c);r.core=c.dbcore,r.tables.forEach(function(l){var h=l.name;r.core.schema.tables.some(function(d){return d.name===h})&&(l.core=r.core.table(h),r[h]instanceof r.Table&&(r[h].core=l.core))})}function ci(r,i,s,c){s.forEach(function(l){var h=c[l];i.forEach(function(d){var v=function _(m,O){return ze(m,O)||(m=p(m))&&_(m,O)}(d,l);(!v||"value"in v&&v.value===void 0)&&(d===r.Transaction.prototype||d instanceof r.Transaction?Z(d,l,{get:function(){return this.table(l)},set:function(_){Q(this,l,{value:_,writable:!0,configurable:!0,enumerable:!0})}}):d[l]=new r.Table(l,h))})})}function To(r,i){i.forEach(function(s){for(var c in s)s[c]instanceof r.Table&&delete s[c]})}function qh(r,i){return r._cfg.version-i._cfg.version}function zh(r,i,s,c){var l=r._dbSchema;s.objectStoreNames.contains("$meta")&&!l.$meta&&(l.$meta=Co("$meta",Hs("")[0],[]),r._storeNames.push("$meta"));var h=r._createTransaction("readwrite",r._storeNames,l);h.create(s),h._completion.catch(c);var d=h._reject.bind(h),v=F.transless||F;Rt(function(){return F.trans=h,F.transless=v,i!==0?(ui(r,s),m=i,((_=h).storeNames.includes("$meta")?_.table("$meta").get("version").then(function(O){return O??m}):R.resolve(m)).then(function(O){return x=O,b=h,E=s,A=[],O=(y=r)._versions,w=y._dbSchema=fi(0,y.idbdb,E),(O=O.filter(function(T){return T._cfg.version>=x})).length!==0?(O.forEach(function(T){A.push(function(){var N=w,M=T._cfg.dbschema;hi(y,N,E),hi(y,M,E),w=y._dbSchema=M;var k=Io(N,M);k.add.forEach(function(U){Do(E,U[0],U[1].primKey,U[1].indexes)}),k.change.forEach(function(U){if(U.recreate)throw new Y.Upgrade("Not yet support for changing primary key");var q=E.objectStore(U.name);U.add.forEach(function(X){return li(q,X)}),U.change.forEach(function(X){q.deleteIndex(X.name),li(q,X)}),U.del.forEach(function(X){return q.deleteIndex(X)})});var L=T._cfg.contentUpgrade;if(L&&T._cfg.version>x){ui(y,E),b._memoizedTables={};var $=vn(M);k.del.forEach(function(U){$[U]=N[U]}),To(y,[y.Transaction.prototype]),ci(y,[y.Transaction.prototype],f($),$),b.schema=$;var V,W=mn(L);return W&&_n(),k=R.follow(function(){var U;(V=L(b))&&W&&(U=Mt.bind(null,null),V.then(U,U))}),V&&typeof V.then=="function"?R.resolve(V):k.then(function(){return V})}}),A.push(function(N){var M,k,L=T._cfg.dbschema;M=L,k=N,[].slice.call(k.db.objectStoreNames).forEach(function($){return M[$]==null&&k.db.deleteObjectStore($)}),To(y,[y.Transaction.prototype]),ci(y,[y.Transaction.prototype],y._storeNames,y._dbSchema),b.schema=y._dbSchema}),A.push(function(N){y.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(y.idbdb.version/10)===T._cfg.version?(y.idbdb.deleteObjectStore("$meta"),delete y._dbSchema.$meta,y._storeNames=y._storeNames.filter(function(M){return M!=="$meta"})):N.objectStore("$meta").put(T._cfg.version,"version"))})}),function T(){return A.length?R.resolve(A.shift()(b.idbtrans)).then(T):R.resolve()}().then(function(){zs(w,E)})):R.resolve();var y,x,b,E,A,w}).catch(d)):(f(l).forEach(function(O){Do(s,O,l[O].primKey,l[O].indexes)}),ui(r,s),void R.follow(function(){return r.on.populate.fire(h)}).catch(d));var _,m})}function Hh(r,i){zs(r._dbSchema,i),i.db.version%10!=0||i.objectStoreNames.contains("$meta")||i.db.createObjectStore("$meta").add(Math.ceil(i.db.version/10-1),"version");var s=fi(0,r.idbdb,i);hi(r,r._dbSchema,i);for(var c=0,l=Io(s,r._dbSchema).change;c<l.length;c++){var h=function(d){if(d.change.length||d.recreate)return console.warn("Unable to patch indexes of table ".concat(d.name," because it has changes on the type of index or primary key.")),{value:void 0};var v=i.objectStore(d.name);d.add.forEach(function(_){Ue&&console.debug("Dexie upgrade patch: Creating missing index ".concat(d.name,".").concat(_.src)),li(v,_)})}(l[c]);if(typeof h=="object")return h.value}}function Io(r,i){var s,c={del:[],add:[],change:[]};for(s in r)i[s]||c.del.push(s);for(s in i){var l=r[s],h=i[s];if(l){var d={name:s,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(l.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||l.primKey.auto!==h.primKey.auto)d.recreate=!0,c.change.push(d);else{var v=l.idxByName,_=h.idxByName,m=void 0;for(m in v)_[m]||d.del.push(m);for(m in _){var O=v[m],y=_[m];O?O.src!==y.src&&d.change.push(y):d.add.push(y)}(0<d.del.length||0<d.add.length||0<d.change.length)&&c.change.push(d)}}else c.add.push([s,h])}return c}function Do(r,i,s,c){var l=r.db.createObjectStore(i,s.keyPath?{keyPath:s.keyPath,autoIncrement:s.auto}:{autoIncrement:s.auto});return c.forEach(function(h){return li(l,h)}),l}function zs(r,i){f(r).forEach(function(s){i.db.objectStoreNames.contains(s)||(Ue&&console.debug("Dexie: Creating missing table",s),Do(i,s,r[s].primKey,r[s].indexes))})}function li(r,i){r.createIndex(i.name,i.keyPath,{unique:i.unique,multiEntry:i.multi})}function fi(r,i,s){var c={};return $e(i.objectStoreNames,0).forEach(function(l){for(var h=s.objectStore(l),d=Ao(Us(m=h.keyPath),m||"",!0,!1,!!h.autoIncrement,m&&typeof m!="string",!0),v=[],_=0;_<h.indexNames.length;++_){var O=h.index(h.indexNames[_]),m=O.keyPath,O=Ao(O.name,m,!!O.unique,!!O.multiEntry,!1,m&&typeof m!="string",!1);v.push(O)}c[l]=Co(l,d,v)}),c}function hi(r,i,s){for(var c=s.db.objectStoreNames,l=0;l<c.length;++l){var h=c[l],d=s.objectStore(h);r._hasGetAll="getAll"in d;for(var v=0;v<d.indexNames.length;++v){var _=d.indexNames[v],m=d.index(_).keyPath,O=typeof m=="string"?m:"["+$e(m).join("+")+"]";!i[h]||(m=i[h].idxByName[O])&&(m.name=_,delete i[h].idxByName[O],i[h].idxByName[_]=m)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&u.WorkerGlobalScope&&u instanceof u.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function Hs(r){return r.split(",").map(function(i,s){var c=(i=i.trim()).replace(/([&*]|\+\+)/g,""),l=/^\[/.test(c)?c.match(/^\[(.*)\]$/)[1].split("+"):c;return Ao(c,l||null,/\&/.test(i),/\*/.test(i),/\+\+/.test(i),g(l),s===0)})}var Gh=(di.prototype._parseStoresSpec=function(r,i){f(r).forEach(function(s){if(r[s]!==null){var c=Hs(r[s]),l=c.shift();if(l.unique=!0,l.multi)throw new Y.Schema("Primary key cannot be multi-valued");c.forEach(function(h){if(h.auto)throw new Y.Schema("Only primary key can be marked as autoIncrement (++)");if(!h.keyPath)throw new Y.Schema("Index must have a name and cannot be an empty string")}),i[s]=Co(s,l,c)}})},di.prototype.stores=function(s){var i=this.db;this._cfg.storesSource=this._cfg.storesSource?S(this._cfg.storesSource,s):s;var s=i._versions,c={},l={};return s.forEach(function(h){S(c,h._cfg.storesSource),l=h._cfg.dbschema={},h._parseStoresSpec(c,l)}),i._dbSchema=l,To(i,[i._allTables,i,i.Transaction.prototype]),ci(i,[i._allTables,i,i.Transaction.prototype,this._cfg.tables],f(l),l),i._storeNames=f(l),this},di.prototype.upgrade=function(r){return this._cfg.contentUpgrade=bn(this._cfg.contentUpgrade||se,r),this},di);function di(){}function No(r,i){var s=r._dbNamesDB;return s||(s=r._dbNamesDB=new St(ri,{addons:[],indexedDB:r,IDBKeyRange:i})).version(1).stores({dbnames:"name"}),s.table("dbnames")}function Ro(r){return r&&typeof r.databases=="function"}function Mo(r){return Rt(function(){return F.letThrough=!0,r()})}function ko(r){return!("from"in r)}var Re=function(r,i){if(!this){var s=new Re;return r&&"d"in r&&S(s,r),s}S(this,arguments.length?{d:1,from:r,to:1<arguments.length?i:r}:{d:0})};function Zn(r,i,s){var c=le(i,s);if(!isNaN(c)){if(0<c)throw RangeError();if(ko(r))return S(r,{from:i,to:s,d:1});var l=r.l,c=r.r;if(le(s,r.from)<0)return l?Zn(l,i,s):r.l={from:i,to:s,d:1,l:null,r:null},Gs(r);if(0<le(i,r.to))return c?Zn(c,i,s):r.r={from:i,to:s,d:1,l:null,r:null},Gs(r);le(i,r.from)<0&&(r.from=i,r.l=null,r.d=c?c.d+1:1),0<le(s,r.to)&&(r.to=s,r.r=null,r.d=r.l?r.l.d+1:1),s=!r.r,l&&!r.l&&er(r,l),c&&s&&er(r,c)}}function er(r,i){ko(i)||function s(c,_){var h=_.from,d=_.to,v=_.l,_=_.r;Zn(c,h,d),v&&s(c,v),_&&s(c,_)}(r,i)}function pi(r,i){var s=jo(i),c=s.next();if(c.done)return!1;for(var l=c.value,h=jo(r),d=h.next(l.from),v=d.value;!c.done&&!d.done;){if(le(v.from,l.to)<=0&&0<=le(v.to,l.from))return!0;le(l.from,v.from)<0?l=(c=s.next(v.from)).value:v=(d=h.next(l.from)).value}return!1}function jo(r){var i=ko(r)?null:{s:0,n:r};return{next:function(s){for(var c=0<arguments.length;i;)switch(i.s){case 0:if(i.s=1,c)for(;i.n.l&&le(s,i.n.from)<0;)i={up:i,n:i.n.l,s:1};else for(;i.n.l;)i={up:i,n:i.n.l,s:1};case 1:if(i.s=2,!c||le(s,i.n.to)<=0)return{value:i.n,done:!1};case 2:if(i.n.r){i.s=3,i={up:i,n:i.n.r,s:0};continue}case 3:i=i.up}return{done:!0}}}}function Gs(r){var i,s,c=(((i=r.r)===null||i===void 0?void 0:i.d)||0)-(((s=r.l)===null||s===void 0?void 0:s.d)||0),l=1<c?"r":c<-1?"l":"";l&&(i=l=="r"?"l":"r",s=o({},r),c=r[l],r.from=c.from,r.to=c.to,r[l]=c[l],s[l]=c[i],(r[i]=s).d=Ys(s)),r.d=Ys(r)}function Ys(s){var i=s.r,s=s.l;return(i?s?Math.max(i.d,s.d):i.d:s?s.d:0)+1}function gi(r,i){return f(i).forEach(function(s){r[s]?er(r[s],i[s]):r[s]=function c(l){var h,d,v={};for(h in l)P(l,h)&&(d=l[h],v[h]=!d||typeof d!="object"||Vr.has(d.constructor)?d:c(d));return v}(i[s])}),r}function Lo(r,i){return r.all||i.all||Object.keys(r).some(function(s){return i[s]&&pi(i[s],r[s])})}B(Re.prototype,((tt={add:function(r){return er(this,r),this},addKey:function(r){return Zn(this,r,r),this},addKeys:function(r){var i=this;return r.forEach(function(s){return Zn(i,s,s)}),this}})[yn]=function(){return jo(this)},tt));var tn={},Fo={},Bo=!1;function vi(r){gi(Fo,r),Bo||(Bo=!0,setTimeout(function(){Bo=!1,Ko(Fo,!(Fo={}))},0))}function Ko(r,i){i===void 0&&(i=!1);var s=new Set;if(r.all)for(var c=0,l=Object.values(tn);c<l.length;c++)Qs(d=l[c],r,s,i);else for(var h in r){var d,v=/^idb\:\/\/(.*)\/(.*)\//.exec(h);v&&(h=v[1],v=v[2],(d=tn["idb://".concat(h,"/").concat(v)])&&Qs(d,r,s,i))}s.forEach(function(_){return _()})}function Qs(r,i,s,c){for(var l=[],h=0,d=Object.entries(r.queries.query);h<d.length;h++){for(var v=d[h],_=v[0],m=[],O=0,y=v[1];O<y.length;O++){var x=y[O];Lo(i,x.obsSet)?x.subscribers.forEach(function(w){return s.add(w)}):c&&m.push(x)}c&&l.push([_,m])}if(c)for(var b=0,E=l;b<E.length;b++){var A=E[b],_=A[0],m=A[1];r.queries.query[_]=m}}function Yh(r){var i=r._state,s=r._deps.indexedDB;if(i.isBeingOpened||r.idbdb)return i.dbReadyPromise.then(function(){return i.dbOpenError?Oe(i.dbOpenError):r});i.isBeingOpened=!0,i.dbOpenError=null,i.openComplete=!1;var c=i.openCanceller,l=Math.round(10*r.verno),h=!1;function d(){if(i.openCanceller!==c)throw new Y.DatabaseClosed("db.open() was cancelled")}function v(){return new R(function(x,b){if(d(),!s)throw new Y.MissingAPI;var E=r.name,A=i.autoSchema||!l?s.open(E):s.open(E,l);if(!A)throw new Y.MissingAPI;A.onerror=ft(b),A.onblocked=be(r._fireOnBlocked),A.onupgradeneeded=be(function(w){var T;O=A.transaction,i.autoSchema&&!r._options.allowEmptyDB?(A.onerror=Yn,O.abort(),A.result.close(),(T=s.deleteDatabase(E)).onsuccess=T.onerror=be(function(){b(new Y.NoSuchDatabase("Database ".concat(E," doesnt exist")))})):(O.onerror=ft(b),w=w.oldVersion>Math.pow(2,62)?0:w.oldVersion,y=w<1,r.idbdb=A.result,h&&Hh(r,O),zh(r,w/10,O,b))},b),A.onsuccess=be(function(){O=null;var w,T,N,M,k,L=r.idbdb=A.result,$=$e(L.objectStoreNames);if(0<$.length)try{var V=L.transaction((M=$).length===1?M[0]:M,"readonly");if(i.autoSchema)T=L,N=V,(w=r).verno=T.version/10,N=w._dbSchema=fi(0,T,N),w._storeNames=$e(T.objectStoreNames,0),ci(w,[w._allTables],f(N),N);else if(hi(r,r._dbSchema,V),((k=Io(fi(0,(k=r).idbdb,V),k._dbSchema)).add.length||k.change.some(function(W){return W.add.length||W.change.length}))&&!h)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),L.close(),l=L.version+1,h=!0,x(v());ui(r,V)}catch{}wn.push(r),L.onversionchange=be(function(W){i.vcFired=!0,r.on("versionchange").fire(W)}),L.onclose=be(function(W){r.on("close").fire(W)}),y&&(k=r._deps,V=E,L=k.indexedDB,k=k.IDBKeyRange,Ro(L)||V===ri||No(L,k).put({name:V}).catch(se)),x()},b)}).catch(function(x){switch(x==null?void 0:x.name){case"UnknownError":if(0<i.PR1398_maxLoop)return i.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),v();break;case"VersionError":if(0<l)return l=0,v()}return R.reject(x)})}var _,m=i.dbReadyResolve,O=null,y=!1;return R.race([c,(typeof navigator>"u"?R.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(x){function b(){return indexedDB.databases().finally(x)}_=setInterval(b,100),b()}).finally(function(){return clearInterval(_)}):Promise.resolve()).then(v)]).then(function(){return d(),i.onReadyBeingFired=[],R.resolve(Mo(function(){return r.on.ready.fire(r.vip)})).then(function x(){if(0<i.onReadyBeingFired.length){var b=i.onReadyBeingFired.reduce(bn,se);return i.onReadyBeingFired=[],R.resolve(Mo(function(){return b(r.vip)})).then(x)}})}).finally(function(){i.openCanceller===c&&(i.onReadyBeingFired=null,i.isBeingOpened=!1)}).catch(function(x){i.dbOpenError=x;try{O&&O.abort()}catch{}return c===i.openCanceller&&r._close(),Oe(x)}).finally(function(){i.openComplete=!0,m()}).then(function(){var x;return y&&(x={},r.tables.forEach(function(b){b.schema.indexes.forEach(function(E){E.name&&(x["idb://".concat(r.name,"/").concat(b.name,"/").concat(E.name)]=new Re(-1/0,[[[]]]))}),x["idb://".concat(r.name,"/").concat(b.name,"/")]=x["idb://".concat(r.name,"/").concat(b.name,"/:dels")]=new Re(-1/0,[[[]]])}),Lt(Qn).fire(x),Ko(x,!0)),r})}function Vo(r){function i(h){return r.next(h)}var s=l(i),c=l(function(h){return r.throw(h)});function l(h){return function(_){var v=h(_),_=v.value;return v.done?_:_&&typeof _.then=="function"?_.then(s,c):g(_)?Promise.all(_).then(s,c):s(_)}}return l(i)()}function yi(r,i,s){for(var c=g(r)?r.slice():[r],l=0;l<s;++l)c.push(i);return c}var Qh={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return o(o({},r),{table:function(i){var s=r.table(i),c=s.schema,l={},h=[];function d(y,x,b){var E=Xn(y),A=l[E]=l[E]||[],w=y==null?0:typeof y=="string"?1:y.length,T=0<x,T=o(o({},b),{name:T?"".concat(E,"(virtual-from:").concat(b.name,")"):b.name,lowLevelIndex:b,isVirtual:T,keyTail:x,keyLength:w,extractKey:Po(y),unique:!T&&b.unique});return A.push(T),T.isPrimaryKey||h.push(T),1<w&&d(w===2?y[0]:y.slice(0,w-1),x+1,b),A.sort(function(N,M){return N.keyTail-M.keyTail}),T}i=d(c.primaryKey.keyPath,0,c.primaryKey),l[":id"]=[i];for(var v=0,_=c.indexes;v<_.length;v++){var m=_[v];d(m.keyPath,0,m)}function O(y){var x,b=y.query.index;return b.isVirtual?o(o({},y),{query:{index:b.lowLevelIndex,range:(x=y.query.range,b=b.keyTail,{type:x.type===1?2:x.type,lower:yi(x.lower,x.lowerOpen?r.MAX_KEY:r.MIN_KEY,b),lowerOpen:!0,upper:yi(x.upper,x.upperOpen?r.MIN_KEY:r.MAX_KEY,b),upperOpen:!0})}}):y}return o(o({},s),{schema:o(o({},c),{primaryKey:i,indexes:h,getIndexByKeyPath:function(y){return(y=l[Xn(y)])&&y[0]}}),count:function(y){return s.count(O(y))},query:function(y){return s.query(O(y))},openCursor:function(y){var x=y.query.index,b=x.keyTail,E=x.isVirtual,A=x.keyLength;return E?s.openCursor(O(y)).then(function(T){return T&&w(T)}):s.openCursor(y);function w(T){return Object.create(T,{continue:{value:function(N){N!=null?T.continue(yi(N,y.reverse?r.MAX_KEY:r.MIN_KEY,b)):y.unique?T.continue(T.key.slice(0,A).concat(y.reverse?r.MIN_KEY:r.MAX_KEY,b)):T.continue()}},continuePrimaryKey:{value:function(N,M){T.continuePrimaryKey(yi(N,r.MAX_KEY,b),M)}},primaryKey:{get:function(){return T.primaryKey}},key:{get:function(){var N=T.key;return A===1?N[0]:N.slice(0,A)}},value:{get:function(){return T.value}}})}}})}})}};function Wo(r,i,s,c){return s=s||{},c=c||"",f(r).forEach(function(l){var h,d,v;P(i,l)?(h=r[l],d=i[l],typeof h=="object"&&typeof d=="object"&&h&&d?(v=Ht(h))!==Ht(d)?s[c+l]=i[l]:v==="Object"?Wo(h,d,s,c+l+"."):h!==d&&(s[c+l]=i[l]):h!==d&&(s[c+l]=i[l])):s[c+l]=void 0}),f(i).forEach(function(l){P(r,l)||(s[c+l]=i[l])}),s}function $o(r,i){return i.type==="delete"?i.keys:i.keys||i.values.map(r.extractKey)}var Jh={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return o(o({},r),{table:function(i){var s=r.table(i),c=s.schema.primaryKey;return o(o({},s),{mutate:function(l){var h=F.trans,d=h.table(i).hook,v=d.deleting,_=d.creating,m=d.updating;switch(l.type){case"add":if(_.fire===se)break;return h._promise("readwrite",function(){return O(l)},!0);case"put":if(_.fire===se&&m.fire===se)break;return h._promise("readwrite",function(){return O(l)},!0);case"delete":if(v.fire===se)break;return h._promise("readwrite",function(){return O(l)},!0);case"deleteRange":if(v.fire===se)break;return h._promise("readwrite",function(){return function y(x,b,E){return s.query({trans:x,values:!1,query:{index:c,range:b},limit:E}).then(function(A){var w=A.result;return O({type:"delete",keys:w,trans:x}).then(function(T){return 0<T.numFailures?Promise.reject(T.failures[0]):w.length<E?{failures:[],numFailures:0,lastResult:void 0}:y(x,o(o({},b),{lower:w[w.length-1],lowerOpen:!0}),E)})})}(l.trans,l.range,1e4)},!0)}return s.mutate(l);function O(y){var x,b,E,A=F.trans,w=y.keys||$o(c,y);if(!w)throw new Error("Keys missing");return(y=y.type==="add"||y.type==="put"?o(o({},y),{keys:w}):o({},y)).type!=="delete"&&(y.values=a([],y.values)),y.keys&&(y.keys=a([],y.keys)),x=s,E=w,((b=y).type==="add"?Promise.resolve([]):x.getMany({trans:b.trans,keys:E,cache:"immutable"})).then(function(T){var N=w.map(function(M,k){var L,$,V,W=T[k],U={onerror:null,onsuccess:null};return y.type==="delete"?v.fire.call(U,M,W,A):y.type==="add"||W===void 0?(L=_.fire.call(U,M,y.values[k],A),M==null&&L!=null&&(y.keys[k]=M=L,c.outbound||Ce(y.values[k],c.keyPath,M))):(L=Wo(W,y.values[k]),($=m.fire.call(U,L,M,W,A))&&(V=y.values[k],Object.keys($).forEach(function(q){P(V,q)?V[q]=$[q]:Ce(V,q,$[q])}))),U});return s.mutate(y).then(function(M){for(var k=M.failures,L=M.results,$=M.numFailures,M=M.lastResult,V=0;V<w.length;++V){var W=(L||w)[V],U=N[V];W==null?U.onerror&&U.onerror(k[V]):U.onsuccess&&U.onsuccess(y.type==="put"&&T[V]?y.values[V]:W)}return{failures:k,results:L,numFailures:$,lastResult:M}}).catch(function(M){return N.forEach(function(k){return k.onerror&&k.onerror(M)}),Promise.reject(M)})})}}})}})}};function Js(r,i,s){try{if(!i||i.keys.length<r.length)return null;for(var c=[],l=0,h=0;l<i.keys.length&&h<r.length;++l)le(i.keys[l],r[h])===0&&(c.push(s?ct(i.values[l]):i.values[l]),++h);return c.length===r.length?c:null}catch{return null}}var Xh={stack:"dbcore",level:-1,create:function(r){return{table:function(i){var s=r.table(i);return o(o({},s),{getMany:function(c){if(!c.cache)return s.getMany(c);var l=Js(c.keys,c.trans._cache,c.cache==="clone");return l?R.resolve(l):s.getMany(c).then(function(h){return c.trans._cache={keys:c.keys,values:c.cache==="clone"?ct(h):h},h})},mutate:function(c){return c.type!=="add"&&(c.trans._cache=null),s.mutate(c)}})}}}};function Xs(r,i){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!i.schema.primaryKey.outbound}function Zs(r,i){switch(r){case"query":return i.values&&!i.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Zh={stack:"dbcore",level:0,name:"Observability",create:function(r){var i=r.schema.name,s=new Re(r.MIN_KEY,r.MAX_KEY);return o(o({},r),{transaction:function(c,l,h){if(F.subscr&&l!=="readonly")throw new Y.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(F.querier));return r.transaction(c,l,h)},table:function(c){var l=r.table(c),h=l.schema,d=h.primaryKey,y=h.indexes,v=d.extractKey,_=d.outbound,m=d.autoIncrement&&y.filter(function(b){return b.compound&&b.keyPath.includes(d.keyPath)}),O=o(o({},l),{mutate:function(b){function E(q){return q="idb://".concat(i,"/").concat(c,"/").concat(q),M[q]||(M[q]=new Re)}var A,w,T,N=b.trans,M=b.mutatedParts||(b.mutatedParts={}),k=E(""),L=E(":dels"),$=b.type,U=b.type==="deleteRange"?[b.range]:b.type==="delete"?[b.keys]:b.values.length<50?[$o(d,b).filter(function(q){return q}),b.values]:[],V=U[0],W=U[1],U=b.trans._cache;return g(V)?(k.addKeys(V),(U=$==="delete"||V.length===W.length?Js(V,U):null)||L.addKeys(V),(U||W)&&(A=E,w=U,T=W,h.indexes.forEach(function(q){var X=A(q.name||"");function re(ie){return ie!=null?q.extractKey(ie):null}function ae(ie){return q.multiEntry&&g(ie)?ie.forEach(function(st){return X.addKey(st)}):X.addKey(ie)}(w||T).forEach(function(ie,Me){var oe=w&&re(w[Me]),Me=T&&re(T[Me]);le(oe,Me)!==0&&(oe!=null&&ae(oe),Me!=null&&ae(Me))})}))):V?(W={from:V.lower,to:V.upper},L.add(W),k.add(W)):(k.add(s),L.add(s),h.indexes.forEach(function(q){return E(q.name).add(s)})),l.mutate(b).then(function(q){return!V||b.type!=="add"&&b.type!=="put"||(k.addKeys(q.results),m&&m.forEach(function(X){var re=b.values.map(function(ie){return X.extractKey(ie)}),ae=X.keyPath.findIndex(function(ie){return ie===d.keyPath});q.results.forEach(function(ie){return re[ae]=ie}),E(X.name).addKeys(re)})),N.mutatedParts=gi(N.mutatedParts||{},M),q})}}),y=function(E){var A=E.query,E=A.index,A=A.range;return[E,new Re((E=A.lower)!==null&&E!==void 0?E:r.MIN_KEY,(A=A.upper)!==null&&A!==void 0?A:r.MAX_KEY)]},x={get:function(b){return[d,new Re(b.key)]},getMany:function(b){return[d,new Re().addKeys(b.keys)]},count:y,query:y,openCursor:y};return f(x).forEach(function(b){O[b]=function(E){var A=F.subscr,w=!!A,T=Xs(F,l)&&Zs(b,E)?E.obsSet={}:A;if(w){var N=function(W){return W="idb://".concat(i,"/").concat(c,"/").concat(W),T[W]||(T[W]=new Re)},M=N(""),k=N(":dels"),A=x[b](E),w=A[0],A=A[1];if((b==="query"&&w.isPrimaryKey&&!E.values?k:N(w.name||"")).add(A),!w.isPrimaryKey){if(b!=="count"){var L=b==="query"&&_&&E.values&&l.query(o(o({},E),{values:!1}));return l[b].apply(this,arguments).then(function(W){if(b==="query"){if(_&&E.values)return L.then(function(re){return re=re.result,M.addKeys(re),W});var U=E.values?W.result.map(v):W.result;(E.values?M:k).addKeys(U)}else if(b==="openCursor"){var q=W,X=E.values;return q&&Object.create(q,{key:{get:function(){return k.addKey(q.primaryKey),q.key}},primaryKey:{get:function(){var re=q.primaryKey;return k.addKey(re),re}},value:{get:function(){return X&&M.addKey(q.primaryKey),q.value}}})}return W})}k.add(s)}}return l[b].apply(this,arguments)}}),O}})}};function eu(r,i,s){if(s.numFailures===0)return i;if(i.type==="deleteRange")return null;var c=i.keys?i.keys.length:"values"in i&&i.values?i.values.length:1;return s.numFailures===c?null:(i=o({},i),g(i.keys)&&(i.keys=i.keys.filter(function(l,h){return!(h in s.failures)})),"values"in i&&g(i.values)&&(i.values=i.values.filter(function(l,h){return!(h in s.failures)})),i)}function Uo(r,i){return s=r,((c=i).lower===void 0||(c.lowerOpen?0<le(s,c.lower):0<=le(s,c.lower)))&&(r=r,(i=i).upper===void 0||(i.upperOpen?le(r,i.upper)<0:le(r,i.upper)<=0));var s,c}function tu(r,i,x,c,l,h){if(!x||x.length===0)return r;var d=i.query.index,v=d.multiEntry,_=i.query.range,m=c.schema.primaryKey.extractKey,O=d.extractKey,y=(d.lowLevelIndex||d).extractKey,x=x.reduce(function(b,E){var A=b,w=E.type==="add"||E.type==="put"?E.values.filter(function(k){return k=O(k),v&&g(k)?k.some(function(L){return Uo(L,_)}):Uo(k,_)}).map(function(k){return k=ct(k),h&&Object.freeze(k),k}):[];switch(E.type){case"add":A=b.concat(i.values?w:w.map(function(L){return m(L)}));break;case"put":var T=new Re().addKeys(E.values.map(function(L){return m(L)})),A=b.filter(function(L){return L=i.values?m(L):L,!pi(new Re(L),T)}).concat(i.values?w:w.map(function(L){return m(L)}));break;case"delete":var N=new Re().addKeys(E.keys);A=b.filter(function(L){return L=i.values?m(L):L,!pi(new Re(L),N)});break;case"deleteRange":var M=E.range;A=b.filter(function(L){return!Uo(m(L),M)})}return A},r);return x===r?r:(x.sort(function(b,E){return le(y(b),y(E))||le(m(b),m(E))}),i.limit&&i.limit<1/0&&(x.length>i.limit?x.length=i.limit:r.length===i.limit&&x.length<i.limit&&(l.dirty=!0)),h?Object.freeze(x):x)}function nu(r,i){return le(r.lower,i.lower)===0&&le(r.upper,i.upper)===0&&!!r.lowerOpen==!!i.lowerOpen&&!!r.upperOpen==!!i.upperOpen}function ed(r,i){return function(s,c,l,h){if(s===void 0)return c!==void 0?-1:0;if(c===void 0)return 1;if((c=le(s,c))===0){if(l&&h)return 0;if(l)return 1;if(h)return-1}return c}(r.lower,i.lower,r.lowerOpen,i.lowerOpen)<=0&&0<=function(s,c,l,h){if(s===void 0)return c!==void 0?1:0;if(c===void 0)return-1;if((c=le(s,c))===0){if(l&&h)return 0;if(l)return-1;if(h)return 1}return c}(r.upper,i.upper,r.upperOpen,i.upperOpen)}function td(r,i,s,c){r.subscribers.add(s),c.addEventListener("abort",function(){var l,h;r.subscribers.delete(s),r.subscribers.size===0&&(l=r,h=i,setTimeout(function(){l.subscribers.size===0&<(h,l)},3e3))})}var nd={stack:"dbcore",level:0,name:"Cache",create:function(r){var i=r.schema.name;return o(o({},r),{transaction:function(s,c,l){var h,d,v=r.transaction(s,c,l);return c==="readwrite"&&(d=(h=new AbortController).signal,l=function(_){return function(){if(h.abort(),c==="readwrite"){for(var m=new Set,O=0,y=s;O<y.length;O++){var x=y[O],b=tn["idb://".concat(i,"/").concat(x)];if(b){var E=r.table(x),A=b.optimisticOps.filter(function(X){return X.trans===v});if(v._explicit&&_&&v.mutatedParts)for(var w=0,T=Object.values(b.queries.query);w<T.length;w++)for(var N=0,M=($=T[w]).slice();N<M.length;N++)Lo((V=M[N]).obsSet,v.mutatedParts)&&(lt($,V),V.subscribers.forEach(function(X){return m.add(X)}));else if(0<A.length){b.optimisticOps=b.optimisticOps.filter(function(X){return X.trans!==v});for(var k=0,L=Object.values(b.queries.query);k<L.length;k++)for(var $,V,W,U=0,q=($=L[k]).slice();U<q.length;U++)(V=q[U]).res!=null&&v.mutatedParts&&(_&&!V.dirty?(W=Object.isFrozen(V.res),W=tu(V.res,V.req,A,E,V,W),V.dirty?(lt($,V),V.subscribers.forEach(function(X){return m.add(X)})):W!==V.res&&(V.res=W,V.promise=R.resolve({result:W}))):(V.dirty&<($,V),V.subscribers.forEach(function(X){return m.add(X)})))}}}m.forEach(function(X){return X()})}}},v.addEventListener("abort",l(!1),{signal:d}),v.addEventListener("error",l(!1),{signal:d}),v.addEventListener("complete",l(!0),{signal:d})),v},table:function(s){var c=r.table(s),l=c.schema.primaryKey;return o(o({},c),{mutate:function(h){var d=F.trans;if(l.outbound||d.db._options.cache==="disabled"||d.explicit)return c.mutate(h);var v=tn["idb://".concat(i,"/").concat(s)];return v?(d=c.mutate(h),h.type!=="add"&&h.type!=="put"||!(50<=h.values.length||$o(l,h).some(function(_){return _==null}))?(v.optimisticOps.push(h),h.mutatedParts&&vi(h.mutatedParts),d.then(function(_){0<_.numFailures&&(lt(v.optimisticOps,h),(_=eu(0,h,_))&&v.optimisticOps.push(_),h.mutatedParts&&vi(h.mutatedParts))}),d.catch(function(){lt(v.optimisticOps,h),h.mutatedParts&&vi(h.mutatedParts)})):d.then(function(_){var m=eu(0,o(o({},h),{values:h.values.map(function(b,y){var x,b=(x=l.keyPath)!==null&&x!==void 0&&x.includes(".")?ct(b):o({},b);return Ce(b,l.keyPath,_.results[y]),b})}),_);v.optimisticOps.push(m),queueMicrotask(function(){return h.mutatedParts&&vi(h.mutatedParts)})}),d):c.mutate(h)},query:function(h){if(!Xs(F,c)||!Zs("query",h))return c.query(h);var d=((m=F.trans)===null||m===void 0?void 0:m.db._options.cache)==="immutable",y=F,v=y.requery,_=y.signal,m=function(E,A,w,T){var N=tn["idb://".concat(E,"/").concat(A)];if(!N)return[];if(!(A=N.queries[w]))return[null,!1,N,null];var M=A[(T.query?T.query.index.name:null)||""];if(!M)return[null,!1,N,null];switch(w){case"query":var k=M.find(function(L){return L.req.limit===T.limit&&L.req.values===T.values&&nu(L.req.query.range,T.query.range)});return k?[k,!0,N,M]:[M.find(function(L){return("limit"in L.req?L.req.limit:1/0)>=T.limit&&(!T.values||L.req.values)&&ed(L.req.query.range,T.query.range)}),!1,N,M];case"count":return k=M.find(function(L){return nu(L.req.query.range,T.query.range)}),[k,!!k,N,M]}}(i,s,"query",h),O=m[0],y=m[1],x=m[2],b=m[3];return O&&y?O.obsSet=h.obsSet:(y=c.query(h).then(function(E){var A=E.result;if(O&&(O.res=A),d){for(var w=0,T=A.length;w<T;++w)Object.freeze(A[w]);Object.freeze(A)}else E.result=ct(A);return E}).catch(function(E){return b&&O&<(b,O),Promise.reject(E)}),O={obsSet:h.obsSet,promise:y,subscribers:new Set,type:"query",req:h,dirty:!1},b?b.push(O):(b=[O],(x=x||(tn["idb://".concat(i,"/").concat(s)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[h.query.index.name||""]=b)),td(O,b,v,_),O.promise.then(function(E){return{result:tu(E.result,h,x==null?void 0:x.optimisticOps,c,O,d)}})}})}})}};function mi(r,i){return new Proxy(r,{get:function(s,c,l){return c==="db"?i:Reflect.get(s,c,l)}})}var St=(xe.prototype.version=function(r){if(isNaN(r)||r<.1)throw new Y.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new Y.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var i=this._versions,s=i.filter(function(c){return c._cfg.version===r})[0];return s||(s=new this.Version(r),i.push(s),i.sort(qh),s.stores({}),this._state.autoSchema=!1,s)},xe.prototype._whenReady=function(r){var i=this;return this.idbdb&&(this._state.openComplete||F.letThrough||this._vip)?r():new R(function(s,c){if(i._state.openComplete)return c(new Y.DatabaseClosed(i._state.dbOpenError));if(!i._state.isBeingOpened){if(!i._state.autoOpen)return void c(new Y.DatabaseClosed);i.open().catch(se)}i._state.dbReadyPromise.then(s,c)}).then(r)},xe.prototype.use=function(r){var i=r.stack,s=r.create,c=r.level,l=r.name;return l&&this.unuse({stack:i,name:l}),r=this._middlewares[i]||(this._middlewares[i]=[]),r.push({stack:i,create:s,level:c??10,name:l}),r.sort(function(h,d){return h.level-d.level}),this},xe.prototype.unuse=function(r){var i=r.stack,s=r.name,c=r.create;return i&&this._middlewares[i]&&(this._middlewares[i]=this._middlewares[i].filter(function(l){return c?l.create!==c:!!s&&l.name!==s})),this},xe.prototype.open=function(){var r=this;return Xt(K,function(){return Yh(r)})},xe.prototype._close=function(){var r=this._state,i=wn.indexOf(this);if(0<=i&&wn.splice(i,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new R(function(s){r.dbReadyResolve=s}),r.openCanceller=new R(function(s,c){r.cancelOpen=c}))},xe.prototype.close=function(s){var i=(s===void 0?{disableAutoOpen:!0}:s).disableAutoOpen,s=this._state;i?(s.isBeingOpened&&s.cancelOpen(new Y.DatabaseClosed),this._close(),s.autoOpen=!1,s.dbOpenError=new Y.DatabaseClosed):(this._close(),s.autoOpen=this._options.autoOpen||s.isBeingOpened,s.openComplete=!1,s.dbOpenError=null)},xe.prototype.delete=function(r){var i=this;r===void 0&&(r={disableAutoOpen:!0});var s=0<arguments.length&&typeof arguments[0]!="object",c=this._state;return new R(function(l,h){function d(){i.close(r);var v=i._deps.indexedDB.deleteDatabase(i.name);v.onsuccess=be(function(){var _,m,O;_=i._deps,m=i.name,O=_.indexedDB,_=_.IDBKeyRange,Ro(O)||m===ri||No(O,_).delete(m).catch(se),l()}),v.onerror=ft(h),v.onblocked=i._fireOnBlocked}if(s)throw new Y.InvalidArgument("Invalid closeOptions argument to db.delete()");c.isBeingOpened?c.dbReadyPromise.then(d):d()})},xe.prototype.backendDB=function(){return this.idbdb},xe.prototype.isOpen=function(){return this.idbdb!==null},xe.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},xe.prototype.hasFailed=function(){return this._state.dbOpenError!==null},xe.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(xe.prototype,"tables",{get:function(){var r=this;return f(this._allTables).map(function(i){return r._allTables[i]})},enumerable:!1,configurable:!0}),xe.prototype.transaction=function(){var r=(function(i,s,c){var l=arguments.length;if(l<2)throw new Y.InvalidArgument("Too few arguments");for(var h=new Array(l-1);--l;)h[l-1]=arguments[l];return c=h.pop(),[i,Kr(h),c]}).apply(this,arguments);return this._transaction.apply(this,r)},xe.prototype._transaction=function(r,i,s){var c=this,l=F.trans;l&&l.db===this&&r.indexOf("!")===-1||(l=null);var h,d,v=r.indexOf("?")!==-1;r=r.replace("!","").replace("?","");try{if(d=i.map(function(m){if(m=m instanceof c.Table?m.name:m,typeof m!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return m}),r=="r"||r===bo)h=bo;else{if(r!="rw"&&r!=_o)throw new Y.InvalidArgument("Invalid transaction mode: "+r);h=_o}if(l){if(l.mode===bo&&h===_o){if(!v)throw new Y.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");l=null}l&&d.forEach(function(m){if(l&&l.storeNames.indexOf(m)===-1){if(!v)throw new Y.SubTransaction("Table "+m+" not included in parent transaction.");l=null}}),v&&l&&!l.active&&(l=null)}}catch(m){return l?l._promise(null,function(O,y){y(m)}):Oe(m)}var _=(function m(O,y,x,b,E){return R.resolve().then(function(){var A=F.transless||F,w=O._createTransaction(y,x,O._dbSchema,b);if(w.explicit=!0,A={trans:w,transless:A},b)w.idbtrans=b.idbtrans;else try{w.create(),w.idbtrans._explicit=!0,O._state.PR1398_maxLoop=3}catch(M){return M.name===$n.InvalidState&&O.isOpen()&&0<--O._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),O.close({disableAutoOpen:!1}),O.open().then(function(){return m(O,y,x,null,E)})):Oe(M)}var T,N=mn(E);return N&&_n(),A=R.follow(function(){var M;(T=E.call(w,w))&&(N?(M=Mt.bind(null,null),T.then(M,M)):typeof T.next=="function"&&typeof T.throw=="function"&&(T=Vo(T)))},A),(T&&typeof T.then=="function"?R.resolve(T).then(function(M){return w.active?M:Oe(new Y.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):A.then(function(){return T})).then(function(M){return b&&w._resolve(),w._completion.then(function(){return M})}).catch(function(M){return w._reject(M),Oe(M)})})}).bind(null,this,h,d,l,s);return l?l._promise(h,_,"lock"):F.trans?Xt(F.transless,function(){return c._whenReady(_)}):this._whenReady(_)},xe.prototype.table=function(r){if(!P(this._allTables,r))throw new Y.InvalidTable("Table ".concat(r," does not exist"));return this._allTables[r]},xe);function xe(r,i){var s=this;this._middlewares={},this.verno=0;var c=xe.dependencies;this._options=i=o({addons:xe.addons,autoOpen:!0,indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange,cache:"cloned"},i),this._deps={indexedDB:i.indexedDB,IDBKeyRange:i.IDBKeyRange},c=i.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var l,h,d,v,_,m={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:se,dbReadyPromise:null,cancelOpen:se,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:i.autoOpen};m.dbReadyPromise=new R(function(y){m.dbReadyResolve=y}),m.openCanceller=new R(function(y,x){m.cancelOpen=x}),this._state=m,this.name=r,this.on=Hn(this,"populate","blocked","versionchange","close",{ready:[bn,se]}),this.on.ready.subscribe=mt(this.on.ready.subscribe,function(y){return function(x,b){xe.vip(function(){var E,A=s._state;A.openComplete?(A.dbOpenError||R.resolve().then(x),b&&y(x)):A.onReadyBeingFired?(A.onReadyBeingFired.push(x),b&&y(x)):(y(x),E=s,b||y(function w(){E.on.ready.unsubscribe(x),E.on.ready.unsubscribe(w)}))})}}),this.Collection=(l=this,Gn(Fh.prototype,function(T,w){this.db=l;var b=Ms,E=null;if(w)try{b=w()}catch(N){E=N}var A=T._ctx,w=A.table,T=w.hook.reading.fire;this._ctx={table:w,index:A.index,isPrimKey:!A.index||w.schema.primKey.keyPath&&A.index===w.schema.primKey.name,range:b,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:E,or:A.or,valueMapper:T!==It?T:null}})),this.Table=(h=this,Gn(Fs.prototype,function(y,x,b){this.db=h,this._tx=b,this.name=y,this.schema=x,this.hook=h._allTables[y]?h._allTables[y].hook:Hn(null,{creating:[zr,se],reading:[yo,It],updating:[Gr,se],deleting:[Hr,se]})})),this.Transaction=(d=this,Gn(Vh.prototype,function(y,x,b,E,A){var w=this;this.db=d,this.mode=y,this.storeNames=x,this.schema=b,this.chromeTransactionDurability=E,this.idbtrans=null,this.on=Hn(this,"complete","error","abort"),this.parent=A||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new R(function(T,N){w._resolve=T,w._reject=N}),this._completion.then(function(){w.active=!1,w.on.complete.fire()},function(T){var N=w.active;return w.active=!1,w.on.error.fire(T),w.parent?w.parent._reject(T):N&&w.idbtrans&&w.idbtrans.abort(),Oe(T)})})),this.Version=(v=this,Gn(Gh.prototype,function(y){this.db=v,this._cfg={version:y,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(_=this,Gn($s.prototype,function(y,x,b){if(this.db=_,this._ctx={table:y,index:x===":id"?null:x,or:b},this._cmp=this._ascending=le,this._descending=function(E,A){return le(A,E)},this._max=function(E,A){return 0<le(E,A)?E:A},this._min=function(E,A){return le(E,A)<0?E:A},this._IDBKeyRange=_._deps.IDBKeyRange,!this._IDBKeyRange)throw new Y.MissingAPI})),this.on("versionchange",function(y){0<y.newVersion?console.warn("Another connection wants to upgrade database '".concat(s.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(s.name,"'. Closing db now to resume the delete request.")),s.close({disableAutoOpen:!1})}),this.on("blocked",function(y){!y.newVersion||y.newVersion<y.oldVersion?console.warn("Dexie.delete('".concat(s.name,"') was blocked")):console.warn("Upgrade '".concat(s.name,"' blocked by other connection holding version ").concat(y.oldVersion/10))}),this._maxKey=Jn(i.IDBKeyRange),this._createTransaction=function(y,x,b,E){return new s.Transaction(y,x,b,s._options.chromeTransactionDurability,E)},this._fireOnBlocked=function(y){s.on("blocked").fire(y),wn.filter(function(x){return x.name===s.name&&x!==s&&!x._state.vcFired}).map(function(x){return x.on("versionchange").fire(y)})},this.use(Xh),this.use(nd),this.use(Zh),this.use(Qh),this.use(Jh);var O=new Proxy(this,{get:function(y,x,b){if(x==="_vip")return!0;if(x==="table")return function(A){return mi(s.table(A),O)};var E=Reflect.get(y,x,b);return E instanceof Fs?mi(E,O):x==="tables"?E.map(function(A){return mi(A,O)}):x==="_createTransaction"?function(){return mi(E.apply(this,arguments),O)}:E}});this.vip=O,c.forEach(function(y){return y(s)})}var bi,tt=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",rd=(qo.prototype.subscribe=function(r,i,s){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:i,complete:s})},qo.prototype[tt]=function(){return this},qo);function qo(r){this._subscribe=r}try{bi={indexedDB:u.indexedDB||u.mozIndexedDB||u.webkitIndexedDB||u.msIndexedDB,IDBKeyRange:u.IDBKeyRange||u.webkitIDBKeyRange}}catch{bi={indexedDB:null,IDBKeyRange:null}}function ru(r){var i,s=!1,c=new rd(function(l){var h=mn(r),d,v=!1,_={},m={},O={get closed(){return v},unsubscribe:function(){v||(v=!0,d&&d.abort(),y&&Lt.storagemutated.unsubscribe(b))}};l.start&&l.start(O);var y=!1,x=function(){return mo(E)},b=function(A){gi(_,A),Lo(m,_)&&x()},E=function(){var A,w,T;!v&&bi.indexedDB&&(_={},A={},d&&d.abort(),d=new AbortController,T=function(N){var M=_t();try{h&&_n();var k=Rt(r,N);return k=h?k.finally(Mt):k}finally{M&&Nt()}}(w={subscr:A,signal:d.signal,requery:x,querier:r,trans:null}),Promise.resolve(T).then(function(N){s=!0,i=N,v||w.signal.aborted||(_={},function(M){for(var k in M)if(P(M,k))return;return 1}(m=A)||y||(Lt(Qn,b),y=!0),mo(function(){return!v&&l.next&&l.next(N)}))},function(N){s=!1,["DatabaseClosedError","AbortError"].includes(N==null?void 0:N.name)||v||mo(function(){v||l.error&&l.error(N)})}))};return setTimeout(x,0),O});return c.hasValue=function(){return s},c.getValue=function(){return i},c}var nn=St;function zo(r){var i=Ft;try{Ft=!0,Lt.storagemutated.fire(r),Ko(r,!0)}finally{Ft=i}}B(nn,o(o({},Gt),{delete:function(r){return new nn(r,{addons:[]}).delete()},exists:function(r){return new nn(r,{addons:[]}).open().then(function(i){return i.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return i=nn.dependencies,s=i.indexedDB,i=i.IDBKeyRange,(Ro(s)?Promise.resolve(s.databases()).then(function(c){return c.map(function(l){return l.name}).filter(function(l){return l!==ri})}):No(s,i).toCollection().primaryKeys()).then(r)}catch{return Oe(new Y.MissingAPI)}var i,s},defineClass:function(){return function(r){S(this,r)}},ignoreTransaction:function(r){return F.trans?Xt(F.transless,r):r()},vip:Mo,async:function(r){return function(){try{var i=Vo(r.apply(this,arguments));return i&&typeof i.then=="function"?i:R.resolve(i)}catch(s){return Oe(s)}}},spawn:function(r,i,s){try{var c=Vo(r.apply(s,i||[]));return c&&typeof c.then=="function"?c:R.resolve(c)}catch(l){return Oe(l)}},currentTransaction:{get:function(){return F.trans||null}},waitFor:function(r,i){return i=R.resolve(typeof r=="function"?nn.ignoreTransaction(r):r).timeout(i||6e4),F.trans?F.trans.waitFor(i):i},Promise:R,debug:{get:function(){return Ue},set:function(r){Qr(r)}},derive:fe,extend:S,props:B,override:mt,Events:Hn,on:Lt,liveQuery:ru,extendObservabilitySet:gi,getByKeyPath:te,setByKeyPath:Ce,delByKeyPath:function(r,i){typeof i=="string"?Ce(r,i,void 0):"length"in i&&[].map.call(i,function(s){Ce(r,s,void 0)})},shallowClone:vn,deepClone:ct,getObjectDiff:Wo,cmp:le,asap:Pt,minKey:-1/0,addons:[],connections:wn,errnames:$n,dependencies:bi,cache:tn,semVer:"4.0.4",version:"4.0.4".split(".").map(function(r){return parseInt(r)}).reduce(function(r,i,s){return r+i/Math.pow(10,2*s)})})),nn.maxKey=Jn(nn.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Lt(Qn,function(r){Ft||(r=new CustomEvent(xo,{detail:r}),Ft=!0,dispatchEvent(r),Ft=!1)}),addEventListener(xo,function(r){r=r.detail,Ft||zo(r)}));var On,Ft=!1,iu=function(){};return typeof BroadcastChannel<"u"&&((iu=function(){(On=new BroadcastChannel(xo)).onmessage=function(r){return r.data&&zo(r.data)}})(),typeof On.unref=="function"&&On.unref(),Lt(Qn,function(r){Ft||On.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!St.disableBfCache&&r.persisted){Ue&&console.debug("Dexie: handling persisted pagehide"),On!=null&&On.close();for(var i=0,s=wn;i<s.length;i++)s[i].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!St.disableBfCache&&r.persisted&&(Ue&&console.debug("Dexie: handling persisted pageshow"),iu(),zo({all:new Re(-1/0,[[]])}))})),R.rejectionMapper=function(r,i){return!r||r instanceof He||r instanceof TypeError||r instanceof SyntaxError||!r.name||!Ge[r.name]?r:(i=new Ge[r.name](i||r.message,r),"stack"in r&&Z(i,"stack",{get:function(){return this.inner.stack}}),i)},Qr(Ue),o(St,Object.freeze({__proto__:null,Dexie:St,liveQuery:ru,Entity:ks,cmp:le,PropModSymbol:Et,PropModification:So,replacePrefix:function(r,i){return new So({replacePrefix:[r,i]})},default:St,RangeSet:Re,mergeRanges:er,rangesOverlap:pi}),{default:St}),St})})(Ps);var wh=Ps.exports,lo=Yc(wh);const Ts=Symbol.for("Dexie"),fo=globalThis[Ts]||(globalThis[Ts]=lo);if(lo.semVer!==fo.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${lo.semVer} and ${fo.semVer}`);/**
|
|
162
|
+
* See the LICENSE file distributed with this work for additional
|
|
163
|
+
* information regarding copyright ownership.
|
|
164
|
+
*
|
|
165
|
+
* This is free software; you can redistribute it and/or modify it
|
|
166
|
+
* under the terms of the GNU Affero General Public License as
|
|
167
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
168
|
+
* the License, or (at your option) any later version.
|
|
169
|
+
*
|
|
170
|
+
* This software is distributed in the hope that it will be useful,
|
|
171
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
172
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
173
|
+
* Lesser General Public License for more details.
|
|
174
|
+
*
|
|
175
|
+
* You should have received a copy of the GNU Affero General Public
|
|
176
|
+
* License along with this software; if not, write to the Free
|
|
177
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
178
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
179
|
+
*
|
|
180
|
+
* This file is part of the Cristal Wiki software prototype
|
|
181
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
182
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
183
|
+
*
|
|
184
|
+
**/class Eh extends fo{constructor(t){super("pages_"+t),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}var Sh=Object.defineProperty,Oh=Object.getOwnPropertyDescriptor,xh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Oh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Sh(t,n,a),a},Ah=(e,t)=>(n,o)=>t(n,o,e);let ho=class{constructor(e){this.pageStorageMap=new Map,this.logger=e,this.logger.setModule("storage.components.dexieOfflineStorage")}getPageStorage(e){let t=this.pageStorageMap.get(e);return t==null&&(t=new Eh(e),this.pageStorageMap.set(e,t)),t}async getPage(e,t){try{this.logger.debug("Ready to load page from local storage",t);const n=this.getPageStorage(e);this.logger.debug("pageStorage is ready, asking for page");const o=await n.pages.get(t),a=new Vn;return a.fromObject(o),a}catch(n){this.logger.debug("Exception while trying to read from local storage",n);return}}async savePage(e,t,n){try{await this.getPageStorage(e).pages.put(n.toObject(),t)}catch(o){this.logger.debug("Exception while trying to store in local storage",e,t,n,o)}}async updatePage(e,t,n){try{const o=this.getPageStorage(e);this.logger.debug("Ready to store",n),await o.pages.update(t,n.toObject())}catch(o){this.logger.debug("Exception while trying to store in local storage",e,t,n,o)}}};ho=xh([Ke(),Ah(0,je("Logger"))],ho);/**
|
|
185
|
+
* See the LICENSE file distributed with this work for additional
|
|
186
|
+
* information regarding copyright ownership.
|
|
187
|
+
*
|
|
188
|
+
* This is free software; you can redistribute it and/or modify it
|
|
189
|
+
* under the terms of the GNU Affero General Public License as
|
|
190
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
191
|
+
* the License, or (at your option) any later version.
|
|
192
|
+
*
|
|
193
|
+
* This software is distributed in the hope that it will be useful,
|
|
194
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
195
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
196
|
+
* Lesser General Public License for more details.
|
|
197
|
+
*
|
|
198
|
+
* You should have received a copy of the GNU Affero General Public
|
|
199
|
+
* License along with this software; if not, write to the Free
|
|
200
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
201
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
202
|
+
*
|
|
203
|
+
* This file is part of the Cristal Wiki software prototype
|
|
204
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
205
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
206
|
+
*
|
|
207
|
+
**/class Ch{constructor(t){var n,o;this.logger=t.get("Logger"),this.logger.setModule("storage.components.componentsInit"),(n=this.logger)==null||n.debug("Init Sample Module components begin"),t.bind("OfflineStorage").to(ho).inSingletonScope(),t.bind("WrappingStorage").to(co).inSingletonScope(),t.bind("WikiConfig").to(oo).whenTargetNamed("XWiki"),t.bind("WikiConfig").to(so).whenTargetNamed("GitHub"),t.bind("Storage").to(io).whenTargetNamed("XWiki"),t.bind("Storage").to(ao).whenTargetNamed("GitHub"),(o=this.logger)==null||o.debug("Init Sample Module components end")}}var Ph=Object.defineProperty,Th=Object.getOwnPropertyDescriptor,Ih=(e,t,n,o)=>{for(var a=o>1?void 0:o?Th(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Ph(t,n,a),a};let po=class{constructor(){this.availableConfigurations=new Map}getApp(){throw new Error("Method not implemented.")}getRouter(){throw new Error("Method not implemented.")}getContainer(){return this.container}setContainer(e){this.container=e}getWikiConfig(){return this.wikiConfig}setWikiConfig(e){this.wikiConfig=e}getSkinManager(){throw new Error("Method not implemented.")}switchConfig(){}setAvailableConfigurations(e){console.log(e),e.forEach((t,n)=>{const o=t==null?void 0:t.configType;if(t){const a=this.container.getNamed("WikiConfig",o);a.setConfigFromObject(t),this.availableConfigurations.set(n,a)}})}getAvailableConfigurations(){return this.availableConfigurations}run(){throw new Error("Method not implemented.")}getUIXTemplates(){throw new Error("Method not implemented.")}getMenuEntries(){throw new Error("Method not implemented.")}getCurrentPage(){throw new Error("Method not implemented.")}getCurrentContent(){throw new Error("Method not implemented.")}getCurrentSource(){throw new Error("Method not implemented.")}getCurrentSyntax(){throw new Error("Method not implemented.")}setCurrentPage(){throw new Error("Method not implemented.")}setContentRef(){throw new Error("Method not implemented.")}loadPageFromURL(){throw new Error("Method not implemented.")}loadPage(){throw new Error("Method not implemented.")}getPage(){throw new Error("Method not implemented.")}getLogger(){throw new Error("Method not implemented.")}getLoggerConfig(){throw new Error("Method not implemented.")}renderContent(){throw new Error("Method not implemented.")}};po=Ih([Ke()],po);var Dh=Object.defineProperty,Nh=Object.getOwnPropertyDescriptor,Rh=(e,t,n,o)=>{for(var a=o>1?void 0:o?Nh(t,n):t,u=e.length-1,f;u>=0;u--)(f=e[u])&&(a=(o?f(t,n,a):f(a))||a);return o&&a&&Dh(t,n,a),a};let go=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};go=Rh([Ke()],go);/**
|
|
208
|
+
* See the LICENSE file distributed with this work for additional
|
|
209
|
+
* information regarding copyright ownership.
|
|
210
|
+
*
|
|
211
|
+
* This is free software; you can redistribute it and/or modify it
|
|
212
|
+
* under the terms of the GNU Affero General Public License as
|
|
213
|
+
* published by the Free Software Foundation; either version 2.1 of
|
|
214
|
+
* the License, or (at your option) any later version.
|
|
215
|
+
*
|
|
216
|
+
* This software is distributed in the hope that it will be useful,
|
|
217
|
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
218
|
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
219
|
+
* Lesser General Public License for more details.
|
|
220
|
+
*
|
|
221
|
+
* You should have received a copy of the GNU Affero General Public
|
|
222
|
+
* License along with this software; if not, write to the Free
|
|
223
|
+
* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
|
|
224
|
+
* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
|
|
225
|
+
*
|
|
226
|
+
* This file is part of the Cristal Wiki software prototype
|
|
227
|
+
* @copyright Copyright (c) 2023 XWiki SAS
|
|
228
|
+
* @license http://opensource.org/licenses/AGPL-3.0 AGPL-3.0
|
|
229
|
+
*
|
|
230
|
+
**/class Mh{constructor(){this.currentNumber=0,this.queue=[],this.initialized=!1}async start(){for(console.log("Starting worker thread"),this.initialize();;)await this.sleep(1e3),this.checkQueue()}setPageLoadedCallback(t){this.fct=t}sleep(t){return new Promise(n=>setTimeout(n,t))}async checkQueue(){if(this.getQueueSize()>0)if(this.initialized){const n=this.queue.pop();n&&await this.handleQueueItem(n),await this.checkQueue()}else console.log("Worker cristal code not initialized yet. Cannot process queue items.")}async handleQueueItem(t){console.log("Handling queue item code ready to process",t);try{let n=null,o=null,a=null;const u=t.indexOf(":"),f=t.lastIndexOf("_");if(u!=-1&&f!=-1){n=t.substring(0,u),o=t.substring(u+1,f),a=t.substring(f+1);const g=this.getWikiConfig(n);g==null?console.log("Could not find config for page",t):(console.log("Updating page ",o,a),await g.storage.updatePageContent(o,a)&&(console.log("Page updated. Calling back to main thread"),this.fct(t)))}else console.log("Could not process page",t)}catch(n){console.log("Exception while trying to load",t,n)}}add(t){return console.log("Worker in add"),this.currentNumber+=t,this.currentNumber}addToQueue(t){console.log("Worker in addToQueue",t),this.queue.includes(t)||this.queue.push(t)}getQueueSize(){return console.log("Worker in getQueueSize"),this.queue.length}getWikiConfig(t){const n=this.configMap.get(t);if(n==null){console.error("Failed to find wikiConfig for configName",t);return}const a=new Map(Object.entries(n)).get("configType");console.log("Looking for wikiConfig for name",t,"and type",a);let u;try{return u=this.container.getNamed("WikiConfig",a),this.cristal.setWikiConfig(u),u.setConfigFromObject(n),u.initialize(),console.debug("Found wikiConfig for",t,"and type",a,":",u),u}catch(f){console.error("Failed to find wikiConfig for name",t,"and type",a,f);return}}async initialize(){console.log("Starting initialize");const t=["storage"],o=await(await fetch("/config.json")).json();this.configMap=new Map(Object.entries(o)),console.log("Loaded json config",this.configMap);const a=new Zf(t);a.initializeContainer(),this.container=a.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(po).inSingletonScope(),this.container.bind("QueueWorker").to(go).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new Ch(a.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const Is=new Mh;Is.start(),onconnect=e=>{Ei(Is,e.ports[0])},console.log("Worker code loaded")})();
|
|
231
|
+
//# sourceMappingURL=worker-D2exZhnK.js.map
|