@veypi/vhtml 0.7.4 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/vhtml.js +3529 -4196
- package/dist/vhtml.min.js +1 -1
- package/package.json +1 -1
package/dist/vhtml.min.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var t;t=function(){const t=new class{constructor(){this.scopeAttribute="",this.scopeBody="",this.scopedKeyframes=new Map}parse(t,e){return this.scopeAttribute=`[vrefof="${e}"]`,this.scopeBody=`[vref="${e}"]`,this.scopedKeyframes.clear(),this.scopeSuffix=e.replace(/[^a-zA-Z0-9]/g,""),t=this.removeComments(t),this.collectKeyframes(t),this.parseRules(t)}collectKeyframes(t){const e=/@keyframes\s+([^\s{]+)/gi;let n;for(;null!==(n=e.exec(t));){const t=n[1],e=t+"-"+this.scopeSuffix;this.scopedKeyframes.set(t,e)}}removeComments(t){return t.replace(/\/\*[\s\S]*?\*\//g,"")}parseRules(t){let e="",n=0;for(;n<t.length;){for(;n<t.length&&/\s/.test(t[n]);)e+=t[n],n++;if(n>=t.length)break;if("@"===t[n]){const r=this.parseAtRule(t,n);e+=r.content,n=r.endIndex}else{const r=this.parseNormalRule(t,n);e+=r.content,n=r.endIndex}}return e}parseAtRule(t,e){let n=e,r="";for(;n<t.length&&"{"!==t[n];)r+=t[n],n++;if(n>=t.length)return{content:r,endIndex:n};const o=r.toLowerCase().trim();if(o.startsWith("@keyframes"))return this.parseKeyframes(t,e);if(o.startsWith("@media"))return this.parseMedia(t,e);if(o.startsWith("@supports"))return this.parseSupports(t,e);{const e=this.findMatchingBrace(t,n);return{content:r+e.content,endIndex:e.endIndex}}}parseKeyframes(t,e){let n=e,r="";for(;n<t.length&&"{"!==t[n];)r+=t[n],n++;if(n>=t.length)return{content:r,endIndex:n};const o=this.findMatchingBrace(t,n),i=o.content,s=this.extractKeyframeName(r),c=this.scopedKeyframes.get(s);return c&&(r=r.replace(s,c)),r+=i,{content:r,endIndex:o.endIndex}}extractKeyframeName(t){const e=t.match(/@keyframes\s+([^\s{]+)/i);return e?e[1]:""}parseMedia(t,e){let n=e,r="";for(;n<t.length&&"{"!==t[n];)r+=t[n],n++;if(n>=t.length)return{content:r,endIndex:n};r+="{",n++;let o=1,i="";for(;n<t.length&&o>0;){if("{"===t[n])o++;else if("}"===t[n]&&(o--,0===o))break;i+=t[n],n++}return r+=this.parseRules(i),n<t.length&&"}"===t[n]&&(r+="}",n++),{content:r,endIndex:n}}parseSupports(t,e){return this.parseMedia(t,e)}parseNormalRule(t,e){let n=e,r="";for(;n<t.length&&"{"!==t[n];)r+=t[n],n++;if(n>=t.length)return{content:r,endIndex:n};const o=this.addScopeToSelector(r.trim()),i=this.findMatchingBrace(t,n);return{content:o+this.processRuleContent(i.content),endIndex:i.endIndex}}processRuleContent(t){let e=t;return e=e.replace(/animation\s*:\s*([^;]+);/gi,((t,e)=>`animation: ${this.processAnimationValue(e)};`)),e=e.replace(/animation-name\s*:\s*([^;]+);/gi,((t,e)=>`animation-name: ${this.processAnimationNames(e)};`)),e}processAnimationValue(t){return t.split(",").map((t=>t.trim())).map((t=>{const e=t.split(/\s+/);for(let n=0;n<e.length;n++){const t=e[n];if(/^\d+(\.\d+)?(s|ms)$/.test(t))continue;if(/^\d+(\.\d+)?$/.test(t))continue;if(["ease","ease-in","ease-out","ease-in-out","linear","infinite","normal","reverse","alternate","alternate-reverse","forwards","backwards","both","running","paused"].includes(t))continue;if(t.startsWith("cubic-bezier("))continue;const r=this.scopedKeyframes.get(t);r&&(e[n]=r);break}return e.join(" ")})).join(", ")}processAnimationNames(t){return t.split(",").map((t=>{const e=t.trim();return this.scopedKeyframes.get(e)||e})).join(", ")}addScopeToSelector(t){return t.trim()?t.split(",").map((t=>t.trim())).map((t=>this.addScopeToSingleSelector(t))).join(", "):t}addScopeToSingleSelector(t){if(!t.trim())return t;if(t.includes("::")){const e=t.split("::"),n=e[0],r="::"+e.slice(1).join("::");return this.addScopeToSelectorPart(n)+r}if(t.includes(":")&&!t.includes("::")){const e=t.match(/^([^:]+)(:.+)$/);if(e){const t=e[1],n=e[2];return this.addScopeToSelectorPart(t)+n}}return"*"===t||t.startsWith("@")?t:this.addScopeToSelectorPart(t)}addScopeToSelectorPart(t){const e=/(\s*[>+~]\s*|\s+)/;if(e.test(t)){const n=t.split(e);if(/^body(?:$|[:\[ ])/.test(n[0]))return n[0]=this.scopeBody+n[0].slice(4),n.join("");if(/^:root(?:$|[:\[ ])/.test(n[0]))return n[0]=this.scopeBody+n[0].slice(5),n.join("");for(let t=n.length-1;t>=0;t--)if(n[t].trim()&&!e.test(n[t])){let e=n[t].trim();n[t]=/^body(?:$|[:\[ ])/.test(e)?this.scopeBody+e.slice(4):/^:root(?:$:[$:\[ ])/.test(e)?this.scopeBody+e.slice(5):n[t].trim()+this.scopeAttribute;break}return n.join("")}let n=(t=t.trim()).trim();return/^body(?:$|[:\[ ])/.test(n)?this.scopeBody+n.slice(4):/^:root(?:$:[$:\[ ])/.test(n)?this.scopeBody+n.slice(5):n+this.scopeAttribute}findMatchingBrace(t,e){let n=e,r="",o=0;for(;n<t.length;){if(r+=t[n],"{"===t[n])o++;else if("}"===t[n]&&(o--,0===o)){n++;break}n++}return{content:r,endIndex:n}}},e=[],n=[];let r=!1;const o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(window):t=>setTimeout(t,16),i=()=>{r=!1;const t=new Set(n.splice(0));let o=0;for(const n of t)e[n]&&(e[n](),o++);return o},s=()=>{r||(r=!0,o(i))};function c(){return`${performance.now().toString(36)}-${Math.random().toString(36).substring(2,5)}`}function u(t,e=new Set){if(t&&"object"==typeof t&&!e.has(t)){e.add(t);for(let n in t)u(t[n],e)}return t}window.$vupdate=t=>{"function"==typeof e[t]&&e[t]()};var a=[];const l=Symbol("isProxy"),f=Symbol("DataID"),h=Symbol("bind"),d=Symbol("root");function p(t,e){t[d]=e}function m(t){return!(!t||"object"!=typeof t||t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Event||t.o||t.constructor!==Object&&t.constructor!==Array)}function y(t,e){if(!t||!t[l]||!m(e))return e;let n=t[h];if(!e[l]){if(Array.isArray(e)&&Array.isArray(t)){t.length=0;for(let n=0;n<e.length;n++)t.push(e[n]);return t}return Object.keys(t).forEach((n=>{e.hasOwnProperty(n)||delete t[n]})),Object.keys(e).forEach((n=>{t[n]?.[l]?t[n]=y(t[n],e[n]):t[n]=e[n]})),t}if(e[f]===t[f])return e;for(let r in n)if(e[h][r]?.indexOf){const t=e[h][r],o=new Set(t);for(let e of n[r])o.has(e)||(t.push(e),o.add(e))}else e[h][r]=n[r];for(let r in e)r in t&&t[r]?.[l]&&(e[r]=y(t[r],e[r]));return e}const w={console,window,prompt:prompt.bind(window),alert:alert.bind(window),confirm:confirm.bind(window),RegExp,document,Array,Object,Math,Date,JSON,Symbol,Number,eval,isNaN,parseInt,parseFloat,setTimeout:setTimeout.bind(window),setInterval:setInterval.bind(window),clearTimeout:clearTimeout.bind(window),clearInterval:clearInterval.bind(window),encodeURIComponent,btoa:btoa.bind(window),fetch:fetch.bind(window),TextDecoder,history,requestAnimationFrame:requestAnimationFrame.bind(window),getComputedStyle:getComputedStyle.bind(window)};function b(t,e={},n={}){const r=e||{},o=n||{},i=r?.$sys||null,s=r?.$ctx||null,c=r?.$mod||null,u=new Proxy(t,{has:(t,e)=>!0,get(e,n,r){let u;return"$data"===n?u=t:"$sys"===n?u=i:"$ctx"===n?u=s:"$mod"===n?u=c:i&&n in i?u=i[n]:n in e?u=Reflect.get(e,n,r):s&&n in s?u=s[n]:c&&n in c?u=c[n]:o&&n in o?u=o[n]:n in w?u=w[n]:n in window&&(u=window[n]),u},set:(t,e,n,r)=>Reflect.set(t,e,n,r)});return u}const v=new Map;function g(t,e,n,r={}){let o=e.get(t);if(o)return o;let i=t.trim();const s=i.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"").trim(),c=/^(var|let|const|if|for|while|switch|try|throw|class|function|return|debugger)\b/.test(s),u=-1===i.indexOf("\n");!1!==r.returnExpression&&!c&&u&&(i="return "+i);const a=`\nwith (sandbox) {\n${i}\n}`;try{return o=n(a),e.set(t,o),o}catch(l){return null}}const x=Object.getPrototypeOf((async function(){})).constructor,R=new Map,O={Wrap:function t(r,o=void 0){const i=c();let u=!1;"[object Array]"==={}.toString.call(r)&&(u=!0),o&&p(r,o),r[f]=i;const w={},b={get(e,n,r){if(n===f)return i;if(n===l)return!0;if(n===h)return w;const o=Reflect.has(e,n),s=Reflect.get(e,n,r);if(!o&&e[d]&&n in e[d])return e[d][n];if("function"==typeof s)return s;let c=-1;if(a.length>0){let t=n;c=a[a.length-1],u&&(t=""),w.hasOwnProperty(t)?-1==w[t].indexOf(c)&&w[t].push(c):w[t]=[c]}if(m(s)&&!s[l]){let o=t(s,void 0);return Reflect.set(e,n,o,r),o}return s},set(t,r,o,i){const c=Reflect.get(t,r,i);if(c===o)return!0;let f=!0;if(Array.isArray(o)&&Array.isArray(c)){c.length=0;for(let t=0;t<o.length;t++)c.push(o[t])}else c&&c[l]&&m(o)?(o=y(c,o),f=Reflect.set(t,r,o,i)):f=Reflect.set(t,r,o,i);if(f&&0===a.length){let t=r;if(u&&(t=""),w[t]){let r=0;for(;r<w[t].length;){let o=w[t][r];e[o]?(r++,n.push(o),s()):w[t].splice(r,1)}}}return f},has:(t,e)=>!!Reflect.has(t,e)||!(!t[d]||!(e in t[d])),deleteProperty(t,r){const o=Reflect.deleteProperty(t,r);if(o&&0===a.length){let t=r;if(u&&(t=""),w[t]){let r=0;for(;r<w[t].length;){let o=w[t][r];e[o]?(r++,n.push(o),s()):w[t].splice(r,1)}}}return o}};return new Proxy(r,b)},Watch:function(t,n,r){let o=e.length;const i=()=>{a.push(o);try{const e=t();return r&&r.deep&&u(e),e}catch(E){return}finally{a.pop()}};"function"==typeof n?e.push((()=>{n(i())})):e.push(i);const s=i();return"function"==typeof n&&n(s),o},Cancel:function(t){t>=0&&t<e.length&&(e[t]=null)},ForceUpdate:function(){for(let t of e)t&&t()},SetDataRoot:p,DataID:f,GenUniqueID:c,Run:function(t,e,n,r){return function(t,e,n,r,o){if(t)try{return t(b(n,r,o))}catch(i){}}(g(t,v,(t=>Function("sandbox",t)),{label:"Run"}),0,e,n,r)},AsyncRun:async function(t,e,n,r){const o=g(t,R,(t=>new x("sandbox",t)),{label:"AsyncRun",returnExpression:!0});return await async function(t,e,n,r,o){if(t)try{return await t(b(n,r,o))}catch(i){throw i}}(o,0,e,n,r)}};class S{constructor(){this.events={}}on(t,e,n=null){if("function"!=typeof e)throw Error("\u56de\u8c03\u51fd\u6570\u5fc5\u987b\u662f\u4e00\u4e2a\u51fd\u6570");this.events[t]||(this.events[t]=[]);const r={callback:e,context:n};return this.events[t].push(r),()=>this.off(t,e,n)}once(t,e,n=null){const r=(...o)=>{this.off(t,r,n),e.apply(n,o)};return this.on(t,r,n)}off(t,e=null,n=null){this.events[t]&&(e?(this.events[t]=this.events[t].filter((t=>!(t.callback===e&&t.context===n))),0===this.events[t].length&&delete this.events[t]):delete this.events[t])}emit(t,...e){this.events[t]&&[...this.events[t]].forEach((t=>{try{t.callback.apply(t.context,e)}catch(n){}}))}listenerCount(t){return this.events[t]?this.events[t].length:0}eventNames(){return Object.keys(this.events)}removeAllListeners(){this.events={}}hasListeners(t){return this.listenerCount(t)>0}}function E(t,e){return function(){return t.apply(e,arguments)}}const{toString:j}=Object.prototype,{getPrototypeOf:A}=Object,{iterator:k,toStringTag:T}=Symbol,$=(N=Object.create(null),t=>{const e=j.call(t);return N[e]||(N[e]=e.slice(8,-1).toLowerCase())});var N;const C=t=>(t=t.toLowerCase(),e=>$(e)===t),P=t=>e=>typeof e===t,{isArray:L}=Array,U=P("undefined"),D=C("ArrayBuffer"),F=P("string"),I=P("function"),M=P("number"),q=t=>null!==t&&"object"==typeof t,B=t=>{if("object"!==$(t))return!1;const e=A(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||T in t||k in t)},_=C("Date"),z=C("File"),H=C("Blob"),W=C("FileList"),J=C("URLSearchParams"),[K,V,X,G]=["ReadableStream","Request","Response","Headers"].map(C);function Z(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),L(t))for(r=0,o=t.length;o>r;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),i=o.length;let s;for(r=0;i>r;r++)s=o[r],e.call(null,t[s],s,t)}}function Y(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const Q="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,tt=t=>!U(t)&&t!==Q,et=(nt="undefined"!=typeof Uint8Array&&A(Uint8Array),t=>nt&&t instanceof nt);var nt;const rt=C("HTMLFormElement"),ot=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),it=C("RegExp"),st=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};Z(n,((n,o)=>{let i;!1!==(i=e(n,o,t))&&(r[o]=i||n)})),Object.defineProperties(t,r)},ct=C("AsyncFunction"),ut=(at="function"==typeof setImmediate,lt=I(Q.postMessage),at?setImmediate:lt?(ft="axios@"+Math.random(),ht=[],Q.addEventListener("message",(({source:t,data:e})=>{t===Q&&e===ft&&ht.length&&ht.shift()()}),!1),t=>{ht.push(t),Q.postMessage(ft,"*")}):t=>setTimeout(t));var at,lt,ft,ht;const dt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(Q):"undefined"!=typeof process&&process.nextTick||ut,pt={isArray:L,isArrayBuffer:D,isBuffer:function(t){return null!==t&&!U(t)&&null!==t.constructor&&!U(t.constructor)&&I(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||I(t.append)&&("formdata"===(e=$(t))||"object"===e&&I(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&D(t.buffer),e},isString:F,isNumber:M,isBoolean:t=>!0===t||!1===t,isObject:q,isPlainObject:B,isReadableStream:K,isRequest:V,isResponse:X,isHeaders:G,isUndefined:U,isDate:_,isFile:z,isBlob:H,isRegExp:it,isFunction:I,isStream:t=>q(t)&&I(t.pipe),isURLSearchParams:J,isTypedArray:et,isFileList:W,forEach:Z,merge:function t(){const{caseless:e}=tt(this)&&this||{},n={},r=(r,o)=>{const i=e&&Y(n,o)||o;B(n[i])&&B(r)?n[i]=t(n[i],r):B(r)?n[i]=t({},r):L(r)?n[i]=r.slice():n[i]=r};for(let o=0,i=arguments.length;i>o;o++)arguments[o]&&Z(arguments[o],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(Z(e,((e,r)=>{n&&I(e)?t[r]=E(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,i,s;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),i=o.length;i-- >0;)s=o[i],r&&!r(s,t,e)||c[s]||(e[s]=t[s],c[s]=!0);t=!1!==n&&A(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:$,kindOfTest:C,endsWith:(t,e,n)=>{t+="",(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(L(t))return t;let e=t.length;if(!M(e))return null;const n=Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[k]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:rt,hasOwnProperty:ot,hasOwnProp:ot,reduceDescriptors:st,freezeMethods:t=>{st(t,((e,n)=>{if(I(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];I(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return L(t)?r(t):r((t+"").split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:Y,global:Q,isContextDefined:tt,isSpecCompliantForm:function(t){return!!(t&&I(t.append)&&"FormData"===t[T]&&t[k])},toJSONObject:t=>{const e=[,,,,,,,,,,],n=(t,r)=>{if(q(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const o=L(t)?[]:{};return Z(t,((t,e)=>{const i=n(t,r+1);!U(i)&&(o[e]=i)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:ct,isThenable:t=>t&&(q(t)||I(t))&&I(t.then)&&I(t.catch),setImmediate:ut,asap:dt,isIterable:t=>null!=t&&I(t[k])};function mt(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}pt.inherits(mt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:pt.toJSONObject(this.config),code:this.code,status:this.status}}});const yt=mt.prototype,wt={};function bt(t){return pt.isPlainObject(t)||pt.isArray(t)}function vt(t){return pt.endsWith(t,"[]")?t.slice(0,-2):t}function gt(t,e,n){return t?t.concat(e).map((function(t,e){return t=vt(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{wt[t]={value:t}})),Object.defineProperties(mt,wt),Object.defineProperty(yt,"isAxiosError",{value:!0}),mt.from=(t,e,n,r,o,i)=>{const s=Object.create(yt);return pt.toFlatObject(t,s,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),mt.call(s,t.message,e,n,r,o),s.cause=t,s.name=t.name,i&&Object.assign(s,i),s};const xt=pt.toFlatObject(pt,{},null,(function(t){return/^is[A-Z]/.test(t)}));function Rt(t,e,n){if(!pt.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=pt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!pt.isUndefined(e[t])}))).metaTokens,o=n.visitor||a,i=n.dots,s=n.indexes,c=(n.Blob||"undefined"!=typeof Blob&&Blob)&&pt.isSpecCompliantForm(e);if(!pt.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(pt.isDate(t))return t.toISOString();if(pt.isBoolean(t))return t.toString();if(!c&&pt.isBlob(t))throw new mt("Blob is not supported. Use a Buffer instead.");return pt.isArrayBuffer(t)||pt.isTypedArray(t)?c&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function a(t,n,o){let c=t;if(t&&!o&&"object"==typeof t)if(pt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(pt.isArray(t)&&function(t){return pt.isArray(t)&&!t.some(bt)}(t)||(pt.isFileList(t)||pt.endsWith(n,"[]"))&&(c=pt.toArray(t)))return n=vt(n),c.forEach((function(t,r){!pt.isUndefined(t)&&null!==t&&e.append(!0===s?gt([n],r,i):null===s?n:n+"[]",u(t))})),!1;return!!bt(t)||(e.append(gt(o,n,i),u(t)),!1)}const l=[],f=Object.assign(xt,{defaultVisitor:a,convertValue:u,isVisitable:bt});if(!pt.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!pt.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),pt.forEach(n,(function(n,i){!0===(!(pt.isUndefined(n)||null===n)&&o.call(e,n,pt.isString(i)?i.trim():i,r,f))&&t(n,r?r.concat(i):[i])})),l.pop()}}(t),e}function Ot(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function St(t,e){this.i=[],t&&Rt(t,this,e)}const Et=St.prototype;function jt(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function At(t,e,n){if(!e)return t;const r=n&&n.encode||jt;pt.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let i;if(i=o?o(e,n):pt.isURLSearchParams(e)?e.toString():new St(e,n).toString(r),i){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+i}return t}Et.append=function(t,e){this.i.push([t,e])},Et.toString=function(t){const e=t?function(e){return t.call(this,e,Ot)}:Ot;return this.i.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const kt=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){pt.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Tt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},$t={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:St,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Nt="undefined"!=typeof window&&"undefined"!=typeof document,Ct="object"==typeof navigator&&navigator||void 0,Pt=Nt&&(!Ct||0>["ReactNative","NativeScript","NS"].indexOf(Ct.product)),Lt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,Ut=Nt&&window.location.href||"http://localhost",Dt={...Object.freeze({__proto__:null,hasBrowserEnv:Nt,hasStandardBrowserWebWorkerEnv:Lt,hasStandardBrowserEnv:Pt,navigator:Ct,origin:Ut}),...$t};function Ft(t){function e(t,n,r,o){let i=t[o++];if("__proto__"===i)return!0;const s=Number.isFinite(+i),c=o>=t.length;return i=!i&&pt.isArray(r)?r.length:i,c?(pt.hasOwnProp(r,i)?r[i]=[r[i],n]:r[i]=n,!s):(r[i]&&pt.isObject(r[i])||(r[i]=[]),e(t,n,r[i],o)&&pt.isArray(r[i])&&(r[i]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let i;for(r=0;o>r;r++)i=n[r],e[i]=t[i];return e}(r[i])),!s)}if(pt.isFormData(t)&&pt.isFunction(t.entries)){const n={};return pt.forEachEntry(t,((t,r)=>{e(function(t){return pt.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null}const It={transitional:Tt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=pt.isObject(t);if(o&&pt.isHTMLForm(t)&&(t=new FormData(t)),pt.isFormData(t))return r?JSON.stringify(Ft(t)):t;if(pt.isArrayBuffer(t)||pt.isBuffer(t)||pt.isStream(t)||pt.isFile(t)||pt.isBlob(t)||pt.isReadableStream(t))return t;if(pt.isArrayBufferView(t))return t.buffer;if(pt.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let i;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return Rt(t,new Dt.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return Dt.isNode&&pt.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((i=pt.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return Rt(i?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t){if(pt.isString(t))try{return(0,JSON.parse)(t),pt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||It.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(pt.isResponse(t)||pt.isReadableStream(t))return t;if(t&&pt.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw mt.from(t,mt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Dt.classes.FormData,Blob:Dt.classes.Blob},validateStatus:function(t){return t>=200&&300>t},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};pt.forEach(["delete","get","head","post","put","patch"],(t=>{It.headers[t]={}}));const Mt=It,qt=pt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Bt=Symbol("internals");function _t(t){return t&&(t+"").trim().toLowerCase()}function zt(t){return!1===t||null==t?t:pt.isArray(t)?t.map(zt):t+""}function Ht(t,e,n,r,o){return pt.isFunction(r)?r.call(this,e,n):(o&&(e=n),pt.isString(e)?pt.isString(r)?-1!==e.indexOf(r):pt.isRegExp(r)?r.test(e):void 0:void 0)}class Wt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=_t(e);if(!o)throw Error("header name must be a non-empty string");const i=pt.findKey(r,o);(!i||void 0===r[i]||!0===n||void 0===n&&!1!==r[i])&&(r[i||e]=zt(t))}const i=(t,e)=>pt.forEach(t,((t,n)=>o(t,n,e)));if(pt.isPlainObject(t)||t instanceof this.constructor)i(t,e);else if(pt.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))i((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&qt[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(pt.isObject(t)&&pt.isIterable(t)){let n,r,o={};for(const e of t){if(!pt.isArray(e))throw TypeError("Object iterator must return a key-value pair");o[r=e[0]]=(n=o[r])?pt.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}i(o,e)}else null!=t&&o(e,t,n);return this}get(t,e){if(t=_t(t)){const n=pt.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(pt.isFunction(e))return e.call(this,t,n);if(pt.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=_t(t)){const n=pt.findKey(this,t);return!(!n||void 0===this[n]||e&&!Ht(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=_t(t)){const o=pt.findKey(n,t);!o||e&&!Ht(0,n[o],o,e)||(delete n[o],r=!0)}}return pt.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!Ht(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return pt.forEach(this,((r,o)=>{const i=pt.findKey(n,o);if(i)return e[i]=zt(r),void delete e[o];const s=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):(o+"").trim();s!==o&&delete e[o],e[s]=zt(r),n[s]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return pt.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&pt.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[Bt]=this[Bt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=_t(t);e[r]||(function(t,e){const n=pt.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return pt.isArray(t)?t.forEach(r):r(t),this}}Wt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),pt.reduceDescriptors(Wt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),pt.freezeMethods(Wt);const Jt=Wt;function Kt(t,e){const n=this||Mt,r=e||n,o=Jt.from(r.headers);let i=r.data;return pt.forEach(t,(function(t){i=t.call(n,i,o.normalize(),e?e.status:void 0)})),o.normalize(),i}function Vt(t){return!(!t||!t.u)}function Xt(t,e,n){mt.call(this,t??"canceled",mt.ERR_CANCELED,e,n),this.name="CanceledError"}function Gt(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new mt("Request failed with status code "+n.status,[mt.ERR_BAD_REQUEST,mt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}pt.inherits(Xt,mt,{u:!0});const Zt=(t,e,n=3)=>{let r=0;const o=function(t,e){const n=Array(t=t||10),r=Array(t);let o,i=0,s=0;return e=void 0!==e?e:1e3,function(c){const u=Date.now(),a=r[s];o||(o=u),n[i]=c,r[i]=u;let l=s,f=0;for(;l!==i;)f+=n[l++],l%=t;if(i=(i+1)%t,i===s&&(s=(s+1)%t),e>u-o)return;const h=a&&u-a;return h?Math.round(1e3*f/h):void 0}}(50,250);return function(t,e){let n,r,o=0,i=1e3/e;const s=(e,i=Date.now())=>{o=i,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),c=e-o;i>c?(n=t,r||(r=setTimeout((()=>{r=null,s(n)}),i-c))):s(t,e)},()=>n&&s(n)]}((n=>{const i=n.loaded,s=n.lengthComputable?n.total:void 0,c=i-r,u=o(c);r=i,t({loaded:i,total:s,progress:s?i/s:void 0,bytes:c,rate:u||void 0,estimated:u&&s&&s>=i?(s-i)/u:void 0,event:n,lengthComputable:null!=s,[e?"download":"upload"]:!0})}),n)},Yt=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},Qt=t=>(...e)=>pt.asap((()=>t(...e))),te=Dt.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,Dt.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(Dt.origin),Dt.navigator&&/(msie|trident)/i.test(Dt.navigator.userAgent)):()=>!0,ee=Dt.hasStandardBrowserEnv?{write(t,e,n,r,o,i){const s=[t+"="+encodeURIComponent(e)];pt.isNumber(n)&&s.push("expires="+new Date(n).toGMTString()),pt.isString(r)&&s.push("path="+r),pt.isString(o)&&s.push("domain="+o),!0===i&&s.push("secure"),document.cookie=s.join("; ")},read(t){const e=document.cookie.match(RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ne(t,e,n){return!t||/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)&&0!=n?e:function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e)}const re=t=>t instanceof Jt?{...t}:t;function oe(t,e){e=e||{};const n={};function r(t,e,n,r){return pt.isPlainObject(t)&&pt.isPlainObject(e)?pt.merge.call({caseless:r},t,e):pt.isPlainObject(e)?pt.merge({},e):pt.isArray(e)?e.slice():e}function o(t,e,n,o){return pt.isUndefined(e)?pt.isUndefined(t)?void 0:r(void 0,t,0,o):r(t,e,0,o)}function i(t,e){if(!pt.isUndefined(e))return r(void 0,e)}function s(t,e){return pt.isUndefined(e)?pt.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function c(n,o,i){return i in e?r(n,o):i in t?r(void 0,n):void 0}const u={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:c,headers:(t,e,n)=>o(re(t),re(e),0,!0)};return pt.forEach(Object.keys(Object.assign({},t,e)),(function(r){const i=u[r]||o,s=i(t[r],e[r],r);pt.isUndefined(s)&&i!==c||(n[r]=s)})),n}const ie=t=>{const e=oe({},t);let n,{data:r,withXSRFToken:o,xsrfHeaderName:i,xsrfCookieName:s,headers:c,auth:u}=e;if(e.headers=c=Jt.from(c),e.url=At(ne(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),pt.isFormData(r))if(Dt.hasStandardBrowserEnv||Dt.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(!1!==(n=c.getContentType())){const[t,...e]=n?n.split(";").map((t=>t.trim())).filter(Boolean):[];c.setContentType([t||"multipart/form-data",...e].join("; "))}if(Dt.hasStandardBrowserEnv&&(o&&pt.isFunction(o)&&(o=o(e)),o||!1!==o&&te(e.url))){const t=i&&s&&ee.read(s);t&&c.set(i,t)}return e},se="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=ie(t);let o=r.data;const i=Jt.from(r.headers).normalize();let s,c,u,a,l,{responseType:f,onUploadProgress:h,onDownloadProgress:d}=r;function p(){a&&a(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(s),r.signal&&r.signal.removeEventListener("abort",s)}let m=new XMLHttpRequest;function y(){if(!m)return;const r=Jt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Gt((function(t){e(t),p()}),(function(t){n(t),p()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:t,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(n(new mt("Request aborted",mt.ECONNABORTED,t,m)),m=null)},m.onerror=function(){n(new mt("Network Error",mt.ERR_NETWORK,t,m)),m=null},m.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Tt;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new mt(e,o.clarifyTimeoutError?mt.ETIMEDOUT:mt.ECONNABORTED,t,m)),m=null},void 0===o&&i.setContentType(null),"setRequestHeader"in m&&pt.forEach(i.toJSON(),(function(t,e){m.setRequestHeader(e,t)})),pt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),d&&([u,l]=Zt(d,!0),m.addEventListener("progress",u)),h&&m.upload&&([c,a]=Zt(h),m.upload.addEventListener("progress",c),m.upload.addEventListener("loadend",a)),(r.cancelToken||r.signal)&&(s=e=>{m&&(n(!e||e.type?new Xt(null,t,m):e),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(s),r.signal&&(r.signal.aborted?s():r.signal.addEventListener("abort",s)));const w=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);w&&-1===Dt.protocols.indexOf(w)?n(new mt("Unsupported protocol "+w+":",mt.ERR_BAD_REQUEST,t)):m.send(o||null)}))},ce=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const o=function(t){if(!n){n=!0,s();const e=t instanceof Error?t:this.reason;r.abort(e instanceof mt?e:new Xt(e instanceof Error?e.message:e))}};let i=e&&setTimeout((()=>{i=null,o(new mt(`timeout ${e} of ms exceeded`,mt.ETIMEDOUT))}),e);const s=()=>{t&&(i&&clearTimeout(i),i=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:c}=r;return c.unsubscribe=()=>pt.asap(s),c}},ue=function*(t,e){let n=t.byteLength;if(e>n)return void(yield t);let r,o=0;for(;n>o;)r=o+e,yield t.slice(o,r),o=r},ae=(t,e,n,r)=>{const o=async function*(t,e){for await(const n of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}}(t))yield*ue(n,e)}(t,e);let i,s=0,c=t=>{i||(i=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e)return c(),void t.close();let i=r.byteLength;if(n){let t=s+=i;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw c(t),t}},cancel:t=>(c(t),o.return())},{highWaterMark:2})},le="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,fe=le&&"function"==typeof ReadableStream,he=le&&("function"==typeof TextEncoder?(de=new TextEncoder,t=>de.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var de;const pe=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},me=fe&&pe((()=>{let t=!1;const e=new Request(Dt.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),ye=fe&&pe((()=>pt.isReadableStream(new Response("").body))),we={stream:ye&&(t=>t.body)};var be;le&&(be=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!we[t]&&(we[t]=pt.isFunction(be[t])?e=>e[t]():(e,n)=>{throw new mt(`Response type '${t}' is not supported`,mt.ERR_NOT_SUPPORT,n)})})));const ve={http:null,xhr:se,fetch:le&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:i,timeout:s,onDownloadProgress:c,onUploadProgress:u,responseType:a,headers:l,withCredentials:f="same-origin",fetchOptions:h}=ie(t);a=a?(a+"").toLowerCase():"text";let d,p=ce([o,i&&i.toAbortSignal()],s);const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&me&&"get"!==n&&"head"!==n&&0!==(y=await(async(t,e)=>pt.toFiniteNumber(t.getContentLength())??(async t=>{if(null==t)return 0;if(pt.isBlob(t))return t.size;if(pt.isSpecCompliantForm(t)){const e=new Request(Dt.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return pt.isArrayBufferView(t)||pt.isArrayBuffer(t)?t.byteLength:(pt.isURLSearchParams(t)&&(t+=""),pt.isString(t)?(await he(t)).byteLength:void 0)})(e))(l,r))){let t,n=new Request(e,{method:"POST",body:r,duplex:"half"});if(pt.isFormData(r)&&(t=n.headers.get("content-type"))&&l.setContentType(t),n.body){const[t,e]=Yt(y,Zt(Qt(u)));r=ae(n.body,65536,t,e)}}pt.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;d=new Request(e,{...h,signal:p,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:o?f:void 0});let i=await fetch(d,h);const s=ye&&("stream"===a||"response"===a);if(ye&&(c||s&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=i[e]}));const e=pt.toFiniteNumber(i.headers.get("content-length")),[n,r]=c&&Yt(e,Zt(Qt(c),!0))||[];i=new Response(ae(i.body,65536,n,(()=>{r&&r(),m&&m()})),t)}a=a||"text";let w=await we[pt.findKey(we,a)||"text"](i,t);return!s&&m&&m(),await new Promise(((e,n)=>{Gt(e,n,{data:w,headers:Jt.from(i.headers),status:i.status,statusText:i.statusText,config:t,request:d})}))}catch(e){if(m&&m(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new mt("Network Error",mt.ERR_NETWORK,t,d),{cause:e.cause||e});throw mt.from(e,e&&e.code,t,d)}})};pt.forEach(ve,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ge=t=>"- "+t,xe=t=>pt.isFunction(t)||null===t||!1===t,Re=t=>{t=pt.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let i=0;e>i;i++){let e;if(n=t[i],r=n,!xe(n)&&(r=ve[(e=n+"").toLowerCase()],void 0===r))throw new mt(`Unknown adapter '${e}'`);if(r)break;o[e||"#"+i]=r}if(!r){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new mt("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(ge).join("\n"):" "+ge(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Oe(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Xt(null,t)}function Se(t){return Oe(t),t.headers=Jt.from(t.headers),t.data=Kt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),Re(t.adapter||Mt.adapter)(t).then((function(e){return Oe(t),e.data=Kt.call(t,t.transformResponse,e),e.headers=Jt.from(e.headers),e}),(function(e){return Vt(e)||(Oe(t),e&&e.response&&(e.response.data=Kt.call(t,t.transformResponse,e.response),e.response.headers=Jt.from(e.response.headers))),Promise.reject(e)}))}const Ee={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Ee[t]=function(n){return typeof n===t||"a"+(1>e?"n ":" ")+t}}));const je={};Ee.transitional=function(t,e,n){function r(t,e){return"[Axios v1.10.0] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,i)=>{if(!1===t)throw new mt(r(o," has been removed"+(e?" in "+e:"")),mt.ERR_DEPRECATED);return e&&!je[o]&&(je[o]=!0),!t||t(n,o,i)}},Ee.spelling=function(t){return(t,e)=>!0};const Ae={assertOptions:function(t,e,n){if("object"!=typeof t)throw new mt("options must be an object",mt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const i=r[o],s=e[i];if(s){const e=t[i],n=void 0===e||s(e,i,t);if(!0!==n)throw new mt("option "+i+" must be "+n,mt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new mt("Unknown option "+i,mt.ERR_BAD_OPTION)}},validators:Ee},ke=Ae.validators;class Te{constructor(t){this.defaults=t||{},this.interceptors={request:new kt,response:new kt}}async request(t,e){try{return await this.l(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=Error();const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!(t.stack+"").endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}l(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=oe(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&Ae.assertOptions(n,{silentJSONParsing:ke.transitional(ke.boolean),forcedJSONParsing:ke.transitional(ke.boolean),clarifyTimeoutError:ke.transitional(ke.boolean)},!1),null!=r&&(pt.isFunction(r)?e.paramsSerializer={serialize:r}:Ae.assertOptions(r,{encode:ke.function,serialize:ke.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ae.assertOptions(e,{baseUrl:ke.spelling("baseURL"),withXsrfToken:ke.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let i=o&&pt.merge(o.common,o[e.method]);o&&pt.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Jt.concat(i,o);const s=[];let c=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(c=c&&t.synchronous,s.unshift(t.fulfilled,t.rejected))}));const u=[];let a;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let l,f=0;if(!c){const t=[Se.bind(this),void 0];for(t.unshift.apply(t,s),t.push.apply(t,u),l=t.length,a=Promise.resolve(e);l>f;)a=a.then(t[f++],t[f++]);return a}l=s.length;let h=e;for(f=0;l>f;){const e=s[f++],n=s[f++];try{h=e(h)}catch(t){n.call(this,t);break}}try{a=Se(h)}catch(t){return Promise.reject(t)}for(f=0,l=u.length;l>f;)a=a.then(u[f++],u[f++]);return a}getUri(t){return At(ne((t=oe(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}pt.forEach(["delete","get","head","options"],(function(t){Te.prototype[t]=function(e,n){return this.request(oe(n||{},{method:t,url:e,data:(n||{}).data}))}})),pt.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,o){return this.request(oe(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Te.prototype[t]=e(),Te.prototype[t+"Form"]=e(!0)}));const $e=Te;class Ne{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n.h)return;let e=n.h.length;for(;e-- >0;)n.h[e](t);n.h=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new Xt(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this.h?this.h.push(t):this.h=[t]}unsubscribe(t){if(!this.h)return;const e=this.h.indexOf(t);-1!==e&&this.h.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Ne((function(e){t=e})),cancel:t}}}const Ce=Ne,Pe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Pe).forEach((([t,e])=>{Pe[e]=t}));const Le=Pe,Ue=function t(e){const n=new $e(e),r=E($e.prototype.request,n);return pt.extend(r,$e.prototype,n,{allOwnKeys:!0}),pt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(oe(e,n))},r}(Mt);Ue.Axios=$e,Ue.CanceledError=Xt,Ue.CancelToken=Ce,Ue.isCancel=Vt,Ue.VERSION="1.10.0",Ue.toFormData=Rt,Ue.AxiosError=mt,Ue.Cancel=Ue.CanceledError,Ue.all=function(t){return Promise.all(t)},Ue.spread=function(t){return function(e){return t.apply(null,e)}},Ue.isAxiosError=function(t){return pt.isObject(t)&&!0===t.isAxiosError},Ue.mergeConfig=oe,Ue.AxiosHeaders=Jt,Ue.formToJSON=t=>Ft(pt.isHTMLForm(t)?new FormData(t):t),Ue.getAdapter=Re,Ue.HttpStatusCode=Le,Ue.default=Ue;const De=Ue,{Axios:Fe,AxiosError:Ie,CanceledError:Me,isCancel:qe,CancelToken:Be,VERSION:_e,all:ze,Cancel:He,isAxiosError:We,spread:Je,toFormData:Ke,AxiosHeaders:Ve,HttpStatusCode:Xe,formToJSON:Ge,getAdapter:Ze,mergeConfig:Ye}=De;class Qe{shared={locale:"zh-CN",fallback:"en-US"};constructor(t={}){this.shared=t||this.shared,this.messages={},this.p=new Map}setLocale(t){return this.shared.locale===t||(this.shared.locale=t,document.documentElement.lang=t,this.p.clear()),this}getLocale(){return this.shared.locale}load(t,e=!0){return e?Object.keys(t).forEach((e=>{this.messages[e]={...this.messages[e],...t[e]}})):this.messages=t,this}t(t,e={}){const{locale:n=this.shared.locale,fallback:r=this.shared.fallback,count:o,...i}=e,s=void 0===o?i:{...i,count:o};let c=this.messages[n]?.[t]||this.messages[r]?.[t]||t;return void 0!==o&&"object"==typeof c&&(c=0===o&&c.zero?c.zero:1===o&&c.one?c.one:c.other||c.one||t),"string"!=typeof c?t:(Object.keys(s).forEach((t=>{c=c.replace(RegExp(`{{?${t}}}?`,"g"),s[t])})),c)}d(t,e={}){const{locale:n=this.shared.locale,...r}=e,o=`d:${n}:${JSON.stringify(r)}`;this.p.has(o)||this.p.set(o,new Intl.DateTimeFormat(n,{year:"numeric",month:"short",day:"numeric",...r}));const i="string"==typeof t?new Date(t):t;return this.p.get(o).format(i)}n(t,e={}){const{locale:n=this.shared.locale,...r}=e,o=`n:${n}:${JSON.stringify(r)}`;return this.p.has(o)||this.p.set(o,new Intl.NumberFormat(n,{minimumFractionDigits:0,maximumFractionDigits:2,...r})),this.p.get(o).format(t)}c(t,e="CNY",n={}){return this.n(t,{style:"currency",currency:e,...n})}rtf(t,e="day",n={}){const{locale:r=this.shared.locale,...o}=n,i=`rtf:${r}:${JSON.stringify(o)}`;return this.p.has(i)||this.p.set(i,new Intl.RelativeTimeFormat(r,{numeric:"auto",...o})),this.p.get(i).format(t,e)}m(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&["zero","one","other"].some((e=>e in t))}has(t,e=this.shared.locale){const n=this.messages[e]?.[t];return void 0!==n&&(!this.m(n)||void 0!==n.one||void 0!==n.other)}getLocales(){return Object.keys(this.messages)}}const tn="vhtml-message-style";class en{constructor(){this.container=null,this.messageTimers=new WeakMap}ensureReady(){return!("undefined"==typeof document||!document.head||!document.body||(this.ensureStyle(),this.ensureContainer(),0))}ensureStyle(){if(document.getElementById(tn))return;const t=document.createElement("style");t.id=tn,t.textContent="\n .vmsg-container {\n position: fixed;\n top: 60px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 9999;\n width: min(300px, calc(100vw - 32px));\n }\n\n .vmsg-item {\n margin-bottom: 10px;\n padding: 15px;\n border-radius: 4px;\n box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);\n transform: translateY(100%);\n opacity: 0;\n transition: all 0.3s ease;\n display: flex;\n align-items: flex-start;\n }\n\n .vmsg-item.show {\n transform: translateY(0);\n opacity: 1;\n }\n\n .vmsg-icon {\n margin-right: 10px;\n font-size: 16px;\n line-height: 1;\n }\n\n .vmsg-content {\n flex: 1;\n font-size: 14px;\n line-height: 1.4;\n }\n\n .vmsg-close {\n margin-left: 10px;\n cursor: pointer;\n font-size: 16px;\n opacity: 0.7;\n transition: opacity 0.2s;\n }\n\n .vmsg-close:hover {\n opacity: 1;\n }\n\n .vmsg-success {\n background-color: #f0f9eb;\n border: 1px solid #e1f3d8;\n color: var(--color-success, #67c23a);\n }\n\n .vmsg-warning {\n background-color: #fdf6ec;\n border: 1px solid #faecd8;\n color: #e6a23c;\n }\n\n .vmsg-error {\n background-color: #fef0f0;\n border: 1px solid #fde2e2;\n color: #f56c6c;\n }\n\n .vmsg-info {\n background-color: #edf2fc;\n border: 1px solid #ebeef5;\n color: #409eff;\n }\n\n .vmsg-overlay {\n position: fixed;\n inset: 0;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n transition: opacity 0.3s ease;\n }\n\n .vmsg-overlay.show {\n opacity: 1;\n }\n\n .vmsg-dialog {\n background: white;\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n min-width: min(400px, calc(100vw - 32px));\n max-width: min(500px, calc(100vw - 32px));\n transform: scale(0.8);\n transition: transform 0.3s ease;\n }\n\n .vmsg-overlay.show .vmsg-dialog {\n transform: scale(1);\n }\n\n .vmsg-header {\n padding: 20px 20px 10px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #eee;\n }\n\n .vmsg-title {\n font-size: 18px;\n font-weight: 500;\n margin: 0;\n }\n\n .vmsg-close-btn {\n cursor: pointer;\n font-size: 20px;\n color: #999;\n border: none;\n background: none;\n padding: 0;\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .vmsg-close-btn:hover {\n color: #666;\n }\n\n .vmsg-body {\n padding: 20px;\n }\n\n .vmsg-prompt-content {\n margin-bottom: 20px;\n font-size: 14px;\n line-height: 1.5;\n color: #333;\n }\n\n .vmsg-input {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid #dcdfe6;\n border-radius: 4px;\n font-size: 14px;\n box-sizing: border-box;\n transition: border-color 0.2s;\n }\n\n .vmsg-input:focus {\n outline: none;\n border-color: #409eff;\n }\n\n .vmsg-footer {\n padding: 15px 20px;\n text-align: right;\n border-top: 1px solid #eee;\n }\n\n .vmsg-btn {\n padding: 8px 16px;\n border: 1px solid #dcdfe6;\n border-radius: 4px;\n font-size: 14px;\n cursor: pointer;\n margin-left: 10px;\n transition: all 0.2s;\n }\n\n .vmsg-btn-cancel {\n background: white;\n color: #606266;\n }\n\n .vmsg-btn-cancel:hover {\n background: #f5f7fa;\n border-color: #c0c4cc;\n }\n\n .vmsg-btn-confirm {\n background: #409eff;\n color: white;\n border-color: #409eff;\n }\n\n .vmsg-btn-confirm:hover {\n background: #66b1ff;\n border-color: #66b1ff;\n }\n",document.head.appendChild(t)}ensureContainer(){return this.container?.isConnected||(this.container=document.createElement("div"),this.container.className="vmsg-container",document.body.appendChild(this.container)),this.container}queue(t){if(this.ensureReady())return t();const e=()=>{window.removeEventListener("DOMContentLoaded",e),t()};return window.addEventListener("DOMContentLoaded",e,{once:!0}),null}schedule(t,e){return window.setTimeout(t,e)}trackTimers(t,e){t&&0!==e.length&&this.messageTimers.set(t,e)}clearTimers(t){const e=this.messageTimers.get(t);e&&(e.forEach((t=>window.clearTimeout(t))),this.messageTimers.delete(t))}}const nn=new class{constructor(t=new en){this.runtime=t}createMessage(t,e,n={}){return this.runtime.queue((()=>{const{duration:r=3e3,showClose:o=!0,onClose:i=null}=n,s=this.runtime.ensureContainer(),c=document.createElement("div");c.className="vmsg-item vmsg-"+t;const u={success:"\u2713",warning:"\u26a0",error:"\u2715",info:"\u2139"},a=document.createElement("span");a.className="vmsg-icon",a.textContent=u[t]||u.info;const l=document.createElement("div");l.className="vmsg-content",l.textContent=e,c.appendChild(a),c.appendChild(l);let f=!1;const h=()=>{f||(f=!0,this.removeMessage(c),"function"==typeof i&&i())};if(o){const t=document.createElement("span");t.className="vmsg-close",t.innerHTML="×",t.addEventListener("click",h),c.appendChild(t)}s.appendChild(c);const d=[this.runtime.schedule((()=>{c.classList.add("show")}),10)];return r>0&&d.push(this.runtime.schedule(h,r)),this.runtime.trackTimers(c,d),c}))}removeMessage(t){if(!t||!t.parentNode)return;this.runtime.clearTimers(t),t.classList.remove("show");const e=this.runtime.schedule((()=>{t.parentNode&&t.parentNode.removeChild(t)}),300);this.runtime.trackTimers(t,[e])}success(t,e={}){return this.createMessage("success",t,e)}warning(t,e={}){return this.createMessage("warning",t,e)}error(t,e={}){return this.createMessage("error",t,e)}info(t,e={}){return this.createMessage("info",t,e)}v(t,e={}){return new Promise(((n,r)=>{this.runtime.queue((()=>{const{title:o="\u63d0\u793a",type:i="confirm",inputValue:s="",confirmText:c="\u786e\u5b9a",cancelText:u="\u53d6\u6d88",onConfirm:a=null,onCancel:l=null}=e,f=document.createElement("div");f.className="vmsg-overlay";const h=document.createElement("div");h.className="vmsg-dialog";const d=document.createElement("div");d.className="vmsg-header";const p=document.createElement("h3");p.className="vmsg-title",p.textContent=o;const m=document.createElement("button");m.className="vmsg-close-btn",m.innerHTML="×",d.appendChild(p),d.appendChild(m);const y=document.createElement("div");y.className="vmsg-body";const w=document.createElement("div");w.className="vmsg-prompt-content",w.textContent=t,y.appendChild(w);let b=null;"input"===i&&(b=document.createElement("input"),b.className="vmsg-input",b.type="text",b.value=s,y.appendChild(b));const v=document.createElement("div");v.className="vmsg-footer";const g=document.createElement("button");g.className="vmsg-btn vmsg-btn-cancel",g.textContent=u;const x=document.createElement("button");x.className="vmsg-btn vmsg-btn-confirm",x.textContent=c,v.appendChild(g),v.appendChild(x),h.appendChild(d),h.appendChild(y),h.appendChild(v),f.appendChild(h),document.body.appendChild(f);const R=[];let O=!1;const S=t=>{O||(O=!0,f.classList.remove("show"),R.splice(0).forEach((t=>t())),window.setTimeout((()=>{f.remove(),t()}),300))},E=()=>{S((()=>{"function"==typeof l&&l(),r(Error("cancelled"))}))},j=t=>{"Escape"===t.key&&E()};document.addEventListener("keydown",j),R.push((()=>document.removeEventListener("keydown",j))),m.addEventListener("click",E),g.addEventListener("click",E),x.addEventListener("click",(()=>{const t=!b||b.value;S((()=>{n(t),"function"==typeof a&&a(t)}))})),f.addEventListener("click",(t=>{t.target===f&&E()}));const A=this.runtime.schedule((()=>{f.classList.add("show")}),10);if(R.push((()=>window.clearTimeout(A))),b){const t=this.runtime.schedule((()=>{b.focus(),b.select()}),300);R.push((()=>window.clearTimeout(t)))}}))}))}confirm(t,e={}){return this.v(t,{...e,type:"confirm"})}prompt(t,e,n={}){return this.v(t,{...n,type:"input",inputValue:e})}};function rn(t=null){const e=function(t=null){return t&&"object"==typeof t?t.$mod||t:null}(t);return e?.scoped||""}function on(t=null,e={}){const n=Object.create(t||null);return{}.hasOwnProperty.call(n,"$message")||(n.$message=nn),e&&"object"==typeof e&&Object.assign(n,e),n}function sn(t=null,e={}){const n=e&&"object"==typeof e?{...e}:{};return O.Wrap(n,t||void 0)}function cn(t){return De.create({baseURL:t})}const un=new Set(["scoped","baseURL","origin","$axios","$bus","$i18n","$t"]);function an(t){return t&&"/"!==t?t.endsWith("/")?t.slice(0,-1):t:t||""}function ln(t=""){if(!t)return"";if(/^https?:\/\//.test(t)){const e=new URL(t),n=an(e.pathname);return`${e.origin}${"/"===n?"":n}`}const e=an(t);return e?e.startsWith("/")?e:"/"+e:""}function fn(t="",e=""){if(!t)return t;if(t.startsWith("@"))return t.slice(1);if(/^https?:\/\//.test(t))return t;if(!t.startsWith("/"))return t;const n=ln(e);return n?`${n}${t}`:t}function hn(t=""){const e=ln(t);return e?/^https?:\/\//.test(e)?e:`${window.location.origin}${e}`:window.location.origin}function dn(t=null,e=null,n={},r={}){return function(t=null,e=null,n={},r={}){const o=t?.$sys||null,i=t?.$ctx||null;return{$sys:on(o,n),$ctx:sn(i,r),$mod:e||t?.$mod||null}}(t,e,n,r)}const pn=new class{constructor(){this.modMap=new Map,this.wrappers=[],this.sharedLocale=O.Wrap({locale:localStorage.getItem("i18n_locale")||"zh-CN",fallback:"en-US"}),this.initLocaleWatcher()}initLocaleWatcher(){O.Watch((()=>this.sharedLocale.locale),(t=>{localStorage.setItem("i18n_locale",t),document.documentElement.lang=t}))}addWrapper(t){if("function"==typeof t){this.wrappers.push(t);for(const[e,n]of this.modMap.entries())t(e,n)}}clear(){this.modMap.clear(),this.wrappers=[]}async getModule(t=""){const e=ln(t||"");let n=this.modMap.get(e);return n||(n=await this.createModule(e),this.modMap.set(e,n)),n}patchModule(t,e={}){return function(t,e={}){e&&"object"==typeof e&&Object.entries(e).forEach((([e,n])=>{un.has(e)||(t[e]=n)}))}(t,e),t}async createModule(t,e={}){const n=hn(t),r=function(t,e,n,r={}){const o={...r,scoped:t,baseURL:e,origin:window.location.origin,$bus:new S,$i18n:new Qe(n)};return o.$t=(t,e={})=>o.$i18n.t(t,e),o}(t,n,this.sharedLocale,{$axios:cn(n)});this.patchModule(r,e),await this.loadEnvConfig(r);for(const o of this.wrappers)o(t,r);return r}async loadEnvConfig(t){const e=hn(t.scoped)+"/env.js";try{const n=await import(e);"function"==typeof n.default&&await n.default(t,this)}catch(n){}}};function mn(t,e=""){return t&&"/"!==t?t.startsWith("@")?t.slice(1):/^https?:\/\//.test(t)?t:t.startsWith("/")?fn(t,e):fn("/"+t,e):fn("/",e)}class yn{constructor(){this.templates=new Map,this.pending=new Map}clear(){this.templates.clear(),this.pending.clear()}}class wn{constructor(){this.loadedLinks=new Set,this.loadedScripts=new Set,this.loadedStyles=new Set}resolveUrl(t,e){return mn(t,e)}loadLink(t,e){const n=this.resolveUrl(t.getAttribute("href"),rn(e)),r=t.getAttribute("key")||n;if(!r||this.loadedLinks.has(r))return;this.loadedLinks.add(r);const o=t.cloneNode(!0);o.setAttribute("href",n),document.head.appendChild(o)}async loadScript(t,e){const n=this.resolveUrl(t.getAttribute("src"),rn(e)),r=t.getAttribute("key"),o=r||n;if(!o||this.loadedScripts.has(o))return;this.loadedScripts.add(o);const i=document.createElement("script");n&&(i.src=n),r&&i.setAttribute("key",r),i.type=t.getAttribute("type")||"text/javascript",await new Promise(((t,e)=>{i.onload=()=>t(i),i.onerror=()=>e(Error("Failed to load script "+n)),document.head.appendChild(i)}))}loadStyle(t,e){if(!t)return;const n=`${e}::${t}`;if(this.loadedStyles.has(n))return;this.loadedStyles.add(n);const r=document.createElement("style");r.innerHTML=t,r.setAttribute("vref",e),document.head.appendChild(r)}async loadHeads(t,e,n){for(const r of t){const t=r.nodeName.toLowerCase();"link"===t?this.loadLink(r,e):"script"===t?await this.loadScript(r,e):"title"===t&&(n.title=r.innerText)}}}class bn{constructor(t){this.resourceLoader=t}createDescriptor(t,e,n,r,o){return{url:n,scoped:r,mod:e,heads:Array.from(o.querySelector("head")?.children||[]),body:document.createElement("div"),setup:void 0,scripts:[],styles:"",title:"",txt:t,tmp:o,customAttrs:{},err:null}}processStyles(e){e.tmp.querySelectorAll("style").forEach((n=>{null===n.getAttribute("unscoped")?e.styles+=t.parse(n.innerHTML,e.url):e.styles+=n.innerHTML})),this.resourceLoader.loadStyle(e.styles,e.url)}processBody(t){const e=t.tmp.querySelector("body");e&&(t.body.append(...e.childNodes),Array.from(e.attributes).forEach((e=>{/^[a-zA-Z]/.test(e.name)?t.body.setAttribute(e.name,e.value):t.customAttrs[e.name]=e.value})),t.body.setAttribute("vref",t.url))}processScripts(t){t.body.querySelectorAll("script").forEach((e=>{e.innerHTML.trim()?(e.hasAttribute("setup")?t.setup=e:e.hasAttribute("no-vhtml")||t.scripts.push(e),e.remove()):e.remove()}))}syncRefOwnerId(t,e){Array.from(t.childNodes).forEach((t=>{1===t.nodeType&&(t.setAttribute("vrefof",e),this.syncRefOwnerId(t,e))}))}async parse(t,e,n,r=!1){const o=(new DOMParser).parseFromString(t,"text/html");if(o.body.hasAttribute("scoped")&&!r)throw Error("HTTP error! status: 404");const i=this.createDescriptor(t,e,n,rn(e),o);return this.processStyles(i),this.processBody(i),this.processScripts(i),this.syncRefOwnerId(i.body,n),r||await this.resourceLoader.loadHeads(i.heads,e,i),i}create404Descriptor(t,e,n){const r=document.createElement("div");return r.style.cssText="background:#aaa;height:100%;width:100%;display:grid;place-items:center;",r.innerHTML=`<div style="width:20rem;height:15rem;border-radius:1rem;padding:1rem;background:#cfc0aa;display:grid;place-items:center;"><div style="font-size:2rem">404</div><p>${t}</p></div>`,{url:t,scoped:rn(e),mod:e,heads:[],body:r,setup:void 0,scripts:[],styles:"",title:"",txt:"",tmp:null,customAttrs:{},err:n}}}const vn=new class{constructor(t=pn){this.moduleManager=t,this.cache=new yn,this.resourceLoader=new wn,this.parser=new bn(this.resourceLoader)}clear(){this.cache.clear(),this.moduleManager.clear()}addWrapper(t){this.moduleManager.addWrapper(t)}async getModule(t){return this.moduleManager.getModule(t)}readScopedHeaders(t){const e={};for(const[n,r]of t.headers.entries())n.startsWith("vhtml-")&&(e[n.slice(6)]=r);return e}async fetchFile(t){const e=await fetch(t);if(!e.ok)throw Error("HTTP error! status: "+e.status);return e.text()}async parseUI(t,e,n,r=!1){const o=n?.endsWith(".html")?n.slice(0,-5):n||"#inline",i=await this.moduleManager.getModule("");return this.parser.parse(t,i,o,r)}async fetchUI(t,e={},n=!1){const r=mn(t,rn(e));if(this.cache.templates.has(r))return this.cache.templates.get(r);if(this.cache.pending.has(r))return this.cache.pending.get(r);const o=this.doFetchUI(r,e,n);return this.cache.pending.set(r,o),o.finally((()=>{this.cache.pending.delete(r)}))}async doFetchUI(t,e={},n=!1){e=e||{};try{const e=await fetch(t);if(!e.ok)throw Error("HTTP error! status: "+e.status);const r=this.readScopedHeaders(e),o=ln(r.scoped||""),i=await this.moduleManager.getModule(o);this.moduleManager.patchModule(i,r);const s=await e.text(),c=t.endsWith(".html")?t.slice(0,-5):t,u=await this.parser.parse(s,i,c,n);return this.cache.templates.set(t,u),u}catch(r){const e=await this.moduleManager.getModule(""),n=this.parser.create404Descriptor(t,e,r);return this.cache.templates.set(t,n),n}}},gn={FetchUI:(t,e,n)=>vn.fetchUI(t,e,n),FetchFile:t=>vn.fetchFile(t),LoadScript:(t,e)=>vn.resourceLoader.loadScript(t,e),LoadLink:(t,e)=>vn.resourceLoader.loadLink(t,e),ParseUI:(t,e,n,r)=>vn.parseUI(t,e,n,r),getInstance:()=>vn,clearCache:()=>vn.clear(),addWrapper:t=>vn.addWrapper(t)};class xn{constructor(t,e="component"){this.host=t,this.kind=e,this.parent=null,this.children=new Set,this.vsrc="",this.data=null,this.runtime=null,this.ctx=null,this.mod=null,this.sys=null,this.router=null,this.route=null,this.cacheKey=null,this.scope=null,this.slots=null,this.slotOutletState=null,this.sourceNodes=null,this.vforData=null,this.events=null,this.parsed=!1,this.meta=null}}function Rn(t,e=null,n="component"){return function(t,e){return e?(e.parent&&e.parent!==t&&e.parent.children.delete(e),e.parent=t||null,t&&t.children.add(e),e):e}(e,new xn(t,n))}function On(t){t&&(t.parent&&(t.parent.children.delete(t),t.parent=null),t.children.forEach((t=>{t.parent=null})),t.children.clear())}class Sn{#t=new Set;#e=!1;#n=null;#r=null;onChange(t){return this.#t.add(t),()=>{this.#t.delete(t)}}notify(t){for(const e of this.#t)e(t)}init(){this.#e||(this.#e=!0,this.#n=t=>{const e=t.target.closest("a");if(!e)return;const n=e.getAttribute("href");!n||n.startsWith("http")||n.startsWith("#")||(t.preventDefault(),e.hasAttribute("reload")?window.location.href=n:this.push(n))},this.#r=()=>{this.notify({type:"popstate",url:window.location.href})},document.body.addEventListener("click",this.#n,!0),window.addEventListener("popstate",this.#r))}push(t){this.notify({type:"push",to:t})}replace(t){this.notify({type:"replace",to:t})}go(t){history.go(t)}back(){history.back()}forward(){history.forward()}}function En(t,e){let n,r="";if(t.startsWith("http://")||t.startsWith("https://")){if(n=new URL(t),n.origin!==window.location.origin)return null;r=n.pathname}else n=new URL(t,window.location.href),r=n.pathname;e&&r.startsWith(e)&&(r=r.slice(e.length)||"/");const o={};return n.searchParams.forEach(((t,e)=>{o[e]=t})),{path:r,query:o,hash:n.hash}}class jn{constructor(t,e){this.originalPath=t,this.name=e,this.keys=[],this.regexp=this.pathToRegexp(t)}pathToRegexp(t){let e=t.replace(/\/:([^(/?]+)\?/g,((t,e)=>(this.keys.push(e),`(?:/(?<${e}>[^/]+))?`)));return e=e.replace(/:([^(/?]+)/g,((t,e)=>(this.keys.push(e),`(?<${e}>[^/]+)`))),e=e.replace(/\*(\w+)/g,((t,e)=>(this.keys.push(e),`(?<${e}>.*)`))),e=e.replace(/\*/g,".*"),RegExp(`^${e}$`)}match(t){let e;if("string"==typeof t)e=t;else{if(!t?.path)return t?.name===this.name?{path:this.originalPath,params:t.params||{},matched:this.originalPath}:null;e=t.path}const n=this.regexp.exec(e);if(!n)return null;const r={};return this.keys.forEach((t=>{void 0!==n.groups?.[t]&&(r[t]=n.groups[t])})),{path:this.originalPath,params:r,matched:n[0]}}}function An(t){return Array.isArray(t)?{routes:t,beforeEnter:null,afterEnter:null}:Array.isArray(t?.routes)?{routes:t.routes,beforeEnter:t.beforeEnter||null,afterEnter:t.afterEnter||null}:{routes:[],beforeEnter:t?.beforeEnter||null,afterEnter:t?.afterEnter||null}}const kn=new WeakMap,Tn=new WeakSet;function $n(t,e=!1){if(!t)return null;let n=kn.get(t);return!n&&e&&(n={},kn.set(t,n)),n}function Nn(t,e){const n=$n(t);n&&(delete n[e],0===Object.keys(n).length&&kn.delete(t))}function Cn(t,e,n=null){return $n(t)?.[e]??n}function Pn(t,e,n){return null==n?(Nn(t,e),n):($n(t,!0)[e]=n,n)}function Ln(t){t&&!Tn.has(t)&&(Object.defineProperties(t,{$data:{configurable:!0,enumerable:!1,get:()=>Wn(t)},$sys:{configurable:!0,enumerable:!1,get:()=>function(t){return Un(t)?.sys??Cn(t,"sys")}(t)},$ctx:{configurable:!0,enumerable:!1,get:()=>function(t){return Un(t)?.ctx??Cn(t,"ctx")}(t)},$mod:{configurable:!0,enumerable:!1,get:()=>function(t){return Un(t)?.mod??Cn(t,"mod")}(t)},$router:{configurable:!0,enumerable:!1,get:()=>_n(t)}}),Tn.add(t))}function Un(t){return Cn(t,"instance")}function Dn(t,e){return Ln(t),Pn(t,"instance",e)}function Fn(t,e=null){let n=t;for(;n;){const t=Un(n);if(t)return t;n=n.parentNode||n.host||null}return e}function In(t){return Un(t)?.scope??Cn(t,"scope")}function Mn(t,e){const n=Un(t);return n&&(n.scope=e||null),Pn(t,"scope",e)}function qn(t){return Un(t)?.runtime??Cn(t,"runtime")}function Bn(t,e){Ln(t);const n=Un(t);return n&&(n.runtime=e||null,n.sys=e?.$sys||null,n.ctx=e?.$ctx||null,n.mod=e?.$mod||null),Pn(t,"sys",e?.$sys||null),Pn(t,"ctx",e?.$ctx||null),Pn(t,"mod",e?.$mod||null),Pn(t,"runtime",e)}function _n(t){return Un(t)?.router??Cn(t,"router")}function zn(t,e){Ln(t);const n=Un(t);return n&&(n.router=e||null),Pn(t,"router",e)}function Hn(t,e=null){let n=t;for(;n;){const t=_n(n);if(t)return t;n=n.parentNode||n.host||null}return e}function Wn(t){return Un(t)?.data??Cn(t,"data")}function Jn(t,e){Ln(t);const n=Un(t);return n&&(n.data=e||null),Pn(t,"data",e)}function Kn(t){return Un(t)?.sourceNodes??Cn(t,"sourceNodes")}function Vn(t,e){const n=Un(t);return n&&(n.sourceNodes=e||null),Pn(t,"sourceNodes",e)}function Xn(t,e){const n=Un(t);return n&&(n.vforData=e||null),Pn(t,"vforData",e)}function Gn(t){const e=Un(t);return!!(e?.parsed??Cn(t,"parsed",!1))}function Zn(t,e=!0){const n=Un(t);return n&&(n.parsed=e),$n(t,!0).parsed=e,e}function Yn(t,e=!0){if(!t)return;const n=Kn(t),r=Un(t);kn.delete(t),r&&(On(r),Dn(t,null)),e&&void 0!==n&&Vn(t,n)}function Qn(t){t&&(Array.from(t.children).forEach((t=>{Qn(t)})),t.scope?.dispose(t.host),Yn(t.host))}function tr(t){if(!t||1!==t.nodeType)return;const e=Un(t);e?Qn(e):(In(t)?.dispose(t),Yn(t),t.childNodes?.forEach((t=>{1===t.nodeType&&tr(t)})))}function er(t,e){if(!t||"string"!=typeof e)return;const n=Fn(t,null);if(n){const t=new Set,r=n=>{if(!n||t.has(n))return;t.add(n);const o=n.scope;o&&"function"==typeof o[e]&&o[e](n.host),n.children.forEach((t=>{r(t)}))};return void r(n)}const r=In(t);r&&"function"==typeof r[e]&&r[e](t)}class nr{constructor(t,e,n,r,o){this.ownerView=t,this.vhtml=e,this.node=n,this.instance=Rn(n,t.instance,"page"),this.instance.meta={htmlPath:this.resolveHtmlPath(r),title:"",titleWatchers:[],didInitialActivation:!1,layoutOutlet:null},this.instance.route=r,this.instance.cacheKey=o,this.layoutInstance=null}get meta(){return this.instance.meta}get matchedRoute(){return this.instance.route}set matchedRoute(t){this.instance.route=t||null}get cacheKey(){return this.instance.cacheKey}get htmlPath(){return this.meta.htmlPath}get dom(){return this.instance.host}set dom(t){this.instance.host=t||null}get layoutDom(){return this.layoutInstance?.host||null}set layoutDom(t){t?this.layoutInstance?this.layoutInstance.host=t:this.layoutInstance=Rn(t,this.instance,"layout"):this.layoutInstance&&(this.layoutInstance.host=null)}resolveHtmlPath(t){let e=t.route.component||t.route.path;return"function"==typeof e&&(e=e(t.path)),Object.entries(t.params).forEach((([t,n])=>{e=e.replace(":"+t,n)})),e.startsWith("/")||(e="/"+e),e.endsWith("/")&&(e=e.slice(0,-1)),e.endsWith(".html")||(e+=".html"),e}updateRouter(t){this.matchedRoute=t;const e=this.runtime()?.$sys?.$router;e&&Object.assign(e.current,{path:t.path,fullPath:t.fullPath,params:t.params,query:t.query,hash:new URL(t.fullPath,window.location.origin).hash,meta:t.route?.meta||{},name:t.route?.name})}roots(){return this.layoutInstance?.host?[this.layoutInstance.host]:this.instance.host?[this.instance.host]:[]}runtime(){return this.instance.runtime||this.layoutInstance?.runtime||qn(this.dom)||qn(this.layoutDom)||null}outlet(){return this.layoutDom?(this.meta.layoutOutlet=this.meta.layoutOutlet||this.layoutDom.querySelector("[data-vrouter-outlet]")||this.layoutDom,this.meta.layoutOutlet):this.node}attach(){if(this.layoutDom){this.layoutDom.isConnected||(this.node.innerHTML="",this.node.append(this.layoutDom));const t=this.outlet();return this.dom&&this.dom.parentNode!==t&&(t.innerHTML="",t.append(this.dom)),this.layoutInstance.host=this.layoutDom,this.layoutInstance.runtime=qn(this.layoutDom)||this.runtime(),this.instance.host=this.dom,void(this.instance.runtime=qn(this.dom)||this.layoutInstance.runtime)}this.dom&&!this.dom.isConnected&&(this.node.innerHTML="",this.node.append(this.dom)),this.instance.host=this.dom,this.instance.runtime=qn(this.dom)||this.ownerView.instance.runtime}async mount(t,e){const n=await gn.FetchUI(this.htmlPath,t);if(n.err)throw Error(`load page failed: ${this.htmlPath} ${n.err}`);if(this.meta.title=n.title||"",this.dom=document.createElement("div"),this.dom.setAttribute("vsrc",this.htmlPath),this.dom.setAttribute("data-vrouter-cache",""),!e)return this.node.innerHTML="",this.node.append(this.dom),await this.vhtml.parseRef(this.htmlPath,this.dom,{},t,null),this.instance.host=this.dom,this.instance.runtime=qn(this.dom)||t||null,void this.activate();let r=e;r.startsWith("/")||(r="/"+r),r.endsWith(".html")||(r+=".html"),r.startsWith("/layout")||(r="/layout"+r);const o=await gn.FetchUI(r,t);if(o.err)throw Error(`load layout failed: ${r} ${o.err}`);this.layoutDom=function(t){if(!t)return null;const e=t.querySelector("vslot:not([name])")||t.querySelector("vslot");return e?(e.setAttribute("data-vrouter-outlet",""),e.setAttribute("data-vrouter-managed",""),t):t}(o.body.cloneNode(!0)),this.layoutDom?.setAttribute("data-vrouter-layout",""),this.node.innerHTML="",this.node.append(this.layoutDom),await this.vhtml.parseRef("/layout/"+e,this.layoutDom,{},t,null,!0);const i=qn(this.layoutDom)||t||null;this.layoutInstance.runtime=i,this.outlet().innerHTML="",this.outlet().append(this.dom),await this.vhtml.parseRef(this.htmlPath,this.dom,{},i,null),this.instance.host=this.dom,this.instance.runtime=qn(this.dom)||this.layoutInstance.runtime,this.activate()}updateTitle(){if(this.clearTitleWatchers(),!this.meta.title)return;const t=this.meta.title.trim();if(!t.includes("{{"))return void(document.title=t);if(!this.dom&&!this.layoutDom)return;const e=this.runtime()||{},n=/{{|}}/g;let r,o=0,i=-1;const s=[];for(;null!==(r=n.exec(t));)if("{{"===r[0])i=r.index;else if(i>=0){o!==i&&s.push(t.slice(o,i)),s.push("");const n=t.slice(i+2,r.index),c=s.length-1;o=r.index+2,i=-1;const u=O.Watch((()=>{let t=O.Run(n,{},e||{});"function"==typeof t?t=t():"object"==typeof t&&t&&(t=JSON.stringify(t)),s[c]=t,document.title=s.join("")}));this.meta.titleWatchers.push(u)}s.push(t.slice(o)),document.title=s.join("")}clearTitleWatchers(){for(;this.meta.titleWatchers.length>0;)O.Cancel(this.meta.titleWatchers.pop())}activate(){this.updateTitle(),this.attach(),this.meta.didInitialActivation?this.roots().forEach((t=>er(t,"activate"))):this.meta.didInitialActivation=!0}deactive(){this.clearTitleWatchers(),this.meta.didInitialActivation&&this.roots().forEach((t=>er(t,"deactive")))}destroy(){this.clearTitleWatchers(),On(this.layoutInstance),On(this.instance),this.layoutInstance=null}}class rr{#o=[];#i=[];#s=new Map;#c=null;constructor(t){this.#c=t,this.instance=Rn(null,null,"router-view"),this.instance.data=O.Wrap({}),this.instance.route=this.instance.data,this.instance.meta={history:[],pageCache:new Map,routesSource:"/routes.js",beforeEnter:null,afterEnter:null,listeners:new Set,hostNode:null,renderer:null,disposeNavListener:null}}get routes(){return[...this.#o,...this.#i]}get history(){return this.instance.meta.history.slice()}get current(){return this.instance.data}get query(){return this.instance.data?.query||{}}get params(){return this.instance.data?.params||{}}get modulePath(){return rn(this.instance.runtime)}get routesSource(){return this.instance.meta.routesSource}get runtime(){return this.instance.runtime}get activePage(){return this.instance.currentPage||null}set activePage(t){this.instance.currentPage=t||null}get beforeEnter(){return this.instance.meta.beforeEnter}set beforeEnter(t){this.instance.meta.beforeEnter="function"==typeof t?t:null}get afterEnter(){return this.instance.meta.afterEnter}set afterEnter(t){this.instance.meta.afterEnter="function"==typeof t?t:null}get pageCache(){return this.instance.meta.pageCache}get listeners(){return this.instance.meta.listeners}get hostNode(){return this.instance.meta.hostNode}set hostNode(t){this.instance.meta.hostNode=t||null}get renderer(){return this.instance.meta.renderer}set renderer(t){this.instance.meta.renderer=t||null}get disposeNavListener(){return this.instance.meta.disposeNavListener||null}set disposeNavListener(t){this.instance.meta.disposeNavListener=t||null}onChange(t){return this.listeners.add(t),()=>{this.listeners.delete(t)}}#u(t,e){for(const n of this.listeners)n(t,e)}#a(t){return{path:t.path,fullPath:t.fullPath,params:{...t.params||{}},query:{...t.query||{}},hash:t.hash||"",meta:{...t.meta||{}},description:t.description||"",layout:t.layout||"",name:t.name,matched:[...t.matched||[]]}}#l(t,e="push"){const n=this.#a(this.current),r=this.#a({path:t.path,fullPath:t.fullPath,params:t.params||{},query:t.query||{},hash:new URL(t.fullPath,window.location.origin).hash,meta:t.route?.meta||{},description:t.route?.description||"",layout:t.route?.layout||"",name:t.route?.name,matched:t.route?[t.route]:[]});Object.assign(this.current,r),"replace"===e&&this.instance.meta.history.length>0?this.instance.meta.history[this.instance.meta.history.length-1]=r:this.instance.meta.history.push(r);const o=this.modulePath&&!t.fullPath.startsWith("http")?`${this.modulePath}${t.fullPath}`:t.fullPath;"replace"===e?history.replaceState({},"",o):history.pushState({},"",o),this.#u(this.current,n)}#f(t){return/[:*?()[\]{}^$+.]/.test(t)}addRoute(t){if(!t.path)throw Error("Route must have a path");"/"!==t.path&&t.path.endsWith("/")&&(t.path=t.path.slice(0,-1));const e={path:t.path,component:t.component,redirect:t.redirect,name:t.name,meta:t.meta||{},children:t.children||[],matcher:new jn(t.path,t.name),description:t.description||"",layout:t.layout||"",cacheKey:t.cacheKey};this.#f(t.path)?this.#i.push(e):this.#o.push(e),t.name&&this.#s.set(t.name,e),t.children?.length>0&&t.children.forEach((n=>{const r=t.path+(n.path.startsWith("/")?n.path:"/"+n.path),o=n.layout||t.layout||"",i={...t.meta,...n.meta};this.addRoute({...n,path:r,parent:e,layout:o,meta:i})}))}addRoutes(t){t.forEach((t=>this.addRoute(t)))}resetRoutes(){this.activePage?.deactive(),this.pageCache.forEach((t=>{t.destroy()})),this.#o=[],this.#i=[],this.#s=new Map,this.instance.meta.history=[],this.instance.meta.pageCache=new Map,this.activePage=null}normalizeRouteTarget(t){let e,n,r={},o={},i="";if("string"==typeof t){const n=En(t,this.modulePath);if(!n)return null;e=n.path,r={...n.query},i=n.hash}else{if(!t||"object"!=typeof t)return null;if(t.path){const n=En(t.path,this.modulePath);if(!n)return null;e=n.path,r={...n.query,...t.query||{}},i=t.hash||n.hash,o=t.params||{}}else{if(!t.name)return null;n=t.name,r=t.query||{},o=t.params||{},i=t.hash||""}}return e&&!e.startsWith("/")&&(e="/"+e),this.modulePath&&e?.startsWith(this.modulePath)&&(e=e.slice(this.modulePath.length)||"/"),e&&!e.startsWith("/")&&(e="/"+e),"/"!==e&&e?.endsWith("/")&&(e=e.slice(0,-1)),{path:e,query:r,params:o,hash:i,name:n}}matchRoute(t){const e=this.normalizeRouteTarget(t);if(!e)return null;const{path:n,query:r,params:o,name:i}=e;if(i){const t=this.#s.get(i);if(!t)return null;let e=t.path;Object.entries(o).forEach((([t,n])=>{e=e.replace(":"+t,n)}));const n=t.matcher.match(e);return n?{route:t,params:{...n.params,...o},matched:n.matched,path:e,query:r,name:i}:null}for(const s of this.#o)if(s.path===n&&(s.component||s.redirect))return{route:s,params:{...o},matched:n,path:n,query:r,name:s.name};for(const s of this.#i){const t=s.matcher.match(n);if(t&&(s.component||s.redirect))return{route:s,params:{...t.params,...o},matched:t.matched,path:n,query:r,name:s.name}}return null}matchTo(t){const e=this.matchRoute(t);if(!e)return null;const{route:n,params:r,query:o,path:i,name:s}=e;let c="";o&&Object.keys(o).length>0&&(c="?"+Object.entries(o).map((([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&"));const u=`${i||e.path}${c}`;return{route:n,params:r,query:o,name:s||n.name,path:i||e.path,fullPath:u,matched:[n]}}resolveCacheKey(t,e){const n=t.cacheKey;return!1===n?null:void 0===n||!0===n?e.fullPath:"string"==typeof n?n:"function"==typeof n?n(e):e.fullPath}async#h(t,e="push"){if(!t)return;const{route:n,params:r,query:o}=t;if(n.redirect){const e="function"==typeof n.redirect?n.redirect(t):n.redirect;return void this.push(e)}if(this.activePage&&this.current?.fullPath===t.fullPath)return;const i={path:t.path,fullPath:t.fullPath,params:r,query:o,hash:new URL(t.fullPath,window.location.origin).hash,meta:n.meta,description:n.description,layout:n.layout,name:n.name,matched:[n]};if(this.beforeEnter){let t=!0;if(!1===await this.beforeEnter(i,this.current,(e=>{e&&(t=!1,this.push(e))}))||!t)return}const s=this.resolveCacheKey(n,t);if(this.activePage?.deactive(),this.#l(t,e),s&&this.pageCache.has(s)){const e=this.pageCache.get(s);return e.matchedRoute.fullPath!==t.fullPath&&e.updateRouter(t),e.activate(),this.activePage=e,void("function"==typeof this.afterEnter&&this.afterEnter(i,this.current))}const c=new nr(this,this.renderer,this.hostNode,t,s);s&&this.pageCache.set(s,c),await c.mount(this.runtime,i.layout),this.activePage=c,"function"==typeof this.afterEnter&&this.afterEnter(i,this.current)}async push(t){this.#c.push(t)}replace(t){this.#c.replace(t)}go(t){this.#c.go(t)}back(){this.#c.back()}forward(){this.#c.forward()}resolveRoutesUrl(t=this.routesSource,e=this.runtime||{}){const n=t||"/routes.js";return/^https?:\/\//.test(n)?n:n.startsWith("/")?fn(n,rn(e)):fn("/"+n.replace(/^\.?\//,""),rn(e))}async loadRoutes(){const t=this.resolveRoutesUrl(this.routesSource,this.runtime||{});return async function(t,e={}){let n=t;if("function"==typeof n?.default)n=await n.default(e);else if("function"==typeof n)n=await n(e);else if(n?.default){const t=An(n.default);if(t.routes.length||t.beforeEnter||t.afterEnter)return{routes:t.routes,beforeEnter:t.beforeEnter||n.beforeEnter||null,afterEnter:t.afterEnter||n.afterEnter||null}}return An(n)}(await import(t),{$mod:this.runtime?.$mod||null,router:this})}async handleNavigation(t){const e="popstate"===t?.type?t.url:t?.to,n="replace"===t?.type||"popstate"===t?.type?"replace":"push";if(!e)return;const r=this.matchTo(e);r&&await this.#h(r,n)}async mount(t,e,n){this.hostNode=e,this.instance.runtime=dn(n||null,n?.$mod||n||null,{$router:this}),this.instance.host=e,this.instance.router=this,zn(e,this),this.instance.meta.routesSource=e.getAttribute("routes")||"/routes.js",this.renderer=t,this.resetRoutes(),this.disposeNavListener?.(),this.disposeNavListener=this.#c.onChange((t=>{this.handleNavigation(t)}));const r=await this.loadRoutes();this.beforeEnter=r.beforeEnter||null,this.afterEnter=r.afterEnter||null,this.addRoutes(r.routes),await this.handleNavigation({type:"replace",to:window.location.href})}}const or=new class{#c=new Sn;#d=new WeakMap;constructor(){this.#c.init()}push(t){this.#c.push(t)}replace(t){this.#c.replace(t)}go(t){this.#c.go(t)}back(){this.#c.back()}forward(){this.#c.forward()}mountView(t,e,n){let r=this.#d.get(e);return r||(r=new rr(this.#c),this.#d.set(e,r)),r.mount(t,e,n),r}},ir={$router:or},sr=[];document.addEventListener("click",(t=>{sr.forEach((e=>{e?.dom instanceof Element&&"function"==typeof e?.callback&&(e.dom.contains(t.target)||e.callback(t))}))}));const cr={CamelToKebabCase:function(t){return 0===t.length?"":t.charAt(0).toLowerCase()+t.slice(1).replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))},EventsList:["load","unload","beforeunload","resize","scroll","submit","reset","input","change","focus","blur","keydown","keypress","keyup","click","dblclick","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","touchstart","touchmove","touchend","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","copy","cut","paste","animationstart","animationend","animationiteration","transitionend","abort","error","loadstart","progress","play","pause","ended","volumechange","timeupdate","loadeddata","waiting","playing","online","offline","storage","visibilitychange"],BindInputDomValue:function(t,e,n,r,o){const i="string"==typeof t?document.querySelector(t):t;if(!i)return;const s=(t,e)=>r(t,e),c=(t,e)=>{o?.addEventListener?o.addEventListener(i,t,e):i.addEventListener(t,e)};switch(i.type||i.tagName.toLowerCase()){case"text":case"password":case"email":case"tel":case"url":case"search":case"number":case"range":case"color":case"date":case"time":case"datetime-local":case"month":case"week":case"hidden":case"textarea":s((()=>e[n]),(t=>{i.value=void 0===t?"":t})),c("input",(function(){e[n]=this.value}));break;case"checkbox":s((function(){i.checked=!!e[n]})),c("change",(function(){e[n]=this.checked}));break;case"radio":s((()=>{i.checked=i.value===e[n]})),c("change",(function(){this.checked&&(e[n]=this.value)}));break;case"select-one":case"select-multiple":s((()=>{let t=e[n];if(i.multiple){const e=Array.isArray(t)?t:[];for(let t=0;t<i.options.length;t++)i.options[t].selected=e.includes(i.options[t].value)}else i.value=t||""})),c("change",(function(){if(this.multiple){const t=[];for(let e=0;e<this.options.length;e++)this.options[e].selected&&t.push(this.options[e].value);e[n]=t}else e[n]=this.value}));break;default:return!1}return!0},SetAttr:function(t,e,n){"function"==typeof n&&(n=n());const r=new Set(["innerHTML","innerText","outerHTML","textContent","value","checked","selected","disabled","readOnly","maxLength","minLength","htmlFor","tabIndex","scrollTop","scrollLeft","scrollWidth","scrollHeight","clientWidth","clientHeight","offsetWidth","offsetHeight","style","dataset"]),o=new Set(["checked","selected","disabled","readonly","required","hidden","autofocus","multiple","novalidate"]),i=e.toLowerCase(),s={htmlfor:"htmlFor",readonly:"readOnly",maxlength:"maxLength",minlength:"minLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable",spellcheck:"spellcheck",innerhtml:"innerHTML",innertext:"innerText",autocapitalize:"autocapitalize"}[i]||e;r.has(s)?t[s]=void 0===n?"":n:o.has(i)?n?t.setAttribute(i,""):t.removeAttribute(i):void 0===n?t.removeAttribute(e):t.setAttribute(e,n)},AddClicker:(t,e,n)=>{if("outer"===e){let e=sr.length;return sr.push({dom:t,callback:n}),()=>{sr[e]=null}}}};function ur(t,e,n,r){const o=Un(e),i=o?.data||Wn(e)||n||{},s=o?.runtime||qn(e)||r||{};return s.$sys&&(s.$sys.$router=Hn(e,s.$sys.$router||null)),O.AsyncRun(t,i,s,function(t,e,n){const r=Un(t);return{$node:t,$watch:(e,n,o)=>{const i=r?.scope||In(t),s=O.Watch(e,n,o);return i?.addWatcher((()=>O.Cancel(s))),s},$scope:r?.scope||In(t),$router:Hn(t,n?.$sys?.$router||null)}}(e,0,s)).catch((t=>{throw t}))}function ar(t,e,n,r){const o=t.innerHTML,i=Un(e),s=i?.scope||In(e);t.hasAttribute("active")?s?.onActive((()=>{ur(o,e,n,qn(e)||r)})):t.hasAttribute("deactive")?s?.onDeactive((()=>{ur(o,e,n,qn(e)||r)})):t.hasAttribute("dispose")?s?.onDispose((()=>{ur(o,e,n,qn(e)||r)})):ur(o,e,n,qn(e)||r||{})}function lr(t,e){return t.contextOf?t.contextOf(e).scope:t.scopeOf(e)||In(e)}function fr(t,e,n,r){const o=lr(t,e);if(!e.hasAttribute("href")&&!e.hasAttribute(":href"))return;if(e.hasAttribute(":href")){const i=e.getAttribute(":href");e.removeAttribute(":href"),t.watch(o,(()=>{let t=O.Run(i,n,r);!t||t.startsWith("#")||t.startsWith("http")||(t.startsWith("@")?e.setAttribute("href",t.slice(1)):(r?.$mod?.scoped&&(t=r.$mod.scoped+t),e.setAttribute("href",t)))}))}else{let t=e.getAttribute("href");if(!t||t.startsWith("#")||t.startsWith("http"))return;t.startsWith("@")?e.setAttribute("href",t.slice(1)):(r?.$mod?.scoped&&(t=r.$mod.scoped+t),e.setAttribute("href",t))}const i=t=>{const n=t?.fullPath;e.getAttribute("href")===n?e.setAttribute("active",""):e.removeAttribute("active")},s=function(t,e){let n=t;for(;n;){const t=_n(n);if(t)return t;n=n.parentNode||n.host||null}return e?.$sys?.$router||null}(e,r);if(!s)return;i(s?.current);const c=s?.onChange?.(i);o?.addCleanup(c)}function hr(t,e,n,r,o,i){const s=lr(t,e);if(n.startsWith(":")){const c=n.slice(1);return"class"===c||"style"===c?dr(t,e,c,r,o,i):t.watch(s,(()=>{const t=r?O.Run(r,o,i):o[c];cr.SetAttr(e,c,t)})),!0}if(n.startsWith("@"))return pr(t,e,n,r,o,i),!0;if(n.indexOf("!")>-1);else if(n.startsWith("v:")){const n=t.findLastAccess(r,o);if(n&&n.data&&n.key)return cr.BindInputDomValue(e,n.data,n.key,((e,n)=>t.watch(s,e,n)),s)}else if("ref"===n){const t=r?.trim?.()||"",n=function(t){return t&&"object"==typeof t?(t.$refs&&"object"==typeof t.$refs||(t.$refs=O.Wrap({})),t.$refs):null}(o);return t&&n&&(n[t]=e,s?.addCleanup((()=>{n[t]===e&&(n[t]=null)}))),!0}return!1}function dr(t,e,n,r,o,i){const s=lr(t,e);let c="";t.watch(s,(()=>{let t=O.Run(r,o,i);if("function"==typeof t&&(t=t()),"class"===n){if(c&&(e.classList.remove(...c.split(/\s+/)),c=""),t instanceof Array)c="",t.forEach((t=>{if("string"==typeof t&&t.length)c+=" "+t;else if("object"==typeof t&&t)for(const e in t)t[e]&&(c+=" "+e)}));else if("string"==typeof t&&t.length)c=t.trim();else if("object"==typeof t&&t){c="";for(const e in t)t[e]&&(c+=" "+e)}return c=c.trim(),void(c&&e.classList.add(...c.split(/\s+/)))}if(c)if("object"==typeof c)for(const n in c)n.startsWith("--")?e.style.removeProperty(n):e.style[n]="";else"string"==typeof c&&c.split(";").forEach((t=>{const n=t.split(":");if(2!==n.length)return;const r=n[0].trim();r.startsWith("--")?e.style.removeProperty(r):e.style[r]=""}));if("object"==typeof t&&t)for(const n in t)n.startsWith("--")?e.style.setProperty(n,t[n]):e.style[n]=t[n];else"string"==typeof t&&t.split(";").forEach((t=>{const n=t.split(":");if(2!==n.length)return;const r=n[0].trim(),o=n[1].trim();r.startsWith("--")?e.style.setProperty(r,o):e.style[r]=o}));c=t}))}function pr(t,e,n,r,o,i){const s=lr(t,e),c=n.slice(1).split("."),u={self:!1,prevent:!1,stop:!1},a=c[0];if("mounted"===a)return void t.onMountedRun(e,(t=>{!function(t,e,n,r){let o=O.Run(r,e,n);"function"==typeof o&&o(t)}(t,o,i,r)}),!1);if("outerclick"===a){const t=t=>{const e=O.Run(r,o,i,{$event:t});"function"==typeof e&&e(t)},n=cr.AddClicker(e,"outer",t);return void s?.addCleanup(n)}if(-1===cr.EventsList.indexOf(a))return void((function(t){const e=Un(t);e&&(e.events||(e.events={}));const n=$n(t,!0);return n.events||(n.events={}),e?.events||n.events}(e))[a]=(...t)=>{const e=O.Run(r,o,i,{});"function"==typeof e&&e(...t)});"keydown"!==a&&"keyup"!==a&&"keypress"!==a||"INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.setAttribute("tabindex","0");let l=t=>{const e=O.Run(r,o,i,{$event:t});"function"==typeof e&&e(t)},f=null;c.slice(1).forEach((t=>{if(t.startsWith("delay")){let e=t.slice(5);e=e?e.endsWith("ms")?+e.slice(0,-2):e.endsWith("s")?1e3*+e.slice(0,-1):+e:1e3,isNaN(e)&&(e=1e3),l=t=>{"number"==typeof f&&(s?.clearTimeout(f)||clearTimeout(f)),f=s?.setTimeout((()=>{const e=O.Run(r,o,i,{$event:t});"function"==typeof e&&e(t)}),e)||setTimeout((()=>{const e=O.Run(r,o,i,{$event:t});"function"==typeof e&&e(t)}),e)}}u[t]=!0}));const h=t=>{(1>=c.length||"keydown"!==a&&"keyup"!==a&&"keypress"!==a||c[1]===t.key?.toLowerCase())&&(u.self&&t.currentTarget!==t.target||(u.prevent&&t.preventDefault(),u.stop&&t.stopPropagation(),l(t)))};s?.addEventListener?s.addEventListener(e,a,h):e.addEventListener(a,h)}class mr{constructor(t=null){this.host=t,this.cleanups=[],this.timers=new Set,this.intervals=new Set,this.lifecycle={active:[],deactive:[],dispose:[]},this.state="created"}addCleanup(t){return"function"==typeof t&&this.cleanups.push(t),t}addWatcher(t){return this.addCleanup(t)}addEventListener(t,e,n,r){return t?.addEventListener&&"function"==typeof n?(t.addEventListener(e,n,r),this.addCleanup((()=>t.removeEventListener(e,n,r))),n):null}setTimeout(t,e){const n=window.setTimeout((()=>{this.timers.delete(n),t()}),e);return this.timers.add(n),n}setInterval(t,e){const n=window.setInterval(t,e);return this.intervals.add(n),n}clearTimeout(t){this.timers.has(t)&&(this.timers.delete(t),window.clearTimeout(t))}clearInterval(t){this.intervals.has(t)&&(this.intervals.delete(t),window.clearInterval(t))}onActive(t){"function"==typeof t&&this.lifecycle.active.push(t)}onDeactive(t){"function"==typeof t&&this.lifecycle.deactive.push(t)}onDispose(t){"function"==typeof t&&this.lifecycle.dispose.push(t)}activate(t){this.state="active";for(const e of this.lifecycle.active)e(t)}deactive(t){this.state="inactive";for(const e of this.lifecycle.deactive)e(t)}dispose(t){if("disposed"!==this.state){this.state="disposed";for(const e of this.lifecycle.dispose)e(t);for(const t of this.cleanups.splice(0))t();for(const t of this.timers)window.clearTimeout(t);this.timers.clear();for(const t of this.intervals)window.clearInterval(t);this.intervals.clear()}}}const yr=/{{|}}/g,wr=/^\s*(?:\((\w+)\s*,\s*(\w+)\)|(\w+))\s+in\s+(.+?)\s*$/;function br(t,e,n=null){return t.runtimeOf?t.runtimeOf(e,n):{instance:Un(e)||Fn(e,null),scope:t.scopeOf(e)||In(e),runtime:qn(e)||n}}function vr(t,e,n){let r=Un(t);r||(r=Rn(t,Fn(t.parentNode||null,null),"boundary"),Dn(t,r)),r.scope||Mn(t,new mr(t)),void 0!==e&&Jn(t,e);const o=n||qn(t)||null;return o&&(Bn(t,o),zn(t,Hn(t,o.$sys?.$router||null))),r}function gr(t){if(!t||1!==t.nodeType)return;const e=In(t);e?.dispose(t),On(Un(t)),function(t){Yn(t)}(t)}function xr(t,e){return t.contextOf?t.contextOf(e):{instance:Un(e)||Fn(e,null),scope:t.scopeOf(e)||In(e)}}function Rr(t){return(t||[]).map((t=>t.cloneNode(!0)))}function Or(t){return null==t?"":t+""}function Sr(t,e,n,r,o){e.innerHTML="",e.append(...Rr(n));const i=xr(t,e).scope;t.parseVif(Array.from(e.childNodes),r,o).forEach((e=>{1===e.nodeType?function(t,e,n){vr(t,e,n)}(e,r,o):(Bn(e,o),i&&Mn(e,i)),t.parseDom(e,r,o,i)}))}function Er(t){t.cleanup?.(),t.cleanup=null}function jr(t,e,n,r){if(e.hasAttribute?.("data-vrouter-managed"))return t.parseAttrs(e,n,r),e;const o=function(t){const e=t.getAttribute("vrefof");let n=t.closest(`*[vref='${e}']`);if(!n)return null;for(;;){const t=n?.parentNode?.closest?.("*[vref]");if(!t)break;if(t.getAttribute("vref")!==e)break;n=t}return n}(e);if(!o)return t.onMountedRun(e,(e=>{jr(t,e,n,r)})),e;const i=function(t){const e=(n=t,Un(n)?.slotOutletState??Cn(n,"slotOutletState"));var n;if(e)return e;const r={fallbackTemplates:Rr(Array.from(t.childNodes)),currentKey:"",currentMode:"",cleanup:null};return t.innerHTML="",function(t,e){const n=Un(t);n&&(n.slotOutletState=e||null),Pn(t,"slotOutletState",e)}(t,r),r}(e),s=xr(t,e);return t.watch(s.scope,(()=>{const t=function(t,e,n){return t.hasAttribute(":name")?Or(O.Run(t.getAttribute(":name"),e,n)):Or(t.getAttribute("name"))}(e,n,r),i=Fn(o,null);var s;return{slotName:t,selected:(i?.slots||(s=o,Un(s)?.slots??Cn(s,"slotContents"))||{})[t]||null}}),(({slotName:o,selected:s})=>{if(s){const r=`projected:${o}:${s.id}`;if(i.currentKey===r&&"projected"===i.currentMode)return;Er(i);const c=function(t,e,n,r){const o=e.getAttribute("vbind");if(!o)return{data:r,cleanup:null};const i=O.Wrap({});O.SetDataRoot(i,r);const s=o.split(",").map((t=>t.trim())).filter(Boolean),c=xr(t,e).scope,u=[];return s.forEach((e=>{const r=t.watch(c,(()=>n[e]),(t=>{i[e]=t}),{deep:!0});u.push(r),i[e]=n[e]})),{data:i,cleanup:()=>u.forEach((t=>O.Cancel(t)))}}(t,e,n,s.data);return Sr(t,e,s.templates,c.data,s.runtime),i.currentKey=r,i.currentMode="projected",void(i.cleanup=c.cleanup)}const c="fallback:"+o;i.currentKey===c&&"fallback"===i.currentMode||(Er(i),Sr(t,e,i.fallbackTemplates,n,r),i.currentKey=c,i.currentMode="fallback")})),t.parseAttrs(e,n,r),e}function Ar(t,e){if(t.startsWith("/"))return t;const n=e.substring(0,e.lastIndexOf("/")).split("/").filter((t=>""!==t)),r=t.split("/").filter((t=>""!==t));for(const o of r)".."!==o?"."!==o&&n.push(o):n.length>0&&n.pop();return"/"+n.join("/")}function kr(t,e,n){return t.startsWith("@")?t=t.slice(1):t.startsWith("http")||(t=t.startsWith("/")?e?`${e}${t}`:t:Ar(t,n)),t.endsWith(".js")||(t+=".js"),t.startsWith("http")||(t=`${window.location.origin}${t}`),t}function Tr(t,e){const n=t.trim();if(/^\w+$/.test(n))return n;if(/^{[\w\s,]+}$/.test(n))return n.slice(1,-1).split(",").map((t=>t.trim())).filter(Boolean);throw Error("unsupported import: "+e)}async function $r(t,e,n){if("string"==typeof t)return void(n[t]=e.default??e);const r=e.default||{};t.forEach((t=>{t in e?n[t]=e[t]:t in r&&(n[t]=r[t])}))}function Nr(t,e,n=null){return t.runtimeOf?t.runtimeOf(e,n):{instance:Un(e),scope:In(e),runtime:qn(e)||n}}async function Cr(t,e,n,r,o,i=!1){const s=O.Wrap({$refs:O.Wrap({})}),c=Nr(t,e,r);if(o.setup){let n=o.setup.innerHTML;n=await async function(t,e={},n={},r=""){const o=rn(n),i=function(t="",e=""){return t?t.startsWith("http")||!e||t.startsWith(e)?t:`${e}${t}`:e||"/"}(r,o);let s,c=t;const u=/await import\(['"]([^'"]+)['"]\)/gm;for(;null!==(s=u.exec(t));){let t=s[1];t.startsWith("http")||(t=Ar(t,i),t=`${window.location.origin}${t}`),c=c.replace(s[0],`await import('${t}')`)}const a=/^[\s/]*import\s+([\w{},\s]+)\s+from\s+['"]([^'"]+)['"][;\s]*$/gm;for(;null!==(s=a.exec(t));)if(c=c.replace(s[0],""),!s[0].trim().startsWith("//"))try{const t=kr(s[2],o,i),n=Tr(s[1],s[0]),r=await import(t);await $r(n,r,e)}catch(l){}return c.trim()}(n,s,c.runtime,o.url),await O.AsyncRun(n,s,c.runtime,{$node:e,$watch:(n,r,o)=>{const i=Nr(t,e,c.runtime).scope,s=()=>{t.watch(Nr(t,e,c.runtime).scope,n,r,o)};i?i.setTimeout(s,50):setTimeout(s,50)}})}if(s.$refs&&"object"==typeof s.$refs||(s.$refs=O.Wrap({})),Jn(e,s),i)return s;Kn(e)||Vn(e,Array.from(e.childNodes).map((t=>t.cloneNode(!0))));const u=function(t,e,n){const r=Object.create(null);return t.forEach((t=>{const o=t.cloneNode(!0),i=Or(o.getAttribute?.("vslot"));o.removeAttribute?.("vslot"),r[i]||(r[i]={id:O.GenUniqueID(),name:i,templates:[],data:e,runtime:n}),r[i].templates.push(o)})),r}(Kn(e)||[],n,r);!function(t,e){const n=Un(t);n&&(n.slots=e||null),Pn(t,"slotContents",e)}(e,u),e.innerHTML="";const a=o.body.cloneNode(!0);e.append(...a.childNodes),Object.keys(s).forEach((o=>{const i=cr.CamelToKebabCase(o);if("boolean"==typeof s[o]?(e.hasAttribute(o)||e.hasAttribute(i))&&(s[o]=!0):e.hasAttribute(o)?(s[o]=e.getAttribute(o),e.removeAttribute(o)):e.hasAttribute(i)&&(s[o]=e.getAttribute(i),e.removeAttribute(i)),e.hasAttribute(":"+o)||e.hasAttribute(":"+i)){const c=e.getAttribute(":"+o)||e.getAttribute(":"+i);e.removeAttribute(":"+o),e.removeAttribute(":"+i),delete s[o],c?t.watch(Nr(t,e,r).scope,(()=>O.Run(c,n,r)),(()=>{s[o]=O.Run(c,n,r)}),{deep:!0}):t.watch(Nr(t,e,r).scope,(()=>n[o]),(()=>{s[o]=n[o]}),{deep:!0})}if(e.hasAttribute("v:"+o)||e.hasAttribute("v:"+i)){let c=e.getAttribute("v:"+o)||e.getAttribute("v:"+i);e.removeAttribute("v:"+o),e.removeAttribute("v:"+i),c||(c=o);const u=t.findLastAccess(c,n);if(!u||!u.key||void 0===u.data)return;void 0!==u.data[u.key]&&null!==u.data[u.key]&&delete s[o],t.watch(Nr(t,e,r).scope,(()=>u.data[u.key]),(()=>{s[o]=u.data[u.key]})),t.watch(Nr(t,e,r).scope,(()=>s[o]),(()=>{u.data[u.key]=s[o]}))}}));let l=Array.from(a.attributes);return l=l.filter((n=>!t.parseAttr(e,n.name,n.value,s,Nr(t,e,r).runtime)||(a.removeAttribute(n.name),!1))),l.forEach((t=>{"class"===t.name?e.classList.add(...t.value.trim().split(/\s+/)):"style"===t.name?t.value.split(";").forEach((t=>{const n=t.split(":");if(2!==n.length||e.style[n[0]])return;const r=n[0].trim(),o=n[1].trim();r.startsWith("--")?e.style.setProperty(r,o):e.style[r]=o})):e.getAttribute(t.name)||e.setAttribute(t.name,t.value)})),s}function Pr(t,e,n,r,o){Nr(t,e,r).scope||Mn(e,new mr(e));for(const i of o.scripts)ar(i,e,n,r)}let Lr=!1;function Ur(){if(Lr)return;Lr=!0;const t=document.createElement("style");t.innerHTML="\n [vref] {\n display: block;\n }\n [vparsing] {\n display: none;\n -webkit-text-fill-color: transparent;\n }\n vslot, vrouter {\n display: block;\n }\n",document.head.firstChild?document.head.insertBefore(t,document.head.firstChild):document.head.appendChild(t);const e=[],n=new WeakMap,r=t=>{if(!t.isConnected)return;let n=t.getAttribute("vdelay");if(n){let r=e[n];r&&r(t)}},o=t=>{if(!t||1!==t.nodeType)return;const e=n.get(t);e&&(cancelAnimationFrame(e),n.delete(t)),t.querySelectorAll?.("*").forEach((t=>{const e=n.get(t);e&&(cancelAnimationFrame(e),n.delete(t))}))},i=t=>{if(!t||1!==t.nodeType)return;if(t.hasAttribute?.("data-vrouter-cache")||t.hasAttribute?.("data-vrouter-layout"))return;o(t);const e=requestAnimationFrame((()=>{n.delete(t),t.isConnected||(t=>{t&&1===t.nodeType&&(t.isConnected||tr(t))})(t)}));n.set(t,e)};new MutationObserver((function(t,e){t.forEach((function(t){for(let e of t.addedNodes)1===e.nodeType&&(o(e),r(e),e.querySelectorAll("*[vdelay]").forEach(r));for(let e of t.removedNodes)i(e)}))})).observe(document.body,{attributes:!1,childList:!0,subtree:!0,characterData:!1}),window.__VhtmlRuntime__=class{app=null;modulePath=null;vget=gn;vproxy=O;Wrap=O.Wrap;o=!0;$router=ir.$router;constructor(t){"string"==typeof t?this.app=document.getElementById(t):t instanceof HTMLElement?this.app=t:this.app=document.body,this.app&&(async()=>{let t=await gn.FetchUI(window.location.pathname,{},!0);this.modulePath=t.mod?.scoped||"",this.parseRef("root",this.app,{},t.mod||{},t,!0)})()}watch(t,e,n,r){const o=O.Watch(e,n,r);return t?.addWatcher((()=>O.Cancel(o))),o}findLastAccess(t,e){return function(t,e){const n=Function("sandbox",t=`with (sandbox) { ${t} }`);let r={data:null,key:null};const o=t=>new Proxy(t,{has:(t,e)=>!0,get(t,e,n){if(e===Symbol.unscopables)return;let i=Reflect.get(t,e,n);return r.data=t,r.key=e,"object"==typeof i&&i?o(i):i},set:(t,e,n,r)=>!1});return n(o(e)),r}(t,e)}runtimeOf(t,e=null){if(!t)return{instance:null,scope:null,runtime:e};const n=Fn(t,null),r=In(t),o=qn(t);return{instance:n,scope:r||n?.scope||null,runtime:o||n?.runtime||e}}scopeOf(t){return this.runtimeOf(t).scope}async parseDom(t,e={},n,r=this.scopeOf(t)){if(n instanceof HTMLElement)throw Error("runtime error");const o=this.runtimeOf(t,n),i=r||o.scope,s=o.runtime||n;let c=t.nodeName.toLowerCase();if(3===t.nodeType)return void this.parseTextNode(t,e,s,i);if(8===t.nodeType)return void t.remove();if(1!==t.nodeType)return;if(t.hasAttribute("no-vhtml")||Gn(t))return;Kn(t)||Vn(t,Array.from(t.childNodes).map((t=>t.cloneNode(!0))));let u=t.getAttribute("v-for");if(null!==u)return void this.parseVfor(u,t,e,s);if(-1!==c.indexOf("-")){let n="/"+c.split("-").join("/"),r=t.hasAttribute("single");return this.parseRef(n,t,e,s,null,r),void Zn(t)}if(t.getAttribute(":vsrc")){let n=t.getAttribute(":vsrc");t.removeAttribute(":vsrc");let r=Array.from(t.attributes).map((t=>({name:t.name,value:t.value}))),o=Array.from(t.childNodes);return void this.watch(i,(()=>{Nn(t,"parsed"),t.setAttribute("vparsing","");let i=O.Run(n,e,s);i&&(Array.from(t.attributes).forEach((e=>{t.removeAttribute(e.name)})),t.innerHTML="",r.forEach((e=>{t.setAttribute(e.name,e.value)})),o.forEach((e=>{t.appendChild(e.cloneNode(!0))})),this.parseRef(i,t,e,s,null,!1),Zn(t))}))}if(t.getAttribute("vsrc")){let n=t.hasAttribute("single");return this.parseRef(t.getAttribute("vsrc"),t,e,s,null,n),void Zn(t)}if("div"===c&&t.getAttribute("v-html")){let n=t.getAttribute("v-html");return t.removeAttribute("v-html"),t.innerHTML="",this.parseAttrs(t,e,s),Zn(t),void this.watch(i,(()=>{let r=O.Run(n,e,s);t.innerHTML=r;let o=this.parseVif(Array.from(t.childNodes),e,s);for(let t of o)this.parseDom(t,e,s,i)}))}if("vslot"===c)return this.parseSlots(t,e,s),void Zn(t);if("vrouter"===c)return this.parseAttrs(t,e,s),void ir.$router.mountView(this,t,s);this.parseAttrs(t,e,s);let a=this.parseVif(Array.from(t.childNodes),e,s);for(let l of a)this.parseDom(l,e,s,i);Zn(t)}onMountedRun(t,n,r=!0){if(r){if(t.isConnected)return void n(t);let r=e.push((t=>{t.removeAttribute("vdelay"),n(t)}));return void t.setAttribute("vdelay",r-1)}t.isConnected&&n(t);let o=e.push(n);t.setAttribute("vdelay",o-1)}async parseRaw(t,e,n,r){return async function(t,e,n,r,o){const i="_"+Math.random().toString(36).slice(2),s=await gn.ParseUI(o,r||{},i);t.parseRef(i,e,n||{},{...r},s)}(this,t,e,n,r)}async parseRef(t,e,n,r,o,i=!1){return async function(t,e,n,r,o,i,s=!1){const c=Un(n),u=Fn(n.parentNode||null,null),a=In(n);a&&a.dispose(n),c&&On(c);const l=Rn(n,u,"component");Dn(n,l),Mn(n,new mr(n)),n.setAttribute("vparsing","");const f=o,h=n.getAttribute("vrefof"),d=n.closest(`*[vref='${h}']`);d&&(o=qn(d)),!i&&e&&(e.endsWith(".html")||(e+=".html"),i=await gn.FetchUI(e,o,n.hasAttribute("scoped")));const p=i?.mod||o?.$mod||null,m=Hn(n,o?.$sys?.$router||null),y=dn(o||null,p,{$router:m});y.$sys.$emit=(t,...e)=>{t=t.toLowerCase();const r=(o=n,Un(o)?.events??Cn(o,"events"));var o;if(!r)return;const i=r[t];"function"==typeof i&&i(...e)},Bn(n,y),zn(n,m),function(t,e){const n=Un(t);n&&(n.vsrc=e||""),Pn(t,"vsrc",e||null)}(n,e);const w=await Cr(t,n,r,f,i,s);s?t.parseAttrs(n,w,y,i?.customAttrs):t.parseAttrs(n,r,f,i?.customAttrs);const b=t.parseVif(Array.from(n.childNodes),w,y);for(const v of b)t.parseDom(v,w,y);n.removeAttribute("vparsing"),Pr(t,n,w,y,i),Nr(t,n,y).scope?.activate(n)}(this,t,e,n,r,o,i)}async setupRef(t,e,n,r,o=!1){return Cr(this,t,e,n,r,o)}async mountRef(t,e,n,r){return Pr(this,t,e,n,r)}parseAttrs(t,e,n,r){return function(t,e,n,r,o){const i=lr(t,e);if("A"===e.nodeName&&fr(t,e,n,r),Array.from(e.attributes).forEach((o=>{hr(t,e,o.name,o.value,n,r)&&e.removeAttribute(o.name)})),o&&Object.keys(o).forEach((n=>{hr(t,e,n,o[n],Wn(e),r)})),e.hasAttribute("v-show")){const o=e.getAttribute("v-show"),s=e.style.display;t.watch(i,(()=>{const t=O.Run(o,n,r);e.style.display=t?s:"none"}))}}(this,t,e,n,r)}parseAHref(t,e,n){return fr(this,t,e,n)}parseAttr(t,e,n,r,o){return hr(this,t,e,n,r,o)}handleStyle(t,e,n,r,o){return dr(this,t,e,n,r,o)}handleEvent(t,e,n,r,o){return pr(this,t,e,n,r,o)}parseTextNode(t,e,n,r=this.scopeOf(t)){return function(t,e,n,r,o=t.scopeOf(e)){const i=o||br(t,e,r).scope,s=e.nodeValue.trim();if(!s)return;let c,u=0,a=-1;const l=[];for(;null!==(c=yr.exec(s));)if("{{"===c[0])a=c.index;else if("}}"===c[0]&&a>=0){u!==a&&l.push(s.slice(u,a)),l.push("");const o=s.slice(a+2,c.index),f=l.length-1;a=-1,u=c.index+2,t.watch(i,(()=>{let t=O.Run(o,n,r);"function"==typeof t?t=t():"object"==typeof t&&t&&(t=JSON.stringify(t)),l[f]=t,e.nodeValue=l.join("").trim()}))}l.push(s.slice(u)),e.nodeValue=l.join("")}(this,t,e,n,r)}parseVfor(t,e,n,r){return function(t,e,n,r,o){n.removeAttribute("v-for");const i=wr.exec(e);if(5!==i?.length)return;const s=i[1]||i[3],c=i[2],u=i[4],a=document.createElement("div");a.style.display="none";const l=O.GenUniqueID(),f=Object.create(null),h=(e,r,i=!1)=>{const s=n.cloneNode(!0);return i&&s.removeAttribute("v-if"),vr(s,e,o),a.parentNode.insertBefore(s,r),t.parseDom(s,e,o,br(t,s,o).scope),s},d=t=>{let e=!1;for(const n of Object.keys(f)){if(n===t){e=!0;continue}if(!e)continue;const r=f[n]?.dom;if(r?.isConnected)return r}return a},p=br(t,n.parentNode,o).scope;p?.addCleanup((()=>{Object.keys(f).forEach((t=>{const e=f[t];0>e?.watchId||O.Cancel(e.watchId),gr(e?.dom),e?.dom?.remove?.(),delete f[t]}))})),n.parentNode.replaceChild(a,n),t.watch(p||br(t,a.parentNode||n.parentNode,o).scope,(()=>{let e=O.Run(u,r,o);const i=new Set;"function"==typeof e&&(e=e()),"number"==typeof e&&(e=Array.from({length:e},((t,e)=>e))),null==e&&(e=[]);let m=e.length;if("object"!=typeof e)return m;const y=[];Object.keys(e).forEach((t=>{let n="";n=e[t]&&e[t][O.DataID]?e[t][O.DataID]:`${t}.${e[t]}`,n=`${l}.${n}`,i.add(n),y.push({key:t,cacheKey:n,value:e[t]})})),Object.keys(f).forEach((t=>{if(!i.has(t)){const e=f[t];0>e?.watchId||O.Cancel(e.watchId),gr(e?.dom),e?.dom?.remove?.(),delete f[t]}}));let w=a;for(let u=y.length-1;u>=0;u--){const{key:e,cacheKey:i,value:l}=y[u],m=f[i];if(m){const t=m.data||(b=m.dom,Un(b)?.vforData??Cn(b,"vforData"));t&&(t[s]=l,c&&(t[c]="0"===e?0:+e||e));const n=m.dom;!n||n.nextSibling===w&&n.isConnected||a.parentNode.insertBefore(n,w),n?.isConnected&&(w=n);continue}let v={[s]:l};c&&(v[c]="0"===e?0:+e||e),v=O.Wrap(v,r);const g={data:v,dom:null,watchId:-1};f[i]=g;const x=n.getAttribute("v-if");if(x)g.watchId=t.watch(p||br(t,a.parentNode||n.parentNode,o).scope,(()=>{const t=f[i];if(t)return O.Run(x,t.data,o);O.Cancel(g.watchId)}),(t=>{const e=f[i];if(e)if(t){if(!e.dom){const t=h(e.data,d(i),!0);Xn(t,e.data),e.dom=t}e.dom.isConnected||a.parentNode.insertBefore(e.dom,d(i))}else e.dom&&(gr(e.dom),e.dom.remove(),e.dom=null);else O.Cancel(g.watchId)}));else{const t=h(v,w);Xn(t,v),g.dom=t,w=t}}var b;return m}))}(this,t,e,n,r)}parseVif(t,e,n){return function(t,e,n,r){let o={now:document.createElement("div"),conds:[],doms:[]};const i=e=>{const o={now:e.now,conds:e.conds,doms:e.doms},i=`let res = [${o.conds.map((t=>""===t?"true":`Boolean(${t})`)).join(",")}]\n return res.indexOf(true)`;t.watch(br(t,o.now,r).scope,(()=>{const t=O.Run(i,n,r);let e=o.doms[t];return e||(e=document.createElement("div"),e.style.display="none"),e}),(e=>{if(!e)return;t.onMountedRun(o.now,(t=>{t.replaceWith(e),o.now=e}));const i=In(e);if(!Gn(e)||"disposed"===i?.state){"disposed"===i?.state&&disposeRuntimeSubtree(e);const o=Kn(e);o?.length&&(e.innerHTML="",o.forEach((t=>{e.appendChild(t.cloneNode(!0))}))),vr(e,n,r),t.parseDom(e,n,r,br(t,e,r).scope)}}))},s=e.filter((t=>!(t.getAttribute&&!t.getAttribute("v-for")&&(null!==t.getAttribute("v-if")?(o.conds.length>0&&(i(o),o={now:document.createElement("div"),conds:[],doms:[]}),t.replaceWith(o.now),o.conds.push(t.getAttribute("v-if")),t.removeAttribute("v-if"),o.doms.push(t),1):null!==t.getAttribute("v-else-if")?(o.conds.push(t.getAttribute("v-else-if")),t.removeAttribute("v-else-if"),o.doms.push(t),t.remove(),1):null!==t.getAttribute("v-else")&&(o.conds.push(""),t.removeAttribute("v-else"),o.doms.push(t),t.remove(),1)))));return o.conds.length>0&&i(o),s}(this,t,e,n)}parseSlots(t,e,n){return jr(this,t,e,n)}}}!function(t=document.body){Ur(),window.$vhtml||(window.$vhtml=function(t=document.body){return Ur(),new(0,window.__VhtmlRuntime__)(t)}(t)),window.$vhtml}(document.body)},"function"==typeof define&&define.amd?define(t):t();
|
|
1
|
+
var t,e;t=this,e=function(){const t=[],e=[];let n=!1;const r="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(window):t=>setTimeout(t,16),o=()=>{n=!1;const r=new Set(e.splice(0));let o=0;for(const e of r)t[e]&&(t[e](),o++);return o},s=()=>{n||(n=!0,r(o))};function i(){return`${performance.now().toString(36)}-${Math.random().toString(36).substring(2,5)}`}function c(t,e=new Set){if(t&&"object"==typeof t&&!e.has(t)){e.add(t);for(let n in t)c(t[n],e)}return t}window.$vupdate=e=>{"function"==typeof t[e]&&t[e]()};const u=[];function a(e,n,r){let o=t.length;const s=()=>{u.push(o);try{const t=e();return r&&r.deep&&c(t),t}catch(T){return}finally{u.pop()}};"function"==typeof n?t.push((()=>n(s()))):t.push(s);const i=s();return"function"==typeof n&&n(i),o}function l(e){e>=0&&e<t.length&&(t[e]=null)}const f=Symbol("isProxy"),h=Symbol("DataID"),d=Symbol("bind"),p=Symbol("root");function m(t,e){t[p]=e}function y(t){return!(!t||"object"!=typeof t||t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Event||t.o||t.constructor!==Object&&t.constructor!==Array)}function w(t,e){if(!t||!t[f]||!y(e))return e;let n=t[d];if(!e[f]){if(Array.isArray(e)&&Array.isArray(t)){t.length=0;for(let n=0;n<e.length;n++)t.push(e[n]);return t}return Object.keys(t).forEach((n=>{e.hasOwnProperty(n)||delete t[n]})),Object.keys(e).forEach((n=>{t[n]?.[f]?t[n]=w(t[n],e[n]):t[n]=e[n]})),t}if(e[h]===t[h])return e;for(let r in n)if(e[d][r]?.indexOf){const t=e[d][r],o=new Set(t);for(let e of n[r])o.has(e)||(t.push(e),o.add(e))}else e[d][r]=n[r];for(let r in e)r in t&&t[r]?.[f]&&(e[r]=w(t[r],e[r]));return e}function b(n,r=void 0){const o=i();let c=!1;"[object Array]"==={}.toString.call(n)&&(c=!0),r&&m(n,r),n[h]=o;const a={},l={get(t,e,n){if(e===h)return o;if(e===f)return!0;if(e===d)return a;const r=Reflect.has(t,e),s=Reflect.get(t,e,n);if(!r&&t[p]&&e in t[p])return t[p][e];if("function"==typeof s)return s;let i=-1;if(u.length>0){let t=e;i=u[u.length-1],c&&(t=""),a.hasOwnProperty(t)?-1==a[t].indexOf(i)&&a[t].push(i):a[t]=[i]}if(y(s)&&!s[f]){let r=b(s,void 0);return Reflect.set(t,e,r,n),r}return s},set(n,r,o,i){const l=Reflect.get(n,r,i);if(l===o)return!0;let h=!0;if(Array.isArray(o)&&Array.isArray(l)){l.length=0;for(let t=0;t<o.length;t++)l.push(o[t])}else l&&l[f]&&y(o)?(o=w(l,o),h=Reflect.set(n,r,o,i)):h=Reflect.set(n,r,o,i);if(h&&0===u.length){let n=r;if(c&&(n=""),a[n]){let r=0;for(;r<a[n].length;){let o=a[n][r];t[o]?(r++,e.push(o),s()):a[n].splice(r,1)}}}return h},has:(t,e)=>!!Reflect.has(t,e)||!(!t[p]||!(e in t[p])),deleteProperty(n,r){const o=Reflect.deleteProperty(n,r);if(o&&0===u.length){let n=r;if(c&&(n=""),a[n]){let r=0;for(;r<a[n].length;){let o=a[n][r];t[o]?(r++,e.push(o),s()):a[n].splice(r,1)}}}return o}};return new Proxy(n,l)}const g={console,window,prompt:prompt.bind(window),alert:alert.bind(window),confirm:confirm.bind(window),RegExp,document,Array,Object,Math,Date,JSON,Symbol,Number,isNaN,parseInt,parseFloat,setTimeout:setTimeout.bind(window),setInterval:setInterval.bind(window),clearTimeout:clearTimeout.bind(window),clearInterval:clearInterval.bind(window),encodeURIComponent,btoa:btoa.bind(window),fetch:fetch.bind(window),TextDecoder,history,requestAnimationFrame:requestAnimationFrame.bind(window),getComputedStyle:getComputedStyle.bind(window)};function v(t,e={},n={}){const r=e?.$sys||null,o=e?.$ctx||null,s=e?.$mod||null;let i=Object.create(null);return i=Object.assign(i,g),n&&"object"==typeof n&&(i=Object.assign(Object.create(i),n)),s&&(i=Object.assign(Object.create(i),s)),o&&(i=Object.assign(Object.create(i),o)),new Proxy(t,{has:(t,e)=>!0,get:(e,n,c)=>"$data"===n?t:"$sys"===n?r:"$ctx"===n?o:"$mod"===n?s:r&&n in r?r[n]:n in e?Reflect.get(e,n,c):n in i?i[n]:window[n],set:(t,e,n,r)=>Reflect.set(t,e,n,r)})}function x(t,e,n,r={}){let o=e.get(t);if(o)return o;let s=t.trim();const i=s.replace(/\/\*[\s\S]*?\*\/|\/\/.*/g,"").trim(),c=/^(var|let|const|if|for|while|switch|try|throw|class|function|return|debugger)\b/.test(i),u=t=>n((t=>`\nwith (sandbox) {\n${t}\n}`)(t));if(!1!==r.returnExpression&&!c)try{return o=u(`return (\n${s}\n)`),e.set(t,o),o}catch(a){}try{return o=u(s),e.set(t,o),o}catch(a){return null}}const R=new Map;function O(t,e,n,r){return function(t,e,n,r,o){if(t)try{return t(v(n,r,o))}catch(s){}}(x(t,R,(t=>Function("sandbox",t)),{label:"Run"}),0,e,n,r)}const k=Object.getPrototypeOf((async function(){})).constructor,S=new Map;async function j(t,e,n,r){const o=x(t,S,(t=>new k("sandbox",t)),{label:"AsyncRun",returnExpression:!0});return await async function(t,e,n,r,o){if(t)try{return await t(v(n,r,o))}catch(s){throw s}}(o,0,e,n,r)}const E=new class{constructor(){this.scopeAttribute="",this.scopeBody="",this.scopedKeyframes=new Map}parse(t,e){return this.scopeAttribute=`[vrefof="${e}"]`,this.scopeBody=`[vref="${e}"]`,this.scopedKeyframes.clear(),this.scopeSuffix=e.replace(/[^a-zA-Z0-9]/g,""),t=this.removeComments(t),this.collectKeyframes(t),this.parseRules(t)}collectKeyframes(t){const e=/@keyframes\s+([^\s{]+)/gi;let n;for(;null!==(n=e.exec(t));){const t=n[1],e=t+"-"+this.scopeSuffix;this.scopedKeyframes.set(t,e)}}removeComments(t){return t.replace(/\/\*[\s\S]*?\*\//g,"")}parseRules(t){let e="",n=0;for(;n<t.length;){for(;n<t.length&&/\s/.test(t[n]);)e+=t[n],n++;if(n>=t.length)break;if("@"===t[n]){const r=this.parseAtRule(t,n);e+=r.content,n=r.endIndex}else{const r=this.parseNormalRule(t,n);e+=r.content,n=r.endIndex}}return e}parseAtRule(t,e){let n=e,r="";for(;n<t.length&&"{"!==t[n];)r+=t[n],n++;if(n>=t.length)return{content:r,endIndex:n};const o=r.toLowerCase().trim();if(o.startsWith("@keyframes"))return this.parseKeyframes(t,e);if(o.startsWith("@media"))return this.parseMedia(t,e);if(o.startsWith("@supports"))return this.parseSupports(t,e);{const e=this.findMatchingBrace(t,n);return{content:r+e.content,endIndex:e.endIndex}}}parseKeyframes(t,e){let n=e,r="";for(;n<t.length&&"{"!==t[n];)r+=t[n],n++;if(n>=t.length)return{content:r,endIndex:n};const o=this.findMatchingBrace(t,n),s=o.content,i=this.extractKeyframeName(r),c=this.scopedKeyframes.get(i);return c&&(r=r.replace(i,c)),r+=s,{content:r,endIndex:o.endIndex}}extractKeyframeName(t){const e=t.match(/@keyframes\s+([^\s{]+)/i);return e?e[1]:""}parseMedia(t,e){let n=e,r="";for(;n<t.length&&"{"!==t[n];)r+=t[n],n++;if(n>=t.length)return{content:r,endIndex:n};r+="{",n++;let o=1,s="";for(;n<t.length&&o>0;){if("{"===t[n])o++;else if("}"===t[n]&&(o--,0===o))break;s+=t[n],n++}return r+=this.parseRules(s),n<t.length&&"}"===t[n]&&(r+="}",n++),{content:r,endIndex:n}}parseSupports(t,e){return this.parseMedia(t,e)}parseNormalRule(t,e){let n=e,r="";for(;n<t.length&&"{"!==t[n];)r+=t[n],n++;if(n>=t.length)return{content:r,endIndex:n};const o=this.addScopeToSelector(r.trim()),s=this.findMatchingBrace(t,n);return{content:o+this.processRuleContent(s.content),endIndex:s.endIndex}}processRuleContent(t){let e=t;return e=e.replace(/animation\s*:\s*([^;]+);/gi,((t,e)=>`animation: ${this.processAnimationValue(e)};`)),e=e.replace(/animation-name\s*:\s*([^;]+);/gi,((t,e)=>`animation-name: ${this.processAnimationNames(e)};`)),e}processAnimationValue(t){return t.split(",").map((t=>t.trim())).map((t=>{const e=t.split(/\s+/);for(let n=0;n<e.length;n++){const t=e[n];if(/^\d+(\.\d+)?(s|ms)$/.test(t))continue;if(/^\d+(\.\d+)?$/.test(t))continue;if(["ease","ease-in","ease-out","ease-in-out","linear","infinite","normal","reverse","alternate","alternate-reverse","forwards","backwards","both","running","paused"].includes(t))continue;if(t.startsWith("cubic-bezier("))continue;const r=this.scopedKeyframes.get(t);r&&(e[n]=r);break}return e.join(" ")})).join(", ")}processAnimationNames(t){return t.split(",").map((t=>{const e=t.trim();return this.scopedKeyframes.get(e)||e})).join(", ")}addScopeToSelector(t){return t.trim()?t.split(",").map((t=>t.trim())).map((t=>this.addScopeToSingleSelector(t))).join(", "):t}addScopeToSingleSelector(t){if(!t.trim())return t;if(t.includes("::")){const e=t.split("::"),n=e[0],r="::"+e.slice(1).join("::");return this.addScopeToSelectorPart(n)+r}if(t.includes(":")&&!t.includes("::")){const e=t.match(/^([^:]+)(:.+)$/);if(e){const t=e[1],n=e[2];return this.addScopeToSelectorPart(t)+n}}return"*"===t||t.startsWith("@")?t:this.addScopeToSelectorPart(t)}addScopeToSelectorPart(t){const e=/(\s*[>+~]\s*|\s+)/;if(e.test(t)){const n=t.split(e);if(/^body(?:$|[:\[ ])/.test(n[0]))return n[0]=this.scopeBody+n[0].slice(4),n.join("");if(/^:root(?:$|[:\[ ])/.test(n[0]))return n[0]=this.scopeBody+n[0].slice(5),n.join("");for(let t=n.length-1;t>=0;t--)if(n[t].trim()&&!e.test(n[t])){let e=n[t].trim();n[t]=/^body(?:$|[:\[ ])/.test(e)?this.scopeBody+e.slice(4):/^:root(?:$:[$:\[ ])/.test(e)?this.scopeBody+e.slice(5):n[t].trim()+this.scopeAttribute;break}return n.join("")}let n=(t=t.trim()).trim();return/^body(?:$|[:\[ ])/.test(n)?this.scopeBody+n.slice(4):/^:root(?:$:[$:\[ ])/.test(n)?this.scopeBody+n.slice(5):n+this.scopeAttribute}findMatchingBrace(t,e){let n=e,r="",o=0;for(;n<t.length;){if(r+=t[n],"{"===t[n])o++;else if("}"===t[n]&&(o--,0===o)){n++;break}n++}return{content:r,endIndex:n}}};class A{constructor(){this.events={}}on(t,e,n=null){if("function"!=typeof e)throw Error("\u56de\u8c03\u51fd\u6570\u5fc5\u987b\u662f\u4e00\u4e2a\u51fd\u6570");this.events[t]||(this.events[t]=[]);const r={callback:e,context:n};return this.events[t].push(r),()=>this.off(t,e,n)}once(t,e,n=null){const r=(...o)=>{this.off(t,r,n),e.apply(n,o)};return this.on(t,r,n)}off(t,e=null,n=null){this.events[t]&&(e?(this.events[t]=this.events[t].filter((t=>!(t.callback===e&&t.context===n))),0===this.events[t].length&&delete this.events[t]):delete this.events[t])}emit(t,...e){this.events[t]&&[...this.events[t]].forEach((t=>{try{t.callback.apply(t.context,e)}catch(n){}}))}listenerCount(t){return this.events[t]?this.events[t].length:0}eventNames(){return Object.keys(this.events)}removeAllListeners(){this.events={}}hasListeners(t){return this.listenerCount(t)>0}}function T(t,e){return function(){return t.apply(e,arguments)}}const{toString:$}=Object.prototype,{getPrototypeOf:N}=Object,{iterator:M,toStringTag:P}=Symbol,C=(L=Object.create(null),t=>{const e=$.call(t);return L[e]||(L[e]=e.slice(8,-1).toLowerCase())});var L;const U=t=>(t=t.toLowerCase(),e=>C(e)===t),F=t=>e=>typeof e===t,{isArray:D}=Array,q=F("undefined"),I=U("ArrayBuffer"),_=F("string"),B=F("function"),z=F("number"),H=t=>null!==t&&"object"==typeof t,W=t=>{if("object"!==C(t))return!1;const e=N(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||P in t||M in t)},J=U("Date"),K=U("File"),V=U("Blob"),X=U("FileList"),Z=U("URLSearchParams"),[G,Y,Q,tt]=["ReadableStream","Request","Response","Headers"].map(U);function et(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,o;if("object"!=typeof t&&(t=[t]),D(t))for(r=0,o=t.length;o>r;r++)e.call(null,t[r],r,t);else{const o=n?Object.getOwnPropertyNames(t):Object.keys(t),s=o.length;let i;for(r=0;s>r;r++)i=o[r],e.call(null,t[i],i,t)}}function nt(t,e){e=e.toLowerCase();const n=Object.keys(t);let r,o=n.length;for(;o-- >0;)if(r=n[o],e===r.toLowerCase())return r;return null}const rt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ot=t=>!q(t)&&t!==rt,st=(it="undefined"!=typeof Uint8Array&&N(Uint8Array),t=>it&&t instanceof it);var it;const ct=U("HTMLFormElement"),ut=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),at=U("RegExp"),lt=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};et(n,((n,o)=>{let s;!1!==(s=e(n,o,t))&&(r[o]=s||n)})),Object.defineProperties(t,r)},ft=U("AsyncFunction"),ht=(dt="function"==typeof setImmediate,pt=B(rt.postMessage),dt?setImmediate:pt?(mt="axios@"+Math.random(),yt=[],rt.addEventListener("message",(({source:t,data:e})=>{t===rt&&e===mt&&yt.length&&yt.shift()()}),!1),t=>{yt.push(t),rt.postMessage(mt,"*")}):t=>setTimeout(t));var dt,pt,mt,yt;const wt="undefined"!=typeof queueMicrotask?queueMicrotask.bind(rt):"undefined"!=typeof process&&process.nextTick||ht,bt={isArray:D,isArrayBuffer:I,isBuffer:function(t){return null!==t&&!q(t)&&null!==t.constructor&&!q(t.constructor)&&B(t.constructor.isBuffer)&&t.constructor.isBuffer(t)},isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||B(t.append)&&("formdata"===(e=C(t))||"object"===e&&B(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&I(t.buffer),e},isString:_,isNumber:z,isBoolean:t=>!0===t||!1===t,isObject:H,isPlainObject:W,isReadableStream:G,isRequest:Y,isResponse:Q,isHeaders:tt,isUndefined:q,isDate:J,isFile:K,isBlob:V,isRegExp:at,isFunction:B,isStream:t=>H(t)&&B(t.pipe),isURLSearchParams:Z,isTypedArray:st,isFileList:X,forEach:et,merge:function t(){const{caseless:e}=ot(this)&&this||{},n={},r=(r,o)=>{const s=e&&nt(n,o)||o;W(n[s])&&W(r)?n[s]=t(n[s],r):W(r)?n[s]=t({},r):D(r)?n[s]=r.slice():n[s]=r};for(let o=0,s=arguments.length;s>o;o++)arguments[o]&&et(arguments[o],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(et(e,((e,r)=>{n&&B(e)?t[r]=T(e,n):t[r]=e}),{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let o,s,i;const c={};if(e=e||{},null==t)return e;do{for(o=Object.getOwnPropertyNames(t),s=o.length;s-- >0;)i=o[s],r&&!r(i,t,e)||c[i]||(e[i]=t[i],c[i]=!0);t=!1!==n&&N(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:C,kindOfTest:U,endsWith:(t,e,n)=>{t+="",(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(D(t))return t;let e=t.length;if(!z(e))return null;const n=Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[M]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:ct,hasOwnProperty:ut,hasOwnProp:ut,reduceDescriptors:lt,freezeMethods:t=>{lt(t,((e,n)=>{if(B(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];B(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach((t=>{n[t]=!0}))};return D(t)?r(t):r((t+"").split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(t,e,n){return e.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:nt,global:rt,isContextDefined:ot,isSpecCompliantForm:function(t){return!!(t&&B(t.append)&&"FormData"===t[P]&&t[M])},toJSONObject:t=>{const e=[,,,,,,,,,,],n=(t,r)=>{if(H(t)){if(e.indexOf(t)>=0)return;if(!("toJSON"in t)){e[r]=t;const o=D(t)?[]:{};return et(t,((t,e)=>{const s=n(t,r+1);!q(s)&&(o[e]=s)})),e[r]=void 0,o}}return t};return n(t,0)},isAsyncFn:ft,isThenable:t=>t&&(H(t)||B(t))&&B(t.then)&&B(t.catch),setImmediate:ht,asap:wt,isIterable:t=>null!=t&&B(t[M])};function gt(t,e,n,r,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=Error().stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),o&&(this.response=o,this.status=o.status?o.status:null)}bt.inherits(gt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:bt.toJSONObject(this.config),code:this.code,status:this.status}}});const vt=gt.prototype,xt={};function Rt(t){return bt.isPlainObject(t)||bt.isArray(t)}function Ot(t){return bt.endsWith(t,"[]")?t.slice(0,-2):t}function kt(t,e,n){return t?t.concat(e).map((function(t,e){return t=Ot(t),!n&&e?"["+t+"]":t})).join(n?".":""):e}["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((t=>{xt[t]={value:t}})),Object.defineProperties(gt,xt),Object.defineProperty(vt,"isAxiosError",{value:!0}),gt.from=(t,e,n,r,o,s)=>{const i=Object.create(vt);return bt.toFlatObject(t,i,(function(t){return t!==Error.prototype}),(t=>"isAxiosError"!==t)),gt.call(i,t.message,e,n,r,o),i.cause=t,i.name=t.name,s&&Object.assign(i,s),i};const St=bt.toFlatObject(bt,{},null,(function(t){return/^is[A-Z]/.test(t)}));function jt(t,e,n){if(!bt.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=bt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(t,e){return!bt.isUndefined(e[t])}))).metaTokens,o=n.visitor||a,s=n.dots,i=n.indexes,c=(n.Blob||"undefined"!=typeof Blob&&Blob)&&bt.isSpecCompliantForm(e);if(!bt.isFunction(o))throw new TypeError("visitor must be a function");function u(t){if(null===t)return"";if(bt.isDate(t))return t.toISOString();if(bt.isBoolean(t))return t.toString();if(!c&&bt.isBlob(t))throw new gt("Blob is not supported. Use a Buffer instead.");return bt.isArrayBuffer(t)||bt.isTypedArray(t)?c&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function a(t,n,o){let c=t;if(t&&!o&&"object"==typeof t)if(bt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(bt.isArray(t)&&function(t){return bt.isArray(t)&&!t.some(Rt)}(t)||(bt.isFileList(t)||bt.endsWith(n,"[]"))&&(c=bt.toArray(t)))return n=Ot(n),c.forEach((function(t,r){!bt.isUndefined(t)&&null!==t&&e.append(!0===i?kt([n],r,s):null===i?n:n+"[]",u(t))})),!1;return!!Rt(t)||(e.append(kt(o,n,s),u(t)),!1)}const l=[],f=Object.assign(St,{defaultVisitor:a,convertValue:u,isVisitable:Rt});if(!bt.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!bt.isUndefined(n)){if(-1!==l.indexOf(n))throw Error("Circular reference detected in "+r.join("."));l.push(n),bt.forEach(n,(function(n,s){!0===(!(bt.isUndefined(n)||null===n)&&o.call(e,n,bt.isString(s)?s.trim():s,r,f))&&t(n,r?r.concat(s):[s])})),l.pop()}}(t),e}function Et(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,(function(t){return e[t]}))}function At(t,e){this.i=[],t&&jt(t,this,e)}const Tt=At.prototype;function $t(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nt(t,e,n){if(!e)return t;const r=n&&n.encode||$t;bt.isFunction(n)&&(n={serialize:n});const o=n&&n.serialize;let s;if(s=o?o(e,n):bt.isURLSearchParams(e)?e.toString():new At(e,n).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}Tt.append=function(t,e){this.i.push([t,e])},Tt.toString=function(t){const e=t?function(e){return t.call(this,e,Et)}:Et;return this.i.map((function(t){return e(t[0])+"="+e(t[1])}),"").join("&")};const Mt=class{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){bt.forEach(this.handlers,(function(e){null!==e&&t(e)}))}},Pt={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Ct={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:At,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]},Lt="undefined"!=typeof window&&"undefined"!=typeof document,Ut="object"==typeof navigator&&navigator||void 0,Ft=Lt&&(!Ut||0>["ReactNative","NativeScript","NS"].indexOf(Ut.product)),Dt="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,qt=Lt&&window.location.href||"http://localhost",It={...Object.freeze({__proto__:null,hasBrowserEnv:Lt,hasStandardBrowserWebWorkerEnv:Dt,hasStandardBrowserEnv:Ft,navigator:Ut,origin:qt}),...Ct};function _t(t){function e(t,n,r,o){let s=t[o++];if("__proto__"===s)return!0;const i=Number.isFinite(+s),c=o>=t.length;return s=!s&&bt.isArray(r)?r.length:s,c?(bt.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!i):(r[s]&&bt.isObject(r[s])||(r[s]=[]),e(t,n,r[s],o)&&bt.isArray(r[s])&&(r[s]=function(t){const e={},n=Object.keys(t);let r;const o=n.length;let s;for(r=0;o>r;r++)s=n[r],e[s]=t[s];return e}(r[s])),!i)}if(bt.isFormData(t)&&bt.isFunction(t.entries)){const n={};return bt.forEachEntry(t,((t,r)=>{e(function(t){return bt.matchAll(/\w+|\[(\w*)]/g,t).map((t=>"[]"===t[0]?"":t[1]||t[0]))}(t),r,n,0)})),n}return null}const Bt={transitional:Pt,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,o=bt.isObject(t);if(o&&bt.isHTMLForm(t)&&(t=new FormData(t)),bt.isFormData(t))return r?JSON.stringify(_t(t)):t;if(bt.isArrayBuffer(t)||bt.isBuffer(t)||bt.isStream(t)||bt.isFile(t)||bt.isBlob(t)||bt.isReadableStream(t))return t;if(bt.isArrayBufferView(t))return t.buffer;if(bt.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(o){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return jt(t,new It.classes.URLSearchParams,Object.assign({visitor:function(t,e,n,r){return It.isNode&&bt.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},e))}(t,this.formSerializer).toString();if((s=bt.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return jt(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return o||r?(e.setContentType("application/json",!1),function(t){if(bt.isString(t))try{return(0,JSON.parse)(t),bt.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(0,JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Bt.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(bt.isResponse(t)||bt.isReadableStream(t))return t;if(t&&bt.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw gt.from(t,gt.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:It.classes.FormData,Blob:It.classes.Blob},validateStatus:function(t){return t>=200&&300>t},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};bt.forEach(["delete","get","head","post","put","patch"],(t=>{Bt.headers[t]={}}));const zt=Bt,Ht=bt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),Wt=Symbol("internals");function Jt(t){return t&&(t+"").trim().toLowerCase()}function Kt(t){return!1===t||null==t?t:bt.isArray(t)?t.map(Kt):t+""}function Vt(t,e,n,r,o){return bt.isFunction(r)?r.call(this,e,n):(o&&(e=n),bt.isString(e)?bt.isString(r)?-1!==e.indexOf(r):bt.isRegExp(r)?r.test(e):void 0:void 0)}class Xt{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function o(t,e,n){const o=Jt(e);if(!o)throw Error("header name must be a non-empty string");const s=bt.findKey(r,o);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||e]=Kt(t))}const s=(t,e)=>bt.forEach(t,((t,n)=>o(t,n,e)));if(bt.isPlainObject(t)||t instanceof this.constructor)s(t,e);else if(bt.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))s((t=>{const e={};let n,r,o;return t&&t.split("\n").forEach((function(t){o=t.indexOf(":"),n=t.substring(0,o).trim().toLowerCase(),r=t.substring(o+1).trim(),!n||e[n]&&Ht[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)})),e})(t),e);else if(bt.isObject(t)&&bt.isIterable(t)){let n,r,o={};for(const e of t){if(!bt.isArray(e))throw TypeError("Object iterator must return a key-value pair");o[r=e[0]]=(n=o[r])?bt.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}s(o,e)}else null!=t&&o(e,t,n);return this}get(t,e){if(t=Jt(t)){const n=bt.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(bt.isFunction(e))return e.call(this,t,n);if(bt.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Jt(t)){const n=bt.findKey(this,t);return!(!n||void 0===this[n]||e&&!Vt(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function o(t){if(t=Jt(t)){const o=bt.findKey(n,t);!o||e&&!Vt(0,n[o],o,e)||(delete n[o],r=!0)}}return bt.isArray(t)?t.forEach(o):o(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const o=e[n];t&&!Vt(0,this[o],o,t,!0)||(delete this[o],r=!0)}return r}normalize(t){const e=this,n={};return bt.forEach(this,((r,o)=>{const s=bt.findKey(n,o);if(s)return e[s]=Kt(r),void delete e[o];const i=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((t,e,n)=>e.toUpperCase()+n))}(o):(o+"").trim();i!==o&&delete e[o],e[i]=Kt(r),n[i]=!0})),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return bt.forEach(this,((n,r)=>{null!=n&&!1!==n&&(e[r]=t&&bt.isArray(n)?n.join(", "):n)})),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([t,e])=>t+": "+e)).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach((t=>n.set(t))),n}static accessor(t){const e=(this[Wt]=this[Wt]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Jt(t);e[r]||(function(t,e){const n=bt.toCamelCase(" "+e);["get","set","has"].forEach((r=>{Object.defineProperty(t,r+n,{value:function(t,n,o){return this[r].call(this,e,t,n,o)},configurable:!0})}))}(n,t),e[r]=!0)}return bt.isArray(t)?t.forEach(r):r(t),this}}Xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),bt.reduceDescriptors(Xt.prototype,(({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}})),bt.freezeMethods(Xt);const Zt=Xt;function Gt(t,e){const n=this||zt,r=e||n,o=Zt.from(r.headers);let s=r.data;return bt.forEach(t,(function(t){s=t.call(n,s,o.normalize(),e?e.status:void 0)})),o.normalize(),s}function Yt(t){return!(!t||!t.u)}function Qt(t,e,n){gt.call(this,t??"canceled",gt.ERR_CANCELED,e,n),this.name="CanceledError"}function te(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new gt("Request failed with status code "+n.status,[gt.ERR_BAD_REQUEST,gt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}bt.inherits(Qt,gt,{u:!0});const ee=(t,e,n=3)=>{let r=0;const o=function(t,e){const n=Array(t=t||10),r=Array(t);let o,s=0,i=0;return e=void 0!==e?e:1e3,function(c){const u=Date.now(),a=r[i];o||(o=u),n[s]=c,r[s]=u;let l=i,f=0;for(;l!==s;)f+=n[l++],l%=t;if(s=(s+1)%t,s===i&&(i=(i+1)%t),e>u-o)return;const h=a&&u-a;return h?Math.round(1e3*f/h):void 0}}(50,250);return function(t,e){let n,r,o=0,s=1e3/e;const i=(e,s=Date.now())=>{o=s,n=null,r&&(clearTimeout(r),r=null),t.apply(null,e)};return[(...t)=>{const e=Date.now(),c=e-o;s>c?(n=t,r||(r=setTimeout((()=>{r=null,i(n)}),s-c))):i(t,e)},()=>n&&i(n)]}((n=>{const s=n.loaded,i=n.lengthComputable?n.total:void 0,c=s-r,u=o(c);r=s,t({loaded:s,total:i,progress:i?s/i:void 0,bytes:c,rate:u||void 0,estimated:u&&i&&i>=s?(i-s)/u:void 0,event:n,lengthComputable:null!=i,[e?"download":"upload"]:!0})}),n)},ne=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},re=t=>(...e)=>bt.asap((()=>t(...e))),oe=It.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,It.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(It.origin),It.navigator&&/(msie|trident)/i.test(It.navigator.userAgent)):()=>!0,se=It.hasStandardBrowserEnv?{write(t,e,n,r,o,s){const i=[t+"="+encodeURIComponent(e)];bt.isNumber(n)&&i.push("expires="+new Date(n).toGMTString()),bt.isString(r)&&i.push("path="+r),bt.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(t){const e=document.cookie.match(RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ie(t,e,n){return!t||/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)&&0!=n?e:function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e)}const ce=t=>t instanceof Zt?{...t}:t;function ue(t,e){e=e||{};const n={};function r(t,e,n,r){return bt.isPlainObject(t)&&bt.isPlainObject(e)?bt.merge.call({caseless:r},t,e):bt.isPlainObject(e)?bt.merge({},e):bt.isArray(e)?e.slice():e}function o(t,e,n,o){return bt.isUndefined(e)?bt.isUndefined(t)?void 0:r(void 0,t,0,o):r(t,e,0,o)}function s(t,e){if(!bt.isUndefined(e))return r(void 0,e)}function i(t,e){return bt.isUndefined(e)?bt.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function c(n,o,s){return s in e?r(n,o):s in t?r(void 0,n):void 0}const u={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:c,headers:(t,e,n)=>o(ce(t),ce(e),0,!0)};return bt.forEach(Object.keys(Object.assign({},t,e)),(function(r){const s=u[r]||o,i=s(t[r],e[r],r);bt.isUndefined(i)&&s!==c||(n[r]=i)})),n}const ae=t=>{const e=ue({},t);let n,{data:r,withXSRFToken:o,xsrfHeaderName:s,xsrfCookieName:i,headers:c,auth:u}=e;if(e.headers=c=Zt.from(c),e.url=Nt(ie(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),u&&c.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),bt.isFormData(r))if(It.hasStandardBrowserEnv||It.hasStandardBrowserWebWorkerEnv)c.setContentType(void 0);else if(!1!==(n=c.getContentType())){const[t,...e]=n?n.split(";").map((t=>t.trim())).filter(Boolean):[];c.setContentType([t||"multipart/form-data",...e].join("; "))}if(It.hasStandardBrowserEnv&&(o&&bt.isFunction(o)&&(o=o(e)),o||!1!==o&&oe(e.url))){const t=s&&i&&se.read(i);t&&c.set(s,t)}return e},le="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise((function(e,n){const r=ae(t);let o=r.data;const s=Zt.from(r.headers).normalize();let i,c,u,a,l,{responseType:f,onUploadProgress:h,onDownloadProgress:d}=r;function p(){a&&a(),l&&l(),r.cancelToken&&r.cancelToken.unsubscribe(i),r.signal&&r.signal.removeEventListener("abort",i)}let m=new XMLHttpRequest;function y(){if(!m)return;const r=Zt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());te((function(t){e(t),p()}),(function(t){n(t),p()}),{data:f&&"text"!==f&&"json"!==f?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:t,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=y:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(y)},m.onabort=function(){m&&(n(new gt("Request aborted",gt.ECONNABORTED,t,m)),m=null)},m.onerror=function(){n(new gt("Network Error",gt.ERR_NETWORK,t,m)),m=null},m.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const o=r.transitional||Pt;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new gt(e,o.clarifyTimeoutError?gt.ETIMEDOUT:gt.ECONNABORTED,t,m)),m=null},void 0===o&&s.setContentType(null),"setRequestHeader"in m&&bt.forEach(s.toJSON(),(function(t,e){m.setRequestHeader(e,t)})),bt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),f&&"json"!==f&&(m.responseType=r.responseType),d&&([u,l]=ee(d,!0),m.addEventListener("progress",u)),h&&m.upload&&([c,a]=ee(h),m.upload.addEventListener("progress",c),m.upload.addEventListener("loadend",a)),(r.cancelToken||r.signal)&&(i=e=>{m&&(n(!e||e.type?new Qt(null,t,m):e),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(i),r.signal&&(r.signal.aborted?i():r.signal.addEventListener("abort",i)));const w=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);w&&-1===It.protocols.indexOf(w)?n(new gt("Unsupported protocol "+w+":",gt.ERR_BAD_REQUEST,t)):m.send(o||null)}))},fe=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const o=function(t){if(!n){n=!0,i();const e=t instanceof Error?t:this.reason;r.abort(e instanceof gt?e:new Qt(e instanceof Error?e.message:e))}};let s=e&&setTimeout((()=>{s=null,o(new gt(`timeout ${e} of ms exceeded`,gt.ETIMEDOUT))}),e);const i=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach((t=>{t.unsubscribe?t.unsubscribe(o):t.removeEventListener("abort",o)})),t=null)};t.forEach((t=>t.addEventListener("abort",o)));const{signal:c}=r;return c.unsubscribe=()=>bt.asap(i),c}},he=function*(t,e){let n=t.byteLength;if(e>n)return void(yield t);let r,o=0;for(;n>o;)r=o+e,yield t.slice(o,r),o=r},de=(t,e,n,r)=>{const o=async function*(t,e){for await(const n of async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}}(t))yield*he(n,e)}(t,e);let s,i=0,c=t=>{s||(s=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await o.next();if(e)return c(),void t.close();let s=r.byteLength;if(n){let t=i+=s;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw c(t),t}},cancel:t=>(c(t),o.return())},{highWaterMark:2})},pe="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,me=pe&&"function"==typeof ReadableStream,ye=pe&&("function"==typeof TextEncoder?(we=new TextEncoder,t=>we.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var we;const be=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},ge=me&&be((()=>{let t=!1;const e=new Request(It.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e})),ve=me&&be((()=>bt.isReadableStream(new Response("").body))),xe={stream:ve&&(t=>t.body)};var Re;pe&&(Re=new Response,["text","arrayBuffer","blob","formData","stream"].forEach((t=>{!xe[t]&&(xe[t]=bt.isFunction(Re[t])?e=>e[t]():(e,n)=>{throw new gt(`Response type '${t}' is not supported`,gt.ERR_NOT_SUPPORT,n)})})));const Oe={http:null,xhr:le,fetch:pe&&(async t=>{let{url:e,method:n,data:r,signal:o,cancelToken:s,timeout:i,onDownloadProgress:c,onUploadProgress:u,responseType:a,headers:l,withCredentials:f="same-origin",fetchOptions:h}=ae(t);a=a?(a+"").toLowerCase():"text";let d,p=fe([o,s&&s.toAbortSignal()],i);const m=p&&p.unsubscribe&&(()=>{p.unsubscribe()});let y;try{if(u&&ge&&"get"!==n&&"head"!==n&&0!==(y=await(async(t,e)=>bt.toFiniteNumber(t.getContentLength())??(async t=>{if(null==t)return 0;if(bt.isBlob(t))return t.size;if(bt.isSpecCompliantForm(t)){const e=new Request(It.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return bt.isArrayBufferView(t)||bt.isArrayBuffer(t)?t.byteLength:(bt.isURLSearchParams(t)&&(t+=""),bt.isString(t)?(await ye(t)).byteLength:void 0)})(e))(l,r))){let t,n=new Request(e,{method:"POST",body:r,duplex:"half"});if(bt.isFormData(r)&&(t=n.headers.get("content-type"))&&l.setContentType(t),n.body){const[t,e]=ne(y,ee(re(u)));r=de(n.body,65536,t,e)}}bt.isString(f)||(f=f?"include":"omit");const o="credentials"in Request.prototype;d=new Request(e,{...h,signal:p,method:n.toUpperCase(),headers:l.normalize().toJSON(),body:r,duplex:"half",credentials:o?f:void 0});let s=await fetch(d,h);const i=ve&&("stream"===a||"response"===a);if(ve&&(c||i&&m)){const t={};["status","statusText","headers"].forEach((e=>{t[e]=s[e]}));const e=bt.toFiniteNumber(s.headers.get("content-length")),[n,r]=c&&ne(e,ee(re(c),!0))||[];s=new Response(de(s.body,65536,n,(()=>{r&&r(),m&&m()})),t)}a=a||"text";let w=await xe[bt.findKey(xe,a)||"text"](s,t);return!i&&m&&m(),await new Promise(((e,n)=>{te(e,n,{data:w,headers:Zt.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:d})}))}catch(e){if(m&&m(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new gt("Network Error",gt.ERR_NETWORK,t,d),{cause:e.cause||e});throw gt.from(e,e&&e.code,t,d)}})};bt.forEach(Oe,((t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}}));const ke=t=>"- "+t,Se=t=>bt.isFunction(t)||null===t||!1===t,je=t=>{t=bt.isArray(t)?t:[t];const{length:e}=t;let n,r;const o={};for(let s=0;e>s;s++){let e;if(n=t[s],r=n,!Se(n)&&(r=Oe[(e=n+"").toLowerCase()],void 0===r))throw new gt(`Unknown adapter '${e}'`);if(r)break;o[e||"#"+s]=r}if(!r){const t=Object.entries(o).map((([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build")));throw new gt("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(ke).join("\n"):" "+ke(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Ee(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new Qt(null,t)}function Ae(t){return Ee(t),t.headers=Zt.from(t.headers),t.data=Gt.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1),je(t.adapter||zt.adapter)(t).then((function(e){return Ee(t),e.data=Gt.call(t,t.transformResponse,e),e.headers=Zt.from(e.headers),e}),(function(e){return Yt(e)||(Ee(t),e&&e.response&&(e.response.data=Gt.call(t,t.transformResponse,e.response),e.response.headers=Zt.from(e.response.headers))),Promise.reject(e)}))}const Te={};["object","boolean","number","function","string","symbol"].forEach(((t,e)=>{Te[t]=function(n){return typeof n===t||"a"+(1>e?"n ":" ")+t}}));const $e={};Te.transitional=function(t,e,n){function r(t,e){return"[Axios v1.10.0] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,o,s)=>{if(!1===t)throw new gt(r(o," has been removed"+(e?" in "+e:"")),gt.ERR_DEPRECATED);return e&&!$e[o]&&($e[o]=!0),!t||t(n,o,s)}},Te.spelling=function(t){return(t,e)=>!0};const Ne={assertOptions:function(t,e,n){if("object"!=typeof t)throw new gt("options must be an object",gt.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let o=r.length;for(;o-- >0;){const s=r[o],i=e[s];if(i){const e=t[s],n=void 0===e||i(e,s,t);if(!0!==n)throw new gt("option "+s+" must be "+n,gt.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new gt("Unknown option "+s,gt.ERR_BAD_OPTION)}},validators:Te},Me=Ne.validators;class Pe{constructor(t){this.defaults=t||{},this.interceptors={request:new Mt,response:new Mt}}async request(t,e){try{return await this.l(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=Error();const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!(t.stack+"").endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}l(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=ue(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:o}=e;void 0!==n&&Ne.assertOptions(n,{silentJSONParsing:Me.transitional(Me.boolean),forcedJSONParsing:Me.transitional(Me.boolean),clarifyTimeoutError:Me.transitional(Me.boolean)},!1),null!=r&&(bt.isFunction(r)?e.paramsSerializer={serialize:r}:Ne.assertOptions(r,{encode:Me.function,serialize:Me.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Ne.assertOptions(e,{baseUrl:Me.spelling("baseURL"),withXsrfToken:Me.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=o&&bt.merge(o.common,o[e.method]);o&&bt.forEach(["delete","get","head","post","put","patch","common"],(t=>{delete o[t]})),e.headers=Zt.concat(s,o);const i=[];let c=!0;this.interceptors.request.forEach((function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(c=c&&t.synchronous,i.unshift(t.fulfilled,t.rejected))}));const u=[];let a;this.interceptors.response.forEach((function(t){u.push(t.fulfilled,t.rejected)}));let l,f=0;if(!c){const t=[Ae.bind(this),void 0];for(t.unshift.apply(t,i),t.push.apply(t,u),l=t.length,a=Promise.resolve(e);l>f;)a=a.then(t[f++],t[f++]);return a}l=i.length;let h=e;for(f=0;l>f;){const e=i[f++],n=i[f++];try{h=e(h)}catch(t){n.call(this,t);break}}try{a=Ae(h)}catch(t){return Promise.reject(t)}for(f=0,l=u.length;l>f;)a=a.then(u[f++],u[f++]);return a}getUri(t){return Nt(ie((t=ue(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}}bt.forEach(["delete","get","head","options"],(function(t){Pe.prototype[t]=function(e,n){return this.request(ue(n||{},{method:t,url:e,data:(n||{}).data}))}})),bt.forEach(["post","put","patch"],(function(t){function e(e){return function(n,r,o){return this.request(ue(o||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Pe.prototype[t]=e(),Pe.prototype[t+"Form"]=e(!0)}));const Ce=Pe;class Le{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise((function(t){e=t}));const n=this;this.promise.then((t=>{if(!n.h)return;let e=n.h.length;for(;e-- >0;)n.h[e](t);n.h=null})),this.promise.then=t=>{let e;const r=new Promise((t=>{n.subscribe(t),e=t})).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t((function(t,r,o){n.reason||(n.reason=new Qt(t,r,o),e(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this.h?this.h.push(t):this.h=[t]}unsubscribe(t){if(!this.h)return;const e=this.h.indexOf(t);-1!==e&&this.h.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new Le((function(e){t=e})),cancel:t}}}const Ue=Le,Fe={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fe).forEach((([t,e])=>{Fe[e]=t}));const De=Fe,qe=function t(e){const n=new Ce(e),r=T(Ce.prototype.request,n);return bt.extend(r,Ce.prototype,n,{allOwnKeys:!0}),bt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(ue(e,n))},r}(zt);qe.Axios=Ce,qe.CanceledError=Qt,qe.CancelToken=Ue,qe.isCancel=Yt,qe.VERSION="1.10.0",qe.toFormData=jt,qe.AxiosError=gt,qe.Cancel=qe.CanceledError,qe.all=function(t){return Promise.all(t)},qe.spread=function(t){return function(e){return t.apply(null,e)}},qe.isAxiosError=function(t){return bt.isObject(t)&&!0===t.isAxiosError},qe.mergeConfig=ue,qe.AxiosHeaders=Zt,qe.formToJSON=t=>_t(bt.isHTMLForm(t)?new FormData(t):t),qe.getAdapter=je,qe.HttpStatusCode=De,qe.default=qe;const Ie=qe,{Axios:_e,AxiosError:Be,CanceledError:ze,isCancel:He,CancelToken:We,VERSION:Je,all:Ke,Cancel:Ve,isAxiosError:Xe,spread:Ze,toFormData:Ge,AxiosHeaders:Ye,HttpStatusCode:Qe,formToJSON:tn,getAdapter:en,mergeConfig:nn}=Ie;class rn{constructor(t){this.p=t||{locale:"zh-CN",fallback:"en-US"},this.messages=b({}),this.m=new Map}get locale(){return this.p.locale}set locale(t){this.p.locale=t}get fallback(){return this.p.fallback}setLocale(t){return this.p.locale===t||(this.p.locale=t,document.documentElement.lang=t,this.m.clear()),this}getLocale(){return this.p.locale}load(t,e=!0){return t=t||{},e?Object.keys(t).forEach((e=>{this.messages[e]||(this.messages[e]={}),Object.keys(t[e]||{}).forEach((n=>{this.messages[e][n]=t[e][n]}))})):(Object.keys(this.messages).forEach((t=>delete this.messages[t])),Object.keys(t).forEach((e=>{this.messages[e]=t[e]||{}}))),this}t(t,e={}){const{locale:n=this.locale,fallback:r=this.fallback,count:o,...s}=e,i=void 0===o?s:{...s,count:o};let c=this.messages[n]?.[t]||this.messages[r]?.[t]||t;return void 0!==o&&"object"==typeof c&&(c=0===o&&c.zero?c.zero:1===o&&c.one?c.one:c.other||c.one||t),"string"!=typeof c?t:(Object.keys(i).forEach((t=>{c=c.replace(RegExp(`{{?${t}}}?`,"g"),i[t])})),c)}d(t,e={}){const{locale:n=this.locale,...r}=e,o=`d:${n}:${JSON.stringify(r)}`;this.m.has(o)||this.m.set(o,new Intl.DateTimeFormat(n,{year:"numeric",month:"short",day:"numeric",...r}));const s="string"==typeof t?new Date(t):t;return this.m.get(o).format(s)}n(t,e={}){const{locale:n=this.locale,...r}=e,o=`n:${n}:${JSON.stringify(r)}`;return this.m.has(o)||this.m.set(o,new Intl.NumberFormat(n,{minimumFractionDigits:0,maximumFractionDigits:2,...r})),this.m.get(o).format(t)}c(t,e="CNY",n={}){return this.n(t,{style:"currency",currency:e,...n})}rtf(t,e="day",n={}){const{locale:r=this.locale,...o}=n,s=`rtf:${r}:${JSON.stringify(o)}`;return this.m.has(s)||this.m.set(s,new Intl.RelativeTimeFormat(r,{numeric:"auto",...o})),this.m.get(s).format(t,e)}has(t,e=this.locale){const n=this.messages[e]?.[t];return!(void 0===n||"object"==typeof n&&null!==n&&!Array.isArray(n)&&void 0===n.one&&void 0===n.other)}getLocales(){return Object.keys(this.messages)}}const on="vhtml-message-style";class sn{constructor(){this.container=null,this.messageTimers=new WeakMap}ensureReady(){return!("undefined"==typeof document||!document.head||!document.body||(this.ensureStyle(),this.ensureContainer(),0))}ensureStyle(){if(document.getElementById(on))return;const t=document.createElement("style");t.id=on,t.textContent="\n .vmsg-container {\n position: fixed;\n top: 60px;\n left: 50%;\n transform: translateX(-50%);\n z-index: 9999;\n width: min(300px, calc(100vw - 32px));\n }\n\n .vmsg-item {\n margin-bottom: 10px;\n padding: 15px;\n border-radius: 4px;\n box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);\n transform: translateY(100%);\n opacity: 0;\n transition: all 0.3s ease;\n display: flex;\n align-items: flex-start;\n }\n\n .vmsg-item.show {\n transform: translateY(0);\n opacity: 1;\n }\n\n .vmsg-icon {\n margin-right: 10px;\n font-size: 16px;\n line-height: 1;\n }\n\n .vmsg-content {\n flex: 1;\n font-size: 14px;\n line-height: 1.4;\n }\n\n .vmsg-close {\n margin-left: 10px;\n cursor: pointer;\n font-size: 16px;\n opacity: 0.7;\n transition: opacity 0.2s;\n }\n\n .vmsg-close:hover {\n opacity: 1;\n }\n\n .vmsg-success {\n background-color: #f0f9eb;\n border: 1px solid #e1f3d8;\n color: var(--color-success, #67c23a);\n }\n\n .vmsg-warning {\n background-color: #fdf6ec;\n border: 1px solid #faecd8;\n color: #e6a23c;\n }\n\n .vmsg-error {\n background-color: #fef0f0;\n border: 1px solid #fde2e2;\n color: #f56c6c;\n }\n\n .vmsg-info {\n background-color: #edf2fc;\n border: 1px solid #ebeef5;\n color: #409eff;\n }\n\n .vmsg-overlay {\n position: fixed;\n inset: 0;\n background-color: rgba(0, 0, 0, 0.5);\n z-index: 10000;\n display: flex;\n justify-content: center;\n align-items: center;\n opacity: 0;\n transition: opacity 0.3s ease;\n }\n\n .vmsg-overlay.show {\n opacity: 1;\n }\n\n .vmsg-dialog {\n background: white;\n border-radius: 8px;\n box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);\n min-width: min(400px, calc(100vw - 32px));\n max-width: min(500px, calc(100vw - 32px));\n transform: scale(0.8);\n transition: transform 0.3s ease;\n }\n\n .vmsg-overlay.show .vmsg-dialog {\n transform: scale(1);\n }\n\n .vmsg-header {\n padding: 20px 20px 10px;\n display: flex;\n justify-content: space-between;\n align-items: center;\n border-bottom: 1px solid #eee;\n }\n\n .vmsg-title {\n font-size: 18px;\n font-weight: 500;\n margin: 0;\n }\n\n .vmsg-close-btn {\n cursor: pointer;\n font-size: 20px;\n color: #999;\n border: none;\n background: none;\n padding: 0;\n width: 20px;\n height: 20px;\n display: flex;\n align-items: center;\n justify-content: center;\n }\n\n .vmsg-close-btn:hover {\n color: #666;\n }\n\n .vmsg-body {\n padding: 20px;\n }\n\n .vmsg-prompt-content {\n margin-bottom: 20px;\n font-size: 14px;\n line-height: 1.5;\n color: #333;\n }\n\n .vmsg-input {\n width: 100%;\n padding: 10px 12px;\n border: 1px solid #dcdfe6;\n border-radius: 4px;\n font-size: 14px;\n box-sizing: border-box;\n transition: border-color 0.2s;\n }\n\n .vmsg-input:focus {\n outline: none;\n border-color: #409eff;\n }\n\n .vmsg-footer {\n padding: 15px 20px;\n text-align: right;\n border-top: 1px solid #eee;\n }\n\n .vmsg-btn {\n padding: 8px 16px;\n border: 1px solid #dcdfe6;\n border-radius: 4px;\n font-size: 14px;\n cursor: pointer;\n margin-left: 10px;\n transition: all 0.2s;\n }\n\n .vmsg-btn-cancel {\n background: white;\n color: #606266;\n }\n\n .vmsg-btn-cancel:hover {\n background: #f5f7fa;\n border-color: #c0c4cc;\n }\n\n .vmsg-btn-confirm {\n background: #409eff;\n color: white;\n border-color: #409eff;\n }\n\n .vmsg-btn-confirm:hover {\n background: #66b1ff;\n border-color: #66b1ff;\n }\n",document.head.appendChild(t)}ensureContainer(){return this.container?.isConnected||(this.container=document.createElement("div"),this.container.className="vmsg-container",document.body.appendChild(this.container)),this.container}queue(t){if(this.ensureReady())return t();const e=()=>{window.removeEventListener("DOMContentLoaded",e),t()};return window.addEventListener("DOMContentLoaded",e,{once:!0}),null}schedule(t,e){return window.setTimeout(t,e)}trackTimers(t,e){t&&0!==e.length&&this.messageTimers.set(t,e)}clearTimers(t){const e=this.messageTimers.get(t);e&&(e.forEach((t=>window.clearTimeout(t))),this.messageTimers.delete(t))}}const cn=new class{constructor(t=new sn){this.runtime=t}createMessage(t,e,n={}){return this.runtime.queue((()=>{const{duration:r=3e3,showClose:o=!0,onClose:s=null}=n,i=this.runtime.ensureContainer(),c=document.createElement("div");c.className="vmsg-item vmsg-"+t;const u={success:"\u2713",warning:"\u26a0",error:"\u2715",info:"\u2139"},a=document.createElement("span");a.className="vmsg-icon",a.textContent=u[t]||u.info;const l=document.createElement("div");l.className="vmsg-content",l.textContent=e,c.appendChild(a),c.appendChild(l);let f=!1;const h=()=>{f||(f=!0,this.removeMessage(c),"function"==typeof s&&s())};if(o){const t=document.createElement("span");t.className="vmsg-close",t.innerHTML="×",t.addEventListener("click",h),c.appendChild(t)}i.appendChild(c);const d=[this.runtime.schedule((()=>{c.classList.add("show")}),10)];return r>0&&d.push(this.runtime.schedule(h,r)),this.runtime.trackTimers(c,d),c}))}removeMessage(t){if(!t||!t.parentNode)return;this.runtime.clearTimers(t),t.classList.remove("show");const e=this.runtime.schedule((()=>{t.parentNode&&t.parentNode.removeChild(t)}),300);this.runtime.trackTimers(t,[e])}success(t,e={}){return this.createMessage("success",t,e)}warning(t,e={}){return this.createMessage("warning",t,e)}error(t,e={}){return this.createMessage("error",t,e)}info(t,e={}){return this.createMessage("info",t,e)}v(t,e={}){return new Promise(((n,r)=>{this.runtime.queue((()=>{const{title:o="\u63d0\u793a",type:s="confirm",inputValue:i="",confirmText:c="\u786e\u5b9a",cancelText:u="\u53d6\u6d88",onConfirm:a=null,onCancel:l=null}=e,f=document.createElement("div");f.className="vmsg-overlay";const h=document.createElement("div");h.className="vmsg-dialog";const d=document.createElement("div");d.className="vmsg-header";const p=document.createElement("h3");p.className="vmsg-title",p.textContent=o;const m=document.createElement("button");m.className="vmsg-close-btn",m.innerHTML="×",d.appendChild(p),d.appendChild(m);const y=document.createElement("div");y.className="vmsg-body";const w=document.createElement("div");w.className="vmsg-prompt-content",w.textContent=t,y.appendChild(w);let b=null;"input"===s&&(b=document.createElement("input"),b.className="vmsg-input",b.type="text",b.value=i,y.appendChild(b));const g=document.createElement("div");g.className="vmsg-footer";const v=document.createElement("button");v.className="vmsg-btn vmsg-btn-cancel",v.textContent=u;const x=document.createElement("button");x.className="vmsg-btn vmsg-btn-confirm",x.textContent=c,g.appendChild(v),g.appendChild(x),h.appendChild(d),h.appendChild(y),h.appendChild(g),f.appendChild(h),document.body.appendChild(f);const R=[];let O=!1;const k=t=>{O||(O=!0,f.classList.remove("show"),R.splice(0).forEach((t=>t())),window.setTimeout((()=>{f.remove(),t()}),300))},S=()=>{k((()=>{"function"==typeof l&&l(),r(Error("cancelled"))}))},j=t=>{"Escape"===t.key&&S()};document.addEventListener("keydown",j),R.push((()=>document.removeEventListener("keydown",j))),m.addEventListener("click",S),v.addEventListener("click",S),x.addEventListener("click",(()=>{const t=!b||b.value;k((()=>{n(t),"function"==typeof a&&a(t)}))})),f.addEventListener("click",(t=>{t.target===f&&S()}));const E=this.runtime.schedule((()=>{f.classList.add("show")}),10);if(R.push((()=>window.clearTimeout(E))),b){const t=this.runtime.schedule((()=>{b.focus(),b.select()}),300);R.push((()=>window.clearTimeout(t)))}}))}))}confirm(t,e={}){return this.v(t,{...e,type:"confirm"})}prompt(t,e,n={}){return this.v(t,{...n,type:"input",inputValue:e})}},un=new Set(["scoped","baseURL","origin","$axios","$bus","$i18n","$t"]);function an(t=null){const e=function(t=null){return t&&"object"==typeof t?t.$mod||t:null}(t);return e?.scoped||""}function ln(t){return Ie.create({baseURL:t})}function fn(t=null,e={}){const n=Object.create(t||null);return{}.hasOwnProperty.call(n,"$message")||(n.$message=cn),e&&"object"==typeof e&&Object.assign(n,e),n}function hn(t=null,e={}){return b(e&&"object"==typeof e?{...e}:{},t||void 0)}function dn(t=null,e=null,n={},r={}){const o=t?.$sys||null,s=t?.$ctx||null;return{$sys:fn(o,n),$ctx:hn(s,r),$mod:e||t?.$mod||null}}function pn(t){return t&&"/"!==t?t.endsWith("/")?t.slice(0,-1):t:t||""}function mn(t=""){if(!t)return"";if(/^https?:\/\//.test(t)){const e=new URL(t),n=pn(e.pathname);return`${e.origin}${"/"===n?"":n}`}const e=pn(t);return e?e.startsWith("/")?e:"/"+e:""}function yn(t="",e=""){if(!t)return t;if(t.startsWith("@"))return t.slice(1);if(/^https?:\/\//.test(t))return t;if(!t.startsWith("/"))return t;const n=mn(e);return n?`${n}${t}`:t}function wn(t=""){const e=mn(t);return e?/^https?:\/\//.test(e)?e:`${window.location.origin}${e}`:window.location.origin}const bn=new class{constructor(){this.modMap=new Map,this.wrappers=[],this.sharedLocale=b({locale:localStorage.getItem("i18n_locale")||"zh-CN",fallback:"en-US"}),this.initLocaleWatcher()}initLocaleWatcher(){a((()=>this.sharedLocale.locale),(t=>{localStorage.setItem("i18n_locale",t),document.documentElement.lang=t}))}addWrapper(t){if("function"==typeof t){this.wrappers.push(t);for(const[e,n]of this.modMap.entries())t(e,n)}}clear(){this.modMap.clear(),this.wrappers=[]}async getModule(t=""){const e=mn(t||"");let n=this.modMap.get(e);return n||(n=await this.createModule(e),this.modMap.set(e,n)),n}patchModule(t,e={}){return function(t,e={}){e&&"object"==typeof e&&Object.entries(e).forEach((([e,n])=>{un.has(e)||(t[e]=n)}))}(t,e),t}async createModule(t,e={}){const n=wn(t),r=function(t,e,n,r={}){const o={...r,scoped:t,baseURL:e,origin:window.location.origin,$bus:new A,$i18n:new rn(n)};return o.$t=(t,e={})=>o.$i18n.t(t,e),o.fetch=(e,n)=>{let r=e;return e.startsWith("@")?r=e.slice(1):/^https?:\/\//.test(e)||e.startsWith("//")||(r=e.startsWith("/")?`${t}${e}`:`${t}/${e}`),fetch(r,n)},o}(t,n,this.sharedLocale,{$axios:ln(n)});this.patchModule(r,e),await this.loadEnvConfig(r);for(const o of this.wrappers)o(t,r);return r}async loadEnvConfig(t){const e=wn(t.scoped)+"/env.js";try{const n=await import(e);"function"==typeof n.default&&await n.default(t,this)}catch(n){}}};function gn(t,e=""){return t&&"/"!==t?t.startsWith("@")?t.slice(1):/^https?:\/\//.test(t)?t:t.startsWith("/")?yn(t,e):yn("/"+t,e):yn("/",e)}class vn{constructor(){this.templates=new Map,this.pending=new Map}clear(){this.templates.clear(),this.pending.clear()}}class xn{constructor(){this.loadedLinks=new Set,this.loadedScripts=new Set,this.loadedStyles=new Set}resolveUrl(t,e){return gn(t,e)}loadLink(t,e){const n=this.resolveUrl(t.getAttribute("href"),an(e)),r=t.getAttribute("key")||n;if(!r||this.loadedLinks.has(r))return;this.loadedLinks.add(r);const o=t.cloneNode(!0);o.setAttribute("href",n),document.head.appendChild(o)}async loadScript(t,e){const n=this.resolveUrl(t.getAttribute("src"),an(e)),r=t.getAttribute("key"),o=r||n;if(!o||this.loadedScripts.has(o))return;this.loadedScripts.add(o);const s=document.createElement("script");n&&(s.src=n),r&&s.setAttribute("key",r),s.type=t.getAttribute("type")||"text/javascript",await new Promise(((t,e)=>{s.onload=()=>t(s),s.onerror=()=>e(Error("Failed to load script "+n)),document.head.appendChild(s)}))}loadStyle(t,e){if(!t)return;const n=`${e}::${t}`;if(this.loadedStyles.has(n))return;this.loadedStyles.add(n);const r=document.createElement("style");r.innerHTML=t,r.setAttribute("vref",e),document.head.appendChild(r)}async loadHeads(t,e,n){for(const r of t){const t=r.nodeName.toLowerCase();"link"===t?this.loadLink(r,e):"script"===t?await this.loadScript(r,e):"title"===t&&(n.title=r.innerText)}}}class Rn{constructor(t){this.resourceLoader=t}createDescriptor(t,e,n,r,o){return{url:n,scoped:r,mod:e,heads:Array.from(o.querySelector("head")?.children||[]),body:document.createElement("div"),setup:void 0,scripts:[],styles:"",title:"",txt:t,tmp:o,customAttrs:{},err:null}}processStyles(t){t.tmp.querySelectorAll("style").forEach((e=>{null===e.getAttribute("unscoped")?t.styles+=E.parse(e.innerHTML,t.url):t.styles+=e.innerHTML})),this.resourceLoader.loadStyle(t.styles,t.url)}processBody(t){const e=t.tmp.querySelector("body");e&&(t.body.append(...e.childNodes),Array.from(e.attributes).forEach((e=>{/^[a-zA-Z]/.test(e.name)?t.body.setAttribute(e.name,e.value):t.customAttrs[e.name]=e.value})),t.body.setAttribute("vref",t.url))}processScripts(t){t.body.querySelectorAll("script").forEach((e=>{e.innerHTML.trim()?(e.hasAttribute("setup")?t.setup=e:e.hasAttribute("no-vhtml")||t.scripts.push(e),e.remove()):e.remove()}))}syncRefOwnerId(t,e){("TEMPLATE"===t.nodeName&&t.content?Array.from(t.content.childNodes):Array.from(t.childNodes)).forEach((t=>{1===t.nodeType&&(t.setAttribute("vrefof",e),this.syncRefOwnerId(t,e))}))}async parse(t,e,n,r=!1){const o=(new DOMParser).parseFromString(t,"text/html");if(o.body.hasAttribute("scoped")&&!r)throw Error("HTTP error! status: 404");const s=this.createDescriptor(t,e,n,an(e),o);return this.processStyles(s),this.processBody(s),this.processScripts(s),this.syncRefOwnerId(s.body,n),r||await this.resourceLoader.loadHeads(s.heads,e,s),s}create404Descriptor(t,e,n){const r=document.createElement("div");return r.style.cssText="background:#aaa;height:100%;width:100%;display:grid;place-items:center;",r.innerHTML=`<div style="width:20rem;height:15rem;border-radius:1rem;padding:1rem;background:#cfc0aa;display:grid;place-items:center;"><div style="font-size:2rem">404</div><p>${t}</p></div>`,{url:t,scoped:an(e),mod:e,heads:[],body:r,setup:void 0,scripts:[],styles:"",title:"",txt:"",tmp:null,customAttrs:{},err:n}}}const On=new class{constructor(t=bn){this.moduleManager=t,this.cache=new vn,this.resourceLoader=new xn,this.parser=new Rn(this.resourceLoader)}clear(){this.cache.clear(),this.moduleManager.clear()}addWrapper(t){this.moduleManager.addWrapper(t)}async getModule(t){return this.moduleManager.getModule(t)}readScopedHeaders(t){const e={};for(const[n,r]of t.headers.entries())n.startsWith("vhtml-")&&(e[n.slice(6)]=r);return e}async fetchFile(t){const e=await fetch(t,{headers:{"X-No-Fallback":"1"}});if(!e.ok)throw Error("HTTP error! status: "+e.status);return e.text()}async parseUI(t,e,n,r=!1){const o=n?.endsWith(".html")?n.slice(0,-5):n||"#inline",s=await this.moduleManager.getModule(an(e));return this.parser.parse(t,s,o,r)}async fetchUI(t,e={},n=!1){const r=gn(t,an(e));if(this.cache.templates.has(r))return this.cache.templates.get(r);if(this.cache.pending.has(r))return this.cache.pending.get(r);const o=this.doFetchUI(r,e,n);return this.cache.pending.set(r,o),o.finally((()=>this.cache.pending.delete(r)))}async doFetchUI(t,e={},n=!1){e=e||{};try{let e={};n||(e={headers:{"X-No-Fallback":1}});const r=await fetch(t,e);if(!r.ok)throw Error("HTTP error! status: "+r.status);const o=this.readScopedHeaders(r),s=mn(o.scoped||""),i=await this.moduleManager.getModule(s);this.moduleManager.patchModule(i,o);const c=await r.text(),u=t.endsWith(".html")?t.slice(0,-5):t,a=await this.parser.parse(c,i,u,n);return this.cache.templates.set(t,a),a}catch(r){const e=await this.moduleManager.getModule(""),n=this.parser.create404Descriptor(t,e,r);return this.cache.templates.set(t,n),n}}},kn=/^[a-zA-Z][a-zA-Z\d+.-]*:/;function Sn(t){return!function(t){return kn.test(t)}(t)&&!t.startsWith("//")}const jn=[];document.addEventListener("click",(t=>{jn.forEach((e=>{e?.dom instanceof Element&&"function"==typeof e?.callback&&(e.dom.contains(t.target)||e.callback(t))}))}));const En={CamelToKebabCase:function(t){return 0===t.length?"":t.charAt(0).toLowerCase()+t.slice(1).replace(/([A-Z])/g,(function(t,e){return"-"+e.toLowerCase()}))},EventsList:["load","unload","beforeunload","resize","scroll","submit","reset","input","change","focus","blur","keydown","keypress","keyup","click","dblclick","contextmenu","mousedown","mouseup","mousemove","mouseover","mouseout","mouseenter","mouseleave","touchstart","touchmove","touchend","touchcancel","drag","dragstart","dragend","dragover","dragenter","dragleave","drop","copy","cut","paste","animationstart","animationend","animationiteration","transitionend","abort","error","loadstart","progress","play","pause","ended","volumechange","timeupdate","loadeddata","waiting","playing","online","offline","storage","visibilitychange"],BindInputDomValue:function(t,e,n,r,o){const s="string"==typeof t?document.querySelector(t):t;if(!s)return;const i=(t,e)=>r(t,e),c=(t,e)=>{o?.addEventListener?o.addEventListener(s,t,e):s.addEventListener(t,e)};switch(s.type||s.tagName.toLowerCase()){case"text":case"password":case"email":case"tel":case"url":case"search":case"number":case"range":case"color":case"date":case"time":case"datetime-local":case"month":case"week":case"hidden":case"textarea":i((()=>e[n]),(t=>{s.value=void 0===t?"":t})),c("input",(function(){e[n]=this.value}));break;case"checkbox":i((function(){s.checked=!!e[n]})),c("change",(function(){e[n]=this.checked}));break;case"radio":i((()=>{s.checked=s.value===e[n]})),c("change",(function(){this.checked&&(e[n]=this.value)}));break;case"select-one":case"select-multiple":i((()=>{let t=e[n];if(s.multiple){const e=Array.isArray(t)?t:[];for(let t=0;t<s.options.length;t++)s.options[t].selected=e.includes(s.options[t].value)}else s.value=t||""})),c("change",(function(){if(this.multiple){const t=[];for(let e=0;e<this.options.length;e++)this.options[e].selected&&t.push(this.options[e].value);e[n]=t}else e[n]=this.value}));break;default:return!1}return!0},SetAttr:function(t,e,n){"function"==typeof n&&(n=n());const r=new Set(["innerHTML","innerText","outerHTML","textContent","value","checked","selected","disabled","readOnly","maxLength","minLength","htmlFor","tabIndex","scrollTop","scrollLeft","scrollWidth","scrollHeight","clientWidth","clientHeight","offsetWidth","offsetHeight","style","dataset"]),o=new Set(["checked","selected","disabled","readonly","required","hidden","autofocus","multiple","novalidate"]),s=e.toLowerCase(),i={htmlfor:"htmlFor",readonly:"readOnly",maxlength:"maxLength",minlength:"minLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",tabindex:"tabIndex",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable",spellcheck:"spellcheck",innerhtml:"innerHTML",innertext:"innerText",autocapitalize:"autocapitalize"}[s]||e;r.has(i)?t[i]=void 0===n?"":n:o.has(s)?n?t.setAttribute(s,""):t.removeAttribute(s):void 0===n?t.removeAttribute(e):t.setAttribute(e,n)},AddClicker:(t,e,n)=>{if("outer"===e){let e=jn.length;return jn.push({dom:t,callback:n}),()=>{jn[e]=null}}}};function An(t,e){if(t.startsWith("/"))return t;const n=e.substring(0,e.lastIndexOf("/")).split("/").filter((t=>""!==t)),r=t.split("/").filter((t=>""!==t));for(const o of r)".."!==o?"."!==o&&n.push(o):n.length>0&&n.pop();return"/"+n.join("/")}function Tn(t,e,n){return t.startsWith("@")?t=t.slice(1):t.startsWith("http")||(t=t.startsWith("/")?e?`${e}${t}`:t:An(t,n)),t.endsWith(".js")||(t+=".js"),t.startsWith("http")||(t=`${window.location.origin}${t}`),t}function $n(t,e){const n=t.trim();if(/^\w+$/.test(n))return n;if(/^{[\w\s,]+}$/.test(n))return n.slice(1,-1).split(",").map((t=>t.trim())).filter(Boolean);throw Error("unsupported import: "+e)}async function Nn(t,e,n){if("string"==typeof t)return void(n[t]=e.default??e);const r=e.default||{};t.forEach((t=>{t in e?n[t]=e[t]:t in r&&(n[t]=r[t])}))}function Mn(t,e,n,r,o){const s=n?.data||r||{},i=n?.runtime||o||{};return i.$sys&&(i.$sys.$router=n?.runtime?.$sys?.$router||null),j(t,s,i,function(t,e){return{$node:t,$watch:(t,n,r)=>{const o=e?.scope,s=a(t,n,r);return o?.addWatcher((()=>l(s))),s},$scope:e?.scope,$router:e?.runtime?.$sys?.$router||null}}(e,n)).catch((t=>{throw t}))}function Pn(t,e,n,r,o){const s=t.innerHTML,i=n?.scope;t.hasAttribute("active")?i?.onActive((()=>{Mn(s,e,n,r,n?.runtime||o)})):t.hasAttribute("deactive")?i?.onDeactive((()=>{Mn(s,e,n,r,n?.runtime||o)})):t.hasAttribute("dispose")?i?.onDispose((()=>{Mn(s,e,n,r,n?.runtime||o)})):Mn(s,e,n,r,n?.runtime||o||{})}class Cn{constructor(t=null){this.host=t,this.cleanups=[],this.timers=new Set,this.intervals=new Set,this.lifecycle={active:[],deactive:[],dispose:[]},this.state="created"}addCleanup(t){return"function"==typeof t&&this.cleanups.push(t),t}addWatcher(t){return this.addCleanup(t)}addEventListener(t,e,n,r){return t?.addEventListener&&"function"==typeof n?(t.addEventListener(e,n,r),this.addCleanup((()=>t.removeEventListener(e,n,r))),n):null}setTimeout(t,e){const n=window.setTimeout((()=>{this.timers.delete(n),t()}),e);return this.timers.add(n),n}setInterval(t,e){const n=window.setInterval(t,e);return this.intervals.add(n),n}clearTimeout(t){this.timers.has(t)&&(this.timers.delete(t),window.clearTimeout(t))}clearInterval(t){this.intervals.has(t)&&(this.intervals.delete(t),window.clearInterval(t))}onActive(t){"function"==typeof t&&this.lifecycle.active.push(t)}onDeactive(t){"function"==typeof t&&this.lifecycle.deactive.push(t)}onDispose(t){"function"==typeof t&&this.lifecycle.dispose.push(t)}activate(t){this.state="active";for(const e of this.lifecycle.active)e(t)}deactive(t){this.state="inactive";for(const e of this.lifecycle.deactive)e(t)}dispose(t){if("disposed"!==this.state){this.state="disposed";for(const e of this.lifecycle.dispose)e(t);for(const t of this.cleanups.splice(0))t();for(const t of this.timers)window.clearTimeout(t);this.timers.clear();for(const t of this.intervals)window.clearInterval(t);this.intervals.clear()}}}class Ln{constructor(t,e="component"){this.host=t,this.kind=e,this.parent=null,this.children=new Set,this.scope=null,this.runtime=null,this.data=null,this.vsrc="",this.events=null,this.slotContents=null,this.sourceNodes=null,this.vforData=null,this.slotOutletState=null}}const Un=new WeakMap,Fn=new WeakSet,Dn=new WeakMap,qn=new WeakMap;function In(t,e=!0){if(!e)return Un.get(t)??null;for(;t;){const e=Un.get(t);if(e)return e;t=t.parentNode||t.host||null}return null}function _n(t,e){Un.set(t,e),Fn.has(t)||(Fn.add(t),Object.defineProperties(t,{$data:{configurable:!0,enumerable:!1,get:()=>Un.get(t)?.data??null},$sys:{configurable:!0,enumerable:!1,get:()=>Un.get(t)?.runtime?.$sys??null},$ctx:{configurable:!0,enumerable:!1,get:()=>Un.get(t)?.runtime?.$ctx??null},$mod:{configurable:!0,enumerable:!1,get:()=>Un.get(t)?.runtime?.$mod??null}}))}function Bn(t){let e=Dn.get(t);return e||(e={},Dn.set(t,e)),e}function zn(t,e=null,n="component"){return function(t,e){return e?(e.parent&&e.parent!==t&&e.parent.children.delete(e),e.parent=t||null,t&&t.children.add(e),e):e}(e,new Ln(t,n))}function Hn(t){t&&(t.parent&&(t.parent.children.delete(t),t.parent=null),t.children.forEach((t=>{t.parent=null})),t.children.clear())}function Wn(t){if(!t)return;const e=Un.get(t);e&&(Hn(e),Un.delete(t)),Dn.delete(t)}function Jn(t){if(!t)return;for(const n of Array.from(t.children))Jn(n);const e=t.host;e&&(t.scope?.dispose(e),Wn(e))}function Kn(t){if(!t||1!==t.nodeType)return;const e=Un.get(t);if(e)return void Jn(e);const n=Un.get(t);n?.scope?.dispose(t),Wn(t),t.childNodes?.forEach((t=>{1===t.nodeType&&Kn(t)}))}function Vn(t,e,n,r){const o=a(e,n,r);return t?.addWatcher((()=>l(o))),o}function Xn(t){return(t||[]).map((t=>t.cloneNode(!0)))}function Zn(t){return null==t?"":t+""}function Gn(t,e,n,r,o){t.innerHTML="",t.append(...Xn(e));const s=In(t)?.scope;o.compileVif(Array.from(t.childNodes),n,r,o).forEach((t=>{1===t.nodeType?o.ensureBoundary?.(t,n,r):function(t,e,n){t&&qn.set(t,{runtime:e||null,scope:n||null})}(t,r,s),o.compileNode(t,n,r,o,s)}))}function Yn(t){t.cleanup?.(),t.cleanup=null}function Qn(t,e,n,r){if(t.hasAttribute?.("data-vrouter-managed"))return r.compileAttrs(t,e,n,r),t;const o=function(t){const e=t.getAttribute("vrefof");let n=t.closest(`*[vref='${e}']`);if(!n)return null;for(;;){const t=n?.parentNode?.closest?.("*[vref]");if(!t)break;if(t.getAttribute("vref")!==e)break;n=t}return n}(t);if(!o)return r.onMountedRun?.(t,(t=>{Qn(t,e,n,r)})),t;const s=function(t){const e=Bn(t).slotOutletState;if(e)return e;const n={fallbackTemplates:Xn(Array.from(t.childNodes)),currentKey:"",currentMode:"",cleanup:null};return t.innerHTML="",Bn(t).slotOutletState=n,n}(t),i=In(t)?.scope;return Vn(i,(()=>{const r=function(t,e,n){return t.hasAttribute(":name")?Zn(O(t.getAttribute(":name"),e,n)):Zn(t.getAttribute("name"))}(t,e,n),s=In(o);return{slotName:r,selected:(s?.slotContents||{})[r]||null}}),(({slotName:o,selected:i})=>{if(i){const n=`projected:${o}:${i.id}`;if(s.currentKey===n&&"projected"===s.currentMode)return;Yn(s);const c=function(t,e,n){const r=t.getAttribute("vbind");if(!r)return{data:n,cleanup:null};const o=b({});m(o,n);const s=r.split(",").map((t=>t.trim())).filter(Boolean),i=In(t)?.scope,c=[];return s.forEach((t=>{const n=Vn(i,(()=>e[t]),(e=>{o[t]=e}),{deep:!0});c.push(n),o[t]=e[t]})),{data:o,cleanup:()=>c.forEach((t=>l(t)))}}(t,e,i.data);return Gn(t,i.templates,c.data,i.runtime,r),s.currentKey=n,s.currentMode="projected",void(s.cleanup=c.cleanup)}const c="fallback:"+o;s.currentKey===c&&"fallback"===s.currentMode||(Yn(s),Gn(t,s.fallbackTemplates,e,n,r),s.currentKey=c,s.currentMode="fallback")})),r.compileAttrs(t,e,n,r),t}class tr{#t=new Set;#e=!1;#n=null;#r=null;onChange(t){return this.#t.add(t),()=>{this.#t.delete(t)}}notify(t){for(const e of this.#t)e(t)}init(){this.#e||(this.#e=!0,this.#n=t=>{const e=t.target.closest("a");if(!e)return;const n=e.getAttribute("href");(function(t){if(!t||t.startsWith("#"))return!1;if(!Sn(t)){if(!function(t){return t.startsWith("http://")||t.startsWith("https://")}(t))return!1;try{return new URL(t,window.location.href).origin===window.location.origin}catch(e){return!1}}return!0})(n)&&("_blank"==e.getAttribute("target")?window.open(e.getAttribute("href"),"_blank"):e.hasAttribute("reload")?(t.preventDefault(),window.location.href=n):(t.preventDefault(),this.push(n)))},this.#r=()=>{this.notify({type:"popstate",url:window.location.href})},document.body.addEventListener("click",this.#n,!0),window.addEventListener("popstate",this.#r))}push(t){this.notify({type:"push",to:t})}replace(t){this.notify({type:"replace",to:t})}go(t){history.go(t)}back(){history.back()}forward(){history.forward()}}class er{constructor(t,e){this.originalPath=t,this.name=e,this.keys=[],this.regexp=this.pathToRegexp(t)}pathToRegexp(t){let e=t.replace(/\/:([^(/?]+)\?/g,((t,e)=>(this.keys.push(e),`(?:/(?<${e}>[^/]+))?`)));return e=e.replace(/:([^(/?]+)/g,((t,e)=>(this.keys.push(e),`(?<${e}>[^/]+)`))),e=e.replace(/\*(\w+)/g,((t,e)=>(this.keys.push(e),`(?<${e}>.*)`))),e=e.replace(/\*/g,".*"),RegExp(`^${e}$`)}match(t){let e;if("string"==typeof t)e=t;else{if(!t?.path)return t?.name===this.name?{path:this.originalPath,params:t.params||{},matched:this.originalPath}:null;e=t.path}const n=this.regexp.exec(e);if(!n)return null;const r={};return this.keys.forEach((t=>{void 0!==n.groups?.[t]&&(r[t]=n.groups[t])})),{path:this.originalPath,params:r,matched:n[0]}}}function nr(t){let e,n="";if(t.startsWith("http://")||t.startsWith("https://")){if(e=new URL(t),e.origin!==window.location.origin)return null;n=e.pathname}else e=new URL(t,window.location.href),n=e.pathname;const r={};return e.searchParams.forEach(((t,e)=>{r[e]=t})),{path:n,query:r,hash:e.hash}}function rr(t){return Array.isArray(t)?{routes:t,beforeEnter:null,afterEnter:null}:Array.isArray(t?.routes)?{routes:t.routes,beforeEnter:t.beforeEnter||null,afterEnter:t.afterEnter||null}:{routes:[],beforeEnter:t?.beforeEnter||null,afterEnter:t?.afterEnter||null}}function or(t,e){if(!t||"string"!=typeof e)return;const n=In(t);if(n){const t=new Set,r=n=>{if(!n||t.has(n))return;t.add(n);const o=n.host;o&&n.scope?.[e]?.(o),n.children.forEach((t=>r(t)))};r(n)}else In(t)?.scope?.[e]?.(t)}class sr{constructor(t,e,n,r,o){this.ownerView=t,this.renderer=e,this.node=n,this.instance=zn(n,t.instance,"page"),this.instance.route=r,this.instance.cacheKey=o,this.layoutInstance=null,this.R={htmlPath:this.resolveHtmlPath(r),title:"",titleWatchers:[],didInitialActivation:!1,layoutOutlet:null}}get meta(){return this.R}get matchedRoute(){return this.instance.route}set matchedRoute(t){this.instance.route=t||null}get cacheKey(){return this.instance.cacheKey}get htmlPath(){return this.R.htmlPath}get dom(){return this.instance.host}set dom(t){this.instance.host=t||null}get layoutDom(){return this.layoutInstance?.host||null}set layoutDom(t){t?this.layoutInstance?this.layoutInstance.host=t:this.layoutInstance=zn(t,this.instance,"layout"):this.layoutInstance&&(this.layoutInstance.host=null)}resolveHtmlPath(t){let e=t.route.component||t.route.path;return"function"==typeof e&&(e=e(t.path,t.params)),Object.entries(t.params).forEach((([t,n])=>{e=e.replace(":"+t,n)})),e.startsWith("/")||(e="/"+e),e.endsWith("/")&&(e=e.slice(0,-1)),e.endsWith(".html")||(e+=".html"),e}resolveErrorRedirect(t){const e=this.matchedRoute.route?.error_redirect;return e?"function"==typeof e?e(this.matchedRoute,t):e:null}updateRouter(t){this.matchedRoute=t;const e=this.runtime()?.$sys?.$router;e&&Object.assign(e.current,{path:t.path,fullPath:t.fullPath,params:t.params,query:t.query,hash:new URL(t.fullPath,window.location.origin).hash,meta:t.route?.meta||{},name:t.route?.name})}roots(){return this.layoutInstance?.host?[this.layoutInstance.host]:this.instance.host?[this.instance.host]:[]}runtime(){return In(this.dom)?.runtime||In(this.layoutDom)?.runtime||null}outlet(){return this.layoutDom?(this.R.layoutOutlet=this.R.layoutOutlet||this.layoutDom.querySelector("[data-vrouter-outlet]")||this.layoutDom,this.R.layoutOutlet):this.node}attach(){if(this.layoutDom){this.layoutDom.isConnected||(this.node.innerHTML="",this.node.append(this.layoutDom));const t=this.outlet();return this.dom&&this.dom.parentNode!==t&&(t.innerHTML="",t.append(this.dom)),this.layoutInstance.host=this.layoutDom,void(this.instance.host=this.dom)}this.dom&&!this.dom.isConnected&&(this.node.innerHTML="",this.node.append(this.dom)),this.instance.host=this.dom}async mount(t,e){const n=await On.fetchUI(this.htmlPath,t);if(n.err){const t=this.resolveErrorRedirect(n.err);if(t)return{redirect:t};throw Error(`load page failed: ${this.htmlPath} ${n.err}`)}if(this.R.title=n.title||"",this.dom=document.createElement("div"),this.dom.setAttribute("vsrc",this.htmlPath),this.dom.setAttribute("data-keep",""),!e)return this.node.innerHTML="",this.node.append(this.dom),await this.renderer.parseRef(this.htmlPath,this.dom,{},t,null),this.instance.host=this.dom,this.activate(),{mounted:!0};let r=e;r.startsWith("/")||(r="/"+r),r.endsWith(".html")||(r+=".html"),r.startsWith("/layout")||(r="/layout"+r);const o=await On.fetchUI(r,t);if(o.err)throw Error(`load layout failed: ${r} ${o.err}`);this.layoutDom=function(t){if(!t)return null;const e=t.querySelector("vslot:not([name])")||t.querySelector("vslot");return e?(e.setAttribute("data-vrouter-outlet",""),e.setAttribute("data-vrouter-managed",""),t):t}(o.body.cloneNode(!0)),this.layoutDom?.setAttribute("data-keep",""),this.node.innerHTML="",this.node.append(this.layoutDom),await this.renderer.parseRef("/layout/"+e,this.layoutDom,{},t,null,!0);const s=In(this.layoutDom)?.runtime||t||null;return this.outlet().innerHTML="",this.outlet().append(this.dom),await this.renderer.parseRef(this.htmlPath,this.dom,{},s,null),this.instance.host=this.dom,this.activate(),{mounted:!0}}updateTitle(){if(this.clearTitleWatchers(),!this.R.title)return;const t=this.R.title.trim();if(!t.includes("{{"))return void(document.title=t);if(!this.dom&&!this.layoutDom)return;const e=this.runtime()||{},n=/{{|}}/g;let r,o=0,s=-1;const i=[];for(;null!==(r=n.exec(t));)if("{{"===r[0])s=r.index;else if(s>=0){o!==s&&i.push(t.slice(o,s)),i.push("");const n=t.slice(s+2,r.index),c=i.length-1;o=r.index+2,s=-1;const u=a((()=>{let t=O(n,{},e||{});"function"==typeof t?t=t():"object"==typeof t&&t&&(t=JSON.stringify(t)),i[c]=t,document.title=i.join("")}));this.R.titleWatchers.push(u)}i.push(t.slice(o)),document.title=i.join("")}clearTitleWatchers(){for(;this.R.titleWatchers.length>0;)l(this.R.titleWatchers.pop())}activate(){this.updateTitle(),this.attach(),this.R.didInitialActivation?this.roots().forEach((t=>or(t,"activate"))):this.R.didInitialActivation=!0}deactive(){this.clearTitleWatchers(),this.R.didInitialActivation&&this.roots().forEach((t=>or(t,"deactive")))}destroy(){this.clearTitleWatchers(),Hn(this.layoutInstance),Hn(this.instance),this.layoutInstance=null}}class ir{#o=[];#s=[];#i=new Map;#c=null;#u=[];#a=new Map;#l="/routes.js";#f=null;#h=null;#t=new Set;#d=null;#p=null;#m=null;#y=null;constructor(t){this.#c=t,this.instance=zn(null,null,"router-view"),this.instance.data=b({}),this.instance.route=this.instance.data,this.instance.router=this}get routes(){return[...this.#o,...this.#s]}get history(){return this.#u.slice()}get current(){return this.instance.data}get query(){return this.instance.data?.query||{}}get params(){return this.instance.data?.params||{}}get modulePath(){return""}get routesSource(){return this.#l}get runtime(){return this.instance.runtime}get activePage(){return this.#y}set activePage(t){this.#y=t||null}get beforeEnter(){return this.#f}set beforeEnter(t){this.#f="function"==typeof t?t:null}get afterEnter(){return this.#h}set afterEnter(t){this.#h="function"==typeof t?t:null}get pageCache(){return this.#a}get listeners(){return this.#t}get hostNode(){return this.#d}set hostNode(t){this.#d=t||null}get renderer(){return this.#p}set renderer(t){this.#p=t||null}get disposeNavListener(){return this.#m||null}set disposeNavListener(t){this.#m=t||null}onChange(t){return this.#t.add(t),()=>{this.#t.delete(t)}}#w(t,e){for(const n of this.#t)n(t,e)}#b(t){return{path:t.path,fullPath:t.fullPath,params:{...t.params||{}},query:{...t.query||{}},hash:t.hash||"",meta:{...t.meta||{}},description:t.description||"",layout:t.layout||"",name:t.name,matched:[...t.matched||[]]}}#g(t,e="push"){const n=this.#b(this.current),r=this.#b({path:t.path,fullPath:t.fullPath,params:t.params||{},query:t.query||{},hash:new URL(t.fullPath,window.location.origin).hash,meta:t.route?.meta||{},description:t.route?.description||"",layout:t.route?.layout||"",name:t.route?.name,matched:t.route?[t.route]:[]});Object.assign(this.current,r),"replace"===e&&this.#u.length>0?this.#u[this.#u.length-1]=r:this.#u.push(r),"replace"===e?history.replaceState({},"",t.fullPath):history.pushState({},"",t.fullPath),this.#w(this.current,n)}#v(t){return/[:*?()[\]{}^$+.]/.test(t)}addRoute(t){if(!t.path)throw Error("Route must have a path");"/"!==t.path&&t.path.endsWith("/")&&(t.path=t.path.slice(0,-1));const e={path:t.path,component:t.component,redirect:t.redirect,error_redirect:t.error_redirect,name:t.name,meta:t.meta||{},children:t.children||[],matcher:new er(t.path,t.name),description:t.description||"",layout:t.layout||"",cacheKey:t.cacheKey};this.#v(t.path)?this.#s.push(e):this.#o.push(e),t.name&&this.#i.set(t.name,e),t.children?.length>0&&t.children.forEach((n=>{const r=t.path+(n.path.startsWith("/")?n.path:"/"+n.path),o=n.layout||t.layout||"",s={...t.meta,...n.meta};this.addRoute({...n,path:r,parent:e,layout:o,meta:s})}))}addRoutes(t){t.forEach((t=>this.addRoute(t)))}resetRoutes(){this.activePage?.deactive(),this.#a.forEach((t=>t.destroy())),this.#o=[],this.#s=[],this.#i=new Map,this.#u=[],this.#a=new Map,this.activePage=null}normalizeRouteTarget(t){let e,n,r={},o={},s="";if("string"==typeof t){const n=nr(t);if(!n)return null;e=n.path,r={...n.query},s=n.hash}else{if(!t||"object"!=typeof t)return null;if(t.path){const n=nr(t.path);if(!n)return null;e=n.path,r={...n.query,...t.query||{}},s=t.hash||n.hash,o=t.params||{}}else{if(!t.name)return null;n=t.name,r=t.query||{},o=t.params||{},s=t.hash||""}}return e&&!e.startsWith("/")&&(e="/"+e),"/"!==e&&e?.endsWith("/")&&(e=e.slice(0,-1)),{path:e,query:r,params:o,hash:s,name:n}}matchRoute(t){const e=this.normalizeRouteTarget(t);if(!e)return null;const{path:n,query:r,params:o,name:s,hash:i}=e;if(s){const t=this.#i.get(s);if(!t)return null;let e=t.path;Object.entries(o).forEach((([t,n])=>{e=e.replace(":"+t,n)}));const n=t.matcher.match(e);return n?{route:t,params:{...n.params,...o},matched:n.matched,path:e,query:r,name:s,hash:i}:null}for(const c of this.#o)if(c.path===n&&(c.component||c.redirect))return{route:c,params:{...o},matched:n,path:n,query:r,name:c.name,hash:i};for(const c of this.#s){const t=c.matcher.match(n);if(t&&(c.component||c.redirect))return{route:c,params:{...t.params,...o},matched:t.matched,path:n,query:r,name:c.name,hash:i}}return null}matchTo(t){const e=this.matchRoute(t);if(!e)return null;const{route:n,params:r,query:o,path:s,name:i,hash:c}=e;let u="";o&&Object.keys(o).length>0&&(u="?"+Object.entries(o).map((([t,e])=>`${encodeURIComponent(t)}=${encodeURIComponent(e)}`)).join("&"));const a=`${s||e.path}${u}${c||""}`;return{route:n,params:r,query:o,name:i||n.name,path:s||e.path,fullPath:a,matched:[n]}}resolveCacheKey(t,e){const n=t.cacheKey;return!1===n?null:void 0===n||!0===n?e.fullPath:"string"==typeof n?n:"function"==typeof n?n(e):e.fullPath}async#x(t,e="push"){if(!t)return;const{route:n,params:r,query:o}=t;if(n.redirect){const e="function"==typeof n.redirect?n.redirect(t):n.redirect;return void this.push(e)}if(this.activePage&&this.current?.fullPath===t.fullPath)return;const s={path:t.path,fullPath:t.fullPath,params:r,query:o,hash:new URL(t.fullPath,window.location.origin).hash,meta:n.meta,description:n.description,layout:n.layout,name:n.name,matched:[n]};if(this.#f){let t=!0;if(!1===await this.#f(s,this.current,(e=>{e&&(t=!1,this.push(e))}))||!t)return}const i=this.resolveCacheKey(n,t);if(this.activePage?.deactive(),this.#g(t,e),i&&this.#a.has(i)){const e=this.#a.get(i);return e.matchedRoute.fullPath!==t.fullPath&&e.updateRouter(t),e.activate(),this.activePage=e,void("function"==typeof this.#h&&this.#h(s,this.current))}const c=new sr(this,this.#p,this.#d,t,i);let u;i&&this.#a.set(i,c);try{u=await c.mount(this.runtime,s.layout)}catch(a){throw i&&this.#a.delete(i),c.destroy(),a}if(u?.redirect)return i&&this.#a.delete(i),c.destroy(),void this.replace(u.redirect);this.activePage=c,"function"==typeof this.#h&&this.#h(s,this.current)}async push(t){const e=this.matchTo(t);e&&await this.#x(e,"push")}async replace(t){const e=this.matchTo(t);e&&await this.#x(e,"replace")}go(t){this.#c.go(t)}back(){this.#c.back()}forward(){this.#c.forward()}resolveRoutesUrl(t=this.#l,e=this.runtime||{}){const n=t||"/routes.js";return/^https?:\/\//.test(n)?n:n.startsWith("/")?yn(n,an(e)):yn("/"+n.replace(/^\.?\//,""),an(e))}async loadRoutes(){const t=this.resolveRoutesUrl(this.#l,this.runtime||{});return async function(t,e={}){let n=t;if("function"==typeof n?.default)n=await n.default(e);else if("function"==typeof n)n=await n(e);else if(n?.default){const t=rr(n.default);if(t.routes.length||t.beforeEnter||t.afterEnter)return{routes:t.routes,beforeEnter:t.beforeEnter||n.beforeEnter||null,afterEnter:t.afterEnter||n.afterEnter||null}}return rr(n)}(await import(t),{$mod:this.runtime?.$mod||null,router:this})}async handleNavigation(t){const e="popstate"===t?.type?t.url:t?.to,n="replace"===t?.type||"popstate"===t?.type?"replace":"push";if(!e)return;const r=this.matchTo(e);r&&await this.#x(r,n)}async mount(t,e,n){this.#d=e,this.#p=t;const r=dn(n||null,n?.$mod||n||null,{$router:this});_n(e,this.instance),this.instance.host=e,this.instance.runtime=r,this.#l=e.getAttribute("routes")||"/routes.js",this.resetRoutes(),this.#m?.(),this.#m=this.#c.onChange((t=>{this.handleNavigation(t)}));const o=await this.loadRoutes();this.#f=o.beforeEnter||null,this.#h=o.afterEnter||null,this.addRoutes(o.routes),await this.handleNavigation({type:"replace",to:window.location.href})}}const cr=new class{#c=new tr;#R=new WeakMap;constructor(){this.#c.init()}push(t){this.#c.push(t)}replace(t){this.#c.replace(t)}go(t){this.#c.go(t)}back(){this.#c.back()}forward(){this.#c.forward()}mountView(t,e,n){let r=this.#R.get(e);return r||(r=new ir(this.#c),this.#R.set(e,r),r.mount(t,e,n)),r}};function ur(t,e,n,r){const o=a(e,n,r);return t?.addWatcher((()=>l(o))),o}const ar=new Set(["href","src","srcset","poster","data","action","formaction"]);function lr(t){return t?.$mod?.url_prefix||t?.$mod?.scoped}function fr(t,e,n){if(!t||t.startsWith("#"))return t;if(t.startsWith("@"))return t.slice(1);if((n=n||e?.$mod?.scoped)&&Sn(t)){const e=n.split("/").filter((t=>t)).length;return function(t,e=0){const n=t.split("/").filter((t=>""!==t)),r=[];for(const o of n)"."!==o&&(".."===o?r.length>e&&r.pop():r.push(o));return"/"+r.join("/")}(n+t,e)}return t}function hr(t,e){return t&&"string"==typeof t?t.split(",").map((t=>{const n=t.trim().split(/\s+/);return n.length>0&&Sn(n[0])&&(n[0]=fr(n[0],e)),n.join(" ")})).join(", "):t}const dr=/{{|}}/g,pr=/^\s*(?:\((\w+)\s*,\s*(\w+)\)|(\w+))\s+in\s+(.+?)\s*$/;function mr(t){if("TEMPLATE"===t.nodeName){const e=t.content||t;return Array.from(e.childNodes).map((t=>t.cloneNode(!0)))}return[t.cloneNode(!0)]}function yr(t,e){const n=document.createDocumentFragment();t.forEach((t=>n.appendChild(t))),e.parentNode.insertBefore(n,e)}function wr(t,e,n){let r=In(t,!1);return r||(r=zn(t,In(t.parentNode),"boundary"),_n(t,r)),r.scope||(r.scope=new Cn(t)),void 0!==e&&(r.data=e),r.runtime||(r.runtime=n||null),r}function br(t,e,n,r){const o=r||In(t)?.scope,s=t.nodeValue.trim();if(!s)return;let i,c=0,u=-1;const a=[];for(;null!==(i=dr.exec(s));)if("{{"===i[0])u=i.index;else if("}}"===i[0]&&u>=0){c!==u&&a.push(s.slice(c,u)),a.push("");const r=s.slice(u+2,i.index),l=a.length-1;u=-1,c=i.index+2,ur(o,(()=>{let o=O(r,e,n);"function"==typeof o?o=o():"object"==typeof o&&o&&(o=JSON.stringify(o)),a[l]=o,t.nodeValue=a.join("").trim()}))}a.push(s.slice(c)),t.nodeValue=a.join("")}function gr(t){if(!t)return;let e=t.startMark.nextSibling;for(;e&&e!==t.endMark;){const t=e.nextSibling;1===e.nodeType&&Kn(e),e.remove(),e=t}t.startMark.remove(),t.endMark.remove()}function vr(t,e,n,r,o){e.removeAttribute("v-for");const s=pr.exec(t);if(5!==s?.length)return;const i=s[1]||s[3],c=s[2],u=s[4],a=mr(e),l=document.createComment("~vfor"),f=document.createComment("~/vfor");e.replaceWith(l,f);const d=Object.create(null),p=In(l.parentNode)?.scope;p?.addCleanup((()=>{Object.keys(d).forEach((t=>{gr(d[t]),delete d[t]})),function(t,e){let n=t.nextSibling;for(;n&&n!==e;){const t=n.nextSibling;1===n.nodeType&&Kn(n),n.remove(),n=t}}(l,f)})),ur(p,(()=>{let t=O(u,n,r);"function"==typeof t&&(t=t()),"number"==typeof t&&(t=Array.from({length:t},((t,e)=>e))),t||(t=[]);const e=new Set,s=[];Object.keys(t).forEach((n=>{const r=t[n],o=r?.[h]||`${n}.${r}`;e.add(o),s.push({key:n,value:r,ck:o})})),Object.keys(d).forEach((t=>{e.has(t)||(gr(d[t]),delete d[t])})),s.forEach((({key:t,value:e,ck:s})=>{let u=d[s];if(!u){const l=document.createComment("~vitem"),h=document.createComment("~/vitem");yr([l,h],f);const m=a.map((t=>t.cloneNode(!0))),y=b({[i]:e},n);return c&&(y[c]="0"===t?0:+t||t),yr(m,h),xr(m,y,r,o).forEach((t=>{1===t.nodeType?(Bn(t).vforData=y,wr(t,y,r),kr(t,y,r,o)):3===t.nodeType&&br(t,y,r,p)})),u={startMark:l,endMark:h,data:y},void(d[s]=u)}u.data&&(u.data[i]=e,c&&(u.data[c]="0"===t?0:+t||t)),function(t,e,n){if(e.nextSibling===n)return;const r=[t];let o=t.nextSibling;for(;o&&o!==e;)r.push(o),o=o.nextSibling;r.push(e),yr(r,n)}(u.startMark,u.endMark,f)}))}))}function xr(t,e,n,r){const o=[];let s=null;function i(){if(!s||0===s.conds.length)return;const{conds:t,sourceBranches:o,startMark:i,endMark:c}=s,u=`[${t.map((t=>""===t?"true":`Boolean(${t})`)).join(",")}].indexOf(true)`;let a=-1;const l=In(i.parentNode)?.scope;ur(l,(()=>O(u,e,n)),(t=>{t!==a&&(function(){let t=i.nextSibling;for(;t&&t!==c;){const e=t.nextSibling;1===t.nodeType&&Kn(t),t.remove(),t=e}}(),function(t){if(0>t||t>=o.length){const t=document.createElement("div");return t.style.display="none",void c.before(t)}const s=o[t].map((t=>t.cloneNode(!0)));yr(s,c),s.forEach((t=>{1===t.nodeType?(wr(t,e,n),kr(t,e,n,r)):3===t.nodeType&&br(t,e,n,In(i.parentNode)?.scope)}))}(t),a=t)})),s=null}for(const c of t){if(1!==c.nodeType){o.push(c);continue}if(c.getAttribute("v-for")){i(),o.push(c);continue}const t=c.getAttribute("v-if");if(null===t){if(s){const t=c.getAttribute("v-else-if");if(null!==t){s.conds.push(t),c.removeAttribute("v-else-if"),s.sourceBranches.push(mr(c)),c.remove();continue}if(null!==c.getAttribute("v-else")){s.conds.push(""),c.removeAttribute("v-else"),s.sourceBranches.push(mr(c)),c.remove();continue}}i(),o.push(c)}else{i();const e=document.createComment("~vif"),n=document.createComment("~/vif");c.replaceWith(e,n),c.removeAttribute("v-if");const r=mr(c);s={conds:[t],sourceBranches:[r],startMark:e,endMark:n},c.remove()}}return i(),o}function Rr(t,e,n,r,o,s,i){const c=In(t)?.scope;if(e.startsWith(":")){const s=e.slice(1);return"class"===s||"style"===s?function(t,e,n,r,o){const s=In(t)?.scope;let i="";ur(s,(()=>{let s=O(n,r,o);if("function"==typeof s&&(s=s()),"class"===e){if(i&&(t.classList.remove(...i.split(/\s+/)),i=""),s instanceof Array)i="",s.forEach((t=>{if("string"==typeof t&&t.length)i+=" "+t;else if("object"==typeof t&&t)for(const e in t)t[e]&&(i+=" "+e)}));else if("string"==typeof s&&s.length)i=s.trim();else if("object"==typeof s&&s){i="";for(const t in s)s[t]&&(i+=" "+t)}return i=i.trim(),void(i&&t.classList.add(...i.split(/\s+/)))}if(i)if("object"==typeof i)for(const e in i)e.startsWith("--")?t.style.removeProperty(e):t.style[e]="";else"string"==typeof i&&i.split(";").forEach((e=>{const n=e.split(":");if(2!==n.length)return;const r=n[0].trim();r.startsWith("--")?t.style.removeProperty(r):t.style[r]=""}));if("object"==typeof s&&s)for(const e in s)e.startsWith("--")?t.style.setProperty(e,s[e]):t.style[e]=s[e];else"string"==typeof s&&s.split(";").forEach((e=>{const n=e.split(":");if(2!==n.length)return;const r=n[0].trim(),o=n[1].trim();r.startsWith("--")?t.style.setProperty(r,o):t.style[r]=o}));i=s}))}(t,s,n,r,o):(ar.has(s)&&i?.add(s),ur(c,(()=>{let e=n?O(n,r,o):r[s];if(ar.has(s)&&e)if("srcset"===s)e=hr(e,o);else{const n="href"===s&&"A"===t.nodeName?lr(o):void 0;e=fr(e,o,n)}En.SetAttr(t,s,e)}))),!0}if(e.startsWith("@"))return function(t,e,n,r,o,s){const i=In(t)?.scope,c=e.slice(1).split("."),u={self:!1,prevent:!1,stop:!1},a=c[0];if("mounted"===a)return void s?.onMountedRun?.(t,(t=>{!function(t,e,n,r){let o=O(r,e,n);"function"==typeof o&&o(t)}(t,r,o,n)}),!1);if("outerclick"===a){const e=t=>{const e=O(n,r,o,{$event:t});"function"==typeof e&&e(t)},s=En.AddClicker(t,"outer",e);return void i?.addCleanup(s)}if(-1===En.EventsList.indexOf(a)){const e=In(t,!1);return void(e&&(e.events||(e.events={}),e.events[a]=(...t)=>{const e=O(n,r,o,{});"function"==typeof e&&e(...t)}))}"keydown"!==a&&"keyup"!==a&&"keypress"!==a||"INPUT"===t.tagName||"TEXTAREA"===t.tagName||t.setAttribute("tabindex","0");let l=t=>{const e=O(n,r,o,{$event:t});"function"==typeof e&&e(t)},f=null;c.slice(1).forEach((t=>{if(t.startsWith("delay")){let e=t.slice(5);e=e?e.endsWith("ms")?+e.slice(0,-2):e.endsWith("s")?1e3*+e.slice(0,-1):+e:1e3,isNaN(e)&&(e=1e3),l=t=>{"number"==typeof f&&(i?.clearTimeout(f)||clearTimeout(f)),f=i?.setTimeout((()=>{const e=O(n,r,o,{$event:t});"function"==typeof e&&e(t)}),e)||setTimeout((()=>{const e=O(n,r,o,{$event:t});"function"==typeof e&&e(t)}),e)}}u[t]=!0}));const h=t=>{(1>=c.length||"keydown"!==a&&"keyup"!==a&&"keypress"!==a||c[1]===t.key?.toLowerCase())&&(u.self&&t.currentTarget!==t.target||(u.prevent&&t.preventDefault(),u.stop&&t.stopPropagation(),l(t)))};i?.addEventListener?i.addEventListener(t,a,h):t.addEventListener(a,h)}(t,e,n,r,o,s),!0;if(e.indexOf("!")>-1);else if(e.startsWith("v:")){const e=s?.findLastAccess?.(n,r);if(e&&e.data&&e.key)return En.BindInputDomValue(t,e.data,e.key,((t,e)=>ur(c,t,e)),c)}else if("ref"===e){const e=n?.trim?.()||"",o=function(t){return t&&"object"==typeof t?(t.$refs&&"object"==typeof t.$refs||(t.$refs=b({})),t.$refs):null}(r);return e&&o&&(o[e]=t,c?.addCleanup((()=>{o[e]===t&&(o[e]=null)}))),!0}return!1}function Or(t,e,n,r,o){const s=new Set;if(Array.from(t.attributes).forEach((o=>{Rr(t,o.name,o.value,e,n,r,s)&&t.removeAttribute(o.name)})),Array.from(t.attributes).forEach((e=>{if(ar.has(e.name)&&!s.has(e.name)){let r;if("srcset"===e.name)r=hr(e.value,n);else{const o="href"===e.name&&"A"===t.nodeName?lr(n):void 0;r=fr(e.value,n,o)}t.setAttribute(e.name,r)}})),"A"===t.nodeName&&function(t){const e=In(t)?.scope,n=In(t)?.runtime?.$sys?.$router;if(!n)return;const r=e=>{const n=e?.fullPath;t.getAttribute("href")===n?t.setAttribute("active",""):t.removeAttribute("active")};r(n.current);const o=n.onChange?.(r);e?.addCleanup(o)}(t),o){const e=In(t,!1),s=e?.data;Object.keys(o).forEach((e=>{Rr(t,e,o[e],s,n,r)}))}if(t.hasAttribute("v-show")){const r=t.getAttribute("v-show"),o=t.style.display,s=In(t)?.scope;ur(s,(()=>{const s=O(r,e,n);t.style.display=s?o:"none"}))}}function kr(t,e={},n,r,o){if(n instanceof HTMLElement)throw Error("runtime error");const s=In(t),i=(c=t,qn.get(c)||null);var c;const u=o||s?.scope||i?.scope,a=i?.runtime||s?.runtime||n,l=t.nodeName.toLowerCase();if(3===t.nodeType)return void br(t,e,a,u);if(8===t.nodeType)return void t.remove();if(1!==t.nodeType)return;if(t.hasAttribute("no-vhtml")||Bn(t).parsed)return;if("template"===l){const n=t.getAttribute("v-for");if(null!==n)return t.removeAttribute("v-for"),vr(n,t,e,a,r),void(Bn(t).parsed=!0);const o=t.content||t,s=xr(Array.from(o.childNodes),e,a,r);return t.replaceWith(...s),void s.forEach((t=>kr(t,e,a,r,u)))}Bn(t).sourceNodes||(Bn(t).sourceNodes=Array.from(t.childNodes).map((t=>t.cloneNode(!0))),Bn(t).sourceAttrs=Array.from(t.attributes).filter((t=>!["v-if","v-else-if","v-else"].includes(t.name))).map((t=>({name:t.name,value:t.value}))));let f=t.getAttribute("v-for");if(null!==f)return void vr(f,t,e,a,r);if(-1!==l.indexOf("-")){let n="/"+l.split("-").join("/"),o=t.hasAttribute("single");return r?.parseRef?.(n,t,e,a,null,o),void(Bn(t).parsed=!0)}if(t.getAttribute(":vsrc")){let n=t.getAttribute(":vsrc");t.removeAttribute(":vsrc");let o=Array.from(t.attributes).map((t=>({name:t.name,value:t.value}))),s=Array.from(t.childNodes);return void ur(u,(()=>{Bn(t).parsed=!1,t.setAttribute("vparsing","");let i=O(n,e,a);i&&(Array.from(t.attributes).forEach((e=>t.removeAttribute(e.name))),t.innerHTML="",o.forEach((e=>t.setAttribute(e.name,e.value))),s.forEach((e=>t.appendChild(e.cloneNode(!0)))),r?.parseRef?.(i,t,e,a,null,!1),Bn(t).parsed=!0)}))}if(t.getAttribute("vsrc")){let n=t.hasAttribute("single");return r?.parseRef?.(t.getAttribute("vsrc"),t,e,a,null,n),void(Bn(t).parsed=!0)}if("div"===l&&t.getAttribute("v-html")){let n=t.getAttribute("v-html");return t.removeAttribute("v-html"),t.innerHTML="",Or(t,e,a,r),Bn(t).parsed=!0,void ur(u,(()=>{let o=O(n,e,a);t.innerHTML=o;let s=xr(Array.from(t.childNodes),e,a,r);for(let t of s)kr(t,e,a,r,u)}))}if("vslot"===l)return r?.parseSlots?.(t,e,a),void(Bn(t).parsed=!0);if("vrouter"===l)return Or(t,e,a,r),void r?.mountRouter?.(t,a);Or(t,e,a,r);let h=xr(Array.from(t.childNodes),e,a,r);for(let d of h)kr(d,e,a,r,u);Bn(t).parsed=!0}function Sr(t,e){const n=Function("sandbox",t=`with (sandbox) { ${t} }`);let r={data:null,key:null};const o=t=>new Proxy(t,{has:(t,e)=>!0,get(t,e,n){if(e===Symbol.unscopables)return;let s=Reflect.get(t,e,n);return r.data=t,r.key=e,"object"==typeof s&&s?o(s):s},set:(t,e,n,r)=>!1});return n(o(e)),r}function jr(t,e,n,r){const o=a(e,n,r);return t?.addWatcher((()=>l(o))),o}function Er(t){const{onMountedRun:e,suspendMO:n,resumeMO:r}=t,o={watch:jr,findLastAccess:Sr,onMountedRun:e,suspendMO:n,resumeMO:r,compileNode:kr,compileAttrs:Or,compileVif:xr,compileAttr:Rr,ensureBoundary:wr,parseRef:(t,e,n,r,s,c)=>async function(t,e,n,r,o,s=!1,c){const u=Un.get(e),a=In(e.parentNode);u&&(u.scope?.dispose(e),Hn(u),Un.delete(e));const l=zn(e,a,"component");_n(e,l),l.scope=new Cn(e),e.setAttribute("vparsing","");const f=r,h=e.getAttribute("vrefof"),d=e.closest(`*[vref='${h}']`);if(d&&(r=In(d)?.runtime),!o&&t&&(t.endsWith(".html")||(t+=".html"),o=await On.fetchUI(t,r,e.hasAttribute("scoped")),!Un.get(e)))return;const p=o?.mod||r?.$mod||null,m=function(t,e){if(!e||!t)return t;const n=t=>/^https?:\/\//.test(t),r=t=>"string"!=typeof t||n(t)||t.startsWith(e)?!t?.path||n(t.path)||t.path.startsWith(e)?t:{...t,path:e+(t.path.startsWith("/")?t.path:"/"+t.path)}:e+(t.startsWith("/")?t:"/"+t);return{push:e=>t.push(r(e)),replace:e=>t.replace(r(e)),go:e=>t.go(e),back:()=>t.back(),forward:()=>t.forward(),onChange:e=>t.onChange(e),get current(){return t.current},get params(){return t.params},get query(){return t.query},get history(){return t.history}}}(r?.$sys?.$router||null,p?.url_prefix||p?.scoped||""),y=dn(r||null,p,{$router:m});y.$sys.$emit=(t,...n)=>{t=t.toLowerCase();const r=In(e,!1)?.events;if(!r)return;const o=r[t];"function"==typeof o&&o(...n)},l.runtime=y,l.vsrc=t;const w=await async function(t,e,n,r,o=!1,s){const c=b({$refs:b({})});let u=Un.get(t);if(!u)return c;const a=u?.runtime;if(r.setup){let e=r.setup.innerHTML;if(e=await async function(t,e={},n={},r=""){const o=an(n),s=function(t="",e=""){return t?t.startsWith("http")||!e||t.startsWith(e)?t:`${e}${t}`:e||"/"}(r,o);let i,c=t;const u=/await import\(['"]([^'"]+)['"]\)/gm;for(;null!==(i=u.exec(t));){let t=i[1];t.startsWith("http")||(t=An(t,s),t=`${window.location.origin}${t}`),c=c.replace(i[0],`await import('${t}')`)}const a=/^[\s/]*import\s+([\w{},\s]+)\s+from\s+['"]([^'"]+)['"][;\s]*$/gm;for(;null!==(i=a.exec(t));)if(c=c.replace(i[0],""),!i[0].trim().startsWith("//"))try{const t=Tn(i[2],o,s),n=$n(i[1],i[0]),r=await import(t);await Nn(n,r,e)}catch(l){}return c.trim()}(e,c,a,r.url),await j(e,c,a,{$node:t,$watch:(t,e,n)=>{const r=u?.scope,o=()=>{Vn(r,t,e,n)};r?r.setTimeout(o,50):setTimeout(o,50)}}),u=Un.get(t),!u)return c}if(c.$refs&&"object"==typeof c.$refs||(c.$refs=b({})),u.data=c,o)return c;if(u.sourceNodes||(u.sourceNodes=Array.from(t.childNodes).filter((t=>!(3===t.nodeType&&!t.textContent.trim()))).map((t=>t.cloneNode(!0)))),t.hasAttribute("vslot-inherit")){t.removeAttribute("vslot-inherit");let e=In(t.parentNode);for(;e&&!e.slotContents;)e=In(e.host?.parentNode);u.slotContents=e?.slotContents||{}}else{const t=function(t,e,n){const r=Object.create(null);return t.forEach((t=>{if(3===t.nodeType&&!t.textContent.trim())return;const o=t.cloneNode(!0),s=Zn(o.getAttribute?.("vslot"));o.removeAttribute?.("vslot"),r[s]||(r[s]={id:i(),name:s,templates:[],data:e,runtime:n}),r[s].templates.push(o)})),r}(u.sourceNodes||[],e,n);u.slotContents=t}t.innerHTML="";const l=r.body.cloneNode(!0);t.append(...l.childNodes);const f=u.scope;Object.keys(c).forEach((r=>{const o=En.CamelToKebabCase(r);if("boolean"==typeof c[r]?(t.hasAttribute(r)||t.hasAttribute(o))&&(c[r]=!0):t.hasAttribute(r)?(c[r]=t.getAttribute(r),t.removeAttribute(r)):t.hasAttribute(o)&&(c[r]=t.getAttribute(o),t.removeAttribute(o)),t.hasAttribute(":"+r)||t.hasAttribute(":"+o)){const s=t.getAttribute(":"+r)||t.getAttribute(":"+o);t.removeAttribute(":"+r),t.removeAttribute(":"+o),delete c[r],s?Vn(f,(()=>O(s,e,n)),(()=>{c[r]=O(s,e,n)}),{deep:!0}):Vn(f,(()=>e[r]),(()=>{c[r]=e[r]}),{deep:!0})}if(t.hasAttribute("v:"+r)||t.hasAttribute("v:"+o)){let n=t.getAttribute("v:"+r)||t.getAttribute("v:"+o);t.removeAttribute("v:"+r),t.removeAttribute("v:"+o),n||(n=r);const i=s.findLastAccess?.(n,e);if(!i||!i.key||void 0===i.data)return;void 0!==i.data[i.key]&&null!==i.data[i.key]&&delete c[r],Vn(f,(()=>i.data[i.key]),(()=>{c[r]=i.data[i.key]})),Vn(f,(()=>c[r]),(()=>{i.data[i.key]=c[r]}))}}));let h=Array.from(l.attributes);return h=h.filter((e=>!s.compileAttr(t,e.name,e.value,c,a,s)||(l.removeAttribute(e.name),!1))),h.forEach((e=>{"class"===e.name?t.classList.add(...e.value.trim().split(/\s+/)):"style"===e.name?e.value.split(";").forEach((e=>{const n=e.split(":");if(2!==n.length||t.style[n[0]])return;const r=n[0].trim(),o=n[1].trim();r.startsWith("--")?t.style.setProperty(r,o):t.style[r]=o})):t.getAttribute(e.name)||t.setAttribute(e.name,e.value)})),c}(e,n,f,o,s,c);if(!Un.get(e))return;c.suspendMO?.(),s?c.compileAttrs(e,w,y,c,o?.customAttrs):c.compileAttrs(e,n,f,c,o?.customAttrs);const g=c.compileVif(Array.from(e.childNodes),w,y,c);for(const i of g)c.compileNode(i,w,y,c);e.removeAttribute("vparsing"),c.resumeMO?.(),function(t,e,n,r){const o=Un.get(t);o?.scope||o&&(o.scope=new Cn(t));for(const s of r.scripts)Pn(s,t,o,e,n)}(e,w,y,o),l.scope?.activate(e)}(t,e,n,r,s,c,o),parseSlots:(t,e,n)=>Qn(t,e,n,o),parseRaw:(t,e,n,r)=>async function(t,e,n,r,o){const s="_"+Math.random().toString(36).slice(2),i=await On.parseUI(r,n||{},s);o.parseRef(s,t,e||{},{...n},i)}(t,e,n,r,o),mountRouter(t,e){cr.mountView(o,t,e)}};return o}class Ar{static O=!1;constructor(t={}){const e=t.target||document.body;this.k="string"==typeof e?document.getElementById(e)||document.querySelector(e):e,this.S=!1,this.j=null,this.A=null,this.T=[],this.$=new WeakMap,this.N=!1,this.M=[],this.P=[]}async mount(){if(this.S)return this;if(Ar.C(),this.L(),this.j=Er({onMountedRun:this.U.bind(this),suspendMO:this.F.bind(this),resumeMO:this.D.bind(this)}),!this.k)return this;const t=await On.fetchUI(window.location.pathname,{},!0);return await this.j.parseRef("root",this.k,{},t.mod||{},t,!0),this.S=!0,this}destroy(){this.A&&(this.A.disconnect(),this.A=null),this.k&&Kn(this.k),this.T.length=0,this.$=new WeakMap,this.M.length=0,this.P.length=0,this.S=!1,this.j=null}parseDom(t,e={},n={}){this.j&&this.j.compileNode(t,e,n,this.j)}async parseRef(t,e,n={},r={},o=null,s=!1){if(this.j)return this.j.parseRef(t,e,n,r,o,s)}static C(){if(Ar.O)return;Ar.O=!0;const t=document.createElement("style");t.innerHTML="\n [vref] { display: block; }\n [vparsing] { display: none; -webkit-text-fill-color: transparent; }\n vslot, vrouter { display: block; }\n vrouter { height: 100%; width: 100%; overflow: auto; }\n ",document.head.firstChild?document.head.insertBefore(t,document.head.firstChild):document.head.appendChild(t)}L(){this.A=new MutationObserver((t=>{if(this.N)for(const e of t)this.M.push(...e.addedNodes),this.P.push(...e.removedNodes);else for(const e of t){for(let t of e.addedNodes)1===t.nodeType&&(this.q(t),this.I(t),t.querySelectorAll("*[vdelay]").forEach((t=>this.I(t))));for(let t of e.removedNodes)this._(t)}})),this.A.observe(this.k,{attributes:!1,childList:!0,subtree:!0,characterData:!1})}I(t){if(!t.isConnected)return;const e=t.getAttribute("vdelay");if(null!==e){const n=this.T[e];n&&n(t)}}q(t){if(!t||1!==t.nodeType)return;const e=this.$.get(t);e&&(cancelAnimationFrame(e),this.$.delete(t)),t.querySelectorAll?.("*").forEach((t=>{const e=this.$.get(t);e&&(cancelAnimationFrame(e),this.$.delete(t))}))}_(t){if(!t||1!==t.nodeType)return;if(t.hasAttribute?.("data-keep"))return;this.q(t);const e=requestAnimationFrame((()=>{this.$.delete(t),t.isConnected||Kn(t)}));this.$.set(t,e)}B(){const t=this.M.splice(0),e=this.P.splice(0);for(let n of t)1===n.nodeType&&(this.q(n),this.I(n),n.querySelectorAll("*[vdelay]").forEach((t=>this.I(t))));for(let n of e)this._(n)}F(){this.N=!0}D(){this.N&&(this.N=!1,(this.M.length>0||this.P.length>0)&&this.B())}U(t,e,n=!0){if(n){if(t.isConnected)return void e(t);const n=this.T.push((t=>{t.removeAttribute("vdelay"),e(t)}));return void t.setAttribute("vdelay",n-1)}t.isConnected&&e(t);const r=this.T.push(e);t.setAttribute("vdelay",r-1)}}return window.$vhtml=new Ar,window.$vhtml.mount(),Ar},"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define(e):(t="undefined"!=typeof globalThis?globalThis:t||self).vhtml=e();
|