@xwiki/cristal-sharedworker-impl 0.12.0 → 0.13.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 +19 -0
- package/dist/assets/worker-89Qy0euM.js +57 -0
- package/dist/assets/worker-89Qy0euM.js.map +1 -0
- package/dist/index.es.js +7 -7
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +1 -1
- package/dist/index.umd.js.map +1 -1
- package/package.json +22 -17
- package/src/components/defaultQueueWorker.ts +5 -2
- package/src/components/worker.ts +9 -2
- package/tsconfig.json +17 -8
- package/vitest.config.ts +25 -0
- package/dist/assets/worker-ZwjuRGo7.js +0 -46
- package/dist/assets/worker-ZwjuRGo7.js.map +0 -1
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
(function(){"use strict";var Ge="named",ca="name",sr="unmanaged",Ti="optional",ur="inject",Dn="multi_inject",la="inversify:tagged",fa="inversify:tagged_props",Di="inversify:paramtypes",gu="design:paramtypes",ha="post_construct",Ii="pre_destroy";function vu(){return[ur,Dn,ca,sr,Ge,Ti]}var da=vu(),Se={Request:"Request",Singleton:"Singleton",Transient:"Transient"},ge={ConstantValue:"ConstantValue",Constructor:"Constructor",DynamicValue:"DynamicValue",Factory:"Factory",Function:"Function",Instance:"Instance",Invalid:"Invalid",Provider:"Provider"},In={ClassProperty:"ClassProperty",ConstructorArgument:"ConstructorArgument",Variable:"Variable"},yu=0;function Nn(){return yu++}var mu=function(){function e(t,n){this.id=Nn(),this.activated=!1,this.serviceIdentifier=t,this.scope=n,this.type=ge.Invalid,this.constraint=function(i){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===Se.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}(),bu="Cannot apply @injectable decorator multiple times.",pa="Metadata key was used more than once in a parameter:",Rn="NULL argument",ga="Key Not Found",_u="Ambiguous match found for serviceIdentifier:",wu="Could not unbind serviceIdentifier:",Eu="No matching bindings found for serviceIdentifier:",va="Missing required @injectable annotation in:",Su="Missing required @inject or @multiInject annotation in:",Ou=function(e){return"@inject called with undefined this could mean that the class ".concat(e," has ")+"a circular dependency problem. You can use a LazyServiceIdentifer to overcome this limitation."},xu="Circular dependency found:",Au="Invalid binding type:",Cu="No snapshot available to restore.",Pu="Invalid return type in middleware. Middleware must return!",Tu="Value provided to function binding must be a function!",Du=function(e){return"You are attempting to construct ".concat(Ku(e)," in a synchronous way ")+"but it has asynchronous dependencies."},Iu="The toSelf function can only be applied when a constructor is used as service identifier",ya="The @inject @multiInject @tagged and @named decorators must be applied to the parameters of a class constructor or a class property.",Nu=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return"The number of constructor arguments in the derived class "+"".concat(e[0]," must be >= than the number of constructor arguments of its base class.")},Ru="Invalid Container constructor argument. Container options must be an object.",Mu='Invalid Container option. Default scope must be a string ("singleton" or "transient").',ku="Invalid Container option. Auto bind injectable must be a boolean",ju="Invalid Container option. Skip base check must be a boolean",Lu="Attempting to unbind dependency with asynchronous destruction (@preDestroy or onDeactivation)",Fu=function(e,t){return"@postConstruct error in class ".concat(e,": ").concat(t)},Bu=function(e,t){return"@preDestroy error in class ".concat(e,": ").concat(t)},Ni=function(e,t){return"onDeactivation() error in class ".concat(e,": ").concat(t)},$u=function(e,t){return"It looks like there is a circular dependency in one of the '".concat(e,"' bindings. Please investigate bindings with ")+"service identifier '".concat(t,"'.")},Vu="Maximum call stack size exceeded";function Ku(e){return typeof e=="function"?"[function/class ".concat(e.name||"<anonymous>","]"):typeof e=="symbol"?e.toString():"'".concat(e,"'")}var Wu=function(){function e(){}return e.prototype.getConstructorMetadata=function(t){var n=Reflect.getMetadata(Di,t),i=Reflect.getMetadata(la,t);return{compilerGeneratedMetadata:n,userGeneratedMetadata:i||{}}},e.prototype.getPropertiesMetadata=function(t){var n=Reflect.getMetadata(fa,t)||[];return n},e}(),cr={MultipleBindingsAvailable:2,NoBindingsAvailable:0,OnlyOneBindingAvailable:1};function ma(e){return e instanceof RangeError||e.message===Vu}var Uu=function(e,t){try{return e()}catch(n){throw ma(n)&&(n=t()),n}};function Mn(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 ba(e,t,n){var i="",a=n(e,t);return a.length!==0&&(i=`
|
|
2
|
-
Registered bindings:`,a.forEach(function(s){var l="Object";s.implementationType!==null&&(l=lr(s.implementationType)),i="".concat(i,`
|
|
3
|
-
`).concat(l),s.constraint.metaData&&(i="".concat(i," - ").concat(s.constraint.metaData))})),i}function _a(e,t){return e.parentRequest===null?!1:e.parentRequest.serviceIdentifier===t?!0:_a(e.parentRequest,t)}function qu(e){function t(i,a){a===void 0&&(a=[]);var s=Mn(i.serviceIdentifier);return a.push(s),i.parentRequest!==null?t(i.parentRequest,a):a}var n=t(e);return n.reverse().join(" --> ")}function wa(e){e.childRequests.forEach(function(t){if(_a(t,t.serviceIdentifier)){var n=qu(t);throw new Error("".concat(xu," ").concat(n))}else wa(t)})}function Hu(e,t){if(t.isTagged()||t.isNamed()){var n="",i=t.getNamedTag(),a=t.getCustomTags();return i!==null&&(n+=i.toString()+`
|
|
4
|
-
`),a!==null&&a.forEach(function(s){n+=s.toString()+`
|
|
5
|
-
`})," ".concat(e,`
|
|
6
|
-
`).concat(e," - ").concat(n)}else return" ".concat(e)}function lr(e){if(e.name)return e.name;var t=e.toString(),n=t.match(/^function\s*([^\s(]+)/);return n?n[1]:"Anonymous function: ".concat(t)}function zu(e){return e.toString().slice(7,-1)}var Ea=function(){function e(t){this.id=Nn(),this.container=t}return e.prototype.addPlan=function(t){this.plan=t},e.prototype.setCurrentRequest=function(t){this.currentRequest=t},e}(),pt=function(){function e(t,n){this.key=t,this.value=n}return e.prototype.toString=function(){return this.key===Ge?"named: ".concat(String(this.value).toString()," "):"tagged: { key:".concat(this.key.toString(),", value: ").concat(String(this.value)," }")},e}(),Gu=function(){function e(t,n){this.parentContext=t,this.rootRequest=n}return e}(),Yu=function(){function e(t){this._cb=t}return e.prototype.unwrap=function(){return this._cb()},e}(),Qu=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="",i=t.split("").reverse().join("");return n=this.str.split("").reverse().join(""),this.startsWith.call({str:n},i)},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}(),fr=function(){function e(t,n,i,a){this.id=Nn(),this.type=t,this.serviceIdentifier=i;var s=typeof n=="symbol"?zu(n):n;this.name=new Qu(s||""),this.identifier=n,this.metadata=new Array;var l=null;typeof a=="string"?l=new pt(Ge,a):a instanceof pt&&(l=a),l!==null&&this.metadata.push(l)}return e.prototype.hasTag=function(t){for(var n=0,i=this.metadata;n<i.length;n++){var a=i[n];if(a.key===t)return!0}return!1},e.prototype.isArray=function(){return this.hasTag(Dn)},e.prototype.matchesArray=function(t){return this.matchesTag(Dn)(t)},e.prototype.isNamed=function(){return this.hasTag(Ge)},e.prototype.isTagged=function(){return this.metadata.some(function(t){return da.every(function(n){return t.key!==n})})},e.prototype.isOptional=function(){return this.matchesTag(Ti)(!0)},e.prototype.getNamedTag=function(){return this.isNamed()?this.metadata.filter(function(t){return t.key===Ge})[0]:null},e.prototype.getCustomTags=function(){return this.isTagged()?this.metadata.filter(function(t){return da.every(function(n){return t.key!==n})}):null},e.prototype.matchesNamedTag=function(t){return this.matchesTag(Ge)(t)},e.prototype.matchesTag=function(t){var n=this;return function(i){for(var a=0,s=n.metadata;a<s.length;a++){var l=s[a];if(l.key===t&&l.value===i)return!0}return!1}},e}(),hr=function(e,t,n){if(n||arguments.length===2)for(var i=0,a=t.length,s;i<a;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))};function Ju(e,t){var n=lr(t);return Sa(e,n,t,!1)}function Sa(e,t,n,i){var a=e.getConstructorMetadata(n),s=a.compilerGeneratedMetadata;if(s===void 0){var l="".concat(va," ").concat(t,".");throw new Error(l)}var d=a.userGeneratedMetadata,m=Object.keys(d),g=n.length===0&&m.length>0,T=m.length>n.length,E=g||T?m.length:n.length,L=Zu(i,t,s,d,E),z=Oa(e,n,t),X=hr(hr([],L,!0),z,!0);return X}function Xu(e,t,n,i,a){var s=a[e.toString()]||[],l=Aa(s),d=l.unmanaged!==!0,m=i[e],g=l.inject||l.multiInject;if(m=g||m,m instanceof Yu&&(m=m.unwrap()),d){var T=m===Object,E=m===Function,L=m===void 0,z=T||E||L;if(!t&&z){var X="".concat(Su," argument ").concat(e," in class ").concat(n,".");throw new Error(X)}var se=new fr(In.ConstructorArgument,l.targetName,m);return se.metadata=s,se}return null}function Zu(e,t,n,i,a){for(var s=[],l=0;l<a;l++){var d=l,m=Xu(d,e,t,n,i);m!==null&&s.push(m)}return s}function ec(e,t,n,i){var a=e||t;if(a===void 0){var s="".concat(va," for property ").concat(String(n)," in class ").concat(i,".");throw new Error(s)}return a}function Oa(e,t,n){for(var i=e.getPropertiesMetadata(t),a=[],s=Object.getOwnPropertySymbols(i),l=Object.keys(i),d=l.concat(s),m=0,g=d;m<g.length;m++){var T=g[m],E=i[T],L=Aa(E),z=L.targetName||T,X=ec(L.inject,L.multiInject,T,n),se=new fr(In.ClassProperty,z,X);se.metadata=E,a.push(se)}var qe=Object.getPrototypeOf(t.prototype).constructor;if(qe!==Object){var Xe=Oa(e,qe,n);a=hr(hr([],a,!0),Xe,!0)}return a}function xa(e,t){var n=Object.getPrototypeOf(t.prototype).constructor;if(n!==Object){var i=lr(n),a=Sa(e,i,n,!0),s=a.map(function(m){return m.metadata.filter(function(g){return g.key===sr})}),l=[].concat.apply([],s).length,d=a.length-l;return d>0?d:xa(e,n)}else return 0}function Aa(e){var t={};return e.forEach(function(n){t[n.key.toString()]=n.value}),{inject:t[ur],multiInject:t[Dn],targetName:t[ca],unmanaged:t[sr]}}var Ri=function(){function e(t,n,i,a,s){this.id=Nn(),this.serviceIdentifier=t,this.parentContext=n,this.parentRequest=i,this.target=s,this.childRequests=[],this.bindings=Array.isArray(a)?a:[a],this.requestScope=i===null?new Map:null}return e.prototype.addChildRequest=function(t,n,i){var a=new e(t,this.parentContext,this,n,i);return this.childRequests.push(a),a},e}();function dr(e){return e._bindingDictionary}function tc(e,t,n,i,a,s){var l=e?Dn:ur,d=new pt(l,n),m=new fr(t,i,n,d);if(a!==void 0){var g=new pt(a,s);m.metadata.push(g)}return m}function Ca(e,t,n,i,a){var s=kn(n.container,a.serviceIdentifier),l=[];return s.length===cr.NoBindingsAvailable&&n.container.options.autoBindInjectable&&typeof a.serviceIdentifier=="function"&&e.getConstructorMetadata(a.serviceIdentifier).compilerGeneratedMetadata&&(n.container.bind(a.serviceIdentifier).toSelf(),s=kn(n.container,a.serviceIdentifier)),t?l=s:l=s.filter(function(d){var m=new Ri(d.serviceIdentifier,n,i,d,a);return d.constraint(m)}),nc(a.serviceIdentifier,l,a,n.container),l}function nc(e,t,n,i){switch(t.length){case cr.NoBindingsAvailable:if(n.isOptional())return t;var a=Mn(e),s=Eu;throw s+=Hu(a,n),s+=ba(i,a,kn),new Error(s);case cr.OnlyOneBindingAvailable:return t;case cr.MultipleBindingsAvailable:default:if(n.isArray())return t;var a=Mn(e),s="".concat(_u," ").concat(a);throw s+=ba(i,a,kn),new Error(s)}}function Pa(e,t,n,i,a,s){var l,d;if(a===null){l=Ca(e,t,i,null,s),d=new Ri(n,i,null,l,s);var m=new Gu(i,d);i.addPlan(m)}else l=Ca(e,t,i,a,s),d=a.addChildRequest(s.serviceIdentifier,l,s);l.forEach(function(g){var T=null;if(s.isArray())T=d.addChildRequest(g.serviceIdentifier,g,s);else{if(g.cache)return;T=d}if(g.type===ge.Instance&&g.implementationType!==null){var E=Ju(e,g.implementationType);if(!i.container.options.skipBaseClassChecks){var L=xa(e,g.implementationType);if(E.length<L){var z=Nu(lr(g.implementationType));throw new Error(z)}}E.forEach(function(X){Pa(e,!1,X.serviceIdentifier,i,T,X)})}})}function kn(e,t){var n=[],i=dr(e);return i.hasKey(t)?n=i.get(t):e.parent!==null&&(n=kn(e.parent,t)),n}function rc(e,t,n,i,a,s,l,d){d===void 0&&(d=!1);var m=new Ea(t),g=tc(n,i,a,"",s,l);try{return Pa(e,d,a,m,null,g),m}catch(T){throw ma(T)&&wa(m.plan.rootRequest),T}}function ic(e,t,n,i){var a=new fr(In.Variable,"",t,new pt(n,i)),s=new Ea(e),l=new Ri(t,s,null,[],a);return l}function Ke(e){var t=typeof e=="object"&&e!==null||typeof e=="function";return t&&typeof e.then=="function"}function Ta(e){return Ke(e)?!0:Array.isArray(e)&&e.some(Ke)}var oc=function(e,t,n,i){function a(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function d(T){try{g(i.next(T))}catch(E){l(E)}}function m(T){try{g(i.throw(T))}catch(E){l(E)}}function g(T){T.done?s(T.value):a(T.value).then(d,m)}g((i=i.apply(e,t||[])).next())})},ac=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,a,s,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=d(0),l.throw=d(1),l.return=d(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(g){return function(T){return m([g,T])}}function m(g){if(i)throw new TypeError("Generator is already executing.");for(;l&&(l=0,g[0]&&(n=0)),n;)try{if(i=1,a&&(s=g[0]&2?a.return:g[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,g[1])).done)return s;switch(a=0,s&&(g=[g[0]&2,s.value]),g[0]){case 0:case 1:s=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,a=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]<s[3])){n.label=g[1];break}if(g[0]===6&&n.label<s[1]){n.label=s[1],s=g;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(g);break}s[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(T){g=[6,T],a=0}finally{i=s=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},sc=function(e,t){return t.scope===Se.Singleton&&t.activated?t.cache:t.scope===Se.Request&&e.has(t.id)?e.get(t.id):null},uc=function(e,t,n){t.scope===Se.Singleton&&lc(t,n),t.scope===Se.Request&&cc(e,t,n)},cc=function(e,t,n){e.has(t.id)||e.set(t.id,n)},lc=function(e,t){e.cache=t,e.activated=!0,Ke(t)&&fc(e,t)},fc=function(e,t){return oc(void 0,void 0,void 0,function(){var n,i;return ac(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 i=a.sent(),e.cache=null,e.activated=!1,i;case 3:return[2]}})})},jn;(function(e){e.DynamicValue="toDynamicValue",e.Factory="toFactory",e.Provider="toProvider"})(jn||(jn={}));var hc=function(e){var t=null;switch(e.type){case ge.ConstantValue:case ge.Function:t=e.cache;break;case ge.Constructor:case ge.Instance:t=e.implementationType;break;case ge.DynamicValue:t=e.dynamicValue;break;case ge.Provider:t=e.provider;break;case ge.Factory:t=e.factory;break}if(t===null){var n=Mn(e.serviceIdentifier);throw new Error("".concat(Au," ").concat(n))}},dc=function(e){switch(e.type){case ge.Factory:return{factory:e.factory,factoryType:jn.Factory};case ge.Provider:return{factory:e.provider,factoryType:jn.Provider};case ge.DynamicValue:return{factory:e.dynamicValue,factoryType:jn.DynamicValue};default:throw new Error("Unexpected factory type ".concat(e.type))}},hn=function(){return hn=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},hn.apply(this,arguments)},Da=function(e,t,n,i){function a(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function d(T){try{g(i.next(T))}catch(E){l(E)}}function m(T){try{g(i.throw(T))}catch(E){l(E)}}function g(T){T.done?s(T.value):a(T.value).then(d,m)}g((i=i.apply(e,t||[])).next())})},Ia=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,a,s,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=d(0),l.throw=d(1),l.return=d(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(g){return function(T){return m([g,T])}}function m(g){if(i)throw new TypeError("Generator is already executing.");for(;l&&(l=0,g[0]&&(n=0)),n;)try{if(i=1,a&&(s=g[0]&2?a.return:g[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,g[1])).done)return s;switch(a=0,s&&(g=[g[0]&2,s.value]),g[0]){case 0:case 1:s=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,a=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]<s[3])){n.label=g[1];break}if(g[0]===6&&n.label<s[1]){n.label=s[1],s=g;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(g);break}s[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(T){g=[6,T],a=0}finally{i=s=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},pc=function(e,t,n){if(n||arguments.length===2)for(var i=0,a=t.length,s;i<a;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))};function gc(e,t){return e.reduce(function(n,i){var a=t(i),s=i.target.type;return s===In.ConstructorArgument?n.constructorInjections.push(a):(n.propertyRequests.push(i),n.propertyInjections.push(a)),n.isAsync||(n.isAsync=Ta(a)),n},{constructorInjections:[],propertyInjections:[],propertyRequests:[],isAsync:!1})}function vc(e,t,n){var i;if(t.length>0){var a=gc(t,n),s=hn(hn({},a),{constr:e});a.isAsync?i=yc(s):i=Na(s)}else i=new e;return i}function Na(e){var t,n=new((t=e.constr).bind.apply(t,pc([void 0],e.constructorInjections,!1)));return e.propertyRequests.forEach(function(i,a){var s=i.target.identifier,l=e.propertyInjections[a];(!i.target.isOptional()||l!==void 0)&&(n[s]=l)}),n}function yc(e){return Da(this,void 0,void 0,function(){var t,n;return Ia(this,function(i){switch(i.label){case 0:return[4,Ra(e.constructorInjections)];case 1:return t=i.sent(),[4,Ra(e.propertyInjections)];case 2:return n=i.sent(),[2,Na(hn(hn({},e),{constructorInjections:t,propertyInjections:n}))]}})})}function Ra(e){return Da(this,void 0,void 0,function(){var t,n,i,a;return Ia(this,function(s){for(t=[],n=0,i=e;n<i.length;n++)a=i[n],Array.isArray(a)?t.push(Promise.all(a)):t.push(a);return[2,Promise.all(t)]})})}function Ma(e,t){var n=mc(e,t);return Ke(n)?n.then(function(){return t}):t}function mc(e,t){var n,i;if(Reflect.hasMetadata(ha,e)){var a=Reflect.getMetadata(ha,e);try{return(i=(n=t)[a.value])===null||i===void 0?void 0:i.call(n)}catch(s){if(s instanceof Error)throw new Error(Fu(e.name,s.message))}}}function bc(e,t){e.scope!==Se.Singleton&&_c(e,t)}function _c(e,t){var n="Class cannot be instantiated in ".concat(e.scope===Se.Request?"request":"transient"," scope.");if(typeof e.onDeactivation=="function")throw new Error(Ni(t.name,n));if(Reflect.hasMetadata(Ii,t))throw new Error(Bu(t.name,n))}function wc(e,t,n,i){bc(e,t);var a=vc(t,n,i);return Ke(a)?a.then(function(s){return Ma(t,s)}):Ma(t,a)}var Ec=function(e,t,n,i){function a(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function d(T){try{g(i.next(T))}catch(E){l(E)}}function m(T){try{g(i.throw(T))}catch(E){l(E)}}function g(T){T.done?s(T.value):a(T.value).then(d,m)}g((i=i.apply(e,t||[])).next())})},Sc=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,a,s,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=d(0),l.throw=d(1),l.return=d(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(g){return function(T){return m([g,T])}}function m(g){if(i)throw new TypeError("Generator is already executing.");for(;l&&(l=0,g[0]&&(n=0)),n;)try{if(i=1,a&&(s=g[0]&2?a.return:g[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,g[1])).done)return s;switch(a=0,s&&(g=[g[0]&2,s.value]),g[0]){case 0:case 1:s=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,a=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]<s[3])){n.label=g[1];break}if(g[0]===6&&n.label<s[1]){n.label=s[1],s=g;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(g);break}s[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(T){g=[6,T],a=0}finally{i=s=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},Mi=function(e){return function(t){t.parentContext.setCurrentRequest(t);var n=t.bindings,i=t.childRequests,a=t.target&&t.target.isArray(),s=!t.parentRequest||!t.parentRequest.target||!t.target||!t.parentRequest.target.matchesArray(t.target.serviceIdentifier);if(a&&s)return i.map(function(d){var m=Mi(e);return m(d)});if(t.target.isOptional()&&n.length===0)return;var l=n[0];return Cc(e,t,l)}},Oc=function(e,t){var n=dc(e);return Uu(function(){return n.factory.bind(e)(t)},function(){return new Error($u(n.factoryType,t.currentRequest.serviceIdentifier.toString()))})},xc=function(e,t,n){var i,a=t.childRequests;switch(hc(n),n.type){case ge.ConstantValue:case ge.Function:i=n.cache;break;case ge.Constructor:i=n.implementationType;break;case ge.Instance:i=wc(n,n.implementationType,a,Mi(e));break;default:i=Oc(n,t.parentContext)}return i},Ac=function(e,t,n){var i=sc(e,t);return i!==null||(i=n(),uc(e,t,i)),i},Cc=function(e,t,n){return Ac(e,n,function(){var i=xc(e,t,n);return Ke(i)?i=i.then(function(a){return ka(t,n,a)}):i=ka(t,n,i),i})};function ka(e,t,n){var i=Pc(e.parentContext,t,n),a=Ic(e.parentContext.container),s,l=a.next();do{s=l.value;var d=e.parentContext,m=e.serviceIdentifier,g=Dc(s,m);Ke(i)?i=ja(g,d,i):i=Tc(g,d,i),l=a.next()}while(l.done!==!0&&!dr(s).hasKey(e.serviceIdentifier));return i}var Pc=function(e,t,n){var i;return typeof t.onActivation=="function"?i=t.onActivation(e,n):i=n,i},Tc=function(e,t,n){for(var i=e.next();!i.done;){if(n=i.value(t,n),Ke(n))return ja(e,t,n);i=e.next()}return n},ja=function(e,t,n){return Ec(void 0,void 0,void 0,function(){var i,a;return Sc(this,function(s){switch(s.label){case 0:return[4,n];case 1:i=s.sent(),a=e.next(),s.label=2;case 2:return a.done?[3,4]:[4,a.value(t,i)];case 3:return i=s.sent(),a=e.next(),[3,2];case 4:return[2,i]}})})},Dc=function(e,t){var n=e._activations;return n.hasKey(t)?n.get(t).values():[].values()},Ic=function(e){for(var t=[e],n=e.parent;n!==null;)t.push(n),n=n.parent;var i=function(){var s=t.pop();return s!==void 0?{done:!1,value:s}:{done:!0,value:void 0}},a={next:i};return a};function Nc(e){var t=Mi(e.plan.rootRequest.requestScope);return t(e.plan.rootRequest)}var bt=function(e,t){var n=e.parentRequest;return n!==null?t(n)?!0:bt(n,t):!1},Ln=function(e){return function(t){var n=function(i){return i!==null&&i.target!==null&&i.target.matchesTag(e)(t)};return n.metaData=new pt(e,t),n}},pr=Ln(Ge),ki=function(e){return function(t){var n=null;if(t!==null)if(n=t.bindings[0],typeof e=="string"){var i=n.serviceIdentifier;return i===e}else{var a=t.bindings[0].implementationType;return e===a}return!1}},gr=function(){function e(t){this._binding=t}return e.prototype.when=function(t){return this._binding.constraint=t,new Ne(this._binding)},e.prototype.whenTargetNamed=function(t){return this._binding.constraint=pr(t),new Ne(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 Ne(this._binding)},e.prototype.whenTargetTagged=function(t,n){return this._binding.constraint=Ln(t)(n),new Ne(this._binding)},e.prototype.whenInjectedInto=function(t){return this._binding.constraint=function(n){return n!==null&&ki(t)(n.parentRequest)},new Ne(this._binding)},e.prototype.whenParentNamed=function(t){return this._binding.constraint=function(n){return n!==null&&pr(t)(n.parentRequest)},new Ne(this._binding)},e.prototype.whenParentTagged=function(t,n){return this._binding.constraint=function(i){return i!==null&&Ln(t)(n)(i.parentRequest)},new Ne(this._binding)},e.prototype.whenAnyAncestorIs=function(t){return this._binding.constraint=function(n){return n!==null&&bt(n,ki(t))},new Ne(this._binding)},e.prototype.whenNoAncestorIs=function(t){return this._binding.constraint=function(n){return n!==null&&!bt(n,ki(t))},new Ne(this._binding)},e.prototype.whenAnyAncestorNamed=function(t){return this._binding.constraint=function(n){return n!==null&&bt(n,pr(t))},new Ne(this._binding)},e.prototype.whenNoAncestorNamed=function(t){return this._binding.constraint=function(n){return n!==null&&!bt(n,pr(t))},new Ne(this._binding)},e.prototype.whenAnyAncestorTagged=function(t,n){return this._binding.constraint=function(i){return i!==null&&bt(i,Ln(t)(n))},new Ne(this._binding)},e.prototype.whenNoAncestorTagged=function(t,n){return this._binding.constraint=function(i){return i!==null&&!bt(i,Ln(t)(n))},new Ne(this._binding)},e.prototype.whenAnyAncestorMatches=function(t){return this._binding.constraint=function(n){return n!==null&&bt(n,t)},new Ne(this._binding)},e.prototype.whenNoAncestorMatches=function(t){return this._binding.constraint=function(n){return n!==null&&!bt(n,t)},new Ne(this._binding)},e}(),Ne=function(){function e(t){this._binding=t}return e.prototype.onActivation=function(t){return this._binding.onActivation=t,new gr(this._binding)},e.prototype.onDeactivation=function(t){return this._binding.onDeactivation=t,new gr(this._binding)},e}(),_t=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new gr(this._binding),this._bindingOnSyntax=new Ne(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}(),Rc=function(){function e(t){this._binding=t}return e.prototype.inRequestScope=function(){return this._binding.scope=Se.Request,new _t(this._binding)},e.prototype.inSingletonScope=function(){return this._binding.scope=Se.Singleton,new _t(this._binding)},e.prototype.inTransientScope=function(){return this._binding.scope=Se.Transient,new _t(this._binding)},e}(),La=function(){function e(t){this._binding=t,this._bindingWhenSyntax=new gr(this._binding),this._bindingOnSyntax=new Ne(this._binding),this._bindingInSyntax=new Rc(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}(),Mc=function(){function e(t){this._binding=t}return e.prototype.to=function(t){return this._binding.type=ge.Instance,this._binding.implementationType=t,new La(this._binding)},e.prototype.toSelf=function(){if(typeof this._binding.serviceIdentifier!="function")throw new Error("".concat(Iu));var t=this._binding.serviceIdentifier;return this.to(t)},e.prototype.toConstantValue=function(t){return this._binding.type=ge.ConstantValue,this._binding.cache=t,this._binding.dynamicValue=null,this._binding.implementationType=null,this._binding.scope=Se.Singleton,new _t(this._binding)},e.prototype.toDynamicValue=function(t){return this._binding.type=ge.DynamicValue,this._binding.cache=null,this._binding.dynamicValue=t,this._binding.implementationType=null,new La(this._binding)},e.prototype.toConstructor=function(t){return this._binding.type=ge.Constructor,this._binding.implementationType=t,this._binding.scope=Se.Singleton,new _t(this._binding)},e.prototype.toFactory=function(t){return this._binding.type=ge.Factory,this._binding.factory=t,this._binding.scope=Se.Singleton,new _t(this._binding)},e.prototype.toFunction=function(t){if(typeof t!="function")throw new Error(Tu);var n=this.toConstantValue(t);return this._binding.type=ge.Function,this._binding.scope=Se.Singleton,n},e.prototype.toAutoFactory=function(t){return this._binding.type=ge.Factory,this._binding.factory=function(n){var i=function(){return n.container.get(t)};return i},this._binding.scope=Se.Singleton,new _t(this._binding)},e.prototype.toAutoNamedFactory=function(t){return this._binding.type=ge.Factory,this._binding.factory=function(n){return function(i){return n.container.getNamed(t,i)}},new _t(this._binding)},e.prototype.toProvider=function(t){return this._binding.type=ge.Provider,this._binding.provider=t,this._binding.scope=Se.Singleton,new _t(this._binding)},e.prototype.toService=function(t){this.toDynamicValue(function(n){return n.container.get(t)})},e}(),kc=function(){function e(){}return e.of=function(t,n,i,a,s){var l=new e;return l.bindings=t,l.middleware=n,l.deactivations=a,l.activations=i,l.moduleActivationStore=s,l},e}();function jc(e){return typeof e=="object"&&e!==null&&"clone"in e&&typeof e.clone=="function"}var qt=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(Rn);if(n==null)throw new Error(Rn);var i=this._map.get(t);i!==void 0?i.push(n):this._map.set(t,[n])},e.prototype.get=function(t){if(t==null)throw new Error(Rn);var n=this._map.get(t);if(n!==void 0)return n;throw new Error(ga)},e.prototype.remove=function(t){if(t==null)throw new Error(Rn);if(!this._map.delete(t))throw new Error(ga)},e.prototype.removeIntersection=function(t){var n=this;this.traverse(function(i,a){var s=t.hasKey(i)?t.get(i):void 0;if(s!==void 0){var l=a.filter(function(d){return!s.some(function(m){return d===m})});n._setValue(i,l)}})},e.prototype.removeByCondition=function(t){var n=this,i=[];return this._map.forEach(function(a,s){for(var l=[],d=0,m=a;d<m.length;d++){var g=m[d],T=t(g);T?i.push(g):l.push(g)}n._setValue(s,l)}),i},e.prototype.hasKey=function(t){if(t==null)throw new Error(Rn);return this._map.has(t)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(n,i){n.forEach(function(a){return t.add(i,jc(a)?a.clone():a)})}),t},e.prototype.traverse=function(t){this._map.forEach(function(n,i){t(i,n)})},e.prototype._setValue=function(t,n){n.length>0?this._map.set(t,n):this._map.delete(t)},e}(),Lc=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,i){this._getModuleActivationHandlers(t).onDeactivations.add(n,i)},e.prototype.addActivation=function(t,n,i){this._getModuleActivationHandlers(t).onActivations.add(n,i)},e.prototype.clone=function(){var t=new e;return this._map.forEach(function(n,i){t._map.set(i,{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 qt,onDeactivations:new qt};return t},e}(),vr=function(){return vr=Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},vr.apply(this,arguments)},rt=function(e,t,n,i){function a(s){return s instanceof n?s:new n(function(l){l(s)})}return new(n||(n=Promise))(function(s,l){function d(T){try{g(i.next(T))}catch(E){l(E)}}function m(T){try{g(i.throw(T))}catch(E){l(E)}}function g(T){T.done?s(T.value):a(T.value).then(d,m)}g((i=i.apply(e,t||[])).next())})},it=function(e,t){var n={label:0,sent:function(){if(s[0]&1)throw s[1];return s[1]},trys:[],ops:[]},i,a,s,l=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return l.next=d(0),l.throw=d(1),l.return=d(2),typeof Symbol=="function"&&(l[Symbol.iterator]=function(){return this}),l;function d(g){return function(T){return m([g,T])}}function m(g){if(i)throw new TypeError("Generator is already executing.");for(;l&&(l=0,g[0]&&(n=0)),n;)try{if(i=1,a&&(s=g[0]&2?a.return:g[0]?a.throw||((s=a.return)&&s.call(a),0):a.next)&&!(s=s.call(a,g[1])).done)return s;switch(a=0,s&&(g=[g[0]&2,s.value]),g[0]){case 0:case 1:s=g;break;case 4:return n.label++,{value:g[1],done:!1};case 5:n.label++,a=g[1],g=[0];continue;case 7:g=n.ops.pop(),n.trys.pop();continue;default:if(s=n.trys,!(s=s.length>0&&s[s.length-1])&&(g[0]===6||g[0]===2)){n=0;continue}if(g[0]===3&&(!s||g[1]>s[0]&&g[1]<s[3])){n.label=g[1];break}if(g[0]===6&&n.label<s[1]){n.label=s[1],s=g;break}if(s&&n.label<s[2]){n.label=s[2],n.ops.push(g);break}s[2]&&n.ops.pop(),n.trys.pop();continue}g=t.call(e,n)}catch(T){g=[6,T],a=0}finally{i=s=0}if(g[0]&5)throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}},Fc=function(e,t,n){if(n||arguments.length===2)for(var i=0,a=t.length,s;i<a;i++)(s||!(i in t))&&(s||(s=Array.prototype.slice.call(t,0,i)),s[i]=t[i]);return e.concat(s||Array.prototype.slice.call(t))},Bc=function(){function e(t){var n=t||{};if(typeof n!="object")throw new Error("".concat(Ru));if(n.defaultScope===void 0)n.defaultScope=Se.Transient;else if(n.defaultScope!==Se.Singleton&&n.defaultScope!==Se.Transient&&n.defaultScope!==Se.Request)throw new Error("".concat(Mu));if(n.autoBindInjectable===void 0)n.autoBindInjectable=!1;else if(typeof n.autoBindInjectable!="boolean")throw new Error("".concat(ku));if(n.skipBaseClassChecks===void 0)n.skipBaseClassChecks=!1;else if(typeof n.skipBaseClassChecks!="boolean")throw new Error("".concat(ju));this.options={autoBindInjectable:n.autoBindInjectable,defaultScope:n.defaultScope,skipBaseClassChecks:n.skipBaseClassChecks},this.id=Nn(),this._bindingDictionary=new qt,this._snapshots=[],this._middleware=null,this._activations=new qt,this._deactivations=new qt,this.parent=null,this._metadataReader=new Wu,this._moduleActivationStore=new Lc}return e.merge=function(t,n){for(var i=[],a=2;a<arguments.length;a++)i[a-2]=arguments[a];var s=new e,l=Fc([t,n],i,!0).map(function(g){return dr(g)}),d=dr(s);function m(g,T){g.traverse(function(E,L){L.forEach(function(z){T.add(z.serviceIdentifier,z.clone())})})}return l.forEach(function(g){m(g,d)}),s},e.prototype.load=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var i=this._getContainerModuleHelpersFactory(),a=0,s=t;a<s.length;a++){var l=s[a],d=i(l.id);l.registry(d.bindFunction,d.unbindFunction,d.isboundFunction,d.rebindFunction,d.unbindAsyncFunction,d.onActivationFunction,d.onDeactivationFunction)}},e.prototype.loadAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rt(this,void 0,void 0,function(){var i,a,s,l,d;return it(this,function(m){switch(m.label){case 0:i=this._getContainerModuleHelpersFactory(),a=0,s=t,m.label=1;case 1:return a<s.length?(l=s[a],d=i(l.id),[4,l.registry(d.bindFunction,d.unbindFunction,d.isboundFunction,d.rebindFunction,d.unbindAsyncFunction,d.onActivationFunction,d.onDeactivationFunction)]):[3,4];case 2:m.sent(),m.label=3;case 3:return a++,[3,1];case 4:return[2]}})})},e.prototype.unload=function(){for(var t=this,n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];n.forEach(function(a){var s=t._removeModuleBindings(a.id);t._deactivateSingletons(s),t._removeModuleHandlers(a.id)})},e.prototype.unloadAsync=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];return rt(this,void 0,void 0,function(){var i,a,s,l;return it(this,function(d){switch(d.label){case 0:i=0,a=t,d.label=1;case 1:return i<a.length?(s=a[i],l=this._removeModuleBindings(s.id),[4,this._deactivateSingletonsAsync(l)]):[3,4];case 2:d.sent(),this._removeModuleHandlers(s.id),d.label=3;case 3:return i++,[3,1];case 4:return[2]}})})},e.prototype.bind=function(t){var n=this.options.defaultScope||Se.Transient,i=new mu(t,n);return this._bindingDictionary.add(t,i),new Mc(i)},e.prototype.rebind=function(t){return this.unbind(t),this.bind(t)},e.prototype.rebindAsync=function(t){return rt(this,void 0,void 0,function(){return it(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 rt(this,void 0,void 0,function(){var n;return it(this,function(i){switch(i.label){case 0:return this._bindingDictionary.hasKey(t)?(n=this._bindingDictionary.get(t),[4,this._deactivateSingletonsAsync(n)]):[3,2];case 1:i.sent(),i.label=2;case 2:return this._removeServiceFromDictionary(t),[2]}})})},e.prototype.unbindAll=function(){var t=this;this._bindingDictionary.traverse(function(n,i){t._deactivateSingletons(i)}),this._bindingDictionary=new qt},e.prototype.unbindAllAsync=function(){return rt(this,void 0,void 0,function(){var t,n=this;return it(this,function(i){switch(i.label){case 0:return t=[],this._bindingDictionary.traverse(function(a,s){t.push(n._deactivateSingletonsAsync(s))}),[4,Promise.all(t)];case 1:return i.sent(),this._bindingDictionary=new qt,[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,Ge,n)},e.prototype.isBoundTagged=function(t,n,i){var a=!1;if(this._bindingDictionary.hasKey(t)){var s=this._bindingDictionary.get(t),l=ic(this,t,n,i);a=s.some(function(d){return d.constraint(l)})}return!a&&this.parent&&(a=this.parent.isBoundTagged(t,n,i)),a},e.prototype.snapshot=function(){this._snapshots.push(kc.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(Cu);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 i=this._middleware?this._middleware:this._planAndResolve();this._middleware=t.reduce(function(a,s){return s(a)},i)},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 rt(this,void 0,void 0,function(){var n;return it(this,function(i){return n=this._getNotAllArgs(t,!1),[2,this._get(n)]})})},e.prototype.getTagged=function(t,n,i){var a=this._getNotAllArgs(t,!1,n,i);return this._getButThrowIfAsync(a)},e.prototype.getTaggedAsync=function(t,n,i){return rt(this,void 0,void 0,function(){var a;return it(this,function(s){return a=this._getNotAllArgs(t,!1,n,i),[2,this._get(a)]})})},e.prototype.getNamed=function(t,n){return this.getTagged(t,Ge,n)},e.prototype.getNamedAsync=function(t,n){return this.getTaggedAsync(t,Ge,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,i){var a=this._getNotAllArgs(t,!0,n,i);return this._getButThrowIfAsync(a)},e.prototype.getAllTaggedAsync=function(t,n,i){var a=this._getNotAllArgs(t,!0,n,i);return this._getAll(a)},e.prototype.getAllNamed=function(t,n){return this.getAllTagged(t,Ge,n)},e.prototype.getAllNamedAsync=function(t,n){return this.getAllTaggedAsync(t,Ge,n)},e.prototype.resolve=function(t){var n=this.isBound(t);n||this.bind(t).toSelf();var i=this.get(t);return n||this.unbind(t),i},e.prototype._preDestroy=function(t,n){var i,a;if(Reflect.hasMetadata(Ii,t)){var s=Reflect.getMetadata(Ii,t);return(a=(i=n)[s.value])===null||a===void 0?void 0:a.call(i)}},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 i=this,a=Object.getPrototypeOf(n).constructor;try{if(this._deactivations.hasKey(t.serviceIdentifier)){var s=this._deactivateContainer(n,this._deactivations.get(t.serviceIdentifier).values());if(Ke(s))return this._handleDeactivationError(s.then(function(){return i._propagateContainerDeactivationThenBindingAndPreDestroyAsync(t,n,a)}),a)}var l=this._propagateContainerDeactivationThenBindingAndPreDestroy(t,n,a);if(Ke(l))return this._handleDeactivationError(l,a)}catch(d){if(d instanceof Error)throw new Error(Ni(a.name,d.message))}},e.prototype._handleDeactivationError=function(t,n){return rt(this,void 0,void 0,function(){var i;return it(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(i=a.sent(),i instanceof Error)throw new Error(Ni(n.name,i.message));return[3,3];case 3:return[2]}})})},e.prototype._deactivateContainer=function(t,n){for(var i=this,a=n.next();a.value;){var s=a.value(t);if(Ke(s))return s.then(function(){return i._deactivateContainerAsync(t,n)});a=n.next()}},e.prototype._deactivateContainerAsync=function(t,n){return rt(this,void 0,void 0,function(){var i;return it(this,function(a){switch(a.label){case 0:i=n.next(),a.label=1;case 1:return i.value?[4,i.value(t)]:[3,3];case 2:return a.sent(),i=n.next(),[3,1];case 3:return[2]}})})},e.prototype._getContainerModuleHelpersFactory=function(){var t=this,n=function(T,E){T._binding.moduleId=E},i=function(T){return function(E){var L=t.bind(E);return n(L,T),L}},a=function(){return function(T){return t.unbind(T)}},s=function(){return function(T){return t.unbindAsync(T)}},l=function(){return function(T){return t.isBound(T)}},d=function(T){return function(E){var L=t.rebind(E);return n(L,T),L}},m=function(T){return function(E,L){t._moduleActivationStore.addActivation(T,E,L),t.onActivation(E,L)}},g=function(T){return function(E,L){t._moduleActivationStore.addDeactivation(T,E,L),t.onDeactivation(E,L)}};return function(T){return{bindFunction:i(T),isboundFunction:l(),onActivationFunction:m(T),onDeactivationFunction:g(T),rebindFunction:d(T),unbindFunction:a(),unbindAsyncFunction:s()}}},e.prototype._getAll=function(t){return Promise.all(this._get(t))},e.prototype._get=function(t){var n=vr(vr({},t),{contextInterceptor:function(a){return a},targetType:In.Variable});if(this._middleware){var i=this._middleware(n);if(i==null)throw new Error(Pu);return i}return this._planAndResolve()(n)},e.prototype._getButThrowIfAsync=function(t){var n=this._get(t);if(Ta(n))throw new Error(Du(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,i,a){var s={avoidConstraints:!1,isMultiInject:n,serviceIdentifier:t,key:i,value:a};return s},e.prototype._planAndResolve=function(){var t=this;return function(n){var i=rc(t._metadataReader,t,n.isMultiInject,n.targetType,n.serviceIdentifier,n.key,n.value,n.avoidConstraints);i=n.contextInterceptor(i);var a=Nc(i);return a}},e.prototype._deactivateIfSingleton=function(t){var n=this;if(t.activated)return Ke(t.cache)?t.cache.then(function(i){return n._deactivate(t,i)}):this._deactivate(t,t.cache)},e.prototype._deactivateSingletons=function(t){for(var n=0,i=t;n<i.length;n++){var a=i[n],s=this._deactivateIfSingleton(a);if(Ke(s))throw new Error(Lu)}},e.prototype._deactivateSingletonsAsync=function(t){return rt(this,void 0,void 0,function(){var n=this;return it(this,function(i){switch(i.label){case 0:return[4,Promise.all(t.map(function(a){return n._deactivateIfSingleton(a)}))];case 1:return i.sent(),[2]}})})},e.prototype._propagateContainerDeactivationThenBindingAndPreDestroy=function(t,n,i){return this.parent?this._deactivate.bind(this.parent)(t,n):this._bindingDeactivationAndPreDestroy(t,n,i)},e.prototype._propagateContainerDeactivationThenBindingAndPreDestroyAsync=function(t,n,i){return rt(this,void 0,void 0,function(){return it(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,i)];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("".concat(wu," ").concat(Mn(t)))}},e.prototype._bindingDeactivationAndPreDestroy=function(t,n,i){var a=this;if(typeof t.onDeactivation=="function"){var s=t.onDeactivation(n);if(Ke(s))return s.then(function(){return a._preDestroy(i,n)})}return this._preDestroy(i,n)},e.prototype._bindingDeactivationAndPreDestroyAsync=function(t,n,i){return rt(this,void 0,void 0,function(){return it(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(i,n)];case 3:return a.sent(),[2]}})})},e}();function $c(e){for(var t=new Set,n=0,i=e;n<i.length;n++){var a=i[n];if(t.has(a))return a;t.add(a)}}function Vc(e){return e.prototype!==void 0}function Kc(e){if(e!==void 0)throw new Error(ya)}function Fa(e,t,n,i){Kc(t),Ba(la,e,n.toString(),i)}function Wc(e,t,n){if(Vc(e))throw new Error(ya);Ba(fa,e.constructor,t,n)}function Uc(e){var t=[];if(Array.isArray(e)){t=e;var n=$c(t.map(function(i){return i.key}));if(n!==void 0)throw new Error("".concat(pa," ").concat(n.toString()))}else t=[e];return t}function Ba(e,t,n,i){var a=Uc(i),s={};Reflect.hasOwnMetadata(e,t)&&(s=Reflect.getMetadata(e,t));var l=s[n];if(l===void 0)l=[];else for(var d=function(E){if(a.some(function(L){return L.key===E.key}))throw new Error("".concat(pa," ").concat(E.key.toString()))},m=0,g=l;m<g.length;m++){var T=g[m];d(T)}l.push.apply(l,a),s[n]=l,Reflect.defineMetadata(e,s,t)}function ji(e){return function(t,n,i){typeof i=="number"?Fa(t,n,i,e):Wc(t,n,e)}}function Re(){return function(e){if(Reflect.hasOwnMetadata(Di,e))throw new Error(bu);var t=Reflect.getMetadata(gu,e)||[];return Reflect.defineMetadata(Di,t,e),e}}function Li(e){return ji(new pt(Ge,e))}function qc(e){return function(t){return function(n,i,a){if(t===void 0){var s=typeof n=="function"?n.name:n.constructor.name;throw new Error(Ou(s))}return ji(new pt(e,t))(n,i,a)}}}var Oe=qc(ur);function Hc(){return ji(new pt(Ti,!0))}function zc(){return function(e,t,n){var i=new pt(sr,!0);Fa(e,t,n,i)}}var Gc=Object.defineProperty,Yc=Object.getOwnPropertyDescriptor,Qc=(e,t,n,i)=>{for(var a=i>1?void 0:i?Yc(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&Gc(t,n,a),a};let Fi=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 i=t==null?void 0:t.configType;if(t){const a=this.container.getNamed("WikiConfig",i);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.")}};Fi=Qc([Re()],Fi);var Jc=Object.defineProperty,Xc=Object.getOwnPropertyDescriptor,Zc=(e,t,n,i)=>{for(var a=i>1?void 0:i?Xc(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&Jc(t,n,a),a};let Bi=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};Bi=Zc([Re()],Bi);var el=Object.defineProperty,tl=Object.getOwnPropertyDescriptor,nl=(e,t,n,i)=>{for(var a=i>1?void 0:i?tl(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&el(t,n,a),a},rl=(e,t)=>(n,i)=>t(n,i,e);let $i=class{constructor(e){this.cristalApp=e}get(e){const t=e||this.cristalApp.getWikiConfig().getType();try{return this.cristalApp.getContainer().getNamed("AuthenticationManager",t)}catch(n){this.cristalApp.getLogger("authentication.api").warn(`Couldn't resolve AuthenticationManager for type=[${t}]`,n);return}}};$i=nl([Re(),rl(0,Oe("CristalApp"))],$i);let il=class{constructor(t){t.bind("AuthenticationManagerProvider").to($i).inSingletonScope()}};var yr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ol(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $a={exports:{}};(function(e,t){(function(n,i){e.exports=i()})(yr,function(){var n=function(r,o){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(u,c){u.__proto__=c}||function(u,c){for(var f in c)Object.prototype.hasOwnProperty.call(c,f)&&(u[f]=c[f])})(r,o)},i=function(){return(i=Object.assign||function(r){for(var o,u=1,c=arguments.length;u<c;u++)for(var f in o=arguments[u])Object.prototype.hasOwnProperty.call(o,f)&&(r[f]=o[f]);return r}).apply(this,arguments)};function a(r,o,u){for(var c,f=0,h=o.length;f<h;f++)!c&&f in o||((c=c||Array.prototype.slice.call(o,0,f))[f]=o[f]);return r.concat(c||Array.prototype.slice.call(o))}var s=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:yr,l=Object.keys,d=Array.isArray;function m(r,o){return typeof o!="object"||l(o).forEach(function(u){r[u]=o[u]}),r}typeof Promise>"u"||s.Promise||(s.Promise=Promise);var g=Object.getPrototypeOf,T={}.hasOwnProperty;function E(r,o){return T.call(r,o)}function L(r,o){typeof o=="function"&&(o=o(g(r))),(typeof Reflect>"u"?l:Reflect.ownKeys)(o).forEach(function(u){X(r,u,o[u])})}var z=Object.defineProperty;function X(r,o,u,c){z(r,o,m(u&&E(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},c))}function se(r){return{from:function(o){return r.prototype=Object.create(o.prototype),X(r.prototype,"constructor",r),{extend:L.bind(null,r.prototype)}}}}var qe=Object.getOwnPropertyDescriptor,Xe=[].slice;function He(r,o,u){return Xe.call(r,o,u)}function gt(r,o){return o(r)}function ne(r){if(!r)throw new Error("Assertion Failed")}function Fe(r){s.setImmediate?setImmediate(r):setTimeout(r,0)}function Be(r,o){if(typeof o=="string"&&E(r,o))return r[o];if(!o)return r;if(typeof o!="string"){for(var u=[],c=0,f=o.length;c<f;++c){var h=Be(r,o[c]);u.push(h)}return u}var p=o.indexOf(".");if(p!==-1){var v=r[o.substr(0,p)];return v==null?void 0:Be(v,o.substr(p+1))}}function Pe(r,o,u){if(r&&o!==void 0&&!("isFrozen"in Object&&Object.isFrozen(r)))if(typeof o!="string"&&"length"in o){ne(typeof u!="string"&&"length"in u);for(var c=0,f=o.length;c<f;++c)Pe(r,o[c],u[c])}else{var h,p,v=o.indexOf(".");v!==-1?(h=o.substr(0,v),(p=o.substr(v+1))===""?u===void 0?d(r)&&!isNaN(parseInt(h))?r.splice(h,1):delete r[h]:r[h]=u:Pe(v=!(v=r[h])||!E(r,h)?r[h]={}:v,p,u)):u===void 0?d(r)&&!isNaN(parseInt(o))?r.splice(o,1):delete r[o]:r[o]=u}}function zr(r){var o,u={};for(o in r)E(r,o)&&(u[o]=r[o]);return u}var Ro=[].concat;function Gr(r){return Ro.apply([],r)}var Pt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Gr([8,16,32,64].map(function(r){return["Int","Uint","Float"].map(function(o){return o+r+"Array"})}))).filter(function(r){return s[r]}),Yr=new Set(Pt.map(function(r){return s[r]})),Zt=null;function Ot(r){return Zt=new WeakMap,r=function o(u){if(!u||typeof u!="object")return u;var c=Zt.get(u);if(c)return c;if(d(u)){c=[],Zt.set(u,c);for(var f=0,h=u.length;f<h;++f)c.push(o(u[f]))}else if(Yr.has(u.constructor))c=u;else{var p,v=g(u);for(p in c=v===Object.prototype?{}:Object.create(v),Zt.set(u,c),u)E(u,p)&&(c[p]=o(u[p]))}return c}(r),Zt=null,r}var Qr={}.toString;function en(r){return Qr.call(r).slice(8,-1)}var En=typeof Symbol<"u"?Symbol.iterator:"@@iterator",Jr=typeof En=="symbol"?function(r){var o;return r!=null&&(o=r[En])&&o.apply(r)}:function(){return null};function vt(r,o){return o=r.indexOf(o),0<=o&&r.splice(o,1),0<=o}var xt={};function st(r){var o,u,c,f;if(arguments.length===1){if(d(r))return r.slice();if(this===xt&&typeof r=="string")return[r];if(f=Jr(r)){for(u=[];!(c=f.next()).done;)u.push(c.value);return u}if(r==null)return[r];if(typeof(o=r.length)!="number")return[r];for(u=new Array(o);o--;)u[o]=r[o];return u}for(o=arguments.length,u=new Array(o);o--;)u[o]=arguments[o];return u}var Sn=typeof Symbol<"u"?function(r){return r[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},rn=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],ut=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(rn),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 Ze(r,o){this.name=r,this.message=o}function Xr(r,o){return r+". Errors: "+Object.keys(o).map(function(u){return o[u].toString()}).filter(function(u,c,f){return f.indexOf(u)===c}).join(`
|
|
7
|
-
`)}function me(r,o,u,c){this.failures=o,this.failedKeys=c,this.successCount=u,this.message=Xr(r,o)}function kt(r,o){this.name="BulkError",this.failures=Object.keys(o).map(function(u){return o[u]}),this.failuresByPos=o,this.message=Xr(r,this.failures)}se(Ze).from(Error).extend({toString:function(){return this.name+": "+this.message}}),se(me).from(Ze),se(kt).from(Ze);var Gn=ut.reduce(function(r,o){return r[o]=o+"Error",r},{}),Zr=Ze,Q=ut.reduce(function(r,o){var u=o+"Error";function c(f,h){this.name=u,f?typeof f=="string"?(this.message="".concat(f).concat(h?`
|
|
8
|
-
`+h:""),this.inner=h||null):typeof f=="object"&&(this.message="".concat(f.name," ").concat(f.message),this.inner=f):(this.message=J[o]||u,this.inner=null)}return se(c).from(Zr),r[o]=c,r},{});Q.Syntax=SyntaxError,Q.Type=TypeError,Q.Range=RangeError;var et=rn.reduce(function(r,o){return r[o+"Error"]=Q[o],r},{}),tn=ut.reduce(function(r,o){return["Syntax","Type","Range"].indexOf(o)===-1&&(r[o+"Error"]=Q[o]),r},{});function ce(){}function jt(r){return r}function Mo(r,o){return r==null||r===jt?o:function(u){return o(r(u))}}function ft(r,o){return function(){r.apply(this,arguments),o.apply(this,arguments)}}function ei(r,o){return r===ce?o:function(){var u=r.apply(this,arguments);u!==void 0&&(arguments[0]=u);var c=this.onsuccess,f=this.onerror;this.onsuccess=null,this.onerror=null;var h=o.apply(this,arguments);return c&&(this.onsuccess=this.onsuccess?ft(c,this.onsuccess):c),f&&(this.onerror=this.onerror?ft(f,this.onerror):f),h!==void 0?h:u}}function ti(r,o){return r===ce?o:function(){r.apply(this,arguments);var u=this.onsuccess,c=this.onerror;this.onsuccess=this.onerror=null,o.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?ft(u,this.onsuccess):u),c&&(this.onerror=this.onerror?ft(c,this.onerror):c)}}function ni(r,o){return r===ce?o:function(u){var c=r.apply(this,arguments);m(u,c);var f=this.onsuccess,h=this.onerror;return this.onsuccess=null,this.onerror=null,u=o.apply(this,arguments),f&&(this.onsuccess=this.onsuccess?ft(f,this.onsuccess):f),h&&(this.onerror=this.onerror?ft(h,this.onerror):h),c===void 0?u===void 0?void 0:u:m(c,u)}}function ri(r,o){return r===ce?o:function(){return o.apply(this,arguments)!==!1&&r.apply(this,arguments)}}function On(r,o){return r===ce?o:function(){var u=r.apply(this,arguments);if(u&&typeof u.then=="function"){for(var c=this,f=arguments.length,h=new Array(f);f--;)h[f]=arguments[f];return u.then(function(){return o.apply(c,h)})}return o.apply(this,arguments)}}tn.ModifyError=me,tn.DexieError=Ze,tn.BulkError=kt;var ze=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ii(r){ze=r}var nn={},oi=100,Pt=typeof Promise>"u"?[]:function(){var r=Promise.resolve();if(typeof crypto>"u"||!crypto.subtle)return[r,g(r),r];var o=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[o,g(o),r]}(),rn=Pt[0],ut=Pt[1],Pt=Pt[2],ut=ut&&ut.then,ht=rn&&rn.constructor,Yn=!!Pt,on=function(r,o){be.push([r,o]),Lt&&(queueMicrotask(tt),Lt=!1)},Qn=!0,Lt=!0,P=[],I=[],j=jt,K={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ce,pgp:!1,env:{},finalize:ce},F=K,be=[],pe=0,ee=[];function N(r){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var o=this._PSD=F;if(typeof r!="function"){if(r!==nn)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(this._state===!1&&Y(this,this._value))}this._state=null,this._value=null,++o.ref,function u(c,f){try{f(function(h){if(c._state===null){if(h===c)throw new TypeError("A promise cannot be resolved with itself.");var p=c._lib&&At();h&&typeof h.then=="function"?u(c,function(v,w){h instanceof N?h._then(v,w):h.then(v,w)}):(c._state=!0,c._value=h,re(c)),p&&Ft()}},Y.bind(null,c))}catch(h){Y(c,h)}}(this,r)}var H={get:function(){var r=F,o=ci;function u(c,f){var h=this,p=!r.global&&(r!==F||o!==ci),v=p&&!$t(),w=new N(function(b,x){de(h,new G(Vs(c,r,p,v),Vs(f,r,p,v),b,x,r))});return this._consoleTask&&(w._consoleTask=this._consoleTask),w}return u.prototype=nn,u},set:function(r){X(this,"then",r&&r.prototype===nn?H:{get:function(){return r},set:H.set})}};function G(r,o,u,c,f){this.onFulfilled=typeof r=="function"?r:null,this.onRejected=typeof o=="function"?o:null,this.resolve=u,this.reject=c,this.psd=f}function Y(r,o){var u,c;I.push(o),r._state===null&&(u=r._lib&&At(),o=j(o),r._state=!1,r._value=o,c=r,P.some(function(f){return f._value===c._value})||P.push(c),re(r),u&&Ft())}function re(r){var o=r._listeners;r._listeners=[];for(var u=0,c=o.length;u<c;++u)de(r,o[u]);var f=r._PSD;--f.ref||f.finalize(),pe===0&&(++pe,on(function(){--pe==0&&Jn()},[]))}function de(r,o){if(r._state!==null){var u=r._state?o.onFulfilled:o.onRejected;if(u===null)return(r._state?o.resolve:o.reject)(r._value);++o.psd.ref,++pe,on(we,[u,r,o])}else r._listeners.push(o)}function we(r,o,u){try{var c,f=o._value;!o._state&&I.length&&(I=[]),c=ze&&o._consoleTask?o._consoleTask.run(function(){return r(f)}):r(f),o._state||I.indexOf(f)!==-1||function(h){for(var p=P.length;p;)if(P[--p]._value===h._value)return P.splice(p,1)}(o),u.resolve(c)}catch(h){u.reject(h)}finally{--pe==0&&Jn(),--u.psd.ref||u.psd.finalize()}}function tt(){an(K,function(){At()&&Ft()})}function At(){var r=Qn;return Lt=Qn=!1,r}function Ft(){var r,o,u;do for(;0<be.length;)for(r=be,be=[],u=r.length,o=0;o<u;++o){var c=r[o];c[0].apply(null,c[1])}while(0<be.length);Lt=Qn=!0}function Jn(){var r=P;P=[],r.forEach(function(c){c._PSD.onunhandled.call(null,c._value,c)});for(var o=ee.slice(0),u=o.length;u;)o[--u]()}function ai(r){return new N(nn,!1,r)}function _e(r,o){var u=F;return function(){var c=At(),f=F;try{return Vt(u,!0),r.apply(this,arguments)}catch(h){o&&o(h)}finally{Vt(f,!1),c&&Ft()}}}L(N.prototype,{then:H,_then:function(r,o){de(this,new G(null,null,r,o,F))},catch:function(r){if(arguments.length===1)return this.then(null,r);var o=r,u=arguments[1];return typeof o=="function"?this.then(null,function(c){return(c instanceof o?u:ai)(c)}):this.then(null,function(c){return(c&&c.name===o?u:ai)(c)})},finally:function(r){return this.then(function(o){return N.resolve(r()).then(function(){return o})},function(o){return N.resolve(r()).then(function(){return ai(o)})})},timeout:function(r,o){var u=this;return r<1/0?new N(function(c,f){var h=setTimeout(function(){return f(new Q.Timeout(o))},r);u.then(c,f).finally(clearTimeout.bind(null,h))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&X(N.prototype,Symbol.toStringTag,"Dexie.Promise"),K.env=$s(),L(N,{all:function(){var r=st.apply(null,arguments).map(li);return new N(function(o,u){r.length===0&&o([]);var c=r.length;r.forEach(function(f,h){return N.resolve(f).then(function(p){r[h]=p,--c||o(r)},u)})})},resolve:function(r){return r instanceof N?r:r&&typeof r.then=="function"?new N(function(o,u){r.then(o,u)}):new N(nn,!0,r)},reject:ai,race:function(){var r=st.apply(null,arguments).map(li);return new N(function(o,u){r.map(function(c){return N.resolve(c).then(o,u)})})},PSD:{get:function(){return F},set:function(r){return F=r}},totalEchoes:{get:function(){return ci}},newPSD:Bt,usePSD:an,scheduler:{get:function(){return on},set:function(r){on=r}},rejectionMapper:{get:function(){return j},set:function(r){j=r}},follow:function(r,o){return new N(function(u,c){return Bt(function(f,h){var p=F;p.unhandleds=[],p.onunhandled=h,p.finalize=ft(function(){var v,w=this;v=function(){w.unhandleds.length===0?f():h(w.unhandleds[0])},ee.push(function b(){v(),ee.splice(ee.indexOf(b),1)}),++pe,on(function(){--pe==0&&Jn()},[])},p.finalize),r()},o,u,c)})}}),ht&&(ht.allSettled&&X(N,"allSettled",function(){var r=st.apply(null,arguments).map(li);return new N(function(o){r.length===0&&o([]);var u=r.length,c=new Array(u);r.forEach(function(f,h){return N.resolve(f).then(function(p){return c[h]={status:"fulfilled",value:p}},function(p){return c[h]={status:"rejected",reason:p}}).then(function(){return--u||o(c)})})})}),ht.any&&typeof AggregateError<"u"&&X(N,"any",function(){var r=st.apply(null,arguments).map(li);return new N(function(o,u){r.length===0&&u(new AggregateError([]));var c=r.length,f=new Array(c);r.forEach(function(h,p){return N.resolve(h).then(function(v){return o(v)},function(v){f[p]=v,--c||u(new AggregateError(f))})})})}));var De={awaits:0,echoes:0,id:0},ld=0,si=[],ui=0,ci=0,fd=0;function Bt(r,o,u,c){var f=F,h=Object.create(f);return h.parent=f,h.ref=0,h.global=!1,h.id=++fd,K.env,h.env=Yn?{Promise:N,PromiseProp:{value:N,configurable:!0,writable:!0},all:N.all,race:N.race,allSettled:N.allSettled,any:N.any,resolve:N.resolve,reject:N.reject}:{},o&&m(h,o),++f.ref,h.finalize=function(){--this.parent.ref||this.parent.finalize()},c=an(h,r,u,c),h.ref===0&&h.finalize(),c}function xn(){return De.id||(De.id=++ld),++De.awaits,De.echoes+=oi,De.id}function $t(){return!!De.awaits&&(--De.awaits==0&&(De.id=0),De.echoes=De.awaits*oi,!0)}function li(r){return De.echoes&&r&&r.constructor===ht?(xn(),r.then(function(o){return $t(),o},function(o){return $t(),xe(o)})):r}function hd(){var r=si[si.length-1];si.pop(),Vt(r,!1)}function Vt(r,o){var u,c=F;(o?!De.echoes||ui++&&r===F:!ui||--ui&&r===F)||queueMicrotask(o?(function(f){++ci,De.echoes&&--De.echoes!=0||(De.echoes=De.awaits=De.id=0),si.push(F),Vt(f,!0)}).bind(null,r):hd),r!==F&&(F=r,c===K&&(K.env=$s()),Yn&&(u=K.env.Promise,o=r.env,(c.global||r.global)&&(Object.defineProperty(s,"Promise",o.PromiseProp),u.all=o.all,u.race=o.race,u.resolve=o.resolve,u.reject=o.reject,o.allSettled&&(u.allSettled=o.allSettled),o.any&&(u.any=o.any))))}function $s(){var r=s.Promise;return Yn?{Promise:r,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:r.all,race:r.race,allSettled:r.allSettled,any:r.any,resolve:r.resolve,reject:r.reject}:{}}function an(r,o,u,c,f){var h=F;try{return Vt(r,!0),o(u,c,f)}finally{Vt(h,!1)}}function Vs(r,o,u,c){return typeof r!="function"?r:function(){var f=F;u&&xn(),Vt(o,!0);try{return r.apply(this,arguments)}finally{Vt(f,!1),c&&queueMicrotask($t)}}}function ko(r){Promise===ht&&De.echoes===0?ui===0?r():enqueueNativeMicroTask(r):setTimeout(r,0)}(""+ut).indexOf("[native code]")===-1&&(xn=$t=ce);var xe=N.reject,sn="",Ct="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ks="String expected.",An=[],fi="__dbnames",jo="readonly",Lo="readwrite";function un(r,o){return r?o?function(){return r.apply(this,arguments)&&o.apply(this,arguments)}:r:o}var Ws={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function hi(r){return typeof r!="string"||/\./.test(r)?function(o){return o}:function(o){return o[r]===void 0&&r in o&&delete(o=Ot(o))[r],o}}function Us(){throw Q.Type()}function le(r,o){try{var u=qs(r),c=qs(o);if(u!==c)return u==="Array"?1:c==="Array"?-1:u==="binary"?1:c==="binary"?-1:u==="string"?1:c==="string"?-1:u==="Date"?1:c!=="Date"?NaN:-1;switch(u){case"number":case"Date":case"string":return o<r?1:r<o?-1:0;case"binary":return function(f,h){for(var p=f.length,v=h.length,w=p<v?p:v,b=0;b<w;++b)if(f[b]!==h[b])return f[b]<h[b]?-1:1;return p===v?0:p<v?-1:1}(Hs(r),Hs(o));case"Array":return function(f,h){for(var p=f.length,v=h.length,w=p<v?p:v,b=0;b<w;++b){var x=le(f[b],h[b]);if(x!==0)return x}return p===v?0:p<v?-1:1}(r,o)}}catch{}return NaN}function qs(r){var o=typeof r;return o!="object"?o:ArrayBuffer.isView(r)?"binary":(r=en(r),r==="ArrayBuffer"?"binary":r)}function Hs(r){return r instanceof Uint8Array?r:ArrayBuffer.isView(r)?new Uint8Array(r.buffer,r.byteOffset,r.byteLength):new Uint8Array(r)}var zs=(ve.prototype._trans=function(r,o,u){var c=this._tx||F.trans,f=this.name,h=ze&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(r==="readonly"?"read":"write"," ").concat(this.name));function p(b,x,y){if(!y.schema[f])throw new Q.NotFound("Table "+f+" not part of transaction");return o(y.idbtrans,y)}var v=At();try{var w=c&&c.db._novip===this.db._novip?c===F.trans?c._promise(r,p,u):Bt(function(){return c._promise(r,p,u)},{trans:c,transless:F.transless||F}):function b(x,y,A,_){if(x.idbdb&&(x._state.openComplete||F.letThrough||x._vip)){var O=x._createTransaction(y,A,x._dbSchema);try{O.create(),x._state.PR1398_maxLoop=3}catch(C){return C.name===Gn.InvalidState&&x.isOpen()&&0<--x._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),x.close({disableAutoOpen:!1}),x.open().then(function(){return b(x,y,A,_)})):xe(C)}return O._promise(y,function(C,S){return Bt(function(){return F.trans=O,_(C,S,O)})}).then(function(C){if(y==="readwrite")try{O.idbtrans.commit()}catch{}return y==="readonly"?C:O._completion.then(function(){return C})})}if(x._state.openComplete)return xe(new Q.DatabaseClosed(x._state.dbOpenError));if(!x._state.isBeingOpened){if(!x._state.autoOpen)return xe(new Q.DatabaseClosed);x.open().catch(ce)}return x._state.dbReadyPromise.then(function(){return b(x,y,A,_)})}(this.db,r,[this.name],p);return h&&(w._consoleTask=h,w=w.catch(function(b){return console.trace(b),xe(b)})),w}finally{v&&Ft()}},ve.prototype.get=function(r,o){var u=this;return r&&r.constructor===Object?this.where(r).first(o):r==null?xe(new Q.Type("Invalid argument to Table.get()")):this._trans("readonly",function(c){return u.core.get({trans:c,key:r}).then(function(f){return u.hook.reading.fire(f)})}).then(o)},ve.prototype.where=function(r){if(typeof r=="string")return new this.db.WhereClause(this,r);if(d(r))return new this.db.WhereClause(this,"[".concat(r.join("+"),"]"));var o=l(r);if(o.length===1)return this.where(o[0]).equals(r[o[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(w){if(w.compound&&o.every(function(x){return 0<=w.keyPath.indexOf(x)})){for(var b=0;b<o.length;++b)if(o.indexOf(w.keyPath[b])===-1)return!1;return!0}return!1}).sort(function(w,b){return w.keyPath.length-b.keyPath.length})[0];if(u&&this.db._maxKey!==sn){var p=u.keyPath.slice(0,o.length);return this.where(p).equals(p.map(function(b){return r[b]}))}!u&&ze&&console.warn("The query ".concat(JSON.stringify(r)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(o.join("+"),"]"));var c=this.schema.idxByName,f=this.db._deps.indexedDB;function h(w,b){return f.cmp(w,b)===0}var v=o.reduce(function(A,b){var x=A[0],y=A[1],A=c[b],_=r[b];return[x||A,x||!A?un(y,A&&A.multi?function(O){return O=Be(O,b),d(O)&&O.some(function(C){return h(_,C)})}:function(O){return h(_,Be(O,b))}):y]},[null,null]),p=v[0],v=v[1];return p?this.where(p.name).equals(r[p.keyPath]).filter(v):u?this.filter(v):this.where(o).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,d(r)?"[".concat(r.join("+"),"]"):r))},ve.prototype.reverse=function(){return this.toCollection().reverse()},ve.prototype.mapToClass=function(r){var o,u=this.db,c=this.name;function f(){return o!==null&&o.apply(this,arguments)||this}(this.schema.mappedClass=r).prototype instanceof Us&&(function(w,b){if(typeof b!="function"&&b!==null)throw new TypeError("Class extends value "+String(b)+" is not a constructor or null");function x(){this.constructor=w}n(w,b),w.prototype=b===null?Object.create(b):(x.prototype=b.prototype,new x)}(f,o=r),Object.defineProperty(f.prototype,"db",{get:function(){return u},enumerable:!1,configurable:!0}),f.prototype.table=function(){return c},r=f);for(var h=new Set,p=r.prototype;p;p=g(p))Object.getOwnPropertyNames(p).forEach(function(w){return h.add(w)});function v(w){if(!w)return w;var b,x=Object.create(r.prototype);for(b in w)if(!h.has(b))try{x[b]=w[b]}catch{}return x}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){m(this,r)})},ve.prototype.add=function(r,o){var u=this,c=this.schema.primKey,f=c.auto,h=c.keyPath,p=r;return h&&f&&(p=hi(h)(r)),this._trans("readwrite",function(v){return u.core.mutate({trans:v,type:"add",keys:o!=null?[o]:null,values:[p]})}).then(function(v){return v.numFailures?N.reject(v.failures[0]):v.lastResult}).then(function(v){if(h)try{Pe(r,h,v)}catch{}return v})},ve.prototype.update=function(r,o){return typeof r!="object"||d(r)?this.where(":id").equals(r).modify(o):(r=Be(r,this.schema.primKey.keyPath),r===void 0?xe(new Q.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(r).modify(o))},ve.prototype.put=function(r,o){var u=this,c=this.schema.primKey,f=c.auto,h=c.keyPath,p=r;return h&&f&&(p=hi(h)(r)),this._trans("readwrite",function(v){return u.core.mutate({trans:v,type:"put",values:[p],keys:o!=null?[o]:null})}).then(function(v){return v.numFailures?N.reject(v.failures[0]):v.lastResult}).then(function(v){if(h)try{Pe(r,h,v)}catch{}return v})},ve.prototype.delete=function(r){var o=this;return this._trans("readwrite",function(u){return o.core.mutate({trans:u,type:"delete",keys:[r]})}).then(function(u){return u.numFailures?N.reject(u.failures[0]):void 0})},ve.prototype.clear=function(){var r=this;return this._trans("readwrite",function(o){return r.core.mutate({trans:o,type:"deleteRange",range:Ws})}).then(function(o){return o.numFailures?N.reject(o.failures[0]):void 0})},ve.prototype.bulkGet=function(r){var o=this;return this._trans("readonly",function(u){return o.core.getMany({keys:r,trans:u}).then(function(c){return c.map(function(f){return o.hook.reading.fire(f)})})})},ve.prototype.bulkAdd=function(r,o,u){var c=this,f=Array.isArray(o)?o:void 0,h=(u=u||(f?void 0:o))?u.allKeys:void 0;return this._trans("readwrite",function(p){var b=c.schema.primKey,v=b.auto,b=b.keyPath;if(b&&f)throw new Q.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(f&&f.length!==r.length)throw new Q.InvalidArgument("Arguments objects and keys must have the same length");var w=r.length,b=b&&v?r.map(hi(b)):r;return c.core.mutate({trans:p,type:"add",keys:f,values:b,wantResults:h}).then(function(O){var y=O.numFailures,A=O.results,_=O.lastResult,O=O.failures;if(y===0)return h?A:_;throw new kt("".concat(c.name,".bulkAdd(): ").concat(y," of ").concat(w," operations failed"),O)})})},ve.prototype.bulkPut=function(r,o,u){var c=this,f=Array.isArray(o)?o:void 0,h=(u=u||(f?void 0:o))?u.allKeys:void 0;return this._trans("readwrite",function(p){var b=c.schema.primKey,v=b.auto,b=b.keyPath;if(b&&f)throw new Q.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(f&&f.length!==r.length)throw new Q.InvalidArgument("Arguments objects and keys must have the same length");var w=r.length,b=b&&v?r.map(hi(b)):r;return c.core.mutate({trans:p,type:"put",keys:f,values:b,wantResults:h}).then(function(O){var y=O.numFailures,A=O.results,_=O.lastResult,O=O.failures;if(y===0)return h?A:_;throw new kt("".concat(c.name,".bulkPut(): ").concat(y," of ").concat(w," operations failed"),O)})})},ve.prototype.bulkUpdate=function(r){var o=this,u=this.core,c=r.map(function(p){return p.key}),f=r.map(function(p){return p.changes}),h=[];return this._trans("readwrite",function(p){return u.getMany({trans:p,keys:c,cache:"clone"}).then(function(v){var w=[],b=[];r.forEach(function(y,A){var _=y.key,O=y.changes,C=v[A];if(C){for(var S=0,D=Object.keys(O);S<D.length;S++){var R=D[S],M=O[R];if(R===o.schema.primKey.keyPath){if(le(M,_)!==0)throw new Q.Constraint("Cannot update primary key in bulkUpdate()")}else Pe(C,R,M)}h.push(A),w.push(_),b.push(C)}});var x=w.length;return u.mutate({trans:p,type:"put",keys:w,values:b,updates:{keys:c,changeSpecs:f}}).then(function(y){var A=y.numFailures,_=y.failures;if(A===0)return x;for(var O=0,C=Object.keys(_);O<C.length;O++){var S,D=C[O],R=h[Number(D)];R!=null&&(S=_[D],delete _[D],_[R]=S)}throw new kt("".concat(o.name,".bulkUpdate(): ").concat(A," of ").concat(x," operations failed"),_)})})})},ve.prototype.bulkDelete=function(r){var o=this,u=r.length;return this._trans("readwrite",function(c){return o.core.mutate({trans:c,type:"delete",keys:r})}).then(function(p){var f=p.numFailures,h=p.lastResult,p=p.failures;if(f===0)return h;throw new kt("".concat(o.name,".bulkDelete(): ").concat(f," of ").concat(u," operations failed"),p)})},ve);function ve(){}function Xn(r){function o(p,v){if(v){for(var w=arguments.length,b=new Array(w-1);--w;)b[w-1]=arguments[w];return u[p].subscribe.apply(null,b),r}if(typeof p=="string")return u[p]}var u={};o.addEventType=h;for(var c=1,f=arguments.length;c<f;++c)h(arguments[c]);return o;function h(p,v,w){if(typeof p!="object"){var b;v=v||ri;var x={subscribers:[],fire:w=w||ce,subscribe:function(y){x.subscribers.indexOf(y)===-1&&(x.subscribers.push(y),x.fire=v(x.fire,y))},unsubscribe:function(y){x.subscribers=x.subscribers.filter(function(A){return A!==y}),x.fire=x.subscribers.reduce(v,w)}};return u[p]=o[p]=x}l(b=p).forEach(function(y){var A=b[y];if(d(A))h(y,b[y][0],b[y][1]);else{if(A!=="asap")throw new Q.InvalidArgument("Invalid event config");var _=h(y,jt,function(){for(var O=arguments.length,C=new Array(O);O--;)C[O]=arguments[O];_.subscribers.forEach(function(S){Fe(function(){S.apply(null,C)})})})}})}}function Zn(r,o){return se(o).from({prototype:r}),o}function Cn(r,o){return!(r.filter||r.algorithm||r.or)&&(o?r.justLimit:!r.replayFilter)}function Fo(r,o){r.filter=un(r.filter,o)}function Bo(r,o,u){var c=r.replayFilter;r.replayFilter=c?function(){return un(c(),o())}:o,r.justLimit=u&&!c}function di(r,o){if(r.isPrimKey)return o.primaryKey;var u=o.getIndexByKeyPath(r.index);if(!u)throw new Q.Schema("KeyPath "+r.index+" on object store "+o.name+" is not indexed");return u}function Gs(r,o,u){var c=di(r,o.schema);return o.openCursor({trans:u,values:!r.keysOnly,reverse:r.dir==="prev",unique:!!r.unique,query:{index:c,range:r.range}})}function pi(r,o,u,c){var f=r.replayFilter?un(r.filter,r.replayFilter()):r.filter;if(r.or){var h={},p=function(v,w,b){var x,y;f&&!f(w,b,function(A){return w.stop(A)},function(A){return w.fail(A)})||((y=""+(x=w.primaryKey))=="[object ArrayBuffer]"&&(y=""+new Uint8Array(x)),E(h,y)||(h[y]=!0,o(v,w,b)))};return Promise.all([r.or._iterate(p,u),Ys(Gs(r,c,u),r.algorithm,p,!r.keysOnly&&r.valueMapper)])}return Ys(Gs(r,c,u),un(r.algorithm,f),o,!r.keysOnly&&r.valueMapper)}function Ys(r,o,u,c){var f=_e(c?function(h,p,v){return u(c(h),p,v)}:u);return r.then(function(h){if(h)return h.start(function(){var p=function(){return h.continue()};o&&!o(h,function(v){return p=v},function(v){h.stop(v),p=ce},function(v){h.fail(v),p=ce})||f(h.value,h,function(v){return p=v}),p()})})}var Pt=Symbol(),er=(Qs.prototype.execute=function(r){if(this.add!==void 0){var o=this.add;if(d(o))return a(a([],d(r)?r:[],!0),o).sort();if(typeof o=="number")return(Number(r)||0)+o;if(typeof o=="bigint")try{return BigInt(r)+o}catch{return BigInt(0)+o}throw new TypeError("Invalid term ".concat(o))}if(this.remove!==void 0){var u=this.remove;if(d(u))return d(r)?r.filter(function(c){return!u.includes(c)}).sort():[];if(typeof u=="number")return Number(r)-u;if(typeof u=="bigint")try{return BigInt(r)-u}catch{return BigInt(0)-u}throw new TypeError("Invalid subtrahend ".concat(u))}return o=(o=this.replacePrefix)===null||o===void 0?void 0:o[0],o&&typeof r=="string"&&r.startsWith(o)?this.replacePrefix[1]+r.substring(o.length):r},Qs);function Qs(r){Object.assign(this,r)}var dd=(fe.prototype._read=function(r,o){var u=this._ctx;return u.error?u.table._trans(null,xe.bind(null,u.error)):u.table._trans("readonly",r).then(o)},fe.prototype._write=function(r){var o=this._ctx;return o.error?o.table._trans(null,xe.bind(null,o.error)):o.table._trans("readwrite",r,"locked")},fe.prototype._addAlgorithm=function(r){var o=this._ctx;o.algorithm=un(o.algorithm,r)},fe.prototype._iterate=function(r,o){return pi(this._ctx,r,o,this._ctx.table.core)},fe.prototype.clone=function(r){var o=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return r&&m(u,r),o._ctx=u,o},fe.prototype.raw=function(){return this._ctx.valueMapper=null,this},fe.prototype.each=function(r){var o=this._ctx;return this._read(function(u){return pi(o,r,u,o.table.core)})},fe.prototype.count=function(r){var o=this;return this._read(function(u){var c=o._ctx,f=c.table.core;if(Cn(c,!0))return f.count({trans:u,query:{index:di(c,f.schema),range:c.range}}).then(function(p){return Math.min(p,c.limit)});var h=0;return pi(c,function(){return++h,!1},u,f).then(function(){return h})}).then(r)},fe.prototype.sortBy=function(r,o){var u=r.split(".").reverse(),c=u[0],f=u.length-1;function h(w,b){return b?h(w[u[b]],b-1):w[c]}var p=this._ctx.dir==="next"?1:-1;function v(w,b){return w=h(w,f),b=h(b,f),w<b?-p:b<w?p:0}return this.toArray(function(w){return w.sort(v)}).then(o)},fe.prototype.toArray=function(r){var o=this;return this._read(function(u){var c=o._ctx;if(c.dir==="next"&&Cn(c,!0)&&0<c.limit){var f=c.valueMapper,h=di(c,c.table.core.schema);return c.table.core.query({trans:u,limit:c.limit,values:!0,query:{index:h,range:c.range}}).then(function(v){return v=v.result,f?v.map(f):v})}var p=[];return pi(c,function(v){return p.push(v)},u,c.table.core).then(function(){return p})},r)},fe.prototype.offset=function(r){var o=this._ctx;return r<=0||(o.offset+=r,Cn(o)?Bo(o,function(){var u=r;return function(c,f){return u===0||(u===1?--u:f(function(){c.advance(u),u=0}),!1)}}):Bo(o,function(){var u=r;return function(){return--u<0}})),this},fe.prototype.limit=function(r){return this._ctx.limit=Math.min(this._ctx.limit,r),Bo(this._ctx,function(){var o=r;return function(u,c,f){return--o<=0&&c(f),0<=o}},!0),this},fe.prototype.until=function(r,o){return Fo(this._ctx,function(u,c,f){return!r(u.value)||(c(f),o)}),this},fe.prototype.first=function(r){return this.limit(1).toArray(function(o){return o[0]}).then(r)},fe.prototype.last=function(r){return this.reverse().first(r)},fe.prototype.filter=function(r){var o;return Fo(this._ctx,function(u){return r(u.value)}),(o=this._ctx).isMatch=un(o.isMatch,r),this},fe.prototype.and=function(r){return this.filter(r)},fe.prototype.or=function(r){return new this.db.WhereClause(this._ctx.table,r,this)},fe.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},fe.prototype.desc=function(){return this.reverse()},fe.prototype.eachKey=function(r){var o=this._ctx;return o.keysOnly=!o.isMatch,this.each(function(u,c){r(c.key,c)})},fe.prototype.eachUniqueKey=function(r){return this._ctx.unique="unique",this.eachKey(r)},fe.prototype.eachPrimaryKey=function(r){var o=this._ctx;return o.keysOnly=!o.isMatch,this.each(function(u,c){r(c.primaryKey,c)})},fe.prototype.keys=function(r){var o=this._ctx;o.keysOnly=!o.isMatch;var u=[];return this.each(function(c,f){u.push(f.key)}).then(function(){return u}).then(r)},fe.prototype.primaryKeys=function(r){var o=this._ctx;if(o.dir==="next"&&Cn(o,!0)&&0<o.limit)return this._read(function(c){var f=di(o,o.table.core.schema);return o.table.core.query({trans:c,values:!1,limit:o.limit,query:{index:f,range:o.range}})}).then(function(c){return c.result}).then(r);o.keysOnly=!o.isMatch;var u=[];return this.each(function(c,f){u.push(f.primaryKey)}).then(function(){return u}).then(r)},fe.prototype.uniqueKeys=function(r){return this._ctx.unique="unique",this.keys(r)},fe.prototype.firstKey=function(r){return this.limit(1).keys(function(o){return o[0]}).then(r)},fe.prototype.lastKey=function(r){return this.reverse().firstKey(r)},fe.prototype.distinct=function(){var r=this._ctx,r=r.index&&r.table.schema.idxByName[r.index];if(!r||!r.multi)return this;var o={};return Fo(this._ctx,function(f){var c=f.primaryKey.toString(),f=E(o,c);return o[c]=!0,!f}),this},fe.prototype.modify=function(r){var o=this,u=this._ctx;return this._write(function(c){var f,h,p;p=typeof r=="function"?r:(f=l(r),h=f.length,function(S){for(var D=!1,R=0;R<h;++R){var M=f[R],k=r[M],$=Be(S,M);k instanceof er?(Pe(S,M,k.execute($)),D=!0):$!==k&&(Pe(S,M,k),D=!0)}return D});function v(S,M){var R=M.failures,M=M.numFailures;O+=S-M;for(var k=0,$=l(R);k<$.length;k++){var U=$[k];_.push(R[U])}}var w=u.table.core,b=w.schema.primaryKey,x=b.outbound,y=b.extractKey,A=o.db._options.modifyChunkSize||200,_=[],O=0,C=[];return o.clone().primaryKeys().then(function(S){function D(M){var k=Math.min(A,S.length-M);return w.getMany({trans:c,keys:S.slice(M,M+k),cache:"immutable"}).then(function($){for(var U=[],V=[],W=x?[]:null,q=[],B=0;B<k;++B){var Z=$[B],te={value:Ot(Z),primKey:S[M+B]};p.call(te,te.value,te)!==!1&&(te.value==null?q.push(S[M+B]):x||le(y(Z),y(te.value))===0?(V.push(te.value),x&&W.push(S[M+B])):(q.push(S[M+B]),U.push(te.value)))}return Promise.resolve(0<U.length&&w.mutate({trans:c,type:"add",values:U}).then(function(ae){for(var ie in ae.failures)q.splice(parseInt(ie),1);v(U.length,ae)})).then(function(){return(0<V.length||R&&typeof r=="object")&&w.mutate({trans:c,type:"put",keys:W,values:V,criteria:R,changeSpec:typeof r!="function"&&r,isAdditionalChunk:0<M}).then(function(ae){return v(V.length,ae)})}).then(function(){return(0<q.length||R&&r===$o)&&w.mutate({trans:c,type:"delete",keys:q,criteria:R,isAdditionalChunk:0<M}).then(function(ae){return v(q.length,ae)})}).then(function(){return S.length>M+k&&D(M+A)})})}var R=Cn(u)&&u.limit===1/0&&(typeof r!="function"||r===$o)&&{index:u.index,range:u.range};return D(0).then(function(){if(0<_.length)throw new me("Error modifying one or more objects",_,O,C);return S.length})})})},fe.prototype.delete=function(){var r=this._ctx,o=r.range;return Cn(r)&&(r.isPrimKey||o.type===3)?this._write(function(u){var c=r.table.core.schema.primaryKey,f=o;return r.table.core.count({trans:u,query:{index:c,range:f}}).then(function(h){return r.table.core.mutate({trans:u,type:"deleteRange",range:f}).then(function(p){var v=p.failures;if(p.lastResult,p.results,p=p.numFailures,p)throw new me("Could not delete some values",Object.keys(v).map(function(w){return v[w]}),h-p);return h-p})})}):this.modify($o)},fe);function fe(){}var $o=function(r,o){return o.value=null};function pd(r,o){return r<o?-1:r===o?0:1}function gd(r,o){return o<r?-1:r===o?0:1}function nt(r,o,u){return r=r instanceof Xs?new r.Collection(r):r,r._ctx.error=new(u||TypeError)(o),r}function Pn(r){return new r.Collection(r,function(){return Js("")}).limit(0)}function gi(r,o,u,c){var f,h,p,v,w,b,x,y=u.length;if(!u.every(function(O){return typeof O=="string"}))return nt(r,Ks);function A(O){f=O==="next"?function(S){return S.toUpperCase()}:function(S){return S.toLowerCase()},h=O==="next"?function(S){return S.toLowerCase()}:function(S){return S.toUpperCase()},p=O==="next"?pd:gd;var C=u.map(function(S){return{lower:h(S),upper:f(S)}}).sort(function(S,D){return p(S.lower,D.lower)});v=C.map(function(S){return S.upper}),w=C.map(function(S){return S.lower}),x=(b=O)==="next"?"":c}A("next"),r=new r.Collection(r,function(){return Kt(v[0],w[y-1]+c)}),r._ondirectionchange=function(O){A(O)};var _=0;return r._addAlgorithm(function(O,C,S){var D=O.key;if(typeof D!="string")return!1;var R=h(D);if(o(R,w,_))return!0;for(var M=null,k=_;k<y;++k){var $=function(U,V,W,q,B,Z){for(var te=Math.min(U.length,q.length),ae=-1,ie=0;ie<te;++ie){var dt=V[ie];if(dt!==q[ie])return B(U[ie],W[ie])<0?U.substr(0,ie)+W[ie]+W.substr(ie+1):B(U[ie],q[ie])<0?U.substr(0,ie)+q[ie]+W.substr(ie+1):0<=ae?U.substr(0,ae)+V[ae]+W.substr(ae+1):null;B(U[ie],dt)<0&&(ae=ie)}return te<q.length&&Z==="next"?U+W.substr(U.length):te<U.length&&Z==="prev"?U.substr(0,W.length):ae<0?null:U.substr(0,ae)+q[ae]+W.substr(ae+1)}(D,R,v[k],w[k],p,b);$===null&&M===null?_=k+1:(M===null||0<p(M,$))&&(M=$)}return C(M!==null?function(){O.continue(M+x)}:S),!1}),r}function Kt(r,o,u,c){return{type:2,lower:r,upper:o,lowerOpen:u,upperOpen:c}}function Js(r){return{type:1,lower:r,upper:r}}var Xs=(Object.defineProperty(Ie.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),Ie.prototype.between=function(r,o,u,c){u=u!==!1,c=c===!0;try{return 0<this._cmp(r,o)||this._cmp(r,o)===0&&(u||c)&&(!u||!c)?Pn(this):new this.Collection(this,function(){return Kt(r,o,!u,!c)})}catch{return nt(this,Ct)}},Ie.prototype.equals=function(r){return r==null?nt(this,Ct):new this.Collection(this,function(){return Js(r)})},Ie.prototype.above=function(r){return r==null?nt(this,Ct):new this.Collection(this,function(){return Kt(r,void 0,!0)})},Ie.prototype.aboveOrEqual=function(r){return r==null?nt(this,Ct):new this.Collection(this,function(){return Kt(r,void 0,!1)})},Ie.prototype.below=function(r){return r==null?nt(this,Ct):new this.Collection(this,function(){return Kt(void 0,r,!1,!0)})},Ie.prototype.belowOrEqual=function(r){return r==null?nt(this,Ct):new this.Collection(this,function(){return Kt(void 0,r)})},Ie.prototype.startsWith=function(r){return typeof r!="string"?nt(this,Ks):this.between(r,r+sn,!0,!0)},Ie.prototype.startsWithIgnoreCase=function(r){return r===""?this.startsWith(r):gi(this,function(o,u){return o.indexOf(u[0])===0},[r],sn)},Ie.prototype.equalsIgnoreCase=function(r){return gi(this,function(o,u){return o===u[0]},[r],"")},Ie.prototype.anyOfIgnoreCase=function(){var r=st.apply(xt,arguments);return r.length===0?Pn(this):gi(this,function(o,u){return u.indexOf(o)!==-1},r,"")},Ie.prototype.startsWithAnyOfIgnoreCase=function(){var r=st.apply(xt,arguments);return r.length===0?Pn(this):gi(this,function(o,u){return u.some(function(c){return o.indexOf(c)===0})},r,sn)},Ie.prototype.anyOf=function(){var r=this,o=st.apply(xt,arguments),u=this._cmp;try{o.sort(u)}catch{return nt(this,Ct)}if(o.length===0)return Pn(this);var c=new this.Collection(this,function(){return Kt(o[0],o[o.length-1])});c._ondirectionchange=function(h){u=h==="next"?r._ascending:r._descending,o.sort(u)};var f=0;return c._addAlgorithm(function(h,p,v){for(var w=h.key;0<u(w,o[f]);)if(++f===o.length)return p(v),!1;return u(w,o[f])===0||(p(function(){h.continue(o[f])}),!1)}),c},Ie.prototype.notEqual=function(r){return this.inAnyRange([[-1/0,r],[r,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},Ie.prototype.noneOf=function(){var r=st.apply(xt,arguments);if(r.length===0)return new this.Collection(this);try{r.sort(this._ascending)}catch{return nt(this,Ct)}var o=r.reduce(function(u,c){return u?u.concat([[u[u.length-1][1],c]]):[[-1/0,c]]},null);return o.push([r[r.length-1],this.db._maxKey]),this.inAnyRange(o,{includeLowers:!1,includeUppers:!1})},Ie.prototype.inAnyRange=function(D,o){var u=this,c=this._cmp,f=this._ascending,h=this._descending,p=this._min,v=this._max;if(D.length===0)return Pn(this);if(!D.every(function(R){return R[0]!==void 0&&R[1]!==void 0&&f(R[0],R[1])<=0}))return nt(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Q.InvalidArgument);var w=!o||o.includeLowers!==!1,b=o&&o.includeUppers===!0,x,y=f;function A(R,M){return y(R[0],M[0])}try{(x=D.reduce(function(R,M){for(var k=0,$=R.length;k<$;++k){var U=R[k];if(c(M[0],U[1])<0&&0<c(M[1],U[0])){U[0]=p(U[0],M[0]),U[1]=v(U[1],M[1]);break}}return k===$&&R.push(M),R},[])).sort(A)}catch{return nt(this,Ct)}var _=0,O=b?function(R){return 0<f(R,x[_][1])}:function(R){return 0<=f(R,x[_][1])},C=w?function(R){return 0<h(R,x[_][0])}:function(R){return 0<=h(R,x[_][0])},S=O,D=new this.Collection(this,function(){return Kt(x[0][0],x[x.length-1][1],!w,!b)});return D._ondirectionchange=function(R){y=R==="next"?(S=O,f):(S=C,h),x.sort(A)},D._addAlgorithm(function(R,M,k){for(var $,U=R.key;S(U);)if(++_===x.length)return M(k),!1;return!O($=U)&&!C($)||(u._cmp(U,x[_][1])===0||u._cmp(U,x[_][0])===0||M(function(){y===f?R.continue(x[_][0]):R.continue(x[_][1])}),!1)}),D},Ie.prototype.startsWithAnyOf=function(){var r=st.apply(xt,arguments);return r.every(function(o){return typeof o=="string"})?r.length===0?Pn(this):this.inAnyRange(r.map(function(o){return[o,o+sn]})):nt(this,"startsWithAnyOf() only works with strings")},Ie);function Ie(){}function yt(r){return _e(function(o){return tr(o),r(o.target.error),!1})}function tr(r){r.stopPropagation&&r.stopPropagation(),r.preventDefault&&r.preventDefault()}var nr="storagemutated",Vo="x-storagemutated-1",Wt=Xn(null,nr),vd=(mt.prototype._lock=function(){return ne(!F.global),++this._reculock,this._reculock!==1||F.global||(F.lockOwnerFor=this),this},mt.prototype._unlock=function(){if(ne(!F.global),--this._reculock==0)for(F.global||(F.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var r=this._blockedFuncs.shift();try{an(r[1],r[0])}catch{}}return this},mt.prototype._locked=function(){return this._reculock&&F.lockOwnerFor!==this},mt.prototype.create=function(r){var o=this;if(!this.mode)return this;var u=this.db.idbdb,c=this.db._state.dbOpenError;if(ne(!this.idbtrans),!r&&!u)switch(c&&c.name){case"DatabaseClosedError":throw new Q.DatabaseClosed(c);case"MissingAPIError":throw new Q.MissingAPI(c.message,c);default:throw new Q.OpenFailed(c)}if(!this.active)throw new Q.TransactionInactive;return ne(this._completion._state===null),(r=this.idbtrans=r||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=_e(function(f){tr(f),o._reject(r.error)}),r.onabort=_e(function(f){tr(f),o.active&&o._reject(new Q.Abort(r.error)),o.active=!1,o.on("abort").fire(f)}),r.oncomplete=_e(function(){o.active=!1,o._resolve(),"mutatedParts"in r&&Wt.storagemutated.fire(r.mutatedParts)}),this},mt.prototype._promise=function(r,o,u){var c=this;if(r==="readwrite"&&this.mode!=="readwrite")return xe(new Q.ReadOnly("Transaction is readonly"));if(!this.active)return xe(new Q.TransactionInactive);if(this._locked())return new N(function(h,p){c._blockedFuncs.push([function(){c._promise(r,o,u).then(h,p)},F])});if(u)return Bt(function(){var h=new N(function(p,v){c._lock();var w=o(p,v,c);w&&w.then&&w.then(p,v)});return h.finally(function(){return c._unlock()}),h._lib=!0,h});var f=new N(function(h,p){var v=o(h,p,c);v&&v.then&&v.then(h,p)});return f._lib=!0,f},mt.prototype._root=function(){return this.parent?this.parent._root():this},mt.prototype.waitFor=function(r){var o,u=this._root(),c=N.resolve(r);u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return c}):(u._waitingFor=c,u._waitingQueue=[],o=u.idbtrans.objectStore(u.storeNames[0]),function h(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(o.get(-1/0).onsuccess=h)}());var f=u._waitingFor;return new N(function(h,p){c.then(function(v){return u._waitingQueue.push(_e(h.bind(null,v)))},function(v){return u._waitingQueue.push(_e(p.bind(null,v)))}).finally(function(){u._waitingFor===f&&(u._waitingFor=null)})})},mt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Q.Abort))},mt.prototype.table=function(r){var o=this._memoizedTables||(this._memoizedTables={});if(E(o,r))return o[r];var u=this.schema[r];if(!u)throw new Q.NotFound("Table "+r+" not part of transaction");return u=new this.db.Table(r,u,this),u.core=this.db.core.table(r),o[r]=u},mt);function mt(){}function Ko(r,o,u,c,f,h,p){return{name:r,keyPath:o,unique:u,multi:c,auto:f,compound:h,src:(u&&!p?"&":"")+(c?"*":"")+(f?"++":"")+Zs(o)}}function Zs(r){return typeof r=="string"?r:r?"["+[].join.call(r,"+")+"]":""}function Wo(r,o,u){return{name:r,primKey:o,indexes:u,mappedClass:null,idxByName:(c=function(f){return[f.name,f]},u.reduce(function(f,h,p){return p=c(h,p),p&&(f[p[0]]=p[1]),f},{}))};var c}var rr=function(r){try{return r.only([[]]),rr=function(){return[[]]},[[]]}catch{return rr=function(){return sn},sn}};function Uo(r){return r==null?function(){}:typeof r=="string"?(o=r).split(".").length===1?function(u){return u[o]}:function(u){return Be(u,o)}:function(u){return Be(u,r)};var o}function eu(r){return[].slice.call(r)}var yd=0;function ir(r){return r==null?":id":typeof r=="string"?r:"[".concat(r.join("+"),"]")}function md(r,o,w){function c(S){if(S.type===3)return null;if(S.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var _=S.lower,O=S.upper,C=S.lowerOpen,S=S.upperOpen;return _===void 0?O===void 0?null:o.upperBound(O,!!S):O===void 0?o.lowerBound(_,!!C):o.bound(_,O,!!C,!!S)}function f(A){var _,O=A.name;return{name:O,schema:A,mutate:function(C){var S=C.trans,D=C.type,R=C.keys,M=C.values,k=C.range;return new Promise(function($,U){$=_e($);var V=S.objectStore(O),W=V.keyPath==null,q=D==="put"||D==="add";if(!q&&D!=="delete"&&D!=="deleteRange")throw new Error("Invalid operation type: "+D);var B,Z=(R||M||{length:1}).length;if(R&&M&&R.length!==M.length)throw new Error("Given keys array must have same length as given values array.");if(Z===0)return $({numFailures:0,failures:{},results:[],lastResult:void 0});function te(Ve){++dt,tr(Ve)}var ae=[],ie=[],dt=0;if(D==="deleteRange"){if(k.type===4)return $({numFailures:dt,failures:ie,results:[],lastResult:void 0});k.type===3?ae.push(B=V.clear()):ae.push(B=V.delete(c(k)))}else{var W=q?W?[M,R]:[M,null]:[R,null],oe=W[0],ke=W[1];if(q)for(var je=0;je<Z;++je)ae.push(B=ke&&ke[je]!==void 0?V[D](oe[je],ke[je]):V[D](oe[je])),B.onerror=te;else for(je=0;je<Z;++je)ae.push(B=V[D](oe[je])),B.onerror=te}function Pi(Ve){Ve=Ve.target.result,ae.forEach(function(fn,ua){return fn.error!=null&&(ie[ua]=fn.error)}),$({numFailures:dt,failures:ie,results:D==="delete"?R:ae.map(function(fn){return fn.result}),lastResult:Ve})}B.onerror=function(Ve){te(Ve),Pi(Ve)},B.onsuccess=Pi})},getMany:function(C){var S=C.trans,D=C.keys;return new Promise(function(R,M){R=_e(R);for(var k,$=S.objectStore(O),U=D.length,V=new Array(U),W=0,q=0,B=function(ae){ae=ae.target,V[ae._pos]=ae.result,++q===W&&R(V)},Z=yt(M),te=0;te<U;++te)D[te]!=null&&((k=$.get(D[te]))._pos=te,k.onsuccess=B,k.onerror=Z,++W);W===0&&R(V)})},get:function(C){var S=C.trans,D=C.key;return new Promise(function(R,M){R=_e(R);var k=S.objectStore(O).get(D);k.onsuccess=function($){return R($.target.result)},k.onerror=yt(M)})},query:(_=b,function(C){return new Promise(function(S,D){S=_e(S);var R,M,k,W=C.trans,$=C.values,U=C.limit,B=C.query,V=U===1/0?void 0:U,q=B.index,B=B.range,W=W.objectStore(O),q=q.isPrimaryKey?W:W.index(q.name),B=c(B);if(U===0)return S({result:[]});_?((V=$?q.getAll(B,V):q.getAllKeys(B,V)).onsuccess=function(Z){return S({result:Z.target.result})},V.onerror=yt(D)):(R=0,M=!$&&"openKeyCursor"in q?q.openKeyCursor(B):q.openCursor(B),k=[],M.onsuccess=function(Z){var te=M.result;return te?(k.push($?te.value:te.primaryKey),++R===U?S({result:k}):void te.continue()):S({result:k})},M.onerror=yt(D))})}),openCursor:function(C){var S=C.trans,D=C.values,R=C.query,M=C.reverse,k=C.unique;return new Promise(function($,U){$=_e($);var q=R.index,V=R.range,W=S.objectStore(O),W=q.isPrimaryKey?W:W.index(q.name),q=M?k?"prevunique":"prev":k?"nextunique":"next",B=!D&&"openKeyCursor"in W?W.openKeyCursor(c(V),q):W.openCursor(c(V),q);B.onerror=yt(U),B.onsuccess=_e(function(Z){var te,ae,ie,dt,oe=B.result;oe?(oe.___id=++yd,oe.done=!1,te=oe.continue.bind(oe),ae=(ae=oe.continuePrimaryKey)&&ae.bind(oe),ie=oe.advance.bind(oe),dt=function(){throw new Error("Cursor not stopped")},oe.trans=S,oe.stop=oe.continue=oe.continuePrimaryKey=oe.advance=function(){throw new Error("Cursor not started")},oe.fail=_e(U),oe.next=function(){var ke=this,je=1;return this.start(function(){return je--?ke.continue():ke.stop()}).then(function(){return ke})},oe.start=function(ke){function je(){if(B.result)try{ke()}catch(Ve){oe.fail(Ve)}else oe.done=!0,oe.start=function(){throw new Error("Cursor behind last entry")},oe.stop()}var Pi=new Promise(function(Ve,fn){Ve=_e(Ve),B.onerror=yt(fn),oe.fail=fn,oe.stop=function(ua){oe.stop=oe.continue=oe.continuePrimaryKey=oe.advance=dt,Ve(ua)}});return B.onsuccess=_e(function(Ve){B.onsuccess=je,je()}),oe.continue=te,oe.continuePrimaryKey=ae,oe.advance=ie,je(),Pi},$(oe)):$(null)},U)})},count:function(C){var S=C.query,D=C.trans,R=S.index,M=S.range;return new Promise(function(k,$){var U=D.objectStore(O),V=R.isPrimaryKey?U:U.index(R.name),U=c(M),V=U?V.count(U):V.count();V.onsuccess=_e(function(W){return k(W.target.result)}),V.onerror=yt($)})}}}var h,p,v,x=(p=w,v=eu((h=r).objectStoreNames),{schema:{name:h.name,tables:v.map(function(A){return p.objectStore(A)}).map(function(A){var _=A.keyPath,S=A.autoIncrement,O=d(_),C={},S={name:A.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:_==null,compound:O,keyPath:_,autoIncrement:S,unique:!0,extractKey:Uo(_)},indexes:eu(A.indexNames).map(function(D){return A.index(D)}).map(function(k){var R=k.name,M=k.unique,$=k.multiEntry,k=k.keyPath,$={name:R,compound:d(k),keyPath:k,unique:M,multiEntry:$,extractKey:Uo(k)};return C[ir(k)]=$}),getIndexByKeyPath:function(D){return C[ir(D)]}};return C[":id"]=S.primaryKey,_!=null&&(C[ir(_)]=S.primaryKey),S})},hasGetAll:0<v.length&&"getAll"in p.objectStore(v[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}),w=x.schema,b=x.hasGetAll,x=w.tables.map(f),y={};return x.forEach(function(A){return y[A.name]=A}),{stack:"dbcore",transaction:r.transaction.bind(r),table:function(A){if(!y[A])throw new Error("Table '".concat(A,"' not found"));return y[A]},MIN_KEY:-1/0,MAX_KEY:rr(o),schema:w}}function bd(r,o,u,c){var f=u.IDBKeyRange;return u.indexedDB,{dbcore:(c=md(o,f,c),r.dbcore.reduce(function(h,p){return p=p.create,i(i({},h),p(h))},c))}}function vi(r,c){var u=c.db,c=bd(r._middlewares,u,r._deps,c);r.core=c.dbcore,r.tables.forEach(function(f){var h=f.name;r.core.schema.tables.some(function(p){return p.name===h})&&(f.core=r.core.table(h),r[h]instanceof r.Table&&(r[h].core=f.core))})}function yi(r,o,u,c){u.forEach(function(f){var h=c[f];o.forEach(function(p){var v=function w(b,x){return qe(b,x)||(b=g(b))&&w(b,x)}(p,f);(!v||"value"in v&&v.value===void 0)&&(p===r.Transaction.prototype||p instanceof r.Transaction?X(p,f,{get:function(){return this.table(f)},set:function(w){z(this,f,{value:w,writable:!0,configurable:!0,enumerable:!0})}}):p[f]=new r.Table(f,h))})})}function qo(r,o){o.forEach(function(u){for(var c in u)u[c]instanceof r.Table&&delete u[c]})}function _d(r,o){return r._cfg.version-o._cfg.version}function wd(r,o,u,c){var f=r._dbSchema;u.objectStoreNames.contains("$meta")&&!f.$meta&&(f.$meta=Wo("$meta",nu("")[0],[]),r._storeNames.push("$meta"));var h=r._createTransaction("readwrite",r._storeNames,f);h.create(u),h._completion.catch(c);var p=h._reject.bind(h),v=F.transless||F;Bt(function(){return F.trans=h,F.transless=v,o!==0?(vi(r,u),b=o,((w=h).storeNames.includes("$meta")?w.table("$meta").get("version").then(function(x){return x??b}):N.resolve(b)).then(function(x){return A=x,_=h,O=u,C=[],x=(y=r)._versions,S=y._dbSchema=bi(0,y.idbdb,O),(x=x.filter(function(D){return D._cfg.version>=A})).length!==0?(x.forEach(function(D){C.push(function(){var R=S,M=D._cfg.dbschema;_i(y,R,O),_i(y,M,O),S=y._dbSchema=M;var k=Ho(R,M);k.add.forEach(function(q){zo(O,q[0],q[1].primKey,q[1].indexes)}),k.change.forEach(function(q){if(q.recreate)throw new Q.Upgrade("Not yet support for changing primary key");var B=O.objectStore(q.name);q.add.forEach(function(Z){return mi(B,Z)}),q.change.forEach(function(Z){B.deleteIndex(Z.name),mi(B,Z)}),q.del.forEach(function(Z){return B.deleteIndex(Z)})});var $=D._cfg.contentUpgrade;if($&&D._cfg.version>A){vi(y,O),_._memoizedTables={};var U=zr(M);k.del.forEach(function(q){U[q]=R[q]}),qo(y,[y.Transaction.prototype]),yi(y,[y.Transaction.prototype],l(U),U),_.schema=U;var V,W=Sn($);return W&&xn(),k=N.follow(function(){var q;(V=$(_))&&W&&(q=$t.bind(null,null),V.then(q,q))}),V&&typeof V.then=="function"?N.resolve(V):k.then(function(){return V})}}),C.push(function(R){var M,k,$=D._cfg.dbschema;M=$,k=R,[].slice.call(k.db.objectStoreNames).forEach(function(U){return M[U]==null&&k.db.deleteObjectStore(U)}),qo(y,[y.Transaction.prototype]),yi(y,[y.Transaction.prototype],y._storeNames,y._dbSchema),_.schema=y._dbSchema}),C.push(function(R){y.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(y.idbdb.version/10)===D._cfg.version?(y.idbdb.deleteObjectStore("$meta"),delete y._dbSchema.$meta,y._storeNames=y._storeNames.filter(function(M){return M!=="$meta"})):R.objectStore("$meta").put(D._cfg.version,"version"))})}),function D(){return C.length?N.resolve(C.shift()(_.idbtrans)).then(D):N.resolve()}().then(function(){tu(S,O)})):N.resolve();var y,A,_,O,C,S}).catch(p)):(l(f).forEach(function(x){zo(u,x,f[x].primKey,f[x].indexes)}),vi(r,u),void N.follow(function(){return r.on.populate.fire(h)}).catch(p));var w,b})}function Ed(r,o){tu(r._dbSchema,o),o.db.version%10!=0||o.objectStoreNames.contains("$meta")||o.db.createObjectStore("$meta").add(Math.ceil(o.db.version/10-1),"version");var u=bi(0,r.idbdb,o);_i(r,r._dbSchema,o);for(var c=0,f=Ho(u,r._dbSchema).change;c<f.length;c++){var h=function(p){if(p.change.length||p.recreate)return console.warn("Unable to patch indexes of table ".concat(p.name," because it has changes on the type of index or primary key.")),{value:void 0};var v=o.objectStore(p.name);p.add.forEach(function(w){ze&&console.debug("Dexie upgrade patch: Creating missing index ".concat(p.name,".").concat(w.src)),mi(v,w)})}(f[c]);if(typeof h=="object")return h.value}}function Ho(r,o){var u,c={del:[],add:[],change:[]};for(u in r)o[u]||c.del.push(u);for(u in o){var f=r[u],h=o[u];if(f){var p={name:u,def:h,recreate:!1,del:[],add:[],change:[]};if(""+(f.primKey.keyPath||"")!=""+(h.primKey.keyPath||"")||f.primKey.auto!==h.primKey.auto)p.recreate=!0,c.change.push(p);else{var v=f.idxByName,w=h.idxByName,b=void 0;for(b in v)w[b]||p.del.push(b);for(b in w){var x=v[b],y=w[b];x?x.src!==y.src&&p.change.push(y):p.add.push(y)}(0<p.del.length||0<p.add.length||0<p.change.length)&&c.change.push(p)}}else c.add.push([u,h])}return c}function zo(r,o,u,c){var f=r.db.createObjectStore(o,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});return c.forEach(function(h){return mi(f,h)}),f}function tu(r,o){l(r).forEach(function(u){o.db.objectStoreNames.contains(u)||(ze&&console.debug("Dexie: Creating missing table",u),zo(o,u,r[u].primKey,r[u].indexes))})}function mi(r,o){r.createIndex(o.name,o.keyPath,{unique:o.unique,multiEntry:o.multi})}function bi(r,o,u){var c={};return He(o.objectStoreNames,0).forEach(function(f){for(var h=u.objectStore(f),p=Ko(Zs(b=h.keyPath),b||"",!0,!1,!!h.autoIncrement,b&&typeof b!="string",!0),v=[],w=0;w<h.indexNames.length;++w){var x=h.index(h.indexNames[w]),b=x.keyPath,x=Ko(x.name,b,!!x.unique,!!x.multiEntry,!1,b&&typeof b!="string",!1);v.push(x)}c[f]=Wo(f,p,v)}),c}function _i(r,o,u){for(var c=u.db.objectStoreNames,f=0;f<c.length;++f){var h=c[f],p=u.objectStore(h);r._hasGetAll="getAll"in p;for(var v=0;v<p.indexNames.length;++v){var w=p.indexNames[v],b=p.index(w).keyPath,x=typeof b=="string"?b:"["+He(b).join("+")+"]";!o[h]||(b=o[h].idxByName[x])&&(b.name=w,delete o[h].idxByName[x],o[h].idxByName[w]=b)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&s.WorkerGlobalScope&&s instanceof s.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(r._hasGetAll=!1)}function nu(r){return r.split(",").map(function(o,u){var c=(o=o.trim()).replace(/([&*]|\+\+)/g,""),f=/^\[/.test(c)?c.match(/^\[(.*)\]$/)[1].split("+"):c;return Ko(c,f||null,/\&/.test(o),/\*/.test(o),/\+\+/.test(o),d(f),u===0)})}var Sd=(wi.prototype._parseStoresSpec=function(r,o){l(r).forEach(function(u){if(r[u]!==null){var c=nu(r[u]),f=c.shift();if(f.unique=!0,f.multi)throw new Q.Schema("Primary key cannot be multi-valued");c.forEach(function(h){if(h.auto)throw new Q.Schema("Only primary key can be marked as autoIncrement (++)");if(!h.keyPath)throw new Q.Schema("Index must have a name and cannot be an empty string")}),o[u]=Wo(u,f,c)}})},wi.prototype.stores=function(u){var o=this.db;this._cfg.storesSource=this._cfg.storesSource?m(this._cfg.storesSource,u):u;var u=o._versions,c={},f={};return u.forEach(function(h){m(c,h._cfg.storesSource),f=h._cfg.dbschema={},h._parseStoresSpec(c,f)}),o._dbSchema=f,qo(o,[o._allTables,o,o.Transaction.prototype]),yi(o,[o._allTables,o,o.Transaction.prototype,this._cfg.tables],l(f),f),o._storeNames=l(f),this},wi.prototype.upgrade=function(r){return this._cfg.contentUpgrade=On(this._cfg.contentUpgrade||ce,r),this},wi);function wi(){}function Go(r,o){var u=r._dbNamesDB;return u||(u=r._dbNamesDB=new Tt(fi,{addons:[],indexedDB:r,IDBKeyRange:o})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function Yo(r){return r&&typeof r.databases=="function"}function Qo(r){return Bt(function(){return F.letThrough=!0,r()})}function Jo(r){return!("from"in r)}var $e=function(r,o){if(!this){var u=new $e;return r&&"d"in r&&m(u,r),u}m(this,arguments.length?{d:1,from:r,to:1<arguments.length?o:r}:{d:0})};function or(r,o,u){var c=le(o,u);if(!isNaN(c)){if(0<c)throw RangeError();if(Jo(r))return m(r,{from:o,to:u,d:1});var f=r.l,c=r.r;if(le(u,r.from)<0)return f?or(f,o,u):r.l={from:o,to:u,d:1,l:null,r:null},iu(r);if(0<le(o,r.to))return c?or(c,o,u):r.r={from:o,to:u,d:1,l:null,r:null},iu(r);le(o,r.from)<0&&(r.from=o,r.l=null,r.d=c?c.d+1:1),0<le(u,r.to)&&(r.to=u,r.r=null,r.d=r.l?r.l.d+1:1),u=!r.r,f&&!r.l&&ar(r,f),c&&u&&ar(r,c)}}function ar(r,o){Jo(o)||function u(c,w){var h=w.from,p=w.to,v=w.l,w=w.r;or(c,h,p),v&&u(c,v),w&&u(c,w)}(r,o)}function ru(r,o){var u=Ei(o),c=u.next();if(c.done)return!1;for(var f=c.value,h=Ei(r),p=h.next(f.from),v=p.value;!c.done&&!p.done;){if(le(v.from,f.to)<=0&&0<=le(v.to,f.from))return!0;le(f.from,v.from)<0?f=(c=u.next(v.from)).value:v=(p=h.next(f.from)).value}return!1}function Ei(r){var o=Jo(r)?null:{s:0,n:r};return{next:function(u){for(var c=0<arguments.length;o;)switch(o.s){case 0:if(o.s=1,c)for(;o.n.l&&le(u,o.n.from)<0;)o={up:o,n:o.n.l,s:1};else for(;o.n.l;)o={up:o,n:o.n.l,s:1};case 1:if(o.s=2,!c||le(u,o.n.to)<=0)return{value:o.n,done:!1};case 2:if(o.n.r){o.s=3,o={up:o,n:o.n.r,s:0};continue}case 3:o=o.up}return{done:!0}}}}function iu(r){var o,u,c=(((o=r.r)===null||o===void 0?void 0:o.d)||0)-(((u=r.l)===null||u===void 0?void 0:u.d)||0),f=1<c?"r":c<-1?"l":"";f&&(o=f=="r"?"l":"r",u=i({},r),c=r[f],r.from=c.from,r.to=c.to,r[f]=c[f],u[f]=c[o],(r[o]=u).d=ou(u)),r.d=ou(r)}function ou(u){var o=u.r,u=u.l;return(o?u?Math.max(o.d,u.d):o.d:u?u.d:0)+1}function Si(r,o){return l(o).forEach(function(u){r[u]?ar(r[u],o[u]):r[u]=function c(f){var h,p,v={};for(h in f)E(f,h)&&(p=f[h],v[h]=!p||typeof p!="object"||Yr.has(p.constructor)?p:c(p));return v}(o[u])}),r}function Xo(r,o){return r.all||o.all||Object.keys(r).some(function(u){return o[u]&&ru(o[u],r[u])})}L($e.prototype,((ut={add:function(r){return ar(this,r),this},addKey:function(r){return or(this,r,r),this},addKeys:function(r){var o=this;return r.forEach(function(u){return or(o,u,u)}),this},hasKey:function(r){var o=Ei(this).next(r).value;return o&&le(o.from,r)<=0&&0<=le(o.to,r)}})[En]=function(){return Ei(this)},ut));var cn={},Zo={},ea=!1;function Oi(r){Si(Zo,r),ea||(ea=!0,setTimeout(function(){ea=!1,ta(Zo,!(Zo={}))},0))}function ta(r,o){o===void 0&&(o=!1);var u=new Set;if(r.all)for(var c=0,f=Object.values(cn);c<f.length;c++)au(p=f[c],r,u,o);else for(var h in r){var p,v=/^idb\:\/\/(.*)\/(.*)\//.exec(h);v&&(h=v[1],v=v[2],(p=cn["idb://".concat(h,"/").concat(v)])&&au(p,r,u,o))}u.forEach(function(w){return w()})}function au(r,o,u,c){for(var f=[],h=0,p=Object.entries(r.queries.query);h<p.length;h++){for(var v=p[h],w=v[0],b=[],x=0,y=v[1];x<y.length;x++){var A=y[x];Xo(o,A.obsSet)?A.subscribers.forEach(function(S){return u.add(S)}):c&&b.push(A)}c&&f.push([w,b])}if(c)for(var _=0,O=f;_<O.length;_++){var C=O[_],w=C[0],b=C[1];r.queries.query[w]=b}}function Od(r){var o=r._state,u=r._deps.indexedDB;if(o.isBeingOpened||r.idbdb)return o.dbReadyPromise.then(function(){return o.dbOpenError?xe(o.dbOpenError):r});o.isBeingOpened=!0,o.dbOpenError=null,o.openComplete=!1;var c=o.openCanceller,f=Math.round(10*r.verno),h=!1;function p(){if(o.openCanceller!==c)throw new Q.DatabaseClosed("db.open() was cancelled")}function v(){return new N(function(A,_){if(p(),!u)throw new Q.MissingAPI;var O=r.name,C=o.autoSchema||!f?u.open(O):u.open(O,f);if(!C)throw new Q.MissingAPI;C.onerror=yt(_),C.onblocked=_e(r._fireOnBlocked),C.onupgradeneeded=_e(function(S){var D;x=C.transaction,o.autoSchema&&!r._options.allowEmptyDB?(C.onerror=tr,x.abort(),C.result.close(),(D=u.deleteDatabase(O)).onsuccess=D.onerror=_e(function(){_(new Q.NoSuchDatabase("Database ".concat(O," doesnt exist")))})):(x.onerror=yt(_),S=S.oldVersion>Math.pow(2,62)?0:S.oldVersion,y=S<1,r.idbdb=C.result,h&&Ed(r,x),wd(r,S/10,x,_))},_),C.onsuccess=_e(function(){x=null;var S,D,R,M,k,$=r.idbdb=C.result,U=He($.objectStoreNames);if(0<U.length)try{var V=$.transaction((M=U).length===1?M[0]:M,"readonly");if(o.autoSchema)D=$,R=V,(S=r).verno=D.version/10,R=S._dbSchema=bi(0,D,R),S._storeNames=He(D.objectStoreNames,0),yi(S,[S._allTables],l(R),R);else if(_i(r,r._dbSchema,V),((k=Ho(bi(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."),$.close(),f=$.version+1,h=!0,A(v());vi(r,V)}catch{}An.push(r),$.onversionchange=_e(function(W){o.vcFired=!0,r.on("versionchange").fire(W)}),$.onclose=_e(function(W){r.on("close").fire(W)}),y&&(k=r._deps,V=O,$=k.indexedDB,k=k.IDBKeyRange,Yo($)||V===fi||Go($,k).put({name:V}).catch(ce)),A()},_)}).catch(function(A){switch(A==null?void 0:A.name){case"UnknownError":if(0<o.PR1398_maxLoop)return o.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),v();break;case"VersionError":if(0<f)return f=0,v()}return N.reject(A)})}var w,b=o.dbReadyResolve,x=null,y=!1;return N.race([c,(typeof navigator>"u"?N.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(A){function _(){return indexedDB.databases().finally(A)}w=setInterval(_,100),_()}).finally(function(){return clearInterval(w)}):Promise.resolve()).then(v)]).then(function(){return p(),o.onReadyBeingFired=[],N.resolve(Qo(function(){return r.on.ready.fire(r.vip)})).then(function A(){if(0<o.onReadyBeingFired.length){var _=o.onReadyBeingFired.reduce(On,ce);return o.onReadyBeingFired=[],N.resolve(Qo(function(){return _(r.vip)})).then(A)}})}).finally(function(){o.openCanceller===c&&(o.onReadyBeingFired=null,o.isBeingOpened=!1)}).catch(function(A){o.dbOpenError=A;try{x&&x.abort()}catch{}return c===o.openCanceller&&r._close(),xe(A)}).finally(function(){o.openComplete=!0,b()}).then(function(){var A;return y&&(A={},r.tables.forEach(function(_){_.schema.indexes.forEach(function(O){O.name&&(A["idb://".concat(r.name,"/").concat(_.name,"/").concat(O.name)]=new $e(-1/0,[[[]]]))}),A["idb://".concat(r.name,"/").concat(_.name,"/")]=A["idb://".concat(r.name,"/").concat(_.name,"/:dels")]=new $e(-1/0,[[[]]])}),Wt(nr).fire(A),ta(A,!0)),r})}function na(r){function o(h){return r.next(h)}var u=f(o),c=f(function(h){return r.throw(h)});function f(h){return function(w){var v=h(w),w=v.value;return v.done?w:w&&typeof w.then=="function"?w.then(u,c):d(w)?Promise.all(w).then(u,c):u(w)}}return f(o)()}function xi(r,o,u){for(var c=d(r)?r.slice():[r],f=0;f<u;++f)c.push(o);return c}var xd={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(r){return i(i({},r),{table:function(o){var u=r.table(o),c=u.schema,f={},h=[];function p(y,A,_){var O=ir(y),C=f[O]=f[O]||[],S=y==null?0:typeof y=="string"?1:y.length,D=0<A,D=i(i({},_),{name:D?"".concat(O,"(virtual-from:").concat(_.name,")"):_.name,lowLevelIndex:_,isVirtual:D,keyTail:A,keyLength:S,extractKey:Uo(y),unique:!D&&_.unique});return C.push(D),D.isPrimaryKey||h.push(D),1<S&&p(S===2?y[0]:y.slice(0,S-1),A+1,_),C.sort(function(R,M){return R.keyTail-M.keyTail}),D}o=p(c.primaryKey.keyPath,0,c.primaryKey),f[":id"]=[o];for(var v=0,w=c.indexes;v<w.length;v++){var b=w[v];p(b.keyPath,0,b)}function x(y){var A,_=y.query.index;return _.isVirtual?i(i({},y),{query:{index:_.lowLevelIndex,range:(A=y.query.range,_=_.keyTail,{type:A.type===1?2:A.type,lower:xi(A.lower,A.lowerOpen?r.MAX_KEY:r.MIN_KEY,_),lowerOpen:!0,upper:xi(A.upper,A.upperOpen?r.MIN_KEY:r.MAX_KEY,_),upperOpen:!0})}}):y}return i(i({},u),{schema:i(i({},c),{primaryKey:o,indexes:h,getIndexByKeyPath:function(y){return(y=f[ir(y)])&&y[0]}}),count:function(y){return u.count(x(y))},query:function(y){return u.query(x(y))},openCursor:function(y){var A=y.query.index,_=A.keyTail,O=A.isVirtual,C=A.keyLength;return O?u.openCursor(x(y)).then(function(D){return D&&S(D)}):u.openCursor(y);function S(D){return Object.create(D,{continue:{value:function(R){R!=null?D.continue(xi(R,y.reverse?r.MAX_KEY:r.MIN_KEY,_)):y.unique?D.continue(D.key.slice(0,C).concat(y.reverse?r.MIN_KEY:r.MAX_KEY,_)):D.continue()}},continuePrimaryKey:{value:function(R,M){D.continuePrimaryKey(xi(R,r.MAX_KEY,_),M)}},primaryKey:{get:function(){return D.primaryKey}},key:{get:function(){var R=D.key;return C===1?R[0]:R.slice(0,C)}},value:{get:function(){return D.value}}})}}})}})}};function ra(r,o,u,c){return u=u||{},c=c||"",l(r).forEach(function(f){var h,p,v;E(o,f)?(h=r[f],p=o[f],typeof h=="object"&&typeof p=="object"&&h&&p?(v=en(h))!==en(p)?u[c+f]=o[f]:v==="Object"?ra(h,p,u,c+f+"."):h!==p&&(u[c+f]=o[f]):h!==p&&(u[c+f]=o[f])):u[c+f]=void 0}),l(o).forEach(function(f){E(r,f)||(u[c+f]=o[f])}),u}function ia(r,o){return o.type==="delete"?o.keys:o.keys||o.values.map(r.extractKey)}var Ad={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(r){return i(i({},r),{table:function(o){var u=r.table(o),c=u.schema.primaryKey;return i(i({},u),{mutate:function(f){var h=F.trans,p=h.table(o).hook,v=p.deleting,w=p.creating,b=p.updating;switch(f.type){case"add":if(w.fire===ce)break;return h._promise("readwrite",function(){return x(f)},!0);case"put":if(w.fire===ce&&b.fire===ce)break;return h._promise("readwrite",function(){return x(f)},!0);case"delete":if(v.fire===ce)break;return h._promise("readwrite",function(){return x(f)},!0);case"deleteRange":if(v.fire===ce)break;return h._promise("readwrite",function(){return function y(A,_,O){return u.query({trans:A,values:!1,query:{index:c,range:_},limit:O}).then(function(C){var S=C.result;return x({type:"delete",keys:S,trans:A}).then(function(D){return 0<D.numFailures?Promise.reject(D.failures[0]):S.length<O?{failures:[],numFailures:0,lastResult:void 0}:y(A,i(i({},_),{lower:S[S.length-1],lowerOpen:!0}),O)})})}(f.trans,f.range,1e4)},!0)}return u.mutate(f);function x(y){var A,_,O,C=F.trans,S=y.keys||ia(c,y);if(!S)throw new Error("Keys missing");return(y=y.type==="add"||y.type==="put"?i(i({},y),{keys:S}):i({},y)).type!=="delete"&&(y.values=a([],y.values)),y.keys&&(y.keys=a([],y.keys)),A=u,O=S,((_=y).type==="add"?Promise.resolve([]):A.getMany({trans:_.trans,keys:O,cache:"immutable"})).then(function(D){var R=S.map(function(M,k){var $,U,V,W=D[k],q={onerror:null,onsuccess:null};return y.type==="delete"?v.fire.call(q,M,W,C):y.type==="add"||W===void 0?($=w.fire.call(q,M,y.values[k],C),M==null&&$!=null&&(y.keys[k]=M=$,c.outbound||Pe(y.values[k],c.keyPath,M))):($=ra(W,y.values[k]),(U=b.fire.call(q,$,M,W,C))&&(V=y.values[k],Object.keys(U).forEach(function(B){E(V,B)?V[B]=U[B]:Pe(V,B,U[B])}))),q});return u.mutate(y).then(function(M){for(var k=M.failures,$=M.results,U=M.numFailures,M=M.lastResult,V=0;V<S.length;++V){var W=($||S)[V],q=R[V];W==null?q.onerror&&q.onerror(k[V]):q.onsuccess&&q.onsuccess(y.type==="put"&&D[V]?y.values[V]:W)}return{failures:k,results:$,numFailures:U,lastResult:M}}).catch(function(M){return R.forEach(function(k){return k.onerror&&k.onerror(M)}),Promise.reject(M)})})}}})}})}};function su(r,o,u){try{if(!o||o.keys.length<r.length)return null;for(var c=[],f=0,h=0;f<o.keys.length&&h<r.length;++f)le(o.keys[f],r[h])===0&&(c.push(u?Ot(o.values[f]):o.values[f]),++h);return c.length===r.length?c:null}catch{return null}}var Cd={stack:"dbcore",level:-1,create:function(r){return{table:function(o){var u=r.table(o);return i(i({},u),{getMany:function(c){if(!c.cache)return u.getMany(c);var f=su(c.keys,c.trans._cache,c.cache==="clone");return f?N.resolve(f):u.getMany(c).then(function(h){return c.trans._cache={keys:c.keys,values:c.cache==="clone"?Ot(h):h},h})},mutate:function(c){return c.type!=="add"&&(c.trans._cache=null),u.mutate(c)}})}}}};function uu(r,o){return r.trans.mode==="readonly"&&!!r.subscr&&!r.trans.explicit&&r.trans.db._options.cache!=="disabled"&&!o.schema.primaryKey.outbound}function cu(r,o){switch(r){case"query":return o.values&&!o.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Pd={stack:"dbcore",level:0,name:"Observability",create:function(r){var o=r.schema.name,u=new $e(r.MIN_KEY,r.MAX_KEY);return i(i({},r),{transaction:function(c,f,h){if(F.subscr&&f!=="readonly")throw new Q.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(F.querier));return r.transaction(c,f,h)},table:function(c){var f=r.table(c),h=f.schema,p=h.primaryKey,y=h.indexes,v=p.extractKey,w=p.outbound,b=p.autoIncrement&&y.filter(function(_){return _.compound&&_.keyPath.includes(p.keyPath)}),x=i(i({},f),{mutate:function(_){function O(B){return B="idb://".concat(o,"/").concat(c,"/").concat(B),M[B]||(M[B]=new $e)}var C,S,D,R=_.trans,M=_.mutatedParts||(_.mutatedParts={}),k=O(""),$=O(":dels"),U=_.type,q=_.type==="deleteRange"?[_.range]:_.type==="delete"?[_.keys]:_.values.length<50?[ia(p,_).filter(function(B){return B}),_.values]:[],V=q[0],W=q[1],q=_.trans._cache;return d(V)?(k.addKeys(V),(q=U==="delete"||V.length===W.length?su(V,q):null)||$.addKeys(V),(q||W)&&(C=O,S=q,D=W,h.indexes.forEach(function(B){var Z=C(B.name||"");function te(ie){return ie!=null?B.extractKey(ie):null}function ae(ie){return B.multiEntry&&d(ie)?ie.forEach(function(dt){return Z.addKey(dt)}):Z.addKey(ie)}(S||D).forEach(function(ie,ke){var oe=S&&te(S[ke]),ke=D&&te(D[ke]);le(oe,ke)!==0&&(oe!=null&&ae(oe),ke!=null&&ae(ke))})}))):V?(W={from:V.lower,to:V.upper},$.add(W),k.add(W)):(k.add(u),$.add(u),h.indexes.forEach(function(B){return O(B.name).add(u)})),f.mutate(_).then(function(B){return!V||_.type!=="add"&&_.type!=="put"||(k.addKeys(B.results),b&&b.forEach(function(Z){var te=_.values.map(function(ie){return Z.extractKey(ie)}),ae=Z.keyPath.findIndex(function(ie){return ie===p.keyPath});B.results.forEach(function(ie){return te[ae]=ie}),O(Z.name).addKeys(te)})),R.mutatedParts=Si(R.mutatedParts||{},M),B})}}),y=function(O){var C=O.query,O=C.index,C=C.range;return[O,new $e((O=C.lower)!==null&&O!==void 0?O:r.MIN_KEY,(C=C.upper)!==null&&C!==void 0?C:r.MAX_KEY)]},A={get:function(_){return[p,new $e(_.key)]},getMany:function(_){return[p,new $e().addKeys(_.keys)]},count:y,query:y,openCursor:y};return l(A).forEach(function(_){x[_]=function(O){var C=F.subscr,S=!!C,D=uu(F,f)&&cu(_,O)?O.obsSet={}:C;if(S){var R=function(W){return W="idb://".concat(o,"/").concat(c,"/").concat(W),D[W]||(D[W]=new $e)},M=R(""),k=R(":dels"),C=A[_](O),S=C[0],C=C[1];if((_==="query"&&S.isPrimaryKey&&!O.values?k:R(S.name||"")).add(C),!S.isPrimaryKey){if(_!=="count"){var $=_==="query"&&w&&O.values&&f.query(i(i({},O),{values:!1}));return f[_].apply(this,arguments).then(function(W){if(_==="query"){if(w&&O.values)return $.then(function(te){return te=te.result,M.addKeys(te),W});var q=O.values?W.result.map(v):W.result;(O.values?M:k).addKeys(q)}else if(_==="openCursor"){var B=W,Z=O.values;return B&&Object.create(B,{key:{get:function(){return k.addKey(B.primaryKey),B.key}},primaryKey:{get:function(){var te=B.primaryKey;return k.addKey(te),te}},value:{get:function(){return Z&&M.addKey(B.primaryKey),B.value}}})}return W})}k.add(u)}}return f[_].apply(this,arguments)}}),x}})}};function lu(r,o,u){if(u.numFailures===0)return o;if(o.type==="deleteRange")return null;var c=o.keys?o.keys.length:"values"in o&&o.values?o.values.length:1;return u.numFailures===c?null:(o=i({},o),d(o.keys)&&(o.keys=o.keys.filter(function(f,h){return!(h in u.failures)})),"values"in o&&d(o.values)&&(o.values=o.values.filter(function(f,h){return!(h in u.failures)})),o)}function oa(r,o){return u=r,((c=o).lower===void 0||(c.lowerOpen?0<le(u,c.lower):0<=le(u,c.lower)))&&(r=r,(o=o).upper===void 0||(o.upperOpen?le(r,o.upper)<0:le(r,o.upper)<=0));var u,c}function fu(r,o,A,c,f,h){if(!A||A.length===0)return r;var p=o.query.index,v=p.multiEntry,w=o.query.range,b=c.schema.primaryKey.extractKey,x=p.extractKey,y=(p.lowLevelIndex||p).extractKey,A=A.reduce(function(_,O){var C=_,S=[];if(O.type==="add"||O.type==="put")for(var D=new $e,R=O.values.length-1;0<=R;--R){var M,k=O.values[R],$=b(k);D.hasKey($)||(M=x(k),(v&&d(M)?M.some(function(q){return oa(q,w)}):oa(M,w))&&(D.addKey($),S.push(k)))}switch(O.type){case"add":C=_.concat(o.values?S:S.map(function(B){return b(B)}));break;case"put":var U=new $e().addKeys(O.values.map(function(B){return b(B)})),C=_.filter(function(B){return!U.hasKey(o.values?b(B):B)}).concat(o.values?S:S.map(function(B){return b(B)}));break;case"delete":var V=new $e().addKeys(O.keys);C=_.filter(function(B){return!V.hasKey(o.values?b(B):B)});break;case"deleteRange":var W=O.range;C=_.filter(function(B){return!oa(b(B),W)})}return C},r);return A===r?r:(A.sort(function(_,O){return le(y(_),y(O))||le(b(_),b(O))}),o.limit&&o.limit<1/0&&(A.length>o.limit?A.length=o.limit:r.length===o.limit&&A.length<o.limit&&(f.dirty=!0)),h?Object.freeze(A):A)}function hu(r,o){return le(r.lower,o.lower)===0&&le(r.upper,o.upper)===0&&!!r.lowerOpen==!!o.lowerOpen&&!!r.upperOpen==!!o.upperOpen}function Td(r,o){return function(u,c,f,h){if(u===void 0)return c!==void 0?-1:0;if(c===void 0)return 1;if((c=le(u,c))===0){if(f&&h)return 0;if(f)return 1;if(h)return-1}return c}(r.lower,o.lower,r.lowerOpen,o.lowerOpen)<=0&&0<=function(u,c,f,h){if(u===void 0)return c!==void 0?1:0;if(c===void 0)return-1;if((c=le(u,c))===0){if(f&&h)return 0;if(f)return-1;if(h)return 1}return c}(r.upper,o.upper,r.upperOpen,o.upperOpen)}function Dd(r,o,u,c){r.subscribers.add(u),c.addEventListener("abort",function(){var f,h;r.subscribers.delete(u),r.subscribers.size===0&&(f=r,h=o,setTimeout(function(){f.subscribers.size===0&&vt(h,f)},3e3))})}var Id={stack:"dbcore",level:0,name:"Cache",create:function(r){var o=r.schema.name;return i(i({},r),{transaction:function(u,c,f){var h,p,v=r.transaction(u,c,f);return c==="readwrite"&&(p=(h=new AbortController).signal,f=function(w){return function(){if(h.abort(),c==="readwrite"){for(var b=new Set,x=0,y=u;x<y.length;x++){var A=y[x],_=cn["idb://".concat(o,"/").concat(A)];if(_){var O=r.table(A),C=_.optimisticOps.filter(function(Z){return Z.trans===v});if(v._explicit&&w&&v.mutatedParts)for(var S=0,D=Object.values(_.queries.query);S<D.length;S++)for(var R=0,M=(U=D[S]).slice();R<M.length;R++)Xo((V=M[R]).obsSet,v.mutatedParts)&&(vt(U,V),V.subscribers.forEach(function(Z){return b.add(Z)}));else if(0<C.length){_.optimisticOps=_.optimisticOps.filter(function(Z){return Z.trans!==v});for(var k=0,$=Object.values(_.queries.query);k<$.length;k++)for(var U,V,W,q=0,B=(U=$[k]).slice();q<B.length;q++)(V=B[q]).res!=null&&v.mutatedParts&&(w&&!V.dirty?(W=Object.isFrozen(V.res),W=fu(V.res,V.req,C,O,V,W),V.dirty?(vt(U,V),V.subscribers.forEach(function(Z){return b.add(Z)})):W!==V.res&&(V.res=W,V.promise=N.resolve({result:W}))):(V.dirty&&vt(U,V),V.subscribers.forEach(function(Z){return b.add(Z)})))}}}b.forEach(function(Z){return Z()})}}},v.addEventListener("abort",f(!1),{signal:p}),v.addEventListener("error",f(!1),{signal:p}),v.addEventListener("complete",f(!0),{signal:p})),v},table:function(u){var c=r.table(u),f=c.schema.primaryKey;return i(i({},c),{mutate:function(h){var p=F.trans;if(f.outbound||p.db._options.cache==="disabled"||p.explicit)return c.mutate(h);var v=cn["idb://".concat(o,"/").concat(u)];return v?(p=c.mutate(h),h.type!=="add"&&h.type!=="put"||!(50<=h.values.length||ia(f,h).some(function(w){return w==null}))?(v.optimisticOps.push(h),h.mutatedParts&&Oi(h.mutatedParts),p.then(function(w){0<w.numFailures&&(vt(v.optimisticOps,h),(w=lu(0,h,w))&&v.optimisticOps.push(w),h.mutatedParts&&Oi(h.mutatedParts))}),p.catch(function(){vt(v.optimisticOps,h),h.mutatedParts&&Oi(h.mutatedParts)})):p.then(function(w){var b=lu(0,i(i({},h),{values:h.values.map(function(_,y){var A,_=(A=f.keyPath)!==null&&A!==void 0&&A.includes(".")?Ot(_):i({},_);return Pe(_,f.keyPath,w.results[y]),_})}),w);v.optimisticOps.push(b),queueMicrotask(function(){return h.mutatedParts&&Oi(h.mutatedParts)})}),p):c.mutate(h)},query:function(h){if(!uu(F,c)||!cu("query",h))return c.query(h);var p=((b=F.trans)===null||b===void 0?void 0:b.db._options.cache)==="immutable",y=F,v=y.requery,w=y.signal,b=function(O,C,S,D){var R=cn["idb://".concat(O,"/").concat(C)];if(!R)return[];if(!(C=R.queries[S]))return[null,!1,R,null];var M=C[(D.query?D.query.index.name:null)||""];if(!M)return[null,!1,R,null];switch(S){case"query":var k=M.find(function($){return $.req.limit===D.limit&&$.req.values===D.values&&hu($.req.query.range,D.query.range)});return k?[k,!0,R,M]:[M.find(function($){return("limit"in $.req?$.req.limit:1/0)>=D.limit&&(!D.values||$.req.values)&&Td($.req.query.range,D.query.range)}),!1,R,M];case"count":return k=M.find(function($){return hu($.req.query.range,D.query.range)}),[k,!!k,R,M]}}(o,u,"query",h),x=b[0],y=b[1],A=b[2],_=b[3];return x&&y?x.obsSet=h.obsSet:(y=c.query(h).then(function(O){var C=O.result;if(x&&(x.res=C),p){for(var S=0,D=C.length;S<D;++S)Object.freeze(C[S]);Object.freeze(C)}else O.result=Ot(C);return O}).catch(function(O){return _&&x&&vt(_,x),Promise.reject(O)}),x={obsSet:h.obsSet,promise:y,subscribers:new Set,type:"query",req:h,dirty:!1},_?_.push(x):(_=[x],(A=A||(cn["idb://".concat(o,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[h.query.index.name||""]=_)),Dd(x,_,v,w),x.promise.then(function(O){return{result:fu(O.result,h,A==null?void 0:A.optimisticOps,c,x,p)}})}})}})}};function Ai(r,o){return new Proxy(r,{get:function(u,c,f){return c==="db"?o:Reflect.get(u,c,f)}})}var Tt=(Ae.prototype.version=function(r){if(isNaN(r)||r<.1)throw new Q.Type("Given version is not a positive number");if(r=Math.round(10*r)/10,this.idbdb||this._state.isBeingOpened)throw new Q.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,r);var o=this._versions,u=o.filter(function(c){return c._cfg.version===r})[0];return u||(u=new this.Version(r),o.push(u),o.sort(_d),u.stores({}),this._state.autoSchema=!1,u)},Ae.prototype._whenReady=function(r){var o=this;return this.idbdb&&(this._state.openComplete||F.letThrough||this._vip)?r():new N(function(u,c){if(o._state.openComplete)return c(new Q.DatabaseClosed(o._state.dbOpenError));if(!o._state.isBeingOpened){if(!o._state.autoOpen)return void c(new Q.DatabaseClosed);o.open().catch(ce)}o._state.dbReadyPromise.then(u,c)}).then(r)},Ae.prototype.use=function(r){var o=r.stack,u=r.create,c=r.level,f=r.name;return f&&this.unuse({stack:o,name:f}),r=this._middlewares[o]||(this._middlewares[o]=[]),r.push({stack:o,create:u,level:c??10,name:f}),r.sort(function(h,p){return h.level-p.level}),this},Ae.prototype.unuse=function(r){var o=r.stack,u=r.name,c=r.create;return o&&this._middlewares[o]&&(this._middlewares[o]=this._middlewares[o].filter(function(f){return c?f.create!==c:!!u&&f.name!==u})),this},Ae.prototype.open=function(){var r=this;return an(K,function(){return Od(r)})},Ae.prototype._close=function(){var r=this._state,o=An.indexOf(this);if(0<=o&&An.splice(o,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}r.isBeingOpened||(r.dbReadyPromise=new N(function(u){r.dbReadyResolve=u}),r.openCanceller=new N(function(u,c){r.cancelOpen=c}))},Ae.prototype.close=function(u){var o=(u===void 0?{disableAutoOpen:!0}:u).disableAutoOpen,u=this._state;o?(u.isBeingOpened&&u.cancelOpen(new Q.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new Q.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},Ae.prototype.delete=function(r){var o=this;r===void 0&&(r={disableAutoOpen:!0});var u=0<arguments.length&&typeof arguments[0]!="object",c=this._state;return new N(function(f,h){function p(){o.close(r);var v=o._deps.indexedDB.deleteDatabase(o.name);v.onsuccess=_e(function(){var w,b,x;w=o._deps,b=o.name,x=w.indexedDB,w=w.IDBKeyRange,Yo(x)||b===fi||Go(x,w).delete(b).catch(ce),f()}),v.onerror=yt(h),v.onblocked=o._fireOnBlocked}if(u)throw new Q.InvalidArgument("Invalid closeOptions argument to db.delete()");c.isBeingOpened?c.dbReadyPromise.then(p):p()})},Ae.prototype.backendDB=function(){return this.idbdb},Ae.prototype.isOpen=function(){return this.idbdb!==null},Ae.prototype.hasBeenClosed=function(){var r=this._state.dbOpenError;return r&&r.name==="DatabaseClosed"},Ae.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Ae.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Ae.prototype,"tables",{get:function(){var r=this;return l(this._allTables).map(function(o){return r._allTables[o]})},enumerable:!1,configurable:!0}),Ae.prototype.transaction=function(){var r=(function(o,u,c){var f=arguments.length;if(f<2)throw new Q.InvalidArgument("Too few arguments");for(var h=new Array(f-1);--f;)h[f-1]=arguments[f];return c=h.pop(),[o,Gr(h),c]}).apply(this,arguments);return this._transaction.apply(this,r)},Ae.prototype._transaction=function(r,o,u){var c=this,f=F.trans;f&&f.db===this&&r.indexOf("!")===-1||(f=null);var h,p,v=r.indexOf("?")!==-1;r=r.replace("!","").replace("?","");try{if(p=o.map(function(b){if(b=b instanceof c.Table?b.name:b,typeof b!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return b}),r=="r"||r===jo)h=jo;else{if(r!="rw"&&r!=Lo)throw new Q.InvalidArgument("Invalid transaction mode: "+r);h=Lo}if(f){if(f.mode===jo&&h===Lo){if(!v)throw new Q.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");f=null}f&&p.forEach(function(b){if(f&&f.storeNames.indexOf(b)===-1){if(!v)throw new Q.SubTransaction("Table "+b+" not included in parent transaction.");f=null}}),v&&f&&!f.active&&(f=null)}}catch(b){return f?f._promise(null,function(x,y){y(b)}):xe(b)}var w=(function b(x,y,A,_,O){return N.resolve().then(function(){var C=F.transless||F,S=x._createTransaction(y,A,x._dbSchema,_);if(S.explicit=!0,C={trans:S,transless:C},_)S.idbtrans=_.idbtrans;else try{S.create(),S.idbtrans._explicit=!0,x._state.PR1398_maxLoop=3}catch(M){return M.name===Gn.InvalidState&&x.isOpen()&&0<--x._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),x.close({disableAutoOpen:!1}),x.open().then(function(){return b(x,y,A,null,O)})):xe(M)}var D,R=Sn(O);return R&&xn(),C=N.follow(function(){var M;(D=O.call(S,S))&&(R?(M=$t.bind(null,null),D.then(M,M)):typeof D.next=="function"&&typeof D.throw=="function"&&(D=na(D)))},C),(D&&typeof D.then=="function"?N.resolve(D).then(function(M){return S.active?M:xe(new Q.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):C.then(function(){return D})).then(function(M){return _&&S._resolve(),S._completion.then(function(){return M})}).catch(function(M){return S._reject(M),xe(M)})})}).bind(null,this,h,p,f,u);return f?f._promise(h,w,"lock"):F.trans?an(F.transless,function(){return c._whenReady(w)}):this._whenReady(w)},Ae.prototype.table=function(r){if(!E(this._allTables,r))throw new Q.InvalidTable("Table ".concat(r," does not exist"));return this._allTables[r]},Ae);function Ae(r,o){var u=this;this._middlewares={},this.verno=0;var c=Ae.dependencies;this._options=o=i({addons:Ae.addons,autoOpen:!0,indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange,cache:"cloned"},o),this._deps={indexedDB:o.indexedDB,IDBKeyRange:o.IDBKeyRange},c=o.addons,this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;var f,h,p,v,w,b={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:ce,dbReadyPromise:null,cancelOpen:ce,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:o.autoOpen};b.dbReadyPromise=new N(function(y){b.dbReadyResolve=y}),b.openCanceller=new N(function(y,A){b.cancelOpen=A}),this._state=b,this.name=r,this.on=Xn(this,"populate","blocked","versionchange","close",{ready:[On,ce]}),this.on.ready.subscribe=gt(this.on.ready.subscribe,function(y){return function(A,_){Ae.vip(function(){var O,C=u._state;C.openComplete?(C.dbOpenError||N.resolve().then(A),_&&y(A)):C.onReadyBeingFired?(C.onReadyBeingFired.push(A),_&&y(A)):(y(A),O=u,_||y(function S(){O.on.ready.unsubscribe(A),O.on.ready.unsubscribe(S)}))})}}),this.Collection=(f=this,Zn(dd.prototype,function(D,S){this.db=f;var _=Ws,O=null;if(S)try{_=S()}catch(R){O=R}var C=D._ctx,S=C.table,D=S.hook.reading.fire;this._ctx={table:S,index:C.index,isPrimKey:!C.index||S.schema.primKey.keyPath&&C.index===S.schema.primKey.name,range:_,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:O,or:C.or,valueMapper:D!==jt?D:null}})),this.Table=(h=this,Zn(zs.prototype,function(y,A,_){this.db=h,this._tx=_,this.name=y,this.schema=A,this.hook=h._allTables[y]?h._allTables[y].hook:Xn(null,{creating:[ei,ce],reading:[Mo,jt],updating:[ni,ce],deleting:[ti,ce]})})),this.Transaction=(p=this,Zn(vd.prototype,function(y,A,_,O,C){var S=this;this.db=p,this.mode=y,this.storeNames=A,this.schema=_,this.chromeTransactionDurability=O,this.idbtrans=null,this.on=Xn(this,"complete","error","abort"),this.parent=C||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 N(function(D,R){S._resolve=D,S._reject=R}),this._completion.then(function(){S.active=!1,S.on.complete.fire()},function(D){var R=S.active;return S.active=!1,S.on.error.fire(D),S.parent?S.parent._reject(D):R&&S.idbtrans&&S.idbtrans.abort(),xe(D)})})),this.Version=(v=this,Zn(Sd.prototype,function(y){this.db=v,this._cfg={version:y,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(w=this,Zn(Xs.prototype,function(y,A,_){if(this.db=w,this._ctx={table:y,index:A===":id"?null:A,or:_},this._cmp=this._ascending=le,this._descending=function(O,C){return le(C,O)},this._max=function(O,C){return 0<le(O,C)?O:C},this._min=function(O,C){return le(O,C)<0?O:C},this._IDBKeyRange=w._deps.IDBKeyRange,!this._IDBKeyRange)throw new Q.MissingAPI})),this.on("versionchange",function(y){0<y.newVersion?console.warn("Another connection wants to upgrade database '".concat(u.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(u.name,"'. Closing db now to resume the delete request.")),u.close({disableAutoOpen:!1})}),this.on("blocked",function(y){!y.newVersion||y.newVersion<y.oldVersion?console.warn("Dexie.delete('".concat(u.name,"') was blocked")):console.warn("Upgrade '".concat(u.name,"' blocked by other connection holding version ").concat(y.oldVersion/10))}),this._maxKey=rr(o.IDBKeyRange),this._createTransaction=function(y,A,_,O){return new u.Transaction(y,A,_,u._options.chromeTransactionDurability,O)},this._fireOnBlocked=function(y){u.on("blocked").fire(y),An.filter(function(A){return A.name===u.name&&A!==u&&!A._state.vcFired}).map(function(A){return A.on("versionchange").fire(y)})},this.use(Cd),this.use(Id),this.use(Pd),this.use(xd),this.use(Ad);var x=new Proxy(this,{get:function(y,A,_){if(A==="_vip")return!0;if(A==="table")return function(C){return Ai(u.table(C),x)};var O=Reflect.get(y,A,_);return O instanceof zs?Ai(O,x):A==="tables"?O.map(function(C){return Ai(C,x)}):A==="_createTransaction"?function(){return Ai(O.apply(this,arguments),x)}:O}});this.vip=x,c.forEach(function(y){return y(u)})}var Ci,ut=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Nd=(aa.prototype.subscribe=function(r,o,u){return this._subscribe(r&&typeof r!="function"?r:{next:r,error:o,complete:u})},aa.prototype[ut]=function(){return this},aa);function aa(r){this._subscribe=r}try{Ci={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{Ci={indexedDB:null,IDBKeyRange:null}}function du(r){var o,u=!1,c=new Nd(function(f){var h=Sn(r),p,v=!1,w={},b={},x={get closed(){return v},unsubscribe:function(){v||(v=!0,p&&p.abort(),y&&Wt.storagemutated.unsubscribe(_))}};f.start&&f.start(x);var y=!1,A=function(){return ko(O)},_=function(C){Si(w,C),Xo(b,w)&&A()},O=function(){var C,S,D;!v&&Ci.indexedDB&&(w={},C={},p&&p.abort(),p=new AbortController,D=function(R){var M=At();try{h&&xn();var k=Bt(r,R);return k=h?k.finally($t):k}finally{M&&Ft()}}(S={subscr:C,signal:p.signal,requery:A,querier:r,trans:null}),Promise.resolve(D).then(function(R){u=!0,o=R,v||S.signal.aborted||(w={},function(M){for(var k in M)if(E(M,k))return;return 1}(b=C)||y||(Wt(nr,_),y=!0),ko(function(){return!v&&f.next&&f.next(R)}))},function(R){u=!1,["DatabaseClosedError","AbortError"].includes(R==null?void 0:R.name)||v||ko(function(){v||f.error&&f.error(R)})}))};return setTimeout(A,0),x});return c.hasValue=function(){return u},c.getValue=function(){return o},c}var ln=Tt;function sa(r){var o=Ut;try{Ut=!0,Wt.storagemutated.fire(r),ta(r,!0)}finally{Ut=o}}L(ln,i(i({},tn),{delete:function(r){return new ln(r,{addons:[]}).delete()},exists:function(r){return new ln(r,{addons:[]}).open().then(function(o){return o.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(r){try{return o=ln.dependencies,u=o.indexedDB,o=o.IDBKeyRange,(Yo(u)?Promise.resolve(u.databases()).then(function(c){return c.map(function(f){return f.name}).filter(function(f){return f!==fi})}):Go(u,o).toCollection().primaryKeys()).then(r)}catch{return xe(new Q.MissingAPI)}var o,u},defineClass:function(){return function(r){m(this,r)}},ignoreTransaction:function(r){return F.trans?an(F.transless,r):r()},vip:Qo,async:function(r){return function(){try{var o=na(r.apply(this,arguments));return o&&typeof o.then=="function"?o:N.resolve(o)}catch(u){return xe(u)}}},spawn:function(r,o,u){try{var c=na(r.apply(u,o||[]));return c&&typeof c.then=="function"?c:N.resolve(c)}catch(f){return xe(f)}},currentTransaction:{get:function(){return F.trans||null}},waitFor:function(r,o){return o=N.resolve(typeof r=="function"?ln.ignoreTransaction(r):r).timeout(o||6e4),F.trans?F.trans.waitFor(o):o},Promise:N,debug:{get:function(){return ze},set:function(r){ii(r)}},derive:se,extend:m,props:L,override:gt,Events:Xn,on:Wt,liveQuery:du,extendObservabilitySet:Si,getByKeyPath:Be,setByKeyPath:Pe,delByKeyPath:function(r,o){typeof o=="string"?Pe(r,o,void 0):"length"in o&&[].map.call(o,function(u){Pe(r,u,void 0)})},shallowClone:zr,deepClone:Ot,getObjectDiff:ra,cmp:le,asap:Fe,minKey:-1/0,addons:[],connections:An,errnames:Gn,dependencies:Ci,cache:cn,semVer:"4.0.8",version:"4.0.8".split(".").map(function(r){return parseInt(r)}).reduce(function(r,o,u){return r+o/Math.pow(10,2*u)})})),ln.maxKey=rr(ln.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Wt(nr,function(r){Ut||(r=new CustomEvent(Vo,{detail:r}),Ut=!0,dispatchEvent(r),Ut=!1)}),addEventListener(Vo,function(r){r=r.detail,Ut||sa(r)}));var Tn,Ut=!1,pu=function(){};return typeof BroadcastChannel<"u"&&((pu=function(){(Tn=new BroadcastChannel(Vo)).onmessage=function(r){return r.data&&sa(r.data)}})(),typeof Tn.unref=="function"&&Tn.unref(),Wt(nr,function(r){Ut||Tn.postMessage(r)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(r){if(!Tt.disableBfCache&&r.persisted){ze&&console.debug("Dexie: handling persisted pagehide"),Tn!=null&&Tn.close();for(var o=0,u=An;o<u.length;o++)u[o].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(r){!Tt.disableBfCache&&r.persisted&&(ze&&console.debug("Dexie: handling persisted pageshow"),pu(),sa({all:new $e(-1/0,[[]])}))})),N.rejectionMapper=function(r,o){return!r||r instanceof Ze||r instanceof TypeError||r instanceof SyntaxError||!r.name||!et[r.name]?r:(o=new et[r.name](o||r.message,r),"stack"in r&&X(o,"stack",{get:function(){return this.inner.stack}}),o)},ii(ze),i(Tt,Object.freeze({__proto__:null,Dexie:Tt,liveQuery:du,Entity:Us,cmp:le,PropModSymbol:Pt,PropModification:er,replacePrefix:function(r,o){return new er({replacePrefix:[r,o]})},add:function(r){return new er({add:r})},remove:function(r){return new er({remove:r})},default:Tt,RangeSet:$e,mergeRanges:ar,rangesOverlap:ru}),{default:Tt}),Tt})})($a);var al=$a.exports,Vi=ol(al);const Va=Symbol.for("Dexie"),Ki=globalThis[Va]||(globalThis[Va]=Vi);if(Vi.semVer!==Ki.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${Vi.semVer} and ${Ki.semVer}`);class sl extends Ki{constructor(t){super("pages_"+t),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}/**
|
|
9
|
-
* @vue/shared v3.5.12
|
|
10
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
11
|
-
* @license MIT
|
|
12
|
-
**//*! #__NO_SIDE_EFFECTS__ */function ul(e){const t=Object.create(null);for(const n of e.split(","))t[n]=1;return n=>n in t}const ot=process.env.NODE_ENV!=="production"?Object.freeze({}):{};process.env.NODE_ENV!=="production"&&Object.freeze([]);const Ht=()=>{},cl=e=>e.charCodeAt(0)===111&&e.charCodeAt(1)===110&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),Ye=Object.assign,ll=Object.prototype.hasOwnProperty,Ce=(e,t)=>ll.call(e,t),ye=Array.isArray,dn=e=>mr(e)==="[object Map]",fl=e=>mr(e)==="[object Set]",Me=e=>typeof e=="function",ct=e=>typeof e=="string",Fn=e=>typeof e=="symbol",We=e=>e!==null&&typeof e=="object",hl=e=>(We(e)||Me(e))&&Me(e.then)&&Me(e.catch),dl=Object.prototype.toString,mr=e=>dl.call(e),Ka=e=>mr(e).slice(8,-1),pl=e=>mr(e)==="[object Object]",Wi=e=>ct(e)&&e!=="NaN"&&e[0]!=="-"&&""+parseInt(e,10)===e,gl=(e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))})(e=>e.charAt(0).toUpperCase()+e.slice(1)),zt=(e,t)=>!Object.is(e,t),vl=(e,t,n,i=!1)=>{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,writable:i,value:n})};let Wa;const br=()=>Wa||(Wa=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});function Ui(e){if(ye(e)){const t={};for(let n=0;n<e.length;n++){const i=e[n],a=ct(i)?_l(i):Ui(i);if(a)for(const s in a)t[s]=a[s]}return t}else if(ct(e)||We(e))return e}const yl=/;(?![^(]*\))/g,ml=/:([^]+)/,bl=/\/\*[^]*?\*\//g;function _l(e){const t={};return e.replace(bl,"").split(yl).forEach(n=>{if(n){const i=n.split(ml);i.length>1&&(t[i[0].trim()]=i[1].trim())}}),t}function qi(e){let t="";if(ct(e))t=e;else if(ye(e))for(let n=0;n<e.length;n++){const i=qi(e[n]);i&&(t+=i+" ")}else if(We(e))for(const n in e)e[n]&&(t+=n+" ");return t.trim()}/**
|
|
13
|
-
* @vue/reactivity v3.5.12
|
|
14
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
15
|
-
* @license MIT
|
|
16
|
-
**/function Dt(e,...t){console.warn(`[Vue warn] ${e}`,...t)}let he;const Hi=new WeakSet;class wl{constructor(t){this.fn=t,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Hi.has(this)&&(Hi.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||El(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,Ga(this),qa(this);const t=he,n=lt;he=this,lt=!0;try{return this.fn()}finally{process.env.NODE_ENV!=="production"&&he!==this&&Dt("Active effect was not restored correctly - this is likely a Vue internal bug."),Ha(this),he=t,lt=n,this.flags&=-3}}stop(){if(this.flags&1){for(let t=this.deps;t;t=t.nextDep)Qi(t);this.deps=this.depsTail=void 0,Ga(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Hi.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){Yi(this)&&this.run()}get dirty(){return Yi(this)}}let Ua=0,Bn,$n;function El(e,t=!1){if(e.flags|=8,t){e.next=$n,$n=e;return}e.next=Bn,Bn=e}function zi(){Ua++}function Gi(){if(--Ua>0)return;if($n){let t=$n;for($n=void 0;t;){const n=t.next;t.next=void 0,t.flags&=-9,t=n}}let e;for(;Bn;){let t=Bn;for(Bn=void 0;t;){const n=t.next;if(t.next=void 0,t.flags&=-9,t.flags&1)try{t.trigger()}catch(i){e||(e=i)}t=n}}if(e)throw e}function qa(e){for(let t=e.deps;t;t=t.nextDep)t.version=-1,t.prevActiveLink=t.dep.activeLink,t.dep.activeLink=t}function Ha(e){let t,n=e.depsTail,i=n;for(;i;){const a=i.prevDep;i.version===-1?(i===n&&(n=a),Qi(i),Ol(i)):t=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=a}e.deps=t,e.depsTail=n}function Yi(e){for(let t=e.deps;t;t=t.nextDep)if(t.dep.version!==t.version||t.dep.computed&&(Sl(t.dep.computed)||t.dep.version!==t.version))return!0;return!!e._dirty}function Sl(e){if(e.flags&4&&!(e.flags&16)||(e.flags&=-17,e.globalVersion===Er))return;e.globalVersion=Er;const t=e.dep;if(e.flags|=2,t.version>0&&!e.isSSR&&e.deps&&!Yi(e)){e.flags&=-3;return}const n=he,i=lt;he=e,lt=!0;try{qa(e);const a=e.fn(e._value);(t.version===0||zt(a,e._value))&&(e._value=a,t.version++)}catch(a){throw t.version++,a}finally{he=n,lt=i,Ha(e),e.flags&=-3}}function Qi(e,t=!1){const{dep:n,prevSub:i,nextSub:a}=e;if(i&&(i.nextSub=a,e.prevSub=void 0),a&&(a.prevSub=i,e.nextSub=void 0),process.env.NODE_ENV!=="production"&&n.subsHead===e&&(n.subsHead=a),n.subs===e&&(n.subs=i,!i&&n.computed)){n.computed.flags&=-5;for(let s=n.computed.deps;s;s=s.nextDep)Qi(s,!0)}!t&&!--n.sc&&n.map&&n.map.delete(n.key)}function Ol(e){const{prevDep:t,nextDep:n}=e;t&&(t.nextDep=n,e.prevDep=void 0),n&&(n.prevDep=t,e.nextDep=void 0)}let lt=!0;const za=[];function _r(){za.push(lt),lt=!1}function wr(){const e=za.pop();lt=e===void 0?!0:e}function Ga(e){const{cleanup:t}=e;if(e.cleanup=void 0,t){const n=he;he=void 0;try{t()}finally{he=n}}}let Er=0;class xl{constructor(t,n){this.sub=t,this.dep=n,this.version=n.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Al{constructor(t){this.computed=t,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,process.env.NODE_ENV!=="production"&&(this.subsHead=void 0)}track(t){if(!he||!lt||he===this.computed)return;let n=this.activeLink;if(n===void 0||n.sub!==he)n=this.activeLink=new xl(he,this),he.deps?(n.prevDep=he.depsTail,he.depsTail.nextDep=n,he.depsTail=n):he.deps=he.depsTail=n,Ya(n);else if(n.version===-1&&(n.version=this.version,n.nextDep)){const i=n.nextDep;i.prevDep=n.prevDep,n.prevDep&&(n.prevDep.nextDep=i),n.prevDep=he.depsTail,n.nextDep=void 0,he.depsTail.nextDep=n,he.depsTail=n,he.deps===n&&(he.deps=i)}return process.env.NODE_ENV!=="production"&&he.onTrack&&he.onTrack(Ye({effect:he},t)),n}trigger(t){this.version++,Er++,this.notify(t)}notify(t){zi();try{if(process.env.NODE_ENV!=="production")for(let n=this.subsHead;n;n=n.nextSub)n.sub.onTrigger&&!(n.sub.flags&8)&&n.sub.onTrigger(Ye({effect:n.sub},t));for(let n=this.subs;n;n=n.prevSub)n.sub.notify()&&n.sub.dep.notify()}finally{Gi()}}}function Ya(e){if(e.dep.sc++,e.sub.flags&4){const t=e.dep.computed;if(t&&!e.dep.subs){t.flags|=20;for(let i=t.deps;i;i=i.nextDep)Ya(i)}const n=e.dep.subs;n!==e&&(e.prevSub=n,n&&(n.nextSub=e)),process.env.NODE_ENV!=="production"&&e.dep.subsHead===void 0&&(e.dep.subsHead=e),e.dep.subs=e}}const Ji=new WeakMap,Gt=Symbol(process.env.NODE_ENV!=="production"?"Object iterate":""),Xi=Symbol(process.env.NODE_ENV!=="production"?"Map keys iterate":""),Vn=Symbol(process.env.NODE_ENV!=="production"?"Array iterate":"");function Te(e,t,n){if(lt&&he){let i=Ji.get(e);i||Ji.set(e,i=new Map);let a=i.get(n);a||(i.set(n,a=new Al),a.map=i,a.key=n),process.env.NODE_ENV!=="production"?a.track({target:e,type:t,key:n}):a.track()}}function It(e,t,n,i,a,s){const l=Ji.get(e);if(!l){Er++;return}const d=m=>{m&&(process.env.NODE_ENV!=="production"?m.trigger({target:e,type:t,key:n,newValue:i,oldValue:a,oldTarget:s}):m.trigger())};if(zi(),t==="clear")l.forEach(d);else{const m=ye(e),g=m&&Wi(n);if(m&&n==="length"){const T=Number(i);l.forEach((E,L)=>{(L==="length"||L===Vn||!Fn(L)&&L>=T)&&d(E)})}else switch((n!==void 0||l.has(void 0))&&d(l.get(n)),g&&d(l.get(Vn)),t){case"add":m?g&&d(l.get("length")):(d(l.get(Gt)),dn(e)&&d(l.get(Xi)));break;case"delete":m||(d(l.get(Gt)),dn(e)&&d(l.get(Xi)));break;case"set":dn(e)&&d(l.get(Gt));break}}Gi()}function pn(e){const t=ue(e);return t===e?t:(Te(t,"iterate",Vn),Qe(e)?t:t.map(Je))}function Zi(e){return Te(e=ue(e),"iterate",Vn),e}const Cl={__proto__:null,[Symbol.iterator](){return eo(this,Symbol.iterator,Je)},concat(...e){return pn(this).concat(...e.map(t=>ye(t)?pn(t):t))},entries(){return eo(this,"entries",e=>(e[1]=Je(e[1]),e))},every(e,t){return wt(this,"every",e,t,void 0,arguments)},filter(e,t){return wt(this,"filter",e,t,n=>n.map(Je),arguments)},find(e,t){return wt(this,"find",e,t,Je,arguments)},findIndex(e,t){return wt(this,"findIndex",e,t,void 0,arguments)},findLast(e,t){return wt(this,"findLast",e,t,Je,arguments)},findLastIndex(e,t){return wt(this,"findLastIndex",e,t,void 0,arguments)},forEach(e,t){return wt(this,"forEach",e,t,void 0,arguments)},includes(...e){return to(this,"includes",e)},indexOf(...e){return to(this,"indexOf",e)},join(e){return pn(this).join(e)},lastIndexOf(...e){return to(this,"lastIndexOf",e)},map(e,t){return wt(this,"map",e,t,void 0,arguments)},pop(){return Kn(this,"pop")},push(...e){return Kn(this,"push",e)},reduce(e,...t){return Qa(this,"reduce",e,t)},reduceRight(e,...t){return Qa(this,"reduceRight",e,t)},shift(){return Kn(this,"shift")},some(e,t){return wt(this,"some",e,t,void 0,arguments)},splice(...e){return Kn(this,"splice",e)},toReversed(){return pn(this).toReversed()},toSorted(e){return pn(this).toSorted(e)},toSpliced(...e){return pn(this).toSpliced(...e)},unshift(...e){return Kn(this,"unshift",e)},values(){return eo(this,"values",Je)}};function eo(e,t,n){const i=Zi(e),a=i[t]();return i!==e&&!Qe(e)&&(a._next=a.next,a.next=()=>{const s=a._next();return s.value&&(s.value=n(s.value)),s}),a}const Pl=Array.prototype;function wt(e,t,n,i,a,s){const l=Zi(e),d=l!==e&&!Qe(e),m=l[t];if(m!==Pl[t]){const E=m.apply(e,s);return d?Je(E):E}let g=n;l!==e&&(d?g=function(E,L){return n.call(this,Je(E),L,e)}:n.length>2&&(g=function(E,L){return n.call(this,E,L,e)}));const T=m.call(l,g,i);return d&&a?a(T):T}function Qa(e,t,n,i){const a=Zi(e);let s=n;return a!==e&&(Qe(e)?n.length>3&&(s=function(l,d,m){return n.call(this,l,d,m,e)}):s=function(l,d,m){return n.call(this,l,Je(d),m,e)}),a[t](s,...i)}function to(e,t,n){const i=ue(e);Te(i,"iterate",Vn);const a=i[t](...n);return(a===-1||a===!1)&&Ar(n[0])?(n[0]=ue(n[0]),i[t](...n)):a}function Kn(e,t,n=[]){_r(),zi();const i=ue(e)[t].apply(e,n);return Gi(),wr(),i}const Tl=ul("__proto__,__v_isRef,__isVue"),Ja=new Set(Object.getOwnPropertyNames(Symbol).filter(e=>e!=="arguments"&&e!=="caller").map(e=>Symbol[e]).filter(Fn));function Dl(e){Fn(e)||(e=String(e));const t=ue(this);return Te(t,"has",e),t.hasOwnProperty(e)}class Xa{constructor(t=!1,n=!1){this._isReadonly=t,this._isShallow=n}get(t,n,i){const a=this._isReadonly,s=this._isShallow;if(n==="__v_isReactive")return!a;if(n==="__v_isReadonly")return a;if(n==="__v_isShallow")return s;if(n==="__v_raw")return i===(a?s?rs:ns:s?$l:ts).get(t)||Object.getPrototypeOf(t)===Object.getPrototypeOf(i)?t:void 0;const l=ye(t);if(!a){let m;if(l&&(m=Cl[n]))return m;if(n==="hasOwnProperty")return Dl}const d=Reflect.get(t,n,Ue(t)?t:i);return(Fn(n)?Ja.has(n):Tl(n))||(a||Te(t,"get",n),s)?d:Ue(d)?l&&Wi(n)?d:d.value:We(d)?a?os(d):is(d):d}}class Il extends Xa{constructor(t=!1){super(!1,t)}set(t,n,i,a){let s=t[n];if(!this._isShallow){const m=Nt(s);if(!Qe(i)&&!Nt(i)&&(s=ue(s),i=ue(i)),!ye(t)&&Ue(s)&&!Ue(i))return m?!1:(s.value=i,!0)}const l=ye(t)&&Wi(n)?Number(n)<t.length:Ce(t,n),d=Reflect.set(t,n,i,Ue(t)?t:a);return t===ue(a)&&(l?zt(i,s)&&It(t,"set",n,i,s):It(t,"add",n,i)),d}deleteProperty(t,n){const i=Ce(t,n),a=t[n],s=Reflect.deleteProperty(t,n);return s&&i&&It(t,"delete",n,void 0,a),s}has(t,n){const i=Reflect.has(t,n);return(!Fn(n)||!Ja.has(n))&&Te(t,"has",n),i}ownKeys(t){return Te(t,"iterate",ye(t)?"length":Gt),Reflect.ownKeys(t)}}class Za extends Xa{constructor(t=!1){super(!0,t)}set(t,n){return process.env.NODE_ENV!=="production"&&Dt(`Set operation on key "${String(n)}" failed: target is readonly.`,t),!0}deleteProperty(t,n){return process.env.NODE_ENV!=="production"&&Dt(`Delete operation on key "${String(n)}" failed: target is readonly.`,t),!0}}const Nl=new Il,Rl=new Za,Ml=new Za(!0),no=e=>e,Sr=e=>Reflect.getPrototypeOf(e);function kl(e,t,n){return function(...i){const a=this.__v_raw,s=ue(a),l=dn(s),d=e==="entries"||e===Symbol.iterator&&l,m=e==="keys"&&l,g=a[e](...i),T=n?no:t?oo:Je;return!t&&Te(s,"iterate",m?Xi:Gt),{next(){const{value:E,done:L}=g.next();return L?{value:E,done:L}:{value:d?[T(E[0]),T(E[1])]:T(E),done:L}},[Symbol.iterator](){return this}}}}function Or(e){return function(...t){if(process.env.NODE_ENV!=="production"){const n=t[0]?`on key "${t[0]}" `:"";Dt(`${gl(e)} operation ${n}failed: target is readonly.`,ue(this))}return e==="delete"?!1:e==="clear"?void 0:this}}function jl(e,t){const n={get(a){const s=this.__v_raw,l=ue(s),d=ue(a);e||(zt(a,d)&&Te(l,"get",a),Te(l,"get",d));const{has:m}=Sr(l),g=t?no:e?oo:Je;if(m.call(l,a))return g(s.get(a));if(m.call(l,d))return g(s.get(d));s!==l&&s.get(a)},get size(){const a=this.__v_raw;return!e&&Te(ue(a),"iterate",Gt),Reflect.get(a,"size",a)},has(a){const s=this.__v_raw,l=ue(s),d=ue(a);return e||(zt(a,d)&&Te(l,"has",a),Te(l,"has",d)),a===d?s.has(a):s.has(a)||s.has(d)},forEach(a,s){const l=this,d=l.__v_raw,m=ue(d),g=t?no:e?oo:Je;return!e&&Te(m,"iterate",Gt),d.forEach((T,E)=>a.call(s,g(T),g(E),l))}};return Ye(n,e?{add:Or("add"),set:Or("set"),delete:Or("delete"),clear:Or("clear")}:{add(a){!t&&!Qe(a)&&!Nt(a)&&(a=ue(a));const s=ue(this);return Sr(s).has.call(s,a)||(s.add(a),It(s,"add",a,a)),this},set(a,s){!t&&!Qe(s)&&!Nt(s)&&(s=ue(s));const l=ue(this),{has:d,get:m}=Sr(l);let g=d.call(l,a);g?process.env.NODE_ENV!=="production"&&es(l,d,a):(a=ue(a),g=d.call(l,a));const T=m.call(l,a);return l.set(a,s),g?zt(s,T)&&It(l,"set",a,s,T):It(l,"add",a,s),this},delete(a){const s=ue(this),{has:l,get:d}=Sr(s);let m=l.call(s,a);m?process.env.NODE_ENV!=="production"&&es(s,l,a):(a=ue(a),m=l.call(s,a));const g=d?d.call(s,a):void 0,T=s.delete(a);return m&&It(s,"delete",a,void 0,g),T},clear(){const a=ue(this),s=a.size!==0,l=process.env.NODE_ENV!=="production"?dn(a)?new Map(a):new Set(a):void 0,d=a.clear();return s&&It(a,"clear",void 0,void 0,l),d}}),["keys","values","entries",Symbol.iterator].forEach(a=>{n[a]=kl(a,e,t)}),n}function ro(e,t){const n=jl(e,t);return(i,a,s)=>a==="__v_isReactive"?!e:a==="__v_isReadonly"?e:a==="__v_raw"?i:Reflect.get(Ce(n,a)&&a in i?n:i,a,s)}const Ll={get:ro(!1,!1)},Fl={get:ro(!0,!1)},Bl={get:ro(!0,!0)};function es(e,t,n){const i=ue(n);if(i!==n&&t.call(e,i)){const a=Ka(e);Dt(`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 ts=new WeakMap,$l=new WeakMap,ns=new WeakMap,rs=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 Kl(e){return e.__v_skip||!Object.isExtensible(e)?0:Vl(Ka(e))}function is(e){return Nt(e)?e:io(e,!1,Nl,Ll,ts)}function os(e){return io(e,!0,Rl,Fl,ns)}function xr(e){return io(e,!0,Ml,Bl,rs)}function io(e,t,n,i,a){if(!We(e))return process.env.NODE_ENV!=="production"&&Dt(`value cannot be made ${t?"readonly":"reactive"}: ${String(e)}`),e;if(e.__v_raw&&!(t&&e.__v_isReactive))return e;const s=a.get(e);if(s)return s;const l=Kl(e);if(l===0)return e;const d=new Proxy(e,l===2?i:n);return a.set(e,d),d}function gn(e){return Nt(e)?gn(e.__v_raw):!!(e&&e.__v_isReactive)}function Nt(e){return!!(e&&e.__v_isReadonly)}function Qe(e){return!!(e&&e.__v_isShallow)}function Ar(e){return e?!!e.__v_raw:!1}function ue(e){const t=e&&e.__v_raw;return t?ue(t):e}function Wl(e){return!Ce(e,"__v_skip")&&Object.isExtensible(e)&&vl(e,"__v_skip",!0),e}const Je=e=>We(e)?is(e):e,oo=e=>We(e)?os(e):e;function Ue(e){return e?e.__v_isRef===!0:!1}function Ul(e){return Ue(e)?e.value:e}const ql={get:(e,t,n)=>t==="__v_raw"?e:Ul(Reflect.get(e,t,n)),set:(e,t,n,i)=>{const a=e[t];return Ue(a)&&!Ue(n)?(a.value=n,!0):Reflect.set(e,t,n,i)}};function Hl(e){return gn(e)?e:new Proxy(e,ql)}const Cr={},Pr=new WeakMap;let Yt;function zl(e,t=!1,n=Yt){if(n){let i=Pr.get(n);i||Pr.set(n,i=[]),i.push(e)}else process.env.NODE_ENV!=="production"&&!t&&Dt("onWatcherCleanup() was called when there was no active watcher to associate with.")}function Gl(e,t,n=ot){const{immediate:i,deep:a,once:s,scheduler:l,augmentJob:d,call:m}=n,g=ne=>{(n.onWarn||Dt)("Invalid watch source: ",ne,"A watch source can only be a getter/effect function, a ref, a reactive object, or an array of these types.")},T=ne=>a?ne:Qe(ne)||a===!1||a===0?Rt(ne,1):Rt(ne);let E,L,z,X,se=!1,qe=!1;if(Ue(e)?(L=()=>e.value,se=Qe(e)):gn(e)?(L=()=>T(e),se=!0):ye(e)?(qe=!0,se=e.some(ne=>gn(ne)||Qe(ne)),L=()=>e.map(ne=>{if(Ue(ne))return ne.value;if(gn(ne))return T(ne);if(Me(ne))return m?m(ne,2):ne();process.env.NODE_ENV!=="production"&&g(ne)})):Me(e)?t?L=m?()=>m(e,2):e:L=()=>{if(z){_r();try{z()}finally{wr()}}const ne=Yt;Yt=E;try{return m?m(e,3,[X]):e(X)}finally{Yt=ne}}:(L=Ht,process.env.NODE_ENV!=="production"&&g(e)),t&&a){const ne=L,Fe=a===!0?1/0:a;L=()=>Rt(ne(),Fe)}const Xe=()=>{E.stop()};if(s&&t){const ne=t;t=(...Fe)=>{ne(...Fe),Xe()}}let He=qe?new Array(e.length).fill(Cr):Cr;const gt=ne=>{if(!(!(E.flags&1)||!E.dirty&&!ne))if(t){const Fe=E.run();if(a||se||(qe?Fe.some((Be,Pe)=>zt(Be,He[Pe])):zt(Fe,He))){z&&z();const Be=Yt;Yt=E;try{const Pe=[Fe,He===Cr?void 0:qe&&He[0]===Cr?[]:He,X];m?m(t,3,Pe):t(...Pe),He=Fe}finally{Yt=Be}}}else E.run()};return d&&d(gt),E=new wl(L),E.scheduler=l?()=>l(gt,!1):gt,X=ne=>zl(ne,!1,E),z=E.onStop=()=>{const ne=Pr.get(E);if(ne){if(m)m(ne,4);else for(const Fe of ne)Fe();Pr.delete(E)}},process.env.NODE_ENV!=="production"&&(E.onTrack=n.onTrack,E.onTrigger=n.onTrigger),t?i?gt(!0):He=E.run():l?l(gt.bind(null,!0),!0):E.run(),Xe.pause=E.pause.bind(E),Xe.resume=E.resume.bind(E),Xe.stop=Xe,Xe}function Rt(e,t=1/0,n){if(t<=0||!We(e)||e.__v_skip||(n=n||new Set,n.has(e)))return e;if(n.add(e),t--,Ue(e))Rt(e.value,t,n);else if(ye(e))for(let i=0;i<e.length;i++)Rt(e[i],t,n);else if(fl(e)||dn(e))e.forEach(i=>{Rt(i,t,n)});else if(pl(e)){for(const i in e)Rt(e[i],t,n);for(const i of Object.getOwnPropertySymbols(e))Object.prototype.propertyIsEnumerable.call(e,i)&&Rt(e[i],t,n)}return e}/**
|
|
17
|
-
* @vue/runtime-core v3.5.12
|
|
18
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
19
|
-
* @license MIT
|
|
20
|
-
**/const Qt=[];function Yl(e){Qt.push(e)}function Ql(){Qt.pop()}let ao=!1;function Ee(e,...t){if(ao)return;ao=!0,_r();const n=Qt.length?Qt[Qt.length-1].component:null,i=n&&n.appContext.config.warnHandler,a=Jl();if(i)Tr(i,n,11,[e+t.map(s=>{var l,d;return(d=(l=s.toString)==null?void 0:l.call(s))!=null?d:JSON.stringify(s)}).join(""),n&&n.proxy,a.map(({vnode:s})=>`at <${Cs(n,s.type)}>`).join(`
|
|
21
|
-
`),a]);else{const s=[`[Vue warn]: ${e}`,...t];a.length&&s.push(`
|
|
22
|
-
`,...Xl(a)),console.warn(...s)}wr(),ao=!1}function Jl(){let e=Qt[Qt.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 i=e.component&&e.component.parent;e=i&&i.vnode}return t}function Xl(e){const t=[];return e.forEach((n,i)=>{t.push(...i===0?[]:[`
|
|
23
|
-
`],...Zl(n))}),t}function Zl({vnode:e,recurseCount:t}){const n=t>0?`... (${t} recursive calls)`:"",i=e.component?e.component.parent==null:!1,a=` at <${Cs(e.component,e.type,i)}`,s=">"+n;return e.props?[a,...ef(e.props),s]:[a+s]}function ef(e){const t=[],n=Object.keys(e);return n.slice(0,3).forEach(i=>{t.push(...as(i,e[i]))}),n.length>3&&t.push(" ..."),t}function as(e,t,n){return ct(t)?(t=JSON.stringify(t),n?t:[`${e}=${t}`]):typeof t=="number"||typeof t=="boolean"||t==null?n?t:[`${e}=${t}`]:Ue(t)?(t=as(e,ue(t.value),!0),n?t:[`${e}=Ref<`,t,">"]):Me(t)?[`${e}=fn${t.name?`<${t.name}>`:""}`]:(t=ue(t),n?t:[`${e}=`,t])}const ss={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",15:"component update",16:"app unmount cleanup function"};function Tr(e,t,n,i){try{return i?e(...i):e()}catch(a){so(a,t,n)}}function us(e,t,n,i){if(Me(e)){const a=Tr(e,t,n,i);return a&&hl(a)&&a.catch(s=>{so(s,t,n)}),a}if(ye(e)){const a=[];for(let s=0;s<e.length;s++)a.push(us(e[s],t,n,i));return a}else process.env.NODE_ENV!=="production"&&Ee(`Invalid value type passed to callWithAsyncErrorHandling(): ${typeof e}`)}function so(e,t,n,i=!0){const a=t?t.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:l}=t&&t.appContext.config||ot;if(t){let d=t.parent;const m=t.proxy,g=process.env.NODE_ENV!=="production"?ss[n]:`https://vuejs.org/error-reference/#runtime-${n}`;for(;d;){const T=d.ec;if(T){for(let E=0;E<T.length;E++)if(T[E](e,m,g)===!1)return}d=d.parent}if(s){_r(),Tr(s,null,10,[e,m,g]),wr();return}}tf(e,n,a,i,l)}function tf(e,t,n,i=!0,a=!1){if(process.env.NODE_ENV!=="production"){const s=ss[t];if(n&&Yl(n),Ee(`Unhandled error${s?` during execution of ${s}`:""}`),n&&Ql(),i)throw e;console.error(e)}else{if(a)throw e;console.error(e)}}const at=[];let Et=-1;const vn=[];let Mt=null,yn=0;const cs=Promise.resolve();let Dr=null;const nf=100;function rf(e){const t=Dr||cs;return e?t.then(this?e.bind(this):e):t}function of(e){let t=Et+1,n=at.length;for(;t<n;){const i=t+n>>>1,a=at[i],s=Wn(a);s<e||s===e&&a.flags&2?t=i+1:n=i}return t}function uo(e){if(!(e.flags&1)){const t=Wn(e),n=at[at.length-1];!n||!(e.flags&2)&&t>=Wn(n)?at.push(e):at.splice(of(t),0,e),e.flags|=1,ls()}}function ls(){Dr||(Dr=cs.then(hs))}function fs(e){ye(e)?vn.push(...e):Mt&&e.id===-1?Mt.splice(yn+1,0,e):e.flags&1||(vn.push(e),e.flags|=1),ls()}function af(e){if(vn.length){const t=[...new Set(vn)].sort((n,i)=>Wn(n)-Wn(i));if(vn.length=0,Mt){Mt.push(...t);return}for(Mt=t,process.env.NODE_ENV!=="production"&&(e=e||new Map),yn=0;yn<Mt.length;yn++){const n=Mt[yn];process.env.NODE_ENV!=="production"&&ds(e,n)||(n.flags&4&&(n.flags&=-2),n.flags&8||n(),n.flags&=-2)}Mt=null,yn=0}}const Wn=e=>e.id==null?e.flags&2?-1:1/0:e.id;function hs(e){process.env.NODE_ENV!=="production"&&(e=e||new Map);const t=process.env.NODE_ENV!=="production"?n=>ds(e,n):Ht;try{for(Et=0;Et<at.length;Et++){const n=at[Et];if(n&&!(n.flags&8)){if(process.env.NODE_ENV!=="production"&&t(n))continue;n.flags&4&&(n.flags&=-2),Tr(n,n.i,n.i?15:14),n.flags&4||(n.flags&=-2)}}}finally{for(;Et<at.length;Et++){const n=at[Et];n&&(n.flags&=-2)}Et=-1,at.length=0,af(e),Dr=null,(at.length||vn.length)&&hs(e)}}function ds(e,t){const n=e.get(t)||0;if(n>nf){const i=t.i,a=i&&As(i.type);return so(`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}return e.set(t,n+1),!1}const co=new Map;process.env.NODE_ENV!=="production"&&(br().__VUE_HMR_RUNTIME__={createRecord:lo(sf),rerender:lo(uf),reload:lo(cf)});const Ir=new Map;function sf(e,t){return Ir.has(e)?!1:(Ir.set(e,{initialDef:Nr(t),instances:new Set}),!0)}function Nr(e){return Ps(e)?e.__vccOpts:e}function uf(e,t){const n=Ir.get(e);n&&(n.initialDef.render=t,[...n.instances].forEach(i=>{t&&(i.render=t,Nr(i.type).render=t),i.renderCache=[],i.update()}))}function cf(e,t){const n=Ir.get(e);if(!n)return;t=Nr(t),ps(n.initialDef,t);const i=[...n.instances];for(let a=0;a<i.length;a++){const s=i[a],l=Nr(s.type);let d=co.get(l);d||(l!==n.initialDef&&ps(l,t),co.set(l,d=new Set)),d.add(s),s.appContext.propsCache.delete(s.type),s.appContext.emitsCache.delete(s.type),s.appContext.optionsCache.delete(s.type),s.ceReload?(d.add(s),s.ceReload(t.styles),d.delete(s)):s.parent?uo(()=>{s.parent.update(),d.delete(s)}):s.appContext.reload?s.appContext.reload():typeof window<"u"?window.location.reload():console.warn("[HMR] Root or manually mounted instance modified. Full reload required."),s.root.ce&&s!==s.root&&s.root.ce._removeChildStyle(l)}fs(()=>{co.clear()})}function ps(e,t){Ye(e,t);for(const n in e)n!=="__file"&&!(n in t)&&delete e[n]}function lo(e){return(t,n)=>{try{return e(t,n)}catch(i){console.error(i),console.warn("[HMR] Something went wrong during Vue component hot-reload. Full reload required.")}}}let mn,Rr=[];function gs(e,t){var n,i;mn=e,mn?(mn.enabled=!0,Rr.forEach(({event:a,args:s})=>mn.emit(a,...s)),Rr=[]):typeof window<"u"&&window.HTMLElement&&!((i=(n=window.navigator)==null?void 0:n.userAgent)!=null&&i.includes("jsdom"))?((t.__VUE_DEVTOOLS_HOOK_REPLAY__=t.__VUE_DEVTOOLS_HOOK_REPLAY__||[]).push(s=>{gs(s,t)}),setTimeout(()=>{mn||(t.__VUE_DEVTOOLS_HOOK_REPLAY__=null,Rr=[])},3e3)):Rr=[]}let St=null,lf=null;const ff=e=>e.__isTeleport;function vs(e,t){e.shapeFlag&6&&e.component?(e.transition=t,vs(e.component.subTree,t)):e.shapeFlag&128?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}br().requestIdleCallback,br().cancelIdleCallback;const hf=Symbol.for("v-ndc"),fo=e=>e?Vf(e)?Kf(e):fo(e.parent):null,Un=Ye(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>process.env.NODE_ENV!=="production"?xr(e.props):e.props,$attrs:e=>process.env.NODE_ENV!=="production"?xr(e.attrs):e.attrs,$slots:e=>process.env.NODE_ENV!=="production"?xr(e.slots):e.slots,$refs:e=>process.env.NODE_ENV!=="production"?xr(e.refs):e.refs,$parent:e=>fo(e.parent),$root:e=>fo(e.root),$host:e=>e.ce,$emit:e=>e.emit,$options:e=>__VUE_OPTIONS_API__?vf(e):e.type,$forceUpdate:e=>e.f||(e.f=()=>{uo(e.update)}),$nextTick:e=>e.n||(e.n=rf.bind(e.proxy)),$watch:e=>__VUE_OPTIONS_API__?Cf.bind(e):Ht}),df=e=>e==="_"||e==="$",ho=(e,t)=>e!==ot&&!e.__isScriptSetup&&Ce(e,t),pf={get({_:e},t){if(t==="__v_skip")return!0;const{ctx:n,setupState:i,data:a,props:s,accessCache:l,type:d,appContext:m}=e;if(process.env.NODE_ENV!=="production"&&t==="__isVue")return!0;let g;if(t[0]!=="$"){const z=l[t];if(z!==void 0)switch(z){case 1:return i[t];case 2:return a[t];case 4:return n[t];case 3:return s[t]}else{if(ho(i,t))return l[t]=1,i[t];if(a!==ot&&Ce(a,t))return l[t]=2,a[t];if((g=e.propsOptions[0])&&Ce(g,t))return l[t]=3,s[t];if(n!==ot&&Ce(n,t))return l[t]=4,n[t];(!__VUE_OPTIONS_API__||gf)&&(l[t]=0)}}const T=Un[t];let E,L;if(T)return t==="$attrs"?(Te(e.attrs,"get",""),process.env.NODE_ENV!=="production"&&void 0):process.env.NODE_ENV!=="production"&&t==="$slots"&&Te(e,"get",t),T(e);if((E=d.__cssModules)&&(E=E[t]))return E;if(n!==ot&&Ce(n,t))return l[t]=4,n[t];if(L=m.config.globalProperties,Ce(L,t))return L[t];process.env.NODE_ENV!=="production"&&St&&(!ct(t)||t.indexOf("__v")!==0)&&(a!==ot&&df(t[0])&&Ce(a,t)?Ee(`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===St&&Ee(`Property ${JSON.stringify(t)} was accessed during render but is not defined on instance.`))},set({_:e},t,n){const{data:i,setupState:a,ctx:s}=e;return ho(a,t)?(a[t]=n,!0):process.env.NODE_ENV!=="production"&&a.__isScriptSetup&&Ce(a,t)?(Ee(`Cannot mutate <script setup> binding "${t}" from Options API.`),!1):i!==ot&&Ce(i,t)?(i[t]=n,!0):Ce(e.props,t)?(process.env.NODE_ENV!=="production"&&Ee(`Attempting to mutate prop "${t}". Props are readonly.`),!1):t[0]==="$"&&t.slice(1)in e?(process.env.NODE_ENV!=="production"&&Ee(`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(s,t,{enumerable:!0,configurable:!0,value:n}):s[t]=n,!0)},has({_:{data:e,setupState:t,accessCache:n,ctx:i,appContext:a,propsOptions:s}},l){let d;return!!n[l]||e!==ot&&Ce(e,l)||ho(t,l)||(d=s[0])&&Ce(d,l)||Ce(i,l)||Ce(Un,l)||Ce(a.config.globalProperties,l)},defineProperty(e,t,n){return n.get!=null?e._.accessCache[t]=0:Ce(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};process.env.NODE_ENV!=="production"&&(pf.ownKeys=e=>(Ee("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 ys(e){return ye(e)?e.reduce((t,n)=>(t[n]=null,t),{}):e}let gf=!0;function vf(e){const t=e.type,{mixins:n,extends:i}=t,{mixins:a,optionsCache:s,config:{optionMergeStrategies:l}}=e.appContext,d=s.get(t);let m;return d?m=d:!a.length&&!n&&!i?m=t:(m={},a.length&&a.forEach(g=>Mr(m,g,l,!0)),Mr(m,t,l)),We(t)&&s.set(t,m),m}function Mr(e,t,n,i=!1){const{mixins:a,extends:s}=t;s&&Mr(e,s,n,!0),a&&a.forEach(l=>Mr(e,l,n,!0));for(const l in t)if(i&&l==="expose")process.env.NODE_ENV!=="production"&&Ee('"expose" option is ignored when declared in mixins or extends. It should only be declared in the base component itself.');else{const d=yf[l]||n&&n[l];e[l]=d?d(e[l],t[l]):t[l]}return e}const yf={data:ms,props:_s,emits:_s,methods:qn,computed:qn,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:qn,directives:qn,watch:bf,provide:ms,inject:mf};function ms(e,t){return t?e?function(){return Ye(Me(e)?e.call(this,this):e,Me(t)?t.call(this,this):t)}:t:e}function mf(e,t){return qn(bs(e),bs(t))}function bs(e){if(ye(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 qn(e,t){return e?Ye(Object.create(null),e,t):t}function _s(e,t){return e?ye(e)&&ye(t)?[...new Set([...e,...t])]:Ye(Object.create(null),ys(e),ys(t??{})):t}function bf(e,t){if(!e)return t;if(!t)return e;const n=Ye(Object.create(null),e);for(const i in t)n[i]=Le(e[i],t[i]);return n}let _f=null;function wf(e,t,n=!1){const i=Lr||St;if(i||_f){const a=i?i.parent==null?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(a&&e in a)return a[e];if(arguments.length>1)return n&&Me(t)?t.call(i&&i.proxy):t;process.env.NODE_ENV!=="production"&&Ee(`injection "${String(e)}" not found.`)}else process.env.NODE_ENV!=="production"&&Ee("inject() can only be used inside setup() or functional components.")}const Ef={},ws=e=>Object.getPrototypeOf(e)===Ef,Sf=Df,Of=Symbol.for("v-scx"),xf=()=>{{const e=wf(Of);return e||process.env.NODE_ENV!=="production"&&Ee("Server rendering context not provided. Make sure to only call useSSRContext() conditionally in the server build."),e}};function Af(e,t,n=ot){const{immediate:i,deep:a,flush:s,once:l}=n;process.env.NODE_ENV!=="production"&&!t&&(i!==void 0&&Ee('watch() "immediate" option is only respected when using the watch(source, callback, options?) signature.'),a!==void 0&&Ee('watch() "deep" option is only respected when using the watch(source, callback, options?) signature.'),l!==void 0&&Ee('watch() "once" option is only respected when using the watch(source, callback, options?) signature.'));const d=Ye({},n);process.env.NODE_ENV!=="production"&&(d.onWarn=Ee);const m=t&&i||!t&&s!=="post";let g;if(vo){if(s==="sync"){const z=xf();g=z.__watcherHandles||(z.__watcherHandles=[])}else if(!m){const z=()=>{};return z.stop=Ht,z.resume=Ht,z.pause=Ht,z}}const T=Lr;d.call=(z,X,se)=>us(z,T,X,se);let E=!1;s==="post"?d.scheduler=z=>{Sf(z,T&&T.suspense)}:s!=="sync"&&(E=!0,d.scheduler=(z,X)=>{X?z():uo(z)}),d.augmentJob=z=>{t&&(z.flags|=4),E&&(z.flags|=2,T&&(z.id=T.uid,z.i=T))};const L=Gl(e,t,d);return vo&&(g?g.push(L):m&&L()),L}function Cf(e,t,n){const i=this.proxy,a=ct(e)?e.includes(".")?Pf(i,e):()=>i[e]:e.bind(i,i);let s;Me(t)?s=t:(s=t.handler,n=t);const l=$f(this),d=Af(a,s.bind(i),n);return l(),d}function Pf(e,t){const n=t.split(".");return()=>{let i=e;for(let a=0;a<n.length&&i;a++)i=i[n[a]];return i}}function Md(){}const Tf=e=>e.__isSuspense;function Df(e,t){t&&t.pendingBranch?ye(e)?t.effects.push(...e):t.effects.push(e):fs(e)}const Es=Symbol.for("v-fgt"),If=Symbol.for("v-txt"),Nf=Symbol.for("v-cmt");let bn=null;function Rf(e){return e?e.__v_isVNode===!0:!1}const Mf=(...e)=>Os(...e),Ss=({key:e})=>e??null,kr=({ref:e,ref_key:t,ref_for:n})=>(typeof e=="number"&&(e=""+e),e!=null?ct(e)||Ue(e)||Me(e)?{i:St,r:e,k:t,f:!!n}:e:null);function kf(e,t=null,n=null,i=0,a=null,s=e===Es?0:1,l=!1,d=!1){const m={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&Ss(t),ref:t&&kr(t),scopeId:lf,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetStart:null,targetAnchor:null,staticCount:0,shapeFlag:s,patchFlag:i,dynamicProps:a,dynamicChildren:null,appContext:null,ctx:St};return d?(po(m,n),s&128&&e.normalize(m)):n&&(m.shapeFlag|=ct(n)?8:16),process.env.NODE_ENV!=="production"&&m.key!==m.key&&Ee("VNode created with invalid key (NaN). VNode type:",m.type),!l&&bn&&(m.patchFlag>0||s&6)&&m.patchFlag!==32&&bn.push(m),m}const jf=process.env.NODE_ENV!=="production"?Mf:Os;function Os(e,t=null,n=null,i=0,a=null,s=!1){if((!e||e===hf)&&(process.env.NODE_ENV!=="production"&&!e&&Ee(`Invalid vnode type when creating vnode: ${e}.`),e=Nf),Rf(e)){const d=jr(e,t,!0);return n&&po(d,n),!s&&bn&&(d.shapeFlag&6?bn[bn.indexOf(e)]=d:bn.push(d)),d.patchFlag=-2,d}if(Ps(e)&&(e=e.__vccOpts),t){t=Lf(t);let{class:d,style:m}=t;d&&!ct(d)&&(t.class=qi(d)),We(m)&&(Ar(m)&&!ye(m)&&(m=Ye({},m)),t.style=Ui(m))}const l=ct(e)?1:Tf(e)?128:ff(e)?64:We(e)?4:Me(e)?2:0;return process.env.NODE_ENV!=="production"&&l&4&&Ar(e)&&(e=ue(e),Ee("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`.",`
|
|
24
|
-
Component that was made reactive: `,e)),kf(e,t,n,i,a,l,s,!0)}function Lf(e){return e?Ar(e)||ws(e)?Ye({},e):e:null}function jr(e,t,n=!1,i=!1){const{props:a,ref:s,patchFlag:l,children:d,transition:m}=e,g=t?Bf(a||{},t):a,T={__v_isVNode:!0,__v_skip:!0,type:e.type,props:g,key:g&&Ss(g),ref:t&&t.ref?n&&s?ye(s)?s.concat(kr(t)):[s,kr(t)]:kr(t):s,scopeId:e.scopeId,slotScopeIds:e.slotScopeIds,children:process.env.NODE_ENV!=="production"&&l===-1&&ye(d)?d.map(xs):d,target:e.target,targetStart:e.targetStart,targetAnchor:e.targetAnchor,staticCount:e.staticCount,shapeFlag:e.shapeFlag,patchFlag:t&&e.type!==Es?l===-1?16:l|16:l,dynamicProps:e.dynamicProps,dynamicChildren:e.dynamicChildren,appContext:e.appContext,dirs:e.dirs,transition:m,component:e.component,suspense:e.suspense,ssContent:e.ssContent&&jr(e.ssContent),ssFallback:e.ssFallback&&jr(e.ssFallback),el:e.el,anchor:e.anchor,ctx:e.ctx,ce:e.ce};return m&&i&&vs(T,m.clone(T)),T}function xs(e){const t=jr(e);return ye(e.children)&&(t.children=e.children.map(xs)),t}function Ff(e=" ",t=0){return jf(If,null,e,t)}function po(e,t){let n=0;const{shapeFlag:i}=e;if(t==null)t=null;else if(ye(t))n=16;else if(typeof t=="object")if(i&65){const a=t.default;a&&(a._c&&(a._d=!1),po(e,a()),a._c&&(a._d=!0));return}else{n=32;const a=t._;!a&&!ws(t)?t._ctx=St:a===3&&St&&(St.slots._===1?t._=1:(t._=2,e.patchFlag|=1024))}else Me(t)?(t={default:t,_ctx:St},n=32):(t=String(t),i&64?(n=16,t=[Ff(t)]):n=8);e.children=t,e.shapeFlag|=n}function Bf(...e){const t={};for(let n=0;n<e.length;n++){const i=e[n];for(const a in i)if(a==="class")t.class!==i.class&&(t.class=qi([t.class,i.class]));else if(a==="style")t.style=Ui([t.style,i.style]);else if(cl(a)){const s=t[a],l=i[a];l&&s!==l&&!(ye(s)&&s.includes(l))&&(t[a]=s?[].concat(s,l):l)}else a!==""&&(t[a]=i[a])}return t}let Lr=null,go;{const e=br(),t=(n,i)=>{let a;return(a=e[n])||(a=e[n]=[]),a.push(i),s=>{a.length>1?a.forEach(l=>l(s)):a[0](s)}};go=t("__VUE_INSTANCE_SETTERS__",n=>Lr=n),t("__VUE_SSR_SETTERS__",n=>vo=n)}const $f=e=>{const t=Lr;return go(e),e.scope.on(),()=>{e.scope.off(),go(t)}};function Vf(e){return e.vnode.shapeFlag&4}let vo=!1;process.env.NODE_ENV;function Kf(e){return e.exposed?e.exposeProxy||(e.exposeProxy=new Proxy(Hl(Wl(e.exposed)),{get(t,n){if(n in t)return t[n];if(n in Un)return Un[n](e)},has(t,n){return n in t||n in Un}})):e.proxy}const Wf=/(?:^|[-_])(\w)/g,Uf=e=>e.replace(Wf,t=>t.toUpperCase()).replace(/[-_]/g,"");function As(e,t=!0){return Me(e)?e.displayName||e.name:e.name||t&&e.__name}function Cs(e,t,n=!1){let i=As(t);if(!i&&t.__file){const a=t.__file.match(/([^/\\]+)\.\w+$/);a&&(i=a[1])}if(!i&&e&&e.parent){const a=s=>{for(const l in s)if(s[l]===t)return l};i=a(e.components||e.parent.type.components)||a(e.appContext.components)}return i?Uf(i):n?"App":"Anonymous"}function Ps(e){return Me(e)&&"__vccOpts"in e}function qf(){if(process.env.NODE_ENV==="production"||typeof window>"u")return;const e={style:"color:#3ba776"},t={style:"color:#1677ff"},n={style:"color:#f5222d"},i={style:"color:#eb2f96"},a={__vue_custom_formatter:!0,header(E){return We(E)?E.__isVue?["div",e,"VueInstance"]:Ue(E)?["div",{},["span",e,T(E)],"<",d("_value"in E?E._value:E),">"]:gn(E)?["div",{},["span",e,Qe(E)?"ShallowReactive":"Reactive"],"<",d(E),`>${Nt(E)?" (readonly)":""}`]:Nt(E)?["div",{},["span",e,Qe(E)?"ShallowReadonly":"Readonly"],"<",d(E),">"]:null:null},hasBody(E){return E&&E.__isVue},body(E){if(E&&E.__isVue)return["div",{},...s(E.$)]}};function s(E){const L=[];E.type.props&&E.props&&L.push(l("props",ue(E.props))),E.setupState!==ot&&L.push(l("setup",E.setupState)),E.data!==ot&&L.push(l("data",ue(E.data)));const z=m(E,"computed");z&&L.push(l("computed",z));const X=m(E,"inject");return X&&L.push(l("injected",X)),L.push(["div",{},["span",{style:i.style+";opacity:0.66"},"$ (internal): "],["object",{object:E}]]),L}function l(E,L){return L=Ye({},L),Object.keys(L).length?["div",{style:"line-height:1.25em;margin-bottom:0.6em"},["div",{style:"color:#476582"},E],["div",{style:"padding-left:1.25em"},...Object.keys(L).map(z=>["div",{},["span",i,z+": "],d(L[z],!1)])]]:["span",{}]}function d(E,L=!0){return typeof E=="number"?["span",t,E]:typeof E=="string"?["span",n,JSON.stringify(E)]:typeof E=="boolean"?["span",i,E]:We(E)?["object",{object:L?ue(E):E}]:["span",n,String(E)]}function m(E,L){const z=E.type;if(Me(z))return;const X={};for(const se in E.ctx)g(z,se,L)&&(X[se]=E.ctx[se]);return X}function g(E,L,z){const X=E[z];if(ye(X)&&X.includes(L)||We(X)&&L in X||E.extends&&g(E.extends,L,z)||E.mixins&&E.mixins.some(se=>g(se,L,z)))return!0}function T(E){return Qe(E)?"ShallowRef":E.effect?"ComputedRef":"Ref"}window.devtoolsFormatters?window.devtoolsFormatters.push(a):window.devtoolsFormatters=[a]}process.env.NODE_ENV,process.env.NODE_ENV,process.env.NODE_ENV;/**
|
|
25
|
-
* vue v3.5.12
|
|
26
|
-
* (c) 2018-present Yuxi (Evan) You and Vue contributors
|
|
27
|
-
* @license MIT
|
|
28
|
-
**/function Hf(){qf()}process.env.NODE_ENV!=="production"&&Hf();class yo{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}}class _n{constructor(t="",n="",i="",a=""){this.mode="",this.headline="",this.headlineRaw="",this.document=new yo({}),this.source=i,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 yo(t.document),this.css=t.css,this.js=t.js,this.version=t.version}}var zf=Object.defineProperty,Gf=Object.getOwnPropertyDescriptor,Yf=(e,t,n,i)=>{for(var a=i>1?void 0:i?Gf(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&zf(t,n,a),a},Ts=(e,t)=>(n,i)=>t(n,i,e);let Fr=class{constructor(e){this.loggerConfig=e}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)}};Fr=Yf([Re(),Ts(0,Oe("LoggerConfig")),Ts(0,Hc())],Fr);var Qf=Object.defineProperty,Jf=Object.getOwnPropertyDescriptor,Xf=(e,t,n,i)=>{for(var a=i>1?void 0:i?Jf(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&Qf(t,n,a),a};let mo=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(i=>{if(i.startsWith(e)){const a=this.computedConfig.get(i);(a==null||n&&n>a)&&n&&this.computedConfig.set(i,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 i=this.getLevelId(t);return!!(i&&n>=i)}hasLevelId(e,t){let n=this.computedConfig.get(e);n||(n=this.getDefaultLevelId());const i=t;return!!(i&&n>=i)}};mo=Xf([Re()],mo);var Zf=Object.defineProperty,eh=Object.getOwnPropertyDescriptor,th=(e,t,n,i)=>{for(var a=i>1?void 0:i?eh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&Zf(t,n,a),a},nh=(e,t)=>(n,i)=>t(n,i,e);let Hn=class{constructor(e){this.logger=e,this.logger.setModule("storage.components.defaultWikiStorage"),this.offlineSetup=!1}setConfig(e,t,n,i,a,s,l,d){this.name=e,this.baseURL=t,this.baseRestURL=n,this.realtimeURL=d==null?void 0:d.realtimeURL,this.homePage=i,this.serverRendering=a,this.designSystem=s,this.offline=l}setConfigFromObject(e){this.name=e.name,this.baseURL=e.baseURL,this.baseRestURL=e.baseRestURL,this.realtimeURL=e.realtimeURL,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"}getType(){return"Default"}getNewPageDefaultName(){return"newpage"}};Hn=th([Re(),nh(0,Oe("Logger"))],Hn);var rh=Object.defineProperty,ih=Object.getOwnPropertyDescriptor,oh=(e,t,n,i)=>{for(var a=i>1?void 0:i?ih(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&rh(t,n,a),a},ah=(e,t)=>(n,i)=>t(n,i,e);let bo=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 sl(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 i=await n.pages.get(t),a=new _n;return a.fromObject(i),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(i){this.logger.debug("Exception while trying to store in local storage",e,t,n,i)}}async updatePage(e,t,n){try{const i=this.getPageStorage(e);this.logger.debug("Ready to store",n),await i.pages.update(t,n.toObject())}catch(i){this.logger.debug("Exception while trying to store in local storage",e,t,n,i)}}};bo=oh([Re(),ah(0,Oe("Logger"))],bo);var sh=Object.defineProperty,uh=Object.getOwnPropertyDescriptor,ch=(e,t,n,i)=>{for(var a=i>1?void 0:i?uh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&sh(t,n,a),a},_o=(e,t)=>(n,i)=>t(n,i,e);let wo=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,i){if(this.logger.debug("Trying to get data for page ",e),this.offlineStorage){this.logger.debug("Asking offline storage for ",e);const a=await this.offlineStorage.getPage(this.getWikiConfig().name,e+"_"+t);return a!=null&&a!=null?(this.logger.debug("Loading data from local storage for page",e),(i==null||i)&&this.queueWorker.addToQueue(this.getWikiConfig().name+":"+e+"_"+t),a):(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)}getAttachments(e){return this.storage.getAttachments(e)}getAttachment(e,t){return this.storage.getAttachment(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),i=await this.storage.getPageContent(e,t);return n&&i?(i.id=e+"_"+t,this.logger.debug("Saving page to offline storage",e),this.offlineStorage.savePage(this.getWikiConfig().name,e+"_"+t,i),!0):(n==null?void 0:n.version)!=(i==null?void 0:i.version)&&i?(i.id=e+"_"+t,this.logger.debug("Updating page to offline storage",e),this.offlineStorage.updatePage(this.getWikiConfig().name,e+"_"+t,i),!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,i){return this.storage.save(e,t,n,i)}async saveAttachments(e,t){return this.storage.saveAttachments(e,t)}async delete(e){return this.storage.delete(e)}};wo=ch([Re(),_o(0,Oe("Logger")),_o(1,Oe("OfflineStorage")),_o(2,Oe("QueueWorker"))],wo);let lh=class{constructor(t){t.bind("WrappingStorage").to(wo).inSingletonScope(),t.bind("OfflineStorage").to(bo).inSingletonScope()}};var fh=Object.defineProperty,hh=Object.getOwnPropertyDescriptor,dh=(e,t,n,i)=>{for(var a=i>1?void 0:i?hh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&fh(t,n,a),a},Br=(e,t)=>(n,i)=>t(n,i,e);let Eo=class extends Hn{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"}getType(){return"GitHub"}};Eo=dh([Re(),Br(0,Oe("Logger")),Br(1,Oe("Storage")),Br(1,Li("GitHub")),Br(2,Oe("CristalApp"))],Eo);var ph=Object.defineProperty,gh=Object.getOwnPropertyDescriptor,vh=(e,t,n,i)=>{for(var a=i>1?void 0:i?gh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&ph(t,n,a),a},yh=(e,t)=>(n,i)=>t(n,i,e);let zn=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}};zn=vh([Re(),yh(0,zc())],zn);var mh=Object.defineProperty,bh=Object.getOwnPropertyDescriptor,_h=(e,t,n,i)=>{for(var a=i>1?void 0:i?bh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&mh(t,n,a),a},wh=(e,t)=>(n,i)=>t(n,i,e);let So=class extends zn{constructor(e){super(e,"storage.components.githubStorage"),this.hashCode=function(t){let n=0,i,a;if(t.length===0)return""+n;for(i=0;i<t.length;i++)a=t.charCodeAt(i),n=(n<<5)-n+a,n|=0;return""+n}}async isStorageReady(){return!0}getPageRestURL(e,t,n){var a;(a=this.logger)==null||a.debug("GitHub Loading page",e);let i=this.wikiConfig.baseRestURL;return n&&(i=i.replace(/\/[^/]*\/$/,`/${n}/`)),i+e}getPageFromViewURL(e){let t=null;return e.startsWith(this.wikiConfig.baseURL)&&(t=e.replace(this.wikiConfig.baseURL,"")),t}getImageURL(e,t){const n=e.replace(/[^/]*$/,"");return`${this.wikiConfig.baseRestURL}${n}${t}`}async getPageContent(e,t,n){var m;(m=this.logger)==null||m.debug("GitHub Loading page",e);const i=this.getPageRestURL(e,t,n),s=await(await fetch(i,{cache:"no-store"})).text();let l="";t=="json"?l="":t=="md"||t=="html"?l=s:l="";const d=new _n;return d.id=e,d.name=e.split("/").pop(),d.source=l,d.syntax="md",d.css=[],d.version=this.hashCode(l),d}getAttachments(){throw new Error("unsupported")}getAttachment(){throw new Error("unsupported")}async getPanelContent(){return new _n}async getEditField(){return""}save(){throw new Error("Save not supported")}async saveAttachments(){throw new Error("unsupported")}async delete(){throw new Error("Delete not supported")}};So=_h([Re(),wh(0,Oe("Logger"))],So);let Eh=class{constructor(t){t.bind("WikiConfig").to(Eo).whenTargetNamed("GitHub"),t.bind("Storage").to(So).whenTargetNamed("GitHub")}};var Sh=Object.defineProperty,Oh=Object.getOwnPropertyDescriptor,xh=(e,t,n,i)=>{for(var a=i>1?void 0:i?Oh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&Sh(t,n,a),a},$r=(e,t)=>(n,i)=>t(n,i,e);let Oo=class extends Hn{constructor(e,t,n){super(e),this.cristal=n,this.storage=t,this.storage.setWikiConfig(this)}isSupported(e){return e=="html"}defaultPageName(){return"home"}getType(){return"Nextcloud"}};Oo=xh([Re(),$r(0,Oe("Logger")),$r(1,Oe("Storage")),$r(1,Li("Nextcloud")),$r(2,Oe("CristalApp"))],Oo);var Ah=Object.defineProperty,Ch=Object.getOwnPropertyDescriptor,Ph=(e,t,n,i)=>{for(var a=i>1?void 0:i?Ch(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&Ah(t,n,a),a},Th=(e,t)=>(n,i)=>t(n,i,e);const Jt="test",Dh="test";let xo=class extends zn{constructor(e){super(e,"storage.components.nextcloudStorage"),this.ATTACHMENTS="attachments"}async getEditField(){return""}getImageURL(){return""}async getPageContent(e){const t=this.getWikiConfig().baseRestURL,n=this.getBaseHeaders();try{const i=await fetch(`${t}/${Jt}/.cristal/${e}/page.json`,{method:"GET",headers:n});if(i.status>=200&&i.status<300){const a=await i.json();return{...a,id:e,headline:a.name,headlineRaw:a.name}}else return}catch{return}}async getAttachments(e){const t=await fetch(this.getAttachmentsBasePath(e),{method:"PROPFIND",headers:{...this.getBaseHeaders(),Depth:"1",Accept:"application/json"}});if(t.status>=200&&t.status<300){const n=await t.text(),a=new window.DOMParser().parseFromString(n,"text/xml").getElementsByTagName("d:response"),s=[];for(let l=0;l<a.length;l++){const d=a[l];d.getElementsByTagName("d:getcontenttype").length>0&&s.push(this.parseAttachment(d))}return{attachments:s}}else return}async getAttachment(e,t){const n=await fetch(this.getAttachmentBasePath(t,e),{method:"PROPFIND",headers:{...this.getBaseHeaders(),Depth:"1",Accept:"application/json"}});if(n.status>=200&&n.status<300){const i=await n.text(),s=new window.DOMParser().parseFromString(i,"text/xml").getElementsByTagName("d:response")[0];return this.parseAttachment(s)}else return}getAttachmentsBasePath(e){return`${this.getWikiConfig().baseRestURL}/${Jt}/.cristal/${e}/${this.ATTACHMENTS}`}getAttachmentBasePath(e,t){return`${this.getAttachmentsBasePath(t)}/${e}`}async save(e,t,n){const i=e.split("/"),a=`${this.getWikiConfig().baseRestURL}/${Jt}/.cristal`;await this.createIntermediateDirectories(a,i),await fetch(`${a}/${i.join("/")}/page.json`,{method:"PUT",headers:this.getBaseHeaders(),body:JSON.stringify({source:t,name:n,syntax:"markdown/1.2"})})}async createIntermediateDirectories(e,t){await this.createDirectory(e);for(let n=0;n<t.length;n++)await this.createDirectory(`${e}/${t.slice(0,n+1).join("/")}`)}async saveAttachments(e,t){return Promise.all(t.map(n=>this.saveAttachment(e,n)))}async saveAttachment(e,t){const n=e.split("/"),i=`${this.getWikiConfig().baseRestURL}/${Jt}/.cristal`;await this.createIntermediateDirectories(i,[...n,this.ATTACHMENTS]);const a=this.getAttachmentsBasePath(e)+"/"+t.name,s=new FormData;s.append(t.name,t),await fetch(a,{method:"PUT",headers:this.getBaseHeaders(),body:s})}getPageFromViewURL(){return null}getPageRestURL(){return""}async getPanelContent(){return new _n}async delete(e){const t=`${this.getWikiConfig().baseRestURL}/${Jt}/.cristal`;return await fetch(`${t}/${e}`,{method:"DELETE",headers:this.getBaseHeaders()}).then(async i=>i.ok?{success:!0}:{success:!1,error:await i.text()})}async isStorageReady(){return!0}async createDirectory(e){await fetch(e,{method:"MKCOL",headers:this.getBaseHeaders()})}getBaseHeaders(){return{Authorization:`Basic ${btoa(`${Jt}:${Dh}`)}`}}parseAttachment(e){const t=e.getElementsByTagName("d:href")[0].textContent,n=e.getElementsByTagName("d:getcontenttype")[0].textContent,i=parseInt(e.getElementsByTagName("d:getcontentlength")[0].textContent),a=Date.parse(e.getElementsByTagName("d:getlastmodified")[0].textContent),s=t.split("/"),l=`${this.getWikiConfig().baseRestURL}/${Jt}/${s.slice(5).join("/")}`,d=s[s.length-1];return{mimetype:n,reference:d,id:t,href:l,size:i,date:new Date(a),author:void 0}}};xo=Ph([Re(),Th(0,Oe("Logger"))],xo);let Ih=class{constructor(t){t.bind("WikiConfig").to(Oo).whenTargetNamed("Nextcloud"),t.bind("Storage").to(xo).whenTargetNamed("Nextcloud")}};var Nh=Object.defineProperty,Rh=Object.getOwnPropertyDescriptor,Mh=(e,t,n,i)=>{for(var a=i>1?void 0:i?Rh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&Nh(t,n,a),a},Vr=(e,t)=>(n,i)=>t(n,i,e);let Ao=class extends Hn{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"}getType(){return"XWiki"}getNewPageDefaultName(){return"NewPage.WebHome"}};Ao=Mh([Re(),Vr(0,Oe("Logger")),Vr(1,Oe("Storage")),Vr(1,Li("XWiki")),Vr(2,Oe("CristalApp"))],Ao);function kh(e,t){const n=t.split(":"),i=n.length>1?n[0]:"xwiki",a=n.length>1?n[1]:n[0];return`${e.baseURL}/rest/wikis/${i}/spaces/${encodeURIComponent(a).replace(/((?:%5C%5C)*)%5C\./g,"$1%2E").replace(/%5C%5C/g,"%5C").replace(/\.(?=.*\.)/g,"/spaces/").replace(/\./,"/pages/")}`}var jh=Object.defineProperty,Lh=Object.getOwnPropertyDescriptor,Fh=(e,t,n,i)=>{for(var a=i>1?void 0:i?Lh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&jh(t,n,a),a},Ds=(e,t)=>(n,i)=>t(n,i,e);let Co=class extends zn{constructor(e,t){super(e,"storage.components.xwikiStorage"),this.authenticationManagerProvider=t}async isStorageReady(){return!0}getPageRestURL(e,t,n){var s;(s=this.logger)==null||s.debug("XWiki Loading page",e);const i=new URL(this.wikiConfig.baseURL+this.wikiConfig.baseRestURL),a=new URLSearchParams([["page",e],["format",t]]);return n&&a.append("revision",n),i.search=a.toString(),i.toString()}getPageFromViewURL(e){let t;return e.startsWith(this.wikiConfig.baseURL)?(t=e.replace(this.wikiConfig.baseURL,"").replace("/bin","").replace("/view/","").replaceAll("%5C","%5C%5C").replaceAll(".","%5C.").replaceAll("/","."),t.endsWith(".")&&(t+="WebHome"),t=decodeURIComponent(t)):t=null,t}getImageURL(e,t){var i;e==""&&(e="Main.WebHome");const n=this.wikiConfig.baseURL+"/bin/download/"+e.replace(".","/")+"/"+t;return(i=this.logger)==null||i.debug("final image url ",n),n}async getPageContent(e,t,n){var T,E,L,z,X,se;(T=this.logger)==null||T.debug("XWiki Loading page",e),e==""&&(e="Main.WebHome");const i=this.getPageRestURL(e,t,n);(E=this.logger)==null||E.debug("XWiki Loading url",i);const a=await fetch(i,{cache:"no-store"});let s;try{s=await a.json()}catch{return}let l="",d="",m={};t=="jsonld"?(m=s,this.wikiConfig.serverRendering?((L=this.logger)==null||L.debug("Using server side rendering for jsonld"),l=s.source,d=s.html):((z=this.logger)==null||z.debug("Using client side rendering for jsonld"),l=s.source,d="")):t=="html"?this.wikiConfig.serverRendering?((X=this.logger)==null||X.debug("Using server side rendering for html"),l=s.source,d=""):((se=this.logger)==null||se.debug("Using client side rendering for html"),l=s.source,d=""):(l="",d="");const g=new _n;return g.source=l,g.syntax="xwiki",g.html=d,g.document=new yo(m),g.css=s.css,g.js=s.js,g.version=g.document.get("version"),g.headlineRaw=s.headlineRaw,g.headline=s.headline,g.name=s.name,g}async getAttachments(e){return{attachments:(await(await fetch(this.buildAttachmentsURL(e),{headers:{Accept:"application/json",...await this.getCredentials()}})).json()).attachments.map(({id:a,name:s,mimeType:l,xwikiAbsoluteUrl:d,size:m,date:g,author:T})=>({id:a,reference:s,mimetype:l,href:d,size:m,date:g,author:T}))}}async getAttachment(e,t){const n=await this.getAttachments(e);if(n)return n.attachments.filter(i=>i.reference==t)[0]}async getPanelContent(e,t){var l;const n=this.wikiConfig.baseURL+"/rest/cristal/panel?media=json&page="+t+"&panel="+e;(l=this.logger)==null||l.debug("XWiki Loading url",n);const a=await(await fetch(n,{cache:"no-store"})).json(),s=new _n;return s.source=a.source,s.syntax="xwiki",s.html=a.content,s.css=a.css,s.js=a.js,s}async getEditField(e,t){var n,i;try{const a=e.get("xwikiMapping")[t];let s=a.type,l=a.fieldName;s==null&&(s="document"),l==null&&(l=t);const d=this.wikiConfig.baseURL+"/bin/get/"+e.getIdentifier().replaceAll(".","/")+"?xpage=display&mode=edit&type="+s+"&property="+e.get("className")+"."+l;return(n=this.logger)==null||n.debug("XWiki Loading Field url",d),await(await fetch(d,{cache:"no-store"})).text()}catch(a){return(i=this.logger)==null||i.error("Exception looking for edit field for field",t,a),""}}async save(e,t,n){const i=this.buildSavePageURL(e,["rest","wikis","xwiki"]);await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json",...await this.getCredentials()},body:JSON.stringify({content:t,title:n,syntax:"markdown/1.2"})})}async saveAttachments(e,t){return Promise.all(t.map(n=>this.saveAttachment(e,n)))}async saveAttachment(e,t){const n=new FormData;n.append(t.name,t);const i=await fetch(this.buildAttachmentsURL(e)+"/"+t.name,{method:"PUT",body:n,headers:{...await this.getCredentials(),"Content-Type":t.type}});if(!i.ok)throw new Error(`Failed to upload the attachment. Reason: [${i.statusText}]`)}async delete(e){const t=this.buildSavePageURL(e,["rest","wikis","xwiki"]);return await fetch(t,{method:"DELETE",headers:{"Content-Type":"application/json",...await this.getCredentials()}}).then(async i=>i.ok?{success:!0}:{success:!1,error:await i.text()})}async getCredentials(){var n;const e=await((n=this.authenticationManagerProvider.get())==null?void 0:n.getAuthorizationHeader()),t={};return e&&(t.Authorization=e),t}buildSavePageURL(e,t){const n=this.wikiConfig.baseURL,i=e.split(".");for(let a=0;a<i.length;a++){const s=a<i.length-1?"spaces":"pages";t.push(s),t.push(i[a])}return`${n}/${t.join("/")}`}buildAttachmentsURL(e){return`${kh(this.wikiConfig,e)}/attachments`}};Co=Fh([Re(),Ds(0,Oe("Logger")),Ds(1,Oe("AuthenticationManagerProvider"))],Co);let Bh=class{constructor(t){t.bind("WikiConfig").to(Ao).whenTargetNamed("XWiki"),t.bind("Storage").to(Co).whenTargetNamed("XWiki")}};/*! *****************************************************************************
|
|
29
|
-
Copyright (C) Microsoft. All rights reserved.
|
|
30
|
-
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
31
|
-
this file except in compliance with the License. You may obtain a copy of the
|
|
32
|
-
License at http://www.apache.org/licenses/LICENSE-2.0
|
|
33
|
-
|
|
34
|
-
THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
35
|
-
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
|
|
36
|
-
WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
|
|
37
|
-
MERCHANTABLITY OR NON-INFRINGEMENT.
|
|
38
|
-
|
|
39
|
-
See the Apache Version 2.0 License for specific language governing permissions
|
|
40
|
-
and limitations under the License.
|
|
41
|
-
***************************************************************************** */var Is;(function(e){(function(t){var n=typeof globalThis=="object"?globalThis:typeof yr=="object"?yr:typeof self=="object"?self:typeof this=="object"?this:d(),i=a(e);typeof n.Reflect<"u"&&(i=a(n.Reflect,i)),t(i,n),typeof n.Reflect>"u"&&(n.Reflect=e);function a(m,g){return function(T,E){Object.defineProperty(m,T,{configurable:!0,writable:!0,value:E}),g&&g(T,E)}}function s(){try{return Function("return this;")()}catch{}}function l(){try{return(0,eval)("(function() { return this; })()")}catch{}}function d(){return s()||l()}})(function(t,n){var i=Object.prototype.hasOwnProperty,a=typeof Symbol=="function",s=a&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",l=a&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",d=typeof Object.create=="function",m={__proto__:[]}instanceof Array,g=!d&&!m,T={create:d?function(){return Lt(Object.create(null))}:m?function(){return Lt({__proto__:null})}:function(){return Lt({})},has:g?function(P,I){return i.call(P,I)}:function(P,I){return I in P},get:g?function(P,I){return i.call(P,I)?P[I]:void 0}:function(P,I){return P[I]}},E=Object.getPrototypeOf(Function),L=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Yn(),z=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:on(),X=typeof WeakMap=="function"?WeakMap:Qn(),se=a?Symbol.for("@reflect-metadata:registry"):void 0,qe=nn(),Xe=oi(qe);function He(P,I,j,K){if(J(j)){if(!tn(P))throw new TypeError;if(!jt(I))throw new TypeError;return Zt(P,I)}else{if(!tn(P))throw new TypeError;if(!me(I))throw new TypeError;if(!me(K)&&!J(K)&&!Ze(K))throw new TypeError;return Ze(K)&&(K=void 0),j=et(j),Ot(P,I,j,K)}}t("decorate",He);function gt(P,I){function j(K,F){if(!me(K))throw new TypeError;if(!J(F)&&!Mo(F))throw new TypeError;vt(P,I,K,F)}return j}t("metadata",gt);function ne(P,I,j,K){if(!me(j))throw new TypeError;return J(K)||(K=et(K)),vt(P,I,j,K)}t("defineMetadata",ne);function Fe(P,I,j){if(!me(I))throw new TypeError;return J(j)||(j=et(j)),Qr(P,I,j)}t("hasMetadata",Fe);function Be(P,I,j){if(!me(I))throw new TypeError;return J(j)||(j=et(j)),en(P,I,j)}t("hasOwnMetadata",Be);function Pe(P,I,j){if(!me(I))throw new TypeError;return J(j)||(j=et(j)),En(P,I,j)}t("getMetadata",Pe);function zr(P,I,j){if(!me(I))throw new TypeError;return J(j)||(j=et(j)),Jr(P,I,j)}t("getOwnMetadata",zr);function Ro(P,I){if(!me(P))throw new TypeError;return J(I)||(I=et(I)),xt(P,I)}t("getMetadataKeys",Ro);function Gr(P,I){if(!me(P))throw new TypeError;return J(I)||(I=et(I)),st(P,I)}t("getOwnMetadataKeys",Gr);function Yr(P,I,j){if(!me(I))throw new TypeError;if(J(j)||(j=et(j)),!me(I))throw new TypeError;J(j)||(j=et(j));var K=ht(I,j,!1);return J(K)?!1:K.OrdinaryDeleteMetadata(P,I,j)}t("deleteMetadata",Yr);function Zt(P,I){for(var j=P.length-1;j>=0;--j){var K=P[j],F=K(I);if(!J(F)&&!Ze(F)){if(!jt(F))throw new TypeError;I=F}}return I}function Ot(P,I,j,K){for(var F=P.length-1;F>=0;--F){var be=P[F],pe=be(I,j,K);if(!J(pe)&&!Ze(pe)){if(!me(pe))throw new TypeError;K=pe}}return K}function Qr(P,I,j){var K=en(P,I,j);if(K)return!0;var F=ze(I);return Ze(F)?!1:Qr(P,F,j)}function en(P,I,j){var K=ht(I,j,!1);return J(K)?!1:Zr(K.OrdinaryHasOwnMetadata(P,I,j))}function En(P,I,j){var K=en(P,I,j);if(K)return Jr(P,I,j);var F=ze(I);if(!Ze(F))return En(P,F,j)}function Jr(P,I,j){var K=ht(I,j,!1);if(!J(K))return K.OrdinaryGetOwnMetadata(P,I,j)}function vt(P,I,j,K){var F=ht(j,K,!0);F.OrdinaryDefineOwnMetadata(P,I,j,K)}function xt(P,I){var j=st(P,I),K=ze(P);if(K===null)return j;var F=xt(K,I);if(F.length<=0)return j;if(j.length<=0)return F;for(var be=new z,pe=[],ee=0,N=j;ee<N.length;ee++){var H=N[ee],G=be.has(H);G||(be.add(H),pe.push(H))}for(var Y=0,re=F;Y<re.length;Y++){var H=re[Y],G=be.has(H);G||(be.add(H),pe.push(H))}return pe}function st(P,I){var j=ht(P,I,!1);return j?j.OrdinaryOwnMetadataKeys(P,I):[]}function Sn(P){if(P===null)return 1;switch(typeof P){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return P===null?1:6;default:return 6}}function J(P){return P===void 0}function Ze(P){return P===null}function Xr(P){return typeof P=="symbol"}function me(P){return typeof P=="object"?P!==null:typeof P=="function"}function kt(P,I){switch(Sn(P)){case 0:return P;case 1:return P;case 2:return P;case 3:return P;case 4:return P;case 5:return P}var j="string",K=ei(P,s);if(K!==void 0){var F=K.call(P,j);if(me(F))throw new TypeError;return F}return Gn(P)}function Gn(P,I){var j,K;{var F=P.toString;if(ce(F)){var K=F.call(P);if(!me(K))return K}var j=P.valueOf;if(ce(j)){var K=j.call(P);if(!me(K))return K}}throw new TypeError}function Zr(P){return!!P}function Q(P){return""+P}function et(P){var I=kt(P);return Xr(I)?I:Q(I)}function tn(P){return Array.isArray?Array.isArray(P):P instanceof Object?P instanceof Array:Object.prototype.toString.call(P)==="[object Array]"}function ce(P){return typeof P=="function"}function jt(P){return typeof P=="function"}function Mo(P){switch(Sn(P)){case 3:return!0;case 4:return!0;default:return!1}}function ft(P,I){return P===I||P!==P&&I!==I}function ei(P,I){var j=P[I];if(j!=null){if(!ce(j))throw new TypeError;return j}}function ti(P){var I=ei(P,l);if(!ce(I))throw new TypeError;var j=I.call(P);if(!me(j))throw new TypeError;return j}function ni(P){return P.value}function ri(P){var I=P.next();return I.done?!1:I}function On(P){var I=P.return;I&&I.call(P)}function ze(P){var I=Object.getPrototypeOf(P);if(typeof P!="function"||P===E||I!==E)return I;var j=P.prototype,K=j&&Object.getPrototypeOf(j);if(K==null||K===Object.prototype)return I;var F=K.constructor;return typeof F!="function"||F===P?I:F}function ii(){var P;!J(se)&&typeof n.Reflect<"u"&&!(se in n.Reflect)&&typeof n.Reflect.defineMetadata=="function"&&(P=rn(n.Reflect));var I,j,K,F=new X,be={registerProvider:pe,getProvider:N,setProvider:G};return be;function pe(Y){if(!Object.isExtensible(be))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case P===Y:break;case J(I):I=Y;break;case I===Y:break;case J(j):j=Y;break;case j===Y:break;default:K===void 0&&(K=new z),K.add(Y);break}}function ee(Y,re){if(!J(I)){if(I.isProviderFor(Y,re))return I;if(!J(j)){if(j.isProviderFor(Y,re))return I;if(!J(K))for(var de=ti(K);;){var we=ri(de);if(!we)return;var tt=ni(we);if(tt.isProviderFor(Y,re))return On(de),tt}}}if(!J(P)&&P.isProviderFor(Y,re))return P}function N(Y,re){var de=F.get(Y),we;return J(de)||(we=de.get(re)),J(we)&&(we=ee(Y,re),J(we)||(J(de)&&(de=new L,F.set(Y,de)),de.set(re,we))),we}function H(Y){if(J(Y))throw new TypeError;return I===Y||j===Y||!J(K)&&K.has(Y)}function G(Y,re,de){if(!H(de))throw new Error("Metadata provider not registered.");var we=N(Y,re);if(we!==de){if(!J(we))return!1;var tt=F.get(Y);J(tt)&&(tt=new L,F.set(Y,tt)),tt.set(re,de)}return!0}}function nn(){var P;return!J(se)&&me(n.Reflect)&&Object.isExtensible(n.Reflect)&&(P=n.Reflect[se]),J(P)&&(P=ii()),!J(se)&&me(n.Reflect)&&Object.isExtensible(n.Reflect)&&Object.defineProperty(n.Reflect,se,{enumerable:!1,configurable:!1,writable:!1,value:P}),P}function oi(P){var I=new X,j={isProviderFor:function(H,G){var Y=I.get(H);return J(Y)?!1:Y.has(G)},OrdinaryDefineOwnMetadata:pe,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:be,OrdinaryOwnMetadataKeys:ee,OrdinaryDeleteMetadata:N};return qe.registerProvider(j),j;function K(H,G,Y){var re=I.get(H),de=!1;if(J(re)){if(!Y)return;re=new L,I.set(H,re),de=!0}var we=re.get(G);if(J(we)){if(!Y)return;if(we=new L,re.set(G,we),!P.setProvider(H,G,j))throw re.delete(G),de&&I.delete(H),new Error("Wrong provider for target.")}return we}function F(H,G,Y){var re=K(G,Y,!1);return J(re)?!1:Zr(re.has(H))}function be(H,G,Y){var re=K(G,Y,!1);if(!J(re))return re.get(H)}function pe(H,G,Y,re){var de=K(Y,re,!0);de.set(H,G)}function ee(H,G){var Y=[],re=K(H,G,!1);if(J(re))return Y;for(var de=re.keys(),we=ti(de),tt=0;;){var At=ri(we);if(!At)return Y.length=tt,Y;var Ft=ni(At);try{Y[tt]=Ft}catch(Jn){try{On(we)}finally{throw Jn}}tt++}}function N(H,G,Y){var re=K(G,Y,!1);if(J(re)||!re.delete(H))return!1;if(re.size===0){var de=I.get(G);J(de)||(de.delete(Y),de.size===0&&I.delete(de))}return!0}}function rn(P){var I=P.defineMetadata,j=P.hasOwnMetadata,K=P.getOwnMetadata,F=P.getOwnMetadataKeys,be=P.deleteMetadata,pe=new X,ee={isProviderFor:function(N,H){var G=pe.get(N);return!J(G)&&G.has(H)?!0:F(N,H).length?(J(G)&&(G=new z,pe.set(N,G)),G.add(H),!0):!1},OrdinaryDefineOwnMetadata:I,OrdinaryHasOwnMetadata:j,OrdinaryGetOwnMetadata:K,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:be};return ee}function ht(P,I,j){var K=qe.getProvider(P,I);if(!J(K))return K;if(j){if(qe.setProvider(P,I,Xe))return Xe;throw new Error("Illegal state.")}}function Yn(){var P={},I=[],j=function(){function ee(N,H,G){this._index=0,this._keys=N,this._values=H,this._selector=G}return ee.prototype["@@iterator"]=function(){return this},ee.prototype[l]=function(){return this},ee.prototype.next=function(){var N=this._index;if(N>=0&&N<this._keys.length){var H=this._selector(this._keys[N],this._values[N]);return N+1>=this._keys.length?(this._index=-1,this._keys=I,this._values=I):this._index++,{value:H,done:!1}}return{value:void 0,done:!0}},ee.prototype.throw=function(N){throw this._index>=0&&(this._index=-1,this._keys=I,this._values=I),N},ee.prototype.return=function(N){return this._index>=0&&(this._index=-1,this._keys=I,this._values=I),{value:N,done:!0}},ee}(),K=function(){function ee(){this._keys=[],this._values=[],this._cacheKey=P,this._cacheIndex=-2}return Object.defineProperty(ee.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),ee.prototype.has=function(N){return this._find(N,!1)>=0},ee.prototype.get=function(N){var H=this._find(N,!1);return H>=0?this._values[H]:void 0},ee.prototype.set=function(N,H){var G=this._find(N,!0);return this._values[G]=H,this},ee.prototype.delete=function(N){var H=this._find(N,!1);if(H>=0){for(var G=this._keys.length,Y=H+1;Y<G;Y++)this._keys[Y-1]=this._keys[Y],this._values[Y-1]=this._values[Y];return this._keys.length--,this._values.length--,ft(N,this._cacheKey)&&(this._cacheKey=P,this._cacheIndex=-2),!0}return!1},ee.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=P,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,be)},ee.prototype.entries=function(){return new j(this._keys,this._values,pe)},ee.prototype["@@iterator"]=function(){return this.entries()},ee.prototype[l]=function(){return this.entries()},ee.prototype._find=function(N,H){if(!ft(this._cacheKey,N)){this._cacheIndex=-1;for(var G=0;G<this._keys.length;G++)if(ft(this._keys[G],N)){this._cacheIndex=G;break}}return this._cacheIndex<0&&H&&(this._cacheIndex=this._keys.length,this._keys.push(N),this._values.push(void 0)),this._cacheIndex},ee}();return K;function F(ee,N){return ee}function be(ee,N){return N}function pe(ee,N){return[ee,N]}}function on(){var P=function(){function I(){this._map=new L}return Object.defineProperty(I.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),I.prototype.has=function(j){return this._map.has(j)},I.prototype.add=function(j){return this._map.set(j,j),this},I.prototype.delete=function(j){return this._map.delete(j)},I.prototype.clear=function(){this._map.clear()},I.prototype.keys=function(){return this._map.keys()},I.prototype.values=function(){return this._map.keys()},I.prototype.entries=function(){return this._map.entries()},I.prototype["@@iterator"]=function(){return this.keys()},I.prototype[l]=function(){return this.keys()},I}();return P}function Qn(){var P=16,I=T.create(),j=K();return function(){function N(){this._key=K()}return N.prototype.has=function(H){var G=F(H,!1);return G!==void 0?T.has(G,this._key):!1},N.prototype.get=function(H){var G=F(H,!1);return G!==void 0?T.get(G,this._key):void 0},N.prototype.set=function(H,G){var Y=F(H,!0);return Y[this._key]=G,this},N.prototype.delete=function(H){var G=F(H,!1);return G!==void 0?delete G[this._key]:!1},N.prototype.clear=function(){this._key=K()},N}();function K(){var N;do N="@@WeakMap@@"+ee();while(T.has(I,N));return I[N]=!0,N}function F(N,H){if(!i.call(N,j)){if(!H)return;Object.defineProperty(N,j,{value:T.create()})}return N[j]}function be(N,H){for(var G=0;G<H;++G)N[G]=Math.random()*255|0;return N}function pe(N){if(typeof Uint8Array=="function"){var H=new Uint8Array(N);return typeof crypto<"u"?crypto.getRandomValues(H):typeof msCrypto<"u"?msCrypto.getRandomValues(H):be(H,N),H}return be(new Array(N),N)}function ee(){var N=pe(P);N[6]=N[6]&79|64,N[8]=N[8]&191|128;for(var H="",G=0;G<P;++G){var Y=N[G];(G===4||G===6||G===8)&&(H+="-"),Y<16&&(H+="0"),H+=Y.toString(16).toLowerCase()}return H}}function Lt(P){return P.__=void 0,delete P.__,P}})})(Is||(Is={}));var $h=Object.defineProperty,Vh=Object.getOwnPropertyDescriptor,Kh=(e,t,n,i)=>{for(var a=i>1?void 0:i?Vh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&$h(t,n,a),a};let Po=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}};Po=Kh([Re()],Po);class Wh{constructor(t,n,i){this.name=t,this.entryFile=n,this.staticModule=i}}var Uh=Object.defineProperty,qh=Object.getOwnPropertyDescriptor,Hh=(e,t,n,i)=>{for(var a=i>1?void 0:i?qh(t,n):t,s=e.length-1,l;s>=0;s--)(l=e[s])&&(a=(i?l(t,n,a):l(a))||a);return i&&a&&Uh(t,n,a),a},zh=(e,t)=>(n,i)=>t(n,i,e);let To=class extends Po{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 Wh(e,t,n))}setRemoteExtensionsConfig(e,t){this.remoteExtensionDefaultURL=e,this.remoteExtensionDefaultEntryFile=t}async loadExtension(e,t){var n,i,a,s,l;try{const d=this.remoteExtensions.get(e),m=d&&d.entryFile?d.entryFile:this.remoteExtensionDefaultEntryFile,g=this.remoteExtensionDefaultURL+e+"/"+m,T=this.remoteExtensionDefaultURL+e+"/style.css";(n=this.logger)==null||n.debug("Ready to import ",g);try{const L=await import(T);document.adoptedStyleSheets=[L.default]}catch{}const E=await import(g);if(E!=null){(i=this.logger)==null||i.debug("Found components Init for ",e,E);const L=E.ComponentInit;new L(t),(a=this.logger)==null||a.debug("Succesfull components Init for ",e)}else(s=this.logger)==null||s.debug("No components to load for ",e);return}catch(d){(l=this.logger)==null||l.error("Exception while loading components from ",e,d)}}async loadExtensions(e){for(const t of this.remoteExtensions.keys())await this.loadExtension(t,e)}};To=Hh([Re(),zh(0,Oe("Logger"))],To);class Gh{constructor(t){var n,i;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(To),(i=this.logger)==null||i.debug("Init Extension Manager components end")}}class Yh{constructor(t){this.extensionList=t}getLogger(t){let n=this.container.get("Logger");return n||(n=new Fr),n.setModule(t),n}async loadExtensionManager(t){var a,s,l,d,m,g;const n="extension-manager",i="/apps/"+n+"/main.bundle.dev.js";try{if(t)(a=this.logger)==null||a.debug("Loading static extension Manager"),new Gh(this.container);else{(s=this.logger)==null||s.debug("Dynamic extension Manager. Ready to import ",i);const T=await import(i);if(T!=null){(l=this.logger)==null||l.debug("Found components Init for ",n,T);const E=T.ComponentInit;new E(this.container),(d=this.logger)==null||d.debug("Succesfull components Init for ",n)}else(m=this.logger)==null||m.debug("No components to load for ",n)}}catch(T){(g=this.logger)==null||g.error("Exception while loading extension Manager from ",i,T)}}async loadExtensions(t,n){var a,s,l,d;(a=this.logger)==null||a.debug("Start app"),await this.loadExtensionManager(t);const i=this.container.get("ExtensionManager");if((s=this.logger)==null||s.debug("Extension Manager is ",i),i!=null){if(!n){i.setRemoteExtensionsConfig("/apps/","main.bundle.dev.js");for(const m in this.extensionList)i.addRemoteExtension(m,"",!0);await i.loadExtensions(this.container)}(l=this.logger)==null||l.debug("After extensions loading")}else(d=this.logger)==null||d.debug("Could not start extension Manager");return i}initializeContainer(){var n;this.container=new Bc,this.container.bind("LoggerConfig").to(mo).inSingletonScope(),this.container.bind("Logger").to(Fr);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 i=t.indexOf("/",1);i!=-1&&(n=t.substring(1,i))}return(n==null||n=="")&&(n="XWiki"),n}}/**
|
|
42
|
-
* @license
|
|
43
|
-
* Copyright 2019 Google LLC
|
|
44
|
-
* SPDX-License-Identifier: Apache-2.0
|
|
45
|
-
*/const Ns=Symbol("Comlink.proxy"),Qh=Symbol("Comlink.endpoint"),Jh=Symbol("Comlink.releaseProxy"),Do=Symbol("Comlink.finalizer"),Kr=Symbol("Comlink.thrown"),Rs=e=>typeof e=="object"&&e!==null||typeof e=="function",Xh={canHandle:e=>Rs(e)&&e[Ns],serialize(e){const{port1:t,port2:n}=new MessageChannel;return Io(e,t),[n,[n]]},deserialize(e){return e.start(),nd(e)}},Zh={canHandle:e=>Rs(e)&&Kr 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}},Ms=new Map([["proxy",Xh],["throw",Zh]]);function ed(e,t){for(const n of e)if(t===n||n==="*"||n instanceof RegExp&&n.test(t))return!0;return!1}function Io(e,t=globalThis,n=["*"]){t.addEventListener("message",function i(a){if(!a||!a.data)return;if(!ed(n,a.origin)){console.warn(`Invalid origin '${a.origin}' for comlink proxy`);return}const{id:s,type:l,path:d}=Object.assign({path:[]},a.data),m=(a.data.argumentList||[]).map(Xt);let g;try{const T=d.slice(0,-1).reduce((L,z)=>L[z],e),E=d.reduce((L,z)=>L[z],e);switch(l){case"GET":g=E;break;case"SET":T[d.slice(-1)[0]]=Xt(a.data.value),g=!0;break;case"APPLY":g=E.apply(T,m);break;case"CONSTRUCT":{const L=new E(...m);g=sd(L)}break;case"ENDPOINT":{const{port1:L,port2:z}=new MessageChannel;Io(e,z),g=ad(L,[L])}break;case"RELEASE":g=void 0;break;default:return}}catch(T){g={value:T,[Kr]:0}}Promise.resolve(g).catch(T=>({value:T,[Kr]:0})).then(T=>{const[E,L]=Hr(T);t.postMessage(Object.assign(Object.assign({},E),{id:s}),L),l==="RELEASE"&&(t.removeEventListener("message",i),ks(t),Do in e&&typeof e[Do]=="function"&&e[Do]())}).catch(T=>{const[E,L]=Hr({value:new TypeError("Unserializable return value"),[Kr]:0});t.postMessage(Object.assign(Object.assign({},E),{id:s}),L)})}),t.start&&t.start()}function td(e){return e.constructor.name==="MessagePort"}function ks(e){td(e)&&e.close()}function nd(e,t){return No(e,[],t)}function Wr(e){if(e)throw new Error("Proxy has been released and is not useable")}function js(e){return wn(e,{type:"RELEASE"}).then(()=>{ks(e)})}const Ur=new WeakMap,qr="FinalizationRegistry"in globalThis&&new FinalizationRegistry(e=>{const t=(Ur.get(e)||0)-1;Ur.set(e,t),t===0&&js(e)});function rd(e,t){const n=(Ur.get(t)||0)+1;Ur.set(t,n),qr&&qr.register(e,t,e)}function id(e){qr&&qr.unregister(e)}function No(e,t=[],n=function(){}){let i=!1;const a=new Proxy(n,{get(s,l){if(Wr(i),l===Jh)return()=>{id(a),js(e),i=!0};if(l==="then"){if(t.length===0)return{then:()=>a};const d=wn(e,{type:"GET",path:t.map(m=>m.toString())}).then(Xt);return d.then.bind(d)}return No(e,[...t,l])},set(s,l,d){Wr(i);const[m,g]=Hr(d);return wn(e,{type:"SET",path:[...t,l].map(T=>T.toString()),value:m},g).then(Xt)},apply(s,l,d){Wr(i);const m=t[t.length-1];if(m===Qh)return wn(e,{type:"ENDPOINT"}).then(Xt);if(m==="bind")return No(e,t.slice(0,-1));const[g,T]=Ls(d);return wn(e,{type:"APPLY",path:t.map(E=>E.toString()),argumentList:g},T).then(Xt)},construct(s,l){Wr(i);const[d,m]=Ls(l);return wn(e,{type:"CONSTRUCT",path:t.map(g=>g.toString()),argumentList:d},m).then(Xt)}});return rd(a,e),a}function od(e){return Array.prototype.concat.apply([],e)}function Ls(e){const t=e.map(Hr);return[t.map(n=>n[0]),od(t.map(n=>n[1]))]}const Fs=new WeakMap;function ad(e,t){return Fs.set(e,t),e}function sd(e){return Object.assign(e,{[Ns]:!0})}function Hr(e){for(const[t,n]of Ms)if(n.canHandle(e)){const[i,a]=n.serialize(e);return[{type:"HANDLER",name:t,value:i},a]}return[{type:"RAW",value:e},Fs.get(e)||[]]}function Xt(e){switch(e.type){case"HANDLER":return Ms.get(e.name).deserialize(e.value);case"RAW":return e.value}}function wn(e,t,n){return new Promise(i=>{const a=ud();e.addEventListener("message",function s(l){!l.data||!l.data.id||l.data.id!==a||(e.removeEventListener("message",s),i(l.data))}),e.start&&e.start(),e.postMessage(Object.assign({id:a},t),n)})}function ud(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}class cd{constructor(){this.currentNumber=0,this.queue=[],this.initialized=!1}async start(){for(console.log("Starting worker thread"),await this.initialize();;)await this.sleep(1e3),await 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,i=null,a=null;const s=t.indexOf(":"),l=t.lastIndexOf("_");if(s!=-1&&l!=-1){n=t.substring(0,s),i=t.substring(s+1,l),a=t.substring(l+1);const d=this.getWikiConfig(n);d==null?console.log("Could not find config for page",t):(console.log("Updating page ",i,a),await d.storage.updatePageContent(i,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 s;try{return s=this.container.getNamed("WikiConfig",a),this.cristal.setWikiConfig(s),s.setConfigFromObject(n),s.initialize(),console.debug("Found wikiConfig for",t,"and type",a,":",s),s}catch(l){console.error("Failed to find wikiConfig for name",t,"and type",a,l);return}}async initialize(){console.log("Starting initialize");const t=["storage"],i=await(await fetch("/config.json")).json();this.configMap=new Map(Object.entries(i)),console.log("Loaded json config",this.configMap);const a=new Yh(t);a.initializeContainer(),this.container=a.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(Fi).inSingletonScope(),this.container.bind("QueueWorker").to(Bi).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new lh(a.container),new Eh(a.container),new Ih(a.container),new Bh(a.container),new il(a.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const Bs=new cd;Bs.start(),onconnect=e=>{Io(Bs,e.ports[0])},console.log("Worker code loaded")})();
|
|
46
|
-
//# sourceMappingURL=worker-ZwjuRGo7.js.map
|