@openmrs/esm-app-shell 5.0.1-pre.815 → 5.0.2-pre.818
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/.turbo/turbo-build.log +101 -100
- package/dist/{e071d971c938113d.js → ba80afe9ce7ebeab.js} +1 -1
- package/dist/{e071d971c938113d.js.map → ba80afe9ce7ebeab.js.map} +1 -1
- package/dist/{980084ac919b4e2a.js → c8bb98d9538f8dde.js} +1 -1
- package/dist/{980084ac919b4e2a.js.map → c8bb98d9538f8dde.js.map} +1 -1
- package/dist/index.html +1 -1
- package/dist/{openmrs.e755c97908e1ebcf.js → openmrs.de9d7791e924ceba.js} +2 -2
- package/dist/{openmrs.e755c97908e1ebcf.js.map → openmrs.de9d7791e924ceba.js.map} +1 -1
- package/dist/service-worker.js +1 -1
- package/lib/esm-devtools-app/main.js +1 -1
- package/lib/esm-devtools-app/openmrs-esm-devtools-app.js +1 -1
- package/lib/esm-devtools-app/openmrs-esm-devtools-app.js.buildmanifest.json +2 -2
- package/lib/esm-devtools-app/routes.json +1 -1
- package/lib/esm-implementer-tools-app/main.js +1 -1
- package/lib/esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js +1 -1
- package/lib/esm-implementer-tools-app/openmrs-esm-implementer-tools-app.js.buildmanifest.json +2 -2
- package/lib/esm-implementer-tools-app/routes.json +1 -1
- package/lib/esm-login-app/236.js +1 -0
- package/lib/esm-login-app/240.js +1 -0
- package/lib/esm-login-app/263.js +1 -0
- package/lib/{esm-primary-navigation-app → esm-login-app}/263.js.map +1 -1
- package/lib/esm-login-app/272.js +1 -0
- package/lib/esm-login-app/273.js +1 -0
- package/lib/esm-login-app/273.js.map +1 -0
- package/lib/esm-login-app/319.js +1 -0
- package/lib/esm-login-app/336.js +1 -0
- package/lib/esm-login-app/390.js +1 -0
- package/lib/esm-login-app/390.js.map +1 -0
- package/lib/{esm-primary-navigation-app/545.js → esm-login-app/403.js} +1 -1
- package/lib/esm-login-app/403.js.map +1 -0
- package/lib/esm-login-app/438.js +2 -0
- package/lib/esm-login-app/438.js.LICENSE.txt +9 -0
- package/lib/esm-login-app/438.js.map +1 -0
- package/lib/esm-login-app/493.js +1 -0
- package/lib/esm-login-app/493.js.map +1 -0
- package/lib/esm-login-app/539.js +1 -0
- package/lib/esm-login-app/574.js +1 -0
- package/lib/esm-login-app/611.js +1 -0
- package/lib/esm-login-app/611.js.map +1 -0
- package/lib/esm-login-app/63.js +2 -0
- package/lib/{esm-primary-navigation-app → esm-login-app}/63.js.map +1 -1
- package/lib/esm-login-app/644.js +1 -0
- package/lib/esm-login-app/660.js +1 -0
- package/lib/esm-login-app/660.js.map +1 -0
- package/lib/esm-login-app/668.js +1 -0
- package/lib/esm-login-app/668.js.map +1 -0
- package/lib/esm-login-app/673.js +1 -0
- package/lib/esm-login-app/735.js +2 -0
- package/lib/{esm-primary-navigation-app → esm-login-app}/735.js.map +1 -1
- package/lib/esm-login-app/737.js +2 -0
- package/lib/esm-login-app/737.js.map +1 -0
- package/lib/esm-login-app/757.js +1 -0
- package/lib/esm-login-app/768.js +2 -0
- package/lib/{esm-primary-navigation-app → esm-login-app}/768.js.map +1 -1
- package/lib/esm-login-app/788.js +2 -0
- package/lib/{esm-primary-navigation-app → esm-login-app}/788.js.map +1 -1
- package/lib/esm-login-app/833.js +1 -0
- package/lib/esm-login-app/main.js +1 -0
- package/lib/esm-login-app/main.js.map +1 -0
- package/lib/esm-login-app/openmrs-esm-login-app.js +1 -0
- package/lib/{esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js.buildmanifest.json → esm-login-app/openmrs-esm-login-app.js.buildmanifest.json} +337 -137
- package/lib/esm-login-app/openmrs-esm-login-app.js.map +1 -0
- package/lib/esm-login-app/routes.json +1 -0
- package/lib/esm-offline-tools-app/107.js +1 -0
- package/lib/esm-offline-tools-app/107.js.map +1 -0
- package/lib/esm-offline-tools-app/153.js +1 -0
- package/lib/esm-offline-tools-app/153.js.map +1 -0
- package/lib/esm-offline-tools-app/1584c81d564cacde.svg +8 -0
- package/lib/esm-offline-tools-app/228.js +1 -0
- package/lib/esm-offline-tools-app/228.js.map +1 -0
- package/lib/esm-offline-tools-app/263.js +1 -0
- package/lib/esm-offline-tools-app/263.js.map +1 -0
- package/lib/esm-offline-tools-app/290.js +1 -0
- package/lib/esm-offline-tools-app/290.js.map +1 -0
- package/lib/esm-offline-tools-app/323.js +1 -0
- package/lib/esm-offline-tools-app/323.js.map +1 -0
- package/lib/esm-offline-tools-app/337.js +1 -0
- package/lib/esm-offline-tools-app/337.js.map +1 -0
- package/lib/esm-offline-tools-app/364.js +1 -0
- package/lib/esm-offline-tools-app/364.js.map +1 -0
- package/lib/esm-offline-tools-app/40.js +1 -0
- package/lib/esm-offline-tools-app/40.js.map +1 -0
- package/lib/esm-offline-tools-app/574.js +1 -0
- package/lib/esm-offline-tools-app/63.js +2 -0
- package/lib/esm-offline-tools-app/63.js.LICENSE.txt +32 -0
- package/lib/esm-offline-tools-app/63.js.map +1 -0
- package/lib/esm-offline-tools-app/679.js +1 -0
- package/lib/esm-offline-tools-app/679.js.map +1 -0
- package/lib/esm-offline-tools-app/697.js +2 -0
- package/lib/esm-offline-tools-app/697.js.LICENSE.txt +9 -0
- package/lib/esm-offline-tools-app/697.js.map +1 -0
- package/lib/esm-offline-tools-app/720.js +1 -0
- package/lib/esm-offline-tools-app/720.js.map +1 -0
- package/lib/esm-offline-tools-app/735.js +2 -0
- package/lib/esm-offline-tools-app/735.js.LICENSE.txt +9 -0
- package/lib/esm-offline-tools-app/735.js.map +1 -0
- package/lib/esm-offline-tools-app/752.js +1 -0
- package/lib/esm-offline-tools-app/752.js.map +1 -0
- package/lib/esm-offline-tools-app/757.js +1 -0
- package/lib/esm-offline-tools-app/768.js +2 -0
- package/lib/esm-offline-tools-app/768.js.LICENSE.txt +5 -0
- package/lib/esm-offline-tools-app/768.js.map +1 -0
- package/lib/esm-offline-tools-app/788.js +2 -0
- package/lib/esm-offline-tools-app/788.js.LICENSE.txt +19 -0
- package/lib/esm-offline-tools-app/788.js.map +1 -0
- package/lib/esm-offline-tools-app/82.js +2 -0
- package/lib/esm-offline-tools-app/82.js.LICENSE.txt +5 -0
- package/lib/esm-offline-tools-app/82.js.map +1 -0
- package/lib/esm-offline-tools-app/833.js +1 -0
- package/lib/esm-offline-tools-app/891.js +1 -0
- package/lib/esm-offline-tools-app/891.js.map +1 -0
- package/lib/esm-offline-tools-app/904.js +1 -0
- package/lib/esm-offline-tools-app/904.js.map +1 -0
- package/lib/esm-offline-tools-app/922.js +1 -0
- package/lib/esm-offline-tools-app/922.js.map +1 -0
- package/lib/esm-offline-tools-app/94.js +1 -0
- package/lib/esm-offline-tools-app/94.js.map +1 -0
- package/lib/esm-offline-tools-app/940.js +1 -0
- package/lib/esm-offline-tools-app/940.js.map +1 -0
- package/lib/esm-offline-tools-app/963.js +1 -0
- package/lib/esm-offline-tools-app/963.js.map +1 -0
- package/lib/esm-offline-tools-app/967.js +1 -0
- package/lib/esm-offline-tools-app/967.js.map +1 -0
- package/lib/esm-offline-tools-app/main.js +2 -0
- package/lib/esm-offline-tools-app/main.js.LICENSE.txt +5 -0
- package/lib/esm-offline-tools-app/main.js.map +1 -0
- package/lib/esm-offline-tools-app/openmrs-esm-offline-tools-app.js +1 -0
- package/lib/esm-offline-tools-app/openmrs-esm-offline-tools-app.js.buildmanifest.json +776 -0
- package/lib/esm-offline-tools-app/openmrs-esm-offline-tools-app.js.map +1 -0
- package/lib/esm-offline-tools-app/routes.json +1 -0
- package/lib/index.html +2 -2
- package/lib/openmrs.js +4 -4
- package/lib/service-worker.js +1 -1
- package/package.json +4 -4
- package/lib/esm-primary-navigation-app/113.js +0 -2
- package/lib/esm-primary-navigation-app/113.js.map +0 -1
- package/lib/esm-primary-navigation-app/263.js +0 -1
- package/lib/esm-primary-navigation-app/341.js +0 -1
- package/lib/esm-primary-navigation-app/341.js.map +0 -1
- package/lib/esm-primary-navigation-app/354.js +0 -1
- package/lib/esm-primary-navigation-app/354.js.map +0 -1
- package/lib/esm-primary-navigation-app/414.js +0 -1
- package/lib/esm-primary-navigation-app/414.js.map +0 -1
- package/lib/esm-primary-navigation-app/545.js.map +0 -1
- package/lib/esm-primary-navigation-app/574.js +0 -1
- package/lib/esm-primary-navigation-app/63.js +0 -2
- package/lib/esm-primary-navigation-app/631.js +0 -1
- package/lib/esm-primary-navigation-app/631.js.map +0 -1
- package/lib/esm-primary-navigation-app/710.js +0 -1
- package/lib/esm-primary-navigation-app/710.js.map +0 -1
- package/lib/esm-primary-navigation-app/735.js +0 -2
- package/lib/esm-primary-navigation-app/757.js +0 -1
- package/lib/esm-primary-navigation-app/768.js +0 -2
- package/lib/esm-primary-navigation-app/788.js +0 -2
- package/lib/esm-primary-navigation-app/833.js +0 -1
- package/lib/esm-primary-navigation-app/874.js +0 -1
- package/lib/esm-primary-navigation-app/874.js.map +0 -1
- package/lib/esm-primary-navigation-app/main.js +0 -1
- package/lib/esm-primary-navigation-app/main.js.map +0 -1
- package/lib/esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js +0 -1
- package/lib/esm-primary-navigation-app/openmrs-esm-primary-navigation-app.js.map +0 -1
- package/lib/esm-primary-navigation-app/routes.json +0 -1
- /package/dist/{openmrs.e755c97908e1ebcf.js.LICENSE.txt → openmrs.de9d7791e924ceba.js.LICENSE.txt} +0 -0
- /package/lib/{esm-primary-navigation-app → esm-login-app}/63.js.LICENSE.txt +0 -0
- /package/lib/{esm-primary-navigation-app → esm-login-app}/735.js.LICENSE.txt +0 -0
- /package/lib/{esm-primary-navigation-app/113.js.LICENSE.txt → esm-login-app/737.js.LICENSE.txt} +0 -0
- /package/lib/{esm-primary-navigation-app → esm-login-app}/768.js.LICENSE.txt +0 -0
- /package/lib/{esm-primary-navigation-app → esm-login-app}/788.js.LICENSE.txt +0 -0
package/dist/service-worker.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(()=>{var e={590:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",o="hour",s="day",a="week",u="month",c="quarter",l="year",h="date",f="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,u),o=n-i<0,s=t.clone().add(r+(o?-1:1),u);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:l,w:a,d:s,D:h,h:o,m:i,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",b={};b[m]=g;var w=function(e){return e instanceof S},_=function e(t,n,r){var i;if(!t)return m;if("string"==typeof t){var o=t.toLowerCase();b[o]&&(i=o),n&&(b[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;b[a]=t,i=a}return!r&&i&&(m=i),i||!r&&m},k=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new S(n)},x=v;x.l=_,x.i=w,x.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function g(e){this.$L=_(e.locale,null,!0),this.parse(e)}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(x.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(d);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return x},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return k(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<k(e)},y.$g=function(e,t,n){return x.u(e)?this[t]:this.set(n,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var n=this,c=!!x.u(t)||t,f=x.p(e),d=function(e,t){var r=x.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?r:r.endOf(s)},p=function(e,t){return x.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(f){case l:return c?d(1,0):d(31,11);case u:return c?d(1,y):d(0,y+1);case a:var b=this.$locale().weekStart||0,w=(g<b?g+7:g)-b;return d(c?v-w:v+(6-w),y);case s:case h:return p(m+"Hours",0);case o:return p(m+"Minutes",1);case i:return p(m+"Seconds",2);case r:return p(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var a,c=x.p(e),f="set"+(this.$u?"UTC":""),d=(a={},a[s]=f+"Date",a[h]=f+"Date",a[u]=f+"Month",a[l]=f+"FullYear",a[o]=f+"Hours",a[i]=f+"Minutes",a[r]=f+"Seconds",a[n]=f+"Milliseconds",a)[c],p=c===s?this.$D+(t-this.$W):t;if(c===u||c===l){var g=this.clone().set(h,1);g.$d[d](p),g.init(),this.$d=g.set(h,Math.min(this.$D,g.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[x.p(e)]()},y.add=function(n,c){var h,f=this;n=Number(n);var d=x.p(c),p=function(e){var t=k(f);return x.w(t.date(t.date()+Math.round(e*n)),f)};if(d===u)return this.set(u,this.$M+n);if(d===l)return this.set(l,this.$y+n);if(d===s)return p(1);if(d===a)return p(7);var g=(h={},h[i]=e,h[o]=t,h[r]=1e3,h)[d]||1,y=this.$d.getTime()+n*g;return x.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=x.z(this),o=this.$H,s=this.$m,a=this.$M,u=n.weekdays,c=n.months,l=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},h=function(e){return x.s(o%12||12,e,"0")},d=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:x.s(a+1,2,"0"),MMM:l(n.monthsShort,a,c,3),MMMM:l(c,a),D:this.$D,DD:x.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,u,2),ddd:l(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:x.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,s,!0),A:d(o,s,!1),m:String(s),mm:x.s(s,2,"0"),s:String(this.$s),ss:x.s(this.$s,2,"0"),SSS:x.s(this.$ms,3,"0"),Z:i};return r.replace(p,(function(e,t){return t||g[e]||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,h,f){var d,p=x.p(h),g=k(n),y=(g.utcOffset()-this.utcOffset())*e,v=this-g,m=x.m(this,g);return m=(d={},d[l]=m/12,d[u]=m,d[c]=m/3,d[a]=(v-y)/6048e5,d[s]=(v-y)/864e5,d[o]=v/t,d[i]=v/e,d[r]=v/1e3,d)[p]||v,f?m:x.a(m)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return b[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=_(e,t,!0);return r&&(n.$L=r),n},y.clone=function(){return x.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),O=S.prototype;return k.prototype=O,[["$ms",n],["$s",r],["$m",i],["$H",o],["$W",s],["$M",u],["$y",l],["$D",h]].forEach((function(e){O[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),k.extend=function(e,t){return e.$i||(e(t,S,k),e.$i=!0),k},k.locale=_,k.isDayjs=w,k.unix=function(e){return k(1e3*e)},k.en=b[m],k.Ls=b,k.p={},k}()},693:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){i(e,t,n[t])}))}return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}n.r(t),n.d(t,{default:()=>B});var p={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},g=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.init(t,n)}return u(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||p,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,o({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),y=function(){function e(){s(this,e),this.observers={}}return u(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function v(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function m(e){return null==e?"":""+e}function b(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function w(e,t,n){var r=b(e,t,Object);r.obj[r.k]=n}function _(e,t){var n=b(e,t),r=n.obj,i=n.k;if(r)return r[i]}function k(e,t,n){var r=_(e,n);return void 0!==r?r:_(t,n)}function x(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):x(e[r],t[r],n):e[r]=t[r]);return e}function S(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var O={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function P(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return O[e]})):e}var E="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,C=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return s(this,t),n=l(this,h(t).call(this)),E&&y.call(c(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return d(t,e),u(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,t];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split(".")),_(this.data,o)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),w(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var u=_(this.data,a)||{};r?x(u,n,i):u=o({},u,n),w(this.data,a,u),s.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?o({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(y),j={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}},R={},D=function(e){function t(e){var n,r,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,t),n=l(this,h(t).call(this)),E&&y.call(c(n)),r=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i=e,o=c(n),r.forEach((function(e){i[e]&&(o[e]=i[e])})),n.options=a,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=g.create("translator"),n}return d(t,e),u(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:i};var s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),e=s.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,i){var s=this;if("object"!==r(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],n),c=u.key,l=u.namespaces,h=l[l.length-1],f=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(d){var p=n.nsSeparator||this.options.nsSeparator;return h+p+c}return c}var g=this.resolve(e,n),y=g&&g.res,v=g&&g.usedKey||c,m=g&&g.exactUsedKey||c,b=Object.prototype.toString.apply(y),w=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject;if(_&&y&&"string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y&&["[object Number]","[object Function]","[object RegExp]"].indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,n):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(a){var k="[object Array]"===b,x=k?[]:{},S=k?m:v;for(var O in y)if(Object.prototype.hasOwnProperty.call(y,O)){var P="".concat(S).concat(a).concat(O);x[O]=this.translate(P,o({},n,{joinArrays:!1,ns:l})),x[O]===P&&(x[O]=y[O])}y=x}}else if(_&&"string"==typeof w&&"[object Array]"===b)(y=y.join(w))&&(y=this.extendTranslation(y,e,n,i));else{var E=!1,C=!1,j=void 0!==n.count&&"string"!=typeof n.count,R=t.hasDefaultValue(n),D=j?this.pluralResolver.getSuffix(f,n.count):"",A=n["defaultValue".concat(D)]||n.defaultValue;!this.isValidLookup(y)&&R&&(E=!0,y=A),this.isValidLookup(y)||(C=!0,y=c);var L=R&&A!==y&&this.options.updateMissing;if(C||E||L){if(this.logger.log(L?"updateKey":"missingKey",f,h,c,L?A:y),a){var K=this.resolve(c,o({},n,{keySeparator:!1}));K&&K.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var T=[],N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&N&&N[0])for(var M=0;M<N.length;M++)T.push(N[M]);else"all"===this.options.saveMissingTo?T=this.languageUtils.toResolveHierarchy(n.lng||this.language):T.push(n.lng||this.language);var $=function(e,t,r){s.options.missingKeyHandler?s.options.missingKeyHandler(e,h,t,L?r:y,L,n):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(e,h,t,L?r:y,L,n),s.emit("missingKey",e,h,t,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?T.forEach((function(e){s.pluralResolver.getSuffixes(e).forEach((function(t){$([e],c+t,n["defaultValue".concat(t)]||A)}))})):$(T,c,A))}y=this.extendTranslation(y,e,n,g,i),C&&y===c&&this.options.appendNamespaceToMissingKey&&(y="".concat(h,":").concat(c)),C&&this.options.parseMissingKeyHandler&&(y=this.options.parseMissingKeyHandler(y))}return y}},{key:"extendTranslation",value:function(e,t,n,r,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(o({},n,{interpolation:o({},this.options.interpolation,n.interpolation)}));var a,u=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(u){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var l=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l=o({},this.options.interpolation.defaultVariables,l)),e=this.interpolator.interpolate(e,l,n.lng||this.language,n),u){var h=e.match(this.interpolator.nestingRegexp);a<(h&&h.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return i&&i[0]===r[0]&&!n.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):s.translate.apply(s,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,d="string"==typeof f?[f]:f;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=j.handle(d,e,t,this.options&&this.options.postProcessPassResolved?o({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var u=s.extractFromKey(e,a),c=u.key;n=c;var l=u.namespaces;s.options.fallbackNS&&(l=l.concat(s.options.fallbackNS));var h=void 0!==a.count&&"string"!=typeof a.count,f=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,d=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);l.forEach((function(e){s.isValidLookup(t)||(o=e,!R["".concat(d[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(R["".concat(d[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,u,l=c,d=[l];for(s.i18nFormat&&s.i18nFormat.addLookupKeys?s.i18nFormat.addLookupKeys(d,c,n,e,a):(h&&(o=s.pluralResolver.getSuffix(n,a.count)),h&&f&&d.push(l+o),f&&d.push(l+="".concat(s.options.contextSeparator).concat(a.context)),h&&d.push(l+=o));u=d.pop();)s.isValidLookup(t)||(r=u,t=s.getResource(n,e,u,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),t}(y);function A(e){return e.charAt(0).toUpperCase()+e.slice(1)}var L=function(){function e(t){s(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=g.create("languageUtils")}return u(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=A(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=A(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=A(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),K=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],T={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},N=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.languageUtils=t,this.options=r,this.logger=g.create("pluralResolver"),this.rules=(n={},K.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:T[e.fc]}}))})),n)}return u(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),M=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.logger=g.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return u(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:P,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?S(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?S(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?S(t.nestingPrefix):t.nestingPrefixEscaped||S("$t("),this.nestingSuffix=t.nestingSuffix?S(t.nestingSuffix):t.nestingSuffixEscaped||S(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(a.formatSeparator)<0){var i=k(t,u,e);return a.alwaysFormat?a.format(i,void 0,n):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(k(t,u,s),c,n,r)};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){if(void 0===(o=l(i[1].trim())))if("function"==typeof h){var n=h(e,i,r);o="string"==typeof n?n:""}else{if(f){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=m(o));if(e=e.replace(i[0],t.safeValue(o)),t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o({},s);function u(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0],i=(i=this.interpolate(i,a)).replace(/'/g,'"');try{a=JSON.parse(i),t&&(a=o({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],l=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=h.shift(),c=h,l=!0}if((r=t(u.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=m(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),l&&(r=c.reduce((function(e,t){return i.format(e,t,s.lng,s)}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}(),$=function(e){function t(e,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s(this,t),i=l(this,h(t).call(this)),E&&y.call(c(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=g.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return d(t,e),u(t,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o=[],s=[],a=[],u=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?s.indexOf(a)<0&&s.push(a):(i.state[a]=1,r=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),u.indexOf(t)<0&&u.push(t)))})),r||a.push(e)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:r}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:u}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,u,c,l;r=n.loaded,a=o,(c=(u=b(r,[i],Object)).obj)[l=u.k]=c[l]||[],c[l].push(a),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(a,u){a&&u&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,u)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,o({},s,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(y);function I(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function F(){}const B=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(s(this,t),e=l(this,h(t).call(this)),E&&y.call(c(e)),e.options=I(n),e.services={},e.logger=g,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),l(e,c(e));setTimeout((function(){e.init(n,r)}),0)}return e}return d(t,e),u(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=o({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===r(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===r(e[2])||"object"===r(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,I(t)),this.format=this.options.interpolation.format,n||(n=F),!this.options.isClone){this.modules.logger?g.init(i(this.modules.logger),this.options):g.init(null,this.options);var s=new L(this.options);this.store=new C(this.options.resources,this.options);var a=this.services;a.logger=g,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new N(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a.interpolator=new M(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new $(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new D(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&"dev"!==u[0]&&(this.options.lng=u[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var c=v(),l=function(){var t=function(t,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),c.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),c}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var i=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};r?o(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return o(e)})),this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(i,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=v();return e||(e=this.languages),t||(t=this.options.ns),n||(n=F),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&j.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=v();this.emit("languageChanging",e);var i=function(e){var i="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var s;if("object"!==r(i)){for(var a=arguments.length,u=new Array(a>2?a-2:0),c=2;c<a;c++)u[c-2]=arguments[c];s=n.options.overloadTranslationOptionHandler([t,i].concat(u))}else s=o({},i);return s.lng=s.lng||e.lng,s.lngs=s.lngs||e.lngs,s.ns=s.ns||e.ns,n.t(t,s)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||!(!s(r,e)||i&&!s(o,e))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=v();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=v();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F,i=o({},this.options,n,{isClone:!0}),s=new t(i);return["store","services","language"].forEach((function(t){s[t]=e[t]})),s.services=o({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new D(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s.emit.apply(s,[e].concat(n))})),s.init(i,r),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}}]),t}(y))},161:()=>{"use strict";try{self["workbox:core:6.5.3"]&&_()}catch(e){}},664:()=>{"use strict";try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},818:()=>{"use strict";try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{n.S={};var e={},t={};n.I=(r,i)=>{i||(i=[]);var o=t[r];if(o||(o=t[r]={}),!(i.indexOf(o)>=0)){if(i.push(o),e[r])return e[r];n.o(n.S,r)||(n.S[r]={});var s=n.S[r],a="@openmrs/esm-app-shell",u=(e,t,n,r)=>{var i=s[e]=s[e]||{},o=i[t];(!o||!o.loaded&&(!r!=!o.eager?r:a>o.from))&&(i[t]={get:n,from:a,eager:!!r})},c=[];return"default"===r&&(u("dayjs","1.11.5",(()=>()=>n(590)),1),u("i18next","19.9.2",(()=>()=>n(693)),1)),e[r]=c.length?Promise.all(c).then((()=>e[r]=1)):1}}})(),(()=>{"use strict";n(161);let e=class extends Error{constructor(e,t){super(((e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n})(e,t)),this.name=e,this.details=t}};const t=new Set,r={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},i=e=>{return e||(t=r.runtime,[r.prefix,t,r.suffix].filter((e=>e&&e.length>0)).join("-"));var t};function o(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function s(e,t){const n=new URL(e);for(const e of t)n.searchParams.delete(e);return n.href}function a(){return a=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,u,"next",e)}function u(e){o(s,r,i,a,u,"throw",e)}a(void 0)}))}}((function*(e,t,n,r){const i=s(t.url,n);if(t.url===i)return e.match(t,r);const o=Object.assign(Object.assign({},r),{ignoreSearch:!0}),a=yield e.keys(t,o);for(const t of a)if(i===s(t.url,n))return e.match(t,r)})),a.apply(this,arguments)}function u(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function c(){return c=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){u(o,r,i,s,a,"next",e)}function a(e){u(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*(){for(const e of t)yield e()})),c.apply(this,arguments)}function l(e){return new Promise((t=>setTimeout(t,e)))}const h="object"==typeof global&&global&&global.Object===Object&&global;var f="object"==typeof self&&self&&self.Object===Object&&self;const d=h||f||Function("return this")(),p=d.Symbol,g=Array.isArray;var y=Object.prototype,v=y.hasOwnProperty,m=y.toString,b=p?p.toStringTag:void 0;var w=Object.prototype.toString;var _=p?p.toStringTag:void 0;const k=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?function(e){var t=v.call(e,b),n=e[b];try{e[b]=void 0;var r=!0}catch(e){}var i=m.call(e);return r&&(t?e[b]=n:delete e[b]),i}(e):function(e){return w.call(e)}(e)},x=function(e){return null!=e&&"object"==typeof e};var S=p?p.prototype:void 0,O=S?S.toString:void 0;const P=function e(t){if("string"==typeof t)return t;if(g(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(function(e){return"symbol"==typeof e||x(e)&&"[object Symbol]"==k(e)}(t))return O?O.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var E=/[\\^$.*+?()[\]{}|]/g,C=RegExp(E.source);const j=function(e){return(e=null==(t=e)?"":P(t))&&C.test(e)?e.replace(E,"\\$&"):e;var t};function R(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function D(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){R(o,r,i,s,a,"next",e)}function a(e){R(o,r,i,s,a,"throw",e)}s(void 0)}))}}function A(){return A=D((function*(e,t={}){let{shouldRetry:n,getDelay:r,onError:i}=t;n=null!=n?n:e=>function(e,t){return e<=5}(e),r=null!=r?r:e=>function(e,t,n=!1){const r=n?e+1:e;return 1e3*Math.pow(2,r)}(e);let o,s=0;do{try{return yield L(r(s)),yield e()}catch(e){null==i||i(e,s),o=e}}while(n(s++));throw o})),A.apply(this,arguments)}function L(e){return K.apply(this,arguments)}function K(){return(K=D((function*(e){if(!(e<=0))return new Promise((t=>setTimeout(t,e)))}))).apply(this,arguments)}const T=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},N=d["__core-js_shared__"];var M,$=(M=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"";var I=Function.prototype.toString;var F=/^\[object .+?Constructor\]$/,B=Function.prototype,q=Object.prototype,U=B.toString,W=q.hasOwnProperty,V=RegExp("^"+U.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const H=function(e){return!(!T(e)||(t=e,$&&$ in t))&&(function(e){if(!T(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?V:F).test(function(e){if(null!=e){try{return I.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t},z=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return H(n)?n:void 0},Y=z(Object,"create");var G=Object.prototype.hasOwnProperty;var J=Object.prototype.hasOwnProperty;function Q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Q.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},Q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Q.prototype.get=function(e){var t=this.__data__;if(Y){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return G.call(t,e)?t[e]:void 0},Q.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:J.call(t,e)},Q.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Y&&void 0===t?"__lodash_hash_undefined__":t,this};const X=Q,Z=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(i=t)||r!=r&&i!=i)return n;var r,i;return-1};var ee=Array.prototype.splice;function te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=Z(t,e);return!(n<0||(n==t.length-1?t.pop():ee.call(t,n,1),--this.size,0))},te.prototype.get=function(e){var t=this.__data__,n=Z(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return Z(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=Z(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const ne=te,re=z(d,"Map"),ie=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}oe.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(re||ne),string:new X}},oe.prototype.delete=function(e){var t=ie(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return ie(this,e).get(e)},oe.prototype.has=function(e){return ie(this,e).has(e)},oe.prototype.set=function(e,t){var n=ie(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const se=oe;function ae(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new se;++t<n;)this.add(e[t])}ae.prototype.add=ae.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ae.prototype.has=function(e){return this.__data__.has(e)};const ue=ae,ce=function(e){return e!=e},le=function(e,t){return!(null==e||!e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}(e,ce,n)}(e,t,0)>-1},he=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1},fe=function(e,t){return e.has(t)},de=z(d,"Set"),pe=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},ge=de&&1/pe(new de([,-0]))[1]==1/0?function(e){return new de(e)}:function(){},ye=function(e){return e&&e.length?function(e,t,n){var r=-1,i=le,o=e.length,s=!0,a=[],u=a;if(n)s=!1,i=he;else if(o>=200){var c=t?null:ge(e);if(c)return pe(c);s=!1,i=fe,u=new ue}else u=t?[]:a;e:for(;++r<o;){var l=e[r],h=t?t(l):l;if(l=n||0!==l?l:0,s&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),a.push(l)}else i(u,h,n)||(u!==a&&u.push(h),a.push(l))}return a}(e):[]},ve="x-omrs-offline-response-body",me="x-omrs-offline-response-status",be="x-omrs-offline-caching-strategy",we="omrs",_e=`${we}-spa-cache-v1`,ke=[{'revision':null,'url':'/openmrs/spa/routes.registry.json'},{'revision':null,'url':'01c48175a5cba05a.js'},{'revision':null,'url':'023bd53d342b7463.woff'},{'revision':null,'url':'02acc4469a2fe2e4.woff2'},{'revision':null,'url':'033e03f8663ab9b1.woff'},{'revision':null,'url':'052607e67da262ec.woff'},{'revision':null,'url':'081587ca0db8e63f.woff2'},{'revision':null,'url':'08cf53c4e5e71cf1.woff2'},{'revision':null,'url':'090b2bc014d24ea4.woff2'},{'revision':null,'url':'0a28cd0b47497b71.woff'},{'revision':null,'url':'0a9765a89ff0437d.woff'},{'revision':null,'url':'0ae92bcea615e948.woff2'},{'revision':null,'url':'0be8520d8945b3b7.woff2'},{'revision':null,'url':'0bf6b66a8b86b014.woff'},{'revision':null,'url':'0e7dd073cd8bb0ad.woff2'},{'revision':null,'url':'14869ac5d1830304.woff2'},{'revision':null,'url':'14aaceff85fc8b28.woff2'},{'revision':null,'url':'1590052e1cf8f28d.woff'},{'revision':null,'url':'16f443eed01776ca.woff2'},{'revision':null,'url':'183bae0e53a22182.woff2'},{'revision':null,'url':'19b239a0bb74b27e.woff'},{'revision':null,'url':'19c8f94ccd6289f5.woff2'},{'revision':null,'url':'1ae86565eab7451c.woff2'},{'revision':null,'url':'1c7bf8797e0a9be6.woff2'},{'revision':null,'url':'1d9aff9a93a3bb66.woff'},{'revision':null,'url':'1f266d3619b30f16.woff2'},{'revision':null,'url':'1f8c5a4087a524fd.woff2'},{'revision':null,'url':'20ba2b23c5c0cd0b.woff2'},{'revision':null,'url':'2269d45733c5cf8f.woff'},{'revision':null,'url':'258ecbd235953099.woff'},{'revision':null,'url':'295dd01a1fbfee6d.woff2'},{'revision':null,'url':'2d7f835ab7c7c764.woff'},{'revision':null,'url':'2f66cca99eeead63.woff'},{'revision':null,'url':'2f686985e26e7107.woff2'},{'revision':null,'url':'315eff729e4ccbd9.woff2'},{'revision':null,'url':'32f1e5aadf845e08.woff'},{'revision':null,'url':'338484e1c850669c.woff'},{'revision':null,'url':'33b7a82f1e295190.woff'},{'revision':null,'url':'3674d98ec4a9173d.woff'},{'revision':null,'url':'368d16e3259bf207.woff2'},{'revision':null,'url':'36c49aa341a7079a.woff2'},{'revision':null,'url':'36e1e0430475edee.woff2'},{'revision':null,'url':'3bc19662b8630ee9.woff2'},{'revision':null,'url':'3f645f473b3f8fba.woff2'},{'revision':null,'url':'4095df88acae9e98.woff'},{'revision':null,'url':'4218ac9901b9d36d.woff2'},{'revision':null,'url':'4680ba68412e4da9.woff2'},{'revision':null,'url':'47d7a8698d562a0e.woff'},{'revision':null,'url':'47ec6c9dffe776a0.woff'},{'revision':null,'url':'48e37bd7ebf85a1f.woff2'},{'revision':null,'url':'48edfdf51dfb3160.woff'},{'revision':null,'url':'4a35a2746c8ad7a5.woff'},{'revision':null,'url':'4e11b8a7c445255f.woff2'},{'revision':null,'url':'4ea1f5c3baf89fe3.woff'},{'revision':null,'url':'4ea99f41c896bf9d.woff'},{'revision':null,'url':'5005db1d1caf70c7.woff'},{'revision':null,'url':'528a8e7c1c141a31.woff'},{'revision':null,'url':'52ca12f5b516d4ea.woff'},{'revision':null,'url':'537ddd61c5c1fce2.woff2'},{'revision':null,'url':'5432f7541ec25c34.woff'},{'revision':null,'url':'54a95d73a9454ba3.woff'},{'revision':null,'url':'56c4118c0907f151.woff2'},{'revision':null,'url':'5938bc2ae7ec60c0.woff2'},{'revision':null,'url':'594306657c4e44e8.woff'},{'revision':null,'url':'5a538aa477a66067.woff'},{'revision':null,'url':'5c6586155f0d278a.woff2'},{'revision':null,'url':'60ec587649ba812a.woff2'},{'revision':null,'url':'616567cd947eb9dd.woff'},{'revision':null,'url':'65168b59f44caab4.woff'},{'revision':null,'url':'65c0982f98374864.woff'},{'revision':null,'url':'65e6511e035870e1.woff2'},{'revision':null,'url':'661425f6798cd16a.woff2'},{'revision':null,'url':'66b864fe213caf46.woff2'},{'revision':null,'url':'6775fee945132ef9.woff'},{'revision':null,'url':'68bbd362c8e4983b.woff'},{'revision':null,'url':'68d6deec87b6b604.woff'},{'revision':null,'url':'69a7e6d31d390296.woff'},{'revision':null,'url':'69d087d970ee9455.woff2'},{'revision':null,'url':'69fa3fc7363bbc04.woff'},{'revision':null,'url':'6a1f0178b45b2e9e.woff'},{'revision':null,'url':'6c6c45e66ff54281.woff2'},{'revision':null,'url':'6ffb9ed97b21fdc0.woff'},{'revision':null,'url':'7073a7323e92bd11.woff2'},{'revision':null,'url':'718c6cc31274ab1a.woff2'},{'revision':null,'url':'72cdbedfe04be9f9.woff2'},{'revision':null,'url':'7509c9f56fe9e532.woff2'},{'revision':null,'url':'75dc5c5b04adc8bf.woff2'},{'revision':null,'url':'76a7c256fc8b3490.woff'},{'revision':null,'url':'77b48bc05299ecca.woff2'},{'revision':null,'url':'787f56efa306ddbc.woff'},{'revision':null,'url':'7a0a0215c248c73d.woff2'},{'revision':null,'url':'7c4463d9c84f263a.woff'},{'revision':null,'url':'7d112a556b7670d2.woff'},{'revision':null,'url':'7d52d6014b5f2bbc.woff'},{'revision':null,'url':'7f00bebb24e40167.woff2'},{'revision':null,'url':'7f2c6ea3e740417e.woff'},{'revision':null,'url':'802c6176541eeed7.woff2'},{'revision':null,'url':'8080081b3379c637.woff2'},{'revision':null,'url':'8274cc1afc7619f1.woff'},{'revision':null,'url':'8605507b7a8487c4.woff2'},{'revision':null,'url':'8a83d654702f6534.woff2'},{'revision':null,'url':'8ccee65f6cf254ee.woff'},{'revision':null,'url':'8d82a082a4aba439.woff'},{'revision':null,'url':'8de04ae985937b56.woff'},{'revision':null,'url':'8fe71173a13fe571.woff2'},{'revision':null,'url':'90edccb224a51cee.woff'},{'revision':null,'url':'94b292fe87831a8b.woff'},{'revision':null,'url':'95dc66c1b88745f8.woff'},{'revision':null,'url':'95fb698be77c85ef.woff'},{'revision':null,'url':'9624cec0f9bdd81e.woff2'},{'revision':null,'url':'9662331fa31e3f20.woff'},{'revision':null,'url':'980084ac919b4e2a.js'},{'revision':null,'url':'98a3af55a1698171.woff2'},{'revision':null,'url':'9ba85996af74c5ce.woff2'},{'revision':null,'url':'9bc133b1df25cb74.woff'},{'revision':null,'url':'9ddb22faa35006e7.woff2'},{'revision':null,'url':'9e97352380611b95.woff'},{'revision':null,'url':'a167fb2799dd741b.woff2'},{'revision':null,'url':'a2045a5cc4fdf94f.woff2'},{'revision':null,'url':'a246c73905a31c93.woff2'},{'revision':null,'url':'a401aa7939cb6e6f.woff2'},{'revision':null,'url':'a41a71258c38684d.woff'},{'revision':null,'url':'a60d94a72d615a8e.woff'},{'revision':null,'url':'a66764dd0c1fa213.woff'},{'revision':null,'url':'a6ed036f17a1ea29.woff2'},{'revision':null,'url':'a8f635129d660202.woff'},{'revision':null,'url':'a9f25ca430709a1a.woff2'},{'revision':null,'url':'ae14d98ad8a1212c.woff'},{'revision':null,'url':'aeec4f78084adf7f.woff'},{'revision':null,'url':'af11e94b0644eba5.woff'},{'revision':null,'url':'afa9121a49e95351.woff2'},{'revision':null,'url':'afcda12d9f805543.woff2'},{'revision':null,'url':'b09ded85a7da77f1.woff2'},{'revision':null,'url':'b2f4e9d1e821b71c.woff2'},{'revision':null,'url':'b30b06698dc369b2.woff'},{'revision':null,'url':'b4a074bf828bb757.woff2'},{'revision':null,'url':'b7f447da43f6e596.woff2'},{'revision':null,'url':'b7f633b871b84820.woff'},{'revision':null,'url':'bcca84a524572d10.woff2'},{'revision':null,'url':'be4d1f97b11d087c.woff2'},{'revision':null,'url':'be91def2232f6776.woff'},{'revision':null,'url':'bec14780d81164de.woff2'},{'revision':null,'url':'c285f4b15d11f172.woff'},{'revision':null,'url':'c4673617b80801f3.woff'},{'revision':null,'url':'c553f7e0199c5084.woff2'},{'revision':null,'url':'c8470ed2c145ace7.woff'},{'revision':null,'url':'c9d9ce9f465df4fe.woff2'},{'revision':null,'url':'ccb2870475da9fe8.woff'},{'revision':null,'url':'d04134fa33c2606d.woff'},{'revision':null,'url':'d11f9c5cd7d9ea16.woff'},{'revision':null,'url':'d188f7f036ac5779.woff2'},{'revision':null,'url':'d265d81c58525ae4.woff2'},{'revision':null,'url':'d5942cd81663e136.woff2'},{'revision':null,'url':'d6097a5c452acf6d.woff'},{'revision':null,'url':'d66b8ff73d95cabb.woff2'},{'revision':null,'url':'d77f5bf95de8edaa.woff'},{'revision':null,'url':'d8829a685af4f372.woff'},{'revision':null,'url':'d88899ef0fd16719.woff2'},{'revision':null,'url':'d9a5d958e69e058d.woff2'},{'revision':null,'url':'da65d9a514c628c8.woff'},{'revision':null,'url':'dac90d495be353a0.woff2'},{'revision':null,'url':'dd7071bc6306585c.woff'},{'revision':null,'url':'dd8ce598529c3fab.woff2'},{'revision':null,'url':'ddef6f2dd566c2b9.woff'},{'revision':null,'url':'de013f1be25103fa.woff2'},{'revision':null,'url':'dee2ff599db31e5b.woff'},{'revision':null,'url':'dee7c6b5dd954d9b.woff'},{'revision':null,'url':'df222fceeffca849.woff2'},{'revision':null,'url':'e071d971c938113d.js'},{'revision':null,'url':'e0d2e5b12f028b5d.woff'},{'revision':null,'url':'e33e3db8e4f7559f.woff'},{'revision':null,'url':'e62b00b9199c1ac9.woff2'},{'revision':null,'url':'e696cef1407b2610.woff2'},{'revision':null,'url':'e89ca83b24959664.woff'},{'revision':null,'url':'eb8c0ae77ad55249.woff'},{'revision':null,'url':'ed0997bd7d221b8e.woff'},{'revision':null,'url':'eed48feba743e21c.woff2'},{'revision':null,'url':'f280bda8a6e535a6.woff'},{'revision':null,'url':'f543c88feb236d11.woff2'},{'revision':null,'url':'f591b0079faa93fe.woff2'},{'revision':null,'url':'f6ed27923769ad1d.woff2'},{'revision':null,'url':'f8803bebe640d99a.woff'},{'revision':'30de494bd9e73ae96c18fd0c06fa422b','url':'favicon.ico'},{'revision':null,'url':'fbebeb4336e67012.woff2'},{'revision':null,'url':'fd522cd7a5c646fe.woff'},{'revision':null,'url':'https://dev3.openmrs.org/openmrs/spa/importmap.json'},{'revision':'b6876dc38a6a977ea7a2e62b670ca1cb','url':'index.html'},{'revision':'6b758b31ea00150986994edcfb033a94','url':'logo-512.png'},{'revision':'b860db243392596e3b875bad9794b4e5','url':'logo.svg'},{'revision':null,'url':'openmrs.419f57cc77d46d0d.css'},{'revision':null,'url':'openmrs.e755c97908e1ebcf.js'},{'revision':'dff2ca614f04628e63b5bb9e7de63433','url':'openmrs.e755c97908e1ebcf.js.LICENSE.txt'}],xe=Pe("index.html"),Se=ye(ke.map((({url:e})=>Pe(e)))),Oe=".buildmanifest.json";function Pe(e){return new URL(e,self.location.href).href}const Ee=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Ce=function(e){return x(e)&&"[object Arguments]"==k(e)};var je=Object.prototype,Re=je.hasOwnProperty,De=je.propertyIsEnumerable;const Ae=Ce(function(){return arguments}())?Ce:function(e){return x(e)&&Re.call(e,"callee")&&!De.call(e,"callee")};var Le=p?p.isConcatSpreadable:void 0;const Ke=function(e){return g(e)||Ae(e)||!!(Le&&e&&e[Le])},Te=function e(t,n,r,i,o){var s=-1,a=t.length;for(r||(r=Ke),o||(o=[]);++s<a;){var u=t[s];n>0&&r(u)?n>1?e(u,n-1,r,i,o):Ee(o,u):i||(o[o.length]=u)}return o},Ne=function(e){return null!=e&&e.length?Te(e,1):[]};function Me(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function $e(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Me(o,r,i,s,a,"next",e)}function a(e){Me(o,r,i,s,a,"throw",e)}s(void 0)}))}}function Ie(){return Ie=$e((function*({imports:e={}}){const t=Object.values(e),n=yield Promise.all(t.map((r=$e((function*(e){const t=function(e){return e+Oe}(e),n=yield function(e){return fetch(e).then((e=>e.json())).catch((()=>null))}(t);return n?function(e,t){try{const i=[],o=function(e){const t=(e.origin+e.pathname).split("/");return t[t.length-1]="",t.join("/")}(new URL(e,self.location.href));var n;for(const e of null!==(n=t.chunks)&&void 0!==n?n:[]){var r;for(const t of null!==(r=e.files)&&void 0!==r?r:[])i.push(new URL(t,o).toString())}return i}catch(t){return console.error("[SW] Failed to determine the dependencies of the module with the URL %s. Not precaching any of the module's assets. Error: ",e,t),[]}}(e,n):[]})),function(e){return r.apply(this,arguments)})));var r;return Ne(n)})),Ie.apply(this,arguments)}const Fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Be=Object.keys,qe=Array.isArray;function Ue(e,t){return"object"!=typeof t||Be(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||Fe.Promise||(Fe.Promise=Promise);const We=Object.getPrototypeOf,Ve={}.hasOwnProperty;function He(e,t){return Ve.call(e,t)}function ze(e,t){"function"==typeof t&&(t=t(We(e))),("undefined"==typeof Reflect?Be:Reflect.ownKeys)(t).forEach((n=>{Ge(e,n,t[n])}))}const Ye=Object.defineProperty;function Ge(e,t,n,r){Ye(e,t,Ue(n&&He(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function Je(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Ge(e.prototype,"constructor",e),{extend:ze.bind(null,e.prototype)}}}}const Qe=Object.getOwnPropertyDescriptor;function Xe(e,t){let n;return Qe(e,t)||(n=We(e))&&Xe(n,t)}const Ze=[].slice;function et(e,t,n){return Ze.call(e,t,n)}function tt(e,t){return t(e)}function nt(e){if(!e)throw new Error("Assertion Failed")}function rt(e){Fe.setImmediate?setImmediate(e):setTimeout(e,0)}function it(e,t){return e.reduce(((e,n,r)=>{var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function ot(e,t){if(He(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=ot(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return void 0===a?void 0:ot(a,t.substr(s+1))}}function st(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){nt("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)st(e,t[r],n[r])}else{var o=t.indexOf(".");if(-1!==o){var s=t.substr(0,o),a=t.substr(o+1);if(""===a)void 0===n?qe(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var u=e[s];u&&He(e,s)||(u=e[s]={}),st(u,a,n)}}else void 0===n?qe(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function at(e){var t={};for(var n in e)He(e,n)&&(t[n]=e[n]);return t}const ut=[].concat;function ct(e){return ut.apply([],e)}const lt="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ct([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>Fe[e])),ht=lt.map((e=>Fe[e]));it(lt,(e=>[e,!0]));let ft=null;function dt(e){ft="undefined"!=typeof WeakMap&&new WeakMap;const t=pt(e);return ft=null,t}function pt(e){if(!e||"object"!=typeof e)return e;let t=ft&&ft.get(e);if(t)return t;if(qe(e)){t=[],ft&&ft.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(pt(e[n]))}else if(ht.indexOf(e.constructor)>=0)t=e;else{const n=We(e);for(var i in t=n===Object.prototype?{}:Object.create(n),ft&&ft.set(e,t),e)He(e,i)&&(t[i]=pt(e[i]))}return t}const{toString:gt}={};function yt(e){return gt.call(e).slice(8,-1)}const vt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",mt="symbol"==typeof vt?function(e){var t;return null!=e&&(t=e[vt])&&t.apply(e)}:function(){return null},bt={};function wt(e){var t,n,r,i;if(1===arguments.length){if(qe(e))return e.slice();if(this===bt&&"string"==typeof e)return[e];if(i=mt(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}const _t="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var kt="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function xt(e,t){kt=e,St=t}var St=()=>!0;const Ot=!new Error("").stack;function Pt(){if(Ot)try{throw Pt.arguments,new Error}catch(e){return e}return new Error}function Et(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(St).map((e=>"\n"+e)).join("")):""}var Ct=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],jt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ct),Rt={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 Dt(e,t){this._e=Pt(),this.name=e,this.message=t}function At(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function Lt(e,t,n,r){this._e=Pt(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=At(e,t)}function Kt(e,t){this._e=Pt(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=At(e,t)}Je(Dt).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Et(this._e,2))}},toString:function(){return this.name+": "+this.message}}),Je(Lt).from(Dt),Je(Kt).from(Dt);var Tt=jt.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const Nt=Dt;var Mt=jt.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=Pt(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=Rt[t]||n,this.inner=null)}return Je(r).from(Nt),e[t]=r,e}),{});Mt.Syntax=SyntaxError,Mt.Type=TypeError,Mt.Range=RangeError;var $t=Ct.reduce(((e,t)=>(e[t+"Error"]=Mt[t],e)),{}),It=jt.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Mt[t]),e)),{});function Ft(){}function Bt(e){return e}function qt(e,t){return null==e||e===Bt?t:function(n){return t(e(n))}}function Ut(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Wt(e,t){return e===Ft?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Ut(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Ut(i,this.onerror):i),void 0!==o?o:n}}function Vt(e,t){return e===Ft?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Ut(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Ut(r,this.onerror):r)}}function Ht(e,t){return e===Ft?t:function(n){var r=e.apply(this,arguments);Ue(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Ut(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Ut(o,this.onerror):o),void 0===r?void 0===s?void 0:s:Ue(r,s)}}function zt(e,t){return e===Ft?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Yt(e,t){return e===Ft?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}It.ModifyError=Lt,It.DexieError=Dt,It.BulkError=Kt;var Gt={};const[Jt,Qt,Xt]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,We(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,We(t),e]})(),Zt=Qt&&Qt.then,en=Jt&&Jt.constructor,tn=!!Xt;var nn=!1,rn=Xt?()=>{Xt.then(En)}:Fe.setImmediate?setImmediate.bind(null,En):Fe.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{En(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(En,0)},on=function(e,t){pn.push([e,t]),an&&(rn(),an=!1)},sn=!0,an=!0,un=[],cn=[],ln=null,hn=Bt,fn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Qn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{Qn(e[0],e[1])}catch(e){}}))}},dn=fn,pn=[],gn=0,yn=[];function vn(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Ft,this._lib=!1;var t=this._PSD=dn;if(kt&&(this._stackHolder=Pt(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Gt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&_n(this,this._value))}this._state=null,this._value=null,++t.ref,wn(this,e)}const mn={get:function(){var e=dn,t=Mn;function n(n,r){var i=!e.global&&(e!==dn||t!==Mn);const o=i&&!Bn();var s=new vn(((t,s)=>{xn(this,new bn(Gn(n,e,i,o),Gn(r,e,i,o),t,s,e))}));return kt&&Pn(s,this),s}return n.prototype=Gt,n},set:function(e){Ge(this,"then",e&&e.prototype===Gt?mn:{get:function(){return e},set:mn.set})}};function bn(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function wn(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Cn();t&&"function"==typeof t.then?wn(e,((e,n)=>{t instanceof vn?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,kn(e)),n&&jn()}}),_n.bind(null,e))}catch(t){_n(e,t)}}function _n(e,t){if(cn.push(t),null===e._state){var n=e._lib&&Cn();t=hn(t),e._state=!1,e._value=t,kt&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=Xe(t,"stack");t._promise=e,Ge(t,"stack",{get:()=>nn?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){un.some((t=>t._value===e._value))||un.push(e)}(e),kn(e),n&&jn()}}function kn(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)xn(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===gn&&(++gn,on((()=>{0==--gn&&Rn()}),[]))}function xn(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++gn,on(Sn,[n,e,t])}else e._listeners.push(t)}function Sn(e,t,n){try{ln=t;var r,i=t._value;t._state?r=e(i):(cn.length&&(cn=[]),r=e(i),-1===cn.indexOf(i)&&function(e){for(var t=un.length;t;)if(un[--t]._value===e._value)return void un.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{ln=null,0==--gn&&Rn(),--n.psd.ref||n.psd.finalize()}}function On(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var i,o,s=e._value;null!=s?(i=s.name||"Error",o=s.message||s,r=Et(s,0)):(i=s,o=""),t.push(i+(o?": "+o:"")+r)}return kt&&((r=Et(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&On(e._prev,t,n)),t}function Pn(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function En(){Cn()&&jn()}function Cn(){var e=sn;return sn=!1,an=!1,e}function jn(){var e,t,n;do{for(;pn.length>0;)for(e=pn,pn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(pn.length>0);sn=!0,an=!0}function Rn(){var e=un;un=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=yn.slice(0),n=t.length;n;)t[--n]()}function Dn(e){return new vn(Gt,!1,e)}function An(e,t){var n=dn;return function(){var r=Cn(),i=dn;try{return Vn(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Vn(i,!1),r&&jn()}}}ze(vn.prototype,{then:mn,_then:function(e,t){xn(this,new bn(null,null,e,t,dn))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?n(e):Dn(e))):this.then(null,(e=>e&&e.name===t?n(e):Dn(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Dn(t))))},stack:{get:function(){if(this._stack)return this._stack;try{nn=!0;var e=On(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{nn=!1}}},timeout:function(e,t){return e<1/0?new vn(((n,r)=>{var i=setTimeout((()=>r(new Mt.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Ge(vn.prototype,Symbol.toStringTag,"Dexie.Promise"),fn.env=Hn(),ze(vn,{all:function(){var e=wt.apply(null,arguments).map(qn);return new vn((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((i,o)=>vn.resolve(i).then((n=>{e[o]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof vn)return e;if(e&&"function"==typeof e.then)return new vn(((t,n)=>{e.then(t,n)}));var t=new vn(Gt,!0,e);return Pn(t,ln),t},reject:Dn,race:function(){var e=wt.apply(null,arguments).map(qn);return new vn(((t,n)=>{e.map((e=>vn.resolve(e).then(t,n)))}))},PSD:{get:()=>dn,set:e=>dn=e},totalEchoes:{get:()=>Mn},newPSD:In,usePSD:zn,scheduler:{get:()=>on,set:e=>{on=e}},rejectionMapper:{get:()=>hn,set:e=>{hn=e}},follow:(e,t)=>new vn(((n,r)=>In(((t,n)=>{var r=dn;r.unhandleds=[],r.onunhandled=n,r.finalize=Ut((function(){!function(e){yn.push((function t(){e(),yn.splice(yn.indexOf(t),1)})),++gn,on((()=>{0==--gn&&Rn()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),en&&(en.allSettled&&Ge(vn,"allSettled",(function(){const e=wt.apply(null,arguments).map(qn);return new vn((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,i)=>vn.resolve(e).then((e=>r[i]={status:"fulfilled",value:e}),(e=>r[i]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),en.any&&"undefined"!=typeof AggregateError&&Ge(vn,"any",(function(){const e=wt.apply(null,arguments).map(qn);return new vn(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const i=new Array(r);e.forEach(((e,o)=>vn.resolve(e).then((e=>t(e)),(e=>{i[o]=e,--r||n(new AggregateError(i))}))))}))})));const Ln={awaits:0,echoes:0,id:0};var Kn=0,Tn=[],Nn=0,Mn=0,$n=0;function In(e,t,n,r){var i=dn,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++$n;var s=fn.env;o.env=tn?{Promise:vn,PromiseProp:{value:vn,configurable:!0,writable:!0},all:vn.all,race:vn.race,allSettled:vn.allSettled,any:vn.any,resolve:vn.resolve,reject:vn.reject,nthen:Jn(s.nthen,o),gthen:Jn(s.gthen,o)}:{},t&&Ue(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=zn(o,e,n,r);return 0===o.ref&&o.finalize(),a}function Fn(){return Ln.id||(Ln.id=++Kn),++Ln.awaits,Ln.echoes+=100,Ln.id}function Bn(){return!!Ln.awaits&&(0==--Ln.awaits&&(Ln.id=0),Ln.echoes=100*Ln.awaits,!0)}function qn(e){return Ln.echoes&&e&&e.constructor===en?(Fn(),e.then((e=>(Bn(),e)),(e=>(Bn(),Xn(e))))):e}function Un(e){++Mn,Ln.echoes&&0!=--Ln.echoes||(Ln.echoes=Ln.id=0),Tn.push(dn),Vn(e,!0)}function Wn(){var e=Tn[Tn.length-1];Tn.pop(),Vn(e,!1)}function Vn(e,t){var n=dn;if((t?!Ln.echoes||Nn++&&e===dn:!Nn||--Nn&&e===dn)||Yn(t?Un.bind(null,e):Wn),e!==dn&&(dn=e,n===fn&&(fn.env=Hn()),tn)){var r=fn.env.Promise,i=e.env;Qt.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(Fe,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function Hn(){var e=Fe.Promise;return tn?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Fe,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Qt.then,gthen:e.prototype.then}:{}}function zn(e,t,n,r,i){var o=dn;try{return Vn(e,!0),t(n,r,i)}finally{Vn(o,!1)}}function Yn(e){Zt.call(Jt,e)}function Gn(e,t,n,r){return"function"!=typeof e?e:function(){var i=dn;n&&Fn(),Vn(t,!0);try{return e.apply(this,arguments)}finally{Vn(i,!1),r&&Yn(Bn)}}}function Jn(e,t){return function(n,r){return e.call(this,Gn(n,t),Gn(r,t))}}function Qn(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(Fe.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Ue(r,i)):Fe.CustomEvent&&Ue(r=new CustomEvent("unhandledrejection",{detail:i}),i),r&&Fe.dispatchEvent&&(dispatchEvent(r),!Fe.PromiseRejectionEvent&&Fe.onunhandledrejection))try{Fe.onunhandledrejection(r)}catch(e){}kt&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Zt).indexOf("[native code]")&&(Fn=Bn=Ft);var Xn=vn.reject;function Zn(e,t,n,r){if(e.idbdb&&(e._state.openComplete||dn.letThrough||e._vip)){var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===Tt.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Zn(e,t,n,r)))):Xn(i)}return i._promise(t,((e,t)=>In((()=>(dn.trans=i,r(e,t,i)))))).then((e=>i._completion.then((()=>e))))}if(e._state.openComplete)return Xn(new Mt.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Xn(new Mt.DatabaseClosed);e.open().catch(Ft)}return e._state.dbReadyPromise.then((()=>Zn(e,t,n,r)))}const er=String.fromCharCode(65535),tr="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",nr=[],rr="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),ir=rr,or=rr,sr=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function ar(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const ur={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function cr(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=dt(t))[e],t)}class lr{_trans(e,t,n){const r=this._tx||dn.trans,i=this.name;function o(e,n,r){if(!r.schema[i])throw new Mt.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}const s=Cn();try{return r&&r.db===this.db?r===dn.trans?r._promise(e,o,n):In((()=>r._promise(e,o,n)),{trans:r,transless:dn.transless||dn}):Zn(this.db,e,[this.name],o)}finally{s&&jn()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(qe(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=Be(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==er)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&kt&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}const[s,a]=t.reduce((([t,n],i)=>{const s=r[i],a=e[i];return[t||s,t||!s?ar(n,s&&s.multi?e=>{const t=ot(e,i);return qe(t)&&t.some((e=>o(a,e)))}:e=>o(a,ot(e,i))):n]}),[null,null]);return s?this.where(s.name).equals(e[s.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,qe(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(He(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){Ue(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let i=e;return r&&n&&(i=cr(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]}))).then((e=>e.numFailures?vn.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{st(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||qe(e))return this.where(":id").equals(e).modify(t);{const n=ot(e,this.schema.primKey.keyPath);if(void 0===n)return Xn(new Mt.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?Be(t).forEach((n=>{st(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let i=e;return r&&n&&(i=cr(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null}))).then((e=>e.numFailures?vn.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{st(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?vn.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:ur}))).then((e=>e.numFailures?vn.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,i=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:o}=this.schema.primKey;if(o&&r)throw new Mt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Mt.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=o&&n?e.map(cr(o)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:i}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return i?t:n;throw new Kt(`${this.name}.bulkAdd(): ${e} of ${s} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,i=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:o}=this.schema.primKey;if(o&&r)throw new Mt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Mt.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=o&&n?e.map(cr(o)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:i}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return i?t:n;throw new Kt(`${this.name}.bulkPut(): ${e} of ${s} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new Kt(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}}function hr(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(e,r,i){if("object"==typeof e)return s(e);r||(r=zt),i||(i=Ft);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=r(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(r,i)}};return t[e]=n[e]=o,o}function s(e){Be(e).forEach((function(t){var n=e[t];if(qe(n))o(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Mt.InvalidArgument("Invalid event config");var r=o(t,Bt,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){rt((function(){e.apply(null,t)}))}))}))}}))}}function fr(e,t){return Je(t).from({prototype:e}),t}function dr(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function pr(e,t){e.filter=ar(e.filter,t)}function gr(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>ar(r(),t()):t,e.justLimit=n&&!r}function yr(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new Mt.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function vr(e,t,n){const r=yr(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function mr(e,t,n,r){const i=e.replayFilter?ar(e.filter,e.replayFilter()):e.filter;if(e.or){const o={},s=(e,n,r)=>{if(!i||i(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),He(o,a)||(o[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(s,n),br(vr(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return br(vr(e,r,n),ar(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function br(e,t,n,r){var i=An(r?(e,t,i)=>n(r(e),t,i):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=Ft}),(t=>{e.fail(t),n=Ft}))||i(e.value,e,(e=>n=e)),n()}))}))}function wr(e,t){try{const n=_r(e),r=_r(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const n=e.length,r=t.length,i=n<r?n:r;for(let n=0;n<i;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(kr(e),kr(t));case"Array":return function(e,t){const n=e.length,r=t.length,i=n<r?n:r;for(let n=0;n<i;++n){const r=wr(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function _r(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=yt(e);return"ArrayBuffer"===n?"binary":n}function kr(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class xr{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Xn.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Xn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=ar(t.algorithm,e)}_iterate(e,t){return mr(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Ue(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>mr(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(dr(t,!0))return n.count({trans:e,query:{index:yr(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return mr(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){var n=o(e,i),r=o(t,i);return n<r?-s:n>r?s:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&dr(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=yr(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return mr(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,dr(t)?gr(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):gr(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),gr(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return pr(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return pr(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=ar(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&dr(t,!0)&&t.limit>0)return this._read((e=>{var n=yr(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return pr(this._ctx,(function(e){var t=e.primaryKey.toString(),r=He(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var i=Be(e),o=i.length;r=function(t){for(var n=!1,r=0;r<o;++r){var s=i[r],a=e[s];ot(t,s)!==a&&(st(t,s,a),n=!0)}return n}}const s=t.table.core,{outbound:a,extractKey:u}=s.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const f=[],d=(e,t)=>{const{failures:n,numFailures:r}=t;h+=e-r;for(let e of Be(n))l.push(n[e])};return this.clone().primaryKeys().then((i=>{const o=l=>{const h=Math.min(c,i.length-l);return s.getMany({trans:n,keys:i.slice(l,l+h),cache:"immutable"}).then((f=>{const p=[],g=[],y=a?[]:null,v=[];for(let e=0;e<h;++e){const t=f[e],n={value:dt(t),primKey:i[l+e]};!1!==r.call(n,n.value,n)&&(null==n.value?v.push(i[l+e]):a||0===wr(u(t),u(n.value))?(g.push(n.value),a&&y.push(i[l+e])):(v.push(i[l+e]),p.push(n.value)))}const m=dr(t)&&t.limit===1/0&&("function"!=typeof e||e===Sr)&&{index:t.index,range:t.range};return Promise.resolve(p.length>0&&s.mutate({trans:n,type:"add",values:p}).then((e=>{for(let t in e.failures)v.splice(parseInt(t),1);d(p.length,e)}))).then((()=>(g.length>0||m&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:y,values:g,criteria:m,changeSpec:"function"!=typeof e&&e}).then((e=>d(g.length,e))))).then((()=>(v.length>0||m&&e===Sr)&&s.mutate({trans:n,type:"delete",keys:v,criteria:m}).then((e=>d(v.length,e))))).then((()=>i.length>l+h&&o(l+c)))}))};return o(0).then((()=>{if(l.length>0)throw new Lt("Error modifying one or more objects",l,h,f);return i.length}))}))}))}delete(){var e=this._ctx,t=e.range;return dr(e)&&(e.isPrimKey&&!or||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((({failures:e,lastResult:n,results:r,numFailures:i})=>{if(i)throw new Lt("Could not delete some values",Object.keys(e).map((t=>e[t])),t-i);return t-i}))))})):this.modify(Sr)}}const Sr=(e,t)=>t.value=null;function Or(e,t){return e<t?-1:e===t?0:1}function Pr(e,t){return e>t?-1:e===t?0:1}function Er(e,t,n){var r=e instanceof Lr?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Cr(e){return new e.Collection(e,(()=>Ar(""))).limit(0)}function jr(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),a=-1,u=0;u<s;++u){var c=t[u];if(c!==r[u])return i(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):i(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;i(e[u],c)<0&&(a=u)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function Rr(e,t,n,r){var i,o,s,a,u,c,l,h=n.length;if(!n.every((e=>"string"==typeof e)))return Er(e,"String expected.");function f(e){i=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),o=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),s="next"===e?Or:Pr;var t=n.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}f("next");var d=new e.Collection(e,(()=>Dr(a[0],u[h-1]+r)));d._ondirectionchange=function(e){f(e)};var p=0;return d._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,u,p))return!0;for(var d=null,g=p;g<h;++g){var y=jr(i,f,a[g],u[g],s,c);null===y&&null===d?p=g+1:(null===d||s(d,y)>0)&&(d=y)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),d}function Dr(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Ar(e){return{type:1,lower:e,upper:e}}class Lr{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Cr(this):new this.Collection(this,(()=>Dr(e,t,!n,!r)))}catch(e){return Er(this,tr)}}equals(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Ar(e)))}above(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Dr(e,void 0,!0)))}aboveOrEqual(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Dr(e,void 0,!1)))}below(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Dr(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Dr(void 0,e)))}startsWith(e){return"string"!=typeof e?Er(this,"String expected."):this.between(e,e+er,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):Rr(this,((e,t)=>0===e.indexOf(t[0])),[e],er)}equalsIgnoreCase(e){return Rr(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=wt.apply(bt,arguments);return 0===e.length?Cr(this):Rr(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=wt.apply(bt,arguments);return 0===e.length?Cr(this):Rr(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,er)}anyOf(){const e=wt.apply(bt,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return Er(this,tr)}if(0===e.length)return Cr(this);const n=new this.Collection(this,(()=>Dr(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,i,o)=>{const s=n.key;for(;t(s,e[r])>0;)if(++r,r===e.length)return i(o),!1;return 0===t(s,e[r])||(i((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=wt.apply(bt,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Er(this,tr)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,i=this._descending,o=this._min,s=this._max;if(0===e.length)return Cr(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return Er(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Mt.InvalidArgument);const a=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let c,l=r;function h(e,t){return l(e[0],t[0])}try{c=e.reduce((function(e,t){let r=0,i=e.length;for(;r<i;++r){const i=e[r];if(n(t[0],i[1])<0&&n(t[1],i[0])>0){i[0]=o(i[0],t[0]),i[1]=s(i[1],t[1]);break}}return r===i&&e.push(t),e}),[]),c.sort(h)}catch(e){return Er(this,tr)}let f=0;const d=u?e=>r(e,c[f][1])>0:e=>r(e,c[f][1])>=0,p=a?e=>i(e,c[f][0])>0:e=>i(e,c[f][0])>=0;let g=d;const y=new this.Collection(this,(()=>Dr(c[0][0],c[c.length-1][1],!a,!u)));return y._ondirectionchange=e=>{"next"===e?(g=d,l=r):(g=p,l=i),c.sort(h)},y._addAlgorithm(((e,t,n)=>{for(var i=e.key;g(i);)if(++f,f===c.length)return t(n),!1;return!!function(e){return!d(e)&&!p(e)}(i)||(0===this._cmp(i,c[f][1])||0===this._cmp(i,c[f][0])||t((()=>{l===r?e.continue(c[f][0]):e.continue(c[f][1])})),!1)})),y}startsWithAnyOf(){const e=wt.apply(bt,arguments);return e.every((e=>"string"==typeof e))?0===e.length?Cr(this):this.inAnyRange(e.map((e=>[e,e+er]))):Er(this,"startsWithAnyOf() only works with strings")}}function Kr(e){return An((function(t){return Tr(t),e(t.target.error),!1}))}function Tr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const Nr=hr(null,"storagemutated");class Mr{_lock(){return nt(!dn.global),++this._reculock,1!==this._reculock||dn.global||(dn.lockOwnerFor=this),this}_unlock(){if(nt(!dn.global),0==--this._reculock)for(dn.global||(dn.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{zn(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&dn.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(nt(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new Mt.DatabaseClosed(n);case"MissingAPIError":throw new Mt.MissingAPI(n.message,n);default:throw new Mt.OpenFailed(n)}if(!this.active)throw new Mt.TransactionInactive;return nt(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=An((t=>{Tr(t),this._reject(e.error)})),e.onabort=An((t=>{Tr(t),this.active&&this._reject(new Mt.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=An((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&Nr.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Xn(new Mt.ReadOnly("Transaction is readonly"));if(!this.active)return Xn(new Mt.TransactionInactive);if(this._locked())return new vn(((r,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,i)},dn])}));if(n)return In((()=>{var e=new vn(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new vn(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=vn.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>n));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new vn(((e,r)=>{n.then((n=>t._waitingQueue.push(An(e.bind(null,n)))),(e=>t._waitingQueue.push(An(r.bind(null,e))))).finally((()=>{t._waitingFor===i&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Mt.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(He(t,e))return t[e];const n=this.schema[e];if(!n)throw new Mt.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function $r(e,t,n,r,i,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+Ir(t)}}function Ir(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Fr(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:it(n,(e=>[e.name,e]))}}let Br=e=>{try{return e.only([[]]),Br=()=>[[]],[[]]}catch(e){return Br=()=>er,er}};function qr(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>ot(t,e)}(e):t=>ot(t,e)}function Ur(e){return[].slice.call(e)}let Wr=0;function Vr(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Hr(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:n,upper:r,lowerOpen:i,upperOpen:o}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!o):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!o)}const{schema:i,hasGetAll:o}=function(e,t){const n=Ur(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=qe(t),i=null==t,o={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:qr(t)},indexes:Ur(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:i}=e,s={name:t,compound:qe(i),keyPath:i,unique:n,multiEntry:r,extractKey:qr(i)};return o[Vr(i)]=s,s})),getIndexByKeyPath:e=>o[Vr(e)]};return o[":id"]=s.primaryKey,null!=t&&(o[Vr(t)]=s.primaryKey),s}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),s=i.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:i,values:o,range:s}){return new Promise(((a,u)=>{a=An(a);const c=e.objectStore(t),l=null==c.keyPath,h="put"===n||"add"===n;if(!h&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:f}=i||o||{length:1};if(i&&o&&i.length!==o.length)throw new Error("Given keys array must have same length as given values array.");if(0===f)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const p=[],g=[];let y=0;const v=e=>{++y,Tr(e)};if("deleteRange"===n){if(4===s.type)return a({numFailures:y,failures:g,results:[],lastResult:void 0});3===s.type?p.push(d=c.clear()):p.push(d=c.delete(r(s)))}else{const[e,t]=h?l?[o,i]:[o,null]:[i,null];if(h)for(let r=0;r<f;++r)p.push(d=t&&void 0!==t[r]?c[n](e[r],t[r]):c[n](e[r])),d.onerror=v;else for(let t=0;t<f;++t)p.push(d=c[n](e[t])),d.onerror=v}const m=e=>{const t=e.target.result;p.forEach(((e,t)=>null!=e.error&&(g[t]=e.error))),a({numFailures:y,failures:g,results:"delete"===n?i:p.map((e=>e.result)),lastResult:t})};d.onerror=e=>{v(e),m(e)},d.onsuccess=m}))},getMany:({trans:e,keys:n})=>new Promise(((r,i)=>{r=An(r);const o=e.objectStore(t),s=n.length,a=new Array(s);let u,c=0,l=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++l===c&&r(a)},f=Kr(i);for(let e=0;e<s;++e)null!=n[e]&&(u=o.get(n[e]),u._pos=e,u.onsuccess=h,u.onerror=f,++c);0===c&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,i)=>{r=An(r);const o=e.objectStore(t).get(n);o.onsuccess=e=>r(e.target.result),o.onerror=Kr(i)})),query:function(e){return n=>new Promise(((i,o)=>{i=An(i);const{trans:s,values:a,limit:u,query:c}=n,l=u===1/0?void 0:u,{index:h,range:f}=c,d=s.objectStore(t),p=h.isPrimaryKey?d:d.index(h.name),g=r(f);if(0===u)return i({result:[]});if(e){const e=a?p.getAll(g,l):p.getAllKeys(g,l);e.onsuccess=e=>i({result:e.target.result}),e.onerror=Kr(o)}else{let e=0;const t=a||!("openKeyCursor"in p)?p.openCursor(g):p.openKeyCursor(g),n=[];t.onsuccess=r=>{const o=t.result;return o?(n.push(a?o.value:o.primaryKey),++e===u?i({result:n}):void o.continue()):i({result:n})},t.onerror=Kr(o)}}))}(o),openCursor:function({trans:e,values:n,query:i,reverse:o,unique:s}){return new Promise(((a,u)=>{a=An(a);const{index:c,range:l}=i,h=e.objectStore(t),f=c.isPrimaryKey?h:h.index(c.name),d=o?s?"prevunique":"prev":s?"nextunique":"next",p=n||!("openKeyCursor"in f)?f.openCursor(r(l),d):f.openKeyCursor(r(l),d);p.onerror=Kr(u),p.onsuccess=An((t=>{const n=p.result;if(!n)return void a(null);n.___id=++Wr,n.done=!1;const r=n.continue.bind(n);let i=n.continuePrimaryKey;i&&(i=i.bind(n));const o=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=An(u),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=An(e),p.onerror=Kr(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),a=()=>{if(p.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return p.onsuccess=An((e=>{p.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=i,n.advance=o,a(),t},a(n)}),u)}))},count({query:e,trans:n}){const{index:i,range:o}=e;return new Promise(((e,s)=>{const a=n.objectStore(t),u=i.isPrimaryKey?a:a.index(i.name),c=r(o),l=c?u.count(c):u.count();l.onsuccess=An((t=>e(t.target.result))),l.onerror=Kr(s)}))}}}(e))),a={};return s.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:Br(t),schema:i}}function zr({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},i){const o=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(Hr(t,n,i),e.dbcore);return{dbcore:o}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Yr({_novip:e},t,n,r){n.forEach((n=>{const i=r[n];t.forEach((t=>{const r=Xe(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?Ge(t,n,{get(){return this.table(n)},set(e){Ye(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function Gr({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function Jr(e,t){return e._cfg.version-t._cfg.version}function Qr(e,t,n,r){const i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(n),o._completion.catch(r);const s=o._reject.bind(o),a=dn.transless||dn;In((()=>{dn.trans=o,dn.transless=a,0===t?(Be(i).forEach((e=>{Zr(n,e,i[e].primKey,i[e].indexes)})),zr(e,n),vn.follow((()=>e.on.populate.fire(o))).catch(s)):function({_novip:e},t,n,r){const i=[],o=e._versions;let s=e._dbSchema=ti(0,e.idbdb,r),a=!1;return o.filter((e=>e._cfg.version>=t)).forEach((o=>{i.push((()=>{const i=s,u=o._cfg.dbschema;ni(e,i,r),ni(e,u,r),s=e._dbSchema=u;const c=Xr(i,u);c.add.forEach((e=>{Zr(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((e=>{if(e.recreate)throw new Mt.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>ei(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),ei(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=o._cfg.contentUpgrade;if(l&&o._cfg.version>t){zr(e,r),n._memoizedTables={},a=!0;let t=at(u);c.del.forEach((e=>{t[e]=i[e]})),Gr(e,[e.Transaction.prototype]),Yr(e,[e.Transaction.prototype],Be(t),t),n.schema=t;const o=_t(l);let s;o&&Fn();const h=vn.follow((()=>{if(s=l(n),s&&o){var e=Bn.bind(null,null);s.then(e,e)}}));return s&&"function"==typeof s.then?vn.resolve(s):h.then((()=>s))}})),i.push((t=>{a&&ir||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(o._cfg.dbschema,t),Gr(e,[e.Transaction.prototype]),Yr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return i.length?vn.resolve(i.shift()(n.idbtrans)).then(e):vn.resolve()}().then((()=>{var e,t;t=r,Be(e=s).forEach((n=>{t.db.objectStoreNames.contains(n)||Zr(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,o,n).catch(s)}))}function Xr(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const i=e[r],o=t[r];if(i){const e={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!rr)e.recreate=!0,n.change.push(e);else{const t=i.idxByName,r=o.idxByName;let s;for(s in t)r[s]||e.del.push(s);for(s in r){const n=t[s],i=r[s];n?n.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,o])}return n}function Zr(e,t,n,r){const i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>ei(i,e))),i}function ei(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function ti(e,t,n){const r={};return et(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let i=t.keyPath;const o=$r(Ir(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),s=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);i=n.keyPath;var a=$r(n.name,i,!!n.unique,!!n.multiEntry,!1,i&&"string"!=typeof i,!1);s.push(a)}r[e]=Fr(e,o,s)})),r}function ni({_novip:e},t,n){const r=n.db.objectStoreNames;for(let i=0;i<r.length;++i){const o=r[i],s=n.objectStore(o);e._hasGetAll="getAll"in s;for(let e=0;e<s.indexNames.length;++e){const n=s.indexNames[e],r=s.index(n).keyPath,i="string"==typeof r?r:"["+et(r).join("+")+"]";if(t[o]){const e=t[o].idxByName[i];e&&(e.name=n,delete t[o].idxByName[i],t[o].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Fe.WorkerGlobalScope&&Fe instanceof Fe.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class ri{_parseStoresSpec(e,t){Be(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return $r(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),qe(r),0===t)})),i=r.shift();if(i.multi)throw new Mt.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new Mt.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Mt.Schema("Index must have a name and cannot be an empty string")})),t[n]=Fr(n,i,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?Ue(this._cfg.storesSource,e):e;const n=t._versions,r={};let i={};return n.forEach((e=>{Ue(r,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(r,i)})),t._dbSchema=i,Gr(t,[t._allTables,t,t.Transaction.prototype]),Yr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Be(i),i),t._storeNames=Be(i),this}upgrade(e){return this._cfg.contentUpgrade=Yt(this._cfg.contentUpgrade||Ft,e),this}}function ii(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Oi("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function oi(e){return e&&"function"==typeof e.databases}function si(e){return In((function(){return dn.letThrough=!0,e()}))}function ai(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function ui(e){var t=t=>e.next(t),n=i(t),r=i((t=>e.throw(t)));function i(e){return t=>{var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(n,r):qe(o)?Promise.all(o).then(n,r):n(o)}}return i(t)()}function ci(e,t,n){var r=arguments.length;if(r<2)throw new Mt.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,ct(i),n]}function li(e,t,n,r,i){return vn.resolve().then((()=>{const o=dn.transless||dn,s=e._createTransaction(t,n,e._dbSchema,r),a={trans:s,transless:o};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===Tt.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>li(e,t,n,null,i)))):Xn(r)}const u=_t(i);let c;u&&Fn();const l=vn.follow((()=>{if(c=i.call(s,s),c)if(u){var e=Bn.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=ui(c))}),a);return(c&&"function"==typeof c.then?vn.resolve(c).then((e=>s.active?e:Xn(new Mt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((e=>(r&&s._resolve(),s._completion.then((()=>e))))).catch((e=>(s._reject(e),Xn(e))))}))}function hi(e,t,n){const r=qe(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const fi={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const n=e.table(t),{schema:r}=n,i={},o=[];function s(e,t,n){const r=Vr(e),a=i[r]=i[r]||[],u=null==e?0:"string"==typeof e?1:e.length,c=t>0,l={...n,isVirtual:c,keyTail:t,keyLength:u,extractKey:qr(e),unique:!c&&n.unique};return a.push(l),l.isPrimaryKey||o.push(l),u>1&&s(2===u?e[0]:e.slice(0,u-1),t+1,n),a.sort(((e,t)=>e.keyTail-t.keyTail)),l}const a=s(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[a];for(const e of r.indexes)s(e.keyPath,0,e);function u(t){const n=t.query.index;return n.isVirtual?{...t,query:{index:n,range:(r=t.query.range,i=n.keyTail,{type:1===r.type?2:r.type,lower:hi(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:hi(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}:t;var r,i}const c={...n,schema:{...r,primaryKey:a,indexes:o,getIndexByKeyPath:function(e){const t=i[Vr(e)];return t&&t[0]}},count:e=>n.count(u(e)),query:e=>n.query(u(e)),openCursor(t){const{keyTail:r,isVirtual:i,keyLength:o}=t.query.index;return i?n.openCursor(u(t)).then((n=>n&&function(n){const i=Object.create(n,{continue:{value:function(i){null!=i?n.continue(hi(i,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,i){n.continuePrimaryKey(hi(t,e.MAX_KEY,r),i)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>n.value}});return i}(n))):n.openCursor(t)}};return c}}}};function di(e,t,n,r){return n=n||{},r=r||"",Be(e).forEach((i=>{if(He(t,i)){var o=e[i],s=t[i];if("object"==typeof o&&"object"==typeof s&&o&&s){const e=yt(o);e!==yt(s)?n[r+i]=t[i]:"Object"===e?di(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i])}else o!==s&&(n[r+i]=t[i])}else n[r+i]=void 0})),Be(t).forEach((i=>{He(e,i)||(n[r+i]=t[i])})),n}const pi={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const n=e.table(t),{primaryKey:r}=n.schema,i={...n,mutate(e){const i=dn.trans,{deleting:o,creating:s,updating:a}=i.table(t).hook;switch(e.type){case"add":if(s.fire===Ft)break;return i._promise("readwrite",(()=>u(e)),!0);case"put":if(s.fire===Ft&&a.fire===Ft)break;return i._promise("readwrite",(()=>u(e)),!0);case"delete":if(o.fire===Ft)break;return i._promise("readwrite",(()=>u(e)),!0);case"deleteRange":if(o.fire===Ft)break;return i._promise("readwrite",(()=>function(e){return c(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function u(e){const t=dn.trans,i=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:i}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,i).then((u=>{const c=i.map(((n,i)=>{const c=u[i],l={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(l,n,c,t);else if("add"===e.type||void 0===c){const o=s.fire.call(l,n,e.values[i],t);null==n&&null!=o&&(n=o,e.keys[i]=n,r.outbound||st(e.values[i],r.keyPath,n))}else{const r=di(c,e.values[i]),o=a.fire.call(l,r,n,c,t);if(o){const t=e.values[i];Object.keys(o).forEach((e=>{He(t,e)?t[e]=o[e]:st(t,e,o[e])}))}}return l}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:o})=>{for(let r=0;r<i.length;++r){const o=n?n[r]:i[r],s=c[r];null==o?s.onerror&&s.onerror(t[r]):s.onsuccess&&s.onsuccess("put"===e.type&&u[r]?e.values[r]:o)}return{failures:t,results:n,numFailures:r,lastResult:o}})).catch((e=>(c.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function c(e,t,i){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:i}).then((({result:n})=>u({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:c(e,{...t,lower:n[n.length-1],lowerOpen:!0},i)))))}}};return i}})};function gi(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let i=0,o=0;i<t.keys.length&&o<e.length;++i)0===wr(t.keys[i],e[o])&&(r.push(n?dt(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}const yi={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);const t=gi(e.keys,e.trans._cache,"clone"===e.cache);return t?vn.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?dt(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function vi(e){return!("from"in e)}const mi=function(e,t){if(!this){const t=new mi;return e&&"d"in e&&Ue(t,e),t}Ue(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function bi(e,t,n){const r=wr(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(vi(e))return Ue(e,{from:t,to:n,d:1});const i=e.l,o=e.r;if(wr(n,e.from)<0)return i?bi(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},ki(e);if(wr(t,e.to)>0)return o?bi(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},ki(e);wr(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),wr(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const s=!e.r;i&&!e.l&&wi(e,i),o&&s&&wi(e,o)}function wi(e,t){vi(t)||function e(t,{from:n,to:r,l:i,r:o}){bi(t,n,r),i&&e(t,i),o&&e(t,o)}(e,t)}function _i(e){let t=vi(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&wr(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||wr(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function ki(e){var t,n;const r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const t="r"===i?"l":"r",n={...e},r=e[i];e.from=r.from,e.to=r.to,e[i]=r[i],n[i]=r[t],e[t]=n,n.d=xi(n)}e.d=xi(e)}function xi({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}ze(mi.prototype,{add(e){return wi(this,e),this},addKey(e){return bi(this,e,e),this},addKeys(e){return e.forEach((e=>bi(this,e,e))),this},[vt](){return _i(this)}});const Si={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new mi(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{const i=e.table(r),{schema:o}=i,{primaryKey:s}=o,{extractKey:a,outbound:u}=s,c={...i,mutate:e=>{const s=e.trans,a=s.mutatedParts||(s.mutatedParts={}),u=e=>{const n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new mi)},c=u(""),l=u(":dels"),{type:h}=e;let[f,d]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const p=e.trans._cache;return i.mutate(e).then((e=>{if(qe(f)){"delete"!==h&&(f=e.results),c.addKeys(f);const t=gi(f,p);t||"add"===h||l.addKeys(f),(t||d)&&function(e,t,n,r){t.indexes.forEach((function(t){const i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}const s=e=>t.multiEntry&&qe(e)?e.forEach((e=>i.addKey(e))):i.addKey(e);(n||r).forEach(((e,t)=>{const i=n&&o(n[t]),a=r&&o(r[t]);0!==wr(i,a)&&(null!=i&&s(i),null!=a&&s(a))}))}))}(u,o,t,d)}else if(f){const e={from:f.lower,to:f.upper};l.add(e),c.add(e)}else c.add(n),l.add(n),o.indexes.forEach((e=>u(e.name).add(n)));return e}))}},l=({query:{index:t,range:n}})=>{var r,i;return[t,new mi(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(i=n.upper)&&void 0!==i?i:e.MAX_KEY)]},h={get:e=>[s,new mi(e.key)],getMany:e=>[s,(new mi).addKeys(e.keys)],count:l,query:l,openCursor:l};return Be(h).forEach((e=>{c[e]=function(o){const{subscr:s}=dn;if(s){const c=e=>{const n=`idb://${t}/${r}/${e}`;return s[n]||(s[n]=new mi)},l=c(""),f=c(":dels"),[d,p]=h[e](o);if(c(d.name||"").add(p),!d.isPrimaryKey){if("count"!==e){const t="query"===e&&u&&o.values&&i.query({...o,values:!1});return i[e].apply(this,arguments).then((n=>{if("query"===e){if(u&&o.values)return t.then((({result:e})=>(l.addKeys(e),n)));const e=o.values?n.result.map(a):n.result;o.values?l.addKeys(e):f.addKeys(e)}else if("openCursor"===e){const e=n,t=o.values;return e&&Object.create(e,{key:{get:()=>(f.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return f.addKey(t),t}},value:{get:()=>(t&&l.addKey(e.primaryKey),e.value)}})}return n}))}f.add(n)}}return i[e].apply(this,arguments)}})),c}}}};class Oi{constructor(e,t){this._middlewares={},this.verno=0;const n=Oi.dependencies;this._options=t={addons:Oi.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:r}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ft,dbReadyPromise:null,cancelOpen:Ft,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var o;i.dbReadyPromise=new vn((e=>{i.dbReadyResolve=e})),i.openCanceller=new vn(((e,t)=>{i.cancelOpen=t})),this._state=i,this.name=e,this.on=hr(this,"populate","blocked","versionchange","close",{ready:[Yt,Ft]}),this.on.ready.subscribe=tt(this.on.ready.subscribe,(e=>(t,n)=>{Oi.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||vn.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);const r=this;n||e((function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))}}))})),this.Collection=(o=this,fr(xr.prototype,(function(e,t){this.db=o;let n=ur,r=null;if(t)try{n=t()}catch(e){r=e}const i=e._ctx,s=i.table,a=s.hook.reading.fire;this._ctx={table:s,index:i.index,isPrimKey:!i.index||s.schema.primKey.keyPath&&i.index===s.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:a!==Bt?a:null}}))),this.Table=function(e){return fr(lr.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:hr(null,{creating:[Wt,Ft],reading:[qt,Bt],updating:[Ht,Ft],deleting:[Vt,Ft]})}))}(this),this.Transaction=function(e){return fr(Mr.prototype,(function(t,n,r,i,o){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=hr(this,"complete","error","abort"),this.parent=o||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 vn(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Xn(e)}))}))}(this),this.Version=function(e){return fr(ri.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return fr(Lr.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const i=e._deps.indexedDB;if(!i)throw new Mt.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>i.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=Br(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),nr.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(fi),this.use(pi),this.use(Si),this.use(yi),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new Mt.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Mt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Jr),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||dn.letThrough||this._vip)?e():new vn(((e,t)=>{if(this._state.openComplete)return t(new Mt.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new Mt.DatabaseClosed);this.open().catch(Ft)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==n?10:n,name:r}),i.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Xn(t.dbOpenError):e));kt&&(t.openCanceller._stackHolder=Pt()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function i(){if(t.openCanceller!==r)throw new Mt.DatabaseClosed("db.open() was cancelled")}let o=t.dbReadyResolve,s=null,a=!1;return vn.race([r,("undefined"==typeof navigator?vn.resolve():ai()).then((()=>new vn(((r,o)=>{if(i(),!n)throw new Mt.MissingAPI;const u=e.name,c=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!c)throw new Mt.MissingAPI;c.onerror=Kr(o),c.onblocked=An(e._fireOnBlocked),c.onupgradeneeded=An((r=>{if(s=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=Tr,s.abort(),c.result.close();const e=n.deleteDatabase(u);e.onsuccess=e.onerror=An((()=>{o(new Mt.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{s.onerror=Kr(o);var i=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=i<1,e._novip.idbdb=c.result,Qr(e,i/10,s,o)}}),o),c.onsuccess=An((()=>{s=null;const n=e._novip.idbdb=c.result,i=et(n.objectStoreNames);if(i.length>0)try{const r=n.transaction(1===(o=i).length?o[0]:o,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=ti(0,t,n);e._storeNames=et(t.objectStoreNames,0),Yr(e,[e._allTables],Be(r),r)}(e,n,r):(ni(e,e._dbSchema,r),function(e,t){const n=Xr(ti(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),zr(e,r)}catch(e){}var o;nr.push(e),n.onversionchange=An((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=An((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!oi(e)&&"__dbnames"!==n&&ii(e,t).put({name:n}).catch(Ft)}(e._deps,u),r()}),o)}))))]).then((()=>(i(),t.onReadyBeingFired=[],vn.resolve(si((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(Yt,Ft);return t.onReadyBeingFired=[],vn.resolve(si((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{s&&s.abort()}catch(e){}return r===t.openCanceller&&e._close(),Xn(n)})).finally((()=>{t.openComplete=!0,o()}))}(this)}_close(){const e=this._state,t=nr.indexOf(this);if(t>=0&&nr.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new vn((t=>{e.dbReadyResolve=t})),e.openCanceller=new vn(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new Mt.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new vn(((n,r)=>{const i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=An((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!oi(e)&&"__dbnames"!==n&&ii(e,t).delete(n).catch(Ft)}(this._deps,this.name),n()})),e.onerror=Kr(r),e.onblocked=this._fireOnBlocked};if(e)throw new Mt.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return Be(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=ci.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=dn.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const i=-1!==e.indexOf("?");let o,s;e=e.replace("!","").replace("?","");try{if(s=t.map((e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)o="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new Mt.InvalidArgument("Invalid transaction mode: "+e);o="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===o){if(!i)throw new Mt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!i)throw new Mt.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Xn(e)}const a=li.bind(null,this,o,s,r,n);return r?r._promise(o,a,"lock"):dn.trans?zn(dn.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!He(this._allTables,e))throw new Mt.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const Pi="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class Ei{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[Pi](){return this}}function Ci(e,t){return Be(t).forEach((n=>{wi(e[n]||(e[n]=new mi),t[n])})),e}let ji;try{ji={indexedDB:Fe.indexedDB||Fe.mozIndexedDB||Fe.webkitIndexedDB||Fe.msIndexedDB,IDBKeyRange:Fe.IDBKeyRange||Fe.webkitIDBKeyRange}}catch(Fe){ji={indexedDB:null,IDBKeyRange:null}}const Ri=Oi;function Di(e){let t=Ai;try{Ai=!0,Nr.storagemutated.fire(e)}finally{Ai=t}}ze(Ri,{...It,delete:e=>new Ri(e,{addons:[]}).delete(),exists:e=>new Ri(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return oi(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):ii(e,t).toCollection().primaryKeys()}(Ri.dependencies).then(e)}catch(e){return Xn(new Mt.MissingAPI)}},defineClass:()=>function(e){Ue(this,e)},ignoreTransaction:e=>dn.trans?zn(dn.transless,e):e(),vip:si,async:function(e){return function(){try{var t=ui(e.apply(this,arguments));return t&&"function"==typeof t.then?t:vn.resolve(t)}catch(e){return Xn(e)}}},spawn:function(e,t,n){try{var r=ui(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:vn.resolve(r)}catch(e){return Xn(e)}},currentTransaction:{get:()=>dn.trans||null},waitFor:function(e,t){const n=vn.resolve("function"==typeof e?Ri.ignoreTransaction(e):e).timeout(t||6e4);return dn.trans?dn.trans.waitFor(n):n},Promise:vn,debug:{get:()=>kt,set:e=>{xt(e,"dexie"===e?()=>!0:sr)}},derive:Je,extend:Ue,props:ze,override:tt,Events:hr,on:Nr,liveQuery:function(e){return new Ei((t=>{const n=_t(e);let r=!1,i={},o={};const s={get closed(){return r},unsubscribe:()=>{r=!0,Nr.storagemutated.unsubscribe(l)}};t.start&&t.start(s);let a=!1,u=!1;function c(){return Be(o).some((e=>i[e]&&function(e,t){const n=_i(t);let r=n.next();if(r.done)return!1;let i=r.value;const o=_i(e);let s=o.next(i.from),a=s.value;for(;!r.done&&!s.done;){if(wr(a.from,i.to)<=0&&wr(a.to,i.from)>=0)return!0;wr(i.from,a.from)<0?i=(r=n.next(a.from)).value:a=(s=o.next(i.from)).value}return!1}(i[e],o[e])))}const l=e=>{Ci(i,e),c()&&h()},h=()=>{if(a||r)return;i={};const f={},d=function(t){n&&Fn();const r=()=>In(e,{subscr:t,trans:null}),i=dn.trans?zn(dn.transless,r):r();return n&&i.then(Bn,Bn),i}(f);u||(Nr("storagemutated",l),u=!0),a=!0,Promise.resolve(d).then((e=>{a=!1,r||(c()?h():(i={},o=f,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),s.unsubscribe()}))};return h(),s}))},extendObservabilitySet:Ci,getByKeyPath:ot,setByKeyPath:st,delByKeyPath:function(e,t){"string"==typeof t?st(e,t,void 0):"length"in t&&[].map.call(t,(function(t){st(e,t,void 0)}))},shallowClone:at,deepClone:dt,getObjectDiff:di,cmp:wr,asap:rt,minKey:-1/0,addons:[],connections:nr,errnames:Tt,dependencies:ji,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))}),Ri.maxKey=Br(Ri.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Nr("storagemutated",(e=>{if(!Ai){let t;rr?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),Ai=!0,dispatchEvent(t),Ai=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{Ai||Di(e)})));let Ai=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),Nr("storagemutated",(t=>{Ai||e.postMessage(t)})),e.onmessage=e=>{e.data&&Di(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Nr("storagemutated",(e=>{try{Ai||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&Di(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&Di(e.changedParts)}))}vn.rejectionMapper=function(e,t){if(!e||e instanceof Dt||e instanceof TypeError||e instanceof SyntaxError||!e.name||!$t[e.name])return e;var n=new $t[e.name](t||e.message,e);return"stack"in e&&Ge(n,"stack",{get:function(){return this.inner.stack}}),n},xt(kt,sr);class Li extends Oi{constructor(){var e,t;super("ServiceWorker"),t=void 0,(e="dynamicRouteRegistrations")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t,this.version(1).stores({dynamicRouteRegistrations:"++,&pattern"}),this.dynamicRouteRegistrations=this.table("dynamicRouteRegistrations")}}function Ki(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function Ti(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Ki(o,r,i,s,a,"next",e)}function a(e){Ki(o,r,i,s,a,"throw",e)}s(void 0)}))}}function Ni(){return Ni=Ti((function*(e){const t=yield function(e){return Ie.apply(this,arguments)}(e);yield function(e){return Ii.apply(this,arguments)}(t),yield Mi(t)})),Ni.apply(this,arguments)}function Mi(e){return $i.apply(this,arguments)}function $i(){return $i=Ti((function*(e){if(0===e.length)return;const t=yield caches.open(_e),n=yield Promise.all(e.map((r=Ti((function*(e){try{return yield function(e){return A.apply(this,arguments)}((()=>t.add(e)),{onError:(t,n)=>console.debug(`[SW] Failure attempt ${n} at caching "${e}". Error: `,t)}),{url:e,success:!0}}catch(t){return{url:e,success:!1}}})),function(e){return r.apply(this,arguments)})));var r;const i=n.filter((e=>e.success)),o=n.filter((e=>!e.success));i.length>0&&console.debug(`[SW] Successfully added ${i.length} URLs to the OMRS cache. URLs: `,i.map((e=>e.url))),o.length>0&&console.error(`[SW] Failed to cache ${o.length} URLs. URLs: `,o.map((e=>e.url)))})),$i.apply(this,arguments)}function Ii(){return Ii=Ti((function*(e){const t=yield caches.open(_e),n=(yield t.keys()).map((e=>e.url)),r=yield(new Li).dynamicRouteRegistrations.toArray(),i=n.filter((t=>!Se.includes(t)&&!e.includes(t)&&!r.some((e=>new RegExp(e.pattern).test(t)))));console.info("[SW] Removing the following expired URLs from the cache: ",i),console.debug("[SW] The following URLs were known and not invalidated: ",Se,e,r),yield Promise.all(i.map((e=>t.delete(e))))})),Ii.apply(this,arguments)}function Fi(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function Bi(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Fi(o,r,i,s,a,"next",e)}function a(e){Fi(o,r,i,s,a,"throw",e)}s(void 0)}))}}const qi={onImportMapChanged:function(e){return Ui.apply(this,arguments)},clearDynamicRoutes:function(){return Wi.apply(this,arguments)},registerDynamicRoute:function(e){return Vi.apply(this,arguments)}};function Ui(){return Ui=Bi((function*({importMap:e}){yield function(e){return Ni.apply(this,arguments)}(e)})),Ui.apply(this,arguments)}function Wi(){return(Wi=Bi((function*(){yield(new Li).dynamicRouteRegistrations.clear()}))).apply(this,arguments)}function Vi(){return(Vi=Bi((function*({pattern:e,url:t,strategy:n}){let r=e;if(!r&&t&&(r=`^${j(t)}$`),r){const e={pattern:r,strategy:n};yield(new Li).dynamicRouteRegistrations.put(e)}}))).apply(this,arguments)}function Hi(){return Hi=Bi((function*(e){var t,n,r;const i=qi[null!==(r=null===(t=e.data)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.toString())&&void 0!==r?r:""];var o;if(i)try{c({success:!0,result:yield i(e.data)})}catch(e){var s,a;u(null!==(a=null!==(s=null==e?void 0:e.message)&&void 0!==s?s:null==e?void 0:e.toString())&&void 0!==a?a:"Unknown error.")}else u(`Received an unknown message of type "${null===(o=e.data)||void 0===o?void 0:o.type} which cannot be handled.`);function u(e){console.warn("[SW] Handling a message resulted in an error.",e),c({success:!1,error:e})}function c(t){e.ports[0].postMessage(null!=t?t:{})}})),Hi.apply(this,arguments)}n(664);const zi=["DELETE","GET","HEAD","PATCH","POST","PUT"],Yi=e=>e&&"object"==typeof e?e:{handle:e};let Gi,Ji=class{setCatchHandler(e){this.catchHandler=Yi(e)}constructor(e,t,n="GET"){this.handler=Yi(t),this.match=e,this.method=n}},Qi=class extends Ji{constructor(e,t,n){super((({url:t})=>{const n=e.exec(t.href);if(n&&(t.origin===location.origin||0===n.index))return n.slice(1)}),t,n)}};function Xi(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}const Zi=()=>(Gi||(Gi=new class{get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map((t=>{"string"==typeof t&&(t=[t]);const n=new Request(...t);return this.handleRequest({request:n,event:e})})));e.waitUntil(n),e.ports&&e.ports[0]&&n.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const r=n.origin===location.origin,{params:i,route:o}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let s=o&&o.handler;const a=e.method;if(!s&&this._defaultHandlerMap.has(a)&&(s=this._defaultHandlerMap.get(a)),!s)return;let u;try{u=s.handle({url:n,request:e,event:t,params:i})}catch(e){u=Promise.reject(e)}const c=o&&o.catchHandler;if(u instanceof Promise&&(this._catchHandler||c)){var l=this;u=u.catch((h=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Xi(o,r,i,s,a,"next",e)}function a(e){Xi(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*(r){if(c)try{return yield c.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(l._catchHandler)return l._catchHandler.handle({url:n,request:e,event:t});throw r})),function(e){return h.apply(this,arguments)}))}var h;return u}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const i=this._routes.get(n.method)||[];for(const o of i){let i;const s=o.match({url:e,sameOrigin:t,request:n,event:r});if(s)return i=s,(Array.isArray(i)&&0===i.length||s.constructor===Object&&0===Object.keys(s).length||"boolean"==typeof s)&&(i=void 0),{route:o,params:i}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,Yi(e))}setCatchHandler(e){this._catchHandler=Yi(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(t){if(!this._routes.has(t.method))throw new e("unregister-route-but-not-found-with-method",{method:t.method});const n=this._routes.get(t.method).indexOf(t);if(!(n>-1))throw new e("unregister-route-route-not-registered");this._routes.get(t.method).splice(n,1)}constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}},Gi.addFetchListener(),Gi.addCacheListener()),Gi);function eo(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function to(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){eo(o,r,i,s,a,"next",e)}function a(e){eo(o,r,i,s,a,"throw",e)}s(void 0)}))}}function no(e){return"string"==typeof e?new Request(e):e}function ro(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function io(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){ro(o,r,i,s,a,"next",e)}function a(e){ro(o,r,i,s,a,"throw",e)}s(void 0)}))}}n(818);let oo=class{handle(e){const[t]=this.handleAll(e);return t}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const n=t.event,r="string"==typeof t.request?new Request(t.request):t.request,i="params"in t?t.params:void 0,o=new class{fetch(t){var n=this;return to((function*(){const{event:r}=n;let i=no(t);if("navigate"===i.mode&&r instanceof FetchEvent&&r.preloadResponse){const e=yield r.preloadResponse;if(e)return e}const o=n.hasCallback("fetchDidFail")?i.clone():null;try{for(const e of n.iterateCallbacks("requestWillFetch"))i=yield e({request:i.clone(),event:r})}catch(t){if(t instanceof Error)throw new e("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const s=i.clone();try{let e;e=yield fetch(i,"navigate"===i.mode?void 0:n._strategy.fetchOptions);for(const t of n.iterateCallbacks("fetchDidSucceed"))e=yield t({event:r,request:s,response:e});return e}catch(e){throw o&&(yield n.runCallbacks("fetchDidFail",{error:e,event:r,originalRequest:o.clone(),request:s.clone()})),e}}))()}fetchAndCachePut(e){var t=this;return to((function*(){const n=yield t.fetch(e),r=n.clone();return t.waitUntil(t.cachePut(e,r)),n}))()}cacheMatch(e){var t=this;return to((function*(){const n=no(e);let r;const{cacheName:i,matchOptions:o}=t._strategy,s=yield t.getCacheKey(n,"read"),a=Object.assign(Object.assign({},o),{cacheName:i});r=yield caches.match(s,a);for(const e of t.iterateCallbacks("cachedResponseWillBeUsed"))r=(yield e({cacheName:i,matchOptions:o,cachedResponse:r,request:s,event:t.event}))||void 0;return r}))()}cachePut(t,n){var r=this;return to((function*(){const i=no(t);yield l(0);const o=yield r.getCacheKey(i,"write");if(!n)throw new e("cache-put-with-no-response",{url:(s=o.url,new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var s;const u=yield r._ensureResponseSafeToCache(n);if(!u)return!1;const{cacheName:h,matchOptions:f}=r._strategy,d=yield self.caches.open(h),p=r.hasCallback("cacheDidUpdate"),g=p?yield function(e,t,n,r){return a.apply(this,arguments)}(d,o.clone(),["__WB_REVISION__"],f):null;try{yield d.put(o,p?u.clone():u)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&(yield function(){return c.apply(this,arguments)}()),e}for(const e of r.iterateCallbacks("cacheDidUpdate"))yield e({cacheName:h,oldResponse:g,newResponse:u.clone(),request:o,event:r.event});return!0}))()}getCacheKey(e,t){var n=this;return to((function*(){const r=`${e.url} | ${t}`;if(!n._cacheKeys[r]){let i=e;for(const e of n.iterateCallbacks("cacheKeyWillBeUsed"))i=no(yield e({mode:t,request:i,event:n.event,params:n.params}));n._cacheKeys[r]=i}return n._cacheKeys[r]}))()}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}runCallbacks(e,t){var n=this;return to((function*(){for(const r of n.iterateCallbacks(e))yield r(t)}))()}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const n=this._pluginStateMap.get(t),r=r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)};yield r}}waitUntil(e){return this._extendLifetimePromises.push(e),e}doneWaiting(){var e=this;return to((function*(){let t;for(;t=e._extendLifetimePromises.shift();)yield t}))()}destroy(){this._handlerDeferred.resolve(null)}_ensureResponseSafeToCache(e){var t=this;return to((function*(){let n=e,r=!1;for(const e of t.iterateCallbacks("cacheWillUpdate"))if(n=(yield e({request:t.request,response:n,event:t.event}))||void 0,r=!0,!n)break;return r||n&&200!==n.status&&(n=void 0),n}))()}constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new class{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}},this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}}(this,{event:n,request:r,params:i}),s=this._getResponse(o,r,n);return[s,this._awaitComplete(s,o,r,n)]}_getResponse(t,n,r){var i=this;return io((function*(){let o;yield t.runCallbacks("handlerWillStart",{event:r,request:n});try{if(o=yield i._handle(n,t),!o||"error"===o.type)throw new e("no-response",{url:n.url})}catch(e){if(e instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(o=yield i({error:e,event:r,request:n}),o)break;if(!o)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))o=yield e({event:r,request:n,response:o});return o}))()}_awaitComplete(e,t,n,r){return io((function*(){let i,o;try{i=yield e}catch(o){}try{yield t.runCallbacks("handlerDidRespond",{event:r,request:n,response:i}),yield t.doneWaiting()}catch(e){e instanceof Error&&(o=e)}if(yield t.runCallbacks("handlerDidComplete",{event:r,request:n,response:i,error:o}),t.destroy(),o)throw o}))()}constructor(e={}){this.cacheName=i(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}};function so(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function ao(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}const uo={cacheWillUpdate:(co=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){ao(o,r,i,s,a,"next",e)}function a(e){ao(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*({response:e}){return 200===e.status||0===e.status?e:null})),function(e){return co.apply(this,arguments)})};var co;function lo(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function ho(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){lo(o,r,i,s,a,"next",e)}function a(e){lo(o,r,i,s,a,"throw",e)}s(void 0)}))}}function fo(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function po(e){var t;const n=+(null!==(t=go(e,me))&&void 0!==t?t:"");return isNaN(n)||n<200||n>599?503:n}function go(e,t){return e.get(t)}function yo(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function vo(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){yo(o,r,i,s,a,"next",e)}function a(e){yo(o,r,i,s,a,"throw",e)}s(void 0)}))}}const mo=new class extends oo{_handle(t,n){var r=this;return function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){fo(o,r,i,s,a,"next",e)}function a(e){fo(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*(){let i,o;try{const e=[n.fetch(t)];if(r._networkTimeoutSeconds){const t=l(1e3*r._networkTimeoutSeconds);e.push(t)}if(o=yield Promise.race(e),!o)throw new Error(`Timed out the network response after ${r._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(i=e)}if(!o)throw new e("no-response",{url:t.url,error:i});return o}))()}constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}},bo=new class extends oo{_handle(t,n){return function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){so(o,r,i,s,a,"next",e)}function a(e){so(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*(){const r=yield n.cacheMatch(t);if(!r)throw new e("no-response",{url:t.url});return r}))()}}({cacheName:_e}),wo=new class extends oo{_handle(t,n){var r=this;return ho((function*(){const i=[],o=[];let s;if(r._networkTimeoutSeconds){const{id:e,promise:a}=r._getTimeoutPromise({request:t,logs:i,handler:n});s=e,o.push(a)}const a=r._getNetworkPromise({timeoutId:s,request:t,logs:i,handler:n});o.push(a);const u=yield n.waitUntil(ho((function*(){return(yield n.waitUntil(Promise.race(o)))||(yield a)}))());if(!u)throw new e("no-response",{url:t.url});return u}))()}_getTimeoutPromise({request:e,logs:t,handler:n}){let r;const i=new Promise((t=>{const i=function(){var r=ho((function*(){t(yield n.cacheMatch(e))}));return function(){return r.apply(this,arguments)}}();r=setTimeout(i,1e3*this._networkTimeoutSeconds)}));return{promise:i,id:r}}_getNetworkPromise({timeoutId:e,request:t,logs:n,handler:r}){return ho((function*(){let n,i;try{i=yield r.fetchAndCachePut(t)}catch(e){e instanceof Error&&(n=e)}return e&&clearTimeout(e),!n&&i||(i=yield r.cacheMatch(t)),i}))()}constructor(e={}){super(e),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(uo),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}}({cacheName:_e}),_o="network-only-or-cache-only",ko={"network-first":e=>wo.handle(e),"network-only-or-cache-only":function(){var e=vo((function*(e){try{return yield mo.handle(e)}catch(t){return yield bo.handle(e)}}));return function(t){return e.apply(this,arguments)}}()};function xo(e){return So.apply(this,arguments)}function So(){return(So=vo((function*(e){try{return yield mo.handle(e)}catch(e){const t=yield caches.open(_e),n=yield t.match(xe);return null!=n?n:Response.error()}}))).apply(this,arguments)}function Oo(e){return Po.apply(this,arguments)}function Po(){return Po=vo((function*(e){const{request:t}=e,n="GET"===e.request.method?yield function(e){return Eo.apply(this,arguments)}(e):_o;var r;const i=null!==(r=ko[n])&&void 0!==r?r:ko[_o];try{return yield i(e)}catch(e){return console.warn("[SW] Could not handle the request to %s (using handler %s).",t.url,n,e),new Response(null!==(o=go(t.headers,ve))&&void 0!==o?o:void 0,{status:po(t.headers)})}var o})),Po.apply(this,arguments)}function Eo(){return Eo=vo((function*({request:e}){var t;return null!==(t=go(e.headers,be))&&void 0!==t?t:yield function(e){return Co.apply(this,arguments)}(e.url)})),Eo.apply(this,arguments)}function Co(){return(Co=vo((function*(e){const t=new Li,n=yield t.dynamicRouteRegistrations.toArray();var r;const i=ye(n.filter((t=>new RegExp(t.pattern).test(e))).map((e=>null!==(r=e.strategy)&&void 0!==r?r:"network-first")));return i.length<=1?i[0]:null!==(o=["network-first","network-only-or-cache-only"].find((e=>i.some((t=>t===e)))))&&void 0!==o?o:_o;var o}))).apply(this,arguments)}var jo;self.__WB_DISABLE_DEV_LOGS=!0,jo={prefix:we},(e=>{for(const t of Object.keys(r))e(t)})((e=>{"string"==typeof jo[e]&&(r[e]=jo[e])})),function(){!function(e,t,n){let r;r=e instanceof RegExp?new Qi(e,t,n):new Ji(e,t,n),Zi().registerRoute(r)}((({request:e})=>"navigate"===e.mode),xo);const e=Zi();for(const t of zi)e.setDefaultHandler(Oo,t)}(),self.addEventListener("message",(function(e){return Hi.apply(this,arguments)})),self.addEventListener("install",(e=>{self.skipWaiting(),e.waitUntil(Mi(Se))})),self.addEventListener("activate",(e=>{e.waitUntil(self.clients.claim())}))})()})();
|
|
1
|
+
(()=>{var e={590:function(e){e.exports=function(){"use strict";var e=6e4,t=36e5,n="millisecond",r="second",i="minute",o="hour",s="day",a="week",u="month",c="quarter",l="year",h="date",f="Invalid Date",d=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,g={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},y=function(e,t,n){var r=String(e);return!r||r.length>=t?e:""+Array(t+1-r.length).join(n)+e},v={s:y,z:function(e){var t=-e.utcOffset(),n=Math.abs(t),r=Math.floor(n/60),i=n%60;return(t<=0?"+":"-")+y(r,2,"0")+":"+y(i,2,"0")},m:function e(t,n){if(t.date()<n.date())return-e(n,t);var r=12*(n.year()-t.year())+(n.month()-t.month()),i=t.clone().add(r,u),o=n-i<0,s=t.clone().add(r+(o?-1:1),u);return+(-(r+(n-i)/(o?i-s:s-i))||0)},a:function(e){return e<0?Math.ceil(e)||0:Math.floor(e)},p:function(e){return{M:u,y:l,w:a,d:s,D:h,h:o,m:i,s:r,ms:n,Q:c}[e]||String(e||"").toLowerCase().replace(/s$/,"")},u:function(e){return void 0===e}},m="en",b={};b[m]=g;var w=function(e){return e instanceof S},_=function e(t,n,r){var i;if(!t)return m;if("string"==typeof t){var o=t.toLowerCase();b[o]&&(i=o),n&&(b[o]=n,i=o);var s=t.split("-");if(!i&&s.length>1)return e(s[0])}else{var a=t.name;b[a]=t,i=a}return!r&&i&&(m=i),i||!r&&m},k=function(e,t){if(w(e))return e.clone();var n="object"==typeof t?t:{};return n.date=e,n.args=arguments,new S(n)},x=v;x.l=_,x.i=w,x.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})};var S=function(){function g(e){this.$L=_(e.locale,null,!0),this.parse(e)}var y=g.prototype;return y.parse=function(e){this.$d=function(e){var t=e.date,n=e.utc;if(null===t)return new Date(NaN);if(x.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var r=t.match(d);if(r){var i=r[2]-1||0,o=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,o)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},y.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},y.$utils=function(){return x},y.isValid=function(){return!(this.$d.toString()===f)},y.isSame=function(e,t){var n=k(e);return this.startOf(t)<=n&&n<=this.endOf(t)},y.isAfter=function(e,t){return k(e)<this.startOf(t)},y.isBefore=function(e,t){return this.endOf(t)<k(e)},y.$g=function(e,t,n){return x.u(e)?this[t]:this.set(n,e)},y.unix=function(){return Math.floor(this.valueOf()/1e3)},y.valueOf=function(){return this.$d.getTime()},y.startOf=function(e,t){var n=this,c=!!x.u(t)||t,f=x.p(e),d=function(e,t){var r=x.w(n.$u?Date.UTC(n.$y,t,e):new Date(n.$y,t,e),n);return c?r:r.endOf(s)},p=function(e,t){return x.w(n.toDate()[e].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(t)),n)},g=this.$W,y=this.$M,v=this.$D,m="set"+(this.$u?"UTC":"");switch(f){case l:return c?d(1,0):d(31,11);case u:return c?d(1,y):d(0,y+1);case a:var b=this.$locale().weekStart||0,w=(g<b?g+7:g)-b;return d(c?v-w:v+(6-w),y);case s:case h:return p(m+"Hours",0);case o:return p(m+"Minutes",1);case i:return p(m+"Seconds",2);case r:return p(m+"Milliseconds",3);default:return this.clone()}},y.endOf=function(e){return this.startOf(e,!1)},y.$set=function(e,t){var a,c=x.p(e),f="set"+(this.$u?"UTC":""),d=(a={},a[s]=f+"Date",a[h]=f+"Date",a[u]=f+"Month",a[l]=f+"FullYear",a[o]=f+"Hours",a[i]=f+"Minutes",a[r]=f+"Seconds",a[n]=f+"Milliseconds",a)[c],p=c===s?this.$D+(t-this.$W):t;if(c===u||c===l){var g=this.clone().set(h,1);g.$d[d](p),g.init(),this.$d=g.set(h,Math.min(this.$D,g.daysInMonth())).$d}else d&&this.$d[d](p);return this.init(),this},y.set=function(e,t){return this.clone().$set(e,t)},y.get=function(e){return this[x.p(e)]()},y.add=function(n,c){var h,f=this;n=Number(n);var d=x.p(c),p=function(e){var t=k(f);return x.w(t.date(t.date()+Math.round(e*n)),f)};if(d===u)return this.set(u,this.$M+n);if(d===l)return this.set(l,this.$y+n);if(d===s)return p(1);if(d===a)return p(7);var g=(h={},h[i]=e,h[o]=t,h[r]=1e3,h)[d]||1,y=this.$d.getTime()+n*g;return x.w(y,this)},y.subtract=function(e,t){return this.add(-1*e,t)},y.format=function(e){var t=this,n=this.$locale();if(!this.isValid())return n.invalidDate||f;var r=e||"YYYY-MM-DDTHH:mm:ssZ",i=x.z(this),o=this.$H,s=this.$m,a=this.$M,u=n.weekdays,c=n.months,l=function(e,n,i,o){return e&&(e[n]||e(t,r))||i[n].slice(0,o)},h=function(e){return x.s(o%12||12,e,"0")},d=n.meridiem||function(e,t,n){var r=e<12?"AM":"PM";return n?r.toLowerCase():r},g={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:x.s(a+1,2,"0"),MMM:l(n.monthsShort,a,c,3),MMMM:l(c,a),D:this.$D,DD:x.s(this.$D,2,"0"),d:String(this.$W),dd:l(n.weekdaysMin,this.$W,u,2),ddd:l(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(o),HH:x.s(o,2,"0"),h:h(1),hh:h(2),a:d(o,s,!0),A:d(o,s,!1),m:String(s),mm:x.s(s,2,"0"),s:String(this.$s),ss:x.s(this.$s,2,"0"),SSS:x.s(this.$ms,3,"0"),Z:i};return r.replace(p,(function(e,t){return t||g[e]||i.replace(":","")}))},y.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},y.diff=function(n,h,f){var d,p=x.p(h),g=k(n),y=(g.utcOffset()-this.utcOffset())*e,v=this-g,m=x.m(this,g);return m=(d={},d[l]=m/12,d[u]=m,d[c]=m/3,d[a]=(v-y)/6048e5,d[s]=(v-y)/864e5,d[o]=v/t,d[i]=v/e,d[r]=v/1e3,d)[p]||v,f?m:x.a(m)},y.daysInMonth=function(){return this.endOf(u).$D},y.$locale=function(){return b[this.$L]},y.locale=function(e,t){if(!e)return this.$L;var n=this.clone(),r=_(e,t,!0);return r&&(n.$L=r),n},y.clone=function(){return x.w(this.$d,this)},y.toDate=function(){return new Date(this.valueOf())},y.toJSON=function(){return this.isValid()?this.toISOString():null},y.toISOString=function(){return this.$d.toISOString()},y.toString=function(){return this.$d.toUTCString()},g}(),O=S.prototype;return k.prototype=O,[["$ms",n],["$s",r],["$m",i],["$H",o],["$W",s],["$M",u],["$y",l],["$D",h]].forEach((function(e){O[e[1]]=function(t){return this.$g(t,e[0],e[1])}})),k.extend=function(e,t){return e.$i||(e(t,S,k),e.$i=!0),k},k.locale=_,k.isDayjs=w,k.unix=function(e){return k(1e3*e)},k.en=b[m],k.Ls=b,k.p={},k}()},693:(e,t,n)=>{"use strict";function r(e){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r(e)}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?Object(arguments[t]):{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&r.push.apply(r,Object.getOwnPropertySymbols(n).filter((function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach((function(t){i(e,t,n[t])}))}return e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&a(e.prototype,t),n&&a(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if(t&&("object"===r(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function h(e){return h=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},h(e)}function f(e,t){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},f(e,t)}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&f(e,t)}n.r(t),n.d(t,{default:()=>B});var p={type:"logger",log:function(e){this.output("log",e)},warn:function(e){this.output("warn",e)},error:function(e){this.output("error",e)},output:function(e,t){console&&console[e]&&console[e].apply(console,t)}},g=new(function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.init(t,n)}return u(e,[{key:"init",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||p,this.options=t,this.debug=t.debug}},{key:"setDebug",value:function(e){this.debug=e}},{key:"log",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"log","",!0)}},{key:"warn",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","",!0)}},{key:"error",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"error","")}},{key:"deprecate",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}},{key:"forward",value:function(e,t,n,r){return r&&!this.debug?null:("string"==typeof e[0]&&(e[0]="".concat(n).concat(this.prefix," ").concat(e[0])),this.logger[t](e))}},{key:"create",value:function(t){return new e(this.logger,o({},{prefix:"".concat(this.prefix,":").concat(t,":")},this.options))}}]),e}()),y=function(){function e(){s(this,e),this.observers={}}return u(e,[{key:"on",value:function(e,t){var n=this;return e.split(" ").forEach((function(e){n.observers[e]=n.observers[e]||[],n.observers[e].push(t)})),this}},{key:"off",value:function(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((function(e){return e!==t})):delete this.observers[e])}},{key:"emit",value:function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];this.observers[e]&&[].concat(this.observers[e]).forEach((function(e){e.apply(void 0,n)})),this.observers["*"]&&[].concat(this.observers["*"]).forEach((function(t){t.apply(t,[e].concat(n))}))}}]),e}();function v(){var e,t,n=new Promise((function(n,r){e=n,t=r}));return n.resolve=e,n.reject=t,n}function m(e){return null==e?"":""+e}function b(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function i(){return!e||"string"==typeof e}for(var o="string"!=typeof t?[].concat(t):t.split(".");o.length>1;){if(i())return{};var s=r(o.shift());!e[s]&&n&&(e[s]=new n),e=Object.prototype.hasOwnProperty.call(e,s)?e[s]:{}}return i()?{}:{obj:e,k:r(o.shift())}}function w(e,t,n){var r=b(e,t,Object);r.obj[r.k]=n}function _(e,t){var n=b(e,t),r=n.obj,i=n.k;if(r)return r[i]}function k(e,t,n){var r=_(e,n);return void 0!==r?r:_(t,n)}function x(e,t,n){for(var r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):x(e[r],t[r],n):e[r]=t[r]);return e}function S(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var O={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function P(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(function(e){return O[e]})):e}var E="undefined"!=typeof window&&window.navigator&&window.navigator.userAgent&&window.navigator.userAgent.indexOf("MSIE")>-1,C=function(e){function t(e){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};return s(this,t),n=l(this,h(t).call(this)),E&&y.call(c(n)),n.data=e||{},n.options=r,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n}return d(t,e),u(t,[{key:"addNamespaces",value:function(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}},{key:"removeNamespaces",value:function(e){var t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,o=[e,t];return n&&"string"!=typeof n&&(o=o.concat(n)),n&&"string"==typeof n&&(o=o.concat(i?n.split(i):n)),e.indexOf(".")>-1&&(o=e.split(".")),_(this.data,o)}},{key:"addResource",value:function(e,t,n,r){var i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1},o=this.options.keySeparator;void 0===o&&(o=".");var s=[e,t];n&&(s=s.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(r=t,t=(s=e.split("."))[1]),this.addNamespaces(t),w(this.data,s,r),i.silent||this.emit("added",e,t,n,r)}},{key:"addResources",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(var i in n)"string"!=typeof n[i]&&"[object Array]"!==Object.prototype.toString.apply(n[i])||this.addResource(e,t,i,n[i],{silent:!0});r.silent||this.emit("added",e,t,n)}},{key:"addResourceBundle",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},a=[e,t];e.indexOf(".")>-1&&(r=n,n=t,t=(a=e.split("."))[1]),this.addNamespaces(t);var u=_(this.data,a)||{};r?x(u,n,i):u=o({},u,n),w(this.data,a,u),s.silent||this.emit("added",e,t,n)}},{key:"removeResourceBundle",value:function(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}},{key:"hasResourceBundle",value:function(e,t){return void 0!==this.getResource(e,t)}},{key:"getResourceBundle",value:function(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?o({},{},this.getResource(e,t)):this.getResource(e,t)}},{key:"getDataByLanguage",value:function(e){return this.data[e]}},{key:"toJSON",value:function(){return this.data}}]),t}(y),j={processors:{},addPostProcessor:function(e){this.processors[e.name]=e},handle:function(e,t,n,r,i){var o=this;return e.forEach((function(e){o.processors[e]&&(t=o.processors[e].process(t,n,r,i))})),t}},R={},D=function(e){function t(e){var n,r,i,o,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return s(this,t),n=l(this,h(t).call(this)),E&&y.call(c(n)),r=["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],i=e,o=c(n),r.forEach((function(e){i[e]&&(o[e]=i[e])})),n.options=a,void 0===n.options.keySeparator&&(n.options.keySeparator="."),n.logger=g.create("translator"),n}return d(t,e),u(t,[{key:"changeLanguage",value:function(e){e&&(this.language=e)}},{key:"exists",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}},n=this.resolve(e,t);return n&&void 0!==n.res}},{key:"extractFromKey",value:function(e,t){var n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");var r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,i=t.ns||this.options.defaultNS;if(n&&e.indexOf(n)>-1){var o=e.match(this.interpolator.nestingRegexp);if(o&&o.length>0)return{key:e,namespaces:i};var s=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(s[0])>-1)&&(i=s.shift()),e=s.join(r)}return"string"==typeof i&&(i=[i]),{key:e,namespaces:i}}},{key:"translate",value:function(e,n,i){var s=this;if("object"!==r(n)&&this.options.overloadTranslationOptionHandler&&(n=this.options.overloadTranslationOptionHandler(arguments)),n||(n={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);var a=void 0!==n.keySeparator?n.keySeparator:this.options.keySeparator,u=this.extractFromKey(e[e.length-1],n),c=u.key,l=u.namespaces,h=l[l.length-1],f=n.lng||this.language,d=n.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(f&&"cimode"===f.toLowerCase()){if(d){var p=n.nsSeparator||this.options.nsSeparator;return h+p+c}return c}var g=this.resolve(e,n),y=g&&g.res,v=g&&g.usedKey||c,m=g&&g.exactUsedKey||c,b=Object.prototype.toString.apply(y),w=void 0!==n.joinArrays?n.joinArrays:this.options.joinArrays,_=!this.i18nFormat||this.i18nFormat.handleAsObject;if(_&&y&&"string"!=typeof y&&"boolean"!=typeof y&&"number"!=typeof y&&["[object Number]","[object Function]","[object RegExp]"].indexOf(b)<0&&("string"!=typeof w||"[object Array]"!==b)){if(!n.returnObjects&&!this.options.returnObjects)return this.logger.warn("accessing an object - but returnObjects options is not enabled!"),this.options.returnedObjectHandler?this.options.returnedObjectHandler(v,y,n):"key '".concat(c," (").concat(this.language,")' returned an object instead of string.");if(a){var k="[object Array]"===b,x=k?[]:{},S=k?m:v;for(var O in y)if(Object.prototype.hasOwnProperty.call(y,O)){var P="".concat(S).concat(a).concat(O);x[O]=this.translate(P,o({},n,{joinArrays:!1,ns:l})),x[O]===P&&(x[O]=y[O])}y=x}}else if(_&&"string"==typeof w&&"[object Array]"===b)(y=y.join(w))&&(y=this.extendTranslation(y,e,n,i));else{var E=!1,C=!1,j=void 0!==n.count&&"string"!=typeof n.count,R=t.hasDefaultValue(n),D=j?this.pluralResolver.getSuffix(f,n.count):"",A=n["defaultValue".concat(D)]||n.defaultValue;!this.isValidLookup(y)&&R&&(E=!0,y=A),this.isValidLookup(y)||(C=!0,y=c);var L=R&&A!==y&&this.options.updateMissing;if(C||E||L){if(this.logger.log(L?"updateKey":"missingKey",f,h,c,L?A:y),a){var K=this.resolve(c,o({},n,{keySeparator:!1}));K&&K.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}var T=[],N=this.languageUtils.getFallbackCodes(this.options.fallbackLng,n.lng||this.language);if("fallback"===this.options.saveMissingTo&&N&&N[0])for(var M=0;M<N.length;M++)T.push(N[M]);else"all"===this.options.saveMissingTo?T=this.languageUtils.toResolveHierarchy(n.lng||this.language):T.push(n.lng||this.language);var $=function(e,t,r){s.options.missingKeyHandler?s.options.missingKeyHandler(e,h,t,L?r:y,L,n):s.backendConnector&&s.backendConnector.saveMissing&&s.backendConnector.saveMissing(e,h,t,L?r:y,L,n),s.emit("missingKey",e,h,t,y)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?T.forEach((function(e){s.pluralResolver.getSuffixes(e).forEach((function(t){$([e],c+t,n["defaultValue".concat(t)]||A)}))})):$(T,c,A))}y=this.extendTranslation(y,e,n,g,i),C&&y===c&&this.options.appendNamespaceToMissingKey&&(y="".concat(h,":").concat(c)),C&&this.options.parseMissingKeyHandler&&(y=this.options.parseMissingKeyHandler(y))}return y}},{key:"extendTranslation",value:function(e,t,n,r,i){var s=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,n,r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init(o({},n,{interpolation:o({},this.options.interpolation,n.interpolation)}));var a,u=n.interpolation&&n.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;if(u){var c=e.match(this.interpolator.nestingRegexp);a=c&&c.length}var l=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l=o({},this.options.interpolation.defaultVariables,l)),e=this.interpolator.interpolate(e,l,n.lng||this.language,n),u){var h=e.match(this.interpolator.nestingRegexp);a<(h&&h.length)&&(n.nest=!1)}!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),o=0;o<e;o++)r[o]=arguments[o];return i&&i[0]===r[0]&&!n.context?(s.logger.warn("It seems you are nesting recursively key: ".concat(r[0]," in key: ").concat(t[0])),null):s.translate.apply(s,r.concat([t]))}),n)),n.interpolation&&this.interpolator.reset()}var f=n.postProcess||this.options.postProcess,d="string"==typeof f?[f]:f;return null!=e&&d&&d.length&&!1!==n.applyPostProcessor&&(e=j.handle(d,e,t,this.options&&this.options.postProcessPassResolved?o({i18nResolved:r},n):n,this)),e}},{key:"resolve",value:function(e){var t,n,r,i,o,s=this,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((function(e){if(!s.isValidLookup(t)){var u=s.extractFromKey(e,a),c=u.key;n=c;var l=u.namespaces;s.options.fallbackNS&&(l=l.concat(s.options.fallbackNS));var h=void 0!==a.count&&"string"!=typeof a.count,f=void 0!==a.context&&"string"==typeof a.context&&""!==a.context,d=a.lngs?a.lngs:s.languageUtils.toResolveHierarchy(a.lng||s.language,a.fallbackLng);l.forEach((function(e){s.isValidLookup(t)||(o=e,!R["".concat(d[0],"-").concat(e)]&&s.utils&&s.utils.hasLoadedNamespace&&!s.utils.hasLoadedNamespace(o)&&(R["".concat(d[0],"-").concat(e)]=!0,s.logger.warn('key "'.concat(n,'" for languages "').concat(d.join(", "),'" won\'t get resolved as namespace "').concat(o,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),d.forEach((function(n){if(!s.isValidLookup(t)){i=n;var o,u,l=c,d=[l];for(s.i18nFormat&&s.i18nFormat.addLookupKeys?s.i18nFormat.addLookupKeys(d,c,n,e,a):(h&&(o=s.pluralResolver.getSuffix(n,a.count)),h&&f&&d.push(l+o),f&&d.push(l+="".concat(s.options.contextSeparator).concat(a.context)),h&&d.push(l+=o));u=d.pop();)s.isValidLookup(t)||(r=u,t=s.getResource(n,e,u,a))}})))}))}})),{res:t,usedKey:n,exactUsedKey:r,usedLng:i,usedNS:o}}},{key:"isValidLookup",value:function(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}},{key:"getResource",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}}],[{key:"hasDefaultValue",value:function(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t)&&"defaultValue"===t.substring(0,12)&&void 0!==e[t])return!0;return!1}}]),t}(y);function A(e){return e.charAt(0).toUpperCase()+e.slice(1)}var L=function(){function e(t){s(this,e),this.options=t,this.whitelist=this.options.supportedLngs||!1,this.supportedLngs=this.options.supportedLngs||!1,this.logger=g.create("languageUtils")}return u(e,[{key:"getScriptPartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return null;var t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}},{key:"getLanguagePartFromCode",value:function(e){if(!e||e.indexOf("-")<0)return e;var t=e.split("-");return this.formatLanguageCode(t[0])}},{key:"formatLanguageCode",value:function(e){if("string"==typeof e&&e.indexOf("-")>-1){var t=["hans","hant","latn","cyrl","cans","mong","arab"],n=e.split("-");return this.options.lowerCaseLng?n=n.map((function(e){return e.toLowerCase()})):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=A(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=A(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=A(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}},{key:"isWhitelisted",value:function(e){return this.logger.deprecate("languageUtils.isWhitelisted",'function "isWhitelisted" will be renamed to "isSupportedCode" in the next major - please make sure to rename it\'s usage asap.'),this.isSupportedCode(e)}},{key:"isSupportedCode",value:function(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}},{key:"getBestMatchFromCodes",value:function(e){var t,n=this;return e?(e.forEach((function(e){if(!t){var r=n.formatLanguageCode(e);n.options.supportedLngs&&!n.isSupportedCode(r)||(t=r)}})),!t&&this.options.supportedLngs&&e.forEach((function(e){if(!t){var r=n.getLanguagePartFromCode(e);if(n.isSupportedCode(r))return t=r;t=n.options.supportedLngs.find((function(e){if(0===e.indexOf(r))return e}))}})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t):null}},{key:"getFallbackCodes",value:function(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];var n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}},{key:"toResolveHierarchy",value:function(e,t){var n=this,r=this.getFallbackCodes(t||this.options.fallbackLng||[],e),i=[],o=function(e){e&&(n.isSupportedCode(e)?i.push(e):n.logger.warn("rejecting language code not found in supportedLngs: ".concat(e)))};return"string"==typeof e&&e.indexOf("-")>-1?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),r.forEach((function(e){i.indexOf(e)<0&&o(n.formatLanguageCode(e))})),i}}]),e}(),K=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","kk","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],T={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}},N=function(){function e(t){var n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};s(this,e),this.languageUtils=t,this.options=r,this.logger=g.create("pluralResolver"),this.rules=(n={},K.forEach((function(e){e.lngs.forEach((function(t){n[t]={numbers:e.nr,plurals:T[e.fc]}}))})),n)}return u(e,[{key:"addRule",value:function(e,t){this.rules[e]=t}},{key:"getRule",value:function(e){return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}},{key:"needsPlural",value:function(e){var t=this.getRule(e);return t&&t.numbers.length>1}},{key:"getPluralFormsOfKey",value:function(e,t){return this.getSuffixes(e).map((function(e){return t+e}))}},{key:"getSuffixes",value:function(e){var t=this,n=this.getRule(e);return n?n.numbers.map((function(n){return t.getSuffix(e,n)})):[]}},{key:"getSuffix",value:function(e,t){var n=this,r=this.getRule(e);if(r){var i=r.noAbs?r.plurals(t):r.plurals(Math.abs(t)),o=r.numbers[i];this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]&&(2===o?o="plural":1===o&&(o=""));var s=function(){return n.options.prepend&&o.toString()?n.options.prepend+o.toString():o.toString()};return"v1"===this.options.compatibilityJSON?1===o?"":"number"==typeof o?"_plural_".concat(o.toString()):s():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===r.numbers.length&&1===r.numbers[0]?s():this.options.prepend&&i.toString()?this.options.prepend+i.toString():i.toString()}return this.logger.warn("no plural rule found for: ".concat(e)),""}}]),e}(),M=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};s(this,e),this.logger=g.create("interpolator"),this.options=t,this.format=t.interpolation&&t.interpolation.format||function(e){return e},this.init(t)}return u(e,[{key:"init",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});var t=e.interpolation;this.escape=void 0!==t.escape?t.escape:P,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?S(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?S(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?S(t.nestingPrefix):t.nestingPrefixEscaped||S("$t("),this.nestingSuffix=t.nestingSuffix?S(t.nestingSuffix):t.nestingSuffixEscaped||S(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}},{key:"reset",value:function(){this.options&&this.init(this.options)}},{key:"resetRegExp",value:function(){var e="".concat(this.prefix,"(.+?)").concat(this.suffix);this.regexp=new RegExp(e,"g");var t="".concat(this.prefix).concat(this.unescapePrefix,"(.+?)").concat(this.unescapeSuffix).concat(this.suffix);this.regexpUnescape=new RegExp(t,"g");var n="".concat(this.nestingPrefix,"(.+?)").concat(this.nestingSuffix);this.nestingRegexp=new RegExp(n,"g")}},{key:"interpolate",value:function(e,t,n,r){var i,o,s,a=this,u=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function c(e){return e.replace(/\$/g,"$$$$")}var l=function(e){if(e.indexOf(a.formatSeparator)<0){var i=k(t,u,e);return a.alwaysFormat?a.format(i,void 0,n):i}var o=e.split(a.formatSeparator),s=o.shift().trim(),c=o.join(a.formatSeparator).trim();return a.format(k(t,u,s),c,n,r)};this.resetRegExp();var h=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,f=r&&r.interpolation&&r.interpolation.skipOnVariables||this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:function(e){return c(e)}},{regex:this.regexp,safeValue:function(e){return a.escapeValue?c(a.escape(e)):c(e)}}].forEach((function(t){for(s=0;i=t.regex.exec(e);){if(void 0===(o=l(i[1].trim())))if("function"==typeof h){var n=h(e,i,r);o="string"==typeof n?n:""}else{if(f){o=i[0];continue}a.logger.warn("missed to pass in variable ".concat(i[1]," for interpolating ").concat(e)),o=""}else"string"==typeof o||a.useRawValueToEscape||(o=m(o));if(e=e.replace(i[0],t.safeValue(o)),t.regex.lastIndex=0,++s>=a.maxReplaces)break}})),e}},{key:"nest",value:function(e,t){var n,r,i=this,s=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},a=o({},s);function u(e,t){var n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;var r=e.split(new RegExp("".concat(n,"[ ]*{"))),i="{".concat(r[1]);e=r[0],i=(i=this.interpolate(i,a)).replace(/'/g,'"');try{a=JSON.parse(i),t&&(a=o({},t,a))}catch(t){return this.logger.warn("failed parsing options string in nesting for key ".concat(e),t),"".concat(e).concat(n).concat(i)}return delete a.defaultValue,e}for(a.applyPostProcessor=!1,delete a.defaultValue;n=this.nestingRegexp.exec(e);){var c=[],l=!1;if(n[0].includes(this.formatSeparator)&&!/{.*}/.test(n[1])){var h=n[1].split(this.formatSeparator).map((function(e){return e.trim()}));n[1]=h.shift(),c=h,l=!0}if((r=t(u.call(this,n[1].trim(),a),a))&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=m(r)),r||(this.logger.warn("missed to resolve ".concat(n[1]," for nesting ").concat(e)),r=""),l&&(r=c.reduce((function(e,t){return i.format(e,t,s.lng,s)}),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}]),e}(),$=function(e){function t(e,n,r){var i,o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return s(this,t),i=l(this,h(t).call(this)),E&&y.call(c(i)),i.backend=e,i.store=n,i.services=r,i.languageUtils=r.languageUtils,i.options=o,i.logger=g.create("backendConnector"),i.state={},i.queue=[],i.backend&&i.backend.init&&i.backend.init(r,o.backend,o),i}return d(t,e),u(t,[{key:"queueLoad",value:function(e,t,n,r){var i=this,o=[],s=[],a=[],u=[];return e.forEach((function(e){var r=!0;t.forEach((function(t){var a="".concat(e,"|").concat(t);!n.reload&&i.store.hasResourceBundle(e,t)?i.state[a]=2:i.state[a]<0||(1===i.state[a]?s.indexOf(a)<0&&s.push(a):(i.state[a]=1,r=!1,s.indexOf(a)<0&&s.push(a),o.indexOf(a)<0&&o.push(a),u.indexOf(t)<0&&u.push(t)))})),r||a.push(e)})),(o.length||s.length)&&this.queue.push({pending:s,loaded:{},errors:[],callback:r}),{toLoad:o,pending:s,toLoadLanguages:a,toLoadNamespaces:u}}},{key:"loaded",value:function(e,t,n){var r=e.split("|"),i=r[0],o=r[1];t&&this.emit("failedLoading",i,o,t),n&&this.store.addResourceBundle(i,o,n),this.state[e]=t?-1:2;var s={};this.queue.forEach((function(n){var r,a,u,c,l;r=n.loaded,a=o,(c=(u=b(r,[i],Object)).obj)[l=u.k]=c[l]||[],c[l].push(a),function(e,t){for(var n=e.indexOf(t);-1!==n;)e.splice(n,1),n=e.indexOf(t)}(n.pending,e),t&&n.errors.push(t),0!==n.pending.length||n.done||(Object.keys(n.loaded).forEach((function(e){s[e]||(s[e]=[]),n.loaded[e].length&&n.loaded[e].forEach((function(t){s[e].indexOf(t)<0&&s[e].push(t)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",s),this.queue=this.queue.filter((function(e){return!e.done}))}},{key:"read",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:350,s=arguments.length>5?arguments[5]:void 0;return e.length?this.backend[n](e,t,(function(a,u){a&&u&&i<5?setTimeout((function(){r.read.call(r,e,t,n,i+1,2*o,s)}),o):s(a,u)})):s(null,{})}},{key:"prepareLoading",value:function(e,t){var n=this,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);var o=this.queueLoad(e,t,r,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach((function(e){n.loadOne(e)}))}},{key:"load",value:function(e,t,n){this.prepareLoading(e,t,{},n)}},{key:"reload",value:function(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}},{key:"loadOne",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=e.split("|"),i=r[0],o=r[1];this.read(i,o,"read",void 0,void 0,(function(r,s){r&&t.logger.warn("".concat(n,"loading namespace ").concat(o," for language ").concat(i," failed"),r),!r&&s&&t.logger.log("".concat(n,"loaded namespace ").concat(o," for language ").concat(i),s),t.loaded(e,r,s)}))}},{key:"saveMissing",value:function(e,t,n,r,i){var s=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{};this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t)?this.logger.warn('did not save key "'.concat(n,'" as the namespace "').concat(t,'" was not yet loaded'),"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!"):null!=n&&""!==n&&(this.backend&&this.backend.create&&this.backend.create(e,t,n,r,null,o({},s,{isUpdate:i})),e&&e[0]&&this.store.addResource(e[0],t,n,r))}}]),t}(y);function I(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.whitelist&&(e.whitelist&&e.whitelist.indexOf("cimode")<0&&(e.whitelist=e.whitelist.concat(["cimode"])),e.supportedLngs=e.whitelist),e.nonExplicitWhitelist&&(e.nonExplicitSupportedLngs=e.nonExplicitWhitelist),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function F(){}const B=new(function(e){function t(){var e,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1?arguments[1]:void 0;if(s(this,t),e=l(this,h(t).call(this)),E&&y.call(c(e)),e.options=I(n),e.services={},e.logger=g,e.modules={external:[]},r&&!e.isInitialized&&!n.isClone){if(!e.options.initImmediate)return e.init(n,r),l(e,c(e));setTimeout((function(){e.init(n,r)}),0)}return e}return d(t,e),u(t,[{key:"init",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;function i(e){return e?"function"==typeof e?new e:e:null}if("function"==typeof t&&(n=t,t={}),t.whitelist&&!t.supportedLngs&&this.logger.deprecate("whitelist",'option "whitelist" will be renamed to "supportedLngs" in the next major - please make sure to rename this option asap.'),t.nonExplicitWhitelist&&!t.nonExplicitSupportedLngs&&this.logger.deprecate("whitelist",'options "nonExplicitWhitelist" will be renamed to "nonExplicitSupportedLngs" in the next major - please make sure to rename this option asap.'),this.options=o({},{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,whitelist:!1,nonExplicitWhitelist:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!0,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){var t={};if("object"===r(e[1])&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"===r(e[2])||"object"===r(e[3])){var n=e[3]||e[2];Object.keys(n).forEach((function(e){t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:function(e,t,n,r){return e},prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!1}},this.options,I(t)),this.format=this.options.interpolation.format,n||(n=F),!this.options.isClone){this.modules.logger?g.init(i(this.modules.logger),this.options):g.init(null,this.options);var s=new L(this.options);this.store=new C(this.options.resources,this.options);var a=this.services;a.logger=g,a.resourceStore=this.store,a.languageUtils=s,a.pluralResolver=new N(s,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),a.interpolator=new M(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new $(i(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.languageDetector&&(a.languageDetector=i(this.modules.languageDetector),a.languageDetector.init(a,this.options.detection,this.options)),this.modules.i18nFormat&&(a.i18nFormat=i(this.modules.i18nFormat),a.i18nFormat.init&&a.i18nFormat.init(this)),this.translator=new D(this.services,this.options),this.translator.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];e.emit.apply(e,[t].concat(r))})),this.modules.external.forEach((function(t){t.init&&t.init(e)}))}if(this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){var u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&"dev"!==u[0]&&(this.options.lng=u[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments)}})),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((function(t){e[t]=function(){var n;return(n=e.store)[t].apply(n,arguments),e}}));var c=v(),l=function(){var t=function(t,r){e.isInitialized&&e.logger.warn("init: i18next is already initialized. You should call init just once!"),e.isInitialized=!0,e.options.isClone||e.logger.log("initialized",e.options),e.emit("initialized",e.options),c.resolve(r),n(t,r)};if(e.languages&&"v1"!==e.options.compatibilityAPI&&!e.isInitialized)return t(null,e.t.bind(e));e.changeLanguage(e.options.lng,t)};return this.options.resources||!this.options.initImmediate?l():setTimeout(l,0),c}},{key:"loadResources",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F,r="string"==typeof e?e:this.language;if("function"==typeof e&&(n=e),!this.options.resources||this.options.partialBundledLanguages){if(r&&"cimode"===r.toLowerCase())return n();var i=[],o=function(e){e&&t.services.languageUtils.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};r?o(r):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((function(e){return o(e)})),this.options.preload&&this.options.preload.forEach((function(e){return o(e)})),this.services.backendConnector.load(i,this.options.ns,n)}else n(null)}},{key:"reloadResources",value:function(e,t,n){var r=v();return e||(e=this.languages),t||(t=this.options.ns),n||(n=F),this.services.backendConnector.reload(e,t,(function(e){r.resolve(),n(e)})),r}},{key:"use",value:function(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&j.addPostProcessor(e),"3rdParty"===e.type&&this.modules.external.push(e),this}},{key:"changeLanguage",value:function(e,t){var n=this;this.isLanguageChangingTo=e;var r=v();this.emit("languageChanging",e);var i=function(e){var i="string"==typeof e?e:n.services.languageUtils.getBestMatchFromCodes(e);i&&(n.language||(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i)),n.translator.language||n.translator.changeLanguage(i),n.services.languageDetector&&n.services.languageDetector.cacheUserLanguage(i)),n.loadResources(i,(function(e){!function(e,i){i?(n.language=i,n.languages=n.services.languageUtils.toResolveHierarchy(i),n.translator.changeLanguage(i),n.isLanguageChangingTo=void 0,n.emit("languageChanged",i),n.logger.log("languageChanged",i)):n.isLanguageChangingTo=void 0,r.resolve((function(){return n.t.apply(n,arguments)})),t&&t(e,(function(){return n.t.apply(n,arguments)}))}(e,i)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}},{key:"getFixedT",value:function(e,t){var n=this,i=function e(t,i){var s;if("object"!==r(i)){for(var a=arguments.length,u=new Array(a>2?a-2:0),c=2;c<a;c++)u[c-2]=arguments[c];s=n.options.overloadTranslationOptionHandler([t,i].concat(u))}else s=o({},i);return s.lng=s.lng||e.lng,s.lngs=s.lngs||e.lngs,s.ns=s.ns||e.ns,n.t(t,s)};return"string"==typeof e?i.lng=e:i.lngs=e,i.ns=t,i}},{key:"t",value:function(){var e;return this.translator&&(e=this.translator).translate.apply(e,arguments)}},{key:"exists",value:function(){var e;return this.translator&&(e=this.translator).exists.apply(e,arguments)}},{key:"setDefaultNamespace",value:function(e){this.options.defaultNS=e}},{key:"hasLoadedNamespace",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;var r=this.languages[0],i=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===r.toLowerCase())return!0;var s=function(e,n){var r=t.services.backendConnector.state["".concat(e,"|").concat(n)];return-1===r||2===r};if(n.precheck){var a=n.precheck(this,s);if(void 0!==a)return a}return!!this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||!(!s(r,e)||i&&!s(o,e))}},{key:"loadNamespaces",value:function(e,t){var n=this,r=v();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((function(e){n.options.ns.indexOf(e)<0&&n.options.ns.push(e)})),this.loadResources((function(e){r.resolve(),t&&t(e)})),r):(t&&t(),Promise.resolve())}},{key:"loadLanguages",value:function(e,t){var n=v();"string"==typeof e&&(e=[e]);var r=this.options.preload||[],i=e.filter((function(e){return r.indexOf(e)<0}));return i.length?(this.options.preload=r.concat(i),this.loadResources((function(e){n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}},{key:"dir",value:function(e){return e||(e=this.languages&&this.languages.length>0?this.languages[0]:this.language),e?["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam"].indexOf(this.services.languageUtils.getLanguagePartFromCode(e))>=0?"rtl":"ltr":"rtl"}},{key:"createInstance",value:function(){return new t(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}},{key:"cloneInstance",value:function(){var e=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:F,i=o({},this.options,n,{isClone:!0}),s=new t(i);return["store","services","language"].forEach((function(t){s[t]=e[t]})),s.services=o({},this.services),s.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s.translator=new D(s.services,s.options),s.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];s.emit.apply(s,[e].concat(n))})),s.init(i,r),s.translator.options=s.options,s.translator.backendConnector.services.utils={hasLoadedNamespace:s.hasLoadedNamespace.bind(s)},s}}]),t}(y))},161:()=>{"use strict";try{self["workbox:core:6.5.3"]&&_()}catch(e){}},664:()=>{"use strict";try{self["workbox:routing:6.5.3"]&&_()}catch(e){}},818:()=>{"use strict";try{self["workbox:strategies:6.5.3"]&&_()}catch(e){}}},t={};function n(r){var i=t[r];if(void 0!==i)return i.exports;var o=t[r]={exports:{}};return e[r].call(o.exports,o,o.exports,n),o.exports}n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},(()=>{n.S={};var e={},t={};n.I=(r,i)=>{i||(i=[]);var o=t[r];if(o||(o=t[r]={}),!(i.indexOf(o)>=0)){if(i.push(o),e[r])return e[r];n.o(n.S,r)||(n.S[r]={});var s=n.S[r],a="@openmrs/esm-app-shell",u=(e,t,n,r)=>{var i=s[e]=s[e]||{},o=i[t];(!o||!o.loaded&&(!r!=!o.eager?r:a>o.from))&&(i[t]={get:n,from:a,eager:!!r})},c=[];return"default"===r&&(u("dayjs","1.11.5",(()=>()=>n(590)),1),u("i18next","19.9.2",(()=>()=>n(693)),1)),e[r]=c.length?Promise.all(c).then((()=>e[r]=1)):1}}})(),(()=>{"use strict";n(161);let e=class extends Error{constructor(e,t){super(((e,...t)=>{let n=e;return t.length>0&&(n+=` :: ${JSON.stringify(t)}`),n})(e,t)),this.name=e,this.details=t}};const t=new Set,r={googleAnalytics:"googleAnalytics",precache:"precache-v2",prefix:"workbox",runtime:"runtime",suffix:"undefined"!=typeof registration?registration.scope:""},i=e=>{return e||(t=r.runtime,[r.prefix,t,r.suffix].filter((e=>e&&e.length>0)).join("-"));var t};function o(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function s(e,t){const n=new URL(e);for(const e of t)n.searchParams.delete(e);return n.href}function a(){return a=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var s=e.apply(t,n);function a(e){o(s,r,i,a,u,"next",e)}function u(e){o(s,r,i,a,u,"throw",e)}a(void 0)}))}}((function*(e,t,n,r){const i=s(t.url,n);if(t.url===i)return e.match(t,r);const o=Object.assign(Object.assign({},r),{ignoreSearch:!0}),a=yield e.keys(t,o);for(const t of a)if(i===s(t.url,n))return e.match(t,r)})),a.apply(this,arguments)}function u(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function c(){return c=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){u(o,r,i,s,a,"next",e)}function a(e){u(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*(){for(const e of t)yield e()})),c.apply(this,arguments)}function l(e){return new Promise((t=>setTimeout(t,e)))}const h="object"==typeof global&&global&&global.Object===Object&&global;var f="object"==typeof self&&self&&self.Object===Object&&self;const d=h||f||Function("return this")(),p=d.Symbol,g=Array.isArray;var y=Object.prototype,v=y.hasOwnProperty,m=y.toString,b=p?p.toStringTag:void 0;var w=Object.prototype.toString;var _=p?p.toStringTag:void 0;const k=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":_&&_ in Object(e)?function(e){var t=v.call(e,b),n=e[b];try{e[b]=void 0;var r=!0}catch(e){}var i=m.call(e);return r&&(t?e[b]=n:delete e[b]),i}(e):function(e){return w.call(e)}(e)},x=function(e){return null!=e&&"object"==typeof e};var S=p?p.prototype:void 0,O=S?S.toString:void 0;const P=function e(t){if("string"==typeof t)return t;if(g(t))return function(e,t){for(var n=-1,r=null==e?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}(t,e)+"";if(function(e){return"symbol"==typeof e||x(e)&&"[object Symbol]"==k(e)}(t))return O?O.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var E=/[\\^$.*+?()[\]{}|]/g,C=RegExp(E.source);const j=function(e){return(e=null==(t=e)?"":P(t))&&C.test(e)?e.replace(E,"\\$&"):e;var t};function R(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function D(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){R(o,r,i,s,a,"next",e)}function a(e){R(o,r,i,s,a,"throw",e)}s(void 0)}))}}function A(){return A=D((function*(e,t={}){let{shouldRetry:n,getDelay:r,onError:i}=t;n=null!=n?n:e=>function(e,t){return e<=5}(e),r=null!=r?r:e=>function(e,t,n=!1){const r=n?e+1:e;return 1e3*Math.pow(2,r)}(e);let o,s=0;do{try{return yield L(r(s)),yield e()}catch(e){null==i||i(e,s),o=e}}while(n(s++));throw o})),A.apply(this,arguments)}function L(e){return K.apply(this,arguments)}function K(){return(K=D((function*(e){if(!(e<=0))return new Promise((t=>setTimeout(t,e)))}))).apply(this,arguments)}const T=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},N=d["__core-js_shared__"];var M,$=(M=/[^.]+$/.exec(N&&N.keys&&N.keys.IE_PROTO||""))?"Symbol(src)_1."+M:"";var I=Function.prototype.toString;var F=/^\[object .+?Constructor\]$/,B=Function.prototype,q=Object.prototype,U=B.toString,W=q.hasOwnProperty,V=RegExp("^"+U.call(W).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");const H=function(e){return!(!T(e)||(t=e,$&&$ in t))&&(function(e){if(!T(e))return!1;var t=k(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t}(e)?V:F).test(function(e){if(null!=e){try{return I.call(e)}catch(e){}try{return e+""}catch(e){}}return""}(e));var t},z=function(e,t){var n=function(e,t){return null==e?void 0:e[t]}(e,t);return H(n)?n:void 0},Y=z(Object,"create");var G=Object.prototype.hasOwnProperty;var J=Object.prototype.hasOwnProperty;function Q(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Q.prototype.clear=function(){this.__data__=Y?Y(null):{},this.size=0},Q.prototype.delete=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},Q.prototype.get=function(e){var t=this.__data__;if(Y){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return G.call(t,e)?t[e]:void 0},Q.prototype.has=function(e){var t=this.__data__;return Y?void 0!==t[e]:J.call(t,e)},Q.prototype.set=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=Y&&void 0===t?"__lodash_hash_undefined__":t,this};const X=Q,Z=function(e,t){for(var n=e.length;n--;)if((r=e[n][0])===(i=t)||r!=r&&i!=i)return n;var r,i;return-1};var ee=Array.prototype.splice;function te(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}te.prototype.clear=function(){this.__data__=[],this.size=0},te.prototype.delete=function(e){var t=this.__data__,n=Z(t,e);return!(n<0||(n==t.length-1?t.pop():ee.call(t,n,1),--this.size,0))},te.prototype.get=function(e){var t=this.__data__,n=Z(t,e);return n<0?void 0:t[n][1]},te.prototype.has=function(e){return Z(this.__data__,e)>-1},te.prototype.set=function(e,t){var n=this.__data__,r=Z(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};const ne=te,re=z(d,"Map"),ie=function(e,t){var n,r,i=e.__data__;return("string"==(r=typeof(n=t))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof t?"string":"hash"]:i.map};function oe(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}oe.prototype.clear=function(){this.size=0,this.__data__={hash:new X,map:new(re||ne),string:new X}},oe.prototype.delete=function(e){var t=ie(this,e).delete(e);return this.size-=t?1:0,t},oe.prototype.get=function(e){return ie(this,e).get(e)},oe.prototype.has=function(e){return ie(this,e).has(e)},oe.prototype.set=function(e,t){var n=ie(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};const se=oe;function ae(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new se;++t<n;)this.add(e[t])}ae.prototype.add=ae.prototype.push=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this},ae.prototype.has=function(e){return this.__data__.has(e)};const ue=ae,ce=function(e){return e!=e},le=function(e,t){return!(null==e||!e.length)&&function(e,t,n){return t==t?function(e,t,n){for(var r=n-1,i=e.length;++r<i;)if(e[r]===t)return r;return-1}(e,t,n):function(e,t,n,r){for(var i=e.length,o=n+(r?1:-1);r?o--:++o<i;)if(t(e[o],o,e))return o;return-1}(e,ce,n)}(e,t,0)>-1},he=function(e,t,n){for(var r=-1,i=null==e?0:e.length;++r<i;)if(n(t,e[r]))return!0;return!1},fe=function(e,t){return e.has(t)},de=z(d,"Set"),pe=function(e){var t=-1,n=Array(e.size);return e.forEach((function(e){n[++t]=e})),n},ge=de&&1/pe(new de([,-0]))[1]==1/0?function(e){return new de(e)}:function(){},ye=function(e){return e&&e.length?function(e,t,n){var r=-1,i=le,o=e.length,s=!0,a=[],u=a;if(n)s=!1,i=he;else if(o>=200){var c=t?null:ge(e);if(c)return pe(c);s=!1,i=fe,u=new ue}else u=t?[]:a;e:for(;++r<o;){var l=e[r],h=t?t(l):l;if(l=n||0!==l?l:0,s&&h==h){for(var f=u.length;f--;)if(u[f]===h)continue e;t&&u.push(h),a.push(l)}else i(u,h,n)||(u!==a&&u.push(h),a.push(l))}return a}(e):[]},ve="x-omrs-offline-response-body",me="x-omrs-offline-response-status",be="x-omrs-offline-caching-strategy",we="omrs",_e=`${we}-spa-cache-v1`,ke=[{'revision':null,'url':'/openmrs/spa/routes.registry.json'},{'revision':null,'url':'01c48175a5cba05a.js'},{'revision':null,'url':'023bd53d342b7463.woff'},{'revision':null,'url':'02acc4469a2fe2e4.woff2'},{'revision':null,'url':'033e03f8663ab9b1.woff'},{'revision':null,'url':'052607e67da262ec.woff'},{'revision':null,'url':'081587ca0db8e63f.woff2'},{'revision':null,'url':'08cf53c4e5e71cf1.woff2'},{'revision':null,'url':'090b2bc014d24ea4.woff2'},{'revision':null,'url':'0a28cd0b47497b71.woff'},{'revision':null,'url':'0a9765a89ff0437d.woff'},{'revision':null,'url':'0ae92bcea615e948.woff2'},{'revision':null,'url':'0be8520d8945b3b7.woff2'},{'revision':null,'url':'0bf6b66a8b86b014.woff'},{'revision':null,'url':'0e7dd073cd8bb0ad.woff2'},{'revision':null,'url':'14869ac5d1830304.woff2'},{'revision':null,'url':'14aaceff85fc8b28.woff2'},{'revision':null,'url':'1590052e1cf8f28d.woff'},{'revision':null,'url':'16f443eed01776ca.woff2'},{'revision':null,'url':'183bae0e53a22182.woff2'},{'revision':null,'url':'19b239a0bb74b27e.woff'},{'revision':null,'url':'19c8f94ccd6289f5.woff2'},{'revision':null,'url':'1ae86565eab7451c.woff2'},{'revision':null,'url':'1c7bf8797e0a9be6.woff2'},{'revision':null,'url':'1d9aff9a93a3bb66.woff'},{'revision':null,'url':'1f266d3619b30f16.woff2'},{'revision':null,'url':'1f8c5a4087a524fd.woff2'},{'revision':null,'url':'20ba2b23c5c0cd0b.woff2'},{'revision':null,'url':'2269d45733c5cf8f.woff'},{'revision':null,'url':'258ecbd235953099.woff'},{'revision':null,'url':'295dd01a1fbfee6d.woff2'},{'revision':null,'url':'2d7f835ab7c7c764.woff'},{'revision':null,'url':'2f66cca99eeead63.woff'},{'revision':null,'url':'2f686985e26e7107.woff2'},{'revision':null,'url':'315eff729e4ccbd9.woff2'},{'revision':null,'url':'32f1e5aadf845e08.woff'},{'revision':null,'url':'338484e1c850669c.woff'},{'revision':null,'url':'33b7a82f1e295190.woff'},{'revision':null,'url':'3674d98ec4a9173d.woff'},{'revision':null,'url':'368d16e3259bf207.woff2'},{'revision':null,'url':'36c49aa341a7079a.woff2'},{'revision':null,'url':'36e1e0430475edee.woff2'},{'revision':null,'url':'3bc19662b8630ee9.woff2'},{'revision':null,'url':'3f645f473b3f8fba.woff2'},{'revision':null,'url':'4095df88acae9e98.woff'},{'revision':null,'url':'4218ac9901b9d36d.woff2'},{'revision':null,'url':'4680ba68412e4da9.woff2'},{'revision':null,'url':'47d7a8698d562a0e.woff'},{'revision':null,'url':'47ec6c9dffe776a0.woff'},{'revision':null,'url':'48e37bd7ebf85a1f.woff2'},{'revision':null,'url':'48edfdf51dfb3160.woff'},{'revision':null,'url':'4a35a2746c8ad7a5.woff'},{'revision':null,'url':'4e11b8a7c445255f.woff2'},{'revision':null,'url':'4ea1f5c3baf89fe3.woff'},{'revision':null,'url':'4ea99f41c896bf9d.woff'},{'revision':null,'url':'5005db1d1caf70c7.woff'},{'revision':null,'url':'528a8e7c1c141a31.woff'},{'revision':null,'url':'52ca12f5b516d4ea.woff'},{'revision':null,'url':'537ddd61c5c1fce2.woff2'},{'revision':null,'url':'5432f7541ec25c34.woff'},{'revision':null,'url':'54a95d73a9454ba3.woff'},{'revision':null,'url':'56c4118c0907f151.woff2'},{'revision':null,'url':'5938bc2ae7ec60c0.woff2'},{'revision':null,'url':'594306657c4e44e8.woff'},{'revision':null,'url':'5a538aa477a66067.woff'},{'revision':null,'url':'5c6586155f0d278a.woff2'},{'revision':null,'url':'60ec587649ba812a.woff2'},{'revision':null,'url':'616567cd947eb9dd.woff'},{'revision':null,'url':'65168b59f44caab4.woff'},{'revision':null,'url':'65c0982f98374864.woff'},{'revision':null,'url':'65e6511e035870e1.woff2'},{'revision':null,'url':'661425f6798cd16a.woff2'},{'revision':null,'url':'66b864fe213caf46.woff2'},{'revision':null,'url':'6775fee945132ef9.woff'},{'revision':null,'url':'68bbd362c8e4983b.woff'},{'revision':null,'url':'68d6deec87b6b604.woff'},{'revision':null,'url':'69a7e6d31d390296.woff'},{'revision':null,'url':'69d087d970ee9455.woff2'},{'revision':null,'url':'69fa3fc7363bbc04.woff'},{'revision':null,'url':'6a1f0178b45b2e9e.woff'},{'revision':null,'url':'6c6c45e66ff54281.woff2'},{'revision':null,'url':'6ffb9ed97b21fdc0.woff'},{'revision':null,'url':'7073a7323e92bd11.woff2'},{'revision':null,'url':'718c6cc31274ab1a.woff2'},{'revision':null,'url':'72cdbedfe04be9f9.woff2'},{'revision':null,'url':'7509c9f56fe9e532.woff2'},{'revision':null,'url':'75dc5c5b04adc8bf.woff2'},{'revision':null,'url':'76a7c256fc8b3490.woff'},{'revision':null,'url':'77b48bc05299ecca.woff2'},{'revision':null,'url':'787f56efa306ddbc.woff'},{'revision':null,'url':'7a0a0215c248c73d.woff2'},{'revision':null,'url':'7c4463d9c84f263a.woff'},{'revision':null,'url':'7d112a556b7670d2.woff'},{'revision':null,'url':'7d52d6014b5f2bbc.woff'},{'revision':null,'url':'7f00bebb24e40167.woff2'},{'revision':null,'url':'7f2c6ea3e740417e.woff'},{'revision':null,'url':'802c6176541eeed7.woff2'},{'revision':null,'url':'8080081b3379c637.woff2'},{'revision':null,'url':'8274cc1afc7619f1.woff'},{'revision':null,'url':'8605507b7a8487c4.woff2'},{'revision':null,'url':'8a83d654702f6534.woff2'},{'revision':null,'url':'8ccee65f6cf254ee.woff'},{'revision':null,'url':'8d82a082a4aba439.woff'},{'revision':null,'url':'8de04ae985937b56.woff'},{'revision':null,'url':'8fe71173a13fe571.woff2'},{'revision':null,'url':'90edccb224a51cee.woff'},{'revision':null,'url':'94b292fe87831a8b.woff'},{'revision':null,'url':'95dc66c1b88745f8.woff'},{'revision':null,'url':'95fb698be77c85ef.woff'},{'revision':null,'url':'9624cec0f9bdd81e.woff2'},{'revision':null,'url':'9662331fa31e3f20.woff'},{'revision':null,'url':'98a3af55a1698171.woff2'},{'revision':null,'url':'9ba85996af74c5ce.woff2'},{'revision':null,'url':'9bc133b1df25cb74.woff'},{'revision':null,'url':'9ddb22faa35006e7.woff2'},{'revision':null,'url':'9e97352380611b95.woff'},{'revision':null,'url':'a167fb2799dd741b.woff2'},{'revision':null,'url':'a2045a5cc4fdf94f.woff2'},{'revision':null,'url':'a246c73905a31c93.woff2'},{'revision':null,'url':'a401aa7939cb6e6f.woff2'},{'revision':null,'url':'a41a71258c38684d.woff'},{'revision':null,'url':'a60d94a72d615a8e.woff'},{'revision':null,'url':'a66764dd0c1fa213.woff'},{'revision':null,'url':'a6ed036f17a1ea29.woff2'},{'revision':null,'url':'a8f635129d660202.woff'},{'revision':null,'url':'a9f25ca430709a1a.woff2'},{'revision':null,'url':'ae14d98ad8a1212c.woff'},{'revision':null,'url':'aeec4f78084adf7f.woff'},{'revision':null,'url':'af11e94b0644eba5.woff'},{'revision':null,'url':'afa9121a49e95351.woff2'},{'revision':null,'url':'afcda12d9f805543.woff2'},{'revision':null,'url':'b09ded85a7da77f1.woff2'},{'revision':null,'url':'b2f4e9d1e821b71c.woff2'},{'revision':null,'url':'b30b06698dc369b2.woff'},{'revision':null,'url':'b4a074bf828bb757.woff2'},{'revision':null,'url':'b7f447da43f6e596.woff2'},{'revision':null,'url':'b7f633b871b84820.woff'},{'revision':null,'url':'ba80afe9ce7ebeab.js'},{'revision':null,'url':'bcca84a524572d10.woff2'},{'revision':null,'url':'be4d1f97b11d087c.woff2'},{'revision':null,'url':'be91def2232f6776.woff'},{'revision':null,'url':'bec14780d81164de.woff2'},{'revision':null,'url':'c285f4b15d11f172.woff'},{'revision':null,'url':'c4673617b80801f3.woff'},{'revision':null,'url':'c553f7e0199c5084.woff2'},{'revision':null,'url':'c8470ed2c145ace7.woff'},{'revision':null,'url':'c8bb98d9538f8dde.js'},{'revision':null,'url':'c9d9ce9f465df4fe.woff2'},{'revision':null,'url':'ccb2870475da9fe8.woff'},{'revision':null,'url':'d04134fa33c2606d.woff'},{'revision':null,'url':'d11f9c5cd7d9ea16.woff'},{'revision':null,'url':'d188f7f036ac5779.woff2'},{'revision':null,'url':'d265d81c58525ae4.woff2'},{'revision':null,'url':'d5942cd81663e136.woff2'},{'revision':null,'url':'d6097a5c452acf6d.woff'},{'revision':null,'url':'d66b8ff73d95cabb.woff2'},{'revision':null,'url':'d77f5bf95de8edaa.woff'},{'revision':null,'url':'d8829a685af4f372.woff'},{'revision':null,'url':'d88899ef0fd16719.woff2'},{'revision':null,'url':'d9a5d958e69e058d.woff2'},{'revision':null,'url':'da65d9a514c628c8.woff'},{'revision':null,'url':'dac90d495be353a0.woff2'},{'revision':null,'url':'dd7071bc6306585c.woff'},{'revision':null,'url':'dd8ce598529c3fab.woff2'},{'revision':null,'url':'ddef6f2dd566c2b9.woff'},{'revision':null,'url':'de013f1be25103fa.woff2'},{'revision':null,'url':'dee2ff599db31e5b.woff'},{'revision':null,'url':'dee7c6b5dd954d9b.woff'},{'revision':null,'url':'df222fceeffca849.woff2'},{'revision':null,'url':'e0d2e5b12f028b5d.woff'},{'revision':null,'url':'e33e3db8e4f7559f.woff'},{'revision':null,'url':'e62b00b9199c1ac9.woff2'},{'revision':null,'url':'e696cef1407b2610.woff2'},{'revision':null,'url':'e89ca83b24959664.woff'},{'revision':null,'url':'eb8c0ae77ad55249.woff'},{'revision':null,'url':'ed0997bd7d221b8e.woff'},{'revision':null,'url':'eed48feba743e21c.woff2'},{'revision':null,'url':'f280bda8a6e535a6.woff'},{'revision':null,'url':'f543c88feb236d11.woff2'},{'revision':null,'url':'f591b0079faa93fe.woff2'},{'revision':null,'url':'f6ed27923769ad1d.woff2'},{'revision':null,'url':'f8803bebe640d99a.woff'},{'revision':'30de494bd9e73ae96c18fd0c06fa422b','url':'favicon.ico'},{'revision':null,'url':'fbebeb4336e67012.woff2'},{'revision':null,'url':'fd522cd7a5c646fe.woff'},{'revision':null,'url':'https://dev3.openmrs.org/openmrs/spa/importmap.json'},{'revision':'3ee128ad017b0fa7a730fcd373d50180','url':'index.html'},{'revision':'6b758b31ea00150986994edcfb033a94','url':'logo-512.png'},{'revision':'b860db243392596e3b875bad9794b4e5','url':'logo.svg'},{'revision':null,'url':'openmrs.419f57cc77d46d0d.css'},{'revision':null,'url':'openmrs.de9d7791e924ceba.js'},{'revision':'dff2ca614f04628e63b5bb9e7de63433','url':'openmrs.de9d7791e924ceba.js.LICENSE.txt'}],xe=Pe("index.html"),Se=ye(ke.map((({url:e})=>Pe(e)))),Oe=".buildmanifest.json";function Pe(e){return new URL(e,self.location.href).href}const Ee=function(e,t){for(var n=-1,r=t.length,i=e.length;++n<r;)e[i+n]=t[n];return e},Ce=function(e){return x(e)&&"[object Arguments]"==k(e)};var je=Object.prototype,Re=je.hasOwnProperty,De=je.propertyIsEnumerable;const Ae=Ce(function(){return arguments}())?Ce:function(e){return x(e)&&Re.call(e,"callee")&&!De.call(e,"callee")};var Le=p?p.isConcatSpreadable:void 0;const Ke=function(e){return g(e)||Ae(e)||!!(Le&&e&&e[Le])},Te=function e(t,n,r,i,o){var s=-1,a=t.length;for(r||(r=Ke),o||(o=[]);++s<a;){var u=t[s];n>0&&r(u)?n>1?e(u,n-1,r,i,o):Ee(o,u):i||(o[o.length]=u)}return o},Ne=function(e){return null!=e&&e.length?Te(e,1):[]};function Me(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function $e(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Me(o,r,i,s,a,"next",e)}function a(e){Me(o,r,i,s,a,"throw",e)}s(void 0)}))}}function Ie(){return Ie=$e((function*({imports:e={}}){const t=Object.values(e),n=yield Promise.all(t.map((r=$e((function*(e){const t=function(e){return e+Oe}(e),n=yield function(e){return fetch(e).then((e=>e.json())).catch((()=>null))}(t);return n?function(e,t){try{const i=[],o=function(e){const t=(e.origin+e.pathname).split("/");return t[t.length-1]="",t.join("/")}(new URL(e,self.location.href));var n;for(const e of null!==(n=t.chunks)&&void 0!==n?n:[]){var r;for(const t of null!==(r=e.files)&&void 0!==r?r:[])i.push(new URL(t,o).toString())}return i}catch(t){return console.error("[SW] Failed to determine the dependencies of the module with the URL %s. Not precaching any of the module's assets. Error: ",e,t),[]}}(e,n):[]})),function(e){return r.apply(this,arguments)})));var r;return Ne(n)})),Ie.apply(this,arguments)}const Fe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Be=Object.keys,qe=Array.isArray;function Ue(e,t){return"object"!=typeof t||Be(t).forEach((function(n){e[n]=t[n]})),e}"undefined"==typeof Promise||Fe.Promise||(Fe.Promise=Promise);const We=Object.getPrototypeOf,Ve={}.hasOwnProperty;function He(e,t){return Ve.call(e,t)}function ze(e,t){"function"==typeof t&&(t=t(We(e))),("undefined"==typeof Reflect?Be:Reflect.ownKeys)(t).forEach((n=>{Ge(e,n,t[n])}))}const Ye=Object.defineProperty;function Ge(e,t,n,r){Ye(e,t,Ue(n&&He(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function Je(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Ge(e.prototype,"constructor",e),{extend:ze.bind(null,e.prototype)}}}}const Qe=Object.getOwnPropertyDescriptor;function Xe(e,t){let n;return Qe(e,t)||(n=We(e))&&Xe(n,t)}const Ze=[].slice;function et(e,t,n){return Ze.call(e,t,n)}function tt(e,t){return t(e)}function nt(e){if(!e)throw new Error("Assertion Failed")}function rt(e){Fe.setImmediate?setImmediate(e):setTimeout(e,0)}function it(e,t){return e.reduce(((e,n,r)=>{var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function ot(e,t){if(He(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=ot(e,t[r]);n.push(o)}return n}var s=t.indexOf(".");if(-1!==s){var a=e[t.substr(0,s)];return void 0===a?void 0:ot(a,t.substr(s+1))}}function st(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){nt("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)st(e,t[r],n[r])}else{var o=t.indexOf(".");if(-1!==o){var s=t.substr(0,o),a=t.substr(o+1);if(""===a)void 0===n?qe(e)&&!isNaN(parseInt(s))?e.splice(s,1):delete e[s]:e[s]=n;else{var u=e[s];u&&He(e,s)||(u=e[s]={}),st(u,a,n)}}else void 0===n?qe(e)&&!isNaN(parseInt(t))?e.splice(t,1):delete e[t]:e[t]=n}}function at(e){var t={};for(var n in e)He(e,n)&&(t[n]=e[n]);return t}const ut=[].concat;function ct(e){return ut.apply([],e)}const lt="Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(ct([8,16,32,64].map((e=>["Int","Uint","Float"].map((t=>t+e+"Array")))))).filter((e=>Fe[e])),ht=lt.map((e=>Fe[e]));it(lt,(e=>[e,!0]));let ft=null;function dt(e){ft="undefined"!=typeof WeakMap&&new WeakMap;const t=pt(e);return ft=null,t}function pt(e){if(!e||"object"!=typeof e)return e;let t=ft&&ft.get(e);if(t)return t;if(qe(e)){t=[],ft&&ft.set(e,t);for(var n=0,r=e.length;n<r;++n)t.push(pt(e[n]))}else if(ht.indexOf(e.constructor)>=0)t=e;else{const n=We(e);for(var i in t=n===Object.prototype?{}:Object.create(n),ft&&ft.set(e,t),e)He(e,i)&&(t[i]=pt(e[i]))}return t}const{toString:gt}={};function yt(e){return gt.call(e).slice(8,-1)}const vt="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator",mt="symbol"==typeof vt?function(e){var t;return null!=e&&(t=e[vt])&&t.apply(e)}:function(){return null},bt={};function wt(e){var t,n,r,i;if(1===arguments.length){if(qe(e))return e.slice();if(this===bt&&"string"==typeof e)return[e];if(i=mt(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}const _t="undefined"!=typeof Symbol?e=>"AsyncFunction"===e[Symbol.toStringTag]:()=>!1;var kt="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function xt(e,t){kt=e,St=t}var St=()=>!0;const Ot=!new Error("").stack;function Pt(){if(Ot)try{throw Pt.arguments,new Error}catch(e){return e}return new Error}function Et(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(St).map((e=>"\n"+e)).join("")):""}var Ct=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],jt=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(Ct),Rt={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 Dt(e,t){this._e=Pt(),this.name=e,this.message=t}function At(e,t){return e+". Errors: "+Object.keys(t).map((e=>t[e].toString())).filter(((e,t,n)=>n.indexOf(e)===t)).join("\n")}function Lt(e,t,n,r){this._e=Pt(),this.failures=t,this.failedKeys=r,this.successCount=n,this.message=At(e,t)}function Kt(e,t){this._e=Pt(),this.name="BulkError",this.failures=Object.keys(t).map((e=>t[e])),this.failuresByPos=t,this.message=At(e,t)}Je(Dt).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Et(this._e,2))}},toString:function(){return this.name+": "+this.message}}),Je(Lt).from(Dt),Je(Kt).from(Dt);var Tt=jt.reduce(((e,t)=>(e[t]=t+"Error",e)),{});const Nt=Dt;var Mt=jt.reduce(((e,t)=>{var n=t+"Error";function r(e,r){this._e=Pt(),this.name=n,e?"string"==typeof e?(this.message=`${e}${r?"\n "+r:""}`,this.inner=r||null):"object"==typeof e&&(this.message=`${e.name} ${e.message}`,this.inner=e):(this.message=Rt[t]||n,this.inner=null)}return Je(r).from(Nt),e[t]=r,e}),{});Mt.Syntax=SyntaxError,Mt.Type=TypeError,Mt.Range=RangeError;var $t=Ct.reduce(((e,t)=>(e[t+"Error"]=Mt[t],e)),{}),It=jt.reduce(((e,t)=>(-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Mt[t]),e)),{});function Ft(){}function Bt(e){return e}function qt(e,t){return null==e||e===Bt?t:function(n){return t(e(n))}}function Ut(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Wt(e,t){return e===Ft?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Ut(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Ut(i,this.onerror):i),void 0!==o?o:n}}function Vt(e,t){return e===Ft?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Ut(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Ut(r,this.onerror):r)}}function Ht(e,t){return e===Ft?t:function(n){var r=e.apply(this,arguments);Ue(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var s=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Ut(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Ut(o,this.onerror):o),void 0===r?void 0===s?void 0:s:Ue(r,s)}}function zt(e,t){return e===Ft?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Yt(e,t){return e===Ft?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}It.ModifyError=Lt,It.DexieError=Dt,It.BulkError=Kt;var Gt={};const[Jt,Qt,Xt]="undefined"==typeof Promise?[]:(()=>{let e=Promise.resolve();if("undefined"==typeof crypto||!crypto.subtle)return[e,We(e),e];const t=crypto.subtle.digest("SHA-512",new Uint8Array([0]));return[t,We(t),e]})(),Zt=Qt&&Qt.then,en=Jt&&Jt.constructor,tn=!!Xt;var nn=!1,rn=Xt?()=>{Xt.then(En)}:Fe.setImmediate?setImmediate.bind(null,En):Fe.MutationObserver?()=>{var e=document.createElement("div");new MutationObserver((()=>{En(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:()=>{setTimeout(En,0)},on=function(e,t){pn.push([e,t]),an&&(rn(),an=!1)},sn=!0,an=!0,un=[],cn=[],ln=null,hn=Bt,fn={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Qn,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((e=>{try{Qn(e[0],e[1])}catch(e){}}))}},dn=fn,pn=[],gn=0,yn=[];function vn(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Ft,this._lib=!1;var t=this._PSD=dn;if(kt&&(this._stackHolder=Pt(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Gt)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&_n(this,this._value))}this._state=null,this._value=null,++t.ref,wn(this,e)}const mn={get:function(){var e=dn,t=Mn;function n(n,r){var i=!e.global&&(e!==dn||t!==Mn);const o=i&&!Bn();var s=new vn(((t,s)=>{xn(this,new bn(Gn(n,e,i,o),Gn(r,e,i,o),t,s,e))}));return kt&&Pn(s,this),s}return n.prototype=Gt,n},set:function(e){Ge(this,"then",e&&e.prototype===Gt?mn:{get:function(){return e},set:mn.set})}};function bn(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function wn(e,t){try{t((t=>{if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&Cn();t&&"function"==typeof t.then?wn(e,((e,n)=>{t instanceof vn?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,kn(e)),n&&jn()}}),_n.bind(null,e))}catch(t){_n(e,t)}}function _n(e,t){if(cn.push(t),null===e._state){var n=e._lib&&Cn();t=hn(t),e._state=!1,e._value=t,kt&&null!==t&&"object"==typeof t&&!t._promise&&function(e,t,n){try{e.apply(null,void 0)}catch(e){}}((()=>{var n=Xe(t,"stack");t._promise=e,Ge(t,"stack",{get:()=>nn?n&&(n.get?n.get.apply(t):n.value):e.stack})})),function(e){un.some((t=>t._value===e._value))||un.push(e)}(e),kn(e),n&&jn()}}function kn(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)xn(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===gn&&(++gn,on((()=>{0==--gn&&Rn()}),[]))}function xn(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++gn,on(Sn,[n,e,t])}else e._listeners.push(t)}function Sn(e,t,n){try{ln=t;var r,i=t._value;t._state?r=e(i):(cn.length&&(cn=[]),r=e(i),-1===cn.indexOf(i)&&function(e){for(var t=un.length;t;)if(un[--t]._value===e._value)return void un.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{ln=null,0==--gn&&Rn(),--n.psd.ref||n.psd.finalize()}}function On(e,t,n){if(t.length===n)return t;var r="";if(!1===e._state){var i,o,s=e._value;null!=s?(i=s.name||"Error",o=s.message||s,r=Et(s,0)):(i=s,o=""),t.push(i+(o?": "+o:"")+r)}return kt&&((r=Et(e._stackHolder,2))&&-1===t.indexOf(r)&&t.push(r),e._prev&&On(e._prev,t,n)),t}function Pn(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function En(){Cn()&&jn()}function Cn(){var e=sn;return sn=!1,an=!1,e}function jn(){var e,t,n;do{for(;pn.length>0;)for(e=pn,pn=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(pn.length>0);sn=!0,an=!0}function Rn(){var e=un;un=[],e.forEach((e=>{e._PSD.onunhandled.call(null,e._value,e)}));for(var t=yn.slice(0),n=t.length;n;)t[--n]()}function Dn(e){return new vn(Gt,!1,e)}function An(e,t){var n=dn;return function(){var r=Cn(),i=dn;try{return Vn(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Vn(i,!1),r&&jn()}}}ze(vn.prototype,{then:mn,_then:function(e,t){xn(this,new bn(null,null,e,t,dn))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(e=>e instanceof t?n(e):Dn(e))):this.then(null,(e=>e&&e.name===t?n(e):Dn(e)))},finally:function(e){return this.then((t=>(e(),t)),(t=>(e(),Dn(t))))},stack:{get:function(){if(this._stack)return this._stack;try{nn=!0;var e=On(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{nn=!1}}},timeout:function(e,t){return e<1/0?new vn(((n,r)=>{var i=setTimeout((()=>r(new Mt.Timeout(t))),e);this.then(n,r).finally(clearTimeout.bind(null,i))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Ge(vn.prototype,Symbol.toStringTag,"Dexie.Promise"),fn.env=Hn(),ze(vn,{all:function(){var e=wt.apply(null,arguments).map(qn);return new vn((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach(((i,o)=>vn.resolve(i).then((n=>{e[o]=n,--r||t(e)}),n)))}))},resolve:e=>{if(e instanceof vn)return e;if(e&&"function"==typeof e.then)return new vn(((t,n)=>{e.then(t,n)}));var t=new vn(Gt,!0,e);return Pn(t,ln),t},reject:Dn,race:function(){var e=wt.apply(null,arguments).map(qn);return new vn(((t,n)=>{e.map((e=>vn.resolve(e).then(t,n)))}))},PSD:{get:()=>dn,set:e=>dn=e},totalEchoes:{get:()=>Mn},newPSD:In,usePSD:zn,scheduler:{get:()=>on,set:e=>{on=e}},rejectionMapper:{get:()=>hn,set:e=>{hn=e}},follow:(e,t)=>new vn(((n,r)=>In(((t,n)=>{var r=dn;r.unhandleds=[],r.onunhandled=n,r.finalize=Ut((function(){!function(e){yn.push((function t(){e(),yn.splice(yn.indexOf(t),1)})),++gn,on((()=>{0==--gn&&Rn()}),[])}((()=>{0===this.unhandleds.length?t():n(this.unhandleds[0])}))}),r.finalize),e()}),t,n,r)))}),en&&(en.allSettled&&Ge(vn,"allSettled",(function(){const e=wt.apply(null,arguments).map(qn);return new vn((t=>{0===e.length&&t([]);let n=e.length;const r=new Array(n);e.forEach(((e,i)=>vn.resolve(e).then((e=>r[i]={status:"fulfilled",value:e}),(e=>r[i]={status:"rejected",reason:e})).then((()=>--n||t(r)))))}))})),en.any&&"undefined"!=typeof AggregateError&&Ge(vn,"any",(function(){const e=wt.apply(null,arguments).map(qn);return new vn(((t,n)=>{0===e.length&&n(new AggregateError([]));let r=e.length;const i=new Array(r);e.forEach(((e,o)=>vn.resolve(e).then((e=>t(e)),(e=>{i[o]=e,--r||n(new AggregateError(i))}))))}))})));const Ln={awaits:0,echoes:0,id:0};var Kn=0,Tn=[],Nn=0,Mn=0,$n=0;function In(e,t,n,r){var i=dn,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++$n;var s=fn.env;o.env=tn?{Promise:vn,PromiseProp:{value:vn,configurable:!0,writable:!0},all:vn.all,race:vn.race,allSettled:vn.allSettled,any:vn.any,resolve:vn.resolve,reject:vn.reject,nthen:Jn(s.nthen,o),gthen:Jn(s.gthen,o)}:{},t&&Ue(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var a=zn(o,e,n,r);return 0===o.ref&&o.finalize(),a}function Fn(){return Ln.id||(Ln.id=++Kn),++Ln.awaits,Ln.echoes+=100,Ln.id}function Bn(){return!!Ln.awaits&&(0==--Ln.awaits&&(Ln.id=0),Ln.echoes=100*Ln.awaits,!0)}function qn(e){return Ln.echoes&&e&&e.constructor===en?(Fn(),e.then((e=>(Bn(),e)),(e=>(Bn(),Xn(e))))):e}function Un(e){++Mn,Ln.echoes&&0!=--Ln.echoes||(Ln.echoes=Ln.id=0),Tn.push(dn),Vn(e,!0)}function Wn(){var e=Tn[Tn.length-1];Tn.pop(),Vn(e,!1)}function Vn(e,t){var n=dn;if((t?!Ln.echoes||Nn++&&e===dn:!Nn||--Nn&&e===dn)||Yn(t?Un.bind(null,e):Wn),e!==dn&&(dn=e,n===fn&&(fn.env=Hn()),tn)){var r=fn.env.Promise,i=e.env;Qt.then=i.nthen,r.prototype.then=i.gthen,(n.global||e.global)&&(Object.defineProperty(Fe,"Promise",i.PromiseProp),r.all=i.all,r.race=i.race,r.resolve=i.resolve,r.reject=i.reject,i.allSettled&&(r.allSettled=i.allSettled),i.any&&(r.any=i.any))}}function Hn(){var e=Fe.Promise;return tn?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Fe,"Promise"),all:e.all,race:e.race,allSettled:e.allSettled,any:e.any,resolve:e.resolve,reject:e.reject,nthen:Qt.then,gthen:e.prototype.then}:{}}function zn(e,t,n,r,i){var o=dn;try{return Vn(e,!0),t(n,r,i)}finally{Vn(o,!1)}}function Yn(e){Zt.call(Jt,e)}function Gn(e,t,n,r){return"function"!=typeof e?e:function(){var i=dn;n&&Fn(),Vn(t,!0);try{return e.apply(this,arguments)}finally{Vn(i,!1),r&&Yn(Bn)}}}function Jn(e,t){return function(n,r){return e.call(this,Gn(n,t),Gn(r,t))}}function Qn(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(Fe.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Ue(r,i)):Fe.CustomEvent&&Ue(r=new CustomEvent("unhandledrejection",{detail:i}),i),r&&Fe.dispatchEvent&&(dispatchEvent(r),!Fe.PromiseRejectionEvent&&Fe.onunhandledrejection))try{Fe.onunhandledrejection(r)}catch(e){}kt&&r&&!r.defaultPrevented&&console.warn(`Unhandled rejection: ${e.stack||e}`)}catch(e){}}-1===(""+Zt).indexOf("[native code]")&&(Fn=Bn=Ft);var Xn=vn.reject;function Zn(e,t,n,r){if(e.idbdb&&(e._state.openComplete||dn.letThrough||e._vip)){var i=e._createTransaction(t,n,e._dbSchema);try{i.create(),e._state.PR1398_maxLoop=3}catch(i){return i.name===Tt.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>Zn(e,t,n,r)))):Xn(i)}return i._promise(t,((e,t)=>In((()=>(dn.trans=i,r(e,t,i)))))).then((e=>i._completion.then((()=>e))))}if(e._state.openComplete)return Xn(new Mt.DatabaseClosed(e._state.dbOpenError));if(!e._state.isBeingOpened){if(!e._options.autoOpen)return Xn(new Mt.DatabaseClosed);e.open().catch(Ft)}return e._state.dbReadyPromise.then((()=>Zn(e,t,n,r)))}const er=String.fromCharCode(65535),tr="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",nr=[],rr="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),ir=rr,or=rr,sr=e=>!/(dexie\.js|dexie\.min\.js)/.test(e);function ar(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}const ur={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function cr(e){return"string"!=typeof e||/\./.test(e)?e=>e:t=>(void 0===t[e]&&e in t&&delete(t=dt(t))[e],t)}class lr{_trans(e,t,n){const r=this._tx||dn.trans,i=this.name;function o(e,n,r){if(!r.schema[i])throw new Mt.NotFound("Table "+i+" not part of transaction");return t(r.idbtrans,r)}const s=Cn();try{return r&&r.db===this.db?r===dn.trans?r._promise(e,o,n):In((()=>r._promise(e,o,n)),{trans:r,transless:dn.transless||dn}):Zn(this.db,e,[this.name],o)}finally{s&&jn()}}get(e,t){return e&&e.constructor===Object?this.where(e).first(t):this._trans("readonly",(t=>this.core.get({trans:t,key:e}).then((e=>this.hook.reading.fire(e))))).then(t)}where(e){if("string"==typeof e)return new this.db.WhereClause(this,e);if(qe(e))return new this.db.WhereClause(this,`[${e.join("+")}]`);const t=Be(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);const n=this.schema.indexes.concat(this.schema.primKey).filter((e=>e.compound&&t.every((t=>e.keyPath.indexOf(t)>=0))&&e.keyPath.every((e=>t.indexOf(e)>=0))))[0];if(n&&this.db._maxKey!==er)return this.where(n.name).equals(n.keyPath.map((t=>e[t])));!n&&kt&&console.warn(`The query ${JSON.stringify(e)} on ${this.name} would benefit of a compound index [${t.join("+")}]`);const{idxByName:r}=this.schema,i=this.db._deps.indexedDB;function o(e,t){try{return 0===i.cmp(e,t)}catch(e){return!1}}const[s,a]=t.reduce((([t,n],i)=>{const s=r[i],a=e[i];return[t||s,t||!s?ar(n,s&&s.multi?e=>{const t=ot(e,i);return qe(t)&&t.some((e=>o(a,e)))}:e=>o(a,ot(e,i))):n]}),[null,null]);return s?this.where(s.name).equals(e[s.keyPath]).filter(a):n?this.filter(a):this.where(t).equals("")}filter(e){return this.toCollection().and(e)}count(e){return this.toCollection().count(e)}offset(e){return this.toCollection().offset(e)}limit(e){return this.toCollection().limit(e)}each(e){return this.toCollection().each(e)}toArray(e){return this.toCollection().toArray(e)}toCollection(){return new this.db.Collection(new this.db.WhereClause(this))}orderBy(e){return new this.db.Collection(new this.db.WhereClause(this,qe(e)?`[${e.join("+")}]`:e))}reverse(){return this.toCollection().reverse()}mapToClass(e){this.schema.mappedClass=e;const t=t=>{if(!t)return t;const n=Object.create(e.prototype);for(var r in t)if(He(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=t,this.hook("reading",t),e}defineClass(){return this.mapToClass((function(e){Ue(this,e)}))}add(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let i=e;return r&&n&&(i=cr(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"add",keys:null!=t?[t]:null,values:[i]}))).then((e=>e.numFailures?vn.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{st(e,r,t)}catch(e){}return t}))}update(e,t){if("object"!=typeof e||qe(e))return this.where(":id").equals(e).modify(t);{const n=ot(e,this.schema.primKey.keyPath);if(void 0===n)return Xn(new Mt.InvalidArgument("Given object does not contain its primary key"));try{"function"!=typeof t?Be(t).forEach((n=>{st(e,n,t[n])})):t(e,{value:e,primKey:n})}catch(e){}return this.where(":id").equals(n).modify(t)}}put(e,t){const{auto:n,keyPath:r}=this.schema.primKey;let i=e;return r&&n&&(i=cr(r)(e)),this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"put",values:[i],keys:null!=t?[t]:null}))).then((e=>e.numFailures?vn.reject(e.failures[0]):e.lastResult)).then((t=>{if(r)try{st(e,r,t)}catch(e){}return t}))}delete(e){return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:[e]}))).then((e=>e.numFailures?vn.reject(e.failures[0]):void 0))}clear(){return this._trans("readwrite",(e=>this.core.mutate({trans:e,type:"deleteRange",range:ur}))).then((e=>e.numFailures?vn.reject(e.failures[0]):void 0))}bulkGet(e){return this._trans("readonly",(t=>this.core.getMany({keys:e,trans:t}).then((e=>e.map((e=>this.hook.reading.fire(e)))))))}bulkAdd(e,t,n){const r=Array.isArray(t)?t:void 0,i=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:o}=this.schema.primKey;if(o&&r)throw new Mt.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Mt.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=o&&n?e.map(cr(o)):e;return this.core.mutate({trans:t,type:"add",keys:r,values:a,wantResults:i}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return i?t:n;throw new Kt(`${this.name}.bulkAdd(): ${e} of ${s} operations failed`,r)}))}))}bulkPut(e,t,n){const r=Array.isArray(t)?t:void 0,i=(n=n||(r?void 0:t))?n.allKeys:void 0;return this._trans("readwrite",(t=>{const{auto:n,keyPath:o}=this.schema.primKey;if(o&&r)throw new Mt.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(r&&r.length!==e.length)throw new Mt.InvalidArgument("Arguments objects and keys must have the same length");const s=e.length;let a=o&&n?e.map(cr(o)):e;return this.core.mutate({trans:t,type:"put",keys:r,values:a,wantResults:i}).then((({numFailures:e,results:t,lastResult:n,failures:r})=>{if(0===e)return i?t:n;throw new Kt(`${this.name}.bulkPut(): ${e} of ${s} operations failed`,r)}))}))}bulkDelete(e){const t=e.length;return this._trans("readwrite",(t=>this.core.mutate({trans:t,type:"delete",keys:e}))).then((({numFailures:e,lastResult:n,failures:r})=>{if(0===e)return n;throw new Kt(`${this.name}.bulkDelete(): ${e} of ${t} operations failed`,r)}))}}function hr(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(e,r,i){if("object"==typeof e)return s(e);r||(r=zt),i||(i=Ft);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=r(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(r,i)}};return t[e]=n[e]=o,o}function s(e){Be(e).forEach((function(t){var n=e[t];if(qe(n))o(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Mt.InvalidArgument("Invalid event config");var r=o(t,Bt,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){rt((function(){e.apply(null,t)}))}))}))}}))}}function fr(e,t){return Je(t).from({prototype:e}),t}function dr(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function pr(e,t){e.filter=ar(e.filter,t)}function gr(e,t,n){var r=e.replayFilter;e.replayFilter=r?()=>ar(r(),t()):t,e.justLimit=n&&!r}function yr(e,t){if(e.isPrimKey)return t.primaryKey;const n=t.getIndexByKeyPath(e.index);if(!n)throw new Mt.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return n}function vr(e,t,n){const r=yr(e,t.schema);return t.openCursor({trans:n,values:!e.keysOnly,reverse:"prev"===e.dir,unique:!!e.unique,query:{index:r,range:e.range}})}function mr(e,t,n,r){const i=e.replayFilter?ar(e.filter,e.replayFilter()):e.filter;if(e.or){const o={},s=(e,n,r)=>{if(!i||i(n,r,(e=>n.stop(e)),(e=>n.fail(e)))){var s=n.primaryKey,a=""+s;"[object ArrayBuffer]"===a&&(a=""+new Uint8Array(s)),He(o,a)||(o[a]=!0,t(e,n,r))}};return Promise.all([e.or._iterate(s,n),br(vr(e,r,n),e.algorithm,s,!e.keysOnly&&e.valueMapper)])}return br(vr(e,r,n),ar(e.algorithm,i),t,!e.keysOnly&&e.valueMapper)}function br(e,t,n,r){var i=An(r?(e,t,i)=>n(r(e),t,i):n);return e.then((e=>{if(e)return e.start((()=>{var n=()=>e.continue();t&&!t(e,(e=>n=e),(t=>{e.stop(t),n=Ft}),(t=>{e.fail(t),n=Ft}))||i(e.value,e,(e=>n=e)),n()}))}))}function wr(e,t){try{const n=_r(e),r=_r(t);if(n!==r)return"Array"===n?1:"Array"===r?-1:"binary"===n?1:"binary"===r?-1:"string"===n?1:"string"===r?-1:"Date"===n?1:"Date"!==r?NaN:-1;switch(n){case"number":case"Date":case"string":return e>t?1:e<t?-1:0;case"binary":return function(e,t){const n=e.length,r=t.length,i=n<r?n:r;for(let n=0;n<i;++n)if(e[n]!==t[n])return e[n]<t[n]?-1:1;return n===r?0:n<r?-1:1}(kr(e),kr(t));case"Array":return function(e,t){const n=e.length,r=t.length,i=n<r?n:r;for(let n=0;n<i;++n){const r=wr(e[n],t[n]);if(0!==r)return r}return n===r?0:n<r?-1:1}(e,t)}}catch(e){}return NaN}function _r(e){const t=typeof e;if("object"!==t)return t;if(ArrayBuffer.isView(e))return"binary";const n=yt(e);return"ArrayBuffer"===n?"binary":n}function kr(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}class xr{_read(e,t){var n=this._ctx;return n.error?n.table._trans(null,Xn.bind(null,n.error)):n.table._trans("readonly",e).then(t)}_write(e){var t=this._ctx;return t.error?t.table._trans(null,Xn.bind(null,t.error)):t.table._trans("readwrite",e,"locked")}_addAlgorithm(e){var t=this._ctx;t.algorithm=ar(t.algorithm,e)}_iterate(e,t){return mr(this._ctx,e,t,this._ctx.table.core)}clone(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Ue(n,e),t._ctx=n,t}raw(){return this._ctx.valueMapper=null,this}each(e){var t=this._ctx;return this._read((n=>mr(t,e,n,t.table.core)))}count(e){return this._read((e=>{const t=this._ctx,n=t.table.core;if(dr(t,!0))return n.count({trans:e,query:{index:yr(t,n.schema),range:t.range}}).then((e=>Math.min(e,t.limit)));var r=0;return mr(t,(()=>(++r,!1)),e,n).then((()=>r))})).then(e)}sortBy(e,t){const n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var s="next"===this._ctx.dir?1:-1;function a(e,t){var n=o(e,i),r=o(t,i);return n<r?-s:n>r?s:0}return this.toArray((function(e){return e.sort(a)})).then(t)}toArray(e){return this._read((e=>{var t=this._ctx;if("next"===t.dir&&dr(t,!0)&&t.limit>0){const{valueMapper:n}=t,r=yr(t,t.table.core.schema);return t.table.core.query({trans:e,limit:t.limit,values:!0,query:{index:r,range:t.range}}).then((({result:e})=>n?e.map(n):e))}{const n=[];return mr(t,(e=>n.push(e)),e,t.table.core).then((()=>n))}}),e)}offset(e){var t=this._ctx;return e<=0||(t.offset+=e,dr(t)?gr(t,(()=>{var t=e;return(e,n)=>0===t||(1===t?(--t,!1):(n((()=>{e.advance(t),t=0})),!1))})):gr(t,(()=>{var t=e;return()=>--t<0}))),this}limit(e){return this._ctx.limit=Math.min(this._ctx.limit,e),gr(this._ctx,(()=>{var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this}until(e,t){return pr(this._ctx,(function(n,r,i){return!e(n.value)||(r(i),t)})),this}first(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)}last(e){return this.reverse().first(e)}filter(e){var t,n;return pr(this._ctx,(function(t){return e(t.value)})),t=this._ctx,n=e,t.isMatch=ar(t.isMatch,n),this}and(e){return this.filter(e)}or(e){return new this.db.WhereClause(this._ctx.table,e,this)}reverse(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this}desc(){return this.reverse()}eachKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))}eachUniqueKey(e){return this._ctx.unique="unique",this.eachKey(e)}eachPrimaryKey(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))}keys(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)}primaryKeys(e){var t=this._ctx;if("next"===t.dir&&dr(t,!0)&&t.limit>0)return this._read((e=>{var n=yr(t,t.table.core.schema);return t.table.core.query({trans:e,values:!1,limit:t.limit,query:{index:n,range:t.range}})})).then((({result:e})=>e)).then(e);t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.primaryKey)})).then((function(){return n})).then(e)}uniqueKeys(e){return this._ctx.unique="unique",this.keys(e)}firstKey(e){return this.limit(1).keys((function(e){return e[0]})).then(e)}lastKey(e){return this.reverse().firstKey(e)}distinct(){var e=this._ctx,t=e.index&&e.table.schema.idxByName[e.index];if(!t||!t.multi)return this;var n={};return pr(this._ctx,(function(e){var t=e.primaryKey.toString(),r=He(n,t);return n[t]=!0,!r})),this}modify(e){var t=this._ctx;return this._write((n=>{var r;if("function"==typeof e)r=e;else{var i=Be(e),o=i.length;r=function(t){for(var n=!1,r=0;r<o;++r){var s=i[r],a=e[s];ot(t,s)!==a&&(st(t,s,a),n=!0)}return n}}const s=t.table.core,{outbound:a,extractKey:u}=s.schema.primaryKey,c=this.db._options.modifyChunkSize||200,l=[];let h=0;const f=[],d=(e,t)=>{const{failures:n,numFailures:r}=t;h+=e-r;for(let e of Be(n))l.push(n[e])};return this.clone().primaryKeys().then((i=>{const o=l=>{const h=Math.min(c,i.length-l);return s.getMany({trans:n,keys:i.slice(l,l+h),cache:"immutable"}).then((f=>{const p=[],g=[],y=a?[]:null,v=[];for(let e=0;e<h;++e){const t=f[e],n={value:dt(t),primKey:i[l+e]};!1!==r.call(n,n.value,n)&&(null==n.value?v.push(i[l+e]):a||0===wr(u(t),u(n.value))?(g.push(n.value),a&&y.push(i[l+e])):(v.push(i[l+e]),p.push(n.value)))}const m=dr(t)&&t.limit===1/0&&("function"!=typeof e||e===Sr)&&{index:t.index,range:t.range};return Promise.resolve(p.length>0&&s.mutate({trans:n,type:"add",values:p}).then((e=>{for(let t in e.failures)v.splice(parseInt(t),1);d(p.length,e)}))).then((()=>(g.length>0||m&&"object"==typeof e)&&s.mutate({trans:n,type:"put",keys:y,values:g,criteria:m,changeSpec:"function"!=typeof e&&e}).then((e=>d(g.length,e))))).then((()=>(v.length>0||m&&e===Sr)&&s.mutate({trans:n,type:"delete",keys:v,criteria:m}).then((e=>d(v.length,e))))).then((()=>i.length>l+h&&o(l+c)))}))};return o(0).then((()=>{if(l.length>0)throw new Lt("Error modifying one or more objects",l,h,f);return i.length}))}))}))}delete(){var e=this._ctx,t=e.range;return dr(e)&&(e.isPrimKey&&!or||3===t.type)?this._write((n=>{const{primaryKey:r}=e.table.core.schema,i=t;return e.table.core.count({trans:n,query:{index:r,range:i}}).then((t=>e.table.core.mutate({trans:n,type:"deleteRange",range:i}).then((({failures:e,lastResult:n,results:r,numFailures:i})=>{if(i)throw new Lt("Could not delete some values",Object.keys(e).map((t=>e[t])),t-i);return t-i}))))})):this.modify(Sr)}}const Sr=(e,t)=>t.value=null;function Or(e,t){return e<t?-1:e===t?0:1}function Pr(e,t){return e>t?-1:e===t?0:1}function Er(e,t,n){var r=e instanceof Lr?new e.Collection(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function Cr(e){return new e.Collection(e,(()=>Ar(""))).limit(0)}function jr(e,t,n,r,i,o){for(var s=Math.min(e.length,r.length),a=-1,u=0;u<s;++u){var c=t[u];if(c!==r[u])return i(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):i(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):a>=0?e.substr(0,a)+t[a]+n.substr(a+1):null;i(e[u],c)<0&&(a=u)}return s<r.length&&"next"===o?e+n.substr(e.length):s<e.length&&"prev"===o?e.substr(0,n.length):a<0?null:e.substr(0,a)+r[a]+n.substr(a+1)}function Rr(e,t,n,r){var i,o,s,a,u,c,l,h=n.length;if(!n.every((e=>"string"==typeof e)))return Er(e,"String expected.");function f(e){i=function(e){return"next"===e?e=>e.toUpperCase():e=>e.toLowerCase()}(e),o=function(e){return"next"===e?e=>e.toLowerCase():e=>e.toUpperCase()}(e),s="next"===e?Or:Pr;var t=n.map((function(e){return{lower:o(e),upper:i(e)}})).sort((function(e,t){return s(e.lower,t.lower)}));a=t.map((function(e){return e.upper})),u=t.map((function(e){return e.lower})),c=e,l="next"===e?"":r}f("next");var d=new e.Collection(e,(()=>Dr(a[0],u[h-1]+r)));d._ondirectionchange=function(e){f(e)};var p=0;return d._addAlgorithm((function(e,n,r){var i=e.key;if("string"!=typeof i)return!1;var f=o(i);if(t(f,u,p))return!0;for(var d=null,g=p;g<h;++g){var y=jr(i,f,a[g],u[g],s,c);null===y&&null===d?p=g+1:(null===d||s(d,y)>0)&&(d=y)}return n(null!==d?function(){e.continue(d+l)}:r),!1})),d}function Dr(e,t,n,r){return{type:2,lower:e,upper:t,lowerOpen:n,upperOpen:r}}function Ar(e){return{type:1,lower:e,upper:e}}class Lr{get Collection(){return this._ctx.table.db.Collection}between(e,t,n,r){n=!1!==n,r=!0===r;try{return this._cmp(e,t)>0||0===this._cmp(e,t)&&(n||r)&&(!n||!r)?Cr(this):new this.Collection(this,(()=>Dr(e,t,!n,!r)))}catch(e){return Er(this,tr)}}equals(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Ar(e)))}above(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Dr(e,void 0,!0)))}aboveOrEqual(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Dr(e,void 0,!1)))}below(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Dr(void 0,e,!1,!0)))}belowOrEqual(e){return null==e?Er(this,tr):new this.Collection(this,(()=>Dr(void 0,e)))}startsWith(e){return"string"!=typeof e?Er(this,"String expected."):this.between(e,e+er,!0,!0)}startsWithIgnoreCase(e){return""===e?this.startsWith(e):Rr(this,((e,t)=>0===e.indexOf(t[0])),[e],er)}equalsIgnoreCase(e){return Rr(this,((e,t)=>e===t[0]),[e],"")}anyOfIgnoreCase(){var e=wt.apply(bt,arguments);return 0===e.length?Cr(this):Rr(this,((e,t)=>-1!==t.indexOf(e)),e,"")}startsWithAnyOfIgnoreCase(){var e=wt.apply(bt,arguments);return 0===e.length?Cr(this):Rr(this,((e,t)=>t.some((t=>0===e.indexOf(t)))),e,er)}anyOf(){const e=wt.apply(bt,arguments);let t=this._cmp;try{e.sort(t)}catch(e){return Er(this,tr)}if(0===e.length)return Cr(this);const n=new this.Collection(this,(()=>Dr(e[0],e[e.length-1])));n._ondirectionchange=n=>{t="next"===n?this._ascending:this._descending,e.sort(t)};let r=0;return n._addAlgorithm(((n,i,o)=>{const s=n.key;for(;t(s,e[r])>0;)if(++r,r===e.length)return i(o),!1;return 0===t(s,e[r])||(i((()=>{n.continue(e[r])})),!1)})),n}notEqual(e){return this.inAnyRange([[-1/0,e],[e,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})}noneOf(){const e=wt.apply(bt,arguments);if(0===e.length)return new this.Collection(this);try{e.sort(this._ascending)}catch(e){return Er(this,tr)}const t=e.reduce(((e,t)=>e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]),null);return t.push([e[e.length-1],this.db._maxKey]),this.inAnyRange(t,{includeLowers:!1,includeUppers:!1})}inAnyRange(e,t){const n=this._cmp,r=this._ascending,i=this._descending,o=this._min,s=this._max;if(0===e.length)return Cr(this);if(!e.every((e=>void 0!==e[0]&&void 0!==e[1]&&r(e[0],e[1])<=0)))return Er(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Mt.InvalidArgument);const a=!t||!1!==t.includeLowers,u=t&&!0===t.includeUppers;let c,l=r;function h(e,t){return l(e[0],t[0])}try{c=e.reduce((function(e,t){let r=0,i=e.length;for(;r<i;++r){const i=e[r];if(n(t[0],i[1])<0&&n(t[1],i[0])>0){i[0]=o(i[0],t[0]),i[1]=s(i[1],t[1]);break}}return r===i&&e.push(t),e}),[]),c.sort(h)}catch(e){return Er(this,tr)}let f=0;const d=u?e=>r(e,c[f][1])>0:e=>r(e,c[f][1])>=0,p=a?e=>i(e,c[f][0])>0:e=>i(e,c[f][0])>=0;let g=d;const y=new this.Collection(this,(()=>Dr(c[0][0],c[c.length-1][1],!a,!u)));return y._ondirectionchange=e=>{"next"===e?(g=d,l=r):(g=p,l=i),c.sort(h)},y._addAlgorithm(((e,t,n)=>{for(var i=e.key;g(i);)if(++f,f===c.length)return t(n),!1;return!!function(e){return!d(e)&&!p(e)}(i)||(0===this._cmp(i,c[f][1])||0===this._cmp(i,c[f][0])||t((()=>{l===r?e.continue(c[f][0]):e.continue(c[f][1])})),!1)})),y}startsWithAnyOf(){const e=wt.apply(bt,arguments);return e.every((e=>"string"==typeof e))?0===e.length?Cr(this):this.inAnyRange(e.map((e=>[e,e+er]))):Er(this,"startsWithAnyOf() only works with strings")}}function Kr(e){return An((function(t){return Tr(t),e(t.target.error),!1}))}function Tr(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}const Nr=hr(null,"storagemutated");class Mr{_lock(){return nt(!dn.global),++this._reculock,1!==this._reculock||dn.global||(dn.lockOwnerFor=this),this}_unlock(){if(nt(!dn.global),0==--this._reculock)for(dn.global||(dn.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{zn(e[1],e[0])}catch(e){}}return this}_locked(){return this._reculock&&dn.lockOwnerFor!==this}create(e){if(!this.mode)return this;const t=this.db.idbdb,n=this.db._state.dbOpenError;if(nt(!this.idbtrans),!e&&!t)switch(n&&n.name){case"DatabaseClosedError":throw new Mt.DatabaseClosed(n);case"MissingAPIError":throw new Mt.MissingAPI(n.message,n);default:throw new Mt.OpenFailed(n)}if(!this.active)throw new Mt.TransactionInactive;return nt(null===this._completion._state),(e=this.idbtrans=e||(this.db.core?this.db.core.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}):t.transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability}))).onerror=An((t=>{Tr(t),this._reject(e.error)})),e.onabort=An((t=>{Tr(t),this.active&&this._reject(new Mt.Abort(e.error)),this.active=!1,this.on("abort").fire(t)})),e.oncomplete=An((()=>{this.active=!1,this._resolve(),"mutatedParts"in e&&Nr.storagemutated.fire(e.mutatedParts)})),this}_promise(e,t,n){if("readwrite"===e&&"readwrite"!==this.mode)return Xn(new Mt.ReadOnly("Transaction is readonly"));if(!this.active)return Xn(new Mt.TransactionInactive);if(this._locked())return new vn(((r,i)=>{this._blockedFuncs.push([()=>{this._promise(e,t,n).then(r,i)},dn])}));if(n)return In((()=>{var e=new vn(((e,n)=>{this._lock();const r=t(e,n,this);r&&r.then&&r.then(e,n)}));return e.finally((()=>this._unlock())),e._lib=!0,e}));var r=new vn(((e,n)=>{var r=t(e,n,this);r&&r.then&&r.then(e,n)}));return r._lib=!0,r}_root(){return this.parent?this.parent._root():this}waitFor(e){var t=this._root();const n=vn.resolve(e);if(t._waitingFor)t._waitingFor=t._waitingFor.then((()=>n));else{t._waitingFor=n,t._waitingQueue=[];var r=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(r.get(-1/0).onsuccess=e)}()}var i=t._waitingFor;return new vn(((e,r)=>{n.then((n=>t._waitingQueue.push(An(e.bind(null,n)))),(e=>t._waitingQueue.push(An(r.bind(null,e))))).finally((()=>{t._waitingFor===i&&(t._waitingFor=null)}))}))}abort(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new Mt.Abort))}table(e){const t=this._memoizedTables||(this._memoizedTables={});if(He(t,e))return t[e];const n=this.schema[e];if(!n)throw new Mt.NotFound("Table "+e+" not part of transaction");const r=new this.db.Table(e,n,this);return r.core=this.db.core.table(e),t[e]=r,r}}function $r(e,t,n,r,i,o,s){return{name:e,keyPath:t,unique:n,multi:r,auto:i,compound:o,src:(n&&!s?"&":"")+(r?"*":"")+(i?"++":"")+Ir(t)}}function Ir(e){return"string"==typeof e?e:e?"["+[].join.call(e,"+")+"]":""}function Fr(e,t,n){return{name:e,primKey:t,indexes:n,mappedClass:null,idxByName:it(n,(e=>[e.name,e]))}}let Br=e=>{try{return e.only([[]]),Br=()=>[[]],[[]]}catch(e){return Br=()=>er,er}};function qr(e){return null==e?()=>{}:"string"==typeof e?function(e){return 1===e.split(".").length?t=>t[e]:t=>ot(t,e)}(e):t=>ot(t,e)}function Ur(e){return[].slice.call(e)}let Wr=0;function Vr(e){return null==e?":id":"string"==typeof e?e:`[${e.join("+")}]`}function Hr(e,t,n){function r(e){if(3===e.type)return null;if(4===e.type)throw new Error("Cannot convert never type to IDBKeyRange");const{lower:n,upper:r,lowerOpen:i,upperOpen:o}=e;return void 0===n?void 0===r?null:t.upperBound(r,!!o):void 0===r?t.lowerBound(n,!!i):t.bound(n,r,!!i,!!o)}const{schema:i,hasGetAll:o}=function(e,t){const n=Ur(e.objectStoreNames);return{schema:{name:e.name,tables:n.map((e=>t.objectStore(e))).map((e=>{const{keyPath:t,autoIncrement:n}=e,r=qe(t),i=null==t,o={},s={name:e.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:i,compound:r,keyPath:t,autoIncrement:n,unique:!0,extractKey:qr(t)},indexes:Ur(e.indexNames).map((t=>e.index(t))).map((e=>{const{name:t,unique:n,multiEntry:r,keyPath:i}=e,s={name:t,compound:qe(i),keyPath:i,unique:n,multiEntry:r,extractKey:qr(i)};return o[Vr(i)]=s,s})),getIndexByKeyPath:e=>o[Vr(e)]};return o[":id"]=s.primaryKey,null!=t&&(o[Vr(t)]=s.primaryKey),s}))},hasGetAll:n.length>0&&"getAll"in t.objectStore(n[0])&&!("undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)}}(e,n),s=i.tables.map((e=>function(e){const t=e.name;return{name:t,schema:e,mutate:function({trans:e,type:n,keys:i,values:o,range:s}){return new Promise(((a,u)=>{a=An(a);const c=e.objectStore(t),l=null==c.keyPath,h="put"===n||"add"===n;if(!h&&"delete"!==n&&"deleteRange"!==n)throw new Error("Invalid operation type: "+n);const{length:f}=i||o||{length:1};if(i&&o&&i.length!==o.length)throw new Error("Given keys array must have same length as given values array.");if(0===f)return a({numFailures:0,failures:{},results:[],lastResult:void 0});let d;const p=[],g=[];let y=0;const v=e=>{++y,Tr(e)};if("deleteRange"===n){if(4===s.type)return a({numFailures:y,failures:g,results:[],lastResult:void 0});3===s.type?p.push(d=c.clear()):p.push(d=c.delete(r(s)))}else{const[e,t]=h?l?[o,i]:[o,null]:[i,null];if(h)for(let r=0;r<f;++r)p.push(d=t&&void 0!==t[r]?c[n](e[r],t[r]):c[n](e[r])),d.onerror=v;else for(let t=0;t<f;++t)p.push(d=c[n](e[t])),d.onerror=v}const m=e=>{const t=e.target.result;p.forEach(((e,t)=>null!=e.error&&(g[t]=e.error))),a({numFailures:y,failures:g,results:"delete"===n?i:p.map((e=>e.result)),lastResult:t})};d.onerror=e=>{v(e),m(e)},d.onsuccess=m}))},getMany:({trans:e,keys:n})=>new Promise(((r,i)=>{r=An(r);const o=e.objectStore(t),s=n.length,a=new Array(s);let u,c=0,l=0;const h=e=>{const t=e.target;a[t._pos]=t.result,++l===c&&r(a)},f=Kr(i);for(let e=0;e<s;++e)null!=n[e]&&(u=o.get(n[e]),u._pos=e,u.onsuccess=h,u.onerror=f,++c);0===c&&r(a)})),get:({trans:e,key:n})=>new Promise(((r,i)=>{r=An(r);const o=e.objectStore(t).get(n);o.onsuccess=e=>r(e.target.result),o.onerror=Kr(i)})),query:function(e){return n=>new Promise(((i,o)=>{i=An(i);const{trans:s,values:a,limit:u,query:c}=n,l=u===1/0?void 0:u,{index:h,range:f}=c,d=s.objectStore(t),p=h.isPrimaryKey?d:d.index(h.name),g=r(f);if(0===u)return i({result:[]});if(e){const e=a?p.getAll(g,l):p.getAllKeys(g,l);e.onsuccess=e=>i({result:e.target.result}),e.onerror=Kr(o)}else{let e=0;const t=a||!("openKeyCursor"in p)?p.openCursor(g):p.openKeyCursor(g),n=[];t.onsuccess=r=>{const o=t.result;return o?(n.push(a?o.value:o.primaryKey),++e===u?i({result:n}):void o.continue()):i({result:n})},t.onerror=Kr(o)}}))}(o),openCursor:function({trans:e,values:n,query:i,reverse:o,unique:s}){return new Promise(((a,u)=>{a=An(a);const{index:c,range:l}=i,h=e.objectStore(t),f=c.isPrimaryKey?h:h.index(c.name),d=o?s?"prevunique":"prev":s?"nextunique":"next",p=n||!("openKeyCursor"in f)?f.openCursor(r(l),d):f.openKeyCursor(r(l),d);p.onerror=Kr(u),p.onsuccess=An((t=>{const n=p.result;if(!n)return void a(null);n.___id=++Wr,n.done=!1;const r=n.continue.bind(n);let i=n.continuePrimaryKey;i&&(i=i.bind(n));const o=n.advance.bind(n),s=()=>{throw new Error("Cursor not stopped")};n.trans=e,n.stop=n.continue=n.continuePrimaryKey=n.advance=()=>{throw new Error("Cursor not started")},n.fail=An(u),n.next=function(){let e=1;return this.start((()=>e--?this.continue():this.stop())).then((()=>this))},n.start=e=>{const t=new Promise(((e,t)=>{e=An(e),p.onerror=Kr(t),n.fail=t,n.stop=t=>{n.stop=n.continue=n.continuePrimaryKey=n.advance=s,e(t)}})),a=()=>{if(p.result)try{e()}catch(e){n.fail(e)}else n.done=!0,n.start=()=>{throw new Error("Cursor behind last entry")},n.stop()};return p.onsuccess=An((e=>{p.onsuccess=a,a()})),n.continue=r,n.continuePrimaryKey=i,n.advance=o,a(),t},a(n)}),u)}))},count({query:e,trans:n}){const{index:i,range:o}=e;return new Promise(((e,s)=>{const a=n.objectStore(t),u=i.isPrimaryKey?a:a.index(i.name),c=r(o),l=c?u.count(c):u.count();l.onsuccess=An((t=>e(t.target.result))),l.onerror=Kr(s)}))}}}(e))),a={};return s.forEach((e=>a[e.name]=e)),{stack:"dbcore",transaction:e.transaction.bind(e),table(e){if(!a[e])throw new Error(`Table '${e}' not found`);return a[e]},MIN_KEY:-1/0,MAX_KEY:Br(t),schema:i}}function zr({_novip:e},t){const n=t.db,r=function(e,t,{IDBKeyRange:n,indexedDB:r},i){const o=function(e,t){return t.reduce(((e,{create:t})=>({...e,...t(e)})),e)}(Hr(t,n,i),e.dbcore);return{dbcore:o}}(e._middlewares,n,e._deps,t);e.core=r.dbcore,e.tables.forEach((t=>{const n=t.name;e.core.schema.tables.some((e=>e.name===n))&&(t.core=e.core.table(n),e[n]instanceof e.Table&&(e[n].core=t.core))}))}function Yr({_novip:e},t,n,r){n.forEach((n=>{const i=r[n];t.forEach((t=>{const r=Xe(t,n);(!r||"value"in r&&void 0===r.value)&&(t===e.Transaction.prototype||t instanceof e.Transaction?Ge(t,n,{get(){return this.table(n)},set(e){Ye(this,n,{value:e,writable:!0,configurable:!0,enumerable:!0})}}):t[n]=new e.Table(n,i))}))}))}function Gr({_novip:e},t){t.forEach((t=>{for(let n in t)t[n]instanceof e.Table&&delete t[n]}))}function Jr(e,t){return e._cfg.version-t._cfg.version}function Qr(e,t,n,r){const i=e._dbSchema,o=e._createTransaction("readwrite",e._storeNames,i);o.create(n),o._completion.catch(r);const s=o._reject.bind(o),a=dn.transless||dn;In((()=>{dn.trans=o,dn.transless=a,0===t?(Be(i).forEach((e=>{Zr(n,e,i[e].primKey,i[e].indexes)})),zr(e,n),vn.follow((()=>e.on.populate.fire(o))).catch(s)):function({_novip:e},t,n,r){const i=[],o=e._versions;let s=e._dbSchema=ti(0,e.idbdb,r),a=!1;return o.filter((e=>e._cfg.version>=t)).forEach((o=>{i.push((()=>{const i=s,u=o._cfg.dbschema;ni(e,i,r),ni(e,u,r),s=e._dbSchema=u;const c=Xr(i,u);c.add.forEach((e=>{Zr(r,e[0],e[1].primKey,e[1].indexes)})),c.change.forEach((e=>{if(e.recreate)throw new Mt.Upgrade("Not yet support for changing primary key");{const t=r.objectStore(e.name);e.add.forEach((e=>ei(t,e))),e.change.forEach((e=>{t.deleteIndex(e.name),ei(t,e)})),e.del.forEach((e=>t.deleteIndex(e)))}}));const l=o._cfg.contentUpgrade;if(l&&o._cfg.version>t){zr(e,r),n._memoizedTables={},a=!0;let t=at(u);c.del.forEach((e=>{t[e]=i[e]})),Gr(e,[e.Transaction.prototype]),Yr(e,[e.Transaction.prototype],Be(t),t),n.schema=t;const o=_t(l);let s;o&&Fn();const h=vn.follow((()=>{if(s=l(n),s&&o){var e=Bn.bind(null,null);s.then(e,e)}}));return s&&"function"==typeof s.then?vn.resolve(s):h.then((()=>s))}})),i.push((t=>{a&&ir||function(e,t){[].slice.call(t.db.objectStoreNames).forEach((n=>null==e[n]&&t.db.deleteObjectStore(n)))}(o._cfg.dbschema,t),Gr(e,[e.Transaction.prototype]),Yr(e,[e.Transaction.prototype],e._storeNames,e._dbSchema),n.schema=e._dbSchema}))})),function e(){return i.length?vn.resolve(i.shift()(n.idbtrans)).then(e):vn.resolve()}().then((()=>{var e,t;t=r,Be(e=s).forEach((n=>{t.db.objectStoreNames.contains(n)||Zr(t,n,e[n].primKey,e[n].indexes)}))}))}(e,t,o,n).catch(s)}))}function Xr(e,t){const n={del:[],add:[],change:[]};let r;for(r in e)t[r]||n.del.push(r);for(r in t){const i=e[r],o=t[r];if(i){const e={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(""+(i.primKey.keyPath||"")!=""+(o.primKey.keyPath||"")||i.primKey.auto!==o.primKey.auto&&!rr)e.recreate=!0,n.change.push(e);else{const t=i.idxByName,r=o.idxByName;let s;for(s in t)r[s]||e.del.push(s);for(s in r){const n=t[s],i=r[s];n?n.src!==i.src&&e.change.push(i):e.add.push(i)}(e.del.length>0||e.add.length>0||e.change.length>0)&&n.change.push(e)}}else n.add.push([r,o])}return n}function Zr(e,t,n,r){const i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((e=>ei(i,e))),i}function ei(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function ti(e,t,n){const r={};return et(t.objectStoreNames,0).forEach((e=>{const t=n.objectStore(e);let i=t.keyPath;const o=$r(Ir(i),i||"",!1,!1,!!t.autoIncrement,i&&"string"!=typeof i,!0),s=[];for(let e=0;e<t.indexNames.length;++e){const n=t.index(t.indexNames[e]);i=n.keyPath;var a=$r(n.name,i,!!n.unique,!!n.multiEntry,!1,i&&"string"!=typeof i,!1);s.push(a)}r[e]=Fr(e,o,s)})),r}function ni({_novip:e},t,n){const r=n.db.objectStoreNames;for(let i=0;i<r.length;++i){const o=r[i],s=n.objectStore(o);e._hasGetAll="getAll"in s;for(let e=0;e<s.indexNames.length;++e){const n=s.indexNames[e],r=s.index(n).keyPath,i="string"==typeof r?r:"["+et(r).join("+")+"]";if(t[o]){const e=t[o].idxByName[i];e&&(e.name=n,delete t[o].idxByName[i],t[o].idxByName[n]=e)}}}"undefined"!=typeof navigator&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Fe.WorkerGlobalScope&&Fe instanceof Fe.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(e._hasGetAll=!1)}class ri{_parseStoresSpec(e,t){Be(e).forEach((n=>{if(null!==e[n]){var r=e[n].split(",").map(((e,t)=>{const n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;return $r(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),qe(r),0===t)})),i=r.shift();if(i.multi)throw new Mt.Schema("Primary key cannot be multi-valued");r.forEach((e=>{if(e.auto)throw new Mt.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Mt.Schema("Index must have a name and cannot be an empty string")})),t[n]=Fr(n,i,r)}}))}stores(e){const t=this.db;this._cfg.storesSource=this._cfg.storesSource?Ue(this._cfg.storesSource,e):e;const n=t._versions,r={};let i={};return n.forEach((e=>{Ue(r,e._cfg.storesSource),i=e._cfg.dbschema={},e._parseStoresSpec(r,i)})),t._dbSchema=i,Gr(t,[t._allTables,t,t.Transaction.prototype]),Yr(t,[t._allTables,t,t.Transaction.prototype,this._cfg.tables],Be(i),i),t._storeNames=Be(i),this}upgrade(e){return this._cfg.contentUpgrade=Yt(this._cfg.contentUpgrade||Ft,e),this}}function ii(e,t){let n=e._dbNamesDB;return n||(n=e._dbNamesDB=new Oi("__dbnames",{addons:[],indexedDB:e,IDBKeyRange:t}),n.version(1).stores({dbnames:"name"})),n.table("dbnames")}function oi(e){return e&&"function"==typeof e.databases}function si(e){return In((function(){return dn.letThrough=!0,e()}))}function ai(){var e;return!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise((function(t){var n=function(){return indexedDB.databases().finally(t)};e=setInterval(n,100),n()})).finally((function(){return clearInterval(e)})):Promise.resolve()}function ui(e){var t=t=>e.next(t),n=i(t),r=i((t=>e.throw(t)));function i(e){return t=>{var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(n,r):qe(o)?Promise.all(o).then(n,r):n(o)}}return i(t)()}function ci(e,t,n){var r=arguments.length;if(r<2)throw new Mt.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];return n=i.pop(),[e,ct(i),n]}function li(e,t,n,r,i){return vn.resolve().then((()=>{const o=dn.transless||dn,s=e._createTransaction(t,n,e._dbSchema,r),a={trans:s,transless:o};if(r)s.idbtrans=r.idbtrans;else try{s.create(),e._state.PR1398_maxLoop=3}catch(r){return r.name===Tt.InvalidState&&e.isOpen()&&--e._state.PR1398_maxLoop>0?(console.warn("Dexie: Need to reopen db"),e._close(),e.open().then((()=>li(e,t,n,null,i)))):Xn(r)}const u=_t(i);let c;u&&Fn();const l=vn.follow((()=>{if(c=i.call(s,s),c)if(u){var e=Bn.bind(null,null);c.then(e,e)}else"function"==typeof c.next&&"function"==typeof c.throw&&(c=ui(c))}),a);return(c&&"function"==typeof c.then?vn.resolve(c).then((e=>s.active?e:Xn(new Mt.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn")))):l.then((()=>c))).then((e=>(r&&s._resolve(),s._completion.then((()=>e))))).catch((e=>(s._reject(e),Xn(e))))}))}function hi(e,t,n){const r=qe(e)?e.slice():[e];for(let e=0;e<n;++e)r.push(t);return r}const fi={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(e){return{...e,table(t){const n=e.table(t),{schema:r}=n,i={},o=[];function s(e,t,n){const r=Vr(e),a=i[r]=i[r]||[],u=null==e?0:"string"==typeof e?1:e.length,c=t>0,l={...n,isVirtual:c,keyTail:t,keyLength:u,extractKey:qr(e),unique:!c&&n.unique};return a.push(l),l.isPrimaryKey||o.push(l),u>1&&s(2===u?e[0]:e.slice(0,u-1),t+1,n),a.sort(((e,t)=>e.keyTail-t.keyTail)),l}const a=s(r.primaryKey.keyPath,0,r.primaryKey);i[":id"]=[a];for(const e of r.indexes)s(e.keyPath,0,e);function u(t){const n=t.query.index;return n.isVirtual?{...t,query:{index:n,range:(r=t.query.range,i=n.keyTail,{type:1===r.type?2:r.type,lower:hi(r.lower,r.lowerOpen?e.MAX_KEY:e.MIN_KEY,i),lowerOpen:!0,upper:hi(r.upper,r.upperOpen?e.MIN_KEY:e.MAX_KEY,i),upperOpen:!0})}}:t;var r,i}const c={...n,schema:{...r,primaryKey:a,indexes:o,getIndexByKeyPath:function(e){const t=i[Vr(e)];return t&&t[0]}},count:e=>n.count(u(e)),query:e=>n.query(u(e)),openCursor(t){const{keyTail:r,isVirtual:i,keyLength:o}=t.query.index;return i?n.openCursor(u(t)).then((n=>n&&function(n){const i=Object.create(n,{continue:{value:function(i){null!=i?n.continue(hi(i,t.reverse?e.MAX_KEY:e.MIN_KEY,r)):t.unique?n.continue(n.key.slice(0,o).concat(t.reverse?e.MIN_KEY:e.MAX_KEY,r)):n.continue()}},continuePrimaryKey:{value(t,i){n.continuePrimaryKey(hi(t,e.MAX_KEY,r),i)}},primaryKey:{get:()=>n.primaryKey},key:{get(){const e=n.key;return 1===o?e[0]:e.slice(0,o)}},value:{get:()=>n.value}});return i}(n))):n.openCursor(t)}};return c}}}};function di(e,t,n,r){return n=n||{},r=r||"",Be(e).forEach((i=>{if(He(t,i)){var o=e[i],s=t[i];if("object"==typeof o&&"object"==typeof s&&o&&s){const e=yt(o);e!==yt(s)?n[r+i]=t[i]:"Object"===e?di(o,s,n,r+i+"."):o!==s&&(n[r+i]=t[i])}else o!==s&&(n[r+i]=t[i])}else n[r+i]=void 0})),Be(t).forEach((i=>{He(e,i)||(n[r+i]=t[i])})),n}const pi={stack:"dbcore",name:"HooksMiddleware",level:2,create:e=>({...e,table(t){const n=e.table(t),{primaryKey:r}=n.schema,i={...n,mutate(e){const i=dn.trans,{deleting:o,creating:s,updating:a}=i.table(t).hook;switch(e.type){case"add":if(s.fire===Ft)break;return i._promise("readwrite",(()=>u(e)),!0);case"put":if(s.fire===Ft&&a.fire===Ft)break;return i._promise("readwrite",(()=>u(e)),!0);case"delete":if(o.fire===Ft)break;return i._promise("readwrite",(()=>u(e)),!0);case"deleteRange":if(o.fire===Ft)break;return i._promise("readwrite",(()=>function(e){return c(e.trans,e.range,1e4)}(e)),!0)}return n.mutate(e);function u(e){const t=dn.trans,i=e.keys||function(e,t){return"delete"===t.type?t.keys:t.keys||t.values.map(e.extractKey)}(r,e);if(!i)throw new Error("Keys missing");return"delete"!==(e="add"===e.type||"put"===e.type?{...e,keys:i}:{...e}).type&&(e.values=[...e.values]),e.keys&&(e.keys=[...e.keys]),function(e,t,n){return"add"===t.type?Promise.resolve([]):e.getMany({trans:t.trans,keys:n,cache:"immutable"})}(n,e,i).then((u=>{const c=i.map(((n,i)=>{const c=u[i],l={onerror:null,onsuccess:null};if("delete"===e.type)o.fire.call(l,n,c,t);else if("add"===e.type||void 0===c){const o=s.fire.call(l,n,e.values[i],t);null==n&&null!=o&&(n=o,e.keys[i]=n,r.outbound||st(e.values[i],r.keyPath,n))}else{const r=di(c,e.values[i]),o=a.fire.call(l,r,n,c,t);if(o){const t=e.values[i];Object.keys(o).forEach((e=>{He(t,e)?t[e]=o[e]:st(t,e,o[e])}))}}return l}));return n.mutate(e).then((({failures:t,results:n,numFailures:r,lastResult:o})=>{for(let r=0;r<i.length;++r){const o=n?n[r]:i[r],s=c[r];null==o?s.onerror&&s.onerror(t[r]):s.onsuccess&&s.onsuccess("put"===e.type&&u[r]?e.values[r]:o)}return{failures:t,results:n,numFailures:r,lastResult:o}})).catch((e=>(c.forEach((t=>t.onerror&&t.onerror(e))),Promise.reject(e))))}))}function c(e,t,i){return n.query({trans:e,values:!1,query:{index:r,range:t},limit:i}).then((({result:n})=>u({type:"delete",keys:n,trans:e}).then((r=>r.numFailures>0?Promise.reject(r.failures[0]):n.length<i?{failures:[],numFailures:0,lastResult:void 0}:c(e,{...t,lower:n[n.length-1],lowerOpen:!0},i)))))}}};return i}})};function gi(e,t,n){try{if(!t)return null;if(t.keys.length<e.length)return null;const r=[];for(let i=0,o=0;i<t.keys.length&&o<e.length;++i)0===wr(t.keys[i],e[o])&&(r.push(n?dt(t.values[i]):t.values[i]),++o);return r.length===e.length?r:null}catch(e){return null}}const yi={stack:"dbcore",level:-1,create:e=>({table:t=>{const n=e.table(t);return{...n,getMany:e=>{if(!e.cache)return n.getMany(e);const t=gi(e.keys,e.trans._cache,"clone"===e.cache);return t?vn.resolve(t):n.getMany(e).then((t=>(e.trans._cache={keys:e.keys,values:"clone"===e.cache?dt(t):t},t)))},mutate:e=>("add"!==e.type&&(e.trans._cache=null),n.mutate(e))}}})};function vi(e){return!("from"in e)}const mi=function(e,t){if(!this){const t=new mi;return e&&"d"in e&&Ue(t,e),t}Ue(this,arguments.length?{d:1,from:e,to:arguments.length>1?t:e}:{d:0})};function bi(e,t,n){const r=wr(t,n);if(isNaN(r))return;if(r>0)throw RangeError();if(vi(e))return Ue(e,{from:t,to:n,d:1});const i=e.l,o=e.r;if(wr(n,e.from)<0)return i?bi(i,t,n):e.l={from:t,to:n,d:1,l:null,r:null},ki(e);if(wr(t,e.to)>0)return o?bi(o,t,n):e.r={from:t,to:n,d:1,l:null,r:null},ki(e);wr(t,e.from)<0&&(e.from=t,e.l=null,e.d=o?o.d+1:1),wr(n,e.to)>0&&(e.to=n,e.r=null,e.d=e.l?e.l.d+1:1);const s=!e.r;i&&!e.l&&wi(e,i),o&&s&&wi(e,o)}function wi(e,t){vi(t)||function e(t,{from:n,to:r,l:i,r:o}){bi(t,n,r),i&&e(t,i),o&&e(t,o)}(e,t)}function _i(e){let t=vi(e)?null:{s:0,n:e};return{next(e){const n=arguments.length>0;for(;t;)switch(t.s){case 0:if(t.s=1,n)for(;t.n.l&&wr(e,t.n.from)<0;)t={up:t,n:t.n.l,s:1};else for(;t.n.l;)t={up:t,n:t.n.l,s:1};case 1:if(t.s=2,!n||wr(e,t.n.to)<=0)return{value:t.n,done:!1};case 2:if(t.n.r){t.s=3,t={up:t,n:t.n.r,s:0};continue}case 3:t=t.up}return{done:!0}}}}function ki(e){var t,n;const r=((null===(t=e.r)||void 0===t?void 0:t.d)||0)-((null===(n=e.l)||void 0===n?void 0:n.d)||0),i=r>1?"r":r<-1?"l":"";if(i){const t="r"===i?"l":"r",n={...e},r=e[i];e.from=r.from,e.to=r.to,e[i]=r[i],n[i]=r[t],e[t]=n,n.d=xi(n)}e.d=xi(e)}function xi({r:e,l:t}){return(e?t?Math.max(e.d,t.d):e.d:t?t.d:0)+1}ze(mi.prototype,{add(e){return wi(this,e),this},addKey(e){return bi(this,e,e),this},addKeys(e){return e.forEach((e=>bi(this,e,e))),this},[vt](){return _i(this)}});const Si={stack:"dbcore",level:0,create:e=>{const t=e.schema.name,n=new mi(e.MIN_KEY,e.MAX_KEY);return{...e,table:r=>{const i=e.table(r),{schema:o}=i,{primaryKey:s}=o,{extractKey:a,outbound:u}=s,c={...i,mutate:e=>{const s=e.trans,a=s.mutatedParts||(s.mutatedParts={}),u=e=>{const n=`idb://${t}/${r}/${e}`;return a[n]||(a[n]=new mi)},c=u(""),l=u(":dels"),{type:h}=e;let[f,d]="deleteRange"===e.type?[e.range]:"delete"===e.type?[e.keys]:e.values.length<50?[[],e.values]:[];const p=e.trans._cache;return i.mutate(e).then((e=>{if(qe(f)){"delete"!==h&&(f=e.results),c.addKeys(f);const t=gi(f,p);t||"add"===h||l.addKeys(f),(t||d)&&function(e,t,n,r){t.indexes.forEach((function(t){const i=e(t.name||"");function o(e){return null!=e?t.extractKey(e):null}const s=e=>t.multiEntry&&qe(e)?e.forEach((e=>i.addKey(e))):i.addKey(e);(n||r).forEach(((e,t)=>{const i=n&&o(n[t]),a=r&&o(r[t]);0!==wr(i,a)&&(null!=i&&s(i),null!=a&&s(a))}))}))}(u,o,t,d)}else if(f){const e={from:f.lower,to:f.upper};l.add(e),c.add(e)}else c.add(n),l.add(n),o.indexes.forEach((e=>u(e.name).add(n)));return e}))}},l=({query:{index:t,range:n}})=>{var r,i;return[t,new mi(null!==(r=n.lower)&&void 0!==r?r:e.MIN_KEY,null!==(i=n.upper)&&void 0!==i?i:e.MAX_KEY)]},h={get:e=>[s,new mi(e.key)],getMany:e=>[s,(new mi).addKeys(e.keys)],count:l,query:l,openCursor:l};return Be(h).forEach((e=>{c[e]=function(o){const{subscr:s}=dn;if(s){const c=e=>{const n=`idb://${t}/${r}/${e}`;return s[n]||(s[n]=new mi)},l=c(""),f=c(":dels"),[d,p]=h[e](o);if(c(d.name||"").add(p),!d.isPrimaryKey){if("count"!==e){const t="query"===e&&u&&o.values&&i.query({...o,values:!1});return i[e].apply(this,arguments).then((n=>{if("query"===e){if(u&&o.values)return t.then((({result:e})=>(l.addKeys(e),n)));const e=o.values?n.result.map(a):n.result;o.values?l.addKeys(e):f.addKeys(e)}else if("openCursor"===e){const e=n,t=o.values;return e&&Object.create(e,{key:{get:()=>(f.addKey(e.primaryKey),e.key)},primaryKey:{get(){const t=e.primaryKey;return f.addKey(t),t}},value:{get:()=>(t&&l.addKey(e.primaryKey),e.value)}})}return n}))}f.add(n)}}return i[e].apply(this,arguments)}})),c}}}};class Oi{constructor(e,t){this._middlewares={},this.verno=0;const n=Oi.dependencies;this._options=t={addons:Oi.addons,autoOpen:!0,indexedDB:n.indexedDB,IDBKeyRange:n.IDBKeyRange,...t},this._deps={indexedDB:t.indexedDB,IDBKeyRange:t.IDBKeyRange};const{addons:r}=t;this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this;const i={dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ft,dbReadyPromise:null,cancelOpen:Ft,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3};var o;i.dbReadyPromise=new vn((e=>{i.dbReadyResolve=e})),i.openCanceller=new vn(((e,t)=>{i.cancelOpen=t})),this._state=i,this.name=e,this.on=hr(this,"populate","blocked","versionchange","close",{ready:[Yt,Ft]}),this.on.ready.subscribe=tt(this.on.ready.subscribe,(e=>(t,n)=>{Oi.vip((()=>{const r=this._state;if(r.openComplete)r.dbOpenError||vn.resolve().then(t),n&&e(t);else if(r.onReadyBeingFired)r.onReadyBeingFired.push(t),n&&e(t);else{e(t);const r=this;n||e((function e(){r.on.ready.unsubscribe(t),r.on.ready.unsubscribe(e)}))}}))})),this.Collection=(o=this,fr(xr.prototype,(function(e,t){this.db=o;let n=ur,r=null;if(t)try{n=t()}catch(e){r=e}const i=e._ctx,s=i.table,a=s.hook.reading.fire;this._ctx={table:s,index:i.index,isPrimKey:!i.index||s.schema.primKey.keyPath&&i.index===s.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:a!==Bt?a:null}}))),this.Table=function(e){return fr(lr.prototype,(function(t,n,r){this.db=e,this._tx=r,this.name=t,this.schema=n,this.hook=e._allTables[t]?e._allTables[t].hook:hr(null,{creating:[Wt,Ft],reading:[qt,Bt],updating:[Ht,Ft],deleting:[Vt,Ft]})}))}(this),this.Transaction=function(e){return fr(Mr.prototype,(function(t,n,r,i,o){this.db=e,this.mode=t,this.storeNames=n,this.schema=r,this.chromeTransactionDurability=i,this.idbtrans=null,this.on=hr(this,"complete","error","abort"),this.parent=o||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 vn(((e,t)=>{this._resolve=e,this._reject=t})),this._completion.then((()=>{this.active=!1,this.on.complete.fire()}),(e=>{var t=this.active;return this.active=!1,this.on.error.fire(e),this.parent?this.parent._reject(e):t&&this.idbtrans&&this.idbtrans.abort(),Xn(e)}))}))}(this),this.Version=function(e){return fr(ri.prototype,(function(t){this.db=e,this._cfg={version:t,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}}))}(this),this.WhereClause=function(e){return fr(Lr.prototype,(function(t,n,r){this.db=e,this._ctx={table:t,index:":id"===n?null:n,or:r};const i=e._deps.indexedDB;if(!i)throw new Mt.MissingAPI;this._cmp=this._ascending=i.cmp.bind(i),this._descending=(e,t)=>i.cmp(t,e),this._max=(e,t)=>i.cmp(e,t)>0?e:t,this._min=(e,t)=>i.cmp(e,t)<0?e:t,this._IDBKeyRange=e._deps.IDBKeyRange}))}(this),this.on("versionchange",(e=>{e.newVersion>0?console.warn(`Another connection wants to upgrade database '${this.name}'. Closing db now to resume the upgrade.`):console.warn(`Another connection wants to delete database '${this.name}'. Closing db now to resume the delete request.`),this.close()})),this.on("blocked",(e=>{!e.newVersion||e.newVersion<e.oldVersion?console.warn(`Dexie.delete('${this.name}') was blocked`):console.warn(`Upgrade '${this.name}' blocked by other connection holding version ${e.oldVersion/10}`)})),this._maxKey=Br(t.IDBKeyRange),this._createTransaction=(e,t,n,r)=>new this.Transaction(e,t,n,this._options.chromeTransactionDurability,r),this._fireOnBlocked=e=>{this.on("blocked").fire(e),nr.filter((e=>e.name===this.name&&e!==this&&!e._state.vcFired)).map((t=>t.on("versionchange").fire(e)))},this.use(fi),this.use(pi),this.use(Si),this.use(yi),this.vip=Object.create(this,{_vip:{value:!0}}),r.forEach((e=>e(this)))}version(e){if(isNaN(e)||e<.1)throw new Mt.Type("Given version is not a positive number");if(e=Math.round(10*e)/10,this.idbdb||this._state.isBeingOpened)throw new Mt.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);const t=this._versions;var n=t.filter((t=>t._cfg.version===e))[0];return n||(n=new this.Version(e),t.push(n),t.sort(Jr),n.stores({}),this._state.autoSchema=!1,n)}_whenReady(e){return this.idbdb&&(this._state.openComplete||dn.letThrough||this._vip)?e():new vn(((e,t)=>{if(this._state.openComplete)return t(new Mt.DatabaseClosed(this._state.dbOpenError));if(!this._state.isBeingOpened){if(!this._options.autoOpen)return void t(new Mt.DatabaseClosed);this.open().catch(Ft)}this._state.dbReadyPromise.then(e,t)})).then(e)}use({stack:e,create:t,level:n,name:r}){r&&this.unuse({stack:e,name:r});const i=this._middlewares[e]||(this._middlewares[e]=[]);return i.push({stack:e,create:t,level:null==n?10:n,name:r}),i.sort(((e,t)=>e.level-t.level)),this}unuse({stack:e,name:t,create:n}){return e&&this._middlewares[e]&&(this._middlewares[e]=this._middlewares[e].filter((e=>n?e.create!==n:!!t&&e.name!==t))),this}open(){return function(e){const t=e._state,{indexedDB:n}=e._deps;if(t.isBeingOpened||e.idbdb)return t.dbReadyPromise.then((()=>t.dbOpenError?Xn(t.dbOpenError):e));kt&&(t.openCanceller._stackHolder=Pt()),t.isBeingOpened=!0,t.dbOpenError=null,t.openComplete=!1;const r=t.openCanceller;function i(){if(t.openCanceller!==r)throw new Mt.DatabaseClosed("db.open() was cancelled")}let o=t.dbReadyResolve,s=null,a=!1;return vn.race([r,("undefined"==typeof navigator?vn.resolve():ai()).then((()=>new vn(((r,o)=>{if(i(),!n)throw new Mt.MissingAPI;const u=e.name,c=t.autoSchema?n.open(u):n.open(u,Math.round(10*e.verno));if(!c)throw new Mt.MissingAPI;c.onerror=Kr(o),c.onblocked=An(e._fireOnBlocked),c.onupgradeneeded=An((r=>{if(s=c.transaction,t.autoSchema&&!e._options.allowEmptyDB){c.onerror=Tr,s.abort(),c.result.close();const e=n.deleteDatabase(u);e.onsuccess=e.onerror=An((()=>{o(new Mt.NoSuchDatabase(`Database ${u} doesnt exist`))}))}else{s.onerror=Kr(o);var i=r.oldVersion>Math.pow(2,62)?0:r.oldVersion;a=i<1,e._novip.idbdb=c.result,Qr(e,i/10,s,o)}}),o),c.onsuccess=An((()=>{s=null;const n=e._novip.idbdb=c.result,i=et(n.objectStoreNames);if(i.length>0)try{const r=n.transaction(1===(o=i).length?o[0]:o,"readonly");t.autoSchema?function({_novip:e},t,n){e.verno=t.version/10;const r=e._dbSchema=ti(0,t,n);e._storeNames=et(t.objectStoreNames,0),Yr(e,[e._allTables],Be(r),r)}(e,n,r):(ni(e,e._dbSchema,r),function(e,t){const n=Xr(ti(0,e.idbdb,t),e._dbSchema);return!(n.add.length||n.change.some((e=>e.add.length||e.change.length)))}(e,r)||console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Some queries may fail.")),zr(e,r)}catch(e){}var o;nr.push(e),n.onversionchange=An((n=>{t.vcFired=!0,e.on("versionchange").fire(n)})),n.onclose=An((t=>{e.on("close").fire(t)})),a&&function({indexedDB:e,IDBKeyRange:t},n){!oi(e)&&"__dbnames"!==n&&ii(e,t).put({name:n}).catch(Ft)}(e._deps,u),r()}),o)}))))]).then((()=>(i(),t.onReadyBeingFired=[],vn.resolve(si((()=>e.on.ready.fire(e.vip)))).then((function n(){if(t.onReadyBeingFired.length>0){let r=t.onReadyBeingFired.reduce(Yt,Ft);return t.onReadyBeingFired=[],vn.resolve(si((()=>r(e.vip)))).then(n)}}))))).finally((()=>{t.onReadyBeingFired=null,t.isBeingOpened=!1})).then((()=>e)).catch((n=>{t.dbOpenError=n;try{s&&s.abort()}catch(e){}return r===t.openCanceller&&e._close(),Xn(n)})).finally((()=>{t.openComplete=!0,o()}))}(this)}_close(){const e=this._state,t=nr.indexOf(this);if(t>=0&&nr.splice(t,1),this.idbdb){try{this.idbdb.close()}catch(e){}this._novip.idbdb=null}e.dbReadyPromise=new vn((t=>{e.dbReadyResolve=t})),e.openCanceller=new vn(((t,n)=>{e.cancelOpen=n}))}close(){this._close();const e=this._state;this._options.autoOpen=!1,e.dbOpenError=new Mt.DatabaseClosed,e.isBeingOpened&&e.cancelOpen(e.dbOpenError)}delete(){const e=arguments.length>0,t=this._state;return new vn(((n,r)=>{const i=()=>{this.close();var e=this._deps.indexedDB.deleteDatabase(this.name);e.onsuccess=An((()=>{!function({indexedDB:e,IDBKeyRange:t},n){!oi(e)&&"__dbnames"!==n&&ii(e,t).delete(n).catch(Ft)}(this._deps,this.name),n()})),e.onerror=Kr(r),e.onblocked=this._fireOnBlocked};if(e)throw new Mt.InvalidArgument("Arguments not allowed in db.delete()");t.isBeingOpened?t.dbReadyPromise.then(i):i()}))}backendDB(){return this.idbdb}isOpen(){return null!==this.idbdb}hasBeenClosed(){const e=this._state.dbOpenError;return e&&"DatabaseClosed"===e.name}hasFailed(){return null!==this._state.dbOpenError}dynamicallyOpened(){return this._state.autoSchema}get tables(){return Be(this._allTables).map((e=>this._allTables[e]))}transaction(){const e=ci.apply(this,arguments);return this._transaction.apply(this,e)}_transaction(e,t,n){let r=dn.trans;r&&r.db===this&&-1===e.indexOf("!")||(r=null);const i=-1!==e.indexOf("?");let o,s;e=e.replace("!","").replace("?","");try{if(s=t.map((e=>{var t=e instanceof this.Table?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t})),"r"==e||"readonly"===e)o="readonly";else{if("rw"!=e&&"readwrite"!=e)throw new Mt.InvalidArgument("Invalid transaction mode: "+e);o="readwrite"}if(r){if("readonly"===r.mode&&"readwrite"===o){if(!i)throw new Mt.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&s.forEach((e=>{if(r&&-1===r.storeNames.indexOf(e)){if(!i)throw new Mt.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,((t,n)=>{n(e)})):Xn(e)}const a=li.bind(null,this,o,s,r,n);return r?r._promise(o,a,"lock"):dn.trans?zn(dn.transless,(()=>this._whenReady(a))):this._whenReady(a)}table(e){if(!He(this._allTables,e))throw new Mt.InvalidTable(`Table ${e} does not exist`);return this._allTables[e]}}const Pi="undefined"!=typeof Symbol&&"observable"in Symbol?Symbol.observable:"@@observable";class Ei{constructor(e){this._subscribe=e}subscribe(e,t,n){return this._subscribe(e&&"function"!=typeof e?e:{next:e,error:t,complete:n})}[Pi](){return this}}function Ci(e,t){return Be(t).forEach((n=>{wi(e[n]||(e[n]=new mi),t[n])})),e}let ji;try{ji={indexedDB:Fe.indexedDB||Fe.mozIndexedDB||Fe.webkitIndexedDB||Fe.msIndexedDB,IDBKeyRange:Fe.IDBKeyRange||Fe.webkitIDBKeyRange}}catch(Fe){ji={indexedDB:null,IDBKeyRange:null}}const Ri=Oi;function Di(e){let t=Ai;try{Ai=!0,Nr.storagemutated.fire(e)}finally{Ai=t}}ze(Ri,{...It,delete:e=>new Ri(e,{addons:[]}).delete(),exists:e=>new Ri(e,{addons:[]}).open().then((e=>(e.close(),!0))).catch("NoSuchDatabaseError",(()=>!1)),getDatabaseNames(e){try{return function({indexedDB:e,IDBKeyRange:t}){return oi(e)?Promise.resolve(e.databases()).then((e=>e.map((e=>e.name)).filter((e=>"__dbnames"!==e)))):ii(e,t).toCollection().primaryKeys()}(Ri.dependencies).then(e)}catch(e){return Xn(new Mt.MissingAPI)}},defineClass:()=>function(e){Ue(this,e)},ignoreTransaction:e=>dn.trans?zn(dn.transless,e):e(),vip:si,async:function(e){return function(){try{var t=ui(e.apply(this,arguments));return t&&"function"==typeof t.then?t:vn.resolve(t)}catch(e){return Xn(e)}}},spawn:function(e,t,n){try{var r=ui(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:vn.resolve(r)}catch(e){return Xn(e)}},currentTransaction:{get:()=>dn.trans||null},waitFor:function(e,t){const n=vn.resolve("function"==typeof e?Ri.ignoreTransaction(e):e).timeout(t||6e4);return dn.trans?dn.trans.waitFor(n):n},Promise:vn,debug:{get:()=>kt,set:e=>{xt(e,"dexie"===e?()=>!0:sr)}},derive:Je,extend:Ue,props:ze,override:tt,Events:hr,on:Nr,liveQuery:function(e){return new Ei((t=>{const n=_t(e);let r=!1,i={},o={};const s={get closed(){return r},unsubscribe:()=>{r=!0,Nr.storagemutated.unsubscribe(l)}};t.start&&t.start(s);let a=!1,u=!1;function c(){return Be(o).some((e=>i[e]&&function(e,t){const n=_i(t);let r=n.next();if(r.done)return!1;let i=r.value;const o=_i(e);let s=o.next(i.from),a=s.value;for(;!r.done&&!s.done;){if(wr(a.from,i.to)<=0&&wr(a.to,i.from)>=0)return!0;wr(i.from,a.from)<0?i=(r=n.next(a.from)).value:a=(s=o.next(i.from)).value}return!1}(i[e],o[e])))}const l=e=>{Ci(i,e),c()&&h()},h=()=>{if(a||r)return;i={};const f={},d=function(t){n&&Fn();const r=()=>In(e,{subscr:t,trans:null}),i=dn.trans?zn(dn.transless,r):r();return n&&i.then(Bn,Bn),i}(f);u||(Nr("storagemutated",l),u=!0),a=!0,Promise.resolve(d).then((e=>{a=!1,r||(c()?h():(i={},o=f,t.next&&t.next(e)))}),(e=>{a=!1,t.error&&t.error(e),s.unsubscribe()}))};return h(),s}))},extendObservabilitySet:Ci,getByKeyPath:ot,setByKeyPath:st,delByKeyPath:function(e,t){"string"==typeof t?st(e,t,void 0):"length"in t&&[].map.call(t,(function(t){st(e,t,void 0)}))},shallowClone:at,deepClone:dt,getObjectDiff:di,cmp:wr,asap:rt,minKey:-1/0,addons:[],connections:nr,errnames:Tt,dependencies:ji,semVer:"3.2.3",version:"3.2.3".split(".").map((e=>parseInt(e))).reduce(((e,t,n)=>e+t/Math.pow(10,2*n)))}),Ri.maxKey=Br(Ri.dependencies.IDBKeyRange),"undefined"!=typeof dispatchEvent&&"undefined"!=typeof addEventListener&&(Nr("storagemutated",(e=>{if(!Ai){let t;rr?(t=document.createEvent("CustomEvent"),t.initCustomEvent("x-storagemutated-1",!0,!0,e)):t=new CustomEvent("x-storagemutated-1",{detail:e}),Ai=!0,dispatchEvent(t),Ai=!1}})),addEventListener("x-storagemutated-1",(({detail:e})=>{Ai||Di(e)})));let Ai=!1;if("undefined"!=typeof BroadcastChannel){const e=new BroadcastChannel("x-storagemutated-1");"function"==typeof e.unref&&e.unref(),Nr("storagemutated",(t=>{Ai||e.postMessage(t)})),e.onmessage=e=>{e.data&&Di(e.data)}}else if("undefined"!=typeof self&&"undefined"!=typeof navigator){Nr("storagemutated",(e=>{try{Ai||("undefined"!=typeof localStorage&&localStorage.setItem("x-storagemutated-1",JSON.stringify({trig:Math.random(),changedParts:e})),"object"==typeof self.clients&&[...self.clients.matchAll({includeUncontrolled:!0})].forEach((t=>t.postMessage({type:"x-storagemutated-1",changedParts:e}))))}catch(e){}})),"undefined"!=typeof addEventListener&&addEventListener("storage",(e=>{if("x-storagemutated-1"===e.key){const t=JSON.parse(e.newValue);t&&Di(t.changedParts)}}));const e=self.document&&navigator.serviceWorker;e&&e.addEventListener("message",(function({data:e}){e&&"x-storagemutated-1"===e.type&&Di(e.changedParts)}))}vn.rejectionMapper=function(e,t){if(!e||e instanceof Dt||e instanceof TypeError||e instanceof SyntaxError||!e.name||!$t[e.name])return e;var n=new $t[e.name](t||e.message,e);return"stack"in e&&Ge(n,"stack",{get:function(){return this.inner.stack}}),n},xt(kt,sr);class Li extends Oi{constructor(){var e,t;super("ServiceWorker"),t=void 0,(e="dynamicRouteRegistrations")in this?Object.defineProperty(this,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):this[e]=t,this.version(1).stores({dynamicRouteRegistrations:"++,&pattern"}),this.dynamicRouteRegistrations=this.table("dynamicRouteRegistrations")}}function Ki(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function Ti(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Ki(o,r,i,s,a,"next",e)}function a(e){Ki(o,r,i,s,a,"throw",e)}s(void 0)}))}}function Ni(){return Ni=Ti((function*(e){const t=yield function(e){return Ie.apply(this,arguments)}(e);yield function(e){return Ii.apply(this,arguments)}(t),yield Mi(t)})),Ni.apply(this,arguments)}function Mi(e){return $i.apply(this,arguments)}function $i(){return $i=Ti((function*(e){if(0===e.length)return;const t=yield caches.open(_e),n=yield Promise.all(e.map((r=Ti((function*(e){try{return yield function(e){return A.apply(this,arguments)}((()=>t.add(e)),{onError:(t,n)=>console.debug(`[SW] Failure attempt ${n} at caching "${e}". Error: `,t)}),{url:e,success:!0}}catch(t){return{url:e,success:!1}}})),function(e){return r.apply(this,arguments)})));var r;const i=n.filter((e=>e.success)),o=n.filter((e=>!e.success));i.length>0&&console.debug(`[SW] Successfully added ${i.length} URLs to the OMRS cache. URLs: `,i.map((e=>e.url))),o.length>0&&console.error(`[SW] Failed to cache ${o.length} URLs. URLs: `,o.map((e=>e.url)))})),$i.apply(this,arguments)}function Ii(){return Ii=Ti((function*(e){const t=yield caches.open(_e),n=(yield t.keys()).map((e=>e.url)),r=yield(new Li).dynamicRouteRegistrations.toArray(),i=n.filter((t=>!Se.includes(t)&&!e.includes(t)&&!r.some((e=>new RegExp(e.pattern).test(t)))));console.info("[SW] Removing the following expired URLs from the cache: ",i),console.debug("[SW] The following URLs were known and not invalidated: ",Se,e,r),yield Promise.all(i.map((e=>t.delete(e))))})),Ii.apply(this,arguments)}function Fi(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function Bi(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Fi(o,r,i,s,a,"next",e)}function a(e){Fi(o,r,i,s,a,"throw",e)}s(void 0)}))}}const qi={onImportMapChanged:function(e){return Ui.apply(this,arguments)},clearDynamicRoutes:function(){return Wi.apply(this,arguments)},registerDynamicRoute:function(e){return Vi.apply(this,arguments)}};function Ui(){return Ui=Bi((function*({importMap:e}){yield function(e){return Ni.apply(this,arguments)}(e)})),Ui.apply(this,arguments)}function Wi(){return(Wi=Bi((function*(){yield(new Li).dynamicRouteRegistrations.clear()}))).apply(this,arguments)}function Vi(){return(Vi=Bi((function*({pattern:e,url:t,strategy:n}){let r=e;if(!r&&t&&(r=`^${j(t)}$`),r){const e={pattern:r,strategy:n};yield(new Li).dynamicRouteRegistrations.put(e)}}))).apply(this,arguments)}function Hi(){return Hi=Bi((function*(e){var t,n,r;const i=qi[null!==(r=null===(t=e.data)||void 0===t||null===(n=t.type)||void 0===n?void 0:n.toString())&&void 0!==r?r:""];var o;if(i)try{c({success:!0,result:yield i(e.data)})}catch(e){var s,a;u(null!==(a=null!==(s=null==e?void 0:e.message)&&void 0!==s?s:null==e?void 0:e.toString())&&void 0!==a?a:"Unknown error.")}else u(`Received an unknown message of type "${null===(o=e.data)||void 0===o?void 0:o.type} which cannot be handled.`);function u(e){console.warn("[SW] Handling a message resulted in an error.",e),c({success:!1,error:e})}function c(t){e.ports[0].postMessage(null!=t?t:{})}})),Hi.apply(this,arguments)}n(664);const zi=["DELETE","GET","HEAD","PATCH","POST","PUT"],Yi=e=>e&&"object"==typeof e?e:{handle:e};let Gi,Ji=class{setCatchHandler(e){this.catchHandler=Yi(e)}constructor(e,t,n="GET"){this.handler=Yi(t),this.match=e,this.method=n}},Qi=class extends Ji{constructor(e,t,n){super((({url:t})=>{const n=e.exec(t.href);if(n&&(t.origin===location.origin||0===n.index))return n.slice(1)}),t,n)}};function Xi(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}const Zi=()=>(Gi||(Gi=new class{get routes(){return this._routes}addFetchListener(){self.addEventListener("fetch",(e=>{const{request:t}=e,n=this.handleRequest({request:t,event:e});n&&e.respondWith(n)}))}addCacheListener(){self.addEventListener("message",(e=>{if(e.data&&"CACHE_URLS"===e.data.type){const{payload:t}=e.data,n=Promise.all(t.urlsToCache.map((t=>{"string"==typeof t&&(t=[t]);const n=new Request(...t);return this.handleRequest({request:n,event:e})})));e.waitUntil(n),e.ports&&e.ports[0]&&n.then((()=>e.ports[0].postMessage(!0)))}}))}handleRequest({request:e,event:t}){const n=new URL(e.url,location.href);if(!n.protocol.startsWith("http"))return;const r=n.origin===location.origin,{params:i,route:o}=this.findMatchingRoute({event:t,request:e,sameOrigin:r,url:n});let s=o&&o.handler;const a=e.method;if(!s&&this._defaultHandlerMap.has(a)&&(s=this._defaultHandlerMap.get(a)),!s)return;let u;try{u=s.handle({url:n,request:e,event:t,params:i})}catch(e){u=Promise.reject(e)}const c=o&&o.catchHandler;if(u instanceof Promise&&(this._catchHandler||c)){var l=this;u=u.catch((h=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){Xi(o,r,i,s,a,"next",e)}function a(e){Xi(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*(r){if(c)try{return yield c.handle({url:n,request:e,event:t,params:i})}catch(e){e instanceof Error&&(r=e)}if(l._catchHandler)return l._catchHandler.handle({url:n,request:e,event:t});throw r})),function(e){return h.apply(this,arguments)}))}var h;return u}findMatchingRoute({url:e,sameOrigin:t,request:n,event:r}){const i=this._routes.get(n.method)||[];for(const o of i){let i;const s=o.match({url:e,sameOrigin:t,request:n,event:r});if(s)return i=s,(Array.isArray(i)&&0===i.length||s.constructor===Object&&0===Object.keys(s).length||"boolean"==typeof s)&&(i=void 0),{route:o,params:i}}return{}}setDefaultHandler(e,t="GET"){this._defaultHandlerMap.set(t,Yi(e))}setCatchHandler(e){this._catchHandler=Yi(e)}registerRoute(e){this._routes.has(e.method)||this._routes.set(e.method,[]),this._routes.get(e.method).push(e)}unregisterRoute(t){if(!this._routes.has(t.method))throw new e("unregister-route-but-not-found-with-method",{method:t.method});const n=this._routes.get(t.method).indexOf(t);if(!(n>-1))throw new e("unregister-route-route-not-registered");this._routes.get(t.method).splice(n,1)}constructor(){this._routes=new Map,this._defaultHandlerMap=new Map}},Gi.addFetchListener(),Gi.addCacheListener()),Gi);function eo(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function to(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){eo(o,r,i,s,a,"next",e)}function a(e){eo(o,r,i,s,a,"throw",e)}s(void 0)}))}}function no(e){return"string"==typeof e?new Request(e):e}function ro(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function io(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){ro(o,r,i,s,a,"next",e)}function a(e){ro(o,r,i,s,a,"throw",e)}s(void 0)}))}}n(818);let oo=class{handle(e){const[t]=this.handleAll(e);return t}handleAll(t){t instanceof FetchEvent&&(t={event:t,request:t.request});const n=t.event,r="string"==typeof t.request?new Request(t.request):t.request,i="params"in t?t.params:void 0,o=new class{fetch(t){var n=this;return to((function*(){const{event:r}=n;let i=no(t);if("navigate"===i.mode&&r instanceof FetchEvent&&r.preloadResponse){const e=yield r.preloadResponse;if(e)return e}const o=n.hasCallback("fetchDidFail")?i.clone():null;try{for(const e of n.iterateCallbacks("requestWillFetch"))i=yield e({request:i.clone(),event:r})}catch(t){if(t instanceof Error)throw new e("plugin-error-request-will-fetch",{thrownErrorMessage:t.message})}const s=i.clone();try{let e;e=yield fetch(i,"navigate"===i.mode?void 0:n._strategy.fetchOptions);for(const t of n.iterateCallbacks("fetchDidSucceed"))e=yield t({event:r,request:s,response:e});return e}catch(e){throw o&&(yield n.runCallbacks("fetchDidFail",{error:e,event:r,originalRequest:o.clone(),request:s.clone()})),e}}))()}fetchAndCachePut(e){var t=this;return to((function*(){const n=yield t.fetch(e),r=n.clone();return t.waitUntil(t.cachePut(e,r)),n}))()}cacheMatch(e){var t=this;return to((function*(){const n=no(e);let r;const{cacheName:i,matchOptions:o}=t._strategy,s=yield t.getCacheKey(n,"read"),a=Object.assign(Object.assign({},o),{cacheName:i});r=yield caches.match(s,a);for(const e of t.iterateCallbacks("cachedResponseWillBeUsed"))r=(yield e({cacheName:i,matchOptions:o,cachedResponse:r,request:s,event:t.event}))||void 0;return r}))()}cachePut(t,n){var r=this;return to((function*(){const i=no(t);yield l(0);const o=yield r.getCacheKey(i,"write");if(!n)throw new e("cache-put-with-no-response",{url:(s=o.url,new URL(String(s),location.href).href.replace(new RegExp(`^${location.origin}`),""))});var s;const u=yield r._ensureResponseSafeToCache(n);if(!u)return!1;const{cacheName:h,matchOptions:f}=r._strategy,d=yield self.caches.open(h),p=r.hasCallback("cacheDidUpdate"),g=p?yield function(e,t,n,r){return a.apply(this,arguments)}(d,o.clone(),["__WB_REVISION__"],f):null;try{yield d.put(o,p?u.clone():u)}catch(e){if(e instanceof Error)throw"QuotaExceededError"===e.name&&(yield function(){return c.apply(this,arguments)}()),e}for(const e of r.iterateCallbacks("cacheDidUpdate"))yield e({cacheName:h,oldResponse:g,newResponse:u.clone(),request:o,event:r.event});return!0}))()}getCacheKey(e,t){var n=this;return to((function*(){const r=`${e.url} | ${t}`;if(!n._cacheKeys[r]){let i=e;for(const e of n.iterateCallbacks("cacheKeyWillBeUsed"))i=no(yield e({mode:t,request:i,event:n.event,params:n.params}));n._cacheKeys[r]=i}return n._cacheKeys[r]}))()}hasCallback(e){for(const t of this._strategy.plugins)if(e in t)return!0;return!1}runCallbacks(e,t){var n=this;return to((function*(){for(const r of n.iterateCallbacks(e))yield r(t)}))()}*iterateCallbacks(e){for(const t of this._strategy.plugins)if("function"==typeof t[e]){const n=this._pluginStateMap.get(t),r=r=>{const i=Object.assign(Object.assign({},r),{state:n});return t[e](i)};yield r}}waitUntil(e){return this._extendLifetimePromises.push(e),e}doneWaiting(){var e=this;return to((function*(){let t;for(;t=e._extendLifetimePromises.shift();)yield t}))()}destroy(){this._handlerDeferred.resolve(null)}_ensureResponseSafeToCache(e){var t=this;return to((function*(){let n=e,r=!1;for(const e of t.iterateCallbacks("cacheWillUpdate"))if(n=(yield e({request:t.request,response:n,event:t.event}))||void 0,r=!0,!n)break;return r||n&&200!==n.status&&(n=void 0),n}))()}constructor(e,t){this._cacheKeys={},Object.assign(this,t),this.event=t.event,this._strategy=e,this._handlerDeferred=new class{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}},this._extendLifetimePromises=[],this._plugins=[...e.plugins],this._pluginStateMap=new Map;for(const e of this._plugins)this._pluginStateMap.set(e,{});this.event.waitUntil(this._handlerDeferred.promise)}}(this,{event:n,request:r,params:i}),s=this._getResponse(o,r,n);return[s,this._awaitComplete(s,o,r,n)]}_getResponse(t,n,r){var i=this;return io((function*(){let o;yield t.runCallbacks("handlerWillStart",{event:r,request:n});try{if(o=yield i._handle(n,t),!o||"error"===o.type)throw new e("no-response",{url:n.url})}catch(e){if(e instanceof Error)for(const i of t.iterateCallbacks("handlerDidError"))if(o=yield i({error:e,event:r,request:n}),o)break;if(!o)throw e}for(const e of t.iterateCallbacks("handlerWillRespond"))o=yield e({event:r,request:n,response:o});return o}))()}_awaitComplete(e,t,n,r){return io((function*(){let i,o;try{i=yield e}catch(o){}try{yield t.runCallbacks("handlerDidRespond",{event:r,request:n,response:i}),yield t.doneWaiting()}catch(e){e instanceof Error&&(o=e)}if(yield t.runCallbacks("handlerDidComplete",{event:r,request:n,response:i,error:o}),t.destroy(),o)throw o}))()}constructor(e={}){this.cacheName=i(e.cacheName),this.plugins=e.plugins||[],this.fetchOptions=e.fetchOptions,this.matchOptions=e.matchOptions}};function so(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function ao(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}const uo={cacheWillUpdate:(co=function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){ao(o,r,i,s,a,"next",e)}function a(e){ao(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*({response:e}){return 200===e.status||0===e.status?e:null})),function(e){return co.apply(this,arguments)})};var co;function lo(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function ho(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){lo(o,r,i,s,a,"next",e)}function a(e){lo(o,r,i,s,a,"throw",e)}s(void 0)}))}}function fo(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function po(e){var t;const n=+(null!==(t=go(e,me))&&void 0!==t?t:"");return isNaN(n)||n<200||n>599?503:n}function go(e,t){return e.get(t)}function yo(e,t,n,r,i,o,s){try{var a=e[o](s),u=a.value}catch(e){return void n(e)}a.done?t(u):Promise.resolve(u).then(r,i)}function vo(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){yo(o,r,i,s,a,"next",e)}function a(e){yo(o,r,i,s,a,"throw",e)}s(void 0)}))}}const mo=new class extends oo{_handle(t,n){var r=this;return function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){fo(o,r,i,s,a,"next",e)}function a(e){fo(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*(){let i,o;try{const e=[n.fetch(t)];if(r._networkTimeoutSeconds){const t=l(1e3*r._networkTimeoutSeconds);e.push(t)}if(o=yield Promise.race(e),!o)throw new Error(`Timed out the network response after ${r._networkTimeoutSeconds} seconds.`)}catch(e){e instanceof Error&&(i=e)}if(!o)throw new e("no-response",{url:t.url,error:i});return o}))()}constructor(e={}){super(e),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}},bo=new class extends oo{_handle(t,n){return function(e){return function(){var t=this,n=arguments;return new Promise((function(r,i){var o=e.apply(t,n);function s(e){so(o,r,i,s,a,"next",e)}function a(e){so(o,r,i,s,a,"throw",e)}s(void 0)}))}}((function*(){const r=yield n.cacheMatch(t);if(!r)throw new e("no-response",{url:t.url});return r}))()}}({cacheName:_e}),wo=new class extends oo{_handle(t,n){var r=this;return ho((function*(){const i=[],o=[];let s;if(r._networkTimeoutSeconds){const{id:e,promise:a}=r._getTimeoutPromise({request:t,logs:i,handler:n});s=e,o.push(a)}const a=r._getNetworkPromise({timeoutId:s,request:t,logs:i,handler:n});o.push(a);const u=yield n.waitUntil(ho((function*(){return(yield n.waitUntil(Promise.race(o)))||(yield a)}))());if(!u)throw new e("no-response",{url:t.url});return u}))()}_getTimeoutPromise({request:e,logs:t,handler:n}){let r;const i=new Promise((t=>{const i=function(){var r=ho((function*(){t(yield n.cacheMatch(e))}));return function(){return r.apply(this,arguments)}}();r=setTimeout(i,1e3*this._networkTimeoutSeconds)}));return{promise:i,id:r}}_getNetworkPromise({timeoutId:e,request:t,logs:n,handler:r}){return ho((function*(){let n,i;try{i=yield r.fetchAndCachePut(t)}catch(e){e instanceof Error&&(n=e)}return e&&clearTimeout(e),!n&&i||(i=yield r.cacheMatch(t)),i}))()}constructor(e={}){super(e),this.plugins.some((e=>"cacheWillUpdate"in e))||this.plugins.unshift(uo),this._networkTimeoutSeconds=e.networkTimeoutSeconds||0}}({cacheName:_e}),_o="network-only-or-cache-only",ko={"network-first":e=>wo.handle(e),"network-only-or-cache-only":function(){var e=vo((function*(e){try{return yield mo.handle(e)}catch(t){return yield bo.handle(e)}}));return function(t){return e.apply(this,arguments)}}()};function xo(e){return So.apply(this,arguments)}function So(){return(So=vo((function*(e){try{return yield mo.handle(e)}catch(e){const t=yield caches.open(_e),n=yield t.match(xe);return null!=n?n:Response.error()}}))).apply(this,arguments)}function Oo(e){return Po.apply(this,arguments)}function Po(){return Po=vo((function*(e){const{request:t}=e,n="GET"===e.request.method?yield function(e){return Eo.apply(this,arguments)}(e):_o;var r;const i=null!==(r=ko[n])&&void 0!==r?r:ko[_o];try{return yield i(e)}catch(e){return console.warn("[SW] Could not handle the request to %s (using handler %s).",t.url,n,e),new Response(null!==(o=go(t.headers,ve))&&void 0!==o?o:void 0,{status:po(t.headers)})}var o})),Po.apply(this,arguments)}function Eo(){return Eo=vo((function*({request:e}){var t;return null!==(t=go(e.headers,be))&&void 0!==t?t:yield function(e){return Co.apply(this,arguments)}(e.url)})),Eo.apply(this,arguments)}function Co(){return(Co=vo((function*(e){const t=new Li,n=yield t.dynamicRouteRegistrations.toArray();var r;const i=ye(n.filter((t=>new RegExp(t.pattern).test(e))).map((e=>null!==(r=e.strategy)&&void 0!==r?r:"network-first")));return i.length<=1?i[0]:null!==(o=["network-first","network-only-or-cache-only"].find((e=>i.some((t=>t===e)))))&&void 0!==o?o:_o;var o}))).apply(this,arguments)}var jo;self.__WB_DISABLE_DEV_LOGS=!0,jo={prefix:we},(e=>{for(const t of Object.keys(r))e(t)})((e=>{"string"==typeof jo[e]&&(r[e]=jo[e])})),function(){!function(e,t,n){let r;r=e instanceof RegExp?new Qi(e,t,n):new Ji(e,t,n),Zi().registerRoute(r)}((({request:e})=>"navigate"===e.mode),xo);const e=Zi();for(const t of zi)e.setDefaultHandler(Oo,t)}(),self.addEventListener("message",(function(e){return Hi.apply(this,arguments)})),self.addEventListener("install",(e=>{self.skipWaiting(),e.waitUntil(Mi(Se))})),self.addEventListener("activate",(e=>{e.waitUntil(self.clients.claim())}))})()})();
|