From c701c9f429013bf787e9466ebe814c3eaff12fd2 Mon Sep 17 00:00:00 2001 From: canisminor1990 Date: Mon, 27 Nov 2023 15:53:04 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix:=20Fix=20highlight=20trim?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- javascript/main.js | 6 +++--- src/modules/PromptHighlight/App.tsx | 2 +- src/scripts/formatPrompt.ts | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/javascript/main.js b/javascript/main.js index e50de5f..fba039e 100644 --- a/javascript/main.js +++ b/javascript/main.js @@ -128,7 +128,7 @@ const se=2; iframe.loading { opacity: 0; } - `,xe([ae({reflect:!0})],e.GiscusWidget.prototype,"host",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"repo",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"repoId",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"category",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"categoryId",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"mapping",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"term",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"strict",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"reactionsEnabled",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"emitMetadata",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"inputPosition",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"theme",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"lang",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"loading",2),e.GiscusWidget=xe([function(e){return customElements.get(e)?e=>e:(e=>t=>{return"function"==typeof t?(n=e,r=t,customElements.define(n,r),r):((e,t)=>{const{kind:n,elements:r}=t;return{kind:n,elements:r,finisher(t){customElements.define(e,t)}}})(e,t);var n,r})(e)}("giscus-widget")],e.GiscusWidget)}(jQ)),jQ}const PQ=Q,_Q=z;var IQ=function({id:e,host:t,repo:n,repoId:r,category:o,categoryId:a,mapping:i,term:s,strict:l,reactionsEnabled:c,emitMetadata:u,inputPosition:d,theme:f,lang:p,loading:h}){const[g,m]=_Q.useState(!1);return _Q.useEffect((()=>{g||(Promise.resolve().then((()=>NQ())),m(!0))}),[]),g?PQ.jsx("giscus-widget",{id:e,host:t,repo:n,repoid:r,category:o,categoryid:a,mapping:i,term:s,strict:l,reactionsenabled:c,emitmetadata:u,inputposition:d,theme:f,lang:p,loading:h}):null};const TQ=n(IQ);var FQ,RQ=function(e){return["zh_CN","zh_TW"].includes(e)?e.replace("_","-"):"zh_HK"===e?"zh-TW":e.split("_")[0]},AQ=["style","className","reactionsEnabled","mapping","lang","inputPosition","id","loading","emitMetadata"];function MQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function LQ(e){for(var t=1;t .m-2 {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n }\n }\n\n .gsc-emoji-button.has-reacted {\n border-color: ",";\n border-radius: ","px;\n }\n\n .gsc-loading-image {\n background-image: url(",");\n }\n }\n "])),a,l,s,i,c,c,l,i,i,o,AW(i,.4),o,AW(i,.6),l,s,c,o,o,o,AW(i,.2),l,AW(l,.2),s,AW(i,.2),o,AW(c,.2),s,o,a,c,e.colorText,e.colorFillTertiary,e.colorBorderSecondary,e.colorFillSecondary,e.colorBorder,e.colorFillSecondary,e.colorBorder,e.colorFillSecondary,JW(e.colorPrimary),e.colorPrimary,e.colorPrimaryBorder,e.colorPrimaryHover,e.colorPrimaryBorderHover,e.colorPrimaryActive,AW(JW(e.colorPrimary),.5),AW(e.colorPrimary,.5),AW(e.colorPrimaryBorder,.5),e.colorFillQuaternary,e.colorFillTertiary,e.colorBorder,e.colorText,e.colorTextSecondary,e.colorTextQuaternary,e.colorBgElevated,e.colorFillQuaternary,e.colorBorder,e.colorBorderSecondary,e.colorFillQuaternary,e.colorFillTertiary,e.colorInfo,e.colorInfoBorderHover,e.colorInfoBorder,e.colorInfoBg,e.colorSuccess,e.colorWarning,e.colorWarningBorder,e.colorWarningBg,e.colorError,e.colorErrorBorder,e.colorErrorBg,e.colorBgContainer,e.colorInfoBg,e.colorFillSecondary,e.colorInfoBgHover,r,u,e.colorInfoBorderHover,e.borderRadius,d)}(v,y).styles)}),[y,v]);return Q.jsx("div",{className:n,style:t,children:Q.jsx(TQ,LQ({emitMetadata:m,id:f,inputPosition:u,lang:RQ(l),loading:h,mapping:i,reactionsEnabled:o,theme:"data:text/css;base64,".concat(w)},b))})}));var zQ,HQ,WQ=MB((function(e,t){var n,r=e.css,o=e.token,a=e.isDarkMode,i=e.stylish;switch(t){case"large":n=o.borderRadiusLG;break;case"middle":default:n=o.borderRadius;break;case"small":n=o.borderRadiusSM}return{button:r(zQ||(zQ=tf(["\n position: relative;\n z-index: 1;\n ","\n border: none;\n border-radius: ","px !important;\n\n &::before {\n content: '';\n\n position: absolute;\n z-index: -1;\n top: 1px;\n left: 1px;\n\n width: calc(100% - 2px);\n height: calc(100% - 2px);\n\n background: ",";\n border-radius: ","px;\n }\n "])),i.gradientAnimation,n,o.colorBgLayout,n-1),glow:r(HQ||(HQ=tf(["\n ","\n position: absolute;\n z-index: -2;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n\n opacity: ",";\n filter: blur(","em);\n border-radius: inherit;\n "])),i.gradientAnimation,a?.5:.3,a?1.5:1)}})),UQ=["glow","children","className","size"];function VQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function GQ(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function cZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n code {\n padding: 0 !important;\n border: none !important;\n }\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ","px;\n color: ",";\n\n background: ",";\n border: 1px solid ",";\n border-radius: ","px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block: 1em 1em;\n margin-inline: 0 0;\n padding: 8px;\n\n border: 1px solid ",";\n border-radius: ","px;\n\n code {\n display: inline-flex;\n }\n }\n\n th,\n td {\n padding-block: 10px 10px;\n padding-inline: 16px 16px;\n }\n\n thead {\n tr {\n th {\n background: ",";\n\n &:first-child {\n border-top-left-radius: ","px;\n border-bottom-left-radius: ","px;\n }\n\n &:last-child {\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n }\n }\n }\n }\n\n > ol > li::marker {\n color: "," !important;\n }\n\n > ul > li {\n line-height: 1.8;\n list-style-type: disc;\n\n &::marker {\n color: "," !important;\n }\n }\n\n ol,\n ul {\n > li::marker {\n color: ",";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ",";\n border: 1px solid ",";\n border-radius: ","px;\n\n transition: all 400ms ",";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ",";\n }\n }\n "])),n.colorText,n.colorText,n.colorTextDescription,n.colorLink,n.colorLinkHover,n.colorLinkActive,n.borderRadius,n.fontSizeSM,a,i,r?n.cyan1A:n.cyan6A,n.borderRadiusSM,n.colorBorderSecondary,n.borderRadius,n.colorFillTertiary,n.borderRadius,n.borderRadius,n.borderRadius,n.borderRadius,r?n.cyan9A:n.cyan10A,r?n.cyan9A:n.cyan10A,n.colorTextDescription,n.colorFillTertiary,n.colorBorderSecondary,n.borderRadiusLG,n.motionEaseOut,n.colorBorder),markdownInChat:t(YJ||(YJ=tf(["\n h1 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.6em;\n }\n\n h2 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.4em;\n }\n\n h3 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.2em;\n }\n\n h4 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.1em;\n }\n\n h5 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1em;\n }\n\n > *:last-child {\n margin-bottom: 0 !important;\n }\n\n p {\n line-height: 1.8 !important;\n\n + * {\n margin-block-end: 0.5em !important;\n }\n\n &:not(:last-child) {\n margin-bottom: 1em !important;\n }\n }\n "]))),noScrollbar:t(QJ||(QJ=tf(["\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n "]))),resetLinkColor:t(JJ||(JJ=tf(["\n cursor: pointer;\n color: ",";\n\n &:hover {\n color: ",";\n }\n "])),n.colorTextSecondary,n.colorText)}}(e)),null==n?void 0:n(e))}),[n]),p=z.useCallback((function(e){return n0(n0({},function(e){for(var t=e.isDarkMode,n={},r=0,o=Object.entries(fK);r0&&d.map((function(e){return Q.jsx(TY,{url:e},e)})),Q.jsx(UB,{speedy:!0,children:Q.jsxs(WB,n0(n0({customStylish:f,customToken:p},c),{},{theme:h,children:[Q.jsx(ZZ,{}),Q.jsx(s$,{style:{minHeight:"inherit",width:"inherit"},children:t})]}))})]})})),o0={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class a0{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||o0,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)})),this}off(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((e=>e!==t)):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{e(...n)}))}if(this.observers["*"]){[].concat(this.observers["*"]).forEach((t=>{t.apply(t,[e,...n])}))}}}function l0(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n}function c0(e){return null==e?"":""+e}function u0(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}const a="string"!=typeof t?[].concat(t):t.split(".");for(;a.length>1;){if(o())return{};const t=r(a.shift());!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return o()?{}:{obj:e,k:r(a.shift())}}function d0(e,t,n){const{obj:r,k:o}=u0(e,t,Object);r[o]=n}function f0(e,t){const{obj:n,k:r}=u0(e,t);if(n)return n[r]}function p0(e,t,n){for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):p0(e[r],t[r],n):e[r]=t[r]);return e}function h0(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var g0={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function m0(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(e=>g0[e])):e}const b0=[" ",",","?","!",";"];function v0(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let a=0;aa+e;)e++,i=r.slice(a,a+e).join(n),s=o[i];if(void 0===s)return;if(null===s)return null;if(t.endsWith(i)){if("string"==typeof s)return s;if(i&&"string"==typeof s[i])return s[i]}const l=r.slice(a+e).join(n);return l?v0(s,l,n):void 0}o=o[r[a]]}return o}function y0(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class w0 extends s0{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let i=[e,t];n&&"string"!=typeof n&&(i=i.concat(n)),n&&"string"==typeof n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=e.split("."));const s=f0(this.data,i);return s||!a||"string"!=typeof n?s:v0(this.data&&this.data[e]&&this.data[e][t],n,o)}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const a=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let i=[e,t];n&&(i=i.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(i=e.split("."),r=t,t=i[1]),this.addNamespaces(t),d0(this.data,i,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),r=n,n=t,t=i[1]),this.addNamespaces(t);let s=f0(this.data,i)||{};r?p0(s,n,o):s={...s,...n},d0(this.data,i,s),a.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var x0={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))})),t}};const S0={};class k0 extends s0{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,n){e.forEach((e=>{t[e]&&(n[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=i0.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const a=n&&e.indexOf(n)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";const r=b0.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const o=new RegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let a=!o.test(e);if(!a){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(a=!0)}return a}(e,n,r));if(a&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};const a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(o=a.shift()),e=a.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:a,namespaces:i}=this.extractFromKey(e[e.length-1],t),s=i[i.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${e}${a}`,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${a}`}return r?{res:a,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:a}const u=this.resolve(e,t);let d=u&&u.res;const f=u&&u.usedKey||a,p=u&&u.exactUsedKey||a,h=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject;if(m&&d&&("string"!=typeof d&&"boolean"!=typeof d&&"number"!=typeof d)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(h)<0&&("string"!=typeof g||"[object Array]"!==h)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,{...t,ns:i}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(u.res=e,u.usedParams=this.getUsedParamsDetails(t),u):e}if(o){const e="[object Array]"===h,n=e?[]:{},r=e?p:f;for(const a in d)if(Object.prototype.hasOwnProperty.call(d,a)){const e=`${r}${o}${a}`;n[a]=this.translate(e,{...t,joinArrays:!1,ns:i}),n[a]===e&&(n[a]=d[a])}d=n}}else if(m&&"string"==typeof g&&"[object Array]"===h)d=d.join(g),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,i=!1;const c=void 0!==t.count&&"string"!=typeof t.count,f=k0.hasDefaultValue(t),p=c?this.pluralResolver.getSuffix(l,t.count,t):"",h=t.ordinal&&c?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",g=t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(d)&&f&&(r=!0,d=g),this.isValidLookup(d)||(i=!0,d=a);const m=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:d,b=f&&g!==d&&this.options.updateMissing;if(i||r||b){if(this.logger.log(b?"updateKey":"missingKey",l,s,a,b?g:d),o){const e=this.resolve(a,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{const o=f&&r!==d?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,n,o,b,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,s,n,o,b,t),this.emit("missingKey",e,s,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach((e=>{this.pluralResolver.getSuffixes(e,t).forEach((n=>{r([e],a+n,t[`defaultValue${n}`]||g)}))})):r(e,a,g))}d=this.extendTranslation(d,e,t,u,n),i&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${s}:${a}`),(i||r)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${a}`:a,r?d:void 0):this.options.parseMissingKeyHandler(d))}return r?(u.res=d,u.usedParams=this.getUsedParamsDetails(t),u):d}extendTranslation(e,t,n,r,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let l=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const s=this.extractFromKey(e,i),l=s.key;n=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==i.count&&"string"!=typeof i.count,d=u&&!i.ordinal&&0===i.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==i.context&&("string"==typeof i.context||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(a=e,!S0[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(S0[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((n=>{if(this.isValidLookup(t))return;o=n;const a=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,n,e,i);else{let e;u&&(e=this.pluralResolver.getSuffix(n,i.count,i));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(a.push(l+e),i.ordinal&&0===e.indexOf(r)&&a.push(l+e.replace(r,this.options.pluralSeparator)),d&&a.push(l+t)),f){const n=`${l}${this.options.contextSeparator}${i.context}`;a.push(n),u&&(a.push(n+e),i.ordinal&&0===e.indexOf(r)&&a.push(n+e.replace(r,this.options.pluralSeparator)),d&&a.push(n+t))}}let s;for(;s=a.pop();)this.isValidLookup(t)||(r=s,t=this.getResource(n,e,s,i))})))}))})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&"string"!=typeof e.replace;let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}function C0(e){return e.charAt(0).toUpperCase()+e.slice(1)}class E0{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=i0.create("languageUtils")}getScriptPartFromCode(e){if(!(e=y0(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=y0(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map((e=>e.toLowerCase())):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C0(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C0(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=C0(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:0===e.indexOf(n)?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))})),r}}let O0=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],D0={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};const $0=["v1","v2","v3"],j0=["v4"],N0={zero:0,one:1,two:2,few:3,many:4,other:5};class P0{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=i0.create("pluralResolver"),this.options.compatibilityJSON&&!j0.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){const e={};return O0.forEach((t=>{t.lngs.forEach((n=>{e[n]={numbers:t.nr,plurals:D0[t.fc]}}))})),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(y0(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(((e,t)=>N0[e]-N0[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):n.numbers.map((n=>this.getSuffix(e,n,t))):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!$0.includes(this.options.compatibilityJSON)}}function _0(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=function(e,t,n){const r=f0(e,n);return void 0!==r?r:f0(t,n)}(e,t,n);return!a&&o&&"string"==typeof n&&(a=v0(e,n,r),void 0===a&&(a=v0(t,n,r))),a}class I0{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i0.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=void 0!==t.escape?t.escape:m0,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?h0(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?h0(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?h0(t.nestingPrefix):t.nestingPrefixEscaped||h0("$t("),this.nestingSuffix=t.nestingSuffix?h0(t.nestingSuffix):t.nestingSuffixEscaped||h0(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");const t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(t,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(e,t,n,r){let o,a,i;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}const c=e=>{if(e.indexOf(this.formatSeparator)<0){const o=_0(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),a=o.shift().trim(),i=o.join(this.formatSeparator).trim();return this.format(_0(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...r,...t,interpolationkey:a})};this.resetRegExp();const u=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>l(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?l(this.escape(e)):l(e)}].forEach((t=>{for(i=0;o=t.regex.exec(e);){const n=o[1].trim();if(a=c(n),void 0===a)if("function"==typeof u){const t=u(e,o,r);a="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a="";else{if(d){a=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=""}else"string"==typeof a||this.useRawValueToEscape||(a=c0(a));const s=t.safeValue(a);if(e=e.replace(o[0],s),d?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}})),e}nest(e,t){let n,r,o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function i(e,t){const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let a=`{${r[1]}`;e=r[0],a=this.interpolate(a,o);const i=a.match(/'/g),s=a.match(/"/g);(i&&i.length%2==0&&!s||s.length%2!=0)&&(a=a.replace(/'/g,'"'));try{o=JSON.parse(a),t&&(o={...t,...o})}catch(A4){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,A4),`${e}${n}${a}`}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let s=[];o={...a},o=o.replace&&"string"!=typeof o.replace?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),s=e,l=!0}if(r=t(i.call(this,n[1].trim(),o),o),r&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=c0(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l&&(r=s.reduce(((e,t)=>this.format(e,t,a.lng,{...a,interpolationkey:n[1].trim()})),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function T0(e){const t={};return function(n,r,o){const a=r+JSON.stringify(o);let i=t[a];return i||(i=e(y0(r),o),t[a]=i),i(n)}}class F0{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i0.create("formatter"),this.options=e,this.formats={number:T0(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:T0(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:T0(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:T0(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:T0(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=T0(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce(((e,t)=>{const{formatName:o,formatOptions:a}=function(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((e=>{if(!e)return;const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,"");n[t.trim()]||(n[t.trim()]=o),"false"===o&&(n[t.trim()]=!1),"true"===o&&(n[t.trim()]=!0),isNaN(o)||(n[t.trim()]=parseInt(o,10))}))}return{formatName:t,formatOptions:n}}(t);if(this.formats[o]){let t=e;try{const i=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=i.locale||i.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...a,...r,...i})}catch(i){this.logger.warn(i)}return t}return this.logger.warn(`there was no format function for ${o}`),e}),e)}}class R0 extends s0{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=i0.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const o={},a={},i={},s={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===a[i]&&(a[i]=!0):(this.state[i]=1,r=!1,void 0===a[i]&&(a[i]=!0),void 0===o[i]&&(o[i]=!0),void 0===s[t]&&(s[t]=!0)))})),r||(i[e]=!0)})),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],a=r[1];t&&this.emit("failedLoading",o,a,t),n&&this.store.addResourceBundle(o,a,n),this.state[e]=t?-1:2;const i={};this.queue.forEach((n=>{!function(e,t,n,r){const{obj:o,k:a}=u0(e,t,Object);o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}(n.loaded,[o],a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{i[e]||(i[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===i[e][t]&&(i[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",i),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:a});this.readingCalls++;const i=(i,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&s&&r{this.read.call(this,e,t,n,r+1,2*o,a)}),o):a(i,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,i);try{const n=s(e,t);n&&"function"==typeof n.then?n.then((e=>i(null,e))).catch(i):i(null,n)}catch(l){i(l)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,((n,a)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,a),this.loaded(e,n,a)}))}saveMissing(e,t,n,r,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let o;o=5===c.length?c(e,t,n,r,l):c(e,t,n,r),o&&"function"==typeof o.then?o.then((e=>i(null,e))).catch(i):i(null,o)}catch(s){i(s)}else c(e,t,n,r,i,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function A0(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function M0(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function L0(){}class B0 extends s0{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=M0(e),this.services={},this.logger=i0,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=A0();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options={...r,...this.options,...M0(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?i0.init(o(this.modules.logger),this.options):i0.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=F0);const n=new E0(this.options);this.store=new w0(this.options.resources,this.options);const a=this.services;a.logger=i0,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new P0(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=o(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new I0(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new R0(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=L0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const a=l0(),i=()=>{const e=(e,t)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?i():setTimeout(i,0),a}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L0;const n="string"==typeof e?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>r(e)))}this.options.preload&&this.options.preload.forEach((e=>r(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const r=l0();return e||(e=this.languages),t||(t=this.options.ns),n||(n=L0),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),n(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&x0.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=l0();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(e,a)=>{a?(o(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,(e=>{a(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let a;if("object"!=typeof t){for(var i=arguments.length,s=new Array(i>2?i-2:0),l=2;l`${a.keyPrefix}${c}${e}`)):a.keyPrefix?`${a.keyPrefix}${c}${e}`:e,r.t(u,a)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const a=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||2===n};if(t.precheck){const e=t.precheck(this,a);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(n,e)||r&&!a(o,e)))}loadNamespaces(e,t){const n=l0();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=l0();"string"==typeof e&&(e=[e]);const r=this.options.preload||[],o=e.filter((e=>r.indexOf(e)<0));return o.length?(this.options.preload=r.concat(o),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new E0(A0());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new B0(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L0;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new B0(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));return["store","services","language"].forEach((e=>{o[e]=this[e]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new w0(this.store.data,r),o.services.resourceStore=o.store),o.translator=new k0(o.services,r),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function g(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function m(e){var t=new FileReader,n=g(t);return t.readAsArrayBuffer(e),n}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&a&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=h(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(m)}),this.text=function(){var e,t,n,r=h(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=g(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},v.call(w.prototype),v.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];S.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(E){e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function C(n,r){return new Promise((function(o,i){var l=new w(n,r);if(l.signal&&l.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function u(){c.abort()}c.onload=function(){var e,t,n={status:c.status,statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in c?c.responseURL:n.headers.get("X-Request-URL");var r="response"in c?c.response:c.responseText;setTimeout((function(){o(new S(r,n))}),0)},c.onerror=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},c.ontimeout=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},c.onabort=function(){setTimeout((function(){i(new e.DOMException("Aborted","AbortError"))}),0)},c.open(l.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(A4){return e}}(l.url),!0),"include"===l.credentials?c.withCredentials=!0:"omit"===l.credentials&&(c.withCredentials=!1),"responseType"in c&&(a?c.responseType="blob":s&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(c.responseType="arraybuffer")),!r||"object"!=typeof r.headers||r.headers instanceof p?l.headers.forEach((function(e,t){c.setRequestHeader(t,e)})):Object.getOwnPropertyNames(r.headers).forEach((function(e){c.setRequestHeader(e,d(r.headers[e]))})),l.signal&&(l.signal.addEventListener("abort",u),c.onreadystatechange=function(){4===c.readyState&&l.signal.removeEventListener("abort",u)}),c.send(void 0===l._bodyInit?null:l._bodyInit)}))}C.polyfill=!0,t.fetch||(t.fetch=C,t.Headers=p,t.Request=w,t.Response=S),e.Headers=p,e.Request=w,e.Response=S,e.fetch=C}({}),a.fetch.ponyfill=!0,delete a.fetch.polyfill;var i=o.fetch?o:a;(n=i.fetch).default=i.fetch,n.fetch=i.fetch,n.Headers=i.Headers,n.Request=i.Request,n.Response=i.Response,e.exports=n}(Q0,Q0.exports)),Q0.exports}!function(e,n){var r;if("function"==typeof fetch&&(r=void 0!==t&&t.fetch?t.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),void 0!==X0&&("undefined"==typeof window||void 0===window.document)){var o=r||J0();o.default&&(o=o.default),n.default=o,e.exports=n.default}}(Y0,Y0.exports);var Z0=Y0.exports;const e1=n(Z0),t1=e({__proto__:null,default:e1},[Z0]);function n1(e){return(n1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r1,o1,a1;"function"==typeof fetch&&(r1="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),q0()&&("undefined"!=typeof global&&global.XMLHttpRequest?o1=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(o1=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?a1=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(a1=window.ActiveXObject)),r1||!t1||o1||a1||(r1=e1||t1),"function"!=typeof r1&&(r1=void 0);var i1=function(e,t){if(t&&"object"===n1(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},s1=function(e,t,n){var r=function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)};"function"==typeof fetch?fetch(e,t).then(r).catch(n):r1(e,t).then(r).catch(n)},l1=!1,c1=function(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),r=r||function(){},r1&&0!==t.indexOf("file:")?function(e,t,n,r){e.queryStringParams&&(t=i1(t,e.queryStringParams));var o=G0({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);"undefined"==typeof window&&"undefined"!=typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),n&&(o["Content-Type"]="application/json");var a="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,i=G0({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},l1?{}:a);try{s1(t,i,r)}catch(A4){if(!a||0===Object.keys(a).length||!A4.message||A4.message.indexOf("not implemented")<0)return r(A4);try{Object.keys(a).forEach((function(e){delete i[e]})),s1(t,i,r),l1=!0}catch(s){r(s)}}}(e,t,n,r):q0()||"function"==typeof ActiveXObject?function(e,t,n,r){n&&"object"===n1(n)&&(n=i1("",n).slice(1)),e.queryStringParams&&(t=i1(t,e.queryStringParams));try{var o;(o=o1?new o1:new a1("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=e.customHeaders;if(a="function"==typeof a?a():a)for(var i in a)o.setRequestHeader(i,a[i]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(A4){console&&console.log(A4)}}(e,t,n,r):void r(new Error("No fetch and no xhr implementation found!"))};function u1(e){return(u1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d1(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=G0(n,this.options||{},p1()),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,o){var a,i=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(a=s)?a:Promise.resolve(a)).then((function(a){if(!a)return o(null,{});var s=i.services.interpolator.interpolate(a,{lng:e.join("+"),ns:n.join("+")});i.loadUrl(s,o,t,r)}))}},{key:"loadUrl",value:function(e,t,n,r){var o=this,a="string"==typeof n?[n]:n,i="string"==typeof r?[r]:r,s=this.options.parseLoadPayload(a,i);this.options.request(this.options,e,s,(function(a,i){if(i&&(i.status>=500&&i.status<600||!i.status))return t("failed loading "+e+"; status code: "+i.status,!0);if(i&&i.status>=400&&i.status<500)return t("failed loading "+e+"; status code: "+i.status,!1);if(!i&&a&&a.message&&a.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+a.message,!0);if(a)return t(a,!1);var s,l;try{s="string"==typeof i.data?o.options.parse(i.data,n,r):i.data}catch(A4){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,r,o){var a=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var i=this.options.parsePayload(t,n,r),s=0,l=[],c=[];e.forEach((function(n){var r=a.options.addPath;"function"==typeof a.options.addPath&&(r=a.options.addPath(n,t));var u=a.services.interpolator.interpolate(r,{lng:n,ns:t});a.options.request(a.options,u,i,(function(t,n){s+=1,l.push(t),c.push(n),s===e.length&&"function"==typeof o&&o(l,c)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,o=t.logger,a=n.language;if(!a||"cimode"!==a.toLowerCase()){var i=[],s=function(e){r.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};s(a),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),i.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(r,a){r&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&a&&o.log("loaded namespace ".concat(e," for language ").concat(t),a),n.loaded("".concat(t,"|").concat(e),r,a)}))}))}))}}}],n&&d1(t.prototype,n),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();h1.type="backend";const g1={};function m1(){for(var e=arguments.length,t=new Array(e),n=0;n()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout((()=>{e.off("initialized",n)}),0),t()};e.on("initialized",n)}};function v1(e,t,n){e.loadNamespaces(t,b1(e,n))}function y1(e,t,n,r){"string"==typeof n&&(n=[n]),n.forEach((t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,b1(e,r))}const w1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,x1={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},S1=e=>x1[e];let k1,C1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(w1,S1)};const E1={type:"3rdParty",init(e){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};C1={...C1,...e}}(e.options.react),function(e){k1=e}(e)}},O1=z.createContext();class D1{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach((e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)}))}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function $1(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:o}=z.useContext(O1)||{},a=n||r||k1;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new D1),!a){m1("You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}a.options.react&&void 0!==a.options.react.wait&&m1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const i={...C1,...a.options.react,...t},{useSuspense:s,keyPrefix:l}=i;let c=e||o||a.options&&a.options.defaultNS;c="string"==typeof c?[c]:c||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(c);const u=(a.isInitialized||a.initializedStoreOnce)&&c.every((e=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=t.languages[0],o=!!t.options&&t.options.fallbackLng,a=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;const i=(e,n)=>{const r=t.services.backendConnector.state[`${e}|${n}`];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!i(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!i(r,e)||o&&!i(a,e)))}(e,t,n):(m1("i18n.languages were undefined or empty",t.languages),!0)}(e,a,i)));function d(){return a.getFixedT(t.lng||null,"fallback"===i.nsMode?c:c[0],l)}const[f,p]=z.useState(d);let h=c.join();t.lng&&(h=`${t.lng}${h}`);const g=((e,t)=>{const n=z.useRef();return z.useEffect((()=>{n.current=t?n.current:e}),[e,t]),n.current})(h),m=z.useRef(!0);z.useEffect((()=>{const{bindI18n:e,bindI18nStore:n}=i;function r(){m.current&&p(d)}return m.current=!0,u||s||(t.lng?y1(a,t.lng,c,(()=>{m.current&&p(d)})):v1(a,c,(()=>{m.current&&p(d)}))),u&&g&&g!==h&&m.current&&p(d),e&&a&&a.on(e,r),n&&a&&a.store.on(n,r),()=>{m.current=!1,e&&a&&e.split(" ").forEach((e=>a.off(e,r))),n&&a&&n.split(" ").forEach((e=>a.store.off(e,r)))}}),[a,h]);const b=z.useRef(!0);z.useEffect((()=>{m.current&&!b.current&&p(d),b.current=!1}),[a,l]);const v=[f,a,u];if(v.t=f,v.i18n=a,v.ready=u,u)return v;if(!u&&!s)return v;throw new Promise((e=>{t.lng?y1(a,t.lng,c,(()=>e())):v1(a,c,(()=>e()))}))}var j1={BASE_URL:"/dev",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const N1=new Map,P1=e=>{const t=N1.get(e);return t?Object.fromEntries(Object.entries(t.stores).map((([e,t])=>[e,t.getState()]))):{}},_1=(e,t={})=>(n,r,o)=>{const{enabled:a,anonymousActionType:i,store:s,...l}=t;let c;try{c=(null!=a?a:"production"!==(j1?"production":void 0))&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(A4){}if(!c)return"production"!==(j1?"production":void 0)&&a&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,o);const{connection:u,...d}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};const r=N1.get(n.name);if(r)return{type:"tracked",store:e,...r};const o={connection:t.connect(n),stores:{}};return N1.set(n.name,o),{type:"tracked",store:e,...o}})(s,c,l);let f=!0;o.setState=(e,t,a)=>{const c=n(e,t);if(!f)return c;const d=void 0===a?{type:i||"anonymous"}:"string"==typeof a?{type:a}:a;return void 0===s?(null==u||u.send(d,r()),c):(null==u||u.send({...d,type:`${s}/${d.type}`},{...P1(l.name),[s]:o.getState()}),c)};const p=(...e)=>{const t=f;f=!1,n(...e),f=t},h=e(o.setState,r,o);if("untracked"===d.type?null==u||u.init(h):(d.stores[d.store]=o,null==u||u.init(Object.fromEntries(Object.entries(d.stores).map((([e,t])=>[e,e===d.store?h:t.getState()]))))),o.dispatchFromDevtools&&"function"==typeof o.dispatch){let e=!1;const t=o.dispatch;o.dispatch=(...n)=>{"production"===(j1?"production":void 0)||"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return u.subscribe((e=>{var t;switch(e.type){case"ACTION":return"string"!=typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):I1(e.payload,(e=>{if("__setState"!==e.type)o.dispatchFromDevtools&&"function"==typeof o.dispatch&&o.dispatch(e);else{if(void 0===s)return void p(e.state);1!==Object.keys(e.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const t=e.state[s];if(null==t)return;JSON.stringify(o.getState())!==JSON.stringify(t)&&p(t)}}));case"DISPATCH":switch(e.payload.type){case"RESET":return p(h),void 0===s?null==u?void 0:u.init(o.getState()):null==u?void 0:u.init(P1(l.name));case"COMMIT":return void 0===s?void(null==u||u.init(o.getState())):null==u?void 0:u.init(P1(l.name));case"ROLLBACK":return I1(e.state,(e=>{if(void 0===s)return p(e),void(null==u||u.init(o.getState()));p(e[s]),null==u||u.init(P1(l.name))}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return I1(e.state,(e=>{void 0!==s?JSON.stringify(o.getState())!==JSON.stringify(e[s])&&p(e[s]):p(e)}));case"IMPORT_STATE":{const{nextLiftedState:n}=e.payload,r=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;return p(void 0===s?r:r[s]),void(null==u||u.send(null,n))}case"PAUSE_RECORDING":return f=!f}return}})),h},I1=(e,t)=>{let n;try{n=JSON.parse(e)}catch(A4){console.error("[zustand devtools middleware] Could not parse the received json",A4)}void 0!==n&&t(n)};function T1(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,a={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(G1?"production":void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},{useDebugValue:X1}=H,{useSyncExternalStoreWithSelector:K1}=V1;const Y1=(e,t)=>{const n=(e=>e?q1(e):q1)(e),r=(e,r=t)=>function(e,t=e.getState,n){const r=K1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return X1(r),r}(n,e,r);return Object.assign(r,n),r},Q1=(e,t)=>e?Y1(e,t):Y1;var J1={exports:{}};var Z1={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},e2={};var t2="object"==typeof process&&e2&&e2.NODE_DEBUG&&/\bsemver\b/i.test(e2.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Z1,a=t2,i=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],c=t.t={};let u=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[d,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),o=u++;a(e,o,t),c[e]=o,l[o]=t,i[o]=new RegExp(t,n?"g":void 0),s[o]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(J1,J1.exports);var n2=J1.exports;const r2=Object.freeze({loose:!0}),o2=Object.freeze({});var a2=e=>e?"object"!=typeof e?r2:e:o2;const i2=/^[0-9]+$/,s2=(e,t)=>{const n=i2.test(e),r=i2.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:es2(t,e)};const c2=t2,{MAX_LENGTH:u2,MAX_SAFE_INTEGER:d2}=Z1,{safeRe:f2,t:p2}=n2,h2=a2,{compareIdentifiers:g2}=l2;var m2=class e{constructor(t,n){if(n=h2(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>u2)throw new TypeError(`version is longer than ${u2} characters`);c2("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?f2[p2.LOOSE]:f2[p2.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>d2||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d2||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d2||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===g2(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const b2=m2;var v2=(e,t,n=!1)=>{if(e instanceof b2)return e;try{return new b2(e,t)}catch(r){if(!n)return null;throw r}};const y2=v2;var w2=(e,t)=>{const n=y2(e,t);return n?n.version:null};const x2=v2;var S2=(e,t)=>{const n=x2(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const k2=m2;var C2=(e,t,n,r,o)=>{"string"==typeof n&&(o=r,r=n,n=void 0);try{return new k2(e instanceof k2?e.version:e,n).inc(t,r,o).version}catch(a){return null}};const E2=v2;var O2=(e,t)=>{const n=E2(e,null,!0),r=E2(t,null,!0),o=n.compare(r);if(0===o)return null;const a=o>0,i=a?n:r,s=a?r:n,l=!!i.prerelease.length;if(!!s.prerelease.length&&!l)return s.patch||s.minor?i.patch?"patch":i.minor?"minor":"major":"major";const c=l?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"};const D2=m2;var $2=(e,t)=>new D2(e,t).major;const j2=m2;var N2=(e,t)=>new j2(e,t).minor;const P2=m2;var _2=(e,t)=>new P2(e,t).patch;const I2=v2;var T2=(e,t)=>{const n=I2(e,t);return n&&n.prerelease.length?n.prerelease:null};const F2=m2;var R2=(e,t,n)=>new F2(e,n).compare(new F2(t,n));const A2=R2;var M2=(e,t,n)=>A2(t,e,n);const L2=R2;var B2=(e,t)=>L2(e,t,!0);const z2=m2;var H2=(e,t,n)=>{const r=new z2(e,n),o=new z2(t,n);return r.compare(o)||r.compareBuild(o)};const W2=H2;var U2=(e,t)=>e.sort(((e,n)=>W2(e,n,t)));const V2=H2;var G2=(e,t)=>e.sort(((e,n)=>V2(n,e,t)));const q2=R2;var X2=(e,t,n)=>q2(e,t,n)>0;const K2=R2;var Y2=(e,t,n)=>K2(e,t,n)<0;const Q2=R2;var J2=(e,t,n)=>0===Q2(e,t,n);const Z2=R2;var e5=(e,t,n)=>0!==Z2(e,t,n);const t5=R2;var n5=(e,t,n)=>t5(e,t,n)>=0;const r5=R2;var o5=(e,t,n)=>r5(e,t,n)<=0;const a5=J2,i5=e5,s5=X2,l5=n5,c5=Y2,u5=o5;var d5=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a5(e,n,r);case"!=":return i5(e,n,r);case">":return s5(e,n,r);case">=":return l5(e,n,r);case"<":return c5(e,n,r);case"<=":return u5(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const f5=m2,p5=v2,{safeRe:h5,t:g5}=n2;var m5,b5,v5=(e,t)=>{if(e instanceof f5)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=h5[g5.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),h5[g5.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;h5[g5.COERCERTL].lastIndex=-1}else n=e.match(h5[g5.COERCE]);return null===n?null:p5(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};var y5=w5;function w5(e){var t=this;if(t instanceof w5||(t=new w5),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var o=0;null!==r;o++)n=e(n,r.value,o),r=r.next;return n},w5.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var o=this.length-1;null!==r;o--)n=e(n,r.value,o),r=r.prev;return n},w5.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},w5.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},w5.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new w5;if(tthis.length&&(t=this.length);for(var r=0,o=this.head;null!==o&&rthis.length&&(t=this.length);for(var r=this.length,o=this.tail;null!==o&&r>t;r--)o=o.prev;for(;null!==o&&r>e;r--,o=o.prev)n.push(o.value);return n},w5.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;null!==o&&r1;const A5=(e,t,n)=>{const r=e[T5].get(t);if(r){const t=r.value;if(M5(e,t)){if(B5(e,r),!e[j5])return}else n&&(e[F5]&&(r.value.now=Date.now()),e[I5].unshiftNode(r));return t.value}},M5=(e,t)=>{if(!t||!t.maxAge&&!e[N5])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[N5]&&n>e[N5]},L5=e=>{if(e[D5]>e[O5])for(let t=e[I5].tail;e[D5]>e[O5]&&null!==t;){const n=t.prev;B5(e,t),t=n}},B5=(e,t)=>{if(t){const n=t.value;e[P5]&&e[P5](n.key,n.value),e[D5]-=n.length,e[T5].delete(n.key),e[I5].removeNode(t)}};class z5{constructor(e,t,n,r,o){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=o||0}}const H5=(e,t,n,r)=>{let o=n.value;M5(e,o)&&(B5(e,n),e[j5]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var W5,U5,V5,G5,q5=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[O5]=e.max||1/0;const t=e.length||R5;if(this[$5]="function"!=typeof t?R5:t,this[j5]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[N5]=e.maxAge||0,this[P5]=e.dispose,this[_5]=e.noDisposeOnSet||!1,this[F5]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[O5]=e||1/0,L5(this)}get max(){return this[O5]}set allowStale(e){this[j5]=!!e}get allowStale(){return this[j5]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[N5]=e,L5(this)}get maxAge(){return this[N5]}set lengthCalculator(e){"function"!=typeof e&&(e=R5),e!==this[$5]&&(this[$5]=e,this[D5]=0,this[I5].forEach((e=>{e.length=this[$5](e.value,e.key),this[D5]+=e.length}))),L5(this)}get lengthCalculator(){return this[$5]}get length(){return this[D5]}get itemCount(){return this[I5].length}rforEach(e,t){t=t||this;for(let n=this[I5].tail;null!==n;){const r=n.prev;H5(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[I5].head;null!==n;){const r=n.next;H5(this,e,n,t),n=r}}keys(){return this[I5].toArray().map((e=>e.key))}values(){return this[I5].toArray().map((e=>e.value))}reset(){this[P5]&&this[I5]&&this[I5].length&&this[I5].forEach((e=>this[P5](e.key,e.value))),this[T5]=new Map,this[I5]=new E5,this[D5]=0}dump(){return this[I5].map((e=>!M5(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[I5]}set(e,t,n){if((n=n||this[N5])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,o=this[$5](t,e);if(this[T5].has(e)){if(o>this[O5])return B5(this,this[T5].get(e)),!1;const a=this[T5].get(e).value;return this[P5]&&(this[_5]||this[P5](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[D5]+=o-a.length,a.length=o,this.get(e),L5(this),!0}const a=new z5(e,t,o,r,n);return a.length>this[O5]?(this[P5]&&this[P5](e,t),!1):(this[D5]+=a.length,this[I5].unshift(a),this[T5].set(e,this[I5].head),L5(this),!0)}has(e){if(!this[T5].has(e))return!1;const t=this[T5].get(e).value;return!M5(this,t)}get(e){return A5(this,e,!0)}peek(e){return A5(this,e,!1)}pop(){const e=this[I5].tail;return e?(B5(this,e),e.value):null}del(e){B5(this,this[T5].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.e||0;if(0===o)this.set(r.k,r.v);else{const e=o-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[T5].forEach(((e,t)=>A5(this,t,!1)))}};function X5(){if(U5)return W5;U5=1;class e{constructor(t,o){if(o=n(o),t instanceof e)return t.loose===!!o.loose&&t.includePrerelease===!!o.includePrerelease?t:new e(t.raw,o);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!p(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&h(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const n=((this.options.includePrerelease&&d)|(this.options.loose&&f))+":"+e,a=t.get(n);if(a)return a;const h=this.options.loose,g=h?i[s.HYPHENRANGELOOSE]:i[s.HYPHENRANGE];e=e.replace(g,O(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(i[s.COMPARATORTRIM],l),o("comparator trim",e),e=e.replace(i[s.TILDETRIM],c),o("tilde trim",e),e=e.replace(i[s.CARETTRIM],u),o("caret trim",e);let b=e.split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));h&&(b=b.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(i[s.COMPARATORLOOSE]))))),o("range list",b);const v=new Map,y=b.map((e=>new r(e,this.options)));for(const t of y){if(p(t))return[t];v.set(t.value,t)}v.size>1&&v.has("")&&v.delete("");const w=[...v.values()];return t.set(n,w),w}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(Bre){return!1}for(let t=0;t"<0.0.0-0"===e.value,h=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every((e=>o.intersects(e,t))),o=r.pop();return n},m=(e,t)=>(o("comp",e,t),e=w(e,t),o("caret",e),e=v(e,t),o("tildes",e),e=S(e,t),o("xrange",e),e=C(e,t),o("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>y(e,t))).join(" "),y=(e,t)=>{const n=t.loose?i[s.TILDELOOSE]:i[s.TILDE];return e.replace(n,((t,n,r,a,i)=>{let s;return o("tilde",e,t,n,r,a,i),b(n)?s="":b(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:b(a)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(o("replaceTilde pr",i),s=`>=${n}.${r}.${a}-${i} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${a} <${n}.${+r+1}.0-0`,o("tilde return",s),s}))},w=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{o("caret",e,t);const n=t.loose?i[s.CARETLOOSE]:i[s.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,a,i,s)=>{let l;return o("caret",e,t,n,a,i,s),b(n)?l="":b(a)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:b(i)?l="0"===n?`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:s?(o("replaceCaret pr",s),l="0"===n?"0"===a?`>=${n}.${a}.${i}-${s} <${n}.${a}.${+i+1}-0`:`>=${n}.${a}.${i}-${s} <${n}.${+a+1}.0-0`:`>=${n}.${a}.${i}-${s} <${+n+1}.0.0-0`):(o("no pr"),l="0"===n?"0"===a?`>=${n}.${a}.${i}${r} <${n}.${a}.${+i+1}-0`:`>=${n}.${a}.${i}${r} <${n}.${+a+1}.0-0`:`>=${n}.${a}.${i} <${+n+1}.0.0-0`),o("caret return",l),l}))},S=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>k(e,t))).join(" ")),k=(e,t)=>{e=e.trim();const n=t.loose?i[s.XRANGELOOSE]:i[s.XRANGE];return e.replace(n,((n,r,a,i,s,l)=>{o("xRange",e,n,r,a,i,s,l);const c=b(a),u=c||b(i),d=u||b(s),f=d;return"="===r&&f&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(i=0),s=0,">"===r?(r=">=",u?(a=+a+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",u?a=+a+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+a}.${i}.${s}${l}`):u?n=`>=${a}.0.0${l} <${+a+1}.0.0-0`:d&&(n=`>=${a}.${i}.0${l} <${a}.${+i+1}.0-0`),o("xRange return",n),n}))},C=(e,t)=>(o("replaceStars",e,t),e.trim().replace(i[s.STAR],"")),E=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(i[t.includePrerelease?s.GTE0PRE:s.GTE0],"")),O=e=>(t,n,r,o,a,i,s,l,c,u,d,f,p)=>`${n=b(r)?"":b(o)?`>=${r}.0.0${e?"-0":""}`:b(a)?`>=${r}.${o}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=b(c)?"":b(u)?`<${+c+1}.0.0-0`:b(d)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${d}-${f}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),D=(e,t,n)=>{for(let r=0;r0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return W5}function K5(){if(G5)return V5;G5=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,o){if(o=n(o),r instanceof t){if(r.loose===!!o.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),i("comparator",r,o),this.options=o,this.loose=!!o.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(t){const n=this.options.loose?r[o.COMPARATORLOOSE]:r[o.COMPARATOR],a=t.match(n);if(!a)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==a[1]?a[1]:"","="===this.operator&&(this.operator=""),a[2]?this.semver=new s(a[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(i("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(Bre){return!1}return a(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,r).test(this.value):""===e.operator?""===e.value||new l(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(a(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(a(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}V5=t;const n=a2,{safeRe:r,t:o}=n2,a=d5,i=t2,s=m2,l=X5();return V5}const Y5=X5();var Q5=(e,t,n)=>{try{t=new Y5(t,n)}catch(Bre){return!1}return t.test(e)};const J5=X5();var Z5=(e,t)=>new J5(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const e3=m2,t3=X5();var n3=(e,t,n)=>{let r=null,o=null,a=null;try{a=new t3(t,n)}catch(Bre){return null}return e.forEach((e=>{a.test(e)&&(r&&-1!==o.compare(e)||(r=e,o=new e3(r,n)))})),r};const r3=m2,o3=X5();var a3=(e,t,n)=>{let r=null,o=null,a=null;try{a=new o3(t,n)}catch(Bre){return null}return e.forEach((e=>{a.test(e)&&(r&&1!==o.compare(e)||(r=e,o=new r3(r,n)))})),r};const i3=m2,s3=X5(),l3=X2;var c3=(e,t)=>{e=new s3(e,t);let n=new i3("0.0.0");if(e.test(n))return n;if(n=new i3("0.0.0-0"),e.test(n))return n;n=null;for(let r=0;r{const t=new i3(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!l3(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||n&&!l3(n,o)||(n=o)}return n&&e.test(n)?n:null};const u3=X5();var d3=(e,t)=>{try{return new u3(e,t).range||"*"}catch(Bre){return null}};const f3=m2,p3=K5(),{ANY:h3}=p3,g3=X5(),m3=Q5,b3=X2,v3=Y2,y3=o5,w3=n5;var x3=(e,t,n,r)=>{let o,a,i,s,l;switch(e=new f3(e,r),t=new g3(t,r),n){case">":o=b3,a=y3,i=v3,s=">",l=">=";break;case"<":o=v3,a=w3,i=b3,s="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(m3(e,t,r))return!1;for(let c=0;c{e.semver===h3&&(e=new p3(">=0.0.0")),u=u||e,d=d||e,o(e.semver,u.semver,r)?u=e:i(e.semver,d.semver,r)&&(d=e)})),u.operator===s||u.operator===l)return!1;if((!d.operator||d.operator===s)&&a(e,d.semver))return!1;if(d.operator===l&&i(e,d.semver))return!1}return!0};const S3=x3;var k3=(e,t,n)=>S3(e,t,">",n);const C3=x3;var E3=(e,t,n)=>C3(e,t,"<",n);const O3=X5();var D3=(e,t,n)=>(e=new O3(e,n),t=new O3(t,n),e.intersects(t,n));const $3=Q5,j3=R2;const N3=X5(),P3=K5(),{ANY:_3}=P3,I3=Q5,T3=R2,F3=[new P3(">=0.0.0-0")],R3=[new P3(">=0.0.0")],A3=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===_3){if(1===t.length&&t[0].semver===_3)return!0;e=n.includePrerelease?F3:R3}if(1===t.length&&t[0].semver===_3){if(n.includePrerelease)return!0;t=R3}const r=new Set;let o,a,i,s,l,c,u;for(const p of e)">"===p.operator||">="===p.operator?o=M3(o,p,n):"<"===p.operator||"<="===p.operator?a=L3(a,p,n):r.add(p.semver);if(r.size>1)return null;if(o&&a){if(i=T3(o.semver,a.semver,n),i>0)return null;if(0===i&&(">="!==o.operator||"<="!==a.operator))return null}for(const p of r){if(o&&!I3(p,String(o),n))return null;if(a&&!I3(p,String(a),n))return null;for(const e of t)if(!I3(p,String(e),n))return!1;return!0}let d=!(!a||n.includePrerelease||!a.semver.prerelease.length)&&a.semver,f=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver;d&&1===d.prerelease.length&&"<"===a.operator&&0===d.prerelease[0]&&(d=!1);for(const p of t){if(u=u||">"===p.operator||">="===p.operator,c=c||"<"===p.operator||"<="===p.operator,o)if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),">"===p.operator||">="===p.operator){if(s=M3(o,p,n),s===p&&s!==o)return!1}else if(">="===o.operator&&!I3(o.semver,String(p),n))return!1;if(a)if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),"<"===p.operator||"<="===p.operator){if(l=L3(a,p,n),l===p&&l!==a)return!1}else if("<="===a.operator&&!I3(a.semver,String(p),n))return!1;if(!p.operator&&(a||o)&&0!==i)return!1}return!(o&&c&&!a&&0!==i)&&(!(a&&u&&!o&&0!==i)&&(!f&&!d))},M3=(e,t,n)=>{if(!e)return t;const r=T3(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},L3=(e,t,n)=>{if(!e)return t;const r=T3(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var B3=(e,t,n={})=>{if(e===t)return!0;e=new N3(e,n),t=new N3(t,n);let r=!1;e:for(const o of e.set){for(const e of t.set){const t=A3(o,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const z3=n2,H3=Z1,W3=m2,U3=l2,V3=(e,t,n)=>{const r=[];let o=null,a=null;const i=e.sort(((e,t)=>j3(e,t,n)));for(const u of i){$3(u,t,n)?(a=u,o||(o=u)):(a&&r.push([o,a]),a=null,o=null)}o&&r.push([o,null]);const s=[];for(const[u,d]of r)u===d?s.push(u):d||u!==i[0]?d?u===i[0]?s.push(`<=${d}`):s.push(`${u} - ${d}`):s.push(`>=${u}`):s.push("*");const l=s.join(" || "),c="string"==typeof t.raw?t.raw:String(t);return l.length{await fetch("/lobe/config",{body:JSON.stringify(e),headers:{"Content-Type":"application/json"},method:"POST"})},Q3={confirmPageUnload:!1,enableExtraNetworkSidebar:!0,enableHighlight:!1,enableSidebar:!0,enableWebFont:!0,extraNetworkCardSize:86,extraNetworkFixedMode:"fixed",extraNetworkSidebarExpand:!0,extraNetworkSidebarWidth:340,i18n:"en_US",layoutHideFooter:!1,layoutSplitPreview:!1,liteAnimation:!1,logoCustomTitle:"",logoCustomUrl:"",logoType:"lobe",neutralColor:void 0,primaryColor:void 0,promptEditor:!1,promptTextareaType:"resizable",sidebarExpand:!0,sidebarFixedMode:"fixed",sidebarWidth:280,svgIcon:!0},J3={currentTab:"tab_txt2img",latestVersion:X3,loading:!0,localeOptions:K3,setting:Q3,themeMode:"dark",version:X3},Z3="SD-LOBE-SETTING",e4=(e,t)=>({onInit:async()=>{e((()=>({loading:!0})),!1,"onInit");const{onLoadSetting:n,onLoadVersion:r,onLoadLatestVersion:o,onLoadLocalOptions:a}=t();await a(),await r(),await o(),await n(),e((()=>({loading:!1})),!1,"onInit")},onLoadLatestVersion:async()=>{const t=await(async()=>{const e=await fetch(`https://api.github.com/repos/${q3.replace("https://github.com/","")}/releases/latest`),t=await e.json();return t&&t.tag_name&&G3.clean(t.tag_name)||X3})();e((()=>({latestVersion:t})),!1,"onLoadLatestVersion")},onLoadLocalOptions:async()=>{const t=await(async()=>{const e=await fetch("/lobe/locales/options"),t=await e.json();return t&&0!==(null==t?void 0:t.length)?t:K3})();e((()=>({localeOptions:t})),!1,"onLoadLocalOptions")},onLoadSetting:async()=>{let t;const n=await(async()=>{const e=await fetch("/lobe/config"),t=await e.json();if(t&&!(null==t?void 0:t.empty))return t})();if(n&&(ue.start("🤯 [setting] loaded webui setting"),t=n),!t){const e=localStorage.getItem(Z3);e&&(ue.info("🤯 [setting] loaded local setting"),t=JSON.parse(e))}if(!t){const e=localStorage.getItem("SD-KITCHEN-SETTING");e&&(ue.info("🤯 [setting] loaded fallback local setting"),t=JSON.parse(e))}t||(ue.info("🤯 [setting] loaded default setting"),t=Q3);const r={...Q3,...t};await Y3(r),e((()=>({setting:r})),!1,"onLoadSetting"),ue.success("🤯 [setting] loaded"),console.table(r)},onLoadVersion:async()=>{const t=await(async()=>{const e=await fetch("/lobe/package"),t=await e.json();return t&&!t.empty&&t.version?t.version:X3})();e((()=>({version:t})),!1,"onLoadVersion")},onSetSetting:async n=>{const r={...t().setting,...n};localStorage.setItem(Z3,JSON.stringify(r)),await Y3(r),e((()=>({setting:r})),!1,"onSetSetting")},onSetThemeMode:t=>{e((()=>({themeMode:t})),!1,"onSetThemeMode")},setCurrentTab:()=>{var n;const r=null==(n=get_uiCurrentTabContent())?void 0:n.id;ue.info("🤯 [tab] onChange",r),r&&r!==t().currentTab&&e({currentTab:r},!1,"setCurrentTab")}}),t4=e=>({...Q3,...e.setting}),n4=e=>e.currentTab,r4=e=>e.themeMode,o4=Q1()(_1(((...e)=>({...J3,...e4(...e)}))),T1),a4=JSON.parse(localStorage.getItem(Z3));z0.use(E1).use(h1).init({backend:{loadPath:"/lobe/locales/{{lng}}"},debug:!1,fallbackLng:"en_US",lng:(null==a4?void 0:a4.i18n)||"en_US"});const i4="%[a-f0-9]{2}",s4=new RegExp("("+i4+")|([^%]+?)","gi"),l4=new RegExp("("+i4+")+","gi");function c4(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],c4(n),c4(r))}function u4(e){try{return decodeURIComponent(e)}catch{let t=e.match(s4)||[];for(let n=1;nnull==e,g4=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),m4=Symbol("encodeFragmentIdentifier");function b4(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function v4(e,t){return t.encode?t.strict?g4(e):encodeURIComponent(e):e}function y4(e,t){return t.decode?d4(e):e}function w4(e){return Array.isArray(e)?e.sort():"object"==typeof e?w4(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function x4(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function S4(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function k4(e){const t=(e=x4(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function C4(e,t){b4((t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t}).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),t?void 0!==r[e]?r[e]=[...r[e],n]:r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[...r[e],n]:r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),a="string"==typeof n&&!o&&y4(n,e).includes(e.arrayFormatSeparator);n=a?y4(n,e):n;const i=o||a?n.split(e.arrayFormatSeparator).map((t=>y4(t,e))):null===n?n:y4(n,e);r[t]=i};case"bracket-separator":return(t,n,r)=>{const o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o)return void(r[t]=n?y4(n,e):n);const a=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>y4(t,e)));void 0!==r[t]?r[t]=[...r[t],...a]:r[t]=a};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[...[n[e]].flat(),t]:n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;const e=t.decode?o.replace(/\+/g," "):o;let[a,i]=f4(e,"=");void 0===a&&(a=e),i=void 0===i?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?i:y4(i,t),n(y4(a,t),i,r)}for(const[o,a]of Object.entries(r))if("object"==typeof a&&null!==a)for(const[e,n]of Object.entries(a))a[e]=S4(n,t);else r[o]=S4(a,t);return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=w4(n):e[t]=n,e}),Object.create(null))}function E4(e,t){if(!e)return"";b4((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);const n=n=>t.skipNull&&h4(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[v4(t,e),"[",o,"]"].join("")]:[...n,[v4(t,e),"[",v4(o,e),"]=",v4(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[v4(t,e),"[]"].join("")]:[...n,[v4(t,e),"[]=",v4(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[v4(t,e),":list="].join("")]:[...n,[v4(t,e),":list=",v4(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[v4(n,e),t,v4(o,e)].join("")]:[[r,v4(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,v4(t,e)]:[...n,[v4(t,e),"=",v4(r,e)].join("")]}}(t),o={};for(const[i,s]of Object.entries(e))n(i)||(o[i]=s);const a=Object.keys(o);return!1!==t.sort&&a.sort(t.sort),a.map((n=>{const o=e[n];return void 0===o?"":null===o?v4(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?v4(n,t)+"[]":o.reduce(r(n),[]).join("&"):v4(n,t)+"="+v4(o,t)})).filter((e=>e.length>0)).join("&")}function O4(e,t){var n;t={decode:!0,...t};let[r,o]=f4(e,"#");return void 0===r&&(r=e),{url:(null==(n=null==r?void 0:r.split("?"))?void 0:n[0])??"",query:C4(k4(e),t),...t&&t.parseFragmentIdentifier&&o?{fragmentIdentifier:y4(o,t)}:{}}}function D4(e,t){t={encode:!0,strict:!0,[m4]:!0,...t};const n=x4(e.url).split("?")[0]||"";let r=E4({...C4(k4(e.url),{sort:!1}),...e.query},t);r&&(r=`?${r}`);let o=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);if(e.fragmentIdentifier){const r=new URL(n);r.hash=e.fragmentIdentifier,o=t[m4]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${r}${o}`}function $4(e,t,n){n={parseFragmentIdentifier:!0,[m4]:!1,...n};const{url:r,query:o,fragmentIdentifier:a}=O4(e,n);return D4({url:r,query:p4(o,t),fragmentIdentifier:a},n)}const j4=Object.freeze(Object.defineProperty({__proto__:null,exclude:function(e,t,n){return $4(e,Array.isArray(t)?e=>!t.includes(e):(e,n)=>!t(e,n),n)},extract:k4,parse:C4,parseUrl:O4,pick:$4,stringify:E4,stringifyUrl:D4},Symbol.toStringTag,{value:"Module"})),N4=()=>{const[e,t]=z.useState((()=>{try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}})());return z.useEffect((()=>{const e=window.matchMedia("(prefers-color-scheme: dark)"),n=e=>{t(e.matches)};return e.addEventListener("change",n),()=>{e.removeEventListener("change",n)}}),[]),e},P4={dark:{colorPrimary:"#007AFF",colorPrimaryActive:"#1554ad",colorPrimaryBg:"#111a2c",colorPrimaryBgHover:"#112545",colorPrimaryBorder:"#15325b",colorPrimaryBorderHover:"#15417e",colorPrimaryHover:"#3c89e8",colorPrimaryText:"#1668dc",colorPrimaryTextActive:"#1554ad",colorPrimaryTextHover:"#3c89e8"},light:{colorPrimary:"#007AFF",colorPrimaryActive:"#0958d9",colorPrimaryBg:"#e6f4ff",colorPrimaryBgHover:"#bae0ff",colorPrimaryBorder:"#91caff",colorPrimaryBorderHover:"#69b1ff",colorPrimaryHover:"#4096ff",colorPrimaryText:"#1677ff",colorPrimaryTextActive:"#0958d9",colorPrimaryTextHover:"#4096ff"}},_4={dark:{colorBgContainer:"#1f1f1f",colorBgElevated:"#222",colorBgLayout:"#181818",colorBgSpotlight:"#444",colorBorder:"#444",colorBorderSecondary:"#333",colorFill:"rgb(255 255 255 / 18%)",colorFillQuaternary:"rgb(255 255 255 / 4%)",colorFillSecondary:"rgb(255 255 255 / 12%)",colorFillTertiary:"rgb(255 255 255 / 8%)",colorNeutral:"#666",colorText:"rgb(255 255 255 / 85%)",colorTextQuaternary:"rgb(255 255 255 / 25%)",colorTextSecondary:"rgb(255 255 255 / 65%)",colorTextTertiary:"rgb(255 255 255 / 45%)"},light:{colorBgContainer:"#fff",colorBgElevated:"#fff",colorBgLayout:"#f7f7f7",colorBgSpotlight:"rgb(0 0 0 / 85%)",colorBorder:"#ddd",colorBorderSecondary:"#eee",colorFill:"rgb(0 0 0 / 15%)",colorFillQuaternary:"rgb(0 0 0 / 2%)",colorFillSecondary:"rgb(0 0 0 / 6%)",colorFillTertiary:"rgb(0 0 0 / 4%)",colorNeutral:"#666",colorText:"rgb(0 0 0 / 88%)",colorTextQuaternary:"rgb(0 0 0 / 25%)",colorTextSecondary:"rgb(0 0 0 / 65%)",colorTextTertiary:"rgb(0 0 0 / 45%)"}},I4=z.memo((({children:e})=>{const{onSetThemeMode:t,themeMode:n}=o4((e=>({onInit:e.onInit,onSetThemeMode:e.onSetThemeMode,themeMode:e.themeMode})),T1),r=o4(t4,IY),o=N4();z.useEffect((()=>{const e=String(j4.parseUrl(window.location.href).query.__theme||"");e?(document.body.classList.add(e),t(e)):(document.body.classList.add(o?"dark":"light"),t(o?"dark":"light"))}),[o]);const a=z.useCallback((()=>{let e={},t={};if(r.primaryColor)if("kitchen"===r.primaryColor)e=P4[n];else{const t=fK[r.primaryColor];e=ZJ({appearance:n,scale:t,type:"Primary"})}if(r.neutralColor)if("kitchen"===r.neutralColor)t=_4[n];else{const e=tZ[r.neutralColor];t=eZ({appearance:n,scale:e})}return{...e,...t}}),[r.primaryColor,r.neutralColor,n]);return r&&Q.jsx(r0,{customToken:a,enableWebfonts:r.enableWebFont,themeMode:n,children:e})})),T4=MB((({css:e,token:t,cx:n,stylish:r,prefixCls:o})=>{const a=`${o}-highlighter`;return{container:e` + `,xe([ae({reflect:!0})],e.GiscusWidget.prototype,"host",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"repo",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"repoId",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"category",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"categoryId",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"mapping",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"term",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"strict",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"reactionsEnabled",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"emitMetadata",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"inputPosition",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"theme",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"lang",2),xe([ae({reflect:!0})],e.GiscusWidget.prototype,"loading",2),e.GiscusWidget=xe([function(e){return customElements.get(e)?e=>e:(e=>t=>{return"function"==typeof t?(n=e,r=t,customElements.define(n,r),r):((e,t)=>{const{kind:n,elements:r}=t;return{kind:n,elements:r,finisher(t){customElements.define(e,t)}}})(e,t);var n,r})(e)}("giscus-widget")],e.GiscusWidget)}(jQ)),jQ}const PQ=Q,_Q=z;var IQ=function({id:e,host:t,repo:n,repoId:r,category:o,categoryId:a,mapping:i,term:s,strict:l,reactionsEnabled:c,emitMetadata:u,inputPosition:d,theme:f,lang:p,loading:h}){const[g,m]=_Q.useState(!1);return _Q.useEffect((()=>{g||(Promise.resolve().then((()=>NQ())),m(!0))}),[]),g?PQ.jsx("giscus-widget",{id:e,host:t,repo:n,repoid:r,category:o,categoryid:a,mapping:i,term:s,strict:l,reactionsenabled:c,emitmetadata:u,inputposition:d,theme:f,lang:p,loading:h}):null};const TQ=n(IQ);var FQ,RQ=function(e){return["zh_CN","zh_TW"].includes(e)?e.replace("_","-"):"zh_HK"===e?"zh-TW":e.split("_")[0]},AQ=["style","className","reactionsEnabled","mapping","lang","inputPosition","id","loading","emitMetadata"];function MQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function LQ(e){for(var t=1;t .m-2 {\n display: flex;\n flex-wrap: wrap;\n gap: 8px;\n }\n }\n\n .gsc-emoji-button.has-reacted {\n border-color: ",";\n border-radius: ","px;\n }\n\n .gsc-loading-image {\n background-image: url(",");\n }\n }\n "])),a,l,s,i,c,c,l,i,i,o,AW(i,.4),o,AW(i,.6),l,s,c,o,o,o,AW(i,.2),l,AW(l,.2),s,AW(i,.2),o,AW(c,.2),s,o,a,c,e.colorText,e.colorFillTertiary,e.colorBorderSecondary,e.colorFillSecondary,e.colorBorder,e.colorFillSecondary,e.colorBorder,e.colorFillSecondary,JW(e.colorPrimary),e.colorPrimary,e.colorPrimaryBorder,e.colorPrimaryHover,e.colorPrimaryBorderHover,e.colorPrimaryActive,AW(JW(e.colorPrimary),.5),AW(e.colorPrimary,.5),AW(e.colorPrimaryBorder,.5),e.colorFillQuaternary,e.colorFillTertiary,e.colorBorder,e.colorText,e.colorTextSecondary,e.colorTextQuaternary,e.colorBgElevated,e.colorFillQuaternary,e.colorBorder,e.colorBorderSecondary,e.colorFillQuaternary,e.colorFillTertiary,e.colorInfo,e.colorInfoBorderHover,e.colorInfoBorder,e.colorInfoBg,e.colorSuccess,e.colorWarning,e.colorWarningBorder,e.colorWarningBg,e.colorError,e.colorErrorBorder,e.colorErrorBg,e.colorBgContainer,e.colorInfoBg,e.colorFillSecondary,e.colorInfoBgHover,r,u,e.colorInfoBorderHover,e.borderRadius,d)}(v,y).styles)}),[y,v]);return Q.jsx("div",{className:n,style:t,children:Q.jsx(TQ,LQ({emitMetadata:m,id:f,inputPosition:u,lang:RQ(l),loading:h,mapping:i,reactionsEnabled:o,theme:"data:text/css;base64,".concat(w)},b))})}));var zQ,HQ,WQ=MB((function(e,t){var n,r=e.css,o=e.token,a=e.isDarkMode,i=e.stylish;switch(t){case"large":n=o.borderRadiusLG;break;case"middle":default:n=o.borderRadius;break;case"small":n=o.borderRadiusSM}return{button:r(zQ||(zQ=tf(["\n position: relative;\n z-index: 1;\n ","\n border: none;\n border-radius: ","px !important;\n\n &::before {\n content: '';\n\n position: absolute;\n z-index: -1;\n top: 1px;\n left: 1px;\n\n width: calc(100% - 2px);\n height: calc(100% - 2px);\n\n background: ",";\n border-radius: ","px;\n }\n "])),i.gradientAnimation,n,o.colorBgLayout,n-1),glow:r(HQ||(HQ=tf(["\n ","\n position: absolute;\n z-index: -2;\n top: 0;\n left: 0;\n\n width: 100%;\n height: 100%;\n\n opacity: ",";\n filter: blur(","em);\n border-radius: inherit;\n "])),i.gradientAnimation,a?.5:.3,a?1.5:1)}})),UQ=["glow","children","className","size"];function VQ(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function GQ(e){for(var t=1;t=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return i=e.done,e},e:function(e){s=!0,a=e},f:function(){try{i||null==n.return||n.return()}finally{if(s)throw a}}}}function cZ(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n code {\n padding: 0 !important;\n border: none !important;\n }\n }\n\n > :not([data-code-type='highlighter']) code {\n padding: 2px 6px;\n\n font-size: ","px;\n color: ",";\n\n background: ",";\n border: 1px solid ",";\n border-radius: ","px;\n }\n\n table {\n border-spacing: 0;\n\n width: 100%;\n margin-block: 1em 1em;\n margin-inline: 0 0;\n padding: 8px;\n\n border: 1px solid ",";\n border-radius: ","px;\n\n code {\n display: inline-flex;\n }\n }\n\n th,\n td {\n padding-block: 10px 10px;\n padding-inline: 16px 16px;\n }\n\n thead {\n tr {\n th {\n background: ",";\n\n &:first-child {\n border-top-left-radius: ","px;\n border-bottom-left-radius: ","px;\n }\n\n &:last-child {\n border-top-right-radius: ","px;\n border-bottom-right-radius: ","px;\n }\n }\n }\n }\n\n > ol > li::marker {\n color: "," !important;\n }\n\n > ul > li {\n line-height: 1.8;\n list-style-type: disc;\n\n &::marker {\n color: "," !important;\n }\n }\n\n ol,\n ul {\n > li::marker {\n color: ",";\n }\n }\n\n details {\n margin-bottom: 1em;\n padding: 12px 16px;\n\n background: ",";\n border: 1px solid ",";\n border-radius: ","px;\n\n transition: all 400ms ",";\n }\n\n details[open] {\n summary {\n padding-bottom: 12px;\n border-bottom: 1px solid ",";\n }\n }\n "])),n.colorText,n.colorText,n.colorTextDescription,n.colorLink,n.colorLinkHover,n.colorLinkActive,n.borderRadius,n.fontSizeSM,a,i,r?n.cyan1A:n.cyan6A,n.borderRadiusSM,n.colorBorderSecondary,n.borderRadius,n.colorFillTertiary,n.borderRadius,n.borderRadius,n.borderRadius,n.borderRadius,r?n.cyan9A:n.cyan10A,r?n.cyan9A:n.cyan10A,n.colorTextDescription,n.colorFillTertiary,n.colorBorderSecondary,n.borderRadiusLG,n.motionEaseOut,n.colorBorder),markdownInChat:t(YJ||(YJ=tf(["\n h1 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.6em;\n }\n\n h2 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.4em;\n }\n\n h3 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.2em;\n }\n\n h4 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1.1em;\n }\n\n h5 {\n margin-top: 0;\n margin-block-start: 0;\n font-size: 1em;\n }\n\n > *:last-child {\n margin-bottom: 0 !important;\n }\n\n p {\n line-height: 1.8 !important;\n\n + * {\n margin-block-end: 0.5em !important;\n }\n\n &:not(:last-child) {\n margin-bottom: 1em !important;\n }\n }\n "]))),noScrollbar:t(QJ||(QJ=tf(["\n ::-webkit-scrollbar {\n display: none;\n width: 0;\n height: 0;\n background-color: transparent;\n }\n "]))),resetLinkColor:t(JJ||(JJ=tf(["\n cursor: pointer;\n color: ",";\n\n &:hover {\n color: ",";\n }\n "])),n.colorTextSecondary,n.colorText)}}(e)),null==n?void 0:n(e))}),[n]),p=z.useCallback((function(e){return n0(n0({},function(e){for(var t=e.isDarkMode,n={},r=0,o=Object.entries(fK);r0&&d.map((function(e){return Q.jsx(TY,{url:e},e)})),Q.jsx(UB,{speedy:!0,children:Q.jsxs(WB,n0(n0({customStylish:f,customToken:p},c),{},{theme:h,children:[Q.jsx(ZZ,{}),Q.jsx(s$,{style:{minHeight:"inherit",width:"inherit"},children:t})]}))})]})})),o0={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console&&console[e]&&console[e].apply(console,t)}};class a0{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.init(e,t)}init(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.prefix=t.prefix||"i18next:",this.logger=e||o0,this.options=t,this.debug=t.debug}log(){for(var e=arguments.length,t=new Array(e),n=0;n{this.observers[e]=this.observers[e]||[],this.observers[e].push(t)})),this}off(e,t){this.observers[e]&&(t?this.observers[e]=this.observers[e].filter((e=>e!==t)):delete this.observers[e])}emit(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r{e(...n)}))}if(this.observers["*"]){[].concat(this.observers["*"]).forEach((t=>{t.apply(t,[e,...n])}))}}}function l0(){let e,t;const n=new Promise(((n,r)=>{e=n,t=r}));return n.resolve=e,n.reject=t,n}function c0(e){return null==e?"":""+e}function u0(e,t,n){function r(e){return e&&e.indexOf("###")>-1?e.replace(/###/g,"."):e}function o(){return!e||"string"==typeof e}const a="string"!=typeof t?[].concat(t):t.split(".");for(;a.length>1;){if(o())return{};const t=r(a.shift());!e[t]&&n&&(e[t]=new n),e=Object.prototype.hasOwnProperty.call(e,t)?e[t]:{}}return o()?{}:{obj:e,k:r(a.shift())}}function d0(e,t,n){const{obj:r,k:o}=u0(e,t,Object);r[o]=n}function f0(e,t){const{obj:n,k:r}=u0(e,t);if(n)return n[r]}function p0(e,t,n){for(const r in t)"__proto__"!==r&&"constructor"!==r&&(r in e?"string"==typeof e[r]||e[r]instanceof String||"string"==typeof t[r]||t[r]instanceof String?n&&(e[r]=t[r]):p0(e[r],t[r],n):e[r]=t[r]);return e}function h0(e){return e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&")}var g0={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function m0(e){return"string"==typeof e?e.replace(/[&<>"'\/]/g,(e=>g0[e])):e}const b0=[" ",",","?","!",";"];function v0(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:".";if(!e)return;if(e[t])return e[t];const r=t.split(n);let o=e;for(let a=0;aa+e;)e++,i=r.slice(a,a+e).join(n),s=o[i];if(void 0===s)return;if(null===s)return null;if(t.endsWith(i)){if("string"==typeof s)return s;if(i&&"string"==typeof s[i])return s[i]}const l=r.slice(a+e).join(n);return l?v0(s,l,n):void 0}o=o[r[a]]}return o}function y0(e){return e&&e.indexOf("_")>0?e.replace("_","-"):e}class w0 extends s0{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{ns:["translation"],defaultNS:"translation"};super(),this.data=e||{},this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),void 0===this.options.ignoreJSONStructure&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const t=this.options.ns.indexOf(e);t>-1&&this.options.ns.splice(t,1)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};const o=void 0!==r.keySeparator?r.keySeparator:this.options.keySeparator,a=void 0!==r.ignoreJSONStructure?r.ignoreJSONStructure:this.options.ignoreJSONStructure;let i=[e,t];n&&"string"!=typeof n&&(i=i.concat(n)),n&&"string"==typeof n&&(i=i.concat(o?n.split(o):n)),e.indexOf(".")>-1&&(i=e.split("."));const s=f0(this.data,i);return s||!a||"string"!=typeof n?s:v0(this.data&&this.data[e]&&this.data[e][t],n,o)}addResource(e,t,n,r){let o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:{silent:!1};const a=void 0!==o.keySeparator?o.keySeparator:this.options.keySeparator;let i=[e,t];n&&(i=i.concat(a?n.split(a):n)),e.indexOf(".")>-1&&(i=e.split("."),r=t,t=i[1]),this.addNamespaces(t),d0(this.data,i,r),o.silent||this.emit("added",e,t,n,r)}addResources(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{silent:!1};for(const o in n)"string"!=typeof n[o]&&"[object Array]"!==Object.prototype.toString.apply(n[o])||this.addResource(e,t,o,n[o],{silent:!0});r.silent||this.emit("added",e,t,n)}addResourceBundle(e,t,n,r,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{silent:!1},i=[e,t];e.indexOf(".")>-1&&(i=e.split("."),r=n,n=t,t=i[1]),this.addNamespaces(t);let s=f0(this.data,i)||{};r?p0(s,n,o):s={...s,...n},d0(this.data,i,s),a.silent||this.emit("added",e,t,n)}removeResourceBundle(e,t){this.hasResourceBundle(e,t)&&delete this.data[e][t],this.removeNamespaces(t),this.emit("removed",e,t)}hasResourceBundle(e,t){return void 0!==this.getResource(e,t)}getResourceBundle(e,t){return t||(t=this.options.defaultNS),"v1"===this.options.compatibilityAPI?{...this.getResource(e,t)}:this.getResource(e,t)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const t=this.getDataByLanguage(e);return!!(t&&Object.keys(t)||[]).find((e=>t[e]&&Object.keys(t[e]).length>0))}toJSON(){return this.data}}var x0={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,o){return e.forEach((e=>{this.processors[e]&&(t=this.processors[e].process(t,n,r,o))})),t}};const S0={};class k0 extends s0{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};super(),function(e,t,n){e.forEach((e=>{t[e]&&(n[e]=t[e])}))}(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=t,void 0===this.options.keySeparator&&(this.options.keySeparator="."),this.logger=i0.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}};if(null==e)return!1;const n=this.resolve(e,t);return n&&void 0!==n.res}extractFromKey(e,t){let n=void 0!==t.nsSeparator?t.nsSeparator:this.options.nsSeparator;void 0===n&&(n=":");const r=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator;let o=t.ns||this.options.defaultNS||[];const a=n&&e.indexOf(n)>-1,i=!(this.options.userDefinedKeySeparator||t.keySeparator||this.options.userDefinedNsSeparator||t.nsSeparator||function(e,t,n){t=t||"",n=n||"";const r=b0.filter((e=>t.indexOf(e)<0&&n.indexOf(e)<0));if(0===r.length)return!0;const o=new RegExp(`(${r.map((e=>"?"===e?"\\?":e)).join("|")})`);let a=!o.test(e);if(!a){const t=e.indexOf(n);t>0&&!o.test(e.substring(0,t))&&(a=!0)}return a}(e,n,r));if(a&&!i){const t=e.match(this.interpolator.nestingRegexp);if(t&&t.length>0)return{key:e,namespaces:o};const a=e.split(n);(n!==r||n===r&&this.options.ns.indexOf(a[0])>-1)&&(o=a.shift()),e=a.join(r)}return"string"==typeof o&&(o=[o]),{key:e,namespaces:o}}translate(e,t,n){if("object"!=typeof t&&this.options.overloadTranslationOptionHandler&&(t=this.options.overloadTranslationOptionHandler(arguments)),"object"==typeof t&&(t={...t}),t||(t={}),null==e)return"";Array.isArray(e)||(e=[String(e)]);const r=void 0!==t.returnDetails?t.returnDetails:this.options.returnDetails,o=void 0!==t.keySeparator?t.keySeparator:this.options.keySeparator,{key:a,namespaces:i}=this.extractFromKey(e[e.length-1],t),s=i[i.length-1],l=t.lng||this.language,c=t.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(l&&"cimode"===l.toLowerCase()){if(c){const e=t.nsSeparator||this.options.nsSeparator;return r?{res:`${s}${e}${a}`,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:`${s}${e}${a}`}return r?{res:a,usedKey:a,exactUsedKey:a,usedLng:l,usedNS:s,usedParams:this.getUsedParamsDetails(t)}:a}const u=this.resolve(e,t);let d=u&&u.res;const f=u&&u.usedKey||a,p=u&&u.exactUsedKey||a,h=Object.prototype.toString.apply(d),g=void 0!==t.joinArrays?t.joinArrays:this.options.joinArrays,m=!this.i18nFormat||this.i18nFormat.handleAsObject;if(m&&d&&("string"!=typeof d&&"boolean"!=typeof d&&"number"!=typeof d)&&["[object Number]","[object Function]","[object RegExp]"].indexOf(h)<0&&("string"!=typeof g||"[object Array]"!==h)){if(!t.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const e=this.options.returnedObjectHandler?this.options.returnedObjectHandler(f,d,{...t,ns:i}):`key '${a} (${this.language})' returned an object instead of string.`;return r?(u.res=e,u.usedParams=this.getUsedParamsDetails(t),u):e}if(o){const e="[object Array]"===h,n=e?[]:{},r=e?p:f;for(const a in d)if(Object.prototype.hasOwnProperty.call(d,a)){const e=`${r}${o}${a}`;n[a]=this.translate(e,{...t,joinArrays:!1,ns:i}),n[a]===e&&(n[a]=d[a])}d=n}}else if(m&&"string"==typeof g&&"[object Array]"===h)d=d.join(g),d&&(d=this.extendTranslation(d,e,t,n));else{let r=!1,i=!1;const c=void 0!==t.count&&"string"!=typeof t.count,f=k0.hasDefaultValue(t),p=c?this.pluralResolver.getSuffix(l,t.count,t):"",h=t.ordinal&&c?this.pluralResolver.getSuffix(l,t.count,{ordinal:!1}):"",g=t[`defaultValue${p}`]||t[`defaultValue${h}`]||t.defaultValue;!this.isValidLookup(d)&&f&&(r=!0,d=g),this.isValidLookup(d)||(i=!0,d=a);const m=(t.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&i?void 0:d,b=f&&g!==d&&this.options.updateMissing;if(i||r||b){if(this.logger.log(b?"updateKey":"missingKey",l,s,a,b?g:d),o){const e=this.resolve(a,{...t,keySeparator:!1});e&&e.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let e=[];const n=this.languageUtils.getFallbackCodes(this.options.fallbackLng,t.lng||this.language);if("fallback"===this.options.saveMissingTo&&n&&n[0])for(let t=0;t{const o=f&&r!==d?r:m;this.options.missingKeyHandler?this.options.missingKeyHandler(e,s,n,o,b,t):this.backendConnector&&this.backendConnector.saveMissing&&this.backendConnector.saveMissing(e,s,n,o,b,t),this.emit("missingKey",e,s,n,d)};this.options.saveMissing&&(this.options.saveMissingPlurals&&c?e.forEach((e=>{this.pluralResolver.getSuffixes(e,t).forEach((n=>{r([e],a+n,t[`defaultValue${n}`]||g)}))})):r(e,a,g))}d=this.extendTranslation(d,e,t,u,n),i&&d===a&&this.options.appendNamespaceToMissingKey&&(d=`${s}:${a}`),(i||r)&&this.options.parseMissingKeyHandler&&(d="v1"!==this.options.compatibilityAPI?this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${s}:${a}`:a,r?d:void 0):this.options.parseMissingKeyHandler(d))}return r?(u.res=d,u.usedParams=this.getUsedParamsDetails(t),u):d}extendTranslation(e,t,n,r,o){var a=this;if(this.i18nFormat&&this.i18nFormat.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...n},n.lng||this.language||r.usedLng,r.usedNS,r.usedKey,{resolved:r});else if(!n.skipInterpolation){n.interpolation&&this.interpolator.init({...n,interpolation:{...this.options.interpolation,...n.interpolation}});const i="string"==typeof e&&(n&&n.interpolation&&void 0!==n.interpolation.skipOnVariables?n.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let s;if(i){const t=e.match(this.interpolator.nestingRegexp);s=t&&t.length}let l=n.replace&&"string"!=typeof n.replace?n.replace:n;if(this.options.interpolation.defaultVariables&&(l={...this.options.interpolation.defaultVariables,...l}),e=this.interpolator.interpolate(e,l,n.lng||this.language,n),i){const t=e.match(this.interpolator.nestingRegexp);s<(t&&t.length)&&(n.nest=!1)}!n.lng&&"v1"!==this.options.compatibilityAPI&&r&&r.res&&(n.lng=r.usedLng),!1!==n.nest&&(e=this.interpolator.nest(e,(function(){for(var e=arguments.length,r=new Array(e),i=0;i1&&void 0!==arguments[1]?arguments[1]:{};return"string"==typeof e&&(e=[e]),e.forEach((e=>{if(this.isValidLookup(t))return;const s=this.extractFromKey(e,i),l=s.key;n=l;let c=s.namespaces;this.options.fallbackNS&&(c=c.concat(this.options.fallbackNS));const u=void 0!==i.count&&"string"!=typeof i.count,d=u&&!i.ordinal&&0===i.count&&this.pluralResolver.shouldUseIntlApi(),f=void 0!==i.context&&("string"==typeof i.context||"number"==typeof i.context)&&""!==i.context,p=i.lngs?i.lngs:this.languageUtils.toResolveHierarchy(i.lng||this.language,i.fallbackLng);c.forEach((e=>{this.isValidLookup(t)||(a=e,!S0[`${p[0]}-${e}`]&&this.utils&&this.utils.hasLoadedNamespace&&!this.utils.hasLoadedNamespace(a)&&(S0[`${p[0]}-${e}`]=!0,this.logger.warn(`key "${n}" for languages "${p.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),p.forEach((n=>{if(this.isValidLookup(t))return;o=n;const a=[l];if(this.i18nFormat&&this.i18nFormat.addLookupKeys)this.i18nFormat.addLookupKeys(a,l,n,e,i);else{let e;u&&(e=this.pluralResolver.getSuffix(n,i.count,i));const t=`${this.options.pluralSeparator}zero`,r=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(u&&(a.push(l+e),i.ordinal&&0===e.indexOf(r)&&a.push(l+e.replace(r,this.options.pluralSeparator)),d&&a.push(l+t)),f){const n=`${l}${this.options.contextSeparator}${i.context}`;a.push(n),u&&(a.push(n+e),i.ordinal&&0===e.indexOf(r)&&a.push(n+e.replace(r,this.options.pluralSeparator)),d&&a.push(n+t))}}let s;for(;s=a.pop();)this.isValidLookup(t)||(r=s,t=this.getResource(n,e,s,i))})))}))})),{res:t,usedKey:n,exactUsedKey:r,usedLng:o,usedNS:a}}isValidLookup(e){return!(void 0===e||!this.options.returnNull&&null===e||!this.options.returnEmptyString&&""===e)}getResource(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return this.i18nFormat&&this.i18nFormat.getResource?this.i18nFormat.getResource(e,t,n,r):this.resourceStore.getResource(e,t,n,r)}getUsedParamsDetails(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};const t=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],n=e.replace&&"string"!=typeof e.replace;let r=n?e.replace:e;if(n&&void 0!==e.count&&(r.count=e.count),this.options.interpolation.defaultVariables&&(r={...this.options.interpolation.defaultVariables,...r}),!n){r={...r};for(const e of t)delete r[e]}return r}static hasDefaultValue(e){const t="defaultValue";for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)&&t===n.substring(0,12)&&void 0!==e[n])return!0;return!1}}function C0(e){return e.charAt(0).toUpperCase()+e.slice(1)}class E0{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=i0.create("languageUtils")}getScriptPartFromCode(e){if(!(e=y0(e))||e.indexOf("-")<0)return null;const t=e.split("-");return 2===t.length?null:(t.pop(),"x"===t[t.length-1].toLowerCase()?null:this.formatLanguageCode(t.join("-")))}getLanguagePartFromCode(e){if(!(e=y0(e))||e.indexOf("-")<0)return e;const t=e.split("-");return this.formatLanguageCode(t[0])}formatLanguageCode(e){if("string"==typeof e&&e.indexOf("-")>-1){const t=["hans","hant","latn","cyrl","cans","mong","arab"];let n=e.split("-");return this.options.lowerCaseLng?n=n.map((e=>e.toLowerCase())):2===n.length?(n[0]=n[0].toLowerCase(),n[1]=n[1].toUpperCase(),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C0(n[1].toLowerCase()))):3===n.length&&(n[0]=n[0].toLowerCase(),2===n[1].length&&(n[1]=n[1].toUpperCase()),"sgn"!==n[0]&&2===n[2].length&&(n[2]=n[2].toUpperCase()),t.indexOf(n[1].toLowerCase())>-1&&(n[1]=C0(n[1].toLowerCase())),t.indexOf(n[2].toLowerCase())>-1&&(n[2]=C0(n[2].toLowerCase()))),n.join("-")}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return("languageOnly"===this.options.load||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let t;return e.forEach((e=>{if(t)return;const n=this.formatLanguageCode(e);this.options.supportedLngs&&!this.isSupportedCode(n)||(t=n)})),!t&&this.options.supportedLngs&&e.forEach((e=>{if(t)return;const n=this.getLanguagePartFromCode(e);if(this.isSupportedCode(n))return t=n;t=this.options.supportedLngs.find((e=>e===n?e:e.indexOf("-")<0&&n.indexOf("-")<0?void 0:0===e.indexOf(n)?e:void 0))})),t||(t=this.getFallbackCodes(this.options.fallbackLng)[0]),t}getFallbackCodes(e,t){if(!e)return[];if("function"==typeof e&&(e=e(t)),"string"==typeof e&&(e=[e]),"[object Array]"===Object.prototype.toString.apply(e))return e;if(!t)return e.default||[];let n=e[t];return n||(n=e[this.getScriptPartFromCode(t)]),n||(n=e[this.formatLanguageCode(t)]),n||(n=e[this.getLanguagePartFromCode(t)]),n||(n=e.default),n||[]}toResolveHierarchy(e,t){const n=this.getFallbackCodes(t||this.options.fallbackLng||[],e),r=[],o=e=>{e&&(this.isSupportedCode(e)?r.push(e):this.logger.warn(`rejecting language code not found in supportedLngs: ${e}`))};return"string"==typeof e&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?("languageOnly"!==this.options.load&&o(this.formatLanguageCode(e)),"languageOnly"!==this.options.load&&"currentOnly"!==this.options.load&&o(this.getScriptPartFromCode(e)),"currentOnly"!==this.options.load&&o(this.getLanguagePartFromCode(e))):"string"==typeof e&&o(this.formatLanguageCode(e)),n.forEach((e=>{r.indexOf(e)<0&&o(this.formatLanguageCode(e))})),r}}let O0=[{lngs:["ach","ak","am","arn","br","fil","gun","ln","mfe","mg","mi","oc","pt","pt-BR","tg","tl","ti","tr","uz","wa"],nr:[1,2],fc:1},{lngs:["af","an","ast","az","bg","bn","ca","da","de","dev","el","en","eo","es","et","eu","fi","fo","fur","fy","gl","gu","ha","hi","hu","hy","ia","it","kk","kn","ku","lb","mai","ml","mn","mr","nah","nap","nb","ne","nl","nn","no","nso","pa","pap","pms","ps","pt-PT","rm","sco","se","si","so","son","sq","sv","sw","ta","te","tk","ur","yo"],nr:[1,2],fc:2},{lngs:["ay","bo","cgg","fa","ht","id","ja","jbo","ka","km","ko","ky","lo","ms","sah","su","th","tt","ug","vi","wo","zh"],nr:[1],fc:3},{lngs:["be","bs","cnr","dz","hr","ru","sr","uk"],nr:[1,2,5],fc:4},{lngs:["ar"],nr:[0,1,2,3,11,100],fc:5},{lngs:["cs","sk"],nr:[1,2,5],fc:6},{lngs:["csb","pl"],nr:[1,2,5],fc:7},{lngs:["cy"],nr:[1,2,3,8],fc:8},{lngs:["fr"],nr:[1,2],fc:9},{lngs:["ga"],nr:[1,2,3,7,11],fc:10},{lngs:["gd"],nr:[1,2,3,20],fc:11},{lngs:["is"],nr:[1,2],fc:12},{lngs:["jv"],nr:[0,1],fc:13},{lngs:["kw"],nr:[1,2,3,4],fc:14},{lngs:["lt"],nr:[1,2,10],fc:15},{lngs:["lv"],nr:[1,2,0],fc:16},{lngs:["mk"],nr:[1,2],fc:17},{lngs:["mnk"],nr:[0,1,2],fc:18},{lngs:["mt"],nr:[1,2,11,20],fc:19},{lngs:["or"],nr:[2,1],fc:2},{lngs:["ro"],nr:[1,2,20],fc:20},{lngs:["sl"],nr:[5,1,2,3],fc:21},{lngs:["he","iw"],nr:[1,2,20,21],fc:22}],D0={1:function(e){return Number(e>1)},2:function(e){return Number(1!=e)},3:function(e){return 0},4:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},5:function(e){return Number(0==e?0:1==e?1:2==e?2:e%100>=3&&e%100<=10?3:e%100>=11?4:5)},6:function(e){return Number(1==e?0:e>=2&&e<=4?1:2)},7:function(e){return Number(1==e?0:e%10>=2&&e%10<=4&&(e%100<10||e%100>=20)?1:2)},8:function(e){return Number(1==e?0:2==e?1:8!=e&&11!=e?2:3)},9:function(e){return Number(e>=2)},10:function(e){return Number(1==e?0:2==e?1:e<7?2:e<11?3:4)},11:function(e){return Number(1==e||11==e?0:2==e||12==e?1:e>2&&e<20?2:3)},12:function(e){return Number(e%10!=1||e%100==11)},13:function(e){return Number(0!==e)},14:function(e){return Number(1==e?0:2==e?1:3==e?2:3)},15:function(e){return Number(e%10==1&&e%100!=11?0:e%10>=2&&(e%100<10||e%100>=20)?1:2)},16:function(e){return Number(e%10==1&&e%100!=11?0:0!==e?1:2)},17:function(e){return Number(1==e||e%10==1&&e%100!=11?0:1)},18:function(e){return Number(0==e?0:1==e?1:2)},19:function(e){return Number(1==e?0:0==e||e%100>1&&e%100<11?1:e%100>10&&e%100<20?2:3)},20:function(e){return Number(1==e?0:0==e||e%100>0&&e%100<20?1:2)},21:function(e){return Number(e%100==1?1:e%100==2?2:e%100==3||e%100==4?3:0)},22:function(e){return Number(1==e?0:2==e?1:(e<0||e>10)&&e%10==0?2:3)}};const $0=["v1","v2","v3"],j0=["v4"],N0={zero:0,one:1,two:2,few:3,many:4,other:5};class P0{constructor(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.languageUtils=e,this.options=t,this.logger=i0.create("pluralResolver"),this.options.compatibilityJSON&&!j0.includes(this.options.compatibilityJSON)||"undefined"!=typeof Intl&&Intl.PluralRules||(this.options.compatibilityJSON="v3",this.logger.error("Your environment seems not to be Intl API compatible, use an Intl.PluralRules polyfill. Will fallback to the compatibilityJSON v3 format handling.")),this.rules=function(){const e={};return O0.forEach((t=>{t.lngs.forEach((n=>{e[n]={numbers:t.nr,plurals:D0[t.fc]}}))})),e}()}addRule(e,t){this.rules[e]=t}getRule(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(this.shouldUseIntlApi())try{return new Intl.PluralRules(y0(e),{type:t.ordinal?"ordinal":"cardinal"})}catch{return}return this.rules[e]||this.rules[this.languageUtils.getLanguagePartFromCode(e)]}needsPlural(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return this.shouldUseIntlApi()?n&&n.resolvedOptions().pluralCategories.length>1:n&&n.numbers.length>1}getPluralFormsOfKey(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return this.getSuffixes(e,n).map((e=>`${t}${e}`))}getSuffixes(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const n=this.getRule(e,t);return n?this.shouldUseIntlApi()?n.resolvedOptions().pluralCategories.sort(((e,t)=>N0[e]-N0[t])).map((e=>`${this.options.prepend}${t.ordinal?`ordinal${this.options.prepend}`:""}${e}`)):n.numbers.map((n=>this.getSuffix(e,n,t))):[]}getSuffix(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=this.getRule(e,n);return r?this.shouldUseIntlApi()?`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${r.select(t)}`:this.getSuffixRetroCompatible(r,t):(this.logger.warn(`no plural rule found for: ${e}`),"")}getSuffixRetroCompatible(e,t){const n=e.noAbs?e.plurals(t):e.plurals(Math.abs(t));let r=e.numbers[n];this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]&&(2===r?r="plural":1===r&&(r=""));const o=()=>this.options.prepend&&r.toString()?this.options.prepend+r.toString():r.toString();return"v1"===this.options.compatibilityJSON?1===r?"":"number"==typeof r?`_plural_${r.toString()}`:o():"v2"===this.options.compatibilityJSON||this.options.simplifyPluralSuffix&&2===e.numbers.length&&1===e.numbers[0]?o():this.options.prepend&&n.toString()?this.options.prepend+n.toString():n.toString()}shouldUseIntlApi(){return!$0.includes(this.options.compatibilityJSON)}}function _0(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:".",o=!(arguments.length>4&&void 0!==arguments[4])||arguments[4],a=function(e,t,n){const r=f0(e,n);return void 0!==r?r:f0(t,n)}(e,t,n);return!a&&o&&"string"==typeof n&&(a=v0(e,n,r),void 0===a&&(a=v0(t,n,r))),a}class I0{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i0.create("interpolator"),this.options=e,this.format=e.interpolation&&e.interpolation.format||(e=>e),this.init(e)}init(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};e.interpolation||(e.interpolation={escapeValue:!0});const t=e.interpolation;this.escape=void 0!==t.escape?t.escape:m0,this.escapeValue=void 0===t.escapeValue||t.escapeValue,this.useRawValueToEscape=void 0!==t.useRawValueToEscape&&t.useRawValueToEscape,this.prefix=t.prefix?h0(t.prefix):t.prefixEscaped||"{{",this.suffix=t.suffix?h0(t.suffix):t.suffixEscaped||"}}",this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||",",this.unescapePrefix=t.unescapeSuffix?"":t.unescapePrefix||"-",this.unescapeSuffix=this.unescapePrefix?"":t.unescapeSuffix||"",this.nestingPrefix=t.nestingPrefix?h0(t.nestingPrefix):t.nestingPrefixEscaped||h0("$t("),this.nestingSuffix=t.nestingSuffix?h0(t.nestingSuffix):t.nestingSuffixEscaped||h0(")"),this.nestingOptionsSeparator=t.nestingOptionsSeparator?t.nestingOptionsSeparator:t.nestingOptionsSeparator||",",this.maxReplaces=t.maxReplaces?t.maxReplaces:1e3,this.alwaysFormat=void 0!==t.alwaysFormat&&t.alwaysFormat,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=`${this.prefix}(.+?)${this.suffix}`;this.regexp=new RegExp(e,"g");const t=`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`;this.regexpUnescape=new RegExp(t,"g");const n=`${this.nestingPrefix}(.+?)${this.nestingSuffix}`;this.nestingRegexp=new RegExp(n,"g")}interpolate(e,t,n,r){let o,a,i;const s=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{};function l(e){return e.replace(/\$/g,"$$$$")}const c=e=>{if(e.indexOf(this.formatSeparator)<0){const o=_0(t,s,e,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(o,void 0,n,{...r,...t,interpolationkey:e}):o}const o=e.split(this.formatSeparator),a=o.shift().trim(),i=o.join(this.formatSeparator).trim();return this.format(_0(t,s,a,this.options.keySeparator,this.options.ignoreJSONStructure),i,n,{...r,...t,interpolationkey:a})};this.resetRegExp();const u=r&&r.missingInterpolationHandler||this.options.missingInterpolationHandler,d=r&&r.interpolation&&void 0!==r.interpolation.skipOnVariables?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:e=>l(e)},{regex:this.regexp,safeValue:e=>this.escapeValue?l(this.escape(e)):l(e)}].forEach((t=>{for(i=0;o=t.regex.exec(e);){const n=o[1].trim();if(a=c(n),void 0===a)if("function"==typeof u){const t=u(e,o,r);a="string"==typeof t?t:""}else if(r&&Object.prototype.hasOwnProperty.call(r,n))a="";else{if(d){a=o[0];continue}this.logger.warn(`missed to pass in variable ${n} for interpolating ${e}`),a=""}else"string"==typeof a||this.useRawValueToEscape||(a=c0(a));const s=t.safeValue(a);if(e=e.replace(o[0],s),d?(t.regex.lastIndex+=a.length,t.regex.lastIndex-=o[0].length):t.regex.lastIndex=0,i++,i>=this.maxReplaces)break}})),e}nest(e,t){let n,r,o,a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};function i(e,t){const n=this.nestingOptionsSeparator;if(e.indexOf(n)<0)return e;const r=e.split(new RegExp(`${n}[ ]*{`));let a=`{${r[1]}`;e=r[0],a=this.interpolate(a,o);const i=a.match(/'/g),s=a.match(/"/g);(i&&i.length%2==0&&!s||s.length%2!=0)&&(a=a.replace(/'/g,'"'));try{o=JSON.parse(a),t&&(o={...t,...o})}catch(A4){return this.logger.warn(`failed parsing options string in nesting for key ${e}`,A4),`${e}${n}${a}`}return delete o.defaultValue,e}for(;n=this.nestingRegexp.exec(e);){let s=[];o={...a},o=o.replace&&"string"!=typeof o.replace?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;let l=!1;if(-1!==n[0].indexOf(this.formatSeparator)&&!/{.*}/.test(n[1])){const e=n[1].split(this.formatSeparator).map((e=>e.trim()));n[1]=e.shift(),s=e,l=!0}if(r=t(i.call(this,n[1].trim(),o),o),r&&n[0]===e&&"string"!=typeof r)return r;"string"!=typeof r&&(r=c0(r)),r||(this.logger.warn(`missed to resolve ${n[1]} for nesting ${e}`),r=""),l&&(r=s.reduce(((e,t)=>this.format(e,t,a.lng,{...a,interpolationkey:n[1].trim()})),r.trim())),e=e.replace(n[0],r),this.regexp.lastIndex=0}return e}}function T0(e){const t={};return function(n,r,o){const a=r+JSON.stringify(o);let i=t[a];return i||(i=e(y0(r),o),t[a]=i),i(n)}}class F0{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.logger=i0.create("formatter"),this.options=e,this.formats={number:T0(((e,t)=>{const n=new Intl.NumberFormat(e,{...t});return e=>n.format(e)})),currency:T0(((e,t)=>{const n=new Intl.NumberFormat(e,{...t,style:"currency"});return e=>n.format(e)})),datetime:T0(((e,t)=>{const n=new Intl.DateTimeFormat(e,{...t});return e=>n.format(e)})),relativetime:T0(((e,t)=>{const n=new Intl.RelativeTimeFormat(e,{...t});return e=>n.format(e,t.range||"day")})),list:T0(((e,t)=>{const n=new Intl.ListFormat(e,{...t});return e=>n.format(e)}))},this.init(e)}init(e){const t=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{interpolation:{}}).interpolation;this.formatSeparator=t.formatSeparator?t.formatSeparator:t.formatSeparator||","}add(e,t){this.formats[e.toLowerCase().trim()]=t}addCached(e,t){this.formats[e.toLowerCase().trim()]=T0(t)}format(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};return t.split(this.formatSeparator).reduce(((e,t)=>{const{formatName:o,formatOptions:a}=function(e){let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const o=r[1].substring(0,r[1].length-1);"currency"===t&&o.indexOf(":")<0?n.currency||(n.currency=o.trim()):"relativetime"===t&&o.indexOf(":")<0?n.range||(n.range=o.trim()):o.split(";").forEach((e=>{if(!e)return;const[t,...r]=e.split(":"),o=r.join(":").trim().replace(/^'+|'+$/g,"");n[t.trim()]||(n[t.trim()]=o),"false"===o&&(n[t.trim()]=!1),"true"===o&&(n[t.trim()]=!0),isNaN(o)||(n[t.trim()]=parseInt(o,10))}))}return{formatName:t,formatOptions:n}}(t);if(this.formats[o]){let t=e;try{const i=r&&r.formatParams&&r.formatParams[r.interpolationkey]||{},s=i.locale||i.lng||r.locale||r.lng||n;t=this.formats[o](e,s,{...a,...r,...i})}catch(i){this.logger.warn(i)}return t}return this.logger.warn(`there was no format function for ${o}`),e}),e)}}class R0 extends s0{constructor(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};super(),this.backend=e,this.store=t,this.services=n,this.languageUtils=n.languageUtils,this.options=r,this.logger=i0.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=r.maxParallelReads||10,this.readingCalls=0,this.maxRetries=r.maxRetries>=0?r.maxRetries:5,this.retryTimeout=r.retryTimeout>=1?r.retryTimeout:350,this.state={},this.queue=[],this.backend&&this.backend.init&&this.backend.init(n,r.backend,r)}queueLoad(e,t,n,r){const o={},a={},i={},s={};return e.forEach((e=>{let r=!0;t.forEach((t=>{const i=`${e}|${t}`;!n.reload&&this.store.hasResourceBundle(e,t)?this.state[i]=2:this.state[i]<0||(1===this.state[i]?void 0===a[i]&&(a[i]=!0):(this.state[i]=1,r=!1,void 0===a[i]&&(a[i]=!0),void 0===o[i]&&(o[i]=!0),void 0===s[t]&&(s[t]=!0)))})),r||(i[e]=!0)})),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:r}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(i),toLoadNamespaces:Object.keys(s)}}loaded(e,t,n){const r=e.split("|"),o=r[0],a=r[1];t&&this.emit("failedLoading",o,a,t),n&&this.store.addResourceBundle(o,a,n),this.state[e]=t?-1:2;const i={};this.queue.forEach((n=>{!function(e,t,n,r){const{obj:o,k:a}=u0(e,t,Object);o[a]=o[a]||[],r&&(o[a]=o[a].concat(n)),r||o[a].push(n)}(n.loaded,[o],a),function(e,t){void 0!==e.pending[t]&&(delete e.pending[t],e.pendingCount--)}(n,e),t&&n.errors.push(t),0!==n.pendingCount||n.done||(Object.keys(n.loaded).forEach((e=>{i[e]||(i[e]={});const t=n.loaded[e];t.length&&t.forEach((t=>{void 0===i[e][t]&&(i[e][t]=!0)}))})),n.done=!0,n.errors.length?n.callback(n.errors):n.callback())})),this.emit("loaded",i),this.queue=this.queue.filter((e=>!e.done))}read(e,t,n){let r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0,o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:this.retryTimeout,a=arguments.length>5?arguments[5]:void 0;if(!e.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads)return void this.waitingReads.push({lng:e,ns:t,fcName:n,tried:r,wait:o,callback:a});this.readingCalls++;const i=(i,s)=>{if(this.readingCalls--,this.waitingReads.length>0){const e=this.waitingReads.shift();this.read(e.lng,e.ns,e.fcName,e.tried,e.wait,e.callback)}i&&s&&r{this.read.call(this,e,t,n,r+1,2*o,a)}),o):a(i,s)},s=this.backend[n].bind(this.backend);if(2!==s.length)return s(e,t,i);try{const n=s(e,t);n&&"function"==typeof n.then?n.then((e=>i(null,e))).catch(i):i(null,n)}catch(l){i(l)}}prepareLoading(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=arguments.length>3?arguments[3]:void 0;if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),r&&r();"string"==typeof e&&(e=this.languageUtils.toResolveHierarchy(e)),"string"==typeof t&&(t=[t]);const o=this.queueLoad(e,t,n,r);if(!o.toLoad.length)return o.pending.length||r(),null;o.toLoad.forEach((e=>{this.loadOne(e)}))}load(e,t,n){this.prepareLoading(e,t,{},n)}reload(e,t,n){this.prepareLoading(e,t,{reload:!0},n)}loadOne(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";const n=e.split("|"),r=n[0],o=n[1];this.read(r,o,"read",void 0,void 0,((n,a)=>{n&&this.logger.warn(`${t}loading namespace ${o} for language ${r} failed`,n),!n&&a&&this.logger.log(`${t}loaded namespace ${o} for language ${r}`,a),this.loaded(e,n,a)}))}saveMissing(e,t,n,r,o){let a=arguments.length>5&&void 0!==arguments[5]?arguments[5]:{},i=arguments.length>6&&void 0!==arguments[6]?arguments[6]:()=>{};if(this.services.utils&&this.services.utils.hasLoadedNamespace&&!this.services.utils.hasLoadedNamespace(t))this.logger.warn(`did not save key "${n}" as the namespace "${t}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");else if(null!=n&&""!==n){if(this.backend&&this.backend.create){const l={...a,isUpdate:o},c=this.backend.create.bind(this.backend);if(c.length<6)try{let o;o=5===c.length?c(e,t,n,r,l):c(e,t,n,r),o&&"function"==typeof o.then?o.then((e=>i(null,e))).catch(i):i(null,o)}catch(s){i(s)}else c(e,t,n,r,i,l)}e&&e[0]&&this.store.addResource(e[0],t,n,r)}}}function A0(){return{debug:!1,initImmediate:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:function(e){let t={};if("object"==typeof e[1]&&(t=e[1]),"string"==typeof e[1]&&(t.defaultValue=e[1]),"string"==typeof e[2]&&(t.tDescription=e[2]),"object"==typeof e[2]||"object"==typeof e[3]){const n=e[3]||e[2];Object.keys(n).forEach((e=>{t[e]=n[e]}))}return t},interpolation:{escapeValue:!0,format:(e,t,n,r)=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0}}}function M0(e){return"string"==typeof e.ns&&(e.ns=[e.ns]),"string"==typeof e.fallbackLng&&(e.fallbackLng=[e.fallbackLng]),"string"==typeof e.fallbackNS&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs&&e.supportedLngs.indexOf("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),e}function L0(){}class B0 extends s0{constructor(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;var n;if(super(),this.options=M0(e),this.services={},this.logger=i0,this.modules={external:[]},n=this,Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach((e=>{"function"==typeof n[e]&&(n[e]=n[e].bind(n))})),t&&!this.isInitialized&&!e.isClone){if(!this.options.initImmediate)return this.init(e,t),this;setTimeout((()=>{this.init(e,t)}),0)}}init(){var e=this;let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=arguments.length>1?arguments[1]:void 0;"function"==typeof t&&(n=t,t={}),!t.defaultNS&&!1!==t.defaultNS&&t.ns&&("string"==typeof t.ns?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=A0();function o(e){return e?"function"==typeof e?new e:e:null}if(this.options={...r,...this.options,...M0(t)},"v1"!==this.options.compatibilityAPI&&(this.options.interpolation={...r.interpolation,...this.options.interpolation}),void 0!==t.keySeparator&&(this.options.userDefinedKeySeparator=t.keySeparator),void 0!==t.nsSeparator&&(this.options.userDefinedNsSeparator=t.nsSeparator),!this.options.isClone){let t;this.modules.logger?i0.init(o(this.modules.logger),this.options):i0.init(null,this.options),this.modules.formatter?t=this.modules.formatter:"undefined"!=typeof Intl&&(t=F0);const n=new E0(this.options);this.store=new w0(this.options.resources,this.options);const a=this.services;a.logger=i0,a.resourceStore=this.store,a.languageUtils=n,a.pluralResolver=new P0(n,{prepend:this.options.pluralSeparator,compatibilityJSON:this.options.compatibilityJSON,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),!t||this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format||(a.formatter=o(t),a.formatter.init(a,this.options),this.options.interpolation.format=a.formatter.format.bind(a.formatter)),a.interpolator=new I0(this.options),a.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},a.backendConnector=new R0(o(this.modules.backend),a.resourceStore,a,this.options),a.backendConnector.on("*",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o1?n-1:0),o=1;o{e.init&&e.init(this)}))}if(this.format=this.options.interpolation.format,n||(n=L0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const e=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);e.length>0&&"dev"!==e[0]&&(this.options.lng=e[0])}this.services.languageDetector||this.options.lng||this.logger.warn("init: no languageDetector is used and no lng is defined");["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach((t=>{this[t]=function(){return e.store[t](...arguments)}}));["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach((t=>{this[t]=function(){return e.store[t](...arguments),e}}));const a=l0(),i=()=>{const e=(e,t)=>{this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(t),n(e,t)};if(this.languages&&"v1"!==this.options.compatibilityAPI&&!this.isInitialized)return e(null,this.t.bind(this));this.changeLanguage(this.options.lng,e)};return this.options.resources||!this.options.initImmediate?i():setTimeout(i,0),a}loadResources(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L0;const n="string"==typeof e?e:this.language;if("function"==typeof e&&(t=e),!this.options.resources||this.options.partialBundledLanguages){if(n&&"cimode"===n.toLowerCase()&&(!this.options.preload||0===this.options.preload.length))return t();const e=[],r=t=>{if(!t)return;if("cimode"===t)return;this.services.languageUtils.toResolveHierarchy(t).forEach((t=>{"cimode"!==t&&e.indexOf(t)<0&&e.push(t)}))};if(n)r(n);else{this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach((e=>r(e)))}this.options.preload&&this.options.preload.forEach((e=>r(e))),this.services.backendConnector.load(e,this.options.ns,(e=>{e||this.resolvedLanguage||!this.language||this.setResolvedLanguage(this.language),t(e)}))}else t(null)}reloadResources(e,t,n){const r=l0();return e||(e=this.languages),t||(t=this.options.ns),n||(n=L0),this.services.backendConnector.reload(e,t,(e=>{r.resolve(),n(e)})),r}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return"backend"===e.type&&(this.modules.backend=e),("logger"===e.type||e.log&&e.warn&&e.error)&&(this.modules.logger=e),"languageDetector"===e.type&&(this.modules.languageDetector=e),"i18nFormat"===e.type&&(this.modules.i18nFormat=e),"postProcessor"===e.type&&x0.addPostProcessor(e),"formatter"===e.type&&(this.modules.formatter=e),"3rdParty"===e.type&&this.modules.external.push(e),this}setResolvedLanguage(e){if(e&&this.languages&&!(["cimode","dev"].indexOf(e)>-1))for(let t=0;t-1)&&this.store.hasLanguageSomeTranslations(e)){this.resolvedLanguage=e;break}}}changeLanguage(e,t){var n=this;this.isLanguageChangingTo=e;const r=l0();this.emit("languageChanging",e);const o=e=>{this.language=e,this.languages=this.services.languageUtils.toResolveHierarchy(e),this.resolvedLanguage=void 0,this.setResolvedLanguage(e)},a=(e,a)=>{a?(o(a),this.translator.changeLanguage(a),this.isLanguageChangingTo=void 0,this.emit("languageChanged",a),this.logger.log("languageChanged",a)):this.isLanguageChangingTo=void 0,r.resolve((function(){return n.t(...arguments)})),t&&t(e,(function(){return n.t(...arguments)}))},i=t=>{e||t||!this.services.languageDetector||(t=[]);const n="string"==typeof t?t:this.services.languageUtils.getBestMatchFromCodes(t);n&&(this.language||o(n),this.translator.language||this.translator.changeLanguage(n),this.services.languageDetector&&this.services.languageDetector.cacheUserLanguage&&this.services.languageDetector.cacheUserLanguage(n)),this.loadResources(n,(e=>{a(e,n)}))};return e||!this.services.languageDetector||this.services.languageDetector.async?!e&&this.services.languageDetector&&this.services.languageDetector.async?0===this.services.languageDetector.detect.length?this.services.languageDetector.detect().then(i):this.services.languageDetector.detect(i):i(e):i(this.services.languageDetector.detect()),r}getFixedT(e,t,n){var r=this;const o=function(e,t){let a;if("object"!=typeof t){for(var i=arguments.length,s=new Array(i>2?i-2:0),l=2;l`${a.keyPrefix}${c}${e}`)):a.keyPrefix?`${a.keyPrefix}${c}${e}`:e,r.t(u,a)};return"string"==typeof e?o.lng=e:o.lngs=e,o.ns=t,o.keyPrefix=n,o}t(){return this.translator&&this.translator.translate(...arguments)}exists(){return this.translator&&this.translator.exists(...arguments)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const n=t.lng||this.resolvedLanguage||this.languages[0],r=!!this.options&&this.options.fallbackLng,o=this.languages[this.languages.length-1];if("cimode"===n.toLowerCase())return!0;const a=(e,t)=>{const n=this.services.backendConnector.state[`${e}|${t}`];return-1===n||2===n};if(t.precheck){const e=t.precheck(this,a);if(void 0!==e)return e}return!!this.hasResourceBundle(n,e)||(!(this.services.backendConnector.backend&&(!this.options.resources||this.options.partialBundledLanguages))||!(!a(n,e)||r&&!a(o,e)))}loadNamespaces(e,t){const n=l0();return this.options.ns?("string"==typeof e&&(e=[e]),e.forEach((e=>{this.options.ns.indexOf(e)<0&&this.options.ns.push(e)})),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}loadLanguages(e,t){const n=l0();"string"==typeof e&&(e=[e]);const r=this.options.preload||[],o=e.filter((e=>r.indexOf(e)<0));return o.length?(this.options.preload=r.concat(o),this.loadResources((e=>{n.resolve(),t&&t(e)})),n):(t&&t(),Promise.resolve())}dir(e){if(e||(e=this.resolvedLanguage||(this.languages&&this.languages.length>0?this.languages[0]:this.language)),!e)return"rtl";const t=this.services&&this.services.languageUtils||new E0(A0());return["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"].indexOf(t.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(){return new B0(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},arguments.length>1?arguments[1]:void 0)}cloneInstance(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:L0;const n=e.forkResourceStore;n&&delete e.forkResourceStore;const r={...this.options,...e,isClone:!0},o=new B0(r);void 0===e.debug&&void 0===e.prefix||(o.logger=o.logger.clone(e));return["store","services","language"].forEach((e=>{o[e]=this[e]})),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},n&&(o.store=new w0(this.store.data,r),o.services.resourceStore=o.store),o.translator=new k0(o.services,r),o.translator.on("*",(function(e){for(var t=arguments.length,n=new Array(t>1?t-1:0),r=1;r-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(e)||""===e)throw new TypeError('Invalid character in header field name: "'+e+'"');return e.toLowerCase()}function d(e){return"string"!=typeof e&&(e=String(e)),e}function f(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return o&&(t[Symbol.iterator]=function(){return t}),t}function p(e){this.map={},e instanceof p?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function h(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function g(e){return new Promise((function(t,n){e.onload=function(){t(e.result)},e.onerror=function(){n(e.error)}}))}function m(e){var t=new FileReader,n=g(t);return t.readAsArrayBuffer(e),n}function b(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function v(){return this.bodyUsed=!1,this._initBody=function(e){var t;this.bodyUsed=this.bodyUsed,this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:a&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:i&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:n&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&a&&(t=e)&&DataView.prototype.isPrototypeOf(t)?(this._bodyArrayBuffer=b(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=b(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):n&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},a&&(this.blob=function(){var e=h(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var e=h(this);return e||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(m)}),this.text=function(){var e,t,n,r=h(this);if(r)return r;if(this._bodyBlob)return e=this._bodyBlob,t=new FileReader,n=g(t),t.readAsText(e),n;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),n=new Array(t.length),r=0;r-1?r:n),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&o)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(o),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==t.cache&&"no-cache"!==t.cache)){var a=/([?&])_=[^&]*/;a.test(this.url)?this.url=this.url.replace(a,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function x(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}})),t}function S(e,t){if(!(this instanceof S))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText=void 0===t.statusText?"":""+t.statusText,this.headers=new p(t.headers),this.url=t.url||"",this._initBody(e)}w.prototype.clone=function(){return new w(this,{body:this._bodyInit})},v.call(w.prototype),v.call(S.prototype),S.prototype.clone=function(){return new S(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new p(this.headers),url:this.url})},S.error=function(){var e=new S(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];S.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new S(null,{status:t,headers:{location:e}})},e.DOMException=t.DOMException;try{new e.DOMException}catch(E){e.DOMException=function(e,t){this.message=e,this.name=t;var n=Error(e);this.stack=n.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function C(n,r){return new Promise((function(o,i){var l=new w(n,r);if(l.signal&&l.signal.aborted)return i(new e.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function u(){c.abort()}c.onload=function(){var e,t,n={status:c.status,statusText:c.statusText,headers:(e=c.getAllResponseHeaders()||"",t=new p,e.replace(/\r?\n[\t ]+/g," ").split("\r").map((function(e){return 0===e.indexOf("\n")?e.substr(1,e.length):e})).forEach((function(e){var n=e.split(":"),r=n.shift().trim();if(r){var o=n.join(":").trim();t.append(r,o)}})),t)};n.url="responseURL"in c?c.responseURL:n.headers.get("X-Request-URL");var r="response"in c?c.response:c.responseText;setTimeout((function(){o(new S(r,n))}),0)},c.onerror=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},c.ontimeout=function(){setTimeout((function(){i(new TypeError("Network request failed"))}),0)},c.onabort=function(){setTimeout((function(){i(new e.DOMException("Aborted","AbortError"))}),0)},c.open(l.method,function(e){try{return""===e&&t.location.href?t.location.href:e}catch(A4){return e}}(l.url),!0),"include"===l.credentials?c.withCredentials=!0:"omit"===l.credentials&&(c.withCredentials=!1),"responseType"in c&&(a?c.responseType="blob":s&&l.headers.get("Content-Type")&&-1!==l.headers.get("Content-Type").indexOf("application/octet-stream")&&(c.responseType="arraybuffer")),!r||"object"!=typeof r.headers||r.headers instanceof p?l.headers.forEach((function(e,t){c.setRequestHeader(t,e)})):Object.getOwnPropertyNames(r.headers).forEach((function(e){c.setRequestHeader(e,d(r.headers[e]))})),l.signal&&(l.signal.addEventListener("abort",u),c.onreadystatechange=function(){4===c.readyState&&l.signal.removeEventListener("abort",u)}),c.send(void 0===l._bodyInit?null:l._bodyInit)}))}C.polyfill=!0,t.fetch||(t.fetch=C,t.Headers=p,t.Request=w,t.Response=S),e.Headers=p,e.Request=w,e.Response=S,e.fetch=C}({}),a.fetch.ponyfill=!0,delete a.fetch.polyfill;var i=o.fetch?o:a;(n=i.fetch).default=i.fetch,n.fetch=i.fetch,n.Headers=i.Headers,n.Request=i.Request,n.Response=i.Response,e.exports=n}(Q0,Q0.exports)),Q0.exports}!function(e,n){var r;if("function"==typeof fetch&&(r=void 0!==t&&t.fetch?t.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),void 0!==X0&&("undefined"==typeof window||void 0===window.document)){var o=r||J0();o.default&&(o=o.default),n.default=o,e.exports=n.default}}(Y0,Y0.exports);var Z0=Y0.exports;const e1=n(Z0),t1=e({__proto__:null,default:e1},[Z0]);function n1(e){return(n1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r1,o1,a1;"function"==typeof fetch&&(r1="undefined"!=typeof global&&global.fetch?global.fetch:"undefined"!=typeof window&&window.fetch?window.fetch:fetch),q0()&&("undefined"!=typeof global&&global.XMLHttpRequest?o1=global.XMLHttpRequest:"undefined"!=typeof window&&window.XMLHttpRequest&&(o1=window.XMLHttpRequest)),"function"==typeof ActiveXObject&&("undefined"!=typeof global&&global.ActiveXObject?a1=global.ActiveXObject:"undefined"!=typeof window&&window.ActiveXObject&&(a1=window.ActiveXObject)),r1||!t1||o1||a1||(r1=e1||t1),"function"!=typeof r1&&(r1=void 0);var i1=function(e,t){if(t&&"object"===n1(t)){var n="";for(var r in t)n+="&"+encodeURIComponent(r)+"="+encodeURIComponent(t[r]);if(!n)return e;e=e+(-1!==e.indexOf("?")?"&":"?")+n.slice(1)}return e},s1=function(e,t,n){var r=function(e){if(!e.ok)return n(e.statusText||"Error",{status:e.status});e.text().then((function(t){n(null,{status:e.status,data:t})})).catch(n)};"function"==typeof fetch?fetch(e,t).then(r).catch(n):r1(e,t).then(r).catch(n)},l1=!1,c1=function(e,t,n,r){return"function"==typeof n&&(r=n,n=void 0),r=r||function(){},r1&&0!==t.indexOf("file:")?function(e,t,n,r){e.queryStringParams&&(t=i1(t,e.queryStringParams));var o=G0({},"function"==typeof e.customHeaders?e.customHeaders():e.customHeaders);"undefined"==typeof window&&"undefined"!=typeof global&&void 0!==global.process&&global.process.versions&&global.process.versions.node&&(o["User-Agent"]="i18next-http-backend (node/".concat(global.process.version,"; ").concat(global.process.platform," ").concat(global.process.arch,")")),n&&(o["Content-Type"]="application/json");var a="function"==typeof e.requestOptions?e.requestOptions(n):e.requestOptions,i=G0({method:n?"POST":"GET",body:n?e.stringify(n):void 0,headers:o},l1?{}:a);try{s1(t,i,r)}catch(A4){if(!a||0===Object.keys(a).length||!A4.message||A4.message.indexOf("not implemented")<0)return r(A4);try{Object.keys(a).forEach((function(e){delete i[e]})),s1(t,i,r),l1=!0}catch(s){r(s)}}}(e,t,n,r):q0()||"function"==typeof ActiveXObject?function(e,t,n,r){n&&"object"===n1(n)&&(n=i1("",n).slice(1)),e.queryStringParams&&(t=i1(t,e.queryStringParams));try{var o;(o=o1?new o1:new a1("MSXML2.XMLHTTP.3.0")).open(n?"POST":"GET",t,1),e.crossDomain||o.setRequestHeader("X-Requested-With","XMLHttpRequest"),o.withCredentials=!!e.withCredentials,n&&o.setRequestHeader("Content-Type","application/x-www-form-urlencoded"),o.overrideMimeType&&o.overrideMimeType("application/json");var a=e.customHeaders;if(a="function"==typeof a?a():a)for(var i in a)o.setRequestHeader(i,a[i]);o.onreadystatechange=function(){o.readyState>3&&r(o.status>=400?o.statusText:null,{status:o.status,data:o.responseText})},o.send(n)}catch(A4){console&&console.log(A4)}}(e,t,n,r):void r(new Error("No fetch and no xhr implementation found!"))};function u1(e){return(u1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function d1(e,t){for(var n=0;n1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.services=t,this.options=n,this.allOptions=r,this.type="backend",this.init(t,n,r)}var t,n,r;return t=e,n=[{key:"init",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};this.services=e,this.options=G0(n,this.options||{},p1()),this.allOptions=r,this.services&&this.options.reloadInterval&&setInterval((function(){return t.reload()}),this.options.reloadInterval)}},{key:"readMulti",value:function(e,t,n){this._readAny(e,e,t,t,n)}},{key:"read",value:function(e,t,n){this._readAny([e],e,[t],t,n)}},{key:"_readAny",value:function(e,t,n,r,o){var a,i=this,s=this.options.loadPath;"function"==typeof this.options.loadPath&&(s=this.options.loadPath(e,n)),(s=function(e){return!!e&&"function"==typeof e.then}(a=s)?a:Promise.resolve(a)).then((function(a){if(!a)return o(null,{});var s=i.services.interpolator.interpolate(a,{lng:e.join("+"),ns:n.join("+")});i.loadUrl(s,o,t,r)}))}},{key:"loadUrl",value:function(e,t,n,r){var o=this,a="string"==typeof n?[n]:n,i="string"==typeof r?[r]:r,s=this.options.parseLoadPayload(a,i);this.options.request(this.options,e,s,(function(a,i){if(i&&(i.status>=500&&i.status<600||!i.status))return t("failed loading "+e+"; status code: "+i.status,!0);if(i&&i.status>=400&&i.status<500)return t("failed loading "+e+"; status code: "+i.status,!1);if(!i&&a&&a.message&&a.message.indexOf("Failed to fetch")>-1)return t("failed loading "+e+": "+a.message,!0);if(a)return t(a,!1);var s,l;try{s="string"==typeof i.data?o.options.parse(i.data,n,r):i.data}catch(A4){l="failed parsing "+e+" to json"}if(l)return t(l,!1);t(null,s)}))}},{key:"create",value:function(e,t,n,r,o){var a=this;if(this.options.addPath){"string"==typeof e&&(e=[e]);var i=this.options.parsePayload(t,n,r),s=0,l=[],c=[];e.forEach((function(n){var r=a.options.addPath;"function"==typeof a.options.addPath&&(r=a.options.addPath(n,t));var u=a.services.interpolator.interpolate(r,{lng:n,ns:t});a.options.request(a.options,u,i,(function(t,n){s+=1,l.push(t),c.push(n),s===e.length&&"function"==typeof o&&o(l,c)}))}))}}},{key:"reload",value:function(){var e=this,t=this.services,n=t.backendConnector,r=t.languageUtils,o=t.logger,a=n.language;if(!a||"cimode"!==a.toLowerCase()){var i=[],s=function(e){r.toResolveHierarchy(e).forEach((function(e){i.indexOf(e)<0&&i.push(e)}))};s(a),this.allOptions.preload&&this.allOptions.preload.forEach((function(e){return s(e)})),i.forEach((function(t){e.allOptions.ns.forEach((function(e){n.read(t,e,"read",null,null,(function(r,a){r&&o.warn("loading namespace ".concat(e," for language ").concat(t," failed"),r),!r&&a&&o.log("loaded namespace ".concat(e," for language ").concat(t),a),n.loaded("".concat(t,"|").concat(e),r,a)}))}))}))}}}],n&&d1(t.prototype,n),r&&d1(t,r),Object.defineProperty(t,"prototype",{writable:!1}),e}();h1.type="backend";const g1={};function m1(){for(var e=arguments.length,t=new Array(e),n=0;n()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout((()=>{e.off("initialized",n)}),0),t()};e.on("initialized",n)}};function v1(e,t,n){e.loadNamespaces(t,b1(e,n))}function y1(e,t,n,r){"string"==typeof n&&(n=[n]),n.forEach((t=>{e.options.ns.indexOf(t)<0&&e.options.ns.push(t)})),e.loadLanguages(t,b1(e,r))}const w1=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,x1={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},S1=e=>x1[e];let k1,C1={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:e=>e.replace(w1,S1)};const E1={type:"3rdParty",init(e){!function(){let e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};C1={...C1,...e}}(e.options.react),function(e){k1=e}(e)}},O1=z.createContext();class D1{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach((e=>{this.usedNamespaces[e]||(this.usedNamespaces[e]=!0)}))}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}function $1(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};const{i18n:n}=t,{i18n:r,defaultNS:o}=z.useContext(O1)||{},a=n||r||k1;if(a&&!a.reportNamespaces&&(a.reportNamespaces=new D1),!a){m1("You will need to pass in an i18next instance by using initReactI18next");const e=(e,t)=>"string"==typeof t?t:t&&"object"==typeof t&&"string"==typeof t.defaultValue?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,t=[e,{},!1];return t.t=e,t.i18n={},t.ready=!1,t}a.options.react&&void 0!==a.options.react.wait&&m1("It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const i={...C1,...a.options.react,...t},{useSuspense:s,keyPrefix:l}=i;let c=e||o||a.options&&a.options.defaultNS;c="string"==typeof c?[c]:c||["translation"],a.reportNamespaces.addUsedNamespaces&&a.reportNamespaces.addUsedNamespaces(c);const u=(a.isInitialized||a.initializedStoreOnce)&&c.every((e=>function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return t.languages&&t.languages.length?void 0!==t.options.ignoreJSONStructure?t.hasLoadedNamespace(e,{lng:n.lng,precheck:(t,r)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!r(t.isLanguageChangingTo,e))return!1}}):function(e,t){let n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};const r=t.languages[0],o=!!t.options&&t.options.fallbackLng,a=t.languages[t.languages.length-1];if("cimode"===r.toLowerCase())return!0;const i=(e,n)=>{const r=t.services.backendConnector.state[`${e}|${n}`];return-1===r||2===r};return!(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&t.services.backendConnector.backend&&t.isLanguageChangingTo&&!i(t.isLanguageChangingTo,e)||!t.hasResourceBundle(r,e)&&t.services.backendConnector.backend&&(!t.options.resources||t.options.partialBundledLanguages)&&(!i(r,e)||o&&!i(a,e)))}(e,t,n):(m1("i18n.languages were undefined or empty",t.languages),!0)}(e,a,i)));function d(){return a.getFixedT(t.lng||null,"fallback"===i.nsMode?c:c[0],l)}const[f,p]=z.useState(d);let h=c.join();t.lng&&(h=`${t.lng}${h}`);const g=((e,t)=>{const n=z.useRef();return z.useEffect((()=>{n.current=t?n.current:e}),[e,t]),n.current})(h),m=z.useRef(!0);z.useEffect((()=>{const{bindI18n:e,bindI18nStore:n}=i;function r(){m.current&&p(d)}return m.current=!0,u||s||(t.lng?y1(a,t.lng,c,(()=>{m.current&&p(d)})):v1(a,c,(()=>{m.current&&p(d)}))),u&&g&&g!==h&&m.current&&p(d),e&&a&&a.on(e,r),n&&a&&a.store.on(n,r),()=>{m.current=!1,e&&a&&e.split(" ").forEach((e=>a.off(e,r))),n&&a&&n.split(" ").forEach((e=>a.store.off(e,r)))}}),[a,h]);const b=z.useRef(!0);z.useEffect((()=>{m.current&&!b.current&&p(d),b.current=!1}),[a,l]);const v=[f,a,u];if(v.t=f,v.i18n=a,v.ready=u,u)return v;if(!u&&!s)return v;throw new Promise((e=>{t.lng?y1(a,t.lng,c,(()=>e())):v1(a,c,(()=>e()))}))}var j1={BASE_URL:"/dev",MODE:"production",DEV:!1,PROD:!0,SSR:!1};const N1=new Map,P1=e=>{const t=N1.get(e);return t?Object.fromEntries(Object.entries(t.stores).map((([e,t])=>[e,t.getState()]))):{}},_1=(e,t={})=>(n,r,o)=>{const{enabled:a,anonymousActionType:i,store:s,...l}=t;let c;try{c=(null!=a?a:"production"!==(j1?"production":void 0))&&window.__REDUX_DEVTOOLS_EXTENSION__}catch(A4){}if(!c)return"production"!==(j1?"production":void 0)&&a&&console.warn("[zustand devtools middleware] Please install/enable Redux devtools extension"),e(n,r,o);const{connection:u,...d}=((e,t,n)=>{if(void 0===e)return{type:"untracked",connection:t.connect(n)};const r=N1.get(n.name);if(r)return{type:"tracked",store:e,...r};const o={connection:t.connect(n),stores:{}};return N1.set(n.name,o),{type:"tracked",store:e,...o}})(s,c,l);let f=!0;o.setState=(e,t,a)=>{const c=n(e,t);if(!f)return c;const d=void 0===a?{type:i||"anonymous"}:"string"==typeof a?{type:a}:a;return void 0===s?(null==u||u.send(d,r()),c):(null==u||u.send({...d,type:`${s}/${d.type}`},{...P1(l.name),[s]:o.getState()}),c)};const p=(...e)=>{const t=f;f=!1,n(...e),f=t},h=e(o.setState,r,o);if("untracked"===d.type?null==u||u.init(h):(d.stores[d.store]=o,null==u||u.init(Object.fromEntries(Object.entries(d.stores).map((([e,t])=>[e,e===d.store?h:t.getState()]))))),o.dispatchFromDevtools&&"function"==typeof o.dispatch){let e=!1;const t=o.dispatch;o.dispatch=(...n)=>{"production"===(j1?"production":void 0)||"__setState"!==n[0].type||e||(console.warn('[zustand devtools middleware] "__setState" action type is reserved to set state from the devtools. Avoid using it.'),e=!0),t(...n)}}return u.subscribe((e=>{var t;switch(e.type){case"ACTION":return"string"!=typeof e.payload?void console.error("[zustand devtools middleware] Unsupported action format"):I1(e.payload,(e=>{if("__setState"!==e.type)o.dispatchFromDevtools&&"function"==typeof o.dispatch&&o.dispatch(e);else{if(void 0===s)return void p(e.state);1!==Object.keys(e.state).length&&console.error('\n [zustand devtools middleware] Unsupported __setState action format. \n When using \'store\' option in devtools(), the \'state\' should have only one key, which is a value of \'store\' that was passed in devtools(),\n and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }\n ');const t=e.state[s];if(null==t)return;JSON.stringify(o.getState())!==JSON.stringify(t)&&p(t)}}));case"DISPATCH":switch(e.payload.type){case"RESET":return p(h),void 0===s?null==u?void 0:u.init(o.getState()):null==u?void 0:u.init(P1(l.name));case"COMMIT":return void 0===s?void(null==u||u.init(o.getState())):null==u?void 0:u.init(P1(l.name));case"ROLLBACK":return I1(e.state,(e=>{if(void 0===s)return p(e),void(null==u||u.init(o.getState()));p(e[s]),null==u||u.init(P1(l.name))}));case"JUMP_TO_STATE":case"JUMP_TO_ACTION":return I1(e.state,(e=>{void 0!==s?JSON.stringify(o.getState())!==JSON.stringify(e[s])&&p(e[s]):p(e)}));case"IMPORT_STATE":{const{nextLiftedState:n}=e.payload,r=null==(t=n.computedStates.slice(-1)[0])?void 0:t.state;if(!r)return;return p(void 0===s?r:r[s]),void(null==u||u.send(null,n))}case"PAUSE_RECORDING":return f=!f}return}})),h},I1=(e,t)=>{let n;try{n=JSON.parse(e)}catch(A4){console.error("[zustand devtools middleware] Could not parse the received json",A4)}void 0!==n&&t(n)};function T1(e,t){if(Object.is(e,t))return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[n,r]of e)if(!Object.is(r,t.get(n)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(let r=0;r{let t;const n=new Set,r=(e,r)=>{const o="function"==typeof e?e(t):e;if(!Object.is(o,t)){const e=t;t=(null!=r?r:"object"!=typeof o)?o:Object.assign({},t,o),n.forEach((n=>n(t,e)))}},o=()=>t,a={setState:r,getState:o,subscribe:e=>(n.add(e),()=>n.delete(e)),destroy:()=>{"production"!==(G1?"production":void 0)&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}};return t=e(r,o,a),a},{useDebugValue:X1}=H,{useSyncExternalStoreWithSelector:K1}=V1;const Y1=(e,t)=>{const n=(e=>e?q1(e):q1)(e),r=(e,r=t)=>function(e,t=e.getState,n){const r=K1(e.subscribe,e.getState,e.getServerState||e.getState,t,n);return X1(r),r}(n,e,r);return Object.assign(r,n),r},Q1=(e,t)=>e?Y1(e,t):Y1;var J1={exports:{}};var Z1={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:16,MAX_SAFE_BUILD_LENGTH:250,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,RELEASE_TYPES:["major","premajor","minor","preminor","patch","prepatch","prerelease"],SEMVER_SPEC_VERSION:"2.0.0",FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2},e2={};var t2="object"==typeof process&&e2&&e2.NODE_DEBUG&&/\bsemver\b/i.test(e2.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};!function(e,t){const{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:r,MAX_LENGTH:o}=Z1,a=t2,i=(t=e.exports={}).re=[],s=t.safeRe=[],l=t.src=[],c=t.t={};let u=0;const d="[a-zA-Z0-9-]",f=[["\\s",1],["\\d",o],[d,r]],p=(e,t,n)=>{const r=(e=>{for(const[t,n]of f)e=e.split(`${t}*`).join(`${t}{0,${n}}`).split(`${t}+`).join(`${t}{1,${n}}`);return e})(t),o=u++;a(e,o,t),c[e]=o,l[o]=t,i[o]=new RegExp(t,n?"g":void 0),s[o]=new RegExp(r,n?"g":void 0)};p("NUMERICIDENTIFIER","0|[1-9]\\d*"),p("NUMERICIDENTIFIERLOOSE","\\d+"),p("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${d}*`),p("MAINVERSION",`(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})\\.(${l[c.NUMERICIDENTIFIER]})`),p("MAINVERSIONLOOSE",`(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})\\.(${l[c.NUMERICIDENTIFIERLOOSE]})`),p("PRERELEASEIDENTIFIER",`(?:${l[c.NUMERICIDENTIFIER]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASEIDENTIFIERLOOSE",`(?:${l[c.NUMERICIDENTIFIERLOOSE]}|${l[c.NONNUMERICIDENTIFIER]})`),p("PRERELEASE",`(?:-(${l[c.PRERELEASEIDENTIFIER]}(?:\\.${l[c.PRERELEASEIDENTIFIER]})*))`),p("PRERELEASELOOSE",`(?:-?(${l[c.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${l[c.PRERELEASEIDENTIFIERLOOSE]})*))`),p("BUILDIDENTIFIER",`${d}+`),p("BUILD",`(?:\\+(${l[c.BUILDIDENTIFIER]}(?:\\.${l[c.BUILDIDENTIFIER]})*))`),p("FULLPLAIN",`v?${l[c.MAINVERSION]}${l[c.PRERELEASE]}?${l[c.BUILD]}?`),p("FULL",`^${l[c.FULLPLAIN]}$`),p("LOOSEPLAIN",`[v=\\s]*${l[c.MAINVERSIONLOOSE]}${l[c.PRERELEASELOOSE]}?${l[c.BUILD]}?`),p("LOOSE",`^${l[c.LOOSEPLAIN]}$`),p("GTLT","((?:<|>)?=?)"),p("XRANGEIDENTIFIERLOOSE",`${l[c.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),p("XRANGEIDENTIFIER",`${l[c.NUMERICIDENTIFIER]}|x|X|\\*`),p("XRANGEPLAIN",`[v=\\s]*(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:\\.(${l[c.XRANGEIDENTIFIER]})(?:${l[c.PRERELEASE]})?${l[c.BUILD]}?)?)?`),p("XRANGEPLAINLOOSE",`[v=\\s]*(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:\\.(${l[c.XRANGEIDENTIFIERLOOSE]})(?:${l[c.PRERELEASELOOSE]})?${l[c.BUILD]}?)?)?`),p("XRANGE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAIN]}$`),p("XRANGELOOSE",`^${l[c.GTLT]}\\s*${l[c.XRANGEPLAINLOOSE]}$`),p("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),p("COERCERTL",l[c.COERCE],!0),p("LONETILDE","(?:~>?)"),p("TILDETRIM",`(\\s*)${l[c.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",p("TILDE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAIN]}$`),p("TILDELOOSE",`^${l[c.LONETILDE]}${l[c.XRANGEPLAINLOOSE]}$`),p("LONECARET","(?:\\^)"),p("CARETTRIM",`(\\s*)${l[c.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",p("CARET",`^${l[c.LONECARET]}${l[c.XRANGEPLAIN]}$`),p("CARETLOOSE",`^${l[c.LONECARET]}${l[c.XRANGEPLAINLOOSE]}$`),p("COMPARATORLOOSE",`^${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]})$|^$`),p("COMPARATOR",`^${l[c.GTLT]}\\s*(${l[c.FULLPLAIN]})$|^$`),p("COMPARATORTRIM",`(\\s*)${l[c.GTLT]}\\s*(${l[c.LOOSEPLAIN]}|${l[c.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",p("HYPHENRANGE",`^\\s*(${l[c.XRANGEPLAIN]})\\s+-\\s+(${l[c.XRANGEPLAIN]})\\s*$`),p("HYPHENRANGELOOSE",`^\\s*(${l[c.XRANGEPLAINLOOSE]})\\s+-\\s+(${l[c.XRANGEPLAINLOOSE]})\\s*$`),p("STAR","(<|>)?=?\\s*\\*"),p("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),p("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")}(J1,J1.exports);var n2=J1.exports;const r2=Object.freeze({loose:!0}),o2=Object.freeze({});var a2=e=>e?"object"!=typeof e?r2:e:o2;const i2=/^[0-9]+$/,s2=(e,t)=>{const n=i2.test(e),r=i2.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:es2(t,e)};const c2=t2,{MAX_LENGTH:u2,MAX_SAFE_INTEGER:d2}=Z1,{safeRe:f2,t:p2}=n2,h2=a2,{compareIdentifiers:g2}=l2;var m2=class e{constructor(t,n){if(n=h2(n),t instanceof e){if(t.loose===!!n.loose&&t.includePrerelease===!!n.includePrerelease)return t;t=t.version}else if("string"!=typeof t)throw new TypeError(`Invalid version. Must be a string. Got type "${typeof t}".`);if(t.length>u2)throw new TypeError(`version is longer than ${u2} characters`);c2("SemVer",t,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;const r=t.trim().match(n.loose?f2[p2.LOOSE]:f2[p2.FULL]);if(!r)throw new TypeError(`Invalid Version: ${t}`);if(this.raw=t,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>d2||this.major<0)throw new TypeError("Invalid major version");if(this.minor>d2||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>d2||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){const t=+e;if(t>=0&&t=0;)"number"==typeof this.prerelease[r]&&(this.prerelease[r]++,r=-2);if(-1===r){if(t===this.prerelease.join(".")&&!1===n)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let r=[t,e];!1===n&&(r=[t]),0===g2(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=r):this.prerelease=r}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};const b2=m2;var v2=(e,t,n=!1)=>{if(e instanceof b2)return e;try{return new b2(e,t)}catch(r){if(!n)return null;throw r}};const y2=v2;var w2=(e,t)=>{const n=y2(e,t);return n?n.version:null};const x2=v2;var S2=(e,t)=>{const n=x2(e.trim().replace(/^[=v]+/,""),t);return n?n.version:null};const k2=m2;var C2=(e,t,n,r,o)=>{"string"==typeof n&&(o=r,r=n,n=void 0);try{return new k2(e instanceof k2?e.version:e,n).inc(t,r,o).version}catch(a){return null}};const E2=v2;var O2=(e,t)=>{const n=E2(e,null,!0),r=E2(t,null,!0),o=n.compare(r);if(0===o)return null;const a=o>0,i=a?n:r,s=a?r:n,l=!!i.prerelease.length;if(!!s.prerelease.length&&!l)return s.patch||s.minor?i.patch?"patch":i.minor?"minor":"major":"major";const c=l?"pre":"";return n.major!==r.major?c+"major":n.minor!==r.minor?c+"minor":n.patch!==r.patch?c+"patch":"prerelease"};const D2=m2;var $2=(e,t)=>new D2(e,t).major;const j2=m2;var N2=(e,t)=>new j2(e,t).minor;const P2=m2;var _2=(e,t)=>new P2(e,t).patch;const I2=v2;var T2=(e,t)=>{const n=I2(e,t);return n&&n.prerelease.length?n.prerelease:null};const F2=m2;var R2=(e,t,n)=>new F2(e,n).compare(new F2(t,n));const A2=R2;var M2=(e,t,n)=>A2(t,e,n);const L2=R2;var B2=(e,t)=>L2(e,t,!0);const z2=m2;var H2=(e,t,n)=>{const r=new z2(e,n),o=new z2(t,n);return r.compare(o)||r.compareBuild(o)};const W2=H2;var U2=(e,t)=>e.sort(((e,n)=>W2(e,n,t)));const V2=H2;var G2=(e,t)=>e.sort(((e,n)=>V2(n,e,t)));const q2=R2;var X2=(e,t,n)=>q2(e,t,n)>0;const K2=R2;var Y2=(e,t,n)=>K2(e,t,n)<0;const Q2=R2;var J2=(e,t,n)=>0===Q2(e,t,n);const Z2=R2;var e5=(e,t,n)=>0!==Z2(e,t,n);const t5=R2;var n5=(e,t,n)=>t5(e,t,n)>=0;const r5=R2;var o5=(e,t,n)=>r5(e,t,n)<=0;const a5=J2,i5=e5,s5=X2,l5=n5,c5=Y2,u5=o5;var d5=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return a5(e,n,r);case"!=":return i5(e,n,r);case">":return s5(e,n,r);case">=":return l5(e,n,r);case"<":return c5(e,n,r);case"<=":return u5(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}};const f5=m2,p5=v2,{safeRe:h5,t:g5}=n2;var m5,b5,v5=(e,t)=>{if(e instanceof f5)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=h5[g5.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),h5[g5.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;h5[g5.COERCERTL].lastIndex=-1}else n=e.match(h5[g5.COERCE]);return null===n?null:p5(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};var y5=w5;function w5(e){var t=this;if(t instanceof w5||(t=new w5),t.tail=null,t.head=null,t.length=0,e&&"function"==typeof e.forEach)e.forEach((function(e){t.push(e)}));else if(arguments.length>0)for(var n=0,r=arguments.length;n1)n=t;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");r=this.head.next,n=this.head.value}for(var o=0;null!==r;o++)n=e(n,r.value,o),r=r.next;return n},w5.prototype.reduceReverse=function(e,t){var n,r=this.tail;if(arguments.length>1)n=t;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");r=this.tail.prev,n=this.tail.value}for(var o=this.length-1;null!==r;o--)n=e(n,r.value,o),r=r.prev;return n},w5.prototype.toArray=function(){for(var e=new Array(this.length),t=0,n=this.head;null!==n;t++)e[t]=n.value,n=n.next;return e},w5.prototype.toArrayReverse=function(){for(var e=new Array(this.length),t=0,n=this.tail;null!==n;t++)e[t]=n.value,n=n.prev;return e},w5.prototype.slice=function(e,t){(t=t||this.length)<0&&(t+=this.length),(e=e||0)<0&&(e+=this.length);var n=new w5;if(tthis.length&&(t=this.length);for(var r=0,o=this.head;null!==o&&rthis.length&&(t=this.length);for(var r=this.length,o=this.tail;null!==o&&r>t;r--)o=o.prev;for(;null!==o&&r>e;r--,o=o.prev)n.push(o.value);return n},w5.prototype.splice=function(e,t,...n){e>this.length&&(e=this.length-1),e<0&&(e=this.length+e);for(var r=0,o=this.head;null!==o&&r1;const A5=(e,t,n)=>{const r=e[T5].get(t);if(r){const t=r.value;if(M5(e,t)){if(B5(e,r),!e[j5])return}else n&&(e[F5]&&(r.value.now=Date.now()),e[I5].unshiftNode(r));return t.value}},M5=(e,t)=>{if(!t||!t.maxAge&&!e[N5])return!1;const n=Date.now()-t.now;return t.maxAge?n>t.maxAge:e[N5]&&n>e[N5]},L5=e=>{if(e[D5]>e[O5])for(let t=e[I5].tail;e[D5]>e[O5]&&null!==t;){const n=t.prev;B5(e,t),t=n}},B5=(e,t)=>{if(t){const n=t.value;e[P5]&&e[P5](n.key,n.value),e[D5]-=n.length,e[T5].delete(n.key),e[I5].removeNode(t)}};class z5{constructor(e,t,n,r,o){this.key=e,this.value=t,this.length=n,this.now=r,this.maxAge=o||0}}const H5=(e,t,n,r)=>{let o=n.value;M5(e,o)&&(B5(e,n),e[j5]||(o=void 0)),o&&t.call(r,o.value,o.key,e)};var W5,U5,V5,G5,q5=class{constructor(e){if("number"==typeof e&&(e={max:e}),e||(e={}),e.max&&("number"!=typeof e.max||e.max<0))throw new TypeError("max must be a non-negative number");this[O5]=e.max||1/0;const t=e.length||R5;if(this[$5]="function"!=typeof t?R5:t,this[j5]=e.stale||!1,e.maxAge&&"number"!=typeof e.maxAge)throw new TypeError("maxAge must be a number");this[N5]=e.maxAge||0,this[P5]=e.dispose,this[_5]=e.noDisposeOnSet||!1,this[F5]=e.updateAgeOnGet||!1,this.reset()}set max(e){if("number"!=typeof e||e<0)throw new TypeError("max must be a non-negative number");this[O5]=e||1/0,L5(this)}get max(){return this[O5]}set allowStale(e){this[j5]=!!e}get allowStale(){return this[j5]}set maxAge(e){if("number"!=typeof e)throw new TypeError("maxAge must be a non-negative number");this[N5]=e,L5(this)}get maxAge(){return this[N5]}set lengthCalculator(e){"function"!=typeof e&&(e=R5),e!==this[$5]&&(this[$5]=e,this[D5]=0,this[I5].forEach((e=>{e.length=this[$5](e.value,e.key),this[D5]+=e.length}))),L5(this)}get lengthCalculator(){return this[$5]}get length(){return this[D5]}get itemCount(){return this[I5].length}rforEach(e,t){t=t||this;for(let n=this[I5].tail;null!==n;){const r=n.prev;H5(this,e,n,t),n=r}}forEach(e,t){t=t||this;for(let n=this[I5].head;null!==n;){const r=n.next;H5(this,e,n,t),n=r}}keys(){return this[I5].toArray().map((e=>e.key))}values(){return this[I5].toArray().map((e=>e.value))}reset(){this[P5]&&this[I5]&&this[I5].length&&this[I5].forEach((e=>this[P5](e.key,e.value))),this[T5]=new Map,this[I5]=new E5,this[D5]=0}dump(){return this[I5].map((e=>!M5(this,e)&&{k:e.key,v:e.value,e:e.now+(e.maxAge||0)})).toArray().filter((e=>e))}dumpLru(){return this[I5]}set(e,t,n){if((n=n||this[N5])&&"number"!=typeof n)throw new TypeError("maxAge must be a number");const r=n?Date.now():0,o=this[$5](t,e);if(this[T5].has(e)){if(o>this[O5])return B5(this,this[T5].get(e)),!1;const a=this[T5].get(e).value;return this[P5]&&(this[_5]||this[P5](e,a.value)),a.now=r,a.maxAge=n,a.value=t,this[D5]+=o-a.length,a.length=o,this.get(e),L5(this),!0}const a=new z5(e,t,o,r,n);return a.length>this[O5]?(this[P5]&&this[P5](e,t),!1):(this[D5]+=a.length,this[I5].unshift(a),this[T5].set(e,this[I5].head),L5(this),!0)}has(e){if(!this[T5].has(e))return!1;const t=this[T5].get(e).value;return!M5(this,t)}get(e){return A5(this,e,!0)}peek(e){return A5(this,e,!1)}pop(){const e=this[I5].tail;return e?(B5(this,e),e.value):null}del(e){B5(this,this[T5].get(e))}load(e){this.reset();const t=Date.now();for(let n=e.length-1;n>=0;n--){const r=e[n],o=r.e||0;if(0===o)this.set(r.k,r.v);else{const e=o-t;e>0&&this.set(r.k,r.v,e)}}}prune(){this[T5].forEach(((e,t)=>A5(this,t,!1)))}};function X5(){if(U5)return W5;U5=1;class e{constructor(t,o){if(o=n(o),t instanceof e)return t.loose===!!o.loose&&t.includePrerelease===!!o.includePrerelease?t:new e(t.raw,o);if(t instanceof r)return this.raw=t.value,this.set=[[t]],this.format(),this;if(this.options=o,this.loose=!!o.loose,this.includePrerelease=!!o.includePrerelease,this.raw=t.trim().split(/\s+/).join(" "),this.set=this.raw.split("||").map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){const e=this.set[0];if(this.set=this.set.filter((e=>!p(e[0]))),0===this.set.length)this.set=[e];else if(this.set.length>1)for(const t of this.set)if(1===t.length&&h(t[0])){this.set=[t];break}}this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){const n=((this.options.includePrerelease&&d)|(this.options.loose&&f))+":"+e,a=t.get(n);if(a)return a;const h=this.options.loose,g=h?i[s.HYPHENRANGELOOSE]:i[s.HYPHENRANGE];e=e.replace(g,O(this.options.includePrerelease)),o("hyphen replace",e),e=e.replace(i[s.COMPARATORTRIM],l),o("comparator trim",e),e=e.replace(i[s.TILDETRIM],c),o("tilde trim",e),e=e.replace(i[s.CARETTRIM],u),o("caret trim",e);let b=e.split(" ").map((e=>m(e,this.options))).join(" ").split(/\s+/).map((e=>E(e,this.options)));h&&(b=b.filter((e=>(o("loose invalid filter",e,this.options),!!e.match(i[s.COMPARATORLOOSE]))))),o("range list",b);const v=new Map,y=b.map((e=>new r(e,this.options)));for(const t of y){if(p(t))return[t];v.set(t.value,t)}v.size>1&&v.has("")&&v.delete("");const w=[...v.values()];return t.set(n,w),w}intersects(t,n){if(!(t instanceof e))throw new TypeError("a Range is required");return this.set.some((e=>g(e,n)&&t.set.some((t=>g(t,n)&&e.every((e=>t.every((t=>e.intersects(t,n)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new a(e,this.options)}catch(Bre){return!1}for(let t=0;t"<0.0.0-0"===e.value,h=e=>""===e.value,g=(e,t)=>{let n=!0;const r=e.slice();let o=r.pop();for(;n&&r.length;)n=r.every((e=>o.intersects(e,t))),o=r.pop();return n},m=(e,t)=>(o("comp",e,t),e=w(e,t),o("caret",e),e=v(e,t),o("tildes",e),e=S(e,t),o("xrange",e),e=C(e,t),o("stars",e),e),b=e=>!e||"x"===e.toLowerCase()||"*"===e,v=(e,t)=>e.trim().split(/\s+/).map((e=>y(e,t))).join(" "),y=(e,t)=>{const n=t.loose?i[s.TILDELOOSE]:i[s.TILDE];return e.replace(n,((t,n,r,a,i)=>{let s;return o("tilde",e,t,n,r,a,i),b(n)?s="":b(r)?s=`>=${n}.0.0 <${+n+1}.0.0-0`:b(a)?s=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:i?(o("replaceTilde pr",i),s=`>=${n}.${r}.${a}-${i} <${n}.${+r+1}.0-0`):s=`>=${n}.${r}.${a} <${n}.${+r+1}.0-0`,o("tilde return",s),s}))},w=(e,t)=>e.trim().split(/\s+/).map((e=>x(e,t))).join(" "),x=(e,t)=>{o("caret",e,t);const n=t.loose?i[s.CARETLOOSE]:i[s.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,a,i,s)=>{let l;return o("caret",e,t,n,a,i,s),b(n)?l="":b(a)?l=`>=${n}.0.0${r} <${+n+1}.0.0-0`:b(i)?l="0"===n?`>=${n}.${a}.0${r} <${n}.${+a+1}.0-0`:`>=${n}.${a}.0${r} <${+n+1}.0.0-0`:s?(o("replaceCaret pr",s),l="0"===n?"0"===a?`>=${n}.${a}.${i}-${s} <${n}.${a}.${+i+1}-0`:`>=${n}.${a}.${i}-${s} <${n}.${+a+1}.0-0`:`>=${n}.${a}.${i}-${s} <${+n+1}.0.0-0`):(o("no pr"),l="0"===n?"0"===a?`>=${n}.${a}.${i}${r} <${n}.${a}.${+i+1}-0`:`>=${n}.${a}.${i}${r} <${n}.${+a+1}.0-0`:`>=${n}.${a}.${i} <${+n+1}.0.0-0`),o("caret return",l),l}))},S=(e,t)=>(o("replaceXRanges",e,t),e.split(/\s+/).map((e=>k(e,t))).join(" ")),k=(e,t)=>{e=e.trim();const n=t.loose?i[s.XRANGELOOSE]:i[s.XRANGE];return e.replace(n,((n,r,a,i,s,l)=>{o("xRange",e,n,r,a,i,s,l);const c=b(a),u=c||b(i),d=u||b(s),f=d;return"="===r&&f&&(r=""),l=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&f?(u&&(i=0),s=0,">"===r?(r=">=",u?(a=+a+1,i=0,s=0):(i=+i+1,s=0)):"<="===r&&(r="<",u?a=+a+1:i=+i+1),"<"===r&&(l="-0"),n=`${r+a}.${i}.${s}${l}`):u?n=`>=${a}.0.0${l} <${+a+1}.0.0-0`:d&&(n=`>=${a}.${i}.0${l} <${a}.${+i+1}.0-0`),o("xRange return",n),n}))},C=(e,t)=>(o("replaceStars",e,t),e.trim().replace(i[s.STAR],"")),E=(e,t)=>(o("replaceGTE0",e,t),e.trim().replace(i[t.includePrerelease?s.GTE0PRE:s.GTE0],"")),O=e=>(t,n,r,o,a,i,s,l,c,u,d,f,p)=>`${n=b(r)?"":b(o)?`>=${r}.0.0${e?"-0":""}`:b(a)?`>=${r}.${o}.0${e?"-0":""}`:i?`>=${n}`:`>=${n}${e?"-0":""}`} ${l=b(c)?"":b(u)?`<${+c+1}.0.0-0`:b(d)?`<${c}.${+u+1}.0-0`:f?`<=${c}.${u}.${d}-${f}`:e?`<${c}.${u}.${+d+1}-0`:`<=${l}`}`.trim(),D=(e,t,n)=>{for(let r=0;r0){const r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0};return W5}function K5(){if(G5)return V5;G5=1;const e=Symbol("SemVer ANY");class t{static get ANY(){return e}constructor(r,o){if(o=n(o),r instanceof t){if(r.loose===!!o.loose)return r;r=r.value}r=r.trim().split(/\s+/).join(" "),i("comparator",r,o),this.options=o,this.loose=!!o.loose,this.parse(r),this.semver===e?this.value="":this.value=this.operator+this.semver.version,i("comp",this)}parse(t){const n=this.options.loose?r[o.COMPARATORLOOSE]:r[o.COMPARATOR],a=t.match(n);if(!a)throw new TypeError(`Invalid comparator: ${t}`);this.operator=void 0!==a[1]?a[1]:"","="===this.operator&&(this.operator=""),a[2]?this.semver=new s(a[2],this.options.loose):this.semver=e}toString(){return this.value}test(t){if(i("Comparator.test",t,this.options.loose),this.semver===e||t===e)return!0;if("string"==typeof t)try{t=new s(t,this.options)}catch(Bre){return!1}return a(t,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return""===this.operator?""===this.value||new l(e.value,r).test(this.value):""===e.operator?""===e.value||new l(this.value,r).test(e.semver):(!(r=n(r)).includePrerelease||"<0.0.0-0"!==this.value&&"<0.0.0-0"!==e.value)&&(!(!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&(!(!this.operator.startsWith(">")||!e.operator.startsWith(">"))||(!(!this.operator.startsWith("<")||!e.operator.startsWith("<"))||(!(this.semver.version!==e.semver.version||!this.operator.includes("=")||!e.operator.includes("="))||(!!(a(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<"))||!!(a(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))))))}}V5=t;const n=a2,{safeRe:r,t:o}=n2,a=d5,i=t2,s=m2,l=X5();return V5}const Y5=X5();var Q5=(e,t,n)=>{try{t=new Y5(t,n)}catch(Bre){return!1}return t.test(e)};const J5=X5();var Z5=(e,t)=>new J5(e,t).set.map((e=>e.map((e=>e.value)).join(" ").trim().split(" ")));const e3=m2,t3=X5();var n3=(e,t,n)=>{let r=null,o=null,a=null;try{a=new t3(t,n)}catch(Bre){return null}return e.forEach((e=>{a.test(e)&&(r&&-1!==o.compare(e)||(r=e,o=new e3(r,n)))})),r};const r3=m2,o3=X5();var a3=(e,t,n)=>{let r=null,o=null,a=null;try{a=new o3(t,n)}catch(Bre){return null}return e.forEach((e=>{a.test(e)&&(r&&1!==o.compare(e)||(r=e,o=new r3(r,n)))})),r};const i3=m2,s3=X5(),l3=X2;var c3=(e,t)=>{e=new s3(e,t);let n=new i3("0.0.0");if(e.test(n))return n;if(n=new i3("0.0.0-0"),e.test(n))return n;n=null;for(let r=0;r{const t=new i3(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":o&&!l3(t,o)||(o=t);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${e.operator}`)}})),!o||n&&!l3(n,o)||(n=o)}return n&&e.test(n)?n:null};const u3=X5();var d3=(e,t)=>{try{return new u3(e,t).range||"*"}catch(Bre){return null}};const f3=m2,p3=K5(),{ANY:h3}=p3,g3=X5(),m3=Q5,b3=X2,v3=Y2,y3=o5,w3=n5;var x3=(e,t,n,r)=>{let o,a,i,s,l;switch(e=new f3(e,r),t=new g3(t,r),n){case">":o=b3,a=y3,i=v3,s=">",l=">=";break;case"<":o=v3,a=w3,i=b3,s="<",l="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(m3(e,t,r))return!1;for(let c=0;c{e.semver===h3&&(e=new p3(">=0.0.0")),u=u||e,d=d||e,o(e.semver,u.semver,r)?u=e:i(e.semver,d.semver,r)&&(d=e)})),u.operator===s||u.operator===l)return!1;if((!d.operator||d.operator===s)&&a(e,d.semver))return!1;if(d.operator===l&&i(e,d.semver))return!1}return!0};const S3=x3;var k3=(e,t,n)=>S3(e,t,">",n);const C3=x3;var E3=(e,t,n)=>C3(e,t,"<",n);const O3=X5();var D3=(e,t,n)=>(e=new O3(e,n),t=new O3(t,n),e.intersects(t,n));const $3=Q5,j3=R2;const N3=X5(),P3=K5(),{ANY:_3}=P3,I3=Q5,T3=R2,F3=[new P3(">=0.0.0-0")],R3=[new P3(">=0.0.0")],A3=(e,t,n)=>{if(e===t)return!0;if(1===e.length&&e[0].semver===_3){if(1===t.length&&t[0].semver===_3)return!0;e=n.includePrerelease?F3:R3}if(1===t.length&&t[0].semver===_3){if(n.includePrerelease)return!0;t=R3}const r=new Set;let o,a,i,s,l,c,u;for(const p of e)">"===p.operator||">="===p.operator?o=M3(o,p,n):"<"===p.operator||"<="===p.operator?a=L3(a,p,n):r.add(p.semver);if(r.size>1)return null;if(o&&a){if(i=T3(o.semver,a.semver,n),i>0)return null;if(0===i&&(">="!==o.operator||"<="!==a.operator))return null}for(const p of r){if(o&&!I3(p,String(o),n))return null;if(a&&!I3(p,String(a),n))return null;for(const e of t)if(!I3(p,String(e),n))return!1;return!0}let d=!(!a||n.includePrerelease||!a.semver.prerelease.length)&&a.semver,f=!(!o||n.includePrerelease||!o.semver.prerelease.length)&&o.semver;d&&1===d.prerelease.length&&"<"===a.operator&&0===d.prerelease[0]&&(d=!1);for(const p of t){if(u=u||">"===p.operator||">="===p.operator,c=c||"<"===p.operator||"<="===p.operator,o)if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),">"===p.operator||">="===p.operator){if(s=M3(o,p,n),s===p&&s!==o)return!1}else if(">="===o.operator&&!I3(o.semver,String(p),n))return!1;if(a)if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),"<"===p.operator||"<="===p.operator){if(l=L3(a,p,n),l===p&&l!==a)return!1}else if("<="===a.operator&&!I3(a.semver,String(p),n))return!1;if(!p.operator&&(a||o)&&0!==i)return!1}return!(o&&c&&!a&&0!==i)&&(!(a&&u&&!o&&0!==i)&&(!f&&!d))},M3=(e,t,n)=>{if(!e)return t;const r=T3(e.semver,t.semver,n);return r>0?e:r<0||">"===t.operator&&">="===e.operator?t:e},L3=(e,t,n)=>{if(!e)return t;const r=T3(e.semver,t.semver,n);return r<0?e:r>0||"<"===t.operator&&"<="===e.operator?t:e};var B3=(e,t,n={})=>{if(e===t)return!0;e=new N3(e,n),t=new N3(t,n);let r=!1;e:for(const o of e.set){for(const e of t.set){const t=A3(o,e,n);if(r=r||null!==t,t)continue e}if(r)return!1}return!0};const z3=n2,H3=Z1,W3=m2,U3=l2,V3=(e,t,n)=>{const r=[];let o=null,a=null;const i=e.sort(((e,t)=>j3(e,t,n)));for(const u of i){$3(u,t,n)?(a=u,o||(o=u)):(a&&r.push([o,a]),a=null,o=null)}o&&r.push([o,null]);const s=[];for(const[u,d]of r)u===d?s.push(u):d||u!==i[0]?d?u===i[0]?s.push(`<=${d}`):s.push(`${u} - ${d}`):s.push(`>=${u}`):s.push("*");const l=s.join(" || "),c="string"==typeof t.raw?t.raw:String(t);return l.length{await fetch("/lobe/config",{body:JSON.stringify(e),headers:{"Content-Type":"application/json"},method:"POST"})},Q3={confirmPageUnload:!1,enableExtraNetworkSidebar:!0,enableHighlight:!1,enableSidebar:!0,enableWebFont:!0,extraNetworkCardSize:86,extraNetworkFixedMode:"fixed",extraNetworkSidebarExpand:!0,extraNetworkSidebarWidth:340,i18n:"en_US",layoutHideFooter:!1,layoutSplitPreview:!1,liteAnimation:!1,logoCustomTitle:"",logoCustomUrl:"",logoType:"lobe",neutralColor:void 0,primaryColor:void 0,promptEditor:!1,promptTextareaType:"resizable",sidebarExpand:!0,sidebarFixedMode:"fixed",sidebarWidth:280,svgIcon:!0},J3={currentTab:"tab_txt2img",latestVersion:X3,loading:!0,localeOptions:K3,setting:Q3,themeMode:"dark",version:X3},Z3="SD-LOBE-SETTING",e4=(e,t)=>({onInit:async()=>{e((()=>({loading:!0})),!1,"onInit");const{onLoadSetting:n,onLoadVersion:r,onLoadLatestVersion:o,onLoadLocalOptions:a}=t();await a(),await r(),await o(),await n(),e((()=>({loading:!1})),!1,"onInit")},onLoadLatestVersion:async()=>{const t=await(async()=>{const e=await fetch(`https://api.github.com/repos/${q3.replace("https://github.com/","")}/releases/latest`),t=await e.json();return t&&t.tag_name&&G3.clean(t.tag_name)||X3})();e((()=>({latestVersion:t})),!1,"onLoadLatestVersion")},onLoadLocalOptions:async()=>{const t=await(async()=>{const e=await fetch("/lobe/locales/options"),t=await e.json();return t&&0!==(null==t?void 0:t.length)?t:K3})();e((()=>({localeOptions:t})),!1,"onLoadLocalOptions")},onLoadSetting:async()=>{let t;const n=await(async()=>{const e=await fetch("/lobe/config"),t=await e.json();if(t&&!(null==t?void 0:t.empty))return t})();if(n&&(ue.start("🤯 [setting] loaded webui setting"),t=n),!t){const e=localStorage.getItem(Z3);e&&(ue.info("🤯 [setting] loaded local setting"),t=JSON.parse(e))}if(!t){const e=localStorage.getItem("SD-KITCHEN-SETTING");e&&(ue.info("🤯 [setting] loaded fallback local setting"),t=JSON.parse(e))}t||(ue.info("🤯 [setting] loaded default setting"),t=Q3);const r={...Q3,...t};await Y3(r),e((()=>({setting:r})),!1,"onLoadSetting"),ue.success("🤯 [setting] loaded"),console.table(r)},onLoadVersion:async()=>{const t=await(async()=>{const e=await fetch("/lobe/package"),t=await e.json();return t&&!t.empty&&t.version?t.version:X3})();e((()=>({version:t})),!1,"onLoadVersion")},onSetSetting:async n=>{const r={...t().setting,...n};localStorage.setItem(Z3,JSON.stringify(r)),await Y3(r),e((()=>({setting:r})),!1,"onSetSetting")},onSetThemeMode:t=>{e((()=>({themeMode:t})),!1,"onSetThemeMode")},setCurrentTab:()=>{var n;const r=null==(n=get_uiCurrentTabContent())?void 0:n.id;ue.info("🤯 [tab] onChange",r),r&&r!==t().currentTab&&e({currentTab:r},!1,"setCurrentTab")}}),t4=e=>({...Q3,...e.setting}),n4=e=>e.currentTab,r4=e=>e.themeMode,o4=Q1()(_1(((...e)=>({...J3,...e4(...e)}))),T1),a4=JSON.parse(localStorage.getItem(Z3));z0.use(E1).use(h1).init({backend:{loadPath:"/lobe/locales/{{lng}}"},debug:!1,fallbackLng:"en_US",lng:(null==a4?void 0:a4.i18n)||"en_US"});const i4="%[a-f0-9]{2}",s4=new RegExp("("+i4+")|([^%]+?)","gi"),l4=new RegExp("("+i4+")+","gi");function c4(e,t){try{return[decodeURIComponent(e.join(""))]}catch{}if(1===e.length)return e;t=t||1;const n=e.slice(0,t),r=e.slice(t);return Array.prototype.concat.call([],c4(n),c4(r))}function u4(e){try{return decodeURIComponent(e)}catch{let t=e.match(s4)||[];for(let n=1;nnull==e,g4=e=>encodeURIComponent(e).replace(/[!'()*]/g,(e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)),m4=Symbol("encodeFragmentIdentifier");function b4(e){if("string"!=typeof e||1!==e.length)throw new TypeError("arrayFormatSeparator must be single character string")}function v4(e,t){return t.encode?t.strict?g4(e):encodeURIComponent(e):e}function y4(e,t){return t.decode?d4(e):e}function w4(e){return Array.isArray(e)?e.sort():"object"==typeof e?w4(Object.keys(e)).sort(((e,t)=>Number(e)-Number(t))).map((t=>e[t])):e}function x4(e){const t=e.indexOf("#");return-1!==t&&(e=e.slice(0,t)),e}function S4(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):!t.parseBooleans||null===e||"true"!==e.toLowerCase()&&"false"!==e.toLowerCase()||(e="true"===e.toLowerCase()),e}function k4(e){const t=(e=x4(e)).indexOf("?");return-1===t?"":e.slice(t+1)}function C4(e,t){b4((t={decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1,...t}).arrayFormatSeparator);const n=function(e){let t;switch(e.arrayFormat){case"index":return(e,n,r)=>{t=/\[(\d*)]$/.exec(e),e=e.replace(/\[\d*]$/,""),t?(void 0===r[e]&&(r[e]={}),r[e][t[1]]=n):r[e]=n};case"bracket":return(e,n,r)=>{t=/(\[])$/.exec(e),e=e.replace(/\[]$/,""),t?void 0!==r[e]?r[e]=[...r[e],n]:r[e]=[n]:r[e]=n};case"colon-list-separator":return(e,n,r)=>{t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),t?void 0!==r[e]?r[e]=[...r[e],n]:r[e]=[n]:r[e]=n};case"comma":case"separator":return(t,n,r)=>{const o="string"==typeof n&&n.includes(e.arrayFormatSeparator),a="string"==typeof n&&!o&&y4(n,e).includes(e.arrayFormatSeparator);n=a?y4(n,e):n;const i=o||a?n.split(e.arrayFormatSeparator).map((t=>y4(t,e))):null===n?n:y4(n,e);r[t]=i};case"bracket-separator":return(t,n,r)=>{const o=/(\[])$/.test(t);if(t=t.replace(/\[]$/,""),!o)return void(r[t]=n?y4(n,e):n);const a=null===n?[]:n.split(e.arrayFormatSeparator).map((t=>y4(t,e)));void 0!==r[t]?r[t]=[...r[t],...a]:r[t]=a};default:return(e,t,n)=>{void 0!==n[e]?n[e]=[...[n[e]].flat(),t]:n[e]=t}}}(t),r=Object.create(null);if("string"!=typeof e)return r;if(!(e=e.trim().replace(/^[?#&]/,"")))return r;for(const o of e.split("&")){if(""===o)continue;const e=t.decode?o.replace(/\+/g," "):o;let[a,i]=f4(e,"=");void 0===a&&(a=e),i=void 0===i?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?i:y4(i,t),n(y4(a,t),i,r)}for(const[o,a]of Object.entries(r))if("object"==typeof a&&null!==a)for(const[e,n]of Object.entries(a))a[e]=S4(n,t);else r[o]=S4(a,t);return!1===t.sort?r:(!0===t.sort?Object.keys(r).sort():Object.keys(r).sort(t.sort)).reduce(((e,t)=>{const n=r[t];return Boolean(n)&&"object"==typeof n&&!Array.isArray(n)?e[t]=w4(n):e[t]=n,e}),Object.create(null))}function E4(e,t){if(!e)return"";b4((t={encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:",",...t}).arrayFormatSeparator);const n=n=>t.skipNull&&h4(e[n])||t.skipEmptyString&&""===e[n],r=function(e){switch(e.arrayFormat){case"index":return t=>(n,r)=>{const o=n.length;return void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[v4(t,e),"[",o,"]"].join("")]:[...n,[v4(t,e),"[",v4(o,e),"]=",v4(r,e)].join("")]};case"bracket":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[v4(t,e),"[]"].join("")]:[...n,[v4(t,e),"[]=",v4(r,e)].join("")];case"colon-list-separator":return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,[v4(t,e),":list="].join("")]:[...n,[v4(t,e),":list=",v4(r,e)].join("")];case"comma":case"separator":case"bracket-separator":{const t="bracket-separator"===e.arrayFormat?"[]=":"=";return n=>(r,o)=>void 0===o||e.skipNull&&null===o||e.skipEmptyString&&""===o?r:(o=null===o?"":o,0===r.length?[[v4(n,e),t,v4(o,e)].join("")]:[[r,v4(o,e)].join(e.arrayFormatSeparator)])}default:return t=>(n,r)=>void 0===r||e.skipNull&&null===r||e.skipEmptyString&&""===r?n:null===r?[...n,v4(t,e)]:[...n,[v4(t,e),"=",v4(r,e)].join("")]}}(t),o={};for(const[i,s]of Object.entries(e))n(i)||(o[i]=s);const a=Object.keys(o);return!1!==t.sort&&a.sort(t.sort),a.map((n=>{const o=e[n];return void 0===o?"":null===o?v4(n,t):Array.isArray(o)?0===o.length&&"bracket-separator"===t.arrayFormat?v4(n,t)+"[]":o.reduce(r(n),[]).join("&"):v4(n,t)+"="+v4(o,t)})).filter((e=>e.length>0)).join("&")}function O4(e,t){var n;t={decode:!0,...t};let[r,o]=f4(e,"#");return void 0===r&&(r=e),{url:(null==(n=null==r?void 0:r.split("?"))?void 0:n[0])??"",query:C4(k4(e),t),...t&&t.parseFragmentIdentifier&&o?{fragmentIdentifier:y4(o,t)}:{}}}function D4(e,t){t={encode:!0,strict:!0,[m4]:!0,...t};const n=x4(e.url).split("?")[0]||"";let r=E4({...C4(k4(e.url),{sort:!1}),...e.query},t);r&&(r=`?${r}`);let o=function(e){let t="";const n=e.indexOf("#");return-1!==n&&(t=e.slice(n)),t}(e.url);if(e.fragmentIdentifier){const r=new URL(n);r.hash=e.fragmentIdentifier,o=t[m4]?r.hash:`#${e.fragmentIdentifier}`}return`${n}${r}${o}`}function $4(e,t,n){n={parseFragmentIdentifier:!0,[m4]:!1,...n};const{url:r,query:o,fragmentIdentifier:a}=O4(e,n);return D4({url:r,query:p4(o,t),fragmentIdentifier:a},n)}const j4=Object.freeze(Object.defineProperty({__proto__:null,exclude:function(e,t,n){return $4(e,Array.isArray(t)?e=>!t.includes(e):(e,n)=>!t(e,n),n)},extract:k4,parse:C4,parseUrl:O4,pick:$4,stringify:E4,stringifyUrl:D4},Symbol.toStringTag,{value:"Module"})),N4=()=>{const[e,t]=z.useState((()=>{try{return window.matchMedia("(prefers-color-scheme: dark)").matches}catch{return!1}})());return z.useEffect((()=>{const e=window.matchMedia("(prefers-color-scheme: dark)"),n=e=>{t(e.matches)};return e.addEventListener("change",n),()=>{e.removeEventListener("change",n)}}),[]),e},P4={dark:{colorPrimary:"#007AFF",colorPrimaryActive:"#1554ad",colorPrimaryBg:"#111a2c",colorPrimaryBgHover:"#112545",colorPrimaryBorder:"#15325b",colorPrimaryBorderHover:"#15417e",colorPrimaryHover:"#3c89e8",colorPrimaryText:"#1668dc",colorPrimaryTextActive:"#1554ad",colorPrimaryTextHover:"#3c89e8"},light:{colorPrimary:"#007AFF",colorPrimaryActive:"#0958d9",colorPrimaryBg:"#e6f4ff",colorPrimaryBgHover:"#bae0ff",colorPrimaryBorder:"#91caff",colorPrimaryBorderHover:"#69b1ff",colorPrimaryHover:"#4096ff",colorPrimaryText:"#1677ff",colorPrimaryTextActive:"#0958d9",colorPrimaryTextHover:"#4096ff"}},_4={dark:{colorBgContainer:"#1f1f1f",colorBgElevated:"#222",colorBgLayout:"#181818",colorBgSpotlight:"#444",colorBorder:"#444",colorBorderSecondary:"#333",colorFill:"rgb(255 255 255 / 18%)",colorFillQuaternary:"rgb(255 255 255 / 4%)",colorFillSecondary:"rgb(255 255 255 / 12%)",colorFillTertiary:"rgb(255 255 255 / 8%)",colorNeutral:"#666",colorText:"rgb(255 255 255 / 85%)",colorTextQuaternary:"rgb(255 255 255 / 25%)",colorTextSecondary:"rgb(255 255 255 / 65%)",colorTextTertiary:"rgb(255 255 255 / 45%)"},light:{colorBgContainer:"#fff",colorBgElevated:"#fff",colorBgLayout:"#f7f7f7",colorBgSpotlight:"rgb(0 0 0 / 85%)",colorBorder:"#ddd",colorBorderSecondary:"#eee",colorFill:"rgb(0 0 0 / 15%)",colorFillQuaternary:"rgb(0 0 0 / 2%)",colorFillSecondary:"rgb(0 0 0 / 6%)",colorFillTertiary:"rgb(0 0 0 / 4%)",colorNeutral:"#666",colorText:"rgb(0 0 0 / 88%)",colorTextQuaternary:"rgb(0 0 0 / 25%)",colorTextSecondary:"rgb(0 0 0 / 65%)",colorTextTertiary:"rgb(0 0 0 / 45%)"}},I4=z.memo((({children:e})=>{const{onSetThemeMode:t,themeMode:n}=o4((e=>({onInit:e.onInit,onSetThemeMode:e.onSetThemeMode,themeMode:e.themeMode})),T1),r=o4(t4,IY),o=N4();z.useEffect((()=>{const e=String(j4.parseUrl(window.location.href).query.__theme||"");e?(document.body.classList.add(e),t(e)):(document.body.classList.add(o?"dark":"light"),t(o?"dark":"light"))}),[o]);const a=z.useCallback((()=>{let e={},t={};if(r.primaryColor)if("kitchen"===r.primaryColor)e=P4[n];else{const t=fK[r.primaryColor];e=ZJ({appearance:n,scale:t,type:"Primary"})}if(r.neutralColor)if("kitchen"===r.neutralColor)t=_4[n];else{const e=tZ[r.neutralColor];t=eZ({appearance:n,scale:e})}return{...e,...t}}),[r.primaryColor,r.neutralColor,n]);return r&&Q.jsx(r0,{customToken:a,enableWebfonts:r.enableWebFont,themeMode:n,children:e})})),T4=MB((({css:e,token:t,cx:n,stylish:r,prefixCls:o})=>{const a=`${o}-highlighter`;return{container:e` pointer-events: none; position: absolute; overflow: hidden auto; @@ -172,7 +172,7 @@ const se=2; font-family: var(--font) !important; } } - `)}}));"undefined"!=typeof globalThis?globalThis:void 0!=={}||("undefined"!=typeof global?global:"undefined"!=typeof self&&self);var F4,R4={exports:{}};F4=()=>{return e={770:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.setDefaultDebugCall=t.createOnigScanner=t.createOnigString=t.loadWASM=t.OnigScanner=t.OnigString=void 0;const o=r(n(418));let a=null,i=!1;class s{static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n=55296&&o<=56319&&n+1=56320&&t<=57343&&(a=65536+(o-55296<<10)|t-56320,i=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,i&&n++}return t}constructor(e){const t=e.length,n=s._utf8ByteLength(e),r=n!==t,o=r?new Uint32Array(t+1):null;r&&(o[t]=n);const a=r?new Uint32Array(n+1):null;r&&(a[n]=t);const i=new Uint8Array(n);let l=0;for(let s=0;s=55296&&n<=56319&&s+1=56320&&t<=57343&&(c=65536+(n-55296<<10)|t-56320,u=!0)}r&&(o[s]=l,u&&(o[s+1]=l),c<=127?a[l+0]=s:c<=2047?(a[l+0]=s,a[l+1]=s):c<=65535?(a[l+0]=s,a[l+1]=s,a[l+2]=s):(a[l+0]=s,a[l+1]=s,a[l+2]=s,a[l+3]=s)),c<=127?i[l++]=c:c<=2047?(i[l++]=192|(1984&c)>>>6,i[l++]=128|(63&c)>>>0):c<=65535?(i[l++]=224|(61440&c)>>>12,i[l++]=128|(4032&c)>>>6,i[l++]=128|(63&c)>>>0):(i[l++]=240|(1835008&c)>>>18,i[l++]=128|(258048&c)>>>12,i[l++]=128|(4032&c)>>>6,i[l++]=128|(63&c)>>>0),u&&s++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=i,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=a}createString(e){const t=e._omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}class l{constructor(e){if(this.id=++l.LAST_ID,!a)throw new Error("Must invoke loadWASM first.");this._onigBinding=a,this.content=e;const t=new s(e);this.utf16Length=t.utf16Length,this.utf8Length=t.utf8Length,this.utf16OffsetToUtf8=t.utf16OffsetToUtf8,this.utf8OffsetToUtf16=t.utf8OffsetToUtf16,this.utf8Length<1e4&&!l._sharedPtrInUse?(l._sharedPtr||(l._sharedPtr=a._omalloc(1e4)),l._sharedPtrInUse=!0,a.HEAPU8.set(t.utf8Value,l._sharedPtr),this.ptr=l._sharedPtr):this.ptr=t.createString(a)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===l._sharedPtr?l._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}t.OnigString=l,l.LAST_ID=0,l._sharedPtr=0,l._sharedPtrInUse=!1;class c{constructor(e){if(!a)throw new Error("Must invoke loadWASM first.");const t=[],n=[];for(let l=0,c=e.length;lWebAssembly.instantiateStreaming(e,t)}(r):function(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}(r):function(e){return t=>WebAssembly.instantiate(e,t)}(r)}return d=new Promise(((e,t)=>{r=e,i=t})),function(e,t,n,r){(0,o.default)({print:t,instantiateWasm:(t,n)=>{if("undefined"==typeof performance){const e=()=>Date.now();t.env.emscripten_get_now=e,t.wasi_snapshot_preview1.emscripten_get_now=e}return e(t).then((e=>n(e.instance)),r),{}}}).then((e=>{a=e,n()}))}(t,n,r,i),d},t.createOnigString=function(e){return new l(e)},t.createOnigScanner=function(e){return new c(e)},t.setDefaultDebugCall=function(e){i=e}},418:e=>{var t=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(e){var t,n,r=void 0!==(e=e||{})?e:{};r.ready=new Promise((function(e,r){t=e,n=r}));var o,a=Object.assign({},r),i=!1;o=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),function(e,t){e||k(t)}("object"==typeof t),t)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print);var s,l,c=r.print||console.log.bind(console),u=r.printErr||console.warn.bind(console);Object.assign(r,a),a=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(s=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&k("no native wasm support detected");var d,f,p,h=!1,g="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function m(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&g)return g.decode(e.subarray(t,o));for(var a="";t>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function b(e){d=e,r.HEAP8=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU8=f=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}r.INITIAL_MEMORY;var v=[],y=[],w=[],x=0,S=null;function k(e){r.onAbort&&r.onAbort(e),u(e="Aborted("+e+")"),h=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var C,E,O,D="data:application/octet-stream;base64,";function $(e){return e.startsWith(D)}function j(e){try{if(e==C&&s)return new Uint8Array(s);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}catch(t){k(t)}}function N(e){for(;e.length>0;)e.shift()(r)}function P(e){try{return l.grow(e-d.byteLength+65535>>>16),b(l.buffer),1}catch(t){}}$(C="onig.wasm")||(O=C,C=r.locateFile?r.locateFile(O,""):""+O),E="undefined"!=typeof dateNow?dateNow:()=>performance.now();var _=[null,[],[]];function I(e,t){var n=_[e];0===t||10===t?((1===e?c:u)(m(n,0)),n.length=0):n.push(t)}var T,F={emscripten_get_now:E,emscripten_memcpy_big:function(e,t,n){f.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=f.length,r=2147483648;if((e>>>=0)>r)return!1;for(var o=1;o<=4;o*=2){var a=n*(1+.2/o);if(a=Math.min(a,e+100663296),P(Math.min(r,(t=Math.max(e,a))+(65536-t%65536)%65536)))return!0}return!1},fd_write:function(e,t,n,r){for(var o=0,a=0;a>2],s=p[t+4>>2];t+=8;for(var l=0;l>2]=o,0}};function R(e){function n(){T||(T=!0,r.calledRun=!0,h||(N(y),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),w.unshift(e);var e;N(w)}()))}x>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),v.unshift(e);var e;N(v)}(),x>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),n()}),1)):n()))}if(function(){var e={env:F,wasi_snapshot_preview1:F};function t(e,t){var n=e.exports;r.asm=n,b((l=r.asm.memory).buffer),r.asm.__indirect_function_table,function(e){y.unshift(e)}(r.asm.__wasm_call_ctors),function(e){if(x--,r.monitorRunDependencies&&r.monitorRunDependencies(x),0==x&&S){var t=S;S=null,t()}}()}function o(e){t(e.instance)}function a(t){return(s||!i||"function"!=typeof fetch?Promise.resolve().then((function(){return j(C)})):fetch(C,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+C+"'";return e.arrayBuffer()})).catch((function(){return j(C)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){u("failed to asynchronously prepare wasm: "+e),k(e)}))}if(x++,r.monitorRunDependencies&&r.monitorRunDependencies(x),r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(c){u("Module.instantiateWasm callback failed with error: "+c),n(c)}(s||"function"!=typeof WebAssembly.instantiateStreaming||$(C)||"function"!=typeof fetch?a(o):fetch(C,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(e){return u("wasm streaming compile failed: "+e),u("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(n)}(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.__wasm_call_ctors).apply(null,arguments)},r.___errno_location=function(){return(r.___errno_location=r.asm.__errno_location).apply(null,arguments)},r._omalloc=function(){return(r._omalloc=r.asm.omalloc).apply(null,arguments)},r._ofree=function(){return(r._ofree=r.asm.ofree).apply(null,arguments)},r._getLastOnigError=function(){return(r._getLastOnigError=r.asm.getLastOnigError).apply(null,arguments)},r._createOnigScanner=function(){return(r._createOnigScanner=r.asm.createOnigScanner).apply(null,arguments)},r._freeOnigScanner=function(){return(r._freeOnigScanner=r.asm.freeOnigScanner).apply(null,arguments)},r._findNextOnigScannerMatch=function(){return(r._findNextOnigScannerMatch=r.asm.findNextOnigScannerMatch).apply(null,arguments)},r._findNextOnigScannerMatchDbg=function(){return(r._findNextOnigScannerMatchDbg=r.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},r.stackSave=function(){return(r.stackSave=r.asm.stackSave).apply(null,arguments)},r.stackRestore=function(){return(r.stackRestore=r.asm.stackRestore).apply(null,arguments)},r.stackAlloc=function(){return(r.stackAlloc=r.asm.stackAlloc).apply(null,arguments)},r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm.dynCall_jiji).apply(null,arguments)},r.UTF8ToString=function(e,t){return e?m(f,e,t):""},S=function e(){T||R(),T||(S=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return R(),e.ready});e.exports=t}},t={},function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}(770);var e,t};var A4,M4,L4=R4.exports=F4(),B4={exports:{}};B4.exports=(A4={350:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UseOnigurumaFindOptions=t.DebugFlags=void 0,t.DebugFlags={InDebugMode:"undefined"!=typeof process&&!1},t.UseOnigurumaFindOptions=!1},36:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.toOptionalTokenType=t.EncodedTokenAttributes=void 0,(n=t.EncodedTokenAttributes||(t.EncodedTokenAttributes={})).toBinaryStr=function(e){let t=e.toString(2);for(;t.length<32;)t="0"+t;return t},n.print=function(e){const t=n.getLanguageId(e),r=n.getTokenType(e),o=n.getFontStyle(e),a=n.getForeground(e),i=n.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:o,foreground:a,background:i})},n.getLanguageId=function(e){return(255&e)>>>0},n.getTokenType=function(e){return(768&e)>>>8},n.containsBalancedBrackets=function(e){return 0!=(1024&e)},n.getFontStyle=function(e){return(30720&e)>>>11},n.getForeground=function(e){return(16744448&e)>>>15},n.getBackground=function(e){return(4278190080&e)>>>24},n.set=function(e,t,r,o,a,i,s){let l=n.getLanguageId(e),c=n.getTokenType(e),u=n.containsBalancedBrackets(e)?1:0,d=n.getFontStyle(e),f=n.getForeground(e),p=n.getBackground(e);return 0!==t&&(l=t),8!==r&&(c=r),null!==o&&(u=o?1:0),-1!==a&&(d=a),0!==i&&(f=i),0!==s&&(p=s),(l<<0|c<<8|u<<10|d<<11|f<<15|p<<24)>>>0},t.toOptionalTokenType=function(e){return e}},996:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BasicScopeAttributesProvider=t.BasicScopeAttributes=void 0;const r=n(878);class o{constructor(e,t){this.languageId=e,this.tokenType=t}}t.BasicScopeAttributes=o;class a{constructor(e,t){this._getBasicScopeAttributes=new r.CachedFn((e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new o(t,n)})),this._defaultAttributes=new o(e,8),this._embeddedLanguagesMatcher=new i(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return null===e?a._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(a.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}}t.BasicScopeAttributesProvider=a,a._NULL_SCOPE_METADATA=new o(0,0),a.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class i{constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map((([e,t])=>r.escapeRegExpCharacters(e)));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}}},947:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LineTokens=t.BalancedBracketSelectors=t.StateStack=t.AttributedScopeStack=t.Grammar=t.createGrammar=void 0;const r=n(350),o=n(36),a=n(736),i=n(44),s=n(792),l=n(583),c=n(878),u=n(996),d=n(47);function f(e,t,n,r,o){const i=a.createMatchers(t,p),l=s.RuleFactory.getCompiledRuleId(n,r,o.repository);for(const a of i)e.push({debugSelector:t,matcher:a.matcher,ruleId:l,grammar:o,priority:a.priority})}function p(e,t){if(t.length{for(let r=n;rn&&e.substr(0,n)===t&&"."===e[n]}t.createGrammar=function(e,t,n,r,o,a,i,s){return new g(e,t,n,r,o,a,i,s)};class g{constructor(e,t,n,r,o,i,s,l){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=l,this._basicScopeAttributesProvider=new u.BasicScopeAttributesProvider(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=m(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const c of Object.keys(o)){const e=a.createMatchers(c,p);for(const t of e)this._tokenTypeMatchers.push({matcher:t.matcher,type:o[c]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=[],t=this._rootScopeName,n=(e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e))(t);if(n){const r=n.injections;if(r)for(let t in r)f(e,t,r[t],this,n);const o=this._grammarRepository.injections(t);o&&o.forEach((t=>{const n=this.getExternalGrammar(t);if(n){const t=n.injectionSelector;t&&f(e,t,n,this,n)}}))}return e.sort(((e,t)=>e.priority-t.priority)),e}getInjections(){if(null===this._injections&&(this._injections=this._collectInjections(),r.DebugFlags.InDebugMode&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const e of this._injections)console.log(` - ${e.debugSelector}`)}return this._injections}registerRule(e){const t=++this._lastRuleId,n=e(s.ruleIdFromNumber(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[s.ruleIdToNumber(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=m(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){let a;if(-1===this._rootId&&(this._rootId=s.RuleFactory.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository)),t&&t!==v.NULL)a=!1,t.reset();else{a=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=o.EncodedTokenAttributes.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),i=this.getRule(this._rootId).getName(null,null);let s;s=i?b.createRootAndLookUpScopeName(i,r,this):b.createRoot("unknown",r),t=new v(null,this._rootId,-1,-1,!1,null,s,s)}e+="\n";const l=this.createOnigString(e),c=l.content.length,u=new y(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=d._tokenizeString(this,l,a,0,t,u,!0,r);return i.disposeOnigString(l),{lineLength:c,lineTokens:u,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}}function m(e,t){return(e=c.clone(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}t.Grammar=g;class b{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static createRoot(e,t){return new b(null,new l.ScopeStack(null,e),t)}static createRootAndLookUpScopeName(e,t,n){const r=n.getMetadataForScope(e),o=new l.ScopeStack(null,e),a=n.themeProvider.themeMatch(o),i=b.mergeAttributes(t,r,a);return new b(null,o,i)}get scopeName(){return this.scopePath.scopeName}equals(e){return b._equals(this,e)}static _equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let r=-1,a=0,i=0;return null!==n&&(r=n.fontStyle,a=n.foregroundId,i=n.backgroundId),o.EncodedTokenAttributes.set(e,t.languageId,t.tokenType,null,r,a,i)}pushAttributed(e,t){if(null===e)return this;if(-1===e.indexOf(" "))return b._pushAttributed(this,e,t);const n=e.split(/ /g);let r=this;for(const o of n)r=b._pushAttributed(r,o,t);return r}static _pushAttributed(e,t,n){const r=n.getMetadataForScope(t),o=e.scopePath.push(t),a=n.themeProvider.themeMatch(o),i=b.mergeAttributes(e.tokenAttributes,r,a);return new b(e,o,i)}getScopeNames(){return this.scopePath.getSegments()}}t.AttributedScopeStack=b;class v{constructor(e,t,n,r,o,a,i,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=o,this.endRule=a,this.nameScopesList=i,this.contentNameScopesList=s,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}equals(e){return null!==e&&v._equals(this,e)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&e.contentNameScopesList.equals(t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){v._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,n,r,o,a,i){return new v(this,e,t,n,r,o,a,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, TODO-${this.nameScopesList}, TODO-${this.contentNameScopesList})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new v(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}}t.StateStack=v,v.NULL=new v(null,0,0,0,!1,null,null,null),t.BalancedBracketSelectors=class{constructor(e,t){this.allowAny=!1,this.balancedBracketScopes=e.flatMap((e=>"*"===e?(this.allowAny=!0,[]):a.createMatchers(e,p).map((e=>e.matcher)))),this.unbalancedBracketScopes=t.flatMap((e=>a.createMatchers(e,p).map((e=>e.matcher))))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}};class y{constructor(e,t,n,o){this.balancedBracketSelectors=o,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,r.DebugFlags.InDebugMode?this._lineText=t:this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var n;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let a=e.tokenAttributes,i=!1;if((null==(n=this.balancedBracketSelectors)?void 0:n.matchesAlways)&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e.getScopeNames();for(const e of this._tokenTypeOverrides)e.matcher(t)&&(a=o.EncodedTokenAttributes.set(a,0,o.toOptionalTokenType(e.type),null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(t))}if(i&&(a=o.EncodedTokenAttributes.set(a,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a)return void(this._lastTokenEndIndex=t);if(r.DebugFlags.InDebugMode){const n=e.getScopeNames();console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(let e=0;e0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInclude=t.TopLevelRepositoryReference=t.TopLevelReference=t.RelativeReference=t.SelfReference=t.BaseReference=t.ScopeDependencyProcessor=t.ExternalReferenceCollector=t.TopLevelRepositoryRuleReference=t.TopLevelRuleReference=void 0;const r=n(878);class o{constructor(e){this.scopeName=e}toKey(){return this.scopeName}}t.TopLevelRuleReference=o;class a{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}}t.TopLevelRepositoryRuleReference=a;class i{constructor(){this._references=[],this._seenReferenceKeys=new Set,this.visitedRule=new Set}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}}function s(e,t,n,r){const a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof o?c({baseGrammar:i,selfGrammar:a},r):l(e.ruleName,{baseGrammar:i,selfGrammar:a,repository:a.repository},r);const s=n.injections(e.scopeName);if(s)for(const l of s)r.add(new o(l))}function l(e,t,n){t.repository&&t.repository[e]&&u([t.repository[e]],t,n)}function c(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&u(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&u(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function u(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const e=i.repository?r.mergeObjects({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&u(i.patterns,{...t,repository:e},n);const s=i.include;if(!s)continue;const d=m(s);switch(d.kind){case 0:c({...t,selfGrammar:t.baseGrammar},n);break;case 1:c(t,n);break;case 2:l(d.ruleName,{...t,repository:e},n);break;case 3:case 4:const r=d.scopeName===t.selfGrammar.scopeName?t.selfGrammar:d.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){const o={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};4===d.kind?l(d.ruleName,o,n):c(o,n)}else 4===d.kind?n.add(new a(d.scopeName,d.ruleName)):n.add(new o(d.scopeName))}}}t.ExternalReferenceCollector=i,t.ScopeDependencyProcessor=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new o(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new i;for(const n of e)s(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof o){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName))continue;if(this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};class d{constructor(){this.kind=0}}t.BaseReference=d;class f{constructor(){this.kind=1}}t.SelfReference=f;class p{constructor(e){this.ruleName=e,this.kind=2}}t.RelativeReference=p;class h{constructor(e){this.scopeName=e,this.kind=3}}t.TopLevelReference=h;class g{constructor(e,t){this.scopeName=e,this.ruleName=t,this.kind=4}}function m(e){if("$base"===e)return new d;if("$self"===e)return new f;const t=e.indexOf("#");if(-1===t)return new h(e);if(0===t)return new p(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new g(n,r)}}t.TopLevelRepositoryReference=g,t.parseInclude=m},391:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(947),t)},47:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStackElement=t._tokenizeString=void 0;const r=n(350),o=n(44),a=n(792),i=n(878);class s{constructor(e,t){this.stack=e,this.stoppedEarly=t}}function l(e,t,n,o,l,d,p,h){const g=t.content.length;let m=!1,b=-1;if(p){const i=function(e,t,n,o,i,s){let l=i.beginRuleCapturedEOL?0:-1;const c=[];for(let r=i;r;r=r.pop()){const t=r.getRule(e);t instanceof a.BeginWhileRule&&c.push({rule:t,stack:r})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:c,findOptions:p}=u(d.rule,e,d.stack.endRule,n,o===l),h=c.findNextMatchSync(t,o,p);if(r.DebugFlags.InDebugMode&&(console.log(" scanning for while rule"),console.log(c.toString())),!h){r.DebugFlags.InDebugMode&&console.log(" popping "+d.rule.debugName+" - "+d.rule.debugWhileRegExp),i=d.stack.pop();break}if(h.ruleId!==a.whileRuleId){i=d.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(s.produce(d.stack,h.captureIndices[0].start),f(e,t,n,d.stack,s,d.rule.whileCaptures,h.captureIndices),s.produce(d.stack,h.captureIndices[0].end),l=h.captureIndices[0].end,h.captureIndices[0].end>o&&(o=h.captureIndices[0].end,n=!1))}return{stack:i,linePos:o,anchorPosition:l,isFirstLine:n}}(e,t,n,o,l,d);l=i.stack,o=i.linePos,n=i.isFirstLine,b=i.anchorPosition}const v=Date.now();for(;!m;){if(0!==h&&Date.now()-v>h)return new s(l,!0);y()}return new s(l,!1);function y(){r.DebugFlags.InDebugMode&&(console.log(""),console.log(`@@scanNext ${o}: |${t.content.substr(o).replace(/\n$/,"\\n")}|`));const s=function(e,t,n,o,a,s){const l=function(e,t,n,o,a,s){const l=a.getRule(e),{ruleScanner:u,findOptions:d}=c(l,e,a.endRule,n,o===s);let f=0;r.DebugFlags.InDebugMode&&(f=i.performanceNow());const p=u.findNextMatchSync(t,o,d);if(r.DebugFlags.InDebugMode){const e=i.performanceNow()-f;e>5&&console.warn(`Rule ${l.debugName} (${l.id}) matching took ${e} against '${t}'`),console.log(` scanning for (linePos: ${o}, anchorPosition: ${s})`),console.log(u.toString()),p&&console.log(`matched rule id: ${p.ruleId} from ${p.captureIndices[0].start} to ${p.captureIndices[0].end}`)}return p?{captureIndices:p.captureIndices,matchedRuleId:p.ruleId}:null}(e,t,n,o,a,s),u=e.getInjections();if(0===u.length)return l;const d=function(e,t,n,o,a,i,s){let l,u=Number.MAX_VALUE,d=null,f=0;const p=i.contentNameScopesList.getScopeNames();for(let h=0,g=e.length;h=u)&&(u=y,d=v.captureIndices,l=v.ruleId,f=i.priority,u===a))break}return d?{priorityMatch:-1===f,captureIndices:d,matchedRuleId:l}:null}(u,e,t,n,o,a,s);if(!d)return l;if(!l)return d;const f=l.captureIndices[0].start,p=d.captureIndices[0].start;return p0)&&u[0].end>o;if(p===a.endRuleId){const a=l.getRule(e);r.DebugFlags.InDebugMode&&console.log(" popping "+a.debugName+" - "+a.debugEndRegExp),d.produce(l,u[0].start),l=l.withContentNameScopesList(l.nameScopesList),f(e,t,n,l,d,a.endCaptures,u),d.produce(l,u[0].end);const i=l;if(l=l.parent,b=i.getAnchorPos(),!h&&i.getEnterPos()===o)return r.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),l=i,d.produce(l,g),void(m=!0)}else{const i=e.getRule(p);d.produce(l,u[0].start);const s=l,c=i.getName(t.content,u),v=l.contentNameScopesList.pushAttributed(c,e);if(l=l.push(p,o,b,u[0].end===g,null,v,v),i instanceof a.BeginEndRule){const o=i;r.DebugFlags.InDebugMode&&console.log(" pushing "+o.debugName+" - "+o.debugBeginRegExp),f(e,t,n,l,d,o.beginCaptures,u),d.produce(l,u[0].end),b=u[0].end;const a=o.getContentName(t.content,u),c=v.pushAttributed(a,e);if(l=l.withContentNameScopesList(c),o.endHasBackReferences&&(l=l.withEndRule(o.getEndWithResolvedBackReferences(t.content,u))),!h&&s.hasSameRuleAs(l))return r.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),l=l.pop(),d.produce(l,g),void(m=!0)}else if(i instanceof a.BeginWhileRule){const o=i;r.DebugFlags.InDebugMode&&console.log(" pushing "+o.debugName),f(e,t,n,l,d,o.beginCaptures,u),d.produce(l,u[0].end),b=u[0].end;const a=o.getContentName(t.content,u),c=v.pushAttributed(a,e);if(l=l.withContentNameScopesList(c),o.whileHasBackReferences&&(l=l.withEndRule(o.getWhileWithResolvedBackReferences(t.content,u))),!h&&s.hasSameRuleAs(l))return r.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),l=l.pop(),d.produce(l,g),void(m=!0)}else{const o=i;if(r.DebugFlags.InDebugMode&&console.log(" matched "+o.debugName+" - "+o.debugMatchRegExp),f(e,t,n,l,d,o.captures,u),d.produce(l,u[0].end),l=l.pop(),!h)return r.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),l=l.safePop(),d.produce(l,g),void(m=!0)}}u[0].end>o&&(o=u[0].end,n=!1)}}function c(e,t,n,o,a){return r.UseOnigurumaFindOptions?{ruleScanner:e.compile(t,n),findOptions:d(o,a)}:{ruleScanner:e.compileAG(t,n,o,a),findOptions:0}}function u(e,t,n,o,a){return r.UseOnigurumaFindOptions?{ruleScanner:e.compileWhile(t,n),findOptions:d(o,a)}:{ruleScanner:e.compileWhileAG(t,n,o,a),findOptions:0}}function d(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function f(e,t,n,r,a,i,s){if(0===i.length)return;const c=t.content,u=Math.min(i.length,s.length),d=[],f=s[0].end;for(let h=0;hf)break;for(;d.length>0&&d[d.length-1].endPos<=u.start;)a.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?a.produceFromScopes(d[d.length-1].scopes,u.start):a.produce(r,u.start),t.retokenizeCapturedWithRuleId){const i=t.getName(c,s),d=r.contentNameScopesList.pushAttributed(i,e),f=t.getContentName(c,s),p=d.pushAttributed(f,e),h=r.push(t.retokenizeCapturedWithRuleId,u.start,-1,!1,null,d,p),g=e.createOnigString(c.substring(0,u.end));l(e,g,n&&0===u.start,u.start,h,a,!1,0),o.disposeOnigString(g);continue}const g=t.getName(c,s);if(null!==g){const t=(d.length>0?d[d.length-1].scopes:r.contentNameScopesList).pushAttributed(g,e);d.push(new p(t,u.end))}}for(;d.length>0;)a.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}t._tokenizeString=l;class p{constructor(e,t){this.scopes=e,this.endPos=t}}t.LocalStackElement=p},974:(e,t)=>{function n(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}Object.defineProperty(t,"__esModule",{value:!0}),t.parseJSON=void 0,t.parseJSON=function(e,t,i){let s=new r(e),l=new o,c=0,u=null,d=[],f=[];function p(){d.push(c),f.push(u)}function h(){c=d.pop(),u=f.pop()}function g(e){n(s,e)}for(;a(s,l);){if(0===c){if(null!==u&&g("too many constructs in root"),3===l.type){u={},i&&(u.$vscodeTextmateLocation=l.toLocation(t)),p(),c=1;continue}if(2===l.type){u=[],p(),c=4;continue}g("unexpected token in root")}if(2===c){if(5===l.type){h();continue}if(7===l.type){c=3;continue}g("expected , or }")}if(1===c||3===c){if(1===c&&5===l.type){h();continue}if(1===l.type){let e=l.value;if(a(s,l)&&6===l.type||g("expected colon"),a(s,l)||g("expected value"),c=2,1===l.type){u[e]=l.value;continue}if(8===l.type){u[e]=null;continue}if(9===l.type){u[e]=!0;continue}if(10===l.type){u[e]=!1;continue}if(11===l.type){u[e]=parseFloat(l.value);continue}if(2===l.type){let t=[];u[e]=t,p(),c=4,u=t;continue}if(3===l.type){let n={};i&&(n.$vscodeTextmateLocation=l.toLocation(t)),u[e]=n,p(),c=1,u=n;continue}}g("unexpected token in dict")}if(5===c){if(4===l.type){h();continue}if(7===l.type){c=6;continue}g("expected , or ]")}if(4===c||6===c){if(4===c&&4===l.type){h();continue}if(c=5,1===l.type){u.push(l.value);continue}if(8===l.type){u.push(null);continue}if(9===l.type){u.push(!0);continue}if(10===l.type){u.push(!1);continue}if(11===l.type){u.push(parseFloat(l.value));continue}if(2===l.type){let e=[];u.push(e),p(),c=4,u=e;continue}if(3===l.type){let e={};i&&(e.$vscodeTextmateLocation=l.toLocation(t)),u.push(e),p(),c=1,u=e;continue}g("unexpected token in array")}g("unknown state")}return 0!==f.length&&g("unclosed constructs"),u};class r{constructor(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0}}class o{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(e){return{filename:e,line:this.line,char:this.char}}}function a(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;let r,o=e.source,a=e.pos,i=e.len,s=e.line,l=e.char;for(;;){if(a>=i)return!1;if(r=o.charCodeAt(a),32!==r&&9!==r&&13!==r){if(10!==r)break;a++,s++,l=0}else a++,l++}if(t.offset=a,t.line=s,t.char=l,34===r){for(t.type=1,a++,l++;;){if(a>=i)return!1;if(r=o.charCodeAt(a),a++,l++,92!==r){if(34===r)break}else a++,l++}t.value=o.substring(t.offset+1,a-1).replace(/\\u([0-9A-Fa-f]{4})/g,((e,t)=>String.fromCodePoint(parseInt(t,16)))).replace(/\\(.)/g,((t,r)=>{switch(r){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:n(e,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===r)t.type=2,a++,l++;else if(123===r)t.type=3,a++,l++;else if(93===r)t.type=4,a++,l++;else if(125===r)t.type=5,a++,l++;else if(58===r)t.type=6,a++,l++;else if(44===r)t.type=7,a++,l++;else if(110===r){if(t.type=8,a++,l++,r=o.charCodeAt(a),117!==r)return!1;if(a++,l++,r=o.charCodeAt(a),108!==r)return!1;if(a++,l++,r=o.charCodeAt(a),108!==r)return!1;a++,l++}else if(116===r){if(t.type=9,a++,l++,r=o.charCodeAt(a),114!==r)return!1;if(a++,l++,r=o.charCodeAt(a),117!==r)return!1;if(a++,l++,r=o.charCodeAt(a),101!==r)return!1;a++,l++}else if(102===r){if(t.type=10,a++,l++,r=o.charCodeAt(a),97!==r)return!1;if(a++,l++,r=o.charCodeAt(a),108!==r)return!1;if(a++,l++,r=o.charCodeAt(a),115!==r)return!1;if(a++,l++,r=o.charCodeAt(a),101!==r)return!1;a++,l++}else for(t.type=11;;){if(a>=i)return!1;if(r=o.charCodeAt(a),!(46===r||r>=48&&r<=57||101===r||69===r||45===r||43===r))break;a++,l++}return t.len=a-t.offset,null===t.value&&(t.value=o.substr(t.offset,t.len)),e.pos=a,e.line=s,e.char=l,!0}},787:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.parseRawGrammar=t.INITIAL=t.Registry=void 0;const a=n(391),i=n(50),s=n(652),l=n(583),c=n(965);o(n(44),t),t.Registry=class{constructor(e){this._options=e,this._syncRegistry=new s.SyncRegistry(l.Theme.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(l.Theme.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new a.BalancedBracketSelectors(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}async _loadGrammar(e,t,n,r,o){const a=new c.ScopeDependencyProcessor(this._syncRegistry,e);for(;a.Q.length>0;)await Promise.all(a.Q.map((e=>this._loadSingleGrammar(e.scopeName)))),a.processQueue();return this._grammarForScopeName(e,t,n,r,o)}async _loadSingleGrammar(e){return this._ensureGrammarCache.has(e)||this._ensureGrammarCache.set(e,this._doLoadSingleGrammar(e)),this._ensureGrammarCache.get(e)}async _doLoadSingleGrammar(e){const t=await this._options.loadGrammar(e);if(t){const n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}async addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),await this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,o)}},t.INITIAL=a.StateStack.NULL,t.parseRawGrammar=i.parseRawGrammar},736:(e,t)=>{function n(e){return!!e&&!!e.match(/[\w\.:]+/)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMatchers=void 0,t.createMatchers=function(e,t){const r=[],o=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}(e);let a=o.next();for(;null!==a;){let e=0;if(2===a.length&&":"===a.charAt(1)){switch(a.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=o.next()}let t=s();if(r.push({matcher:t,priority:e}),","!==a)break;a=o.next()}return r;function i(){if("-"===a){a=o.next();const e=i();return t=>!!e&&!e(t)}if("("===a){a=o.next();const e=function(){const e=[];let t=s();for(;t&&(e.push(t),"|"===a||","===a);){do{a=o.next()}while("|"===a||","===a);t=s()}return t=>e.some((e=>e(t)))}();return")"===a&&(a=o.next()),e}if(n(a)){const e=[];do{e.push(a),a=o.next()}while(n(a));return n=>t(e,n)}return null}function s(){const e=[];let t=i();for(;t;)e.push(t),t=i();return t=>e.every((e=>e(t)))}}},44:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.disposeOnigString=void 0,t.disposeOnigString=function(e){"function"==typeof e.dispose&&e.dispose()}},50:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseRawGrammar=void 0;const r=n(69),o=n(350),a=n(974);t.parseRawGrammar=function(e,t=null){return null!==t&&/\.json$/.test(t)?(s=e,l=t,o.DebugFlags.InDebugMode?a.parseJSON(s,l,!0):JSON.parse(s)):(n=e,i=t,o.DebugFlags.InDebugMode?r.parseWithLocation(n,i,"$vscodeTextmateLocation"):r.parsePLIST(n));var n,i,s,l}},69:(e,t)=>{function n(e,t,n){const r=e.length;let o=0,a=1,i=0;function s(t){if(null===n)o+=t;else for(;t>0;)10===e.charCodeAt(o)?(o++,a++,i=0):(o++,i++),t--}function l(e){null===n?o=e:s(e-o)}function c(){for(;o0&&65279===e.charCodeAt(0)&&(o=1);let p=0,h=null,g=[],m=[],b=null;function v(e,t){g.push(p),m.push(h),p=e,h=t}function y(){if(0===g.length)return w("illegal state stack");p=g.pop(),h=m.pop()}function w(t){throw new Error("Near offset "+o+": "+t+" ~~~"+e.substr(o,50)+"~~~")}const x=function(){if(null===b)return w("missing ");let e={};null!==n&&(e[n]={filename:t,line:a,char:i}),h[b]=e,b=null,v(1,e)},S=function(){if(null===b)return w("missing ");let e=[];h[b]=e,b=null,v(2,e)},k=function(){let e={};null!==n&&(e[n]={filename:t,line:a,char:i}),h.push(e),v(1,e)},C=function(){let e=[];h.push(e),v(2,e)};function E(){if(1!==p)return w("unexpected ");y()}function O(){return 1===p||2!==p?w("unexpected "):void y()}function D(e){if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function $(e){if(isNaN(e))return w("cannot parse float");if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function j(e){if(isNaN(e))return w("cannot parse integer");if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function N(e){if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function P(e){if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function _(e){if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function I(){let e=f(">"),t=!1;return 47===e.charCodeAt(e.length-1)&&(t=!0,e=e.substring(0,e.length-1)),{name:e.trim(),isClosed:t}}function T(e){if(e.isClosed)return"";let t=f(""),t.replace(/&#([0-9]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,10))})).replace(/&#x([0-9a-f]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/&|<|>|"|'/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return e}))}for(;o=r));){const l=e.charCodeAt(o);if(s(1),60!==l)return w("expected <");if(o>=r)return w("unexpected end of input");const f=e.charCodeAt(o);if(63===f){s(1),d("?>");continue}if(33===f){if(s(1),u("--")){d("--\x3e");continue}d(">");continue}if(47===f){if(s(1),c(),u("plist")){d(">");continue}if(u("dict")){d(">"),E();continue}if(u("array")){d(">"),O();continue}return w("unexpected closed tag")}let g=I();switch(g.name){case"dict":1===p?x():2===p?k():(h={},null!==n&&(h[n]={filename:t,line:a,char:i}),v(1,h)),g.isClosed&&E();continue;case"array":1===p?S():2===p?C():(h=[],v(2,h)),g.isClosed&&O();continue;case"key":F=T(g),1!==p?w("unexpected "):null!==b?w("too many "):b=F;continue;case"string":D(T(g));continue;case"real":$(parseFloat(T(g)));continue;case"integer":j(parseInt(T(g),10));continue;case"date":N(new Date(T(g)));continue;case"data":P(T(g));continue;case"true":T(g),_(!0);continue;case"false":T(g),_(!1);continue}if(!/^plist/.test(g.name))return w("unexpected opened tag "+g.name)}var F;return h}Object.defineProperty(t,"__esModule",{value:!0}),t.parsePLIST=t.parseWithLocation=void 0,t.parseWithLocation=function(e,t,r){return n(e,t,r)},t.parsePLIST=function(e){return n(e,null,null)}},652:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SyncRegistry=void 0;const r=n(391);t.SyncRegistry=class{constructor(e,t){this._onigLibPromise=t,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}async grammarForScopeName(e,t,n,o,a){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,r.createGrammar(e,i,t,n,o,a,this,await this._onigLibPromise))}return this._grammars.get(e)}}},792:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CompiledRule=t.RegExpSourceList=t.RegExpSource=t.RuleFactory=t.BeginWhileRule=t.BeginEndRule=t.IncludeOnlyRule=t.MatchRule=t.CaptureRule=t.Rule=t.ruleIdToNumber=t.ruleIdFromNumber=t.whileRuleId=t.endRuleId=void 0;const r=n(878),o=n(965),a=/\\(\d+)/,i=/\\(\d+)/g;t.endRuleId=-1,t.whileRuleId=-2,t.ruleIdFromNumber=function(e){return e},t.ruleIdToNumber=function(e){return e};class s{constructor(e,t,n,o){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=r.RegexSource.hasCaptures(this._name),this._contentName=o||null,this._contentNameIsCapturing=r.RegexSource.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${r.basename(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?r.RegexSource.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?r.RegexSource.replaceCaptures(this._contentName,e,t):this._contentName}}t.Rule=s;class l extends s{constructor(e,t,n,r,o){super(e,t,n,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}}t.CaptureRule=l;class c extends s{constructor(e,t,n,r,o){super(e,t,n,null),this._match=new h(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new g,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}t.MatchRule=c;class u extends s{constructor(e,t,n,r,o){super(e,t,n,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new g,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}t.IncludeOnlyRule=u;class d extends s{constructor(e,t,n,r,o,a,i,s,l,c){super(e,t,n,r),this._begin=new h(o,this.id),this.beginCaptures=a,this._end=new h(i||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new g;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}}t.BeginEndRule=d;class f extends s{constructor(e,n,r,o,a,i,s,l,c){super(e,n,r,o),this._begin=new h(a,this.id),this.beginCaptures=i,this.whileCaptures=l,this._while=new h(s,t.whileRuleId),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new g;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new g,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}}t.BeginWhileRule=f;class p{static createCaptureRule(e,t,n,r,o){return e.registerRule((e=>new l(t,e,n,r,o)))}static getCompiledRuleId(e,t,n){return e.id||t.registerRule((o=>{if(e.id=o,e.match)return new c(e.$vscodeTextmateLocation,e.id,e.name,e.match,p._compileCaptures(e.captures,t,n));if(void 0===e.begin){e.repository&&(n=r.mergeObjects({},n,e.repository));let o=e.patterns;return void 0===o&&e.include&&(o=[{include:e.include}]),new u(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,p._compilePatterns(o,t,n))}return e.while?new f(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,p._compileCaptures(e.beginCaptures||e.captures,t,n),e.while,p._compileCaptures(e.whileCaptures||e.captures,t,n),p._compilePatterns(e.patterns,t,n)):new d(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,p._compileCaptures(e.beginCaptures||e.captures,t,n),e.end,p._compileCaptures(e.endCaptures||e.captures,t,n),e.applyEndPatternLast,p._compilePatterns(e.patterns,t,n))})),e.id}static _compileCaptures(e,t,n){let r=[];if(e){let o=0;for(const t in e){if("$vscodeTextmateLocation"===t)continue;const e=parseInt(t,10);e>o&&(o=e)}for(let e=0;e<=o;e++)r[e]=null;for(const a in e){if("$vscodeTextmateLocation"===a)continue;const o=parseInt(a,10);let i=0;e[a].patterns&&(i=p.getCompiledRuleId(e[a],t,n)),r[o]=p.createCaptureRule(t,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,i)}}return r}static _compilePatterns(e,t,n){let r=[];if(e)for(let a=0,i=e.length;ae.substring(t.start,t.end)));return i.lastIndex=0,this.source.replace(i,((e,t)=>r.escapeRegExpCharacters(n[parseInt(t,10)]||"")))}_buildAnchorCache(){let e,t,n,r,o=[],a=[],i=[],s=[];for(e=0,t=this.source.length;ee.source));this._cached=new m(e,t,this._items.map((e=>e.ruleId)))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map((e=>e.resolveAnchors(t,n)));return new m(e,r,this._items.map((e=>e.ruleId)))}}t.RegExpSourceList=g;class m{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeTrieElement=t.ThemeTrieElementRule=t.ColorMap=t.fontStyleToString=t.ParsedThemeRule=t.parseTheme=t.StyleAttributes=t.ScopeStack=t.Theme=void 0;const r=n(878);class o{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n,this._cachedMatchRoot=new r.CachedFn((e=>this._root.match(e)))}static createFromRawTheme(e,t){return this.createFromParsedTheme(l(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort(((e,t)=>{let n=r.strcmp(e.scope,t.scope);return 0!==n?n:(n=r.strArrCmp(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)}));let n=0,a="#000000",i="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(a=t.foreground),null!==t.background&&(i=t.background)}let l=new u(t),c=new s(n,l.getId(a),l.getId(i)),p=new f(new d(0,null,-1,0,0),[]);for(let r=0,o=e.length;rfunction(e,t){if(null===t)return!0;let n=0,r=t[n];for(;e;){if(i(e.scopeName,r)){if(n++,n===t.length)return!0;r=t[n]}e=e.parent}return!1}(e.parent,t.parentScopes)));return n?new s(n.fontStyle,n.foreground,n.background):null}}t.Theme=o;class a{constructor(e,t){this.parent=e,this.scopeName=t}static from(...e){let t=null;for(let n=0;n1&&(d=r.slice(0,r.length-1),d.reverse()),n[o++]=new c(i,d,a,s,l,u)}}return n}t.StyleAttributes=s,t.parseTheme=l;class c{constructor(e,t,n,r,o,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=a}}t.ParsedThemeRule=c,t.fontStyleToString=function(e){if(-1===e)return"not set";let t="";return 1&e&&(t+="italic "),2&e&&(t+="bold "),4&e&&(t+="underline "),8&e&&(t+="strikethrough "),""===t&&(t="none"),t.trim()};class u{constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;te?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)}}t.ThemeTrieElementRule=d;class f{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}static _sortBySpecificity(e){return 1===e.length||e.sort(this._cmpBySpecificity),e}static _cmpBySpecificity(e,t){if(e.scopeDepth===t.scopeDepth){const n=e.parentScopes,r=t.parentScopes;let o=null===n?0:n.length,a=null===r?0:r.length;if(o===a)for(let e=0;e{function n(e){return Array.isArray(e)?function(e){let t=[];for(let r=0,o=e.length;r{for(let n in t)e[n]=t[n]})),e},t.basename=function e(t){const n=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===n?t:~n==t.length-1?e(t.substring(0,t.length-1)):t.substr(1+~n)};let r=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;function o(e,t){return et?1:0}t.RegexSource=class{static hasCaptures(e){return null!==e&&(r.lastIndex=0,r.test(e))}static replaceCaptures(e,t,n){return e.replace(r,((e,r,o,a)=>{let i=n[parseInt(r||o,10)];if(!i)return e;{let e=t.substring(i.start,i.end);for(;"."===e[0];)e=e.substring(1);switch(a){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}}))}},t.strcmp=o,t.strArrCmp=function(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e))(Y4||{});class Q4{static toBinaryStr(e){let t=e.toString(2);for(;t.length<32;)t="0"+t;return t}static printMetadata(e){let t=Q4.getLanguageId(e),n=Q4.getTokenType(e),r=Q4.getFontStyle(e),o=Q4.getForeground(e),a=Q4.getBackground(e);console.log({languageId:t,tokenType:n,fontStyle:r,foreground:o,background:a})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static getFontStyle(e){return(14336&e)>>>11}static getForeground(e){return(8372224&e)>>>15}static getBackground(e){return(4286578688&e)>>>24}static containsBalancedBrackets(e){return 0!=(1024&e)}static set(e,t,n,r,o,a){let i=Q4.getLanguageId(e),s=Q4.getTokenType(e),l=Q4.getFontStyle(e),c=Q4.getForeground(e),u=Q4.getBackground(e);return 0!==t&&(i=t),0!==n&&(s=8===n?0:n),-1!==r&&(l=r),0!==o&&(c=o),0!==a&&(u=a),(i<<0|s<<8|l<<11|(Q4.containsBalancedBrackets(e)?1:0)<<10|c<<15|u<<24)>>>0}}function J4(e){return e.endsWith("/")||e.endsWith("\\")?e.slice(0,-1):e}function Z4(e){return e.startsWith("./")?e.slice(2):e}function e6(e){const t=e.split(/[\/\\]/g);return t.slice(0,t.length-1)}function t6(...e){return e.map(J4).map(Z4).join("/")}function n6(e,t=!1){const n=e.length;let r=0,o="",a=0,i=16,s=0,l=0,c=0,u=0,d=0;function f(t,n){let o=0,a=0;for(;o=48&&t<=57)a=16*a+t-48;else if(t>=65&&t<=70)a=16*a+t-65+10;else{if(!(t>=97&&t<=102))break;a=16*a+t-97+10}r++,o++}return o=n)return a=n,i=17;let t=e.charCodeAt(r);if(r6(t)){do{r++,o+=String.fromCharCode(t),t=e.charCodeAt(r)}while(r6(t));return i=15}if(o6(t))return r++,o+=String.fromCharCode(t),13===t&&10===e.charCodeAt(r)&&(r++,o+="\n"),s++,c=r,i=14;switch(t){case 123:return r++,i=1;case 125:return r++,i=2;case 91:return r++,i=3;case 93:return r++,i=4;case 58:return r++,i=6;case 44:return r++,i=5;case 34:return r++,o=function(){let t="",o=r;for(;;){if(r>=n){t+=e.substring(o,r),d=2;break}const a=e.charCodeAt(r);if(34===a){t+=e.substring(o,r),r++;break}if(92!==a){if(a>=0&&a<=31){if(o6(a)){t+=e.substring(o,r),d=2;break}d=6}r++}else{if(t+=e.substring(o,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:const e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}o=r}}return t}(),i=10;case 47:const l=r-1;if(47===e.charCodeAt(r+1)){for(r+=2;rr,scan:t?function(){let e;do{e=p()}while(e>=12&&e<=15);return e}:p,getToken:()=>i,getTokenValue:()=>o,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>l,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function r6(e){return 32===e||9===e}function o6(e){return 10===e||13===e}function a6(e){return e>=48&&e<=57}(U4=W4||(W4={}))[U4.lineFeed=10]="lineFeed",U4[U4.carriageReturn=13]="carriageReturn",U4[U4.space=32]="space",U4[U4._0=48]="_0",U4[U4._1=49]="_1",U4[U4._2=50]="_2",U4[U4._3=51]="_3",U4[U4._4=52]="_4",U4[U4._5=53]="_5",U4[U4._6=54]="_6",U4[U4._7=55]="_7",U4[U4._8=56]="_8",U4[U4._9=57]="_9",U4[U4.a=97]="a",U4[U4.b=98]="b",U4[U4.c=99]="c",U4[U4.d=100]="d",U4[U4.e=101]="e",U4[U4.f=102]="f",U4[U4.g=103]="g",U4[U4.h=104]="h",U4[U4.i=105]="i",U4[U4.j=106]="j",U4[U4.k=107]="k",U4[U4.l=108]="l",U4[U4.m=109]="m",U4[U4.n=110]="n",U4[U4.o=111]="o",U4[U4.p=112]="p",U4[U4.q=113]="q",U4[U4.r=114]="r",U4[U4.s=115]="s",U4[U4.t=116]="t",U4[U4.u=117]="u",U4[U4.v=118]="v",U4[U4.w=119]="w",U4[U4.x=120]="x",U4[U4.y=121]="y",U4[U4.z=122]="z",U4[U4.A=65]="A",U4[U4.B=66]="B",U4[U4.C=67]="C",U4[U4.D=68]="D",U4[U4.E=69]="E",U4[U4.F=70]="F",U4[U4.G=71]="G",U4[U4.H=72]="H",U4[U4.I=73]="I",U4[U4.J=74]="J",U4[U4.K=75]="K",U4[U4.L=76]="L",U4[U4.M=77]="M",U4[U4.N=78]="N",U4[U4.O=79]="O",U4[U4.P=80]="P",U4[U4.Q=81]="Q",U4[U4.R=82]="R",U4[U4.S=83]="S",U4[U4.T=84]="T",U4[U4.U=85]="U",U4[U4.V=86]="V",U4[U4.W=87]="W",U4[U4.X=88]="X",U4[U4.Y=89]="Y",U4[U4.Z=90]="Z",U4[U4.asterisk=42]="asterisk",U4[U4.backslash=92]="backslash",U4[U4.closeBrace=125]="closeBrace",U4[U4.closeBracket=93]="closeBracket",U4[U4.colon=58]="colon",U4[U4.comma=44]="comma",U4[U4.dot=46]="dot",U4[U4.doubleQuote=34]="doubleQuote",U4[U4.minus=45]="minus",U4[U4.openBrace=123]="openBrace",U4[U4.openBracket=91]="openBracket",U4[U4.plus=43]="plus",U4[U4.slash=47]="slash",U4[U4.formFeed=12]="formFeed",U4[U4.tab=9]="tab",(V4||(V4={})).DEFAULT={allowTrailingComma:!1},(q4=G4||(G4={}))[q4.None=0]="None",q4[q4.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",q4[q4.UnexpectedEndOfString=2]="UnexpectedEndOfString",q4[q4.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",q4[q4.InvalidUnicode=4]="InvalidUnicode",q4[q4.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",q4[q4.InvalidCharacter=6]="InvalidCharacter",(K4=X4||(X4={}))[K4.OpenBraceToken=1]="OpenBraceToken",K4[K4.CloseBraceToken=2]="CloseBraceToken",K4[K4.OpenBracketToken=3]="OpenBracketToken",K4[K4.CloseBracketToken=4]="CloseBracketToken",K4[K4.CommaToken=5]="CommaToken",K4[K4.ColonToken=6]="ColonToken",K4[K4.NullKeyword=7]="NullKeyword",K4[K4.TrueKeyword=8]="TrueKeyword",K4[K4.FalseKeyword=9]="FalseKeyword",K4[K4.StringLiteral=10]="StringLiteral",K4[K4.NumericLiteral=11]="NumericLiteral",K4[K4.LineCommentTrivia=12]="LineCommentTrivia",K4[K4.BlockCommentTrivia=13]="BlockCommentTrivia",K4[K4.LineBreakTrivia=14]="LineBreakTrivia",K4[K4.Trivia=15]="Trivia",K4[K4.Unknown=16]="Unknown",K4[K4.EOF=17]="EOF";const i6=function(e,t=[],n=V4.DEFAULT){let r=null,o=[];const a=[];function i(e){Array.isArray(o)?o.push(e):null!==r&&(o[r]=e)}const s={onObjectBegin:()=>{const e={};i(e),a.push(o),o=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{o=a.pop()},onArrayBegin:()=>{const e=[];i(e),a.push(o),o=e,r=null},onArrayEnd:()=>{o=a.pop()},onLiteralValue:i,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}};return function(e,t,n=V4.DEFAULT){const r=n6(e,!1),o=[];function a(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function i(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),(()=>o.slice())):()=>!0}function s(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function l(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),(()=>o.slice())):()=>!0}const c=i(t.onObjectBegin),u=l(t.onObjectProperty),d=a(t.onObjectEnd),f=i(t.onArrayBegin),p=a(t.onArrayEnd),h=l(t.onLiteralValue),g=s(t.onSeparator),m=a(t.onComment),b=s(t.onError),v=n&&n.disallowComments,y=n&&n.allowTrailingComma;function w(){for(;;){const e=r.scan();switch(r.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:v||x(11);break;case 2:x(12);break;case 6:x(16)}switch(e){case 12:case 13:v?x(10):m();break;case 16:x(1);break;case 15:case 14:break;default:return e}}}function x(e,t=[],n=[]){if(b(e),t.length+n.length>0){let e=r.getToken();for(;17!==e;){if(-1!==t.indexOf(e)){w();break}if(-1!==n.indexOf(e))break;e=w()}}}function S(e){const t=r.getTokenValue();return e?h(t):(u(t),o.push(t)),w(),!0}function k(){switch(r.getToken()){case 11:const e=r.getTokenValue();let t=Number(e);isNaN(t)&&(x(2),t=0),h(t);break;case 7:h(null);break;case 8:h(!0);break;case 9:h(!1);break;default:return!1}return w(),!0}function C(){return 10!==r.getToken()?(x(3,[],[2,5]),!1):(S(!1),6===r.getToken()?(g(":"),w(),D()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}function E(){c(),w();let e=!1;for(;2!==r.getToken()&&17!==r.getToken();){if(5===r.getToken()){if(e||x(4,[],[]),g(","),w(),2===r.getToken()&&y)break}else e&&x(6,[],[]);C()||x(4,[],[2,5]),e=!0}return d(),2!==r.getToken()?x(7,[2],[]):w(),!0}function O(){f(),w();let e=!0,t=!1;for(;4!==r.getToken()&&17!==r.getToken();){if(5===r.getToken()){if(t||x(4,[],[]),g(","),w(),4===r.getToken()&&y)break}else t&&x(6,[],[]);e?(o.push(0),e=!1):o[o.length-1]++,D()||x(4,[],[4,5]),t=!0}return p(),e||o.pop(),4!==r.getToken()?x(8,[4],[]):w(),!0}function D(){switch(r.getToken()){case 3:return O();case 1:return E();case 10:return S(!0);default:return k()}}if(w(),17===r.getToken())return!!n.allowEmptyContent||(x(4,[],[]),!1);if(!D())return x(4,[],[]),!1;17!==r.getToken()&&x(9,[],[])}(e,s,n),o[0]};var s6,l6;(l6=s6||(s6={}))[l6.InvalidSymbol=1]="InvalidSymbol",l6[l6.InvalidNumberFormat=2]="InvalidNumberFormat",l6[l6.PropertyNameExpected=3]="PropertyNameExpected",l6[l6.ValueExpected=4]="ValueExpected",l6[l6.ColonExpected=5]="ColonExpected",l6[l6.CommaExpected=6]="CommaExpected",l6[l6.CloseBraceExpected=7]="CloseBraceExpected",l6[l6.CloseBracketExpected=8]="CloseBracketExpected",l6[l6.EndOfFileExpected=9]="EndOfFileExpected",l6[l6.InvalidCommentToken=10]="InvalidCommentToken",l6[l6.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",l6[l6.UnexpectedEndOfString=12]="UnexpectedEndOfString",l6[l6.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",l6[l6.InvalidUnicode=14]="InvalidUnicode",l6[l6.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",l6[l6.InvalidCharacter=16]="InvalidCharacter","process"in globalThis&&"undefined"!=typeof process&&void 0!==process.release&&process.release.name;let c6="";const u6="dist/";let d6=null;function f6(e){return`${c6}${e}`}async function p6(e){const t=[],n=await async function(e){const t=f6(e);return await(globalThis.__shiki_fetch__||globalThis.fetch)(t).then((e=>e.text()))}(e);let r;try{r=JSON.parse(n)}catch(A4){if(r=i6(n,t,{allowTrailingComma:!0}),t.length)throw t[0]}return r}async function h6(e){const t=g6(await p6(e));if(t.include){const n=await h6(t6(...e6(e),t.include));n.settings&&(t.settings=n.settings.concat(t.settings)),n.bg&&!t.bg&&(t.bg=n.bg),n.colors&&(t.colors={...n.colors,...t.colors}),delete t.include}return t}function g6(e){const t=e.type||"dark",n={name:e.name,type:t,...e,...v6(e)};var r;return e.include&&(n.include=e.include),e.tokenColors&&(n.settings=e.tokenColors,delete n.tokenColors),(r=n).settings||(r.settings=[]),r.settings[0]&&r.settings[0].settings&&!r.settings[0].scope||r.settings.unshift({settings:{foreground:r.fg,background:r.bg}}),n}const m6={light:"#333333",dark:"#bbbbbb"},b6={light:"#fffffe",dark:"#1e1e1e"};function v6(e){var t,n,r,o;let a,i,s=e.settings?e.settings:e.tokenColors;const l=s?s.find((e=>!e.name&&!e.scope)):void 0;return(null==(t=null==l?void 0:l.settings)?void 0:t.foreground)&&(a=l.settings.foreground),(null==(n=null==l?void 0:l.settings)?void 0:n.background)&&(i=l.settings.background),!a&&(null==(r=null==e?void 0:e.colors)?void 0:r["editor.foreground"])&&(a=e.colors["editor.foreground"]),!i&&(null==(o=null==e?void 0:e.colors)?void 0:o["editor.background"])&&(i=e.colors["editor.background"]),a||(a="light"===e.type?m6.light:m6.dark),i||(i="light"===e.type?b6.light:b6.dark),{fg:a,bg:i}}class y6{constructor(e,t){this.languagesPath="languages/",this.languageMap={},this.scopeToLangMap={},this._onigLibPromise=e,this._onigLibName=t}get onigLib(){return this._onigLibPromise}getOnigLibName(){return this._onigLibName}getLangRegistration(e){return this.languageMap[e]}async loadGrammar(e){const t=this.scopeToLangMap[e];if(!t)return null;if(t.grammar)return t.grammar;const n=await async function(e){return await p6(e)}(H4.includes(t)?`${this.languagesPath}${t.path}`:t.path);return t.grammar=n,n}addLanguage(e){this.languageMap[e.id]=e,e.aliases&&e.aliases.forEach((t=>{this.languageMap[t]=e})),this.scopeToLangMap[e.scopeName]=e}}function w6(e,t){let n=[];for(let r=0,o=t.length;r=0&&a>=0;)x6(t[o],r[a])&&o--,a--;return-1===o}function k6(e,t,n){let r=[],o=0;for(let a=0,i=e.settings.length;ae.trim()));else{if(!Array.isArray(s.scope))continue;i=s.scope}for(let e=0,a=i.length;eNumber.parseInt(e)));if(3!==t.length||t.some((e=>Number.isNaN(e))))return;return{type:"rgb",rgb:t}}if("5"===t){const t=e.shift();if(t)return{type:"table",index:Number(t)}}}function $6(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(0===r)t.push({type:"resetAll"});else if(r<=9){E6[r]&&t.push({type:"setDecoration",value:E6[r]})}else if(r<=29){const e=E6[r-20];e&&t.push({type:"resetDecoration",value:e})}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:C6[r-30]}});else if(38===r){const n=D6(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===r)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:C6[r-40]}});else if(48===r){const n=D6(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===r?t.push({type:"resetBackgroundColor"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:C6[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:C6[r-100+8]}})}return t}var j6={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function N6(e=j6){function t(t){return e[t]}function n(e){return`#${e.map((e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0"))).join("")}`}let r;function o(e){return function(){if(r)return r;r=[];for(let n=0;n[t,e.colors[`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`]])))),o=function(){let e=null,t=null,n=new Set;return{parse(r){const o=[];let a=0;do{const i=O6(r,a),s=i.sequence?r.substring(a,i.startPosition):r.substring(a);if(s.length>0&&o.push({value:s,foreground:e,background:t,decorations:new Set(n)}),i.sequence){const r=$6(i.sequence);for(const o of r)"resetAll"===o.type?(e=null,t=null,n.clear()):"resetForegroundColor"===o.type?e=null:"resetBackgroundColor"===o.type?t=null:"resetDecoration"===o.type&&n.delete(o.value);for(const o of r)"setForegroundColor"===o.type?e=o.value:"setBackgroundColor"===o.type?t=o.value:"setDecoration"===o.type&&n.add(o.value)}a=i.position}while(ao.parse(t).map((t=>{let n;n=t.decorations.has("reverse")?t.background?r.value(t.background):e.bg:t.foreground?r.value(t.foreground):e.fg,t.decorations.has("dim")&&(n=function(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t){if(t[3]){const e=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${e}`}return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map((e=>`${e}${e}`)).join("")}80`}const n=e.match(/var\((--shiki-color-ansi-[\w-]+)\)/);if(n)return`var(${n[1]}-dim)`;return e}(n));let o=Y4.None;return t.decorations.has("bold")&&(o|=Y4.Bold),t.decorations.has("italic")&&(o|=Y4.Italic),t.decorations.has("underline")&&(o|=Y4.Underline),{content:t.value,color:n,fontStyle:o}}))))}const _6={pre:({className:e,style:t,children:n})=>`
${n}
`,code:({children:e})=>`${e}`,line:({className:e,children:t})=>`${t}`,token:({style:e,children:t})=>`${t}`};function I6(e,t={}){const n=t.bg||"#fff",r=function(e,t){const n=new Map;for(const r of e){const e=t(r);n.has(e)?n.get(e).push(r):n.set(e,[r])}return n}(t.lineOptions??[],(e=>e.line)),o=t.elements||{};function a(e="",t={},n){const r=o[e]||_6[e];return r?(n=n.filter(Boolean),r({...t,children:"code"===e?n.join("\n"):n.join("")})):""}return a("pre",{className:"shiki "+(t.themeName||""),style:`background-color: ${n}`},[t.langId?`
${t.langId}
`:"",a("code",{},e.map(((n,o)=>{const i=o+1,s=function(e){const t=new Set(["line"]);for(const n of e)for(const e of n.classes??[])t.add(e);return Array.from(t)}(r.get(i)??[]).join(" ");return a("line",{className:s,lines:e,line:n,index:o},n.map(((e,r)=>{const o=[`color: ${e.color||t.fg}`];return e.fontStyle&Y4.Italic&&o.push("font-style: italic"),e.fontStyle&Y4.Bold&&o.push("font-weight: bold"),e.fontStyle&Y4.Underline&&o.push("text-decoration: underline"),a("token",{style:o.join("; "),tokens:n,token:e,index:r},[(i=e.content,i.replace(/[&<>"']/g,(e=>T6[e])))]);var i})))})))])}const T6={"&":"&","<":"<",">":">",'"':""","'":"'"};class F6 extends z4.Registry{constructor(e){super(e),this._resolver=e,this.themesPath="themes/",this._resolvedThemes={},this._resolvedGrammars={},this._langGraph=new Map,this._langMap=H4.reduce(((e,t)=>(e[t.id]=t,e)),{})}getTheme(e){return"string"==typeof e?this._resolvedThemes[e]:e}async loadTheme(e){return"string"==typeof e?(this._resolvedThemes[e]||(this._resolvedThemes[e]=await h6(`${this.themesPath}${e}.json`)),this._resolvedThemes[e]):((e=g6(e)).name&&(this._resolvedThemes[e.name]=e),e)}async loadThemes(e){return await Promise.all(e.map((e=>this.loadTheme(e))))}getLoadedThemes(){return Object.keys(this._resolvedThemes)}getGrammar(e){return this._resolvedGrammars[e]}async loadLanguage(e){var t;const n={embeddedLanguages:null==(t=e.embeddedLangs)?void 0:t.reduce((async(e,t,n)=>{if(!this.getLoadedLanguages().includes(t)&&this._resolver.getLangRegistration(t))return await this._resolver.loadGrammar(this._resolver.getLangRegistration(t).scopeName),e[this._resolver.getLangRegistration(t).scopeName]=n+2,e}),{}),balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]},r=await this.loadGrammarWithConfiguration(e.scopeName,1,n);this._resolvedGrammars[e.id]=r,e.aliases&&e.aliases.forEach((e=>{this._resolvedGrammars[e]=r}))}async loadLanguages(e){for(const n of e)this.resolveEmbeddedLanguages(n);const t=Array.from(this._langGraph.values());for(const n of t)this._resolver.addLanguage(n);for(const n of t)await this.loadLanguage(n)}getLoadedLanguages(){return Object.keys(this._resolvedGrammars)}resolveEmbeddedLanguages(e){if(this._langGraph.has(e.id)||this._langGraph.set(e.id,e),e.embeddedLangs)for(const t of e.embeddedLangs)this._langGraph.set(t,this._langMap[t])}}function R6(e){return"string"==typeof e?H4.find((t=>{var n;return t.id===e||(null==(n=t.aliases)?void 0:n.includes(e))})):e}async function A6(e){var t,n;const{_languages:r,_themes:o,_wasmPath:a}=function(e){var t;let n=H4,r=e.themes||[],o=(null==(t=e.paths)?void 0:t.wasm)?e.paths.wasm.endsWith("/")?e.paths.wasm:e.paths.wasm+"/":u6;return e.langs&&(n=e.langs.map(R6)),e.theme&&r.unshift(e.theme),r.length||(r=["nord"]),{_languages:n,_themes:r,_wasmPath:o}}(e),i=new y6(async function(e){if(!d6){let t;t=L4.loadWASM({data:await(globalThis.__shiki_fetch__||globalThis.fetch)(f6(t6(...e6(e),"onig.wasm")))}),d6=t.then((()=>({createOnigScanner:e=>L4.createOnigScanner(e),createOnigString:e=>L4.createOnigString(e)})))}return d6}(a),"vscode-oniguruma"),s=new F6(i);(null==(t=e.paths)?void 0:t.themes)&&(s.themesPath=e.paths.themes.endsWith("/")?e.paths.themes:e.paths.themes+"/"),(null==(n=e.paths)?void 0:n.languages)&&(i.languagesPath=e.paths.languages.endsWith("/")?e.paths.languages:e.paths.languages+"/");const l=(await s.loadThemes(o))[0];let c;await s.loadLanguages(r);let u=function(){const e={"#000001":"var(--shiki-color-text)","#000002":"var(--shiki-color-background)","#000004":"var(--shiki-token-constant)","#000005":"var(--shiki-token-string)","#000006":"var(--shiki-token-comment)","#000007":"var(--shiki-token-keyword)","#000008":"var(--shiki-token-parameter)","#000009":"var(--shiki-token-function)","#000010":"var(--shiki-token-string-expression)","#000011":"var(--shiki-token-punctuation)","#000012":"var(--shiki-token-link)"};for(let t=0;t{e.colors[t]=u[n]||n})),t.forEach(((e,n)=>{t[n]=u[e]||e}))}(t,n),{_theme:t,_colorMap:n}}function f(e,t="text",n,r={includeExplanation:!0}){if(function(e){return!e||["plaintext","txt","text"].includes(e)}(t)){return[...e.split(/\r\n|\r|\n/).map((e=>[{content:e}]))]}const{_grammar:o}=function(e){const t=s.getGrammar(e);if(!t)throw Error(`No language registration for ${e}`);return{_grammar:t}}(t),{_theme:a,_colorMap:i}=d(n);return function(e,t,n,r,o){let a=n.split(/\r\n|\r|\n/),i=z4.INITIAL,s=[],l=[];for(let c=0,u=a.length;cd(e)._theme,loadTheme:async function(e){await s.loadTheme(e)},loadLanguage:async function(e){const t=R6(e);i.addLanguage(t),await s.loadLanguage(t)},getBackgroundColor:function(e){const{_theme:t}=d(e);return t.bg},getForegroundColor:function(e){const{_theme:t}=d(e);return t.fg},getLoadedThemes:function(){return s.getLoadedThemes()},getLoadedLanguages:function(){return s.getLoadedLanguages()},setColorReplacements:function(e){u=e}}}var M6;c6=(M6="https://cdn.jsdelivr.net/npm/shiki-es@0.14.0/dist/assets/").endsWith("/")?M6:M6+"/";const L6=Q1(((e,t)=>({codeToHtml:(e,n,r)=>{const{highlighter:o}=t();if(!o)return"";try{return null==o?void 0:o.codeToHtml(e,{lang:n,theme:r?"dark":"light"})}catch{return e}},highlighter:void 0,initHighlighter:async n=>{if(!t().highlighter){const t=await A6({langs:null==n?void 0:n.langs,themes:null==n?void 0:n.themes});e({highlighter:t})}}})),T1),B6=z.memo((({children:e,language:t,options:n})=>{const{styles:r}=T4(),{isDarkMode:o}=tB(),[a,i]=L6((e=>[e.codeToHtml,!e.highlighter]));return z.useEffect((()=>{L6.getState().initHighlighter(n)}),[n]),Q.jsxs(Q.Fragment,{children:[i?Q.jsx("code",{children:e}):Q.jsx("div",{className:r.shiki,dangerouslySetInnerHTML:{__html:a(e,t,o)||""}}),i&&Q.jsxs(qH,{className:r.loading,gap:8,horizontal:!0,children:[Q.jsx(QB,{icon:Bd,spin:!0}),"Highlighting..."]})]})})),z6=e=>{const t=e?"dark":"light",n=e?fK.yellow[t][9]:fK.gold[t][10],r=e?fK.gold[t][9]:fK.orange[t][10],o=e?fK.volcano[t][10]:fK.volcano[t][8],a=e?fK.lime[t][9]:fK.green[t][10],i=e?fK.blue[t][9]:fK.geekblue[t][9],s=e?fK.purple[t][11]:fK.purple[t][8];return{colors:{"editor.foreground":a},name:t,tokenColors:[{scope:"comma",settings:{foreground:a}},{scope:"func",settings:{foreground:s}},{scope:["and","break"],settings:{foreground:i}},{scope:"bracket",settings:{foreground:s}},{scope:"model-type",settings:{fontStyle:"italic",foreground:o}},{scope:"model-name",settings:{foreground:r}},{scope:"model-bracket",settings:{foreground:s}},{scope:"number",settings:{foreground:s}},{scope:"wildcards",settings:{foreground:n}}],type:t}},H6={langs:[{aliases:["prompt"],grammar:{$schema:"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",fileTypes:["prompt"],name:"prompt",patterns:[{match:"[,]",name:"comma"},{match:"[:|]",name:"func"},{match:"AND",name:"and"},{match:"BREAK",name:"break"},{match:"<([^:]+):([^:]+):([^>]+)>",captures:{0:{name:"model-bracket"},1:{name:"model-type"},2:{name:"model-name"},3:{name:"number"}}},{match:"[<|>]",name:"model-bracket"},{match:"[(|)|\\[|\\]|{|}]",name:"bracket"},{match:"(?{const t=z.useRef(null),[n,r]=z.useState(""),{styles:o,theme:a}=T4(),i=(e=>{const[t,n]=z.useState("");return z.useEffect((()=>{const t={attributes:!0,characterData:!0,childList:!0,subtree:!0},r=new MutationObserver((t=>{for(const r of t)if("attributes"===r.type){const t=document.querySelector(e);n(t.value)}})),o=document.querySelector(e);return o&&(r.observe(o,t),n(o.value)),()=>{r.disconnect()}}),[e]),t})(`${e} label textarea`),s=z.useMemo((()=>gradioApp().querySelector(`${e} label textarea`)),[e]),l=(c=s,u=ZW(DX((function(){var e=DU(c);return e?{width:e.clientWidth,height:e.clientHeight}:void 0})),2),d=u[0],f=u[1],jX((function(){var e=DU(c);if(e){var t=new Ib((function(e){e.forEach((function(e){var t=e.target,n=t.clientWidth,r=t.clientHeight;f({width:n,height:r})}))}));return t.observe(e),function(){t.disconnect()}}}),[],c),d);var c,u,d,f;const p=function(e,t){void 0===t&&(t=function(){return!0});var n=ZW(DX(),2),r=n[0],o=n[1],a=nU(t);return jU((function(){var t=DU(e,document);if(t){var n=function(){var e;e=t===document?document.scrollingElement?{left:document.scrollingElement.scrollLeft,top:document.scrollingElement.scrollTop}:{left:Math.max(window.pageXOffset,document.documentElement.scrollLeft,document.body.scrollLeft),top:Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop)}:{left:t.scrollLeft,top:t.scrollTop},a.current(e)&&o(e)};return n(),t.addEventListener("scroll",n),function(){t.removeEventListener("scroll",n)}}}),[],e),r}(s),h=z.useCallback((e=>{r(e.target.value)}),[]),g=z.useCallback((()=>s.clientHeight{t.current.scroll(0,(null==p?void 0:p.top)||0)}),[null==p?void 0:p.top]),z.useEffect((()=>(s.addEventListener("change",h),()=>{s.removeEventListener("change",h)})),[]),z.useEffect((()=>{a&&(s.style.color="transparent",s.style.caretColor=a.colorSuccess)}),[a]),z.useEffect((()=>{r(i)}),[i]),Q.jsx("div",{className:o.container,"data-code-type":"highlighter",ref:t,style:{height:null==l?void 0:l.height,width:g()},children:Q.jsx(B6,{language:"prompt",options:H6,children:n.trim()})})})),U6=z.memo((({parentId:e})=>{const t=o4((e=>e.loading));return Q.jsx(I4,{children:!1===t&&Q.jsx(W6,{parentId:e})})})),V6=(e,t)=>{if(document.querySelector(t))return;const n=document.createElement("div");n.id=t.replace("#",""),gradioApp().querySelector(e).insertBefore(n,gradioApp().querySelector(e).firstChild),xd(n).render(Q.jsx(z.StrictMode,{children:Q.jsx(z.Suspense,{fallback:"loading...",children:Q.jsx(U6,{parentId:e})})}))}; + `)}}));"undefined"!=typeof globalThis?globalThis:void 0!=={}||("undefined"!=typeof global?global:"undefined"!=typeof self&&self);var F4,R4={exports:{}};F4=()=>{return e={770:function(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.setDefaultDebugCall=t.createOnigScanner=t.createOnigString=t.loadWASM=t.OnigScanner=t.OnigString=void 0;const o=r(n(418));let a=null,i=!1;class s{static _utf8ByteLength(e){let t=0;for(let n=0,r=e.length;n=55296&&o<=56319&&n+1=56320&&t<=57343&&(a=65536+(o-55296<<10)|t-56320,i=!0)}t+=a<=127?1:a<=2047?2:a<=65535?3:4,i&&n++}return t}constructor(e){const t=e.length,n=s._utf8ByteLength(e),r=n!==t,o=r?new Uint32Array(t+1):null;r&&(o[t]=n);const a=r?new Uint32Array(n+1):null;r&&(a[n]=t);const i=new Uint8Array(n);let l=0;for(let s=0;s=55296&&n<=56319&&s+1=56320&&t<=57343&&(c=65536+(n-55296<<10)|t-56320,u=!0)}r&&(o[s]=l,u&&(o[s+1]=l),c<=127?a[l+0]=s:c<=2047?(a[l+0]=s,a[l+1]=s):c<=65535?(a[l+0]=s,a[l+1]=s,a[l+2]=s):(a[l+0]=s,a[l+1]=s,a[l+2]=s,a[l+3]=s)),c<=127?i[l++]=c:c<=2047?(i[l++]=192|(1984&c)>>>6,i[l++]=128|(63&c)>>>0):c<=65535?(i[l++]=224|(61440&c)>>>12,i[l++]=128|(4032&c)>>>6,i[l++]=128|(63&c)>>>0):(i[l++]=240|(1835008&c)>>>18,i[l++]=128|(258048&c)>>>12,i[l++]=128|(4032&c)>>>6,i[l++]=128|(63&c)>>>0),u&&s++}this.utf16Length=t,this.utf8Length=n,this.utf16Value=e,this.utf8Value=i,this.utf16OffsetToUtf8=o,this.utf8OffsetToUtf16=a}createString(e){const t=e._omalloc(this.utf8Length);return e.HEAPU8.set(this.utf8Value,t),t}}class l{constructor(e){if(this.id=++l.LAST_ID,!a)throw new Error("Must invoke loadWASM first.");this._onigBinding=a,this.content=e;const t=new s(e);this.utf16Length=t.utf16Length,this.utf8Length=t.utf8Length,this.utf16OffsetToUtf8=t.utf16OffsetToUtf8,this.utf8OffsetToUtf16=t.utf8OffsetToUtf16,this.utf8Length<1e4&&!l._sharedPtrInUse?(l._sharedPtr||(l._sharedPtr=a._omalloc(1e4)),l._sharedPtrInUse=!0,a.HEAPU8.set(t.utf8Value,l._sharedPtr),this.ptr=l._sharedPtr):this.ptr=t.createString(a)}convertUtf8OffsetToUtf16(e){return this.utf8OffsetToUtf16?e<0?0:e>this.utf8Length?this.utf16Length:this.utf8OffsetToUtf16[e]:e}convertUtf16OffsetToUtf8(e){return this.utf16OffsetToUtf8?e<0?0:e>this.utf16Length?this.utf8Length:this.utf16OffsetToUtf8[e]:e}dispose(){this.ptr===l._sharedPtr?l._sharedPtrInUse=!1:this._onigBinding._ofree(this.ptr)}}t.OnigString=l,l.LAST_ID=0,l._sharedPtr=0,l._sharedPtrInUse=!1;class c{constructor(e){if(!a)throw new Error("Must invoke loadWASM first.");const t=[],n=[];for(let l=0,c=e.length;lWebAssembly.instantiateStreaming(e,t)}(r):function(e){return async t=>{const n=await e.arrayBuffer();return WebAssembly.instantiate(n,t)}}(r):function(e){return t=>WebAssembly.instantiate(e,t)}(r)}return d=new Promise(((e,t)=>{r=e,i=t})),function(e,t,n,r){(0,o.default)({print:t,instantiateWasm:(t,n)=>{if("undefined"==typeof performance){const e=()=>Date.now();t.env.emscripten_get_now=e,t.wasi_snapshot_preview1.emscripten_get_now=e}return e(t).then((e=>n(e.instance)),r),{}}}).then((e=>{a=e,n()}))}(t,n,r,i),d},t.createOnigString=function(e){return new l(e)},t.createOnigScanner=function(e){return new c(e)},t.setDefaultDebugCall=function(e){i=e}},418:e=>{var t=("undefined"!=typeof document&&document.currentScript&&document.currentScript.src,function(e){var t,n,r=void 0!==(e=e||{})?e:{};r.ready=new Promise((function(e,r){t=e,n=r}));var o,a=Object.assign({},r),i=!1;o=function(e){let t;return"function"==typeof readbuffer?new Uint8Array(readbuffer(e)):(t=read(e,"binary"),function(e,t){e||k(t)}("object"==typeof t),t)},"undefined"!=typeof scriptArgs&&scriptArgs,"undefined"!=typeof onig_print&&("undefined"==typeof console&&(console={}),console.log=onig_print,console.warn=console.error="undefined"!=typeof printErr?printErr:onig_print);var s,l,c=r.print||console.log.bind(console),u=r.printErr||console.warn.bind(console);Object.assign(r,a),a=null,r.arguments&&r.arguments,r.thisProgram&&r.thisProgram,r.quit&&r.quit,r.wasmBinary&&(s=r.wasmBinary),r.noExitRuntime,"object"!=typeof WebAssembly&&k("no native wasm support detected");var d,f,p,h=!1,g="undefined"!=typeof TextDecoder?new TextDecoder("utf8"):void 0;function m(e,t,n){for(var r=t+n,o=t;e[o]&&!(o>=r);)++o;if(o-t>16&&e.buffer&&g)return g.decode(e.subarray(t,o));for(var a="";t>10,56320|1023&c)}}else a+=String.fromCharCode((31&i)<<6|s)}else a+=String.fromCharCode(i)}return a}function b(e){d=e,r.HEAP8=new Int8Array(e),r.HEAP16=new Int16Array(e),r.HEAP32=new Int32Array(e),r.HEAPU8=f=new Uint8Array(e),r.HEAPU16=new Uint16Array(e),r.HEAPU32=p=new Uint32Array(e),r.HEAPF32=new Float32Array(e),r.HEAPF64=new Float64Array(e)}r.INITIAL_MEMORY;var v=[],y=[],w=[],x=0,S=null;function k(e){r.onAbort&&r.onAbort(e),u(e="Aborted("+e+")"),h=!0,e+=". Build with -sASSERTIONS for more info.";var t=new WebAssembly.RuntimeError(e);throw n(t),t}var C,E,O,D="data:application/octet-stream;base64,";function $(e){return e.startsWith(D)}function j(e){try{if(e==C&&s)return new Uint8Array(s);if(o)return o(e);throw"both async and sync fetching of the wasm failed"}catch(t){k(t)}}function N(e){for(;e.length>0;)e.shift()(r)}function P(e){try{return l.grow(e-d.byteLength+65535>>>16),b(l.buffer),1}catch(t){}}$(C="onig.wasm")||(O=C,C=r.locateFile?r.locateFile(O,""):""+O),E="undefined"!=typeof dateNow?dateNow:()=>performance.now();var _=[null,[],[]];function I(e,t){var n=_[e];0===t||10===t?((1===e?c:u)(m(n,0)),n.length=0):n.push(t)}var T,F={emscripten_get_now:E,emscripten_memcpy_big:function(e,t,n){f.copyWithin(e,t,t+n)},emscripten_resize_heap:function(e){var t,n=f.length,r=2147483648;if((e>>>=0)>r)return!1;for(var o=1;o<=4;o*=2){var a=n*(1+.2/o);if(a=Math.min(a,e+100663296),P(Math.min(r,(t=Math.max(e,a))+(65536-t%65536)%65536)))return!0}return!1},fd_write:function(e,t,n,r){for(var o=0,a=0;a>2],s=p[t+4>>2];t+=8;for(var l=0;l>2]=o,0}};function R(e){function n(){T||(T=!0,r.calledRun=!0,h||(N(y),t(r),r.onRuntimeInitialized&&r.onRuntimeInitialized(),function(){if(r.postRun)for("function"==typeof r.postRun&&(r.postRun=[r.postRun]);r.postRun.length;)e=r.postRun.shift(),w.unshift(e);var e;N(w)}()))}x>0||(function(){if(r.preRun)for("function"==typeof r.preRun&&(r.preRun=[r.preRun]);r.preRun.length;)e=r.preRun.shift(),v.unshift(e);var e;N(v)}(),x>0||(r.setStatus?(r.setStatus("Running..."),setTimeout((function(){setTimeout((function(){r.setStatus("")}),1),n()}),1)):n()))}if(function(){var e={env:F,wasi_snapshot_preview1:F};function t(e,t){var n=e.exports;r.asm=n,b((l=r.asm.memory).buffer),r.asm.__indirect_function_table,function(e){y.unshift(e)}(r.asm.__wasm_call_ctors),function(e){if(x--,r.monitorRunDependencies&&r.monitorRunDependencies(x),0==x&&S){var t=S;S=null,t()}}()}function o(e){t(e.instance)}function a(t){return(s||!i||"function"!=typeof fetch?Promise.resolve().then((function(){return j(C)})):fetch(C,{credentials:"same-origin"}).then((function(e){if(!e.ok)throw"failed to load wasm binary file at '"+C+"'";return e.arrayBuffer()})).catch((function(){return j(C)}))).then((function(t){return WebAssembly.instantiate(t,e)})).then((function(e){return e})).then(t,(function(e){u("failed to asynchronously prepare wasm: "+e),k(e)}))}if(x++,r.monitorRunDependencies&&r.monitorRunDependencies(x),r.instantiateWasm)try{return r.instantiateWasm(e,t)}catch(c){u("Module.instantiateWasm callback failed with error: "+c),n(c)}(s||"function"!=typeof WebAssembly.instantiateStreaming||$(C)||"function"!=typeof fetch?a(o):fetch(C,{credentials:"same-origin"}).then((function(t){return WebAssembly.instantiateStreaming(t,e).then(o,(function(e){return u("wasm streaming compile failed: "+e),u("falling back to ArrayBuffer instantiation"),a(o)}))}))).catch(n)}(),r.___wasm_call_ctors=function(){return(r.___wasm_call_ctors=r.asm.__wasm_call_ctors).apply(null,arguments)},r.___errno_location=function(){return(r.___errno_location=r.asm.__errno_location).apply(null,arguments)},r._omalloc=function(){return(r._omalloc=r.asm.omalloc).apply(null,arguments)},r._ofree=function(){return(r._ofree=r.asm.ofree).apply(null,arguments)},r._getLastOnigError=function(){return(r._getLastOnigError=r.asm.getLastOnigError).apply(null,arguments)},r._createOnigScanner=function(){return(r._createOnigScanner=r.asm.createOnigScanner).apply(null,arguments)},r._freeOnigScanner=function(){return(r._freeOnigScanner=r.asm.freeOnigScanner).apply(null,arguments)},r._findNextOnigScannerMatch=function(){return(r._findNextOnigScannerMatch=r.asm.findNextOnigScannerMatch).apply(null,arguments)},r._findNextOnigScannerMatchDbg=function(){return(r._findNextOnigScannerMatchDbg=r.asm.findNextOnigScannerMatchDbg).apply(null,arguments)},r.stackSave=function(){return(r.stackSave=r.asm.stackSave).apply(null,arguments)},r.stackRestore=function(){return(r.stackRestore=r.asm.stackRestore).apply(null,arguments)},r.stackAlloc=function(){return(r.stackAlloc=r.asm.stackAlloc).apply(null,arguments)},r.dynCall_jiji=function(){return(r.dynCall_jiji=r.asm.dynCall_jiji).apply(null,arguments)},r.UTF8ToString=function(e,t){return e?m(f,e,t):""},S=function e(){T||R(),T||(S=e)},r.preInit)for("function"==typeof r.preInit&&(r.preInit=[r.preInit]);r.preInit.length>0;)r.preInit.pop()();return R(),e.ready});e.exports=t}},t={},function n(r){var o=t[r];if(void 0!==o)return o.exports;var a=t[r]={exports:{}};return e[r].call(a.exports,a,a.exports,n),a.exports}(770);var e,t};var A4,M4,L4=R4.exports=F4(),B4={exports:{}};B4.exports=(A4={350:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.UseOnigurumaFindOptions=t.DebugFlags=void 0,t.DebugFlags={InDebugMode:"undefined"!=typeof process&&!1},t.UseOnigurumaFindOptions=!1},36:(e,t)=>{var n;Object.defineProperty(t,"__esModule",{value:!0}),t.toOptionalTokenType=t.EncodedTokenAttributes=void 0,(n=t.EncodedTokenAttributes||(t.EncodedTokenAttributes={})).toBinaryStr=function(e){let t=e.toString(2);for(;t.length<32;)t="0"+t;return t},n.print=function(e){const t=n.getLanguageId(e),r=n.getTokenType(e),o=n.getFontStyle(e),a=n.getForeground(e),i=n.getBackground(e);console.log({languageId:t,tokenType:r,fontStyle:o,foreground:a,background:i})},n.getLanguageId=function(e){return(255&e)>>>0},n.getTokenType=function(e){return(768&e)>>>8},n.containsBalancedBrackets=function(e){return 0!=(1024&e)},n.getFontStyle=function(e){return(30720&e)>>>11},n.getForeground=function(e){return(16744448&e)>>>15},n.getBackground=function(e){return(4278190080&e)>>>24},n.set=function(e,t,r,o,a,i,s){let l=n.getLanguageId(e),c=n.getTokenType(e),u=n.containsBalancedBrackets(e)?1:0,d=n.getFontStyle(e),f=n.getForeground(e),p=n.getBackground(e);return 0!==t&&(l=t),8!==r&&(c=r),null!==o&&(u=o?1:0),-1!==a&&(d=a),0!==i&&(f=i),0!==s&&(p=s),(l<<0|c<<8|u<<10|d<<11|f<<15|p<<24)>>>0},t.toOptionalTokenType=function(e){return e}},996:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.BasicScopeAttributesProvider=t.BasicScopeAttributes=void 0;const r=n(878);class o{constructor(e,t){this.languageId=e,this.tokenType=t}}t.BasicScopeAttributes=o;class a{constructor(e,t){this._getBasicScopeAttributes=new r.CachedFn((e=>{const t=this._scopeToLanguage(e),n=this._toStandardTokenType(e);return new o(t,n)})),this._defaultAttributes=new o(e,8),this._embeddedLanguagesMatcher=new i(Object.entries(t||{}))}getDefaultAttributes(){return this._defaultAttributes}getBasicScopeAttributes(e){return null===e?a._NULL_SCOPE_METADATA:this._getBasicScopeAttributes.get(e)}_scopeToLanguage(e){return this._embeddedLanguagesMatcher.match(e)||0}_toStandardTokenType(e){const t=e.match(a.STANDARD_TOKEN_TYPE_REGEXP);if(!t)return 8;switch(t[1]){case"comment":return 1;case"string":return 2;case"regex":return 3;case"meta.embedded":return 0}throw new Error("Unexpected match for standard token type!")}}t.BasicScopeAttributesProvider=a,a._NULL_SCOPE_METADATA=new o(0,0),a.STANDARD_TOKEN_TYPE_REGEXP=/\b(comment|string|regex|meta\.embedded)\b/;class i{constructor(e){if(0===e.length)this.values=null,this.scopesRegExp=null;else{this.values=new Map(e);const t=e.map((([e,t])=>r.escapeRegExpCharacters(e)));t.sort(),t.reverse(),this.scopesRegExp=new RegExp(`^((${t.join(")|(")}))($|\\.)`,"")}}match(e){if(!this.scopesRegExp)return;const t=e.match(this.scopesRegExp);return t?this.values.get(t[1]):void 0}}},947:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LineTokens=t.BalancedBracketSelectors=t.StateStack=t.AttributedScopeStack=t.Grammar=t.createGrammar=void 0;const r=n(350),o=n(36),a=n(736),i=n(44),s=n(792),l=n(583),c=n(878),u=n(996),d=n(47);function f(e,t,n,r,o){const i=a.createMatchers(t,p),l=s.RuleFactory.getCompiledRuleId(n,r,o.repository);for(const a of i)e.push({debugSelector:t,matcher:a.matcher,ruleId:l,grammar:o,priority:a.priority})}function p(e,t){if(t.length{for(let r=n;rn&&e.substr(0,n)===t&&"."===e[n]}t.createGrammar=function(e,t,n,r,o,a,i,s){return new g(e,t,n,r,o,a,i,s)};class g{constructor(e,t,n,r,o,i,s,l){if(this._rootScopeName=e,this.balancedBracketSelectors=i,this._onigLib=l,this._basicScopeAttributesProvider=new u.BasicScopeAttributesProvider(n,r),this._rootId=-1,this._lastRuleId=0,this._ruleId2desc=[null],this._includedGrammars={},this._grammarRepository=s,this._grammar=m(t,null),this._injections=null,this._tokenTypeMatchers=[],o)for(const c of Object.keys(o)){const e=a.createMatchers(c,p);for(const t of e)this._tokenTypeMatchers.push({matcher:t.matcher,type:o[c]})}}get themeProvider(){return this._grammarRepository}dispose(){for(const e of this._ruleId2desc)e&&e.dispose()}createOnigScanner(e){return this._onigLib.createOnigScanner(e)}createOnigString(e){return this._onigLib.createOnigString(e)}getMetadataForScope(e){return this._basicScopeAttributesProvider.getBasicScopeAttributes(e)}_collectInjections(){const e=[],t=this._rootScopeName,n=(e=>e===this._rootScopeName?this._grammar:this.getExternalGrammar(e))(t);if(n){const r=n.injections;if(r)for(let t in r)f(e,t,r[t],this,n);const o=this._grammarRepository.injections(t);o&&o.forEach((t=>{const n=this.getExternalGrammar(t);if(n){const t=n.injectionSelector;t&&f(e,t,n,this,n)}}))}return e.sort(((e,t)=>e.priority-t.priority)),e}getInjections(){if(null===this._injections&&(this._injections=this._collectInjections(),r.DebugFlags.InDebugMode&&this._injections.length>0)){console.log(`Grammar ${this._rootScopeName} contains the following injections:`);for(const e of this._injections)console.log(` - ${e.debugSelector}`)}return this._injections}registerRule(e){const t=++this._lastRuleId,n=e(s.ruleIdFromNumber(t));return this._ruleId2desc[t]=n,n}getRule(e){return this._ruleId2desc[s.ruleIdToNumber(e)]}getExternalGrammar(e,t){if(this._includedGrammars[e])return this._includedGrammars[e];if(this._grammarRepository){const n=this._grammarRepository.lookup(e);if(n)return this._includedGrammars[e]=m(n,t&&t.$base),this._includedGrammars[e]}}tokenizeLine(e,t,n=0){const r=this._tokenize(e,t,!1,n);return{tokens:r.lineTokens.getResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}tokenizeLine2(e,t,n=0){const r=this._tokenize(e,t,!0,n);return{tokens:r.lineTokens.getBinaryResult(r.ruleStack,r.lineLength),ruleStack:r.ruleStack,stoppedEarly:r.stoppedEarly}}_tokenize(e,t,n,r){let a;if(-1===this._rootId&&(this._rootId=s.RuleFactory.getCompiledRuleId(this._grammar.repository.$self,this,this._grammar.repository)),t&&t!==v.NULL)a=!1,t.reset();else{a=!0;const e=this._basicScopeAttributesProvider.getDefaultAttributes(),n=this.themeProvider.getDefaults(),r=o.EncodedTokenAttributes.set(0,e.languageId,e.tokenType,null,n.fontStyle,n.foregroundId,n.backgroundId),i=this.getRule(this._rootId).getName(null,null);let s;s=i?b.createRootAndLookUpScopeName(i,r,this):b.createRoot("unknown",r),t=new v(null,this._rootId,-1,-1,!1,null,s,s)}e+="\n";const l=this.createOnigString(e),c=l.content.length,u=new y(n,e,this._tokenTypeMatchers,this.balancedBracketSelectors),f=d._tokenizeString(this,l,a,0,t,u,!0,r);return i.disposeOnigString(l),{lineLength:c,lineTokens:u,ruleStack:f.stack,stoppedEarly:f.stoppedEarly}}}function m(e,t){return(e=c.clone(e)).repository=e.repository||{},e.repository.$self={$vscodeTextmateLocation:e.$vscodeTextmateLocation,patterns:e.patterns,name:e.scopeName},e.repository.$base=t||e.repository.$self,e}t.Grammar=g;class b{constructor(e,t,n){this.parent=e,this.scopePath=t,this.tokenAttributes=n}static createRoot(e,t){return new b(null,new l.ScopeStack(null,e),t)}static createRootAndLookUpScopeName(e,t,n){const r=n.getMetadataForScope(e),o=new l.ScopeStack(null,e),a=n.themeProvider.themeMatch(o),i=b.mergeAttributes(t,r,a);return new b(null,o,i)}get scopeName(){return this.scopePath.scopeName}equals(e){return b._equals(this,e)}static _equals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.scopeName!==t.scopeName||e.tokenAttributes!==t.tokenAttributes)return!1;e=e.parent,t=t.parent}}static mergeAttributes(e,t,n){let r=-1,a=0,i=0;return null!==n&&(r=n.fontStyle,a=n.foregroundId,i=n.backgroundId),o.EncodedTokenAttributes.set(e,t.languageId,t.tokenType,null,r,a,i)}pushAttributed(e,t){if(null===e)return this;if(-1===e.indexOf(" "))return b._pushAttributed(this,e,t);const n=e.split(/ /g);let r=this;for(const o of n)r=b._pushAttributed(r,o,t);return r}static _pushAttributed(e,t,n){const r=n.getMetadataForScope(t),o=e.scopePath.push(t),a=n.themeProvider.themeMatch(o),i=b.mergeAttributes(e.tokenAttributes,r,a);return new b(e,o,i)}getScopeNames(){return this.scopePath.getSegments()}}t.AttributedScopeStack=b;class v{constructor(e,t,n,r,o,a,i,s){this.parent=e,this.ruleId=t,this.beginRuleCapturedEOL=o,this.endRule=a,this.nameScopesList=i,this.contentNameScopesList=s,this._stackElementBrand=void 0,this.depth=this.parent?this.parent.depth+1:1,this._enterPos=n,this._anchorPos=r}equals(e){return null!==e&&v._equals(this,e)}static _equals(e,t){return e===t||!!this._structuralEquals(e,t)&&e.contentNameScopesList.equals(t.contentNameScopesList)}static _structuralEquals(e,t){for(;;){if(e===t)return!0;if(!e&&!t)return!0;if(!e||!t)return!1;if(e.depth!==t.depth||e.ruleId!==t.ruleId||e.endRule!==t.endRule)return!1;e=e.parent,t=t.parent}}clone(){return this}static _reset(e){for(;e;)e._enterPos=-1,e._anchorPos=-1,e=e.parent}reset(){v._reset(this)}pop(){return this.parent}safePop(){return this.parent?this.parent:this}push(e,t,n,r,o,a,i){return new v(this,e,t,n,r,o,a,i)}getEnterPos(){return this._enterPos}getAnchorPos(){return this._anchorPos}getRule(e){return e.getRule(this.ruleId)}toString(){const e=[];return this._writeString(e,0),"["+e.join(",")+"]"}_writeString(e,t){return this.parent&&(t=this.parent._writeString(e,t)),e[t++]=`(${this.ruleId}, TODO-${this.nameScopesList}, TODO-${this.contentNameScopesList})`,t}withContentNameScopesList(e){return this.contentNameScopesList===e?this:this.parent.push(this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,this.endRule,this.nameScopesList,e)}withEndRule(e){return this.endRule===e?this:new v(this.parent,this.ruleId,this._enterPos,this._anchorPos,this.beginRuleCapturedEOL,e,this.nameScopesList,this.contentNameScopesList)}hasSameRuleAs(e){let t=this;for(;t&&t._enterPos===e._enterPos;){if(t.ruleId===e.ruleId)return!0;t=t.parent}return!1}}t.StateStack=v,v.NULL=new v(null,0,0,0,!1,null,null,null),t.BalancedBracketSelectors=class{constructor(e,t){this.allowAny=!1,this.balancedBracketScopes=e.flatMap((e=>"*"===e?(this.allowAny=!0,[]):a.createMatchers(e,p).map((e=>e.matcher)))),this.unbalancedBracketScopes=t.flatMap((e=>a.createMatchers(e,p).map((e=>e.matcher))))}get matchesAlways(){return this.allowAny&&0===this.unbalancedBracketScopes.length}get matchesNever(){return 0===this.balancedBracketScopes.length&&!this.allowAny}match(e){for(const t of this.unbalancedBracketScopes)if(t(e))return!1;for(const t of this.balancedBracketScopes)if(t(e))return!0;return this.allowAny}};class y{constructor(e,t,n,o){this.balancedBracketSelectors=o,this._emitBinaryTokens=e,this._tokenTypeOverrides=n,r.DebugFlags.InDebugMode?this._lineText=t:this._lineText=null,this._tokens=[],this._binaryTokens=[],this._lastTokenEndIndex=0}produce(e,t){this.produceFromScopes(e.contentNameScopesList,t)}produceFromScopes(e,t){var n;if(this._lastTokenEndIndex>=t)return;if(this._emitBinaryTokens){let a=e.tokenAttributes,i=!1;if((null==(n=this.balancedBracketSelectors)?void 0:n.matchesAlways)&&(i=!0),this._tokenTypeOverrides.length>0||this.balancedBracketSelectors&&!this.balancedBracketSelectors.matchesAlways&&!this.balancedBracketSelectors.matchesNever){const t=e.getScopeNames();for(const e of this._tokenTypeOverrides)e.matcher(t)&&(a=o.EncodedTokenAttributes.set(a,0,o.toOptionalTokenType(e.type),null,-1,0,0));this.balancedBracketSelectors&&(i=this.balancedBracketSelectors.match(t))}if(i&&(a=o.EncodedTokenAttributes.set(a,0,8,i,-1,0,0)),this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-1]===a)return void(this._lastTokenEndIndex=t);if(r.DebugFlags.InDebugMode){const n=e.getScopeNames();console.log(" token: |"+this._lineText.substring(this._lastTokenEndIndex,t).replace(/\n$/,"\\n")+"|");for(let e=0;e0&&this._tokens[this._tokens.length-1].startIndex===t-1&&this._tokens.pop(),0===this._tokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._tokens[this._tokens.length-1].startIndex=0),this._tokens}getBinaryResult(e,t){this._binaryTokens.length>0&&this._binaryTokens[this._binaryTokens.length-2]===t-1&&(this._binaryTokens.pop(),this._binaryTokens.pop()),0===this._binaryTokens.length&&(this._lastTokenEndIndex=-1,this.produce(e,t),this._binaryTokens[this._binaryTokens.length-2]=0);const n=new Uint32Array(this._binaryTokens.length);for(let r=0,o=this._binaryTokens.length;r{Object.defineProperty(t,"__esModule",{value:!0}),t.parseInclude=t.TopLevelRepositoryReference=t.TopLevelReference=t.RelativeReference=t.SelfReference=t.BaseReference=t.ScopeDependencyProcessor=t.ExternalReferenceCollector=t.TopLevelRepositoryRuleReference=t.TopLevelRuleReference=void 0;const r=n(878);class o{constructor(e){this.scopeName=e}toKey(){return this.scopeName}}t.TopLevelRuleReference=o;class a{constructor(e,t){this.scopeName=e,this.ruleName=t}toKey(){return`${this.scopeName}#${this.ruleName}`}}t.TopLevelRepositoryRuleReference=a;class i{constructor(){this._references=[],this._seenReferenceKeys=new Set,this.visitedRule=new Set}get references(){return this._references}add(e){const t=e.toKey();this._seenReferenceKeys.has(t)||(this._seenReferenceKeys.add(t),this._references.push(e))}}function s(e,t,n,r){const a=n.lookup(e.scopeName);if(!a){if(e.scopeName===t)throw new Error(`No grammar provided for <${t}>`);return}const i=n.lookup(t);e instanceof o?c({baseGrammar:i,selfGrammar:a},r):l(e.ruleName,{baseGrammar:i,selfGrammar:a,repository:a.repository},r);const s=n.injections(e.scopeName);if(s)for(const l of s)r.add(new o(l))}function l(e,t,n){t.repository&&t.repository[e]&&u([t.repository[e]],t,n)}function c(e,t){e.selfGrammar.patterns&&Array.isArray(e.selfGrammar.patterns)&&u(e.selfGrammar.patterns,{...e,repository:e.selfGrammar.repository},t),e.selfGrammar.injections&&u(Object.values(e.selfGrammar.injections),{...e,repository:e.selfGrammar.repository},t)}function u(e,t,n){for(const i of e){if(n.visitedRule.has(i))continue;n.visitedRule.add(i);const e=i.repository?r.mergeObjects({},t.repository,i.repository):t.repository;Array.isArray(i.patterns)&&u(i.patterns,{...t,repository:e},n);const s=i.include;if(!s)continue;const d=m(s);switch(d.kind){case 0:c({...t,selfGrammar:t.baseGrammar},n);break;case 1:c(t,n);break;case 2:l(d.ruleName,{...t,repository:e},n);break;case 3:case 4:const r=d.scopeName===t.selfGrammar.scopeName?t.selfGrammar:d.scopeName===t.baseGrammar.scopeName?t.baseGrammar:void 0;if(r){const o={baseGrammar:t.baseGrammar,selfGrammar:r,repository:e};4===d.kind?l(d.ruleName,o,n):c(o,n)}else 4===d.kind?n.add(new a(d.scopeName,d.ruleName)):n.add(new o(d.scopeName))}}}t.ExternalReferenceCollector=i,t.ScopeDependencyProcessor=class{constructor(e,t){this.repo=e,this.initialScopeName=t,this.seenFullScopeRequests=new Set,this.seenPartialScopeRequests=new Set,this.seenFullScopeRequests.add(this.initialScopeName),this.Q=[new o(this.initialScopeName)]}processQueue(){const e=this.Q;this.Q=[];const t=new i;for(const n of e)s(n,this.initialScopeName,this.repo,t);for(const n of t.references)if(n instanceof o){if(this.seenFullScopeRequests.has(n.scopeName))continue;this.seenFullScopeRequests.add(n.scopeName),this.Q.push(n)}else{if(this.seenFullScopeRequests.has(n.scopeName))continue;if(this.seenPartialScopeRequests.has(n.toKey()))continue;this.seenPartialScopeRequests.add(n.toKey()),this.Q.push(n)}}};class d{constructor(){this.kind=0}}t.BaseReference=d;class f{constructor(){this.kind=1}}t.SelfReference=f;class p{constructor(e){this.ruleName=e,this.kind=2}}t.RelativeReference=p;class h{constructor(e){this.scopeName=e,this.kind=3}}t.TopLevelReference=h;class g{constructor(e,t){this.scopeName=e,this.ruleName=t,this.kind=4}}function m(e){if("$base"===e)return new d;if("$self"===e)return new f;const t=e.indexOf("#");if(-1===t)return new h(e);if(0===t)return new p(e.substring(1));{const n=e.substring(0,t),r=e.substring(t+1);return new g(n,r)}}t.TopLevelRepositoryReference=g,t.parseInclude=m},391:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),o(n(947),t)},47:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.LocalStackElement=t._tokenizeString=void 0;const r=n(350),o=n(44),a=n(792),i=n(878);class s{constructor(e,t){this.stack=e,this.stoppedEarly=t}}function l(e,t,n,o,l,d,p,h){const g=t.content.length;let m=!1,b=-1;if(p){const i=function(e,t,n,o,i,s){let l=i.beginRuleCapturedEOL?0:-1;const c=[];for(let r=i;r;r=r.pop()){const t=r.getRule(e);t instanceof a.BeginWhileRule&&c.push({rule:t,stack:r})}for(let d=c.pop();d;d=c.pop()){const{ruleScanner:c,findOptions:p}=u(d.rule,e,d.stack.endRule,n,o===l),h=c.findNextMatchSync(t,o,p);if(r.DebugFlags.InDebugMode&&(console.log(" scanning for while rule"),console.log(c.toString())),!h){r.DebugFlags.InDebugMode&&console.log(" popping "+d.rule.debugName+" - "+d.rule.debugWhileRegExp),i=d.stack.pop();break}if(h.ruleId!==a.whileRuleId){i=d.stack.pop();break}h.captureIndices&&h.captureIndices.length&&(s.produce(d.stack,h.captureIndices[0].start),f(e,t,n,d.stack,s,d.rule.whileCaptures,h.captureIndices),s.produce(d.stack,h.captureIndices[0].end),l=h.captureIndices[0].end,h.captureIndices[0].end>o&&(o=h.captureIndices[0].end,n=!1))}return{stack:i,linePos:o,anchorPosition:l,isFirstLine:n}}(e,t,n,o,l,d);l=i.stack,o=i.linePos,n=i.isFirstLine,b=i.anchorPosition}const v=Date.now();for(;!m;){if(0!==h&&Date.now()-v>h)return new s(l,!0);y()}return new s(l,!1);function y(){r.DebugFlags.InDebugMode&&(console.log(""),console.log(`@@scanNext ${o}: |${t.content.substr(o).replace(/\n$/,"\\n")}|`));const s=function(e,t,n,o,a,s){const l=function(e,t,n,o,a,s){const l=a.getRule(e),{ruleScanner:u,findOptions:d}=c(l,e,a.endRule,n,o===s);let f=0;r.DebugFlags.InDebugMode&&(f=i.performanceNow());const p=u.findNextMatchSync(t,o,d);if(r.DebugFlags.InDebugMode){const e=i.performanceNow()-f;e>5&&console.warn(`Rule ${l.debugName} (${l.id}) matching took ${e} against '${t}'`),console.log(` scanning for (linePos: ${o}, anchorPosition: ${s})`),console.log(u.toString()),p&&console.log(`matched rule id: ${p.ruleId} from ${p.captureIndices[0].start} to ${p.captureIndices[0].end}`)}return p?{captureIndices:p.captureIndices,matchedRuleId:p.ruleId}:null}(e,t,n,o,a,s),u=e.getInjections();if(0===u.length)return l;const d=function(e,t,n,o,a,i,s){let l,u=Number.MAX_VALUE,d=null,f=0;const p=i.contentNameScopesList.getScopeNames();for(let h=0,g=e.length;h=u)&&(u=y,d=v.captureIndices,l=v.ruleId,f=i.priority,u===a))break}return d?{priorityMatch:-1===f,captureIndices:d,matchedRuleId:l}:null}(u,e,t,n,o,a,s);if(!d)return l;if(!l)return d;const f=l.captureIndices[0].start,p=d.captureIndices[0].start;return p0)&&u[0].end>o;if(p===a.endRuleId){const a=l.getRule(e);r.DebugFlags.InDebugMode&&console.log(" popping "+a.debugName+" - "+a.debugEndRegExp),d.produce(l,u[0].start),l=l.withContentNameScopesList(l.nameScopesList),f(e,t,n,l,d,a.endCaptures,u),d.produce(l,u[0].end);const i=l;if(l=l.parent,b=i.getAnchorPos(),!h&&i.getEnterPos()===o)return r.DebugFlags.InDebugMode&&console.error("[1] - Grammar is in an endless loop - Grammar pushed & popped a rule without advancing"),l=i,d.produce(l,g),void(m=!0)}else{const i=e.getRule(p);d.produce(l,u[0].start);const s=l,c=i.getName(t.content,u),v=l.contentNameScopesList.pushAttributed(c,e);if(l=l.push(p,o,b,u[0].end===g,null,v,v),i instanceof a.BeginEndRule){const o=i;r.DebugFlags.InDebugMode&&console.log(" pushing "+o.debugName+" - "+o.debugBeginRegExp),f(e,t,n,l,d,o.beginCaptures,u),d.produce(l,u[0].end),b=u[0].end;const a=o.getContentName(t.content,u),c=v.pushAttributed(a,e);if(l=l.withContentNameScopesList(c),o.endHasBackReferences&&(l=l.withEndRule(o.getEndWithResolvedBackReferences(t.content,u))),!h&&s.hasSameRuleAs(l))return r.DebugFlags.InDebugMode&&console.error("[2] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),l=l.pop(),d.produce(l,g),void(m=!0)}else if(i instanceof a.BeginWhileRule){const o=i;r.DebugFlags.InDebugMode&&console.log(" pushing "+o.debugName),f(e,t,n,l,d,o.beginCaptures,u),d.produce(l,u[0].end),b=u[0].end;const a=o.getContentName(t.content,u),c=v.pushAttributed(a,e);if(l=l.withContentNameScopesList(c),o.whileHasBackReferences&&(l=l.withEndRule(o.getWhileWithResolvedBackReferences(t.content,u))),!h&&s.hasSameRuleAs(l))return r.DebugFlags.InDebugMode&&console.error("[3] - Grammar is in an endless loop - Grammar pushed the same rule without advancing"),l=l.pop(),d.produce(l,g),void(m=!0)}else{const o=i;if(r.DebugFlags.InDebugMode&&console.log(" matched "+o.debugName+" - "+o.debugMatchRegExp),f(e,t,n,l,d,o.captures,u),d.produce(l,u[0].end),l=l.pop(),!h)return r.DebugFlags.InDebugMode&&console.error("[4] - Grammar is in an endless loop - Grammar is not advancing, nor is it pushing/popping"),l=l.safePop(),d.produce(l,g),void(m=!0)}}u[0].end>o&&(o=u[0].end,n=!1)}}function c(e,t,n,o,a){return r.UseOnigurumaFindOptions?{ruleScanner:e.compile(t,n),findOptions:d(o,a)}:{ruleScanner:e.compileAG(t,n,o,a),findOptions:0}}function u(e,t,n,o,a){return r.UseOnigurumaFindOptions?{ruleScanner:e.compileWhile(t,n),findOptions:d(o,a)}:{ruleScanner:e.compileWhileAG(t,n,o,a),findOptions:0}}function d(e,t){let n=0;return e||(n|=1),t||(n|=4),n}function f(e,t,n,r,a,i,s){if(0===i.length)return;const c=t.content,u=Math.min(i.length,s.length),d=[],f=s[0].end;for(let h=0;hf)break;for(;d.length>0&&d[d.length-1].endPos<=u.start;)a.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop();if(d.length>0?a.produceFromScopes(d[d.length-1].scopes,u.start):a.produce(r,u.start),t.retokenizeCapturedWithRuleId){const i=t.getName(c,s),d=r.contentNameScopesList.pushAttributed(i,e),f=t.getContentName(c,s),p=d.pushAttributed(f,e),h=r.push(t.retokenizeCapturedWithRuleId,u.start,-1,!1,null,d,p),g=e.createOnigString(c.substring(0,u.end));l(e,g,n&&0===u.start,u.start,h,a,!1,0),o.disposeOnigString(g);continue}const g=t.getName(c,s);if(null!==g){const t=(d.length>0?d[d.length-1].scopes:r.contentNameScopesList).pushAttributed(g,e);d.push(new p(t,u.end))}}for(;d.length>0;)a.produceFromScopes(d[d.length-1].scopes,d[d.length-1].endPos),d.pop()}t._tokenizeString=l;class p{constructor(e,t){this.scopes=e,this.endPos=t}}t.LocalStackElement=p},974:(e,t)=>{function n(e,t){throw new Error("Near offset "+e.pos+": "+t+" ~~~"+e.source.substr(e.pos,50)+"~~~")}Object.defineProperty(t,"__esModule",{value:!0}),t.parseJSON=void 0,t.parseJSON=function(e,t,i){let s=new r(e),l=new o,c=0,u=null,d=[],f=[];function p(){d.push(c),f.push(u)}function h(){c=d.pop(),u=f.pop()}function g(e){n(s,e)}for(;a(s,l);){if(0===c){if(null!==u&&g("too many constructs in root"),3===l.type){u={},i&&(u.$vscodeTextmateLocation=l.toLocation(t)),p(),c=1;continue}if(2===l.type){u=[],p(),c=4;continue}g("unexpected token in root")}if(2===c){if(5===l.type){h();continue}if(7===l.type){c=3;continue}g("expected , or }")}if(1===c||3===c){if(1===c&&5===l.type){h();continue}if(1===l.type){let e=l.value;if(a(s,l)&&6===l.type||g("expected colon"),a(s,l)||g("expected value"),c=2,1===l.type){u[e]=l.value;continue}if(8===l.type){u[e]=null;continue}if(9===l.type){u[e]=!0;continue}if(10===l.type){u[e]=!1;continue}if(11===l.type){u[e]=parseFloat(l.value);continue}if(2===l.type){let t=[];u[e]=t,p(),c=4,u=t;continue}if(3===l.type){let n={};i&&(n.$vscodeTextmateLocation=l.toLocation(t)),u[e]=n,p(),c=1,u=n;continue}}g("unexpected token in dict")}if(5===c){if(4===l.type){h();continue}if(7===l.type){c=6;continue}g("expected , or ]")}if(4===c||6===c){if(4===c&&4===l.type){h();continue}if(c=5,1===l.type){u.push(l.value);continue}if(8===l.type){u.push(null);continue}if(9===l.type){u.push(!0);continue}if(10===l.type){u.push(!1);continue}if(11===l.type){u.push(parseFloat(l.value));continue}if(2===l.type){let e=[];u.push(e),p(),c=4,u=e;continue}if(3===l.type){let e={};i&&(e.$vscodeTextmateLocation=l.toLocation(t)),u.push(e),p(),c=1,u=e;continue}g("unexpected token in array")}g("unknown state")}return 0!==f.length&&g("unclosed constructs"),u};class r{constructor(e){this.source=e,this.pos=0,this.len=e.length,this.line=1,this.char=0}}class o{constructor(){this.value=null,this.type=0,this.offset=-1,this.len=-1,this.line=-1,this.char=-1}toLocation(e){return{filename:e,line:this.line,char:this.char}}}function a(e,t){t.value=null,t.type=0,t.offset=-1,t.len=-1,t.line=-1,t.char=-1;let r,o=e.source,a=e.pos,i=e.len,s=e.line,l=e.char;for(;;){if(a>=i)return!1;if(r=o.charCodeAt(a),32!==r&&9!==r&&13!==r){if(10!==r)break;a++,s++,l=0}else a++,l++}if(t.offset=a,t.line=s,t.char=l,34===r){for(t.type=1,a++,l++;;){if(a>=i)return!1;if(r=o.charCodeAt(a),a++,l++,92!==r){if(34===r)break}else a++,l++}t.value=o.substring(t.offset+1,a-1).replace(/\\u([0-9A-Fa-f]{4})/g,((e,t)=>String.fromCodePoint(parseInt(t,16)))).replace(/\\(.)/g,((t,r)=>{switch(r){case'"':return'"';case"\\":return"\\";case"/":return"/";case"b":return"\b";case"f":return"\f";case"n":return"\n";case"r":return"\r";case"t":return"\t";default:n(e,"invalid escape sequence")}throw new Error("unreachable")}))}else if(91===r)t.type=2,a++,l++;else if(123===r)t.type=3,a++,l++;else if(93===r)t.type=4,a++,l++;else if(125===r)t.type=5,a++,l++;else if(58===r)t.type=6,a++,l++;else if(44===r)t.type=7,a++,l++;else if(110===r){if(t.type=8,a++,l++,r=o.charCodeAt(a),117!==r)return!1;if(a++,l++,r=o.charCodeAt(a),108!==r)return!1;if(a++,l++,r=o.charCodeAt(a),108!==r)return!1;a++,l++}else if(116===r){if(t.type=9,a++,l++,r=o.charCodeAt(a),114!==r)return!1;if(a++,l++,r=o.charCodeAt(a),117!==r)return!1;if(a++,l++,r=o.charCodeAt(a),101!==r)return!1;a++,l++}else if(102===r){if(t.type=10,a++,l++,r=o.charCodeAt(a),97!==r)return!1;if(a++,l++,r=o.charCodeAt(a),108!==r)return!1;if(a++,l++,r=o.charCodeAt(a),115!==r)return!1;if(a++,l++,r=o.charCodeAt(a),101!==r)return!1;a++,l++}else for(t.type=11;;){if(a>=i)return!1;if(r=o.charCodeAt(a),!(46===r||r>=48&&r<=57||101===r||69===r||45===r||43===r))break;a++,l++}return t.len=a-t.offset,null===t.value&&(t.value=o.substr(t.offset,t.len)),e.pos=a,e.line=s,e.char=l,!0}},787:function(e,t,n){var r=this&&this.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),o=this&&this.__exportStar||function(e,t){for(var n in e)"default"===n||Object.prototype.hasOwnProperty.call(t,n)||r(t,e,n)};Object.defineProperty(t,"__esModule",{value:!0}),t.parseRawGrammar=t.INITIAL=t.Registry=void 0;const a=n(391),i=n(50),s=n(652),l=n(583),c=n(965);o(n(44),t),t.Registry=class{constructor(e){this._options=e,this._syncRegistry=new s.SyncRegistry(l.Theme.createFromRawTheme(e.theme,e.colorMap),e.onigLib),this._ensureGrammarCache=new Map}dispose(){this._syncRegistry.dispose()}setTheme(e,t){this._syncRegistry.setTheme(l.Theme.createFromRawTheme(e,t))}getColorMap(){return this._syncRegistry.getColorMap()}loadGrammarWithEmbeddedLanguages(e,t,n){return this.loadGrammarWithConfiguration(e,t,{embeddedLanguages:n})}loadGrammarWithConfiguration(e,t,n){return this._loadGrammar(e,t,n.embeddedLanguages,n.tokenTypes,new a.BalancedBracketSelectors(n.balancedBracketSelectors||[],n.unbalancedBracketSelectors||[]))}loadGrammar(e){return this._loadGrammar(e,0,null,null,null)}async _loadGrammar(e,t,n,r,o){const a=new c.ScopeDependencyProcessor(this._syncRegistry,e);for(;a.Q.length>0;)await Promise.all(a.Q.map((e=>this._loadSingleGrammar(e.scopeName)))),a.processQueue();return this._grammarForScopeName(e,t,n,r,o)}async _loadSingleGrammar(e){return this._ensureGrammarCache.has(e)||this._ensureGrammarCache.set(e,this._doLoadSingleGrammar(e)),this._ensureGrammarCache.get(e)}async _doLoadSingleGrammar(e){const t=await this._options.loadGrammar(e);if(t){const n="function"==typeof this._options.getInjections?this._options.getInjections(e):void 0;this._syncRegistry.addGrammar(t,n)}}async addGrammar(e,t=[],n=0,r=null){return this._syncRegistry.addGrammar(e,t),await this._grammarForScopeName(e.scopeName,n,r)}_grammarForScopeName(e,t=0,n=null,r=null,o=null){return this._syncRegistry.grammarForScopeName(e,t,n,r,o)}},t.INITIAL=a.StateStack.NULL,t.parseRawGrammar=i.parseRawGrammar},736:(e,t)=>{function n(e){return!!e&&!!e.match(/[\w\.:]+/)}Object.defineProperty(t,"__esModule",{value:!0}),t.createMatchers=void 0,t.createMatchers=function(e,t){const r=[],o=function(e){let t=/([LR]:|[\w\.:][\w\.:\-]*|[\,\|\-\(\)])/g,n=t.exec(e);return{next:()=>{if(!n)return null;const r=n[0];return n=t.exec(e),r}}}(e);let a=o.next();for(;null!==a;){let e=0;if(2===a.length&&":"===a.charAt(1)){switch(a.charAt(0)){case"R":e=1;break;case"L":e=-1;break;default:console.log(`Unknown priority ${a} in scope selector`)}a=o.next()}let t=s();if(r.push({matcher:t,priority:e}),","!==a)break;a=o.next()}return r;function i(){if("-"===a){a=o.next();const e=i();return t=>!!e&&!e(t)}if("("===a){a=o.next();const e=function(){const e=[];let t=s();for(;t&&(e.push(t),"|"===a||","===a);){do{a=o.next()}while("|"===a||","===a);t=s()}return t=>e.some((e=>e(t)))}();return")"===a&&(a=o.next()),e}if(n(a)){const e=[];do{e.push(a),a=o.next()}while(n(a));return n=>t(e,n)}return null}function s(){const e=[];let t=i();for(;t;)e.push(t),t=i();return t=>e.every((e=>e(t)))}}},44:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.disposeOnigString=void 0,t.disposeOnigString=function(e){"function"==typeof e.dispose&&e.dispose()}},50:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.parseRawGrammar=void 0;const r=n(69),o=n(350),a=n(974);t.parseRawGrammar=function(e,t=null){return null!==t&&/\.json$/.test(t)?(s=e,l=t,o.DebugFlags.InDebugMode?a.parseJSON(s,l,!0):JSON.parse(s)):(n=e,i=t,o.DebugFlags.InDebugMode?r.parseWithLocation(n,i,"$vscodeTextmateLocation"):r.parsePLIST(n));var n,i,s,l}},69:(e,t)=>{function n(e,t,n){const r=e.length;let o=0,a=1,i=0;function s(t){if(null===n)o+=t;else for(;t>0;)10===e.charCodeAt(o)?(o++,a++,i=0):(o++,i++),t--}function l(e){null===n?o=e:s(e-o)}function c(){for(;o0&&65279===e.charCodeAt(0)&&(o=1);let p=0,h=null,g=[],m=[],b=null;function v(e,t){g.push(p),m.push(h),p=e,h=t}function y(){if(0===g.length)return w("illegal state stack");p=g.pop(),h=m.pop()}function w(t){throw new Error("Near offset "+o+": "+t+" ~~~"+e.substr(o,50)+"~~~")}const x=function(){if(null===b)return w("missing ");let e={};null!==n&&(e[n]={filename:t,line:a,char:i}),h[b]=e,b=null,v(1,e)},S=function(){if(null===b)return w("missing ");let e=[];h[b]=e,b=null,v(2,e)},k=function(){let e={};null!==n&&(e[n]={filename:t,line:a,char:i}),h.push(e),v(1,e)},C=function(){let e=[];h.push(e),v(2,e)};function E(){if(1!==p)return w("unexpected ");y()}function O(){return 1===p||2!==p?w("unexpected "):void y()}function D(e){if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function $(e){if(isNaN(e))return w("cannot parse float");if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function j(e){if(isNaN(e))return w("cannot parse integer");if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function N(e){if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function P(e){if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function _(e){if(1===p){if(null===b)return w("missing ");h[b]=e,b=null}else 2===p?h.push(e):h=e}function I(){let e=f(">"),t=!1;return 47===e.charCodeAt(e.length-1)&&(t=!0,e=e.substring(0,e.length-1)),{name:e.trim(),isClosed:t}}function T(e){if(e.isClosed)return"";let t=f(""),t.replace(/&#([0-9]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,10))})).replace(/&#x([0-9a-f]+);/g,(function(e,t){return String.fromCodePoint(parseInt(t,16))})).replace(/&|<|>|"|'/g,(function(e){switch(e){case"&":return"&";case"<":return"<";case">":return">";case""":return'"';case"'":return"'"}return e}))}for(;o=r));){const l=e.charCodeAt(o);if(s(1),60!==l)return w("expected <");if(o>=r)return w("unexpected end of input");const f=e.charCodeAt(o);if(63===f){s(1),d("?>");continue}if(33===f){if(s(1),u("--")){d("--\x3e");continue}d(">");continue}if(47===f){if(s(1),c(),u("plist")){d(">");continue}if(u("dict")){d(">"),E();continue}if(u("array")){d(">"),O();continue}return w("unexpected closed tag")}let g=I();switch(g.name){case"dict":1===p?x():2===p?k():(h={},null!==n&&(h[n]={filename:t,line:a,char:i}),v(1,h)),g.isClosed&&E();continue;case"array":1===p?S():2===p?C():(h=[],v(2,h)),g.isClosed&&O();continue;case"key":F=T(g),1!==p?w("unexpected "):null!==b?w("too many "):b=F;continue;case"string":D(T(g));continue;case"real":$(parseFloat(T(g)));continue;case"integer":j(parseInt(T(g),10));continue;case"date":N(new Date(T(g)));continue;case"data":P(T(g));continue;case"true":T(g),_(!0);continue;case"false":T(g),_(!1);continue}if(!/^plist/.test(g.name))return w("unexpected opened tag "+g.name)}var F;return h}Object.defineProperty(t,"__esModule",{value:!0}),t.parsePLIST=t.parseWithLocation=void 0,t.parseWithLocation=function(e,t,r){return n(e,t,r)},t.parsePLIST=function(e){return n(e,null,null)}},652:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.SyncRegistry=void 0;const r=n(391);t.SyncRegistry=class{constructor(e,t){this._onigLibPromise=t,this._grammars=new Map,this._rawGrammars=new Map,this._injectionGrammars=new Map,this._theme=e}dispose(){for(const e of this._grammars.values())e.dispose()}setTheme(e){this._theme=e}getColorMap(){return this._theme.getColorMap()}addGrammar(e,t){this._rawGrammars.set(e.scopeName,e),t&&this._injectionGrammars.set(e.scopeName,t)}lookup(e){return this._rawGrammars.get(e)}injections(e){return this._injectionGrammars.get(e)}getDefaults(){return this._theme.getDefaults()}themeMatch(e){return this._theme.match(e)}async grammarForScopeName(e,t,n,o,a){if(!this._grammars.has(e)){let i=this._rawGrammars.get(e);if(!i)return null;this._grammars.set(e,r.createGrammar(e,i,t,n,o,a,this,await this._onigLibPromise))}return this._grammars.get(e)}}},792:(e,t,n)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.CompiledRule=t.RegExpSourceList=t.RegExpSource=t.RuleFactory=t.BeginWhileRule=t.BeginEndRule=t.IncludeOnlyRule=t.MatchRule=t.CaptureRule=t.Rule=t.ruleIdToNumber=t.ruleIdFromNumber=t.whileRuleId=t.endRuleId=void 0;const r=n(878),o=n(965),a=/\\(\d+)/,i=/\\(\d+)/g;t.endRuleId=-1,t.whileRuleId=-2,t.ruleIdFromNumber=function(e){return e},t.ruleIdToNumber=function(e){return e};class s{constructor(e,t,n,o){this.$location=e,this.id=t,this._name=n||null,this._nameIsCapturing=r.RegexSource.hasCaptures(this._name),this._contentName=o||null,this._contentNameIsCapturing=r.RegexSource.hasCaptures(this._contentName)}get debugName(){const e=this.$location?`${r.basename(this.$location.filename)}:${this.$location.line}`:"unknown";return`${this.constructor.name}#${this.id} @ ${e}`}getName(e,t){return this._nameIsCapturing&&null!==this._name&&null!==e&&null!==t?r.RegexSource.replaceCaptures(this._name,e,t):this._name}getContentName(e,t){return this._contentNameIsCapturing&&null!==this._contentName?r.RegexSource.replaceCaptures(this._contentName,e,t):this._contentName}}t.Rule=s;class l extends s{constructor(e,t,n,r,o){super(e,t,n,r),this.retokenizeCapturedWithRuleId=o}dispose(){}collectPatterns(e,t){throw new Error("Not supported!")}compile(e,t){throw new Error("Not supported!")}compileAG(e,t,n,r){throw new Error("Not supported!")}}t.CaptureRule=l;class c extends s{constructor(e,t,n,r,o){super(e,t,n,null),this._match=new h(r,this.id),this.captures=o,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugMatchRegExp(){return`${this._match.source}`}collectPatterns(e,t){t.push(this._match)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new g,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}t.MatchRule=c;class u extends s{constructor(e,t,n,r,o){super(e,t,n,r),this.patterns=o.patterns,this.hasMissingPatterns=o.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}collectPatterns(e,t){for(const n of this.patterns)e.getRule(n).collectPatterns(e,t)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){return this._cachedCompiledPatterns||(this._cachedCompiledPatterns=new g,this.collectPatterns(e,this._cachedCompiledPatterns)),this._cachedCompiledPatterns}}t.IncludeOnlyRule=u;class d extends s{constructor(e,t,n,r,o,a,i,s,l,c){super(e,t,n,r),this._begin=new h(o,this.id),this.beginCaptures=a,this._end=new h(i||"￿",-1),this.endHasBackReferences=this._end.hasBackReferences,this.endCaptures=s,this.applyEndPatternLast=l||!1,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugEndRegExp(){return`${this._end.source}`}getEndWithResolvedBackReferences(e,t){return this._end.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e,t).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e,t).compileAG(e,n,r)}_getCachedCompiledPatterns(e,t){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new g;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns);this.applyEndPatternLast?this._cachedCompiledPatterns.push(this._end.hasBackReferences?this._end.clone():this._end):this._cachedCompiledPatterns.unshift(this._end.hasBackReferences?this._end.clone():this._end)}return this._end.hasBackReferences&&(this.applyEndPatternLast?this._cachedCompiledPatterns.setSource(this._cachedCompiledPatterns.length()-1,t):this._cachedCompiledPatterns.setSource(0,t)),this._cachedCompiledPatterns}}t.BeginEndRule=d;class f extends s{constructor(e,n,r,o,a,i,s,l,c){super(e,n,r,o),this._begin=new h(a,this.id),this.beginCaptures=i,this.whileCaptures=l,this._while=new h(s,t.whileRuleId),this.whileHasBackReferences=this._while.hasBackReferences,this.patterns=c.patterns,this.hasMissingPatterns=c.hasMissingPatterns,this._cachedCompiledPatterns=null,this._cachedCompiledWhilePatterns=null}dispose(){this._cachedCompiledPatterns&&(this._cachedCompiledPatterns.dispose(),this._cachedCompiledPatterns=null),this._cachedCompiledWhilePatterns&&(this._cachedCompiledWhilePatterns.dispose(),this._cachedCompiledWhilePatterns=null)}get debugBeginRegExp(){return`${this._begin.source}`}get debugWhileRegExp(){return`${this._while.source}`}getWhileWithResolvedBackReferences(e,t){return this._while.resolveBackReferences(e,t)}collectPatterns(e,t){t.push(this._begin)}compile(e,t){return this._getCachedCompiledPatterns(e).compile(e)}compileAG(e,t,n,r){return this._getCachedCompiledPatterns(e).compileAG(e,n,r)}_getCachedCompiledPatterns(e){if(!this._cachedCompiledPatterns){this._cachedCompiledPatterns=new g;for(const t of this.patterns)e.getRule(t).collectPatterns(e,this._cachedCompiledPatterns)}return this._cachedCompiledPatterns}compileWhile(e,t){return this._getCachedCompiledWhilePatterns(e,t).compile(e)}compileWhileAG(e,t,n,r){return this._getCachedCompiledWhilePatterns(e,t).compileAG(e,n,r)}_getCachedCompiledWhilePatterns(e,t){return this._cachedCompiledWhilePatterns||(this._cachedCompiledWhilePatterns=new g,this._cachedCompiledWhilePatterns.push(this._while.hasBackReferences?this._while.clone():this._while)),this._while.hasBackReferences&&this._cachedCompiledWhilePatterns.setSource(0,t||"￿"),this._cachedCompiledWhilePatterns}}t.BeginWhileRule=f;class p{static createCaptureRule(e,t,n,r,o){return e.registerRule((e=>new l(t,e,n,r,o)))}static getCompiledRuleId(e,t,n){return e.id||t.registerRule((o=>{if(e.id=o,e.match)return new c(e.$vscodeTextmateLocation,e.id,e.name,e.match,p._compileCaptures(e.captures,t,n));if(void 0===e.begin){e.repository&&(n=r.mergeObjects({},n,e.repository));let o=e.patterns;return void 0===o&&e.include&&(o=[{include:e.include}]),new u(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,p._compilePatterns(o,t,n))}return e.while?new f(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,p._compileCaptures(e.beginCaptures||e.captures,t,n),e.while,p._compileCaptures(e.whileCaptures||e.captures,t,n),p._compilePatterns(e.patterns,t,n)):new d(e.$vscodeTextmateLocation,e.id,e.name,e.contentName,e.begin,p._compileCaptures(e.beginCaptures||e.captures,t,n),e.end,p._compileCaptures(e.endCaptures||e.captures,t,n),e.applyEndPatternLast,p._compilePatterns(e.patterns,t,n))})),e.id}static _compileCaptures(e,t,n){let r=[];if(e){let o=0;for(const t in e){if("$vscodeTextmateLocation"===t)continue;const e=parseInt(t,10);e>o&&(o=e)}for(let e=0;e<=o;e++)r[e]=null;for(const a in e){if("$vscodeTextmateLocation"===a)continue;const o=parseInt(a,10);let i=0;e[a].patterns&&(i=p.getCompiledRuleId(e[a],t,n)),r[o]=p.createCaptureRule(t,e[a].$vscodeTextmateLocation,e[a].name,e[a].contentName,i)}}return r}static _compilePatterns(e,t,n){let r=[];if(e)for(let a=0,i=e.length;ae.substring(t.start,t.end)));return i.lastIndex=0,this.source.replace(i,((e,t)=>r.escapeRegExpCharacters(n[parseInt(t,10)]||"")))}_buildAnchorCache(){let e,t,n,r,o=[],a=[],i=[],s=[];for(e=0,t=this.source.length;ee.source));this._cached=new m(e,t,this._items.map((e=>e.ruleId)))}return this._cached}compileAG(e,t,n){return this._hasAnchors?t?n?(this._anchorCache.A1_G1||(this._anchorCache.A1_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G1):(this._anchorCache.A1_G0||(this._anchorCache.A1_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A1_G0):n?(this._anchorCache.A0_G1||(this._anchorCache.A0_G1=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G1):(this._anchorCache.A0_G0||(this._anchorCache.A0_G0=this._resolveAnchors(e,t,n)),this._anchorCache.A0_G0):this.compile(e)}_resolveAnchors(e,t,n){let r=this._items.map((e=>e.resolveAnchors(t,n)));return new m(e,r,this._items.map((e=>e.ruleId)))}}t.RegExpSourceList=g;class m{constructor(e,t,n){this.regExps=t,this.rules=n,this.scanner=e.createOnigScanner(t)}dispose(){"function"==typeof this.scanner.dispose&&this.scanner.dispose()}toString(){const e=[];for(let t=0,n=this.rules.length;t{Object.defineProperty(t,"__esModule",{value:!0}),t.ThemeTrieElement=t.ThemeTrieElementRule=t.ColorMap=t.fontStyleToString=t.ParsedThemeRule=t.parseTheme=t.StyleAttributes=t.ScopeStack=t.Theme=void 0;const r=n(878);class o{constructor(e,t,n){this._colorMap=e,this._defaults=t,this._root=n,this._cachedMatchRoot=new r.CachedFn((e=>this._root.match(e)))}static createFromRawTheme(e,t){return this.createFromParsedTheme(l(e),t)}static createFromParsedTheme(e,t){return function(e,t){e.sort(((e,t)=>{let n=r.strcmp(e.scope,t.scope);return 0!==n?n:(n=r.strArrCmp(e.parentScopes,t.parentScopes),0!==n?n:e.index-t.index)}));let n=0,a="#000000",i="#ffffff";for(;e.length>=1&&""===e[0].scope;){let t=e.shift();-1!==t.fontStyle&&(n=t.fontStyle),null!==t.foreground&&(a=t.foreground),null!==t.background&&(i=t.background)}let l=new u(t),c=new s(n,l.getId(a),l.getId(i)),p=new f(new d(0,null,-1,0,0),[]);for(let r=0,o=e.length;rfunction(e,t){if(null===t)return!0;let n=0,r=t[n];for(;e;){if(i(e.scopeName,r)){if(n++,n===t.length)return!0;r=t[n]}e=e.parent}return!1}(e.parent,t.parentScopes)));return n?new s(n.fontStyle,n.foreground,n.background):null}}t.Theme=o;class a{constructor(e,t){this.parent=e,this.scopeName=t}static from(...e){let t=null;for(let n=0;n1&&(d=r.slice(0,r.length-1),d.reverse()),n[o++]=new c(i,d,a,s,l,u)}}return n}t.StyleAttributes=s,t.parseTheme=l;class c{constructor(e,t,n,r,o,a){this.scope=e,this.parentScopes=t,this.index=n,this.fontStyle=r,this.foreground=o,this.background=a}}t.ParsedThemeRule=c,t.fontStyleToString=function(e){if(-1===e)return"not set";let t="";return 1&e&&(t+="italic "),2&e&&(t+="bold "),4&e&&(t+="underline "),8&e&&(t+="strikethrough "),""===t&&(t="none"),t.trim()};class u{constructor(e){if(this._lastColorId=0,this._id2color=[],this._color2id=Object.create(null),Array.isArray(e)){this._isFrozen=!0;for(let t=0,n=e.length;te?console.log("how did this happen?"):this.scopeDepth=e,-1!==t&&(this.fontStyle=t),0!==n&&(this.foreground=n),0!==r&&(this.background=r)}}t.ThemeTrieElementRule=d;class f{constructor(e,t=[],n={}){this._mainRule=e,this._children=n,this._rulesWithParentScopes=t}static _sortBySpecificity(e){return 1===e.length||e.sort(this._cmpBySpecificity),e}static _cmpBySpecificity(e,t){if(e.scopeDepth===t.scopeDepth){const n=e.parentScopes,r=t.parentScopes;let o=null===n?0:n.length,a=null===r?0:r.length;if(o===a)for(let e=0;e{function n(e){return Array.isArray(e)?function(e){let t=[];for(let r=0,o=e.length;r{for(let n in t)e[n]=t[n]})),e},t.basename=function e(t){const n=~t.lastIndexOf("/")||~t.lastIndexOf("\\");return 0===n?t:~n==t.length-1?e(t.substring(0,t.length-1)):t.substr(1+~n)};let r=/\$(\d+)|\${(\d+):\/(downcase|upcase)}/g;function o(e,t){return et?1:0}t.RegexSource=class{static hasCaptures(e){return null!==e&&(r.lastIndex=0,r.test(e))}static replaceCaptures(e,t,n){return e.replace(r,((e,r,o,a)=>{let i=n[parseInt(r||o,10)];if(!i)return e;{let e=t.substring(i.start,i.end);for(;"."===e[0];)e=e.substring(1);switch(a){case"downcase":return e.toLowerCase();case"upcase":return e.toUpperCase();default:return e}}}))}},t.strcmp=o,t.strArrCmp=function(e,t){if(null===e&&null===t)return 0;if(!e)return-1;if(!t)return 1;let n=e.length,r=t.length;if(n===r){for(let r=0;r(e[e.NotSet=-1]="NotSet",e[e.None=0]="None",e[e.Italic=1]="Italic",e[e.Bold=2]="Bold",e[e.Underline=4]="Underline",e))(Y4||{});class Q4{static toBinaryStr(e){let t=e.toString(2);for(;t.length<32;)t="0"+t;return t}static printMetadata(e){let t=Q4.getLanguageId(e),n=Q4.getTokenType(e),r=Q4.getFontStyle(e),o=Q4.getForeground(e),a=Q4.getBackground(e);console.log({languageId:t,tokenType:n,fontStyle:r,foreground:o,background:a})}static getLanguageId(e){return(255&e)>>>0}static getTokenType(e){return(768&e)>>>8}static getFontStyle(e){return(14336&e)>>>11}static getForeground(e){return(8372224&e)>>>15}static getBackground(e){return(4286578688&e)>>>24}static containsBalancedBrackets(e){return 0!=(1024&e)}static set(e,t,n,r,o,a){let i=Q4.getLanguageId(e),s=Q4.getTokenType(e),l=Q4.getFontStyle(e),c=Q4.getForeground(e),u=Q4.getBackground(e);return 0!==t&&(i=t),0!==n&&(s=8===n?0:n),-1!==r&&(l=r),0!==o&&(c=o),0!==a&&(u=a),(i<<0|s<<8|l<<11|(Q4.containsBalancedBrackets(e)?1:0)<<10|c<<15|u<<24)>>>0}}function J4(e){return e.endsWith("/")||e.endsWith("\\")?e.slice(0,-1):e}function Z4(e){return e.startsWith("./")?e.slice(2):e}function e6(e){const t=e.split(/[\/\\]/g);return t.slice(0,t.length-1)}function t6(...e){return e.map(J4).map(Z4).join("/")}function n6(e,t=!1){const n=e.length;let r=0,o="",a=0,i=16,s=0,l=0,c=0,u=0,d=0;function f(t,n){let o=0,a=0;for(;o=48&&t<=57)a=16*a+t-48;else if(t>=65&&t<=70)a=16*a+t-65+10;else{if(!(t>=97&&t<=102))break;a=16*a+t-97+10}r++,o++}return o=n)return a=n,i=17;let t=e.charCodeAt(r);if(r6(t)){do{r++,o+=String.fromCharCode(t),t=e.charCodeAt(r)}while(r6(t));return i=15}if(o6(t))return r++,o+=String.fromCharCode(t),13===t&&10===e.charCodeAt(r)&&(r++,o+="\n"),s++,c=r,i=14;switch(t){case 123:return r++,i=1;case 125:return r++,i=2;case 91:return r++,i=3;case 93:return r++,i=4;case 58:return r++,i=6;case 44:return r++,i=5;case 34:return r++,o=function(){let t="",o=r;for(;;){if(r>=n){t+=e.substring(o,r),d=2;break}const a=e.charCodeAt(r);if(34===a){t+=e.substring(o,r),r++;break}if(92!==a){if(a>=0&&a<=31){if(o6(a)){t+=e.substring(o,r),d=2;break}d=6}r++}else{if(t+=e.substring(o,r),r++,r>=n){d=2;break}switch(e.charCodeAt(r++)){case 34:t+='"';break;case 92:t+="\\";break;case 47:t+="/";break;case 98:t+="\b";break;case 102:t+="\f";break;case 110:t+="\n";break;case 114:t+="\r";break;case 116:t+="\t";break;case 117:const e=f(4,!0);e>=0?t+=String.fromCharCode(e):d=4;break;default:d=5}o=r}}return t}(),i=10;case 47:const l=r-1;if(47===e.charCodeAt(r+1)){for(r+=2;rr,scan:t?function(){let e;do{e=p()}while(e>=12&&e<=15);return e}:p,getToken:()=>i,getTokenValue:()=>o,getTokenOffset:()=>a,getTokenLength:()=>r-a,getTokenStartLine:()=>l,getTokenStartCharacter:()=>a-u,getTokenError:()=>d}}function r6(e){return 32===e||9===e}function o6(e){return 10===e||13===e}function a6(e){return e>=48&&e<=57}(U4=W4||(W4={}))[U4.lineFeed=10]="lineFeed",U4[U4.carriageReturn=13]="carriageReturn",U4[U4.space=32]="space",U4[U4._0=48]="_0",U4[U4._1=49]="_1",U4[U4._2=50]="_2",U4[U4._3=51]="_3",U4[U4._4=52]="_4",U4[U4._5=53]="_5",U4[U4._6=54]="_6",U4[U4._7=55]="_7",U4[U4._8=56]="_8",U4[U4._9=57]="_9",U4[U4.a=97]="a",U4[U4.b=98]="b",U4[U4.c=99]="c",U4[U4.d=100]="d",U4[U4.e=101]="e",U4[U4.f=102]="f",U4[U4.g=103]="g",U4[U4.h=104]="h",U4[U4.i=105]="i",U4[U4.j=106]="j",U4[U4.k=107]="k",U4[U4.l=108]="l",U4[U4.m=109]="m",U4[U4.n=110]="n",U4[U4.o=111]="o",U4[U4.p=112]="p",U4[U4.q=113]="q",U4[U4.r=114]="r",U4[U4.s=115]="s",U4[U4.t=116]="t",U4[U4.u=117]="u",U4[U4.v=118]="v",U4[U4.w=119]="w",U4[U4.x=120]="x",U4[U4.y=121]="y",U4[U4.z=122]="z",U4[U4.A=65]="A",U4[U4.B=66]="B",U4[U4.C=67]="C",U4[U4.D=68]="D",U4[U4.E=69]="E",U4[U4.F=70]="F",U4[U4.G=71]="G",U4[U4.H=72]="H",U4[U4.I=73]="I",U4[U4.J=74]="J",U4[U4.K=75]="K",U4[U4.L=76]="L",U4[U4.M=77]="M",U4[U4.N=78]="N",U4[U4.O=79]="O",U4[U4.P=80]="P",U4[U4.Q=81]="Q",U4[U4.R=82]="R",U4[U4.S=83]="S",U4[U4.T=84]="T",U4[U4.U=85]="U",U4[U4.V=86]="V",U4[U4.W=87]="W",U4[U4.X=88]="X",U4[U4.Y=89]="Y",U4[U4.Z=90]="Z",U4[U4.asterisk=42]="asterisk",U4[U4.backslash=92]="backslash",U4[U4.closeBrace=125]="closeBrace",U4[U4.closeBracket=93]="closeBracket",U4[U4.colon=58]="colon",U4[U4.comma=44]="comma",U4[U4.dot=46]="dot",U4[U4.doubleQuote=34]="doubleQuote",U4[U4.minus=45]="minus",U4[U4.openBrace=123]="openBrace",U4[U4.openBracket=91]="openBracket",U4[U4.plus=43]="plus",U4[U4.slash=47]="slash",U4[U4.formFeed=12]="formFeed",U4[U4.tab=9]="tab",(V4||(V4={})).DEFAULT={allowTrailingComma:!1},(q4=G4||(G4={}))[q4.None=0]="None",q4[q4.UnexpectedEndOfComment=1]="UnexpectedEndOfComment",q4[q4.UnexpectedEndOfString=2]="UnexpectedEndOfString",q4[q4.UnexpectedEndOfNumber=3]="UnexpectedEndOfNumber",q4[q4.InvalidUnicode=4]="InvalidUnicode",q4[q4.InvalidEscapeCharacter=5]="InvalidEscapeCharacter",q4[q4.InvalidCharacter=6]="InvalidCharacter",(K4=X4||(X4={}))[K4.OpenBraceToken=1]="OpenBraceToken",K4[K4.CloseBraceToken=2]="CloseBraceToken",K4[K4.OpenBracketToken=3]="OpenBracketToken",K4[K4.CloseBracketToken=4]="CloseBracketToken",K4[K4.CommaToken=5]="CommaToken",K4[K4.ColonToken=6]="ColonToken",K4[K4.NullKeyword=7]="NullKeyword",K4[K4.TrueKeyword=8]="TrueKeyword",K4[K4.FalseKeyword=9]="FalseKeyword",K4[K4.StringLiteral=10]="StringLiteral",K4[K4.NumericLiteral=11]="NumericLiteral",K4[K4.LineCommentTrivia=12]="LineCommentTrivia",K4[K4.BlockCommentTrivia=13]="BlockCommentTrivia",K4[K4.LineBreakTrivia=14]="LineBreakTrivia",K4[K4.Trivia=15]="Trivia",K4[K4.Unknown=16]="Unknown",K4[K4.EOF=17]="EOF";const i6=function(e,t=[],n=V4.DEFAULT){let r=null,o=[];const a=[];function i(e){Array.isArray(o)?o.push(e):null!==r&&(o[r]=e)}const s={onObjectBegin:()=>{const e={};i(e),a.push(o),o=e,r=null},onObjectProperty:e=>{r=e},onObjectEnd:()=>{o=a.pop()},onArrayBegin:()=>{const e=[];i(e),a.push(o),o=e,r=null},onArrayEnd:()=>{o=a.pop()},onLiteralValue:i,onError:(e,n,r)=>{t.push({error:e,offset:n,length:r})}};return function(e,t,n=V4.DEFAULT){const r=n6(e,!1),o=[];function a(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function i(e){return e?()=>e(r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),(()=>o.slice())):()=>!0}function s(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter()):()=>!0}function l(e){return e?t=>e(t,r.getTokenOffset(),r.getTokenLength(),r.getTokenStartLine(),r.getTokenStartCharacter(),(()=>o.slice())):()=>!0}const c=i(t.onObjectBegin),u=l(t.onObjectProperty),d=a(t.onObjectEnd),f=i(t.onArrayBegin),p=a(t.onArrayEnd),h=l(t.onLiteralValue),g=s(t.onSeparator),m=a(t.onComment),b=s(t.onError),v=n&&n.disallowComments,y=n&&n.allowTrailingComma;function w(){for(;;){const e=r.scan();switch(r.getTokenError()){case 4:x(14);break;case 5:x(15);break;case 3:x(13);break;case 1:v||x(11);break;case 2:x(12);break;case 6:x(16)}switch(e){case 12:case 13:v?x(10):m();break;case 16:x(1);break;case 15:case 14:break;default:return e}}}function x(e,t=[],n=[]){if(b(e),t.length+n.length>0){let e=r.getToken();for(;17!==e;){if(-1!==t.indexOf(e)){w();break}if(-1!==n.indexOf(e))break;e=w()}}}function S(e){const t=r.getTokenValue();return e?h(t):(u(t),o.push(t)),w(),!0}function k(){switch(r.getToken()){case 11:const e=r.getTokenValue();let t=Number(e);isNaN(t)&&(x(2),t=0),h(t);break;case 7:h(null);break;case 8:h(!0);break;case 9:h(!1);break;default:return!1}return w(),!0}function C(){return 10!==r.getToken()?(x(3,[],[2,5]),!1):(S(!1),6===r.getToken()?(g(":"),w(),D()||x(4,[],[2,5])):x(5,[],[2,5]),o.pop(),!0)}function E(){c(),w();let e=!1;for(;2!==r.getToken()&&17!==r.getToken();){if(5===r.getToken()){if(e||x(4,[],[]),g(","),w(),2===r.getToken()&&y)break}else e&&x(6,[],[]);C()||x(4,[],[2,5]),e=!0}return d(),2!==r.getToken()?x(7,[2],[]):w(),!0}function O(){f(),w();let e=!0,t=!1;for(;4!==r.getToken()&&17!==r.getToken();){if(5===r.getToken()){if(t||x(4,[],[]),g(","),w(),4===r.getToken()&&y)break}else t&&x(6,[],[]);e?(o.push(0),e=!1):o[o.length-1]++,D()||x(4,[],[4,5]),t=!0}return p(),e||o.pop(),4!==r.getToken()?x(8,[4],[]):w(),!0}function D(){switch(r.getToken()){case 3:return O();case 1:return E();case 10:return S(!0);default:return k()}}if(w(),17===r.getToken())return!!n.allowEmptyContent||(x(4,[],[]),!1);if(!D())return x(4,[],[]),!1;17!==r.getToken()&&x(9,[],[])}(e,s,n),o[0]};var s6,l6;(l6=s6||(s6={}))[l6.InvalidSymbol=1]="InvalidSymbol",l6[l6.InvalidNumberFormat=2]="InvalidNumberFormat",l6[l6.PropertyNameExpected=3]="PropertyNameExpected",l6[l6.ValueExpected=4]="ValueExpected",l6[l6.ColonExpected=5]="ColonExpected",l6[l6.CommaExpected=6]="CommaExpected",l6[l6.CloseBraceExpected=7]="CloseBraceExpected",l6[l6.CloseBracketExpected=8]="CloseBracketExpected",l6[l6.EndOfFileExpected=9]="EndOfFileExpected",l6[l6.InvalidCommentToken=10]="InvalidCommentToken",l6[l6.UnexpectedEndOfComment=11]="UnexpectedEndOfComment",l6[l6.UnexpectedEndOfString=12]="UnexpectedEndOfString",l6[l6.UnexpectedEndOfNumber=13]="UnexpectedEndOfNumber",l6[l6.InvalidUnicode=14]="InvalidUnicode",l6[l6.InvalidEscapeCharacter=15]="InvalidEscapeCharacter",l6[l6.InvalidCharacter=16]="InvalidCharacter","process"in globalThis&&"undefined"!=typeof process&&void 0!==process.release&&process.release.name;let c6="";const u6="dist/";let d6=null;function f6(e){return`${c6}${e}`}async function p6(e){const t=[],n=await async function(e){const t=f6(e);return await(globalThis.__shiki_fetch__||globalThis.fetch)(t).then((e=>e.text()))}(e);let r;try{r=JSON.parse(n)}catch(A4){if(r=i6(n,t,{allowTrailingComma:!0}),t.length)throw t[0]}return r}async function h6(e){const t=g6(await p6(e));if(t.include){const n=await h6(t6(...e6(e),t.include));n.settings&&(t.settings=n.settings.concat(t.settings)),n.bg&&!t.bg&&(t.bg=n.bg),n.colors&&(t.colors={...n.colors,...t.colors}),delete t.include}return t}function g6(e){const t=e.type||"dark",n={name:e.name,type:t,...e,...v6(e)};var r;return e.include&&(n.include=e.include),e.tokenColors&&(n.settings=e.tokenColors,delete n.tokenColors),(r=n).settings||(r.settings=[]),r.settings[0]&&r.settings[0].settings&&!r.settings[0].scope||r.settings.unshift({settings:{foreground:r.fg,background:r.bg}}),n}const m6={light:"#333333",dark:"#bbbbbb"},b6={light:"#fffffe",dark:"#1e1e1e"};function v6(e){var t,n,r,o;let a,i,s=e.settings?e.settings:e.tokenColors;const l=s?s.find((e=>!e.name&&!e.scope)):void 0;return(null==(t=null==l?void 0:l.settings)?void 0:t.foreground)&&(a=l.settings.foreground),(null==(n=null==l?void 0:l.settings)?void 0:n.background)&&(i=l.settings.background),!a&&(null==(r=null==e?void 0:e.colors)?void 0:r["editor.foreground"])&&(a=e.colors["editor.foreground"]),!i&&(null==(o=null==e?void 0:e.colors)?void 0:o["editor.background"])&&(i=e.colors["editor.background"]),a||(a="light"===e.type?m6.light:m6.dark),i||(i="light"===e.type?b6.light:b6.dark),{fg:a,bg:i}}class y6{constructor(e,t){this.languagesPath="languages/",this.languageMap={},this.scopeToLangMap={},this._onigLibPromise=e,this._onigLibName=t}get onigLib(){return this._onigLibPromise}getOnigLibName(){return this._onigLibName}getLangRegistration(e){return this.languageMap[e]}async loadGrammar(e){const t=this.scopeToLangMap[e];if(!t)return null;if(t.grammar)return t.grammar;const n=await async function(e){return await p6(e)}(H4.includes(t)?`${this.languagesPath}${t.path}`:t.path);return t.grammar=n,n}addLanguage(e){this.languageMap[e.id]=e,e.aliases&&e.aliases.forEach((t=>{this.languageMap[t]=e})),this.scopeToLangMap[e.scopeName]=e}}function w6(e,t){let n=[];for(let r=0,o=t.length;r=0&&a>=0;)x6(t[o],r[a])&&o--,a--;return-1===o}function k6(e,t,n){let r=[],o=0;for(let a=0,i=e.settings.length;ae.trim()));else{if(!Array.isArray(s.scope))continue;i=s.scope}for(let e=0,a=i.length;eNumber.parseInt(e)));if(3!==t.length||t.some((e=>Number.isNaN(e))))return;return{type:"rgb",rgb:t}}if("5"===t){const t=e.shift();if(t)return{type:"table",index:Number(t)}}}function $6(e){const t=[];for(;e.length>0;){const n=e.shift();if(!n)continue;const r=Number.parseInt(n);if(!Number.isNaN(r))if(0===r)t.push({type:"resetAll"});else if(r<=9){E6[r]&&t.push({type:"setDecoration",value:E6[r]})}else if(r<=29){const e=E6[r-20];e&&t.push({type:"resetDecoration",value:e})}else if(r<=37)t.push({type:"setForegroundColor",value:{type:"named",name:C6[r-30]}});else if(38===r){const n=D6(e);n&&t.push({type:"setForegroundColor",value:n})}else if(39===r)t.push({type:"resetForegroundColor"});else if(r<=47)t.push({type:"setBackgroundColor",value:{type:"named",name:C6[r-40]}});else if(48===r){const n=D6(e);n&&t.push({type:"setBackgroundColor",value:n})}else 49===r?t.push({type:"resetBackgroundColor"}):r>=90&&r<=97?t.push({type:"setForegroundColor",value:{type:"named",name:C6[r-90+8]}}):r>=100&&r<=107&&t.push({type:"setBackgroundColor",value:{type:"named",name:C6[r-100+8]}})}return t}var j6={black:"#000000",red:"#bb0000",green:"#00bb00",yellow:"#bbbb00",blue:"#0000bb",magenta:"#ff00ff",cyan:"#00bbbb",white:"#eeeeee",brightBlack:"#555555",brightRed:"#ff5555",brightGreen:"#00ff00",brightYellow:"#ffff55",brightBlue:"#5555ff",brightMagenta:"#ff55ff",brightCyan:"#55ffff",brightWhite:"#ffffff"};function N6(e=j6){function t(t){return e[t]}function n(e){return`#${e.map((e=>Math.max(0,Math.min(e,255)).toString(16).padStart(2,"0"))).join("")}`}let r;function o(e){return function(){if(r)return r;r=[];for(let n=0;n[t,e.colors[`terminal.ansi${t[0].toUpperCase()}${t.substring(1)}`]])))),o=function(){let e=null,t=null,n=new Set;return{parse(r){const o=[];let a=0;do{const i=O6(r,a),s=i.sequence?r.substring(a,i.startPosition):r.substring(a);if(s.length>0&&o.push({value:s,foreground:e,background:t,decorations:new Set(n)}),i.sequence){const r=$6(i.sequence);for(const o of r)"resetAll"===o.type?(e=null,t=null,n.clear()):"resetForegroundColor"===o.type?e=null:"resetBackgroundColor"===o.type?t=null:"resetDecoration"===o.type&&n.delete(o.value);for(const o of r)"setForegroundColor"===o.type?e=o.value:"setBackgroundColor"===o.type?t=o.value:"setDecoration"===o.type&&n.add(o.value)}a=i.position}while(ao.parse(t).map((t=>{let n;n=t.decorations.has("reverse")?t.background?r.value(t.background):e.bg:t.foreground?r.value(t.foreground):e.fg,t.decorations.has("dim")&&(n=function(e){const t=e.match(/#([0-9a-f]{3})([0-9a-f]{3})?([0-9a-f]{2})?/);if(t){if(t[3]){const e=Math.round(Number.parseInt(t[3],16)/2).toString(16).padStart(2,"0");return`#${t[1]}${t[2]}${e}`}return t[2]?`#${t[1]}${t[2]}80`:`#${Array.from(t[1]).map((e=>`${e}${e}`)).join("")}80`}const n=e.match(/var\((--shiki-color-ansi-[\w-]+)\)/);if(n)return`var(${n[1]}-dim)`;return e}(n));let o=Y4.None;return t.decorations.has("bold")&&(o|=Y4.Bold),t.decorations.has("italic")&&(o|=Y4.Italic),t.decorations.has("underline")&&(o|=Y4.Underline),{content:t.value,color:n,fontStyle:o}}))))}const _6={pre:({className:e,style:t,children:n})=>`
${n}
`,code:({children:e})=>`${e}`,line:({className:e,children:t})=>`${t}`,token:({style:e,children:t})=>`${t}`};function I6(e,t={}){const n=t.bg||"#fff",r=function(e,t){const n=new Map;for(const r of e){const e=t(r);n.has(e)?n.get(e).push(r):n.set(e,[r])}return n}(t.lineOptions??[],(e=>e.line)),o=t.elements||{};function a(e="",t={},n){const r=o[e]||_6[e];return r?(n=n.filter(Boolean),r({...t,children:"code"===e?n.join("\n"):n.join("")})):""}return a("pre",{className:"shiki "+(t.themeName||""),style:`background-color: ${n}`},[t.langId?`
${t.langId}
`:"",a("code",{},e.map(((n,o)=>{const i=o+1,s=function(e){const t=new Set(["line"]);for(const n of e)for(const e of n.classes??[])t.add(e);return Array.from(t)}(r.get(i)??[]).join(" ");return a("line",{className:s,lines:e,line:n,index:o},n.map(((e,r)=>{const o=[`color: ${e.color||t.fg}`];return e.fontStyle&Y4.Italic&&o.push("font-style: italic"),e.fontStyle&Y4.Bold&&o.push("font-weight: bold"),e.fontStyle&Y4.Underline&&o.push("text-decoration: underline"),a("token",{style:o.join("; "),tokens:n,token:e,index:r},[(i=e.content,i.replace(/[&<>"']/g,(e=>T6[e])))]);var i})))})))])}const T6={"&":"&","<":"<",">":">",'"':""","'":"'"};class F6 extends z4.Registry{constructor(e){super(e),this._resolver=e,this.themesPath="themes/",this._resolvedThemes={},this._resolvedGrammars={},this._langGraph=new Map,this._langMap=H4.reduce(((e,t)=>(e[t.id]=t,e)),{})}getTheme(e){return"string"==typeof e?this._resolvedThemes[e]:e}async loadTheme(e){return"string"==typeof e?(this._resolvedThemes[e]||(this._resolvedThemes[e]=await h6(`${this.themesPath}${e}.json`)),this._resolvedThemes[e]):((e=g6(e)).name&&(this._resolvedThemes[e.name]=e),e)}async loadThemes(e){return await Promise.all(e.map((e=>this.loadTheme(e))))}getLoadedThemes(){return Object.keys(this._resolvedThemes)}getGrammar(e){return this._resolvedGrammars[e]}async loadLanguage(e){var t;const n={embeddedLanguages:null==(t=e.embeddedLangs)?void 0:t.reduce((async(e,t,n)=>{if(!this.getLoadedLanguages().includes(t)&&this._resolver.getLangRegistration(t))return await this._resolver.loadGrammar(this._resolver.getLangRegistration(t).scopeName),e[this._resolver.getLangRegistration(t).scopeName]=n+2,e}),{}),balancedBracketSelectors:e.balancedBracketSelectors||["*"],unbalancedBracketSelectors:e.unbalancedBracketSelectors||[]},r=await this.loadGrammarWithConfiguration(e.scopeName,1,n);this._resolvedGrammars[e.id]=r,e.aliases&&e.aliases.forEach((e=>{this._resolvedGrammars[e]=r}))}async loadLanguages(e){for(const n of e)this.resolveEmbeddedLanguages(n);const t=Array.from(this._langGraph.values());for(const n of t)this._resolver.addLanguage(n);for(const n of t)await this.loadLanguage(n)}getLoadedLanguages(){return Object.keys(this._resolvedGrammars)}resolveEmbeddedLanguages(e){if(this._langGraph.has(e.id)||this._langGraph.set(e.id,e),e.embeddedLangs)for(const t of e.embeddedLangs)this._langGraph.set(t,this._langMap[t])}}function R6(e){return"string"==typeof e?H4.find((t=>{var n;return t.id===e||(null==(n=t.aliases)?void 0:n.includes(e))})):e}async function A6(e){var t,n;const{_languages:r,_themes:o,_wasmPath:a}=function(e){var t;let n=H4,r=e.themes||[],o=(null==(t=e.paths)?void 0:t.wasm)?e.paths.wasm.endsWith("/")?e.paths.wasm:e.paths.wasm+"/":u6;return e.langs&&(n=e.langs.map(R6)),e.theme&&r.unshift(e.theme),r.length||(r=["nord"]),{_languages:n,_themes:r,_wasmPath:o}}(e),i=new y6(async function(e){if(!d6){let t;t=L4.loadWASM({data:await(globalThis.__shiki_fetch__||globalThis.fetch)(f6(t6(...e6(e),"onig.wasm")))}),d6=t.then((()=>({createOnigScanner:e=>L4.createOnigScanner(e),createOnigString:e=>L4.createOnigString(e)})))}return d6}(a),"vscode-oniguruma"),s=new F6(i);(null==(t=e.paths)?void 0:t.themes)&&(s.themesPath=e.paths.themes.endsWith("/")?e.paths.themes:e.paths.themes+"/"),(null==(n=e.paths)?void 0:n.languages)&&(i.languagesPath=e.paths.languages.endsWith("/")?e.paths.languages:e.paths.languages+"/");const l=(await s.loadThemes(o))[0];let c;await s.loadLanguages(r);let u=function(){const e={"#000001":"var(--shiki-color-text)","#000002":"var(--shiki-color-background)","#000004":"var(--shiki-token-constant)","#000005":"var(--shiki-token-string)","#000006":"var(--shiki-token-comment)","#000007":"var(--shiki-token-keyword)","#000008":"var(--shiki-token-parameter)","#000009":"var(--shiki-token-function)","#000010":"var(--shiki-token-string-expression)","#000011":"var(--shiki-token-punctuation)","#000012":"var(--shiki-token-link)"};for(let t=0;t{e.colors[t]=u[n]||n})),t.forEach(((e,n)=>{t[n]=u[e]||e}))}(t,n),{_theme:t,_colorMap:n}}function f(e,t="text",n,r={includeExplanation:!0}){if(function(e){return!e||["plaintext","txt","text"].includes(e)}(t)){return[...e.split(/\r\n|\r|\n/).map((e=>[{content:e}]))]}const{_grammar:o}=function(e){const t=s.getGrammar(e);if(!t)throw Error(`No language registration for ${e}`);return{_grammar:t}}(t),{_theme:a,_colorMap:i}=d(n);return function(e,t,n,r,o){let a=n.split(/\r\n|\r|\n/),i=z4.INITIAL,s=[],l=[];for(let c=0,u=a.length;cd(e)._theme,loadTheme:async function(e){await s.loadTheme(e)},loadLanguage:async function(e){const t=R6(e);i.addLanguage(t),await s.loadLanguage(t)},getBackgroundColor:function(e){const{_theme:t}=d(e);return t.bg},getForegroundColor:function(e){const{_theme:t}=d(e);return t.fg},getLoadedThemes:function(){return s.getLoadedThemes()},getLoadedLanguages:function(){return s.getLoadedLanguages()},setColorReplacements:function(e){u=e}}}var M6;c6=(M6="https://cdn.jsdelivr.net/npm/shiki-es@0.14.0/dist/assets/").endsWith("/")?M6:M6+"/";const L6=Q1(((e,t)=>({codeToHtml:(e,n,r)=>{const{highlighter:o}=t();if(!o)return"";try{return null==o?void 0:o.codeToHtml(e,{lang:n,theme:r?"dark":"light"})}catch{return e}},highlighter:void 0,initHighlighter:async n=>{if(!t().highlighter){const t=await A6({langs:null==n?void 0:n.langs,themes:null==n?void 0:n.themes});e({highlighter:t})}}})),T1),B6=z.memo((({children:e,language:t,options:n})=>{const{styles:r}=T4(),{isDarkMode:o}=tB(),[a,i]=L6((e=>[e.codeToHtml,!e.highlighter]));return z.useEffect((()=>{L6.getState().initHighlighter(n)}),[n]),Q.jsxs(Q.Fragment,{children:[i?Q.jsx("code",{children:e}):Q.jsx("div",{className:r.shiki,dangerouslySetInnerHTML:{__html:a(e,t,o)||""}}),i&&Q.jsxs(qH,{className:r.loading,gap:8,horizontal:!0,children:[Q.jsx(QB,{icon:Bd,spin:!0}),"Highlighting..."]})]})})),z6=e=>{const t=e?"dark":"light",n=e?fK.yellow[t][9]:fK.gold[t][10],r=e?fK.gold[t][9]:fK.orange[t][10],o=e?fK.volcano[t][10]:fK.volcano[t][8],a=e?fK.lime[t][9]:fK.green[t][10],i=e?fK.blue[t][9]:fK.geekblue[t][9],s=e?fK.purple[t][11]:fK.purple[t][8];return{colors:{"editor.foreground":a},name:t,tokenColors:[{scope:"comma",settings:{foreground:a}},{scope:"func",settings:{foreground:s}},{scope:["and","break"],settings:{foreground:i}},{scope:"bracket",settings:{foreground:s}},{scope:"model-type",settings:{fontStyle:"italic",foreground:o}},{scope:"model-name",settings:{foreground:r}},{scope:"model-bracket",settings:{foreground:s}},{scope:"number",settings:{foreground:s}},{scope:"wildcards",settings:{foreground:n}}],type:t}},H6={langs:[{aliases:["prompt"],grammar:{$schema:"https://raw.githubusercontent.com/martinring/tmlanguage/master/tmlanguage.json",fileTypes:["prompt"],name:"prompt",patterns:[{match:"[,]",name:"comma"},{match:"[:|]",name:"func"},{match:"AND",name:"and"},{match:"BREAK",name:"break"},{match:"<([^:]+):([^:]+):([^>]+)>",captures:{0:{name:"model-bracket"},1:{name:"model-type"},2:{name:"model-name"},3:{name:"number"}}},{match:"[<|>]",name:"model-bracket"},{match:"[(|)|\\[|\\]|{|}]",name:"bracket"},{match:"(?{const t=z.useRef(null),[n,r]=z.useState(""),{styles:o,theme:a}=T4(),i=(e=>{const[t,n]=z.useState("");return z.useEffect((()=>{const t={attributes:!0,characterData:!0,childList:!0,subtree:!0},r=new MutationObserver((t=>{for(const r of t)if("attributes"===r.type){const t=document.querySelector(e);n(t.value)}})),o=document.querySelector(e);return o&&(r.observe(o,t),n(o.value)),()=>{r.disconnect()}}),[e]),t})(`${e} label textarea`),s=z.useMemo((()=>gradioApp().querySelector(`${e} label textarea`)),[e]),l=(c=s,u=ZW(DX((function(){var e=DU(c);return e?{width:e.clientWidth,height:e.clientHeight}:void 0})),2),d=u[0],f=u[1],jX((function(){var e=DU(c);if(e){var t=new Ib((function(e){e.forEach((function(e){var t=e.target,n=t.clientWidth,r=t.clientHeight;f({width:n,height:r})}))}));return t.observe(e),function(){t.disconnect()}}}),[],c),d);var c,u,d,f;const p=function(e,t){void 0===t&&(t=function(){return!0});var n=ZW(DX(),2),r=n[0],o=n[1],a=nU(t);return jU((function(){var t=DU(e,document);if(t){var n=function(){var e;e=t===document?document.scrollingElement?{left:document.scrollingElement.scrollLeft,top:document.scrollingElement.scrollTop}:{left:Math.max(window.pageXOffset,document.documentElement.scrollLeft,document.body.scrollLeft),top:Math.max(window.pageYOffset,document.documentElement.scrollTop,document.body.scrollTop)}:{left:t.scrollLeft,top:t.scrollTop},a.current(e)&&o(e)};return n(),t.addEventListener("scroll",n),function(){t.removeEventListener("scroll",n)}}}),[],e),r}(s),h=z.useCallback((e=>{r(e.target.value)}),[]),g=z.useCallback((()=>s.clientHeight{t.current.scroll(0,(null==p?void 0:p.top)||0)}),[null==p?void 0:p.top]),z.useEffect((()=>(s.addEventListener("change",h),()=>{s.removeEventListener("change",h)})),[]),z.useEffect((()=>{a&&(s.style.color="transparent",s.style.caretColor=a.colorSuccess)}),[a]),z.useEffect((()=>{r(i)}),[i]),Q.jsx("div",{className:o.container,"data-code-type":"highlighter",ref:t,style:{height:null==l?void 0:l.height,width:g()},children:Q.jsx(B6,{language:"prompt",options:H6,children:n})})})),U6=z.memo((({parentId:e})=>{const t=o4((e=>e.loading));return Q.jsx(I4,{children:!1===t&&Q.jsx(W6,{parentId:e})})})),V6=(e,t)=>{if(document.querySelector(t))return;const n=document.createElement("div");n.id=t.replace("#",""),gradioApp().querySelector(e).insertBefore(n,gradioApp().querySelector(e).firstChild),xd(n).render(Q.jsx(z.StrictMode,{children:Q.jsx(z.Suspense,{fallback:"loading...",children:Q.jsx(U6,{parentId:e})})}))}; /** * @license lucide-static v0.293.0 - ISC */ @@ -1351,7 +1351,7 @@ var G6=' div.form`),n=gradioApp().querySelector(`#${e}_formatconvert`);if(!t||n)return;const r=c8.createButton(`${e}_formatconvert`,"🪄",(()=>c8.onClickConvert(e)));t.append(r)},convert(e){const t=/\{|\[|\}|\]|[^{}[\]]+/gmu;let n=c8.convertStr(e);const r=c8.convertStr2Array(n);n=c8.convertArray2Str(r);let o=[];const a={"[":{multiplier:1/1.05,stack:[]},"{":{multiplier:1.05,stack:[]}};function i(e,t){for(let n=e;n0&&i(t.stack.pop(),t.multiplier)}else o.push([e,1])}for(const c of Object.keys(a))for(const e of a[c].stack)i(e,a[c].multiplier);0===o.length&&(o=[["",1]]);let s=0;for(;s+1e.map((e=>{if(e.includes("<"))return e;const t=e.replaceAll(/\s+/g," ").replaceAll(/,|\.\|。/g,",").replaceAll(/“|‘|”|"|\/'/g,"").replaceAll(", ",",").replaceAll(",,",",").replaceAll(",",", ");return c8.convertStr2Array(t).join(", ")})).join(", "),convertStr:e=>e.replaceAll(":",":").replaceAll("(","(").replaceAll(")",")"),convertStr2Array(e){const t=/([()<>[\]])/g;return(e=>{let n=(e=>{const n=[];let r,o=0,a=0;for(;null!==(r=t.exec(e));)0===a&&r.index>o&&(n.push(e.slice(o,r.index)),o=r.index),"("===r[0]||"<"===r[0]||"["===r[0]?a++:")"!==r[0]&&">"!==r[0]&&"]"!==r[0]||a--,0===a&&(n.push(e.slice(o,r.index+1)),o=r.index+1);return o(e=>{const n=[];let r=0,o=!1;for(let a=0;a""!==e))})(e).filter((e=>!/^[\s,,]+$/.test(e))).filter(Boolean).sort(((e,t)=>e.includes("<")&&!t.includes("<")?1:t.includes("<")&&!e.includes("<")?-1:0))},createButton(e,t,n){const r=document.createElement("button");return r.id=e,r.type="button",r.innerHTML=t,r.title="Format prompt~🪄",r.className="lg secondary gradio-button tool svelte-cmf5ev",r.addEventListener("click",n),r},dispatchInputEvent(e){let t=new Event("input");Object.defineProperty(t,"target",{value:e}),e.dispatchEvent(t)},onClickConvert(e){const t=gradioApp().querySelector(`#${e}_prompt > label > textarea`),n=c8.convert(t.value);t.value=null===n.match(/^masterpiece, best quality,/)?""+n:n,c8.dispatchInputEvent(t);const r=gradioApp().querySelector(`#${e}_neg_prompt > label > textarea`),o=c8.convert(r.value);r.value=null===o.match(/^lowres,/)?0===o.length?"":""+o:o,c8.dispatchInputEvent(r)},round:e=>Math.round(1e4*e)/1e4},u8=z.memo((()=>(z.useEffect((()=>{try{const e=gradioApp().querySelector("#txt2img_toprow"),t=gradioApp().querySelector("#txt2img_settings"),n=gradioApp().querySelector("#txt2img_generate_box"),r=gradioApp().querySelector("#txt2img_gallery_container");e&&t&&n&&r&&(t.prepend(e),r.prepend(n));const o=gradioApp().querySelector("#img2img_toprow"),a=gradioApp().querySelector("#img2img_settings"),i=gradioApp().querySelector("#img2img_generate_box"),s=gradioApp().querySelector("#img2img_gallery_container");a&&o&&i&&s&&(a.prepend(o),s.prepend(i));const l=gradioApp().querySelector("#extras_generate"),c=gradioApp().querySelector("#extras_results");l&&c&&((null==c?void 0:c.parentNode).id="#extras_gallery_container",c.prepend(l)),ue.success("🤯 [layout] inject - Split Previewer")}catch(e){ue.error("🤯 [layout] inject - Split Previewer",e)}}),[]),null))),d8=MB((({css:e,token:t,stylish:n,isDarkMode:r,responsive:o},{isPromptResizable:a,layoutSplitPreview:i})=>({container:e` + `,Y6(e),n8(e),o8(e),a8(e),i8(e),s8(e),J6(e),t8(e)];var t})),c8={addPromptButton(e){ue.info("🤯 [formatPrompt] inject",e);const t=gradioApp().querySelector(`#${e}_tools > div.form`),n=gradioApp().querySelector(`#${e}_formatconvert`);if(!t||n)return;const r=c8.createButton(`${e}_formatconvert`,"🪄",(()=>c8.onClickConvert(e)));t.append(r)},convert(e){const t=/\{|\[|\}|\]|[^{}[\]]+/gmu;let n=c8.convertStr(e);const r=c8.convertStr2Array(n);n=c8.convertArray2Str(r);let o=[];const a={"[":{multiplier:1/1.05,stack:[]},"{":{multiplier:1.05,stack:[]}};function i(e,t){for(let n=e;n0&&i(t.stack.pop(),t.multiplier)}else o.push([e,1])}for(const c of Object.keys(a))for(const e of a[c].stack)i(e,a[c].multiplier);0===o.length&&(o=[["",1]]);let s=0;for(;s+1e.map((e=>{if(e.includes("<"))return e;const t=e.replaceAll(/\s+/g," ").replaceAll(/,|\.\|。/g,",").replaceAll(/“|‘|”|"|\/'/g,"").replaceAll(", ",",").replaceAll(",,",",").replaceAll(",",", ");return c8.convertStr2Array(t).join(", ")})).join(", "),convertStr:e=>e.replaceAll(":",":").replaceAll("(","(").replaceAll(")",")"),convertStr2Array(e){const t=/([()<>[\]])/g;return(e=>{let n=(e=>{const n=[];let r,o=0,a=0;for(;null!==(r=t.exec(e));)0===a&&r.index>o&&(n.push(e.slice(o,r.index)),o=r.index),"("===r[0]||"<"===r[0]||"["===r[0]?a++:")"!==r[0]&&">"!==r[0]&&"]"!==r[0]||a--,0===a&&(n.push(e.slice(o,r.index+1)),o=r.index+1);return o(e=>{const n=[];let r=0,o=!1;for(let a=0;a""!==e))})(e).filter((e=>!/^[\s,,]+$/.test(e))).filter(Boolean).sort(((e,t)=>e.includes("<")&&!t.includes("<")?1:t.includes("<")&&!e.includes("<")?-1:0))},createButton(e,t,n){const r=document.createElement("button");return r.id=e,r.type="button",r.innerHTML=t,r.title="Format prompt~🪄",r.className="lg secondary gradio-button tool svelte-cmf5ev",r.addEventListener("click",n),r},dispatchInputEvent(e){let t=new Event("input");Object.defineProperty(t,"target",{value:e}),e.dispatchEvent(t)},onClickConvert(e){const t=gradioApp().querySelector(`#${e}_prompt > label > textarea`),n=c8.convert(t.value);t.value=null===n.match(/^masterpiece, best quality,/)?""+n:n,c8.dispatchInputEvent(t);const r=gradioApp().querySelector(`#${e}_neg_prompt > label > textarea`),o=c8.convert(r.value);r.value=null===o.match(/^lowres,/)?0===o.length?"":""+o:o,c8.dispatchInputEvent(r)},round:e=>Math.round(1e4*e)/1e4},u8=z.memo((()=>(z.useEffect((()=>{try{const e=gradioApp().querySelector("#txt2img_toprow"),t=gradioApp().querySelector("#txt2img_settings"),n=gradioApp().querySelector("#txt2img_generate_box"),r=gradioApp().querySelector("#txt2img_gallery_container");e&&t&&n&&r&&(t.prepend(e),r.prepend(n));const o=gradioApp().querySelector("#img2img_toprow"),a=gradioApp().querySelector("#img2img_settings"),i=gradioApp().querySelector("#img2img_generate_box"),s=gradioApp().querySelector("#img2img_gallery_container");a&&o&&i&&s&&(a.prepend(o),s.prepend(i));const l=gradioApp().querySelector("#extras_generate"),c=gradioApp().querySelector("#extras_results");l&&c&&((null==c?void 0:c.parentNode).id="#extras_gallery_container",c.prepend(l)),ue.success("🤯 [layout] inject - Split Previewer")}catch(e){ue.error("🤯 [layout] inject - Split Previewer",e)}}),[]),null))),d8=MB((({css:e,token:t,stylish:n,isDarkMode:r,responsive:o},{isPromptResizable:a,layoutSplitPreview:i})=>({container:e` position: relative; flex: 1; min-width: ${i?"200px":"0"}; diff --git a/src/modules/PromptHighlight/App.tsx b/src/modules/PromptHighlight/App.tsx index 8bf7d72..46311d1 100644 --- a/src/modules/PromptHighlight/App.tsx +++ b/src/modules/PromptHighlight/App.tsx @@ -78,7 +78,7 @@ const App = memo(({ parentId }) => { style={{ height: size?.height, width: handlePromptResize() }} > - {prompt.trim()} + {prompt} ); diff --git a/src/scripts/formatPrompt.ts b/src/scripts/formatPrompt.ts index d61296f..f78fdb1 100644 --- a/src/scripts/formatPrompt.ts +++ b/src/scripts/formatPrompt.ts @@ -175,13 +175,13 @@ export const Converter = { let inBracket = false; for (let index = 0; index < string__.length; index++) { if (string__[index] === ',' && !inBracket) { - array.push(string__.slice(start, index).trim()); + array.push(string__.slice(start, index)); start = index + 1; } else if (bracketRegex.test(string__[index])) { inBracket = !inBracket; } } - array.push(string__.slice(Math.max(0, start)).trim()); + array.push(string__.slice(Math.max(0, start))); return array; };