Files
mermaid-live-editor/_app/chunks/state-ed309cb8.js
T
2022-05-09 07:06:16 +00:00

20 lines
78 KiB
JavaScript

var G=Object.defineProperty,K=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var z=Object.getOwnPropertySymbols;var j=Object.prototype.hasOwnProperty,V=Object.prototype.propertyIsEnumerable;var Y=(e,n,t)=>n in e?G(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,B=(e,n)=>{for(var t in n||(n={}))j.call(n,t)&&Y(e,t,n[t]);if(z)for(var t of z(n))V.call(n,t)&&Y(e,t,n[t]);return e},k=(e,n)=>K(e,X(n));import{w as writable,_ as __vitePreload,d as derived}from"./preload-helper-5fa16730.js";import{O as get_store_value}from"./index-b06f7db9.js";const defaultLoading={loading:!1},loadingStateStore=writable(defaultLoading),initLoading=async(e,n)=>{loadingStateStore.set({loading:!0,message:e});const t=await n;return loadingStateStore.set({loading:!1}),t};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var browserCookies={};(function(e){e.defaults={},e.set=function(n,t,i){var a=i||{},r=e.defaults,l=a.expires||r.expires,o=a.domain||r.domain,u=a.path!==void 0?a.path:r.path!==void 0?r.path:"/",_=a.secure!==void 0?a.secure:r.secure,s=a.httponly!==void 0?a.httponly:r.httponly,N=a.samesite!==void 0?a.samesite:r.samesite,h=l?new Date(typeof l=="number"?new Date().getTime()+l*864e5:l):0;document.cookie=n.replace(/[^+#$&^`|]/g,encodeURIComponent).replace("(","%28").replace(")","%29")+"="+t.replace(/[^+#$&/:<-\[\]-}]/g,encodeURIComponent)+(h&&h.getTime()>=0?";expires="+h.toUTCString():"")+(o?";domain="+o:"")+(u?";path="+u:"")+(_?";secure":"")+(s?";httponly":"")+(N?";samesite="+N:"")},e.get=function(n){for(var t=document.cookie.split(";");t.length;){var i=t.pop(),a=i.indexOf("=");a=a<0?i.length:a;var r=decodeURIComponent(i.slice(0,a).replace(/^\s+/,""));if(r===n)return decodeURIComponent(i.slice(a+1))}return null},e.erase=function(n,t){e.set(n,"",{expires:-1,domain:t&&t.domain,path:t&&t.path,secure:0,httponly:0})},e.all=function(){for(var n={},t=document.cookie.split(";");t.length;){var i=t.pop(),a=i.indexOf("=");a=a<0?i.length:a;var r=decodeURIComponent(i.slice(0,a).replace(/^\s+/,""));n[r]=decodeURIComponent(i.slice(a+1))}return n}})(browserCookies);var bundle={};(function(exports){(function(e,n){for(var t in n)e[t]=n[t];n.__esModule&&Object.defineProperty(e,"__esModule",{value:!0})})(exports,(()=>{var __webpack_modules__={607:(module,exports,__webpack_require__)=>{Object.defineProperty(exports,"__esModule",{value:!0});var serializer_1=__webpack_require__(810),deserializer_1=__webpack_require__(496),Module;typeof process!="undefined"&&process.release.name==="node"&&(Module=eval("require")("module"));var ESSerializer=function(){function e(){}return e.throwErrorIfInNonNodeEnvironment=function(){if(!Module)throw new Error("Cannot intercept require in non-Node environment.")},e.interceptRequire=function(){this.isRequireIntercepted||(this.isRequireIntercepted=!0,this.throwErrorIfInNonNodeEnvironment(),e.originRequire=Module.prototype.require,Module.prototype.require=function(){var n=e.originRequire.apply(this,arguments),t=n.name;return e.requiredClasses[t]||(e.requiredClasses[t]=n),n})},e.stopInterceptRequire=function(){this.throwErrorIfInNonNodeEnvironment(),Module.prototype.require=e.originRequire,this.isRequireIntercepted=!1},e.isInterceptingRequire=function(){return this.isRequireIntercepted},e.getRequiredClasses=function(){return this.requiredClasses},e.clearRequiredClasses=function(){this.requiredClasses={}},e.registerClass=function(n){this.registeredClasses.push(n)},e.registerClasses=function(n){this.registeredClasses=this.registeredClasses.concat(n)},e.clearRegisteredClasses=function(){this.registeredClasses=[]},e.serialize=function(n,t){return t===void 0&&(t={}),JSON.stringify(serializer_1.getSerializeValueWithClassName(n,t))},e.deserialize=function(n,t,i){return t===void 0&&(t=[]),i===void 0&&(i={}),deserializer_1.deserializeFromParsedObj(JSON.parse(n),Object.values(this.requiredClasses).concat(this.registeredClasses).concat(t),i)},e.originRequire=null,e.isRequireIntercepted=!1,e.requiredClasses={},e.registeredClasses=[],e}();module.exports=ESSerializer},917:function(e,n){var t=this&&this.__spreadArrays||function(){for(var x=0,m=0,F=arguments.length;m<F;m++)x+=arguments[m].length;var $=Array(x),Z=0;for(m=0;m<F;m++)for(var H=arguments[m],M=0,P=H.length;M<P;M++,Z++)$[Z]=H[M];return $};Object.defineProperty(n,"__esModule",{value:!0}),n.TO_STRING_FIELD=n.TIMESTAMP_FIELD=n.OPTIONS_FIELD=n.CLASS_NAME_FIELD=n.BOOLEAN_FIELD=n.ARRAY_FIELD=n.BUILTIN_TYPE_UNDEFINED=n.BUILTIN_TYPE_NOT_FINITE=n.BUILTIN_TYPE_BIG_INT=n.BUILTIN_CLASS_AGGREGATE_ERROR=n.BUILTIN_CLASS_URI_ERROR=n.BUILTIN_CLASS_TYPE_ERROR=n.BUILTIN_CLASS_SYNTAX_ERROR=n.BUILTIN_CLASS_REFERENCE_ERROR=n.BUILTIN_CLASS_RANGE_ERROR=n.BUILTIN_CLASS_EVAL_ERROR=n.BUILTIN_CLASS_ERROR=n.BUILTIN_CLASS_STRING=n.BUILTIN_CLASS_SET=n.BUILTIN_CLASS_REGEXP=n.BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT=n.BUILTIN_CLASS_INTL_PLURALRULES=n.BUILTIN_CLASS_INTL_NUMBERFORMAT=n.BUILTIN_CLASS_INTL_LOCALE=n.BUILTIN_CLASS_INTL_LISTFORMAT=n.BUILTIN_CLASS_INTL_DATETIMEFORMAT=n.BUILTIN_CLASS_INTL_COLLATOR=n.BUILTIN_CLASS_DATE=n.BUILTIN_CLASS_DATAVIEW=n.BUILTIN_CLASS_BOOLEAN=n.BUILTIN_CLASS_SHAREDARRAYBUFFER=n.BUILTIN_CLASS_ARRAYBUFFER=n.BUILTIN_CLASS_BIGUINT64ARRAY=n.BUILTIN_CLASS_BIGINT64ARRAY=n.BUILTIN_CLASS_FLOAT64ARRAY=n.BUILTIN_CLASS_FLOAT32ARRAY=n.BUILTIN_CLASS_UINT32ARRAY=n.BUILTIN_CLASS_INT32ARRAY=n.BUILTIN_CLASS_UINT16ARRAY=n.BUILTIN_CLASS_INT16ARRAY=n.BUILTIN_CLASS_UINT8CLAMPEDARRAY=n.BUILTIN_CLASS_UINT8ARRAY=n.BUILTIN_CLASS_INT8ARRAY=n.CLASSNAMES_WHOSE_ENUMERABLE_PROPERTIES_SHOULD_BE_IGNORED=n.ALL_BUILTIN_INTLS=n.ALL_BUILTIN_ERRORS=n.ALL_BUILTIN_ARRAYS=n.ESSERIALIZER_NULL=void 0,n.ESSERIALIZER_NULL="__ESSERIALIZER_NULL__",n.ARRAY_FIELD="ess_arr",n.BOOLEAN_FIELD="ess_bool",n.CLASS_NAME_FIELD="ess_cn",n.OPTIONS_FIELD="ess_opt",n.TIMESTAMP_FIELD="ess_ts",n.TO_STRING_FIELD="ess_str";var i="Int8Array";n.BUILTIN_CLASS_INT8ARRAY=i;var a="Uint8Array";n.BUILTIN_CLASS_UINT8ARRAY=a;var r="Uint8ClampedArray";n.BUILTIN_CLASS_UINT8CLAMPEDARRAY=r;var l="Int16Array";n.BUILTIN_CLASS_INT16ARRAY=l;var o="Uint16Array";n.BUILTIN_CLASS_UINT16ARRAY=o;var u="Int32Array";n.BUILTIN_CLASS_INT32ARRAY=u;var _="Uint32Array";n.BUILTIN_CLASS_UINT32ARRAY=_;var s="Float32Array";n.BUILTIN_CLASS_FLOAT32ARRAY=s;var N="Float64Array";n.BUILTIN_CLASS_FLOAT64ARRAY=N;var h="BigInt64Array";n.BUILTIN_CLASS_BIGINT64ARRAY=h;var f="BigUint64Array";n.BUILTIN_CLASS_BIGUINT64ARRAY=f,n.BUILTIN_CLASS_ARRAYBUFFER="ArrayBuffer",n.BUILTIN_CLASS_SHAREDARRAYBUFFER="SharedArrayBuffer",n.BUILTIN_CLASS_BOOLEAN="Boolean",n.BUILTIN_CLASS_DATAVIEW="DataView",n.BUILTIN_CLASS_DATE="Date";var A="Collator";n.BUILTIN_CLASS_INTL_COLLATOR=A;var p="DateTimeFormat";n.BUILTIN_CLASS_INTL_DATETIMEFORMAT=p;var L="ListFormat";n.BUILTIN_CLASS_INTL_LISTFORMAT=L,n.BUILTIN_CLASS_INTL_LOCALE="Locale";var c="NumberFormat";n.BUILTIN_CLASS_INTL_NUMBERFORMAT=c;var T="PluralRules";n.BUILTIN_CLASS_INTL_PLURALRULES=T;var I="RelativeTimeFormat";n.BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT=I,n.BUILTIN_CLASS_REGEXP="RegExp",n.BUILTIN_CLASS_SET="Set";var d="String";n.BUILTIN_CLASS_STRING=d;var g="Error";n.BUILTIN_CLASS_ERROR=g;var C="EvalError";n.BUILTIN_CLASS_EVAL_ERROR=C;var E="RangeError";n.BUILTIN_CLASS_RANGE_ERROR=E;var S="ReferenceError";n.BUILTIN_CLASS_REFERENCE_ERROR=S;var w="SyntaxError";n.BUILTIN_CLASS_SYNTAX_ERROR=w;var b="TypeError";n.BUILTIN_CLASS_TYPE_ERROR=b;var R="URIError";n.BUILTIN_CLASS_URI_ERROR=R;var O="AggregateError";n.BUILTIN_CLASS_AGGREGATE_ERROR=O,n.BUILTIN_TYPE_BIG_INT="BI",n.BUILTIN_TYPE_NOT_FINITE="NF",n.BUILTIN_TYPE_UNDEFINED="UD";var D=[i,a,r,l,o,u,_,s,N,h,f];n.ALL_BUILTIN_ARRAYS=D;var v=[g,C,E,S,w,b,R,O];n.ALL_BUILTIN_ERRORS=v;var y=[A,p,L,c,T,I];n.ALL_BUILTIN_INTLS=y;var U=t([d],D);n.CLASSNAMES_WHOSE_ENUMERABLE_PROPERTIES_SHOULD_BE_IGNORED=U},496:function(e,n,t){var i=this&&this.__spreadArrays||function(){for(var c=0,T=0,I=arguments.length;T<I;T++)c+=arguments[T].length;var d=Array(c),g=0;for(T=0;T<I;T++)for(var C=arguments[T],E=0,S=C.length;E<S;E++,g++)d[g]=C[E];return d};Object.defineProperty(n,"__esModule",{value:!0}),n.getParentClassName=n.getClassMappingFromClassArray=n.deserializeFromParsedObjWithClassMapping=n.deserializeFromParsedObj=void 0;var a=t(821),r=t(917),l=/^\s*class\s+/;function o(c,T,I){if(I===void 0&&(I={}),a.notObject(c))return c;if(Array.isArray(c))return u(c,T);var d=c[r.CLASS_NAME_FIELD],g=function(E,S,w){switch(E){case r.BUILTIN_CLASS_INT8ARRAY:return _(S[r.ARRAY_FIELD],Int8Array);case r.BUILTIN_CLASS_UINT8ARRAY:return _(S[r.ARRAY_FIELD],Uint8Array);case r.BUILTIN_CLASS_UINT8CLAMPEDARRAY:return _(S[r.ARRAY_FIELD],Uint8ClampedArray);case r.BUILTIN_CLASS_INT16ARRAY:return _(S[r.ARRAY_FIELD],Int16Array);case r.BUILTIN_CLASS_UINT16ARRAY:return _(S[r.ARRAY_FIELD],Uint16Array);case r.BUILTIN_CLASS_INT32ARRAY:return _(S[r.ARRAY_FIELD],Int32Array);case r.BUILTIN_CLASS_UINT32ARRAY:return _(S[r.ARRAY_FIELD],Uint32Array);case r.BUILTIN_CLASS_FLOAT32ARRAY:return _(S[r.ARRAY_FIELD],Float32Array);case r.BUILTIN_CLASS_FLOAT64ARRAY:return _(S[r.ARRAY_FIELD],Float64Array);case r.BUILTIN_CLASS_BIGINT64ARRAY:return s(S[r.ARRAY_FIELD],BigInt64Array);case r.BUILTIN_CLASS_BIGUINT64ARRAY:return s(S[r.ARRAY_FIELD],BigUint64Array);case r.BUILTIN_TYPE_BIG_INT:return N(S[r.TO_STRING_FIELD]);case r.BUILTIN_TYPE_UNDEFINED:return;case r.BUILTIN_TYPE_NOT_FINITE:return a.getValueFromToStringResult(S[r.TO_STRING_FIELD]);case r.BUILTIN_CLASS_ARRAYBUFFER:return b=S[r.ARRAY_FIELD],new Uint8Array(b).buffer;case r.BUILTIN_CLASS_SHAREDARRAYBUFFER:return function(R){var O=new SharedArrayBuffer(R.length),D=new Uint8Array(O);return R.forEach(function(v,y){D[y]=v}),O}(S[r.ARRAY_FIELD]);case r.BUILTIN_CLASS_BOOLEAN:return function(R){return new Boolean(R[r.BOOLEAN_FIELD])}(S);case r.BUILTIN_CLASS_DATAVIEW:return function(R){return new DataView(new Uint8Array(R).buffer)}(S[r.ARRAY_FIELD]);case r.BUILTIN_CLASS_DATE:return function(R){return typeof R[r.TIMESTAMP_FIELD]=="number"?new Date(R[r.TIMESTAMP_FIELD]):null}(S);case r.BUILTIN_CLASS_INTL_COLLATOR:return h(S,Intl.Collator);case r.BUILTIN_CLASS_INTL_DATETIMEFORMAT:return h(S,Intl.DateTimeFormat);case r.BUILTIN_CLASS_INTL_LISTFORMAT:return h(S,Intl.ListFormat);case r.BUILTIN_CLASS_INTL_LOCALE:return new Intl.Locale(S[r.TO_STRING_FIELD]);case r.BUILTIN_CLASS_INTL_NUMBERFORMAT:return h(S,Intl.NumberFormat);case r.BUILTIN_CLASS_INTL_PLURALRULES:return h(S,Intl.PluralRules);case r.BUILTIN_CLASS_INTL_RELATIVETIMEFORMAT:return h(S,Intl.RelativeTimeFormat);case r.BUILTIN_CLASS_REGEXP:return function(R){var O=R[r.TO_STRING_FIELD],D=O.lastIndexOf("/");return new RegExp(O.substring(1,D),O.substring(D+1))}(S);case r.BUILTIN_CLASS_SET:return function(R,O){return new Set(u(R[r.ARRAY_FIELD],O))}(S,w);case r.BUILTIN_CLASS_STRING:return function(R){return new String(R[r.TO_STRING_FIELD])}(S);case r.BUILTIN_CLASS_ERROR:return f(S,Error);case r.BUILTIN_CLASS_EVAL_ERROR:return f(S,EvalError);case r.BUILTIN_CLASS_RANGE_ERROR:return f(S,RangeError);case r.BUILTIN_CLASS_REFERENCE_ERROR:return f(S,ReferenceError);case r.BUILTIN_CLASS_SYNTAX_ERROR:return f(S,SyntaxError);case r.BUILTIN_CLASS_TYPE_ERROR:return f(S,TypeError);case r.BUILTIN_CLASS_URI_ERROR:return f(S,URIError);case r.BUILTIN_CLASS_AGGREGATE_ERROR:return f(S,AggregateError);default:return r.ESSERIALIZER_NULL}var b}(d,c,T);if(g!==r.ESSERIALIZER_NULL)return g;if(d&&!T[d])throw new Error("Class "+d+" not found");var C=[];return I.fieldsForConstructorParameters&&(C=I.fieldsForConstructorParameters.map(function(E){return E in c?c[E]:{}})),function(E,S,w,b){for(var R in S){var O=S[R];if(!b.ignoreProperties||!b.ignoreProperties.includes(R))if(b.rawProperties&&b.rawProperties.includes(R))E[R]=JSON.stringify(O);else{var D=Object.getOwnPropertyDescriptor(E,R);v=O,y=D,R===r.CLASS_NAME_FIELD||y&&(typeof y.set=="function"||y.writable===!1&&typeof v!="object")||(D&&D.writable===!1&&typeof O=="object"?p(E[R],O,w):E[R]=o(O,w))}}var v,y;return E}(function(E,S){var w={};if(!E)return w;var b=E.length-S.length;if(b>0&&(S=S.concat(Array.from(Array(b),function(){return{}}))),l.test(E.toString()))try{w=new(E.bind.apply(E,i([void 0],S)))}catch{A(E.name),w={},Object.setPrototypeOf(w,E?E.prototype:Object.prototype)}else{w=Object.create(E.prototype.constructor.prototype);try{E.prototype.constructor.call(w,S)}catch{A(E.name)}}return w}(T[d],C),c,T,I)}function u(c,T){return c.map(function(I){return o(I,T)})}function _(c,T){return new T(c)}function s(c,T){return new T(c.map(function(I){return N(I[r.TO_STRING_FIELD])}))}function N(c){return BigInt(c)}function h(c,T){var I=c[r.OPTIONS_FIELD],d=I.locale;return delete I.locale,new T(d,I)}function f(c,T){var I;return delete(I=c.message?new T(c.message):new T).stack,c.name&&(I.name=c.name),c.stack&&(I.stack=c.stack),T===AggregateError&&(I.errors=o(c.errors,{})),I}function A(c){console.warn("Incorrect parameter type passed to constructor: "+c)}function p(c,T,I){for(var d in T){var g=Object.getOwnPropertyDescriptor(c,d);g&&g.writable!==!0&&typeof g.set!="function"||(c[d]=o(T[d],I))}}function L(c){c===void 0&&(c=[]);var T={};return c.forEach(function(I){if(a.isClass(I)){var d=I.name,g=T[d];g&&g!==I&&console.warn("WARNING: Found class definition with the same name: "+d),T[d]=I}}),T}n.deserializeFromParsedObj=function(c,T,I){return o(c,L(T),I)},n.deserializeFromParsedObjWithClassMapping=o,n.getClassMappingFromClassArray=L,n.getParentClassName=function(c){return c.prototype.__proto__.constructor.name}},821:(e,n)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.isClass=n.notObject=n.getValueFromToStringResult=void 0,n.notObject=function(t){return t===null||typeof t!="object"},n.getValueFromToStringResult=function(t){switch(t){case"Infinity":return 1/0;case"-Infinity":return-1/0;case"NaN":return NaN;default:return null}},n.isClass=function(t){if(function(i){return[Date].indexOf(i)>=0}(t))return!0;try{Reflect.construct(String,[],t)}catch{return!1}return!0}},810:(e,n,t)=>{Object.defineProperty(n,"__esModule",{value:!0}),n.getSerializeValueWithClassName=void 0;var i=t(917),a=t(821);function r(o,u){u===void 0&&(u={});var _=function(f){var A,p,L;return f===void 0?((A={})[i.CLASS_NAME_FIELD]=i.BUILTIN_TYPE_UNDEFINED,A):typeof f!="number"||isFinite(f)?typeof f=="bigint"?((L={})[i.CLASS_NAME_FIELD]=i.BUILTIN_TYPE_BIG_INT,L[i.TO_STRING_FIELD]=f.toString(),L):a.notObject(f)?f:i.ESSERIALIZER_NULL:((p={})[i.CLASS_NAME_FIELD]=i.BUILTIN_TYPE_NOT_FINITE,p[i.TO_STRING_FIELD]=f.toString(),p)}(o);if(_!==i.ESSERIALIZER_NULL)return _;if(Array.isArray(o))return l(o);var s={};if(!function(f){var A=f.__proto__.constructor.name;return i.CLASSNAMES_WHOSE_ENUMERABLE_PROPERTIES_SHOULD_BE_IGNORED.includes(A)}(o)){if(u.ignoreProperties&&u.ignoreProperties.forEach(function(f){delete o[f]}),u.interceptProperties)for(var N in u.interceptProperties)o[N]=u.interceptProperties[N].call(o,o[N]);for(var h in o)s[h]=r(o[h])}return function(f,A){var p=f.__proto__.constructor.name;return p!=="Object"&&(A[i.CLASS_NAME_FIELD]=p,p===i.BUILTIN_CLASS_ARRAYBUFFER||p===i.BUILTIN_CLASS_SHAREDARRAYBUFFER?A[i.ARRAY_FIELD]=l(Array.from(new Uint8Array(f))):p===i.BUILTIN_CLASS_BOOLEAN?A[i.BOOLEAN_FIELD]=f.valueOf():p===i.BUILTIN_CLASS_DATAVIEW?A[i.ARRAY_FIELD]=l(Array.from(new Uint8Array(f.buffer))):p===i.BUILTIN_CLASS_DATE?A[i.TIMESTAMP_FIELD]=f.getTime():p===i.BUILTIN_CLASS_INTL_LOCALE||p===i.BUILTIN_CLASS_REGEXP?A[i.TO_STRING_FIELD]=f.toString():p===i.BUILTIN_CLASS_SET?A[i.ARRAY_FIELD]=l(Array.from(f)):p===i.BUILTIN_CLASS_STRING?A[i.TO_STRING_FIELD]=f.toString():i.ALL_BUILTIN_ARRAYS.includes(p)?A[i.ARRAY_FIELD]=l(Array.from(f)):i.ALL_BUILTIN_ERRORS.includes(p)?function(L,c,T){L.name!=="Error"&&(c.name=L.name),L.message&&(c.message=L.message),L.stack&&(c.stack=L.stack),T===i.BUILTIN_CLASS_AGGREGATE_ERROR&&(c.errors=r(L.errors))}(f,A,p):i.ALL_BUILTIN_INTLS.includes(p)&&(A[i.OPTIONS_FIELD]=f.resolvedOptions())),A}(o,s)}function l(o){return o.map(function(u){return r(u)})}n.getSerializeValueWithClassName=r}},__webpack_module_cache__={};function __webpack_require__(e){if(__webpack_module_cache__[e])return __webpack_module_cache__[e].exports;var n=__webpack_module_cache__[e]={exports:{}};return __webpack_modules__[e].call(n.exports,n,n.exports,__webpack_require__),n.exports}return __webpack_require__(607)})())})(bundle);var ESSerializer=getDefaultExportFromCjs(bundle);const alreadyWarnFor=[],warnStorageNotFound=e=>{var n;const t=typeof process!="undefined"&&((n=process.env)===null||n===void 0?void 0:n.NODE_ENV)==="production";if(alreadyWarnFor.indexOf(e)===-1&&!t){let i=`Unable to find the ${e}. No data will be persisted.`;typeof window=="undefined"&&(i+=`
Are you running on a server? Most of storages are not available while running on a server.`),console.warn(i),alreadyWarnFor.push(e)}},allowedClasses=[],serialize=e=>ESSerializer.serialize(e),deserialize=e=>{if(e!=="undefined"){if(e!=null){try{return ESSerializer.deserialize(e,allowedClasses)}catch{}try{return JSON.parse(e)}catch{}}return e}};function persist(e,n,t){const i=n.getValue(t);return i!==null&&e.set(i),n.addListener&&n.addListener(t,a=>{e.set(a)}),e.subscribe(a=>{n.setValue(t,a)}),Object.assign(Object.assign({},e),{delete(){n.deleteValue(t)}})}function getBrowserStorage(e,n=!1){const t=[],i=l=>{const o=l.key;l.storageArea===e&&t.filter(({key:u})=>u===o).forEach(({listener:u})=>{u(deserialize(l.newValue))})},a=()=>{n&&typeof window!="undefined"&&(window==null?void 0:window.addEventListener)&&window.addEventListener("storage",i)},r=()=>{n&&typeof window!="undefined"&&(window==null?void 0:window.removeEventListener)&&window.removeEventListener("storage",i)};return{addListener(l,o){t.push({key:l,listener:o}),t.length===1&&a()},removeListener(l,o){const u=t.indexOf({key:l,listener:o});u!==-1&&t.splice(u,1),t.length===0&&r()},getValue(l){const o=e.getItem(l);return deserialize(o)},deleteValue(l){e.removeItem(l)},setValue(l,o){e.setItem(l,serialize(o))}}}function localStorage(e=!1){return typeof window!="undefined"&&(window==null?void 0:window.localStorage)?getBrowserStorage(window.localStorage,e):(warnStorageNotFound("window.localStorage"),noopStorage())}function noopStorage(){return{getValue(){return null},deleteValue(){},setValue(){}}}let analytics;const initAnalytics=async()=>{if(!analytics)try{const{Analytics:e}=await __vitePreload(()=>import("./analytics.browser.es-da2e3609.js"),[]),n=await __vitePreload(()=>import("./analytics-plugin-ga.browser.es-1cdb0512.js"),[]);analytics=e({app:"mermaid-live-editor",plugins:[n.init({trackingId:"UA-153180559-1"})]})}catch{console.info("Analytics blocked ;)")}},detectType=e=>e.replace(/^\s*%%.*\n/g,`
`).trimStart().split(" ")[0];let timeout;const saveStatistics=e=>{analytics&&(clearTimeout(timeout),timeout=setTimeout(function(){const n=detectType(e);console.debug("ga:","send","event","render",n),analytics.track("render",{graphType:n})},5e3))};/*! pako 2.0.4 https://github.com/nodeca/pako @license (MIT AND Zlib) */const Z_FIXED$1=4,Z_BINARY=0,Z_TEXT=1,Z_UNKNOWN$1=2;function zero$1(e){let n=e.length;for(;--n>=0;)e[n]=0}const STORED_BLOCK=0,STATIC_TREES=1,DYN_TREES=2,MIN_MATCH$1=3,MAX_MATCH$1=258,LENGTH_CODES$1=29,LITERALS$1=256,L_CODES$1=LITERALS$1+1+LENGTH_CODES$1,D_CODES$1=30,BL_CODES$1=19,HEAP_SIZE$1=2*L_CODES$1+1,MAX_BITS$1=15,Buf_size=16,MAX_BL_BITS=7,END_BLOCK=256,REP_3_6=16,REPZ_3_10=17,REPZ_11_138=18,extra_lbits=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),extra_dbits=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),extra_blbits=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),bl_order=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),DIST_CODE_LEN=512,static_ltree=new Array((L_CODES$1+2)*2);zero$1(static_ltree);const static_dtree=new Array(D_CODES$1*2);zero$1(static_dtree);const _dist_code=new Array(DIST_CODE_LEN);zero$1(_dist_code);const _length_code=new Array(MAX_MATCH$1-MIN_MATCH$1+1);zero$1(_length_code);const base_length=new Array(LENGTH_CODES$1);zero$1(base_length);const base_dist=new Array(D_CODES$1);zero$1(base_dist);function StaticTreeDesc(e,n,t,i,a){this.static_tree=e,this.extra_bits=n,this.extra_base=t,this.elems=i,this.max_length=a,this.has_stree=e&&e.length}let static_l_desc,static_d_desc,static_bl_desc;function TreeDesc(e,n){this.dyn_tree=e,this.max_code=0,this.stat_desc=n}const d_code=e=>e<256?_dist_code[e]:_dist_code[256+(e>>>7)],put_short=(e,n)=>{e.pending_buf[e.pending++]=n&255,e.pending_buf[e.pending++]=n>>>8&255},send_bits=(e,n,t)=>{e.bi_valid>Buf_size-t?(e.bi_buf|=n<<e.bi_valid&65535,put_short(e,e.bi_buf),e.bi_buf=n>>Buf_size-e.bi_valid,e.bi_valid+=t-Buf_size):(e.bi_buf|=n<<e.bi_valid&65535,e.bi_valid+=t)},send_code=(e,n,t)=>{send_bits(e,t[n*2],t[n*2+1])},bi_reverse=(e,n)=>{let t=0;do t|=e&1,e>>>=1,t<<=1;while(--n>0);return t>>>1},bi_flush=e=>{e.bi_valid===16?(put_short(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=e.bi_buf&255,e.bi_buf>>=8,e.bi_valid-=8)},gen_bitlen=(e,n)=>{const t=n.dyn_tree,i=n.max_code,a=n.stat_desc.static_tree,r=n.stat_desc.has_stree,l=n.stat_desc.extra_bits,o=n.stat_desc.extra_base,u=n.stat_desc.max_length;let _,s,N,h,f,A,p=0;for(h=0;h<=MAX_BITS$1;h++)e.bl_count[h]=0;for(t[e.heap[e.heap_max]*2+1]=0,_=e.heap_max+1;_<HEAP_SIZE$1;_++)s=e.heap[_],h=t[t[s*2+1]*2+1]+1,h>u&&(h=u,p++),t[s*2+1]=h,!(s>i)&&(e.bl_count[h]++,f=0,s>=o&&(f=l[s-o]),A=t[s*2],e.opt_len+=A*(h+f),r&&(e.static_len+=A*(a[s*2+1]+f)));if(p!==0){do{for(h=u-1;e.bl_count[h]===0;)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[u]--,p-=2}while(p>0);for(h=u;h!==0;h--)for(s=e.bl_count[h];s!==0;)N=e.heap[--_],!(N>i)&&(t[N*2+1]!==h&&(e.opt_len+=(h-t[N*2+1])*t[N*2],t[N*2+1]=h),s--)}},gen_codes=(e,n,t)=>{const i=new Array(MAX_BITS$1+1);let a=0,r,l;for(r=1;r<=MAX_BITS$1;r++)i[r]=a=a+t[r-1]<<1;for(l=0;l<=n;l++){let o=e[l*2+1];o!==0&&(e[l*2]=bi_reverse(i[o]++,o))}},tr_static_init=()=>{let e,n,t,i,a;const r=new Array(MAX_BITS$1+1);for(t=0,i=0;i<LENGTH_CODES$1-1;i++)for(base_length[i]=t,e=0;e<1<<extra_lbits[i];e++)_length_code[t++]=i;for(_length_code[t-1]=i,a=0,i=0;i<16;i++)for(base_dist[i]=a,e=0;e<1<<extra_dbits[i];e++)_dist_code[a++]=i;for(a>>=7;i<D_CODES$1;i++)for(base_dist[i]=a<<7,e=0;e<1<<extra_dbits[i]-7;e++)_dist_code[256+a++]=i;for(n=0;n<=MAX_BITS$1;n++)r[n]=0;for(e=0;e<=143;)static_ltree[e*2+1]=8,e++,r[8]++;for(;e<=255;)static_ltree[e*2+1]=9,e++,r[9]++;for(;e<=279;)static_ltree[e*2+1]=7,e++,r[7]++;for(;e<=287;)static_ltree[e*2+1]=8,e++,r[8]++;for(gen_codes(static_ltree,L_CODES$1+1,r),e=0;e<D_CODES$1;e++)static_dtree[e*2+1]=5,static_dtree[e*2]=bi_reverse(e,5);static_l_desc=new StaticTreeDesc(static_ltree,extra_lbits,LITERALS$1+1,L_CODES$1,MAX_BITS$1),static_d_desc=new StaticTreeDesc(static_dtree,extra_dbits,0,D_CODES$1,MAX_BITS$1),static_bl_desc=new StaticTreeDesc(new Array(0),extra_blbits,0,BL_CODES$1,MAX_BL_BITS)},init_block=e=>{let n;for(n=0;n<L_CODES$1;n++)e.dyn_ltree[n*2]=0;for(n=0;n<D_CODES$1;n++)e.dyn_dtree[n*2]=0;for(n=0;n<BL_CODES$1;n++)e.bl_tree[n*2]=0;e.dyn_ltree[END_BLOCK*2]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},bi_windup=e=>{e.bi_valid>8?put_short(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},copy_block=(e,n,t,i)=>{bi_windup(e),i&&(put_short(e,t),put_short(e,~t)),e.pending_buf.set(e.window.subarray(n,n+t),e.pending),e.pending+=t},smaller=(e,n,t,i)=>{const a=n*2,r=t*2;return e[a]<e[r]||e[a]===e[r]&&i[n]<=i[t]},pqdownheap=(e,n,t)=>{const i=e.heap[t];let a=t<<1;for(;a<=e.heap_len&&(a<e.heap_len&&smaller(n,e.heap[a+1],e.heap[a],e.depth)&&a++,!smaller(n,i,e.heap[a],e.depth));)e.heap[t]=e.heap[a],t=a,a<<=1;e.heap[t]=i},compress_block=(e,n,t)=>{let i,a,r=0,l,o;if(e.last_lit!==0)do i=e.pending_buf[e.d_buf+r*2]<<8|e.pending_buf[e.d_buf+r*2+1],a=e.pending_buf[e.l_buf+r],r++,i===0?send_code(e,a,n):(l=_length_code[a],send_code(e,l+LITERALS$1+1,n),o=extra_lbits[l],o!==0&&(a-=base_length[l],send_bits(e,a,o)),i--,l=d_code(i),send_code(e,l,t),o=extra_dbits[l],o!==0&&(i-=base_dist[l],send_bits(e,i,o)));while(r<e.last_lit);send_code(e,END_BLOCK,n)},build_tree=(e,n)=>{const t=n.dyn_tree,i=n.stat_desc.static_tree,a=n.stat_desc.has_stree,r=n.stat_desc.elems;let l,o,u=-1,_;for(e.heap_len=0,e.heap_max=HEAP_SIZE$1,l=0;l<r;l++)t[l*2]!==0?(e.heap[++e.heap_len]=u=l,e.depth[l]=0):t[l*2+1]=0;for(;e.heap_len<2;)_=e.heap[++e.heap_len]=u<2?++u:0,t[_*2]=1,e.depth[_]=0,e.opt_len--,a&&(e.static_len-=i[_*2+1]);for(n.max_code=u,l=e.heap_len>>1;l>=1;l--)pqdownheap(e,t,l);_=r;do l=e.heap[1],e.heap[1]=e.heap[e.heap_len--],pqdownheap(e,t,1),o=e.heap[1],e.heap[--e.heap_max]=l,e.heap[--e.heap_max]=o,t[_*2]=t[l*2]+t[o*2],e.depth[_]=(e.depth[l]>=e.depth[o]?e.depth[l]:e.depth[o])+1,t[l*2+1]=t[o*2+1]=_,e.heap[1]=_++,pqdownheap(e,t,1);while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],gen_bitlen(e,n),gen_codes(t,u,e.bl_count)},scan_tree=(e,n,t)=>{let i,a=-1,r,l=n[0*2+1],o=0,u=7,_=4;for(l===0&&(u=138,_=3),n[(t+1)*2+1]=65535,i=0;i<=t;i++)r=l,l=n[(i+1)*2+1],!(++o<u&&r===l)&&(o<_?e.bl_tree[r*2]+=o:r!==0?(r!==a&&e.bl_tree[r*2]++,e.bl_tree[REP_3_6*2]++):o<=10?e.bl_tree[REPZ_3_10*2]++:e.bl_tree[REPZ_11_138*2]++,o=0,a=r,l===0?(u=138,_=3):r===l?(u=6,_=3):(u=7,_=4))},send_tree=(e,n,t)=>{let i,a=-1,r,l=n[0*2+1],o=0,u=7,_=4;for(l===0&&(u=138,_=3),i=0;i<=t;i++)if(r=l,l=n[(i+1)*2+1],!(++o<u&&r===l)){if(o<_)do send_code(e,r,e.bl_tree);while(--o!==0);else r!==0?(r!==a&&(send_code(e,r,e.bl_tree),o--),send_code(e,REP_3_6,e.bl_tree),send_bits(e,o-3,2)):o<=10?(send_code(e,REPZ_3_10,e.bl_tree),send_bits(e,o-3,3)):(send_code(e,REPZ_11_138,e.bl_tree),send_bits(e,o-11,7));o=0,a=r,l===0?(u=138,_=3):r===l?(u=6,_=3):(u=7,_=4)}},build_bl_tree=e=>{let n;for(scan_tree(e,e.dyn_ltree,e.l_desc.max_code),scan_tree(e,e.dyn_dtree,e.d_desc.max_code),build_tree(e,e.bl_desc),n=BL_CODES$1-1;n>=3&&e.bl_tree[bl_order[n]*2+1]===0;n--);return e.opt_len+=3*(n+1)+5+5+4,n},send_all_trees=(e,n,t,i)=>{let a;for(send_bits(e,n-257,5),send_bits(e,t-1,5),send_bits(e,i-4,4),a=0;a<i;a++)send_bits(e,e.bl_tree[bl_order[a]*2+1],3);send_tree(e,e.dyn_ltree,n-1),send_tree(e,e.dyn_dtree,t-1)},detect_data_type=e=>{let n=4093624447,t;for(t=0;t<=31;t++,n>>>=1)if(n&1&&e.dyn_ltree[t*2]!==0)return Z_BINARY;if(e.dyn_ltree[9*2]!==0||e.dyn_ltree[10*2]!==0||e.dyn_ltree[13*2]!==0)return Z_TEXT;for(t=32;t<LITERALS$1;t++)if(e.dyn_ltree[t*2]!==0)return Z_TEXT;return Z_BINARY};let static_init_done=!1;const _tr_init$1=e=>{static_init_done||(tr_static_init(),static_init_done=!0),e.l_desc=new TreeDesc(e.dyn_ltree,static_l_desc),e.d_desc=new TreeDesc(e.dyn_dtree,static_d_desc),e.bl_desc=new TreeDesc(e.bl_tree,static_bl_desc),e.bi_buf=0,e.bi_valid=0,init_block(e)},_tr_stored_block$1=(e,n,t,i)=>{send_bits(e,(STORED_BLOCK<<1)+(i?1:0),3),copy_block(e,n,t,!0)},_tr_align$1=e=>{send_bits(e,STATIC_TREES<<1,3),send_code(e,END_BLOCK,static_ltree),bi_flush(e)},_tr_flush_block$1=(e,n,t,i)=>{let a,r,l=0;e.level>0?(e.strm.data_type===Z_UNKNOWN$1&&(e.strm.data_type=detect_data_type(e)),build_tree(e,e.l_desc),build_tree(e,e.d_desc),l=build_bl_tree(e),a=e.opt_len+3+7>>>3,r=e.static_len+3+7>>>3,r<=a&&(a=r)):a=r=t+5,t+4<=a&&n!==-1?_tr_stored_block$1(e,n,t,i):e.strategy===Z_FIXED$1||r===a?(send_bits(e,(STATIC_TREES<<1)+(i?1:0),3),compress_block(e,static_ltree,static_dtree)):(send_bits(e,(DYN_TREES<<1)+(i?1:0),3),send_all_trees(e,e.l_desc.max_code+1,e.d_desc.max_code+1,l+1),compress_block(e,e.dyn_ltree,e.dyn_dtree)),init_block(e),i&&bi_windup(e)},_tr_tally$1=(e,n,t)=>(e.pending_buf[e.d_buf+e.last_lit*2]=n>>>8&255,e.pending_buf[e.d_buf+e.last_lit*2+1]=n&255,e.pending_buf[e.l_buf+e.last_lit]=t&255,e.last_lit++,n===0?e.dyn_ltree[t*2]++:(e.matches++,n--,e.dyn_ltree[(_length_code[t]+LITERALS$1+1)*2]++,e.dyn_dtree[d_code(n)*2]++),e.last_lit===e.lit_bufsize-1);var _tr_init_1=_tr_init$1,_tr_stored_block_1=_tr_stored_block$1,_tr_flush_block_1=_tr_flush_block$1,_tr_tally_1=_tr_tally$1,_tr_align_1=_tr_align$1,trees={_tr_init:_tr_init_1,_tr_stored_block:_tr_stored_block_1,_tr_flush_block:_tr_flush_block_1,_tr_tally:_tr_tally_1,_tr_align:_tr_align_1};const adler32=(e,n,t,i)=>{let a=e&65535|0,r=e>>>16&65535|0,l=0;for(;t!==0;){l=t>2e3?2e3:t,t-=l;do a=a+n[i++]|0,r=r+a|0;while(--l);a%=65521,r%=65521}return a|r<<16|0};var adler32_1=adler32;const makeTable=()=>{let e,n=[];for(var t=0;t<256;t++){e=t;for(var i=0;i<8;i++)e=e&1?3988292384^e>>>1:e>>>1;n[t]=e}return n},crcTable=new Uint32Array(makeTable()),crc32=(e,n,t,i)=>{const a=crcTable,r=i+t;e^=-1;for(let l=i;l<r;l++)e=e>>>8^a[(e^n[l])&255];return e^-1};var crc32_1=crc32,messages={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},constants$2={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init,_tr_stored_block,_tr_flush_block,_tr_tally,_tr_align}=trees,{Z_NO_FLUSH:Z_NO_FLUSH$2,Z_PARTIAL_FLUSH,Z_FULL_FLUSH:Z_FULL_FLUSH$1,Z_FINISH:Z_FINISH$3,Z_BLOCK:Z_BLOCK$1,Z_OK:Z_OK$3,Z_STREAM_END:Z_STREAM_END$3,Z_STREAM_ERROR:Z_STREAM_ERROR$2,Z_DATA_ERROR:Z_DATA_ERROR$2,Z_BUF_ERROR:Z_BUF_ERROR$1,Z_DEFAULT_COMPRESSION:Z_DEFAULT_COMPRESSION$1,Z_FILTERED,Z_HUFFMAN_ONLY,Z_RLE,Z_FIXED,Z_DEFAULT_STRATEGY:Z_DEFAULT_STRATEGY$1,Z_UNKNOWN,Z_DEFLATED:Z_DEFLATED$2}=constants$2,MAX_MEM_LEVEL=9,MAX_WBITS$1=15,DEF_MEM_LEVEL=8,LENGTH_CODES=29,LITERALS=256,L_CODES=LITERALS+1+LENGTH_CODES,D_CODES=30,BL_CODES=19,HEAP_SIZE=2*L_CODES+1,MAX_BITS=15,MIN_MATCH=3,MAX_MATCH=258,MIN_LOOKAHEAD=MAX_MATCH+MIN_MATCH+1,PRESET_DICT=32,INIT_STATE=42,EXTRA_STATE=69,NAME_STATE=73,COMMENT_STATE=91,HCRC_STATE=103,BUSY_STATE=113,FINISH_STATE=666,BS_NEED_MORE=1,BS_BLOCK_DONE=2,BS_FINISH_STARTED=3,BS_FINISH_DONE=4,OS_CODE=3,err=(e,n)=>(e.msg=messages[n],n),rank=e=>(e<<1)-(e>4?9:0),zero=e=>{let n=e.length;for(;--n>=0;)e[n]=0};let HASH_ZLIB=(e,n,t)=>(n<<e.hash_shift^t)&e.hash_mask,HASH=HASH_ZLIB;const flush_pending=e=>{const n=e.state;let t=n.pending;t>e.avail_out&&(t=e.avail_out),t!==0&&(e.output.set(n.pending_buf.subarray(n.pending_out,n.pending_out+t),e.next_out),e.next_out+=t,n.pending_out+=t,e.total_out+=t,e.avail_out-=t,n.pending-=t,n.pending===0&&(n.pending_out=0))},flush_block_only=(e,n)=>{_tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,n),e.block_start=e.strstart,flush_pending(e.strm)},put_byte=(e,n)=>{e.pending_buf[e.pending++]=n},putShortMSB=(e,n)=>{e.pending_buf[e.pending++]=n>>>8&255,e.pending_buf[e.pending++]=n&255},read_buf=(e,n,t,i)=>{let a=e.avail_in;return a>i&&(a=i),a===0?0:(e.avail_in-=a,n.set(e.input.subarray(e.next_in,e.next_in+a),t),e.state.wrap===1?e.adler=adler32_1(e.adler,n,a,t):e.state.wrap===2&&(e.adler=crc32_1(e.adler,n,a,t)),e.next_in+=a,e.total_in+=a,a)},longest_match=(e,n)=>{let t=e.max_chain_length,i=e.strstart,a,r,l=e.prev_length,o=e.nice_match;const u=e.strstart>e.w_size-MIN_LOOKAHEAD?e.strstart-(e.w_size-MIN_LOOKAHEAD):0,_=e.window,s=e.w_mask,N=e.prev,h=e.strstart+MAX_MATCH;let f=_[i+l-1],A=_[i+l];e.prev_length>=e.good_match&&(t>>=2),o>e.lookahead&&(o=e.lookahead);do if(a=n,!(_[a+l]!==A||_[a+l-1]!==f||_[a]!==_[i]||_[++a]!==_[i+1])){i+=2,a++;do;while(_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&_[++i]===_[++a]&&i<h);if(r=MAX_MATCH-(h-i),i=h-MAX_MATCH,r>l){if(e.match_start=n,l=r,r>=o)break;f=_[i+l-1],A=_[i+l]}}while((n=N[n&s])>u&&--t!==0);return l<=e.lookahead?l:e.lookahead},fill_window=e=>{const n=e.w_size;let t,i,a,r,l;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=n+(n-MIN_LOOKAHEAD)){e.window.set(e.window.subarray(n,n+n),0),e.match_start-=n,e.strstart-=n,e.block_start-=n,i=e.hash_size,t=i;do a=e.head[--t],e.head[t]=a>=n?a-n:0;while(--i);i=n,t=i;do a=e.prev[--t],e.prev[t]=a>=n?a-n:0;while(--i);r+=n}if(e.strm.avail_in===0)break;if(i=read_buf(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=i,e.lookahead+e.insert>=MIN_MATCH)for(l=e.strstart-e.insert,e.ins_h=e.window[l],e.ins_h=HASH(e,e.ins_h,e.window[l+1]);e.insert&&(e.ins_h=HASH(e,e.ins_h,e.window[l+MIN_MATCH-1]),e.prev[l&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=l,l++,e.insert--,!(e.lookahead+e.insert<MIN_MATCH)););}while(e.lookahead<MIN_LOOKAHEAD&&e.strm.avail_in!==0)},deflate_stored=(e,n)=>{let t=65535;for(t>e.pending_buf_size-5&&(t=e.pending_buf_size-5);;){if(e.lookahead<=1){if(fill_window(e),e.lookahead===0&&n===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}e.strstart+=e.lookahead,e.lookahead=0;const i=e.block_start+t;if((e.strstart===0||e.strstart>=i)&&(e.lookahead=e.strstart-i,e.strstart=i,flush_block_only(e,!1),e.strm.avail_out===0)||e.strstart-e.block_start>=e.w_size-MIN_LOOKAHEAD&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,n===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):(e.strstart>e.block_start&&(flush_block_only(e,!1),e.strm.avail_out===0),BS_NEED_MORE)},deflate_fast=(e,n)=>{let t,i;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&n===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(t=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),t!==0&&e.strstart-t<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,t)),e.match_length>=MIN_MATCH)if(i=_tr_tally(e,e.strstart-e.match_start,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=MIN_MATCH){e.match_length--;do e.strstart++,e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart;while(--e.match_length!==0);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+1]);else i=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,n===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_slow=(e,n)=>{let t,i,a;for(;;){if(e.lookahead<MIN_LOOKAHEAD){if(fill_window(e),e.lookahead<MIN_LOOKAHEAD&&n===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(t=0,e.lookahead>=MIN_MATCH&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=MIN_MATCH-1,t!==0&&e.prev_length<e.max_lazy_match&&e.strstart-t<=e.w_size-MIN_LOOKAHEAD&&(e.match_length=longest_match(e,t),e.match_length<=5&&(e.strategy===Z_FILTERED||e.match_length===MIN_MATCH&&e.strstart-e.match_start>4096)&&(e.match_length=MIN_MATCH-1)),e.prev_length>=MIN_MATCH&&e.match_length<=e.prev_length){a=e.strstart+e.lookahead-MIN_MATCH,i=_tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-MIN_MATCH),e.lookahead-=e.prev_length-1,e.prev_length-=2;do++e.strstart<=a&&(e.ins_h=HASH(e,e.ins_h,e.window[e.strstart+MIN_MATCH-1]),t=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart);while(--e.prev_length!==0);if(e.match_available=0,e.match_length=MIN_MATCH-1,e.strstart++,i&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}else if(e.match_available){if(i=_tr_tally(e,0,e.window[e.strstart-1]),i&&flush_block_only(e,!1),e.strstart++,e.lookahead--,e.strm.avail_out===0)return BS_NEED_MORE}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=_tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<MIN_MATCH-1?e.strstart:MIN_MATCH-1,n===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_rle=(e,n)=>{let t,i,a,r;const l=e.window;for(;;){if(e.lookahead<=MAX_MATCH){if(fill_window(e),e.lookahead<=MAX_MATCH&&n===Z_NO_FLUSH$2)return BS_NEED_MORE;if(e.lookahead===0)break}if(e.match_length=0,e.lookahead>=MIN_MATCH&&e.strstart>0&&(a=e.strstart-1,i=l[a],i===l[++a]&&i===l[++a]&&i===l[++a])){r=e.strstart+MAX_MATCH;do;while(i===l[++a]&&i===l[++a]&&i===l[++a]&&i===l[++a]&&i===l[++a]&&i===l[++a]&&i===l[++a]&&i===l[++a]&&a<r);e.match_length=MAX_MATCH-(r-a),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=MIN_MATCH?(t=_tr_tally(e,1,e.match_length-MIN_MATCH),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(t=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),t&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,n===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE},deflate_huff=(e,n)=>{let t;for(;;){if(e.lookahead===0&&(fill_window(e),e.lookahead===0)){if(n===Z_NO_FLUSH$2)return BS_NEED_MORE;break}if(e.match_length=0,t=_tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,t&&(flush_block_only(e,!1),e.strm.avail_out===0))return BS_NEED_MORE}return e.insert=0,n===Z_FINISH$3?(flush_block_only(e,!0),e.strm.avail_out===0?BS_FINISH_STARTED:BS_FINISH_DONE):e.last_lit&&(flush_block_only(e,!1),e.strm.avail_out===0)?BS_NEED_MORE:BS_BLOCK_DONE};function Config(e,n,t,i,a){this.good_length=e,this.max_lazy=n,this.nice_length=t,this.max_chain=i,this.func=a}const configuration_table=[new Config(0,0,0,0,deflate_stored),new Config(4,4,8,4,deflate_fast),new Config(4,5,16,8,deflate_fast),new Config(4,6,32,32,deflate_fast),new Config(4,4,16,16,deflate_slow),new Config(8,16,32,32,deflate_slow),new Config(8,16,128,128,deflate_slow),new Config(8,32,128,256,deflate_slow),new Config(32,128,258,1024,deflate_slow),new Config(32,258,258,4096,deflate_slow)],lm_init=e=>{e.window_size=2*e.w_size,zero(e.head),e.max_lazy_match=configuration_table[e.level].max_lazy,e.good_match=configuration_table[e.level].good_length,e.nice_match=configuration_table[e.level].nice_length,e.max_chain_length=configuration_table[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=MIN_MATCH-1,e.match_available=0,e.ins_h=0};function DeflateState(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Z_DEFLATED$2,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(HEAP_SIZE*2),this.dyn_dtree=new Uint16Array((2*D_CODES+1)*2),this.bl_tree=new Uint16Array((2*BL_CODES+1)*2),zero(this.dyn_ltree),zero(this.dyn_dtree),zero(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(MAX_BITS+1),this.heap=new Uint16Array(2*L_CODES+1),zero(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(2*L_CODES+1),zero(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const deflateResetKeep=e=>{if(!e||!e.state)return err(e,Z_STREAM_ERROR$2);e.total_in=e.total_out=0,e.data_type=Z_UNKNOWN;const n=e.state;return n.pending=0,n.pending_out=0,n.wrap<0&&(n.wrap=-n.wrap),n.status=n.wrap?INIT_STATE:BUSY_STATE,e.adler=n.wrap===2?0:1,n.last_flush=Z_NO_FLUSH$2,_tr_init(n),Z_OK$3},deflateReset=e=>{const n=deflateResetKeep(e);return n===Z_OK$3&&lm_init(e.state),n},deflateSetHeader=(e,n)=>!e||!e.state||e.state.wrap!==2?Z_STREAM_ERROR$2:(e.state.gzhead=n,Z_OK$3),deflateInit2=(e,n,t,i,a,r)=>{if(!e)return Z_STREAM_ERROR$2;let l=1;if(n===Z_DEFAULT_COMPRESSION$1&&(n=6),i<0?(l=0,i=-i):i>15&&(l=2,i-=16),a<1||a>MAX_MEM_LEVEL||t!==Z_DEFLATED$2||i<8||i>15||n<0||n>9||r<0||r>Z_FIXED)return err(e,Z_STREAM_ERROR$2);i===8&&(i=9);const o=new DeflateState;return e.state=o,o.strm=e,o.wrap=l,o.gzhead=null,o.w_bits=i,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=a+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+MIN_MATCH-1)/MIN_MATCH),o.window=new Uint8Array(o.w_size*2),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<a+6,o.pending_buf_size=o.lit_bufsize*4,o.pending_buf=new Uint8Array(o.pending_buf_size),o.d_buf=1*o.lit_bufsize,o.l_buf=(1+2)*o.lit_bufsize,o.level=n,o.strategy=r,o.method=t,deflateReset(e)},deflateInit=(e,n)=>deflateInit2(e,n,Z_DEFLATED$2,MAX_WBITS$1,DEF_MEM_LEVEL,Z_DEFAULT_STRATEGY$1),deflate$2=(e,n)=>{let t,i;if(!e||!e.state||n>Z_BLOCK$1||n<0)return e?err(e,Z_STREAM_ERROR$2):Z_STREAM_ERROR$2;const a=e.state;if(!e.output||!e.input&&e.avail_in!==0||a.status===FINISH_STATE&&n!==Z_FINISH$3)return err(e,e.avail_out===0?Z_BUF_ERROR$1:Z_STREAM_ERROR$2);a.strm=e;const r=a.last_flush;if(a.last_flush=n,a.status===INIT_STATE)if(a.wrap===2)e.adler=0,put_byte(a,31),put_byte(a,139),put_byte(a,8),a.gzhead?(put_byte(a,(a.gzhead.text?1:0)+(a.gzhead.hcrc?2:0)+(a.gzhead.extra?4:0)+(a.gzhead.name?8:0)+(a.gzhead.comment?16:0)),put_byte(a,a.gzhead.time&255),put_byte(a,a.gzhead.time>>8&255),put_byte(a,a.gzhead.time>>16&255),put_byte(a,a.gzhead.time>>24&255),put_byte(a,a.level===9?2:a.strategy>=Z_HUFFMAN_ONLY||a.level<2?4:0),put_byte(a,a.gzhead.os&255),a.gzhead.extra&&a.gzhead.extra.length&&(put_byte(a,a.gzhead.extra.length&255),put_byte(a,a.gzhead.extra.length>>8&255)),a.gzhead.hcrc&&(e.adler=crc32_1(e.adler,a.pending_buf,a.pending,0)),a.gzindex=0,a.status=EXTRA_STATE):(put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,0),put_byte(a,a.level===9?2:a.strategy>=Z_HUFFMAN_ONLY||a.level<2?4:0),put_byte(a,OS_CODE),a.status=BUSY_STATE);else{let l=Z_DEFLATED$2+(a.w_bits-8<<4)<<8,o=-1;a.strategy>=Z_HUFFMAN_ONLY||a.level<2?o=0:a.level<6?o=1:a.level===6?o=2:o=3,l|=o<<6,a.strstart!==0&&(l|=PRESET_DICT),l+=31-l%31,a.status=BUSY_STATE,putShortMSB(a,l),a.strstart!==0&&(putShortMSB(a,e.adler>>>16),putShortMSB(a,e.adler&65535)),e.adler=1}if(a.status===EXTRA_STATE)if(a.gzhead.extra){for(t=a.pending;a.gzindex<(a.gzhead.extra.length&65535)&&!(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>t&&(e.adler=crc32_1(e.adler,a.pending_buf,a.pending-t,t)),flush_pending(e),t=a.pending,a.pending===a.pending_buf_size));)put_byte(a,a.gzhead.extra[a.gzindex]&255),a.gzindex++;a.gzhead.hcrc&&a.pending>t&&(e.adler=crc32_1(e.adler,a.pending_buf,a.pending-t,t)),a.gzindex===a.gzhead.extra.length&&(a.gzindex=0,a.status=NAME_STATE)}else a.status=NAME_STATE;if(a.status===NAME_STATE)if(a.gzhead.name){t=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>t&&(e.adler=crc32_1(e.adler,a.pending_buf,a.pending-t,t)),flush_pending(e),t=a.pending,a.pending===a.pending_buf_size)){i=1;break}a.gzindex<a.gzhead.name.length?i=a.gzhead.name.charCodeAt(a.gzindex++)&255:i=0,put_byte(a,i)}while(i!==0);a.gzhead.hcrc&&a.pending>t&&(e.adler=crc32_1(e.adler,a.pending_buf,a.pending-t,t)),i===0&&(a.gzindex=0,a.status=COMMENT_STATE)}else a.status=COMMENT_STATE;if(a.status===COMMENT_STATE)if(a.gzhead.comment){t=a.pending;do{if(a.pending===a.pending_buf_size&&(a.gzhead.hcrc&&a.pending>t&&(e.adler=crc32_1(e.adler,a.pending_buf,a.pending-t,t)),flush_pending(e),t=a.pending,a.pending===a.pending_buf_size)){i=1;break}a.gzindex<a.gzhead.comment.length?i=a.gzhead.comment.charCodeAt(a.gzindex++)&255:i=0,put_byte(a,i)}while(i!==0);a.gzhead.hcrc&&a.pending>t&&(e.adler=crc32_1(e.adler,a.pending_buf,a.pending-t,t)),i===0&&(a.status=HCRC_STATE)}else a.status=HCRC_STATE;if(a.status===HCRC_STATE&&(a.gzhead.hcrc?(a.pending+2>a.pending_buf_size&&flush_pending(e),a.pending+2<=a.pending_buf_size&&(put_byte(a,e.adler&255),put_byte(a,e.adler>>8&255),e.adler=0,a.status=BUSY_STATE)):a.status=BUSY_STATE),a.pending!==0){if(flush_pending(e),e.avail_out===0)return a.last_flush=-1,Z_OK$3}else if(e.avail_in===0&&rank(n)<=rank(r)&&n!==Z_FINISH$3)return err(e,Z_BUF_ERROR$1);if(a.status===FINISH_STATE&&e.avail_in!==0)return err(e,Z_BUF_ERROR$1);if(e.avail_in!==0||a.lookahead!==0||n!==Z_NO_FLUSH$2&&a.status!==FINISH_STATE){let l=a.strategy===Z_HUFFMAN_ONLY?deflate_huff(a,n):a.strategy===Z_RLE?deflate_rle(a,n):configuration_table[a.level].func(a,n);if((l===BS_FINISH_STARTED||l===BS_FINISH_DONE)&&(a.status=FINISH_STATE),l===BS_NEED_MORE||l===BS_FINISH_STARTED)return e.avail_out===0&&(a.last_flush=-1),Z_OK$3;if(l===BS_BLOCK_DONE&&(n===Z_PARTIAL_FLUSH?_tr_align(a):n!==Z_BLOCK$1&&(_tr_stored_block(a,0,0,!1),n===Z_FULL_FLUSH$1&&(zero(a.head),a.lookahead===0&&(a.strstart=0,a.block_start=0,a.insert=0))),flush_pending(e),e.avail_out===0))return a.last_flush=-1,Z_OK$3}return n!==Z_FINISH$3?Z_OK$3:a.wrap<=0?Z_STREAM_END$3:(a.wrap===2?(put_byte(a,e.adler&255),put_byte(a,e.adler>>8&255),put_byte(a,e.adler>>16&255),put_byte(a,e.adler>>24&255),put_byte(a,e.total_in&255),put_byte(a,e.total_in>>8&255),put_byte(a,e.total_in>>16&255),put_byte(a,e.total_in>>24&255)):(putShortMSB(a,e.adler>>>16),putShortMSB(a,e.adler&65535)),flush_pending(e),a.wrap>0&&(a.wrap=-a.wrap),a.pending!==0?Z_OK$3:Z_STREAM_END$3)},deflateEnd=e=>{if(!e||!e.state)return Z_STREAM_ERROR$2;const n=e.state.status;return n!==INIT_STATE&&n!==EXTRA_STATE&&n!==NAME_STATE&&n!==COMMENT_STATE&&n!==HCRC_STATE&&n!==BUSY_STATE&&n!==FINISH_STATE?err(e,Z_STREAM_ERROR$2):(e.state=null,n===BUSY_STATE?err(e,Z_DATA_ERROR$2):Z_OK$3)},deflateSetDictionary=(e,n)=>{let t=n.length;if(!e||!e.state)return Z_STREAM_ERROR$2;const i=e.state,a=i.wrap;if(a===2||a===1&&i.status!==INIT_STATE||i.lookahead)return Z_STREAM_ERROR$2;if(a===1&&(e.adler=adler32_1(e.adler,n,t,0)),i.wrap=0,t>=i.w_size){a===0&&(zero(i.head),i.strstart=0,i.block_start=0,i.insert=0);let u=new Uint8Array(i.w_size);u.set(n.subarray(t-i.w_size,t),0),n=u,t=i.w_size}const r=e.avail_in,l=e.next_in,o=e.input;for(e.avail_in=t,e.next_in=0,e.input=n,fill_window(i);i.lookahead>=MIN_MATCH;){let u=i.strstart,_=i.lookahead-(MIN_MATCH-1);do i.ins_h=HASH(i,i.ins_h,i.window[u+MIN_MATCH-1]),i.prev[u&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=u,u++;while(--_);i.strstart=u,i.lookahead=MIN_MATCH-1,fill_window(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=MIN_MATCH-1,i.match_available=0,e.next_in=l,e.input=o,e.avail_in=r,i.wrap=a,Z_OK$3};var deflateInit_1=deflateInit,deflateInit2_1=deflateInit2,deflateReset_1=deflateReset,deflateResetKeep_1=deflateResetKeep,deflateSetHeader_1=deflateSetHeader,deflate_2$1=deflate$2,deflateEnd_1=deflateEnd,deflateSetDictionary_1=deflateSetDictionary,deflateInfo="pako deflate (from Nodeca project)",deflate_1$2={deflateInit:deflateInit_1,deflateInit2:deflateInit2_1,deflateReset:deflateReset_1,deflateResetKeep:deflateResetKeep_1,deflateSetHeader:deflateSetHeader_1,deflate:deflate_2$1,deflateEnd:deflateEnd_1,deflateSetDictionary:deflateSetDictionary_1,deflateInfo};const _has=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var assign=function(e){const n=Array.prototype.slice.call(arguments,1);for(;n.length;){const t=n.shift();if(!!t){if(typeof t!="object")throw new TypeError(t+"must be non-object");for(const i in t)_has(t,i)&&(e[i]=t[i])}}return e},flattenChunks=e=>{let n=0;for(let i=0,a=e.length;i<a;i++)n+=e[i].length;const t=new Uint8Array(n);for(let i=0,a=0,r=e.length;i<r;i++){let l=e[i];t.set(l,a),a+=l.length}return t},common={assign,flattenChunks};let STR_APPLY_UIA_OK=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){STR_APPLY_UIA_OK=!1}const _utf8len=new Uint8Array(256);for(let e=0;e<256;e++)_utf8len[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;_utf8len[254]=_utf8len[254]=1;var string2buf=e=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(e);let n,t,i,a,r,l=e.length,o=0;for(a=0;a<l;a++)t=e.charCodeAt(a),(t&64512)===55296&&a+1<l&&(i=e.charCodeAt(a+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),a++)),o+=t<128?1:t<2048?2:t<65536?3:4;for(n=new Uint8Array(o),r=0,a=0;r<o;a++)t=e.charCodeAt(a),(t&64512)===55296&&a+1<l&&(i=e.charCodeAt(a+1),(i&64512)===56320&&(t=65536+(t-55296<<10)+(i-56320),a++)),t<128?n[r++]=t:t<2048?(n[r++]=192|t>>>6,n[r++]=128|t&63):t<65536?(n[r++]=224|t>>>12,n[r++]=128|t>>>6&63,n[r++]=128|t&63):(n[r++]=240|t>>>18,n[r++]=128|t>>>12&63,n[r++]=128|t>>>6&63,n[r++]=128|t&63);return n};const buf2binstring=(e,n)=>{if(n<65534&&e.subarray&&STR_APPLY_UIA_OK)return String.fromCharCode.apply(null,e.length===n?e:e.subarray(0,n));let t="";for(let i=0;i<n;i++)t+=String.fromCharCode(e[i]);return t};var buf2string=(e,n)=>{const t=n||e.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(e.subarray(0,n));let i,a;const r=new Array(t*2);for(a=0,i=0;i<t;){let l=e[i++];if(l<128){r[a++]=l;continue}let o=_utf8len[l];if(o>4){r[a++]=65533,i+=o-1;continue}for(l&=o===2?31:o===3?15:7;o>1&&i<t;)l=l<<6|e[i++]&63,o--;if(o>1){r[a++]=65533;continue}l<65536?r[a++]=l:(l-=65536,r[a++]=55296|l>>10&1023,r[a++]=56320|l&1023)}return buf2binstring(r,a)},utf8border=(e,n)=>{n=n||e.length,n>e.length&&(n=e.length);let t=n-1;for(;t>=0&&(e[t]&192)===128;)t--;return t<0||t===0?n:t+_utf8len[e[t]]>n?t:n},strings={string2buf,buf2string,utf8border};function ZStream(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}var zstream=ZStream;const toString$1=Object.prototype.toString,{Z_NO_FLUSH:Z_NO_FLUSH$1,Z_SYNC_FLUSH,Z_FULL_FLUSH,Z_FINISH:Z_FINISH$2,Z_OK:Z_OK$2,Z_STREAM_END:Z_STREAM_END$2,Z_DEFAULT_COMPRESSION,Z_DEFAULT_STRATEGY,Z_DEFLATED:Z_DEFLATED$1}=constants$2;function Deflate$1(e){this.options=common.assign({level:Z_DEFAULT_COMPRESSION,method:Z_DEFLATED$1,chunkSize:16384,windowBits:15,memLevel:8,strategy:Z_DEFAULT_STRATEGY},e||{});let n=this.options;n.raw&&n.windowBits>0?n.windowBits=-n.windowBits:n.gzip&&n.windowBits>0&&n.windowBits<16&&(n.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let t=deflate_1$2.deflateInit2(this.strm,n.level,n.method,n.windowBits,n.memLevel,n.strategy);if(t!==Z_OK$2)throw new Error(messages[t]);if(n.header&&deflate_1$2.deflateSetHeader(this.strm,n.header),n.dictionary){let i;if(typeof n.dictionary=="string"?i=strings.string2buf(n.dictionary):toString$1.call(n.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(n.dictionary):i=n.dictionary,t=deflate_1$2.deflateSetDictionary(this.strm,i),t!==Z_OK$2)throw new Error(messages[t]);this._dict_set=!0}}Deflate$1.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize;let a,r;if(this.ended)return!1;for(n===~~n?r=n:r=n===!0?Z_FINISH$2:Z_NO_FLUSH$1,typeof e=="string"?t.input=strings.string2buf(e):toString$1.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){if(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),(r===Z_SYNC_FLUSH||r===Z_FULL_FLUSH)&&t.avail_out<=6){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(a=deflate_1$2.deflate(t,r),a===Z_STREAM_END$2)return t.next_out>0&&this.onData(t.output.subarray(0,t.next_out)),a=deflate_1$2.deflateEnd(this.strm),this.onEnd(a),this.ended=!0,a===Z_OK$2;if(t.avail_out===0){this.onData(t.output);continue}if(r>0&&t.next_out>0){this.onData(t.output.subarray(0,t.next_out)),t.avail_out=0;continue}if(t.avail_in===0)break}return!0};Deflate$1.prototype.onData=function(e){this.chunks.push(e)};Deflate$1.prototype.onEnd=function(e){e===Z_OK$2&&(this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function deflate$1(e,n){const t=new Deflate$1(n);if(t.push(e,!0),t.err)throw t.msg||messages[t.err];return t.result}function deflateRaw$1(e,n){return n=n||{},n.raw=!0,deflate$1(e,n)}function gzip$1(e,n){return n=n||{},n.gzip=!0,deflate$1(e,n)}var Deflate_1$1=Deflate$1,deflate_2=deflate$1,deflateRaw_1$1=deflateRaw$1,gzip_1$1=gzip$1,constants$1=constants$2,deflate_1$1={Deflate:Deflate_1$1,deflate:deflate_2,deflateRaw:deflateRaw_1$1,gzip:gzip_1$1,constants:constants$1};const BAD$1=30,TYPE$1=12;var inffast=function e(n,t){let i,a,r,l,o,u,_,s,N,h,f,A,p,L,c,T,I,d,g,C,E,S,w,b;const R=n.state;i=n.next_in,w=n.input,a=i+(n.avail_in-5),r=n.next_out,b=n.output,l=r-(t-n.avail_out),o=r+(n.avail_out-257),u=R.dmax,_=R.wsize,s=R.whave,N=R.wnext,h=R.window,f=R.hold,A=R.bits,p=R.lencode,L=R.distcode,c=(1<<R.lenbits)-1,T=(1<<R.distbits)-1;e:do{A<15&&(f+=w[i++]<<A,A+=8,f+=w[i++]<<A,A+=8),I=p[f&c];t:for(;;){if(d=I>>>24,f>>>=d,A-=d,d=I>>>16&255,d===0)b[r++]=I&65535;else if(d&16){g=I&65535,d&=15,d&&(A<d&&(f+=w[i++]<<A,A+=8),g+=f&(1<<d)-1,f>>>=d,A-=d),A<15&&(f+=w[i++]<<A,A+=8,f+=w[i++]<<A,A+=8),I=L[f&T];n:for(;;){if(d=I>>>24,f>>>=d,A-=d,d=I>>>16&255,d&16){if(C=I&65535,d&=15,A<d&&(f+=w[i++]<<A,A+=8,A<d&&(f+=w[i++]<<A,A+=8)),C+=f&(1<<d)-1,C>u){n.msg="invalid distance too far back",R.mode=BAD$1;break e}if(f>>>=d,A-=d,d=r-l,C>d){if(d=C-d,d>s&&R.sane){n.msg="invalid distance too far back",R.mode=BAD$1;break e}if(E=0,S=h,N===0){if(E+=_-d,d<g){g-=d;do b[r++]=h[E++];while(--d);E=r-C,S=b}}else if(N<d){if(E+=_+N-d,d-=N,d<g){g-=d;do b[r++]=h[E++];while(--d);if(E=0,N<g){d=N,g-=d;do b[r++]=h[E++];while(--d);E=r-C,S=b}}}else if(E+=N-d,d<g){g-=d;do b[r++]=h[E++];while(--d);E=r-C,S=b}for(;g>2;)b[r++]=S[E++],b[r++]=S[E++],b[r++]=S[E++],g-=3;g&&(b[r++]=S[E++],g>1&&(b[r++]=S[E++]))}else{E=r-C;do b[r++]=b[E++],b[r++]=b[E++],b[r++]=b[E++],g-=3;while(g>2);g&&(b[r++]=b[E++],g>1&&(b[r++]=b[E++]))}}else if((d&64)===0){I=L[(I&65535)+(f&(1<<d)-1)];continue n}else{n.msg="invalid distance code",R.mode=BAD$1;break e}break}}else if((d&64)===0){I=p[(I&65535)+(f&(1<<d)-1)];continue t}else if(d&32){R.mode=TYPE$1;break e}else{n.msg="invalid literal/length code",R.mode=BAD$1;break e}break}}while(i<a&&r<o);g=A>>3,i-=g,A-=g<<3,f&=(1<<A)-1,n.next_in=i,n.next_out=r,n.avail_in=i<a?5+(a-i):5-(i-a),n.avail_out=r<o?257+(o-r):257-(r-o),R.hold=f,R.bits=A};const MAXBITS=15,ENOUGH_LENS$1=852,ENOUGH_DISTS$1=592,CODES$1=0,LENS$1=1,DISTS$1=2,lbase=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),lext=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),dbase=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),dext=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]),inflate_table=(e,n,t,i,a,r,l,o)=>{const u=o.bits;let _=0,s=0,N=0,h=0,f=0,A=0,p=0,L=0,c=0,T=0,I,d,g,C,E,S=null,w=0,b;const R=new Uint16Array(MAXBITS+1),O=new Uint16Array(MAXBITS+1);let D=null,v=0,y,U,x;for(_=0;_<=MAXBITS;_++)R[_]=0;for(s=0;s<i;s++)R[n[t+s]]++;for(f=u,h=MAXBITS;h>=1&&R[h]===0;h--);if(f>h&&(f=h),h===0)return a[r++]=1<<24|64<<16|0,a[r++]=1<<24|64<<16|0,o.bits=1,0;for(N=1;N<h&&R[N]===0;N++);for(f<N&&(f=N),L=1,_=1;_<=MAXBITS;_++)if(L<<=1,L-=R[_],L<0)return-1;if(L>0&&(e===CODES$1||h!==1))return-1;for(O[1]=0,_=1;_<MAXBITS;_++)O[_+1]=O[_]+R[_];for(s=0;s<i;s++)n[t+s]!==0&&(l[O[n[t+s]]++]=s);if(e===CODES$1?(S=D=l,b=19):e===LENS$1?(S=lbase,w-=257,D=lext,v-=257,b=256):(S=dbase,D=dext,b=-1),T=0,s=0,_=N,E=r,A=f,p=0,g=-1,c=1<<f,C=c-1,e===LENS$1&&c>ENOUGH_LENS$1||e===DISTS$1&&c>ENOUGH_DISTS$1)return 1;for(;;){y=_-p,l[s]<b?(U=0,x=l[s]):l[s]>b?(U=D[v+l[s]],x=S[w+l[s]]):(U=32+64,x=0),I=1<<_-p,d=1<<A,N=d;do d-=I,a[E+(T>>p)+d]=y<<24|U<<16|x|0;while(d!==0);for(I=1<<_-1;T&I;)I>>=1;if(I!==0?(T&=I-1,T+=I):T=0,s++,--R[_]===0){if(_===h)break;_=n[t+l[s]]}if(_>f&&(T&C)!==g){for(p===0&&(p=f),E+=N,A=_-p,L=1<<A;A+p<h&&(L-=R[A+p],!(L<=0));)A++,L<<=1;if(c+=1<<A,e===LENS$1&&c>ENOUGH_LENS$1||e===DISTS$1&&c>ENOUGH_DISTS$1)return 1;g=T&C,a[g]=f<<24|A<<16|E-r|0}}return T!==0&&(a[E+T]=_-p<<24|64<<16|0),o.bits=f,0};var inftrees=inflate_table;const CODES=0,LENS=1,DISTS=2,{Z_FINISH:Z_FINISH$1,Z_BLOCK,Z_TREES,Z_OK:Z_OK$1,Z_STREAM_END:Z_STREAM_END$1,Z_NEED_DICT:Z_NEED_DICT$1,Z_STREAM_ERROR:Z_STREAM_ERROR$1,Z_DATA_ERROR:Z_DATA_ERROR$1,Z_MEM_ERROR:Z_MEM_ERROR$1,Z_BUF_ERROR,Z_DEFLATED}=constants$2,HEAD=1,FLAGS=2,TIME=3,OS=4,EXLEN=5,EXTRA=6,NAME=7,COMMENT=8,HCRC=9,DICTID=10,DICT=11,TYPE=12,TYPEDO=13,STORED=14,COPY_=15,COPY=16,TABLE=17,LENLENS=18,CODELENS=19,LEN_=20,LEN=21,LENEXT=22,DIST=23,DISTEXT=24,MATCH=25,LIT=26,CHECK=27,LENGTH=28,DONE=29,BAD=30,MEM=31,SYNC=32,ENOUGH_LENS=852,ENOUGH_DISTS=592,MAX_WBITS=15,DEF_WBITS=MAX_WBITS,zswap32=e=>(e>>>24&255)+(e>>>8&65280)+((e&65280)<<8)+((e&255)<<24);function InflateState(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const inflateResetKeep=e=>{if(!e||!e.state)return Z_STREAM_ERROR$1;const n=e.state;return e.total_in=e.total_out=n.total=0,e.msg="",n.wrap&&(e.adler=n.wrap&1),n.mode=HEAD,n.last=0,n.havedict=0,n.dmax=32768,n.head=null,n.hold=0,n.bits=0,n.lencode=n.lendyn=new Int32Array(ENOUGH_LENS),n.distcode=n.distdyn=new Int32Array(ENOUGH_DISTS),n.sane=1,n.back=-1,Z_OK$1},inflateReset=e=>{if(!e||!e.state)return Z_STREAM_ERROR$1;const n=e.state;return n.wsize=0,n.whave=0,n.wnext=0,inflateResetKeep(e)},inflateReset2=(e,n)=>{let t;if(!e||!e.state)return Z_STREAM_ERROR$1;const i=e.state;return n<0?(t=0,n=-n):(t=(n>>4)+1,n<48&&(n&=15)),n&&(n<8||n>15)?Z_STREAM_ERROR$1:(i.window!==null&&i.wbits!==n&&(i.window=null),i.wrap=t,i.wbits=n,inflateReset(e))},inflateInit2=(e,n)=>{if(!e)return Z_STREAM_ERROR$1;const t=new InflateState;e.state=t,t.window=null;const i=inflateReset2(e,n);return i!==Z_OK$1&&(e.state=null),i},inflateInit=e=>inflateInit2(e,DEF_WBITS);let virgin=!0,lenfix,distfix;const fixedtables=e=>{if(virgin){lenfix=new Int32Array(512),distfix=new Int32Array(32);let n=0;for(;n<144;)e.lens[n++]=8;for(;n<256;)e.lens[n++]=9;for(;n<280;)e.lens[n++]=7;for(;n<288;)e.lens[n++]=8;for(inftrees(LENS,e.lens,0,288,lenfix,0,e.work,{bits:9}),n=0;n<32;)e.lens[n++]=5;inftrees(DISTS,e.lens,0,32,distfix,0,e.work,{bits:5}),virgin=!1}e.lencode=lenfix,e.lenbits=9,e.distcode=distfix,e.distbits=5},updatewindow=(e,n,t,i)=>{let a;const r=e.state;return r.window===null&&(r.wsize=1<<r.wbits,r.wnext=0,r.whave=0,r.window=new Uint8Array(r.wsize)),i>=r.wsize?(r.window.set(n.subarray(t-r.wsize,t),0),r.wnext=0,r.whave=r.wsize):(a=r.wsize-r.wnext,a>i&&(a=i),r.window.set(n.subarray(t-i,t-i+a),r.wnext),i-=a,i?(r.window.set(n.subarray(t-i,t),0),r.wnext=i,r.whave=r.wsize):(r.wnext+=a,r.wnext===r.wsize&&(r.wnext=0),r.whave<r.wsize&&(r.whave+=a))),0},inflate$2=(e,n)=>{let t,i,a,r,l,o,u,_,s,N,h,f,A,p,L=0,c,T,I,d,g,C,E,S;const w=new Uint8Array(4);let b,R;const O=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&e.avail_in!==0)return Z_STREAM_ERROR$1;t=e.state,t.mode===TYPE&&(t.mode=TYPEDO),l=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,o=e.avail_in,_=t.hold,s=t.bits,N=o,h=u,S=Z_OK$1;e:for(;;)switch(t.mode){case HEAD:if(t.wrap===0){t.mode=TYPEDO;break}for(;s<16;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if(t.wrap&2&&_===35615){t.check=0,w[0]=_&255,w[1]=_>>>8&255,t.check=crc32_1(t.check,w,2,0),_=0,s=0,t.mode=FLAGS;break}if(t.flags=0,t.head&&(t.head.done=!1),!(t.wrap&1)||(((_&255)<<8)+(_>>8))%31){e.msg="incorrect header check",t.mode=BAD;break}if((_&15)!==Z_DEFLATED){e.msg="unknown compression method",t.mode=BAD;break}if(_>>>=4,s-=4,E=(_&15)+8,t.wbits===0)t.wbits=E;else if(E>t.wbits){e.msg="invalid window size",t.mode=BAD;break}t.dmax=1<<t.wbits,e.adler=t.check=1,t.mode=_&512?DICTID:TYPE,_=0,s=0;break;case FLAGS:for(;s<16;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if(t.flags=_,(t.flags&255)!==Z_DEFLATED){e.msg="unknown compression method",t.mode=BAD;break}if(t.flags&57344){e.msg="unknown header flags set",t.mode=BAD;break}t.head&&(t.head.text=_>>8&1),t.flags&512&&(w[0]=_&255,w[1]=_>>>8&255,t.check=crc32_1(t.check,w,2,0)),_=0,s=0,t.mode=TIME;case TIME:for(;s<32;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}t.head&&(t.head.time=_),t.flags&512&&(w[0]=_&255,w[1]=_>>>8&255,w[2]=_>>>16&255,w[3]=_>>>24&255,t.check=crc32_1(t.check,w,4,0)),_=0,s=0,t.mode=OS;case OS:for(;s<16;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}t.head&&(t.head.xflags=_&255,t.head.os=_>>8),t.flags&512&&(w[0]=_&255,w[1]=_>>>8&255,t.check=crc32_1(t.check,w,2,0)),_=0,s=0,t.mode=EXLEN;case EXLEN:if(t.flags&1024){for(;s<16;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}t.length=_,t.head&&(t.head.extra_len=_),t.flags&512&&(w[0]=_&255,w[1]=_>>>8&255,t.check=crc32_1(t.check,w,2,0)),_=0,s=0}else t.head&&(t.head.extra=null);t.mode=EXTRA;case EXTRA:if(t.flags&1024&&(f=t.length,f>o&&(f=o),f&&(t.head&&(E=t.head.extra_len-t.length,t.head.extra||(t.head.extra=new Uint8Array(t.head.extra_len)),t.head.extra.set(i.subarray(r,r+f),E)),t.flags&512&&(t.check=crc32_1(t.check,i,f,r)),o-=f,r+=f,t.length-=f),t.length))break e;t.length=0,t.mode=NAME;case NAME:if(t.flags&2048){if(o===0)break e;f=0;do E=i[r+f++],t.head&&E&&t.length<65536&&(t.head.name+=String.fromCharCode(E));while(E&&f<o);if(t.flags&512&&(t.check=crc32_1(t.check,i,f,r)),o-=f,r+=f,E)break e}else t.head&&(t.head.name=null);t.length=0,t.mode=COMMENT;case COMMENT:if(t.flags&4096){if(o===0)break e;f=0;do E=i[r+f++],t.head&&E&&t.length<65536&&(t.head.comment+=String.fromCharCode(E));while(E&&f<o);if(t.flags&512&&(t.check=crc32_1(t.check,i,f,r)),o-=f,r+=f,E)break e}else t.head&&(t.head.comment=null);t.mode=HCRC;case HCRC:if(t.flags&512){for(;s<16;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if(_!==(t.check&65535)){e.msg="header crc mismatch",t.mode=BAD;break}_=0,s=0}t.head&&(t.head.hcrc=t.flags>>9&1,t.head.done=!0),e.adler=t.check=0,t.mode=TYPE;break;case DICTID:for(;s<32;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}e.adler=t.check=zswap32(_),_=0,s=0,t.mode=DICT;case DICT:if(t.havedict===0)return e.next_out=l,e.avail_out=u,e.next_in=r,e.avail_in=o,t.hold=_,t.bits=s,Z_NEED_DICT$1;e.adler=t.check=1,t.mode=TYPE;case TYPE:if(n===Z_BLOCK||n===Z_TREES)break e;case TYPEDO:if(t.last){_>>>=s&7,s-=s&7,t.mode=CHECK;break}for(;s<3;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}switch(t.last=_&1,_>>>=1,s-=1,_&3){case 0:t.mode=STORED;break;case 1:if(fixedtables(t),t.mode=LEN_,n===Z_TREES){_>>>=2,s-=2;break e}break;case 2:t.mode=TABLE;break;case 3:e.msg="invalid block type",t.mode=BAD}_>>>=2,s-=2;break;case STORED:for(_>>>=s&7,s-=s&7;s<32;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if((_&65535)!==(_>>>16^65535)){e.msg="invalid stored block lengths",t.mode=BAD;break}if(t.length=_&65535,_=0,s=0,t.mode=COPY_,n===Z_TREES)break e;case COPY_:t.mode=COPY;case COPY:if(f=t.length,f){if(f>o&&(f=o),f>u&&(f=u),f===0)break e;a.set(i.subarray(r,r+f),l),o-=f,r+=f,u-=f,l+=f,t.length-=f;break}t.mode=TYPE;break;case TABLE:for(;s<14;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if(t.nlen=(_&31)+257,_>>>=5,s-=5,t.ndist=(_&31)+1,_>>>=5,s-=5,t.ncode=(_&15)+4,_>>>=4,s-=4,t.nlen>286||t.ndist>30){e.msg="too many length or distance symbols",t.mode=BAD;break}t.have=0,t.mode=LENLENS;case LENLENS:for(;t.have<t.ncode;){for(;s<3;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}t.lens[O[t.have++]]=_&7,_>>>=3,s-=3}for(;t.have<19;)t.lens[O[t.have++]]=0;if(t.lencode=t.lendyn,t.lenbits=7,b={bits:t.lenbits},S=inftrees(CODES,t.lens,0,19,t.lencode,0,t.work,b),t.lenbits=b.bits,S){e.msg="invalid code lengths set",t.mode=BAD;break}t.have=0,t.mode=CODELENS;case CODELENS:for(;t.have<t.nlen+t.ndist;){for(;L=t.lencode[_&(1<<t.lenbits)-1],c=L>>>24,T=L>>>16&255,I=L&65535,!(c<=s);){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if(I<16)_>>>=c,s-=c,t.lens[t.have++]=I;else{if(I===16){for(R=c+2;s<R;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if(_>>>=c,s-=c,t.have===0){e.msg="invalid bit length repeat",t.mode=BAD;break}E=t.lens[t.have-1],f=3+(_&3),_>>>=2,s-=2}else if(I===17){for(R=c+3;s<R;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}_>>>=c,s-=c,E=0,f=3+(_&7),_>>>=3,s-=3}else{for(R=c+7;s<R;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}_>>>=c,s-=c,E=0,f=11+(_&127),_>>>=7,s-=7}if(t.have+f>t.nlen+t.ndist){e.msg="invalid bit length repeat",t.mode=BAD;break}for(;f--;)t.lens[t.have++]=E}}if(t.mode===BAD)break;if(t.lens[256]===0){e.msg="invalid code -- missing end-of-block",t.mode=BAD;break}if(t.lenbits=9,b={bits:t.lenbits},S=inftrees(LENS,t.lens,0,t.nlen,t.lencode,0,t.work,b),t.lenbits=b.bits,S){e.msg="invalid literal/lengths set",t.mode=BAD;break}if(t.distbits=6,t.distcode=t.distdyn,b={bits:t.distbits},S=inftrees(DISTS,t.lens,t.nlen,t.ndist,t.distcode,0,t.work,b),t.distbits=b.bits,S){e.msg="invalid distances set",t.mode=BAD;break}if(t.mode=LEN_,n===Z_TREES)break e;case LEN_:t.mode=LEN;case LEN:if(o>=6&&u>=258){e.next_out=l,e.avail_out=u,e.next_in=r,e.avail_in=o,t.hold=_,t.bits=s,inffast(e,h),l=e.next_out,a=e.output,u=e.avail_out,r=e.next_in,i=e.input,o=e.avail_in,_=t.hold,s=t.bits,t.mode===TYPE&&(t.back=-1);break}for(t.back=0;L=t.lencode[_&(1<<t.lenbits)-1],c=L>>>24,T=L>>>16&255,I=L&65535,!(c<=s);){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if(T&&(T&240)===0){for(d=c,g=T,C=I;L=t.lencode[C+((_&(1<<d+g)-1)>>d)],c=L>>>24,T=L>>>16&255,I=L&65535,!(d+c<=s);){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}_>>>=d,s-=d,t.back+=d}if(_>>>=c,s-=c,t.back+=c,t.length=I,T===0){t.mode=LIT;break}if(T&32){t.back=-1,t.mode=TYPE;break}if(T&64){e.msg="invalid literal/length code",t.mode=BAD;break}t.extra=T&15,t.mode=LENEXT;case LENEXT:if(t.extra){for(R=t.extra;s<R;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}t.length+=_&(1<<t.extra)-1,_>>>=t.extra,s-=t.extra,t.back+=t.extra}t.was=t.length,t.mode=DIST;case DIST:for(;L=t.distcode[_&(1<<t.distbits)-1],c=L>>>24,T=L>>>16&255,I=L&65535,!(c<=s);){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if((T&240)===0){for(d=c,g=T,C=I;L=t.distcode[C+((_&(1<<d+g)-1)>>d)],c=L>>>24,T=L>>>16&255,I=L&65535,!(d+c<=s);){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}_>>>=d,s-=d,t.back+=d}if(_>>>=c,s-=c,t.back+=c,T&64){e.msg="invalid distance code",t.mode=BAD;break}t.offset=I,t.extra=T&15,t.mode=DISTEXT;case DISTEXT:if(t.extra){for(R=t.extra;s<R;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}t.offset+=_&(1<<t.extra)-1,_>>>=t.extra,s-=t.extra,t.back+=t.extra}if(t.offset>t.dmax){e.msg="invalid distance too far back",t.mode=BAD;break}t.mode=MATCH;case MATCH:if(u===0)break e;if(f=h-u,t.offset>f){if(f=t.offset-f,f>t.whave&&t.sane){e.msg="invalid distance too far back",t.mode=BAD;break}f>t.wnext?(f-=t.wnext,A=t.wsize-f):A=t.wnext-f,f>t.length&&(f=t.length),p=t.window}else p=a,A=l-t.offset,f=t.length;f>u&&(f=u),u-=f,t.length-=f;do a[l++]=p[A++];while(--f);t.length===0&&(t.mode=LEN);break;case LIT:if(u===0)break e;a[l++]=t.length,u--,t.mode=LEN;break;case CHECK:if(t.wrap){for(;s<32;){if(o===0)break e;o--,_|=i[r++]<<s,s+=8}if(h-=u,e.total_out+=h,t.total+=h,h&&(e.adler=t.check=t.flags?crc32_1(t.check,a,h,l-h):adler32_1(t.check,a,h,l-h)),h=u,(t.flags?_:zswap32(_))!==t.check){e.msg="incorrect data check",t.mode=BAD;break}_=0,s=0}t.mode=LENGTH;case LENGTH:if(t.wrap&&t.flags){for(;s<32;){if(o===0)break e;o--,_+=i[r++]<<s,s+=8}if(_!==(t.total&4294967295)){e.msg="incorrect length check",t.mode=BAD;break}_=0,s=0}t.mode=DONE;case DONE:S=Z_STREAM_END$1;break e;case BAD:S=Z_DATA_ERROR$1;break e;case MEM:return Z_MEM_ERROR$1;case SYNC:default:return Z_STREAM_ERROR$1}return e.next_out=l,e.avail_out=u,e.next_in=r,e.avail_in=o,t.hold=_,t.bits=s,(t.wsize||h!==e.avail_out&&t.mode<BAD&&(t.mode<CHECK||n!==Z_FINISH$1))&&updatewindow(e,e.output,e.next_out,h-e.avail_out),N-=e.avail_in,h-=e.avail_out,e.total_in+=N,e.total_out+=h,t.total+=h,t.wrap&&h&&(e.adler=t.check=t.flags?crc32_1(t.check,a,h,e.next_out-h):adler32_1(t.check,a,h,e.next_out-h)),e.data_type=t.bits+(t.last?64:0)+(t.mode===TYPE?128:0)+(t.mode===LEN_||t.mode===COPY_?256:0),(N===0&&h===0||n===Z_FINISH$1)&&S===Z_OK$1&&(S=Z_BUF_ERROR),S},inflateEnd=e=>{if(!e||!e.state)return Z_STREAM_ERROR$1;let n=e.state;return n.window&&(n.window=null),e.state=null,Z_OK$1},inflateGetHeader=(e,n)=>{if(!e||!e.state)return Z_STREAM_ERROR$1;const t=e.state;return(t.wrap&2)===0?Z_STREAM_ERROR$1:(t.head=n,n.done=!1,Z_OK$1)},inflateSetDictionary=(e,n)=>{const t=n.length;let i,a,r;return!e||!e.state||(i=e.state,i.wrap!==0&&i.mode!==DICT)?Z_STREAM_ERROR$1:i.mode===DICT&&(a=1,a=adler32_1(a,n,t,0),a!==i.check)?Z_DATA_ERROR$1:(r=updatewindow(e,n,t,t),r?(i.mode=MEM,Z_MEM_ERROR$1):(i.havedict=1,Z_OK$1))};var inflateReset_1=inflateReset,inflateReset2_1=inflateReset2,inflateResetKeep_1=inflateResetKeep,inflateInit_1=inflateInit,inflateInit2_1=inflateInit2,inflate_2$1=inflate$2,inflateEnd_1=inflateEnd,inflateGetHeader_1=inflateGetHeader,inflateSetDictionary_1=inflateSetDictionary,inflateInfo="pako inflate (from Nodeca project)",inflate_1$2={inflateReset:inflateReset_1,inflateReset2:inflateReset2_1,inflateResetKeep:inflateResetKeep_1,inflateInit:inflateInit_1,inflateInit2:inflateInit2_1,inflate:inflate_2$1,inflateEnd:inflateEnd_1,inflateGetHeader:inflateGetHeader_1,inflateSetDictionary:inflateSetDictionary_1,inflateInfo};function GZheader(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}var gzheader=GZheader;const toString=Object.prototype.toString,{Z_NO_FLUSH,Z_FINISH,Z_OK,Z_STREAM_END,Z_NEED_DICT,Z_STREAM_ERROR,Z_DATA_ERROR,Z_MEM_ERROR}=constants$2;function Inflate$1(e){this.options=common.assign({chunkSize:1024*64,windowBits:15,to:""},e||{});const n=this.options;n.raw&&n.windowBits>=0&&n.windowBits<16&&(n.windowBits=-n.windowBits,n.windowBits===0&&(n.windowBits=-15)),n.windowBits>=0&&n.windowBits<16&&!(e&&e.windowBits)&&(n.windowBits+=32),n.windowBits>15&&n.windowBits<48&&(n.windowBits&15)===0&&(n.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new zstream,this.strm.avail_out=0;let t=inflate_1$2.inflateInit2(this.strm,n.windowBits);if(t!==Z_OK)throw new Error(messages[t]);if(this.header=new gzheader,inflate_1$2.inflateGetHeader(this.strm,this.header),n.dictionary&&(typeof n.dictionary=="string"?n.dictionary=strings.string2buf(n.dictionary):toString.call(n.dictionary)==="[object ArrayBuffer]"&&(n.dictionary=new Uint8Array(n.dictionary)),n.raw&&(t=inflate_1$2.inflateSetDictionary(this.strm,n.dictionary),t!==Z_OK)))throw new Error(messages[t])}Inflate$1.prototype.push=function(e,n){const t=this.strm,i=this.options.chunkSize,a=this.options.dictionary;let r,l,o;if(this.ended)return!1;for(n===~~n?l=n:l=n===!0?Z_FINISH:Z_NO_FLUSH,toString.call(e)==="[object ArrayBuffer]"?t.input=new Uint8Array(e):t.input=e,t.next_in=0,t.avail_in=t.input.length;;){for(t.avail_out===0&&(t.output=new Uint8Array(i),t.next_out=0,t.avail_out=i),r=inflate_1$2.inflate(t,l),r===Z_NEED_DICT&&a&&(r=inflate_1$2.inflateSetDictionary(t,a),r===Z_OK?r=inflate_1$2.inflate(t,l):r===Z_DATA_ERROR&&(r=Z_NEED_DICT));t.avail_in>0&&r===Z_STREAM_END&&t.state.wrap>0&&e[t.next_in]!==0;)inflate_1$2.inflateReset(t),r=inflate_1$2.inflate(t,l);switch(r){case Z_STREAM_ERROR:case Z_DATA_ERROR:case Z_NEED_DICT:case Z_MEM_ERROR:return this.onEnd(r),this.ended=!0,!1}if(o=t.avail_out,t.next_out&&(t.avail_out===0||r===Z_STREAM_END))if(this.options.to==="string"){let u=strings.utf8border(t.output,t.next_out),_=t.next_out-u,s=strings.buf2string(t.output,u);t.next_out=_,t.avail_out=i-_,_&&t.output.set(t.output.subarray(u,u+_),0),this.onData(s)}else this.onData(t.output.length===t.next_out?t.output:t.output.subarray(0,t.next_out));if(!(r===Z_OK&&o===0)){if(r===Z_STREAM_END)return r=inflate_1$2.inflateEnd(this.strm),this.onEnd(r),this.ended=!0,!0;if(t.avail_in===0)break}}return!0};Inflate$1.prototype.onData=function(e){this.chunks.push(e)};Inflate$1.prototype.onEnd=function(e){e===Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=common.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};function inflate$1(e,n){const t=new Inflate$1(n);if(t.push(e),t.err)throw t.msg||messages[t.err];return t.result}function inflateRaw$1(e,n){return n=n||{},n.raw=!0,inflate$1(e,n)}var Inflate_1$1=Inflate$1,inflate_2=inflate$1,inflateRaw_1$1=inflateRaw$1,ungzip$1=inflate$1,constants=constants$2,inflate_1$1={Inflate:Inflate_1$1,inflate:inflate_2,inflateRaw:inflateRaw_1$1,ungzip:ungzip$1,constants};const{Deflate,deflate,deflateRaw,gzip}=deflate_1$1,{Inflate,inflate,inflateRaw,ungzip}=inflate_1$1;var deflate_1=deflate,inflate_1=inflate;const _hasatob=typeof atob=="function",_hasbtoa=typeof btoa=="function",_hasBuffer=typeof Buffer=="function",_TD=typeof TextDecoder=="function"?new TextDecoder:void 0,_TE=typeof TextEncoder=="function"?new TextEncoder:void 0,b64ch="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",b64chs=Array.prototype.slice.call(b64ch),b64tab=(e=>{let n={};return e.forEach((t,i)=>n[t]=i),n})(b64chs),b64re=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,_fromCC=String.fromCharCode.bind(String),_U8Afrom=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):(e,n=t=>t)=>new Uint8Array(Array.prototype.slice.call(e,0).map(n)),_mkUriSafe=e=>e.replace(/=/g,"").replace(/[+\/]/g,n=>n=="+"?"-":"_"),_tidyB64=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),btoaPolyfill=e=>{let n,t,i,a,r="";const l=e.length%3;for(let o=0;o<e.length;){if((t=e.charCodeAt(o++))>255||(i=e.charCodeAt(o++))>255||(a=e.charCodeAt(o++))>255)throw new TypeError("invalid character found");n=t<<16|i<<8|a,r+=b64chs[n>>18&63]+b64chs[n>>12&63]+b64chs[n>>6&63]+b64chs[n&63]}return l?r.slice(0,l-3)+"===".substring(l):r},_btoa=_hasbtoa?e=>btoa(e):_hasBuffer?e=>Buffer.from(e,"binary").toString("base64"):btoaPolyfill,_fromUint8Array=_hasBuffer?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let i=0,a=e.length;i<a;i+=4096)t.push(_fromCC.apply(null,e.subarray(i,i+4096)));return _btoa(t.join(""))},fromUint8Array=(e,n=!1)=>n?_mkUriSafe(_fromUint8Array(e)):_fromUint8Array(e),cb_utob=e=>{if(e.length<2){var n=e.charCodeAt(0);return n<128?e:n<2048?_fromCC(192|n>>>6)+_fromCC(128|n&63):_fromCC(224|n>>>12&15)+_fromCC(128|n>>>6&63)+_fromCC(128|n&63)}else{var n=65536+(e.charCodeAt(0)-55296)*1024+(e.charCodeAt(1)-56320);return _fromCC(240|n>>>18&7)+_fromCC(128|n>>>12&63)+_fromCC(128|n>>>6&63)+_fromCC(128|n&63)}},re_utob=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,utob=e=>e.replace(re_utob,cb_utob),_encode=_hasBuffer?e=>Buffer.from(e,"utf8").toString("base64"):_TE?e=>_fromUint8Array(_TE.encode(e)):e=>_btoa(utob(e)),encode=(e,n=!1)=>n?_mkUriSafe(_encode(e)):_encode(e),re_btou=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,cb_btou=e=>{switch(e.length){case 4:var n=(7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3),t=n-65536;return _fromCC((t>>>10)+55296)+_fromCC((t&1023)+56320);case 3:return _fromCC((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return _fromCC((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},btou=e=>e.replace(re_btou,cb_btou),atobPolyfill=e=>{if(e=e.replace(/\s+/g,""),!b64re.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(e.length&3));let n,t="",i,a;for(let r=0;r<e.length;)n=b64tab[e.charAt(r++)]<<18|b64tab[e.charAt(r++)]<<12|(i=b64tab[e.charAt(r++)])<<6|(a=b64tab[e.charAt(r++)]),t+=i===64?_fromCC(n>>16&255):a===64?_fromCC(n>>16&255,n>>8&255):_fromCC(n>>16&255,n>>8&255,n&255);return t},_atob=_hasatob?e=>atob(_tidyB64(e)):_hasBuffer?e=>Buffer.from(e,"base64").toString("binary"):atobPolyfill,_toUint8Array=_hasBuffer?e=>_U8Afrom(Buffer.from(e,"base64")):e=>_U8Afrom(_atob(e),n=>n.charCodeAt(0)),toUint8Array=e=>_toUint8Array(_unURI(e)),_decode=_hasBuffer?e=>Buffer.from(e,"base64").toString("utf8"):_TD?e=>_TD.decode(_toUint8Array(e)):e=>btou(_atob(e)),_unURI=e=>_tidyB64(e.replace(/[-_]/g,n=>n=="-"?"+":"/")),decode=e=>_decode(_unURI(e)),base64Serde={serialize:e=>encode(e,!0),deserialize:e=>decode(e)},pakoSerde={serialize:e=>{const n=new TextEncoder().encode(e),t=deflate_1(n,{level:9});return fromUint8Array(t,!0)},deserialize:e=>{const n=toUint8Array(e);return inflate_1(n,{to:"string"})}},serdes={base64:base64Serde,pako:pakoSerde},serializeState=e=>{const n=JSON.stringify(e),t="pako",i=serdes[t].serialize(n);return`${t}:${i}`},deserializeState=e=>{let n,t;if(e.includes(":")){let a;if([a,t]=e.split(":"),a in serdes)n=a;else throw new Error(`Unknown serde type: ${a}`)}else n="base64",t=e;const i=serdes[n].deserialize(t);return JSON.parse(i)},defaultState={code:`graph TD
A[Christmas] -->|Get money| B(Go shopping)
B --> C{Let me think}
C -->|One| D[Laptop]
C -->|Two| E[iPhone]
C -->|Three| F[fa:fa-car Car]
`,mermaid:JSON.stringify({theme:"default"},null,2),updateEditor:!1,autoSync:!0,updateDiagram:!0},urlParseFailedState=`graph TD
A[Loading URL failed. We can try to figure out why.] -->|Decode JSON| B(Please check the console to see the JSON and error details.)
B --> C{Is the JSON correct?}
C -->|Yes| D(Please Click here to Raise an issue in github.<br/>Including the broken link in the issue <br/> will speed up the fix.)
C -->|No| E{Did someone <br/>send you this link?}
E -->|Yes| F[Ask them to send <br/>you the complete link]
E -->|No| G{Did you copy <br/> the complete URL?}
G --> |Yes| D
G --> |"No :("| H(Try using the Timeline tab in History <br/>from same browser you used to create the diagram.)
click D href "https://github.com/mermaid-js/mermaid-live-editor/issues/new?assignees=&labels=bug&template=bug_report.md&title=Broken%20link" "Raise issue"`,codeStore=persist(writable(defaultState),localStorage(),"codeStore"),serializedState=derived([codeStore],([e],n)=>{n(serializeState(e))}),loadState=e=>{let n;console.log("Loading",e);try{n=deserializeState(e);const t=typeof n.mermaid=="string"?JSON.parse(n.mermaid):n.mermaid;t.securityLevel&&t.securityLevel!=="strict"&&confirm(`Removing "securityLevel":"${t.securityLevel}" from the config for safety.
Click Cancel if you trust the source of this Diagram.`)&&delete t.securityLevel,n.mermaid=JSON.stringify(t,null,2)}catch(t){n=get_store_value(codeStore),e&&(console.error("Init error",t),n.code=urlParseFailedState)}updateCodeStore(k(B({},n),{updateEditor:!0}))},updateCodeStore=e=>{codeStore.update(n=>B(B({},n),e))};let prompted=!1;const updateCode=(e,n,t=!1)=>{if(saveStatistics(e),(e.match(/\n/g)||"").length+1>50&&!prompted&&get_store_value(codeStore).autoSync){const a=confirm("Long diagram detected. Turn off Auto Sync? Click the sync logo to manually sync.");prompted=!0,a&&updateCodeStore({autoSync:!1})}codeStore.update(a=>k(B({},a),{code:e,updateEditor:n,updateDiagram:t}))},updateConfig=(e,n)=>{codeStore.update(t=>k(B({},t),{mermaid:e,updateEditor:n}))},toggleDarkTheme=e=>{codeStore.update(n=>{const t=JSON.parse(n.mermaid);return(!t.theme||["dark","default"].includes(t.theme))&&(t.theme=e?"dark":"default"),k(B({},n),{mermaid:JSON.stringify(t,null,2),updateEditor:!0})})},initURLSubscription=()=>{serializedState.subscribe(e=>{history.replaceState(void 0,void 0,`#${e}`)})},getStateString=()=>JSON.stringify(get_store_value(codeStore));export{localStorage as a,analytics as b,codeStore as c,pakoSerde as d,encode as e,updateConfig as f,getStateString as g,defaultState as h,updateCodeStore as i,initLoading as j,initURLSubscription as k,loadingStateStore as l,initAnalytics as m,loadState as n,persist as p,serializedState as s,toggleDarkTheme as t,updateCode as u};