@xwiki/cristal-electron-renderer 1.2.0 → 1.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +19 -19
- package/dist/AttachmentPreview-DNQ6Ebkw.css +0 -1
- package/dist/AttachmentPreview-Ecn8Pmvf.js +0 -2
- package/dist/AttachmentPreview-Ecn8Pmvf.js.map +0 -1
- package/dist/AuthServiceBanner-7KaHK0Au.js +0 -2
- package/dist/AuthServiceBanner-7KaHK0Au.js.map +0 -1
- package/dist/AuthServiceBanner-BArubXdu.css +0 -1
- package/dist/DeletePage-DA6E5XYv.js +0 -2
- package/dist/DeletePage-DA6E5XYv.js.map +0 -1
- package/dist/GitHubLoginMenu-Crh899SM.js +0 -2
- package/dist/GitHubLoginMenu-Crh899SM.js.map +0 -1
- package/dist/LoggedInMenu-kH3kWMGK.js +0 -2
- package/dist/LoggedInMenu-kH3kWMGK.js.map +0 -1
- package/dist/LoginMenu-D_c21AxX.js +0 -2
- package/dist/LoginMenu-D_c21AxX.js.map +0 -1
- package/dist/MovePage-BHS998Jm.css +0 -1
- package/dist/MovePage-Du2Z2i7H.js +0 -2
- package/dist/MovePage-Du2Z2i7H.js.map +0 -1
- package/dist/NextcloudLoginMenu-BTVdL-FM.js +0 -2
- package/dist/NextcloudLoginMenu-BTVdL-FM.js.map +0 -1
- package/dist/NextcloudLoginMenu-DGCgMCya.css +0 -1
- package/dist/RenamePage-CQF0H3Kh.js +0 -2
- package/dist/RenamePage-CQF0H3Kh.js.map +0 -1
- package/dist/SettingsConfigurations-B9GWI5mw.css +0 -1
- package/dist/SettingsConfigurations-Cy7Cfmm4.js +0 -2
- package/dist/SettingsConfigurations-Cy7Cfmm4.js.map +0 -1
- package/dist/c-config-menu-BGV5XXU8.css +0 -1
- package/dist/c-config-menu-C99poXWy.js +0 -2
- package/dist/c-config-menu-C99poXWy.js.map +0 -1
- package/dist/c-edit-blocknote-ByH5aYGe.js +0 -257
- package/dist/c-edit-blocknote-ByH5aYGe.js.map +0 -1
- package/dist/c-edit-blocknote-gIdUYHeV.css +0 -1
- package/dist/chunk.24ZZSBUF-BmQPh48m.js +0 -89
- package/dist/chunk.24ZZSBUF-BmQPh48m.js.map +0 -1
- package/dist/chunk.36O46B5H-Cv2poSyf.js +0 -64
- package/dist/chunk.36O46B5H-Cv2poSyf.js.map +0 -1
- package/dist/chunk.3LWOA5DF-D8Va5Pmw.js +0 -77
- package/dist/chunk.3LWOA5DF-D8Va5Pmw.js.map +0 -1
- package/dist/chunk.3RPBFEDE-DI7eSlIl.js +0 -2
- package/dist/chunk.3RPBFEDE-DI7eSlIl.js.map +0 -1
- package/dist/chunk.4TUIT776-BvlNwMXD.js +0 -18
- package/dist/chunk.4TUIT776-BvlNwMXD.js.map +0 -1
- package/dist/chunk.6CTB5ZDJ-9Su7bEUQ.js +0 -2
- package/dist/chunk.6CTB5ZDJ-9Su7bEUQ.js.map +0 -1
- package/dist/chunk.7E4JTYWU-Ci99jpyG.js +0 -75
- package/dist/chunk.7E4JTYWU-Ci99jpyG.js.map +0 -1
- package/dist/chunk.AJ3ENQ5C-zot94vv9.js +0 -2
- package/dist/chunk.AJ3ENQ5C-zot94vv9.js.map +0 -1
- package/dist/chunk.B4BZKR24-B0iVuGLD.js +0 -2
- package/dist/chunk.B4BZKR24-B0iVuGLD.js.map +0 -1
- package/dist/chunk.D5YQDJ7X-_UyNui_V.js +0 -2
- package/dist/chunk.D5YQDJ7X-_UyNui_V.js.map +0 -1
- package/dist/chunk.DFHYNK3F-bS0lNIuO.js +0 -86
- package/dist/chunk.DFHYNK3F-bS0lNIuO.js.map +0 -1
- package/dist/chunk.GMYPQTFK-BT1AAYXJ.js +0 -2
- package/dist/chunk.GMYPQTFK-BT1AAYXJ.js.map +0 -1
- package/dist/chunk.J5ZM7LIC-n6gjp3-L.js +0 -244
- package/dist/chunk.J5ZM7LIC-n6gjp3-L.js.map +0 -1
- package/dist/chunk.JCXLDPQF-BOaK9AtU.js +0 -622
- package/dist/chunk.JCXLDPQF-BOaK9AtU.js.map +0 -1
- package/dist/chunk.JHOXTQXA-CWkZ1weQ.js +0 -24
- package/dist/chunk.JHOXTQXA-CWkZ1weQ.js.map +0 -1
- package/dist/chunk.JQBT7BOV-BKSO0Hfn.js +0 -3378
- package/dist/chunk.JQBT7BOV-BKSO0Hfn.js.map +0 -1
- package/dist/chunk.JXOKFADN-DpK3Q_uU.js +0 -785
- package/dist/chunk.JXOKFADN-DpK3Q_uU.js.map +0 -1
- package/dist/chunk.KPLQLAWP-DUYDfZ7-.js +0 -163
- package/dist/chunk.KPLQLAWP-DUYDfZ7-.js.map +0 -1
- package/dist/chunk.LD4M4QGE-cX1_6HT7.js +0 -2
- package/dist/chunk.LD4M4QGE-cX1_6HT7.js.map +0 -1
- package/dist/chunk.NYIIDP5N-AHr3eTN0.js +0 -2
- package/dist/chunk.NYIIDP5N-AHr3eTN0.js.map +0 -1
- package/dist/chunk.R45OWEVP-WMyXo-Fn.js +0 -181
- package/dist/chunk.R45OWEVP-WMyXo-Fn.js.map +0 -1
- package/dist/chunk.RWUUFNUL-BJhNq5wM.js +0 -2
- package/dist/chunk.RWUUFNUL-BJhNq5wM.js.map +0 -1
- package/dist/chunk.RY756JLP-BUknFjxa.js +0 -22
- package/dist/chunk.RY756JLP-BUknFjxa.js.map +0 -1
- package/dist/chunk.SI4ACBFK-BB831ml8.js +0 -58
- package/dist/chunk.SI4ACBFK-BB831ml8.js.map +0 -1
- package/dist/chunk.TRHSUYII-DFnBKJNh.js +0 -140
- package/dist/chunk.TRHSUYII-DFnBKJNh.js.map +0 -1
- package/dist/chunk.XA43ZQPC-maNlqVLX.js +0 -395
- package/dist/chunk.XA43ZQPC-maNlqVLX.js.map +0 -1
- package/dist/chunk.XSFJLY2D-ldEKWtxN.js +0 -178
- package/dist/chunk.XSFJLY2D-ldEKWtxN.js.map +0 -1
- package/dist/chunk.YHLNUJ7P-BGNuPG1R.js +0 -109
- package/dist/chunk.YHLNUJ7P-BGNuPG1R.js.map +0 -1
- package/dist/chunk.ZGGPD2XJ-DD1S3h7C.js +0 -2
- package/dist/chunk.ZGGPD2XJ-DD1S3h7C.js.map +0 -1
- package/dist/chunk.ZH2AND3P-CzagA8cz.js +0 -288
- package/dist/chunk.ZH2AND3P-CzagA8cz.js.map +0 -1
- package/dist/class-map-DmaCJs8c.js +0 -2
- package/dist/class-map-DmaCJs8c.js.map +0 -1
- package/dist/filesystem-internal-link-serializer-BmtbMUwV.js +0 -2
- package/dist/filesystem-internal-link-serializer-BmtbMUwV.js.map +0 -1
- package/dist/floating-ui.dom-1S43Ew4Q.js +0 -2
- package/dist/floating-ui.dom-1S43Ew4Q.js.map +0 -1
- package/dist/github-CRi3Ye_z.js +0 -3
- package/dist/github-CRi3Ye_z.js.map +0 -1
- package/dist/github-internal-link-serializer-ChUBU16v.js +0 -2
- package/dist/github-internal-link-serializer-ChUBU16v.js.map +0 -1
- package/dist/hocuspocus-provider.esm-DpwNtHpL.js +0 -2
- package/dist/hocuspocus-provider.esm-DpwNtHpL.js.map +0 -1
- package/dist/if-defined-O-hFrvt0.js +0 -2
- package/dist/if-defined-O-hFrvt0.js.map +0 -1
- package/dist/index-B1WxkRNy.js +0 -254
- package/dist/index-B1WxkRNy.js.map +0 -1
- package/dist/index-BgL5UHSB.css +0 -1
- package/dist/index-DWPjg9z3.js +0 -2
- package/dist/index-DWPjg9z3.js.map +0 -1
- package/dist/index-qhuTooVL.js +0 -3
- package/dist/index-qhuTooVL.js.map +0 -1
- package/dist/index.html +0 -13
- package/dist/live-z5w0O4st.js +0 -2
- package/dist/live-z5w0O4st.js.map +0 -1
- package/dist/module-RjUF93sV.js +0 -717
- package/dist/module-RjUF93sV.js.map +0 -1
- package/dist/native-48B9X9Wg.js +0 -2
- package/dist/native-48B9X9Wg.js.map +0 -1
- package/dist/nextcloud-B3M7otLC.js +0 -31
- package/dist/nextcloud-B3M7otLC.js.map +0 -1
- package/dist/nextcloud-internal-link-serializer-6Syv5TEU.js +0 -7
- package/dist/nextcloud-internal-link-serializer-6Syv5TEU.js.map +0 -1
- package/dist/offline-3x82kJQp.js +0 -4
- package/dist/offline-3x82kJQp.js.map +0 -1
- package/dist/query-x48B6FB_.js +0 -2
- package/dist/query-x48B6FB_.js.map +0 -1
- package/dist/shoelace-ZF5apisL.js +0 -3
- package/dist/shoelace-ZF5apisL.js.map +0 -1
- package/dist/static-Dm20cmTz.js +0 -3
- package/dist/static-Dm20cmTz.js.map +0 -1
- package/dist/staticBuild-BOgweg16.js +0 -2
- package/dist/staticBuild-BOgweg16.js.map +0 -1
- package/dist/translations-D5nOIu3x.js +0 -2
- package/dist/translations-D5nOIu3x.js.map +0 -1
- package/dist/translations-Ds9OkLNv.js +0 -2
- package/dist/translations-Ds9OkLNv.js.map +0 -1
- package/dist/vuetify-BxGNBe1U.js +0 -19
- package/dist/vuetify-BxGNBe1U.js.map +0 -1
- package/dist/vuetify-DJa-zcj7.css +0 -1
- package/dist/worker-BgcG6AhJ.js +0 -202
- package/dist/worker-BgcG6AhJ.js.map +0 -1
- package/dist/x-alert-BeYgGEHw.js +0 -2
- package/dist/x-alert-BeYgGEHw.js.map +0 -1
- package/dist/x-alert-BhErtBtU.css +0 -1
- package/dist/x-alert-DfYpLdml.css +0 -1
- package/dist/x-alert-Dy2REhpp.js +0 -2
- package/dist/x-alert-Dy2REhpp.js.map +0 -1
- package/dist/x-avatar-2efH4gNX.css +0 -1
- package/dist/x-avatar-C4CTlSRd.js +0 -2
- package/dist/x-avatar-C4CTlSRd.js.map +0 -1
- package/dist/x-avatar-DzYlPdwz.js +0 -2
- package/dist/x-avatar-DzYlPdwz.js.map +0 -1
- package/dist/x-breadcrumb-3U5TzpgN.js +0 -2
- package/dist/x-breadcrumb-3U5TzpgN.js.map +0 -1
- package/dist/x-breadcrumb-BMSNlvvi.css +0 -1
- package/dist/x-breadcrumb-BYgHeSE3.js +0 -2
- package/dist/x-breadcrumb-BYgHeSE3.js.map +0 -1
- package/dist/x-btn-9AKb7ryY.js +0 -2
- package/dist/x-btn-9AKb7ryY.js.map +0 -1
- package/dist/x-btn-CWfGjEgy.js +0 -2
- package/dist/x-btn-CWfGjEgy.js.map +0 -1
- package/dist/x-btn-DPGq6Sd-.css +0 -1
- package/dist/x-btn.vue_vue_type_script_setup_true_lang-D3pg_1oq.js +0 -2
- package/dist/x-btn.vue_vue_type_script_setup_true_lang-D3pg_1oq.js.map +0 -1
- package/dist/x-card-BiFAsKLZ.js +0 -2
- package/dist/x-card-BiFAsKLZ.js.map +0 -1
- package/dist/x-card-blonMcP4.js +0 -2
- package/dist/x-card-blonMcP4.js.map +0 -1
- package/dist/x-checkbox-BoqoQxdA.css +0 -1
- package/dist/x-checkbox-CfFCxOCr.js +0 -2
- package/dist/x-checkbox-CfFCxOCr.js.map +0 -1
- package/dist/x-checkbox-VDSX4CX7.js +0 -2
- package/dist/x-checkbox-VDSX4CX7.js.map +0 -1
- package/dist/x-col-DsUQg5Gm.js +0 -2
- package/dist/x-col-DsUQg5Gm.js.map +0 -1
- package/dist/x-container-B1osS5wH.js +0 -2
- package/dist/x-container-B1osS5wH.js.map +0 -1
- package/dist/x-dialog-Bk9LE0HR.css +0 -1
- package/dist/x-dialog-Cwb1fieH.js +0 -2
- package/dist/x-dialog-Cwb1fieH.js.map +0 -1
- package/dist/x-dialog-VzzVz38L.css +0 -1
- package/dist/x-dialog-eOwazoAI.js +0 -2
- package/dist/x-dialog-eOwazoAI.js.map +0 -1
- package/dist/x-divider-Bf6b5P6D.js +0 -2
- package/dist/x-divider-Bf6b5P6D.js.map +0 -1
- package/dist/x-divider-D36BIsQM.js +0 -2
- package/dist/x-divider-D36BIsQM.js.map +0 -1
- package/dist/x-dropdown-CxWpPIwn.css +0 -1
- package/dist/x-dropdown-DfwjES9w.js +0 -2
- package/dist/x-dropdown-DfwjES9w.js.map +0 -1
- package/dist/x-dropdown-GNs7ILlc.css +0 -1
- package/dist/x-dropdown-ds5_iBZ4.js +0 -2
- package/dist/x-dropdown-ds5_iBZ4.js.map +0 -1
- package/dist/x-file-input-B9mfyR4z.js +0 -2
- package/dist/x-file-input-B9mfyR4z.js.map +0 -1
- package/dist/x-file-input-BSstA5LD.css +0 -1
- package/dist/x-file-input-DftepgSQ.js +0 -2
- package/dist/x-file-input-DftepgSQ.js.map +0 -1
- package/dist/x-form-C5eClK9q.js +0 -2
- package/dist/x-form-C5eClK9q.js.map +0 -1
- package/dist/x-form-CK24VrXN.css +0 -1
- package/dist/x-form-DGUS5Veh.css +0 -1
- package/dist/x-form-etxLXE0R.js +0 -2
- package/dist/x-form-etxLXE0R.js.map +0 -1
- package/dist/x-img-CNPL9bZj.js +0 -2
- package/dist/x-img-CNPL9bZj.js.map +0 -1
- package/dist/x-img-DYWmHySi.js +0 -2
- package/dist/x-img-DYWmHySi.js.map +0 -1
- package/dist/x-load-BlPeW_ej.css +0 -1
- package/dist/x-load-CM4p-BU2.css +0 -1
- package/dist/x-load-CatWwBSt.js +0 -2
- package/dist/x-load-CatWwBSt.js.map +0 -1
- package/dist/x-load-pklPPw3d.js +0 -2
- package/dist/x-load-pklPPw3d.js.map +0 -1
- package/dist/x-menu-BmuGyRjl.css +0 -1
- package/dist/x-menu-C0JNNHR2.js +0 -2
- package/dist/x-menu-C0JNNHR2.js.map +0 -1
- package/dist/x-menu-CKBWYMym.js +0 -2
- package/dist/x-menu-CKBWYMym.js.map +0 -1
- package/dist/x-menu-item-9k48D3Mw.js +0 -2
- package/dist/x-menu-item-9k48D3Mw.js.map +0 -1
- package/dist/x-menu-item-fSf-cD7q.js +0 -2
- package/dist/x-menu-item-fSf-cD7q.js.map +0 -1
- package/dist/x-menu-label-BDlCFsFH.js +0 -2
- package/dist/x-menu-label-BDlCFsFH.js.map +0 -1
- package/dist/x-menu-label-C8o6TwqC.js +0 -2
- package/dist/x-menu-label-C8o6TwqC.js.map +0 -1
- package/dist/x-menu-label-DhRAj-fk.css +0 -1
- package/dist/x-row-DsUQg5Gm.js +0 -2
- package/dist/x-row-DsUQg5Gm.js.map +0 -1
- package/dist/x-search-C6XAaOXg.js +0 -2
- package/dist/x-search-C6XAaOXg.js.map +0 -1
- package/dist/x-search-CmWnWxsP.js +0 -2
- package/dist/x-search-CmWnWxsP.js.map +0 -1
- package/dist/x-select-C8GSGs-Z.js +0 -2
- package/dist/x-select-C8GSGs-Z.js.map +0 -1
- package/dist/x-select-Da6f14h4.js +0 -2
- package/dist/x-select-Da6f14h4.js.map +0 -1
- package/dist/x-tab-BDpZS53n.js +0 -2
- package/dist/x-tab-BDpZS53n.js.map +0 -1
- package/dist/x-tab-DV937RB-.js +0 -2
- package/dist/x-tab-DV937RB-.js.map +0 -1
- package/dist/x-tab-group-C3YcH4jU.js +0 -2
- package/dist/x-tab-group-C3YcH4jU.js.map +0 -1
- package/dist/x-tab-group-CT7pAQGH.js +0 -2
- package/dist/x-tab-group-CT7pAQGH.js.map +0 -1
- package/dist/x-tab-panel--wEPqeL9.js +0 -2
- package/dist/x-tab-panel--wEPqeL9.js.map +0 -1
- package/dist/x-tab-panel-BV2Axw5I.js +0 -2
- package/dist/x-tab-panel-BV2Axw5I.js.map +0 -1
- package/dist/x-text-field-B0juKwq0.js +0 -2
- package/dist/x-text-field-B0juKwq0.js.map +0 -1
- package/dist/x-text-field-CNuOWA3c.js +0 -2
- package/dist/x-text-field-CNuOWA3c.js.map +0 -1
- package/dist/x-tree-Aj-ivC70.js +0 -2
- package/dist/x-tree-Aj-ivC70.js.map +0 -1
- package/dist/x-tree-CUnE9yj-.js +0 -2
- package/dist/x-tree-CUnE9yj-.js.map +0 -1
- package/dist/x-tree-D0WG-8EM.css +0 -1
- package/dist/x-tree-OLo4IKf9.css +0 -1
- package/dist/xwiki-BeDAdEBl.js +0 -4
- package/dist/xwiki-BeDAdEBl.js.map +0 -1
- package/dist/xwiki-internal-link-serializer-Cd8xorru-_7nXuj98.js +0 -2
- package/dist/xwiki-internal-link-serializer-Cd8xorru-_7nXuj98.js.map +0 -1
- package/dist/xwiki-logo-color-DZ9bdNW4.svg +0 -18
- package/dist/yjs-VtUl3AlT.js +0 -6
- package/dist/yjs-VtUl3AlT.js.map +0 -1
package/dist/worker-BgcG6AhJ.js
DELETED
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
var gr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Nd(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sl={};var ol;function jd(){if(ol)return sl;ol=1;var n;return(function(e){(function(t){var i=typeof globalThis=="object"?globalThis:typeof gr=="object"?gr:typeof self=="object"?self:typeof this=="object"?this:d(),r=s(e);typeof i.Reflect<"u"&&(r=s(i.Reflect,r)),t(r,i),typeof i.Reflect>"u"&&(i.Reflect=e);function s(h,m){return function(v,w){Object.defineProperty(h,v,{configurable:!0,writable:!0,value:w}),m&&m(v,w)}}function a(){try{return Function("return this;")()}catch{}}function l(){try{return(0,eval)("(function() { return this; })()")}catch{}}function d(){return a()||l()}})(function(t,i){var r=Object.prototype.hasOwnProperty,s=typeof Symbol=="function",a=s&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:"@@toPrimitive",l=s&&typeof Symbol.iterator<"u"?Symbol.iterator:"@@iterator",d=typeof Object.create=="function",h={__proto__:[]}instanceof Array,m=!d&&!h,v={create:d?function(){return nt(Object.create(null))}:h?function(){return nt({__proto__:null})}:function(){return nt({})},has:m?function(S,T){return r.call(S,T)}:function(S,T){return T in S},get:m?function(S,T){return r.call(S,T)?S[T]:void 0}:function(S,T){return S[T]}},w=Object.getPrototypeOf(Function),P=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:st(),K=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Ue(),A=typeof WeakMap=="function"?WeakMap:vt(),D=s?Symbol.for("@reflect-metadata:registry"):void 0,z=V(),H=W(z);function ie(S,T,j,q){if(ve(j)){if(!Ie(S))throw new TypeError;if(!Fn(T))throw new TypeError;return rt(S,T)}else{if(!Ie(S))throw new TypeError;if(!Ee(T))throw new TypeError;if(!Ee(q)&&!ve(q)&&!dt(q))throw new TypeError;return dt(q)&&(q=void 0),j=pt(j),gn(S,T,j,q)}}t("decorate",ie);function J(S,T){function j(q,F){if(!Ee(q))throw new TypeError;if(!ve(F)&&!Tt(F))throw new TypeError;ft(S,T,q,F)}return j}t("metadata",J);function ne(S,T,j,q){if(!Ee(j))throw new TypeError;return ve(q)||(q=pt(q)),ft(S,T,j,q)}t("defineMetadata",ne);function ue(S,T,j){if(!Ee(T))throw new TypeError;return ve(j)||(j=pt(j)),zt(S,T,j)}t("hasMetadata",ue);function pe(S,T,j){if(!Ee(T))throw new TypeError;return ve(j)||(j=pt(j)),ut(S,T,j)}t("hasOwnMetadata",pe);function Q(S,T,j){if(!Ee(T))throw new TypeError;return ve(j)||(j=pt(j)),tt(S,T,j)}t("getMetadata",Q);function ge(S,T,j){if(!Ee(T))throw new TypeError;return ve(j)||(j=pt(j)),he(S,T,j)}t("getOwnMetadata",ge);function Re(S,T){if(!Ee(S))throw new TypeError;return ve(T)||(T=pt(T)),St(S,T)}t("getMetadataKeys",Re);function We(S,T){if(!Ee(S))throw new TypeError;return ve(T)||(T=pt(T)),Ke(S,T)}t("getOwnMetadataKeys",We);function _e(S,T,j){if(!Ee(T))throw new TypeError;if(ve(j)||(j=pt(j)),!Ee(T))throw new TypeError;ve(j)||(j=pt(j));var q=de(T,j,!1);return ve(q)?!1:q.OrdinaryDeleteMetadata(S,T,j)}t("deleteMetadata",_e);function rt(S,T){for(var j=S.length-1;j>=0;--j){var q=S[j],F=q(T);if(!ve(F)&&!dt(F)){if(!Fn(F))throw new TypeError;T=F}}return T}function gn(S,T,j,q){for(var F=S.length-1;F>=0;--F){var ye=S[F],xe=ye(T,j,q);if(!ve(xe)&&!dt(xe)){if(!Ee(xe))throw new TypeError;q=xe}}return q}function zt(S,T,j){var q=ut(S,T,j);if(q)return!0;var F=Nt(T);return dt(F)?!1:zt(S,F,j)}function ut(S,T,j){var q=de(T,j,!1);return ve(q)?!1:Bn(q.OrdinaryHasOwnMetadata(S,T,j))}function tt(S,T,j){var q=ut(S,T,j);if(q)return he(S,T,j);var F=Nt(T);if(!dt(F))return tt(S,F,j)}function he(S,T,j){var q=de(T,j,!1);if(!ve(q))return q.OrdinaryGetOwnMetadata(S,T,j)}function ft(S,T,j,q){var F=de(j,q,!0);F.OrdinaryDefineOwnMetadata(S,T,j,q)}function St(S,T){var j=Ke(S,T),q=Nt(S);if(q===null)return j;var F=St(q,T);if(F.length<=0)return j;if(j.length<=0)return F;for(var ye=new K,xe=[],be=0,L=j;be<L.length;be++){var se=L[be],ae=ye.has(se);ae||(ye.add(se),xe.push(se))}for(var le=0,Se=F;le<Se.length;le++){var se=Se[le],ae=ye.has(se);ae||(ye.add(se),xe.push(se))}return xe}function Ke(S,T){var j=de(S,T,!1);return j?j.OrdinaryOwnMetadataKeys(S,T):[]}function kt(S){if(S===null)return 1;switch(typeof S){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return S===null?1:6;default:return 6}}function ve(S){return S===void 0}function dt(S){return S===null}function ci(S){return typeof S=="symbol"}function Ee(S){return typeof S=="object"?S!==null:typeof S=="function"}function Vt(S,T){switch(kt(S)){case 0:return S;case 1:return S;case 2:return S;case 3:return S;case 4:return S;case 5:return S}var j="string",q=Qt(S,a);if(q!==void 0){var F=q.call(S,j);if(Ee(F))throw new TypeError;return F}return Jt(S)}function Jt(S,T){var j,q;{var F=S.toString;if(Et(F)){var q=F.call(S);if(!Ee(q))return q}var j=S.valueOf;if(Et(j)){var q=j.call(S);if(!Ee(q))return q}}throw new TypeError}function Bn(S){return!!S}function fe(S){return""+S}function pt(S){var T=Vt(S);return ci(T)?T:fe(T)}function Ie(S){return Array.isArray?Array.isArray(S):S instanceof Object?S instanceof Array:Object.prototype.toString.call(S)==="[object Array]"}function Et(S){return typeof S=="function"}function Fn(S){return typeof S=="function"}function Tt(S){switch(kt(S)){case 3:return!0;case 4:return!0;default:return!1}}function rn(S,T){return S===T||S!==S&&T!==T}function Qt(S,T){var j=S[T];if(j!=null){if(!Et(j))throw new TypeError;return j}}function li(S){var T=Qt(S,l);if(!Et(T))throw new TypeError;var j=T.call(S);if(!Ee(j))throw new TypeError;return j}function ui(S){return S.value}function mn(S){var T=S.next();return T.done?!1:T}function mt(S){var T=S.return;T&&T.call(S)}function Nt(S){var T=Object.getPrototypeOf(S);if(typeof S!="function"||S===w||T!==w)return T;var j=S.prototype,q=j&&Object.getPrototypeOf(j);if(q==null||q===Object.prototype)return T;var F=q.constructor;return typeof F!="function"||F===S?T:F}function B(){var S;!ve(D)&&typeof i.Reflect<"u"&&!(D in i.Reflect)&&typeof i.Reflect.defineMetadata=="function"&&(S=X(i.Reflect));var T,j,q,F=new A,ye={registerProvider:xe,getProvider:L,setProvider:ae};return ye;function xe(le){if(!Object.isExtensible(ye))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case S===le:break;case ve(T):T=le;break;case T===le:break;case ve(j):j=le;break;case j===le:break;default:q===void 0&&(q=new K),q.add(le);break}}function be(le,Se){if(!ve(T)){if(T.isProviderFor(le,Se))return T;if(!ve(j)){if(j.isProviderFor(le,Se))return T;if(!ve(q))for(var $e=li(q);;){var ze=mn($e);if(!ze)return;var It=ui(ze);if(It.isProviderFor(le,Se))return mt($e),It}}}if(!ve(S)&&S.isProviderFor(le,Se))return S}function L(le,Se){var $e=F.get(le),ze;return ve($e)||(ze=$e.get(Se)),ve(ze)&&(ze=be(le,Se),ve(ze)||(ve($e)&&($e=new P,F.set(le,$e)),$e.set(Se,ze))),ze}function se(le){if(ve(le))throw new TypeError;return T===le||j===le||!ve(q)&&q.has(le)}function ae(le,Se,$e){if(!se($e))throw new Error("Metadata provider not registered.");var ze=L(le,Se);if(ze!==$e){if(!ve(ze))return!1;var It=F.get(le);ve(It)&&(It=new P,F.set(le,It)),It.set(Se,$e)}return!0}}function V(){var S;return!ve(D)&&Ee(i.Reflect)&&Object.isExtensible(i.Reflect)&&(S=i.Reflect[D]),ve(S)&&(S=B()),!ve(D)&&Ee(i.Reflect)&&Object.isExtensible(i.Reflect)&&Object.defineProperty(i.Reflect,D,{enumerable:!1,configurable:!1,writable:!1,value:S}),S}function W(S){var T=new A,j={isProviderFor:function(se,ae){var le=T.get(se);return ve(le)?!1:le.has(ae)},OrdinaryDefineOwnMetadata:xe,OrdinaryHasOwnMetadata:F,OrdinaryGetOwnMetadata:ye,OrdinaryOwnMetadataKeys:be,OrdinaryDeleteMetadata:L};return z.registerProvider(j),j;function q(se,ae,le){var Se=T.get(se),$e=!1;if(ve(Se)){if(!le)return;Se=new P,T.set(se,Se),$e=!0}var ze=Se.get(ae);if(ve(ze)){if(!le)return;if(ze=new P,Se.set(ae,ze),!S.setProvider(se,ae,j))throw Se.delete(ae),$e&&T.delete(se),new Error("Wrong provider for target.")}return ze}function F(se,ae,le){var Se=q(ae,le,!1);return ve(Se)?!1:Bn(Se.has(se))}function ye(se,ae,le){var Se=q(ae,le,!1);if(!ve(Se))return Se.get(se)}function xe(se,ae,le,Se){var $e=q(le,Se,!0);$e.set(se,ae)}function be(se,ae){var le=[],Se=q(se,ae,!1);if(ve(Se))return le;for(var $e=Se.keys(),ze=li($e),It=0;;){var sn=mn(ze);if(!sn)return le.length=It,le;var vn=ui(sn);try{le[It]=vn}catch(Bi){try{mt(ze)}finally{throw Bi}}It++}}function L(se,ae,le){var Se=q(ae,le,!1);if(ve(Se)||!Se.delete(se))return!1;if(Se.size===0){var $e=T.get(ae);ve($e)||($e.delete(le),$e.size===0&&T.delete($e))}return!0}}function X(S){var T=S.defineMetadata,j=S.hasOwnMetadata,q=S.getOwnMetadata,F=S.getOwnMetadataKeys,ye=S.deleteMetadata,xe=new A,be={isProviderFor:function(L,se){var ae=xe.get(L);return!ve(ae)&&ae.has(se)?!0:F(L,se).length?(ve(ae)&&(ae=new K,xe.set(L,ae)),ae.add(se),!0):!1},OrdinaryDefineOwnMetadata:T,OrdinaryHasOwnMetadata:j,OrdinaryGetOwnMetadata:q,OrdinaryOwnMetadataKeys:F,OrdinaryDeleteMetadata:ye};return be}function de(S,T,j){var q=z.getProvider(S,T);if(!ve(q))return q;if(j){if(z.setProvider(S,T,H))return H;throw new Error("Illegal state.")}}function st(){var S={},T=[],j=(function(){function be(L,se,ae){this._index=0,this._keys=L,this._values=se,this._selector=ae}return be.prototype["@@iterator"]=function(){return this},be.prototype[l]=function(){return this},be.prototype.next=function(){var L=this._index;if(L>=0&&L<this._keys.length){var se=this._selector(this._keys[L],this._values[L]);return L+1>=this._keys.length?(this._index=-1,this._keys=T,this._values=T):this._index++,{value:se,done:!1}}return{value:void 0,done:!0}},be.prototype.throw=function(L){throw this._index>=0&&(this._index=-1,this._keys=T,this._values=T),L},be.prototype.return=function(L){return this._index>=0&&(this._index=-1,this._keys=T,this._values=T),{value:L,done:!0}},be})(),q=(function(){function be(){this._keys=[],this._values=[],this._cacheKey=S,this._cacheIndex=-2}return Object.defineProperty(be.prototype,"size",{get:function(){return this._keys.length},enumerable:!0,configurable:!0}),be.prototype.has=function(L){return this._find(L,!1)>=0},be.prototype.get=function(L){var se=this._find(L,!1);return se>=0?this._values[se]:void 0},be.prototype.set=function(L,se){var ae=this._find(L,!0);return this._values[ae]=se,this},be.prototype.delete=function(L){var se=this._find(L,!1);if(se>=0){for(var ae=this._keys.length,le=se+1;le<ae;le++)this._keys[le-1]=this._keys[le],this._values[le-1]=this._values[le];return this._keys.length--,this._values.length--,rn(L,this._cacheKey)&&(this._cacheKey=S,this._cacheIndex=-2),!0}return!1},be.prototype.clear=function(){this._keys.length=0,this._values.length=0,this._cacheKey=S,this._cacheIndex=-2},be.prototype.keys=function(){return new j(this._keys,this._values,F)},be.prototype.values=function(){return new j(this._keys,this._values,ye)},be.prototype.entries=function(){return new j(this._keys,this._values,xe)},be.prototype["@@iterator"]=function(){return this.entries()},be.prototype[l]=function(){return this.entries()},be.prototype._find=function(L,se){if(!rn(this._cacheKey,L)){this._cacheIndex=-1;for(var ae=0;ae<this._keys.length;ae++)if(rn(this._keys[ae],L)){this._cacheIndex=ae;break}}return this._cacheIndex<0&&se&&(this._cacheIndex=this._keys.length,this._keys.push(L),this._values.push(void 0)),this._cacheIndex},be})();return q;function F(be,L){return be}function ye(be,L){return L}function xe(be,L){return[be,L]}}function Ue(){var S=(function(){function T(){this._map=new P}return Object.defineProperty(T.prototype,"size",{get:function(){return this._map.size},enumerable:!0,configurable:!0}),T.prototype.has=function(j){return this._map.has(j)},T.prototype.add=function(j){return this._map.set(j,j),this},T.prototype.delete=function(j){return this._map.delete(j)},T.prototype.clear=function(){this._map.clear()},T.prototype.keys=function(){return this._map.keys()},T.prototype.values=function(){return this._map.keys()},T.prototype.entries=function(){return this._map.entries()},T.prototype["@@iterator"]=function(){return this.keys()},T.prototype[l]=function(){return this.keys()},T})();return S}function vt(){var S=16,T=v.create(),j=q();return(function(){function L(){this._key=q()}return L.prototype.has=function(se){var ae=F(se,!1);return ae!==void 0?v.has(ae,this._key):!1},L.prototype.get=function(se){var ae=F(se,!1);return ae!==void 0?v.get(ae,this._key):void 0},L.prototype.set=function(se,ae){var le=F(se,!0);return le[this._key]=ae,this},L.prototype.delete=function(se){var ae=F(se,!1);return ae!==void 0?delete ae[this._key]:!1},L.prototype.clear=function(){this._key=q()},L})();function q(){var L;do L="@@WeakMap@@"+be();while(v.has(T,L));return T[L]=!0,L}function F(L,se){if(!r.call(L,j)){if(!se)return;Object.defineProperty(L,j,{value:v.create()})}return L[j]}function ye(L,se){for(var ae=0;ae<se;++ae)L[ae]=Math.random()*255|0;return L}function xe(L){if(typeof Uint8Array=="function"){var se=new Uint8Array(L);return typeof crypto<"u"?crypto.getRandomValues(se):typeof msCrypto<"u"?msCrypto.getRandomValues(se):ye(se,L),se}return ye(new Array(L),L)}function be(){var L=xe(S);L[6]=L[6]&79|64,L[8]=L[8]&191|128;for(var se="",ae=0;ae<S;++ae){var le=L[ae];(ae===4||ae===6||ae===8)&&(se+="-"),le<16&&(se+="0"),se+=le.toString(16).toLowerCase()}return se}}function nt(S){return S.__=void 0,delete S.__,S}})})(n||(n={})),sl}jd();function Md(n){const e=Object.create(null);for(const t of n.split(","))e[t]=1;return t=>t in e}const Da={},bs=()=>{},Ka=Object.assign,Rd=(n,e)=>{const t=n.indexOf(e);t>-1&&n.splice(t,1)},$d=Object.prototype.hasOwnProperty,Es=(n,e)=>$d.call(n,e),Dt=Array.isArray,sr=n=>Ds(n)==="[object Map]",Ld=n=>Ds(n)==="[object Set]",fn=n=>typeof n=="function",Bd=n=>typeof n=="string",Er=n=>typeof n=="symbol",Rn=n=>n!==null&&typeof n=="object",Fd=n=>(Rn(n)||fn(n))&&fn(n.then)&&fn(n.catch),Dd=Object.prototype.toString,Ds=n=>Dd.call(n),Kd=n=>Ds(n).slice(8,-1),qd=n=>Ds(n)==="[object Object]",Ks=n=>Bd(n)&&n!=="NaN"&&n[0]!=="-"&&""+parseInt(n,10)===n,tn=(n,e)=>!Object.is(n,e),Ud=(n,e,t,i=!1)=>{Object.defineProperty(n,e,{configurable:!0,enumerable:!1,writable:i,value:t})};let al;const qa=()=>al||(al=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});let gt;class zd{constructor(e=!1){this.detached=e,this._active=!0,this._on=0,this.effects=[],this.cleanups=[],this._isPaused=!1,this.__v_skip=!0,this.parent=gt,!e&>&&(this.index=(gt.scopes||(gt.scopes=[])).push(this)-1)}get active(){return this._active}pause(){if(this._active){this._isPaused=!0;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].pause();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].pause()}}resume(){if(this._active&&this._isPaused){this._isPaused=!1;let e,t;if(this.scopes)for(e=0,t=this.scopes.length;e<t;e++)this.scopes[e].resume();for(e=0,t=this.effects.length;e<t;e++)this.effects[e].resume()}}run(e){if(this._active){const t=gt;try{return gt=this,e()}finally{gt=t}}}on(){++this._on===1&&(this.prevScope=gt,gt=this)}off(){this._on>0&&--this._on===0&&(gt=this.prevScope,this.prevScope=void 0)}stop(e){if(this._active){this._active=!1;let t,i;for(t=0,i=this.effects.length;t<i;t++)this.effects[t].stop();for(this.effects.length=0,t=0,i=this.cleanups.length;t<i;t++)this.cleanups[t]();if(this.cleanups.length=0,this.scopes){for(t=0,i=this.scopes.length;t<i;t++)this.scopes[t].stop(!0);this.scopes.length=0}if(!this.detached&&this.parent&&!e){const r=this.parent.scopes.pop();r&&r!==this&&(this.parent.scopes[this.index]=r,r.index=this.index)}this.parent=void 0}}}function Vd(n){return new zd(n)}function cu(){return gt}function Wd(n,e=!1){gt&>.cleanups.push(n)}let Fe;const Po=new WeakSet;class Hd{constructor(e){this.fn=e,this.deps=void 0,this.depsTail=void 0,this.flags=5,this.next=void 0,this.cleanup=void 0,this.scheduler=void 0,gt&>.active&>.effects.push(this)}pause(){this.flags|=64}resume(){this.flags&64&&(this.flags&=-65,Po.has(this)&&(Po.delete(this),this.trigger()))}notify(){this.flags&2&&!(this.flags&32)||this.flags&8||uu(this)}run(){if(!(this.flags&1))return this.fn();this.flags|=2,cl(this),fu(this);const e=Fe,t=Gt;Fe=this,Gt=!0;try{return this.fn()}finally{du(this),Fe=e,Gt=t,this.flags&=-3}}stop(){if(this.flags&1){for(let e=this.deps;e;e=e.nextDep)Va(e);this.deps=this.depsTail=void 0,cl(this),this.onStop&&this.onStop(),this.flags&=-2}}trigger(){this.flags&64?Po.add(this):this.scheduler?this.scheduler():this.runIfDirty()}runIfDirty(){ea(this)&&this.run()}get dirty(){return ea(this)}}let lu=0,or,ar;function uu(n,e=!1){if(n.flags|=8,e){n.next=ar,ar=n;return}n.next=or,or=n}function Ua(){lu++}function za(){if(--lu>0)return;if(ar){let e=ar;for(ar=void 0;e;){const t=e.next;e.next=void 0,e.flags&=-9,e=t}}let n;for(;or;){let e=or;for(or=void 0;e;){const t=e.next;if(e.next=void 0,e.flags&=-9,e.flags&1)try{e.trigger()}catch(i){n||(n=i)}e=t}}if(n)throw n}function fu(n){for(let e=n.deps;e;e=e.nextDep)e.version=-1,e.prevActiveLink=e.dep.activeLink,e.dep.activeLink=e}function du(n){let e,t=n.depsTail,i=t;for(;i;){const r=i.prevDep;i.version===-1?(i===t&&(t=r),Va(i),Gd(i)):e=i,i.dep.activeLink=i.prevActiveLink,i.prevActiveLink=void 0,i=r}n.deps=e,n.depsTail=t}function ea(n){for(let e=n.deps;e;e=e.nextDep)if(e.dep.version!==e.version||e.dep.computed&&(pu(e.dep.computed)||e.dep.version!==e.version))return!0;return!!n._dirty}function pu(n){if(n.flags&4&&!(n.flags&16)||(n.flags&=-17,n.globalVersion===mr)||(n.globalVersion=mr,!n.isSSR&&n.flags&128&&(!n.deps&&!n._dirty||!ea(n))))return;n.flags|=2;const e=n.dep,t=Fe,i=Gt;Fe=n,Gt=!0;try{fu(n);const r=n.fn(n._value);(e.version===0||tn(r,n._value))&&(n.flags|=128,n._value=r,e.version++)}catch(r){throw e.version++,r}finally{Fe=t,Gt=i,du(n),n.flags&=-3}}function Va(n,e=!1){const{dep:t,prevSub:i,nextSub:r}=n;if(i&&(i.nextSub=r,n.prevSub=void 0),r&&(r.prevSub=i,n.nextSub=void 0),t.subs===n&&(t.subs=i,!i&&t.computed)){t.computed.flags&=-5;for(let s=t.computed.deps;s;s=s.nextDep)Va(s,!0)}!e&&!--t.sc&&t.map&&t.map.delete(t.key)}function Gd(n){const{prevDep:e,nextDep:t}=n;e&&(e.nextDep=t,n.prevDep=void 0),t&&(t.prevDep=e,n.nextDep=void 0)}let Gt=!0;const hu=[];function Wa(){hu.push(Gt),Gt=!1}function Ha(){const n=hu.pop();Gt=n===void 0?!0:n}function cl(n){const{cleanup:e}=n;if(n.cleanup=void 0,e){const t=Fe;Fe=void 0;try{e()}finally{Fe=t}}}let mr=0;class Yd{constructor(e,t){this.sub=e,this.dep=t,this.version=t.version,this.nextDep=this.prevDep=this.nextSub=this.prevSub=this.prevActiveLink=void 0}}class Ga{constructor(e){this.computed=e,this.version=0,this.activeLink=void 0,this.subs=void 0,this.map=void 0,this.key=void 0,this.sc=0,this.__v_skip=!0}track(e){if(!Fe||!Gt||Fe===this.computed)return;let t=this.activeLink;if(t===void 0||t.sub!==Fe)t=this.activeLink=new Yd(Fe,this),Fe.deps?(t.prevDep=Fe.depsTail,Fe.depsTail.nextDep=t,Fe.depsTail=t):Fe.deps=Fe.depsTail=t,gu(t);else if(t.version===-1&&(t.version=this.version,t.nextDep)){const i=t.nextDep;i.prevDep=t.prevDep,t.prevDep&&(t.prevDep.nextDep=i),t.prevDep=Fe.depsTail,t.nextDep=void 0,Fe.depsTail.nextDep=t,Fe.depsTail=t,Fe.deps===t&&(Fe.deps=i)}return t}trigger(e){this.version++,mr++,this.notify(e)}notify(e){Ua();try{for(let t=this.subs;t;t=t.prevSub)t.sub.notify()&&t.sub.dep.notify()}finally{za()}}}function gu(n){if(n.dep.sc++,n.sub.flags&4){const e=n.dep.computed;if(e&&!n.dep.subs){e.flags|=20;for(let i=e.deps;i;i=i.nextDep)gu(i)}const t=n.dep.subs;t!==n&&(n.prevSub=t,t&&(t.nextSub=n)),n.dep.subs=n}}const Is=new WeakMap,ti=Symbol(""),ta=Symbol(""),vr=Symbol("");function Ct(n,e,t){if(Gt&&Fe){let i=Is.get(n);i||Is.set(n,i=new Map);let r=i.get(t);r||(i.set(t,r=new Ga),r.map=i,r.key=t),r.track()}}function Pn(n,e,t,i,r,s){const a=Is.get(n);if(!a){mr++;return}const l=d=>{d&&d.trigger()};if(Ua(),e==="clear")a.forEach(l);else{const d=Dt(n),h=d&&Ks(t);if(d&&t==="length"){const m=Number(i);a.forEach((v,w)=>{(w==="length"||w===vr||!Er(w)&&w>=m)&&l(v)})}else switch((t!==void 0||a.has(void 0))&&l(a.get(t)),h&&l(a.get(vr)),e){case"add":d?h&&l(a.get("length")):(l(a.get(ti)),sr(n)&&l(a.get(ta)));break;case"delete":d||(l(a.get(ti)),sr(n)&&l(a.get(ta)));break;case"set":sr(n)&&l(a.get(ti));break}}za()}function Jd(n,e){const t=Is.get(n);return t&&t.get(e)}function yi(n){const e=Me(n);return e===n?e:(Ct(e,"iterate",vr),Lt(n)?e:e.map(hn))}function Ya(n){return Ct(n=Me(n),"iterate",vr),n}function en(n,e){return $n(n)?yr(Nn(n)?hn(e):e):hn(e)}const Qd={__proto__:null,[Symbol.iterator](){return To(this,Symbol.iterator,n=>en(this,n))},concat(...n){return yi(this).concat(...n.map(e=>Dt(e)?yi(e):e))},entries(){return To(this,"entries",n=>(n[1]=en(this,n[1]),n))},every(n,e){return cn(this,"every",n,e,void 0,arguments)},filter(n,e){return cn(this,"filter",n,e,t=>t.map(i=>en(this,i)),arguments)},find(n,e){return cn(this,"find",n,e,t=>en(this,t),arguments)},findIndex(n,e){return cn(this,"findIndex",n,e,void 0,arguments)},findLast(n,e){return cn(this,"findLast",n,e,t=>en(this,t),arguments)},findLastIndex(n,e){return cn(this,"findLastIndex",n,e,void 0,arguments)},forEach(n,e){return cn(this,"forEach",n,e,void 0,arguments)},includes(...n){return No(this,"includes",n)},indexOf(...n){return No(this,"indexOf",n)},join(n){return yi(this).join(n)},lastIndexOf(...n){return No(this,"lastIndexOf",n)},map(n,e){return cn(this,"map",n,e,void 0,arguments)},pop(){return Gi(this,"pop")},push(...n){return Gi(this,"push",n)},reduce(n,...e){return ll(this,"reduce",n,e)},reduceRight(n,...e){return ll(this,"reduceRight",n,e)},shift(){return Gi(this,"shift")},some(n,e){return cn(this,"some",n,e,void 0,arguments)},splice(...n){return Gi(this,"splice",n)},toReversed(){return yi(this).toReversed()},toSorted(n){return yi(this).toSorted(n)},toSpliced(...n){return yi(this).toSpliced(...n)},unshift(...n){return Gi(this,"unshift",n)},values(){return To(this,"values",n=>en(this,n))}};function To(n,e,t){const i=Ya(n),r=i[e]();return i!==n&&!Lt(n)&&(r._next=r.next,r.next=()=>{const s=r._next();return s.done||(s.value=t(s.value)),s}),r}const Xd=Array.prototype;function cn(n,e,t,i,r,s){const a=Ya(n),l=a!==n&&!Lt(n),d=a[e];if(d!==Xd[e]){const v=d.apply(n,s);return l?hn(v):v}let h=t;a!==n&&(l?h=function(v,w){return t.call(this,en(n,v),w,n)}:t.length>2&&(h=function(v,w){return t.call(this,v,w,n)}));const m=d.call(a,h,i);return l&&r?r(m):m}function ll(n,e,t,i){const r=Ya(n),s=r!==n&&!Lt(n);let a=t,l=!1;r!==n&&(s?(l=i.length===0,a=function(h,m,v){return l&&(l=!1,h=en(n,h)),t.call(this,h,en(n,m),v,n)}):t.length>3&&(a=function(h,m,v){return t.call(this,h,m,v,n)}));const d=r[e](a,...i);return l?en(n,d):d}function No(n,e,t){const i=Me(n);Ct(i,"iterate",vr);const r=i[e](...t);return(r===-1||r===!1)&&Su(t[0])?(t[0]=Me(t[0]),i[e](...t)):r}function Gi(n,e,t=[]){Wa(),Ua();const i=Me(n)[e].apply(n,t);return za(),Ha(),i}const Zd=Md("__proto__,__v_isRef,__isVue"),mu=new Set(Object.getOwnPropertyNames(Symbol).filter(n=>n!=="arguments"&&n!=="caller").map(n=>Symbol[n]).filter(Er));function ep(n){Er(n)||(n=String(n));const e=Me(this);return Ct(e,"has",n),e.hasOwnProperty(n)}class vu{constructor(e=!1,t=!1){this._isReadonly=e,this._isShallow=t}get(e,t,i){if(t==="__v_skip")return e.__v_skip;const r=this._isReadonly,s=this._isShallow;if(t==="__v_isReactive")return!r;if(t==="__v_isReadonly")return r;if(t==="__v_isShallow")return s;if(t==="__v_raw")return i===(r?s?up:wu:s?lp:bu).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(i)?e:void 0;const a=Dt(e);if(!r){let d;if(a&&(d=Qd[t]))return d;if(t==="hasOwnProperty")return ep}const l=Reflect.get(e,t,ct(e)?e:i);if((Er(t)?mu.has(t):Zd(t))||(r||Ct(e,"get",t),s))return l;if(ct(l)){const d=a&&Ks(t)?l:l.value;return r&&Rn(d)?ia(d):d}return Rn(l)?r?ia(l):Ja(l):l}}class tp extends vu{constructor(e=!1){super(!1,e)}set(e,t,i,r){let s=e[t];const a=Dt(e)&&Ks(t);if(!this._isShallow){const h=$n(s);if(!Lt(i)&&!$n(i)&&(s=Me(s),i=Me(i)),!a&&ct(s)&&!ct(i))return h||(s.value=i),!0}const l=a?Number(t)<e.length:Es(e,t),d=Reflect.set(e,t,i,ct(e)?e:r);return e===Me(r)&&(l?tn(i,s)&&Pn(e,"set",t,i):Pn(e,"add",t,i)),d}deleteProperty(e,t){const i=Es(e,t);e[t];const r=Reflect.deleteProperty(e,t);return r&&i&&Pn(e,"delete",t,void 0),r}has(e,t){const i=Reflect.has(e,t);return(!Er(t)||!mu.has(t))&&Ct(e,"has",t),i}ownKeys(e){return Ct(e,"iterate",Dt(e)?"length":ti),Reflect.ownKeys(e)}}class np extends vu{constructor(e=!1){super(!0,e)}set(e,t){return!0}deleteProperty(e,t){return!0}}const ip=new tp,rp=new np,na=n=>n,ns=n=>Reflect.getPrototypeOf(n);function sp(n,e,t){return function(...i){const r=this.__v_raw,s=Me(r),a=sr(s),l=n==="entries"||n===Symbol.iterator&&a,d=n==="keys"&&a,h=r[n](...i),m=t?na:e?yr:hn;return!e&&Ct(s,"iterate",d?ta:ti),Ka(Object.create(h),{next(){const{value:v,done:w}=h.next();return w?{value:v,done:w}:{value:l?[m(v[0]),m(v[1])]:m(v),done:w}}})}}function is(n){return function(...e){return n==="delete"?!1:n==="clear"?void 0:this}}function op(n,e){const t={get(r){const s=this.__v_raw,a=Me(s),l=Me(r);n||(tn(r,l)&&Ct(a,"get",r),Ct(a,"get",l));const{has:d}=ns(a),h=e?na:n?yr:hn;if(d.call(a,r))return h(s.get(r));if(d.call(a,l))return h(s.get(l));s!==a&&s.get(r)},get size(){const r=this.__v_raw;return!n&&Ct(Me(r),"iterate",ti),r.size},has(r){const s=this.__v_raw,a=Me(s),l=Me(r);return n||(tn(r,l)&&Ct(a,"has",r),Ct(a,"has",l)),r===l?s.has(r):s.has(r)||s.has(l)},forEach(r,s){const a=this,l=a.__v_raw,d=Me(l),h=e?na:n?yr:hn;return!n&&Ct(d,"iterate",ti),l.forEach((m,v)=>r.call(s,h(m),h(v),a))}};return Ka(t,n?{add:is("add"),set:is("set"),delete:is("delete"),clear:is("clear")}:{add(r){const s=Me(this),a=ns(s),l=Me(r),d=!e&&!Lt(r)&&!$n(r)?l:r;return a.has.call(s,d)||tn(r,d)&&a.has.call(s,r)||tn(l,d)&&a.has.call(s,l)||(s.add(d),Pn(s,"add",d,d)),this},set(r,s){!e&&!Lt(s)&&!$n(s)&&(s=Me(s));const a=Me(this),{has:l,get:d}=ns(a);let h=l.call(a,r);h||(r=Me(r),h=l.call(a,r));const m=d.call(a,r);return a.set(r,s),h?tn(s,m)&&Pn(a,"set",r,s):Pn(a,"add",r,s),this},delete(r){const s=Me(this),{has:a,get:l}=ns(s);let d=a.call(s,r);d||(r=Me(r),d=a.call(s,r)),l&&l.call(s,r);const h=s.delete(r);return d&&Pn(s,"delete",r,void 0),h},clear(){const r=Me(this),s=r.size!==0,a=r.clear();return s&&Pn(r,"clear",void 0,void 0),a}}),["keys","values","entries",Symbol.iterator].forEach(r=>{t[r]=sp(r,n,e)}),t}function yu(n,e){const t=op(n,e);return(i,r,s)=>r==="__v_isReactive"?!n:r==="__v_isReadonly"?n:r==="__v_raw"?i:Reflect.get(Es(t,r)&&r in i?t:i,r,s)}const ap={get:yu(!1,!1)},cp={get:yu(!0,!1)},bu=new WeakMap,lp=new WeakMap,wu=new WeakMap,up=new WeakMap;function fp(n){switch(n){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function dp(n){return n.__v_skip||!Object.isExtensible(n)?0:fp(Kd(n))}function Ja(n){return $n(n)?n:xu(n,!1,ip,ap,bu)}function ia(n){return xu(n,!0,rp,cp,wu)}function xu(n,e,t,i,r){if(!Rn(n)||n.__v_raw&&!(e&&n.__v_isReactive))return n;const s=dp(n);if(s===0)return n;const a=r.get(n);if(a)return a;const l=new Proxy(n,s===2?i:t);return r.set(n,l),l}function Nn(n){return $n(n)?Nn(n.__v_raw):!!(n&&n.__v_isReactive)}function $n(n){return!!(n&&n.__v_isReadonly)}function Lt(n){return!!(n&&n.__v_isShallow)}function Su(n){return n?!!n.__v_raw:!1}function Me(n){const e=n&&n.__v_raw;return e?Me(e):n}function pp(n){return!Es(n,"__v_skip")&&Object.isExtensible(n)&&Ud(n,"__v_skip",!0),n}const hn=n=>Rn(n)?Ja(n):n,yr=n=>Rn(n)?ia(n):n;function ct(n){return n?n.__v_isRef===!0:!1}function hp(n){return gp(n,!1)}function gp(n,e){return ct(n)?n:new mp(n,e)}class mp{constructor(e,t){this.dep=new Ga,this.__v_isRef=!0,this.__v_isShallow=!1,this._rawValue=t?e:Me(e),this._value=t?e:hn(e),this.__v_isShallow=t}get value(){return this.dep.track(),this._value}set value(e){const t=this._rawValue,i=this.__v_isShallow||Lt(e)||$n(e);e=i?e:Me(e),tn(e,t)&&(this._rawValue=e,this._value=i?e:hn(e),this.dep.trigger())}}function vp(n){return ct(n)?n.value:n}function yp(n){const e=Dt(n)?new Array(n.length):{};for(const t in n)e[t]=ku(n,t);return e}class bp{constructor(e,t,i){this._object=e,this._key=t,this._defaultValue=i,this.__v_isRef=!0,this._value=void 0,this._raw=Me(e);let r=!0,s=e;if(!Dt(e)||!Ks(String(t)))do r=!Su(s)||Lt(s);while(r&&(s=s.__v_raw));this._shallow=r}get value(){let e=this._object[this._key];return this._shallow&&(e=vp(e)),this._value=e===void 0?this._defaultValue:e}set value(e){if(this._shallow&&ct(this._raw[this._key])){const t=this._object[this._key];if(ct(t)){t.value=e;return}}this._object[this._key]=e}get dep(){return Jd(this._raw,this._key)}}class wp{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0,this._value=void 0}get value(){return this._value=this._getter()}}function xp(n,e,t){return ct(n)?n:fn(n)?new wp(n):Rn(n)&&arguments.length>1?ku(n,e,t):hp(n)}function ku(n,e,t){return new bp(n,e,t)}class Sp{constructor(e,t,i){this.fn=e,this.setter=t,this._value=void 0,this.dep=new Ga(this),this.__v_isRef=!0,this.deps=void 0,this.depsTail=void 0,this.flags=16,this.globalVersion=mr-1,this.next=void 0,this.effect=this,this.__v_isReadonly=!t,this.isSSR=i}notify(){if(this.flags|=16,!(this.flags&8)&&Fe!==this)return uu(this,!0),!0}get value(){const e=this.dep.track();return pu(this),e&&(e.version=this.dep.version),this._value}set value(e){this.setter&&this.setter(e)}}function kp(n,e,t=!1){let i,r;return fn(n)?i=n:(i=n.get,r=n.set),new Sp(i,r,t)}const rs={},Os=new WeakMap;let Gn;function _p(n,e=!1,t=Gn){if(t){let i=Os.get(t);i||Os.set(t,i=[]),i.push(n)}}function Cp(n,e,t=Da){const{immediate:i,deep:r,once:s,scheduler:a,augmentJob:l,call:d}=t,h=J=>r?J:Lt(J)||r===!1||r===0?Tn(J,1):Tn(J);let m,v,w,P,K=!1,A=!1;if(ct(n)?(v=()=>n.value,K=Lt(n)):Nn(n)?(v=()=>h(n),K=!0):Dt(n)?(A=!0,K=n.some(J=>Nn(J)||Lt(J)),v=()=>n.map(J=>{if(ct(J))return J.value;if(Nn(J))return h(J);if(fn(J))return d?d(J,2):J()})):fn(n)?e?v=d?()=>d(n,2):n:v=()=>{if(w){Wa();try{w()}finally{Ha()}}const J=Gn;Gn=m;try{return d?d(n,3,[P]):n(P)}finally{Gn=J}}:v=bs,e&&r){const J=v,ne=r===!0?1/0:r;v=()=>Tn(J(),ne)}const D=cu(),z=()=>{m.stop(),D&&D.active&&Rd(D.effects,m)};if(s&&e){const J=e;e=(...ne)=>{J(...ne),z()}}let H=A?new Array(n.length).fill(rs):rs;const ie=J=>{if(!(!(m.flags&1)||!m.dirty&&!J))if(e){const ne=m.run();if(r||K||(A?ne.some((ue,pe)=>tn(ue,H[pe])):tn(ne,H))){w&&w();const ue=Gn;Gn=m;try{const pe=[ne,H===rs?void 0:A&&H[0]===rs?[]:H,P];H=ne,d?d(e,3,pe):e(...pe)}finally{Gn=ue}}}else m.run()};return l&&l(ie),m=new Hd(v),m.scheduler=a?()=>a(ie,!1):ie,P=J=>_p(J,!1,m),w=m.onStop=()=>{const J=Os.get(m);if(J){if(d)d(J,4);else for(const ne of J)ne();Os.delete(m)}},e?i?ie(!0):H=m.run():a?a(ie.bind(null,!0),!0):m.run(),z.pause=m.pause.bind(m),z.resume=m.resume.bind(m),z.stop=z,z}function Tn(n,e=1/0,t){if(e<=0||!Rn(n)||n.__v_skip||(t=t||new Map,(t.get(n)||0)>=e))return n;if(t.set(n,e),e--,ct(n))Tn(n.value,e,t);else if(Dt(n))for(let i=0;i<n.length;i++)Tn(n[i],e,t);else if(Ld(n)||sr(n))n.forEach(i=>{Tn(i,e,t)});else if(qd(n)){for(const i in n)Tn(n[i],e,t);for(const i of Object.getOwnPropertySymbols(n))Object.prototype.propertyIsEnumerable.call(n,i)&&Tn(n[i],e,t)}return n}function Qa(n,e,t,i){try{return i?n(...i):n()}catch(r){Cu(r,e,t)}}function _u(n,e,t,i){if(fn(n)){const r=Qa(n,e,t,i);return r&&Fd(r)&&r.catch(s=>{Cu(s,e,t)}),r}if(Dt(n)){const r=[];for(let s=0;s<n.length;s++)r.push(_u(n[s],e,t,i));return r}}function Cu(n,e,t,i=!0){const r=e?e.vnode:null,{errorHandler:s,throwUnhandledErrorInProduction:a}=e&&e.appContext.config||Da;if(e){let l=e.parent;const d=e.proxy,h=`https://vuejs.org/error-reference/#runtime-${t}`;for(;l;){const m=l.ec;if(m){for(let v=0;v<m.length;v++)if(m[v](n,d,h)===!1)return}l=l.parent}if(s){Wa(),Qa(s,null,10,[n,d,h]),Ha();return}}Ep(n,t,r,i,a)}function Ep(n,e,t,i=!0,r=!1){if(r)throw n;console.error(n)}const Rt=[];let ln=-1;const Oi=[];let En=null,Si=0;const Eu=Promise.resolve();let As=null;function Ip(n){const e=As||Eu;return n?e.then(this?n.bind(this):n):e}function Op(n){let e=ln+1,t=Rt.length;for(;e<t;){const i=e+t>>>1,r=Rt[i],s=br(r);s<n||s===n&&r.flags&2?e=i+1:t=i}return e}function Ap(n){if(!(n.flags&1)){const e=br(n),t=Rt[Rt.length-1];!t||!(n.flags&2)&&e>=br(t)?Rt.push(n):Rt.splice(Op(e),0,n),n.flags|=1,Iu()}}function Iu(){As||(As=Eu.then(Ou))}function Pp(n){Dt(n)?Oi.push(...n):En&&n.id===-1?En.splice(Si+1,0,n):n.flags&1||(Oi.push(n),n.flags|=1),Iu()}function Tp(n){if(Oi.length){const e=[...new Set(Oi)].sort((t,i)=>br(t)-br(i));if(Oi.length=0,En){En.push(...e);return}for(En=e,Si=0;Si<En.length;Si++){const t=En[Si];t.flags&4&&(t.flags&=-2),t.flags&8||t(),t.flags&=-2}En=null,Si=0}}const br=n=>n.id==null?n.flags&2?-1:1/0:n.id;function Ou(n){try{for(ln=0;ln<Rt.length;ln++){const e=Rt[ln];e&&!(e.flags&8)&&(e.flags&4&&(e.flags&=-2),Qa(e,e.i,e.i?15:14),e.flags&4||(e.flags&=-2))}}finally{for(;ln<Rt.length;ln++){const e=Rt[ln];e&&(e.flags&=-2)}ln=-1,Rt.length=0,Tp(),As=null,(Rt.length||Oi.length)&&Ou()}}let Np=null;function Au(n,e,t=!1){const i=Tu();if(i||Pu){let r=i?i.parent==null||i.ce?i.vnode.appContext&&i.vnode.appContext.provides:i.parent.provides:void 0;if(r&&n in r)return r[n];if(arguments.length>1)return t&&fn(e)?e.call(i&&i.proxy):e}}function jp(){return!!(Tu()||Pu)}const Mp=Symbol.for("v-scx"),Rp=()=>Au(Mp);function $p(n,e,t){return Lp(n,e,t)}function Lp(n,e,t=Da){const{immediate:i,deep:r,flush:s,once:a}=t,l=Ka({},t),d=e&&i||!e&&s!=="post";let h;if(Ps){if(s==="sync"){const P=Rp();h=P.__watcherHandles||(P.__watcherHandles=[])}else if(!d){const P=()=>{};return P.stop=bs,P.resume=bs,P.pause=bs,P}}const m=Xa;l.call=(P,K,A)=>_u(P,m,K,A);let v=!1;s==="post"?l.scheduler=P=>{Bp(P,m&&m.suspense)}:s!=="sync"&&(v=!0,l.scheduler=(P,K)=>{K?P():Ap(P)}),l.augmentJob=P=>{e&&(P.flags|=4),v&&(P.flags|=2,m&&(P.id=m.uid,P.i=m))};const w=Cp(n,e,l);return Ps&&(h?h.push(w):d&&w()),w}qa().requestIdleCallback;qa().cancelIdleCallback;let Pu=null;const Bp=Fp;function Fp(n,e){e&&e.pendingBranch?Dt(n)?e.effects.push(...n):e.effects.push(n):Pp(n)}let Xa=null;const Tu=()=>Xa||Np;{const n=qa(),e=(t,i)=>{let r;return(r=n[t])||(r=n[t]=[]),r.push(i),s=>{r.length>1?r.forEach(a=>a(s)):r[0](s)}};e("__VUE_INSTANCE_SETTERS__",t=>Xa=t),e("__VUE_SSR_SETTERS__",t=>Ps=t)}let Ps=!1;const Nu=(n,e)=>kp(n,e,Ps);function Ze(n){return(typeof n=="object"&&n!==null||typeof n=="function")&&typeof n.then=="function"}function lt(n){switch(typeof n){case"string":case"symbol":return n.toString();case"function":return n.name;default:throw new Error(`Unexpected ${typeof n} service id type`)}}const jo=Symbol.for("@inversifyjs/common/islazyServiceIdentifier");class Ts{[jo];#e;constructor(e){this.#e=e,this[jo]=!0}static is(e){return typeof e=="object"&&e!==null&&e[jo]===!0}unwrap(){return this.#e()}}var ul={};var fl;function Dp(){if(fl)return ul;fl=1;var n;return(function(e){(function(t){var i=typeof globalThis=="object"?globalThis:typeof gr=="object"?gr:typeof self=="object"?self:typeof this=="object"?this:a(),r=s(e);typeof i.Reflect<"u"&&(r=s(i.Reflect,r)),t(r,i),typeof i.Reflect>"u"&&(i.Reflect=e);function s(l,d){return function(h,m){Object.defineProperty(l,h,{configurable:!0,writable:!0,value:m}),d&&d(h,m)}}function a(){throw new ReferenceError("globalThis could not be found. Please polyfill globalThis before loading this module.")}})(function(t,i){var r=typeof Symbol=="function",s=r&&typeof Symbol.toPrimitive<"u"?Symbol.toPrimitive:Qt("Symbol.toPrimitive not found."),a=r&&typeof Symbol.iterator<"u"?Symbol.iterator:Qt("Symbol.iterator not found."),l=Object.getPrototypeOf(Function),d=typeof Map=="function"&&typeof Map.prototype.entries=="function"?Map:Qt("A valid Map constructor could not be found."),h=typeof Set=="function"&&typeof Set.prototype.entries=="function"?Set:Qt("A valid Set constructor could not be found."),m=typeof WeakMap=="function"?WeakMap:Qt("A valid WeakMap constructor could not be found."),v=r?Symbol.for("@reflect-metadata:registry"):void 0,w=ui(),P=mn(w);function K(B,V,W,X){if(he(W)){if(!Vt(B))throw new TypeError;if(!Bn(V))throw new TypeError;return Q(B,V)}else{if(!Vt(B))throw new TypeError;if(!Ke(V))throw new TypeError;if(!Ke(X)&&!he(X)&&!ft(X))throw new TypeError;return ft(X)&&(X=void 0),W=Ee(W),ge(B,V,W,X)}}t("decorate",K);function A(B,V){function W(X,de){if(!Ke(X))throw new TypeError;if(!he(de)&&!fe(de))throw new TypeError;gn(B,V,X,de)}return W}t("metadata",A);function D(B,V,W,X){if(!Ke(W))throw new TypeError;return he(X)||(X=Ee(X)),gn(B,V,W,X)}t("defineMetadata",D);function z(B,V,W){if(!Ke(V))throw new TypeError;return he(W)||(W=Ee(W)),Re(B,V,W)}t("hasMetadata",z);function H(B,V,W){if(!Ke(V))throw new TypeError;return he(W)||(W=Ee(W)),We(B,V,W)}t("hasOwnMetadata",H);function ie(B,V,W){if(!Ke(V))throw new TypeError;return he(W)||(W=Ee(W)),_e(B,V,W)}t("getMetadata",ie);function J(B,V,W){if(!Ke(V))throw new TypeError;return he(W)||(W=Ee(W)),rt(B,V,W)}t("getOwnMetadata",J);function ne(B,V){if(!Ke(B))throw new TypeError;return he(V)||(V=Ee(V)),zt(B,V)}t("getMetadataKeys",ne);function ue(B,V){if(!Ke(B))throw new TypeError;return he(V)||(V=Ee(V)),ut(B,V)}t("getOwnMetadataKeys",ue);function pe(B,V,W){if(!Ke(V))throw new TypeError;he(W)||(W=Ee(W));var X=Nt(V,W,!1);return he(X)?!1:X.OrdinaryDeleteMetadata(B,V,W)}t("deleteMetadata",pe);function Q(B,V){for(var W=B.length-1;W>=0;--W){var X=B[W],de=X(V);if(!he(de)&&!ft(de)){if(!Bn(de))throw new TypeError;V=de}}return V}function ge(B,V,W,X){for(var de=B.length-1;de>=0;--de){var st=B[de],Ue=st(V,W,X);if(!he(Ue)&&!ft(Ue)){if(!Ke(Ue))throw new TypeError;X=Ue}}return X}function Re(B,V,W){var X=We(B,V,W);if(X)return!0;var de=rn(V);return ft(de)?!1:Re(B,de,W)}function We(B,V,W){var X=Nt(V,W,!1);return he(X)?!1:dt(X.OrdinaryHasOwnMetadata(B,V,W))}function _e(B,V,W){var X=We(B,V,W);if(X)return rt(B,V,W);var de=rn(V);if(!ft(de))return _e(B,de,W)}function rt(B,V,W){var X=Nt(V,W,!1);if(!he(X))return X.OrdinaryGetOwnMetadata(B,V,W)}function gn(B,V,W,X){var de=Nt(W,X,!0);de.OrdinaryDefineOwnMetadata(B,V,W,X)}function zt(B,V){var W=ut(B,V),X=rn(B);if(X===null)return W;var de=zt(X,V);if(de.length<=0)return W;if(W.length<=0)return de;for(var st=new h,Ue=[],vt=0,nt=W;vt<nt.length;vt++){var S=nt[vt],T=st.has(S);T||(st.add(S),Ue.push(S))}for(var j=0,q=de;j<q.length;j++){var S=q[j],T=st.has(S);T||(st.add(S),Ue.push(S))}return Ue}function ut(B,V){var W=Nt(B,V,!1);return W?W.OrdinaryOwnMetadataKeys(B,V):[]}function tt(B){if(B===null)return 1;switch(typeof B){case"undefined":return 0;case"boolean":return 2;case"string":return 3;case"symbol":return 4;case"number":return 5;case"object":return B===null?1:6;default:return 6}}function he(B){return B===void 0}function ft(B){return B===null}function St(B){return typeof B=="symbol"}function Ke(B){return typeof B=="object"?B!==null:typeof B=="function"}function kt(B,V){switch(tt(B)){case 0:return B;case 1:return B;case 2:return B;case 3:return B;case 4:return B;case 5:return B}var W="string",X=pt(B,s);if(X!==void 0){var de=X.call(B,W);if(Ke(de))throw new TypeError;return de}return ve(B)}function ve(B,V){var W,X;{var de=B.toString;if(Jt(de)){var X=de.call(B);if(!Ke(X))return X}var W=B.valueOf;if(Jt(W)){var X=W.call(B);if(!Ke(X))return X}}throw new TypeError}function dt(B){return!!B}function ci(B){return""+B}function Ee(B){var V=kt(B);return St(V)?V:ci(V)}function Vt(B){return Array.isArray?Array.isArray(B):B instanceof Object?B instanceof Array:Object.prototype.toString.call(B)==="[object Array]"}function Jt(B){return typeof B=="function"}function Bn(B){return typeof B=="function"}function fe(B){switch(tt(B)){case 3:return!0;case 4:return!0;default:return!1}}function pt(B,V){var W=B[V];if(W!=null){if(!Jt(W))throw new TypeError;return W}}function Ie(B){var V=pt(B,a);if(!Jt(V))throw new TypeError;var W=V.call(B);if(!Ke(W))throw new TypeError;return W}function Et(B){return B.value}function Fn(B){var V=B.next();return V.done?!1:V}function Tt(B){var V=B.return;V&&V.call(B)}function rn(B){var V=Object.getPrototypeOf(B);if(typeof B!="function"||B===l||V!==l)return V;var W=B.prototype,X=W&&Object.getPrototypeOf(W);if(X==null||X===Object.prototype)return V;var de=X.constructor;return typeof de!="function"||de===B?V:de}function Qt(B){throw B}function li(){var B;!he(v)&&typeof i.Reflect<"u"&&!(v in i.Reflect)&&typeof i.Reflect.defineMetadata=="function"&&(B=mt(i.Reflect));var V,W,X,de=new m,st={registerProvider:Ue,getProvider:nt,setProvider:T};return st;function Ue(j){if(!Object.isExtensible(st))throw new Error("Cannot add provider to a frozen registry.");switch(!0){case B===j:break;case he(V):V=j;break;case V===j:break;case he(W):W=j;break;case W===j:break;default:X===void 0&&(X=new h),X.add(j);break}}function vt(j,q){if(!he(V)){if(V.isProviderFor(j,q))return V;if(!he(W)){if(W.isProviderFor(j,q))return V;if(!he(X))for(var F=Ie(X);;){var ye=Fn(F);if(!ye)return;var xe=Et(ye);if(xe.isProviderFor(j,q))return Tt(F),xe}}}if(!he(B)&&B.isProviderFor(j,q))return B}function nt(j,q){var F=de.get(j),ye;return he(F)||(ye=F.get(q)),he(ye)&&(ye=vt(j,q),he(ye)||(he(F)&&(F=new d,de.set(j,F)),F.set(q,ye))),ye}function S(j){if(he(j))throw new TypeError;return V===j||W===j||!he(X)&&X.has(j)}function T(j,q,F){if(!S(F))throw new Error("Metadata provider not registered.");var ye=nt(j,q);if(ye!==F){if(!he(ye))return!1;var xe=de.get(j);he(xe)&&(xe=new d,de.set(j,xe)),xe.set(q,F)}return!0}}function ui(){var B;return!he(v)&&Ke(i.Reflect)&&Object.isExtensible(i.Reflect)&&(B=i.Reflect[v]),he(B)&&(B=li()),!he(v)&&Ke(i.Reflect)&&Object.isExtensible(i.Reflect)&&Object.defineProperty(i.Reflect,v,{enumerable:!1,configurable:!1,writable:!1,value:B}),B}function mn(B){var V=new m,W={isProviderFor:function(S,T){var j=V.get(S);return he(j)?!1:j.has(T)},OrdinaryDefineOwnMetadata:Ue,OrdinaryHasOwnMetadata:de,OrdinaryGetOwnMetadata:st,OrdinaryOwnMetadataKeys:vt,OrdinaryDeleteMetadata:nt};return w.registerProvider(W),W;function X(S,T,j){var q=V.get(S),F=!1;if(he(q)){if(!j)return;q=new d,V.set(S,q),F=!0}var ye=q.get(T);if(he(ye)){if(!j)return;if(ye=new d,q.set(T,ye),!B.setProvider(S,T,W))throw q.delete(T),F&&V.delete(S),new Error("Wrong provider for target.")}return ye}function de(S,T,j){var q=X(T,j,!1);return he(q)?!1:dt(q.has(S))}function st(S,T,j){var q=X(T,j,!1);if(!he(q))return q.get(S)}function Ue(S,T,j,q){var F=X(j,q,!0);F.set(S,T)}function vt(S,T){var j=[],q=X(S,T,!1);if(he(q))return j;for(var F=q.keys(),ye=Ie(F),xe=0;;){var be=Fn(ye);if(!be)return j.length=xe,j;var L=Et(be);try{j[xe]=L}catch(se){try{Tt(ye)}finally{throw se}}xe++}}function nt(S,T,j){var q=X(T,j,!1);if(he(q)||!q.delete(S))return!1;if(q.size===0){var F=V.get(T);he(F)||(F.delete(j),F.size===0&&V.delete(F))}return!0}}function mt(B){var V=B.defineMetadata,W=B.hasOwnMetadata,X=B.getOwnMetadata,de=B.getOwnMetadataKeys,st=B.deleteMetadata,Ue=new m,vt={isProviderFor:function(nt,S){var T=Ue.get(nt);return!he(T)&&T.has(S)?!0:de(nt,S).length?(he(T)&&(T=new h,Ue.set(nt,T)),T.add(S),!0):!1},OrdinaryDefineOwnMetadata:V,OrdinaryHasOwnMetadata:W,OrdinaryGetOwnMetadata:X,OrdinaryOwnMetadataKeys:de,OrdinaryDeleteMetadata:st};return vt}function Nt(B,V,W){var X=w.getProvider(B,V);if(!he(X))return X;if(W){if(w.setProvider(B,V,P))return P;throw new Error("Illegal state.")}}})})(n||(n={})),ul}Dp();function Ti(n,e,t){return Reflect.getOwnMetadata(e,n,t)}function ju(n,e,t,i){Reflect.defineMetadata(e,t,n,i)}function ni(n,e,t,i,r){const s=i(Ti(n,e,r)??t());Reflect.defineMetadata(e,s,n,r)}const Mo="@inversifyjs/container/bindingId";function _n(){const n=Ti(Object,Mo)??0;return n===Number.MAX_SAFE_INTEGER?ju(Object,Mo,Number.MIN_SAFE_INTEGER):ni(Object,Mo,()=>n,e=>e+1),n}const Bt={Request:"Request",Singleton:"Singleton",Transient:"Transient"},Ae={ConstantValue:"ConstantValue",DynamicValue:"DynamicValue",Factory:"Factory",Instance:"Instance",Provider:"Provider",ResolvedValue:"ResolvedValue",ServiceRedirection:"ServiceRedirection"};function*Mu(...n){for(const e of n)yield*e}class Ir{#e;#t;#i;constructor(e){this.#e=new Map,this.#t={};for(const t of Reflect.ownKeys(e))this.#t[t]=new Map;this.#i=e}add(e,t){this.#s(e).push(t);for(const i of Reflect.ownKeys(t))this.#o(i,t[i]).push(e)}clone(){const e=this.#n(),t=this.#r(),i=Reflect.ownKeys(this.#i),r=this._buildNewInstance(this.#i);this.#p(this.#e,r.#e,e,t);for(const s of i)this.#a(this.#t[s],r.#t[s],e);return r}get(e,t){return this.#t[e].get(t)}getAllKeys(e){return this.#t[e].keys()}removeByRelation(e,t){const i=this.get(e,t);if(i===void 0)return;const r=new Set(i);for(const s of r){const a=this.#e.get(s);if(a===void 0)throw new Error("Expecting model relation, none found");for(const l of a)l[e]===t&&this.#u(s,l);this.#e.delete(s)}}_buildNewInstance(e){return new Ir(e)}_cloneModel(e){return e}_cloneRelation(e){return e}#n(){const e=new Map;for(const t of this.#e.keys()){const i=this._cloneModel(t);e.set(t,i)}return e}#r(){const e=new Map;for(const t of this.#e.values())for(const i of t){const r=this._cloneRelation(i);e.set(i,r)}return e}#s(e){let t=this.#e.get(e);return t===void 0&&(t=[],this.#e.set(e,t)),t}#o(e,t){let i=this.#t[e].get(t);return i===void 0&&(i=[],this.#t[e].set(t,i)),i}#l(e,t){const i=t.get(e);if(i===void 0)throw new Error("Expecting model to be cloned, none found");return i}#c(e,t){const i=t.get(e);if(i===void 0)throw new Error("Expecting relation to be cloned, none found");return i}#a(e,t,i){for(const[r,s]of e){const a=new Array;for(const l of s)a.push(this.#l(l,i));t.set(r,a)}}#p(e,t,i,r){for(const[s,a]of e){const l=new Array;for(const d of a)l.push(this.#c(d,r));t.set(this.#l(s,i),l)}}#u(e,t){for(const i of Reflect.ownKeys(t))this.#f(e,i,t[i])}#f(e,t,i){const r=this.#t[t].get(i);if(r!==void 0){const s=r.indexOf(e);s!==-1&&r.splice(s,1),r.length===0&&this.#t[t].delete(i)}}}var cr;(function(n){n.moduleId="moduleId",n.serviceId="serviceId"})(cr||(cr={}));class wr{#e;#t;constructor(e,t){this.#e=t??new Ir({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e}static build(e){return new wr(e)}add(e,t){this.#e.add(e,t)}clone(){return new wr(this.#t,this.#e.clone())}get(e){const t=[],i=this.#e.get(cr.serviceId,e);i!==void 0&&t.push(i);const r=this.#t()?.get(e);if(r!==void 0&&t.push(r),t.length!==0)return Mu(...t)}removeAllByModuleId(e){this.#e.removeByRelation(cr.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(cr.serviceId,e)}}const lr="@inversifyjs/core/classMetadataReflectKey";function ur(){return{constructorArguments:[],lifecycle:{postConstructMethodNames:new Set,preDestroyMethodNames:new Set},properties:new Map,scope:void 0}}const Za="@inversifyjs/core/pendingClassMetadataCountReflectKey",Ro=Symbol.for("@inversifyjs/core/InversifyCoreError");class Ne extends Error{[Ro];kind;constructor(e,t,i){super(t,i),this[Ro]=!0,this.kind=e}static is(e){return typeof e=="object"&&e!==null&&e[Ro]===!0}static isErrorOfKind(e,t){return Ne.is(e)&&e.kind===t}}var je,ri,At,fr,wt;function qs(n){const e=Ti(n,lr)??ur();if(!(function(t){const i=Ti(t,Za);return i!==void 0&&i!==0})(n))return(function(t,i){const r=[];if(i.length<t.length)throw new Ne(je.missingInjectionDecorator,`Found unexpected missing metadata on type "${t.name}". "${t.name}" constructor requires at least ${t.length.toString()} arguments, found ${i.length.toString()} instead.
|
|
2
|
-
Are you using @inject, @multiInject or @unmanaged decorators in every non optional constructor argument?
|
|
3
|
-
|
|
4
|
-
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`);for(let s=0;s<i.length;++s)i[s]===void 0&&r.push(s);if(r.length>0)throw new Ne(je.missingInjectionDecorator,`Found unexpected missing metadata on type "${t.name}" at constructor indexes "${r.join('", "')}".
|
|
5
|
-
|
|
6
|
-
Are you using @inject, @multiInject or @unmanaged decorators at those indexes?
|
|
7
|
-
|
|
8
|
-
If you're using typescript and want to rely on auto injection, set "emitDecoratorMetadata" compiler option to true`)})(n,e.constructorArguments),e;(function(t,i){const r=[];for(let s=0;s<i.constructorArguments.length;++s){const a=i.constructorArguments[s];a!==void 0&&a.kind!==ri.unknown||r.push(` - Missing or incomplete metadata for type "${t.name}" at constructor argument with index ${s.toString()}.
|
|
9
|
-
Every constructor parameter must be decorated either with @inject, @multiInject or @unmanaged decorator.`)}for(const[s,a]of i.properties)a.kind===ri.unknown&&r.push(` - Missing or incomplete metadata for type "${t.name}" at property "${s.toString()}".
|
|
10
|
-
This property must be decorated either with @inject or @multiInject decorator.`);throw r.length===0?new Ne(je.unknown,`Unexpected class metadata for type "${t.name}" with uncompletion traces.
|
|
11
|
-
This might be caused by one of the following reasons:
|
|
12
|
-
|
|
13
|
-
1. A third party library is targeting inversify reflection metadata.
|
|
14
|
-
2. A bug is causing the issue. Consider submiting an issue to fix it.`):new Ne(je.missingInjectionDecorator,`Invalid class metadata at type ${t.name}:
|
|
15
|
-
|
|
16
|
-
${r.join(`
|
|
17
|
-
|
|
18
|
-
`)}`)})(n,e)}function Ru(n,e){const t=qs(e).scope??n.scope;return{cache:{isRight:!1,value:void 0},id:_n(),implementationType:e,isSatisfiedBy:()=>!0,moduleId:void 0,onActivation:void 0,onDeactivation:void 0,scope:t,serviceIdentifier:e,type:Ae.Instance}}function Yi(n){return n.isRight?{isRight:!0,value:n.value}:n}function Kp(n){switch(n.type){case Ae.ConstantValue:case Ae.DynamicValue:return(function(e){return{cache:Yi(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type,value:e.value}})(n);case Ae.Factory:return(function(e){return{cache:Yi(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}})(n);case Ae.Instance:return(function(e){return{cache:Yi(e.cache),id:e.id,implementationType:e.implementationType,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}})(n);case Ae.Provider:return(function(e){return{cache:Yi(e.cache),id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,provider:e.provider,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}})(n);case Ae.ResolvedValue:return(function(e){return{cache:Yi(e.cache),factory:e.factory,id:e.id,isSatisfiedBy:e.isSatisfiedBy,metadata:e.metadata,moduleId:e.moduleId,onActivation:e.onActivation,onDeactivation:e.onDeactivation,scope:e.scope,serviceIdentifier:e.serviceIdentifier,type:e.type}})(n);case Ae.ServiceRedirection:return(function(e){return{id:e.id,isSatisfiedBy:e.isSatisfiedBy,moduleId:e.moduleId,serviceIdentifier:e.serviceIdentifier,targetServiceIdentifier:e.targetServiceIdentifier,type:e.type}})(n)}}(function(n){n[n.injectionDecoratorConflict=0]="injectionDecoratorConflict",n[n.missingInjectionDecorator=1]="missingInjectionDecorator",n[n.planning=2]="planning",n[n.resolution=3]="resolution",n[n.unknown=4]="unknown"})(je||(je={})),(function(n){n[n.unknown=32]="unknown"})(ri||(ri={})),(function(n){n.id="id",n.moduleId="moduleId",n.serviceId="serviceId"})(At||(At={}));class ec extends Ir{_buildNewInstance(e){return new ec(e)}_cloneModel(e){return Kp(e)}}let dl=class ra{#e;#t;#i;constructor(e,t,i){this.#t=i??new ec({id:{isOptional:!1},moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#i=e,this.#e=t}static build(e,t){return new ra(e,t)}clone(){return new ra(this.#i,this.#e,this.#t.clone())}get(e){const t=this.getNonParentBindings(e)??this.#i()?.get(e);if(t!==void 0)return t;const i=this.#n(e);return i===void 0?i:[i]}*getChained(e){const t=this.getNonParentBindings(e);t!==void 0&&(yield*t);const i=this.#i();if(i===void 0){if(t===void 0){const r=this.#n(e);r!==void 0&&(yield r)}}else yield*i.getChained(e)}getBoundServices(){const e=new Set(this.#t.getAllKeys(At.serviceId)),t=this.#i();if(t!==void 0)for(const i of t.getBoundServices())e.add(i);return e}getById(e){return this.#t.get(At.id,e)??this.#i()?.getById(e)}getByModuleId(e){return this.#t.get(At.moduleId,e)??this.#i()?.getByModuleId(e)}getNonParentBindings(e){return this.#t.get(At.serviceId,e)}getNonParentBoundServices(){return this.#t.getAllKeys(At.serviceId)}removeById(e){this.#t.removeByRelation(At.id,e)}removeAllByModuleId(e){this.#t.removeByRelation(At.moduleId,e)}removeAllByServiceId(e){this.#t.removeByRelation(At.serviceId,e)}set(e){const t={[At.id]:e.id,[At.serviceId]:e.serviceIdentifier};e.moduleId!==void 0&&(t[At.moduleId]=e.moduleId),this.#t.add(e,t)}#n(e){if(this.#e===void 0||typeof e!="function")return;const t=Ru(this.#e,e);return this.set(t),t}};(function(n){n.moduleId="moduleId",n.serviceId="serviceId"})(fr||(fr={}));let pl=class sa{#e;#t;constructor(e,t){this.#e=t??new Ir({moduleId:{isOptional:!0},serviceId:{isOptional:!1}}),this.#t=e}static build(e){return new sa(e)}add(e,t){this.#e.add(e,t)}clone(){return new sa(this.#t,this.#e.clone())}get(e){const t=[],i=this.#e.get(fr.serviceId,e);i!==void 0&&t.push(i);const r=this.#t()?.get(e);if(r!==void 0&&t.push(r),t.length!==0)return Mu(...t)}removeAllByModuleId(e){this.#e.removeByRelation(fr.moduleId,e)}removeAllByServiceId(e){this.#e.removeByRelation(fr.serviceId,e)}};function $u(){return 0}function Lu(n){return e=>{e!==void 0&&e.kind===ri.unknown&&ni(n,Za,$u,t=>t-1)}}function Bu(n,e){return(...t)=>i=>{if(i===void 0)return n(...t);if(i.kind===wt.unmanaged)throw new Ne(je.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found");return e(i,...t)}}function Fu(n){if(n.kind!==ri.unknown&&n.isFromTypescriptParamType!==!0)throw new Ne(je.injectionDecoratorConflict,"Unexpected injection found. Multiple @inject, @multiInject or @unmanaged decorators found")}(function(n){n[n.multipleInjection=0]="multipleInjection",n[n.singleInjection=1]="singleInjection",n[n.unmanaged=2]="unmanaged"})(wt||(wt={}));const qp=Bu(function(n,e,t){return n===wt.multipleInjection?{chained:t?.chained??!1,kind:n,name:void 0,optional:!1,tags:new Map,value:e}:{kind:n,name:void 0,optional:!1,tags:new Map,value:e}},function(n,e,t,i){return Fu(n),e===wt.multipleInjection?{...n,chained:i?.chained??!1,kind:e,value:t}:{...n,kind:e,value:t}});function hl(n,e){return t=>{const i=t.properties.get(e);return t.properties.set(e,n(i)),t}}var In;function Up(n,e,t,i){if(Ne.isErrorOfKind(i,je.injectionDecoratorConflict)){const r=(function(s,a,l){if(l===void 0){if(a===void 0)throw new Ne(je.unknown,"Unexpected undefined property and index values");return{kind:In.property,property:a,targetClass:s.constructor}}return typeof l=="number"?{index:l,kind:In.parameter,targetClass:s}:{kind:In.method,method:a,targetClass:s}})(n,e,t);throw new Ne(je.injectionDecoratorConflict,`Unexpected injection error.
|
|
19
|
-
|
|
20
|
-
Cause:
|
|
21
|
-
|
|
22
|
-
${i.message}
|
|
23
|
-
|
|
24
|
-
Details
|
|
25
|
-
|
|
26
|
-
${(function(s){switch(s.kind){case In.method:return`[class: "${s.targetClass.name}", method: "${s.method.toString()}"]`;case In.parameter:return`[class: "${s.targetClass.name}", index: "${s.index.toString()}"]`;case In.property:return`[class: "${s.targetClass.name}", property: "${s.property.toString()}"]`}})(r)}`,{cause:i})}throw i}function Us(n,e){return(t,i,r)=>{try{r===void 0?(function(s,a){const l=$o(s,a);return(d,h)=>{ni(d.constructor,lr,ur,hl(l(d),h))}})(n,e)(t,i):typeof r=="number"?(function(s,a){const l=$o(s,a);return(d,h,m)=>{if(!(function(v,w){return typeof v=="function"&&w===void 0})(d,h))throw new Ne(je.injectionDecoratorConflict,`Found an @inject decorator in a non constructor parameter.
|
|
27
|
-
Found @inject decorator at method "${h?.toString()??""}" at class "${d.constructor.name}"`);ni(d,lr,ur,(function(v,w){return P=>{const K=P.constructorArguments[w];return P.constructorArguments[w]=v(K),P}})(l(d),m))}})(n,e)(t,i,r):(function(s,a){const l=$o(s,a);return(d,h,m)=>{if(!(function(v){return v.set!==void 0})(m))throw new Ne(je.injectionDecoratorConflict,`Found an @inject decorator in a non setter property method.
|
|
28
|
-
Found @inject decorator at method "${h.toString()}" at class "${d.constructor.name}"`);ni(d.constructor,lr,ur,hl(l(d),h))}})(n,e)(t,i,r)}catch(s){Up(t,i,r,s)}}}function $o(n,e){return t=>{const i=e(t);return r=>(i(r),n(r))}}function Le(n){return Us(qp(wt.singleInjection,n),Lu)}(function(n){n[n.method=0]="method",n[n.parameter=1]="parameter",n[n.property=2]="property"})(In||(In={}));const gl="@inversifyjs/core/classIsInjectableFlagReflectKey",zp=[Array,BigInt,Boolean,Function,Number,Object,String];function Vp(n){const e=Ti(n,"design:paramtypes");e!==void 0&&ni(n,lr,ur,(function(t){return i=>(t.forEach((r,s)=>{var a;i.constructorArguments[s]!==void 0||(a=r,zp.includes(a))||(i.constructorArguments[s]=(function(l){return{isFromTypescriptParamType:!0,kind:wt.singleInjection,name:void 0,optional:!1,tags:new Map,value:l}})(r))}),i)})(e))}function it(n){return e=>{(function(t){if(Ti(t,gl)!==void 0)throw new Ne(je.injectionDecoratorConflict,`Cannot apply @injectable decorator multiple times at class "${t.name}"`);ju(t,gl,!0)})(e),Vp(e)}}function Du(n){return e=>{e===void 0&&ni(n,Za,$u,t=>t+1)}}function Ku(n){return e=>{const t=e??{kind:ri.unknown,name:void 0,optional:!1,tags:new Map};if(t.kind===wt.unmanaged)throw new Ne(je.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return n(t)}}function tc(n){const e=Ku((function(t){return i=>{if(i.name!==void 0)throw new Ne(je.injectionDecoratorConflict,"Unexpected duplicated named decorator");return i.name=t,i}})(n));return Us(e,Du)}function Wp(n){if(n.optional)throw new Ne(je.injectionDecoratorConflict,"Unexpected duplicated optional decorator");return n.optional=!0,n}function Hp(){return Us(Ku(Wp),Du)}function ml(){return{kind:wt.unmanaged}}const Gp=Bu(ml,function(n){if(Fu(n),(function(e){return e.name!==void 0||e.optional||e.tags.size>0})(n))throw new Ne(je.injectionDecoratorConflict,"Unexpected injection found. Found @unmanaged injection with additional @named, @optional, @tagged or @targetName injections");return ml()});function Yp(){return Us(Gp(),Lu)}var dn;(function(n){n[n.multipleInjection=0]="multipleInjection",n[n.singleInjection=1]="singleInjection"})(dn||(dn={}));const Jp=/stack space|call stack|too much recursion/i,Qp=/too much recursion/;function nc(n){try{return n instanceof Error&&(n instanceof RangeError&&Jp.test(n.message)||n.name==="InternalError"&&Qp.test(n.message))}catch(e){return e instanceof SyntaxError&&e.message.includes("Stack overflow")}}function Xp(n,e){if(nc(e)){const t=(function(i){const r=[...i];return r.length===0?"(No dependency trace)":r.map(lt).join(" -> ")})((function(i){const r=new Set;for(const s of i.servicesBranch){if(r.has(s))return[...r,s];r.add(s)}return[...r]})(n));throw new Ne(je.planning,`Circular dependency found: ${t}`,{cause:e})}throw e}const Lo=Symbol.for("@inversifyjs/core/LazyPlanServiceNode");class Pt{[Lo];_serviceIdentifier;_serviceNode;constructor(e,t){this[Lo]=!0,this._serviceNode=e,this._serviceIdentifier=t}get bindings(){return this._getNode().bindings}get isContextFree(){return this._getNode().isContextFree}get serviceIdentifier(){return this._serviceIdentifier}set bindings(e){this._getNode().bindings=e}set isContextFree(e){this._getNode().isContextFree=e}static is(e){return typeof e=="object"&&e!==null&&e[Lo]===!0}invalidate(){this._serviceNode=void 0}isExpanded(){return this._serviceNode!==void 0}_getNode(){return this._serviceNode===void 0&&(this._serviceNode=this._buildPlanServiceNode()),this._serviceNode}}class Ln{#e;constructor(e){this.#e=e}get name(){return this.#e.elem.name}get serviceIdentifier(){return this.#e.elem.serviceIdentifier}get tags(){return this.#e.elem.tags}getAncestor(){if(this.#e.elem.getAncestorsCalled=!0,this.#e.previous!==void 0)return new Ln(this.#e.previous)}}function zs(n,e,t){const i=t?.customServiceIdentifier??e.serviceIdentifier,r=(t?.chained===!0?[...n.operations.getBindingsChained(i)]:[...n.operations.getBindings(i)??[]]).filter(s=>s.isSatisfiedBy(e));if(r.length===0&&n.autobindOptions!==void 0&&typeof i=="function"){const s=Ru(n.autobindOptions,i);n.operations.setBinding(s),s.isSatisfiedBy(e)&&r.push(s)}return r}class ic{last;constructor(e){this.last=e}concat(e){return new ic({elem:e,previous:this.last})}[Symbol.iterator](){let e=this.last;return{next:()=>{if(e===void 0)return{done:!0,value:void 0};const t=e.elem;return e=e.previous,{done:!1,value:t}}}}}function oa(n){const e=new Map;return n.rootConstraints.tag!==void 0&&e.set(n.rootConstraints.tag.key,n.rootConstraints.tag.value),new ic({elem:{getAncestorsCalled:!1,name:n.rootConstraints.name,serviceIdentifier:n.rootConstraints.serviceIdentifier,tags:e},previous:void 0})}function si(n){return n.redirections!==void 0}function qu(n,e,t,i){const r=t.elem.serviceIdentifier,s=t.previous?.elem.serviceIdentifier;Array.isArray(n)?(function(a,l,d,h,m,v){if(a.length!==0){const w=v[v.length-1]??d,P=`Ambiguous bindings found for service: "${lt(w)}".${Vu(v)}
|
|
29
|
-
|
|
30
|
-
Registered bindings:
|
|
31
|
-
|
|
32
|
-
${a.map(K=>(function(A){switch(A.type){case Ae.Instance:return`[ type: "${A.type}", serviceIdentifier: "${lt(A.serviceIdentifier)}", scope: "${A.scope}", implementationType: "${A.implementationType.name}" ]`;case Ae.ServiceRedirection:return`[ type: "${A.type}", serviceIdentifier: "${lt(A.serviceIdentifier)}", redirection: "${lt(A.targetServiceIdentifier)}" ]`;default:return`[ type: "${A.type}", serviceIdentifier: "${lt(A.serviceIdentifier)}", scope: "${A.scope}" ]`}})(K.binding)).join(`
|
|
33
|
-
`)}
|
|
34
|
-
|
|
35
|
-
Trying to resolve bindings for "${Uu(d,h)}".${zu(m)}`;throw new Ne(je.planning,P)}l||vl(d,h,m,v)})(n,e,r,s,t.elem,i):(function(a,l,d,h,m,v){a!==void 0||l||vl(d,h,m,v)})(n,e,r,s,t.elem,i)}function vl(n,e,t,i){const r=i[i.length-1]??n,s=`No bindings found for service: "${lt(r)}".
|
|
36
|
-
|
|
37
|
-
Trying to resolve bindings for "${Uu(n,e)}".${Vu(i)}${zu(t)}`;throw new Ne(je.planning,s)}function Uu(n,e){return e===void 0?`${lt(n)} (Root service)`:lt(e)}function zu(n){const e=n.tags.size===0?"":`
|
|
38
|
-
- tags:
|
|
39
|
-
- ${[...n.tags.keys()].map(t=>t.toString()).join(`
|
|
40
|
-
- `)}`;return`
|
|
41
|
-
|
|
42
|
-
Binding constraints:
|
|
43
|
-
- service identifier: ${lt(n.serviceIdentifier)}
|
|
44
|
-
- name: ${n.name?.toString()??"-"}${e}`}function Vu(n){return n.length===0?"":`
|
|
45
|
-
|
|
46
|
-
- service redirections:
|
|
47
|
-
- ${n.map(e=>lt(e)).join(`
|
|
48
|
-
- `)}`}function Wu(n,e,t,i){if(n.redirections.length===1){const[r]=n.redirections;return void(si(r)&&Wu(r,e,t,[...i,r.binding.targetServiceIdentifier]))}qu(n.redirections,e,t,i)}function rc(n,e,t){if(Array.isArray(n.bindings)&&n.bindings.length===1){const[i]=n.bindings;return void(si(i)&&Wu(i,e,t,[i.binding.targetServiceIdentifier]))}qu(n.bindings,e,t,[])}function Vs(n){return Ts.is(n)?n.unwrap():n}function Hu(n){return(e,t,i)=>{const r=Vs(i.value),s=t.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),a=new Ln(s.last),l=i.kind===wt.multipleInjection&&i.chained,d=zs(e,a,{chained:l}),h=[],m={bindings:h,isContextFree:!0,serviceIdentifier:r};if(h.push(...n(e,s,d,m,l)),m.isContextFree=!s.last.elem.getAncestorsCalled,i.kind===wt.singleInjection){rc(m,i.optional,s.last);const[v]=h;m.bindings=v}return m}}function Gu(n){return(e,t,i)=>{const r=Vs(i.value),s=t.concat({getAncestorsCalled:!1,name:i.name,serviceIdentifier:r,tags:i.tags}),a=new Ln(s.last),l=i.kind===dn.multipleInjection&&i.chained,d=zs(e,a,{chained:l}),h=[],m={bindings:h,isContextFree:!0,serviceIdentifier:r};if(h.push(...n(e,s,d,m,l)),m.isContextFree=!s.last.elem.getAncestorsCalled,i.kind===dn.singleInjection){rc(m,i.optional,s.last);const[v]=h;m.bindings=v}return m}}function Yu(n){const e=(function(s){return(a,l,d)=>{const h={binding:l,classMetadata:a.operations.getClassMetadata(l.implementationType),constructorParams:[],propertyParams:new Map},m={autobindOptions:a.autobindOptions,node:h,operations:a.operations,servicesBranch:a.servicesBranch};return s(m,d)}})(n),t=(function(s){return(a,l,d)=>{const h={binding:l,params:[]},m={autobindOptions:a.autobindOptions,node:h,operations:a.operations,servicesBranch:a.servicesBranch};return s(m,d)}})(n),i=(s,a,l,d,h)=>{const m=si(d)?d.binding.targetServiceIdentifier:d.serviceIdentifier;s.servicesBranch.push(m);const v=[];for(const w of l)switch(w.type){case Ae.Instance:v.push(e(s,w,a));break;case Ae.ResolvedValue:v.push(t(s,w,a));break;case Ae.ServiceRedirection:{const P=r(s,a,w,h);v.push(P);break}default:v.push({binding:w})}return s.servicesBranch.pop(),v},r=(function(s){return(a,l,d,h)=>{const m={binding:d,redirections:[]},v=zs(a,new Ln(l.last),{chained:h,customServiceIdentifier:d.targetServiceIdentifier});return m.redirections.push(...s(a,l,v,m,h)),m}})(i);return i}function yl(n,e,t,i){if(n!==void 0&&(Pt.is(t)&&!t.isExpanded()||t.isContextFree)){const r={tree:{root:t}};e.setPlan(n,r)}else e.setNonCachedServiceNode(t,i)}class Zp extends Pt{#e;#t;#i;#n;constructor(e,t,i,r,s){super(s,Vs(r.value)),this.#t=t,this.#e=e,this.#i=i,this.#n=r}_buildPlanServiceNode(){return this.#t(this.#e,this.#i,this.#n)}}class eh extends Pt{#e;#t;#i;#n;constructor(e,t,i,r,s){super(s,Vs(r.value)),this.#e=e,this.#t=t,this.#i=i,this.#n=r}_buildPlanServiceNode(){return this.#t(this.#e,this.#i,this.#n)}}function Ju(n,e,t,i){const r=(function(a,l){const d=(function(h,m){return(v,w,P)=>{if(P.kind===wt.unmanaged)return;const K=(function(z){let H;if(z.tags.size===0)H=void 0;else{if(z.tags.size!==1)return;{const[J,ne]=z.tags.entries().next().value;H={key:J,value:ne}}}const ie=Ts.is(z.value)?z.value.unwrap():z.value;return z.kind===wt.multipleInjection?{chained:z.chained,isMultiple:!0,name:z.name,optional:z.optional,serviceIdentifier:ie,tag:H}:{isMultiple:!1,name:z.name,optional:z.optional,serviceIdentifier:ie,tag:H}})(P);if(K!==void 0){const z=v.operations.getPlan(K);if(z!==void 0&&z.tree.root.isContextFree)return z.tree.root}const A=m(v,w,P),D=new Zp(v,h,w,P,A);return yl(K,v.operations,D,{bindingConstraintsList:w,chainedBindings:P.kind===wt.multipleInjection&&P.chained,optionalBindings:P.optional}),D}})(a,l);return(h,m,v)=>{const w=m.classMetadata;for(const[P,K]of w.constructorArguments.entries())m.constructorParams[P]=d(h,v,K);for(const[P,K]of w.properties){const A=d(h,v,K);A!==void 0&&m.propertyParams.set(P,A)}return h.node}})(n,t),s=(function(a,l){const d=(function(h,m){return(v,w,P)=>{const K=(function(z){let H;if(z.tags.size===0)H=void 0;else{if(z.tags.size!==1)return;{const[J,ne]=z.tags.entries().next().value;H={key:J,value:ne}}}const ie=Ts.is(z.value)?z.value.unwrap():z.value;return z.kind===dn.multipleInjection?{chained:z.chained,isMultiple:!0,name:z.name,optional:z.optional,serviceIdentifier:ie,tag:H}:{isMultiple:!1,name:z.name,optional:z.optional,serviceIdentifier:ie,tag:H}})(P);if(K!==void 0){const z=v.operations.getPlan(K);if(z!==void 0&&z.tree.root.isContextFree)return z.tree.root}const A=m(v,w,P),D=new eh(v,h,w,P,A);return yl(K,v.operations,D,{bindingConstraintsList:w,chainedBindings:P.kind===dn.multipleInjection&&P.chained,optionalBindings:P.optional}),D}})(a,l);return(h,m,v)=>{const w=m.binding.metadata;for(const[P,K]of w.arguments.entries())m.params[P]=d(h,v,K);return h.node}})(e,i);return(a,l)=>a.node.binding.type===Ae.Instance?r(a,a.node,l):s(a,a.node,l)}class th extends Pt{#e;constructor(e,t){super(t,t.serviceIdentifier),this.#e=e}_buildPlanServiceNode(){return Zu(this.#e)}}const aa=Hu(Xu),ca=Gu(Xu),Qu=Yu(Ju(aa,ca,aa,ca));function Xu(n,e,t,i,r){return Qu(n,e,t,i,r)}const Zu=(function(n){return e=>{const t=oa(e),i=new Ln(t.last),r=e.rootConstraints.isMultiple&&e.rootConstraints.chained,s=zs(e,i,{chained:r}),a=[],l={bindings:a,isContextFree:!0,serviceIdentifier:e.rootConstraints.serviceIdentifier};if(a.push(...n(e,t,s,l,r)),l.isContextFree=!t.last.elem.getAncestorsCalled,!e.rootConstraints.isMultiple){rc(l,e.rootConstraints.isOptional??!1,t.last);const[d]=a;l.bindings=d}return l}})(Qu);function nh(n){try{const e=(function(s){return s.rootConstraints.isMultiple?{chained:s.rootConstraints.chained,isMultiple:!0,name:s.rootConstraints.name,optional:s.rootConstraints.isOptional??!1,serviceIdentifier:s.rootConstraints.serviceIdentifier,tag:s.rootConstraints.tag}:{isMultiple:!1,name:s.rootConstraints.name,optional:s.rootConstraints.isOptional??!1,serviceIdentifier:s.rootConstraints.serviceIdentifier,tag:s.rootConstraints.tag}})(n),t=n.operations.getPlan(e);if(t!==void 0)return t;const i=Zu(n),r={tree:{root:new th(n,i)}};return n.operations.setPlan(e,r),r}catch(e){Xp(n,e)}}var Ht;(function(n){n.bindingAdded="bindingAdded",n.bindingRemoved="bindingRemoved"})(Ht||(Ht={}));class ih{#e;#t;#i;constructor(){this.#e=[],this.#t=8,this.#i=1024}*[Symbol.iterator](){let e=0;for(const t of this.#e){const i=t.deref();i===void 0?++e:yield i}this.#e.length>=this.#t&&this.#r(e)&&this.#n(e)}push(e){const t=new WeakRef(e);if(this.#e.push(t),this.#e.length>=this.#t&&this.#e.length%this.#i===0){let i=0;for(const r of this.#e)r.deref()===void 0&&++i;this.#r(i)&&this.#n(i)}}#n(e){const t=new Array(this.#e.length-e);let i=0;for(const r of this.#e)r.deref()&&(t[i++]=r);this.#e=t}#r(e){return e>=.5*this.#e.length}}const sc=Yu(Ju(aa,ca,function(n,e,t){return rh(n,e,t)},function(n,e,t){return sh(n,e,t)})),rh=(function(n){const e=Hu(n);return(t,i,r)=>{try{return e(t,i,r)}catch(s){if(Ne.isErrorOfKind(s,je.planning))return;throw s}}})(sc),sh=(function(n){const e=Gu(n);return(t,i,r)=>{try{return e(t,i,r)}catch(s){if(Ne.isErrorOfKind(s,je.planning))return;throw s}}})(sc);function bl(n,e,t,i,r){if(Pt.is(e)&&!e.isExpanded())return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1};const s=new Ln(i.last);return!t.isSatisfiedBy(s)||i.last.elem.getAncestorsCalled?{isContextFreeBinding:!i.last.elem.getAncestorsCalled,shouldInvalidateServiceNode:!1}:(function(a,l,d,h,m){let v;try{[v]=sc(a,h,[d],l,m)}catch(w){if(nc(w))return{isContextFreeBinding:!1,shouldInvalidateServiceNode:!0};throw w}return(function(w,P){if(Array.isArray(w.bindings))w.bindings.push(P);else{if(w.bindings!==void 0){if(!Pt.is(w))throw new Ne(je.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!0}}w.bindings=P}return{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}})(l,v)})(n,e,t,i,r)}function wl(n,e,t,i){if(Pt.is(n)&&!n.isExpanded())return{bindingNodeRemoved:void 0,isContextFreeBinding:!0};const r=new Ln(t.last);if(!e.isSatisfiedBy(r)||t.last.elem.getAncestorsCalled)return{bindingNodeRemoved:void 0,isContextFreeBinding:!t.last.elem.getAncestorsCalled};let s;if(Array.isArray(n.bindings))n.bindings=n.bindings.filter(a=>a.binding!==e||(s=a,!1));else if(n.bindings?.binding===e)if(s=n.bindings,i)n.bindings=void 0;else{if(!Pt.is(n))throw new Ne(je.planning,"Unexpected non-lazy plan service node. This is likely a bug in the planning logic. Please, report this issue");n.invalidate()}return{bindingNodeRemoved:s,isContextFreeBinding:!0}}class xl{#e;#t;#i;#n;#r;#s;constructor(){this.#e=new Map,this.#t=this.#o(),this.#i=this.#o(),this.#n=this.#o(),this.#r=this.#o(),this.#s=new ih}clearCache(){for(const e of this.#p())e.clear();for(const e of this.#s)e.clearCache()}get(e){return e.name===void 0?e.tag===void 0?this.#a(this.#t,e).get(e.serviceIdentifier):this.#a(this.#r,e).get(e.serviceIdentifier)?.get(e.tag.key)?.get(e.tag.value):e.tag===void 0?this.#a(this.#i,e).get(e.serviceIdentifier)?.get(e.name):this.#a(this.#n,e).get(e.serviceIdentifier)?.get(e.name)?.get(e.tag.key)?.get(e.tag.value)}invalidateServiceBinding(e){this.#b(e),this.#f(e),this.#d(e),this.#w(e),this.#y(e);for(const t of this.#s)t.invalidateServiceBinding(e)}set(e,t){e.name===void 0?e.tag===void 0?this.#a(this.#t,e).set(e.serviceIdentifier,t):this.#c(this.#c(this.#a(this.#r,e),e.serviceIdentifier),e.tag.key).set(e.tag.value,t):e.tag===void 0?this.#c(this.#a(this.#i,e),e.serviceIdentifier).set(e.name,t):this.#c(this.#c(this.#c(this.#a(this.#n,e),e.serviceIdentifier),e.name),e.tag.key).set(e.tag.value,t)}setNonCachedServiceNode(e,t){let i=this.#e.get(e.serviceIdentifier);i===void 0&&(i=new Map,this.#e.set(e.serviceIdentifier,i)),i.set(e,t)}subscribe(e){this.#s.push(e)}#o(){const e=new Array(8);for(let t=0;t<e.length;++t)e[t]=new Map;return e}#l(e,t,i,r){const s=!!(2&t);let a;return s?a={chained:!!(0&t),isMultiple:s,serviceIdentifier:e.binding.serviceIdentifier}:a={isMultiple:s,serviceIdentifier:e.binding.serviceIdentifier},1&t&&(a.isOptional=!0),i!==void 0&&(a.name=i),r!==void 0&&(a.tag=r),{autobindOptions:void 0,operations:e.operations,rootConstraints:a,servicesBranch:[]}}#c(e,t){let i=e.get(t);return i===void 0&&(i=new Map,e.set(t,i)),i}#a(e,t){return e[this.#u(t)]}#p(){return[this.#e,...this.#t,...this.#i,...this.#n,...this.#r]}#u(e){return e.isMultiple?(e.chained?4:0)|(e.optional?1:0)|2:e.optional?1:0}#f(e){for(const[t,i]of this.#i.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())this.#g(e,a,t,s,void 0)}}#d(e){for(const[t,i]of this.#n.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())for(const[l,d]of a.entries())for(const[h,m]of d.entries())this.#g(e,m,t,s,{key:l,value:h})}}#h(e){switch(e.binding.type){case Ae.ServiceRedirection:for(const t of e.redirections)this.#h(t);break;case Ae.Instance:for(const t of e.constructorParams)t!==void 0&&this.#m(t);for(const t of e.propertyParams.values())this.#m(t);break;case Ae.ResolvedValue:for(const t of e.params)this.#m(t)}}#m(e){const t=this.#e.get(e.serviceIdentifier);t!==void 0&&t.has(e)&&(t.delete(e),this.#v(e))}#v(e){if((!Pt.is(e)||e.isExpanded())&&e.bindings!==void 0)if(Array.isArray(e.bindings))for(const t of e.bindings)this.#h(t);else this.#h(e.bindings)}#y(e){const t=this.#e.get(e.binding.serviceIdentifier);if(t!==void 0)switch(e.kind){case Ht.bindingAdded:for(const[i,r]of t){const s=bl({autobindOptions:void 0,operations:e.operations,servicesBranch:[]},i,e.binding,r.bindingConstraintsList,r.chainedBindings);s.isContextFreeBinding?s.shouldInvalidateServiceNode&&Pt.is(i)&&(this.#v(i),i.invalidate()):this.clearCache()}break;case Ht.bindingRemoved:for(const[i,r]of t){const s=wl(i,e.binding,r.bindingConstraintsList,r.optionalBindings);s.isContextFreeBinding?s.bindingNodeRemoved!==void 0&&this.#h(s.bindingNodeRemoved):this.clearCache()}}}#b(e){for(const[t,i]of this.#t.entries()){const r=i.get(e.binding.serviceIdentifier);this.#g(e,r,t,void 0,void 0)}}#w(e){for(const[t,i]of this.#r.entries()){const r=i.get(e.binding.serviceIdentifier);if(r!==void 0)for(const[s,a]of r.entries())for(const[l,d]of a.entries())this.#g(e,d,t,void 0,{key:s,value:l})}}#g(e,t,i,r,s){if(t!==void 0&&Pt.is(t.tree.root)){const h=this.#l(e,i,r,s);switch(e.kind){case Ht.bindingAdded:{const m=(a=h,l=t.tree.root,d=e.binding,Pt.is(l)&&!l.isExpanded()?{isContextFreeBinding:!0,shouldInvalidateServiceNode:!1}:bl(a,l,d,oa(a),a.rootConstraints.isMultiple&&a.rootConstraints.chained));m.isContextFreeBinding?m.shouldInvalidateServiceNode&&(this.#v(t.tree.root),t.tree.root.invalidate()):this.clearCache()}break;case Ht.bindingRemoved:{const m=(function(v,w,P){return Pt.is(w)&&!w.isExpanded()?{bindingNodeRemoved:void 0,isContextFreeBinding:!0}:wl(w,P,oa(v),v.rootConstraints.isOptional??!1)})(h,t.tree.root,e.binding);m.isContextFreeBinding?m.bindingNodeRemoved!==void 0&&this.#h(m.bindingNodeRemoved):this.clearCache()}}}var a,l,d}}function oh(n,e){if(nc(e)){const t=(function(i){const r=[...i];return r.length===0?"(No dependency trace)":r.map(lt).join(" -> ")})((function(i){const r=i.planResult.tree.root,s=[];function a(l){const d=s.indexOf(l);if(d!==-1)return[...s.slice(d),l].map(h=>h.serviceIdentifier);s.push(l);try{for(const h of(function(m){const v=[],w=m.bindings;if(w===void 0)return v;const P=K=>{if(si(K))for(const A of K.redirections)P(A);else switch(K.binding.type){case Ae.Instance:{const A=K;for(const D of A.constructorParams)D!==void 0&&v.push(D);for(const D of A.propertyParams.values())v.push(D);break}case Ae.ResolvedValue:{const A=K;for(const D of A.params)v.push(D);break}}};if(Array.isArray(w))for(const K of w)P(K);else P(w);return v})(l)){const m=a(h);if(m!==void 0)return m}}finally{s.pop()}}return a(r)??[]})(n));throw new Ne(je.planning,`Circular dependency found: ${t}`,{cause:e})}throw e}function ef(n,e){return Ze(e)?(n.cache={isRight:!0,value:e},e.then(t=>Sl(n,t))):Sl(n,e)}function Sl(n,e){return n.cache={isRight:!0,value:e},e}function ah(n,e,t){const i=n.getActivations(e);return i===void 0?t:Ze(t)?kl(n,t,i[Symbol.iterator]()):(function(r,s,a){let l=s,d=a.next();for(;d.done!==!0;){const h=d.value(r.context,l);if(Ze(h))return kl(r,h,a);l=h,d=a.next()}return l})(n,t,i[Symbol.iterator]())}async function kl(n,e,t){let i=await e,r=t.next();for(;r.done!==!0;)i=await r.value(n.context,i),r=t.next();return i}function ws(n,e,t){let i=t;if(e.onActivation!==void 0){const r=e.onActivation;i=Ze(i)?i.then(s=>r(n.context,s)):r(n.context,i)}return ah(n,e.serviceIdentifier,i)}function oc(n){return(e,t)=>t.cache.isRight?t.cache.value:ef(t,ws(e,t,n(e,t)))}const ch=oc(function(n,e){return e.value});function lh(n){return n}function ac(n,e){return(t,i)=>{const r=n(i);switch(r.scope){case Bt.Singleton:return r.cache.isRight?r.cache.value:ef(r,ws(t,r,e(t,i)));case Bt.Request:{if(t.requestScopeCache.has(r.id))return t.requestScopeCache.get(r.id);const s=ws(t,r,e(t,i));return t.requestScopeCache.set(r.id,s),s}case Bt.Transient:return ws(t,r,e(t,i))}}}const uh=(n=>ac(lh,n))(function(n,e){return e.value(n.context)}),fh=oc(function(n,e){return e.factory(n.context)});function _l(n,e,t){const i=(function(r,s,a){if(!(a in r))throw new Ne(je.resolution,`Expecting a "${a.toString()}" property when resolving "${s.implementationType.name}" class @postConstruct decorated method, none found.`);if(typeof r[a]!="function")throw new Ne(je.resolution,`Expecting a "${a.toString()}" method when resolving "${s.implementationType.name}" class @postConstruct decorated method, a non function property was found instead.`);{let l;try{l=r[a]()}catch(d){throw new Ne(je.resolution,`Unexpected error found when calling "${a.toString()}" @postConstruct decorated method on class "${s.implementationType.name}"`,{cause:d})}if(Ze(l))return(async function(d,h,m){try{await m}catch(v){throw new Ne(je.resolution,`Unexpected error found when calling "${h.toString()}" @postConstruct decorated method on class "${d.implementationType.name}"`,{cause:v})}})(s,a,l)}})(n,e,t);return Ze(i)?i.then(()=>n):n}function Cl(n,e,t){if(t.size===0)return n;let i=n;for(const r of t)i=Ze(i)?i.then(s=>_l(s,e,r)):_l(i,e,r);return i}function El(n){return(e,t,i)=>{const r=new i.binding.implementationType(...e),s=n(t,r,i);return Ze(s)?s.then(()=>Cl(r,i.binding,i.classMetadata.lifecycle.postConstructMethodNames)):Cl(r,i.binding,i.classMetadata.lifecycle.postConstructMethodNames)}}const dh=oc(function(n,e){return e.provider(n.context)});function ph(n){return n.binding}function hh(n){return n.binding}const Il=(function(n){return(e,t,i)=>{const r=[];for(const[s,a]of i.propertyParams){const l=i.classMetadata.properties.get(s);if(l===void 0)throw new Ne(je.resolution,`Expecting metadata at property "${s.toString()}", none found`);l.kind!==wt.unmanaged&&a.bindings!==void 0&&(t[s]=n(e,a),Ze(t[s])&&r.push((async()=>{t[s]=await t[s]})()))}if(r.length>0)return Promise.all(r).then(()=>{})}})(Ws),Ol=(function(n){return function e(t,i){const r=[];for(const s of i.redirections)si(s)?r.push(...e(t,s)):r.push(n(t,s));return r}})(la),gh=(function(n,e,t){return(i,r)=>{const s=n(i,r);return Ze(s)?e(s,i,r):t(s,i,r)}})((function(n){return(e,t)=>{const i=[];for(const r of t.constructorParams)r===void 0?i.push(void 0):i.push(n(e,r));return i.some(Ze)?Promise.all(i):i}})(Ws),(function(n){return async(e,t,i)=>{const r=await e;return n(r,t,i)}})(El(Il)),El(Il)),mh=(function(n){return(e,t)=>{const i=n(e,t);return Ze(i)?i.then(r=>t.binding.factory(...r)):t.binding.factory(...i)}})((function(n){return(e,t)=>{const i=[];for(const r of t.params)i.push(n(e,r));return i.some(Ze)?Promise.all(i):i}})(Ws)),vh=(n=>ac(ph,n))(gh),yh=(n=>ac(hh,n))(mh);function bh(n){try{return Ws(n,n.planResult.tree.root)}catch(e){oh(n,e)}}function la(n,e){switch(e.binding.type){case Ae.ConstantValue:return ch(n,e.binding);case Ae.DynamicValue:return uh(n,e.binding);case Ae.Factory:return fh(n,e.binding);case Ae.Instance:return vh(n,e);case Ae.Provider:return dh(n,e.binding);case Ae.ResolvedValue:return yh(n,e)}}function Ws(n,e){if(e.bindings!==void 0)return Array.isArray(e.bindings)?(function(t,i){const r=[];for(const s of i)si(s)?r.push(...Ol(t,s)):r.push(la(t,s));return r.some(Ze)?Promise.all(r):r})(n,e.bindings):(function(t,i){if(si(i)){const r=Ol(t,i);if(r.length===1)return r[0];throw new Ne(je.resolution,"Unexpected multiple resolved values on single injection")}return la(t,i)})(n,e.bindings)}function wh(n){return n.scope!==void 0}function Al(n,e){if(typeof n[e]=="function")return n[e]()}function Pl(n,e){const t=n.lifecycle.preDestroyMethodNames;if(t.size===0)return;let i;for(const r of t)i=i===void 0?Al(e,r):i.then(()=>Al(e,r));return i}function Tl(n,e,t){const i=n.getDeactivations(e);if(i!==void 0)return Ze(t)?Nl(t,i[Symbol.iterator]()):(function(r,s){let a=s.next();for(;a.done!==!0;){const l=a.value(r);if(Ze(l))return Nl(r,s);a=s.next()}})(t,i[Symbol.iterator]())}async function Nl(n,e){const t=await n;let i=e.next();for(;i.done!==!0;)await i.value(t),i=e.next()}function xh(n,e){const t=(function(i,r){if(r.type===Ae.Instance){const s=i.getClassMetadata(r.implementationType),a=r.cache.value;return Ze(a)?a.then(l=>Pl(s,l)):Pl(s,a)}})(n,e);return t===void 0?jl(n,e):t.then(()=>jl(n,e))}function jl(n,e){const t=e.cache;return Ze(t.value)?t.value.then(i=>Ml(n,e,i)):Ml(n,e,t.value)}function Ml(n,e,t){let i;return e.onDeactivation!==void 0&&(i=(0,e.onDeactivation)(t)),i===void 0?Tl(n,e.serviceIdentifier,t):i.then(()=>Tl(n,e.serviceIdentifier,t))}function Ns(n,e){if(e===void 0)return;const t=(function(r){const s=[];for(const a of r)wh(a)&&a.scope===Bt.Singleton&&a.cache.isRight&&s.push(a);return s})(e),i=[];for(const r of t){const s=xh(n,r);s!==void 0&&i.push(s)}return i.length>0?Promise.all(i).then(()=>{}):void 0}function Sh(n,e){const t=n.getBindingsFromModule(e);return Ns(n,t)}function kh(n,e){const t=n.getBindings(e);return Ns(n,t)}const _h=Symbol.for("@inversifyjs/plugin/isPlugin"),tf=Symbol.for("@inversifyjs/container/bindingIdentifier");function Rl(n){return typeof n=="object"&&n!==null&&n[tf]===!0}class Wn{static always=e=>!0}const Bo=Symbol.for("@inversifyjs/container/InversifyContainerError");class Kt extends Error{[Bo];kind;constructor(e,t,i){super(t,i),this[Bo]=!0,this.kind=e}static is(e){return typeof e=="object"&&e!==null&&e[Bo]===!0}static isErrorOfKind(e,t){return Kt.is(e)&&e.kind===t}}var qt;function cc(n){return{[tf]:!0,id:n.id}}function tr(n){return e=>{for(let t=e.getAncestor();t!==void 0;t=t.getAncestor())if(n(t))return!0;return!1}}function Ji(n){return e=>e.name===n}function ss(n){return e=>e.serviceIdentifier===n}function Qi(n,e){return t=>t.tags.has(n)&&t.tags.get(n)===e}function Ch(n){return n.name===void 0&&n.tags.size===0}function os(n){const e=tr(n);return t=>!e(t)}function as(n){return e=>{const t=e.getAncestor();return t===void 0||!n(t)}}function cs(n){return e=>{const t=e.getAncestor();return t!==void 0&&n(t)}}(function(n){n[n.invalidOperation=0]="invalidOperation"})(qt||(qt={}));class Eh{#e;constructor(e){this.#e=e}getIdentifier(){return cc(this.#e)}inRequestScope(){return this.#e.scope=Bt.Request,new ii(this.#e)}inSingletonScope(){return this.#e.scope=Bt.Singleton,new ii(this.#e)}inTransientScope(){return this.#e.scope=Bt.Transient,new ii(this.#e)}}class nf{#e;#t;#i;#n;constructor(e,t,i,r){this.#e=e,this.#t=t,this.#i=i,this.#n=r}to(e){const t=qs(e),i={cache:{isRight:!1,value:void 0},id:_n(),implementationType:e,isSatisfiedBy:Wn.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:t.scope??this.#i,serviceIdentifier:this.#n,type:Ae.Instance};return this.#e(i),new Fo(i)}toSelf(){if(typeof this.#n!="function")throw new Error('"toSelf" function can only be applied when a newable function is used as service identifier');return this.to(this.#n)}toConstantValue(e){const t={cache:{isRight:!1,value:void 0},id:_n(),isSatisfiedBy:Wn.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:Bt.Singleton,serviceIdentifier:this.#n,type:Ae.ConstantValue,value:e};return this.#e(t),new ii(t)}toDynamicValue(e){const t={cache:{isRight:!1,value:void 0},id:_n(),isSatisfiedBy:Wn.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#i,serviceIdentifier:this.#n,type:Ae.DynamicValue,value:e};return this.#e(t),new Fo(t)}toResolvedValue(e,t){const i={cache:{isRight:!1,value:void 0},factory:e,id:_n(),isSatisfiedBy:Wn.always,metadata:this.#r(t),moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:this.#i,serviceIdentifier:this.#n,type:Ae.ResolvedValue};return this.#e(i),new Fo(i)}toFactory(e){const t={cache:{isRight:!1,value:void 0},factory:e,id:_n(),isSatisfiedBy:Wn.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,scope:Bt.Singleton,serviceIdentifier:this.#n,type:Ae.Factory};return this.#e(t),new ii(t)}toProvider(e){const t={cache:{isRight:!1,value:void 0},id:_n(),isSatisfiedBy:Wn.always,moduleId:this.#t,onActivation:void 0,onDeactivation:void 0,provider:e,scope:Bt.Singleton,serviceIdentifier:this.#n,type:Ae.Provider};return this.#e(t),new ii(t)}toService(e){const t={id:_n(),isSatisfiedBy:Wn.always,moduleId:this.#t,serviceIdentifier:this.#n,targetServiceIdentifier:e,type:Ae.ServiceRedirection};this.#e(t)}#r(e){return{arguments:(e??[]).map(t=>(function(i){return typeof i=="object"&&!Ts.is(i)})(t)?(function(i){return i.isMultiple===!0})(t)?{chained:t.chained??!1,kind:dn.multipleInjection,name:t.name,optional:t.optional??!1,tags:new Map((t.tags??[]).map(i=>[i.key,i.value])),value:t.serviceIdentifier}:{kind:dn.singleInjection,name:t.name,optional:t.optional??!1,tags:new Map((t.tags??[]).map(i=>[i.key,i.value])),value:t.serviceIdentifier}:{kind:dn.singleInjection,name:void 0,optional:!1,tags:new Map,value:t})}}}class rf{#e;constructor(e){this.#e=e}getIdentifier(){return cc(this.#e)}onActivation(e){return this.#e.onActivation=e,new ua(this.#e)}onDeactivation(e){if(this.#e.onDeactivation=e,this.#e.scope!==Bt.Singleton)throw new Kt(qt.invalidOperation,`Binding for service "${lt(this.#e.serviceIdentifier)}" has a deactivation function, but its scope is not singleton. Deactivation functions can only be used with singleton bindings.`);return new ua(this.#e)}}class ua{#e;constructor(e){this.#e=e}getIdentifier(){return cc(this.#e)}when(e){return this.#e.isSatisfiedBy=e,new rf(this.#e)}whenAnyAncestor(e){return this.when(tr(e))}whenAnyAncestorIs(e){return this.when(tr(ss(e)))}whenAnyAncestorNamed(e){return this.when((function(t){return tr(Ji(t))})(e))}whenAnyAncestorTagged(e,t){return this.when((function(i,r){return tr(Qi(i,r))})(e,t))}whenDefault(){return this.when(Ch)}whenNamed(e){return this.when(Ji(e))}whenNoParent(e){return this.when(as(e))}whenNoParentIs(e){return this.when(as(ss(e)))}whenNoParentNamed(e){return this.when((function(t){return as(Ji(t))})(e))}whenNoParentTagged(e,t){return this.when((function(i,r){return as(Qi(i,r))})(e,t))}whenParent(e){return this.when(cs(e))}whenParentIs(e){return this.when(cs(ss(e)))}whenParentNamed(e){return this.when((function(t){return cs(Ji(t))})(e))}whenParentTagged(e,t){return this.when((function(i,r){return cs(Qi(i,r))})(e,t))}whenTagged(e,t){return this.when(Qi(e,t))}whenNoAncestor(e){return this.when(os(e))}whenNoAncestorIs(e){return this.when(os(ss(e)))}whenNoAncestorNamed(e){return this.when((function(t){return os(Ji(t))})(e))}whenNoAncestorTagged(e,t){return this.when((function(i,r){return os(Qi(i,r))})(e,t))}}class ii extends ua{#e;constructor(e){super(e),this.#e=new rf(e)}onActivation(e){return this.#e.onActivation(e)}onDeactivation(e){return this.#e.onDeactivation(e)}}class Fo extends ii{#e;constructor(e){super(e),this.#e=new Eh(e)}inRequestScope(){return this.#e.inRequestScope()}inSingletonScope(){return this.#e.inSingletonScope()}inTransientScope(){return this.#e.inTransientScope()}}let Ih=class{#e;#t;#i;#n;constructor(e,t,i,r){this.#e=e,this.#t=t,this.#i=i,this.#n=r}bind(e){return new nf(t=>{this.#r(t)},void 0,this.#t,e)}isBound(e,t){const i=this.#n.bindingService.get(e);return this.#d(e,i,t)}isCurrentBound(e,t){const i=this.#n.bindingService.getNonParentBindings(e);return this.#d(e,i,t)}async rebind(e){return await this.unbind(e),this.bind(e)}rebindSync(e){return this.unbindSync(e),this.bind(e)}async unbind(e){await this.#o(e)}async unbindAll(){await this.#a()}unbindAllSync(){if(this.#a()!==void 0)throw new Kt(qt.invalidOperation,"Unexpected asynchronous deactivation when unbinding all services. Consider using Container.unbindAll() instead.")}unbindSync(e){this.#o(e)!==void 0&&this.#s(e)}#r(e){this.#n.bindingService.set(e),this.#i.invalidateService({binding:e,kind:Ht.bindingAdded})}#s(e){let t;if(Rl(e)){const r=this.#n.bindingService.getById(e.id),s=(i=r,(function(a){if(a===void 0)return;const l=a.next();return l.done!==!0?l.value:void 0})(i?.[Symbol.iterator]()))?.serviceIdentifier;t=s===void 0?"Unexpected asynchronous deactivation when unbinding binding identifier. Consider using Container.unbind() instead.":`Unexpected asynchronous deactivation when unbinding "${lt(s)}" binding. Consider using Container.unbind() instead.`}else t=`Unexpected asynchronous deactivation when unbinding "${lt(e)}" service. Consider using Container.unbind() instead.`;var i;throw new Kt(qt.invalidOperation,t)}#o(e){return Rl(e)?this.#l(e):this.#u(e)}#l(e){const t=this.#n.bindingService.getById(e.id),i=t===void 0?void 0:[...t],r=Ns(this.#e,t);if(r!==void 0)return r.then(()=>{this.#c(i,e)});this.#c(i,e)}#c(e,t){if(this.#n.bindingService.removeById(t.id),e!==void 0)for(const i of e)this.#i.invalidateService({binding:i,kind:Ht.bindingRemoved})}#a(){const e=[...this.#n.bindingService.getNonParentBoundServices()],t=e.map(i=>kh(this.#e,i));if(t.some(i=>Ze(i)))return Promise.all(t).then(()=>{this.#p(e)});this.#p(e)}#p(e){for(const t of e)this.#n.activationService.removeAllByServiceId(t),this.#n.bindingService.removeAllByServiceId(t),this.#n.deactivationService.removeAllByServiceId(t);this.#n.planResultCacheService.clearCache()}#u(e){const t=this.#n.bindingService.get(e),i=t===void 0?void 0:[...t],r=Ns(this.#e,t);if(r!==void 0)return r.then(()=>{this.#f(e,i)});this.#f(e,i)}#f(e,t){if(this.#n.activationService.removeAllByServiceId(e),this.#n.bindingService.removeAllByServiceId(e),this.#n.deactivationService.removeAllByServiceId(e),t!==void 0)for(const i of t)this.#i.invalidateService({binding:i,kind:Ht.bindingRemoved})}#d(e,t,i){if(t===void 0)return!1;const r={getAncestor:()=>{},name:i?.name,serviceIdentifier:e,tags:new Map};i?.tag!==void 0&&r.tags.set(i.tag.key,i.tag.value);for(const s of t)if(s.isSatisfiedBy(r))return!0;return!1}};class Oh{#e;#t;#i;#n;#r;constructor(e,t,i,r,s){this.#e=e,this.#t=t,this.#i=i,this.#n=r,this.#r=s}async load(...e){await Promise.all(this.#l(...e))}loadSync(...e){const t=this.#l(...e);for(const i of t)if(i!==void 0)throw new Kt(qt.invalidOperation,"Unexpected asynchronous module load. Consider using Container.load() instead.")}async unload(...e){await Promise.all(this.#a(...e)),this.#o(e)}unloadSync(...e){const t=this.#a(...e);for(const i of t)if(i!==void 0)throw new Kt(qt.invalidOperation,"Unexpected asynchronous module unload. Consider using Container.unload() instead.");this.#o(e)}#s(e){return{bind:t=>new nf(i=>{this.#c(i)},e,this.#i,t),isBound:this.#e.isBound.bind(this.#e),onActivation:(t,i)=>{this.#r.activationService.add(i,{moduleId:e,serviceId:t})},onDeactivation:(t,i)=>{this.#r.deactivationService.add(i,{moduleId:e,serviceId:t})},rebind:this.#e.rebind.bind(this.#e),rebindSync:this.#e.rebindSync.bind(this.#e),unbind:this.#e.unbind.bind(this.#e),unbindSync:this.#e.unbindSync.bind(this.#e)}}#o(e){for(const t of e)this.#r.activationService.removeAllByModuleId(t.id),this.#r.bindingService.removeAllByModuleId(t.id),this.#r.deactivationService.removeAllByModuleId(t.id);this.#r.planResultCacheService.clearCache()}#l(...e){return e.map(t=>t.load(this.#s(t.id)))}#c(e){this.#r.bindingService.set(e),this.#n.invalidateService({binding:e,kind:Ht.bindingAdded})}#a(...e){return e.map(t=>Sh(this.#t,t.id))}}class Ah{deactivationParams;constructor(e){this.deactivationParams=(function(t){return{getBindings:t.bindingService.get.bind(t.bindingService),getBindingsFromModule:t.bindingService.getByModuleId.bind(t.bindingService),getClassMetadata:qs,getDeactivations:t.deactivationService.get.bind(t.deactivationService)}})(e),e.onReset(()=>{(function(t,i){i.getBindings=t.bindingService.get.bind(t.bindingService),i.getBindingsFromModule=t.bindingService.getByModuleId.bind(t.bindingService),i.getDeactivations=t.deactivationService.get.bind(t.deactivationService)})(e,this.deactivationParams)})}}class Ph{planParamsOperations;#e;constructor(e){this.#e=e,this.planParamsOperations={getBindings:this.#e.bindingService.get.bind(this.#e.bindingService),getBindingsChained:this.#e.bindingService.getChained.bind(this.#e.bindingService),getClassMetadata:qs,getPlan:this.#e.planResultCacheService.get.bind(this.#e.planResultCacheService),setBinding:this.#i.bind(this),setNonCachedServiceNode:this.#e.planResultCacheService.setNonCachedServiceNode.bind(this.#e.planResultCacheService),setPlan:this.#e.planResultCacheService.set.bind(this.#e.planResultCacheService)},this.#e.onReset(()=>{this.#t()})}#t(){this.planParamsOperations.getBindings=this.#e.bindingService.get.bind(this.#e.bindingService),this.planParamsOperations.getBindingsChained=this.#e.bindingService.getChained.bind(this.#e.bindingService),this.planParamsOperations.setBinding=this.#i.bind(this)}#i(e){this.#e.bindingService.set(e),this.#e.planResultCacheService.invalidateServiceBinding({binding:e,kind:Ht.bindingAdded,operations:this.planParamsOperations})}}class Th{#e;#t;constructor(e,t){this.#e=e,this.#t=t}invalidateService(e){this.#t.planResultCacheService.invalidateServiceBinding({...e,operations:this.#e.planParamsOperations})}}class Nh{#e;#t;#i;#n;constructor(e,t,i){this.#n=t,this.#i=i,this.#e=this.#r(e),this.#t=this.#s()}register(e,t){const i=new t(e,this.#t);if(i[_h]!==!0)throw new Kt(qt.invalidOperation,"Invalid plugin. The plugin must extend the Plugin class");i.load(this.#e)}#r(e){return{define:(t,i)=>{if(Object.prototype.hasOwnProperty.call(e,t))throw new Kt(qt.invalidOperation,`Container already has a method named "${String(t)}"`);e[t]=i},onPlan:this.#i.onPlan.bind(this.#i)}}#s(){const e=this.#n;return{get activationService(){return e.activationService},get bindingService(){return e.bindingService},get deactivationService(){return e.deactivationService},get planResultCacheService(){return e.planResultCacheService}}}}class $l{activationService;bindingService;deactivationService;planResultCacheService;#e;constructor(e,t,i,r){this.activationService=e,this.bindingService=t,this.deactivationService=i,this.planResultCacheService=r,this.#e=[]}reset(e,t,i){this.activationService=e,this.bindingService=t,this.deactivationService=i,this.planResultCacheService.clearCache();for(const r of this.#e)r()}onReset(e){this.#e.push(e)}}class jh{#e;#t;#i;#n;#r;#s;#o;constructor(e,t,i,r){this.#s=e,this.#o=t,this.#n=this.#f(),this.#e=i,this.#t=r,this.#i=s=>this.#o.activationService.get(s),this.#r=[],this.#o.onReset(()=>{this.#l()})}get(e,t){const i=this.#u(!1,e,t),r=this.#d(i);if(Ze(r))throw new Kt(qt.invalidOperation,`Unexpected asynchronous service when resolving service "${lt(e)}"`);return r}getAll(e,t){const i=this.#u(!0,e,t),r=this.#d(i);if(Ze(r))throw new Kt(qt.invalidOperation,`Unexpected asynchronous service when resolving service "${lt(e)}"`);return r}async getAllAsync(e,t){const i=this.#u(!0,e,t);return this.#d(i)}async getAsync(e,t){const i=this.#u(!1,e,t);return this.#d(i)}onPlan(e){this.#r.push(e)}#l(){this.#n=this.#f()}#c(e,t,i){const r=i?.name,s=i?.optional??!1,a=i?.tag;return e?{chained:i?.chained??!1,isMultiple:e,name:r,optional:s,serviceIdentifier:t,tag:a}:{isMultiple:e,name:r,optional:s,serviceIdentifier:t,tag:a}}#a(e,t,i){const r={autobindOptions:i?.autobind??this.#e?{scope:this.#t}:void 0,operations:this.#s.planParamsOperations,rootConstraints:this.#p(e,t,i),servicesBranch:[]};return this.#h(r,i),r}#p(e,t,i){return t?{chained:i?.chained??!1,isMultiple:t,serviceIdentifier:e}:{isMultiple:t,serviceIdentifier:e}}#u(e,t,i){const r=this.#c(e,t,i),s=this.#o.planResultCacheService.get(r);if(s!==void 0)return s;const a=nh(this.#a(t,e,i));for(const l of this.#r)l(r,a);return a}#f(){return{get:this.get.bind(this),getAll:this.getAll.bind(this),getAllAsync:this.getAllAsync.bind(this),getAsync:this.getAsync.bind(this)}}#d(e){return bh({context:this.#n,getActivations:this.#i,planResult:e,requestScopeCache:new Map})}#h(e,t){t!==void 0&&(t.name!==void 0&&(e.rootConstraints.name=t.name),t.optional===!0&&(e.rootConstraints.isOptional=!0),t.tag!==void 0&&(e.rootConstraints.tag={key:t.tag.key,value:t.tag.value}),e.rootConstraints.isMultiple&&(e.rootConstraints.chained=t?.chained??!1))}}class Mh{#e;#t;constructor(e){this.#e=e,this.#t=[]}restore(){const e=this.#t.pop();if(e===void 0)throw new Kt(qt.invalidOperation,"No snapshot available to restore");this.#e.reset(e.activationService,e.bindingService,e.deactivationService)}snapshot(){this.#t.push({activationService:this.#e.activationService.clone(),bindingService:this.#e.bindingService.clone(),deactivationService:this.#e.deactivationService.clone()})}}const Rh=Bt.Transient;class $h{#e;#t;#i;#n;#r;#s;constructor(e){const t=e?.autobind??!1,i=e?.defaultScope??Rh;this.#n=this.#l(e,t,i);const r=new Ph(this.#n),s=new Th(r,this.#n),a=new Ah(this.#n);this.#e=new Ih(a.deactivationParams,i,s,this.#n),this.#t=new Oh(this.#e,a.deactivationParams,i,s,this.#n),this.#r=new jh(r,this.#n,t,i),this.#i=new Nh(this,this.#n,this.#r),this.#s=new Mh(this.#n)}bind(e){return this.#e.bind(e)}get(e,t){return this.#r.get(e,t)}getAll(e,t){return this.#r.getAll(e,t)}async getAllAsync(e,t){return this.#r.getAllAsync(e,t)}async getAsync(e,t){return this.#r.getAsync(e,t)}isBound(e,t){return this.#e.isBound(e,t)}isCurrentBound(e,t){return this.#e.isCurrentBound(e,t)}async load(...e){return this.#t.load(...e)}loadSync(...e){this.#t.loadSync(...e)}onActivation(e,t){this.#n.activationService.add(t,{serviceId:e})}onDeactivation(e,t){this.#n.deactivationService.add(t,{serviceId:e})}register(e){this.#i.register(this,e)}restore(){this.#s.restore()}async rebind(e){return this.#e.rebind(e)}rebindSync(e){return this.#e.rebindSync(e)}snapshot(){this.#s.snapshot()}async unbind(e){await this.#e.unbind(e)}async unbindAll(){await this.#e.unbindAll()}unbindAllSync(){this.#e.unbindAllSync()}unbindSync(e){this.#e.unbindSync(e)}async unload(...e){return this.#t.unload(...e)}unloadSync(...e){this.#t.unloadSync(...e)}#o(e,t){if(e)return{scope:t}}#l(e,t,i){const r=this.#o(t,i);if(e?.parent===void 0)return new $l(wr.build(()=>{}),dl.build(()=>{},r),pl.build(()=>{}),new xl);const s=new xl,a=e.parent;return a.#n.planResultCacheService.subscribe(s),new $l(wr.build(()=>a.#n.activationService),dl.build(()=>a.#n.bindingService,r),pl.build(()=>a.#n.deactivationService),s)}}class fa{jsonld;constructor(e){this.jsonld=e}getIdentifier(){return this.jsonld.identifier}setIdentifier(e){this.jsonld.identifier=e}getName(){return this.jsonld.name}setName(e){this.jsonld.name=e}getText(){return this.jsonld.text}setText(e){this.jsonld.text=e}get(e){return this.jsonld[e]}set(e,t){this.jsonld[e]=t}getSource(){return this.jsonld}}class jn{id;name;mode="";source;syntax;html;document;css;js;version;headline="";headlineRaw="";lastModificationDate;lastAuthor;canEdit=!0;constructor(e="",t="",i="",r=""){this.document=new fa({}),this.source=i,this.syntax=r,this.html="",this.name=t,this.id=e,this.css=[],this.js=[],this.version=""}toObject(){return{id:this.id,name:this.name,source:this.source,syntax:this.syntax,html:this.html,document:this.document.getSource(),css:this.css,js:this.js,version:this.version}}fromObject(e){this.id=e.id,this.name=e.name,this.source=e.source,this.syntax=e.syntax,this.html=e.html,this.document=new fa(e.document),this.css=e.css,this.js=e.js,this.version=e.version}}var Lh=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Ll=(n,e)=>(t,i)=>e(t,i,n);let xr=class{constructor(e){this.loggerConfig=e}module;setModule(e){this.module=e}debug(...e){(!this.loggerConfig||this.loggerConfig.hasLevelId(this.module,4))&&e.unshift(this.module+":"),console.debug.apply(null,e)}info(...e){e.unshift(this.module+":"),console.info.apply(null,e)}warn(...e){e.unshift(this.module+":"),console.warn.apply(null,e)}error(...e){e.unshift(this.module+":"),console.error.apply(null,e)}};xr=Lh([it(),Ll(0,Le("LoggerConfig")),Ll(0,Hp())],xr);var Bh=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};let da=class{config;computedConfig;defaultLevel;defaultLevelId;levels=new Map;constructor(e="error"){this.config=new Map,this.defaultLevel=e,this.computedConfig=new Map,this.levels.set("error",1),this.levels.set("warn",2),this.levels.set("info",3),this.levels.set("debug",4)}addLevel(e,t){const i=this.levels.get(t);i!=null&&this.config.forEach(r=>{if(r.startsWith(e)){const s=this.computedConfig.get(r);(s==null||i&&i>s)&&i&&this.computedConfig.set(r,i)}})}getLevels(){return this.config}getLevel(e){let t=this.config.get(e);return t||(t=this.defaultLevel),t}getLevelId(e){return this.levels.get(e)||10}setDefaultLevel(e){this.defaultLevel=e,this.defaultLevelId=this.getLevelId(this.defaultLevel)}getDefaultLevel(){return this.defaultLevel}getDefaultLevelId(){return this.defaultLevelId?this.defaultLevelId:(this.defaultLevelId=this.getLevelId(this.defaultLevel),this.defaultLevelId)}hasLevel(e,t){let i=this.computedConfig.get(e);i||(i=this.getDefaultLevelId());const r=this.getLevelId(t);return!!(r&&i>=r)}hasLevelId(e,t){let i=this.computedConfig.get(e);i||(i=this.getDefaultLevelId());const r=t;return!!(r&&i>=r)}};da=Bh([it()],da);var Fh=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Dh=(n,e)=>(t,i)=>e(t,i,n);let Sr=class{name;baseURL;baseRestURL;realtimeURL;authenticationBaseURL;authenticationManager;homePage;storage;serverRendering;designSystem;editor;offline;offlineSetup;storageRoot;cristal;logger;constructor(e){this.logger=e,this.logger.setModule("storage.components.defaultWikiStorage"),this.offlineSetup=!1}setConfig(e,t,i,r,s,a,l,d,h){Object.assign(this,{name:e,baseURL:t,baseRestURL:i,homePage:r,serverRendering:s,designSystem:a,offline:l,editor:d,...h})}setConfigFromObject(e){Object.assign(this,e)}setupOfflineStorage(){if(this.logger.debug("Checking offline storage"),this.offline&&this.cristal){this.logger.debug("Looking for wrapping offline storage");const e=this.cristal.getContainer().get("WrappingStorage");e?(this.logger.debug("Offline local storage is ready"),e.setStorage(this.storage),e.setWikiConfig(this.storage.getWikiConfig()),this.storage=e):this.logger.debug("Failed Looking for wrapping offline storage")}else this.cristal||this.logger.debug("Cristal not initialized"),this.offline||this.logger.debug("Offline mode not activated")}isSupported(e){return e=="html"}initialize(){this.offline&&!this.offlineSetup&&(this.setupOfflineStorage(),this.offlineSetup=!0,this.storage.isStorageReady())}defaultPageName(){return"index"}getType(){return"Default"}getNewPageDefaultName(){return"newpage"}};Sr=Fh([it(),Dh(0,Le("Logger"))],Sr);var Kh=Object.getOwnPropertyDescriptor,qh=(n,e,t,i)=>{for(var r=i>1?void 0:i?Kh(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};let pa=class{wikiConfig;container;availableConfigurations;constructor(){this.availableConfigurations=new Map}getApp(){throw new Error("Method not implemented.")}getRouter(){throw new Error("Method not implemented.")}getContainer(){return this.container}setContainer(n){this.container=n}getWikiConfig(){return this.wikiConfig}setWikiConfig(n){this.wikiConfig=n}getSkinManager(){throw new Error("Method not implemented.")}switchConfig(){}setAvailableConfigurations(n){for(const e in n){const t=n[e],i=t?.configType;if(t){const r=this.container.get("WikiConfig",{name:i});r.setConfigFromObject(t),this.availableConfigurations.set(e,r)}}}getAvailableConfigurations(){return this.availableConfigurations}deleteAvailableConfiguration(n){this.availableConfigurations.delete(n)}run(){throw new Error("Method not implemented.")}getUIXTemplates(){throw new Error("Method not implemented.")}getMenuEntries(){throw new Error("Method not implemented.")}getCurrentPage(){throw new Error("Method not implemented.")}getCurrentContent(){throw new Error("Method not implemented.")}getCurrentSource(){throw new Error("Method not implemented.")}getCurrentSyntax(){throw new Error("Method not implemented.")}setCurrentPage(){throw new Error("Method not implemented.")}setContentRef(){throw new Error("Method not implemented.")}loadPageFromURL(){throw new Error("Method not implemented.")}loadPage(){throw new Error("Method not implemented.")}getPage(){throw new Error("Method not implemented.")}getLogger(){return new xr}getLoggerConfig(){throw new Error("Method not implemented.")}};pa=qh([it()],pa);var Uh=Object.getOwnPropertyDescriptor,zh=(n,e,t,i)=>{for(var r=i>1?void 0:i?Uh(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};let ha=class{constructor(){this.initialize()}initialize(){}getStatus(){return!0}async increment(){return 0}async addToQueue(){}async getQueueSize(){return 0}};ha=zh([it()],ha);let sf;const lc=n=>sf=n,Vh=Symbol();function ga(n){return n&&typeof n=="object"&&Object.prototype.toString.call(n)==="[object Object]"&&typeof n.toJSON!="function"}var dr;(function(n){n.direct="direct",n.patchObject="patch object",n.patchFunction="patch function"})(dr||(dr={}));const of=()=>{};function Bl(n,e,t,i=of){n.add(e);const r=()=>{n.delete(e)&&i()};return!t&&cu()&&Wd(r),r}function bi(n,...e){n.forEach(t=>{t(...e)})}const Wh=n=>n(),Fl=Symbol(),Do=Symbol();function ma(n,e){n instanceof Map&&e instanceof Map?e.forEach((t,i)=>n.set(i,t)):n instanceof Set&&e instanceof Set&&e.forEach(n.add,n);for(const t in e){if(!e.hasOwnProperty(t))continue;const i=e[t],r=n[t];ga(r)&&ga(i)&&n.hasOwnProperty(t)&&!ct(i)&&!Nn(i)?n[t]=ma(r,i):n[t]=i}return n}const Hh=Symbol();function Gh(n){return!ga(n)||!Object.prototype.hasOwnProperty.call(n,Hh)}const{assign:Cn}=Object;function Yh(n){return!!(ct(n)&&n.effect)}function Jh(n,e,t,i){const{state:r,actions:s,getters:a}=e,l=t.state.value[n];let d;function h(){l||(t.state.value[n]=r?r():{});const m=yp(t.state.value[n]);return Cn(m,s,Object.keys(a||{}).reduce((v,w)=>(v[w]=pp(Nu(()=>{lc(t);const P=t._s.get(n);return a[w].call(P,P)})),v),{}))}return d=af(n,h,e,t,i,!0),d}function af(n,e,t={},i,r,s){let a;const l=Cn({actions:{}},t),d={deep:!0};let h,m,v=new Set,w=new Set,P;const K=i.state.value[n];!s&&!K&&(i.state.value[n]={});let A;function D(Q){let ge;h=m=!1,typeof Q=="function"?(Q(i.state.value[n]),ge={type:dr.patchFunction,storeId:n,events:P}):(ma(i.state.value[n],Q),ge={type:dr.patchObject,payload:Q,storeId:n,events:P});const Re=A=Symbol();Ip().then(()=>{A===Re&&(h=!0)}),m=!0,bi(v,ge,i.state.value[n])}const z=s?function(){const{state:ge}=t,Re=ge?ge():{};this.$patch(We=>{Cn(We,Re)})}:of;function H(){a.stop(),v.clear(),w.clear(),i._s.delete(n)}const ie=(Q,ge="")=>{if(Fl in Q)return Q[Do]=ge,Q;const Re=function(){lc(i);const We=Array.from(arguments),_e=new Set,rt=new Set;function gn(tt){_e.add(tt)}function zt(tt){rt.add(tt)}bi(w,{args:We,name:Re[Do],store:ne,after:gn,onError:zt});let ut;try{ut=Q.apply(this&&this.$id===n?this:ne,We)}catch(tt){throw bi(rt,tt),tt}return ut instanceof Promise?ut.then(tt=>(bi(_e,tt),tt)).catch(tt=>(bi(rt,tt),Promise.reject(tt))):(bi(_e,ut),ut)};return Re[Fl]=!0,Re[Do]=ge,Re},J={_p:i,$id:n,$onAction:Bl.bind(null,w),$patch:D,$reset:z,$subscribe(Q,ge={}){const Re=Bl(v,Q,ge.detached,()=>We()),We=a.run(()=>$p(()=>i.state.value[n],_e=>{(ge.flush==="sync"?m:h)&&Q({storeId:n,type:dr.direct,events:P},_e)},Cn({},d,ge)));return Re},$dispose:H},ne=Ja(J);i._s.set(n,ne);const pe=(i._a&&i._a.runWithContext||Wh)(()=>i._e.run(()=>(a=Vd()).run(()=>e({action:ie}))));for(const Q in pe){const ge=pe[Q];if(ct(ge)&&!Yh(ge)||Nn(ge))s||(K&&Gh(ge)&&(ct(ge)?ge.value=K[Q]:ma(ge,K[Q])),i.state.value[n][Q]=ge);else if(typeof ge=="function"){const Re=ie(ge,Q);pe[Q]=Re,l.actions[Q]=ge}}return Cn(ne,pe),Cn(Me(ne),pe),Object.defineProperty(ne,"$state",{get:()=>i.state.value[n],set:Q=>{D(ge=>{Cn(ge,Q)})}}),i._p.forEach(Q=>{Cn(ne,a.run(()=>Q({store:ne,app:i._a,pinia:i,options:l})))}),K&&s&&t.hydrate&&t.hydrate(ne.$state,K),h=!0,m=!0,ne}function Qh(n,e,t){let i;const r=typeof e=="function";i=r?t:e;function s(a,l){const d=jp();return a=a||(d?Au(Vh,null):null),a&&lc(a),a=sf,a._s.has(n)||(r?af(n,e,i,a):Jh(n,i,a)),a._s.get(n)}return s.$id=n,s}function Xh(n){const e=Me(n),t={};for(const i in e){const r=e[i];r.effect?t[i]=Nu({get:()=>n[i],set(s){n[i]=s}}):(ct(r)||Nn(r))&&(t[i]=xp(n,i))}return t}var Zh=Object.getOwnPropertyDescriptor,eg=(n,e,t,i)=>{for(var r=i>1?void 0:i?Zh(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};const tg=Qh("alerts",{state(){return{alerts:[],id:0}},actions:{createAlert(n,e,t){const i=this.alerts.find(r=>r.type==n&&r.message==e&&r.actions==t);i?i.duplicatesCount++:this.alerts.push({id:this.id++,type:n,message:e,actions:t,duplicatesCount:0})},deleteAlert(n){for(const e of this.alerts.keys())if(this.alerts[e].id==n){this.alerts.splice(e,1);break}}}});let va=class{refs;store;constructor(){this.store=tg(),this.refs=Xh(this.store)}list(){return this.refs.alerts}info(n,e){this.store.createAlert("info",n,e)}success(n,e){this.store.createAlert("success",n,e)}warning(n,e){this.store.createAlert("warning",n,e)}error(n,e){this.store.createAlert("error",n,e)}dismiss(n){this.store.deleteAlert(n)}};va=eg([it()],va);var ng=Object.getOwnPropertyDescriptor,ig=(n,e,t,i)=>{for(var r=i>1?void 0:i?ng(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},rg=(n,e)=>(t,i)=>e(t,i,n);let ya=class{constructor(n){this.cristal=n}get(){return this.cristal.getContainer().get("AlertsService")}};ya=ig([it(),rg(0,Le("CristalApp"))],ya);let sg=class{constructor(e){e.bind("AlertsService").to(va).inSingletonScope(),e.bind("AlertsServiceProvider").to(ya).inSingletonScope()}};var og=Object.getOwnPropertyDescriptor,ag=(n,e,t,i)=>{for(var r=i>1?void 0:i?og(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},cg=(n,e)=>(t,i)=>e(t,i,n);let ba=class{constructor(n){this.cristalApp=n}get(n){const e=n??this.cristalApp.getWikiConfig().authenticationManager??this.cristalApp.getWikiConfig().getType();try{return this.cristalApp.getContainer().get("AuthenticationManager",{name:e})}catch(t){this.cristalApp.getLogger("authentication.api").warn(`Couldn't resolve AuthenticationManager for type=[${e}]`,t);return}}};ba=ag([it(),cg(0,Le("CristalApp"))],ba);let lg=class{constructor(e){e.bind("AuthenticationManagerProvider").to(ba).inSingletonScope()}};var xs={exports:{}},ug=xs.exports,Dl;function fg(){return Dl||(Dl=1,(function(n,e){((t,i)=>{n.exports=i()})(ug,function(){var t=function(o,c){return(t=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(u,f){u.__proto__=f}:function(u,f){for(var p in f)Object.prototype.hasOwnProperty.call(f,p)&&(u[p]=f[p])}))(o,c)},i=function(){return(i=Object.assign||function(o){for(var c,u=1,f=arguments.length;u<f;u++)for(var p in c=arguments[u])Object.prototype.hasOwnProperty.call(c,p)&&(o[p]=c[p]);return o}).apply(this,arguments)};function r(o,c,u){for(var f,p=0,g=c.length;p<g;p++)!f&&p in c||((f=f||Array.prototype.slice.call(c,0,p))[p]=c[p]);return o.concat(f||Array.prototype.slice.call(c))}var s=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:gr,a=Object.keys,l=Array.isArray;function d(o,c){return typeof c=="object"&&a(c).forEach(function(u){o[u]=c[u]}),o}typeof Promise>"u"||s.Promise||(s.Promise=Promise);var h=Object.getPrototypeOf,m={}.hasOwnProperty;function v(o,c){return m.call(o,c)}function w(o,c){typeof c=="function"&&(c=c(h(o))),(typeof Reflect>"u"?a:Reflect.ownKeys)(c).forEach(function(u){K(o,u,c[u])})}var P=Object.defineProperty;function K(o,c,u,f){P(o,c,d(u&&v(u,"get")&&typeof u.get=="function"?{get:u.get,set:u.set,configurable:!0}:{value:u,configurable:!0,writable:!0},f))}function A(o){return{from:function(c){return o.prototype=Object.create(c.prototype),K(o.prototype,"constructor",o),{extend:w.bind(null,o.prototype)}}}}var D=Object.getOwnPropertyDescriptor,z=[].slice;function H(o,c,u){return z.call(o,c,u)}function ie(o,c){return c(o)}function J(o){if(!o)throw new Error("Assertion Failed")}function ne(o){s.setImmediate?setImmediate(o):setTimeout(o,0)}function ue(o,c){if(typeof c=="string"&&v(o,c))return o[c];if(!c)return o;if(typeof c!="string"){for(var u=[],f=0,p=c.length;f<p;++f){var g=ue(o,c[f]);u.push(g)}return u}var y,b=c.indexOf(".");return b===-1||(y=o[c.substr(0,b)])==null?void 0:ue(y,c.substr(b+1))}function pe(o,c,u){if(o&&c!==void 0&&!("isFrozen"in Object&&Object.isFrozen(o)))if(typeof c!="string"&&"length"in c){J(typeof u!="string"&&"length"in u);for(var f=0,p=c.length;f<p;++f)pe(o,c[f],u[f])}else{var g,y,b=c.indexOf(".");b!==-1?(g=c.substr(0,b),(b=c.substr(b+1))===""?u===void 0?l(o)&&!isNaN(parseInt(g))?o.splice(g,1):delete o[g]:o[g]=u:pe(y=(y=o[g])&&v(o,g)?y:o[g]={},b,u)):u===void 0?l(o)&&!isNaN(parseInt(c))?o.splice(c,1):delete o[c]:o[c]=u}}function Q(o){var c,u={};for(c in o)v(o,c)&&(u[c]=o[c]);return u}var ge=[].concat;function Re(o){return ge.apply([],o)}var kt="BigUint64Array,BigInt64Array,Array,Boolean,String,Date,RegExp,Blob,File,FileList,FileSystemFileHandle,FileSystemDirectoryHandle,ArrayBuffer,DataView,Uint8ClampedArray,ImageBitmap,ImageData,Map,Set,CryptoKey".split(",").concat(Re([8,16,32,64].map(function(o){return["Int","Uint","Float"].map(function(c){return c+o+"Array"})}))).filter(function(o){return s[o]}),We=new Set(kt.map(function(o){return s[o]})),_e=null;function rt(o){return _e=new WeakMap,o=(function c(u){if(!u||typeof u!="object")return u;var f=_e.get(u);if(f)return f;if(l(u)){f=[],_e.set(u,f);for(var p=0,g=u.length;p<g;++p)f.push(c(u[p]))}else if(We.has(u.constructor))f=u;else{var y,b=h(u);for(y in f=b===Object.prototype?{}:Object.create(b),_e.set(u,f),u)v(u,y)&&(f[y]=c(u[y]))}return f})(o),_e=null,o}var gn={}.toString;function zt(o){return gn.call(o).slice(8,-1)}var ut=typeof Symbol<"u"?Symbol.iterator:"@@iterator",tt=typeof ut=="symbol"?function(o){var c;return o!=null&&(c=o[ut])&&c.apply(o)}:function(){return null};function he(o,c){c=o.indexOf(c),0<=c&&o.splice(c,1)}var ft={};function St(o){var c,u,f,p;if(arguments.length===1){if(l(o))return o.slice();if(this===ft&&typeof o=="string")return[o];if(p=tt(o))for(u=[];!(f=p.next()).done;)u.push(f.value);else{if(o==null)return[o];if(typeof(c=o.length)!="number")return[o];for(u=new Array(c);c--;)u[c]=o[c]}}else for(c=arguments.length,u=new Array(c);c--;)u[c]=arguments[c];return u}var Ke=typeof Symbol<"u"?function(o){return o[Symbol.toStringTag]==="AsyncFunction"}:function(){return!1},kt=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],X=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(kt),ve={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(o,c){this.name=o,this.message=c}function ci(o,c){return o+". Errors: "+Object.keys(c).map(function(u){return c[u].toString()}).filter(function(u,f,p){return p.indexOf(u)===f}).join(`
|
|
49
|
-
`)}function Ee(o,c,u,f){this.failures=c,this.failedKeys=f,this.successCount=u,this.message=ci(o,c)}function Vt(o,c){this.name="BulkError",this.failures=Object.keys(c).map(function(u){return c[u]}),this.failuresByPos=c,this.message=ci(o,this.failures)}A(dt).from(Error).extend({toString:function(){return this.name+": "+this.message}}),A(Ee).from(dt),A(Vt).from(dt);var Jt=X.reduce(function(o,c){return o[c]=c+"Error",o},{}),Bn=dt,fe=X.reduce(function(o,c){var u=c+"Error";function f(p,g){this.name=u,p?typeof p=="string"?(this.message="".concat(p).concat(g?`
|
|
50
|
-
`+g:""),this.inner=g||null):typeof p=="object"&&(this.message="".concat(p.name," ").concat(p.message),this.inner=p):(this.message=ve[c]||u,this.inner=null)}return A(f).from(Bn),o[c]=f,o},{}),pt=(fe.Syntax=SyntaxError,fe.Type=TypeError,fe.Range=RangeError,kt.reduce(function(o,c){return o[c+"Error"]=fe[c],o},{}));kt=X.reduce(function(o,c){return["Syntax","Type","Range"].indexOf(c)===-1&&(o[c+"Error"]=fe[c]),o},{});function Ie(){}function Et(o){return o}function Fn(o,c){return o==null||o===Et?c:function(u){return c(o(u))}}function Tt(o,c){return function(){o.apply(this,arguments),c.apply(this,arguments)}}function rn(o,c){return o===Ie?c:function(){var u=o.apply(this,arguments),f=(u!==void 0&&(arguments[0]=u),this.onsuccess),p=this.onerror,g=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return f&&(this.onsuccess=this.onsuccess?Tt(f,this.onsuccess):f),p&&(this.onerror=this.onerror?Tt(p,this.onerror):p),g!==void 0?g:u}}function Qt(o,c){return o===Ie?c:function(){o.apply(this,arguments);var u=this.onsuccess,f=this.onerror;this.onsuccess=this.onerror=null,c.apply(this,arguments),u&&(this.onsuccess=this.onsuccess?Tt(u,this.onsuccess):u),f&&(this.onerror=this.onerror?Tt(f,this.onerror):f)}}function li(o,c){return o===Ie?c:function(p){var f=o.apply(this,arguments),p=(d(p,f),this.onsuccess),g=this.onerror,y=(this.onsuccess=null,this.onerror=null,c.apply(this,arguments));return p&&(this.onsuccess=this.onsuccess?Tt(p,this.onsuccess):p),g&&(this.onerror=this.onerror?Tt(g,this.onerror):g),f===void 0?y===void 0?void 0:y:d(f,y)}}function ui(o,c){return o===Ie?c:function(){return c.apply(this,arguments)!==!1&&o.apply(this,arguments)}}function mn(o,c){return o===Ie?c:function(){var u=o.apply(this,arguments);if(u&&typeof u.then=="function"){for(var f=this,p=arguments.length,g=new Array(p);p--;)g[p]=arguments[p];return u.then(function(){return c.apply(f,g)})}return c.apply(this,arguments)}}kt.ModifyError=Ee,kt.DexieError=dt,kt.BulkError=Vt;var mt=typeof location<"u"&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Nt(o){mt=o}var B={},V=100,W=typeof Promise>"u"?[]:(X=Promise.resolve(),typeof crypto<"u"&&crypto.subtle?[W=crypto.subtle.digest("SHA-512",new Uint8Array([0])),h(W),X]:[X,h(X),X]),X=W[0],mi=W[1],mi=mi&&mi.then,de=X&&X.constructor,st=!!W[2],Ue=function(o,c){ye.push([o,c]),nt&&(queueMicrotask(It),nt=!1)},vt=!0,nt=!0,S=[],T=[],j=Et,q={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Ie,pgp:!1,env:{},finalize:Ie},F=q,ye=[],xe=0,be=[];function L(o){if(typeof this!="object")throw new TypeError("Promises must be constructed via new");this._listeners=[],this._lib=!1;var c=this._PSD=F;if(typeof o!="function"){if(o!==B)throw new TypeError("Not a function");this._state=arguments[1],this._value=arguments[2],this._state===!1&&le(this,this._value)}else this._state=null,this._value=null,++c.ref,(function u(f,p){try{p(function(g){if(f._state===null){if(g===f)throw new TypeError("A promise cannot be resolved with itself.");var y=f._lib&&sn();g&&typeof g.then=="function"?u(f,function(b,_){g instanceof L?g._then(b,_):g.then(b,_)}):(f._state=!0,f._value=g,Se(f)),y&&vn()}},le.bind(null,f))}catch(g){le(f,g)}})(this,o)}var se={get:function(){var o=F,c=Lr;function u(f,p){var g=this,y=!o.global&&(o!==F||c!==Lr),b=y&&!bn(),_=new L(function(M,C){$e(g,new ae(Ac(f,o,y,b),Ac(p,o,y,b),M,C,o))});return this._consoleTask&&(_._consoleTask=this._consoleTask),_}return u.prototype=B,u},set:function(o){K(this,"then",o&&o.prototype===B?se:{get:function(){return o},set:se.set})}};function ae(o,c,u,f,p){this.onFulfilled=typeof o=="function"?o:null,this.onRejected=typeof c=="function"?c:null,this.resolve=u,this.reject=f,this.psd=p}function le(o,c){var u,f;T.push(c),o._state===null&&(u=o._lib&&sn(),c=j(c),o._state=!1,o._value=c,f=o,S.some(function(p){return p._value===f._value})||S.push(f),Se(o),u)&&vn()}function Se(o){var c=o._listeners;o._listeners=[];for(var u=0,f=c.length;u<f;++u)$e(o,c[u]);var p=o._PSD;--p.ref||p.finalize(),xe===0&&(++xe,Ue(function(){--xe==0&&Bi()},[]))}function $e(o,c){if(o._state===null)o._listeners.push(c);else{var u=o._state?c.onFulfilled:c.onRejected;if(u===null)return(o._state?c.resolve:c.reject)(o._value);++c.psd.ref,++xe,Ue(ze,[u,o,c])}}function ze(o,c,u){try{var f,p=c._value;!c._state&&T.length&&(T=[]),f=mt&&c._consoleTask?c._consoleTask.run(function(){return o(p)}):o(p),c._state||T.indexOf(p)!==-1||(g=>{for(var y=S.length;y;)if(S[--y]._value===g._value)return S.splice(y,1)})(c),u.resolve(f)}catch(g){u.reject(g)}finally{--xe==0&&Bi(),--u.psd.ref||u.psd.finalize()}}function It(){Dn(q,function(){sn()&&vn()})}function sn(){var o=vt;return nt=vt=!1,o}function vn(){var o,c,u;do for(;0<ye.length;)for(o=ye,ye=[],u=o.length,c=0;c<u;++c){var f=o[c];f[0].apply(null,f[1])}while(0<ye.length);nt=vt=!0}function Bi(){for(var o=S,c=(S=[],o.forEach(function(f){f._PSD.onunhandled.call(null,f._value,f)}),be.slice(0)),u=c.length;u;)c[--u]()}function Mr(o){return new L(B,!1,o)}function qe(o,c){var u=F;return function(){var f=sn(),p=F;try{return wn(u,!0),o.apply(this,arguments)}catch(g){c&&c(g)}finally{wn(p,!1),f&&vn()}}}w(L.prototype,{then:se,_then:function(o,c){$e(this,new ae(null,null,o,c,F))},catch:function(o){var c,u;return arguments.length===1?this.then(null,o):(c=o,u=arguments[1],typeof c=="function"?this.then(null,function(f){return(f instanceof c?u:Mr)(f)}):this.then(null,function(f){return(f&&f.name===c?u:Mr)(f)}))},finally:function(o){return this.then(function(c){return L.resolve(o()).then(function(){return c})},function(c){return L.resolve(o()).then(function(){return Mr(c)})})},timeout:function(o,c){var u=this;return o<1/0?new L(function(f,p){var g=setTimeout(function(){return p(new fe.Timeout(c))},o);u.then(f,p).finally(clearTimeout.bind(null,g))}):this}}),typeof Symbol<"u"&&Symbol.toStringTag&&K(L.prototype,Symbol.toStringTag,"Dexie.Promise"),q.env=Oc(),w(L,{all:function(){var o=St.apply(null,arguments).map(Br);return new L(function(c,u){o.length===0&&c([]);var f=o.length;o.forEach(function(p,g){return L.resolve(p).then(function(y){o[g]=y,--f||c(o)},u)})})},resolve:function(o){return o instanceof L?o:o&&typeof o.then=="function"?new L(function(c,u){o.then(c,u)}):new L(B,!0,o)},reject:Mr,race:function(){var o=St.apply(null,arguments).map(Br);return new L(function(c,u){o.map(function(f){return L.resolve(f).then(c,u)})})},PSD:{get:function(){return F},set:function(o){return F=o}},totalEchoes:{get:function(){return Lr}},newPSD:yn,usePSD:Dn,scheduler:{get:function(){return Ue},set:function(o){Ue=o}},rejectionMapper:{get:function(){return j},set:function(o){j=o}},follow:function(o,c){return new L(function(u,f){return yn(function(p,g){var y=F;y.unhandleds=[],y.onunhandled=g,y.finalize=Tt(function(){var b,_=this;b=function(){_.unhandleds.length===0?p():g(_.unhandleds[0])},be.push(function M(){b(),be.splice(be.indexOf(M),1)}),++xe,Ue(function(){--xe==0&&Bi()},[])},y.finalize),o()},c,u,f)})}}),de&&(de.allSettled&&K(L,"allSettled",function(){var o=St.apply(null,arguments).map(Br);return new L(function(c){o.length===0&&c([]);var u=o.length,f=new Array(u);o.forEach(function(p,g){return L.resolve(p).then(function(y){return f[g]={status:"fulfilled",value:y}},function(y){return f[g]={status:"rejected",reason:y}}).then(function(){return--u||c(f)})})})}),de.any&&typeof AggregateError<"u"&&K(L,"any",function(){var o=St.apply(null,arguments).map(Br);return new L(function(c,u){o.length===0&&u(new AggregateError([]));var f=o.length,p=new Array(f);o.forEach(function(g,y){return L.resolve(g).then(function(b){return c(b)},function(b){p[y]=b,--f||u(new AggregateError(p))})})})}),de.withResolvers)&&(L.withResolvers=de.withResolvers);var ot={awaits:0,echoes:0,id:0},ld=0,Rr=[],$r=0,Lr=0,ud=0;function yn(o,y,u,f){var p=F,g=Object.create(p),y=(g.parent=p,g.ref=0,g.global=!1,g.id=++ud,q.env,g.env=st?{Promise:L,PromiseProp:{value:L,configurable:!0,writable:!0},all:L.all,race:L.race,allSettled:L.allSettled,any:L.any,resolve:L.resolve,reject:L.reject}:{},y&&d(g,y),++p.ref,g.finalize=function(){--this.parent.ref||this.parent.finalize()},Dn(g,o,u,f));return g.ref===0&&g.finalize(),y}function fi(){return ot.id||(ot.id=++ld),++ot.awaits,ot.echoes+=V,ot.id}function bn(){return!!ot.awaits&&(--ot.awaits==0&&(ot.id=0),ot.echoes=ot.awaits*V,!0)}function Br(o){return ot.echoes&&o&&o.constructor===de?(fi(),o.then(function(c){return bn(),c},function(c){return bn(),Ge(c)})):o}function fd(){var o=Rr[Rr.length-1];Rr.pop(),wn(o,!1)}function wn(o,c){var u,f,p=F;(c?!ot.echoes||$r++&&o===F:!$r||--$r&&o===F)||queueMicrotask(c?function(g){++Lr,ot.echoes&&--ot.echoes!=0||(ot.echoes=ot.awaits=ot.id=0),Rr.push(F),wn(g,!0)}.bind(null,o):fd),o!==F&&(F=o,p===q&&(q.env=Oc()),st)&&(u=q.env.Promise,f=o.env,p.global||o.global)&&(Object.defineProperty(s,"Promise",f.PromiseProp),u.all=f.all,u.race=f.race,u.resolve=f.resolve,u.reject=f.reject,f.allSettled&&(u.allSettled=f.allSettled),f.any)&&(u.any=f.any)}function Oc(){var o=s.Promise;return st?{Promise:o,PromiseProp:Object.getOwnPropertyDescriptor(s,"Promise"),all:o.all,race:o.race,allSettled:o.allSettled,any:o.any,resolve:o.resolve,reject:o.reject}:{}}function Dn(o,c,u,f,p){var g=F;try{return wn(o,!0),c(u,f,p)}finally{wn(g,!1)}}function Ac(o,c,u,f){return typeof o!="function"?o:function(){var p=F;u&&fi(),wn(c,!0);try{return o.apply(this,arguments)}finally{wn(p,!1),f&&queueMicrotask(bn)}}}function no(o){Promise===de&&ot.echoes===0?$r===0?o():enqueueNativeMicroTask(o):setTimeout(o,0)}(""+mi).indexOf("[native code]")===-1&&(fi=bn=Ie);var Ge=L.reject,Kn="",on="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Pc="String expected.",di=[],Fr="__dbnames",io="readonly",ro="readwrite";function qn(o,c){return o?c?function(){return o.apply(this,arguments)&&c.apply(this,arguments)}:o:c}var Tc={type:3,lower:-1/0,lowerOpen:!1,upper:[[]],upperOpen:!1};function Dr(o){return typeof o!="string"||/\./.test(o)?function(c){return c}:function(c){return c[o]===void 0&&o in c&&delete(c=rt(c))[o],c}}function Nc(){throw fe.Type("Entity instances must never be new:ed. Instances are generated by the framework bypassing the constructor.")}function Ce(o,c){try{var u=jc(o),f=jc(c);if(u!==f)return u==="Array"?1:f==="Array"?-1:u==="binary"?1:f==="binary"?-1:u==="string"?1:f==="string"?-1:u==="Date"?1:f!=="Date"?NaN:-1;switch(u){case"number":case"Date":case"string":return c<o?1:o<c?-1:0;case"binary":for(var p=Mc(o),g=Mc(c),y=p.length,b=g.length,_=y<b?y:b,M=0;M<_;++M)if(p[M]!==g[M])return p[M]<g[M]?-1:1;return y===b?0:y<b?-1:1;case"Array":for(var C=o,x=c,I=C.length,O=x.length,E=I<O?I:O,k=0;k<E;++k){var R=Ce(C[k],x[k]);if(R!==0)return R}return I===O?0:I<O?-1:1}}catch{}return NaN}function jc(o){var c=typeof o;return c=="object"&&(ArrayBuffer.isView(o)||(c=zt(o))==="ArrayBuffer")?"binary":c}function Mc(o){return o instanceof Uint8Array?o:ArrayBuffer.isView(o)?new Uint8Array(o.buffer,o.byteOffset,o.byteLength):new Uint8Array(o)}function Kr(o,c,u){var f=o.schema.yProps;return f?(c&&0<u.numFailures&&(c=c.filter(function(p,g){return!u.failures[g]})),Promise.all(f.map(function(p){return p=p.updatesTable,c?o.db.table(p).where("k").anyOf(c).delete():o.db.table(p).clear()})).then(function(){return u})):u}Rc.prototype.execute=function(o){var c=this["@@propmod"];if(c.add!==void 0){var u=c.add;if(l(u))return r(r([],l(o)?o:[],!0),u).sort();if(typeof u=="number")return(Number(o)||0)+u;if(typeof u=="bigint")try{return BigInt(o)+u}catch{return BigInt(0)+u}throw new TypeError("Invalid term ".concat(u))}if(c.remove!==void 0){var f=c.remove;if(l(f))return l(o)?o.filter(function(p){return!f.includes(p)}).sort():[];if(typeof f=="number")return Number(o)-f;if(typeof f=="bigint")try{return BigInt(o)-f}catch{return BigInt(0)-f}throw new TypeError("Invalid subtrahend ".concat(f))}return u=(u=c.replacePrefix)==null?void 0:u[0],u&&typeof o=="string"&&o.startsWith(u)?c.replacePrefix[1]+o.substring(u.length):o};var Fi=Rc;function Rc(o){this["@@propmod"]=o}function $c(o,c){for(var u=a(c),f=u.length,p=!1,g=0;g<f;++g){var y=u[g],b=c[y],_=ue(o,y);b instanceof Fi?(pe(o,y,b.execute(_)),p=!0):_!==b&&(pe(o,y,b),p=!0)}return p}Be.prototype._trans=function(o,c,u){var f=this._tx||F.trans,p=this.name,g=mt&&typeof console<"u"&&console.createTask&&console.createTask("Dexie: ".concat(o==="readonly"?"read":"write"," ").concat(this.name));function y(M,C,x){if(x.schema[p])return c(x.idbtrans,x);throw new fe.NotFound("Table "+p+" not part of transaction")}var b=sn();try{var _=f&&f.db._novip===this.db._novip?f===F.trans?f._promise(o,y,u):yn(function(){return f._promise(o,y,u)},{trans:f,transless:F.transless||F}):(function M(C,x,I,O){if(C.idbdb&&(C._state.openComplete||F.letThrough||C._vip)){var E=C._createTransaction(x,I,C._dbSchema);try{E.create(),C._state.PR1398_maxLoop=3}catch(k){return k.name===Jt.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return M(C,x,I,O)})):Ge(k)}return E._promise(x,function(k,R){return yn(function(){return F.trans=E,O(k,R,E)})}).then(function(k){if(x==="readwrite")try{E.idbtrans.commit()}catch{}return x==="readonly"?k:E._completion.then(function(){return k})})}if(C._state.openComplete)return Ge(new fe.DatabaseClosed(C._state.dbOpenError));if(!C._state.isBeingOpened){if(!C._state.autoOpen)return Ge(new fe.DatabaseClosed);C.open().catch(Ie)}return C._state.dbReadyPromise.then(function(){return M(C,x,I,O)})})(this.db,o,[this.name],y);return g&&(_._consoleTask=g,_=_.catch(function(M){return console.trace(M),Ge(M)})),_}finally{b&&vn()}},Be.prototype.get=function(o,c){var u=this;return o&&o.constructor===Object?this.where(o).first(c):o==null?Ge(new fe.Type("Invalid argument to Table.get()")):this._trans("readonly",function(f){return u.core.get({trans:f,key:o}).then(function(p){return u.hook.reading.fire(p)})}).then(c)},Be.prototype.where=function(o){if(typeof o=="string")return new this.db.WhereClause(this,o);if(l(o))return new this.db.WhereClause(this,"[".concat(o.join("+"),"]"));var c=a(o);if(c.length===1)return this.where(c[0]).equals(o[c[0]]);var u=this.schema.indexes.concat(this.schema.primKey).filter(function(b){if(b.compound&&c.every(function(M){return 0<=b.keyPath.indexOf(M)})){for(var _=0;_<c.length;++_)if(c.indexOf(b.keyPath[_])===-1)return!1;return!0}return!1}).sort(function(b,_){return b.keyPath.length-_.keyPath.length})[0];if(u&&this.db._maxKey!==Kn)return y=u.keyPath.slice(0,c.length),this.where(y).equals(y.map(function(b){return o[b]}));!u&&mt&&console.warn("The query ".concat(JSON.stringify(o)," on ").concat(this.name," would benefit from a ")+"compound index [".concat(c.join("+"),"]"));var f=this.schema.idxByName;function p(b,_){return Ce(b,_)===0}var y=c.reduce(function(C,_){var M=C[0],C=C[1],x=f[_],I=o[_];return[M||x,M||!x?qn(C,x&&x.multi?function(O){return O=ue(O,_),l(O)&&O.some(function(E){return p(I,E)})}:function(O){return p(I,ue(O,_))}):C]},[null,null]),g=y[0],y=y[1];return g?this.where(g.name).equals(o[g.keyPath]).filter(y):u?this.filter(y):this.where(c).equals("")},Be.prototype.filter=function(o){return this.toCollection().and(o)},Be.prototype.count=function(o){return this.toCollection().count(o)},Be.prototype.offset=function(o){return this.toCollection().offset(o)},Be.prototype.limit=function(o){return this.toCollection().limit(o)},Be.prototype.each=function(o){return this.toCollection().each(o)},Be.prototype.toArray=function(o){return this.toCollection().toArray(o)},Be.prototype.toCollection=function(){return new this.db.Collection(new this.db.WhereClause(this))},Be.prototype.orderBy=function(o){return new this.db.Collection(new this.db.WhereClause(this,l(o)?"[".concat(o.join("+"),"]"):o))},Be.prototype.reverse=function(){return this.toCollection().reverse()},Be.prototype.mapToClass=function(o){for(var c=this.db,u=this.name,f=((this.schema.mappedClass=o).prototype instanceof Nc&&(o=(y=>{var b=C,_=y;if(typeof _!="function"&&_!==null)throw new TypeError("Class extends value "+String(_)+" is not a constructor or null");function M(){this.constructor=b}function C(){return y!==null&&y.apply(this,arguments)||this}return t(b,_),b.prototype=_===null?Object.create(_):(M.prototype=_.prototype,new M),Object.defineProperty(C.prototype,"db",{get:function(){return c},enumerable:!1,configurable:!0}),C.prototype.table=function(){return u},C})(o)),new Set),p=o.prototype;p;p=h(p))Object.getOwnPropertyNames(p).forEach(function(y){return f.add(y)});function g(y){if(!y)return y;var b,_=Object.create(o.prototype);for(b in y)if(!f.has(b))try{_[b]=y[b]}catch{}return _}return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=g,this.hook("reading",g),o},Be.prototype.defineClass=function(){return this.mapToClass(function(o){d(this,o)})},Be.prototype.add=function(o,c){var u=this,f=this.schema.primKey,p=f.auto,g=f.keyPath,y=o;return g&&p&&(y=Dr(g)(o)),this._trans("readwrite",function(b){return u.core.mutate({trans:b,type:"add",keys:c!=null?[c]:null,values:[y]})}).then(function(b){return b.numFailures?L.reject(b.failures[0]):b.lastResult}).then(function(b){if(g)try{pe(o,g,b)}catch{}return b})},Be.prototype.upsert=function(o,c){var u=this,f=this.schema.primKey.keyPath;return this._trans("readwrite",function(p){return u.core.get({trans:p,key:o}).then(function(g){var y=g??{};return $c(y,c),f&&pe(y,f,o),u.core.mutate({trans:p,type:"put",values:[y],keys:[o],upsert:!0,updates:{keys:[o],changeSpecs:[c]}}).then(function(b){return b.numFailures?L.reject(b.failures[0]):!!g})})})},Be.prototype.update=function(o,c){return typeof o!="object"||l(o)?this.where(":id").equals(o).modify(c):(o=ue(o,this.schema.primKey.keyPath))===void 0?Ge(new fe.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(o).modify(c)},Be.prototype.put=function(o,c){var u=this,f=this.schema.primKey,p=f.auto,g=f.keyPath,y=o;return g&&p&&(y=Dr(g)(o)),this._trans("readwrite",function(b){return u.core.mutate({trans:b,type:"put",values:[y],keys:c!=null?[c]:null})}).then(function(b){return b.numFailures?L.reject(b.failures[0]):b.lastResult}).then(function(b){if(g)try{pe(o,g,b)}catch{}return b})},Be.prototype.delete=function(o){var c=this;return this._trans("readwrite",function(u){return c.core.mutate({trans:u,type:"delete",keys:[o]}).then(function(f){return Kr(c,[o],f)}).then(function(f){return f.numFailures?L.reject(f.failures[0]):void 0})})},Be.prototype.clear=function(){var o=this;return this._trans("readwrite",function(c){return o.core.mutate({trans:c,type:"deleteRange",range:Tc}).then(function(u){return Kr(o,null,u)})}).then(function(c){return c.numFailures?L.reject(c.failures[0]):void 0})},Be.prototype.bulkGet=function(o){var c=this;return this._trans("readonly",function(u){return c.core.getMany({keys:o,trans:u}).then(function(f){return f.map(function(p){return c.hook.reading.fire(p)})})})},Be.prototype.bulkAdd=function(o,c,u){var f=this,p=Array.isArray(c)?c:void 0,g=(u=u||(p?void 0:c))?u.allKeys:void 0;return this._trans("readwrite",function(y){var b=f.schema.primKey,M=b.auto,b=b.keyPath;if(b&&p)throw new fe.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(p&&p.length!==o.length)throw new fe.InvalidArgument("Arguments objects and keys must have the same length");var _=o.length,M=b&&M?o.map(Dr(b)):o;return f.core.mutate({trans:y,type:"add",keys:p,values:M,wantResults:g}).then(function(C){var x=C.numFailures,I=C.failures;if(x===0)return g?C.results:C.lastResult;throw new Vt("".concat(f.name,".bulkAdd(): ").concat(x," of ").concat(_," operations failed"),I)})})},Be.prototype.bulkPut=function(o,c,u){var f=this,p=Array.isArray(c)?c:void 0,g=(u=u||(p?void 0:c))?u.allKeys:void 0;return this._trans("readwrite",function(y){var b=f.schema.primKey,M=b.auto,b=b.keyPath;if(b&&p)throw new fe.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(p&&p.length!==o.length)throw new fe.InvalidArgument("Arguments objects and keys must have the same length");var _=o.length,M=b&&M?o.map(Dr(b)):o;return f.core.mutate({trans:y,type:"put",keys:p,values:M,wantResults:g}).then(function(C){var x=C.numFailures,I=C.failures;if(x===0)return g?C.results:C.lastResult;throw new Vt("".concat(f.name,".bulkPut(): ").concat(x," of ").concat(_," operations failed"),I)})})},Be.prototype.bulkUpdate=function(o){var c=this,u=this.core,f=o.map(function(y){return y.key}),p=o.map(function(y){return y.changes}),g=[];return this._trans("readwrite",function(y){return u.getMany({trans:y,keys:f,cache:"clone"}).then(function(b){var _=[],M=[],C=(o.forEach(function(x,I){var O=x.key,E=x.changes,k=b[I];if(k){for(var R=0,$=Object.keys(E);R<$.length;R++){var N=$[R],U=E[N];if(N===c.schema.primKey.keyPath){if(Ce(U,O)!==0)throw new fe.Constraint("Cannot update primary key in bulkUpdate()")}else pe(k,N,U)}g.push(I),_.push(O),M.push(k)}}),_.length);return u.mutate({trans:y,type:"put",keys:_,values:M,updates:{keys:f,changeSpecs:p}}).then(function(x){var I=x.numFailures,O=x.failures;if(I===0)return C;for(var E=0,k=Object.keys(O);E<k.length;E++){var R,$=k[E],N=g[Number($)];N!=null&&(R=O[$],delete O[$],O[N]=R)}throw new Vt("".concat(c.name,".bulkUpdate(): ").concat(I," of ").concat(C," operations failed"),O)})})})},Be.prototype.bulkDelete=function(o){var c=this,u=o.length;return this._trans("readwrite",function(f){return c.core.mutate({trans:f,type:"delete",keys:o}).then(function(p){return Kr(c,o,p)})}).then(function(f){var p=f.numFailures,g=f.failures;if(p===0)return f.lastResult;throw new Vt("".concat(c.name,".bulkDelete(): ").concat(p," of ").concat(u," operations failed"),g)})};var Lc=Be;function Be(){}function Di(o){function c(y,b){if(b){for(var _=arguments.length,M=new Array(_-1);--_;)M[_-1]=arguments[_];return u[y].subscribe.apply(null,M),o}if(typeof y=="string")return u[y]}var u={};c.addEventType=g;for(var f=1,p=arguments.length;f<p;++f)g(arguments[f]);return c;function g(y,b,_){var M,C;if(typeof y!="object")return b=b||ui,C={subscribers:[],fire:_=_||Ie,subscribe:function(x){C.subscribers.indexOf(x)===-1&&(C.subscribers.push(x),C.fire=b(C.fire,x))},unsubscribe:function(x){C.subscribers=C.subscribers.filter(function(I){return I!==x}),C.fire=C.subscribers.reduce(b,_)}},u[y]=c[y]=C;a(M=y).forEach(function(x){var I=M[x];if(l(I))g(x,M[x][0],M[x][1]);else{if(I!=="asap")throw new fe.InvalidArgument("Invalid event config");var O=g(x,Et,function(){for(var E=arguments.length,k=new Array(E);E--;)k[E]=arguments[E];O.subscribers.forEach(function(R){ne(function(){R.apply(null,k)})})})}})}}function Ki(o,c){return A(c).from({prototype:o}),c}function pi(o,c){return!(o.filter||o.algorithm||o.or)&&(c?o.justLimit:!o.replayFilter)}function so(o,c){o.filter=qn(o.filter,c)}function oo(o,c,u){var f=o.replayFilter;o.replayFilter=f?function(){return qn(f(),c())}:c,o.justLimit=u&&!f}function qr(o,c){if(o.isPrimKey)return c.primaryKey;var u=c.getIndexByKeyPath(o.index);if(u)return u;throw new fe.Schema("KeyPath "+o.index+" on object store "+c.name+" is not indexed")}function Bc(o,c,u){var f=qr(o,c.schema);return c.openCursor({trans:u,values:!o.keysOnly,reverse:o.dir==="prev",unique:!!o.unique,query:{index:f,range:o.range}})}function Ur(o,c,u,f){var p,g,y=o.replayFilter?qn(o.filter,o.replayFilter()):o.filter;return o.or?(p={},g=function(b,_,M){var C,x;y&&!y(_,M,function(I){return _.stop(I)},function(I){return _.fail(I)})||((x=""+(C=_.primaryKey))=="[object ArrayBuffer]"&&(x=""+new Uint8Array(C)),v(p,x))||(p[x]=!0,c(b,_,M))},Promise.all([o.or._iterate(g,u),Fc(Bc(o,f,u),o.algorithm,g,!o.keysOnly&&o.valueMapper)])):Fc(Bc(o,f,u),qn(o.algorithm,y),c,!o.keysOnly&&o.valueMapper)}function Fc(o,c,u,f){var p=qe(f?function(g,y,b){return u(f(g),y,b)}:u);return o.then(function(g){if(g)return g.start(function(){var y=function(){return g.continue()};c&&!c(g,function(b){return y=b},function(b){g.stop(b),y=Ie},function(b){g.fail(b),y=Ie})||p(g.value,g,function(b){return y=b}),y()})})}Pe.prototype._read=function(o,c){var u=this._ctx;return u.error?u.table._trans(null,Ge.bind(null,u.error)):u.table._trans("readonly",o).then(c)},Pe.prototype._write=function(o){var c=this._ctx;return c.error?c.table._trans(null,Ge.bind(null,c.error)):c.table._trans("readwrite",o,"locked")},Pe.prototype._addAlgorithm=function(o){var c=this._ctx;c.algorithm=qn(c.algorithm,o)},Pe.prototype._iterate=function(o,c){return Ur(this._ctx,o,c,this._ctx.table.core)},Pe.prototype.clone=function(o){var c=Object.create(this.constructor.prototype),u=Object.create(this._ctx);return o&&d(u,o),c._ctx=u,c},Pe.prototype.raw=function(){return this._ctx.valueMapper=null,this},Pe.prototype.each=function(o){var c=this._ctx;return this._read(function(u){return Ur(c,o,u,c.table.core)})},Pe.prototype.count=function(o){var c=this;return this._read(function(u){var f,p=c._ctx,g=p.table.core;return pi(p,!0)?g.count({trans:u,query:{index:qr(p,g.schema),range:p.range}}).then(function(y){return Math.min(y,p.limit)}):(f=0,Ur(p,function(){return++f,!1},u,g).then(function(){return f}))}).then(o)},Pe.prototype.sortBy=function(o,c){var u=o.split(".").reverse(),f=u[0],p=u.length-1;function g(_,M){return M?g(_[u[M]],M-1):_[f]}var y=this._ctx.dir==="next"?1:-1;function b(_,M){return Ce(g(_,p),g(M,p))*y}return this.toArray(function(_){return _.sort(b)}).then(c)},Pe.prototype.toArray=function(o){var c=this;return this._read(function(u){var f,p,g,y=c._ctx;return y.dir==="next"&&pi(y,!0)&&0<y.limit?(f=y.valueMapper,p=qr(y,y.table.core.schema),y.table.core.query({trans:u,limit:y.limit,values:!0,query:{index:p,range:y.range}}).then(function(b){return b=b.result,f?b.map(f):b})):(g=[],Ur(y,function(b){return g.push(b)},u,y.table.core).then(function(){return g}))},o)},Pe.prototype.offset=function(o){var c=this._ctx;return o<=0||(c.offset+=o,pi(c)?oo(c,function(){var u=o;return function(f,p){return u===0||(u===1?--u:p(function(){f.advance(u),u=0}),!1)}}):oo(c,function(){var u=o;return function(){return--u<0}})),this},Pe.prototype.limit=function(o){return this._ctx.limit=Math.min(this._ctx.limit,o),oo(this._ctx,function(){var c=o;return function(u,f,p){return--c<=0&&f(p),0<=c}},!0),this},Pe.prototype.until=function(o,c){return so(this._ctx,function(u,f,p){return!o(u.value)||(f(p),c)}),this},Pe.prototype.first=function(o){return this.limit(1).toArray(function(c){return c[0]}).then(o)},Pe.prototype.last=function(o){return this.reverse().first(o)},Pe.prototype.filter=function(o){var c;return so(this._ctx,function(u){return o(u.value)}),(c=this._ctx).isMatch=qn(c.isMatch,o),this},Pe.prototype.and=function(o){return this.filter(o)},Pe.prototype.or=function(o){return new this.db.WhereClause(this._ctx.table,o,this)},Pe.prototype.reverse=function(){return this._ctx.dir=this._ctx.dir==="prev"?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},Pe.prototype.desc=function(){return this.reverse()},Pe.prototype.eachKey=function(o){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(u,f){o(f.key,f)})},Pe.prototype.eachUniqueKey=function(o){return this._ctx.unique="unique",this.eachKey(o)},Pe.prototype.eachPrimaryKey=function(o){var c=this._ctx;return c.keysOnly=!c.isMatch,this.each(function(u,f){o(f.primaryKey,f)})},Pe.prototype.keys=function(o){var c=this._ctx,u=(c.keysOnly=!c.isMatch,[]);return this.each(function(f,p){u.push(p.key)}).then(function(){return u}).then(o)},Pe.prototype.primaryKeys=function(o){var c=this._ctx;if(c.dir==="next"&&pi(c,!0)&&0<c.limit)return this._read(function(f){var p=qr(c,c.table.core.schema);return c.table.core.query({trans:f,values:!1,limit:c.limit,query:{index:p,range:c.range}})}).then(function(f){return f.result}).then(o);c.keysOnly=!c.isMatch;var u=[];return this.each(function(f,p){u.push(p.primaryKey)}).then(function(){return u}).then(o)},Pe.prototype.uniqueKeys=function(o){return this._ctx.unique="unique",this.keys(o)},Pe.prototype.firstKey=function(o){return this.limit(1).keys(function(c){return c[0]}).then(o)},Pe.prototype.lastKey=function(o){return this.reverse().firstKey(o)},Pe.prototype.distinct=function(){var o,c=this._ctx,c=c.index&&c.table.schema.idxByName[c.index];return c&&c.multi&&(o={},so(this._ctx,function(f){var f=f.primaryKey.toString(),p=v(o,f);return o[f]=!0,!p})),this},Pe.prototype.modify=function(o){var c=this,u=this._ctx;return this._write(function(f){function p(k,R){var $=R.failures;I+=k-R.numFailures;for(var N=0,U=a($);N<U.length;N++){var G=U[N];x.push($[G])}}var g=typeof o=="function"?o:function(k){return $c(k,o)},y=u.table.core,C=y.schema.primaryKey,b=C.outbound,_=C.extractKey,M=200,C=c.db._options.modifyChunkSize,x=(C&&(M=typeof C=="object"?C[y.name]||C["*"]||200:C),[]),I=0,O=[],E=o===Dc;return c.clone().primaryKeys().then(function(k){function R(N){var U=Math.min(M,k.length-N),G=k.slice(N,N+U);return(E?Promise.resolve([]):y.getMany({trans:f,keys:G,cache:"immutable"})).then(function(ee){var te=[],Y=[],oe=b?[]:null,re=E?G:[];if(!E)for(var Z=0;Z<U;++Z){var ce=ee[Z],Oe={value:rt(ce),primKey:k[N+Z]};g.call(Oe,Oe.value,Oe)!==!1&&(Oe.value==null?re.push(k[N+Z]):b||Ce(_(ce),_(Oe.value))===0?(Y.push(Oe.value),b&&oe.push(k[N+Z])):(re.push(k[N+Z]),te.push(Oe.value)))}return Promise.resolve(0<te.length&&y.mutate({trans:f,type:"add",values:te}).then(function(Te){for(var me in Te.failures)re.splice(parseInt(me),1);p(te.length,Te)})).then(function(){return(0<Y.length||$&&typeof o=="object")&&y.mutate({trans:f,type:"put",keys:oe,values:Y,criteria:$,changeSpec:typeof o!="function"&&o,isAdditionalChunk:0<N}).then(function(Te){return p(Y.length,Te)})}).then(function(){return(0<re.length||$&&E)&&y.mutate({trans:f,type:"delete",keys:re,criteria:$,isAdditionalChunk:0<N}).then(function(Te){return Kr(u.table,re,Te)}).then(function(Te){return p(re.length,Te)})}).then(function(){return k.length>N+U&&R(N+M)})})}var $=pi(u)&&u.limit===1/0&&(typeof o!="function"||E)&&{index:u.index,range:u.range};return R(0).then(function(){if(0<x.length)throw new Ee("Error modifying one or more objects",x,I,O);return k.length})})})},Pe.prototype.delete=function(){var o=this._ctx,c=o.range;return!pi(o)||o.table.schema.yProps||!o.isPrimKey&&c.type!==3?this.modify(Dc):this._write(function(u){var f=o.table.core.schema.primaryKey,p=c;return o.table.core.count({trans:u,query:{index:f,range:p}}).then(function(g){return o.table.core.mutate({trans:u,type:"deleteRange",range:p}).then(function(_){var b=_.failures,_=_.numFailures;if(_)throw new Ee("Could not delete some values",Object.keys(b).map(function(M){return b[M]}),g-_);return g-_})})})};var dd=Pe;function Pe(){}var Dc=function(o,c){return c.value=null};function pd(o,c){return o<c?-1:o===c?0:1}function hd(o,c){return c<o?-1:o===c?0:1}function Ot(o,c,u){return o=o instanceof qc?new o.Collection(o):o,o._ctx.error=new(u||TypeError)(c),o}function hi(o){return new o.Collection(o,function(){return Kc("")}).limit(0)}function zr(O,c,u,f){var p,g,y,b,_,M,C,x=u.length;if(!u.every(function(k){return typeof k=="string"}))return Ot(O,Pc);function I(k){p=k==="next"?function($){return $.toUpperCase()}:function($){return $.toLowerCase()},g=k==="next"?function($){return $.toLowerCase()}:function($){return $.toUpperCase()},y=k==="next"?pd:hd;var R=u.map(function($){return{lower:g($),upper:p($)}}).sort(function($,N){return y($.lower,N.lower)});b=R.map(function($){return $.upper}),_=R.map(function($){return $.lower}),C=(M=k)==="next"?"":f}I("next");var O=new O.Collection(O,function(){return xn(b[0],_[x-1]+f)}),E=(O._ondirectionchange=function(k){I(k)},0);return O._addAlgorithm(function(k,R,$){var N=k.key;if(typeof N=="string"){var U=g(N);if(c(U,_,E))return!0;for(var G=null,ee=E;ee<x;++ee){var te=((Y,oe,re,Z,ce,Oe)=>{for(var Te=Math.min(Y.length,Z.length),me=-1,ke=0;ke<Te;++ke){var Ve=oe[ke];if(Ve!==Z[ke])return ce(Y[ke],re[ke])<0?Y.substr(0,ke)+re[ke]+re.substr(ke+1):ce(Y[ke],Z[ke])<0?Y.substr(0,ke)+Z[ke]+re.substr(ke+1):0<=me?Y.substr(0,me)+oe[me]+re.substr(me+1):null;ce(Y[ke],Ve)<0&&(me=ke)}return Te<Z.length&&Oe==="next"?Y+re.substr(Y.length):Te<Y.length&&Oe==="prev"?Y.substr(0,re.length):me<0?null:Y.substr(0,me)+Z[me]+re.substr(me+1)})(N,U,b[ee],_[ee],y,M);te===null&&G===null?E=ee+1:(G===null||0<y(G,te))&&(G=te)}R(G!==null?function(){k.continue(G+C)}:$)}return!1}),O}function xn(o,c,u,f){return{type:2,lower:o,upper:c,lowerOpen:u,upperOpen:f}}function Kc(o){return{type:1,lower:o,upper:o}}Object.defineProperty(at.prototype,"Collection",{get:function(){return this._ctx.table.db.Collection},enumerable:!1,configurable:!0}),at.prototype.between=function(o,c,u,f){u=u!==!1,f=f===!0;try{return 0<this._cmp(o,c)||this._cmp(o,c)===0&&(u||f)&&(!u||!f)?hi(this):new this.Collection(this,function(){return xn(o,c,!u,!f)})}catch{return Ot(this,on)}},at.prototype.equals=function(o){return o==null?Ot(this,on):new this.Collection(this,function(){return Kc(o)})},at.prototype.above=function(o){return o==null?Ot(this,on):new this.Collection(this,function(){return xn(o,void 0,!0)})},at.prototype.aboveOrEqual=function(o){return o==null?Ot(this,on):new this.Collection(this,function(){return xn(o,void 0,!1)})},at.prototype.below=function(o){return o==null?Ot(this,on):new this.Collection(this,function(){return xn(void 0,o,!1,!0)})},at.prototype.belowOrEqual=function(o){return o==null?Ot(this,on):new this.Collection(this,function(){return xn(void 0,o)})},at.prototype.startsWith=function(o){return typeof o!="string"?Ot(this,Pc):this.between(o,o+Kn,!0,!0)},at.prototype.startsWithIgnoreCase=function(o){return o===""?this.startsWith(o):zr(this,function(c,u){return c.indexOf(u[0])===0},[o],Kn)},at.prototype.equalsIgnoreCase=function(o){return zr(this,function(c,u){return c===u[0]},[o],"")},at.prototype.anyOfIgnoreCase=function(){var o=St.apply(ft,arguments);return o.length===0?hi(this):zr(this,function(c,u){return u.indexOf(c)!==-1},o,"")},at.prototype.startsWithAnyOfIgnoreCase=function(){var o=St.apply(ft,arguments);return o.length===0?hi(this):zr(this,function(c,u){return u.some(function(f){return c.indexOf(f)===0})},o,Kn)},at.prototype.anyOf=function(){var o,c,u=this,f=St.apply(ft,arguments),p=this._cmp;try{f.sort(p)}catch{return Ot(this,on)}return f.length===0?hi(this):((o=new this.Collection(this,function(){return xn(f[0],f[f.length-1])}))._ondirectionchange=function(g){p=g==="next"?u._ascending:u._descending,f.sort(p)},c=0,o._addAlgorithm(function(g,y,b){for(var _=g.key;0<p(_,f[c]);)if(++c===f.length)return y(b),!1;return p(_,f[c])===0||(y(function(){g.continue(f[c])}),!1)}),o)},at.prototype.notEqual=function(o){return this.inAnyRange([[-1/0,o],[o,this.db._maxKey]],{includeLowers:!1,includeUppers:!1})},at.prototype.noneOf=function(){var o=St.apply(ft,arguments);if(o.length===0)return new this.Collection(this);try{o.sort(this._ascending)}catch{return Ot(this,on)}var c=o.reduce(function(u,f){return u?u.concat([[u[u.length-1][1],f]]):[[-1/0,f]]},null);return c.push([o[o.length-1],this.db._maxKey]),this.inAnyRange(c,{includeLowers:!1,includeUppers:!1})},at.prototype.inAnyRange=function(o,$){var u=this,f=this._cmp,p=this._ascending,g=this._descending,y=this._min,b=this._max;if(o.length===0)return hi(this);if(!o.every(function(N){return N[0]!==void 0&&N[1]!==void 0&&p(N[0],N[1])<=0}))return Ot(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",fe.InvalidArgument);var _=!$||$.includeLowers!==!1,M=$&&$.includeUppers===!0,C,x=p;function I(N,U){return x(N[0],U[0])}try{(C=o.reduce(function(N,U){for(var G=0,ee=N.length;G<ee;++G){var te=N[G];if(f(U[0],te[1])<0&&0<f(U[1],te[0])){te[0]=y(te[0],U[0]),te[1]=b(te[1],U[1]);break}}return G===ee&&N.push(U),N},[])).sort(I)}catch{return Ot(this,on)}var O=0,E=M?function(N){return 0<p(N,C[O][1])}:function(N){return 0<=p(N,C[O][1])},k=_?function(N){return 0<g(N,C[O][0])}:function(N){return 0<=g(N,C[O][0])},R=E,$=new this.Collection(this,function(){return xn(C[0][0],C[C.length-1][1],!_,!M)});return $._ondirectionchange=function(N){x=N==="next"?(R=E,p):(R=k,g),C.sort(I)},$._addAlgorithm(function(N,U,G){for(var ee,te=N.key;R(te);)if(++O===C.length)return U(G),!1;return!E(ee=te)&&!k(ee)||(u._cmp(te,C[O][1])===0||u._cmp(te,C[O][0])===0||U(function(){x===p?N.continue(C[O][0]):N.continue(C[O][1])}),!1)}),$},at.prototype.startsWithAnyOf=function(){var o=St.apply(ft,arguments);return o.every(function(c){return typeof c=="string"})?o.length===0?hi(this):this.inAnyRange(o.map(function(c){return[c,c+Kn]})):Ot(this,"startsWithAnyOf() only works with strings")};var qc=at;function at(){}function Xt(o){return qe(function(c){return qi(c),o(c.target.error),!1})}function qi(o){o.stopPropagation&&o.stopPropagation(),o.preventDefault&&o.preventDefault()}var Ui="storagemutated",ao="x-storagemutated-1",Sn=Di(null,Ui),gd=(Zt.prototype._lock=function(){return J(!F.global),++this._reculock,this._reculock!==1||F.global||(F.lockOwnerFor=this),this},Zt.prototype._unlock=function(){if(J(!F.global),--this._reculock==0)for(F.global||(F.lockOwnerFor=null);0<this._blockedFuncs.length&&!this._locked();){var o=this._blockedFuncs.shift();try{Dn(o[1],o[0])}catch{}}return this},Zt.prototype._locked=function(){return this._reculock&&F.lockOwnerFor!==this},Zt.prototype.create=function(o){var c=this;if(this.mode){var u=this.db.idbdb,f=this.db._state.dbOpenError;if(J(!this.idbtrans),!o&&!u)switch(f&&f.name){case"DatabaseClosedError":throw new fe.DatabaseClosed(f);case"MissingAPIError":throw new fe.MissingAPI(f.message,f);default:throw new fe.OpenFailed(f)}if(!this.active)throw new fe.TransactionInactive;J(this._completion._state===null),(o=this.idbtrans=o||(this.db.core||u).transaction(this.storeNames,this.mode,{durability:this.chromeTransactionDurability})).onerror=qe(function(p){qi(p),c._reject(o.error)}),o.onabort=qe(function(p){qi(p),c.active&&c._reject(new fe.Abort(o.error)),c.active=!1,c.on("abort").fire(p)}),o.oncomplete=qe(function(){c.active=!1,c._resolve(),"mutatedParts"in o&&Sn.storagemutated.fire(o.mutatedParts)})}return this},Zt.prototype._promise=function(o,c,u){var f,p=this;return o==="readwrite"&&this.mode!=="readwrite"?Ge(new fe.ReadOnly("Transaction is readonly")):this.active?this._locked()?new L(function(g,y){p._blockedFuncs.push([function(){p._promise(o,c,u).then(g,y)},F])}):u?yn(function(){var g=new L(function(y,b){p._lock();var _=c(y,b,p);_&&_.then&&_.then(y,b)});return g.finally(function(){return p._unlock()}),g._lib=!0,g}):((f=new L(function(g,y){var b=c(g,y,p);b&&b.then&&b.then(g,y)}))._lib=!0,f):Ge(new fe.TransactionInactive)},Zt.prototype._root=function(){return this.parent?this.parent._root():this},Zt.prototype.waitFor=function(o){var c,u=this._root(),f=L.resolve(o),p=(u._waitingFor?u._waitingFor=u._waitingFor.then(function(){return f}):(u._waitingFor=f,u._waitingQueue=[],c=u.idbtrans.objectStore(u.storeNames[0]),(function g(){for(++u._spinCount;u._waitingQueue.length;)u._waitingQueue.shift()();u._waitingFor&&(c.get(-1/0).onsuccess=g)})()),u._waitingFor);return new L(function(g,y){f.then(function(b){return u._waitingQueue.push(qe(g.bind(null,b)))},function(b){return u._waitingQueue.push(qe(y.bind(null,b)))}).finally(function(){u._waitingFor===p&&(u._waitingFor=null)})})},Zt.prototype.abort=function(){this.active&&(this.active=!1,this.idbtrans&&this.idbtrans.abort(),this._reject(new fe.Abort))},Zt.prototype.table=function(o){var c=this._memoizedTables||(this._memoizedTables={});if(v(c,o))return c[o];var u=this.schema[o];if(u)return(u=new this.db.Table(o,u,this)).core=this.db.core.table(o),c[o]=u;throw new fe.NotFound("Table "+o+" not part of transaction")},Zt);function Zt(){}function co(o,c,u,f,p,g,y,b){return{name:o,keyPath:c,unique:u,multi:f,auto:p,compound:g,src:(u&&!y?"&":"")+(f?"*":"")+(p?"++":"")+Uc(c),type:b}}function Uc(o){return typeof o=="string"?o:o?"["+[].join.call(o,"+")+"]":""}function lo(o,c,u){return{name:o,primKey:c,indexes:u,mappedClass:null,idxByName:(f=function(p){return[p.name,p]},u.reduce(function(p,g,y){return g=f(g,y),g&&(p[g[0]]=g[1]),p},{}))};var f}var zi=function(o){try{return o.only([[]]),zi=function(){return[[]]},[[]]}catch{return zi=function(){return Kn},Kn}};function uo(o){return o==null?function(){}:typeof o=="string"?(c=o).split(".").length===1?function(u){return u[c]}:function(u){return ue(u,c)}:function(u){return ue(u,o)};var c}function zc(o){return[].slice.call(o)}var md=0;function Vi(o){return o==null?":id":typeof o=="string"?o:"[".concat(o.join("+"),"]")}function vd(o,c,_){function f(E){if(E.type===3)return null;if(E.type===4)throw new Error("Cannot convert never type to IDBKeyRange");var x=E.lower,I=E.upper,O=E.lowerOpen,E=E.upperOpen;return x===void 0?I===void 0?null:c.upperBound(I,!!E):I===void 0?c.lowerBound(x,!!O):c.bound(x,I,!!O,!!E)}function p(C){var x,I=C.name;return{name:I,schema:C,mutate:function(O){var E=O.trans,k=O.type,R=O.keys,$=O.values,N=O.range;return new Promise(function(U,G){U=qe(U);var ee=E.objectStore(I),te=ee.keyPath==null,Y=k==="put"||k==="add";if(!Y&&k!=="delete"&&k!=="deleteRange")throw new Error("Invalid operation type: "+k);var oe,re=(R||$||{length:1}).length;if(R&&$&&R.length!==$.length)throw new Error("Given keys array must have same length as given values array.");if(re===0)return U({numFailures:0,failures:{},results:[],lastResult:void 0});function Z(He){++Te,qi(He)}var ce=[],Oe=[],Te=0;if(k==="deleteRange"){if(N.type===4)return U({numFailures:Te,failures:Oe,results:[],lastResult:void 0});N.type===3?ce.push(oe=ee.clear()):ce.push(oe=ee.delete(f(N)))}else{var te=Y?te?[$,R]:[$,null]:[R,null],me=te[0],ke=te[1];if(Y)for(var Ve=0;Ve<re;++Ve)ce.push(oe=ke&&ke[Ve]!==void 0?ee[k](me[Ve],ke[Ve]):ee[k](me[Ve])),oe.onerror=Z;else for(Ve=0;Ve<re;++Ve)ce.push(oe=ee[k](me[Ve])),oe.onerror=Z}function jt(He){He=He.target.result,ce.forEach(function(Vn,Ao){return Vn.error!=null&&(Oe[Ao]=Vn.error)}),U({numFailures:Te,failures:Oe,results:k==="delete"?R:ce.map(function(Vn){return Vn.result}),lastResult:He})}oe.onerror=function(He){Z(He),jt(He)},oe.onsuccess=jt})},getMany:function(O){var E=O.trans,k=O.keys;return new Promise(function(R,$){R=qe(R);for(var N,U=E.objectStore(I),G=k.length,ee=new Array(G),te=0,Y=0,oe=function(ce){ce=ce.target,ee[ce._pos]=ce.result,++Y===te&&R(ee)},re=Xt($),Z=0;Z<G;++Z)k[Z]!=null&&((N=U.get(k[Z]))._pos=Z,N.onsuccess=oe,N.onerror=re,++te);te===0&&R(ee)})},get:function(O){var E=O.trans,k=O.key;return new Promise(function(R,$){R=qe(R);var N=E.objectStore(I).get(k);N.onsuccess=function(U){return R(U.target.result)},N.onerror=Xt($)})},query:(x=b,function(O){return new Promise(function(E,k){E=qe(E);var R,$,N,Y=O.trans,U=O.values,G=O.limit,te=O.query,ee=G===1/0?void 0:G,oe=te.index,te=te.range,Y=Y.objectStore(I),Y=oe.isPrimaryKey?Y:Y.index(oe.name),oe=f(te);if(G===0)return E({result:[]});x?((te=U?Y.getAll(oe,ee):Y.getAllKeys(oe,ee)).onsuccess=function(re){return E({result:re.target.result})},te.onerror=Xt(k)):(R=0,$=!U&&"openKeyCursor"in Y?Y.openKeyCursor(oe):Y.openCursor(oe),N=[],$.onsuccess=function(re){var Z=$.result;return!Z||(N.push(U?Z.value:Z.primaryKey),++R===G)?E({result:N}):void Z.continue()},$.onerror=Xt(k))})}),openCursor:function(O){var E=O.trans,k=O.values,R=O.query,$=O.reverse,N=O.unique;return new Promise(function(U,G){U=qe(U);var Y=R.index,ee=R.range,te=E.objectStore(I),te=Y.isPrimaryKey?te:te.index(Y.name),Y=$?N?"prevunique":"prev":N?"nextunique":"next",oe=!k&&"openKeyCursor"in te?te.openKeyCursor(f(ee),Y):te.openCursor(f(ee),Y);oe.onerror=Xt(G),oe.onsuccess=qe(function(re){var Z,ce,Oe,Te,me=oe.result;me?(me.___id=++md,me.done=!1,Z=me.continue.bind(me),ce=(ce=me.continuePrimaryKey)&&ce.bind(me),Oe=me.advance.bind(me),Te=function(){throw new Error("Cursor not stopped")},me.trans=E,me.stop=me.continue=me.continuePrimaryKey=me.advance=function(){throw new Error("Cursor not started")},me.fail=qe(G),me.next=function(){var ke=this,Ve=1;return this.start(function(){return Ve--?ke.continue():ke.stop()}).then(function(){return ke})},me.start=function(ke){function Ve(){if(oe.result)try{ke()}catch(He){me.fail(He)}else me.done=!0,me.start=function(){throw new Error("Cursor behind last entry")},me.stop()}var jt=new Promise(function(He,Vn){He=qe(He),oe.onerror=Xt(Vn),me.fail=Vn,me.stop=function(Ao){me.stop=me.continue=me.continuePrimaryKey=me.advance=Te,He(Ao)}});return oe.onsuccess=qe(function(He){oe.onsuccess=Ve,Ve()}),me.continue=Z,me.continuePrimaryKey=ce,me.advance=Oe,Ve(),jt},U(me)):U(null)},G)})},count:function(O){var E=O.query,k=O.trans,R=E.index,$=E.range;return new Promise(function(N,U){var G=k.objectStore(I),G=R.isPrimaryKey?G:G.index(R.name),ee=f($),ee=ee?G.count(ee):G.count();ee.onsuccess=qe(function(te){return N(te.target.result)}),ee.onerror=Xt(U)})}}}g=_,y=zc((_=o).objectStoreNames);var g,_={schema:{name:_.name,tables:y.map(function(C){return g.objectStore(C)}).map(function(C){var x=C.keyPath,I=C.autoIncrement,E=l(x),O={},E={name:C.name,primaryKey:{name:null,isPrimaryKey:!0,outbound:x==null,compound:E,keyPath:x,autoIncrement:I,unique:!0,extractKey:uo(x)},indexes:zc(C.indexNames).map(function(k){return C.index(k)}).map(function(N){var U=N.name,R=N.unique,$=N.multiEntry,N=N.keyPath,U={name:U,compound:l(N),keyPath:N,unique:R,multiEntry:$,extractKey:uo(N)};return O[Vi(N)]=U}),getIndexByKeyPath:function(k){return O[Vi(k)]}};return O[":id"]=E.primaryKey,x!=null&&(O[Vi(x)]=E.primaryKey),E})},hasGetAll:0<y.length&&"getAll"in g.objectStore(y[0])&&!(typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604)},y=_.schema,b=_.hasGetAll,_=y.tables.map(p),M={};return _.forEach(function(C){return M[C.name]=C}),{stack:"dbcore",transaction:o.transaction.bind(o),table:function(C){if(M[C])return M[C];throw new Error("Table '".concat(C,"' not found"))},MIN_KEY:-1/0,MAX_KEY:zi(c),schema:y}}function yd(o,c,u,f){return u=u.IDBKeyRange,c=vd(c,u,f),{dbcore:o.dbcore.reduce(function(p,g){return g=g.create,i(i({},p),g(p))},c)}}function Vr(o,c){var u=c.db,u=yd(o._middlewares,u,o._deps,c);o.core=u.dbcore,o.tables.forEach(function(f){var p=f.name;o.core.schema.tables.some(function(g){return g.name===p})&&(f.core=o.core.table(p),o[p]instanceof o.Table)&&(o[p].core=f.core)})}function Wr(o,c,u,f){u.forEach(function(p){var g=f[p];c.forEach(function(y){var b=(function _(M,C){return D(M,C)||(M=h(M))&&_(M,C)})(y,p);(!b||"value"in b&&b.value===void 0)&&(y===o.Transaction.prototype||y instanceof o.Transaction?K(y,p,{get:function(){return this.table(p)},set:function(_){P(this,p,{value:_,writable:!0,configurable:!0,enumerable:!0})}}):y[p]=new o.Table(p,g))})})}function fo(o,c){c.forEach(function(u){for(var f in u)u[f]instanceof o.Table&&delete u[f]})}function bd(o,c){return o._cfg.version-c._cfg.version}function wd(o,c,u,f){var p=o._dbSchema,g=(u.objectStoreNames.contains("$meta")&&!p.$meta&&(p.$meta=lo("$meta",Wc("")[0],[]),o._storeNames.push("$meta")),o._createTransaction("readwrite",o._storeNames,p)),y=(g.create(u),g._completion.catch(f),g._reject.bind(g)),b=F.transless||F;yn(function(){if(F.trans=g,F.transless=b,c!==0)return Vr(o,u),M=c,((_=g).storeNames.includes("$meta")?_.table("$meta").get("version").then(function(C){return C??M}):L.resolve(M)).then(function(R){var x=o,I=R,O=g,E=u,k=[],R=x._versions,$=x._dbSchema=Gr(0,x.idbdb,E);return(R=R.filter(function(N){return N._cfg.version>=I})).length===0?L.resolve():(R.forEach(function(N){k.push(function(){var U,G,ee,te=$,Y=N._cfg.dbschema,oe=(Yr(x,te,E),Yr(x,Y,E),$=x._dbSchema=Y,po(te,Y)),re=(oe.add.forEach(function(Z){ho(E,Z[0],Z[1].primKey,Z[1].indexes)}),oe.change.forEach(function(Z){if(Z.recreate)throw new fe.Upgrade("Not yet support for changing primary key");var ce=E.objectStore(Z.name);Z.add.forEach(function(Oe){return Hr(ce,Oe)}),Z.change.forEach(function(Oe){ce.deleteIndex(Oe.name),Hr(ce,Oe)}),Z.del.forEach(function(Oe){return ce.deleteIndex(Oe)})}),N._cfg.contentUpgrade);if(re&&N._cfg.version>I)return Vr(x,E),O._memoizedTables={},U=Q(Y),oe.del.forEach(function(Z){U[Z]=te[Z]}),fo(x,[x.Transaction.prototype]),Wr(x,[x.Transaction.prototype],a(U),U),O.schema=U,(G=Ke(re))&&fi(),Y=L.follow(function(){var Z;(ee=re(O))&&G&&(Z=bn.bind(null,null),ee.then(Z,Z))}),ee&&typeof ee.then=="function"?L.resolve(ee):Y.then(function(){return ee})}),k.push(function(U){var G,ee,te=N._cfg.dbschema;G=te,ee=U,[].slice.call(ee.db.objectStoreNames).forEach(function(Y){return G[Y]==null&&ee.db.deleteObjectStore(Y)}),fo(x,[x.Transaction.prototype]),Wr(x,[x.Transaction.prototype],x._storeNames,x._dbSchema),O.schema=x._dbSchema}),k.push(function(U){x.idbdb.objectStoreNames.contains("$meta")&&(Math.ceil(x.idbdb.version/10)===N._cfg.version?(x.idbdb.deleteObjectStore("$meta"),delete x._dbSchema.$meta,x._storeNames=x._storeNames.filter(function(G){return G!=="$meta"})):U.objectStore("$meta").put(N._cfg.version,"version"))})}),(function N(){return k.length?L.resolve(k.shift()(O.idbtrans)).then(N):L.resolve()})().then(function(){Vc($,E)}))}).catch(y);var _,M;a(p).forEach(function(C){ho(u,C,p[C].primKey,p[C].indexes)}),Vr(o,u),L.follow(function(){return o.on.populate.fire(g)}).catch(y)})}function xd(o,c){Vc(o._dbSchema,c),c.db.version%10!=0||c.objectStoreNames.contains("$meta")||c.db.createObjectStore("$meta").add(Math.ceil(c.db.version/10-1),"version");var u=Gr(0,o.idbdb,c);Yr(o,o._dbSchema,c);for(var f=0,p=po(u,o._dbSchema).change;f<p.length;f++){var g=(y=>{if(y.change.length||y.recreate)return console.warn("Unable to patch indexes of table ".concat(y.name," because it has changes on the type of index or primary key.")),{value:void 0};var b=c.objectStore(y.name);y.add.forEach(function(_){mt&&console.debug("Dexie upgrade patch: Creating missing index ".concat(y.name,".").concat(_.src)),Hr(b,_)})})(p[f]);if(typeof g=="object")return g.value}}function po(o,c){var u,f={del:[],add:[],change:[]};for(u in o)c[u]||f.del.push(u);for(u in c){var p=o[u],g=c[u];if(p){var y={name:u,def:g,recreate:!1,del:[],add:[],change:[]};if(""+(p.primKey.keyPath||"")!=""+(g.primKey.keyPath||"")||p.primKey.auto!==g.primKey.auto)y.recreate=!0,f.change.push(y);else{var b=p.idxByName,_=g.idxByName,M=void 0;for(M in b)_[M]||y.del.push(M);for(M in _){var C=b[M],x=_[M];C?C.src!==x.src&&y.change.push(x):y.add.push(x)}(0<y.del.length||0<y.add.length||0<y.change.length)&&f.change.push(y)}}else f.add.push([u,g])}return f}function ho(o,c,u,f){var p=o.db.createObjectStore(c,u.keyPath?{keyPath:u.keyPath,autoIncrement:u.auto}:{autoIncrement:u.auto});f.forEach(function(g){return Hr(p,g)})}function Vc(o,c){a(o).forEach(function(u){c.db.objectStoreNames.contains(u)||(mt&&console.debug("Dexie: Creating missing table",u),ho(c,u,o[u].primKey,o[u].indexes))})}function Hr(o,c){o.createIndex(c.name,c.keyPath,{unique:c.unique,multiEntry:c.multi})}function Gr(o,c,u){var f={};return H(c.objectStoreNames,0).forEach(function(p){for(var g=u.objectStore(p),y=co(Uc(M=g.keyPath),M||"",!0,!1,!!g.autoIncrement,M&&typeof M!="string",!0),b=[],_=0;_<g.indexNames.length;++_){var C=g.index(g.indexNames[_]),M=C.keyPath,C=co(C.name,M,!!C.unique,!!C.multiEntry,!1,M&&typeof M!="string",!1);b.push(C)}f[p]=lo(p,y,b)}),f}function Yr(o,c,u){for(var f=u.db.objectStoreNames,p=0;p<f.length;++p){var g=f[p],y=u.objectStore(g);o._hasGetAll="getAll"in y;for(var b=0;b<y.indexNames.length;++b){var _,M=y.indexNames[b],C=y.index(M).keyPath,C=typeof C=="string"?C:"["+H(C).join("+")+"]";c[g]&&(_=c[g].idxByName[C])&&(_.name=M,delete c[g].idxByName[C],c[g].idxByName[M]=_)}}typeof navigator<"u"&&/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&s.WorkerGlobalScope&&s instanceof s.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(o._hasGetAll=!1)}function Wc(o){return o.split(",").map(function(c,u){var p=c.split(":"),f=(f=p[1])==null?void 0:f.trim(),p=(c=p[0].trim()).replace(/([&*]|\+\+)/g,""),g=/^\[/.test(p)?p.match(/^\[(.*)\]$/)[1].split("+"):p;return co(p,g||null,/\&/.test(c),/\*/.test(c),/\+\+/.test(c),l(g),u===0,f)})}gi.prototype._createTableSchema=lo,gi.prototype._parseIndexSyntax=Wc,gi.prototype._parseStoresSpec=function(o,c){var u=this;a(o).forEach(function(f){if(o[f]!==null){var p=u._parseIndexSyntax(o[f]),g=p.shift();if(!g)throw new fe.Schema("Invalid schema for table "+f+": "+o[f]);if(g.unique=!0,g.multi)throw new fe.Schema("Primary key cannot be multiEntry*");p.forEach(function(y){if(y.auto)throw new fe.Schema("Only primary key can be marked as autoIncrement (++)");if(!y.keyPath)throw new fe.Schema("Index must have a name and cannot be an empty string")}),g=u._createTableSchema(f,g,p),c[f]=g}})},gi.prototype.stores=function(u){var c=this.db,u=(this._cfg.storesSource=this._cfg.storesSource?d(this._cfg.storesSource,u):u,c._versions),f={},p={};return u.forEach(function(g){d(f,g._cfg.storesSource),p=g._cfg.dbschema={},g._parseStoresSpec(f,p)}),c._dbSchema=p,fo(c,[c._allTables,c,c.Transaction.prototype]),Wr(c,[c._allTables,c,c.Transaction.prototype,this._cfg.tables],a(p),p),c._storeNames=a(p),this},gi.prototype.upgrade=function(o){return this._cfg.contentUpgrade=mn(this._cfg.contentUpgrade||Ie,o),this};var Sd=gi;function gi(){}function go(o,c){var u=o._dbNamesDB;return u||(u=o._dbNamesDB=new an(Fr,{addons:[],indexedDB:o,IDBKeyRange:c})).version(1).stores({dbnames:"name"}),u.table("dbnames")}function mo(o){return o&&typeof o.databases=="function"}function vo(o){return yn(function(){return F.letThrough=!0,o()})}function yo(o){return!("from"in o)}var ht=function(o,c){var u;if(!this)return u=new ht,o&&"d"in o&&d(u,o),u;d(this,arguments.length?{d:1,from:o,to:1<arguments.length?c:o}:{d:0})};function Wi(o,c,u){var f=Ce(c,u);if(!isNaN(f)){if(0<f)throw RangeError();if(yo(o))return d(o,{from:c,to:u,d:1});var f=o.l,p=o.r;if(Ce(u,o.from)<0)return f?Wi(f,c,u):o.l={from:c,to:u,d:1,l:null,r:null},Gc(o);if(0<Ce(c,o.to))return p?Wi(p,c,u):o.r={from:c,to:u,d:1,l:null,r:null},Gc(o);Ce(c,o.from)<0&&(o.from=c,o.l=null,o.d=p?p.d+1:1),0<Ce(u,o.to)&&(o.to=u,o.r=null,o.d=o.l?o.l.d+1:1),c=!o.r,f&&!o.l&&Hi(o,f),p&&c&&Hi(o,p)}}function Hi(o,c){yo(c)||(function u(f,p){var g=p.from,y=p.l,b=p.r;Wi(f,g,p.to),y&&u(f,y),b&&u(f,b)})(o,c)}function Hc(o,c){var u=Jr(c),f=u.next();if(!f.done)for(var p=f.value,g=Jr(o),y=g.next(p.from),b=y.value;!f.done&&!y.done;){if(Ce(b.from,p.to)<=0&&0<=Ce(b.to,p.from))return!0;Ce(p.from,b.from)<0?p=(f=u.next(b.from)).value:b=(y=g.next(p.from)).value}return!1}function Jr(o){var c=yo(o)?null:{s:0,n:o};return{next:function(u){for(var f=0<arguments.length;c;)switch(c.s){case 0:if(c.s=1,f)for(;c.n.l&&Ce(u,c.n.from)<0;)c={up:c,n:c.n.l,s:1};else for(;c.n.l;)c={up:c,n:c.n.l,s:1};case 1:if(c.s=2,!f||Ce(u,c.n.to)<=0)return{value:c.n,done:!1};case 2:if(c.n.r){c.s=3,c={up:c,n:c.n.r,s:0};continue}case 3:c=c.up}return{done:!0}}}}function Gc(o){var c,u,f,p=(((p=o.r)==null?void 0:p.d)||0)-(((p=o.l)==null?void 0:p.d)||0),p=1<p?"r":p<-1?"l":"";p&&(c=p=="r"?"l":"r",u=i({},o),f=o[p],o.from=f.from,o.to=f.to,o[p]=f[p],u[p]=f[c],(o[c]=u).d=Yc(u)),o.d=Yc(o)}function Yc(u){var c=u.r,u=u.l;return(c?u?Math.max(c.d,u.d):c.d:u?u.d:0)+1}function Qr(o,c){return a(c).forEach(function(u){o[u]?Hi(o[u],c[u]):o[u]=(function f(p){var g,y,b={};for(g in p)v(p,g)&&(y=p[g],b[g]=!y||typeof y!="object"||We.has(y.constructor)?y:f(y));return b})(c[u])}),o}function bo(o,c){return o.all||c.all||Object.keys(o).some(function(u){return c[u]&&Hc(c[u],o[u])})}w(ht.prototype,((X={add:function(o){return Hi(this,o),this},addKey:function(o){return Wi(this,o,o),this},addKeys:function(o){var c=this;return o.forEach(function(u){return Wi(c,u,u)}),this},hasKey:function(o){var c=Jr(this).next(o).value;return c&&Ce(c.from,o)<=0&&0<=Ce(c.to,o)}})[ut]=function(){return Jr(this)},X));var Un={},wo={},xo=!1;function Xr(o){Qr(wo,o),xo||(xo=!0,setTimeout(function(){xo=!1,So(wo,!(wo={}))},0))}function So(o,c){c===void 0&&(c=!1);var u=new Set;if(o.all)for(var f=0,p=Object.values(Un);f<p.length;f++)Jc(b=p[f],o,u,c);else for(var g in o){var y,b,g=/^idb\:\/\/(.*)\/(.*)\//.exec(g);g&&(y=g[1],g=g[2],b=Un["idb://".concat(y,"/").concat(g)])&&Jc(b,o,u,c)}u.forEach(function(_){return _()})}function Jc(o,c,u,f){for(var p=[],g=0,y=Object.entries(o.queries.query);g<y.length;g++){for(var b=y[g],_=b[0],M=[],C=0,x=b[1];C<x.length;C++){var I=x[C];bo(c,I.obsSet)?I.subscribers.forEach(function(R){return u.add(R)}):f&&M.push(I)}f&&p.push([_,M])}if(f)for(var O=0,E=p;O<E.length;O++){var k=E[O],_=k[0],M=k[1];o.queries.query[_]=M}}function kd(o){var c=o._state,u=o._deps.indexedDB;if(c.isBeingOpened||o.idbdb)return c.dbReadyPromise.then(function(){return c.dbOpenError?Ge(c.dbOpenError):o});c.isBeingOpened=!0,c.dbOpenError=null,c.openComplete=!1;var f=c.openCanceller,p=Math.round(10*o.verno),g=!1;function y(){if(c.openCanceller!==f)throw new fe.DatabaseClosed("db.open() was cancelled")}function b(){return new L(function(I,O){if(y(),!u)throw new fe.MissingAPI;var E=o.name,k=c.autoSchema||!p?u.open(E):u.open(E,p);if(!k)throw new fe.MissingAPI;k.onerror=Xt(O),k.onblocked=qe(o._fireOnBlocked),k.onupgradeneeded=qe(function(R){var $;C=k.transaction,c.autoSchema&&!o._options.allowEmptyDB?(k.onerror=qi,C.abort(),k.result.close(),($=u.deleteDatabase(E)).onsuccess=$.onerror=qe(function(){O(new fe.NoSuchDatabase("Database ".concat(E," doesnt exist")))})):(C.onerror=Xt(O),$=R.oldVersion>Math.pow(2,62)?0:R.oldVersion,x=$<1,o.idbdb=k.result,g&&xd(o,C),wd(o,$/10,C,O))},O),k.onsuccess=qe(function(){C=null;var R,$,N,U,G,ee,te=o.idbdb=k.result,Y=H(te.objectStoreNames);if(0<Y.length)try{var oe=te.transaction((G=Y).length===1?G[0]:G,"readonly");if(c.autoSchema)ee=te,U=oe,(N=o).verno=ee.version/10,U=N._dbSchema=Gr(0,ee,U),N._storeNames=H(ee.objectStoreNames,0),Wr(N,[N._allTables],a(U),U);else if(Yr(o,o._dbSchema,oe),$=oe,(($=po(Gr(0,(R=o).idbdb,$),R._dbSchema)).add.length||$.change.some(function(re){return re.add.length||re.change.length}))&&!g)return console.warn("Dexie SchemaDiff: Schema was extended without increasing the number passed to db.version(). Dexie will add missing parts and increment native version number to workaround this."),te.close(),p=te.version+1,g=!0,I(b());Vr(o,oe)}catch{}di.push(o),te.onversionchange=qe(function(re){c.vcFired=!0,o.on("versionchange").fire(re)}),te.onclose=qe(function(){o.close({disableAutoOpen:!1})}),x&&(Y=o._deps,G=E,mo(ee=Y.indexedDB)||G===Fr||go(ee,Y.IDBKeyRange).put({name:G}).catch(Ie)),I()},O)}).catch(function(I){switch(I?.name){case"UnknownError":if(0<c.PR1398_maxLoop)return c.PR1398_maxLoop--,console.warn("Dexie: Workaround for Chrome UnknownError on open()"),b();break;case"VersionError":if(0<p)return p=0,b()}return L.reject(I)})}var _,M=c.dbReadyResolve,C=null,x=!1;return L.race([f,(typeof navigator>"u"?L.resolve():!navigator.userAgentData&&/Safari\//.test(navigator.userAgent)&&!/Chrom(e|ium)\//.test(navigator.userAgent)&&indexedDB.databases?new Promise(function(I){function O(){return indexedDB.databases().finally(I)}_=setInterval(O,100),O()}).finally(function(){return clearInterval(_)}):Promise.resolve()).then(b)]).then(function(){return y(),c.onReadyBeingFired=[],L.resolve(vo(function(){return o.on.ready.fire(o.vip)})).then(function I(){var O;if(0<c.onReadyBeingFired.length)return O=c.onReadyBeingFired.reduce(mn,Ie),c.onReadyBeingFired=[],L.resolve(vo(function(){return O(o.vip)})).then(I)})}).finally(function(){c.openCanceller===f&&(c.onReadyBeingFired=null,c.isBeingOpened=!1)}).catch(function(I){c.dbOpenError=I;try{C&&C.abort()}catch{}return f===c.openCanceller&&o._close(),Ge(I)}).finally(function(){c.openComplete=!0,M()}).then(function(){var I;return x&&(I={},o.tables.forEach(function(O){O.schema.indexes.forEach(function(E){E.name&&(I["idb://".concat(o.name,"/").concat(O.name,"/").concat(E.name)]=new ht(-1/0,[[[]]]))}),I["idb://".concat(o.name,"/").concat(O.name,"/")]=I["idb://".concat(o.name,"/").concat(O.name,"/:dels")]=new ht(-1/0,[[[]]])}),Sn(Ui).fire(I),So(I,!0)),o})}function ko(o){function c(g){return o.next(g)}var u=p(c),f=p(function(g){return o.throw(g)});function p(g){return function(b){var b=g(b),_=b.value;return b.done?_:_&&typeof _.then=="function"?_.then(u,f):l(_)?Promise.all(_).then(u,f):u(_)}}return p(c)()}function Zr(o,c,u){for(var f=l(o)?o.slice():[o],p=0;p<u;++p)f.push(c);return f}var _d={stack:"dbcore",name:"VirtualIndexMiddleware",level:1,create:function(o){return i(i({},o),{table:function(f){var u=o.table(f),f=u.schema,p={},g=[];function y(I,O,E){var N=Vi(I),k=p[N]=p[N]||[],R=I==null?0:typeof I=="string"?1:I.length,$=0<O,N=i(i({},E),{name:$?"".concat(N,"(virtual-from:").concat(E.name,")"):E.name,lowLevelIndex:E,isVirtual:$,keyTail:O,keyLength:R,extractKey:uo(I),unique:!$&&E.unique});return k.push(N),N.isPrimaryKey||g.push(N),1<R&&y(R===2?I[0]:I.slice(0,R-1),O+1,E),k.sort(function(U,G){return U.keyTail-G.keyTail}),N}var b=y(f.primaryKey.keyPath,0,f.primaryKey);p[":id"]=[b];for(var _=0,M=f.indexes;_<M.length;_++){var C=M[_];y(C.keyPath,0,C)}function x(I){var O,E=I.query.index;return E.isVirtual?i(i({},I),{query:{index:E.lowLevelIndex,range:(O=I.query.range,E=E.keyTail,{type:O.type===1?2:O.type,lower:Zr(O.lower,O.lowerOpen?o.MAX_KEY:o.MIN_KEY,E),lowerOpen:!0,upper:Zr(O.upper,O.upperOpen?o.MIN_KEY:o.MAX_KEY,E),upperOpen:!0})}}):I}return i(i({},u),{schema:i(i({},f),{primaryKey:b,indexes:g,getIndexByKeyPath:function(I){return(I=p[Vi(I)])&&I[0]}}),count:function(I){return u.count(x(I))},query:function(I){return u.query(x(I))},openCursor:function(I){var O=I.query.index,E=O.keyTail,k=O.keyLength;return O.isVirtual?u.openCursor(x(I)).then(function($){return $&&R($)}):u.openCursor(I);function R($){return Object.create($,{continue:{value:function(N){N!=null?$.continue(Zr(N,I.reverse?o.MAX_KEY:o.MIN_KEY,E)):I.unique?$.continue($.key.slice(0,k).concat(I.reverse?o.MIN_KEY:o.MAX_KEY,E)):$.continue()}},continuePrimaryKey:{value:function(N,U){$.continuePrimaryKey(Zr(N,o.MAX_KEY,E),U)}},primaryKey:{get:function(){return $.primaryKey}},key:{get:function(){var N=$.key;return k===1?N[0]:N.slice(0,k)}},value:{get:function(){return $.value}}})}}})}})}};function _o(o,c,u,f){return u=u||{},f=f||"",a(o).forEach(function(p){var g,y,b;v(c,p)?(g=o[p],y=c[p],typeof g=="object"&&typeof y=="object"&&g&&y?(b=zt(g))!==zt(y)?u[f+p]=c[p]:b==="Object"?_o(g,y,u,f+p+"."):g!==y&&(u[f+p]=c[p]):g!==y&&(u[f+p]=c[p])):u[f+p]=void 0}),a(c).forEach(function(p){v(o,p)||(u[f+p]=c[p])}),u}function Co(o,c){return c.type==="delete"?c.keys:c.keys||c.values.map(o.extractKey)}var Cd={stack:"dbcore",name:"HooksMiddleware",level:2,create:function(o){return i(i({},o),{table:function(c){var u=o.table(c),f=u.schema.primaryKey;return i(i({},u),{mutate:function(p){var g=F.trans,y=g.table(c).hook,b=y.deleting,_=y.creating,M=y.updating;switch(p.type){case"add":if(_.fire===Ie)break;return g._promise("readwrite",function(){return C(p)},!0);case"put":if(_.fire===Ie&&M.fire===Ie)break;return g._promise("readwrite",function(){return C(p)},!0);case"delete":if(b.fire===Ie)break;return g._promise("readwrite",function(){return C(p)},!0);case"deleteRange":if(b.fire===Ie)break;return g._promise("readwrite",function(){return(function x(I,O,E){return u.query({trans:I,values:!1,query:{index:f,range:O},limit:E}).then(function(k){var R=k.result;return C({type:"delete",keys:R,trans:I}).then(function($){return 0<$.numFailures?Promise.reject($.failures[0]):R.length<E?{failures:[],numFailures:0,lastResult:void 0}:x(I,i(i({},O),{lower:R[R.length-1],lowerOpen:!0}),E)})})})(p.trans,p.range,1e4)},!0)}return u.mutate(p);function C(x){var I,O,E,k=F.trans,R=x.keys||Co(f,x);if(R)return(x=x.type==="add"||x.type==="put"?i(i({},x),{keys:R}):i({},x)).type!=="delete"&&(x.values=r([],x.values)),x.keys&&(x.keys=r([],x.keys)),I=u,E=R,((O=x).type==="add"?Promise.resolve([]):I.getMany({trans:O.trans,keys:E,cache:"immutable"})).then(function($){var N=R.map(function(U,G){var ee,te,Y,oe=$[G],re={onerror:null,onsuccess:null};return x.type==="delete"?b.fire.call(re,U,oe,k):x.type==="add"||oe===void 0?(ee=_.fire.call(re,U,x.values[G],k),U==null&&ee!=null&&(x.keys[G]=U=ee,f.outbound||pe(x.values[G],f.keyPath,U))):(ee=_o(oe,x.values[G]),(te=M.fire.call(re,ee,U,oe,k))&&(Y=x.values[G],Object.keys(te).forEach(function(Z){v(Y,Z)?Y[Z]=te[Z]:pe(Y,Z,te[Z])}))),re});return u.mutate(x).then(function(U){for(var G=U.failures,ee=U.results,te=U.numFailures,U=U.lastResult,Y=0;Y<R.length;++Y){var oe=(ee||R)[Y],re=N[Y];oe==null?re.onerror&&re.onerror(G[Y]):re.onsuccess&&re.onsuccess(x.type==="put"&&$[Y]?x.values[Y]:oe)}return{failures:G,results:ee,numFailures:te,lastResult:U}}).catch(function(U){return N.forEach(function(G){return G.onerror&&G.onerror(U)}),Promise.reject(U)})});throw new Error("Keys missing")}}})}})}};function Qc(o,c,u){try{if(!c||c.keys.length<o.length)return null;for(var f=[],p=0,g=0;p<c.keys.length&&g<o.length;++p)Ce(c.keys[p],o[g])===0&&(f.push(u?rt(c.values[p]):c.values[p]),++g);return f.length===o.length?f:null}catch{return null}}var Ed={stack:"dbcore",level:-1,create:function(o){return{table:function(c){var u=o.table(c);return i(i({},u),{getMany:function(f){var p;return f.cache?(p=Qc(f.keys,f.trans._cache,f.cache==="clone"))?L.resolve(p):u.getMany(f).then(function(g){return f.trans._cache={keys:f.keys,values:f.cache==="clone"?rt(g):g},g}):u.getMany(f)},mutate:function(f){return f.type!=="add"&&(f.trans._cache=null),u.mutate(f)}})}}}};function Xc(o,c){return o.trans.mode==="readonly"&&!!o.subscr&&!o.trans.explicit&&o.trans.db._options.cache!=="disabled"&&!c.schema.primaryKey.outbound}function Zc(o,c){switch(o){case"query":return c.values&&!c.unique;case"get":case"getMany":case"count":case"openCursor":return!1}}var Id={stack:"dbcore",level:0,name:"Observability",create:function(o){var c=o.schema.name,u=new ht(o.MIN_KEY,o.MAX_KEY);return i(i({},o),{transaction:function(f,p,g){if(F.subscr&&p!=="readonly")throw new fe.ReadOnly("Readwrite transaction in liveQuery context. Querier source: ".concat(F.querier));return o.transaction(f,p,g)},table:function(f){function p(R){var k,R=R.query;return[k=R.index,new ht((k=(R=R.range).lower)!=null?k:o.MIN_KEY,(k=R.upper)!=null?k:o.MAX_KEY)]}var g=o.table(f),y=g.schema,b=y.primaryKey,_=y.indexes,M=b.extractKey,C=b.outbound,x=b.autoIncrement&&_.filter(function(E){return E.compound&&E.keyPath.includes(b.keyPath)}),I=i(i({},g),{mutate:function(E){function k(ce){return ce="idb://".concat(c,"/").concat(f,"/").concat(ce),G[ce]||(G[ce]=new ht)}var R,$,N,U=E.trans,G=E.mutatedParts||(E.mutatedParts={}),ee=k(""),te=k(":dels"),Y=E.type,re=E.type==="deleteRange"?[E.range]:E.type==="delete"?[E.keys]:E.values.length<50?[Co(b,E).filter(function(ce){return ce}),E.values]:[],oe=re[0],re=re[1],Z=E.trans._cache;return l(oe)?(ee.addKeys(oe),(Y=Y==="delete"||oe.length===re.length?Qc(oe,Z):null)||te.addKeys(oe),(Y||re)&&(R=k,$=Y,N=re,y.indexes.forEach(function(ce){var Oe=R(ce.name||"");function Te(ke){return ke!=null?ce.extractKey(ke):null}function me(ke){ce.multiEntry&&l(ke)?ke.forEach(function(Ve){return Oe.addKey(Ve)}):Oe.addKey(ke)}($||N).forEach(function(ke,He){var jt=$&&Te($[He]),He=N&&Te(N[He]);Ce(jt,He)!==0&&(jt!=null&&me(jt),He!=null)&&me(He)})}))):oe?(re={from:(Z=oe.lower)!=null?Z:o.MIN_KEY,to:(Y=oe.upper)!=null?Y:o.MAX_KEY},te.add(re),ee.add(re)):(ee.add(u),te.add(u),y.indexes.forEach(function(ce){return k(ce.name).add(u)})),g.mutate(E).then(function(ce){return!oe||E.type!=="add"&&E.type!=="put"||(ee.addKeys(ce.results),x&&x.forEach(function(Oe){for(var Te=E.values.map(function(jt){return Oe.extractKey(jt)}),me=Oe.keyPath.findIndex(function(jt){return jt===b.keyPath}),ke=0,Ve=ce.results.length;ke<Ve;++ke)Te[ke][me]=ce.results[ke];k(Oe.name).addKeys(Te)})),U.mutatedParts=Qr(U.mutatedParts||{},G),ce})}}),O={get:function(E){return[b,new ht(E.key)]},getMany:function(E){return[b,new ht().addKeys(E.keys)]},count:p,query:p,openCursor:p};return a(O).forEach(function(E){I[E]=function(k){var R=F.subscr,$=!!R,N=Xc(F,g)&&Zc(E,k)?k.obsSet={}:R;if($){var U,R=function(re){return re="idb://".concat(c,"/").concat(f,"/").concat(re),N[re]||(N[re]=new ht)},G=R(""),ee=R(":dels"),$=O[E](k),te=$[0],$=$[1];if((E==="query"&&te.isPrimaryKey&&!k.values?ee:R(te.name||"")).add($),!te.isPrimaryKey){if(E!=="count")return U=E==="query"&&C&&k.values&&g.query(i(i({},k),{values:!1})),g[E].apply(this,arguments).then(function(re){if(E==="query"){if(C&&k.values)return U.then(function(Te){return Te=Te.result,G.addKeys(Te),re});var Z=k.values?re.result.map(M):re.result;(k.values?G:ee).addKeys(Z)}else{var ce,Oe;if(E==="openCursor")return Oe=k.values,(ce=re)&&Object.create(ce,{key:{get:function(){return ee.addKey(ce.primaryKey),ce.key}},primaryKey:{get:function(){var Te=ce.primaryKey;return ee.addKey(Te),Te}},value:{get:function(){return Oe&&G.addKey(ce.primaryKey),ce.value}}})}return re});ee.add(u)}}return g[E].apply(this,arguments)}}),I}})}};function el(o,c,u){var f;return u.numFailures===0?c:c.type==="deleteRange"||(f=c.keys?c.keys.length:"values"in c&&c.values?c.values.length:1,u.numFailures===f)?null:(f=i({},c),l(f.keys)&&(f.keys=f.keys.filter(function(p,g){return!(g in u.failures)})),"values"in f&&l(f.values)&&(f.values=f.values.filter(function(p,g){return!(g in u.failures)})),f)}function Eo(o,c){return u=o,((f=c).lower===void 0||(f.lowerOpen?0<Ce(u,f.lower):0<=Ce(u,f.lower)))&&(u=o,(f=c).upper===void 0||(f.upperOpen?Ce(u,f.upper)<0:Ce(u,f.upper)<=0));var u,f}function tl(o,c,u,f,p,g){var y,b,_,M,C,x;return!u||u.length===0||(y=c.query.index,b=y.multiEntry,_=c.query.range,M=f.schema.primaryKey.extractKey,C=y.extractKey,x=(y.lowLevelIndex||y).extractKey,(f=u.reduce(function(I,O){var E=I,k=[];if(O.type==="add"||O.type==="put")for(var R=new ht,$=O.values.length-1;0<=$;--$){var N,U=O.values[$],G=M(U);!R.hasKey(G)&&(N=C(U),b&&l(N)?N.some(function(re){return Eo(re,_)}):Eo(N,_))&&(R.addKey(G),k.push(U))}switch(O.type){case"add":var ee=new ht().addKeys(c.values?I.map(function(Z){return M(Z)}):I),E=I.concat(c.values?k.filter(function(Z){return Z=M(Z),!ee.hasKey(Z)&&(ee.addKey(Z),!0)}):k.map(function(Z){return M(Z)}).filter(function(Z){return!ee.hasKey(Z)&&(ee.addKey(Z),!0)}));break;case"put":var te=new ht().addKeys(O.values.map(function(Z){return M(Z)}));E=I.filter(function(Z){return!te.hasKey(c.values?M(Z):Z)}).concat(c.values?k:k.map(function(Z){return M(Z)}));break;case"delete":var Y=new ht().addKeys(O.keys);E=I.filter(function(Z){return!Y.hasKey(c.values?M(Z):Z)});break;case"deleteRange":var oe=O.range;E=I.filter(function(Z){return!Eo(M(Z),oe)})}return E},o))===o)?o:(f.sort(function(I,O){return Ce(x(I),x(O))||Ce(M(I),M(O))}),c.limit&&c.limit<1/0&&(f.length>c.limit?f.length=c.limit:o.length===c.limit&&f.length<c.limit&&(p.dirty=!0)),g?Object.freeze(f):f)}function nl(o,c){return Ce(o.lower,c.lower)===0&&Ce(o.upper,c.upper)===0&&!!o.lowerOpen==!!c.lowerOpen&&!!o.upperOpen==!!c.upperOpen}function Od(o,c){return((u,f,p,g)=>{if(u===void 0)return f!==void 0?-1:0;if(f===void 0)return 1;if((u=Ce(u,f))===0){if(p&&g)return 0;if(p)return 1;if(g)return-1}return u})(o.lower,c.lower,o.lowerOpen,c.lowerOpen)<=0&&0<=((u,f,p,g)=>{if(u===void 0)return f!==void 0?1:0;if(f===void 0)return-1;if((u=Ce(u,f))===0){if(p&&g)return 0;if(p)return-1;if(g)return 1}return u})(o.upper,c.upper,o.upperOpen,c.upperOpen)}function Ad(o,c,u,f){o.subscribers.add(u),f.addEventListener("abort",function(){var p,g;o.subscribers.delete(u),o.subscribers.size===0&&(p=o,g=c,setTimeout(function(){p.subscribers.size===0&&he(g,p)},3e3))})}var Pd={stack:"dbcore",level:0,name:"Cache",create:function(o){var c=o.schema.name;return i(i({},o),{transaction:function(u,f,p){var g,y,b=o.transaction(u,f,p);return f==="readwrite"&&(p=(g=new AbortController).signal,b.addEventListener("abort",(y=function(_){return function(){if(g.abort(),f==="readwrite"){for(var M=new Set,C=0,x=u;C<x.length;C++){var I=x[C],O=Un["idb://".concat(c,"/").concat(I)];if(O){var E=o.table(I),k=O.optimisticOps.filter(function(ce){return ce.trans===b});if(b._explicit&&_&&b.mutatedParts)for(var R=0,$=Object.values(O.queries.query);R<$.length;R++)for(var N=0,U=(te=$[R]).slice();N<U.length;N++)bo((Y=U[N]).obsSet,b.mutatedParts)&&(he(te,Y),Y.subscribers.forEach(function(ce){return M.add(ce)}));else if(0<k.length){O.optimisticOps=O.optimisticOps.filter(function(ce){return ce.trans!==b});for(var G=0,ee=Object.values(O.queries.query);G<ee.length;G++)for(var te,Y,oe,re=0,Z=(te=ee[G]).slice();re<Z.length;re++)(Y=Z[re]).res!=null&&b.mutatedParts&&(_&&!Y.dirty?(oe=Object.isFrozen(Y.res),oe=tl(Y.res,Y.req,k,E,Y,oe),Y.dirty?(he(te,Y),Y.subscribers.forEach(function(ce){return M.add(ce)})):oe!==Y.res&&(Y.res=oe,Y.promise=L.resolve({result:oe}))):(Y.dirty&&he(te,Y),Y.subscribers.forEach(function(ce){return M.add(ce)})))}}}M.forEach(function(ce){return ce()})}}})(!1),{signal:p}),b.addEventListener("error",y(!1),{signal:p}),b.addEventListener("complete",y(!0),{signal:p})),b},table:function(u){var f=o.table(u),p=f.schema.primaryKey;return i(i({},f),{mutate:function(g){var y,b=F.trans;return!p.outbound&&b.db._options.cache!=="disabled"&&!b.explicit&&b.idbtrans.mode==="readwrite"&&(y=Un["idb://".concat(c,"/").concat(u)])?(b=f.mutate(g),g.type!=="add"&&g.type!=="put"||!(50<=g.values.length||Co(p,g).some(function(_){return _==null}))?(y.optimisticOps.push(g),g.mutatedParts&&Xr(g.mutatedParts),b.then(function(_){0<_.numFailures&&(he(y.optimisticOps,g),(_=el(0,g,_))&&y.optimisticOps.push(_),g.mutatedParts)&&Xr(g.mutatedParts)}),b.catch(function(){he(y.optimisticOps,g),g.mutatedParts&&Xr(g.mutatedParts)})):b.then(function(_){var M=el(0,i(i({},g),{values:g.values.map(function(C,x){var I;return _.failures[x]?C:(pe(I=(I=p.keyPath)!=null&&I.includes(".")?rt(C):i({},C),p.keyPath,_.results[x]),I)})}),_);y.optimisticOps.push(M),queueMicrotask(function(){return g.mutatedParts&&Xr(g.mutatedParts)})}),b):f.mutate(g)},query:function(g){var y,b,_,M,C,x,I;return Xc(F,f)&&Zc("query",g)?(y=((_=F.trans)==null?void 0:_.db._options.cache)==="immutable",b=(_=F).requery,_=_.signal,x=((O,E,k,R)=>{var $=Un["idb://".concat(O,"/").concat(E)];if(!$)return[];if(!(O=$.queries[k]))return[null,!1,$,null];var N=O[(R.query?R.query.index.name:null)||""];if(!N)return[null,!1,$,null];switch(k){case"query":var U=N.find(function(G){return G.req.limit===R.limit&&G.req.values===R.values&&nl(G.req.query.range,R.query.range)});return U?[U,!0,$,N]:[N.find(function(G){return("limit"in G.req?G.req.limit:1/0)>=R.limit&&(!R.values||G.req.values)&&Od(G.req.query.range,R.query.range)}),!1,$,N];case"count":return U=N.find(function(G){return nl(G.req.query.range,R.query.range)}),[U,!!U,$,N]}})(c,u,"query",g),I=x[0],M=x[2],C=x[3],I&&x[1]?I.obsSet=g.obsSet:(x=f.query(g).then(function(O){var E=O.result;if(I&&(I.res=E),y){for(var k=0,R=E.length;k<R;++k)Object.freeze(E[k]);Object.freeze(E)}else O.result=rt(E);return O}).catch(function(O){return C&&I&&he(C,I),Promise.reject(O)}),I={obsSet:g.obsSet,promise:x,subscribers:new Set,type:"query",req:g,dirty:!1},C?C.push(I):(C=[I],(M=M||(Un["idb://".concat(c,"/").concat(u)]={queries:{query:{},count:{}},objs:new Map,optimisticOps:[],unsignaledParts:{}})).queries.query[g.query.index.name||""]=C)),Ad(I,C,b,_),I.promise.then(function(O){return{result:tl(O.result,g,M?.optimisticOps,f,I,y)}})):f.query(g)}})}})}};function es(o,c){return new Proxy(o,{get:function(u,f,p){return f==="db"?c:Reflect.get(u,f,p)}})}Ye.prototype.version=function(o){if(isNaN(o)||o<.1)throw new fe.Type("Given version is not a positive number");if(o=Math.round(10*o)/10,this.idbdb||this._state.isBeingOpened)throw new fe.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,o);var c=this._versions,u=c.filter(function(f){return f._cfg.version===o})[0];return u||(u=new this.Version(o),c.push(u),c.sort(bd),u.stores({}),this._state.autoSchema=!1),u},Ye.prototype._whenReady=function(o){var c=this;return this.idbdb&&(this._state.openComplete||F.letThrough||this._vip)?o():new L(function(u,f){if(c._state.openComplete)return f(new fe.DatabaseClosed(c._state.dbOpenError));if(!c._state.isBeingOpened){if(!c._state.autoOpen)return void f(new fe.DatabaseClosed);c.open().catch(Ie)}c._state.dbReadyPromise.then(u,f)}).then(o)},Ye.prototype.use=function(p){var c=p.stack,u=p.create,f=p.level,p=p.name,g=(p&&this.unuse({stack:c,name:p}),this._middlewares[c]||(this._middlewares[c]=[]));return g.push({stack:c,create:u,level:f??10,name:p}),g.sort(function(y,b){return y.level-b.level}),this},Ye.prototype.unuse=function(o){var c=o.stack,u=o.name,f=o.create;return c&&this._middlewares[c]&&(this._middlewares[c]=this._middlewares[c].filter(function(p){return f?p.create!==f:!!u&&p.name!==u})),this},Ye.prototype.open=function(){var o=this;return Dn(q,function(){return kd(o)})},Ye.prototype._close=function(){this.on.close.fire(new CustomEvent("close"));var o=this._state,c=di.indexOf(this);if(0<=c&&di.splice(c,1),this.idbdb){try{this.idbdb.close()}catch{}this.idbdb=null}o.isBeingOpened||(o.dbReadyPromise=new L(function(u){o.dbReadyResolve=u}),o.openCanceller=new L(function(u,f){o.cancelOpen=f}))},Ye.prototype.close=function(c){var c=(c===void 0?{disableAutoOpen:!0}:c).disableAutoOpen,u=this._state;c?(u.isBeingOpened&&u.cancelOpen(new fe.DatabaseClosed),this._close(),u.autoOpen=!1,u.dbOpenError=new fe.DatabaseClosed):(this._close(),u.autoOpen=this._options.autoOpen||u.isBeingOpened,u.openComplete=!1,u.dbOpenError=null)},Ye.prototype.delete=function(o){var c=this,u=(o===void 0&&(o={disableAutoOpen:!0}),0<arguments.length&&typeof arguments[0]!="object"),f=this._state;return new L(function(p,g){function y(){c.close(o);var b=c._deps.indexedDB.deleteDatabase(c.name);b.onsuccess=qe(function(){var _,M,C;_=c._deps,M=c.name,mo(C=_.indexedDB)||M===Fr||go(C,_.IDBKeyRange).delete(M).catch(Ie),p()}),b.onerror=Xt(g),b.onblocked=c._fireOnBlocked}if(u)throw new fe.InvalidArgument("Invalid closeOptions argument to db.delete()");f.isBeingOpened?f.dbReadyPromise.then(y):y()})},Ye.prototype.backendDB=function(){return this.idbdb},Ye.prototype.isOpen=function(){return this.idbdb!==null},Ye.prototype.hasBeenClosed=function(){var o=this._state.dbOpenError;return o&&o.name==="DatabaseClosed"},Ye.prototype.hasFailed=function(){return this._state.dbOpenError!==null},Ye.prototype.dynamicallyOpened=function(){return this._state.autoSchema},Object.defineProperty(Ye.prototype,"tables",{get:function(){var o=this;return a(this._allTables).map(function(c){return o._allTables[c]})},enumerable:!1,configurable:!0}),Ye.prototype.transaction=function(){var o=function(c,u,f){var p=arguments.length;if(p<2)throw new fe.InvalidArgument("Too few arguments");for(var g=new Array(p-1);--p;)g[p-1]=arguments[p];return f=g.pop(),[c,Re(g),f]}.apply(this,arguments);return this._transaction.apply(this,o)},Ye.prototype._transaction=function(o,c,u){var f,p,g=this,y=F.trans,b=(y&&y.db===this&&o.indexOf("!")===-1||(y=null),o.indexOf("?")!==-1);o=o.replace("!","").replace("?","");try{if(p=c.map(function(M){if(M=M instanceof g.Table?M.name:M,typeof M!="string")throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return M}),o=="r"||o===io)f=io;else{if(o!="rw"&&o!=ro)throw new fe.InvalidArgument("Invalid transaction mode: "+o);f=ro}if(y){if(y.mode===io&&f===ro){if(!b)throw new fe.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");y=null}y&&p.forEach(function(M){if(y&&y.storeNames.indexOf(M)===-1){if(!b)throw new fe.SubTransaction("Table "+M+" not included in parent transaction.");y=null}}),b&&y&&!y.active&&(y=null)}}catch(M){return y?y._promise(null,function(C,x){x(M)}):Ge(M)}var _=function M(C,x,I,O,E){return L.resolve().then(function(){var N=F.transless||F,k=C._createTransaction(x,I,C._dbSchema,O),N=(k.explicit=!0,{trans:k,transless:N});if(O)k.idbtrans=O.idbtrans;else try{k.create(),k.idbtrans._explicit=!0,C._state.PR1398_maxLoop=3}catch(U){return U.name===Jt.InvalidState&&C.isOpen()&&0<--C._state.PR1398_maxLoop?(console.warn("Dexie: Need to reopen db"),C.close({disableAutoOpen:!1}),C.open().then(function(){return M(C,x,I,null,E)})):Ge(U)}var R,$=Ke(E),N=($&&fi(),L.follow(function(){var U;(R=E.call(k,k))&&($?(U=bn.bind(null,null),R.then(U,U)):typeof R.next=="function"&&typeof R.throw=="function"&&(R=ko(R)))},N));return(R&&typeof R.then=="function"?L.resolve(R).then(function(U){return k.active?U:Ge(new fe.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))}):N.then(function(){return R})).then(function(U){return O&&k._resolve(),k._completion.then(function(){return U})}).catch(function(U){return k._reject(U),Ge(U)})})}.bind(null,this,f,p,y,u);return y?y._promise(f,_,"lock"):F.trans?Dn(F.transless,function(){return g._whenReady(_)}):this._whenReady(_)},Ye.prototype.table=function(o){if(v(this._allTables,o))return this._allTables[o];throw new fe.InvalidTable("Table ".concat(o," does not exist"))};var an=Ye;function Ye(o,c){var u,f,p,g,y,b=this,_=(this._middlewares={},this.verno=0,Ye.dependencies),_=(this._options=c=i({addons:Ye.addons,autoOpen:!0,indexedDB:_.indexedDB,IDBKeyRange:_.IDBKeyRange,cache:"cloned"},c),this._deps={indexedDB:c.indexedDB,IDBKeyRange:c.IDBKeyRange},c.addons),M=(this._dbSchema={},this._versions=[],this._storeNames=[],this._allTables={},this.idbdb=null,this._novip=this,{dbOpenError:null,isBeingOpened:!1,onReadyBeingFired:null,openComplete:!1,dbReadyResolve:Ie,dbReadyPromise:null,cancelOpen:Ie,openCanceller:null,autoSchema:!0,PR1398_maxLoop:3,autoOpen:c.autoOpen}),C=(M.dbReadyPromise=new L(function(x){M.dbReadyResolve=x}),M.openCanceller=new L(function(x,I){M.cancelOpen=I}),this._state=M,this.name=o,this.on=Di(this,"populate","blocked","versionchange","close",{ready:[mn,Ie]}),this.once=function(x,I){var O=function(){for(var E=[],k=0;k<arguments.length;k++)E[k]=arguments[k];b.on(x).unsubscribe(O),I.apply(b,E)};return b.on(x,O)},this.on.ready.subscribe=ie(this.on.ready.subscribe,function(x){return function(I,O){Ye.vip(function(){var E,k=b._state;k.openComplete?(k.dbOpenError||L.resolve().then(I),O&&x(I)):k.onReadyBeingFired?(k.onReadyBeingFired.push(I),O&&x(I)):(x(I),E=b,O||x(function R(){E.on.ready.unsubscribe(I),E.on.ready.unsubscribe(R)}))})}}),this.Collection=(u=this,Ki(dd.prototype,function(R,k){this.db=u;var O=Tc,E=null;if(k)try{O=k()}catch(N){E=N}var k=R._ctx,R=k.table,$=R.hook.reading.fire;this._ctx={table:R,index:k.index,isPrimKey:!k.index||R.schema.primKey.keyPath&&k.index===R.schema.primKey.name,range:O,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:E,or:k.or,valueMapper:$!==Et?$:null}})),this.Table=(f=this,Ki(Lc.prototype,function(x,I,O){this.db=f,this._tx=O,this.name=x,this.schema=I,this.hook=f._allTables[x]?f._allTables[x].hook:Di(null,{creating:[rn,Ie],reading:[Fn,Et],updating:[li,Ie],deleting:[Qt,Ie]})})),this.Transaction=(p=this,Ki(gd.prototype,function(x,I,O,E,k){var R=this;x!=="readonly"&&I.forEach(function($){$=($=O[$])==null?void 0:$.yProps,$&&(I=I.concat($.map(function(N){return N.updatesTable})))}),this.db=p,this.mode=x,this.storeNames=I,this.schema=O,this.chromeTransactionDurability=E,this.idbtrans=null,this.on=Di(this,"complete","error","abort"),this.parent=k||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 L(function($,N){R._resolve=$,R._reject=N}),this._completion.then(function(){R.active=!1,R.on.complete.fire()},function($){var N=R.active;return R.active=!1,R.on.error.fire($),R.parent?R.parent._reject($):N&&R.idbtrans&&R.idbtrans.abort(),Ge($)})})),this.Version=(g=this,Ki(Sd.prototype,function(x){this.db=g,this._cfg={version:x,storesSource:null,dbschema:{},tables:{},contentUpgrade:null}})),this.WhereClause=(y=this,Ki(qc.prototype,function(x,I,O){if(this.db=y,this._ctx={table:x,index:I===":id"?null:I,or:O},this._cmp=this._ascending=Ce,this._descending=function(E,k){return Ce(k,E)},this._max=function(E,k){return 0<Ce(E,k)?E:k},this._min=function(E,k){return Ce(E,k)<0?E:k},this._IDBKeyRange=y._deps.IDBKeyRange,!this._IDBKeyRange)throw new fe.MissingAPI})),this.on("versionchange",function(x){0<x.newVersion?console.warn("Another connection wants to upgrade database '".concat(b.name,"'. Closing db now to resume the upgrade.")):console.warn("Another connection wants to delete database '".concat(b.name,"'. Closing db now to resume the delete request.")),b.close({disableAutoOpen:!1})}),this.on("blocked",function(x){!x.newVersion||x.newVersion<x.oldVersion?console.warn("Dexie.delete('".concat(b.name,"') was blocked")):console.warn("Upgrade '".concat(b.name,"' blocked by other connection holding version ").concat(x.oldVersion/10))}),this._maxKey=zi(c.IDBKeyRange),this._createTransaction=function(x,I,O,E){return new b.Transaction(x,I,O,b._options.chromeTransactionDurability,E)},this._fireOnBlocked=function(x){b.on("blocked").fire(x),di.filter(function(I){return I.name===b.name&&I!==b&&!I._state.vcFired}).map(function(I){return I.on("versionchange").fire(x)})},this.use(Ed),this.use(Pd),this.use(Id),this.use(_d),this.use(Cd),new Proxy(this,{get:function(x,I,O){var E;return I==="_vip"||(I==="table"?function(k){return es(b.table(k),C)}:(E=Reflect.get(x,I,O))instanceof Lc?es(E,C):I==="tables"?E.map(function(k){return es(k,C)}):I==="_createTransaction"?function(){return es(E.apply(this,arguments),C)}:E)}}));this.vip=C,_.forEach(function(x){return x(b)})}var ts,mi=typeof Symbol<"u"&&"observable"in Symbol?Symbol.observable:"@@observable",Td=(Io.prototype.subscribe=function(o,c,u){return this._subscribe(o&&typeof o!="function"?o:{next:o,error:c,complete:u})},Io.prototype[mi]=function(){return this},Io);function Io(o){this._subscribe=o}try{ts={indexedDB:s.indexedDB||s.mozIndexedDB||s.webkitIndexedDB||s.msIndexedDB,IDBKeyRange:s.IDBKeyRange||s.webkitIDBKeyRange}}catch{ts={indexedDB:null,IDBKeyRange:null}}function il(o){var c,u=!1,f=new Td(function(p){var g=Ke(o),y,b=!1,_={},M={},C={get closed(){return b},unsubscribe:function(){b||(b=!0,y&&y.abort(),x&&Sn.storagemutated.unsubscribe(O))}},x=(p.start&&p.start(C),!1),I=function(){return no(E)},O=function(k){Qr(_,k),bo(M,_)&&I()},E=function(){var k,R,$;!b&&ts.indexedDB&&(_={},k={},y&&y.abort(),y=new AbortController,$=(N=>{var U=sn();try{g&&fi();var G=yn(o,N);return G=g?G.finally(bn):G}finally{U&&vn()}})(R={subscr:k,signal:y.signal,requery:I,querier:o,trans:null}),Promise.resolve($).then(function(N){u=!0,c=N,b||R.signal.aborted||(_={},(U=>{for(var G in U)if(v(U,G))return;return 1})(M=k)||x||(Sn(Ui,O),x=!0),no(function(){return!b&&p.next&&p.next(N)}))},function(N){u=!1,["DatabaseClosedError","AbortError"].includes(N?.name)||b||no(function(){b||p.error&&p.error(N)})}))};return setTimeout(I,0),C});return f.hasValue=function(){return u},f.getValue=function(){return c},f}var zn=an;function Oo(o){var c=kn;try{kn=!0,Sn.storagemutated.fire(o),So(o,!0)}finally{kn=c}}w(zn,i(i({},kt),{delete:function(o){return new zn(o,{addons:[]}).delete()},exists:function(o){return new zn(o,{addons:[]}).open().then(function(c){return c.close(),!0}).catch("NoSuchDatabaseError",function(){return!1})},getDatabaseNames:function(o){try{return c=zn.dependencies,u=c.indexedDB,c=c.IDBKeyRange,(mo(u)?Promise.resolve(u.databases()).then(function(f){return f.map(function(p){return p.name}).filter(function(p){return p!==Fr})}):go(u,c).toCollection().primaryKeys()).then(o)}catch{return Ge(new fe.MissingAPI)}var c,u},defineClass:function(){return function(o){d(this,o)}},ignoreTransaction:function(o){return F.trans?Dn(F.transless,o):o()},vip:vo,async:function(o){return function(){try{var c=ko(o.apply(this,arguments));return c&&typeof c.then=="function"?c:L.resolve(c)}catch(u){return Ge(u)}}},spawn:function(o,c,u){try{var f=ko(o.apply(u,c||[]));return f&&typeof f.then=="function"?f:L.resolve(f)}catch(p){return Ge(p)}},currentTransaction:{get:function(){return F.trans||null}},waitFor:function(o,c){return o=L.resolve(typeof o=="function"?zn.ignoreTransaction(o):o).timeout(c||6e4),F.trans?F.trans.waitFor(o):o},Promise:L,debug:{get:function(){return mt},set:function(o){Nt(o)}},derive:A,extend:d,props:w,override:ie,Events:Di,on:Sn,liveQuery:il,extendObservabilitySet:Qr,getByKeyPath:ue,setByKeyPath:pe,delByKeyPath:function(o,c){typeof c=="string"?pe(o,c,void 0):"length"in c&&[].map.call(c,function(u){pe(o,u,void 0)})},shallowClone:Q,deepClone:rt,getObjectDiff:_o,cmp:Ce,asap:ne,minKey:-1/0,addons:[],connections:di,errnames:Jt,dependencies:ts,cache:Un,semVer:"4.3.0",version:"4.3.0".split(".").map(function(o){return parseInt(o)}).reduce(function(o,c,u){return o+c/Math.pow(10,2*u)})})),zn.maxKey=zi(zn.dependencies.IDBKeyRange),typeof dispatchEvent<"u"&&typeof addEventListener<"u"&&(Sn(Ui,function(o){kn||(o=new CustomEvent(ao,{detail:o}),kn=!0,dispatchEvent(o),kn=!1)}),addEventListener(ao,function(o){o=o.detail,kn||Oo(o)}));var vi,kn=!1,rl=function(){};return typeof BroadcastChannel<"u"&&((rl=function(){(vi=new BroadcastChannel(ao)).onmessage=function(o){return o.data&&Oo(o.data)}})(),typeof vi.unref=="function"&&vi.unref(),Sn(Ui,function(o){kn||vi.postMessage(o)})),typeof addEventListener<"u"&&(addEventListener("pagehide",function(o){if(!an.disableBfCache&&o.persisted){mt&&console.debug("Dexie: handling persisted pagehide"),vi?.close();for(var c=0,u=di;c<u.length;c++)u[c].close({disableAutoOpen:!1})}}),addEventListener("pageshow",function(o){!an.disableBfCache&&o.persisted&&(mt&&console.debug("Dexie: handling persisted pageshow"),rl(),Oo({all:new ht(-1/0,[[]])}))})),L.rejectionMapper=function(o,c){return!o||o instanceof dt||o instanceof TypeError||o instanceof SyntaxError||!o.name||!pt[o.name]?o:(c=new pt[o.name](c||o.message,o),"stack"in o&&K(c,"stack",{get:function(){return this.inner.stack}}),c)},Nt(mt),i(an,Object.freeze({__proto__:null,Dexie:an,Entity:Nc,PropModification:Fi,RangeSet:ht,add:function(o){return new Fi({add:o})},cmp:Ce,default:an,liveQuery:il,mergeRanges:Hi,rangesOverlap:Hc,remove:function(o){return new Fi({remove:o})},replacePrefix:function(o,c){return new Fi({replacePrefix:[o,c]})}}),{default:an}),an})})(xs)),xs.exports}var dg=fg(),wa=Nd(dg);const Kl=Symbol.for("Dexie"),js=globalThis[Kl]||(globalThis[Kl]=wa);if(wa.semVer!==js.semVer)throw new Error(`Two different versions of Dexie loaded in the same app: ${wa.semVer} and ${js.semVer}`);const{liveQuery:Cy,mergeRanges:Ey,rangesOverlap:Iy,RangeSet:Oy,cmp:Ay,Entity:Py,PropModification:Ty,replacePrefix:Ny,add:jy,remove:My,DexieYProvider:Ry}=js;class pg extends js{pages;constructor(e){super("pages_"+e),this.version(2).stores({pages:"id, name, content, document, css, js, document.name, document.headline, document.creator"})}}var hg=Object.getOwnPropertyDescriptor,gg=(n,e,t,i)=>{for(var r=i>1?void 0:i?hg(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},mg=(n,e)=>(t,i)=>e(t,i,n);let xa=class{pageStorageMap=new Map;logger;constructor(n){this.logger=n,this.logger.setModule("storage.components.dexieOfflineStorage")}getPageStorage(n){let e=this.pageStorageMap.get(n);return e==null&&(e=new pg(n),this.pageStorageMap.set(n,e)),e}async getPage(n,e){try{this.logger.debug("Ready to load page from local storage",e);const t=this.getPageStorage(n);this.logger.debug("pageStorage is ready, asking for page");const i=await t.pages.get(e),r=new jn;return r.fromObject(i),r}catch(t){this.logger.debug("Exception while trying to read from local storage",t);return}}async savePage(n,e,t){try{await this.getPageStorage(n).pages.put(t.toObject(),e)}catch(i){this.logger.debug("Exception while trying to store in local storage",n,e,t,i)}}async updatePage(n,e,t){try{const i=this.getPageStorage(n);this.logger.debug("Ready to store",t),await i.pages.update(e,t.toObject())}catch(i){this.logger.debug("Exception while trying to store in local storage",n,e,t,i)}}};xa=gg([it(),mg(0,Le("Logger"))],xa);var vg=Object.getOwnPropertyDescriptor,yg=(n,e,t,i)=>{for(var r=i>1?void 0:i?vg(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Ko=(n,e)=>(t,i)=>e(t,i,n);let Sa=class{logger;storage;offlineStorage;queueWorker;constructor(n,e,t){this.logger=n,this.logger.setModule("storage.components.wrappingOfflineStorage"),this.offlineStorage=e,this.queueWorker=t}setStorage(n){this.storage=n}getStorage(){return this.storage}setWikiConfig(n){return this.storage.setWikiConfig(n)}getWikiConfig(){return this.storage.getWikiConfig()}async isStorageReady(){return this.storage.isStorageReady()}getPageRestURL(n,e){return this.storage.getPageRestURL(n,e)}getPageFromViewURL(n){return this.storage.getPageFromViewURL(n)}getImageURL(n,e){return this.storage.getImageURL(n,e)}async getPageContent(n,e,t,i){if(this.logger.debug("Trying to get data for page ",n),this.offlineStorage){this.logger.debug("Asking offline storage for ",n);const r=await this.offlineStorage.getPage(this.getWikiConfig().name,n+"_"+e);return r!=null&&r!=null?(this.logger.debug("Loading data from local storage for page",n),(i==null||i)&&this.queueWorker.addToQueue(this.getWikiConfig().name+":"+n+"_"+e),r):(this.logger.debug("Could not find data in local storage for page",n),this.savePageContent(n,e))}else return this.logger.debug("No offline local storage available"),this.storage.getPageContent(n,e)}getAttachments(n){return this.storage.getAttachments(n)}getAttachment(n,e){return this.storage.getAttachment(n,e)}async savePageContent(n,e){const t=await this.storage.getPageContent(n,e);if(t)return t.id=n+"_"+e,this.logger.debug("Saving page to offline storage",n),this.offlineStorage.savePage(this.getWikiConfig().name,n+"_"+e,t),t;throw new Error("Can't save missing page.")}async updatePageContent(n,e){const t=await this.offlineStorage.getPage(this.getWikiConfig().name,n+"_"+e),i=await this.storage.getPageContent(n,e);return t&&i?(i.id=n+"_"+e,this.logger.debug("Saving page to offline storage",n),this.offlineStorage.savePage(this.getWikiConfig().name,n+"_"+e,i),!0):t?.version!=i?.version&&i?(i.id=n+"_"+e,this.logger.debug("Updating page to offline storage",n),this.offlineStorage.updatePage(this.getWikiConfig().name,n+"_"+e,i),!0):(this.logger.debug("Local storage not updated, because version are identical"),!1)}async getPanelContent(n,e,t){return this.storage.getPanelContent(n,e,t)}async getEditField(n,e){return await this.storage.getEditField(n,e)}save(n,e,t,i){return this.storage.save(n,e,t,i)}async saveAttachments(n,e){return this.storage.saveAttachments(n,e)}async delete(n){return this.storage.delete(n)}async move(n,e,t){return this.storage.move(n,e,t)}};Sa=yg([it(),Ko(0,Le("Logger")),Ko(1,Le("OfflineStorage")),Ko(2,Le("QueueWorker"))],Sa);let bg=class{constructor(e){e.bind("WrappingStorage").to(Sa).inSingletonScope(),e.bind("OfflineStorage").to(xa).inSingletonScope()}};var wg=Object.getOwnPropertyDescriptor,xg=(n,e,t,i)=>{for(var r=i>1?void 0:i?wg(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},ls=(n,e)=>(t,i)=>e(t,i,n);let ka=class extends Sr{storage;cristal;constructor(n,e,t){super(n),this.storage=e,this.cristal=t,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="README.md")}defaultPageName(){return"README"}getType(){return"GitHub"}};ka=xg([it(),ls(0,Le("Logger")),ls(1,Le("Storage")),ls(1,tc("GitHub")),ls(2,Le("CristalApp"))],ka);const uc=Symbol.for("yaml.alias"),_a=Symbol.for("yaml.document"),Mn=Symbol.for("yaml.map"),cf=Symbol.for("yaml.pair"),nn=Symbol.for("yaml.scalar"),Mi=Symbol.for("yaml.seq"),Ut=Symbol.for("yaml.node.type"),ai=n=>!!n&&typeof n=="object"&&n[Ut]===uc,Or=n=>!!n&&typeof n=="object"&&n[Ut]===_a,Ar=n=>!!n&&typeof n=="object"&&n[Ut]===Mn,et=n=>!!n&&typeof n=="object"&&n[Ut]===cf,De=n=>!!n&&typeof n=="object"&&n[Ut]===nn,Pr=n=>!!n&&typeof n=="object"&&n[Ut]===Mi;function Qe(n){if(n&&typeof n=="object")switch(n[Ut]){case Mn:case Mi:return!0}return!1}function Xe(n){if(n&&typeof n=="object")switch(n[Ut]){case uc:case Mn:case nn:case Mi:return!0}return!1}const lf=n=>(De(n)||Qe(n))&&!!n.anchor,Yn=Symbol("break visit"),Sg=Symbol("skip children"),pr=Symbol("remove node");function Ri(n,e){const t=kg(e);Or(n)?Ci(null,n.contents,t,Object.freeze([n]))===pr&&(n.contents=null):Ci(null,n,t,Object.freeze([]))}Ri.BREAK=Yn;Ri.SKIP=Sg;Ri.REMOVE=pr;function Ci(n,e,t,i){const r=_g(n,e,t,i);if(Xe(r)||et(r))return Cg(n,i,r),Ci(n,r,t,i);if(typeof r!="symbol"){if(Qe(e)){i=Object.freeze(i.concat(e));for(let s=0;s<e.items.length;++s){const a=Ci(s,e.items[s],t,i);if(typeof a=="number")s=a-1;else{if(a===Yn)return Yn;a===pr&&(e.items.splice(s,1),s-=1)}}}else if(et(e)){i=Object.freeze(i.concat(e));const s=Ci("key",e.key,t,i);if(s===Yn)return Yn;s===pr&&(e.key=null);const a=Ci("value",e.value,t,i);if(a===Yn)return Yn;a===pr&&(e.value=null)}}return r}function kg(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function _g(n,e,t,i){if(typeof t=="function")return t(n,e,i);if(Ar(e))return t.Map?.(n,e,i);if(Pr(e))return t.Seq?.(n,e,i);if(et(e))return t.Pair?.(n,e,i);if(De(e))return t.Scalar?.(n,e,i);if(ai(e))return t.Alias?.(n,e,i)}function Cg(n,e,t){const i=e[e.length-1];if(Qe(i))i.items[n]=t;else if(et(i))n==="key"?i.key=t:i.value=t;else if(Or(i))i.contents=t;else{const r=ai(i)?"alias":"scalar";throw new Error(`Cannot replace node with ${r} parent`)}}const Eg={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},Ig=n=>n.replace(/[!,[\]{}]/g,e=>Eg[e]);class bt{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},bt.defaultYaml,e),this.tags=Object.assign({},bt.defaultTags,t)}clone(){const e=new bt(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new bt(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:bt.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},bt.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:bt.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},bt.defaultTags),this.atNextDocument=!1);const i=e.trim().split(/[ \t]+/),r=i.shift();switch(r){case"%TAG":{if(i.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),i.length<2))return!1;const[s,a]=i;return this.tags[s]=a,!0}case"%YAML":{if(this.yaml.explicit=!0,i.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[s]=i;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const a=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,a),!1}}default:return t(0,`Unknown directive ${r}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const a=e.slice(2,-1);return a==="!"||a==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),a)}const[,i,r]=e.match(/^(.*!)([^!]*)$/s);r||t(`The ${e} tag has no suffix`);const s=this.tags[i];if(s)try{return s+decodeURIComponent(r)}catch(a){return t(String(a)),null}return i==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,i]of Object.entries(this.tags))if(e.startsWith(i))return t+Ig(e.substring(i.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],i=Object.entries(this.tags);let r;if(e&&i.length>0&&Xe(e.contents)){const s={};Ri(e.contents,(a,l)=>{Xe(l)&&l.tag&&(s[l.tag]=!0)}),r=Object.keys(s)}else r=[];for(const[s,a]of i)s==="!!"&&a==="tag:yaml.org,2002:"||(!e||r.some(l=>l.startsWith(a)))&&t.push(`%TAG ${s} ${a}`);return t.join(`
|
|
51
|
-
`)}}bt.defaultYaml={explicit:!1,version:"1.2"};bt.defaultTags={"!!":"tag:yaml.org,2002:"};function uf(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function ff(n){const e=new Set;return Ri(n,{Value(t,i){i.anchor&&e.add(i.anchor)}}),e}function df(n,e){for(let t=1;;++t){const i=`${n}${t}`;if(!e.has(i))return i}}function Og(n,e){const t=[],i=new Map;let r=null;return{onAnchor:s=>{t.push(s),r??(r=ff(n));const a=df(e,r);return r.add(a),a},setAnchors:()=>{for(const s of t){const a=i.get(s);if(typeof a=="object"&&a.anchor&&(De(a.node)||Qe(a.node)))a.node.anchor=a.anchor;else{const l=new Error("Failed to resolve repeated object (this should not happen)");throw l.source=s,l}}},sourceObjects:i}}function Ei(n,e,t,i){if(i&&typeof i=="object")if(Array.isArray(i))for(let r=0,s=i.length;r<s;++r){const a=i[r],l=Ei(n,i,String(r),a);l===void 0?delete i[r]:l!==a&&(i[r]=l)}else if(i instanceof Map)for(const r of Array.from(i.keys())){const s=i.get(r),a=Ei(n,i,r,s);a===void 0?i.delete(r):a!==s&&i.set(r,a)}else if(i instanceof Set)for(const r of Array.from(i)){const s=Ei(n,i,r,r);s===void 0?i.delete(r):s!==r&&(i.delete(r),i.add(s))}else for(const[r,s]of Object.entries(i)){const a=Ei(n,i,r,s);a===void 0?delete i[r]:a!==s&&(i[r]=a)}return n.call(e,t,i)}function Ft(n,e,t){if(Array.isArray(n))return n.map((i,r)=>Ft(i,String(r),t));if(n&&typeof n.toJSON=="function"){if(!t||!lf(n))return n.toJSON(e,t);const i={aliasCount:0,count:1,res:void 0};t.anchors.set(n,i),t.onCreate=s=>{i.res=s,delete t.onCreate};const r=n.toJSON(e,t);return t.onCreate&&t.onCreate(r),r}return typeof n=="bigint"&&!t?.keep?Number(n):n}class fc{constructor(e){Object.defineProperty(this,Ut,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:i,onAnchor:r,reviver:s}={}){if(!Or(e))throw new TypeError("A document argument is required");const a={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=Ft(this,"",a);if(typeof r=="function")for(const{count:d,res:h}of a.anchors.values())r(h,d);return typeof s=="function"?Ei(s,{"":l},"",l):l}}class dc extends fc{constructor(e){super(uc),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let i;t?.aliasResolveCache?i=t.aliasResolveCache:(i=[],Ri(e,{Node:(s,a)=>{(ai(a)||lf(a))&&i.push(a)}}),t&&(t.aliasResolveCache=i));let r;for(const s of i){if(s===this)break;s.anchor===this.source&&(r=s)}return r}toJSON(e,t){if(!t)return{source:this.source};const{anchors:i,doc:r,maxAliasCount:s}=t,a=this.resolve(r,t);if(!a){const d=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(d)}let l=i.get(a);if(l||(Ft(a,null,t),l=i.get(a)),l?.res===void 0){const d="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(d)}if(s>=0&&(l.count+=1,l.aliasCount===0&&(l.aliasCount=Ss(r,a,i)),l.count*l.aliasCount>s)){const d="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(d)}return l.res}toString(e,t,i){const r=`*${this.source}`;if(e){if(uf(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${r} `}return r}}function Ss(n,e,t){if(ai(e)){const i=e.resolve(n),r=t&&i&&t.get(i);return r?r.count*r.aliasCount:0}else if(Qe(e)){let i=0;for(const r of e.items){const s=Ss(n,r,t);s>i&&(i=s)}return i}else if(et(e)){const i=Ss(n,e.key,t),r=Ss(n,e.value,t);return Math.max(i,r)}return 1}const pf=n=>!n||typeof n!="function"&&typeof n!="object";class we extends fc{constructor(e){super(nn),this.value=e}toJSON(e,t){return t?.keep?this.value:Ft(this.value,e,t)}toString(){return String(this.value)}}we.BLOCK_FOLDED="BLOCK_FOLDED";we.BLOCK_LITERAL="BLOCK_LITERAL";we.PLAIN="PLAIN";we.QUOTE_DOUBLE="QUOTE_DOUBLE";we.QUOTE_SINGLE="QUOTE_SINGLE";const Ag="tag:yaml.org,2002:";function Pg(n,e,t){if(e){const i=t.filter(s=>s.tag===e),r=i.find(s=>!s.format)??i[0];if(!r)throw new Error(`Tag ${e} not found`);return r}return t.find(i=>i.identify?.(n)&&!i.format)}function kr(n,e,t){if(Or(n)&&(n=n.contents),Xe(n))return n;if(et(n)){const v=t.schema[Mn].createNode?.(t.schema,null,t);return v.items.push(n),v}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:i,onAnchor:r,onTagObj:s,schema:a,sourceObjects:l}=t;let d;if(i&&n&&typeof n=="object"){if(d=l.get(n),d)return d.anchor??(d.anchor=r(n)),new dc(d.anchor);d={anchor:null,node:null},l.set(n,d)}e?.startsWith("!!")&&(e=Ag+e.slice(2));let h=Pg(n,e,a.tags);if(!h){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const v=new we(n);return d&&(d.node=v),v}h=n instanceof Map?a[Mn]:Symbol.iterator in Object(n)?a[Mi]:a[Mn]}s&&(s(h),delete t.onTagObj);const m=h?.createNode?h.createNode(t.schema,n,t):typeof h?.nodeClass?.from=="function"?h.nodeClass.from(t.schema,n,t):new we(n);return e?m.tag=e:h.default||(m.tag=h.tag),d&&(d.node=m),m}function Ms(n,e,t){let i=t;for(let r=e.length-1;r>=0;--r){const s=e[r];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const a=[];a[s]=i,i=a}else i=new Map([[s,i]])}return kr(i,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const nr=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class hf extends fc{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(i=>Xe(i)||et(i)?i.clone(e):i),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(nr(e))this.add(t);else{const[i,...r]=e,s=this.get(i,!0);if(Qe(s))s.addIn(r,t);else if(s===void 0&&this.schema)this.set(i,Ms(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}deleteIn(e){const[t,...i]=e;if(i.length===0)return this.delete(t);const r=this.get(t,!0);if(Qe(r))return r.deleteIn(i);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${i}`)}getIn(e,t){const[i,...r]=e,s=this.get(i,!0);return r.length===0?!t&&De(s)?s.value:s:Qe(s)?s.getIn(r,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!et(t))return!1;const i=t.value;return i==null||e&&De(i)&&i.value==null&&!i.commentBefore&&!i.comment&&!i.tag})}hasIn(e){const[t,...i]=e;if(i.length===0)return this.has(t);const r=this.get(t,!0);return Qe(r)?r.hasIn(i):!1}setIn(e,t){const[i,...r]=e;if(r.length===0)this.set(i,t);else{const s=this.get(i,!0);if(Qe(s))s.setIn(r,t);else if(s===void 0&&this.schema)this.set(i,Ms(this.schema,r,t));else throw new Error(`Expected YAML collection at ${i}. Remaining path: ${r}`)}}}const Tg=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function un(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const Xn=(n,e,t)=>n.endsWith(`
|
|
52
|
-
`)?un(t,e):t.includes(`
|
|
53
|
-
`)?`
|
|
54
|
-
`+un(t,e):(n.endsWith(" ")?"":" ")+t,gf="flow",Ca="block",ks="quoted";function Hs(n,e,t="flow",{indentAtStart:i,lineWidth:r=80,minContentWidth:s=20,onFold:a,onOverflow:l}={}){if(!r||r<0)return n;r<s&&(s=0);const d=Math.max(1+s,1+r-e.length);if(n.length<=d)return n;const h=[],m={};let v=r-e.length;typeof i=="number"&&(i>r-Math.max(2,s)?h.push(0):v=r-i);let w,P,K=!1,A=-1,D=-1,z=-1;t===Ca&&(A=ql(n,A,e.length),A!==-1&&(v=A+d));for(let ie;ie=n[A+=1];){if(t===ks&&ie==="\\"){switch(D=A,n[A+1]){case"x":A+=3;break;case"u":A+=5;break;case"U":A+=9;break;default:A+=1}z=A}if(ie===`
|
|
55
|
-
`)t===Ca&&(A=ql(n,A,e.length)),v=A+e.length+d,w=void 0;else{if(ie===" "&&P&&P!==" "&&P!==`
|
|
56
|
-
`&&P!==" "){const J=n[A+1];J&&J!==" "&&J!==`
|
|
57
|
-
`&&J!==" "&&(w=A)}if(A>=v)if(w)h.push(w),v=w+d,w=void 0;else if(t===ks){for(;P===" "||P===" ";)P=ie,ie=n[A+=1],K=!0;const J=A>z+1?A-2:D-1;if(m[J])return n;h.push(J),m[J]=!0,v=J+d,w=void 0}else K=!0}P=ie}if(K&&l&&l(),h.length===0)return n;a&&a();let H=n.slice(0,h[0]);for(let ie=0;ie<h.length;++ie){const J=h[ie],ne=h[ie+1]||n.length;J===0?H=`
|
|
58
|
-
${e}${n.slice(0,ne)}`:(t===ks&&m[J]&&(H+=`${n[J]}\\`),H+=`
|
|
59
|
-
${e}${n.slice(J+1,ne)}`)}return H}function ql(n,e,t){let i=e,r=e+1,s=n[r];for(;s===" "||s===" ";)if(e<r+t)s=n[++e];else{do s=n[++e];while(s&&s!==`
|
|
60
|
-
`);i=e,r=e+1,s=n[r]}return i}const Gs=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),Ys=n=>/^(%|---|\.\.\.)/m.test(n);function Ng(n,e,t){if(!e||e<0)return!1;const i=e-t,r=n.length;if(r<=i)return!1;for(let s=0,a=0;s<r;++s)if(n[s]===`
|
|
61
|
-
`){if(s-a>i)return!0;if(a=s+1,r-a<=i)return!1}return!0}function hr(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:i}=e,r=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(Ys(n)?" ":"");let a="",l=0;for(let d=0,h=t[d];h;h=t[++d])if(h===" "&&t[d+1]==="\\"&&t[d+2]==="n"&&(a+=t.slice(l,d)+"\\ ",d+=1,l=d,h="\\"),h==="\\")switch(t[d+1]){case"u":{a+=t.slice(l,d);const m=t.substr(d+2,4);switch(m){case"0000":a+="\\0";break;case"0007":a+="\\a";break;case"000b":a+="\\v";break;case"001b":a+="\\e";break;case"0085":a+="\\N";break;case"00a0":a+="\\_";break;case"2028":a+="\\L";break;case"2029":a+="\\P";break;default:m.substr(0,2)==="00"?a+="\\x"+m.substr(2):a+=t.substr(d,6)}d+=5,l=d+1}break;case"n":if(i||t[d+2]==='"'||t.length<r)d+=1;else{for(a+=t.slice(l,d)+`
|
|
62
|
-
|
|
63
|
-
`;t[d+2]==="\\"&&t[d+3]==="n"&&t[d+4]!=='"';)a+=`
|
|
64
|
-
`,d+=2;a+=s,t[d+2]===" "&&(a+="\\"),d+=1,l=d+1}break;default:d+=1}return a=l?a+t.slice(l):t,i?a:Hs(a,s,ks,Gs(e,!1))}function Ea(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
65
|
-
`)||/[ \t]\n|\n[ \t]/.test(n))return hr(n,e);const t=e.indent||(Ys(n)?" ":""),i="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
66
|
-
${t}`)+"'";return e.implicitKey?i:Hs(i,t,gf,Gs(e,!1))}function Ii(n,e){const{singleQuote:t}=e.options;let i;if(t===!1)i=hr;else{const r=n.includes('"'),s=n.includes("'");r&&!s?i=Ea:s&&!r?i=hr:i=t?Ea:hr}return i(n,e)}let Ia;try{Ia=new RegExp(`(^|(?<!
|
|
67
|
-
))
|
|
68
|
-
+(?!
|
|
69
|
-
|$)`,"g")}catch{Ia=/\n+(?!\n|$)/g}function _s({comment:n,type:e,value:t},i,r,s){const{blockQuote:a,commentString:l,lineWidth:d}=i.options;if(!a||/\n[\t ]+$/.test(t))return Ii(t,i);const h=i.indent||(i.forceBlockIndent||Ys(t)?" ":""),m=a==="literal"?!0:a==="folded"||e===we.BLOCK_FOLDED?!1:e===we.BLOCK_LITERAL?!0:!Ng(t,d,h.length);if(!t)return m?`|
|
|
70
|
-
`:`>
|
|
71
|
-
`;let v,w;for(w=t.length;w>0;--w){const ne=t[w-1];if(ne!==`
|
|
72
|
-
`&&ne!==" "&&ne!==" ")break}let P=t.substring(w);const K=P.indexOf(`
|
|
73
|
-
`);K===-1?v="-":t===P||K!==P.length-1?(v="+",s&&s()):v="",P&&(t=t.slice(0,-P.length),P[P.length-1]===`
|
|
74
|
-
`&&(P=P.slice(0,-1)),P=P.replace(Ia,`$&${h}`));let A=!1,D,z=-1;for(D=0;D<t.length;++D){const ne=t[D];if(ne===" ")A=!0;else if(ne===`
|
|
75
|
-
`)z=D;else break}let H=t.substring(0,z<D?z+1:D);H&&(t=t.substring(H.length),H=H.replace(/\n+/g,`$&${h}`));let J=(A?h?"2":"1":"")+v;if(n&&(J+=" "+l(n.replace(/ ?[\r\n]+/g," ")),r&&r()),!m){const ne=t.replace(/\n+/g,`
|
|
76
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let ue=!1;const pe=Gs(i,!0);a!=="folded"&&e!==we.BLOCK_FOLDED&&(pe.onOverflow=()=>{ue=!0});const Q=Hs(`${H}${ne}${P}`,h,Ca,pe);if(!ue)return`>${J}
|
|
77
|
-
${h}${Q}`}return t=t.replace(/\n+/g,`$&${h}`),`|${J}
|
|
78
|
-
${h}${H}${t}${P}`}function jg(n,e,t,i){const{type:r,value:s}=n,{actualString:a,implicitKey:l,indent:d,indentStep:h,inFlow:m}=e;if(l&&s.includes(`
|
|
79
|
-
`)||m&&/[[\]{},]/.test(s))return Ii(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return l||m||!s.includes(`
|
|
80
|
-
`)?Ii(s,e):_s(n,e,t,i);if(!l&&!m&&r!==we.PLAIN&&s.includes(`
|
|
81
|
-
`))return _s(n,e,t,i);if(Ys(s)){if(d==="")return e.forceBlockIndent=!0,_s(n,e,t,i);if(l&&d===h)return Ii(s,e)}const v=s.replace(/\n+/g,`$&
|
|
82
|
-
${d}`);if(a){const w=A=>A.default&&A.tag!=="tag:yaml.org,2002:str"&&A.test?.test(v),{compat:P,tags:K}=e.doc.schema;if(K.some(w)||P?.some(w))return Ii(s,e)}return l?v:Hs(v,d,gf,Gs(e,!1))}function pc(n,e,t,i){const{implicitKey:r,inFlow:s}=e,a=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:l}=n;l!==we.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(a.value)&&(l=we.QUOTE_DOUBLE);const d=m=>{switch(m){case we.BLOCK_FOLDED:case we.BLOCK_LITERAL:return r||s?Ii(a.value,e):_s(a,e,t,i);case we.QUOTE_DOUBLE:return hr(a.value,e);case we.QUOTE_SINGLE:return Ea(a.value,e);case we.PLAIN:return jg(a,e,t,i);default:return null}};let h=d(l);if(h===null){const{defaultKeyType:m,defaultStringType:v}=e.options,w=r&&m||v;if(h=d(w),h===null)throw new Error(`Unsupported default string type ${w}`)}return h}function mf(n,e){const t=Object.assign({blockQuote:!0,commentString:Tg,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let i;switch(t.collectionStyle){case"block":i=!1;break;case"flow":i=!0;break;default:i=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:i,options:t}}function Mg(n,e){if(e.tag){const r=n.filter(s=>s.tag===e.tag);if(r.length>0)return r.find(s=>s.format===e.format)??r[0]}let t,i;if(De(e)){i=e.value;let r=n.filter(s=>s.identify?.(i));if(r.length>1){const s=r.filter(a=>a.test);s.length>0&&(r=s)}t=r.find(s=>s.format===e.format)??r.find(s=>!s.format)}else i=e,t=n.find(r=>r.nodeClass&&i instanceof r.nodeClass);if(!t){const r=i?.constructor?.name??(i===null?"null":typeof i);throw new Error(`Tag not resolved for ${r} value`)}return t}function Rg(n,e,{anchors:t,doc:i}){if(!i.directives)return"";const r=[],s=(De(n)||Qe(n))&&n.anchor;s&&uf(s)&&(t.add(s),r.push(`&${s}`));const a=n.tag??(e.default?null:e.tag);return a&&r.push(i.directives.tagString(a)),r.join(" ")}function Ni(n,e,t,i){if(et(n))return n.toString(e,t,i);if(ai(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let r;const s=Xe(n)?n:e.doc.createNode(n,{onTagObj:d=>r=d});r??(r=Mg(e.doc.schema.tags,s));const a=Rg(s,r,e);a.length>0&&(e.indentAtStart=(e.indentAtStart??0)+a.length+1);const l=typeof r.stringify=="function"?r.stringify(s,e,t,i):De(s)?pc(s,e,t,i):s.toString(e,t,i);return a?De(s)||l[0]==="{"||l[0]==="["?`${a} ${l}`:`${a}
|
|
83
|
-
${e.indent}${l}`:l}function $g({key:n,value:e},t,i,r){const{allNullValues:s,doc:a,indent:l,indentStep:d,options:{commentString:h,indentSeq:m,simpleKeys:v}}=t;let w=Xe(n)&&n.comment||null;if(v){if(w)throw new Error("With simple keys, key nodes cannot have comments");if(Qe(n)||!Xe(n)&&typeof n=="object"){const pe="With simple keys, collection cannot be used as a key value";throw new Error(pe)}}let P=!v&&(!n||w&&e==null&&!t.inFlow||Qe(n)||(De(n)?n.type===we.BLOCK_FOLDED||n.type===we.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!P&&(v||!s),indent:l+d});let K=!1,A=!1,D=Ni(n,t,()=>K=!0,()=>A=!0);if(!P&&!t.inFlow&&D.length>1024){if(v)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");P=!0}if(t.inFlow){if(s||e==null)return K&&i&&i(),D===""?"?":P?`? ${D}`:D}else if(s&&!v||e==null&&P)return D=`? ${D}`,w&&!K?D+=Xn(D,t.indent,h(w)):A&&r&&r(),D;K&&(w=null),P?(w&&(D+=Xn(D,t.indent,h(w))),D=`? ${D}
|
|
84
|
-
${l}:`):(D=`${D}:`,w&&(D+=Xn(D,t.indent,h(w))));let z,H,ie;Xe(e)?(z=!!e.spaceBefore,H=e.commentBefore,ie=e.comment):(z=!1,H=null,ie=null,e&&typeof e=="object"&&(e=a.createNode(e))),t.implicitKey=!1,!P&&!w&&De(e)&&(t.indentAtStart=D.length+1),A=!1,!m&&d.length>=2&&!t.inFlow&&!P&&Pr(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let J=!1;const ne=Ni(e,t,()=>J=!0,()=>A=!0);let ue=" ";if(w||z||H){if(ue=z?`
|
|
85
|
-
`:"",H){const pe=h(H);ue+=`
|
|
86
|
-
${un(pe,t.indent)}`}ne===""&&!t.inFlow?ue===`
|
|
87
|
-
`&&ie&&(ue=`
|
|
88
|
-
|
|
89
|
-
`):ue+=`
|
|
90
|
-
${t.indent}`}else if(!P&&Qe(e)){const pe=ne[0],Q=ne.indexOf(`
|
|
91
|
-
`),ge=Q!==-1,Re=t.inFlow??e.flow??e.items.length===0;if(ge||!Re){let We=!1;if(ge&&(pe==="&"||pe==="!")){let _e=ne.indexOf(" ");pe==="&"&&_e!==-1&&_e<Q&&ne[_e+1]==="!"&&(_e=ne.indexOf(" ",_e+1)),(_e===-1||Q<_e)&&(We=!0)}We||(ue=`
|
|
92
|
-
${t.indent}`)}}else(ne===""||ne[0]===`
|
|
93
|
-
`)&&(ue="");return D+=ue+ne,t.inFlow?J&&i&&i():ie&&!J?D+=Xn(D,t.indent,h(ie)):A&&r&&r(),D}function vf(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const us="<<",pn={identify:n=>n===us||typeof n=="symbol"&&n.description===us,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new we(Symbol(us)),{addToJSMap:yf}),stringify:()=>us},Lg=(n,e)=>(pn.identify(e)||De(e)&&(!e.type||e.type===we.PLAIN)&&pn.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===pn.tag&&t.default);function yf(n,e,t){if(t=n&&ai(t)?t.resolve(n.doc):t,Pr(t))for(const i of t.items)qo(n,e,i);else if(Array.isArray(t))for(const i of t)qo(n,e,i);else qo(n,e,t)}function qo(n,e,t){const i=n&&ai(t)?t.resolve(n.doc):t;if(!Ar(i))throw new Error("Merge sources must be maps or map aliases");const r=i.toJSON(null,n,Map);for(const[s,a]of r)e instanceof Map?e.has(s)||e.set(s,a):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0});return e}function bf(n,e,{key:t,value:i}){if(Xe(t)&&t.addToJSMap)t.addToJSMap(n,e,i);else if(Lg(n,t))yf(n,e,i);else{const r=Ft(t,"",n);if(e instanceof Map)e.set(r,Ft(i,r,n));else if(e instanceof Set)e.add(r);else{const s=Bg(t,r,n),a=Ft(i,s,n);s in e?Object.defineProperty(e,s,{value:a,writable:!0,enumerable:!0,configurable:!0}):e[s]=a}}return e}function Bg(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(Xe(n)&&t?.doc){const i=mf(t.doc,{});i.anchors=new Set;for(const s of t.anchors.keys())i.anchors.add(s.anchor);i.inFlow=!0,i.inStringifyKey=!0;const r=n.toString(i);if(!t.mapKeyWarned){let s=JSON.stringify(r);s.length>40&&(s=s.substring(0,36)+'..."'),vf(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return r}return JSON.stringify(e)}function hc(n,e,t){const i=kr(n,void 0,t),r=kr(e,void 0,t);return new xt(i,r)}class xt{constructor(e,t=null){Object.defineProperty(this,Ut,{value:cf}),this.key=e,this.value=t}clone(e){let{key:t,value:i}=this;return Xe(t)&&(t=t.clone(e)),Xe(i)&&(i=i.clone(e)),new xt(t,i)}toJSON(e,t){const i=t?.mapAsMap?new Map:{};return bf(t,i,this)}toString(e,t,i){return e?.doc?$g(this,e,t,i):JSON.stringify(this)}}function wf(n,e,t){return(e.inFlow??n.flow?Dg:Fg)(n,e,t)}function Fg({comment:n,items:e},t,{blockItemPrefix:i,flowChars:r,itemIndent:s,onChompKeep:a,onComment:l}){const{indent:d,options:{commentString:h}}=t,m=Object.assign({},t,{indent:s,type:null});let v=!1;const w=[];for(let K=0;K<e.length;++K){const A=e[K];let D=null;if(Xe(A))!v&&A.spaceBefore&&w.push(""),Rs(t,w,A.commentBefore,v),A.comment&&(D=A.comment);else if(et(A)){const H=Xe(A.key)?A.key:null;H&&(!v&&H.spaceBefore&&w.push(""),Rs(t,w,H.commentBefore,v))}v=!1;let z=Ni(A,m,()=>D=null,()=>v=!0);D&&(z+=Xn(z,s,h(D))),v&&D&&(v=!1),w.push(i+z)}let P;if(w.length===0)P=r.start+r.end;else{P=w[0];for(let K=1;K<w.length;++K){const A=w[K];P+=A?`
|
|
94
|
-
${d}${A}`:`
|
|
95
|
-
`}}return n?(P+=`
|
|
96
|
-
`+un(h(n),d),l&&l()):v&&a&&a(),P}function Dg({items:n},e,{flowChars:t,itemIndent:i}){const{indent:r,indentStep:s,flowCollectionPadding:a,options:{commentString:l}}=e;i+=s;const d=Object.assign({},e,{indent:i,inFlow:!0,type:null});let h=!1,m=0;const v=[];for(let K=0;K<n.length;++K){const A=n[K];let D=null;if(Xe(A))A.spaceBefore&&v.push(""),Rs(e,v,A.commentBefore,!1),A.comment&&(D=A.comment);else if(et(A)){const H=Xe(A.key)?A.key:null;H&&(H.spaceBefore&&v.push(""),Rs(e,v,H.commentBefore,!1),H.comment&&(h=!0));const ie=Xe(A.value)?A.value:null;ie?(ie.comment&&(D=ie.comment),ie.commentBefore&&(h=!0)):A.value==null&&H?.comment&&(D=H.comment)}D&&(h=!0);let z=Ni(A,d,()=>D=null);h||(h=v.length>m||z.includes(`
|
|
97
|
-
`)),K<n.length-1?z+=",":e.options.trailingComma&&(e.options.lineWidth>0&&(h||(h=v.reduce((H,ie)=>H+ie.length+2,2)+(z.length+2)>e.options.lineWidth)),h&&(z+=",")),D&&(z+=Xn(z,i,l(D))),v.push(z),m=v.length}const{start:w,end:P}=t;if(v.length===0)return w+P;if(!h){const K=v.reduce((A,D)=>A+D.length+2,2);h=e.options.lineWidth>0&&K>e.options.lineWidth}if(h){let K=w;for(const A of v)K+=A?`
|
|
98
|
-
${s}${r}${A}`:`
|
|
99
|
-
`;return`${K}
|
|
100
|
-
${r}${P}`}else return`${w}${a}${v.join(" ")}${a}${P}`}function Rs({indent:n,options:{commentString:e}},t,i,r){if(i&&r&&(i=i.replace(/^\n+/,"")),i){const s=un(e(i),n);t.push(s.trimStart())}}function Zn(n,e){const t=De(e)?e.value:e;for(const i of n)if(et(i)&&(i.key===e||i.key===t||De(i.key)&&i.key.value===t))return i}class $t extends hf{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Mn,e),this.items=[]}static from(e,t,i){const{keepUndefined:r,replacer:s}=i,a=new this(e),l=(d,h)=>{if(typeof s=="function")h=s.call(t,d,h);else if(Array.isArray(s)&&!s.includes(d))return;(h!==void 0||r)&&a.items.push(hc(d,h,i))};if(t instanceof Map)for(const[d,h]of t)l(d,h);else if(t&&typeof t=="object")for(const d of Object.keys(t))l(d,t[d]);return typeof e.sortMapEntries=="function"&&a.items.sort(e.sortMapEntries),a}add(e,t){let i;et(e)?i=e:!e||typeof e!="object"||!("key"in e)?i=new xt(e,e?.value):i=new xt(e.key,e.value);const r=Zn(this.items,i.key),s=this.schema?.sortMapEntries;if(r){if(!t)throw new Error(`Key ${i.key} already set`);De(r.value)&&pf(i.value)?r.value.value=i.value:r.value=i.value}else if(s){const a=this.items.findIndex(l=>s(i,l)<0);a===-1?this.items.push(i):this.items.splice(a,0,i)}else this.items.push(i)}delete(e){const t=Zn(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const r=Zn(this.items,e)?.value;return(!t&&De(r)?r.value:r)??void 0}has(e){return!!Zn(this.items,e)}set(e,t){this.add(new xt(e,t),!0)}toJSON(e,t,i){const r=i?new i:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(r);for(const s of this.items)bf(t,r,s);return r}toString(e,t,i){if(!e)return JSON.stringify(this);for(const r of this.items)if(!et(r))throw new Error(`Map items must all be pairs; found ${JSON.stringify(r)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),wf(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:i,onComment:t})}}const $i={collection:"map",default:!0,nodeClass:$t,tag:"tag:yaml.org,2002:map",resolve(n,e){return Ar(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>$t.from(n,e,t)};class oi extends hf{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(Mi,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=fs(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const i=fs(e);if(typeof i!="number")return;const r=this.items[i];return!t&&De(r)?r.value:r}has(e){const t=fs(e);return typeof t=="number"&&t<this.items.length}set(e,t){const i=fs(e);if(typeof i!="number")throw new Error(`Expected a valid index, not ${e}.`);const r=this.items[i];De(r)&&pf(t)?r.value=t:this.items[i]=t}toJSON(e,t){const i=[];t?.onCreate&&t.onCreate(i);let r=0;for(const s of this.items)i.push(Ft(s,String(r++),t));return i}toString(e,t,i){return e?wf(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:i,onComment:t}):JSON.stringify(this)}static from(e,t,i){const{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t)){let a=0;for(let l of t){if(typeof r=="function"){const d=t instanceof Set?l:String(a++);l=r.call(t,d,l)}s.items.push(kr(l,void 0,i))}}return s}}function fs(n){let e=De(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const Li={collection:"seq",default:!0,nodeClass:oi,tag:"tag:yaml.org,2002:seq",resolve(n,e){return Pr(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>oi.from(n,e,t)},Js={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,i){return e=Object.assign({actualString:!0},e),pc(n,e,t,i)}},Qs={identify:n=>n==null,createNode:()=>new we(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new we(null),stringify:({source:n},e)=>typeof n=="string"&&Qs.test.test(n)?n:e.options.nullStr},gc={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new we(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&gc.test.test(n)){const i=n[0]==="t"||n[0]==="T";if(e===i)return n}return e?t.options.trueStr:t.options.falseStr}};function Yt({format:n,minFractionDigits:e,tag:t,value:i}){if(typeof i=="bigint")return String(i);const r=typeof i=="number"?i:Number(i);if(!isFinite(r))return isNaN(r)?".nan":r<0?"-.inf":".inf";let s=Object.is(i,-0)?"-0":JSON.stringify(i);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let a=s.indexOf(".");a<0&&(a=s.length,s+=".");let l=e-(s.length-a-1);for(;l-- >0;)s+="0"}return s}const xf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yt},Sf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Yt(n)}},kf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new we(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Yt},Xs=n=>typeof n=="bigint"||Number.isInteger(n),mc=(n,e,t,{intAsBigInt:i})=>i?BigInt(n):parseInt(n.substring(e),t);function _f(n,e,t){const{value:i}=n;return Xs(i)&&i>=0?t+i.toString(e):Yt(n)}const Cf={identify:n=>Xs(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>mc(n,2,8,t),stringify:n=>_f(n,8,"0o")},Ef={identify:Xs,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>mc(n,0,10,t),stringify:Yt},If={identify:n=>Xs(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>mc(n,2,16,t),stringify:n=>_f(n,16,"0x")},Kg=[$i,Li,Js,Qs,gc,Cf,Ef,If,xf,Sf,kf];function Ul(n){return typeof n=="bigint"||Number.isInteger(n)}const ds=({value:n})=>JSON.stringify(n),qg=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:ds},{identify:n=>n==null,createNode:()=>new we(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:ds},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:ds},{identify:Ul,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Ul(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:ds}],Ug={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},zg=[$i,Li].concat(qg,Ug),vc={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),i=new Uint8Array(t.length);for(let r=0;r<t.length;++r)i[r]=t.charCodeAt(r);return i}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},i,r,s){if(!t)return"";const a=t;let l;if(typeof btoa=="function"){let d="";for(let h=0;h<a.length;++h)d+=String.fromCharCode(a[h]);l=btoa(d)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=we.BLOCK_LITERAL),e!==we.QUOTE_DOUBLE){const d=Math.max(i.options.lineWidth-i.indent.length,i.options.minContentWidth),h=Math.ceil(l.length/d),m=new Array(h);for(let v=0,w=0;v<h;++v,w+=d)m[v]=l.substr(w,d);l=m.join(e===we.BLOCK_LITERAL?`
|
|
101
|
-
`:" ")}return pc({comment:n,type:e,value:l},i,r,s)}};function Of(n,e){if(Pr(n))for(let t=0;t<n.items.length;++t){let i=n.items[t];if(!et(i)){if(Ar(i)){i.items.length>1&&e("Each pair must have its own sequence indicator");const r=i.items[0]||new xt(new we(null));if(i.commentBefore&&(r.key.commentBefore=r.key.commentBefore?`${i.commentBefore}
|
|
102
|
-
${r.key.commentBefore}`:i.commentBefore),i.comment){const s=r.value??r.key;s.comment=s.comment?`${i.comment}
|
|
103
|
-
${s.comment}`:i.comment}i=r}n.items[t]=et(i)?i:new xt(i)}}else e("Expected a sequence for this tag");return n}function Af(n,e,t){const{replacer:i}=t,r=new oi(n);r.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let a of e){typeof i=="function"&&(a=i.call(e,String(s++),a));let l,d;if(Array.isArray(a))if(a.length===2)l=a[0],d=a[1];else throw new TypeError(`Expected [key, value] tuple: ${a}`);else if(a&&a instanceof Object){const h=Object.keys(a);if(h.length===1)l=h[0],d=a[l];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else l=a;r.items.push(hc(l,d,t))}return r}const yc={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:Of,createNode:Af};class Ai extends oi{constructor(){super(),this.add=$t.prototype.add.bind(this),this.delete=$t.prototype.delete.bind(this),this.get=$t.prototype.get.bind(this),this.has=$t.prototype.has.bind(this),this.set=$t.prototype.set.bind(this),this.tag=Ai.tag}toJSON(e,t){if(!t)return super.toJSON(e);const i=new Map;t?.onCreate&&t.onCreate(i);for(const r of this.items){let s,a;if(et(r)?(s=Ft(r.key,"",t),a=Ft(r.value,s,t)):s=Ft(r,"",t),i.has(s))throw new Error("Ordered maps must not include duplicate keys");i.set(s,a)}return i}static from(e,t,i){const r=Af(e,t,i),s=new this;return s.items=r.items,s}}Ai.tag="tag:yaml.org,2002:omap";const bc={collection:"seq",identify:n=>n instanceof Map,nodeClass:Ai,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=Of(n,e),i=[];for(const{key:r}of t.items)De(r)&&(i.includes(r.value)?e(`Ordered maps must not include duplicate keys: ${r.value}`):i.push(r.value));return Object.assign(new Ai,t)},createNode:(n,e,t)=>Ai.from(n,e,t)};function Pf({value:n,source:e},t){return e&&(n?Tf:Nf).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const Tf={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new we(!0),stringify:Pf},Nf={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new we(!1),stringify:Pf},Vg={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Yt},Wg={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Yt(n)}},Hg={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new we(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const i=n.substring(t+1).replace(/_/g,"");i[i.length-1]==="0"&&(e.minFractionDigits=i.length)}return e},stringify:Yt},Tr=n=>typeof n=="bigint"||Number.isInteger(n);function Zs(n,e,t,{intAsBigInt:i}){const r=n[0];if((r==="-"||r==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),i){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const a=BigInt(n);return r==="-"?BigInt(-1)*a:a}const s=parseInt(n,t);return r==="-"?-1*s:s}function wc(n,e,t){const{value:i}=n;if(Tr(i)){const r=i.toString(e);return i<0?"-"+t+r.substr(1):t+r}return Yt(n)}const Gg={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Zs(n,2,2,t),stringify:n=>wc(n,2,"0b")},Yg={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Zs(n,1,8,t),stringify:n=>wc(n,8,"0")},Jg={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Zs(n,0,10,t),stringify:Yt},Qg={identify:Tr,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Zs(n,2,16,t),stringify:n=>wc(n,16,"0x")};class Pi extends $t{constructor(e){super(e),this.tag=Pi.tag}add(e){let t;et(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new xt(e.key,null):t=new xt(e,null),Zn(this.items,t.key)||this.items.push(t)}get(e,t){const i=Zn(this.items,e);return!t&&et(i)?De(i.key)?i.key.value:i.key:i}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const i=Zn(this.items,e);i&&!t?this.items.splice(this.items.indexOf(i),1):!i&&t&&this.items.push(new xt(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,i){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,i);throw new Error("Set items must all have null values")}static from(e,t,i){const{replacer:r}=i,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let a of t)typeof r=="function"&&(a=r.call(t,a,a)),s.items.push(hc(a,null,i));return s}}Pi.tag="tag:yaml.org,2002:set";const xc={collection:"map",identify:n=>n instanceof Set,nodeClass:Pi,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>Pi.from(n,e,t),resolve(n,e){if(Ar(n)){if(n.hasAllNullValues(!0))return Object.assign(new Pi,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function Sc(n,e){const t=n[0],i=t==="-"||t==="+"?n.substring(1):n,r=a=>e?BigInt(a):Number(a),s=i.replace(/_/g,"").split(":").reduce((a,l)=>a*r(60)+r(l),r(0));return t==="-"?r(-1)*s:s}function jf(n){let{value:e}=n,t=a=>a;if(typeof e=="bigint")t=a=>BigInt(a);else if(isNaN(e)||!isFinite(e))return Yt(n);let i="";e<0&&(i="-",e*=t(-1));const r=t(60),s=[e%r];return e<60?s.unshift(0):(e=(e-s[0])/r,s.unshift(e%r),e>=60&&(e=(e-s[0])/r,s.unshift(e))),i+s.map(a=>String(a).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Mf={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>Sc(n,t),stringify:jf},Rf={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>Sc(n,!1),stringify:jf},eo={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(eo.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,i,r,s,a,l]=e.map(Number),d=e[7]?Number((e[7]+"00").substr(1,3)):0;let h=Date.UTC(t,i-1,r,s||0,a||0,l||0,d);const m=e[8];if(m&&m!=="Z"){let v=Sc(m,!1);Math.abs(v)<30&&(v*=60),h-=6e4*v}return new Date(h)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},zl=[$i,Li,Js,Qs,Tf,Nf,Gg,Yg,Jg,Qg,Vg,Wg,Hg,vc,pn,bc,yc,xc,Mf,Rf,eo],Vl=new Map([["core",Kg],["failsafe",[$i,Li,Js]],["json",zg],["yaml11",zl],["yaml-1.1",zl]]),Wl={binary:vc,bool:gc,float:kf,floatExp:Sf,floatNaN:xf,floatTime:Rf,int:Ef,intHex:If,intOct:Cf,intTime:Mf,map:$i,merge:pn,null:Qs,omap:bc,pairs:yc,seq:Li,set:xc,timestamp:eo},Xg={"tag:yaml.org,2002:binary":vc,"tag:yaml.org,2002:merge":pn,"tag:yaml.org,2002:omap":bc,"tag:yaml.org,2002:pairs":yc,"tag:yaml.org,2002:set":xc,"tag:yaml.org,2002:timestamp":eo};function Uo(n,e,t){const i=Vl.get(e);if(i&&!n)return t&&!i.includes(pn)?i.concat(pn):i.slice();let r=i;if(!r)if(Array.isArray(n))r=[];else{const s=Array.from(Vl.keys()).filter(a=>a!=="yaml11").map(a=>JSON.stringify(a)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(const s of n)r=r.concat(s);else typeof n=="function"&&(r=n(r.slice()));return t&&(r=r.concat(pn)),r.reduce((s,a)=>{const l=typeof a=="string"?Wl[a]:a;if(!l){const d=JSON.stringify(a),h=Object.keys(Wl).map(m=>JSON.stringify(m)).join(", ");throw new Error(`Unknown custom tag ${d}; use one of ${h}`)}return s.includes(l)||s.push(l),s},[])}const Zg=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;class kc{constructor({compat:e,customTags:t,merge:i,resolveKnownTags:r,schema:s,sortMapEntries:a,toStringDefaults:l}){this.compat=Array.isArray(e)?Uo(e,"compat"):e?Uo(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=r?Xg:{},this.tags=Uo(t,this.name,i),this.toStringOptions=l??null,Object.defineProperty(this,Mn,{value:$i}),Object.defineProperty(this,nn,{value:Js}),Object.defineProperty(this,Mi,{value:Li}),this.sortMapEntries=typeof a=="function"?a:a===!0?Zg:null}clone(){const e=Object.create(kc.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}}function em(n,e){const t=[];let i=e.directives===!0;if(e.directives!==!1&&n.directives){const d=n.directives.toString(n);d?(t.push(d),i=!0):n.directives.docStart&&(i=!0)}i&&t.push("---");const r=mf(n,e),{commentString:s}=r.options;if(n.commentBefore){t.length!==1&&t.unshift("");const d=s(n.commentBefore);t.unshift(un(d,""))}let a=!1,l=null;if(n.contents){if(Xe(n.contents)){if(n.contents.spaceBefore&&i&&t.push(""),n.contents.commentBefore){const m=s(n.contents.commentBefore);t.push(un(m,""))}r.forceBlockIndent=!!n.comment,l=n.contents.comment}const d=l?void 0:()=>a=!0;let h=Ni(n.contents,r,()=>l=null,d);l&&(h+=Xn(h,"",s(l))),(h[0]==="|"||h[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${h}`:t.push(h)}else t.push(Ni(n.contents,r));if(n.directives?.docEnd)if(n.comment){const d=s(n.comment);d.includes(`
|
|
104
|
-
`)?(t.push("..."),t.push(un(d,""))):t.push(`... ${d}`)}else t.push("...");else{let d=n.comment;d&&a&&(d=d.replace(/^\n+/,"")),d&&((!a||l)&&t[t.length-1]!==""&&t.push(""),t.push(un(s(d),"")))}return t.join(`
|
|
105
|
-
`)+`
|
|
106
|
-
`}class Nr{constructor(e,t,i){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Ut,{value:_a});let r=null;typeof t=="function"||Array.isArray(t)?r=t:i===void 0&&t&&(i=t,t=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},i);this.options=s;let{version:a}=s;i?._directives?(this.directives=i._directives.atDocument(),this.directives.yaml.explicit&&(a=this.directives.yaml.version)):this.directives=new bt({version:a}),this.setSchema(a,i),this.contents=e===void 0?null:this.createNode(e,r,i)}clone(){const e=Object.create(Nr.prototype,{[Ut]:{value:_a}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=Xe(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){wi(this.contents)&&this.contents.add(e)}addIn(e,t){wi(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const i=ff(this);e.anchor=!t||i.has(t)?df(t||"a",i):t}return new dc(e.anchor)}createNode(e,t,i){let r;if(typeof t=="function")e=t.call({"":e},"",e),r=t;else if(Array.isArray(t)){const D=H=>typeof H=="number"||H instanceof String||H instanceof Number,z=t.filter(D).map(String);z.length>0&&(t=t.concat(z)),r=t}else i===void 0&&t&&(i=t,t=void 0);const{aliasDuplicateObjects:s,anchorPrefix:a,flow:l,keepUndefined:d,onTagObj:h,tag:m}=i??{},{onAnchor:v,setAnchors:w,sourceObjects:P}=Og(this,a||"a"),K={aliasDuplicateObjects:s??!0,keepUndefined:d??!1,onAnchor:v,onTagObj:h,replacer:r,schema:this.schema,sourceObjects:P},A=kr(e,m,K);return l&&Qe(A)&&(A.flow=!0),w(),A}createPair(e,t,i={}){const r=this.createNode(e,null,i),s=this.createNode(t,null,i);return new xt(r,s)}delete(e){return wi(this.contents)?this.contents.delete(e):!1}deleteIn(e){return nr(e)?this.contents==null?!1:(this.contents=null,!0):wi(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return Qe(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return nr(e)?!t&&De(this.contents)?this.contents.value:this.contents:Qe(this.contents)?this.contents.getIn(e,t):void 0}has(e){return Qe(this.contents)?this.contents.has(e):!1}hasIn(e){return nr(e)?this.contents!==void 0:Qe(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=Ms(this.schema,[e],t):wi(this.contents)&&this.contents.set(e,t)}setIn(e,t){nr(e)?this.contents=t:this.contents==null?this.contents=Ms(this.schema,Array.from(e),t):wi(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let i;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new bt({version:"1.1"}),i={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new bt({version:e}),i={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,i=null;break;default:{const r=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${r}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(i)this.schema=new kc(Object.assign(i,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:i,maxAliasCount:r,onAnchor:s,reviver:a}={}){const l={anchors:new Map,doc:this,keep:!e,mapAsMap:i===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},d=Ft(this.contents,t??"",l);if(typeof s=="function")for(const{count:h,res:m}of l.anchors.values())s(m,h);return typeof a=="function"?Ei(a,{"":d},"",d):d}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return em(this,e)}}function wi(n){if(Qe(n))return!0;throw new Error("Expected a YAML collection as document contents")}class $f extends Error{constructor(e,t,i,r){super(),this.name=e,this.code=i,this.message=r,this.pos=t}}class ir extends $f{constructor(e,t,i){super("YAMLParseError",e,t,i)}}class tm extends $f{constructor(e,t,i){super("YAMLWarning",e,t,i)}}const Hl=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(l=>e.linePos(l));const{line:i,col:r}=t.linePos[0];t.message+=` at line ${i}, column ${r}`;let s=r-1,a=n.substring(e.lineStarts[i-1],e.lineStarts[i]).replace(/[\n\r]+$/,"");if(s>=60&&a.length>80){const l=Math.min(s-39,a.length-79);a="…"+a.substring(l),s-=l-1}if(a.length>80&&(a=a.substring(0,79)+"…"),i>1&&/^ *$/.test(a.substring(0,s))){let l=n.substring(e.lineStarts[i-2],e.lineStarts[i-1]);l.length>80&&(l=l.substring(0,79)+`…
|
|
107
|
-
`),a=l+a}if(/[^ ]/.test(a)){let l=1;const d=t.linePos[1];d?.line===i&&d.col>r&&(l=Math.max(1,Math.min(d.col-r,80-s)));const h=" ".repeat(s)+"^".repeat(l);t.message+=`:
|
|
108
|
-
|
|
109
|
-
${a}
|
|
110
|
-
${h}
|
|
111
|
-
`}};function ji(n,{flow:e,indicator:t,next:i,offset:r,onError:s,parentIndent:a,startOnNewline:l}){let d=!1,h=l,m=l,v="",w="",P=!1,K=!1,A=null,D=null,z=null,H=null,ie=null,J=null,ne=null;for(const Q of n)switch(K&&(Q.type!=="space"&&Q.type!=="newline"&&Q.type!=="comma"&&s(Q.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),K=!1),A&&(h&&Q.type!=="comment"&&Q.type!=="newline"&&s(A,"TAB_AS_INDENT","Tabs are not allowed as indentation"),A=null),Q.type){case"space":!e&&(t!=="doc-start"||i?.type!=="flow-collection")&&Q.source.includes(" ")&&(A=Q),m=!0;break;case"comment":{m||s(Q,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const ge=Q.source.substring(1)||" ";v?v+=w+ge:v=ge,w="",h=!1;break}case"newline":h?v?v+=Q.source:(!J||t!=="seq-item-ind")&&(d=!0):w+=Q.source,h=!0,P=!0,(D||z)&&(H=Q),m=!0;break;case"anchor":D&&s(Q,"MULTIPLE_ANCHORS","A node can have at most one anchor"),Q.source.endsWith(":")&&s(Q.offset+Q.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),D=Q,ne??(ne=Q.offset),h=!1,m=!1,K=!0;break;case"tag":{z&&s(Q,"MULTIPLE_TAGS","A node can have at most one tag"),z=Q,ne??(ne=Q.offset),h=!1,m=!1,K=!0;break}case t:(D||z)&&s(Q,"BAD_PROP_ORDER",`Anchors and tags must be after the ${Q.source} indicator`),J&&s(Q,"UNEXPECTED_TOKEN",`Unexpected ${Q.source} in ${e??"collection"}`),J=Q,h=t==="seq-item-ind"||t==="explicit-key-ind",m=!1;break;case"comma":if(e){ie&&s(Q,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),ie=Q,h=!1,m=!1;break}default:s(Q,"UNEXPECTED_TOKEN",`Unexpected ${Q.type} token`),h=!1,m=!1}const ue=n[n.length-1],pe=ue?ue.offset+ue.source.length:r;return K&&i&&i.type!=="space"&&i.type!=="newline"&&i.type!=="comma"&&(i.type!=="scalar"||i.source!=="")&&s(i.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),A&&(h&&A.indent<=a||i?.type==="block-map"||i?.type==="block-seq")&&s(A,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:ie,found:J,spaceBefore:d,comment:v,hasNewline:P,anchor:D,tag:z,newlineAfterProp:H,end:pe,start:ne??pe}}function _r(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
112
|
-
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(_r(e.key)||_r(e.value))return!0}return!1;default:return!0}}function Oa(n,e,t){if(e?.type==="flow-collection"){const i=e.end[0];i.indent===n&&(i.source==="]"||i.source==="}")&&_r(e)&&t(i,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function Lf(n,e,t){const{uniqueKeys:i}=n.options;if(i===!1)return!1;const r=typeof i=="function"?i:(s,a)=>s===a||De(s)&&De(a)&&s.value===a.value;return e.some(s=>r(s.key,t))}const Gl="All mapping items must start at the same column";function nm({composeNode:n,composeEmptyNode:e},t,i,r,s){const a=s?.nodeClass??$t,l=new a(t.schema);t.atRoot&&(t.atRoot=!1);let d=i.offset,h=null;for(const m of i.items){const{start:v,key:w,sep:P,value:K}=m,A=ji(v,{indicator:"explicit-key-ind",next:w??P?.[0],offset:d,onError:r,parentIndent:i.indent,startOnNewline:!0}),D=!A.found;if(D){if(w&&(w.type==="block-seq"?r(d,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in w&&w.indent!==i.indent&&r(d,"BAD_INDENT",Gl)),!A.anchor&&!A.tag&&!P){h=A.end,A.comment&&(l.comment?l.comment+=`
|
|
113
|
-
`+A.comment:l.comment=A.comment);continue}(A.newlineAfterProp||_r(w))&&r(w??v[v.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else A.found?.indent!==i.indent&&r(d,"BAD_INDENT",Gl);t.atKey=!0;const z=A.end,H=w?n(t,w,A,r):e(t,z,v,null,A,r);t.schema.compat&&Oa(i.indent,w,r),t.atKey=!1,Lf(t,l.items,H)&&r(z,"DUPLICATE_KEY","Map keys must be unique");const ie=ji(P??[],{indicator:"map-value-ind",next:K,offset:H.range[2],onError:r,parentIndent:i.indent,startOnNewline:!w||w.type==="block-scalar"});if(d=ie.end,ie.found){D&&(K?.type==="block-map"&&!ie.hasNewline&&r(d,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&A.start<ie.found.offset-1024&&r(H.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const J=K?n(t,K,ie,r):e(t,d,P,null,ie,r);t.schema.compat&&Oa(i.indent,K,r),d=J.range[2];const ne=new xt(H,J);t.options.keepSourceTokens&&(ne.srcToken=m),l.items.push(ne)}else{D&&r(H.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),ie.comment&&(H.comment?H.comment+=`
|
|
114
|
-
`+ie.comment:H.comment=ie.comment);const J=new xt(H);t.options.keepSourceTokens&&(J.srcToken=m),l.items.push(J)}}return h&&h<d&&r(h,"IMPOSSIBLE","Map comment with trailing content"),l.range=[i.offset,d,h??d],l}function im({composeNode:n,composeEmptyNode:e},t,i,r,s){const a=s?.nodeClass??oi,l=new a(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let d=i.offset,h=null;for(const{start:m,value:v}of i.items){const w=ji(m,{indicator:"seq-item-ind",next:v,offset:d,onError:r,parentIndent:i.indent,startOnNewline:!0});if(!w.found)if(w.anchor||w.tag||v)v?.type==="block-seq"?r(w.end,"BAD_INDENT","All sequence items must start at the same column"):r(d,"MISSING_CHAR","Sequence item without - indicator");else{h=w.end,w.comment&&(l.comment=w.comment);continue}const P=v?n(t,v,w,r):e(t,w.end,m,null,w,r);t.schema.compat&&Oa(i.indent,v,r),d=P.range[2],l.items.push(P)}return l.range=[i.offset,d,h??d],l}function jr(n,e,t,i){let r="";if(n){let s=!1,a="";for(const l of n){const{source:d,type:h}=l;switch(h){case"space":s=!0;break;case"comment":{t&&!s&&i(l,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const m=d.substring(1)||" ";r?r+=a+m:r=m,a="";break}case"newline":r&&(a+=d),s=!0;break;default:i(l,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}e+=d.length}}return{comment:r,offset:e}}const zo="Block collections are not allowed within flow collections",Vo=n=>n&&(n.type==="block-map"||n.type==="block-seq");function rm({composeNode:n,composeEmptyNode:e},t,i,r,s){const a=i.start.source==="{",l=a?"flow map":"flow sequence",d=s?.nodeClass??(a?$t:oi),h=new d(t.schema);h.flow=!0;const m=t.atRoot;m&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let v=i.offset+i.start.source.length;for(let D=0;D<i.items.length;++D){const z=i.items[D],{start:H,key:ie,sep:J,value:ne}=z,ue=ji(H,{flow:l,indicator:"explicit-key-ind",next:ie??J?.[0],offset:v,onError:r,parentIndent:i.indent,startOnNewline:!1});if(!ue.found){if(!ue.anchor&&!ue.tag&&!J&&!ne){D===0&&ue.comma?r(ue.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`):D<i.items.length-1&&r(ue.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${l}`),ue.comment&&(h.comment?h.comment+=`
|
|
115
|
-
`+ue.comment:h.comment=ue.comment),v=ue.end;continue}!a&&t.options.strict&&_r(ie)&&r(ie,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(D===0)ue.comma&&r(ue.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${l}`);else if(ue.comma||r(ue.start,"MISSING_CHAR",`Missing , between ${l} items`),ue.comment){let pe="";e:for(const Q of H)switch(Q.type){case"comma":case"space":break;case"comment":pe=Q.source.substring(1);break e;default:break e}if(pe){let Q=h.items[h.items.length-1];et(Q)&&(Q=Q.value??Q.key),Q.comment?Q.comment+=`
|
|
116
|
-
`+pe:Q.comment=pe,ue.comment=ue.comment.substring(pe.length+1)}}if(!a&&!J&&!ue.found){const pe=ne?n(t,ne,ue,r):e(t,ue.end,J,null,ue,r);h.items.push(pe),v=pe.range[2],Vo(ne)&&r(pe.range,"BLOCK_IN_FLOW",zo)}else{t.atKey=!0;const pe=ue.end,Q=ie?n(t,ie,ue,r):e(t,pe,H,null,ue,r);Vo(ie)&&r(Q.range,"BLOCK_IN_FLOW",zo),t.atKey=!1;const ge=ji(J??[],{flow:l,indicator:"map-value-ind",next:ne,offset:Q.range[2],onError:r,parentIndent:i.indent,startOnNewline:!1});if(ge.found){if(!a&&!ue.found&&t.options.strict){if(J)for(const _e of J){if(_e===ge.found)break;if(_e.type==="newline"){r(_e,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}ue.start<ge.found.offset-1024&&r(ge.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else ne&&("source"in ne&&ne.source?.[0]===":"?r(ne,"MISSING_CHAR",`Missing space after : in ${l}`):r(ge.start,"MISSING_CHAR",`Missing , or : between ${l} items`));const Re=ne?n(t,ne,ge,r):ge.found?e(t,ge.end,J,null,ge,r):null;Re?Vo(ne)&&r(Re.range,"BLOCK_IN_FLOW",zo):ge.comment&&(Q.comment?Q.comment+=`
|
|
117
|
-
`+ge.comment:Q.comment=ge.comment);const We=new xt(Q,Re);if(t.options.keepSourceTokens&&(We.srcToken=z),a){const _e=h;Lf(t,_e.items,Q)&&r(pe,"DUPLICATE_KEY","Map keys must be unique"),_e.items.push(We)}else{const _e=new $t(t.schema);_e.flow=!0,_e.items.push(We);const rt=(Re??Q).range;_e.range=[Q.range[0],rt[1],rt[2]],h.items.push(_e)}v=Re?Re.range[2]:ge.end}}const w=a?"}":"]",[P,...K]=i.end;let A=v;if(P?.source===w)A=P.offset+P.source.length;else{const D=l[0].toUpperCase()+l.substring(1),z=m?`${D} must end with a ${w}`:`${D} in block collection must be sufficiently indented and end with a ${w}`;r(v,m?"MISSING_CHAR":"BAD_INDENT",z),P&&P.source.length!==1&&K.unshift(P)}if(K.length>0){const D=jr(K,A,t.options.strict,r);D.comment&&(h.comment?h.comment+=`
|
|
118
|
-
`+D.comment:h.comment=D.comment),h.range=[i.offset,A,D.offset]}else h.range=[i.offset,A,A];return h}function Wo(n,e,t,i,r,s){const a=t.type==="block-map"?nm(n,e,t,i,s):t.type==="block-seq"?im(n,e,t,i,s):rm(n,e,t,i,s),l=a.constructor;return r==="!"||r===l.tagName?(a.tag=l.tagName,a):(r&&(a.tag=r),a)}function sm(n,e,t,i,r){const s=i.tag,a=s?e.directives.tagName(s.source,w=>r(s,"TAG_RESOLVE_FAILED",w)):null;if(t.type==="block-seq"){const{anchor:w,newlineAfterProp:P}=i,K=w&&s?w.offset>s.offset?w:s:w??s;K&&(!P||P.offset<K.offset)&&r(K,"MISSING_CHAR","Missing newline after block sequence props")}const l=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!a||a==="!"||a===$t.tagName&&l==="map"||a===oi.tagName&&l==="seq")return Wo(n,e,t,r,a);let d=e.schema.tags.find(w=>w.tag===a&&w.collection===l);if(!d){const w=e.schema.knownTags[a];if(w?.collection===l)e.schema.tags.push(Object.assign({},w,{default:!1})),d=w;else return w?r(s,"BAD_COLLECTION_TYPE",`${w.tag} used for ${l} collection, but expects ${w.collection??"scalar"}`,!0):r(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${a}`,!0),Wo(n,e,t,r,a)}const h=Wo(n,e,t,r,a,d),m=d.resolve?.(h,w=>r(s,"TAG_RESOLVE_FAILED",w),e.options)??h,v=Xe(m)?m:new we(m);return v.range=h.range,v.tag=a,d?.format&&(v.format=d.format),v}function om(n,e,t){const i=e.offset,r=am(e,n.options.strict,t);if(!r)return{value:"",type:null,comment:"",range:[i,i,i]};const s=r.mode===">"?we.BLOCK_FOLDED:we.BLOCK_LITERAL,a=e.source?cm(e.source):[];let l=a.length;for(let A=a.length-1;A>=0;--A){const D=a[A][1];if(D===""||D==="\r")l=A;else break}if(l===0){const A=r.chomp==="+"&&a.length>0?`
|
|
119
|
-
`.repeat(Math.max(1,a.length-1)):"";let D=i+r.length;return e.source&&(D+=e.source.length),{value:A,type:s,comment:r.comment,range:[i,D,D]}}let d=e.indent+r.indent,h=e.offset+r.length,m=0;for(let A=0;A<l;++A){const[D,z]=a[A];if(z===""||z==="\r")r.indent===0&&D.length>d&&(d=D.length);else{D.length<d&&t(h+D.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),r.indent===0&&(d=D.length),m=A,d===0&&!n.atRoot&&t(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=D.length+z.length+1}for(let A=a.length-1;A>=l;--A)a[A][0].length>d&&(l=A+1);let v="",w="",P=!1;for(let A=0;A<m;++A)v+=a[A][0].slice(d)+`
|
|
120
|
-
`;for(let A=m;A<l;++A){let[D,z]=a[A];h+=D.length+z.length+1;const H=z[z.length-1]==="\r";if(H&&(z=z.slice(0,-1)),z&&D.length<d){const J=`Block scalar lines must not be less indented than their ${r.indent?"explicit indentation indicator":"first line"}`;t(h-z.length-(H?2:1),"BAD_INDENT",J),D=""}s===we.BLOCK_LITERAL?(v+=w+D.slice(d)+z,w=`
|
|
121
|
-
`):D.length>d||z[0]===" "?(w===" "?w=`
|
|
122
|
-
`:!P&&w===`
|
|
123
|
-
`&&(w=`
|
|
124
|
-
|
|
125
|
-
`),v+=w+D.slice(d)+z,w=`
|
|
126
|
-
`,P=!0):z===""?w===`
|
|
127
|
-
`?v+=`
|
|
128
|
-
`:w=`
|
|
129
|
-
`:(v+=w+z,w=" ",P=!1)}switch(r.chomp){case"-":break;case"+":for(let A=l;A<a.length;++A)v+=`
|
|
130
|
-
`+a[A][0].slice(d);v[v.length-1]!==`
|
|
131
|
-
`&&(v+=`
|
|
132
|
-
`);break;default:v+=`
|
|
133
|
-
`}const K=i+r.length+e.source.length;return{value:v,type:s,comment:r.comment,range:[i,K,K]}}function am({offset:n,props:e},t,i){if(e[0].type!=="block-scalar-header")return i(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:r}=e[0],s=r[0];let a=0,l="",d=-1;for(let w=1;w<r.length;++w){const P=r[w];if(!l&&(P==="-"||P==="+"))l=P;else{const K=Number(P);!a&&K?a=K:d===-1&&(d=n+w)}}d!==-1&&i(d,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${r}`);let h=!1,m="",v=r.length;for(let w=1;w<e.length;++w){const P=e[w];switch(P.type){case"space":h=!0;case"newline":v+=P.source.length;break;case"comment":t&&!h&&i(P,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),v+=P.source.length,m=P.source.substring(1);break;case"error":i(P,"UNEXPECTED_TOKEN",P.message),v+=P.source.length;break;default:{const K=`Unexpected token in block scalar header: ${P.type}`;i(P,"UNEXPECTED_TOKEN",K);const A=P.source;A&&typeof A=="string"&&(v+=A.length)}}}return{mode:s,indent:a,chomp:l,comment:m,length:v}}function cm(n){const e=n.split(/\n( *)/),t=e[0],i=t.match(/^( *)/),s=[i?.[1]?[i[1],t.slice(i[1].length)]:["",t]];for(let a=1;a<e.length;a+=2)s.push([e[a],e[a+1]]);return s}function lm(n,e,t){const{offset:i,type:r,source:s,end:a}=n;let l,d;const h=(w,P,K)=>t(i+w,P,K);switch(r){case"scalar":l=we.PLAIN,d=um(s,h);break;case"single-quoted-scalar":l=we.QUOTE_SINGLE,d=fm(s,h);break;case"double-quoted-scalar":l=we.QUOTE_DOUBLE,d=dm(s,h);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${r}`),{value:"",type:null,comment:"",range:[i,i+s.length,i+s.length]}}const m=i+s.length,v=jr(a,m,e,t);return{value:d,type:l,comment:v.comment,range:[i,m,v.offset]}}function um(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Bf(n)}function fm(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Bf(n.slice(1,-1)).replace(/''/g,"'")}function Bf(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
134
|
-
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
135
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let i=e.exec(n);if(!i)return n;let r=i[1],s=" ",a=e.lastIndex;for(t.lastIndex=a;i=t.exec(n);)i[1]===""?s===`
|
|
136
|
-
`?r+=s:s=`
|
|
137
|
-
`:(r+=s+i[1],s=" "),a=t.lastIndex;const l=/[ \t]*(.*)/sy;return l.lastIndex=a,i=l.exec(n),r+s+(i?.[1]??"")}function dm(n,e){let t="";for(let i=1;i<n.length-1;++i){const r=n[i];if(!(r==="\r"&&n[i+1]===`
|
|
138
|
-
`))if(r===`
|
|
139
|
-
`){const{fold:s,offset:a}=pm(n,i);t+=s,i=a}else if(r==="\\"){let s=n[++i];const a=hm[s];if(a)t+=a;else if(s===`
|
|
140
|
-
`)for(s=n[i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="\r"&&n[i+1]===`
|
|
141
|
-
`)for(s=n[++i+1];s===" "||s===" ";)s=n[++i+1];else if(s==="x"||s==="u"||s==="U"){const l={x:2,u:4,U:8}[s];t+=gm(n,i+1,l,e),i+=l}else{const l=n.substr(i-1,2);e(i-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),t+=l}}else if(r===" "||r===" "){const s=i;let a=n[i+1];for(;a===" "||a===" ";)a=n[++i+1];a!==`
|
|
142
|
-
`&&!(a==="\r"&&n[i+2]===`
|
|
143
|
-
`)&&(t+=i>s?n.slice(s,i+1):r)}else t+=r}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function pm(n,e){let t="",i=n[e+1];for(;(i===" "||i===" "||i===`
|
|
144
|
-
`||i==="\r")&&!(i==="\r"&&n[e+2]!==`
|
|
145
|
-
`);)i===`
|
|
146
|
-
`&&(t+=`
|
|
147
|
-
`),e+=1,i=n[e+1];return t||(t=" "),{fold:t,offset:e}}const hm={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
148
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function gm(n,e,t,i){const r=n.substr(e,t),a=r.length===t&&/^[0-9a-fA-F]+$/.test(r)?parseInt(r,16):NaN;if(isNaN(a)){const l=n.substr(e-2,t+2);return i(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${l}`),l}return String.fromCodePoint(a)}function Ff(n,e,t,i){const{value:r,type:s,comment:a,range:l}=e.type==="block-scalar"?om(n,e,i):lm(e,n.options.strict,i),d=t?n.directives.tagName(t.source,v=>i(t,"TAG_RESOLVE_FAILED",v)):null;let h;n.options.stringKeys&&n.atKey?h=n.schema[nn]:d?h=mm(n.schema,r,d,t,i):e.type==="scalar"?h=vm(n,r,e,i):h=n.schema[nn];let m;try{const v=h.resolve(r,w=>i(t??e,"TAG_RESOLVE_FAILED",w),n.options);m=De(v)?v:new we(v)}catch(v){const w=v instanceof Error?v.message:String(v);i(t??e,"TAG_RESOLVE_FAILED",w),m=new we(r)}return m.range=l,m.source=r,s&&(m.type=s),d&&(m.tag=d),h.format&&(m.format=h.format),a&&(m.comment=a),m}function mm(n,e,t,i,r){if(t==="!")return n[nn];const s=[];for(const l of n.tags)if(!l.collection&&l.tag===t)if(l.default&&l.test)s.push(l);else return l;for(const l of s)if(l.test?.test(e))return l;const a=n.knownTags[t];return a&&!a.collection?(n.tags.push(Object.assign({},a,{default:!1,test:void 0})),a):(r(i,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[nn])}function vm({atKey:n,directives:e,schema:t},i,r,s){const a=t.tags.find(l=>(l.default===!0||n&&l.default==="key")&&l.test?.test(i))||t[nn];if(t.compat){const l=t.compat.find(d=>d.default&&d.test?.test(i))??t[nn];if(a.tag!==l.tag){const d=e.tagString(a.tag),h=e.tagString(l.tag),m=`Value may be parsed as either ${d} or ${h}`;s(r,"TAG_RESOLVE_FAILED",m,!0)}}return a}function ym(n,e,t){if(e){t??(t=e.length);for(let i=t-1;i>=0;--i){let r=e[i];switch(r.type){case"space":case"comment":case"newline":n-=r.source.length;continue}for(r=e[++i];r?.type==="space";)n+=r.source.length,r=e[++i];break}}return n}const bm={composeNode:Df,composeEmptyNode:_c};function Df(n,e,t,i){const r=n.atKey,{spaceBefore:s,comment:a,anchor:l,tag:d}=t;let h,m=!0;switch(e.type){case"alias":h=wm(n,e,i),(l||d)&&i(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=Ff(n,e,d,i),l&&(h.anchor=l.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=sm(bm,n,e,t,i),l&&(h.anchor=l.source.substring(1))}catch(v){const w=v instanceof Error?v.message:String(v);i(e,"RESOURCE_EXHAUSTION",w)}break;default:{const v=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;i(e,"UNEXPECTED_TOKEN",v),m=!1}}return h??(h=_c(n,e.offset,void 0,null,t,i)),l&&h.anchor===""&&i(l,"BAD_ALIAS","Anchor cannot be an empty string"),r&&n.options.stringKeys&&(!De(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&i(d??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(h.spaceBefore=!0),a&&(e.type==="scalar"&&e.source===""?h.comment=a:h.commentBefore=a),n.options.keepSourceTokens&&m&&(h.srcToken=e),h}function _c(n,e,t,i,{spaceBefore:r,comment:s,anchor:a,tag:l,end:d},h){const m={type:"scalar",offset:ym(e,t,i),indent:-1,source:""},v=Ff(n,m,l,h);return a&&(v.anchor=a.source.substring(1),v.anchor===""&&h(a,"BAD_ALIAS","Anchor cannot be an empty string")),r&&(v.spaceBefore=!0),s&&(v.comment=s,v.range[2]=d),v}function wm({options:n},{offset:e,source:t,end:i},r){const s=new dc(t.substring(1));s.source===""&&r(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&r(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const a=e+t.length,l=jr(i,a,n.strict,r);return s.range=[e,a,l.offset],l.comment&&(s.comment=l.comment),s}function xm(n,e,{offset:t,start:i,value:r,end:s},a){const l=Object.assign({_directives:e},n),d=new Nr(void 0,l),h={atKey:!1,atRoot:!0,directives:d.directives,options:d.options,schema:d.schema},m=ji(i,{indicator:"doc-start",next:r??s?.[0],offset:t,onError:a,parentIndent:0,startOnNewline:!0});m.found&&(d.directives.docStart=!0,r&&(r.type==="block-map"||r.type==="block-seq")&&!m.hasNewline&&a(m.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),d.contents=r?Df(h,r,m,a):_c(h,m.end,i,null,m,a);const v=d.contents.range[2],w=jr(s,v,!1,a);return w.comment&&(d.comment=w.comment),d.range=[t,v,w.offset],d}function Xi(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Yl(n){let e="",t=!1,i=!1;for(let r=0;r<n.length;++r){const s=n[r];switch(s[0]){case"#":e+=(e===""?"":i?`
|
|
149
|
-
|
|
150
|
-
`:`
|
|
151
|
-
`)+(s.substring(1)||" "),t=!0,i=!1;break;case"%":n[r+1]?.[0]!=="#"&&(r+=1),t=!1;break;default:t||(i=!0),t=!1}}return{comment:e,afterEmptyLine:i}}class Sm{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,i,r,s)=>{const a=Xi(t);s?this.warnings.push(new tm(a,i,r)):this.errors.push(new ir(a,i,r))},this.directives=new bt({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:i,afterEmptyLine:r}=Yl(this.prelude);if(i){const s=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
152
|
-
${i}`:i;else if(r||e.directives.docStart||!s)e.commentBefore=i;else if(Qe(s)&&!s.flow&&s.items.length>0){let a=s.items[0];et(a)&&(a=a.key);const l=a.commentBefore;a.commentBefore=l?`${i}
|
|
153
|
-
${l}`:i}else{const a=s.commentBefore;s.commentBefore=a?`${i}
|
|
154
|
-
${a}`:i}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Yl(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,i=-1){for(const r of e)yield*this.next(r);yield*this.end(t,i)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,i,r)=>{const s=Xi(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",i,r)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=xm(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,i=new ir(Xi(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(i):this.doc.errors.push(i);break}case"doc-end":{if(!this.doc){const i="Unexpected doc-end without preceding document";this.errors.push(new ir(Xi(e),"UNEXPECTED_TOKEN",i));break}this.doc.directives.docEnd=!0;const t=jr(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const i=this.doc.comment;this.doc.comment=i?`${i}
|
|
155
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new ir(Xi(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const i=Object.assign({_directives:this.directives},this.options),r=new Nr(void 0,i);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),r.range=[0,t,t],this.decorate(r,!1),yield r}}}const Kf="\uFEFF",qf="",Uf="",Aa="";function km(n){switch(n){case Kf:return"byte-order-mark";case qf:return"doc-mode";case Uf:return"flow-error-end";case Aa:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
156
|
-
`:case`\r
|
|
157
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}function Wt(n){switch(n){case void 0:case" ":case`
|
|
158
|
-
`:case"\r":case" ":return!0;default:return!1}}const Jl=new Set("0123456789ABCDEFabcdef"),_m=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),ps=new Set(",[]{}"),Cm=new Set(` ,[]{}
|
|
159
|
-
\r `),Ho=n=>!n||Cm.has(n);class Em{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let i=this.next??"stream";for(;i&&(t||this.hasChars(1));)i=yield*this.parseNext(i)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
160
|
-
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
161
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let i=0;for(;t===" ";)t=this.buffer[++i+e];if(t==="\r"){const r=this.buffer[i+e+1];if(r===`
|
|
162
|
-
`||!r&&!this.atEnd)return e+i+1}return t===`
|
|
163
|
-
`||i>=this.indentNext||!t&&!this.atEnd?e+i:-1}if(t==="-"||t==="."){const i=this.buffer.substr(e,3);if((i==="---"||i==="...")&&Wt(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
164
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Kf&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,i=e.indexOf("#");for(;i!==-1;){const s=e[i-1];if(s===" "||s===" "){t=i-1;break}else i=e.indexOf("#",i+1)}for(;;){const s=e[t-1];if(s===" "||s===" ")t-=1;else break}const r=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-r),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield qf,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&Wt(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!Wt(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&Wt(t)){const i=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=i,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Ho),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,i=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=i=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const r=this.getLine();if(r===null)return this.setNext("flow");if((i!==-1&&i<this.indentNext&&r[0]!=="#"||i===0&&(r.startsWith("---")||r.startsWith("..."))&&Wt(r[3]))&&!(i===this.indentNext-1&&this.flowLevel===1&&(r[0]==="]"||r[0]==="}")))return this.flowLevel=0,yield Uf,yield*this.parseLineStart();let s=0;for(;r[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),r[s]){case void 0:return"flow";case"#":return yield*this.pushCount(r.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Ho),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const a=this.charAt(1);if(this.flowKey||Wt(a)||a===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let s=0;for(;this.buffer[t-1-s]==="\\";)s+=1;if(s%2===0)break;t=this.buffer.indexOf('"',t+1)}const i=this.buffer.substring(0,t);let r=i.indexOf(`
|
|
165
|
-
`,this.pos);if(r!==-1){for(;r!==-1;){const s=this.continueScalar(r+1);if(s===-1)break;r=i.indexOf(`
|
|
166
|
-
`,s)}r!==-1&&(t=r-(i[r-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>Wt(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,i;e:for(let s=this.pos;i=this.buffer[s];++s)switch(i){case" ":t+=1;break;case`
|
|
167
|
-
`:e=s,t=0;break;case"\r":{const a=this.buffer[s+1];if(!a&&!this.atEnd)return this.setNext("block-scalar");if(a===`
|
|
168
|
-
`)break}default:break e}if(!i&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
169
|
-
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let r=e+1;for(i=this.buffer[r];i===" ";)i=this.buffer[++r];if(i===" "){for(;i===" "||i===" "||i==="\r"||i===`
|
|
170
|
-
`;)i=this.buffer[++r];e=r-1}else if(!this.blockScalarKeep)do{let s=e-1,a=this.buffer[s];a==="\r"&&(a=this.buffer[--s]);const l=s;for(;a===" ";)a=this.buffer[--s];if(a===`
|
|
171
|
-
`&&s>=this.pos&&s+1+t>l)e=s;else break}while(!0);return yield Aa,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,i=this.pos-1,r;for(;r=this.buffer[++i];)if(r===":"){const s=this.buffer[i+1];if(Wt(s)||e&&ps.has(s))break;t=i}else if(Wt(r)){let s=this.buffer[i+1];if(r==="\r"&&(s===`
|
|
172
|
-
`?(i+=1,r=`
|
|
173
|
-
`,s=this.buffer[i+1]):t=i),s==="#"||e&&ps.has(s))break;if(r===`
|
|
174
|
-
`){const a=this.continueScalar(i+1);if(a===-1)break;i=Math.max(i,a-2)}}else{if(e&&ps.has(r))break;t=i}return!r&&!this.atEnd?this.setNext("plain-scalar"):(yield Aa,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const i=this.buffer.slice(this.pos,e);return i?(yield i,this.pos+=i.length,i.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Ho))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(Wt(t)||e&&ps.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!Wt(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(_m.has(t))t=this.buffer[++e];else if(t==="%"&&Jl.has(this.buffer[e+1])&&Jl.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
175
|
-
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
176
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,i;do i=this.buffer[++t];while(i===" "||e&&i===" ");const r=t-this.pos;return r>0&&(yield this.buffer.substr(this.pos,r),this.pos=t),r}*pushUntil(e){let t=this.pos,i=this.buffer[t];for(;!e(i);)i=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class Im{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,i=this.lineStarts.length;for(;t<i;){const s=t+i>>1;this.lineStarts[s]<e?t=s+1:i=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const r=this.lineStarts[t-1];return{line:t,col:e-r+1}}}}function On(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Ql(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function zf(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function hs(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function xi(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Xl(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!On(e.start,"explicit-key-ind")&&!On(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,zf(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}class Om{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new Em,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const i of this.lexer.lex(e,t))yield*this.next(i);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=km(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const i=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:i,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const i=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in i?i.indent:0:t.type==="flow-collection"&&i.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Xl(t),i.type){case"document":i.value=t;break;case"block-scalar":i.props.push(t);break;case"block-map":{const r=i.items[i.items.length-1];if(r.value){i.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(r.sep)r.value=t;else{Object.assign(r,{key:t,sep:[]}),this.onKeyLine=!r.explicitKey;return}break}case"block-seq":{const r=i.items[i.items.length-1];r.value?i.items.push({start:[],value:t}):r.value=t;break}case"flow-collection":{const r=i.items[i.items.length-1];!r||r.value?i.items.push({start:[],key:t,sep:[]}):r.sep?r.value=t:Object.assign(r,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((i.type==="document"||i.type==="block-map"||i.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const r=t.items[t.items.length-1];r&&!r.sep&&!r.value&&r.start.length>0&&Ql(r.start)===-1&&(t.indent===0||r.start.every(s=>s.type!=="comment"||s.indent<t.indent))&&(i.type==="document"?i.end=r.start:i.items.push({start:r.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Ql(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=hs(this.peek(2)),i=xi(t);let r;e.end?(r=e.end,r.push(this.sourceToken),delete e.end):r=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:i,key:e,sep:r}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
177
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
178
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const i=!this.onKeyLine&&this.indent===e.indent,r=i&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(r&&t.sep&&!t.value){const a=[];for(let l=0;l<t.sep.length;++l){const d=t.sep[l];switch(d.type){case"newline":a.push(l);break;case"space":break;case"comment":d.indent>e.indent&&(a.length=0);break;default:a.length=0}}a.length>=2&&(s=t.sep.splice(a[1]))}switch(this.type){case"anchor":case"tag":r||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):r||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(On(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(zf(t.key)&&!On(t.sep,"newline")){const a=xi(t.start),l=t.key,d=t.sep;d.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:l,sep:d}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(On(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const a=xi(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:a,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||r?e.items.push({start:s,key:null,sep:[this.sourceToken]}):On(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);r||t.value?(e.items.push({start:s,key:a,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(a):(Object.assign(t,{key:a,sep:[]}),this.onKeyLine=!0);return}default:{const a=this.startBlockValue(e);if(a){if(a.type==="block-seq"){if(!t.explicitKey&&t.sep&&!On(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else i&&e.items.push({start:s});this.stack.push(a);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const i="end"in t.value?t.value.end:void 0;(Array.isArray(i)?i[i.length-1]:void 0)?.type==="comment"?i?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const r=e.items[e.items.length-2]?.value?.end;if(Array.isArray(r)){Array.prototype.push.apply(r,t.start),r.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||On(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const i=this.startBlockValue(e);if(i){this.stack.push(i);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let i;do yield*this.pop(),i=this.peek(1);while(i?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const r=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:r,sep:[]}):t.sep?this.stack.push(r):Object.assign(t,{key:r,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const i=this.startBlockValue(e);i?this.stack.push(i):(yield*this.pop(),yield*this.step())}else{const i=this.peek(2);if(i.type==="block-map"&&(this.type==="map-value-ind"&&i.indent===e.indent||this.type==="newline"&&!i.items[i.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&i.type!=="flow-collection"){const r=hs(i),s=xi(r);Xl(e);const a=e.end.splice(1,e.end.length);a.push(this.sourceToken);const l={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=l}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
179
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
180
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=hs(e),i=xi(t);return i.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=hs(e),i=xi(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:i,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(i=>i.type==="newline"||i.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function Am(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new Im||null,prettyErrors:e}}function Pm(n,e={}){const{lineCounter:t,prettyErrors:i}=Am(e),r=new Om(t?.addNewLine),s=new Sm(e);let a=null;for(const l of s.compose(r.parse(n),!0,n.length))if(!a)a=l;else if(a.options.logLevel!=="silent"){a.errors.push(new ir(l.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return i&&t&&(a.errors.forEach(Hl(n,t)),a.warnings.forEach(Hl(n,t))),a}function Tm(n,e,t){let i;const r=Pm(n,t);if(!r)return null;if(r.warnings.forEach(s=>vf(r.options.logLevel,s)),r.errors.length>0){if(r.options.logLevel!=="silent")throw r.errors[0];r.errors=[]}return r.toJS(Object.assign({reviver:i},t))}function Nm(n,e,t){let i=null;if(Array.isArray(e)&&(i=e),n===void 0){const{keepUndefined:r}={};if(!r)return}return Or(n)&&!i?n.toString(t):new Nr(n,i,t).toString(t)}class Vf{readPage(e){const t=e.split(`
|
|
181
|
-
`);if(t[0]=="---"){t.shift();const i=t.findIndex(r=>r=="---");if(i>=0){const r=t.slice(0,i).join(`
|
|
182
|
-
`);return{...Tm(r),content:t.slice(i+1).join(`
|
|
183
|
-
`)}}else return{content:e}}else return{content:e}}}class Wf{writePage(e){const{content:t,...i}=e;return i&&Object.keys(i).length>0?`---
|
|
184
|
-
${Nm(i)}---
|
|
185
|
-
${t??""}`:t??""}}var jm=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Mm=(n,e)=>(t,i)=>e(t,i,n);let Cr=class{logger;wikiConfig;constructor(e,t){this.logger=e,this.logger.setModule(t)}setWikiConfig(e){this.logger.debug("Setting wiki Config: ",e),this.wikiConfig=e}getWikiConfig(){return this.wikiConfig}};Cr=jm([it(),Mm(0,Yp())],Cr);var Rm=(n,e,t,i)=>{for(var r=e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},$m=(n,e)=>(t,i)=>e(t,i,n);let Zl=class{constructor(n){this.cristalApp=n}get(){return this.cristalApp.getWikiConfig().storage}};Zl=Rm([it(),$m(0,Le("CristalApp"))],Zl);const Hf={"application/prs.cww":["cww"],"application/prs.xsf+xml":["xsf"],"application/vnd.1000minds.decision-model+xml":["1km"],"application/vnd.3gpp.pic-bw-large":["plb"],"application/vnd.3gpp.pic-bw-small":["psb"],"application/vnd.3gpp.pic-bw-var":["pvb"],"application/vnd.3gpp2.tcap":["tcap"],"application/vnd.3m.post-it-notes":["pwn"],"application/vnd.accpac.simply.aso":["aso"],"application/vnd.accpac.simply.imp":["imp"],"application/vnd.acucobol":["acu"],"application/vnd.acucorp":["atc","acutc"],"application/vnd.adobe.air-application-installer-package+zip":["air"],"application/vnd.adobe.formscentral.fcdt":["fcdt"],"application/vnd.adobe.fxp":["fxp","fxpl"],"application/vnd.adobe.xdp+xml":["xdp"],"application/vnd.adobe.xfdf":["*xfdf"],"application/vnd.age":["age"],"application/vnd.ahead.space":["ahead"],"application/vnd.airzip.filesecure.azf":["azf"],"application/vnd.airzip.filesecure.azs":["azs"],"application/vnd.amazon.ebook":["azw"],"application/vnd.americandynamics.acc":["acc"],"application/vnd.amiga.ami":["ami"],"application/vnd.android.package-archive":["apk"],"application/vnd.anser-web-certificate-issue-initiation":["cii"],"application/vnd.anser-web-funds-transfer-initiation":["fti"],"application/vnd.antix.game-component":["atx"],"application/vnd.apple.installer+xml":["mpkg"],"application/vnd.apple.keynote":["key"],"application/vnd.apple.mpegurl":["m3u8"],"application/vnd.apple.numbers":["numbers"],"application/vnd.apple.pages":["pages"],"application/vnd.apple.pkpass":["pkpass"],"application/vnd.aristanetworks.swi":["swi"],"application/vnd.astraea-software.iota":["iota"],"application/vnd.audiograph":["aep"],"application/vnd.autodesk.fbx":["fbx"],"application/vnd.balsamiq.bmml+xml":["bmml"],"application/vnd.blueice.multipass":["mpm"],"application/vnd.bmi":["bmi"],"application/vnd.businessobjects":["rep"],"application/vnd.chemdraw+xml":["cdxml"],"application/vnd.chipnuts.karaoke-mmd":["mmd"],"application/vnd.cinderella":["cdy"],"application/vnd.citationstyles.style+xml":["csl"],"application/vnd.claymore":["cla"],"application/vnd.cloanto.rp9":["rp9"],"application/vnd.clonk.c4group":["c4g","c4d","c4f","c4p","c4u"],"application/vnd.cluetrust.cartomobile-config":["c11amc"],"application/vnd.cluetrust.cartomobile-config-pkg":["c11amz"],"application/vnd.commonspace":["csp"],"application/vnd.contact.cmsg":["cdbcmsg"],"application/vnd.cosmocaller":["cmc"],"application/vnd.crick.clicker":["clkx"],"application/vnd.crick.clicker.keyboard":["clkk"],"application/vnd.crick.clicker.palette":["clkp"],"application/vnd.crick.clicker.template":["clkt"],"application/vnd.crick.clicker.wordbank":["clkw"],"application/vnd.criticaltools.wbs+xml":["wbs"],"application/vnd.ctc-posml":["pml"],"application/vnd.cups-ppd":["ppd"],"application/vnd.curl.car":["car"],"application/vnd.curl.pcurl":["pcurl"],"application/vnd.dart":["dart"],"application/vnd.data-vision.rdz":["rdz"],"application/vnd.dbf":["dbf"],"application/vnd.dcmp+xml":["dcmp"],"application/vnd.dece.data":["uvf","uvvf","uvd","uvvd"],"application/vnd.dece.ttml+xml":["uvt","uvvt"],"application/vnd.dece.unspecified":["uvx","uvvx"],"application/vnd.dece.zip":["uvz","uvvz"],"application/vnd.denovo.fcselayout-link":["fe_launch"],"application/vnd.dna":["dna"],"application/vnd.dolby.mlp":["mlp"],"application/vnd.dpgraph":["dpg"],"application/vnd.dreamfactory":["dfac"],"application/vnd.ds-keypoint":["kpxx"],"application/vnd.dvb.ait":["ait"],"application/vnd.dvb.service":["svc"],"application/vnd.dynageo":["geo"],"application/vnd.ecowin.chart":["mag"],"application/vnd.enliven":["nml"],"application/vnd.epson.esf":["esf"],"application/vnd.epson.msf":["msf"],"application/vnd.epson.quickanime":["qam"],"application/vnd.epson.salt":["slt"],"application/vnd.epson.ssf":["ssf"],"application/vnd.eszigno3+xml":["es3","et3"],"application/vnd.ezpix-album":["ez2"],"application/vnd.ezpix-package":["ez3"],"application/vnd.fdf":["*fdf"],"application/vnd.fdsn.mseed":["mseed"],"application/vnd.fdsn.seed":["seed","dataless"],"application/vnd.flographit":["gph"],"application/vnd.fluxtime.clip":["ftc"],"application/vnd.framemaker":["fm","frame","maker","book"],"application/vnd.frogans.fnc":["fnc"],"application/vnd.frogans.ltf":["ltf"],"application/vnd.fsc.weblaunch":["fsc"],"application/vnd.fujitsu.oasys":["oas"],"application/vnd.fujitsu.oasys2":["oa2"],"application/vnd.fujitsu.oasys3":["oa3"],"application/vnd.fujitsu.oasysgp":["fg5"],"application/vnd.fujitsu.oasysprs":["bh2"],"application/vnd.fujixerox.ddd":["ddd"],"application/vnd.fujixerox.docuworks":["xdw"],"application/vnd.fujixerox.docuworks.binder":["xbd"],"application/vnd.fuzzysheet":["fzs"],"application/vnd.genomatix.tuxedo":["txd"],"application/vnd.geogebra.file":["ggb"],"application/vnd.geogebra.slides":["ggs"],"application/vnd.geogebra.tool":["ggt"],"application/vnd.geometry-explorer":["gex","gre"],"application/vnd.geonext":["gxt"],"application/vnd.geoplan":["g2w"],"application/vnd.geospace":["g3w"],"application/vnd.gmx":["gmx"],"application/vnd.google-apps.document":["gdoc"],"application/vnd.google-apps.drawing":["gdraw"],"application/vnd.google-apps.form":["gform"],"application/vnd.google-apps.jam":["gjam"],"application/vnd.google-apps.map":["gmap"],"application/vnd.google-apps.presentation":["gslides"],"application/vnd.google-apps.script":["gscript"],"application/vnd.google-apps.site":["gsite"],"application/vnd.google-apps.spreadsheet":["gsheet"],"application/vnd.google-earth.kml+xml":["kml"],"application/vnd.google-earth.kmz":["kmz"],"application/vnd.gov.sk.xmldatacontainer+xml":["xdcf"],"application/vnd.grafeq":["gqf","gqs"],"application/vnd.groove-account":["gac"],"application/vnd.groove-help":["ghf"],"application/vnd.groove-identity-message":["gim"],"application/vnd.groove-injector":["grv"],"application/vnd.groove-tool-message":["gtm"],"application/vnd.groove-tool-template":["tpl"],"application/vnd.groove-vcard":["vcg"],"application/vnd.hal+xml":["hal"],"application/vnd.handheld-entertainment+xml":["zmm"],"application/vnd.hbci":["hbci"],"application/vnd.hhe.lesson-player":["les"],"application/vnd.hp-hpgl":["hpgl"],"application/vnd.hp-hpid":["hpid"],"application/vnd.hp-hps":["hps"],"application/vnd.hp-jlyt":["jlt"],"application/vnd.hp-pcl":["pcl"],"application/vnd.hp-pclxl":["pclxl"],"application/vnd.hydrostatix.sof-data":["sfd-hdstx"],"application/vnd.ibm.minipay":["mpy"],"application/vnd.ibm.modcap":["afp","listafp","list3820"],"application/vnd.ibm.rights-management":["irm"],"application/vnd.ibm.secure-container":["sc"],"application/vnd.iccprofile":["icc","icm"],"application/vnd.igloader":["igl"],"application/vnd.immervision-ivp":["ivp"],"application/vnd.immervision-ivu":["ivu"],"application/vnd.insors.igm":["igm"],"application/vnd.intercon.formnet":["xpw","xpx"],"application/vnd.intergeo":["i2g"],"application/vnd.intu.qbo":["qbo"],"application/vnd.intu.qfx":["qfx"],"application/vnd.ipunplugged.rcprofile":["rcprofile"],"application/vnd.irepository.package+xml":["irp"],"application/vnd.is-xpr":["xpr"],"application/vnd.isac.fcs":["fcs"],"application/vnd.jam":["jam"],"application/vnd.jcp.javame.midlet-rms":["rms"],"application/vnd.jisp":["jisp"],"application/vnd.joost.joda-archive":["joda"],"application/vnd.kahootz":["ktz","ktr"],"application/vnd.kde.karbon":["karbon"],"application/vnd.kde.kchart":["chrt"],"application/vnd.kde.kformula":["kfo"],"application/vnd.kde.kivio":["flw"],"application/vnd.kde.kontour":["kon"],"application/vnd.kde.kpresenter":["kpr","kpt"],"application/vnd.kde.kspread":["ksp"],"application/vnd.kde.kword":["kwd","kwt"],"application/vnd.kenameaapp":["htke"],"application/vnd.kidspiration":["kia"],"application/vnd.kinar":["kne","knp"],"application/vnd.koan":["skp","skd","skt","skm"],"application/vnd.kodak-descriptor":["sse"],"application/vnd.las.las+xml":["lasxml"],"application/vnd.llamagraphics.life-balance.desktop":["lbd"],"application/vnd.llamagraphics.life-balance.exchange+xml":["lbe"],"application/vnd.lotus-1-2-3":["123"],"application/vnd.lotus-approach":["apr"],"application/vnd.lotus-freelance":["pre"],"application/vnd.lotus-notes":["nsf"],"application/vnd.lotus-organizer":["org"],"application/vnd.lotus-screencam":["scm"],"application/vnd.lotus-wordpro":["lwp"],"application/vnd.macports.portpkg":["portpkg"],"application/vnd.mapbox-vector-tile":["mvt"],"application/vnd.mcd":["mcd"],"application/vnd.medcalcdata":["mc1"],"application/vnd.mediastation.cdkey":["cdkey"],"application/vnd.mfer":["mwf"],"application/vnd.mfmp":["mfm"],"application/vnd.micrografx.flo":["flo"],"application/vnd.micrografx.igx":["igx"],"application/vnd.mif":["mif"],"application/vnd.mobius.daf":["daf"],"application/vnd.mobius.dis":["dis"],"application/vnd.mobius.mbk":["mbk"],"application/vnd.mobius.mqy":["mqy"],"application/vnd.mobius.msl":["msl"],"application/vnd.mobius.plc":["plc"],"application/vnd.mobius.txf":["txf"],"application/vnd.mophun.application":["mpn"],"application/vnd.mophun.certificate":["mpc"],"application/vnd.mozilla.xul+xml":["xul"],"application/vnd.ms-artgalry":["cil"],"application/vnd.ms-cab-compressed":["cab"],"application/vnd.ms-excel":["xls","xlm","xla","xlc","xlt","xlw"],"application/vnd.ms-excel.addin.macroenabled.12":["xlam"],"application/vnd.ms-excel.sheet.binary.macroenabled.12":["xlsb"],"application/vnd.ms-excel.sheet.macroenabled.12":["xlsm"],"application/vnd.ms-excel.template.macroenabled.12":["xltm"],"application/vnd.ms-fontobject":["eot"],"application/vnd.ms-htmlhelp":["chm"],"application/vnd.ms-ims":["ims"],"application/vnd.ms-lrm":["lrm"],"application/vnd.ms-officetheme":["thmx"],"application/vnd.ms-outlook":["msg"],"application/vnd.ms-pki.seccat":["cat"],"application/vnd.ms-pki.stl":["*stl"],"application/vnd.ms-powerpoint":["ppt","pps","pot"],"application/vnd.ms-powerpoint.addin.macroenabled.12":["ppam"],"application/vnd.ms-powerpoint.presentation.macroenabled.12":["pptm"],"application/vnd.ms-powerpoint.slide.macroenabled.12":["sldm"],"application/vnd.ms-powerpoint.slideshow.macroenabled.12":["ppsm"],"application/vnd.ms-powerpoint.template.macroenabled.12":["potm"],"application/vnd.ms-project":["*mpp","mpt"],"application/vnd.ms-visio.viewer":["vdx"],"application/vnd.ms-word.document.macroenabled.12":["docm"],"application/vnd.ms-word.template.macroenabled.12":["dotm"],"application/vnd.ms-works":["wps","wks","wcm","wdb"],"application/vnd.ms-wpl":["wpl"],"application/vnd.ms-xpsdocument":["xps"],"application/vnd.mseq":["mseq"],"application/vnd.musician":["mus"],"application/vnd.muvee.style":["msty"],"application/vnd.mynfc":["taglet"],"application/vnd.nato.bindingdataobject+xml":["bdo"],"application/vnd.neurolanguage.nlu":["nlu"],"application/vnd.nitf":["ntf","nitf"],"application/vnd.noblenet-directory":["nnd"],"application/vnd.noblenet-sealer":["nns"],"application/vnd.noblenet-web":["nnw"],"application/vnd.nokia.n-gage.ac+xml":["*ac"],"application/vnd.nokia.n-gage.data":["ngdat"],"application/vnd.nokia.n-gage.symbian.install":["n-gage"],"application/vnd.nokia.radio-preset":["rpst"],"application/vnd.nokia.radio-presets":["rpss"],"application/vnd.novadigm.edm":["edm"],"application/vnd.novadigm.edx":["edx"],"application/vnd.novadigm.ext":["ext"],"application/vnd.oasis.opendocument.chart":["odc"],"application/vnd.oasis.opendocument.chart-template":["otc"],"application/vnd.oasis.opendocument.database":["odb"],"application/vnd.oasis.opendocument.formula":["odf"],"application/vnd.oasis.opendocument.formula-template":["odft"],"application/vnd.oasis.opendocument.graphics":["odg"],"application/vnd.oasis.opendocument.graphics-template":["otg"],"application/vnd.oasis.opendocument.image":["odi"],"application/vnd.oasis.opendocument.image-template":["oti"],"application/vnd.oasis.opendocument.presentation":["odp"],"application/vnd.oasis.opendocument.presentation-template":["otp"],"application/vnd.oasis.opendocument.spreadsheet":["ods"],"application/vnd.oasis.opendocument.spreadsheet-template":["ots"],"application/vnd.oasis.opendocument.text":["odt"],"application/vnd.oasis.opendocument.text-master":["odm"],"application/vnd.oasis.opendocument.text-template":["ott"],"application/vnd.oasis.opendocument.text-web":["oth"],"application/vnd.olpc-sugar":["xo"],"application/vnd.oma.dd2+xml":["dd2"],"application/vnd.openblox.game+xml":["obgx"],"application/vnd.openofficeorg.extension":["oxt"],"application/vnd.openstreetmap.data+xml":["osm"],"application/vnd.openxmlformats-officedocument.presentationml.presentation":["pptx"],"application/vnd.openxmlformats-officedocument.presentationml.slide":["sldx"],"application/vnd.openxmlformats-officedocument.presentationml.slideshow":["ppsx"],"application/vnd.openxmlformats-officedocument.presentationml.template":["potx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":["xlsx"],"application/vnd.openxmlformats-officedocument.spreadsheetml.template":["xltx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.document":["docx"],"application/vnd.openxmlformats-officedocument.wordprocessingml.template":["dotx"],"application/vnd.osgeo.mapguide.package":["mgp"],"application/vnd.osgi.dp":["dp"],"application/vnd.osgi.subsystem":["esa"],"application/vnd.palm":["pdb","pqa","oprc"],"application/vnd.pawaafile":["paw"],"application/vnd.pg.format":["str"],"application/vnd.pg.osasli":["ei6"],"application/vnd.picsel":["efif"],"application/vnd.pmi.widget":["wg"],"application/vnd.pocketlearn":["plf"],"application/vnd.powerbuilder6":["pbd"],"application/vnd.previewsystems.box":["box"],"application/vnd.procrate.brushset":["brushset"],"application/vnd.procreate.brush":["brush"],"application/vnd.procreate.dream":["drm"],"application/vnd.proteus.magazine":["mgz"],"application/vnd.publishare-delta-tree":["qps"],"application/vnd.pvi.ptid1":["ptid"],"application/vnd.pwg-xhtml-print+xml":["xhtm"],"application/vnd.quark.quarkxpress":["qxd","qxt","qwd","qwt","qxl","qxb"],"application/vnd.rar":["rar"],"application/vnd.realvnc.bed":["bed"],"application/vnd.recordare.musicxml":["mxl"],"application/vnd.recordare.musicxml+xml":["musicxml"],"application/vnd.rig.cryptonote":["cryptonote"],"application/vnd.rim.cod":["cod"],"application/vnd.rn-realmedia":["rm"],"application/vnd.rn-realmedia-vbr":["rmvb"],"application/vnd.route66.link66+xml":["link66"],"application/vnd.sailingtracker.track":["st"],"application/vnd.seemail":["see"],"application/vnd.sema":["sema"],"application/vnd.semd":["semd"],"application/vnd.semf":["semf"],"application/vnd.shana.informed.formdata":["ifm"],"application/vnd.shana.informed.formtemplate":["itp"],"application/vnd.shana.informed.interchange":["iif"],"application/vnd.shana.informed.package":["ipk"],"application/vnd.simtech-mindmapper":["twd","twds"],"application/vnd.smaf":["mmf"],"application/vnd.smart.teacher":["teacher"],"application/vnd.software602.filler.form+xml":["fo"],"application/vnd.solent.sdkm+xml":["sdkm","sdkd"],"application/vnd.spotfire.dxp":["dxp"],"application/vnd.spotfire.sfs":["sfs"],"application/vnd.stardivision.calc":["sdc"],"application/vnd.stardivision.draw":["sda"],"application/vnd.stardivision.impress":["sdd"],"application/vnd.stardivision.math":["smf"],"application/vnd.stardivision.writer":["sdw","vor"],"application/vnd.stardivision.writer-global":["sgl"],"application/vnd.stepmania.package":["smzip"],"application/vnd.stepmania.stepchart":["sm"],"application/vnd.sun.wadl+xml":["wadl"],"application/vnd.sun.xml.calc":["sxc"],"application/vnd.sun.xml.calc.template":["stc"],"application/vnd.sun.xml.draw":["sxd"],"application/vnd.sun.xml.draw.template":["std"],"application/vnd.sun.xml.impress":["sxi"],"application/vnd.sun.xml.impress.template":["sti"],"application/vnd.sun.xml.math":["sxm"],"application/vnd.sun.xml.writer":["sxw"],"application/vnd.sun.xml.writer.global":["sxg"],"application/vnd.sun.xml.writer.template":["stw"],"application/vnd.sus-calendar":["sus","susp"],"application/vnd.svd":["svd"],"application/vnd.symbian.install":["sis","sisx"],"application/vnd.syncml+xml":["xsm"],"application/vnd.syncml.dm+wbxml":["bdm"],"application/vnd.syncml.dm+xml":["xdm"],"application/vnd.syncml.dmddf+xml":["ddf"],"application/vnd.tao.intent-module-archive":["tao"],"application/vnd.tcpdump.pcap":["pcap","cap","dmp"],"application/vnd.tmobile-livetv":["tmo"],"application/vnd.trid.tpt":["tpt"],"application/vnd.triscape.mxs":["mxs"],"application/vnd.trueapp":["tra"],"application/vnd.ufdl":["ufd","ufdl"],"application/vnd.uiq.theme":["utz"],"application/vnd.umajin":["umj"],"application/vnd.unity":["unityweb"],"application/vnd.uoml+xml":["uoml","uo"],"application/vnd.vcx":["vcx"],"application/vnd.visio":["vsd","vst","vss","vsw","vsdx","vtx"],"application/vnd.visionary":["vis"],"application/vnd.vsf":["vsf"],"application/vnd.wap.wbxml":["wbxml"],"application/vnd.wap.wmlc":["wmlc"],"application/vnd.wap.wmlscriptc":["wmlsc"],"application/vnd.webturbo":["wtb"],"application/vnd.wolfram.player":["nbp"],"application/vnd.wordperfect":["wpd"],"application/vnd.wqd":["wqd"],"application/vnd.wt.stf":["stf"],"application/vnd.xara":["xar"],"application/vnd.xfdl":["xfdl"],"application/vnd.yamaha.hv-dic":["hvd"],"application/vnd.yamaha.hv-script":["hvs"],"application/vnd.yamaha.hv-voice":["hvp"],"application/vnd.yamaha.openscoreformat":["osf"],"application/vnd.yamaha.openscoreformat.osfpvg+xml":["osfpvg"],"application/vnd.yamaha.smaf-audio":["saf"],"application/vnd.yamaha.smaf-phrase":["spf"],"application/vnd.yellowriver-custom-menu":["cmp"],"application/vnd.zul":["zir","zirz"],"application/vnd.zzazz.deck+xml":["zaz"],"application/x-7z-compressed":["7z"],"application/x-abiword":["abw"],"application/x-ace-compressed":["ace"],"application/x-apple-diskimage":["*dmg"],"application/x-arj":["arj"],"application/x-authorware-bin":["aab","x32","u32","vox"],"application/x-authorware-map":["aam"],"application/x-authorware-seg":["aas"],"application/x-bcpio":["bcpio"],"application/x-bdoc":["*bdoc"],"application/x-bittorrent":["torrent"],"application/x-blender":["blend"],"application/x-blorb":["blb","blorb"],"application/x-bzip":["bz"],"application/x-bzip2":["bz2","boz"],"application/x-cbr":["cbr","cba","cbt","cbz","cb7"],"application/x-cdlink":["vcd"],"application/x-cfs-compressed":["cfs"],"application/x-chat":["chat"],"application/x-chess-pgn":["pgn"],"application/x-chrome-extension":["crx"],"application/x-cocoa":["cco"],"application/x-compressed":["*rar"],"application/x-conference":["nsc"],"application/x-cpio":["cpio"],"application/x-csh":["csh"],"application/x-debian-package":["*deb","udeb"],"application/x-dgc-compressed":["dgc"],"application/x-director":["dir","dcr","dxr","cst","cct","cxt","w3d","fgd","swa"],"application/x-doom":["wad"],"application/x-dtbncx+xml":["ncx"],"application/x-dtbook+xml":["dtb"],"application/x-dtbresource+xml":["res"],"application/x-dvi":["dvi"],"application/x-envoy":["evy"],"application/x-eva":["eva"],"application/x-font-bdf":["bdf"],"application/x-font-ghostscript":["gsf"],"application/x-font-linux-psf":["psf"],"application/x-font-pcf":["pcf"],"application/x-font-snf":["snf"],"application/x-font-type1":["pfa","pfb","pfm","afm"],"application/x-freearc":["arc"],"application/x-futuresplash":["spl"],"application/x-gca-compressed":["gca"],"application/x-glulx":["ulx"],"application/x-gnumeric":["gnumeric"],"application/x-gramps-xml":["gramps"],"application/x-gtar":["gtar"],"application/x-hdf":["hdf"],"application/x-httpd-php":["php"],"application/x-install-instructions":["install"],"application/x-ipynb+json":["ipynb"],"application/x-iso9660-image":["*iso"],"application/x-iwork-keynote-sffkey":["*key"],"application/x-iwork-numbers-sffnumbers":["*numbers"],"application/x-iwork-pages-sffpages":["*pages"],"application/x-java-archive-diff":["jardiff"],"application/x-java-jnlp-file":["jnlp"],"application/x-keepass2":["kdbx"],"application/x-latex":["latex"],"application/x-lua-bytecode":["luac"],"application/x-lzh-compressed":["lzh","lha"],"application/x-makeself":["run"],"application/x-mie":["mie"],"application/x-mobipocket-ebook":["*prc","mobi"],"application/x-ms-application":["application"],"application/x-ms-shortcut":["lnk"],"application/x-ms-wmd":["wmd"],"application/x-ms-wmz":["wmz"],"application/x-ms-xbap":["xbap"],"application/x-msaccess":["mdb"],"application/x-msbinder":["obd"],"application/x-mscardfile":["crd"],"application/x-msclip":["clp"],"application/x-msdos-program":["*exe"],"application/x-msdownload":["*exe","*dll","com","bat","*msi"],"application/x-msmediaview":["mvb","m13","m14"],"application/x-msmetafile":["*wmf","*wmz","*emf","emz"],"application/x-msmoney":["mny"],"application/x-mspublisher":["pub"],"application/x-msschedule":["scd"],"application/x-msterminal":["trm"],"application/x-mswrite":["wri"],"application/x-netcdf":["nc","cdf"],"application/x-ns-proxy-autoconfig":["pac"],"application/x-nzb":["nzb"],"application/x-perl":["pl","pm"],"application/x-pilot":["*prc","*pdb"],"application/x-pkcs12":["p12","pfx"],"application/x-pkcs7-certificates":["p7b","spc"],"application/x-pkcs7-certreqresp":["p7r"],"application/x-rar-compressed":["*rar"],"application/x-redhat-package-manager":["rpm"],"application/x-research-info-systems":["ris"],"application/x-sea":["sea"],"application/x-sh":["sh"],"application/x-shar":["shar"],"application/x-shockwave-flash":["swf"],"application/x-silverlight-app":["xap"],"application/x-sql":["*sql"],"application/x-stuffit":["sit"],"application/x-stuffitx":["sitx"],"application/x-subrip":["srt"],"application/x-sv4cpio":["sv4cpio"],"application/x-sv4crc":["sv4crc"],"application/x-t3vm-image":["t3"],"application/x-tads":["gam"],"application/x-tar":["tar"],"application/x-tcl":["tcl","tk"],"application/x-tex":["tex"],"application/x-tex-tfm":["tfm"],"application/x-texinfo":["texinfo","texi"],"application/x-tgif":["*obj"],"application/x-ustar":["ustar"],"application/x-virtualbox-hdd":["hdd"],"application/x-virtualbox-ova":["ova"],"application/x-virtualbox-ovf":["ovf"],"application/x-virtualbox-vbox":["vbox"],"application/x-virtualbox-vbox-extpack":["vbox-extpack"],"application/x-virtualbox-vdi":["vdi"],"application/x-virtualbox-vhd":["vhd"],"application/x-virtualbox-vmdk":["vmdk"],"application/x-wais-source":["src"],"application/x-web-app-manifest+json":["webapp"],"application/x-x509-ca-cert":["der","crt","pem"],"application/x-xfig":["fig"],"application/x-xliff+xml":["*xlf"],"application/x-xpinstall":["xpi"],"application/x-xz":["xz"],"application/x-zip-compressed":["*zip"],"application/x-zmachine":["z1","z2","z3","z4","z5","z6","z7","z8"],"audio/vnd.dece.audio":["uva","uvva"],"audio/vnd.digital-winds":["eol"],"audio/vnd.dra":["dra"],"audio/vnd.dts":["dts"],"audio/vnd.dts.hd":["dtshd"],"audio/vnd.lucent.voice":["lvp"],"audio/vnd.ms-playready.media.pya":["pya"],"audio/vnd.nuera.ecelp4800":["ecelp4800"],"audio/vnd.nuera.ecelp7470":["ecelp7470"],"audio/vnd.nuera.ecelp9600":["ecelp9600"],"audio/vnd.rip":["rip"],"audio/x-aac":["*aac"],"audio/x-aiff":["aif","aiff","aifc"],"audio/x-caf":["caf"],"audio/x-flac":["flac"],"audio/x-m4a":["*m4a"],"audio/x-matroska":["mka"],"audio/x-mpegurl":["m3u"],"audio/x-ms-wax":["wax"],"audio/x-ms-wma":["wma"],"audio/x-pn-realaudio":["ram","ra"],"audio/x-pn-realaudio-plugin":["rmp"],"audio/x-realaudio":["*ra"],"audio/x-wav":["*wav"],"chemical/x-cdx":["cdx"],"chemical/x-cif":["cif"],"chemical/x-cmdf":["cmdf"],"chemical/x-cml":["cml"],"chemical/x-csml":["csml"],"chemical/x-xyz":["xyz"],"image/prs.btif":["btif","btf"],"image/prs.pti":["pti"],"image/vnd.adobe.photoshop":["psd"],"image/vnd.airzip.accelerator.azv":["azv"],"image/vnd.blockfact.facti":["facti"],"image/vnd.dece.graphic":["uvi","uvvi","uvg","uvvg"],"image/vnd.djvu":["djvu","djv"],"image/vnd.dvb.subtitle":["*sub"],"image/vnd.dwg":["dwg"],"image/vnd.dxf":["dxf"],"image/vnd.fastbidsheet":["fbs"],"image/vnd.fpx":["fpx"],"image/vnd.fst":["fst"],"image/vnd.fujixerox.edmics-mmr":["mmr"],"image/vnd.fujixerox.edmics-rlc":["rlc"],"image/vnd.microsoft.icon":["ico"],"image/vnd.ms-dds":["dds"],"image/vnd.ms-modi":["mdi"],"image/vnd.ms-photo":["wdp"],"image/vnd.net-fpx":["npx"],"image/vnd.pco.b16":["b16"],"image/vnd.tencent.tap":["tap"],"image/vnd.valve.source.texture":["vtf"],"image/vnd.wap.wbmp":["wbmp"],"image/vnd.xiff":["xif"],"image/vnd.zbrush.pcx":["pcx"],"image/x-3ds":["3ds"],"image/x-adobe-dng":["dng"],"image/x-cmu-raster":["ras"],"image/x-cmx":["cmx"],"image/x-freehand":["fh","fhc","fh4","fh5","fh7"],"image/x-icon":["*ico"],"image/x-jng":["jng"],"image/x-mrsid-image":["sid"],"image/x-ms-bmp":["*bmp"],"image/x-pcx":["*pcx"],"image/x-pict":["pic","pct"],"image/x-portable-anymap":["pnm"],"image/x-portable-bitmap":["pbm"],"image/x-portable-graymap":["pgm"],"image/x-portable-pixmap":["ppm"],"image/x-rgb":["rgb"],"image/x-tga":["tga"],"image/x-xbitmap":["xbm"],"image/x-xpixmap":["xpm"],"image/x-xwindowdump":["xwd"],"message/vnd.wfa.wsc":["wsc"],"model/vnd.bary":["bary"],"model/vnd.cld":["cld"],"model/vnd.collada+xml":["dae"],"model/vnd.dwf":["dwf"],"model/vnd.gdl":["gdl"],"model/vnd.gtw":["gtw"],"model/vnd.mts":["*mts"],"model/vnd.opengex":["ogex"],"model/vnd.parasolid.transmit.binary":["x_b"],"model/vnd.parasolid.transmit.text":["x_t"],"model/vnd.pytha.pyox":["pyo","pyox"],"model/vnd.sap.vds":["vds"],"model/vnd.usda":["usda"],"model/vnd.usdz+zip":["usdz"],"model/vnd.valve.source.compiled-map":["bsp"],"model/vnd.vtu":["vtu"],"text/prs.lines.tag":["dsc"],"text/vnd.curl":["curl"],"text/vnd.curl.dcurl":["dcurl"],"text/vnd.curl.mcurl":["mcurl"],"text/vnd.curl.scurl":["scurl"],"text/vnd.dvb.subtitle":["sub"],"text/vnd.familysearch.gedcom":["ged"],"text/vnd.fly":["fly"],"text/vnd.fmi.flexstor":["flx"],"text/vnd.graphviz":["gv"],"text/vnd.in3d.3dml":["3dml"],"text/vnd.in3d.spot":["spot"],"text/vnd.sun.j2me.app-descriptor":["jad"],"text/vnd.wap.wml":["wml"],"text/vnd.wap.wmlscript":["wmls"],"text/x-asm":["s","asm"],"text/x-c":["c","cc","cxx","cpp","h","hh","dic"],"text/x-component":["htc"],"text/x-fortran":["f","for","f77","f90"],"text/x-handlebars-template":["hbs"],"text/x-java-source":["java"],"text/x-lua":["lua"],"text/x-markdown":["mkd"],"text/x-nfo":["nfo"],"text/x-opml":["opml"],"text/x-org":["*org"],"text/x-pascal":["p","pas"],"text/x-processing":["pde"],"text/x-sass":["sass"],"text/x-scss":["scss"],"text/x-setext":["etx"],"text/x-sfv":["sfv"],"text/x-suse-ymp":["ymp"],"text/x-uuencode":["uu"],"text/x-vcalendar":["vcs"],"text/x-vcard":["vcf"],"video/vnd.dece.hd":["uvh","uvvh"],"video/vnd.dece.mobile":["uvm","uvvm"],"video/vnd.dece.pd":["uvp","uvvp"],"video/vnd.dece.sd":["uvs","uvvs"],"video/vnd.dece.video":["uvv","uvvv"],"video/vnd.dvb.file":["dvb"],"video/vnd.fvt":["fvt"],"video/vnd.mpegurl":["mxu","m4u"],"video/vnd.ms-playready.media.pyv":["pyv"],"video/vnd.uvvu.mp4":["uvu","uvvu"],"video/vnd.vivo":["viv"],"video/x-f4v":["f4v"],"video/x-fli":["fli"],"video/x-flv":["flv"],"video/x-m4v":["m4v"],"video/x-matroska":["mkv","mk3d","mks"],"video/x-mng":["mng"],"video/x-ms-asf":["asf","asx"],"video/x-ms-vob":["vob"],"video/x-ms-wm":["wm"],"video/x-ms-wmv":["wmv"],"video/x-ms-wmx":["wmx"],"video/x-ms-wvx":["wvx"],"video/x-msvideo":["avi"],"video/x-sgi-movie":["movie"],"video/x-smv":["smv"],"x-conference/x-cooltalk":["ice"]};Object.freeze(Hf);const Gf={"application/andrew-inset":["ez"],"application/appinstaller":["appinstaller"],"application/applixware":["aw"],"application/appx":["appx"],"application/appxbundle":["appxbundle"],"application/atom+xml":["atom"],"application/atomcat+xml":["atomcat"],"application/atomdeleted+xml":["atomdeleted"],"application/atomsvc+xml":["atomsvc"],"application/atsc-dwd+xml":["dwd"],"application/atsc-held+xml":["held"],"application/atsc-rsat+xml":["rsat"],"application/automationml-aml+xml":["aml"],"application/automationml-amlx+zip":["amlx"],"application/bdoc":["bdoc"],"application/calendar+xml":["xcs"],"application/ccxml+xml":["ccxml"],"application/cdfx+xml":["cdfx"],"application/cdmi-capability":["cdmia"],"application/cdmi-container":["cdmic"],"application/cdmi-domain":["cdmid"],"application/cdmi-object":["cdmio"],"application/cdmi-queue":["cdmiq"],"application/cpl+xml":["cpl"],"application/cu-seeme":["cu"],"application/cwl":["cwl"],"application/dash+xml":["mpd"],"application/dash-patch+xml":["mpp"],"application/davmount+xml":["davmount"],"application/dicom":["dcm"],"application/docbook+xml":["dbk"],"application/dssc+der":["dssc"],"application/dssc+xml":["xdssc"],"application/ecmascript":["ecma"],"application/emma+xml":["emma"],"application/emotionml+xml":["emotionml"],"application/epub+zip":["epub"],"application/exi":["exi"],"application/express":["exp"],"application/fdf":["fdf"],"application/fdt+xml":["fdt"],"application/font-tdpfr":["pfr"],"application/geo+json":["geojson"],"application/gml+xml":["gml"],"application/gpx+xml":["gpx"],"application/gxf":["gxf"],"application/gzip":["gz"],"application/hjson":["hjson"],"application/hyperstudio":["stk"],"application/inkml+xml":["ink","inkml"],"application/ipfix":["ipfix"],"application/its+xml":["its"],"application/java-archive":["jar","war","ear"],"application/java-serialized-object":["ser"],"application/java-vm":["class"],"application/javascript":["*js"],"application/json":["json","map"],"application/json5":["json5"],"application/jsonml+json":["jsonml"],"application/ld+json":["jsonld"],"application/lgr+xml":["lgr"],"application/lost+xml":["lostxml"],"application/mac-binhex40":["hqx"],"application/mac-compactpro":["cpt"],"application/mads+xml":["mads"],"application/manifest+json":["webmanifest"],"application/marc":["mrc"],"application/marcxml+xml":["mrcx"],"application/mathematica":["ma","nb","mb"],"application/mathml+xml":["mathml"],"application/mbox":["mbox"],"application/media-policy-dataset+xml":["mpf"],"application/mediaservercontrol+xml":["mscml"],"application/metalink+xml":["metalink"],"application/metalink4+xml":["meta4"],"application/mets+xml":["mets"],"application/mmt-aei+xml":["maei"],"application/mmt-usd+xml":["musd"],"application/mods+xml":["mods"],"application/mp21":["m21","mp21"],"application/mp4":["*mp4","*mpg4","mp4s","m4p"],"application/msix":["msix"],"application/msixbundle":["msixbundle"],"application/msword":["doc","dot"],"application/mxf":["mxf"],"application/n-quads":["nq"],"application/n-triples":["nt"],"application/node":["cjs"],"application/octet-stream":["bin","dms","lrf","mar","so","dist","distz","pkg","bpk","dump","elc","deploy","exe","dll","deb","dmg","iso","img","msi","msp","msm","buffer"],"application/oda":["oda"],"application/oebps-package+xml":["opf"],"application/ogg":["ogx"],"application/omdoc+xml":["omdoc"],"application/onenote":["onetoc","onetoc2","onetmp","onepkg","one","onea"],"application/oxps":["oxps"],"application/p2p-overlay+xml":["relo"],"application/patch-ops-error+xml":["xer"],"application/pdf":["pdf"],"application/pgp-encrypted":["pgp"],"application/pgp-keys":["asc"],"application/pgp-signature":["sig","*asc"],"application/pics-rules":["prf"],"application/pkcs10":["p10"],"application/pkcs7-mime":["p7m","p7c"],"application/pkcs7-signature":["p7s"],"application/pkcs8":["p8"],"application/pkix-attr-cert":["ac"],"application/pkix-cert":["cer"],"application/pkix-crl":["crl"],"application/pkix-pkipath":["pkipath"],"application/pkixcmp":["pki"],"application/pls+xml":["pls"],"application/postscript":["ai","eps","ps"],"application/provenance+xml":["provx"],"application/pskc+xml":["pskcxml"],"application/raml+yaml":["raml"],"application/rdf+xml":["rdf","owl"],"application/reginfo+xml":["rif"],"application/relax-ng-compact-syntax":["rnc"],"application/resource-lists+xml":["rl"],"application/resource-lists-diff+xml":["rld"],"application/rls-services+xml":["rs"],"application/route-apd+xml":["rapd"],"application/route-s-tsid+xml":["sls"],"application/route-usd+xml":["rusd"],"application/rpki-ghostbusters":["gbr"],"application/rpki-manifest":["mft"],"application/rpki-roa":["roa"],"application/rsd+xml":["rsd"],"application/rss+xml":["rss"],"application/rtf":["rtf"],"application/sbml+xml":["sbml"],"application/scvp-cv-request":["scq"],"application/scvp-cv-response":["scs"],"application/scvp-vp-request":["spq"],"application/scvp-vp-response":["spp"],"application/sdp":["sdp"],"application/senml+xml":["senmlx"],"application/sensml+xml":["sensmlx"],"application/set-payment-initiation":["setpay"],"application/set-registration-initiation":["setreg"],"application/shf+xml":["shf"],"application/sieve":["siv","sieve"],"application/smil+xml":["smi","smil"],"application/sparql-query":["rq"],"application/sparql-results+xml":["srx"],"application/sql":["sql"],"application/srgs":["gram"],"application/srgs+xml":["grxml"],"application/sru+xml":["sru"],"application/ssdl+xml":["ssdl"],"application/ssml+xml":["ssml"],"application/swid+xml":["swidtag"],"application/tei+xml":["tei","teicorpus"],"application/thraud+xml":["tfi"],"application/timestamped-data":["tsd"],"application/toml":["toml"],"application/trig":["trig"],"application/ttml+xml":["ttml"],"application/ubjson":["ubj"],"application/urc-ressheet+xml":["rsheet"],"application/urc-targetdesc+xml":["td"],"application/voicexml+xml":["vxml"],"application/wasm":["wasm"],"application/watcherinfo+xml":["wif"],"application/widget":["wgt"],"application/winhlp":["hlp"],"application/wsdl+xml":["wsdl"],"application/wspolicy+xml":["wspolicy"],"application/xaml+xml":["xaml"],"application/xcap-att+xml":["xav"],"application/xcap-caps+xml":["xca"],"application/xcap-diff+xml":["xdf"],"application/xcap-el+xml":["xel"],"application/xcap-ns+xml":["xns"],"application/xenc+xml":["xenc"],"application/xfdf":["xfdf"],"application/xhtml+xml":["xhtml","xht"],"application/xliff+xml":["xlf"],"application/xml":["xml","xsl","xsd","rng"],"application/xml-dtd":["dtd"],"application/xop+xml":["xop"],"application/xproc+xml":["xpl"],"application/xslt+xml":["*xsl","xslt"],"application/xspf+xml":["xspf"],"application/xv+xml":["mxml","xhvml","xvml","xvm"],"application/yang":["yang"],"application/yin+xml":["yin"],"application/zip":["zip"],"application/zip+dotlottie":["lottie"],"audio/3gpp":["*3gpp"],"audio/aac":["adts","aac"],"audio/adpcm":["adp"],"audio/amr":["amr"],"audio/basic":["au","snd"],"audio/midi":["mid","midi","kar","rmi"],"audio/mobile-xmf":["mxmf"],"audio/mp3":["*mp3"],"audio/mp4":["m4a","mp4a","m4b"],"audio/mpeg":["mpga","mp2","mp2a","mp3","m2a","m3a"],"audio/ogg":["oga","ogg","spx","opus"],"audio/s3m":["s3m"],"audio/silk":["sil"],"audio/wav":["wav"],"audio/wave":["*wav"],"audio/webm":["weba"],"audio/xm":["xm"],"font/collection":["ttc"],"font/otf":["otf"],"font/ttf":["ttf"],"font/woff":["woff"],"font/woff2":["woff2"],"image/aces":["exr"],"image/apng":["apng"],"image/avci":["avci"],"image/avcs":["avcs"],"image/avif":["avif"],"image/bmp":["bmp","dib"],"image/cgm":["cgm"],"image/dicom-rle":["drle"],"image/dpx":["dpx"],"image/emf":["emf"],"image/fits":["fits"],"image/g3fax":["g3"],"image/gif":["gif"],"image/heic":["heic"],"image/heic-sequence":["heics"],"image/heif":["heif"],"image/heif-sequence":["heifs"],"image/hej2k":["hej2"],"image/ief":["ief"],"image/jaii":["jaii"],"image/jais":["jais"],"image/jls":["jls"],"image/jp2":["jp2","jpg2"],"image/jpeg":["jpg","jpeg","jpe"],"image/jph":["jph"],"image/jphc":["jhc"],"image/jpm":["jpm","jpgm"],"image/jpx":["jpx","jpf"],"image/jxl":["jxl"],"image/jxr":["jxr"],"image/jxra":["jxra"],"image/jxrs":["jxrs"],"image/jxs":["jxs"],"image/jxsc":["jxsc"],"image/jxsi":["jxsi"],"image/jxss":["jxss"],"image/ktx":["ktx"],"image/ktx2":["ktx2"],"image/pjpeg":["jfif"],"image/png":["png"],"image/sgi":["sgi"],"image/svg+xml":["svg","svgz"],"image/t38":["t38"],"image/tiff":["tif","tiff"],"image/tiff-fx":["tfx"],"image/webp":["webp"],"image/wmf":["wmf"],"message/disposition-notification":["disposition-notification"],"message/global":["u8msg"],"message/global-delivery-status":["u8dsn"],"message/global-disposition-notification":["u8mdn"],"message/global-headers":["u8hdr"],"message/rfc822":["eml","mime","mht","mhtml"],"model/3mf":["3mf"],"model/gltf+json":["gltf"],"model/gltf-binary":["glb"],"model/iges":["igs","iges"],"model/jt":["jt"],"model/mesh":["msh","mesh","silo"],"model/mtl":["mtl"],"model/obj":["obj"],"model/prc":["prc"],"model/step":["step","stp","stpnc","p21","210"],"model/step+xml":["stpx"],"model/step+zip":["stpz"],"model/step-xml+zip":["stpxz"],"model/stl":["stl"],"model/u3d":["u3d"],"model/vrml":["wrl","vrml"],"model/x3d+binary":["*x3db","x3dbz"],"model/x3d+fastinfoset":["x3db"],"model/x3d+vrml":["*x3dv","x3dvz"],"model/x3d+xml":["x3d","x3dz"],"model/x3d-vrml":["x3dv"],"text/cache-manifest":["appcache","manifest"],"text/calendar":["ics","ifb"],"text/coffeescript":["coffee","litcoffee"],"text/css":["css"],"text/csv":["csv"],"text/html":["html","htm","shtml"],"text/jade":["jade"],"text/javascript":["js","mjs"],"text/jsx":["jsx"],"text/less":["less"],"text/markdown":["md","markdown"],"text/mathml":["mml"],"text/mdx":["mdx"],"text/n3":["n3"],"text/plain":["txt","text","conf","def","list","log","in","ini"],"text/richtext":["rtx"],"text/rtf":["*rtf"],"text/sgml":["sgml","sgm"],"text/shex":["shex"],"text/slim":["slim","slm"],"text/spdx":["spdx"],"text/stylus":["stylus","styl"],"text/tab-separated-values":["tsv"],"text/troff":["t","tr","roff","man","me","ms"],"text/turtle":["ttl"],"text/uri-list":["uri","uris","urls"],"text/vcard":["vcard"],"text/vtt":["vtt"],"text/wgsl":["wgsl"],"text/xml":["*xml"],"text/yaml":["yaml","yml"],"video/3gpp":["3gp","3gpp"],"video/3gpp2":["3g2"],"video/h261":["h261"],"video/h263":["h263"],"video/h264":["h264"],"video/iso.segment":["m4s"],"video/jpeg":["jpgv"],"video/jpm":["*jpm","*jpgm"],"video/mj2":["mj2","mjp2"],"video/mp2t":["ts","m2t","m2ts","mts"],"video/mp4":["mp4","mp4v","mpg4"],"video/mpeg":["mpeg","mpg","mpe","m1v","m2v"],"video/ogg":["ogv"],"video/quicktime":["qt","mov"],"video/webm":["webm"]};Object.freeze(Gf);var Mt=function(n,e,t,i){if(t==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?n!==e||!i:!e.has(n))throw new TypeError("Cannot read private member from an object whose class did not declare it");return t==="m"?i:t==="a"?i.call(n):i?i.value:e.get(n)},ki,rr,Jn;class Lm{constructor(...e){ki.set(this,new Map),rr.set(this,new Map),Jn.set(this,new Map);for(const t of e)this.define(t)}define(e,t=!1){for(let[i,r]of Object.entries(e)){i=i.toLowerCase(),r=r.map(l=>l.toLowerCase()),Mt(this,Jn,"f").has(i)||Mt(this,Jn,"f").set(i,new Set);const s=Mt(this,Jn,"f").get(i);let a=!0;for(let l of r){const d=l.startsWith("*");if(l=d?l.slice(1):l,s?.add(l),a&&Mt(this,rr,"f").set(i,l),a=!1,d)continue;const h=Mt(this,ki,"f").get(l);if(h&&h!=i&&!t)throw new Error(`"${i} -> ${l}" conflicts with "${h} -> ${l}". Pass \`force=true\` to override this definition.`);Mt(this,ki,"f").set(l,i)}}return this}getType(e){if(typeof e!="string")return null;const t=e.replace(/^.*[/\\]/s,"").toLowerCase(),i=t.replace(/^.*\./s,"").toLowerCase(),r=t.length<e.length;return!(i.length<t.length-1)&&r?null:Mt(this,ki,"f").get(i)??null}getExtension(e){return typeof e!="string"?null:(e=e?.split?.(";")[0],(e&&Mt(this,rr,"f").get(e.trim().toLowerCase()))??null)}getAllExtensions(e){return typeof e!="string"?null:Mt(this,Jn,"f").get(e.toLowerCase())??null}_freeze(){this.define=()=>{throw new Error("define() not allowed for built-in Mime objects. See https://github.com/broofa/mime/blob/main/README.md#custom-mime-instances")},Object.freeze(this);for(const e of Mt(this,Jn,"f").values())Object.freeze(e);return this}_getTestState(){return{types:Mt(this,ki,"f"),extensions:Mt(this,rr,"f")}}}ki=new WeakMap,rr=new WeakMap,Jn=new WeakMap;var Bm=new Lm(Gf,Hf)._freeze(),Fm=Object.getOwnPropertyDescriptor,Dm=(n,e,t,i)=>{for(var r=i>1?void 0:i?Fm(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Go=(n,e)=>(t,i)=>e(t,i,n);let Pa=class extends Cr{constructor(n,e,t){super(n,"storage.components.githubStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=t}ATTACHMENTS="attachments";async isStorageReady(){return!0}getPageRestURL(n,e,t){this.logger?.debug("GitHub Loading page",n);let i=`${this.wikiConfig.baseRestURL}/contents/${n}`;return t&&(i=`${i}?ref=${t}`),i}getPageRestMetaURL(n,e,t){const i=n.split("/");i[i.length-1]=`.${i[i.length-1]}`;let r=`${this.wikiConfig.baseRestURL}/contents/${i.join("/")}`;return t&&(r=`${r}?ref=${t}`),r}getPageFromViewURL(n){let e=null;return n.startsWith(this.wikiConfig.baseURL)&&(e=n.replace(this.wikiConfig.baseURL,"")),e}getImageURL(n,e){const t=n.replace(/[^/]*$/,"");return`${this.wikiConfig.baseURL}/${t}${e}`}hashCode=function(n){let e=0,t,i;if(n.length===0)return""+e;for(t=0;t<n.length;t++)i=n.charCodeAt(t),e=(e<<5)-e+i,e|=0;return""+e};async getPageContent(n,e,t){this.logger?.debug("GitHub Loading page",n);const i=this.getPageRestURL(`${n}.md`,e,t),r=await fetch(i,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.raw+json"}});if(r.status>=200&&r.status<300){const{content:s,...a}=new Vf().readPage(await r.text()),{date:l,name:d,username:h}=await this.getLastEditDetails(n,t);return Object.assign(new jn,{source:s,syntax:"markdown/1.2",...a,id:n,headline:a.name,headlineRaw:a.name,canEdit:await this.authenticationManagerProvider.get()?.isAuthenticated()??!1,lastModificationDate:l,lastAuthor:{name:d,username:h}})}else return}async getAttachments(n){const e=`${this.getPageRestMetaURL(n,"")}/${this.ATTACHMENTS}`,t=await fetch(e,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.raw+json"}});if(t.status>=200&&t.status<300){const i=await t.json();return{attachments:await Promise.all(i.map(async r=>await this.getAttachment(n,r.name))),count:i.length}}else return{attachments:[],count:0}}async getAttachment(n,e){const t=`${this.getPageRestMetaURL(n,"")}/${this.ATTACHMENTS}/${e}`,i=await fetch(t,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}});if(i.status>=200&&i.status<300){const r=await i.json(),s=new URL(`${this.wikiConfig.baseRestURL}/commits`);s.search=new URLSearchParams([["path",r.path],["per_page","1"]]).toString();const l=await(await fetch(s,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{reference:r.name,id:r.path,size:r.size,href:r.download_url,mimetype:Bm.getType(r.name)??"",date:new Date(l[0].commit.author.date),author:l[0].commit.author.name}}else return}async getPanelContent(){return new jn}async getEditField(){return""}async save(n,e,t){const i=this.getPageRestURL(`${n}.md`,""),r=await fetch(i,{method:"HEAD",cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}}),s=r.status>=200&&r.status<300?r.headers.get("ETag").slice(3,-1):void 0,a=new Wf().writePage({content:t,name:e,syntax:"markdown/1.2"}),l=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({content:btoa(a),message:`Update ${n}`,sha:s})});if(!l.ok){const d=await l.text();throw this.alertsServiceProvider.get().error(`Could not save page ${n}. Reason: ${d}`),new Error(d)}}async saveAttachments(n,e){const t=[];for(const i of e){const r=`${this.getPageRestMetaURL(n,"")}/${this.ATTACHMENTS}/${i.name}`,s=await this.computeAttachmentSHA(r);t.push(this.uploadAttachment(r,i,s,n))}return Promise.all(t)}async computeAttachmentSHA(n){const e=await fetch(n,{method:"HEAD",cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github.object+json"}});return e.status>=200&&e.status<300?e.headers.get("ETag").slice(3,-1):void 0}uploadAttachment(n,e,t,i){return new Promise(r=>{const s=new FileReader;s.onload=async()=>{const a=await fetch(n,{method:"PUT",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({content:s.result.split(",")[1],message:`Upload ${e.name}`,sha:t})});if(a.ok)r((await a.json()).content.download_url);else{const l=await a.text();this.alertsServiceProvider.get().error(`Could not upload attachment ${e.name} for page ${i}. Reason: ${l}`),r(void 0)}},s.readAsDataURL(e)})}async delete(n){const e=this.wikiConfig.baseURL.split("/").pop(),t=(await(await fetch(`${this.wikiConfig.baseRestURL}/git/ref/heads/${e}`,{method:"GET",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()}})).json()).object.sha,i=await fetch(`${this.wikiConfig.baseRestURL}/git/trees`,{method:"POST",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({base_tree:e,tree:[{path:`${n}.md`,mode:"040000",type:"tree",sha:null}]})});if(!i.ok)return{success:!1,error:await i.text()};const r=await fetch(`${this.wikiConfig.baseRestURL}/git/commits`,{method:"POST",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({tree:(await i.json()).sha,message:`Delete ${n}`,parents:[t]})});return r.ok?await fetch(`${this.wikiConfig.baseRestURL}/git/refs/heads/${e}`,{method:"PATCH",headers:{"Content-Type":"application/vnd.github+json",...await this.getCredentials()},body:JSON.stringify({sha:(await r.json()).sha})}).then(async s=>s.ok?{success:!0}:{success:!1,error:await s.text()}):{success:!1,error:await r.text()}}async move(){throw new Error("Move not supported")}async getCredentials(){const n=await this.authenticationManagerProvider.get()?.getAuthorizationHeader(),e={};return n&&(e.Authorization=n),e}async getLastEditDetails(n,e){if(e){const t=new URL(`${this.wikiConfig.baseRestURL}/commits/${e}`),r=await(await fetch(t,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{date:new Date(r.commit.author.date),username:r.commit.author.login,name:r.commit.author.name}}else{const t=new URL(`${this.wikiConfig.baseRestURL}/commits`);t.search=new URLSearchParams([["path",`${n}.md`],["per_page","1"]]).toString();const r=await(await fetch(t,{cache:"no-store",headers:{...await this.getCredentials(),Accept:"application/vnd.github+json"}})).json();return{date:new Date(r[0].commit.author.date),username:r[0].commit.author.login,name:r[0].commit.author.name}}}};Pa=Dm([it(),Go(0,Le("Logger")),Go(1,Le("AuthenticationManagerProvider")),Go(2,Le("AlertsServiceProvider"))],Pa);function Cc(n){return e=>e.name==n||e.name==null}let Km=class{constructor(e){e.bind("WikiConfig").to(ka).when(Cc("GitHub")),e.bind("Storage").to(Pa).whenNamed("GitHub")}};var qm=Object.getOwnPropertyDescriptor,Um=(n,e,t,i)=>{for(var r=i>1?void 0:i?qm(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},gs=(n,e)=>(t,i)=>e(t,i,n);let Ta=class extends Sr{storage;cristal;constructor(n,e,t){super(n),this.cristal=t,this.storage=e,this.storage.setWikiConfig(this)}isSupported(n){return n=="html"}defaultPageName(){return"home"}getType(){return"Nextcloud"}};Ta=Um([it(),gs(0,Le("Logger")),gs(1,Le("Storage")),gs(1,tc("Nextcloud")),gs(2,Le("CristalApp"))],Ta);class zm{type=1;wiki;names;constructor(e,...t){this.wiki=e,this.names=t}}class Vm{type=2;space;name;terminal;constructor(e,t,i){this.space=t,this.name=e,this.terminal=i??!1}}const Yf=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Wm=Yf+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",Hm="["+Yf+"]["+Wm+"]*",Gm=new RegExp("^"+Hm+"$");function Jf(n,e){const t=[];let i=e.exec(n);for(;i;){const r=[];r.startIndex=e.lastIndex-i[0].length;const s=i.length;for(let a=0;a<s;a++)r.push(i[a]);t.push(r),i=e.exec(n)}return t}const to=function(n){const e=Gm.exec(n);return!(e===null||typeof e>"u")};function Ym(n){return typeof n<"u"}const Ec=["hasOwnProperty","toString","valueOf","__defineGetter__","__defineSetter__","__lookupGetter__","__lookupSetter__"],Qf=["__proto__","constructor","prototype"],Jm={allowBooleanAttributes:!1,unpairedTags:[]};function Qm(n,e){e=Object.assign({},Jm,e);const t=[];let i=!1,r=!1;n[0]==="\uFEFF"&&(n=n.substr(1));for(let s=0;s<n.length;s++)if(n[s]==="<"&&n[s+1]==="?"){if(s+=2,s=tu(n,s),s.err)return s}else if(n[s]==="<"){let a=s;if(s++,n[s]==="!"){s=nu(n,s);continue}else{let l=!1;n[s]==="/"&&(l=!0,s++);let d="";for(;s<n.length&&n[s]!==">"&&n[s]!==" "&&n[s]!==" "&&n[s]!==`
|
|
186
|
-
`&&n[s]!=="\r";s++)d+=n[s];if(d=d.trim(),d[d.length-1]==="/"&&(d=d.substring(0,d.length-1),s--),!sv(d)){let v;return d.trim().length===0?v="Invalid space after '<'.":v="Tag '"+d+"' is an invalid name.",Je("InvalidTag",v,yt(n,s))}const h=ev(n,s);if(h===!1)return Je("InvalidAttr","Attributes for '"+d+"' have open quote.",yt(n,s));let m=h.value;if(s=h.index,m[m.length-1]==="/"){const v=s-m.length;m=m.substring(0,m.length-1);const w=iu(m,e);if(w===!0)i=!0;else return Je(w.err.code,w.err.msg,yt(n,v+w.err.line))}else if(l)if(h.tagClosed){if(m.trim().length>0)return Je("InvalidTag","Closing tag '"+d+"' can't have attributes or invalid starting.",yt(n,a));if(t.length===0)return Je("InvalidTag","Closing tag '"+d+"' has not been opened.",yt(n,a));{const v=t.pop();if(d!==v.tagName){let w=yt(n,v.tagStartPos);return Je("InvalidTag","Expected closing tag '"+v.tagName+"' (opened in line "+w.line+", col "+w.col+") instead of closing tag '"+d+"'.",yt(n,a))}t.length==0&&(r=!0)}}else return Je("InvalidTag","Closing tag '"+d+"' doesn't have proper closing.",yt(n,s));else{const v=iu(m,e);if(v!==!0)return Je(v.err.code,v.err.msg,yt(n,s-m.length+v.err.line));if(r===!0)return Je("InvalidXml","Multiple possible root nodes found.",yt(n,s));e.unpairedTags.indexOf(d)!==-1||t.push({tagName:d,tagStartPos:a}),i=!0}for(s++;s<n.length;s++)if(n[s]==="<")if(n[s+1]==="!"){s++,s=nu(n,s);continue}else if(n[s+1]==="?"){if(s=tu(n,++s),s.err)return s}else break;else if(n[s]==="&"){const v=iv(n,s);if(v==-1)return Je("InvalidChar","char '&' is not expected.",yt(n,s));s=v}else if(r===!0&&!eu(n[s]))return Je("InvalidXml","Extra text at the end",yt(n,s));n[s]==="<"&&s--}}else{if(eu(n[s]))continue;return Je("InvalidChar","char '"+n[s]+"' is not expected.",yt(n,s))}if(i){if(t.length==1)return Je("InvalidTag","Unclosed tag '"+t[0].tagName+"'.",yt(n,t[0].tagStartPos));if(t.length>0)return Je("InvalidXml","Invalid '"+JSON.stringify(t.map(s=>s.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Je("InvalidXml","Start tag expected.",1);return!0}function eu(n){return n===" "||n===" "||n===`
|
|
187
|
-
`||n==="\r"}function tu(n,e){const t=e;for(;e<n.length;e++)if(n[e]=="?"||n[e]==" "){const i=n.substr(t,e-t);if(e>5&&i==="xml")return Je("InvalidXml","XML declaration allowed only at the start of the document.",yt(n,e));if(n[e]=="?"&&n[e+1]==">"){e++;break}else continue}return e}function nu(n,e){if(n.length>e+5&&n[e+1]==="-"&&n[e+2]==="-"){for(e+=3;e<n.length;e++)if(n[e]==="-"&&n[e+1]==="-"&&n[e+2]===">"){e+=2;break}}else if(n.length>e+8&&n[e+1]==="D"&&n[e+2]==="O"&&n[e+3]==="C"&&n[e+4]==="T"&&n[e+5]==="Y"&&n[e+6]==="P"&&n[e+7]==="E"){let t=1;for(e+=8;e<n.length;e++)if(n[e]==="<")t++;else if(n[e]===">"&&(t--,t===0))break}else if(n.length>e+9&&n[e+1]==="["&&n[e+2]==="C"&&n[e+3]==="D"&&n[e+4]==="A"&&n[e+5]==="T"&&n[e+6]==="A"&&n[e+7]==="["){for(e+=8;e<n.length;e++)if(n[e]==="]"&&n[e+1]==="]"&&n[e+2]===">"){e+=2;break}}return e}const Xm='"',Zm="'";function ev(n,e){let t="",i="",r=!1;for(;e<n.length;e++){if(n[e]===Xm||n[e]===Zm)i===""?i=n[e]:i!==n[e]||(i="");else if(n[e]===">"&&i===""){r=!0;break}t+=n[e]}return i!==""?!1:{value:t,index:e,tagClosed:r}}const tv=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function iu(n,e){const t=Jf(n,tv),i={};for(let r=0;r<t.length;r++){if(t[r][1].length===0)return Je("InvalidAttr","Attribute '"+t[r][2]+"' has no space in starting.",Zi(t[r]));if(t[r][3]!==void 0&&t[r][4]===void 0)return Je("InvalidAttr","Attribute '"+t[r][2]+"' is without value.",Zi(t[r]));if(t[r][3]===void 0&&!e.allowBooleanAttributes)return Je("InvalidAttr","boolean attribute '"+t[r][2]+"' is not allowed.",Zi(t[r]));const s=t[r][2];if(!rv(s))return Je("InvalidAttr","Attribute '"+s+"' is an invalid name.",Zi(t[r]));if(!Object.prototype.hasOwnProperty.call(i,s))i[s]=1;else return Je("InvalidAttr","Attribute '"+s+"' is repeated.",Zi(t[r]))}return!0}function nv(n,e){let t=/\d/;for(n[e]==="x"&&(e++,t=/[\da-fA-F]/);e<n.length;e++){if(n[e]===";")return e;if(!n[e].match(t))break}return-1}function iv(n,e){if(e++,n[e]===";")return-1;if(n[e]==="#")return e++,nv(n,e);let t=0;for(;e<n.length;e++,t++)if(!(n[e].match(/\w/)&&t<20)){if(n[e]===";")break;return-1}return e}function Je(n,e,t){return{err:{code:n,msg:e,line:t.line||t,col:t.col}}}function rv(n){return to(n)}function sv(n){return to(n)}function yt(n,e){const t=n.substring(0,e).split(/\r?\n/);return{line:t.length,col:t[t.length-1].length+1}}function Zi(n){return n.startIndex+n[1].length}const Xf=n=>Ec.includes(n)?"__"+n:n,ov={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(n,e){return e},attributeValueProcessor:function(n,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(n,e,t){return n},captureMetaData:!1,maxNestedTags:100,strictReservedNames:!0,jPath:!0,onDangerousProperty:Xf};function av(n,e){if(typeof n!="string")return;const t=n.toLowerCase();if(Ec.some(i=>t===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`);if(Qf.some(i=>t===i.toLowerCase()))throw new Error(`[SECURITY] Invalid ${e}: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`)}function Zf(n){return typeof n=="boolean"?{enabled:n,maxEntitySize:1e4,maxExpansionDepth:10,maxTotalExpansions:1e3,maxExpandedLength:1e5,maxEntityCount:100,allowedTags:null,tagFilter:null}:typeof n=="object"&&n!==null?{enabled:n.enabled!==!1,maxEntitySize:Math.max(1,n.maxEntitySize??1e4),maxExpansionDepth:Math.max(1,n.maxExpansionDepth??10),maxTotalExpansions:Math.max(1,n.maxTotalExpansions??1e3),maxExpandedLength:Math.max(1,n.maxExpandedLength??1e5),maxEntityCount:Math.max(1,n.maxEntityCount??100),allowedTags:n.allowedTags??null,tagFilter:n.tagFilter??null}:Zf(!0)}const cv=function(n){const e=Object.assign({},ov,n),t=[{value:e.attributeNamePrefix,name:"attributeNamePrefix"},{value:e.attributesGroupName,name:"attributesGroupName"},{value:e.textNodeName,name:"textNodeName"},{value:e.cdataPropName,name:"cdataPropName"},{value:e.commentPropName,name:"commentPropName"}];for(const{value:i,name:r}of t)i&&av(i,r);return e.onDangerousProperty===null&&(e.onDangerousProperty=Xf),e.processEntities=Zf(e.processEntities),e.stopNodes&&Array.isArray(e.stopNodes)&&(e.stopNodes=e.stopNodes.map(i=>typeof i=="string"&&i.startsWith("*.")?".."+i.substring(2):i)),e};let $s;typeof Symbol!="function"?$s="@@xmlMetadata":$s=Symbol("XML Node Metadata");class An{constructor(e){this.tagname=e,this.child=[],this[":@"]=Object.create(null)}add(e,t){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:t})}addChild(e,t){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][$s]={startIndex:t})}static getMetaDataSymbol(){return $s}}class lv{constructor(e){this.suppressValidationErr=!e,this.options=e}readDocType(e,t){const i=Object.create(null);let r=0;if(e[t+3]==="O"&&e[t+4]==="C"&&e[t+5]==="T"&&e[t+6]==="Y"&&e[t+7]==="P"&&e[t+8]==="E"){t=t+9;let s=1,a=!1,l=!1,d="";for(;t<e.length;t++)if(e[t]==="<"&&!l){if(a&&Hn(e,"!ENTITY",t)){t+=7;let h,m;if([h,m,t]=this.readEntityExp(e,t+1,this.suppressValidationErr),m.indexOf("&")===-1){if(this.options.enabled!==!1&&this.options.maxEntityCount!=null&&r>=this.options.maxEntityCount)throw new Error(`Entity count (${r+1}) exceeds maximum allowed (${this.options.maxEntityCount})`);const v=h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");i[h]={regx:RegExp(`&${v};`,"g"),val:m},r++}}else if(a&&Hn(e,"!ELEMENT",t)){t+=8;const{index:h}=this.readElementExp(e,t+1);t=h}else if(a&&Hn(e,"!ATTLIST",t))t+=8;else if(a&&Hn(e,"!NOTATION",t)){t+=9;const{index:h}=this.readNotationExp(e,t+1,this.suppressValidationErr);t=h}else if(Hn(e,"!--",t))l=!0;else throw new Error("Invalid DOCTYPE");s++,d=""}else if(e[t]===">"){if(l?e[t-1]==="-"&&e[t-2]==="-"&&(l=!1,s--):s--,s===0)break}else e[t]==="["?a=!0:d+=e[t];if(s!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:i,i:t}}readEntityExp(e,t){t=_t(e,t);const i=t;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!=='"'&&e[t]!=="'";)t++;let r=e.substring(i,t);if(er(r),t=_t(e,t),!this.suppressValidationErr){if(e.substring(t,t+6).toUpperCase()==="SYSTEM")throw new Error("External entities are not supported");if(e[t]==="%")throw new Error("Parameter entities are not supported")}let s="";if([t,s]=this.readIdentifierVal(e,t,"entity"),this.options.enabled!==!1&&this.options.maxEntitySize!=null&&s.length>this.options.maxEntitySize)throw new Error(`Entity "${r}" size (${s.length}) exceeds maximum allowed size (${this.options.maxEntitySize})`);return t--,[r,s,t]}readNotationExp(e,t){t=_t(e,t);const i=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(i,t);!this.suppressValidationErr&&er(r),t=_t(e,t);const s=e.substring(t,t+6).toUpperCase();if(!this.suppressValidationErr&&s!=="SYSTEM"&&s!=="PUBLIC")throw new Error(`Expected SYSTEM or PUBLIC, found "${s}"`);t+=s.length,t=_t(e,t);let a=null,l=null;if(s==="PUBLIC")[t,a]=this.readIdentifierVal(e,t,"publicIdentifier"),t=_t(e,t),(e[t]==='"'||e[t]==="'")&&([t,l]=this.readIdentifierVal(e,t,"systemIdentifier"));else if(s==="SYSTEM"&&([t,l]=this.readIdentifierVal(e,t,"systemIdentifier"),!this.suppressValidationErr&&!l))throw new Error("Missing mandatory system identifier for SYSTEM notation");return{notationName:r,publicIdentifier:a,systemIdentifier:l,index:--t}}readIdentifierVal(e,t,i){let r="";const s=e[t];if(s!=='"'&&s!=="'")throw new Error(`Expected quoted string, found "${s}"`);t++;const a=t;for(;t<e.length&&e[t]!==s;)t++;if(r=e.substring(a,t),e[t]!==s)throw new Error(`Unterminated ${i} value`);return t++,[t,r]}readElementExp(e,t){t=_t(e,t);const i=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(i,t);if(!this.suppressValidationErr&&!to(r))throw new Error(`Invalid element name: "${r}"`);t=_t(e,t);let s="";if(e[t]==="E"&&Hn(e,"MPTY",t))t+=4;else if(e[t]==="A"&&Hn(e,"NY",t))t+=2;else if(e[t]==="("){t++;const a=t;for(;t<e.length&&e[t]!==")";)t++;if(s=e.substring(a,t),e[t]!==")")throw new Error("Unterminated content model")}else if(!this.suppressValidationErr)throw new Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:r,contentModel:s.trim(),index:t}}readAttlistExp(e,t){t=_t(e,t);let i=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;let r=e.substring(i,t);for(er(r),t=_t(e,t),i=t;t<e.length&&!/\s/.test(e[t]);)t++;let s=e.substring(i,t);if(!er(s))throw new Error(`Invalid attribute name: "${s}"`);t=_t(e,t);let a="";if(e.substring(t,t+8).toUpperCase()==="NOTATION"){if(a="NOTATION",t+=8,t=_t(e,t),e[t]!=="(")throw new Error(`Expected '(', found "${e[t]}"`);t++;let d=[];for(;t<e.length&&e[t]!==")";){const h=t;for(;t<e.length&&e[t]!=="|"&&e[t]!==")";)t++;let m=e.substring(h,t);if(m=m.trim(),!er(m))throw new Error(`Invalid notation name: "${m}"`);d.push(m),e[t]==="|"&&(t++,t=_t(e,t))}if(e[t]!==")")throw new Error("Unterminated list of notations");t++,a+=" ("+d.join("|")+")"}else{const d=t;for(;t<e.length&&!/\s/.test(e[t]);)t++;a+=e.substring(d,t);const h=["CDATA","ID","IDREF","IDREFS","ENTITY","ENTITIES","NMTOKEN","NMTOKENS"];if(!this.suppressValidationErr&&!h.includes(a.toUpperCase()))throw new Error(`Invalid attribute type: "${a}"`)}t=_t(e,t);let l="";return e.substring(t,t+8).toUpperCase()==="#REQUIRED"?(l="#REQUIRED",t+=8):e.substring(t,t+7).toUpperCase()==="#IMPLIED"?(l="#IMPLIED",t+=7):[t,l]=this.readIdentifierVal(e,t,"ATTLIST"),{elementName:r,attributeName:s,attributeType:a,defaultValue:l,index:t}}}const _t=(n,e)=>{for(;e<n.length&&/\s/.test(n[e]);)e++;return e};function Hn(n,e,t){for(let i=0;i<e.length;i++)if(e[i]!==n[t+i+1])return!1;return!0}function er(n){if(to(n))return n;throw new Error(`Invalid entity name ${n}`)}const uv=/^[-+]?0x[a-fA-F0-9]+$/,fv=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,dv={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0,infinity:"original"};function pv(n,e={}){if(e=Object.assign({},dv,e),!n||typeof n!="string")return n;let t=n.trim();if(e.skipLike!==void 0&&e.skipLike.test(t))return n;if(n==="0")return 0;if(e.hex&&uv.test(t))return vv(t,16);if(isFinite(t)){if(t.includes("e")||t.includes("E"))return gv(n,t,e);{const i=fv.exec(t);if(i){const r=i[1]||"",s=i[2];let a=mv(i[3]);const l=r?n[s.length+1]===".":n[s.length]===".";if(!e.leadingZeros&&(s.length>1||s.length===1&&!l))return n;{const d=Number(t),h=String(d);if(d===0)return d;if(h.search(/[eE]/)!==-1)return e.eNotation?d:n;if(t.indexOf(".")!==-1)return h==="0"||h===a||h===`${r}${a}`?d:n;let m=s?a:t;return s?m===h||r+m===h?d:n:m===h||m===r+h?d:n}}else return n}}else return yv(n,Number(t),e)}const hv=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function gv(n,e,t){if(!t.eNotation)return n;const i=e.match(hv);if(i){let r=i[1]||"";const s=i[3].indexOf("e")===-1?"E":"e",a=i[2],l=r?n[a.length+1]===s:n[a.length]===s;return a.length>1&&l?n:a.length===1&&(i[3].startsWith(`.${s}`)||i[3][0]===s)?Number(e):a.length>0?t.leadingZeros&&!l?(e=(i[1]||"")+i[3],Number(e)):n:Number(e)}else return n}function mv(n){return n&&n.indexOf(".")!==-1&&(n=n.replace(/0+$/,""),n==="."?n="0":n[0]==="."?n="0"+n:n[n.length-1]==="."&&(n=n.substring(0,n.length-1))),n}function vv(n,e){if(parseInt)return parseInt(n,e);if(Number.parseInt)return Number.parseInt(n,e);if(window&&window.parseInt)return window.parseInt(n,e);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}function yv(n,e,t){const i=e===1/0;switch(t.infinity.toLowerCase()){case"null":return null;case"infinity":return e;case"string":return i?"Infinity":"-Infinity";default:return n}}function bv(n){return typeof n=="function"?n:Array.isArray(n)?e=>{for(const t of n)if(typeof t=="string"&&e===t||t instanceof RegExp&&t.test(e))return!0}:()=>!1}class ru{constructor(e,t={}){this.pattern=e,this.separator=t.separator||".",this.segments=this._parse(e),this._hasDeepWildcard=this.segments.some(i=>i.type==="deep-wildcard"),this._hasAttributeCondition=this.segments.some(i=>i.attrName!==void 0),this._hasPositionSelector=this.segments.some(i=>i.position!==void 0)}_parse(e){const t=[];let i=0,r="";for(;i<e.length;)e[i]===this.separator?i+1<e.length&&e[i+1]===this.separator?(r.trim()&&(t.push(this._parseSegment(r.trim())),r=""),t.push({type:"deep-wildcard"}),i+=2):(r.trim()&&t.push(this._parseSegment(r.trim())),r="",i++):(r+=e[i],i++);return r.trim()&&t.push(this._parseSegment(r.trim())),t}_parseSegment(e){const t={type:"tag"};let i=null,r=e;const s=e.match(/^([^\[]+)(\[[^\]]*\])(.*)$/);if(s&&(r=s[1]+s[3],s[2])){const m=s[2].slice(1,-1);m&&(i=m)}let a,l=r;if(r.includes("::")){const m=r.indexOf("::");if(a=r.substring(0,m).trim(),l=r.substring(m+2).trim(),!a)throw new Error(`Invalid namespace in pattern: ${e}`)}let d,h=null;if(l.includes(":")){const m=l.lastIndexOf(":"),v=l.substring(0,m).trim(),w=l.substring(m+1).trim();["first","last","odd","even"].includes(w)||/^nth\(\d+\)$/.test(w)?(d=v,h=w):d=l}else d=l;if(!d)throw new Error(`Invalid segment pattern: ${e}`);if(t.tag=d,a&&(t.namespace=a),i)if(i.includes("=")){const m=i.indexOf("=");t.attrName=i.substring(0,m).trim(),t.attrValue=i.substring(m+1).trim()}else t.attrName=i.trim();if(h){const m=h.match(/^nth\((\d+)\)$/);m?(t.position="nth",t.positionValue=parseInt(m[1],10)):t.position=h}return t}get length(){return this.segments.length}hasDeepWildcard(){return this._hasDeepWildcard}hasAttributeCondition(){return this._hasAttributeCondition}hasPositionSelector(){return this._hasPositionSelector}toString(){return this.pattern}}class wv{constructor(e={}){this.separator=e.separator||".",this.path=[],this.siblingStacks=[]}push(e,t=null,i=null){if(this.path.length>0){const m=this.path[this.path.length-1];m.values=void 0}const r=this.path.length;this.siblingStacks[r]||(this.siblingStacks[r]=new Map);const s=this.siblingStacks[r],a=i?`${i}:${e}`:e,l=s.get(a)||0;let d=0;for(const m of s.values())d+=m;s.set(a,l+1);const h={tag:e,position:d,counter:l};i!=null&&(h.namespace=i),t!=null&&(h.values=t),this.path.push(h)}pop(){if(this.path.length===0)return;const e=this.path.pop();return this.siblingStacks.length>this.path.length+1&&(this.siblingStacks.length=this.path.length+1),e}updateCurrent(e){if(this.path.length>0){const t=this.path[this.path.length-1];e!=null&&(t.values=e)}}getCurrentTag(){return this.path.length>0?this.path[this.path.length-1].tag:void 0}getCurrentNamespace(){return this.path.length>0?this.path[this.path.length-1].namespace:void 0}getAttrValue(e){return this.path.length===0?void 0:this.path[this.path.length-1].values?.[e]}hasAttr(e){if(this.path.length===0)return!1;const t=this.path[this.path.length-1];return t.values!==void 0&&e in t.values}getPosition(){return this.path.length===0?-1:this.path[this.path.length-1].position??0}getCounter(){return this.path.length===0?-1:this.path[this.path.length-1].counter??0}getIndex(){return this.getPosition()}getDepth(){return this.path.length}toString(e,t=!0){const i=e||this.separator;return this.path.map(r=>t&&r.namespace?`${r.namespace}:${r.tag}`:r.tag).join(i)}toArray(){return this.path.map(e=>e.tag)}reset(){this.path=[],this.siblingStacks=[]}matches(e){const t=e.segments;return t.length===0?!1:e.hasDeepWildcard()?this._matchWithDeepWildcard(t):this._matchSimple(t)}_matchSimple(e){if(this.path.length!==e.length)return!1;for(let t=0;t<e.length;t++){const i=e[t],r=this.path[t],s=t===this.path.length-1;if(!this._matchSegment(i,r,s))return!1}return!0}_matchWithDeepWildcard(e){let t=this.path.length-1,i=e.length-1;for(;i>=0&&t>=0;){const r=e[i];if(r.type==="deep-wildcard"){if(i--,i<0)return!0;const s=e[i];let a=!1;for(let l=t;l>=0;l--){const d=l===this.path.length-1;if(this._matchSegment(s,this.path[l],d)){t=l-1,i--,a=!0;break}}if(!a)return!1}else{const s=t===this.path.length-1;if(!this._matchSegment(r,this.path[t],s))return!1;t--,i--}}return i<0}_matchSegment(e,t,i){if(e.tag!=="*"&&e.tag!==t.tag||e.namespace!==void 0&&e.namespace!=="*"&&e.namespace!==t.namespace)return!1;if(e.attrName!==void 0){if(!i||!t.values||!(e.attrName in t.values))return!1;if(e.attrValue!==void 0){const r=t.values[e.attrName];if(String(r)!==String(e.attrValue))return!1}}if(e.position!==void 0){if(!i)return!1;const r=t.counter??0;if(e.position==="first"&&r!==0)return!1;if(e.position==="odd"&&r%2!==1)return!1;if(e.position==="even"&&r%2!==0)return!1;if(e.position==="nth"&&r!==e.positionValue)return!1}return!0}snapshot(){return{path:this.path.map(e=>({...e})),siblingStacks:this.siblingStacks.map(e=>new Map(e))}}restore(e){this.path=e.path.map(t=>({...t})),this.siblingStacks=e.siblingStacks.map(t=>new Map(t))}}function xv(n,e){if(!n)return{};const t=e.attributesGroupName?n[e.attributesGroupName]:n;if(!t)return{};const i={};for(const r in t)if(r.startsWith(e.attributeNamePrefix)){const s=r.substring(e.attributeNamePrefix.length);i[s]=t[r]}else i[r]=t[r];return i}function Sv(n){if(!n||typeof n!="string")return;const e=n.indexOf(":");if(e!==-1&&e>0){const t=n.substring(0,e);if(t!=="xmlns")return t}}class kv{constructor(e){if(this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(t,i)=>su(i,10,"&#")},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(t,i)=>su(i,16,"&#x")}},this.addExternalEntities=_v,this.parseXml=Av,this.parseTextData=Cv,this.resolveNameSpace=Ev,this.buildAttributesMap=Ov,this.isItStopNode=jv,this.replaceEntitiesValue=Tv,this.readStopNodeData=Rv,this.saveTextToParentTag=Nv,this.addChild=Pv,this.ignoreAttributesFn=bv(this.options.ignoreAttributes),this.entityExpansionCount=0,this.currentExpandedLength=0,this.matcher=new wv,this.isCurrentNodeStopNode=!1,this.options.stopNodes&&this.options.stopNodes.length>0){this.stopNodeExpressions=[];for(let t=0;t<this.options.stopNodes.length;t++){const i=this.options.stopNodes[t];typeof i=="string"?this.stopNodeExpressions.push(new ru(i)):i instanceof ru&&this.stopNodeExpressions.push(i)}}}}function _v(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const i=e[t],r=i.replace(/[.\-+*:]/g,"\\.");this.lastEntities[i]={regex:new RegExp("&"+r+";","g"),val:n[i]}}}function Cv(n,e,t,i,r,s,a){if(n!==void 0&&(this.options.trimValues&&!i&&(n=n.trim()),n.length>0)){a||(n=this.replaceEntitiesValue(n,e,t));const l=this.options.jPath?t.toString():t,d=this.options.tagValueProcessor(e,n,l,r,s);return d==null?n:typeof d!=typeof n||d!==n?d:this.options.trimValues?ja(n,this.options.parseTagValue,this.options.numberParseOptions):n.trim()===n?ja(n,this.options.parseTagValue,this.options.numberParseOptions):n}}function Ev(n){if(this.options.removeNSPrefix){const e=n.split(":"),t=n.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(n=t+e[1])}return n}const Iv=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function Ov(n,e,t){if(this.options.ignoreAttributes!==!0&&typeof n=="string"){const i=Jf(n,Iv),r=i.length,s={},a={};for(let l=0;l<r;l++){const d=this.resolveNameSpace(i[l][1]),h=i[l][4];if(d.length&&h!==void 0){let m=h;this.options.trimValues&&(m=m.trim()),m=this.replaceEntitiesValue(m,t,e),a[d]=m}}Object.keys(a).length>0&&typeof e=="object"&&e.updateCurrent&&e.updateCurrent(a);for(let l=0;l<r;l++){const d=this.resolveNameSpace(i[l][1]),h=this.options.jPath?e.toString():e;if(this.ignoreAttributesFn(d,h))continue;let m=i[l][4],v=this.options.attributeNamePrefix+d;if(d.length)if(this.options.transformAttributeName&&(v=this.options.transformAttributeName(v)),v=ed(v,this.options),m!==void 0){this.options.trimValues&&(m=m.trim()),m=this.replaceEntitiesValue(m,t,e);const w=this.options.jPath?e.toString():e,P=this.options.attributeValueProcessor(d,m,w);P==null?s[v]=m:typeof P!=typeof m||P!==m?s[v]=P:s[v]=ja(m,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(s[v]=!0)}if(!Object.keys(s).length)return;if(this.options.attributesGroupName){const l={};return l[this.options.attributesGroupName]=s,l}return s}}const Av=function(n){n=n.replace(/\r\n?/g,`
|
|
188
|
-
`);const e=new An("!xml");let t=e,i="";this.matcher.reset(),this.entityExpansionCount=0,this.currentExpandedLength=0;const r=new lv(this.options.processEntities);for(let s=0;s<n.length;s++)if(n[s]==="<")if(n[s+1]==="/"){const l=ei(n,">",s,"Closing Tag is not closed.");let d=n.substring(s+2,l).trim();if(this.options.removeNSPrefix){const m=d.indexOf(":");m!==-1&&(d=d.substr(m+1))}d=Yo(this.options.transformTagName,d,"",this.options).tagName,t&&(i=this.saveTextToParentTag(i,t,this.matcher));const h=this.matcher.getCurrentTag();if(d&&this.options.unpairedTags.indexOf(d)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${d}>`);h&&this.options.unpairedTags.indexOf(h)!==-1&&(this.matcher.pop(),this.tagsNodeStack.pop()),this.matcher.pop(),this.isCurrentNodeStopNode=!1,t=this.tagsNodeStack.pop(),i="",s=l}else if(n[s+1]==="?"){let l=Na(n,s,!1,"?>");if(!l)throw new Error("Pi Tag is not closed.");if(i=this.saveTextToParentTag(i,t,this.matcher),!(this.options.ignoreDeclaration&&l.tagName==="?xml"||this.options.ignorePiTags)){const d=new An(l.tagName);d.add(this.options.textNodeName,""),l.tagName!==l.tagExp&&l.attrExpPresent&&(d[":@"]=this.buildAttributesMap(l.tagExp,this.matcher,l.tagName)),this.addChild(t,d,this.matcher,s)}s=l.closeIndex+1}else if(n.substr(s+1,3)==="!--"){const l=ei(n,"-->",s+4,"Comment is not closed.");if(this.options.commentPropName){const d=n.substring(s+4,l-2);i=this.saveTextToParentTag(i,t,this.matcher),t.add(this.options.commentPropName,[{[this.options.textNodeName]:d}])}s=l}else if(n.substr(s+1,2)==="!D"){const l=r.readDocType(n,s);this.docTypeEntities=l.entities,s=l.i}else if(n.substr(s+1,2)==="!["){const l=ei(n,"]]>",s,"CDATA is not closed.")-2,d=n.substring(s+9,l);i=this.saveTextToParentTag(i,t,this.matcher);let h=this.parseTextData(d,t.tagname,this.matcher,!0,!1,!0,!0);h==null&&(h=""),this.options.cdataPropName?t.add(this.options.cdataPropName,[{[this.options.textNodeName]:d}]):t.add(this.options.textNodeName,h),s=l+2}else{let l=Na(n,s,this.options.removeNSPrefix);if(!l){const H=n.substring(Math.max(0,s-50),Math.min(n.length,s+50));throw new Error(`readTagExp returned undefined at position ${s}. Context: "${H}"`)}let d=l.tagName;const h=l.rawTagName;let m=l.tagExp,v=l.attrExpPresent,w=l.closeIndex;if({tagName:d,tagExp:m}=Yo(this.options.transformTagName,d,m,this.options),this.options.strictReservedNames&&(d===this.options.commentPropName||d===this.options.cdataPropName||d===this.options.textNodeName||d===this.options.attributesGroupName))throw new Error(`Invalid tag name: ${d}`);t&&i&&t.tagname!=="!xml"&&(i=this.saveTextToParentTag(i,t,this.matcher,!1));const P=t;P&&this.options.unpairedTags.indexOf(P.tagname)!==-1&&(t=this.tagsNodeStack.pop(),this.matcher.pop());let K=!1;m.length>0&&m.lastIndexOf("/")===m.length-1&&(K=!0,d[d.length-1]==="/"?(d=d.substr(0,d.length-1),m=d):m=m.substr(0,m.length-1),v=d!==m);let A=null,D;D=Sv(h),d!==e.tagname&&this.matcher.push(d,{},D),d!==m&&v&&(A=this.buildAttributesMap(m,this.matcher,d),A&&xv(A,this.options)),d!==e.tagname&&(this.isCurrentNodeStopNode=this.isItStopNode(this.stopNodeExpressions,this.matcher));const z=s;if(this.isCurrentNodeStopNode){let H="";if(K)s=l.closeIndex;else if(this.options.unpairedTags.indexOf(d)!==-1)s=l.closeIndex;else{const J=this.readStopNodeData(n,h,w+1);if(!J)throw new Error(`Unexpected end of ${h}`);s=J.i,H=J.tagContent}const ie=new An(d);A&&(ie[":@"]=A),ie.add(this.options.textNodeName,H),this.matcher.pop(),this.isCurrentNodeStopNode=!1,this.addChild(t,ie,this.matcher,z)}else{if(K){({tagName:d,tagExp:m}=Yo(this.options.transformTagName,d,m,this.options));const H=new An(d);A&&(H[":@"]=A),this.addChild(t,H,this.matcher,z),this.matcher.pop(),this.isCurrentNodeStopNode=!1}else if(this.options.unpairedTags.indexOf(d)!==-1){const H=new An(d);A&&(H[":@"]=A),this.addChild(t,H,this.matcher,z),this.matcher.pop(),this.isCurrentNodeStopNode=!1,s=l.closeIndex;continue}else{const H=new An(d);if(this.tagsNodeStack.length>this.options.maxNestedTags)throw new Error("Maximum nested tags exceeded");this.tagsNodeStack.push(t),A&&(H[":@"]=A),this.addChild(t,H,this.matcher,z),t=H}i="",s=w}}else i+=n[s];return e.child};function Pv(n,e,t,i){this.options.captureMetaData||(i=void 0);const r=this.options.jPath?t.toString():t,s=this.options.updateTag(e.tagname,r,e[":@"]);s===!1||(typeof s=="string"&&(e.tagname=s),n.addChild(e,i))}function Tv(n,e,t){const i=this.options.processEntities;if(!i||!i.enabled)return n;if(i.allowedTags){const r=this.options.jPath?t.toString():t;if(!(Array.isArray(i.allowedTags)?i.allowedTags.includes(e):i.allowedTags(e,r)))return n}if(i.tagFilter){const r=this.options.jPath?t.toString():t;if(!i.tagFilter(e,r))return n}for(const r of Object.keys(this.docTypeEntities)){const s=this.docTypeEntities[r],a=n.match(s.regx);if(a){if(this.entityExpansionCount+=a.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions)throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);const l=n.length;if(n=n.replace(s.regx,s.val),i.maxExpandedLength&&(this.currentExpandedLength+=n.length-l,this.currentExpandedLength>i.maxExpandedLength))throw new Error(`Total expanded content size exceeded: ${this.currentExpandedLength} > ${i.maxExpandedLength}`)}}for(const r of Object.keys(this.lastEntities)){const s=this.lastEntities[r],a=n.match(s.regex);if(a&&(this.entityExpansionCount+=a.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);n=n.replace(s.regex,s.val)}if(n.indexOf("&")===-1)return n;if(this.options.htmlEntities)for(const r of Object.keys(this.htmlEntities)){const s=this.htmlEntities[r],a=n.match(s.regex);if(a&&(this.entityExpansionCount+=a.length,i.maxTotalExpansions&&this.entityExpansionCount>i.maxTotalExpansions))throw new Error(`Entity expansion limit exceeded: ${this.entityExpansionCount} > ${i.maxTotalExpansions}`);n=n.replace(s.regex,s.val)}return n=n.replace(this.ampEntity.regex,this.ampEntity.val),n}function Nv(n,e,t,i){return n&&(i===void 0&&(i=e.child.length===0),n=this.parseTextData(n,e.tagname,t,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,i),n!==void 0&&n!==""&&e.add(this.options.textNodeName,n),n=""),n}function jv(n,e){if(!n||n.length===0)return!1;for(let t=0;t<n.length;t++)if(e.matches(n[t]))return!0;return!1}function Mv(n,e,t=">"){let i,r="";for(let s=e;s<n.length;s++){let a=n[s];if(i)a===i&&(i="");else if(a==='"'||a==="'")i=a;else if(a===t[0])if(t[1]){if(n[s+1]===t[1])return{data:r,index:s}}else return{data:r,index:s};else a===" "&&(a=" ");r+=a}}function ei(n,e,t,i){const r=n.indexOf(e,t);if(r===-1)throw new Error(i);return r+e.length-1}function Na(n,e,t,i=">"){const r=Mv(n,e+1,i);if(!r)return;let s=r.data;const a=r.index,l=s.search(/\s/);let d=s,h=!0;l!==-1&&(d=s.substring(0,l),s=s.substring(l+1).trimStart());const m=d;if(t){const v=d.indexOf(":");v!==-1&&(d=d.substr(v+1),h=d!==r.data.substr(v+1))}return{tagName:d,tagExp:s,closeIndex:a,attrExpPresent:h,rawTagName:m}}function Rv(n,e,t){const i=t;let r=1;for(;t<n.length;t++)if(n[t]==="<")if(n[t+1]==="/"){const s=ei(n,">",t,`${e} is not closed`);if(n.substring(t+2,s).trim()===e&&(r--,r===0))return{tagContent:n.substring(i,t),i:s};t=s}else if(n[t+1]==="?")t=ei(n,"?>",t+1,"StopNode is not closed.");else if(n.substr(t+1,3)==="!--")t=ei(n,"-->",t+3,"StopNode is not closed.");else if(n.substr(t+1,2)==="![")t=ei(n,"]]>",t,"StopNode is not closed.")-2;else{const s=Na(n,t,">");s&&((s&&s.tagName)===e&&s.tagExp[s.tagExp.length-1]!=="/"&&r++,t=s.closeIndex)}}function ja(n,e,t){if(e&&typeof n=="string"){const i=n.trim();return i==="true"?!0:i==="false"?!1:pv(n,t)}else return Ym(n)?n:""}function su(n,e,t){const i=Number.parseInt(n,e);return i>=0&&i<=1114111?String.fromCodePoint(i):t+n+";"}function Yo(n,e,t,i){if(n){const r=n(e);t===e&&(t=r),e=r}return e=ed(e,i),{tagName:e,tagExp:t}}function ed(n,e){if(Qf.includes(n))throw new Error(`[SECURITY] Invalid name: "${n}" is a reserved JavaScript keyword that could cause prototype pollution`);return Ec.includes(n)?e.onDangerousProperty(n):n}const Jo=An.getMetaDataSymbol();function $v(n,e){if(!n||typeof n!="object")return{};if(!e)return n;const t={};for(const i in n)if(i.startsWith(e)){const r=i.substring(e.length);t[r]=n[i]}else t[i]=n[i];return t}function Lv(n,e,t){return td(n,e,t)}function td(n,e,t){let i;const r={};for(let s=0;s<n.length;s++){const a=n[s],l=Bv(a);if(l!==void 0&&l!==e.textNodeName){const d=$v(a[":@"]||{},e.attributeNamePrefix);t.push(l,d)}if(l===e.textNodeName)i===void 0?i=a[l]:i+=""+a[l];else{if(l===void 0)continue;if(a[l]){let d=td(a[l],e,t);const h=Dv(d,e);if(a[":@"]?Fv(d,a[":@"],t,e):Object.keys(d).length===1&&d[e.textNodeName]!==void 0&&!e.alwaysCreateTextNode?d=d[e.textNodeName]:Object.keys(d).length===0&&(e.alwaysCreateTextNode?d[e.textNodeName]="":d=""),a[Jo]!==void 0&&typeof d=="object"&&d!==null&&(d[Jo]=a[Jo]),r[l]!==void 0&&Object.prototype.hasOwnProperty.call(r,l))Array.isArray(r[l])||(r[l]=[r[l]]),r[l].push(d);else{const m=e.jPath?t.toString():t;e.isArray(l,m,h)?r[l]=[d]:r[l]=d}l!==void 0&&l!==e.textNodeName&&t.pop()}}}return typeof i=="string"?i.length>0&&(r[e.textNodeName]=i):i!==void 0&&(r[e.textNodeName]=i),r}function Bv(n){const e=Object.keys(n);for(let t=0;t<e.length;t++){const i=e[t];if(i!==":@")return i}}function Fv(n,e,t,i){if(e){const r=Object.keys(e),s=r.length;for(let a=0;a<s;a++){const l=r[a],d=l.startsWith(i.attributeNamePrefix)?l.substring(i.attributeNamePrefix.length):l,h=i.jPath?t.toString()+"."+d:t;i.isArray(l,h,!0,!0)?n[l]=[e[l]]:n[l]=e[l]}}}function Dv(n,e){const{textNodeName:t}=e,i=Object.keys(n).length;return!!(i===0||i===1&&(n[t]||typeof n[t]=="boolean"||n[t]===0))}class Kv{constructor(e){this.externalEntities={},this.options=cv(e)}parse(e,t){if(typeof e!="string"&&e.toString)e=e.toString();else if(typeof e!="string")throw new Error("XML data is accepted in String or Bytes[] form.");if(t){t===!0&&(t={});const s=Qm(e,t);if(s!==!0)throw Error(`${s.err.msg}:${s.err.line}:${s.err.col}`)}const i=new kv(this.options);i.addExternalEntities(this.externalEntities);const r=i.parseXml(e);return this.options.preserveOrder||r===void 0?r:Lv(r,this.options,i.matcher)}addEntity(e,t){if(t.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(t==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=t}static getMetaDataSymbol(){return An.getMetaDataSymbol()}}var qv=Object.getOwnPropertyDescriptor,Uv=(n,e,t,i)=>{for(var r=i>1?void 0:i?qv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},ms=(n,e)=>(t,i)=>e(t,i,n);let Ma=class extends Cr{constructor(n,e,t,i){super(n,"storage.components.nextcloudStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=t,this.cristalApp=i}ATTACHMENTS="attachments";initBaseContentCalled=!1;authenticatedHTTPHeadersProvider;documentService;async getEditField(){return""}getImageURL(){return""}async getAuthenticatedHTTPHeaders(){return this.authenticatedHTTPHeadersProvider||(this.authenticatedHTTPHeadersProvider=this.cristalApp.getContainer().get("HTTPHeadersProvider",{name:"Nextcloud/Authenticated"})),await this.authenticatedHTTPHeadersProvider.getHeaders()}getDocumentService(){return this.documentService||(this.documentService=this.cristalApp.getContainer().get("DocumentService")),this.documentService}getRootUrl(n){const e=this.getWikiConfig();return`${e.baseRestURL}${e.storageRoot??`/files/${n}/.cristal`}`.replace("${username}",n)}async getPageContent(n){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e){const t=new jn;return t.html="Not logged-in.",t.canEdit=!1,t}await this.initBaseContent(e);try{const t=await fetch(`${this.getRootUrl(e)}/${n}.md`,{method:"GET",headers:await this.getAuthenticatedHTTPHeaders()});if(t.status>=200&&t.status<300){const{lastModificationDate:i,lastAuthor:r}=await this.getLastEditDetails(n,e),s=new Vf().readPage(await t.text()),a=new jn;return a.source=s.content,a.name=s.name,a.headline=s.name,a.headlineRaw=s.name,a.syntax=s.syntax,a.lastAuthor=r,a.lastModificationDate=i,a.canEdit=!0,a}else return}catch(t){console.error("Unable to get page content",t);return}}async getLastEditDetails(n,e){let t,i;const r=await fetch(`${this.getRootUrl(e)}/${n}.md`,{body:`<?xml version="1.0" encoding="UTF-8"?>
|
|
189
|
-
<d:propfind xmlns:d="DAV:">
|
|
190
|
-
<d:prop xmlns:oc="http://owncloud.org/ns">
|
|
191
|
-
<d:getlastmodified />
|
|
192
|
-
<oc:owner-id />
|
|
193
|
-
<oc:owner-display-name />
|
|
194
|
-
</d:prop>
|
|
195
|
-
</d:propfind>`,method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(r.status>=200&&r.status<300){const s=new Kv().parse(await r.text())["d:multistatus"]["d:response"]["d:propstat"]["d:prop"],a=s["d:getlastmodified"];a&&(t=new Date(Date.parse(a))),i={username:s["oc:owner-id"],name:s["oc:owner-display-name"]}}return{lastModificationDate:t,lastAuthor:i}}async getAttachments(n){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e)return;const t=await fetch(this.getAttachmentsBasePath(n,e),{method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(t.status>=200&&t.status<300){const i=await t.text(),s=new window.DOMParser().parseFromString(i,"text/xml").getElementsByTagName("d:response"),a=[];for(let l=0;l<s.length;l++){const d=s[l];d.getElementsByTagName("d:getcontenttype").length>0&&a.push(this.parseAttachment(d))}return{attachments:a}}else return}async getAttachment(n,e){const t=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!t)return;const i=await fetch(this.getAttachmentBasePath(e,n,t),{method:"PROPFIND",headers:await this.getAuthenticatedHTTPHeaders()});if(i.status>=200&&i.status<300){const r=await i.text(),a=new window.DOMParser().parseFromString(r,"text/xml").getElementsByTagName("d:response")[0];return this.parseAttachment(a)}else return}getAttachmentsBasePath(n,e){const t=this.convertToMetaSegments(n).join("/");return`${this.getRootUrl(e)}/${t}/${this.ATTACHMENTS}`}getAttachmentBasePath(n,e,t){return`${this.getAttachmentsBasePath(e,t)}/${n}`}async save(n,e,t){const i=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!i)return;const r=n.split("/"),s=this.getRootUrl(i);await this.createIntermediateDirectories(s,r.slice(0,r.length-1));const a=new Wf().writePage({content:t,name:e,syntax:"markdown/1.2"});await fetch(`${s}/${r.join("/")}.md`,{method:"PUT",headers:await this.getAuthenticatedHTTPHeaders(),body:a})}convertToMetaSegments(n){const e=n.split("/");return[...e.slice(0,e.length-1),`.${e[e.length-1]}`]}async createIntermediateDirectories(n,e){await this.createDirectory(n);for(let t=0;t<e.length;t++)await this.createDirectory(`${n}/${e.slice(0,t+1).join("/")}`)}async saveAttachments(n,e){const t=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!t){this.alertsServiceProvider.get().error(`Could not save attachments for page ${n}, the user is not properly logged-in.`);return}return Promise.all(e.map(i=>this.saveAttachment(n,i,t)))}async saveAttachment(n,e,t){const i=this.convertToMetaSegments(n),r=this.getRootUrl(t);await this.createIntermediateDirectories(r,[...i,this.ATTACHMENTS]);const s=this.getAttachmentsBasePath(n,t)+"/"+e.name;await fetch(s,{method:"PUT",headers:await this.getAuthenticatedHTTPHeaders(),body:e})}getPageFromViewURL(){return null}getPageRestURL(){return""}async getPanelContent(){return new jn}async delete(n){const e=(await this.authenticationManagerProvider.get()?.getUserDetails())?.username;if(!e)return{success:!1,error:"Not logged-in."};const t=this.getRootUrl(e),r=(await Promise.all([await this.deletePageFile(t,n),await this.deletePageFolder(t,n)])).filter(s=>!s.success).map(s=>s.error).filter(s=>s!==void 0);return r.length>0?{success:!1,error:r.join(", ")}:{success:!0}}async deletePageFile(n,e){return await fetch(`${n}/${e}.md`,{method:"DELETE",headers:await this.getAuthenticatedHTTPHeaders()}).then(async t=>t.ok?{success:!0}:{success:!1,error:await t.text()})}async deletePageFolder(n,e){return await fetch(`${n}/${this.convertToMetaSegments(e).join("/")}`,{method:"DELETE",headers:await this.getAuthenticatedHTTPHeaders()}).then(async t=>t.ok||t.status==404?{success:!0}:{success:!1,error:await t.text()})}async move(){throw new Error("Move not supported")}async isStorageReady(){return!0}async createDirectory(n){await fetch(n,{method:"MKCOL",headers:await this.getAuthenticatedHTTPHeaders()})}parseAttachment(n){const e=n.getElementsByTagName("d:href")[0].textContent,t=n.getElementsByTagName("d:getcontenttype")[0].textContent,i=parseInt(n.getElementsByTagName("d:getcontentlength")[0].textContent),r=Date.parse(n.getElementsByTagName("d:getlastmodified")[0].textContent),s=e.split("/"),a=`${this.getWikiConfig().baseURL}${e}`,l=s[s.length-1];return{mimetype:t,reference:l,id:e,href:a,size:i,date:new Date(r),author:void 0}}async initBaseContent(n){if(!this.initBaseContentCalled){this.initBaseContentCalled=!0;try{(await fetch(this.getRootUrl(n),{method:"GET",headers:await this.getAuthenticatedHTTPHeaders()})).status===404&&(await this.save("home","",`# Welcome
|
|
196
|
-
|
|
197
|
-
This is a new **Cristal** wiki.
|
|
198
|
-
|
|
199
|
-
You can use it to take your *own* notes.
|
|
200
|
-
|
|
201
|
-
Enjoy!`),await this.getDocumentService().notifyDocumentChange("update",new Vm("home",new zm)))}catch(e){console.error("Failed to initialize Cristal default content",e)}}}};Ma=Uv([it(),ms(0,Le("Logger")),ms(1,Le("AuthenticationManagerProvider")),ms(2,Le("AlertsServiceProvider")),ms(3,Le("CristalApp"))],Ma);let zv=class{constructor(e){e.bind("WikiConfig").to(Ta).when(Cc("Nextcloud")),e.bind("Storage").to(Ma).whenNamed("Nextcloud")}};var Vv=Object.getOwnPropertyDescriptor,Wv=(n,e,t,i)=>{for(var r=i>1?void 0:i?Vv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},vs=(n,e)=>(t,i)=>e(t,i,n);let Ra=class extends Sr{storage;cristal;constructor(n,e,t){super(n),this.cristal=t,this.storage=e,this.storage.setWikiConfig(this),this.homePage==""&&(this.homePage="Main.WebHome")}isSupported(n){return n=="html"||n=="jsonld"}defaultPageName(){return"Main.WebHome"}getType(){return"XWiki"}getNewPageDefaultName(){return"NewPage"}};Ra=Wv([it(),vs(0,Le("Logger")),vs(1,Le("Storage")),vs(1,tc("XWiki")),vs(2,Le("CristalApp"))],Ra);function Qo(n,e){const t=e.split(":"),i=t.length>1?t[0]:"xwiki",r=t.length>1?t[1]:t[0];return`${n.baseURL}/rest/wikis/${i}/spaces/${encodeURIComponent(r).replace(/((?:%5C%5C)*)%5C\./g,"$1%2E").replace(/%5C%5C/g,"%5C").replace(/\.(?=.*\.)/g,"/spaces/").replace(/\./,"/pages/")}`}var Hv=Object.getOwnPropertyDescriptor,Gv=(n,e,t,i)=>{for(var r=i>1?void 0:i?Hv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},Xo=(n,e)=>(t,i)=>e(t,i,n);let $a=class extends Cr{constructor(n,e,t){super(n,"storage.components.xwikiStorage"),this.authenticationManagerProvider=e,this.alertsServiceProvider=t}async isStorageReady(){return!0}getPageRestURL(n,e,t){this.logger?.debug("XWiki Loading page",n);const i=new URL(this.buildPageRestBaseURL(n,["rest","cristal","wikis","xwiki"])),r=new URLSearchParams([["format",e]]);return t&&r.append("revision",t),i.search=r.toString(),i.toString()}getPageFromViewURL(n){let e;return n.startsWith(this.wikiConfig.baseURL)?(e=n.replace(this.wikiConfig.baseURL,"").replace("/bin","").replace("/view/","").replaceAll("%5C","%5C%5C").replaceAll(".","%5C.").replaceAll("/","."),e.endsWith(".")&&(e+="WebHome"),e=decodeURIComponent(e)):e=null,e}getImageURL(n,e){n==""&&(n="Main.WebHome");const t=this.wikiConfig.baseURL+"/bin/download/"+n.replace(".","/")+"/"+e;return this.logger?.debug("final image url ",t),t}async getPageContent(n,e,t){this.logger?.debug("XWiki Loading page",n),n==""&&(n="Main.WebHome");let i;t?i=new URL(`${Qo(this.wikiConfig,n)}/history/${t}`):(i=new URL(Qo(this.wikiConfig,n)),i.search=new URLSearchParams([["checkRight","edit"],["supportedSyntax","markdown/1.2"]]).toString()),this.logger?.debug("XWiki Loading url",i);const r=await fetch(i,{cache:"no-store",headers:{Accept:"application/json",...await this.getCredentials()}});let s;try{if(s=await r.json(),!r.ok){this.alertsServiceProvider.get().error(`Could not load page ${n}. Reason: ${s.message}`);return}}catch{return}const a=new jn;a.syntax=s.syntax,a.source=s.content,a.html=s.renderedContent,a.version=`${s.majorVersion}.${s.minorVersion}`,a.headlineRaw=s.rawTitle,a.headline=s.title;const l=s.hierarchy.items.pop().name;return a.name=l!="WebHome"?l:s.hierarchy.items.pop().name,a.lastModificationDate=new Date(s.modified),a.lastAuthor={name:s.author},a.canEdit=s.rights?.find(d=>d.name=="edit")?.value??!1,a.document=new fa({encodingFormat:a.syntax,name:a.name,identifier:s.fullName,headline:a.headline,headlineRaw:a.headlineRaw,text:a.source,html:a.html}),a}async getAttachments(n){return{attachments:(await(await fetch(this.buildAttachmentsURL(n),{headers:{Accept:"application/json",...await this.getCredentials()}})).json()).attachments.map(({id:r,name:s,mimeType:a,xwikiAbsoluteUrl:l,size:d,date:h,author:m})=>({id:r,reference:s,mimetype:a,href:l,size:d,date:new Date(h),author:m}))}}async getAttachment(n,e){const t=await this.getAttachments(n);if(t)return t.attachments.filter(i=>i.reference==e)[0]}async getPanelContent(n,e){const t=this.wikiConfig.baseURL+"/rest/cristal/panel?media=json&page="+e+"&panel="+n;this.logger?.debug("XWiki Loading url",t);const r=await(await fetch(t,{cache:"no-store"})).json(),s=new jn;return s.source=r.source,s.syntax="xwiki",s.html=r.content,s.css=r.css,s.js=r.js,s}async getEditField(n,e){try{const t=n.get("xwikiMapping")[e];let i=t.type,r=t.fieldName;i==null&&(i="document"),r==null&&(r=e);const s=this.wikiConfig.baseURL+"/bin/get/"+n.getIdentifier().replaceAll(".","/")+"?xpage=display&mode=edit&type="+i+"&property="+n.get("className")+"."+r;return this.logger?.debug("XWiki Loading Field url",s),await(await fetch(s,{cache:"no-store"})).text()}catch(t){return this.logger?.error("Exception looking for edit field for field",e,t),""}}async save(n,e,t){const i=this.buildPageRestBaseURL(n,["rest","wikis","xwiki"]),r=await fetch(i,{method:"PUT",headers:{"Content-Type":"application/json",...await this.getCredentials()},body:JSON.stringify({content:t,title:e,syntax:"markdown/1.2"})});if(!r.ok){const s=await r.text();throw this.alertsServiceProvider.get().error(`Could not save page ${n}. Reason: ${s}`),new Error(s)}}async saveAttachments(n,e){await Promise.all(e.map(t=>this.saveAttachment(n,t)))}async saveAttachment(n,e){const t=await fetch(`${this.buildAttachmentsURL(n)}/${e.name}`,{method:"PUT",body:e,headers:{...await this.getCredentials(),"Content-Type":e.type}});if(!t.ok)throw new Error(`Failed to upload the attachment. Reason: [${t.statusText}]`)}async delete(n){const e=this.buildPageRestBaseURL(n,["rest","wikis","xwiki"]);return await fetch(e,{method:"DELETE",headers:{"Content-Type":"application/json",...await this.getCredentials()}}).then(async i=>i.ok?{success:!0}:{success:!1,error:await i.text()})}async move(){throw new Error("Move not supported")}async getCredentials(){const n=await this.authenticationManagerProvider.get()?.getAuthorizationHeader(),e={};return n&&(e.Authorization=n),e}buildPageRestBaseURL(n,e){const t=this.wikiConfig.baseURL,i=n.split(/(?<=(?<!\\)(?:\\\\)*)\./);for(let r=0;r<i.length;r++){const s=r<i.length-1?"spaces":"pages";e.push(s),e.push(i[r].replace(/\\\./g,"."))}return`${t}/${e.join("/")}`}buildAttachmentsURL(n){return`${Qo(this.wikiConfig,n)}/attachments`}};$a=Gv([it(),Xo(0,Le("Logger")),Xo(1,Le("AuthenticationManagerProvider")),Xo(2,Le("AlertsServiceProvider"))],$a);let Yv=class{constructor(e){e.bind("WikiConfig").to(Ra).when(Cc("XWiki")),e.bind("Storage").to($a).whenNamed("XWiki")}};var Jv=Object.getOwnPropertyDescriptor,Qv=(n,e,t,i)=>{for(var r=i>1?void 0:i?Jv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r};let La=class{name;hint;priority;singleton;constructor(){this.name="component.name",this.hint="default",this.priority=1e3,this.singleton=!1}getName(){return this.name}getHint(){return this.hint}getPriority(){return this.priority}isSingleton(){return this.singleton}};La=Qv([it()],La);class Xv{name;entryFile;staticModule;constructor(e,t,i){this.name=e,this.entryFile=t,this.staticModule=i}}var Zv=Object.getOwnPropertyDescriptor,ey=(n,e,t,i)=>{for(var r=i>1?void 0:i?Zv(e,t):e,s=n.length-1,a;s>=0;s--)(a=n[s])&&(r=a(r)||r);return r},ty=(n,e)=>(t,i)=>e(t,i,n);let Ba=class extends La{remoteExtensions=new Map;remoteExtensionDefaultURL="/apps/";remoteExtensionDefaultEntryFile="main.bundle.js";logger;constructor(n){super(),this.logger=n,this.logger.setModule("extensionmanager.components.defaultExtensionManager")}addRemoteExtension(n,e,t){this.remoteExtensions.set(n,new Xv(n,e,t))}setRemoteExtensionsConfig(n,e){this.remoteExtensionDefaultURL=n,this.remoteExtensionDefaultEntryFile=e}async loadExtension(n,e){try{const t=this.remoteExtensions.get(n),i=t&&t.entryFile?t.entryFile:this.remoteExtensionDefaultEntryFile,r=this.remoteExtensionDefaultURL+n+"/"+i,s=this.remoteExtensionDefaultURL+n+"/style.css";this.logger?.debug("Ready to import ",r);try{const l=await import(s,{assert:{type:"text/css"}});document.adoptedStyleSheets=[l.default]}catch{}const a=await import(r);if(a!=null){this.logger?.debug("Found components Init for ",n,a);const l=a.ComponentInit;new l(e),this.logger?.debug("Succesfull components Init for ",n)}else this.logger?.debug("No components to load for ",n);return}catch(t){this.logger?.error("Exception while loading components from ",n,t)}}async loadExtensions(n){for(const e of this.remoteExtensions.keys())await this.loadExtension(e,n)}};Ba=ey([it(),ty(0,Le("Logger"))],Ba);class ny{logger;constructor(e){this.logger=e.get("Logger"),this.logger.setModule("extensionmanager.components.componentsInit"),this.logger?.debug("Init Extension Manager components begin"),e.bind("ExtensionManager").to(Ba),this.logger?.debug("Init Extension Manager components end")}}class iy{logger;container;extensionList;constructor(e){this.extensionList=e}getLogger(e){let t=this.container.get("Logger");return t||(t=new xr),t.setModule(e),t}async loadExtensionManager(e){const t="extension-manager",i="/apps/"+t+"/main.bundle.dev.js";try{if(e)this.logger?.debug("Loading static extension Manager"),new ny(this.container);else{this.logger?.debug("Dynamic extension Manager. Ready to import ",i);const r=await import(i);if(r!=null){this.logger?.debug("Found components Init for ",t,r);const s=r.ComponentInit;new s(this.container),this.logger?.debug("Succesfull components Init for ",t)}else this.logger?.debug("No components to load for ",t)}}catch(r){this.logger?.error("Exception while loading extension Manager from ",i,r)}}async loadExtensions(e,t){this.logger?.debug("Start app"),await this.loadExtensionManager(e);const i=this.container.get("ExtensionManager");if(this.logger?.debug("Extension Manager is ",i),i!=null){if(!t){i.setRemoteExtensionsConfig("/apps/","main.bundle.dev.js");for(const r in this.extensionList)i.addRemoteExtension(r,"",!0);await i.loadExtensions(this.container)}this.logger?.debug("After extensions loading")}else this.logger?.debug("Could not start extension Manager");return i}initializeContainer(){this.container=new $h,this.container.bind("LoggerConfig").to(da).inSingletonScope(),this.container.bind("Logger").to(xr);const e=this.container.get("LoggerConfig");e&&e.setDefaultLevel("debug"),this.logger=this.getLogger("index.ts"),this.logger?.debug("Logging initialized")}getConfigFromPathName(e){let t="";if(e.startsWith("/")){const i=e.indexOf("/",1);i!=-1&&(t=e.substring(1,i))}return(t==null||t=="")&&(t="XWiki"),t}}const nd=Symbol("Comlink.proxy"),ry=Symbol("Comlink.endpoint"),sy=Symbol("Comlink.releaseProxy"),Zo=Symbol("Comlink.finalizer"),Cs=Symbol("Comlink.thrown"),id=n=>typeof n=="object"&&n!==null||typeof n=="function",oy={canHandle:n=>id(n)&&n[nd],serialize(n){const{port1:e,port2:t}=new MessageChannel;return Ic(n,e),[t,[t]]},deserialize(n){return n.start(),uy(n)}},ay={canHandle:n=>id(n)&&Cs in n,serialize({value:n}){let e;return n instanceof Error?e={isError:!0,value:{message:n.message,name:n.name,stack:n.stack}}:e={isError:!1,value:n},[e,[]]},deserialize(n){throw n.isError?Object.assign(new Error(n.value.message),n.value):n.value}},rd=new Map([["proxy",oy],["throw",ay]]);function cy(n,e){for(const t of n)if(e===t||t==="*"||t instanceof RegExp&&t.test(e))return!0;return!1}function Ic(n,e=globalThis,t=["*"]){e.addEventListener("message",function i(r){if(!r||!r.data)return;if(!cy(t,r.origin)){console.warn(`Invalid origin '${r.origin}' for comlink proxy`);return}const{id:s,type:a,path:l}=Object.assign({path:[]},r.data),d=(r.data.argumentList||[]).map(Qn);let h;try{const m=l.slice(0,-1).reduce((w,P)=>w[P],n),v=l.reduce((w,P)=>w[P],n);switch(a){case"GET":h=v;break;case"SET":m[l.slice(-1)[0]]=Qn(r.data.value),h=!0;break;case"APPLY":h=v.apply(m,d);break;case"CONSTRUCT":{const w=new v(...d);h=gy(w)}break;case"ENDPOINT":{const{port1:w,port2:P}=new MessageChannel;Ic(n,P),h=hy(w,[w])}break;case"RELEASE":h=void 0;break;default:return}}catch(m){h={value:m,[Cs]:0}}Promise.resolve(h).catch(m=>({value:m,[Cs]:0})).then(m=>{const[v,w]=Fs(m);e.postMessage(Object.assign(Object.assign({},v),{id:s}),w),a==="RELEASE"&&(e.removeEventListener("message",i),sd(e),Zo in n&&typeof n[Zo]=="function"&&n[Zo]())}).catch(m=>{const[v,w]=Fs({value:new TypeError("Unserializable return value"),[Cs]:0});e.postMessage(Object.assign(Object.assign({},v),{id:s}),w)})}),e.start&&e.start()}function ly(n){return n.constructor.name==="MessagePort"}function sd(n){ly(n)&&n.close()}function uy(n,e){const t=new Map;return n.addEventListener("message",function(r){const{data:s}=r;if(!s||!s.id)return;const a=t.get(s.id);if(a)try{a(s)}finally{t.delete(s.id)}}),Fa(n,t,[],e)}function ys(n){if(n)throw new Error("Proxy has been released and is not useable")}function od(n){return _i(n,new Map,{type:"RELEASE"}).then(()=>{sd(n)})}const Ls=new WeakMap,Bs="FinalizationRegistry"in globalThis&&new FinalizationRegistry(n=>{const e=(Ls.get(n)||0)-1;Ls.set(n,e),e===0&&od(n)});function fy(n,e){const t=(Ls.get(e)||0)+1;Ls.set(e,t),Bs&&Bs.register(n,e,n)}function dy(n){Bs&&Bs.unregister(n)}function Fa(n,e,t=[],i=function(){}){let r=!1;const s=new Proxy(i,{get(a,l){if(ys(r),l===sy)return()=>{dy(s),od(n),e.clear(),r=!0};if(l==="then"){if(t.length===0)return{then:()=>s};const d=_i(n,e,{type:"GET",path:t.map(h=>h.toString())}).then(Qn);return d.then.bind(d)}return Fa(n,e,[...t,l])},set(a,l,d){ys(r);const[h,m]=Fs(d);return _i(n,e,{type:"SET",path:[...t,l].map(v=>v.toString()),value:h},m).then(Qn)},apply(a,l,d){ys(r);const h=t[t.length-1];if(h===ry)return _i(n,e,{type:"ENDPOINT"}).then(Qn);if(h==="bind")return Fa(n,e,t.slice(0,-1));const[m,v]=ou(d);return _i(n,e,{type:"APPLY",path:t.map(w=>w.toString()),argumentList:m},v).then(Qn)},construct(a,l){ys(r);const[d,h]=ou(l);return _i(n,e,{type:"CONSTRUCT",path:t.map(m=>m.toString()),argumentList:d},h).then(Qn)}});return fy(s,n),s}function py(n){return Array.prototype.concat.apply([],n)}function ou(n){const e=n.map(Fs);return[e.map(t=>t[0]),py(e.map(t=>t[1]))]}const ad=new WeakMap;function hy(n,e){return ad.set(n,e),n}function gy(n){return Object.assign(n,{[nd]:!0})}function Fs(n){for(const[e,t]of rd)if(t.canHandle(n)){const[i,r]=t.serialize(n);return[{type:"HANDLER",name:e,value:i},r]}return[{type:"RAW",value:n},ad.get(n)||[]]}function Qn(n){switch(n.type){case"HANDLER":return rd.get(n.name).deserialize(n.value);case"RAW":return n.value}}function _i(n,e,t,i){return new Promise(r=>{const s=my();e.set(s,r),n.start&&n.start(),n.postMessage(Object.assign({id:s},t),i)})}function my(){return new Array(4).fill(0).map(()=>Math.floor(Math.random()*Number.MAX_SAFE_INTEGER).toString(16)).join("-")}async function au(){return await(await import("./index-DWPjg9z3.js")).loadConfig("/config.json")()}async function vy(){try{return!process||!process.versions||!process.versions.electron?{}:await au()}catch{return await au()}}class yy{currentNumber=0;queue=[];container;cristal;configMap;initialized=!1;fct;async start(){for(console.log("Starting worker thread"),await this.initialize();;)await this.sleep(1e3),await this.checkQueue()}setPageLoadedCallback(e){this.fct=e}sleep(e){return new Promise(t=>setTimeout(t,e))}async checkQueue(){if(this.getQueueSize()>0)if(this.initialized){const t=this.queue.pop();t&&await this.handleQueueItem(t),await this.checkQueue()}else console.log("Worker cristal code not initialized yet. Cannot process queue items.")}async handleQueueItem(e){console.log("Handling queue item code ready to process",e);try{let t=null,i=null,r=null;const s=e.indexOf(":"),a=e.lastIndexOf("_");if(s!=-1&&a!=-1){t=e.substring(0,s),i=e.substring(s+1,a),r=e.substring(a+1);const l=this.getWikiConfig(t);l==null?console.log("Could not find config for page",e):(console.log("Updating page ",i,r),await l.storage.updatePageContent(i,r)&&(console.log("Page updated. Calling back to main thread"),this.fct(e)))}else console.log("Could not process page",e)}catch(t){console.log("Exception while trying to load",e,t)}}add(e){return console.log("Worker in add"),this.currentNumber+=e,this.currentNumber}addToQueue(e){console.log("Worker in addToQueue",e),this.queue.includes(e)||this.queue.push(e)}getQueueSize(){return console.log("Worker in getQueueSize"),this.queue.length}getWikiConfig(e){const t=this.configMap.get(e);if(t==null){console.error("Failed to find wikiConfig for configName",e);return}const r=new Map(Object.entries(t)).get("configType");console.log("Looking for wikiConfig for name",e,"and type",r);let s;try{return s=this.container.get("WikiConfig",{name:r}),this.cristal.setWikiConfig(s),s.setConfigFromObject(t),s.initialize(),console.debug("Found wikiConfig for",e,"and type",r,":",s),s}catch(a){console.error("Failed to find wikiConfig for name",e,"and type",r,a);return}}async initialize(){console.log("Starting initialize");const e=["storage"],t=await vy();this.configMap=new Map(Object.entries(t)),console.log("Loaded json config",this.configMap);const i=new iy(e);i.initializeContainer(),this.container=i.container,console.log("Container status",this.container),this.container.bind("CristalApp").to(pa).inSingletonScope(),this.container.bind("QueueWorker").to(ha).inSingletonScope(),this.cristal=this.container.get("CristalApp"),this.cristal.setContainer(this.container),console.log("Container status",this.container),new bg(i.container),new Km(i.container),new zv(i.container),new Yv(i.container),new lg(i.container),new sg(i.container),console.log("Loading storage components"),this.initialized=!0,console.log("Finished initialize")}}const cd=new yy;cd.start();onconnect=n=>{Ic(cd,n.ports[0])};console.log("Worker code loaded");
|
|
202
|
-
//# sourceMappingURL=worker-BgcG6AhJ.js.map
|