@xtrable-ltd/nanoesis 0.1.27 → 0.1.29
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/adapter-azure-blob.js +1 -1
- package/dist/{chunk-CH4DCPNN.js → chunk-BCWZRKMF.js} +42 -55
- package/dist/{chunk-EGQLAHLP.js → chunk-GFQT7BYP.js} +1 -1
- package/dist/editor-api.d.ts +23 -11
- package/dist/editor-api.js +2 -2
- package/dist/index.js +1 -1
- package/dist/mcp.js +3 -3
- package/editor/assets/{MigrationsPane-eijyEoIw.js → MigrationsPane-Db55MALu.js} +1 -1
- package/editor/assets/{TemplatesPane-DjFFkccd.js → TemplatesPane-DHyXai5d.js} +7 -7
- package/editor/assets/{cssMode-BNSyZV7c.js → cssMode-Ebgz2oYb.js} +1 -1
- package/editor/assets/{freemarker2-B8rz05rs.js → freemarker2-OW9oqAuJ.js} +1 -1
- package/editor/assets/{handlebars-B3M9DD2d.js → handlebars-yU_uDQCo.js} +1 -1
- package/editor/assets/{html-BajOMTpc.js → html-mq2fSbXS.js} +1 -1
- package/editor/assets/{htmlMode-Cqrnk3KF.js → htmlMode-jlHi2ACE.js} +1 -1
- package/editor/assets/{index-BtwjABtU.js → index-CGnjiYmK.js} +77 -80
- package/editor/assets/{javascript-CgKgaKRj.js → javascript-BzRWxc-b.js} +1 -1
- package/editor/assets/{jsonMode-B4i8iNyO.js → jsonMode-WWeyEKIq.js} +1 -1
- package/editor/assets/{liquid-DJaUoyuM.js → liquid-Cy5e_JG_.js} +1 -1
- package/editor/assets/{mdx-DBfFAeUj.js → mdx-DHE9PigU.js} +1 -1
- package/editor/assets/{python-ClvSkGDd.js → python-CZE0IKg0.js} +1 -1
- package/editor/assets/{razor-BJcU60fL.js → razor-D_uNKhBj.js} +1 -1
- package/editor/assets/{tsMode-8Lhfeq5V.js → tsMode-CL4UgdsJ.js} +1 -1
- package/editor/assets/{typescript-D3i2tBiq.js → typescript-Chd3W6I3.js} +1 -1
- package/editor/assets/{xml-CXwucYqL.js → xml-CF6D9amh.js} +1 -1
- package/editor/assets/{yaml-D48SS_IL.js → yaml-DwOKo7BM.js} +1 -1
- package/editor/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-
|
|
2
|
-
var jb=Object.defineProperty;var o0=t=>{throw TypeError(t)};var $b=(t,e,n)=>e in t?jb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ye=(t,e,n)=>$b(t,typeof e!="symbol"?e+"":e,n),Ic=(t,e,n)=>e.has(t)||o0("Cannot "+n);var X=(t,e,n)=>(Ic(t,e,"read from private field"),n?n.call(t):e.get(t)),je=(t,e,n)=>e.has(t)?o0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$e=(t,e,n,r)=>(Ic(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),rt=(t,e,n)=>(Ic(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const F1=!1;var qf=Array.isArray,Yb=Array.prototype.indexOf,Oa=Array.prototype.includes,jl=Array.from,zb=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,U1=Object.getOwnPropertyDescriptors,Wb=Object.prototype,Gb=Array.prototype,jf=Object.getPrototypeOf,u0=Object.isExtensible;function oo(t){return typeof t=="function"}const $f=()=>{};function Kb(t){return t()}function cd(t){for(var e=0;e<t.length;e++)t[e]()}function H1(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function Vb(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const n=[];for(const r of t)if(n.push(r),n.length===e)break;return n}const _n=2,Pi=4,uu=8,Yf=1<<24,Cr=16,Dr=32,ea=64,dd=128,pr=512,rn=1024,fn=2048,ts=4096,Dn=8192,mr=16384,Va=32768,fd=1<<25,Ts=65536,ml=1<<17,Xb=1<<18,Qi=1<<19,q1=1<<20,Vr=1<<25,Ua=65536,gl=1<<21,Ti=1<<22,Xs=1<<23,Xr=Symbol("$state"),j1=Symbol("legacy props"),Qb=Symbol(""),Ju=Symbol("attributes"),hd=Symbol("class"),pd=Symbol("style"),vo=Symbol("text"),el=Symbol("form reset"),$l=new class extends Error{constructor(){super(...arguments);ye(this,"name","StaleReactionError");ye(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var P1;const zf=!!((P1=globalThis.document)!=null&&P1.contentType)&&globalThis.document.contentType.includes("xml");function $1(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Zb(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Jb(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function eE(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function tE(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function nE(t){throw new Error("https://svelte.dev/e/effect_orphan")}function rE(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function sE(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function aE(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function iE(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function oE(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function uE(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const lE=1,cE=2,Y1=4,dE=8,fE=16,hE=1,pE=2,mE=4,gE=8,vE=16,bE=1,EE=2,Xt=Symbol("uninitialized"),z1="http://www.w3.org/1999/xhtml",_E="http://www.w3.org/2000/svg",TE="@attach";function AE(){console.warn("https://svelte.dev/e/derived_inert")}function yE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function NE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function W1(t){return t===this.v}function SE(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function G1(t){return!SE(t,this.v)}let Zi=!1,wE=!1;function IE(){Zi=!0}let It=null;function Mi(t){It=t}function CE(t){return LE().get(t)}function it(t,e=!1,n){It={p:It,i:!1,c:null,e:null,s:t,x:null,r:Ze,l:Zi&&!e?{s:null,u:null,$:[]}:null}}function ot(t){var e=It,n=e.e;if(n!==null){e.e=null;for(var r of n)gm(r)}return e.i=!0,It=e.p,{}}function Ji(){return!Zi||It!==null&&It.l===null}function LE(t){return It===null&&$1(),It.c??(It.c=new Map(OE(It)||void 0))}function OE(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let _a=[];function K1(){var t=_a;_a=[],cd(t)}function xr(t){if(_a.length===0&&!So){var e=_a;queueMicrotask(()=>{e===_a&&K1()})}_a.push(t)}function xE(){for(;_a.length>0;)K1()}function V1(t){var e=Ze;if(e===null)return et.f|=Xs,t;if((e.f&Va)===0&&(e.f&Pi)===0)throw t;js(t,e)}function js(t,e){for(;e!==null;){if((e.f&dd)!==0){if((e.f&Va)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const RE=-7169;function Yt(t,e){t.f=t.f&RE|e}function Wf(t){(t.f&pr)!==0||t.deps===null?Yt(t,rn):Yt(t,ts)}function X1(t){if(t!==null)for(const e of t)(e.f&_n)===0||(e.f&Ua)===0||(e.f^=Ua,X1(e.deps))}function Q1(t,e,n){(t.f&fn)!==0?e.add(t):(t.f&ts)!==0&&n.add(t),X1(t.deps),Yt(t,rn)}let Lu=!1;function DE(t){var e=Lu;try{return Lu=!1,[t(),Lu]}finally{Lu=e}}let Cc=null,ui=null,Me=null,No=null,vn=null,md=null,So=!1,Lc=!1,bi=null,tl=null;var l0=0;let kE=1;var Ci,Fs,Na,Li,Oi,Sa,xi,ps,tu,Wn,nu,Us,zr,Wr,Ri,wa,gt,gd,bo,vd,Z1,J1,nl,PE,bd,ci;const Bl=class Bl{constructor(){je(this,gt);ye(this,"id",kE++);je(this,Ci,!1);ye(this,"linked",!0);je(this,Fs,null);je(this,Na,null);ye(this,"async_deriveds",new Map);ye(this,"current",new Map);ye(this,"previous",new Map);ye(this,"unblocked",new Set);je(this,Li,new Set);je(this,Oi,new Set);je(this,Sa,new Set);je(this,xi,0);je(this,ps,new Map);je(this,tu,null);je(this,Wn,[]);je(this,nu,[]);je(this,Us,new Set);je(this,zr,new Set);je(this,Wr,new Map);je(this,Ri,new Set);ye(this,"is_fork",!1);je(this,wa,!1)}skip_effect(e){X(this,Wr).has(e)||X(this,Wr).set(e,{d:[],m:[]}),X(this,Ri).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=X(this,Wr).get(e);if(r){X(this,Wr).delete(e);for(var s of r.d)Yt(s,fn),n(s);for(s of r.m)Yt(s,ts),n(s)}X(this,Ri).add(e)}capture(e,n,r=!1){e.v!==Xt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Xs)===0&&(this.current.set(e,[n,r]),vn==null||vn.set(e,n)),this.is_fork||(e.v=n)}activate(){Me=this}deactivate(){Me=null,vn=null}flush(){try{Lc=!0,Me=this,rt(this,gt,bo).call(this)}finally{l0=0,md=null,bi=null,tl=null,Lc=!1,Me=null,vn=null,xa.clear()}}discard(){for(const e of X(this,Oi))e(this);X(this,Oi).clear(),X(this,Sa).clear(),rt(this,gt,ci).call(this)}register_created_effect(e){X(this,nu).push(e)}increment(e,n){if($e(this,xi,X(this,xi)+1),e){let r=X(this,ps).get(n)??0;X(this,ps).set(n,r+1)}}decrement(e,n){if($e(this,xi,X(this,xi)-1),e){let r=X(this,ps).get(n)??0;r===1?X(this,ps).delete(n):X(this,ps).set(n,r-1)}X(this,wa)||($e(this,wa,!0),xr(()=>{$e(this,wa,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)X(this,Us).add(r);for(const r of n)X(this,zr).add(r);e.clear(),n.clear()}oncommit(e){X(this,Li).add(e)}ondiscard(e){X(this,Oi).add(e)}on_fork_commit(e){X(this,Sa).add(e)}run_fork_commit_callbacks(){for(const e of X(this,Sa))e(this);X(this,Sa).clear()}settled(){return(X(this,tu)??$e(this,tu,H1())).promise}static ensure(){var e;if(Me===null){const n=Me=new Bl;rt(e=n,gt,bd).call(e),!Lc&&!So&&xr(()=>{X(n,Ci)||n.flush()})}return Me}apply(){{vn=null;return}}schedule(e){var s;if(md=e,(s=e.b)!=null&&s.is_pending&&(e.f&(Pi|uu|Yf))!==0&&(e.f&Va)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(bi!==null&&n===Ze&&(et===null||(et.f&_n)===0))return;if((r&(ea|Dr))!==0){if((r&rn)===0)return;n.f^=rn}}X(this,Wn).push(n)}};Ci=new WeakMap,Fs=new WeakMap,Na=new WeakMap,Li=new WeakMap,Oi=new WeakMap,Sa=new WeakMap,xi=new WeakMap,ps=new WeakMap,tu=new WeakMap,Wn=new WeakMap,nu=new WeakMap,Us=new WeakMap,zr=new WeakMap,Wr=new WeakMap,Ri=new WeakMap,wa=new WeakMap,gt=new WeakSet,gd=function(){if(this.is_fork)return!0;for(const r of X(this,ps).keys()){for(var e=r,n=!1;e.parent!==null;){if(X(this,Wr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},bo=function(){var l,d,h,g;if($e(this,Ci,!0),l0++>1e3&&(rt(this,gt,ci).call(this),BE()),!rt(this,gt,gd).call(this)){for(const f of X(this,Us))X(this,zr).delete(f),Yt(f,fn),this.schedule(f);for(const f of X(this,zr))Yt(f,ts),this.schedule(f)}const e=X(this,Wn);$e(this,Wn,[]),this.apply();var n=bi=[],r=[],s=tl=[];for(const f of e)try{rt(this,gt,vd).call(this,f,n,r)}catch(p){throw nm(f),p}if(Me=null,s.length>0){var a=Bl.ensure();for(const f of s)a.schedule(f)}if(bi=null,tl=null,rt(this,gt,gd).call(this)){rt(this,gt,nl).call(this,r),rt(this,gt,nl).call(this,n);for(const[f,p]of X(this,Wr))tm(f,p);s.length>0&&rt(l=Me,gt,bo).call(l);return}const i=rt(this,gt,Z1).call(this);if(i){rt(d=i,gt,J1).call(d,this);return}X(this,Us).clear(),X(this,zr).clear();for(const f of X(this,Li))f(this);X(this,Li).clear(),No=this,c0(r),c0(n),No=null,(h=X(this,tu))==null||h.resolve();var o=Me;if(this.linked&&X(this,xi)===0&&rt(this,gt,ci).call(this),X(this,Wn).length>0){o===null&&(o=this,rt(this,gt,bd).call(this));const f=o;X(f,Wn).push(...X(this,Wn).filter(p=>!X(f,Wn).includes(p)))}o!==null&&rt(g=o,gt,bo).call(g)},vd=function(e,n,r){e.f^=rn;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Dr|ea))!==0,o=i&&(a&rn)!==0,l=o||(a&Dn)!==0||X(this,Wr).has(s);if(!l&&s.fn!==null){i?s.f^=rn:(a&Pi)!==0?n.push(s):du(s)&&((a&Cr)!==0&&X(this,zr).add(s),Hi(s));var d=s.first;if(d!==null){s=d;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},Z1=function(){for(var e=X(this,Fs);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=X(e,Fs)}return null},J1=function(e){var r;for(const[s,a]of e.current)!this.previous.has(s)&&e.previous.has(s)&&this.previous.set(s,e.previous.get(s)),this.current.set(s,a);for(const[s,a]of e.async_deriveds){const i=this.async_deriveds.get(s);i&&a.promise.then(i.resolve)}const n=s=>{var a=s.reactions;if(a!==null)for(const l of a){var i=l.f;if((i&_n)!==0)n(l);else{var o=l;i&(Ti|Cr)&&!this.async_deriveds.has(o)&&(X(this,zr).delete(o),Yt(o,fn),this.schedule(o))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),rt(r=e,gt,ci).call(r),Me=this,rt(this,gt,bo).call(this)},nl=function(e){for(var n=0;n<e.length;n+=1)Q1(e[n],X(this,Us),X(this,zr))},PE=function(){var h;rt(this,gt,ci).call(this);for(let g=Cc;g!==null;g=X(g,Na)){var e=g.id<this.id,n=[];for(const[f,[p,v]]of this.current){if(g.current.has(f)){var r=g.current.get(f)[0];if(e&&p!==r)g.current.set(f,[p,v]);else continue}n.push(f)}if(e)for(const[f,p]of this.async_deriveds){const v=g.async_deriveds.get(f);v&&p.promise.then(v.resolve)}if(X(g,Ci)){var s=[...g.current.keys()].filter(f=>!this.current.has(f));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const f of X(this,Ri))g.unskip_effect(f,p=>{var v;(p.f&(Cr|Ti))!==0?g.schedule(p):rt(v=g,gt,nl).call(v,[p])});g.activate();var a=new Set,i=new Map;for(var o of n)em(o,s,a,i);i=new Map;var l=[...g.current.keys()].filter(f=>this.current.has(f)?this.current.get(f)[0]!==f.v:!0);if(l.length>0)for(const f of X(this,nu))(f.f&(mr|Dn|ml))===0&&Gf(f,l,i)&&((f.f&(Ti|Cr))!==0?(Yt(f,fn),g.schedule(f)):X(g,Us).add(f));if(X(g,Wn).length>0&&!X(g,wa)){g.apply();for(var d of X(g,Wn))rt(h=g,gt,vd).call(h,d,[],[]);$e(g,Wn,[])}g.deactivate()}}}},bd=function(){ui===null?Cc=ui=this:($e(ui,Na,this),$e(this,Fs,ui)),ui=this},ci=function(){var e=X(this,Fs),n=X(this,Na);e===null?Cc=n:$e(e,Na,n),n===null?ui=e:$e(n,Fs,e),this.linked=!1};let Ha=Bl;function ME(t){var e=So;So=!0;try{for(var n;;){if(xE(),Me===null)return n;Me.flush()}}finally{So=e}}function BE(){try{rE()}catch(t){js(t,md)}}let Tr=null;function c0(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(mr|Dn))===0&&du(r)&&(Tr=new Set,Hi(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Em(r),(Tr==null?void 0:Tr.size)>0)){xa.clear();for(const s of Tr){if((s.f&(mr|Dn))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)Tr.has(i)&&(Tr.delete(i),a.push(i)),i=i.parent;for(let o=a.length-1;o>=0;o--){const l=a[o];(l.f&(mr|Dn))===0&&Hi(l)}}Tr.clear()}}Tr=null}}function em(t,e,n,r){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const s of t.reactions){const a=s.f;(a&_n)!==0?em(s,e,n,r):(a&(Ti|Cr))!==0&&(a&fn)===0&&Gf(s,e,r)&&(Yt(s,fn),Kf(s))}}function Gf(t,e,n){const r=n.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const s of t.deps){if(Oa.call(e,s))return!0;if((s.f&_n)!==0&&Gf(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function Kf(t){Me.schedule(t)}function tm(t,e){if(!((t.f&Dr)!==0&&(t.f&rn)!==0)){(t.f&fn)!==0?e.d.push(t):(t.f&ts)!==0&&e.m.push(t),Yt(t,rn);for(var n=t.first;n!==null;)tm(n,e),n=n.next}}function nm(t){Yt(t,rn);for(var e=t.first;e!==null;)nm(e),e=e.next}function FE(t){let e=0,n=qa(0),r;return()=>{Zf()&&(u(n),zl(()=>(e===0&&(r=na(()=>t(()=>wo(n)))),e+=1,()=>{xr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,wo(n))})})))}}var UE=Ts|Qi;function HE(t,e,n,r){new qE(t,e,n,r)}var ir,Hf,or,Ia,Hn,ur,On,Gn,ms,Ca,Hs,Di,ru,su,gs,Fl,zt,jE,$E,YE,Ed,rl,sl,_d,Td;class qE{constructor(e,n,r,s){je(this,zt);ye(this,"parent");ye(this,"is_pending",!1);ye(this,"transform_error");je(this,ir);je(this,Hf,null);je(this,or);je(this,Ia);je(this,Hn);je(this,ur,null);je(this,On,null);je(this,Gn,null);je(this,ms,null);je(this,Ca,0);je(this,Hs,0);je(this,Di,!1);je(this,ru,new Set);je(this,su,new Set);je(this,gs,null);je(this,Fl,FE(()=>($e(this,gs,qa(X(this,Ca))),()=>{$e(this,gs,null)})));var a;$e(this,ir,e),$e(this,or,n),$e(this,Ia,i=>{var o=Ze;o.b=this,o.f|=dd,r(i)}),this.parent=Ze.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),$e(this,Hn,Xa(()=>{rt(this,zt,Ed).call(this)},UE))}defer_effect(e){Q1(e,X(this,ru),X(this,su))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!X(this,or).pending}update_pending_count(e,n){rt(this,zt,_d).call(this,e,n),$e(this,Ca,X(this,Ca)+e),!(!X(this,gs)||X(this,Di))&&($e(this,Di,!0),xr(()=>{$e(this,Di,!1),X(this,gs)&&Fi(X(this,gs),X(this,Ca))}))}get_effect_pending(){return X(this,Fl).call(this),u(X(this,gs))}error(e){if(!X(this,or).onerror&&!X(this,or).failed)throw e;Me!=null&&Me.is_fork?(X(this,ur)&&Me.skip_effect(X(this,ur)),X(this,On)&&Me.skip_effect(X(this,On)),X(this,Gn)&&Me.skip_effect(X(this,Gn)),Me.on_fork_commit(()=>{rt(this,zt,Td).call(this,e)})):rt(this,zt,Td).call(this,e)}}ir=new WeakMap,Hf=new WeakMap,or=new WeakMap,Ia=new WeakMap,Hn=new WeakMap,ur=new WeakMap,On=new WeakMap,Gn=new WeakMap,ms=new WeakMap,Ca=new WeakMap,Hs=new WeakMap,Di=new WeakMap,ru=new WeakMap,su=new WeakMap,gs=new WeakMap,Fl=new WeakMap,zt=new WeakSet,jE=function(){try{$e(this,ur,jn(()=>X(this,Ia).call(this,X(this,ir))))}catch(e){this.error(e)}},$E=function(e){const n=X(this,or).failed;n&&$e(this,Gn,jn(()=>{n(X(this,ir),()=>e,()=>()=>{})}))},YE=function(){const e=X(this,or).pending;e&&(this.is_pending=!0,$e(this,On,jn(()=>e(X(this,ir)))),xr(()=>{var n=$e(this,ms,document.createDocumentFragment()),r=Qr();n.append(r),$e(this,ur,rt(this,zt,sl).call(this,()=>jn(()=>X(this,Ia).call(this,r)))),X(this,Hs)===0&&(X(this,ir).before(n),$e(this,ms,null),Ra(X(this,On),()=>{$e(this,On,null)}),rt(this,zt,rl).call(this,Me))}))},Ed=function(){try{if(this.is_pending=this.has_pending_snippet(),$e(this,Hs,0),$e(this,Ca,0),$e(this,ur,jn(()=>{X(this,Ia).call(this,X(this,ir))})),X(this,Hs)>0){var e=$e(this,ms,document.createDocumentFragment());th(X(this,ur),e);const n=X(this,or).pending;$e(this,On,jn(()=>n(X(this,ir))))}else rt(this,zt,rl).call(this,Me)}catch(n){this.error(n)}},rl=function(e){this.is_pending=!1,e.transfer_effects(X(this,ru),X(this,su))},sl=function(e){var n=Ze,r=et,s=It;ns(X(this,Hn)),vr(X(this,Hn)),Mi(X(this,Hn).ctx);try{return Ha.ensure(),e()}catch(a){return V1(a),null}finally{ns(n),vr(r),Mi(s)}},_d=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&rt(r=this.parent,zt,_d).call(r,e,n);return}$e(this,Hs,X(this,Hs)+e),X(this,Hs)===0&&(rt(this,zt,rl).call(this,n),X(this,On)&&Ra(X(this,On),()=>{$e(this,On,null)}),X(this,ms)&&(X(this,ir).before(X(this,ms)),$e(this,ms,null)))},Td=function(e){X(this,ur)&&(bn(X(this,ur)),$e(this,ur,null)),X(this,On)&&(bn(X(this,On)),$e(this,On,null)),X(this,Gn)&&(bn(X(this,Gn)),$e(this,Gn,null));var n=X(this,or).onerror;let r=X(this,or).failed;var s=!1,a=!1;const i=()=>{if(s){NE();return}s=!0,a&&uE(),X(this,Gn)!==null&&Ra(X(this,Gn),()=>{$e(this,Gn,null)}),rt(this,zt,sl).call(this,()=>{rt(this,zt,Ed).call(this)})},o=l=>{try{a=!0,n==null||n(l,i),a=!1}catch(d){js(d,X(this,Hn)&&X(this,Hn).parent)}r&&$e(this,Gn,rt(this,zt,sl).call(this,()=>{try{return jn(()=>{var d=Ze;d.b=this,d.f|=dd,r(X(this,ir),()=>l,()=>i)})}catch(d){return js(d,X(this,Hn).parent),null}}))};xr(()=>{var l;try{l=this.transform_error(e)}catch(d){js(d,X(this,Hn)&&X(this,Hn).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(o,d=>js(d,X(this,Hn)&&X(this,Hn).parent)):o(l)})};function rm(t,e,n,r){const s=Ji()?Bi:Vf;var a=t.filter(f=>!f.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Ze,o=zE(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(f=>f.promise)):null;function d(f){if((i.f&mr)===0){o();try{r(f)}catch(p){js(p,i)}vl()}}var h=sm();if(n.length===0){l.then(()=>d(e.map(s))).finally(h);return}function g(){Promise.all(n.map(f=>WE(f))).then(f=>d([...e.map(s),...f])).catch(f=>js(f,i)).finally(h)}l?l.then(()=>{o(),g(),vl()}):g()}function zE(){var t=Ze,e=et,n=It,r=Me;return function(a=!0){ns(t),vr(e),Mi(n),a&&(t.f&mr)===0&&(r==null||r.activate(),r==null||r.apply())}}function vl(t=!0){ns(null),vr(null),Mi(null),t&&(Me==null||Me.deactivate())}function sm(){var t=Ze,e=t.b,n=Me,r=e.is_rendered();return e.update_pending_count(1,n),n.increment(r,t),()=>{e.update_pending_count(-1,n),n.decrement(r,t)}}function Bi(t){var e=_n|fn;return Ze!==null&&(Ze.f|=Qi),{ctx:It,deps:null,effects:null,equals:W1,f:e,fn:t,reactions:null,rv:0,v:Xt,wv:0,parent:Ze,ac:null}}const Ou=Symbol("obsolete");function WE(t,e,n){let r=Ze;r===null&&Zb();var s=void 0,a=qa(Xt),i=!et,o=new Set;return r_(()=>{var p;var l=Ze,d=H1();s=d.promise;try{Promise.resolve(t()).then(d.resolve,v=>{v!==$l&&d.reject(v)}).finally(vl)}catch(v){d.reject(v),vl()}var h=Me;if(i){if((l.f&Va)!==0)var g=sm();if(r.b.is_rendered())(p=h.async_deriveds.get(l))==null||p.reject(Ou);else for(const v of o.values())v.reject(Ou);o.add(d),h.async_deriveds.set(l,d)}const f=(v,T=void 0)=>{g==null||g(),o.delete(d),T!==Ou&&(h.activate(),T?(a.f|=Xs,Fi(a,T)):((a.f&Xs)!==0&&(a.f^=Xs),Fi(a,v)),h.deactivate())};d.promise.then(f,v=>f(null,v||"unknown"))}),cu(()=>{for(const l of o)l.reject(Ou)}),new Promise(l=>{function d(h){function g(){h===s?l(a):d(s)}h.then(g,g)}d(s)})}function Ae(t){const e=Bi(t);return Am(e),e}function Vf(t){const e=Bi(t);return e.equals=G1,e}function GE(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)bn(e[n])}}function Xf(t){var e,n=Ze,r=t.parent;if(!As&&r!==null&&t.v!==Xt&&(r.f&(mr|Dn))!==0)return AE(),t.v;ns(r);try{t.f&=~Ua,GE(t),e=wm(t)}finally{ns(n)}return e}function am(t){var e=Xf(t);if(!t.equals(e)&&(t.wv=Nm(),(!(Me!=null&&Me.is_fork)||t.deps===null)&&(Me!==null?(Me.capture(t,e,!0),No==null||No.capture(t,e,!0)):t.v=e,t.deps===null))){Yt(t,rn);return}As||(vn!==null?(Zf()||Me!=null&&Me.is_fork)&&vn.set(t,e):Wf(t))}function KE(t){var e,n;if(t.effects!==null)for(const r of t.effects)(r.teardown||r.ac)&&((e=r.teardown)==null||e.call(r),(n=r.ac)==null||n.abort($l),r.fn!==null&&(r.teardown=$f),r.ac=null,qo(r,0),Jf(r))}function im(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&Hi(e)}let bl=new Set;const xa=new Map;let om=!1;function qa(t,e){var n={f:0,v:t,reactions:null,equals:W1,rv:0,wv:0};return n}function Q(t,e){const n=qa(t);return Am(n),n}function VE(t,e=!1,n=!0){var s;const r=qa(t);return e||(r.equals=G1),Zi&&n&&It!==null&&It.l!==null&&((s=It.l).s??(s.s=[])).push(r),r}function A(t,e,n=!1){et!==null&&(!Lr||(et.f&ml)!==0)&&Ji()&&(et.f&(_n|Cr|Ti|ml))!==0&&(gr===null||!Oa.call(gr,t))&&oE();let r=n?dt(e):e;return Fi(t,r,tl)}function Fi(t,e,n=null){if(!t.equals(e)){xa.set(t,As?e:t.v);var r=Ha.ensure();if(r.capture(t,e),(t.f&_n)!==0){const s=t;(t.f&fn)!==0&&Xf(s),vn===null&&Wf(s)}t.wv=Nm(),um(t,fn,n),Ji()&&Ze!==null&&(Ze.f&rn)!==0&&(Ze.f&(Dr|ea))===0&&(ar===null?i_([t]):ar.push(t)),!r.is_fork&&bl.size>0&&!om&&XE()}return e}function XE(){om=!1;for(const t of bl){(t.f&rn)!==0&&Yt(t,ts);let e;try{e=du(t)}catch{e=!0}e&&Hi(t)}bl.clear()}function wo(t){A(t,t.v+1)}function um(t,e,n){var r=t.reactions;if(r!==null)for(var s=Ji(),a=r.length,i=0;i<a;i++){var o=r[i],l=o.f;if(!(!s&&o===Ze)){var d=(l&fn)===0;if(d&&Yt(o,e),(l&ml)!==0)bl.add(o);else if((l&_n)!==0){var h=o;vn==null||vn.delete(h),(l&Ua)===0&&(l&pr&&(Ze===null||(Ze.f&gl)===0)&&(o.f|=Ua),um(h,ts,n))}else if(d){var g=o;(l&Cr)!==0&&Tr!==null&&Tr.add(g),n!==null?n.push(g):Kf(g)}}}}function dt(t){if(typeof t!="object"||t===null||Xr in t)return t;const e=jf(t);if(e!==Wb&&e!==Gb)return t;var n=new Map,r=qf(t),s=Q(0),a=Da,i=o=>{if(Da===a)return o();var l=et,d=Da;vr(null),m0(a);var h=o();return vr(l),m0(d),h};return r&&n.set("length",Q(t.length)),new Proxy(t,{defineProperty(o,l,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&aE();var h=n.get(l);return h===void 0?i(()=>{var g=Q(d.value);return n.set(l,g),g}):A(h,d.value,!0),!0},deleteProperty(o,l){var d=n.get(l);if(d===void 0){if(l in o){const h=i(()=>Q(Xt));n.set(l,h),wo(s)}}else A(d,Xt),wo(s);return!0},get(o,l,d){var p;if(l===Xr)return t;var h=n.get(l),g=l in o;if(h===void 0&&(!g||(p=Vs(o,l))!=null&&p.writable)&&(h=i(()=>{var v=dt(g?o[l]:Xt),T=Q(v);return T}),n.set(l,h)),h!==void 0){var f=u(h);return f===Xt?void 0:f}return Reflect.get(o,l,d)},getOwnPropertyDescriptor(o,l){var d=Reflect.getOwnPropertyDescriptor(o,l);if(d&&"value"in d){var h=n.get(l);h&&(d.value=u(h))}else if(d===void 0){var g=n.get(l),f=g==null?void 0:g.v;if(g!==void 0&&f!==Xt)return{enumerable:!0,configurable:!0,value:f,writable:!0}}return d},has(o,l){var f;if(l===Xr)return!0;var d=n.get(l),h=d!==void 0&&d.v!==Xt||Reflect.has(o,l);if(d!==void 0||Ze!==null&&(!h||(f=Vs(o,l))!=null&&f.writable)){d===void 0&&(d=i(()=>{var p=h?dt(o[l]):Xt,v=Q(p);return v}),n.set(l,d));var g=u(d);if(g===Xt)return!1}return h},set(o,l,d,h){var C;var g=n.get(l),f=l in o;if(r&&l==="length")for(var p=d;p<g.v;p+=1){var v=n.get(p+"");v!==void 0?A(v,Xt):p in o&&(v=i(()=>Q(Xt)),n.set(p+"",v))}if(g===void 0)(!f||(C=Vs(o,l))!=null&&C.writable)&&(g=i(()=>Q(void 0)),A(g,dt(d)),n.set(l,g));else{f=g.v!==Xt;var T=i(()=>dt(d));A(g,T)}var _=Reflect.getOwnPropertyDescriptor(o,l);if(_!=null&&_.set&&_.set.call(h,d),!f){if(r&&typeof l=="string"){var E=n.get("length"),O=Number(l);Number.isInteger(O)&&O>=E.v&&A(E,O+1)}wo(s)}return!0},ownKeys(o){u(s);var l=Reflect.ownKeys(o).filter(g=>{var f=n.get(g);return f===void 0||f.v!==Xt});for(var[d,h]of n)h.v!==Xt&&!(d in o)&&l.push(d);return l},setPrototypeOf(){iE()}})}function d0(t){try{if(t!==null&&typeof t=="object"&&Xr in t)return t[Xr]}catch{}return t}function lm(t,e){return Object.is(d0(t),d0(e))}var f0,cm,dm,fm;function QE(){if(f0===void 0){f0=window,cm=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;dm=Vs(e,"firstChild").get,fm=Vs(e,"nextSibling").get,u0(t)&&(t[hd]=void 0,t[Ju]=null,t[pd]=void 0,t.__e=void 0),u0(n)&&(n[vo]=void 0)}}function Qr(t=""){return document.createTextNode(t)}function Ui(t){return dm.call(t)}function lu(t){return fm.call(t)}function N(t,e){return Ui(t)}function tt(t,e=!1){{var n=Ui(t);return n instanceof Comment&&n.data===""?lu(n):n}}function I(t,e=1,n=!1){let r=t;for(;e--;)r=lu(r);return r}function ZE(t){t.textContent=""}function hm(){return!1}function pm(t,e,n){return document.createElementNS(e??z1,t,void 0)}function ja(t,e){if(e){const n=document.body;t.autofocus=!0,xr(()=>{document.activeElement===n&&t.focus()})}}let h0=!1;function JE(){h0||(h0=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[el])==null||e.call(n)})},{capture:!0}))}function Yl(t){var e=et,n=Ze;vr(null),ns(null);try{return t()}finally{vr(e),ns(n)}}function Qf(t,e,n,r=n){t.addEventListener(e,()=>Yl(n));const s=t[el];s?t[el]=()=>{s(),r(!0)}:t[el]=()=>r(!0),JE()}function mm(t){Ze===null&&(et===null&&nE(),tE()),As&&eE()}function e_(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Pr(t,e){var n=Ze;n!==null&&(n.f&Dn)!==0&&(t|=Dn);var r={ctx:It,deps:null,nodes:null,f:t|fn|pr,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};Me==null||Me.register_created_effect(r);var s=r;if((t&Pi)!==0)bi!==null?bi.push(r):Ha.ensure().schedule(r);else if(e!==null){try{Hi(r)}catch(i){throw bn(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Qi)===0&&(s=s.first,(t&Cr)!==0&&(t&Ts)!==0&&s!==null&&(s.f|=Ts))}if(s!==null&&(s.parent=n,n!==null&&e_(s,n),et!==null&&(et.f&_n)!==0&&(t&ea)===0)){var a=et;(a.effects??(a.effects=[])).push(s)}return r}function Zf(){return et!==null&&!Lr}function cu(t){const e=Pr(uu,null);return Yt(e,rn),e.teardown=t,e}function Rt(t){mm();var e=Ze.f,n=!et&&(e&Dr)!==0&&(e&Va)===0;if(n){var r=It;(r.e??(r.e=[])).push(t)}else return gm(t)}function gm(t){return Pr(Pi|q1,t)}function t_(t){return mm(),Pr(uu|q1,t)}function n_(t){Ha.ensure();const e=Pr(ea|Qi,t);return(n={})=>new Promise(r=>{n.outro?Ra(e,()=>{bn(e),r(void 0)}):(bn(e),r(void 0))})}function eo(t){return Pr(Pi,t)}function r_(t){return Pr(Ti|Qi,t)}function zl(t,e=0){return Pr(uu|e,t)}function se(t,e=[],n=[],r=[]){rm(r,e,n,s=>{Pr(uu,()=>t(...s.map(u)))})}function Xa(t,e=0){var n=Pr(Cr|e,t);return n}function vm(t,e=0){var n=Pr(Yf|e,t);return n}function jn(t){return Pr(Dr|Qi,t)}function bm(t){var e=t.teardown;if(e!==null){const n=As,r=et;p0(!0),vr(null);try{e.call(null)}finally{p0(n),vr(r)}}}function Jf(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&Yl(()=>{s.abort($l)});var r=n.next;(n.f&ea)!==0?n.parent=null:bn(n,e),n=r}}function s_(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Dr)===0&&bn(e),e=n}}function bn(t,e=!0){var n=!1;(e||(t.f&Xb)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(a_(t.nodes.start,t.nodes.end),n=!0),Yt(t,fd),Jf(t,e&&!n),qo(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();bm(t),t.f^=fd,t.f|=mr;var s=t.parent;s!==null&&s.first!==null&&Em(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function a_(t,e){for(;t!==null;){var n=t===e?null:lu(t);t.remove(),t=n}}function Em(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Ra(t,e,n=!0){var r=[];_m(t,r,!0);var s=()=>{n&&bn(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var o of r)o.out(i)}else s()}function _m(t,e,n){if((t.f&Dn)===0){t.f^=Dn;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var a=s.next;if((s.f&ea)===0){var i=(s.f&Ts)!==0||(s.f&Dr)!==0&&(t.f&Cr)!==0;_m(s,e,i?n:!1)}s=a}}}function eh(t){Tm(t,!0)}function Tm(t,e){if((t.f&Dn)!==0){t.f^=Dn,(t.f&rn)===0&&(Yt(t,fn),Ha.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&Ts)!==0||(n.f&Dr)!==0;Tm(n,s?e:!1),n=r}var a=t.nodes&&t.nodes.t;if(a!==null)for(const i of a)(i.is_global||e)&&i.in()}}function th(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:lu(n);e.append(n),n=s}}let al=!1,As=!1;function p0(t){As=t}let et=null,Lr=!1;function vr(t){et=t}let Ze=null;function ns(t){Ze=t}let gr=null;function Am(t){et!==null&&(gr===null?gr=[t]:gr.push(t))}let qn=null,zn=0,ar=null;function i_(t){ar=t}let ym=1,Ta=0,Da=Ta;function m0(t){Da=t}function Nm(){return++ym}function du(t){var e=t.f;if((e&fn)!==0)return!0;if(e&_n&&(t.f&=~Ua),(e&ts)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(du(a)&&am(a),a.wv>t.wv)return!0}(e&pr)!==0&&vn===null&&Yt(t,rn)}return!1}function Sm(t,e,n=!0){var r=t.reactions;if(r!==null&&!(gr!==null&&Oa.call(gr,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&_n)!==0?Sm(a,e,!1):e===a&&(n?Yt(a,fn):(a.f&rn)!==0&&Yt(a,ts),Kf(a))}}function wm(t){var T;var e=qn,n=zn,r=ar,s=et,a=gr,i=It,o=Lr,l=Da,d=t.f;qn=null,zn=0,ar=null,et=(d&(Dr|ea))===0?t:null,gr=null,Mi(t.ctx),Lr=!1,Da=++Ta,t.ac!==null&&(Yl(()=>{t.ac.abort($l)}),t.ac=null);try{t.f|=gl;var h=t.fn,g=h();t.f|=Va;var f=t.deps,p=Me==null?void 0:Me.is_fork;if(qn!==null){var v;if(p||qo(t,zn),f!==null&&zn>0)for(f.length=zn+qn.length,v=0;v<qn.length;v++)f[zn+v]=qn[v];else t.deps=f=qn;if(Zf()&&(t.f&pr)!==0)for(v=zn;v<f.length;v++)((T=f[v]).reactions??(T.reactions=[])).push(t)}else!p&&f!==null&&zn<f.length&&(qo(t,zn),f.length=zn);if(Ji()&&ar!==null&&!Lr&&f!==null&&(t.f&(_n|ts|fn))===0)for(v=0;v<ar.length;v++)Sm(ar[v],t);if(s!==null&&s!==t){if(Ta++,s.deps!==null)for(let _=0;_<n;_+=1)s.deps[_].rv=Ta;if(e!==null)for(const _ of e)_.rv=Ta;ar!==null&&(r===null?r=ar:r.push(...ar))}return(t.f&Xs)!==0&&(t.f^=Xs),g}catch(_){return V1(_)}finally{t.f^=gl,qn=e,zn=n,ar=r,et=s,gr=a,Mi(i),Lr=o,Da=l}}function o_(t,e){let n=e.reactions;if(n!==null){var r=Yb.call(n,t);if(r!==-1){var s=n.length-1;s===0?n=e.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(e.f&_n)!==0&&(qn===null||!Oa.call(qn,e))){var a=e;(a.f&pr)!==0&&(a.f^=pr,a.f&=~Ua),a.v!==Xt&&Wf(a),KE(a),qo(a,0)}}function qo(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)o_(t,n[r])}function Hi(t){var e=t.f;if((e&mr)===0){Yt(t,rn);var n=Ze,r=al;Ze=t,al=!0;try{(e&(Cr|Yf))!==0?s_(t):Jf(t),bm(t);var s=wm(t);t.teardown=typeof s=="function"?s:null,t.wv=ym;var a;F1&&wE&&(t.f&fn)!==0&&t.deps}finally{al=r,Ze=n}}}async function Im(){await Promise.resolve(),ME()}function u(t){var e=t.f,n=(e&_n)!==0;if(et!==null&&!Lr){var r=Ze!==null&&(Ze.f&mr)!==0;if(!r&&(gr===null||!Oa.call(gr,t))){var s=et.deps;if((et.f&gl)!==0)t.rv<Ta&&(t.rv=Ta,qn===null&&s!==null&&s[zn]===t?zn++:qn===null?qn=[t]:qn.push(t));else{et.deps??(et.deps=[]),Oa.call(et.deps,t)||et.deps.push(t);var a=t.reactions;a===null?t.reactions=[et]:Oa.call(a,et)||a.push(et)}}}if(As&&xa.has(t))return xa.get(t);if(n){var i=t;if(As){var o=i.v;return((i.f&rn)===0&&i.reactions!==null||Lm(i))&&(o=Xf(i)),xa.set(i,o),o}var l=(i.f&pr)===0&&!Lr&&et!==null&&(al||(et.f&pr)!==0),d=(i.f&Va)===0;du(i)&&(l&&(i.f|=pr),am(i)),l&&!d&&(im(i),Cm(i))}if(vn!=null&&vn.has(t))return vn.get(t);if((t.f&Xs)!==0)throw t.v;return t.v}function Cm(t){if(t.f|=pr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&_n)!==0&&(e.f&pr)===0&&(im(e),Cm(e))}function Lm(t){if(t.v===Xt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(xa.has(e)||(e.f&_n)!==0&&Lm(e))return!0;return!1}function na(t){var e=Lr;try{return Lr=!0,t()}finally{Lr=e}}function u_(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Xr in t)Ad(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Xr in n&&Ad(n)}}}function Ad(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{Ad(t[r],e)}catch{}const n=jf(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=U1(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function l_(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const c_=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function d_(t){return c_.includes(t)}const f_={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function h_(t){return t=t.toLowerCase(),f_[t]??t}const p_=["touchstart","touchmove"];function m_(t){return p_.includes(t)}const Aa=Symbol("events"),Om=new Set,yd=new Set;function xm(t,e,n,r={}){function s(a){if(r.capture||Nd.call(e,a),!a.cancelBubble)return Yl(()=>n==null?void 0:n.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?xr(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function Ue(t,e,n,r,s){var a={capture:r,passive:s},i=xm(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&cu(()=>{e.removeEventListener(t,i,a)})}function ie(t,e,n){(e[Aa]??(e[Aa]={}))[t]=n}function _t(t){for(var e=0;e<t.length;e++)Om.add(t[e]);for(var n of yd)n(t)}let g0=null;function Nd(t){var _,E;var e=this,n=e.ownerDocument,r=t.type,s=((_=t.composedPath)==null?void 0:_.call(t))||[],a=s[0]||t.target;g0=t;var i=0,o=g0===t&&t[Aa];if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){t[Aa]=e;return}var d=s.indexOf(e);if(d===-1)return;l<=d&&(i=l)}if(a=s[i]||t.target,a!==e){zb(t,"currentTarget",{configurable:!0,get(){return a||n}});var h=et,g=Ze;vr(null),ns(null);try{for(var f,p=[];a!==null;){var v=a.assignedSlot||a.parentNode||a.host||null;try{var T=(E=a[Aa])==null?void 0:E[r];T!=null&&(!a.disabled||t.target===a)&&T.call(a,t)}catch(O){f?p.push(O):f=O}if(t.cancelBubble||v===e||v===null)break;a=v}if(f){for(let O of p)queueMicrotask(()=>{throw O});throw f}}finally{t[Aa]=e,delete t.currentTarget,vr(h),ns(g)}}}var M1;const Oc=((M1=globalThis==null?void 0:globalThis.window)==null?void 0:M1.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function g_(t){return(Oc==null?void 0:Oc.createHTML(t))??t}function Rm(t){var e=pm("template");return e.innerHTML=g_(t.replaceAll("<!>","<!---->")),e.content}function qi(t,e){var n=Ze;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function $(t,e){var n=(e&bE)!==0,r=(e&EE)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=Rm(a?t:"<!>"+t),n||(s=Ui(s)));var i=r||cm?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=Ui(i),l=i.lastChild;qi(o,l)}else qi(i,i);return i}}function v_(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=Rm(s),o=Ui(i);a=Ui(o)}var l=a.cloneNode(!0);return qi(l,l),l}}function b_(t,e){return v_(t,e,"svg")}function El(t=""){{var e=Qr(t+"");return qi(e,e),e}}function Vn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Qr();return t.append(e,n),qi(e,n),t}function F(t,e){t!==null&&t.before(e)}function ae(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[vo]??(t[vo]=t.nodeValue))&&(t[vo]=n,t.nodeValue=`${n}`)}function E_(t,e){return __(t,e)}const xu=new Map;function __(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:o}){QE();var l=void 0,d=n_(()=>{var h=n??e.appendChild(Qr());HE(h,{pending:()=>{}},p=>{it({});var v=It;a&&(v.c=a),s&&(r.$$events=s),l=t(p,r)||{},ot()},o);var g=new Set,f=p=>{for(var v=0;v<p.length;v++){var T=p[v];if(!g.has(T)){g.add(T);var _=m_(T);for(const C of[e,document]){var E=xu.get(C);E===void 0&&(E=new Map,xu.set(C,E));var O=E.get(T);O===void 0?(C.addEventListener(T,Nd,{passive:_}),E.set(T,1)):E.set(T,O+1)}}}};return f(jl(Om)),yd.add(f),()=>{var _;for(var p of g)for(const E of[e,document]){var v=xu.get(E),T=v.get(p);--T==0?(E.removeEventListener(p,Nd),v.delete(p),v.size===0&&xu.delete(E)):v.set(p,T)}yd.delete(f),h!==n&&((_=h.parentNode)==null||_.removeChild(h))}});return T_.set(l,d),l}let T_=new WeakMap;var Nr,Gr,Kn,La,au,iu,Ul;class fu{constructor(e,n=!0){ye(this,"anchor");je(this,Nr,new Map);je(this,Gr,new Map);je(this,Kn,new Map);je(this,La,new Set);je(this,au,!0);je(this,iu,e=>{if(X(this,Nr).has(e)){var n=X(this,Nr).get(e),r=X(this,Gr).get(n);if(r)eh(r),X(this,La).delete(n);else{var s=X(this,Kn).get(n);s&&(X(this,Gr).set(n,s.effect),X(this,Kn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of X(this,Nr)){if(X(this,Nr).delete(a),a===e)break;const o=X(this,Kn).get(i);o&&(bn(o.effect),X(this,Kn).delete(i))}for(const[a,i]of X(this,Gr)){if(a===n||X(this,La).has(a))continue;const o=()=>{if(Array.from(X(this,Nr).values()).includes(a)){var d=document.createDocumentFragment();th(i,d),d.append(Qr()),X(this,Kn).set(a,{effect:i,fragment:d})}else bn(i);X(this,La).delete(a),X(this,Gr).delete(a)};X(this,au)||!r?(X(this,La).add(a),Ra(i,o,!1)):o()}}});je(this,Ul,e=>{X(this,Nr).delete(e);const n=Array.from(X(this,Nr).values());for(const[r,s]of X(this,Kn))n.includes(r)||(bn(s.effect),X(this,Kn).delete(r))});this.anchor=e,$e(this,au,n)}ensure(e,n){var r=Me,s=hm();if(n&&!X(this,Gr).has(e)&&!X(this,Kn).has(e))if(s){var a=document.createDocumentFragment(),i=Qr();a.append(i),X(this,Kn).set(e,{effect:jn(()=>n(i)),fragment:a})}else X(this,Gr).set(e,jn(()=>n(this.anchor)));if(X(this,Nr).set(r,e),s){for(const[o,l]of X(this,Gr))o===e?r.unskip_effect(l):r.skip_effect(l);for(const[o,l]of X(this,Kn))o===e?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(X(this,iu)),r.ondiscard(X(this,Ul))}else X(this,iu).call(this,r)}}Nr=new WeakMap,Gr=new WeakMap,Kn=new WeakMap,La=new WeakMap,au=new WeakMap,iu=new WeakMap,Ul=new WeakMap;function ce(t,e,n=!1){var r=new fu(t),s=n?Ts:0;function a(i,o){r.ensure(i,o)}Xa(()=>{var i=!1;e((o,l=0)=>{i=!0,a(l,o)}),i||a(-1,null)},s)}const A_=Symbol("NaN");function y_(t,e,n){var r=new fu(t),s=!Ji();Xa(()=>{var a=e();a!==a&&(a=A_),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function jo(t,e){return e}function N_(t,e,n){for(var r=[],s=e.length,a,i=e.length,o=0;o<s;o++){let g=e[o];Ra(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var f=t.outrogroups;Sd(t,jl(a.done)),f.delete(a),f.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var l=r.length===0&&n!==null;if(l){var d=n,h=d.parentNode;ZE(h),h.append(d),t.items.clear()}Sd(t,e,!l)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function Sd(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const o of i)r.add(t.items.get(o).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=Vr;const i=document.createDocumentFragment();th(a,i)}else bn(e[s],n)}}var v0;function Nt(t,e,n,r,s,a=null){var i=t,o=new Map,l=(e&Y1)!==0;if(l){var d=t;i=d.appendChild(Qr())}var h=null,g=Vf(()=>{var C=n();return qf(C)?C:C==null?[]:jl(C)}),f,p=new Map,v=!0;function T(C){(O.effect.f&mr)===0&&(O.pending.delete(C),O.fallback=h,S_(O,f,i,e,r),h!==null&&(f.length===0?(h.f&Vr)===0?eh(h):(h.f^=Vr,Eo(h,null,i)):Ra(h,()=>{h=null})))}function _(C){O.pending.delete(C)}var E=Xa(()=>{f=u(g);for(var C=f.length,H=new Set,M=Me,J=hm(),U=0;U<C;U+=1){var G=f[U],V=r(G,U),ee=v?null:o.get(V);ee?(ee.v&&Fi(ee.v,G),ee.i&&Fi(ee.i,U),J&&M.unskip_effect(ee.e)):(ee=w_(o,v?i:v0??(v0=Qr()),G,V,U,s,e,n),v||(ee.e.f|=Vr),o.set(V,ee)),H.add(V)}if(C===0&&a&&!h&&(v?h=jn(()=>a(i)):(h=jn(()=>a(v0??(v0=Qr()))),h.f|=Vr)),C>H.size&&Jb(),!v)if(p.set(M,H),J){for(const[y,j]of o)H.has(y)||M.skip_effect(j.e);M.oncommit(T),M.ondiscard(_)}else T(M);u(g)}),O={effect:E,items:o,pending:p,outrogroups:null,fallback:h};v=!1}function uo(t){for(;t!==null&&(t.f&Dr)===0;)t=t.next;return t}function S_(t,e,n,r,s){var ee,y,j,b,R,k,D,W,Y;var a=(r&dE)!==0,i=e.length,o=t.items,l=uo(t.effect.first),d,h=null,g,f=[],p=[],v,T,_,E;if(a)for(E=0;E<i;E+=1)v=e[E],T=s(v,E),_=o.get(T).e,(_.f&Vr)===0&&((y=(ee=_.nodes)==null?void 0:ee.a)==null||y.measure(),(g??(g=new Set)).add(_));for(E=0;E<i;E+=1){if(v=e[E],T=s(v,E),_=o.get(T).e,t.outrogroups!==null)for(const B of t.outrogroups)B.pending.delete(_),B.done.delete(_);if((_.f&Dn)!==0&&(eh(_),a&&((b=(j=_.nodes)==null?void 0:j.a)==null||b.unfix(),(g??(g=new Set)).delete(_))),(_.f&Vr)!==0)if(_.f^=Vr,_===l)Eo(_,null,n);else{var O=h?h.next:l;_===t.effect.last&&(t.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),Ds(t,h,_),Ds(t,_,O),Eo(_,O,n),h=_,f=[],p=[],l=uo(h.next);continue}if(_!==l){if(d!==void 0&&d.has(_)){if(f.length<p.length){var C=p[0],H;h=C.prev;var M=f[0],J=f[f.length-1];for(H=0;H<f.length;H+=1)Eo(f[H],C,n);for(H=0;H<p.length;H+=1)d.delete(p[H]);Ds(t,M.prev,J.next),Ds(t,h,M),Ds(t,J,C),l=C,h=J,E-=1,f=[],p=[]}else d.delete(_),Eo(_,l,n),Ds(t,_.prev,_.next),Ds(t,_,h===null?t.effect.first:h.next),Ds(t,h,_),h=_;continue}for(f=[],p=[];l!==null&&l!==_;)(d??(d=new Set)).add(l),p.push(l),l=uo(l.next);if(l===null)continue}(_.f&Vr)===0&&f.push(_),h=_,l=uo(_.next)}if(t.outrogroups!==null){for(const B of t.outrogroups)B.pending.size===0&&(Sd(t,jl(B.done)),(R=t.outrogroups)==null||R.delete(B));t.outrogroups.size===0&&(t.outrogroups=null)}if(l!==null||d!==void 0){var U=[];if(d!==void 0)for(_ of d)(_.f&Dn)===0&&U.push(_);for(;l!==null;)(l.f&Dn)===0&&l!==t.fallback&&U.push(l),l=uo(l.next);var G=U.length;if(G>0){var V=(r&Y1)!==0&&i===0?n:null;if(a){for(E=0;E<G;E+=1)(D=(k=U[E].nodes)==null?void 0:k.a)==null||D.measure();for(E=0;E<G;E+=1)(Y=(W=U[E].nodes)==null?void 0:W.a)==null||Y.fix()}N_(t,U,V)}}a&&xr(()=>{var B,z;if(g!==void 0)for(_ of g)(z=(B=_.nodes)==null?void 0:B.a)==null||z.apply()})}function w_(t,e,n,r,s,a,i,o){var l=(i&lE)!==0?(i&fE)===0?VE(n,!1,!1):qa(n):null,d=(i&cE)!==0?qa(s):null;return{v:l,i:d,e:jn(()=>(a(e,l??n,d??s,o),()=>{t.delete(r)}))}}function Eo(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&Vr)===0?e.nodes.start:n;r!==null;){var i=lu(r);if(a.before(r),r===s)return;r=i}}function Ds(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function I_(t,e,...n){var r=new fu(t);Xa(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},Ts)}function wd(t,e,n){var r=new fu(t);Xa(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},Ts)}function C_(t,e,n,r,s,a){var i=null,o=t,l=new fu(o,!1);Xa(()=>{const d=e()||null;var h=_E;if(d===null){l.ensure(null,null);return}return l.ensure(d,g=>{if(d){if(i=pm(d,h),qi(i,i),r){var f=i.appendChild(Qr());r(i,f)}Ze.nodes.end=i,g.before(i)}}),()=>{}},Ts),cu(()=>{})}function L_(t,e,n){eo(()=>{var r=na(()=>e(t,n==null?void 0:n())||{});if(r!=null&&r.destroy)return()=>r.destroy()})}function O_(t,e){var n=void 0,r;vm(()=>{n!==(n=e())&&(r&&(bn(r),r=null),n&&(r=jn(()=>{eo(()=>n(t))})))})}function Dm(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=Dm(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function x_(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Dm(t))&&(r&&(r+=" "),r+=e);return r}function km(t){return typeof t=="object"?x_(t):t??""}const b0=[...`
|
|
3
|
-
\r\f \v\uFEFF`];function R_(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,i=0;(i=r.indexOf(s,i))>=0;){var o=i+a;(i===0||b0.includes(r[i-1]))&&(o===r.length||b0.includes(r[o]))?r=(i===0?"":r.substring(0,i))+r.substring(o+1):i=o}}return r===""?null:r}function E0(t,e=!1){var n=e?" !important;":";",r="";for(var s of Object.keys(t)){var a=t[s];a!=null&&a!==""&&(r+=" "+s+": "+a+n)}return r}function xc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function D_(t,e){if(e){var n="",r,s;if(Array.isArray(e)?(r=e[0],s=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,i=0,o=!1,l=[];r&&l.push(...Object.keys(r).map(xc)),s&&l.push(...Object.keys(s).map(xc));var d=0,h=-1;const T=t.length;for(var g=0;g<T;g++){var f=t[g];if(o?f==="/"&&t[g-1]==="*"&&(o=!1):a?a===f&&(a=!1):f==="/"&&t[g+1]==="*"?o=!0:f==='"'||f==="'"?a=f:f==="("?i++:f===")"&&i--,!o&&a===!1&&i===0){if(f===":"&&h===-1)h=g;else if(f===";"||g===T-1){if(h!==-1){var p=xc(t.substring(d,h).trim());if(!l.includes(p)){f!==";"&&g++;var v=t.substring(d,g).trim();n+=" "+v+";"}}d=g+1,h=-1}}}}return r&&(n+=E0(r)),s&&(n+=E0(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function Ge(t,e,n,r,s,a){var i=t[hd];if(i!==n||i===void 0){var o=R_(n,r,a);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t[hd]=n}else if(a&&s!==a)for(var l in a){var d=!!a[l];(s==null||d!==!!s[l])&&t.classList.toggle(l,d)}return a}function Rc(t,e={},n,r){for(var s in n){var a=n[s];e[s]!==a&&(n[s]==null?t.style.removeProperty(s):t.style.setProperty(s,a,r))}}function Wl(t,e,n,r){var s=t[pd];if(s!==e){var a=D_(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[pd]=e}else r&&(Array.isArray(r)?(Rc(t,n==null?void 0:n[0],r[0]),Rc(t,n==null?void 0:n[1],r[1],"important")):Rc(t,n,r));return r}function _l(t,e,n=!1){if(t.multiple){if(e==null)return;if(!qf(e))return yE();for(var r of t.options)r.selected=e.includes(Io(r));return}for(r of t.options){var s=Io(r);if(lm(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Pm(t){var e=new MutationObserver(()=>{_l(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),cu(()=>{e.disconnect()})}function $a(t,e,n=e){var r=new WeakSet,s=!0;Qf(t,"change",a=>{var i=a?"[selected]":":checked",o;if(t.multiple)o=[].map.call(t.querySelectorAll(i),Io);else{var l=t.querySelector(i)??t.querySelector("option:not([disabled])");o=l&&Io(l)}n(o),t.__value=o,Me!==null&&r.add(Me)}),eo(()=>{var a=e();if(t===document.activeElement){var i=Me;if(r.has(i))return}if(_l(t,a,s),s&&a===void 0){var o=t.querySelector(":checked");o!==null&&(a=Io(o),n(a))}t.__value=a,s=!1}),Pm(t)}function Io(t){return"__value"in t?t.__value:t.value}const lo=Symbol("class"),co=Symbol("style"),Mm=Symbol("is custom element"),Bm=Symbol("is html"),k_=zf?"option":"OPTION",P_=zf?"select":"SELECT",M_=zf?"progress":"PROGRESS";function B_(t,e){var n=Gl(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==M_)||(t.value=e??"")}function F_(t,e){var n=Gl(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function U_(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function be(t,e,n,r){var s=Gl(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[Qb]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Fm(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function H_(t,e,n,r,s=!1,a=!1){var i=Gl(t),o=i[Mm],l=!i[Bm],d=e||{},h=t.nodeName===k_;for(var g in e)g in n||(n[g]=null);n.class?n.class=km(n.class):n[lo]&&(n.class=null),n[co]&&(n.style??(n.style=null));var f=Fm(t);for(const C in n){let H=n[C];if(h&&C==="value"&&H==null){t.value=t.__value="",d[C]=H;continue}if(C==="class"){var p=t.namespaceURI==="http://www.w3.org/1999/xhtml";Ge(t,p,H,r,e==null?void 0:e[lo],n[lo]),d[C]=H,d[lo]=n[lo];continue}if(C==="style"){Wl(t,H,e==null?void 0:e[co],n[co]),d[C]=H,d[co]=n[co];continue}var v=d[C];if(!(H===v&&!(H===void 0&&t.hasAttribute(C)))){d[C]=H;var T=C[0]+C[1];if(T!=="$$")if(T==="on"){const M={},J="$$"+C;let U=C.slice(2);var _=d_(U);if(l_(U)&&(U=U.slice(0,-7),M.capture=!0),!_&&v){if(H!=null)continue;t.removeEventListener(U,d[J],M),d[J]=null}if(_)ie(U,t,H),_t([U]);else if(H!=null){let G=function(V){d[C].call(this,V)};d[J]=xm(U,t,G,M)}}else if(C==="style")be(t,C,H);else if(C==="autofocus")ja(t,!!H);else if(!o&&(C==="__value"||C==="value"&&H!=null))t.value=t.__value=H;else if(C==="selected"&&h)U_(t,H);else{var E=C;l||(E=h_(E));var O=E==="defaultValue"||E==="defaultChecked";if(H==null&&!o&&!O)if(i[C]=null,E==="value"||E==="checked"){let M=t;const J=e===void 0;if(E==="value"){let U=M.defaultValue;M.removeAttribute(E),M.defaultValue=U,M.value=M.__value=J?U:null}else{let U=M.defaultChecked;M.removeAttribute(E),M.defaultChecked=U,M.checked=J?U:!1}}else t.removeAttribute(C);else O||f.includes(E)&&(o||typeof H!="string")?(t[E]=H,E in i&&(i[E]=Xt)):typeof H!="function"&&be(t,E,H)}}}return d}function _0(t,e,n=[],r=[],s=[],a,i=!1,o=!1){rm(s,n,r,l=>{var d=void 0,h={},g=t.nodeName===P_,f=!1;if(vm(()=>{var v=e(...l.map(u)),T=H_(t,d,v,a,i,o);f&&g&&"value"in v&&_l(t,v.value);for(let E of Object.getOwnPropertySymbols(h))v[E]||bn(h[E]);for(let E of Object.getOwnPropertySymbols(v)){var _=v[E];E.description===TE&&(!d||_!==d[E])&&(h[E]&&bn(h[E]),h[E]=jn(()=>O_(t,()=>_))),T[E]=_}d=T}),g){var p=t;eo(()=>{_l(p,d.value,!0),Pm(p)})}f=!0})}function Gl(t){return t[Ju]??(t[Ju]={[Mm]:t.nodeName.includes("-"),[Bm]:t.namespaceURI===z1})}var T0=new Map;function Fm(t){var e=t.getAttribute("is")||t.nodeName,n=T0.get(e);if(n)return n;T0.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=U1(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=jf(s)}return n}function yt(t,e,n=e){var r=new WeakSet;Qf(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=kc(t)?Pc(a):a,n(a),Me!==null&&r.add(Me),await Im(),a!==(a=e())){var i=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=a??"",o!==null){var d=t.value.length;i===o&&o===l&&d>l?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=i,t.selectionEnd=Math.min(o,d))}}}),na(e)==null&&t.value&&(n(kc(t)?Pc(t.value):t.value),Me!==null&&r.add(Me)),zl(()=>{var s=e();if(t===document.activeElement){var a=Me;if(r.has(a))return}kc(t)&&s===Pc(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const Dc=new Set;function q_(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var o of e)i=i[o]??(i[o]=[]);i.push(n),Qf(n,"change",()=>{var l=n.__value;a&&(l=j_(i,l,n.checked)),s(l)},()=>s(a?[]:null)),zl(()=>{var l=r();a?(l=l||[],n.checked=l.includes(n.__value)):n.checked=lm(n.__value,l)}),cu(()=>{var l=i.indexOf(n);l!==-1&&i.splice(l,1)}),Dc.has(i)||(Dc.add(i),xr(()=>{i.sort((l,d)=>l.compareDocumentPosition(d)===4?-1:1),Dc.delete(i)})),xr(()=>{})}function j_(t,e,n){for(var r=new Set,s=0;s<t.length;s+=1)t[s].checked&&r.add(t[s].__value);return n||r.delete(e),Array.from(r)}function kc(t){var e=t.type;return e==="number"||e==="range"}function Pc(t){return t===""?null:+t}var qs,ki,ou,Hl,Um;const ql=class ql{constructor(e){je(this,Hl);je(this,qs,new WeakMap);je(this,ki);je(this,ou);$e(this,ou,e)}observe(e,n){var r=X(this,qs).get(e)||new Set;return r.add(n),X(this,qs).set(e,r),rt(this,Hl,Um).call(this).observe(e,X(this,ou)),()=>{var s=X(this,qs).get(e);s.delete(n),s.size===0&&(X(this,qs).delete(e),X(this,ki).unobserve(e))}}};qs=new WeakMap,ki=new WeakMap,ou=new WeakMap,Hl=new WeakSet,Um=function(){return X(this,ki)??$e(this,ki,new ResizeObserver(e=>{for(var n of e){ql.entries.set(n.target,n);for(var r of X(this,qs).get(n.target)||[])r(n)}}))},ye(ql,"entries",new WeakMap);let Id=ql;var $_=new Id({box:"border-box"});function Y_(t,e,n){var r=$_.observe(t,()=>n(t[e]));eo(()=>(na(()=>n(t[e])),r))}function Mc(t,e){return t===e||(t==null?void 0:t[Xr])===e}function hn(t={},e,n,r){var s=It.r,a=Ze;return eo(()=>{var i,o;return zl(()=>{i=o,o=[],na(()=>{Mc(n(...o),t)||(e(t,...o),i&&Mc(n(...i),t)&&e(null,...i))})}),()=>{let l=a;for(;l!==s&&l.parent!==null&&l.parent.f&fd;)l=l.parent;const d=()=>{o&&Mc(n(...o),t)&&e(null,...o)},h=l.teardown;l.teardown=()=>{d(),h==null||h()}}}),t}function Hm(t=!1){const e=It,n=e.l.u;if(!n)return;let r=()=>u_(e.s);if(t){let s=0,a={};const i=Bi(()=>{let o=!1;const l=e.s;for(const d in l)l[d]!==a[d]&&(a[d]=l[d],o=!0);return o&&s++,s});r=()=>u(i)}n.b.length&&t_(()=>{A0(e,r),cd(n.b)}),Rt(()=>{const s=na(()=>n.m.map(Kb));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&Rt(()=>{A0(e,r),cd(n.a)})}function A0(t,e){if(t.l.s)for(const n of t.l.s)u(n);e()}const z_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Qt(t,e,n){return new Proxy({props:t,exclude:e},z_)}const W_={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(oo(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r)return r[e]}},set(t,e,n){let r=t.props.length;for(;r--;){let s=t.props[r];oo(s)&&(s=s());const a=Vs(s,e);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(oo(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=Vs(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Xr||e===j1)return!1;for(let n of t.props)if(oo(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(oo(n)&&(n=n()),!!n){for(const r in n)e.includes(r)||e.push(r);for(const r of Object.getOwnPropertySymbols(n))e.includes(r)||e.push(r)}return e}};function sn(...t){return new Proxy({props:t},W_)}function Xn(t,e,n,r){var H;var s=!Zi||(n&pE)!==0,a=(n&gE)!==0,i=(n&vE)!==0,o=r,l=!0,d=void 0,h=()=>i&&s?(d??(d=Bi(r)),u(d)):(l&&(l=!1,o=i?na(r):r),o);let g;if(a){var f=Xr in t||j1 in t;g=((H=Vs(t,e))==null?void 0:H.set)??(f&&e in t?M=>t[e]=M:void 0)}var p,v=!1;a?[p,v]=DE(()=>t[e]):p=t[e],p===void 0&&r!==void 0&&(p=h(),g&&(s&&sE(),g(p)));var T;if(s?T=()=>{var M=t[e];return M===void 0?h():(l=!0,M)}:T=()=>{var M=t[e];return M!==void 0&&(o=void 0),M===void 0?o:M},s&&(n&mE)===0)return T;if(g){var _=t.$$legacy;return(function(M,J){return arguments.length>0?((!s||!J||_||v)&&g(J?T():M),M):T()})}var E=!1,O=((n&hE)!==0?Bi:Vf)(()=>(E=!1,T()));a&&u(O);var C=Ze;return(function(M,J){if(arguments.length>0){const U=J?u(O):s&&a?dt(M):M;return A(O,U),E=!0,o!==void 0&&(o=U),M}return As&&E||(C.f&mr)!==0?O.v:u(O)})}function Qa(t){It===null&&$1(),Zi&&It.l!==null?G_(It).m.push(t):Rt(()=>{const e=na(t);if(typeof e=="function")return e})}function G_(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const K_="5";var B1;typeof window<"u"&&((B1=window.__svelte??(window.__svelte={})).v??(B1.v=new Set)).add(K_);IE();function bs(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function nh(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ");return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}const V_={html:"text/html; charset=utf-8",json:"application/json; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",css:"text/css; charset=utf-8",txt:"text/plain; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",avif:"image/avif",gif:"image/gif",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",map:"application/json; charset=utf-8"};function X_(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return V_[e]??"application/octet-stream"}class ya extends Error{constructor(e){super(e),this.name="ContentParseError"}}const Q_=new Set(["template","title","isPublished","fields","created","published","updated"]);function Cd(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ld(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function Z_(t){return Cd(t)&&Object.values(t).every(Ld)}function J_(t,e){if(Ld(e))return e;if(Array.isArray(e)){if(e.every(Ld)||e.every(Z_))return e;throw new ya(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new ya(`Field "${t}" must be a primitive or an array, not a bare object.`)}function Ru(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new ya(`"${e}" must be a string when present.`);return n}}function Kl(t){return qm(t).item}function qm(t){if(!Cd(t))throw new ya("A content item must be a JSON object.");if(typeof t.title!="string")throw new ya('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new ya(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!Cd(t.fields))throw new ya('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([d,h])=>[d,J_(d,h)]))}const r=Ru(t,"template"),s=Ru(t,"created"),a=Ru(t,"published"),i=Ru(t,"updated"),o=Object.keys(t).filter(d=>!Q_.has(d)).sort();return{item:{title:t.title,isPublished:e,fields:n,...r!==void 0&&{template:r},...s!==void 0&&{created:s},...a!==void 0&&{published:a},...i!==void 0&&{updated:i}},diagnostics:{unknownTopLevelKeys:o}}}function y0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function jm(t){if(!y0(t))return{order:[]};const e=Array.isArray(t.order)?t.order.filter(a=>typeof a=="string"):[],n=typeof t.name=="string"?t.name:void 0,r=typeof t.defaultTemplate=="string"?t.defaultTemplate:void 0,s=y0(t.collection)?{recursive:t.collection.recursive===!0}:void 0;return{order:e,...n!==void 0&&{name:n},...r!==void 0&&{defaultTemplate:r},...s!==void 0&&{collection:s}}}const $m="_sort.json",eT="_redirects.json",tT="_site.json",nT="assets",N0=".json",st={content:"content",templates:"templates",components:"components",public:"public"};function Zr(...t){return t.filter(e=>e!=="").join("/")}async function rh(t,e=st.content){return Ym(t,e,"","")}async function Ym(t,e,n,r){const[s,a]=await Promise.all([t.list(e),sT(t,e)]),i=new Map;for(const l of s)if(l.kind==="file"){if(l.name===$m||l.name===eT||l.name===tT||!l.name.endsWith(N0))continue;const d=l.name.slice(0,-N0.length);i.set(d,await rT(t,Zr(e,l.name),d,r))}else{if(l.name===nT)continue;const d=Zr(r,l.name);i.set(l.name,await Ym(t,Zr(e,l.name),l.name,d))}const o=a.name??(n===""?"":nh(n));return{kind:"dir",slug:n,name:o,path:r,children:aT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function rT(t,e,n,r){const s=await t.readText(e);try{const{item:a,diagnostics:i}=qm(JSON.parse(s));return{kind:"item",slug:n,path:Zr(r,n),item:a,...i.unknownTopLevelKeys.length>0&&{parseDiagnostics:i}}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function sT(t,e){const n=Zr(e,$m);if(!await t.exists(n))return{order:[]};try{return jm(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function aT(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}function sh(t,e=st.components){return ah(t,e,"html")}function zm(t,e=st.components){return ah(t,e,"css")}function Wm(t,e=st.components){return ah(t,e,"js")}async function ah(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const o of await t.list(i)){const l=Zr(i,o.name);if(o.kind==="dir")await a(l);else if(o.name.endsWith(r)){const d=o.name.slice(0,-r.length).toLowerCase();s.set(d,await t.readText(l))}}};return await a(e),s}async function Tl(t,e,n=st.templates){return t.readText(Zr(n,`${e}.html`))}function iT(t,e,n=st.templates){return oh(t,Zr(n,`${e}.css`))}function oT(t,e,n=st.templates){return oh(t,Zr(n,`${e}.js`))}const hu="document";function ih(t,e=st.templates){return oh(t,Zr(e,`${hu}.html`))}async function oh(t,e){try{return await t.readText(e)}catch{return}}const uT=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ut="�";var w;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(w||(w={}));const Fn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Gm(t){return t>=55296&&t<=57343}function lT(t){return t>=56320&&t<=57343}function cT(t,e){return(t-55296)*1024+9216+e}function Km(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function Vm(t){return t>=64976&&t<=65007||uT.has(t)}var re;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(re||(re={}));const dT=65536;class fT{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=dT,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:a}=this,i=s+n,o=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(lT(n))return this.pos++,this._addGap(),cT(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,w.EOF;return this._err(re.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,w.EOF;const r=this.html.charCodeAt(n);return r===w.CARRIAGE_RETURN?w.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,w.EOF;let e=this.html.charCodeAt(this.pos);return e===w.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,w.LINE_FEED):e===w.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Gm(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===w.LINE_FEED||e===w.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Km(e)?this._err(re.controlCharacterInInputStream):Vm(e)&&this._err(re.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var ct;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(ct||(ct={}));function Xm(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const hT=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),pT=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function mT(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=pT.get(t))!==null&&e!==void 0?e:t}var dn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(dn||(dn={}));const gT=32;var $s;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})($s||($s={}));function Od(t){return t>=dn.ZERO&&t<=dn.NINE}function vT(t){return t>=dn.UPPER_A&&t<=dn.UPPER_F||t>=dn.LOWER_A&&t<=dn.LOWER_F}function bT(t){return t>=dn.UPPER_A&&t<=dn.UPPER_Z||t>=dn.LOWER_A&&t<=dn.LOWER_Z||Od(t)}function ET(t){return t===dn.EQUALS||bT(t)}var cn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(cn||(cn={}));var vs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(vs||(vs={}));class _T{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=cn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vs.Strict}startEntity(e){this.decodeMode=e,this.state=cn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case cn.EntityStart:return e.charCodeAt(n)===dn.NUM?(this.state=cn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=cn.NamedEntity,this.stateNamedEntity(e,n));case cn.NumericStart:return this.stateNumericStart(e,n);case cn.NumericDecimal:return this.stateNumericDecimal(e,n);case cn.NumericHex:return this.stateNumericHex(e,n);case cn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|gT)===dn.LOWER_X?(this.state=cn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=cn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(e.substr(n,a),s),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(Od(s)||vT(s))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(Od(s))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===dn.SEMI)this.consumed+=1;else if(this.decodeMode===vs.Strict)return 0;return this.emitCodePoint(mT(this.result),this.consumed),this.errors&&(e!==dn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&$s.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=TT(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===vs.Attribute&&(a===0||ET(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&$s.VALUE_LENGTH)>>14,a!==0){if(i===dn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==vs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,s=(r[n]&$s.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[e]&~$s.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case cn.NamedEntity:return this.result!==0&&(this.decodeMode!==vs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case cn.NumericDecimal:return this.emitNumericEntity(0,2);case cn.NumericHex:return this.emitNumericEntity(0,3);case cn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case cn.EntityStart:return 0}}}function TT(t,e,n,r){const s=(e&$s.BRANCH_LENGTH)>>7,a=e&$s.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const l=r-a;return l<0||l>=s?-1:t[n+l]-1}let i=n,o=i+s-1;for(;i<=o;){const l=i+o>>>1,d=t[l];if(d<r)i=l+1;else if(d>r)o=l-1;else return t[l+s]}return-1}var pe;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(pe||(pe={}));var ka;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(ka||(ka={}));var lr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(lr||(lr={}));var Z;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(Z||(Z={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const AT=new Map([[Z.A,c.A],[Z.ADDRESS,c.ADDRESS],[Z.ANNOTATION_XML,c.ANNOTATION_XML],[Z.APPLET,c.APPLET],[Z.AREA,c.AREA],[Z.ARTICLE,c.ARTICLE],[Z.ASIDE,c.ASIDE],[Z.B,c.B],[Z.BASE,c.BASE],[Z.BASEFONT,c.BASEFONT],[Z.BGSOUND,c.BGSOUND],[Z.BIG,c.BIG],[Z.BLOCKQUOTE,c.BLOCKQUOTE],[Z.BODY,c.BODY],[Z.BR,c.BR],[Z.BUTTON,c.BUTTON],[Z.CAPTION,c.CAPTION],[Z.CENTER,c.CENTER],[Z.CODE,c.CODE],[Z.COL,c.COL],[Z.COLGROUP,c.COLGROUP],[Z.DD,c.DD],[Z.DESC,c.DESC],[Z.DETAILS,c.DETAILS],[Z.DIALOG,c.DIALOG],[Z.DIR,c.DIR],[Z.DIV,c.DIV],[Z.DL,c.DL],[Z.DT,c.DT],[Z.EM,c.EM],[Z.EMBED,c.EMBED],[Z.FIELDSET,c.FIELDSET],[Z.FIGCAPTION,c.FIGCAPTION],[Z.FIGURE,c.FIGURE],[Z.FONT,c.FONT],[Z.FOOTER,c.FOOTER],[Z.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[Z.FORM,c.FORM],[Z.FRAME,c.FRAME],[Z.FRAMESET,c.FRAMESET],[Z.H1,c.H1],[Z.H2,c.H2],[Z.H3,c.H3],[Z.H4,c.H4],[Z.H5,c.H5],[Z.H6,c.H6],[Z.HEAD,c.HEAD],[Z.HEADER,c.HEADER],[Z.HGROUP,c.HGROUP],[Z.HR,c.HR],[Z.HTML,c.HTML],[Z.I,c.I],[Z.IMG,c.IMG],[Z.IMAGE,c.IMAGE],[Z.INPUT,c.INPUT],[Z.IFRAME,c.IFRAME],[Z.KEYGEN,c.KEYGEN],[Z.LABEL,c.LABEL],[Z.LI,c.LI],[Z.LINK,c.LINK],[Z.LISTING,c.LISTING],[Z.MAIN,c.MAIN],[Z.MALIGNMARK,c.MALIGNMARK],[Z.MARQUEE,c.MARQUEE],[Z.MATH,c.MATH],[Z.MENU,c.MENU],[Z.META,c.META],[Z.MGLYPH,c.MGLYPH],[Z.MI,c.MI],[Z.MO,c.MO],[Z.MN,c.MN],[Z.MS,c.MS],[Z.MTEXT,c.MTEXT],[Z.NAV,c.NAV],[Z.NOBR,c.NOBR],[Z.NOFRAMES,c.NOFRAMES],[Z.NOEMBED,c.NOEMBED],[Z.NOSCRIPT,c.NOSCRIPT],[Z.OBJECT,c.OBJECT],[Z.OL,c.OL],[Z.OPTGROUP,c.OPTGROUP],[Z.OPTION,c.OPTION],[Z.P,c.P],[Z.PARAM,c.PARAM],[Z.PLAINTEXT,c.PLAINTEXT],[Z.PRE,c.PRE],[Z.RB,c.RB],[Z.RP,c.RP],[Z.RT,c.RT],[Z.RTC,c.RTC],[Z.RUBY,c.RUBY],[Z.S,c.S],[Z.SCRIPT,c.SCRIPT],[Z.SEARCH,c.SEARCH],[Z.SECTION,c.SECTION],[Z.SELECT,c.SELECT],[Z.SOURCE,c.SOURCE],[Z.SMALL,c.SMALL],[Z.SPAN,c.SPAN],[Z.STRIKE,c.STRIKE],[Z.STRONG,c.STRONG],[Z.STYLE,c.STYLE],[Z.SUB,c.SUB],[Z.SUMMARY,c.SUMMARY],[Z.SUP,c.SUP],[Z.TABLE,c.TABLE],[Z.TBODY,c.TBODY],[Z.TEMPLATE,c.TEMPLATE],[Z.TEXTAREA,c.TEXTAREA],[Z.TFOOT,c.TFOOT],[Z.TD,c.TD],[Z.TH,c.TH],[Z.THEAD,c.THEAD],[Z.TITLE,c.TITLE],[Z.TR,c.TR],[Z.TRACK,c.TRACK],[Z.TT,c.TT],[Z.U,c.U],[Z.UL,c.UL],[Z.SVG,c.SVG],[Z.VAR,c.VAR],[Z.WBR,c.WBR],[Z.XMP,c.XMP]]);function Vl(t){var e;return(e=AT.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const ve=c,yT={[pe.HTML]:new Set([ve.ADDRESS,ve.APPLET,ve.AREA,ve.ARTICLE,ve.ASIDE,ve.BASE,ve.BASEFONT,ve.BGSOUND,ve.BLOCKQUOTE,ve.BODY,ve.BR,ve.BUTTON,ve.CAPTION,ve.CENTER,ve.COL,ve.COLGROUP,ve.DD,ve.DETAILS,ve.DIR,ve.DIV,ve.DL,ve.DT,ve.EMBED,ve.FIELDSET,ve.FIGCAPTION,ve.FIGURE,ve.FOOTER,ve.FORM,ve.FRAME,ve.FRAMESET,ve.H1,ve.H2,ve.H3,ve.H4,ve.H5,ve.H6,ve.HEAD,ve.HEADER,ve.HGROUP,ve.HR,ve.HTML,ve.IFRAME,ve.IMG,ve.INPUT,ve.LI,ve.LINK,ve.LISTING,ve.MAIN,ve.MARQUEE,ve.MENU,ve.META,ve.NAV,ve.NOEMBED,ve.NOFRAMES,ve.NOSCRIPT,ve.OBJECT,ve.OL,ve.P,ve.PARAM,ve.PLAINTEXT,ve.PRE,ve.SCRIPT,ve.SECTION,ve.SELECT,ve.SOURCE,ve.STYLE,ve.SUMMARY,ve.TABLE,ve.TBODY,ve.TD,ve.TEMPLATE,ve.TEXTAREA,ve.TFOOT,ve.TH,ve.THEAD,ve.TITLE,ve.TR,ve.TRACK,ve.UL,ve.WBR,ve.XMP]),[pe.MATHML]:new Set([ve.MI,ve.MO,ve.MN,ve.MS,ve.MTEXT,ve.ANNOTATION_XML]),[pe.SVG]:new Set([ve.TITLE,ve.FOREIGN_OBJECT,ve.DESC]),[pe.XLINK]:new Set,[pe.XML]:new Set,[pe.XMLNS]:new Set},xd=new Set([ve.H1,ve.H2,ve.H3,ve.H4,ve.H5,ve.H6]),NT=new Set([Z.STYLE,Z.SCRIPT,Z.XMP,Z.IFRAME,Z.NOEMBED,Z.NOFRAMES,Z.PLAINTEXT]);function ST(t,e){return NT.has(t)||e&&t===Z.NOSCRIPT}var x;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(x||(x={}));const Yn={DATA:x.DATA,RCDATA:x.RCDATA,RAWTEXT:x.RAWTEXT,SCRIPT_DATA:x.SCRIPT_DATA,PLAINTEXT:x.PLAINTEXT,CDATA_SECTION:x.CDATA_SECTION};function wT(t){return t>=w.DIGIT_0&&t<=w.DIGIT_9}function _o(t){return t>=w.LATIN_CAPITAL_A&&t<=w.LATIN_CAPITAL_Z}function IT(t){return t>=w.LATIN_SMALL_A&&t<=w.LATIN_SMALL_Z}function ks(t){return IT(t)||_o(t)}function S0(t){return ks(t)||wT(t)}function Du(t){return t+32}function Qm(t){return t===w.SPACE||t===w.LINE_FEED||t===w.TABULATION||t===w.FORM_FEED}function w0(t){return Qm(t)||t===w.SOLIDUS||t===w.GREATER_THAN_SIGN}function CT(t){return t===w.NULL?re.nullCharacterReference:t>1114111?re.characterReferenceOutsideUnicodeRange:Gm(t)?re.surrogateCharacterReference:Vm(t)?re.noncharacterCharacterReference:Km(t)||t===w.CARRIAGE_RETURN?re.controlCharacterReference:null}class LT{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=x.DATA,this.returnState=x.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new fT(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new _T(hT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(re.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(re.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=CT(r);s&&this._err(s,1)}}:void 0)}_err(e,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:ct.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:ct.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:ct.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:ct.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(Xm(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(re.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=Vl(e.tagName),e.type===ct.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(re.endTagWithAttributes),e.selfClosing&&this._err(re.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case ct.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case ct.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case ct.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:ct.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=Qm(e)?ct.WHITESPACE_CHARACTER:e===w.NULL?ct.NULL_CHARACTER:ct.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(ct.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=x.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vs.Attribute:vs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===x.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case x.DATA:{this._stateData(e);break}case x.RCDATA:{this._stateRcdata(e);break}case x.RAWTEXT:{this._stateRawtext(e);break}case x.SCRIPT_DATA:{this._stateScriptData(e);break}case x.PLAINTEXT:{this._statePlaintext(e);break}case x.TAG_OPEN:{this._stateTagOpen(e);break}case x.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case x.TAG_NAME:{this._stateTagName(e);break}case x.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case x.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case x.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case x.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case x.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case x.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case x.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case x.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case x.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case x.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case x.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case x.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case x.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case x.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case x.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case x.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case x.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case x.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case x.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case x.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case x.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case x.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case x.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case x.BOGUS_COMMENT:{this._stateBogusComment(e);break}case x.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case x.COMMENT_START:{this._stateCommentStart(e);break}case x.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case x.COMMENT:{this._stateComment(e);break}case x.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case x.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case x.COMMENT_END:{this._stateCommentEnd(e);break}case x.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case x.DOCTYPE:{this._stateDoctype(e);break}case x.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case x.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case x.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case x.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case x.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case x.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case x.CDATA_SECTION:{this._stateCdataSection(e);break}case x.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case x.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case x.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case x.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=x.TAG_OPEN;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitCodePoint(e);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case w.AMPERSAND:{this._startCharacterReference();break}case w.LESS_THAN_SIGN:{this.state=x.RCDATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ut);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case w.LESS_THAN_SIGN:{this.state=x.RAWTEXT_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ut);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ut);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ut);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(ks(e))this._createStartTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case w.EXCLAMATION_MARK:{this.state=x.MARKUP_DECLARATION_OPEN;break}case w.SOLIDUS:{this.state=x.END_TAG_OPEN;break}case w.QUESTION_MARK:{this._err(re.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e);break}case w.EOF:{this._err(re.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(re.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=x.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(ks(e))this._createEndTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case w.GREATER_THAN_SIGN:{this._err(re.missingEndTagName),this.state=x.DATA;break}case w.EOF:{this._err(re.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(re.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this.state=x.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.tagName+=Ut;break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(_o(e)?Du(e):e)}}_stateRcdataLessThanSign(e){e===w.SOLIDUS?this.state=x.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){ks(e)?(this.state=x.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=x.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=x.BEFORE_ATTRIBUTE_NAME,!1;case w.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=x.SELF_CLOSING_START_TAG,!1;case w.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=x.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===w.SOLIDUS?this.state=x.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){ks(e)?(this.state=x.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case w.SOLIDUS:{this.state=x.SCRIPT_DATA_END_TAG_OPEN;break}case w.EXCLAMATION_MARK:{this.state=x.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=x.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){ks(e)?(this.state=x.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===w.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===w.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ut);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(Ut);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.GREATER_THAN_SIGN:{this.state=x.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(Ut);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===w.SOLIDUS?this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:ks(e)?(this._emitChars("<"),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){ks(e)?(this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Fn.SCRIPT,!1)&&w0(this.preprocessor.peek(Fn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Fn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(re.unexpectedNullCharacter),this._emitChars(Ut);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ut);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.GREATER_THAN_SIGN:{this.state=x.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ut);break}case w.EOF:{this._err(re.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===w.SOLIDUS?(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Fn.SCRIPT,!1)&&w0(this.preprocessor.peek(Fn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Fn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._err(re.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=x.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this._leaveAttrName(),this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._leaveAttrName(),this.state=x.BEFORE_ATTRIBUTE_VALUE;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:{this._err(re.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.name+=Ut;break}default:this.currentAttr.name+=String.fromCodePoint(_o(e)?Du(e):e)}}_stateAfterAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:{this.state=x.SELF_CLOSING_START_TAG;break}case w.EQUALS_SIGN:{this.state=x.BEFORE_ATTRIBUTE_VALUE;break}case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{this.state=x.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this.state=x.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingAttributeValue),this.state=x.DATA,this.emitCurrentTagToken();break}default:this.state=x.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case w.QUOTATION_MARK:{this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case w.APOSTROPHE:{this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(re.unexpectedNullCharacter),this.currentAttr.value+=Ut;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:case w.EQUALS_SIGN:case w.GRAVE_ACCENT:{this._err(re.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this._leaveAttrValue(),this.state=x.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._err(re.missingWhitespaceBetweenAttributes),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case w.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=x.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(re.eofInTag),this._emitEOFToken();break}default:this._err(re.unexpectedSolidusInTag),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentComment(n);break}case w.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.data+=Ut;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Fn.DASH_DASH,!0)?(this._createCommentToken(Fn.DASH_DASH.length+1),this.state=x.COMMENT_START):this._consumeSequenceIfMatch(Fn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Fn.DOCTYPE.length+1),this.state=x.DOCTYPE):this._consumeSequenceIfMatch(Fn.CDATA_START,!0)?this.inForeignNode?this.state=x.CDATA_SECTION:(this._err(re.cdataInHtmlContent),this._createCommentToken(Fn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=x.BOGUS_COMMENT):this._ensureHibernation()||(this._err(re.incorrectlyOpenedComment),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.COMMENT_START_DASH;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptClosingOfEmptyComment),this.state=x.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=x.COMMENT_END;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptClosingOfEmptyComment),this.state=x.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=x.COMMENT_END_DASH;break}case w.LESS_THAN_SIGN:{n.data+="<",this.state=x.COMMENT_LESS_THAN_SIGN;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.data+=Ut;break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case w.EXCLAMATION_MARK:{n.data+="!",this.state=x.COMMENT_LESS_THAN_SIGN_BANG;break}case w.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===w.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=x.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===w.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=x.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==w.GREATER_THAN_SIGN&&e!==w.EOF&&this._err(re.nestedComment),this.state=x.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=x.COMMENT_END;break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentComment(n);break}case w.EXCLAMATION_MARK:{this.state=x.COMMENT_END_BANG;break}case w.HYPHEN_MINUS:{n.data+="-";break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{n.data+="--!",this.state=x.COMMENT_END_DASH;break}case w.GREATER_THAN_SIGN:{this._err(re.incorrectlyClosedComment),this.state=x.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(re.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=x.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case w.EOF:{this._err(re.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingWhitespaceBeforeDoctypeName),this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(_o(e))this._createDoctypeToken(String.fromCharCode(Du(e))),this.state=x.DOCTYPE_NAME;else switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.NULL:{this._err(re.unexpectedNullCharacter),this._createDoctypeToken(Ut),this.state=x.DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(re.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=x.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.AFTER_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.name+=Ut;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(_o(e)?Du(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Fn.PUBLIC,!1)?this.state=x.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Fn.SYSTEM,!1)?this.state=x.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(re.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(re.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(re.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.publicId+=Ut;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.publicId+=Ut;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.QUOTATION_MARK:{this._err(re.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(re.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.QUOTATION_MARK:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(re.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(re.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(re.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.systemId+=Ut;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(re.unexpectedNullCharacter),n.systemId+=Ut;break}case w.GREATER_THAN_SIGN:{this._err(re.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(re.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(re.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.NULL:{this._err(re.unexpectedNullCharacter);break}case w.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case w.RIGHT_SQUARE_BRACKET:{this.state=x.CDATA_SECTION_BRACKET;break}case w.EOF:{this._err(re.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===w.RIGHT_SQUARE_BRACKET?this.state=x.CDATA_SECTION_END:(this._emitChars("]"),this.state=x.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case w.GREATER_THAN_SIGN:{this.state=x.DATA;break}case w.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=x.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(w.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&S0(this.preprocessor.peek(1))?x.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){S0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===w.SEMICOLON&&this._err(re.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Zm=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),I0=new Set([...Zm,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),Al=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),OT=new Set([...Al,c.OL,c.UL]),xT=new Set([...Al,c.BUTTON]),C0=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),L0=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),RT=new Set([c.TR,c.TEMPLATE,c.HTML]),DT=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),kT=new Set([c.TABLE,c.TEMPLATE,c.HTML]),PT=new Set([c.TD,c.TH]);class MT{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===pe.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const s=this._indexOf(e)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==pe.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(xd,pe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(PT,pe.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(kT,pe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(DT,pe.HTML)}clearBackToTableRowContext(){this.clearBackTo(RT,pe.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case pe.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case pe.SVG:{if(L0.has(s))return!1;break}case pe.MATHML:{if(C0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,Al)}hasInListItemScope(e){return this.hasInDynamicScope(e,OT)}hasInButtonScope(e){return this.hasInDynamicScope(e,xT)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case pe.HTML:{if(xd.has(n))return!0;if(Al.has(n))return!1;break}case pe.SVG:{if(L0.has(n))return!1;break}case pe.MATHML:{if(C0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===pe.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===pe.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===pe.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Zm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&I0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&I0.has(this.currentTagId);)this.pop()}}const Bc=3;var Kr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Kr||(Kr={}));const O0={type:Kr.Marker};class BT{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(e),i=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const l=this.entries[o];if(l.type===Kr.Marker)break;const{element:d}=l;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===i){const h=this.treeAdapter.getAttrList(d);h.length===s&&r.push({idx:o,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Bc)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Bc)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const o=r[i];o.attrs.every(l=>s.get(l.name)===l.value)&&(a+=1,a>=Bc&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(O0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Kr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Kr.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(O0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Kr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Kr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Kr.Element&&n.element===e)}}const hs={createDocument(){return{nodeName:"#document",mode:lr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const s=t.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=e,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};hs.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(hs.isTextNode(n)){n.value+=e;return}}hs.appendChild(t,hs.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&hs.isTextNode(r)?r.value+=e:hs.insertBefore(t,hs.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},Jm="html",FT="about:legacy-compat",UT="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",eg=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],HT=[...eg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],qT=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),tg=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],jT=[...tg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function x0(t,e){return e.some(n=>t.startsWith(n))}function $T(t){return t.name===Jm&&t.publicId===null&&(t.systemId===null||t.systemId===FT)}function YT(t){if(t.name!==Jm)return lr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===UT)return lr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),qT.has(n))return lr.QUIRKS;let r=e===null?HT:eg;if(x0(n,r))return lr.QUIRKS;if(r=e===null?tg:jT,x0(n,r))return lr.LIMITED_QUIRKS}return lr.NO_QUIRKS}const R0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},zT="definitionurl",WT="definitionURL",GT=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),KT=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:pe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:pe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:pe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:pe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:pe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:pe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:pe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:pe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:pe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:pe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:pe.XMLNS}]]),VT=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),XT=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function QT(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===ka.COLOR||r===ka.SIZE||r===ka.FACE)||XT.has(e)}function ng(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===zT){t.attrs[e].name=WT;break}}function rg(t){for(let e=0;e<t.attrs.length;e++){const n=GT.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function uh(t){for(let e=0;e<t.attrs.length;e++){const n=KT.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function ZT(t){const e=VT.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Vl(t.tagName))}function JT(t,e){return e===pe.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function e2(t,e,n){if(e===pe.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ka.ENCODING){const s=n[r].value.toLowerCase();return s===R0.TEXT_HTML||s===R0.APPLICATION_XML}}return e===pe.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function t2(t,e,n,r){return(!r||r===pe.HTML)&&e2(t,e,n)||(!r||r===pe.MATHML)&&JT(t,e)}const n2="hidden",r2=8,s2=3;var P;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(P||(P={}));const a2={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},sg=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),D0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:hs,onParseError:null};class ag{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=P.INITIAL,this.originalInsertionMode=P.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...D0,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new LT(this.options,this),this.activeFormattingElements=new BT(this.treeAdapter),this.fragmentContextID=r?Vl(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new MT(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...D0,...n};e??(e=r.treeAdapter.createElement(Z.TEMPLATE,pe.HTML,[]));const s=r.treeAdapter.createElement("documentmock",pe.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(P.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const a=(s=e.location)!==null&&s!==void 0?s:a2,i={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(i)}onItemPush(e,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,e,this.openElements.current),n){let a,i;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,i=this.fragmentContextID):{current:a,currentTagId:i}=this.openElements,this._setContextModes(a,i)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===pe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,pe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=P.TEXT}switchToPlaintextParsing(){this.insertionMode=P.TEXT,this.originalInsertionMode=P.IN_BODY,this.tokenizer.state=Yn.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Z.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==pe.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=Yn.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=Yn.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=Yn.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=Yn.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),e.location){const i=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,pe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,pe.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(Z.HTML,pe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,i=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:l,endCol:d,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:l,endCol:d,endOffset:h})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),a=n.type===ct.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===Z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===pe.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,pe.HTML)}_processToken(e){switch(e.type){case ct.CHARACTER:{this.onCharacter(e);break}case ct.NULL_CHARACTER:{this.onNullCharacter(e);break}case ct.COMMENT:{this.onComment(e);break}case ct.DOCTYPE:{this.onDoctype(e);break}case ct.START_TAG:{this._processStartTag(e);break}case ct.END_TAG:{this.onEndTag(e);break}case ct.EOF:{this.onEof(e);break}case ct.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return t2(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Kr.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=P.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=P.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=P.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=P.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=P.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=P.IN_TABLE;return}case c.BODY:{this.insertionMode=P.IN_BODY;return}case c.FRAMESET:{this.insertionMode=P.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?P.AFTER_HEAD:P.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=P.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=P.IN_HEAD;return}break}}this.insertionMode=P.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=P.IN_SELECT_IN_TABLE;return}}this.insertionMode=P.IN_SELECT}_isElementCausesFosterParenting(e){return sg.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===pe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return yT[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){PA(this,e);return}switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{Co(this,e);break}case P.BEFORE_HEAD:{Lo(this,e);break}case P.IN_HEAD:{Oo(this,e);break}case P.IN_HEAD_NO_SCRIPT:{xo(this,e);break}case P.AFTER_HEAD:{Ro(this,e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:{og(this,e);break}case P.TEXT:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Fc(this,e);break}case P.IN_TABLE_TEXT:{hg(this,e);break}case P.IN_COLUMN_GROUP:{yl(this,e);break}case P.AFTER_BODY:{Nl(this,e);break}case P.AFTER_AFTER_BODY:{il(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){kA(this,e);return}switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{Co(this,e);break}case P.BEFORE_HEAD:{Lo(this,e);break}case P.IN_HEAD:{Oo(this,e);break}case P.IN_HEAD_NO_SCRIPT:{xo(this,e);break}case P.AFTER_HEAD:{Ro(this,e);break}case P.TEXT:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Fc(this,e);break}case P.IN_COLUMN_GROUP:{yl(this,e);break}case P.AFTER_BODY:{Nl(this,e);break}case P.AFTER_AFTER_BODY:{il(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Rd(this,e);return}switch(this.insertionMode){case P.INITIAL:case P.BEFORE_HTML:case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_TEMPLATE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{Rd(this,e);break}case P.IN_TABLE_TEXT:{ho(this,e);break}case P.AFTER_BODY:{f2(this,e);break}case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{h2(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case P.INITIAL:{p2(this,e);break}case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:{this._err(e,re.misplacedDoctype);break}case P.IN_TABLE_TEXT:{ho(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,re.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?MA(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{m2(this,e);break}case P.BEFORE_HEAD:{v2(this,e);break}case P.IN_HEAD:{Mr(this,e);break}case P.IN_HEAD_NO_SCRIPT:{_2(this,e);break}case P.AFTER_HEAD:{A2(this,e);break}case P.IN_BODY:{wn(this,e);break}case P.IN_TABLE:{ji(this,e);break}case P.IN_TABLE_TEXT:{ho(this,e);break}case P.IN_CAPTION:{bA(this,e);break}case P.IN_COLUMN_GROUP:{dh(this,e);break}case P.IN_TABLE_BODY:{Zl(this,e);break}case P.IN_ROW:{Jl(this,e);break}case P.IN_CELL:{TA(this,e);break}case P.IN_SELECT:{gg(this,e);break}case P.IN_SELECT_IN_TABLE:{yA(this,e);break}case P.IN_TEMPLATE:{SA(this,e);break}case P.AFTER_BODY:{IA(this,e);break}case P.IN_FRAMESET:{CA(this,e);break}case P.AFTER_FRAMESET:{OA(this,e);break}case P.AFTER_AFTER_BODY:{RA(this,e);break}case P.AFTER_AFTER_FRAMESET:{DA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?BA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{g2(this,e);break}case P.BEFORE_HEAD:{b2(this,e);break}case P.IN_HEAD:{E2(this,e);break}case P.IN_HEAD_NO_SCRIPT:{T2(this,e);break}case P.AFTER_HEAD:{y2(this,e);break}case P.IN_BODY:{Ql(this,e);break}case P.TEXT:{uA(this,e);break}case P.IN_TABLE:{$o(this,e);break}case P.IN_TABLE_TEXT:{ho(this,e);break}case P.IN_CAPTION:{EA(this,e);break}case P.IN_COLUMN_GROUP:{_A(this,e);break}case P.IN_TABLE_BODY:{Dd(this,e);break}case P.IN_ROW:{mg(this,e);break}case P.IN_CELL:{AA(this,e);break}case P.IN_SELECT:{vg(this,e);break}case P.IN_SELECT_IN_TABLE:{NA(this,e);break}case P.IN_TEMPLATE:{wA(this,e);break}case P.AFTER_BODY:{Eg(this,e);break}case P.IN_FRAMESET:{LA(this,e);break}case P.AFTER_FRAMESET:{xA(this,e);break}case P.AFTER_AFTER_BODY:{il(this,e);break}}}onEof(e){switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{Co(this,e);break}case P.BEFORE_HEAD:{Lo(this,e);break}case P.IN_HEAD:{Oo(this,e);break}case P.IN_HEAD_NO_SCRIPT:{xo(this,e);break}case P.AFTER_HEAD:{Ro(this,e);break}case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{dg(this,e);break}case P.TEXT:{lA(this,e);break}case P.IN_TABLE_TEXT:{ho(this,e);break}case P.IN_TEMPLATE:{bg(this,e);break}case P.AFTER_BODY:case P.IN_FRAMESET:case P.AFTER_FRAMESET:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{ch(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===w.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.TEXT:case P.IN_COLUMN_GROUP:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{this._insertCharacters(e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:case P.AFTER_BODY:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{ig(this,e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Fc(this,e);break}case P.IN_TABLE_TEXT:{fg(this,e);break}}}}function i2(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):cg(t,e),n}function o2(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const s=t.openElements.items[r];if(s===e.element)break;t._isSpecialElement(s,t.openElements.tagIDs[r])&&(n=s)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function u2(t,e,n){let r=e,s=t.openElements.getCommonAncestor(e);for(let a=0,i=s;i!==n;a++,i=s){s=t.openElements.getCommonAncestor(i);const o=t.activeFormattingElements.getElementEntry(i),l=o&&a>=s2;!o||l?(l&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(i)):(i=l2(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function l2(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function c2(t,e,n){const r=t.treeAdapter.getTagName(e),s=Vl(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&a===pe.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function d2(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,s.tagID)}function lh(t,e){for(let n=0;n<r2;n++){const r=i2(t,e);if(!r)break;const s=o2(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=u2(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&c2(t,i,a),d2(t,s,r)}}function Rd(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function f2(t,e){t._appendCommentNode(e,t.openElements.items[0])}function h2(t,e){t._appendCommentNode(e,t.document)}function ch(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],s=t.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],i=t.treeAdapter.getNodeSourceCodeLocation(a);i&&!i.endTag&&t._setEndLocation(a,e)}}}}function p2(t,e){t._setDocumentType(e);const n=e.forceQuirks?lr.QUIRKS:YT(e);$T(e)||t._err(e,re.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=P.BEFORE_HTML}function fo(t,e){t._err(e,re.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,lr.QUIRKS),t.insertionMode=P.BEFORE_HTML,t._processToken(e)}function m2(t,e){e.tagID===c.HTML?(t._insertElement(e,pe.HTML),t.insertionMode=P.BEFORE_HEAD):Co(t,e)}function g2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&Co(t,e)}function Co(t,e){t._insertFakeRootElement(),t.insertionMode=P.BEFORE_HEAD,t._processToken(e)}function v2(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.HEAD:{t._insertElement(e,pe.HTML),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD;break}default:Lo(t,e)}}function b2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Lo(t,e):t._err(e,re.endTagWithoutMatchingOpenElement)}function Lo(t,e){t._insertFakeElement(Z.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD,t._processToken(e)}function Mr(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,Yn.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Yn.RAWTEXT):(t._insertElement(e,pe.HTML),t.insertionMode=P.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,Yn.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,Yn.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=P.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(P.IN_TEMPLATE);break}case c.HEAD:{t._err(e,re.misplacedStartTagForHeadElement);break}default:Oo(t,e)}}function E2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=P.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{Oo(t,e);break}case c.TEMPLATE:{Za(t,e);break}default:t._err(e,re.endTagWithoutMatchingOpenElement)}}function Za(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,re.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,re.endTagWithoutMatchingOpenElement)}function Oo(t,e){t.openElements.pop(),t.insertionMode=P.AFTER_HEAD,t._processToken(e)}function _2(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{Mr(t,e);break}case c.NOSCRIPT:{t._err(e,re.nestedNoscriptInHead);break}default:xo(t,e)}}function T2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=P.IN_HEAD;break}case c.BR:{xo(t,e);break}default:t._err(e,re.endTagWithoutMatchingOpenElement)}}function xo(t,e){const n=e.type===ct.EOF?re.openElementsLeftAfterEof:re.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=P.IN_HEAD,t._processToken(e)}function A2(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.BODY:{t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=P.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,pe.HTML),t.insertionMode=P.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,re.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),Mr(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,re.misplacedStartTagForHeadElement);break}default:Ro(t,e)}}function y2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Ro(t,e);break}case c.TEMPLATE:{Za(t,e);break}default:t._err(e,re.endTagWithoutMatchingOpenElement)}}function Ro(t,e){t._insertFakeElement(Z.BODY,c.BODY),t.insertionMode=P.IN_BODY,Xl(t,e)}function Xl(t,e){switch(e.type){case ct.CHARACTER:{og(t,e);break}case ct.WHITESPACE_CHARACTER:{ig(t,e);break}case ct.COMMENT:{Rd(t,e);break}case ct.START_TAG:{wn(t,e);break}case ct.END_TAG:{Ql(t,e);break}case ct.EOF:{dg(t,e);break}}}function ig(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function og(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function N2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function S2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function w2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_FRAMESET)}function I2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML)}function C2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&xd.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,pe.HTML)}function L2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function O2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),n||(t.formElement=t.openElements.current))}function x2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML)}function R2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.tokenizer.state=Yn.PLAINTEXT}function D2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.framesetOk=!1}function k2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Z.A);n&&(lh(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function P2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function M2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(lh(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function B2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function F2(t,e){t.treeAdapter.getDocumentMode(t.document)!==lr.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=P.IN_TABLE}function ug(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,pe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function lg(t){const e=Xm(t,ka.TYPE);return e!=null&&e.toLowerCase()===n2}function U2(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,pe.HTML),lg(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function H2(t,e){t._appendElement(e,pe.HTML),e.ackSelfClosing=!0}function q2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,pe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function j2(t,e){e.tagName=Z.IMG,e.tagID=c.IMG,ug(t,e)}function $2(t,e){t._insertElement(e,pe.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Yn.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=P.TEXT}function Y2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Yn.RAWTEXT)}function z2(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Yn.RAWTEXT)}function k0(t,e){t._switchToTextParsing(e,Yn.RAWTEXT)}function W2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===P.IN_TABLE||t.insertionMode===P.IN_CAPTION||t.insertionMode===P.IN_TABLE_BODY||t.insertionMode===P.IN_ROW||t.insertionMode===P.IN_CELL?P.IN_SELECT_IN_TABLE:P.IN_SELECT}function G2(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML)}function K2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,pe.HTML)}function V2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,pe.HTML)}function X2(t,e){t._reconstructActiveFormattingElements(),ng(e),uh(e),e.selfClosing?t._appendElement(e,pe.MATHML):t._insertElement(e,pe.MATHML),e.ackSelfClosing=!0}function Q2(t,e){t._reconstructActiveFormattingElements(),rg(e),uh(e),e.selfClosing?t._appendElement(e,pe.SVG):t._insertElement(e,pe.SVG),e.ackSelfClosing=!0}function P0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML)}function wn(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{P2(t,e);break}case c.A:{k2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{C2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{I2(t,e);break}case c.LI:case c.DD:case c.DT:{x2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{ug(t,e);break}case c.HR:{q2(t,e);break}case c.RB:case c.RTC:{K2(t,e);break}case c.RT:case c.RP:{V2(t,e);break}case c.PRE:case c.LISTING:{L2(t,e);break}case c.XMP:{Y2(t,e);break}case c.SVG:{Q2(t,e);break}case c.HTML:{N2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{Mr(t,e);break}case c.BODY:{S2(t,e);break}case c.FORM:{O2(t,e);break}case c.NOBR:{M2(t,e);break}case c.MATH:{X2(t,e);break}case c.TABLE:{F2(t,e);break}case c.INPUT:{U2(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{H2(t,e);break}case c.IMAGE:{j2(t,e);break}case c.BUTTON:{D2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{B2(t,e);break}case c.IFRAME:{z2(t,e);break}case c.SELECT:{W2(t,e);break}case c.OPTION:case c.OPTGROUP:{G2(t,e);break}case c.NOEMBED:case c.NOFRAMES:{k0(t,e);break}case c.FRAMESET:{w2(t,e);break}case c.TEXTAREA:{$2(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?k0(t,e):P0(t,e);break}case c.PLAINTEXT:{R2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:P0(t,e)}}function Z2(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function J2(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,Eg(t,e))}function eA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function tA(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function nA(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(Z.P,c.P),t._closePElement()}function rA(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function sA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function aA(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function iA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function oA(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(Z.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function cg(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const a=t.openElements.items[s],i=t.openElements.tagIDs[s];if(r===i&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(a,i))break}}function Ql(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{lh(t,e);break}case c.P:{nA(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{eA(t,e);break}case c.LI:{rA(t);break}case c.DD:case c.DT:{sA(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{aA(t);break}case c.BR:{oA(t);break}case c.BODY:{Z2(t,e);break}case c.HTML:{J2(t,e);break}case c.FORM:{tA(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{iA(t,e);break}case c.TEMPLATE:{Za(t,e);break}default:cg(t,e)}}function dg(t,e){t.tmplInsertionModeStack.length>0?bg(t,e):ch(t,e)}function uA(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function lA(t,e){t._err(e,re.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Fc(t,e){if(t.openElements.currentTagId!==void 0&&sg.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=P.IN_TABLE_TEXT,e.type){case ct.CHARACTER:{hg(t,e);break}case ct.WHITESPACE_CHARACTER:{fg(t,e);break}}else pu(t,e)}function cA(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_CAPTION}function dA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_COLUMN_GROUP}function fA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.COLGROUP,c.COLGROUP),t.insertionMode=P.IN_COLUMN_GROUP,dh(t,e)}function hA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_TABLE_BODY}function pA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.TBODY,c.TBODY),t.insertionMode=P.IN_TABLE_BODY,Zl(t,e)}function mA(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function gA(t,e){lg(e)?t._appendElement(e,pe.HTML):pu(t,e),e.ackSelfClosing=!0}function vA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,pe.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function ji(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{pA(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{Mr(t,e);break}case c.COL:{fA(t,e);break}case c.FORM:{vA(t,e);break}case c.TABLE:{mA(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{hA(t,e);break}case c.INPUT:{gA(t,e);break}case c.CAPTION:{cA(t,e);break}case c.COLGROUP:{dA(t,e);break}default:pu(t,e)}}function $o(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{Za(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:pu(t,e)}}function pu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Xl(t,e),t.fosterParentingEnabled=n}function fg(t,e){t.pendingCharacterTokens.push(e)}function hg(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function ho(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)pu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const pg=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function bA(t,e){const n=e.tagID;pg.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,ji(t,e)):wn(t,e)}function EA(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,n===c.TABLE&&$o(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:Ql(t,e)}}function dh(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.COL:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{Mr(t,e);break}default:yl(t,e)}}function _A(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TEMPLATE:{Za(t,e);break}case c.COL:break;default:yl(t,e)}}function yl(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE,t._processToken(e))}function Zl(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(Z.TR,c.TR),t.insertionMode=P.IN_ROW,Jl(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,ji(t,e));break}default:ji(t,e)}}function Dd(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,$o(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:$o(t,e)}}function Jl(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,Zl(t,e));break}default:ji(t,e)}}function mg(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,Dd(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,Dd(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:$o(t,e)}}function TA(t,e){const n=e.tagID;pg.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),Jl(t,e)):wn(t,e)}function AA(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),mg(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:Ql(t,e)}}function gg(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,pe.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,pe.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{Mr(t,e);break}}}function vg(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{Za(t,e);break}}}function yA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):gg(t,e)}function NA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):vg(t,e)}function SA(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{Mr(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=P.IN_TABLE,t.insertionMode=P.IN_TABLE,ji(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=P.IN_COLUMN_GROUP,t.insertionMode=P.IN_COLUMN_GROUP,dh(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=P.IN_TABLE_BODY,t.insertionMode=P.IN_TABLE_BODY,Zl(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=P.IN_ROW,t.insertionMode=P.IN_ROW,Jl(t,e);break}default:t.tmplInsertionModeStack[0]=P.IN_BODY,t.insertionMode=P.IN_BODY,wn(t,e)}}function wA(t,e){e.tagID===c.TEMPLATE&&Za(t,e)}function bg(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):ch(t,e)}function IA(t,e){e.tagID===c.HTML?wn(t,e):Nl(t,e)}function Eg(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=P.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else Nl(t,e)}function Nl(t,e){t.insertionMode=P.IN_BODY,Xl(t,e)}function CA(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.FRAMESET:{t._insertElement(e,pe.HTML);break}case c.FRAME:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{Mr(t,e);break}}}function LA(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=P.AFTER_FRAMESET))}function OA(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.NOFRAMES:{Mr(t,e);break}}}function xA(t,e){e.tagID===c.HTML&&(t.insertionMode=P.AFTER_AFTER_FRAMESET)}function RA(t,e){e.tagID===c.HTML?wn(t,e):il(t,e)}function il(t,e){t.insertionMode=P.IN_BODY,Xl(t,e)}function DA(t,e){switch(e.tagID){case c.HTML:{wn(t,e);break}case c.NOFRAMES:{Mr(t,e);break}}}function kA(t,e){e.chars=Ut,t._insertCharacters(e)}function PA(t,e){t._insertCharacters(e),t.framesetOk=!1}function _g(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==pe.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function MA(t,e){if(QT(e))_g(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===pe.MATHML?ng(e):r===pe.SVG&&(ZT(e),rg(e)),uh(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function BA(t,e){if(e.tagID===c.P||e.tagID===c.BR){_g(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===pe.HTML){t._endTagOutsideForeignContent(e);break}const s=t.treeAdapter.getTagName(r);if(s.toLowerCase()===e.tagName){e.tagName=s,t.openElements.shortenToLength(n);break}}}function Tg(t,e){return function(r){let s,a=0,i="";for(;s=t.exec(r);)a!==s.index&&(i+=r.substring(a,s.index)),i+=e.get(s[0].charCodeAt(0)),a=s.index+1;return i+r.substring(a)}}const FA=Tg(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),UA=Tg(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),HA=new Set([Z.AREA,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BR,Z.COL,Z.EMBED,Z.FRAME,Z.HR,Z.IMG,Z.INPUT,Z.KEYGEN,Z.LINK,Z.META,Z.PARAM,Z.SOURCE,Z.TRACK,Z.WBR]);function Ag(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===pe.HTML&&HA.has(e.treeAdapter.getTagName(t))}const qA={treeAdapter:hs,scriptingEnabled:!0};function jA(t,e){const n={...qA,...e};return Ag(t,n)?"":yg(t,n)}function yg(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===Z.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===pe.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=$A(a,e);return n}function $A(t,e){return e.treeAdapter.isElementNode(t)?YA(t,e):e.treeAdapter.isTextNode(t)?WA(t,e):e.treeAdapter.isCommentNode(t)?GA(t,e):e.treeAdapter.isDocumentTypeNode(t)?KA(t,e):""}function YA(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${zA(t,e)}>${Ag(t,e)?"":`${yg(t,e)}</${n}>`}`}function zA(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case pe.XML:{n+=`xml:${r.name}`;break}case pe.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case pe.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${FA(r.value)}"`}return n}function WA(t,e){const{treeAdapter:n}=e,r=n.getTextNodeContent(t),s=n.getParentNode(t),a=s&&n.isElementNode(s)&&n.getTagName(s);return a&&n.getNamespaceURI(s)===pe.HTML&&ST(a,e.scriptingEnabled)?r:UA(r)}function GA(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function KA(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function VA(t,e){return ag.parse(t,e)}function fh(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=ag.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Qn(t){return"tagName"in t}function rs(t){return t.nodeName==="#text"}function xt(t,e){var n;return(n=t.attrs.find(r=>r.name===e))==null?void 0:n.value}function Qs(t,e){return t.attrs.some(n=>n.name===e)}function M0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function hh(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function Zs(t){return fh(t).childNodes}function XA(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function $i(t){return XA(t)?VA(t).childNodes:fh(t).childNodes}function QA(t){const e=fh("");return e.childNodes=t,jA(e)}const ph={image:{type:"image",valueKind:"asset",control:"image",multiline:!1},file:{type:"file",valueKind:"asset",control:"file",multiline:!1},url:{type:"url",valueKind:"url",control:"url",multiline:!1},email:{type:"email",valueKind:"text",control:"email",multiline:!1},phone:{type:"phone",valueKind:"text",control:"phone",multiline:!1},date:{type:"date",valueKind:"text",control:"date",multiline:!1},time:{type:"time",valueKind:"text",control:"time",multiline:!1},code:{type:"code",valueKind:"text",control:"code",multiline:!0},richtext:{type:"richtext",valueKind:"html",control:"richtext",multiline:!0},authors:{type:"authors",valueKind:"authors",control:"authors",multiline:!1},text:{type:"text",valueKind:"text",control:"text",multiline:!0},shorttext:{type:"shorttext",valueKind:"text",control:"shorttext",multiline:!1}};function ZA(t){return Object.prototype.hasOwnProperty.call(ph,t)}function Ya(t){return ph[t].valueKind}const JA=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),ey=new Set(["code","pre","kbd","samp"]),ty=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Pa(t){if(t.annotation!==void 0&&ZA(t.annotation))return t.annotation;if(t.attribute!==void 0){const e=t.attribute,n=(t.valuePrefix??"").toLowerCase();if(e==="href"){if(n.endsWith("mailto:"))return"email";if(n.endsWith("tel:"))return"phone";if(t.wholeValue)return t.download===!0?"file":"url"}return t.wholeValue&&e==="src"?t.tag==="img"?"image":"file":t.wholeValue&&t.tag==="source"&&e==="srcset"?"file":"shorttext"}return ey.has(t.tag)?"code":JA.has(t.tag)?"shorttext":ty.has(t.tag)?"text":"shorttext"}const ny=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function Es(t){const e=[];for(const n of t.matchAll(ny)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Ma(t){var r;const e=t.trim(),n=Es(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function ec(t,e){return t.replace(/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g,(n,r)=>{const s=r.split(".");return e({raw:n,name:s[0]??"",path:s,dotted:s.length>1})})}function mh(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function Ng(t){const e=B0(xt(t,"data-minlength")),n=B0(xt(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function B0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function _s(t,e=new Map){return wg(t,e,new Set)}function Sg(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=wg(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function wg(t,e,n){const r=[],s=new Map,a=h=>{const g=s.get(h);if(g!==void 0)return g;const f={name:h,type:"shorttext",label:nh(h),required:!1,multiline:!1};return s.set(h,f),r.push(h),f},i=(h,g)=>{if(s.has(h))return;const f=a(h);f.type=g,f.multiline=ph[g].multiline},o=h=>{const g=xt(h,"data-field")??ry(h);if(g===void 0)return;const f=a(g);Qs(h,"data-required")&&(f.required=!0);const p=xt(h,"data-help");p!==void 0&&(f.help=p);const v=xt(h,"data-label");v!==void 0&&(f.label=v);const{minLength:T,maxLength:_}=Ng(h);T!==void 0&&(f.minLength=T),_!==void 0&&(f.maxLength=_)},l=h=>{const g=Ma(h);for(const f of Es(h))f.dotted||i(f.name,Pa({tag:"",wholeValue:(g==null?void 0:g.name)===f.name}))},d=h=>{for(const g of h){if(!Qn(g)){rs(g)&&l(g.value);continue}const f=xt(g,"data-each");if(f!==void 0){const T=a(f);T.type="url",T.multiple=!0;const _=xt(g,"data-pick-from");_!==void 0&&(T.pickFrom=_),o(g);continue}if(Qs(g,"data-each-in"))continue;const p=xt(g,"data-type"),v=e.has(g.tagName)?Sg(g.tagName,e,n):void 0;for(const T of g.attrs){const _=Ma(T.value);for(const E of Es(T.value)){if(E.dotted)continue;const O=(_==null?void 0:_.name)===E.name,C=O?v==null?void 0:v.get(T.name):void 0;i(E.name,C??Pa({tag:g.tagName,attribute:T.name,wholeValue:O,valuePrefix:mh(T.value),download:Qs(g,"download"),...p!==void 0&&{annotation:p}}))}}for(const T of g.childNodes){if(!rs(T))continue;const _=Ma(T.value);for(const E of Es(T.value))E.dotted||i(E.name,Pa({tag:g.tagName,wholeValue:(_==null?void 0:_.name)===E.name,...p!==void 0&&{annotation:p}}))}o(g),d(g.childNodes)}};return d($i(t)),r.map(h=>sy(s.get(h)))}function ry(t){for(const e of t.attrs){const n=Es(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(rs(e)){const n=Es(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function sy(t){return{name:t.name,type:t.type,label:t.label,required:t.required,multiline:t.multiline,...t.help!==void 0&&{help:t.help},...t.minLength!==void 0&&{minLength:t.minLength},...t.maxLength!==void 0&&{maxLength:t.maxLength},...t.multiple!==void 0&&{multiple:t.multiple},...t.pickFrom!==void 0&&{pickFrom:t.pickFrom}}}function ay(t,e){if(t===e)return!1;const n=Ya(t),r=Ya(e);return r==="html"?!1:n==="html"||t==="date"&&e==="time"||t==="time"&&e==="date"||(a=>a==="shorttext"||a==="text"||a==="code"||a==="email"||a==="phone")(t)&&(e==="date"||e==="time")?!0:!(n===r||r==="text")}function iy(t,e){const n=new Map(t.map(o=>[o.name,o])),r=new Map(e.map(o=>[o.name,o])),s=[],a=[],i=[];for(const[o,l]of n){const d=r.get(o);d===void 0?a.push({name:o,type:l.type}):d.type!==l.type&&i.push({name:o,from:l.type,to:d.type,destructive:ay(l.type,d.type)})}for(const[o,l]of r)n.has(o)||s.push({name:o,type:l.type});return{added:s.sort((o,l)=>o.name.localeCompare(l.name)),removed:a.sort((o,l)=>o.name.localeCompare(l.name)),typeChanged:i.sort((o,l)=>o.name.localeCompare(l.name))}}const F0=/^(.+)@v([1-9]\d*)$/;function gh(t){const e=F0.exec(t);if(!e)return null;const n=e[1];return F0.test(n)?null:{base:n,version:Number.parseInt(e[2],10)}}function kd(t){return gh(t)!==null}function YD(t){const e=gh(t);return e?e.base:t}function oy(t){const e=gh(t);return e?e.version:null}const U0="ref:";function tc(t){return t.startsWith(U0)?t.slice(U0.length):void 0}function H0(t){const e=new Set,n=r=>{for(const s of r)if(Qn(s)){for(const a of s.attrs){const i=tc(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n($i(t)),[...e].sort()}function Pd(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,o=new Set,l=new Map,d=new Set,h=g=>{for(const f of g){if(!Qn(f))continue;const p=uy(f);p!==void 0&&o.add(p);const v=xt(f,"data-each-in");if(v!==void 0){r.push(v);continue}const T=xt(f,"data-each");if(T!==void 0&&s.push(T),Qs(f,"data-required")){const C=q0(f);C!==void 0&&n.add(C)}const _=Ng(f);if(_.minLength!==void 0||_.maxLength!==void 0){const C=q0(f);C!==void 0&&l.set(C,_)}const E=xt(f,"data-type"),O=e.has(f.tagName)?Sg(f.tagName,e,new Set):void 0;for(const C of f.attrs){const H=tc(C.value);H!==void 0&&d.add(H);const M=Ma(C.value);if(M===null||M.dotted)continue;const J=(O==null?void 0:O.get(C.name))??Pa({tag:f.tagName,attribute:C.name,wholeValue:!0,valuePrefix:mh(C.value),download:Qs(f,"download"),...E!==void 0&&{annotation:E}});J==="image"?a.add(M.name):J==="file"?i.add(M.name):J==="richtext"&&o.add(M.name)}h(f.childNodes)}};return h($i(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...o],constraints:l,references:[...d].sort()}}function uy(t){const e=t.childNodes.filter(i=>!(rs(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!rs(n))return;const r=Ma(n.value);if(r===null||r.dotted)return;const s=xt(t,"data-type"),a=Pa({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return Ya(a)==="html"?r.name:void 0}function q0(t){const e=xt(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=Es(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(rs(n)){const r=Es(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function ly(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Uc(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function cy(t){return JSON.stringify(t).slice(1,-1)}function Sl(t){let e="";for(const r of t){const s=r.codePointAt(0);s!==void 0&&s>32&&(e+=r)}const n=e.toLowerCase();return n.startsWith("javascript:")||n.startsWith("vbscript:")?"#":t}function dy(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(n===null||typeof n!="object")continue;const r=n,s=typeof r.name=="string"?r.name:"";s.trim()!==""&&e.push({name:s,...typeof r.user=="string"&&r.user!==""&&{user:r.user},...typeof r.href=="string"&&r.href!==""&&{href:r.href}})}return e}function fy(t){if(t.length===0)return"";if(t.length===1)return t[0]??"";const e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`}function hy(t,e){const n=dy(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return ly((s==null?void 0:s.displayName)??r.name)});return fy(n)}const py="public, max-age=31536000, immutable",my=[400,800,1200,1600],gy={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function vy(t){return t==="jpeg"?"jpg":t}function by(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function Ey(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t[n]??0,e=Math.imul(e,16777619);return(e>>>0).toString(36)}async function _y(t,e,n){var _;const r=by(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:my,formats:s}),i=Ey(t),o=e.slice(0,e.lastIndexOf(".")>=0?e.lastIndexOf("."):e.length),l=[],d=E=>{const O=`${o}.${i}-${E.width}.${vy(E.format)}`;return l.push({path:O,contents:E.bytes,cacheControl:py}),`/${O}`},h=new Map;for(const E of[...a.variants].sort((O,C)=>O.width-C.width)){const O=d(E),C=h.get(E.format)??[];C.push({url:O,width:E.width}),h.set(E.format,C)}const g=E=>(h.get(E)??[]).map(O=>`${O.url} ${O.width}w`).join(", "),f=["avif","webp"].filter(E=>h.has(E)).map(E=>({format:E,mime:gy[E],srcset:g(E)})),p=h.get(r)??[],v=((_=p[p.length-1])==null?void 0:_.url)??`/${e}`,T={width:a.sourceWidth,height:a.sourceHeight,sources:f,fallbackSrc:v,...a.blurDataUri!==void 0&&{blurDataUri:a.blurDataUri}};return{artifacts:l,info:T}}function Ig(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${Uc(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${Uc(i)}"`).join(""),s=`<img src="${Uc(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const Ty=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],Ay=["data-type","data-field","data-required","data-help","data-label"];function Md(t){const e={components:t.components,usedComponents:new Set,...t.context!==void 0&&{context:t.context},...t.media!==void 0&&{media:t.media},...t.authorDirectory!==void 0&&{authorDirectory:t.authorDirectory},...t.componentStyles!==void 0&&{componentStyles:t.componentStyles}},n=Yo($i(t.template),t.scope,e),r=t.document===void 0?n:xg(Yo($i(t.document),t.scope,e),n);return yy(r,t,e),QA(r)}function yy(t,e,n){var i,o,l,d;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const h=Zs(`<style>
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-DHyXai5d.js","./TemplatesPane-C-T4XiLp.css","./MigrationsPane-Db55MALu.js","./MigrationsPane-BAHPPSXP.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
var jb=Object.defineProperty;var u0=t=>{throw TypeError(t)};var $b=(t,e,n)=>e in t?jb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var ye=(t,e,n)=>$b(t,typeof e!="symbol"?e+"":e,n),Cc=(t,e,n)=>e.has(t)||u0("Cannot "+n);var X=(t,e,n)=>(Cc(t,e,"read from private field"),n?n.call(t):e.get(t)),je=(t,e,n)=>e.has(t)?u0("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),$e=(t,e,n,r)=>(Cc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),nt=(t,e,n)=>(Cc(t,e,"access private method"),n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const i of a.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=n(s);fetch(s.href,a)}})();const F1=!1;var jf=Array.isArray,Yb=Array.prototype.indexOf,Oa=Array.prototype.includes,$l=Array.from,zb=Object.defineProperty,Vs=Object.getOwnPropertyDescriptor,U1=Object.getOwnPropertyDescriptors,Wb=Object.prototype,Gb=Array.prototype,$f=Object.getPrototypeOf,l0=Object.isExtensible;function oo(t){return typeof t=="function"}const Yf=()=>{};function Kb(t){return t()}function dd(t){for(var e=0;e<t.length;e++)t[e]()}function H1(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function Vb(t,e){if(Array.isArray(t))return t;if(!(Symbol.iterator in t))return Array.from(t);const n=[];for(const r of t)if(n.push(r),n.length===e)break;return n}const Tn=2,Pi=4,uu=8,zf=1<<24,Cr=16,Dr=32,ea=64,fd=128,mr=512,an=1024,pn=2048,ts=4096,Pn=8192,gr=16384,Va=32768,hd=1<<25,As=65536,gl=1<<17,Xb=1<<18,Qi=1<<19,q1=1<<20,Vr=1<<25,Ua=65536,vl=1<<21,Ti=1<<22,Xs=1<<23,Xr=Symbol("$state"),j1=Symbol("legacy props"),Qb=Symbol(""),el=Symbol("attributes"),pd=Symbol("class"),md=Symbol("style"),vo=Symbol("text"),tl=Symbol("form reset"),Yl=new class extends Error{constructor(){super(...arguments);ye(this,"name","StaleReactionError");ye(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var P1;const Wf=!!((P1=globalThis.document)!=null&&P1.contentType)&&globalThis.document.contentType.includes("xml");function $1(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function Zb(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function Jb(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function eE(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function tE(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function nE(t){throw new Error("https://svelte.dev/e/effect_orphan")}function rE(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function sE(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function aE(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function iE(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function oE(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function uE(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const lE=1,cE=2,Y1=4,dE=8,fE=16,hE=1,pE=2,mE=4,gE=8,vE=16,bE=1,EE=2,Zt=Symbol("uninitialized"),z1="http://www.w3.org/1999/xhtml",_E="http://www.w3.org/2000/svg",TE="@attach";function AE(){console.warn("https://svelte.dev/e/derived_inert")}function yE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function NE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function W1(t){return t===this.v}function SE(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function G1(t){return!SE(t,this.v)}let Zi=!1,wE=!1;function IE(){Zi=!0}let Ct=null;function Mi(t){Ct=t}function CE(t){return LE().get(t)}function at(t,e=!1,n){Ct={p:Ct,i:!1,c:null,e:null,s:t,x:null,r:Qe,l:Zi&&!e?{s:null,u:null,$:[]}:null}}function it(t){var e=Ct,n=e.e;if(n!==null){e.e=null;for(var r of n)gm(r)}return e.i=!0,Ct=e.p,{}}function Ji(){return!Zi||Ct!==null&&Ct.l===null}function LE(t){return Ct===null&&$1(),Ct.c??(Ct.c=new Map(OE(Ct)||void 0))}function OE(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let _a=[];function K1(){var t=_a;_a=[],dd(t)}function xr(t){if(_a.length===0&&!So){var e=_a;queueMicrotask(()=>{e===_a&&K1()})}_a.push(t)}function xE(){for(;_a.length>0;)K1()}function V1(t){var e=Qe;if(e===null)return Je.f|=Xs,t;if((e.f&Va)===0&&(e.f&Pi)===0)throw t;$s(t,e)}function $s(t,e){for(;e!==null;){if((e.f&fd)!==0){if((e.f&Va)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const RE=-7169;function zt(t,e){t.f=t.f&RE|e}function Gf(t){(t.f&mr)!==0||t.deps===null?zt(t,an):zt(t,ts)}function X1(t){if(t!==null)for(const e of t)(e.f&Tn)===0||(e.f&Ua)===0||(e.f^=Ua,X1(e.deps))}function Q1(t,e,n){(t.f&pn)!==0?e.add(t):(t.f&ts)!==0&&n.add(t),X1(t.deps),zt(t,an)}let Lu=!1;function DE(t){var e=Lu;try{return Lu=!1,[t(),Lu]}finally{Lu=e}}let Lc=null,ui=null,Fe=null,No=null,bn=null,gd=null,So=!1,Oc=!1,bi=null,nl=null;var c0=0;let kE=1;var Ci,Us,Na,Li,Oi,Sa,xi,ps,tu,zn,nu,Hs,zr,Wr,Ri,wa,vt,vd,bo,bd,Z1,J1,rl,PE,Ed,ci;const Fl=class Fl{constructor(){je(this,vt);ye(this,"id",kE++);je(this,Ci,!1);ye(this,"linked",!0);je(this,Us,null);je(this,Na,null);ye(this,"async_deriveds",new Map);ye(this,"current",new Map);ye(this,"previous",new Map);ye(this,"unblocked",new Set);je(this,Li,new Set);je(this,Oi,new Set);je(this,Sa,new Set);je(this,xi,0);je(this,ps,new Map);je(this,tu,null);je(this,zn,[]);je(this,nu,[]);je(this,Hs,new Set);je(this,zr,new Set);je(this,Wr,new Map);je(this,Ri,new Set);ye(this,"is_fork",!1);je(this,wa,!1)}skip_effect(e){X(this,Wr).has(e)||X(this,Wr).set(e,{d:[],m:[]}),X(this,Ri).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=X(this,Wr).get(e);if(r){X(this,Wr).delete(e);for(var s of r.d)zt(s,pn),n(s);for(s of r.m)zt(s,ts),n(s)}X(this,Ri).add(e)}capture(e,n,r=!1){e.v!==Zt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Xs)===0&&(this.current.set(e,[n,r]),bn==null||bn.set(e,n)),this.is_fork||(e.v=n)}activate(){Fe=this}deactivate(){Fe=null,bn=null}flush(){try{Oc=!0,Fe=this,nt(this,vt,bo).call(this)}finally{c0=0,gd=null,bi=null,nl=null,Oc=!1,Fe=null,bn=null,xa.clear()}}discard(){for(const e of X(this,Oi))e(this);X(this,Oi).clear(),X(this,Sa).clear(),nt(this,vt,ci).call(this)}register_created_effect(e){X(this,nu).push(e)}increment(e,n){if($e(this,xi,X(this,xi)+1),e){let r=X(this,ps).get(n)??0;X(this,ps).set(n,r+1)}}decrement(e,n){if($e(this,xi,X(this,xi)-1),e){let r=X(this,ps).get(n)??0;r===1?X(this,ps).delete(n):X(this,ps).set(n,r-1)}X(this,wa)||($e(this,wa,!0),xr(()=>{$e(this,wa,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)X(this,Hs).add(r);for(const r of n)X(this,zr).add(r);e.clear(),n.clear()}oncommit(e){X(this,Li).add(e)}ondiscard(e){X(this,Oi).add(e)}on_fork_commit(e){X(this,Sa).add(e)}run_fork_commit_callbacks(){for(const e of X(this,Sa))e(this);X(this,Sa).clear()}settled(){return(X(this,tu)??$e(this,tu,H1())).promise}static ensure(){var e;if(Fe===null){const n=Fe=new Fl;nt(e=n,vt,Ed).call(e),!Oc&&!So&&xr(()=>{X(n,Ci)||n.flush()})}return Fe}apply(){{bn=null;return}}schedule(e){var s;if(gd=e,(s=e.b)!=null&&s.is_pending&&(e.f&(Pi|uu|zf))!==0&&(e.f&Va)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(bi!==null&&n===Qe&&(Je===null||(Je.f&Tn)===0))return;if((r&(ea|Dr))!==0){if((r&an)===0)return;n.f^=an}}X(this,zn).push(n)}};Ci=new WeakMap,Us=new WeakMap,Na=new WeakMap,Li=new WeakMap,Oi=new WeakMap,Sa=new WeakMap,xi=new WeakMap,ps=new WeakMap,tu=new WeakMap,zn=new WeakMap,nu=new WeakMap,Hs=new WeakMap,zr=new WeakMap,Wr=new WeakMap,Ri=new WeakMap,wa=new WeakMap,vt=new WeakSet,vd=function(){if(this.is_fork)return!0;for(const r of X(this,ps).keys()){for(var e=r,n=!1;e.parent!==null;){if(X(this,Wr).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},bo=function(){var l,d,f,g;if($e(this,Ci,!0),c0++>1e3&&(nt(this,vt,ci).call(this),BE()),!nt(this,vt,vd).call(this)){for(const h of X(this,Hs))X(this,zr).delete(h),zt(h,pn),this.schedule(h);for(const h of X(this,zr))zt(h,ts),this.schedule(h)}const e=X(this,zn);$e(this,zn,[]),this.apply();var n=bi=[],r=[],s=nl=[];for(const h of e)try{nt(this,vt,bd).call(this,h,n,r)}catch(p){throw nm(h),p}if(Fe=null,s.length>0){var a=Fl.ensure();for(const h of s)a.schedule(h)}if(bi=null,nl=null,nt(this,vt,vd).call(this)){nt(this,vt,rl).call(this,r),nt(this,vt,rl).call(this,n);for(const[h,p]of X(this,Wr))tm(h,p);s.length>0&&nt(l=Fe,vt,bo).call(l);return}const i=nt(this,vt,Z1).call(this);if(i){nt(d=i,vt,J1).call(d,this);return}X(this,Hs).clear(),X(this,zr).clear();for(const h of X(this,Li))h(this);X(this,Li).clear(),No=this,d0(r),d0(n),No=null,(f=X(this,tu))==null||f.resolve();var o=Fe;if(this.linked&&X(this,xi)===0&&nt(this,vt,ci).call(this),X(this,zn).length>0){o===null&&(o=this,nt(this,vt,Ed).call(this));const h=o;X(h,zn).push(...X(this,zn).filter(p=>!X(h,zn).includes(p)))}o!==null&&nt(g=o,vt,bo).call(g)},bd=function(e,n,r){e.f^=an;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Dr|ea))!==0,o=i&&(a&an)!==0,l=o||(a&Pn)!==0||X(this,Wr).has(s);if(!l&&s.fn!==null){i?s.f^=an:(a&Pi)!==0?n.push(s):du(s)&&((a&Cr)!==0&&X(this,zr).add(s),Hi(s));var d=s.first;if(d!==null){s=d;continue}}for(;s!==null;){var f=s.next;if(f!==null){s=f;break}s=s.parent}}},Z1=function(){for(var e=X(this,Us);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=X(e,Us)}return null},J1=function(e){var r;for(const[s,a]of e.current)!this.previous.has(s)&&e.previous.has(s)&&this.previous.set(s,e.previous.get(s)),this.current.set(s,a);for(const[s,a]of e.async_deriveds){const i=this.async_deriveds.get(s);i&&a.promise.then(i.resolve)}const n=s=>{var a=s.reactions;if(a!==null)for(const l of a){var i=l.f;if((i&Tn)!==0)n(l);else{var o=l;i&(Ti|Cr)&&!this.async_deriveds.has(o)&&(X(this,zr).delete(o),zt(o,pn),this.schedule(o))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),nt(r=e,vt,ci).call(r),Fe=this,nt(this,vt,bo).call(this)},rl=function(e){for(var n=0;n<e.length;n+=1)Q1(e[n],X(this,Hs),X(this,zr))},PE=function(){var f;nt(this,vt,ci).call(this);for(let g=Lc;g!==null;g=X(g,Na)){var e=g.id<this.id,n=[];for(const[h,[p,v]]of this.current){if(g.current.has(h)){var r=g.current.get(h)[0];if(e&&p!==r)g.current.set(h,[p,v]);else continue}n.push(h)}if(e)for(const[h,p]of this.async_deriveds){const v=g.async_deriveds.get(h);v&&p.promise.then(v.resolve)}if(X(g,Ci)){var s=[...g.current.keys()].filter(h=>!this.current.has(h));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const h of X(this,Ri))g.unskip_effect(h,p=>{var v;(p.f&(Cr|Ti))!==0?g.schedule(p):nt(v=g,vt,rl).call(v,[p])});g.activate();var a=new Set,i=new Map;for(var o of n)em(o,s,a,i);i=new Map;var l=[...g.current.keys()].filter(h=>this.current.has(h)?this.current.get(h)[0]!==h.v:!0);if(l.length>0)for(const h of X(this,nu))(h.f&(gr|Pn|gl))===0&&Kf(h,l,i)&&((h.f&(Ti|Cr))!==0?(zt(h,pn),g.schedule(h)):X(g,Hs).add(h));if(X(g,zn).length>0&&!X(g,wa)){g.apply();for(var d of X(g,zn))nt(f=g,vt,bd).call(f,d,[],[]);$e(g,zn,[])}g.deactivate()}}}},Ed=function(){ui===null?Lc=ui=this:($e(ui,Na,this),$e(this,Us,ui)),ui=this},ci=function(){var e=X(this,Us),n=X(this,Na);e===null?Lc=n:$e(e,Na,n),n===null?ui=e:$e(n,Us,e),this.linked=!1};let Ha=Fl;function ME(t){var e=So;So=!0;try{for(var n;;){if(xE(),Fe===null)return n;Fe.flush()}}finally{So=e}}function BE(){try{rE()}catch(t){$s(t,gd)}}let Tr=null;function d0(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(gr|Pn))===0&&du(r)&&(Tr=new Set,Hi(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Em(r),(Tr==null?void 0:Tr.size)>0)){xa.clear();for(const s of Tr){if((s.f&(gr|Pn))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)Tr.has(i)&&(Tr.delete(i),a.push(i)),i=i.parent;for(let o=a.length-1;o>=0;o--){const l=a[o];(l.f&(gr|Pn))===0&&Hi(l)}}Tr.clear()}}Tr=null}}function em(t,e,n,r){if(!n.has(t)&&(n.add(t),t.reactions!==null))for(const s of t.reactions){const a=s.f;(a&Tn)!==0?em(s,e,n,r):(a&(Ti|Cr))!==0&&(a&pn)===0&&Kf(s,e,r)&&(zt(s,pn),Vf(s))}}function Kf(t,e,n){const r=n.get(t);if(r!==void 0)return r;if(t.deps!==null)for(const s of t.deps){if(Oa.call(e,s))return!0;if((s.f&Tn)!==0&&Kf(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function Vf(t){Fe.schedule(t)}function tm(t,e){if(!((t.f&Dr)!==0&&(t.f&an)!==0)){(t.f&pn)!==0?e.d.push(t):(t.f&ts)!==0&&e.m.push(t),zt(t,an);for(var n=t.first;n!==null;)tm(n,e),n=n.next}}function nm(t){zt(t,an);for(var e=t.first;e!==null;)nm(e),e=e.next}function FE(t){let e=0,n=qa(0),r;return()=>{Jf()&&(u(n),Wl(()=>(e===0&&(r=na(()=>t(()=>wo(n)))),e+=1,()=>{xr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,wo(n))})})))}}var UE=As|Qi;function HE(t,e,n,r){new qE(t,e,n,r)}var or,qf,ur,Ia,Un,lr,Rn,Wn,ms,Ca,qs,Di,ru,su,gs,Ul,Wt,jE,$E,YE,_d,sl,al,Td,Ad;class qE{constructor(e,n,r,s){je(this,Wt);ye(this,"parent");ye(this,"is_pending",!1);ye(this,"transform_error");je(this,or);je(this,qf,null);je(this,ur);je(this,Ia);je(this,Un);je(this,lr,null);je(this,Rn,null);je(this,Wn,null);je(this,ms,null);je(this,Ca,0);je(this,qs,0);je(this,Di,!1);je(this,ru,new Set);je(this,su,new Set);je(this,gs,null);je(this,Ul,FE(()=>($e(this,gs,qa(X(this,Ca))),()=>{$e(this,gs,null)})));var a;$e(this,or,e),$e(this,ur,n),$e(this,Ia,i=>{var o=Qe;o.b=this,o.f|=fd,r(i)}),this.parent=Qe.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),$e(this,Un,Xa(()=>{nt(this,Wt,_d).call(this)},UE))}defer_effect(e){Q1(e,X(this,ru),X(this,su))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!X(this,ur).pending}update_pending_count(e,n){nt(this,Wt,Td).call(this,e,n),$e(this,Ca,X(this,Ca)+e),!(!X(this,gs)||X(this,Di))&&($e(this,Di,!0),xr(()=>{$e(this,Di,!1),X(this,gs)&&Fi(X(this,gs),X(this,Ca))}))}get_effect_pending(){return X(this,Ul).call(this),u(X(this,gs))}error(e){if(!X(this,ur).onerror&&!X(this,ur).failed)throw e;Fe!=null&&Fe.is_fork?(X(this,lr)&&Fe.skip_effect(X(this,lr)),X(this,Rn)&&Fe.skip_effect(X(this,Rn)),X(this,Wn)&&Fe.skip_effect(X(this,Wn)),Fe.on_fork_commit(()=>{nt(this,Wt,Ad).call(this,e)})):nt(this,Wt,Ad).call(this,e)}}or=new WeakMap,qf=new WeakMap,ur=new WeakMap,Ia=new WeakMap,Un=new WeakMap,lr=new WeakMap,Rn=new WeakMap,Wn=new WeakMap,ms=new WeakMap,Ca=new WeakMap,qs=new WeakMap,Di=new WeakMap,ru=new WeakMap,su=new WeakMap,gs=new WeakMap,Ul=new WeakMap,Wt=new WeakSet,jE=function(){try{$e(this,lr,qn(()=>X(this,Ia).call(this,X(this,or))))}catch(e){this.error(e)}},$E=function(e){const n=X(this,ur).failed;n&&$e(this,Wn,qn(()=>{n(X(this,or),()=>e,()=>()=>{})}))},YE=function(){const e=X(this,ur).pending;e&&(this.is_pending=!0,$e(this,Rn,qn(()=>e(X(this,or)))),xr(()=>{var n=$e(this,ms,document.createDocumentFragment()),r=Qr();n.append(r),$e(this,lr,nt(this,Wt,al).call(this,()=>qn(()=>X(this,Ia).call(this,r)))),X(this,qs)===0&&(X(this,or).before(n),$e(this,ms,null),Ra(X(this,Rn),()=>{$e(this,Rn,null)}),nt(this,Wt,sl).call(this,Fe))}))},_d=function(){try{if(this.is_pending=this.has_pending_snippet(),$e(this,qs,0),$e(this,Ca,0),$e(this,lr,qn(()=>{X(this,Ia).call(this,X(this,or))})),X(this,qs)>0){var e=$e(this,ms,document.createDocumentFragment());nh(X(this,lr),e);const n=X(this,ur).pending;$e(this,Rn,qn(()=>n(X(this,or))))}else nt(this,Wt,sl).call(this,Fe)}catch(n){this.error(n)}},sl=function(e){this.is_pending=!1,e.transfer_effects(X(this,ru),X(this,su))},al=function(e){var n=Qe,r=Je,s=Ct;ns(X(this,Un)),br(X(this,Un)),Mi(X(this,Un).ctx);try{return Ha.ensure(),e()}catch(a){return V1(a),null}finally{ns(n),br(r),Mi(s)}},Td=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&nt(r=this.parent,Wt,Td).call(r,e,n);return}$e(this,qs,X(this,qs)+e),X(this,qs)===0&&(nt(this,Wt,sl).call(this,n),X(this,Rn)&&Ra(X(this,Rn),()=>{$e(this,Rn,null)}),X(this,ms)&&(X(this,or).before(X(this,ms)),$e(this,ms,null)))},Ad=function(e){X(this,lr)&&(En(X(this,lr)),$e(this,lr,null)),X(this,Rn)&&(En(X(this,Rn)),$e(this,Rn,null)),X(this,Wn)&&(En(X(this,Wn)),$e(this,Wn,null));var n=X(this,ur).onerror;let r=X(this,ur).failed;var s=!1,a=!1;const i=()=>{if(s){NE();return}s=!0,a&&uE(),X(this,Wn)!==null&&Ra(X(this,Wn),()=>{$e(this,Wn,null)}),nt(this,Wt,al).call(this,()=>{nt(this,Wt,_d).call(this)})},o=l=>{try{a=!0,n==null||n(l,i),a=!1}catch(d){$s(d,X(this,Un)&&X(this,Un).parent)}r&&$e(this,Wn,nt(this,Wt,al).call(this,()=>{try{return qn(()=>{var d=Qe;d.b=this,d.f|=fd,r(X(this,or),()=>l,()=>i)})}catch(d){return $s(d,X(this,Un).parent),null}}))};xr(()=>{var l;try{l=this.transform_error(e)}catch(d){$s(d,X(this,Un)&&X(this,Un).parent);return}l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(o,d=>$s(d,X(this,Un)&&X(this,Un).parent)):o(l)})};function rm(t,e,n,r){const s=Ji()?Bi:Xf;var a=t.filter(h=>!h.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Qe,o=zE(),l=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(h=>h.promise)):null;function d(h){if((i.f&gr)===0){o();try{r(h)}catch(p){$s(p,i)}bl()}}var f=sm();if(n.length===0){l.then(()=>d(e.map(s))).finally(f);return}function g(){Promise.all(n.map(h=>WE(h))).then(h=>d([...e.map(s),...h])).catch(h=>$s(h,i)).finally(f)}l?l.then(()=>{o(),g(),bl()}):g()}function zE(){var t=Qe,e=Je,n=Ct,r=Fe;return function(a=!0){ns(t),br(e),Mi(n),a&&(t.f&gr)===0&&(r==null||r.activate(),r==null||r.apply())}}function bl(t=!0){ns(null),br(null),Mi(null),t&&(Fe==null||Fe.deactivate())}function sm(){var t=Qe,e=t.b,n=Fe,r=e.is_rendered();return e.update_pending_count(1,n),n.increment(r,t),()=>{e.update_pending_count(-1,n),n.decrement(r,t)}}function Bi(t){var e=Tn|pn;return Qe!==null&&(Qe.f|=Qi),{ctx:Ct,deps:null,effects:null,equals:W1,f:e,fn:t,reactions:null,rv:0,v:Zt,wv:0,parent:Qe,ac:null}}const Ou=Symbol("obsolete");function WE(t,e,n){let r=Qe;r===null&&Zb();var s=void 0,a=qa(Zt),i=!Je,o=new Set;return r_(()=>{var p;var l=Qe,d=H1();s=d.promise;try{Promise.resolve(t()).then(d.resolve,v=>{v!==Yl&&d.reject(v)}).finally(bl)}catch(v){d.reject(v),bl()}var f=Fe;if(i){if((l.f&Va)!==0)var g=sm();if(r.b.is_rendered())(p=f.async_deriveds.get(l))==null||p.reject(Ou);else for(const v of o.values())v.reject(Ou);o.add(d),f.async_deriveds.set(l,d)}const h=(v,T=void 0)=>{g==null||g(),o.delete(d),T!==Ou&&(f.activate(),T?(a.f|=Xs,Fi(a,T)):((a.f&Xs)!==0&&(a.f^=Xs),Fi(a,v)),f.deactivate())};d.promise.then(h,v=>h(null,v||"unknown"))}),cu(()=>{for(const l of o)l.reject(Ou)}),new Promise(l=>{function d(f){function g(){f===s?l(a):d(s)}f.then(g,g)}d(s)})}function _e(t){const e=Bi(t);return Am(e),e}function Xf(t){const e=Bi(t);return e.equals=G1,e}function GE(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)En(e[n])}}function Qf(t){var e,n=Qe,r=t.parent;if(!ys&&r!==null&&t.v!==Zt&&(r.f&(gr|Pn))!==0)return AE(),t.v;ns(r);try{t.f&=~Ua,GE(t),e=wm(t)}finally{ns(n)}return e}function am(t){var e=Qf(t);if(!t.equals(e)&&(t.wv=Nm(),(!(Fe!=null&&Fe.is_fork)||t.deps===null)&&(Fe!==null?(Fe.capture(t,e,!0),No==null||No.capture(t,e,!0)):t.v=e,t.deps===null))){zt(t,an);return}ys||(bn!==null?(Jf()||Fe!=null&&Fe.is_fork)&&bn.set(t,e):Gf(t))}function KE(t){var e,n;if(t.effects!==null)for(const r of t.effects)(r.teardown||r.ac)&&((e=r.teardown)==null||e.call(r),(n=r.ac)==null||n.abort(Yl),r.fn!==null&&(r.teardown=Yf),r.ac=null,qo(r,0),eh(r))}function im(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&Hi(e)}let El=new Set;const xa=new Map;let om=!1;function qa(t,e){var n={f:0,v:t,reactions:null,equals:W1,rv:0,wv:0};return n}function Q(t,e){const n=qa(t);return Am(n),n}function VE(t,e=!1,n=!0){var s;const r=qa(t);return e||(r.equals=G1),Zi&&n&&Ct!==null&&Ct.l!==null&&((s=Ct.l).s??(s.s=[])).push(r),r}function A(t,e,n=!1){Je!==null&&(!Lr||(Je.f&gl)!==0)&&Ji()&&(Je.f&(Tn|Cr|Ti|gl))!==0&&(vr===null||!Oa.call(vr,t))&&oE();let r=n?ct(e):e;return Fi(t,r,nl)}function Fi(t,e,n=null){if(!t.equals(e)){xa.set(t,ys?e:t.v);var r=Ha.ensure();if(r.capture(t,e),(t.f&Tn)!==0){const s=t;(t.f&pn)!==0&&Qf(s),bn===null&&Gf(s)}t.wv=Nm(),um(t,pn,n),Ji()&&Qe!==null&&(Qe.f&an)!==0&&(Qe.f&(Dr|ea))===0&&(ir===null?i_([t]):ir.push(t)),!r.is_fork&&El.size>0&&!om&&XE()}return e}function XE(){om=!1;for(const t of El){(t.f&an)!==0&&zt(t,ts);let e;try{e=du(t)}catch{e=!0}e&&Hi(t)}El.clear()}function wo(t){A(t,t.v+1)}function um(t,e,n){var r=t.reactions;if(r!==null)for(var s=Ji(),a=r.length,i=0;i<a;i++){var o=r[i],l=o.f;if(!(!s&&o===Qe)){var d=(l&pn)===0;if(d&&zt(o,e),(l&gl)!==0)El.add(o);else if((l&Tn)!==0){var f=o;bn==null||bn.delete(f),(l&Ua)===0&&(l&mr&&(Qe===null||(Qe.f&vl)===0)&&(o.f|=Ua),um(f,ts,n))}else if(d){var g=o;(l&Cr)!==0&&Tr!==null&&Tr.add(g),n!==null?n.push(g):Vf(g)}}}}function ct(t){if(typeof t!="object"||t===null||Xr in t)return t;const e=$f(t);if(e!==Wb&&e!==Gb)return t;var n=new Map,r=jf(t),s=Q(0),a=Da,i=o=>{if(Da===a)return o();var l=Je,d=Da;br(null),g0(a);var f=o();return br(l),g0(d),f};return r&&n.set("length",Q(t.length)),new Proxy(t,{defineProperty(o,l,d){(!("value"in d)||d.configurable===!1||d.enumerable===!1||d.writable===!1)&&aE();var f=n.get(l);return f===void 0?i(()=>{var g=Q(d.value);return n.set(l,g),g}):A(f,d.value,!0),!0},deleteProperty(o,l){var d=n.get(l);if(d===void 0){if(l in o){const f=i(()=>Q(Zt));n.set(l,f),wo(s)}}else A(d,Zt),wo(s);return!0},get(o,l,d){var p;if(l===Xr)return t;var f=n.get(l),g=l in o;if(f===void 0&&(!g||(p=Vs(o,l))!=null&&p.writable)&&(f=i(()=>{var v=ct(g?o[l]:Zt),T=Q(v);return T}),n.set(l,f)),f!==void 0){var h=u(f);return h===Zt?void 0:h}return Reflect.get(o,l,d)},getOwnPropertyDescriptor(o,l){var d=Reflect.getOwnPropertyDescriptor(o,l);if(d&&"value"in d){var f=n.get(l);f&&(d.value=u(f))}else if(d===void 0){var g=n.get(l),h=g==null?void 0:g.v;if(g!==void 0&&h!==Zt)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return d},has(o,l){var h;if(l===Xr)return!0;var d=n.get(l),f=d!==void 0&&d.v!==Zt||Reflect.has(o,l);if(d!==void 0||Qe!==null&&(!f||(h=Vs(o,l))!=null&&h.writable)){d===void 0&&(d=i(()=>{var p=f?ct(o[l]):Zt,v=Q(p);return v}),n.set(l,d));var g=u(d);if(g===Zt)return!1}return f},set(o,l,d,f){var C;var g=n.get(l),h=l in o;if(r&&l==="length")for(var p=d;p<g.v;p+=1){var v=n.get(p+"");v!==void 0?A(v,Zt):p in o&&(v=i(()=>Q(Zt)),n.set(p+"",v))}if(g===void 0)(!h||(C=Vs(o,l))!=null&&C.writable)&&(g=i(()=>Q(void 0)),A(g,ct(d)),n.set(l,g));else{h=g.v!==Zt;var T=i(()=>ct(d));A(g,T)}var _=Reflect.getOwnPropertyDescriptor(o,l);if(_!=null&&_.set&&_.set.call(f,d),!h){if(r&&typeof l=="string"){var E=n.get("length"),O=Number(l);Number.isInteger(O)&&O>=E.v&&A(E,O+1)}wo(s)}return!0},ownKeys(o){u(s);var l=Reflect.ownKeys(o).filter(g=>{var h=n.get(g);return h===void 0||h.v!==Zt});for(var[d,f]of n)f.v!==Zt&&!(d in o)&&l.push(d);return l},setPrototypeOf(){iE()}})}function f0(t){try{if(t!==null&&typeof t=="object"&&Xr in t)return t[Xr]}catch{}return t}function lm(t,e){return Object.is(f0(t),f0(e))}var h0,cm,dm,fm;function QE(){if(h0===void 0){h0=window,cm=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;dm=Vs(e,"firstChild").get,fm=Vs(e,"nextSibling").get,l0(t)&&(t[pd]=void 0,t[el]=null,t[md]=void 0,t.__e=void 0),l0(n)&&(n[vo]=void 0)}}function Qr(t=""){return document.createTextNode(t)}function Ui(t){return dm.call(t)}function lu(t){return fm.call(t)}function N(t,e){return Ui(t)}function et(t,e=!1){{var n=Ui(t);return n instanceof Comment&&n.data===""?lu(n):n}}function I(t,e=1,n=!1){let r=t;for(;e--;)r=lu(r);return r}function ZE(t){t.textContent=""}function hm(){return!1}function pm(t,e,n){return document.createElementNS(e??z1,t,void 0)}function ja(t,e){if(e){const n=document.body;t.autofocus=!0,xr(()=>{document.activeElement===n&&t.focus()})}}let p0=!1;function JE(){p0||(p0=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[tl])==null||e.call(n)})},{capture:!0}))}function zl(t){var e=Je,n=Qe;br(null),ns(null);try{return t()}finally{br(e),ns(n)}}function Zf(t,e,n,r=n){t.addEventListener(e,()=>zl(n));const s=t[tl];s?t[tl]=()=>{s(),r(!0)}:t[tl]=()=>r(!0),JE()}function mm(t){Qe===null&&(Je===null&&nE(),tE()),ys&&eE()}function e_(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Pr(t,e){var n=Qe;n!==null&&(n.f&Pn)!==0&&(t|=Pn);var r={ctx:Ct,deps:null,nodes:null,f:t|pn|mr,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};Fe==null||Fe.register_created_effect(r);var s=r;if((t&Pi)!==0)bi!==null?bi.push(r):Ha.ensure().schedule(r);else if(e!==null){try{Hi(r)}catch(i){throw En(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Qi)===0&&(s=s.first,(t&Cr)!==0&&(t&As)!==0&&s!==null&&(s.f|=As))}if(s!==null&&(s.parent=n,n!==null&&e_(s,n),Je!==null&&(Je.f&Tn)!==0&&(t&ea)===0)){var a=Je;(a.effects??(a.effects=[])).push(s)}return r}function Jf(){return Je!==null&&!Lr}function cu(t){const e=Pr(uu,null);return zt(e,an),e.teardown=t,e}function Rt(t){mm();var e=Qe.f,n=!Je&&(e&Dr)!==0&&(e&Va)===0;if(n){var r=Ct;(r.e??(r.e=[])).push(t)}else return gm(t)}function gm(t){return Pr(Pi|q1,t)}function t_(t){return mm(),Pr(uu|q1,t)}function n_(t){Ha.ensure();const e=Pr(ea|Qi,t);return(n={})=>new Promise(r=>{n.outro?Ra(e,()=>{En(e),r(void 0)}):(En(e),r(void 0))})}function eo(t){return Pr(Pi,t)}function r_(t){return Pr(Ti|Qi,t)}function Wl(t,e=0){return Pr(uu|e,t)}function re(t,e=[],n=[],r=[]){rm(r,e,n,s=>{Pr(uu,()=>t(...s.map(u)))})}function Xa(t,e=0){var n=Pr(Cr|e,t);return n}function vm(t,e=0){var n=Pr(zf|e,t);return n}function qn(t){return Pr(Dr|Qi,t)}function bm(t){var e=t.teardown;if(e!==null){const n=ys,r=Je;m0(!0),br(null);try{e.call(null)}finally{m0(n),br(r)}}}function eh(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&zl(()=>{s.abort(Yl)});var r=n.next;(n.f&ea)!==0?n.parent=null:En(n,e),n=r}}function s_(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Dr)===0&&En(e),e=n}}function En(t,e=!0){var n=!1;(e||(t.f&Xb)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(a_(t.nodes.start,t.nodes.end),n=!0),zt(t,hd),eh(t,e&&!n),qo(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();bm(t),t.f^=hd,t.f|=gr;var s=t.parent;s!==null&&s.first!==null&&Em(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function a_(t,e){for(;t!==null;){var n=t===e?null:lu(t);t.remove(),t=n}}function Em(t){var e=t.parent,n=t.prev,r=t.next;n!==null&&(n.next=r),r!==null&&(r.prev=n),e!==null&&(e.first===t&&(e.first=r),e.last===t&&(e.last=n))}function Ra(t,e,n=!0){var r=[];_m(t,r,!0);var s=()=>{n&&En(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var o of r)o.out(i)}else s()}function _m(t,e,n){if((t.f&Pn)===0){t.f^=Pn;var r=t.nodes&&t.nodes.t;if(r!==null)for(const o of r)(o.is_global||n)&&e.push(o);for(var s=t.first;s!==null;){var a=s.next;if((s.f&ea)===0){var i=(s.f&As)!==0||(s.f&Dr)!==0&&(t.f&Cr)!==0;_m(s,e,i?n:!1)}s=a}}}function th(t){Tm(t,!0)}function Tm(t,e){if((t.f&Pn)!==0){t.f^=Pn,(t.f&an)===0&&(zt(t,pn),Ha.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&As)!==0||(n.f&Dr)!==0;Tm(n,s?e:!1),n=r}var a=t.nodes&&t.nodes.t;if(a!==null)for(const i of a)(i.is_global||e)&&i.in()}}function nh(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:lu(n);e.append(n),n=s}}let il=!1,ys=!1;function m0(t){ys=t}let Je=null,Lr=!1;function br(t){Je=t}let Qe=null;function ns(t){Qe=t}let vr=null;function Am(t){Je!==null&&(vr===null?vr=[t]:vr.push(t))}let Hn=null,Yn=0,ir=null;function i_(t){ir=t}let ym=1,Ta=0,Da=Ta;function g0(t){Da=t}function Nm(){return++ym}function du(t){var e=t.f;if((e&pn)!==0)return!0;if(e&Tn&&(t.f&=~Ua),(e&ts)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(du(a)&&am(a),a.wv>t.wv)return!0}(e&mr)!==0&&bn===null&&zt(t,an)}return!1}function Sm(t,e,n=!0){var r=t.reactions;if(r!==null&&!(vr!==null&&Oa.call(vr,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&Tn)!==0?Sm(a,e,!1):e===a&&(n?zt(a,pn):(a.f&an)!==0&&zt(a,ts),Vf(a))}}function wm(t){var T;var e=Hn,n=Yn,r=ir,s=Je,a=vr,i=Ct,o=Lr,l=Da,d=t.f;Hn=null,Yn=0,ir=null,Je=(d&(Dr|ea))===0?t:null,vr=null,Mi(t.ctx),Lr=!1,Da=++Ta,t.ac!==null&&(zl(()=>{t.ac.abort(Yl)}),t.ac=null);try{t.f|=vl;var f=t.fn,g=f();t.f|=Va;var h=t.deps,p=Fe==null?void 0:Fe.is_fork;if(Hn!==null){var v;if(p||qo(t,Yn),h!==null&&Yn>0)for(h.length=Yn+Hn.length,v=0;v<Hn.length;v++)h[Yn+v]=Hn[v];else t.deps=h=Hn;if(Jf()&&(t.f&mr)!==0)for(v=Yn;v<h.length;v++)((T=h[v]).reactions??(T.reactions=[])).push(t)}else!p&&h!==null&&Yn<h.length&&(qo(t,Yn),h.length=Yn);if(Ji()&&ir!==null&&!Lr&&h!==null&&(t.f&(Tn|ts|pn))===0)for(v=0;v<ir.length;v++)Sm(ir[v],t);if(s!==null&&s!==t){if(Ta++,s.deps!==null)for(let _=0;_<n;_+=1)s.deps[_].rv=Ta;if(e!==null)for(const _ of e)_.rv=Ta;ir!==null&&(r===null?r=ir:r.push(...ir))}return(t.f&Xs)!==0&&(t.f^=Xs),g}catch(_){return V1(_)}finally{t.f^=vl,Hn=e,Yn=n,ir=r,Je=s,vr=a,Mi(i),Lr=o,Da=l}}function o_(t,e){let n=e.reactions;if(n!==null){var r=Yb.call(n,t);if(r!==-1){var s=n.length-1;s===0?n=e.reactions=null:(n[r]=n[s],n.pop())}}if(n===null&&(e.f&Tn)!==0&&(Hn===null||!Oa.call(Hn,e))){var a=e;(a.f&mr)!==0&&(a.f^=mr,a.f&=~Ua),a.v!==Zt&&Gf(a),KE(a),qo(a,0)}}function qo(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)o_(t,n[r])}function Hi(t){var e=t.f;if((e&gr)===0){zt(t,an);var n=Qe,r=il;Qe=t,il=!0;try{(e&(Cr|zf))!==0?s_(t):eh(t),bm(t);var s=wm(t);t.teardown=typeof s=="function"?s:null,t.wv=ym;var a;F1&&wE&&(t.f&pn)!==0&&t.deps}finally{il=r,Qe=n}}}async function Im(){await Promise.resolve(),ME()}function u(t){var e=t.f,n=(e&Tn)!==0;if(Je!==null&&!Lr){var r=Qe!==null&&(Qe.f&gr)!==0;if(!r&&(vr===null||!Oa.call(vr,t))){var s=Je.deps;if((Je.f&vl)!==0)t.rv<Ta&&(t.rv=Ta,Hn===null&&s!==null&&s[Yn]===t?Yn++:Hn===null?Hn=[t]:Hn.push(t));else{Je.deps??(Je.deps=[]),Oa.call(Je.deps,t)||Je.deps.push(t);var a=t.reactions;a===null?t.reactions=[Je]:Oa.call(a,Je)||a.push(Je)}}}if(ys&&xa.has(t))return xa.get(t);if(n){var i=t;if(ys){var o=i.v;return((i.f&an)===0&&i.reactions!==null||Lm(i))&&(o=Qf(i)),xa.set(i,o),o}var l=(i.f&mr)===0&&!Lr&&Je!==null&&(il||(Je.f&mr)!==0),d=(i.f&Va)===0;du(i)&&(l&&(i.f|=mr),am(i)),l&&!d&&(im(i),Cm(i))}if(bn!=null&&bn.has(t))return bn.get(t);if((t.f&Xs)!==0)throw t.v;return t.v}function Cm(t){if(t.f|=mr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&Tn)!==0&&(e.f&mr)===0&&(im(e),Cm(e))}function Lm(t){if(t.v===Zt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(xa.has(e)||(e.f&Tn)!==0&&Lm(e))return!0;return!1}function na(t){var e=Lr;try{return Lr=!0,t()}finally{Lr=e}}function u_(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(Xr in t)yd(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&Xr in n&&yd(n)}}}function yd(t,e=new Set){if(typeof t=="object"&&t!==null&&!(t instanceof EventTarget)&&!e.has(t)){e.add(t),t instanceof Date&&t.getTime();for(let r in t)try{yd(t[r],e)}catch{}const n=$f(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=U1(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function l_(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const c_=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function d_(t){return c_.includes(t)}const f_={formnovalidate:"formNoValidate",ismap:"isMap",nomodule:"noModule",playsinline:"playsInline",readonly:"readOnly",defaultvalue:"defaultValue",defaultchecked:"defaultChecked",srcobject:"srcObject",novalidate:"noValidate",allowfullscreen:"allowFullscreen",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback"};function h_(t){return t=t.toLowerCase(),f_[t]??t}const p_=["touchstart","touchmove"];function m_(t){return p_.includes(t)}const Aa=Symbol("events"),Om=new Set,Nd=new Set;function xm(t,e,n,r={}){function s(a){if(r.capture||Sd.call(e,a),!a.cancelBubble)return zl(()=>n==null?void 0:n.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?xr(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function Ue(t,e,n,r,s){var a={capture:r,passive:s},i=xm(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&cu(()=>{e.removeEventListener(t,i,a)})}function ie(t,e,n){(e[Aa]??(e[Aa]={}))[t]=n}function Tt(t){for(var e=0;e<t.length;e++)Om.add(t[e]);for(var n of Nd)n(t)}let v0=null;function Sd(t){var _,E;var e=this,n=e.ownerDocument,r=t.type,s=((_=t.composedPath)==null?void 0:_.call(t))||[],a=s[0]||t.target;v0=t;var i=0,o=v0===t&&t[Aa];if(o){var l=s.indexOf(o);if(l!==-1&&(e===document||e===window)){t[Aa]=e;return}var d=s.indexOf(e);if(d===-1)return;l<=d&&(i=l)}if(a=s[i]||t.target,a!==e){zb(t,"currentTarget",{configurable:!0,get(){return a||n}});var f=Je,g=Qe;br(null),ns(null);try{for(var h,p=[];a!==null;){var v=a.assignedSlot||a.parentNode||a.host||null;try{var T=(E=a[Aa])==null?void 0:E[r];T!=null&&(!a.disabled||t.target===a)&&T.call(a,t)}catch(O){h?p.push(O):h=O}if(t.cancelBubble||v===e||v===null)break;a=v}if(h){for(let O of p)queueMicrotask(()=>{throw O});throw h}}finally{t[Aa]=e,delete t.currentTarget,br(f),ns(g)}}}var M1;const xc=((M1=globalThis==null?void 0:globalThis.window)==null?void 0:M1.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function g_(t){return(xc==null?void 0:xc.createHTML(t))??t}function Rm(t){var e=pm("template");return e.innerHTML=g_(t.replaceAll("<!>","<!---->")),e.content}function qi(t,e){var n=Qe;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function $(t,e){var n=(e&bE)!==0,r=(e&EE)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=Rm(a?t:"<!>"+t),n||(s=Ui(s)));var i=r||cm?document.importNode(s,!0):s.cloneNode(!0);if(n){var o=Ui(i),l=i.lastChild;qi(o,l)}else qi(i,i);return i}}function v_(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=Rm(s),o=Ui(i);a=Ui(o)}var l=a.cloneNode(!0);return qi(l,l),l}}function b_(t,e){return v_(t,e,"svg")}function _l(t=""){{var e=Qr(t+"");return qi(e,e),e}}function Kn(){var t=document.createDocumentFragment(),e=document.createComment(""),n=Qr();return t.append(e,n),qi(e,n),t}function F(t,e){t!==null&&t.before(e)}function ae(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[vo]??(t[vo]=t.nodeValue))&&(t[vo]=n,t.nodeValue=`${n}`)}function E_(t,e){return __(t,e)}const xu=new Map;function __(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:o}){QE();var l=void 0,d=n_(()=>{var f=n??e.appendChild(Qr());HE(f,{pending:()=>{}},p=>{at({});var v=Ct;a&&(v.c=a),s&&(r.$$events=s),l=t(p,r)||{},it()},o);var g=new Set,h=p=>{for(var v=0;v<p.length;v++){var T=p[v];if(!g.has(T)){g.add(T);var _=m_(T);for(const C of[e,document]){var E=xu.get(C);E===void 0&&(E=new Map,xu.set(C,E));var O=E.get(T);O===void 0?(C.addEventListener(T,Sd,{passive:_}),E.set(T,1)):E.set(T,O+1)}}}};return h($l(Om)),Nd.add(h),()=>{var _;for(var p of g)for(const E of[e,document]){var v=xu.get(E),T=v.get(p);--T==0?(E.removeEventListener(p,Sd),v.delete(p),v.size===0&&xu.delete(E)):v.set(p,T)}Nd.delete(h),f!==n&&((_=f.parentNode)==null||_.removeChild(f))}});return T_.set(l,d),l}let T_=new WeakMap;var Nr,Gr,Gn,La,au,iu,Hl;class fu{constructor(e,n=!0){ye(this,"anchor");je(this,Nr,new Map);je(this,Gr,new Map);je(this,Gn,new Map);je(this,La,new Set);je(this,au,!0);je(this,iu,e=>{if(X(this,Nr).has(e)){var n=X(this,Nr).get(e),r=X(this,Gr).get(n);if(r)th(r),X(this,La).delete(n);else{var s=X(this,Gn).get(n);s&&(X(this,Gr).set(n,s.effect),X(this,Gn).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of X(this,Nr)){if(X(this,Nr).delete(a),a===e)break;const o=X(this,Gn).get(i);o&&(En(o.effect),X(this,Gn).delete(i))}for(const[a,i]of X(this,Gr)){if(a===n||X(this,La).has(a))continue;const o=()=>{if(Array.from(X(this,Nr).values()).includes(a)){var d=document.createDocumentFragment();nh(i,d),d.append(Qr()),X(this,Gn).set(a,{effect:i,fragment:d})}else En(i);X(this,La).delete(a),X(this,Gr).delete(a)};X(this,au)||!r?(X(this,La).add(a),Ra(i,o,!1)):o()}}});je(this,Hl,e=>{X(this,Nr).delete(e);const n=Array.from(X(this,Nr).values());for(const[r,s]of X(this,Gn))n.includes(r)||(En(s.effect),X(this,Gn).delete(r))});this.anchor=e,$e(this,au,n)}ensure(e,n){var r=Fe,s=hm();if(n&&!X(this,Gr).has(e)&&!X(this,Gn).has(e))if(s){var a=document.createDocumentFragment(),i=Qr();a.append(i),X(this,Gn).set(e,{effect:qn(()=>n(i)),fragment:a})}else X(this,Gr).set(e,qn(()=>n(this.anchor)));if(X(this,Nr).set(r,e),s){for(const[o,l]of X(this,Gr))o===e?r.unskip_effect(l):r.skip_effect(l);for(const[o,l]of X(this,Gn))o===e?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(X(this,iu)),r.ondiscard(X(this,Hl))}else X(this,iu).call(this,r)}}Nr=new WeakMap,Gr=new WeakMap,Gn=new WeakMap,La=new WeakMap,au=new WeakMap,iu=new WeakMap,Hl=new WeakMap;function ce(t,e,n=!1){var r=new fu(t),s=n?As:0;function a(i,o){r.ensure(i,o)}Xa(()=>{var i=!1;e((o,l=0)=>{i=!0,a(l,o)}),i||a(-1,null)},s)}const A_=Symbol("NaN");function y_(t,e,n){var r=new fu(t),s=!Ji();Xa(()=>{var a=e();a!==a&&(a=A_),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function jo(t,e){return e}function N_(t,e,n){for(var r=[],s=e.length,a,i=e.length,o=0;o<s;o++){let g=e[o];Ra(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var h=t.outrogroups;wd(t,$l(a.done)),h.delete(a),h.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var l=r.length===0&&n!==null;if(l){var d=n,f=d.parentNode;ZE(f),f.append(d),t.items.clear()}wd(t,e,!l)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function wd(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const o of i)r.add(t.items.get(o).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=Vr;const i=document.createDocumentFragment();nh(a,i)}else En(e[s],n)}}var b0;function wt(t,e,n,r,s,a=null){var i=t,o=new Map,l=(e&Y1)!==0;if(l){var d=t;i=d.appendChild(Qr())}var f=null,g=Xf(()=>{var C=n();return jf(C)?C:C==null?[]:$l(C)}),h,p=new Map,v=!0;function T(C){(O.effect.f&gr)===0&&(O.pending.delete(C),O.fallback=f,S_(O,h,i,e,r),f!==null&&(h.length===0?(f.f&Vr)===0?th(f):(f.f^=Vr,Eo(f,null,i)):Ra(f,()=>{f=null})))}function _(C){O.pending.delete(C)}var E=Xa(()=>{h=u(g);for(var C=h.length,H=new Set,M=Fe,J=hm(),U=0;U<C;U+=1){var G=h[U],V=r(G,U),ee=v?null:o.get(V);ee?(ee.v&&Fi(ee.v,G),ee.i&&Fi(ee.i,U),J&&M.unskip_effect(ee.e)):(ee=w_(o,v?i:b0??(b0=Qr()),G,V,U,s,e,n),v||(ee.e.f|=Vr),o.set(V,ee)),H.add(V)}if(C===0&&a&&!f&&(v?f=qn(()=>a(i)):(f=qn(()=>a(b0??(b0=Qr()))),f.f|=Vr)),C>H.size&&Jb(),!v)if(p.set(M,H),J){for(const[y,j]of o)H.has(y)||M.skip_effect(j.e);M.oncommit(T),M.ondiscard(_)}else T(M);u(g)}),O={effect:E,items:o,pending:p,outrogroups:null,fallback:f};v=!1}function uo(t){for(;t!==null&&(t.f&Dr)===0;)t=t.next;return t}function S_(t,e,n,r,s){var ee,y,j,b,R,k,D,W,Y;var a=(r&dE)!==0,i=e.length,o=t.items,l=uo(t.effect.first),d,f=null,g,h=[],p=[],v,T,_,E;if(a)for(E=0;E<i;E+=1)v=e[E],T=s(v,E),_=o.get(T).e,(_.f&Vr)===0&&((y=(ee=_.nodes)==null?void 0:ee.a)==null||y.measure(),(g??(g=new Set)).add(_));for(E=0;E<i;E+=1){if(v=e[E],T=s(v,E),_=o.get(T).e,t.outrogroups!==null)for(const B of t.outrogroups)B.pending.delete(_),B.done.delete(_);if((_.f&Pn)!==0&&(th(_),a&&((b=(j=_.nodes)==null?void 0:j.a)==null||b.unfix(),(g??(g=new Set)).delete(_))),(_.f&Vr)!==0)if(_.f^=Vr,_===l)Eo(_,null,n);else{var O=f?f.next:l;_===t.effect.last&&(t.effect.last=_.prev),_.prev&&(_.prev.next=_.next),_.next&&(_.next.prev=_.prev),ks(t,f,_),ks(t,_,O),Eo(_,O,n),f=_,h=[],p=[],l=uo(f.next);continue}if(_!==l){if(d!==void 0&&d.has(_)){if(h.length<p.length){var C=p[0],H;f=C.prev;var M=h[0],J=h[h.length-1];for(H=0;H<h.length;H+=1)Eo(h[H],C,n);for(H=0;H<p.length;H+=1)d.delete(p[H]);ks(t,M.prev,J.next),ks(t,f,M),ks(t,J,C),l=C,f=J,E-=1,h=[],p=[]}else d.delete(_),Eo(_,l,n),ks(t,_.prev,_.next),ks(t,_,f===null?t.effect.first:f.next),ks(t,f,_),f=_;continue}for(h=[],p=[];l!==null&&l!==_;)(d??(d=new Set)).add(l),p.push(l),l=uo(l.next);if(l===null)continue}(_.f&Vr)===0&&h.push(_),f=_,l=uo(_.next)}if(t.outrogroups!==null){for(const B of t.outrogroups)B.pending.size===0&&(wd(t,$l(B.done)),(R=t.outrogroups)==null||R.delete(B));t.outrogroups.size===0&&(t.outrogroups=null)}if(l!==null||d!==void 0){var U=[];if(d!==void 0)for(_ of d)(_.f&Pn)===0&&U.push(_);for(;l!==null;)(l.f&Pn)===0&&l!==t.fallback&&U.push(l),l=uo(l.next);var G=U.length;if(G>0){var V=(r&Y1)!==0&&i===0?n:null;if(a){for(E=0;E<G;E+=1)(D=(k=U[E].nodes)==null?void 0:k.a)==null||D.measure();for(E=0;E<G;E+=1)(Y=(W=U[E].nodes)==null?void 0:W.a)==null||Y.fix()}N_(t,U,V)}}a&&xr(()=>{var B,z;if(g!==void 0)for(_ of g)(z=(B=_.nodes)==null?void 0:B.a)==null||z.apply()})}function w_(t,e,n,r,s,a,i,o){var l=(i&lE)!==0?(i&fE)===0?VE(n,!1,!1):qa(n):null,d=(i&cE)!==0?qa(s):null;return{v:l,i:d,e:qn(()=>(a(e,l??n,d??s,o),()=>{t.delete(r)}))}}function Eo(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&Vr)===0?e.nodes.start:n;r!==null;){var i=lu(r);if(a.before(r),r===s)return;r=i}}function ks(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function I_(t,e,...n){var r=new fu(t);Xa(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},As)}function Id(t,e,n){var r=new fu(t);Xa(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},As)}function C_(t,e,n,r,s,a){var i=null,o=t,l=new fu(o,!1);Xa(()=>{const d=e()||null;var f=_E;if(d===null){l.ensure(null,null);return}return l.ensure(d,g=>{if(d){if(i=pm(d,f),qi(i,i),r){var h=i.appendChild(Qr());r(i,h)}Qe.nodes.end=i,g.before(i)}}),()=>{}},As),cu(()=>{})}function L_(t,e,n){eo(()=>{var r=na(()=>e(t,n==null?void 0:n())||{});if(r!=null&&r.destroy)return()=>r.destroy()})}function O_(t,e){var n=void 0,r;vm(()=>{n!==(n=e())&&(r&&(En(r),r=null),n&&(r=qn(()=>{eo(()=>n(t))})))})}function Dm(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(n=Dm(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function x_(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Dm(t))&&(r&&(r+=" "),r+=e);return r}function km(t){return typeof t=="object"?x_(t):t??""}const E0=[...`
|
|
3
|
+
\r\f \v\uFEFF`];function R_(t,e,n){var r=t==null?"":""+t;if(e&&(r=r?r+" "+e:e),n){for(var s of Object.keys(n))if(n[s])r=r?r+" "+s:s;else if(r.length)for(var a=s.length,i=0;(i=r.indexOf(s,i))>=0;){var o=i+a;(i===0||E0.includes(r[i-1]))&&(o===r.length||E0.includes(r[o]))?r=(i===0?"":r.substring(0,i))+r.substring(o+1):i=o}}return r===""?null:r}function _0(t,e=!1){var n=e?" !important;":";",r="";for(var s of Object.keys(t)){var a=t[s];a!=null&&a!==""&&(r+=" "+s+": "+a+n)}return r}function Rc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function D_(t,e){if(e){var n="",r,s;if(Array.isArray(e)?(r=e[0],s=e[1]):r=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,i=0,o=!1,l=[];r&&l.push(...Object.keys(r).map(Rc)),s&&l.push(...Object.keys(s).map(Rc));var d=0,f=-1;const T=t.length;for(var g=0;g<T;g++){var h=t[g];if(o?h==="/"&&t[g-1]==="*"&&(o=!1):a?a===h&&(a=!1):h==="/"&&t[g+1]==="*"?o=!0:h==='"'||h==="'"?a=h:h==="("?i++:h===")"&&i--,!o&&a===!1&&i===0){if(h===":"&&f===-1)f=g;else if(h===";"||g===T-1){if(f!==-1){var p=Rc(t.substring(d,f).trim());if(!l.includes(p)){h!==";"&&g++;var v=t.substring(d,g).trim();n+=" "+v+";"}}d=g+1,f=-1}}}}return r&&(n+=_0(r)),s&&(n+=_0(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function Ke(t,e,n,r,s,a){var i=t[pd];if(i!==n||i===void 0){var o=R_(n,r,a);o==null?t.removeAttribute("class"):e?t.className=o:t.setAttribute("class",o),t[pd]=n}else if(a&&s!==a)for(var l in a){var d=!!a[l];(s==null||d!==!!s[l])&&t.classList.toggle(l,d)}return a}function Dc(t,e={},n,r){for(var s in n){var a=n[s];e[s]!==a&&(n[s]==null?t.style.removeProperty(s):t.style.setProperty(s,a,r))}}function Gl(t,e,n,r){var s=t[md];if(s!==e){var a=D_(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[md]=e}else r&&(Array.isArray(r)?(Dc(t,n==null?void 0:n[0],r[0]),Dc(t,n==null?void 0:n[1],r[1],"important")):Dc(t,n,r));return r}function Tl(t,e,n=!1){if(t.multiple){if(e==null)return;if(!jf(e))return yE();for(var r of t.options)r.selected=e.includes(Io(r));return}for(r of t.options){var s=Io(r);if(lm(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function Pm(t){var e=new MutationObserver(()=>{Tl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),cu(()=>{e.disconnect()})}function $a(t,e,n=e){var r=new WeakSet,s=!0;Zf(t,"change",a=>{var i=a?"[selected]":":checked",o;if(t.multiple)o=[].map.call(t.querySelectorAll(i),Io);else{var l=t.querySelector(i)??t.querySelector("option:not([disabled])");o=l&&Io(l)}n(o),t.__value=o,Fe!==null&&r.add(Fe)}),eo(()=>{var a=e();if(t===document.activeElement){var i=Fe;if(r.has(i))return}if(Tl(t,a,s),s&&a===void 0){var o=t.querySelector(":checked");o!==null&&(a=Io(o),n(a))}t.__value=a,s=!1}),Pm(t)}function Io(t){return"__value"in t?t.__value:t.value}const lo=Symbol("class"),co=Symbol("style"),Mm=Symbol("is custom element"),Bm=Symbol("is html"),k_=Wf?"option":"OPTION",P_=Wf?"select":"SELECT",M_=Wf?"progress":"PROGRESS";function B_(t,e){var n=Kl(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==M_)||(t.value=e??"")}function F_(t,e){var n=Kl(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function U_(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function be(t,e,n,r){var s=Kl(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[Qb]=n),n==null?t.removeAttribute(e):typeof n!="string"&&Fm(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function H_(t,e,n,r,s=!1,a=!1){var i=Kl(t),o=i[Mm],l=!i[Bm],d=e||{},f=t.nodeName===k_;for(var g in e)g in n||(n[g]=null);n.class?n.class=km(n.class):n[lo]&&(n.class=null),n[co]&&(n.style??(n.style=null));var h=Fm(t);for(const C in n){let H=n[C];if(f&&C==="value"&&H==null){t.value=t.__value="",d[C]=H;continue}if(C==="class"){var p=t.namespaceURI==="http://www.w3.org/1999/xhtml";Ke(t,p,H,r,e==null?void 0:e[lo],n[lo]),d[C]=H,d[lo]=n[lo];continue}if(C==="style"){Gl(t,H,e==null?void 0:e[co],n[co]),d[C]=H,d[co]=n[co];continue}var v=d[C];if(!(H===v&&!(H===void 0&&t.hasAttribute(C)))){d[C]=H;var T=C[0]+C[1];if(T!=="$$")if(T==="on"){const M={},J="$$"+C;let U=C.slice(2);var _=d_(U);if(l_(U)&&(U=U.slice(0,-7),M.capture=!0),!_&&v){if(H!=null)continue;t.removeEventListener(U,d[J],M),d[J]=null}if(_)ie(U,t,H),Tt([U]);else if(H!=null){let G=function(V){d[C].call(this,V)};d[J]=xm(U,t,G,M)}}else if(C==="style")be(t,C,H);else if(C==="autofocus")ja(t,!!H);else if(!o&&(C==="__value"||C==="value"&&H!=null))t.value=t.__value=H;else if(C==="selected"&&f)U_(t,H);else{var E=C;l||(E=h_(E));var O=E==="defaultValue"||E==="defaultChecked";if(H==null&&!o&&!O)if(i[C]=null,E==="value"||E==="checked"){let M=t;const J=e===void 0;if(E==="value"){let U=M.defaultValue;M.removeAttribute(E),M.defaultValue=U,M.value=M.__value=J?U:null}else{let U=M.defaultChecked;M.removeAttribute(E),M.defaultChecked=U,M.checked=J?U:!1}}else t.removeAttribute(C);else O||h.includes(E)&&(o||typeof H!="string")?(t[E]=H,E in i&&(i[E]=Zt)):typeof H!="function"&&be(t,E,H)}}}return d}function T0(t,e,n=[],r=[],s=[],a,i=!1,o=!1){rm(s,n,r,l=>{var d=void 0,f={},g=t.nodeName===P_,h=!1;if(vm(()=>{var v=e(...l.map(u)),T=H_(t,d,v,a,i,o);h&&g&&"value"in v&&Tl(t,v.value);for(let E of Object.getOwnPropertySymbols(f))v[E]||En(f[E]);for(let E of Object.getOwnPropertySymbols(v)){var _=v[E];E.description===TE&&(!d||_!==d[E])&&(f[E]&&En(f[E]),f[E]=qn(()=>O_(t,()=>_))),T[E]=_}d=T}),g){var p=t;eo(()=>{Tl(p,d.value,!0),Pm(p)})}h=!0})}function Kl(t){return t[el]??(t[el]={[Mm]:t.nodeName.includes("-"),[Bm]:t.namespaceURI===z1})}var A0=new Map;function Fm(t){var e=t.getAttribute("is")||t.nodeName,n=A0.get(e);if(n)return n;A0.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=U1(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=$f(s)}return n}function St(t,e,n=e){var r=new WeakSet;Zf(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=Pc(t)?Mc(a):a,n(a),Fe!==null&&r.add(Fe),await Im(),a!==(a=e())){var i=t.selectionStart,o=t.selectionEnd,l=t.value.length;if(t.value=a??"",o!==null){var d=t.value.length;i===o&&o===l&&d>l?(t.selectionStart=d,t.selectionEnd=d):(t.selectionStart=i,t.selectionEnd=Math.min(o,d))}}}),na(e)==null&&t.value&&(n(Pc(t)?Mc(t.value):t.value),Fe!==null&&r.add(Fe)),Wl(()=>{var s=e();if(t===document.activeElement){var a=Fe;if(r.has(a))return}Pc(t)&&s===Mc(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const kc=new Set;function q_(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var o of e)i=i[o]??(i[o]=[]);i.push(n),Zf(n,"change",()=>{var l=n.__value;a&&(l=j_(i,l,n.checked)),s(l)},()=>s(a?[]:null)),Wl(()=>{var l=r();a?(l=l||[],n.checked=l.includes(n.__value)):n.checked=lm(n.__value,l)}),cu(()=>{var l=i.indexOf(n);l!==-1&&i.splice(l,1)}),kc.has(i)||(kc.add(i),xr(()=>{i.sort((l,d)=>l.compareDocumentPosition(d)===4?-1:1),kc.delete(i)})),xr(()=>{})}function j_(t,e,n){for(var r=new Set,s=0;s<t.length;s+=1)t[s].checked&&r.add(t[s].__value);return n||r.delete(e),Array.from(r)}function Pc(t){var e=t.type;return e==="number"||e==="range"}function Mc(t){return t===""?null:+t}var js,ki,ou,ql,Um;const jl=class jl{constructor(e){je(this,ql);je(this,js,new WeakMap);je(this,ki);je(this,ou);$e(this,ou,e)}observe(e,n){var r=X(this,js).get(e)||new Set;return r.add(n),X(this,js).set(e,r),nt(this,ql,Um).call(this).observe(e,X(this,ou)),()=>{var s=X(this,js).get(e);s.delete(n),s.size===0&&(X(this,js).delete(e),X(this,ki).unobserve(e))}}};js=new WeakMap,ki=new WeakMap,ou=new WeakMap,ql=new WeakSet,Um=function(){return X(this,ki)??$e(this,ki,new ResizeObserver(e=>{for(var n of e){jl.entries.set(n.target,n);for(var r of X(this,js).get(n.target)||[])r(n)}}))},ye(jl,"entries",new WeakMap);let Cd=jl;var $_=new Cd({box:"border-box"});function Y_(t,e,n){var r=$_.observe(t,()=>n(t[e]));eo(()=>(na(()=>n(t[e])),r))}function Bc(t,e){return t===e||(t==null?void 0:t[Xr])===e}function mn(t={},e,n,r){var s=Ct.r,a=Qe;return eo(()=>{var i,o;return Wl(()=>{i=o,o=[],na(()=>{Bc(n(...o),t)||(e(t,...o),i&&Bc(n(...i),t)&&e(null,...i))})}),()=>{let l=a;for(;l!==s&&l.parent!==null&&l.parent.f&hd;)l=l.parent;const d=()=>{o&&Bc(n(...o),t)&&e(null,...o)},f=l.teardown;l.teardown=()=>{d(),f==null||f()}}}),t}function Hm(t=!1){const e=Ct,n=e.l.u;if(!n)return;let r=()=>u_(e.s);if(t){let s=0,a={};const i=Bi(()=>{let o=!1;const l=e.s;for(const d in l)l[d]!==a[d]&&(a[d]=l[d],o=!0);return o&&s++,s});r=()=>u(i)}n.b.length&&t_(()=>{y0(e,r),dd(n.b)}),Rt(()=>{const s=na(()=>n.m.map(Kb));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&Rt(()=>{y0(e,r),dd(n.a)})}function y0(t,e){if(t.l.s)for(const n of t.l.s)u(n);e()}const z_={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function Jt(t,e,n){return new Proxy({props:t,exclude:e},z_)}const W_={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(oo(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r)return r[e]}},set(t,e,n){let r=t.props.length;for(;r--;){let s=t.props[r];oo(s)&&(s=s());const a=Vs(s,e);if(a&&a.set)return a.set(n),!0}return!1},getOwnPropertyDescriptor(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(oo(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=Vs(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===Xr||e===j1)return!1;for(let n of t.props)if(oo(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(oo(n)&&(n=n()),!!n){for(const r in n)e.includes(r)||e.push(r);for(const r of Object.getOwnPropertySymbols(n))e.includes(r)||e.push(r)}return e}};function on(...t){return new Proxy({props:t},W_)}function Vn(t,e,n,r){var H;var s=!Zi||(n&pE)!==0,a=(n&gE)!==0,i=(n&vE)!==0,o=r,l=!0,d=void 0,f=()=>i&&s?(d??(d=Bi(r)),u(d)):(l&&(l=!1,o=i?na(r):r),o);let g;if(a){var h=Xr in t||j1 in t;g=((H=Vs(t,e))==null?void 0:H.set)??(h&&e in t?M=>t[e]=M:void 0)}var p,v=!1;a?[p,v]=DE(()=>t[e]):p=t[e],p===void 0&&r!==void 0&&(p=f(),g&&(s&&sE(),g(p)));var T;if(s?T=()=>{var M=t[e];return M===void 0?f():(l=!0,M)}:T=()=>{var M=t[e];return M!==void 0&&(o=void 0),M===void 0?o:M},s&&(n&mE)===0)return T;if(g){var _=t.$$legacy;return(function(M,J){return arguments.length>0?((!s||!J||_||v)&&g(J?T():M),M):T()})}var E=!1,O=((n&hE)!==0?Bi:Xf)(()=>(E=!1,T()));a&&u(O);var C=Qe;return(function(M,J){if(arguments.length>0){const U=J?u(O):s&&a?ct(M):M;return A(O,U),E=!0,o!==void 0&&(o=U),M}return ys&&E||(C.f&gr)!==0?O.v:u(O)})}function Qa(t){Ct===null&&$1(),Zi&&Ct.l!==null?G_(Ct).m.push(t):Rt(()=>{const e=na(t);if(typeof e=="function")return e})}function G_(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const K_="5";var B1;typeof window<"u"&&((B1=window.__svelte??(window.__svelte={})).v??(B1.v=new Set)).add(K_);IE();function Es(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function rh(t){const e=t.replace(/[_-]+/g," ").replace(/([a-z0-9])([A-Z])/g,"$1 $2").trim().replace(/\s+/g," ");return e.length===0?"":e.charAt(0).toUpperCase()+e.slice(1)}const V_={html:"text/html; charset=utf-8",json:"application/json; charset=utf-8",js:"text/javascript; charset=utf-8",mjs:"text/javascript; charset=utf-8",css:"text/css; charset=utf-8",txt:"text/plain; charset=utf-8",xml:"application/xml; charset=utf-8",svg:"image/svg+xml",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp",avif:"image/avif",gif:"image/gif",ico:"image/x-icon",woff:"font/woff",woff2:"font/woff2",map:"application/json; charset=utf-8"};function X_(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return V_[e]??"application/octet-stream"}class ya extends Error{constructor(e){super(e),this.name="ContentParseError"}}const Q_=new Set(["template","title","isPublished","fields","created","published","updated"]);function Ld(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Od(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function Z_(t){return Ld(t)&&Object.values(t).every(Od)}function J_(t,e){if(Od(e))return e;if(Array.isArray(e)){if(e.every(Od)||e.every(Z_))return e;throw new ya(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new ya(`Field "${t}" must be a primitive or an array, not a bare object.`)}function Ru(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new ya(`"${e}" must be a string when present.`);return n}}function Vl(t){return qm(t).item}function qm(t){if(!Ld(t))throw new ya("A content item must be a JSON object.");if(typeof t.title!="string")throw new ya('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new ya(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!Ld(t.fields))throw new ya('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([d,f])=>[d,J_(d,f)]))}const r=Ru(t,"template"),s=Ru(t,"created"),a=Ru(t,"published"),i=Ru(t,"updated"),o=Object.keys(t).filter(d=>!Q_.has(d)).sort();return{item:{title:t.title,isPublished:e,fields:n,...r!==void 0&&{template:r},...s!==void 0&&{created:s},...a!==void 0&&{published:a},...i!==void 0&&{updated:i}},diagnostics:{unknownTopLevelKeys:o}}}function N0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function jm(t){if(!N0(t))return{order:[]};const e=Array.isArray(t.order)?t.order.filter(a=>typeof a=="string"):[],n=typeof t.name=="string"?t.name:void 0,r=typeof t.defaultTemplate=="string"?t.defaultTemplate:void 0,s=N0(t.collection)?{recursive:t.collection.recursive===!0}:void 0;return{order:e,...n!==void 0&&{name:n},...r!==void 0&&{defaultTemplate:r},...s!==void 0&&{collection:s}}}const $m="_sort.json",eT="_redirects.json",tT="_site.json",nT="assets",S0=".json",rt={content:"content",templates:"templates",components:"components",public:"public"};function Zr(...t){return t.filter(e=>e!=="").join("/")}async function sh(t,e=rt.content){return Ym(t,e,"","")}async function Ym(t,e,n,r){const[s,a]=await Promise.all([t.list(e),sT(t,e)]),i=new Map;for(const l of s)if(l.kind==="file"){if(l.name===$m||l.name===eT||l.name===tT||!l.name.endsWith(S0))continue;const d=l.name.slice(0,-S0.length);i.set(d,await rT(t,Zr(e,l.name),d,r))}else{if(l.name===nT)continue;const d=Zr(r,l.name);i.set(l.name,await Ym(t,Zr(e,l.name),l.name,d))}const o=a.name??(n===""?"":rh(n));return{kind:"dir",slug:n,name:o,path:r,children:aT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function rT(t,e,n,r){const s=await t.readText(e);try{const{item:a,diagnostics:i}=qm(JSON.parse(s));return{kind:"item",slug:n,path:Zr(r,n),item:a,...i.unknownTopLevelKeys.length>0&&{parseDiagnostics:i}}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function sT(t,e){const n=Zr(e,$m);if(!await t.exists(n))return{order:[]};try{return jm(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function aT(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}function ah(t,e=rt.components){return ih(t,e,"html")}function zm(t,e=rt.components){return ih(t,e,"css")}function Wm(t,e=rt.components){return ih(t,e,"js")}async function ih(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const o of await t.list(i)){const l=Zr(i,o.name);if(o.kind==="dir")await a(l);else if(o.name.endsWith(r)){const d=o.name.slice(0,-r.length).toLowerCase();s.set(d,await t.readText(l))}}};return await a(e),s}async function Al(t,e,n=rt.templates){return t.readText(Zr(n,`${e}.html`))}function iT(t,e,n=rt.templates){return uh(t,Zr(n,`${e}.css`))}function oT(t,e,n=rt.templates){return uh(t,Zr(n,`${e}.js`))}const hu="document";function oh(t,e=rt.templates){return uh(t,Zr(e,`${hu}.html`))}async function uh(t,e){try{return await t.readText(e)}catch{return}}const uT=new Set([65534,65535,131070,131071,196606,196607,262142,262143,327678,327679,393214,393215,458750,458751,524286,524287,589822,589823,655358,655359,720894,720895,786430,786431,851966,851967,917502,917503,983038,983039,1048574,1048575,1114110,1114111]),Ht="�";var w;(function(t){t[t.EOF=-1]="EOF",t[t.NULL=0]="NULL",t[t.TABULATION=9]="TABULATION",t[t.CARRIAGE_RETURN=13]="CARRIAGE_RETURN",t[t.LINE_FEED=10]="LINE_FEED",t[t.FORM_FEED=12]="FORM_FEED",t[t.SPACE=32]="SPACE",t[t.EXCLAMATION_MARK=33]="EXCLAMATION_MARK",t[t.QUOTATION_MARK=34]="QUOTATION_MARK",t[t.AMPERSAND=38]="AMPERSAND",t[t.APOSTROPHE=39]="APOSTROPHE",t[t.HYPHEN_MINUS=45]="HYPHEN_MINUS",t[t.SOLIDUS=47]="SOLIDUS",t[t.DIGIT_0=48]="DIGIT_0",t[t.DIGIT_9=57]="DIGIT_9",t[t.SEMICOLON=59]="SEMICOLON",t[t.LESS_THAN_SIGN=60]="LESS_THAN_SIGN",t[t.EQUALS_SIGN=61]="EQUALS_SIGN",t[t.GREATER_THAN_SIGN=62]="GREATER_THAN_SIGN",t[t.QUESTION_MARK=63]="QUESTION_MARK",t[t.LATIN_CAPITAL_A=65]="LATIN_CAPITAL_A",t[t.LATIN_CAPITAL_Z=90]="LATIN_CAPITAL_Z",t[t.RIGHT_SQUARE_BRACKET=93]="RIGHT_SQUARE_BRACKET",t[t.GRAVE_ACCENT=96]="GRAVE_ACCENT",t[t.LATIN_SMALL_A=97]="LATIN_SMALL_A",t[t.LATIN_SMALL_Z=122]="LATIN_SMALL_Z"})(w||(w={}));const Bn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function Gm(t){return t>=55296&&t<=57343}function lT(t){return t>=56320&&t<=57343}function cT(t,e){return(t-55296)*1024+9216+e}function Km(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function Vm(t){return t>=64976&&t<=65007||uT.has(t)}var ne;(function(t){t.controlCharacterInInputStream="control-character-in-input-stream",t.noncharacterInInputStream="noncharacter-in-input-stream",t.surrogateInInputStream="surrogate-in-input-stream",t.nonVoidHtmlElementStartTagWithTrailingSolidus="non-void-html-element-start-tag-with-trailing-solidus",t.endTagWithAttributes="end-tag-with-attributes",t.endTagWithTrailingSolidus="end-tag-with-trailing-solidus",t.unexpectedSolidusInTag="unexpected-solidus-in-tag",t.unexpectedNullCharacter="unexpected-null-character",t.unexpectedQuestionMarkInsteadOfTagName="unexpected-question-mark-instead-of-tag-name",t.invalidFirstCharacterOfTagName="invalid-first-character-of-tag-name",t.unexpectedEqualsSignBeforeAttributeName="unexpected-equals-sign-before-attribute-name",t.missingEndTagName="missing-end-tag-name",t.unexpectedCharacterInAttributeName="unexpected-character-in-attribute-name",t.unknownNamedCharacterReference="unknown-named-character-reference",t.missingSemicolonAfterCharacterReference="missing-semicolon-after-character-reference",t.unexpectedCharacterAfterDoctypeSystemIdentifier="unexpected-character-after-doctype-system-identifier",t.unexpectedCharacterInUnquotedAttributeValue="unexpected-character-in-unquoted-attribute-value",t.eofBeforeTagName="eof-before-tag-name",t.eofInTag="eof-in-tag",t.missingAttributeValue="missing-attribute-value",t.missingWhitespaceBetweenAttributes="missing-whitespace-between-attributes",t.missingWhitespaceAfterDoctypePublicKeyword="missing-whitespace-after-doctype-public-keyword",t.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers="missing-whitespace-between-doctype-public-and-system-identifiers",t.missingWhitespaceAfterDoctypeSystemKeyword="missing-whitespace-after-doctype-system-keyword",t.missingQuoteBeforeDoctypePublicIdentifier="missing-quote-before-doctype-public-identifier",t.missingQuoteBeforeDoctypeSystemIdentifier="missing-quote-before-doctype-system-identifier",t.missingDoctypePublicIdentifier="missing-doctype-public-identifier",t.missingDoctypeSystemIdentifier="missing-doctype-system-identifier",t.abruptDoctypePublicIdentifier="abrupt-doctype-public-identifier",t.abruptDoctypeSystemIdentifier="abrupt-doctype-system-identifier",t.cdataInHtmlContent="cdata-in-html-content",t.incorrectlyOpenedComment="incorrectly-opened-comment",t.eofInScriptHtmlCommentLikeText="eof-in-script-html-comment-like-text",t.eofInDoctype="eof-in-doctype",t.nestedComment="nested-comment",t.abruptClosingOfEmptyComment="abrupt-closing-of-empty-comment",t.eofInComment="eof-in-comment",t.incorrectlyClosedComment="incorrectly-closed-comment",t.eofInCdata="eof-in-cdata",t.absenceOfDigitsInNumericCharacterReference="absence-of-digits-in-numeric-character-reference",t.nullCharacterReference="null-character-reference",t.surrogateCharacterReference="surrogate-character-reference",t.characterReferenceOutsideUnicodeRange="character-reference-outside-unicode-range",t.controlCharacterReference="control-character-reference",t.noncharacterCharacterReference="noncharacter-character-reference",t.missingWhitespaceBeforeDoctypeName="missing-whitespace-before-doctype-name",t.missingDoctypeName="missing-doctype-name",t.invalidCharacterSequenceAfterDoctypeName="invalid-character-sequence-after-doctype-name",t.duplicateAttribute="duplicate-attribute",t.nonConformingDoctype="non-conforming-doctype",t.missingDoctype="missing-doctype",t.misplacedDoctype="misplaced-doctype",t.endTagWithoutMatchingOpenElement="end-tag-without-matching-open-element",t.closingOfElementWithOpenChildElements="closing-of-element-with-open-child-elements",t.disallowedContentInNoscriptInHead="disallowed-content-in-noscript-in-head",t.openElementsLeftAfterEof="open-elements-left-after-eof",t.abandonedHeadElementChild="abandoned-head-element-child",t.misplacedStartTagForHeadElement="misplaced-start-tag-for-head-element",t.nestedNoscriptInHead="nested-noscript-in-head",t.eofInElementThatCanContainOnlyText="eof-in-element-that-can-contain-only-text"})(ne||(ne={}));const dT=65536;class fT{constructor(e){this.handler=e,this.html="",this.pos=-1,this.lastGapPos=-2,this.gapStack=[],this.skipNextNewLine=!1,this.lastChunkWritten=!1,this.endOfChunkHit=!1,this.bufferWaterline=dT,this.isEol=!1,this.lineStartPos=0,this.droppedBufferSize=0,this.line=1,this.lastErrOffset=-1}get col(){return this.pos-this.lineStartPos+ +(this.lastGapPos!==this.pos)}get offset(){return this.droppedBufferSize+this.pos}getError(e,n){const{line:r,col:s,offset:a}=this,i=s+n,o=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:o,endOffset:o}}_err(e){this.handler.onParseError&&this.lastErrOffset!==this.offset&&(this.lastErrOffset=this.offset,this.handler.onParseError(this.getError(e,0)))}_addGap(){this.gapStack.push(this.lastGapPos),this.lastGapPos=this.pos}_processSurrogate(e){if(this.pos!==this.html.length-1){const n=this.html.charCodeAt(this.pos+1);if(lT(n))return this.pos++,this._addGap(),cT(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,w.EOF;return this._err(ne.surrogateInInputStream),e}willDropParsedChunk(){return this.pos>this.bufferWaterline}dropParsedChunk(){this.willDropParsedChunk()&&(this.html=this.html.substring(this.pos),this.lineStartPos-=this.pos,this.droppedBufferSize+=this.pos,this.pos=0,this.lastGapPos=-2,this.gapStack.length=0)}write(e,n){this.html.length>0?this.html+=e:this.html=e,this.endOfChunkHit=!1,this.lastChunkWritten=n}insertHtmlAtCurrentPos(e){this.html=this.html.substring(0,this.pos+1)+e+this.html.substring(this.pos+1),this.endOfChunkHit=!1}startsWith(e,n){if(this.pos+e.length>this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,!1;if(n)return this.html.startsWith(e,this.pos);for(let r=0;r<e.length;r++)if((this.html.charCodeAt(this.pos+r)|32)!==e.charCodeAt(r))return!1;return!0}peek(e){const n=this.pos+e;if(n>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,w.EOF;const r=this.html.charCodeAt(n);return r===w.CARRIAGE_RETURN?w.LINE_FEED:r}advance(){if(this.pos++,this.isEol&&(this.isEol=!1,this.line++,this.lineStartPos=this.pos),this.pos>=this.html.length)return this.endOfChunkHit=!this.lastChunkWritten,w.EOF;let e=this.html.charCodeAt(this.pos);return e===w.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,w.LINE_FEED):e===w.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,Gm(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===w.LINE_FEED||e===w.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){Km(e)?this._err(ne.controlCharacterInInputStream):Vm(e)&&this._err(ne.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var lt;(function(t){t[t.CHARACTER=0]="CHARACTER",t[t.NULL_CHARACTER=1]="NULL_CHARACTER",t[t.WHITESPACE_CHARACTER=2]="WHITESPACE_CHARACTER",t[t.START_TAG=3]="START_TAG",t[t.END_TAG=4]="END_TAG",t[t.COMMENT=5]="COMMENT",t[t.DOCTYPE=6]="DOCTYPE",t[t.EOF=7]="EOF",t[t.HIBERNATION=8]="HIBERNATION"})(lt||(lt={}));function Xm(t,e){for(let n=t.attrs.length-1;n>=0;n--)if(t.attrs[n].name===e)return t.attrs[n].value;return null}const hT=new Uint16Array('ᵁ<Õıʊҝջאٵ۞ޢߖࠏઑඡ༉༦ረዡᐕᒝᓃᓟᔥ\0\0\0\0\0\0ᕫᛍᦍᰒᷝ↰⊍⏀⏻⑂⠤⤒ⴈ⹈⿎〖㊺㘹㞬㣾㨨㩱㫠㬮ࠀEMabcfglmnoprstu\\bfms¦³¹ÈÏlig耻Æ䃆P耻&䀦cute耻Á䃁reve;䄂Āiyx}rc耻Â䃂;䐐r;쀀𝔄rave耻À䃀pha;䎑acr;䄀d;橓Āgp¡on;䄄f;쀀𝔸plyFunction;恡ing耻Å䃅Ācs¾Ãr;쀀𝒜ign;扔ilde耻Ã䃃ml耻Ä䃄ЀaceforsuåûþėĜĢħĪĀcrêòkslash;或Ŷöø;櫧ed;挆y;䐑ƀcrtąċĔause;戵noullis;愬a;䎒r;쀀𝔅pf;쀀𝔹eve;䋘còēmpeq;扎܀HOacdefhilorsuōőŖƀƞƢƵƷƺǜȕɳɸɾcy;䐧PY耻©䂩ƀcpyŝŢźute;䄆Ā;iŧŨ拒talDifferentialD;慅leys;愭ȀaeioƉƎƔƘron;䄌dil耻Ç䃇rc;䄈nint;戰ot;䄊ĀdnƧƭilla;䂸terDot;䂷òſi;䎧rcleȀDMPTLJNjǑǖot;抙inus;抖lus;投imes;抗oĀcsǢǸkwiseContourIntegral;戲eCurlyĀDQȃȏoubleQuote;思uote;怙ȀlnpuȞȨɇɕonĀ;eȥȦ户;橴ƀgitȯȶȺruent;扡nt;戯ourIntegral;戮ĀfrɌɎ;愂oduct;成nterClockwiseContourIntegral;戳oss;樯cr;쀀𝒞pĀ;Cʄʅ拓ap;才րDJSZacefiosʠʬʰʴʸˋ˗ˡ˦̳ҍĀ;oŹʥtrahd;椑cy;䐂cy;䐅cy;䐏ƀgrsʿ˄ˇger;怡r;憡hv;櫤Āayː˕ron;䄎;䐔lĀ;t˝˞戇a;䎔r;쀀𝔇Āaf˫̧Ācm˰̢riticalȀADGT̖̜̀̆cute;䂴oŴ̋̍;䋙bleAcute;䋝rave;䁠ilde;䋜ond;拄ferentialD;慆Ѱ̽\0\0\0͔͂\0Ѕf;쀀𝔻ƀ;DE͈͉͍䂨ot;惜qual;扐blèCDLRUVͣͲϏϢϸontourIntegraìȹoɴ\0\0ͻ»͉nArrow;懓Āeo·ΤftƀARTΐΖΡrrow;懐ightArrow;懔eåˊngĀLRΫτeftĀARγιrrow;柸ightArrow;柺ightArrow;柹ightĀATϘϞrrow;懒ee;抨pɁϩ\0\0ϯrrow;懑ownArrow;懕erticalBar;戥ǹABLRTaВЪаўѿͼrrowƀ;BUНОТ憓ar;椓pArrow;懵reve;䌑eft˒к\0ц\0ѐightVector;楐eeVector;楞ectorĀ;Bљњ憽ar;楖ightǔѧ\0ѱeeVector;楟ectorĀ;BѺѻ懁ar;楗eeĀ;A҆҇护rrow;憧ĀctҒҗr;쀀𝒟rok;䄐ࠀNTacdfglmopqstuxҽӀӄӋӞӢӧӮӵԡԯԶՒ՝ՠեG;䅊H耻Ð䃐cute耻É䃉ƀaiyӒӗӜron;䄚rc耻Ê䃊;䐭ot;䄖r;쀀𝔈rave耻È䃈ement;戈ĀapӺӾcr;䄒tyɓԆ\0\0ԒmallSquare;旻erySmallSquare;斫ĀgpԦԪon;䄘f;쀀𝔼silon;䎕uĀaiԼՉlĀ;TՂՃ橵ilde;扂librium;懌Āci՚r;愰m;橳a;䎗ml耻Ë䃋Āipժկsts;戃onentialE;慇ʀcfiosօֈ֍ֲy;䐤r;쀀𝔉lledɓ֗\0\0֣mallSquare;旼erySmallSquare;斪Ͱֺ\0ֿ\0\0ׄf;쀀𝔽All;戀riertrf;愱còJTabcdfgorstרׯؒؖ؛؝أ٬ٲcy;䐃耻>䀾mmaĀ;d䎓;䏜reve;䄞ƀeiy؇،ؐdil;䄢rc;䄜;䐓ot;䄠r;쀀𝔊;拙pf;쀀𝔾eater̀EFGLSTصلَٖٛ٦qualĀ;Lؾؿ扥ess;招ullEqual;执reater;檢ess;扷lantEqual;橾ilde;扳cr;쀀𝒢;扫ЀAacfiosuڅڋږڛڞڪھۊRDcy;䐪Āctڐڔek;䋇;䁞irc;䄤r;愌lbertSpace;愋ǰگ\0ڲf;愍izontalLine;攀Āctۃۅòکrok;䄦mpńېۘownHumðįqual;扏܀EJOacdfgmnostuۺ۾܃܇ܚܞܡܨ݄ݸދޏޕcy;䐕lig;䄲cy;䐁cute耻Í䃍Āiyܓܘrc耻Î䃎;䐘ot;䄰r;愑rave耻Ì䃌ƀ;apܠܯܿĀcgܴܷr;䄪inaryI;慈lieóϝǴ݉\0ݢĀ;eݍݎ戬Āgrݓݘral;戫section;拂isibleĀCTݬݲomma;恣imes;恢ƀgptݿރވon;䄮f;쀀𝕀a;䎙cr;愐ilde;䄨ǫޚ\0ޞcy;䐆l耻Ï䃏ʀcfosuެ߂ߐĀiyޱrc;䄴;䐙r;쀀𝔍pf;쀀𝕁ǣ߇\0ߌr;쀀𝒥rcy;䐈kcy;䐄HJacfosߤߨ߽߬߱ࠂࠈcy;䐥cy;䐌ppa;䎚Āey߶dil;䄶;䐚r;쀀𝔎pf;쀀𝕂cr;쀀𝒦րJTaceflmostࠥࠩࠬࡐࡣসে্ੇcy;䐉耻<䀼ʀcmnpr࠷࠼ࡁࡄࡍute;䄹bda;䎛g;柪lacetrf;愒r;憞ƀaeyࡗࡡron;䄽dil;䄻;䐛Āfsࡨ॰tԀACDFRTUVarࡾࢩࢱࣦ࣠ࣼयज़ΐ४ĀnrࢃgleBracket;柨rowƀ;BR࢙࢚࢞憐ar;懤ightArrow;懆eiling;挈oǵࢷ\0ࣃbleBracket;柦nǔࣈ\0࣒eeVector;楡ectorĀ;Bࣛࣜ懃ar;楙loor;挊ightĀAV࣯ࣵrrow;憔ector;楎Āerँगeƀ;AVउऊऐ抣rrow;憤ector;楚iangleƀ;BEतथऩ抲ar;槏qual;抴pƀDTVषूौownVector;楑eeVector;楠ectorĀ;Bॖॗ憿ar;楘ectorĀ;B॥०憼ar;楒ightáΜs̀EFGLSTॾঋকঝঢভqualGreater;拚ullEqual;扦reater;扶ess;檡lantEqual;橽ilde;扲r;쀀𝔏Ā;eঽা拘ftarrow;懚idot;䄿ƀnpwਖਛgȀLRlr৷ਂਐeftĀAR০৬rrow;柵ightArrow;柷ightArrow;柶eftĀarγਊightáοightáϊf;쀀𝕃erĀLRਢਬeftArrow;憙ightArrow;憘ƀchtਾੀੂòࡌ;憰rok;䅁;扪Ѐacefiosuਗ਼અઋp;椅y;䐜Ādl੯iumSpace;恟lintrf;愳r;쀀𝔐nusPlus;戓pf;쀀𝕄cò੶;䎜ҀJacefostuણધભીଔଙඑඞcy;䐊cute;䅃ƀaeyહાron;䅇dil;䅅;䐝ƀgswે૰ativeƀMTV૨ediumSpace;怋hiĀcn૦ëeryThiîtedĀGLଆreaterGreateòٳessLesóੈLine;䀊r;쀀𝔑ȀBnptଢନଷreak;恠BreakingSpace;䂠f;愕ڀ;CDEGHLNPRSTV୕ୖ୪௫ఄ಄ದൡඅ櫬Āoungruent;扢pCap;扭oubleVerticalBar;戦ƀlqxஃஊement;戉ualĀ;Tஒஓ扠ilde;쀀≂̸ists;戄reater;EFGLSTஶஷ扯qual;扱ullEqual;쀀≧̸reater;쀀≫̸ess;批lantEqual;쀀⩾̸ilde;扵umpń௲ownHump;쀀≎̸qual;쀀≏̸eĀfsఊధtTriangleƀ;BEచఛడ拪ar;쀀⧏̸qual;括s̀;EGLSTవశ఼ౄోౘ扮qual;扰reater;扸ess;쀀≪̸lantEqual;쀀⩽̸ilde;扴estedĀGL౨౹reaterGreater;쀀⪢̸essLess;쀀⪡̸recedesƀ;ESಒಓಛ技qual;쀀⪯̸lantEqual;拠ĀeiಫಹverseElement;戌ghtTriangleƀ;BEೋೌ拫ar;쀀⧐̸qual;拭ĀquೝഌuareSuĀbp೨setĀ;Eೳ쀀⊏̸qual;拢ersetĀ;Eഃആ쀀⊐̸qual;拣ƀbcpഓതൎsetĀ;Eഛഞ쀀⊂⃒qual;抈ceedsȀ;ESTലള഻െ抁qual;쀀⪰̸lantEqual;拡ilde;쀀≿̸ersetĀ;E൘൛쀀⊃⃒qual;抉ildeȀ;EFT൮൯൵ൿ扁qual;扄ullEqual;扇ilde;扉erticalBar;戤cr;쀀𝒩ilde耻Ñ䃑;䎝܀Eacdfgmoprstuvලෂෛ෧ขภยา฿ไlig;䅒cute耻Ó䃓Āiyීrc耻Ô䃔;䐞blac;䅐r;쀀𝔒rave耻Ò䃒ƀaei෮ෲcr;䅌ga;䎩cron;䎟pf;쀀𝕆enCurlyĀDQฎบoubleQuote;怜uote;怘;橔Āclวฬr;쀀𝒪ash耻Ø䃘iŬืde耻Õ䃕es;樷ml耻Ö䃖erĀBP๋Āar๐๓r;怾acĀek๚;揞et;掴arenthesis;揜ҀacfhilorsງຊຏຒດຝະrtialD;戂y;䐟r;쀀𝔓i;䎦;䎠usMinus;䂱Āipຢອncareplanåڝf;愙Ȁ;eio຺ູ檻cedesȀ;EST່້扺qual;檯lantEqual;扼ilde;找me;怳Ādpuct;戏ortionĀ;aȥl;戝Āci༁༆r;쀀𝒫;䎨ȀUfos༑༖༛༟OT耻"䀢r;쀀𝔔pf;愚cr;쀀𝒬BEacefhiorsu༾གྷཇའཱིྦྷྪྭ႖ႩႴႾarr;椐G耻®䂮ƀcnrཎནབute;䅔g;柫rĀ;tཛྷཝ憠l;椖ƀaeyཧཬཱron;䅘dil;䅖;䐠Ā;vླྀཹ愜erseĀEUྂྙĀlq྇ྎement;戋uilibrium;懋pEquilibrium;楯r»ཹo;䎡ghtЀACDFTUVa࿁ဢဨၛႇϘĀnr࿆࿒gleBracket;柩rowƀ;BL憒ar;懥eftArrow;懄eiling;按oǵ\0စbleBracket;柧nǔည\0နeeVector;楝ectorĀ;Bဝသ懂ar;楕loor;挋Āerိ၃eƀ;AVဵံြ抢rrow;憦ector;楛iangleƀ;BEၐၑၕ抳ar;槐qual;抵pƀDTVၣၮၸownVector;楏eeVector;楜ectorĀ;Bႂႃ憾ar;楔ectorĀ;B႑႒懀ar;楓Āpuႛ႞f;愝ndImplies;楰ightarrow;懛ĀchႹႼr;愛;憱leDelayed;槴ڀHOacfhimoqstuფჱჷჽᄙᄞᅑᅖᅡᅧᆵᆻᆿĀCcჩხHcy;䐩y;䐨FTcy;䐬cute;䅚ʀ;aeiyᄈᄉᄎᄓᄗ檼ron;䅠dil;䅞rc;䅜;䐡r;쀀𝔖ortȀDLRUᄪᄴᄾᅉownArrow»ОeftArrow»࢚ightArrow»pArrow;憑gma;䎣allCircle;战pf;쀀𝕊ɲᅭ\0\0ᅰt;戚areȀ;ISUᅻᅼᆉᆯ斡ntersection;抓uĀbpᆏᆞsetĀ;Eᆗᆘ抏qual;抑ersetĀ;Eᆨᆩ抐qual;抒nion;抔cr;쀀𝒮ar;拆ȀbcmpᇈᇛሉላĀ;sᇍᇎ拐etĀ;Eᇍᇕqual;抆ĀchᇠህeedsȀ;ESTᇭᇮᇴᇿ扻qual;檰lantEqual;扽ilde;承Tháྌ;我ƀ;esሒሓሣ拑rsetĀ;Eሜም抃qual;抇et»ሓրHRSacfhiorsሾቄቕቱቶኟዂወዑORN耻Þ䃞ADE;愢ĀHcቒcy;䐋y;䐦Ābuቚቜ;䀉;䎤ƀaeyብቪቯron;䅤dil;䅢;䐢r;쀀𝔗ĀeiቻDzኀ\0ኇefore;戴a;䎘ĀcnኘkSpace;쀀 Space;怉ldeȀ;EFTካኬኲኼ戼qual;扃ullEqual;扅ilde;扈pf;쀀𝕋ipleDot;惛Āctዖዛr;쀀𝒯rok;䅦ૡዷጎጚጦ\0ጬጱ\0\0\0\0\0ጸጽ፷ᎅ\0ᐄᐊᐐĀcrዻጁute耻Ú䃚rĀ;oጇገ憟cir;楉rǣጓ\0y;䐎ve;䅬Āiyጞጣrc耻Û䃛;䐣blac;䅰r;쀀𝔘rave耻Ù䃙acr;䅪Ādiፁ፩erĀBPፈ፝Āarፍፐr;䁟acĀekፗፙ;揟et;掵arenthesis;揝onĀ;P፰፱拃lus;抎Āgp፻on;䅲f;쀀𝕌ЀADETadps᎕ᎮᎸᏄϨᏒᏗᏳrrowƀ;BDᅐᎠᎤar;椒ownArrow;懅ownArrow;憕quilibrium;楮eeĀ;AᏋᏌ报rrow;憥ownáϳerĀLRᏞᏨeftArrow;憖ightArrow;憗iĀ;lᏹᏺ䏒on;䎥ing;䅮cr;쀀𝒰ilde;䅨ml耻Ü䃜ҀDbcdefosvᐧᐬᐰᐳᐾᒅᒊᒐᒖash;披ar;櫫y;䐒ashĀ;lᐻᐼ抩;櫦Āerᑃᑅ;拁ƀbtyᑌᑐᑺar;怖Ā;iᑏᑕcalȀBLSTᑡᑥᑪᑴar;戣ine;䁼eparator;杘ilde;所ThinSpace;怊r;쀀𝔙pf;쀀𝕍cr;쀀𝒱dash;抪ʀcefosᒧᒬᒱᒶᒼirc;䅴dge;拀r;쀀𝔚pf;쀀𝕎cr;쀀𝒲Ȁfiosᓋᓐᓒᓘr;쀀𝔛;䎞pf;쀀𝕏cr;쀀𝒳ҀAIUacfosuᓱᓵᓹᓽᔄᔏᔔᔚᔠcy;䐯cy;䐇cy;䐮cute耻Ý䃝Āiyᔉᔍrc;䅶;䐫r;쀀𝔜pf;쀀𝕐cr;쀀𝒴ml;䅸ЀHacdefosᔵᔹᔿᕋᕏᕝᕠᕤcy;䐖cute;䅹Āayᕄᕉron;䅽;䐗ot;䅻Dzᕔ\0ᕛoWidtèa;䎖r;愨pf;愤cr;쀀𝒵ᖃᖊᖐ\0ᖰᖶᖿ\0\0\0\0ᗆᗛᗫᙟ᙭\0ᚕ᚛ᚲᚹ\0ᚾcute耻á䃡reve;䄃̀;Ediuyᖜᖝᖡᖣᖨᖭ戾;쀀∾̳;房rc耻â䃢te肻´̆;䐰lig耻æ䃦Ā;r²ᖺ;쀀𝔞rave耻à䃠ĀepᗊᗖĀfpᗏᗔsym;愵èᗓha;䎱ĀapᗟcĀclᗤᗧr;䄁g;樿ɤᗰ\0\0ᘊʀ;adsvᗺᗻᗿᘁᘇ戧nd;橕;橜lope;橘;橚;elmrszᘘᘙᘛᘞᘿᙏᙙ戠;榤e»ᘙsdĀ;aᘥᘦ戡ѡᘰᘲᘴᘶᘸᘺᘼᘾ;榨;榩;榪;榫;榬;榭;榮;榯tĀ;vᙅᙆ戟bĀ;dᙌᙍ抾;榝Āptᙔᙗh;戢»¹arr;捼Āgpᙣᙧon;䄅f;쀀𝕒;Eaeiopᙻᙽᚂᚄᚇᚊ;橰cir;橯;扊d;手s;䀧roxĀ;eᚒñᚃing耻å䃥ƀctyᚡᚦᚨr;쀀𝒶;䀪mpĀ;eᚯñʈilde耻ã䃣ml耻ä䃤Āciᛂᛈoninôɲnt;樑ࠀNabcdefiklnoprsu᛭ᛱᜰᝃᝈ០៦ᠹᡐᜍ᥈ᥰot;櫭ĀcrᛶkȀcepsᜀᜅᜍᜓong;扌psilon;䏶rime;怵imĀ;e戽q;拍Ŷᜢᜦee;抽edĀ;gᜬᜭ挅e»ᜭrkĀ;tbrk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯᝳ;䎲;愶een;扬r;쀀𝔟gcostuvwឍឝឳេ៕៛ƀaiuបពរðݠrc;旯p»፱ƀdptឤឨឭot;樀lus;樁imes;樂ɱឹ\0\0ើcup;樆ar;昅riangleĀdu៍្own;施p;斳plus;樄eåᑄåᒭarow;植ƀakoᠦᠵĀcn៲ᠣkƀlst֫᠂ozenge;槫riangleȀ;dlr᠒᠓᠘斴own;斾eft;旂ight;斸k;搣Ʊᠫ\0ᠳƲᠯ\0ᠱ;斒;斑4;斓ck;斈ĀeoᠾᡍĀ;qᡃᡆ쀀=⃥uiv;쀀≡⃥t;挐Ȁptwxᡙᡞᡧᡬf;쀀𝕓Ā;tᏋᡣom»Ꮜtie;拈DHUVbdhmptuvᢅᢖᢪᢻᣗᣛᣬᤅᤊᤐᤡȀLRlrᢎᢐᢒᢔ;敗;敔;敖;敓ʀ;DUduᢡᢢᢤᢦᢨ敐;敦;敩;敤;敧ȀLRlrᢳᢵᢷᢹ;敝;敚;敜;教;HLRhlrᣊᣋᣍᣏᣑᣓᣕ救;敬;散;敠;敫;敢;敟ox;槉ȀLRlrᣤᣦᣨᣪ;敕;敒;攐;攌ʀ;DUduڽ;敥;敨;攬;攴inus;抟lus;択imes;抠ȀLRlrᤙᤛᤝ;敛;敘;攘;攔;HLRhlrᤰᤱᤳᤵᤷ᤻᤹攂;敪;敡;敞;攼;攤;攜Āevģbar耻¦䂦Ȁceioᥑᥖᥚᥠr;쀀𝒷mi;恏mĀ;elƀ;bhᥨᥩᥫ䁜;槅sub;柈ŬᥴlĀ;e怢t»pƀ;Eeįᦅᦇ;檮Ā;qۜۛೡᦧ\0᧨ᨑᨕᨲ\0ᨷᩐ\0\0᪴\0\0᫁\0\0ᬡᬮ᭒\0᯽\0ᰌƀcprᦲute;䄇̀;abcdsᦿᧀᧄ᧕᧙戩nd;橄rcup;橉Āau᧒p;橋p;橇ot;橀;쀀∩︀Āeo᧢᧥t;恁îړȀaeiu᧰᧻ᨁᨅǰ᧵\0᧸s;橍on;䄍dil耻ç䃧rc;䄉psĀ;sᨌᨍ橌m;橐ot;䄋ƀdmnᨛᨠᨦil肻¸ƭptyv;榲t脀¢;eᨭᨮ䂢räƲr;쀀𝔠ƀceiᨽᩀᩍy;䑇ckĀ;mᩇᩈ朓ark»ᩈ;䏇r;Ecefms᩠ᩢᩫ᪤᪪旋;槃ƀ;elᩩᩪᩭ䋆q;扗eɡᩴ\0\0᪈rrowĀlr᩼᪁eft;憺ight;憻ʀRSacd᪒᪔᪖»ཇ;擈st;抛irc;抚ash;抝nint;樐id;櫯cir;槂ubsĀ;u᪻᪼晣it»᪼ˬ᫇\0ᬊonĀ;eᫍᫎ䀺Ā;qÇÆɭ\0\0aĀ;t䀬;䁀ƀ;fl戁îᅠeĀmxent»eóɍǧ\0ᬇĀ;dኻᬂot;橭nôɆƀfryᬐᬔᬗ;쀀𝕔oäɔ脀©;sŕᬝr;愗Āaoᬥᬩrr;憵ss;朗Ācuᬲᬷr;쀀𝒸Ābpᬼ᭄Ā;eᭁᭂ櫏;櫑Ā;eᭉᭊ櫐;櫒dot;拯delprvw᭠᭬᭷ᮂᮬᯔarrĀlr᭨᭪;椸;椵ɰ᭲\0\0᭵r;拞c;拟arrĀ;pᮀ憶;椽̀;bcdosᮏᮐᮖᮡᮥᮨ截rcap;橈Āauᮛᮞp;橆p;橊ot;抍r;橅;쀀∪︀Ȁalrv᮵ᮿᯞᯣrrĀ;mᮼᮽ憷;椼yƀevwᯇᯔᯘqɰᯎ\0\0ᯒreã᭳uã᭵ee;拎edge;拏en耻¤䂤earrowĀlrᯮ᯳eft»ᮀight»ᮽeäᯝĀciᰁᰇoninôǷnt;戱lcty;挭ঀAHabcdefhijlorstuwz᰻᰿ᱝᱩᱵᲞᲬᲷᴍᵻᶑᶫᶻ᷆᷍ròar;楥Ȁglrs᱈ᱍ᱒᱔ger;怠eth;愸òᄳhĀ;vᱚᱛ怐»ऊūᱡᱧarow;椏aã̕Āayᱮᱳron;䄏;䐴ƀ;ao̲ᱼᲄĀgrʿᲁr;懊tseq;橷ƀglmᲑᲔᲘ耻°䂰ta;䎴ptyv;榱ĀirᲣᲨsht;楿;쀀𝔡arĀlrᲳᲵ»ࣜ»သʀaegsv᳂᳖᳜᳠mƀ;oș᳔ndĀ;ș᳑uit;晦amma;䏝in;拲ƀ;io᳧᳨᳸䃷de脀÷;o᳧ᳰntimes;拇nø᳷cy;䑒cɯᴆ\0\0ᴊrn;挞op;挍ʀlptuwᴘᴝᴢᵉᵕlar;䀤f;쀀𝕕ʀ;emps̋ᴭᴷᴽᵂqĀ;d͒ᴳot;扑inus;戸lus;戔quare;抡blebarwedgåúnƀadhᄮᵝᵧownarrowóᲃarpoonĀlrᵲᵶefôᲴighôᲶŢᵿᶅkaro÷གɯᶊ\0\0ᶎrn;挟op;挌ƀcotᶘᶣᶦĀryᶝᶡ;쀀𝒹;䑕l;槶rok;䄑Ādrᶰᶴot;拱iĀ;fᶺ᠖斿Āah᷀᷃ròЩaòྦangle;榦Āci᷒ᷕy;䑟grarr;柿ऀDacdefglmnopqrstuxḁḉḙḸոḼṉṡṾấắẽỡἪἷὄĀDoḆᴴoôĀcsḎḔute耻é䃩ter;橮ȀaioyḢḧḱḶron;䄛rĀ;cḭḮ扖耻ê䃪lon;払;䑍ot;䄗ĀDrṁṅot;扒;쀀𝔢ƀ;rsṐṑṗ檚ave耻è䃨Ā;dṜṝ檖ot;檘Ȁ;ilsṪṫṲṴ檙nters;揧;愓Ā;dṹṺ檕ot;檗ƀapsẅẉẗcr;䄓tyƀ;svẒẓẕ戅et»ẓpĀ1;ẝẤijạả;怄;怅怃ĀgsẪẬ;䅋p;怂ĀgpẴẸon;䄙f;쀀𝕖ƀalsỄỎỒrĀ;sỊị拕l;槣us;橱iƀ;lvỚớở䎵on»ớ;䏵ȀcsuvỪỳἋἣĀioữḱrc»Ḯɩỹ\0\0ỻíՈantĀglἂἆtr»ṝess»ṺƀaeiἒἚls;䀽st;扟vĀ;DȵἠD;橸parsl;槥ĀDaἯἳot;打rr;楱ƀcdiἾὁỸr;愯oô͒ĀahὉὋ;䎷耻ð䃰Āmrὓὗl耻ë䃫o;悬ƀcipὡὤὧl;䀡sôծĀeoὬὴctatioîՙnentialåչৡᾒ\0ᾞ\0ᾡᾧ\0\0ῆῌ\0ΐ\0ῦῪ \0 ⁚llingdotseñṄy;䑄male;晀ƀilrᾭᾳ῁lig;耀ffiɩᾹ\0\0᾽g;耀ffig;耀ffl;쀀𝔣lig;耀filig;쀀fjƀaltῙῡt;晭ig;耀flns;斱of;䆒ǰ΅\0ῳf;쀀𝕗ĀakֿῷĀ;vῼ´拔;櫙artint;樍Āao⁕Ācs‑⁒ႉ‸⁅⁈\0⁐β•‥‧\0耻½䂽;慓耻¼䂼;慕;慙;慛Ƴ‴\0‶;慔;慖ʴ‾⁁\0\0⁃耻¾䂾;慗;慜5;慘ƶ⁌\0⁎;慚;慝8;慞l;恄wn;挢cr;쀀𝒻ࢀEabcdefgijlnorstv₂₉₥₰₴⃰℃ℒℸ̗ℾ⅒↞Ā;lٍ₇;檌ƀcmpₐₕute;䇵maĀ;dₜ᳚䎳;檆reve;䄟Āiy₪₮rc;䄝;䐳ot;䄡Ȁ;lqsؾق₽ƀ;qsؾٌlanô٥Ȁ;cdl٥⃒⃥⃕c;檩otĀ;o⃜⃝檀Ā;l⃢⃣檂;檄Ā;e⃪⃭쀀⋛︀s;檔r;쀀𝔤Ā;gٳ؛mel;愷cy;䑓Ȁ;Eajٚℌℎℐ;檒;檥;檤ȀEaesℛℝ℩ℴ;扩pĀ;p℣ℤ檊rox»ℤĀ;q℮ℯ檈Ā;q℮ℛim;拧pf;쀀𝕘Āci⅃ⅆr;愊mƀ;el٫ⅎ⅐;檎;檐茀>;cdlqrⅠⅪⅮⅳⅹĀciⅥⅧ;檧r;橺ot;拗Par;榕uest;橼ʀadelsↄⅪ←ٖ↛ǰ↉\0proør;楸qĀlqؿ↖lesó₈ií٫Āen↣↭rtneqq;쀀≩︀Å↪ԀAabcefkosy⇄⇇⇱⇵⇺∘∝∯≨≽ròΠȀilmr⇐⇔⇗⇛rsðᒄf»․ilôکĀdr⇠⇤cy;䑊ƀ;cwࣴ⇫⇯ir;楈;憭ar;意irc;䄥ƀalr∁∎∓rtsĀ;u∉∊晥it»∊lip;怦con;抹r;쀀𝔥sĀew∣∩arow;椥arow;椦ʀamopr∺∾≃≞≣rr;懿tht;戻kĀlr≉≓eftarrow;憩ightarrow;憪f;쀀𝕙bar;怕ƀclt≯≴≸r;쀀𝒽asè⇴rok;䄧Ābp⊂⊇ull;恃hen»ᱛૡ⊣\0⊪\0⊸⋅⋎\0⋕⋳\0\0⋸⌢⍧⍢⍿\0⎆⎪⎴cute耻í䃭ƀ;iyݱ⊰⊵rc耻î䃮;䐸Ācx⊼⊿y;䐵cl耻¡䂡ĀfrΟ⋉;쀀𝔦rave耻ì䃬Ȁ;inoܾ⋝⋩⋮Āin⋢⋦nt;樌t;戭fin;槜ta;愩lig;䄳ƀaop⋾⌚⌝ƀcgt⌅⌈⌗r;䄫ƀelpܟ⌏⌓inåގarôܠh;䄱f;抷ed;䆵ʀ;cfotӴ⌬⌱⌽⍁are;愅inĀ;t⌸⌹戞ie;槝doô⌙ʀ;celpݗ⍌⍐⍛⍡al;抺Āgr⍕⍙eróᕣã⍍arhk;樗rod;樼Ȁcgpt⍯⍲⍶⍻y;䑑on;䄯f;쀀𝕚a;䎹uest耻¿䂿Āci⎊⎏r;쀀𝒾nʀ;EdsvӴ⎛⎝⎡ӳ;拹ot;拵Ā;v⎦⎧拴;拳Ā;iݷ⎮lde;䄩ǫ⎸\0⎼cy;䑖l耻ï䃯̀cfmosu⏌⏗⏜⏡⏧⏵Āiy⏑⏕rc;䄵;䐹r;쀀𝔧ath;䈷pf;쀀𝕛ǣ⏬\0⏱r;쀀𝒿rcy;䑘kcy;䑔Ѐacfghjos␋␖␢ppaĀ;v␓␔䎺;䏰Āey␛␠dil;䄷;䐺r;쀀𝔨reen;䄸cy;䑅cy;䑜pf;쀀𝕜cr;쀀𝓀ABEHabcdefghjlmnoprstuv⑰⒁⒆⒍⒑┎┽╚▀♎♞♥♹♽⚚⚲⛘❝❨➋⟀⠁⠒ƀart⑷⑺⑼ròòΕail;椛arr;椎Ā;gঔ⒋;檋ar;楢ॣ⒥\0⒪\0⒱\0\0\0\0\0⒵Ⓔ\0ⓆⓈⓍ\0⓹ute;䄺mptyv;榴raîࡌbda;䎻gƀ;dlࢎⓁⓃ;榑åࢎ;檅uo耻«䂫rЀ;bfhlpst࢙ⓞⓦⓩ⓫⓮⓱⓵Ā;f࢝ⓣs;椟s;椝ë≒p;憫l;椹im;楳l;憢ƀ;ae⓿─┄檫il;椙Ā;s┉┊檭;쀀⪭︀ƀabr┕┙┝rr;椌rk;杲Āak┢┬cĀek┨┪;䁻;䁛Āes┱┳;榋lĀdu┹┻;榏;榍Ȁaeuy╆╋╖╘ron;䄾Ādi═╔il;䄼ìࢰâ┩;䐻Ȁcqrs╣╦╭╽a;椶uoĀ;rนᝆĀdu╲╷har;楧shar;楋h;憲ʀ;fgqs▋▌উ◳◿扤tʀahlrt▘▤▷◂◨rrowĀ;t࢙□aé⓶arpoonĀdu▯▴own»њp»०eftarrows;懇ightƀahs◍◖◞rrowĀ;sࣴࢧarpoonóquigarro÷⇰hreetimes;拋ƀ;qs▋ও◺lanôবʀ;cdgsব☊☍☝☨c;檨otĀ;o☔☕橿Ā;r☚☛檁;檃Ā;e☢☥쀀⋚︀s;檓ʀadegs☳☹☽♉♋pproøⓆot;拖qĀgq♃♅ôউgtò⒌ôছiíলƀilr♕࣡♚sht;楼;쀀𝔩Ā;Eজ♣;檑š♩♶rĀdu▲♮Ā;l॥♳;楪lk;斄cy;䑙ʀ;achtੈ⚈⚋⚑⚖rò◁orneòᴈard;楫ri;旺Āio⚟⚤dot;䅀ustĀ;a⚬⚭掰che»⚭ȀEaes⚻⚽⛉⛔;扨pĀ;p⛃⛄檉rox»⛄Ā;q⛎⛏檇Ā;q⛎⚻im;拦Ѐabnoptwz⛩⛴⛷✚✯❁❇❐Ānr⛮⛱g;柬r;懽rëࣁgƀlmr⛿✍✔eftĀar০✇ightá৲apsto;柼ightá৽parrowĀlr✥✩efô⓭ight;憬ƀafl✶✹✽r;榅;쀀𝕝us;樭imes;樴š❋❏st;戗áፎƀ;ef❗❘᠀旊nge»❘arĀ;l❤❥䀨t;榓ʀachmt❳❶❼➅➇ròࢨorneòᶌarĀ;d➃;業;怎ri;抿̀achiqt➘➝ੀ➢➮➻quo;怹r;쀀𝓁mƀ;egল➪➬;檍;檏Ābu┪➳oĀ;rฟ➹;怚rok;䅂萀<;cdhilqrࠫ⟒☹⟜⟠⟥⟪⟰Āci⟗⟙;檦r;橹reå◲mes;拉arr;楶uest;橻ĀPi⟵⟹ar;榖ƀ;ef⠀भ旃rĀdu⠇⠍shar;楊har;楦Āen⠗⠡rtneqq;쀀≨︀Å⠞܀Dacdefhilnopsu⡀⡅⢂⢎⢓⢠⢥⢨⣚⣢⣤ઃ⣳⤂Dot;戺Ȁclpr⡎⡒⡣⡽r耻¯䂯Āet⡗⡙;時Ā;e⡞⡟朠se»⡟Ā;sျ⡨toȀ;dluျ⡳⡷⡻owîҌefôएðᏑker;斮Āoy⢇⢌mma;権;䐼ash;怔asuredangle»ᘦr;쀀𝔪o;愧ƀcdn⢯⢴⣉ro耻µ䂵Ȁ;acdᑤ⢽⣀⣄sôᚧir;櫰ot肻·Ƶusƀ;bd⣒ᤃ⣓戒Ā;uᴼ⣘;横ţ⣞⣡p;櫛ò−ðઁĀdp⣩⣮els;抧f;쀀𝕞Āct⣸⣽r;쀀𝓂pos»ᖝƀ;lm⤉⤊⤍䎼timap;抸ఀGLRVabcdefghijlmoprstuvw⥂⥓⥾⦉⦘⧚⧩⨕⨚⩘⩝⪃⪕⪤⪨⬄⬇⭄⭿⮮ⰴⱧⱼ⳩Āgt⥇⥋;쀀⋙̸Ā;v⥐쀀≫⃒ƀelt⥚⥲⥶ftĀar⥡⥧rrow;懍ightarrow;懎;쀀⋘̸Ā;v⥻ే쀀≪⃒ightarrow;懏ĀDd⦎⦓ash;抯ash;抮ʀbcnpt⦣⦧⦬⦱⧌la»˞ute;䅄g;쀀∠⃒ʀ;Eiop⦼⧀⧅⧈;쀀⩰̸d;쀀≋̸s;䅉roøurĀ;a⧓⧔普lĀ;s⧓ସdz⧟\0⧣p肻 ଷmpĀ;e௹ఀʀaeouy⧴⧾⨃⨐⨓ǰ⧹\0⧻;橃on;䅈dil;䅆ngĀ;dൾ⨊ot;쀀⩭̸p;橂;䐽ash;怓;Aadqsxஒ⨩⨭⨻⩁⩅⩐rr;懗rĀhr⨳⨶k;椤Ā;oᏲᏰot;쀀≐̸uiöୣĀei⩊⩎ar;椨íistĀ;sடr;쀀𝔫ȀEest⩦⩹⩼ƀ;qs⩭ƀ;qs⩴lanôií௪Ā;rஶ⪁»ஷƀAap⪊⪍⪑rò⥱rr;憮ar;櫲ƀ;svྍ⪜ྌĀ;d⪡⪢拼;拺cy;䑚AEadest⪷⪺⪾⫂⫅⫶⫹rò⥦;쀀≦̸rr;憚r;急Ȁ;fqs⫎⫣⫯tĀar⫔⫙rro÷⫁ightarro÷⪐ƀ;qs⪺⫪lanôౕĀ;sౕ⫴»శiíౝĀ;rవ⫾iĀ;eచథiäඐĀpt⬌⬑f;쀀𝕟膀¬;in⬙⬚⬶䂬nȀ;Edvஉ⬤⬨⬮;쀀⋹̸ot;쀀⋵̸ǡஉ⬳⬵;拷;拶iĀ;vಸ⬼ǡಸ⭁⭃;拾;拽ƀaor⭋⭣⭩rȀ;ast⭕⭚⭟lleìl;쀀⫽⃥;쀀∂̸lint;樔ƀ;ceಒ⭰⭳uåಥĀ;cಘ⭸Ā;eಒ⭽ñಘȀAait⮈⮋⮝⮧rò⦈rrƀ;cw⮔⮕⮙憛;쀀⤳̸;쀀↝̸ghtarrow»⮕riĀ;eೋೖchimpqu⮽⯍⯙⬄⯤⯯Ȁ;cerല⯆ഷ⯉uå;쀀𝓃ortɭ⬅\0\0⯖ará⭖mĀ;e൮⯟Ā;q൴൳suĀbp⯫⯭ååഋƀbcp⯶ⰑⰙȀ;Ees⯿ⰀഢⰄ抄;쀀⫅̸etĀ;eഛⰋqĀ;qണⰀcĀ;eലⰗñസȀ;EesⰢⰣൟⰧ抅;쀀⫆̸etĀ;e൘ⰮqĀ;qൠⰣȀgilrⰽⰿⱅⱇìௗlde耻ñ䃱çృiangleĀlrⱒⱜeftĀ;eచⱚñదightĀ;eೋⱥñĀ;mⱬⱭ䎽ƀ;esⱴⱵⱹ䀣ro;愖p;怇ҀDHadgilrsⲏⲔⲙⲞⲣⲰⲶⳓⳣash;抭arr;椄p;쀀≍⃒ash;抬ĀetⲨⲬ;쀀≥⃒;쀀>⃒nfin;槞ƀAetⲽⳁⳅrr;椂;쀀≤⃒Ā;rⳊⳍ쀀<⃒ie;쀀⊴⃒ĀAtⳘⳜrr;椃rie;쀀⊵⃒im;쀀∼⃒ƀAan⳰ⴂrr;懖rĀhr⳺⳽k;椣Ā;oᏧᏥear;椧ቓ᪕\0\0\0\0\0\0\0\0\0\0\0\0\0ⴭ\0ⴸⵈⵠⵥⶄᬇ\0\0ⶍⶫ\0ⷈⷎ\0ⷜ⸙⸫⸾⹃Ācsⴱ᪗ute耻ó䃳ĀiyⴼⵅrĀ;cⵂ耻ô䃴;䐾ʀabios᪠ⵒⵗLjⵚlac;䅑v;樸old;榼lig;䅓Ācrir;榿;쀀𝔬ͯ\0\0\0ⶂn;䋛ave耻ò䃲;槁Ābmⶈ෴ar;榵Ȁacitⶕⶥⶨrò᪀Āirⶠr;榾oss;榻nå๒;槀ƀaeiⶱⶵⶹcr;䅍ga;䏉ƀcdnⷀⷅǍron;䎿;榶pf;쀀𝕠ƀaelⷔǒr;榷rp;榹;adiosvⷪⷫⷮ⸈⸍⸐⸖戨rò᪆Ȁ;efmⷷⷸ⸂⸅橝rĀ;oⷾⷿ愴f»ⷿ耻ª䂪耻º䂺gof;抶r;橖lope;橗;橛ƀclo⸟⸡⸧ò⸁ash耻ø䃸l;折iŬⸯ⸴de耻õ䃵esĀ;aǛ⸺s;樶ml耻ö䃶bar;挽ૡ\0\0⺀⺝\0⺢⺹\0\0⻋ຜ\0⼓\0\0⼫⾼\0⿈rȀ;astЃ脀¶;l䂶leìЃɩ\0\0m;櫳;櫽y;䐿rʀcimpt⺋⺏⺓ᡥ⺗nt;䀥od;䀮il;怰enk;怱r;쀀𝔭ƀimo⺨⺰⺴Ā;v⺭⺮䏆;䏕maô੶ne;明ƀ;tv⺿⻀⻈䏀chfork»´;䏖Āau⻏⻟nĀck⻕⻝kĀ;h⇴⻛;愎ö⇴sҀ;abcdemst⻳ᤈ⼄⼆⼊⼎䀫cir;樣ir;樢Āouᵀ⼂;樥;橲n肻±ຝim;樦wo;樧ƀipu⼙⼠⼥ntint;樕f;쀀𝕡nd耻£䂣Ԁ;Eaceinosu່⼿⽁⽄⽇⾁⾉⾒⽾⾶;檳p;檷uå໙Ā;c໎⽌̀;acens່⽙⽟⽦⽨⽾pproø⽃urlyeñ໙ñ໎ƀaes⽯⽶⽺pprox;檹qq;檵im;拨iíໟmeĀ;s⾈ຮ怲ƀEas⽸⾐⽺ð⽵ƀdfp⾙⾯ƀals⾠⾥⾪lar;挮ine;挒urf;挓Ā;t⾴ïrel;抰Āci⿀⿅r;쀀𝓅;䏈ncsp;怈̀fiopsu⋢⿱r;쀀𝔮pf;쀀𝕢rime;恗cr;쀀𝓆ƀaeo⿸〉〓tĀei々rnionóڰnt;樖stĀ;e【】䀿ñἙô༔ABHabcdefhilmnoprstuxけさすムㄎㄫㅇㅢㅲㆎ㈆㈕㈤㈩㉘㉮㉲㊐㊰㊷ƀartぇおがròႳòϝail;検aròᱥar;楤cdenqrtとふへみわゔヌĀeuねぱ;쀀∽̱te;䅕iãᅮmptyv;榳gȀ;del࿑らるろ;榒;榥å࿑uo耻»䂻rր;abcfhlpstwガクシスゼゾダッデナp;極Ā;fゴs;椠;椳s;椞ë≝ð✮l;楅im;楴l;憣;憝Āaiパフil;椚oĀ;nホボ戶aló༞ƀabrョリヮrò៥rk;杳ĀakンヽcĀekヹ・;䁽;䁝Āes;榌lĀduㄊㄌ;榎;榐Ȁaeuyㄗㄜㄧㄩron;䅙Ādiㄡㄥil;䅗ìâヺ;䑀Ȁclqsㄴㄷㄽㅄa;椷dhar;楩uoĀ;rȎȍh;憳ƀacgㅎㅟངlȀ;ipsླྀㅘㅛႜnåႻarôྩt;断ƀilrㅩဣㅮsht;楽;쀀𝔯ĀaoㅷㆆrĀduㅽㅿ»ѻĀ;l႑ㆄ;楬Ā;vㆋㆌ䏁;䏱ƀgns㆕ㇹㇼht̀ahlrstㆤㆰ㇂㇘rrowĀ;tㆭaéトarpoonĀduㆻㆿowîㅾp»႒eftĀah㇊㇐rrowóarpoonóՑightarrows;應quigarro÷ニhreetimes;拌g;䋚ingdotseñἲƀahm㈍㈐㈓ròaòՑ;怏oustĀ;a㈞掱che»mid;櫮Ȁabpt㈲㈽㉀㉒Ānr㈷㈺g;柭r;懾rëဃƀafl㉇㉊㉎r;榆;쀀𝕣us;樮imes;樵Āap㉝㉧rĀ;g㉣㉤䀩t;榔olint;樒arò㇣Ȁachq㉻㊀Ⴜ㊅quo;怺r;쀀𝓇Ābu・㊊oĀ;rȔȓƀhir㊗㊛㊠reåㇸmes;拊iȀ;efl㊪ၙᠡ㊫方tri;槎luhar;楨;愞ൡ㋕㋛㋟㌬㌸㍱\0㍺㎤\0\0㏬㏰\0㐨㑈㑚㒭㒱㓊㓱\0㘖\0\0㘳cute;䅛quï➺Ԁ;Eaceinpsyᇭ㋳㋵㋿㌂㌋㌏㌟㌦㌩;檴ǰ㋺\0㋼;檸on;䅡uåᇾĀ;dᇳ㌇il;䅟rc;䅝ƀEas㌖㌘㌛;檶p;檺im;择olint;樓iíሄ;䑁otƀ;be㌴ᵇ㌵担;橦Aacmstx㍆㍊㍗㍛㍞㍣㍭rr;懘rĀhr㍐㍒ë∨Ā;oਸ਼t耻§䂧i;䀻war;椩mĀin㍩ðnuóñt;朶rĀ;o㍶⁕쀀𝔰Ȁacoy㎂㎆㎑㎠rp;景Āhy㎋㎏cy;䑉;䑈rtɭ㎙\0\0㎜iäᑤaraì耻䂭Āgm㎨㎴maƀ;fv㎱㎲㎲䏃;䏂Ѐ;deglnprካ㏅㏉㏎㏖㏞㏡㏦ot;橪Ā;qኰĀ;E㏓㏔檞;檠Ā;E㏛㏜檝;檟e;扆lus;樤arr;楲aròᄽȀaeit㏸㐈㐏㐗Āls㏽㐄lsetmé㍪hp;樳parsl;槤Ādlᑣ㐔e;挣Ā;e㐜㐝檪Ā;s㐢㐣檬;쀀⪬︀ƀflp㐮㐳㑂tcy;䑌Ā;b㐸㐹䀯Ā;a㐾㐿槄r;挿f;쀀𝕤aĀdr㑍ЂesĀ;u㑔㑕晠it»㑕ƀcsu㑠㑹㒟Āau㑥㑯pĀ;sᆈ㑫;쀀⊓︀pĀ;sᆴ㑵;쀀⊔︀uĀbp㑿㒏ƀ;esᆗᆜ㒆etĀ;eᆗ㒍ñᆝƀ;esᆨᆭ㒖etĀ;eᆨ㒝ñᆮƀ;afᅻ㒦ְrť㒫ֱ»ᅼaròᅈȀcemt㒹㒾㓂㓅r;쀀𝓈tmîñiì㐕aræᆾĀar㓎㓕rĀ;f㓔ឿ昆Āan㓚㓭ightĀep㓣㓪psiloîỠhé⺯s»⡒ʀbcmnp㓻㕞ሉ㖋㖎Ҁ;Edemnprs㔎㔏㔑㔕㔞㔣㔬㔱㔶抂;櫅ot;檽Ā;dᇚ㔚ot;櫃ult;櫁ĀEe㔨㔪;櫋;把lus;檿arr;楹ƀeiu㔽㕒㕕tƀ;en㔎㕅㕋qĀ;qᇚ㔏eqĀ;q㔫㔨m;櫇Ābp㕚㕜;櫕;櫓c̀;acensᇭ㕬㕲㕹㕻㌦pproø㋺urlyeñᇾñᇳƀaes㖂㖈㌛pproø㌚qñ㌗g;晪ڀ123;Edehlmnps㖩㖬㖯ሜ㖲㖴㗀㗉㗕㗚㗟㗨㗭耻¹䂹耻²䂲耻³䂳;櫆Āos㖹㖼t;檾ub;櫘Ā;dሢ㗅ot;櫄sĀou㗏㗒l;柉b;櫗arr;楻ult;櫂ĀEe㗤㗦;櫌;抋lus;櫀ƀeiu㗴㘉㘌tƀ;enሜ㗼㘂qĀ;qሢ㖲eqĀ;q㗧㗤m;櫈Ābp㘑㘓;櫔;櫖ƀAan㘜㘠㘭rr;懙rĀhr㘦㘨ë∮Ā;oਫwar;椪lig耻ß䃟㙑㙝㙠ዎ㙳㙹\0㙾㛂\0\0\0\0\0㛛㜃\0㜉㝬\0\0\0㞇ɲ㙖\0\0㙛get;挖;䏄rëƀaey㙦㙫㙰ron;䅥dil;䅣;䑂lrec;挕r;쀀𝔱Ȁeiko㚆㚝㚵㚼Dz㚋\0㚑eĀ4fኄኁaƀ;sv㚘㚙㚛䎸ym;䏑Ācn㚢㚲kĀas㚨㚮pproøim»ኬsðኞĀas㚺㚮ðrn耻þ䃾Ǭ̟㛆⋧es膀×;bd㛏㛐㛘䃗Ā;aᤏ㛕r;樱;樰ƀeps㛡㛣㜀á⩍Ȁ;bcf҆㛬㛰㛴ot;挶ir;櫱Ā;o㛹㛼쀀𝕥rk;櫚á㍢rime;怴ƀaip㜏㜒㝤dåቈadempst㜡㝍㝀㝑㝗㝜㝟ngleʀ;dlqr㜰㜱㜶㝀㝂斵own»ᶻeftĀ;e⠀㜾ñम;扜ightĀ;e㊪㝋ñၚot;旬inus;樺lus;樹b;槍ime;樻ezium;揢ƀcht㝲㝽㞁Āry㝷㝻;쀀𝓉;䑆cy;䑛rok;䅧Āio㞋㞎xôheadĀlr㞗㞠eftarro÷ࡏightarrow»ཝऀAHabcdfghlmoprstuw㟐㟓㟗㟤㟰㟼㠎㠜㠣㠴㡑㡝㡫㢩㣌㣒㣪㣶ròϭar;楣Ācr㟜㟢ute耻ú䃺òᅐrǣ㟪\0㟭y;䑞ve;䅭Āiy㟵㟺rc耻û䃻;䑃ƀabh㠃㠆㠋ròᎭlac;䅱aòᏃĀir㠓㠘sht;楾;쀀𝔲rave耻ù䃹š㠧㠱rĀlr㠬㠮»ॗ»ႃlk;斀Āct㠹㡍ɯ㠿\0\0㡊rnĀ;e㡅㡆挜r»㡆op;挏ri;旸Āal㡖㡚cr;䅫肻¨͉Āgp㡢㡦on;䅳f;쀀𝕦̀adhlsuᅋ㡸㡽፲㢑㢠ownáᎳarpoonĀlr㢈㢌efô㠭ighô㠯iƀ;hl㢙㢚㢜䏅»ᏺon»㢚parrows;懈ƀcit㢰㣄㣈ɯ㢶\0\0㣁rnĀ;e㢼㢽挝r»㢽op;挎ng;䅯ri;旹cr;쀀𝓊ƀdir㣙㣝㣢ot;拰lde;䅩iĀ;f㜰㣨»᠓Āam㣯㣲rò㢨l耻ü䃼angle;榧ހABDacdeflnoprsz㤜㤟㤩㤭㦵㦸㦽㧟㧤㧨㧳㧹㧽㨁㨠ròϷarĀ;v㤦㤧櫨;櫩asèϡĀnr㤲㤷grt;榜eknprst㓣㥆㥋㥒㥝㥤㦖appá␕othinçẖƀhir㓫⻈㥙opô⾵Ā;hᎷ㥢ïㆍĀiu㥩㥭gmá㎳Ābp㥲㦄setneqĀ;q㥽㦀쀀⊊︀;쀀⫋︀setneqĀ;q㦏㦒쀀⊋︀;쀀⫌︀Āhr㦛㦟etá㚜iangleĀlr㦪㦯eft»थight»ၑy;䐲ash»ံƀelr㧄㧒㧗ƀ;beⷪ㧋㧏ar;抻q;扚lip;拮Ābt㧜ᑨaòᑩr;쀀𝔳tré㦮suĀbp㧯㧱»ജ»൙pf;쀀𝕧roðtré㦴Ācu㨆㨋r;쀀𝓋Ābp㨐㨘nĀEe㦀㨖»㥾nĀEe㦒㨞»㦐igzag;榚cefoprs㨶㨻㩖㩛㩔㩡㩪irc;䅵Ādi㩀㩑Ābg㩅㩉ar;機eĀ;qᗺ㩏;扙erp;愘r;쀀𝔴pf;쀀𝕨Ā;eᑹ㩦atèᑹcr;쀀𝓌ૣណ㪇\0㪋\0㪐㪛\0\0㪝㪨㪫㪯\0\0㫃㫎\0㫘ៜtré៑r;쀀𝔵ĀAa㪔㪗ròσrò৶;䎾ĀAa㪡㪤ròθrò৫að✓is;拻ƀdptឤ㪵㪾Āfl㪺ឩ;쀀𝕩imåឲĀAa㫇㫊ròώròਁĀcq㫒ីr;쀀𝓍Āpt៖㫜ré។Ѐacefiosu㫰㫽㬈㬌㬑㬕㬛㬡cĀuy㫶㫻te耻ý䃽;䑏Āiy㬂㬆rc;䅷;䑋n耻¥䂥r;쀀𝔶cy;䑗pf;쀀𝕪cr;쀀𝓎Ācm㬦㬩y;䑎l耻ÿ䃿Ԁacdefhiosw㭂㭈㭔㭘㭤㭩㭭㭴㭺㮀cute;䅺Āay㭍㭒ron;䅾;䐷ot;䅼Āet㭝㭡træᕟa;䎶r;쀀𝔷cy;䐶grarr;懝pf;쀀𝕫cr;쀀𝓏Ājn㮅㮇;怍j;怌'.split("").map(t=>t.charCodeAt(0))),pT=new Map([[0,65533],[128,8364],[130,8218],[131,402],[132,8222],[133,8230],[134,8224],[135,8225],[136,710],[137,8240],[138,352],[139,8249],[140,338],[142,381],[145,8216],[146,8217],[147,8220],[148,8221],[149,8226],[150,8211],[151,8212],[152,732],[153,8482],[154,353],[155,8250],[156,339],[158,382],[159,376]]);function mT(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=pT.get(t))!==null&&e!==void 0?e:t}var hn;(function(t){t[t.NUM=35]="NUM",t[t.SEMI=59]="SEMI",t[t.EQUALS=61]="EQUALS",t[t.ZERO=48]="ZERO",t[t.NINE=57]="NINE",t[t.LOWER_A=97]="LOWER_A",t[t.LOWER_F=102]="LOWER_F",t[t.LOWER_X=120]="LOWER_X",t[t.LOWER_Z=122]="LOWER_Z",t[t.UPPER_A=65]="UPPER_A",t[t.UPPER_F=70]="UPPER_F",t[t.UPPER_Z=90]="UPPER_Z"})(hn||(hn={}));const gT=32;var Ys;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ys||(Ys={}));function xd(t){return t>=hn.ZERO&&t<=hn.NINE}function vT(t){return t>=hn.UPPER_A&&t<=hn.UPPER_F||t>=hn.LOWER_A&&t<=hn.LOWER_F}function bT(t){return t>=hn.UPPER_A&&t<=hn.UPPER_Z||t>=hn.LOWER_A&&t<=hn.LOWER_Z||xd(t)}function ET(t){return t===hn.EQUALS||bT(t)}var fn;(function(t){t[t.EntityStart=0]="EntityStart",t[t.NumericStart=1]="NumericStart",t[t.NumericDecimal=2]="NumericDecimal",t[t.NumericHex=3]="NumericHex",t[t.NamedEntity=4]="NamedEntity"})(fn||(fn={}));var vs;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(vs||(vs={}));class _T{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=fn.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=vs.Strict}startEntity(e){this.decodeMode=e,this.state=fn.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case fn.EntityStart:return e.charCodeAt(n)===hn.NUM?(this.state=fn.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=fn.NamedEntity,this.stateNamedEntity(e,n));case fn.NumericStart:return this.stateNumericStart(e,n);case fn.NumericDecimal:return this.stateNumericDecimal(e,n);case fn.NumericHex:return this.stateNumericHex(e,n);case fn.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|gT)===hn.LOWER_X?(this.state=fn.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=fn.NumericDecimal,this.stateNumericDecimal(e,n))}addToNumericResult(e,n,r,s){if(n!==r){const a=r-n;this.result=this.result*Math.pow(s,a)+Number.parseInt(e.substr(n,a),s),this.consumed+=a}}stateNumericHex(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(xd(s)||vT(s))n+=1;else return this.addToNumericResult(e,r,n,16),this.emitNumericEntity(s,3)}return this.addToNumericResult(e,r,n,16),-1}stateNumericDecimal(e,n){const r=n;for(;n<e.length;){const s=e.charCodeAt(n);if(xd(s))n+=1;else return this.addToNumericResult(e,r,n,10),this.emitNumericEntity(s,2)}return this.addToNumericResult(e,r,n,10),-1}emitNumericEntity(e,n){var r;if(this.consumed<=n)return(r=this.errors)===null||r===void 0||r.absenceOfDigitsInNumericCharacterReference(this.consumed),0;if(e===hn.SEMI)this.consumed+=1;else if(this.decodeMode===vs.Strict)return 0;return this.emitCodePoint(mT(this.result),this.consumed),this.errors&&(e!==hn.SEMI&&this.errors.missingSemicolonAfterCharacterReference(),this.errors.validateNumericCharacterReference(this.result)),this.consumed}stateNamedEntity(e,n){const{decodeTree:r}=this;let s=r[this.treeIndex],a=(s&Ys.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=TT(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===vs.Attribute&&(a===0||ET(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&Ys.VALUE_LENGTH)>>14,a!==0){if(i===hn.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==vs.Strict&&(this.result=this.treeIndex,this.consumed+=this.excess,this.excess=0)}}return-1}emitNotTerminatedNamedEntity(){var e;const{result:n,decodeTree:r}=this,s=(r[n]&Ys.VALUE_LENGTH)>>14;return this.emitNamedEntityData(n,s,this.consumed),(e=this.errors)===null||e===void 0||e.missingSemicolonAfterCharacterReference(),this.consumed}emitNamedEntityData(e,n,r){const{decodeTree:s}=this;return this.emitCodePoint(n===1?s[e]&~Ys.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case fn.NamedEntity:return this.result!==0&&(this.decodeMode!==vs.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case fn.NumericDecimal:return this.emitNumericEntity(0,2);case fn.NumericHex:return this.emitNumericEntity(0,3);case fn.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case fn.EntityStart:return 0}}}function TT(t,e,n,r){const s=(e&Ys.BRANCH_LENGTH)>>7,a=e&Ys.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const l=r-a;return l<0||l>=s?-1:t[n+l]-1}let i=n,o=i+s-1;for(;i<=o;){const l=i+o>>>1,d=t[l];if(d<r)i=l+1;else if(d>r)o=l-1;else return t[l+s]}return-1}var pe;(function(t){t.HTML="http://www.w3.org/1999/xhtml",t.MATHML="http://www.w3.org/1998/Math/MathML",t.SVG="http://www.w3.org/2000/svg",t.XLINK="http://www.w3.org/1999/xlink",t.XML="http://www.w3.org/XML/1998/namespace",t.XMLNS="http://www.w3.org/2000/xmlns/"})(pe||(pe={}));var ka;(function(t){t.TYPE="type",t.ACTION="action",t.ENCODING="encoding",t.PROMPT="prompt",t.NAME="name",t.COLOR="color",t.FACE="face",t.SIZE="size"})(ka||(ka={}));var cr;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(cr||(cr={}));var Z;(function(t){t.A="a",t.ADDRESS="address",t.ANNOTATION_XML="annotation-xml",t.APPLET="applet",t.AREA="area",t.ARTICLE="article",t.ASIDE="aside",t.B="b",t.BASE="base",t.BASEFONT="basefont",t.BGSOUND="bgsound",t.BIG="big",t.BLOCKQUOTE="blockquote",t.BODY="body",t.BR="br",t.BUTTON="button",t.CAPTION="caption",t.CENTER="center",t.CODE="code",t.COL="col",t.COLGROUP="colgroup",t.DD="dd",t.DESC="desc",t.DETAILS="details",t.DIALOG="dialog",t.DIR="dir",t.DIV="div",t.DL="dl",t.DT="dt",t.EM="em",t.EMBED="embed",t.FIELDSET="fieldset",t.FIGCAPTION="figcaption",t.FIGURE="figure",t.FONT="font",t.FOOTER="footer",t.FOREIGN_OBJECT="foreignObject",t.FORM="form",t.FRAME="frame",t.FRAMESET="frameset",t.H1="h1",t.H2="h2",t.H3="h3",t.H4="h4",t.H5="h5",t.H6="h6",t.HEAD="head",t.HEADER="header",t.HGROUP="hgroup",t.HR="hr",t.HTML="html",t.I="i",t.IMG="img",t.IMAGE="image",t.INPUT="input",t.IFRAME="iframe",t.KEYGEN="keygen",t.LABEL="label",t.LI="li",t.LINK="link",t.LISTING="listing",t.MAIN="main",t.MALIGNMARK="malignmark",t.MARQUEE="marquee",t.MATH="math",t.MENU="menu",t.META="meta",t.MGLYPH="mglyph",t.MI="mi",t.MO="mo",t.MN="mn",t.MS="ms",t.MTEXT="mtext",t.NAV="nav",t.NOBR="nobr",t.NOFRAMES="noframes",t.NOEMBED="noembed",t.NOSCRIPT="noscript",t.OBJECT="object",t.OL="ol",t.OPTGROUP="optgroup",t.OPTION="option",t.P="p",t.PARAM="param",t.PLAINTEXT="plaintext",t.PRE="pre",t.RB="rb",t.RP="rp",t.RT="rt",t.RTC="rtc",t.RUBY="ruby",t.S="s",t.SCRIPT="script",t.SEARCH="search",t.SECTION="section",t.SELECT="select",t.SOURCE="source",t.SMALL="small",t.SPAN="span",t.STRIKE="strike",t.STRONG="strong",t.STYLE="style",t.SUB="sub",t.SUMMARY="summary",t.SUP="sup",t.TABLE="table",t.TBODY="tbody",t.TEMPLATE="template",t.TEXTAREA="textarea",t.TFOOT="tfoot",t.TD="td",t.TH="th",t.THEAD="thead",t.TITLE="title",t.TR="tr",t.TRACK="track",t.TT="tt",t.U="u",t.UL="ul",t.SVG="svg",t.VAR="var",t.WBR="wbr",t.XMP="xmp"})(Z||(Z={}));var c;(function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.A=1]="A",t[t.ADDRESS=2]="ADDRESS",t[t.ANNOTATION_XML=3]="ANNOTATION_XML",t[t.APPLET=4]="APPLET",t[t.AREA=5]="AREA",t[t.ARTICLE=6]="ARTICLE",t[t.ASIDE=7]="ASIDE",t[t.B=8]="B",t[t.BASE=9]="BASE",t[t.BASEFONT=10]="BASEFONT",t[t.BGSOUND=11]="BGSOUND",t[t.BIG=12]="BIG",t[t.BLOCKQUOTE=13]="BLOCKQUOTE",t[t.BODY=14]="BODY",t[t.BR=15]="BR",t[t.BUTTON=16]="BUTTON",t[t.CAPTION=17]="CAPTION",t[t.CENTER=18]="CENTER",t[t.CODE=19]="CODE",t[t.COL=20]="COL",t[t.COLGROUP=21]="COLGROUP",t[t.DD=22]="DD",t[t.DESC=23]="DESC",t[t.DETAILS=24]="DETAILS",t[t.DIALOG=25]="DIALOG",t[t.DIR=26]="DIR",t[t.DIV=27]="DIV",t[t.DL=28]="DL",t[t.DT=29]="DT",t[t.EM=30]="EM",t[t.EMBED=31]="EMBED",t[t.FIELDSET=32]="FIELDSET",t[t.FIGCAPTION=33]="FIGCAPTION",t[t.FIGURE=34]="FIGURE",t[t.FONT=35]="FONT",t[t.FOOTER=36]="FOOTER",t[t.FOREIGN_OBJECT=37]="FOREIGN_OBJECT",t[t.FORM=38]="FORM",t[t.FRAME=39]="FRAME",t[t.FRAMESET=40]="FRAMESET",t[t.H1=41]="H1",t[t.H2=42]="H2",t[t.H3=43]="H3",t[t.H4=44]="H4",t[t.H5=45]="H5",t[t.H6=46]="H6",t[t.HEAD=47]="HEAD",t[t.HEADER=48]="HEADER",t[t.HGROUP=49]="HGROUP",t[t.HR=50]="HR",t[t.HTML=51]="HTML",t[t.I=52]="I",t[t.IMG=53]="IMG",t[t.IMAGE=54]="IMAGE",t[t.INPUT=55]="INPUT",t[t.IFRAME=56]="IFRAME",t[t.KEYGEN=57]="KEYGEN",t[t.LABEL=58]="LABEL",t[t.LI=59]="LI",t[t.LINK=60]="LINK",t[t.LISTING=61]="LISTING",t[t.MAIN=62]="MAIN",t[t.MALIGNMARK=63]="MALIGNMARK",t[t.MARQUEE=64]="MARQUEE",t[t.MATH=65]="MATH",t[t.MENU=66]="MENU",t[t.META=67]="META",t[t.MGLYPH=68]="MGLYPH",t[t.MI=69]="MI",t[t.MO=70]="MO",t[t.MN=71]="MN",t[t.MS=72]="MS",t[t.MTEXT=73]="MTEXT",t[t.NAV=74]="NAV",t[t.NOBR=75]="NOBR",t[t.NOFRAMES=76]="NOFRAMES",t[t.NOEMBED=77]="NOEMBED",t[t.NOSCRIPT=78]="NOSCRIPT",t[t.OBJECT=79]="OBJECT",t[t.OL=80]="OL",t[t.OPTGROUP=81]="OPTGROUP",t[t.OPTION=82]="OPTION",t[t.P=83]="P",t[t.PARAM=84]="PARAM",t[t.PLAINTEXT=85]="PLAINTEXT",t[t.PRE=86]="PRE",t[t.RB=87]="RB",t[t.RP=88]="RP",t[t.RT=89]="RT",t[t.RTC=90]="RTC",t[t.RUBY=91]="RUBY",t[t.S=92]="S",t[t.SCRIPT=93]="SCRIPT",t[t.SEARCH=94]="SEARCH",t[t.SECTION=95]="SECTION",t[t.SELECT=96]="SELECT",t[t.SOURCE=97]="SOURCE",t[t.SMALL=98]="SMALL",t[t.SPAN=99]="SPAN",t[t.STRIKE=100]="STRIKE",t[t.STRONG=101]="STRONG",t[t.STYLE=102]="STYLE",t[t.SUB=103]="SUB",t[t.SUMMARY=104]="SUMMARY",t[t.SUP=105]="SUP",t[t.TABLE=106]="TABLE",t[t.TBODY=107]="TBODY",t[t.TEMPLATE=108]="TEMPLATE",t[t.TEXTAREA=109]="TEXTAREA",t[t.TFOOT=110]="TFOOT",t[t.TD=111]="TD",t[t.TH=112]="TH",t[t.THEAD=113]="THEAD",t[t.TITLE=114]="TITLE",t[t.TR=115]="TR",t[t.TRACK=116]="TRACK",t[t.TT=117]="TT",t[t.U=118]="U",t[t.UL=119]="UL",t[t.SVG=120]="SVG",t[t.VAR=121]="VAR",t[t.WBR=122]="WBR",t[t.XMP=123]="XMP"})(c||(c={}));const AT=new Map([[Z.A,c.A],[Z.ADDRESS,c.ADDRESS],[Z.ANNOTATION_XML,c.ANNOTATION_XML],[Z.APPLET,c.APPLET],[Z.AREA,c.AREA],[Z.ARTICLE,c.ARTICLE],[Z.ASIDE,c.ASIDE],[Z.B,c.B],[Z.BASE,c.BASE],[Z.BASEFONT,c.BASEFONT],[Z.BGSOUND,c.BGSOUND],[Z.BIG,c.BIG],[Z.BLOCKQUOTE,c.BLOCKQUOTE],[Z.BODY,c.BODY],[Z.BR,c.BR],[Z.BUTTON,c.BUTTON],[Z.CAPTION,c.CAPTION],[Z.CENTER,c.CENTER],[Z.CODE,c.CODE],[Z.COL,c.COL],[Z.COLGROUP,c.COLGROUP],[Z.DD,c.DD],[Z.DESC,c.DESC],[Z.DETAILS,c.DETAILS],[Z.DIALOG,c.DIALOG],[Z.DIR,c.DIR],[Z.DIV,c.DIV],[Z.DL,c.DL],[Z.DT,c.DT],[Z.EM,c.EM],[Z.EMBED,c.EMBED],[Z.FIELDSET,c.FIELDSET],[Z.FIGCAPTION,c.FIGCAPTION],[Z.FIGURE,c.FIGURE],[Z.FONT,c.FONT],[Z.FOOTER,c.FOOTER],[Z.FOREIGN_OBJECT,c.FOREIGN_OBJECT],[Z.FORM,c.FORM],[Z.FRAME,c.FRAME],[Z.FRAMESET,c.FRAMESET],[Z.H1,c.H1],[Z.H2,c.H2],[Z.H3,c.H3],[Z.H4,c.H4],[Z.H5,c.H5],[Z.H6,c.H6],[Z.HEAD,c.HEAD],[Z.HEADER,c.HEADER],[Z.HGROUP,c.HGROUP],[Z.HR,c.HR],[Z.HTML,c.HTML],[Z.I,c.I],[Z.IMG,c.IMG],[Z.IMAGE,c.IMAGE],[Z.INPUT,c.INPUT],[Z.IFRAME,c.IFRAME],[Z.KEYGEN,c.KEYGEN],[Z.LABEL,c.LABEL],[Z.LI,c.LI],[Z.LINK,c.LINK],[Z.LISTING,c.LISTING],[Z.MAIN,c.MAIN],[Z.MALIGNMARK,c.MALIGNMARK],[Z.MARQUEE,c.MARQUEE],[Z.MATH,c.MATH],[Z.MENU,c.MENU],[Z.META,c.META],[Z.MGLYPH,c.MGLYPH],[Z.MI,c.MI],[Z.MO,c.MO],[Z.MN,c.MN],[Z.MS,c.MS],[Z.MTEXT,c.MTEXT],[Z.NAV,c.NAV],[Z.NOBR,c.NOBR],[Z.NOFRAMES,c.NOFRAMES],[Z.NOEMBED,c.NOEMBED],[Z.NOSCRIPT,c.NOSCRIPT],[Z.OBJECT,c.OBJECT],[Z.OL,c.OL],[Z.OPTGROUP,c.OPTGROUP],[Z.OPTION,c.OPTION],[Z.P,c.P],[Z.PARAM,c.PARAM],[Z.PLAINTEXT,c.PLAINTEXT],[Z.PRE,c.PRE],[Z.RB,c.RB],[Z.RP,c.RP],[Z.RT,c.RT],[Z.RTC,c.RTC],[Z.RUBY,c.RUBY],[Z.S,c.S],[Z.SCRIPT,c.SCRIPT],[Z.SEARCH,c.SEARCH],[Z.SECTION,c.SECTION],[Z.SELECT,c.SELECT],[Z.SOURCE,c.SOURCE],[Z.SMALL,c.SMALL],[Z.SPAN,c.SPAN],[Z.STRIKE,c.STRIKE],[Z.STRONG,c.STRONG],[Z.STYLE,c.STYLE],[Z.SUB,c.SUB],[Z.SUMMARY,c.SUMMARY],[Z.SUP,c.SUP],[Z.TABLE,c.TABLE],[Z.TBODY,c.TBODY],[Z.TEMPLATE,c.TEMPLATE],[Z.TEXTAREA,c.TEXTAREA],[Z.TFOOT,c.TFOOT],[Z.TD,c.TD],[Z.TH,c.TH],[Z.THEAD,c.THEAD],[Z.TITLE,c.TITLE],[Z.TR,c.TR],[Z.TRACK,c.TRACK],[Z.TT,c.TT],[Z.U,c.U],[Z.UL,c.UL],[Z.SVG,c.SVG],[Z.VAR,c.VAR],[Z.WBR,c.WBR],[Z.XMP,c.XMP]]);function Xl(t){var e;return(e=AT.get(t))!==null&&e!==void 0?e:c.UNKNOWN}const ve=c,yT={[pe.HTML]:new Set([ve.ADDRESS,ve.APPLET,ve.AREA,ve.ARTICLE,ve.ASIDE,ve.BASE,ve.BASEFONT,ve.BGSOUND,ve.BLOCKQUOTE,ve.BODY,ve.BR,ve.BUTTON,ve.CAPTION,ve.CENTER,ve.COL,ve.COLGROUP,ve.DD,ve.DETAILS,ve.DIR,ve.DIV,ve.DL,ve.DT,ve.EMBED,ve.FIELDSET,ve.FIGCAPTION,ve.FIGURE,ve.FOOTER,ve.FORM,ve.FRAME,ve.FRAMESET,ve.H1,ve.H2,ve.H3,ve.H4,ve.H5,ve.H6,ve.HEAD,ve.HEADER,ve.HGROUP,ve.HR,ve.HTML,ve.IFRAME,ve.IMG,ve.INPUT,ve.LI,ve.LINK,ve.LISTING,ve.MAIN,ve.MARQUEE,ve.MENU,ve.META,ve.NAV,ve.NOEMBED,ve.NOFRAMES,ve.NOSCRIPT,ve.OBJECT,ve.OL,ve.P,ve.PARAM,ve.PLAINTEXT,ve.PRE,ve.SCRIPT,ve.SECTION,ve.SELECT,ve.SOURCE,ve.STYLE,ve.SUMMARY,ve.TABLE,ve.TBODY,ve.TD,ve.TEMPLATE,ve.TEXTAREA,ve.TFOOT,ve.TH,ve.THEAD,ve.TITLE,ve.TR,ve.TRACK,ve.UL,ve.WBR,ve.XMP]),[pe.MATHML]:new Set([ve.MI,ve.MO,ve.MN,ve.MS,ve.MTEXT,ve.ANNOTATION_XML]),[pe.SVG]:new Set([ve.TITLE,ve.FOREIGN_OBJECT,ve.DESC]),[pe.XLINK]:new Set,[pe.XML]:new Set,[pe.XMLNS]:new Set},Rd=new Set([ve.H1,ve.H2,ve.H3,ve.H4,ve.H5,ve.H6]),NT=new Set([Z.STYLE,Z.SCRIPT,Z.XMP,Z.IFRAME,Z.NOEMBED,Z.NOFRAMES,Z.PLAINTEXT]);function ST(t,e){return NT.has(t)||e&&t===Z.NOSCRIPT}var x;(function(t){t[t.DATA=0]="DATA",t[t.RCDATA=1]="RCDATA",t[t.RAWTEXT=2]="RAWTEXT",t[t.SCRIPT_DATA=3]="SCRIPT_DATA",t[t.PLAINTEXT=4]="PLAINTEXT",t[t.TAG_OPEN=5]="TAG_OPEN",t[t.END_TAG_OPEN=6]="END_TAG_OPEN",t[t.TAG_NAME=7]="TAG_NAME",t[t.RCDATA_LESS_THAN_SIGN=8]="RCDATA_LESS_THAN_SIGN",t[t.RCDATA_END_TAG_OPEN=9]="RCDATA_END_TAG_OPEN",t[t.RCDATA_END_TAG_NAME=10]="RCDATA_END_TAG_NAME",t[t.RAWTEXT_LESS_THAN_SIGN=11]="RAWTEXT_LESS_THAN_SIGN",t[t.RAWTEXT_END_TAG_OPEN=12]="RAWTEXT_END_TAG_OPEN",t[t.RAWTEXT_END_TAG_NAME=13]="RAWTEXT_END_TAG_NAME",t[t.SCRIPT_DATA_LESS_THAN_SIGN=14]="SCRIPT_DATA_LESS_THAN_SIGN",t[t.SCRIPT_DATA_END_TAG_OPEN=15]="SCRIPT_DATA_END_TAG_OPEN",t[t.SCRIPT_DATA_END_TAG_NAME=16]="SCRIPT_DATA_END_TAG_NAME",t[t.SCRIPT_DATA_ESCAPE_START=17]="SCRIPT_DATA_ESCAPE_START",t[t.SCRIPT_DATA_ESCAPE_START_DASH=18]="SCRIPT_DATA_ESCAPE_START_DASH",t[t.SCRIPT_DATA_ESCAPED=19]="SCRIPT_DATA_ESCAPED",t[t.SCRIPT_DATA_ESCAPED_DASH=20]="SCRIPT_DATA_ESCAPED_DASH",t[t.SCRIPT_DATA_ESCAPED_DASH_DASH=21]="SCRIPT_DATA_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN=22]="SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_OPEN=23]="SCRIPT_DATA_ESCAPED_END_TAG_OPEN",t[t.SCRIPT_DATA_ESCAPED_END_TAG_NAME=24]="SCRIPT_DATA_ESCAPED_END_TAG_NAME",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_START=25]="SCRIPT_DATA_DOUBLE_ESCAPE_START",t[t.SCRIPT_DATA_DOUBLE_ESCAPED=26]="SCRIPT_DATA_DOUBLE_ESCAPED",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH=27]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH=28]="SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH",t[t.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN=29]="SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN",t[t.SCRIPT_DATA_DOUBLE_ESCAPE_END=30]="SCRIPT_DATA_DOUBLE_ESCAPE_END",t[t.BEFORE_ATTRIBUTE_NAME=31]="BEFORE_ATTRIBUTE_NAME",t[t.ATTRIBUTE_NAME=32]="ATTRIBUTE_NAME",t[t.AFTER_ATTRIBUTE_NAME=33]="AFTER_ATTRIBUTE_NAME",t[t.BEFORE_ATTRIBUTE_VALUE=34]="BEFORE_ATTRIBUTE_VALUE",t[t.ATTRIBUTE_VALUE_DOUBLE_QUOTED=35]="ATTRIBUTE_VALUE_DOUBLE_QUOTED",t[t.ATTRIBUTE_VALUE_SINGLE_QUOTED=36]="ATTRIBUTE_VALUE_SINGLE_QUOTED",t[t.ATTRIBUTE_VALUE_UNQUOTED=37]="ATTRIBUTE_VALUE_UNQUOTED",t[t.AFTER_ATTRIBUTE_VALUE_QUOTED=38]="AFTER_ATTRIBUTE_VALUE_QUOTED",t[t.SELF_CLOSING_START_TAG=39]="SELF_CLOSING_START_TAG",t[t.BOGUS_COMMENT=40]="BOGUS_COMMENT",t[t.MARKUP_DECLARATION_OPEN=41]="MARKUP_DECLARATION_OPEN",t[t.COMMENT_START=42]="COMMENT_START",t[t.COMMENT_START_DASH=43]="COMMENT_START_DASH",t[t.COMMENT=44]="COMMENT",t[t.COMMENT_LESS_THAN_SIGN=45]="COMMENT_LESS_THAN_SIGN",t[t.COMMENT_LESS_THAN_SIGN_BANG=46]="COMMENT_LESS_THAN_SIGN_BANG",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH=47]="COMMENT_LESS_THAN_SIGN_BANG_DASH",t[t.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH=48]="COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH",t[t.COMMENT_END_DASH=49]="COMMENT_END_DASH",t[t.COMMENT_END=50]="COMMENT_END",t[t.COMMENT_END_BANG=51]="COMMENT_END_BANG",t[t.DOCTYPE=52]="DOCTYPE",t[t.BEFORE_DOCTYPE_NAME=53]="BEFORE_DOCTYPE_NAME",t[t.DOCTYPE_NAME=54]="DOCTYPE_NAME",t[t.AFTER_DOCTYPE_NAME=55]="AFTER_DOCTYPE_NAME",t[t.AFTER_DOCTYPE_PUBLIC_KEYWORD=56]="AFTER_DOCTYPE_PUBLIC_KEYWORD",t[t.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER=57]="BEFORE_DOCTYPE_PUBLIC_IDENTIFIER",t[t.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED=58]="DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED=59]="DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_PUBLIC_IDENTIFIER=60]="AFTER_DOCTYPE_PUBLIC_IDENTIFIER",t[t.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS=61]="BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS",t[t.AFTER_DOCTYPE_SYSTEM_KEYWORD=62]="AFTER_DOCTYPE_SYSTEM_KEYWORD",t[t.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER=63]="BEFORE_DOCTYPE_SYSTEM_IDENTIFIER",t[t.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED=64]="DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED",t[t.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED=65]="DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED",t[t.AFTER_DOCTYPE_SYSTEM_IDENTIFIER=66]="AFTER_DOCTYPE_SYSTEM_IDENTIFIER",t[t.BOGUS_DOCTYPE=67]="BOGUS_DOCTYPE",t[t.CDATA_SECTION=68]="CDATA_SECTION",t[t.CDATA_SECTION_BRACKET=69]="CDATA_SECTION_BRACKET",t[t.CDATA_SECTION_END=70]="CDATA_SECTION_END",t[t.CHARACTER_REFERENCE=71]="CHARACTER_REFERENCE",t[t.AMBIGUOUS_AMPERSAND=72]="AMBIGUOUS_AMPERSAND"})(x||(x={}));const $n={DATA:x.DATA,RCDATA:x.RCDATA,RAWTEXT:x.RAWTEXT,SCRIPT_DATA:x.SCRIPT_DATA,PLAINTEXT:x.PLAINTEXT,CDATA_SECTION:x.CDATA_SECTION};function wT(t){return t>=w.DIGIT_0&&t<=w.DIGIT_9}function _o(t){return t>=w.LATIN_CAPITAL_A&&t<=w.LATIN_CAPITAL_Z}function IT(t){return t>=w.LATIN_SMALL_A&&t<=w.LATIN_SMALL_Z}function Ps(t){return IT(t)||_o(t)}function w0(t){return Ps(t)||wT(t)}function Du(t){return t+32}function Qm(t){return t===w.SPACE||t===w.LINE_FEED||t===w.TABULATION||t===w.FORM_FEED}function I0(t){return Qm(t)||t===w.SOLIDUS||t===w.GREATER_THAN_SIGN}function CT(t){return t===w.NULL?ne.nullCharacterReference:t>1114111?ne.characterReferenceOutsideUnicodeRange:Gm(t)?ne.surrogateCharacterReference:Vm(t)?ne.noncharacterCharacterReference:Km(t)||t===w.CARRIAGE_RETURN?ne.controlCharacterReference:null}class LT{constructor(e,n){this.options=e,this.handler=n,this.paused=!1,this.inLoop=!1,this.inForeignNode=!1,this.lastStartTagName="",this.active=!1,this.state=x.DATA,this.returnState=x.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new fT(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new _T(hT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(ne.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(ne.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=CT(r);s&&this._err(s,1)}}:void 0)}_err(e,n=0){var r,s;(s=(r=this.handler).onParseError)===null||s===void 0||s.call(r,this.preprocessor.getError(e,n))}getCurrentLocation(e){return this.options.sourceCodeLocationInfo?{startLine:this.preprocessor.line,startCol:this.preprocessor.col-e,startOffset:this.preprocessor.offset-e,endLine:-1,endCol:-1,endOffset:-1}:null}_runParsingLoop(){if(!this.inLoop){for(this.inLoop=!0;this.active&&!this.paused;){this.consumedAfterSnapshot=0;const e=this._consume();this._ensureHibernation()||this._callState(e)}this.inLoop=!1}}pause(){this.paused=!0}resume(e){if(!this.paused)throw new Error("Parser was already resumed");this.paused=!1,!this.inLoop&&(this._runParsingLoop(),this.paused||e==null||e())}write(e,n,r){this.active=!0,this.preprocessor.write(e,n),this._runParsingLoop(),this.paused||r==null||r()}insertHtmlAtCurrentPos(e){this.active=!0,this.preprocessor.insertHtmlAtCurrentPos(e),this._runParsingLoop()}_ensureHibernation(){return this.preprocessor.endOfChunkHit?(this.preprocessor.retreat(this.consumedAfterSnapshot),this.consumedAfterSnapshot=0,this.active=!1,!0):!1}_consume(){return this.consumedAfterSnapshot++,this.preprocessor.advance()}_advanceBy(e){this.consumedAfterSnapshot+=e;for(let n=0;n<e;n++)this.preprocessor.advance()}_consumeSequenceIfMatch(e,n){return this.preprocessor.startsWith(e,n)?(this._advanceBy(e.length-1),!0):!1}_createStartTagToken(){this.currentToken={type:lt.START_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:lt.END_TAG,tagName:"",tagID:c.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:lt.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:lt.DOCTYPE,name:e,forceQuirks:!1,publicId:null,systemId:null,location:this.currentLocation}}_createCharacterToken(e,n){this.currentCharacterToken={type:e,chars:n,location:this.currentLocation}}_createAttr(e){this.currentAttr={name:e,value:""},this.currentLocation=this.getCurrentLocation(0)}_leaveAttrName(){var e,n;const r=this.currentToken;if(Xm(r,this.currentAttr.name)===null){if(r.attrs.push(this.currentAttr),r.location&&this.currentLocation){const s=(e=(n=r.location).attrs)!==null&&e!==void 0?e:n.attrs=Object.create(null);s[this.currentAttr.name]=this.currentLocation,this._leaveAttrValue()}}else this._err(ne.duplicateAttribute)}_leaveAttrValue(){this.currentLocation&&(this.currentLocation.endLine=this.preprocessor.line,this.currentLocation.endCol=this.preprocessor.col,this.currentLocation.endOffset=this.preprocessor.offset)}prepareToken(e){this._emitCurrentCharacterToken(e.location),this.currentToken=null,e.location&&(e.location.endLine=this.preprocessor.line,e.location.endCol=this.preprocessor.col+1,e.location.endOffset=this.preprocessor.offset+1),this.currentLocation=this.getCurrentLocation(-1)}emitCurrentTagToken(){const e=this.currentToken;this.prepareToken(e),e.tagID=Xl(e.tagName),e.type===lt.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(ne.endTagWithAttributes),e.selfClosing&&this._err(ne.endTagWithTrailingSolidus),this.handler.onEndTag(e)),this.preprocessor.dropParsedChunk()}emitCurrentComment(e){this.prepareToken(e),this.handler.onComment(e),this.preprocessor.dropParsedChunk()}emitCurrentDoctype(e){this.prepareToken(e),this.handler.onDoctype(e),this.preprocessor.dropParsedChunk()}_emitCurrentCharacterToken(e){if(this.currentCharacterToken){switch(e&&this.currentCharacterToken.location&&(this.currentCharacterToken.location.endLine=e.startLine,this.currentCharacterToken.location.endCol=e.startCol,this.currentCharacterToken.location.endOffset=e.startOffset),this.currentCharacterToken.type){case lt.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case lt.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case lt.WHITESPACE_CHARACTER:{this.handler.onWhitespaceCharacter(this.currentCharacterToken);break}}this.currentCharacterToken=null}}_emitEOFToken(){const e=this.getCurrentLocation(0);e&&(e.endLine=e.startLine,e.endCol=e.startCol,e.endOffset=e.startOffset),this._emitCurrentCharacterToken(e),this.handler.onEof({type:lt.EOF,location:e}),this.active=!1}_appendCharToCurrentCharacterToken(e,n){if(this.currentCharacterToken)if(this.currentCharacterToken.type===e){this.currentCharacterToken.chars+=n;return}else this.currentLocation=this.getCurrentLocation(0),this._emitCurrentCharacterToken(this.currentLocation),this.preprocessor.dropParsedChunk();this._createCharacterToken(e,n)}_emitCodePoint(e){const n=Qm(e)?lt.WHITESPACE_CHARACTER:e===w.NULL?lt.NULL_CHARACTER:lt.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(lt.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=x.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?vs.Attribute:vs.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===x.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===x.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case x.DATA:{this._stateData(e);break}case x.RCDATA:{this._stateRcdata(e);break}case x.RAWTEXT:{this._stateRawtext(e);break}case x.SCRIPT_DATA:{this._stateScriptData(e);break}case x.PLAINTEXT:{this._statePlaintext(e);break}case x.TAG_OPEN:{this._stateTagOpen(e);break}case x.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case x.TAG_NAME:{this._stateTagName(e);break}case x.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case x.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case x.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case x.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case x.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case x.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case x.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case x.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case x.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case x.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case x.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case x.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case x.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case x.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case x.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case x.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case x.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case x.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case x.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case x.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case x.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case x.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case x.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case x.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case x.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case x.BOGUS_COMMENT:{this._stateBogusComment(e);break}case x.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case x.COMMENT_START:{this._stateCommentStart(e);break}case x.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case x.COMMENT:{this._stateComment(e);break}case x.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case x.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case x.COMMENT_END:{this._stateCommentEnd(e);break}case x.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case x.DOCTYPE:{this._stateDoctype(e);break}case x.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case x.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case x.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case x.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case x.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case x.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case x.CDATA_SECTION:{this._stateCdataSection(e);break}case x.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case x.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case x.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case x.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=x.TAG_OPEN;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitCodePoint(e);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case w.AMPERSAND:{this._startCharacterReference();break}case w.LESS_THAN_SIGN:{this.state=x.RCDATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case w.LESS_THAN_SIGN:{this.state=x.RAWTEXT_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case w.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(Ps(e))this._createStartTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case w.EXCLAMATION_MARK:{this.state=x.MARKUP_DECLARATION_OPEN;break}case w.SOLIDUS:{this.state=x.END_TAG_OPEN;break}case w.QUESTION_MARK:{this._err(ne.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e);break}case w.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=x.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(Ps(e))this._createEndTagToken(),this.state=x.TAG_NAME,this._stateTagName(e);else switch(e){case w.GREATER_THAN_SIGN:{this._err(ne.missingEndTagName),this.state=x.DATA;break}case w.EOF:{this._err(ne.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(ne.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this.state=x.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.tagName+=Ht;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(_o(e)?Du(e):e)}}_stateRcdataLessThanSign(e){e===w.SOLIDUS?this.state=x.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){Ps(e)?(this.state=x.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=x.RCDATA,this._stateRcdata(e))}handleSpecialEndTag(e){if(!this.preprocessor.startsWith(this.lastStartTagName,!1))return!this._ensureHibernation();this._createEndTagToken();const n=this.currentToken;switch(n.tagName=this.lastStartTagName,this.preprocessor.peek(this.lastStartTagName.length)){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=x.BEFORE_ATTRIBUTE_NAME,!1;case w.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=x.SELF_CLOSING_START_TAG,!1;case w.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=x.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===w.SOLIDUS?this.state=x.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){Ps(e)?(this.state=x.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case w.SOLIDUS:{this.state=x.SCRIPT_DATA_END_TAG_OPEN;break}case w.EXCLAMATION_MARK:{this.state=x.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=x.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){Ps(e)?(this.state=x.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===w.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===w.HYPHEN_MINUS?(this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=x.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(Ht);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case w.GREATER_THAN_SIGN:{this.state=x.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_ESCAPED,this._emitChars(Ht);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===w.SOLIDUS?this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:Ps(e)?(this._emitChars("<"),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){Ps(e)?(this.state=x.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&I0(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this._emitChars(Ht);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ht);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case w.HYPHEN_MINUS:{this._emitChars("-");break}case w.LESS_THAN_SIGN:{this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case w.GREATER_THAN_SIGN:{this.state=x.SCRIPT_DATA,this._emitChars(">");break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(Ht);break}case w.EOF:{this._err(ne.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===w.SOLIDUS?(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Bn.SCRIPT,!1)&&I0(this.preprocessor.peek(Bn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Bn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=x.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=x.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._err(ne.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=x.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:case w.SOLIDUS:case w.GREATER_THAN_SIGN:case w.EOF:{this._leaveAttrName(),this.state=x.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case w.EQUALS_SIGN:{this._leaveAttrName(),this.state=x.BEFORE_ATTRIBUTE_VALUE;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:{this._err(ne.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.name+=Ht;break}default:this.currentAttr.name+=String.fromCodePoint(_o(e)?Du(e):e)}}_stateAfterAttributeName(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.SOLIDUS:{this.state=x.SELF_CLOSING_START_TAG;break}case w.EQUALS_SIGN:{this.state=x.BEFORE_ATTRIBUTE_VALUE;break}case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=x.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{this.state=x.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this.state=x.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingAttributeValue),this.state=x.DATA,this.emitCurrentTagToken();break}default:this.state=x.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case w.QUOTATION_MARK:{this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case w.APOSTROPHE:{this.state=x.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break}case w.AMPERSAND:{this._startCharacterReference();break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),this.currentAttr.value+=Ht;break}case w.QUOTATION_MARK:case w.APOSTROPHE:case w.LESS_THAN_SIGN:case w.EQUALS_SIGN:case w.GRAVE_ACCENT:{this._err(ne.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this._leaveAttrValue(),this.state=x.BEFORE_ATTRIBUTE_NAME;break}case w.SOLIDUS:{this._leaveAttrValue(),this.state=x.SELF_CLOSING_START_TAG;break}case w.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=x.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBetweenAttributes),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case w.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=x.DATA,this.emitCurrentTagToken();break}case w.EOF:{this._err(ne.eofInTag),this._emitEOFToken();break}default:this._err(ne.unexpectedSolidusInTag),this.state=x.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentComment(n);break}case w.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ht;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Bn.DASH_DASH,!0)?(this._createCommentToken(Bn.DASH_DASH.length+1),this.state=x.COMMENT_START):this._consumeSequenceIfMatch(Bn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Bn.DOCTYPE.length+1),this.state=x.DOCTYPE):this._consumeSequenceIfMatch(Bn.CDATA_START,!0)?this.inForeignNode?this.state=x.CDATA_SECTION:(this._err(ne.cdataInHtmlContent),this._createCommentToken(Bn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=x.BOGUS_COMMENT):this._ensureHibernation()||(this._err(ne.incorrectlyOpenedComment),this._createCommentToken(2),this.state=x.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case w.HYPHEN_MINUS:{this.state=x.COMMENT_START_DASH;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=x.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=x.COMMENT_END;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptClosingOfEmptyComment),this.state=x.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=x.COMMENT_END_DASH;break}case w.LESS_THAN_SIGN:{n.data+="<",this.state=x.COMMENT_LESS_THAN_SIGN;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.data+=Ht;break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case w.EXCLAMATION_MARK:{n.data+="!",this.state=x.COMMENT_LESS_THAN_SIGN_BANG;break}case w.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=x.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===w.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=x.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===w.HYPHEN_MINUS?this.state=x.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=x.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==w.GREATER_THAN_SIGN&&e!==w.EOF&&this._err(ne.nestedComment),this.state=x.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{this.state=x.COMMENT_END;break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentComment(n);break}case w.EXCLAMATION_MARK:{this.state=x.COMMENT_END_BANG;break}case w.HYPHEN_MINUS:{n.data+="-";break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=x.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case w.HYPHEN_MINUS:{n.data+="--!",this.state=x.COMMENT_END_DASH;break}case w.GREATER_THAN_SIGN:{this._err(ne.incorrectlyClosedComment),this.state=x.DATA,this.emitCurrentComment(n);break}case w.EOF:{this._err(ne.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=x.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case w.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingWhitespaceBeforeDoctypeName),this.state=x.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(_o(e))this._createDoctypeToken(String.fromCharCode(Du(e))),this.state=x.DOCTYPE_NAME;else switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.NULL:{this._err(ne.unexpectedNullCharacter),this._createDoctypeToken(Ht),this.state=x.DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._createDoctypeToken(String.fromCodePoint(e)),this.state=x.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.AFTER_DOCTYPE_NAME;break}case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.name+=Ht;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(_o(e)?Du(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Bn.PUBLIC,!1)?this.state=x.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Bn.SYSTEM,!1)?this.state=x.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(ne.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.publicId="",this.state=x.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ht;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateDoctypePublicIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=x.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.publicId+=Ht;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.publicId+=String.fromCodePoint(e)}}_stateAfterDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case w.GREATER_THAN_SIGN:{this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.QUOTATION_MARK:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:{this.state=x.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.QUOTATION_MARK:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{this._err(ne.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.QUOTATION_MARK:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case w.APOSTROPHE:{n.systemId="",this.state=x.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case w.GREATER_THAN_SIGN:{this._err(ne.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.DATA,this.emitCurrentDoctype(n);break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case w.QUOTATION_MARK:{this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ht;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateDoctypeSystemIdentifierSingleQuoted(e){const n=this.currentToken;switch(e){case w.APOSTROPHE:{this.state=x.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case w.NULL:{this._err(ne.unexpectedNullCharacter),n.systemId+=Ht;break}case w.GREATER_THAN_SIGN:{this._err(ne.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.systemId+=String.fromCodePoint(e)}}_stateAfterDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case w.SPACE:case w.LINE_FEED:case w.TABULATION:case w.FORM_FEED:break;case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.EOF:{this._err(ne.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(ne.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=x.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case w.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=x.DATA;break}case w.NULL:{this._err(ne.unexpectedNullCharacter);break}case w.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case w.RIGHT_SQUARE_BRACKET:{this.state=x.CDATA_SECTION_BRACKET;break}case w.EOF:{this._err(ne.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===w.RIGHT_SQUARE_BRACKET?this.state=x.CDATA_SECTION_END:(this._emitChars("]"),this.state=x.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case w.GREATER_THAN_SIGN:{this.state=x.DATA;break}case w.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=x.CDATA_SECTION,this._stateCdataSection(e)}}_stateCharacterReference(){let e=this.entityDecoder.write(this.preprocessor.html,this.preprocessor.pos);if(e<0)if(this.preprocessor.lastChunkWritten)e=this.entityDecoder.end();else{this.active=!1,this.preprocessor.pos=this.preprocessor.html.length-1,this.consumedAfterSnapshot=0,this.preprocessor.endOfChunkHit=!0;return}e===0?(this.preprocessor.pos=this.entityStartPos,this._flushCodePointConsumedAsCharacterReference(w.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&w0(this.preprocessor.peek(1))?x.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){w0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===w.SEMICOLON&&this._err(ne.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const Zm=new Set([c.DD,c.DT,c.LI,c.OPTGROUP,c.OPTION,c.P,c.RB,c.RP,c.RT,c.RTC]),C0=new Set([...Zm,c.CAPTION,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]),yl=new Set([c.APPLET,c.CAPTION,c.HTML,c.MARQUEE,c.OBJECT,c.TABLE,c.TD,c.TEMPLATE,c.TH]),OT=new Set([...yl,c.OL,c.UL]),xT=new Set([...yl,c.BUTTON]),L0=new Set([c.ANNOTATION_XML,c.MI,c.MN,c.MO,c.MS,c.MTEXT]),O0=new Set([c.DESC,c.FOREIGN_OBJECT,c.TITLE]),RT=new Set([c.TR,c.TEMPLATE,c.HTML]),DT=new Set([c.TBODY,c.TFOOT,c.THEAD,c.TEMPLATE,c.HTML]),kT=new Set([c.TABLE,c.TEMPLATE,c.HTML]),PT=new Set([c.TD,c.TH]);class MT{get currentTmplContentOrNode(){return this._isInTemplate()?this.treeAdapter.getTemplateContent(this.current):this.current}constructor(e,n,r){this.treeAdapter=n,this.handler=r,this.items=[],this.tagIDs=[],this.stackTop=-1,this.tmplCount=0,this.currentTagId=c.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===c.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===pe.HTML}_updateCurrentElement(){this.current=this.items[this.stackTop],this.currentTagId=this.tagIDs[this.stackTop]}push(e,n){this.stackTop++,this.items[this.stackTop]=e,this.current=e,this.tagIDs[this.stackTop]=n,this.currentTagId=n,this._isInTemplate()&&this.tmplCount++,this.handler.onItemPush(e,n,!0)}pop(){const e=this.current;this.tmplCount>0&&this._isInTemplate()&&this.tmplCount--,this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!0)}replace(e,n){const r=this._indexOf(e);this.items[r]=n,r===this.stackTop&&(this.current=n)}insertAfter(e,n,r){const s=this._indexOf(e)+1;this.items.splice(s,0,n),this.tagIDs.splice(s,0,r),this.stackTop++,s===this.stackTop&&this._updateCurrentElement(),this.current&&this.currentTagId!==void 0&&this.handler.onItemPush(this.current,this.currentTagId,s===this.stackTop)}popUntilTagNamePopped(e){let n=this.stackTop+1;do n=this.tagIDs.lastIndexOf(e,n-1);while(n>0&&this.treeAdapter.getNamespaceURI(this.items[n])!==pe.HTML);this.shortenToLength(Math.max(n,0))}shortenToLength(e){for(;this.stackTop>=e;){const n=this.current;this.tmplCount>0&&this._isInTemplate()&&(this.tmplCount-=1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(n,this.stackTop<e)}}popUntilElementPopped(e){const n=this._indexOf(e);this.shortenToLength(Math.max(n,0))}popUntilPopped(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(Math.max(r,0))}popUntilNumberedHeaderPopped(){this.popUntilPopped(Rd,pe.HTML)}popUntilTableCellPopped(){this.popUntilPopped(PT,pe.HTML)}popAllUpToHtmlElement(){this.tmplCount=0,this.shortenToLength(1)}_indexOfTagNames(e,n){for(let r=this.stackTop;r>=0;r--)if(e.has(this.tagIDs[r])&&this.treeAdapter.getNamespaceURI(this.items[r])===n)return r;return-1}clearBackTo(e,n){const r=this._indexOfTagNames(e,n);this.shortenToLength(r+1)}clearBackToTableContext(){this.clearBackTo(kT,pe.HTML)}clearBackToTableBodyContext(){this.clearBackTo(DT,pe.HTML)}clearBackToTableRowContext(){this.clearBackTo(RT,pe.HTML)}remove(e){const n=this._indexOf(e);n>=0&&(n===this.stackTop?this.pop():(this.items.splice(n,1),this.tagIDs.splice(n,1),this.stackTop--,this._updateCurrentElement(),this.handler.onItemPop(e,!1)))}tryPeekProperlyNestedBodyElement(){return this.stackTop>=1&&this.tagIDs[1]===c.BODY?this.items[1]:null}contains(e){return this._indexOf(e)>-1}getCommonAncestor(e){const n=this._indexOf(e)-1;return n>=0?this.items[n]:null}isRootHtmlElementCurrent(){return this.stackTop===0&&this.tagIDs[0]===c.HTML}hasInDynamicScope(e,n){for(let r=this.stackTop;r>=0;r--){const s=this.tagIDs[r];switch(this.treeAdapter.getNamespaceURI(this.items[r])){case pe.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case pe.SVG:{if(O0.has(s))return!1;break}case pe.MATHML:{if(L0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,yl)}hasInListItemScope(e){return this.hasInDynamicScope(e,OT)}hasInButtonScope(e){return this.hasInDynamicScope(e,xT)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case pe.HTML:{if(Rd.has(n))return!0;if(yl.has(n))return!1;break}case pe.SVG:{if(O0.has(n))return!1;break}case pe.MATHML:{if(L0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===pe.HTML)switch(this.tagIDs[n]){case e:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===pe.HTML)switch(this.tagIDs[e]){case c.TBODY:case c.THEAD:case c.TFOOT:return!0;case c.TABLE:case c.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===pe.HTML)switch(this.tagIDs[n]){case e:return!0;case c.OPTION:case c.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&Zm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&C0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&C0.has(this.currentTagId);)this.pop()}}const Fc=3;var Kr;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Kr||(Kr={}));const x0={type:Kr.Marker};class BT{constructor(e){this.treeAdapter=e,this.entries=[],this.bookmark=null}_getNoahArkConditionCandidates(e,n){const r=[],s=n.length,a=this.treeAdapter.getTagName(e),i=this.treeAdapter.getNamespaceURI(e);for(let o=0;o<this.entries.length;o++){const l=this.entries[o];if(l.type===Kr.Marker)break;const{element:d}=l;if(this.treeAdapter.getTagName(d)===a&&this.treeAdapter.getNamespaceURI(d)===i){const f=this.treeAdapter.getAttrList(d);f.length===s&&r.push({idx:o,attrs:f})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<Fc)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<Fc)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const o=r[i];o.attrs.every(l=>s.get(l.name)===l.value)&&(a+=1,a>=Fc&&this.entries.splice(o.idx,1))}}insertMarker(){this.entries.unshift(x0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Kr.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Kr.Element,element:e,token:n})}removeEntry(e){const n=this.entries.indexOf(e);n!==-1&&this.entries.splice(n,1)}clearToLastMarker(){const e=this.entries.indexOf(x0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Kr.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Kr.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Kr.Element&&n.element===e)}}const hs={createDocument(){return{nodeName:"#document",mode:cr.NO_QUIRKS,childNodes:[]}},createDocumentFragment(){return{nodeName:"#document-fragment",childNodes:[]}},createElement(t,e,n){return{nodeName:t,tagName:t,attrs:n,namespaceURI:e,childNodes:[],parentNode:null}},createCommentNode(t){return{nodeName:"#comment",data:t,parentNode:null}},createTextNode(t){return{nodeName:"#text",value:t,parentNode:null}},appendChild(t,e){t.childNodes.push(e),e.parentNode=t},insertBefore(t,e,n){const r=t.childNodes.indexOf(n);t.childNodes.splice(r,0,e),e.parentNode=t},setTemplateContent(t,e){t.content=e},getTemplateContent(t){return t.content},setDocumentType(t,e,n,r){const s=t.childNodes.find(a=>a.nodeName==="#documentType");if(s)s.name=e,s.publicId=n,s.systemId=r;else{const a={nodeName:"#documentType",name:e,publicId:n,systemId:r,parentNode:null};hs.appendChild(t,a)}},setDocumentMode(t,e){t.mode=e},getDocumentMode(t){return t.mode},detachNode(t){if(t.parentNode){const e=t.parentNode.childNodes.indexOf(t);t.parentNode.childNodes.splice(e,1),t.parentNode=null}},insertText(t,e){if(t.childNodes.length>0){const n=t.childNodes[t.childNodes.length-1];if(hs.isTextNode(n)){n.value+=e;return}}hs.appendChild(t,hs.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&hs.isTextNode(r)?r.value+=e:hs.insertBefore(t,hs.createTextNode(e),n)},adoptAttributes(t,e){const n=new Set(t.attrs.map(r=>r.name));for(let r=0;r<e.length;r++)n.has(e[r].name)||t.attrs.push(e[r])},getFirstChild(t){return t.childNodes[0]},getChildNodes(t){return t.childNodes},getParentNode(t){return t.parentNode},getAttrList(t){return t.attrs},getTagName(t){return t.tagName},getNamespaceURI(t){return t.namespaceURI},getTextNodeContent(t){return t.value},getCommentNodeContent(t){return t.data},getDocumentTypeNodeName(t){return t.name},getDocumentTypeNodePublicId(t){return t.publicId},getDocumentTypeNodeSystemId(t){return t.systemId},isTextNode(t){return t.nodeName==="#text"},isCommentNode(t){return t.nodeName==="#comment"},isDocumentTypeNode(t){return t.nodeName==="#documentType"},isElementNode(t){return Object.prototype.hasOwnProperty.call(t,"tagName")},setNodeSourceCodeLocation(t,e){t.sourceCodeLocation=e},getNodeSourceCodeLocation(t){return t.sourceCodeLocation},updateNodeSourceCodeLocation(t,e){t.sourceCodeLocation={...t.sourceCodeLocation,...e}}},Jm="html",FT="about:legacy-compat",UT="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",eg=["+//silmaril//dtd html pro v0r11 19970101//","-//as//dtd html 3.0 aswedit + extensions//","-//advasoft ltd//dtd html 3.0 aswedit + extensions//","-//ietf//dtd html 2.0 level 1//","-//ietf//dtd html 2.0 level 2//","-//ietf//dtd html 2.0 strict level 1//","-//ietf//dtd html 2.0 strict level 2//","-//ietf//dtd html 2.0 strict//","-//ietf//dtd html 2.0//","-//ietf//dtd html 2.1e//","-//ietf//dtd html 3.0//","-//ietf//dtd html 3.2 final//","-//ietf//dtd html 3.2//","-//ietf//dtd html 3//","-//ietf//dtd html level 0//","-//ietf//dtd html level 1//","-//ietf//dtd html level 2//","-//ietf//dtd html level 3//","-//ietf//dtd html strict level 0//","-//ietf//dtd html strict level 1//","-//ietf//dtd html strict level 2//","-//ietf//dtd html strict level 3//","-//ietf//dtd html strict//","-//ietf//dtd html//","-//metrius//dtd metrius presentational//","-//microsoft//dtd internet explorer 2.0 html strict//","-//microsoft//dtd internet explorer 2.0 html//","-//microsoft//dtd internet explorer 2.0 tables//","-//microsoft//dtd internet explorer 3.0 html strict//","-//microsoft//dtd internet explorer 3.0 html//","-//microsoft//dtd internet explorer 3.0 tables//","-//netscape comm. corp.//dtd html//","-//netscape comm. corp.//dtd strict html//","-//o'reilly and associates//dtd html 2.0//","-//o'reilly and associates//dtd html extended 1.0//","-//o'reilly and associates//dtd html extended relaxed 1.0//","-//sq//dtd html 2.0 hotmetal + extensions//","-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//","-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//","-//spyglass//dtd html 2.0 extended//","-//sun microsystems corp.//dtd hotjava html//","-//sun microsystems corp.//dtd hotjava strict html//","-//w3c//dtd html 3 1995-03-24//","-//w3c//dtd html 3.2 draft//","-//w3c//dtd html 3.2 final//","-//w3c//dtd html 3.2//","-//w3c//dtd html 3.2s draft//","-//w3c//dtd html 4.0 frameset//","-//w3c//dtd html 4.0 transitional//","-//w3c//dtd html experimental 19960712//","-//w3c//dtd html experimental 970421//","-//w3c//dtd w3 html//","-//w3o//dtd w3 html 3.0//","-//webtechs//dtd mozilla html 2.0//","-//webtechs//dtd mozilla html//"],HT=[...eg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],qT=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),tg=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],jT=[...tg,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function R0(t,e){return e.some(n=>t.startsWith(n))}function $T(t){return t.name===Jm&&t.publicId===null&&(t.systemId===null||t.systemId===FT)}function YT(t){if(t.name!==Jm)return cr.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===UT)return cr.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),qT.has(n))return cr.QUIRKS;let r=e===null?HT:eg;if(R0(n,r))return cr.QUIRKS;if(r=e===null?tg:jT,R0(n,r))return cr.LIMITED_QUIRKS}return cr.NO_QUIRKS}const D0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},zT="definitionurl",WT="definitionURL",GT=new Map(["attributeName","attributeType","baseFrequency","baseProfile","calcMode","clipPathUnits","diffuseConstant","edgeMode","filterUnits","glyphRef","gradientTransform","gradientUnits","kernelMatrix","kernelUnitLength","keyPoints","keySplines","keyTimes","lengthAdjust","limitingConeAngle","markerHeight","markerUnits","markerWidth","maskContentUnits","maskUnits","numOctaves","pathLength","patternContentUnits","patternTransform","patternUnits","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","refX","refY","repeatCount","repeatDur","requiredExtensions","requiredFeatures","specularConstant","specularExponent","spreadMethod","startOffset","stdDeviation","stitchTiles","surfaceScale","systemLanguage","tableValues","targetX","targetY","textLength","viewBox","viewTarget","xChannelSelector","yChannelSelector","zoomAndPan"].map(t=>[t.toLowerCase(),t])),KT=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:pe.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:pe.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:pe.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:pe.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:pe.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:pe.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:pe.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:pe.XML}],["xml:space",{prefix:"xml",name:"space",namespace:pe.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:pe.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:pe.XMLNS}]]),VT=new Map(["altGlyph","altGlyphDef","altGlyphItem","animateColor","animateMotion","animateTransform","clipPath","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","foreignObject","glyphRef","linearGradient","radialGradient","textPath"].map(t=>[t.toLowerCase(),t])),XT=new Set([c.B,c.BIG,c.BLOCKQUOTE,c.BODY,c.BR,c.CENTER,c.CODE,c.DD,c.DIV,c.DL,c.DT,c.EM,c.EMBED,c.H1,c.H2,c.H3,c.H4,c.H5,c.H6,c.HEAD,c.HR,c.I,c.IMG,c.LI,c.LISTING,c.MENU,c.META,c.NOBR,c.OL,c.P,c.PRE,c.RUBY,c.S,c.SMALL,c.SPAN,c.STRONG,c.STRIKE,c.SUB,c.SUP,c.TABLE,c.TT,c.U,c.UL,c.VAR]);function QT(t){const e=t.tagID;return e===c.FONT&&t.attrs.some(({name:r})=>r===ka.COLOR||r===ka.SIZE||r===ka.FACE)||XT.has(e)}function ng(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===zT){t.attrs[e].name=WT;break}}function rg(t){for(let e=0;e<t.attrs.length;e++){const n=GT.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function lh(t){for(let e=0;e<t.attrs.length;e++){const n=KT.get(t.attrs[e].name);n&&(t.attrs[e].prefix=n.prefix,t.attrs[e].name=n.name,t.attrs[e].namespace=n.namespace)}}function ZT(t){const e=VT.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Xl(t.tagName))}function JT(t,e){return e===pe.MATHML&&(t===c.MI||t===c.MO||t===c.MN||t===c.MS||t===c.MTEXT)}function e2(t,e,n){if(e===pe.MATHML&&t===c.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ka.ENCODING){const s=n[r].value.toLowerCase();return s===D0.TEXT_HTML||s===D0.APPLICATION_XML}}return e===pe.SVG&&(t===c.FOREIGN_OBJECT||t===c.DESC||t===c.TITLE)}function t2(t,e,n,r){return(!r||r===pe.HTML)&&e2(t,e,n)||(!r||r===pe.MATHML)&&JT(t,e)}const n2="hidden",r2=8,s2=3;var P;(function(t){t[t.INITIAL=0]="INITIAL",t[t.BEFORE_HTML=1]="BEFORE_HTML",t[t.BEFORE_HEAD=2]="BEFORE_HEAD",t[t.IN_HEAD=3]="IN_HEAD",t[t.IN_HEAD_NO_SCRIPT=4]="IN_HEAD_NO_SCRIPT",t[t.AFTER_HEAD=5]="AFTER_HEAD",t[t.IN_BODY=6]="IN_BODY",t[t.TEXT=7]="TEXT",t[t.IN_TABLE=8]="IN_TABLE",t[t.IN_TABLE_TEXT=9]="IN_TABLE_TEXT",t[t.IN_CAPTION=10]="IN_CAPTION",t[t.IN_COLUMN_GROUP=11]="IN_COLUMN_GROUP",t[t.IN_TABLE_BODY=12]="IN_TABLE_BODY",t[t.IN_ROW=13]="IN_ROW",t[t.IN_CELL=14]="IN_CELL",t[t.IN_SELECT=15]="IN_SELECT",t[t.IN_SELECT_IN_TABLE=16]="IN_SELECT_IN_TABLE",t[t.IN_TEMPLATE=17]="IN_TEMPLATE",t[t.AFTER_BODY=18]="AFTER_BODY",t[t.IN_FRAMESET=19]="IN_FRAMESET",t[t.AFTER_FRAMESET=20]="AFTER_FRAMESET",t[t.AFTER_AFTER_BODY=21]="AFTER_AFTER_BODY",t[t.AFTER_AFTER_FRAMESET=22]="AFTER_AFTER_FRAMESET"})(P||(P={}));const a2={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},sg=new Set([c.TABLE,c.TBODY,c.TFOOT,c.THEAD,c.TR]),k0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:hs,onParseError:null};class ag{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=P.INITIAL,this.originalInsertionMode=P.INITIAL,this.headElement=null,this.formElement=null,this.currentNotInHTML=!1,this.tmplInsertionModeStack=[],this.pendingCharacterTokens=[],this.hasNonWhitespacePendingCharacterToken=!1,this.framesetOk=!0,this.skipNextNewLine=!1,this.fosterParentingEnabled=!1,this.options={...k0,...e},this.treeAdapter=this.options.treeAdapter,this.onParseError=this.options.onParseError,this.onParseError&&(this.options.sourceCodeLocationInfo=!0),this.document=n??this.treeAdapter.createDocument(),this.tokenizer=new LT(this.options,this),this.activeFormattingElements=new BT(this.treeAdapter),this.fragmentContextID=r?Xl(this.treeAdapter.getTagName(r)):c.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new MT(this.document,this.treeAdapter,this)}static parse(e,n){const r=new this(n);return r.tokenizer.write(e,!0),r.document}static getFragmentParser(e,n){const r={...k0,...n};e??(e=r.treeAdapter.createElement(Z.TEMPLATE,pe.HTML,[]));const s=r.treeAdapter.createElement("documentmock",pe.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===c.TEMPLATE&&a.tmplInsertionModeStack.unshift(P.IN_TEMPLATE),a._initTokenizerForFragmentParsing(),a._insertFakeRootElement(),a._resetInsertionMode(),a._findFormInFragmentContext(),a}getFragment(){const e=this.treeAdapter.getFirstChild(this.document),n=this.treeAdapter.createDocumentFragment();return this._adoptNodes(e,n),n}_err(e,n,r){var s;if(!this.onParseError)return;const a=(s=e.location)!==null&&s!==void 0?s:a2,i={code:n,startLine:a.startLine,startCol:a.startCol,startOffset:a.startOffset,endLine:r?a.startLine:a.endLine,endCol:r?a.startCol:a.endCol,endOffset:r?a.startOffset:a.endOffset};this.onParseError(i)}onItemPush(e,n,r){var s,a;(a=(s=this.treeAdapter).onItemPush)===null||a===void 0||a.call(s,e),r&&this.openElements.stackTop>0&&this._setContextModes(e,n)}onItemPop(e,n){var r,s;if(this.options.sourceCodeLocationInfo&&this._setEndLocation(e,this.currentToken),(s=(r=this.treeAdapter).onItemPop)===null||s===void 0||s.call(r,e,this.openElements.current),n){let a,i;this.openElements.stackTop===0&&this.fragmentContext?(a=this.fragmentContext,i=this.fragmentContextID):{current:a,currentTagId:i}=this.openElements,this._setContextModes(a,i)}}_setContextModes(e,n){const r=e===this.document||e&&this.treeAdapter.getNamespaceURI(e)===pe.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,pe.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=P.TEXT}switchToPlaintextParsing(){this.insertionMode=P.TEXT,this.originalInsertionMode=P.IN_BODY,this.tokenizer.state=$n.PLAINTEXT}_getAdjustedCurrentElement(){return this.openElements.stackTop===0&&this.fragmentContext?this.fragmentContext:this.openElements.current}_findFormInFragmentContext(){let e=this.fragmentContext;for(;e;){if(this.treeAdapter.getTagName(e)===Z.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==pe.HTML))switch(this.fragmentContextID){case c.TITLE:case c.TEXTAREA:{this.tokenizer.state=$n.RCDATA;break}case c.STYLE:case c.XMP:case c.IFRAME:case c.NOEMBED:case c.NOFRAMES:case c.NOSCRIPT:{this.tokenizer.state=$n.RAWTEXT;break}case c.SCRIPT:{this.tokenizer.state=$n.SCRIPT_DATA;break}case c.PLAINTEXT:{this.tokenizer.state=$n.PLAINTEXT;break}}}_setDocumentType(e){const n=e.name||"",r=e.publicId||"",s=e.systemId||"";if(this.treeAdapter.setDocumentType(this.document,n,r,s),e.location){const i=this.treeAdapter.getChildNodes(this.document).find(o=>this.treeAdapter.isDocumentTypeNode(o));i&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}}_attachElementToTree(e,n){if(this.options.sourceCodeLocationInfo){const r=n&&{...n,startTag:n};this.treeAdapter.setNodeSourceCodeLocation(e,r)}if(this._shouldFosterParentOnInsertion())this._fosterParentElement(e);else{const r=this.openElements.currentTmplContentOrNode;this.treeAdapter.appendChild(r??this.document,e)}}_appendElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location)}_insertElement(e,n){const r=this.treeAdapter.createElement(e.tagName,n,e.attrs);this._attachElementToTree(r,e.location),this.openElements.push(r,e.tagID)}_insertFakeElement(e,n){const r=this.treeAdapter.createElement(e,pe.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,pe.HTML,e.attrs),r=this.treeAdapter.createDocumentFragment();this.treeAdapter.setTemplateContent(n,r),this._attachElementToTree(n,e.location),this.openElements.push(n,e.tagID),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,null)}_insertFakeRootElement(){const e=this.treeAdapter.createElement(Z.HTML,pe.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,c.HTML)}_appendCommentNode(e,n){const r=this.treeAdapter.createCommentNode(e.data);this.treeAdapter.appendChild(n,r),this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(r,e.location)}_insertCharacters(e){let n,r;if(this._shouldFosterParentOnInsertion()?({parent:n,beforeElement:r}=this._findFosterParentingLocation(),r?this.treeAdapter.insertTextBefore(n,e.chars,r):this.treeAdapter.insertText(n,e.chars)):(n=this.openElements.currentTmplContentOrNode,this.treeAdapter.insertText(n,e.chars)),!e.location)return;const s=this.treeAdapter.getChildNodes(n),a=r?s.lastIndexOf(r):s.length,i=s[a-1];if(this.treeAdapter.getNodeSourceCodeLocation(i)){const{endLine:l,endCol:d,endOffset:f}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:l,endCol:d,endOffset:f})}else this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(i,e.location)}_adoptNodes(e,n){for(let r=this.treeAdapter.getFirstChild(e);r;r=this.treeAdapter.getFirstChild(e))this.treeAdapter.detachNode(r),this.treeAdapter.appendChild(n,r)}_setEndLocation(e,n){if(this.treeAdapter.getNodeSourceCodeLocation(e)&&n.location){const r=n.location,s=this.treeAdapter.getTagName(e),a=n.type===lt.END_TAG&&s===n.tagName?{endTag:{...r},endLine:r.endLine,endCol:r.endCol,endOffset:r.endOffset}:{endLine:r.startLine,endCol:r.startCol,endOffset:r.startOffset};this.treeAdapter.updateNodeSourceCodeLocation(e,a)}}shouldProcessStartTagTokenInForeignContent(e){if(!this.currentNotInHTML)return!1;let n,r;return this.openElements.stackTop===0&&this.fragmentContext?(n=this.fragmentContext,r=this.fragmentContextID):{current:n,currentTagId:r}=this.openElements,e.tagID===c.SVG&&this.treeAdapter.getTagName(n)===Z.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===pe.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===c.MGLYPH||e.tagID===c.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,pe.HTML)}_processToken(e){switch(e.type){case lt.CHARACTER:{this.onCharacter(e);break}case lt.NULL_CHARACTER:{this.onNullCharacter(e);break}case lt.COMMENT:{this.onComment(e);break}case lt.DOCTYPE:{this.onDoctype(e);break}case lt.START_TAG:{this._processStartTag(e);break}case lt.END_TAG:{this.onEndTag(e);break}case lt.EOF:{this.onEof(e);break}case lt.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return t2(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Kr.Marker||this.openElements.contains(s.element)),r=n===-1?e-1:n-1;for(let s=r;s>=0;s--){const a=this.activeFormattingElements.entries[s];this._insertElement(a.token,this.treeAdapter.getNamespaceURI(a.element)),a.element=this.openElements.current}}}_closeTableCell(){this.openElements.generateImpliedEndTags(),this.openElements.popUntilTableCellPopped(),this.activeFormattingElements.clearToLastMarker(),this.insertionMode=P.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(c.P),this.openElements.popUntilTagNamePopped(c.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case c.TR:{this.insertionMode=P.IN_ROW;return}case c.TBODY:case c.THEAD:case c.TFOOT:{this.insertionMode=P.IN_TABLE_BODY;return}case c.CAPTION:{this.insertionMode=P.IN_CAPTION;return}case c.COLGROUP:{this.insertionMode=P.IN_COLUMN_GROUP;return}case c.TABLE:{this.insertionMode=P.IN_TABLE;return}case c.BODY:{this.insertionMode=P.IN_BODY;return}case c.FRAMESET:{this.insertionMode=P.IN_FRAMESET;return}case c.SELECT:{this._resetInsertionModeForSelect(e);return}case c.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case c.HTML:{this.insertionMode=this.headElement?P.AFTER_HEAD:P.BEFORE_HEAD;return}case c.TD:case c.TH:{if(e>0){this.insertionMode=P.IN_CELL;return}break}case c.HEAD:{if(e>0){this.insertionMode=P.IN_HEAD;return}break}}this.insertionMode=P.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===c.TEMPLATE)break;if(r===c.TABLE){this.insertionMode=P.IN_SELECT_IN_TABLE;return}}this.insertionMode=P.IN_SELECT}_isElementCausesFosterParenting(e){return sg.has(e)}_shouldFosterParentOnInsertion(){return this.fosterParentingEnabled&&this.openElements.currentTagId!==void 0&&this._isElementCausesFosterParenting(this.openElements.currentTagId)}_findFosterParentingLocation(){for(let e=this.openElements.stackTop;e>=0;e--){const n=this.openElements.items[e];switch(this.openElements.tagIDs[e]){case c.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===pe.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case c.TABLE:{const r=this.treeAdapter.getParentNode(n);return r?{parent:r,beforeElement:n}:{parent:this.openElements.items[e-1],beforeElement:null}}}}return{parent:this.openElements.items[0],beforeElement:null}}_fosterParentElement(e){const n=this._findFosterParentingLocation();n.beforeElement?this.treeAdapter.insertBefore(n.parent,e,n.beforeElement):this.treeAdapter.appendChild(n.parent,e)}_isSpecialElement(e,n){const r=this.treeAdapter.getNamespaceURI(e);return yT[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){PA(this,e);return}switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{Co(this,e);break}case P.BEFORE_HEAD:{Lo(this,e);break}case P.IN_HEAD:{Oo(this,e);break}case P.IN_HEAD_NO_SCRIPT:{xo(this,e);break}case P.AFTER_HEAD:{Ro(this,e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:{og(this,e);break}case P.TEXT:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Uc(this,e);break}case P.IN_TABLE_TEXT:{hg(this,e);break}case P.IN_COLUMN_GROUP:{Nl(this,e);break}case P.AFTER_BODY:{Sl(this,e);break}case P.AFTER_AFTER_BODY:{ol(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){kA(this,e);return}switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{Co(this,e);break}case P.BEFORE_HEAD:{Lo(this,e);break}case P.IN_HEAD:{Oo(this,e);break}case P.IN_HEAD_NO_SCRIPT:{xo(this,e);break}case P.AFTER_HEAD:{Ro(this,e);break}case P.TEXT:{this._insertCharacters(e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Uc(this,e);break}case P.IN_COLUMN_GROUP:{Nl(this,e);break}case P.AFTER_BODY:{Sl(this,e);break}case P.AFTER_AFTER_BODY:{ol(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){Dd(this,e);return}switch(this.insertionMode){case P.INITIAL:case P.BEFORE_HTML:case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_TEMPLATE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{Dd(this,e);break}case P.IN_TABLE_TEXT:{ho(this,e);break}case P.AFTER_BODY:{f2(this,e);break}case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{h2(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case P.INITIAL:{p2(this,e);break}case P.BEFORE_HEAD:case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:{this._err(e,ne.misplacedDoctype);break}case P.IN_TABLE_TEXT:{ho(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,ne.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?MA(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{m2(this,e);break}case P.BEFORE_HEAD:{v2(this,e);break}case P.IN_HEAD:{Mr(this,e);break}case P.IN_HEAD_NO_SCRIPT:{_2(this,e);break}case P.AFTER_HEAD:{A2(this,e);break}case P.IN_BODY:{Ln(this,e);break}case P.IN_TABLE:{ji(this,e);break}case P.IN_TABLE_TEXT:{ho(this,e);break}case P.IN_CAPTION:{bA(this,e);break}case P.IN_COLUMN_GROUP:{fh(this,e);break}case P.IN_TABLE_BODY:{Jl(this,e);break}case P.IN_ROW:{ec(this,e);break}case P.IN_CELL:{TA(this,e);break}case P.IN_SELECT:{gg(this,e);break}case P.IN_SELECT_IN_TABLE:{yA(this,e);break}case P.IN_TEMPLATE:{SA(this,e);break}case P.AFTER_BODY:{IA(this,e);break}case P.IN_FRAMESET:{CA(this,e);break}case P.AFTER_FRAMESET:{OA(this,e);break}case P.AFTER_AFTER_BODY:{RA(this,e);break}case P.AFTER_AFTER_FRAMESET:{DA(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?BA(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{g2(this,e);break}case P.BEFORE_HEAD:{b2(this,e);break}case P.IN_HEAD:{E2(this,e);break}case P.IN_HEAD_NO_SCRIPT:{T2(this,e);break}case P.AFTER_HEAD:{y2(this,e);break}case P.IN_BODY:{Zl(this,e);break}case P.TEXT:{uA(this,e);break}case P.IN_TABLE:{$o(this,e);break}case P.IN_TABLE_TEXT:{ho(this,e);break}case P.IN_CAPTION:{EA(this,e);break}case P.IN_COLUMN_GROUP:{_A(this,e);break}case P.IN_TABLE_BODY:{kd(this,e);break}case P.IN_ROW:{mg(this,e);break}case P.IN_CELL:{AA(this,e);break}case P.IN_SELECT:{vg(this,e);break}case P.IN_SELECT_IN_TABLE:{NA(this,e);break}case P.IN_TEMPLATE:{wA(this,e);break}case P.AFTER_BODY:{Eg(this,e);break}case P.IN_FRAMESET:{LA(this,e);break}case P.AFTER_FRAMESET:{xA(this,e);break}case P.AFTER_AFTER_BODY:{ol(this,e);break}}}onEof(e){switch(this.insertionMode){case P.INITIAL:{fo(this,e);break}case P.BEFORE_HTML:{Co(this,e);break}case P.BEFORE_HEAD:{Lo(this,e);break}case P.IN_HEAD:{Oo(this,e);break}case P.IN_HEAD_NO_SCRIPT:{xo(this,e);break}case P.AFTER_HEAD:{Ro(this,e);break}case P.IN_BODY:case P.IN_TABLE:case P.IN_CAPTION:case P.IN_COLUMN_GROUP:case P.IN_TABLE_BODY:case P.IN_ROW:case P.IN_CELL:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:{dg(this,e);break}case P.TEXT:{lA(this,e);break}case P.IN_TABLE_TEXT:{ho(this,e);break}case P.IN_TEMPLATE:{bg(this,e);break}case P.AFTER_BODY:case P.IN_FRAMESET:case P.AFTER_FRAMESET:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{dh(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===w.LINE_FEED)){if(e.chars.length===1)return;e.chars=e.chars.substr(1)}if(this.tokenizer.inForeignNode){this._insertCharacters(e);return}switch(this.insertionMode){case P.IN_HEAD:case P.IN_HEAD_NO_SCRIPT:case P.AFTER_HEAD:case P.TEXT:case P.IN_COLUMN_GROUP:case P.IN_SELECT:case P.IN_SELECT_IN_TABLE:case P.IN_FRAMESET:case P.AFTER_FRAMESET:{this._insertCharacters(e);break}case P.IN_BODY:case P.IN_CAPTION:case P.IN_CELL:case P.IN_TEMPLATE:case P.AFTER_BODY:case P.AFTER_AFTER_BODY:case P.AFTER_AFTER_FRAMESET:{ig(this,e);break}case P.IN_TABLE:case P.IN_TABLE_BODY:case P.IN_ROW:{Uc(this,e);break}case P.IN_TABLE_TEXT:{fg(this,e);break}}}}function i2(t,e){let n=t.activeFormattingElements.getElementEntryInScopeWithTagName(e.tagName);return n?t.openElements.contains(n.element)?t.openElements.hasInScope(e.tagID)||(n=null):(t.activeFormattingElements.removeEntry(n),n=null):cg(t,e),n}function o2(t,e){let n=null,r=t.openElements.stackTop;for(;r>=0;r--){const s=t.openElements.items[r];if(s===e.element)break;t._isSpecialElement(s,t.openElements.tagIDs[r])&&(n=s)}return n||(t.openElements.shortenToLength(Math.max(r,0)),t.activeFormattingElements.removeEntry(e)),n}function u2(t,e,n){let r=e,s=t.openElements.getCommonAncestor(e);for(let a=0,i=s;i!==n;a++,i=s){s=t.openElements.getCommonAncestor(i);const o=t.activeFormattingElements.getElementEntry(i),l=o&&a>=s2;!o||l?(l&&t.activeFormattingElements.removeEntry(o),t.openElements.remove(i)):(i=l2(t,o),r===e&&(t.activeFormattingElements.bookmark=o),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function l2(t,e){const n=t.treeAdapter.getNamespaceURI(e.element),r=t.treeAdapter.createElement(e.token.tagName,n,e.token.attrs);return t.openElements.replace(e.element,r),e.element=r,r}function c2(t,e,n){const r=t.treeAdapter.getTagName(e),s=Xl(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===c.TEMPLATE&&a===pe.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function d2(t,e,n){const r=t.treeAdapter.getNamespaceURI(n.element),{token:s}=n,a=t.treeAdapter.createElement(s.tagName,r,s.attrs);t._adoptNodes(e,a),t.treeAdapter.appendChild(e,a),t.activeFormattingElements.insertElementAfterBookmark(a,s),t.activeFormattingElements.removeEntry(n),t.openElements.remove(n.element),t.openElements.insertAfter(e,a,s.tagID)}function ch(t,e){for(let n=0;n<r2;n++){const r=i2(t,e);if(!r)break;const s=o2(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=u2(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&c2(t,i,a),d2(t,s,r)}}function Dd(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function f2(t,e){t._appendCommentNode(e,t.openElements.items[0])}function h2(t,e){t._appendCommentNode(e,t.document)}function dh(t,e){if(t.stopped=!0,e.location){const n=t.fragmentContext?0:2;for(let r=t.openElements.stackTop;r>=n;r--)t._setEndLocation(t.openElements.items[r],e);if(!t.fragmentContext&&t.openElements.stackTop>=0){const r=t.openElements.items[0],s=t.treeAdapter.getNodeSourceCodeLocation(r);if(s&&!s.endTag&&(t._setEndLocation(r,e),t.openElements.stackTop>=1)){const a=t.openElements.items[1],i=t.treeAdapter.getNodeSourceCodeLocation(a);i&&!i.endTag&&t._setEndLocation(a,e)}}}}function p2(t,e){t._setDocumentType(e);const n=e.forceQuirks?cr.QUIRKS:YT(e);$T(e)||t._err(e,ne.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=P.BEFORE_HTML}function fo(t,e){t._err(e,ne.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,cr.QUIRKS),t.insertionMode=P.BEFORE_HTML,t._processToken(e)}function m2(t,e){e.tagID===c.HTML?(t._insertElement(e,pe.HTML),t.insertionMode=P.BEFORE_HEAD):Co(t,e)}function g2(t,e){const n=e.tagID;(n===c.HTML||n===c.HEAD||n===c.BODY||n===c.BR)&&Co(t,e)}function Co(t,e){t._insertFakeRootElement(),t.insertionMode=P.BEFORE_HEAD,t._processToken(e)}function v2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.HEAD:{t._insertElement(e,pe.HTML),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD;break}default:Lo(t,e)}}function b2(t,e){const n=e.tagID;n===c.HEAD||n===c.BODY||n===c.HTML||n===c.BR?Lo(t,e):t._err(e,ne.endTagWithoutMatchingOpenElement)}function Lo(t,e){t._insertFakeElement(Z.HEAD,c.HEAD),t.headElement=t.openElements.current,t.insertionMode=P.IN_HEAD,t._processToken(e)}function Mr(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.TITLE:{t._switchToTextParsing(e,$n.RCDATA);break}case c.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,$n.RAWTEXT):(t._insertElement(e,pe.HTML),t.insertionMode=P.IN_HEAD_NO_SCRIPT);break}case c.NOFRAMES:case c.STYLE:{t._switchToTextParsing(e,$n.RAWTEXT);break}case c.SCRIPT:{t._switchToTextParsing(e,$n.SCRIPT_DATA);break}case c.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=P.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(P.IN_TEMPLATE);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:Oo(t,e)}}function E2(t,e){switch(e.tagID){case c.HEAD:{t.openElements.pop(),t.insertionMode=P.AFTER_HEAD;break}case c.BODY:case c.BR:case c.HTML:{Oo(t,e);break}case c.TEMPLATE:{Za(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Za(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==c.TEMPLATE&&t._err(e,ne.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,ne.endTagWithoutMatchingOpenElement)}function Oo(t,e){t.openElements.pop(),t.insertionMode=P.AFTER_HEAD,t._processToken(e)}function _2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BASEFONT:case c.BGSOUND:case c.HEAD:case c.LINK:case c.META:case c.NOFRAMES:case c.STYLE:{Mr(t,e);break}case c.NOSCRIPT:{t._err(e,ne.nestedNoscriptInHead);break}default:xo(t,e)}}function T2(t,e){switch(e.tagID){case c.NOSCRIPT:{t.openElements.pop(),t.insertionMode=P.IN_HEAD;break}case c.BR:{xo(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function xo(t,e){const n=e.type===lt.EOF?ne.openElementsLeftAfterEof:ne.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=P.IN_HEAD,t._processToken(e)}function A2(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.BODY:{t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=P.IN_BODY;break}case c.FRAMESET:{t._insertElement(e,pe.HTML),t.insertionMode=P.IN_FRAMESET;break}case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{t._err(e,ne.abandonedHeadElementChild),t.openElements.push(t.headElement,c.HEAD),Mr(t,e),t.openElements.remove(t.headElement);break}case c.HEAD:{t._err(e,ne.misplacedStartTagForHeadElement);break}default:Ro(t,e)}}function y2(t,e){switch(e.tagID){case c.BODY:case c.HTML:case c.BR:{Ro(t,e);break}case c.TEMPLATE:{Za(t,e);break}default:t._err(e,ne.endTagWithoutMatchingOpenElement)}}function Ro(t,e){t._insertFakeElement(Z.BODY,c.BODY),t.insertionMode=P.IN_BODY,Ql(t,e)}function Ql(t,e){switch(e.type){case lt.CHARACTER:{og(t,e);break}case lt.WHITESPACE_CHARACTER:{ig(t,e);break}case lt.COMMENT:{Dd(t,e);break}case lt.START_TAG:{Ln(t,e);break}case lt.END_TAG:{Zl(t,e);break}case lt.EOF:{dg(t,e);break}}}function ig(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function og(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function N2(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function S2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function w2(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_FRAMESET)}function I2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML)}function C2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&Rd.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,pe.HTML)}function L2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function O2(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),n||(t.formElement=t.openElements.current))}function x2(t,e){t.framesetOk=!1;const n=e.tagID;for(let r=t.openElements.stackTop;r>=0;r--){const s=t.openElements.tagIDs[r];if(n===c.LI&&s===c.LI||(n===c.DD||n===c.DT)&&(s===c.DD||s===c.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==c.ADDRESS&&s!==c.DIV&&s!==c.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML)}function R2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.tokenizer.state=$n.PLAINTEXT}function D2(t,e){t.openElements.hasInScope(c.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.framesetOk=!1}function k2(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(Z.A);n&&(ch(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function P2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function M2(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(c.NOBR)&&(ch(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,pe.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function B2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function F2(t,e){t.treeAdapter.getDocumentMode(t.document)!==cr.QUIRKS&&t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=P.IN_TABLE}function ug(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,pe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function lg(t){const e=Xm(t,ka.TYPE);return e!=null&&e.toLowerCase()===n2}function U2(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,pe.HTML),lg(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function H2(t,e){t._appendElement(e,pe.HTML),e.ackSelfClosing=!0}function q2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._appendElement(e,pe.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function j2(t,e){e.tagName=Z.IMG,e.tagID=c.IMG,ug(t,e)}function $2(t,e){t._insertElement(e,pe.HTML),t.skipNextNewLine=!0,t.tokenizer.state=$n.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=P.TEXT}function Y2(t,e){t.openElements.hasInButtonScope(c.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,$n.RAWTEXT)}function z2(t,e){t.framesetOk=!1,t._switchToTextParsing(e,$n.RAWTEXT)}function P0(t,e){t._switchToTextParsing(e,$n.RAWTEXT)}function W2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===P.IN_TABLE||t.insertionMode===P.IN_CAPTION||t.insertionMode===P.IN_TABLE_BODY||t.insertionMode===P.IN_ROW||t.insertionMode===P.IN_CELL?P.IN_SELECT_IN_TABLE:P.IN_SELECT}function G2(t,e){t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML)}function K2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,pe.HTML)}function V2(t,e){t.openElements.hasInScope(c.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(c.RTC),t._insertElement(e,pe.HTML)}function X2(t,e){t._reconstructActiveFormattingElements(),ng(e),lh(e),e.selfClosing?t._appendElement(e,pe.MATHML):t._insertElement(e,pe.MATHML),e.ackSelfClosing=!0}function Q2(t,e){t._reconstructActiveFormattingElements(),rg(e),lh(e),e.selfClosing?t._appendElement(e,pe.SVG):t._insertElement(e,pe.SVG),e.ackSelfClosing=!0}function M0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,pe.HTML)}function Ln(t,e){switch(e.tagID){case c.I:case c.S:case c.B:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.SMALL:case c.STRIKE:case c.STRONG:{P2(t,e);break}case c.A:{k2(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{C2(t,e);break}case c.P:case c.DL:case c.OL:case c.UL:case c.DIV:case c.DIR:case c.NAV:case c.MAIN:case c.MENU:case c.ASIDE:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.DETAILS:case c.ADDRESS:case c.ARTICLE:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{I2(t,e);break}case c.LI:case c.DD:case c.DT:{x2(t,e);break}case c.BR:case c.IMG:case c.WBR:case c.AREA:case c.EMBED:case c.KEYGEN:{ug(t,e);break}case c.HR:{q2(t,e);break}case c.RB:case c.RTC:{K2(t,e);break}case c.RT:case c.RP:{V2(t,e);break}case c.PRE:case c.LISTING:{L2(t,e);break}case c.XMP:{Y2(t,e);break}case c.SVG:{Q2(t,e);break}case c.HTML:{N2(t,e);break}case c.BASE:case c.LINK:case c.META:case c.STYLE:case c.TITLE:case c.SCRIPT:case c.BGSOUND:case c.BASEFONT:case c.TEMPLATE:{Mr(t,e);break}case c.BODY:{S2(t,e);break}case c.FORM:{O2(t,e);break}case c.NOBR:{M2(t,e);break}case c.MATH:{X2(t,e);break}case c.TABLE:{F2(t,e);break}case c.INPUT:{U2(t,e);break}case c.PARAM:case c.TRACK:case c.SOURCE:{H2(t,e);break}case c.IMAGE:{j2(t,e);break}case c.BUTTON:{D2(t,e);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{B2(t,e);break}case c.IFRAME:{z2(t,e);break}case c.SELECT:{W2(t,e);break}case c.OPTION:case c.OPTGROUP:{G2(t,e);break}case c.NOEMBED:case c.NOFRAMES:{P0(t,e);break}case c.FRAMESET:{w2(t,e);break}case c.TEXTAREA:{$2(t,e);break}case c.NOSCRIPT:{t.options.scriptingEnabled?P0(t,e):M0(t,e);break}case c.PLAINTEXT:{R2(t,e);break}case c.COL:case c.TH:case c.TD:case c.TR:case c.HEAD:case c.FRAME:case c.TBODY:case c.TFOOT:case c.THEAD:case c.CAPTION:case c.COLGROUP:break;default:M0(t,e)}}function Z2(t,e){if(t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function J2(t,e){t.openElements.hasInScope(c.BODY)&&(t.insertionMode=P.AFTER_BODY,Eg(t,e))}function eA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function tA(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(c.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(c.FORM):n&&t.openElements.remove(n))}function nA(t){t.openElements.hasInButtonScope(c.P)||t._insertFakeElement(Z.P,c.P),t._closePElement()}function rA(t){t.openElements.hasInListItemScope(c.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(c.LI),t.openElements.popUntilTagNamePopped(c.LI))}function sA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function aA(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function iA(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function oA(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(Z.BR,c.BR),t.openElements.pop(),t.framesetOk=!1}function cg(t,e){const n=e.tagName,r=e.tagID;for(let s=t.openElements.stackTop;s>0;s--){const a=t.openElements.items[s],i=t.openElements.tagIDs[s];if(r===i&&(r!==c.UNKNOWN||t.treeAdapter.getTagName(a)===n)){t.openElements.generateImpliedEndTagsWithExclusion(r),t.openElements.stackTop>=s&&t.openElements.shortenToLength(s);break}if(t._isSpecialElement(a,i))break}}function Zl(t,e){switch(e.tagID){case c.A:case c.B:case c.I:case c.S:case c.U:case c.EM:case c.TT:case c.BIG:case c.CODE:case c.FONT:case c.NOBR:case c.SMALL:case c.STRIKE:case c.STRONG:{ch(t,e);break}case c.P:{nA(t);break}case c.DL:case c.UL:case c.OL:case c.DIR:case c.DIV:case c.NAV:case c.PRE:case c.MAIN:case c.MENU:case c.ASIDE:case c.BUTTON:case c.CENTER:case c.FIGURE:case c.FOOTER:case c.HEADER:case c.HGROUP:case c.DIALOG:case c.ADDRESS:case c.ARTICLE:case c.DETAILS:case c.SEARCH:case c.SECTION:case c.SUMMARY:case c.LISTING:case c.FIELDSET:case c.BLOCKQUOTE:case c.FIGCAPTION:{eA(t,e);break}case c.LI:{rA(t);break}case c.DD:case c.DT:{sA(t,e);break}case c.H1:case c.H2:case c.H3:case c.H4:case c.H5:case c.H6:{aA(t);break}case c.BR:{oA(t);break}case c.BODY:{Z2(t,e);break}case c.HTML:{J2(t,e);break}case c.FORM:{tA(t);break}case c.APPLET:case c.OBJECT:case c.MARQUEE:{iA(t,e);break}case c.TEMPLATE:{Za(t,e);break}default:cg(t,e)}}function dg(t,e){t.tmplInsertionModeStack.length>0?bg(t,e):dh(t,e)}function uA(t,e){var n;e.tagID===c.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function lA(t,e){t._err(e,ne.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Uc(t,e){if(t.openElements.currentTagId!==void 0&&sg.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=P.IN_TABLE_TEXT,e.type){case lt.CHARACTER:{hg(t,e);break}case lt.WHITESPACE_CHARACTER:{fg(t,e);break}}else pu(t,e)}function cA(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_CAPTION}function dA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_COLUMN_GROUP}function fA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.COLGROUP,c.COLGROUP),t.insertionMode=P.IN_COLUMN_GROUP,fh(t,e)}function hA(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_TABLE_BODY}function pA(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(Z.TBODY,c.TBODY),t.insertionMode=P.IN_TABLE_BODY,Jl(t,e)}function mA(t,e){t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function gA(t,e){lg(e)?t._appendElement(e,pe.HTML):pu(t,e),e.ackSelfClosing=!0}function vA(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,pe.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function ji(t,e){switch(e.tagID){case c.TD:case c.TH:case c.TR:{pA(t,e);break}case c.STYLE:case c.SCRIPT:case c.TEMPLATE:{Mr(t,e);break}case c.COL:{fA(t,e);break}case c.FORM:{vA(t,e);break}case c.TABLE:{mA(t,e);break}case c.TBODY:case c.TFOOT:case c.THEAD:{hA(t,e);break}case c.INPUT:{gA(t,e);break}case c.CAPTION:{cA(t,e);break}case c.COLGROUP:{dA(t,e);break}default:pu(t,e)}}function $o(t,e){switch(e.tagID){case c.TABLE:{t.openElements.hasInTableScope(c.TABLE)&&(t.openElements.popUntilTagNamePopped(c.TABLE),t._resetInsertionMode());break}case c.TEMPLATE:{Za(t,e);break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:pu(t,e)}}function pu(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Ql(t,e),t.fosterParentingEnabled=n}function fg(t,e){t.pendingCharacterTokens.push(e)}function hg(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function ho(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)pu(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const pg=new Set([c.CAPTION,c.COL,c.COLGROUP,c.TBODY,c.TD,c.TFOOT,c.TH,c.THEAD,c.TR]);function bA(t,e){const n=e.tagID;pg.has(n)?t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,ji(t,e)):Ln(t,e)}function EA(t,e){const n=e.tagID;switch(n){case c.CAPTION:case c.TABLE:{t.openElements.hasInTableScope(c.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(c.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_TABLE,n===c.TABLE&&$o(t,e));break}case c.BODY:case c.COL:case c.COLGROUP:case c.HTML:case c.TBODY:case c.TD:case c.TFOOT:case c.TH:case c.THEAD:case c.TR:break;default:Zl(t,e)}}function fh(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.COL:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.TEMPLATE:{Mr(t,e);break}default:Nl(t,e)}}function _A(t,e){switch(e.tagID){case c.COLGROUP:{t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TEMPLATE:{Za(t,e);break}case c.COL:break;default:Nl(t,e)}}function Nl(t,e){t.openElements.currentTagId===c.COLGROUP&&(t.openElements.pop(),t.insertionMode=P.IN_TABLE,t._processToken(e))}function Jl(t,e){switch(e.tagID){case c.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_ROW;break}case c.TH:case c.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(Z.TR,c.TR),t.insertionMode=P.IN_ROW,ec(t,e);break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,ji(t,e));break}default:ji(t,e)}}function kd(t,e){const n=e.tagID;switch(e.tagID){case c.TBODY:case c.TFOOT:case c.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE);break}case c.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE,$o(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:case c.TR:break;default:$o(t,e)}}function ec(t,e){switch(e.tagID){case c.TH:case c.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,pe.HTML),t.insertionMode=P.IN_CELL,t.activeFormattingElements.insertMarker();break}case c.CAPTION:case c.COL:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,Jl(t,e));break}default:ji(t,e)}}function mg(t,e){switch(e.tagID){case c.TR:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY);break}case c.TABLE:{t.openElements.hasInTableScope(c.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,kd(t,e));break}case c.TBODY:case c.TFOOT:case c.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(c.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=P.IN_TABLE_BODY,kd(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:case c.TD:case c.TH:break;default:$o(t,e)}}function TA(t,e){const n=e.tagID;pg.has(n)?(t.openElements.hasInTableScope(c.TD)||t.openElements.hasInTableScope(c.TH))&&(t._closeTableCell(),ec(t,e)):Ln(t,e)}function AA(t,e){const n=e.tagID;switch(n){case c.TD:case c.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=P.IN_ROW);break}case c.TABLE:case c.TBODY:case c.TFOOT:case c.THEAD:case c.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),mg(t,e));break}case c.BODY:case c.CAPTION:case c.COL:case c.COLGROUP:case c.HTML:break;default:Zl(t,e)}}function gg(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t._insertElement(e,pe.HTML);break}case c.OPTGROUP:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._insertElement(e,pe.HTML);break}case c.HR:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop(),t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.INPUT:case c.KEYGEN:case c.TEXTAREA:case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),e.tagID!==c.SELECT&&t._processStartTag(e));break}case c.SCRIPT:case c.TEMPLATE:{Mr(t,e);break}}}function vg(t,e){switch(e.tagID){case c.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===c.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===c.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===c.OPTGROUP&&t.openElements.pop();break}case c.OPTION:{t.openElements.currentTagId===c.OPTION&&t.openElements.pop();break}case c.SELECT:{t.openElements.hasInSelectScope(c.SELECT)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode());break}case c.TEMPLATE:{Za(t,e);break}}}function yA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t._processStartTag(e)):gg(t,e)}function NA(t,e){const n=e.tagID;n===c.CAPTION||n===c.TABLE||n===c.TBODY||n===c.TFOOT||n===c.THEAD||n===c.TR||n===c.TD||n===c.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(c.SELECT),t._resetInsertionMode(),t.onEndTag(e)):vg(t,e)}function SA(t,e){switch(e.tagID){case c.BASE:case c.BASEFONT:case c.BGSOUND:case c.LINK:case c.META:case c.NOFRAMES:case c.SCRIPT:case c.STYLE:case c.TEMPLATE:case c.TITLE:{Mr(t,e);break}case c.CAPTION:case c.COLGROUP:case c.TBODY:case c.TFOOT:case c.THEAD:{t.tmplInsertionModeStack[0]=P.IN_TABLE,t.insertionMode=P.IN_TABLE,ji(t,e);break}case c.COL:{t.tmplInsertionModeStack[0]=P.IN_COLUMN_GROUP,t.insertionMode=P.IN_COLUMN_GROUP,fh(t,e);break}case c.TR:{t.tmplInsertionModeStack[0]=P.IN_TABLE_BODY,t.insertionMode=P.IN_TABLE_BODY,Jl(t,e);break}case c.TD:case c.TH:{t.tmplInsertionModeStack[0]=P.IN_ROW,t.insertionMode=P.IN_ROW,ec(t,e);break}default:t.tmplInsertionModeStack[0]=P.IN_BODY,t.insertionMode=P.IN_BODY,Ln(t,e)}}function wA(t,e){e.tagID===c.TEMPLATE&&Za(t,e)}function bg(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(c.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):dh(t,e)}function IA(t,e){e.tagID===c.HTML?Ln(t,e):Sl(t,e)}function Eg(t,e){var n;if(e.tagID===c.HTML){if(t.fragmentContext||(t.insertionMode=P.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===c.HTML){t._setEndLocation(t.openElements.items[0],e);const r=t.openElements.items[1];r&&!(!((n=t.treeAdapter.getNodeSourceCodeLocation(r))===null||n===void 0)&&n.endTag)&&t._setEndLocation(r,e)}}else Sl(t,e)}function Sl(t,e){t.insertionMode=P.IN_BODY,Ql(t,e)}function CA(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.FRAMESET:{t._insertElement(e,pe.HTML);break}case c.FRAME:{t._appendElement(e,pe.HTML),e.ackSelfClosing=!0;break}case c.NOFRAMES:{Mr(t,e);break}}}function LA(t,e){e.tagID===c.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==c.FRAMESET&&(t.insertionMode=P.AFTER_FRAMESET))}function OA(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.NOFRAMES:{Mr(t,e);break}}}function xA(t,e){e.tagID===c.HTML&&(t.insertionMode=P.AFTER_AFTER_FRAMESET)}function RA(t,e){e.tagID===c.HTML?Ln(t,e):ol(t,e)}function ol(t,e){t.insertionMode=P.IN_BODY,Ql(t,e)}function DA(t,e){switch(e.tagID){case c.HTML:{Ln(t,e);break}case c.NOFRAMES:{Mr(t,e);break}}}function kA(t,e){e.chars=Ht,t._insertCharacters(e)}function PA(t,e){t._insertCharacters(e),t.framesetOk=!1}function _g(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==pe.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function MA(t,e){if(QT(e))_g(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===pe.MATHML?ng(e):r===pe.SVG&&(ZT(e),rg(e)),lh(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function BA(t,e){if(e.tagID===c.P||e.tagID===c.BR){_g(t),t._endTagOutsideForeignContent(e);return}for(let n=t.openElements.stackTop;n>0;n--){const r=t.openElements.items[n];if(t.treeAdapter.getNamespaceURI(r)===pe.HTML){t._endTagOutsideForeignContent(e);break}const s=t.treeAdapter.getTagName(r);if(s.toLowerCase()===e.tagName){e.tagName=s,t.openElements.shortenToLength(n);break}}}function Tg(t,e){return function(r){let s,a=0,i="";for(;s=t.exec(r);)a!==s.index&&(i+=r.substring(a,s.index)),i+=e.get(s[0].charCodeAt(0)),a=s.index+1;return i+r.substring(a)}}const FA=Tg(/["&\u00A0]/g,new Map([[34,"""],[38,"&"],[160," "]])),UA=Tg(/[&<>\u00A0]/g,new Map([[38,"&"],[60,"<"],[62,">"],[160," "]])),HA=new Set([Z.AREA,Z.BASE,Z.BASEFONT,Z.BGSOUND,Z.BR,Z.COL,Z.EMBED,Z.FRAME,Z.HR,Z.IMG,Z.INPUT,Z.KEYGEN,Z.LINK,Z.META,Z.PARAM,Z.SOURCE,Z.TRACK,Z.WBR]);function Ag(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===pe.HTML&&HA.has(e.treeAdapter.getTagName(t))}const qA={treeAdapter:hs,scriptingEnabled:!0};function jA(t,e){const n={...qA,...e};return Ag(t,n)?"":yg(t,n)}function yg(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===Z.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===pe.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=$A(a,e);return n}function $A(t,e){return e.treeAdapter.isElementNode(t)?YA(t,e):e.treeAdapter.isTextNode(t)?WA(t,e):e.treeAdapter.isCommentNode(t)?GA(t,e):e.treeAdapter.isDocumentTypeNode(t)?KA(t,e):""}function YA(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${zA(t,e)}>${Ag(t,e)?"":`${yg(t,e)}</${n}>`}`}function zA(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case pe.XML:{n+=`xml:${r.name}`;break}case pe.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case pe.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${FA(r.value)}"`}return n}function WA(t,e){const{treeAdapter:n}=e,r=n.getTextNodeContent(t),s=n.getParentNode(t),a=s&&n.isElementNode(s)&&n.getTagName(s);return a&&n.getNamespaceURI(s)===pe.HTML&&ST(a,e.scriptingEnabled)?r:UA(r)}function GA(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function KA(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function VA(t,e){return ag.parse(t,e)}function hh(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=ag.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Xn(t){return"tagName"in t}function rs(t){return t.nodeName==="#text"}function xt(t,e){var n;return(n=t.attrs.find(r=>r.name===e))==null?void 0:n.value}function Qs(t,e){return t.attrs.some(n=>n.name===e)}function B0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function ph(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function Zs(t){return hh(t).childNodes}function XA(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function $i(t){return XA(t)?VA(t).childNodes:hh(t).childNodes}function QA(t){const e=hh("");return e.childNodes=t,jA(e)}const mh={image:{type:"image",valueKind:"asset",control:"image",multiline:!1},file:{type:"file",valueKind:"asset",control:"file",multiline:!1},url:{type:"url",valueKind:"url",control:"url",multiline:!1},email:{type:"email",valueKind:"text",control:"email",multiline:!1},phone:{type:"phone",valueKind:"text",control:"phone",multiline:!1},date:{type:"date",valueKind:"text",control:"date",multiline:!1},time:{type:"time",valueKind:"text",control:"time",multiline:!1},code:{type:"code",valueKind:"text",control:"code",multiline:!0},richtext:{type:"richtext",valueKind:"html",control:"richtext",multiline:!0},authors:{type:"authors",valueKind:"authors",control:"authors",multiline:!1},text:{type:"text",valueKind:"text",control:"text",multiline:!0},shorttext:{type:"shorttext",valueKind:"text",control:"shorttext",multiline:!1}};function ZA(t){return Object.prototype.hasOwnProperty.call(mh,t)}function Ya(t){return mh[t].valueKind}const JA=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),ey=new Set(["code","pre","kbd","samp"]),ty=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function Pa(t){if(t.annotation!==void 0&&ZA(t.annotation))return t.annotation;if(t.attribute!==void 0){const e=t.attribute,n=(t.valuePrefix??"").toLowerCase();if(e==="href"){if(n.endsWith("mailto:"))return"email";if(n.endsWith("tel:"))return"phone";if(t.wholeValue)return t.download===!0?"file":"url"}return t.wholeValue&&e==="src"?t.tag==="img"?"image":"file":t.wholeValue&&t.tag==="source"&&e==="srcset"?"file":"shorttext"}return ey.has(t.tag)?"code":JA.has(t.tag)?"shorttext":ty.has(t.tag)?"text":"shorttext"}const ny=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function _s(t){const e=[];for(const n of t.matchAll(ny)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Ma(t){var r;const e=t.trim(),n=_s(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function tc(t,e){return t.replace(/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g,(n,r)=>{const s=r.split(".");return e({raw:n,name:s[0]??"",path:s,dotted:s.length>1})})}function gh(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function Ng(t){const e=F0(xt(t,"data-minlength")),n=F0(xt(t,"data-maxlength"));return{...e!==void 0&&{minLength:e},...n!==void 0&&{maxLength:n}}}function F0(t){if(t===void 0)return;const e=Number(t);return Number.isInteger(e)&&e>=0?e:void 0}function Ts(t,e=new Map){return wg(t,e,new Set)}function Sg(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=wg(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function wg(t,e,n){const r=[],s=new Map,a=f=>{const g=s.get(f);if(g!==void 0)return g;const h={name:f,type:"shorttext",label:rh(f),required:!1,multiline:!1};return s.set(f,h),r.push(f),h},i=(f,g)=>{if(s.has(f))return;const h=a(f);h.type=g,h.multiline=mh[g].multiline},o=f=>{const g=xt(f,"data-field")??ry(f);if(g===void 0)return;const h=a(g);Qs(f,"data-required")&&(h.required=!0);const p=xt(f,"data-help");p!==void 0&&(h.help=p);const v=xt(f,"data-label");v!==void 0&&(h.label=v);const{minLength:T,maxLength:_}=Ng(f);T!==void 0&&(h.minLength=T),_!==void 0&&(h.maxLength=_)},l=f=>{const g=Ma(f);for(const h of _s(f))h.dotted||i(h.name,Pa({tag:"",wholeValue:(g==null?void 0:g.name)===h.name}))},d=f=>{for(const g of f){if(!Xn(g)){rs(g)&&l(g.value);continue}const h=xt(g,"data-each");if(h!==void 0){const T=a(h);T.type="url",T.multiple=!0;const _=xt(g,"data-pick-from");_!==void 0&&(T.pickFrom=_),o(g);continue}if(Qs(g,"data-each-in"))continue;const p=xt(g,"data-type"),v=e.has(g.tagName)?Sg(g.tagName,e,n):void 0;for(const T of g.attrs){const _=Ma(T.value);for(const E of _s(T.value)){if(E.dotted)continue;const O=(_==null?void 0:_.name)===E.name,C=O?v==null?void 0:v.get(T.name):void 0;i(E.name,C??Pa({tag:g.tagName,attribute:T.name,wholeValue:O,valuePrefix:gh(T.value),download:Qs(g,"download"),...p!==void 0&&{annotation:p}}))}}for(const T of g.childNodes){if(!rs(T))continue;const _=Ma(T.value);for(const E of _s(T.value))E.dotted||i(E.name,Pa({tag:g.tagName,wholeValue:(_==null?void 0:_.name)===E.name,...p!==void 0&&{annotation:p}}))}o(g),d(g.childNodes)}};return d($i(t)),r.map(f=>sy(s.get(f)))}function ry(t){for(const e of t.attrs){const n=_s(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(rs(e)){const n=_s(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function sy(t){return{name:t.name,type:t.type,label:t.label,required:t.required,multiline:t.multiline,...t.help!==void 0&&{help:t.help},...t.minLength!==void 0&&{minLength:t.minLength},...t.maxLength!==void 0&&{maxLength:t.maxLength},...t.multiple!==void 0&&{multiple:t.multiple},...t.pickFrom!==void 0&&{pickFrom:t.pickFrom}}}function ay(t,e){if(t===e)return!1;const n=Ya(t),r=Ya(e);return r==="html"?!1:n==="html"||t==="date"&&e==="time"||t==="time"&&e==="date"||(a=>a==="shorttext"||a==="text"||a==="code"||a==="email"||a==="phone")(t)&&(e==="date"||e==="time")?!0:!(n===r||r==="text")}function iy(t,e){const n=new Map(t.map(o=>[o.name,o])),r=new Map(e.map(o=>[o.name,o])),s=[],a=[],i=[];for(const[o,l]of n){const d=r.get(o);d===void 0?a.push({name:o,type:l.type}):d.type!==l.type&&i.push({name:o,from:l.type,to:d.type,destructive:ay(l.type,d.type)})}for(const[o,l]of r)n.has(o)||s.push({name:o,type:l.type});return{added:s.sort((o,l)=>o.name.localeCompare(l.name)),removed:a.sort((o,l)=>o.name.localeCompare(l.name)),typeChanged:i.sort((o,l)=>o.name.localeCompare(l.name))}}const U0=/^(.+)@v([1-9]\d*)$/;function vh(t){const e=U0.exec(t);if(!e)return null;const n=e[1];return U0.test(n)?null:{base:n,version:Number.parseInt(e[2],10)}}function Pd(t){return vh(t)!==null}function GD(t){const e=vh(t);return e?e.base:t}function oy(t){const e=vh(t);return e?e.version:null}const H0="ref:";function nc(t){return t.startsWith(H0)?t.slice(H0.length):void 0}function q0(t){const e=new Set,n=r=>{for(const s of r)if(Xn(s)){for(const a of s.attrs){const i=nc(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n($i(t)),[...e].sort()}function Md(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,o=new Set,l=new Map,d=new Set,f=g=>{for(const h of g){if(!Xn(h))continue;const p=uy(h);p!==void 0&&o.add(p);const v=xt(h,"data-each-in");if(v!==void 0){r.push(v);continue}const T=xt(h,"data-each");if(T!==void 0&&s.push(T),Qs(h,"data-required")){const C=j0(h);C!==void 0&&n.add(C)}const _=Ng(h);if(_.minLength!==void 0||_.maxLength!==void 0){const C=j0(h);C!==void 0&&l.set(C,_)}const E=xt(h,"data-type"),O=e.has(h.tagName)?Sg(h.tagName,e,new Set):void 0;for(const C of h.attrs){const H=nc(C.value);H!==void 0&&d.add(H);const M=Ma(C.value);if(M===null||M.dotted)continue;const J=(O==null?void 0:O.get(C.name))??Pa({tag:h.tagName,attribute:C.name,wholeValue:!0,valuePrefix:gh(C.value),download:Qs(h,"download"),...E!==void 0&&{annotation:E}});J==="image"?a.add(M.name):J==="file"?i.add(M.name):J==="richtext"&&o.add(M.name)}f(h.childNodes)}};return f($i(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...o],constraints:l,references:[...d].sort()}}function uy(t){const e=t.childNodes.filter(i=>!(rs(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!rs(n))return;const r=Ma(n.value);if(r===null||r.dotted)return;const s=xt(t,"data-type"),a=Pa({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return Ya(a)==="html"?r.name:void 0}function j0(t){const e=xt(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=_s(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(rs(n)){const r=_s(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function ly(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Hc(t){return t.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function cy(t){return JSON.stringify(t).slice(1,-1)}function wl(t){let e="";for(const r of t){const s=r.codePointAt(0);s!==void 0&&s>32&&(e+=r)}const n=e.toLowerCase();return n.startsWith("javascript:")||n.startsWith("vbscript:")?"#":t}function dy(t){if(!Array.isArray(t))return[];const e=[];for(const n of t){if(n===null||typeof n!="object")continue;const r=n,s=typeof r.name=="string"?r.name:"";s.trim()!==""&&e.push({name:s,...typeof r.user=="string"&&r.user!==""&&{user:r.user},...typeof r.href=="string"&&r.href!==""&&{href:r.href}})}return e}function fy(t){if(t.length===0)return"";if(t.length===1)return t[0]??"";const e=t[t.length-1]??"";return`${t.slice(0,-1).join(", ")} and ${e}`}function hy(t,e){const n=dy(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return ly((s==null?void 0:s.displayName)??r.name)});return fy(n)}const py="public, max-age=31536000, immutable",my=[400,800,1200,1600],gy={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function vy(t){return t==="jpeg"?"jpg":t}function by(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function Ey(t){let e=2166136261;for(let n=0;n<t.length;n+=1)e^=t[n]??0,e=Math.imul(e,16777619);return(e>>>0).toString(36)}async function _y(t,e,n){var _;const r=by(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:my,formats:s}),i=Ey(t),o=e.slice(0,e.lastIndexOf(".")>=0?e.lastIndexOf("."):e.length),l=[],d=E=>{const O=`${o}.${i}-${E.width}.${vy(E.format)}`;return l.push({path:O,contents:E.bytes,cacheControl:py}),`/${O}`},f=new Map;for(const E of[...a.variants].sort((O,C)=>O.width-C.width)){const O=d(E),C=f.get(E.format)??[];C.push({url:O,width:E.width}),f.set(E.format,C)}const g=E=>(f.get(E)??[]).map(O=>`${O.url} ${O.width}w`).join(", "),h=["avif","webp"].filter(E=>f.has(E)).map(E=>({format:E,mime:gy[E],srcset:g(E)})),p=f.get(r)??[],v=((_=p[p.length-1])==null?void 0:_.url)??`/${e}`,T={width:a.sourceWidth,height:a.sourceHeight,sources:h,fallbackSrc:v,...a.blurDataUri!==void 0&&{blurDataUri:a.blurDataUri}};return{artifacts:l,info:T}}function Ig(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${Hc(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${Hc(i)}"`).join(""),s=`<img src="${Hc(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const Ty=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],Ay=["data-type","data-field","data-required","data-help","data-label"];function Bd(t){const e={components:t.components,usedComponents:new Set,...t.context!==void 0&&{context:t.context},...t.media!==void 0&&{media:t.media},...t.authorDirectory!==void 0&&{authorDirectory:t.authorDirectory},...t.componentStyles!==void 0&&{componentStyles:t.componentStyles}},n=Yo($i(t.template),t.scope,e),r=t.document===void 0?n:xg(Yo($i(t.document),t.scope,e),n);return yy(r,t,e),QA(r)}function yy(t,e,n){var i,o,l,d;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const f=Zs(`<style>
|
|
4
4
|
${r}
|
|
5
|
-
</style>`),g=
|
|
6
|
-
${
|
|
7
|
-
<\/script>`)),g=
|
|
5
|
+
</style>`),g=Fd(t,"head");g?g.childNodes.push(...f):t.unshift(...f)}const s=[],a=(o=e.templateScript)==null?void 0:o.trim();a&&s.push(a);for(const f of[...n.usedComponents].sort()){const g=(d=(l=e.componentScripts)==null?void 0:l.get(f))==null?void 0:d.trim();g&&s.push(g)}if(s.length>0){const f=s.flatMap(h=>Zs(`<script>
|
|
6
|
+
${h}
|
|
7
|
+
<\/script>`)),g=Fd(t,"body");g?g.childNodes.push(...f):t.push(...f)}}function Fd(t,e){for(const n of t){if(!Xn(n))continue;if(n.tagName===e)return n;const r=Fd(n.childNodes,e);if(r!==void 0)return r}}function $0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function Ud(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function rc(t){return e=>{const n=t[e.name];if($0(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return $0(r)?r.url:Ud(r)}return e.dotted?"":Ud(n)}}function Yo(t,e,n){const r=[];for(const s of t)Xn(s)?r.push(...Cg(s,e,n)):(rs(s)&&(s.value=tc(s.value,rc(e))),r.push(s));return r}function Cg(t,e,n){if(Qs(t,"data-each-in")||Qs(t,"data-each"))return Ny(t,e,n);if(n.components.has(t.tagName))return Cy(t,e,n);Sy(t,e,n);const r=xt(t,"data-type");for(const a of Ay)ph(t,a);if(t.tagName==="img"&&n.media!==void 0){const a=n.media.image(xt(t,"src")??"");if(a!==void 0){const i=t.attrs.map(o=>[o.name,o.value]);return Zs(Ig(a,i))}}if(Iy(t))return z0(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return z0(t,e,"raw"),[t];const s=wy(t,r);if((s==null?void 0:s.kind)==="html"){const a=Zs(Ud(e[s.token.name]));return t.childNodes=Lg(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=Zs(hy(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=Yo(t.childNodes,e,n),[t])}function Lg(t,e){var r;const n=[];for(const s of t){if(!Xn(s)){n.push(s);continue}if(s.childNodes=Lg(s.childNodes,e),s.tagName==="img"){const i=xt(s,"src"),o=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(o!==void 0){const l=s.attrs.map(d=>[d.name,d.value]);n.push(...Zs(Ig(o,l)));continue}i!==void 0&&B0(s,"src",Y0(i,e))}const a=xt(s,"href");a!==void 0&&B0(s,"href",Y0(a,e)),n.push(s)}return n}function Y0(t,e){var r;const n=Hd(t,e);return wl(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function Hd(t,e){var r,s;const n=nc(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function Ny(t,e,n){if(n.context===void 0)return[];const r=xt(t,"data-each-in");let s;if(r!==void 0){const i=xt(t,"data-limit"),o=i!==void 0?Number.parseInt(i,10):void 0,l=xt(t,"data-sort");s=n.context.collection(r,{...l!==void 0&&{sort:l},...o!==void 0&&!Number.isNaN(o)&&{limit:o}})}else{const i=xt(t,"data-each")??"",o=e[i];s=(Array.isArray(o)?o.filter(d=>typeof d=="string"):typeof o=="string"?[o]:[]).map(d=>{var f;return(f=n.context)==null?void 0:f.reference(d)}).filter(d=>d!==void 0)}const a=[];for(const i of s){const o=Og(t);for(const l of Ty)ph(o,l);a.push(...Cg(o,{...e,item:i},n))}return a}function Og(t){if(Xn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(Og),e}return{...t}}function Sy(t,e,n){var r;for(const s of t.attrs){if(_s(s.value).length===0){const g=Hd(s.value,n);g!==void 0&&(s.value=wl(g));continue}const a=xt(t,"data-type"),i=Ma(s.value)!==null,o=Pa({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:gh(s.value),download:Qs(t,"download"),...a!==void 0&&{annotation:a}});let l=tc(s.value,rc(e));const d=Hd(l,n);d!==void 0&&(l=d);const f=(r=n.media)==null?void 0:r.file(l);f!==void 0&&(l=f),i&&Ya(o)==="url"&&(l=wl(l)),s.value=l}}function z0(t,e,n){const r=rc(e);for(const s of t.childNodes)rs(s)&&(s.value=tc(s.value,a=>{const i=r(a);return n==="json"?cy(i):i}))}function wy(t,e){const n=t.childNodes.filter(i=>!(rs(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!rs(r))return null;const s=Ma(r.value);if(s===null||s.dotted)return null;const a=Pa({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:Ya(a)}}function Iy(t){var e;return t.tagName==="script"&&((e=xt(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function Cy(t,e,n){var f,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=rc(e),a={};for(const h of t.attrs)a[h.name]=tc(h.value,s);const i=Yo(t.childNodes,e,n),o=Yo($i(r),a,n),l=xg(o,i);n.usedComponents.add(t.tagName);const d=(g=(f=n.componentStyles)==null?void 0:f.get(t.tagName))==null?void 0:g.trim();if(d){const h=l.find(Xn);if(h!==void 0){const p=Zs(`<style>@scope {
|
|
8
8
|
${d}
|
|
9
|
-
}</style>`);f.childNodes=[...p,...f.childNodes]}}return l}function xg(t,e){const n=new Map,r=[];for(const s of e){const a=Qn(s)?xt(s,"slot"):void 0;if(a!==void 0){Qn(s)&&hh(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return Hd(t,n,r)}function Hd(t,e,n){const r=[];for(const s of t)if(Qn(s)&&s.tagName==="slot"){const a=xt(s,"name"),i=a!==void 0?e.get(a):n;i&&i.length>0?r.push(...i):r.push(...Hd(s.childNodes,e,n))}else Qn(s)&&(s.childNodes=Hd(s.childNodes,e,n)),r.push(s);return r}async function z0(t,e,n){const r=new Array(t.length),s=Math.max(1,Math.min(Math.floor(e),t.length));let a=0;const i=async()=>{for(;a<t.length;){const o=a++;r[o]=await n(t[o],o)}};return await Promise.all(Array.from({length:s},()=>i())),r}function Ly(t){return t.split("/").filter(e=>e!=="")}function yr(t){const e=Ly(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}const Oy=16;async function xy(t,e,n={}){const[r,s,a,i]=await Promise.all([rh(t),sh(t),zm(t),Wm(t)]),o=Rg(r,e,void 0);if(o===void 0)return;const l=n.draft??o.node.item,d=l.template??o.dirTemplate;if(d===void 0)return;const[h,g,f,p]=await Promise.all([Tl(t,d),iT(t,d),oT(t,d),ih(t)]),v=Pd(h,s),T={...o.node,item:l};let _,E=[];if(n.media!==void 0)_=n.media;else{const C=Ry(T,v),H=await Dy(t,[C],n.imageEncoder,Oy);_=ky(C,H.imageInfoByPublished,H.fileUrlByPublished),E=H.mediaArtifacts}return{html:Md({template:h,scope:vh(l),components:s,context:Dg(r),media:_,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...p!==void 0&&{document:p},...g!==void 0&&{templateStyle:g},...f!==void 0&&{templateScript:f}}),mediaArtifacts:E}}function Rg(t,e,n){const r=t.defaultTemplate??n;for(const s of t.children)if(s.kind==="item"){if(s.path===e)return{node:s,dirTemplate:r}}else{const a=Rg(s,e,r);if(a!==void 0)return a}}function Ry(t,e){const n=Py(t.path),r=t.item.fields,s=[];for(const l of e.fileFields)for(const d of K0(r[l]))s.push({ref:d,published:G0(n,d)});const a=[],i=new Set,o=l=>{i.has(l)||(i.add(l),a.push({ref:l,published:G0(n,l)}))};for(const l of e.imageFields)for(const d of K0(r[l]))o(d);for(const l of e.richTextFields){const d=r[l];if(typeof d=="string")for(const h of My(d))o(h)}return{images:a,files:s}}async function Dy(t,e,n,r,s){const a=g=>{const f=new Set,p=[];for(const v of e)for(const{published:T}of g(v))f.has(T)||(f.add(T),p.push(T));return p},i=[],o=a(g=>g.files),l=await z0(o,r,async g=>await W0(t,`content/${g}`)),d=new Map;o.forEach((g,f)=>{const p=l[f];p!==void 0&&(i.push({path:g,contents:p}),d.set(g,`/${g}`))});const h=new Map;if(n!==void 0){const g=a(p=>p.images),f=await z0(g,r,async p=>{const v=await W0(t,`content/${p}`);return v===void 0?void 0:await _y(v,p,n)});g.forEach((p,v)=>{const T=f[v];T!==void 0&&(i.push(...T.artifacts),h.set(p,T.info))})}return{mediaArtifacts:i,imageInfoByPublished:h,fileUrlByPublished:d}}function ky(t,e,n){const r=new Map;for(const{ref:a,published:i}of t.images){const o=e.get(i);o!==void 0&&r.set(a,o)}const s=new Map;for(const{ref:a,published:i}of t.files){const o=n.get(i);o!==void 0&&s.set(a,o)}return{image:a=>r.get(a),file:a=>s.get(a)}}async function W0(t,e){try{return await t.readBytes(e)}catch{return}}function Py(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function G0(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function My(t){const e=[],n=r=>{for(const s of r)if(Qn(s)){if(s.tagName==="img"){const a=xt(s,"src");a!==void 0&&By(a)&&e.push(a)}n(s.childNodes)}};return n(Zs(t)),e}function By(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function K0(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function vh(t){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated}}}function Fy(t){const e=new Map,n=new Map,r=s=>{n.set(s.path,s);for(const a of s.children)a.kind==="item"?e.set(a.path,a):r(a)};return r(t),{items:e,dirs:n}}function V0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function Dg(t){const{items:e,dirs:n}=Fy(t),r=s=>({url:yr(s.path),fields:vh(s.item)});return{collection(s,a){var f;const i=n.get(V0(s));if(i===void 0)return[];const o=((f=i.collection)==null?void 0:f.recursive)??!1,l=[],d=p=>{for(const v of p.children)v.kind==="item"?v.slug!=="index"&&v.item.isPublished&&l.push(v):o&&d(v)};d(i);const h=Uy(l,a.sort);return(a.limit!==void 0?h.slice(0,a.limit):h).map(r)},reference(s){const a=e.get(V0(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function Uy(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const o=vh(i.item)[n];return o==null?"":String(o)},a=[...t].sort((i,o)=>s(i).localeCompare(s(o)));return r==="desc"?a.reverse():a}async function Hy(t){var j;const[e,n,r]=await Promise.all([rh(t),sh(t),ih(t)]),{items:s,dirs:a,published:i}=qy(e);let o=null;if(r!==void 0)try{o=Pd(r,n)}catch{o=null}const l=(o==null?void 0:o.requiredFields)??[],d=(o==null?void 0:o.constraints)??new Map,h=[],g=(b,R,k,D)=>{h.push({severity:b,code:R,message:k,...D!==void 0&&{path:D}})},f=(b,R,k)=>{const D=s.get(Q0(b));D===void 0?g("error","reference-missing",`"${R}" references "${b}" (${k}), which does not exist.`,R):D.item.isPublished||g("error","reference-unpublished",`"${R}" references "${b}" (${k}), which is not published.`,R)},p=(b,R,k)=>{for(const[D,{minLength:W,maxLength:Y}]of b){const B=R[D];if(typeof B!="string"||B==="")continue;const{length:z}=B;W!==void 0&&z<W&&g("warning","value-too-short",`"${k}" field "${D}" is ${z} characters; the minimum is ${W}.`,k),Y!==void 0&&z>Y&&g("warning","value-too-long",`"${k}" field "${D}" is ${z} characters; the maximum is ${Y}.`,k)}},v=new Map,T=new Map,_=async b=>{const R=v.get(b);if(R!==void 0||v.has(b))return R??null;let k;try{const D=await Tl(t,b);T.set(b,D),k=Pd(D,n)}catch{k=null}return v.set(b,k),k},E=new Map,O=b=>{const R=E.get(b);if(R!==void 0)return R;const k=T.get(b),D=new Set(k!==void 0?_s(k,n).map(W=>W.name):[]);return E.set(b,D),D},C=new Map,H=async b=>{if(C.has(b))return C.get(b)??null;const R=await J(b);if(R===null)return C.set(b,null),null;let k;try{k=await Tl(t,R)}catch{return C.set(b,null),null}const D=T.get(b);if(D===void 0)return C.set(b,null),null;const W=iy(_s(k,n),_s(D,n)),Y=new Set(W.typeChanged.filter(B=>B.destructive&&Ya(B.from)!==Ya(B.to)).map(B=>B.name));return C.set(b,Y),Y},M=new Map,J=async b=>{if(M.has(b))return M.get(b)??null;const R=b.lastIndexOf("/"),k=R===-1?"templates":`templates/${b.slice(0,R)}`,D=R===-1?b:b.slice(R+1);let W;try{W=await t.list(k)}catch{return M.set(b,null),null}let Y=0,B=null;const z=`${D}@v`;for(const K of W){if(K.kind!=="file"||!K.name.endsWith(".html"))continue;const te=K.name.slice(0,-5);if(!te.startsWith(z))continue;const he=oy(te);he!==null&&he>Y&&(Y=he,B=R===-1?te:`${b.slice(0,R)}/${te}`)}return M.set(b,B),B},U=new Map;for(const{node:b,templateName:R}of i){const k=U.get(yr(b.path))??[];k.push(b.path),U.set(yr(b.path),k);const D=((j=b.parseDiagnostics)==null?void 0:j.unknownTopLevelKeys)??[];if(D.length>0&&g("warning","content.unknown-top-level-key",`"${b.path}" has top-level key${D.length===1?"":"s"} the parser does not recognise: ${D.map(B=>`"${B}"`).join(", ")}. They were dropped — content values belong under "fields" (and system keys are case-sensitive: "isPublished", not "IsPublished").`,b.path),R===void 0){g("error","no-template",`"${b.path}" has no template (no per-item or folder default).`,b.path);continue}const W=await _(R);if(W===null){const B=kd(R)?" (the snapshot may have been deleted while this item still pins to it — restore it, rebind the item to current via the Migrations workspace, or delete this item).":"";g("error","template-missing",`"${b.path}" uses template "${R}", which does not exist.${B}`,b.path);continue}if(!kd(R)){const B=O(R),z=Object.keys(b.item.fields),K=z.filter(he=>!B.has(he));K.length>0&&g("warning","content.schema-drift",`"${b.path}" has field${K.length===1?"":"s"} not rendered by template "${R}": ${K.map(he=>`"${he}"`).join(", ")}. Open the Migrations workspace to drop, rename, or keep them.`,b.path);const te=await H(R);if(te!==null&&te.size>0){const he=z.filter(Ee=>te.has(Ee));he.length>0&&g("warning","content.type-drift",`"${b.path}" has field${he.length===1?"":"s"} whose stored value now renders under a different kind in template "${R}": ${he.map(Ee=>`"${Ee}"`).join(", ")}. The value carries over but may look different (e.g. rich text shown as escaped text). Re-edit the field, or revert the template's type change if it wasn't intended.`,b.path)}}const Y=jy(b.item);for(const B of W.requiredFields)X0(Y[B])&&g("error","required-empty",`"${b.path}" is missing required field "${B}".`,b.path);for(const B of l)X0(Y[B])&&g("error","required-empty",`"${b.path}" is missing required meta field "${B}" (document shell).`,b.path);p(W.constraints,Y,b.path),p(d,Y,b.path);for(const B of W.queryLoopPaths)a.has(Q0(B))||g("error","loop-target-missing",`"${b.path}" loops over "${B}", which is not a directory.`,b.path);for(const B of W.curatedLoopFields)for(const z of $y(b.item.fields[B]))f(z,b.path,`field "${B}"`);for(const[B,z]of Object.entries(Y)){if(typeof z!="string")continue;const K=tc(z);if(K!==void 0&&f(K,b.path,`field "${B}"`),W.richTextFields.includes(B))for(const te of H0(z))f(te,b.path,`field "${B}"`)}}const G=st.templates;if(o!==null)for(const b of o.references)f(b,`${G}/${hu}.html`,"link");for(const[b,R]of v)if(R!==null)for(const k of R.references)f(k,`${G}/${b}.html`,"link");for(const[b,R]of n)for(const k of H0(R))f(k,`${st.components}/${b}.html`,"link");for(const[b,R]of U)R.length>1&&g("error","url-collision",`URL ${b} is produced by multiple items: ${R.join(", ")}.`);const V=new Map;for(const b of await Yy(t)){const k=b.slice(b.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),D=V.get(k)??[];D.push(`${st.components}/${b}`),V.set(k,D)}for(const[b,R]of[...V].sort(([k],[D])=>k.localeCompare(D)))R.length>1&&g("error","component-tag-collision",`Multiple components resolve to <${b}>: ${R.join(", ")}.`);const ee=h.filter(b=>b.severity==="error"),y=h.filter(b=>b.severity==="warning");return{diagnostics:h,errors:ee,warnings:y,ok:ee.length===0}}function qy(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const o=a.defaultTemplate??i;for(const l of a.children){if(l.kind==="dir"){s(l,o);continue}e.set(l.path,l),l.item.isPublished&&r.push({node:l,templateName:l.item.template??o})}};return s(t,void 0),{items:e,dirs:n,published:r}}function jy(t){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated}}}function X0(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function $y(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Q0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function Yy(t){const e=st.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const o=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,o):i.name.endsWith(".html")&&n.push(o)}};return await r(e,""),n.sort()}function Hc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let kg="";function Ba(t){return`${kg}${t}`}function zy(t){kg=t.replace(/\/+$/,"")}async function Wy(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&zy(e.apiUrl)}catch{}}async function Ke(t,e={}){const n=typeof t=="string"?Ba(t):t,r=await Z0(n,e,ht.token);if(r.status!==401||ht.token===null)return r;const s=await ht.refresh();return s===null?r:Z0(n,e,s)}async function Z0(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function Ja(t,e){const n=await Ke(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const ku="nanoesis.jwt",Gy=540*1e3;function Ky(){let t=Q("loading"),e=Q(null),n=Q(null),r=Q(!1),s=null;function a(E,O){A(e,E,!0),A(n,O,!0),A(t,"authenticated"),localStorage.setItem(ku,E),o()}function i(){A(e,null),A(n,null),A(t,"unauthenticated"),localStorage.removeItem(ku),l()}function o(){l(),s=setInterval(()=>{d()},Gy)}function l(){s!==null&&(clearInterval(s),s=null)}async function d(){if(u(e)===null)return null;const E=u(e),O=await fetch(Ba("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${E}`}});if(!O.ok)return i(),null;const C=await O.json().catch(()=>({}));return!C.ok||C.token===void 0||C.principal===void 0?(i(),null):(a(C.token,C.principal),C.token)}async function h(){A(t,"loading");let E;try{E=await fetch(Ba("/api/auth/state"))}catch{A(t,"no-auth");return}if(E.status===404){A(t,"no-auth");return}if(!E.ok){A(t,"unauthenticated");return}const O=await E.json();A(r,O.firstRun,!0);const C=localStorage.getItem(ku);C!==null&&C!==""&&(A(e,C,!0),await d()!==null)||A(t,"unauthenticated")}async function g(E,O){const C=await fetch(Ba("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:E,password:O})}),H=await C.json().catch(()=>({}));return!C.ok||!H.ok||H.token===void 0||H.principal===void 0?{ok:!1,error:H.error??`HTTP ${C.status}`}:(A(r,!1),a(H.token,H.principal),{ok:!0})}async function f(){if(u(e)!==null)try{await Ke("/api/logout",{method:"POST"})}catch{}i()}async function p(E,O){const C=await Ke("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:E,newPassword:O})}),H=await C.json().catch(()=>({}));return!C.ok||!H.ok||H.token===void 0?{ok:!1,error:H.error??`HTTP ${C.status}`}:(A(e,H.token,!0),localStorage.setItem(ku,H.token),{ok:!0})}async function v(){const E=await Ke("/api/me/token",{method:"POST"}),O=await E.json().catch(()=>({}));return!E.ok||O.ok!==!0||O.token===void 0?{ok:!1,error:O.error??`HTTP ${E.status}`}:{ok:!0,token:O.token,...O.expiresAt!==void 0&&{expiresAt:O.expiresAt}}}async function T(){const E=await Ke("/api/me/token",{method:"DELETE"});return E.ok?{ok:!0}:{ok:!1,error:(await E.json().catch(()=>({}))).error??`HTTP ${E.status}`}}function _(){return u(t)==="no-auth"}return{get status(){return u(t)},get token(){return u(e)},get principal(){return u(n)},get firstRun(){return u(r)},get canAuthor(){return _()||Hc(u(n),"author")},get canDevelop(){return _()||Hc(u(n),"developer")},get isAdmin(){return _()||Hc(u(n),"admin")},init:h,login:g,logout:f,refresh:d,changePassword:p,createMcpToken:v,revokeMcpTokens:T}}const ht=Ky(),J0={name:null,logoUrl:null};async function Vy(){try{const t=await fetch(Ba("/api/branding"));if(!t.ok)return J0;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:Ba(e.logoUrl)}}catch{return J0}}function Xy(t){return Ja("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function Qy(t){return Ja("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function Zy(){return Ja("/api/branding/logo",{method:"DELETE"})}function Jy(){let t=Q(null),e=Q(null);async function n(){const r=await Vy();A(t,r.name,!0),A(e,r.logoUrl,!0)}return{get name(){return u(t)},get logoUrl(){return u(e)},load:n}}const xn=Jy();let Do=Q(null);const e3={get pending(){return u(Do)}};function ep(t=""){return new Promise(e=>{A(Do,{current:t,resolve:e},!0)})}function Pu(t){u(Do)!==null&&(u(Do).resolve(t),A(Do,null))}var t3=$(`<h2 class="svelte-trwq3g">Image description</h2> <p class="hint svelte-trwq3g">Describe the image for readers using a screen reader and for when it fails to load.
|
|
10
|
-
Leave it empty if the image is purely decorative.</p> <label class="field svelte-trwq3g"><span class="svelte-trwq3g">Alt text</span> <textarea rows="3" placeholder="e.g. Two people texting, frowning at their phones" class="svelte-trwq3g"></textarea></label> <div class="actions svelte-trwq3g"><button type="button" class="ghost svelte-trwq3g">Cancel</button> <button type="button" class="primary svelte-trwq3g">Save</button></div>`,1),n3=$('<dialog aria-label="Image description" class="svelte-trwq3g"><!></dialog>');function r3(t,e){it(e,!0);let n=Q(void 0),r=Q("");const s=Ae(()=>e3.pending);Rt(()=>{var d,h;if(u(s)===null){(d=u(n))==null||d.close();return}A(r,u(s).current,!0),(h=u(n))==null||h.showModal()});function a(){Pu(u(r).trim())}var i=n3(),o=N(i);{var l=d=>{var h=t3(),g=I(tt(h),4),f=I(N(g),2);ja(f,!0);var p=I(g,2),v=N(p),T=I(v,2);ie("keydown",f,_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),a())}),yt(f,()=>u(r),_=>A(r,_)),ie("click",v,()=>Pu(null)),ie("click",T,a),F(d,h)};ce(o,d=>{u(s)!==null&&d(l)})}hn(i,d=>A(n,d),()=>u(n)),Ue("close",i,()=>Pu(null)),Ue("cancel",i,()=>Pu(null)),F(t,i),ot()}_t(["keydown","click"]);const s3="modulepreload",a3=function(t,e){return new URL(t,e).href},tp={},np=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let i=function(h){return Promise.all(h.map(g=>Promise.resolve(g).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=i(n.map(h=>{if(h=a3(h,r),h in tp)return;tp[h]=!0;const g=h.endsWith(".css"),f=g?'[rel="stylesheet"]':"";if(!!r)for(let T=o.length-1;T>=0;T--){const _=o[T];if(_.href===h&&(!g||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${f}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":s3,g||(v.as="script"),v.crossOrigin="",v.href=h,d&&v.setAttribute("nonce",d),document.head.appendChild(v),g)return new Promise((T,_)=>{v.addEventListener("load",T),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return s.then(i=>{for(const o of i||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function ra(t){return Array.isArray?Array.isArray(t):Mg(t)==="[object Array]"}function i3(t){if(typeof t=="string")return t;if(typeof t=="bigint")return t.toString();const e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function qd(t){return t==null?"":i3(t)}function Rn(t){return typeof t=="string"}function ol(t){return typeof t=="number"}function o3(t){return t===!0||t===!1||u3(t)&&Mg(t)=="[object Boolean]"}function Pg(t){return typeof t=="object"}function u3(t){return Pg(t)&&t!==null}function $n(t){return t!=null}function Mu(t){return!t.trim().length}function Mg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const l3="Incorrect 'index' type",c3=t=>`Invalid value for key ${t}`,d3=t=>`Pattern length exceeds max of ${t}.`,f3=t=>`Missing ${t} property in key`,h3=t=>`Property 'weight' in key '${t}' must be a positive integer`,rp=Object.prototype.hasOwnProperty;class p3{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{const s=Bg(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bg(t){let e=null,n=null,r=null,s=1,a=null;if(Rn(t)||ra(t))r=t,e=sp(t),n=jd(t);else{if(!rp.call(t,"name"))throw new Error(f3("name"));const i=t.name;if(r=i,rp.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(h3(i));e=sp(i),n=jd(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function sp(t){return ra(t)?t:t.split(".")}function jd(t){return ra(t)?t.join("."):t}function m3(t,e){const n=[];let r=!1;const s=(a,i,o,l)=>{if($n(a))if(!i[o])n.push(l!==void 0?{v:a,i:l}:a);else{const d=i[o],h=a[d];if(!$n(h))return;if(o===i.length-1&&(Rn(h)||ol(h)||o3(h)||typeof h=="bigint"))n.push(l!==void 0?{v:qd(h),i:l}:qd(h));else if(ra(h)){r=!0;for(let g=0,f=h.length;g<f;g+=1)s(h[g],i,o+1,g)}else i.length&&s(h,i,o+1,l)}};return s(t,Rn(e)?e.split("."):e,0),r?n:n[0]}const g3={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},v3={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},b3={location:0,threshold:.6,distance:100},E3={useExtendedSearch:!1,useTokenSearch:!1,getFn:m3,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},qe=Object.freeze({...v3,...g3,...b3,...E3}),_3=/[^ ]+/g;function T3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(_3).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),o=parseFloat(Math.round(i*r)/r);return n.set(a,o),o},clear(){n.clear()}}}class bh{constructor({getFn:e=qe.getFn,fieldNormWeight:n=qe.fieldNormWeight}={}){this.norm=T3(n,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,Rn(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();Rn(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}removeAll(e){for(let n=e.length-1;n>=0;n-=1)this.records.splice(e[n],1);for(let n=0,r=this.records.length;n<r;n+=1)this.records[n].i=n}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!$n(e)||Mu(e))return;const r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){const r={i:n,$:{}};this.keys.forEach((s,a)=>{const i=s.getFn?s.getFn(e):this.getFn(e,s.path);if($n(i)){if(ra(i)){const o=[];for(let l=0,d=i.length;l<d;l+=1){const h=i[l];if($n(h)){if(Rn(h)){if(!Mu(h)){const g={v:h,i:l,n:this.norm.get(h)};o.push(g)}}else if($n(h.v)){const g=Rn(h.v)?h.v:qd(h.v);if(!Mu(g)){const f={v:g,i:h.i,n:this.norm.get(g)};o.push(f)}}}}r.$[a]=o}else if(Rn(i)&&!Mu(i)){const o={v:i,n:this.norm.get(i)};r.$[a]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function Fg(t,e,{getFn:n=qe.getFn,fieldNormWeight:r=qe.fieldNormWeight}={}){const s=new bh({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(Bg)),s.setSources(e),s.create(),s}function A3(t,{getFn:e=qe.getFn,fieldNormWeight:n=qe.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new bh({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function y3(t=[],e=qe.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const o=t[a];o&&r===-1?r=a:!o&&r!==-1&&(s=a-1,s-r+1>=e&&n.push([r,s]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const Ea=32;function N3(t,e,n,{location:r=qe.location,distance:s=qe.distance,threshold:a=qe.threshold,findAllMatches:i=qe.findAllMatches,minMatchCharLength:o=qe.minMatchCharLength,includeMatches:l=qe.includeMatches,ignoreLocation:d=qe.ignoreLocation}={}){if(e.length>Ea)throw new Error(d3(Ea));const h=e.length,g=t.length,f=Math.max(0,Math.min(r,g));let p=a,v=f;const T=(G,V)=>{const ee=G/h;if(d)return ee;const y=Math.abs(f-V);return s?ee+y/s:y?1:ee},_=o>1||l,E=_?Array(g):[];let O;for(;(O=t.indexOf(e,v))>-1;){const G=T(0,O);if(p=Math.min(G,p),v=O+h,_){let V=0;for(;V<h;)E[O+V]=1,V+=1}}v=-1;let C=[],H=1,M=h+g;const J=1<<h-1;for(let G=0;G<h;G+=1){let V=0,ee=M;for(;V<ee;)T(G,f+ee)<=p?V=ee:M=ee,ee=Math.floor((M-V)/2+V);M=ee;let y=Math.max(1,f-ee+1);const j=i?g:Math.min(f+ee,g)+h,b=Array(j+2);b[j+1]=(1<<G)-1;for(let k=j;k>=y;k-=1){const D=k-1,W=n[t[D]];if(_&&(E[D]=+!!W),b[k]=(b[k+1]<<1|1)&W,G&&(b[k]|=(C[k+1]|C[k])<<1|1|C[k+1]),b[k]&J&&(H=T(G,D),H<=p)){if(p=H,v=D,v<=f)break;y=Math.max(1,2*f-v)}}if(T(G+1,f)>p)break;C=b}const U={isMatch:v>=0,score:Math.max(.001,H)};if(_){const G=y3(E,o);G.length?l&&(U.indices=G):U.isMatch=!1}return U}function S3(t){const e={};for(let n=0,r=t.length;n<r;n+=1){const s=t.charAt(n);e[s]=(e[s]||0)|1<<r-n-1}return e}function Eh(t){if(t.length<=1)return t;t.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const e=[t[0]];for(let n=1,r=t.length;n<r;n+=1){const s=e[e.length-1],a=t[n];a[0]<=s[1]+1?s[1]=Math.max(s[1],a[1]):e.push(a)}return e}const Ug={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},w3=new RegExp("["+Object.keys(Ug).join("")+"]","g"),zo=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(w3,e=>Ug[e]):t=>t;class _h{constructor(e,{location:n=qe.location,threshold:r=qe.threshold,distance:s=qe.distance,includeMatches:a=qe.includeMatches,findAllMatches:i=qe.findAllMatches,minMatchCharLength:o=qe.minMatchCharLength,isCaseSensitive:l=qe.isCaseSensitive,ignoreDiacritics:d=qe.ignoreDiacritics,ignoreLocation:h=qe.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:h},e=l?e:e.toLowerCase(),e=d?zo(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(p,v)=>{this.chunks.push({pattern:p,alphabet:S3(p),startIndex:v})},f=this.pattern.length;if(f>Ea){let p=0;const v=f%Ea,T=f-v;for(;p<T;)g(this.pattern.substr(p,Ea),p),p+=Ea;if(v){const _=f-Ea;g(this.pattern.substr(_),_)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?zo(e):e,this.pattern===e){const T={isMatch:!0,score:0};return s&&(T.indices=[[0,e.length-1]]),T}const{location:a,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:d,ignoreLocation:h}=this.options,g=[];let f=0,p=!1;this.chunks.forEach(({pattern:T,alphabet:_,startIndex:E})=>{const{isMatch:O,score:C,indices:H}=N3(e,T,_,{location:a+E,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:d,includeMatches:s,ignoreLocation:h});O&&(p=!0),f+=C,O&&H&&g.push(...H)});const v={isMatch:p,score:p?f/this.chunks.length:1};return p&&s&&(v.indices=Eh(g)),v}}class sa{constructor(e){this.pattern=e}static isMultiMatch(e){return ap(e,this.multiRegex)}static isSingleMatch(e){return ap(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function ap(t,e){const n=t.match(e);return n?n[1]:null}class I3 extends sa{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class C3 extends sa{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class L3 extends sa{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class O3 extends sa{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class x3 extends sa{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class R3 extends sa{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class Hg extends sa{constructor(e,{location:n=qe.location,threshold:r=qe.threshold,distance:s=qe.distance,includeMatches:a=qe.includeMatches,findAllMatches:i=qe.findAllMatches,minMatchCharLength:o=qe.minMatchCharLength,isCaseSensitive:l=qe.isCaseSensitive,ignoreDiacritics:d=qe.ignoreDiacritics,ignoreLocation:h=qe.ignoreLocation}={}){super(e),this._bitapSearch=new _h(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class qg extends sa{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const s=[],a=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+a,s.push([r,n-1]);const i=!!s.length;return{isMatch:i,score:i?0:1,indices:s}}}const $d=[I3,qg,L3,O3,R3,x3,C3,Hg],ip=$d.length,D3="\0",k3="|";function P3(t){const e=[],n=t.length;let r=0;for(;r<n;){for(;r<n&&t[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&t[s]!==" "&&t[s]!=='"';)s++;if(s<n&&t[s]==='"'){for(s++;s<n;){if(t[s]==='"'){const a=s+1;if(a>=n||t[a]===" "){s++;break}if(t[a]==="$"&&(a+1>=n||t[a+1]===" ")){s+=2;break}}s++}e.push(t.substring(r,s)),r=s}else{for(;s<n&&t[s]!==" ";)s++;e.push(t.substring(r,s)),r=s}}return e}function M3(t,e={}){return t.replace(/\\\|/g,D3).split(k3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=P3(s.trim()).filter(o=>o&&!!o.trim()),i=[];for(let o=0,l=a.length;o<l;o+=1){const d=a[o];let h=!1,g=-1;for(;!h&&++g<ip;){const f=$d[g],p=f.isMultiMatch(d);p&&(i.push(new f(p,e)),h=!0)}if(!h)for(g=-1;++g<ip;){const f=$d[g],p=f.isSingleMatch(d);if(p){i.push(new f(p,e));break}}}return i})}const B3=new Set([Hg.type,qg.type]);class F3{constructor(e,{isCaseSensitive:n=qe.isCaseSensitive,ignoreDiacritics:r=qe.ignoreDiacritics,includeMatches:s=qe.includeMatches,minMatchCharLength:a=qe.minMatchCharLength,ignoreLocation:i=qe.ignoreLocation,findAllMatches:o=qe.findAllMatches,location:l=qe.location,threshold:d=qe.threshold,distance:h=qe.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:o,ignoreLocation:i,location:l,threshold:d,distance:h},e=n?e:e.toLowerCase(),e=r?zo(e):e,this.pattern=e,this.query=M3(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:s,ignoreDiacritics:a}=this.options;e=s?e:e.toLowerCase(),e=a?zo(e):e;let i=0;const o=[];let l=0,d=!1;for(let h=0,g=n.length;h<g;h+=1){const f=n[h];o.length=0,i=0,d=!1;for(let p=0,v=f.length;p<v;p+=1){const T=f[p],{isMatch:_,indices:E,score:O}=T.search(e);if(_){i+=1,l+=O;const C=T.constructor.type;C.startsWith("inverse")&&(d=!0),r&&(B3.has(C)?o.push(...E):o.push(E))}else{l=0,i=0,o.length=0,d=!1;break}}if(i){const p={isMatch:!0,score:l/i};return d&&(p.hasInverse=!0),r&&(p.indices=Eh(o)),p}}return{isMatch:!1,score:1}}}const Yd=[];function Th(...t){Yd.push(...t)}function wl(t,e){for(let n=0,r=Yd.length;n<r;n+=1){const s=Yd[n];if(s.condition(t,e))return new s(t,e)}return new _h(t,e)}const Il={AND:"$and",OR:"$or"},zd={PATH:"$path",PATTERN:"$val"},Wd=t=>!!(t[Il.AND]||t[Il.OR]),U3=t=>!!t[zd.PATH],H3=t=>!ra(t)&&Pg(t)&&!Wd(t),op=t=>({[Il.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function jg(t,e,{auto:n=!0}={}){const r=s=>{if(Rn(s)){const l={keyId:null,pattern:s};return n&&(l.searcher=wl(s,e)),l}const a=Object.keys(s),i=U3(s);if(!i&&a.length>1&&!Wd(s))return r(op(s));if(H3(s)){const l=i?s[zd.PATH]:a[0],d=i?s[zd.PATTERN]:s[l];if(!Rn(d))throw new Error(c3(l));const h={keyId:jd(l),pattern:d};return n&&(h.searcher=wl(d,e)),h}const o={children:[],operator:a[0]};return a.forEach(l=>{const d=s[l];ra(d)&&d.forEach(h=>{o.children.push(r(h))})}),o};return Wd(t)||(t=op(t)),r(t)}function Gd(t,{ignoreFieldNorm:e=qe.ignoreFieldNorm}){let n=1;return t.forEach(({key:r,norm:s,score:a})=>{const i=r?r.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(e?1:s))}),n}function q3(t,{ignoreFieldNorm:e=qe.ignoreFieldNorm}){t.forEach(n=>{n.score=Gd(n.matches,{ignoreFieldNorm:e})})}class j3{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const n=this.heap;for(;e>0;){const r=e-1>>1;if(n[e].score<=n[r].score)break;const s=n[e];n[e]=n[r],n[r]=s,e=r}}_sinkDown(e){const n=this.heap,r=n.length;let s=e;do{e=s;const a=2*e+1,i=2*e+2;if(a<r&&n[a].score>n[s].score&&(s=a),i<r&&n[i].score>n[s].score&&(s=i),s!==e){const o=n[e];n[e]=n[s],n[s]=o}}while(s!==e)}}function $3(t,e){const n=t.matches;e.matches=[],$n(n)&&n.forEach(r=>{if(!$n(r.indices)||!r.indices.length)return;const{indices:s,value:a}=r,i={indices:s,value:a};r.key&&(i.key=r.key.src),r.idx>-1&&(i.refIndex=r.idx),e.matches.push(i)})}function Y3(t,e){e.score=t.score}function z3(t,e,{includeMatches:n=qe.includeMatches,includeScore:r=qe.includeScore}={}){const s=[];return n&&s.push($3),r&&s.push(Y3),t.map(a=>{const{idx:i}=a,o={item:e[i],refIndex:i};return s.length&&s.forEach(l=>{l(a,o)}),o})}const W3=/\b\w+\b/g;function Kd({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=zo(n)),n.match(W3)||[]}}}function G3(t,e,n){const r=new Map,s=new Map;let a=0;function i(o,l,d,h){const g=n.tokenize(o);if(!g.length)return;a++;const f=new Map;for(const p of g)f.set(p,(f.get(p)||0)+1);for(const[p,v]of f){const T={docIdx:l,keyIdx:d,subIdx:h,tf:v};let _=r.get(p);_||(_=[],r.set(p,_)),_.push(T),s.set(p,(s.get(p)||0)+1)}}for(const o of t){const{i:l,v:d,$:h}=o;if(d!==void 0){i(d,l,-1,-1);continue}if(h)for(let g=0;g<e;g++){const f=h[g];if(f)if(Array.isArray(f))for(const p of f)i(p.v,l,g,p.i??-1);else i(f.v,l,g,-1)}}return{terms:r,fieldCount:a,df:s}}function K3(t,e,n,r){const{i:s,v:a,$:i}=e;function o(l,d,h){const g=r.tokenize(l);if(!g.length)return;t.fieldCount++;const f=new Map;for(const p of g)f.set(p,(f.get(p)||0)+1);for(const[p,v]of f){const T={docIdx:s,keyIdx:d,subIdx:h,tf:v};let _=t.terms.get(p);_||(_=[],t.terms.set(p,_)),_.push(T),t.df.set(p,(t.df.get(p)||0)+1)}}if(a!==void 0){o(a,-1,-1);return}if(i)for(let l=0;l<n;l++){const d=i[l];if(d)if(Array.isArray(d))for(const h of d)o(h.v,l,h.i??-1);else o(d.v,l,-1)}}function up(t,e){for(const[n,r]of t.terms){const s=r.filter(i=>i.docIdx!==e),a=r.length-s.length;a>0&&(t.fieldCount-=a,t.df.set(n,(t.df.get(n)||0)-a),s.length===0?(t.terms.delete(n),t.df.delete(n)):t.terms.set(n,s))}}class aa{constructor(e,n,r){this.options={...qe,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new p3(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const n=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,r=wl(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof bh))throw new Error(l3);if(this._myIndex=n||Fg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=Kd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=G3(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if($n(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const n=this._myIndex.records[this._myIndex.records.length-1],r=Kd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});K3(this._invertedIndex,n,this._myIndex.keys.length,r)}}remove(e=()=>!1){const n=[],r=[];for(let s=0,a=this._docs.length;s<a;s+=1)e(this._docs[s],s)&&(n.push(this._docs[s]),r.push(s));if(r.length){if(this._invertedIndex)for(const s of r)up(this._invertedIndex,s);for(let s=r.length-1;s>=0;s-=1)this._docs.splice(r[s],1);this._myIndex.removeAll(r)}return n}removeAt(e){this._invertedIndex&&up(this._invertedIndex,e);const n=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),n}getIndex(){return this._myIndex}search(e,n){const{limit:r=-1}=n||{},{includeMatches:s,includeScore:a,shouldSort:i,sortFn:o,ignoreFieldNorm:l}=this.options;if(Rn(e)&&!e.trim()){let g=this._docs.map((f,p)=>({item:f,refIndex:p}));return ol(r)&&r>-1&&(g=g.slice(0,r)),g}const d=ol(r)&&r>0&&Rn(e);let h;if(d){const g=new j3(r);Rn(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:l}),h=g.extractSorted(o)}else h=Rn(e)?Rn(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),q3(h,{ignoreFieldNorm:l}),i&&h.sort(o),ol(r)&&r>-1&&(h=h.slice(0,r));return z3(h,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{records:a}=this._myIndex,i=n?null:[];return a.forEach(({v:o,i:l,n:d})=>{if(!$n(o))return;const{isMatch:h,score:g,indices:f}=s.searchIn(o);if(h){const p={item:o,idx:l,matches:[{score:g,value:o,norm:d,indices:f}]};n?(p.score=Gd(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):i.push(p)}}),i}_searchLogical(e){const n=jg(e,this.options),r=(o,l,d)=>{if(!("children"in o)){const{keyId:p,searcher:v}=o;let T;return p===null?(T=[],this._myIndex.keys.forEach((_,E)=>{T.push(...this._findMatches({key:_,value:l[E],searcher:v}))})):T=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(l,p),searcher:v}),T&&T.length?[{idx:d,item:l,matches:T}]:[]}const{children:h,operator:g}=o,f=[];for(let p=0,v=h.length;p<v;p+=1){const T=h[p],_=r(T,l,d);if(_.length)f.push(..._);else if(g===Il.AND)return[]}return f},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:o,i:l})=>{if($n(o)){const d=r(n,o,l);d.length&&(a.has(l)||(a.set(l,{idx:l,item:o,matches:[]}),i.push(a.get(l))),d.forEach(({matches:h})=>{a.get(l).matches.push(...h)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,o=n?null:[];return i.forEach(({$:l,i:d})=>{if(!$n(l))return;const h=[];let g=!1,f=!1;if(a.forEach((p,v)=>{const T=this._findMatches({key:p,value:l[v],searcher:s});T.length?(h.push(...T),T[0].hasInverse&&(f=!0)):g=!0}),!(f&&g)&&h.length){const p={idx:d,item:l,matches:h};n?(p.score=Gd(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):o.push(p)}}),o}_findMatches({key:e,value:n,searcher:r}){if(!$n(n))return[];const s=[];if(ra(n))n.forEach(({v:a,i,n:o})=>{if(!$n(a))return;const{isMatch:l,score:d,indices:h,hasInverse:g}=r.searchIn(a);l&&s.push({score:d,key:e,value:a,idx:i,norm:o,indices:h,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:o,score:l,indices:d,hasInverse:h}=r.searchIn(a);o&&s.push({score:l,key:e,value:a,norm:i,indices:d,hasInverse:h})}return s}}class V3{static condition(e,n){return n.useTokenSearch}constructor(e,n){this.options=n,this.analyzer=Kd({isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics});const r=this.analyzer.tokenize(e),s=n._invertedIndex,{df:a,fieldCount:i}=s;this.termSearchers=[],this.idfWeights=[];for(const o of r){this.termSearchers.push(new _h(o,{location:n.location,threshold:n.threshold,distance:n.distance,includeMatches:n.includeMatches,findAllMatches:n.findAllMatches,minMatchCharLength:n.minMatchCharLength,isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics,ignoreLocation:!0}));const l=a.get(o)||0,d=Math.log(1+(i-l+.5)/(l+.5));this.idfWeights.push(d)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let l=0;l<this.termSearchers.length;l++){const d=this.termSearchers[l].searchIn(e),h=this.idfWeights[l];s+=h,d.isMatch&&(a++,r+=h*(1-d.score),d.indices&&n.push(...d.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,o={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(o.indices=Eh(n)),o}}aa.version="7.3.0";aa.createIndex=Fg;aa.parseIndex=A3;aa.config=qe;aa.match=function(t,e,n){return wl(t,{...qe,...n}).searchIn(e)};aa.parseQuery=jg;Th(F3);Th(V3);aa.use=function(...t){t.forEach(e=>Th(e))};function X3(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=l=>{a.has(l.path)||(a.add(l.path),s.push(l))};for(const l of t)l.title.toLowerCase()===r&&i(l);for(const l of t)l.title.toLowerCase().startsWith(r)&&i(l);for(const l of t)l.title.toLowerCase().includes(r)&&i(l);const o=new aa(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const l of o.search(e))i(l.item);return s.slice(0,n)}const Q3=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function $g(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function Yg(...t){return t.filter(e=>e!=="").join("/")}function Z3(t){return Q3.has($g(t))}function J3(t){return Yg(st.content,t,"assets")}function Yi(t,e){return Yg(st.content,t,e)}function rc(t,e){return zg(Yi(t,e))}function zg(t){return Ba(`/api/read?path=${encodeURIComponent(t)}`)}function Wg(t){return`assets/${t}`}function Gg(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=$g(t),s=bs(n)||"image";return r===""?s:`${s}.${r}`}class eN{async list(e){return await(await Ke(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await Ke(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return n.text()}async readBytes(e){const n=await Ke(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return new Uint8Array(await n.arrayBuffer())}async exists(e){return(await(await Ke(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function ul(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function lp(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let qc=Q(0);const Ah={get value(){return u(qc)},bump(){A(qc,u(qc)+1)}};function tN(t){return{image:()=>{},file:e=>nN(e)?rc(t,e):void 0}}function nN(t){return t.startsWith("assets/")}async function Vd(t,e){const n=new Map,r=async a=>(n.has(a)||n.set(a,await e(a)),n.get(a)),s=await sN(t,r);return iN(s,r)}function yh(t){return t.startsWith("/")&&!t.startsWith("//")}function Kg(t){return`data:${t.contentType};base64,${rN(t.bytes)}`}function rN(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}async function sN(t,e){var a;const n=new Set([...t.matchAll(/<link\b[^>]*>/gi)].map(i=>i[0])),r=new Map;for(const i of n){const o=(a=i.match(/\bhref="([^"]*)"/i))==null?void 0:a[1];if(o===void 0||!yh(o))continue;const l=await e(o);if(l!==void 0)if(/\brel="[^"]*stylesheet[^"]*"/i.test(i)){const d=new TextDecoder().decode(l.bytes);r.set(i,`<style>
|
|
9
|
+
}</style>`);h.childNodes=[...p,...h.childNodes]}}return l}function xg(t,e){const n=new Map,r=[];for(const s of e){const a=Xn(s)?xt(s,"slot"):void 0;if(a!==void 0){Xn(s)&&ph(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return qd(t,n,r)}function qd(t,e,n){const r=[];for(const s of t)if(Xn(s)&&s.tagName==="slot"){const a=xt(s,"name"),i=a!==void 0?e.get(a):n;i&&i.length>0?r.push(...i):r.push(...qd(s.childNodes,e,n))}else Xn(s)&&(s.childNodes=qd(s.childNodes,e,n)),r.push(s);return r}async function W0(t,e,n){const r=new Array(t.length),s=Math.max(1,Math.min(Math.floor(e),t.length));let a=0;const i=async()=>{for(;a<t.length;){const o=a++;r[o]=await n(t[o],o)}};return await Promise.all(Array.from({length:s},()=>i())),r}function Ly(t){return t.split("/").filter(e=>e!=="")}function yr(t){const e=Ly(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}const Oy=4;async function xy(t,e,n={}){const[r,s,a,i]=await Promise.all([sh(t),ah(t),zm(t),Wm(t)]),o=Rg(r,e,void 0);if(o===void 0)return;const l=n.draft??o.node.item,d=l.template??o.dirTemplate;if(d===void 0)return;const[f,g,h,p]=await Promise.all([Al(t,d),iT(t,d),oT(t,d),oh(t)]),v=Md(f,s),T={...o.node,item:l};let _,E=[];if(n.media!==void 0)_=n.media;else{const C=Ry(T,v),H=await Dy(t,[C],n.imageEncoder,Oy);_=ky(C,H.imageInfoByPublished,H.fileUrlByPublished),E=H.mediaArtifacts}return{html:Bd({template:f,scope:bh(l),components:s,context:Dg(r),media:_,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...p!==void 0&&{document:p},...g!==void 0&&{templateStyle:g},...h!==void 0&&{templateScript:h}}),mediaArtifacts:E}}function Rg(t,e,n){const r=t.defaultTemplate??n;for(const s of t.children)if(s.kind==="item"){if(s.path===e)return{node:s,dirTemplate:r}}else{const a=Rg(s,e,r);if(a!==void 0)return a}}function Ry(t,e){const n=Py(t.path),r=t.item.fields,s=[];for(const l of e.fileFields)for(const d of V0(r[l]))s.push({ref:d,published:K0(n,d)});const a=[],i=new Set,o=l=>{i.has(l)||(i.add(l),a.push({ref:l,published:K0(n,l)}))};for(const l of e.imageFields)for(const d of V0(r[l]))o(d);for(const l of e.richTextFields){const d=r[l];if(typeof d=="string")for(const f of My(d))o(f)}return{images:a,files:s}}async function Dy(t,e,n,r,s){const a=g=>{const h=new Set,p=[];for(const v of e)for(const{published:T}of g(v))h.has(T)||(h.add(T),p.push(T));return p},i=[],o=a(g=>g.files),l=await W0(o,r,async g=>await G0(t,`content/${g}`)),d=new Map;o.forEach((g,h)=>{const p=l[h];p!==void 0&&(i.push({path:g,contents:p}),d.set(g,`/${g}`))});const f=new Map;if(n!==void 0){const g=a(p=>p.images),h=await W0(g,r,async p=>{const v=await G0(t,`content/${p}`);return v===void 0?void 0:await _y(v,p,n)});g.forEach((p,v)=>{const T=h[v];T!==void 0&&(i.push(...T.artifacts),f.set(p,T.info))})}return{mediaArtifacts:i,imageInfoByPublished:f,fileUrlByPublished:d}}function ky(t,e,n){const r=new Map;for(const{ref:a,published:i}of t.images){const o=e.get(i);o!==void 0&&r.set(a,o)}const s=new Map;for(const{ref:a,published:i}of t.files){const o=n.get(i);o!==void 0&&s.set(a,o)}return{image:a=>r.get(a),file:a=>s.get(a)}}async function G0(t,e){try{return await t.readBytes(e)}catch{return}}function Py(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function K0(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function My(t){const e=[],n=r=>{for(const s of r)if(Xn(s)){if(s.tagName==="img"){const a=xt(s,"src");a!==void 0&&By(a)&&e.push(a)}n(s.childNodes)}};return n(Zs(t)),e}function By(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function V0(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function bh(t){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated}}}function Fy(t){const e=new Map,n=new Map,r=s=>{n.set(s.path,s);for(const a of s.children)a.kind==="item"?e.set(a.path,a):r(a)};return r(t),{items:e,dirs:n}}function X0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function Dg(t){const{items:e,dirs:n}=Fy(t),r=s=>({url:yr(s.path),fields:bh(s.item)});return{collection(s,a){var h;const i=n.get(X0(s));if(i===void 0)return[];const o=((h=i.collection)==null?void 0:h.recursive)??!1,l=[],d=p=>{for(const v of p.children)v.kind==="item"?v.slug!=="index"&&v.item.isPublished&&l.push(v):o&&d(v)};d(i);const f=Uy(l,a.sort);return(a.limit!==void 0?f.slice(0,a.limit):f).map(r)},reference(s){const a=e.get(X0(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function Uy(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const o=bh(i.item)[n];return o==null?"":String(o)},a=[...t].sort((i,o)=>s(i).localeCompare(s(o)));return r==="desc"?a.reverse():a}async function Hy(t){var j;const[e,n,r]=await Promise.all([sh(t),ah(t),oh(t)]),{items:s,dirs:a,published:i}=qy(e);let o=null;if(r!==void 0)try{o=Md(r,n)}catch{o=null}const l=(o==null?void 0:o.requiredFields)??[],d=(o==null?void 0:o.constraints)??new Map,f=[],g=(b,R,k,D)=>{f.push({severity:b,code:R,message:k,...D!==void 0&&{path:D}})},h=(b,R,k)=>{const D=s.get(Z0(b));D===void 0?g("error","reference-missing",`"${R}" references "${b}" (${k}), which does not exist.`,R):D.item.isPublished||g("error","reference-unpublished",`"${R}" references "${b}" (${k}), which is not published.`,R)},p=(b,R,k)=>{for(const[D,{minLength:W,maxLength:Y}]of b){const B=R[D];if(typeof B!="string"||B==="")continue;const{length:z}=B;W!==void 0&&z<W&&g("warning","value-too-short",`"${k}" field "${D}" is ${z} characters; the minimum is ${W}.`,k),Y!==void 0&&z>Y&&g("warning","value-too-long",`"${k}" field "${D}" is ${z} characters; the maximum is ${Y}.`,k)}},v=new Map,T=new Map,_=async b=>{const R=v.get(b);if(R!==void 0||v.has(b))return R??null;let k;try{const D=await Al(t,b);T.set(b,D),k=Md(D,n)}catch{k=null}return v.set(b,k),k},E=new Map,O=b=>{const R=E.get(b);if(R!==void 0)return R;const k=T.get(b),D=new Set(k!==void 0?Ts(k,n).map(W=>W.name):[]);return E.set(b,D),D},C=new Map,H=async b=>{if(C.has(b))return C.get(b)??null;const R=await J(b);if(R===null)return C.set(b,null),null;let k;try{k=await Al(t,R)}catch{return C.set(b,null),null}const D=T.get(b);if(D===void 0)return C.set(b,null),null;const W=iy(Ts(k,n),Ts(D,n)),Y=new Set(W.typeChanged.filter(B=>B.destructive&&Ya(B.from)!==Ya(B.to)).map(B=>B.name));return C.set(b,Y),Y},M=new Map,J=async b=>{if(M.has(b))return M.get(b)??null;const R=b.lastIndexOf("/"),k=R===-1?"templates":`templates/${b.slice(0,R)}`,D=R===-1?b:b.slice(R+1);let W;try{W=await t.list(k)}catch{return M.set(b,null),null}let Y=0,B=null;const z=`${D}@v`;for(const K of W){if(K.kind!=="file"||!K.name.endsWith(".html"))continue;const te=K.name.slice(0,-5);if(!te.startsWith(z))continue;const fe=oy(te);fe!==null&&fe>Y&&(Y=fe,B=R===-1?te:`${b.slice(0,R)}/${te}`)}return M.set(b,B),B},U=new Map;for(const{node:b,templateName:R}of i){const k=U.get(yr(b.path))??[];k.push(b.path),U.set(yr(b.path),k);const D=((j=b.parseDiagnostics)==null?void 0:j.unknownTopLevelKeys)??[];if(D.length>0&&g("warning","content.unknown-top-level-key",`"${b.path}" has top-level key${D.length===1?"":"s"} the parser does not recognise: ${D.map(B=>`"${B}"`).join(", ")}. They were dropped — content values belong under "fields" (and system keys are case-sensitive: "isPublished", not "IsPublished").`,b.path),R===void 0){g("error","no-template",`"${b.path}" has no template (no per-item or folder default).`,b.path);continue}const W=await _(R);if(W===null){const B=Pd(R)?" (the snapshot may have been deleted while this item still pins to it — restore it, rebind the item to current via the Migrations workspace, or delete this item).":"";g("error","template-missing",`"${b.path}" uses template "${R}", which does not exist.${B}`,b.path);continue}if(!Pd(R)){const B=O(R),z=Object.keys(b.item.fields),K=z.filter(fe=>!B.has(fe));K.length>0&&g("warning","content.schema-drift",`"${b.path}" has field${K.length===1?"":"s"} not rendered by template "${R}": ${K.map(fe=>`"${fe}"`).join(", ")}. Open the Migrations workspace to drop, rename, or keep them.`,b.path);const te=await H(R);if(te!==null&&te.size>0){const fe=z.filter(Ee=>te.has(Ee));fe.length>0&&g("warning","content.type-drift",`"${b.path}" has field${fe.length===1?"":"s"} whose stored value now renders under a different kind in template "${R}": ${fe.map(Ee=>`"${Ee}"`).join(", ")}. The value carries over but may look different (e.g. rich text shown as escaped text). Re-edit the field, or revert the template's type change if it wasn't intended.`,b.path)}}const Y=jy(b.item);for(const B of W.requiredFields)Q0(Y[B])&&g("error","required-empty",`"${b.path}" is missing required field "${B}".`,b.path);for(const B of l)Q0(Y[B])&&g("error","required-empty",`"${b.path}" is missing required meta field "${B}" (document shell).`,b.path);p(W.constraints,Y,b.path),p(d,Y,b.path);for(const B of W.queryLoopPaths)a.has(Z0(B))||g("error","loop-target-missing",`"${b.path}" loops over "${B}", which is not a directory.`,b.path);for(const B of W.curatedLoopFields)for(const z of $y(b.item.fields[B]))h(z,b.path,`field "${B}"`);for(const[B,z]of Object.entries(Y)){if(typeof z!="string")continue;const K=nc(z);if(K!==void 0&&h(K,b.path,`field "${B}"`),W.richTextFields.includes(B))for(const te of q0(z))h(te,b.path,`field "${B}"`)}}const G=rt.templates;if(o!==null)for(const b of o.references)h(b,`${G}/${hu}.html`,"link");for(const[b,R]of v)if(R!==null)for(const k of R.references)h(k,`${G}/${b}.html`,"link");for(const[b,R]of n)for(const k of q0(R))h(k,`${rt.components}/${b}.html`,"link");for(const[b,R]of U)R.length>1&&g("error","url-collision",`URL ${b} is produced by multiple items: ${R.join(", ")}.`);const V=new Map;for(const b of await Yy(t)){const k=b.slice(b.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),D=V.get(k)??[];D.push(`${rt.components}/${b}`),V.set(k,D)}for(const[b,R]of[...V].sort(([k],[D])=>k.localeCompare(D)))R.length>1&&g("error","component-tag-collision",`Multiple components resolve to <${b}>: ${R.join(", ")}.`);const ee=f.filter(b=>b.severity==="error"),y=f.filter(b=>b.severity==="warning");return{diagnostics:f,errors:ee,warnings:y,ok:ee.length===0}}function qy(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const o=a.defaultTemplate??i;for(const l of a.children){if(l.kind==="dir"){s(l,o);continue}e.set(l.path,l),l.item.isPublished&&r.push({node:l,templateName:l.item.template??o})}};return s(t,void 0),{items:e,dirs:n,published:r}}function jy(t){return{...t.fields,title:t.title,...t.created!==void 0&&{created:t.created},...t.published!==void 0&&{published:t.published},...t.updated!==void 0&&{updated:t.updated}}}function Q0(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function $y(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Z0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function Yy(t){const e=rt.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const o=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,o):i.name.endsWith(".html")&&n.push(o)}};return await r(e,""),n.sort()}function qc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let kg="";function Ba(t){return`${kg}${t}`}function zy(t){kg=t.replace(/\/+$/,"")}async function Wy(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&zy(e.apiUrl)}catch{}}async function We(t,e={}){const n=typeof t=="string"?Ba(t):t,r=await J0(n,e,pt.token);if(r.status!==401||pt.token===null)return r;const s=await pt.refresh();return s===null?r:J0(n,e,s)}async function J0(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function Ja(t,e){const n=await We(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const ku="nanoesis.jwt",Gy=540*1e3;function Ky(){let t=Q("loading"),e=Q(null),n=Q(null),r=Q(!1),s=null;function a(E,O){A(e,E,!0),A(n,O,!0),A(t,"authenticated"),localStorage.setItem(ku,E),o()}function i(){A(e,null),A(n,null),A(t,"unauthenticated"),localStorage.removeItem(ku),l()}function o(){l(),s=setInterval(()=>{d()},Gy)}function l(){s!==null&&(clearInterval(s),s=null)}async function d(){if(u(e)===null)return null;const E=u(e),O=await fetch(Ba("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${E}`}});if(!O.ok)return i(),null;const C=await O.json().catch(()=>({}));return!C.ok||C.token===void 0||C.principal===void 0?(i(),null):(a(C.token,C.principal),C.token)}async function f(){A(t,"loading");let E;try{E=await fetch(Ba("/api/auth/state"))}catch{A(t,"no-auth");return}if(E.status===404){A(t,"no-auth");return}if(!E.ok){A(t,"unauthenticated");return}const O=await E.json();A(r,O.firstRun,!0);const C=localStorage.getItem(ku);C!==null&&C!==""&&(A(e,C,!0),await d()!==null)||A(t,"unauthenticated")}async function g(E,O){const C=await fetch(Ba("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:E,password:O})}),H=await C.json().catch(()=>({}));return!C.ok||!H.ok||H.token===void 0||H.principal===void 0?{ok:!1,error:H.error??`HTTP ${C.status}`}:(A(r,!1),a(H.token,H.principal),{ok:!0})}async function h(){if(u(e)!==null)try{await We("/api/logout",{method:"POST"})}catch{}i()}async function p(E,O){const C=await We("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:E,newPassword:O})}),H=await C.json().catch(()=>({}));return!C.ok||!H.ok||H.token===void 0?{ok:!1,error:H.error??`HTTP ${C.status}`}:(A(e,H.token,!0),localStorage.setItem(ku,H.token),{ok:!0})}async function v(){const E=await We("/api/me/token",{method:"POST"}),O=await E.json().catch(()=>({}));return!E.ok||O.ok!==!0||O.token===void 0?{ok:!1,error:O.error??`HTTP ${E.status}`}:{ok:!0,token:O.token,...O.expiresAt!==void 0&&{expiresAt:O.expiresAt}}}async function T(){const E=await We("/api/me/token",{method:"DELETE"});return E.ok?{ok:!0}:{ok:!1,error:(await E.json().catch(()=>({}))).error??`HTTP ${E.status}`}}function _(){return u(t)==="no-auth"}return{get status(){return u(t)},get token(){return u(e)},get principal(){return u(n)},get firstRun(){return u(r)},get canAuthor(){return _()||qc(u(n),"author")},get canDevelop(){return _()||qc(u(n),"developer")},get isAdmin(){return _()||qc(u(n),"admin")},init:f,login:g,logout:h,refresh:d,changePassword:p,createMcpToken:v,revokeMcpTokens:T}}const pt=Ky(),ep={name:null,logoUrl:null};async function Vy(){try{const t=await fetch(Ba("/api/branding"));if(!t.ok)return ep;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:Ba(e.logoUrl)}}catch{return ep}}function Xy(t){return Ja("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function Qy(t){return Ja("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function Zy(){return Ja("/api/branding/logo",{method:"DELETE"})}function Jy(){let t=Q(null),e=Q(null);async function n(){const r=await Vy();A(t,r.name,!0),A(e,r.logoUrl,!0)}return{get name(){return u(t)},get logoUrl(){return u(e)},load:n}}const Dn=Jy();let Do=Q(null);const e3={get pending(){return u(Do)}};function tp(t=""){return new Promise(e=>{A(Do,{current:t,resolve:e},!0)})}function Pu(t){u(Do)!==null&&(u(Do).resolve(t),A(Do,null))}var t3=$(`<h2 class="svelte-trwq3g">Image description</h2> <p class="hint svelte-trwq3g">Describe the image for readers using a screen reader and for when it fails to load.
|
|
10
|
+
Leave it empty if the image is purely decorative.</p> <label class="field svelte-trwq3g"><span class="svelte-trwq3g">Alt text</span> <textarea rows="3" placeholder="e.g. Two people texting, frowning at their phones" class="svelte-trwq3g"></textarea></label> <div class="actions svelte-trwq3g"><button type="button" class="ghost svelte-trwq3g">Cancel</button> <button type="button" class="primary svelte-trwq3g">Save</button></div>`,1),n3=$('<dialog aria-label="Image description" class="svelte-trwq3g"><!></dialog>');function r3(t,e){at(e,!0);let n=Q(void 0),r=Q("");const s=_e(()=>e3.pending);Rt(()=>{var d,f;if(u(s)===null){(d=u(n))==null||d.close();return}A(r,u(s).current,!0),(f=u(n))==null||f.showModal()});function a(){Pu(u(r).trim())}var i=n3(),o=N(i);{var l=d=>{var f=t3(),g=I(et(f),4),h=I(N(g),2);ja(h,!0);var p=I(g,2),v=N(p),T=I(v,2);ie("keydown",h,_=>{_.key==="Enter"&&!_.shiftKey&&(_.preventDefault(),a())}),St(h,()=>u(r),_=>A(r,_)),ie("click",v,()=>Pu(null)),ie("click",T,a),F(d,f)};ce(o,d=>{u(s)!==null&&d(l)})}mn(i,d=>A(n,d),()=>u(n)),Ue("close",i,()=>Pu(null)),Ue("cancel",i,()=>Pu(null)),F(t,i),it()}Tt(["keydown","click"]);const s3="modulepreload",a3=function(t,e){return new URL(t,e).href},np={},rp=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){let i=function(f){return Promise.all(f.map(g=>Promise.resolve(g).then(h=>({status:"fulfilled",value:h}),h=>({status:"rejected",reason:h}))))};const o=document.getElementsByTagName("link"),l=document.querySelector("meta[property=csp-nonce]"),d=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=i(n.map(f=>{if(f=a3(f,r),f in np)return;np[f]=!0;const g=f.endsWith(".css"),h=g?'[rel="stylesheet"]':"";if(!!r)for(let T=o.length-1;T>=0;T--){const _=o[T];if(_.href===f&&(!g||_.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${f}"]${h}`))return;const v=document.createElement("link");if(v.rel=g?"stylesheet":s3,g||(v.as="script"),v.crossOrigin="",v.href=f,d&&v.setAttribute("nonce",d),document.head.appendChild(v),g)return new Promise((T,_)=>{v.addEventListener("load",T),v.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function a(i){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=i,window.dispatchEvent(o),!o.defaultPrevented)throw i}return s.then(i=>{for(const o of i||[])o.status==="rejected"&&a(o.reason);return e().catch(a)})};function ra(t){return Array.isArray?Array.isArray(t):Mg(t)==="[object Array]"}function i3(t){if(typeof t=="string")return t;if(typeof t=="bigint")return t.toString();const e=t+"";return e=="0"&&1/t==-1/0?"-0":e}function jd(t){return t==null?"":i3(t)}function kn(t){return typeof t=="string"}function ul(t){return typeof t=="number"}function o3(t){return t===!0||t===!1||u3(t)&&Mg(t)=="[object Boolean]"}function Pg(t){return typeof t=="object"}function u3(t){return Pg(t)&&t!==null}function jn(t){return t!=null}function Mu(t){return!t.trim().length}function Mg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const l3="Incorrect 'index' type",c3=t=>`Invalid value for key ${t}`,d3=t=>`Pattern length exceeds max of ${t}.`,f3=t=>`Missing ${t} property in key`,h3=t=>`Property 'weight' in key '${t}' must be a positive integer`,sp=Object.prototype.hasOwnProperty;class p3{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{const s=Bg(r);this._keys.push(s),this._keyMap[s.id]=s,n+=s.weight}),this._keys.forEach(r=>{r.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function Bg(t){let e=null,n=null,r=null,s=1,a=null;if(kn(t)||ra(t))r=t,e=ap(t),n=$d(t);else{if(!sp.call(t,"name"))throw new Error(f3("name"));const i=t.name;if(r=i,sp.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(h3(i));e=ap(i),n=$d(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function ap(t){return ra(t)?t:t.split(".")}function $d(t){return ra(t)?t.join("."):t}function m3(t,e){const n=[];let r=!1;const s=(a,i,o,l)=>{if(jn(a))if(!i[o])n.push(l!==void 0?{v:a,i:l}:a);else{const d=i[o],f=a[d];if(!jn(f))return;if(o===i.length-1&&(kn(f)||ul(f)||o3(f)||typeof f=="bigint"))n.push(l!==void 0?{v:jd(f),i:l}:jd(f));else if(ra(f)){r=!0;for(let g=0,h=f.length;g<h;g+=1)s(f[g],i,o+1,g)}else i.length&&s(f,i,o+1,l)}};return s(t,kn(e)?e.split("."):e,0),r?n:n[0]}const g3={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},v3={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},b3={location:0,threshold:.6,distance:100},E3={useExtendedSearch:!1,useTokenSearch:!1,getFn:m3,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},qe=Object.freeze({...v3,...g3,...b3,...E3}),_3=/[^ ]+/g;function T3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(_3).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),o=parseFloat(Math.round(i*r)/r);return n.set(a,o),o},clear(){n.clear()}}}class Eh{constructor({getFn:e=qe.getFn,fieldNormWeight:n=qe.fieldNormWeight}={}){this.norm=T3(n,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,r)=>{this._keysMap[n.id]=r})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,kn(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();kn(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,r=this.size();n<r;n+=1)this.records[n].i-=1}removeAll(e){for(let n=e.length-1;n>=0;n-=1)this.records.splice(e[n],1);for(let n=0,r=this.records.length;n<r;n+=1)this.records[n].i=n}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!jn(e)||Mu(e))return;const r={v:e,i:n,n:this.norm.get(e)};this.records.push(r)}_addObject(e,n){const r={i:n,$:{}};this.keys.forEach((s,a)=>{const i=s.getFn?s.getFn(e):this.getFn(e,s.path);if(jn(i)){if(ra(i)){const o=[];for(let l=0,d=i.length;l<d;l+=1){const f=i[l];if(jn(f)){if(kn(f)){if(!Mu(f)){const g={v:f,i:l,n:this.norm.get(f)};o.push(g)}}else if(jn(f.v)){const g=kn(f.v)?f.v:jd(f.v);if(!Mu(g)){const h={v:g,i:f.i,n:this.norm.get(g)};o.push(h)}}}}r.$[a]=o}else if(kn(i)&&!Mu(i)){const o={v:i,n:this.norm.get(i)};r.$[a]=o}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function Fg(t,e,{getFn:n=qe.getFn,fieldNormWeight:r=qe.fieldNormWeight}={}){const s=new Eh({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(Bg)),s.setSources(e),s.create(),s}function A3(t,{getFn:e=qe.getFn,fieldNormWeight:n=qe.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new Eh({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function y3(t=[],e=qe.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const o=t[a];o&&r===-1?r=a:!o&&r!==-1&&(s=a-1,s-r+1>=e&&n.push([r,s]),r=-1)}return t[a-1]&&a-r>=e&&n.push([r,a-1]),n}const Ea=32;function N3(t,e,n,{location:r=qe.location,distance:s=qe.distance,threshold:a=qe.threshold,findAllMatches:i=qe.findAllMatches,minMatchCharLength:o=qe.minMatchCharLength,includeMatches:l=qe.includeMatches,ignoreLocation:d=qe.ignoreLocation}={}){if(e.length>Ea)throw new Error(d3(Ea));const f=e.length,g=t.length,h=Math.max(0,Math.min(r,g));let p=a,v=h;const T=(G,V)=>{const ee=G/f;if(d)return ee;const y=Math.abs(h-V);return s?ee+y/s:y?1:ee},_=o>1||l,E=_?Array(g):[];let O;for(;(O=t.indexOf(e,v))>-1;){const G=T(0,O);if(p=Math.min(G,p),v=O+f,_){let V=0;for(;V<f;)E[O+V]=1,V+=1}}v=-1;let C=[],H=1,M=f+g;const J=1<<f-1;for(let G=0;G<f;G+=1){let V=0,ee=M;for(;V<ee;)T(G,h+ee)<=p?V=ee:M=ee,ee=Math.floor((M-V)/2+V);M=ee;let y=Math.max(1,h-ee+1);const j=i?g:Math.min(h+ee,g)+f,b=Array(j+2);b[j+1]=(1<<G)-1;for(let k=j;k>=y;k-=1){const D=k-1,W=n[t[D]];if(_&&(E[D]=+!!W),b[k]=(b[k+1]<<1|1)&W,G&&(b[k]|=(C[k+1]|C[k])<<1|1|C[k+1]),b[k]&J&&(H=T(G,D),H<=p)){if(p=H,v=D,v<=h)break;y=Math.max(1,2*h-v)}}if(T(G+1,h)>p)break;C=b}const U={isMatch:v>=0,score:Math.max(.001,H)};if(_){const G=y3(E,o);G.length?l&&(U.indices=G):U.isMatch=!1}return U}function S3(t){const e={};for(let n=0,r=t.length;n<r;n+=1){const s=t.charAt(n);e[s]=(e[s]||0)|1<<r-n-1}return e}function _h(t){if(t.length<=1)return t;t.sort((n,r)=>n[0]-r[0]||n[1]-r[1]);const e=[t[0]];for(let n=1,r=t.length;n<r;n+=1){const s=e[e.length-1],a=t[n];a[0]<=s[1]+1?s[1]=Math.max(s[1],a[1]):e.push(a)}return e}const Ug={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},w3=new RegExp("["+Object.keys(Ug).join("")+"]","g"),zo=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,"").replace(w3,e=>Ug[e]):t=>t;class Th{constructor(e,{location:n=qe.location,threshold:r=qe.threshold,distance:s=qe.distance,includeMatches:a=qe.includeMatches,findAllMatches:i=qe.findAllMatches,minMatchCharLength:o=qe.minMatchCharLength,isCaseSensitive:l=qe.isCaseSensitive,ignoreDiacritics:d=qe.ignoreDiacritics,ignoreLocation:f=qe.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:f},e=l?e:e.toLowerCase(),e=d?zo(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(p,v)=>{this.chunks.push({pattern:p,alphabet:S3(p),startIndex:v})},h=this.pattern.length;if(h>Ea){let p=0;const v=h%Ea,T=h-v;for(;p<T;)g(this.pattern.substr(p,Ea),p),p+=Ea;if(v){const _=h-Ea;g(this.pattern.substr(_),_)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?zo(e):e,this.pattern===e){const T={isMatch:!0,score:0};return s&&(T.indices=[[0,e.length-1]]),T}const{location:a,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:d,ignoreLocation:f}=this.options,g=[];let h=0,p=!1;this.chunks.forEach(({pattern:T,alphabet:_,startIndex:E})=>{const{isMatch:O,score:C,indices:H}=N3(e,T,_,{location:a+E,distance:i,threshold:o,findAllMatches:l,minMatchCharLength:d,includeMatches:s,ignoreLocation:f});O&&(p=!0),h+=C,O&&H&&g.push(...H)});const v={isMatch:p,score:p?h/this.chunks.length:1};return p&&s&&(v.indices=_h(g)),v}}class sa{constructor(e){this.pattern=e}static isMultiMatch(e){return ip(e,this.multiRegex)}static isSingleMatch(e){return ip(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function ip(t,e){const n=t.match(e);return n?n[1]:null}class I3 extends sa{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class C3 extends sa{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const r=e.indexOf(this.pattern)===-1;return{isMatch:r,score:r?0:1,indices:[0,e.length-1]}}}class L3 extends sa{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class O3 extends sa{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class x3 extends sa{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class R3 extends sa{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class Hg extends sa{constructor(e,{location:n=qe.location,threshold:r=qe.threshold,distance:s=qe.distance,includeMatches:a=qe.includeMatches,findAllMatches:i=qe.findAllMatches,minMatchCharLength:o=qe.minMatchCharLength,isCaseSensitive:l=qe.isCaseSensitive,ignoreDiacritics:d=qe.ignoreDiacritics,ignoreLocation:f=qe.ignoreLocation}={}){super(e),this._bitapSearch=new Th(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:o,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:f})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class qg extends sa{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,r;const s=[],a=this.pattern.length;for(;(r=e.indexOf(this.pattern,n))>-1;)n=r+a,s.push([r,n-1]);const i=!!s.length;return{isMatch:i,score:i?0:1,indices:s}}}const Yd=[I3,qg,L3,O3,R3,x3,C3,Hg],op=Yd.length,D3="\0",k3="|";function P3(t){const e=[],n=t.length;let r=0;for(;r<n;){for(;r<n&&t[r]===" ";)r++;if(r>=n)break;let s=r;for(;s<n&&t[s]!==" "&&t[s]!=='"';)s++;if(s<n&&t[s]==='"'){for(s++;s<n;){if(t[s]==='"'){const a=s+1;if(a>=n||t[a]===" "){s++;break}if(t[a]==="$"&&(a+1>=n||t[a+1]===" ")){s+=2;break}}s++}e.push(t.substring(r,s)),r=s}else{for(;s<n&&t[s]!==" ";)s++;e.push(t.substring(r,s)),r=s}}return e}function M3(t,e={}){return t.replace(/\\\|/g,D3).split(k3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=P3(s.trim()).filter(o=>o&&!!o.trim()),i=[];for(let o=0,l=a.length;o<l;o+=1){const d=a[o];let f=!1,g=-1;for(;!f&&++g<op;){const h=Yd[g],p=h.isMultiMatch(d);p&&(i.push(new h(p,e)),f=!0)}if(!f)for(g=-1;++g<op;){const h=Yd[g],p=h.isSingleMatch(d);if(p){i.push(new h(p,e));break}}}return i})}const B3=new Set([Hg.type,qg.type]);class F3{constructor(e,{isCaseSensitive:n=qe.isCaseSensitive,ignoreDiacritics:r=qe.ignoreDiacritics,includeMatches:s=qe.includeMatches,minMatchCharLength:a=qe.minMatchCharLength,ignoreLocation:i=qe.ignoreLocation,findAllMatches:o=qe.findAllMatches,location:l=qe.location,threshold:d=qe.threshold,distance:f=qe.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:o,ignoreLocation:i,location:l,threshold:d,distance:f},e=n?e:e.toLowerCase(),e=r?zo(e):e,this.pattern=e,this.query=M3(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:r,isCaseSensitive:s,ignoreDiacritics:a}=this.options;e=s?e:e.toLowerCase(),e=a?zo(e):e;let i=0;const o=[];let l=0,d=!1;for(let f=0,g=n.length;f<g;f+=1){const h=n[f];o.length=0,i=0,d=!1;for(let p=0,v=h.length;p<v;p+=1){const T=h[p],{isMatch:_,indices:E,score:O}=T.search(e);if(_){i+=1,l+=O;const C=T.constructor.type;C.startsWith("inverse")&&(d=!0),r&&(B3.has(C)?o.push(...E):o.push(E))}else{l=0,i=0,o.length=0,d=!1;break}}if(i){const p={isMatch:!0,score:l/i};return d&&(p.hasInverse=!0),r&&(p.indices=_h(o)),p}}return{isMatch:!1,score:1}}}const zd=[];function Ah(...t){zd.push(...t)}function Il(t,e){for(let n=0,r=zd.length;n<r;n+=1){const s=zd[n];if(s.condition(t,e))return new s(t,e)}return new Th(t,e)}const Cl={AND:"$and",OR:"$or"},Wd={PATH:"$path",PATTERN:"$val"},Gd=t=>!!(t[Cl.AND]||t[Cl.OR]),U3=t=>!!t[Wd.PATH],H3=t=>!ra(t)&&Pg(t)&&!Gd(t),up=t=>({[Cl.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function jg(t,e,{auto:n=!0}={}){const r=s=>{if(kn(s)){const l={keyId:null,pattern:s};return n&&(l.searcher=Il(s,e)),l}const a=Object.keys(s),i=U3(s);if(!i&&a.length>1&&!Gd(s))return r(up(s));if(H3(s)){const l=i?s[Wd.PATH]:a[0],d=i?s[Wd.PATTERN]:s[l];if(!kn(d))throw new Error(c3(l));const f={keyId:$d(l),pattern:d};return n&&(f.searcher=Il(d,e)),f}const o={children:[],operator:a[0]};return a.forEach(l=>{const d=s[l];ra(d)&&d.forEach(f=>{o.children.push(r(f))})}),o};return Gd(t)||(t=up(t)),r(t)}function Kd(t,{ignoreFieldNorm:e=qe.ignoreFieldNorm}){let n=1;return t.forEach(({key:r,norm:s,score:a})=>{const i=r?r.weight:null;n*=Math.pow(a===0&&i?Number.EPSILON:a,(i||1)*(e?1:s))}),n}function q3(t,{ignoreFieldNorm:e=qe.ignoreFieldNorm}){t.forEach(n=>{n.score=Kd(n.matches,{ignoreFieldNorm:e})})}class j3{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){const n=this.heap;for(;e>0;){const r=e-1>>1;if(n[e].score<=n[r].score)break;const s=n[e];n[e]=n[r],n[r]=s,e=r}}_sinkDown(e){const n=this.heap,r=n.length;let s=e;do{e=s;const a=2*e+1,i=2*e+2;if(a<r&&n[a].score>n[s].score&&(s=a),i<r&&n[i].score>n[s].score&&(s=i),s!==e){const o=n[e];n[e]=n[s],n[s]=o}}while(s!==e)}}function $3(t,e){const n=t.matches;e.matches=[],jn(n)&&n.forEach(r=>{if(!jn(r.indices)||!r.indices.length)return;const{indices:s,value:a}=r,i={indices:s,value:a};r.key&&(i.key=r.key.src),r.idx>-1&&(i.refIndex=r.idx),e.matches.push(i)})}function Y3(t,e){e.score=t.score}function z3(t,e,{includeMatches:n=qe.includeMatches,includeScore:r=qe.includeScore}={}){const s=[];return n&&s.push($3),r&&s.push(Y3),t.map(a=>{const{idx:i}=a,o={item:e[i],refIndex:i};return s.length&&s.forEach(l=>{l(a,o)}),o})}const W3=/\b\w+\b/g;function Vd({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=zo(n)),n.match(W3)||[]}}}function G3(t,e,n){const r=new Map,s=new Map;let a=0;function i(o,l,d,f){const g=n.tokenize(o);if(!g.length)return;a++;const h=new Map;for(const p of g)h.set(p,(h.get(p)||0)+1);for(const[p,v]of h){const T={docIdx:l,keyIdx:d,subIdx:f,tf:v};let _=r.get(p);_||(_=[],r.set(p,_)),_.push(T),s.set(p,(s.get(p)||0)+1)}}for(const o of t){const{i:l,v:d,$:f}=o;if(d!==void 0){i(d,l,-1,-1);continue}if(f)for(let g=0;g<e;g++){const h=f[g];if(h)if(Array.isArray(h))for(const p of h)i(p.v,l,g,p.i??-1);else i(h.v,l,g,-1)}}return{terms:r,fieldCount:a,df:s}}function K3(t,e,n,r){const{i:s,v:a,$:i}=e;function o(l,d,f){const g=r.tokenize(l);if(!g.length)return;t.fieldCount++;const h=new Map;for(const p of g)h.set(p,(h.get(p)||0)+1);for(const[p,v]of h){const T={docIdx:s,keyIdx:d,subIdx:f,tf:v};let _=t.terms.get(p);_||(_=[],t.terms.set(p,_)),_.push(T),t.df.set(p,(t.df.get(p)||0)+1)}}if(a!==void 0){o(a,-1,-1);return}if(i)for(let l=0;l<n;l++){const d=i[l];if(d)if(Array.isArray(d))for(const f of d)o(f.v,l,f.i??-1);else o(d.v,l,-1)}}function lp(t,e){for(const[n,r]of t.terms){const s=r.filter(i=>i.docIdx!==e),a=r.length-s.length;a>0&&(t.fieldCount-=a,t.df.set(n,(t.df.get(n)||0)-a),s.length===0?(t.terms.delete(n),t.df.delete(n)):t.terms.set(n,s))}}class aa{constructor(e,n,r){this.options={...qe,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new p3(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,r),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;const n=this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options,r=Il(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Eh))throw new Error(l3);if(this._myIndex=n||Fg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=Vd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=G3(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if(jn(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const n=this._myIndex.records[this._myIndex.records.length-1],r=Vd({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});K3(this._invertedIndex,n,this._myIndex.keys.length,r)}}remove(e=()=>!1){const n=[],r=[];for(let s=0,a=this._docs.length;s<a;s+=1)e(this._docs[s],s)&&(n.push(this._docs[s]),r.push(s));if(r.length){if(this._invertedIndex)for(const s of r)lp(this._invertedIndex,s);for(let s=r.length-1;s>=0;s-=1)this._docs.splice(r[s],1);this._myIndex.removeAll(r)}return n}removeAt(e){this._invertedIndex&&lp(this._invertedIndex,e);const n=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),n}getIndex(){return this._myIndex}search(e,n){const{limit:r=-1}=n||{},{includeMatches:s,includeScore:a,shouldSort:i,sortFn:o,ignoreFieldNorm:l}=this.options;if(kn(e)&&!e.trim()){let g=this._docs.map((h,p)=>({item:h,refIndex:p}));return ul(r)&&r>-1&&(g=g.slice(0,r)),g}const d=ul(r)&&r>0&&kn(e);let f;if(d){const g=new j3(r);kn(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:l}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:l}),f=g.extractSorted(o)}else f=kn(e)?kn(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),q3(f,{ignoreFieldNorm:l}),i&&f.sort(o),ul(r)&&r>-1&&(f=f.slice(0,r));return z3(f,this._docs,{includeMatches:s,includeScore:a})}_searchStringList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{records:a}=this._myIndex,i=n?null:[];return a.forEach(({v:o,i:l,n:d})=>{if(!jn(o))return;const{isMatch:f,score:g,indices:h}=s.searchIn(o);if(f){const p={item:o,idx:l,matches:[{score:g,value:o,norm:d,indices:h}]};n?(p.score=Kd(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):i.push(p)}}),i}_searchLogical(e){const n=jg(e,this.options),r=(o,l,d)=>{if(!("children"in o)){const{keyId:p,searcher:v}=o;let T;return p===null?(T=[],this._myIndex.keys.forEach((_,E)=>{T.push(...this._findMatches({key:_,value:l[E],searcher:v}))})):T=this._findMatches({key:this._keyStore.get(p),value:this._myIndex.getValueForItemAtKeyId(l,p),searcher:v}),T&&T.length?[{idx:d,item:l,matches:T}]:[]}const{children:f,operator:g}=o,h=[];for(let p=0,v=f.length;p<v;p+=1){const T=f[p],_=r(T,l,d);if(_.length)h.push(..._);else if(g===Cl.AND)return[]}return h},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:o,i:l})=>{if(jn(o)){const d=r(n,o,l);d.length&&(a.has(l)||(a.set(l,{idx:l,item:o,matches:[]}),i.push(a.get(l))),d.forEach(({matches:f})=>{a.get(l).matches.push(...f)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,o=n?null:[];return i.forEach(({$:l,i:d})=>{if(!jn(l))return;const f=[];let g=!1,h=!1;if(a.forEach((p,v)=>{const T=this._findMatches({key:p,value:l[v],searcher:s});T.length?(f.push(...T),T[0].hasInverse&&(h=!0)):g=!0}),!(h&&g)&&f.length){const p={idx:d,item:l,matches:f};n?(p.score=Kd(p.matches,{ignoreFieldNorm:r}),n.shouldInsert(p.score)&&n.insert(p)):o.push(p)}}),o}_findMatches({key:e,value:n,searcher:r}){if(!jn(n))return[];const s=[];if(ra(n))n.forEach(({v:a,i,n:o})=>{if(!jn(a))return;const{isMatch:l,score:d,indices:f,hasInverse:g}=r.searchIn(a);l&&s.push({score:d,key:e,value:a,idx:i,norm:o,indices:f,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:o,score:l,indices:d,hasInverse:f}=r.searchIn(a);o&&s.push({score:l,key:e,value:a,norm:i,indices:d,hasInverse:f})}return s}}class V3{static condition(e,n){return n.useTokenSearch}constructor(e,n){this.options=n,this.analyzer=Vd({isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics});const r=this.analyzer.tokenize(e),s=n._invertedIndex,{df:a,fieldCount:i}=s;this.termSearchers=[],this.idfWeights=[];for(const o of r){this.termSearchers.push(new Th(o,{location:n.location,threshold:n.threshold,distance:n.distance,includeMatches:n.includeMatches,findAllMatches:n.findAllMatches,minMatchCharLength:n.minMatchCharLength,isCaseSensitive:n.isCaseSensitive,ignoreDiacritics:n.ignoreDiacritics,ignoreLocation:!0}));const l=a.get(o)||0,d=Math.log(1+(i-l+.5)/(l+.5));this.idfWeights.push(d)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let l=0;l<this.termSearchers.length;l++){const d=this.termSearchers[l].searchIn(e),f=this.idfWeights[l];s+=f,d.isMatch&&(a++,r+=f*(1-d.score),d.indices&&n.push(...d.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,o={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(o.indices=_h(n)),o}}aa.version="7.3.0";aa.createIndex=Fg;aa.parseIndex=A3;aa.config=qe;aa.match=function(t,e,n){return Il(t,{...qe,...n}).searchIn(e)};aa.parseQuery=jg;Ah(F3);Ah(V3);aa.use=function(...t){t.forEach(e=>Ah(e))};function X3(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=l=>{a.has(l.path)||(a.add(l.path),s.push(l))};for(const l of t)l.title.toLowerCase()===r&&i(l);for(const l of t)l.title.toLowerCase().startsWith(r)&&i(l);for(const l of t)l.title.toLowerCase().includes(r)&&i(l);const o=new aa(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const l of o.search(e))i(l.item);return s.slice(0,n)}const Q3=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function $g(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function Yg(...t){return t.filter(e=>e!=="").join("/")}function Z3(t){return Q3.has($g(t))}function J3(t){return Yg(rt.content,t,"assets")}function Yi(t,e){return Yg(rt.content,t,e)}function sc(t,e){return zg(Yi(t,e))}function zg(t){return Ba(`/api/read?path=${encodeURIComponent(t)}`)}function Wg(t){return`assets/${t}`}function Gg(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=$g(t),s=Es(n)||"image";return r===""?s:`${s}.${r}`}class eN{async list(e){return await(await We(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await We(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return n.text()}async readBytes(e){const n=await We(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return new Uint8Array(await n.arrayBuffer())}async exists(e){return(await(await We(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function ll(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function cp(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let jc=Q(0);const yh={get value(){return u(jc)},bump(){A(jc,u(jc)+1)}};function tN(t){return{image:()=>{},file:e=>nN(e)?sc(t,e):void 0}}function nN(t){return t.startsWith("assets/")}async function Xd(t,e){const n=new Map,r=async a=>(n.has(a)||n.set(a,await e(a)),n.get(a)),s=await sN(t,r);return iN(s,r)}function Nh(t){return t.startsWith("/")&&!t.startsWith("//")}function Kg(t){return`data:${t.contentType};base64,${rN(t.bytes)}`}function rN(t){let e="";for(let r=0;r<t.length;r+=32768)e+=String.fromCharCode(...t.subarray(r,r+32768));return btoa(e)}async function sN(t,e){var a;const n=new Set([...t.matchAll(/<link\b[^>]*>/gi)].map(i=>i[0])),r=new Map;for(const i of n){const o=(a=i.match(/\bhref="([^"]*)"/i))==null?void 0:a[1];if(o===void 0||!Nh(o))continue;const l=await e(o);if(l!==void 0)if(/\brel="[^"]*stylesheet[^"]*"/i.test(i)){const d=new TextDecoder().decode(l.bytes);r.set(i,`<style>
|
|
11
11
|
${await aN(d,e)}
|
|
12
|
-
</style>`)}else r.set(i,i.replace(/(\bhref=")[^"]*"/i,`$1${Kg(l)}"`))}let s=t;for(const[i,o]of r)s=s.split(i).join(o);return s}async function aN(t,e){const n=new Set;for(const s of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))
|
|
12
|
+
</style>`)}else r.set(i,i.replace(/(\bhref=")[^"]*"/i,`$1${Kg(l)}"`))}let s=t;for(const[i,o]of r)s=s.split(i).join(o);return s}async function aN(t,e){const n=new Set;for(const s of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))Nh(s[1])&&n.add(s[1]);const r=await Xg(n,e);return Vg(t,r)}async function iN(t,e){const n=new Set,r=o=>{o!==void 0&&Nh(o)&&n.add(o)};for(const o of t.matchAll(/\s(?:src|poster)="([^"]*)"/g))r(o[1]);for(const o of t.matchAll(/\ssrcset="([^"]*)"/g))for(const l of dp(o[1]))r(l.url);for(const o of t.matchAll(/url\(\s*['"]?([^)'"]*)['"]?\s*\)/gi))r(o[1]);const s=await Xg(n,e),a=o=>s.get(o)??o,i=t.replace(/(\s(?:src|poster)=")([^"]*)"/g,(o,l,d)=>s.has(d)?`${l}${a(d)}"`:o).replace(/(\ssrcset=")([^"]*)"/g,(o,l,d)=>{const f=dp(d).map(({url:g,descriptor:h})=>[a(g),h].filter(p=>p!=="").join(" ")).join(", ");return`${l}${f}"`});return Vg(i,s)}function Vg(t,e){return t.replace(/url\(\s*(['"]?)([^)'"]*)\1\s*\)/gi,(n,r,s)=>e.has(s)?`url(${r}${e.get(s)}${r})`:n)}async function Xg(t,e){const n=new Map;return await Promise.all([...t].map(async r=>{const s=await e(r);s!==void 0&&n.set(r,Kg(s))})),n}function dp(t){return t.split(",").map(e=>e.trim()).filter(e=>e!=="").map(e=>{const[n,...r]=e.split(/\s+/);return{url:n??"",descriptor:r.join(" ")}})}const oN=`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='450' viewBox='0 0 800 450' role='img' aria-label='Image placeholder'>
|
|
13
13
|
<rect width='800' height='450' fill='#e2e8f0'/>
|
|
14
14
|
<path d='M0 0 800 450 M800 0 0 450' stroke='#cbd5e1' stroke-width='2'/>
|
|
15
15
|
<rect x='300' y='150' width='200' height='130' rx='10' fill='#cbd5e1'/>
|
|
16
16
|
<circle cx='350' cy='195' r='18' fill='#94a3b8'/>
|
|
17
17
|
<path d='M308 280 380 210 432 258 470 228 492 280Z' fill='#94a3b8'/>
|
|
18
18
|
<text x='400' y='330' font-family='system-ui, sans-serif' font-size='24' fill='#64748b' text-anchor='middle'>image</text>
|
|
19
|
-
</svg>`,Qg=`data:image/svg+xml,${encodeURIComponent(oN)}`;function uN(t){switch(t.type){case"image":return Qg;case"file":case"url":return"#";case"email":return"name@example.com";case"phone":return"+1 555-0100";case"date":return"2026-01-01";case"time":return"09:00";case"code":return`// ${t.label}`;case"richtext":return`<p>${t.label}, sample rich text. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`;case"authors":return[{name:"Ada Lovelace"},{name:"Alan Turing"}];case"text":return`${t.label}, sample paragraph text. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.`;case"shorttext":default:return t.label}}function lN(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=uN(n));return e}function cN(t,e){if(e===void 0)return t;const n={...t};for(const[r,s]of Object.entries(e))s!==""&&(n[r]=s);return n}function dN(t,e){const n={};if(e===void 0)return n;for(const r of t){if(r.multiple!==!0)continue;const s=e[r.name];if(s===void 0||s.trim()==="")continue;const a=s.split(/[\n,]+/).map(i=>i.trim()).filter(i=>i!=="");a.length>0&&(n[r.name]=a)}return n}function fN(t){return t.startsWith(`${
|
|
19
|
+
</svg>`,Qg=`data:image/svg+xml,${encodeURIComponent(oN)}`;function uN(t){switch(t.type){case"image":return Qg;case"file":case"url":return"#";case"email":return"name@example.com";case"phone":return"+1 555-0100";case"date":return"2026-01-01";case"time":return"09:00";case"code":return`// ${t.label}`;case"richtext":return`<p>${t.label}, sample rich text. Lorem ipsum dolor sit amet, consectetur adipiscing elit.</p>`;case"authors":return[{name:"Ada Lovelace"},{name:"Alan Turing"}];case"text":return`${t.label}, sample paragraph text. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor.`;case"shorttext":default:return t.label}}function lN(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=uN(n));return e}function cN(t,e){if(e===void 0)return t;const n={...t};for(const[r,s]of Object.entries(e))s!==""&&(n[r]=s);return n}function dN(t,e){const n={};if(e===void 0)return n;for(const r of t){if(r.multiple!==!0)continue;const s=e[r.name];if(s===void 0||s.trim()==="")continue;const a=s.split(/[\n,]+/).map(i=>i.trim()).filter(i=>i!=="");a.length>0&&(n[r.name]=a)}return n}function fN(t){return t.startsWith(`${rt.components}/`)}function hN(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}const Zg={htmlAttrs:"",headStyles:""};function pN(t){var s,a,i;if(t===void 0||t.trim()==="")return Zg;const e=((a=(s=t.match(/<html\b([^>]*)>/i))==null?void 0:s[1])==null?void 0:a.trim())??"",n=((i=t.match(/<head\b[^>]*>([\s\S]*?)<\/head>/i))==null?void 0:i[1])??"",r=[];for(const o of n.matchAll(/<link\b[^>]*>/gi))/\brel=(["'])[^"']*stylesheet[^"']*\1/i.test(o[0])&&r.push(o[0]);for(const o of n.matchAll(/<style\b[^>]*>[\s\S]*?<\/style>/gi))r.push(o[0]);return{htmlAttrs:e,headStyles:r.join(`
|
|
20
20
|
`)}}function Jg(t){const e=t.htmlAttrs.trim()===""?'lang="en"':t.htmlAttrs.trim(),n=t.headStyles.trim()===""?"":`
|
|
21
21
|
${t.headStyles}`;return`<!doctype html>
|
|
22
22
|
<html ${e}>
|
|
@@ -29,7 +29,7 @@ ${await aN(d,e)}
|
|
|
29
29
|
<body>
|
|
30
30
|
${t.body}
|
|
31
31
|
</body>
|
|
32
|
-
</html>`}function mN(t,e,n=Zg){const r=e.filter(a=>a.multiple!==!0).map(a=>`${a.name}="{${a.name}}"`).join(" "),s=r===""?`<${t}>`:`<${t} ${r}>`;return Jg({htmlAttrs:n.htmlAttrs,headStyles:n.headStyles,title:`${t} preview`,body:`${s}Sample slot content</${t}>`})}function
|
|
32
|
+
</html>`}function mN(t,e,n=Zg){const r=e.filter(a=>a.multiple!==!0).map(a=>`${a.name}="{${a.name}}"`).join(" "),s=r===""?`<${t}>`:`<${t} ${r}>`;return Jg({htmlAttrs:n.htmlAttrs,headStyles:n.headStyles,title:`${t} preview`,body:`${s}Sample slot content</${t}>`})}function fp(){return{image:()=>{},file:t=>vN(t)?Qg:void 0}}const gN=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function vN(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:gN.test(t)}const st=new eN,Qd=new Map;let Zd,Jd,ef,Ll,tf;function Sh(){return tf??(tf=sh(st)),tf}async function nf(){const t=[],e=n=>{for(const r of n.children)r.kind==="dir"&&(t.push(r.path),e(r))};return e(await Sh()),t.sort()}async function bN(){const t=await We("/api/authors");return t.ok?await t.json():[]}function to(){tf=void 0,yh.bump()}const hp=".json",wh="_sort.json",EN="assets",_N=new Set([wh,"_redirects.json","_site.json"]);function rf(t,e){return t===""?e:`${t}/${e}`}function Ih(t){return t===""?rt.content:`${rt.content}/${t}`}async function Ch(t){try{return jm(JSON.parse(await st.readText(`${t}/${wh}`)))}catch{return{order:[]}}}function TN(t,e){const n=[],r=new Set;for(const s of e){const a=t.get(s);a!==void 0&&(n.push(a),r.add(s))}for(const[s,a]of t)r.has(s)||n.push(a);return n}async function AN(t){try{const{title:e}=Vl(JSON.parse(await st.readText(t)));return e===""?void 0:e}catch{return}}async function sf(t){return t===""?"Home":(await Ch(Ih(t))).name??rh(ll(t))}async function yN(t){return await AN(zs(rf(t,"index")))??await sf(t)}async function ev(t){const e=Ih(t),[n,r]=await Promise.all([st.list(e),Ch(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(_N.has(a.name)||!a.name.endsWith(hp))continue;const i=a.name.slice(0,-hp.length);try{const o=Vl(JSON.parse(await st.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:rf(t,i),title:o.title,isPublished:o.isPublished,template:o.template})}catch{}}else if(a.name!==EN){const i=rf(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await yN(i)})}return{entries:TN(s,r.order),defaultTemplate:r.defaultTemplate}}function NN(t){const e=[],n=(r,s)=>{const a=r.defaultTemplate??s;for(const i of r.children)i.kind==="item"?e.push({path:i.path,title:i.item.title,isPublished:i.item.isPublished,template:i.item.template??a}):n(i,a)};return n(t,void 0),e}async function tv(t,e=30){return t.trim()===""?[]:X3(NN(await Sh()),t,e)}async function SN(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await Ch(Ih(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function wN(t){const e=Qd.get(t);if(e!==void 0)return e;const n=await Al(st,t);return Qd.set(t,n),n}function mu(){return Zd??(Zd=ah(st)),Zd}function IN(){return Jd??(Jd=zm(st)),Jd}function CN(){return ef??(ef=Wm(st)),ef}async function LN(t){const[e,n]=await Promise.all([wN(t),mu()]);return Ts(e,n)}function nv(){return Ll??(Ll=oh(st)),Ll}async function ON(){const[t,e]=await Promise.all([nv(),mu()]);return t===void 0?[]:Ts(t,e).filter(n=>n.name!=="title")}const af=`${rt.templates}/${hu}.html`;function KD(){return st.exists(af)}const xN=`<!doctype html>
|
|
33
33
|
<html lang="en">
|
|
34
34
|
<head>
|
|
35
35
|
<meta charset="utf-8" />
|
|
@@ -41,105 +41,102 @@ ${await aN(d,e)}
|
|
|
41
41
|
<slot></slot>
|
|
42
42
|
</body>
|
|
43
43
|
</html>
|
|
44
|
-
`;async function
|
|
45
|
-
`))n(
|
|
46
|
-
`);
|
|
47
|
-
`);if(o)
|
|
48
|
-
`
|
|
49
|
-
`});if(!
|
|
50
|
-
`});if(!
|
|
51
|
-
|
|
52
|
-
`});if(!r.ok)throw new Error(`Reorder failed (${r.status})`)}async function nk(t,e){const n=await Ke(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);Rh(t);const r=await n.json().catch(()=>({}));return{...r.stamped!==void 0&&{stamped:r.stamped},...r.stampIncomplete===!0&&{stampIncomplete:!0},...r.schemaDelta!==void 0&&{schemaDelta:r.schemaDelta}}}function Rh(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&(Xd.clear(),Qd=void 0,Cl=void 0,Ah.bump()),t.some(n=>n.startsWith(`${st.components}/`))&&(Zd=void 0,Jd=void 0),t.some(n=>n.startsWith(`${st.content}/`))&&to()}function Ys(t){return`${st.content}/${t}.json`}function Ai(t){return`${st.content}/${t}`}async function Ll(t){const e=await Ke(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);Rh(t)}async function za(t,e){const n=await Ke(`/api/rename?from=${encodeURIComponent(t)}&to=${encodeURIComponent(e)}`,{method:"POST"});if(!n.ok){const r=n.status===409?"a file or folder with that name already exists":`status ${n.status}`;throw new Error(`Rename failed, ${r}.`)}Rh(t,e)}const VN=/assets\/[A-Za-z0-9._-]+/g;async function XN(t,e,n){const r=Yi(t,n),s=Yi(e,n);if(r===s)return;const a=await Ke(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await Ke(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function QN(t,e){const n=t.lastIndexOf("/"),r=n>=0?t.slice(n+1):t,s=n>=0?t.slice(0,n):"";if(e===s)return t;const a=e===""?r:`${e}/${r}`;if(await at.exists(Ys(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await at.readText(Ys(t));for(const o of new Set(i.match(VN)??[]))await XN(s,e,o);return await za(Ys(t),Ys(a)),to(),a}async function ZN(t,e){const n=t.lastIndexOf("/"),r=n>=0?t.slice(n+1):t,s=n>=0?t.slice(0,n):"";if(e===s)return t;if(e===t||e.startsWith(`${t}/`))throw new Error("Cannot move a folder into itself.");const a=e===""?r:`${e}/${r}`;if(await at.exists(Ai(a)))throw new Error(`A folder named "${r}" already exists there.`);return await za(Ai(t),Ai(a)),to(),a}const ov=`${st.content}/_redirects.json`;async function JN(){try{const t=JSON.parse(await at.readText(ov));return Array.isArray(t)?t:[]}catch{return[]}}async function Bu(t,e){if(t!==e)try{const n=await JN();n.push({from:t,to:e});const r=await Ke(`/api/write?path=${encodeURIComponent(ov)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
|
|
53
|
-
`});if(!r.ok)throw new Error(`status ${r.status}`)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const uv=`${st.content}/_site.json`;async function e6(){try{const t=JSON.parse(await at.readText(uv));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function t6(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
|
|
54
|
-
`,r=await Ke(`/api/write?path=${encodeURIComponent(uv)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`)}const lv=["html","css","js"];async function rk(t){const e=t.replace(/\.html$/,"");await Promise.all(lv.map(n=>Ll(`${e}.${n}`)))}async function n6(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of lv){const a=`${n}.${s}`;await at.exists(a)&&await za(a,`${r}.${s}`)}}async function r6(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await xy(at,t,{draft:e,media:tN(n)});return r===void 0?void 0:Vd(r.html,of)}async function of(t){const e=t.startsWith("/api/")?t:zg(`public/${t.slice(1)}`);try{const n=await Ke(e);if(!n.ok)return;const r=new Uint8Array(await n.arrayBuffer());return{contentType:n.headers.get("content-type")??(t.startsWith("/api/")?"":X_(t)),bytes:r}}catch{return}}async function sk(t){return _s(t,await mu())}async function ak(t,e,n){const[r,s,a,i,o]=await Promise.all([mu(),IN(),CN(),Nh(),nv()]),l=Dg(i),d=pN(o),h=p=>({...cN(lN(p),n),...dN(p,n)});if(fN(t)){const p=hN(t),v=new Map(r).set(p,e.html),T=mp(new Map(s),p,e.css),_=mp(new Map(a),p,e.js),E=_s(e.html,v);return Vd(Md({template:mN(p,E,d),scope:h(E),components:v,componentStyles:T,componentScripts:_,context:l,media:dp()}),of)}const g=_s(e.html,r),f=Md({template:e.html,scope:h(g),components:r,componentStyles:s,componentScripts:a,context:l,media:dp(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}});return Vd(Jg({htmlAttrs:d.htmlAttrs,headStyles:d.headStyles,title:"Template preview",body:f}),of)}function mp(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function s6(t,e){if(e==="title")return t.title;if(e==="created")return t.created??"";if(e==="published")return t.published??"";if(e==="updated")return t.updated??"";const n=t.fields[e];return n==null?"":Array.isArray(n)?n.some(r=>r!==null&&typeof r=="object")?JSON.stringify(n):n.map(String).join(", "):String(n)}const cv="nanoesis:tree-expanded";function a6(){try{const t=JSON.parse(localStorage.getItem(cv)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const ys=dt({}),yi=dt({}),zi=dt(a6());function dv(){const t=Object.keys(zi).filter(e=>zi[e]);localStorage.setItem(cv,JSON.stringify(t))}function Ei(t){return ys[t]}function i6(t){return yi[t]===!0}function di(t){return t===""||zi[t]===!0}async function sc(t){if(!(ys[t]!==void 0||yi[t])){yi[t]=!0;try{ys[t]=await ev(t)}finally{yi[t]=!1}}}async function Ln(t){yi[t]=!0;try{ys[t]=await ev(t)}finally{yi[t]=!1}}async function o6(){await Promise.all(Object.keys(ys).map(t=>Ln(t)))}function uf(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function fv(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function lf(t,e,n){const r=ys[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(ys[t]={...r,entries:a})}function u6(t,e){const n=fv(t);if(n!==null){n!==""&&lf(uf(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}lf(uf(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function l6(t,e){fv(t)===null&&lf(uf(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function c6(t,e){const n=ys[t];if(n===void 0)return;const r=new Map(n.entries.map(a=>[a.slug,a])),s=[];for(const a of e){const i=r.get(a);i!==void 0&&(s.push(i),r.delete(a))}for(const a of r.values())s.push(a);ys[t]={...n,entries:s}}async function gp(t){di(t)?zi[t]=!1:(zi[t]=!0,await sc(t)),dv()}async function po(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,zi[n]=!0,await sc(n);dv()}const hv="nanoesis:dev-tree-expanded";function d6(){try{const t=JSON.parse(localStorage.getItem(hv)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return Object.fromEntries(HN.map(t=>[t,!0]))}const Wo=dt({}),Ni=dt({}),Fa=dt(d6());function pv(){const t=Object.keys(Fa).filter(e=>Fa[e]);localStorage.setItem(hv,JSON.stringify(t))}function ik(t){return Wo[t]}function ok(t){return Ni[t]===!0}function uk(t){return Fa[t]===!0}async function mv(t){if(!(Wo[t]!==void 0||Ni[t])){Ni[t]=!0;try{Wo[t]=await Lh(t)}finally{Ni[t]=!1}}}async function f6(t){Ni[t]=!0;try{Wo[t]=await Lh(t)}finally{Ni[t]=!1}}async function h6(){await Promise.all(Object.keys(Wo).map(t=>f6(t)))}async function lk(t){Fa[t]?Fa[t]=!1:(Fa[t]=!0,await mv(t)),pv()}let Or=Q(null),Dh=Q(null);function ck(){return u(Or)}function dk(){return u(Dh)}function fk(t,e){A(Or,{entry:t,parent:e},!0)}function hk(t){A(Dh,t,!0)}function pk(){A(Or,null),A(Dh,null)}const p6=new Set(["templates/home.html"]);function gv(t){return p6.has(t)}function mk(t,e){if(u(Or)===null||e!=="dir"||gv(u(Or).entry.path))return!1;const n=u(Or).entry.path;return t!==n&&u(Or).parent!==t&&!t.startsWith(`${n}/`)&&n.split("/")[0]===t.split("/")[0]}function gk(t){return u(Or)===null||gv(u(Or).entry.path)?!1:u(Or).parent!==t&&u(Or).entry.path.split("/")[0]===t}async function vk(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Fa[n]=!0,await mv(n);pv()}const m6=9e4;function g6(t){if(typeof t!="object"||t===null)return{changed:!1,added:0,removed:0};const e=t,n=typeof e.added=="number"?e.added:0,r=typeof e.removed=="number"?e.removed:0;return{changed:n>0||r>0,added:n,removed:r}}function v6(t){const e=t.intervalMs??m6;let n=null,r=!1;async function s(){if(!(r||!t.isVisible())){r=!0;try{const a=await t.reconcileOnce();a.changed&&t.onChanged(a)}catch{}finally{r=!1}}}return{start(){n===null&&(n=setInterval(()=>void s(),e))},stop(){n!==null&&(clearInterval(n),n=null)}}}let Wt=Q(null);const Fu={get pending(){return u(Wt)}};function Ol(t,e={}){return new Promise(n=>{A(Wt,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function ko(t,e={}){return new Promise(n=>{A(Wt,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function bk(t,e,n={}){return new Promise(r=>{A(Wt,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function b6(t,e){return new Promise(n=>{A(Wt,{kind:"decide",message:t,options:e,resolve:n},!0)})}function Un(t,e={}){return new Promise(n=>{A(Wt,{kind:"alert",message:t,options:e,resolve:n},!0)})}function jc(t){var e;((e=u(Wt))==null?void 0:e.kind)==="confirm"&&(u(Wt).resolve(t),A(Wt,null))}function $c(t){var e;((e=u(Wt))==null?void 0:e.kind)==="prompt"&&(u(Wt).resolve(t),A(Wt,null))}function Yc(t){var e;((e=u(Wt))==null?void 0:e.kind)==="select"&&(u(Wt).resolve(t),A(Wt,null))}function Uu(t){var e;((e=u(Wt))==null?void 0:e.kind)==="decide"&&(u(Wt).resolve(t),A(Wt,null))}function vp(){var t;((t=u(Wt))==null?void 0:t.kind)==="alert"&&(u(Wt).resolve(),A(Wt,null))}let bp=Q(null);const Hu=dt({}),cf={get active(){return u(bp)},get hasDirty(){return Object.keys(Hu).length>0},isDirty(t){return Hu[t]===!0},setActive(t){A(bp,t,!0)},setDirty(t,e){e?Hu[t]=!0:delete Hu[t]}};async function vv(t){const e=cf.active;if(e===null||!cf.isDirty(e.key))return!0;const n=t===void 0?"":`
|
|
44
|
+
`;async function VD(){if(await st.exists(af))return;const t=await We(`/api/write?path=${encodeURIComponent(af)}`,{method:"POST",body:xN});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);Ll=void 0}async function XD(){const t=await mu();return[...t.entries()].map(([e,n])=>({tag:e,props:Ts(n,t).map(r=>r.name)}))}async function pp(t){const e=await st.readText(`${rt.content}/${t}.json`);return Vl(JSON.parse(e))}async function rv(t,e){const n=`${rt.content}/${t}.json`,r=await We(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);to()}function RN(){return Hy(st)}async function DN(){const t=await We("/api/publish/plan");if(t.status===404)throw new Error("Publishing runs on the host, start it with `npm run example:azure`.");if(!t.ok)throw new Error(`Could not plan the publish (${t.status}).`);return await t.json()}async function kN(){const t=await We("/api/publish",{method:"POST"});if(t.status===404)throw new Error("Publishing runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{ok:!0,written:e.written??0,...e.summary!==void 0&&{summary:e.summary}};if(t.status===422)return{ok:!1,errors:e.errors??["Validation failed."],...e.summary!==void 0&&{summary:e.summary}};throw new Error(`Publish failed (${t.status}).`)}async function PN(t){const e=await We(`/api/publish/progress?since=${t}`);return e.ok?await e.json():{running:!1,total:t,events:[]}}async function MN(){const t=await We("/api/scaffold",{method:"POST"});if(t.status===404)throw new Error("Scaffolding runs on the host, start it with `npm run example:azure`.");const e=await t.json().catch(()=>({}));if(t.ok)return{created:e.created??[],skipped:e.skipped??[]};throw t.status===409?new Error("This site already has content, scaffolding is only for an empty site."):t.status===403?new Error("Only an admin can scaffold a starter site."):new Error(e.error??`Scaffold failed (${t.status})`)}async function mp(t,e){const n=await st.readText(`${rt.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await rv(t,`${JSON.stringify(r,null,2)}
|
|
45
|
+
`)}async function BN(t,e){return(await st.list(J3(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function FN(t){return BN(t,e=>!Z3(e))}async function Lh(t,e){const n=Gg(e.name),r=Wg(n),s=await We(`/api/write?path=${encodeURIComponent(Yi(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return r}async function UN(t,e){try{await Ol(Yi(t,e))}catch{}}async function of(t){const e=[],n=async(r,s)=>{for(const a of await st.list(r)){const i=s===""?a.name:`${s}/${a.name}`;a.kind==="dir"?await n(`${r}/${a.name}`,i):a.name.endsWith(".html")&&e.push(i.slice(0,-5))}};return await n(t,""),e.sort()}async function HN(){const t=[],e=async(n,r)=>{for(const s of await st.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):t.push(a)}};return await e(rt.public,""),t.sort()}const qN=["templates","components","public"],sv=".gitkeep";function av(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function Oh(t){const e=av(t),n=[],r=[];for(const s of await st.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===sv)continue;if(e){if(t===rt.templates&&s.name===`${hu}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else r.push({kind:"file",name:s.name,path:a})}}return n.sort((s,a)=>s.name.localeCompare(a.name)),r.sort((s,a)=>s.name.localeCompare(a.name)),[...n,...r]}async function QD(t){const e=[t],n=async r=>{for(const s of await Oh(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function ZD(t,e){const n=e.split("/").map(i=>Es(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${sv}`;if(await st.exists(s))throw new Error(`"${r}" already exists.`);const a=await We(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return r}async function JD(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(av(t)?r6(t,r):za(t,r)),r)}async function ek(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;if(e===t||e.startsWith(`${t}/`))throw new Error("Cannot move a folder into itself.");return r===t?t:(await za(t,r),r)}function jN(t,e){const n=t.slice(t.lastIndexOf("/")+1);return n===e?4:n.startsWith(e)?3:n.includes(e)?2:t.includes(e)?1:0}async function tk(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([of("templates"),of("components"),HN()]);return[...n.map(i=>({label:i,path:`templates/${i}.html`,root:"templates"})),...r.map(i=>({label:i,path:`components/${i}.html`,root:"components"})),...s.map(i=>({label:i,path:`public/${i}`,root:"public"}))].map(i=>({hit:i,score:jN(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,o)=>o.score-i.score||i.hit.label.localeCompare(o.hit.label)).slice(0,30).map(i=>i.hit)}function nk(t){return st.readText(t)}async function $N(t){const e=await We(`/api/read?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Not found: ${t}`);return URL.createObjectURL(await e.blob())}async function YN(t,e){return $N(Yi(t,e))}async function rk(t){if(await st.exists(t))throw new Error(`"${t}" already exists.`);const e=await We(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`)}async function sk(t,e){const n=`${t}/${Gg(e.name)}`;if(await st.exists(n))throw new Error(`"${n}" already exists.`);const r=await We(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",body:await e.arrayBuffer()});if(!r.ok)throw new Error(`Upload failed (${r.status})`);return n}async function iv(t,e,n){const r=`${rt.content}/${t}.json`;if(await st.exists(r))throw new Error(`"${t}" already exists.`);const s={title:e,isPublished:!1};n!==void 0&&n!==""&&(s.template=n),s.fields={};const a=await We(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
|
|
46
|
+
`});if(!a.ok)throw new Error(`Create failed (${a.status})`);to()}function zN(t){return st.exists(`${rt.content}/${t}.json`)}async function WN(t,e){const n=e.split("/").map(l=>({raw:l.trim(),slug:Es(l)})).filter(l=>l.slug!==""),r=n.at(-1);if(r===void 0)throw new Error("A folder name is required.");const s=n.map(l=>l.slug).join("/"),a=t===""?s:`${t}/${s}`,i=`${rt.content}/${a}/${wh}`;if(await st.exists(i))throw new Error(`"${a}" already exists.`);const o=await We(`/api/write?path=${encodeURIComponent(i)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify({name:r.raw},null,2)}
|
|
47
|
+
`});if(!o.ok)throw new Error(`Create folder failed (${o.status})`);return to(),a}function xh(t){return t===""?`${rt.content}/_sort.json`:`${rt.content}/${t}/_sort.json`}async function Rh(t){try{const e=JSON.parse(await st.readText(xh(t)));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}async function GN(t){const e=await Rh(t);return typeof e.defaultTemplate=="string"?e.defaultTemplate:""}async function KN(t,e){const n=await Rh(t);e===""?delete n.defaultTemplate:n.defaultTemplate=e;const r=await We(`/api/write?path=${encodeURIComponent(xh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
|
|
48
|
+
`});if(!r.ok)throw new Error(`Save failed (${r.status})`)}async function VN(t,e){const n=await Rh(t);n.order=[...e];const r=await We(`/api/write?path=${encodeURIComponent(xh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
|
|
49
|
+
`});if(!r.ok)throw new Error(`Reorder failed (${r.status})`)}async function ak(t,e){const n=await We(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);Dh(t);const r=await n.json().catch(()=>({}));return{...r.stamped!==void 0&&{stamped:r.stamped},...r.stampIncomplete===!0&&{stampIncomplete:!0},...r.schemaDelta!==void 0&&{schemaDelta:r.schemaDelta}}}function Dh(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&(Qd.clear(),Zd=void 0,Ll=void 0,yh.bump()),t.some(n=>n.startsWith(`${rt.components}/`))&&(Jd=void 0,ef=void 0),t.some(n=>n.startsWith(`${rt.content}/`))&&to()}function zs(t){return`${rt.content}/${t}.json`}function Ai(t){return`${rt.content}/${t}`}async function Ol(t){const e=await We(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);Dh(t)}async function za(t,e){const n=await We(`/api/rename?from=${encodeURIComponent(t)}&to=${encodeURIComponent(e)}`,{method:"POST"});if(!n.ok){const r=n.status===409?"a file or folder with that name already exists":`status ${n.status}`;throw new Error(`Rename failed, ${r}.`)}Dh(t,e)}const XN=/assets\/[A-Za-z0-9._-]+/g;async function QN(t,e,n){const r=Yi(t,n),s=Yi(e,n);if(r===s)return;const a=await We(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await We(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function ZN(t,e){const n=t.lastIndexOf("/"),r=n>=0?t.slice(n+1):t,s=n>=0?t.slice(0,n):"";if(e===s)return t;const a=e===""?r:`${e}/${r}`;if(await st.exists(zs(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await st.readText(zs(t));for(const o of new Set(i.match(XN)??[]))await QN(s,e,o);return await za(zs(t),zs(a)),to(),a}async function JN(t,e){const n=t.lastIndexOf("/"),r=n>=0?t.slice(n+1):t,s=n>=0?t.slice(0,n):"";if(e===s)return t;if(e===t||e.startsWith(`${t}/`))throw new Error("Cannot move a folder into itself.");const a=e===""?r:`${e}/${r}`;if(await st.exists(Ai(a)))throw new Error(`A folder named "${r}" already exists there.`);return await za(Ai(t),Ai(a)),to(),a}const ov=`${rt.content}/_redirects.json`;async function e6(){try{const t=JSON.parse(await st.readText(ov));return Array.isArray(t)?t:[]}catch{return[]}}async function Bu(t,e){if(t!==e)try{const n=await e6();n.push({from:t,to:e});const r=await We(`/api/write?path=${encodeURIComponent(ov)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
|
|
50
|
+
`});if(!r.ok)throw new Error(`status ${r.status}`)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const uv=`${rt.content}/_site.json`;async function t6(){try{const t=JSON.parse(await st.readText(uv));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function n6(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
|
|
51
|
+
`,r=await We(`/api/write?path=${encodeURIComponent(uv)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`)}const lv=["html","css","js"];async function ik(t){const e=t.replace(/\.html$/,"");await Promise.all(lv.map(n=>Ol(`${e}.${n}`)))}async function r6(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of lv){const a=`${n}.${s}`;await st.exists(a)&&await za(a,`${r}.${s}`)}}async function s6(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await xy(st,t,{draft:e,media:tN(n)});return r===void 0?void 0:Xd(r.html,uf)}async function uf(t){const e=t.startsWith("/api/")?t:zg(`public/${t.slice(1)}`);try{const n=await We(e);if(!n.ok)return;const r=new Uint8Array(await n.arrayBuffer());return{contentType:n.headers.get("content-type")??(t.startsWith("/api/")?"":X_(t)),bytes:r}}catch{return}}async function ok(t){return Ts(t,await mu())}async function uk(t,e,n){const[r,s,a,i,o]=await Promise.all([mu(),IN(),CN(),Sh(),nv()]),l=Dg(i),d=pN(o),f=p=>({...cN(lN(p),n),...dN(p,n)});if(fN(t)){const p=hN(t),v=new Map(r).set(p,e.html),T=gp(new Map(s),p,e.css),_=gp(new Map(a),p,e.js),E=Ts(e.html,v);return Xd(Bd({template:mN(p,E,d),scope:f(E),components:v,componentStyles:T,componentScripts:_,context:l,media:fp()}),uf)}const g=Ts(e.html,r),h=Bd({template:e.html,scope:f(g),components:r,componentStyles:s,componentScripts:a,context:l,media:fp(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}});return Xd(Jg({htmlAttrs:d.htmlAttrs,headStyles:d.headStyles,title:"Template preview",body:h}),uf)}function gp(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function a6(t,e){if(e==="title")return t.title;if(e==="created")return t.created??"";if(e==="published")return t.published??"";if(e==="updated")return t.updated??"";const n=t.fields[e];return n==null?"":Array.isArray(n)?n.some(r=>r!==null&&typeof r=="object")?JSON.stringify(n):n.map(String).join(", "):String(n)}const cv="nanoesis:tree-expanded";function i6(){try{const t=JSON.parse(localStorage.getItem(cv)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const Ns=ct({}),yi=ct({}),zi=ct(i6());function dv(){const t=Object.keys(zi).filter(e=>zi[e]);localStorage.setItem(cv,JSON.stringify(t))}function Ei(t){return Ns[t]}function o6(t){return yi[t]===!0}function di(t){return t===""||zi[t]===!0}async function ac(t){if(!(Ns[t]!==void 0||yi[t])){yi[t]=!0;try{Ns[t]=await ev(t)}finally{yi[t]=!1}}}async function xn(t){yi[t]=!0;try{Ns[t]=await ev(t)}finally{yi[t]=!1}}async function u6(){await Promise.all(Object.keys(Ns).map(t=>xn(t)))}function lf(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function fv(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function cf(t,e,n){const r=Ns[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(Ns[t]={...r,entries:a})}function l6(t,e){const n=fv(t);if(n!==null){n!==""&&cf(lf(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}cf(lf(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function c6(t,e){fv(t)===null&&cf(lf(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function d6(t,e){const n=Ns[t];if(n===void 0)return;const r=new Map(n.entries.map(a=>[a.slug,a])),s=[];for(const a of e){const i=r.get(a);i!==void 0&&(s.push(i),r.delete(a))}for(const a of r.values())s.push(a);Ns[t]={...n,entries:s}}async function vp(t){di(t)?zi[t]=!1:(zi[t]=!0,await ac(t)),dv()}async function po(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,zi[n]=!0,await ac(n);dv()}const hv="nanoesis:dev-tree-expanded";function f6(){try{const t=JSON.parse(localStorage.getItem(hv)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return Object.fromEntries(qN.map(t=>[t,!0]))}const Wo=ct({}),Ni=ct({}),Fa=ct(f6());function pv(){const t=Object.keys(Fa).filter(e=>Fa[e]);localStorage.setItem(hv,JSON.stringify(t))}function lk(t){return Wo[t]}function ck(t){return Ni[t]===!0}function dk(t){return Fa[t]===!0}async function mv(t){if(!(Wo[t]!==void 0||Ni[t])){Ni[t]=!0;try{Wo[t]=await Oh(t)}finally{Ni[t]=!1}}}async function h6(t){Ni[t]=!0;try{Wo[t]=await Oh(t)}finally{Ni[t]=!1}}async function p6(){await Promise.all(Object.keys(Wo).map(t=>h6(t)))}async function fk(t){Fa[t]?Fa[t]=!1:(Fa[t]=!0,await mv(t)),pv()}let Or=Q(null),kh=Q(null);function hk(){return u(Or)}function pk(){return u(kh)}function mk(t,e){A(Or,{entry:t,parent:e},!0)}function gk(t){A(kh,t,!0)}function vk(){A(Or,null),A(kh,null)}const m6=new Set(["templates/home.html"]);function gv(t){return m6.has(t)}function bk(t,e){if(u(Or)===null||e!=="dir"||gv(u(Or).entry.path))return!1;const n=u(Or).entry.path;return t!==n&&u(Or).parent!==t&&!t.startsWith(`${n}/`)&&n.split("/")[0]===t.split("/")[0]}function Ek(t){return u(Or)===null||gv(u(Or).entry.path)?!1:u(Or).parent!==t&&u(Or).entry.path.split("/")[0]===t}async function _k(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Fa[n]=!0,await mv(n);pv()}const g6=9e4;function v6(t){if(typeof t!="object"||t===null)return{changed:!1,added:0,removed:0};const e=t,n=typeof e.added=="number"?e.added:0,r=typeof e.removed=="number"?e.removed:0;return{changed:n>0||r>0,added:n,removed:r}}function b6(t){const e=t.intervalMs??g6;let n=null,r=!1;async function s(){if(!(r||!t.isVisible())){r=!0;try{const a=await t.reconcileOnce();a.changed&&t.onChanged(a)}catch{}finally{r=!1}}}return{start(){n===null&&(n=setInterval(()=>void s(),e))},stop(){n!==null&&(clearInterval(n),n=null)}}}let Kt=Q(null);const Fu={get pending(){return u(Kt)}};function xl(t,e={}){return new Promise(n=>{A(Kt,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function ko(t,e={}){return new Promise(n=>{A(Kt,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function Tk(t,e,n={}){return new Promise(r=>{A(Kt,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function E6(t,e){return new Promise(n=>{A(Kt,{kind:"decide",message:t,options:e,resolve:n},!0)})}function Fn(t,e={}){return new Promise(n=>{A(Kt,{kind:"alert",message:t,options:e,resolve:n},!0)})}function $c(t){var e;((e=u(Kt))==null?void 0:e.kind)==="confirm"&&(u(Kt).resolve(t),A(Kt,null))}function Yc(t){var e;((e=u(Kt))==null?void 0:e.kind)==="prompt"&&(u(Kt).resolve(t),A(Kt,null))}function zc(t){var e;((e=u(Kt))==null?void 0:e.kind)==="select"&&(u(Kt).resolve(t),A(Kt,null))}function Uu(t){var e;((e=u(Kt))==null?void 0:e.kind)==="decide"&&(u(Kt).resolve(t),A(Kt,null))}function bp(){var t;((t=u(Kt))==null?void 0:t.kind)==="alert"&&(u(Kt).resolve(),A(Kt,null))}let Ep=Q(null);const Hu=ct({}),df={get active(){return u(Ep)},get hasDirty(){return Object.keys(Hu).length>0},isDirty(t){return Hu[t]===!0},setActive(t){A(Ep,t,!0)},setDirty(t,e){e?Hu[t]=!0:delete Hu[t]}};async function vv(t){const e=df.active;if(e===null||!df.isDirty(e.key))return!0;const n=t===void 0?"":`
|
|
55
52
|
|
|
56
|
-
${t}`,r=await
|
|
53
|
+
${t}`,r=await E6(`You have unsaved changes to ${e.key}. Save them, discard them, or stay on this file?${n}`,{title:"Unsaved changes",primaryLabel:"Save",secondaryLabel:"Discard",cancelLabel:"Stay",secondaryDanger:!0});if(r==="cancel")return!1;if(r==="secondary")return e.discard(),!0;try{return await e.flush(),!0}catch(s){return await Fn(`Couldn't save ${e.key}: ${s instanceof Error?s.message:String(s)}
|
|
57
54
|
|
|
58
|
-
You're still on this file — try again or discard.`,{title:"Save failed"}),!1}}const bv="nanoesis-restore:",Ev="nanoesis:unit-values:",_v="nanoesis:tree-expanded",Tv="nanoesis:dev-tree-expanded";function
|
|
55
|
+
You're still on this file — try again or discard.`,{title:"Save failed"}),!1}}const bv="nanoesis-restore:",Ev="nanoesis:unit-values:",_v="nanoesis:tree-expanded",Tv="nanoesis:dev-tree-expanded";function _6(t){t.removeItem(_v),t.removeItem(Tv);for(let e=t.length-1;e>=0;e--){const n=t.key(e);n!==null&&(n.startsWith(bv)||n.startsWith(Ev))&&t.removeItem(n)}}function _p(t,e){t.removeItem(`${bv}${e}`),t.removeItem(`${Ev}${e}`);for(const n of[_v,Tv]){const r=t.getItem(n);if(r!==null)try{const s=JSON.parse(r);if(!Array.isArray(s))continue;const a=s.filter(i=>typeof i=="string"&&i!==e&&!i.startsWith(`${e}/`));a.length!==s.length&&t.setItem(n,JSON.stringify(a))}catch{}}}/**
|
|
59
56
|
* @file
|
|
60
57
|
* @license @lucide/svelte v1.16.0 - ISC
|
|
61
58
|
*
|
|
62
59
|
* This source code is licensed under the ISC license.
|
|
63
60
|
* See the LICENSE file in the root directory of this source tree.
|
|
64
|
-
*/const
|
|
61
|
+
*/const T6={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round"};/**
|
|
65
62
|
* @file
|
|
66
63
|
* @license @lucide/svelte v1.16.0 - ISC
|
|
67
64
|
*
|
|
68
65
|
* This source code is licensed under the ISC license.
|
|
69
66
|
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const
|
|
67
|
+
*/const A6=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
|
|
71
68
|
* @file
|
|
72
69
|
* @license @lucide/svelte v1.16.0 - ISC
|
|
73
70
|
*
|
|
74
71
|
* This source code is licensed under the ISC license.
|
|
75
72
|
* See the LICENSE file in the root directory of this source tree.
|
|
76
|
-
*/const
|
|
77
|
-
`}function
|
|
78
|
-
heading at the top of the form.</p>`),yS=$('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),NS=$('<dialog aria-label="Edit item" class="svelte-wge2ya"><form><h2 class="svelte-wge2ya">Edit item</h2> <label class="svelte-wge2ya"><span class="svelte-wge2ya">Template</span> <select class="svelte-wge2ya"></select> <span class="help svelte-wge2ya">Switching keeps any field values the new template doesn’t use.</span></label> <!> <!> <div class="actions svelte-wge2ya"><button type="button" class="ghost svelte-wge2ya">Cancel</button> <button type="submit" class="primary svelte-wge2ya">Save</button></div></form></dialog>');function SS(t,e){it(e,!0);const n=Xn(e,"currentFolder",3,""),r=Xn(e,"folders",19,()=>[]);let s,a=Q(dt(e.templateName));const i="\0";let o=Q(i);const l=Ae(()=>r().filter(M=>M!==n())),d=Ae(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);Qa(()=>s.showModal());function h(M){M.preventDefault(),u(a)!==e.templateName?e.onchangetemplate(u(a)):e.onclose()}var g=NS(),f=N(g),p=I(N(f),2),v=I(N(p),2);Nt(v,20,()=>u(d),M=>M,(M,J)=>{var U=gS(),G=N(U),V={};se(()=>{ae(G,J),V!==(V=J)&&(U.value=(U.__value=J)??"")}),F(M,U)});var T=I(p,2);{var _=M=>{var J=ES(),U=I(N(J),2),G=N(U),V=I(N(G),2),ee=N(V);ee.value=ee.__value=i;var y=I(ee);{var j=k=>{var D=vS();D.value=D.__value="",F(k,D)};ce(y,k=>{n()!==""&&k(j)})}var b=I(y);Nt(b,16,()=>u(l),k=>k,(k,D)=>{var W=bS(),Y=N(W),B={};se(()=>{ae(Y,`${D??""}/`),B!==(B=D)&&(W.value=(W.__value=D)??"")}),F(k,W)});var R=I(G,2);se(()=>R.disabled=u(o)===i),$a(V,()=>u(o),k=>A(o,k)),ie("click",R,()=>e.onmove(u(o))),F(M,J)};ce(T,M=>{e.onmove&&M(_)})}var E=I(T,2);{var O=M=>{var J=yS(),U=I(N(J),2),G=N(U);{var V=R=>{var k=_S();ie("click",k,function(...D){var W;(W=e.onrename)==null||W.apply(this,D)}),F(R,k)};ce(G,R=>{e.onrename&&R(V)})}var ee=I(G,2);{var y=R=>{var k=TS();ie("click",k,function(...D){var W;(W=e.ondelete)==null||W.apply(this,D)}),F(R,k)};ce(ee,R=>{e.ondelete&&R(y)})}var j=I(U,2);{var b=R=>{var k=AS();F(R,k)};ce(j,R=>{e.onrename&&R(b)})}F(M,J)};ce(E,M=>{(e.onrename||e.ondelete)&&M(O)})}var C=I(E,2),H=N(C);hn(g,M=>s=M,()=>s),Ue("close",g,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),Ue("cancel",g,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),Ue("submit",f,h),$a(v,()=>u(a),M=>A(a,M)),ie("click",H,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),F(t,g),ot()}_t(["click"]);let Po=Q(null);const wS={get pending(){return u(Po)}};function yv(t=""){return new Promise(e=>{A(Po,{current:t,resolve:e},!0)})}function li(t){u(Po)!==null&&(u(Po).resolve(t),A(Po,null))}const Fh="ref:";function Go(t){return t.startsWith(Fh)}function mf(t){return Go(t)?t.slice(Fh.length):t}function IS(t){return`${Fh}${t}`}var CS=$('<!> <span class="target svelte-147ryxk"> </span>',1),LS=$('<!> <span class="target svelte-147ryxk"> </span>',1),OS=$('<span class="value svelte-147ryxk"><!></span> <button type="button" class="action svelte-147ryxk">Edit</button> <button type="button" class="action svelte-147ryxk">Clear</button>',1),xS=$('<button type="button" class="action svelte-147ryxk">Set link…</button>'),RS=$('<div class="link-field svelte-147ryxk" role="group"><!></div>');function DS(t,e){it(e,!0);async function n(){const o=await yv(e.value);o!==null&&e.onchange(o)}var r=RS(),s=N(r);{var a=o=>{var l=OS(),d=tt(l),h=N(d);{var g=_=>{var E=CS(),O=tt(E);L6(O,{size:14,"aria-hidden":"true"});var C=I(O,2),H=N(C);se((M,J)=>{be(C,"title",M),ae(H,J)},[()=>`Page: ${mf(e.value)}`,()=>mf(e.value)]),F(_,E)},f=Ae(()=>Go(e.value)),p=_=>{var E=LS(),O=tt(E);O6(O,{size:14,"aria-hidden":"true"});var C=I(O,2),H=N(C);se(()=>{be(C,"title",e.value),ae(H,e.value)}),F(_,E)};ce(h,_=>{u(f)?_(g):_(p,-1)})}var v=I(d,2),T=I(v,2);ie("click",v,n),ie("click",T,()=>e.onchange("")),F(o,l)},i=o=>{var l=xS();ie("click",l,n),F(o,l)};ce(s,o=>{e.value?o(a):o(i,-1)})}se(()=>be(r,"aria-labelledby",e.labelledBy)),F(t,r),ot()}_t(["click"]);var kS=$('<p class="note error svelte-1v8pkea"> </p>'),PS=$('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),MS=$('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),BS=$('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),FS=$('<section class="preview svelte-1v8pkea" aria-label="Preview"><header class="bar svelte-1v8pkea"><strong class="title svelte-1v8pkea">Preview</strong> <span class="dims svelte-1v8pkea" title="Current preview width"> </span> <button type="button" class="close svelte-1v8pkea" title="Close preview" aria-label="Close preview"><!></button></header> <div class="frame svelte-1v8pkea"><!></div></section>');function US(t,e){it(e,!0);let n=Q(""),r=Q("loading"),s=Q(""),a=Q(0),i=Q(void 0),o={x:0,y:0};function l(){var U;try{const G=(U=u(i))==null?void 0:U.contentWindow;G&&(o={x:G.scrollX,y:G.scrollY})}catch{}}function d(){var U,G;try{(G=(U=u(i))==null?void 0:U.contentWindow)==null||G.scrollTo(o.x,o.y)}catch{}}let h;Rt(()=>{const U=e.previewItem,G=e.path;if(clearTimeout(h),U===null){A(r,"loading");return}return h=setTimeout(()=>void g(G,U),350),()=>clearTimeout(h)});async function g(U,G){try{const V=await r6(U,G);if(V===void 0){A(r,"empty");return}l(),A(n,V,!0),A(r,"ready")}catch(V){A(s,V instanceof Error?V.message:String(V),!0),A(r,"error")}}var f=FS(),p=N(f),v=I(N(p),2),T=N(v),_=I(v,2),E=N(_);Ph(E,{size:18,"aria-hidden":"true"});var O=I(p,2),C=N(O);{var H=U=>{var G=kS(),V=N(G);se(()=>ae(V,`Couldn’t render preview: ${u(s)??""}`)),F(U,G)},M=U=>{var G=PS();F(U,G)},J=U=>{var G=BS(),V=tt(G);hn(V,j=>A(i,j),()=>u(i));var ee=I(V,2);{var y=j=>{var b=MS();F(j,b)};ce(ee,j=>{u(r)==="loading"&&j(y)})}se(()=>be(V,"srcdoc",u(n))),Ue("load",V,d),F(U,G)};ce(C,U=>{u(r)==="error"?U(H):u(r)==="empty"?U(M,1):U(J,-1)})}se(U=>ae(T,`${U??""}px`),[()=>Math.round(u(a))]),ie("click",_,function(...U){var G;(G=e.onclose)==null||G.apply(this,U)}),Y_(O,"clientWidth",U=>A(a,U)),F(t,f),ot()}_t(["click"]);var Nv=typeof global=="object"&&global&&global.Object===Object&&global,HS=typeof self=="object"&&self&&self.Object===Object&&self,is=Nv||HS||Function("return this")(),ta=is.Symbol,Sv=Object.prototype,qS=Sv.hasOwnProperty,jS=Sv.toString,mo=ta?ta.toStringTag:void 0;function $S(t){var e=qS.call(t,mo),n=t[mo];try{t[mo]=void 0;var r=!0}catch{}var s=jS.call(t);return r&&(e?t[mo]=n:delete t[mo]),s}var YS=Object.prototype,zS=YS.toString;function WS(t){return zS.call(t)}var GS="[object Null]",KS="[object Undefined]",yp=ta?ta.toStringTag:void 0;function no(t){return t==null?t===void 0?KS:GS:yp&&yp in Object(t)?$S(t):WS(t)}function Ns(t){return t!=null&&typeof t=="object"}var Wa=Array.isArray;function ia(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function wv(t){return t}var VS="[object AsyncFunction]",XS="[object Function]",QS="[object GeneratorFunction]",ZS="[object Proxy]";function Uh(t){if(!ia(t))return!1;var e=no(t);return e==XS||e==QS||e==VS||e==ZS}var Gc=is["__core-js_shared__"],Np=(function(){var t=/[^.]+$/.exec(Gc&&Gc.keys&&Gc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function JS(t){return!!Np&&Np in t}var ew=Function.prototype,tw=ew.toString;function ei(t){if(t!=null){try{return tw.call(t)}catch{}try{return t+""}catch{}}return""}var nw=/[\\^$.*+?()[\]{}|]/g,rw=/^\[object .+?Constructor\]$/,sw=Function.prototype,aw=Object.prototype,iw=sw.toString,ow=aw.hasOwnProperty,uw=RegExp("^"+iw.call(ow).replace(nw,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function lw(t){if(!ia(t)||JS(t))return!1;var e=Uh(t)?uw:rw;return e.test(ei(t))}function cw(t,e){return t==null?void 0:t[e]}function ti(t,e){var n=cw(t,e);return lw(n)?n:void 0}var gf=ti(is,"WeakMap"),Sp=Object.create,dw=(function(){function t(){}return function(e){if(!ia(e))return{};if(Sp)return Sp(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function fw(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function hw(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var pw=800,mw=16,gw=Date.now;function vw(t){var e=0,n=0;return function(){var r=gw(),s=mw-(r-n);if(n=r,s>0){if(++e>=pw)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function bw(t){return function(){return t}}var xl=(function(){try{var t=ti(Object,"defineProperty");return t({},"",{}),t}catch{}})(),Ew=xl?function(t,e){return xl(t,"toString",{configurable:!0,enumerable:!1,value:bw(e),writable:!0})}:wv,_w=vw(Ew);function Tw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var Aw=9007199254740991,yw=/^(?:0|[1-9]\d*)$/;function Iv(t,e){var n=typeof t;return e=e??Aw,!!e&&(n=="number"||n!="symbol"&&yw.test(t))&&t>-1&&t%1==0&&t<e}function Hh(t,e,n){e=="__proto__"&&xl?xl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function gu(t,e){return t===e||t!==t&&e!==e}var Nw=Object.prototype,Sw=Nw.hasOwnProperty;function Cv(t,e,n){var r=t[e];(!(Sw.call(t,e)&&gu(r,n))||n===void 0&&!(e in t))&&Hh(t,e,n)}function ww(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),s?Hh(n,o,l):Cv(n,o,l)}return n}var wp=Math.max;function Iw(t,e,n){return e=wp(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=wp(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=n(i),fw(t,this,o)}}function Cw(t,e){return _w(Iw(t,e,wv),t+"")}var Lw=9007199254740991;function Lv(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Lw}function ac(t){return t!=null&&Lv(t.length)&&!Uh(t)}function Ow(t,e,n){if(!ia(n))return!1;var r=typeof e;return(r=="number"?ac(n)&&Iv(e,n.length):r=="string"&&e in n)?gu(n[e],t):!1}function xw(t){return Cw(function(e,n){var r=-1,s=n.length,a=s>1?n[s-1]:void 0,i=s>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(s--,a):void 0,i&&Ow(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var o=n[r];o&&t(e,o,r,a)}return e})}var Rw=Object.prototype;function qh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Rw;return t===n}function Dw(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var kw="[object Arguments]";function Ip(t){return Ns(t)&&no(t)==kw}var Ov=Object.prototype,Pw=Ov.hasOwnProperty,Mw=Ov.propertyIsEnumerable,vf=Ip((function(){return arguments})())?Ip:function(t){return Ns(t)&&Pw.call(t,"callee")&&!Mw.call(t,"callee")};function Bw(){return!1}var xv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Cp=xv&&typeof module=="object"&&module&&!module.nodeType&&module,Fw=Cp&&Cp.exports===xv,Lp=Fw?is.Buffer:void 0,Uw=Lp?Lp.isBuffer:void 0,Ko=Uw||Bw,Hw="[object Arguments]",qw="[object Array]",jw="[object Boolean]",$w="[object Date]",Yw="[object Error]",zw="[object Function]",Ww="[object Map]",Gw="[object Number]",Kw="[object Object]",Vw="[object RegExp]",Xw="[object Set]",Qw="[object String]",Zw="[object WeakMap]",Jw="[object ArrayBuffer]",eI="[object DataView]",tI="[object Float32Array]",nI="[object Float64Array]",rI="[object Int8Array]",sI="[object Int16Array]",aI="[object Int32Array]",iI="[object Uint8Array]",oI="[object Uint8ClampedArray]",uI="[object Uint16Array]",lI="[object Uint32Array]",kt={};kt[tI]=kt[nI]=kt[rI]=kt[sI]=kt[aI]=kt[iI]=kt[oI]=kt[uI]=kt[lI]=!0;kt[Hw]=kt[qw]=kt[Jw]=kt[jw]=kt[eI]=kt[$w]=kt[Yw]=kt[zw]=kt[Ww]=kt[Gw]=kt[Kw]=kt[Vw]=kt[Xw]=kt[Qw]=kt[Zw]=!1;function cI(t){return Ns(t)&&Lv(t.length)&&!!kt[no(t)]}function jh(t){return function(e){return t(e)}}var Rv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mo=Rv&&typeof module=="object"&&module&&!module.nodeType&&module,dI=Mo&&Mo.exports===Rv,Kc=dI&&Nv.process,Wi=(function(){try{var t=Mo&&Mo.require&&Mo.require("util").types;return t||Kc&&Kc.binding&&Kc.binding("util")}catch{}})(),Op=Wi&&Wi.isTypedArray,$h=Op?jh(Op):cI,fI=Object.prototype,hI=fI.hasOwnProperty;function Dv(t,e){var n=Wa(t),r=!n&&vf(t),s=!n&&!r&&Ko(t),a=!n&&!r&&!s&&$h(t),i=n||r||s||a,o=i?Dw(t.length,String):[],l=o.length;for(var d in t)(e||hI.call(t,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Iv(d,l)))&&o.push(d);return o}function kv(t,e){return function(n){return t(e(n))}}var pI=kv(Object.keys,Object),mI=Object.prototype,gI=mI.hasOwnProperty;function vI(t){if(!qh(t))return pI(t);var e=[];for(var n in Object(t))gI.call(t,n)&&n!="constructor"&&e.push(n);return e}function bI(t){return ac(t)?Dv(t):vI(t)}function EI(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var _I=Object.prototype,TI=_I.hasOwnProperty;function AI(t){if(!ia(t))return EI(t);var e=qh(t),n=[];for(var r in t)r=="constructor"&&(e||!TI.call(t,r))||n.push(r);return n}function Pv(t){return ac(t)?Dv(t,!0):AI(t)}var Vo=ti(Object,"create");function yI(){this.__data__=Vo?Vo(null):{},this.size=0}function NI(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var SI="__lodash_hash_undefined__",wI=Object.prototype,II=wI.hasOwnProperty;function CI(t){var e=this.__data__;if(Vo){var n=e[t];return n===SI?void 0:n}return II.call(e,t)?e[t]:void 0}var LI=Object.prototype,OI=LI.hasOwnProperty;function xI(t){var e=this.__data__;return Vo?e[t]!==void 0:OI.call(e,t)}var RI="__lodash_hash_undefined__";function DI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Vo&&e===void 0?RI:e,this}function Ga(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ga.prototype.clear=yI;Ga.prototype.delete=NI;Ga.prototype.get=CI;Ga.prototype.has=xI;Ga.prototype.set=DI;function kI(){this.__data__=[],this.size=0}function ic(t,e){for(var n=t.length;n--;)if(gu(t[n][0],e))return n;return-1}var PI=Array.prototype,MI=PI.splice;function BI(t){var e=this.__data__,n=ic(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():MI.call(e,n,1),--this.size,!0}function FI(t){var e=this.__data__,n=ic(e,t);return n<0?void 0:e[n][1]}function UI(t){return ic(this.__data__,t)>-1}function HI(t,e){var n=this.__data__,r=ic(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Is(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Is.prototype.clear=kI;Is.prototype.delete=BI;Is.prototype.get=FI;Is.prototype.has=UI;Is.prototype.set=HI;var Xo=ti(is,"Map");function qI(){this.size=0,this.__data__={hash:new Ga,map:new(Xo||Is),string:new Ga}}function jI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function oc(t,e){var n=t.__data__;return jI(e)?n[typeof e=="string"?"string":"hash"]:n.map}function $I(t){var e=oc(this,t).delete(t);return this.size-=e?1:0,e}function YI(t){return oc(this,t).get(t)}function zI(t){return oc(this,t).has(t)}function WI(t,e){var n=oc(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ni(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ni.prototype.clear=qI;ni.prototype.delete=$I;ni.prototype.get=YI;ni.prototype.has=zI;ni.prototype.set=WI;function GI(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var Mv=kv(Object.getPrototypeOf,Object),KI="[object Object]",VI=Function.prototype,XI=Object.prototype,Bv=VI.toString,QI=XI.hasOwnProperty,ZI=Bv.call(Object);function JI(t){if(!Ns(t)||no(t)!=KI)return!1;var e=Mv(t);if(e===null)return!0;var n=QI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Bv.call(n)==ZI}function eC(){this.__data__=new Is,this.size=0}function tC(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function nC(t){return this.__data__.get(t)}function rC(t){return this.__data__.has(t)}var sC=200;function aC(t,e){var n=this.__data__;if(n instanceof Is){var r=n.__data__;if(!Xo||r.length<sC-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ni(r)}return n.set(t,e),this.size=n.size,this}function Jr(t){var e=this.__data__=new Is(t);this.size=e.size}Jr.prototype.clear=eC;Jr.prototype.delete=tC;Jr.prototype.get=nC;Jr.prototype.has=rC;Jr.prototype.set=aC;var Fv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,xp=Fv&&typeof module=="object"&&module&&!module.nodeType&&module,iC=xp&&xp.exports===Fv,Rp=iC?is.Buffer:void 0,Dp=Rp?Rp.allocUnsafe:void 0;function Uv(t,e){if(e)return t.slice();var n=t.length,r=Dp?Dp(n):new t.constructor(n);return t.copy(r),r}function oC(t,e){for(var n=-1,r=t==null?0:t.length,s=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[s++]=i)}return a}function uC(){return[]}var lC=Object.prototype,cC=lC.propertyIsEnumerable,kp=Object.getOwnPropertySymbols,dC=kp?function(t){return t==null?[]:(t=Object(t),oC(kp(t),function(e){return cC.call(t,e)}))}:uC;function fC(t,e,n){var r=e(t);return Wa(t)?r:GI(r,n(t))}function bf(t){return fC(t,bI,dC)}var Ef=ti(is,"DataView"),_f=ti(is,"Promise"),Tf=ti(is,"Set"),Pp="[object Map]",hC="[object Object]",Mp="[object Promise]",Bp="[object Set]",Fp="[object WeakMap]",Up="[object DataView]",pC=ei(Ef),mC=ei(Xo),gC=ei(_f),vC=ei(Tf),bC=ei(gf),wr=no;(Ef&&wr(new Ef(new ArrayBuffer(1)))!=Up||Xo&&wr(new Xo)!=Pp||_f&&wr(_f.resolve())!=Mp||Tf&&wr(new Tf)!=Bp||gf&&wr(new gf)!=Fp)&&(wr=function(t){var e=no(t),n=e==hC?t.constructor:void 0,r=n?ei(n):"";if(r)switch(r){case pC:return Up;case mC:return Pp;case gC:return Mp;case vC:return Bp;case bC:return Fp}return e});var EC=Object.prototype,_C=EC.hasOwnProperty;function TC(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&_C.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Rl=is.Uint8Array;function Yh(t){var e=new t.constructor(t.byteLength);return new Rl(e).set(new Rl(t)),e}function AC(t,e){var n=Yh(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var yC=/\w*$/;function NC(t){var e=new t.constructor(t.source,yC.exec(t));return e.lastIndex=t.lastIndex,e}var Hp=ta?ta.prototype:void 0,qp=Hp?Hp.valueOf:void 0;function SC(t){return qp?Object(qp.call(t)):{}}function Hv(t,e){var n=e?Yh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var wC="[object Boolean]",IC="[object Date]",CC="[object Map]",LC="[object Number]",OC="[object RegExp]",xC="[object Set]",RC="[object String]",DC="[object Symbol]",kC="[object ArrayBuffer]",PC="[object DataView]",MC="[object Float32Array]",BC="[object Float64Array]",FC="[object Int8Array]",UC="[object Int16Array]",HC="[object Int32Array]",qC="[object Uint8Array]",jC="[object Uint8ClampedArray]",$C="[object Uint16Array]",YC="[object Uint32Array]";function zC(t,e,n){var r=t.constructor;switch(e){case kC:return Yh(t);case wC:case IC:return new r(+t);case PC:return AC(t);case MC:case BC:case FC:case UC:case HC:case qC:case jC:case $C:case YC:return Hv(t,n);case CC:return new r;case LC:case RC:return new r(t);case OC:return NC(t);case xC:return new r;case DC:return SC(t)}}function qv(t){return typeof t.constructor=="function"&&!qh(t)?dw(Mv(t)):{}}var WC="[object Map]";function GC(t){return Ns(t)&&wr(t)==WC}var jp=Wi&&Wi.isMap,KC=jp?jh(jp):GC,VC="[object Set]";function XC(t){return Ns(t)&&wr(t)==VC}var $p=Wi&&Wi.isSet,QC=$p?jh($p):XC,ZC=1,jv="[object Arguments]",JC="[object Array]",e4="[object Boolean]",t4="[object Date]",n4="[object Error]",$v="[object Function]",r4="[object GeneratorFunction]",s4="[object Map]",a4="[object Number]",Yv="[object Object]",i4="[object RegExp]",o4="[object Set]",u4="[object String]",l4="[object Symbol]",c4="[object WeakMap]",d4="[object ArrayBuffer]",f4="[object DataView]",h4="[object Float32Array]",p4="[object Float64Array]",m4="[object Int8Array]",g4="[object Int16Array]",v4="[object Int32Array]",b4="[object Uint8Array]",E4="[object Uint8ClampedArray]",_4="[object Uint16Array]",T4="[object Uint32Array]",Ot={};Ot[jv]=Ot[JC]=Ot[d4]=Ot[f4]=Ot[e4]=Ot[t4]=Ot[h4]=Ot[p4]=Ot[m4]=Ot[g4]=Ot[v4]=Ot[s4]=Ot[a4]=Ot[Yv]=Ot[i4]=Ot[o4]=Ot[u4]=Ot[l4]=Ot[b4]=Ot[E4]=Ot[_4]=Ot[T4]=!0;Ot[n4]=Ot[$v]=Ot[c4]=!1;function ll(t,e,n,r,s,a){var i,o=e&ZC;if(i!==void 0)return i;if(!ia(t))return t;var l=Wa(t);if(l)i=TC(t);else{var d=wr(t),h=d==$v||d==r4;if(Ko(t))return Uv(t,o);if(d==Yv||d==jv||h&&!s)i=h?{}:qv(t);else{if(!Ot[d])return s?t:{};i=zC(t,d,o)}}a||(a=new Jr);var g=a.get(t);if(g)return g;a.set(t,i),QC(t)?t.forEach(function(v){i.add(ll(v,e,n,v,t,a))}):KC(t)&&t.forEach(function(v,T){i.set(T,ll(v,e,n,T,t,a))});var f=bf,p=l?void 0:f(t);return Tw(p||t,function(v,T){p&&(T=v,v=t[T]),Cv(i,T,ll(v,e,n,T,t,a))}),i}var A4=1,y4=4;function Si(t){return ll(t,A4|y4)}var N4="__lodash_hash_undefined__";function S4(t){return this.__data__.set(t,N4),this}function w4(t){return this.__data__.has(t)}function Dl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ni;++e<n;)this.add(t[e])}Dl.prototype.add=Dl.prototype.push=S4;Dl.prototype.has=w4;function I4(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function C4(t,e){return t.has(e)}var L4=1,O4=2;function zv(t,e,n,r,s,a){var i=n&L4,o=t.length,l=e.length;if(o!=l&&!(i&&l>o))return!1;var d=a.get(t),h=a.get(e);if(d&&h)return d==e&&h==t;var g=-1,f=!0,p=n&O4?new Dl:void 0;for(a.set(t,e),a.set(e,t);++g<o;){var v=t[g],T=e[g];if(r)var _=i?r(T,v,g,e,t,a):r(v,T,g,t,e,a);if(_!==void 0){if(_)continue;f=!1;break}if(p){if(!I4(e,function(E,O){if(!C4(p,O)&&(v===E||s(v,E,n,r,a)))return p.push(O)})){f=!1;break}}else if(!(v===T||s(v,T,n,r,a))){f=!1;break}}return a.delete(t),a.delete(e),f}function x4(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function R4(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var D4=1,k4=2,P4="[object Boolean]",M4="[object Date]",B4="[object Error]",F4="[object Map]",U4="[object Number]",H4="[object RegExp]",q4="[object Set]",j4="[object String]",$4="[object Symbol]",Y4="[object ArrayBuffer]",z4="[object DataView]",Yp=ta?ta.prototype:void 0,Vc=Yp?Yp.valueOf:void 0;function W4(t,e,n,r,s,a,i){switch(n){case z4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case Y4:return!(t.byteLength!=e.byteLength||!a(new Rl(t),new Rl(e)));case P4:case M4:case U4:return gu(+t,+e);case B4:return t.name==e.name&&t.message==e.message;case H4:case j4:return t==e+"";case F4:var o=x4;case q4:var l=r&D4;if(o||(o=R4),t.size!=e.size&&!l)return!1;var d=i.get(t);if(d)return d==e;r|=k4,i.set(t,e);var h=zv(o(t),o(e),r,s,a,i);return i.delete(t),h;case $4:if(Vc)return Vc.call(t)==Vc.call(e)}return!1}var G4=1,K4=Object.prototype,V4=K4.hasOwnProperty;function X4(t,e,n,r,s,a){var i=n&G4,o=bf(t),l=o.length,d=bf(e),h=d.length;if(l!=h&&!i)return!1;for(var g=l;g--;){var f=o[g];if(!(i?f in e:V4.call(e,f)))return!1}var p=a.get(t),v=a.get(e);if(p&&v)return p==e&&v==t;var T=!0;a.set(t,e),a.set(e,t);for(var _=i;++g<l;){f=o[g];var E=t[f],O=e[f];if(r)var C=i?r(O,E,f,e,t,a):r(E,O,f,t,e,a);if(!(C===void 0?E===O||s(E,O,n,r,a):C)){T=!1;break}_||(_=f=="constructor")}if(T&&!_){var H=t.constructor,M=e.constructor;H!=M&&"constructor"in t&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof M=="function"&&M instanceof M)&&(T=!1)}return a.delete(t),a.delete(e),T}var Q4=1,zp="[object Arguments]",Wp="[object Array]",qu="[object Object]",Z4=Object.prototype,Gp=Z4.hasOwnProperty;function J4(t,e,n,r,s,a){var i=Wa(t),o=Wa(e),l=i?Wp:wr(t),d=o?Wp:wr(e);l=l==zp?qu:l,d=d==zp?qu:d;var h=l==qu,g=d==qu,f=l==d;if(f&&Ko(t)){if(!Ko(e))return!1;i=!0,h=!1}if(f&&!h)return a||(a=new Jr),i||$h(t)?zv(t,e,n,r,s,a):W4(t,e,l,n,r,s,a);if(!(n&Q4)){var p=h&&Gp.call(t,"__wrapped__"),v=g&&Gp.call(e,"__wrapped__");if(p||v){var T=p?t.value():t,_=v?e.value():e;return a||(a=new Jr),s(T,_,n,r,a)}}return f?(a||(a=new Jr),X4(t,e,n,r,s,a)):!1}function Wv(t,e,n,r,s){return t===e?!0:t==null||e==null||!Ns(t)&&!Ns(e)?t!==t&&e!==e:J4(t,e,n,r,Wv,s)}function eL(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),o=i.length;o--;){var l=i[++s];if(n(a[l],l,a)===!1)break}return e}}var tL=eL();function Af(t,e,n){(n!==void 0&&!gu(t[e],n)||n===void 0&&!(e in t))&&Hh(t,e,n)}function nL(t){return Ns(t)&&ac(t)}function yf(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function rL(t){return ww(t,Pv(t))}function sL(t,e,n,r,s,a,i){var o=yf(t,n),l=yf(e,n),d=i.get(l);if(d){Af(t,n,d);return}var h=a?a(o,l,n+"",t,e,i):void 0,g=h===void 0;if(g){var f=Wa(l),p=!f&&Ko(l),v=!f&&!p&&$h(l);h=l,f||p||v?Wa(o)?h=o:nL(o)?h=hw(o):p?(g=!1,h=Uv(l,!0)):v?(g=!1,h=Hv(l,!0)):h=[]:JI(l)||vf(l)?(h=o,vf(o)?h=rL(o):(!ia(o)||Uh(o))&&(h=qv(l))):g=!1}g&&(i.set(l,h),s(h,l,r,a,i),i.delete(l)),Af(t,n,h)}function Gv(t,e,n,r,s){t!==e&&tL(e,function(a,i){if(s||(s=new Jr),ia(a))sL(t,e,i,n,Gv,r,s);else{var o=r?r(yf(t,i),a,i+"",t,e,s):void 0;o===void 0&&(o=a),Af(t,i,o)}},Pv)}function zh(t,e){return Wv(t,e)}var Js=xw(function(t,e,n){Gv(t,e,n)}),Re=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(Re||{});class ss{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=Re.TYPE&Re.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Re.LEVEL|s:Re.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class wi extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Kv=class Nf{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const s=this.query(n);if(s==null)throw new wi(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),o=new a(e,i,r);return Nf.blots.set(o.domNode,o),o}find(e,n=!1){return Nf.find(e,n)}query(e,n=Re.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Re.LEVEL&Re.BLOCK?r=this.types.block:e&Re.LEVEL&Re.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&Re.LEVEL&r.scope&&n&Re.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,s="attrName"in n;if(!r&&!s)throw new wi("Invalid definition");if(r&&n.blotName==="abstract")throw new wi("Cannot register abstract class");const a=r?n.blotName:s?n.attrName:void 0;return this.types[a]=n,s?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(i=>i.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(i=>{(this.tags[i]==null||n.className==null)&&(this.tags[i]=n)}))),n})}};Kv.blots=new WeakMap;let Gi=Kv;function Kp(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class aL extends ss{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){Kp(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(Kp(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Br=aL;function Xc(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class iL extends ss{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[Xc(this.keyName)]=n,!0):!1}remove(e){e.style[Xc(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[Xc(this.keyName)];return this.canAdd(e,n)?n:""}}const oa=iL;class oL{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Gi.find(this.domNode);if(e==null)return;const n=ss.keys(this.domNode),r=Br.keys(this.domNode),s=oa.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,Re.ATTRIBUTE);i instanceof ss&&(this.attributes[i.attrName]=i)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const uc=oL,Vv=class{constructor(e,n){this.scroll=e,this.domNode=n,Gi.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new wi("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Gi.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,s){const a=this.isolate(e,n);if(this.scroll.query(r,Re.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Re.ATTRIBUTE)!=null){const i=this.scroll.create(this.statics.scope);a.wrap(i),i.format(r,s)}}insertAt(e,n,r){const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(s,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new wi(`Cannot wrap ${e}`);return r.appendChild(this),r}};Vv.blotName="abstract";let Xv=Vv;const Qv=class extends Xv{static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Qv.scope=Re.INLINE_BLOT;let uL=Qv;const Nn=uL;class lL{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),s=0;for(;r;){if(r===e)return s;s+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let s=r();for(;s;){const a=s.length();if(e<a||n&&e===a&&(s.next==null||s.next.length()!==0))return[s,e];e-=a,s=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[s,a]=this.find(e);let i=e-a;const o=this.iterator(s);let l=o();for(;l&&i<e+n;){const d=l.length();e>i?r(l,e-i,Math.min(n,i+d-e)):r(l,0,Math.min(d,e+n-i)),i+=d,l=o()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let s=r();for(;s;)n=e(n,s),s=r();return n}}function Vp(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(Re.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const Zv=class Ms extends Xv{constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Ms.uiClass&&this.uiNode.classList.add(Ms.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new lL,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=Vp(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof wi)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,s,a)=>{r.deleteAt(s,a)})}descendant(e,n=0){const[r,s]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof Ms?r.descendant(e,s):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let s=[],a=r;return this.children.forEachAt(n,r,(i,o,l)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Ms&&(s=s.concat(i.descendants(e,o,a))),a-=l}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===Re.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Ms?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,o)=>{a.formatAt(i,o,r,s)})}insertAt(e,n,r){const[s,a]=this.children.find(e);if(s)s.insertAt(a,n,r);else{const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(i)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,s]=this.children.find(e,n),a=[[this,e]];return r instanceof Ms?a.concat(r.path(s,n)):(r!=null&&a.push([r,s]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof Ms&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,a,i)=>{const o=s.split(a,n);o!=null&&r.appendChild(o)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],s=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),s.push(...a.removedNodes))}),s.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const i=this.scroll.find(a);i!=null&&(i.domNode.parentNode==null||i.domNode.parentNode===this.domNode)&&i.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,i)=>a===i?0:a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let i=null;a.nextSibling!=null&&(i=this.scroll.find(a.nextSibling));const o=Vp(a,this.scroll);(o.next!==i||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,i||void 0))}),this.enforceAllowedChildren()}};Zv.uiClass="";let cL=Zv;const Rr=cL;function dL(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const fi=class hi extends Rr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(hi.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new uc(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof hi||(r=r.wrap(hi.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Re.INLINE);if(r==null)return;r instanceof ss?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.formats()[r]!=null||this.scroll.query(r,Re.ATTRIBUTE)?this.isolate(e,n).format(r,s):super.formatAt(e,n,r,s)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof hi&&r.prev===this&&dL(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof hi&&this.attributes.move(r),r}};fi.allowedChildren=[fi,Nn],fi.blotName="inline",fi.scope=Re.INLINE_BLOT,fi.tagName="SPAN";let fL=fi;const Wh=fL,pi=class Sf extends Rr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(Sf.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new uc(this.domNode)}format(e,n){const r=this.scroll.query(e,Re.BLOCK);r!=null&&(r instanceof ss?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(Sf.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.scroll.query(r,Re.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,Re.INLINE)!=null)super.insertAt(e,n,r);else{const s=this.split(e);if(s!=null){const a=this.scroll.create(n,r);s.parent.insertBefore(a,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};pi.blotName="block",pi.scope=Re.BLOCK_BLOT,pi.tagName="P",pi.allowedChildren=[Wh,pi,Nn];let hL=pi;const Qo=hL,wf=class extends Rr{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};wf.blotName="container",wf.scope=Re.BLOCK_BLOT;let pL=wf;const lc=pL;class mL extends Nn{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,s){e===0&&n===this.length()?this.format(r,s):super.formatAt(e,n,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Zn=mL,gL={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},vL=100,mi=class extends Rr{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,gL),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=Re.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,s){this.update(),super.formatAt(e,n,r,s)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const a=(l,d=!0)=>{l==null||l===this||l.domNode.parentNode!=null&&(r.has(l.domNode)||r.set(l.domNode,[]),d&&a(l.parent))},i=l=>{r.has(l.domNode)&&(l instanceof Rr&&l.children.forEach(i),r.delete(l.domNode),l.optimize(n))};let o=e;for(let l=0;o.length>0;l+=1){if(l>=vL)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const h=this.find(d.target,!0);h!=null&&(h.domNode===d.target&&(d.type==="childList"?(a(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(g=>{const f=this.find(g,!1);a(f,!1),f instanceof Rr&&f.children.forEach(p=>{a(p,!1)})})):d.type==="attributes"&&a(h.prev)),a(h))}),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const a=this.find(s.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(s),null):(r.set(a.domNode,[s]),a)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};mi.blotName="scroll",mi.defaultChild=Qo,mi.allowedChildren=[Qo,lc],mi.scope=Re.BLOCK_BLOT,mi.tagName="DIV";let bL=mi;const Gh=bL,If=class Jv extends Nn{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Jv&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};If.blotName="text",If.scope=Re.INLINE_BLOT;let EL=If;const kl=EL,_L=Object.freeze(Object.defineProperty({__proto__:null,Attributor:ss,AttributorStore:uc,BlockBlot:Qo,ClassAttributor:Br,ContainerBlot:lc,EmbedBlot:Zn,InlineBlot:Wh,LeafBlot:Nn,ParentBlot:Rr,Registry:Gi,Scope:Re,ScrollBlot:Gh,StyleAttributor:oa,TextBlot:kl},Symbol.toStringTag,{value:"Module"}));var zs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ju={exports:{}},Qc,Xp;function TL(){if(Xp)return Qc;Xp=1;var t=-1,e=1,n=0;function r(y,j,b,R,k){if(y===j)return y?[[n,y]]:[];if(b!=null){var D=V(y,j,b);if(D)return D}var W=o(y,j),Y=y.substring(0,W);y=y.substring(W),j=j.substring(W),W=d(y,j);var B=y.substring(y.length-W);y=y.substring(0,y.length-W),j=j.substring(0,j.length-W);var z=s(y,j);return Y&&z.unshift([n,Y]),B&&z.push([n,B]),O(z,k),R&&g(z),z}function s(y,j){var b;if(!y)return[[e,j]];if(!j)return[[t,y]];var R=y.length>j.length?y:j,k=y.length>j.length?j:y,D=R.indexOf(k);if(D!==-1)return b=[[e,R.substring(0,D)],[n,k],[e,R.substring(D+k.length)]],y.length>j.length&&(b[0][0]=b[2][0]=t),b;if(k.length===1)return[[t,y],[e,j]];var W=h(y,j);if(W){var Y=W[0],B=W[1],z=W[2],K=W[3],te=W[4],he=r(Y,z),Ee=r(B,K);return he.concat([[n,te]],Ee)}return a(y,j)}function a(y,j){for(var b=y.length,R=j.length,k=Math.ceil((b+R)/2),D=k,W=2*k,Y=new Array(W),B=new Array(W),z=0;z<W;z++)Y[z]=-1,B[z]=-1;Y[D+1]=0,B[D+1]=0;for(var K=b-R,te=K%2!==0,he=0,Ee=0,ge=0,Ce=0,fe=0;fe<k;fe++){for(var ne=-fe+he;ne<=fe-Ee;ne+=2){var de=D+ne,me;ne===-fe||ne!==fe&&Y[de-1]<Y[de+1]?me=Y[de+1]:me=Y[de-1]+1;for(var Te=me-ne;me<b&&Te<R&&y.charAt(me)===j.charAt(Te);)me++,Te++;if(Y[de]=me,me>b)Ee+=2;else if(Te>R)he+=2;else if(te){var Ie=D+K-ne;if(Ie>=0&&Ie<W&&B[Ie]!==-1){var Oe=b-B[Ie];if(me>=Oe)return i(y,j,me,Te)}}}for(var Pe=-fe+ge;Pe<=fe-Ce;Pe+=2){var Ie=D+Pe,Oe;Pe===-fe||Pe!==fe&&B[Ie-1]<B[Ie+1]?Oe=B[Ie+1]:Oe=B[Ie-1]+1;for(var Fe=Oe-Pe;Oe<b&&Fe<R&&y.charAt(b-Oe-1)===j.charAt(R-Fe-1);)Oe++,Fe++;if(B[Ie]=Oe,Oe>b)Ce+=2;else if(Fe>R)ge+=2;else if(!te){var de=D+K-Pe;if(de>=0&&de<W&&Y[de]!==-1){var me=Y[de],Te=D+me-de;if(Oe=b-Oe,me>=Oe)return i(y,j,me,Te)}}}}return[[t,y],[e,j]]}function i(y,j,b,R){var k=y.substring(0,b),D=j.substring(0,R),W=y.substring(b),Y=j.substring(R),B=r(k,D),z=r(W,Y);return B.concat(z)}function o(y,j){if(!y||!j||y.charAt(0)!==j.charAt(0))return 0;for(var b=0,R=Math.min(y.length,j.length),k=R,D=0;b<k;)y.substring(D,k)==j.substring(D,k)?(b=k,D=b):R=k,k=Math.floor((R-b)/2+b);return C(y.charCodeAt(k-1))&&k--,k}function l(y,j){var b=y.length,R=j.length;if(b==0||R==0)return 0;b>R?y=y.substring(b-R):b<R&&(j=j.substring(0,b));var k=Math.min(b,R);if(y==j)return k;for(var D=0,W=1;;){var Y=y.substring(k-W),B=j.indexOf(Y);if(B==-1)return D;W+=B,(B==0||y.substring(k-W)==j.substring(0,W))&&(D=W,W++)}}function d(y,j){if(!y||!j||y.slice(-1)!==j.slice(-1))return 0;for(var b=0,R=Math.min(y.length,j.length),k=R,D=0;b<k;)y.substring(y.length-k,y.length-D)==j.substring(j.length-k,j.length-D)?(b=k,D=b):R=k,k=Math.floor((R-b)/2+b);return H(y.charCodeAt(y.length-k))&&k--,k}function h(y,j){var b=y.length>j.length?y:j,R=y.length>j.length?j:y;if(b.length<4||R.length*2<b.length)return null;function k(Ee,ge,Ce){for(var fe=Ee.substring(Ce,Ce+Math.floor(Ee.length/4)),ne=-1,de="",me,Te,Ie,Oe;(ne=ge.indexOf(fe,ne+1))!==-1;){var Pe=o(Ee.substring(Ce),ge.substring(ne)),Fe=d(Ee.substring(0,Ce),ge.substring(0,ne));de.length<Fe+Pe&&(de=ge.substring(ne-Fe,ne)+ge.substring(ne,ne+Pe),me=Ee.substring(0,Ce-Fe),Te=Ee.substring(Ce+Pe),Ie=ge.substring(0,ne-Fe),Oe=ge.substring(ne+Pe))}return de.length*2>=Ee.length?[me,Te,Ie,Oe,de]:null}var D=k(b,R,Math.ceil(b.length/4)),W=k(b,R,Math.ceil(b.length/2)),Y;if(!D&&!W)return null;W?D?Y=D[4].length>W[4].length?D:W:Y=W:Y=D;var B,z,K,te;y.length>j.length?(B=Y[0],z=Y[1],K=Y[2],te=Y[3]):(K=Y[0],te=Y[1],B=Y[2],z=Y[3]);var he=Y[4];return[B,z,K,te,he]}function g(y){for(var j=!1,b=[],R=0,k=null,D=0,W=0,Y=0,B=0,z=0;D<y.length;)y[D][0]==n?(b[R++]=D,W=B,Y=z,B=0,z=0,k=y[D][1]):(y[D][0]==e?B+=y[D][1].length:z+=y[D][1].length,k&&k.length<=Math.max(W,Y)&&k.length<=Math.max(B,z)&&(y.splice(b[R-1],0,[t,k]),y[b[R-1]+1][0]=e,R--,R--,D=R>0?b[R-1]:-1,W=0,Y=0,B=0,z=0,k=null,j=!0)),D++;for(j&&O(y),E(y),D=1;D<y.length;){if(y[D-1][0]==t&&y[D][0]==e){var K=y[D-1][1],te=y[D][1],he=l(K,te),Ee=l(te,K);he>=Ee?(he>=K.length/2||he>=te.length/2)&&(y.splice(D,0,[n,te.substring(0,he)]),y[D-1][1]=K.substring(0,K.length-he),y[D+1][1]=te.substring(he),D++):(Ee>=K.length/2||Ee>=te.length/2)&&(y.splice(D,0,[n,K.substring(0,Ee)]),y[D-1][0]=e,y[D-1][1]=te.substring(0,te.length-Ee),y[D+1][0]=t,y[D+1][1]=K.substring(Ee),D++),D++}D++}}var f=/[^a-zA-Z0-9]/,p=/\s/,v=/[\r\n]/,T=/\n\r?\n$/,_=/^\r?\n\r?\n/;function E(y){function j(Ee,ge){if(!Ee||!ge)return 6;var Ce=Ee.charAt(Ee.length-1),fe=ge.charAt(0),ne=Ce.match(f),de=fe.match(f),me=ne&&Ce.match(p),Te=de&&fe.match(p),Ie=me&&Ce.match(v),Oe=Te&&fe.match(v),Pe=Ie&&Ee.match(T),Fe=Oe&&ge.match(_);return Pe||Fe?5:Ie||Oe?4:ne&&!me&&Te?3:me||Te?2:ne||de?1:0}for(var b=1;b<y.length-1;){if(y[b-1][0]==n&&y[b+1][0]==n){var R=y[b-1][1],k=y[b][1],D=y[b+1][1],W=d(R,k);if(W){var Y=k.substring(k.length-W);R=R.substring(0,R.length-W),k=Y+k.substring(0,k.length-W),D=Y+D}for(var B=R,z=k,K=D,te=j(R,k)+j(k,D);k.charAt(0)===D.charAt(0);){R+=k.charAt(0),k=k.substring(1)+D.charAt(0),D=D.substring(1);var he=j(R,k)+j(k,D);he>=te&&(te=he,B=R,z=k,K=D)}y[b-1][1]!=B&&(B?y[b-1][1]=B:(y.splice(b-1,1),b--),y[b][1]=z,K?y[b+1][1]=K:(y.splice(b+1,1),b--))}b++}}function O(y,j){y.push([n,""]);for(var b=0,R=0,k=0,D="",W="",Y;b<y.length;){if(b<y.length-1&&!y[b][1]){y.splice(b,1);continue}switch(y[b][0]){case e:k++,W+=y[b][1],b++;break;case t:R++,D+=y[b][1],b++;break;case n:var B=b-k-R-1;if(j){if(B>=0&&J(y[B][1])){var z=y[B][1].slice(-1);if(y[B][1]=y[B][1].slice(0,-1),D=z+D,W=z+W,!y[B][1]){y.splice(B,1),b--;var K=B-1;y[K]&&y[K][0]===e&&(k++,W=y[K][1]+W,K--),y[K]&&y[K][0]===t&&(R++,D=y[K][1]+D,K--),B=K}}if(M(y[b][1])){var z=y[b][1].charAt(0);y[b][1]=y[b][1].slice(1),D+=z,W+=z}}if(b<y.length-1&&!y[b][1]){y.splice(b,1);break}if(D.length>0||W.length>0){D.length>0&&W.length>0&&(Y=o(W,D),Y!==0&&(B>=0?y[B][1]+=W.substring(0,Y):(y.splice(0,0,[n,W.substring(0,Y)]),b++),W=W.substring(Y),D=D.substring(Y)),Y=d(W,D),Y!==0&&(y[b][1]=W.substring(W.length-Y)+y[b][1],W=W.substring(0,W.length-Y),D=D.substring(0,D.length-Y)));var te=k+R;D.length===0&&W.length===0?(y.splice(b-te,te),b=b-te):D.length===0?(y.splice(b-te,te,[e,W]),b=b-te+1):W.length===0?(y.splice(b-te,te,[t,D]),b=b-te+1):(y.splice(b-te,te,[t,D],[e,W]),b=b-te+2)}b!==0&&y[b-1][0]===n?(y[b-1][1]+=y[b][1],y.splice(b,1)):b++,k=0,R=0,D="",W="";break}}y[y.length-1][1]===""&&y.pop();var he=!1;for(b=1;b<y.length-1;)y[b-1][0]===n&&y[b+1][0]===n&&(y[b][1].substring(y[b][1].length-y[b-1][1].length)===y[b-1][1]?(y[b][1]=y[b-1][1]+y[b][1].substring(0,y[b][1].length-y[b-1][1].length),y[b+1][1]=y[b-1][1]+y[b+1][1],y.splice(b-1,1),he=!0):y[b][1].substring(0,y[b+1][1].length)==y[b+1][1]&&(y[b-1][1]+=y[b+1][1],y[b][1]=y[b][1].substring(y[b+1][1].length)+y[b+1][1],y.splice(b+1,1),he=!0)),b++;he&&O(y,j)}function C(y){return y>=55296&&y<=56319}function H(y){return y>=56320&&y<=57343}function M(y){return H(y.charCodeAt(0))}function J(y){return C(y.charCodeAt(y.length-1))}function U(y){for(var j=[],b=0;b<y.length;b++)y[b][1].length>0&&j.push(y[b]);return j}function G(y,j,b,R){return J(y)||M(R)?null:U([[n,y],[t,j],[e,b],[n,R]])}function V(y,j,b){var R=typeof b=="number"?{index:b,length:0}:b.oldRange,k=typeof b=="number"?null:b.newRange,D=y.length,W=j.length;if(R.length===0&&(k===null||k.length===0)){var Y=R.index,B=y.slice(0,Y),z=y.slice(Y),K=k?k.index:null;e:{var te=Y+W-D;if(K!==null&&K!==te||te<0||te>W)break e;var he=j.slice(0,te),Ee=j.slice(te);if(Ee!==z)break e;var ge=Math.min(Y,te),Ce=B.slice(0,ge),fe=he.slice(0,ge);if(Ce!==fe)break e;var ne=B.slice(ge),de=he.slice(ge);return G(Ce,ne,de,z)}e:{if(K!==null&&K!==Y)break e;var me=Y,he=j.slice(0,me),Ee=j.slice(me);if(he!==B)break e;var Te=Math.min(D-me,W-me),Ie=z.slice(z.length-Te),Oe=Ee.slice(Ee.length-Te);if(Ie!==Oe)break e;var ne=z.slice(0,z.length-Te),de=Ee.slice(0,Ee.length-Te);return G(B,ne,de,Ie)}}if(R.length>0&&k&&k.length===0)e:{var Ce=y.slice(0,R.index),Ie=y.slice(R.index+R.length),ge=Ce.length,Te=Ie.length;if(W<ge+Te)break e;var fe=j.slice(0,ge),Oe=j.slice(W-Te);if(Ce!==fe||Ie!==Oe)break e;var ne=y.slice(ge,D-Te),de=j.slice(ge,W-Te);return G(Ce,ne,de,Ie)}return null}function ee(y,j,b,R){return r(y,j,b,R,!0)}return ee.INSERT=e,ee.DELETE=t,ee.EQUAL=n,Qc=ee,Qc}var To={exports:{}};To.exports;var Qp;function tb(){return Qp||(Qp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",o="[object Boolean]",l="[object Date]",d="[object Error]",h="[object Function]",g="[object GeneratorFunction]",f="[object Map]",p="[object Number]",v="[object Object]",T="[object Promise]",_="[object RegExp]",E="[object Set]",O="[object String]",C="[object Symbol]",H="[object WeakMap]",M="[object ArrayBuffer]",J="[object DataView]",U="[object Float32Array]",G="[object Float64Array]",V="[object Int8Array]",ee="[object Int16Array]",y="[object Int32Array]",j="[object Uint8Array]",b="[object Uint8ClampedArray]",R="[object Uint16Array]",k="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,W=/\w*$/,Y=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,z={};z[a]=z[i]=z[M]=z[J]=z[o]=z[l]=z[U]=z[G]=z[V]=z[ee]=z[y]=z[f]=z[p]=z[v]=z[_]=z[E]=z[O]=z[C]=z[j]=z[b]=z[R]=z[k]=!0,z[d]=z[h]=z[H]=!1;var K=typeof zs=="object"&&zs&&zs.Object===Object&&zs,te=typeof self=="object"&&self&&self.Object===Object&&self,he=K||te||Function("return this")(),Ee=e&&!e.nodeType&&e,ge=Ee&&!0&&t&&!t.nodeType&&t,Ce=ge&&ge.exports===Ee;function fe(m,S){return m.set(S[0],S[1]),m}function ne(m,S){return m.add(S),m}function de(m,S){for(var q=-1,oe=m?m.length:0;++q<oe&&S(m[q],q,m)!==!1;);return m}function me(m,S){for(var q=-1,oe=S.length,ze=m.length;++q<oe;)m[ze+q]=S[q];return m}function Te(m,S,q,oe){for(var ze=-1,ke=m?m.length:0;++ze<ke;)q=S(q,m[ze],ze,m);return q}function Ie(m,S){for(var q=-1,oe=Array(m);++q<m;)oe[q]=S(q);return oe}function Oe(m,S){return m==null?void 0:m[S]}function Pe(m){var S=!1;if(m!=null&&typeof m.toString!="function")try{S=!!(m+"")}catch{}return S}function Fe(m){var S=-1,q=Array(m.size);return m.forEach(function(oe,ze){q[++S]=[ze,oe]}),q}function St(m,S){return function(q){return m(S(q))}}function Be(m){var S=-1,q=Array(m.size);return m.forEach(function(oe){q[++S]=oe}),q}var Pt=Array.prototype,jt=Function.prototype,Ct=Object.prototype,ut=he["__core-js_shared__"],Gt=(function(){var m=/[^.]+$/.exec(ut&&ut.keys&&ut.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),Lt=jt.toString,pt=Ct.hasOwnProperty,Zt=Ct.toString,pn=RegExp("^"+Lt.call(pt).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),vt=Ce?he.Buffer:void 0,wt=he.Symbol,nt=he.Uint8Array,Qe=St(Object.getPrototypeOf,Object),Mt=Object.create,Dt=Ct.propertyIsEnumerable,kn=Pt.splice,Pn=Object.getOwnPropertySymbols,on=vt?vt.isBuffer:void 0,$t=St(Object.keys,Object),Mn=Er(he,"DataView"),br=Er(he,"Map"),In=Er(he,"Promise"),Hr=Er(he,"Set"),os=Er(he,"WeakMap"),Jn=Er(Object,"create"),us=Cn(Mn),Ne=Cn(br),Ye=Cn(In),Xe=Cn(Hr),Je=Cn(os),L=wt?wt.prototype:void 0,ue=L?L.valueOf:void 0;function _e(m){var S=-1,q=m?m.length:0;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function De(){this.__data__=Jn?Jn(null):{}}function Ve(m){return this.has(m)&&delete this.__data__[m]}function We(m){var S=this.__data__;if(Jn){var q=S[m];return q===r?void 0:q}return pt.call(S,m)?S[m]:void 0}function bt(m){var S=this.__data__;return Jn?S[m]!==void 0:pt.call(S,m)}function un(m,S){var q=this.__data__;return q[m]=Jn&&S===void 0?r:S,this}_e.prototype.clear=De,_e.prototype.delete=Ve,_e.prototype.get=We,_e.prototype.has=bt,_e.prototype.set=un;function At(m){var S=-1,q=m?m.length:0;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function er(){this.__data__=[]}function Ls(m){var S=this.__data__,q=mt(S,m);if(q<0)return!1;var oe=S.length-1;return q==oe?S.pop():kn.call(S,q,1),!0}function qr(m){var S=this.__data__,q=mt(S,m);return q<0?void 0:S[q][1]}function ua(m){return mt(this.__data__,m)>-1}function la(m,S){var q=this.__data__,oe=mt(q,m);return oe<0?q.push([m,S]):q[oe][1]=S,this}At.prototype.clear=er,At.prototype.delete=Ls,At.prototype.get=qr,At.prototype.has=ua,At.prototype.set=la;function Kt(m){var S=-1,q=m?m.length:0;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function ca(){this.__data__={hash:new _e,map:new(br||At),string:new _e}}function da(m){return va(this,m).delete(m)}function Os(m){return va(this,m).get(m)}function fa(m){return va(this,m).has(m)}function ha(m,S){return va(this,m).set(m,S),this}Kt.prototype.clear=ca,Kt.prototype.delete=da,Kt.prototype.get=Os,Kt.prototype.has=fa,Kt.prototype.set=ha;function ln(m){this.__data__=new At(m)}function xs(){this.__data__=new At}function pa(m){return this.__data__.delete(m)}function ma(m){return this.__data__.get(m)}function ga(m){return this.__data__.has(m)}function we(m,S){var q=this.__data__;if(q instanceof At){var oe=q.__data__;if(!br||oe.length<n-1)return oe.push([m,S]),this;q=this.__data__=new Kt(oe)}return q.set(m,S),this}ln.prototype.clear=xs,ln.prototype.delete=pa,ln.prototype.get=ma,ln.prototype.has=ga,ln.prototype.set=we;function Se(m,S){var q=so(m)||ii(m)?Ie(m.length,String):[],oe=q.length,ze=!!oe;for(var ke in m)pt.call(m,ke)&&!(ze&&(ke=="length"||Tc(ke,oe)))&&q.push(ke);return q}function He(m,S,q){var oe=m[S];(!(pt.call(m,S)&&yu(oe,q))||q===void 0&&!(S in m))&&(m[S]=q)}function mt(m,S){for(var q=m.length;q--;)if(yu(m[q][0],S))return q;return-1}function Ht(m,S){return m&&ro(S,io(S),m)}function qt(m,S,q,oe,ze,ke,ft){var lt;if(oe&&(lt=ke?oe(m,ze,ke,ft):oe(m)),lt!==void 0)return lt;if(!$r(m))return m;var Vt=so(m);if(Vt){if(lt=Ec(m),!S)return gc(m,lt)}else{var Et=cs(m),Tn=Et==h||Et==g;if(Nu(m))return tn(m,S);if(Et==v||Et==a||Tn&&!ke){if(Pe(m))return ke?m:{};if(lt=jr(Tn?{}:m),!S)return vc(m,Ht(lt,m))}else{if(!z[Et])return ke?m:{};lt=_c(m,Et,qt,S)}}ft||(ft=new ln);var Bn=ft.get(m);if(Bn)return Bn;if(ft.set(m,lt),!Vt)var nn=q?bc(m):io(m);return de(nn||m,function(An,gn){nn&&(gn=An,An=m[gn]),He(lt,gn,qt(An,S,q,oe,gn,m,ft))}),lt}function Jt(m){return $r(m)?Mt(m):{}}function mn(m,S,q){var oe=S(m);return so(m)?oe:me(oe,q(m))}function en(m){return Zt.call(m)}function tr(m){if(!$r(m)||yc(m))return!1;var S=ao(m)||Pe(m)?pn:Y;return S.test(Cn(m))}function Bt(m){if(!Tu(m))return $t(m);var S=[];for(var q in Object(m))pt.call(m,q)&&q!="constructor"&&S.push(q);return S}function tn(m,S){if(S)return m.slice();var q=new m.constructor(m.length);return m.copy(q),q}function Tt(m){var S=new m.constructor(m.byteLength);return new nt(S).set(new nt(m)),S}function Ft(m,S){var q=S?Tt(m.buffer):m.buffer;return new m.constructor(q,m.byteOffset,m.byteLength)}function nr(m,S,q){var oe=S?q(Fe(m),!0):Fe(m);return Te(oe,fe,new m.constructor)}function rr(m){var S=new m.constructor(m.source,W.exec(m));return S.lastIndex=m.lastIndex,S}function hc(m,S,q){var oe=S?q(Be(m),!0):Be(m);return Te(oe,ne,new m.constructor)}function pc(m){return ue?Object(ue.call(m)):{}}function mc(m,S){var q=S?Tt(m.buffer):m.buffer;return new m.constructor(q,m.byteOffset,m.length)}function gc(m,S){var q=-1,oe=m.length;for(S||(S=Array(oe));++q<oe;)S[q]=m[q];return S}function ro(m,S,q,oe){q||(q={});for(var ze=-1,ke=S.length;++ze<ke;){var ft=S[ze],lt=void 0;He(q,ft,lt===void 0?m[ft]:lt)}return q}function vc(m,S){return ro(m,ls(m),S)}function bc(m){return mn(m,io,ls)}function va(m,S){var q=m.__data__;return Ac(S)?q[typeof S=="string"?"string":"hash"]:q.map}function Er(m,S){var q=Oe(m,S);return tr(q)?q:void 0}var ls=Pn?St(Pn,Object):Sc,cs=en;(Mn&&cs(new Mn(new ArrayBuffer(1)))!=J||br&&cs(new br)!=f||In&&cs(In.resolve())!=T||Hr&&cs(new Hr)!=E||os&&cs(new os)!=H)&&(cs=function(m){var S=Zt.call(m),q=S==v?m.constructor:void 0,oe=q?Cn(q):void 0;if(oe)switch(oe){case us:return J;case Ne:return f;case Ye:return T;case Xe:return E;case Je:return H}return S});function Ec(m){var S=m.length,q=m.constructor(S);return S&&typeof m[0]=="string"&&pt.call(m,"index")&&(q.index=m.index,q.input=m.input),q}function jr(m){return typeof m.constructor=="function"&&!Tu(m)?Jt(Qe(m)):{}}function _c(m,S,q,oe){var ze=m.constructor;switch(S){case M:return Tt(m);case o:case l:return new ze(+m);case J:return Ft(m,oe);case U:case G:case V:case ee:case y:case j:case b:case R:case k:return mc(m,oe);case f:return nr(m,oe,q);case p:case O:return new ze(m);case _:return rr(m);case E:return hc(m,oe,q);case C:return pc(m)}}function Tc(m,S){return S=S??s,!!S&&(typeof m=="number"||B.test(m))&&m>-1&&m%1==0&&m<S}function Ac(m){var S=typeof m;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?m!=="__proto__":m===null}function yc(m){return!!Gt&&Gt in m}function Tu(m){var S=m&&m.constructor,q=typeof S=="function"&&S.prototype||Ct;return m===q}function Cn(m){if(m!=null){try{return Lt.call(m)}catch{}try{return m+""}catch{}}return""}function Au(m){return qt(m,!0,!0)}function yu(m,S){return m===S||m!==m&&S!==S}function ii(m){return Nc(m)&&pt.call(m,"callee")&&(!Dt.call(m,"callee")||Zt.call(m)==a)}var so=Array.isArray;function oi(m){return m!=null&&Su(m.length)&&!ao(m)}function Nc(m){return wu(m)&&oi(m)}var Nu=on||wc;function ao(m){var S=$r(m)?Zt.call(m):"";return S==h||S==g}function Su(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=s}function $r(m){var S=typeof m;return!!m&&(S=="object"||S=="function")}function wu(m){return!!m&&typeof m=="object"}function io(m){return oi(m)?Se(m):Bt(m)}function Sc(){return[]}function wc(){return!1}t.exports=Au})(To,To.exports)),To.exports}var Ao={exports:{}};Ao.exports;var Zp;function nb(){return Zp||(Zp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,o="[object Arguments]",l="[object Array]",d="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",f="[object Error]",p="[object Function]",v="[object GeneratorFunction]",T="[object Map]",_="[object Number]",E="[object Null]",O="[object Object]",C="[object Promise]",H="[object Proxy]",M="[object RegExp]",J="[object Set]",U="[object String]",G="[object Symbol]",V="[object Undefined]",ee="[object WeakMap]",y="[object ArrayBuffer]",j="[object DataView]",b="[object Float32Array]",R="[object Float64Array]",k="[object Int8Array]",D="[object Int16Array]",W="[object Int32Array]",Y="[object Uint8Array]",B="[object Uint8ClampedArray]",z="[object Uint16Array]",K="[object Uint32Array]",te=/[\\^$.*+?()[\]{}|]/g,he=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,ge={};ge[b]=ge[R]=ge[k]=ge[D]=ge[W]=ge[Y]=ge[B]=ge[z]=ge[K]=!0,ge[o]=ge[l]=ge[y]=ge[h]=ge[j]=ge[g]=ge[f]=ge[p]=ge[T]=ge[_]=ge[O]=ge[M]=ge[J]=ge[U]=ge[ee]=!1;var Ce=typeof zs=="object"&&zs&&zs.Object===Object&&zs,fe=typeof self=="object"&&self&&self.Object===Object&&self,ne=Ce||fe||Function("return this")(),de=e&&!e.nodeType&&e,me=de&&!0&&t&&!t.nodeType&&t,Te=me&&me.exports===de,Ie=Te&&Ce.process,Oe=(function(){try{return Ie&&Ie.binding&&Ie.binding("util")}catch{}})(),Pe=Oe&&Oe.isTypedArray;function Fe(m,S){for(var q=-1,oe=m==null?0:m.length,ze=0,ke=[];++q<oe;){var ft=m[q];S(ft,q,m)&&(ke[ze++]=ft)}return ke}function St(m,S){for(var q=-1,oe=S.length,ze=m.length;++q<oe;)m[ze+q]=S[q];return m}function Be(m,S){for(var q=-1,oe=m==null?0:m.length;++q<oe;)if(S(m[q],q,m))return!0;return!1}function Pt(m,S){for(var q=-1,oe=Array(m);++q<m;)oe[q]=S(q);return oe}function jt(m){return function(S){return m(S)}}function Ct(m,S){return m.has(S)}function ut(m,S){return m==null?void 0:m[S]}function Gt(m){var S=-1,q=Array(m.size);return m.forEach(function(oe,ze){q[++S]=[ze,oe]}),q}function Lt(m,S){return function(q){return m(S(q))}}function pt(m){var S=-1,q=Array(m.size);return m.forEach(function(oe){q[++S]=oe}),q}var Zt=Array.prototype,pn=Function.prototype,vt=Object.prototype,wt=ne["__core-js_shared__"],nt=pn.toString,Qe=vt.hasOwnProperty,Mt=(function(){var m=/[^.]+$/.exec(wt&&wt.keys&&wt.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),Dt=vt.toString,kn=RegExp("^"+nt.call(Qe).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Pn=Te?ne.Buffer:void 0,on=ne.Symbol,$t=ne.Uint8Array,Mn=vt.propertyIsEnumerable,br=Zt.splice,In=on?on.toStringTag:void 0,Hr=Object.getOwnPropertySymbols,os=Pn?Pn.isBuffer:void 0,Jn=Lt(Object.keys,Object),us=ls(ne,"DataView"),Ne=ls(ne,"Map"),Ye=ls(ne,"Promise"),Xe=ls(ne,"Set"),Je=ls(ne,"WeakMap"),L=ls(Object,"create"),ue=Cn(us),_e=Cn(Ne),De=Cn(Ye),Ve=Cn(Xe),We=Cn(Je),bt=on?on.prototype:void 0,un=bt?bt.valueOf:void 0;function At(m){var S=-1,q=m==null?0:m.length;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function er(){this.__data__=L?L(null):{},this.size=0}function Ls(m){var S=this.has(m)&&delete this.__data__[m];return this.size-=S?1:0,S}function qr(m){var S=this.__data__;if(L){var q=S[m];return q===r?void 0:q}return Qe.call(S,m)?S[m]:void 0}function ua(m){var S=this.__data__;return L?S[m]!==void 0:Qe.call(S,m)}function la(m,S){var q=this.__data__;return this.size+=this.has(m)?0:1,q[m]=L&&S===void 0?r:S,this}At.prototype.clear=er,At.prototype.delete=Ls,At.prototype.get=qr,At.prototype.has=ua,At.prototype.set=la;function Kt(m){var S=-1,q=m==null?0:m.length;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function ca(){this.__data__=[],this.size=0}function da(m){var S=this.__data__,q=tn(S,m);if(q<0)return!1;var oe=S.length-1;return q==oe?S.pop():br.call(S,q,1),--this.size,!0}function Os(m){var S=this.__data__,q=tn(S,m);return q<0?void 0:S[q][1]}function fa(m){return tn(this.__data__,m)>-1}function ha(m,S){var q=this.__data__,oe=tn(q,m);return oe<0?(++this.size,q.push([m,S])):q[oe][1]=S,this}Kt.prototype.clear=ca,Kt.prototype.delete=da,Kt.prototype.get=Os,Kt.prototype.has=fa,Kt.prototype.set=ha;function ln(m){var S=-1,q=m==null?0:m.length;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function xs(){this.size=0,this.__data__={hash:new At,map:new(Ne||Kt),string:new At}}function pa(m){var S=Er(this,m).delete(m);return this.size-=S?1:0,S}function ma(m){return Er(this,m).get(m)}function ga(m){return Er(this,m).has(m)}function we(m,S){var q=Er(this,m),oe=q.size;return q.set(m,S),this.size+=q.size==oe?0:1,this}ln.prototype.clear=xs,ln.prototype.delete=pa,ln.prototype.get=ma,ln.prototype.has=ga,ln.prototype.set=we;function Se(m){var S=-1,q=m==null?0:m.length;for(this.__data__=new ln;++S<q;)this.add(m[S])}function He(m){return this.__data__.set(m,r),this}function mt(m){return this.__data__.has(m)}Se.prototype.add=Se.prototype.push=He,Se.prototype.has=mt;function Ht(m){var S=this.__data__=new Kt(m);this.size=S.size}function qt(){this.__data__=new Kt,this.size=0}function Jt(m){var S=this.__data__,q=S.delete(m);return this.size=S.size,q}function mn(m){return this.__data__.get(m)}function en(m){return this.__data__.has(m)}function tr(m,S){var q=this.__data__;if(q instanceof Kt){var oe=q.__data__;if(!Ne||oe.length<n-1)return oe.push([m,S]),this.size=++q.size,this;q=this.__data__=new ln(oe)}return q.set(m,S),this.size=q.size,this}Ht.prototype.clear=qt,Ht.prototype.delete=Jt,Ht.prototype.get=mn,Ht.prototype.has=en,Ht.prototype.set=tr;function Bt(m,S){var q=ii(m),oe=!q&&yu(m),ze=!q&&!oe&&oi(m),ke=!q&&!oe&&!ze&&wu(m),ft=q||oe||ze||ke,lt=ft?Pt(m.length,String):[],Vt=lt.length;for(var Et in m)Qe.call(m,Et)&&!(ft&&(Et=="length"||ze&&(Et=="offset"||Et=="parent")||ke&&(Et=="buffer"||Et=="byteLength"||Et=="byteOffset")||_c(Et,Vt)))&<.push(Et);return lt}function tn(m,S){for(var q=m.length;q--;)if(Au(m[q][0],S))return q;return-1}function Tt(m,S,q){var oe=S(m);return ii(m)?oe:St(oe,q(m))}function Ft(m){return m==null?m===void 0?V:E:In&&In in Object(m)?cs(m):Tu(m)}function nr(m){return $r(m)&&Ft(m)==o}function rr(m,S,q,oe,ze){return m===S?!0:m==null||S==null||!$r(m)&&!$r(S)?m!==m&&S!==S:hc(m,S,q,oe,rr,ze)}function hc(m,S,q,oe,ze,ke){var ft=ii(m),lt=ii(S),Vt=ft?l:jr(m),Et=lt?l:jr(S);Vt=Vt==o?O:Vt,Et=Et==o?O:Et;var Tn=Vt==O,Bn=Et==O,nn=Vt==Et;if(nn&&oi(m)){if(!oi(S))return!1;ft=!0,Tn=!1}if(nn&&!Tn)return ke||(ke=new Ht),ft||wu(m)?ro(m,S,q,oe,ze,ke):vc(m,S,Vt,q,oe,ze,ke);if(!(q&s)){var An=Tn&&Qe.call(m,"__wrapped__"),gn=Bn&&Qe.call(S,"__wrapped__");if(An||gn){var Rs=An?m.value():m,ds=gn?S.value():S;return ke||(ke=new Ht),ze(Rs,ds,q,oe,ke)}}return nn?(ke||(ke=new Ht),bc(m,S,q,oe,ze,ke)):!1}function pc(m){if(!Su(m)||Ac(m))return!1;var S=Nu(m)?kn:he;return S.test(Cn(m))}function mc(m){return $r(m)&&ao(m.length)&&!!ge[Ft(m)]}function gc(m){if(!yc(m))return Jn(m);var S=[];for(var q in Object(m))Qe.call(m,q)&&q!="constructor"&&S.push(q);return S}function ro(m,S,q,oe,ze,ke){var ft=q&s,lt=m.length,Vt=S.length;if(lt!=Vt&&!(ft&&Vt>lt))return!1;var Et=ke.get(m);if(Et&&ke.get(S))return Et==S;var Tn=-1,Bn=!0,nn=q&a?new Se:void 0;for(ke.set(m,S),ke.set(S,m);++Tn<lt;){var An=m[Tn],gn=S[Tn];if(oe)var Rs=ft?oe(gn,An,Tn,S,m,ke):oe(An,gn,Tn,m,S,ke);if(Rs!==void 0){if(Rs)continue;Bn=!1;break}if(nn){if(!Be(S,function(ds,ba){if(!Ct(nn,ba)&&(An===ds||ze(An,ds,q,oe,ke)))return nn.push(ba)})){Bn=!1;break}}else if(!(An===gn||ze(An,gn,q,oe,ke))){Bn=!1;break}}return ke.delete(m),ke.delete(S),Bn}function vc(m,S,q,oe,ze,ke,ft){switch(q){case j:if(m.byteLength!=S.byteLength||m.byteOffset!=S.byteOffset)return!1;m=m.buffer,S=S.buffer;case y:return!(m.byteLength!=S.byteLength||!ke(new $t(m),new $t(S)));case h:case g:case _:return Au(+m,+S);case f:return m.name==S.name&&m.message==S.message;case M:case U:return m==S+"";case T:var lt=Gt;case J:var Vt=oe&s;if(lt||(lt=pt),m.size!=S.size&&!Vt)return!1;var Et=ft.get(m);if(Et)return Et==S;oe|=a,ft.set(m,S);var Tn=ro(lt(m),lt(S),oe,ze,ke,ft);return ft.delete(m),Tn;case G:if(un)return un.call(m)==un.call(S)}return!1}function bc(m,S,q,oe,ze,ke){var ft=q&s,lt=va(m),Vt=lt.length,Et=va(S),Tn=Et.length;if(Vt!=Tn&&!ft)return!1;for(var Bn=Vt;Bn--;){var nn=lt[Bn];if(!(ft?nn in S:Qe.call(S,nn)))return!1}var An=ke.get(m);if(An&&ke.get(S))return An==S;var gn=!0;ke.set(m,S),ke.set(S,m);for(var Rs=ft;++Bn<Vt;){nn=lt[Bn];var ds=m[nn],ba=S[nn];if(oe)var i0=ft?oe(ba,ds,nn,S,m,ke):oe(ds,ba,nn,m,S,ke);if(!(i0===void 0?ds===ba||ze(ds,ba,q,oe,ke):i0)){gn=!1;break}Rs||(Rs=nn=="constructor")}if(gn&&!Rs){var Iu=m.constructor,Cu=S.constructor;Iu!=Cu&&"constructor"in m&&"constructor"in S&&!(typeof Iu=="function"&&Iu instanceof Iu&&typeof Cu=="function"&&Cu instanceof Cu)&&(gn=!1)}return ke.delete(m),ke.delete(S),gn}function va(m){return Tt(m,io,Ec)}function Er(m,S){var q=m.__data__;return Tc(S)?q[typeof S=="string"?"string":"hash"]:q.map}function ls(m,S){var q=ut(m,S);return pc(q)?q:void 0}function cs(m){var S=Qe.call(m,In),q=m[In];try{m[In]=void 0;var oe=!0}catch{}var ze=Dt.call(m);return oe&&(S?m[In]=q:delete m[In]),ze}var Ec=Hr?function(m){return m==null?[]:(m=Object(m),Fe(Hr(m),function(S){return Mn.call(m,S)}))}:Sc,jr=Ft;(us&&jr(new us(new ArrayBuffer(1)))!=j||Ne&&jr(new Ne)!=T||Ye&&jr(Ye.resolve())!=C||Xe&&jr(new Xe)!=J||Je&&jr(new Je)!=ee)&&(jr=function(m){var S=Ft(m),q=S==O?m.constructor:void 0,oe=q?Cn(q):"";if(oe)switch(oe){case ue:return j;case _e:return T;case De:return C;case Ve:return J;case We:return ee}return S});function _c(m,S){return S=S??i,!!S&&(typeof m=="number"||Ee.test(m))&&m>-1&&m%1==0&&m<S}function Tc(m){var S=typeof m;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?m!=="__proto__":m===null}function Ac(m){return!!Mt&&Mt in m}function yc(m){var S=m&&m.constructor,q=typeof S=="function"&&S.prototype||vt;return m===q}function Tu(m){return Dt.call(m)}function Cn(m){if(m!=null){try{return nt.call(m)}catch{}try{return m+""}catch{}}return""}function Au(m,S){return m===S||m!==m&&S!==S}var yu=nr((function(){return arguments})())?nr:function(m){return $r(m)&&Qe.call(m,"callee")&&!Mn.call(m,"callee")},ii=Array.isArray;function so(m){return m!=null&&ao(m.length)&&!Nu(m)}var oi=os||wc;function Nc(m,S){return rr(m,S)}function Nu(m){if(!Su(m))return!1;var S=Ft(m);return S==p||S==v||S==d||S==H}function ao(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=i}function Su(m){var S=typeof m;return m!=null&&(S=="object"||S=="function")}function $r(m){return m!=null&&typeof m=="object"}var wu=Pe?jt(Pe):mc;function io(m){return so(m)?Bt(m):gc(m)}function Sc(){return[]}function wc(){return!1}t.exports=Nc})(Ao,Ao.exports)),Ao.exports}var $u={},Jp;function AL(){if(Jp)return $u;Jp=1,Object.defineProperty($u,"__esModule",{value:!0});const t=tb(),e=nb();var n;return(function(r){function s(l={},d={},h=!1){typeof l!="object"&&(l={}),typeof d!="object"&&(d={});let g=t(d);h||(g=Object.keys(g).reduce((f,p)=>(g[p]!=null&&(f[p]=g[p]),f),{}));for(const f in l)l[f]!==void 0&&d[f]===void 0&&(g[f]=l[f]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(l={},d={}){typeof l!="object"&&(l={}),typeof d!="object"&&(d={});const h=Object.keys(l).concat(Object.keys(d)).reduce((g,f)=>(e(l[f],d[f])||(g[f]=d[f]===void 0?null:d[f]),g),{});return Object.keys(h).length>0?h:void 0}r.diff=a;function i(l={},d={}){l=l||{};const h=Object.keys(d).reduce((g,f)=>(d[f]!==l[f]&&l[f]!==void 0&&(g[f]=d[f]),g),{});return Object.keys(l).reduce((g,f)=>(l[f]!==d[f]&&d[f]===void 0&&(g[f]=null),g),h)}r.invert=i;function o(l,d,h=!1){if(typeof l!="object")return d;if(typeof d!="object")return;if(!h)return d;const g=Object.keys(d).reduce((f,p)=>(l[p]===void 0&&(f[p]=d[p]),f),{});return Object.keys(g).length>0?g:void 0}r.transform=o})(n||(n={})),$u.default=n,$u}var Yu={},e1;function rb(){if(e1)return Yu;e1=1,Object.defineProperty(Yu,"__esModule",{value:!0});var t;return(function(e){function n(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=n})(t||(t={})),Yu.default=t,Yu}var zu={},t1;function yL(){if(t1)return zu;t1=1,Object.defineProperty(zu,"__esModule",{value:!0});const t=rb();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const a=this.offset,i=t.default.length(s);if(r>=i-a?(r=i-a,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=r:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(a,r):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,a=this.next(),i=this.ops.slice(this.index);return this.offset=r,this.index=s,[a].concat(i)}}else return[]}}return zu.default=e,zu}var n1;function NL(){return n1||(n1=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=TL(),r=tb(),s=nb(),a=AL();e.AttributeMap=a.default;const i=rb();e.Op=i.default;const o=yL();e.OpIterator=o.default;const l="\0",d=(g,f)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof f!="object"||f===null)throw new Error(`cannot retain a ${typeof f}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(f)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(f)[0]}`);return[p,g[p],f[p]]};class h{constructor(f){Array.isArray(f)?this.ops=f:f!=null&&Array.isArray(f.ops)?this.ops=f.ops:this.ops=[]}static registerEmbed(f,p){this.handlers[f]=p}static unregisterEmbed(f){delete this.handlers[f]}static getHandler(f){const p=this.handlers[f];if(!p)throw new Error(`no handlers for embed type "${f}"`);return p}insert(f,p){const v={};return typeof f=="string"&&f.length===0?this:(v.insert=f,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(v.attributes=p),this.push(v))}delete(f){return f<=0?this:this.push({delete:f})}retain(f,p){if(typeof f=="number"&&f<=0)return this;const v={retain:f};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(v.attributes=p),this.push(v)}push(f){let p=this.ops.length,v=this.ops[p-1];if(f=r(f),typeof v=="object"){if(typeof f.delete=="number"&&typeof v.delete=="number")return this.ops[p-1]={delete:v.delete+f.delete},this;if(typeof v.delete=="number"&&f.insert!=null&&(p-=1,v=this.ops[p-1],typeof v!="object"))return this.ops.unshift(f),this;if(s(f.attributes,v.attributes)){if(typeof f.insert=="string"&&typeof v.insert=="string")return this.ops[p-1]={insert:v.insert+f.insert},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this;if(typeof f.retain=="number"&&typeof v.retain=="number")return this.ops[p-1]={retain:v.retain+f.retain},typeof f.attributes=="object"&&(this.ops[p-1].attributes=f.attributes),this}}return p===this.ops.length?this.ops.push(f):this.ops.splice(p,0,f),this}chop(){const f=this.ops[this.ops.length-1];return f&&typeof f.retain=="number"&&!f.attributes&&this.ops.pop(),this}filter(f){return this.ops.filter(f)}forEach(f){this.ops.forEach(f)}map(f){return this.ops.map(f)}partition(f){const p=[],v=[];return this.forEach(T=>{(f(T)?p:v).push(T)}),[p,v]}reduce(f,p){return this.ops.reduce(f,p)}changeLength(){return this.reduce((f,p)=>p.insert?f+i.default.length(p):p.delete?f-p.delete:f,0)}length(){return this.reduce((f,p)=>f+i.default.length(p),0)}slice(f=0,p=1/0){const v=[],T=new o.default(this.ops);let _=0;for(;_<p&&T.hasNext();){let E;_<f?E=T.next(f-_):(E=T.next(p-_),v.push(E)),_+=i.default.length(E)}return new h(v)}compose(f){const p=new o.default(this.ops),v=new o.default(f.ops),T=[],_=v.peek();if(_!=null&&typeof _.retain=="number"&&_.attributes==null){let O=_.retain;for(;p.peekType()==="insert"&&p.peekLength()<=O;)O-=p.peekLength(),T.push(p.next());_.retain-O>0&&v.next(_.retain-O)}const E=new h(T);for(;p.hasNext()||v.hasNext();)if(v.peekType()==="insert")E.push(v.next());else if(p.peekType()==="delete")E.push(p.next());else{const O=Math.min(p.peekLength(),v.peekLength()),C=p.next(O),H=v.next(O);if(H.retain){const M={};if(typeof C.retain=="number")M.retain=typeof H.retain=="number"?O:H.retain;else if(typeof H.retain=="number")C.retain==null?M.insert=C.insert:M.retain=C.retain;else{const U=C.retain==null?"insert":"retain",[G,V,ee]=d(C[U],H.retain),y=h.getHandler(G);M[U]={[G]:y.compose(V,ee,U==="retain")}}const J=a.default.compose(C.attributes,H.attributes,typeof C.retain=="number");if(J&&(M.attributes=J),E.push(M),!v.hasNext()&&s(E.ops[E.ops.length-1],M)){const U=new h(p.rest());return E.concat(U).chop()}}else typeof H.delete=="number"&&(typeof C.retain=="number"||typeof C.retain=="object"&&C.retain!==null)&&E.push(H)}return E.chop()}concat(f){const p=new h(this.ops.slice());return f.ops.length>0&&(p.push(f.ops[0]),p.ops=p.ops.concat(f.ops.slice(1))),p}diff(f,p){if(this.ops===f.ops)return new h;const v=[this,f].map(C=>C.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:l;const M=C===f?"on":"with";throw new Error("diff() called "+M+" non-document")}).join("")),T=new h,_=n(v[0],v[1],p,!0),E=new o.default(this.ops),O=new o.default(f.ops);return _.forEach(C=>{let H=C[1].length;for(;H>0;){let M=0;switch(C[0]){case n.INSERT:M=Math.min(O.peekLength(),H),T.push(O.next(M));break;case n.DELETE:M=Math.min(H,E.peekLength()),E.next(M),T.delete(M);break;case n.EQUAL:M=Math.min(E.peekLength(),O.peekLength(),H);const J=E.next(M),U=O.next(M);s(J.insert,U.insert)?T.retain(M,a.default.diff(J.attributes,U.attributes)):T.push(U).delete(M);break}H-=M}}),T.chop()}eachLine(f,p=`
|
|
79
|
-
`){const v=new o.default(this.ops);let T=new
|
|
80
|
-
`),i=a.shift();i.length>0&&(n<this.length()-1||this.children.tail==null?super.insertAt(Math.min(n,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let o=this;a.reduce((l,d)=>(o=o.split(l,!0),o.insertAt(0,d),d.length),n+i.length)}insertBefore(n,r){const{head:s}=this.children;super.insertBefore(n,r),s instanceof Fr&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+
|
|
81
|
-
`),a=s.pop(),i=s.map(l=>{const d=this.scroll.create(
|
|
82
|
-
`,cr(t))}function cr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return t==null||("formats"in t&&typeof t.formats=="function"&&(e={...e,...t.formats()},n&&delete e["code-token"]),t.parent==null||t.parent.statics.blotName==="scroll"||t.parent.statics.scope!==t.statics.scope)?e:cr(t.parent,e,n)}const sr=class sr extends Zn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(sr.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,n){if(this.savedLength!==0){super.format(e,n);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Re.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=sr.CONTENTS.length,r.optimize(),r.formatAt(s,sr.CONTENTS.length,e,n),this.savedLength=0)}index(e,n){return e===this.textNode?0:super.index(e,n)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const n=this.prev instanceof kr?this.prev:null,r=n?n.length():0,s=this.next instanceof kr?this.next:null,a=s?s.text:"",{textNode:i}=this,o=i.data.split(sr.CONTENTS).join("");i.data=sr.CONTENTS;let l;if(n)l=n,(o||s)&&(n.insertAt(n.length(),o+a),s&&s.remove());else if(s)l=s,s.insertAt(0,o);else{const d=document.createTextNode(o);l=this.scroll.create(d),this.parent.insertBefore(l,this)}if(this.remove(),e){const d=(f,p)=>n&&f===n.domNode?p:f===i?r+p-1:s&&f===s.domNode?r+o.length+p:null,h=d(e.start.node,e.start.offset),g=d(e.end.node,e.end.offset);if(h!==null&&g!==null)return{startNode:l.domNode,startOffset:h,endNode:l.domNode,endOffset:g}}return null}update(e,n){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(n.range=r)}}optimize(e){super.optimize(e);let{parent:n}=this;for(;n;){if(n.domNode.tagName==="A"){this.savedLength=sr.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};ye(sr,"blotName","cursor"),ye(sr,"className","ql-cursor"),ye(sr,"tagName","span"),ye(sr,"CONTENTS","\uFEFF");let Ki=sr;var Zc={exports:{}},s1;function wL(){return s1||(s1=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(l,d,h){this.fn=l,this.context=d,this.once=h||!1}function a(l,d,h,g,f){if(typeof h!="function")throw new TypeError("The listener must be a function");var p=new s(h,g||l,f),v=n?n+d:d;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],p]:l._events[v].push(p):(l._events[v]=p,l._eventsCount++),l}function i(l,d){--l._eventsCount===0?l._events=new r:delete l._events[d]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],h,g;if(this._eventsCount===0)return d;for(g in h=this._events)e.call(h,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},o.prototype.listeners=function(d){var h=n?n+d:d,g=this._events[h];if(!g)return[];if(g.fn)return[g.fn];for(var f=0,p=g.length,v=new Array(p);f<p;f++)v[f]=g[f].fn;return v},o.prototype.listenerCount=function(d){var h=n?n+d:d,g=this._events[h];return g?g.fn?1:g.length:0},o.prototype.emit=function(d,h,g,f,p,v){var T=n?n+d:d;if(!this._events[T])return!1;var _=this._events[T],E=arguments.length,O,C;if(_.fn){switch(_.once&&this.removeListener(d,_.fn,void 0,!0),E){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,h),!0;case 3:return _.fn.call(_.context,h,g),!0;case 4:return _.fn.call(_.context,h,g,f),!0;case 5:return _.fn.call(_.context,h,g,f,p),!0;case 6:return _.fn.call(_.context,h,g,f,p,v),!0}for(C=1,O=new Array(E-1);C<E;C++)O[C-1]=arguments[C];_.fn.apply(_.context,O)}else{var H=_.length,M;for(C=0;C<H;C++)switch(_[C].once&&this.removeListener(d,_[C].fn,void 0,!0),E){case 1:_[C].fn.call(_[C].context);break;case 2:_[C].fn.call(_[C].context,h);break;case 3:_[C].fn.call(_[C].context,h,g);break;case 4:_[C].fn.call(_[C].context,h,g,f);break;default:if(!O)for(M=1,O=new Array(E-1);M<E;M++)O[M-1]=arguments[M];_[C].fn.apply(_[C].context,O)}}return!0},o.prototype.on=function(d,h,g){return a(this,d,h,g,!1)},o.prototype.once=function(d,h,g){return a(this,d,h,g,!0)},o.prototype.removeListener=function(d,h,g,f){var p=n?n+d:d;if(!this._events[p])return this;if(!h)return i(this,p),this;var v=this._events[p];if(v.fn)v.fn===h&&(!f||v.once)&&(!g||v.context===g)&&i(this,p);else{for(var T=0,_=[],E=v.length;T<E;T++)(v[T].fn!==h||f&&!v[T].once||g&&v[T].context!==g)&&_.push(v[T]);_.length?this._events[p]=_.length===1?_[0]:_:i(this,p)}return this},o.prototype.removeAllListeners=function(d){var h;return d?(h=n?n+d:d,this._events[h]&&i(this,h)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(Zc)),Zc.exports}var IL=wL();const CL=eb(IL),Cf=new WeakMap,Lf=["error","warn","log","info"];let Of="warn";function ab(t){if(Of&&Lf.indexOf(t)<=Lf.indexOf(Of)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console[t](...n)}}function Cs(t){return Lf.reduce((e,n)=>(e[n]=ab.bind(console,n,t),e),{})}Cs.level=t=>{Of=t};ab.level=Cs.level;const Jc=Cs("quill:events"),LL=["selectionchange","mousedown","mouseup","click"];LL.forEach(t=>{document.addEventListener(t,function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const a=Cf.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class Le extends CL{constructor(){super(),this.domListeners={},this.on("error",Jc.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Jc.log.call(Jc,...n),super.emit(...n)}handleDOM(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(a=>{let{node:i,handler:o}=a;(e.target===i||i.contains(e.target))&&o(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}ye(Le,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),ye(Le,"sources",{API:"api",SILENT:"silent",USER:"user"});const ed=Cs("quill:selection");class Ka{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class OL{constructor(e,n){this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Ka(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Le.sources.USER),1)}),this.emitter.on(Le.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Le.events.SCROLL_UPDATE,(s,a)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const i=a.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(i?Le.sources.SILENT:s)}catch{}})}),this.emitter.on(Le.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:o,endOffset:l}=s.range;this.setNativeRange(a,i,o,l),this.update(Le.sources.SILENT)}}),this.update(Le.sources.SILENT)}handleComposition(){this.emitter.on(Le.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Le.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Le.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,n){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Re.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof Nn){const a=s.split(r.start.offset);s.parent.insertBefore(this.cursor,a)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),n=Math.min(e+n,r-1)-e;let s,[a,i]=this.scroll.leaf(e);if(a==null)return null;if(n>0&&i===a.length()){const[h]=this.scroll.leaf(e+1);if(h){const[g]=this.scroll.line(e),[f]=this.scroll.line(e+1);g===f&&(a=h,i=0)}}[s,i]=a.position(i,!0);const o=document.createRange();if(n>0)return o.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),o.setEnd(s,i),o.getBoundingClientRect());let l="left",d;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(o.setStart(s,i),o.setEnd(s,i+1)):(o.setStart(s,i-1),o.setEnd(s,i),l="right"),d=o.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;d=a.domNode.getBoundingClientRect(),i>0&&(l="right")}return{bottom:d.top+d.height,height:d.height,left:d[l],right:d[l],top:d.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const n=e.getRangeAt(0);if(n==null)return null;const r=this.normalizeNative(n);return ed.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const n=this.getNativeRange();return n==null?[null,null]:[this.normalizedToRange(n),n]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&td(this.root,document.activeElement)}normalizedToRange(e){const n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);const r=n.map(i=>{const[o,l]=i,d=this.scroll.find(o,!0),h=d.offset(this.scroll);return l===0?h:d instanceof Nn?h+d.index(o,l):h+d.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Ka(a,s-a)}normalizeNative(e){if(!td(this.root,e.startContainer)||!e.collapsed&&!td(this.root,e.endContainer))return null;const n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(r=>{let{node:s,offset:a}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>a)s=s.childNodes[a],a=0;else if(s.childNodes.length===a)s=s.lastChild,s instanceof Text?a=s.data.length:s.childNodes.length>0?a=s.childNodes.length:a=s.childNodes.length+1;else break;r.node=s,r.offset=a}),n}rangeToNative(e){const n=this.scroll.length(),r=(s,a)=>{s=Math.min(n-1,s);const[i,o]=this.scroll.leaf(s);return i?i.position(o,a):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(ed.info("setNativeRange",e,n,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const i=document.getSelection();if(i!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||a||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(n=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const l=document.createRange();l.setStart(e,n),l.setEnd(r,s),i.removeAllRanges(),i.addRange(l)}}else i.removeAllRanges(),this.root.blur()}setRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Le.sources.API;if(typeof n=="string"&&(r=n,n=!1),ed.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,n)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Le.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!zh(n,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const i=this.cursor.restore();i&&this.setNativeRange(i.startNode,i.startOffset,i.endNode,i.endOffset)}const a=[Le.events.SELECTION_CHANGE,Si(this.lastRange),Si(n),e];this.emitter.emit(Le.events.EDITOR_CHANGE,...a),e!==Le.sources.SILENT&&this.emitter.emit(...a)}}}function td(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const xL=/^[ -~]*$/;class RL{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=a1(e),s=new xe;return kL(r.ops.slice()).reduce((i,o)=>{const l=hr.Op.length(o);let d=o.attributes||{},h=!1,g=!1;if(o.insert!=null){if(s.retain(l),typeof o.insert=="string"){const v=o.insert;g=!v.endsWith(`
|
|
83
|
-
`)&&(n<=i||!!this.scroll.descendant(
|
|
84
|
-
`&&(
|
|
73
|
+
*/const y6=Symbol("lucide-context"),N6=()=>CE(y6);var S6=b_("<svg><!><!></svg>");function un(t,e){at(e,!0);const n=N6()??{},r=Vn(e,"color",19,()=>n.color??"currentColor"),s=Vn(e,"size",19,()=>n.size??24),a=Vn(e,"strokeWidth",19,()=>n.strokeWidth??2),i=Vn(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),o=Vn(e,"iconNode",19,()=>[]),l=Jt(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),d=_e(()=>i()?Number(a())*24/Number(s()):a());var f=S6();T0(f,p=>({...T6,...p,...l,width:s(),height:s(),stroke:r(),"stroke-width":u(d),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!A6(l)&&{"aria-hidden":"true"}]);var g=N(f);wt(g,17,o,jo,(p,v)=>{var T=_e(()=>Vb(u(v),2));let _=()=>u(T)[0],E=()=>u(T)[1];var O=Kn(),C=et(O);C_(C,_,!0,(H,M)=>{T0(H,()=>({...E()}))}),F(p,O)});var h=I(g);I_(h,()=>e.children??Yf),F(t,f),it()}function Ph(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M14 17H5"}],["path",{d:"M19 7h-9"}],["circle",{cx:"17",cy:"17",r:"3"}],["circle",{cx:"7",cy:"7",r:"3"}]];un(t,on({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function w6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];un(t,on({name:"plus"},()=>n,{get iconNode(){return r}}))}function Mh(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];un(t,on({name:"x"},()=>n,{get iconNode(){return r}}))}function I6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];un(t,on({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function C6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];un(t,on({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function Av(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];un(t,on({name:"search"},()=>n,{get iconNode(){return r}}))}function L6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"}]];un(t,on({name:"house"},()=>n,{get iconNode(){return r}}))}function O6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71"}]];un(t,on({name:"link"},()=>n,{get iconNode(){return r}}))}function x6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M15 3h6v6"}],["path",{d:"M10 14 21 3"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"}]];un(t,on({name:"external-link"},()=>n,{get iconNode(){return r}}))}function ff(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"9",cy:"12",r:"1"}],["circle",{cx:"9",cy:"5",r:"1"}],["circle",{cx:"9",cy:"19",r:"1"}],["circle",{cx:"15",cy:"12",r:"1"}],["circle",{cx:"15",cy:"5",r:"1"}],["circle",{cx:"15",cy:"19",r:"1"}]];un(t,on({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function R6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 10v6"}],["path",{d:"M9 13h6"}],["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"}]];un(t,on({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}function D6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 3v12"}],["path",{d:"m17 8-5-5-5 5"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}]];un(t,on({name:"upload"},()=>n,{get iconNode(){return r}}))}function k6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 12.5 8 15l2 2.5"}],["path",{d:"m14 12.5 2 2.5-2 2.5"}]];un(t,on({name:"file-code"},()=>n,{get iconNode(){return r}}))}function Tp(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M20 6 9 17l-5-5"}]];un(t,on({name:"check"},()=>n,{get iconNode(){return r}}))}function P6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}],["circle",{cx:"9",cy:"9",r:"2"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"}]];un(t,on({name:"image"},()=>n,{get iconNode(){return r}}))}function M6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5"}],["path",{d:"M10 9H8"}],["path",{d:"M16 13H8"}],["path",{d:"M16 17H8"}]];un(t,on({name:"file-text"},()=>n,{get iconNode(){return r}}))}function B6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5"}],["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09"}],["path",{d:"M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05"}]];un(t,on({name:"rocket"},()=>n,{get iconNode(){return r}}))}function F6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20"}],["path",{d:"M2 12h20"}]];un(t,on({name:"globe"},()=>n,{get iconNode(){return r}}))}function U6(t,e){let n=Jt(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}],["path",{d:"M12 9v4"}],["path",{d:"M12 17h.01"}]];un(t,on({name:"triangle-alert"},()=>n,{get iconNode(){return r}}))}let Bh=Q(null),Fh=Q(null);function _i(){return u(Bh)}function Ap(){return u(Fh)}function H6(t,e){A(Bh,{entry:t,parent:e},!0)}function Wc(t){A(Fh,t,!0)}function Ms(){A(Bh,null),A(Fh,null)}let Gc=Q(null);const hf={get target(){return u(Gc)},request(t){A(Gc,t,!0)},clear(){A(Gc,null)}};function q6(){let t=Q("content");return{get mode(){return u(t)},set(e){A(t,e,!0)}}}const Sr=q6(),j6="nanoesis-restore:";function pf(t){return`${j6}${t}`}function $6(t,e,n){t.getItem(pf(e))===null&&t.setItem(pf(e),JSON.stringify(n))}function Y6(t,e){const n=t.getItem(pf(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function z6(){let t=Q("saved"),e=null;return{get state(){return u(t)},get canRetry(){return u(t)==="error"&&e!==null},saving(){A(t,"saving")},saved(){A(t,"saved"),e=null},failed(n){A(t,"error"),e=n},retry(){e==null||e()},reset(){A(t,"saved"),e=null}}}const Fs=z6(),W6=new Set(["title","created","published","updated"]);function G6(t){let e;try{e=JSON.parse(t===""?"[]":t)}catch{return[]}if(!Array.isArray(e))return[];const n=[];for(const r of e){if(r===null||typeof r!="object")continue;const s=r,a=typeof s.name=="string"?s.name.trim():"";if(a==="")continue;const i={name:a};typeof s.user=="string"&&s.user!==""&&(i.user=s.user),typeof s.href=="string"&&s.href!==""&&(i.href=s.href),n.push(i)}return n}function K6(t,e,n){if(t.type==="authors")return G6(n);if(t.multiple||Array.isArray(e))return n.split(",").map(r=>r.trim()).filter(r=>r.length>0);if(typeof e=="number"){const r=Number(n);return Number.isFinite(r)?r:n}return typeof e=="boolean"?n==="true":n}function V6(t){return t===""||Array.isArray(t)&&t.length===0}function yp(t,e,n,r=t.isPublished){const s={...t.fields},a={title:t.title,created:t.created,published:t.published,updated:t.updated};for(const o of e){const l=n[o.name]??"";if(W6.has(o.name)){a[o.name]=o.name==="title"?l:l||void 0;continue}const d=K6(o,t.fields[o.name],l);V6(d)?delete s[o.name]:s[o.name]=d}const i={};return t.template!==void 0&&(i.template=t.template),i.title=a.title,i.isPublished=r,a.created!==void 0&&(i.created=a.created),a.published!==void 0&&(i.published=a.published),a.updated!==void 0&&(i.updated=a.updated),i.fields=s,`${JSON.stringify(i,null,2)}
|
|
74
|
+
`}function mf(t,e,n){if(e<0||e>=t.length)return[...t];const r=[...t],s=Math.max(0,Math.min(r.length-1,n)),[a]=r.splice(e,1);return r.splice(s,0,a),r}let X6=0;var Q6=$('<li draggable="true"><span class="grip svelte-5hnbr8" aria-hidden="true"><!></span> <span class="name svelte-5hnbr8"> </span> <button type="button" class="remove svelte-5hnbr8"><!></button></li>'),Z6=$('<ul class="pills svelte-5hnbr8"></ul>'),J6=$('<li role="option"> </li>'),eS=$('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),tS=$('<div class="authors svelte-5hnbr8" role="group"><!> <div class="add svelte-5hnbr8"><input type="text" class="add-input svelte-5hnbr8" placeholder="Add an author…" autocomplete="off" role="combobox" aria-autocomplete="list"/> <!></div></div>');function nS(t,e){at(e,!0);function n(K){if(K.trim()==="")return[];try{const te=JSON.parse(K);return Array.isArray(te)?te.flatMap(fe=>{if(fe===null||typeof fe!="object")return[];const Ee=fe,ge=typeof Ee.name=="string"?Ee.name:"";return ge.trim()===""?[]:[{name:ge,...typeof Ee.user=="string"&&Ee.user!==""?{user:Ee.user}:{}}]}):[]}catch{return[]}}const r=_e(()=>n(e.value)),s=`authors-${++X6}`;let a=Q(ct([])),i=Q(""),o=Q(!1),l=Q(0),d=Q(void 0),f=Q(null),g=Q(null);Rt(()=>{bN().then(K=>A(a,K,!0))});const h=_e(()=>new Map(u(a).map(K=>[K.user,K.name]))),p=_e(()=>new Set(u(r).map(K=>K.user).filter(K=>K!==void 0)));function v(K){return K.user!==void 0?u(h).get(K.user)??K.name:K.name}const T=_e(()=>{const K=u(i).trim().toLowerCase();return K===""?[]:u(a).filter(te=>!u(p).has(te.user)&&te.name.toLowerCase().includes(K)).slice(0,6)}),_=_e(()=>u(o)&&u(i).trim()!==""),E=_e(()=>u(T).length),O=_e(()=>u(_)?u(l)<u(T).length?`${s}-opt-${u(l)}`:`${s}-guest`:void 0);function C(K){e.onchange(K.length===0?"":JSON.stringify(K))}function H(K){u(p).has(K.user)||(C([...u(r),{name:K.name,user:K.user}]),A(i,""))}function M(K){const te=K.trim();te!==""&&(C([...u(r),{name:te}]),A(i,""))}function J(){const K=u(T)[u(l)];K!==void 0?H(K):M(u(i))}function U(){var K,te;(te=(K=u(d))==null?void 0:K.children[u(l)])==null||te.scrollIntoView({block:"nearest"})}function G(K){if(!u(_)){K.key==="Enter"&&(K.preventDefault(),M(u(i)));return}const te=u(T).length+1;K.key==="ArrowDown"?(K.preventDefault(),A(l,(u(l)+1)%te),U()):K.key==="ArrowUp"?(K.preventDefault(),A(l,(u(l)-1+te)%te),U()):K.key==="Enter"?(K.preventDefault(),J()):K.key==="Escape"&&(K.preventDefault(),A(i,""))}function V(K){C(u(r).filter((te,fe)=>fe!==K))}function ee(K,te){var fe;A(f,K,!0),(fe=te.dataTransfer)==null||fe.setData("text/plain",String(K)),te.dataTransfer&&(te.dataTransfer.effectAllowed="move")}function y(K,te){u(f)!==null&&(te.preventDefault(),A(g,K,!0))}function j(K){u(f)!==null&&u(f)!==K&&C(mf(u(r),u(f),K)),A(f,null),A(g,null)}function b(){A(f,null),A(g,null)}var R=tS(),k=N(R);{var D=K=>{var te=Z6();wt(te,21,()=>u(r),jo,(fe,Ee,ge)=>{var Le=Q6();let de;var me=N(Le),Ie=N(me);ff(Ie,{size:14});var se=I(me,2),he=N(se),Ae=I(se,2),Ce=N(Ae);Mh(Ce,{size:14,"aria-hidden":"true"}),re((Me,ke)=>{de=Ke(Le,1,"pill svelte-5hnbr8",null,de,{guest:u(Ee).user===void 0,dragging:u(f)===ge,over:u(g)===ge&&u(f)!==ge}),be(se,"title",u(Ee).user??"Guest"),ae(he,Me),be(Ae,"aria-label",ke)},[()=>v(u(Ee)),()=>`Remove ${v(u(Ee))}`]),Ue("dragstart",Le,Me=>ee(ge,Me)),Ue("dragover",Le,Me=>y(ge,Me)),Ue("drop",Le,()=>j(ge)),Ue("dragend",Le,b),ie("click",Ae,()=>V(ge)),F(fe,Le)}),F(K,te)};ce(k,K=>{u(r).length>0&&K(D)})}var W=I(k,2),Y=N(W),B=I(Y,2);{var z=K=>{var te=eS(),fe=N(te);wt(fe,19,()=>u(T),de=>de.user,(de,me,Ie)=>{var se=J6();let he;var Ae=N(se);re(()=>{be(se,"id",`${s}-opt-${u(Ie)}`),he=Ke(se,1,"option svelte-5hnbr8",null,he,{active:u(Ie)===u(l)}),be(se,"aria-selected",u(Ie)===u(l)),ae(Ae,u(me).name)}),ie("click",se,()=>H(u(me))),Ue("mouseenter",se,()=>A(l,u(Ie),!0)),F(de,se)});var Ee=I(fe,2);let ge;var Le=N(Ee);mn(te,de=>A(d,de),()=>u(d)),re(de=>{be(te,"id",`${s}-listbox`),be(Ee,"id",`${s}-guest`),ge=Ke(Ee,1,"option guest-option svelte-5hnbr8",null,ge,{active:u(l)===u(E)}),be(Ee,"aria-selected",u(l)===u(E)),ae(Le,`Add “${de??""}” as a guest`)},[()=>u(i).trim()]),ie("click",Ee,()=>M(u(i))),Ue("mouseenter",Ee,()=>A(l,u(E),!0)),F(K,te)};ce(B,K=>{u(_)&&K(z)})}re(()=>{be(R,"aria-labelledby",e.labelledBy),be(Y,"aria-expanded",u(_)),be(Y,"aria-controls",`${s}-listbox`),be(Y,"aria-activedescendant",u(O))}),ie("input",Y,()=>A(l,0)),ie("keydown",Y,G),Ue("focus",Y,()=>{A(o,!0),A(l,0)}),Ue("blur",Y,()=>setTimeout(()=>A(o,!1),120)),St(Y,()=>u(i),K=>A(i,K)),F(t,R),it()}Tt(["click","input","keydown"]);var rS=$('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),sS=$('<p class="empty svelte-1nm0yno">No file selected.</p>'),aS=$('<li class="hint svelte-1nm0yno">Loading…</li>'),iS=$('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),oS=$('<li><button type="button"> </button></li>'),uS=$('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),lS=$('<p class="error svelte-1nm0yno" role="alert"> </p>'),cS=$('<div class="file-field svelte-1nm0yno" role="group"><!> <div class="actions svelte-1nm0yno"><button type="button" class="action svelte-1nm0yno"> </button> <label class="action upload svelte-1nm0yno">Upload… <input type="file" class="svelte-1nm0yno"/></label></div> <!> <!></div>');function dS(t,e){at(e,!0);let n=Q(ct([])),r=Q(!1),s=Q(!1),a=!1,i=Q(null);const o=_e(()=>e.value.split("/").pop()??e.value);async function l(){A(s,!0);try{A(n,await FN(e.itemDir),!0),a=!0}finally{A(s,!1)}}function d(){A(r,!u(r)),u(r)&&!a&&l()}function f(V){var j;const ee=V.currentTarget,y=(j=ee.files)==null?void 0:j[0];ee.value="",y&&g(y)}async function g(V){A(i,null);try{e.onchange(await Lh(e.itemDir,V)),a=!1,u(r)&&await l()}catch(ee){A(i,ee instanceof Error?ee.message:String(ee),!0)}}var h=cS(),p=N(h);{var v=V=>{var ee=rS(),y=N(ee),j=N(y),b=I(y,2);re(R=>{be(y,"href",R),ae(j,u(o))},[()=>sc(e.itemDir,e.value)]),ie("click",b,()=>e.onchange("")),F(V,ee)},T=V=>{var ee=sS();F(V,ee)};ce(p,V=>{e.value?V(v):V(T,-1)})}var _=I(p,2),E=N(_),O=N(E),C=I(E,2),H=I(N(C)),M=I(_,2);{var J=V=>{var ee=uS(),y=N(ee);{var j=k=>{var D=aS();F(k,D)},b=k=>{var D=iS();F(k,D)},R=k=>{var D=Kn(),W=et(D);wt(W,16,()=>u(n),Y=>Y,(Y,B)=>{const z=_e(()=>Wg(B));var K=oS(),te=N(K);let fe;var Ee=N(te);re(()=>{fe=Ke(te,1,"file svelte-1nm0yno",null,fe,{selected:e.value===u(z)}),be(te,"aria-pressed",e.value===u(z)),ae(Ee,B)}),ie("click",te,()=>e.onchange(u(z))),F(Y,K)}),F(k,D)};ce(y,k=>{u(s)?k(j):u(n).length===0?k(b,1):k(R,-1)})}F(V,ee)};ce(M,V=>{u(r)&&V(J)})}var U=I(M,2);{var G=V=>{var ee=lS(),y=N(ee);re(()=>ae(y,u(i))),F(V,ee)};ce(U,V=>{u(i)&&V(G)})}re(()=>{be(h,"aria-labelledby",e.labelledBy),be(E,"aria-expanded",u(r)),ae(O,u(r)?"Hide files":"Choose from files")}),ie("click",E,d),ie("change",H,f),F(t,h),it()}Tt(["click","change"]);var fS=$('<div class="preview svelte-s6anrr"><img class="preview-img svelte-s6anrr" alt=""/> <div class="preview-meta svelte-s6anrr"><span class="filename svelte-s6anrr"> </span> <div class="row svelte-s6anrr"><label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label> <button type="button" class="link svelte-s6anrr">Remove</button></div></div></div>'),hS=$('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),pS=$('<p class="error svelte-s6anrr" role="alert"> </p>'),mS=$('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function gS(t,e){at(e,!0);let n=Q(!1),r=Q(null),s=Q("");Rt(()=>{const p=e.value;if(p===""){A(s,"");return}if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(p)){A(s,p,!0);return}let v=null,T=!1;return YN(e.itemDir,p).then(_=>{if(T){URL.revokeObjectURL(_);return}v=_,A(s,_,!0)}).catch(()=>{T||A(s,"")}),()=>{T=!0,v!==null&&URL.revokeObjectURL(v)}});function a(p){var _;const v=p.currentTarget,T=(_=v.files)==null?void 0:_[0];v.value="",T&&i(T)}async function i(p){A(r,null),A(n,!0);try{e.onchange(await Lh(e.itemDir,p))}catch(v){A(r,v instanceof Error?v.message:String(v),!0)}finally{A(n,!1)}}var o=mS(),l=N(o);{var d=p=>{var v=fS(),T=N(v),_=I(T,2),E=N(_),O=N(E),C=I(E,2),H=N(C);let M;var J=N(H),U=I(J),G=I(H,2);re(()=>{be(T,"src",u(s)),ae(O,e.value),M=Ke(H,1,"action svelte-s6anrr",null,M,{busy:u(n)}),ae(J,`${u(n)?"Uploading…":"Replace…"} `),U.disabled=u(n)}),ie("change",U,a),ie("click",G,()=>e.onchange("")),F(p,v)},f=p=>{var v=hS();let T;var _=N(v),E=I(_);re(()=>{T=Ke(v,1,"action svelte-s6anrr",null,T,{busy:u(n)}),ae(_,`${u(n)?"Uploading…":"Upload image…"} `),E.disabled=u(n)}),ie("change",E,a),F(p,v)};ce(l,p=>{e.value?p(d):p(f,-1)})}var g=I(l,2);{var h=p=>{var v=pS(),T=N(v);re(()=>ae(T,u(r))),F(p,v)};ce(g,p=>{u(r)&&p(h)})}re(()=>be(o,"aria-labelledby",e.labelledBy)),F(t,o),it()}Tt(["change","click"]);var vS=$("<option> </option>"),bS=$("<option>Top level</option>"),ES=$("<option> </option>"),_S=$('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Move</h3> <div class="manage svelte-wge2ya"><label class="grow svelte-wge2ya"><span class="visually-hidden svelte-wge2ya">Move to folder</span> <select class="svelte-wge2ya"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-wge2ya">Move</button></div></div>'),TS=$('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),AS=$('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),yS=$(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
|
|
75
|
+
heading at the top of the form.</p>`),NS=$('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),SS=$('<dialog aria-label="Edit item" class="svelte-wge2ya"><form><h2 class="svelte-wge2ya">Edit item</h2> <label class="svelte-wge2ya"><span class="svelte-wge2ya">Template</span> <select class="svelte-wge2ya"></select> <span class="help svelte-wge2ya">Switching keeps any field values the new template doesn’t use.</span></label> <!> <!> <div class="actions svelte-wge2ya"><button type="button" class="ghost svelte-wge2ya">Cancel</button> <button type="submit" class="primary svelte-wge2ya">Save</button></div></form></dialog>');function wS(t,e){at(e,!0);const n=Vn(e,"currentFolder",3,""),r=Vn(e,"folders",19,()=>[]);let s,a=Q(ct(e.templateName));const i="\0";let o=Q(i);const l=_e(()=>r().filter(M=>M!==n())),d=_e(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);Qa(()=>s.showModal());function f(M){M.preventDefault(),u(a)!==e.templateName?e.onchangetemplate(u(a)):e.onclose()}var g=SS(),h=N(g),p=I(N(h),2),v=I(N(p),2);wt(v,20,()=>u(d),M=>M,(M,J)=>{var U=vS(),G=N(U),V={};re(()=>{ae(G,J),V!==(V=J)&&(U.value=(U.__value=J)??"")}),F(M,U)});var T=I(p,2);{var _=M=>{var J=_S(),U=I(N(J),2),G=N(U),V=I(N(G),2),ee=N(V);ee.value=ee.__value=i;var y=I(ee);{var j=k=>{var D=bS();D.value=D.__value="",F(k,D)};ce(y,k=>{n()!==""&&k(j)})}var b=I(y);wt(b,16,()=>u(l),k=>k,(k,D)=>{var W=ES(),Y=N(W),B={};re(()=>{ae(Y,`${D??""}/`),B!==(B=D)&&(W.value=(W.__value=D)??"")}),F(k,W)});var R=I(G,2);re(()=>R.disabled=u(o)===i),$a(V,()=>u(o),k=>A(o,k)),ie("click",R,()=>e.onmove(u(o))),F(M,J)};ce(T,M=>{e.onmove&&M(_)})}var E=I(T,2);{var O=M=>{var J=NS(),U=I(N(J),2),G=N(U);{var V=R=>{var k=TS();ie("click",k,function(...D){var W;(W=e.onrename)==null||W.apply(this,D)}),F(R,k)};ce(G,R=>{e.onrename&&R(V)})}var ee=I(G,2);{var y=R=>{var k=AS();ie("click",k,function(...D){var W;(W=e.ondelete)==null||W.apply(this,D)}),F(R,k)};ce(ee,R=>{e.ondelete&&R(y)})}var j=I(U,2);{var b=R=>{var k=yS();F(R,k)};ce(j,R=>{e.onrename&&R(b)})}F(M,J)};ce(E,M=>{(e.onrename||e.ondelete)&&M(O)})}var C=I(E,2),H=N(C);mn(g,M=>s=M,()=>s),Ue("close",g,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),Ue("cancel",g,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),Ue("submit",h,f),$a(v,()=>u(a),M=>A(a,M)),ie("click",H,function(...M){var J;(J=e.onclose)==null||J.apply(this,M)}),F(t,g),it()}Tt(["click"]);let Po=Q(null);const IS={get pending(){return u(Po)}};function yv(t=""){return new Promise(e=>{A(Po,{current:t,resolve:e},!0)})}function li(t){u(Po)!==null&&(u(Po).resolve(t),A(Po,null))}const Uh="ref:";function Go(t){return t.startsWith(Uh)}function gf(t){return Go(t)?t.slice(Uh.length):t}function CS(t){return`${Uh}${t}`}var LS=$('<!> <span class="target svelte-147ryxk"> </span>',1),OS=$('<!> <span class="target svelte-147ryxk"> </span>',1),xS=$('<span class="value svelte-147ryxk"><!></span> <button type="button" class="action svelte-147ryxk">Edit</button> <button type="button" class="action svelte-147ryxk">Clear</button>',1),RS=$('<button type="button" class="action svelte-147ryxk">Set link…</button>'),DS=$('<div class="link-field svelte-147ryxk" role="group"><!></div>');function kS(t,e){at(e,!0);async function n(){const o=await yv(e.value);o!==null&&e.onchange(o)}var r=DS(),s=N(r);{var a=o=>{var l=xS(),d=et(l),f=N(d);{var g=_=>{var E=LS(),O=et(E);O6(O,{size:14,"aria-hidden":"true"});var C=I(O,2),H=N(C);re((M,J)=>{be(C,"title",M),ae(H,J)},[()=>`Page: ${gf(e.value)}`,()=>gf(e.value)]),F(_,E)},h=_e(()=>Go(e.value)),p=_=>{var E=OS(),O=et(E);x6(O,{size:14,"aria-hidden":"true"});var C=I(O,2),H=N(C);re(()=>{be(C,"title",e.value),ae(H,e.value)}),F(_,E)};ce(f,_=>{u(h)?_(g):_(p,-1)})}var v=I(d,2),T=I(v,2);ie("click",v,n),ie("click",T,()=>e.onchange("")),F(o,l)},i=o=>{var l=RS();ie("click",l,n),F(o,l)};ce(s,o=>{e.value?o(a):o(i,-1)})}re(()=>be(r,"aria-labelledby",e.labelledBy)),F(t,r),it()}Tt(["click"]);var PS=$('<p class="note error svelte-1v8pkea"> </p>'),MS=$('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),BS=$('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),FS=$('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),US=$('<section class="preview svelte-1v8pkea" aria-label="Preview"><header class="bar svelte-1v8pkea"><strong class="title svelte-1v8pkea">Preview</strong> <span class="dims svelte-1v8pkea" title="Current preview width"> </span> <button type="button" class="close svelte-1v8pkea" title="Close preview" aria-label="Close preview"><!></button></header> <div class="frame svelte-1v8pkea"><!></div></section>');function HS(t,e){at(e,!0);let n=Q(""),r=Q("loading"),s=Q(""),a=Q(0),i=Q(void 0),o={x:0,y:0};function l(){var U;try{const G=(U=u(i))==null?void 0:U.contentWindow;G&&(o={x:G.scrollX,y:G.scrollY})}catch{}}function d(){var U,G;try{(G=(U=u(i))==null?void 0:U.contentWindow)==null||G.scrollTo(o.x,o.y)}catch{}}let f;Rt(()=>{const U=e.previewItem,G=e.path;if(clearTimeout(f),U===null){A(r,"loading");return}return f=setTimeout(()=>void g(G,U),350),()=>clearTimeout(f)});async function g(U,G){try{const V=await s6(U,G);if(V===void 0){A(r,"empty");return}l(),A(n,V,!0),A(r,"ready")}catch(V){A(s,V instanceof Error?V.message:String(V),!0),A(r,"error")}}var h=US(),p=N(h),v=I(N(p),2),T=N(v),_=I(v,2),E=N(_);Mh(E,{size:18,"aria-hidden":"true"});var O=I(p,2),C=N(O);{var H=U=>{var G=PS(),V=N(G);re(()=>ae(V,`Couldn’t render preview: ${u(s)??""}`)),F(U,G)},M=U=>{var G=MS();F(U,G)},J=U=>{var G=FS(),V=et(G);mn(V,j=>A(i,j),()=>u(i));var ee=I(V,2);{var y=j=>{var b=BS();F(j,b)};ce(ee,j=>{u(r)==="loading"&&j(y)})}re(()=>be(V,"srcdoc",u(n))),Ue("load",V,d),F(U,G)};ce(C,U=>{u(r)==="error"?U(H):u(r)==="empty"?U(M,1):U(J,-1)})}re(U=>ae(T,`${U??""}px`),[()=>Math.round(u(a))]),ie("click",_,function(...U){var G;(G=e.onclose)==null||G.apply(this,U)}),Y_(O,"clientWidth",U=>A(a,U)),F(t,h),it()}Tt(["click"]);var Nv=typeof global=="object"&&global&&global.Object===Object&&global,qS=typeof self=="object"&&self&&self.Object===Object&&self,is=Nv||qS||Function("return this")(),ta=is.Symbol,Sv=Object.prototype,jS=Sv.hasOwnProperty,$S=Sv.toString,mo=ta?ta.toStringTag:void 0;function YS(t){var e=jS.call(t,mo),n=t[mo];try{t[mo]=void 0;var r=!0}catch{}var s=$S.call(t);return r&&(e?t[mo]=n:delete t[mo]),s}var zS=Object.prototype,WS=zS.toString;function GS(t){return WS.call(t)}var KS="[object Null]",VS="[object Undefined]",Np=ta?ta.toStringTag:void 0;function no(t){return t==null?t===void 0?VS:KS:Np&&Np in Object(t)?YS(t):GS(t)}function Ss(t){return t!=null&&typeof t=="object"}var Wa=Array.isArray;function ia(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function wv(t){return t}var XS="[object AsyncFunction]",QS="[object Function]",ZS="[object GeneratorFunction]",JS="[object Proxy]";function Hh(t){if(!ia(t))return!1;var e=no(t);return e==QS||e==ZS||e==XS||e==JS}var Kc=is["__core-js_shared__"],Sp=(function(){var t=/[^.]+$/.exec(Kc&&Kc.keys&&Kc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function ew(t){return!!Sp&&Sp in t}var tw=Function.prototype,nw=tw.toString;function ei(t){if(t!=null){try{return nw.call(t)}catch{}try{return t+""}catch{}}return""}var rw=/[\\^$.*+?()[\]{}|]/g,sw=/^\[object .+?Constructor\]$/,aw=Function.prototype,iw=Object.prototype,ow=aw.toString,uw=iw.hasOwnProperty,lw=RegExp("^"+ow.call(uw).replace(rw,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function cw(t){if(!ia(t)||ew(t))return!1;var e=Hh(t)?lw:sw;return e.test(ei(t))}function dw(t,e){return t==null?void 0:t[e]}function ti(t,e){var n=dw(t,e);return cw(n)?n:void 0}var vf=ti(is,"WeakMap"),wp=Object.create,fw=(function(){function t(){}return function(e){if(!ia(e))return{};if(wp)return wp(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function hw(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function pw(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var mw=800,gw=16,vw=Date.now;function bw(t){var e=0,n=0;return function(){var r=vw(),s=gw-(r-n);if(n=r,s>0){if(++e>=mw)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function Ew(t){return function(){return t}}var Rl=(function(){try{var t=ti(Object,"defineProperty");return t({},"",{}),t}catch{}})(),_w=Rl?function(t,e){return Rl(t,"toString",{configurable:!0,enumerable:!1,value:Ew(e),writable:!0})}:wv,Tw=bw(_w);function Aw(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var yw=9007199254740991,Nw=/^(?:0|[1-9]\d*)$/;function Iv(t,e){var n=typeof t;return e=e??yw,!!e&&(n=="number"||n!="symbol"&&Nw.test(t))&&t>-1&&t%1==0&&t<e}function qh(t,e,n){e=="__proto__"&&Rl?Rl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function gu(t,e){return t===e||t!==t&&e!==e}var Sw=Object.prototype,ww=Sw.hasOwnProperty;function Cv(t,e,n){var r=t[e];(!(ww.call(t,e)&&gu(r,n))||n===void 0&&!(e in t))&&qh(t,e,n)}function Iw(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var o=e[a],l=void 0;l===void 0&&(l=t[o]),s?qh(n,o,l):Cv(n,o,l)}return n}var Ip=Math.max;function Cw(t,e,n){return e=Ip(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=Ip(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var o=Array(e+1);++s<e;)o[s]=r[s];return o[e]=n(i),hw(t,this,o)}}function Lw(t,e){return Tw(Cw(t,e,wv),t+"")}var Ow=9007199254740991;function Lv(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Ow}function ic(t){return t!=null&&Lv(t.length)&&!Hh(t)}function xw(t,e,n){if(!ia(n))return!1;var r=typeof e;return(r=="number"?ic(n)&&Iv(e,n.length):r=="string"&&e in n)?gu(n[e],t):!1}function Rw(t){return Lw(function(e,n){var r=-1,s=n.length,a=s>1?n[s-1]:void 0,i=s>2?n[2]:void 0;for(a=t.length>3&&typeof a=="function"?(s--,a):void 0,i&&xw(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var o=n[r];o&&t(e,o,r,a)}return e})}var Dw=Object.prototype;function jh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||Dw;return t===n}function kw(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var Pw="[object Arguments]";function Cp(t){return Ss(t)&&no(t)==Pw}var Ov=Object.prototype,Mw=Ov.hasOwnProperty,Bw=Ov.propertyIsEnumerable,bf=Cp((function(){return arguments})())?Cp:function(t){return Ss(t)&&Mw.call(t,"callee")&&!Bw.call(t,"callee")};function Fw(){return!1}var xv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Lp=xv&&typeof module=="object"&&module&&!module.nodeType&&module,Uw=Lp&&Lp.exports===xv,Op=Uw?is.Buffer:void 0,Hw=Op?Op.isBuffer:void 0,Ko=Hw||Fw,qw="[object Arguments]",jw="[object Array]",$w="[object Boolean]",Yw="[object Date]",zw="[object Error]",Ww="[object Function]",Gw="[object Map]",Kw="[object Number]",Vw="[object Object]",Xw="[object RegExp]",Qw="[object Set]",Zw="[object String]",Jw="[object WeakMap]",eI="[object ArrayBuffer]",tI="[object DataView]",nI="[object Float32Array]",rI="[object Float64Array]",sI="[object Int8Array]",aI="[object Int16Array]",iI="[object Int32Array]",oI="[object Uint8Array]",uI="[object Uint8ClampedArray]",lI="[object Uint16Array]",cI="[object Uint32Array]",kt={};kt[nI]=kt[rI]=kt[sI]=kt[aI]=kt[iI]=kt[oI]=kt[uI]=kt[lI]=kt[cI]=!0;kt[qw]=kt[jw]=kt[eI]=kt[$w]=kt[tI]=kt[Yw]=kt[zw]=kt[Ww]=kt[Gw]=kt[Kw]=kt[Vw]=kt[Xw]=kt[Qw]=kt[Zw]=kt[Jw]=!1;function dI(t){return Ss(t)&&Lv(t.length)&&!!kt[no(t)]}function $h(t){return function(e){return t(e)}}var Rv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Mo=Rv&&typeof module=="object"&&module&&!module.nodeType&&module,fI=Mo&&Mo.exports===Rv,Vc=fI&&Nv.process,Wi=(function(){try{var t=Mo&&Mo.require&&Mo.require("util").types;return t||Vc&&Vc.binding&&Vc.binding("util")}catch{}})(),xp=Wi&&Wi.isTypedArray,Yh=xp?$h(xp):dI,hI=Object.prototype,pI=hI.hasOwnProperty;function Dv(t,e){var n=Wa(t),r=!n&&bf(t),s=!n&&!r&&Ko(t),a=!n&&!r&&!s&&Yh(t),i=n||r||s||a,o=i?kw(t.length,String):[],l=o.length;for(var d in t)(e||pI.call(t,d))&&!(i&&(d=="length"||s&&(d=="offset"||d=="parent")||a&&(d=="buffer"||d=="byteLength"||d=="byteOffset")||Iv(d,l)))&&o.push(d);return o}function kv(t,e){return function(n){return t(e(n))}}var mI=kv(Object.keys,Object),gI=Object.prototype,vI=gI.hasOwnProperty;function bI(t){if(!jh(t))return mI(t);var e=[];for(var n in Object(t))vI.call(t,n)&&n!="constructor"&&e.push(n);return e}function EI(t){return ic(t)?Dv(t):bI(t)}function _I(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var TI=Object.prototype,AI=TI.hasOwnProperty;function yI(t){if(!ia(t))return _I(t);var e=jh(t),n=[];for(var r in t)r=="constructor"&&(e||!AI.call(t,r))||n.push(r);return n}function Pv(t){return ic(t)?Dv(t,!0):yI(t)}var Vo=ti(Object,"create");function NI(){this.__data__=Vo?Vo(null):{},this.size=0}function SI(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var wI="__lodash_hash_undefined__",II=Object.prototype,CI=II.hasOwnProperty;function LI(t){var e=this.__data__;if(Vo){var n=e[t];return n===wI?void 0:n}return CI.call(e,t)?e[t]:void 0}var OI=Object.prototype,xI=OI.hasOwnProperty;function RI(t){var e=this.__data__;return Vo?e[t]!==void 0:xI.call(e,t)}var DI="__lodash_hash_undefined__";function kI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=Vo&&e===void 0?DI:e,this}function Ga(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Ga.prototype.clear=NI;Ga.prototype.delete=SI;Ga.prototype.get=LI;Ga.prototype.has=RI;Ga.prototype.set=kI;function PI(){this.__data__=[],this.size=0}function oc(t,e){for(var n=t.length;n--;)if(gu(t[n][0],e))return n;return-1}var MI=Array.prototype,BI=MI.splice;function FI(t){var e=this.__data__,n=oc(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():BI.call(e,n,1),--this.size,!0}function UI(t){var e=this.__data__,n=oc(e,t);return n<0?void 0:e[n][1]}function HI(t){return oc(this.__data__,t)>-1}function qI(t,e){var n=this.__data__,r=oc(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function Cs(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}Cs.prototype.clear=PI;Cs.prototype.delete=FI;Cs.prototype.get=UI;Cs.prototype.has=HI;Cs.prototype.set=qI;var Xo=ti(is,"Map");function jI(){this.size=0,this.__data__={hash:new Ga,map:new(Xo||Cs),string:new Ga}}function $I(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function uc(t,e){var n=t.__data__;return $I(e)?n[typeof e=="string"?"string":"hash"]:n.map}function YI(t){var e=uc(this,t).delete(t);return this.size-=e?1:0,e}function zI(t){return uc(this,t).get(t)}function WI(t){return uc(this,t).has(t)}function GI(t,e){var n=uc(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function ni(t){var e=-1,n=t==null?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}ni.prototype.clear=jI;ni.prototype.delete=YI;ni.prototype.get=zI;ni.prototype.has=WI;ni.prototype.set=GI;function KI(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var Mv=kv(Object.getPrototypeOf,Object),VI="[object Object]",XI=Function.prototype,QI=Object.prototype,Bv=XI.toString,ZI=QI.hasOwnProperty,JI=Bv.call(Object);function eC(t){if(!Ss(t)||no(t)!=VI)return!1;var e=Mv(t);if(e===null)return!0;var n=ZI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&Bv.call(n)==JI}function tC(){this.__data__=new Cs,this.size=0}function nC(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function rC(t){return this.__data__.get(t)}function sC(t){return this.__data__.has(t)}var aC=200;function iC(t,e){var n=this.__data__;if(n instanceof Cs){var r=n.__data__;if(!Xo||r.length<aC-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new ni(r)}return n.set(t,e),this.size=n.size,this}function Jr(t){var e=this.__data__=new Cs(t);this.size=e.size}Jr.prototype.clear=tC;Jr.prototype.delete=nC;Jr.prototype.get=rC;Jr.prototype.has=sC;Jr.prototype.set=iC;var Fv=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Rp=Fv&&typeof module=="object"&&module&&!module.nodeType&&module,oC=Rp&&Rp.exports===Fv,Dp=oC?is.Buffer:void 0,kp=Dp?Dp.allocUnsafe:void 0;function Uv(t,e){if(e)return t.slice();var n=t.length,r=kp?kp(n):new t.constructor(n);return t.copy(r),r}function uC(t,e){for(var n=-1,r=t==null?0:t.length,s=0,a=[];++n<r;){var i=t[n];e(i,n,t)&&(a[s++]=i)}return a}function lC(){return[]}var cC=Object.prototype,dC=cC.propertyIsEnumerable,Pp=Object.getOwnPropertySymbols,fC=Pp?function(t){return t==null?[]:(t=Object(t),uC(Pp(t),function(e){return dC.call(t,e)}))}:lC;function hC(t,e,n){var r=e(t);return Wa(t)?r:KI(r,n(t))}function Ef(t){return hC(t,EI,fC)}var _f=ti(is,"DataView"),Tf=ti(is,"Promise"),Af=ti(is,"Set"),Mp="[object Map]",pC="[object Object]",Bp="[object Promise]",Fp="[object Set]",Up="[object WeakMap]",Hp="[object DataView]",mC=ei(_f),gC=ei(Xo),vC=ei(Tf),bC=ei(Af),EC=ei(vf),wr=no;(_f&&wr(new _f(new ArrayBuffer(1)))!=Hp||Xo&&wr(new Xo)!=Mp||Tf&&wr(Tf.resolve())!=Bp||Af&&wr(new Af)!=Fp||vf&&wr(new vf)!=Up)&&(wr=function(t){var e=no(t),n=e==pC?t.constructor:void 0,r=n?ei(n):"";if(r)switch(r){case mC:return Hp;case gC:return Mp;case vC:return Bp;case bC:return Fp;case EC:return Up}return e});var _C=Object.prototype,TC=_C.hasOwnProperty;function AC(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&TC.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var Dl=is.Uint8Array;function zh(t){var e=new t.constructor(t.byteLength);return new Dl(e).set(new Dl(t)),e}function yC(t,e){var n=zh(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var NC=/\w*$/;function SC(t){var e=new t.constructor(t.source,NC.exec(t));return e.lastIndex=t.lastIndex,e}var qp=ta?ta.prototype:void 0,jp=qp?qp.valueOf:void 0;function wC(t){return jp?Object(jp.call(t)):{}}function Hv(t,e){var n=e?zh(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var IC="[object Boolean]",CC="[object Date]",LC="[object Map]",OC="[object Number]",xC="[object RegExp]",RC="[object Set]",DC="[object String]",kC="[object Symbol]",PC="[object ArrayBuffer]",MC="[object DataView]",BC="[object Float32Array]",FC="[object Float64Array]",UC="[object Int8Array]",HC="[object Int16Array]",qC="[object Int32Array]",jC="[object Uint8Array]",$C="[object Uint8ClampedArray]",YC="[object Uint16Array]",zC="[object Uint32Array]";function WC(t,e,n){var r=t.constructor;switch(e){case PC:return zh(t);case IC:case CC:return new r(+t);case MC:return yC(t);case BC:case FC:case UC:case HC:case qC:case jC:case $C:case YC:case zC:return Hv(t,n);case LC:return new r;case OC:case DC:return new r(t);case xC:return SC(t);case RC:return new r;case kC:return wC(t)}}function qv(t){return typeof t.constructor=="function"&&!jh(t)?fw(Mv(t)):{}}var GC="[object Map]";function KC(t){return Ss(t)&&wr(t)==GC}var $p=Wi&&Wi.isMap,VC=$p?$h($p):KC,XC="[object Set]";function QC(t){return Ss(t)&&wr(t)==XC}var Yp=Wi&&Wi.isSet,ZC=Yp?$h(Yp):QC,JC=1,jv="[object Arguments]",e4="[object Array]",t4="[object Boolean]",n4="[object Date]",r4="[object Error]",$v="[object Function]",s4="[object GeneratorFunction]",a4="[object Map]",i4="[object Number]",Yv="[object Object]",o4="[object RegExp]",u4="[object Set]",l4="[object String]",c4="[object Symbol]",d4="[object WeakMap]",f4="[object ArrayBuffer]",h4="[object DataView]",p4="[object Float32Array]",m4="[object Float64Array]",g4="[object Int8Array]",v4="[object Int16Array]",b4="[object Int32Array]",E4="[object Uint8Array]",_4="[object Uint8ClampedArray]",T4="[object Uint16Array]",A4="[object Uint32Array]",Ot={};Ot[jv]=Ot[e4]=Ot[f4]=Ot[h4]=Ot[t4]=Ot[n4]=Ot[p4]=Ot[m4]=Ot[g4]=Ot[v4]=Ot[b4]=Ot[a4]=Ot[i4]=Ot[Yv]=Ot[o4]=Ot[u4]=Ot[l4]=Ot[c4]=Ot[E4]=Ot[_4]=Ot[T4]=Ot[A4]=!0;Ot[r4]=Ot[$v]=Ot[d4]=!1;function cl(t,e,n,r,s,a){var i,o=e&JC;if(i!==void 0)return i;if(!ia(t))return t;var l=Wa(t);if(l)i=AC(t);else{var d=wr(t),f=d==$v||d==s4;if(Ko(t))return Uv(t,o);if(d==Yv||d==jv||f&&!s)i=f?{}:qv(t);else{if(!Ot[d])return s?t:{};i=WC(t,d,o)}}a||(a=new Jr);var g=a.get(t);if(g)return g;a.set(t,i),ZC(t)?t.forEach(function(v){i.add(cl(v,e,n,v,t,a))}):VC(t)&&t.forEach(function(v,T){i.set(T,cl(v,e,n,T,t,a))});var h=Ef,p=l?void 0:h(t);return Aw(p||t,function(v,T){p&&(T=v,v=t[T]),Cv(i,T,cl(v,e,n,T,t,a))}),i}var y4=1,N4=4;function Si(t){return cl(t,y4|N4)}var S4="__lodash_hash_undefined__";function w4(t){return this.__data__.set(t,S4),this}function I4(t){return this.__data__.has(t)}function kl(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new ni;++e<n;)this.add(t[e])}kl.prototype.add=kl.prototype.push=w4;kl.prototype.has=I4;function C4(t,e){for(var n=-1,r=t==null?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}function L4(t,e){return t.has(e)}var O4=1,x4=2;function zv(t,e,n,r,s,a){var i=n&O4,o=t.length,l=e.length;if(o!=l&&!(i&&l>o))return!1;var d=a.get(t),f=a.get(e);if(d&&f)return d==e&&f==t;var g=-1,h=!0,p=n&x4?new kl:void 0;for(a.set(t,e),a.set(e,t);++g<o;){var v=t[g],T=e[g];if(r)var _=i?r(T,v,g,e,t,a):r(v,T,g,t,e,a);if(_!==void 0){if(_)continue;h=!1;break}if(p){if(!C4(e,function(E,O){if(!L4(p,O)&&(v===E||s(v,E,n,r,a)))return p.push(O)})){h=!1;break}}else if(!(v===T||s(v,T,n,r,a))){h=!1;break}}return a.delete(t),a.delete(e),h}function R4(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function D4(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var k4=1,P4=2,M4="[object Boolean]",B4="[object Date]",F4="[object Error]",U4="[object Map]",H4="[object Number]",q4="[object RegExp]",j4="[object Set]",$4="[object String]",Y4="[object Symbol]",z4="[object ArrayBuffer]",W4="[object DataView]",zp=ta?ta.prototype:void 0,Xc=zp?zp.valueOf:void 0;function G4(t,e,n,r,s,a,i){switch(n){case W4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case z4:return!(t.byteLength!=e.byteLength||!a(new Dl(t),new Dl(e)));case M4:case B4:case H4:return gu(+t,+e);case F4:return t.name==e.name&&t.message==e.message;case q4:case $4:return t==e+"";case U4:var o=R4;case j4:var l=r&k4;if(o||(o=D4),t.size!=e.size&&!l)return!1;var d=i.get(t);if(d)return d==e;r|=P4,i.set(t,e);var f=zv(o(t),o(e),r,s,a,i);return i.delete(t),f;case Y4:if(Xc)return Xc.call(t)==Xc.call(e)}return!1}var K4=1,V4=Object.prototype,X4=V4.hasOwnProperty;function Q4(t,e,n,r,s,a){var i=n&K4,o=Ef(t),l=o.length,d=Ef(e),f=d.length;if(l!=f&&!i)return!1;for(var g=l;g--;){var h=o[g];if(!(i?h in e:X4.call(e,h)))return!1}var p=a.get(t),v=a.get(e);if(p&&v)return p==e&&v==t;var T=!0;a.set(t,e),a.set(e,t);for(var _=i;++g<l;){h=o[g];var E=t[h],O=e[h];if(r)var C=i?r(O,E,h,e,t,a):r(E,O,h,t,e,a);if(!(C===void 0?E===O||s(E,O,n,r,a):C)){T=!1;break}_||(_=h=="constructor")}if(T&&!_){var H=t.constructor,M=e.constructor;H!=M&&"constructor"in t&&"constructor"in e&&!(typeof H=="function"&&H instanceof H&&typeof M=="function"&&M instanceof M)&&(T=!1)}return a.delete(t),a.delete(e),T}var Z4=1,Wp="[object Arguments]",Gp="[object Array]",qu="[object Object]",J4=Object.prototype,Kp=J4.hasOwnProperty;function eL(t,e,n,r,s,a){var i=Wa(t),o=Wa(e),l=i?Gp:wr(t),d=o?Gp:wr(e);l=l==Wp?qu:l,d=d==Wp?qu:d;var f=l==qu,g=d==qu,h=l==d;if(h&&Ko(t)){if(!Ko(e))return!1;i=!0,f=!1}if(h&&!f)return a||(a=new Jr),i||Yh(t)?zv(t,e,n,r,s,a):G4(t,e,l,n,r,s,a);if(!(n&Z4)){var p=f&&Kp.call(t,"__wrapped__"),v=g&&Kp.call(e,"__wrapped__");if(p||v){var T=p?t.value():t,_=v?e.value():e;return a||(a=new Jr),s(T,_,n,r,a)}}return h?(a||(a=new Jr),Q4(t,e,n,r,s,a)):!1}function Wv(t,e,n,r,s){return t===e?!0:t==null||e==null||!Ss(t)&&!Ss(e)?t!==t&&e!==e:eL(t,e,n,r,Wv,s)}function tL(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),o=i.length;o--;){var l=i[++s];if(n(a[l],l,a)===!1)break}return e}}var nL=tL();function yf(t,e,n){(n!==void 0&&!gu(t[e],n)||n===void 0&&!(e in t))&&qh(t,e,n)}function rL(t){return Ss(t)&&ic(t)}function Nf(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function sL(t){return Iw(t,Pv(t))}function aL(t,e,n,r,s,a,i){var o=Nf(t,n),l=Nf(e,n),d=i.get(l);if(d){yf(t,n,d);return}var f=a?a(o,l,n+"",t,e,i):void 0,g=f===void 0;if(g){var h=Wa(l),p=!h&&Ko(l),v=!h&&!p&&Yh(l);f=l,h||p||v?Wa(o)?f=o:rL(o)?f=pw(o):p?(g=!1,f=Uv(l,!0)):v?(g=!1,f=Hv(l,!0)):f=[]:eC(l)||bf(l)?(f=o,bf(o)?f=sL(o):(!ia(o)||Hh(o))&&(f=qv(l))):g=!1}g&&(i.set(l,f),s(f,l,r,a,i),i.delete(l)),yf(t,n,f)}function Gv(t,e,n,r,s){t!==e&&nL(e,function(a,i){if(s||(s=new Jr),ia(a))aL(t,e,i,n,Gv,r,s);else{var o=r?r(Nf(t,i),a,i+"",t,e,s):void 0;o===void 0&&(o=a),yf(t,i,o)}},Pv)}function Wh(t,e){return Wv(t,e)}var Js=Rw(function(t,e,n){Gv(t,e,n)}),Re=(t=>(t[t.TYPE=3]="TYPE",t[t.LEVEL=12]="LEVEL",t[t.ATTRIBUTE=13]="ATTRIBUTE",t[t.BLOT=14]="BLOT",t[t.INLINE=7]="INLINE",t[t.BLOCK=11]="BLOCK",t[t.BLOCK_BLOT=10]="BLOCK_BLOT",t[t.INLINE_BLOT=6]="INLINE_BLOT",t[t.BLOCK_ATTRIBUTE=9]="BLOCK_ATTRIBUTE",t[t.INLINE_ATTRIBUTE=5]="INLINE_ATTRIBUTE",t[t.ANY=15]="ANY",t))(Re||{});class ss{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=Re.TYPE&Re.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Re.LEVEL|s:Re.ATTRIBUTE,r.whitelist!=null&&(this.whitelist=r.whitelist)}static keys(e){return Array.from(e.attributes).map(n=>n.name)}add(e,n){return this.canAdd(e,n)?(e.setAttribute(this.keyName,n),!0):!1}canAdd(e,n){return this.whitelist==null?!0:typeof n=="string"?this.whitelist.indexOf(n.replace(/["']/g,""))>-1:this.whitelist.indexOf(n)>-1}remove(e){e.removeAttribute(this.keyName)}value(e){const n=e.getAttribute(this.keyName);return this.canAdd(e,n)&&n?n:""}}class wi extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Kv=class Sf{constructor(){this.attributes={},this.classes={},this.tags={},this.types={}}static find(e,n=!1){if(e==null)return null;if(this.blots.has(e))return this.blots.get(e)||null;if(n){let r=null;try{r=e.parentNode}catch{return null}return this.find(r,n)}return null}create(e,n,r){const s=this.query(n);if(s==null)throw new wi(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),o=new a(e,i,r);return Sf.blots.set(o.domNode,o),o}find(e,n=!1){return Sf.find(e,n)}query(e,n=Re.ANY){let r;return typeof e=="string"?r=this.types[e]||this.attributes[e]:e instanceof Text||e.nodeType===Node.TEXT_NODE?r=this.types.text:typeof e=="number"?e&Re.LEVEL&Re.BLOCK?r=this.types.block:e&Re.LEVEL&Re.INLINE&&(r=this.types.inline):e instanceof Element&&((e.getAttribute("class")||"").split(/\s+/).some(s=>(r=this.classes[s],!!r)),r=r||this.tags[e.tagName]),r==null?null:"scope"in r&&n&Re.LEVEL&r.scope&&n&Re.TYPE&r.scope?r:null}register(...e){return e.map(n=>{const r="blotName"in n,s="attrName"in n;if(!r&&!s)throw new wi("Invalid definition");if(r&&n.blotName==="abstract")throw new wi("Cannot register abstract class");const a=r?n.blotName:s?n.attrName:void 0;return this.types[a]=n,s?typeof n.keyName=="string"&&(this.attributes[n.keyName]=n):r&&(n.className&&(this.classes[n.className]=n),n.tagName&&(Array.isArray(n.tagName)?n.tagName=n.tagName.map(i=>i.toUpperCase()):n.tagName=n.tagName.toUpperCase(),(Array.isArray(n.tagName)?n.tagName:[n.tagName]).forEach(i=>{(this.tags[i]==null||n.className==null)&&(this.tags[i]=n)}))),n})}};Kv.blots=new WeakMap;let Gi=Kv;function Vp(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class iL extends ss{static keys(e){return(e.getAttribute("class")||"").split(/\s+/).map(n=>n.split("-").slice(0,-1).join("-"))}add(e,n){return this.canAdd(e,n)?(this.remove(e),e.classList.add(`${this.keyName}-${n}`),!0):!1}remove(e){Vp(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(Vp(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const Br=iL;function Qc(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class oL extends ss{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[Qc(this.keyName)]=n,!0):!1}remove(e){e.style[Qc(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[Qc(this.keyName)];return this.canAdd(e,n)?n:""}}const oa=oL;class uL{constructor(e){this.attributes={},this.domNode=e,this.build()}attribute(e,n){n?e.add(this.domNode,n)&&(e.value(this.domNode)!=null?this.attributes[e.attrName]=e:delete this.attributes[e.attrName]):(e.remove(this.domNode),delete this.attributes[e.attrName])}build(){this.attributes={};const e=Gi.find(this.domNode);if(e==null)return;const n=ss.keys(this.domNode),r=Br.keys(this.domNode),s=oa.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,Re.ATTRIBUTE);i instanceof ss&&(this.attributes[i.attrName]=i)})}copy(e){Object.keys(this.attributes).forEach(n=>{const r=this.attributes[n].value(this.domNode);e.format(n,r)})}move(e){this.copy(e),Object.keys(this.attributes).forEach(n=>{this.attributes[n].remove(this.domNode)}),this.attributes={}}values(){return Object.keys(this.attributes).reduce((e,n)=>(e[n]=this.attributes[n].value(this.domNode),e),{})}}const lc=uL,Vv=class{constructor(e,n){this.scroll=e,this.domNode=n,Gi.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new wi("Blot definition missing tagName");let n,r;return Array.isArray(this.tagName)?(typeof e=="string"?(r=e.toUpperCase(),parseInt(r,10).toString()===r&&(r=parseInt(r,10))):typeof e=="number"&&(r=e),typeof r=="number"?n=document.createElement(this.tagName[r-1]):r&&this.tagName.indexOf(r)>-1?n=document.createElement(r):n=document.createElement(this.tagName[0])):n=document.createElement(this.tagName),this.className&&n.classList.add(this.className),n}get statics(){return this.constructor}attach(){}clone(){const e=this.domNode.cloneNode(!1);return this.scroll.create(e)}detach(){this.parent!=null&&this.parent.removeChild(this),Gi.blots.delete(this.domNode)}deleteAt(e,n){this.isolate(e,n).remove()}formatAt(e,n,r,s){const a=this.isolate(e,n);if(this.scroll.query(r,Re.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Re.ATTRIBUTE)!=null){const i=this.scroll.create(this.statics.scope);a.wrap(i),i.format(r,s)}}insertAt(e,n,r){const s=r==null?this.scroll.create("text",n):this.scroll.create(n,r),a=this.split(e);this.parent.insertBefore(s,a||void 0)}isolate(e,n){const r=this.split(e);if(r==null)throw new Error("Attempt to isolate at end");return r.split(n),r}length(){return 1}offset(e=this.parent){return this.parent==null||this===e?0:this.parent.children.offset(this)+this.parent.offset(e)}optimize(e){this.statics.requiredContainer&&!(this.parent instanceof this.statics.requiredContainer)&&this.wrap(this.statics.requiredContainer.blotName)}remove(){this.domNode.parentNode!=null&&this.domNode.parentNode.removeChild(this.domNode),this.detach()}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return this.parent!=null&&(this.parent.insertBefore(r,this.next||void 0),this.remove()),r}split(e,n){return e===0?this:this.next}update(e,n){}wrap(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;if(this.parent!=null&&this.parent.insertBefore(r,this.next||void 0),typeof r.appendChild!="function")throw new wi(`Cannot wrap ${e}`);return r.appendChild(this),r}};Vv.blotName="abstract";let Xv=Vv;const Qv=class extends Xv{static value(e){return!0}index(e,n){return this.domNode===e||this.domNode.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_CONTAINED_BY?Math.min(n,1):-1}position(e,n){let r=Array.from(this.parent.domNode.childNodes).indexOf(this.domNode);return e>0&&(r+=1),[this.parent.domNode,r]}value(){return{[this.statics.blotName]:this.statics.value(this.domNode)||!0}}};Qv.scope=Re.INLINE_BLOT;let lL=Qv;const In=lL;class cL{constructor(){this.head=null,this.tail=null,this.length=0}append(...e){if(this.insertBefore(e[0],null),e.length>1){const n=e.slice(1);this.append(...n)}}at(e){const n=this.iterator();let r=n();for(;r&&e>0;)e-=1,r=n();return r}contains(e){const n=this.iterator();let r=n();for(;r;){if(r===e)return!0;r=n()}return!1}indexOf(e){const n=this.iterator();let r=n(),s=0;for(;r;){if(r===e)return s;s+=1,r=n()}return-1}insertBefore(e,n){e!=null&&(this.remove(e),e.next=n,n!=null?(e.prev=n.prev,n.prev!=null&&(n.prev.next=e),n.prev=e,n===this.head&&(this.head=e)):this.tail!=null?(this.tail.next=e,e.prev=this.tail,this.tail=e):(e.prev=null,this.head=this.tail=e),this.length+=1)}offset(e){let n=0,r=this.head;for(;r!=null;){if(r===e)return n;n+=r.length(),r=r.next}return-1}remove(e){this.contains(e)&&(e.prev!=null&&(e.prev.next=e.next),e.next!=null&&(e.next.prev=e.prev),e===this.head&&(this.head=e.next),e===this.tail&&(this.tail=e.prev),this.length-=1)}iterator(e=this.head){return()=>{const n=e;return e!=null&&(e=e.next),n}}find(e,n=!1){const r=this.iterator();let s=r();for(;s;){const a=s.length();if(e<a||n&&e===a&&(s.next==null||s.next.length()!==0))return[s,e];e-=a,s=r()}return[null,0]}forEach(e){const n=this.iterator();let r=n();for(;r;)e(r),r=n()}forEachAt(e,n,r){if(n<=0)return;const[s,a]=this.find(e);let i=e-a;const o=this.iterator(s);let l=o();for(;l&&i<e+n;){const d=l.length();e>i?r(l,e-i,Math.min(n,i+d-e)):r(l,0,Math.min(d,e+n-i)),i+=d,l=o()}}map(e){return this.reduce((n,r)=>(n.push(e(r)),n),[])}reduce(e,n){const r=this.iterator();let s=r();for(;s;)n=e(n,s),s=r();return n}}function Xp(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(Re.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const Zv=class Bs extends Xv{constructor(e,n){super(e,n),this.uiNode=null,this.build()}appendChild(e){this.insertBefore(e)}attach(){super.attach(),this.children.forEach(e=>{e.attach()})}attachUI(e){this.uiNode!=null&&this.uiNode.remove(),this.uiNode=e,Bs.uiClass&&this.uiNode.classList.add(Bs.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new cL,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=Xp(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof wi)return;throw n}})}deleteAt(e,n){if(e===0&&n===this.length())return this.remove();this.children.forEachAt(e,n,(r,s,a)=>{r.deleteAt(s,a)})}descendant(e,n=0){const[r,s]=this.children.find(n);return e.blotName==null&&e(r)||e.blotName!=null&&r instanceof e?[r,s]:r instanceof Bs?r.descendant(e,s):[null,-1]}descendants(e,n=0,r=Number.MAX_VALUE){let s=[],a=r;return this.children.forEachAt(n,r,(i,o,l)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof Bs&&(s=s.concat(i.descendants(e,o,a))),a-=l}),s}detach(){this.children.forEach(e=>{e.detach()}),super.detach()}enforceAllowedChildren(){let e=!1;this.children.forEach(n=>{e||this.statics.allowedChildren.some(r=>n instanceof r)||(n.statics.scope===Re.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof Bs?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,o)=>{a.formatAt(i,o,r,s)})}insertAt(e,n,r){const[s,a]=this.children.find(e);if(s)s.insertAt(a,n,r);else{const i=r==null?this.scroll.create("text",n):this.scroll.create(n,r);this.appendChild(i)}}insertBefore(e,n){e.parent!=null&&e.parent.children.remove(e);let r=null;this.children.insertBefore(e,n||null),e.parent=this,n!=null&&(r=n.domNode),(this.domNode.parentNode!==e.domNode||this.domNode.nextSibling!==r)&&this.domNode.insertBefore(e.domNode,r),e.attach()}length(){return this.children.reduce((e,n)=>e+n.length(),0)}moveChildren(e,n){this.children.forEach(r=>{e.insertBefore(r,n)})}optimize(e){if(super.optimize(e),this.enforceAllowedChildren(),this.uiNode!=null&&this.uiNode!==this.domNode.firstChild&&this.domNode.insertBefore(this.uiNode,this.domNode.firstChild),this.children.length===0)if(this.statics.defaultChild!=null){const n=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(n)}else this.remove()}path(e,n=!1){const[r,s]=this.children.find(e,n),a=[[this,e]];return r instanceof Bs?a.concat(r.path(s,n)):(r!=null&&a.push([r,s]),a)}removeChild(e){this.children.remove(e)}replaceWith(e,n){const r=typeof e=="string"?this.scroll.create(e,n):e;return r instanceof Bs&&this.moveChildren(r),super.replaceWith(r)}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.clone();return this.parent&&this.parent.insertBefore(r,this.next||void 0),this.children.forEachAt(e,this.length(),(s,a,i)=>{const o=s.split(a,n);o!=null&&r.appendChild(o)}),r}splitAfter(e){const n=this.clone();for(;e.next!=null;)n.appendChild(e.next);return this.parent&&this.parent.insertBefore(n,this.next||void 0),n}unwrap(){this.parent&&this.moveChildren(this.parent,this.next||void 0),this.remove()}update(e,n){const r=[],s=[];e.forEach(a=>{a.target===this.domNode&&a.type==="childList"&&(r.push(...a.addedNodes),s.push(...a.removedNodes))}),s.forEach(a=>{if(a.parentNode!=null&&a.tagName!=="IFRAME"&&document.body.compareDocumentPosition(a)&Node.DOCUMENT_POSITION_CONTAINED_BY)return;const i=this.scroll.find(a);i!=null&&(i.domNode.parentNode==null||i.domNode.parentNode===this.domNode)&&i.detach()}),r.filter(a=>a.parentNode===this.domNode&&a!==this.uiNode).sort((a,i)=>a===i?0:a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_FOLLOWING?1:-1).forEach(a=>{let i=null;a.nextSibling!=null&&(i=this.scroll.find(a.nextSibling));const o=Xp(a,this.scroll);(o.next!==i||o.next==null)&&(o.parent!=null&&o.parent.removeChild(this),this.insertBefore(o,i||void 0))}),this.enforceAllowedChildren()}};Zv.uiClass="";let dL=Zv;const Rr=dL;function fL(t,e){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}const fi=class hi extends Rr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(hi.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new lc(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof hi||(r=r.wrap(hi.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Re.INLINE);if(r==null)return;r instanceof ss?this.attributes.attribute(r,n):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n)}}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.formats()[r]!=null||this.scroll.query(r,Re.ATTRIBUTE)?this.isolate(e,n).format(r,s):super.formatAt(e,n,r,s)}optimize(e){super.optimize(e);const n=this.formats();if(Object.keys(n).length===0)return this.unwrap();const r=this.next;r instanceof hi&&r.prev===this&&fL(n,r.formats())&&(r.moveChildren(this),r.remove())}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}wrap(e,n){const r=super.wrap(e,n);return r instanceof hi&&this.attributes.move(r),r}};fi.allowedChildren=[fi,In],fi.blotName="inline",fi.scope=Re.INLINE_BLOT,fi.tagName="SPAN";let hL=fi;const Gh=hL,pi=class wf extends Rr{static create(e){return super.create(e)}static formats(e,n){const r=n.query(wf.blotName);if(!(r!=null&&e.tagName===r.tagName)){if(typeof this.tagName=="string")return!0;if(Array.isArray(this.tagName))return e.tagName.toLowerCase()}}constructor(e,n){super(e,n),this.attributes=new lc(this.domNode)}format(e,n){const r=this.scroll.query(e,Re.BLOCK);r!=null&&(r instanceof ss?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(wf.blotName):n&&(e!==this.statics.blotName||this.formats()[e]!==n)&&this.replaceWith(e,n))}formats(){const e=this.attributes.values(),n=this.statics.formats(this.domNode,this.scroll);return n!=null&&(e[this.statics.blotName]=n),e}formatAt(e,n,r,s){this.scroll.query(r,Re.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,Re.INLINE)!=null)super.insertAt(e,n,r);else{const s=this.split(e);if(s!=null){const a=this.scroll.create(n,r);s.parent.insertBefore(a,s)}else throw new Error("Attempt to insertAt after block boundaries")}}replaceWith(e,n){const r=super.replaceWith(e,n);return this.attributes.copy(r),r}update(e,n){super.update(e,n),e.some(r=>r.target===this.domNode&&r.type==="attributes")&&this.attributes.build()}};pi.blotName="block",pi.scope=Re.BLOCK_BLOT,pi.tagName="P",pi.allowedChildren=[Gh,pi,In];let pL=pi;const Qo=pL,If=class extends Rr{checkMerge(){return this.next!==null&&this.next.statics.blotName===this.statics.blotName}deleteAt(e,n){super.deleteAt(e,n),this.enforceAllowedChildren()}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.enforceAllowedChildren()}insertAt(e,n,r){super.insertAt(e,n,r),this.enforceAllowedChildren()}optimize(e){super.optimize(e),this.children.length>0&&this.next!=null&&this.checkMerge()&&(this.next.moveChildren(this),this.next.remove())}};If.blotName="container",If.scope=Re.BLOCK_BLOT;let mL=If;const cc=mL;class gL extends In{static formats(e,n){}format(e,n){super.formatAt(0,this.length(),e,n)}formatAt(e,n,r,s){e===0&&n===this.length()?this.format(r,s):super.formatAt(e,n,r,s)}formats(){return this.statics.formats(this.domNode,this.scroll)}}const Qn=gL,vL={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},bL=100,mi=class extends Rr{constructor(e,n){super(null,n),this.registry=e,this.scroll=this,this.build(),this.observer=new MutationObserver(r=>{this.update(r)}),this.observer.observe(this.domNode,vL),this.attach()}create(e,n){return this.registry.create(this,e,n)}find(e,n=!1){const r=this.registry.find(e,n);return r?r.scroll===this?r:n?this.find(r.scroll.domNode.parentNode,!0):null:null}query(e,n=Re.ANY){return this.registry.query(e,n)}register(...e){return this.registry.register(...e)}build(){this.scroll!=null&&super.build()}detach(){super.detach(),this.observer.disconnect()}deleteAt(e,n){this.update(),e===0&&n===this.length()?this.children.forEach(r=>{r.remove()}):super.deleteAt(e,n)}formatAt(e,n,r,s){this.update(),super.formatAt(e,n,r,s)}insertAt(e,n,r){this.update(),super.insertAt(e,n,r)}optimize(e=[],n={}){super.optimize(n);const r=n.mutationsMap||new WeakMap;let s=Array.from(this.observer.takeRecords());for(;s.length>0;)e.push(s.pop());const a=(l,d=!0)=>{l==null||l===this||l.domNode.parentNode!=null&&(r.has(l.domNode)||r.set(l.domNode,[]),d&&a(l.parent))},i=l=>{r.has(l.domNode)&&(l instanceof Rr&&l.children.forEach(i),r.delete(l.domNode),l.optimize(n))};let o=e;for(let l=0;o.length>0;l+=1){if(l>=bL)throw new Error("[Parchment] Maximum optimize iterations reached");for(o.forEach(d=>{const f=this.find(d.target,!0);f!=null&&(f.domNode===d.target&&(d.type==="childList"?(a(this.find(d.previousSibling,!1)),Array.from(d.addedNodes).forEach(g=>{const h=this.find(g,!1);a(h,!1),h instanceof Rr&&h.children.forEach(p=>{a(p,!1)})})):d.type==="attributes"&&a(f.prev)),a(f))}),this.children.forEach(i),o=Array.from(this.observer.takeRecords()),s=o.slice();s.length>0;)e.push(s.pop())}}update(e,n={}){e=e||this.observer.takeRecords();const r=new WeakMap;e.map(s=>{const a=this.find(s.target,!0);return a==null?null:r.has(a.domNode)?(r.get(a.domNode).push(s),null):(r.set(a.domNode,[s]),a)}).forEach(s=>{s!=null&&s!==this&&r.has(s.domNode)&&s.update(r.get(s.domNode)||[],n)}),n.mutationsMap=r,r.has(this.domNode)&&super.update(r.get(this.domNode),n),this.optimize(e,n)}};mi.blotName="scroll",mi.defaultChild=Qo,mi.allowedChildren=[Qo,cc],mi.scope=Re.BLOCK_BLOT,mi.tagName="DIV";let EL=mi;const Kh=EL,Cf=class Jv extends In{static create(e){return document.createTextNode(e)}static value(e){return e.data}constructor(e,n){super(e,n),this.text=this.statics.value(this.domNode)}deleteAt(e,n){this.domNode.data=this.text=this.text.slice(0,e)+this.text.slice(e+n)}index(e,n){return this.domNode===e?n:-1}insertAt(e,n,r){r==null?(this.text=this.text.slice(0,e)+n+this.text.slice(e),this.domNode.data=this.text):super.insertAt(e,n,r)}length(){return this.text.length}optimize(e){super.optimize(e),this.text=this.statics.value(this.domNode),this.text.length===0?this.remove():this.next instanceof Jv&&this.next.prev===this&&(this.insertAt(this.length(),this.next.value()),this.next.remove())}position(e,n=!1){return[this.domNode,e]}split(e,n=!1){if(!n){if(e===0)return this;if(e===this.length())return this.next}const r=this.scroll.create(this.domNode.splitText(e));return this.parent.insertBefore(r,this.next||void 0),this.text=this.statics.value(this.domNode),r}update(e,n){e.some(r=>r.type==="characterData"&&r.target===this.domNode)&&(this.text=this.statics.value(this.domNode))}value(){return this.text}};Cf.blotName="text",Cf.scope=Re.INLINE_BLOT;let _L=Cf;const Pl=_L,TL=Object.freeze(Object.defineProperty({__proto__:null,Attributor:ss,AttributorStore:lc,BlockBlot:Qo,ClassAttributor:Br,ContainerBlot:cc,EmbedBlot:Qn,InlineBlot:Gh,LeafBlot:In,ParentBlot:Rr,Registry:Gi,Scope:Re,ScrollBlot:Kh,StyleAttributor:oa,TextBlot:Pl},Symbol.toStringTag,{value:"Module"}));var Ws=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function eb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var ju={exports:{}},Zc,Qp;function AL(){if(Qp)return Zc;Qp=1;var t=-1,e=1,n=0;function r(y,j,b,R,k){if(y===j)return y?[[n,y]]:[];if(b!=null){var D=V(y,j,b);if(D)return D}var W=o(y,j),Y=y.substring(0,W);y=y.substring(W),j=j.substring(W),W=d(y,j);var B=y.substring(y.length-W);y=y.substring(0,y.length-W),j=j.substring(0,j.length-W);var z=s(y,j);return Y&&z.unshift([n,Y]),B&&z.push([n,B]),O(z,k),R&&g(z),z}function s(y,j){var b;if(!y)return[[e,j]];if(!j)return[[t,y]];var R=y.length>j.length?y:j,k=y.length>j.length?j:y,D=R.indexOf(k);if(D!==-1)return b=[[e,R.substring(0,D)],[n,k],[e,R.substring(D+k.length)]],y.length>j.length&&(b[0][0]=b[2][0]=t),b;if(k.length===1)return[[t,y],[e,j]];var W=f(y,j);if(W){var Y=W[0],B=W[1],z=W[2],K=W[3],te=W[4],fe=r(Y,z),Ee=r(B,K);return fe.concat([[n,te]],Ee)}return a(y,j)}function a(y,j){for(var b=y.length,R=j.length,k=Math.ceil((b+R)/2),D=k,W=2*k,Y=new Array(W),B=new Array(W),z=0;z<W;z++)Y[z]=-1,B[z]=-1;Y[D+1]=0,B[D+1]=0;for(var K=b-R,te=K%2!==0,fe=0,Ee=0,ge=0,Le=0,de=0;de<k;de++){for(var me=-de+fe;me<=de-Ee;me+=2){var Ie=D+me,se;me===-de||me!==de&&Y[Ie-1]<Y[Ie+1]?se=Y[Ie+1]:se=Y[Ie-1]+1;for(var he=se-me;se<b&&he<R&&y.charAt(se)===j.charAt(he);)se++,he++;if(Y[Ie]=se,se>b)Ee+=2;else if(he>R)fe+=2;else if(te){var Ae=D+K-me;if(Ae>=0&&Ae<W&&B[Ae]!==-1){var Ce=b-B[Ae];if(se>=Ce)return i(y,j,se,he)}}}for(var Me=-de+ge;Me<=de-Le;Me+=2){var Ae=D+Me,Ce;Me===-de||Me!==de&&B[Ae-1]<B[Ae+1]?Ce=B[Ae+1]:Ce=B[Ae-1]+1;for(var ke=Ce-Me;Ce<b&&ke<R&&y.charAt(b-Ce-1)===j.charAt(R-ke-1);)Ce++,ke++;if(B[Ae]=Ce,Ce>b)Le+=2;else if(ke>R)ge+=2;else if(!te){var Ie=D+K-Me;if(Ie>=0&&Ie<W&&Y[Ie]!==-1){var se=Y[Ie],he=D+se-Ie;if(Ce=b-Ce,se>=Ce)return i(y,j,se,he)}}}}return[[t,y],[e,j]]}function i(y,j,b,R){var k=y.substring(0,b),D=j.substring(0,R),W=y.substring(b),Y=j.substring(R),B=r(k,D),z=r(W,Y);return B.concat(z)}function o(y,j){if(!y||!j||y.charAt(0)!==j.charAt(0))return 0;for(var b=0,R=Math.min(y.length,j.length),k=R,D=0;b<k;)y.substring(D,k)==j.substring(D,k)?(b=k,D=b):R=k,k=Math.floor((R-b)/2+b);return C(y.charCodeAt(k-1))&&k--,k}function l(y,j){var b=y.length,R=j.length;if(b==0||R==0)return 0;b>R?y=y.substring(b-R):b<R&&(j=j.substring(0,b));var k=Math.min(b,R);if(y==j)return k;for(var D=0,W=1;;){var Y=y.substring(k-W),B=j.indexOf(Y);if(B==-1)return D;W+=B,(B==0||y.substring(k-W)==j.substring(0,W))&&(D=W,W++)}}function d(y,j){if(!y||!j||y.slice(-1)!==j.slice(-1))return 0;for(var b=0,R=Math.min(y.length,j.length),k=R,D=0;b<k;)y.substring(y.length-k,y.length-D)==j.substring(j.length-k,j.length-D)?(b=k,D=b):R=k,k=Math.floor((R-b)/2+b);return H(y.charCodeAt(y.length-k))&&k--,k}function f(y,j){var b=y.length>j.length?y:j,R=y.length>j.length?j:y;if(b.length<4||R.length*2<b.length)return null;function k(Ee,ge,Le){for(var de=Ee.substring(Le,Le+Math.floor(Ee.length/4)),me=-1,Ie="",se,he,Ae,Ce;(me=ge.indexOf(de,me+1))!==-1;){var Me=o(Ee.substring(Le),ge.substring(me)),ke=d(Ee.substring(0,Le),ge.substring(0,me));Ie.length<ke+Me&&(Ie=ge.substring(me-ke,me)+ge.substring(me,me+Me),se=Ee.substring(0,Le-ke),he=Ee.substring(Le+Me),Ae=ge.substring(0,me-ke),Ce=ge.substring(me+Me))}return Ie.length*2>=Ee.length?[se,he,Ae,Ce,Ie]:null}var D=k(b,R,Math.ceil(b.length/4)),W=k(b,R,Math.ceil(b.length/2)),Y;if(!D&&!W)return null;W?D?Y=D[4].length>W[4].length?D:W:Y=W:Y=D;var B,z,K,te;y.length>j.length?(B=Y[0],z=Y[1],K=Y[2],te=Y[3]):(K=Y[0],te=Y[1],B=Y[2],z=Y[3]);var fe=Y[4];return[B,z,K,te,fe]}function g(y){for(var j=!1,b=[],R=0,k=null,D=0,W=0,Y=0,B=0,z=0;D<y.length;)y[D][0]==n?(b[R++]=D,W=B,Y=z,B=0,z=0,k=y[D][1]):(y[D][0]==e?B+=y[D][1].length:z+=y[D][1].length,k&&k.length<=Math.max(W,Y)&&k.length<=Math.max(B,z)&&(y.splice(b[R-1],0,[t,k]),y[b[R-1]+1][0]=e,R--,R--,D=R>0?b[R-1]:-1,W=0,Y=0,B=0,z=0,k=null,j=!0)),D++;for(j&&O(y),E(y),D=1;D<y.length;){if(y[D-1][0]==t&&y[D][0]==e){var K=y[D-1][1],te=y[D][1],fe=l(K,te),Ee=l(te,K);fe>=Ee?(fe>=K.length/2||fe>=te.length/2)&&(y.splice(D,0,[n,te.substring(0,fe)]),y[D-1][1]=K.substring(0,K.length-fe),y[D+1][1]=te.substring(fe),D++):(Ee>=K.length/2||Ee>=te.length/2)&&(y.splice(D,0,[n,K.substring(0,Ee)]),y[D-1][0]=e,y[D-1][1]=te.substring(0,te.length-Ee),y[D+1][0]=t,y[D+1][1]=K.substring(Ee),D++),D++}D++}}var h=/[^a-zA-Z0-9]/,p=/\s/,v=/[\r\n]/,T=/\n\r?\n$/,_=/^\r?\n\r?\n/;function E(y){function j(Ee,ge){if(!Ee||!ge)return 6;var Le=Ee.charAt(Ee.length-1),de=ge.charAt(0),me=Le.match(h),Ie=de.match(h),se=me&&Le.match(p),he=Ie&&de.match(p),Ae=se&&Le.match(v),Ce=he&&de.match(v),Me=Ae&&Ee.match(T),ke=Ce&&ge.match(_);return Me||ke?5:Ae||Ce?4:me&&!se&&he?3:se||he?2:me||Ie?1:0}for(var b=1;b<y.length-1;){if(y[b-1][0]==n&&y[b+1][0]==n){var R=y[b-1][1],k=y[b][1],D=y[b+1][1],W=d(R,k);if(W){var Y=k.substring(k.length-W);R=R.substring(0,R.length-W),k=Y+k.substring(0,k.length-W),D=Y+D}for(var B=R,z=k,K=D,te=j(R,k)+j(k,D);k.charAt(0)===D.charAt(0);){R+=k.charAt(0),k=k.substring(1)+D.charAt(0),D=D.substring(1);var fe=j(R,k)+j(k,D);fe>=te&&(te=fe,B=R,z=k,K=D)}y[b-1][1]!=B&&(B?y[b-1][1]=B:(y.splice(b-1,1),b--),y[b][1]=z,K?y[b+1][1]=K:(y.splice(b+1,1),b--))}b++}}function O(y,j){y.push([n,""]);for(var b=0,R=0,k=0,D="",W="",Y;b<y.length;){if(b<y.length-1&&!y[b][1]){y.splice(b,1);continue}switch(y[b][0]){case e:k++,W+=y[b][1],b++;break;case t:R++,D+=y[b][1],b++;break;case n:var B=b-k-R-1;if(j){if(B>=0&&J(y[B][1])){var z=y[B][1].slice(-1);if(y[B][1]=y[B][1].slice(0,-1),D=z+D,W=z+W,!y[B][1]){y.splice(B,1),b--;var K=B-1;y[K]&&y[K][0]===e&&(k++,W=y[K][1]+W,K--),y[K]&&y[K][0]===t&&(R++,D=y[K][1]+D,K--),B=K}}if(M(y[b][1])){var z=y[b][1].charAt(0);y[b][1]=y[b][1].slice(1),D+=z,W+=z}}if(b<y.length-1&&!y[b][1]){y.splice(b,1);break}if(D.length>0||W.length>0){D.length>0&&W.length>0&&(Y=o(W,D),Y!==0&&(B>=0?y[B][1]+=W.substring(0,Y):(y.splice(0,0,[n,W.substring(0,Y)]),b++),W=W.substring(Y),D=D.substring(Y)),Y=d(W,D),Y!==0&&(y[b][1]=W.substring(W.length-Y)+y[b][1],W=W.substring(0,W.length-Y),D=D.substring(0,D.length-Y)));var te=k+R;D.length===0&&W.length===0?(y.splice(b-te,te),b=b-te):D.length===0?(y.splice(b-te,te,[e,W]),b=b-te+1):W.length===0?(y.splice(b-te,te,[t,D]),b=b-te+1):(y.splice(b-te,te,[t,D],[e,W]),b=b-te+2)}b!==0&&y[b-1][0]===n?(y[b-1][1]+=y[b][1],y.splice(b,1)):b++,k=0,R=0,D="",W="";break}}y[y.length-1][1]===""&&y.pop();var fe=!1;for(b=1;b<y.length-1;)y[b-1][0]===n&&y[b+1][0]===n&&(y[b][1].substring(y[b][1].length-y[b-1][1].length)===y[b-1][1]?(y[b][1]=y[b-1][1]+y[b][1].substring(0,y[b][1].length-y[b-1][1].length),y[b+1][1]=y[b-1][1]+y[b+1][1],y.splice(b-1,1),fe=!0):y[b][1].substring(0,y[b+1][1].length)==y[b+1][1]&&(y[b-1][1]+=y[b+1][1],y[b][1]=y[b][1].substring(y[b+1][1].length)+y[b+1][1],y.splice(b+1,1),fe=!0)),b++;fe&&O(y,j)}function C(y){return y>=55296&&y<=56319}function H(y){return y>=56320&&y<=57343}function M(y){return H(y.charCodeAt(0))}function J(y){return C(y.charCodeAt(y.length-1))}function U(y){for(var j=[],b=0;b<y.length;b++)y[b][1].length>0&&j.push(y[b]);return j}function G(y,j,b,R){return J(y)||M(R)?null:U([[n,y],[t,j],[e,b],[n,R]])}function V(y,j,b){var R=typeof b=="number"?{index:b,length:0}:b.oldRange,k=typeof b=="number"?null:b.newRange,D=y.length,W=j.length;if(R.length===0&&(k===null||k.length===0)){var Y=R.index,B=y.slice(0,Y),z=y.slice(Y),K=k?k.index:null;e:{var te=Y+W-D;if(K!==null&&K!==te||te<0||te>W)break e;var fe=j.slice(0,te),Ee=j.slice(te);if(Ee!==z)break e;var ge=Math.min(Y,te),Le=B.slice(0,ge),de=fe.slice(0,ge);if(Le!==de)break e;var me=B.slice(ge),Ie=fe.slice(ge);return G(Le,me,Ie,z)}e:{if(K!==null&&K!==Y)break e;var se=Y,fe=j.slice(0,se),Ee=j.slice(se);if(fe!==B)break e;var he=Math.min(D-se,W-se),Ae=z.slice(z.length-he),Ce=Ee.slice(Ee.length-he);if(Ae!==Ce)break e;var me=z.slice(0,z.length-he),Ie=Ee.slice(0,Ee.length-he);return G(B,me,Ie,Ae)}}if(R.length>0&&k&&k.length===0)e:{var Le=y.slice(0,R.index),Ae=y.slice(R.index+R.length),ge=Le.length,he=Ae.length;if(W<ge+he)break e;var de=j.slice(0,ge),Ce=j.slice(W-he);if(Le!==de||Ae!==Ce)break e;var me=y.slice(ge,D-he),Ie=j.slice(ge,W-he);return G(Le,me,Ie,Ae)}return null}function ee(y,j,b,R){return r(y,j,b,R,!0)}return ee.INSERT=e,ee.DELETE=t,ee.EQUAL=n,Zc=ee,Zc}var To={exports:{}};To.exports;var Zp;function tb(){return Zp||(Zp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",o="[object Boolean]",l="[object Date]",d="[object Error]",f="[object Function]",g="[object GeneratorFunction]",h="[object Map]",p="[object Number]",v="[object Object]",T="[object Promise]",_="[object RegExp]",E="[object Set]",O="[object String]",C="[object Symbol]",H="[object WeakMap]",M="[object ArrayBuffer]",J="[object DataView]",U="[object Float32Array]",G="[object Float64Array]",V="[object Int8Array]",ee="[object Int16Array]",y="[object Int32Array]",j="[object Uint8Array]",b="[object Uint8ClampedArray]",R="[object Uint16Array]",k="[object Uint32Array]",D=/[\\^$.*+?()[\]{}|]/g,W=/\w*$/,Y=/^\[object .+?Constructor\]$/,B=/^(?:0|[1-9]\d*)$/,z={};z[a]=z[i]=z[M]=z[J]=z[o]=z[l]=z[U]=z[G]=z[V]=z[ee]=z[y]=z[h]=z[p]=z[v]=z[_]=z[E]=z[O]=z[C]=z[j]=z[b]=z[R]=z[k]=!0,z[d]=z[f]=z[H]=!1;var K=typeof Ws=="object"&&Ws&&Ws.Object===Object&&Ws,te=typeof self=="object"&&self&&self.Object===Object&&self,fe=K||te||Function("return this")(),Ee=e&&!e.nodeType&&e,ge=Ee&&!0&&t&&!t.nodeType&&t,Le=ge&&ge.exports===Ee;function de(m,S){return m.set(S[0],S[1]),m}function me(m,S){return m.add(S),m}function Ie(m,S){for(var q=-1,oe=m?m.length:0;++q<oe&&S(m[q],q,m)!==!1;);return m}function se(m,S){for(var q=-1,oe=S.length,ze=m.length;++q<oe;)m[ze+q]=S[q];return m}function he(m,S,q,oe){for(var ze=-1,Pe=m?m.length:0;++ze<Pe;)q=S(q,m[ze],ze,m);return q}function Ae(m,S){for(var q=-1,oe=Array(m);++q<m;)oe[q]=S(q);return oe}function Ce(m,S){return m==null?void 0:m[S]}function Me(m){var S=!1;if(m!=null&&typeof m.toString!="function")try{S=!!(m+"")}catch{}return S}function ke(m){var S=-1,q=Array(m.size);return m.forEach(function(oe,ze){q[++S]=[ze,oe]}),q}function dt(m,S){return function(q){return m(S(q))}}function Be(m){var S=-1,q=Array(m.size);return m.forEach(function(oe){q[++S]=oe}),q}var It=Array.prototype,Dt=Function.prototype,Lt=Object.prototype,ft=fe["__core-js_shared__"],Vt=(function(){var m=/[^.]+$/.exec(ft&&ft.keys&&ft.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),qt=Dt.toString,Pt=Lt.hasOwnProperty,Gt=Lt.toString,Mt=RegExp("^"+qt.call(Pt).replace(D,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=Le?fe.Buffer:void 0,yt=fe.Symbol,Bt=fe.Uint8Array,ot=dt(Object.getPrototypeOf,Object),tt=Object.create,bt=Lt.propertyIsEnumerable,An=It.splice,yn=Object.getOwnPropertySymbols,ln=mt?mt.isBuffer:void 0,Zn=dt(Object.keys,Object),Jn=Er(fe,"DataView"),jt=Er(fe,"Map"),en=Er(fe,"Promise"),Hr=Er(fe,"Set"),os=Er(fe,"WeakMap"),er=Er(Object,"create"),us=On(Jn),Ne=On(jt),Ye=On(en),Xe=On(Hr),Ze=On(os),L=yt?yt.prototype:void 0,ue=L?L.valueOf:void 0;function Te(m){var S=-1,q=m?m.length:0;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function De(){this.__data__=er?er(null):{}}function Ve(m){return this.has(m)&&delete this.__data__[m]}function Ge(m){var S=this.__data__;if(er){var q=S[m];return q===r?void 0:q}return Pt.call(S,m)?S[m]:void 0}function Et(m){var S=this.__data__;return er?S[m]!==void 0:Pt.call(S,m)}function cn(m,S){var q=this.__data__;return q[m]=er&&S===void 0?r:S,this}Te.prototype.clear=De,Te.prototype.delete=Ve,Te.prototype.get=Ge,Te.prototype.has=Et,Te.prototype.set=cn;function Nt(m){var S=-1,q=m?m.length:0;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function tr(){this.__data__=[]}function Os(m){var S=this.__data__,q=gt(S,m);if(q<0)return!1;var oe=S.length-1;return q==oe?S.pop():An.call(S,q,1),!0}function qr(m){var S=this.__data__,q=gt(S,m);return q<0?void 0:S[q][1]}function ua(m){return gt(this.__data__,m)>-1}function la(m,S){var q=this.__data__,oe=gt(q,m);return oe<0?q.push([m,S]):q[oe][1]=S,this}Nt.prototype.clear=tr,Nt.prototype.delete=Os,Nt.prototype.get=qr,Nt.prototype.has=ua,Nt.prototype.set=la;function Xt(m){var S=-1,q=m?m.length:0;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function ca(){this.__data__={hash:new Te,map:new(jt||Nt),string:new Te}}function da(m){return va(this,m).delete(m)}function xs(m){return va(this,m).get(m)}function fa(m){return va(this,m).has(m)}function ha(m,S){return va(this,m).set(m,S),this}Xt.prototype.clear=ca,Xt.prototype.delete=da,Xt.prototype.get=xs,Xt.prototype.has=fa,Xt.prototype.set=ha;function dn(m){this.__data__=new Nt(m)}function Rs(){this.__data__=new Nt}function pa(m){return this.__data__.delete(m)}function ma(m){return this.__data__.get(m)}function ga(m){return this.__data__.has(m)}function we(m,S){var q=this.__data__;if(q instanceof Nt){var oe=q.__data__;if(!jt||oe.length<n-1)return oe.push([m,S]),this;q=this.__data__=new Xt(oe)}return q.set(m,S),this}dn.prototype.clear=Rs,dn.prototype.delete=pa,dn.prototype.get=ma,dn.prototype.has=ga,dn.prototype.set=we;function Se(m,S){var q=so(m)||ii(m)?Ae(m.length,String):[],oe=q.length,ze=!!oe;for(var Pe in m)Pt.call(m,Pe)&&!(ze&&(Pe=="length"||Ac(Pe,oe)))&&q.push(Pe);return q}function He(m,S,q){var oe=m[S];(!(Pt.call(m,S)&&yu(oe,q))||q===void 0&&!(S in m))&&(m[S]=q)}function gt(m,S){for(var q=m.length;q--;)if(yu(m[q][0],S))return q;return-1}function $t(m,S){return m&&ro(S,io(S),m)}function Yt(m,S,q,oe,ze,Pe,ht){var ut;if(oe&&(ut=Pe?oe(m,ze,Pe,ht):oe(m)),ut!==void 0)return ut;if(!$r(m))return m;var Qt=so(m);if(Qt){if(ut=_c(m),!S)return vc(m,ut)}else{var _t=cs(m),Nn=_t==f||_t==g;if(Nu(m))return rn(m,S);if(_t==v||_t==a||Nn&&!Pe){if(Me(m))return Pe?m:{};if(ut=jr(Nn?{}:m),!S)return bc(m,$t(ut,m))}else{if(!z[_t])return Pe?m:{};ut=Tc(m,_t,Yt,S)}}ht||(ht=new dn);var Mn=ht.get(m);if(Mn)return Mn;if(ht.set(m,ut),!Qt)var sn=q?Ec(m):io(m);return Ie(sn||m,function(Sn,vn){sn&&(vn=Sn,Sn=m[vn]),He(ut,vn,Yt(Sn,S,q,oe,vn,m,ht))}),ut}function tn(m){return $r(m)?tt(m):{}}function gn(m,S,q){var oe=S(m);return so(m)?oe:se(oe,q(m))}function nn(m){return Gt.call(m)}function nr(m){if(!$r(m)||Nc(m))return!1;var S=ao(m)||Me(m)?Mt:Y;return S.test(On(m))}function Ft(m){if(!Tu(m))return Zn(m);var S=[];for(var q in Object(m))Pt.call(m,q)&&q!="constructor"&&S.push(q);return S}function rn(m,S){if(S)return m.slice();var q=new m.constructor(m.length);return m.copy(q),q}function At(m){var S=new m.constructor(m.byteLength);return new Bt(S).set(new Bt(m)),S}function Ut(m,S){var q=S?At(m.buffer):m.buffer;return new m.constructor(q,m.byteOffset,m.byteLength)}function rr(m,S,q){var oe=S?q(ke(m),!0):ke(m);return he(oe,de,new m.constructor)}function sr(m){var S=new m.constructor(m.source,W.exec(m));return S.lastIndex=m.lastIndex,S}function pc(m,S,q){var oe=S?q(Be(m),!0):Be(m);return he(oe,me,new m.constructor)}function mc(m){return ue?Object(ue.call(m)):{}}function gc(m,S){var q=S?At(m.buffer):m.buffer;return new m.constructor(q,m.byteOffset,m.length)}function vc(m,S){var q=-1,oe=m.length;for(S||(S=Array(oe));++q<oe;)S[q]=m[q];return S}function ro(m,S,q,oe){q||(q={});for(var ze=-1,Pe=S.length;++ze<Pe;){var ht=S[ze],ut=void 0;He(q,ht,ut===void 0?m[ht]:ut)}return q}function bc(m,S){return ro(m,ls(m),S)}function Ec(m){return gn(m,io,ls)}function va(m,S){var q=m.__data__;return yc(S)?q[typeof S=="string"?"string":"hash"]:q.map}function Er(m,S){var q=Ce(m,S);return nr(q)?q:void 0}var ls=yn?dt(yn,Object):wc,cs=nn;(Jn&&cs(new Jn(new ArrayBuffer(1)))!=J||jt&&cs(new jt)!=h||en&&cs(en.resolve())!=T||Hr&&cs(new Hr)!=E||os&&cs(new os)!=H)&&(cs=function(m){var S=Gt.call(m),q=S==v?m.constructor:void 0,oe=q?On(q):void 0;if(oe)switch(oe){case us:return J;case Ne:return h;case Ye:return T;case Xe:return E;case Ze:return H}return S});function _c(m){var S=m.length,q=m.constructor(S);return S&&typeof m[0]=="string"&&Pt.call(m,"index")&&(q.index=m.index,q.input=m.input),q}function jr(m){return typeof m.constructor=="function"&&!Tu(m)?tn(ot(m)):{}}function Tc(m,S,q,oe){var ze=m.constructor;switch(S){case M:return At(m);case o:case l:return new ze(+m);case J:return Ut(m,oe);case U:case G:case V:case ee:case y:case j:case b:case R:case k:return gc(m,oe);case h:return rr(m,oe,q);case p:case O:return new ze(m);case _:return sr(m);case E:return pc(m,oe,q);case C:return mc(m)}}function Ac(m,S){return S=S??s,!!S&&(typeof m=="number"||B.test(m))&&m>-1&&m%1==0&&m<S}function yc(m){var S=typeof m;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?m!=="__proto__":m===null}function Nc(m){return!!Vt&&Vt in m}function Tu(m){var S=m&&m.constructor,q=typeof S=="function"&&S.prototype||Lt;return m===q}function On(m){if(m!=null){try{return qt.call(m)}catch{}try{return m+""}catch{}}return""}function Au(m){return Yt(m,!0,!0)}function yu(m,S){return m===S||m!==m&&S!==S}function ii(m){return Sc(m)&&Pt.call(m,"callee")&&(!bt.call(m,"callee")||Gt.call(m)==a)}var so=Array.isArray;function oi(m){return m!=null&&Su(m.length)&&!ao(m)}function Sc(m){return wu(m)&&oi(m)}var Nu=ln||Ic;function ao(m){var S=$r(m)?Gt.call(m):"";return S==f||S==g}function Su(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=s}function $r(m){var S=typeof m;return!!m&&(S=="object"||S=="function")}function wu(m){return!!m&&typeof m=="object"}function io(m){return oi(m)?Se(m):Ft(m)}function wc(){return[]}function Ic(){return!1}t.exports=Au})(To,To.exports)),To.exports}var Ao={exports:{}};Ao.exports;var Jp;function nb(){return Jp||(Jp=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,o="[object Arguments]",l="[object Array]",d="[object AsyncFunction]",f="[object Boolean]",g="[object Date]",h="[object Error]",p="[object Function]",v="[object GeneratorFunction]",T="[object Map]",_="[object Number]",E="[object Null]",O="[object Object]",C="[object Promise]",H="[object Proxy]",M="[object RegExp]",J="[object Set]",U="[object String]",G="[object Symbol]",V="[object Undefined]",ee="[object WeakMap]",y="[object ArrayBuffer]",j="[object DataView]",b="[object Float32Array]",R="[object Float64Array]",k="[object Int8Array]",D="[object Int16Array]",W="[object Int32Array]",Y="[object Uint8Array]",B="[object Uint8ClampedArray]",z="[object Uint16Array]",K="[object Uint32Array]",te=/[\\^$.*+?()[\]{}|]/g,fe=/^\[object .+?Constructor\]$/,Ee=/^(?:0|[1-9]\d*)$/,ge={};ge[b]=ge[R]=ge[k]=ge[D]=ge[W]=ge[Y]=ge[B]=ge[z]=ge[K]=!0,ge[o]=ge[l]=ge[y]=ge[f]=ge[j]=ge[g]=ge[h]=ge[p]=ge[T]=ge[_]=ge[O]=ge[M]=ge[J]=ge[U]=ge[ee]=!1;var Le=typeof Ws=="object"&&Ws&&Ws.Object===Object&&Ws,de=typeof self=="object"&&self&&self.Object===Object&&self,me=Le||de||Function("return this")(),Ie=e&&!e.nodeType&&e,se=Ie&&!0&&t&&!t.nodeType&&t,he=se&&se.exports===Ie,Ae=he&&Le.process,Ce=(function(){try{return Ae&&Ae.binding&&Ae.binding("util")}catch{}})(),Me=Ce&&Ce.isTypedArray;function ke(m,S){for(var q=-1,oe=m==null?0:m.length,ze=0,Pe=[];++q<oe;){var ht=m[q];S(ht,q,m)&&(Pe[ze++]=ht)}return Pe}function dt(m,S){for(var q=-1,oe=S.length,ze=m.length;++q<oe;)m[ze+q]=S[q];return m}function Be(m,S){for(var q=-1,oe=m==null?0:m.length;++q<oe;)if(S(m[q],q,m))return!0;return!1}function It(m,S){for(var q=-1,oe=Array(m);++q<m;)oe[q]=S(q);return oe}function Dt(m){return function(S){return m(S)}}function Lt(m,S){return m.has(S)}function ft(m,S){return m==null?void 0:m[S]}function Vt(m){var S=-1,q=Array(m.size);return m.forEach(function(oe,ze){q[++S]=[ze,oe]}),q}function qt(m,S){return function(q){return m(S(q))}}function Pt(m){var S=-1,q=Array(m.size);return m.forEach(function(oe){q[++S]=oe}),q}var Gt=Array.prototype,Mt=Function.prototype,mt=Object.prototype,yt=me["__core-js_shared__"],Bt=Mt.toString,ot=mt.hasOwnProperty,tt=(function(){var m=/[^.]+$/.exec(yt&&yt.keys&&yt.keys.IE_PROTO||"");return m?"Symbol(src)_1."+m:""})(),bt=mt.toString,An=RegExp("^"+Bt.call(ot).replace(te,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),yn=he?me.Buffer:void 0,ln=me.Symbol,Zn=me.Uint8Array,Jn=mt.propertyIsEnumerable,jt=Gt.splice,en=ln?ln.toStringTag:void 0,Hr=Object.getOwnPropertySymbols,os=yn?yn.isBuffer:void 0,er=qt(Object.keys,Object),us=ls(me,"DataView"),Ne=ls(me,"Map"),Ye=ls(me,"Promise"),Xe=ls(me,"Set"),Ze=ls(me,"WeakMap"),L=ls(Object,"create"),ue=On(us),Te=On(Ne),De=On(Ye),Ve=On(Xe),Ge=On(Ze),Et=ln?ln.prototype:void 0,cn=Et?Et.valueOf:void 0;function Nt(m){var S=-1,q=m==null?0:m.length;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function tr(){this.__data__=L?L(null):{},this.size=0}function Os(m){var S=this.has(m)&&delete this.__data__[m];return this.size-=S?1:0,S}function qr(m){var S=this.__data__;if(L){var q=S[m];return q===r?void 0:q}return ot.call(S,m)?S[m]:void 0}function ua(m){var S=this.__data__;return L?S[m]!==void 0:ot.call(S,m)}function la(m,S){var q=this.__data__;return this.size+=this.has(m)?0:1,q[m]=L&&S===void 0?r:S,this}Nt.prototype.clear=tr,Nt.prototype.delete=Os,Nt.prototype.get=qr,Nt.prototype.has=ua,Nt.prototype.set=la;function Xt(m){var S=-1,q=m==null?0:m.length;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function ca(){this.__data__=[],this.size=0}function da(m){var S=this.__data__,q=rn(S,m);if(q<0)return!1;var oe=S.length-1;return q==oe?S.pop():jt.call(S,q,1),--this.size,!0}function xs(m){var S=this.__data__,q=rn(S,m);return q<0?void 0:S[q][1]}function fa(m){return rn(this.__data__,m)>-1}function ha(m,S){var q=this.__data__,oe=rn(q,m);return oe<0?(++this.size,q.push([m,S])):q[oe][1]=S,this}Xt.prototype.clear=ca,Xt.prototype.delete=da,Xt.prototype.get=xs,Xt.prototype.has=fa,Xt.prototype.set=ha;function dn(m){var S=-1,q=m==null?0:m.length;for(this.clear();++S<q;){var oe=m[S];this.set(oe[0],oe[1])}}function Rs(){this.size=0,this.__data__={hash:new Nt,map:new(Ne||Xt),string:new Nt}}function pa(m){var S=Er(this,m).delete(m);return this.size-=S?1:0,S}function ma(m){return Er(this,m).get(m)}function ga(m){return Er(this,m).has(m)}function we(m,S){var q=Er(this,m),oe=q.size;return q.set(m,S),this.size+=q.size==oe?0:1,this}dn.prototype.clear=Rs,dn.prototype.delete=pa,dn.prototype.get=ma,dn.prototype.has=ga,dn.prototype.set=we;function Se(m){var S=-1,q=m==null?0:m.length;for(this.__data__=new dn;++S<q;)this.add(m[S])}function He(m){return this.__data__.set(m,r),this}function gt(m){return this.__data__.has(m)}Se.prototype.add=Se.prototype.push=He,Se.prototype.has=gt;function $t(m){var S=this.__data__=new Xt(m);this.size=S.size}function Yt(){this.__data__=new Xt,this.size=0}function tn(m){var S=this.__data__,q=S.delete(m);return this.size=S.size,q}function gn(m){return this.__data__.get(m)}function nn(m){return this.__data__.has(m)}function nr(m,S){var q=this.__data__;if(q instanceof Xt){var oe=q.__data__;if(!Ne||oe.length<n-1)return oe.push([m,S]),this.size=++q.size,this;q=this.__data__=new dn(oe)}return q.set(m,S),this.size=q.size,this}$t.prototype.clear=Yt,$t.prototype.delete=tn,$t.prototype.get=gn,$t.prototype.has=nn,$t.prototype.set=nr;function Ft(m,S){var q=ii(m),oe=!q&&yu(m),ze=!q&&!oe&&oi(m),Pe=!q&&!oe&&!ze&&wu(m),ht=q||oe||ze||Pe,ut=ht?It(m.length,String):[],Qt=ut.length;for(var _t in m)ot.call(m,_t)&&!(ht&&(_t=="length"||ze&&(_t=="offset"||_t=="parent")||Pe&&(_t=="buffer"||_t=="byteLength"||_t=="byteOffset")||Tc(_t,Qt)))&&ut.push(_t);return ut}function rn(m,S){for(var q=m.length;q--;)if(Au(m[q][0],S))return q;return-1}function At(m,S,q){var oe=S(m);return ii(m)?oe:dt(oe,q(m))}function Ut(m){return m==null?m===void 0?V:E:en&&en in Object(m)?cs(m):Tu(m)}function rr(m){return $r(m)&&Ut(m)==o}function sr(m,S,q,oe,ze){return m===S?!0:m==null||S==null||!$r(m)&&!$r(S)?m!==m&&S!==S:pc(m,S,q,oe,sr,ze)}function pc(m,S,q,oe,ze,Pe){var ht=ii(m),ut=ii(S),Qt=ht?l:jr(m),_t=ut?l:jr(S);Qt=Qt==o?O:Qt,_t=_t==o?O:_t;var Nn=Qt==O,Mn=_t==O,sn=Qt==_t;if(sn&&oi(m)){if(!oi(S))return!1;ht=!0,Nn=!1}if(sn&&!Nn)return Pe||(Pe=new $t),ht||wu(m)?ro(m,S,q,oe,ze,Pe):bc(m,S,Qt,q,oe,ze,Pe);if(!(q&s)){var Sn=Nn&&ot.call(m,"__wrapped__"),vn=Mn&&ot.call(S,"__wrapped__");if(Sn||vn){var Ds=Sn?m.value():m,ds=vn?S.value():S;return Pe||(Pe=new $t),ze(Ds,ds,q,oe,Pe)}}return sn?(Pe||(Pe=new $t),Ec(m,S,q,oe,ze,Pe)):!1}function mc(m){if(!Su(m)||yc(m))return!1;var S=Nu(m)?An:fe;return S.test(On(m))}function gc(m){return $r(m)&&ao(m.length)&&!!ge[Ut(m)]}function vc(m){if(!Nc(m))return er(m);var S=[];for(var q in Object(m))ot.call(m,q)&&q!="constructor"&&S.push(q);return S}function ro(m,S,q,oe,ze,Pe){var ht=q&s,ut=m.length,Qt=S.length;if(ut!=Qt&&!(ht&&Qt>ut))return!1;var _t=Pe.get(m);if(_t&&Pe.get(S))return _t==S;var Nn=-1,Mn=!0,sn=q&a?new Se:void 0;for(Pe.set(m,S),Pe.set(S,m);++Nn<ut;){var Sn=m[Nn],vn=S[Nn];if(oe)var Ds=ht?oe(vn,Sn,Nn,S,m,Pe):oe(Sn,vn,Nn,m,S,Pe);if(Ds!==void 0){if(Ds)continue;Mn=!1;break}if(sn){if(!Be(S,function(ds,ba){if(!Lt(sn,ba)&&(Sn===ds||ze(Sn,ds,q,oe,Pe)))return sn.push(ba)})){Mn=!1;break}}else if(!(Sn===vn||ze(Sn,vn,q,oe,Pe))){Mn=!1;break}}return Pe.delete(m),Pe.delete(S),Mn}function bc(m,S,q,oe,ze,Pe,ht){switch(q){case j:if(m.byteLength!=S.byteLength||m.byteOffset!=S.byteOffset)return!1;m=m.buffer,S=S.buffer;case y:return!(m.byteLength!=S.byteLength||!Pe(new Zn(m),new Zn(S)));case f:case g:case _:return Au(+m,+S);case h:return m.name==S.name&&m.message==S.message;case M:case U:return m==S+"";case T:var ut=Vt;case J:var Qt=oe&s;if(ut||(ut=Pt),m.size!=S.size&&!Qt)return!1;var _t=ht.get(m);if(_t)return _t==S;oe|=a,ht.set(m,S);var Nn=ro(ut(m),ut(S),oe,ze,Pe,ht);return ht.delete(m),Nn;case G:if(cn)return cn.call(m)==cn.call(S)}return!1}function Ec(m,S,q,oe,ze,Pe){var ht=q&s,ut=va(m),Qt=ut.length,_t=va(S),Nn=_t.length;if(Qt!=Nn&&!ht)return!1;for(var Mn=Qt;Mn--;){var sn=ut[Mn];if(!(ht?sn in S:ot.call(S,sn)))return!1}var Sn=Pe.get(m);if(Sn&&Pe.get(S))return Sn==S;var vn=!0;Pe.set(m,S),Pe.set(S,m);for(var Ds=ht;++Mn<Qt;){sn=ut[Mn];var ds=m[sn],ba=S[sn];if(oe)var o0=ht?oe(ba,ds,sn,S,m,Pe):oe(ds,ba,sn,m,S,Pe);if(!(o0===void 0?ds===ba||ze(ds,ba,q,oe,Pe):o0)){vn=!1;break}Ds||(Ds=sn=="constructor")}if(vn&&!Ds){var Iu=m.constructor,Cu=S.constructor;Iu!=Cu&&"constructor"in m&&"constructor"in S&&!(typeof Iu=="function"&&Iu instanceof Iu&&typeof Cu=="function"&&Cu instanceof Cu)&&(vn=!1)}return Pe.delete(m),Pe.delete(S),vn}function va(m){return At(m,io,_c)}function Er(m,S){var q=m.__data__;return Ac(S)?q[typeof S=="string"?"string":"hash"]:q.map}function ls(m,S){var q=ft(m,S);return mc(q)?q:void 0}function cs(m){var S=ot.call(m,en),q=m[en];try{m[en]=void 0;var oe=!0}catch{}var ze=bt.call(m);return oe&&(S?m[en]=q:delete m[en]),ze}var _c=Hr?function(m){return m==null?[]:(m=Object(m),ke(Hr(m),function(S){return Jn.call(m,S)}))}:wc,jr=Ut;(us&&jr(new us(new ArrayBuffer(1)))!=j||Ne&&jr(new Ne)!=T||Ye&&jr(Ye.resolve())!=C||Xe&&jr(new Xe)!=J||Ze&&jr(new Ze)!=ee)&&(jr=function(m){var S=Ut(m),q=S==O?m.constructor:void 0,oe=q?On(q):"";if(oe)switch(oe){case ue:return j;case Te:return T;case De:return C;case Ve:return J;case Ge:return ee}return S});function Tc(m,S){return S=S??i,!!S&&(typeof m=="number"||Ee.test(m))&&m>-1&&m%1==0&&m<S}function Ac(m){var S=typeof m;return S=="string"||S=="number"||S=="symbol"||S=="boolean"?m!=="__proto__":m===null}function yc(m){return!!tt&&tt in m}function Nc(m){var S=m&&m.constructor,q=typeof S=="function"&&S.prototype||mt;return m===q}function Tu(m){return bt.call(m)}function On(m){if(m!=null){try{return Bt.call(m)}catch{}try{return m+""}catch{}}return""}function Au(m,S){return m===S||m!==m&&S!==S}var yu=rr((function(){return arguments})())?rr:function(m){return $r(m)&&ot.call(m,"callee")&&!Jn.call(m,"callee")},ii=Array.isArray;function so(m){return m!=null&&ao(m.length)&&!Nu(m)}var oi=os||Ic;function Sc(m,S){return sr(m,S)}function Nu(m){if(!Su(m))return!1;var S=Ut(m);return S==p||S==v||S==d||S==H}function ao(m){return typeof m=="number"&&m>-1&&m%1==0&&m<=i}function Su(m){var S=typeof m;return m!=null&&(S=="object"||S=="function")}function $r(m){return m!=null&&typeof m=="object"}var wu=Me?Dt(Me):gc;function io(m){return so(m)?Ft(m):vc(m)}function wc(){return[]}function Ic(){return!1}t.exports=Sc})(Ao,Ao.exports)),Ao.exports}var $u={},e1;function yL(){if(e1)return $u;e1=1,Object.defineProperty($u,"__esModule",{value:!0});const t=tb(),e=nb();var n;return(function(r){function s(l={},d={},f=!1){typeof l!="object"&&(l={}),typeof d!="object"&&(d={});let g=t(d);f||(g=Object.keys(g).reduce((h,p)=>(g[p]!=null&&(h[p]=g[p]),h),{}));for(const h in l)l[h]!==void 0&&d[h]===void 0&&(g[h]=l[h]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(l={},d={}){typeof l!="object"&&(l={}),typeof d!="object"&&(d={});const f=Object.keys(l).concat(Object.keys(d)).reduce((g,h)=>(e(l[h],d[h])||(g[h]=d[h]===void 0?null:d[h]),g),{});return Object.keys(f).length>0?f:void 0}r.diff=a;function i(l={},d={}){l=l||{};const f=Object.keys(d).reduce((g,h)=>(d[h]!==l[h]&&l[h]!==void 0&&(g[h]=d[h]),g),{});return Object.keys(l).reduce((g,h)=>(l[h]!==d[h]&&d[h]===void 0&&(g[h]=null),g),f)}r.invert=i;function o(l,d,f=!1){if(typeof l!="object")return d;if(typeof d!="object")return;if(!f)return d;const g=Object.keys(d).reduce((h,p)=>(l[p]===void 0&&(h[p]=d[p]),h),{});return Object.keys(g).length>0?g:void 0}r.transform=o})(n||(n={})),$u.default=n,$u}var Yu={},t1;function rb(){if(t1)return Yu;t1=1,Object.defineProperty(Yu,"__esModule",{value:!0});var t;return(function(e){function n(r){return typeof r.delete=="number"?r.delete:typeof r.retain=="number"?r.retain:typeof r.retain=="object"&&r.retain!==null?1:typeof r.insert=="string"?r.insert.length:1}e.length=n})(t||(t={})),Yu.default=t,Yu}var zu={},n1;function NL(){if(n1)return zu;n1=1,Object.defineProperty(zu,"__esModule",{value:!0});const t=rb();class e{constructor(r){this.ops=r,this.index=0,this.offset=0}hasNext(){return this.peekLength()<1/0}next(r){r||(r=1/0);const s=this.ops[this.index];if(s){const a=this.offset,i=t.default.length(s);if(r>=i-a?(r=i-a,this.index+=1,this.offset=0):this.offset+=r,typeof s.delete=="number")return{delete:r};{const o={};return s.attributes&&(o.attributes=s.attributes),typeof s.retain=="number"?o.retain=r:typeof s.retain=="object"&&s.retain!==null?o.retain=s.retain:typeof s.insert=="string"?o.insert=s.insert.substr(a,r):o.insert=s.insert,o}}else return{retain:1/0}}peek(){return this.ops[this.index]}peekLength(){return this.ops[this.index]?t.default.length(this.ops[this.index])-this.offset:1/0}peekType(){const r=this.ops[this.index];return r?typeof r.delete=="number"?"delete":typeof r.retain=="number"||typeof r.retain=="object"&&r.retain!==null?"retain":"insert":"retain"}rest(){if(this.hasNext()){if(this.offset===0)return this.ops.slice(this.index);{const r=this.offset,s=this.index,a=this.next(),i=this.ops.slice(this.index);return this.offset=r,this.index=s,[a].concat(i)}}else return[]}}return zu.default=e,zu}var r1;function SL(){return r1||(r1=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=AL(),r=tb(),s=nb(),a=yL();e.AttributeMap=a.default;const i=rb();e.Op=i.default;const o=NL();e.OpIterator=o.default;const l="\0",d=(g,h)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof h!="object"||h===null)throw new Error(`cannot retain a ${typeof h}`);const p=Object.keys(g)[0];if(!p||p!==Object.keys(h)[0])throw new Error(`embed types not matched: ${p} != ${Object.keys(h)[0]}`);return[p,g[p],h[p]]};class f{constructor(h){Array.isArray(h)?this.ops=h:h!=null&&Array.isArray(h.ops)?this.ops=h.ops:this.ops=[]}static registerEmbed(h,p){this.handlers[h]=p}static unregisterEmbed(h){delete this.handlers[h]}static getHandler(h){const p=this.handlers[h];if(!p)throw new Error(`no handlers for embed type "${h}"`);return p}insert(h,p){const v={};return typeof h=="string"&&h.length===0?this:(v.insert=h,p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(v.attributes=p),this.push(v))}delete(h){return h<=0?this:this.push({delete:h})}retain(h,p){if(typeof h=="number"&&h<=0)return this;const v={retain:h};return p!=null&&typeof p=="object"&&Object.keys(p).length>0&&(v.attributes=p),this.push(v)}push(h){let p=this.ops.length,v=this.ops[p-1];if(h=r(h),typeof v=="object"){if(typeof h.delete=="number"&&typeof v.delete=="number")return this.ops[p-1]={delete:v.delete+h.delete},this;if(typeof v.delete=="number"&&h.insert!=null&&(p-=1,v=this.ops[p-1],typeof v!="object"))return this.ops.unshift(h),this;if(s(h.attributes,v.attributes)){if(typeof h.insert=="string"&&typeof v.insert=="string")return this.ops[p-1]={insert:v.insert+h.insert},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this;if(typeof h.retain=="number"&&typeof v.retain=="number")return this.ops[p-1]={retain:v.retain+h.retain},typeof h.attributes=="object"&&(this.ops[p-1].attributes=h.attributes),this}}return p===this.ops.length?this.ops.push(h):this.ops.splice(p,0,h),this}chop(){const h=this.ops[this.ops.length-1];return h&&typeof h.retain=="number"&&!h.attributes&&this.ops.pop(),this}filter(h){return this.ops.filter(h)}forEach(h){this.ops.forEach(h)}map(h){return this.ops.map(h)}partition(h){const p=[],v=[];return this.forEach(T=>{(h(T)?p:v).push(T)}),[p,v]}reduce(h,p){return this.ops.reduce(h,p)}changeLength(){return this.reduce((h,p)=>p.insert?h+i.default.length(p):p.delete?h-p.delete:h,0)}length(){return this.reduce((h,p)=>h+i.default.length(p),0)}slice(h=0,p=1/0){const v=[],T=new o.default(this.ops);let _=0;for(;_<p&&T.hasNext();){let E;_<h?E=T.next(h-_):(E=T.next(p-_),v.push(E)),_+=i.default.length(E)}return new f(v)}compose(h){const p=new o.default(this.ops),v=new o.default(h.ops),T=[],_=v.peek();if(_!=null&&typeof _.retain=="number"&&_.attributes==null){let O=_.retain;for(;p.peekType()==="insert"&&p.peekLength()<=O;)O-=p.peekLength(),T.push(p.next());_.retain-O>0&&v.next(_.retain-O)}const E=new f(T);for(;p.hasNext()||v.hasNext();)if(v.peekType()==="insert")E.push(v.next());else if(p.peekType()==="delete")E.push(p.next());else{const O=Math.min(p.peekLength(),v.peekLength()),C=p.next(O),H=v.next(O);if(H.retain){const M={};if(typeof C.retain=="number")M.retain=typeof H.retain=="number"?O:H.retain;else if(typeof H.retain=="number")C.retain==null?M.insert=C.insert:M.retain=C.retain;else{const U=C.retain==null?"insert":"retain",[G,V,ee]=d(C[U],H.retain),y=f.getHandler(G);M[U]={[G]:y.compose(V,ee,U==="retain")}}const J=a.default.compose(C.attributes,H.attributes,typeof C.retain=="number");if(J&&(M.attributes=J),E.push(M),!v.hasNext()&&s(E.ops[E.ops.length-1],M)){const U=new f(p.rest());return E.concat(U).chop()}}else typeof H.delete=="number"&&(typeof C.retain=="number"||typeof C.retain=="object"&&C.retain!==null)&&E.push(H)}return E.chop()}concat(h){const p=new f(this.ops.slice());return h.ops.length>0&&(p.push(h.ops[0]),p.ops=p.ops.concat(h.ops.slice(1))),p}diff(h,p){if(this.ops===h.ops)return new f;const v=[this,h].map(C=>C.map(H=>{if(H.insert!=null)return typeof H.insert=="string"?H.insert:l;const M=C===h?"on":"with";throw new Error("diff() called "+M+" non-document")}).join("")),T=new f,_=n(v[0],v[1],p,!0),E=new o.default(this.ops),O=new o.default(h.ops);return _.forEach(C=>{let H=C[1].length;for(;H>0;){let M=0;switch(C[0]){case n.INSERT:M=Math.min(O.peekLength(),H),T.push(O.next(M));break;case n.DELETE:M=Math.min(H,E.peekLength()),E.next(M),T.delete(M);break;case n.EQUAL:M=Math.min(E.peekLength(),O.peekLength(),H);const J=E.next(M),U=O.next(M);s(J.insert,U.insert)?T.retain(M,a.default.diff(J.attributes,U.attributes)):T.push(U).delete(M);break}H-=M}}),T.chop()}eachLine(h,p=`
|
|
76
|
+
`){const v=new o.default(this.ops);let T=new f,_=0;for(;v.hasNext();){if(v.peekType()!=="insert")return;const E=v.peek(),O=i.default.length(E)-v.peekLength(),C=typeof E.insert=="string"?E.insert.indexOf(p,O)-O:-1;if(C<0)T.push(v.next());else if(C>0)T.push(v.next(C));else{if(h(T,v.next(1).attributes||{},_)===!1)return;_+=1,T=new f}}T.length()>0&&h(T,{},_)}invert(h){const p=new f;return this.reduce((v,T)=>{if(T.insert)p.delete(i.default.length(T));else{if(typeof T.retain=="number"&&T.attributes==null)return p.retain(T.retain),v+T.retain;if(T.delete||typeof T.retain=="number"){const _=T.delete||T.retain;return h.slice(v,v+_).forEach(O=>{T.delete?p.push(O):T.retain&&T.attributes&&p.retain(i.default.length(O),a.default.invert(T.attributes,O.attributes))}),v+_}else if(typeof T.retain=="object"&&T.retain!==null){const _=h.slice(v,v+1),E=new o.default(_.ops).next(),[O,C,H]=d(T.retain,E.insert),M=f.getHandler(O);return p.retain({[O]:M.invert(C,H)},a.default.invert(T.attributes,E.attributes)),v+1}}return v},0),p.chop()}transform(h,p=!1){if(p=!!p,typeof h=="number")return this.transformPosition(h,p);const v=h,T=new o.default(this.ops),_=new o.default(v.ops),E=new f;for(;T.hasNext()||_.hasNext();)if(T.peekType()==="insert"&&(p||_.peekType()!=="insert"))E.retain(i.default.length(T.next()));else if(_.peekType()==="insert")E.push(_.next());else{const O=Math.min(T.peekLength(),_.peekLength()),C=T.next(O),H=_.next(O);if(C.delete)continue;if(H.delete)E.push(H);else{const M=C.retain,J=H.retain;let U=typeof J=="object"&&J!==null?J:O;if(typeof M=="object"&&M!==null&&typeof J=="object"&&J!==null){const G=Object.keys(M)[0];if(G===Object.keys(J)[0]){const V=f.getHandler(G);V&&(U={[G]:V.transform(M[G],J[G],p)})}}E.retain(U,a.default.transform(C.attributes,H.attributes,p))}}return E.chop()}transformPosition(h,p=!1){p=!!p;const v=new o.default(this.ops);let T=0;for(;v.hasNext()&&T<=h;){const _=v.peekLength(),E=v.peekType();if(v.next(),E==="delete"){h-=Math.min(_,h-T);continue}else E==="insert"&&(T<h||!p)&&(h+=_);T+=_}return h}}f.Op=i.default,f.OpIterator=o.default,f.AttributeMap=a.default,f.handlers={},e.default=f,t.exports=f,t.exports.default=f})(ju,ju.exports)),ju.exports}var pr=SL();const xe=eb(pr);class Fr extends Qn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Fr.blotName="break";Fr.tagName="BR";let kr=class extends Pl{};const wL={"&":"&","<":"<",">":">",'"':""","'":"'"};function dc(t){return t.replace(/[&<>"']/g,e=>wL[e])}const Yr=class Yr extends Gh{static compare(e,n){const r=Yr.order.indexOf(e),s=Yr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(Yr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Re.BLOT)){const a=this.isolate(e,n);s&&a.wrap(r,s)}else super.formatAt(e,n,r,s)}optimize(e){if(super.optimize(e),this.parent instanceof Yr&&Yr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};ye(Yr,"allowedChildren",[Yr,Fr,Qn,kr]),ye(Yr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let as=Yr;const s1=1;class _n extends Qo{constructor(){super(...arguments);ye(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=sb(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,Re.BLOCK)?n+r===this.length()&&this.format(s,a):super.formatAt(n,Math.min(r,this.length()-n-1),s,a),this.cache={})}insertAt(n,r,s){if(s!=null){super.insertAt(n,r,s),this.cache={};return}if(r.length===0)return;const a=r.split(`
|
|
77
|
+
`),i=a.shift();i.length>0&&(n<this.length()-1||this.children.tail==null?super.insertAt(Math.min(n,this.length()-1),i):this.children.tail.insertAt(this.children.tail.length(),i),this.cache={});let o=this;a.reduce((l,d)=>(o=o.split(l,!0),o.insertAt(0,d),d.length),n+i.length)}insertBefore(n,r){const{head:s}=this.children;super.insertBefore(n,r),s instanceof Fr&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+s1),this.cache.length}moveChildren(n,r){super.moveChildren(n,r),this.cache={}}optimize(n){super.optimize(n),this.cache={}}path(n){return super.path(n,!0)}removeChild(n){super.removeChild(n),this.cache={}}split(n){let r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(r&&(n===0||n>=this.length()-s1)){const a=this.clone();return n===0?(this.parent.insertBefore(a,this),this):(this.parent.insertBefore(a,this.next),a)}const s=super.split(n,r);return this.cache={},s}}_n.blotName="block";_n.tagName="P";_n.defaultChild=Fr;_n.allowedChildren=[Fr,as,Qn,kr];class hr extends Qn{attach(){super.attach(),this.attributes=new lc(this.domNode)}delta(){return new xe().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,Re.BLOCK_ATTRIBUTE);r!=null&&this.attributes.attribute(r,n)}formatAt(e,n,r,s){this.format(r,s)}insertAt(e,n,r){if(r!=null){super.insertAt(e,n,r);return}const s=n.split(`
|
|
78
|
+
`),a=s.pop(),i=s.map(l=>{const d=this.scroll.create(_n.blotName);return d.insertAt(0,l),d}),o=this.split(e);i.forEach(l=>{this.parent.insertBefore(l,o)}),a&&this.parent.insertBefore(this.scroll.create("text",a),o)}}hr.scope=Re.BLOCK_BLOT;function sb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(In).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),dr(r,{},e)),new xe).insert(`
|
|
79
|
+
`,dr(t))}function dr(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;return t==null||("formats"in t&&typeof t.formats=="function"&&(e={...e,...t.formats()},n&&delete e["code-token"]),t.parent==null||t.parent.statics.blotName==="scroll"||t.parent.statics.scope!==t.statics.scope)?e:dr(t.parent,e,n)}const ar=class ar extends Qn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(ar.CONTENTS),this.domNode.appendChild(this.textNode),this.savedLength=0}detach(){this.parent!=null&&this.parent.removeChild(this)}format(e,n){if(this.savedLength!==0){super.format(e,n);return}let r=this,s=0;for(;r!=null&&r.statics.scope!==Re.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=ar.CONTENTS.length,r.optimize(),r.formatAt(s,ar.CONTENTS.length,e,n),this.savedLength=0)}index(e,n){return e===this.textNode?0:super.index(e,n)}length(){return this.savedLength}position(){return[this.textNode,this.textNode.data.length]}remove(){super.remove(),this.parent=null}restore(){if(this.selection.composing||this.parent==null)return null;const e=this.selection.getNativeRange();for(;this.domNode.lastChild!=null&&this.domNode.lastChild!==this.textNode;)this.domNode.parentNode.insertBefore(this.domNode.lastChild,this.domNode);const n=this.prev instanceof kr?this.prev:null,r=n?n.length():0,s=this.next instanceof kr?this.next:null,a=s?s.text:"",{textNode:i}=this,o=i.data.split(ar.CONTENTS).join("");i.data=ar.CONTENTS;let l;if(n)l=n,(o||s)&&(n.insertAt(n.length(),o+a),s&&s.remove());else if(s)l=s,s.insertAt(0,o);else{const d=document.createTextNode(o);l=this.scroll.create(d),this.parent.insertBefore(l,this)}if(this.remove(),e){const d=(h,p)=>n&&h===n.domNode?p:h===i?r+p-1:s&&h===s.domNode?r+o.length+p:null,f=d(e.start.node,e.start.offset),g=d(e.end.node,e.end.offset);if(f!==null&&g!==null)return{startNode:l.domNode,startOffset:f,endNode:l.domNode,endOffset:g}}return null}update(e,n){if(e.some(r=>r.type==="characterData"&&r.target===this.textNode)){const r=this.restore();r&&(n.range=r)}}optimize(e){super.optimize(e);let{parent:n}=this;for(;n;){if(n.domNode.tagName==="A"){this.savedLength=ar.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};ye(ar,"blotName","cursor"),ye(ar,"className","ql-cursor"),ye(ar,"tagName","span"),ye(ar,"CONTENTS","\uFEFF");let Ki=ar;var Jc={exports:{}},a1;function IL(){return a1||(a1=1,(function(t){var e=Object.prototype.hasOwnProperty,n="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1));function s(l,d,f){this.fn=l,this.context=d,this.once=f||!1}function a(l,d,f,g,h){if(typeof f!="function")throw new TypeError("The listener must be a function");var p=new s(f,g||l,h),v=n?n+d:d;return l._events[v]?l._events[v].fn?l._events[v]=[l._events[v],p]:l._events[v].push(p):(l._events[v]=p,l._eventsCount++),l}function i(l,d){--l._eventsCount===0?l._events=new r:delete l._events[d]}function o(){this._events=new r,this._eventsCount=0}o.prototype.eventNames=function(){var d=[],f,g;if(this._eventsCount===0)return d;for(g in f=this._events)e.call(f,g)&&d.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(f)):d},o.prototype.listeners=function(d){var f=n?n+d:d,g=this._events[f];if(!g)return[];if(g.fn)return[g.fn];for(var h=0,p=g.length,v=new Array(p);h<p;h++)v[h]=g[h].fn;return v},o.prototype.listenerCount=function(d){var f=n?n+d:d,g=this._events[f];return g?g.fn?1:g.length:0},o.prototype.emit=function(d,f,g,h,p,v){var T=n?n+d:d;if(!this._events[T])return!1;var _=this._events[T],E=arguments.length,O,C;if(_.fn){switch(_.once&&this.removeListener(d,_.fn,void 0,!0),E){case 1:return _.fn.call(_.context),!0;case 2:return _.fn.call(_.context,f),!0;case 3:return _.fn.call(_.context,f,g),!0;case 4:return _.fn.call(_.context,f,g,h),!0;case 5:return _.fn.call(_.context,f,g,h,p),!0;case 6:return _.fn.call(_.context,f,g,h,p,v),!0}for(C=1,O=new Array(E-1);C<E;C++)O[C-1]=arguments[C];_.fn.apply(_.context,O)}else{var H=_.length,M;for(C=0;C<H;C++)switch(_[C].once&&this.removeListener(d,_[C].fn,void 0,!0),E){case 1:_[C].fn.call(_[C].context);break;case 2:_[C].fn.call(_[C].context,f);break;case 3:_[C].fn.call(_[C].context,f,g);break;case 4:_[C].fn.call(_[C].context,f,g,h);break;default:if(!O)for(M=1,O=new Array(E-1);M<E;M++)O[M-1]=arguments[M];_[C].fn.apply(_[C].context,O)}}return!0},o.prototype.on=function(d,f,g){return a(this,d,f,g,!1)},o.prototype.once=function(d,f,g){return a(this,d,f,g,!0)},o.prototype.removeListener=function(d,f,g,h){var p=n?n+d:d;if(!this._events[p])return this;if(!f)return i(this,p),this;var v=this._events[p];if(v.fn)v.fn===f&&(!h||v.once)&&(!g||v.context===g)&&i(this,p);else{for(var T=0,_=[],E=v.length;T<E;T++)(v[T].fn!==f||h&&!v[T].once||g&&v[T].context!==g)&&_.push(v[T]);_.length?this._events[p]=_.length===1?_[0]:_:i(this,p)}return this},o.prototype.removeAllListeners=function(d){var f;return d?(f=n?n+d:d,this._events[f]&&i(this,f)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,t.exports=o})(Jc)),Jc.exports}var CL=IL();const LL=eb(CL),Lf=new WeakMap,Of=["error","warn","log","info"];let xf="warn";function ab(t){if(xf&&Of.indexOf(t)<=Of.indexOf(xf)){for(var e=arguments.length,n=new Array(e>1?e-1:0),r=1;r<e;r++)n[r-1]=arguments[r];console[t](...n)}}function Ls(t){return Of.reduce((e,n)=>(e[n]=ab.bind(console,n,t),e),{})}Ls.level=t=>{xf=t};ab.level=Ls.level;const ed=Ls("quill:events"),OL=["selectionchange","mousedown","mouseup","click"];OL.forEach(t=>{document.addEventListener(t,function(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];Array.from(document.querySelectorAll(".ql-container")).forEach(s=>{const a=Lf.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class Oe extends LL{constructor(){super(),this.domListeners={},this.on("error",ed.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return ed.log.call(ed,...n),super.emit(...n)}handleDOM(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),s=1;s<n;s++)r[s-1]=arguments[s];(this.domListeners[e.type]||[]).forEach(a=>{let{node:i,handler:o}=a;(e.target===i||i.contains(e.target))&&o(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}ye(Oe,"events",{EDITOR_CHANGE:"editor-change",SCROLL_BEFORE_UPDATE:"scroll-before-update",SCROLL_BLOT_MOUNT:"scroll-blot-mount",SCROLL_BLOT_UNMOUNT:"scroll-blot-unmount",SCROLL_OPTIMIZE:"scroll-optimize",SCROLL_UPDATE:"scroll-update",SCROLL_EMBED_UPDATE:"scroll-embed-update",SELECTION_CHANGE:"selection-change",TEXT_CHANGE:"text-change",COMPOSITION_BEFORE_START:"composition-before-start",COMPOSITION_START:"composition-start",COMPOSITION_BEFORE_END:"composition-before-end",COMPOSITION_END:"composition-end"}),ye(Oe,"sources",{API:"api",SILENT:"silent",USER:"user"});const td=Ls("quill:selection");class Ka{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class xL{constructor(e,n){this.emitter=n,this.scroll=e,this.composing=!1,this.mouseDown=!1,this.root=this.scroll.domNode,this.cursor=this.scroll.create("cursor",this),this.savedRange=new Ka(0,0),this.lastRange=this.savedRange,this.lastNative=null,this.handleComposition(),this.handleDragging(),this.emitter.listenDOM("selectionchange",document,()=>{!this.mouseDown&&!this.composing&&setTimeout(this.update.bind(this,Oe.sources.USER),1)}),this.emitter.on(Oe.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Oe.events.SCROLL_UPDATE,(s,a)=>{try{this.root.contains(r.start.node)&&this.root.contains(r.end.node)&&this.setNativeRange(r.start.node,r.start.offset,r.end.node,r.end.offset);const i=a.some(o=>o.type==="characterData"||o.type==="childList"||o.type==="attributes"&&o.target===this.root);this.update(i?Oe.sources.SILENT:s)}catch{}})}),this.emitter.on(Oe.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:o,endOffset:l}=s.range;this.setNativeRange(a,i,o,l),this.update(Oe.sources.SILENT)}}),this.update(Oe.sources.SILENT)}handleComposition(){this.emitter.on(Oe.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Oe.events.COMPOSITION_END,()=>{if(this.composing=!1,this.cursor.parent){const e=this.cursor.restore();if(!e)return;setTimeout(()=>{this.setNativeRange(e.startNode,e.startOffset,e.endNode,e.endOffset)},1)}})}handleDragging(){this.emitter.listenDOM("mousedown",document.body,()=>{this.mouseDown=!0}),this.emitter.listenDOM("mouseup",document.body,()=>{this.mouseDown=!1,this.update(Oe.sources.USER)})}focus(){this.hasFocus()||(this.root.focus({preventScroll:!0}),this.setRange(this.savedRange))}format(e,n){this.scroll.update();const r=this.getNativeRange();if(!(r==null||!r.native.collapsed||this.scroll.query(e,Re.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof In){const a=s.split(r.start.offset);s.parent.insertBefore(this.cursor,a)}else s.insertBefore(this.cursor,r.start.node);this.cursor.attach()}this.cursor.format(e,n),this.scroll.optimize(),this.setNativeRange(this.cursor.textNode,this.cursor.textNode.data.length),this.update()}}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;const r=this.scroll.length();e=Math.min(e,r-1),n=Math.min(e+n,r-1)-e;let s,[a,i]=this.scroll.leaf(e);if(a==null)return null;if(n>0&&i===a.length()){const[f]=this.scroll.leaf(e+1);if(f){const[g]=this.scroll.line(e),[h]=this.scroll.line(e+1);g===h&&(a=f,i=0)}}[s,i]=a.position(i,!0);const o=document.createRange();if(n>0)return o.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),o.setEnd(s,i),o.getBoundingClientRect());let l="left",d;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(o.setStart(s,i),o.setEnd(s,i+1)):(o.setStart(s,i-1),o.setEnd(s,i),l="right"),d=o.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;d=a.domNode.getBoundingClientRect(),i>0&&(l="right")}return{bottom:d.top+d.height,height:d.height,left:d[l],right:d[l],top:d.top,width:0}}getNativeRange(){const e=document.getSelection();if(e==null||e.rangeCount<=0)return null;const n=e.getRangeAt(0);if(n==null)return null;const r=this.normalizeNative(n);return td.info("getNativeRange",r),r}getRange(){const e=this.scroll.domNode;if("isConnected"in e&&!e.isConnected)return[null,null];const n=this.getNativeRange();return n==null?[null,null]:[this.normalizedToRange(n),n]}hasFocus(){return document.activeElement===this.root||document.activeElement!=null&&nd(this.root,document.activeElement)}normalizedToRange(e){const n=[[e.start.node,e.start.offset]];e.native.collapsed||n.push([e.end.node,e.end.offset]);const r=n.map(i=>{const[o,l]=i,d=this.scroll.find(o,!0),f=d.offset(this.scroll);return l===0?f:d instanceof In?f+d.index(o,l):f+d.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Ka(a,s-a)}normalizeNative(e){if(!nd(this.root,e.startContainer)||!e.collapsed&&!nd(this.root,e.endContainer))return null;const n={start:{node:e.startContainer,offset:e.startOffset},end:{node:e.endContainer,offset:e.endOffset},native:e};return[n.start,n.end].forEach(r=>{let{node:s,offset:a}=r;for(;!(s instanceof Text)&&s.childNodes.length>0;)if(s.childNodes.length>a)s=s.childNodes[a],a=0;else if(s.childNodes.length===a)s=s.lastChild,s instanceof Text?a=s.data.length:s.childNodes.length>0?a=s.childNodes.length:a=s.childNodes.length+1;else break;r.node=s,r.offset=a}),n}rangeToNative(e){const n=this.scroll.length(),r=(s,a)=>{s=Math.min(n-1,s);const[i,o]=this.scroll.leaf(s);return i?i.position(o,a):[null,-1]};return[...r(e.index,!1),...r(e.index+e.length,!0)]}setNativeRange(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:n,a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!1;if(td.info("setNativeRange",e,n,r,s),e!=null&&(this.root.parentNode==null||e.parentNode==null||r.parentNode==null))return;const i=document.getSelection();if(i!=null)if(e!=null){this.hasFocus()||this.root.focus({preventScroll:!0});const{native:o}=this.getNativeRange()||{};if(o==null||a||e!==o.startContainer||n!==o.startOffset||r!==o.endContainer||s!==o.endOffset){e instanceof Element&&e.tagName==="BR"&&(n=Array.from(e.parentNode.childNodes).indexOf(e),e=e.parentNode),r instanceof Element&&r.tagName==="BR"&&(s=Array.from(r.parentNode.childNodes).indexOf(r),r=r.parentNode);const l=document.createRange();l.setStart(e,n),l.setEnd(r,s),i.removeAllRanges(),i.addRange(l)}}else i.removeAllRanges(),this.root.blur()}setRange(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oe.sources.API;if(typeof n=="string"&&(r=n,n=!1),td.info("setRange",e),e!=null){const s=this.rangeToNative(e);this.setNativeRange(...s,n)}else this.setNativeRange(null);this.update(r)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!Wh(n,this.lastRange)){if(!this.composing&&s!=null&&s.native.collapsed&&s.start.node!==this.cursor.textNode){const i=this.cursor.restore();i&&this.setNativeRange(i.startNode,i.startOffset,i.endNode,i.endOffset)}const a=[Oe.events.SELECTION_CHANGE,Si(this.lastRange),Si(n),e];this.emitter.emit(Oe.events.EDITOR_CHANGE,...a),e!==Oe.sources.SILENT&&this.emitter.emit(...a)}}}function nd(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const RL=/^[ -~]*$/;class DL{constructor(e){this.scroll=e,this.delta=this.getDelta()}applyDelta(e){this.scroll.update();let n=this.scroll.length();this.scroll.batchStart();const r=i1(e),s=new xe;return PL(r.ops.slice()).reduce((i,o)=>{const l=pr.Op.length(o);let d=o.attributes||{},f=!1,g=!1;if(o.insert!=null){if(s.retain(l),typeof o.insert=="string"){const v=o.insert;g=!v.endsWith(`
|
|
80
|
+
`)&&(n<=i||!!this.scroll.descendant(hr,i)[0]),this.scroll.insertAt(i,v);const[T,_]=this.scroll.line(i);let E=Js({},dr(T));if(T instanceof _n){const[O]=T.descendant(In,_);O&&(E=Js(E,dr(O)))}d=pr.AttributeMap.diff(E,d)||{}}else if(typeof o.insert=="object"){const v=Object.keys(o.insert)[0];if(v==null)return i;const T=this.scroll.query(v,Re.INLINE)!=null;if(T)(n<=i||this.scroll.descendant(hr,i)[0])&&(g=!0);else if(i>0){const[_,E]=this.scroll.descendant(In,i-1);_ instanceof kr?_.value()[E]!==`
|
|
81
|
+
`&&(f=!0):_ instanceof Qn&&_.statics.scope===Re.INLINE_BLOT&&(f=!0)}if(this.scroll.insertAt(i,v,o.insert[v]),T){const[_]=this.scroll.descendant(In,i);if(_){const E=Js({},dr(_));d=pr.AttributeMap.diff(E,d)||{}}}}n+=l}else if(s.push(o),o.retain!==null&&typeof o.retain=="object"){const v=Object.keys(o.retain)[0];if(v==null)return i;this.scroll.updateEmbedAt(i,v,o.retain[v])}Object.keys(d).forEach(v=>{this.scroll.formatAt(i,l,v,d[v])});const h=f?1:0,p=g?1:0;return n+=h+p,s.retain(h),s.delete(p),i+l+h+p},0),s.reduce((i,o)=>typeof o.delete=="number"?(this.scroll.deleteAt(i,o.delete),i):i+pr.Op.length(o),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new xe().retain(e).delete(n))}formatLine(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.scroll.update(),Object.keys(r).forEach(a=>{this.scroll.lines(e,Math.max(n,1)).forEach(i=>{i.format(a,r[a])})}),this.scroll.optimize();const s=new xe().retain(e).retain(n,Si(r));return this.update(s)}formatText(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};Object.keys(r).forEach(a=>{this.scroll.formatAt(e,n,a,r[a])});const s=new xe().retain(e).retain(n,Si(r));return this.update(s)}getContents(e,n){return this.delta.slice(e,e+n)}getDelta(){return this.scroll.lines().reduce((e,n)=>e.concat(n.delta()),new xe)}getFormat(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];n===0?this.scroll.path(e).forEach(o=>{const[l]=o;l instanceof _n?r.push(l):l instanceof In&&s.push(l)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(In,e,n));const[a,i]=[r,s].map(o=>{const l=o.shift();if(l==null)return{};let d=dr(l);for(;Object.keys(d).length>0;){const f=o.shift();if(f==null)return d;d=kL(dr(f),d)}return d});return{...a,...i}}getHTML(e,n){const[r,s]=this.scroll.line(e);if(r){const a=r.length();return r.length()>=s+n&&!(s===0&&n===a)?Zo(r,s,n,!0):Zo(this.scroll,e,n,!0)}return""}getText(e,n){return this.getContents(e,n).filter(r=>typeof r.insert=="string").map(r=>r.insert).join("")}insertContents(e,n){const r=i1(n),s=new xe().retain(e).concat(r);return this.scroll.insertContents(e,r),this.update(s)}insertEmbed(e,n,r){return this.scroll.insertAt(e,n,r),this.update(new xe().retain(e).insert({[n]:r}))}insertText(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return n=n.replace(/\r\n/g,`
|
|
85
82
|
`).replace(/\r/g,`
|
|
86
|
-
`),this.scroll.insertAt(e,n),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,n.length,s,r[s])}),this.update(new xe().retain(e).insert(n,Si(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==
|
|
87
|
-
`));const d=this.getContents(e,n+i).diff(new xe().insert(r).concat(o)),
|
|
83
|
+
`),this.scroll.insertAt(e,n),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,n.length,s,r[s])}),this.update(new xe().retain(e).insert(n,Si(r)))}isBlank(){if(this.scroll.children.length===0)return!0;if(this.scroll.children.length>1)return!1;const e=this.scroll.children.head;if((e==null?void 0:e.statics.blotName)!==_n.blotName)return!1;const n=e;return n.children.length>1?!1:n.children.head instanceof Fr}removeFormat(e,n){const r=this.getText(e,n),[s,a]=this.scroll.line(e+n);let i=0,o=new xe;s!=null&&(i=s.length()-a,o=s.delta().slice(a,a+i-1).insert(`
|
|
84
|
+
`));const d=this.getContents(e,n+i).diff(new xe().insert(r).concat(o)),f=new xe().retain(e).concat(d);return this.applyDelta(f)}update(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:void 0;const s=this.delta;if(n.length===1&&n[0].type==="characterData"&&n[0].target.data.match(RL)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=dr(a),o=a.offset(this.scroll),l=n[0].oldValue.replace(Ki.CONTENTS,""),d=new xe().insert(l),f=new xe().insert(a.value()),g=r&&{oldRange:o1(r.oldRange,-o),newRange:o1(r.newRange,-o)};e=new xe().retain(o).concat(d.diff(f,g)).reduce((p,v)=>v.insert?p.insert(v.insert,i):p.push(v),new xe),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!Wh(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function gi(t,e,n){if(t.length===0){const[p]=rd(n.pop());return e<=0?`</li></${p}>`:`</li></${p}>${gi([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:o},...l]=t,[d,f]=rd(o);if(i>e)return n.push(o),i===e+1?`<${d}><li${f}>${Zo(r,s,a)}${gi(l,i,n)}`:`<${d}><li>${gi(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&o===g)return`</li><li${f}>${Zo(r,s,a)}${gi(l,i,n)}`;const[h]=rd(n.pop());return`</li></${h}>${gi(t,e-1,n)}`}function Zo(t,e,n){let r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if("html"in t&&typeof t.html=="function")return t.html(e,n);if(t instanceof kr)return dc(t.value().slice(e,e+n)).replaceAll(" "," ");if(t instanceof Rr){if(t.statics.blotName==="list-container"){const d=[];return t.children.forEachAt(e,n,(f,g,h)=>{const p="formats"in f&&typeof f.formats=="function"?f.formats():{};d.push({child:f,offset:g,length:h,indent:p.indent||0,type:p.list})}),gi(d,-1,[])}const s=[];if(t.children.forEachAt(e,n,(d,f,g)=>{s.push(Zo(d,f,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[o,l]=a.split(`>${i}<`);return o==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${l}`:`${o}>${s.join("")}<${l}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function kL(t,e){return Object.keys(e).reduce((n,r)=>{if(t[r]==null)return n;const s=e[r];return s===t[r]?n[r]=s:Array.isArray(s)?s.indexOf(t[r])<0?n[r]=s.concat([t[r]]):n[r]=s:n[r]=[s,t[r]],n},{})}function rd(t){const e=t==="ordered"?"ol":"ul";switch(t){case"checked":return[e,' data-list="checked"'];case"unchecked":return[e,' data-list="unchecked"'];default:return[e,""]}}function i1(t){return t.reduce((e,n)=>{if(typeof n.insert=="string"){const r=n.insert.replace(/\r\n/g,`
|
|
88
85
|
`).replace(/\r/g,`
|
|
89
|
-
`);return e.insert(r,n.attributes)}return e.push(n)},new xe)}function
|
|
86
|
+
`);return e.insert(r,n.attributes)}return e.push(n)},new xe)}function o1(t,e){let{index:n,length:r}=t;return new Ka(n+e,r)}function PL(t){const e=[];return t.forEach(n=>{typeof n.insert=="string"?n.insert.split(`
|
|
90
87
|
`).forEach((s,a)=>{a&&e.push({insert:`
|
|
91
|
-
`,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Ur{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}ye(Ur,"DEFAULTS",{});const Wu="\uFEFF";class
|
|
92
|
-
`});this.setContents(i)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,n),e}blur(){this.selection.setRange(null)}deleteText(e,n,r){return[e,n,,r]=fs(e,n,r),_r.call(this,()=>this.editor.deleteText(e,n),r,e,-1*n)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const n=e();return this.allowReadOnlyEdits=!1,n}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:
|
|
88
|
+
`,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Ur{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}ye(Ur,"DEFAULTS",{});const Wu="\uFEFF";class Vh extends Qn{constructor(e,n){super(e,n),this.contentNode=document.createElement("span"),this.contentNode.setAttribute("contenteditable","false"),Array.from(this.domNode.childNodes).forEach(r=>{this.contentNode.appendChild(r)}),this.leftGuard=document.createTextNode(Wu),this.rightGuard=document.createTextNode(Wu),this.domNode.appendChild(this.leftGuard),this.domNode.appendChild(this.contentNode),this.domNode.appendChild(this.rightGuard)}index(e,n){return e===this.leftGuard?0:e===this.rightGuard?1:super.index(e,n)}restore(e){let n=null,r;const s=e.data.split(Wu).join("");if(e===this.leftGuard)if(this.prev instanceof kr){const a=this.prev.length();this.prev.insertAt(a,s),n={startNode:this.prev.domNode,startOffset:a+s.length}}else r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this),n={startNode:r,startOffset:s.length};else e===this.rightGuard&&(this.next instanceof kr?(this.next.insertAt(0,s),n={startNode:this.next.domNode,startOffset:s.length}):(r=document.createTextNode(s),this.parent.insertBefore(this.scroll.create(r),this.next),n={startNode:r,startOffset:s.length}));return e.data=Wu,n}update(e,n){e.forEach(r=>{if(r.type==="characterData"&&(r.target===this.leftGuard||r.target===this.rightGuard)){const s=this.restore(r.target);s&&(n.range=s)}})}}class ML{constructor(e,n){ye(this,"isComposing",!1);this.scroll=e,this.emitter=n,this.setupListeners()}setupListeners(){this.scroll.domNode.addEventListener("compositionstart",e=>{this.isComposing||this.handleCompositionStart(e)}),this.scroll.domNode.addEventListener("compositionend",e=>{this.isComposing&&queueMicrotask(()=>{this.handleCompositionEnd(e)})})}handleCompositionStart(e){const n=e.target instanceof Node?this.scroll.find(e.target,!0):null;n&&!(n instanceof Vh)&&(this.emitter.emit(Oe.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Oe.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Oe.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Oe.events.COMPOSITION_END,e),this.isComposing=!1}}const Uo=class Uo{constructor(e,n){ye(this,"modules",{});this.quill=e,this.options=n}init(){Object.keys(this.options.modules).forEach(e=>{this.modules[e]==null&&this.addModule(e)})}addModule(e){const n=this.quill.constructor.import(`modules/${e}`);return this.modules[e]=new n(this.quill,this.options.modules[e]||{}),this.modules[e]}};ye(Uo,"DEFAULTS",{modules:{}}),ye(Uo,"themes",{default:Uo});let Vi=Uo;const BL=t=>t.parentElement||t.getRootNode().host||null,FL=t=>{const e=t.getBoundingClientRect(),n="offsetWidth"in t&&Math.abs(e.width)/t.offsetWidth||1,r="offsetHeight"in t&&Math.abs(e.height)/t.offsetHeight||1;return{top:e.top,right:e.left+t.clientWidth*n,bottom:e.top+t.clientHeight*r,left:e.left}},Gu=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},u1=(t,e,n,r,s,a)=>t<n&&e>r?0:t<n?-(n-t+s):e>r?e-t>r-n?t+s-n:e-r+a:0,UL=(t,e)=>{var a,i,o;const n=t.ownerDocument;let r=e,s=t;for(;s;){const l=s===n.body,d=l?{top:0,right:((a=window.visualViewport)==null?void 0:a.width)??n.documentElement.clientWidth,bottom:((i=window.visualViewport)==null?void 0:i.height)??n.documentElement.clientHeight,left:0}:FL(s),f=getComputedStyle(s),g=u1(r.left,r.right,d.left,d.right,Gu(f.scrollPaddingLeft),Gu(f.scrollPaddingRight)),h=u1(r.top,r.bottom,d.top,d.bottom,Gu(f.scrollPaddingTop),Gu(f.scrollPaddingBottom));if(g||h)if(l)(o=n.defaultView)==null||o.scrollBy(g,h);else{const{scrollLeft:p,scrollTop:v}=s;h&&(s.scrollTop+=h),g&&(s.scrollLeft+=g);const T=s.scrollLeft-p,_=s.scrollTop-v;r={left:r.left-T,top:r.top-_,right:r.right-T,bottom:r.bottom-_}}s=l||f.position==="fixed"?null:BL(s)}},HL=100,qL=["block","break","cursor","inline","scroll","text"],jL=(t,e,n)=>{const r=new Gi;return qL.forEach(s=>{const a=e.query(s);a&&r.register(a)}),t.forEach(s=>{let a=e.query(s);a||n.error(`Cannot register "${s}" specified in "formats" config. Are you sure it was registered?`);let i=0;for(;a;)if(r.register(a),a="blotName"in a?a.requiredContainer??null:null,i+=1,i>HL){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},Ii=Ls("quill"),Ku=new Gi;Rr.uiClass="ql-ui";const Ar=class Ar{static debug(e){e===!0&&(e="log"),Ls.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Lf.get(e)||Ku.find(e,n)}static import(e){return this.imports[e]==null&&Ii.error(`Cannot import ${e}. Are you sure it was registered?`),this.imports[e]}static register(){if(typeof(arguments.length<=0?void 0:arguments[0])!="string"){const e=arguments.length<=0?void 0:arguments[0],n=!!(!(arguments.length<=1)&&arguments[1]),r="attrName"in e?e.attrName:e.blotName;typeof r=="string"?this.register(`formats/${r}`,e,n):Object.keys(e).forEach(s=>{this.register(s,e[s],n)})}else{const e=arguments.length<=0?void 0:arguments[0],n=arguments.length<=1?void 0:arguments[1],r=!!(!(arguments.length<=2)&&arguments[2]);this.imports[e]!=null&&!r&&Ii.warn(`Overwriting ${e} with`,n),this.imports[e]=n,(e.startsWith("blots/")||e.startsWith("formats/"))&&n&&typeof n!="boolean"&&n.blotName!=="abstract"&&Ku.register(n),typeof n.register=="function"&&n.register(Ku)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=$L(e,n),this.container=this.options.container,this.container==null){Ii.error("Invalid Quill container",e);return}this.options.debug&&Ar.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",Lf.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Oe;const s=Kh.blotName,a=this.options.registry.query(s);if(!a||!("blotName"in a))throw new Error(`Cannot initialize Quill without "${s}" blot`);if(this.scroll=new a(this.options.registry,this.root,{emitter:this.emitter}),this.editor=new DL(this.scroll),this.selection=new xL(this.scroll,this.emitter),this.composition=new ML(this.scroll,this.emitter),this.theme=new this.options.theme(this,this.options),this.keyboard=this.theme.addModule("keyboard"),this.clipboard=this.theme.addModule("clipboard"),this.history=this.theme.addModule("history"),this.uploader=this.theme.addModule("uploader"),this.theme.addModule("input"),this.theme.addModule("uiNode"),this.theme.init(),this.emitter.on(Oe.events.EDITOR_CHANGE,i=>{i===Oe.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Oe.events.SCROLL_UPDATE,(i,o)=>{const l=this.selection.lastRange,[d]=this.selection.getRange(),f=l&&d?{oldRange:l,newRange:d}:void 0;_r.call(this,()=>this.editor.update(null,o,f),i)}),this.emitter.on(Oe.events.SCROLL_EMBED_UPDATE,(i,o)=>{const l=this.selection.lastRange,[d]=this.selection.getRange(),f=l&&d?{oldRange:l,newRange:d}:void 0;_r.call(this,()=>{const g=new xe().retain(i.offset(this)).retain({[i.statics.blotName]:o});return this.editor.update(g,[],f)},Ar.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
|
|
89
|
+
`});this.setContents(i)}this.history.clear(),this.options.placeholder&&this.root.setAttribute("data-placeholder",this.options.placeholder),this.options.readOnly&&this.disable(),this.allowReadOnlyEdits=!1}addContainer(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(typeof e=="string"){const r=e;e=document.createElement("div"),e.classList.add(r)}return this.container.insertBefore(e,n),e}blur(){this.selection.setRange(null)}deleteText(e,n,r){return[e,n,,r]=fs(e,n,r),_r.call(this,()=>this.editor.deleteText(e,n),r,e,-1*n)}disable(){this.enable(!1)}editReadOnly(e){this.allowReadOnlyEdits=!0;const n=e();return this.allowReadOnlyEdits=!1,n}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.scroll.enable(e),this.container.classList.toggle("ql-disabled",!e)}focus(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};this.selection.focus(),e.preventScroll||this.scrollSelectionIntoView()}format(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Oe.sources.API;return _r.call(this,()=>{const s=this.getSelection(!0);let a=new xe;if(s==null)return a;if(this.scroll.query(e,Re.BLOCK))a=this.editor.formatLine(s.index,s.length,{[e]:n});else{if(s.length===0)return this.selection.format(e,n),a;a=this.editor.formatText(s.index,s.length,{[e]:n})}return this.setSelection(s,Oe.sources.SILENT),a},r)}formatLine(e,n,r,s,a){let i;return[e,n,i,a]=fs(e,n,r,s,a),_r.call(this,()=>this.editor.formatLine(e,n,i),a,e,0)}formatText(e,n,r,s,a){let i;return[e,n,i,a]=fs(e,n,r,s,a),_r.call(this,()=>this.editor.formatText(e,n,i),a,e,0)}getBounds(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=null;if(typeof e=="number"?r=this.selection.getBounds(e,n):r=this.selection.getBounds(e.index,e.length),!r)return null;const s=this.container.getBoundingClientRect();return{bottom:r.bottom-s.top,height:r.height,left:r.left-s.left,right:r.right-s.left,top:r.top-s.top,width:r.width}}getContents(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.getLength()-e;return[e,n]=fs(e,n),this.editor.getContents(e,n)}getFormat(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.getSelection(!0),n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return typeof e=="number"?this.editor.getFormat(e,n):this.editor.getFormat(e.index,e.length)}getIndex(e){return e.offset(this.scroll)}getLength(){return this.scroll.length()}getLeaf(e){return this.scroll.leaf(e)}getLine(e){return this.scroll.line(e)}getLines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;return typeof e!="number"?this.scroll.lines(e.index,e.length):this.scroll.lines(e,n)}getModule(e){return this.theme.modules[e]}getSelection(){return(arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1)&&this.focus(),this.update(),this.selection.getRange()[0]}getSemanticHTML(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(n=n??this.getLength()-e),[e,n]=fs(e,n),this.editor.getHTML(e,n)}getText(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1?arguments[1]:void 0;return typeof e=="number"&&(n=n??this.getLength()-e),[e,n]=fs(e,n),this.editor.getText(e,n)}hasFocus(){return this.selection.hasFocus()}insertEmbed(e,n,r){let s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ar.sources.API;return _r.call(this,()=>this.editor.insertEmbed(e,n,r),s,e)}insertText(e,n,r,s,a){let i;return[e,,i,a]=fs(e,0,r,s,a),_r.call(this,()=>this.editor.insertText(e,n,i),a,e,n.length)}isEnabled(){return this.scroll.isEnabled()}off(){return this.emitter.off(...arguments)}on(){return this.emitter.on(...arguments)}once(){return this.emitter.once(...arguments)}removeFormat(e,n,r){return[e,n,,r]=fs(e,n,r),_r.call(this,()=>this.editor.removeFormat(e,n),r,e)}scrollRectIntoView(e){UL(this.root,e)}scrollIntoView(){console.warn("Quill#scrollIntoView() has been deprecated and will be removed in the near future. Please use Quill#scrollSelectionIntoView() instead."),this.scrollSelectionIntoView()}scrollSelectionIntoView(){const e=this.selection.lastRange,n=e&&this.selection.getBounds(e.index,e.length);n&&this.scrollRectIntoView(n)}setContents(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;return _r.call(this,()=>{e=new xe(e);const r=this.getLength(),s=this.editor.deleteText(0,r),a=this.editor.insertContents(0,e),i=this.editor.deleteText(this.getLength()-1,1);return s.compose(a).compose(i)},n)}setSelection(e,n,r){e==null?this.selection.setRange(null,n||Ar.sources.API):([e,n,,r]=fs(e,n,r),this.selection.setRange(new Ka(Math.max(0,e),n),r),r!==Oe.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;const r=new xe().insert(e);return this.setContents(r,n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Oe.sources.USER;const n=this.scroll.update(e);return this.selection.update(e),n}updateContents(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Oe.sources.API;return _r.call(this,()=>(e=new xe(e),this.editor.applyDelta(e)),n,!0)}};ye(Ar,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:Ku,theme:"default"}),ye(Ar,"events",Oe.events),ye(Ar,"sources",Oe.sources),ye(Ar,"version","2.0.3"),ye(Ar,"imports",{delta:xe,parchment:TL,"core/module":Ur,"core/theme":Vi});let le=Ar;function l1(t){return typeof t=="string"?document.querySelector(t):t}function sd(t){return Object.entries(t??{}).reduce((e,n)=>{let[r,s]=n;return{...e,[r]:s===!0?{}:s}},{})}function c1(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function $L(t,e){const n=l1(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===le.DEFAULTS.theme?Vi:le.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=le.DEFAULTS,{modules:o,...l}=s.DEFAULTS;let d=sd(e.modules);d!=null&&d.toolbar&&d.toolbar.constructor!==Object&&(d={...d,toolbar:{container:d.toolbar}});const f=Js({},sd(a),sd(o),d),g={...i,...c1(l),...c1(e)};let h=e.registry;return h?e.formats&&Ii.warn('Ignoring "formats" option because "registry" is specified'):h=e.formats?jL(e.formats,g.registry,Ii):g.registry,{...g,registry:h,container:n,theme:s,modules:Object.entries(f).reduce((p,v)=>{let[T,_]=v;if(!_)return p;const E=le.import(`modules/${T}`);return E==null?(Ii.error(`Cannot load ${T} module. Are you sure you registered it?`),p):{...p,[T]:Js({},E.DEFAULTS||{},_)}},{}),bounds:l1(g.bounds)}}function _r(t,e,n,r){if(!this.isEnabled()&&e===Oe.sources.USER&&!this.allowReadOnlyEdits)return new xe;let s=n==null?null:this.getSelection();const a=this.editor.delta,i=t();if(s!=null&&(n===!0&&(n=s.index),r==null?s=d1(s,i,e):r!==0&&(s=d1(s,n,r,e)),this.setSelection(s,Oe.sources.SILENT)),i.length()>0){const o=[Oe.events.TEXT_CHANGE,i,a,e];this.emitter.emit(Oe.events.EDITOR_CHANGE,...o),e!==Oe.sources.SILENT&&this.emitter.emit(...o)}return i}function fs(t,e,n,r,s){let a={};return typeof t.index=="number"&&typeof t.length=="number"?typeof e!="number"?(s=r,r=n,n=e,e=t.length,t=t.index):(e=t.length,t=t.index):typeof e!="number"&&(s=r,r=n,n=e,e=0),typeof n=="object"?(a=n,s=r):typeof n=="string"&&(r!=null?a[n]=r:s=n),s=s||Oe.sources.API,[t,e,a,s]}function d1(t,e,n,r){const s=typeof n=="number"?n:0;if(t==null)return null;let a,i;return e&&typeof e.transformPosition=="function"?[a,i]=[t.index,t.index+t.length].map(o=>e.transformPosition(o,r!==Oe.sources.USER)):[a,i]=[t.index,t.index+t.length].map(o=>o<e||o===e&&r===Oe.sources.USER?o:s>=0?o+s:Math.max(e,o+s)),new Ka(a,i-a)}class ri extends cc{}function f1(t){return t instanceof _n||t instanceof hr}function h1(t){return typeof t.updateContent=="function"}class vi extends Kh{constructor(e,n,r){let{emitter:s}=r;super(e,n),this.emitter=s,this.batch=!1,this.optimize(),this.enable(),this.domNode.addEventListener("dragstart",a=>this.handleDragStart(a))}batchStart(){Array.isArray(this.batch)||(this.batch=[])}batchEnd(){if(!this.batch)return;const e=this.batch;this.batch=!1,this.update(e)}emitMount(e){this.emitter.emit(Oe.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Oe.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(Oe.events.SCROLL_EMBED_UPDATE,e,n)}deleteAt(e,n){const[r,s]=this.line(e),[a]=this.line(e+n);if(super.deleteAt(e,n),a!=null&&r!==a&&s>0){if(r instanceof hr||a instanceof hr){this.optimize();return}const i=a.children.head instanceof Fr?null:a.children.head;r.moveChildren(a,i),r.remove()}this.optimize()}enable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!0;this.domNode.setAttribute("contenteditable",e?"true":"false")}formatAt(e,n,r,s){super.formatAt(e,n,r,s),this.optimize()}insertAt(e,n,r){if(e>=this.length())if(r==null||this.scroll.query(n,Re.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
|
|
93
90
|
`)?s.insertAt(0,n.slice(0,-1),r):s.insertAt(0,n,r)}else{const s=this.scroll.create(n,r);this.appendChild(s)}else super.insertAt(e,n,r);this.optimize()}insertBefore(e,n){if(e.statics.scope===Re.INLINE_BLOT){const r=this.scroll.create(this.statics.defaultChild.blotName);r.appendChild(e),super.insertBefore(r,n)}else super.insertBefore(e,n)}insertContents(e,n){const r=this.deltaToRenderBlocks(n.concat(new xe().insert(`
|
|
94
|
-
`))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const l=a.type==="block"&&(a.delta.length()===0||!this.descendant(
|
|
95
|
-
`);const
|
|
96
|
-
`);i.slice(0,-1).forEach(l=>{r.insert(l,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new xe});const o=i[i.length-1];o&&r.insert(o,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,Re.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new xe,n.push({type:"blockEmbed",key:i,value:a[i],attributes:s.attributes??{}}))}}),r.length()&&n.push({type:"block",delta:r,attributes:{}}),n}createBlock(e,n){let r;const s={};Object.entries(e).forEach(o=>{let[l,d]=o;this.query(l,Re.BLOCK&Re.BLOT)!=null?r=l:s[l]=d});const a=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(a,n||void 0);const i=a.length();return Object.entries(s).forEach(o=>{let[l,d]=o;a.formatAt(0,i,l,d)}),a}}ye(vi,"blotName","scroll"),ye(vi,"className","ql-editor"),ye(vi,"tagName","DIV"),ye(vi,"defaultChild",
|
|
91
|
+
`))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const l=a.type==="block"&&(a.delta.length()===0||!this.descendant(hr,e)[0]&&e<this.length()),d=a.type==="block"?a.delta:new xe().insert({[a.key]:a.value});ad(this,e,d);const f=a.type==="block"?1:0,g=e+d.length()+f;l&&this.insertAt(g-1,`
|
|
92
|
+
`);const h=dr(this.line(e)[0]),p=pr.AttributeMap.diff(h,a.attributes)||{};Object.keys(p).forEach(v=>{this.formatAt(g-1,1,v,p[v])}),e=g}let[i,o]=this.children.find(e);if(r.length&&(i&&(i=i.split(o),o=0),r.forEach(l=>{if(l.type==="block"){const d=this.createBlock(l.attributes,i||void 0);ad(d,0,l.delta)}else{const d=this.create(l.key,l.value);this.insertBefore(d,i||void 0),Object.keys(l.attributes).forEach(f=>{d.format(f,l.attributes[f])})}})),s.type==="block"&&s.delta.length()){const l=i?i.offset(i.scroll)+o:this.length();ad(this,l,s.delta)}this.batchEnd(),this.optimize()}isEnabled(){return this.domNode.getAttribute("contenteditable")==="true"}leaf(e){const n=this.path(e).pop();if(!n)return[null,-1];const[r,s]=n;return r instanceof In?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(f1,e)}lines(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Number.MAX_VALUE;const r=(s,a,i)=>{let o=[],l=i;return s.children.forEachAt(a,i,(d,f,g)=>{f1(d)?o.push(d):d instanceof cc&&(o=o.concat(r(d,f,l))),l-=g}),o};return r(this,e,n)}optimize(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.batch||(super.optimize(e,n),e.length>0&&this.emitter.emit(Oe.events.SCROLL_OPTIMIZE,e,n))}path(e){return super.path(e).slice(1)}remove(){}update(e){if(this.batch){Array.isArray(e)&&(this.batch=this.batch.concat(e));return}let n=Oe.sources.USER;typeof e=="string"&&(n=e),Array.isArray(e)||(e=this.observer.takeRecords()),e=e.filter(r=>{let{target:s}=r;const a=this.find(s,!0);return a&&!h1(a)}),e.length>0&&this.emitter.emit(Oe.events.SCROLL_BEFORE_UPDATE,n,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Oe.events.SCROLL_UPDATE,n,e)}updateEmbedAt(e,n,r){const[s]=this.descendant(a=>a instanceof hr,e);s&&s.statics.blotName===n&&h1(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const n=[];let r=new xe;return e.forEach(s=>{const a=s==null?void 0:s.insert;if(a)if(typeof a=="string"){const i=a.split(`
|
|
93
|
+
`);i.slice(0,-1).forEach(l=>{r.insert(l,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new xe});const o=i[i.length-1];o&&r.insert(o,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,Re.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new xe,n.push({type:"blockEmbed",key:i,value:a[i],attributes:s.attributes??{}}))}}),r.length()&&n.push({type:"block",delta:r,attributes:{}}),n}createBlock(e,n){let r;const s={};Object.entries(e).forEach(o=>{let[l,d]=o;this.query(l,Re.BLOCK&Re.BLOT)!=null?r=l:s[l]=d});const a=this.create(r||this.statics.defaultChild.blotName,r?e[r]:void 0);this.insertBefore(a,n||void 0);const i=a.length();return Object.entries(s).forEach(o=>{let[l,d]=o;a.formatAt(0,i,l,d)}),a}}ye(vi,"blotName","scroll"),ye(vi,"className","ql-editor"),ye(vi,"tagName","DIV"),ye(vi,"defaultChild",_n),ye(vi,"allowedChildren",[_n,hr,ri]);function ad(t,e,n){n.reduce((r,s)=>{const a=pr.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const o=s.insert;t.insertAt(r,o);const[l]=t.descendant(In,r),d=dr(l);i=pr.AttributeMap.diff(d,i)||{}}else if(typeof s.insert=="object"){const o=Object.keys(s.insert)[0];if(o==null)return r;if(t.insertAt(r,o,s.insert[o]),t.scroll.query(o,Re.INLINE)!=null){const[d]=t.descendant(In,r),f=dr(d);i=pr.AttributeMap.diff(f,i)||{}}}}return Object.keys(i).forEach(o=>{t.formatAt(r,a,o,i[o])}),r+a},e)}const Xh={scope:Re.BLOCK,whitelist:["right","center","justify"]},YL=new ss("align","align",Xh),ib=new Br("align","ql-align",Xh),ob=new oa("align","text-align",Xh);class ub extends oa{value(e){let n=super.value(e);return n.startsWith("rgb(")?(n=n.replace(/^[^\d]+/,"").replace(/[^\d]+$/,""),`#${n.split(",").map(s=>`00${parseInt(s,10).toString(16)}`.slice(-2)).join("")}`):n}}const zL=new Br("color","ql-color",{scope:Re.INLINE}),Qh=new ub("color","color",{scope:Re.INLINE}),WL=new Br("background","ql-bg",{scope:Re.INLINE}),Zh=new ub("background","background-color",{scope:Re.INLINE});class si extends ri{static create(e){const n=super.create(e);return n.setAttribute("spellcheck","false"),n}code(e,n){return this.children.map(r=>r.length()<=1?"":r.domNode.innerText).join(`
|
|
97
94
|
`).slice(e,e+n)}html(e,n){return`<pre>
|
|
98
|
-
${
|
|
99
|
-
</pre>`}}class
|
|
100
|
-
`,r);this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(e.index+1,le.sources.SILENT),this.quill.focus()}}const
|
|
95
|
+
${dc(this.code(e,n))}
|
|
96
|
+
</pre>`}}class Cn extends _n{static register(){le.register(si)}}ye(Cn,"TAB"," ");class Jh extends as{}Jh.blotName="code";Jh.tagName="CODE";Cn.blotName="code-block";Cn.className="ql-code-block";Cn.tagName="DIV";si.blotName="code-block-container";si.className="ql-code-block-container";si.tagName="DIV";si.allowedChildren=[Cn];Cn.allowedChildren=[kr,Fr,Ki];Cn.requiredContainer=si;const e0={scope:Re.BLOCK,whitelist:["rtl"]},lb=new ss("direction","dir",e0),cb=new Br("direction","ql-direction",e0),db=new oa("direction","direction",e0),fb={scope:Re.INLINE,whitelist:["serif","monospace"]},hb=new Br("font","ql-font",fb);class GL extends oa{value(e){return super.value(e).replace(/["']/g,"")}}const pb=new GL("font","font-family",fb),mb=new Br("size","ql-size",{scope:Re.INLINE,whitelist:["small","large","huge"]}),gb=new oa("size","font-size",{scope:Re.INLINE,whitelist:["10px","18px","32px"]}),KL=Ls("quill:keyboard"),VL=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class fc extends Ur{static match(e,n){return["altKey","ctrlKey","metaKey","shiftKey"].some(r=>!!n[r]!==e[r]&&n[r]!==null)?!1:n.key===e.key||n.key===e.which}constructor(e,n){super(e,n),this.bindings={},Object.keys(this.options.bindings).forEach(r=>{this.options.bindings[r]&&this.addBinding(this.options.bindings[r])}),this.addBinding({key:"Enter",shiftKey:null},this.handleEnter),this.addBinding({key:"Enter",metaKey:null,ctrlKey:null,altKey:null},()=>{}),/Firefox/i.test(navigator.userAgent)?(this.addBinding({key:"Backspace"},{collapsed:!0},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0},this.handleDelete)):(this.addBinding({key:"Backspace"},{collapsed:!0,prefix:/^.?$/},this.handleBackspace),this.addBinding({key:"Delete"},{collapsed:!0,suffix:/^.?$/},this.handleDelete)),this.addBinding({key:"Backspace"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Delete"},{collapsed:!1},this.handleDeleteRange),this.addBinding({key:"Backspace",altKey:null,ctrlKey:null,metaKey:null,shiftKey:null},{collapsed:!0,offset:0},this.handleBackspace),this.listen()}addBinding(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};const s=QL(e);if(s==null){KL.warn("Attempted to add invalid keyboard binding",s);return}typeof n=="function"&&(n={handler:n}),typeof r=="function"&&(r={handler:r}),(Array.isArray(s.key)?s.key:[s.key]).forEach(i=>{const o={...s,key:i,...n,...r};this.bindings[o.key]=this.bindings[o.key]||[],this.bindings[o.key].push(o)})}listen(){this.quill.root.addEventListener("keydown",e=>{if(e.defaultPrevented||e.isComposing||e.keyCode===229&&(e.key==="Enter"||e.key==="Backspace"))return;const s=(this.bindings[e.key]||[]).concat(this.bindings[e.which]||[]).filter(E=>fc.match(e,E));if(s.length===0)return;const a=le.find(e.target,!0);if(a&&a.scroll!==this.quill.scroll)return;const i=this.quill.getSelection();if(i==null||!this.quill.hasFocus())return;const[o,l]=this.quill.getLine(i.index),[d,f]=this.quill.getLeaf(i.index),[g,h]=i.length===0?[d,f]:this.quill.getLeaf(i.index+i.length),p=d instanceof Pl?d.value().slice(0,f):"",v=g instanceof Pl?g.value().slice(h):"",T={collapsed:i.length===0,empty:i.length===0&&o.length()<=1,format:this.quill.getFormat(i),line:o,offset:l,prefix:p,suffix:v,event:e};s.some(E=>{if(E.collapsed!=null&&E.collapsed!==T.collapsed||E.empty!=null&&E.empty!==T.empty||E.offset!=null&&E.offset!==T.offset)return!1;if(Array.isArray(E.format)){if(E.format.every(O=>T.format[O]==null))return!1}else if(typeof E.format=="object"&&!Object.keys(E.format).every(O=>E.format[O]===!0?T.format[O]!=null:E.format[O]===!1?T.format[O]==null:Wh(E.format[O],T.format[O])))return!1;return E.prefix!=null&&!E.prefix.test(T.prefix)||E.suffix!=null&&!E.suffix.test(T.suffix)?!1:E.handler.call(this,i,T,E)!==!0})&&e.preventDefault()})}handleBackspace(e,n){const r=/[\uD800-\uDBFF][\uDC00-\uDFFF]$/.test(n.prefix)?2:1;if(e.index===0||this.quill.getLength()<=1)return;let s={};const[a]=this.quill.getLine(e.index);let i=new xe().retain(e.index-r).delete(r);if(n.offset===0){const[o]=this.quill.getLine(e.index-1);if(o&&!(o.statics.blotName==="block"&&o.length()<=1)){const d=a.formats(),f=this.quill.getFormat(e.index-1,1);if(s=pr.AttributeMap.diff(d,f)||{},Object.keys(s).length>0){const g=new xe().retain(e.index+a.length()-2).retain(1,s);i=i.compose(g)}}}this.quill.updateContents(i,le.sources.USER),this.quill.focus()}handleDelete(e,n){const r=/^[\uD800-\uDBFF][\uDC00-\uDFFF]/.test(n.suffix)?2:1;if(e.index>=this.quill.getLength()-r)return;let s={};const[a]=this.quill.getLine(e.index);let i=new xe().retain(e.index).delete(r);if(n.offset>=a.length()-1){const[o]=this.quill.getLine(e.index+1);if(o){const l=a.formats(),d=this.quill.getFormat(e.index,1);s=pr.AttributeMap.diff(l,d)||{},Object.keys(s).length>0&&(i=i.retain(o.length()-1).retain(1,s))}}this.quill.updateContents(i,le.sources.USER),this.quill.focus()}handleDeleteRange(e){t0({range:e,quill:this.quill}),this.quill.focus()}handleEnter(e,n){const r=Object.keys(n.format).reduce((a,i)=>(this.quill.scroll.query(i,Re.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new xe().retain(e.index).delete(e.length).insert(`
|
|
97
|
+
`,r);this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(e.index+1,le.sources.SILENT),this.quill.focus()}}const XL={bindings:{bold:id("bold"),italic:id("italic"),underline:id("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",le.sources.USER),!1)}},outdent:{key:"Tab",shiftKey:!0,format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","-1",le.sources.USER),!1)}},"outdent backspace":{key:"Backspace",collapsed:!0,shiftKey:null,metaKey:null,ctrlKey:null,altKey:null,format:["indent","list"],offset:0,handler(t,e){e.format.indent!=null?this.quill.format("indent","-1",le.sources.USER):e.format.list!=null&&this.quill.format("list",!1,le.sources.USER)}},"indent code-block":p1(!0),"outdent code-block":p1(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,le.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const n=new xe().retain(t.index).delete(t.length).insert(" ");return this.quill.updateContents(n,le.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,le.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,le.sources.USER)}},"list empty enter":{key:"Enter",collapsed:!0,format:["list"],empty:!0,handler(t,e){const n={list:!1};e.format.indent&&(n.indent=!1),this.quill.formatLine(t.index,t.length,n,le.sources.USER)}},"checklist enter":{key:"Enter",collapsed:!0,format:{list:"checked"},handler(t){const[e,n]=this.quill.getLine(t.index),r={...e.formats(),list:"checked"},s=new xe().retain(t.index).insert(`
|
|
101
98
|
`,r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(t.index+1,le.sources.SILENT),this.quill.scrollSelectionIntoView()}},"header enter":{key:"Enter",collapsed:!0,format:["header"],suffix:/^$/,handler(t,e){const[n,r]=this.quill.getLine(t.index),s=new xe().retain(t.index).insert(`
|
|
102
|
-
`,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(t.index+1,le.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){const[n,r,s,a]=e.getTable(t),i=
|
|
99
|
+
`,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(t.index+1,le.sources.SILENT),this.quill.scrollSelectionIntoView()}},"table backspace":{key:"Backspace",format:["table"],collapsed:!0,offset:0,handler(){}},"table delete":{key:"Delete",format:["table"],collapsed:!0,suffix:/^$/,handler(){}},"table enter":{key:"Enter",shiftKey:null,format:["table"],handler(t){const e=this.quill.getModule("table");if(e){const[n,r,s,a]=e.getTable(t),i=ZL(n,r,s,a);if(i==null)return;let o=n.offset();if(i<0){const l=new xe().retain(o).insert(`
|
|
103
100
|
`);this.quill.updateContents(l,le.sources.USER),this.quill.setSelection(t.index+1,t.length,le.sources.SILENT)}else if(i>0){o+=n.length();const l=new xe().retain(o).insert(`
|
|
104
|
-
`);this.quill.updateContents(l,le.sources.USER),this.quill.setSelection(o,le.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:r}=e,s=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(s-1,le.sources.USER):this.quill.setSelection(s+r.length(),le.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(this.quill.scroll.query("list")==null)return!0;const{length:n}=e.prefix,[r,s]=this.quill.getLine(t.index);if(s>n)return!0;let a;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",le.sources.USER),this.quill.history.cutoff();const i=new xe().retain(t.index-s).delete(n+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(i,le.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,le.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const a=new xe().retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,le.sources.USER),this.quill.setSelection(t.index-1,le.sources.SILENT),!1}return!0}},"embed left":Vu("ArrowLeft",!1),"embed left shift":Vu("ArrowLeft",!0),"embed right":Vu("ArrowRight",!1),"embed right shift":Vu("ArrowRight",!0),"table down":
|
|
105
|
-
`)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new xe().retain(a.length()-1).delete(1)):a}normalizeHTML(e){
|
|
106
|
-
`)}onCapturePaste(e){var i,o,l,d,
|
|
101
|
+
`);this.quill.updateContents(l,le.sources.USER),this.quill.setSelection(o,le.sources.USER)}}}},"table tab":{key:"Tab",shiftKey:null,format:["table"],handler(t,e){const{event:n,line:r}=e,s=r.offset(this.quill.scroll);n.shiftKey?this.quill.setSelection(s-1,le.sources.USER):this.quill.setSelection(s+r.length(),le.sources.USER)}},"list autofill":{key:" ",shiftKey:null,collapsed:!0,format:{"code-block":!1,blockquote:!1,table:!1},prefix:/^\s*?(\d+\.|-|\*|\[ ?\]|\[x\])$/,handler(t,e){if(this.quill.scroll.query("list")==null)return!0;const{length:n}=e.prefix,[r,s]=this.quill.getLine(t.index);if(s>n)return!0;let a;switch(e.prefix.trim()){case"[]":case"[ ]":a="unchecked";break;case"[x]":a="checked";break;case"-":case"*":a="bullet";break;default:a="ordered"}this.quill.insertText(t.index," ",le.sources.USER),this.quill.history.cutoff();const i=new xe().retain(t.index-s).delete(n+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(i,le.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,le.sources.SILENT),!1}},"code exit":{key:"Enter",collapsed:!0,format:["code-block"],prefix:/^$/,suffix:/^\s*$/,handler(t){const[e,n]=this.quill.getLine(t.index);let r=2,s=e;for(;s!=null&&s.length()<=1&&s.formats()["code-block"];)if(s=s.prev,r-=1,r<=0){const a=new xe().retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,le.sources.USER),this.quill.setSelection(t.index-1,le.sources.SILENT),!1}return!0}},"embed left":Vu("ArrowLeft",!1),"embed left shift":Vu("ArrowLeft",!0),"embed right":Vu("ArrowRight",!1),"embed right shift":Vu("ArrowRight",!0),"table down":m1(!1),"table up":m1(!0)}};fc.DEFAULTS=XL;function p1(t){return{key:"Tab",shiftKey:!t,format:{"code-block":!0},handler(e,n){let{event:r}=n;const s=this.quill.scroll.query("code-block"),{TAB:a}=s;if(e.length===0&&!r.shiftKey){this.quill.insertText(e.index,a,le.sources.USER),this.quill.setSelection(e.index+a.length,le.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:o,length:l}=e;i.forEach((d,f)=>{t?(d.insertAt(0,a),f===0?o+=a.length:l+=a.length):d.domNode.textContent.startsWith(a)&&(d.deleteAt(0,a.length),f===0?o-=a.length:l-=a.length)}),this.quill.update(le.sources.USER),this.quill.setSelection(o,l,le.sources.SILENT)}}}function Vu(t,e){return{key:t,shiftKey:e,altKey:null,[t==="ArrowLeft"?"prefix":"suffix"]:/^$/,handler(r){let{index:s}=r;t==="ArrowRight"&&(s+=r.length+1);const[a]=this.quill.getLeaf(s);return a instanceof Qn?(t==="ArrowLeft"?e?this.quill.setSelection(r.index-1,r.length+1,le.sources.USER):this.quill.setSelection(r.index-1,le.sources.USER):e?this.quill.setSelection(r.index,r.length+1,le.sources.USER):this.quill.setSelection(r.index+r.length+1,le.sources.USER),!1):!0}}}function id(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],le.sources.USER)}}}function m1(t){return{key:t?"ArrowUp":"ArrowDown",collapsed:!0,format:["table"],handler(e,n){const r=t?"prev":"next",s=n.line,a=s.parent[r];if(a!=null){if(a.statics.blotName==="table-row"){let i=a.children.head,o=s;for(;o.prev!=null;)o=o.prev,i=i.next;const l=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(l,0,le.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,le.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,le.sources.USER))}return!1}}}function QL(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=Si(t);else return null;return t.shortKey&&(t[VL]=t.shortKey,delete t.shortKey),t}function t0(t){let{quill:e,range:n}=t;const r=e.getLines(n);let s={};if(r.length>1){const a=r[0].formats(),i=r[r.length-1].formats();s=pr.AttributeMap.diff(i,a)||{}}e.deleteText(n,le.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,le.sources.USER),e.setSelection(n.index,le.sources.SILENT)}function ZL(t,e,n,r){return e.prev==null&&e.next==null?n.prev==null&&n.next==null?r===0?-1:1:n.prev==null?-1:1:e.prev==null?-1:e.next==null?1:null}const JL=/font-weight:\s*normal/,eO=["P","OL","UL"],g1=t=>t&&eO.includes(t.tagName),tO=t=>{Array.from(t.querySelectorAll("br")).filter(e=>g1(e.previousElementSibling)&&g1(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},nO=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(JL)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function rO(t){t.querySelector('[id^="docs-internal-guid-"]')&&(nO(t),tO(t))}const sO=/\bmso-list:[^;]*ignore/i,aO=/\bmso-list:[^;]*\bl(\d+)/i,iO=/\bmso-list:[^;]*\blevel(\d+)/i,oO=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(aO);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(iO),i=a?Number(a[1]):1,o=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),l=e.match(o),d=l&&l[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:d,element:t}},uO=t=>{var i,o;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(l=>{(l.getAttribute("style")||"").match(sO)?n.push(l):r.push(l)}),n.forEach(l=>{var d;return(d=l.parentNode)==null?void 0:d.removeChild(l)});const s=t.documentElement.innerHTML,a=r.map(l=>oO(l,s)).filter(l=>l);for(;a.length;){const l=[];let d=a.shift();for(;d;)l.push(d),d=a.length&&((i=a[0])==null?void 0:i.element)===d.element.nextElementSibling&&a[0].id===d.id?a.shift():null;const f=document.createElement("ul");l.forEach(p=>{const v=document.createElement("li");v.setAttribute("data-list",p.type),p.indent>1&&v.setAttribute("class",`ql-indent-${p.indent-1}`),v.innerHTML=p.element.innerHTML,f.appendChild(v)});const g=(o=l[0])==null?void 0:o.element,{parentNode:h}=g??{};g&&(h==null||h.replaceChild(f,g)),l.slice(1).forEach(p=>{let{element:v}=p;h==null||h.removeChild(v)})}};function lO(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&uO(t)}const cO=[lO,rO],dO=t=>{t.documentElement&&cO.forEach(e=>{e(t)})},fO=Ls("quill:clipboard"),hO=[[Node.TEXT_NODE,SO],[Node.TEXT_NODE,b1],["br",bO],[Node.ELEMENT_NODE,b1],[Node.ELEMENT_NODE,vO],[Node.ELEMENT_NODE,gO],[Node.ELEMENT_NODE,yO],["li",TO],["ol, ul",AO],["pre",EO],["tr",NO],["b",od("bold")],["i",od("italic")],["strike",od("strike")],["style",_O]],pO=[YL,lb].reduce((t,e)=>(t[e.keyName]=e,t),{}),v1=[ob,Zh,Qh,db,pb,gb].reduce((t,e)=>(t[e.keyName]=e,t),{});class vb extends Ur{constructor(e,n){super(e,n),this.quill.root.addEventListener("copy",r=>this.onCaptureCopy(r,!1)),this.quill.root.addEventListener("cut",r=>this.onCaptureCopy(r,!0)),this.quill.root.addEventListener("paste",this.onCapturePaste.bind(this)),this.matchers=[],hO.concat(this.options.matchers??[]).forEach(r=>{let[s,a]=r;this.addMatcher(s,a)})}addMatcher(e,n){this.matchers.push([e,n])}convert(e){let{html:n,text:r}=e,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(s[Cn.blotName])return new xe().insert(r||"",{[Cn.blotName]:s[Cn.blotName]});if(!n)return new xe().insert(r||"",s);const a=this.convertHTML(n);return vu(a,`
|
|
102
|
+
`)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new xe().retain(a.length()-1).delete(1)):a}normalizeHTML(e){dO(e)}convertHTML(e){const n=new DOMParser().parseFromString(e,"text/html");this.normalizeHTML(n);const r=n.body,s=new WeakMap,[a,i]=this.prepareMatching(r,s);return n0(this.quill.scroll,r,a,i,s)}dangerouslyPasteHTML(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:le.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,n),this.quill.setSelection(0,le.sources.SILENT)}else{const s=this.convert({html:n,text:""});this.quill.updateContents(new xe().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),le.sources.SILENT)}}onCaptureCopy(e){var i,o;let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(e.defaultPrevented)return;e.preventDefault();const[r]=this.quill.selection.getRange();if(r==null)return;const{html:s,text:a}=this.onCopy(r,n);(i=e.clipboardData)==null||i.setData("text/plain",a),(o=e.clipboardData)==null||o.setData("text/html",s),n&&t0({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(n=>n[0]!=="#").join(`
|
|
103
|
+
`)}onCapturePaste(e){var i,o,l,d,f;if(e.defaultPrevented||!this.quill.isEnabled())return;e.preventDefault();const n=this.quill.getSelection(!0);if(n==null)return;const r=(i=e.clipboardData)==null?void 0:i.getData("text/html");let s=(o=e.clipboardData)==null?void 0:o.getData("text/plain");if(!r&&!s){const g=(l=e.clipboardData)==null?void 0:l.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((d=e.clipboardData)==null?void 0:d.files)||[]);if(!r&&a.length>0){this.quill.uploader.upload(n,a);return}if(r&&a.length>0){const g=new DOMParser().parseFromString(r,"text/html");if(g.body.childElementCount===1&&((f=g.body.firstElementChild)==null?void 0:f.tagName)==="IMG"){this.quill.uploader.upload(n,a);return}}this.onPaste(n,{html:r,text:s})}onCopy(e){const n=this.quill.getText(e);return{html:this.quill.getSemanticHTML(e),text:n}}onPaste(e,n){let{text:r,html:s}=n;const a=this.quill.getFormat(e.index),i=this.convert({text:r,html:s},a);fO.log("onPaste",i,{text:r,html:s});const o=new xe().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(o,le.sources.USER),this.quill.setSelection(o.length()-e.length,le.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,o]=a;switch(i){case Node.TEXT_NODE:s.push(o);break;case Node.ELEMENT_NODE:r.push(o);break;default:Array.from(e.querySelectorAll(i)).forEach(l=>{if(n.has(l)){const d=n.get(l);d==null||d.push(o)}else n.set(l,[o])});break}}),[r,s]}}ye(vb,"DEFAULTS",{matchers:[]});function ai(t,e,n,r){return r.query(e)?t.reduce((s,a)=>{if(!a.insert)return s;if(a.attributes&&a.attributes[e])return s.push(a);const i=n?{[e]:n}:{};return s.insert(a.insert,{...i,...a.attributes})},new xe):t}function vu(t,e){let n="";for(let r=t.ops.length-1;r>=0&&n.length<e.length;--r){const s=t.ops[r];if(typeof s.insert!="string")break;n=s.insert+n}return n.slice(-1*e.length)===e}function Gs(t,e){if(!(t instanceof Element))return!1;const n=e.query(t);return n&&n.prototype instanceof Qn?!1:["address","article","blockquote","canvas","dd","div","dl","dt","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","iframe","li","main","nav","ol","output","p","pre","section","table","td","tr","ul","video"].includes(t.tagName.toLowerCase())}function mO(t,e){return t.previousElementSibling&&t.nextElementSibling&&!Gs(t.previousElementSibling,e)&&!Gs(t.nextElementSibling,e)}const Xu=new WeakMap;function bb(t){return t==null?!1:(Xu.has(t)||(t.tagName==="PRE"?Xu.set(t,!0):Xu.set(t,bb(t.parentNode))),Xu.get(t))}function n0(t,e,n,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((a,i)=>i(e,a,t),new xe):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((a,i)=>{let o=n0(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(o=n.reduce((l,d)=>d(i,l,t),o),o=(s.get(i)||[]).reduce((l,d)=>d(i,l,t),o)),a.concat(o)},new xe):new xe}function od(t){return(e,n,r)=>ai(n,t,!0,r)}function gO(t,e,n){const r=ss.keys(t),s=Br.keys(t),a=oa.keys(t),i={};return r.concat(s).concat(a).forEach(o=>{let l=n.query(o,Re.ATTRIBUTE);l!=null&&(i[l.attrName]=l.value(t),i[l.attrName])||(l=pO[o],l!=null&&(l.attrName===o||l.keyName===o)&&(i[l.attrName]=l.value(t)||void 0),l=v1[o],l!=null&&(l.attrName===o||l.keyName===o)&&(l=v1[o],i[l.attrName]=l.value(t)||void 0))}),Object.entries(i).reduce((o,l)=>{let[d,f]=l;return ai(o,d,f,n)},e)}function vO(t,e,n){const r=n.query(t);if(r==null)return e;if(r.prototype instanceof Qn){const s={},a=r.value(t);if(a!=null)return s[r.blotName]=a,new xe().insert(s,r.formats(t,n))}else if(r.prototype instanceof Qo&&!vu(e,`
|
|
107
104
|
`)&&e.insert(`
|
|
108
|
-
`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return ai(e,r.blotName,r.formats(t,n),n);return e}function
|
|
105
|
+
`),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return ai(e,r.blotName,r.formats(t,n),n);return e}function bO(t,e){return vu(e,`
|
|
109
106
|
`)||e.insert(`
|
|
110
|
-
`),e}function
|
|
111
|
-
`))return e;let s=-1,a=t.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(s+=1),a=a.parentNode;return s<=0?e:e.reduce((i,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?i.push(o):i.insert(o.insert,{indent:s,...o.attributes||{}}):i,new xe)}function
|
|
112
|
-
`)){if(
|
|
113
|
-
`);if(e.length()>0&&t.nextSibling){let r=t.nextSibling;for(;r!=null;){if(
|
|
114
|
-
`);const s=n.query(r);if(s&&s.prototype instanceof
|
|
115
|
-
`);r=r.firstChild}}}return e}function
|
|
116
|
-
`)&&!
|
|
117
|
-
`):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,Re.BLOCK)!=null):!1}function wO(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return SO(t,e)&&(r-=1),r}function xf(t,e){if(!t)return t;const n=e.transformPosition(t.index),r=e.transformPosition(t.index+t.length);return{index:n,length:r-n}}class _b extends Ur{constructor(e,n){super(e,n),e.root.addEventListener("drop",r=>{var i;r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const o=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(o,r.dataTransfer.files)}})}upload(e,n){const r=[];Array.from(n).forEach(s=>{var a;s&&((a=this.options.mimetypes)!=null&&a.includes(s.type))&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}_b.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const n=e.map(r=>new Promise(s=>{const a=new FileReader;a.onload=()=>{s(a.result)},a.readAsDataURL(r)}));Promise.all(n).then(r=>{const s=r.reduce((a,i)=>a.insert({image:i}),new xe().retain(t.index).delete(t.length));this.quill.updateContents(s,Le.sources.USER),this.quill.setSelection(t.index+r.length,Le.sources.SILENT)})}};const IO=["insertText","insertReplacementText"];class CO extends Ur{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(le.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){e0({range:e,quill:this.quill})}replaceText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(n){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new xe().retain(e.index).insert(n,r),le.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,le.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!IO.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=LO(e);if(r==null)return;const s=this.quill.selection.normalizeNative(n),a=s?this.quill.selection.normalizedToRange(s):null;a&&this.replaceText(a,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function LO(t){var e;return typeof t.data=="string"?t.data:(e=t.dataTransfer)!=null&&e.types.includes("text/plain")?t.dataTransfer.getData("text/plain"):null}const OO=/Mac/i.test(navigator.platform),xO=100,RO=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||OO&&t.key==="a"&&t.ctrlKey===!0);class DO extends Ur{constructor(n,r){super(n,r);ye(this,"isListening",!1);ye(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(n,r){let{line:s,event:a}=r;if(!(s instanceof Rr)||!s.uiNode)return!0;const i=getComputedStyle(s.domNode).direction==="rtl";return i&&a.key!=="ArrowRight"||!i&&a.key!=="ArrowLeft"?!0:(this.quill.setSelection(n.index-1,n.length+(a.shiftKey?1:0),le.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&RO(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+xO,this.isListening)return;this.isListening=!0;const n=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",n,{once:!0})}handleSelectionChange(){const n=document.getSelection();if(!n)return;const r=n.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const s=this.quill.scroll.find(r.startContainer);if(!(s instanceof Rr)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}le.register({"blots/block":En,"blots/block/embed":fr,"blots/break":Fr,"blots/container":ri,"blots/cursor":Ki,"blots/embed":Kh,"blots/inline":as,"blots/scroll":vi,"blots/text":kr,"modules/clipboard":vb,"modules/history":Eb,"modules/keyboard":dc,"modules/uploader":_b,"modules/input":CO,"modules/uiNode":DO});class kO extends Br{add(e,n){let r=0;if(n==="+1"||n==="-1"){const s=this.value(e)||0;r=n==="+1"?s+1:s-1}else typeof n=="number"&&(r=n);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,n){return super.canAdd(e,n)||super.canAdd(e,parseInt(n,10))}value(e){return parseInt(super.value(e),10)||void 0}}const PO=new kO("indent","ql-indent",{scope:Re.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Rf extends En{}ye(Rf,"blotName","blockquote"),ye(Rf,"tagName","blockquote");class Df extends En{static formats(e){return this.tagName.indexOf(e.tagName)+1}}ye(Df,"blotName","header"),ye(Df,"tagName",["H1","H2","H3","H4","H5","H6"]);class bu extends ri{}bu.blotName="list-container";bu.tagName="OL";class Eu extends En{static create(e){const n=super.create();return n.setAttribute("data-list",e),n}static formats(e){return e.getAttribute("data-list")||void 0}static register(){le.register(bu)}constructor(e,n){super(e,n);const r=n.ownerDocument.createElement("span"),s=a=>{if(!e.isEnabled())return;const i=this.statics.formats(n,e);i==="checked"?(this.format("list","unchecked"),a.preventDefault()):i==="unchecked"&&(this.format("list","checked"),a.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-list",n):super.format(e,n)}}Eu.blotName="list";Eu.tagName="LI";bu.allowedChildren=[Eu];Eu.requiredContainer=bu;class Jo extends as{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}ye(Jo,"blotName","bold"),ye(Jo,"tagName",["STRONG","B"]);class kf extends Jo{}ye(kf,"blotName","italic"),ye(kf,"tagName",["EM","I"]);class Gs extends as{static create(e){const n=super.create(e);return n.setAttribute("href",this.sanitize(e)),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}static formats(e){return e.getAttribute("href")}static sanitize(e){return Tb(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,n){e!==this.statics.blotName||!n?super.format(e,n):this.domNode.setAttribute("href",this.constructor.sanitize(n))}}ye(Gs,"blotName","link"),ye(Gs,"tagName","A"),ye(Gs,"SANITIZED_URL","about:blank"),ye(Gs,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Tb(t,e){const n=document.createElement("a");n.href=t;const r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}class Pf extends as{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}ye(Pf,"blotName","script"),ye(Pf,"tagName",["SUB","SUP"]);class Mf extends Jo{}ye(Mf,"blotName","strike"),ye(Mf,"tagName",["S","STRIKE"]);class Bf extends as{}ye(Bf,"blotName","underline"),ye(Bf,"tagName","U");class cl extends Kh{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const n=super.create(e);return typeof e=="string"&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}ye(cl,"blotName","formula"),ye(cl,"className","ql-formula"),ye(cl,"tagName","SPAN");const E1=["alt","height","width"];class Ff extends Zn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return E1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return Tb(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){E1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}ye(Ff,"blotName","image"),ye(Ff,"tagName","IMG");const _1=["height","width"];class dl extends fr{static create(e){const n=super.create(e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen","true"),n.setAttribute("src",this.sanitize(e)),n}static formats(e){return _1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Gs.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){_1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}ye(dl,"blotName","video"),ye(dl,"className","ql-video"),ye(dl,"tagName","IFRAME");const yo=new Br("code-token","hljs",{scope:Re.INLINE});class Ss extends as{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(Sn.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),yo.add(this.domNode,r)}format(e,n){e!==Ss.blotName?super.format(e,n):n?yo.add(this.domNode,n):(yo.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),yo.value(this.domNode)||this.unwrap()}}Ss.blotName="code-token";Ss.className="ql-token";class dr extends Sn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("data-language",e),n}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-language",n):super.format(e,n)}replaceWith(e,n){return this.formatAt(0,this.length(),Ss.blotName,!1),super.replaceWith(e,n)}}class Bo extends si{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===dr.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===dr.blotName&&(this.forceNext=!0),super.formatAt(e,n,r,s)}highlight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(i=>i!==this.uiNode).map(i=>i.textContent).join(`
|
|
107
|
+
`),e}function EO(t,e,n){const r=n.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(t,n):!0;return ai(e,"code-block",s,n)}function _O(){return new xe}function TO(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!vu(e,`
|
|
108
|
+
`))return e;let s=-1,a=t.parentNode;for(;a!=null;)["OL","UL"].includes(a.tagName)&&(s+=1),a=a.parentNode;return s<=0?e:e.reduce((i,o)=>o.insert?o.attributes&&typeof o.attributes.indent=="number"?i.push(o):i.insert(o.insert,{indent:s,...o.attributes||{}}):i,new xe)}function AO(t,e,n){const r=t;let s=r.tagName==="OL"?"ordered":"bullet";const a=r.getAttribute("data-checked");return a&&(s=a==="true"?"checked":"unchecked"),ai(e,"list",s,n)}function b1(t,e,n){if(!vu(e,`
|
|
109
|
+
`)){if(Gs(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert(`
|
|
110
|
+
`);if(e.length()>0&&t.nextSibling){let r=t.nextSibling;for(;r!=null;){if(Gs(r,n))return e.insert(`
|
|
111
|
+
`);const s=n.query(r);if(s&&s.prototype instanceof hr)return e.insert(`
|
|
112
|
+
`);r=r.firstChild}}}return e}function yO(t,e,n){var a;const r={},s=t.style||{};return s.fontStyle==="italic"&&(r.italic=!0),s.textDecoration==="underline"&&(r.underline=!0),s.textDecoration==="line-through"&&(r.strike=!0),((a=s.fontWeight)!=null&&a.startsWith("bold")||parseInt(s.fontWeight,10)>=700)&&(r.bold=!0),e=Object.entries(r).reduce((i,o)=>{let[l,d]=o;return ai(i,l,d,n)},e),parseFloat(s.textIndent||0)>0?new xe().insert(" ").concat(e):e}function NO(t,e,n){var s,a;const r=((s=t.parentElement)==null?void 0:s.tagName)==="TABLE"?t.parentElement:(a=t.parentElement)==null?void 0:a.parentElement;if(r!=null){const o=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return ai(e,"table",o,n)}return e}function SO(t,e,n){var s;let r=t.data;if(((s=t.parentElement)==null?void 0:s.tagName)==="O:P")return e.insert(r.trim());if(!bb(t)){if(r.trim().length===0&&r.includes(`
|
|
113
|
+
`)&&!mO(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&Gs(t.parentElement,n)||t.previousSibling instanceof Element&&Gs(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&Gs(t.parentElement,n)||t.nextSibling instanceof Element&&Gs(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class Eb extends Ur{constructor(n,r){super(n,r);ye(this,"lastRecorded",0);ye(this,"ignoreChange",!1);ye(this,"stack",{undo:[],redo:[]});ye(this,"currentRange",null);this.quill.on(le.events.EDITOR_CHANGE,(s,a,i,o)=>{s===le.events.SELECTION_CHANGE?a&&o!==le.sources.SILENT&&(this.currentRange=a):s===le.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||o===le.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=Rf(this.currentRange,a))}),this.quill.keyboard.addBinding({key:"z",shortKey:!0},this.undo.bind(this)),this.quill.keyboard.addBinding({key:["z","Z"],shortKey:!0,shiftKey:!0},this.redo.bind(this)),/Win/i.test(navigator.platform)&&this.quill.keyboard.addBinding({key:"y",shortKey:!0},this.redo.bind(this)),this.quill.root.addEventListener("beforeinput",s=>{s.inputType==="historyUndo"?(this.undo(),s.preventDefault()):s.inputType==="historyRedo"&&(this.redo(),s.preventDefault())})}change(n,r){if(this.stack[n].length===0)return;const s=this.stack[n].pop();if(!s)return;const a=this.quill.getContents(),i=s.delta.invert(a);this.stack[r].push({delta:i,range:Rf(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,le.sources.USER),this.ignoreChange=!1,this.restoreSelection(s)}clear(){this.stack={undo:[],redo:[]}}cutoff(){this.lastRecorded=0}record(n,r){if(n.ops.length===0)return;this.stack.redo=[];let s=n.invert(r),a=this.currentRange;const i=Date.now();if(this.lastRecorded+this.options.delay>i&&this.stack.undo.length>0){const o=this.stack.undo.pop();o&&(s=s.compose(o.delta),a=o.range)}else this.lastRecorded=i;s.length()!==0&&(this.stack.undo.push({delta:s,range:a}),this.stack.undo.length>this.options.maxStack&&this.stack.undo.shift())}redo(){this.change("redo","undo")}transform(n){E1(this.stack.undo,n),E1(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,le.sources.USER);else{const r=IO(this.quill.scroll,n.delta);this.quill.setSelection(r,le.sources.USER)}}}ye(Eb,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function E1(t,e){let n=e;for(let r=t.length-1;r>=0;r-=1){const s=t[r];t[r]={delta:n.transform(s.delta,!0),range:s.range&&Rf(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function wO(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
|
|
114
|
+
`):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,Re.BLOCK)!=null):!1}function IO(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return wO(t,e)&&(r-=1),r}function Rf(t,e){if(!t)return t;const n=e.transformPosition(t.index),r=e.transformPosition(t.index+t.length);return{index:n,length:r-n}}class _b extends Ur{constructor(e,n){super(e,n),e.root.addEventListener("drop",r=>{var i;r.preventDefault();let s=null;if(document.caretRangeFromPoint)s=document.caretRangeFromPoint(r.clientX,r.clientY);else if(document.caretPositionFromPoint){const o=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(o.offsetNode,o.offset),s.setEnd(o.offsetNode,o.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const o=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(o,r.dataTransfer.files)}})}upload(e,n){const r=[];Array.from(n).forEach(s=>{var a;s&&((a=this.options.mimetypes)!=null&&a.includes(s.type))&&r.push(s)}),r.length>0&&this.options.handler.call(this,e,r)}}_b.DEFAULTS={mimetypes:["image/png","image/jpeg"],handler(t,e){if(!this.quill.scroll.query("image"))return;const n=e.map(r=>new Promise(s=>{const a=new FileReader;a.onload=()=>{s(a.result)},a.readAsDataURL(r)}));Promise.all(n).then(r=>{const s=r.reduce((a,i)=>a.insert({image:i}),new xe().retain(t.index).delete(t.length));this.quill.updateContents(s,Oe.sources.USER),this.quill.setSelection(t.index+r.length,Oe.sources.SILENT)})}};const CO=["insertText","insertReplacementText"];class LO extends Ur{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(le.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){t0({range:e,quill:this.quill})}replaceText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";if(e.length===0)return!1;if(n){const r=this.quill.getFormat(e.index,1);this.deleteRange(e),this.quill.updateContents(new xe().retain(e.index).insert(n,r),le.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,le.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!CO.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=OO(e);if(r==null)return;const s=this.quill.selection.normalizeNative(n),a=s?this.quill.selection.normalizedToRange(s):null;a&&this.replaceText(a,r)&&e.preventDefault()}handleCompositionStart(){const e=this.quill.getSelection();e&&this.replaceText(e)}}function OO(t){var e;return typeof t.data=="string"?t.data:(e=t.dataTransfer)!=null&&e.types.includes("text/plain")?t.dataTransfer.getData("text/plain"):null}const xO=/Mac/i.test(navigator.platform),RO=100,DO=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||xO&&t.key==="a"&&t.ctrlKey===!0);class kO extends Ur{constructor(n,r){super(n,r);ye(this,"isListening",!1);ye(this,"selectionChangeDeadline",0);this.handleArrowKeys(),this.handleNavigationShortcuts()}handleArrowKeys(){this.quill.keyboard.addBinding({key:["ArrowLeft","ArrowRight"],offset:0,shiftKey:null,handler(n,r){let{line:s,event:a}=r;if(!(s instanceof Rr)||!s.uiNode)return!0;const i=getComputedStyle(s.domNode).direction==="rtl";return i&&a.key!=="ArrowRight"||!i&&a.key!=="ArrowLeft"?!0:(this.quill.setSelection(n.index-1,n.length+(a.shiftKey?1:0),le.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&DO(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+RO,this.isListening)return;this.isListening=!0;const n=()=>{this.isListening=!1,Date.now()<=this.selectionChangeDeadline&&this.handleSelectionChange()};document.addEventListener("selectionchange",n,{once:!0})}handleSelectionChange(){const n=document.getSelection();if(!n)return;const r=n.getRangeAt(0);if(r.collapsed!==!0||r.startOffset!==0)return;const s=this.quill.scroll.find(r.startContainer);if(!(s instanceof Rr)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}le.register({"blots/block":_n,"blots/block/embed":hr,"blots/break":Fr,"blots/container":ri,"blots/cursor":Ki,"blots/embed":Vh,"blots/inline":as,"blots/scroll":vi,"blots/text":kr,"modules/clipboard":vb,"modules/history":Eb,"modules/keyboard":fc,"modules/uploader":_b,"modules/input":LO,"modules/uiNode":kO});class PO extends Br{add(e,n){let r=0;if(n==="+1"||n==="-1"){const s=this.value(e)||0;r=n==="+1"?s+1:s-1}else typeof n=="number"&&(r=n);return r===0?(this.remove(e),!0):super.add(e,r.toString())}canAdd(e,n){return super.canAdd(e,n)||super.canAdd(e,parseInt(n,10))}value(e){return parseInt(super.value(e),10)||void 0}}const MO=new PO("indent","ql-indent",{scope:Re.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class Df extends _n{}ye(Df,"blotName","blockquote"),ye(Df,"tagName","blockquote");class kf extends _n{static formats(e){return this.tagName.indexOf(e.tagName)+1}}ye(kf,"blotName","header"),ye(kf,"tagName",["H1","H2","H3","H4","H5","H6"]);class bu extends ri{}bu.blotName="list-container";bu.tagName="OL";class Eu extends _n{static create(e){const n=super.create();return n.setAttribute("data-list",e),n}static formats(e){return e.getAttribute("data-list")||void 0}static register(){le.register(bu)}constructor(e,n){super(e,n);const r=n.ownerDocument.createElement("span"),s=a=>{if(!e.isEnabled())return;const i=this.statics.formats(n,e);i==="checked"?(this.format("list","unchecked"),a.preventDefault()):i==="unchecked"&&(this.format("list","checked"),a.preventDefault())};r.addEventListener("mousedown",s),r.addEventListener("touchstart",s),this.attachUI(r)}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-list",n):super.format(e,n)}}Eu.blotName="list";Eu.tagName="LI";bu.allowedChildren=[Eu];Eu.requiredContainer=bu;class Jo extends as{static create(){return super.create()}static formats(){return!0}optimize(e){super.optimize(e),this.domNode.tagName!==this.statics.tagName[0]&&this.replaceWith(this.statics.blotName)}}ye(Jo,"blotName","bold"),ye(Jo,"tagName",["STRONG","B"]);class Pf extends Jo{}ye(Pf,"blotName","italic"),ye(Pf,"tagName",["EM","I"]);class Ks extends as{static create(e){const n=super.create(e);return n.setAttribute("href",this.sanitize(e)),n.setAttribute("rel","noopener noreferrer"),n.setAttribute("target","_blank"),n}static formats(e){return e.getAttribute("href")}static sanitize(e){return Tb(e,this.PROTOCOL_WHITELIST)?e:this.SANITIZED_URL}format(e,n){e!==this.statics.blotName||!n?super.format(e,n):this.domNode.setAttribute("href",this.constructor.sanitize(n))}}ye(Ks,"blotName","link"),ye(Ks,"tagName","A"),ye(Ks,"SANITIZED_URL","about:blank"),ye(Ks,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Tb(t,e){const n=document.createElement("a");n.href=t;const r=n.href.slice(0,n.href.indexOf(":"));return e.indexOf(r)>-1}class Mf extends as{static create(e){return e==="super"?document.createElement("sup"):e==="sub"?document.createElement("sub"):super.create(e)}static formats(e){if(e.tagName==="SUB")return"sub";if(e.tagName==="SUP")return"super"}}ye(Mf,"blotName","script"),ye(Mf,"tagName",["SUB","SUP"]);class Bf extends Jo{}ye(Bf,"blotName","strike"),ye(Bf,"tagName",["S","STRIKE"]);class Ff extends as{}ye(Ff,"blotName","underline"),ye(Ff,"tagName","U");class dl extends Vh{static create(e){if(window.katex==null)throw new Error("Formula module requires KaTeX.");const n=super.create(e);return typeof e=="string"&&(window.katex.render(e,n,{throwOnError:!1,errorColor:"#f00"}),n.setAttribute("data-value",e)),n}static value(e){return e.getAttribute("data-value")}html(){const{formula:e}=this.value();return`<span>${e}</span>`}}ye(dl,"blotName","formula"),ye(dl,"className","ql-formula"),ye(dl,"tagName","SPAN");const _1=["alt","height","width"];class Uf extends Qn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("src",this.sanitize(e)),n}static formats(e){return _1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static match(e){return/\.(jpe?g|gif|png)$/.test(e)||/^data:image\/.+;base64/.test(e)}static sanitize(e){return Tb(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){_1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}ye(Uf,"blotName","image"),ye(Uf,"tagName","IMG");const T1=["height","width"];class fl extends hr{static create(e){const n=super.create(e);return n.setAttribute("frameborder","0"),n.setAttribute("allowfullscreen","true"),n.setAttribute("src",this.sanitize(e)),n}static formats(e){return T1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Ks.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){T1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}html(){const{video:e}=this.value();return`<a href="${e}">${e}</a>`}}ye(fl,"blotName","video"),ye(fl,"className","ql-video"),ye(fl,"tagName","IFRAME");const yo=new Br("code-token","hljs",{scope:Re.INLINE});class ws extends as{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(Cn.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),yo.add(this.domNode,r)}format(e,n){e!==ws.blotName?super.format(e,n):n?yo.add(this.domNode,n):(yo.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),yo.value(this.domNode)||this.unwrap()}}ws.blotName="code-token";ws.className="ql-token";class fr extends Cn{static create(e){const n=super.create(e);return typeof e=="string"&&n.setAttribute("data-language",e),n}static formats(e){return e.getAttribute("data-language")||"plain"}static register(){}format(e,n){e===this.statics.blotName&&n?this.domNode.setAttribute("data-language",n):super.format(e,n)}replaceWith(e,n){return this.formatAt(0,this.length(),ws.blotName,!1),super.replaceWith(e,n)}}class Bo extends si{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===fr.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===fr.blotName&&(this.forceNext=!0),super.formatAt(e,n,r,s)}highlight(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.children.head==null)return;const s=`${Array.from(this.domNode.childNodes).filter(i=>i!==this.uiNode).map(i=>i.textContent).join(`
|
|
118
115
|
`)}
|
|
119
|
-
`,a=
|
|
120
|
-
${
|
|
121
|
-
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=
|
|
116
|
+
`,a=fr.formats(this.children.head.domNode);if(n||this.forceNext||this.cachedText!==s){if(s.trim().length>0||this.cachedText==null){const i=this.children.reduce((l,d)=>l.concat(sb(d,!1)),new xe),o=e(s,a);i.diff(o).reduce((l,d)=>{let{retain:f,attributes:g}=d;return f?(g&&Object.keys(g).forEach(h=>{[fr.blotName,ws.blotName].includes(h)&&this.formatAt(l,f,h,g[h])}),l+f):l},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?fr.formats(r.domNode):"plain"}">
|
|
117
|
+
${dc(this.code(e,n))}
|
|
118
|
+
</pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=fr.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}Bo.allowedChildren=[fr];fr.requiredContainer=Bo;fr.allowedChildren=[ws,Ki,kr,Fr];const BO=(t,e,n)=>{if(typeof t.versionString=="string"){const r=t.versionString.split(".")[0];if(parseInt(r,10)>=11)return t.highlight(n,{language:e}).value}return t.highlight(e,n).value};class Ab extends Ur{static register(){le.register(ws,!0),le.register(fr,!0),le.register(Bo,!0)}constructor(e,n){if(super(e,n),this.options.hljs==null)throw new Error("Syntax module requires highlight.js. Please include the library on the page before Quill.");this.languages=this.options.languages.reduce((r,s)=>{let{key:a}=s;return r[a]=!0,r},{}),this.highlightBlot=this.highlightBlot.bind(this),this.initListener(),this.initTimer()}initListener(){this.quill.on(le.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Bo))return;const n=this.quill.root.ownerDocument.createElement("select");this.options.languages.forEach(r=>{let{key:s,label:a}=r;const i=n.ownerDocument.createElement("option");i.textContent=a,i.setAttribute("value",s),n.appendChild(i)}),n.addEventListener("change",()=>{e.format(fr.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=fr.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(le.events.SCROLL_OPTIMIZE,()=>{e&&clearTimeout(e),e=setTimeout(()=>{this.highlight(),e=null},this.options.interval)})}highlight(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(this.quill.selection.composing)return;this.quill.update(le.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Bo):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(le.sources.SILENT),r!=null&&this.quill.setSelection(r,le.sources.SILENT)}highlightBlot(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"plain";if(n=this.languages[n]?n:"plain",n==="plain")return dc(e).split(`
|
|
122
119
|
`).reduce((s,a,i)=>(i!==0&&s.insert(`
|
|
123
|
-
`,{[
|
|
120
|
+
`,{[Cn.blotName]:n}),s.insert(a)),new xe);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(Cn.className),r.innerHTML=BO(this.options.hljs,n,e),n0(this.quill.scroll,r,[(s,a)=>{const i=yo.value(s);return i?a.compose(new xe().retain(a.length(),{[ws.blotName]:i})):a}],[(s,a)=>s.data.split(`
|
|
124
121
|
`).reduce((i,o,l)=>(l!==0&&i.insert(`
|
|
125
|
-
`,{[
|
|
126
|
-
`).join("");return a.insert(i,{table:n0()})},new xe().retain(r.index));this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(r.index,le.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(le.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(le.events.TEXT_CHANGE,(r,s,a)=>{a===le.sources.USER&&this.balanceTables()}),!0):!1)})}}const T1=Cs("quill:toolbar");class r0 extends Ur{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),FO(a,this.options.container),(s=(r=e.container)==null?void 0:r.parentNode)==null||s.insertBefore(a,e.container),this.container=a}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){T1.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(a=>{var o;const i=(o=this.options.handlers)==null?void 0:o[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(le.events.EDITOR_CHANGE,()=>{const[a]=this.quill.selection.getRange();this.update(a)})}addHandler(e,n){this.handlers[e]=n}attach(e){let n=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!n)return;if(n=n.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[n]==null&&this.quill.scroll.query(n)==null){T1.warn("ignoring attaching to nonexistent format",n,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let a;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?a=!1:a=o.value||!1}else e.classList.contains("ql-active")?a=!1:a=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,a);else if(this.quill.scroll.query(n).prototype instanceof Zn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new xe().retain(i.index).delete(i.length).insert({[n]:a}),le.sources.USER)}else this.quill.format(n,a,le.sources.USER);this.update(i)}),this.controls.push([n,e])}update(e){const n=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,a]=r;if(a.tagName==="SELECT"){let i=null;if(e==null)i=null;else if(n[s]==null)i=a.querySelector("option[selected]");else if(!Array.isArray(n[s])){let o=n[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${o}"]`)}i==null?(a.value="",a.selectedIndex=-1):i.selected=!0}else if(e==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const i=n[s],o=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",o),a.setAttribute("aria-pressed",o.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}r0.DEFAULTS={};function A1(t,e,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),n!=null?(r.value=n,r.setAttribute("aria-label",`${e}: ${n}`)):r.setAttribute("aria-label",e),t.appendChild(r)}function FO(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(n=>{const r=document.createElement("span");r.classList.add("ql-formats"),n.forEach(s=>{if(typeof s=="string")A1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?UO(r,a,i):A1(r,a,i)}}),t.appendChild(r)})}function UO(t,e,n){const r=document.createElement("select");r.classList.add(`ql-${e}`),n.forEach(s=>{const a=document.createElement("option");s!==!1?a.setAttribute("value",String(s)):a.setAttribute("selected","selected"),r.appendChild(a)}),t.appendChild(r)}r0.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t!=null)if(t.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(n=>{this.quill.scroll.query(n,Re.INLINE)!=null&&this.quill.format(n,!1,le.sources.USER)})}else this.quill.removeFormat(t.index,t.length,le.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",le.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,le.sources.USER),this.quill.format("direction",t,le.sources.USER)},indent(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e),r=parseInt(n.indent||0,10);if(t==="+1"||t==="-1"){let s=t==="+1"?1:-1;n.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,le.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,le.sources.USER)},list(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e);t==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,le.sources.USER):this.quill.format("list","unchecked",le.sources.USER):this.quill.format("list",t,le.sources.USER)}}};const HO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',qO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',jO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',$O='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',YO='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',zO='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',WO='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',GO='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',y1='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',KO='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',VO='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',XO='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',QO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',ZO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',JO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',e8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',t8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',n8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',r8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',s8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',a8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',i8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',o8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',u8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',l8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',c8='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',d8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',f8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',h8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',p8='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',m8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',g8='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',v8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',eu={align:{"":HO,center:qO,right:jO,justify:$O},background:YO,blockquote:zO,bold:WO,clean:GO,code:y1,"code-block":y1,color:KO,direction:{"":VO,rtl:XO},formula:QO,header:{1:ZO,2:JO,3:e8,4:t8,5:n8,6:r8},italic:s8,image:a8,indent:{"+1":i8,"-1":o8},link:u8,list:{bullet:l8,check:c8,ordered:d8},script:{sub:f8,super:h8},strike:p8,table:m8,underline:g8,video:v8},b8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let N1=0;function S1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class fc{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),n.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),S1(this.label,"aria-expanded"),S1(this.options,"aria-hidden")}buildItem(e){const n=document.createElement("span");n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&n.setAttribute("data-value",r),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",()=>{this.selectItem(n,!0)}),n.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(n,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),n}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=b8,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${N1}`,N1+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(n=>{const r=this.buildItem(n);e.appendChild(r),n.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r!=null&&r.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const n=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}class yb extends fc{constructor(e,n){super(e),this.label.innerHTML=n,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(e){const n=super.buildItem(e);return n.style.backgroundColor=e.getAttribute("value")||"",n}selectItem(e,n){super.selectItem(e,n);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class Nb extends fc{constructor(e,n){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=n[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,n){super.selectItem(e,n);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const E8=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class Sb{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,E8(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const n=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>s.right&&(i=s.right-a.right,this.root.style.left=`${n+i}px`),a.left<s.left&&(i=s.left-a.left,this.root.style.left=`${n+i}px`),a.bottom>s.bottom){const o=a.bottom-a.top,l=e.bottom-e.top+o;this.root.style.top=`${r-l}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const _8=[!1,"center","right","justify"],T8=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],A8=[!1,"serif","monospace"],y8=["1","2","3",!1],N8=["small",!1,"large","huge"];class _u extends Vi{constructor(e,n){super(e,n);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(a=>{a.container.contains(s.target)||a.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const n=super.addModule(e);return e==="toolbar"&&this.extendToolbar(n),n}buildButtons(e,n){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(a=>{if(a.startsWith("ql-")&&(a=a.slice(3),n[a]!=null))if(a==="direction")r.innerHTML=n[a][""]+n[a].rtl;else if(typeof n[a]=="string")r.innerHTML=n[a];else{const i=r.value||"";i!=null&&n[a][i]&&(r.innerHTML=n[a][i])}})})}buildPickers(e,n){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&go(s,_8),typeof n.align=="object"))return new Nb(s,n.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const a=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&go(s,T8,a==="background"?"#ffffff":"#000000"),new yb(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?go(s,A8):s.classList.contains("ql-header")?go(s,y8):s.classList.contains("ql-size")&&go(s,N8)),new fc(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(Le.events.EDITOR_CHANGE,r)}}_u.DEFAULTS=Js({},Vi.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");t==null&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class wb extends Sb{constructor(e,n){super(e,n),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;n!=null?this.textbox.value=n:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:n}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Le.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Le.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=S8(e);case"formula":{if(!e)break;const n=this.quill.getSelection(!0);if(n!=null){const r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,Le.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Le.sources.USER),this.quill.setSelection(r+2,Le.sources.USER)}break}}this.textbox.value="",this.hide()}}function S8(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:t}function go(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===n?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),t.appendChild(s)})}const w8=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Ib extends wb{constructor(e,n){super(e,n),this.quill.on(Le.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===Le.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===Le.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const l=this.quill.getBounds(s);l!=null&&this.position(l)}else{const l=o[o.length-1],d=this.quill.getIndex(l),h=Math.min(l.length()-1,s.index+s.length-d),g=this.quill.getBounds(new Ka(d,h));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Le.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const n=this.quill.getBounds(e);n!=null&&this.position(n)}},1)})}cancel(){this.show()}position(e){const n=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",n!==0&&(r.style.marginLeft=`${-1*n-r.offsetWidth/2}px`),n}}ye(Ib,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class Cb extends _u{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=w8),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Ib(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),eu),this.buildPickers(e.container.querySelectorAll("select"),eu))}}Cb.DEFAULTS=Js({},_u.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,le.sources.USER)}}}}});const I8=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Lb extends wb{constructor(){super(...arguments);ye(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",n=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),n.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",n=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,Le.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(Le.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===Le.sources.USER){const[a,i]=this.quill.scroll.descendant(Gs,n.index);if(a!=null){this.linkRange=new Ka(n.index-i,a.length());const o=Gs.formats(a.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}ye(Lb,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class Ob extends _u{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=I8),super(e,n),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),eu),this.buildPickers(e.container.querySelectorAll("select"),eu),this.tooltip=new Lb(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(n,r)=>{e.handlers.link.call(e,!r.format.link)}))}}Ob.DEFAULTS=Js({},_u.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const e=this.quill.getSelection();if(e==null||e.length===0)return;let n=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf("mailto:")!==0&&(n=`mailto:${n}`);const{tooltip:r}=this.quill.theme;r.edit("link",n)}else this.quill.format("link",!1,le.sources.USER)}}}}});le.register({"attributors/attribute/direction":lb,"attributors/class/align":ib,"attributors/class/background":zL,"attributors/class/color":YL,"attributors/class/direction":cb,"attributors/class/font":hb,"attributors/class/size":mb,"attributors/style/align":ob,"attributors/style/background":Qh,"attributors/style/color":Xh,"attributors/style/direction":db,"attributors/style/font":pb,"attributors/style/size":gb},!0);le.register({"formats/align":ib,"formats/direction":cb,"formats/indent":PO,"formats/background":Qh,"formats/color":Xh,"formats/font":hb,"formats/size":mb,"formats/blockquote":Rf,"formats/code-block":Sn,"formats/header":Df,"formats/list":Eu,"formats/bold":Jo,"formats/code":Zh,"formats/italic":kf,"formats/link":Gs,"formats/script":Pf,"formats/strike":Mf,"formats/underline":Bf,"formats/formula":cl,"formats/image":Ff,"formats/video":dl,"modules/syntax":Ab,"modules/table":BO,"modules/toolbar":r0,"themes/bubble":Cb,"themes/snow":Ob,"ui/icons":eu,"ui/picker":fc,"ui/icon-picker":Nb,"ui/color-picker":yb,"ui/tooltip":Sb},!0);const C8="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",L8="/api/read?path=",Pl=new WeakMap;function O8(t){return typeof t=="string"&&t.includes(L8)}async function x8(t,e){try{const n=await Ke(e);if(!n.ok)return;const r=URL.createObjectURL(await n.blob()),s=Pl.get(t);s!==void 0&&URL.revokeObjectURL(s),Pl.set(t,r),t.setAttribute("src",r)}catch{}}function xb(t){const e=Pl.get(t);e!==void 0&&(URL.revokeObjectURL(e),Pl.delete(t))}const R8=le.import("formats/image");class s0 extends R8{static create(e){if(O8(e)){const n=super.create(C8);return n.setAttribute("data-read",e),x8(n,e),n}return super.create(e)}static value(e){return e.getAttribute("data-read")??e.getAttribute("src")??""}remove(){xb(this.domNode),super.remove()}}s0.blotName="image";s0.tagName="IMG";le.register(s0,!0);const w1="/api/read?path=",Rb=/src="([^"]*)"/g,D8=/ /g,k8=/<img src="[^"]*" data-read="([^"]*)"/g,P8=/<div class="ql-code-block-container"[^>]*>((?:<div class="ql-code-block"[^>]*>[\s\S]*?<\/div>)+)<\/div>/g,M8=/<div class="ql-code-block"[^>]*>([\s\S]*?)<\/div>/g,B8=/<pre><code>([\s\S]*?)<\/code><\/pre>/g;function F8(t){return t.replace(P8,(e,n)=>{const r=[];for(const s of n.matchAll(M8))r.push(s[1]==="<br>"?"":s[1]??"");return`<pre><code>${r.join(`
|
|
127
|
-
`)}</code></pre>`})}function
|
|
128
|
-
`).map(s=>`<div class="ql-code-block">${s}</div>`).join("")}</div>`)}function H8(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function I1(t,e){return U8(t.replace(Rb,(n,r)=>H8(r)?`src="${rc(e,r)}"`:n))}function C1(t,e){const n=`content/${e===""?"":`${e}/`}`;return F8(t).replace(k8,(r,s)=>`<img src="${s}"`).replace(Rb,(r,s)=>{const a=s.indexOf(w1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+w1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(D8," ")}var q8=$('<div class="rte svelte-1afg4yo"><div></div></div>');function j8(t,e){it(e,!0);const n=le.import("formats/link");n.PROTOCOL_WHITELIST.includes("ref")||n.PROTOCOL_WHITELIST.push("ref");let r,s;const a=[[{header:[2,3,!1]}],["bold","italic","link","image"],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],["clean"]];Qa(()=>{const p=new le(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(p.root.setAttribute("aria-labelledby",e.labelledBy),p.root.setAttribute("aria-multiline","true"));const T=p.theme.tooltip;if(T!==void 0){const H=T.position.bind(T);T.position=M=>{const J=p.root.getBoundingClientRect();return H({...M,left:M.left+J.left,right:M.right+J.left,top:M.top+J.top-p.root.scrollTop,bottom:M.bottom+J.top-p.root.scrollTop})}}const _=p.getModule("toolbar");_.addHandler("image",()=>l(p)),_.addHandler("link",()=>o(p));const E=H=>{H.preventDefault(),setTimeout(()=>i(p),0)};p.root.addEventListener("contextmenu",E);const O=H=>{H.target instanceof HTMLImageElement&&h(p,H.target)};p.root.addEventListener("dblclick",O),e.value&&p.clipboard.dangerouslyPasteHTML(I1(e.value,e.itemDir),"silent");const C=()=>e.onchange(C1(p.root.innerHTML,e.itemDir));return p.on("text-change",C),s=p,()=>{p.off("text-change",C),p.root.removeEventListener("contextmenu",E),p.root.removeEventListener("dblclick",O);for(const H of p.root.querySelectorAll("img"))xb(H)}});function i(p){var E;const v=p.getSelection(!0);if(v===null)return;const T=p.theme,_=p.getBounds(v.index,v.length);((E=T.tooltip)==null?void 0:E.show)!==void 0&&T.tooltip.position!==void 0&&_&&(T.tooltip.show(),T.tooltip.position(_))}function o(p){const v=p.getSelection(!0);if(v===null)return;const T=p.getFormat(v).link??"";yv(T).then(_=>{if(_!==null)if(_==="")p.formatText(v.index,v.length,"link",!1,"user");else if(v.length>0)p.formatText(v.index,v.length,"link",_,"user");else{const E=Go(_)?mf(_):_;p.insertText(v.index,E,{link:_},"user")}})}function l(p){const v=document.createElement("input");v.type="file",v.accept="image/*",v.onchange=()=>{var _;const T=(_=v.files)==null?void 0:_[0];T&&d(p,T)},v.click()}async function d(p,v){try{const T=await Ch(e.itemDir,v),_=p.getSelection(!0),E=await ep("");if(E===null)return;p.insertEmbed(_.index,"image",rc(e.itemDir,T),"user"),E!==""&&p.formatText(_.index,1,"alt",E,"user"),p.setSelection(_.index+1,0)}catch(T){console.error("Inline image upload failed",T)}}function h(p,v){const T=le.find(v);if(T===null)return;const _=p.getIndex(T);ep(v.getAttribute("alt")??"").then(E=>{E!==null&&p.formatText(_,1,"alt",E===""?!1:E,"user")})}Rt(()=>{const p=e.value;s&&C1(s.root.innerHTML,e.itemDir)!==p&&s.clipboard.dangerouslyPasteHTML(I1(p,e.itemDir),"silent")});var g=q8(),f=N(g);hn(f,p=>r=p,()=>r),F(t,g),ot()}var $8=$('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),Y8=$('<textarea rows="3"></textarea>'),z8=$('<input type="date" class="svelte-1bn65uv"/>'),W8=$('<input type="time" class="svelte-1bn65uv"/>'),G8=$('<input type="email" class="svelte-1bn65uv"/>'),K8=$('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),V8=$('<input type="text" class="svelte-1bn65uv"/>'),X8=$('<p class="hint svelte-1bn65uv"> </p>'),Q8=$("<p> </p>"),Z8=$('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),J8=$('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),e5=$('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),t5=$('<p class="hint svelte-1bn65uv">Loading fields…</p>'),n5=$('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),r5=$(`<details class="meta-section svelte-1bn65uv"><summary class="svelte-1bn65uv">Meta & SEO</summary> <p class="meta-note svelte-1bn65uv">From the document shell, these fill every page's <head>.</p> <!></details>`),s5=$("<!> <!>",1),a5=$('<div class="divider svelte-1bn65uv" role="separator" aria-orientation="vertical" aria-label="Resize preview" tabindex="0"><span class="grip svelte-1bn65uv"></span></div> <div class="preview-pane svelte-1bn65uv"><!></div>',1),i5=$('<div><div class="form-pane svelte-1bn65uv"><form class="form svelte-1bn65uv"><header class="form-head svelte-1bn65uv"><div class="titles svelte-1bn65uv"><input class="title-input svelte-1bn65uv" type="text" aria-label="Title" placeholder="Untitled"/> <p class="meta svelte-1bn65uv"> </p></div> <div class="head-actions svelte-1bn65uv"><div class="action-buttons svelte-1bn65uv"><!> <!> <button type="button">Preview</button> <button type="button"> </button></div> <label class="pubdate svelte-1bn65uv"><span>Publish date</span> <input type="date" class="svelte-1bn65uv"/></label></div></header> <!></form></div> <!></div> <!>',1);function o5(t,e){it(e,!0);const n=Xn(e,"templates",19,()=>[]),r={name:"title",type:"shorttext",label:"Title",required:!0,multiline:!1,help:"Names the page in the tree and fills {title} where the template uses it, it doesn’t have to appear on the page."},s={name:"published",type:"date",label:"Publish date",required:!1,multiline:!1};let a=Q(!1);const i=()=>new Date().toISOString().slice(0,10);function o(){A(a,!u(a)),u(a)&&(u(E).published??"").trim()===""&&(u(E).published=i()),G()}let l=Q(!1),d=Q(dt([]));function h(){A(l,!0),e.onmove&&tf().then(Ne=>A(d,Ne,!0))}async function g(Ne){var Ye;Ne!==e.templateName&&(await y(),(Ye=e.onchangetemplate)==null||Ye.call(e,Ne))}const f=Ae(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),p=new Set(["richtext","image","file","authors"]);function v(Ne){return p.has(Ne.type)?void 0:`f-${Ne.name}`}let T=Q(dt([])),_=Q(!0),E=Q(dt({})),O=Q(null);const C=700;let H,M=!1,J=0;Qa(()=>{U();const Ne=()=>void y();return window.addEventListener("beforeunload",Ne),()=>{window.removeEventListener("beforeunload",Ne),y()}});async function U(){A(_,!0);const[Ne,Ye]=await Promise.all([LN(e.templateName),ON()]),Xe=Ne.filter(De=>De.name!=="title"&&De.name!=="published"),Je=new Set(Xe.map(De=>De.name)),L=Ye.filter(De=>De.name!=="published"&&!Je.has(De.name)),ue=[r,s,...Xe,...L],_e={};for(const De of ue)_e[De.name]=s6(e.item,De.name);_e.published=(_e.published??"").slice(0,10),A(a,e.item.isPublished,!0),A(T,ue,!0),A(D,Xe,!0),A(W,L,!0),A(E,_e,!0),j6(localStorage,e.path,_e),A(O,$6(localStorage,e.path),!0),A(_,!1)}function G(){M=!0,J+=1,clearTimeout(H),H=setTimeout(()=>void y(),C)}function V(Ne,Ye){const Xe=u(E)[Ne]??"";u(E)[Ne]=Ye,G(),Xe!==""&&Xe!==Ye&&ee(Xe)}async function ee(Ne){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Ne))return;Object.values(u(E)).some(Xe=>typeof Xe=="string"&&Xe.includes(Ne))||await FN(u(f),Ne)}async function y(){var Xe;if(clearTimeout(H),!M)return;const Ne=J,Ye=Ap(e.item,u(T),u(E),u(a));Bs.saving();try{await rv(e.path,Ye),J===Ne&&(M=!1),Bs.saved(),(Xe=e.onsaved)==null||Xe.call(e,e.path,u(E).title??e.item.title,u(a))}catch{Bs.failed(()=>void y())}}async function j(){u(O)===null||!await Ol("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(A(E,{...u(O)},!0),G())}const b=new Set(["text","code"]);function R(Ne,Ye){return Ne.maxLength!==void 0&&Ne.minLength!==void 0?`${Ye} / ${Ne.maxLength} characters (min ${Ne.minLength})`:Ne.maxLength!==void 0?`${Ye} / ${Ne.maxLength} characters`:`${Ye} characters (min ${Ne.minLength})`}function k(Ne,Ye){return Ne.minLength!==void 0&&Ye>0&&Ye<Ne.minLength?!0:Ne.maxLength!==void 0&&Ye>Ne.maxLength}let D=Q(dt([])),W=Q(dt([]));const Y=Ae(()=>u(O)!==null&&JSON.stringify(u(E))!==JSON.stringify(u(O))),B="nanoesis:preview-open";let z=Q(localStorage.getItem(B)==="true");function K(Ne){A(z,Ne,!0),localStorage.setItem(B,String(Ne))}const te=Ae(()=>{if(u(_))return null;try{return{...Kl(JSON.parse(Ap(e.item,u(T),u(E),u(a)))),template:e.templateName}}catch{return null}}),he="nanoesis:preview-split",Ee=.2,ge=.8;function Ce(Ne){return Math.min(ge,Math.max(Ee,Ne))}function fe(){const Ne=Number(localStorage.getItem(he));return Number.isFinite(Ne)&&Ne>0?Ce(Ne):.5}let ne=Q(dt(fe())),de=Q(!1),me;function Te(Ne){Ne.preventDefault(),A(de,!0),Ne.currentTarget.setPointerCapture(Ne.pointerId)}function Ie(Ne){if(!u(de))return;const Ye=me.getBoundingClientRect();A(ne,Ce((Ne.clientX-Ye.left)/Ye.width),!0)}function Oe(Ne){var Ye,Xe;u(de)&&(A(de,!1),(Xe=(Ye=Ne.currentTarget).releasePointerCapture)==null||Xe.call(Ye,Ne.pointerId),localStorage.setItem(he,String(u(ne))))}function Pe(Ne){const Ye=Ne.key==="ArrowLeft"?-.02:Ne.key==="ArrowRight"?.02:0;Ye!==0&&(Ne.preventDefault(),A(ne,Ce(u(ne)+Ye),!0),localStorage.setItem(he,String(u(ne))))}var Fe=i5(),St=tt(Fe);let Be;var Pt=N(St),jt=N(Pt);{const Ne=(Je,L=$f)=>{var ue=Z8(),_e=N(ue),De=N(_e),Ve=I(De);{var We=we=>{var Se=$8();F(we,Se)};ce(Ve,we=>{L().required&&we(We)})}var bt=I(Ve,2),un=N(bt),At=I(_e,2);{var er=we=>{{let Se=Ae(()=>u(E)[L().name]??""),He=Ae(()=>`lbl-${L().name}`);j8(we,{get value(){return u(Se)},get itemDir(){return u(f)},get labelledBy(){return u(He)},placeholder:"Write…",onchange:mt=>{u(E)[L().name]=mt,G()}})}},Ls=we=>{var Se=Y8();let He;se(()=>{be(Se,"id",`f-${L().name}`),be(Se,"maxlength",L().maxLength),be(Se,"minlength",L().minLength),He=Ge(Se,1,"svelte-1bn65uv",null,He,{mono:L().type==="code"})}),ie("input",Se,G),yt(Se,()=>u(E)[L().name],mt=>u(E)[L().name]=mt),F(we,Se)},qr=Ae(()=>b.has(L().type)),ua=we=>{{let Se=Ae(()=>u(E)[L().name]??""),He=Ae(()=>`lbl-${L().name}`);mS(we,{get value(){return u(Se)},get itemDir(){return u(f)},get labelledBy(){return u(He)},onchange:mt=>V(L().name,mt)})}},la=we=>{{let Se=Ae(()=>u(E)[L().name]??""),He=Ae(()=>`lbl-${L().name}`);cS(we,{get value(){return u(Se)},get itemDir(){return u(f)},get labelledBy(){return u(He)},onchange:mt=>{u(E)[L().name]=mt,G()}})}},Kt=we=>{{let Se=Ae(()=>u(E)[L().name]??""),He=Ae(()=>`lbl-${L().name}`);tS(we,{get value(){return u(Se)},get labelledBy(){return u(He)},onchange:mt=>{u(E)[L().name]=mt,G()}})}},ca=we=>{{let Se=Ae(()=>u(E)[L().name]??""),He=Ae(()=>`lbl-${L().name}`);DS(we,{get value(){return u(Se)},get labelledBy(){return u(He)},onchange:mt=>{u(E)[L().name]=mt,G()}})}},da=we=>{var Se=z8();se(()=>be(Se,"id",`f-${L().name}`)),ie("input",Se,G),yt(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)},Os=we=>{var Se=W8();se(()=>be(Se,"id",`f-${L().name}`)),ie("input",Se,G),yt(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)},fa=we=>{var Se=G8();se(()=>{be(Se,"id",`f-${L().name}`),be(Se,"maxlength",L().maxLength),be(Se,"minlength",L().minLength)}),ie("input",Se,G),yt(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)},ha=we=>{var Se=K8();se(()=>{be(Se,"id",`f-${L().name}`),be(Se,"maxlength",L().maxLength),be(Se,"minlength",L().minLength)}),ie("input",Se,G),yt(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)},ln=we=>{var Se=V8();se(()=>{be(Se,"id",`f-${L().name}`),be(Se,"maxlength",L().maxLength),be(Se,"minlength",L().minLength)}),ie("input",Se,G),yt(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)};ce(At,we=>{L().type==="richtext"?we(er):u(qr)?we(Ls,1):L().type==="image"?we(ua,2):L().type==="file"?we(la,3):L().type==="authors"?we(Kt,4):L().type==="url"?we(ca,5):L().type==="date"?we(da,6):L().type==="time"?we(Os,7):L().type==="email"?we(fa,8):L().type==="phone"?we(ha,9):we(ln,-1)})}var xs=I(At,2);{var pa=we=>{var Se=X8(),He=N(Se);se(()=>ae(He,L().help)),F(we,Se)};ce(xs,we=>{L().help&&we(pa)})}var ma=I(xs,2);{var ga=we=>{const Se=Ae(()=>(u(E)[L().name]??"").length);var He=Q8();let mt;var Ht=N(He);se((qt,Jt)=>{mt=Ge(He,1,"hint count svelte-1bn65uv",null,mt,qt),ae(Ht,Jt)},[()=>({over:k(L(),u(Se))}),()=>R(L(),u(Se))]),F(we,He)};ce(ma,we=>{(L().minLength!==void 0||L().maxLength!==void 0)&&we(ga)})}se(we=>{be(_e,"id",`lbl-${L().name}`),be(_e,"for",we),ae(De,`${L().label??""} `),ae(un,L().multiple?"references":L().type)},[()=>v(L())]),F(Je,ue)};var Ct=N(jt),ut=N(Ct),Gt=N(ut),Lt=I(Gt,2),pt=N(Lt),Zt=I(ut,2),pn=N(Zt),vt=N(pn);{var wt=Je=>{var L=J8();ie("click",L,j),F(Je,L)};ce(vt,Je=>{u(Y)&&Je(wt)})}var nt=I(vt,2);{var Qe=Je=>{var L=e5(),ue=N(L);kh(ue,{size:16,"aria-hidden":"true"}),ie("click",L,h),F(Je,L)};ce(nt,Je=>{e.onchangetemplate&&Je(Qe)})}var Mt=I(nt,2);let Ye;var Dt=I(Mt,2);let Xe;var kn=N(Dt),Pn=I(pn,2),on=I(N(Pn),2),$t=I(Ct,2);{var Mn=Je=>{var L=t5();F(Je,L)},br=Je=>{var L=n5();F(Je,L)},In=Je=>{var L=s5(),ue=tt(L);Nt(ue,17,()=>u(D),Ve=>Ve.name,(Ve,We)=>{Ne(Ve,()=>u(We))});var _e=I(ue,2);{var De=Ve=>{var We=r5(),bt=I(N(We),4);Nt(bt,17,()=>u(W),un=>un.name,(un,At)=>{Ne(un,()=>u(At))}),F(Ve,We)};ce(_e,Ve=>{u(W).length>0&&Ve(De)})}F(Je,L)};ce($t,Je=>{u(_)?Je(Mn):u(D).length===0&&u(W).length===0?Je(br,1):Je(In,-1)})}se(()=>{ae(pt,e.templateName),Ye=Ge(Mt,1,"preview-toggle svelte-1bn65uv",null,Ye,{active:u(z)}),be(Mt,"aria-pressed",u(z)),Xe=Ge(Dt,1,"publish-btn svelte-1bn65uv",null,Xe,{on:u(a)}),be(Dt,"aria-pressed",u(a)),be(Dt,"title",u(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),ae(kn,u(a)?"Publish":"Don't Publish")}),ie("input",Gt,G),yt(Gt,()=>u(E).title,Je=>u(E).title=Je),ie("click",Mt,()=>K(!u(z))),ie("click",Dt,o),ie("input",on,G),yt(on,()=>u(E).published,Je=>u(E).published=Je)}var Hr=I(Pt,2);{var os=Ne=>{var Ye=a5(),Xe=tt(Ye),Je=I(Xe,2),L=N(Je);US(L,{get path(){return e.path},get previewItem(){return u(te)},onclose:()=>K(!1)}),se((ue,_e,De)=>{be(Xe,"aria-valuemin",ue),be(Xe,"aria-valuemax",_e),be(Xe,"aria-valuenow",De)},[()=>Math.round(Ee*100),()=>Math.round(ge*100),()=>Math.round(u(ne)*100)]),ie("pointerdown",Xe,Te),ie("pointermove",Xe,Ie),ie("pointerup",Xe,Oe),Ue("pointercancel",Xe,Oe),ie("keydown",Xe,Pe),F(Ne,Ye)};ce(Hr,Ne=>{u(z)&&Ne(os)})}hn(St,Ne=>me=Ne,()=>me);var Jn=I(St,2);{var us=Ne=>{{let Ye=Ae(()=>e.onrename?()=>(A(l,!1),e.onrename()):void 0),Xe=Ae(()=>e.ondelete?()=>(A(l,!1),e.ondelete()):void 0),Je=Ae(()=>e.onmove?L=>(A(l,!1),e.onmove(L)):void 0);SS(Ne,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return u(f)},get folders(){return u(d)},onchangetemplate:L=>{A(l,!1),g(L)},get onrename(){return u(Ye)},get ondelete(){return u(Xe)},get onmove(){return u(Je)},onclose:()=>A(l,!1)})}};ce(Jn,Ne=>{u(l)&&e.onchangetemplate&&Ne(us)})}se(()=>{Be=Ge(St,1,"layout svelte-1bn65uv",null,Be,{split:u(z),dragging:u(de)}),Wl(Pt,u(z)?`flex-basis:${u(ne)*100}%`:void 0)}),Ue("submit",jt,Ne=>Ne.preventDefault()),ie("focusout",jt,()=>void y()),F(t,Fe),ot()}_t(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const Db=""+new URL("nanoesis-logo-CgieIWPg.png",import.meta.url).href,u5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAFS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgZXhpZjpQaXhlbFhEaW1lbnNpb249IjUwIgogICBleGlmOlBpeGVsWURpbWVuc2lvbj0iNTAiCiAgIGV4aWY6Q29sb3JTcGFjZT0iMSIKICAgdGlmZjpJbWFnZVdpZHRoPSI1MCIKICAgdGlmZjpJbWFnZUxlbmd0aD0iNTAiCiAgIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiCiAgIHRpZmY6WFJlc29sdXRpb249IjMwMC8xIgogICB0aWZmOllSZXNvbHV0aW9uPSIzMDAvMSIKICAgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIKICAgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIgogICB4bXA6TW9kaWZ5RGF0ZT0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiCiAgIHhtcDpNZXRhZGF0YURhdGU9IjIwMjYtMDItMjRUMTA6NTY6NTBaIj4KICAgPGRjOnRpdGxlPgogICAgPHJkZjpBbHQ+CiAgICAgPHJkZjpsaSB4bWw6bGFuZz0ieC1kZWZhdWx0Ij54dHJhYmxlLWFpLWxvZ288L3JkZjpsaT4KICAgIDwvcmRmOkFsdD4KICAgPC9kYzp0aXRsZT4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0icHJvZHVjZWQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFmZmluaXR5IERlc2lnbmVyIDEuMTAuNiIKICAgICAgc3RFdnQ6d2hlbj0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KPD94cGFja2V0IGVuZD0iciI/PtBEvDoAAAGBaUNDUHNSR0IgSUVDNjE5NjYtMi4xAAAokXWRv0tCURTHP2pRlGFQg0ODRDVplEHY0qD0C6pBDbJa9OWPwB+P95SQ1qA1KIha+jXUX1Br0BwERRFEczQWtZS8zlNBiTyXc8/nfu89h3vPBWs4rWT0piHIZPNacMrvWowsuVresOKkDR+2qKKrc6HJMA3t6wGLGe88Zq3G5/619tW4roClVXhcUbW88LTw7HpeNXlXuFtJRVeFz4XdmlxQ+N7UYxV+NTlZ4R+TtXAwANZOYVeyjmN1rKS0jLC8nL5MuqBU72O+xB7PLoQk9or3oBNkCj8uZpggwCjDjMk8igcvg7KiQf5QOX+enOQqMqsU0VgjSYo8blELUj0uMSF6XEaaotn/v33VEyPeSnW7H5pfDOOjH1p2oLRtGN/HhlE6AdszXGVr+bkj8H2Kvl3T+g7BsQkX1zUttgeXW+B8UqNatCzZxK2JBLyfQUcEum6hbbnSs+o+p48Q3pCvuoH9AxiQ846VX24uZ+lBa66dAAAACXBIWXMAAC4jAAAuIwF4pT92AAAIcElEQVRogeXZfXAU5R0H8O9ze3t73F1edrMJLyoDHSmoYxkHqrxZ0mpoaEEJiYBSBvriTAuVomBlChUpjDMqVq0F6QwWWrFFJC2UtkHiaDoooKaMQLG8TIWCRSHLbnJc9rKvv/6Ru3AJubvdS5h22u/MzXO57D35ffJ7nid3F+D/MaZNwf90DdkS8HqhaVOpYWOokqCia1lQofEESSFkw8ZA08ak0y008FoXlo7TTqJrk5DvuryQDES5aUM2LAw2bdx/5BwN65dKc8T4jEa5JoaTgYH5MDkhvSA6RxvXGTaWv3OKbu7f0q9EP0WTycAY10C5a0LOh8kKyYEoT92uN22sbzhKo/obEf8rzXINVLkmysmA7AXT6ynkASGbneMAw+59jkKjNdFiMjHZBZT0YwEAbuZ9my4EgszICfGJeHDGbexv9c00FYBaO5a91xeEspsecw3MB6BkFu8F0w1i2sT7RLxX30yzALwa70Dy2b00dekU9m6hENcABYDybgV7xHTbI6EgswwbmmmjzCciqOoo0nQ0LPoNTfQL+GSLs/jTHc74ijr2tGtgPZkod1N7g8zUHjEgZ9kz/FUQAJBj7JJh4Zhpo8wHAlrnrUhLoqH6Re+YUz9211oaXnASeOPTHc6Eijr2hA9MjIzOJvV6ag0vZ6cNG3uNToxXBLQkkO7MiFX5MYfnumutVqywVQZLQ5GTwB4fmJBr4B9clDlZIQDwhRvYYcPG5lRnvCKg6SlMEjNzIQ6Od9faGlZYKmC1Aj4xcE28JQy6stlZvt9aw1GaaNhon3Eb+9AjAloS2zUdD5SEQQBuUdexo5lzvl1Ba3gJK4MigReBoAjwEsCXAkGJwIu4zMVQPbiO239xBz0RELCIhdASEKAEBBxmIawoHsPimXPmhaRT30z3AKj3ifgluc4cR1dmxjcO+nN6rr08vcmLuIuXAJ+Y9wMC5omVTO1Zn+dXvwBYvAPMJ2K+oyuCoyu/E+qaqg5INAYAyMIMS8O7lgrYGoOlAbYG5Flm3yUT3+wN4QtSO5btUnXM1XQ4PhBwdAW2rrQ/vq+kSnWU5gMSPf5VsARZqPaBuaWijtXL09nFbPX56QiWTmGvaTrmakk4PhDqgrfVXxS3JR7VbAWqo6z2iVGcBFrz1eYLAgDrH2CvpTvjBeG0K3cVafF9qqMYmqPAJ+a0rbLK6xdw/8pXl+fN3jMjVtEsLYnJmo7FuRB2Q92HALAssGVqEVfye4mTBZGTIQZlSJy8arzKfvIGKMZ47OFFTMw4AE4HRVSOfjVw1ks9BUPSkZZRIB8iHR+Y00GRKscd8IYAClhaveQmcp3Z+RAAsM5d0HDZaavJs8w2WCp8IYB+6MjOufysPe59N73C/2i5rSt6NkRmcnWm0Dr6BDm+PDpHiTtblTbH3aN/Zc2mjgd350Ok0wvmgsTJo8arLO8J1Vu4Qp4EALRBupEx9hYIHBi4Ie7Hk6Y42/fuPEEnvDz/4Ga92ratk4NPlo1hwCUAX/56vPyTQuspGLL6T0n1qZnRDsZYFQgAA+cSaqs/hyP5MIEtU34A4GfnJ7WOMyP2c4MPiQ8v7rjz74XWAhSwtGj1wGok1IVwrHnsp2ijDdIPL8Wdp5RWG0rcgdLmWK0J574Fu9xdORDPc2UCuLIwgrJgcnJ4eJu06XxfIL5OLXppQjUi4k7EpOng+EZ6BCVsofp0WTH3mFwahFzMQS7h+NIY9/qWewP3ekDYnBye11eELwjVfyONEBARgZj0RT+YLIi5bdKm7aDaoaDak2Gas7RQiKelRftWVaNd24l2VUBCA3QNSKjp8QM4VlWOZVbzrZq7b8yJAJrC4IdLiEFEdNkx9sKzfiF5O0InfjURUWknoqKAqATERKQ6Ag+d6fjt7Tff7QMBEbF10+lJ353Jv7SEWALR0iSiEhAV4QNzeeOIERsarxuyxAcCIqKQEFu3hF72hcm6tBL7nrmdHIOKKld+QGfqx8JINKK9tRTtKtCuAe0q8iyzCi4ydihXJjRyZeFSH4jUGIWI2OyH2LTtXiC9dkQ/tHkcC0W2ME7YfblpbSUbVtsMIVaFaGmrh85sBQC2UL3oLtjbzJWFq4KyoBSA+KeI6PsFd6Tj+B9uJSu5mix9CFm6TKYeI8eYU1S5sslDZwzoWg1bdaEhc84S9TuRNmmT7hNRGUbgPICNDOxQLfvSz3NBun1kapzdPxyWfj+ANgB81zdMbLvctHYOG1bbRGfqqwA0AijtMZcBoIY9eryhx+Nokzbpqbsv+US8zsC+JoCvbqTmeBUb++tskK6lZSknKxgfuRN8pJXxkRbGD1A6x4jCQpEE44RtOZaZgZhYw763/ypEZsLgH5EQ+8wnokUAr4TAzz9IH03LCXF0NcL4yDDGRzTGR1rARxQfGANRsYbVbs2JAIAOtu2EiGilmML4QLQI4BUBfPUxOjO+t7kZALhWRxFZ+kCydJksvTw9ouvr5JXHu++Z0TASxWzk/H35EJmZTk+OlBBrEhEd5APREkqNAvg3b2AV3V6Ydm121+ooJkuv8IG5p6hypedTpWeW0MsjJUSbRMQMn4j010dKWazrn0Fdmz3Ah+Ou1XHVDyT0+sfGhNm3t8nPs2+feJH+eIeIqB1GQPGJUATwVuZ83U4tjxgLwMPROxYd7AsEAB5i084CwA76yxqfiHMh8G1ZIR4wNoDnBtw6+0hfEZlhYK8I4KcL4AMeERrHAj3myJJe9oxIlv6OMHTCx/2JSKeRmoeFwD8jgHf9InJCemAksvQzvPz5rJ+99kcO0kdDBPDfD4E3/SAAD+9HUkezw0UkPd+1/ZFjdEZOLTPdKwLoh8+1rkXO0cUiAfzoEPi4F8R/dVopISTJiDnk5r/4fyn/BmrDD+pUdvB8AAAAAElFTkSuQmCC";let Fo=Q("idle"),fl=Q(dt([])),hl=Q(dt([])),od=Q(!1),ud;async function L1(){A(Fo,"checking");try{const t=await RN();A(fl,[...t.errors],!0),A(hl,[...t.warnings],!0),A(Fo,"done")}catch{A(Fo,"error")}}const yn={get status(){return u(Fo)},get errors(){return u(fl)},get warnings(){return u(hl)},get count(){return u(fl).length+u(hl).length},get hasProblems(){return u(Fo)==="done"&&u(fl).length+u(hl).length>0},get panelOpen(){return u(od)},refresh(){return clearTimeout(ud),L1()},scheduleRefresh(t=1200){clearTimeout(ud),ud=setTimeout(()=>void L1(),t)},openPanel(){A(od,!0)},closePanel(){A(od,!1)}};var l5=$('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),c5=$('<button type="button" class="problems svelte-jz8lnl"> </button>'),d5=$('<footer><div class="credit svelte-jz8lnl"><img class="logo svelte-jz8lnl" alt="" width="20" height="20"/> <span>nanoesis by <a target="_blank" rel="noopener noreferrer" class="svelte-jz8lnl">xtrable ltd</a></span></div> <div aria-live="polite"><span> </span> <!></div> <!> <a class="xtrable svelte-jz8lnl" target="_blank" rel="noopener noreferrer" aria-label="xtrable ltd"><img alt="xtrable" width="24" height="24" class="svelte-jz8lnl"/></a></footer>');function f5(t,e){it(e,!0);const n=Ae(()=>Bs.state==="saving"?"Saving…":Bs.state==="error"?"Save failed":"Saved");Rt(()=>{Ah.value,yn.scheduleRefresh()});const r=Ae(()=>yn.count),s="https://xtrable.com/";var a=d5();let i;var o=N(a),l=N(o),d=I(l,2),h=I(N(d));be(h,"href",s);var g=I(o,2);let f;var p=N(g),v=N(p),T=I(p,2);{var _=M=>{var J=l5();ie("click",J,()=>Bs.retry()),F(M,J)};ce(T,M=>{Bs.canRetry&&M(_)})}var E=I(g,2);{var O=M=>{var J=c5(),U=N(J);se(()=>ae(U,`${u(r)??""}
|
|
129
|
-
${u(r)===1?"problem":"problems"}`)),ie("click",J,()=>
|
|
130
|
-
page’s title.</p></div>`),b5=$('<p class="error svelte-1uvxo8j" role="alert"> </p>'),E5=$('<dialog aria-label="Folder settings" class="svelte-1uvxo8j"><form><h2 class="svelte-1uvxo8j">Folder settings</h2> <p class="path svelte-1uvxo8j"> </p> <label class="svelte-1uvxo8j"><span class="svelte-1uvxo8j">Default template</span> <select class="svelte-1uvxo8j"><option>(none, items must set their own)</option><!></select> <span class="help svelte-1uvxo8j">New items here inherit this template unless they pick their own. Stored in the folder’s <code>_sort.json</code>.</span></label> <!> <!> <!> <div class="actions svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">Cancel</button> <button type="submit" class="primary svelte-1uvxo8j">Save</button></div></form></dialog>');function _5(t,e){it(e,!0);const n=Xn(e,"folders",19,()=>[]);let r=Q(""),s=Q(!0),a=Q(null),i;const o=Ae(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),l=Ae(()=>n().filter(b=>b!==e.folderPath&&b!==u(o)&&!b.startsWith(`${e.folderPath}/`))),d=" ";let h=Q(d);Qa(()=>{i.showModal(),WN(e.folderPath).then(b=>{A(r,b,!0)}).finally(()=>{A(s,!1)})});async function g(b){b.preventDefault(),A(a,null);try{await GN(e.folderPath,u(r)),e.onsaved()}catch(R){A(a,R instanceof Error?R.message:String(R),!0)}}var f=E5(),p=N(f),v=I(N(p),2),T=N(v),_=I(v,2),E=I(N(_),2),O=N(E);O.value=O.__value="";var C=I(O);Nt(C,16,()=>e.templates,b=>b,(b,R)=>{var k=h5(),D=N(k),W={};se(()=>{ae(D,R),W!==(W=R)&&(k.value=(k.__value=R)??"")}),F(b,k)});var H=I(_,2);{var M=b=>{var R=g5(),k=I(N(R),2),D=N(k),W=I(N(D),2),Y=N(W);Y.value=Y.__value=d;var B=I(Y);{var z=he=>{var Ee=p5();Ee.value=Ee.__value="",F(he,Ee)};ce(B,he=>{u(o)!==""&&he(z)})}var K=I(B);Nt(K,16,()=>u(l),he=>he,(he,Ee)=>{var ge=m5(),Ce=N(ge),fe={};se(()=>{ae(Ce,`${Ee??""}/`),fe!==(fe=Ee)&&(ge.value=(ge.__value=Ee)??"")}),F(he,ge)});var te=I(D,2);se(()=>te.disabled=u(h)===d),$a(W,()=>u(h),he=>A(h,he)),ie("click",te,()=>e.onmove(u(h))),F(b,R)};ce(H,b=>{e.onmove&&b(M)})}var J=I(H,2);{var U=b=>{var R=v5(),k=I(N(R),2),D=N(k),W=I(D,2),Y=I(W,2);ie("click",D,function(...B){var z;(z=e.onnewsubfolder)==null||z.apply(this,B)}),ie("click",W,function(...B){var z;(z=e.onrenamefolder)==null||z.apply(this,B)}),ie("click",Y,function(...B){var z;(z=e.ondeletefolder)==null||z.apply(this,B)}),F(b,R)};ce(J,b=>{e.folderPath!==""&&b(U)})}var G=I(J,2);{var V=b=>{var R=b5(),k=N(R);se(()=>ae(k,u(a))),F(b,R)};ce(G,b=>{u(a)&&b(V)})}var ee=I(G,2),y=N(ee),j=I(y,2);hn(f,b=>i=b,()=>i),se(()=>{ae(T,e.folderPath===""?"/ (root)":`${e.folderPath}/`),E.disabled=u(s),j.disabled=u(s)}),Ue("cancel",f,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),Ue("close",f,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),Ue("submit",p,g),$a(E,()=>u(r),b=>A(r,b)),ie("click",y,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),F(t,f),ot()}_t(["click"]);var T5=$("<option></option>"),A5=$("<option> </option>"),y5=$('<p class="error svelte-1t0ew8l" role="alert"> </p>'),N5=$('<dialog aria-label="New content item" class="svelte-1t0ew8l"><form><h2 class="svelte-1t0ew8l">New content item</h2> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Title</span> <input required="" class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Slug</span> <input class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Folder</span> <input list="folder-options" placeholder="/ (root), or type a new folder" class="svelte-1t0ew8l"/> <datalist id="folder-options"></datalist> <span class="help svelte-1t0ew8l">Pick an existing folder or type a new path to create it.</span></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Template</span> <select class="svelte-1t0ew8l"><option>Inherit the folder’s default</option><!></select> <span class="help svelte-1t0ew8l">A folder’s default is set in its folder settings (the gear button in the tree).</span></label> <!> <div class="actions svelte-1t0ew8l"><button type="button" class="ghost svelte-1t0ew8l">Cancel</button> <button type="submit" class="primary svelte-1t0ew8l">Create</button></div></form></dialog>');function S5(t,e){it(e,!0);const n=Xn(e,"initialFolder",3,"");let r=Q(""),s=Q(""),a=Q(""),i=Q("");Rt(()=>{A(a,n())});let o=!1,l=Q(null),d;Qa(()=>d.showModal());function h(){o||A(s,bs(u(r)),!0)}async function g(b){b.preventDefault(),A(l,null);const R=bs(u(s)||u(r));if(R===""){A(l,"A title or slug is required.");return}const k=u(a).split("/").map(W=>bs(W)).filter(W=>W!=="").join("/"),D=k===""?R:`${k}/${R}`;try{await iv(D,u(r).trim()||R,u(i)),e.oncreated(D)}catch(W){A(l,W instanceof Error?W.message:String(W),!0)}}var f=N5(),p=N(f),v=I(N(p),2),T=I(N(v),2);ja(T,!0);var _=I(v,2),E=I(N(_),2),O=I(_,2),C=I(N(O),2),H=I(C,2);Nt(H,20,()=>e.folders,b=>b,(b,R)=>{var k=T5(),D={};se(()=>{D!==(D=R)&&(k.value=(k.__value=R)??"")}),F(b,k)});var M=I(O,2),J=I(N(M),2),U=N(J);U.value=U.__value="";var G=I(U);Nt(G,16,()=>e.templates,b=>b,(b,R)=>{var k=A5(),D=N(k),W={};se(()=>{ae(D,R),W!==(W=R)&&(k.value=(k.__value=R)??"")}),F(b,k)});var V=I(M,2);{var ee=b=>{var R=y5(),k=N(R);se(()=>ae(k,u(l))),F(b,R)};ce(V,b=>{u(l)&&b(ee)})}var y=I(V,2),j=N(y);hn(f,b=>d=b,()=>d),se(b=>be(E,"placeholder",b),[()=>bs(u(r))||"my-item"]),Ue("cancel",f,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),Ue("close",f,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),Ue("submit",p,g),ie("input",T,h),yt(T,()=>u(r),b=>A(r,b)),ie("input",E,()=>o=!0),yt(E,()=>u(s),b=>A(s,b)),yt(C,()=>u(a),b=>A(a,b)),$a(J,()=>u(i),b=>A(i,b)),ie("click",j,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),F(t,f),ot()}_t(["input","click"]);function Uf(t){let e=!1;return t.map(n=>n.status==="done"?n:e?{...n,status:"pending"}:(e=!0,{...n,status:"active"}))}function kb(t){return t.map(e=>({...e,status:"pending"}))}function O1(t){return t.map(e=>({...e,status:"done"}))}function Qu(t){return{phase:"validating",resources:Uf(kb((t==null?void 0:t.resources)??[])),done:0,total:(t==null?void 0:t.resources.length)??0,uploaded:0,uploadTotal:0}}function x1(t,e){switch(e.phase){case"validate":return{...t,phase:"validating"};case"plan":{const n=Uf(kb(e.plan.resources));return{...t,phase:"building",resources:n,done:0,total:e.plan.resources.length}}case"resource":{const n=t.resources.map(r=>r.id===e.resource.id?{...r,status:"done"}:r);return{...t,phase:"building",resources:Uf(n),done:e.done,total:e.total}}case"upload":return{...t,phase:"uploading",resources:O1(t.resources),done:t.total,uploaded:e.written,uploadTotal:e.total};case"purge":return{...t,phase:"purging"};case"done":return{...t,phase:"done",resources:O1(t.resources),done:t.total,written:e.written,...e.summary!==void 0&&{summary:e.summary}};case"blocked":return{...t,phase:"blocked",errors:e.errors};case"error":return{...t,phase:"error",message:e.message}}}function w5(t){switch(t.phase){case"validating":return .02;case"building":return .05+.78*(t.total===0?1:t.done/t.total);case"uploading":return .83+.15*(t.uploadTotal===0?1:t.uploaded/t.uploadTotal);case"purging":return .99;case"done":return 1;case"blocked":case"error":return t.total===0?0:t.done/t.total}}function I5(){let t=Q(!1),e=Q(!1),n=Q(dt(Qu())),r=Q(0),s,a=0;const i=()=>u(n).phase==="done"||u(n).phase==="blocked"||u(n).phase==="error";function o(){const l=w5(u(n))*100,d=i(),h=(performance.now()-a)/1e3,g=8+82*(1-Math.exp(-h/4)),f=d?u(n).phase==="done"?100:l:Math.max(l,g);A(r,u(r)+(f-u(r))*.12),Math.abs(f-u(r))<.2&&A(r,f,!0);const p=d&&u(r)===f;s=u(t)&&!p?requestAnimationFrame(o):void 0}return{get active(){return u(t)},get running(){return u(e)},get state(){return u(n)},get percent(){return Math.round(u(r))},async start(){if(!u(e)){A(t,!0),A(e,!0),a=performance.now(),A(r,0),A(n,Qu(),!0),s===void 0&&(s=requestAnimationFrame(o));try{A(n,Qu(await DN()),!0),await kN(l=>{A(n,x1(u(n),l),!0)})}catch(l){const d=l instanceof Error?l.message:String(l);A(n,x1(u(n),{phase:"error",message:d}),!0)}finally{A(e,!1),s===void 0&&(s=requestAnimationFrame(o))}}},close(){u(e)||(A(t,!1),s!==void 0&&(cancelAnimationFrame(s),s=void 0),A(n,Qu(),!0),A(r,0))}}}const Ks=I5();var C5=$('<div class="bar-row svelte-1o0yh0y"><div class="bar svelte-1o0yh0y" role="progressbar" aria-label="Publish progress"><div></div></div> <span class="pct svelte-1o0yh0y" aria-hidden="true"> </span></div> <p class="sr-only svelte-1o0yh0y" aria-live="polite"> </p>',1),L5=$('<li class="svelte-1o0yh0y"> </li>'),O5=$('<div class="panel blocked-panel svelte-1o0yh0y"><p class="panel-lead svelte-1o0yh0y">Fix these, then publish again:</p> <ul class="errors svelte-1o0yh0y"></ul></div>'),x5=$('<div class="panel error-panel svelte-1o0yh0y"><p class="svelte-1o0yh0y"> </p></div>'),R5=$('<span class="spinner svelte-1o0yh0y"></span>'),D5=$('<span class="pending-dot svelte-1o0yh0y"></span>'),k5=$('<li><span class="dot svelte-1o0yh0y" aria-hidden="true"><!></span> <span class="row-label svelte-1o0yh0y"> </span> <span class="sr-only svelte-1o0yh0y"> </span></li>'),P5=$('<div class="group svelte-1o0yh0y"><div class="group-head svelte-1o0yh0y"><!> <span class="group-label svelte-1o0yh0y"> </span> <span class="group-count svelte-1o0yh0y"> </span></div> <ul class="rows svelte-1o0yh0y"></ul></div>'),M5=$('<span class="group-count svelte-1o0yh0y"> </span>'),B5=$('<span class="spinner svelte-1o0yh0y"></span>'),F5=$('<span class="pending-dot svelte-1o0yh0y"></span>'),U5=$('<div class="group svelte-1o0yh0y"><div class="group-head svelte-1o0yh0y"><!> <span class="group-label svelte-1o0yh0y">Upload</span> <!></div> <ul class="rows svelte-1o0yh0y"><li><span class="dot svelte-1o0yh0y" aria-hidden="true"><!></span> <span class="row-label svelte-1o0yh0y"> </span></li></ul></div>'),H5=$('<div class="timeline svelte-1o0yh0y" aria-label="Resources"><!> <!></div>'),q5=$('<p class="note warn svelte-1o0yh0y"> </p>'),j5=$('<p class="note svelte-1o0yh0y"> </p>'),$5=$('<button type="button" class="ghost svelte-1o0yh0y" disabled="">Publishing…</button>'),Y5=$('<button type="button" class="primary svelte-1o0yh0y"> </button>'),z5=$('<section class="publish svelte-1o0yh0y" aria-label="Publishing"><div class="card svelte-1o0yh0y"><header><div class="badge svelte-1o0yh0y" aria-hidden="true"><!></div> <div class="head-text svelte-1o0yh0y"><h1 class="svelte-1o0yh0y"> </h1> <p class="caption svelte-1o0yh0y" aria-live="polite"> </p></div></header> <!> <!> <!> <footer class="actions svelte-1o0yh0y"><!></footer></div></section>');function W5(t,e){it(e,!0);const n=Ae(()=>Ks.state),r=Ae(()=>Ks.percent),s={image:k6,file:D6,page:P6},a={image:"Images",file:"Files",page:"Pages"},i=Ae(()=>["image","file","page"].map(de=>{const me=u(n).resources.filter(Ie=>Ie.kind===de),Te=me.filter(Ie=>Ie.status==="done").length;return{kind:de,label:a[de],icon:s[de],items:me,done:Te}}).filter(de=>de.items.length>0)),o=Ae(()=>{var ne;return(ne=u(n).resources.find(de=>de.status==="active"))==null?void 0:ne.kind}),l={validating:"Checking what would break…",building:"Building your site…",uploading:"Uploading to your live site…",purging:"Clearing the CDN cache…",done:"Published",blocked:"Publish blocked",error:"Publish failed"},d=Ae(()=>{if(u(n).phase==="building"){if(u(o)==="image")return"Optimising images…";if(u(o)==="file")return"Copying files…";if(u(o)==="page")return"Rendering pages…"}return l[u(n).phase]}),h=Ae(()=>u(n).phase==="error"),g=Ae(()=>u(n).phase==="blocked"),f=Ae(()=>u(n).phase==="done"),p=Ae(()=>{var ne;return u(f)&&((ne=u(n).summary)==null?void 0:ne.published)===0}),v=Ae(()=>{var ne,de;if(u(h))return"Publish failed";if(u(g)){const me=((ne=u(n).errors)==null?void 0:ne.length)??0;return`${me} ${me===1?"thing":"things"} would break`}if(u(p))return"Nothing went live";if(u(f)){const me=((de=u(n).summary)==null?void 0:de.published)??0;return me>0?`Published ${me} ${me===1?"page":"pages"}`:`Published ${u(n).written??0} ${u(n).written===1?"file":"files"}`}return"Publishing your site"}),T=Ae(()=>`${u(v)}. ${u(d)}`);function _(ne){return ne.status==="done"?"done":ne.status==="active"?"in progress":"waiting"}var E=z5(),O=N(E),C=N(O);let H;var M=N(C),J=N(M);{var U=ne=>{F6(ne,{size:22})},G=ne=>{B6(ne,{size:22})},V=ne=>{M6(ne,{size:22})};ce(J,ne=>{u(h)||u(g)?ne(U):u(f)?ne(G,1):ne(V,-1)})}var ee=I(M,2),y=N(ee),j=N(y),b=I(y,2),R=N(b),k=I(C,2);{var D=ne=>{var de=C5(),me=tt(de),Te=N(me);be(Te,"aria-valuemin",0),be(Te,"aria-valuemax",100);var Ie=N(Te);let Oe;var Pe=I(Te,2),Fe=N(Pe),St=I(me,2),Be=N(St);se(()=>{be(Te,"aria-valuenow",u(r)),Oe=Ge(Ie,1,"fill svelte-1o0yh0y",null,Oe,{done:u(f)}),Wl(Ie,`width: ${u(r)}%`),ae(Fe,`${u(r)??""}%`),ae(Be,u(T))}),F(ne,de)};ce(k,ne=>{!u(g)&&!u(h)&&ne(D)})}var W=I(k,2);{var Y=ne=>{var de=O5(),me=I(N(de),2);Nt(me,20,()=>u(n).errors??[],Te=>Te,(Te,Ie)=>{var Oe=L5(),Pe=N(Oe);se(()=>ae(Pe,Ie)),F(Te,Oe)}),F(ne,de)},B=ne=>{var de=x5(),me=N(de),Te=N(me);se(()=>ae(Te,u(n).message)),F(ne,de)},z=ne=>{var de=H5(),me=N(de);Nt(me,17,()=>u(i),Oe=>Oe.kind,(Oe,Pe)=>{var Fe=P5(),St=N(Fe),Be=N(St);wd(Be,()=>u(Pe).icon,(Lt,pt)=>{pt(Lt,{size:15,"aria-hidden":"true"})});var Pt=I(Be,2),jt=N(Pt),Ct=I(Pt,2),ut=N(Ct),Gt=I(St,2);Nt(Gt,21,()=>u(Pe).items,Lt=>Lt.id,(Lt,pt)=>{var Zt=k5();let pn;var vt=N(Zt),wt=N(vt);{var nt=$t=>{_p($t,{size:13})},Qe=$t=>{var Mn=R5();F($t,Mn)},Mt=$t=>{var Mn=D5();F($t,Mn)};ce(wt,$t=>{u(pt).status==="done"?$t(nt):u(pt).status==="active"?$t(Qe,1):$t(Mt,-1)})}var Dt=I(vt,2),kn=N(Dt),Pn=I(Dt,2),on=N(Pn);se($t=>{pn=Ge(Zt,1,"row svelte-1o0yh0y",null,pn,{active:u(pt).status==="active",done:u(pt).status==="done"}),be(Dt,"title",u(pt).id),ae(kn,u(pt).label),ae(on,$t)},[()=>_(u(pt))]),F(Lt,Zt)}),se(()=>{ae(jt,u(Pe).label),ae(ut,`${u(Pe).done??""}/${u(Pe).items.length??""}`)}),F(Oe,Fe)});var Te=I(me,2);{var Ie=Oe=>{var Pe=U5(),Fe=N(Pe),St=N(Fe);R6(St,{size:15,"aria-hidden":"true"});var Be=I(St,4);{var Pt=nt=>{var Qe=M5(),Mt=N(Qe);se(()=>ae(Mt,`${u(n).uploaded??""}/${u(n).uploadTotal??""}`)),F(nt,Qe)};ce(Be,nt=>{u(n).uploadTotal>0&&nt(Pt)})}var jt=I(Fe,2),Ct=N(jt);let ut;var Gt=N(Ct),Lt=N(Gt);{var pt=nt=>{_p(nt,{size:13})},Zt=nt=>{var Qe=B5();F(nt,Qe)},pn=nt=>{var Qe=F5();F(nt,Qe)};ce(Lt,nt=>{u(f)?nt(pt):u(n).phase==="uploading"?nt(Zt,1):nt(pn,-1)})}var vt=I(Gt,2),wt=N(vt);se(()=>{ut=Ge(Ct,1,"row svelte-1o0yh0y",null,ut,{active:u(n).phase==="uploading",done:u(f)}),ae(wt,u(f)?`Uploaded ${u(n).written??u(n).uploadTotal} files to the live site`:`Uploading ${u(n).uploadTotal} files…`)}),F(Oe,Pe)};ce(Te,Oe=>{(u(n).uploadTotal>0||u(n).phase==="uploading"||u(f))&&Oe(Ie)})}F(ne,de)};ce(W,ne=>{u(g)?ne(Y):u(h)?ne(B,1):ne(z,-1)})}var K=I(W,2);{var te=ne=>{var de=q5(),me=N(de);se(()=>{var Te;return ae(me,((Te=u(n).summary)==null?void 0:Te.firstPublishWarning)??"Your site has no published pages. Toggle Publish on at least one page to go live.")}),F(ne,de)},he=ne=>{var de=j5(),me=N(de);se(()=>{var Te,Ie;return ae(me,`${((Te=u(n).summary)==null?void 0:Te.drafts)??""}
|
|
131
|
-
${((
|
|
132
|
-
listing template loops over this section's items) and create it.</p> <label class="svelte-y9gf4p"><span class="svelte-y9gf4p">Template</span> <select class="svelte-y9gf4p"><option>Inherit the folder’s default</option><!></select></label> <button type="button" class="primary svelte-y9gf4p"> </button></div></div>`);function
|
|
122
|
+
`,{[Cn.blotName]:n}),i.insert(o)),a)],new WeakMap)}}Ab.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};const Ho=class Ho extends _n{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",r0()),n}static formats(e){if(e.hasAttribute("data-row"))return e.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(e,n){e===Ho.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(e,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}};ye(Ho,"blotName","table"),ye(Ho,"tagName","TD");let Ir=Ho;class Is extends ri{checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const e=this.children.head.formats(),n=this.children.tail.formats(),r=this.next.children.head.formats(),s=this.next.children.tail.formats();return e.table===n.table&&e.table===r.table&&e.table===s.table}return!1}optimize(e){super.optimize(e),this.children.forEach(n=>{if(n.next==null)return;const r=n.formats(),s=n.next.formats();if(r.table!==s.table){const a=this.splitAfter(n);a&&a.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}ye(Is,"blotName","table-row"),ye(Is,"tagName","TR");class es extends ri{}ye(es,"blotName","table-body"),ye(es,"tagName","TBODY");class Xi extends ri{balanceCells(){const e=this.descendants(Is),n=e.reduce((r,s)=>Math.max(s.children.length,r),0);e.forEach(r=>{new Array(n-r.children.length).fill(0).forEach(()=>{let s;r.children.head!=null&&(s=Ir.formats(r.children.head.domNode));const a=this.scroll.create(Ir.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(es);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e);s!=null&&s.remove()})}insertColumn(e){const[n]=this.descendant(es);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=Ir.formats(r.children.head.domNode),i=this.scroll.create(Ir.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(es);if(n==null||n.children.head==null)return;const r=r0(),s=this.scroll.create(Is.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(Ir.blotName,r);s.appendChild(i)});const a=n.children.at(e);n.insertBefore(s,a)}rows(){const e=this.children.head;return e==null?[]:e.children.map(n=>n)}}ye(Xi,"blotName","table-container"),ye(Xi,"tagName","TABLE");Xi.allowedChildren=[es];es.requiredContainer=Xi;es.allowedChildren=[Is];Is.requiredContainer=es;Is.allowedChildren=[Ir];Ir.requiredContainer=Is;function r0(){return`row-${Math.random().toString(36).slice(2,6)}`}class FO extends Ur{static register(){le.register(Ir),le.register(Is),le.register(es),le.register(Xi)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Xi).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(le.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(le.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(le.sources.USER),this.quill.setSelection(n,le.sources.SILENT)}getTable(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(e==null)return[null,null,null,-1];const[n,r]=this.quill.getLine(e.index);if(n==null||n.statics.blotName!==Ir.blotName)return[null,null,null,-1];const s=n.parent;return[s.parent.parent,s,n,r]}insertColumn(e){const n=this.quill.getSelection();if(!n)return;const[r,s,a]=this.getTable(n);if(a==null)return;const i=a.cellOffset();r.insertColumn(i+e),this.quill.update(le.sources.USER);let o=s.rowOffset();e===0&&(o+=1),this.quill.setSelection(n.index+o,n.length,le.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(e){const n=this.quill.getSelection();if(!n)return;const[r,s,a]=this.getTable(n);if(a==null)return;const i=s.rowOffset();r.insertRow(i+e),this.quill.update(le.sources.USER),e>0?this.quill.setSelection(n,le.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,le.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(e,n){const r=this.quill.getSelection();if(r==null)return;const s=new Array(e).fill(0).reduce(a=>{const i=new Array(n).fill(`
|
|
123
|
+
`).join("");return a.insert(i,{table:r0()})},new xe().retain(r.index));this.quill.updateContents(s,le.sources.USER),this.quill.setSelection(r.index,le.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(le.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(le.events.TEXT_CHANGE,(r,s,a)=>{a===le.sources.USER&&this.balanceTables()}),!0):!1)})}}const A1=Ls("quill:toolbar");class s0 extends Ur{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),UO(a,this.options.container),(s=(r=e.container)==null?void 0:r.parentNode)==null||s.insertBefore(a,e.container),this.container=a}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){A1.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(a=>{var o;const i=(o=this.options.handlers)==null?void 0:o[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(le.events.EDITOR_CHANGE,()=>{const[a]=this.quill.selection.getRange();this.update(a)})}addHandler(e,n){this.handlers[e]=n}attach(e){let n=Array.from(e.classList).find(s=>s.indexOf("ql-")===0);if(!n)return;if(n=n.slice(3),e.tagName==="BUTTON"&&e.setAttribute("type","button"),this.handlers[n]==null&&this.quill.scroll.query(n)==null){A1.warn("ignoring attaching to nonexistent format",n,e);return}const r=e.tagName==="SELECT"?"change":"click";e.addEventListener(r,s=>{let a;if(e.tagName==="SELECT"){if(e.selectedIndex<0)return;const o=e.options[e.selectedIndex];o.hasAttribute("selected")?a=!1:a=o.value||!1}else e.classList.contains("ql-active")?a=!1:a=e.value||!e.hasAttribute("value"),s.preventDefault();this.quill.focus();const[i]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,a);else if(this.quill.scroll.query(n).prototype instanceof Qn){if(a=prompt(`Enter ${n}`),!a)return;this.quill.updateContents(new xe().retain(i.index).delete(i.length).insert({[n]:a}),le.sources.USER)}else this.quill.format(n,a,le.sources.USER);this.update(i)}),this.controls.push([n,e])}update(e){const n=e==null?{}:this.quill.getFormat(e);this.controls.forEach(r=>{const[s,a]=r;if(a.tagName==="SELECT"){let i=null;if(e==null)i=null;else if(n[s]==null)i=a.querySelector("option[selected]");else if(!Array.isArray(n[s])){let o=n[s];typeof o=="string"&&(o=o.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${o}"]`)}i==null?(a.value="",a.selectedIndex=-1):i.selected=!0}else if(e==null)a.classList.remove("ql-active"),a.setAttribute("aria-pressed","false");else if(a.hasAttribute("value")){const i=n[s],o=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",o),a.setAttribute("aria-pressed",o.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}s0.DEFAULTS={};function y1(t,e,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${e}`),r.setAttribute("aria-pressed","false"),n!=null?(r.value=n,r.setAttribute("aria-label",`${e}: ${n}`)):r.setAttribute("aria-label",e),t.appendChild(r)}function UO(t,e){Array.isArray(e[0])||(e=[e]),e.forEach(n=>{const r=document.createElement("span");r.classList.add("ql-formats"),n.forEach(s=>{if(typeof s=="string")y1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?HO(r,a,i):y1(r,a,i)}}),t.appendChild(r)})}function HO(t,e,n){const r=document.createElement("select");r.classList.add(`ql-${e}`),n.forEach(s=>{const a=document.createElement("option");s!==!1?a.setAttribute("value",String(s)):a.setAttribute("selected","selected"),r.appendChild(a)}),t.appendChild(r)}s0.DEFAULTS={container:null,handlers:{clean(){const t=this.quill.getSelection();if(t!=null)if(t.length===0){const e=this.quill.getFormat();Object.keys(e).forEach(n=>{this.quill.scroll.query(n,Re.INLINE)!=null&&this.quill.format(n,!1,le.sources.USER)})}else this.quill.removeFormat(t.index,t.length,le.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",le.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,le.sources.USER),this.quill.format("direction",t,le.sources.USER)},indent(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e),r=parseInt(n.indent||0,10);if(t==="+1"||t==="-1"){let s=t==="+1"?1:-1;n.direction==="rtl"&&(s*=-1),this.quill.format("indent",r+s,le.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,le.sources.USER)},list(t){const e=this.quill.getSelection(),n=this.quill.getFormat(e);t==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,le.sources.USER):this.quill.format("list","unchecked",le.sources.USER):this.quill.format("list",t,le.sources.USER)}}};const qO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',jO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',$O='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',YO='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',zO='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',WO='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',GO='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',KO='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',N1='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',VO='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',XO='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',QO='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',ZO='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',JO='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',e8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',t8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',n8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',r8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',s8='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',a8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',i8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',o8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',u8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',l8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',c8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',d8='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',f8='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',h8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',p8='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',m8='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',g8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',v8='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',b8='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',eu={align:{"":qO,center:jO,right:$O,justify:YO},background:zO,blockquote:WO,bold:GO,clean:KO,code:N1,"code-block":N1,color:VO,direction:{"":XO,rtl:QO},formula:ZO,header:{1:JO,2:e8,3:t8,4:n8,5:r8,6:s8},italic:a8,image:i8,indent:{"+1":o8,"-1":u8},link:l8,list:{bullet:c8,check:d8,ordered:f8},script:{sub:h8,super:p8},strike:m8,table:g8,underline:v8,video:b8},E8='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let S1=0;function w1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class hc{constructor(e){this.select=e,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),n.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),w1(this.label,"aria-expanded"),w1(this.options,"aria-hidden")}buildItem(e){const n=document.createElement("span");n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item");const r=e.getAttribute("value");return r&&n.setAttribute("data-value",r),e.textContent&&n.setAttribute("data-label",e.textContent),n.addEventListener("click",()=>{this.selectItem(n,!0)}),n.addEventListener("keydown",s=>{switch(s.key){case"Enter":this.selectItem(n,!0),s.preventDefault();break;case"Escape":this.escape(),s.preventDefault();break}}),n}buildLabel(){const e=document.createElement("span");return e.classList.add("ql-picker-label"),e.innerHTML=E8,e.tabIndex="0",e.setAttribute("role","button"),e.setAttribute("aria-expanded","false"),this.container.appendChild(e),e}buildOptions(){const e=document.createElement("span");e.classList.add("ql-picker-options"),e.setAttribute("aria-hidden","true"),e.tabIndex="-1",e.id=`ql-picker-options-${S1}`,S1+=1,this.label.setAttribute("aria-controls",e.id),this.options=e,Array.from(this.select.options).forEach(n=>{const r=this.buildItem(n);e.appendChild(r),n.selected===!0&&this.selectItem(r)}),this.container.appendChild(e)}buildPicker(){Array.from(this.select.attributes).forEach(e=>{this.container.setAttribute(e.name,e.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");e!==r&&(r!=null&&r.classList.remove("ql-selected"),e!=null&&(e.classList.add("ql-selected"),this.select.selectedIndex=Array.from(e.parentNode.children).indexOf(e),e.hasAttribute("data-value")?this.label.setAttribute("data-value",e.getAttribute("data-value")):this.label.removeAttribute("data-value"),e.hasAttribute("data-label")?this.label.setAttribute("data-label",e.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let e;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];e=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const n=e!=null&&e!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}class yb extends hc{constructor(e,n){super(e),this.label.innerHTML=n,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(e){const n=super.buildItem(e);return n.style.backgroundColor=e.getAttribute("value")||"",n}selectItem(e,n){super.selectItem(e,n);const r=this.label.querySelector(".ql-color-label"),s=e&&e.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=s:r.style.fill=s)}}class Nb extends hc{constructor(e,n){super(e),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=n[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(e,n){super.selectItem(e,n);const r=e||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const _8=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class Sb{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,_8(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(e){const n=e.left+e.width/2-this.root.offsetWidth/2,r=e.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const s=this.boundsContainer.getBoundingClientRect(),a=this.root.getBoundingClientRect();let i=0;if(a.right>s.right&&(i=s.right-a.right,this.root.style.left=`${n+i}px`),a.left<s.left&&(i=s.left-a.left,this.root.style.left=`${n+i}px`),a.bottom>s.bottom){const o=a.bottom-a.top,l=e.bottom-e.top+o;this.root.style.top=`${r-l}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const T8=[!1,"center","right","justify"],A8=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],y8=[!1,"serif","monospace"],N8=["1","2","3",!1],S8=["small",!1,"large","huge"];class _u extends Vi{constructor(e,n){super(e,n);const r=s=>{if(!document.body.contains(e.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(s.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(a=>{a.container.contains(s.target)||a.close()})};e.emitter.listenDOM("click",document.body,r)}addModule(e){const n=super.addModule(e);return e==="toolbar"&&this.extendToolbar(n),n}buildButtons(e,n){Array.from(e).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(a=>{if(a.startsWith("ql-")&&(a=a.slice(3),n[a]!=null))if(a==="direction")r.innerHTML=n[a][""]+n[a].rtl;else if(typeof n[a]=="string")r.innerHTML=n[a];else{const i=r.value||"";i!=null&&n[a][i]&&(r.innerHTML=n[a][i])}})})}buildPickers(e,n){this.pickers=Array.from(e).map(s=>{if(s.classList.contains("ql-align")&&(s.querySelector("option")==null&&go(s,T8),typeof n.align=="object"))return new Nb(s,n.align);if(s.classList.contains("ql-background")||s.classList.contains("ql-color")){const a=s.classList.contains("ql-background")?"background":"color";return s.querySelector("option")==null&&go(s,A8,a==="background"?"#ffffff":"#000000"),new yb(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?go(s,y8):s.classList.contains("ql-header")?go(s,N8):s.classList.contains("ql-size")&&go(s,S8)),new hc(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(Oe.events.EDITOR_CHANGE,r)}}_u.DEFAULTS=Js({},Vi.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let t=this.container.querySelector("input.ql-image[type=file]");t==null&&(t=document.createElement("input"),t.setAttribute("type","file"),t.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),t.classList.add("ql-image"),t.addEventListener("change",()=>{const e=this.quill.getSelection(!0);this.quill.uploader.upload(e,t.files),t.value=""}),this.container.appendChild(t)),t.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class wb extends Sb{constructor(e,n){super(e,n),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",e=>{e.key==="Enter"?(this.save(),e.preventDefault()):e.key==="Escape"&&(this.cancel(),e.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;n!=null?this.textbox.value=n:e!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${e}`)||""),this.root.setAttribute("data-mode",e)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:e}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:n}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",e,Oe.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Oe.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=w8(e);case"formula":{if(!e)break;const n=this.quill.getSelection(!0);if(n!=null){const r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),e,Oe.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Oe.sources.USER),this.quill.setSelection(r+2,Oe.sources.USER)}break}}this.textbox.value="",this.hide()}}function w8(t){let e=t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||t.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return e?`${e[1]||"https"}://www.youtube.com/embed/${e[2]}?showinfo=0`:(e=t.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${e[1]||"https"}://player.vimeo.com/video/${e[2]}/`:t}function go(t,e){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;e.forEach(r=>{const s=document.createElement("option");r===n?s.setAttribute("selected","selected"):s.setAttribute("value",String(r)),t.appendChild(s)})}const I8=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class Ib extends wb{constructor(e,n){super(e,n),this.quill.on(Oe.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===Oe.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===Oe.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const o=this.quill.getLines(s.index,s.length);if(o.length===1){const l=this.quill.getBounds(s);l!=null&&this.position(l)}else{const l=o[o.length-1],d=this.quill.getIndex(l),f=Math.min(l.length()-1,s.index+s.length-d),g=this.quill.getBounds(new Ka(d,f));g!=null&&this.position(g)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Oe.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const e=this.quill.getSelection();if(e!=null){const n=this.quill.getBounds(e);n!=null&&this.position(n)}},1)})}cancel(){this.show()}position(e){const n=super.position(e),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",n!==0&&(r.style.marginLeft=`${-1*n-r.offsetWidth/2}px`),n}}ye(Ib,"TEMPLATE",['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join(""));class Cb extends _u{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=I8),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new Ib(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),eu),this.buildPickers(e.container.querySelectorAll("select"),eu))}}Cb.DEFAULTS=Js({},_u.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,le.sources.USER)}}}}});const C8=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Lb extends wb{constructor(){super(...arguments);ye(this,"preview",this.root.querySelector("a.ql-preview"))}listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",n=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),n.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",n=>{if(this.linkRange!=null){const r=this.linkRange;this.restoreFocus(),this.quill.formatText(r,"link",!1,Oe.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(Oe.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===Oe.sources.USER){const[a,i]=this.quill.scroll.descendant(Ks,n.index);if(a!=null){this.linkRange=new Ka(n.index-i,a.length());const o=Ks.formats(a.domNode);this.preview.textContent=o,this.preview.setAttribute("href",o),this.show();const l=this.quill.getBounds(this.linkRange);l!=null&&this.position(l);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}ye(Lb,"TEMPLATE",['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join(""));class Ob extends _u{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=C8),super(e,n),this.quill.container.classList.add("ql-snow")}extendToolbar(e){e.container!=null&&(e.container.classList.add("ql-snow"),this.buildButtons(e.container.querySelectorAll("button"),eu),this.buildPickers(e.container.querySelectorAll("select"),eu),this.tooltip=new Lb(this.quill,this.options.bounds),e.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(n,r)=>{e.handlers.link.call(e,!r.format.link)}))}}Ob.DEFAULTS=Js({},_u.DEFAULTS,{modules:{toolbar:{handlers:{link(t){if(t){const e=this.quill.getSelection();if(e==null||e.length===0)return;let n=this.quill.getText(e);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf("mailto:")!==0&&(n=`mailto:${n}`);const{tooltip:r}=this.quill.theme;r.edit("link",n)}else this.quill.format("link",!1,le.sources.USER)}}}}});le.register({"attributors/attribute/direction":lb,"attributors/class/align":ib,"attributors/class/background":WL,"attributors/class/color":zL,"attributors/class/direction":cb,"attributors/class/font":hb,"attributors/class/size":mb,"attributors/style/align":ob,"attributors/style/background":Zh,"attributors/style/color":Qh,"attributors/style/direction":db,"attributors/style/font":pb,"attributors/style/size":gb},!0);le.register({"formats/align":ib,"formats/direction":cb,"formats/indent":MO,"formats/background":Zh,"formats/color":Qh,"formats/font":hb,"formats/size":mb,"formats/blockquote":Df,"formats/code-block":Cn,"formats/header":kf,"formats/list":Eu,"formats/bold":Jo,"formats/code":Jh,"formats/italic":Pf,"formats/link":Ks,"formats/script":Mf,"formats/strike":Bf,"formats/underline":Ff,"formats/formula":dl,"formats/image":Uf,"formats/video":fl,"modules/syntax":Ab,"modules/table":FO,"modules/toolbar":s0,"themes/bubble":Cb,"themes/snow":Ob,"ui/icons":eu,"ui/picker":hc,"ui/icon-picker":Nb,"ui/color-picker":yb,"ui/tooltip":Sb},!0);const L8="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",O8="/api/read?path=",Ml=new WeakMap;function x8(t){return typeof t=="string"&&t.includes(O8)}async function R8(t,e){try{const n=await We(e);if(!n.ok)return;const r=URL.createObjectURL(await n.blob()),s=Ml.get(t);s!==void 0&&URL.revokeObjectURL(s),Ml.set(t,r),t.setAttribute("src",r)}catch{}}function xb(t){const e=Ml.get(t);e!==void 0&&(URL.revokeObjectURL(e),Ml.delete(t))}const D8=le.import("formats/image");class a0 extends D8{static create(e){if(x8(e)){const n=super.create(L8);return n.setAttribute("data-read",e),R8(n,e),n}return super.create(e)}static value(e){return e.getAttribute("data-read")??e.getAttribute("src")??""}remove(){xb(this.domNode),super.remove()}}a0.blotName="image";a0.tagName="IMG";le.register(a0,!0);const I1="/api/read?path=",Rb=/src="([^"]*)"/g,k8=/ /g,P8=/<img src="[^"]*" data-read="([^"]*)"/g,M8=/<div class="ql-code-block-container"[^>]*>((?:<div class="ql-code-block"[^>]*>[\s\S]*?<\/div>)+)<\/div>/g,B8=/<div class="ql-code-block"[^>]*>([\s\S]*?)<\/div>/g,F8=/<pre><code>([\s\S]*?)<\/code><\/pre>/g;function U8(t){return t.replace(M8,(e,n)=>{const r=[];for(const s of n.matchAll(B8))r.push(s[1]==="<br>"?"":s[1]??"");return`<pre><code>${r.join(`
|
|
124
|
+
`)}</code></pre>`})}function H8(t){return t.replace(F8,(e,n)=>`<div class="ql-code-block-container">${n.split(`
|
|
125
|
+
`).map(s=>`<div class="ql-code-block">${s}</div>`).join("")}</div>`)}function q8(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function C1(t,e){return H8(t.replace(Rb,(n,r)=>q8(r)?`src="${sc(e,r)}"`:n))}function L1(t,e){const n=`content/${e===""?"":`${e}/`}`;return U8(t).replace(P8,(r,s)=>`<img src="${s}"`).replace(Rb,(r,s)=>{const a=s.indexOf(I1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+I1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(k8," ")}var j8=$('<div class="rte svelte-1afg4yo"><div></div></div>');function $8(t,e){at(e,!0);const n=le.import("formats/link");n.PROTOCOL_WHITELIST.includes("ref")||n.PROTOCOL_WHITELIST.push("ref");let r,s;const a=[[{header:[2,3,!1]}],["bold","italic","link","image"],["blockquote","code-block"],[{list:"ordered"},{list:"bullet"}],["clean"]];Qa(()=>{const p=new le(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(p.root.setAttribute("aria-labelledby",e.labelledBy),p.root.setAttribute("aria-multiline","true"));const T=p.theme.tooltip;if(T!==void 0){const H=T.position.bind(T);T.position=M=>{const J=p.root.getBoundingClientRect();return H({...M,left:M.left+J.left,right:M.right+J.left,top:M.top+J.top-p.root.scrollTop,bottom:M.bottom+J.top-p.root.scrollTop})}}const _=p.getModule("toolbar");_.addHandler("image",()=>l(p)),_.addHandler("link",()=>o(p));const E=H=>{H.preventDefault(),setTimeout(()=>i(p),0)};p.root.addEventListener("contextmenu",E);const O=H=>{H.target instanceof HTMLImageElement&&f(p,H.target)};p.root.addEventListener("dblclick",O),e.value&&p.clipboard.dangerouslyPasteHTML(C1(e.value,e.itemDir),"silent");const C=()=>e.onchange(L1(p.root.innerHTML,e.itemDir));return p.on("text-change",C),s=p,()=>{p.off("text-change",C),p.root.removeEventListener("contextmenu",E),p.root.removeEventListener("dblclick",O);for(const H of p.root.querySelectorAll("img"))xb(H)}});function i(p){var E;const v=p.getSelection(!0);if(v===null)return;const T=p.theme,_=p.getBounds(v.index,v.length);((E=T.tooltip)==null?void 0:E.show)!==void 0&&T.tooltip.position!==void 0&&_&&(T.tooltip.show(),T.tooltip.position(_))}function o(p){const v=p.getSelection(!0);if(v===null)return;const T=p.getFormat(v).link??"";yv(T).then(_=>{if(_!==null)if(_==="")p.formatText(v.index,v.length,"link",!1,"user");else if(v.length>0)p.formatText(v.index,v.length,"link",_,"user");else{const E=Go(_)?gf(_):_;p.insertText(v.index,E,{link:_},"user")}})}function l(p){const v=document.createElement("input");v.type="file",v.accept="image/*",v.onchange=()=>{var _;const T=(_=v.files)==null?void 0:_[0];T&&d(p,T)},v.click()}async function d(p,v){try{const T=await Lh(e.itemDir,v),_=p.getSelection(!0),E=await tp("");if(E===null)return;p.insertEmbed(_.index,"image",sc(e.itemDir,T),"user"),E!==""&&p.formatText(_.index,1,"alt",E,"user"),p.setSelection(_.index+1,0)}catch(T){console.error("Inline image upload failed",T)}}function f(p,v){const T=le.find(v);if(T===null)return;const _=p.getIndex(T);tp(v.getAttribute("alt")??"").then(E=>{E!==null&&p.formatText(_,1,"alt",E===""?!1:E,"user")})}Rt(()=>{const p=e.value;s&&L1(s.root.innerHTML,e.itemDir)!==p&&s.clipboard.dangerouslyPasteHTML(C1(p,e.itemDir),"silent")});var g=j8(),h=N(g);mn(h,p=>r=p,()=>r),F(t,g),it()}var Y8=$('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),z8=$('<textarea rows="3"></textarea>'),W8=$('<input type="date" class="svelte-1bn65uv"/>'),G8=$('<input type="time" class="svelte-1bn65uv"/>'),K8=$('<input type="email" class="svelte-1bn65uv"/>'),V8=$('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),X8=$('<input type="text" class="svelte-1bn65uv"/>'),Q8=$('<p class="hint svelte-1bn65uv"> </p>'),Z8=$("<p> </p>"),J8=$('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),e5=$('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),t5=$('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),n5=$('<p class="hint svelte-1bn65uv">Loading fields…</p>'),r5=$('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),s5=$(`<details class="meta-section svelte-1bn65uv"><summary class="svelte-1bn65uv">Meta & SEO</summary> <p class="meta-note svelte-1bn65uv">From the document shell, these fill every page's <head>.</p> <!></details>`),a5=$("<!> <!>",1),i5=$('<div class="divider svelte-1bn65uv" role="separator" aria-orientation="vertical" aria-label="Resize preview" tabindex="0"><span class="grip svelte-1bn65uv"></span></div> <div class="preview-pane svelte-1bn65uv"><!></div>',1),o5=$('<div><div class="form-pane svelte-1bn65uv"><form class="form svelte-1bn65uv"><header class="form-head svelte-1bn65uv"><div class="titles svelte-1bn65uv"><input class="title-input svelte-1bn65uv" type="text" aria-label="Title" placeholder="Untitled"/> <p class="meta svelte-1bn65uv"> </p></div> <div class="head-actions svelte-1bn65uv"><div class="action-buttons svelte-1bn65uv"><!> <!> <button type="button">Preview</button> <button type="button"> </button></div> <label class="pubdate svelte-1bn65uv"><span>Publish date</span> <input type="date" class="svelte-1bn65uv"/></label></div></header> <!></form></div> <!></div> <!>',1);function u5(t,e){at(e,!0);const n=Vn(e,"templates",19,()=>[]),r={name:"title",type:"shorttext",label:"Title",required:!0,multiline:!1,help:"Names the page in the tree and fills {title} where the template uses it, it doesn’t have to appear on the page."},s={name:"published",type:"date",label:"Publish date",required:!1,multiline:!1};let a=Q(!1);const i=()=>new Date().toISOString().slice(0,10);function o(){A(a,!u(a)),u(a)&&(u(E).published??"").trim()===""&&(u(E).published=i()),G()}let l=Q(!1),d=Q(ct([]));function f(){A(l,!0),e.onmove&&nf().then(Ne=>A(d,Ne,!0))}async function g(Ne){var Ye;Ne!==e.templateName&&(await y(),(Ye=e.onchangetemplate)==null||Ye.call(e,Ne))}const h=_e(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),p=new Set(["richtext","image","file","authors"]);function v(Ne){return p.has(Ne.type)?void 0:`f-${Ne.name}`}let T=Q(ct([])),_=Q(!0),E=Q(ct({})),O=Q(null);const C=700;let H,M=!1,J=0;Qa(()=>{U();const Ne=()=>void y();return window.addEventListener("beforeunload",Ne),()=>{window.removeEventListener("beforeunload",Ne),y()}});async function U(){A(_,!0);const[Ne,Ye]=await Promise.all([LN(e.templateName),ON()]),Xe=Ne.filter(De=>De.name!=="title"&&De.name!=="published"),Ze=new Set(Xe.map(De=>De.name)),L=Ye.filter(De=>De.name!=="published"&&!Ze.has(De.name)),ue=[r,s,...Xe,...L],Te={};for(const De of ue)Te[De.name]=a6(e.item,De.name);Te.published=(Te.published??"").slice(0,10),A(a,e.item.isPublished,!0),A(T,ue,!0),A(D,Xe,!0),A(W,L,!0),A(E,Te,!0),$6(localStorage,e.path,Te),A(O,Y6(localStorage,e.path),!0),A(_,!1)}function G(){M=!0,J+=1,clearTimeout(H),H=setTimeout(()=>void y(),C)}function V(Ne,Ye){const Xe=u(E)[Ne]??"";u(E)[Ne]=Ye,G(),Xe!==""&&Xe!==Ye&&ee(Xe)}async function ee(Ne){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(Ne))return;Object.values(u(E)).some(Xe=>typeof Xe=="string"&&Xe.includes(Ne))||await UN(u(h),Ne)}async function y(){var Xe;if(clearTimeout(H),!M)return;const Ne=J,Ye=yp(e.item,u(T),u(E),u(a));Fs.saving();try{await rv(e.path,Ye),J===Ne&&(M=!1),Fs.saved(),(Xe=e.onsaved)==null||Xe.call(e,e.path,u(E).title??e.item.title,u(a))}catch{Fs.failed(()=>void y())}}async function j(){u(O)===null||!await xl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(A(E,{...u(O)},!0),G())}const b=new Set(["text","code"]);function R(Ne,Ye){return Ne.maxLength!==void 0&&Ne.minLength!==void 0?`${Ye} / ${Ne.maxLength} characters (min ${Ne.minLength})`:Ne.maxLength!==void 0?`${Ye} / ${Ne.maxLength} characters`:`${Ye} characters (min ${Ne.minLength})`}function k(Ne,Ye){return Ne.minLength!==void 0&&Ye>0&&Ye<Ne.minLength?!0:Ne.maxLength!==void 0&&Ye>Ne.maxLength}let D=Q(ct([])),W=Q(ct([]));const Y=_e(()=>u(O)!==null&&JSON.stringify(u(E))!==JSON.stringify(u(O))),B="nanoesis:preview-open";let z=Q(localStorage.getItem(B)==="true");function K(Ne){A(z,Ne,!0),localStorage.setItem(B,String(Ne))}const te=_e(()=>{if(u(_))return null;try{return{...Vl(JSON.parse(yp(e.item,u(T),u(E),u(a)))),template:e.templateName}}catch{return null}}),fe="nanoesis:preview-split",Ee=.2,ge=.8;function Le(Ne){return Math.min(ge,Math.max(Ee,Ne))}function de(){const Ne=Number(localStorage.getItem(fe));return Number.isFinite(Ne)&&Ne>0?Le(Ne):.5}let me=Q(ct(de())),Ie=Q(!1),se;function he(Ne){Ne.preventDefault(),A(Ie,!0),Ne.currentTarget.setPointerCapture(Ne.pointerId)}function Ae(Ne){if(!u(Ie))return;const Ye=se.getBoundingClientRect();A(me,Le((Ne.clientX-Ye.left)/Ye.width),!0)}function Ce(Ne){var Ye,Xe;u(Ie)&&(A(Ie,!1),(Xe=(Ye=Ne.currentTarget).releasePointerCapture)==null||Xe.call(Ye,Ne.pointerId),localStorage.setItem(fe,String(u(me))))}function Me(Ne){const Ye=Ne.key==="ArrowLeft"?-.02:Ne.key==="ArrowRight"?.02:0;Ye!==0&&(Ne.preventDefault(),A(me,Le(u(me)+Ye),!0),localStorage.setItem(fe,String(u(me))))}var ke=o5(),dt=et(ke);let Be;var It=N(dt),Dt=N(It);{const Ne=(Ze,L=Yf)=>{var ue=J8(),Te=N(ue),De=N(Te),Ve=I(De);{var Ge=we=>{var Se=Y8();F(we,Se)};ce(Ve,we=>{L().required&&we(Ge)})}var Et=I(Ve,2),cn=N(Et),Nt=I(Te,2);{var tr=we=>{{let Se=_e(()=>u(E)[L().name]??""),He=_e(()=>`lbl-${L().name}`);$8(we,{get value(){return u(Se)},get itemDir(){return u(h)},get labelledBy(){return u(He)},placeholder:"Write…",onchange:gt=>{u(E)[L().name]=gt,G()}})}},Os=we=>{var Se=z8();let He;re(()=>{be(Se,"id",`f-${L().name}`),be(Se,"maxlength",L().maxLength),be(Se,"minlength",L().minLength),He=Ke(Se,1,"svelte-1bn65uv",null,He,{mono:L().type==="code"})}),ie("input",Se,G),St(Se,()=>u(E)[L().name],gt=>u(E)[L().name]=gt),F(we,Se)},qr=_e(()=>b.has(L().type)),ua=we=>{{let Se=_e(()=>u(E)[L().name]??""),He=_e(()=>`lbl-${L().name}`);gS(we,{get value(){return u(Se)},get itemDir(){return u(h)},get labelledBy(){return u(He)},onchange:gt=>V(L().name,gt)})}},la=we=>{{let Se=_e(()=>u(E)[L().name]??""),He=_e(()=>`lbl-${L().name}`);dS(we,{get value(){return u(Se)},get itemDir(){return u(h)},get labelledBy(){return u(He)},onchange:gt=>{u(E)[L().name]=gt,G()}})}},Xt=we=>{{let Se=_e(()=>u(E)[L().name]??""),He=_e(()=>`lbl-${L().name}`);nS(we,{get value(){return u(Se)},get labelledBy(){return u(He)},onchange:gt=>{u(E)[L().name]=gt,G()}})}},ca=we=>{{let Se=_e(()=>u(E)[L().name]??""),He=_e(()=>`lbl-${L().name}`);kS(we,{get value(){return u(Se)},get labelledBy(){return u(He)},onchange:gt=>{u(E)[L().name]=gt,G()}})}},da=we=>{var Se=W8();re(()=>be(Se,"id",`f-${L().name}`)),ie("input",Se,G),St(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)},xs=we=>{var Se=G8();re(()=>be(Se,"id",`f-${L().name}`)),ie("input",Se,G),St(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)},fa=we=>{var Se=K8();re(()=>{be(Se,"id",`f-${L().name}`),be(Se,"maxlength",L().maxLength),be(Se,"minlength",L().minLength)}),ie("input",Se,G),St(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)},ha=we=>{var Se=V8();re(()=>{be(Se,"id",`f-${L().name}`),be(Se,"maxlength",L().maxLength),be(Se,"minlength",L().minLength)}),ie("input",Se,G),St(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)},dn=we=>{var Se=X8();re(()=>{be(Se,"id",`f-${L().name}`),be(Se,"maxlength",L().maxLength),be(Se,"minlength",L().minLength)}),ie("input",Se,G),St(Se,()=>u(E)[L().name],He=>u(E)[L().name]=He),F(we,Se)};ce(Nt,we=>{L().type==="richtext"?we(tr):u(qr)?we(Os,1):L().type==="image"?we(ua,2):L().type==="file"?we(la,3):L().type==="authors"?we(Xt,4):L().type==="url"?we(ca,5):L().type==="date"?we(da,6):L().type==="time"?we(xs,7):L().type==="email"?we(fa,8):L().type==="phone"?we(ha,9):we(dn,-1)})}var Rs=I(Nt,2);{var pa=we=>{var Se=Q8(),He=N(Se);re(()=>ae(He,L().help)),F(we,Se)};ce(Rs,we=>{L().help&&we(pa)})}var ma=I(Rs,2);{var ga=we=>{const Se=_e(()=>(u(E)[L().name]??"").length);var He=Z8();let gt;var $t=N(He);re((Yt,tn)=>{gt=Ke(He,1,"hint count svelte-1bn65uv",null,gt,Yt),ae($t,tn)},[()=>({over:k(L(),u(Se))}),()=>R(L(),u(Se))]),F(we,He)};ce(ma,we=>{(L().minLength!==void 0||L().maxLength!==void 0)&&we(ga)})}re(we=>{be(Te,"id",`lbl-${L().name}`),be(Te,"for",we),ae(De,`${L().label??""} `),ae(cn,L().multiple?"references":L().type)},[()=>v(L())]),F(Ze,ue)};var Lt=N(Dt),ft=N(Lt),Vt=N(ft),qt=I(Vt,2),Pt=N(qt),Gt=I(ft,2),Mt=N(Gt),mt=N(Mt);{var yt=Ze=>{var L=e5();ie("click",L,j),F(Ze,L)};ce(mt,Ze=>{u(Y)&&Ze(yt)})}var Bt=I(mt,2);{var ot=Ze=>{var L=t5(),ue=N(L);Ph(ue,{size:16,"aria-hidden":"true"}),ie("click",L,f),F(Ze,L)};ce(Bt,Ze=>{e.onchangetemplate&&Ze(ot)})}var tt=I(Bt,2);let Ye;var bt=I(tt,2);let Xe;var An=N(bt),yn=I(Mt,2),ln=I(N(yn),2),Zn=I(Lt,2);{var Jn=Ze=>{var L=n5();F(Ze,L)},jt=Ze=>{var L=r5();F(Ze,L)},en=Ze=>{var L=a5(),ue=et(L);wt(ue,17,()=>u(D),Ve=>Ve.name,(Ve,Ge)=>{Ne(Ve,()=>u(Ge))});var Te=I(ue,2);{var De=Ve=>{var Ge=s5(),Et=I(N(Ge),4);wt(Et,17,()=>u(W),cn=>cn.name,(cn,Nt)=>{Ne(cn,()=>u(Nt))}),F(Ve,Ge)};ce(Te,Ve=>{u(W).length>0&&Ve(De)})}F(Ze,L)};ce(Zn,Ze=>{u(_)?Ze(Jn):u(D).length===0&&u(W).length===0?Ze(jt,1):Ze(en,-1)})}re(()=>{ae(Pt,e.templateName),Ye=Ke(tt,1,"preview-toggle svelte-1bn65uv",null,Ye,{active:u(z)}),be(tt,"aria-pressed",u(z)),Xe=Ke(bt,1,"publish-btn svelte-1bn65uv",null,Xe,{on:u(a)}),be(bt,"aria-pressed",u(a)),be(bt,"title",u(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),ae(An,u(a)?"Publish":"Don't Publish")}),ie("input",Vt,G),St(Vt,()=>u(E).title,Ze=>u(E).title=Ze),ie("click",tt,()=>K(!u(z))),ie("click",bt,o),ie("input",ln,G),St(ln,()=>u(E).published,Ze=>u(E).published=Ze)}var Hr=I(It,2);{var os=Ne=>{var Ye=i5(),Xe=et(Ye),Ze=I(Xe,2),L=N(Ze);HS(L,{get path(){return e.path},get previewItem(){return u(te)},onclose:()=>K(!1)}),re((ue,Te,De)=>{be(Xe,"aria-valuemin",ue),be(Xe,"aria-valuemax",Te),be(Xe,"aria-valuenow",De)},[()=>Math.round(Ee*100),()=>Math.round(ge*100),()=>Math.round(u(me)*100)]),ie("pointerdown",Xe,he),ie("pointermove",Xe,Ae),ie("pointerup",Xe,Ce),Ue("pointercancel",Xe,Ce),ie("keydown",Xe,Me),F(Ne,Ye)};ce(Hr,Ne=>{u(z)&&Ne(os)})}mn(dt,Ne=>se=Ne,()=>se);var er=I(dt,2);{var us=Ne=>{{let Ye=_e(()=>e.onrename?()=>(A(l,!1),e.onrename()):void 0),Xe=_e(()=>e.ondelete?()=>(A(l,!1),e.ondelete()):void 0),Ze=_e(()=>e.onmove?L=>(A(l,!1),e.onmove(L)):void 0);wS(Ne,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return u(h)},get folders(){return u(d)},onchangetemplate:L=>{A(l,!1),g(L)},get onrename(){return u(Ye)},get ondelete(){return u(Xe)},get onmove(){return u(Ze)},onclose:()=>A(l,!1)})}};ce(er,Ne=>{u(l)&&e.onchangetemplate&&Ne(us)})}re(()=>{Be=Ke(dt,1,"layout svelte-1bn65uv",null,Be,{split:u(z),dragging:u(Ie)}),Gl(It,u(z)?`flex-basis:${u(me)*100}%`:void 0)}),Ue("submit",Dt,Ne=>Ne.preventDefault()),ie("focusout",Dt,()=>void y()),F(t,ke),it()}Tt(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const Db=""+new URL("nanoesis-logo-CgieIWPg.png",import.meta.url).href,l5="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAFS2lUWHRYTUw6Y29tLmFkb2JlLnhtcAAAAAAAPD94cGFja2V0IGJlZ2luPSLvu78iIGlkPSJXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQiPz4KPHg6eG1wbWV0YSB4bWxuczp4PSJhZG9iZTpuczptZXRhLyIgeDp4bXB0az0iWE1QIENvcmUgNS41LjAiPgogPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICA8cmRmOkRlc2NyaXB0aW9uIHJkZjphYm91dD0iIgogICAgeG1sbnM6ZGM9Imh0dHA6Ly9wdXJsLm9yZy9kYy9lbGVtZW50cy8xLjEvIgogICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iCiAgICB4bWxuczp0aWZmPSJodHRwOi8vbnMuYWRvYmUuY29tL3RpZmYvMS4wLyIKICAgIHhtbG5zOnBob3Rvc2hvcD0iaHR0cDovL25zLmFkb2JlLmNvbS9waG90b3Nob3AvMS4wLyIKICAgIHhtbG5zOnhtcD0iaHR0cDovL25zLmFkb2JlLmNvbS94YXAvMS4wLyIKICAgIHhtbG5zOnhtcE1NPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvbW0vIgogICAgeG1sbnM6c3RFdnQ9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9zVHlwZS9SZXNvdXJjZUV2ZW50IyIKICAgZXhpZjpQaXhlbFhEaW1lbnNpb249IjUwIgogICBleGlmOlBpeGVsWURpbWVuc2lvbj0iNTAiCiAgIGV4aWY6Q29sb3JTcGFjZT0iMSIKICAgdGlmZjpJbWFnZVdpZHRoPSI1MCIKICAgdGlmZjpJbWFnZUxlbmd0aD0iNTAiCiAgIHRpZmY6UmVzb2x1dGlvblVuaXQ9IjIiCiAgIHRpZmY6WFJlc29sdXRpb249IjMwMC8xIgogICB0aWZmOllSZXNvbHV0aW9uPSIzMDAvMSIKICAgcGhvdG9zaG9wOkNvbG9yTW9kZT0iMyIKICAgcGhvdG9zaG9wOklDQ1Byb2ZpbGU9InNSR0IgSUVDNjE5NjYtMi4xIgogICB4bXA6TW9kaWZ5RGF0ZT0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiCiAgIHhtcDpNZXRhZGF0YURhdGU9IjIwMjYtMDItMjRUMTA6NTY6NTBaIj4KICAgPGRjOnRpdGxlPgogICAgPHJkZjpBbHQ+CiAgICAgPHJkZjpsaSB4bWw6bGFuZz0ieC1kZWZhdWx0Ij54dHJhYmxlLWFpLWxvZ288L3JkZjpsaT4KICAgIDwvcmRmOkFsdD4KICAgPC9kYzp0aXRsZT4KICAgPHhtcE1NOkhpc3Rvcnk+CiAgICA8cmRmOlNlcT4KICAgICA8cmRmOmxpCiAgICAgIHN0RXZ0OmFjdGlvbj0icHJvZHVjZWQiCiAgICAgIHN0RXZ0OnNvZnR3YXJlQWdlbnQ9IkFmZmluaXR5IERlc2lnbmVyIDEuMTAuNiIKICAgICAgc3RFdnQ6d2hlbj0iMjAyNi0wMi0yNFQxMDo1Njo1MFoiLz4KICAgIDwvcmRmOlNlcT4KICAgPC94bXBNTTpIaXN0b3J5PgogIDwvcmRmOkRlc2NyaXB0aW9uPgogPC9yZGY6UkRGPgo8L3g6eG1wbWV0YT4KPD94cGFja2V0IGVuZD0iciI/PtBEvDoAAAGBaUNDUHNSR0IgSUVDNjE5NjYtMi4xAAAokXWRv0tCURTHP2pRlGFQg0ODRDVplEHY0qD0C6pBDbJa9OWPwB+P95SQ1qA1KIha+jXUX1Br0BwERRFEczQWtZS8zlNBiTyXc8/nfu89h3vPBWs4rWT0piHIZPNacMrvWowsuVresOKkDR+2qKKrc6HJMA3t6wGLGe88Zq3G5/619tW4roClVXhcUbW88LTw7HpeNXlXuFtJRVeFz4XdmlxQ+N7UYxV+NTlZ4R+TtXAwANZOYVeyjmN1rKS0jLC8nL5MuqBU72O+xB7PLoQk9or3oBNkCj8uZpggwCjDjMk8igcvg7KiQf5QOX+enOQqMqsU0VgjSYo8blELUj0uMSF6XEaaotn/v33VEyPeSnW7H5pfDOOjH1p2oLRtGN/HhlE6AdszXGVr+bkj8H2Kvl3T+g7BsQkX1zUttgeXW+B8UqNatCzZxK2JBLyfQUcEum6hbbnSs+o+p48Q3pCvuoH9AxiQ846VX24uZ+lBa66dAAAACXBIWXMAAC4jAAAuIwF4pT92AAAIcElEQVRogeXZfXAU5R0H8O9ze3t73F1edrMJLyoDHSmoYxkHqrxZ0mpoaEEJiYBSBvriTAuVomBlChUpjDMqVq0F6QwWWrFFJC2UtkHiaDoooKaMQLG8TIWCRSHLbnJc9rKvv/6Ru3AJubvdS5h22u/MzXO57D35ffJ7nid3F+D/MaZNwf90DdkS8HqhaVOpYWOokqCia1lQofEESSFkw8ZA08ak0y008FoXlo7TTqJrk5DvuryQDES5aUM2LAw2bdx/5BwN65dKc8T4jEa5JoaTgYH5MDkhvSA6RxvXGTaWv3OKbu7f0q9EP0WTycAY10C5a0LOh8kKyYEoT92uN22sbzhKo/obEf8rzXINVLkmysmA7AXT6ynkASGbneMAw+59jkKjNdFiMjHZBZT0YwEAbuZ9my4EgszICfGJeHDGbexv9c00FYBaO5a91xeEspsecw3MB6BkFu8F0w1i2sT7RLxX30yzALwa70Dy2b00dekU9m6hENcABYDybgV7xHTbI6EgswwbmmmjzCciqOoo0nQ0LPoNTfQL+GSLs/jTHc74ijr2tGtgPZkod1N7g8zUHjEgZ9kz/FUQAJBj7JJh4Zhpo8wHAlrnrUhLoqH6Re+YUz9211oaXnASeOPTHc6Eijr2hA9MjIzOJvV6ag0vZ6cNG3uNToxXBLQkkO7MiFX5MYfnumutVqywVQZLQ5GTwB4fmJBr4B9clDlZIQDwhRvYYcPG5lRnvCKg6SlMEjNzIQ6Od9faGlZYKmC1Aj4xcE28JQy6stlZvt9aw1GaaNhon3Eb+9AjAloS2zUdD5SEQQBuUdexo5lzvl1Ba3gJK4MigReBoAjwEsCXAkGJwIu4zMVQPbiO239xBz0RELCIhdASEKAEBBxmIawoHsPimXPmhaRT30z3AKj3ifgluc4cR1dmxjcO+nN6rr08vcmLuIuXAJ+Y9wMC5omVTO1Zn+dXvwBYvAPMJ2K+oyuCoyu/E+qaqg5INAYAyMIMS8O7lgrYGoOlAbYG5Flm3yUT3+wN4QtSO5btUnXM1XQ4PhBwdAW2rrQ/vq+kSnWU5gMSPf5VsARZqPaBuaWijtXL09nFbPX56QiWTmGvaTrmakk4PhDqgrfVXxS3JR7VbAWqo6z2iVGcBFrz1eYLAgDrH2CvpTvjBeG0K3cVafF9qqMYmqPAJ+a0rbLK6xdw/8pXl+fN3jMjVtEsLYnJmo7FuRB2Q92HALAssGVqEVfye4mTBZGTIQZlSJy8arzKfvIGKMZ47OFFTMw4AE4HRVSOfjVw1ks9BUPSkZZRIB8iHR+Y00GRKscd8IYAClhaveQmcp3Z+RAAsM5d0HDZaavJs8w2WCp8IYB+6MjOufysPe59N73C/2i5rSt6NkRmcnWm0Dr6BDm+PDpHiTtblTbH3aN/Zc2mjgd350Ok0wvmgsTJo8arLO8J1Vu4Qp4EALRBupEx9hYIHBi4Ie7Hk6Y42/fuPEEnvDz/4Ga92ratk4NPlo1hwCUAX/56vPyTQuspGLL6T0n1qZnRDsZYFQgAA+cSaqs/hyP5MIEtU34A4GfnJ7WOMyP2c4MPiQ8v7rjz74XWAhSwtGj1wGok1IVwrHnsp2ijDdIPL8Wdp5RWG0rcgdLmWK0J574Fu9xdORDPc2UCuLIwgrJgcnJ4eJu06XxfIL5OLXppQjUi4k7EpOng+EZ6BCVsofp0WTH3mFwahFzMQS7h+NIY9/qWewP3ekDYnBye11eELwjVfyONEBARgZj0RT+YLIi5bdKm7aDaoaDak2Gas7RQiKelRftWVaNd24l2VUBCA3QNSKjp8QM4VlWOZVbzrZq7b8yJAJrC4IdLiEFEdNkx9sKzfiF5O0InfjURUWknoqKAqATERKQ6Ag+d6fjt7Tff7QMBEbF10+lJ353Jv7SEWALR0iSiEhAV4QNzeeOIERsarxuyxAcCIqKQEFu3hF72hcm6tBL7nrmdHIOKKld+QGfqx8JINKK9tRTtKtCuAe0q8iyzCi4ydihXJjRyZeFSH4jUGIWI2OyH2LTtXiC9dkQ/tHkcC0W2ME7YfblpbSUbVtsMIVaFaGmrh85sBQC2UL3oLtjbzJWFq4KyoBSA+KeI6PsFd6Tj+B9uJSu5mix9CFm6TKYeI8eYU1S5sslDZwzoWg1bdaEhc84S9TuRNmmT7hNRGUbgPICNDOxQLfvSz3NBun1kapzdPxyWfj+ANgB81zdMbLvctHYOG1bbRGfqqwA0AijtMZcBoIY9eryhx+Nokzbpqbsv+US8zsC+JoCvbqTmeBUb++tskK6lZSknKxgfuRN8pJXxkRbGD1A6x4jCQpEE44RtOZaZgZhYw763/ypEZsLgH5EQ+8wnokUAr4TAzz9IH03LCXF0NcL4yDDGRzTGR1rARxQfGANRsYbVbs2JAIAOtu2EiGilmML4QLQI4BUBfPUxOjO+t7kZALhWRxFZ+kCydJksvTw9ouvr5JXHu++Z0TASxWzk/H35EJmZTk+OlBBrEhEd5APREkqNAvg3b2AV3V6Ydm121+ooJkuv8IG5p6hypedTpWeW0MsjJUSbRMQMn4j010dKWazrn0Fdmz3Ah+Ou1XHVDyT0+sfGhNm3t8nPs2+feJH+eIeIqB1GQPGJUATwVuZ83U4tjxgLwMPROxYd7AsEAB5i084CwA76yxqfiHMh8G1ZIR4wNoDnBtw6+0hfEZlhYK8I4KcL4AMeERrHAj3myJJe9oxIlv6OMHTCx/2JSKeRmoeFwD8jgHf9InJCemAksvQzvPz5rJ+99kcO0kdDBPDfD4E3/SAAD+9HUkezw0UkPd+1/ZFjdEZOLTPdKwLoh8+1rkXO0cUiAfzoEPi4F8R/dVopISTJiDnk5r/4fyn/BmrDD+pUdvB8AAAAAElFTkSuQmCC";let Fo=Q("idle"),hl=Q(ct([])),pl=Q(ct([])),ud=Q(!1),ld;async function O1(){A(Fo,"checking");try{const t=await RN();A(hl,[...t.errors],!0),A(pl,[...t.warnings],!0),A(Fo,"done")}catch{A(Fo,"error")}}const wn={get status(){return u(Fo)},get errors(){return u(hl)},get warnings(){return u(pl)},get count(){return u(hl).length+u(pl).length},get hasProblems(){return u(Fo)==="done"&&u(hl).length+u(pl).length>0},get panelOpen(){return u(ud)},refresh(){return clearTimeout(ld),O1()},scheduleRefresh(t=1200){clearTimeout(ld),ld=setTimeout(()=>void O1(),t)},openPanel(){A(ud,!0)},closePanel(){A(ud,!1)}};var c5=$('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),d5=$('<button type="button" class="problems svelte-jz8lnl"> </button>'),f5=$('<footer><div class="credit svelte-jz8lnl"><img class="logo svelte-jz8lnl" alt="" width="20" height="20"/> <span>nanoesis by <a target="_blank" rel="noopener noreferrer" class="svelte-jz8lnl">xtrable ltd</a></span></div> <div aria-live="polite"><span> </span> <!></div> <!> <a class="xtrable svelte-jz8lnl" target="_blank" rel="noopener noreferrer" aria-label="xtrable ltd"><img alt="xtrable" width="24" height="24" class="svelte-jz8lnl"/></a></footer>');function h5(t,e){at(e,!0);const n=_e(()=>Fs.state==="saving"?"Saving…":Fs.state==="error"?"Save failed":"Saved");Rt(()=>{yh.value,wn.scheduleRefresh()});const r=_e(()=>wn.count),s="https://xtrable.com/";var a=f5();let i;var o=N(a),l=N(o),d=I(l,2),f=I(N(d));be(f,"href",s);var g=I(o,2);let h;var p=N(g),v=N(p),T=I(p,2);{var _=M=>{var J=c5();ie("click",J,()=>Fs.retry()),F(M,J)};ce(T,M=>{Fs.canRetry&&M(_)})}var E=I(g,2);{var O=M=>{var J=d5(),U=N(J);re(()=>ae(U,`${u(r)??""}
|
|
126
|
+
${u(r)===1?"problem":"problems"}`)),ie("click",J,()=>wn.openPanel()),F(M,J)};ce(E,M=>{wn.hasProblems&&M(O)})}var C=I(E,2);be(C,"href",s);var H=N(C);re(()=>{i=Ke(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":wn.hasProblems}),be(l,"src",Db),h=Ke(g,1,"save svelte-jz8lnl",null,h,{error:Fs.state==="error"}),ae(v,u(n)),be(H,"src",l5)}),F(t,a),it()}Tt(["click"]);var p5=$("<option> </option>"),m5=$("<option>Top level</option>"),g5=$("<option> </option>"),v5=$('<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Move</h3> <div class="manage svelte-1uvxo8j"><label class="grow svelte-1uvxo8j"><span class="visually-hidden svelte-1uvxo8j">Move to folder</span> <select class="svelte-1uvxo8j"><option disabled="">Move to…</option><!><!></select></label> <button type="button" class="ghost svelte-1uvxo8j">Move</button></div></div>'),b5=$(`<div class="section svelte-1uvxo8j"><h3 class="svelte-1uvxo8j">Manage folder</h3> <div class="manage svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">New subfolder…</button> <button type="button" class="ghost svelte-1uvxo8j">Change URL…</button> <button type="button" class="ghost danger svelte-1uvxo8j">Delete folder…</button></div> <p class="help svelte-1uvxo8j">“Change URL” renames this folder’s slug (its address). Its name in the tree is its section
|
|
127
|
+
page’s title.</p></div>`),E5=$('<p class="error svelte-1uvxo8j" role="alert"> </p>'),_5=$('<dialog aria-label="Folder settings" class="svelte-1uvxo8j"><form><h2 class="svelte-1uvxo8j">Folder settings</h2> <p class="path svelte-1uvxo8j"> </p> <label class="svelte-1uvxo8j"><span class="svelte-1uvxo8j">Default template</span> <select class="svelte-1uvxo8j"><option>(none, items must set their own)</option><!></select> <span class="help svelte-1uvxo8j">New items here inherit this template unless they pick their own. Stored in the folder’s <code>_sort.json</code>.</span></label> <!> <!> <!> <div class="actions svelte-1uvxo8j"><button type="button" class="ghost svelte-1uvxo8j">Cancel</button> <button type="submit" class="primary svelte-1uvxo8j">Save</button></div></form></dialog>');function T5(t,e){at(e,!0);const n=Vn(e,"folders",19,()=>[]);let r=Q(""),s=Q(!0),a=Q(null),i;const o=_e(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),l=_e(()=>n().filter(b=>b!==e.folderPath&&b!==u(o)&&!b.startsWith(`${e.folderPath}/`))),d=" ";let f=Q(d);Qa(()=>{i.showModal(),GN(e.folderPath).then(b=>{A(r,b,!0)}).finally(()=>{A(s,!1)})});async function g(b){b.preventDefault(),A(a,null);try{await KN(e.folderPath,u(r)),e.onsaved()}catch(R){A(a,R instanceof Error?R.message:String(R),!0)}}var h=_5(),p=N(h),v=I(N(p),2),T=N(v),_=I(v,2),E=I(N(_),2),O=N(E);O.value=O.__value="";var C=I(O);wt(C,16,()=>e.templates,b=>b,(b,R)=>{var k=p5(),D=N(k),W={};re(()=>{ae(D,R),W!==(W=R)&&(k.value=(k.__value=R)??"")}),F(b,k)});var H=I(_,2);{var M=b=>{var R=v5(),k=I(N(R),2),D=N(k),W=I(N(D),2),Y=N(W);Y.value=Y.__value=d;var B=I(Y);{var z=fe=>{var Ee=m5();Ee.value=Ee.__value="",F(fe,Ee)};ce(B,fe=>{u(o)!==""&&fe(z)})}var K=I(B);wt(K,16,()=>u(l),fe=>fe,(fe,Ee)=>{var ge=g5(),Le=N(ge),de={};re(()=>{ae(Le,`${Ee??""}/`),de!==(de=Ee)&&(ge.value=(ge.__value=Ee)??"")}),F(fe,ge)});var te=I(D,2);re(()=>te.disabled=u(f)===d),$a(W,()=>u(f),fe=>A(f,fe)),ie("click",te,()=>e.onmove(u(f))),F(b,R)};ce(H,b=>{e.onmove&&b(M)})}var J=I(H,2);{var U=b=>{var R=b5(),k=I(N(R),2),D=N(k),W=I(D,2),Y=I(W,2);ie("click",D,function(...B){var z;(z=e.onnewsubfolder)==null||z.apply(this,B)}),ie("click",W,function(...B){var z;(z=e.onrenamefolder)==null||z.apply(this,B)}),ie("click",Y,function(...B){var z;(z=e.ondeletefolder)==null||z.apply(this,B)}),F(b,R)};ce(J,b=>{e.folderPath!==""&&b(U)})}var G=I(J,2);{var V=b=>{var R=E5(),k=N(R);re(()=>ae(k,u(a))),F(b,R)};ce(G,b=>{u(a)&&b(V)})}var ee=I(G,2),y=N(ee),j=I(y,2);mn(h,b=>i=b,()=>i),re(()=>{ae(T,e.folderPath===""?"/ (root)":`${e.folderPath}/`),E.disabled=u(s),j.disabled=u(s)}),Ue("cancel",h,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),Ue("close",h,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),Ue("submit",p,g),$a(E,()=>u(r),b=>A(r,b)),ie("click",y,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),F(t,h),it()}Tt(["click"]);var A5=$("<option></option>"),y5=$("<option> </option>"),N5=$('<p class="error svelte-1t0ew8l" role="alert"> </p>'),S5=$('<dialog aria-label="New content item" class="svelte-1t0ew8l"><form><h2 class="svelte-1t0ew8l">New content item</h2> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Title</span> <input required="" class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Slug</span> <input class="svelte-1t0ew8l"/></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Folder</span> <input list="folder-options" placeholder="/ (root), or type a new folder" class="svelte-1t0ew8l"/> <datalist id="folder-options"></datalist> <span class="help svelte-1t0ew8l">Pick an existing folder or type a new path to create it.</span></label> <label class="svelte-1t0ew8l"><span class="svelte-1t0ew8l">Template</span> <select class="svelte-1t0ew8l"><option>Inherit the folder’s default</option><!></select> <span class="help svelte-1t0ew8l">A folder’s default is set in its folder settings (the gear button in the tree).</span></label> <!> <div class="actions svelte-1t0ew8l"><button type="button" class="ghost svelte-1t0ew8l">Cancel</button> <button type="submit" class="primary svelte-1t0ew8l">Create</button></div></form></dialog>');function w5(t,e){at(e,!0);const n=Vn(e,"initialFolder",3,"");let r=Q(""),s=Q(""),a=Q(""),i=Q("");Rt(()=>{A(a,n())});let o=!1,l=Q(null),d;Qa(()=>d.showModal());function f(){o||A(s,Es(u(r)),!0)}async function g(b){b.preventDefault(),A(l,null);const R=Es(u(s)||u(r));if(R===""){A(l,"A title or slug is required.");return}const k=u(a).split("/").map(W=>Es(W)).filter(W=>W!=="").join("/"),D=k===""?R:`${k}/${R}`;try{await iv(D,u(r).trim()||R,u(i)),e.oncreated(D)}catch(W){A(l,W instanceof Error?W.message:String(W),!0)}}var h=S5(),p=N(h),v=I(N(p),2),T=I(N(v),2);ja(T,!0);var _=I(v,2),E=I(N(_),2),O=I(_,2),C=I(N(O),2),H=I(C,2);wt(H,20,()=>e.folders,b=>b,(b,R)=>{var k=A5(),D={};re(()=>{D!==(D=R)&&(k.value=(k.__value=R)??"")}),F(b,k)});var M=I(O,2),J=I(N(M),2),U=N(J);U.value=U.__value="";var G=I(U);wt(G,16,()=>e.templates,b=>b,(b,R)=>{var k=y5(),D=N(k),W={};re(()=>{ae(D,R),W!==(W=R)&&(k.value=(k.__value=R)??"")}),F(b,k)});var V=I(M,2);{var ee=b=>{var R=N5(),k=N(R);re(()=>ae(k,u(l))),F(b,R)};ce(V,b=>{u(l)&&b(ee)})}var y=I(V,2),j=N(y);mn(h,b=>d=b,()=>d),re(b=>be(E,"placeholder",b),[()=>Es(u(r))||"my-item"]),Ue("cancel",h,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),Ue("close",h,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),Ue("submit",p,g),ie("input",T,f),St(T,()=>u(r),b=>A(r,b)),ie("input",E,()=>o=!0),St(E,()=>u(s),b=>A(s,b)),St(C,()=>u(a),b=>A(a,b)),$a(J,()=>u(i),b=>A(i,b)),ie("click",j,function(...b){var R;(R=e.oncancel)==null||R.apply(this,b)}),F(t,h),it()}Tt(["input","click"]);function Hf(t){let e=!1;return t.map(n=>n.status==="done"?n:e?{...n,status:"pending"}:(e=!0,{...n,status:"active"}))}function kb(t){return t.map(e=>({...e,status:"pending"}))}function x1(t){return t.map(e=>({...e,status:"done"}))}function Qu(t){return{phase:"validating",resources:Hf(kb((t==null?void 0:t.resources)??[])),done:0,total:(t==null?void 0:t.resources.length)??0,uploaded:0,uploadTotal:0}}function Zu(t,e){switch(e.phase){case"validate":return{...t,phase:"validating"};case"plan":{const n=Hf(kb(e.plan.resources));return{...t,phase:"building",resources:n,done:0,total:e.plan.resources.length}}case"resource":{const n=t.resources.map(r=>r.id===e.resource.id?{...r,status:"done"}:r);return{...t,phase:"building",resources:Hf(n),done:e.done,total:e.total}}case"upload":return{...t,phase:"uploading",resources:x1(t.resources),done:t.total,uploaded:e.written,uploadTotal:e.total};case"purge":return{...t,phase:"purging"};case"done":return{...t,phase:"done",resources:x1(t.resources),done:t.total,written:e.written,...e.summary!==void 0&&{summary:e.summary}};case"blocked":return{...t,phase:"blocked",errors:e.errors};case"error":return{...t,phase:"error",message:e.message}}}function I5(t){switch(t.phase){case"validating":return .02;case"building":return .05+.78*(t.total===0?1:t.done/t.total);case"uploading":return .83+.15*(t.uploadTotal===0?1:t.uploaded/t.uploadTotal);case"purging":return .99;case"done":return 1;case"blocked":case"error":return t.total===0?0:t.done/t.total}}const C5=t=>new Promise(e=>setTimeout(e,t)),L5=250;function O5(){let t=Q(!1),e=Q(!1),n=Q(ct(Qu())),r=Q(0),s,a=0;const i=()=>u(n).phase==="done"||u(n).phase==="blocked"||u(n).phase==="error";function o(){const d=I5(u(n))*100,f=i(),g=(performance.now()-a)/1e3,h=8+62*(1-Math.exp(-g/5)),p=f?u(n).phase==="done"?100:d:Math.max(d,h);A(r,u(r)+(p-u(r))*.12),Math.abs(p-u(r))<.2&&A(r,p,!0);const v=f&&u(r)===p;s=u(t)&&!v?requestAnimationFrame(o):void 0}const l=83;return{get active(){return u(t)},get running(){return u(e)},get state(){return u(n)},get percent(){return Math.round(u(r))},get shownDone(){const d=u(n).total;if(d===0)return 0;if(u(n).phase==="done")return d;const f=Math.floor(u(r)/l*d);return Math.max(0,Math.min(d-1,Math.max(u(n).done,f)))},async start(){if(!u(e)){A(t,!0),A(e,!0),a=performance.now(),A(r,0),A(n,Qu(),!0),s===void 0&&(s=requestAnimationFrame(o));try{A(n,Qu(await DN()),!0);let d=0,f=!0;const g=async()=>{const T=await PN(d);for(const _ of T.events)A(n,Zu(u(n),_),!0);return d=T.total,T.running},p=(async()=>{for(;f;){try{if(!await g()&&d>0)break}catch{}await C5(L5)}})(),v=await kN();f=!1,await p.catch(()=>{});try{await g()}catch{}i()||A(n,v.ok?Zu(u(n),{phase:"done",written:v.written,...v.summary!==void 0&&{summary:v.summary}}):Zu(u(n),{phase:"blocked",errors:v.errors}),!0)}catch(d){const f=d instanceof Error?d.message:String(d);A(n,Zu(u(n),{phase:"error",message:f}),!0)}finally{A(e,!1),s===void 0&&(s=requestAnimationFrame(o))}}},close(){u(e)||(A(t,!1),s!==void 0&&(cancelAnimationFrame(s),s=void 0),A(n,Qu(),!0),A(r,0))}}}const bs=O5();var x5=$('<div class="bar-row svelte-1o0yh0y"><div class="bar svelte-1o0yh0y" role="progressbar" aria-label="Publish progress"><div></div></div> <span class="pct svelte-1o0yh0y" aria-hidden="true"> </span></div> <p class="sr-only svelte-1o0yh0y" aria-live="polite"> </p>',1),R5=$('<li class="svelte-1o0yh0y"> </li>'),D5=$('<div class="panel blocked-panel svelte-1o0yh0y"><p class="panel-lead svelte-1o0yh0y">Fix these, then publish again:</p> <ul class="errors svelte-1o0yh0y"></ul></div>'),k5=$('<div class="panel error-panel svelte-1o0yh0y"><p class="svelte-1o0yh0y"> </p></div>'),P5=$('<span class="spinner svelte-1o0yh0y"></span>'),M5=$('<span class="pending-dot svelte-1o0yh0y"></span>'),B5=$('<li><span class="dot svelte-1o0yh0y" aria-hidden="true"><!></span> <span class="row-label svelte-1o0yh0y"> </span> <span class="sr-only svelte-1o0yh0y"> </span></li>'),F5=$('<div class="group svelte-1o0yh0y"><div class="group-head svelte-1o0yh0y"><!> <span class="group-label svelte-1o0yh0y"> </span> <span class="group-count svelte-1o0yh0y"> </span></div> <ul class="rows svelte-1o0yh0y"></ul></div>'),U5=$('<span class="group-count svelte-1o0yh0y"> </span>'),H5=$('<span class="spinner svelte-1o0yh0y"></span>'),q5=$('<span class="pending-dot svelte-1o0yh0y"></span>'),j5=$('<div class="group svelte-1o0yh0y"><div class="group-head svelte-1o0yh0y"><!> <span class="group-label svelte-1o0yh0y">Upload</span> <!></div> <ul class="rows svelte-1o0yh0y"><li><span class="dot svelte-1o0yh0y" aria-hidden="true"><!></span> <span class="row-label svelte-1o0yh0y"> </span></li></ul></div>'),$5=$('<div class="timeline svelte-1o0yh0y" aria-label="Resources"><!> <!></div>'),Y5=$('<p class="note warn svelte-1o0yh0y"> </p>'),z5=$('<p class="note svelte-1o0yh0y"> </p>'),W5=$('<button type="button" class="ghost svelte-1o0yh0y" disabled="">Publishing…</button>'),G5=$('<button type="button" class="primary svelte-1o0yh0y"> </button>'),K5=$('<section class="publish svelte-1o0yh0y" aria-label="Publishing"><div class="card svelte-1o0yh0y"><header><div class="badge svelte-1o0yh0y" aria-hidden="true"><!></div> <div class="head-text svelte-1o0yh0y"><h1 class="svelte-1o0yh0y"> </h1> <p class="caption svelte-1o0yh0y" aria-live="polite"> </p></div></header> <!> <!> <!> <footer class="actions svelte-1o0yh0y"><!></footer></div></section>');function V5(t,e){at(e,!0);const n=_e(()=>bs.state),r=_e(()=>bs.percent),s=_e(()=>u(n).phase==="error"),a=_e(()=>u(n).phase==="blocked"),i=_e(()=>u(n).phase==="done"),o=_e(()=>{var se;return u(i)&&((se=u(n).summary)==null?void 0:se.published)===0}),l=_e(()=>bs.shownDone),d=_e(()=>u(n).resources.map((se,he)=>{const Ae=he<u(l)?"done":he===u(l)&&!u(i)?"active":"pending";return{...se,status:Ae}})),f={image:P6,file:k6,page:M6},g={image:"Images",file:"Files",page:"Pages"},h=_e(()=>["image","file","page"].map(he=>{const Ae=u(d).filter(Me=>Me.kind===he),Ce=Ae.filter(Me=>Me.status==="done").length;return{kind:he,label:g[he],icon:f[he],items:Ae,done:Ce}}).filter(he=>he.items.length>0)),p=_e(()=>{var se;return(se=u(d).find(he=>he.status==="active"))==null?void 0:se.kind}),v=_e(()=>u(i)||u(a)||u(s)?u(n).phase:u(n).phase==="uploading"||u(r)>=83?"uploading":u(n).phase==="purging"?"purging":u(l)>0||u(r)>12?"building":"validating"),T=_e(()=>{switch(u(v)){case"validating":return"Checking your content…";case"building":return u(p)==="image"?"Optimising images…":u(p)==="file"?"Copying files…":"Rendering pages…";case"uploading":return"Uploading to your live site…";case"purging":return"Refreshing the CDN…";case"done":return u(o)?"No pages were published.":"Your changes are live.";case"blocked":case"error":return"Nothing was published, your live site is unchanged."}}),_=_e(()=>{var se,he;if(u(s))return"Publish failed";if(u(a)){const Ae=((se=u(n).errors)==null?void 0:se.length)??0;return`${Ae} ${Ae===1?"thing":"things"} would break`}if(u(o))return"Nothing went live";if(u(i)){const Ae=((he=u(n).summary)==null?void 0:he.published)??0;return Ae>0?`Published ${Ae} ${Ae===1?"page":"pages"}`:`Published ${u(n).written??0} ${u(n).written===1?"file":"files"}`}return"Publishing your site"}),E=_e(()=>`${u(_)}. ${u(T)}`);function O(se){return se.status==="done"?"done":se.status==="active"?"in progress":"waiting"}var C=K5(),H=N(C),M=N(H);let J;var U=N(M),G=N(U);{var V=se=>{U6(se,{size:22})},ee=se=>{F6(se,{size:22})},y=se=>{B6(se,{size:22})};ce(G,se=>{u(s)||u(a)?se(V):u(i)?se(ee,1):se(y,-1)})}var j=I(U,2),b=N(j),R=N(b),k=I(b,2),D=N(k),W=I(M,2);{var Y=se=>{var he=x5(),Ae=et(he),Ce=N(Ae);be(Ce,"aria-valuemin",0),be(Ce,"aria-valuemax",100);var Me=N(Ce);let ke;var dt=I(Ce,2),Be=N(dt),It=I(Ae,2),Dt=N(It);re(()=>{be(Ce,"aria-valuenow",u(r)),ke=Ke(Me,1,"fill svelte-1o0yh0y",null,ke,{done:u(i)}),Gl(Me,`width: ${u(r)}%`),ae(Be,`${u(r)??""}%`),ae(Dt,u(E))}),F(se,he)};ce(W,se=>{!u(a)&&!u(s)&&se(Y)})}var B=I(W,2);{var z=se=>{var he=D5(),Ae=I(N(he),2);wt(Ae,20,()=>u(n).errors??[],Ce=>Ce,(Ce,Me)=>{var ke=R5(),dt=N(ke);re(()=>ae(dt,Me)),F(Ce,ke)}),F(se,he)},K=se=>{var he=k5(),Ae=N(he),Ce=N(Ae);re(()=>ae(Ce,u(n).message)),F(se,he)},te=se=>{var he=$5(),Ae=N(he);wt(Ae,17,()=>u(h),ke=>ke.kind,(ke,dt)=>{var Be=F5(),It=N(Be),Dt=N(It);Id(Dt,()=>u(dt).icon,(Gt,Mt)=>{Mt(Gt,{size:15,"aria-hidden":"true"})});var Lt=I(Dt,2),ft=N(Lt),Vt=I(Lt,2),qt=N(Vt),Pt=I(It,2);wt(Pt,21,()=>u(dt).items,Gt=>Gt.id,(Gt,Mt)=>{var mt=B5();let yt;var Bt=N(mt),ot=N(Bt);{var tt=jt=>{Tp(jt,{size:13})},bt=jt=>{var en=P5();F(jt,en)},An=jt=>{var en=M5();F(jt,en)};ce(ot,jt=>{u(Mt).status==="done"?jt(tt):u(Mt).status==="active"?jt(bt,1):jt(An,-1)})}var yn=I(Bt,2),ln=N(yn),Zn=I(yn,2),Jn=N(Zn);re(jt=>{yt=Ke(mt,1,"row svelte-1o0yh0y",null,yt,{active:u(Mt).status==="active",done:u(Mt).status==="done"}),be(yn,"title",u(Mt).id),ae(ln,u(Mt).label),ae(Jn,jt)},[()=>O(u(Mt))]),F(Gt,mt)}),re(()=>{ae(ft,u(dt).label),ae(qt,`${u(dt).done??""}/${u(dt).items.length??""}`)}),F(ke,Be)});var Ce=I(Ae,2);{var Me=ke=>{var dt=j5(),Be=N(dt),It=N(Be);D6(It,{size:15,"aria-hidden":"true"});var Dt=I(It,4);{var Lt=tt=>{var bt=U5(),An=N(bt);re(()=>ae(An,`${u(n).uploaded??""}/${u(n).uploadTotal??""}`)),F(tt,bt)};ce(Dt,tt=>{u(n).uploadTotal>0&&tt(Lt)})}var ft=I(Be,2),Vt=N(ft);let qt;var Pt=N(Vt),Gt=N(Pt);{var Mt=tt=>{Tp(tt,{size:13})},mt=tt=>{var bt=H5();F(tt,bt)},yt=tt=>{var bt=q5();F(tt,bt)};ce(Gt,tt=>{u(i)?tt(Mt):u(n).phase==="uploading"?tt(mt,1):tt(yt,-1)})}var Bt=I(Pt,2),ot=N(Bt);re(()=>{qt=Ke(Vt,1,"row svelte-1o0yh0y",null,qt,{active:u(n).phase==="uploading",done:u(i)}),ae(ot,u(i)?`Uploaded ${u(n).written??u(n).uploadTotal} files to the live site`:`Uploading ${u(n).uploadTotal} files…`)}),F(ke,dt)};ce(Ce,ke=>{(u(n).uploadTotal>0||u(n).phase==="uploading"||u(i))&&ke(Me)})}F(se,he)};ce(B,se=>{u(a)?se(z):u(s)?se(K,1):se(te,-1)})}var fe=I(B,2);{var Ee=se=>{var he=Y5(),Ae=N(he);re(()=>{var Ce;return ae(Ae,((Ce=u(n).summary)==null?void 0:Ce.firstPublishWarning)??"Your site has no published pages. Toggle Publish on at least one page to go live.")}),F(se,he)},ge=se=>{var he=z5(),Ae=N(he);re(()=>{var Ce,Me;return ae(Ae,`${((Ce=u(n).summary)==null?void 0:Ce.drafts)??""}
|
|
128
|
+
${((Me=u(n).summary)==null?void 0:Me.drafts)===1?"draft was":"drafts were"} skipped.`)}),F(se,he)};ce(fe,se=>{var he;u(i)&&u(o)?se(Ee):u(i)&&(((he=u(n).summary)==null?void 0:he.drafts)??0)>0&&se(ge,1)})}var Le=I(fe,2),de=N(Le);{var me=se=>{var he=W5();F(se,he)},Ie=se=>{var he=G5(),Ae=N(he);re(()=>ae(Ae,u(i)?"Done":"Back to editing")),ie("click",he,()=>bs.close()),F(se,he)};ce(de,se=>{bs.running?se(me):se(Ie,-1)})}re(()=>{J=Ke(M,1,"head svelte-1o0yh0y",null,J,{error:u(s),blocked:u(a),done:u(i)&&!u(o)}),ae(R,u(_)),ae(D,u(T))}),F(t,C),it()}Tt(["click"]);var X5=$("<option> </option>"),Q5=$(`<div class="empty svelte-y9gf4p"><div class="card svelte-y9gf4p"><h1 class="svelte-y9gf4p"> </h1> <p class="svelte-y9gf4p">This section has no page yet, the page visitors see at <code class="svelte-y9gf4p"> </code>. Pick a template (a
|
|
129
|
+
listing template loops over this section's items) and create it.</p> <label class="svelte-y9gf4p"><span class="svelte-y9gf4p">Template</span> <select class="svelte-y9gf4p"><option>Inherit the folder’s default</option><!></select></label> <button type="button" class="primary svelte-y9gf4p"> </button></div></div>`);function Z5(t,e){at(e,!0);const n=_e(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=Q(""),s=Q(!1);function a(){A(s,!0),e.oncreate(u(r))}var i=Q5(),o=N(i),l=N(o),d=N(l),f=I(l,2),g=I(N(f)),h=N(g),p=I(f,2),v=I(N(p),2),T=N(v);T.value=T.__value="";var _=I(T);wt(_,16,()=>e.templates,C=>C,(C,H)=>{var M=X5(),J=N(M),U={};re(()=>{ae(J,H),U!==(U=H)&&(M.value=(M.__value=H)??"")}),F(C,M)});var E=I(p,2),O=N(E);re(()=>{ae(d,e.name),ae(h,u(n)),v.disabled=u(s),E.disabled=u(s),ae(O,u(s)?"Creating…":"Create page")}),$a(v,()=>u(r),C=>A(r,C)),ie("click",E,a),F(t,i),it()}Tt(["click"]);const Pb="nanoesis:sidebar-width",J5=180,ex=560,tx=260;function Mb(t){return Math.min(ex,Math.max(J5,Math.round(t)))}function nx(){const t=Number(localStorage.getItem(Pb));return Number.isFinite(t)&&t>0?Mb(t):tx}let Bl=nx();function Bb(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${Bl}px`)}Bb();function rx(){return Bl}function sx(t){Bl=Mb(t),Bb(),localStorage.setItem(Pb,String(Bl))}var ax=$('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function ix(t,e){at(e,!0);let n=Q(null);function r(l){l.preventDefault(),l.currentTarget.setPointerCapture(l.pointerId),A(n,{startX:l.clientX,startWidth:rx()},!0)}function s(l){u(n)!==null&&sx(u(n).startWidth+(l.clientX-u(n).startX))}function a(l){var d,f;u(n)!==null&&((f=(d=l.currentTarget).releasePointerCapture)==null||f.call(d,l.pointerId),A(n,null))}var i=ax();let o;re(()=>o=Ke(i,1,"resizer svelte-1jo2gqq",null,o,{dragging:u(n)!==null})),ie("pointerdown",i,r),ie("pointermove",i,s),ie("pointerup",i,a),Ue("pointercancel",i,a),F(t,i),it()}Tt(["pointerdown","pointermove","pointerup"]);const Fb={"content-type":"application/json"};async function ox(){const t=await We("/api/migrations");if(!t.ok)throw new Error(`Failed to load migrations (HTTP ${t.status}).`);return await t.json()}async function Ik(t){const e=await We(`/api/migrations/preview?path=${encodeURIComponent(t)}`);if(!e.ok)throw new Error(`Failed to load migration preview (HTTP ${e.status}).`);return await e.json()}async function Ck(t,e){const n=await We("/api/migrations/apply",{method:"POST",headers:Fb,body:JSON.stringify({path:t,resolution:e})});if(!n.ok){const s=await n.json().catch(()=>({}));throw new Error(s.error??`Migration failed (HTTP ${n.status}).`)}return await n.json()}async function Lk(t,e){const n=await We("/api/templates/stamp",{method:"POST",headers:Fb,body:JSON.stringify({name:t,kind:e})});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.error??`Stamp failed (HTTP ${n.status}).`)}return await n.json()}function ux(){let t=Q(0),e=Q(null),n=Q(!1),r=Q(null),s=!1;async function a(){A(n,!0),A(r,null);try{const i=await ox();A(e,i,!0),A(t,i.items.length,!0),s=!0}catch(i){A(r,i instanceof Error?i.message:String(i),!0)}finally{A(n,!1)}}return{get count(){return u(t)},get list(){return u(e)},get loading(){return u(n)},get error(){return u(r)},async ensureLoaded(){s||u(n)||await a()},refresh:a}}const Ju=ux();var lx=$(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),cx=$('<p class="error svelte-fna247" role="alert"> </p>'),dx=$('<p class="success svelte-fna247" role="status">Password updated.</p>'),fx=$('<dialog aria-label="Change password" class="svelte-fna247"><h2 class="svelte-fna247">Change password</h2> <p class="lede svelte-fna247">You stay signed in here. Other sessions of yours (other devices, other tabs) are signed out.</p> <form class="svelte-fna247"><label class="svelte-fna247"><span class="svelte-fna247">Current password</span> <input type="password" autocomplete="current-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">New password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/></label> <label class="svelte-fna247"><span class="svelte-fna247">Confirm new password</span> <input type="password" autocomplete="new-password" required="" class="svelte-fna247"/> <!></label> <!> <!> <div class="actions svelte-fna247"><button type="button" class="ghost svelte-fna247">Cancel</button> <button type="submit" class="primary svelte-fna247"> </button></div></form></dialog>');function hx(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q(""),a=Q(""),i=Q(""),o=Q(!1),l=Q(null),d=Q(!1);Rt(()=>{u(r)&&(n()&&!u(r).open?(A(s,""),A(a,""),A(i,""),A(l,null),A(d,!1),A(o,!1),u(r).showModal()):!n()&&u(r).open&&u(r).close())});let f=_e(()=>u(a)!==""&&u(i)!==""&&u(a)!==u(i)),g=_e(()=>!u(o)&&u(s)!==""&&u(a)!==""&&!u(f));async function h(D){if(D.preventDefault(),!u(g))return;A(o,!0),A(l,null);const W=await pt.changePassword(u(s),u(a));if(A(o,!1),!W.ok){const Y=W.error??"Password change failed.";A(l,Y.includes("credentials")?"Current password is incorrect.":Y,!0);return}A(d,!0),setTimeout(()=>{n(!1)},900)}function p(D){D.preventDefault(),n(!1)}var v=fx(),T=I(N(v),4),_=N(T),E=I(N(_),2),O=I(_,2),C=I(N(O),2),H=I(O,2),M=I(N(H),2),J=I(M,2);{var U=D=>{var W=lx();F(D,W)};ce(J,D=>{u(f)&&D(U)})}var G=I(H,2);{var V=D=>{var W=cx(),Y=N(W);re(()=>ae(Y,u(l))),F(D,W)};ce(G,D=>{u(l)&&D(V)})}var ee=I(G,2);{var y=D=>{var W=dx();F(D,W)};ce(ee,D=>{u(d)&&D(y)})}var j=I(ee,2),b=N(j),R=I(b,2),k=N(R);mn(v,D=>A(r,D),()=>u(r)),re(()=>{R.disabled=!u(g),ae(k,u(o)?"Updating…":"Update password")}),Ue("cancel",v,p),Ue("submit",T,h),St(E,()=>u(s),D=>A(s,D)),St(C,()=>u(a),D=>A(a,D)),St(M,()=>u(i),D=>A(i,D)),ie("click",b,()=>n(!1)),F(t,v),it()}Tt(["click"]);var px=$(`<label class="svelte-szf2lz"><span class="svelte-szf2lz"> </span> <textarea readonly="" rows="3" class="svelte-szf2lz"></textarea></label> <p class="warn svelte-szf2lz" role="status">Copy it now, you won't be able to see it again.</p> <div class="actions svelte-szf2lz"><button type="button" class="ghost svelte-szf2lz">Done</button> <button type="button" class="primary svelte-szf2lz"> </button></div>`,1),mx=$('<p class="error svelte-szf2lz" role="alert"> </p>'),gx=$('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),vx=$('<!> <!> <div class="actions svelte-szf2lz"><button type="button" class="danger svelte-szf2lz">Revoke all</button> <span class="spacer svelte-szf2lz"></span> <button type="button" class="ghost svelte-szf2lz">Cancel</button> <button type="button" class="primary svelte-szf2lz"> </button></div>',1),bx=$(`<dialog aria-label="MCP access token" class="svelte-szf2lz"><h2 class="svelte-szf2lz">MCP access token</h2> <p class="lede svelte-szf2lz">A token lets an AI client (through the MCP server) read and edit this site as you, with your
|
|
133
130
|
role. Paste it into your client's config as a Bearer token. It keeps working after you sign out,
|
|
134
|
-
so treat it like a password.</p> <!></dialog>`);function
|
|
135
|
-
built-in brand. (The footer credit stays.)</p> <!> <!> <section class="field svelte-1e3birj"><label for="brand-name" class="svelte-1e3birj">Name</label> <div class="row svelte-1e3birj"><input id="brand-name" type="text" placeholder="nanoesis" class="svelte-1e3birj"/> <button type="button" class="primary svelte-1e3birj"> </button></div></section> <section class="field svelte-1e3birj"><span class="field-label svelte-1e3birj">Logo</span> <div class="logo-row svelte-1e3birj"><div class="preview svelte-1e3birj"><!></div> <div class="logo-actions svelte-1e3birj"><input type="file" accept="image/*" class="visually-hidden svelte-1e3birj"/> <button type="button" class="ghost svelte-1e3birj"> </button> <!></div></div> <small class="svelte-1e3birj">PNG, SVG, or any image, up to 1 MB.</small></section></div>`);function
|
|
136
|
-
port-agnostic probes, so they catch problems regardless of how your storage and CDN are wired. <strong>Repair</strong> fixes that the engine can apply in place; advisory findings are everything else.</p> <!> <!> <div class="actions-bar svelte-1iylrs"><div class="summary svelte-1iylrs" aria-live="polite"><!></div> <button type="button" class="svelte-1iylrs"> </button></div> <!></div>`);function Hx(t,e){it(e,!0);let n=Q(!0),r=Q(null),s=Q(dt([])),a=Q(null),i=Q(null);const o={error:"Error",warning:"Warning",info:"Info"},l={error:0,warning:1,info:2},d=Ae(()=>[...u(s)].sort((j,b)=>l[j.severity]-l[b.severity])),h=Ae(()=>({error:u(s).filter(j=>j.severity==="error").length,warning:u(s).filter(j=>j.severity==="warning").length,info:u(s).filter(j=>j.severity==="info").length}));async function g(){A(n,!0),A(r,null);try{A(s,await Ix(),!0)}catch(j){A(r,j instanceof Error?j.message:String(j),!0)}finally{A(n,!1)}}Rt(()=>{g()});async function f(j){if(j.repair){A(a,j.repair.id,!0),A(i,null);try{A(s,await Cx(j.repair.id),!0)}catch(b){A(i,b instanceof Error?b.message:String(b),!0)}finally{A(a,null)}}}var p=Ux(),v=I(N(p),2);{var T=j=>{var b=Lx(),R=N(b);se(()=>ae(R,u(r))),F(j,b)};ce(v,j=>{u(r)&&j(T)})}var _=I(v,2);{var E=j=>{var b=Ox(),R=N(b);se(()=>ae(R,u(i))),F(j,b)};ce(_,j=>{u(i)&&j(E)})}var O=I(_,2),C=N(O),H=N(C);{var M=j=>{var b=El("Running checks…");F(j,b)},J=j=>{var b=xx();F(j,b)},U=j=>{var b=Px(),R=tt(b);{var k=z=>{var K=Rx(),te=N(K);se(()=>ae(te,`${u(h).error??""} error${u(h).error===1?"":"s"}`)),F(z,K)};ce(R,z=>{u(h).error>0&&z(k)})}var D=I(R,2);{var W=z=>{var K=Dx(),te=N(K);se(()=>ae(te,`${u(h).warning??""} warning${u(h).warning===1?"":"s"}`)),F(z,K)};ce(D,z=>{u(h).warning>0&&z(W)})}var Y=I(D,2);{var B=z=>{var K=kx(),te=N(K);se(()=>ae(te,`${u(h).info??""} info`)),F(z,K)};ce(Y,z=>{u(h).info>0&&z(B)})}F(j,b)};ce(H,j=>{u(n)?j(M):u(s).length===0?j(J,1):j(U,-1)})}var G=I(C,2),V=N(G),ee=I(O,2);{var y=j=>{var b=Fx();Nt(b,21,()=>u(d),R=>R.id,(R,k)=>{var D=Bx(),W=N(D),Y=N(W),B=N(Y),z=I(Y,2),K=N(z),te=I(W,2),he=N(te),Ee=I(te,2);{var ge=Ce=>{var fe=Mx(),ne=N(fe),de=N(ne);se(()=>{ne.disabled=u(a)!==null,ae(de,u(a)===u(k).repair.id?"Repairing…":u(k).repair.label)}),ie("click",ne,()=>f(u(k))),F(Ce,fe)};ce(Ee,Ce=>{u(k).repair&&Ce(ge)})}se(()=>{Ge(D,1,`finding finding-${u(k).severity??""}`,"svelte-1iylrs"),Ge(Y,1,`severity-tag severity-${u(k).severity??""}`,"svelte-1iylrs"),ae(B,o[u(k).severity]),ae(K,u(k).title),ae(he,u(k).detail)}),F(R,D)}),F(j,b)};ce(ee,j=>{!u(n)&&u(s).length>0&&j(y)})}se(()=>{G.disabled=u(n),ae(V,u(n)?"Checking…":"Re-run checks")}),ie("click",G,g),F(t,p),ot()}_t(["click"]);var qx=$('<p class="error svelte-8ydvuj" role="alert"> </p>'),jx=$('<p class="ok svelte-8ydvuj" role="status"> </p>'),$x=$(`<div class="panel svelte-8ydvuj"><p class="lede svelte-8ydvuj">The site's base URL, its public address, e.g. <code class="svelte-8ydvuj">https://example.com</code>. Setting it makes <code class="svelte-8ydvuj">publish</code> emit a <code class="svelte-8ydvuj">sitemap.xml</code> (and absolute links in the RSS feed). Leave it blank to skip the sitemap.</p> <!> <!> <section class="field svelte-8ydvuj"><label for="site-base-url" class="svelte-8ydvuj">Base URL</label> <div class="row svelte-8ydvuj"><input id="site-base-url" type="url" inputmode="url" placeholder="https://example.com" class="svelte-8ydvuj"/> <button type="button" class="primary svelte-8ydvuj"> </button></div> <small class="svelte-8ydvuj">No trailing slash needed. Used only to build absolute URLs in the sitemap and feed.</small></section></div>`);function Yx(t,e){it(e,!0);let n=Q(""),r=Q(!0),s=Q(!1),a=Q(null),i=Q(null);e6().then(C=>{A(n,C.baseUrl,!0),A(r,!1)});function o(C){A(i,C,!0),setTimeout(()=>A(i,null),1500)}async function l(){A(s,!0),A(a,null);try{await t6({baseUrl:u(n)}),o("Saved.")}catch(C){A(a,C instanceof Error?C.message:String(C),!0)}finally{A(s,!1)}}var d=$x(),h=I(N(d),2);{var g=C=>{var H=qx(),M=N(H);se(()=>ae(M,u(a))),F(C,H)};ce(h,C=>{u(a)&&C(g)})}var f=I(h,2);{var p=C=>{var H=jx(),M=N(H);se(()=>ae(M,u(i))),F(C,H)};ce(f,C=>{u(i)&&C(p)})}var v=I(f,2),T=I(N(v),2),_=N(T),E=I(_,2),O=N(E);se(()=>{_.disabled=u(r),E.disabled=u(r)||u(s),ae(O,u(s)?"Saving…":"Save")}),yt(_,()=>u(n),C=>A(n,C)),ie("click",E,l),F(t,d),ot()}_t(["click"]);async function zx(){const t=await Ke("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const a0={"content-type":"application/json"};function Wx(t){return Ja("/api/users",{method:"POST",headers:a0,body:JSON.stringify(t)})}function R1(t,e){return Ja(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:a0,body:JSON.stringify(e)})}function Gx(t,e){return Ja(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:a0,body:JSON.stringify(e)})}function Kx(t){return Ja(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var Vx=$('<p class="error svelte-plhp3i" role="alert"> </p>'),Xx=$('<p class="muted svelte-plhp3i">Loading users…</p>'),Qx=$('<p class="error svelte-plhp3i"> </p>'),Zx=$('<span class="you svelte-plhp3i">(you)</span>'),Jx=$('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),eR=$('<span class="you svelte-plhp3i">(you)</span>'),tR=$('<span class="username svelte-plhp3i"> <!></span>'),nR=$('<span class="chip locked svelte-plhp3i">Locked</span>'),rR=$('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),sR=$('<tr><td class="svelte-plhp3i"><div class="who svelte-plhp3i"><!></div> <!></td><td class="svelte-plhp3i"><div class="roles svelte-plhp3i"></div></td><td class="row-actions svelte-plhp3i"><button type="button" class="link svelte-plhp3i">Edit name</button> <button type="button" class="link svelte-plhp3i">Reset password</button> <button type="button" class="link danger svelte-plhp3i">Delete</button></td></tr>'),aR=$('<table class="svelte-plhp3i"><thead><tr><th class="svelte-plhp3i">User</th><th class="svelte-plhp3i">Roles</th><th class="svelte-plhp3i"></th></tr></thead><tbody></tbody></table>'),iR=$('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),oR=$('<div class="panel svelte-plhp3i"><!> <section class="list"><!></section> <form class="create svelte-plhp3i"><h3 class="svelte-plhp3i">Add a user</h3> <div class="create-grid svelte-plhp3i"><label class="svelte-plhp3i"><span class="svelte-plhp3i">Username</span> <input type="text" autocomplete="off" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Display name <small class="optional svelte-plhp3i">(optional)</small></span> <input type="text" autocomplete="off" placeholder="Shown on bylines; defaults to the username" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Initial password</span> <input type="text" autocomplete="off" placeholder="Set a password" class="svelte-plhp3i"/></label> <fieldset class="roles-field svelte-plhp3i"><legend class="svelte-plhp3i">Roles</legend> <div class="roles svelte-plhp3i"></div></fieldset></div> <div class="create-actions svelte-plhp3i"><small class="svelte-plhp3i">Share the password with them; they can change it from their account menu.</small> <button type="submit" class="primary svelte-plhp3i"> </button></div></form></div>');function uR(t,e){it(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=Q(dt([])),i=Q(!0),o=Q(null),l=Q(null),d=Q(""),h=Q(""),g=Q(""),f=Q(dt(["author"])),p=Q(!1);const v=Ae(()=>{var fe;return((fe=ht.principal)==null?void 0:fe.userId)??null}),T=Ae(()=>!u(p)&&u(d).trim()!==""&&u(g)!==""&&u(f).length>0);async function _(){A(i,!0),A(o,null);try{A(a,await zx(),!0)}catch(fe){A(o,fe instanceof Error?fe.message:String(fe),!0)}finally{A(i,!1)}}Rt(()=>{_()});async function E(fe){if(fe.preventDefault(),!u(T))return;A(p,!0),A(l,null);const ne=await Wx({username:u(d).trim(),password:u(g),roles:[...u(f)],...u(h).trim()!==""&&{displayName:u(h).trim()}});if(A(p,!1),!ne.ok){A(l,ne.error,!0);return}A(d,""),A(h,""),A(g,""),A(f,["author"],!0),await _()}async function O(fe){const ne=await ko(`Display name for “${fe.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:fe.displayName??"",placeholder:fe.username});if(ne===null)return;A(l,null);const de=await R1(fe.id,{displayName:ne});de.ok||A(l,de.error,!0),await _()}async function C(fe,ne){const me=fe.roles.includes(ne)?fe.roles.filter(Ie=>Ie!==ne):[...fe.roles,ne];if(me.length===0){A(l,"A user must keep at least one role."),await _();return}A(l,null);const Te=await R1(fe.id,{roles:me});Te.ok||A(l,Te.error,!0),await _()}async function H(fe){const ne=await ko(`Set a new password for “${fe.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(ne===null)return;A(l,null);const de=await Gx(fe.id,{newPassword:ne});de.ok||A(l,de.error,!0)}async function M(fe){if(!await Ol(`Delete the user “${fe.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;A(l,null);const de=await Kx(fe.id);if(!de.ok){A(l,de.error,!0);return}await _()}var J=oR(),U=N(J);{var G=fe=>{var ne=Vx(),de=N(ne);se(()=>ae(de,u(l))),F(fe,ne)};ce(U,fe=>{u(l)&&fe(G)})}var V=I(U,2),ee=N(V);{var y=fe=>{var ne=Xx();F(fe,ne)},j=fe=>{var ne=Qx(),de=N(ne);se(()=>ae(de,u(o))),F(fe,ne)},b=fe=>{var ne=aR(),de=I(N(ne));Nt(de,21,()=>u(a),me=>me.id,(me,Te)=>{const Ie=Ae(()=>u(Te).id===u(v));var Oe=sR(),Pe=N(Oe),Fe=N(Pe),St=N(Fe);{var Be=vt=>{var wt=Jx(),nt=tt(wt),Qe=N(nt),Mt=I(Qe);{var Dt=on=>{var $t=Zx();F(on,$t)};ce(Mt,on=>{u(Ie)&&on(Dt)})}var kn=I(nt,2),Pn=N(kn);se(()=>{ae(Qe,u(Te).displayName),ae(Pn,u(Te).username)}),F(vt,wt)},Pt=vt=>{var wt=tR(),nt=N(wt),Qe=I(nt);{var Mt=Dt=>{var kn=eR();F(Dt,kn)};ce(Qe,Dt=>{u(Ie)&&Dt(Mt)})}se(()=>ae(nt,u(Te).username)),F(vt,wt)};ce(St,vt=>{u(Te).displayName?vt(Be):vt(Pt,-1)})}var jt=I(Fe,2);{var Ct=vt=>{var wt=nR();F(vt,wt)};ce(jt,vt=>{u(Te).locked&&vt(Ct)})}var ut=I(Pe),Gt=N(ut);Nt(Gt,21,()=>r,jo,(vt,wt)=>{var nt=rR(),Qe=N(nt),Mt=I(Qe);se(Dt=>{F_(Qe,Dt),Qe.disabled=u(Ie),ae(Mt,` ${s[u(wt)]??""}`)},[()=>u(Te).roles.includes(u(wt))]),ie("change",Qe,()=>C(u(Te),u(wt))),F(vt,nt)});var Lt=I(ut),pt=N(Lt),Zt=I(pt,2),pn=I(Zt,2);se(()=>{be(Gt,"title",u(Ie)?"You can't change your own roles":void 0),pn.disabled=u(Ie),be(pn,"title",u(Ie)?"You can't delete your own account":void 0)}),ie("click",pt,()=>O(u(Te))),ie("click",Zt,()=>H(u(Te))),ie("click",pn,()=>M(u(Te))),F(me,Oe)}),F(fe,ne)};ce(ee,fe=>{u(i)?fe(y):u(o)?fe(j,1):fe(b,-1)})}var R=I(V,2),k=I(N(R),2),D=N(k),W=I(N(D),2),Y=I(D,2),B=I(N(Y),2),z=I(Y,2),K=I(N(z),2),te=I(z,2),he=I(N(te),2);Nt(he,21,()=>r,jo,(fe,ne)=>{var de=iR(),me=N(de),Te,Ie=I(me);se(()=>{Te!==(Te=u(ne))&&(me.value=(me.__value=u(ne))??""),ae(Ie,` ${s[u(ne)]??""}`)}),q_(n,[],me,()=>(u(ne),u(f)),Oe=>A(f,Oe)),F(fe,de)});var Ee=I(k,2),ge=I(N(Ee),2),Ce=N(ge);se(()=>{ge.disabled=!u(T),ae(Ce,u(p)?"Adding…":"Add user")}),Ue("submit",R,E),yt(W,()=>u(d),fe=>A(d,fe)),yt(B,()=>u(h),fe=>A(h,fe)),yt(K,()=>u(g),fe=>A(g,fe)),F(t,J),ot()}_t(["change","click"]);var lR=$('<dialog aria-label="Settings" class="svelte-1eaqpj"><header class="svelte-1eaqpj"><h2 class="svelte-1eaqpj">Settings</h2> <button type="button" class="close svelte-1eaqpj" aria-label="Close settings"><!></button></header> <div class="tabs svelte-1eaqpj" role="tablist" aria-label="Settings sections"><button type="button" role="tab">Users</button> <button type="button" role="tab">Branding</button> <button type="button" role="tab">Site</button> <button type="button" role="tab">Health</button></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function cR(t,e){it(e,!0);let n=Xn(e,"open",15),r=Q(void 0),s=Q("users");Rt(()=>{u(r)&&(n()&&!u(r).open?(A(s,"users"),u(r).showModal()):!n()&&u(r).open&&u(r).close())});function a(V){V.preventDefault(),n(!1)}var i=lR(),o=N(i),l=I(N(o),2),d=N(l);Ph(d,{size:18,"aria-hidden":"true"});var h=I(o,2),g=N(h);let f;var p=I(g,2);let v;var T=I(p,2);let _;var E=I(T,2);let O;var C=I(h,2),H=N(C);{var M=V=>{uR(V,{})},J=V=>{Sx(V,{})},U=V=>{Yx(V,{})},G=V=>{Hx(V,{})};ce(H,V=>{u(s)==="users"?V(M):u(s)==="branding"?V(J,1):u(s)==="site"?V(U,2):V(G,-1)})}hn(i,V=>A(r,V),()=>u(r)),se(()=>{be(g,"aria-selected",u(s)==="users"),f=Ge(g,1,"svelte-1eaqpj",null,f,{selected:u(s)==="users"}),be(p,"aria-selected",u(s)==="branding"),v=Ge(p,1,"svelte-1eaqpj",null,v,{selected:u(s)==="branding"}),be(T,"aria-selected",u(s)==="site"),_=Ge(T,1,"svelte-1eaqpj",null,_,{selected:u(s)==="site"}),be(E,"aria-selected",u(s)==="health"),O=Ge(E,1,"svelte-1eaqpj",null,O,{selected:u(s)==="health"})}),Ue("cancel",i,a),ie("click",l,()=>n(!1)),ie("click",g,()=>A(s,"users")),ie("click",p,()=>A(s,"branding")),ie("click",T,()=>A(s,"site")),ie("click",E,()=>A(s,"health")),F(t,i),ot()}_t(["click"]);const ld="nanoesis-theme";function dR(t){return t==="system"||t==="light"||t==="dark"}function D1(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function fR(){let t=Q("system"),e=Q(!1);const n=()=>{document.documentElement.dataset.theme=D1(u(t),u(e))};return{get choice(){return u(t)},get resolved(){return D1(u(t),u(e))},init(){const r=localStorage.getItem(ld);dR(r)&&A(t,r,!0);const s=window.matchMedia("(prefers-color-scheme: dark)");A(e,s.matches,!0),s.addEventListener("change",a=>{A(e,a.matches,!0),n()}),n()},setChoice(r){A(t,r,!0),r==="system"?localStorage.removeItem(ld):localStorage.setItem(ld,r),n()}}}const pl=fR();var hR=$('<button type="button"> </button>'),pR=$('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function mR(t,e){it(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];Hm();var r=pR();Nt(r,5,()=>n,s=>s.value,(s,a)=>{var i=hR();let o;var l=N(i);se(()=>{o=Ge(i,1,"option svelte-1cmi4dh",null,o,{selected:pl.choice===u(a).value}),be(i,"aria-pressed",pl.choice===u(a).value),ae(l,u(a).label)}),ie("click",i,()=>pl.setChoice(u(a).value)),F(s,i)}),F(t,r),ot()}_t(["click"]);var gR=$('<span class="badge svelte-yic9pk"> </span>'),vR=$('<button type="button"> <!></button>'),bR=$('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),ER=$('<span class="spacer"></span>'),_R=$('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),TR=$('<header class="topbar svelte-yic9pk"><div class="brand svelte-yic9pk"><img class="logo svelte-yic9pk" alt="" width="24" height="24"/> </div> <!> <div class="actions svelte-yic9pk"><!> <button class="publish svelte-yic9pk" type="button"> </button> <!> <!></div></header> <!>',1);function AR(t,e){it(e,!0);const n=Ae(()=>xn.logoUrl??Db),r=Ae(()=>xn.name??"nanoesis"),s=Ae(()=>ht.canAuthor&&ht.canDevelop);let a=Q(!1);Rt(()=>{ht.canDevelop&&!ht.canAuthor?Sr.set("templates"):ht.canAuthor&&!ht.canDevelop&&Sr.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"},{value:"migrations",label:"Migrations"}];async function o(ee){ee!==Sr.mode&&await vv("Switching workspaces will close this file.")&&Sr.set(ee)}Zu.ensureLoaded();function l(){Ks.start()}var d=TR(),h=tt(d),g=N(h),f=N(g),p=I(f,1,!0),v=I(g,2);{var T=ee=>{var y=bR();Nt(y,21,()=>i,j=>j.value,(j,b)=>{var R=vR();let k;var D=N(R),W=I(D);{var Y=B=>{var z=gR(),K=N(z);se(()=>{be(z,"aria-label",`${Zu.count} pending`),ae(K,Zu.count)}),F(B,z)};ce(W,B=>{u(b).value==="migrations"&&Zu.count>0&&B(Y)})}se(()=>{k=Ge(R,1,"option svelte-yic9pk",null,k,{selected:Sr.mode===u(b).value}),be(R,"aria-pressed",Sr.mode===u(b).value),ae(D,`${u(b).label??""} `)}),ie("click",R,()=>void o(u(b).value)),F(j,R)}),F(ee,y)},_=ee=>{var y=ER();F(ee,y)};ce(v,ee=>{u(s)?ee(T):ee(_,-1)})}var E=I(v,2),O=N(E);mR(O,{});var C=I(O,2),H=N(C),M=I(C,2);{var J=ee=>{var y=_R(),j=N(y);kh(j,{size:18,"aria-hidden":"true"}),ie("click",y,()=>A(a,!0)),F(ee,y)};ce(M,ee=>{ht.isAdmin&&ee(J)})}var U=I(M,2);bx(U,{});var G=I(h,2);{var V=ee=>{cR(ee,{get open(){return u(a)},set open(y){A(a,y,!0)}})};ce(G,ee=>{ht.isAdmin&&ee(V)})}se(()=>{be(f,"src",u(n)),ae(p,u(r)),C.disabled=Ks.active,ae(H,Ks.running?"Publishing…":"Publish")}),ie("click",C,l),F(t,d),ot()}_t(["click"]);var yR=$('<li class="hint svelte-2dodtm">Loading…</li>'),NR=$('<li class="hint svelte-2dodtm">Empty</li>'),SR=$('<p class="hint nested svelte-2dodtm">Loading…</p>'),wR=$("<div><!> <!></div>"),IR=$('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button" class="chevron svelte-2dodtm"><!></button> <button type="button"><span class="label svelte-2dodtm"> </span></button> <span class="actions svelte-2dodtm"><button type="button" title="Folder settings" class="svelte-2dodtm"><!></button></span></div> <!></li>'),CR=$('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),LR=$("<ul><!></ul>");function Ub(t,e){it(e,!0),Rt(()=>{sc(e.treePath)});const n=Ae(()=>Ei(e.treePath)),r=Ae(()=>{var U;return((U=u(n))==null?void 0:U.defaultTemplate)??e.inheritedTemplate}),s=Ae(()=>{var U;return(((U=u(n))==null?void 0:U.entries)??[]).filter(G=>!(G.kind==="item"&&G.slug==="index"))});function a(U){return`tree-group-${U.replace(/\//g,"--")||"root"}`}function i(U){di(U)||gp(U),e.onopenDir(U)}function o(U){return U.template??u(r)}function l(U){return U.isPublished?void 0:`${U.title}, not published`}function d(U){var ee;const G=[...U],V=(((ee=u(n))==null?void 0:ee.entries)??[]).map(y=>u(s).includes(y)?G.shift()??y.slug:y.slug);c6(e.treePath,V),e.onreorder(e.treePath,V)}function h(U,G){const V=u(s).map(y=>y.slug),ee=V.indexOf(U);ee<0||d(pf(V,ee,ee+G))}function g(U,G){U.key==="ArrowUp"?(U.preventDefault(),h(G.slug,-1)):U.key==="ArrowDown"&&(U.preventDefault(),h(G.slug,1))}function f(U,G){U6(U,e.treePath),G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",U.slug))}function p(U,G){return G.kind==="dir"&&G.path!==U.entry.path&&U.parent!==G.path&&!G.path.startsWith(`${U.entry.path}/`)}function v(U,G){return U.parent===e.treePath&&G.path!==U.entry.path}function T(U,G){const V=_i();V!==null&&(!p(V,U)&&!v(V,U)||(G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move"),zc(U.path)))}function _(U,G){G.preventDefault();const V=_i();if(Ps(),V===null)return;if(p(V,U)){e.onmove(V.entry.path,V.entry.kind,U.path);return}if(!v(V,U))return;const ee=u(s).map(b=>b.slug),y=ee.indexOf(V.entry.slug),j=ee.indexOf(U.slug);y<0||j<0||d(pf(ee,y,j))}var E=LR();let O;var C=N(E);{var H=U=>{var G=yR();F(U,G)},M=U=>{var G=NR();F(U,G)},J=U=>{var G=Vn(),V=tt(G);Nt(V,17,()=>u(s),ee=>ee.path,(ee,y)=>{var j=Vn(),b=tt(j);{var R=D=>{var W=IR(),Y=N(W);let B;var z=N(Y),K=N(z);df(K,{size:16,"aria-hidden":"true"});var te=I(z,2),he=N(te);{var Ee=Be=>{I6(Be,{size:16,"aria-hidden":"true"})},ge=Ae(()=>di(u(y).path)),Ce=Be=>{w6(Be,{size:16,"aria-hidden":"true"})};ce(he,Be=>{u(ge)?Be(Ee):Be(Ce,-1)})}var fe=I(te,2);let ne;var de=N(fe),me=N(de),Te=I(fe,2),Ie=N(Te),Oe=N(Ie);kh(Oe,{size:16,"aria-hidden":"true"});var Pe=I(Y,2);{var Fe=Be=>{var Pt=wR(),jt=N(Pt);{var Ct=Lt=>{var pt=SR();F(Lt,pt)},ut=Ae(()=>i6(u(y).path)&&Ei(u(y).path)===void 0);ce(jt,Lt=>{u(ut)&&Lt(Ct)})}var Gt=I(jt,2);{let Lt=Ae(()=>e.level+1);Ub(Gt,{get treePath(){return u(y).path},get inheritedTemplate(){return u(r)},get level(){return u(Lt)},get selectedPath(){return e.selectedPath},get activeDir(){return e.activeDir},get onselect(){return e.onselect},get onopenDir(){return e.onopenDir},get onsettingsDir(){return e.onsettingsDir},get onfoldermenu(){return e.onfoldermenu},get onreorder(){return e.onreorder},get onmove(){return e.onmove}})}se(Lt=>be(Pt,"id",Lt),[()=>a(u(y).path)]),F(Be,Pt)},St=Ae(()=>di(u(y).path));ce(Pe,Be=>{u(St)&&Be(Fe)})}se((Be,Pt,jt,Ct)=>{B=Ge(Y,1,"row svelte-2dodtm",null,B,Be),be(z,"aria-label",`Reorder ${u(y).name}; arrow keys move it`),be(te,"aria-expanded",Pt),be(te,"aria-controls",jt),be(te,"aria-label",Ct),ne=Ge(fe,1,"dir svelte-2dodtm",null,ne,{active:u(y).path===e.activeDir}),be(fe,"aria-current",u(y).path===e.activeDir),be(fe,"title",`${u(y).name}, open this section's page`),ae(me,u(y).name),be(Ie,"aria-label",`Settings for ${u(y).name}`)},[()=>({active:u(y).path===e.activeDir,"drop-target":Tp()===u(y).path}),()=>di(u(y).path),()=>a(u(y).path),()=>`${di(u(y).path)?"Collapse":"Expand"} ${u(y).name}`]),Ue("dragstart",Y,Be=>f(u(y),Be)),Ue("dragover",Y,Be=>T(u(y),Be)),Ue("dragleave",Y,()=>zc(null)),Ue("drop",Y,Be=>_(u(y),Be)),Ue("dragend",Y,function(...Be){Ps==null||Ps.apply(this,Be)}),ie("contextmenu",Y,Be=>{Be.preventDefault(),e.onfoldermenu(u(y).path,Be.clientX,Be.clientY)}),ie("keydown",z,Be=>g(Be,u(y))),ie("click",te,()=>gp(u(y).path)),ie("click",fe,()=>i(u(y).path)),ie("click",Ie,()=>e.onsettingsDir(u(y).path)),F(D,W)},k=D=>{var W=CR(),Y=N(W);let B;var z=N(Y),K=N(z);df(K,{size:16,"aria-hidden":"true"});var te=I(z,2);let he;var Ee=N(te),ge=N(Ee);se((Ce,fe)=>{B=Ge(Y,1,"row svelte-2dodtm",null,B,Ce),be(z,"aria-label",`Reorder ${u(y).title}; arrow keys move it`),he=Ge(te,1,"item svelte-2dodtm",null,he,{selected:u(y).path===e.selectedPath,unpublished:!u(y).isPublished}),be(te,"aria-current",u(y).path===e.selectedPath),be(te,"aria-label",fe),be(te,"title",u(y).title),ae(ge,u(y).title)},[()=>({"drop-target":Tp()===u(y).path}),()=>l(u(y))]),Ue("dragstart",Y,Ce=>f(u(y),Ce)),Ue("dragover",Y,Ce=>T(u(y),Ce)),Ue("dragleave",Y,()=>zc(null)),Ue("drop",Y,Ce=>_(u(y),Ce)),Ue("dragend",Y,function(...Ce){Ps==null||Ps.apply(this,Ce)}),ie("keydown",z,Ce=>g(Ce,u(y))),ie("click",te,()=>e.onselect(u(y).path,o(u(y)))),F(D,W)};ce(b,D=>{u(y).kind==="dir"?D(R):D(k,-1)})}F(ee,j)}),F(U,G)};ce(C,U=>{u(n)===void 0?U(H):u(s).length===0?U(M,1):U(J,-1)})}se(()=>O=Ge(E,1,"level svelte-2dodtm",null,O,{root:e.level===1})),F(t,E),ot()}_t(["contextmenu","keydown","click"]);var OR=$('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),xR=$('<p class="placeholder pad svelte-whg6dh">Loading migrations…</p>'),RR=$('<p class="placeholder svelte-whg6dh"> </p>'),DR=$('<p class="placeholder svelte-whg6dh"> </p>'),kR=$('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),PR=$('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),MR=$('<span class="home-hint svelte-whg6dh">needs template</span>'),BR=$('<span class="home-hint svelte-whg6dh">draft</span>'),FR=$("<div>Move to top level</div>"),UR=$('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),HR=$("<option> </option>"),qR=$('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),jR=$(`<div class="work-pad svelte-whg6dh"><div class="broken-item svelte-whg6dh"><h1 class="svelte-whg6dh">This page has no template</h1> <p class="svelte-whg6dh">Pick a template to set up the form, or delete the page. This usually happens when
|
|
131
|
+
so treat it like a password.</p> <!></dialog>`);function Ex(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q(!1),a=Q(null),i=Q(null),o=Q(null),l=Q(!1),d=Q(!1);Rt(()=>{u(r)&&(n()&&!u(r).open?(A(s,!1),A(a,null),A(i,null),A(o,null),A(l,!1),A(d,!1),u(r).showModal()):!n()&&u(r).open&&u(r).close())});let f=_e(()=>u(o)===null?"":new Date(u(o)).toLocaleDateString());async function g(){A(s,!0),A(a,null),A(d,!1),A(l,!1);const H=await pt.createMcpToken();if(A(s,!1),!H.ok||H.token===void 0){A(a,H.error??"Could not create a token.",!0);return}A(i,H.token,!0),A(o,H.expiresAt??null,!0)}async function h(){if(u(i)!==null)try{await navigator.clipboard.writeText(u(i)),A(l,!0)}catch{A(l,!1)}}async function p(){A(s,!0),A(a,null);const H=await pt.revokeMcpTokens();if(A(s,!1),!H.ok){A(a,H.error??"Could not revoke tokens.",!0);return}A(i,null),A(o,null),A(d,!0)}function v(H){var M;(M=H.currentTarget)==null||M.select()}function T(H){H.preventDefault(),n(!1)}var _=bx(),E=I(N(_),4);{var O=H=>{var M=px(),J=et(M),U=N(J),G=N(U),V=I(U,2),ee=I(J,4),y=N(ee),j=I(y,2),b=N(j);re(()=>{ae(G,`Your new token${u(f)?` · expires ${u(f)}`:""}`),B_(V,u(i)),ae(b,u(l)?"Copied":"Copy token")}),ie("click",V,v),ie("click",y,()=>n(!1)),ie("click",j,h),F(H,M)},C=H=>{var M=vx(),J=et(M);{var U=k=>{var D=mx(),W=N(D);re(()=>ae(W,u(a))),F(k,D)};ce(J,k=>{u(a)&&k(U)})}var G=I(J,2);{var V=k=>{var D=gx();F(k,D)};ce(G,k=>{u(d)&&k(V)})}var ee=I(G,2),y=N(ee),j=I(y,4),b=I(j,2),R=N(b);re(()=>{y.disabled=u(s),b.disabled=u(s),ae(R,u(s)?"Working…":"Create token")}),ie("click",y,p),ie("click",j,()=>n(!1)),ie("click",b,g),F(H,M)};ce(E,H=>{u(i)!==null?H(O):H(C,-1)})}mn(_,H=>A(r,H),()=>u(r)),Ue("cancel",_,T),F(t,_),it()}Tt(["click"]);var _x=$('<details class="menu svelte-1y2gtaj"><summary aria-label="Account menu" class="svelte-1y2gtaj"><span class="label svelte-1y2gtaj"> </span> <span class="caret svelte-1y2gtaj" aria-hidden="true">▾</span></summary> <ul role="menu" class="svelte-1y2gtaj"><li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Change password…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">MCP access token…</button></li> <li class="svelte-1y2gtaj"><button type="button" role="menuitem" class="svelte-1y2gtaj">Log out</button></li></ul></details> <!> <!>',1);function Tx(t,e){at(e,!0);let n=Q(!1),r=Q(!1),s=_e(()=>{var p;return((p=pt.principal)==null?void 0:p.username)??""});function a(){u(d)&&(u(d).open=!1)}function i(){a(),A(n,!0)}function o(){a(),A(r,!0)}async function l(){a(),await pt.logout()}let d=Q(void 0);Rt(()=>{function p(v){u(d)&&u(d).open&&!u(d).contains(v.target)&&(u(d).open=!1)}return document.addEventListener("click",p),()=>document.removeEventListener("click",p)});var f=Kn(),g=et(f);{var h=p=>{var v=_x(),T=et(v),_=N(T),E=N(_),O=N(E),C=I(_,2),H=N(C),M=N(H),J=I(H,2),U=N(J),G=I(J,2),V=N(G);mn(T,j=>A(d,j),()=>u(d));var ee=I(T,2);hx(ee,{get open(){return u(n)},set open(j){A(n,j,!0)}});var y=I(ee,2);Ex(y,{get open(){return u(r)},set open(j){A(r,j,!0)}}),re(()=>ae(O,u(s))),ie("click",M,i),ie("click",U,o),ie("click",V,l),F(p,v)};ce(g,p=>{pt.status==="authenticated"&&pt.principal!==null&&p(h)})}F(t,f),it()}Tt(["click"]);var Ax=$('<p class="error svelte-1e3birj" role="alert"> </p>'),yx=$('<p class="ok svelte-1e3birj" role="status"> </p>'),Nx=$('<img alt="Current logo" class="svelte-1e3birj"/>'),Sx=$('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),wx=$('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),Ix=$(`<div class="panel svelte-1e3birj"><p class="lede svelte-1e3birj">Replace the editor's top-left logo and name with your own. Leave the name blank to use the
|
|
132
|
+
built-in brand. (The footer credit stays.)</p> <!> <!> <section class="field svelte-1e3birj"><label for="brand-name" class="svelte-1e3birj">Name</label> <div class="row svelte-1e3birj"><input id="brand-name" type="text" placeholder="nanoesis" class="svelte-1e3birj"/> <button type="button" class="primary svelte-1e3birj"> </button></div></section> <section class="field svelte-1e3birj"><span class="field-label svelte-1e3birj">Logo</span> <div class="logo-row svelte-1e3birj"><div class="preview svelte-1e3birj"><!></div> <div class="logo-actions svelte-1e3birj"><input type="file" accept="image/*" class="visually-hidden svelte-1e3birj"/> <button type="button" class="ghost svelte-1e3birj"> </button> <!></div></div> <small class="svelte-1e3birj">PNG, SVG, or any image, up to 1 MB.</small></section></div>`);function Cx(t,e){at(e,!0);let n=Q(ct(Dn.name??"")),r=Q(!1),s=Q(!1),a=Q(null),i=Q(null),o=Q(void 0);function l(Y){A(i,Y,!0),setTimeout(()=>A(i,null),1500)}async function d(){A(r,!0),A(a,null);const Y=u(n).trim(),B=await Xy(Y===""?null:Y);if(A(r,!1),!B.ok){A(a,B.error,!0);return}await Dn.load(),l("Name saved.")}async function f(Y){var te;const B=Y.currentTarget,z=(te=B.files)==null?void 0:te[0];if(z===void 0)return;A(s,!0),A(a,null);const K=await Qy(z);if(A(s,!1),B.value="",!K.ok){A(a,K.error,!0);return}await Dn.load(),l("Logo updated.")}async function g(){A(a,null);const Y=await Zy();if(!Y.ok){A(a,Y.error,!0);return}await Dn.load(),l("Logo removed.")}var h=Ix(),p=I(N(h),2);{var v=Y=>{var B=Ax(),z=N(B);re(()=>ae(z,u(a))),F(Y,B)};ce(p,Y=>{u(a)&&Y(v)})}var T=I(p,2);{var _=Y=>{var B=yx(),z=N(B);re(()=>ae(z,u(i))),F(Y,B)};ce(T,Y=>{u(i)&&Y(_)})}var E=I(T,2),O=I(N(E),2),C=N(O),H=I(C,2),M=N(H),J=I(E,2),U=I(N(J),2),G=N(U),V=N(G);{var ee=Y=>{var B=Nx();re(()=>be(B,"src",Dn.logoUrl)),F(Y,B)},y=Y=>{var B=Sx();F(Y,B)};ce(V,Y=>{Dn.logoUrl?Y(ee):Y(y,-1)})}var j=I(G,2),b=N(j);mn(b,Y=>A(o,Y),()=>u(o));var R=I(b,2),k=N(R),D=I(R,2);{var W=Y=>{var B=wx();ie("click",B,g),F(Y,B)};ce(D,Y=>{Dn.logoUrl&&Y(W)})}re(()=>{H.disabled=u(r),ae(M,u(r)?"Saving…":"Save"),be(G,"aria-hidden",Dn.logoUrl===null),R.disabled=u(s),ae(k,u(s)?"Uploading…":Dn.logoUrl?"Replace logo…":"Upload logo…")}),St(C,()=>u(n),Y=>A(n,Y)),ie("click",H,d),ie("change",b,f),ie("click",R,()=>{var Y;return(Y=u(o))==null?void 0:Y.click()}),F(t,h),it()}Tt(["click","change"]);const Lx={"content-type":"application/json"};async function Ox(){const t=await We("/api/admin/diagnostics");if(t.status===404)throw new Error("Diagnostics are not available on this host.");if(!t.ok)throw new Error(`Couldn't load diagnostics (HTTP ${t.status}).`);return(await t.json()).findings}async function xx(t){const e=await We("/api/admin/diagnostics/repair",{method:"POST",headers:Lx,body:JSON.stringify({id:t})});if(!e.ok){const n=await e.json().catch(()=>({}));throw new Error(n.error??`Repair failed (HTTP ${e.status}).`)}return(await e.json()).findings}var Rx=$('<p class="error svelte-1iylrs" role="alert"> </p>'),Dx=$('<p class="error svelte-1iylrs" role="alert"> </p>'),kx=$('<span class="all-good svelte-1iylrs">All checks passed.</span>'),Px=$('<span class="chip chip-error svelte-1iylrs"> </span>'),Mx=$('<span class="chip chip-warning svelte-1iylrs"> </span>'),Bx=$('<span class="chip chip-info svelte-1iylrs"> </span>'),Fx=$("<!> <!> <!>",1),Ux=$('<div class="finding-actions svelte-1iylrs"><button type="button" class="primary svelte-1iylrs"> </button></div>'),Hx=$('<li><div class="finding-head svelte-1iylrs"><span> </span> <h3 class="svelte-1iylrs"> </h3></div> <p class="detail svelte-1iylrs"> </p> <!></li>'),qx=$('<ul class="findings svelte-1iylrs"></ul>'),jx=$(`<div class="panel svelte-1iylrs"><p class="lede svelte-1iylrs">A live check of your installation — what works, and what doesn't. Findings come from
|
|
133
|
+
port-agnostic probes, so they catch problems regardless of how your storage and CDN are wired. <strong>Repair</strong> fixes that the engine can apply in place; advisory findings are everything else.</p> <!> <!> <div class="actions-bar svelte-1iylrs"><div class="summary svelte-1iylrs" aria-live="polite"><!></div> <button type="button" class="svelte-1iylrs"> </button></div> <!></div>`);function $x(t,e){at(e,!0);let n=Q(!0),r=Q(null),s=Q(ct([])),a=Q(null),i=Q(null);const o={error:"Error",warning:"Warning",info:"Info"},l={error:0,warning:1,info:2},d=_e(()=>[...u(s)].sort((j,b)=>l[j.severity]-l[b.severity])),f=_e(()=>({error:u(s).filter(j=>j.severity==="error").length,warning:u(s).filter(j=>j.severity==="warning").length,info:u(s).filter(j=>j.severity==="info").length}));async function g(){A(n,!0),A(r,null);try{A(s,await Ox(),!0)}catch(j){A(r,j instanceof Error?j.message:String(j),!0)}finally{A(n,!1)}}Rt(()=>{g()});async function h(j){if(j.repair){A(a,j.repair.id,!0),A(i,null);try{A(s,await xx(j.repair.id),!0)}catch(b){A(i,b instanceof Error?b.message:String(b),!0)}finally{A(a,null)}}}var p=jx(),v=I(N(p),2);{var T=j=>{var b=Rx(),R=N(b);re(()=>ae(R,u(r))),F(j,b)};ce(v,j=>{u(r)&&j(T)})}var _=I(v,2);{var E=j=>{var b=Dx(),R=N(b);re(()=>ae(R,u(i))),F(j,b)};ce(_,j=>{u(i)&&j(E)})}var O=I(_,2),C=N(O),H=N(C);{var M=j=>{var b=_l("Running checks…");F(j,b)},J=j=>{var b=kx();F(j,b)},U=j=>{var b=Fx(),R=et(b);{var k=z=>{var K=Px(),te=N(K);re(()=>ae(te,`${u(f).error??""} error${u(f).error===1?"":"s"}`)),F(z,K)};ce(R,z=>{u(f).error>0&&z(k)})}var D=I(R,2);{var W=z=>{var K=Mx(),te=N(K);re(()=>ae(te,`${u(f).warning??""} warning${u(f).warning===1?"":"s"}`)),F(z,K)};ce(D,z=>{u(f).warning>0&&z(W)})}var Y=I(D,2);{var B=z=>{var K=Bx(),te=N(K);re(()=>ae(te,`${u(f).info??""} info`)),F(z,K)};ce(Y,z=>{u(f).info>0&&z(B)})}F(j,b)};ce(H,j=>{u(n)?j(M):u(s).length===0?j(J,1):j(U,-1)})}var G=I(C,2),V=N(G),ee=I(O,2);{var y=j=>{var b=qx();wt(b,21,()=>u(d),R=>R.id,(R,k)=>{var D=Hx(),W=N(D),Y=N(W),B=N(Y),z=I(Y,2),K=N(z),te=I(W,2),fe=N(te),Ee=I(te,2);{var ge=Le=>{var de=Ux(),me=N(de),Ie=N(me);re(()=>{me.disabled=u(a)!==null,ae(Ie,u(a)===u(k).repair.id?"Repairing…":u(k).repair.label)}),ie("click",me,()=>h(u(k))),F(Le,de)};ce(Ee,Le=>{u(k).repair&&Le(ge)})}re(()=>{Ke(D,1,`finding finding-${u(k).severity??""}`,"svelte-1iylrs"),Ke(Y,1,`severity-tag severity-${u(k).severity??""}`,"svelte-1iylrs"),ae(B,o[u(k).severity]),ae(K,u(k).title),ae(fe,u(k).detail)}),F(R,D)}),F(j,b)};ce(ee,j=>{!u(n)&&u(s).length>0&&j(y)})}re(()=>{G.disabled=u(n),ae(V,u(n)?"Checking…":"Re-run checks")}),ie("click",G,g),F(t,p),it()}Tt(["click"]);var Yx=$('<p class="error svelte-8ydvuj" role="alert"> </p>'),zx=$('<p class="ok svelte-8ydvuj" role="status"> </p>'),Wx=$(`<div class="panel svelte-8ydvuj"><p class="lede svelte-8ydvuj">The site's base URL, its public address, e.g. <code class="svelte-8ydvuj">https://example.com</code>. Setting it makes <code class="svelte-8ydvuj">publish</code> emit a <code class="svelte-8ydvuj">sitemap.xml</code> (and absolute links in the RSS feed). Leave it blank to skip the sitemap.</p> <!> <!> <section class="field svelte-8ydvuj"><label for="site-base-url" class="svelte-8ydvuj">Base URL</label> <div class="row svelte-8ydvuj"><input id="site-base-url" type="url" inputmode="url" placeholder="https://example.com" class="svelte-8ydvuj"/> <button type="button" class="primary svelte-8ydvuj"> </button></div> <small class="svelte-8ydvuj">No trailing slash needed. Used only to build absolute URLs in the sitemap and feed.</small></section></div>`);function Gx(t,e){at(e,!0);let n=Q(""),r=Q(!0),s=Q(!1),a=Q(null),i=Q(null);t6().then(C=>{A(n,C.baseUrl,!0),A(r,!1)});function o(C){A(i,C,!0),setTimeout(()=>A(i,null),1500)}async function l(){A(s,!0),A(a,null);try{await n6({baseUrl:u(n)}),o("Saved.")}catch(C){A(a,C instanceof Error?C.message:String(C),!0)}finally{A(s,!1)}}var d=Wx(),f=I(N(d),2);{var g=C=>{var H=Yx(),M=N(H);re(()=>ae(M,u(a))),F(C,H)};ce(f,C=>{u(a)&&C(g)})}var h=I(f,2);{var p=C=>{var H=zx(),M=N(H);re(()=>ae(M,u(i))),F(C,H)};ce(h,C=>{u(i)&&C(p)})}var v=I(h,2),T=I(N(v),2),_=N(T),E=I(_,2),O=N(E);re(()=>{_.disabled=u(r),E.disabled=u(r)||u(s),ae(O,u(s)?"Saving…":"Save")}),St(_,()=>u(n),C=>A(n,C)),ie("click",E,l),F(t,d),it()}Tt(["click"]);async function Kx(){const t=await We("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const i0={"content-type":"application/json"};function Vx(t){return Ja("/api/users",{method:"POST",headers:i0,body:JSON.stringify(t)})}function R1(t,e){return Ja(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:i0,body:JSON.stringify(e)})}function Xx(t,e){return Ja(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:i0,body:JSON.stringify(e)})}function Qx(t){return Ja(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var Zx=$('<p class="error svelte-plhp3i" role="alert"> </p>'),Jx=$('<p class="muted svelte-plhp3i">Loading users…</p>'),eR=$('<p class="error svelte-plhp3i"> </p>'),tR=$('<span class="you svelte-plhp3i">(you)</span>'),nR=$('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),rR=$('<span class="you svelte-plhp3i">(you)</span>'),sR=$('<span class="username svelte-plhp3i"> <!></span>'),aR=$('<span class="chip locked svelte-plhp3i">Locked</span>'),iR=$('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),oR=$('<tr><td class="svelte-plhp3i"><div class="who svelte-plhp3i"><!></div> <!></td><td class="svelte-plhp3i"><div class="roles svelte-plhp3i"></div></td><td class="row-actions svelte-plhp3i"><button type="button" class="link svelte-plhp3i">Edit name</button> <button type="button" class="link svelte-plhp3i">Reset password</button> <button type="button" class="link danger svelte-plhp3i">Delete</button></td></tr>'),uR=$('<table class="svelte-plhp3i"><thead><tr><th class="svelte-plhp3i">User</th><th class="svelte-plhp3i">Roles</th><th class="svelte-plhp3i"></th></tr></thead><tbody></tbody></table>'),lR=$('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),cR=$('<div class="panel svelte-plhp3i"><!> <section class="list"><!></section> <form class="create svelte-plhp3i"><h3 class="svelte-plhp3i">Add a user</h3> <div class="create-grid svelte-plhp3i"><label class="svelte-plhp3i"><span class="svelte-plhp3i">Username</span> <input type="text" autocomplete="off" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Display name <small class="optional svelte-plhp3i">(optional)</small></span> <input type="text" autocomplete="off" placeholder="Shown on bylines; defaults to the username" class="svelte-plhp3i"/></label> <label class="svelte-plhp3i"><span class="svelte-plhp3i">Initial password</span> <input type="text" autocomplete="off" placeholder="Set a password" class="svelte-plhp3i"/></label> <fieldset class="roles-field svelte-plhp3i"><legend class="svelte-plhp3i">Roles</legend> <div class="roles svelte-plhp3i"></div></fieldset></div> <div class="create-actions svelte-plhp3i"><small class="svelte-plhp3i">Share the password with them; they can change it from their account menu.</small> <button type="submit" class="primary svelte-plhp3i"> </button></div></form></div>');function dR(t,e){at(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=Q(ct([])),i=Q(!0),o=Q(null),l=Q(null),d=Q(""),f=Q(""),g=Q(""),h=Q(ct(["author"])),p=Q(!1);const v=_e(()=>{var de;return((de=pt.principal)==null?void 0:de.userId)??null}),T=_e(()=>!u(p)&&u(d).trim()!==""&&u(g)!==""&&u(h).length>0);async function _(){A(i,!0),A(o,null);try{A(a,await Kx(),!0)}catch(de){A(o,de instanceof Error?de.message:String(de),!0)}finally{A(i,!1)}}Rt(()=>{_()});async function E(de){if(de.preventDefault(),!u(T))return;A(p,!0),A(l,null);const me=await Vx({username:u(d).trim(),password:u(g),roles:[...u(h)],...u(f).trim()!==""&&{displayName:u(f).trim()}});if(A(p,!1),!me.ok){A(l,me.error,!0);return}A(d,""),A(f,""),A(g,""),A(h,["author"],!0),await _()}async function O(de){const me=await ko(`Display name for “${de.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:de.displayName??"",placeholder:de.username});if(me===null)return;A(l,null);const Ie=await R1(de.id,{displayName:me});Ie.ok||A(l,Ie.error,!0),await _()}async function C(de,me){const se=de.roles.includes(me)?de.roles.filter(Ae=>Ae!==me):[...de.roles,me];if(se.length===0){A(l,"A user must keep at least one role."),await _();return}A(l,null);const he=await R1(de.id,{roles:se});he.ok||A(l,he.error,!0),await _()}async function H(de){const me=await ko(`Set a new password for “${de.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(me===null)return;A(l,null);const Ie=await Xx(de.id,{newPassword:me});Ie.ok||A(l,Ie.error,!0)}async function M(de){if(!await xl(`Delete the user “${de.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;A(l,null);const Ie=await Qx(de.id);if(!Ie.ok){A(l,Ie.error,!0);return}await _()}var J=cR(),U=N(J);{var G=de=>{var me=Zx(),Ie=N(me);re(()=>ae(Ie,u(l))),F(de,me)};ce(U,de=>{u(l)&&de(G)})}var V=I(U,2),ee=N(V);{var y=de=>{var me=Jx();F(de,me)},j=de=>{var me=eR(),Ie=N(me);re(()=>ae(Ie,u(o))),F(de,me)},b=de=>{var me=uR(),Ie=I(N(me));wt(Ie,21,()=>u(a),se=>se.id,(se,he)=>{const Ae=_e(()=>u(he).id===u(v));var Ce=oR(),Me=N(Ce),ke=N(Me),dt=N(ke);{var Be=mt=>{var yt=nR(),Bt=et(yt),ot=N(Bt),tt=I(ot);{var bt=ln=>{var Zn=tR();F(ln,Zn)};ce(tt,ln=>{u(Ae)&&ln(bt)})}var An=I(Bt,2),yn=N(An);re(()=>{ae(ot,u(he).displayName),ae(yn,u(he).username)}),F(mt,yt)},It=mt=>{var yt=sR(),Bt=N(yt),ot=I(Bt);{var tt=bt=>{var An=rR();F(bt,An)};ce(ot,bt=>{u(Ae)&&bt(tt)})}re(()=>ae(Bt,u(he).username)),F(mt,yt)};ce(dt,mt=>{u(he).displayName?mt(Be):mt(It,-1)})}var Dt=I(ke,2);{var Lt=mt=>{var yt=aR();F(mt,yt)};ce(Dt,mt=>{u(he).locked&&mt(Lt)})}var ft=I(Me),Vt=N(ft);wt(Vt,21,()=>r,jo,(mt,yt)=>{var Bt=iR(),ot=N(Bt),tt=I(ot);re(bt=>{F_(ot,bt),ot.disabled=u(Ae),ae(tt,` ${s[u(yt)]??""}`)},[()=>u(he).roles.includes(u(yt))]),ie("change",ot,()=>C(u(he),u(yt))),F(mt,Bt)});var qt=I(ft),Pt=N(qt),Gt=I(Pt,2),Mt=I(Gt,2);re(()=>{be(Vt,"title",u(Ae)?"You can't change your own roles":void 0),Mt.disabled=u(Ae),be(Mt,"title",u(Ae)?"You can't delete your own account":void 0)}),ie("click",Pt,()=>O(u(he))),ie("click",Gt,()=>H(u(he))),ie("click",Mt,()=>M(u(he))),F(se,Ce)}),F(de,me)};ce(ee,de=>{u(i)?de(y):u(o)?de(j,1):de(b,-1)})}var R=I(V,2),k=I(N(R),2),D=N(k),W=I(N(D),2),Y=I(D,2),B=I(N(Y),2),z=I(Y,2),K=I(N(z),2),te=I(z,2),fe=I(N(te),2);wt(fe,21,()=>r,jo,(de,me)=>{var Ie=lR(),se=N(Ie),he,Ae=I(se);re(()=>{he!==(he=u(me))&&(se.value=(se.__value=u(me))??""),ae(Ae,` ${s[u(me)]??""}`)}),q_(n,[],se,()=>(u(me),u(h)),Ce=>A(h,Ce)),F(de,Ie)});var Ee=I(k,2),ge=I(N(Ee),2),Le=N(ge);re(()=>{ge.disabled=!u(T),ae(Le,u(p)?"Adding…":"Add user")}),Ue("submit",R,E),St(W,()=>u(d),de=>A(d,de)),St(B,()=>u(f),de=>A(f,de)),St(K,()=>u(g),de=>A(g,de)),F(t,J),it()}Tt(["change","click"]);var fR=$('<dialog aria-label="Settings" class="svelte-1eaqpj"><header class="svelte-1eaqpj"><h2 class="svelte-1eaqpj">Settings</h2> <button type="button" class="close svelte-1eaqpj" aria-label="Close settings"><!></button></header> <div class="tabs svelte-1eaqpj" role="tablist" aria-label="Settings sections"><button type="button" role="tab">Users</button> <button type="button" role="tab">Branding</button> <button type="button" role="tab">Site</button> <button type="button" role="tab">Health</button></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function hR(t,e){at(e,!0);let n=Vn(e,"open",15),r=Q(void 0),s=Q("users");Rt(()=>{u(r)&&(n()&&!u(r).open?(A(s,"users"),u(r).showModal()):!n()&&u(r).open&&u(r).close())});function a(V){V.preventDefault(),n(!1)}var i=fR(),o=N(i),l=I(N(o),2),d=N(l);Mh(d,{size:18,"aria-hidden":"true"});var f=I(o,2),g=N(f);let h;var p=I(g,2);let v;var T=I(p,2);let _;var E=I(T,2);let O;var C=I(f,2),H=N(C);{var M=V=>{dR(V,{})},J=V=>{Cx(V,{})},U=V=>{Gx(V,{})},G=V=>{$x(V,{})};ce(H,V=>{u(s)==="users"?V(M):u(s)==="branding"?V(J,1):u(s)==="site"?V(U,2):V(G,-1)})}mn(i,V=>A(r,V),()=>u(r)),re(()=>{be(g,"aria-selected",u(s)==="users"),h=Ke(g,1,"svelte-1eaqpj",null,h,{selected:u(s)==="users"}),be(p,"aria-selected",u(s)==="branding"),v=Ke(p,1,"svelte-1eaqpj",null,v,{selected:u(s)==="branding"}),be(T,"aria-selected",u(s)==="site"),_=Ke(T,1,"svelte-1eaqpj",null,_,{selected:u(s)==="site"}),be(E,"aria-selected",u(s)==="health"),O=Ke(E,1,"svelte-1eaqpj",null,O,{selected:u(s)==="health"})}),Ue("cancel",i,a),ie("click",l,()=>n(!1)),ie("click",g,()=>A(s,"users")),ie("click",p,()=>A(s,"branding")),ie("click",T,()=>A(s,"site")),ie("click",E,()=>A(s,"health")),F(t,i),it()}Tt(["click"]);const cd="nanoesis-theme";function pR(t){return t==="system"||t==="light"||t==="dark"}function D1(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function mR(){let t=Q("system"),e=Q(!1);const n=()=>{document.documentElement.dataset.theme=D1(u(t),u(e))};return{get choice(){return u(t)},get resolved(){return D1(u(t),u(e))},init(){const r=localStorage.getItem(cd);pR(r)&&A(t,r,!0);const s=window.matchMedia("(prefers-color-scheme: dark)");A(e,s.matches,!0),s.addEventListener("change",a=>{A(e,a.matches,!0),n()}),n()},setChoice(r){A(t,r,!0),r==="system"?localStorage.removeItem(cd):localStorage.setItem(cd,r),n()}}}const ml=mR();var gR=$('<button type="button"> </button>'),vR=$('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function bR(t,e){at(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];Hm();var r=vR();wt(r,5,()=>n,s=>s.value,(s,a)=>{var i=gR();let o;var l=N(i);re(()=>{o=Ke(i,1,"option svelte-1cmi4dh",null,o,{selected:ml.choice===u(a).value}),be(i,"aria-pressed",ml.choice===u(a).value),ae(l,u(a).label)}),ie("click",i,()=>ml.setChoice(u(a).value)),F(s,i)}),F(t,r),it()}Tt(["click"]);var ER=$('<span class="badge svelte-yic9pk"> </span>'),_R=$('<button type="button"> <!></button>'),TR=$('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),AR=$('<span class="spacer"></span>'),yR=$('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),NR=$('<header class="topbar svelte-yic9pk"><div class="brand svelte-yic9pk"><img class="logo svelte-yic9pk" alt="" width="24" height="24"/> </div> <!> <div class="actions svelte-yic9pk"><!> <button class="publish svelte-yic9pk" type="button"> </button> <!> <!></div></header> <!>',1);function SR(t,e){at(e,!0);const n=_e(()=>Dn.logoUrl??Db),r=_e(()=>Dn.name??"nanoesis"),s=_e(()=>pt.canAuthor&&pt.canDevelop);let a=Q(!1);Rt(()=>{pt.canDevelop&&!pt.canAuthor?Sr.set("templates"):pt.canAuthor&&!pt.canDevelop&&Sr.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"},{value:"migrations",label:"Migrations"}];async function o(ee){ee!==Sr.mode&&await vv("Switching workspaces will close this file.")&&Sr.set(ee)}Ju.ensureLoaded();function l(){bs.start()}var d=NR(),f=et(d),g=N(f),h=N(g),p=I(h,1,!0),v=I(g,2);{var T=ee=>{var y=TR();wt(y,21,()=>i,j=>j.value,(j,b)=>{var R=_R();let k;var D=N(R),W=I(D);{var Y=B=>{var z=ER(),K=N(z);re(()=>{be(z,"aria-label",`${Ju.count} pending`),ae(K,Ju.count)}),F(B,z)};ce(W,B=>{u(b).value==="migrations"&&Ju.count>0&&B(Y)})}re(()=>{k=Ke(R,1,"option svelte-yic9pk",null,k,{selected:Sr.mode===u(b).value}),be(R,"aria-pressed",Sr.mode===u(b).value),ae(D,`${u(b).label??""} `)}),ie("click",R,()=>void o(u(b).value)),F(j,R)}),F(ee,y)},_=ee=>{var y=AR();F(ee,y)};ce(v,ee=>{u(s)?ee(T):ee(_,-1)})}var E=I(v,2),O=N(E);bR(O,{});var C=I(O,2),H=N(C),M=I(C,2);{var J=ee=>{var y=yR(),j=N(y);Ph(j,{size:18,"aria-hidden":"true"}),ie("click",y,()=>A(a,!0)),F(ee,y)};ce(M,ee=>{pt.isAdmin&&ee(J)})}var U=I(M,2);Tx(U,{});var G=I(f,2);{var V=ee=>{hR(ee,{get open(){return u(a)},set open(y){A(a,y,!0)}})};ce(G,ee=>{pt.isAdmin&&ee(V)})}re(()=>{be(h,"src",u(n)),ae(p,u(r)),C.disabled=bs.active,ae(H,bs.running?"Publishing…":"Publish")}),ie("click",C,l),F(t,d),it()}Tt(["click"]);var wR=$('<li class="hint svelte-2dodtm">Loading…</li>'),IR=$('<li class="hint svelte-2dodtm">Empty</li>'),CR=$('<p class="hint nested svelte-2dodtm">Loading…</p>'),LR=$("<div><!> <!></div>"),OR=$('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button" class="chevron svelte-2dodtm"><!></button> <button type="button"><span class="label svelte-2dodtm"> </span></button> <span class="actions svelte-2dodtm"><button type="button" title="Folder settings" class="svelte-2dodtm"><!></button></span></div> <!></li>'),xR=$('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),RR=$("<ul><!></ul>");function Ub(t,e){at(e,!0),Rt(()=>{ac(e.treePath)});const n=_e(()=>Ei(e.treePath)),r=_e(()=>{var U;return((U=u(n))==null?void 0:U.defaultTemplate)??e.inheritedTemplate}),s=_e(()=>{var U;return(((U=u(n))==null?void 0:U.entries)??[]).filter(G=>!(G.kind==="item"&&G.slug==="index"))});function a(U){return`tree-group-${U.replace(/\//g,"--")||"root"}`}function i(U){di(U)||vp(U),e.onopenDir(U)}function o(U){return U.template??u(r)}function l(U){return U.isPublished?void 0:`${U.title}, not published`}function d(U){var ee;const G=[...U],V=(((ee=u(n))==null?void 0:ee.entries)??[]).map(y=>u(s).includes(y)?G.shift()??y.slug:y.slug);d6(e.treePath,V),e.onreorder(e.treePath,V)}function f(U,G){const V=u(s).map(y=>y.slug),ee=V.indexOf(U);ee<0||d(mf(V,ee,ee+G))}function g(U,G){U.key==="ArrowUp"?(U.preventDefault(),f(G.slug,-1)):U.key==="ArrowDown"&&(U.preventDefault(),f(G.slug,1))}function h(U,G){H6(U,e.treePath),G.dataTransfer&&(G.dataTransfer.effectAllowed="move",G.dataTransfer.setData("text/plain",U.slug))}function p(U,G){return G.kind==="dir"&&G.path!==U.entry.path&&U.parent!==G.path&&!G.path.startsWith(`${U.entry.path}/`)}function v(U,G){return U.parent===e.treePath&&G.path!==U.entry.path}function T(U,G){const V=_i();V!==null&&(!p(V,U)&&!v(V,U)||(G.preventDefault(),G.dataTransfer&&(G.dataTransfer.dropEffect="move"),Wc(U.path)))}function _(U,G){G.preventDefault();const V=_i();if(Ms(),V===null)return;if(p(V,U)){e.onmove(V.entry.path,V.entry.kind,U.path);return}if(!v(V,U))return;const ee=u(s).map(b=>b.slug),y=ee.indexOf(V.entry.slug),j=ee.indexOf(U.slug);y<0||j<0||d(mf(ee,y,j))}var E=RR();let O;var C=N(E);{var H=U=>{var G=wR();F(U,G)},M=U=>{var G=IR();F(U,G)},J=U=>{var G=Kn(),V=et(G);wt(V,17,()=>u(s),ee=>ee.path,(ee,y)=>{var j=Kn(),b=et(j);{var R=D=>{var W=OR(),Y=N(W);let B;var z=N(Y),K=N(z);ff(K,{size:16,"aria-hidden":"true"});var te=I(z,2),fe=N(te);{var Ee=Be=>{C6(Be,{size:16,"aria-hidden":"true"})},ge=_e(()=>di(u(y).path)),Le=Be=>{I6(Be,{size:16,"aria-hidden":"true"})};ce(fe,Be=>{u(ge)?Be(Ee):Be(Le,-1)})}var de=I(te,2);let me;var Ie=N(de),se=N(Ie),he=I(de,2),Ae=N(he),Ce=N(Ae);Ph(Ce,{size:16,"aria-hidden":"true"});var Me=I(Y,2);{var ke=Be=>{var It=LR(),Dt=N(It);{var Lt=qt=>{var Pt=CR();F(qt,Pt)},ft=_e(()=>o6(u(y).path)&&Ei(u(y).path)===void 0);ce(Dt,qt=>{u(ft)&&qt(Lt)})}var Vt=I(Dt,2);{let qt=_e(()=>e.level+1);Ub(Vt,{get treePath(){return u(y).path},get inheritedTemplate(){return u(r)},get level(){return u(qt)},get selectedPath(){return e.selectedPath},get activeDir(){return e.activeDir},get onselect(){return e.onselect},get onopenDir(){return e.onopenDir},get onsettingsDir(){return e.onsettingsDir},get onfoldermenu(){return e.onfoldermenu},get onreorder(){return e.onreorder},get onmove(){return e.onmove}})}re(qt=>be(It,"id",qt),[()=>a(u(y).path)]),F(Be,It)},dt=_e(()=>di(u(y).path));ce(Me,Be=>{u(dt)&&Be(ke)})}re((Be,It,Dt,Lt)=>{B=Ke(Y,1,"row svelte-2dodtm",null,B,Be),be(z,"aria-label",`Reorder ${u(y).name}; arrow keys move it`),be(te,"aria-expanded",It),be(te,"aria-controls",Dt),be(te,"aria-label",Lt),me=Ke(de,1,"dir svelte-2dodtm",null,me,{active:u(y).path===e.activeDir}),be(de,"aria-current",u(y).path===e.activeDir),be(de,"title",`${u(y).name}, open this section's page`),ae(se,u(y).name),be(Ae,"aria-label",`Settings for ${u(y).name}`)},[()=>({active:u(y).path===e.activeDir,"drop-target":Ap()===u(y).path}),()=>di(u(y).path),()=>a(u(y).path),()=>`${di(u(y).path)?"Collapse":"Expand"} ${u(y).name}`]),Ue("dragstart",Y,Be=>h(u(y),Be)),Ue("dragover",Y,Be=>T(u(y),Be)),Ue("dragleave",Y,()=>Wc(null)),Ue("drop",Y,Be=>_(u(y),Be)),Ue("dragend",Y,function(...Be){Ms==null||Ms.apply(this,Be)}),ie("contextmenu",Y,Be=>{Be.preventDefault(),e.onfoldermenu(u(y).path,Be.clientX,Be.clientY)}),ie("keydown",z,Be=>g(Be,u(y))),ie("click",te,()=>vp(u(y).path)),ie("click",de,()=>i(u(y).path)),ie("click",Ae,()=>e.onsettingsDir(u(y).path)),F(D,W)},k=D=>{var W=xR(),Y=N(W);let B;var z=N(Y),K=N(z);ff(K,{size:16,"aria-hidden":"true"});var te=I(z,2);let fe;var Ee=N(te),ge=N(Ee);re((Le,de)=>{B=Ke(Y,1,"row svelte-2dodtm",null,B,Le),be(z,"aria-label",`Reorder ${u(y).title}; arrow keys move it`),fe=Ke(te,1,"item svelte-2dodtm",null,fe,{selected:u(y).path===e.selectedPath,unpublished:!u(y).isPublished}),be(te,"aria-current",u(y).path===e.selectedPath),be(te,"aria-label",de),be(te,"title",u(y).title),ae(ge,u(y).title)},[()=>({"drop-target":Ap()===u(y).path}),()=>l(u(y))]),Ue("dragstart",Y,Le=>h(u(y),Le)),Ue("dragover",Y,Le=>T(u(y),Le)),Ue("dragleave",Y,()=>Wc(null)),Ue("drop",Y,Le=>_(u(y),Le)),Ue("dragend",Y,function(...Le){Ms==null||Ms.apply(this,Le)}),ie("keydown",z,Le=>g(Le,u(y))),ie("click",te,()=>e.onselect(u(y).path,o(u(y)))),F(D,W)};ce(b,D=>{u(y).kind==="dir"?D(R):D(k,-1)})}F(ee,j)}),F(U,G)};ce(C,U=>{u(n)===void 0?U(H):u(s).length===0?U(M,1):U(J,-1)})}re(()=>O=Ke(E,1,"level svelte-2dodtm",null,O,{root:e.level===1})),F(t,E),it()}Tt(["contextmenu","keydown","click"]);var DR=$('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),kR=$('<p class="placeholder pad svelte-whg6dh">Loading migrations…</p>'),PR=$('<p class="placeholder svelte-whg6dh"> </p>'),MR=$('<p class="placeholder svelte-whg6dh"> </p>'),BR=$('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),FR=$('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),UR=$('<span class="home-hint svelte-whg6dh">needs template</span>'),HR=$('<span class="home-hint svelte-whg6dh">draft</span>'),qR=$("<div>Move to top level</div>"),jR=$('<div class="tree-body svelte-whg6dh"><button type="button"><!> <span class="home-label">Home</span> <!></button> <!> <!></div>'),$R=$("<option> </option>"),YR=$('<button type="button" class="ghost svelte-whg6dh">Delete this page</button>'),zR=$(`<div class="work-pad svelte-whg6dh"><div class="broken-item svelte-whg6dh"><h1 class="svelte-whg6dh">This page has no template</h1> <p class="svelte-whg6dh">Pick a template to set up the form, or delete the page. This usually happens when
|
|
137
134
|
an item was created before its template existed (a common state after recovering a
|
|
138
|
-
store with reconcile).</p> <label class="svelte-whg6dh"><span class="svelte-whg6dh">Template</span> <select class="svelte-whg6dh"><option> </option><!></select></label> <!></div></div>`)
|
|
139
|
-
editing. This only happens once.</p></div></div>`),
|
|
135
|
+
store with reconcile).</p> <label class="svelte-whg6dh"><span class="svelte-whg6dh">Template</span> <select class="svelte-whg6dh"><option> </option><!></select></label> <!></div></div>`),WR=$(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">Setting up your starter site…</h1> <p class="svelte-whg6dh">Adding a home page, a template, and a stylesheet so you can get straight to
|
|
136
|
+
editing. This only happens once.</p></div></div>`),GR=$(`<div class="work-pad svelte-whg6dh"><div class="welcome svelte-whg6dh"><h1 class="svelte-whg6dh">nanoesis</h1> <p class="svelte-whg6dh">Pick an item from the tree to edit it. The form is generated from its template,
|
|
140
137
|
the template is the schema. Switch to <strong>Templates</strong> to edit those templates
|
|
141
|
-
and components directly.</p></div></div>`),zR=$('<div class="panes svelte-whg6dh"><aside class="tree svelte-whg6dh" aria-label="Content"><div class="tree-head svelte-whg6dh"><h2 class="tree-title svelte-whg6dh">Content</h2> <div class="tree-head-actions svelte-whg6dh"><button type="button" class="add svelte-whg6dh" title="New folder" aria-label="New folder"><!></button> <button type="button" class="add svelte-whg6dh" title="New content item" aria-label="New content item"><!></button></div></div> <div class="search svelte-whg6dh"><!> <input type="search" role="combobox" placeholder="Search titles…" aria-label="Search content by title" aria-controls="search-results" aria-autocomplete="list" class="svelte-whg6dh"/></div> <!></aside> <!> <main class="work svelte-whg6dh"><!></main></div>'),WR=$('<button type="button" class="menu-backdrop svelte-whg6dh" aria-label="Close menu"></button> <div class="context-menu svelte-whg6dh" role="menu" tabindex="-1"><button type="button" role="menuitem" class="svelte-whg6dh">Add content…</button> <button type="button" role="menuitem" class="svelte-whg6dh">Add folder…</button></div>',1),GR=$('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!> <!>',1);function KR(t,e){it(e,!0);let n=Q(null);Rt(()=>{const L=ff.target;L!==null&&(ff.clear(),(async()=>await vv("Opening this item will close the open file.")&&(Sr.set("content"),await M(L)))())});let r=Q(null),s=Q(""),a=Q(null),i=Q(!1);function o(L){return L==="index"?"":L.endsWith("/index")?L.slice(0,-6):null}const l=Ae(()=>u(r)??(u(n)!==null?o(u(n).path):null)),d=Ae(()=>u(n)!==null&&o(u(n).path)!==null),h=Ae(()=>{var L;return((L=u(n))==null?void 0:L.path)==="index"});let g=Q(""),f=Q(dt([])),p=Q(-1),v=Q(void 0),T;Rt(()=>{const L=u(g);if(clearTimeout(T),L.trim()===""){A(f,[],!0),A(p,-1);return}return T=setTimeout(()=>{tv(L).then(ue=>{L===u(g)&&(A(f,ue,!0),A(p,ue.length>0?0:-1,!0))})},200),()=>clearTimeout(T)});function _(){Im().then(()=>{var L,ue;return(ue=(L=u(v))==null?void 0:L.children[u(p)])==null?void 0:ue.scrollIntoView({block:"nearest"})})}function E(L){if(L.key==="Escape"){A(g,"");return}if(u(f).length!==0){if(L.key==="ArrowDown")L.preventDefault(),A(p,(u(p)+1)%u(f).length),_();else if(L.key==="ArrowUp")L.preventDefault(),A(p,(u(p)-1+u(f).length)%u(f).length),_();else if(L.key==="Enter"){L.preventDefault();const ue=u(f)[u(p)]??u(f)[0];ue!==void 0&&G(ue)}}}Qa(()=>{sc("").catch(_e=>{A(a,_e instanceof Error?_e.message:String(_e),!0)}),de();const L=_e=>{cf.hasDirty&&(_e.preventDefault(),_e.returnValue="")};window.addEventListener("beforeunload",L);const ue=v6({reconcileOnce:async()=>{const _e=await Ke("/api/reconcile",{method:"POST"});return _e.ok?g6(await _e.json().catch(()=>null)):{changed:!1,added:0,removed:0}},onChanged:()=>{o6(),h6()},isVisible:()=>document.visibilityState==="visible"});return ue.start(),()=>{window.removeEventListener("beforeunload",L),ue.stop()}});function O(L){return L.includes("/")?L.slice(0,L.lastIndexOf("/")):""}function C(L){return u(n)!==null&&(u(n).path===L||u(n).path.startsWith(`${L}/`))}async function H(L,ue){try{const _e=await hp(L);A(r,null),A(n,{item:_e,path:L,templateName:ue},!0)}catch(_e){await Un(_e instanceof Error?_e.message:String(_e))}}async function M(L){try{const ue=await hp(L);A(r,null),A(n,{item:ue,path:L,templateName:await SN(L,ue.template)},!0)}catch(ue){await Un(ue instanceof Error?ue.message:String(ue))}}async function J(L){const ue=L===""?"index":`${L}/index`;await YN(ue)?await M(ue):(A(n,null),await de(),A(s,await rf(L),!0),A(r,L,!0))}async function U(L){const ue=u(r);if(ue===null)return;const _e=ue===""?"index":`${ue}/index`,De=await rf(ue);try{await iv(_e,De,L)}catch(Ve){await Un(Ve instanceof Error?Ve.message:String(Ve));return}await Ln(ue),await po(_e),await M(_e)}async function G(L){A(g,""),await po(L.path),await H(L.path,L.template)}async function V(L,ue){try{await KN(L,ue)}catch(_e){await Un(_e instanceof Error?_e.message:String(_e)),await Ln(L)}}async function ee(L,ue,_e){var We;const De=O(L);if(_e===De)return;let Ve;try{Ve=ue==="item"?await QN(L,_e):await ZN(L,_e)}catch(bt){await Un(bt instanceof Error?bt.message:String(bt));return}ue==="item"?await Bu(yr(L),yr(Ve)):await Bu(`${yr(L)}*`,`${yr(Ve)}:splat`),await Ln(De),await Ln(_e),await po(Ve),ue==="item"&&((We=u(n))==null?void 0:We.path)===L?await M(Ve):ue==="dir"&&C(L)&&A(n,null)}async function y(L){L.preventDefault();const ue=_i();Ps(),ue!==null&&ue.parent!==""&&await ee(ue.entry.path,ue.entry.kind,"")}async function j(L){u(n)!==null&&await ee(u(n).path,"item",L)}async function b(L){const ue=u(ut);A(ut,null),ue!==null&&await ee(ue,"dir",L)}async function R(L){if(u(n)===null)return;const{path:ue}=u(n);try{await pp(ue,L)}catch(_e){await Un(_e instanceof Error?_e.message:String(_e));return}await Ln(O(ue)),await M(ue)}const k=Ae(()=>Ei("")!==void 0),D=Ae(()=>{var L;return(((L=Ei(""))==null?void 0:L.entries.length)??-1)===0}),W=Ae(()=>{const L=Ei(""),ue=L==null?void 0:L.entries.find(_e=>_e.kind==="item"&&_e.slug==="index");return(ue==null?void 0:ue.kind)==="item"?ue:void 0}),Y=Ae(()=>{var _e;const L=u(W);return L===void 0?"missing":(L.template??((_e=Ei(""))==null?void 0:_e.defaultTemplate))===void 0?"broken":L.isPublished?"published":"draft"}),B=Ae(()=>{switch(u(Y)){case"missing":return"Home, the site’s front page (/). No page yet — click to create.";case"broken":return"Home page exists but its template is missing — click to fix.";case"draft":return"Home, the site’s front page (/). Draft, not yet published.";case"published":return"Home, the site’s front page (/)."}});let z=Q(!1);async function K(L){if(!(u(n)===null||L==="")){A(z,!0);try{await pp(u(n).path,L),await Ln(O(u(n).path)),await M(u(n).path)}catch(ue){await Un(ue instanceof Error?ue.message:String(ue))}finally{A(z,!1)}}}let te=Q(!1),he=Q(!1);Rt(()=>{!u(he)&&!u(te)&&ht.isAdmin&&u(k)&&u(D)&&(A(he,!0),Ee())});async function Ee(){A(te,!0);try{await PN(),E6(localStorage),await Ln(""),await de(),await M("index")}catch(L){if(L instanceof Error&&/already has content/i.test(L.message))return;await Un(L instanceof Error?L.message:String(L))}finally{A(te,!1)}}let ge=Q(!1),Ce=Q(""),fe=Q(dt([])),ne=Q(dt([]));async function de(){const L=await af("templates");A(fe,L.filter(ue=>ue!==hu&&!kd(ue.split("/").pop()??ue)),!0)}async function me(L){await de(),A(ne,await tf(),!0),A(Ce,L,!0),A(ge,!0)}async function Te(){await me("")}async function Ie(L){A(ge,!1),await Ln(O(L)),await po(L),await M(L)}async function Oe(L){const ue=await ko("New folder name:",{title:"New folder",confirmLabel:"Create"});if(ue===null||ue.trim()==="")return;let _e;try{_e=await zN(L,ue)}catch(De){await Un(De instanceof Error?De.message:String(De));return}await Ln(L),await po(`${_e}/_`)}async function Pe(){const L=u(ut);A(ut,null),L!==null&&await Oe(L)}let Fe=Q(null);function St(L,ue,_e){A(Fe,{x:ue,y:_e,path:L},!0)}function Be(){A(Fe,null)}async function Pt(){var ue;const L=((ue=u(Fe))==null?void 0:ue.path)??"";Be(),await me(L)}async function jt(){var ue;const L=(ue=u(Fe))==null?void 0:ue.path;Be(),L!==void 0&&await Oe(L)}function Ct(L){var _e;const ue=L.getBoundingClientRect();ue.right>window.innerWidth&&(L.style.left=`${window.innerWidth-ue.width-8}px`),ue.bottom>window.innerHeight&&(L.style.top=`${window.innerHeight-ue.height-8}px`),(_e=L.querySelector("button"))==null||_e.focus()}let ut=Q(null);async function Gt(L){await de(),A(ne,await tf(),!0),A(ut,L,!0)}async function Lt(){const L=u(ut);A(ut,null),L!==null&&await Ln(L),u(n)!==null&&await M(u(n).path)}async function pt(){const L=u(ut);A(ut,null),L!==null&&await vt(L)}async function Zt(){const L=u(ut);A(ut,null),L!==null&&await pn(L)}async function pn(L){const ue=ul(L);if(await Ol(`Delete the folder “${ue}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Ll(Ai(L))}catch(De){await Un(De instanceof Error?De.message:String(De));return}C(L)&&A(n,null),await Ln(O(L))}}async function vt(L){const ue=ul(L),_e=await ko("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:ue,confirmLabel:"Change URL"});if(_e===null)return;const De=bs(_e);if(De===""||De===ue)return;const Ve=lp(L,De);try{await za(Ai(L),Ai(Ve))}catch(We){await Un(We instanceof Error?We.message:String(We));return}await Bu(`${yr(L)}*`,`${yr(Ve)}:splat`),C(L)&&A(n,null),await Ln(O(L))}async function wt(){if(u(n)===null)return;const{path:L,item:ue}=u(n);if(await Ol(`Delete “${ue.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Ll(Ys(L))}catch(De){await Un(De instanceof Error?De.message:String(De));return}Ep(localStorage,L),A(n,null),await Ln(O(L))}}async function nt(){if(u(n)===null)return;const L=u(n).path,ue=ul(L),_e=await ko("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:ue,confirmLabel:"Change URL"});if(_e===null)return;const De=bs(_e);if(De===""||De===ue)return;const Ve=lp(L,De);try{await za(Ys(L),Ys(Ve))}catch(We){await Un(We instanceof Error?We.message:String(We));return}Ep(localStorage,L),await Bu(yr(L),yr(Ve)),await Ln(O(L)),await M(Ve)}let Qe=Q(null),Mt=Q(null);Rt(()=>{Sr.mode==="templates"&&u(Qe)===null&&np(()=>import("./TemplatesPane-DjFFkccd.js").then(L=>L.T),__vite__mapDeps([0,1]),import.meta.url).then(L=>{A(Qe,L.default,!0)}),Sr.mode==="migrations"&&u(Mt)===null&&np(()=>import("./MigrationsPane-eijyEoIw.js"),__vite__mapDeps([2,3]),import.meta.url).then(L=>{A(Mt,L.default,!0)})});var Dt=GR(),kn=tt(Dt),Pn=N(kn);AR(Pn,{});var on=I(Pn,2),$t=N(on);{var Mn=L=>{W5(L,{})},br=L=>{var ue=Vn(),_e=tt(ue);{var De=We=>{var bt=Vn(),un=tt(bt);wd(un,()=>u(Qe),(At,er)=>{er(At,{})}),F(We,bt)},Ve=We=>{var bt=OR();F(We,bt)};ce(_e,We=>{u(Qe)?We(De):We(Ve,-1)})}F(L,ue)},In=L=>{var ue=Vn(),_e=tt(ue);{var De=We=>{var bt=Vn(),un=tt(bt);wd(un,()=>u(Mt),(At,er)=>{er(At,{})}),F(We,bt)},Ve=We=>{var bt=xR();F(We,bt)};ce(_e,We=>{u(Mt)?We(De):We(Ve,-1)})}F(L,ue)},Hr=L=>{var ue=zR(),_e=N(ue),De=N(_e),Ve=I(N(De),2),We=N(Ve),bt=N(We);x6(bt,{size:18,"aria-hidden":"true"});var un=I(We,2),At=N(un);S6(At,{size:18,"aria-hidden":"true"});var er=I(De,2),Ls=N(er);Av(Ls,{class:"search-icon",size:16,"aria-hidden":"true"});var qr=I(Ls,2),ua=I(er,2);{var la=we=>{var Se=RR(),He=N(Se);se(()=>ae(He,`Couldn’t load content: ${u(a)??""}`)),F(we,Se)},Kt=we=>{var Se=Vn(),He=tt(Se);{var mt=qt=>{var Jt=DR(),mn=N(Jt);se(en=>ae(mn,`No matches for “${en??""}”.`),[()=>u(g).trim()]),F(qt,Jt)},Ht=qt=>{var Jt=PR();Nt(Jt,23,()=>u(f),mn=>mn.path,(mn,en,tr)=>{var Bt=kR();let tn;var Tt=N(Bt),Ft=N(Tt),nr=I(Tt,2),rr=N(nr);se(()=>{be(Bt,"id",`search-option-${u(tr)}`),tn=Ge(Bt,1,"result svelte-whg6dh",null,tn,{active:u(tr)===u(p),unpublished:!u(en).isPublished}),be(Bt,"aria-selected",u(tr)===u(p)),be(Bt,"aria-label",u(en).isPublished?void 0:`${u(en).title}, not published`),ae(Ft,u(en).title),ae(rr,u(en).path)}),ie("click",Bt,()=>G(u(en))),Ue("mouseenter",Bt,()=>A(p,u(tr),!0)),F(mn,Bt)}),hn(Jt,mn=>A(v,mn),()=>u(v)),F(qt,Jt)};ce(He,qt=>{u(f).length===0?qt(mt):qt(Ht,-1)})}F(we,Se)},ca=Ae(()=>u(g).trim()!==""),da=we=>{var Se=UR(),He=N(Se);let mt;var Ht=N(He);C6(Ht,{size:16,"aria-hidden":"true"});var qt=I(Ht,4);{var Jt=Tt=>{var Ft=MR();F(Tt,Ft)},mn=Tt=>{var Ft=BR();F(Tt,Ft)};ce(qt,Tt=>{u(Y)==="broken"?Tt(Jt):u(Y)==="draft"&&Tt(mn,1)})}var en=I(He,2);{let Tt=Ae(()=>{var Ft;return((Ft=u(n))==null?void 0:Ft.path)??null});Ub(en,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return u(Tt)},get activeDir(){return u(l)},onselect:H,onopenDir:J,onsettingsDir:Gt,onfoldermenu:St,onreorder:V,onmove:ee})}var tr=I(en,2);{var Bt=Tt=>{var Ft=FR();let nr;se(rr=>nr=Ge(Ft,1,"root-drop svelte-whg6dh",null,nr,rr),[()=>({over:_i()!==null&&u(i)})]),Ue("dragover",Ft,rr=>{rr.preventDefault(),A(i,!0)}),Ue("dragleave",Ft,()=>A(i,!1)),Ue("drop",Ft,rr=>{A(i,!1),y(rr)}),F(Tt,Ft)},tn=Ae(()=>{var Tt;return _i()!==null&&((Tt=_i())==null?void 0:Tt.parent)!==""});ce(tr,Tt=>{u(tn)&&Tt(Bt)})}se(()=>{mt=Ge(He,1,"home-row svelte-whg6dh",null,mt,{active:u(l)==="",unpublished:u(Y)==="draft"||u(Y)==="broken",broken:u(Y)==="broken"}),be(He,"aria-current",u(l)===""),be(He,"title",u(B))}),ie("click",He,()=>J("")),F(we,Se)};ce(ua,we=>{u(a)?we(la):u(ca)?we(Kt,1):we(da,-1)})}var Os=I(_e,2);rx(Os,{});var fa=I(Os,2),ha=N(fa);{var ln=we=>{var Se=Vn(),He=tt(Se);y_(He,()=>`${u(n).path}\0${u(n).templateName}`,mt=>{{let Ht=Ae(()=>u(d)?void 0:nt),qt=Ae(()=>u(h)?void 0:wt);o5(mt,{get item(){return u(n).item},get templateName(){return u(n).templateName},get path(){return u(n).path},get templates(){return u(fe)},get onrename(){return u(Ht)},get ondelete(){return u(qt)},onchangetemplate:R,onmove:j,onsaved:(Jt,mn,en)=>{u6(Jt,mn),l6(Jt,en)}})}}),F(we,Se)},xs=we=>{var Se=jR(),He=N(Se),mt=I(N(He),4),Ht=I(N(mt),2),qt=N(Ht),Jt=N(qt);qt.value=qt.__value="";var mn=I(qt);Nt(mn,16,()=>u(fe),Bt=>Bt,(Bt,tn)=>{var Tt=HR(),Ft=N(Tt),nr={};se(()=>{ae(Ft,tn),nr!==(nr=tn)&&(Tt.value=(Tt.__value=tn)??"")}),F(Bt,Tt)});var en=I(mt,2);{var tr=Bt=>{var tn=qR();se(()=>tn.disabled=u(z)),ie("click",tn,wt),F(Bt,tn)};ce(en,Bt=>{u(h)||Bt(tr)})}se(()=>{Ht.disabled=u(z)||u(fe).length===0,ae(Jt,u(fe).length===0?"No templates exist yet":"Choose…")}),ie("change",Ht,Bt=>K(Bt.currentTarget.value)),F(we,Se)},pa=we=>{V5(we,{get folderPath(){return u(r)},get name(){return u(s)},get templates(){return u(fe)},oncreate:U})},ma=we=>{var Se=$R();F(we,Se)},ga=we=>{var Se=YR();F(we,Se)};ce(ha,we=>{u(n)&&u(n).templateName?we(ln):u(n)?we(xs,1):u(r)!==null?we(pa,2):ht.isAdmin&&u(k)&&u(D)?we(ma,3):we(ga,-1)})}se(()=>{be(qr,"aria-expanded",u(f).length>0),be(qr,"aria-activedescendant",u(p)>=0?`search-option-${u(p)}`:void 0)}),ie("click",We,()=>Oe("")),ie("click",un,Te),ie("keydown",qr,E),yt(qr,()=>u(g),we=>A(g,we)),F(L,ue)};ce($t,L=>{Ks.active?L(Mn):Sr.mode==="templates"?L(br,1):Sr.mode==="migrations"?L(In,2):L(Hr,-1)})}var os=I(on,2);f5(os,{});var Jn=I(kn,2);{var us=L=>{S5(L,{get folders(){return u(ne)},get templates(){return u(fe)},get initialFolder(){return u(Ce)},oncreated:Ie,oncancel:()=>A(ge,!1)})};ce(Jn,L=>{u(ge)&&L(us)})}var Ne=I(Jn,2);{var Ye=L=>{var ue=WR(),_e=tt(ue),De=I(_e,2),Ve=N(De),We=I(Ve,2);L_(De,bt=>Ct==null?void 0:Ct(bt)),se(()=>Wl(De,`left: ${u(Fe).x}px; top: ${u(Fe).y}px`)),ie("click",_e,Be),ie("contextmenu",_e,bt=>{bt.preventDefault(),Be()}),ie("keydown",De,bt=>{bt.key==="Escape"&&Be()}),ie("click",Ve,Pt),ie("click",We,jt),F(L,ue)};ce(Ne,L=>{u(Fe)!==null&&L(Ye)})}var Xe=I(Ne,2);{var Je=L=>{_5(L,{get folderPath(){return u(ut)},get templates(){return u(fe)},get folders(){return u(ne)},onsaved:Lt,oncancel:()=>A(ut,null),onnewsubfolder:Pe,onrenamefolder:pt,ondeletefolder:Zt,onmove:b})};ce(Xe,L=>{u(ut)!==null&&L(Je)})}F(t,Dt),ot()}_t(["click","keydown","change","contextmenu"]);var VR=$('<h2 class="svelte-z86ibt"> </h2>'),XR=$('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <input class="svelte-z86ibt"/></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),QR=$('<h2 class="svelte-z86ibt"> </h2>'),ZR=$("<option> </option>"),JR=$('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <select class="svelte-z86ibt"><option disabled=""> </option><!></select></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),eD=$('<h2 class="svelte-z86ibt"> </h2>'),tD=$('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button></div>',1),nD=$('<h2 class="svelte-z86ibt"> </h2>'),rD=$('<!> <p class="message svelte-z86ibt"> </p> <div class="actions decide-actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button> <button type="button" class="primary svelte-z86ibt"> </button></div>',1),sD=$('<h2 class="svelte-z86ibt"> </h2>'),aD=$('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),iD=$('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function oD(t,e){it(e,!0);let n,r=Q(""),s=Q("");Rt(()=>{const p=Fu.pending;p?(p.kind==="prompt"&&A(r,p.options.value??"",!0),p.kind==="select"&&A(s,""),n.open||n.showModal()):n!=null&&n.open&&n.close()});function a(){const p=Fu.pending;(p==null?void 0:p.kind)==="confirm"?jc(!1):(p==null?void 0:p.kind)==="prompt"?$c(null):(p==null?void 0:p.kind)==="select"?Yc(null):(p==null?void 0:p.kind)==="decide"?Uu("cancel"):vp()}function i(p){p.preventDefault(),a()}function o(p){p.target===n&&a()}function l(p){p.preventDefault(),$c(u(r))}function d(p){p.preventDefault(),u(s)!==""&&Yc(u(s))}var h=iD(),g=N(h);{var f=p=>{const v=Ae(()=>Fu.pending);var T=Vn(),_=tt(T);{var E=J=>{var U=XR(),G=N(U);{var V=Y=>{var B=VR(),z=N(B);se(()=>ae(z,u(v).options.title)),F(Y,B)};ce(G,Y=>{u(v).options.title&&Y(V)})}var ee=I(G,2),y=N(ee),j=N(y),b=I(y,2);ja(b,!0);var R=I(ee,2),k=N(R),D=I(k,2),W=N(D);se(()=>{ae(j,u(v).message),be(b,"placeholder",u(v).options.placeholder??""),ae(W,u(v).options.confirmLabel??"OK")}),Ue("submit",U,l),yt(b,()=>u(r),Y=>A(r,Y)),ie("click",k,()=>$c(null)),F(J,U)},O=J=>{var U=JR(),G=N(U);{var V=K=>{var te=QR(),he=N(te);se(()=>ae(he,u(v).options.title)),F(K,te)};ce(G,K=>{u(v).options.title&&K(V)})}var ee=I(G,2),y=N(ee),j=N(y),b=I(y,2);ja(b,!0);var R=N(b),k=N(R);R.value=R.__value="";var D=I(R);Nt(D,17,()=>u(v).choices,K=>K.value,(K,te)=>{var he=ZR(),Ee=N(he),ge={};se(()=>{ae(Ee,u(te).label),ge!==(ge=u(te).value)&&(he.value=(he.__value=u(te).value)??"")}),F(K,he)});var W=I(ee,2),Y=N(W),B=I(Y,2),z=N(B);se(()=>{ae(j,u(v).message),ae(k,u(v).options.placeholder??"Choose…"),B.disabled=u(s)==="",ae(z,u(v).options.confirmLabel??"OK")}),Ue("submit",U,d),$a(b,()=>u(s),K=>A(s,K)),ie("click",Y,()=>Yc(null)),F(J,U)},C=J=>{var U=tD(),G=tt(U);{var V=Y=>{var B=eD(),z=N(B);se(()=>ae(z,u(v).options.title)),F(Y,B)};ce(G,Y=>{u(v).options.title&&Y(V)})}var ee=I(G,2),y=N(ee),j=I(ee,2),b=N(j),R=N(b),k=I(b,2);let D;var W=N(k);se(()=>{ae(y,u(v).message),ae(R,u(v).options.cancelLabel??"Cancel"),D=Ge(k,1,"primary svelte-z86ibt",null,D,{danger:u(v).options.danger}),ae(W,u(v).options.confirmLabel??"Confirm")}),ie("click",b,()=>jc(!1)),ie("click",k,()=>jc(!0)),F(J,U)},H=J=>{var U=rD(),G=tt(U);{var V=z=>{var K=nD(),te=N(K);se(()=>ae(te,u(v).options.title)),F(z,K)};ce(G,z=>{u(v).options.title&&z(V)})}var ee=I(G,2),y=N(ee),j=I(ee,2),b=N(j),R=N(b),k=I(b,2);let D;var W=N(k),Y=I(k,2),B=N(Y);se(()=>{ae(y,u(v).message),ae(R,u(v).options.cancelLabel),D=Ge(k,1,"ghost svelte-z86ibt",null,D,{"danger-ghost":u(v).options.secondaryDanger}),ae(W,u(v).options.secondaryLabel),ae(B,u(v).options.primaryLabel)}),ie("click",b,()=>Uu("cancel")),ie("click",k,()=>Uu("secondary")),ie("click",Y,()=>Uu("primary")),F(J,U)},M=J=>{var U=aD(),G=tt(U);{var V=R=>{var k=sD(),D=N(k);se(()=>ae(D,u(v).options.title)),F(R,k)};ce(G,R=>{u(v).options.title&&R(V)})}var ee=I(G,2),y=N(ee),j=I(ee,2),b=N(j);se(()=>ae(y,u(v).message)),ie("click",b,()=>vp()),F(J,U)};ce(_,J=>{u(v).kind==="prompt"?J(E):u(v).kind==="select"?J(O,1):u(v).kind==="confirm"?J(C,2):u(v).kind==="decide"?J(H,3):J(M,-1)})}F(p,T)};ce(g,p=>{Fu.pending&&p(f)})}hn(h,p=>n=p,()=>n),Ue("cancel",h,i),ie("click",h,o),F(t,h),ot()}_t(["click"]);var uD=$('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),lD=$('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),cD=$('<p class="hint svelte-o6yxmi">No matching pages.</p>'),dD=$('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),fD=$('<div class="search svelte-o6yxmi"><!> <input type="search" role="combobox" placeholder="Search pages by title…" aria-label="Search pages by title" aria-controls="link-results" aria-autocomplete="list" class="svelte-o6yxmi"/></div> <div class="results-area svelte-o6yxmi"><!></div>',1),hD=$('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),pD=$('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),mD=$('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),gD=$('<h2 class="svelte-o6yxmi">Link</h2> <div class="tabs svelte-o6yxmi" role="tablist" aria-label="Link type"><button type="button" role="tab">Page</button> <button type="button" role="tab">External URL</button></div> <div class="body svelte-o6yxmi"><!></div> <div class="actions svelte-o6yxmi"><button type="button" class="ghost svelte-o6yxmi">Cancel</button> <!> <!></div>',1),vD=$('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function bD(t,e){it(e,!0);let n=Q(void 0),r=Q("page"),s=Q(""),a=Q(dt([])),i=Q(-1),o=Q(""),l=Q(void 0);const d=Ae(()=>wS.pending);Rt(()=>{var C,H;if(u(d)===null){(C=u(n))==null||C.close();return}const O=u(d).current;A(r,O===""||Go(O)?"page":"url",!0),A(s,""),A(a,[],!0),A(i,-1),A(o,Go(O)?"":O,!0),(H=u(n))==null||H.showModal()});let h;Rt(()=>{const O=u(s);if(clearTimeout(h),u(r)!=="page"||O.trim()===""){A(a,[],!0),A(i,-1);return}return h=setTimeout(()=>{tv(O).then(C=>{O===u(s)&&(A(a,C,!0),A(i,C.length>0?0:-1,!0))})},200),()=>clearTimeout(h)});function g(O){li(IS(O.path))}function f(){const O=u(o).trim();O!==""&&li(O)}function p(){var O,C;(C=(O=u(l))==null?void 0:O.children[u(i)])==null||C.scrollIntoView({block:"nearest"})}function v(O){if(u(a).length!==0){if(O.key==="ArrowDown")O.preventDefault(),A(i,(u(i)+1)%u(a).length),p();else if(O.key==="ArrowUp")O.preventDefault(),A(i,(u(i)-1+u(a).length)%u(a).length),p();else if(O.key==="Enter"){O.preventDefault();const C=u(a)[u(i)]??u(a)[0];C!==void 0&&g(C)}}}var T=vD(),_=N(T);{var E=O=>{var C=gD(),H=I(tt(C),2),M=N(H);let J;var U=I(M,2);let G;var V=I(H,2),ee=N(V);{var y=B=>{var z=fD(),K=tt(z),te=N(K);Av(te,{class:"search-icon",size:16,"aria-hidden":"true"});var he=I(te,2);ja(he,!0);var Ee=I(K,2),ge=N(Ee);{var Ce=me=>{var Te=lD();Nt(Te,23,()=>u(a),Ie=>Ie.path,(Ie,Oe,Pe)=>{var Fe=uD();let St;var Be=N(Fe),Pt=N(Be),jt=I(Be,2),Ct=N(jt);se(()=>{be(Fe,"id",`link-option-${u(Pe)}`),St=Ge(Fe,1,"result svelte-o6yxmi",null,St,{active:u(Pe)===u(i)}),be(Fe,"aria-selected",u(Pe)===u(i)),ae(Pt,u(Oe).title),ae(Ct,u(Oe).path)}),ie("click",Fe,()=>g(u(Oe))),Ue("mouseenter",Fe,()=>A(i,u(Pe),!0)),F(Ie,Fe)}),hn(Te,Ie=>A(l,Ie),()=>u(l)),F(me,Te)},fe=me=>{var Te=cD();F(me,Te)},ne=Ae(()=>u(s).trim()!==""),de=me=>{var Te=dD();F(me,Te)};ce(ge,me=>{u(a).length>0?me(Ce):u(ne)?me(fe,1):me(de,-1)})}se(()=>{be(he,"aria-expanded",u(a).length>0),be(he,"aria-activedescendant",u(i)>=0?`link-option-${u(i)}`:void 0)}),ie("keydown",he,v),yt(he,()=>u(s),me=>A(s,me)),F(B,z)},j=B=>{var z=hD(),K=I(N(z),2);ie("keydown",K,te=>{te.key==="Enter"&&(te.preventDefault(),f())}),yt(K,()=>u(o),te=>A(o,te)),F(B,z)};ce(ee,B=>{u(r)==="page"?B(y):B(j,-1)})}var b=I(V,2),R=N(b),k=I(R,2);{var D=B=>{var z=pD();ie("click",z,()=>li("")),F(B,z)};ce(k,B=>{u(d).current!==""&&B(D)})}var W=I(k,2);{var Y=B=>{var z=mD();se(K=>z.disabled=K,[()=>u(o).trim()===""]),ie("click",z,f),F(B,z)};ce(W,B=>{u(r)==="url"&&B(Y)})}se(()=>{J=Ge(M,1,"tab svelte-o6yxmi",null,J,{active:u(r)==="page"}),be(M,"aria-selected",u(r)==="page"),G=Ge(U,1,"tab svelte-o6yxmi",null,G,{active:u(r)==="url"}),be(U,"aria-selected",u(r)==="url")}),ie("click",M,()=>A(r,"page")),ie("click",U,()=>A(r,"url")),ie("click",R,()=>li(null)),F(O,C)};ce(_,O=>{u(d)!==null&&O(E)})}hn(T,O=>A(n,O),()=>u(n)),Ue("close",T,()=>li(null)),Ue("cancel",T,()=>li(null)),F(t,T),ot()}_t(["click","keydown"]);var ED=$('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),_D=$(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
|
|
142
|
-
password.</p>`),
|
|
138
|
+
and components directly.</p></div></div>`),KR=$('<div class="panes svelte-whg6dh"><aside class="tree svelte-whg6dh" aria-label="Content"><div class="tree-head svelte-whg6dh"><h2 class="tree-title svelte-whg6dh">Content</h2> <div class="tree-head-actions svelte-whg6dh"><button type="button" class="add svelte-whg6dh" title="New folder" aria-label="New folder"><!></button> <button type="button" class="add svelte-whg6dh" title="New content item" aria-label="New content item"><!></button></div></div> <div class="search svelte-whg6dh"><!> <input type="search" role="combobox" placeholder="Search titles…" aria-label="Search content by title" aria-controls="search-results" aria-autocomplete="list" class="svelte-whg6dh"/></div> <!></aside> <!> <main class="work svelte-whg6dh"><!></main></div>'),VR=$('<button type="button" class="menu-backdrop svelte-whg6dh" aria-label="Close menu"></button> <div class="context-menu svelte-whg6dh" role="menu" tabindex="-1"><button type="button" role="menuitem" class="svelte-whg6dh">Add content…</button> <button type="button" role="menuitem" class="svelte-whg6dh">Add folder…</button></div>',1),XR=$('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!> <!>',1);function QR(t,e){at(e,!0);let n=Q(null);Rt(()=>{const L=hf.target;L!==null&&(hf.clear(),(async()=>await vv("Opening this item will close the open file.")&&(Sr.set("content"),await M(L)))())});let r=Q(null),s=Q(""),a=Q(null),i=Q(!1);function o(L){return L==="index"?"":L.endsWith("/index")?L.slice(0,-6):null}const l=_e(()=>u(r)??(u(n)!==null?o(u(n).path):null)),d=_e(()=>u(n)!==null&&o(u(n).path)!==null),f=_e(()=>{var L;return((L=u(n))==null?void 0:L.path)==="index"});let g=Q(""),h=Q(ct([])),p=Q(-1),v=Q(void 0),T;Rt(()=>{const L=u(g);if(clearTimeout(T),L.trim()===""){A(h,[],!0),A(p,-1);return}return T=setTimeout(()=>{tv(L).then(ue=>{L===u(g)&&(A(h,ue,!0),A(p,ue.length>0?0:-1,!0))})},200),()=>clearTimeout(T)});function _(){Im().then(()=>{var L,ue;return(ue=(L=u(v))==null?void 0:L.children[u(p)])==null?void 0:ue.scrollIntoView({block:"nearest"})})}function E(L){if(L.key==="Escape"){A(g,"");return}if(u(h).length!==0){if(L.key==="ArrowDown")L.preventDefault(),A(p,(u(p)+1)%u(h).length),_();else if(L.key==="ArrowUp")L.preventDefault(),A(p,(u(p)-1+u(h).length)%u(h).length),_();else if(L.key==="Enter"){L.preventDefault();const ue=u(h)[u(p)]??u(h)[0];ue!==void 0&&G(ue)}}}Qa(()=>{ac("").catch(Te=>{A(a,Te instanceof Error?Te.message:String(Te),!0)}),Ie();const L=Te=>{df.hasDirty&&(Te.preventDefault(),Te.returnValue="")};window.addEventListener("beforeunload",L);const ue=b6({reconcileOnce:async()=>{const Te=await We("/api/reconcile",{method:"POST"});return Te.ok?v6(await Te.json().catch(()=>null)):{changed:!1,added:0,removed:0}},onChanged:()=>{u6(),p6()},isVisible:()=>document.visibilityState==="visible"});return ue.start(),()=>{window.removeEventListener("beforeunload",L),ue.stop()}});function O(L){return L.includes("/")?L.slice(0,L.lastIndexOf("/")):""}function C(L){return u(n)!==null&&(u(n).path===L||u(n).path.startsWith(`${L}/`))}async function H(L,ue){try{const Te=await pp(L);A(r,null),A(n,{item:Te,path:L,templateName:ue},!0)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te))}}async function M(L){try{const ue=await pp(L);A(r,null),A(n,{item:ue,path:L,templateName:await SN(L,ue.template)},!0)}catch(ue){await Fn(ue instanceof Error?ue.message:String(ue))}}async function J(L){const ue=L===""?"index":`${L}/index`;await zN(ue)?await M(ue):(A(n,null),await Ie(),A(s,await sf(L),!0),A(r,L,!0))}async function U(L){const ue=u(r);if(ue===null)return;const Te=ue===""?"index":`${ue}/index`,De=await sf(ue);try{await iv(Te,De,L)}catch(Ve){await Fn(Ve instanceof Error?Ve.message:String(Ve));return}await xn(ue),await po(Te),await M(Te)}async function G(L){A(g,""),await po(L.path),await H(L.path,L.template)}async function V(L,ue){try{await VN(L,ue)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te)),await xn(L)}}async function ee(L,ue,Te){var Ge;const De=O(L);if(Te===De)return;let Ve;try{Ve=ue==="item"?await ZN(L,Te):await JN(L,Te)}catch(Et){await Fn(Et instanceof Error?Et.message:String(Et));return}ue==="item"?await Bu(yr(L),yr(Ve)):await Bu(`${yr(L)}*`,`${yr(Ve)}:splat`),await xn(De),await xn(Te),await po(Ve),ue==="item"&&((Ge=u(n))==null?void 0:Ge.path)===L?await M(Ve):ue==="dir"&&C(L)&&A(n,null)}async function y(L){L.preventDefault();const ue=_i();Ms(),ue!==null&&ue.parent!==""&&await ee(ue.entry.path,ue.entry.kind,"")}async function j(L){u(n)!==null&&await ee(u(n).path,"item",L)}async function b(L){const ue=u(ft);A(ft,null),ue!==null&&await ee(ue,"dir",L)}async function R(L){if(u(n)===null)return;const{path:ue}=u(n);try{await mp(ue,L)}catch(Te){await Fn(Te instanceof Error?Te.message:String(Te));return}await xn(O(ue)),await M(ue)}const k=_e(()=>Ei("")!==void 0),D=_e(()=>{var L;return(((L=Ei(""))==null?void 0:L.entries.length)??-1)===0}),W=_e(()=>{const L=Ei(""),ue=L==null?void 0:L.entries.find(Te=>Te.kind==="item"&&Te.slug==="index");return(ue==null?void 0:ue.kind)==="item"?ue:void 0}),Y=_e(()=>{var Te;const L=u(W);return L===void 0?"missing":(L.template??((Te=Ei(""))==null?void 0:Te.defaultTemplate))===void 0?"broken":L.isPublished?"published":"draft"}),B=_e(()=>{switch(u(Y)){case"missing":return"Home, the site’s front page (/). No page yet — click to create.";case"broken":return"Home page exists but its template is missing — click to fix.";case"draft":return"Home, the site’s front page (/). Draft, not yet published.";case"published":return"Home, the site’s front page (/)."}});let z=Q(!1);async function K(L){if(!(u(n)===null||L==="")){A(z,!0);try{await mp(u(n).path,L),await xn(O(u(n).path)),await M(u(n).path)}catch(ue){await Fn(ue instanceof Error?ue.message:String(ue))}finally{A(z,!1)}}}let te=Q(!1),fe=Q(!1);Rt(()=>{!u(fe)&&!u(te)&&pt.isAdmin&&u(k)&&u(D)&&(A(fe,!0),Ee())});async function Ee(){A(te,!0);try{await MN(),_6(localStorage),await xn(""),await Ie(),await M("index")}catch(L){if(L instanceof Error&&/already has content/i.test(L.message))return;await Fn(L instanceof Error?L.message:String(L))}finally{A(te,!1)}}let ge=Q(!1),Le=Q(""),de=Q(ct([])),me=Q(ct([]));async function Ie(){const L=await of("templates");A(de,L.filter(ue=>ue!==hu&&!Pd(ue.split("/").pop()??ue)),!0)}async function se(L){await Ie(),A(me,await nf(),!0),A(Le,L,!0),A(ge,!0)}async function he(){await se("")}async function Ae(L){A(ge,!1),await xn(O(L)),await po(L),await M(L)}async function Ce(L){const ue=await ko("New folder name:",{title:"New folder",confirmLabel:"Create"});if(ue===null||ue.trim()==="")return;let Te;try{Te=await WN(L,ue)}catch(De){await Fn(De instanceof Error?De.message:String(De));return}await xn(L),await po(`${Te}/_`)}async function Me(){const L=u(ft);A(ft,null),L!==null&&await Ce(L)}let ke=Q(null);function dt(L,ue,Te){A(ke,{x:ue,y:Te,path:L},!0)}function Be(){A(ke,null)}async function It(){var ue;const L=((ue=u(ke))==null?void 0:ue.path)??"";Be(),await se(L)}async function Dt(){var ue;const L=(ue=u(ke))==null?void 0:ue.path;Be(),L!==void 0&&await Ce(L)}function Lt(L){var Te;const ue=L.getBoundingClientRect();ue.right>window.innerWidth&&(L.style.left=`${window.innerWidth-ue.width-8}px`),ue.bottom>window.innerHeight&&(L.style.top=`${window.innerHeight-ue.height-8}px`),(Te=L.querySelector("button"))==null||Te.focus()}let ft=Q(null);async function Vt(L){await Ie(),A(me,await nf(),!0),A(ft,L,!0)}async function qt(){const L=u(ft);A(ft,null),L!==null&&await xn(L),u(n)!==null&&await M(u(n).path)}async function Pt(){const L=u(ft);A(ft,null),L!==null&&await mt(L)}async function Gt(){const L=u(ft);A(ft,null),L!==null&&await Mt(L)}async function Mt(L){const ue=ll(L);if(await xl(`Delete the folder “${ue}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Ol(Ai(L))}catch(De){await Fn(De instanceof Error?De.message:String(De));return}C(L)&&A(n,null),await xn(O(L))}}async function mt(L){const ue=ll(L),Te=await ko("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:ue,confirmLabel:"Change URL"});if(Te===null)return;const De=Es(Te);if(De===""||De===ue)return;const Ve=cp(L,De);try{await za(Ai(L),Ai(Ve))}catch(Ge){await Fn(Ge instanceof Error?Ge.message:String(Ge));return}await Bu(`${yr(L)}*`,`${yr(Ve)}:splat`),C(L)&&A(n,null),await xn(O(L))}async function yt(){if(u(n)===null)return;const{path:L,item:ue}=u(n);if(await xl(`Delete “${ue.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await Ol(zs(L))}catch(De){await Fn(De instanceof Error?De.message:String(De));return}_p(localStorage,L),A(n,null),await xn(O(L))}}async function Bt(){if(u(n)===null)return;const L=u(n).path,ue=ll(L),Te=await ko("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:ue,confirmLabel:"Change URL"});if(Te===null)return;const De=Es(Te);if(De===""||De===ue)return;const Ve=cp(L,De);try{await za(zs(L),zs(Ve))}catch(Ge){await Fn(Ge instanceof Error?Ge.message:String(Ge));return}_p(localStorage,L),await Bu(yr(L),yr(Ve)),await xn(O(L)),await M(Ve)}let ot=Q(null),tt=Q(null);Rt(()=>{Sr.mode==="templates"&&u(ot)===null&&rp(()=>import("./TemplatesPane-DHyXai5d.js").then(L=>L.T),__vite__mapDeps([0,1]),import.meta.url).then(L=>{A(ot,L.default,!0)}),Sr.mode==="migrations"&&u(tt)===null&&rp(()=>import("./MigrationsPane-Db55MALu.js"),__vite__mapDeps([2,3]),import.meta.url).then(L=>{A(tt,L.default,!0)})});var bt=XR(),An=et(bt),yn=N(An);SR(yn,{});var ln=I(yn,2),Zn=N(ln);{var Jn=L=>{V5(L,{})},jt=L=>{var ue=Kn(),Te=et(ue);{var De=Ge=>{var Et=Kn(),cn=et(Et);Id(cn,()=>u(ot),(Nt,tr)=>{tr(Nt,{})}),F(Ge,Et)},Ve=Ge=>{var Et=DR();F(Ge,Et)};ce(Te,Ge=>{u(ot)?Ge(De):Ge(Ve,-1)})}F(L,ue)},en=L=>{var ue=Kn(),Te=et(ue);{var De=Ge=>{var Et=Kn(),cn=et(Et);Id(cn,()=>u(tt),(Nt,tr)=>{tr(Nt,{})}),F(Ge,Et)},Ve=Ge=>{var Et=kR();F(Ge,Et)};ce(Te,Ge=>{u(tt)?Ge(De):Ge(Ve,-1)})}F(L,ue)},Hr=L=>{var ue=KR(),Te=N(ue),De=N(Te),Ve=I(N(De),2),Ge=N(Ve),Et=N(Ge);R6(Et,{size:18,"aria-hidden":"true"});var cn=I(Ge,2),Nt=N(cn);w6(Nt,{size:18,"aria-hidden":"true"});var tr=I(De,2),Os=N(tr);Av(Os,{class:"search-icon",size:16,"aria-hidden":"true"});var qr=I(Os,2),ua=I(tr,2);{var la=we=>{var Se=PR(),He=N(Se);re(()=>ae(He,`Couldn’t load content: ${u(a)??""}`)),F(we,Se)},Xt=we=>{var Se=Kn(),He=et(Se);{var gt=Yt=>{var tn=MR(),gn=N(tn);re(nn=>ae(gn,`No matches for “${nn??""}”.`),[()=>u(g).trim()]),F(Yt,tn)},$t=Yt=>{var tn=FR();wt(tn,23,()=>u(h),gn=>gn.path,(gn,nn,nr)=>{var Ft=BR();let rn;var At=N(Ft),Ut=N(At),rr=I(At,2),sr=N(rr);re(()=>{be(Ft,"id",`search-option-${u(nr)}`),rn=Ke(Ft,1,"result svelte-whg6dh",null,rn,{active:u(nr)===u(p),unpublished:!u(nn).isPublished}),be(Ft,"aria-selected",u(nr)===u(p)),be(Ft,"aria-label",u(nn).isPublished?void 0:`${u(nn).title}, not published`),ae(Ut,u(nn).title),ae(sr,u(nn).path)}),ie("click",Ft,()=>G(u(nn))),Ue("mouseenter",Ft,()=>A(p,u(nr),!0)),F(gn,Ft)}),mn(tn,gn=>A(v,gn),()=>u(v)),F(Yt,tn)};ce(He,Yt=>{u(h).length===0?Yt(gt):Yt($t,-1)})}F(we,Se)},ca=_e(()=>u(g).trim()!==""),da=we=>{var Se=jR(),He=N(Se);let gt;var $t=N(He);L6($t,{size:16,"aria-hidden":"true"});var Yt=I($t,4);{var tn=At=>{var Ut=UR();F(At,Ut)},gn=At=>{var Ut=HR();F(At,Ut)};ce(Yt,At=>{u(Y)==="broken"?At(tn):u(Y)==="draft"&&At(gn,1)})}var nn=I(He,2);{let At=_e(()=>{var Ut;return((Ut=u(n))==null?void 0:Ut.path)??null});Ub(nn,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return u(At)},get activeDir(){return u(l)},onselect:H,onopenDir:J,onsettingsDir:Vt,onfoldermenu:dt,onreorder:V,onmove:ee})}var nr=I(nn,2);{var Ft=At=>{var Ut=qR();let rr;re(sr=>rr=Ke(Ut,1,"root-drop svelte-whg6dh",null,rr,sr),[()=>({over:_i()!==null&&u(i)})]),Ue("dragover",Ut,sr=>{sr.preventDefault(),A(i,!0)}),Ue("dragleave",Ut,()=>A(i,!1)),Ue("drop",Ut,sr=>{A(i,!1),y(sr)}),F(At,Ut)},rn=_e(()=>{var At;return _i()!==null&&((At=_i())==null?void 0:At.parent)!==""});ce(nr,At=>{u(rn)&&At(Ft)})}re(()=>{gt=Ke(He,1,"home-row svelte-whg6dh",null,gt,{active:u(l)==="",unpublished:u(Y)==="draft"||u(Y)==="broken",broken:u(Y)==="broken"}),be(He,"aria-current",u(l)===""),be(He,"title",u(B))}),ie("click",He,()=>J("")),F(we,Se)};ce(ua,we=>{u(a)?we(la):u(ca)?we(Xt,1):we(da,-1)})}var xs=I(Te,2);ix(xs,{});var fa=I(xs,2),ha=N(fa);{var dn=we=>{var Se=Kn(),He=et(Se);y_(He,()=>`${u(n).path}\0${u(n).templateName}`,gt=>{{let $t=_e(()=>u(d)?void 0:Bt),Yt=_e(()=>u(f)?void 0:yt);u5(gt,{get item(){return u(n).item},get templateName(){return u(n).templateName},get path(){return u(n).path},get templates(){return u(de)},get onrename(){return u($t)},get ondelete(){return u(Yt)},onchangetemplate:R,onmove:j,onsaved:(tn,gn,nn)=>{l6(tn,gn),c6(tn,nn)}})}}),F(we,Se)},Rs=we=>{var Se=zR(),He=N(Se),gt=I(N(He),4),$t=I(N(gt),2),Yt=N($t),tn=N(Yt);Yt.value=Yt.__value="";var gn=I(Yt);wt(gn,16,()=>u(de),Ft=>Ft,(Ft,rn)=>{var At=$R(),Ut=N(At),rr={};re(()=>{ae(Ut,rn),rr!==(rr=rn)&&(At.value=(At.__value=rn)??"")}),F(Ft,At)});var nn=I(gt,2);{var nr=Ft=>{var rn=YR();re(()=>rn.disabled=u(z)),ie("click",rn,yt),F(Ft,rn)};ce(nn,Ft=>{u(f)||Ft(nr)})}re(()=>{$t.disabled=u(z)||u(de).length===0,ae(tn,u(de).length===0?"No templates exist yet":"Choose…")}),ie("change",$t,Ft=>K(Ft.currentTarget.value)),F(we,Se)},pa=we=>{Z5(we,{get folderPath(){return u(r)},get name(){return u(s)},get templates(){return u(de)},oncreate:U})},ma=we=>{var Se=WR();F(we,Se)},ga=we=>{var Se=GR();F(we,Se)};ce(ha,we=>{u(n)&&u(n).templateName?we(dn):u(n)?we(Rs,1):u(r)!==null?we(pa,2):pt.isAdmin&&u(k)&&u(D)?we(ma,3):we(ga,-1)})}re(()=>{be(qr,"aria-expanded",u(h).length>0),be(qr,"aria-activedescendant",u(p)>=0?`search-option-${u(p)}`:void 0)}),ie("click",Ge,()=>Ce("")),ie("click",cn,he),ie("keydown",qr,E),St(qr,()=>u(g),we=>A(g,we)),F(L,ue)};ce(Zn,L=>{bs.active?L(Jn):Sr.mode==="templates"?L(jt,1):Sr.mode==="migrations"?L(en,2):L(Hr,-1)})}var os=I(ln,2);h5(os,{});var er=I(An,2);{var us=L=>{w5(L,{get folders(){return u(me)},get templates(){return u(de)},get initialFolder(){return u(Le)},oncreated:Ae,oncancel:()=>A(ge,!1)})};ce(er,L=>{u(ge)&&L(us)})}var Ne=I(er,2);{var Ye=L=>{var ue=VR(),Te=et(ue),De=I(Te,2),Ve=N(De),Ge=I(Ve,2);L_(De,Et=>Lt==null?void 0:Lt(Et)),re(()=>Gl(De,`left: ${u(ke).x}px; top: ${u(ke).y}px`)),ie("click",Te,Be),ie("contextmenu",Te,Et=>{Et.preventDefault(),Be()}),ie("keydown",De,Et=>{Et.key==="Escape"&&Be()}),ie("click",Ve,It),ie("click",Ge,Dt),F(L,ue)};ce(Ne,L=>{u(ke)!==null&&L(Ye)})}var Xe=I(Ne,2);{var Ze=L=>{T5(L,{get folderPath(){return u(ft)},get templates(){return u(de)},get folders(){return u(me)},onsaved:qt,oncancel:()=>A(ft,null),onnewsubfolder:Me,onrenamefolder:Pt,ondeletefolder:Gt,onmove:b})};ce(Xe,L=>{u(ft)!==null&&L(Ze)})}F(t,bt),it()}Tt(["click","keydown","change","contextmenu"]);var ZR=$('<h2 class="svelte-z86ibt"> </h2>'),JR=$('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <input class="svelte-z86ibt"/></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),eD=$('<h2 class="svelte-z86ibt"> </h2>'),tD=$("<option> </option>"),nD=$('<form><!> <label class="svelte-z86ibt"><span class="svelte-z86ibt"> </span> <select class="svelte-z86ibt"><option disabled=""> </option><!></select></label> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt">Cancel</button> <button type="submit" class="primary svelte-z86ibt"> </button></div></form>'),rD=$('<h2 class="svelte-z86ibt"> </h2>'),sD=$('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button></div>',1),aD=$('<h2 class="svelte-z86ibt"> </h2>'),iD=$('<!> <p class="message svelte-z86ibt"> </p> <div class="actions decide-actions svelte-z86ibt"><button type="button" class="ghost svelte-z86ibt"> </button> <button type="button"> </button> <button type="button" class="primary svelte-z86ibt"> </button></div>',1),oD=$('<h2 class="svelte-z86ibt"> </h2>'),uD=$('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),lD=$('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function cD(t,e){at(e,!0);let n,r=Q(""),s=Q("");Rt(()=>{const p=Fu.pending;p?(p.kind==="prompt"&&A(r,p.options.value??"",!0),p.kind==="select"&&A(s,""),n.open||n.showModal()):n!=null&&n.open&&n.close()});function a(){const p=Fu.pending;(p==null?void 0:p.kind)==="confirm"?$c(!1):(p==null?void 0:p.kind)==="prompt"?Yc(null):(p==null?void 0:p.kind)==="select"?zc(null):(p==null?void 0:p.kind)==="decide"?Uu("cancel"):bp()}function i(p){p.preventDefault(),a()}function o(p){p.target===n&&a()}function l(p){p.preventDefault(),Yc(u(r))}function d(p){p.preventDefault(),u(s)!==""&&zc(u(s))}var f=lD(),g=N(f);{var h=p=>{const v=_e(()=>Fu.pending);var T=Kn(),_=et(T);{var E=J=>{var U=JR(),G=N(U);{var V=Y=>{var B=ZR(),z=N(B);re(()=>ae(z,u(v).options.title)),F(Y,B)};ce(G,Y=>{u(v).options.title&&Y(V)})}var ee=I(G,2),y=N(ee),j=N(y),b=I(y,2);ja(b,!0);var R=I(ee,2),k=N(R),D=I(k,2),W=N(D);re(()=>{ae(j,u(v).message),be(b,"placeholder",u(v).options.placeholder??""),ae(W,u(v).options.confirmLabel??"OK")}),Ue("submit",U,l),St(b,()=>u(r),Y=>A(r,Y)),ie("click",k,()=>Yc(null)),F(J,U)},O=J=>{var U=nD(),G=N(U);{var V=K=>{var te=eD(),fe=N(te);re(()=>ae(fe,u(v).options.title)),F(K,te)};ce(G,K=>{u(v).options.title&&K(V)})}var ee=I(G,2),y=N(ee),j=N(y),b=I(y,2);ja(b,!0);var R=N(b),k=N(R);R.value=R.__value="";var D=I(R);wt(D,17,()=>u(v).choices,K=>K.value,(K,te)=>{var fe=tD(),Ee=N(fe),ge={};re(()=>{ae(Ee,u(te).label),ge!==(ge=u(te).value)&&(fe.value=(fe.__value=u(te).value)??"")}),F(K,fe)});var W=I(ee,2),Y=N(W),B=I(Y,2),z=N(B);re(()=>{ae(j,u(v).message),ae(k,u(v).options.placeholder??"Choose…"),B.disabled=u(s)==="",ae(z,u(v).options.confirmLabel??"OK")}),Ue("submit",U,d),$a(b,()=>u(s),K=>A(s,K)),ie("click",Y,()=>zc(null)),F(J,U)},C=J=>{var U=sD(),G=et(U);{var V=Y=>{var B=rD(),z=N(B);re(()=>ae(z,u(v).options.title)),F(Y,B)};ce(G,Y=>{u(v).options.title&&Y(V)})}var ee=I(G,2),y=N(ee),j=I(ee,2),b=N(j),R=N(b),k=I(b,2);let D;var W=N(k);re(()=>{ae(y,u(v).message),ae(R,u(v).options.cancelLabel??"Cancel"),D=Ke(k,1,"primary svelte-z86ibt",null,D,{danger:u(v).options.danger}),ae(W,u(v).options.confirmLabel??"Confirm")}),ie("click",b,()=>$c(!1)),ie("click",k,()=>$c(!0)),F(J,U)},H=J=>{var U=iD(),G=et(U);{var V=z=>{var K=aD(),te=N(K);re(()=>ae(te,u(v).options.title)),F(z,K)};ce(G,z=>{u(v).options.title&&z(V)})}var ee=I(G,2),y=N(ee),j=I(ee,2),b=N(j),R=N(b),k=I(b,2);let D;var W=N(k),Y=I(k,2),B=N(Y);re(()=>{ae(y,u(v).message),ae(R,u(v).options.cancelLabel),D=Ke(k,1,"ghost svelte-z86ibt",null,D,{"danger-ghost":u(v).options.secondaryDanger}),ae(W,u(v).options.secondaryLabel),ae(B,u(v).options.primaryLabel)}),ie("click",b,()=>Uu("cancel")),ie("click",k,()=>Uu("secondary")),ie("click",Y,()=>Uu("primary")),F(J,U)},M=J=>{var U=uD(),G=et(U);{var V=R=>{var k=oD(),D=N(k);re(()=>ae(D,u(v).options.title)),F(R,k)};ce(G,R=>{u(v).options.title&&R(V)})}var ee=I(G,2),y=N(ee),j=I(ee,2),b=N(j);re(()=>ae(y,u(v).message)),ie("click",b,()=>bp()),F(J,U)};ce(_,J=>{u(v).kind==="prompt"?J(E):u(v).kind==="select"?J(O,1):u(v).kind==="confirm"?J(C,2):u(v).kind==="decide"?J(H,3):J(M,-1)})}F(p,T)};ce(g,p=>{Fu.pending&&p(h)})}mn(f,p=>n=p,()=>n),Ue("cancel",f,i),ie("click",f,o),F(t,f),it()}Tt(["click"]);var dD=$('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),fD=$('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),hD=$('<p class="hint svelte-o6yxmi">No matching pages.</p>'),pD=$('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),mD=$('<div class="search svelte-o6yxmi"><!> <input type="search" role="combobox" placeholder="Search pages by title…" aria-label="Search pages by title" aria-controls="link-results" aria-autocomplete="list" class="svelte-o6yxmi"/></div> <div class="results-area svelte-o6yxmi"><!></div>',1),gD=$('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),vD=$('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),bD=$('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),ED=$('<h2 class="svelte-o6yxmi">Link</h2> <div class="tabs svelte-o6yxmi" role="tablist" aria-label="Link type"><button type="button" role="tab">Page</button> <button type="button" role="tab">External URL</button></div> <div class="body svelte-o6yxmi"><!></div> <div class="actions svelte-o6yxmi"><button type="button" class="ghost svelte-o6yxmi">Cancel</button> <!> <!></div>',1),_D=$('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function TD(t,e){at(e,!0);let n=Q(void 0),r=Q("page"),s=Q(""),a=Q(ct([])),i=Q(-1),o=Q(""),l=Q(void 0);const d=_e(()=>IS.pending);Rt(()=>{var C,H;if(u(d)===null){(C=u(n))==null||C.close();return}const O=u(d).current;A(r,O===""||Go(O)?"page":"url",!0),A(s,""),A(a,[],!0),A(i,-1),A(o,Go(O)?"":O,!0),(H=u(n))==null||H.showModal()});let f;Rt(()=>{const O=u(s);if(clearTimeout(f),u(r)!=="page"||O.trim()===""){A(a,[],!0),A(i,-1);return}return f=setTimeout(()=>{tv(O).then(C=>{O===u(s)&&(A(a,C,!0),A(i,C.length>0?0:-1,!0))})},200),()=>clearTimeout(f)});function g(O){li(CS(O.path))}function h(){const O=u(o).trim();O!==""&&li(O)}function p(){var O,C;(C=(O=u(l))==null?void 0:O.children[u(i)])==null||C.scrollIntoView({block:"nearest"})}function v(O){if(u(a).length!==0){if(O.key==="ArrowDown")O.preventDefault(),A(i,(u(i)+1)%u(a).length),p();else if(O.key==="ArrowUp")O.preventDefault(),A(i,(u(i)-1+u(a).length)%u(a).length),p();else if(O.key==="Enter"){O.preventDefault();const C=u(a)[u(i)]??u(a)[0];C!==void 0&&g(C)}}}var T=_D(),_=N(T);{var E=O=>{var C=ED(),H=I(et(C),2),M=N(H);let J;var U=I(M,2);let G;var V=I(H,2),ee=N(V);{var y=B=>{var z=mD(),K=et(z),te=N(K);Av(te,{class:"search-icon",size:16,"aria-hidden":"true"});var fe=I(te,2);ja(fe,!0);var Ee=I(K,2),ge=N(Ee);{var Le=se=>{var he=fD();wt(he,23,()=>u(a),Ae=>Ae.path,(Ae,Ce,Me)=>{var ke=dD();let dt;var Be=N(ke),It=N(Be),Dt=I(Be,2),Lt=N(Dt);re(()=>{be(ke,"id",`link-option-${u(Me)}`),dt=Ke(ke,1,"result svelte-o6yxmi",null,dt,{active:u(Me)===u(i)}),be(ke,"aria-selected",u(Me)===u(i)),ae(It,u(Ce).title),ae(Lt,u(Ce).path)}),ie("click",ke,()=>g(u(Ce))),Ue("mouseenter",ke,()=>A(i,u(Me),!0)),F(Ae,ke)}),mn(he,Ae=>A(l,Ae),()=>u(l)),F(se,he)},de=se=>{var he=hD();F(se,he)},me=_e(()=>u(s).trim()!==""),Ie=se=>{var he=pD();F(se,he)};ce(ge,se=>{u(a).length>0?se(Le):u(me)?se(de,1):se(Ie,-1)})}re(()=>{be(fe,"aria-expanded",u(a).length>0),be(fe,"aria-activedescendant",u(i)>=0?`link-option-${u(i)}`:void 0)}),ie("keydown",fe,v),St(fe,()=>u(s),se=>A(s,se)),F(B,z)},j=B=>{var z=gD(),K=I(N(z),2);ie("keydown",K,te=>{te.key==="Enter"&&(te.preventDefault(),h())}),St(K,()=>u(o),te=>A(o,te)),F(B,z)};ce(ee,B=>{u(r)==="page"?B(y):B(j,-1)})}var b=I(V,2),R=N(b),k=I(R,2);{var D=B=>{var z=vD();ie("click",z,()=>li("")),F(B,z)};ce(k,B=>{u(d).current!==""&&B(D)})}var W=I(k,2);{var Y=B=>{var z=bD();re(K=>z.disabled=K,[()=>u(o).trim()===""]),ie("click",z,h),F(B,z)};ce(W,B=>{u(r)==="url"&&B(Y)})}re(()=>{J=Ke(M,1,"tab svelte-o6yxmi",null,J,{active:u(r)==="page"}),be(M,"aria-selected",u(r)==="page"),G=Ke(U,1,"tab svelte-o6yxmi",null,G,{active:u(r)==="url"}),be(U,"aria-selected",u(r)==="url")}),ie("click",M,()=>A(r,"page")),ie("click",U,()=>A(r,"url")),ie("click",R,()=>li(null)),F(O,C)};ce(_,O=>{u(d)!==null&&O(E)})}mn(T,O=>A(n,O),()=>u(n)),Ue("close",T,()=>li(null)),Ue("cancel",T,()=>li(null)),F(t,T),it()}Tt(["click","keydown"]);var AD=$('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),yD=$(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
|
|
139
|
+
password.</p>`),ND=$('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),SD=$(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),wD=$('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),ID=$('<p class="error svelte-2jpsc9" role="alert"> </p>'),CD=$('<main class="screen svelte-2jpsc9"><section class="panel svelte-2jpsc9"><header class="svelte-2jpsc9"><!> <h1 class="svelte-2jpsc9"> </h1> <!></header> <form autocomplete="on" class="svelte-2jpsc9"><label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Username</span> <input type="text" name="username" autocomplete="username" required="" class="svelte-2jpsc9"/></label> <label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Password</span> <input type="password" name="password" required="" class="svelte-2jpsc9"/></label> <!> <!> <button type="submit" class="primary svelte-2jpsc9"><!></button></form></section></main>');function LD(t,e){at(e,!0);const n=_e(()=>Dn.name??"nanoesis");let r=Q(""),s=Q(""),a=Q(""),i=Q(!1),o=Q(null),l=_e(()=>pt.firstRun&&u(a)!==""&&u(s)!==u(a)),d=_e(()=>!u(i)&&u(r).trim()!==""&&u(s)!==""&&(!pt.firstRun||u(a)!==""&&!u(l)));async function f(B){if(B.preventDefault(),!u(d))return;A(i,!0),A(o,null);const z=await pt.login(u(r),u(s));if(A(i,!1),!z.ok){A(o,g(z.error??"Sign-in failed."),!0);return}}function g(B){return B.includes("locked")?"Account temporarily locked, try again shortly.":B.includes("credentials")?"Invalid credentials. Check your username and password.":B}var h=CD(),p=N(h),v=N(p),T=N(v);{var _=B=>{var z=AD();re(()=>be(z,"src",Dn.logoUrl)),F(B,z)};ce(T,B=>{Dn.logoUrl&&B(_)})}var E=I(T,2),O=N(E),C=I(E,2);{var H=B=>{var z=yD();F(B,z)},M=B=>{var z=ND();F(B,z)};ce(C,B=>{pt.firstRun?B(H):B(M,-1)})}var J=I(v,2),U=N(J),G=I(N(U),2);ja(G,!0);var V=I(U,2),ee=I(N(V),2),y=I(V,2);{var j=B=>{var z=wD(),K=I(N(z),2),te=I(K,2);{var fe=Ee=>{var ge=SD();F(Ee,ge)};ce(te,Ee=>{u(l)&&Ee(fe)})}St(K,()=>u(a),Ee=>A(a,Ee)),F(B,z)};ce(y,B=>{pt.firstRun&&B(j)})}var b=I(y,2);{var R=B=>{var z=ID(),K=N(z);re(()=>ae(K,u(o))),F(B,z)};ce(b,B=>{u(o)&&B(R)})}var k=I(b,2),D=N(k);{var W=B=>{var z=_l();re(()=>ae(z,pt.firstRun?"Creating…":"Signing in…")),F(B,z)},Y=B=>{var z=_l();re(()=>ae(z,pt.firstRun?"Create admin account":"Sign in")),F(B,z)};ce(D,B=>{u(i)?B(W):B(Y,-1)})}re(()=>{ae(O,u(n)),be(ee,"autocomplete",pt.firstRun?"new-password":"current-password"),k.disabled=!u(d)}),Ue("submit",J,f),St(G,()=>u(r),B=>A(r,B)),St(ee,()=>u(s),B=>A(s,B)),F(t,h),it()}var OD=$('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),xD=$('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),RD=$('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),DD=$('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),kD=$('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),PD=$("<li><!></li>"),MD=$('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),BD=$('<dialog aria-label="Problems" class="svelte-7emrh2"><h2 class="svelte-7emrh2">Problems</h2> <!> <div class="actions svelte-7emrh2"><button type="button" class="ghost svelte-7emrh2">Re-check</button> <button type="button" class="primary svelte-7emrh2">Close</button></div></dialog>');function FD(t,e){at(e,!0);let n;const r=_e(()=>wn.errors),s=_e(()=>wn.warnings);Rt(()=>{wn.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(E){hf.request(E),wn.closePanel()}function i(E){E.preventDefault(),wn.closePanel()}function o(E){E.target===n&&wn.closePanel()}var l=BD(),d=I(N(l),2);{var f=E=>{var O=OD();F(E,O)},g=E=>{var O=xD();F(E,O)},h=E=>{var O=RD();F(E,O)},p=E=>{var O=MD(),C=et(O),H=N(C),M=I(H);{var J=G=>{var V=_l();re(()=>ae(V,`,
|
|
143
140
|
${u(s).length??""}
|
|
144
|
-
${u(s).length===1?"warning":"warnings"}`)),F(G,V)};ce(M,G=>{u(s).length>0&&G(J)})}var U=I(C,2);
|
|
145
|
-
${u(r).length===1?"error":"errors"}`)),F(E,O)};ce(d,E=>{
|
|
141
|
+
${u(s).length===1?"warning":"warnings"}`)),F(G,V)};ce(M,G=>{u(s).length>0&&G(J)})}var U=I(C,2);wt(U,21,()=>[...u(r),...u(s)],jo,(G,V)=>{var ee=PD(),y=N(ee);{var j=R=>{var k=DD(),D=N(k),W=N(D),Y=I(D,2),B=N(Y);re(()=>{ae(W,u(V).severity),ae(B,u(V).message)}),ie("click",k,()=>a(u(V).path??"")),F(R,k)},b=R=>{var k=kD(),D=N(k),W=N(D),Y=I(D,2),B=N(Y);re(()=>{ae(W,u(V).severity),ae(B,u(V).message)}),F(R,k)};ce(y,R=>{u(V).path?R(j):R(b,-1)})}re(()=>Ke(ee,1,km(u(V).severity),"svelte-7emrh2")),F(G,ee)}),re(()=>ae(H,`${u(r).length??""}
|
|
142
|
+
${u(r).length===1?"error":"errors"}`)),F(E,O)};ce(d,E=>{wn.status==="checking"?E(f):wn.status==="error"?E(g,1):u(r).length===0&&u(s).length===0?E(h,2):E(p,-1)})}var v=I(d,2),T=N(v),_=I(T,2);mn(l,E=>n=E,()=>n),re(()=>T.disabled=wn.status==="checking"),Ue("cancel",l,i),ie("click",l,o),ie("click",T,()=>void wn.refresh()),ie("click",_,()=>wn.closePanel()),F(t,l),it()}Tt(["click"]);var UD=$('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),HD=$("<!> <!> <!> <!> <!>",1);function qD(t,e){at(e,!1),Qa(()=>{ml.init(),pt.init(),Dn.load()}),Hm();var n=Kn(),r=et(n);{var s=o=>{var l=UD();F(o,l)},a=o=>{LD(o,{})},i=o=>{var l=HD(),d=et(l);QR(d,{});var f=I(d,2);cD(f,{});var g=I(f,2);TD(g,{});var h=I(g,2);r3(h,{});var p=I(h,2);FD(p,{}),F(o,l)};ce(r,o=>{pt.status==="loading"?o(s):pt.status==="unauthenticated"?o(a,1):o(i,-1)})}F(t,n),it()}const jD=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],$D=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function Hb(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&$D.has(t.type)))for(const[e,n]of jD)t.setAttribute(e,n)}function k1(t){for(const e of t.querySelectorAll("input, textarea"))Hb(e)}function YD(){k1(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&(Hb(r),k1(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const qb=document.getElementById("app");if(qb===null)throw new Error("Missing #app mount point");Wy().then(()=>{E_(qD,{target:qb}),YD()});export{Z3 as $,ik as A,pk as B,Tp as C,qN as D,df as E,mh as F,KD as G,hk as H,un as I,wt as J,vk as K,mv as L,Ue as M,_k as N,ok as O,w6 as P,et as Q,$ as R,Av as S,u as T,D6 as U,vv as V,ce as W,Mh as X,Pm as Y,dk as Z,rp as _,C6 as a,ck as a0,gv as a1,Pd as a2,y_ as a3,lk as a4,nf as a5,QD as a6,ek as a7,JD as a8,Qa as a9,ae as aA,B_ as aB,I as aC,Es as aD,on as aE,Lk as aF,Q as aG,re as aH,_l as aI,ml as aJ,Im as aK,fk as aL,sk as aM,_e as aN,Rt as aO,Ju as aa,it as ab,Ik as ac,uk as ad,ko as ae,Vn as af,ct as ag,_p as ah,at as ai,$N as aj,nk as ak,h6 as al,za as am,r6 as an,Jt as ao,ak as ap,Fs as aq,tk as ar,Tk as as,Tl as at,A as au,gk as av,be as aw,F_ as ax,Ke as ay,Gl as az,I6 as b,af as c,k6 as d,R6 as e,ix as f,Fn as g,F as h,Ck as i,GD as j,mk as k,Y_ as l,mn as m,St as n,bk as o,Ek as p,N as q,Kn as r,XD as s,xl as t,ZD as u,VD as v,rk as w,Tt as x,ie as y,Ol as z};
|