@xtrable-ltd/nanoesis 0.1.1 → 0.1.4

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.
Files changed (27) hide show
  1. package/dist/adapter-azure-blob.js +1 -1
  2. package/dist/{chunk-G2UEZTYC.js → chunk-S23S4ZAK.js} +50 -2
  3. package/dist/editor-api.d.ts +38 -4
  4. package/dist/editor-api.js +165 -3
  5. package/dist/index.d.ts +86 -34
  6. package/dist/index.js +5 -1
  7. package/editor/assets/{TemplatesPane-5qsDAK_B.js → TemplatesPane-Cjwu8SOY.js} +7 -7
  8. package/editor/assets/{cssMode-CGp4MIjR.js → cssMode-CIqtqlOX.js} +1 -1
  9. package/editor/assets/{freemarker2-CJkwxmPv.js → freemarker2-03aLbgAQ.js} +1 -1
  10. package/editor/assets/{handlebars-CKb5i2nM.js → handlebars-CsCT0Kz-.js} +1 -1
  11. package/editor/assets/{html-DyMbQx0w.js → html-BMDaxhoV.js} +1 -1
  12. package/editor/assets/{htmlMode-DVPeqtn-.js → htmlMode-BmX-GJzB.js} +1 -1
  13. package/editor/assets/{index-CbuWEnUB.css → index-DSooOnUR.css} +1 -1
  14. package/editor/assets/index-xCwd0bS3.js +138 -0
  15. package/editor/assets/{javascript-Bp1Qh9wR.js → javascript-y8MJYJ58.js} +1 -1
  16. package/editor/assets/{jsonMode-FLEeVtx7.js → jsonMode-DPpxOVap.js} +1 -1
  17. package/editor/assets/{liquid-Bh8c534t.js → liquid-CGoDffSW.js} +1 -1
  18. package/editor/assets/{mdx-BUbo8M9l.js → mdx-CMvr2LP2.js} +1 -1
  19. package/editor/assets/{python-CuJlk8g3.js → python-Dg93CFNM.js} +1 -1
  20. package/editor/assets/{razor-CuQT_1Ku.js → razor-D8HipAex.js} +1 -1
  21. package/editor/assets/{tsMode-CT2HUNtN.js → tsMode-Drl3yYU0.js} +1 -1
  22. package/editor/assets/{typescript-CtMx97cn.js → typescript-Dcqumk7N.js} +1 -1
  23. package/editor/assets/{xml-CyfpINj_.js → xml-zoMMlERG.js} +1 -1
  24. package/editor/assets/{yaml-BBWmgfMA.js → yaml-BMaJnJHN.js} +1 -1
  25. package/editor/index.html +2 -2
  26. package/package.json +1 -1
  27. package/editor/assets/index-DJmSgobK.js +0 -129
@@ -1,129 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./TemplatesPane-5qsDAK_B.js","./TemplatesPane-B4_sg2u5.css"])))=>i.map(i=>d[i]);
2
- var Yb=Object.defineProperty;var Mh=t=>{throw TypeError(t)};var zb=(t,e,n)=>e in t?Yb(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Ee=(t,e,n)=>zb(t,typeof e!="symbol"?e+"":e,n),cc=(t,e,n)=>e.has(t)||Mh("Cannot "+n);var W=(t,e,n)=>(cc(t,e,"read from private field"),n?n.call(t):e.get(t)),qe=(t,e,n)=>e.has(t)?Mh("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),je=(t,e,n,r)=>(cc(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),tt=(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 rp=!1;var vd=Array.isArray,Wb=Array.prototype.indexOf,fa=Array.prototype.includes,yl=Array.from,Gb=Object.defineProperty,ks=Object.getOwnPropertyDescriptor,sp=Object.getOwnPropertyDescriptors,Kb=Object.prototype,Vb=Array.prototype,Td=Object.getPrototypeOf,Bh=Object.isExtensible;function Wi(t){return typeof t=="function"}const _d=()=>{};function Xb(t){return t()}function Gc(t){for(var e=0;e<t.length;e++)t[e]()}function ap(){var t,e,n=new Promise((r,s)=>{t=r,e=s});return{promise:n,resolve:t,reject:e}}function Qb(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 un=2,fi=4,zu=8,Ad=1<<24,br=16,Ar=32,Us=64,Kc=128,nr=512,Yt=1024,Xt=2048,Wr=4096,An=8192,rr=16384,Sa=32768,Vc=1<<25,ls=65536,Jo=1<<17,Zb=1<<18,Oi=1<<19,ip=1<<20,Hr=1<<25,ba=65536,el=1<<21,Za=1<<22,Ps=1<<23,qr=Symbol("$state"),up=Symbol("legacy props"),Jb=Symbol(""),Bo=Symbol("attributes"),Xc=Symbol("class"),Qc=Symbol("style"),tu=Symbol("text"),Fo=Symbol("form reset"),Nl=new class extends Error{constructor(){super(...arguments);Ee(this,"name","StaleReactionError");Ee(this,"message","The reaction that called `getAbortSignal()` was re-run or destroyed")}};var ep;const yd=!!((ep=globalThis.document)!=null&&ep.contentType)&&globalThis.document.contentType.includes("xml");function op(t){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function eE(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function tE(t,e,n){throw new Error("https://svelte.dev/e/each_key_duplicate")}function nE(t){throw new Error("https://svelte.dev/e/effect_in_teardown")}function rE(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function sE(t){throw new Error("https://svelte.dev/e/effect_orphan")}function aE(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function iE(t){throw new Error("https://svelte.dev/e/props_invalid_value")}function uE(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function oE(){throw new Error("https://svelte.dev/e/state_prototype_fixed")}function lE(){throw new Error("https://svelte.dev/e/state_unsafe_mutation")}function cE(){throw new Error("https://svelte.dev/e/svelte_boundary_reset_onerror")}const fE=1,dE=2,lp=4,hE=8,pE=16,mE=1,gE=2,bE=4,EE=8,vE=16,TE=1,_E=2,Mt=Symbol("uninitialized"),cp="http://www.w3.org/1999/xhtml",AE="http://www.w3.org/2000/svg",yE="@attach";function NE(){console.warn("https://svelte.dev/e/derived_inert")}function SE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function IE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function fp(t){return t===this.v}function CE(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function dp(t){return!CE(t,this.v)}let Ri=!1,wE=!1;function LE(){Ri=!0}let vt=null;function di(t){vt=t}function OE(t){return RE().get(t)}function ct(t,e=!1,n){vt={p:vt,i:!1,c:null,e:null,s:t,x:null,r:Ve,l:Ri&&!e?{s:null,u:null,$:[]}:null}}function ft(t){var e=vt,n=e.e;if(n!==null){e.e=null;for(var r of n)Pp(r)}return e.i=!0,vt=e.p,{}}function xi(){return!Ri||vt!==null&&vt.l===null}function RE(t){return vt===null&&op(),vt.c??(vt.c=new Map(xE(vt)||void 0))}function xE(t){let e=t.p;for(;e!==null;){const n=e.c;if(n!==null)return n;e=e.p}return null}let ta=[];function hp(){var t=ta;ta=[],Gc(t)}function Tr(t){if(ta.length===0&&!lu){var e=ta;queueMicrotask(()=>{e===ta&&hp()})}ta.push(t)}function DE(){for(;ta.length>0;)hp()}function pp(t){var e=Ve;if(e===null)return Ze.f|=Ps,t;if((e.f&Sa)===0&&(e.f&fi)===0)throw t;ws(t,e)}function ws(t,e){for(;e!==null;){if((e.f&Kc)!==0){if((e.f&Sa)===0)throw t;try{e.b.error(t);return}catch(n){t=n}}e=e.parent}throw t}const kE=-7169;function Rt(t,e){t.f=t.f&kE|e}function Nd(t){(t.f&nr)!==0||t.deps===null?Rt(t,Yt):Rt(t,Wr)}function mp(t){if(t!==null)for(const e of t)(e.f&un)===0||(e.f&ba)===0||(e.f^=ba,mp(e.deps))}function gp(t,e,n){(t.f&Xt)!==0?e.add(t):(t.f&Wr)!==0&&n.add(t),mp(t.deps),Rt(t,Yt)}let Eo=!1;function PE(t){var e=Eo;try{return Eo=!1,[t(),Eo]}finally{Eo=e}}let fc=null,Ha=null,De=null,ou=null,nn=null,Zc=null,lu=!1,dc=!1,Xa=null,Uo=null;var Fh=0;let ME=1;var si,Ns,aa,ai,ii,ia,ui,ss,Fu,Bn,Uu,Ss,Mr,Br,oi,ua,lt,Jc,nu,ef,bp,Ep,Ho,BE,tf,ja;const El=class El{constructor(){qe(this,lt);Ee(this,"id",ME++);qe(this,si,!1);Ee(this,"linked",!0);qe(this,Ns,null);qe(this,aa,null);Ee(this,"async_deriveds",new Map);Ee(this,"current",new Map);Ee(this,"previous",new Map);Ee(this,"unblocked",new Set);qe(this,ai,new Set);qe(this,ii,new Set);qe(this,ia,new Set);qe(this,ui,0);qe(this,ss,new Map);qe(this,Fu,null);qe(this,Bn,[]);qe(this,Uu,[]);qe(this,Ss,new Set);qe(this,Mr,new Set);qe(this,Br,new Map);qe(this,oi,new Set);Ee(this,"is_fork",!1);qe(this,ua,!1)}skip_effect(e){W(this,Br).has(e)||W(this,Br).set(e,{d:[],m:[]}),W(this,oi).delete(e)}unskip_effect(e,n=r=>this.schedule(r)){var r=W(this,Br).get(e);if(r){W(this,Br).delete(e);for(var s of r.d)Rt(s,Xt),n(s);for(s of r.m)Rt(s,Wr),n(s)}W(this,oi).add(e)}capture(e,n,r=!1){e.v!==Mt&&!this.previous.has(e)&&this.previous.set(e,e.v),(e.f&Ps)===0&&(this.current.set(e,[n,r]),nn==null||nn.set(e,n)),this.is_fork||(e.v=n)}activate(){De=this}deactivate(){De=null,nn=null}flush(){try{dc=!0,De=this,tt(this,lt,nu).call(this)}finally{Fh=0,Zc=null,Xa=null,Uo=null,dc=!1,De=null,nn=null,da.clear()}}discard(){for(const e of W(this,ii))e(this);W(this,ii).clear(),W(this,ia).clear(),tt(this,lt,ja).call(this)}register_created_effect(e){W(this,Uu).push(e)}increment(e,n){if(je(this,ui,W(this,ui)+1),e){let r=W(this,ss).get(n)??0;W(this,ss).set(n,r+1)}}decrement(e,n){if(je(this,ui,W(this,ui)-1),e){let r=W(this,ss).get(n)??0;r===1?W(this,ss).delete(n):W(this,ss).set(n,r-1)}W(this,ua)||(je(this,ua,!0),Tr(()=>{je(this,ua,!1),this.linked&&this.flush()}))}transfer_effects(e,n){for(const r of e)W(this,Ss).add(r);for(const r of n)W(this,Mr).add(r);e.clear(),n.clear()}oncommit(e){W(this,ai).add(e)}ondiscard(e){W(this,ii).add(e)}on_fork_commit(e){W(this,ia).add(e)}run_fork_commit_callbacks(){for(const e of W(this,ia))e(this);W(this,ia).clear()}settled(){return(W(this,Fu)??je(this,Fu,ap())).promise}static ensure(){var e;if(De===null){const n=De=new El;tt(e=n,lt,tf).call(e),!dc&&!lu&&Tr(()=>{W(n,si)||n.flush()})}return De}apply(){{nn=null;return}}schedule(e){var s;if(Zc=e,(s=e.b)!=null&&s.is_pending&&(e.f&(fi|zu|Ad))!==0&&(e.f&Sa)===0){e.b.defer_effect(e);return}for(var n=e;n.parent!==null;){n=n.parent;var r=n.f;if(Xa!==null&&n===Ve&&(Ze===null||(Ze.f&un)===0))return;if((r&(Us|Ar))!==0){if((r&Yt)===0)return;n.f^=Yt}}W(this,Bn).push(n)}};si=new WeakMap,Ns=new WeakMap,aa=new WeakMap,ai=new WeakMap,ii=new WeakMap,ia=new WeakMap,ui=new WeakMap,ss=new WeakMap,Fu=new WeakMap,Bn=new WeakMap,Uu=new WeakMap,Ss=new WeakMap,Mr=new WeakMap,Br=new WeakMap,oi=new WeakMap,ua=new WeakMap,lt=new WeakSet,Jc=function(){if(this.is_fork)return!0;for(const r of W(this,ss).keys()){for(var e=r,n=!1;e.parent!==null;){if(W(this,Br).has(e)){n=!0;break}e=e.parent}if(!n)return!0}return!1},nu=function(){var o,f,h,g;if(je(this,si,!0),Fh++>1e3&&(tt(this,lt,ja).call(this),UE()),!tt(this,lt,Jc).call(this)){for(const d of W(this,Ss))W(this,Mr).delete(d),Rt(d,Xt),this.schedule(d);for(const d of W(this,Mr))Rt(d,Wr),this.schedule(d)}const e=W(this,Bn);je(this,Bn,[]),this.apply();var n=Xa=[],r=[],s=Uo=[];for(const d of e)try{tt(this,lt,ef).call(this,d,n,r)}catch(m){throw _p(d),m}if(De=null,s.length>0){var a=El.ensure();for(const d of s)a.schedule(d)}if(Xa=null,Uo=null,tt(this,lt,Jc).call(this)){tt(this,lt,Ho).call(this,r),tt(this,lt,Ho).call(this,n);for(const[d,m]of W(this,Br))Tp(d,m);s.length>0&&tt(o=De,lt,nu).call(o);return}const i=tt(this,lt,bp).call(this);if(i){tt(f=i,lt,Ep).call(f,this);return}W(this,Ss).clear(),W(this,Mr).clear();for(const d of W(this,ai))d(this);W(this,ai).clear(),ou=this,Uh(r),Uh(n),ou=null,(h=W(this,Fu))==null||h.resolve();var u=De;if(this.linked&&W(this,ui)===0&&tt(this,lt,ja).call(this),W(this,Bn).length>0){u===null&&(u=this,tt(this,lt,tf).call(this));const d=u;W(d,Bn).push(...W(this,Bn).filter(m=>!W(d,Bn).includes(m)))}u!==null&&tt(g=u,lt,nu).call(g)},ef=function(e,n,r){e.f^=Yt;for(var s=e.first;s!==null;){var a=s.f,i=(a&(Ar|Us))!==0,u=i&&(a&Yt)!==0,o=u||(a&An)!==0||W(this,Br).has(s);if(!o&&s.fn!==null){i?s.f^=Yt:(a&fi)!==0?n.push(s):Vu(s)&&((a&br)!==0&&W(this,Mr).add(s),bi(s));var f=s.first;if(f!==null){s=f;continue}}for(;s!==null;){var h=s.next;if(h!==null){s=h;break}s=s.parent}}},bp=function(){for(var e=W(this,Ns);e!==null;){if(!e.is_fork){for(const[n,[,r]]of this.current)if(e.current.has(n)&&!r)return e}e=W(e,Ns)}return null},Ep=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 o of a){var i=o.f;if((i&un)!==0)n(o);else{var u=o;i&(Za|br)&&!this.async_deriveds.has(u)&&(W(this,Mr).delete(u),Rt(u,Xt),this.schedule(u))}}};for(const s of this.current.keys())n(s);this.oncommit(()=>e.discard()),tt(r=e,lt,ja).call(r),De=this,tt(this,lt,nu).call(this)},Ho=function(e){for(var n=0;n<e.length;n+=1)gp(e[n],W(this,Ss),W(this,Mr))},BE=function(){var h;tt(this,lt,ja).call(this);for(let g=fc;g!==null;g=W(g,aa)){var e=g.id<this.id,n=[];for(const[d,[m,b]]of this.current){if(g.current.has(d)){var r=g.current.get(d)[0];if(e&&m!==r)g.current.set(d,[m,b]);else continue}n.push(d)}if(e)for(const[d,m]of this.async_deriveds){const b=g.async_deriveds.get(d);b&&m.promise.then(b.resolve)}if(W(g,si)){var s=[...g.current.keys()].filter(d=>!this.current.has(d));if(s.length===0)e&&g.discard();else if(n.length>0){if(e)for(const d of W(this,oi))g.unskip_effect(d,m=>{var b;(m.f&(br|Za))!==0?g.schedule(m):tt(b=g,lt,Ho).call(b,[m])});g.activate();var a=new Set,i=new Map;for(var u of n)vp(u,s,a,i);i=new Map;var o=[...g.current.keys()].filter(d=>this.current.has(d)?this.current.get(d)[0]!==d.v:!0);if(o.length>0)for(const d of W(this,Uu))(d.f&(rr|An|Jo))===0&&Sd(d,o,i)&&((d.f&(Za|br))!==0?(Rt(d,Xt),g.schedule(d)):W(g,Ss).add(d));if(W(g,Bn).length>0&&!W(g,ua)){g.apply();for(var f of W(g,Bn))tt(h=g,lt,ef).call(h,f,[],[]);je(g,Bn,[])}g.deactivate()}}}},tf=function(){Ha===null?fc=Ha=this:(je(Ha,aa,this),je(this,Ns,Ha)),Ha=this},ja=function(){var e=W(this,Ns),n=W(this,aa);e===null?fc=n:je(e,aa,n),n===null?Ha=e:je(n,Ns,e),this.linked=!1};let Ea=El;function FE(t){var e=lu;lu=!0;try{for(var n;;){if(DE(),De===null)return n;De.flush()}}finally{lu=e}}function UE(){try{aE()}catch(t){ws(t,Zc)}}let fr=null;function Uh(t){var e=t.length;if(e!==0){for(var n=0;n<e;){var r=t[n++];if((r.f&(rr|An))===0&&Vu(r)&&(fr=new Set,bi(r),r.deps===null&&r.first===null&&r.nodes===null&&r.teardown===null&&r.ac===null&&Fp(r),(fr==null?void 0:fr.size)>0)){da.clear();for(const s of fr){if((s.f&(rr|An))!==0)continue;const a=[s];let i=s.parent;for(;i!==null;)fr.has(i)&&(fr.delete(i),a.push(i)),i=i.parent;for(let u=a.length-1;u>=0;u--){const o=a[u];(o.f&(rr|An))===0&&bi(o)}}fr.clear()}}fr=null}}function vp(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&un)!==0?vp(s,e,n,r):(a&(Za|br))!==0&&(a&Xt)===0&&Sd(s,e,r)&&(Rt(s,Xt),Id(s))}}function Sd(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(fa.call(e,s))return!0;if((s.f&un)!==0&&Sd(s,e,n))return n.set(s,!0),!0}return n.set(t,!1),!1}function Id(t){De.schedule(t)}function Tp(t,e){if(!((t.f&Ar)!==0&&(t.f&Yt)!==0)){(t.f&Xt)!==0?e.d.push(t):(t.f&Wr)!==0&&e.m.push(t),Rt(t,Yt);for(var n=t.first;n!==null;)Tp(n,e),n=n.next}}function _p(t){Rt(t,Yt);for(var e=t.first;e!==null;)_p(e),e=e.next}function HE(t){let e=0,n=va(0),r;return()=>{Od()&&(c(n),Il(()=>(e===0&&(r=Ca(()=>t(()=>cu(n)))),e+=1,()=>{Tr(()=>{e-=1,e===0&&(r==null||r(),r=void 0,cu(n))})})))}}var qE=ls|Oi;function jE(t,e,n,r){new $E(t,e,n,r)}var Gn,Ed,Kn,oa,Cn,Vn,vn,Fn,as,la,Is,li,Hu,qu,is,vl,xt,YE,zE,WE,nf,qo,jo,rf,sf;class $E{constructor(e,n,r,s){qe(this,xt);Ee(this,"parent");Ee(this,"is_pending",!1);Ee(this,"transform_error");qe(this,Gn);qe(this,Ed,null);qe(this,Kn);qe(this,oa);qe(this,Cn);qe(this,Vn,null);qe(this,vn,null);qe(this,Fn,null);qe(this,as,null);qe(this,la,0);qe(this,Is,0);qe(this,li,!1);qe(this,Hu,new Set);qe(this,qu,new Set);qe(this,is,null);qe(this,vl,HE(()=>(je(this,is,va(W(this,la))),()=>{je(this,is,null)})));var a;je(this,Gn,e),je(this,Kn,n),je(this,oa,i=>{var u=Ve;u.b=this,u.f|=Kc,r(i)}),this.parent=Ve.b,this.transform_error=s??((a=this.parent)==null?void 0:a.transform_error)??(i=>i),je(this,Cn,Ia(()=>{tt(this,xt,nf).call(this)},qE))}defer_effect(e){gp(e,W(this,Hu),W(this,qu))}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!W(this,Kn).pending}update_pending_count(e,n){tt(this,xt,rf).call(this,e,n),je(this,la,W(this,la)+e),!(!W(this,is)||W(this,li))&&(je(this,li,!0),Tr(()=>{je(this,li,!1),W(this,is)&&pi(W(this,is),W(this,la))}))}get_effect_pending(){return W(this,vl).call(this),c(W(this,is))}error(e){if(!W(this,Kn).onerror&&!W(this,Kn).failed)throw e;De!=null&&De.is_fork?(W(this,Vn)&&De.skip_effect(W(this,Vn)),W(this,vn)&&De.skip_effect(W(this,vn)),W(this,Fn)&&De.skip_effect(W(this,Fn)),De.on_fork_commit(()=>{tt(this,xt,sf).call(this,e)})):tt(this,xt,sf).call(this,e)}}Gn=new WeakMap,Ed=new WeakMap,Kn=new WeakMap,oa=new WeakMap,Cn=new WeakMap,Vn=new WeakMap,vn=new WeakMap,Fn=new WeakMap,as=new WeakMap,la=new WeakMap,Is=new WeakMap,li=new WeakMap,Hu=new WeakMap,qu=new WeakMap,is=new WeakMap,vl=new WeakMap,xt=new WeakSet,YE=function(){try{je(this,Vn,Ln(()=>W(this,oa).call(this,W(this,Gn))))}catch(e){this.error(e)}},zE=function(e){const n=W(this,Kn).failed;n&&je(this,Fn,Ln(()=>{n(W(this,Gn),()=>e,()=>()=>{})}))},WE=function(){const e=W(this,Kn).pending;e&&(this.is_pending=!0,je(this,vn,Ln(()=>e(W(this,Gn)))),Tr(()=>{var n=je(this,as,document.createDocumentFragment()),r=jr();n.append(r),je(this,Vn,tt(this,xt,jo).call(this,()=>Ln(()=>W(this,oa).call(this,r)))),W(this,Is)===0&&(W(this,Gn).before(n),je(this,as,null),ha(W(this,vn),()=>{je(this,vn,null)}),tt(this,xt,qo).call(this,De))}))},nf=function(){try{if(this.is_pending=this.has_pending_snippet(),je(this,Is,0),je(this,la,0),je(this,Vn,Ln(()=>{W(this,oa).call(this,W(this,Gn))})),W(this,Is)>0){var e=je(this,as,document.createDocumentFragment());Dd(W(this,Vn),e);const n=W(this,Kn).pending;je(this,vn,Ln(()=>n(W(this,Gn))))}else tt(this,xt,qo).call(this,De)}catch(n){this.error(n)}},qo=function(e){this.is_pending=!1,e.transfer_effects(W(this,Hu),W(this,qu))},jo=function(e){var n=Ve,r=Ze,s=vt;Gr(W(this,Cn)),ar(W(this,Cn)),di(W(this,Cn).ctx);try{return Ea.ensure(),e()}catch(a){return pp(a),null}finally{Gr(n),ar(r),di(s)}},rf=function(e,n){var r;if(!this.has_pending_snippet()){this.parent&&tt(r=this.parent,xt,rf).call(r,e,n);return}je(this,Is,W(this,Is)+e),W(this,Is)===0&&(tt(this,xt,qo).call(this,n),W(this,vn)&&ha(W(this,vn),()=>{je(this,vn,null)}),W(this,as)&&(W(this,Gn).before(W(this,as)),je(this,as,null)))},sf=function(e){W(this,Vn)&&(rn(W(this,Vn)),je(this,Vn,null)),W(this,vn)&&(rn(W(this,vn)),je(this,vn,null)),W(this,Fn)&&(rn(W(this,Fn)),je(this,Fn,null));var n=W(this,Kn).onerror;let r=W(this,Kn).failed;var s=!1,a=!1;const i=()=>{if(s){IE();return}s=!0,a&&cE(),W(this,Fn)!==null&&ha(W(this,Fn),()=>{je(this,Fn,null)}),tt(this,xt,jo).call(this,()=>{tt(this,xt,nf).call(this)})},u=o=>{try{a=!0,n==null||n(o,i),a=!1}catch(f){ws(f,W(this,Cn)&&W(this,Cn).parent)}r&&je(this,Fn,tt(this,xt,jo).call(this,()=>{try{return Ln(()=>{var f=Ve;f.b=this,f.f|=Kc,r(W(this,Gn),()=>o,()=>i)})}catch(f){return ws(f,W(this,Cn).parent),null}}))};Tr(()=>{var o;try{o=this.transform_error(e)}catch(f){ws(f,W(this,Cn)&&W(this,Cn).parent);return}o!==null&&typeof o=="object"&&typeof o.then=="function"?o.then(u,f=>ws(f,W(this,Cn)&&W(this,Cn).parent)):u(o)})};function Ap(t,e,n,r){const s=xi()?hi:Cd;var a=t.filter(d=>!d.settled);if(n.length===0&&a.length===0){r(e.map(s));return}var i=Ve,u=GE(),o=a.length===1?a[0].promise:a.length>1?Promise.all(a.map(d=>d.promise)):null;function f(d){if((i.f&rr)===0){u();try{r(d)}catch(m){ws(m,i)}tl()}}var h=yp();if(n.length===0){o.then(()=>f(e.map(s))).finally(h);return}function g(){Promise.all(n.map(d=>KE(d))).then(d=>f([...e.map(s),...d])).catch(d=>ws(d,i)).finally(h)}o?o.then(()=>{u(),g(),tl()}):g()}function GE(){var t=Ve,e=Ze,n=vt,r=De;return function(a=!0){Gr(t),ar(e),di(n),a&&(t.f&rr)===0&&(r==null||r.activate(),r==null||r.apply())}}function tl(t=!0){Gr(null),ar(null),di(null),t&&(De==null||De.deactivate())}function yp(){var t=Ve,e=t.b,n=De,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 hi(t){var e=un|Xt;return Ve!==null&&(Ve.f|=Oi),{ctx:vt,deps:null,effects:null,equals:fp,f:e,fn:t,reactions:null,rv:0,v:Mt,wv:0,parent:Ve,ac:null}}const vo=Symbol("obsolete");function KE(t,e,n){let r=Ve;r===null&&eE();var s=void 0,a=va(Mt),i=!Ze,u=new Set;return av(()=>{var m;var o=Ve,f=ap();s=f.promise;try{Promise.resolve(t()).then(f.resolve,b=>{b!==Nl&&f.reject(b)}).finally(tl)}catch(b){f.reject(b),tl()}var h=De;if(i){if((o.f&Sa)!==0)var g=yp();if(r.b.is_rendered())(m=h.async_deriveds.get(o))==null||m.reject(vo);else for(const b of u.values())b.reject(vo);u.add(f),h.async_deriveds.set(o,f)}const d=(b,_=void 0)=>{g==null||g(),u.delete(f),_!==vo&&(h.activate(),_?(a.f|=Ps,pi(a,_)):((a.f&Ps)!==0&&(a.f^=Ps),pi(a,b)),h.deactivate())};f.promise.then(d,b=>d(null,b||"unknown"))}),Gu(()=>{for(const o of u)o.reject(vo)}),new Promise(o=>{function f(h){function g(){h===s?o(a):f(s)}h.then(g,g)}f(s)})}function Ae(t){const e=hi(t);return qp(e),e}function Cd(t){const e=hi(t);return e.equals=dp,e}function VE(t){var e=t.effects;if(e!==null){t.effects=null;for(var n=0;n<e.length;n+=1)rn(e[n])}}function wd(t){var e,n=Ve,r=t.parent;if(!cs&&r!==null&&t.v!==Mt&&(r.f&(rr|An))!==0)return NE(),t.v;Gr(r);try{t.f&=~ba,VE(t),e=zp(t)}finally{Gr(n)}return e}function Np(t){var e=wd(t);if(!t.equals(e)&&(t.wv=$p(),(!(De!=null&&De.is_fork)||t.deps===null)&&(De!==null?(De.capture(t,e,!0),ou==null||ou.capture(t,e,!0)):t.v=e,t.deps===null))){Rt(t,Yt);return}cs||(nn!==null?(Od()||De!=null&&De.is_fork)&&nn.set(t,e):Nd(t))}function XE(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(Nl),r.fn!==null&&(r.teardown=_d),r.ac=null,Nu(r,0),Rd(r))}function Sp(t){if(t.effects!==null)for(const e of t.effects)e.teardown&&e.fn!==null&&bi(e)}let nl=new Set;const da=new Map;let Ip=!1;function va(t,e){var n={f:0,v:t,reactions:null,equals:fp,rv:0,wv:0};return n}function ee(t,e){const n=va(t);return qp(n),n}function QE(t,e=!1,n=!0){var s;const r=va(t);return e||(r.equals=dp),Ri&&n&&vt!==null&&vt.l!==null&&((s=vt.l).s??(s.s=[])).push(r),r}function y(t,e,n=!1){Ze!==null&&(!Er||(Ze.f&Jo)!==0)&&xi()&&(Ze.f&(un|br|Za|Jo))!==0&&(sr===null||!fa.call(sr,t))&&lE();let r=n?Et(e):e;return pi(t,r,Uo)}function pi(t,e,n=null){if(!t.equals(e)){da.set(t,cs?e:t.v);var r=Ea.ensure();if(r.capture(t,e),(t.f&un)!==0){const s=t;(t.f&Xt)!==0&&wd(s),nn===null&&Nd(s)}t.wv=$p(),Cp(t,Xt,n),xi()&&Ve!==null&&(Ve.f&Yt)!==0&&(Ve.f&(Ar|Us))===0&&(Wn===null?ov([t]):Wn.push(t)),!r.is_fork&&nl.size>0&&!Ip&&ZE()}return e}function ZE(){Ip=!1;for(const t of nl){(t.f&Yt)!==0&&Rt(t,Wr);let e;try{e=Vu(t)}catch{e=!0}e&&bi(t)}nl.clear()}function cu(t){y(t,t.v+1)}function Cp(t,e,n){var r=t.reactions;if(r!==null)for(var s=xi(),a=r.length,i=0;i<a;i++){var u=r[i],o=u.f;if(!(!s&&u===Ve)){var f=(o&Xt)===0;if(f&&Rt(u,e),(o&Jo)!==0)nl.add(u);else if((o&un)!==0){var h=u;nn==null||nn.delete(h),(o&ba)===0&&(o&nr&&(Ve===null||(Ve.f&el)===0)&&(u.f|=ba),Cp(h,Wr,n))}else if(f){var g=u;(o&br)!==0&&fr!==null&&fr.add(g),n!==null?n.push(g):Id(g)}}}}function Et(t){if(typeof t!="object"||t===null||qr in t)return t;const e=Td(t);if(e!==Kb&&e!==Vb)return t;var n=new Map,r=vd(t),s=ee(0),a=pa,i=u=>{if(pa===a)return u();var o=Ze,f=pa;ar(null),Yh(a);var h=u();return ar(o),Yh(f),h};return r&&n.set("length",ee(t.length)),new Proxy(t,{defineProperty(u,o,f){(!("value"in f)||f.configurable===!1||f.enumerable===!1||f.writable===!1)&&uE();var h=n.get(o);return h===void 0?i(()=>{var g=ee(f.value);return n.set(o,g),g}):y(h,f.value,!0),!0},deleteProperty(u,o){var f=n.get(o);if(f===void 0){if(o in u){const h=i(()=>ee(Mt));n.set(o,h),cu(s)}}else y(f,Mt),cu(s);return!0},get(u,o,f){var m;if(o===qr)return t;var h=n.get(o),g=o in u;if(h===void 0&&(!g||(m=ks(u,o))!=null&&m.writable)&&(h=i(()=>{var b=Et(g?u[o]:Mt),_=ee(b);return _}),n.set(o,h)),h!==void 0){var d=c(h);return d===Mt?void 0:d}return Reflect.get(u,o,f)},getOwnPropertyDescriptor(u,o){var f=Reflect.getOwnPropertyDescriptor(u,o);if(f&&"value"in f){var h=n.get(o);h&&(f.value=c(h))}else if(f===void 0){var g=n.get(o),d=g==null?void 0:g.v;if(g!==void 0&&d!==Mt)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return f},has(u,o){var d;if(o===qr)return!0;var f=n.get(o),h=f!==void 0&&f.v!==Mt||Reflect.has(u,o);if(f!==void 0||Ve!==null&&(!h||(d=ks(u,o))!=null&&d.writable)){f===void 0&&(f=i(()=>{var m=h?Et(u[o]):Mt,b=ee(m);return b}),n.set(o,f));var g=c(f);if(g===Mt)return!1}return h},set(u,o,f,h){var L;var g=n.get(o),d=o in u;if(r&&o==="length")for(var m=f;m<g.v;m+=1){var b=n.get(m+"");b!==void 0?y(b,Mt):m in u&&(b=i(()=>ee(Mt)),n.set(m+"",b))}if(g===void 0)(!d||(L=ks(u,o))!=null&&L.writable)&&(g=i(()=>ee(void 0)),y(g,Et(f)),n.set(o,g));else{d=g.v!==Mt;var _=i(()=>Et(f));y(g,_)}var T=Reflect.getOwnPropertyDescriptor(u,o);if(T!=null&&T.set&&T.set.call(h,f),!d){if(r&&typeof o=="string"){var E=n.get("length"),O=Number(o);Number.isInteger(O)&&O>=E.v&&y(E,O+1)}cu(s)}return!0},ownKeys(u){c(s);var o=Reflect.ownKeys(u).filter(g=>{var d=n.get(g);return d===void 0||d.v!==Mt});for(var[f,h]of n)h.v!==Mt&&!(f in u)&&o.push(f);return o},setPrototypeOf(){oE()}})}function Hh(t){try{if(t!==null&&typeof t=="object"&&qr in t)return t[qr]}catch{}return t}function wp(t,e){return Object.is(Hh(t),Hh(e))}var qh,Lp,Op,Rp;function JE(){if(qh===void 0){qh=window,Lp=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,n=Text.prototype;Op=ks(e,"firstChild").get,Rp=ks(e,"nextSibling").get,Bh(t)&&(t[Xc]=void 0,t[Bo]=null,t[Qc]=void 0,t.__e=void 0),Bh(n)&&(n[tu]=void 0)}}function jr(t=""){return document.createTextNode(t)}function mi(t){return Op.call(t)}function Wu(t){return Rp.call(t)}function C(t,e){return mi(t)}function pt(t,e=!1){{var n=mi(t);return n instanceof Comment&&n.data===""?Wu(n):n}}function x(t,e=1,n=!1){let r=t;for(;e--;)r=Wu(r);return r}function ev(t){t.textContent=""}function xp(){return!1}function Dp(t,e,n){return document.createElementNS(e??cp,t,void 0)}function gi(t,e){if(e){const n=document.body;t.autofocus=!0,Tr(()=>{document.activeElement===n&&t.focus()})}}let jh=!1;function tv(){jh||(jh=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{var e;if(!t.defaultPrevented)for(const n of t.target.elements)(e=n[Fo])==null||e.call(n)})},{capture:!0}))}function Sl(t){var e=Ze,n=Ve;ar(null),Gr(null);try{return t()}finally{ar(e),Gr(n)}}function Ld(t,e,n,r=n){t.addEventListener(e,()=>Sl(n));const s=t[Fo];s?t[Fo]=()=>{s(),r(!0)}:t[Fo]=()=>r(!0),tv()}function kp(t){Ve===null&&(Ze===null&&sE(),rE()),cs&&nE()}function nv(t,e){var n=e.last;n===null?e.last=e.first=t:(n.next=t,t.prev=n,e.last=t)}function Nr(t,e){var n=Ve;n!==null&&(n.f&An)!==0&&(t|=An);var r={ctx:vt,deps:null,nodes:null,f:t|Xt|nr,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,wv:0,ac:null};De==null||De.register_created_effect(r);var s=r;if((t&fi)!==0)Xa!==null?Xa.push(r):Ea.ensure().schedule(r);else if(e!==null){try{bi(r)}catch(i){throw rn(r),i}s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&Oi)===0&&(s=s.first,(t&br)!==0&&(t&ls)!==0&&s!==null&&(s.f|=ls))}if(s!==null&&(s.parent=n,n!==null&&nv(s,n),Ze!==null&&(Ze.f&un)!==0&&(t&Us)===0)){var a=Ze;(a.effects??(a.effects=[])).push(s)}return r}function Od(){return Ze!==null&&!Er}function Gu(t){const e=Nr(zu,null);return Rt(e,Yt),e.teardown=t,e}function Dt(t){kp();var e=Ve.f,n=!Ze&&(e&Ar)!==0&&(e&Sa)===0;if(n){var r=vt;(r.e??(r.e=[])).push(t)}else return Pp(t)}function Pp(t){return Nr(fi|ip,t)}function rv(t){return kp(),Nr(zu|ip,t)}function sv(t){Ea.ensure();const e=Nr(Us|Oi,t);return(n={})=>new Promise(r=>{n.outro?ha(e,()=>{rn(e),r(void 0)}):(rn(e),r(void 0))})}function Ku(t){return Nr(fi,t)}function av(t){return Nr(Za|Oi,t)}function Il(t,e=0){return Nr(zu|e,t)}function oe(t,e=[],n=[],r=[]){Ap(r,e,n,s=>{Nr(zu,()=>t(...s.map(c)))})}function Ia(t,e=0){var n=Nr(br|e,t);return n}function Mp(t,e=0){var n=Nr(Ad|e,t);return n}function Ln(t){return Nr(Ar|Oi,t)}function Bp(t){var e=t.teardown;if(e!==null){const n=cs,r=Ze;$h(!0),ar(null);try{e.call(null)}finally{$h(n),ar(r)}}}function Rd(t,e=!1){var n=t.first;for(t.first=t.last=null;n!==null;){const s=n.ac;s!==null&&Sl(()=>{s.abort(Nl)});var r=n.next;(n.f&Us)!==0?n.parent=null:rn(n,e),n=r}}function iv(t){for(var e=t.first;e!==null;){var n=e.next;(e.f&Ar)===0&&rn(e),e=n}}function rn(t,e=!0){var n=!1;(e||(t.f&Zb)!==0)&&t.nodes!==null&&t.nodes.end!==null&&(uv(t.nodes.start,t.nodes.end),n=!0),Rt(t,Vc),Rd(t,e&&!n),Nu(t,0);var r=t.nodes&&t.nodes.t;if(r!==null)for(const a of r)a.stop();Bp(t),t.f^=Vc,t.f|=rr;var s=t.parent;s!==null&&s.first!==null&&Fp(t),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes=t.ac=t.b=null}function uv(t,e){for(;t!==null;){var n=t===e?null:Wu(t);t.remove(),t=n}}function Fp(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 ha(t,e,n=!0){var r=[];Up(t,r,!0);var s=()=>{n&&rn(t),e&&e()},a=r.length;if(a>0){var i=()=>--a||s();for(var u of r)u.out(i)}else s()}function Up(t,e,n){if((t.f&An)===0){t.f^=An;var r=t.nodes&&t.nodes.t;if(r!==null)for(const u of r)(u.is_global||n)&&e.push(u);for(var s=t.first;s!==null;){var a=s.next;if((s.f&Us)===0){var i=(s.f&ls)!==0||(s.f&Ar)!==0&&(t.f&br)!==0;Up(s,e,i?n:!1)}s=a}}}function xd(t){Hp(t,!0)}function Hp(t,e){if((t.f&An)!==0){t.f^=An,(t.f&Yt)===0&&(Rt(t,Xt),Ea.ensure().schedule(t));for(var n=t.first;n!==null;){var r=n.next,s=(n.f&ls)!==0||(n.f&Ar)!==0;Hp(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 Dd(t,e){if(t.nodes)for(var n=t.nodes.start,r=t.nodes.end;n!==null;){var s=n===r?null:Wu(n);e.append(n),n=s}}let $o=!1,cs=!1;function $h(t){cs=t}let Ze=null,Er=!1;function ar(t){Ze=t}let Ve=null;function Gr(t){Ve=t}let sr=null;function qp(t){Ze!==null&&(sr===null?sr=[t]:sr.push(t))}let wn=null,Mn=0,Wn=null;function ov(t){Wn=t}let jp=1,na=0,pa=na;function Yh(t){pa=t}function $p(){return++jp}function Vu(t){var e=t.f;if((e&Xt)!==0)return!0;if(e&un&&(t.f&=~ba),(e&Wr)!==0){for(var n=t.deps,r=n.length,s=0;s<r;s++){var a=n[s];if(Vu(a)&&Np(a),a.wv>t.wv)return!0}(e&nr)!==0&&nn===null&&Rt(t,Yt)}return!1}function Yp(t,e,n=!0){var r=t.reactions;if(r!==null&&!(sr!==null&&fa.call(sr,t)))for(var s=0;s<r.length;s++){var a=r[s];(a.f&un)!==0?Yp(a,e,!1):e===a&&(n?Rt(a,Xt):(a.f&Yt)!==0&&Rt(a,Wr),Id(a))}}function zp(t){var _;var e=wn,n=Mn,r=Wn,s=Ze,a=sr,i=vt,u=Er,o=pa,f=t.f;wn=null,Mn=0,Wn=null,Ze=(f&(Ar|Us))===0?t:null,sr=null,di(t.ctx),Er=!1,pa=++na,t.ac!==null&&(Sl(()=>{t.ac.abort(Nl)}),t.ac=null);try{t.f|=el;var h=t.fn,g=h();t.f|=Sa;var d=t.deps,m=De==null?void 0:De.is_fork;if(wn!==null){var b;if(m||Nu(t,Mn),d!==null&&Mn>0)for(d.length=Mn+wn.length,b=0;b<wn.length;b++)d[Mn+b]=wn[b];else t.deps=d=wn;if(Od()&&(t.f&nr)!==0)for(b=Mn;b<d.length;b++)((_=d[b]).reactions??(_.reactions=[])).push(t)}else!m&&d!==null&&Mn<d.length&&(Nu(t,Mn),d.length=Mn);if(xi()&&Wn!==null&&!Er&&d!==null&&(t.f&(un|Wr|Xt))===0)for(b=0;b<Wn.length;b++)Yp(Wn[b],t);if(s!==null&&s!==t){if(na++,s.deps!==null)for(let T=0;T<n;T+=1)s.deps[T].rv=na;if(e!==null)for(const T of e)T.rv=na;Wn!==null&&(r===null?r=Wn:r.push(...Wn))}return(t.f&Ps)!==0&&(t.f^=Ps),g}catch(T){return pp(T)}finally{t.f^=el,wn=e,Mn=n,Wn=r,Ze=s,sr=a,di(i),Er=u,pa=o}}function lv(t,e){let n=e.reactions;if(n!==null){var r=Wb.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&un)!==0&&(wn===null||!fa.call(wn,e))){var a=e;(a.f&nr)!==0&&(a.f^=nr,a.f&=~ba),a.v!==Mt&&Nd(a),XE(a),Nu(a,0)}}function Nu(t,e){var n=t.deps;if(n!==null)for(var r=e;r<n.length;r++)lv(t,n[r])}function bi(t){var e=t.f;if((e&rr)===0){Rt(t,Yt);var n=Ve,r=$o;Ve=t,$o=!0;try{(e&(br|Ad))!==0?iv(t):Rd(t),Bp(t);var s=zp(t);t.teardown=typeof s=="function"?s:null,t.wv=jp;var a;rp&&wE&&(t.f&Xt)!==0&&t.deps}finally{$o=r,Ve=n}}}async function Wp(){await Promise.resolve(),FE()}function c(t){var e=t.f,n=(e&un)!==0;if(Ze!==null&&!Er){var r=Ve!==null&&(Ve.f&rr)!==0;if(!r&&(sr===null||!fa.call(sr,t))){var s=Ze.deps;if((Ze.f&el)!==0)t.rv<na&&(t.rv=na,wn===null&&s!==null&&s[Mn]===t?Mn++:wn===null?wn=[t]:wn.push(t));else{Ze.deps??(Ze.deps=[]),fa.call(Ze.deps,t)||Ze.deps.push(t);var a=t.reactions;a===null?t.reactions=[Ze]:fa.call(a,Ze)||a.push(Ze)}}}if(cs&&da.has(t))return da.get(t);if(n){var i=t;if(cs){var u=i.v;return((i.f&Yt)===0&&i.reactions!==null||Kp(i))&&(u=wd(i)),da.set(i,u),u}var o=(i.f&nr)===0&&!Er&&Ze!==null&&($o||(Ze.f&nr)!==0),f=(i.f&Sa)===0;Vu(i)&&(o&&(i.f|=nr),Np(i)),o&&!f&&(Sp(i),Gp(i))}if(nn!=null&&nn.has(t))return nn.get(t);if((t.f&Ps)!==0)throw t.v;return t.v}function Gp(t){if(t.f|=nr,t.deps!==null)for(const e of t.deps)(e.reactions??(e.reactions=[])).push(t),(e.f&un)!==0&&(e.f&nr)===0&&(Sp(e),Gp(e))}function Kp(t){if(t.v===Mt)return!0;if(t.deps===null)return!1;for(const e of t.deps)if(da.has(e)||(e.f&un)!==0&&Kp(e))return!0;return!1}function Ca(t){var e=Er;try{return Er=!0,t()}finally{Er=e}}function cv(t){if(!(typeof t!="object"||!t||t instanceof EventTarget)){if(qr in t)af(t);else if(!Array.isArray(t))for(let e in t){const n=t[e];typeof n=="object"&&n&&qr in n&&af(n)}}}function af(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{af(t[r],e)}catch{}const n=Td(t);if(n!==Object.prototype&&n!==Array.prototype&&n!==Map.prototype&&n!==Set.prototype&&n!==Date.prototype){const r=sp(n);for(let s in r){const a=r[s].get;if(a)try{a.call(t)}catch{}}}}}function fv(t){return t.endsWith("capture")&&t!=="gotpointercapture"&&t!=="lostpointercapture"}const dv=["beforeinput","click","change","dblclick","contextmenu","focusin","focusout","input","keydown","keyup","mousedown","mousemove","mouseout","mouseover","mouseup","pointerdown","pointermove","pointerout","pointerover","pointerup","touchend","touchmove","touchstart"];function hv(t){return dv.includes(t)}const pv={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 mv(t){return t=t.toLowerCase(),pv[t]??t}const gv=["touchstart","touchmove"];function bv(t){return gv.includes(t)}const ra=Symbol("events"),Vp=new Set,uf=new Set;function Xp(t,e,n,r={}){function s(a){if(r.capture||of.call(e,a),!a.cancelBubble)return Sl(()=>n==null?void 0:n.call(this,a))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Tr(()=>{e.addEventListener(t,s,r)}):e.addEventListener(t,s,r),s}function Be(t,e,n,r,s){var a={capture:r,passive:s},i=Xp(t,e,n,a);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Gu(()=>{e.removeEventListener(t,i,a)})}function ae(t,e,n){(e[ra]??(e[ra]={}))[t]=n}function Tt(t){for(var e=0;e<t.length;e++)Vp.add(t[e]);for(var n of uf)n(t)}let zh=null;function of(t){var T,E;var e=this,n=e.ownerDocument,r=t.type,s=((T=t.composedPath)==null?void 0:T.call(t))||[],a=s[0]||t.target;zh=t;var i=0,u=zh===t&&t[ra];if(u){var o=s.indexOf(u);if(o!==-1&&(e===document||e===window)){t[ra]=e;return}var f=s.indexOf(e);if(f===-1)return;o<=f&&(i=o)}if(a=s[i]||t.target,a!==e){Gb(t,"currentTarget",{configurable:!0,get(){return a||n}});var h=Ze,g=Ve;ar(null),Gr(null);try{for(var d,m=[];a!==null;){var b=a.assignedSlot||a.parentNode||a.host||null;try{var _=(E=a[ra])==null?void 0:E[r];_!=null&&(!a.disabled||t.target===a)&&_.call(a,t)}catch(O){d?m.push(O):d=O}if(t.cancelBubble||b===e||b===null)break;a=b}if(d){for(let O of m)queueMicrotask(()=>{throw O});throw d}}finally{t[ra]=e,delete t.currentTarget,ar(h),Gr(g)}}}var tp;const hc=((tp=globalThis==null?void 0:globalThis.window)==null?void 0:tp.trustedTypes)&&globalThis.window.trustedTypes.createPolicy("svelte-trusted-html",{createHTML:t=>t});function Ev(t){return(hc==null?void 0:hc.createHTML(t))??t}function Qp(t){var e=Dp("template");return e.innerHTML=Ev(t.replaceAll("<!>","<!---->")),e.content}function Ei(t,e){var n=Ve;n.nodes===null&&(n.nodes={start:t,end:e,a:null,t:null})}function G(t,e){var n=(e&TE)!==0,r=(e&_E)!==0,s,a=!t.startsWith("<!>");return()=>{s===void 0&&(s=Qp(a?t:"<!>"+t),n||(s=mi(s)));var i=r||Lp?document.importNode(s,!0):s.cloneNode(!0);if(n){var u=mi(i),o=i.lastChild;Ei(u,o)}else Ei(i,i);return i}}function vv(t,e,n="svg"){var r=!t.startsWith("<!>"),s=`<${n}>${r?t:"<!>"+t}</${n}>`,a;return()=>{if(!a){var i=Qp(s),u=mi(i);a=mi(u)}var o=a.cloneNode(!0);return Ei(o,o),o}}function Tv(t,e){return vv(t,e,"svg")}function lf(t=""){{var e=jr(t+"");return Ei(e,e),e}}function vr(){var t=document.createDocumentFragment(),e=document.createComment(""),n=jr();return t.append(e,n),Ei(e,n),t}function $(t,e){t!==null&&t.before(e)}function de(t,e){var n=e==null?"":typeof e=="object"?`${e}`:e;n!==(t[tu]??(t[tu]=t.nodeValue))&&(t[tu]=n,t.nodeValue=`${n}`)}function _v(t,e){return Av(t,e)}const To=new Map;function Av(t,{target:e,anchor:n,props:r={},events:s,context:a,intro:i=!0,transformError:u}){JE();var o=void 0,f=sv(()=>{var h=n??e.appendChild(jr());jE(h,{pending:()=>{}},m=>{ct({});var b=vt;a&&(b.c=a),s&&(r.$$events=s),o=t(m,r)||{},ft()},u);var g=new Set,d=m=>{for(var b=0;b<m.length;b++){var _=m[b];if(!g.has(_)){g.add(_);var T=bv(_);for(const L of[e,document]){var E=To.get(L);E===void 0&&(E=new Map,To.set(L,E));var O=E.get(_);O===void 0?(L.addEventListener(_,of,{passive:T}),E.set(_,1)):E.set(_,O+1)}}}};return d(yl(Vp)),uf.add(d),()=>{var T;for(var m of g)for(const E of[e,document]){var b=To.get(E),_=b.get(m);--_==0?(E.removeEventListener(m,of),b.delete(m),b.size===0&&To.delete(E)):b.set(m,_)}uf.delete(d),h!==n&&((T=h.parentNode)==null||T.removeChild(h))}});return yv.set(o,f),o}let yv=new WeakMap;var pr,Fr,Un,ca,ju,$u,Tl;class Xu{constructor(e,n=!0){Ee(this,"anchor");qe(this,pr,new Map);qe(this,Fr,new Map);qe(this,Un,new Map);qe(this,ca,new Set);qe(this,ju,!0);qe(this,$u,e=>{if(W(this,pr).has(e)){var n=W(this,pr).get(e),r=W(this,Fr).get(n);if(r)xd(r),W(this,ca).delete(n);else{var s=W(this,Un).get(n);s&&(W(this,Fr).set(n,s.effect),W(this,Un).delete(n),s.fragment.lastChild.remove(),this.anchor.before(s.fragment),r=s.effect)}for(const[a,i]of W(this,pr)){if(W(this,pr).delete(a),a===e)break;const u=W(this,Un).get(i);u&&(rn(u.effect),W(this,Un).delete(i))}for(const[a,i]of W(this,Fr)){if(a===n||W(this,ca).has(a))continue;const u=()=>{if(Array.from(W(this,pr).values()).includes(a)){var f=document.createDocumentFragment();Dd(i,f),f.append(jr()),W(this,Un).set(a,{effect:i,fragment:f})}else rn(i);W(this,ca).delete(a),W(this,Fr).delete(a)};W(this,ju)||!r?(W(this,ca).add(a),ha(i,u,!1)):u()}}});qe(this,Tl,e=>{W(this,pr).delete(e);const n=Array.from(W(this,pr).values());for(const[r,s]of W(this,Un))n.includes(r)||(rn(s.effect),W(this,Un).delete(r))});this.anchor=e,je(this,ju,n)}ensure(e,n){var r=De,s=xp();if(n&&!W(this,Fr).has(e)&&!W(this,Un).has(e))if(s){var a=document.createDocumentFragment(),i=jr();a.append(i),W(this,Un).set(e,{effect:Ln(()=>n(i)),fragment:a})}else W(this,Fr).set(e,Ln(()=>n(this.anchor)));if(W(this,pr).set(r,e),s){for(const[u,o]of W(this,Fr))u===e?r.unskip_effect(o):r.skip_effect(o);for(const[u,o]of W(this,Un))u===e?r.unskip_effect(o.effect):r.skip_effect(o.effect);r.oncommit(W(this,$u)),r.ondiscard(W(this,Tl))}else W(this,$u).call(this,r)}}pr=new WeakMap,Fr=new WeakMap,Un=new WeakMap,ca=new WeakMap,ju=new WeakMap,$u=new WeakMap,Tl=new WeakMap;function he(t,e,n=!1){var r=new Xu(t),s=n?ls:0;function a(i,u){r.ensure(i,u)}Ia(()=>{var i=!1;e((u,o=0)=>{i=!0,a(o,u)}),i||a(-1,null)},s)}const Nv=Symbol("NaN");function Sv(t,e,n){var r=new Xu(t),s=!xi();Ia(()=>{var a=e();a!==a&&(a=Nv),s&&a!==null&&typeof a=="object"&&(a={}),r.ensure(a,n)})}function Su(t,e){return e}function Iv(t,e,n){for(var r=[],s=e.length,a,i=e.length,u=0;u<s;u++){let g=e[u];ha(g,()=>{if(a){if(a.pending.delete(g),a.done.add(g),a.pending.size===0){var d=t.outrogroups;cf(t,yl(a.done)),d.delete(a),d.size===0&&(t.outrogroups=null)}}else i-=1},!1)}if(i===0){var o=r.length===0&&n!==null;if(o){var f=n,h=f.parentNode;ev(h),h.append(f),t.items.clear()}cf(t,e,!o)}else a={pending:new Set(e),done:new Set},(t.outrogroups??(t.outrogroups=new Set)).add(a)}function cf(t,e,n=!0){var r;if(t.pending.size>0){r=new Set;for(const i of t.pending.values())for(const u of i)r.add(t.items.get(u).e)}for(var s=0;s<e.length;s++){var a=e[s];if(r!=null&&r.has(a)){a.f|=Hr;const i=document.createDocumentFragment();Dd(a,i)}else rn(e[s],n)}}var Wh;function wt(t,e,n,r,s,a=null){var i=t,u=new Map,o=(e&lp)!==0;if(o){var f=t;i=f.appendChild(jr())}var h=null,g=Cd(()=>{var L=n();return vd(L)?L:L==null?[]:yl(L)}),d,m=new Map,b=!0;function _(L){(O.effect.f&rr)===0&&(O.pending.delete(L),O.fallback=h,Cv(O,d,i,e,r),h!==null&&(d.length===0?(h.f&Hr)===0?xd(h):(h.f^=Hr,ru(h,null,i)):ha(h,()=>{h=null})))}function T(L){O.pending.delete(L)}var E=Ia(()=>{d=c(g);for(var L=d.length,B=new Set,I=De,H=xp(),R=0;R<L;R+=1){var q=d[R],Q=r(q,R),Y=b?null:u.get(Q);Y?(Y.v&&pi(Y.v,q),Y.i&&pi(Y.i,R),H&&I.unskip_effect(Y.e)):(Y=wv(u,b?i:Wh??(Wh=jr()),q,Q,R,s,e,n),b||(Y.e.f|=Hr),u.set(Q,Y)),B.add(Q)}if(L===0&&a&&!h&&(b?h=Ln(()=>a(i)):(h=Ln(()=>a(Wh??(Wh=jr()))),h.f|=Hr)),L>B.size&&tE(),!b)if(m.set(I,B),H){for(const[v,M]of u)B.has(v)||I.skip_effect(M.e);I.oncommit(_),I.ondiscard(T)}else _(I);c(g)}),O={effect:E,items:u,pending:m,outrogroups:null,fallback:h};b=!1}function Gi(t){for(;t!==null&&(t.f&Ar)===0;)t=t.next;return t}function Cv(t,e,n,r,s){var Y,v,M,S,U,F,k,V,z;var a=(r&hE)!==0,i=e.length,u=t.items,o=Gi(t.effect.first),f,h=null,g,d=[],m=[],b,_,T,E;if(a)for(E=0;E<i;E+=1)b=e[E],_=s(b,E),T=u.get(_).e,(T.f&Hr)===0&&((v=(Y=T.nodes)==null?void 0:Y.a)==null||v.measure(),(g??(g=new Set)).add(T));for(E=0;E<i;E+=1){if(b=e[E],_=s(b,E),T=u.get(_).e,t.outrogroups!==null)for(const j of t.outrogroups)j.pending.delete(T),j.done.delete(T);if((T.f&An)!==0&&(xd(T),a&&((S=(M=T.nodes)==null?void 0:M.a)==null||S.unfix(),(g??(g=new Set)).delete(T))),(T.f&Hr)!==0)if(T.f^=Hr,T===o)ru(T,null,n);else{var O=h?h.next:o;T===t.effect.last&&(t.effect.last=T.prev),T.prev&&(T.prev.next=T.next),T.next&&(T.next.prev=T.prev),Es(t,h,T),Es(t,T,O),ru(T,O,n),h=T,d=[],m=[],o=Gi(h.next);continue}if(T!==o){if(f!==void 0&&f.has(T)){if(d.length<m.length){var L=m[0],B;h=L.prev;var I=d[0],H=d[d.length-1];for(B=0;B<d.length;B+=1)ru(d[B],L,n);for(B=0;B<m.length;B+=1)f.delete(m[B]);Es(t,I.prev,H.next),Es(t,h,I),Es(t,H,L),o=L,h=H,E-=1,d=[],m=[]}else f.delete(T),ru(T,o,n),Es(t,T.prev,T.next),Es(t,T,h===null?t.effect.first:h.next),Es(t,h,T),h=T;continue}for(d=[],m=[];o!==null&&o!==T;)(f??(f=new Set)).add(o),m.push(o),o=Gi(o.next);if(o===null)continue}(T.f&Hr)===0&&d.push(T),h=T,o=Gi(T.next)}if(t.outrogroups!==null){for(const j of t.outrogroups)j.pending.size===0&&(cf(t,yl(j.done)),(U=t.outrogroups)==null||U.delete(j));t.outrogroups.size===0&&(t.outrogroups=null)}if(o!==null||f!==void 0){var R=[];if(f!==void 0)for(T of f)(T.f&An)===0&&R.push(T);for(;o!==null;)(o.f&An)===0&&o!==t.fallback&&R.push(o),o=Gi(o.next);var q=R.length;if(q>0){var Q=(r&lp)!==0&&i===0?n:null;if(a){for(E=0;E<q;E+=1)(k=(F=R[E].nodes)==null?void 0:F.a)==null||k.measure();for(E=0;E<q;E+=1)(z=(V=R[E].nodes)==null?void 0:V.a)==null||z.fix()}Iv(t,R,Q)}}a&&Tr(()=>{var j,X;if(g!==void 0)for(T of g)(X=(j=T.nodes)==null?void 0:j.a)==null||X.apply()})}function wv(t,e,n,r,s,a,i,u){var o=(i&fE)!==0?(i&pE)===0?QE(n,!1,!1):va(n):null,f=(i&dE)!==0?va(s):null;return{v:o,i:f,e:Ln(()=>(a(e,o??n,f??s,u),()=>{t.delete(r)}))}}function ru(t,e,n){if(t.nodes)for(var r=t.nodes.start,s=t.nodes.end,a=e&&(e.f&Hr)===0?e.nodes.start:n;r!==null;){var i=Wu(r);if(a.before(r),r===s)return;r=i}}function Es(t,e,n){e===null?t.effect.first=n:e.next=n,n===null?t.effect.last=e:n.prev=e}function Lv(t,e,...n){var r=new Xu(t);Ia(()=>{const s=e()??null;r.ensure(s,s&&(a=>s(a,...n)))},ls)}function Ov(t,e,n){var r=new Xu(t);Ia(()=>{var s=e()??null;r.ensure(s,s&&(a=>n(a,s)))},ls)}function Rv(t,e,n,r,s,a){var i=null,u=t,o=new Xu(u,!1);Ia(()=>{const f=e()||null;var h=AE;if(f===null){o.ensure(null,null);return}return o.ensure(f,g=>{if(f){if(i=Dp(f,h),Ei(i,i),r){var d=i.appendChild(jr());r(i,d)}Ve.nodes.end=i,g.before(i)}}),()=>{}},ls),Gu(()=>{})}function xv(t,e){var n=void 0,r;Mp(()=>{n!==(n=e())&&(r&&(rn(r),r=null),n&&(r=Ln(()=>{Ku(()=>n(t))})))})}function Zp(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=Zp(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function Dv(){for(var t,e,n=0,r="",s=arguments.length;n<s;n++)(t=arguments[n])&&(e=Zp(t))&&(r&&(r+=" "),r+=e);return r}function Jp(t){return typeof t=="object"?Dv(t):t??""}const Gh=[...`
3
- \r\f \v\uFEFF`];function kv(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 u=i+a;(i===0||Gh.includes(r[i-1]))&&(u===r.length||Gh.includes(r[u]))?r=(i===0?"":r.substring(0,i))+r.substring(u+1):i=u}}return r===""?null:r}function Kh(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 pc(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function Pv(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,u=!1,o=[];r&&o.push(...Object.keys(r).map(pc)),s&&o.push(...Object.keys(s).map(pc));var f=0,h=-1;const _=t.length;for(var g=0;g<_;g++){var d=t[g];if(u?d==="/"&&t[g-1]==="*"&&(u=!1):a?a===d&&(a=!1):d==="/"&&t[g+1]==="*"?u=!0:d==='"'||d==="'"?a=d:d==="("?i++:d===")"&&i--,!u&&a===!1&&i===0){if(d===":"&&h===-1)h=g;else if(d===";"||g===_-1){if(h!==-1){var m=pc(t.substring(f,h).trim());if(!o.includes(m)){d!==";"&&g++;var b=t.substring(f,g).trim();n+=" "+b+";"}}f=g+1,h=-1}}}}return r&&(n+=Kh(r)),s&&(n+=Kh(s,!0)),n=n.trim(),n===""?null:n}return t==null?null:String(t)}function it(t,e,n,r,s,a){var i=t[Xc];if(i!==n||i===void 0){var u=kv(n,r,a);u==null?t.removeAttribute("class"):e?t.className=u:t.setAttribute("class",u),t[Xc]=n}else if(a&&s!==a)for(var o in a){var f=!!a[o];(s==null||f!==!!s[o])&&t.classList.toggle(o,f)}return a}function mc(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 em(t,e,n,r){var s=t[Qc];if(s!==e){var a=Pv(e,r);a==null?t.removeAttribute("style"):t.style.cssText=a,t[Qc]=e}else r&&(Array.isArray(r)?(mc(t,n==null?void 0:n[0],r[0]),mc(t,n==null?void 0:n[1],r[1],"important")):mc(t,n,r));return r}function rl(t,e,n=!1){if(t.multiple){if(e==null)return;if(!vd(e))return SE();for(var r of t.options)r.selected=e.includes(fu(r));return}for(r of t.options){var s=fu(r);if(wp(s,e)){r.selected=!0;return}}(!n||e!==void 0)&&(t.selectedIndex=-1)}function tm(t){var e=new MutationObserver(()=>{rl(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Gu(()=>{e.disconnect()})}function Ta(t,e,n=e){var r=new WeakSet,s=!0;Ld(t,"change",a=>{var i=a?"[selected]":":checked",u;if(t.multiple)u=[].map.call(t.querySelectorAll(i),fu);else{var o=t.querySelector(i)??t.querySelector("option:not([disabled])");u=o&&fu(o)}n(u),t.__value=u,De!==null&&r.add(De)}),Ku(()=>{var a=e();if(t===document.activeElement){var i=De;if(r.has(i))return}if(rl(t,a,s),s&&a===void 0){var u=t.querySelector(":checked");u!==null&&(a=fu(u),n(a))}t.__value=a,s=!1}),tm(t)}function fu(t){return"__value"in t?t.__value:t.value}const Ki=Symbol("class"),Vi=Symbol("style"),nm=Symbol("is custom element"),rm=Symbol("is html"),Mv=yd?"option":"OPTION",Bv=yd?"select":"SELECT",Fv=yd?"progress":"PROGRESS";function Uv(t,e){var n=Cl(t);n.value===(n.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!==Fv)||(t.value=e??"")}function Hv(t,e){var n=Cl(t);n.checked!==(n.checked=e??void 0)&&(t.checked=e)}function qv(t,e){e?t.hasAttribute("selected")||t.setAttribute("selected",""):t.removeAttribute("selected")}function ge(t,e,n,r){var s=Cl(t);s[e]!==(s[e]=n)&&(e==="loading"&&(t[Jb]=n),n==null?t.removeAttribute(e):typeof n!="string"&&sm(t).includes(e)?t[e]=n:t.setAttribute(e,n))}function jv(t,e,n,r,s=!1,a=!1){var i=Cl(t),u=i[nm],o=!i[rm],f=e||{},h=t.nodeName===Mv;for(var g in e)g in n||(n[g]=null);n.class?n.class=Jp(n.class):n[Ki]&&(n.class=null),n[Vi]&&(n.style??(n.style=null));var d=sm(t);for(const L in n){let B=n[L];if(h&&L==="value"&&B==null){t.value=t.__value="",f[L]=B;continue}if(L==="class"){var m=t.namespaceURI==="http://www.w3.org/1999/xhtml";it(t,m,B,r,e==null?void 0:e[Ki],n[Ki]),f[L]=B,f[Ki]=n[Ki];continue}if(L==="style"){em(t,B,e==null?void 0:e[Vi],n[Vi]),f[L]=B,f[Vi]=n[Vi];continue}var b=f[L];if(!(B===b&&!(B===void 0&&t.hasAttribute(L)))){f[L]=B;var _=L[0]+L[1];if(_!=="$$")if(_==="on"){const I={},H="$$"+L;let R=L.slice(2);var T=hv(R);if(fv(R)&&(R=R.slice(0,-7),I.capture=!0),!T&&b){if(B!=null)continue;t.removeEventListener(R,f[H],I),f[H]=null}if(T)ae(R,t,B),Tt([R]);else if(B!=null){let q=function(Q){f[L].call(this,Q)};f[H]=Xp(R,t,q,I)}}else if(L==="style")ge(t,L,B);else if(L==="autofocus")gi(t,!!B);else if(!u&&(L==="__value"||L==="value"&&B!=null))t.value=t.__value=B;else if(L==="selected"&&h)qv(t,B);else{var E=L;o||(E=mv(E));var O=E==="defaultValue"||E==="defaultChecked";if(B==null&&!u&&!O)if(i[L]=null,E==="value"||E==="checked"){let I=t;const H=e===void 0;if(E==="value"){let R=I.defaultValue;I.removeAttribute(E),I.defaultValue=R,I.value=I.__value=H?R:null}else{let R=I.defaultChecked;I.removeAttribute(E),I.defaultChecked=R,I.checked=H?R:!1}}else t.removeAttribute(L);else O||d.includes(E)&&(u||typeof B!="string")?(t[E]=B,E in i&&(i[E]=Mt)):typeof B!="function"&&ge(t,E,B)}}}return f}function Vh(t,e,n=[],r=[],s=[],a,i=!1,u=!1){Ap(s,n,r,o=>{var f=void 0,h={},g=t.nodeName===Bv,d=!1;if(Mp(()=>{var b=e(...o.map(c)),_=jv(t,f,b,a,i,u);d&&g&&"value"in b&&rl(t,b.value);for(let E of Object.getOwnPropertySymbols(h))b[E]||rn(h[E]);for(let E of Object.getOwnPropertySymbols(b)){var T=b[E];E.description===yE&&(!f||T!==f[E])&&(h[E]&&rn(h[E]),h[E]=Ln(()=>xv(t,()=>T))),_[E]=T}f=_}),g){var m=t;Ku(()=>{rl(m,f.value,!0),tm(m)})}d=!0})}function Cl(t){return t[Bo]??(t[Bo]={[nm]:t.nodeName.includes("-"),[rm]:t.namespaceURI===cp})}var Xh=new Map;function sm(t){var e=t.getAttribute("is")||t.nodeName,n=Xh.get(e);if(n)return n;Xh.set(e,n=[]);for(var r,s=t,a=Element.prototype;a!==s;){r=sp(s);for(var i in r)r[i].set&&i!=="innerHTML"&&i!=="textContent"&&i!=="innerText"&&n.push(i);s=Td(s)}return n}function bt(t,e,n=e){var r=new WeakSet;Ld(t,"input",async s=>{var a=s?t.defaultValue:t.value;if(a=bc(t)?Ec(a):a,n(a),De!==null&&r.add(De),await Wp(),a!==(a=e())){var i=t.selectionStart,u=t.selectionEnd,o=t.value.length;if(t.value=a??"",u!==null){var f=t.value.length;i===u&&u===o&&f>o?(t.selectionStart=f,t.selectionEnd=f):(t.selectionStart=i,t.selectionEnd=Math.min(u,f))}}}),Ca(e)==null&&t.value&&(n(bc(t)?Ec(t.value):t.value),De!==null&&r.add(De)),Il(()=>{var s=e();if(t===document.activeElement){var a=De;if(r.has(a))return}bc(t)&&s===Ec(t.value)||t.type==="date"&&!s&&!t.value||s!==t.value&&(t.value=s??"")})}const gc=new Set;function $v(t,e,n,r,s=r){var a=n.getAttribute("type")==="checkbox",i=t;if(e!==null)for(var u of e)i=i[u]??(i[u]=[]);i.push(n),Ld(n,"change",()=>{var o=n.__value;a&&(o=Yv(i,o,n.checked)),s(o)},()=>s(a?[]:null)),Il(()=>{var o=r();a?(o=o||[],n.checked=o.includes(n.__value)):n.checked=wp(n.__value,o)}),Gu(()=>{var o=i.indexOf(n);o!==-1&&i.splice(o,1)}),gc.has(i)||(gc.add(i),Tr(()=>{i.sort((o,f)=>o.compareDocumentPosition(f)===4?-1:1),gc.delete(i)})),Tr(()=>{})}function Yv(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 bc(t){var e=t.type;return e==="number"||e==="range"}function Ec(t){return t===""?null:+t}var Cs,ci,Yu,_l,am;const Al=class Al{constructor(e){qe(this,_l);qe(this,Cs,new WeakMap);qe(this,ci);qe(this,Yu);je(this,Yu,e)}observe(e,n){var r=W(this,Cs).get(e)||new Set;return r.add(n),W(this,Cs).set(e,r),tt(this,_l,am).call(this).observe(e,W(this,Yu)),()=>{var s=W(this,Cs).get(e);s.delete(n),s.size===0&&(W(this,Cs).delete(e),W(this,ci).unobserve(e))}}};Cs=new WeakMap,ci=new WeakMap,Yu=new WeakMap,_l=new WeakSet,am=function(){return W(this,ci)??je(this,ci,new ResizeObserver(e=>{for(var n of e){Al.entries.set(n.target,n);for(var r of W(this,Cs).get(n.target)||[])r(n)}}))},Ee(Al,"entries",new WeakMap);let ff=Al;var zv=new ff({box:"border-box"});function Wv(t,e,n){var r=zv.observe(t,()=>n(t[e]));Ku(()=>(Ca(()=>n(t[e])),r))}function vc(t,e){return t===e||(t==null?void 0:t[qr])===e}function on(t={},e,n,r){var s=vt.r,a=Ve;return Ku(()=>{var i,u;return Il(()=>{i=u,u=[],Ca(()=>{vc(n(...u),t)||(e(t,...u),i&&vc(n(...i),t)&&e(null,...i))})}),()=>{let o=a;for(;o!==s&&o.parent!==null&&o.parent.f&Vc;)o=o.parent;const f=()=>{u&&vc(n(...u),t)&&e(null,...u)},h=o.teardown;o.teardown=()=>{f(),h==null||h()}}}),t}function im(t=!1){const e=vt,n=e.l.u;if(!n)return;let r=()=>cv(e.s);if(t){let s=0,a={};const i=hi(()=>{let u=!1;const o=e.s;for(const f in o)o[f]!==a[f]&&(a[f]=o[f],u=!0);return u&&s++,s});r=()=>c(i)}n.b.length&&rv(()=>{Qh(e,r),Gc(n.b)}),Dt(()=>{const s=Ca(()=>n.m.map(Xb));return()=>{for(const a of s)typeof a=="function"&&a()}}),n.a.length&&Dt(()=>{Qh(e,r),Gc(n.a)})}function Qh(t,e){if(t.l.s)for(const n of t.l.s)c(n);e()}const Gv={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 ir(t,e,n){return new Proxy({props:t,exclude:e},Gv)}const Kv={get(t,e){let n=t.props.length;for(;n--;){let r=t.props[n];if(Wi(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];Wi(s)&&(s=s());const a=ks(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(Wi(r)&&(r=r()),typeof r=="object"&&r!==null&&e in r){const s=ks(r,e);return s&&!s.configurable&&(s.configurable=!0),s}}},has(t,e){if(e===qr||e===up)return!1;for(let n of t.props)if(Wi(n)&&(n=n()),n!=null&&e in n)return!0;return!1},ownKeys(t){const e=[];for(let n of t.props)if(Wi(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 Sr(...t){return new Proxy({props:t},Kv)}function Jn(t,e,n,r){var B;var s=!Ri||(n&gE)!==0,a=(n&EE)!==0,i=(n&vE)!==0,u=r,o=!0,f=void 0,h=()=>i&&s?(f??(f=hi(r)),c(f)):(o&&(o=!1,u=i?Ca(r):r),u);let g;if(a){var d=qr in t||up in t;g=((B=ks(t,e))==null?void 0:B.set)??(d&&e in t?I=>t[e]=I:void 0)}var m,b=!1;a?[m,b]=PE(()=>t[e]):m=t[e],m===void 0&&r!==void 0&&(m=h(),g&&(s&&iE(),g(m)));var _;if(s?_=()=>{var I=t[e];return I===void 0?h():(o=!0,I)}:_=()=>{var I=t[e];return I!==void 0&&(u=void 0),I===void 0?u:I},s&&(n&bE)===0)return _;if(g){var T=t.$$legacy;return(function(I,H){return arguments.length>0?((!s||!H||T||b)&&g(H?_():I),I):_()})}var E=!1,O=((n&mE)!==0?hi:Cd)(()=>(E=!1,_()));a&&c(O);var L=Ve;return(function(I,H){if(arguments.length>0){const R=H?c(O):s&&a?Et(I):I;return y(O,R),E=!0,u!==void 0&&(u=R),I}return cs&&E||(L.f&rr)!==0?O.v:c(O)})}function wa(t){vt===null&&op(),Ri&&vt.l!==null?Vv(vt).m.push(t):Dt(()=>{const e=Ca(t);if(typeof e=="function")return e})}function Vv(t){var e=t.l;return e.u??(e.u={a:[],b:[],m:[]})}const Xv="5";var np;typeof window<"u"&&((np=window.__svelte??(window.__svelte={})).v??(np.v=new Set)).add(Xv);LE();function os(t){return t.normalize("NFKD").replace(/[̀-ͯ]/g,"").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"")}function kd(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)}class sa extends Error{constructor(e){super(e),this.name="ContentParseError"}}function df(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function hf(t){return t===null||typeof t=="string"||typeof t=="number"||typeof t=="boolean"}function Qv(t){return df(t)&&Object.values(t).every(hf)}function Zv(t,e){if(hf(e))return e;if(Array.isArray(e)){if(e.every(hf)||e.every(Qv))return e;throw new sa(`Field "${t}" array must hold only primitives or only flat records (no nesting).`)}throw new sa(`Field "${t}" must be a primitive or an array, not a bare object.`)}function _o(t,e){const n=t[e];if(n!==void 0){if(typeof n!="string")throw new sa(`"${e}" must be a string when present.`);return n}}function Qu(t){if(!df(t))throw new sa("A content item must be a JSON object.");if(typeof t.title!="string")throw new sa('A content item requires a string "title".');let e=!1;if(t.isPublished!==void 0){if(typeof t.isPublished!="boolean")throw new sa(`"isPublished" must be a boolean when present, got ${JSON.stringify(t.isPublished)}.`);e=t.isPublished}let n={};if(t.fields!==void 0){if(!df(t.fields))throw new sa('"fields" must be an object.');n=Object.fromEntries(Object.entries(t.fields).map(([u,o])=>[u,Zv(u,o)]))}const r=_o(t,"template"),s=_o(t,"created"),a=_o(t,"published"),i=_o(t,"updated");return{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}}}function Zh(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function um(t){if(!Zh(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=Zh(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 om="_sort.json",Jv="_redirects.json",eT="_site.json",tT="assets",Jh=".json",nt={content:"content",templates:"templates",components:"components",public:"public"};function $r(...t){return t.filter(e=>e!=="").join("/")}async function Pd(t,e=nt.content){return lm(t,e,"","")}async function lm(t,e,n,r){const[s,a]=await Promise.all([t.list(e),rT(t,e)]),i=new Map;for(const o of s)if(o.kind==="file"){if(o.name===om||o.name===Jv||o.name===eT||!o.name.endsWith(Jh))continue;const f=o.name.slice(0,-Jh.length);i.set(f,await nT(t,$r(e,o.name),f,r))}else{if(o.name===tT)continue;const f=$r(r,o.name);i.set(o.name,await lm(t,$r(e,o.name),o.name,f))}const u=a.name??(n===""?"":kd(n));return{kind:"dir",slug:n,name:u,path:r,children:sT(i,a.order),...a.collection!==void 0&&{collection:a.collection},...a.defaultTemplate!==void 0&&{defaultTemplate:a.defaultTemplate}}}async function nT(t,e,n,r){const s=await t.readText(e);try{const a=Qu(JSON.parse(s));return{kind:"item",slug:n,path:$r(r,n),item:a}}catch(a){throw new Error(`Failed to load ${e}: ${a.message}`)}}async function rT(t,e){const n=$r(e,om);if(!await t.exists(n))return{order:[]};try{return um(JSON.parse(await t.readText(n)))}catch{return{order:[]}}}function sT(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 Md(t,e=nt.components){return Bd(t,e,"html")}function cm(t,e=nt.components){return Bd(t,e,"css")}function fm(t,e=nt.components){return Bd(t,e,"js")}async function Bd(t,e,n){const r=`.${n}`,s=new Map,a=async i=>{if(await t.exists(i))for(const u of await t.list(i)){const o=$r(i,u.name);if(u.kind==="dir")await a(o);else if(u.name.endsWith(r)){const f=u.name.slice(0,-r.length).toLowerCase();s.set(f,await t.readText(o))}}};return await a(e),s}async function Fd(t,e,n=nt.templates){return t.readText($r(n,`${e}.html`))}function aT(t,e,n=nt.templates){return Hd(t,$r(n,`${e}.css`))}function iT(t,e,n=nt.templates){return Hd(t,$r(n,`${e}.js`))}const Zu="document";function Ud(t,e=nt.templates){return Hd(t,$r(e,`${Zu}.html`))}async function Hd(t,e){try{return await t.readText(e)}catch{return}}const qd={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 uT(t){return Object.prototype.hasOwnProperty.call(qd,t)}function jd(t){return qd[t].valueKind}const oT=new Set(["h1","h2","h3","h4","h5","h6","title","label","th","caption","figcaption","legend","summary","option","dt","button"]),lT=new Set(["code","pre","kbd","samp"]),cT=new Set(["p","span","li","td","dd","strong","em","b","i","small","time","a","figcaption","div","article","section","main","aside","blockquote"]);function vi(t){if(t.annotation!==void 0&&uT(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 lT.has(t.tag)?"code":oT.has(t.tag)?"shorttext":cT.has(t.tag)?"text":"shorttext"}const fT=/\{([A-Za-z_]\w*(?:\.[A-Za-z_]\w*)*)\}/g;function Hs(t){const e=[];for(const n of t.matchAll(fT)){const s=(n[1]??"").split(".");e.push({raw:n[0],name:s[0]??"",path:s,dotted:s.length>1})}return e}function Ti(t){var r;const e=t.trim(),n=Hs(e);return n.length===1&&((r=n[0])==null?void 0:r.raw)===e?n[0]:null}function wl(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 $d(t){const e=t.indexOf("{");return(e===-1?t:t.slice(0,e)).toLowerCase()}function dT(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function Tc(t){return t.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function hT(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 pT(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 mT(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 gT(t,e){const n=pT(t).map(r=>{const s=r.user!==void 0?e==null?void 0:e(r.user):void 0;return dT((s==null?void 0:s.displayName)??r.name)});return mT(n)}const bT=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]),St="�";var N;(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"})(N||(N={}));const Sn={DASH_DASH:"--",CDATA_START:"[CDATA[",DOCTYPE:"doctype",SCRIPT:"script",PUBLIC:"public",SYSTEM:"system"};function dm(t){return t>=55296&&t<=57343}function ET(t){return t>=56320&&t<=57343}function vT(t,e){return(t-55296)*1024+9216+e}function hm(t){return t!==32&&t!==10&&t!==13&&t!==9&&t!==12&&t>=1&&t<=31||t>=127&&t<=159}function pm(t){return t>=64976&&t<=65007||bT.has(t)}var te;(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"})(te||(te={}));const TT=65536;class _T{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=TT,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,u=a+n;return{code:e,startLine:r,endLine:r,startCol:i,endCol:i,startOffset:u,endOffset:u}}_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(ET(n))return this.pos++,this._addGap(),vT(e,n)}else if(!this.lastChunkWritten)return this.endOfChunkHit=!0,N.EOF;return this._err(te.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,N.EOF;const r=this.html.charCodeAt(n);return r===N.CARRIAGE_RETURN?N.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,N.EOF;let e=this.html.charCodeAt(this.pos);return e===N.CARRIAGE_RETURN?(this.isEol=!0,this.skipNextNewLine=!0,N.LINE_FEED):e===N.LINE_FEED&&(this.isEol=!0,this.skipNextNewLine)?(this.line--,this.skipNextNewLine=!1,this._addGap(),this.advance()):(this.skipNextNewLine=!1,dm(e)&&(e=this._processSurrogate(e)),this.handler.onParseError===null||e>31&&e<127||e===N.LINE_FEED||e===N.CARRIAGE_RETURN||e>159&&e<64976||this._checkForProblematicCharacters(e),e)}_checkForProblematicCharacters(e){hm(e)?this._err(te.controlCharacterInInputStream):pm(e)&&this._err(te.noncharacterInInputStream)}retreat(e){for(this.pos-=e;this.pos<this.lastGapPos;)this.lastGapPos=this.gapStack.pop(),this.pos--;this.isEol=!1}}var at;(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"})(at||(at={}));function mm(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 AT=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୕ୖ୪୼஡௫ఄ౞಄ದ೘ൡඅ櫬Āou୛୤ngruent;扢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;怳Ādp໩໮uct;戏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ǣጓ\0጖y;䐎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Ā;t፜᜷brk;掶Āoyᜁᝁ;䐱quo;怞ʀcmprtᝓ᝛ᝡᝤᝨausĀ;eĊĉptyv;榰séᜌnoõēƀahwᝯ᝱ᝳ;䎲;愶een;扬r;쀀𝔟g΀costuvwឍឝឳេ៕៛៞ƀ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Ā;e᜚᜜lƀ;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\0᫢aĀ;t᫞᫟䀬;䁀ƀ;fl᫨᫩᫫戁îᅠeĀmx᫱᫶ent»᫩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ↄⅪ←ٖ↛ǰ↉\0↎proø₞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;䅓Ācr⵩⵭ir;榿;쀀𝔬ͯ⵹\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\0⹻m;櫳;櫽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))),yT=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 NT(t){var e;return t>=55296&&t<=57343||t>1114111?65533:(e=yT.get(t))!==null&&e!==void 0?e:t}var Vt;(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"})(Vt||(Vt={}));const ST=32;var Ls;(function(t){t[t.VALUE_LENGTH=49152]="VALUE_LENGTH",t[t.BRANCH_LENGTH=16256]="BRANCH_LENGTH",t[t.JUMP_TABLE=127]="JUMP_TABLE"})(Ls||(Ls={}));function pf(t){return t>=Vt.ZERO&&t<=Vt.NINE}function IT(t){return t>=Vt.UPPER_A&&t<=Vt.UPPER_F||t>=Vt.LOWER_A&&t<=Vt.LOWER_F}function CT(t){return t>=Vt.UPPER_A&&t<=Vt.UPPER_Z||t>=Vt.LOWER_A&&t<=Vt.LOWER_Z||pf(t)}function wT(t){return t===Vt.EQUALS||CT(t)}var Kt;(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"})(Kt||(Kt={}));var us;(function(t){t[t.Legacy=0]="Legacy",t[t.Strict=1]="Strict",t[t.Attribute=2]="Attribute"})(us||(us={}));class LT{constructor(e,n,r){this.decodeTree=e,this.emitCodePoint=n,this.errors=r,this.state=Kt.EntityStart,this.consumed=1,this.result=0,this.treeIndex=0,this.excess=1,this.decodeMode=us.Strict}startEntity(e){this.decodeMode=e,this.state=Kt.EntityStart,this.result=0,this.treeIndex=0,this.excess=1,this.consumed=1}write(e,n){switch(this.state){case Kt.EntityStart:return e.charCodeAt(n)===Vt.NUM?(this.state=Kt.NumericStart,this.consumed+=1,this.stateNumericStart(e,n+1)):(this.state=Kt.NamedEntity,this.stateNamedEntity(e,n));case Kt.NumericStart:return this.stateNumericStart(e,n);case Kt.NumericDecimal:return this.stateNumericDecimal(e,n);case Kt.NumericHex:return this.stateNumericHex(e,n);case Kt.NamedEntity:return this.stateNamedEntity(e,n)}}stateNumericStart(e,n){return n>=e.length?-1:(e.charCodeAt(n)|ST)===Vt.LOWER_X?(this.state=Kt.NumericHex,this.consumed+=1,this.stateNumericHex(e,n+1)):(this.state=Kt.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(pf(s)||IT(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(pf(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===Vt.SEMI)this.consumed+=1;else if(this.decodeMode===us.Strict)return 0;return this.emitCodePoint(NT(this.result),this.consumed),this.errors&&(e!==Vt.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&Ls.VALUE_LENGTH)>>14;for(;n<e.length;n++,this.excess++){const i=e.charCodeAt(n);if(this.treeIndex=OT(r,s,this.treeIndex+Math.max(1,a),i),this.treeIndex<0)return this.result===0||this.decodeMode===us.Attribute&&(a===0||wT(i))?0:this.emitNotTerminatedNamedEntity();if(s=r[this.treeIndex],a=(s&Ls.VALUE_LENGTH)>>14,a!==0){if(i===Vt.SEMI)return this.emitNamedEntityData(this.treeIndex,a,this.consumed+this.excess);this.decodeMode!==us.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]&Ls.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]&~Ls.VALUE_LENGTH:s[e+1],r),n===3&&this.emitCodePoint(s[e+2],r),r}end(){var e;switch(this.state){case Kt.NamedEntity:return this.result!==0&&(this.decodeMode!==us.Attribute||this.result===this.treeIndex)?this.emitNotTerminatedNamedEntity():0;case Kt.NumericDecimal:return this.emitNumericEntity(0,2);case Kt.NumericHex:return this.emitNumericEntity(0,3);case Kt.NumericStart:return(e=this.errors)===null||e===void 0||e.absenceOfDigitsInNumericCharacterReference(this.consumed),0;case Kt.EntityStart:return 0}}}function OT(t,e,n,r){const s=(e&Ls.BRANCH_LENGTH)>>7,a=e&Ls.JUMP_TABLE;if(s===0)return a!==0&&r===a?n:-1;if(a){const o=r-a;return o<0||o>=s?-1:t[n+o]-1}let i=n,u=i+s-1;for(;i<=u;){const o=i+u>>>1,f=t[o];if(f<r)i=o+1;else if(f>r)u=o-1;else return t[o+s]}return-1}var ie;(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/"})(ie||(ie={}));var ma;(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"})(ma||(ma={}));var Xn;(function(t){t.NO_QUIRKS="no-quirks",t.QUIRKS="quirks",t.LIMITED_QUIRKS="limited-quirks"})(Xn||(Xn={}));var K;(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"})(K||(K={}));var l;(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"})(l||(l={}));const RT=new Map([[K.A,l.A],[K.ADDRESS,l.ADDRESS],[K.ANNOTATION_XML,l.ANNOTATION_XML],[K.APPLET,l.APPLET],[K.AREA,l.AREA],[K.ARTICLE,l.ARTICLE],[K.ASIDE,l.ASIDE],[K.B,l.B],[K.BASE,l.BASE],[K.BASEFONT,l.BASEFONT],[K.BGSOUND,l.BGSOUND],[K.BIG,l.BIG],[K.BLOCKQUOTE,l.BLOCKQUOTE],[K.BODY,l.BODY],[K.BR,l.BR],[K.BUTTON,l.BUTTON],[K.CAPTION,l.CAPTION],[K.CENTER,l.CENTER],[K.CODE,l.CODE],[K.COL,l.COL],[K.COLGROUP,l.COLGROUP],[K.DD,l.DD],[K.DESC,l.DESC],[K.DETAILS,l.DETAILS],[K.DIALOG,l.DIALOG],[K.DIR,l.DIR],[K.DIV,l.DIV],[K.DL,l.DL],[K.DT,l.DT],[K.EM,l.EM],[K.EMBED,l.EMBED],[K.FIELDSET,l.FIELDSET],[K.FIGCAPTION,l.FIGCAPTION],[K.FIGURE,l.FIGURE],[K.FONT,l.FONT],[K.FOOTER,l.FOOTER],[K.FOREIGN_OBJECT,l.FOREIGN_OBJECT],[K.FORM,l.FORM],[K.FRAME,l.FRAME],[K.FRAMESET,l.FRAMESET],[K.H1,l.H1],[K.H2,l.H2],[K.H3,l.H3],[K.H4,l.H4],[K.H5,l.H5],[K.H6,l.H6],[K.HEAD,l.HEAD],[K.HEADER,l.HEADER],[K.HGROUP,l.HGROUP],[K.HR,l.HR],[K.HTML,l.HTML],[K.I,l.I],[K.IMG,l.IMG],[K.IMAGE,l.IMAGE],[K.INPUT,l.INPUT],[K.IFRAME,l.IFRAME],[K.KEYGEN,l.KEYGEN],[K.LABEL,l.LABEL],[K.LI,l.LI],[K.LINK,l.LINK],[K.LISTING,l.LISTING],[K.MAIN,l.MAIN],[K.MALIGNMARK,l.MALIGNMARK],[K.MARQUEE,l.MARQUEE],[K.MATH,l.MATH],[K.MENU,l.MENU],[K.META,l.META],[K.MGLYPH,l.MGLYPH],[K.MI,l.MI],[K.MO,l.MO],[K.MN,l.MN],[K.MS,l.MS],[K.MTEXT,l.MTEXT],[K.NAV,l.NAV],[K.NOBR,l.NOBR],[K.NOFRAMES,l.NOFRAMES],[K.NOEMBED,l.NOEMBED],[K.NOSCRIPT,l.NOSCRIPT],[K.OBJECT,l.OBJECT],[K.OL,l.OL],[K.OPTGROUP,l.OPTGROUP],[K.OPTION,l.OPTION],[K.P,l.P],[K.PARAM,l.PARAM],[K.PLAINTEXT,l.PLAINTEXT],[K.PRE,l.PRE],[K.RB,l.RB],[K.RP,l.RP],[K.RT,l.RT],[K.RTC,l.RTC],[K.RUBY,l.RUBY],[K.S,l.S],[K.SCRIPT,l.SCRIPT],[K.SEARCH,l.SEARCH],[K.SECTION,l.SECTION],[K.SELECT,l.SELECT],[K.SOURCE,l.SOURCE],[K.SMALL,l.SMALL],[K.SPAN,l.SPAN],[K.STRIKE,l.STRIKE],[K.STRONG,l.STRONG],[K.STYLE,l.STYLE],[K.SUB,l.SUB],[K.SUMMARY,l.SUMMARY],[K.SUP,l.SUP],[K.TABLE,l.TABLE],[K.TBODY,l.TBODY],[K.TEMPLATE,l.TEMPLATE],[K.TEXTAREA,l.TEXTAREA],[K.TFOOT,l.TFOOT],[K.TD,l.TD],[K.TH,l.TH],[K.THEAD,l.THEAD],[K.TITLE,l.TITLE],[K.TR,l.TR],[K.TRACK,l.TRACK],[K.TT,l.TT],[K.U,l.U],[K.UL,l.UL],[K.SVG,l.SVG],[K.VAR,l.VAR],[K.WBR,l.WBR],[K.XMP,l.XMP]]);function Ll(t){var e;return(e=RT.get(t))!==null&&e!==void 0?e:l.UNKNOWN}const fe=l,xT={[ie.HTML]:new Set([fe.ADDRESS,fe.APPLET,fe.AREA,fe.ARTICLE,fe.ASIDE,fe.BASE,fe.BASEFONT,fe.BGSOUND,fe.BLOCKQUOTE,fe.BODY,fe.BR,fe.BUTTON,fe.CAPTION,fe.CENTER,fe.COL,fe.COLGROUP,fe.DD,fe.DETAILS,fe.DIR,fe.DIV,fe.DL,fe.DT,fe.EMBED,fe.FIELDSET,fe.FIGCAPTION,fe.FIGURE,fe.FOOTER,fe.FORM,fe.FRAME,fe.FRAMESET,fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6,fe.HEAD,fe.HEADER,fe.HGROUP,fe.HR,fe.HTML,fe.IFRAME,fe.IMG,fe.INPUT,fe.LI,fe.LINK,fe.LISTING,fe.MAIN,fe.MARQUEE,fe.MENU,fe.META,fe.NAV,fe.NOEMBED,fe.NOFRAMES,fe.NOSCRIPT,fe.OBJECT,fe.OL,fe.P,fe.PARAM,fe.PLAINTEXT,fe.PRE,fe.SCRIPT,fe.SECTION,fe.SELECT,fe.SOURCE,fe.STYLE,fe.SUMMARY,fe.TABLE,fe.TBODY,fe.TD,fe.TEMPLATE,fe.TEXTAREA,fe.TFOOT,fe.TH,fe.THEAD,fe.TITLE,fe.TR,fe.TRACK,fe.UL,fe.WBR,fe.XMP]),[ie.MATHML]:new Set([fe.MI,fe.MO,fe.MN,fe.MS,fe.MTEXT,fe.ANNOTATION_XML]),[ie.SVG]:new Set([fe.TITLE,fe.FOREIGN_OBJECT,fe.DESC]),[ie.XLINK]:new Set,[ie.XML]:new Set,[ie.XMLNS]:new Set},mf=new Set([fe.H1,fe.H2,fe.H3,fe.H4,fe.H5,fe.H6]),DT=new Set([K.STYLE,K.SCRIPT,K.XMP,K.IFRAME,K.NOEMBED,K.NOFRAMES,K.PLAINTEXT]);function kT(t,e){return DT.has(t)||e&&t===K.NOSCRIPT}var w;(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"})(w||(w={}));const Rn={DATA:w.DATA,RCDATA:w.RCDATA,RAWTEXT:w.RAWTEXT,SCRIPT_DATA:w.SCRIPT_DATA,PLAINTEXT:w.PLAINTEXT,CDATA_SECTION:w.CDATA_SECTION};function PT(t){return t>=N.DIGIT_0&&t<=N.DIGIT_9}function su(t){return t>=N.LATIN_CAPITAL_A&&t<=N.LATIN_CAPITAL_Z}function MT(t){return t>=N.LATIN_SMALL_A&&t<=N.LATIN_SMALL_Z}function vs(t){return MT(t)||su(t)}function e0(t){return vs(t)||PT(t)}function Ao(t){return t+32}function gm(t){return t===N.SPACE||t===N.LINE_FEED||t===N.TABULATION||t===N.FORM_FEED}function t0(t){return gm(t)||t===N.SOLIDUS||t===N.GREATER_THAN_SIGN}function BT(t){return t===N.NULL?te.nullCharacterReference:t>1114111?te.characterReferenceOutsideUnicodeRange:dm(t)?te.surrogateCharacterReference:pm(t)?te.noncharacterCharacterReference:hm(t)||t===N.CARRIAGE_RETURN?te.controlCharacterReference:null}class FT{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=w.DATA,this.returnState=w.DATA,this.entityStartPos=0,this.consumedAfterSnapshot=-1,this.currentCharacterToken=null,this.currentToken=null,this.currentAttr={name:"",value:""},this.preprocessor=new _T(n),this.currentLocation=this.getCurrentLocation(-1),this.entityDecoder=new LT(AT,(r,s)=>{this.preprocessor.pos=this.entityStartPos+s-1,this._flushCodePointConsumedAsCharacterReference(r)},n.onParseError?{missingSemicolonAfterCharacterReference:()=>{this._err(te.missingSemicolonAfterCharacterReference,1)},absenceOfDigitsInNumericCharacterReference:r=>{this._err(te.absenceOfDigitsInNumericCharacterReference,this.entityStartPos-this.preprocessor.pos+r)},validateNumericCharacterReference:r=>{const s=BT(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:at.START_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(1)}}_createEndTagToken(){this.currentToken={type:at.END_TAG,tagName:"",tagID:l.UNKNOWN,selfClosing:!1,ackSelfClosing:!1,attrs:[],location:this.getCurrentLocation(2)}}_createCommentToken(e){this.currentToken={type:at.COMMENT,data:"",location:this.getCurrentLocation(e)}}_createDoctypeToken(e){this.currentToken={type:at.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(mm(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(te.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=Ll(e.tagName),e.type===at.START_TAG?(this.lastStartTagName=e.tagName,this.handler.onStartTag(e)):(e.attrs.length>0&&this._err(te.endTagWithAttributes),e.selfClosing&&this._err(te.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 at.CHARACTER:{this.handler.onCharacter(this.currentCharacterToken);break}case at.NULL_CHARACTER:{this.handler.onNullCharacter(this.currentCharacterToken);break}case at.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:at.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=gm(e)?at.WHITESPACE_CHARACTER:e===N.NULL?at.NULL_CHARACTER:at.CHARACTER;this._appendCharToCurrentCharacterToken(n,String.fromCodePoint(e))}_emitChars(e){this._appendCharToCurrentCharacterToken(at.CHARACTER,e)}_startCharacterReference(){this.returnState=this.state,this.state=w.CHARACTER_REFERENCE,this.entityStartPos=this.preprocessor.pos,this.entityDecoder.startEntity(this._isCharacterReferenceInAttribute()?us.Attribute:us.Legacy)}_isCharacterReferenceInAttribute(){return this.returnState===w.ATTRIBUTE_VALUE_DOUBLE_QUOTED||this.returnState===w.ATTRIBUTE_VALUE_SINGLE_QUOTED||this.returnState===w.ATTRIBUTE_VALUE_UNQUOTED}_flushCodePointConsumedAsCharacterReference(e){this._isCharacterReferenceInAttribute()?this.currentAttr.value+=String.fromCodePoint(e):this._emitCodePoint(e)}_callState(e){switch(this.state){case w.DATA:{this._stateData(e);break}case w.RCDATA:{this._stateRcdata(e);break}case w.RAWTEXT:{this._stateRawtext(e);break}case w.SCRIPT_DATA:{this._stateScriptData(e);break}case w.PLAINTEXT:{this._statePlaintext(e);break}case w.TAG_OPEN:{this._stateTagOpen(e);break}case w.END_TAG_OPEN:{this._stateEndTagOpen(e);break}case w.TAG_NAME:{this._stateTagName(e);break}case w.RCDATA_LESS_THAN_SIGN:{this._stateRcdataLessThanSign(e);break}case w.RCDATA_END_TAG_OPEN:{this._stateRcdataEndTagOpen(e);break}case w.RCDATA_END_TAG_NAME:{this._stateRcdataEndTagName(e);break}case w.RAWTEXT_LESS_THAN_SIGN:{this._stateRawtextLessThanSign(e);break}case w.RAWTEXT_END_TAG_OPEN:{this._stateRawtextEndTagOpen(e);break}case w.RAWTEXT_END_TAG_NAME:{this._stateRawtextEndTagName(e);break}case w.SCRIPT_DATA_LESS_THAN_SIGN:{this._stateScriptDataLessThanSign(e);break}case w.SCRIPT_DATA_END_TAG_OPEN:{this._stateScriptDataEndTagOpen(e);break}case w.SCRIPT_DATA_END_TAG_NAME:{this._stateScriptDataEndTagName(e);break}case w.SCRIPT_DATA_ESCAPE_START:{this._stateScriptDataEscapeStart(e);break}case w.SCRIPT_DATA_ESCAPE_START_DASH:{this._stateScriptDataEscapeStartDash(e);break}case w.SCRIPT_DATA_ESCAPED:{this._stateScriptDataEscaped(e);break}case w.SCRIPT_DATA_ESCAPED_DASH:{this._stateScriptDataEscapedDash(e);break}case w.SCRIPT_DATA_ESCAPED_DASH_DASH:{this._stateScriptDataEscapedDashDash(e);break}case w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataEscapedLessThanSign(e);break}case w.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:{this._stateScriptDataEscapedEndTagOpen(e);break}case w.SCRIPT_DATA_ESCAPED_END_TAG_NAME:{this._stateScriptDataEscapedEndTagName(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPE_START:{this._stateScriptDataDoubleEscapeStart(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED:{this._stateScriptDataDoubleEscaped(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH:{this._stateScriptDataDoubleEscapedDash(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH:{this._stateScriptDataDoubleEscapedDashDash(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN:{this._stateScriptDataDoubleEscapedLessThanSign(e);break}case w.SCRIPT_DATA_DOUBLE_ESCAPE_END:{this._stateScriptDataDoubleEscapeEnd(e);break}case w.BEFORE_ATTRIBUTE_NAME:{this._stateBeforeAttributeName(e);break}case w.ATTRIBUTE_NAME:{this._stateAttributeName(e);break}case w.AFTER_ATTRIBUTE_NAME:{this._stateAfterAttributeName(e);break}case w.BEFORE_ATTRIBUTE_VALUE:{this._stateBeforeAttributeValue(e);break}case w.ATTRIBUTE_VALUE_DOUBLE_QUOTED:{this._stateAttributeValueDoubleQuoted(e);break}case w.ATTRIBUTE_VALUE_SINGLE_QUOTED:{this._stateAttributeValueSingleQuoted(e);break}case w.ATTRIBUTE_VALUE_UNQUOTED:{this._stateAttributeValueUnquoted(e);break}case w.AFTER_ATTRIBUTE_VALUE_QUOTED:{this._stateAfterAttributeValueQuoted(e);break}case w.SELF_CLOSING_START_TAG:{this._stateSelfClosingStartTag(e);break}case w.BOGUS_COMMENT:{this._stateBogusComment(e);break}case w.MARKUP_DECLARATION_OPEN:{this._stateMarkupDeclarationOpen(e);break}case w.COMMENT_START:{this._stateCommentStart(e);break}case w.COMMENT_START_DASH:{this._stateCommentStartDash(e);break}case w.COMMENT:{this._stateComment(e);break}case w.COMMENT_LESS_THAN_SIGN:{this._stateCommentLessThanSign(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG:{this._stateCommentLessThanSignBang(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG_DASH:{this._stateCommentLessThanSignBangDash(e);break}case w.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:{this._stateCommentLessThanSignBangDashDash(e);break}case w.COMMENT_END_DASH:{this._stateCommentEndDash(e);break}case w.COMMENT_END:{this._stateCommentEnd(e);break}case w.COMMENT_END_BANG:{this._stateCommentEndBang(e);break}case w.DOCTYPE:{this._stateDoctype(e);break}case w.BEFORE_DOCTYPE_NAME:{this._stateBeforeDoctypeName(e);break}case w.DOCTYPE_NAME:{this._stateDoctypeName(e);break}case w.AFTER_DOCTYPE_NAME:{this._stateAfterDoctypeName(e);break}case w.AFTER_DOCTYPE_PUBLIC_KEYWORD:{this._stateAfterDoctypePublicKeyword(e);break}case w.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateBeforeDoctypePublicIdentifier(e);break}case w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypePublicIdentifierDoubleQuoted(e);break}case w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypePublicIdentifierSingleQuoted(e);break}case w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER:{this._stateAfterDoctypePublicIdentifier(e);break}case w.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS:{this._stateBetweenDoctypePublicAndSystemIdentifiers(e);break}case w.AFTER_DOCTYPE_SYSTEM_KEYWORD:{this._stateAfterDoctypeSystemKeyword(e);break}case w.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateBeforeDoctypeSystemIdentifier(e);break}case w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED:{this._stateDoctypeSystemIdentifierDoubleQuoted(e);break}case w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED:{this._stateDoctypeSystemIdentifierSingleQuoted(e);break}case w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER:{this._stateAfterDoctypeSystemIdentifier(e);break}case w.BOGUS_DOCTYPE:{this._stateBogusDoctype(e);break}case w.CDATA_SECTION:{this._stateCdataSection(e);break}case w.CDATA_SECTION_BRACKET:{this._stateCdataSectionBracket(e);break}case w.CDATA_SECTION_END:{this._stateCdataSectionEnd(e);break}case w.CHARACTER_REFERENCE:{this._stateCharacterReference();break}case w.AMBIGUOUS_AMPERSAND:{this._stateAmbiguousAmpersand(e);break}default:throw new Error("Unknown state")}}_stateData(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.TAG_OPEN;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitCodePoint(e);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRcdata(e){switch(e){case N.AMPERSAND:{this._startCharacterReference();break}case N.LESS_THAN_SIGN:{this.state=w.RCDATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(St);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateRawtext(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.RAWTEXT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(St);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptData(e){switch(e){case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(St);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_statePlaintext(e){switch(e){case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(St);break}case N.EOF:{this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateTagOpen(e){if(vs(e))this._createStartTagToken(),this.state=w.TAG_NAME,this._stateTagName(e);else switch(e){case N.EXCLAMATION_MARK:{this.state=w.MARKUP_DECLARATION_OPEN;break}case N.SOLIDUS:{this.state=w.END_TAG_OPEN;break}case N.QUESTION_MARK:{this._err(te.unexpectedQuestionMarkInsteadOfTagName),this._createCommentToken(1),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e);break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("<"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._emitChars("<"),this.state=w.DATA,this._stateData(e)}}_stateEndTagOpen(e){if(vs(e))this._createEndTagToken(),this.state=w.TAG_NAME,this._stateTagName(e);else switch(e){case N.GREATER_THAN_SIGN:{this._err(te.missingEndTagName),this.state=w.DATA;break}case N.EOF:{this._err(te.eofBeforeTagName),this._emitChars("</"),this._emitEOFToken();break}default:this._err(te.invalidFirstCharacterOfTagName),this._createCommentToken(2),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e)}}_stateTagName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this.state=w.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.tagName+=St;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:n.tagName+=String.fromCodePoint(su(e)?Ao(e):e)}}_stateRcdataLessThanSign(e){e===N.SOLIDUS?this.state=w.RCDATA_END_TAG_OPEN:(this._emitChars("<"),this.state=w.RCDATA,this._stateRcdata(e))}_stateRcdataEndTagOpen(e){vs(e)?(this.state=w.RCDATA_END_TAG_NAME,this._stateRcdataEndTagName(e)):(this._emitChars("</"),this.state=w.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:return this._advanceBy(this.lastStartTagName.length),this.state=w.BEFORE_ATTRIBUTE_NAME,!1;case N.SOLIDUS:return this._advanceBy(this.lastStartTagName.length),this.state=w.SELF_CLOSING_START_TAG,!1;case N.GREATER_THAN_SIGN:return this._advanceBy(this.lastStartTagName.length),this.emitCurrentTagToken(),this.state=w.DATA,!1;default:return!this._ensureHibernation()}}_stateRcdataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.RCDATA,this._stateRcdata(e))}_stateRawtextLessThanSign(e){e===N.SOLIDUS?this.state=w.RAWTEXT_END_TAG_OPEN:(this._emitChars("<"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagOpen(e){vs(e)?(this.state=w.RAWTEXT_END_TAG_NAME,this._stateRawtextEndTagName(e)):(this._emitChars("</"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateRawtextEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.RAWTEXT,this._stateRawtext(e))}_stateScriptDataLessThanSign(e){switch(e){case N.SOLIDUS:{this.state=w.SCRIPT_DATA_END_TAG_OPEN;break}case N.EXCLAMATION_MARK:{this.state=w.SCRIPT_DATA_ESCAPE_START,this._emitChars("<!");break}default:this._emitChars("<"),this.state=w.SCRIPT_DATA,this._stateScriptData(e)}}_stateScriptDataEndTagOpen(e){vs(e)?(this.state=w.SCRIPT_DATA_END_TAG_NAME,this._stateScriptDataEndTagName(e)):(this._emitChars("</"),this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStart(e){e===N.HYPHEN_MINUS?(this.state=w.SCRIPT_DATA_ESCAPE_START_DASH,this._emitChars("-")):(this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscapeStartDash(e){e===N.HYPHEN_MINUS?(this.state=w.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-")):(this.state=w.SCRIPT_DATA,this._stateScriptData(e))}_stateScriptDataEscaped(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(St);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataEscapedDash(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_ESCAPED,this._emitChars(St);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedDashDash(e){switch(e){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN;break}case N.GREATER_THAN_SIGN:{this.state=w.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_ESCAPED,this._emitChars(St);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataEscapedLessThanSign(e){e===N.SOLIDUS?this.state=w.SCRIPT_DATA_ESCAPED_END_TAG_OPEN:vs(e)?(this._emitChars("<"),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPE_START,this._stateScriptDataDoubleEscapeStart(e)):(this._emitChars("<"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagOpen(e){vs(e)?(this.state=w.SCRIPT_DATA_ESCAPED_END_TAG_NAME,this._stateScriptDataEscapedEndTagName(e)):(this._emitChars("</"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataEscapedEndTagName(e){this.handleSpecialEndTag(e)&&(this._emitChars("</"),this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscapeStart(e){if(this.preprocessor.startsWith(Sn.SCRIPT,!1)&&t0(this.preprocessor.peek(Sn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Sn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED}else this._ensureHibernation()||(this.state=w.SCRIPT_DATA_ESCAPED,this._stateScriptDataEscaped(e))}_stateScriptDataDoubleEscaped(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this._emitChars(St);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDash(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(St);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedDashDash(e){switch(e){case N.HYPHEN_MINUS:{this._emitChars("-");break}case N.LESS_THAN_SIGN:{this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,this._emitChars("<");break}case N.GREATER_THAN_SIGN:{this.state=w.SCRIPT_DATA,this._emitChars(">");break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitChars(St);break}case N.EOF:{this._err(te.eofInScriptHtmlCommentLikeText),this._emitEOFToken();break}default:this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._emitCodePoint(e)}}_stateScriptDataDoubleEscapedLessThanSign(e){e===N.SOLIDUS?(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPE_END,this._emitChars("/")):(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateScriptDataDoubleEscapeEnd(e){if(this.preprocessor.startsWith(Sn.SCRIPT,!1)&&t0(this.preprocessor.peek(Sn.SCRIPT.length))){this._emitCodePoint(e);for(let n=0;n<Sn.SCRIPT.length;n++)this._emitCodePoint(this._consume());this.state=w.SCRIPT_DATA_ESCAPED}else this._ensureHibernation()||(this.state=w.SCRIPT_DATA_DOUBLE_ESCAPED,this._stateScriptDataDoubleEscaped(e))}_stateBeforeAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this.state=w.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case N.EQUALS_SIGN:{this._err(te.unexpectedEqualsSignBeforeAttributeName),this._createAttr("="),this.state=w.ATTRIBUTE_NAME;break}default:this._createAttr(""),this.state=w.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:case N.SOLIDUS:case N.GREATER_THAN_SIGN:case N.EOF:{this._leaveAttrName(),this.state=w.AFTER_ATTRIBUTE_NAME,this._stateAfterAttributeName(e);break}case N.EQUALS_SIGN:{this._leaveAttrName(),this.state=w.BEFORE_ATTRIBUTE_VALUE;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:{this._err(te.unexpectedCharacterInAttributeName),this.currentAttr.name+=String.fromCodePoint(e);break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.name+=St;break}default:this.currentAttr.name+=String.fromCodePoint(su(e)?Ao(e):e)}}_stateAfterAttributeName(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.SOLIDUS:{this.state=w.SELF_CLOSING_START_TAG;break}case N.EQUALS_SIGN:{this.state=w.BEFORE_ATTRIBUTE_VALUE;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._createAttr(""),this.state=w.ATTRIBUTE_NAME,this._stateAttributeName(e)}}_stateBeforeAttributeValue(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{this.state=w.ATTRIBUTE_VALUE_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this.state=w.ATTRIBUTE_VALUE_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingAttributeValue),this.state=w.DATA,this.emitCurrentTagToken();break}default:this.state=w.ATTRIBUTE_VALUE_UNQUOTED,this._stateAttributeValueUnquoted(e)}}_stateAttributeValueDoubleQuoted(e){switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=St;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueSingleQuoted(e){switch(e){case N.APOSTROPHE:{this.state=w.AFTER_ATTRIBUTE_VALUE_QUOTED;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=St;break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAttributeValueUnquoted(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.AMPERSAND:{this._startCharacterReference();break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=w.DATA,this.emitCurrentTagToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),this.currentAttr.value+=St;break}case N.QUOTATION_MARK:case N.APOSTROPHE:case N.LESS_THAN_SIGN:case N.EQUALS_SIGN:case N.GRAVE_ACCENT:{this._err(te.unexpectedCharacterInUnquotedAttributeValue),this.currentAttr.value+=String.fromCodePoint(e);break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this.currentAttr.value+=String.fromCodePoint(e)}}_stateAfterAttributeValueQuoted(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this._leaveAttrValue(),this.state=w.BEFORE_ATTRIBUTE_NAME;break}case N.SOLIDUS:{this._leaveAttrValue(),this.state=w.SELF_CLOSING_START_TAG;break}case N.GREATER_THAN_SIGN:{this._leaveAttrValue(),this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBetweenAttributes),this.state=w.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateSelfClosingStartTag(e){switch(e){case N.GREATER_THAN_SIGN:{const n=this.currentToken;n.selfClosing=!0,this.state=w.DATA,this.emitCurrentTagToken();break}case N.EOF:{this._err(te.eofInTag),this._emitEOFToken();break}default:this._err(te.unexpectedSolidusInTag),this.state=w.BEFORE_ATTRIBUTE_NAME,this._stateBeforeAttributeName(e)}}_stateBogusComment(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this.emitCurrentComment(n),this._emitEOFToken();break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=St;break}default:n.data+=String.fromCodePoint(e)}}_stateMarkupDeclarationOpen(e){this._consumeSequenceIfMatch(Sn.DASH_DASH,!0)?(this._createCommentToken(Sn.DASH_DASH.length+1),this.state=w.COMMENT_START):this._consumeSequenceIfMatch(Sn.DOCTYPE,!1)?(this.currentLocation=this.getCurrentLocation(Sn.DOCTYPE.length+1),this.state=w.DOCTYPE):this._consumeSequenceIfMatch(Sn.CDATA_START,!0)?this.inForeignNode?this.state=w.CDATA_SECTION:(this._err(te.cdataInHtmlContent),this._createCommentToken(Sn.CDATA_START.length+1),this.currentToken.data="[CDATA[",this.state=w.BOGUS_COMMENT):this._ensureHibernation()||(this._err(te.incorrectlyOpenedComment),this._createCommentToken(2),this.state=w.BOGUS_COMMENT,this._stateBogusComment(e))}_stateCommentStart(e){switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_START_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=w.DATA;const n=this.currentToken;this.emitCurrentComment(n);break}default:this.state=w.COMMENT,this._stateComment(e)}}_stateCommentStartDash(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptClosingOfEmptyComment),this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=w.COMMENT,this._stateComment(e)}}_stateComment(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END_DASH;break}case N.LESS_THAN_SIGN:{n.data+="<",this.state=w.COMMENT_LESS_THAN_SIGN;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.data+=St;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+=String.fromCodePoint(e)}}_stateCommentLessThanSign(e){const n=this.currentToken;switch(e){case N.EXCLAMATION_MARK:{n.data+="!",this.state=w.COMMENT_LESS_THAN_SIGN_BANG;break}case N.LESS_THAN_SIGN:{n.data+="<";break}default:this.state=w.COMMENT,this._stateComment(e)}}_stateCommentLessThanSignBang(e){e===N.HYPHEN_MINUS?this.state=w.COMMENT_LESS_THAN_SIGN_BANG_DASH:(this.state=w.COMMENT,this._stateComment(e))}_stateCommentLessThanSignBangDash(e){e===N.HYPHEN_MINUS?this.state=w.COMMENT_LESS_THAN_SIGN_BANG_DASH_DASH:(this.state=w.COMMENT_END_DASH,this._stateCommentEndDash(e))}_stateCommentLessThanSignBangDashDash(e){e!==N.GREATER_THAN_SIGN&&e!==N.EOF&&this._err(te.nestedComment),this.state=w.COMMENT_END,this._stateCommentEnd(e)}_stateCommentEndDash(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{this.state=w.COMMENT_END;break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="-",this.state=w.COMMENT,this._stateComment(e)}}_stateCommentEnd(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentComment(n);break}case N.EXCLAMATION_MARK:{this.state=w.COMMENT_END_BANG;break}case N.HYPHEN_MINUS:{n.data+="-";break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--",this.state=w.COMMENT,this._stateComment(e)}}_stateCommentEndBang(e){const n=this.currentToken;switch(e){case N.HYPHEN_MINUS:{n.data+="--!",this.state=w.COMMENT_END_DASH;break}case N.GREATER_THAN_SIGN:{this._err(te.incorrectlyClosedComment),this.state=w.DATA,this.emitCurrentComment(n);break}case N.EOF:{this._err(te.eofInComment),this.emitCurrentComment(n),this._emitEOFToken();break}default:n.data+="--!",this.state=w.COMMENT,this._stateComment(e)}}_stateDoctype(e){switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=w.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e);break}case N.EOF:{this._err(te.eofInDoctype),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingWhitespaceBeforeDoctypeName),this.state=w.BEFORE_DOCTYPE_NAME,this._stateBeforeDoctypeName(e)}}_stateBeforeDoctypeName(e){if(su(e))this._createDoctypeToken(String.fromCharCode(Ao(e))),this.state=w.DOCTYPE_NAME;else switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.NULL:{this._err(te.unexpectedNullCharacter),this._createDoctypeToken(St),this.state=w.DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeName),this._createDoctypeToken(null);const n=this.currentToken;n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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=w.DOCTYPE_NAME}}_stateDoctypeName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.AFTER_DOCTYPE_NAME;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.name+=St;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:n.name+=String.fromCodePoint(su(e)?Ao(e):e)}}_stateAfterDoctypeName(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._consumeSequenceIfMatch(Sn.PUBLIC,!1)?this.state=w.AFTER_DOCTYPE_PUBLIC_KEYWORD:this._consumeSequenceIfMatch(Sn.SYSTEM,!1)?this.state=w.AFTER_DOCTYPE_SYSTEM_KEYWORD:this._ensureHibernation()||(this._err(te.invalidCharacterSequenceAfterDoctypeName),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e))}}_stateAfterDoctypePublicKeyword(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypePublicKeyword),n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypePublicIdentifier(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.publicId="",this.state=w.DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypePublicIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypePublicIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=St;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=w.AFTER_DOCTYPE_PUBLIC_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.publicId+=St;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypePublicIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS;break}case N.GREATER_THAN_SIGN:{this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceBetweenDoctypePublicAndSystemIdentifiers),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBetweenDoctypePublicAndSystemIdentifiers(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.QUOTATION_MARK:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateAfterDoctypeSystemKeyword(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:{this.state=w.BEFORE_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.QUOTATION_MARK:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{this._err(te.missingWhitespaceAfterDoctypeSystemKeyword),n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBeforeDoctypeSystemIdentifier(e){const n=this.currentToken;switch(e){case N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.QUOTATION_MARK:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED;break}case N.APOSTROPHE:{n.systemId="",this.state=w.DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED;break}case N.GREATER_THAN_SIGN:{this._err(te.missingDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.DATA,this.emitCurrentDoctype(n);break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.missingQuoteBeforeDoctypeSystemIdentifier),n.forceQuirks=!0,this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateDoctypeSystemIdentifierDoubleQuoted(e){const n=this.currentToken;switch(e){case N.QUOTATION_MARK:{this.state=w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=St;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.APOSTROPHE:{this.state=w.AFTER_DOCTYPE_SYSTEM_IDENTIFIER;break}case N.NULL:{this._err(te.unexpectedNullCharacter),n.systemId+=St;break}case N.GREATER_THAN_SIGN:{this._err(te.abruptDoctypeSystemIdentifier),n.forceQuirks=!0,this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.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 N.SPACE:case N.LINE_FEED:case N.TABULATION:case N.FORM_FEED:break;case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.EOF:{this._err(te.eofInDoctype),n.forceQuirks=!0,this.emitCurrentDoctype(n),this._emitEOFToken();break}default:this._err(te.unexpectedCharacterAfterDoctypeSystemIdentifier),this.state=w.BOGUS_DOCTYPE,this._stateBogusDoctype(e)}}_stateBogusDoctype(e){const n=this.currentToken;switch(e){case N.GREATER_THAN_SIGN:{this.emitCurrentDoctype(n),this.state=w.DATA;break}case N.NULL:{this._err(te.unexpectedNullCharacter);break}case N.EOF:{this.emitCurrentDoctype(n),this._emitEOFToken();break}}}_stateCdataSection(e){switch(e){case N.RIGHT_SQUARE_BRACKET:{this.state=w.CDATA_SECTION_BRACKET;break}case N.EOF:{this._err(te.eofInCdata),this._emitEOFToken();break}default:this._emitCodePoint(e)}}_stateCdataSectionBracket(e){e===N.RIGHT_SQUARE_BRACKET?this.state=w.CDATA_SECTION_END:(this._emitChars("]"),this.state=w.CDATA_SECTION,this._stateCdataSection(e))}_stateCdataSectionEnd(e){switch(e){case N.GREATER_THAN_SIGN:{this.state=w.DATA;break}case N.RIGHT_SQUARE_BRACKET:{this._emitChars("]");break}default:this._emitChars("]]"),this.state=w.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(N.AMPERSAND),this.state=!this._isCharacterReferenceInAttribute()&&e0(this.preprocessor.peek(1))?w.AMBIGUOUS_AMPERSAND:this.returnState):this.state=this.returnState}_stateAmbiguousAmpersand(e){e0(e)?this._flushCodePointConsumedAsCharacterReference(e):(e===N.SEMICOLON&&this._err(te.unknownNamedCharacterReference),this.state=this.returnState,this._callState(e))}}const bm=new Set([l.DD,l.DT,l.LI,l.OPTGROUP,l.OPTION,l.P,l.RB,l.RP,l.RT,l.RTC]),n0=new Set([...bm,l.CAPTION,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]),al=new Set([l.APPLET,l.CAPTION,l.HTML,l.MARQUEE,l.OBJECT,l.TABLE,l.TD,l.TEMPLATE,l.TH]),UT=new Set([...al,l.OL,l.UL]),HT=new Set([...al,l.BUTTON]),r0=new Set([l.ANNOTATION_XML,l.MI,l.MN,l.MO,l.MS,l.MTEXT]),s0=new Set([l.DESC,l.FOREIGN_OBJECT,l.TITLE]),qT=new Set([l.TR,l.TEMPLATE,l.HTML]),jT=new Set([l.TBODY,l.TFOOT,l.THEAD,l.TEMPLATE,l.HTML]),$T=new Set([l.TABLE,l.TEMPLATE,l.HTML]),YT=new Set([l.TD,l.TH]);class zT{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=l.UNKNOWN,this.current=e}_indexOf(e){return this.items.lastIndexOf(e,this.stackTop)}_isInTemplate(){return this.currentTagId===l.TEMPLATE&&this.treeAdapter.getNamespaceURI(this.current)===ie.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])!==ie.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(mf,ie.HTML)}popUntilTableCellPopped(){this.popUntilPopped(YT,ie.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($T,ie.HTML)}clearBackToTableBodyContext(){this.clearBackTo(jT,ie.HTML)}clearBackToTableRowContext(){this.clearBackTo(qT,ie.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]===l.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]===l.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 ie.HTML:{if(s===e)return!0;if(n.has(s))return!1;break}case ie.SVG:{if(s0.has(s))return!1;break}case ie.MATHML:{if(r0.has(s))return!1;break}}}return!0}hasInScope(e){return this.hasInDynamicScope(e,al)}hasInListItemScope(e){return this.hasInDynamicScope(e,UT)}hasInButtonScope(e){return this.hasInDynamicScope(e,HT)}hasNumberedHeaderInScope(){for(let e=this.stackTop;e>=0;e--){const n=this.tagIDs[e];switch(this.treeAdapter.getNamespaceURI(this.items[e])){case ie.HTML:{if(mf.has(n))return!0;if(al.has(n))return!1;break}case ie.SVG:{if(s0.has(n))return!1;break}case ie.MATHML:{if(r0.has(n))return!1;break}}}return!0}hasInTableScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ie.HTML)switch(this.tagIDs[n]){case e:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasTableBodyContextInTableScope(){for(let e=this.stackTop;e>=0;e--)if(this.treeAdapter.getNamespaceURI(this.items[e])===ie.HTML)switch(this.tagIDs[e]){case l.TBODY:case l.THEAD:case l.TFOOT:return!0;case l.TABLE:case l.HTML:return!1}return!0}hasInSelectScope(e){for(let n=this.stackTop;n>=0;n--)if(this.treeAdapter.getNamespaceURI(this.items[n])===ie.HTML)switch(this.tagIDs[n]){case e:return!0;case l.OPTION:case l.OPTGROUP:break;default:return!1}return!0}generateImpliedEndTags(){for(;this.currentTagId!==void 0&&bm.has(this.currentTagId);)this.pop()}generateImpliedEndTagsThoroughly(){for(;this.currentTagId!==void 0&&n0.has(this.currentTagId);)this.pop()}generateImpliedEndTagsWithExclusion(e){for(;this.currentTagId!==void 0&&this.currentTagId!==e&&n0.has(this.currentTagId);)this.pop()}}const _c=3;var Ur;(function(t){t[t.Marker=0]="Marker",t[t.Element=1]="Element"})(Ur||(Ur={}));const a0={type:Ur.Marker};class WT{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 u=0;u<this.entries.length;u++){const o=this.entries[u];if(o.type===Ur.Marker)break;const{element:f}=o;if(this.treeAdapter.getTagName(f)===a&&this.treeAdapter.getNamespaceURI(f)===i){const h=this.treeAdapter.getAttrList(f);h.length===s&&r.push({idx:u,attrs:h})}}return r}_ensureNoahArkCondition(e){if(this.entries.length<_c)return;const n=this.treeAdapter.getAttrList(e),r=this._getNoahArkConditionCandidates(e,n);if(r.length<_c)return;const s=new Map(n.map(i=>[i.name,i.value]));let a=0;for(let i=0;i<r.length;i++){const u=r[i];u.attrs.every(o=>s.get(o.name)===o.value)&&(a+=1,a>=_c&&this.entries.splice(u.idx,1))}}insertMarker(){this.entries.unshift(a0)}pushElement(e,n){this._ensureNoahArkCondition(e),this.entries.unshift({type:Ur.Element,element:e,token:n})}insertElementAfterBookmark(e,n){const r=this.entries.indexOf(this.bookmark);this.entries.splice(r,0,{type:Ur.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(a0);e===-1?this.entries.length=0:this.entries.splice(0,e+1)}getElementEntryInScopeWithTagName(e){const n=this.entries.find(r=>r.type===Ur.Marker||this.treeAdapter.getTagName(r.element)===e);return n&&n.type===Ur.Element?n:null}getElementEntry(e){return this.entries.find(n=>n.type===Ur.Element&&n.element===e)}}const rs={createDocument(){return{nodeName:"#document",mode:Xn.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};rs.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(rs.isTextNode(n)){n.value+=e;return}}rs.appendChild(t,rs.createTextNode(e))},insertTextBefore(t,e,n){const r=t.childNodes[t.childNodes.indexOf(n)-1];r&&rs.isTextNode(r)?r.value+=e:rs.insertBefore(t,rs.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}}},Em="html",GT="about:legacy-compat",KT="http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",vm=["+//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//"],VT=[...vm,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"],XT=new Set(["-//w3o//dtd w3 html strict 3.0//en//","-/w3c/dtd html 4.0 transitional/en","html"]),Tm=["-//w3c//dtd xhtml 1.0 frameset//","-//w3c//dtd xhtml 1.0 transitional//"],QT=[...Tm,"-//w3c//dtd html 4.01 frameset//","-//w3c//dtd html 4.01 transitional//"];function i0(t,e){return e.some(n=>t.startsWith(n))}function ZT(t){return t.name===Em&&t.publicId===null&&(t.systemId===null||t.systemId===GT)}function JT(t){if(t.name!==Em)return Xn.QUIRKS;const{systemId:e}=t;if(e&&e.toLowerCase()===KT)return Xn.QUIRKS;let{publicId:n}=t;if(n!==null){if(n=n.toLowerCase(),XT.has(n))return Xn.QUIRKS;let r=e===null?VT:vm;if(i0(n,r))return Xn.QUIRKS;if(r=e===null?Tm:QT,i0(n,r))return Xn.LIMITED_QUIRKS}return Xn.NO_QUIRKS}const u0={TEXT_HTML:"text/html",APPLICATION_XML:"application/xhtml+xml"},e_="definitionurl",t_="definitionURL",n_=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])),r_=new Map([["xlink:actuate",{prefix:"xlink",name:"actuate",namespace:ie.XLINK}],["xlink:arcrole",{prefix:"xlink",name:"arcrole",namespace:ie.XLINK}],["xlink:href",{prefix:"xlink",name:"href",namespace:ie.XLINK}],["xlink:role",{prefix:"xlink",name:"role",namespace:ie.XLINK}],["xlink:show",{prefix:"xlink",name:"show",namespace:ie.XLINK}],["xlink:title",{prefix:"xlink",name:"title",namespace:ie.XLINK}],["xlink:type",{prefix:"xlink",name:"type",namespace:ie.XLINK}],["xml:lang",{prefix:"xml",name:"lang",namespace:ie.XML}],["xml:space",{prefix:"xml",name:"space",namespace:ie.XML}],["xmlns",{prefix:"",name:"xmlns",namespace:ie.XMLNS}],["xmlns:xlink",{prefix:"xmlns",name:"xlink",namespace:ie.XMLNS}]]),s_=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])),a_=new Set([l.B,l.BIG,l.BLOCKQUOTE,l.BODY,l.BR,l.CENTER,l.CODE,l.DD,l.DIV,l.DL,l.DT,l.EM,l.EMBED,l.H1,l.H2,l.H3,l.H4,l.H5,l.H6,l.HEAD,l.HR,l.I,l.IMG,l.LI,l.LISTING,l.MENU,l.META,l.NOBR,l.OL,l.P,l.PRE,l.RUBY,l.S,l.SMALL,l.SPAN,l.STRONG,l.STRIKE,l.SUB,l.SUP,l.TABLE,l.TT,l.U,l.UL,l.VAR]);function i_(t){const e=t.tagID;return e===l.FONT&&t.attrs.some(({name:r})=>r===ma.COLOR||r===ma.SIZE||r===ma.FACE)||a_.has(e)}function _m(t){for(let e=0;e<t.attrs.length;e++)if(t.attrs[e].name===e_){t.attrs[e].name=t_;break}}function Am(t){for(let e=0;e<t.attrs.length;e++){const n=n_.get(t.attrs[e].name);n!=null&&(t.attrs[e].name=n)}}function Yd(t){for(let e=0;e<t.attrs.length;e++){const n=r_.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 u_(t){const e=s_.get(t.tagName);e!=null&&(t.tagName=e,t.tagID=Ll(t.tagName))}function o_(t,e){return e===ie.MATHML&&(t===l.MI||t===l.MO||t===l.MN||t===l.MS||t===l.MTEXT)}function l_(t,e,n){if(e===ie.MATHML&&t===l.ANNOTATION_XML){for(let r=0;r<n.length;r++)if(n[r].name===ma.ENCODING){const s=n[r].value.toLowerCase();return s===u0.TEXT_HTML||s===u0.APPLICATION_XML}}return e===ie.SVG&&(t===l.FOREIGN_OBJECT||t===l.DESC||t===l.TITLE)}function c_(t,e,n,r){return(!r||r===ie.HTML)&&l_(t,e,n)||(!r||r===ie.MATHML)&&o_(t,e)}const f_="hidden",d_=8,h_=3;var D;(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"})(D||(D={}));const p_={startLine:-1,startCol:-1,startOffset:-1,endLine:-1,endCol:-1,endOffset:-1},ym=new Set([l.TABLE,l.TBODY,l.TFOOT,l.THEAD,l.TR]),o0={scriptingEnabled:!0,sourceCodeLocationInfo:!1,treeAdapter:rs,onParseError:null};class Nm{constructor(e,n,r=null,s=null){this.fragmentContext=r,this.scriptHandler=s,this.currentToken=null,this.stopped=!1,this.insertionMode=D.INITIAL,this.originalInsertionMode=D.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={...o0,...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 FT(this.options,this),this.activeFormattingElements=new WT(this.treeAdapter),this.fragmentContextID=r?Ll(this.treeAdapter.getTagName(r)):l.UNKNOWN,this._setContextModes(r??this.document,this.fragmentContextID),this.openElements=new zT(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={...o0,...n};e??(e=r.treeAdapter.createElement(K.TEMPLATE,ie.HTML,[]));const s=r.treeAdapter.createElement("documentmock",ie.HTML,[]),a=new this(r,s,e);return a.fragmentContextID===l.TEMPLATE&&a.tmplInsertionModeStack.unshift(D.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:p_,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)===ie.HTML;this.currentNotInHTML=!r,this.tokenizer.inForeignNode=!r&&e!==void 0&&n!==void 0&&!this._isIntegrationPoint(n,e)}_switchToTextParsing(e,n){this._insertElement(e,ie.HTML),this.tokenizer.state=n,this.originalInsertionMode=this.insertionMode,this.insertionMode=D.TEXT}switchToPlaintextParsing(){this.insertionMode=D.TEXT,this.originalInsertionMode=D.IN_BODY,this.tokenizer.state=Rn.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)===K.FORM){this.formElement=e;break}e=this.treeAdapter.getParentNode(e)}}_initTokenizerForFragmentParsing(){if(!(!this.fragmentContext||this.treeAdapter.getNamespaceURI(this.fragmentContext)!==ie.HTML))switch(this.fragmentContextID){case l.TITLE:case l.TEXTAREA:{this.tokenizer.state=Rn.RCDATA;break}case l.STYLE:case l.XMP:case l.IFRAME:case l.NOEMBED:case l.NOFRAMES:case l.NOSCRIPT:{this.tokenizer.state=Rn.RAWTEXT;break}case l.SCRIPT:{this.tokenizer.state=Rn.SCRIPT_DATA;break}case l.PLAINTEXT:{this.tokenizer.state=Rn.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(u=>this.treeAdapter.isDocumentTypeNode(u));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,ie.HTML,[]);this._attachElementToTree(r,null),this.openElements.push(r,n)}_insertTemplate(e){const n=this.treeAdapter.createElement(e.tagName,ie.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(K.HTML,ie.HTML,[]);this.options.sourceCodeLocationInfo&&this.treeAdapter.setNodeSourceCodeLocation(e,null),this.treeAdapter.appendChild(this.openElements.current,e),this.openElements.push(e,l.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:o,endCol:f,endOffset:h}=e.location;this.treeAdapter.updateNodeSourceCodeLocation(i,{endLine:o,endCol:f,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===at.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===l.SVG&&this.treeAdapter.getTagName(n)===K.ANNOTATION_XML&&this.treeAdapter.getNamespaceURI(n)===ie.MATHML?!1:this.tokenizer.inForeignNode||(e.tagID===l.MGLYPH||e.tagID===l.MALIGNMARK)&&r!==void 0&&!this._isIntegrationPoint(r,n,ie.HTML)}_processToken(e){switch(e.type){case at.CHARACTER:{this.onCharacter(e);break}case at.NULL_CHARACTER:{this.onNullCharacter(e);break}case at.COMMENT:{this.onComment(e);break}case at.DOCTYPE:{this.onDoctype(e);break}case at.START_TAG:{this._processStartTag(e);break}case at.END_TAG:{this.onEndTag(e);break}case at.EOF:{this.onEof(e);break}case at.WHITESPACE_CHARACTER:{this.onWhitespaceCharacter(e);break}}}_isIntegrationPoint(e,n,r){const s=this.treeAdapter.getNamespaceURI(n),a=this.treeAdapter.getAttrList(n);return c_(e,s,a,r)}_reconstructActiveFormattingElements(){const e=this.activeFormattingElements.entries.length;if(e){const n=this.activeFormattingElements.entries.findIndex(s=>s.type===Ur.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=D.IN_ROW}_closePElement(){this.openElements.generateImpliedEndTagsWithExclusion(l.P),this.openElements.popUntilTagNamePopped(l.P)}_resetInsertionMode(){for(let e=this.openElements.stackTop;e>=0;e--)switch(e===0&&this.fragmentContext?this.fragmentContextID:this.openElements.tagIDs[e]){case l.TR:{this.insertionMode=D.IN_ROW;return}case l.TBODY:case l.THEAD:case l.TFOOT:{this.insertionMode=D.IN_TABLE_BODY;return}case l.CAPTION:{this.insertionMode=D.IN_CAPTION;return}case l.COLGROUP:{this.insertionMode=D.IN_COLUMN_GROUP;return}case l.TABLE:{this.insertionMode=D.IN_TABLE;return}case l.BODY:{this.insertionMode=D.IN_BODY;return}case l.FRAMESET:{this.insertionMode=D.IN_FRAMESET;return}case l.SELECT:{this._resetInsertionModeForSelect(e);return}case l.TEMPLATE:{this.insertionMode=this.tmplInsertionModeStack[0];return}case l.HTML:{this.insertionMode=this.headElement?D.AFTER_HEAD:D.BEFORE_HEAD;return}case l.TD:case l.TH:{if(e>0){this.insertionMode=D.IN_CELL;return}break}case l.HEAD:{if(e>0){this.insertionMode=D.IN_HEAD;return}break}}this.insertionMode=D.IN_BODY}_resetInsertionModeForSelect(e){if(e>0)for(let n=e-1;n>0;n--){const r=this.openElements.tagIDs[n];if(r===l.TEMPLATE)break;if(r===l.TABLE){this.insertionMode=D.IN_SELECT_IN_TABLE;return}}this.insertionMode=D.IN_SELECT}_isElementCausesFosterParenting(e){return ym.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 l.TEMPLATE:{if(this.treeAdapter.getNamespaceURI(n)===ie.HTML)return{parent:this.treeAdapter.getTemplateContent(n),beforeElement:null};break}case l.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 xT[r].has(n)}onCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){Y2(this,e);return}switch(this.insertionMode){case D.INITIAL:{Xi(this,e);break}case D.BEFORE_HTML:{du(this,e);break}case D.BEFORE_HEAD:{hu(this,e);break}case D.IN_HEAD:{pu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{mu(this,e);break}case D.AFTER_HEAD:{gu(this,e);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:{Im(this,e);break}case D.TEXT:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{this._insertCharacters(e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{Ac(this,e);break}case D.IN_TABLE_TEXT:{xm(this,e);break}case D.IN_COLUMN_GROUP:{il(this,e);break}case D.AFTER_BODY:{ul(this,e);break}case D.AFTER_AFTER_BODY:{Yo(this,e);break}}}onNullCharacter(e){if(this.skipNextNewLine=!1,this.tokenizer.inForeignNode){$2(this,e);return}switch(this.insertionMode){case D.INITIAL:{Xi(this,e);break}case D.BEFORE_HTML:{du(this,e);break}case D.BEFORE_HEAD:{hu(this,e);break}case D.IN_HEAD:{pu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{mu(this,e);break}case D.AFTER_HEAD:{gu(this,e);break}case D.TEXT:{this._insertCharacters(e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{Ac(this,e);break}case D.IN_COLUMN_GROUP:{il(this,e);break}case D.AFTER_BODY:{ul(this,e);break}case D.AFTER_AFTER_BODY:{Yo(this,e);break}}}onComment(e){if(this.skipNextNewLine=!1,this.currentNotInHTML){gf(this,e);return}switch(this.insertionMode){case D.INITIAL:case D.BEFORE_HTML:case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_TEMPLATE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{gf(this,e);break}case D.IN_TABLE_TEXT:{Qi(this,e);break}case D.AFTER_BODY:{__(this,e);break}case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{A_(this,e);break}}}onDoctype(e){switch(this.skipNextNewLine=!1,this.insertionMode){case D.INITIAL:{y_(this,e);break}case D.BEFORE_HEAD:case D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:{this._err(e,te.misplacedDoctype);break}case D.IN_TABLE_TEXT:{Qi(this,e);break}}}onStartTag(e){this.skipNextNewLine=!1,this.currentToken=e,this._processStartTag(e),e.selfClosing&&!e.ackSelfClosing&&this._err(e,te.nonVoidHtmlElementStartTagWithTrailingSolidus)}_processStartTag(e){this.shouldProcessStartTagTokenInForeignContent(e)?z2(this,e):this._startTagOutsideForeignContent(e)}_startTagOutsideForeignContent(e){switch(this.insertionMode){case D.INITIAL:{Xi(this,e);break}case D.BEFORE_HTML:{N_(this,e);break}case D.BEFORE_HEAD:{I_(this,e);break}case D.IN_HEAD:{Ir(this,e);break}case D.IN_HEAD_NO_SCRIPT:{L_(this,e);break}case D.AFTER_HEAD:{R_(this,e);break}case D.IN_BODY:{pn(this,e);break}case D.IN_TABLE:{_i(this,e);break}case D.IN_TABLE_TEXT:{Qi(this,e);break}case D.IN_CAPTION:{C2(this,e);break}case D.IN_COLUMN_GROUP:{Gd(this,e);break}case D.IN_TABLE_BODY:{xl(this,e);break}case D.IN_ROW:{Dl(this,e);break}case D.IN_CELL:{O2(this,e);break}case D.IN_SELECT:{Pm(this,e);break}case D.IN_SELECT_IN_TABLE:{x2(this,e);break}case D.IN_TEMPLATE:{k2(this,e);break}case D.AFTER_BODY:{M2(this,e);break}case D.IN_FRAMESET:{B2(this,e);break}case D.AFTER_FRAMESET:{U2(this,e);break}case D.AFTER_AFTER_BODY:{q2(this,e);break}case D.AFTER_AFTER_FRAMESET:{j2(this,e);break}}}onEndTag(e){this.skipNextNewLine=!1,this.currentToken=e,this.currentNotInHTML?W2(this,e):this._endTagOutsideForeignContent(e)}_endTagOutsideForeignContent(e){switch(this.insertionMode){case D.INITIAL:{Xi(this,e);break}case D.BEFORE_HTML:{S_(this,e);break}case D.BEFORE_HEAD:{C_(this,e);break}case D.IN_HEAD:{w_(this,e);break}case D.IN_HEAD_NO_SCRIPT:{O_(this,e);break}case D.AFTER_HEAD:{x_(this,e);break}case D.IN_BODY:{Rl(this,e);break}case D.TEXT:{b2(this,e);break}case D.IN_TABLE:{Iu(this,e);break}case D.IN_TABLE_TEXT:{Qi(this,e);break}case D.IN_CAPTION:{w2(this,e);break}case D.IN_COLUMN_GROUP:{L2(this,e);break}case D.IN_TABLE_BODY:{bf(this,e);break}case D.IN_ROW:{km(this,e);break}case D.IN_CELL:{R2(this,e);break}case D.IN_SELECT:{Mm(this,e);break}case D.IN_SELECT_IN_TABLE:{D2(this,e);break}case D.IN_TEMPLATE:{P2(this,e);break}case D.AFTER_BODY:{Fm(this,e);break}case D.IN_FRAMESET:{F2(this,e);break}case D.AFTER_FRAMESET:{H2(this,e);break}case D.AFTER_AFTER_BODY:{Yo(this,e);break}}}onEof(e){switch(this.insertionMode){case D.INITIAL:{Xi(this,e);break}case D.BEFORE_HTML:{du(this,e);break}case D.BEFORE_HEAD:{hu(this,e);break}case D.IN_HEAD:{pu(this,e);break}case D.IN_HEAD_NO_SCRIPT:{mu(this,e);break}case D.AFTER_HEAD:{gu(this,e);break}case D.IN_BODY:case D.IN_TABLE:case D.IN_CAPTION:case D.IN_COLUMN_GROUP:case D.IN_TABLE_BODY:case D.IN_ROW:case D.IN_CELL:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:{Om(this,e);break}case D.TEXT:{E2(this,e);break}case D.IN_TABLE_TEXT:{Qi(this,e);break}case D.IN_TEMPLATE:{Bm(this,e);break}case D.AFTER_BODY:case D.IN_FRAMESET:case D.AFTER_FRAMESET:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{Wd(this,e);break}}}onWhitespaceCharacter(e){if(this.skipNextNewLine&&(this.skipNextNewLine=!1,e.chars.charCodeAt(0)===N.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 D.IN_HEAD:case D.IN_HEAD_NO_SCRIPT:case D.AFTER_HEAD:case D.TEXT:case D.IN_COLUMN_GROUP:case D.IN_SELECT:case D.IN_SELECT_IN_TABLE:case D.IN_FRAMESET:case D.AFTER_FRAMESET:{this._insertCharacters(e);break}case D.IN_BODY:case D.IN_CAPTION:case D.IN_CELL:case D.IN_TEMPLATE:case D.AFTER_BODY:case D.AFTER_AFTER_BODY:case D.AFTER_AFTER_FRAMESET:{Sm(this,e);break}case D.IN_TABLE:case D.IN_TABLE_BODY:case D.IN_ROW:{Ac(this,e);break}case D.IN_TABLE_TEXT:{Rm(this,e);break}}}}function m_(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):Lm(t,e),n}function g_(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 b_(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 u=t.activeFormattingElements.getElementEntry(i),o=u&&a>=h_;!u||o?(o&&t.activeFormattingElements.removeEntry(u),t.openElements.remove(i)):(i=E_(t,u),r===e&&(t.activeFormattingElements.bookmark=u),t.treeAdapter.detachNode(r),t.treeAdapter.appendChild(i,r),r=i)}return r}function E_(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 v_(t,e,n){const r=t.treeAdapter.getTagName(e),s=Ll(r);if(t._isElementCausesFosterParenting(s))t._fosterParentElement(n);else{const a=t.treeAdapter.getNamespaceURI(e);s===l.TEMPLATE&&a===ie.HTML&&(e=t.treeAdapter.getTemplateContent(e)),t.treeAdapter.appendChild(e,n)}}function T_(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 zd(t,e){for(let n=0;n<d_;n++){const r=m_(t,e);if(!r)break;const s=g_(t,r);if(!s)break;t.activeFormattingElements.bookmark=r;const a=b_(t,s,r.element),i=t.openElements.getCommonAncestor(r.element);t.treeAdapter.detachNode(a),i&&v_(t,i,a),T_(t,s,r)}}function gf(t,e){t._appendCommentNode(e,t.openElements.currentTmplContentOrNode)}function __(t,e){t._appendCommentNode(e,t.openElements.items[0])}function A_(t,e){t._appendCommentNode(e,t.document)}function Wd(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 y_(t,e){t._setDocumentType(e);const n=e.forceQuirks?Xn.QUIRKS:JT(e);ZT(e)||t._err(e,te.nonConformingDoctype),t.treeAdapter.setDocumentMode(t.document,n),t.insertionMode=D.BEFORE_HTML}function Xi(t,e){t._err(e,te.missingDoctype,!0),t.treeAdapter.setDocumentMode(t.document,Xn.QUIRKS),t.insertionMode=D.BEFORE_HTML,t._processToken(e)}function N_(t,e){e.tagID===l.HTML?(t._insertElement(e,ie.HTML),t.insertionMode=D.BEFORE_HEAD):du(t,e)}function S_(t,e){const n=e.tagID;(n===l.HTML||n===l.HEAD||n===l.BODY||n===l.BR)&&du(t,e)}function du(t,e){t._insertFakeRootElement(),t.insertionMode=D.BEFORE_HEAD,t._processToken(e)}function I_(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.HEAD:{t._insertElement(e,ie.HTML),t.headElement=t.openElements.current,t.insertionMode=D.IN_HEAD;break}default:hu(t,e)}}function C_(t,e){const n=e.tagID;n===l.HEAD||n===l.BODY||n===l.HTML||n===l.BR?hu(t,e):t._err(e,te.endTagWithoutMatchingOpenElement)}function hu(t,e){t._insertFakeElement(K.HEAD,l.HEAD),t.headElement=t.openElements.current,t.insertionMode=D.IN_HEAD,t._processToken(e)}function Ir(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:{t._appendElement(e,ie.HTML),e.ackSelfClosing=!0;break}case l.TITLE:{t._switchToTextParsing(e,Rn.RCDATA);break}case l.NOSCRIPT:{t.options.scriptingEnabled?t._switchToTextParsing(e,Rn.RAWTEXT):(t._insertElement(e,ie.HTML),t.insertionMode=D.IN_HEAD_NO_SCRIPT);break}case l.NOFRAMES:case l.STYLE:{t._switchToTextParsing(e,Rn.RAWTEXT);break}case l.SCRIPT:{t._switchToTextParsing(e,Rn.SCRIPT_DATA);break}case l.TEMPLATE:{t._insertTemplate(e),t.activeFormattingElements.insertMarker(),t.framesetOk=!1,t.insertionMode=D.IN_TEMPLATE,t.tmplInsertionModeStack.unshift(D.IN_TEMPLATE);break}case l.HEAD:{t._err(e,te.misplacedStartTagForHeadElement);break}default:pu(t,e)}}function w_(t,e){switch(e.tagID){case l.HEAD:{t.openElements.pop(),t.insertionMode=D.AFTER_HEAD;break}case l.BODY:case l.BR:case l.HTML:{pu(t,e);break}case l.TEMPLATE:{La(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function La(t,e){t.openElements.tmplCount>0?(t.openElements.generateImpliedEndTagsThoroughly(),t.openElements.currentTagId!==l.TEMPLATE&&t._err(e,te.closingOfElementWithOpenChildElements),t.openElements.popUntilTagNamePopped(l.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode()):t._err(e,te.endTagWithoutMatchingOpenElement)}function pu(t,e){t.openElements.pop(),t.insertionMode=D.AFTER_HEAD,t._processToken(e)}function L_(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.BASEFONT:case l.BGSOUND:case l.HEAD:case l.LINK:case l.META:case l.NOFRAMES:case l.STYLE:{Ir(t,e);break}case l.NOSCRIPT:{t._err(e,te.nestedNoscriptInHead);break}default:mu(t,e)}}function O_(t,e){switch(e.tagID){case l.NOSCRIPT:{t.openElements.pop(),t.insertionMode=D.IN_HEAD;break}case l.BR:{mu(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function mu(t,e){const n=e.type===at.EOF?te.openElementsLeftAfterEof:te.disallowedContentInNoscriptInHead;t._err(e,n),t.openElements.pop(),t.insertionMode=D.IN_HEAD,t._processToken(e)}function R_(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.BODY:{t._insertElement(e,ie.HTML),t.framesetOk=!1,t.insertionMode=D.IN_BODY;break}case l.FRAMESET:{t._insertElement(e,ie.HTML),t.insertionMode=D.IN_FRAMESET;break}case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{t._err(e,te.abandonedHeadElementChild),t.openElements.push(t.headElement,l.HEAD),Ir(t,e),t.openElements.remove(t.headElement);break}case l.HEAD:{t._err(e,te.misplacedStartTagForHeadElement);break}default:gu(t,e)}}function x_(t,e){switch(e.tagID){case l.BODY:case l.HTML:case l.BR:{gu(t,e);break}case l.TEMPLATE:{La(t,e);break}default:t._err(e,te.endTagWithoutMatchingOpenElement)}}function gu(t,e){t._insertFakeElement(K.BODY,l.BODY),t.insertionMode=D.IN_BODY,Ol(t,e)}function Ol(t,e){switch(e.type){case at.CHARACTER:{Im(t,e);break}case at.WHITESPACE_CHARACTER:{Sm(t,e);break}case at.COMMENT:{gf(t,e);break}case at.START_TAG:{pn(t,e);break}case at.END_TAG:{Rl(t,e);break}case at.EOF:{Om(t,e);break}}}function Sm(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e)}function Im(t,e){t._reconstructActiveFormattingElements(),t._insertCharacters(e),t.framesetOk=!1}function D_(t,e){t.openElements.tmplCount===0&&t.treeAdapter.adoptAttributes(t.openElements.items[0],e.attrs)}function k_(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t.openElements.tmplCount===0&&(t.framesetOk=!1,t.treeAdapter.adoptAttributes(n,e.attrs))}function P_(t,e){const n=t.openElements.tryPeekProperlyNestedBodyElement();t.framesetOk&&n&&(t.treeAdapter.detachNode(n),t.openElements.popAllUpToHtmlElement(),t._insertElement(e,ie.HTML),t.insertionMode=D.IN_FRAMESET)}function M_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,ie.HTML)}function B_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t.openElements.currentTagId!==void 0&&mf.has(t.openElements.currentTagId)&&t.openElements.pop(),t._insertElement(e,ie.HTML)}function F_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,ie.HTML),t.skipNextNewLine=!0,t.framesetOk=!1}function U_(t,e){const n=t.openElements.tmplCount>0;(!t.formElement||n)&&(t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,ie.HTML),n||(t.formElement=t.openElements.current))}function H_(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===l.LI&&s===l.LI||(n===l.DD||n===l.DT)&&(s===l.DD||s===l.DT)){t.openElements.generateImpliedEndTagsWithExclusion(s),t.openElements.popUntilTagNamePopped(s);break}if(s!==l.ADDRESS&&s!==l.DIV&&s!==l.P&&t._isSpecialElement(t.openElements.items[r],s))break}t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,ie.HTML)}function q_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,ie.HTML),t.tokenizer.state=Rn.PLAINTEXT}function j_(t,e){t.openElements.hasInScope(l.BUTTON)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.BUTTON)),t._reconstructActiveFormattingElements(),t._insertElement(e,ie.HTML),t.framesetOk=!1}function $_(t,e){const n=t.activeFormattingElements.getElementEntryInScopeWithTagName(K.A);n&&(zd(t,e),t.openElements.remove(n.element),t.activeFormattingElements.removeEntry(n)),t._reconstructActiveFormattingElements(),t._insertElement(e,ie.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function Y_(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ie.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function z_(t,e){t._reconstructActiveFormattingElements(),t.openElements.hasInScope(l.NOBR)&&(zd(t,e),t._reconstructActiveFormattingElements()),t._insertElement(e,ie.HTML),t.activeFormattingElements.pushElement(t.openElements.current,e)}function W_(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ie.HTML),t.activeFormattingElements.insertMarker(),t.framesetOk=!1}function G_(t,e){t.treeAdapter.getDocumentMode(t.document)!==Xn.QUIRKS&&t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._insertElement(e,ie.HTML),t.framesetOk=!1,t.insertionMode=D.IN_TABLE}function Cm(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,ie.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function wm(t){const e=mm(t,ma.TYPE);return e!=null&&e.toLowerCase()===f_}function K_(t,e){t._reconstructActiveFormattingElements(),t._appendElement(e,ie.HTML),wm(e)||(t.framesetOk=!1),e.ackSelfClosing=!0}function V_(t,e){t._appendElement(e,ie.HTML),e.ackSelfClosing=!0}function X_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._appendElement(e,ie.HTML),t.framesetOk=!1,e.ackSelfClosing=!0}function Q_(t,e){e.tagName=K.IMG,e.tagID=l.IMG,Cm(t,e)}function Z_(t,e){t._insertElement(e,ie.HTML),t.skipNextNewLine=!0,t.tokenizer.state=Rn.RCDATA,t.originalInsertionMode=t.insertionMode,t.framesetOk=!1,t.insertionMode=D.TEXT}function J_(t,e){t.openElements.hasInButtonScope(l.P)&&t._closePElement(),t._reconstructActiveFormattingElements(),t.framesetOk=!1,t._switchToTextParsing(e,Rn.RAWTEXT)}function e2(t,e){t.framesetOk=!1,t._switchToTextParsing(e,Rn.RAWTEXT)}function l0(t,e){t._switchToTextParsing(e,Rn.RAWTEXT)}function t2(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ie.HTML),t.framesetOk=!1,t.insertionMode=t.insertionMode===D.IN_TABLE||t.insertionMode===D.IN_CAPTION||t.insertionMode===D.IN_TABLE_BODY||t.insertionMode===D.IN_ROW||t.insertionMode===D.IN_CELL?D.IN_SELECT_IN_TABLE:D.IN_SELECT}function n2(t,e){t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t._reconstructActiveFormattingElements(),t._insertElement(e,ie.HTML)}function r2(t,e){t.openElements.hasInScope(l.RUBY)&&t.openElements.generateImpliedEndTags(),t._insertElement(e,ie.HTML)}function s2(t,e){t.openElements.hasInScope(l.RUBY)&&t.openElements.generateImpliedEndTagsWithExclusion(l.RTC),t._insertElement(e,ie.HTML)}function a2(t,e){t._reconstructActiveFormattingElements(),_m(e),Yd(e),e.selfClosing?t._appendElement(e,ie.MATHML):t._insertElement(e,ie.MATHML),e.ackSelfClosing=!0}function i2(t,e){t._reconstructActiveFormattingElements(),Am(e),Yd(e),e.selfClosing?t._appendElement(e,ie.SVG):t._insertElement(e,ie.SVG),e.ackSelfClosing=!0}function c0(t,e){t._reconstructActiveFormattingElements(),t._insertElement(e,ie.HTML)}function pn(t,e){switch(e.tagID){case l.I:case l.S:case l.B:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.SMALL:case l.STRIKE:case l.STRONG:{Y_(t,e);break}case l.A:{$_(t,e);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{B_(t,e);break}case l.P:case l.DL:case l.OL:case l.UL:case l.DIV:case l.DIR:case l.NAV:case l.MAIN:case l.MENU:case l.ASIDE:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.DETAILS:case l.ADDRESS:case l.ARTICLE:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{M_(t,e);break}case l.LI:case l.DD:case l.DT:{H_(t,e);break}case l.BR:case l.IMG:case l.WBR:case l.AREA:case l.EMBED:case l.KEYGEN:{Cm(t,e);break}case l.HR:{X_(t,e);break}case l.RB:case l.RTC:{r2(t,e);break}case l.RT:case l.RP:{s2(t,e);break}case l.PRE:case l.LISTING:{F_(t,e);break}case l.XMP:{J_(t,e);break}case l.SVG:{i2(t,e);break}case l.HTML:{D_(t,e);break}case l.BASE:case l.LINK:case l.META:case l.STYLE:case l.TITLE:case l.SCRIPT:case l.BGSOUND:case l.BASEFONT:case l.TEMPLATE:{Ir(t,e);break}case l.BODY:{k_(t,e);break}case l.FORM:{U_(t,e);break}case l.NOBR:{z_(t,e);break}case l.MATH:{a2(t,e);break}case l.TABLE:{G_(t,e);break}case l.INPUT:{K_(t,e);break}case l.PARAM:case l.TRACK:case l.SOURCE:{V_(t,e);break}case l.IMAGE:{Q_(t,e);break}case l.BUTTON:{j_(t,e);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{W_(t,e);break}case l.IFRAME:{e2(t,e);break}case l.SELECT:{t2(t,e);break}case l.OPTION:case l.OPTGROUP:{n2(t,e);break}case l.NOEMBED:case l.NOFRAMES:{l0(t,e);break}case l.FRAMESET:{P_(t,e);break}case l.TEXTAREA:{Z_(t,e);break}case l.NOSCRIPT:{t.options.scriptingEnabled?l0(t,e):c0(t,e);break}case l.PLAINTEXT:{q_(t,e);break}case l.COL:case l.TH:case l.TD:case l.TR:case l.HEAD:case l.FRAME:case l.TBODY:case l.TFOOT:case l.THEAD:case l.CAPTION:case l.COLGROUP:break;default:c0(t,e)}}function u2(t,e){if(t.openElements.hasInScope(l.BODY)&&(t.insertionMode=D.AFTER_BODY,t.options.sourceCodeLocationInfo)){const n=t.openElements.tryPeekProperlyNestedBodyElement();n&&t._setEndLocation(n,e)}}function o2(t,e){t.openElements.hasInScope(l.BODY)&&(t.insertionMode=D.AFTER_BODY,Fm(t,e))}function l2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n))}function c2(t){const e=t.openElements.tmplCount>0,{formElement:n}=t;e||(t.formElement=null),(n||e)&&t.openElements.hasInScope(l.FORM)&&(t.openElements.generateImpliedEndTags(),e?t.openElements.popUntilTagNamePopped(l.FORM):n&&t.openElements.remove(n))}function f2(t){t.openElements.hasInButtonScope(l.P)||t._insertFakeElement(K.P,l.P),t._closePElement()}function d2(t){t.openElements.hasInListItemScope(l.LI)&&(t.openElements.generateImpliedEndTagsWithExclusion(l.LI),t.openElements.popUntilTagNamePopped(l.LI))}function h2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTagsWithExclusion(n),t.openElements.popUntilTagNamePopped(n))}function p2(t){t.openElements.hasNumberedHeaderInScope()&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilNumberedHeaderPopped())}function m2(t,e){const n=e.tagID;t.openElements.hasInScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker())}function g2(t){t._reconstructActiveFormattingElements(),t._insertFakeElement(K.BR,l.BR),t.openElements.pop(),t.framesetOk=!1}function Lm(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!==l.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 Rl(t,e){switch(e.tagID){case l.A:case l.B:case l.I:case l.S:case l.U:case l.EM:case l.TT:case l.BIG:case l.CODE:case l.FONT:case l.NOBR:case l.SMALL:case l.STRIKE:case l.STRONG:{zd(t,e);break}case l.P:{f2(t);break}case l.DL:case l.UL:case l.OL:case l.DIR:case l.DIV:case l.NAV:case l.PRE:case l.MAIN:case l.MENU:case l.ASIDE:case l.BUTTON:case l.CENTER:case l.FIGURE:case l.FOOTER:case l.HEADER:case l.HGROUP:case l.DIALOG:case l.ADDRESS:case l.ARTICLE:case l.DETAILS:case l.SEARCH:case l.SECTION:case l.SUMMARY:case l.LISTING:case l.FIELDSET:case l.BLOCKQUOTE:case l.FIGCAPTION:{l2(t,e);break}case l.LI:{d2(t);break}case l.DD:case l.DT:{h2(t,e);break}case l.H1:case l.H2:case l.H3:case l.H4:case l.H5:case l.H6:{p2(t);break}case l.BR:{g2(t);break}case l.BODY:{u2(t,e);break}case l.HTML:{o2(t,e);break}case l.FORM:{c2(t);break}case l.APPLET:case l.OBJECT:case l.MARQUEE:{m2(t,e);break}case l.TEMPLATE:{La(t,e);break}default:Lm(t,e)}}function Om(t,e){t.tmplInsertionModeStack.length>0?Bm(t,e):Wd(t,e)}function b2(t,e){var n;e.tagID===l.SCRIPT&&((n=t.scriptHandler)===null||n===void 0||n.call(t,t.openElements.current)),t.openElements.pop(),t.insertionMode=t.originalInsertionMode}function E2(t,e){t._err(e,te.eofInElementThatCanContainOnlyText),t.openElements.pop(),t.insertionMode=t.originalInsertionMode,t.onEof(e)}function Ac(t,e){if(t.openElements.currentTagId!==void 0&&ym.has(t.openElements.currentTagId))switch(t.pendingCharacterTokens.length=0,t.hasNonWhitespacePendingCharacterToken=!1,t.originalInsertionMode=t.insertionMode,t.insertionMode=D.IN_TABLE_TEXT,e.type){case at.CHARACTER:{xm(t,e);break}case at.WHITESPACE_CHARACTER:{Rm(t,e);break}}else Ju(t,e)}function v2(t,e){t.openElements.clearBackToTableContext(),t.activeFormattingElements.insertMarker(),t._insertElement(e,ie.HTML),t.insertionMode=D.IN_CAPTION}function T2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,ie.HTML),t.insertionMode=D.IN_COLUMN_GROUP}function _2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(K.COLGROUP,l.COLGROUP),t.insertionMode=D.IN_COLUMN_GROUP,Gd(t,e)}function A2(t,e){t.openElements.clearBackToTableContext(),t._insertElement(e,ie.HTML),t.insertionMode=D.IN_TABLE_BODY}function y2(t,e){t.openElements.clearBackToTableContext(),t._insertFakeElement(K.TBODY,l.TBODY),t.insertionMode=D.IN_TABLE_BODY,xl(t,e)}function N2(t,e){t.openElements.hasInTableScope(l.TABLE)&&(t.openElements.popUntilTagNamePopped(l.TABLE),t._resetInsertionMode(),t._processStartTag(e))}function S2(t,e){wm(e)?t._appendElement(e,ie.HTML):Ju(t,e),e.ackSelfClosing=!0}function I2(t,e){!t.formElement&&t.openElements.tmplCount===0&&(t._insertElement(e,ie.HTML),t.formElement=t.openElements.current,t.openElements.pop())}function _i(t,e){switch(e.tagID){case l.TD:case l.TH:case l.TR:{y2(t,e);break}case l.STYLE:case l.SCRIPT:case l.TEMPLATE:{Ir(t,e);break}case l.COL:{_2(t,e);break}case l.FORM:{I2(t,e);break}case l.TABLE:{N2(t,e);break}case l.TBODY:case l.TFOOT:case l.THEAD:{A2(t,e);break}case l.INPUT:{S2(t,e);break}case l.CAPTION:{v2(t,e);break}case l.COLGROUP:{T2(t,e);break}default:Ju(t,e)}}function Iu(t,e){switch(e.tagID){case l.TABLE:{t.openElements.hasInTableScope(l.TABLE)&&(t.openElements.popUntilTagNamePopped(l.TABLE),t._resetInsertionMode());break}case l.TEMPLATE:{La(t,e);break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:Ju(t,e)}}function Ju(t,e){const n=t.fosterParentingEnabled;t.fosterParentingEnabled=!0,Ol(t,e),t.fosterParentingEnabled=n}function Rm(t,e){t.pendingCharacterTokens.push(e)}function xm(t,e){t.pendingCharacterTokens.push(e),t.hasNonWhitespacePendingCharacterToken=!0}function Qi(t,e){let n=0;if(t.hasNonWhitespacePendingCharacterToken)for(;n<t.pendingCharacterTokens.length;n++)Ju(t,t.pendingCharacterTokens[n]);else for(;n<t.pendingCharacterTokens.length;n++)t._insertCharacters(t.pendingCharacterTokens[n]);t.insertionMode=t.originalInsertionMode,t._processToken(e)}const Dm=new Set([l.CAPTION,l.COL,l.COLGROUP,l.TBODY,l.TD,l.TFOOT,l.TH,l.THEAD,l.TR]);function C2(t,e){const n=e.tagID;Dm.has(n)?t.openElements.hasInTableScope(l.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_TABLE,_i(t,e)):pn(t,e)}function w2(t,e){const n=e.tagID;switch(n){case l.CAPTION:case l.TABLE:{t.openElements.hasInTableScope(l.CAPTION)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(l.CAPTION),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_TABLE,n===l.TABLE&&Iu(t,e));break}case l.BODY:case l.COL:case l.COLGROUP:case l.HTML:case l.TBODY:case l.TD:case l.TFOOT:case l.TH:case l.THEAD:case l.TR:break;default:Rl(t,e)}}function Gd(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.COL:{t._appendElement(e,ie.HTML),e.ackSelfClosing=!0;break}case l.TEMPLATE:{Ir(t,e);break}default:il(t,e)}}function L2(t,e){switch(e.tagID){case l.COLGROUP:{t.openElements.currentTagId===l.COLGROUP&&(t.openElements.pop(),t.insertionMode=D.IN_TABLE);break}case l.TEMPLATE:{La(t,e);break}case l.COL:break;default:il(t,e)}}function il(t,e){t.openElements.currentTagId===l.COLGROUP&&(t.openElements.pop(),t.insertionMode=D.IN_TABLE,t._processToken(e))}function xl(t,e){switch(e.tagID){case l.TR:{t.openElements.clearBackToTableBodyContext(),t._insertElement(e,ie.HTML),t.insertionMode=D.IN_ROW;break}case l.TH:case l.TD:{t.openElements.clearBackToTableBodyContext(),t._insertFakeElement(K.TR,l.TR),t.insertionMode=D.IN_ROW,Dl(t,e);break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE,_i(t,e));break}default:_i(t,e)}}function bf(t,e){const n=e.tagID;switch(e.tagID){case l.TBODY:case l.TFOOT:case l.THEAD:{t.openElements.hasInTableScope(n)&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE);break}case l.TABLE:{t.openElements.hasTableBodyContextInTableScope()&&(t.openElements.clearBackToTableBodyContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE,Iu(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:case l.TR:break;default:Iu(t,e)}}function Dl(t,e){switch(e.tagID){case l.TH:case l.TD:{t.openElements.clearBackToTableRowContext(),t._insertElement(e,ie.HTML),t.insertionMode=D.IN_CELL,t.activeFormattingElements.insertMarker();break}case l.CAPTION:case l.COL:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,xl(t,e));break}default:_i(t,e)}}function km(t,e){switch(e.tagID){case l.TR:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY);break}case l.TABLE:{t.openElements.hasInTableScope(l.TR)&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,bf(t,e));break}case l.TBODY:case l.TFOOT:case l.THEAD:{(t.openElements.hasInTableScope(e.tagID)||t.openElements.hasInTableScope(l.TR))&&(t.openElements.clearBackToTableRowContext(),t.openElements.pop(),t.insertionMode=D.IN_TABLE_BODY,bf(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:case l.TD:case l.TH:break;default:Iu(t,e)}}function O2(t,e){const n=e.tagID;Dm.has(n)?(t.openElements.hasInTableScope(l.TD)||t.openElements.hasInTableScope(l.TH))&&(t._closeTableCell(),Dl(t,e)):pn(t,e)}function R2(t,e){const n=e.tagID;switch(n){case l.TD:case l.TH:{t.openElements.hasInTableScope(n)&&(t.openElements.generateImpliedEndTags(),t.openElements.popUntilTagNamePopped(n),t.activeFormattingElements.clearToLastMarker(),t.insertionMode=D.IN_ROW);break}case l.TABLE:case l.TBODY:case l.TFOOT:case l.THEAD:case l.TR:{t.openElements.hasInTableScope(n)&&(t._closeTableCell(),km(t,e));break}case l.BODY:case l.CAPTION:case l.COL:case l.COLGROUP:case l.HTML:break;default:Rl(t,e)}}function Pm(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.OPTION:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t._insertElement(e,ie.HTML);break}case l.OPTGROUP:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop(),t._insertElement(e,ie.HTML);break}case l.HR:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop(),t._appendElement(e,ie.HTML),e.ackSelfClosing=!0;break}case l.INPUT:case l.KEYGEN:case l.TEXTAREA:case l.SELECT:{t.openElements.hasInSelectScope(l.SELECT)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),e.tagID!==l.SELECT&&t._processStartTag(e));break}case l.SCRIPT:case l.TEMPLATE:{Ir(t,e);break}}}function Mm(t,e){switch(e.tagID){case l.OPTGROUP:{t.openElements.stackTop>0&&t.openElements.currentTagId===l.OPTION&&t.openElements.tagIDs[t.openElements.stackTop-1]===l.OPTGROUP&&t.openElements.pop(),t.openElements.currentTagId===l.OPTGROUP&&t.openElements.pop();break}case l.OPTION:{t.openElements.currentTagId===l.OPTION&&t.openElements.pop();break}case l.SELECT:{t.openElements.hasInSelectScope(l.SELECT)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode());break}case l.TEMPLATE:{La(t,e);break}}}function x2(t,e){const n=e.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),t._processStartTag(e)):Pm(t,e)}function D2(t,e){const n=e.tagID;n===l.CAPTION||n===l.TABLE||n===l.TBODY||n===l.TFOOT||n===l.THEAD||n===l.TR||n===l.TD||n===l.TH?t.openElements.hasInTableScope(n)&&(t.openElements.popUntilTagNamePopped(l.SELECT),t._resetInsertionMode(),t.onEndTag(e)):Mm(t,e)}function k2(t,e){switch(e.tagID){case l.BASE:case l.BASEFONT:case l.BGSOUND:case l.LINK:case l.META:case l.NOFRAMES:case l.SCRIPT:case l.STYLE:case l.TEMPLATE:case l.TITLE:{Ir(t,e);break}case l.CAPTION:case l.COLGROUP:case l.TBODY:case l.TFOOT:case l.THEAD:{t.tmplInsertionModeStack[0]=D.IN_TABLE,t.insertionMode=D.IN_TABLE,_i(t,e);break}case l.COL:{t.tmplInsertionModeStack[0]=D.IN_COLUMN_GROUP,t.insertionMode=D.IN_COLUMN_GROUP,Gd(t,e);break}case l.TR:{t.tmplInsertionModeStack[0]=D.IN_TABLE_BODY,t.insertionMode=D.IN_TABLE_BODY,xl(t,e);break}case l.TD:case l.TH:{t.tmplInsertionModeStack[0]=D.IN_ROW,t.insertionMode=D.IN_ROW,Dl(t,e);break}default:t.tmplInsertionModeStack[0]=D.IN_BODY,t.insertionMode=D.IN_BODY,pn(t,e)}}function P2(t,e){e.tagID===l.TEMPLATE&&La(t,e)}function Bm(t,e){t.openElements.tmplCount>0?(t.openElements.popUntilTagNamePopped(l.TEMPLATE),t.activeFormattingElements.clearToLastMarker(),t.tmplInsertionModeStack.shift(),t._resetInsertionMode(),t.onEof(e)):Wd(t,e)}function M2(t,e){e.tagID===l.HTML?pn(t,e):ul(t,e)}function Fm(t,e){var n;if(e.tagID===l.HTML){if(t.fragmentContext||(t.insertionMode=D.AFTER_AFTER_BODY),t.options.sourceCodeLocationInfo&&t.openElements.tagIDs[0]===l.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 ul(t,e)}function ul(t,e){t.insertionMode=D.IN_BODY,Ol(t,e)}function B2(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.FRAMESET:{t._insertElement(e,ie.HTML);break}case l.FRAME:{t._appendElement(e,ie.HTML),e.ackSelfClosing=!0;break}case l.NOFRAMES:{Ir(t,e);break}}}function F2(t,e){e.tagID===l.FRAMESET&&!t.openElements.isRootHtmlElementCurrent()&&(t.openElements.pop(),!t.fragmentContext&&t.openElements.currentTagId!==l.FRAMESET&&(t.insertionMode=D.AFTER_FRAMESET))}function U2(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.NOFRAMES:{Ir(t,e);break}}}function H2(t,e){e.tagID===l.HTML&&(t.insertionMode=D.AFTER_AFTER_FRAMESET)}function q2(t,e){e.tagID===l.HTML?pn(t,e):Yo(t,e)}function Yo(t,e){t.insertionMode=D.IN_BODY,Ol(t,e)}function j2(t,e){switch(e.tagID){case l.HTML:{pn(t,e);break}case l.NOFRAMES:{Ir(t,e);break}}}function $2(t,e){e.chars=St,t._insertCharacters(e)}function Y2(t,e){t._insertCharacters(e),t.framesetOk=!1}function Um(t){for(;t.treeAdapter.getNamespaceURI(t.openElements.current)!==ie.HTML&&t.openElements.currentTagId!==void 0&&!t._isIntegrationPoint(t.openElements.currentTagId,t.openElements.current);)t.openElements.pop()}function z2(t,e){if(i_(e))Um(t),t._startTagOutsideForeignContent(e);else{const n=t._getAdjustedCurrentElement(),r=t.treeAdapter.getNamespaceURI(n);r===ie.MATHML?_m(e):r===ie.SVG&&(u_(e),Am(e)),Yd(e),e.selfClosing?t._appendElement(e,r):t._insertElement(e,r),e.ackSelfClosing=!0}}function W2(t,e){if(e.tagID===l.P||e.tagID===l.BR){Um(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)===ie.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 Hm(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 G2=Hm(/["&\u00A0]/g,new Map([[34,"&quot;"],[38,"&amp;"],[160,"&nbsp;"]])),K2=Hm(/[&<>\u00A0]/g,new Map([[38,"&amp;"],[60,"&lt;"],[62,"&gt;"],[160,"&nbsp;"]])),V2=new Set([K.AREA,K.BASE,K.BASEFONT,K.BGSOUND,K.BR,K.COL,K.EMBED,K.FRAME,K.HR,K.IMG,K.INPUT,K.KEYGEN,K.LINK,K.META,K.PARAM,K.SOURCE,K.TRACK,K.WBR]);function qm(t,e){return e.treeAdapter.isElementNode(t)&&e.treeAdapter.getNamespaceURI(t)===ie.HTML&&V2.has(e.treeAdapter.getTagName(t))}const X2={treeAdapter:rs,scriptingEnabled:!0};function Q2(t,e){const n={...X2,...e};return qm(t,n)?"":jm(t,n)}function jm(t,e){let n="";const r=e.treeAdapter.isElementNode(t)&&e.treeAdapter.getTagName(t)===K.TEMPLATE&&e.treeAdapter.getNamespaceURI(t)===ie.HTML?e.treeAdapter.getTemplateContent(t):t,s=e.treeAdapter.getChildNodes(r);if(s)for(const a of s)n+=Z2(a,e);return n}function Z2(t,e){return e.treeAdapter.isElementNode(t)?J2(t,e):e.treeAdapter.isTextNode(t)?tA(t,e):e.treeAdapter.isCommentNode(t)?nA(t,e):e.treeAdapter.isDocumentTypeNode(t)?rA(t,e):""}function J2(t,e){const n=e.treeAdapter.getTagName(t);return`<${n}${eA(t,e)}>${qm(t,e)?"":`${jm(t,e)}</${n}>`}`}function eA(t,{treeAdapter:e}){let n="";for(const r of e.getAttrList(t)){if(n+=" ",r.namespace)switch(r.namespace){case ie.XML:{n+=`xml:${r.name}`;break}case ie.XMLNS:{r.name!=="xmlns"&&(n+="xmlns:"),n+=r.name;break}case ie.XLINK:{n+=`xlink:${r.name}`;break}default:n+=`${r.prefix}:${r.name}`}else n+=r.name;n+=`="${G2(r.value)}"`}return n}function tA(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)===ie.HTML&&kT(a,e.scriptingEnabled)?r:K2(r)}function nA(t,{treeAdapter:e}){return`<!--${e.getCommentNodeContent(t)}-->`}function rA(t,{treeAdapter:e}){return`<!DOCTYPE ${e.getDocumentTypeNodeName(t)}>`}function sA(t,e){return Nm.parse(t,e)}function Kd(t,e,n){typeof t=="string"&&(n=e,e=t,t=null);const r=Nm.getFragmentParser(t,n);return r.tokenizer.write(e,!0),r.getFragment()}function Hn(t){return"tagName"in t}function Kr(t){return t.nodeName==="#text"}function yt(t,e){var n;return(n=t.attrs.find(r=>r.name===e))==null?void 0:n.value}function Ms(t,e){return t.attrs.some(n=>n.name===e)}function f0(t,e,n){const r=t.attrs.find(s=>s.name===e);r?r.value=n:t.attrs.push({name:e,value:n})}function Vd(t,e){t.attrs=t.attrs.filter(n=>n.name!==e)}function Bs(t){return Kd(t).childNodes}function aA(t){const e=t.trimStart().toLowerCase();return e.startsWith("<!doctype")||e.startsWith("<html")}function Ai(t){return aA(t)?sA(t).childNodes:Kd(t).childNodes}function iA(t){const e=Kd("");return e.childNodes=t,Q2(e)}const uA=[400,800,1200,1600],oA={avif:"image/avif",webp:"image/webp",jpeg:"image/jpeg",png:"image/png"};function lA(t){return t==="jpeg"?"jpg":t}function cA(t){const e=t.slice(t.lastIndexOf(".")+1).toLowerCase();return e==="png"?"png":e==="webp"?"webp":"jpeg"}function fA(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 dA(t,e,n){var T;const r=cA(e),s=[...new Set(["avif","webp",r])],a=await n.encode(t,{widths:uA,formats:s}),i=fA(t),u=e.slice(0,e.lastIndexOf(".")>=0?e.lastIndexOf("."):e.length),o=[],f=E=>{const O=`${u}.${i}-${E.width}.${lA(E.format)}`;return o.push({path:O,contents:E.bytes}),`/${O}`},h=new Map;for(const E of[...a.variants].sort((O,L)=>O.width-L.width)){const O=f(E),L=h.get(E.format)??[];L.push({url:O,width:E.width}),h.set(E.format,L)}const g=E=>(h.get(E)??[]).map(O=>`${O.url} ${O.width}w`).join(", "),d=["avif","webp"].filter(E=>h.has(E)).map(E=>({format:E,mime:oA[E],srcset:g(E)})),m=h.get(r)??[],b=((T=m[m.length-1])==null?void 0:T.url)??`/${e}`,_={width:a.sourceWidth,height:a.sourceHeight,sources:d,fallbackSrc:b,...a.blurDataUri!==void 0&&{blurDataUri:a.blurDataUri}};return{artifacts:o,info:_}}function $m(t,e){const n=t.sources.map(a=>`<source type="${a.mime}" srcset="${Tc(a.srcset)}">`).join(""),r=e.filter(([a])=>a!=="src"&&a!=="width"&&a!=="height").map(([a,i])=>` ${a}="${Tc(i)}"`).join(""),s=`<img src="${Tc(t.fallbackSrc)}" width="${t.width}" height="${t.height}" loading="lazy" decoding="async"${r}>`;return`<picture>${n}${s}</picture>`}const d0="ref:";function kl(t){return t.startsWith(d0)?t.slice(d0.length):void 0}function h0(t){const e=new Set,n=r=>{for(const s of r)if(Hn(s)){for(const a of s.attrs){const i=kl(a.value);i!==void 0&&e.add(i)}n(s.childNodes)}};return n(Ai(t)),[...e].sort()}const hA=["data-each-in","data-each","data-sort","data-limit","data-pick-from"],pA=["data-type","data-field","data-required","data-help","data-label"];function Ef(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=Cu(Ai(t.template),t.scope,e),r=t.document===void 0?n:Gm(Cu(Ai(t.document),t.scope,e),n);return mA(r,t,e),iA(r)}function mA(t,e,n){var i,u,o,f;const r=(i=e.templateStyle)==null?void 0:i.trim();if(r){const h=Bs(`<style>
4
- ${r}
5
- </style>`),g=vf(t,"head");g?g.childNodes.push(...h):t.unshift(...h)}const s=[],a=(u=e.templateScript)==null?void 0:u.trim();a&&s.push(a);for(const h of[...n.usedComponents].sort()){const g=(f=(o=e.componentScripts)==null?void 0:o.get(h))==null?void 0:f.trim();g&&s.push(g)}if(s.length>0){const h=s.flatMap(d=>Bs(`<script>
6
- ${d}
7
- <\/script>`)),g=vf(t,"body");g?g.childNodes.push(...h):t.push(...h)}}function vf(t,e){for(const n of t){if(!Hn(n))continue;if(n.tagName===e)return n;const r=vf(n.childNodes,e);if(r!==void 0)return r}}function p0(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)&&"url"in t}function Tf(t){return t==null?"":Array.isArray(t)?t.map(e=>e===null?"":String(e)).join(", "):String(t)}function Pl(t){return e=>{const n=t[e.name];if(p0(n)){if(e.path.length===1)return n.url;const r=n.fields[e.path[1]??""];return p0(r)?r.url:Tf(r)}return e.dotted?"":Tf(n)}}function Cu(t,e,n){const r=[];for(const s of t)Hn(s)?r.push(...Ym(s,e,n)):(Kr(s)&&(s.value=wl(s.value,Pl(e))),r.push(s));return r}function Ym(t,e,n){if(Ms(t,"data-each-in")||Ms(t,"data-each"))return gA(t,e,n);if(n.components.has(t.tagName))return TA(t,e,n);bA(t,e,n);const r=yt(t,"data-type");for(const a of pA)Vd(t,a);if(t.tagName==="img"&&n.media!==void 0){const a=n.media.image(yt(t,"src")??"");if(a!==void 0){const i=t.attrs.map(u=>[u.name,u.value]);return Bs($m(a,i))}}if(vA(t))return g0(t,e,"json"),[t];if(t.tagName==="script"||t.tagName==="style")return g0(t,e,"raw"),[t];const s=EA(t,r);if((s==null?void 0:s.kind)==="html"){const a=Bs(Tf(e[s.token.name]));return t.childNodes=zm(a,n),[t]}return(s==null?void 0:s.kind)==="authors"?(t.childNodes=Bs(gT(e[s.token.name],n.authorDirectory)),[t]):(t.childNodes=Cu(t.childNodes,e,n),[t])}function zm(t,e){var r;const n=[];for(const s of t){if(!Hn(s)){n.push(s);continue}if(s.childNodes=zm(s.childNodes,e),s.tagName==="img"){const i=yt(s,"src"),u=i!==void 0?(r=e.media)==null?void 0:r.image(i):void 0;if(u!==void 0){const o=s.attrs.map(f=>[f.name,f.value]);n.push(...Bs($m(u,o)));continue}i!==void 0&&f0(s,"src",m0(i,e))}const a=yt(s,"href");a!==void 0&&f0(s,"href",m0(a,e)),n.push(s)}return n}function m0(t,e){var r;const n=_f(t,e);return sl(n!==void 0?n:((r=e.media)==null?void 0:r.file(t))??t)}function _f(t,e){var r,s;const n=kl(t);if(n!==void 0)return((s=(r=e.context)==null?void 0:r.reference(n))==null?void 0:s.url)??"#"}function gA(t,e,n){if(n.context===void 0)return[];const r=yt(t,"data-each-in");let s;if(r!==void 0){const i=yt(t,"data-limit"),u=i!==void 0?Number.parseInt(i,10):void 0,o=yt(t,"data-sort");s=n.context.collection(r,{...o!==void 0&&{sort:o},...u!==void 0&&!Number.isNaN(u)&&{limit:u}})}else{const i=yt(t,"data-each")??"",u=e[i];s=(Array.isArray(u)?u.filter(f=>typeof f=="string"):typeof u=="string"?[u]:[]).map(f=>{var h;return(h=n.context)==null?void 0:h.reference(f)}).filter(f=>f!==void 0)}const a=[];for(const i of s){const u=Wm(t);for(const o of hA)Vd(u,o);a.push(...Ym(u,{...e,item:i},n))}return a}function Wm(t){if(Hn(t)){const e={...t,attrs:t.attrs.map(n=>({...n})),childNodes:[]};return e.childNodes=t.childNodes.map(Wm),e}return{...t}}function bA(t,e,n){var r;for(const s of t.attrs){if(Hs(s.value).length===0){const g=_f(s.value,n);g!==void 0&&(s.value=sl(g));continue}const a=yt(t,"data-type"),i=Ti(s.value)!==null,u=vi({tag:t.tagName,attribute:s.name,wholeValue:i,valuePrefix:$d(s.value),download:Ms(t,"download"),...a!==void 0&&{annotation:a}});let o=wl(s.value,Pl(e));const f=_f(o,n);f!==void 0&&(o=f);const h=(r=n.media)==null?void 0:r.file(o);h!==void 0&&(o=h),i&&jd(u)==="url"&&(o=sl(o)),s.value=o}}function g0(t,e,n){const r=Pl(e);for(const s of t.childNodes)Kr(s)&&(s.value=wl(s.value,a=>{const i=r(a);return n==="json"?hT(i):i}))}function EA(t,e){const n=t.childNodes.filter(i=>!(Kr(i)&&i.value.trim()==="")),r=n[0];if(n.length!==1||r===void 0||!Kr(r))return null;const s=Ti(r.value);if(s===null||s.dotted)return null;const a=vi({tag:t.tagName,wholeValue:!0,...e!==void 0&&{annotation:e}});return{token:s,kind:jd(a)}}function vA(t){var e;return t.tagName==="script"&&((e=yt(t,"type"))==null?void 0:e.toLowerCase())==="application/ld+json"}function TA(t,e,n){var h,g;const r=n.components.get(t.tagName);if(r===void 0)return[t];const s=Pl(e),a={};for(const d of t.attrs)a[d.name]=wl(d.value,s);const i=Cu(t.childNodes,e,n),u=Cu(Ai(r),a,n),o=Gm(u,i);n.usedComponents.add(t.tagName);const f=(g=(h=n.componentStyles)==null?void 0:h.get(t.tagName))==null?void 0:g.trim();if(f){const d=o.find(Hn);if(d!==void 0){const m=Bs(`<style>@scope {
8
- ${f}
9
- }</style>`);d.childNodes=[...m,...d.childNodes]}}return o}function Gm(t,e){const n=new Map,r=[];for(const s of e){const a=Hn(s)?yt(s,"slot"):void 0;if(a!==void 0){Hn(s)&&Vd(s,"slot");const i=n.get(a)??[];i.push(s),n.set(a,i)}else r.push(s)}return Af(t,n,r)}function Af(t,e,n){const r=[];for(const s of t)if(Hn(s)&&s.tagName==="slot"){const a=yt(s,"name"),i=a!==void 0?e.get(a):n;i&&i.length>0?r.push(...i):r.push(...Af(s.childNodes,e,n))}else Hn(s)&&(s.childNodes=Af(s.childNodes,e,n)),r.push(s);return r}async function _A(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 u=a++;r[u]=await n(t[u],u)}};return await Promise.all(Array.from({length:s},()=>i())),r}function Km(t){const e=b0(yt(t,"data-minlength")),n=b0(yt(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 yi(t,e=new Map){return Xm(t,e,new Set)}function Vm(t,e,n){if(n.has(t))return new Map;const r=e.get(t);if(r===void 0)return new Map;const s=Xm(r,e,new Set(n).add(t));return new Map(s.map(a=>[a.name,a.type]))}function Xm(t,e,n){const r=[],s=new Map,a=f=>{const h=s.get(f);if(h!==void 0)return h;const g={name:f,type:"shorttext",label:kd(f),required:!1,multiline:!1};return s.set(f,g),r.push(f),g},i=(f,h)=>{if(s.has(f))return;const g=a(f);g.type=h,g.multiline=qd[h].multiline},u=f=>{const h=yt(f,"data-field")??AA(f);if(h===void 0)return;const g=a(h);Ms(f,"data-required")&&(g.required=!0);const d=yt(f,"data-help");d!==void 0&&(g.help=d);const m=yt(f,"data-label");m!==void 0&&(g.label=m);const{minLength:b,maxLength:_}=Km(f);b!==void 0&&(g.minLength=b),_!==void 0&&(g.maxLength=_)},o=f=>{for(const h of f){if(!Hn(h)){if(Kr(h))continue;continue}const g=yt(h,"data-each");if(g!==void 0){const b=a(g);b.type="url",b.multiple=!0;const _=yt(h,"data-pick-from");_!==void 0&&(b.pickFrom=_),u(h);continue}if(Ms(h,"data-each-in"))continue;const d=yt(h,"data-type"),m=e.has(h.tagName)?Vm(h.tagName,e,n):void 0;for(const b of h.attrs){const _=Ti(b.value);for(const T of Hs(b.value)){if(T.dotted)continue;const E=(_==null?void 0:_.name)===T.name,O=E?m==null?void 0:m.get(b.name):void 0;i(T.name,O??vi({tag:h.tagName,attribute:b.name,wholeValue:E,valuePrefix:$d(b.value),download:Ms(h,"download"),...d!==void 0&&{annotation:d}}))}}for(const b of h.childNodes){if(!Kr(b))continue;const _=Ti(b.value);for(const T of Hs(b.value))T.dotted||i(T.name,vi({tag:h.tagName,wholeValue:(_==null?void 0:_.name)===T.name,...d!==void 0&&{annotation:d}}))}u(h),o(h.childNodes)}};return o(Ai(t)),r.map(f=>yA(s.get(f)))}function AA(t){for(const e of t.attrs){const n=Hs(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}for(const e of t.childNodes)if(Kr(e)){const n=Hs(e.value).find(r=>!r.dotted);if(n!==void 0)return n.name}}function yA(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 yf(t,e=new Map){const n=new Set,r=[],s=[],a=new Set,i=new Set,u=new Set,o=new Map,f=new Set,h=g=>{for(const d of g){if(!Hn(d))continue;const m=NA(d);m!==void 0&&u.add(m);const b=yt(d,"data-each-in");b!==void 0&&r.push(b);const _=yt(d,"data-each");if(_!==void 0&&s.push(_),Ms(d,"data-required")){const L=E0(d);L!==void 0&&n.add(L)}const T=Km(d);if(T.minLength!==void 0||T.maxLength!==void 0){const L=E0(d);L!==void 0&&o.set(L,T)}const E=yt(d,"data-type"),O=e.has(d.tagName)?Vm(d.tagName,e,new Set):void 0;for(const L of d.attrs){const B=kl(L.value);B!==void 0&&f.add(B);const I=Ti(L.value);if(I===null||I.dotted)continue;const H=(O==null?void 0:O.get(L.name))??vi({tag:d.tagName,attribute:L.name,wholeValue:!0,valuePrefix:$d(L.value),download:Ms(d,"download"),...E!==void 0&&{annotation:E}});H==="image"?a.add(I.name):H==="file"?i.add(I.name):H==="richtext"&&u.add(I.name)}h(d.childNodes)}};return h(Ai(t)),{requiredFields:[...n],queryLoopPaths:r,curatedLoopFields:s,imageFields:[...a],fileFields:[...i],richTextFields:[...u],constraints:o,references:[...f].sort()}}function NA(t){const e=t.childNodes.filter(i=>!(Kr(i)&&i.value.trim()==="")),n=e[0];if(e.length!==1||n===void 0||!Kr(n))return;const r=Ti(n.value);if(r===null||r.dotted)return;const s=yt(t,"data-type"),a=vi({tag:t.tagName,wholeValue:!0,...s!==void 0&&{annotation:s}});return jd(a)==="html"?r.name:void 0}function E0(t){const e=yt(t,"data-field");if(e!==void 0)return e;for(const n of t.attrs){const r=Hs(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}for(const n of t.childNodes)if(Kr(n)){const r=Hs(n.value).find(s=>!s.dotted);if(r!==void 0)return r.name}}function SA(t){return t.split("/").filter(e=>e!=="")}function hr(t){const e=SA(t),n=e[e.length-1]==="index"?e.slice(0,-1):e;return n.length===0?"/":`/${n.join("/")}/`}const IA=4;async function CA(t,e,n={}){const[r,s,a,i]=await Promise.all([Pd(t),Md(t),cm(t),fm(t)]),u=Qm(r,e,void 0);if(u===void 0)return;const o=n.draft??u.node.item,f=o.template??u.dirTemplate;if(f===void 0)return;const[h,g,d,m]=await Promise.all([Fd(t,f),aT(t,f),iT(t,f),Ud(t)]),b=yf(h,s),_={...u.node,item:o};let T,E=[];if(n.media!==void 0)T=n.media;else{const L=await wA(t,_,b,n.imageEncoder,IA);T=L.media,E=L.mediaArtifacts}return{html:Ef({template:h,scope:Xd(o),components:s,context:Zm(r),media:T,componentStyles:a,componentScripts:i,...n.authorDirectory!==void 0&&{authorDirectory:n.authorDirectory},...m!==void 0&&{document:m},...g!==void 0&&{templateStyle:g},...d!==void 0&&{templateScript:d}}),mediaArtifacts:E}}function Qm(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=Qm(s,e,r);if(a!==void 0)return a}}async function wA(t,e,n,r,s){const a=LA(e.path),i=e.item.fields,u=new Map,o=new Map,f=[];for(const h of n.fileFields)for(const g of _0(i[h])){const d=T0(a,g),m=await v0(t,`content/${d}`);m!==void 0&&(f.push({path:d,contents:m}),o.set(g,`/${d}`))}if(r!==void 0){const h=new Set;for(const d of n.imageFields)for(const m of _0(i[d]))h.add(m);for(const d of n.richTextFields){const m=i[d];if(typeof m=="string")for(const b of OA(m))h.add(b)}const g=await _A([...h],s,async d=>{const m=T0(a,d),b=await v0(t,`content/${m}`);if(b!==void 0)return{ref:d,...await dA(b,m,r)}});for(const d of g)d!==void 0&&(f.push(...d.artifacts),u.set(d.ref,d.info))}return{media:{image:h=>u.get(h),file:h=>o.get(h)},mediaArtifacts:f}}async function v0(t,e){try{return await t.readBytes(e)}catch{return}}function LA(t){const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function T0(t,e){return[t,e.replace(/^\/+/,"")].filter(n=>n!=="").join("/")}function OA(t){const e=[],n=r=>{for(const s of r)if(Hn(s)){if(s.tagName==="img"){const a=yt(s,"src");a!==void 0&&RA(a)&&e.push(a)}n(s.childNodes)}};return n(Bs(t)),e}function RA(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function _0(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function Xd(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 xA(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 A0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}function Zm(t){const{items:e,dirs:n}=xA(t),r=s=>({url:hr(s.path),fields:Xd(s.item)});return{collection(s,a){var d;const i=n.get(A0(s));if(i===void 0)return[];const u=((d=i.collection)==null?void 0:d.recursive)??!1,o=[],f=m=>{for(const b of m.children)b.kind==="item"?b.slug!=="index"&&b.item.isPublished&&o.push(b):u&&f(b)};f(i);const h=DA(o,a.sort);return(a.limit!==void 0?h.slice(0,a.limit):h).map(r)},reference(s){const a=e.get(A0(s));if(!(a===void 0||!a.item.isPublished))return r(a)}}}function DA(t,e){if(e===void 0)return[...t];const[n="published",r]=e.trim().split(/\s+/),s=i=>{const u=Xd(i.item)[n];return u==null?"":String(u)},a=[...t].sort((i,u)=>s(i).localeCompare(s(u)));return r==="desc"?a.reverse():a}async function kA(t){const[e,n,r]=await Promise.all([Pd(t),Md(t),Ud(t)]),{items:s,dirs:a,published:i}=PA(e);let u=null;if(r!==void 0)try{u=yf(r,n)}catch{u=null}const o=(u==null?void 0:u.requiredFields)??[],f=(u==null?void 0:u.constraints)??new Map,h=[],g=(I,H,R,q)=>{h.push({severity:I,code:H,message:R,...q!==void 0&&{path:q}})},d=(I,H,R)=>{const q=s.get(N0(I));q===void 0?g("error","reference-missing",`"${H}" references "${I}" (${R}), which does not exist.`,H):q.item.isPublished||g("error","reference-unpublished",`"${H}" references "${I}" (${R}), which is not published.`,H)},m=(I,H,R)=>{for(const[q,{minLength:Q,maxLength:Y}]of I){const v=H[q];if(typeof v!="string"||v==="")continue;const{length:M}=v;Q!==void 0&&M<Q&&g("warning","value-too-short",`"${R}" field "${q}" is ${M} characters; the minimum is ${Q}.`,R),Y!==void 0&&M>Y&&g("warning","value-too-long",`"${R}" field "${q}" is ${M} characters; the maximum is ${Y}.`,R)}},b=new Map,_=async I=>{const H=b.get(I);if(H!==void 0||b.has(I))return H??null;let R;try{R=yf(await Fd(t,I),n)}catch{R=null}return b.set(I,R),R},T=new Map;for(const{node:I,templateName:H}of i){const R=T.get(hr(I.path))??[];if(R.push(I.path),T.set(hr(I.path),R),H===void 0){g("error","no-template",`"${I.path}" has no template (no per-item or folder default).`,I.path);continue}const q=await _(H);if(q===null){g("error","template-missing",`"${I.path}" uses template "${H}", which does not exist.`,I.path);continue}const Q=MA(I.item);for(const Y of q.requiredFields)y0(Q[Y])&&g("error","required-empty",`"${I.path}" is missing required field "${Y}".`,I.path);for(const Y of o)y0(Q[Y])&&g("error","required-empty",`"${I.path}" is missing required meta field "${Y}" (document shell).`,I.path);m(q.constraints,Q,I.path),m(f,Q,I.path);for(const Y of q.queryLoopPaths)a.has(N0(Y))||g("error","loop-target-missing",`"${I.path}" loops over "${Y}", which is not a directory.`,I.path);for(const Y of q.curatedLoopFields)for(const v of BA(I.item.fields[Y]))d(v,I.path,`field "${Y}"`);for(const[Y,v]of Object.entries(Q)){if(typeof v!="string")continue;const M=kl(v);if(M!==void 0&&d(M,I.path,`field "${Y}"`),q.richTextFields.includes(Y))for(const S of h0(v))d(S,I.path,`field "${Y}"`)}}const E=nt.templates;if(u!==null)for(const I of u.references)d(I,`${E}/${Zu}.html`,"link");for(const[I,H]of b)if(H!==null)for(const R of H.references)d(R,`${E}/${I}.html`,"link");for(const[I,H]of n)for(const R of h0(H))d(R,`${nt.components}/${I}.html`,"link");for(const[I,H]of T)H.length>1&&g("error","url-collision",`URL ${I} is produced by multiple items: ${H.join(", ")}.`);const O=new Map;for(const I of await FA(t)){const R=I.slice(I.lastIndexOf("/")+1).slice(0,-5).toLowerCase(),q=O.get(R)??[];q.push(`${nt.components}/${I}`),O.set(R,q)}for(const[I,H]of[...O].sort(([R],[q])=>R.localeCompare(q)))H.length>1&&g("error","component-tag-collision",`Multiple components resolve to <${I}>: ${H.join(", ")}.`);const L=h.filter(I=>I.severity==="error"),B=h.filter(I=>I.severity==="warning");return{diagnostics:h,errors:L,warnings:B,ok:L.length===0}}function PA(t){const e=new Map,n=new Map,r=[],s=(a,i)=>{n.set(a.path,a);const u=a.defaultTemplate??i;for(const o of a.children){if(o.kind==="dir"){s(o,u);continue}e.set(o.path,o),o.item.isPublished&&r.push({node:o,templateName:o.item.template??u})}};return s(t,void 0),{items:e,dirs:n,published:r}}function MA(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 y0(t){return t==null||t===""?!0:Array.isArray(t)?t.length===0:!1}function BA(t){return typeof t=="string"?[t]:Array.isArray(t)?t.filter(e=>typeof e=="string"):[]}function N0(t){return t.replace(/^\/+/,"").replace(/\/+$/,"")}async function FA(t){const e=nt.components;if(!await t.exists(e))return[];const n=[],r=async(s,a)=>{for(const i of await t.list(s)){const u=a===""?i.name:`${a}/${i.name}`;i.kind==="dir"?await r(`${s}/${i.name}`,u):i.name.endsWith(".html")&&n.push(u)}};return await r(e,""),n.sort()}function yc(t,e){return t===null?!1:t.roles.includes("admin")?!0:t.roles.includes(e)}let Jm="";function ga(t){return`${Jm}${t}`}function UA(t){Jm=t.replace(/\/+$/,"")}async function HA(){try{const t=await fetch("/config.json",{cache:"no-store"});if(!t.ok)return;const e=await t.json();typeof e.apiUrl=="string"&&UA(e.apiUrl)}catch{}}async function mt(t,e={}){const n=typeof t=="string"?ga(t):t,r=await S0(n,e,ht.token);if(r.status!==401||ht.token===null)return r;const s=await ht.refresh();return s===null?r:S0(n,e,s)}async function S0(t,e,n){const r=new Headers(e.headers);return n!==null&&r.set("authorization",`Bearer ${n}`),fetch(t,{...e,headers:r})}async function Oa(t,e){const n=await mt(t,e);return n.ok?{ok:!0}:{ok:!1,error:(await n.json().catch(()=>({}))).error??`HTTP ${n.status}`}}const yo="nanoesis.jwt",qA=540*1e3;function jA(){let t=ee("loading"),e=ee(null),n=ee(null),r=ee(!1),s=null;function a(E,O){y(e,E,!0),y(n,O,!0),y(t,"authenticated"),localStorage.setItem(yo,E),u()}function i(){y(e,null),y(n,null),y(t,"unauthenticated"),localStorage.removeItem(yo),o()}function u(){o(),s=setInterval(()=>{f()},qA)}function o(){s!==null&&(clearInterval(s),s=null)}async function f(){if(c(e)===null)return null;const E=c(e),O=await fetch(ga("/api/refresh"),{method:"POST",headers:{authorization:`Bearer ${E}`}});if(!O.ok)return i(),null;const L=await O.json().catch(()=>({}));return!L.ok||L.token===void 0||L.principal===void 0?(i(),null):(a(L.token,L.principal),L.token)}async function h(){y(t,"loading");let E;try{E=await fetch(ga("/api/auth/state"))}catch{y(t,"no-auth");return}if(E.status===404){y(t,"no-auth");return}if(!E.ok){y(t,"unauthenticated");return}const O=await E.json();y(r,O.firstRun,!0);const L=localStorage.getItem(yo);L!==null&&L!==""&&(y(e,L,!0),await f()!==null)||y(t,"unauthenticated")}async function g(E,O){const L=await fetch(ga("/api/login"),{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({username:E,password:O})}),B=await L.json().catch(()=>({}));return!L.ok||!B.ok||B.token===void 0||B.principal===void 0?{ok:!1,error:B.error??`HTTP ${L.status}`}:(y(r,!1),a(B.token,B.principal),{ok:!0})}async function d(){if(c(e)!==null)try{await mt("/api/logout",{method:"POST"})}catch{}i()}async function m(E,O){const L=await mt("/api/me/password",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({currentPassword:E,newPassword:O})}),B=await L.json().catch(()=>({}));return!L.ok||!B.ok||B.token===void 0?{ok:!1,error:B.error??`HTTP ${L.status}`}:(y(e,B.token,!0),localStorage.setItem(yo,B.token),{ok:!0})}async function b(){const E=await mt("/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 _(){const E=await mt("/api/me/token",{method:"DELETE"});return E.ok?{ok:!0}:{ok:!1,error:(await E.json().catch(()=>({}))).error??`HTTP ${E.status}`}}function T(){return c(t)==="no-auth"}return{get status(){return c(t)},get token(){return c(e)},get principal(){return c(n)},get firstRun(){return c(r)},get canAuthor(){return T()||yc(c(n),"author")},get canDevelop(){return T()||yc(c(n),"developer")},get isAdmin(){return T()||yc(c(n),"admin")},init:h,login:g,logout:d,refresh:f,changePassword:m,createMcpToken:b,revokeMcpTokens:_}}const ht=jA(),I0={name:null,logoUrl:null};async function $A(){try{const t=await fetch(ga("/api/branding"));if(!t.ok)return I0;const e=await t.json();return e.logoUrl===null?e:{name:e.name,logoUrl:ga(e.logoUrl)}}catch{return I0}}function YA(t){return Oa("/api/branding",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:t})})}function zA(t){return Oa("/api/branding/logo",{method:"POST",headers:{"content-type":t.type},body:t})}function WA(){return Oa("/api/branding/logo",{method:"DELETE"})}function GA(){let t=ee(null),e=ee(null);async function n(){const r=await $A();y(t,r.name,!0),y(e,r.logoUrl,!0)}return{get name(){return c(t)},get logoUrl(){return c(e)},load:n}}const Tn=GA(),KA="modulepreload",VA=function(t,e){return new URL(t,e).href},C0={},XA=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(d=>({status:"fulfilled",value:d}),d=>({status:"rejected",reason:d}))))};const u=document.getElementsByTagName("link"),o=document.querySelector("meta[property=csp-nonce]"),f=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=i(n.map(h=>{if(h=VA(h,r),h in C0)return;C0[h]=!0;const g=h.endsWith(".css"),d=g?'[rel="stylesheet"]':"";if(!!r)for(let _=u.length-1;_>=0;_--){const T=u[_];if(T.href===h&&(!g||T.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${h}"]${d}`))return;const b=document.createElement("link");if(b.rel=g?"stylesheet":KA,g||(b.as="script"),b.crossOrigin="",b.href=h,f&&b.setAttribute("nonce",f),document.head.appendChild(b),g)return new Promise((_,T)=>{b.addEventListener("load",_),b.addEventListener("error",()=>T(new Error(`Unable to preload CSS for ${h}`)))})}))}function a(i){const u=new Event("vite:preloadError",{cancelable:!0});if(u.payload=i,window.dispatchEvent(u),!u.defaultPrevented)throw i}return s.then(i=>{for(const u of i||[])u.status==="rejected"&&a(u.reason);return e().catch(a)})};function $s(t){return Array.isArray?Array.isArray(t):tg(t)==="[object Array]"}function QA(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 Nf(t){return t==null?"":QA(t)}function _n(t){return typeof t=="string"}function zo(t){return typeof t=="number"}function ZA(t){return t===!0||t===!1||JA(t)&&tg(t)=="[object Boolean]"}function eg(t){return typeof t=="object"}function JA(t){return eg(t)&&t!==null}function On(t){return t!=null}function No(t){return!t.trim().length}function tg(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const e3="Incorrect 'index' type",t3=t=>`Invalid value for key ${t}`,n3=t=>`Pattern length exceeds max of ${t}.`,r3=t=>`Missing ${t} property in key`,s3=t=>`Property 'weight' in key '${t}' must be a positive integer`,w0=Object.prototype.hasOwnProperty;class a3{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(r=>{const s=ng(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 ng(t){let e=null,n=null,r=null,s=1,a=null;if(_n(t)||$s(t))r=t,e=L0(t),n=Sf(t);else{if(!w0.call(t,"name"))throw new Error(r3("name"));const i=t.name;if(r=i,w0.call(t,"weight")&&(s=t.weight,s<=0))throw new Error(s3(i));e=L0(i),n=Sf(i),a=t.getFn}return{path:e,id:n,weight:s,src:r,getFn:a}}function L0(t){return $s(t)?t:t.split(".")}function Sf(t){return $s(t)?t.join("."):t}function i3(t,e){const n=[];let r=!1;const s=(a,i,u,o)=>{if(On(a))if(!i[u])n.push(o!==void 0?{v:a,i:o}:a);else{const f=i[u],h=a[f];if(!On(h))return;if(u===i.length-1&&(_n(h)||zo(h)||ZA(h)||typeof h=="bigint"))n.push(o!==void 0?{v:Nf(h),i:o}:Nf(h));else if($s(h)){r=!0;for(let g=0,d=h.length;g<d;g+=1)s(h[g],i,u+1,g)}else i.length&&s(h,i,u+1,o)}};return s(t,_n(e)?e.split("."):e,0),r?n:n[0]}const u3={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},o3={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},l3={location:0,threshold:.6,distance:100},c3={useExtendedSearch:!1,useTokenSearch:!1,getFn:i3,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},Fe=Object.freeze({...o3,...u3,...l3,...c3}),f3=/[^ ]+/g;function d3(t=1,e=3){const n=new Map,r=Math.pow(10,e);return{get(s){const a=s.match(f3).length;if(n.has(a))return n.get(a);const i=1/Math.pow(a,.5*t),u=parseFloat(Math.round(i*r)/r);return n.set(a,u),u},clear(){n.clear()}}}class Qd{constructor({getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){this.norm=d3(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,_n(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();_n(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(!On(e)||No(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(On(i)){if($s(i)){const u=[];for(let o=0,f=i.length;o<f;o+=1){const h=i[o];if(On(h)){if(_n(h)){if(!No(h)){const g={v:h,i:o,n:this.norm.get(h)};u.push(g)}}else if(On(h.v)){const g=_n(h.v)?h.v:Nf(h.v);if(!No(g)){const d={v:g,i:h.i,n:this.norm.get(g)};u.push(d)}}}}r.$[a]=u}else if(_n(i)&&!No(i)){const u={v:i,n:this.norm.get(i)};r.$[a]=u}}}),this.records.push(r)}toJSON(){return{keys:this.keys.map(({getFn:e,...n})=>n),records:this.records}}}function rg(t,e,{getFn:n=Fe.getFn,fieldNormWeight:r=Fe.fieldNormWeight}={}){const s=new Qd({getFn:n,fieldNormWeight:r});return s.setKeys(t.map(ng)),s.setSources(e),s.create(),s}function h3(t,{getFn:e=Fe.getFn,fieldNormWeight:n=Fe.fieldNormWeight}={}){const{keys:r,records:s}=t,a=new Qd({getFn:e,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(s),a}function p3(t=[],e=Fe.minMatchCharLength){const n=[];let r=-1,s=-1,a=0;for(let i=t.length;a<i;a+=1){const u=t[a];u&&r===-1?r=a:!u&&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 m3(t,e,n,{location:r=Fe.location,distance:s=Fe.distance,threshold:a=Fe.threshold,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,includeMatches:o=Fe.includeMatches,ignoreLocation:f=Fe.ignoreLocation}={}){if(e.length>ea)throw new Error(n3(ea));const h=e.length,g=t.length,d=Math.max(0,Math.min(r,g));let m=a,b=d;const _=(q,Q)=>{const Y=q/h;if(f)return Y;const v=Math.abs(d-Q);return s?Y+v/s:v?1:Y},T=u>1||o,E=T?Array(g):[];let O;for(;(O=t.indexOf(e,b))>-1;){const q=_(0,O);if(m=Math.min(q,m),b=O+h,T){let Q=0;for(;Q<h;)E[O+Q]=1,Q+=1}}b=-1;let L=[],B=1,I=h+g;const H=1<<h-1;for(let q=0;q<h;q+=1){let Q=0,Y=I;for(;Q<Y;)_(q,d+Y)<=m?Q=Y:I=Y,Y=Math.floor((I-Q)/2+Q);I=Y;let v=Math.max(1,d-Y+1);const M=i?g:Math.min(d+Y,g)+h,S=Array(M+2);S[M+1]=(1<<q)-1;for(let F=M;F>=v;F-=1){const k=F-1,V=n[t[k]];if(T&&(E[k]=+!!V),S[F]=(S[F+1]<<1|1)&V,q&&(S[F]|=(L[F+1]|L[F])<<1|1|L[F+1]),S[F]&H&&(B=_(q,k),B<=m)){if(m=B,b=k,b<=d)break;v=Math.max(1,2*d-b)}}if(_(q+1,d)>m)break;L=S}const R={isMatch:b>=0,score:Math.max(.001,B)};if(T){const q=p3(E,u);q.length?o&&(R.indices=q):R.isMatch=!1}return R}function g3(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 Zd(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 sg={ł:"l",Ł:"L",đ:"d",Đ:"D",ø:"o",Ø:"O",ħ:"h",Ħ:"H",ŧ:"t",Ŧ:"T",ı:"i",ß:"ss"},b3=new RegExp("["+Object.keys(sg).join("")+"]","g"),wu=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(b3,e=>sg[e]):t=>t;class Jd{constructor(e,{location:n=Fe.location,threshold:r=Fe.threshold,distance:s=Fe.distance,includeMatches:a=Fe.includeMatches,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,isCaseSensitive:o=Fe.isCaseSensitive,ignoreDiacritics:f=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){if(this.options={location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:u,isCaseSensitive:o,ignoreDiacritics:f,ignoreLocation:h},e=o?e:e.toLowerCase(),e=f?wu(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const g=(m,b)=>{this.chunks.push({pattern:m,alphabet:g3(m),startIndex:b})},d=this.pattern.length;if(d>ea){let m=0;const b=d%ea,_=d-b;for(;m<_;)g(this.pattern.substr(m,ea),m),m+=ea;if(b){const T=d-ea;g(this.pattern.substr(T),T)}}else g(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s}=this.options;if(e=n?e:e.toLowerCase(),e=r?wu(e):e,this.pattern===e){const _={isMatch:!0,score:0};return s&&(_.indices=[[0,e.length-1]]),_}const{location:a,distance:i,threshold:u,findAllMatches:o,minMatchCharLength:f,ignoreLocation:h}=this.options,g=[];let d=0,m=!1;this.chunks.forEach(({pattern:_,alphabet:T,startIndex:E})=>{const{isMatch:O,score:L,indices:B}=m3(e,_,T,{location:a+E,distance:i,threshold:u,findAllMatches:o,minMatchCharLength:f,includeMatches:s,ignoreLocation:h});O&&(m=!0),d+=L,O&&B&&g.push(...B)});const b={isMatch:m,score:m?d/this.chunks.length:1};return m&&s&&(b.indices=Zd(g)),b}}class Ys{constructor(e){this.pattern=e}static isMultiMatch(e){return O0(e,this.multiRegex)}static isSingleMatch(e){return O0(e,this.singleRegex)}search(e){return{isMatch:!1,score:1}}}function O0(t,e){const n=t.match(e);return n?n[1]:null}class E3 extends Ys{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 v3 extends Ys{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 T3 extends Ys{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 _3 extends Ys{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 A3 extends Ys{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 y3 extends Ys{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 ag extends Ys{constructor(e,{location:n=Fe.location,threshold:r=Fe.threshold,distance:s=Fe.distance,includeMatches:a=Fe.includeMatches,findAllMatches:i=Fe.findAllMatches,minMatchCharLength:u=Fe.minMatchCharLength,isCaseSensitive:o=Fe.isCaseSensitive,ignoreDiacritics:f=Fe.ignoreDiacritics,ignoreLocation:h=Fe.ignoreLocation}={}){super(e),this._bitapSearch=new Jd(e,{location:n,threshold:r,distance:s,includeMatches:a,findAllMatches:i,minMatchCharLength:u,isCaseSensitive:o,ignoreDiacritics:f,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ig extends Ys{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 If=[E3,ig,T3,_3,y3,A3,v3,ag],R0=If.length,N3="\0",S3="|";function I3(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 C3(t,e={}){return t.replace(/\\\|/g,N3).split(S3).map(r=>{const s=r.replace(/\u0000/g,"|"),a=I3(s.trim()).filter(u=>u&&!!u.trim()),i=[];for(let u=0,o=a.length;u<o;u+=1){const f=a[u];let h=!1,g=-1;for(;!h&&++g<R0;){const d=If[g],m=d.isMultiMatch(f);m&&(i.push(new d(m,e)),h=!0)}if(!h)for(g=-1;++g<R0;){const d=If[g],m=d.isSingleMatch(f);if(m){i.push(new d(m,e));break}}}return i})}const w3=new Set([ag.type,ig.type]);class L3{constructor(e,{isCaseSensitive:n=Fe.isCaseSensitive,ignoreDiacritics:r=Fe.ignoreDiacritics,includeMatches:s=Fe.includeMatches,minMatchCharLength:a=Fe.minMatchCharLength,ignoreLocation:i=Fe.ignoreLocation,findAllMatches:u=Fe.findAllMatches,location:o=Fe.location,threshold:f=Fe.threshold,distance:h=Fe.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:r,includeMatches:s,minMatchCharLength:a,findAllMatches:u,ignoreLocation:i,location:o,threshold:f,distance:h},e=n?e:e.toLowerCase(),e=r?wu(e):e,this.pattern=e,this.query=C3(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?wu(e):e;let i=0;const u=[];let o=0,f=!1;for(let h=0,g=n.length;h<g;h+=1){const d=n[h];u.length=0,i=0,f=!1;for(let m=0,b=d.length;m<b;m+=1){const _=d[m],{isMatch:T,indices:E,score:O}=_.search(e);if(T){i+=1,o+=O;const L=_.constructor.type;L.startsWith("inverse")&&(f=!0),r&&(w3.has(L)?u.push(...E):u.push(E))}else{o=0,i=0,u.length=0,f=!1;break}}if(i){const m={isMatch:!0,score:o/i};return f&&(m.hasInverse=!0),r&&(m.indices=Zd(u)),m}}return{isMatch:!1,score:1}}}const Cf=[];function eh(...t){Cf.push(...t)}function ol(t,e){for(let n=0,r=Cf.length;n<r;n+=1){const s=Cf[n];if(s.condition(t,e))return new s(t,e)}return new Jd(t,e)}const ll={AND:"$and",OR:"$or"},wf={PATH:"$path",PATTERN:"$val"},Lf=t=>!!(t[ll.AND]||t[ll.OR]),O3=t=>!!t[wf.PATH],R3=t=>!$s(t)&&eg(t)&&!Lf(t),x0=t=>({[ll.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function ug(t,e,{auto:n=!0}={}){const r=s=>{if(_n(s)){const o={keyId:null,pattern:s};return n&&(o.searcher=ol(s,e)),o}const a=Object.keys(s),i=O3(s);if(!i&&a.length>1&&!Lf(s))return r(x0(s));if(R3(s)){const o=i?s[wf.PATH]:a[0],f=i?s[wf.PATTERN]:s[o];if(!_n(f))throw new Error(t3(o));const h={keyId:Sf(o),pattern:f};return n&&(h.searcher=ol(f,e)),h}const u={children:[],operator:a[0]};return a.forEach(o=>{const f=s[o];$s(f)&&f.forEach(h=>{u.children.push(r(h))})}),u};return Lf(t)||(t=x0(t)),r(t)}function Of(t,{ignoreFieldNorm:e=Fe.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 x3(t,{ignoreFieldNorm:e=Fe.ignoreFieldNorm}){t.forEach(n=>{n.score=Of(n.matches,{ignoreFieldNorm:e})})}class D3{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 u=n[e];n[e]=n[s],n[s]=u}}while(s!==e)}}function k3(t,e){const n=t.matches;e.matches=[],On(n)&&n.forEach(r=>{if(!On(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 P3(t,e){e.score=t.score}function M3(t,e,{includeMatches:n=Fe.includeMatches,includeScore:r=Fe.includeScore}={}){const s=[];return n&&s.push(k3),r&&s.push(P3),t.map(a=>{const{idx:i}=a,u={item:e[i],refIndex:i};return s.length&&s.forEach(o=>{o(a,u)}),u})}const B3=/\b\w+\b/g;function Rf({isCaseSensitive:t=!1,ignoreDiacritics:e=!1}={}){return{tokenize(n){return t||(n=n.toLowerCase()),e&&(n=wu(n)),n.match(B3)||[]}}}function F3(t,e,n){const r=new Map,s=new Map;let a=0;function i(u,o,f,h){const g=n.tokenize(u);if(!g.length)return;a++;const d=new Map;for(const m of g)d.set(m,(d.get(m)||0)+1);for(const[m,b]of d){const _={docIdx:o,keyIdx:f,subIdx:h,tf:b};let T=r.get(m);T||(T=[],r.set(m,T)),T.push(_),s.set(m,(s.get(m)||0)+1)}}for(const u of t){const{i:o,v:f,$:h}=u;if(f!==void 0){i(f,o,-1,-1);continue}if(h)for(let g=0;g<e;g++){const d=h[g];if(d)if(Array.isArray(d))for(const m of d)i(m.v,o,g,m.i??-1);else i(d.v,o,g,-1)}}return{terms:r,fieldCount:a,df:s}}function U3(t,e,n,r){const{i:s,v:a,$:i}=e;function u(o,f,h){const g=r.tokenize(o);if(!g.length)return;t.fieldCount++;const d=new Map;for(const m of g)d.set(m,(d.get(m)||0)+1);for(const[m,b]of d){const _={docIdx:s,keyIdx:f,subIdx:h,tf:b};let T=t.terms.get(m);T||(T=[],t.terms.set(m,T)),T.push(_),t.df.set(m,(t.df.get(m)||0)+1)}}if(a!==void 0){u(a,-1,-1);return}if(i)for(let o=0;o<n;o++){const f=i[o];if(f)if(Array.isArray(f))for(const h of f)u(h.v,o,h.i??-1);else u(f.v,o,-1)}}function D0(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 zs{constructor(e,n,r){this.options={...Fe,...n},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new a3(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=ol(e,n);return this._lastQuery=e,this._lastSearcher=r,r}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Qd))throw new Error(e3);if(this._myIndex=n||rg(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){const r=Rf({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});this._invertedIndex=F3(this._myIndex.records,this._myIndex.keys.length,r)}}add(e){if(On(e)&&(this._docs.push(e),this._myIndex.add(e),this._invertedIndex)){const n=this._myIndex.records[this._myIndex.records.length-1],r=Rf({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics});U3(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)D0(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&&D0(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:u,ignoreFieldNorm:o}=this.options;if(_n(e)&&!e.trim()){let g=this._docs.map((d,m)=>({item:d,refIndex:m}));return zo(r)&&r>-1&&(g=g.slice(0,r)),g}const f=zo(r)&&r>0&&_n(e);let h;if(f){const g=new D3(r);_n(this._docs[0])?this._searchStringList(e,{heap:g,ignoreFieldNorm:o}):this._searchObjectList(e,{heap:g,ignoreFieldNorm:o}),h=g.extractSorted(u)}else h=_n(e)?_n(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),x3(h,{ignoreFieldNorm:o}),i&&h.sort(u),zo(r)&&r>-1&&(h=h.slice(0,r));return M3(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:u,i:o,n:f})=>{if(!On(u))return;const{isMatch:h,score:g,indices:d}=s.searchIn(u);if(h){const m={item:u,idx:o,matches:[{score:g,value:u,norm:f,indices:d}]};n?(m.score=Of(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):i.push(m)}}),i}_searchLogical(e){const n=ug(e,this.options),r=(u,o,f)=>{if(!("children"in u)){const{keyId:m,searcher:b}=u;let _;return m===null?(_=[],this._myIndex.keys.forEach((T,E)=>{_.push(...this._findMatches({key:T,value:o[E],searcher:b}))})):_=this._findMatches({key:this._keyStore.get(m),value:this._myIndex.getValueForItemAtKeyId(o,m),searcher:b}),_&&_.length?[{idx:f,item:o,matches:_}]:[]}const{children:h,operator:g}=u,d=[];for(let m=0,b=h.length;m<b;m+=1){const _=h[m],T=r(_,o,f);if(T.length)d.push(...T);else if(g===ll.AND)return[]}return d},s=this._myIndex.records,a=new Map,i=[];return s.forEach(({$:u,i:o})=>{if(On(u)){const f=r(n,u,o);f.length&&(a.has(o)||(a.set(o,{idx:o,item:u,matches:[]}),i.push(a.get(o))),f.forEach(({matches:h})=>{a.get(o).matches.push(...h)}))}}),i}_searchObjectList(e,{heap:n,ignoreFieldNorm:r}={}){const s=this._getSearcher(e),{keys:a,records:i}=this._myIndex,u=n?null:[];return i.forEach(({$:o,i:f})=>{if(!On(o))return;const h=[];let g=!1,d=!1;if(a.forEach((m,b)=>{const _=this._findMatches({key:m,value:o[b],searcher:s});_.length?(h.push(..._),_[0].hasInverse&&(d=!0)):g=!0}),!(d&&g)&&h.length){const m={idx:f,item:o,matches:h};n?(m.score=Of(m.matches,{ignoreFieldNorm:r}),n.shouldInsert(m.score)&&n.insert(m)):u.push(m)}}),u}_findMatches({key:e,value:n,searcher:r}){if(!On(n))return[];const s=[];if($s(n))n.forEach(({v:a,i,n:u})=>{if(!On(a))return;const{isMatch:o,score:f,indices:h,hasInverse:g}=r.searchIn(a);o&&s.push({score:f,key:e,value:a,idx:i,norm:u,indices:h,hasInverse:g})});else{const{v:a,n:i}=n,{isMatch:u,score:o,indices:f,hasInverse:h}=r.searchIn(a);u&&s.push({score:o,key:e,value:a,norm:i,indices:f,hasInverse:h})}return s}}class H3{static condition(e,n){return n.useTokenSearch}constructor(e,n){this.options=n,this.analyzer=Rf({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 u of r){this.termSearchers.push(new Jd(u,{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 o=a.get(u)||0,f=Math.log(1+(i-o+.5)/(o+.5));this.idfWeights.push(f)}}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};const n=[];let r=0,s=0,a=0;for(let o=0;o<this.termSearchers.length;o++){const f=this.termSearchers[o].searchIn(e),h=this.idfWeights[o];s+=h,f.isMatch&&(a++,r+=h*(1-f.score),f.indices&&n.push(...f.indices))}if(a===0)return{isMatch:!1,score:1};const i=s>0?1-r/s:0,u={isMatch:!0,score:Math.max(.001,i)};return this.options.includeMatches&&n.length&&(u.indices=Zd(n)),u}}zs.version="7.3.0";zs.createIndex=rg;zs.parseIndex=h3;zs.config=Fe;zs.match=function(t,e,n){return ol(t,{...Fe,...n}).searchIn(e)};zs.parseQuery=ug;eh(L3);eh(H3);zs.use=function(...t){t.forEach(e=>eh(e))};function q3(t,e,n=30){const r=e.trim().toLowerCase();if(r==="")return[];const s=[],a=new Set,i=o=>{a.has(o.path)||(a.add(o.path),s.push(o))};for(const o of t)o.title.toLowerCase()===r&&i(o);for(const o of t)o.title.toLowerCase().startsWith(r)&&i(o);for(const o of t)o.title.toLowerCase().includes(r)&&i(o);const u=new zs(t,{keys:["title"],threshold:.4,ignoreLocation:!0});for(const o of u.search(e))i(o.item);return s.slice(0,n)}const j3=new Set(["jpg","jpeg","png","webp","avif","gif","svg"]);function og(t){const e=t.lastIndexOf(".");return e>0?t.slice(e+1).toLowerCase():""}function lg(...t){return t.filter(e=>e!=="").join("/")}function $3(t){return j3.has(og(t))}function Y3(t){return lg(nt.content,t,"assets")}function Lu(t,e){return lg(nt.content,t,e)}function eo(t,e){return ga(`/api/read?path=${encodeURIComponent(Lu(t,e))}`)}function cg(t){return`assets/${t}`}function fg(t){const e=t.lastIndexOf("."),n=e>0?t.slice(0,e):t,r=og(t),s=os(n)||"image";return r===""?s:`${s}.${r}`}class z3{async list(e){return await(await mt(`/api/list?dir=${encodeURIComponent(e)}`)).json()}async readText(e){const n=await mt(`/api/read?path=${encodeURIComponent(e)}`);if(!n.ok)throw new Error(`Not found: ${e}`);return n.text()}async readBytes(e){const n=await mt(`/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 mt(`/api/exists?path=${encodeURIComponent(e)}`)).json()).exists}}function Wo(t){const e=t.lastIndexOf("/");return e===-1?t:t.slice(e+1)}function k0(t,e){const n=t.lastIndexOf("/");return n===-1?e:`${t.slice(0,n+1)}${e}`}let Nc=ee(0);const th={get value(){return c(Nc)},bump(){y(Nc,c(Nc)+1)}};function W3(t){return{image:()=>{},file:e=>G3(e)?eo(t,e):void 0}}function G3(t){return t.startsWith("assets/")}const K3=`<svg xmlns='http://www.w3.org/2000/svg' width='800' height='450' viewBox='0 0 800 450' role='img' aria-label='Image placeholder'>
10
- <rect width='800' height='450' fill='#e2e8f0'/>
11
- <path d='M0 0 800 450 M800 0 0 450' stroke='#cbd5e1' stroke-width='2'/>
12
- <rect x='300' y='150' width='200' height='130' rx='10' fill='#cbd5e1'/>
13
- <circle cx='350' cy='195' r='18' fill='#94a3b8'/>
14
- <path d='M308 280 380 210 432 258 470 228 492 280Z' fill='#94a3b8'/>
15
- <text x='400' y='330' font-family='system-ui, sans-serif' font-size='24' fill='#64748b' text-anchor='middle'>image</text>
16
- </svg>`,dg=`data:image/svg+xml,${encodeURIComponent(K3)}`;function V3(t){switch(t.type){case"image":return dg;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 X3(t){const e={};for(const n of t)n.multiple!==!0&&(e[n.name]=V3(n));return e}function Q3(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 Z3(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 J3(t){return t.startsWith(`${nt.components}/`)}function ey(t){const e=t.replace(/\.html$/,""),n=e.lastIndexOf("/");return(n===-1?e:e.slice(n+1)).toLowerCase()}function ty(t,e){const n=e.filter(s=>s.multiple!==!0).map(s=>`${s.name}="{${s.name}}"`).join(" "),r=n===""?`<${t}>`:`<${t} ${n}>`;return`<!doctype html>
17
- <html lang="en">
18
- <head>
19
- <meta charset="utf-8" />
20
- <meta name="viewport" content="width=device-width, initial-scale=1" />
21
- <title>${t} preview</title>
22
- <style>body { margin: 16px; font-family: system-ui, sans-serif; }</style>
23
- </head>
24
- <body>
25
- ${r}Sample slot content</${t}>
26
- </body>
27
- </html>`}function P0(){return{image:()=>{},file:t=>ry(t)?dg:void 0}}const ny=/\.(?:apng|avif|gif|jpe?g|png|svg|webp)$/i;function ry(t){return t===""||t.startsWith("/")||t.startsWith("data:")||/^[a-z][a-z0-9+.-]*:/i.test(t)?!1:ny.test(t)}const rt=new z3,xf=new Map;let Df,kf,Pf,cl,Mf;function nh(){return Mf??(Mf=Pd(rt)),Mf}async function Bf(){const t=[],e=n=>{for(const r of n.children)r.kind==="dir"&&(t.push(r.path),e(r))};return e(await nh()),t.sort()}async function sy(){const t=await mt("/api/authors");return t.ok?await t.json():[]}function Di(){Mf=void 0,th.bump()}const M0=".json",rh="_sort.json",ay="assets",iy=new Set([rh,"_redirects.json","_site.json"]);function Ff(t,e){return t===""?e:`${t}/${e}`}function sh(t){return t===""?nt.content:`${nt.content}/${t}`}async function ah(t){try{return um(JSON.parse(await rt.readText(`${t}/${rh}`)))}catch{return{order:[]}}}function uy(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 oy(t){try{const{title:e}=Qu(JSON.parse(await rt.readText(t)));return e===""?void 0:e}catch{return}}async function Uf(t){return t===""?"Home":(await ah(sh(t))).name??kd(Wo(t))}async function ly(t){return await oy(Os(Ff(t,"index")))??await Uf(t)}async function hg(t){const e=sh(t),[n,r]=await Promise.all([rt.list(e),ah(e)]),s=new Map;for(const a of n)if(a.kind==="file"){if(iy.has(a.name)||!a.name.endsWith(M0))continue;const i=a.name.slice(0,-M0.length);try{const u=Qu(JSON.parse(await rt.readText(`${e}/${a.name}`)));s.set(i,{kind:"item",slug:i,path:Ff(t,i),title:u.title,isPublished:u.isPublished,template:u.template})}catch{}}else if(a.name!==ay){const i=Ff(t,a.name);s.set(a.name,{kind:"dir",slug:a.name,path:i,name:await ly(i)})}return{entries:uy(s,r.order),defaultTemplate:r.defaultTemplate}}function cy(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 pg(t,e=30){return t.trim()===""?[]:q3(cy(await nh()),t,e)}async function fy(t,e){if(e!==void 0&&e!=="")return e;let n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"";for(;;){const r=await ah(sh(n));if(r.defaultTemplate!==void 0&&r.defaultTemplate!=="")return r.defaultTemplate;if(n==="")break;n=n.includes("/")?n.slice(0,n.lastIndexOf("/")):""}}async function dy(t){const e=xf.get(t);if(e!==void 0)return e;const n=await Fd(rt,t);return xf.set(t,n),n}function to(){return Df??(Df=Md(rt)),Df}function hy(){return kf??(kf=cm(rt)),kf}function py(){return Pf??(Pf=fm(rt)),Pf}async function my(t){const[e,n]=await Promise.all([dy(t),to()]);return yi(e,n)}function gy(){return cl??(cl=Ud(rt)),cl}async function by(){const[t,e]=await Promise.all([gy(),to()]);return t===void 0?[]:yi(t,e).filter(n=>n.name!=="title")}const Hf=`${nt.templates}/${Zu}.html`;function iR(){return rt.exists(Hf)}const Ey=`<!doctype html>
28
- <html lang="en">
29
- <head>
30
- <meta charset="utf-8" />
31
- <meta name="viewport" content="width=device-width, initial-scale=1" />
32
- <title>{title}</title>
33
- <link rel="stylesheet" href="/styles.css" />
34
- </head>
35
- <body>
36
- <slot></slot>
37
- </body>
38
- </html>
39
- `;async function uR(){if(await rt.exists(Hf))return;const t=await mt(`/api/write?path=${encodeURIComponent(Hf)}`,{method:"POST",body:Ey});if(!t.ok)throw new Error(`Create document shell failed (${t.status})`);cl=void 0}async function oR(){const t=await to();return[...t.entries()].map(([e,n])=>({tag:e,props:yi(n,t).map(r=>r.name)}))}async function B0(t){const e=await rt.readText(`${nt.content}/${t}.json`);return Qu(JSON.parse(e))}async function mg(t,e){const n=`${nt.content}/${t}.json`,r=await mt(`/api/write?path=${encodeURIComponent(n)}`,{method:"POST",headers:{"content-type":"application/json"},body:e});if(!r.ok)throw new Error(`Save failed (${r.status})`);Di()}function vy(){return kA(rt)}async function Ty(){const t=await mt("/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};if(t.status===422)return{ok:!1,errors:e.errors??["Validation failed."]};throw new Error(`Publish failed (${t.status})`)}async function _y(t,e){const n=await rt.readText(`${nt.content}/${t}.json`),r=JSON.parse(n);e===""?delete r.template:r.template=e,await mg(t,`${JSON.stringify(r,null,2)}
40
- `)}async function Ay(t,e){return(await rt.list(Y3(t))).filter(r=>r.kind==="file"&&e(r.name)).map(r=>r.name).sort()}function yy(t){return Ay(t,e=>!$3(e))}async function ih(t,e){const n=fg(e.name),r=cg(n),s=await mt(`/api/write?path=${encodeURIComponent(Lu(t,r))}`,{method:"POST",body:await e.arrayBuffer()});if(!s.ok)throw new Error(`Upload failed (${s.status})`);return r}async function Ny(t,e){try{await fl(Lu(t,e))}catch{}}async function qf(t){const e=[],n=async(r,s)=>{for(const a of await rt.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()}const gg=new Set(["css","js","mjs","cjs","json","webmanifest","svg","xml","txt","md","html","htm"]);function bg(t){const e=t.lastIndexOf(".");return e===-1?"":t.slice(e+1).toLowerCase()}async function Sy(){const t=[],e=async(n,r)=>{for(const s of await rt.list(n)){const a=r===""?s.name:`${r}/${s.name}`;s.kind==="dir"?await e(`${n}/${s.name}`,a):gg.has(bg(s.name))&&t.push(a)}};return await e(nt.public,""),t.sort()}const lR=["templates","components","public"],Eg=".gitkeep";function vg(t){const e=t.split("/")[0];return e==="templates"||e==="components"}async function Iy(t){const e=vg(t),n=[],r=[];for(const s of await rt.list(t)){const a=`${t}/${s.name}`;if(s.kind==="dir")n.push({kind:"dir",name:s.name,path:a});else{if(s.name===Eg)continue;if(e){if(t===nt.templates&&s.name===`${Zu}.html`)continue;s.name.endsWith(".html")&&r.push({kind:"file",name:s.name.slice(0,-5),path:a})}else gg.has(bg(s.name))&&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 cR(t){const e=[t],n=async r=>{for(const s of await Iy(r))s.kind==="dir"&&(e.push(s.path),await n(s.path))};return await n(t),e}async function fR(t,e){const n=e.split("/").map(i=>os(i)).filter(i=>i!=="").join("/");if(n==="")throw new Error("A folder name is required.");const r=`${t}/${n}`,s=`${r}/${Eg}`;if(await rt.exists(s))throw new Error(`"${r}" already exists.`);const a=await mt(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:""});if(!a.ok)throw new Error(`Create folder failed (${a.status})`);return r}async function dR(t,e){const n=t.slice(t.lastIndexOf("/")+1),r=`${e}/${n}`;return r===t?t:(await(vg(t)?Hy(t,r):_a(t,r)),r)}async function hR(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 _a(t,r),r)}function Cy(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 pR(t){const e=t.trim().toLowerCase();if(e==="")return[];const[n,r,s]=await Promise.all([qf("templates"),qf("components"),Sy()]);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:Cy(i.label.toLowerCase(),e)})).filter(i=>i.score>0).sort((i,u)=>u.score-i.score||i.hit.label.localeCompare(u.hit.label)).slice(0,30).map(i=>i.hit)}function mR(t){return rt.readText(t)}async function gR(t){if(await rt.exists(t))throw new Error(`"${t}" already exists.`);const e=await mt(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:""});if(!e.ok)throw new Error(`Create failed (${e.status})`)}async function bR(t,e){const n=`${t}/${fg(e.name)}`;if(await rt.exists(n))throw new Error(`"${n}" already exists.`);const r=await mt(`/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 Tg(t,e,n){const r=`${nt.content}/${t}.json`;if(await rt.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 mt(`/api/write?path=${encodeURIComponent(r)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(s,null,2)}
41
- `});if(!a.ok)throw new Error(`Create failed (${a.status})`);Di()}function wy(t){return rt.exists(`${nt.content}/${t}.json`)}async function Ly(t,e){const n=e.split("/").map(o=>({raw:o.trim(),slug:os(o)})).filter(o=>o.slug!==""),r=n.at(-1);if(r===void 0)throw new Error("A folder name is required.");const s=n.map(o=>o.slug).join("/"),a=t===""?s:`${t}/${s}`,i=`${nt.content}/${a}/${rh}`;if(await rt.exists(i))throw new Error(`"${a}" already exists.`);const u=await mt(`/api/write?path=${encodeURIComponent(i)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify({name:r.raw},null,2)}
42
- `});if(!u.ok)throw new Error(`Create folder failed (${u.status})`);return Di(),a}function uh(t){return t===""?`${nt.content}/_sort.json`:`${nt.content}/${t}/_sort.json`}async function oh(t){try{const e=JSON.parse(await rt.readText(uh(t)));return typeof e=="object"&&e!==null?e:{}}catch{return{}}}async function Oy(t){const e=await oh(t);return typeof e.defaultTemplate=="string"?e.defaultTemplate:""}async function Ry(t,e){const n=await oh(t);e===""?delete n.defaultTemplate:n.defaultTemplate=e;const r=await mt(`/api/write?path=${encodeURIComponent(uh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
43
- `});if(!r.ok)throw new Error(`Save failed (${r.status})`)}async function xy(t,e){const n=await oh(t);n.order=[...e];const r=await mt(`/api/write?path=${encodeURIComponent(uh(t))}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
44
- `});if(!r.ok)throw new Error(`Reorder failed (${r.status})`)}async function ER(t,e){const n=await mt(`/api/write?path=${encodeURIComponent(t)}`,{method:"POST",body:e});if(!n.ok)throw new Error(`Save failed (${n.status})`);lh(t)}function lh(...t){t.some(n=>n.endsWith(".html")&&(n.startsWith("templates/")||n.startsWith("components/")))&&(xf.clear(),Df=void 0,cl=void 0,th.bump()),t.some(n=>n.startsWith(`${nt.components}/`))&&(kf=void 0,Pf=void 0),t.some(n=>n.startsWith(`${nt.content}/`))&&Di()}function Os(t){return`${nt.content}/${t}.json`}function Ja(t){return`${nt.content}/${t}`}async function fl(t){const e=await mt(`/api/delete?path=${encodeURIComponent(t)}`,{method:"POST"});if(!e.ok)throw new Error(`Delete failed (${e.status})`);lh(t)}async function _a(t,e){const n=await mt(`/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}.`)}lh(t,e)}const Dy=/assets\/[A-Za-z0-9._-]+/g;async function ky(t,e,n){const r=Lu(t,n),s=Lu(e,n);if(r===s)return;const a=await mt(`/api/read?path=${encodeURIComponent(r)}`);if(!a.ok)return;const i=await mt(`/api/write?path=${encodeURIComponent(s)}`,{method:"POST",body:await a.arrayBuffer()});if(!i.ok)throw new Error(`Copying ${n} failed (${i.status})`)}async function Py(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 rt.exists(Os(a)))throw new Error(`"${r}" already exists in that folder.`);const i=await rt.readText(Os(t));for(const u of new Set(i.match(Dy)??[]))await ky(s,e,u);return await _a(Os(t),Os(a)),Di(),a}async function My(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 rt.exists(Ja(a)))throw new Error(`A folder named "${r}" already exists there.`);return await _a(Ja(t),Ja(a)),Di(),a}const _g=`${nt.content}/_redirects.json`;async function By(){try{const t=JSON.parse(await rt.readText(_g));return Array.isArray(t)?t:[]}catch{return[]}}async function So(t,e){if(t!==e)try{const n=await By();n.push({from:t,to:e});const r=await mt(`/api/write?path=${encodeURIComponent(_g)}`,{method:"POST",headers:{"content-type":"application/json"},body:`${JSON.stringify(n,null,2)}
45
- `});if(!r.ok)throw new Error(`status ${r.status}`)}catch(n){console.warn(`Could not record redirect ${t} → ${e}:`,n)}}const Ag=`${nt.content}/_site.json`;async function Fy(){try{const t=JSON.parse(await rt.readText(Ag));return{baseUrl:typeof t.baseUrl=="string"?t.baseUrl:""}}catch{return{baseUrl:""}}}async function Uy(t){const e=t.baseUrl.trim(),n=`${JSON.stringify(e===""?{}:{baseUrl:e},null,2)}
46
- `,r=await mt(`/api/write?path=${encodeURIComponent(Ag)}`,{method:"POST",headers:{"content-type":"application/json"},body:n});if(!r.ok)throw new Error(`Saving site settings failed (${r.status}).`)}const yg=["html","css","js"];async function vR(t){const e=t.replace(/\.html$/,"");await Promise.all(yg.map(n=>fl(`${e}.${n}`)))}async function Hy(t,e){const n=t.replace(/\.html$/,""),r=e.replace(/\.html$/,"");for(const s of yg){const a=`${n}.${s}`;await rt.exists(a)&&await _a(a,`${r}.${s}`)}}async function qy(t,e){const n=t.includes("/")?t.slice(0,t.lastIndexOf("/")):"",r=await CA(rt,t,{draft:e,media:W3(n)});return r==null?void 0:r.html}async function TR(t){return yi(t,await to())}async function _R(t,e,n){const[r,s,a,i]=await Promise.all([to(),hy(),py(),nh()]),u=Zm(i),o=h=>({...Q3(X3(h),n),...Z3(h,n)});if(J3(t)){const h=ey(t),g=new Map(r).set(h,e.html),d=F0(new Map(s),h,e.css),m=F0(new Map(a),h,e.js),b=yi(e.html,g);return Ef({template:ty(h,b),scope:o(b),components:g,componentStyles:d,componentScripts:m,context:u,media:P0()})}const f=yi(e.html,r);return Ef({template:e.html,scope:o(f),components:r,componentStyles:s,componentScripts:a,context:u,media:P0(),...e.css.trim()!==""&&{templateStyle:e.css},...e.js.trim()!==""&&{templateScript:e.js}})}function F0(t,e,n){return n.trim()===""?t.delete(e):t.set(e,n),t}function jy(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 Ng="nanoesis:tree-expanded";function $y(){try{const t=JSON.parse(localStorage.getItem(Ng)??"");if(Array.isArray(t)){const e={};for(const n of t)typeof n=="string"&&(e[n]=!0);return e}}catch{}return{}}const qs=Et({}),ei=Et({}),Ni=Et($y());function Sg(){const t=Object.keys(Ni).filter(e=>Ni[e]);localStorage.setItem(Ng,JSON.stringify(t))}function U0(t){return qs[t]}function Yy(t){return ei[t]===!0}function $a(t){return t===""||Ni[t]===!0}async function Ml(t){if(!(qs[t]!==void 0||ei[t])){ei[t]=!0;try{qs[t]=await hg(t)}finally{ei[t]=!1}}}async function Yn(t){ei[t]=!0;try{qs[t]=await hg(t)}finally{ei[t]=!1}}function jf(t){return t.includes("/")?t.slice(0,t.lastIndexOf("/")):""}function Ig(t){return t==="index"?"":t.endsWith("/index")?t.slice(0,-6):null}function $f(t,e,n){const r=qs[t];if(r===void 0)return;let s=!1;const a=r.entries.map(i=>i.path!==e?i:(s=!0,n(i)));s&&(qs[t]={...r,entries:a})}function zy(t,e){const n=Ig(t);if(n!==null){n!==""&&$f(jf(n),n,r=>r.kind==="dir"?{...r,name:e}:r);return}$f(jf(t),t,r=>r.kind==="item"?{...r,title:e}:r)}function Wy(t,e){Ig(t)===null&&$f(jf(t),t,n=>n.kind==="item"?{...n,isPublished:e}:n)}function Gy(t,e){const n=qs[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);qs[t]={...n,entries:s}}async function H0(t){$a(t)?Ni[t]=!1:(Ni[t]=!0,await Ml(t)),Sg()}async function Zi(t){const e=t.split("/");e.pop();let n="";for(const r of e)n=n===""?r:`${n}/${r}`,Ni[n]=!0,await Ml(n);Sg()}let sn=ee(null);const Io={get pending(){return c(sn)}};function dl(t,e={}){return new Promise(n=>{y(sn,{kind:"confirm",message:t,options:e,resolve:n},!0)})}function bu(t,e={}){return new Promise(n=>{y(sn,{kind:"prompt",message:t,options:e,resolve:n},!0)})}function AR(t,e,n={}){return new Promise(r=>{y(sn,{kind:"select",message:t,choices:e,options:n,resolve:r},!0)})}function In(t,e={}){return new Promise(n=>{y(sn,{kind:"alert",message:t,options:e,resolve:n},!0)})}function Sc(t){var e;((e=c(sn))==null?void 0:e.kind)==="confirm"&&(c(sn).resolve(t),y(sn,null))}function Ic(t){var e;((e=c(sn))==null?void 0:e.kind)==="prompt"&&(c(sn).resolve(t),y(sn,null))}function Cc(t){var e;((e=c(sn))==null?void 0:e.kind)==="select"&&(c(sn).resolve(t),y(sn,null))}function q0(){var t;((t=c(sn))==null?void 0:t.kind)==="alert"&&(c(sn).resolve(),y(sn,null))}/**
47
- * @file
48
- * @license @lucide/svelte v1.16.0 - ISC
49
- *
50
- * This source code is licensed under the ISC license.
51
- * See the LICENSE file in the root directory of this source tree.
52
- */const Ky={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"};/**
53
- * @file
54
- * @license @lucide/svelte v1.16.0 - ISC
55
- *
56
- * This source code is licensed under the ISC license.
57
- * See the LICENSE file in the root directory of this source tree.
58
- */const Vy=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
59
- * @file
60
- * @license @lucide/svelte v1.16.0 - ISC
61
- *
62
- * This source code is licensed under the ISC license.
63
- * See the LICENSE file in the root directory of this source tree.
64
- */const Xy=Symbol("lucide-context"),Qy=()=>OE(Xy);var Zy=Tv("<svg><!><!></svg>");function Cr(t,e){ct(e,!0);const n=Qy()??{},r=Jn(e,"color",19,()=>n.color??"currentColor"),s=Jn(e,"size",19,()=>n.size??24),a=Jn(e,"strokeWidth",19,()=>n.strokeWidth??2),i=Jn(e,"absoluteStrokeWidth",19,()=>n.absoluteStrokeWidth??!1),u=Jn(e,"iconNode",19,()=>[]),o=ir(e,["$$slots","$$events","$$legacy","name","color","size","strokeWidth","absoluteStrokeWidth","iconNode","children"]),f=Ae(()=>i()?Number(a())*24/Number(s()):a());var h=Zy();Vh(h,m=>({...Ky,...m,...o,width:s(),height:s(),stroke:r(),"stroke-width":c(f),class:["lucide-icon lucide",n.class,e.name&&`lucide-${e.name}`,e.class]}),[()=>!e.children&&!Vy(o)&&{"aria-hidden":"true"}]);var g=C(h);wt(g,17,u,Su,(m,b)=>{var _=Ae(()=>Qb(c(b),2));let T=()=>c(_)[0],E=()=>c(_)[1];var O=vr(),L=pt(O);Rv(L,T,!0,(B,I)=>{Vh(B,()=>({...E()}))}),$(m,O)});var d=x(g);Lv(d,()=>e.children??_d),$(t,h),ft()}function ch(t,e){let n=ir(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"}]];Cr(t,Sr({name:"settings-2"},()=>n,{get iconNode(){return r}}))}function Jy(t,e){let n=ir(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M5 12h14"}],["path",{d:"M12 5v14"}]];Cr(t,Sr({name:"plus"},()=>n,{get iconNode(){return r}}))}function fh(t,e){let n=ir(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"M18 6 6 18"}],["path",{d:"m6 6 12 12"}]];Cr(t,Sr({name:"x"},()=>n,{get iconNode(){return r}}))}function eN(t,e){let n=ir(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m9 18 6-6-6-6"}]];Cr(t,Sr({name:"chevron-right"},()=>n,{get iconNode(){return r}}))}function tN(t,e){let n=ir(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m6 9 6 6 6-6"}]];Cr(t,Sr({name:"chevron-down"},()=>n,{get iconNode(){return r}}))}function Cg(t,e){let n=ir(e,["$$slots","$$events","$$legacy"]);const r=[["path",{d:"m21 21-4.34-4.34"}],["circle",{cx:"11",cy:"11",r:"8"}]];Cr(t,Sr({name:"search"},()=>n,{get iconNode(){return r}}))}function nN(t,e){let n=ir(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"}]];Cr(t,Sr({name:"house"},()=>n,{get iconNode(){return r}}))}function rN(t,e){let n=ir(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"}]];Cr(t,Sr({name:"link"},()=>n,{get iconNode(){return r}}))}function sN(t,e){let n=ir(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"}]];Cr(t,Sr({name:"external-link"},()=>n,{get iconNode(){return r}}))}function Yf(t,e){let n=ir(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"}]];Cr(t,Sr({name:"grip-vertical"},()=>n,{get iconNode(){return r}}))}function aN(t,e){let n=ir(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"}]];Cr(t,Sr({name:"folder-plus"},()=>n,{get iconNode(){return r}}))}let dh=ee(null),hh=ee(null);function Qa(){return c(dh)}function j0(){return c(hh)}function iN(t,e){y(dh,{entry:t,parent:e},!0)}function wc(t){y(hh,t,!0)}function Ts(){y(dh,null),y(hh,null)}let Lc=ee(null);const zf={get target(){return c(Lc)},request(t){y(Lc,t,!0)},clear(){y(Lc,null)}};function uN(){let t=ee("content");return{get mode(){return c(t)},set(e){y(t,e,!0)}}}const As=uN(),oN="nanoesis-restore:";function Wf(t){return`${oN}${t}`}function lN(t,e,n){t.getItem(Wf(e))===null&&t.setItem(Wf(e),JSON.stringify(n))}function cN(t,e){const n=t.getItem(Wf(e));if(n===null)return null;try{return JSON.parse(n)}catch{return null}}function fN(){let t=ee("saved"),e=null;return{get state(){return c(t)},get canRetry(){return c(t)==="error"&&e!==null},saving(){y(t,"saving")},saved(){y(t,"saved"),e=null},failed(n){y(t,"error"),e=n},retry(){e==null||e()},reset(){y(t,"saved"),e=null}}}const ys=fN(),dN=new Set(["title","created","published","updated"]);function hN(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 pN(t,e,n){if(t.type==="authors")return hN(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 mN(t){return t===""||Array.isArray(t)&&t.length===0}function $0(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 u of e){const o=n[u.name]??"";if(dN.has(u.name)){a[u.name]=u.name==="title"?o:o||void 0;continue}const f=pN(u,t.fields[u.name],o);mN(f)?delete s[u.name]:s[u.name]=f}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)}
65
- `}function Gf(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 gN=0;var bN=G('<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>'),EN=G('<ul class="pills svelte-5hnbr8"></ul>'),vN=G('<li role="option"> </li>'),TN=G('<ul class="suggestions svelte-5hnbr8" role="listbox"><!> <li role="option"> </li></ul>'),_N=G('<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 AN(t,e){ct(e,!0);function n(J){if(J.trim()==="")return[];try{const ne=JSON.parse(J);return Array.isArray(ne)?ne.flatMap(le=>{if(le===null||typeof le!="object")return[];const be=le,pe=typeof be.name=="string"?be.name:"";return pe.trim()===""?[]:[{name:pe,...typeof be.user=="string"&&be.user!==""?{user:be.user}:{}}]}):[]}catch{return[]}}const r=Ae(()=>n(e.value)),s=`authors-${++gN}`;let a=ee(Et([])),i=ee(""),u=ee(!1),o=ee(0),f=ee(void 0),h=ee(null),g=ee(null);Dt(()=>{sy().then(J=>y(a,J,!0))});const d=Ae(()=>new Map(c(a).map(J=>[J.user,J.name]))),m=Ae(()=>new Set(c(r).map(J=>J.user).filter(J=>J!==void 0)));function b(J){return J.user!==void 0?c(d).get(J.user)??J.name:J.name}const _=Ae(()=>{const J=c(i).trim().toLowerCase();return J===""?[]:c(a).filter(ne=>!c(m).has(ne.user)&&ne.name.toLowerCase().includes(J)).slice(0,6)}),T=Ae(()=>c(u)&&c(i).trim()!==""),E=Ae(()=>c(_).length),O=Ae(()=>c(T)?c(o)<c(_).length?`${s}-opt-${c(o)}`:`${s}-guest`:void 0);function L(J){e.onchange(J.length===0?"":JSON.stringify(J))}function B(J){c(m).has(J.user)||(L([...c(r),{name:J.name,user:J.user}]),y(i,""))}function I(J){const ne=J.trim();ne!==""&&(L([...c(r),{name:ne}]),y(i,""))}function H(){const J=c(_)[c(o)];J!==void 0?B(J):I(c(i))}function R(){var J,ne;(ne=(J=c(f))==null?void 0:J.children[c(o)])==null||ne.scrollIntoView({block:"nearest"})}function q(J){if(!c(T)){J.key==="Enter"&&(J.preventDefault(),I(c(i)));return}const ne=c(_).length+1;J.key==="ArrowDown"?(J.preventDefault(),y(o,(c(o)+1)%ne),R()):J.key==="ArrowUp"?(J.preventDefault(),y(o,(c(o)-1+ne)%ne),R()):J.key==="Enter"?(J.preventDefault(),H()):J.key==="Escape"&&(J.preventDefault(),y(i,""))}function Q(J){L(c(r).filter((ne,le)=>le!==J))}function Y(J,ne){var le;y(h,J,!0),(le=ne.dataTransfer)==null||le.setData("text/plain",String(J)),ne.dataTransfer&&(ne.dataTransfer.effectAllowed="move")}function v(J,ne){c(h)!==null&&(ne.preventDefault(),y(g,J,!0))}function M(J){c(h)!==null&&c(h)!==J&&L(Gf(c(r),c(h),J)),y(h,null),y(g,null)}function S(){y(h,null),y(g,null)}var U=_N(),F=C(U);{var k=J=>{var ne=EN();wt(ne,21,()=>c(r),Su,(le,be,pe)=>{var Re=bN();let ue;var me=C(Re),Ne=C(me);Yf(Ne,{size:14});var _e=x(me,2),ye=C(_e),Ie=x(_e,2),Ue=C(Ie);fh(Ue,{size:14,"aria-hidden":"true"}),oe((We,Ge)=>{ue=it(Re,1,"pill svelte-5hnbr8",null,ue,{guest:c(be).user===void 0,dragging:c(h)===pe,over:c(g)===pe&&c(h)!==pe}),ge(_e,"title",c(be).user??"Guest"),de(ye,We),ge(Ie,"aria-label",Ge)},[()=>b(c(be)),()=>`Remove ${b(c(be))}`]),Be("dragstart",Re,We=>Y(pe,We)),Be("dragover",Re,We=>v(pe,We)),Be("drop",Re,()=>M(pe)),Be("dragend",Re,S),ae("click",Ie,()=>Q(pe)),$(le,Re)}),$(J,ne)};he(F,J=>{c(r).length>0&&J(k)})}var V=x(F,2),z=C(V),j=x(z,2);{var X=J=>{var ne=TN(),le=C(ne);wt(le,19,()=>c(_),ue=>ue.user,(ue,me,Ne)=>{var _e=vN();let ye;var Ie=C(_e);oe(()=>{ge(_e,"id",`${s}-opt-${c(Ne)}`),ye=it(_e,1,"option svelte-5hnbr8",null,ye,{active:c(Ne)===c(o)}),ge(_e,"aria-selected",c(Ne)===c(o)),de(Ie,c(me).name)}),ae("click",_e,()=>B(c(me))),Be("mouseenter",_e,()=>y(o,c(Ne),!0)),$(ue,_e)});var be=x(le,2);let pe;var Re=C(be);on(ne,ue=>y(f,ue),()=>c(f)),oe(ue=>{ge(ne,"id",`${s}-listbox`),ge(be,"id",`${s}-guest`),pe=it(be,1,"option guest-option svelte-5hnbr8",null,pe,{active:c(o)===c(E)}),ge(be,"aria-selected",c(o)===c(E)),de(Re,`Add “${ue??""}” as a guest`)},[()=>c(i).trim()]),ae("click",be,()=>I(c(i))),Be("mouseenter",be,()=>y(o,c(E),!0)),$(J,ne)};he(j,J=>{c(T)&&J(X)})}oe(()=>{ge(U,"aria-labelledby",e.labelledBy),ge(z,"aria-expanded",c(T)),ge(z,"aria-controls",`${s}-listbox`),ge(z,"aria-activedescendant",c(O))}),ae("input",z,()=>y(o,0)),ae("keydown",z,q),Be("focus",z,()=>{y(u,!0),y(o,0)}),Be("blur",z,()=>setTimeout(()=>y(u,!1),120)),bt(z,()=>c(i),J=>y(i,J)),$(t,U),ft()}Tt(["click","input","keydown"]);var yN=G('<div class="current svelte-1nm0yno"><a class="filename svelte-1nm0yno" download=""> </a> <button type="button" class="link svelte-1nm0yno">Remove</button></div>'),NN=G('<p class="empty svelte-1nm0yno">No file selected.</p>'),SN=G('<li class="hint svelte-1nm0yno">Loading…</li>'),IN=G('<li class="hint svelte-1nm0yno">No files here yet, upload one above.</li>'),CN=G('<li><button type="button"> </button></li>'),wN=G('<ul class="library svelte-1nm0yno" aria-label="File library"><!></ul>'),LN=G('<p class="error svelte-1nm0yno" role="alert"> </p>'),ON=G('<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 RN(t,e){ct(e,!0);let n=ee(Et([])),r=ee(!1),s=ee(!1),a=!1,i=ee(null);const u=Ae(()=>e.value.split("/").pop()??e.value);async function o(){y(s,!0);try{y(n,await yy(e.itemDir),!0),a=!0}finally{y(s,!1)}}function f(){y(r,!c(r)),c(r)&&!a&&o()}function h(Q){var M;const Y=Q.currentTarget,v=(M=Y.files)==null?void 0:M[0];Y.value="",v&&g(v)}async function g(Q){y(i,null);try{e.onchange(await ih(e.itemDir,Q)),a=!1,c(r)&&await o()}catch(Y){y(i,Y instanceof Error?Y.message:String(Y),!0)}}var d=ON(),m=C(d);{var b=Q=>{var Y=yN(),v=C(Y),M=C(v),S=x(v,2);oe(U=>{ge(v,"href",U),de(M,c(u))},[()=>eo(e.itemDir,e.value)]),ae("click",S,()=>e.onchange("")),$(Q,Y)},_=Q=>{var Y=NN();$(Q,Y)};he(m,Q=>{e.value?Q(b):Q(_,-1)})}var T=x(m,2),E=C(T),O=C(E),L=x(E,2),B=x(C(L)),I=x(T,2);{var H=Q=>{var Y=wN(),v=C(Y);{var M=F=>{var k=SN();$(F,k)},S=F=>{var k=IN();$(F,k)},U=F=>{var k=vr(),V=pt(k);wt(V,16,()=>c(n),z=>z,(z,j)=>{const X=Ae(()=>cg(j));var J=CN(),ne=C(J);let le;var be=C(ne);oe(()=>{le=it(ne,1,"file svelte-1nm0yno",null,le,{selected:e.value===c(X)}),ge(ne,"aria-pressed",e.value===c(X)),de(be,j)}),ae("click",ne,()=>e.onchange(c(X))),$(z,J)}),$(F,k)};he(v,F=>{c(s)?F(M):c(n).length===0?F(S,1):F(U,-1)})}$(Q,Y)};he(I,Q=>{c(r)&&Q(H)})}var R=x(I,2);{var q=Q=>{var Y=LN(),v=C(Y);oe(()=>de(v,c(i))),$(Q,Y)};he(R,Q=>{c(i)&&Q(q)})}oe(()=>{ge(d,"aria-labelledby",e.labelledBy),ge(E,"aria-expanded",c(r)),de(O,c(r)?"Hide files":"Choose from files")}),ae("click",E,f),ae("change",B,h),$(t,d),ft()}Tt(["click","change"]);var xN=G('<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>'),DN=G('<label> <input type="file" accept="image/*" class="svelte-s6anrr"/></label>'),kN=G('<p class="error svelte-s6anrr" role="alert"> </p>'),PN=G('<div class="image-field svelte-s6anrr" role="group"><!> <!></div>');function MN(t,e){ct(e,!0);let n=ee(!1),r=ee(null);const s=Ae(()=>e.value===""?"":/^(\/|[a-z][a-z0-9+.-]*:)/i.test(e.value)?e.value:eo(e.itemDir,e.value));function a(m){var T;const b=m.currentTarget,_=(T=b.files)==null?void 0:T[0];b.value="",_&&i(_)}async function i(m){y(r,null),y(n,!0);try{e.onchange(await ih(e.itemDir,m))}catch(b){y(r,b instanceof Error?b.message:String(b),!0)}finally{y(n,!1)}}var u=PN(),o=C(u);{var f=m=>{var b=xN(),_=C(b),T=x(_,2),E=C(T),O=C(E),L=x(E,2),B=C(L);let I;var H=C(B),R=x(H),q=x(B,2);oe(()=>{ge(_,"src",c(s)),de(O,e.value),I=it(B,1,"action svelte-s6anrr",null,I,{busy:c(n)}),de(H,`${c(n)?"Uploading…":"Replace…"} `),R.disabled=c(n)}),ae("change",R,a),ae("click",q,()=>e.onchange("")),$(m,b)},h=m=>{var b=DN();let _;var T=C(b),E=x(T);oe(()=>{_=it(b,1,"action svelte-s6anrr",null,_,{busy:c(n)}),de(T,`${c(n)?"Uploading…":"Upload image…"} `),E.disabled=c(n)}),ae("change",E,a),$(m,b)};he(o,m=>{e.value?m(f):m(h,-1)})}var g=x(o,2);{var d=m=>{var b=kN(),_=C(b);oe(()=>de(_,c(r))),$(m,b)};he(g,m=>{c(r)&&m(d)})}oe(()=>ge(u,"aria-labelledby",e.labelledBy)),$(t,u),ft()}Tt(["change","click"]);var BN=G("<option> </option>"),FN=G("<option>Top level</option>"),UN=G("<option> </option>"),HN=G('<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>'),qN=G('<button type="button" class="ghost svelte-wge2ya">Change URL…</button>'),jN=G('<button type="button" class="ghost danger svelte-wge2ya">Delete…</button>'),$N=G(`<p class="help svelte-wge2ya">Changes the page’s URL (its slug, the filename). The <strong>title</strong> is edited as the
66
- heading at the top of the form.</p>`),YN=G('<div class="section svelte-wge2ya"><h3 class="svelte-wge2ya">Manage item</h3> <div class="manage svelte-wge2ya"><!> <!></div> <!></div>'),zN=G('<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 WN(t,e){ct(e,!0);const n=Jn(e,"currentFolder",3,""),r=Jn(e,"folders",19,()=>[]);let s,a=ee(Et(e.templateName));const i="\0";let u=ee(i);const o=Ae(()=>r().filter(I=>I!==n())),f=Ae(()=>e.templates.includes(e.templateName)?e.templates:[e.templateName,...e.templates]);wa(()=>s.showModal());function h(I){I.preventDefault(),c(a)!==e.templateName?e.onchangetemplate(c(a)):e.onclose()}var g=zN(),d=C(g),m=x(C(d),2),b=x(C(m),2);wt(b,20,()=>c(f),I=>I,(I,H)=>{var R=BN(),q=C(R),Q={};oe(()=>{de(q,H),Q!==(Q=H)&&(R.value=(R.__value=H)??"")}),$(I,R)});var _=x(m,2);{var T=I=>{var H=HN(),R=x(C(H),2),q=C(R),Q=x(C(q),2),Y=C(Q);Y.value=Y.__value=i;var v=x(Y);{var M=F=>{var k=FN();k.value=k.__value="",$(F,k)};he(v,F=>{n()!==""&&F(M)})}var S=x(v);wt(S,16,()=>c(o),F=>F,(F,k)=>{var V=UN(),z=C(V),j={};oe(()=>{de(z,`${k??""}/`),j!==(j=k)&&(V.value=(V.__value=k)??"")}),$(F,V)});var U=x(q,2);oe(()=>U.disabled=c(u)===i),Ta(Q,()=>c(u),F=>y(u,F)),ae("click",U,()=>e.onmove(c(u))),$(I,H)};he(_,I=>{e.onmove&&I(T)})}var E=x(_,2);{var O=I=>{var H=YN(),R=x(C(H),2),q=C(R);{var Q=U=>{var F=qN();ae("click",F,function(...k){var V;(V=e.onrename)==null||V.apply(this,k)}),$(U,F)};he(q,U=>{e.onrename&&U(Q)})}var Y=x(q,2);{var v=U=>{var F=jN();ae("click",F,function(...k){var V;(V=e.ondelete)==null||V.apply(this,k)}),$(U,F)};he(Y,U=>{e.ondelete&&U(v)})}var M=x(R,2);{var S=U=>{var F=$N();$(U,F)};he(M,U=>{e.onrename&&U(S)})}$(I,H)};he(E,I=>{(e.onrename||e.ondelete)&&I(O)})}var L=x(E,2),B=C(L);on(g,I=>s=I,()=>s),Be("close",g,function(...I){var H;(H=e.onclose)==null||H.apply(this,I)}),Be("cancel",g,function(...I){var H;(H=e.onclose)==null||H.apply(this,I)}),Be("submit",d,h),Ta(b,()=>c(a),I=>y(a,I)),ae("click",B,function(...I){var H;(H=e.onclose)==null||H.apply(this,I)}),$(t,g),ft()}Tt(["click"]);let Eu=ee(null);const GN={get pending(){return c(Eu)}};function wg(t=""){return new Promise(e=>{y(Eu,{current:t,resolve:e},!0)})}function qa(t){c(Eu)!==null&&(c(Eu).resolve(t),y(Eu,null))}const ph="ref:";function Ou(t){return t.startsWith(ph)}function Kf(t){return Ou(t)?t.slice(ph.length):t}function KN(t){return`${ph}${t}`}var VN=G('<!> <span class="target svelte-147ryxk"> </span>',1),XN=G('<!> <span class="target svelte-147ryxk"> </span>',1),QN=G('<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),ZN=G('<button type="button" class="action svelte-147ryxk">Set link…</button>'),JN=G('<div class="link-field svelte-147ryxk" role="group"><!></div>');function e6(t,e){ct(e,!0);async function n(){const u=await wg(e.value);u!==null&&e.onchange(u)}var r=JN(),s=C(r);{var a=u=>{var o=QN(),f=pt(o),h=C(f);{var g=T=>{var E=VN(),O=pt(E);rN(O,{size:14,"aria-hidden":"true"});var L=x(O,2),B=C(L);oe((I,H)=>{ge(L,"title",I),de(B,H)},[()=>`Page: ${Kf(e.value)}`,()=>Kf(e.value)]),$(T,E)},d=Ae(()=>Ou(e.value)),m=T=>{var E=XN(),O=pt(E);sN(O,{size:14,"aria-hidden":"true"});var L=x(O,2),B=C(L);oe(()=>{ge(L,"title",e.value),de(B,e.value)}),$(T,E)};he(h,T=>{c(d)?T(g):T(m,-1)})}var b=x(f,2),_=x(b,2);ae("click",b,n),ae("click",_,()=>e.onchange("")),$(u,o)},i=u=>{var o=ZN();ae("click",o,n),$(u,o)};he(s,u=>{e.value?u(a):u(i,-1)})}oe(()=>ge(r,"aria-labelledby",e.labelledBy)),$(t,r),ft()}Tt(["click"]);var t6=G('<p class="note error svelte-1v8pkea"> </p>'),n6=G('<p class="note svelte-1v8pkea">Nothing to preview yet, this item has no resolvable template.</p>'),r6=G('<p class="note overlay svelte-1v8pkea">Rendering…</p>'),s6=G('<iframe title="Rendered preview" sandbox="allow-same-origin allow-scripts allow-modals" class="svelte-1v8pkea"></iframe> <!>',1),a6=G('<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 i6(t,e){ct(e,!0);let n=ee(""),r=ee("loading"),s=ee(""),a=ee(0),i=ee(void 0),u={x:0,y:0};function o(){var R;try{const q=(R=c(i))==null?void 0:R.contentWindow;q&&(u={x:q.scrollX,y:q.scrollY})}catch{}}function f(){var R,q;try{(q=(R=c(i))==null?void 0:R.contentWindow)==null||q.scrollTo(u.x,u.y)}catch{}}let h;Dt(()=>{const R=e.previewItem,q=e.path;if(clearTimeout(h),R===null){y(r,"loading");return}return h=setTimeout(()=>void g(q,R),350),()=>clearTimeout(h)});async function g(R,q){try{const Q=await qy(R,q);if(Q===void 0){y(r,"empty");return}o(),y(n,Q,!0),y(r,"ready")}catch(Q){y(s,Q instanceof Error?Q.message:String(Q),!0),y(r,"error")}}var d=a6(),m=C(d),b=x(C(m),2),_=C(b),T=x(b,2),E=C(T);fh(E,{size:18,"aria-hidden":"true"});var O=x(m,2),L=C(O);{var B=R=>{var q=t6(),Q=C(q);oe(()=>de(Q,`Couldn’t render preview: ${c(s)??""}`)),$(R,q)},I=R=>{var q=n6();$(R,q)},H=R=>{var q=s6(),Q=pt(q);on(Q,M=>y(i,M),()=>c(i));var Y=x(Q,2);{var v=M=>{var S=r6();$(M,S)};he(Y,M=>{c(r)==="loading"&&M(v)})}oe(()=>ge(Q,"srcdoc",c(n))),Be("load",Q,f),$(R,q)};he(L,R=>{c(r)==="error"?R(B):c(r)==="empty"?R(I,1):R(H,-1)})}oe(R=>de(_,`${R??""}px`),[()=>Math.round(c(a))]),ae("click",T,function(...R){var q;(q=e.onclose)==null||q.apply(this,R)}),Wv(O,"clientWidth",R=>y(a,R)),$(t,d),ft()}Tt(["click"]);var Lg=typeof global=="object"&&global&&global.Object===Object&&global,u6=typeof self=="object"&&self&&self.Object===Object&&self,Qr=Lg||u6||Function("return this")(),js=Qr.Symbol,Og=Object.prototype,o6=Og.hasOwnProperty,l6=Og.toString,Ji=js?js.toStringTag:void 0;function c6(t){var e=o6.call(t,Ji),n=t[Ji];try{t[Ji]=void 0;var r=!0}catch{}var s=l6.call(t);return r&&(e?t[Ji]=n:delete t[Ji]),s}var f6=Object.prototype,d6=f6.toString;function h6(t){return d6.call(t)}var p6="[object Null]",m6="[object Undefined]",Y0=js?js.toStringTag:void 0;function ki(t){return t==null?t===void 0?m6:p6:Y0&&Y0 in Object(t)?c6(t):h6(t)}function fs(t){return t!=null&&typeof t=="object"}var Aa=Array.isArray;function Ws(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}function Rg(t){return t}var g6="[object AsyncFunction]",b6="[object Function]",E6="[object GeneratorFunction]",v6="[object Proxy]";function mh(t){if(!Ws(t))return!1;var e=ki(t);return e==b6||e==E6||e==g6||e==v6}var Oc=Qr["__core-js_shared__"],z0=(function(){var t=/[^.]+$/.exec(Oc&&Oc.keys&&Oc.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""})();function T6(t){return!!z0&&z0 in t}var _6=Function.prototype,A6=_6.toString;function Ra(t){if(t!=null){try{return A6.call(t)}catch{}try{return t+""}catch{}}return""}var y6=/[\\^$.*+?()[\]{}|]/g,N6=/^\[object .+?Constructor\]$/,S6=Function.prototype,I6=Object.prototype,C6=S6.toString,w6=I6.hasOwnProperty,L6=RegExp("^"+C6.call(w6).replace(y6,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function O6(t){if(!Ws(t)||T6(t))return!1;var e=mh(t)?L6:N6;return e.test(Ra(t))}function R6(t,e){return t==null?void 0:t[e]}function xa(t,e){var n=R6(t,e);return O6(n)?n:void 0}var Vf=xa(Qr,"WeakMap"),W0=Object.create,x6=(function(){function t(){}return function(e){if(!Ws(e))return{};if(W0)return W0(e);t.prototype=e;var n=new t;return t.prototype=void 0,n}})();function D6(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 k6(t,e){var n=-1,r=t.length;for(e||(e=Array(r));++n<r;)e[n]=t[n];return e}var P6=800,M6=16,B6=Date.now;function F6(t){var e=0,n=0;return function(){var r=B6(),s=M6-(r-n);if(n=r,s>0){if(++e>=P6)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}function U6(t){return function(){return t}}var hl=(function(){try{var t=xa(Object,"defineProperty");return t({},"",{}),t}catch{}})(),H6=hl?function(t,e){return hl(t,"toString",{configurable:!0,enumerable:!1,value:U6(e),writable:!0})}:Rg,q6=F6(H6);function j6(t,e){for(var n=-1,r=t==null?0:t.length;++n<r&&e(t[n],n,t)!==!1;);return t}var $6=9007199254740991,Y6=/^(?:0|[1-9]\d*)$/;function xg(t,e){var n=typeof t;return e=e??$6,!!e&&(n=="number"||n!="symbol"&&Y6.test(t))&&t>-1&&t%1==0&&t<e}function gh(t,e,n){e=="__proto__"&&hl?hl(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function no(t,e){return t===e||t!==t&&e!==e}var z6=Object.prototype,W6=z6.hasOwnProperty;function Dg(t,e,n){var r=t[e];(!(W6.call(t,e)&&no(r,n))||n===void 0&&!(e in t))&&gh(t,e,n)}function G6(t,e,n,r){var s=!n;n||(n={});for(var a=-1,i=e.length;++a<i;){var u=e[a],o=void 0;o===void 0&&(o=t[u]),s?gh(n,u,o):Dg(n,u,o)}return n}var G0=Math.max;function K6(t,e,n){return e=G0(e===void 0?t.length-1:e,0),function(){for(var r=arguments,s=-1,a=G0(r.length-e,0),i=Array(a);++s<a;)i[s]=r[e+s];s=-1;for(var u=Array(e+1);++s<e;)u[s]=r[s];return u[e]=n(i),D6(t,this,u)}}function V6(t,e){return q6(K6(t,e,Rg),t+"")}var X6=9007199254740991;function kg(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=X6}function Bl(t){return t!=null&&kg(t.length)&&!mh(t)}function Q6(t,e,n){if(!Ws(n))return!1;var r=typeof e;return(r=="number"?Bl(n)&&xg(e,n.length):r=="string"&&e in n)?no(n[e],t):!1}function Z6(t){return V6(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&&Q6(n[0],n[1],i)&&(a=s<3?void 0:a,s=1),e=Object(e);++r<s;){var u=n[r];u&&t(e,u,r,a)}return e})}var J6=Object.prototype;function bh(t){var e=t&&t.constructor,n=typeof e=="function"&&e.prototype||J6;return t===n}function eS(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}var tS="[object Arguments]";function K0(t){return fs(t)&&ki(t)==tS}var Pg=Object.prototype,nS=Pg.hasOwnProperty,rS=Pg.propertyIsEnumerable,Xf=K0((function(){return arguments})())?K0:function(t){return fs(t)&&nS.call(t,"callee")&&!rS.call(t,"callee")};function sS(){return!1}var Mg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,V0=Mg&&typeof module=="object"&&module&&!module.nodeType&&module,aS=V0&&V0.exports===Mg,X0=aS?Qr.Buffer:void 0,iS=X0?X0.isBuffer:void 0,Ru=iS||sS,uS="[object Arguments]",oS="[object Array]",lS="[object Boolean]",cS="[object Date]",fS="[object Error]",dS="[object Function]",hS="[object Map]",pS="[object Number]",mS="[object Object]",gS="[object RegExp]",bS="[object Set]",ES="[object String]",vS="[object WeakMap]",TS="[object ArrayBuffer]",_S="[object DataView]",AS="[object Float32Array]",yS="[object Float64Array]",NS="[object Int8Array]",SS="[object Int16Array]",IS="[object Int32Array]",CS="[object Uint8Array]",wS="[object Uint8ClampedArray]",LS="[object Uint16Array]",OS="[object Uint32Array]",Nt={};Nt[AS]=Nt[yS]=Nt[NS]=Nt[SS]=Nt[IS]=Nt[CS]=Nt[wS]=Nt[LS]=Nt[OS]=!0;Nt[uS]=Nt[oS]=Nt[TS]=Nt[lS]=Nt[_S]=Nt[cS]=Nt[fS]=Nt[dS]=Nt[hS]=Nt[pS]=Nt[mS]=Nt[gS]=Nt[bS]=Nt[ES]=Nt[vS]=!1;function RS(t){return fs(t)&&kg(t.length)&&!!Nt[ki(t)]}function Eh(t){return function(e){return t(e)}}var Bg=typeof exports=="object"&&exports&&!exports.nodeType&&exports,vu=Bg&&typeof module=="object"&&module&&!module.nodeType&&module,xS=vu&&vu.exports===Bg,Rc=xS&&Lg.process,Si=(function(){try{var t=vu&&vu.require&&vu.require("util").types;return t||Rc&&Rc.binding&&Rc.binding("util")}catch{}})(),Q0=Si&&Si.isTypedArray,vh=Q0?Eh(Q0):RS,DS=Object.prototype,kS=DS.hasOwnProperty;function Fg(t,e){var n=Aa(t),r=!n&&Xf(t),s=!n&&!r&&Ru(t),a=!n&&!r&&!s&&vh(t),i=n||r||s||a,u=i?eS(t.length,String):[],o=u.length;for(var f in t)(e||kS.call(t,f))&&!(i&&(f=="length"||s&&(f=="offset"||f=="parent")||a&&(f=="buffer"||f=="byteLength"||f=="byteOffset")||xg(f,o)))&&u.push(f);return u}function Ug(t,e){return function(n){return t(e(n))}}var PS=Ug(Object.keys,Object),MS=Object.prototype,BS=MS.hasOwnProperty;function FS(t){if(!bh(t))return PS(t);var e=[];for(var n in Object(t))BS.call(t,n)&&n!="constructor"&&e.push(n);return e}function US(t){return Bl(t)?Fg(t):FS(t)}function HS(t){var e=[];if(t!=null)for(var n in Object(t))e.push(n);return e}var qS=Object.prototype,jS=qS.hasOwnProperty;function $S(t){if(!Ws(t))return HS(t);var e=bh(t),n=[];for(var r in t)r=="constructor"&&(e||!jS.call(t,r))||n.push(r);return n}function Hg(t){return Bl(t)?Fg(t,!0):$S(t)}var xu=xa(Object,"create");function YS(){this.__data__=xu?xu(null):{},this.size=0}function zS(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var WS="__lodash_hash_undefined__",GS=Object.prototype,KS=GS.hasOwnProperty;function VS(t){var e=this.__data__;if(xu){var n=e[t];return n===WS?void 0:n}return KS.call(e,t)?e[t]:void 0}var XS=Object.prototype,QS=XS.hasOwnProperty;function ZS(t){var e=this.__data__;return xu?e[t]!==void 0:QS.call(e,t)}var JS="__lodash_hash_undefined__";function eI(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=xu&&e===void 0?JS:e,this}function ya(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])}}ya.prototype.clear=YS;ya.prototype.delete=zS;ya.prototype.get=VS;ya.prototype.has=ZS;ya.prototype.set=eI;function tI(){this.__data__=[],this.size=0}function Fl(t,e){for(var n=t.length;n--;)if(no(t[n][0],e))return n;return-1}var nI=Array.prototype,rI=nI.splice;function sI(t){var e=this.__data__,n=Fl(e,t);if(n<0)return!1;var r=e.length-1;return n==r?e.pop():rI.call(e,n,1),--this.size,!0}function aI(t){var e=this.__data__,n=Fl(e,t);return n<0?void 0:e[n][1]}function iI(t){return Fl(this.__data__,t)>-1}function uI(t,e){var n=this.__data__,r=Fl(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this}function ps(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])}}ps.prototype.clear=tI;ps.prototype.delete=sI;ps.prototype.get=aI;ps.prototype.has=iI;ps.prototype.set=uI;var Du=xa(Qr,"Map");function oI(){this.size=0,this.__data__={hash:new ya,map:new(Du||ps),string:new ya}}function lI(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}function Ul(t,e){var n=t.__data__;return lI(e)?n[typeof e=="string"?"string":"hash"]:n.map}function cI(t){var e=Ul(this,t).delete(t);return this.size-=e?1:0,e}function fI(t){return Ul(this,t).get(t)}function dI(t){return Ul(this,t).has(t)}function hI(t,e){var n=Ul(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this}function Da(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])}}Da.prototype.clear=oI;Da.prototype.delete=cI;Da.prototype.get=fI;Da.prototype.has=dI;Da.prototype.set=hI;function pI(t,e){for(var n=-1,r=e.length,s=t.length;++n<r;)t[s+n]=e[n];return t}var qg=Ug(Object.getPrototypeOf,Object),mI="[object Object]",gI=Function.prototype,bI=Object.prototype,jg=gI.toString,EI=bI.hasOwnProperty,vI=jg.call(Object);function TI(t){if(!fs(t)||ki(t)!=mI)return!1;var e=qg(t);if(e===null)return!0;var n=EI.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&jg.call(n)==vI}function _I(){this.__data__=new ps,this.size=0}function AI(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n}function yI(t){return this.__data__.get(t)}function NI(t){return this.__data__.has(t)}var SI=200;function II(t,e){var n=this.__data__;if(n instanceof ps){var r=n.__data__;if(!Du||r.length<SI-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new Da(r)}return n.set(t,e),this.size=n.size,this}function Yr(t){var e=this.__data__=new ps(t);this.size=e.size}Yr.prototype.clear=_I;Yr.prototype.delete=AI;Yr.prototype.get=yI;Yr.prototype.has=NI;Yr.prototype.set=II;var $g=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Z0=$g&&typeof module=="object"&&module&&!module.nodeType&&module,CI=Z0&&Z0.exports===$g,J0=CI?Qr.Buffer:void 0,e1=J0?J0.allocUnsafe:void 0;function Yg(t,e){if(e)return t.slice();var n=t.length,r=e1?e1(n):new t.constructor(n);return t.copy(r),r}function wI(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 LI(){return[]}var OI=Object.prototype,RI=OI.propertyIsEnumerable,t1=Object.getOwnPropertySymbols,xI=t1?function(t){return t==null?[]:(t=Object(t),wI(t1(t),function(e){return RI.call(t,e)}))}:LI;function DI(t,e,n){var r=e(t);return Aa(t)?r:pI(r,n(t))}function Qf(t){return DI(t,US,xI)}var Zf=xa(Qr,"DataView"),Jf=xa(Qr,"Promise"),ed=xa(Qr,"Set"),n1="[object Map]",kI="[object Object]",r1="[object Promise]",s1="[object Set]",a1="[object WeakMap]",i1="[object DataView]",PI=Ra(Zf),MI=Ra(Du),BI=Ra(Jf),FI=Ra(ed),UI=Ra(Vf),mr=ki;(Zf&&mr(new Zf(new ArrayBuffer(1)))!=i1||Du&&mr(new Du)!=n1||Jf&&mr(Jf.resolve())!=r1||ed&&mr(new ed)!=s1||Vf&&mr(new Vf)!=a1)&&(mr=function(t){var e=ki(t),n=e==kI?t.constructor:void 0,r=n?Ra(n):"";if(r)switch(r){case PI:return i1;case MI:return n1;case BI:return r1;case FI:return s1;case UI:return a1}return e});var HI=Object.prototype,qI=HI.hasOwnProperty;function jI(t){var e=t.length,n=new t.constructor(e);return e&&typeof t[0]=="string"&&qI.call(t,"index")&&(n.index=t.index,n.input=t.input),n}var pl=Qr.Uint8Array;function Th(t){var e=new t.constructor(t.byteLength);return new pl(e).set(new pl(t)),e}function $I(t,e){var n=Th(t.buffer);return new t.constructor(n,t.byteOffset,t.byteLength)}var YI=/\w*$/;function zI(t){var e=new t.constructor(t.source,YI.exec(t));return e.lastIndex=t.lastIndex,e}var u1=js?js.prototype:void 0,o1=u1?u1.valueOf:void 0;function WI(t){return o1?Object(o1.call(t)):{}}function zg(t,e){var n=e?Th(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}var GI="[object Boolean]",KI="[object Date]",VI="[object Map]",XI="[object Number]",QI="[object RegExp]",ZI="[object Set]",JI="[object String]",eC="[object Symbol]",tC="[object ArrayBuffer]",nC="[object DataView]",rC="[object Float32Array]",sC="[object Float64Array]",aC="[object Int8Array]",iC="[object Int16Array]",uC="[object Int32Array]",oC="[object Uint8Array]",lC="[object Uint8ClampedArray]",cC="[object Uint16Array]",fC="[object Uint32Array]";function dC(t,e,n){var r=t.constructor;switch(e){case tC:return Th(t);case GI:case KI:return new r(+t);case nC:return $I(t);case rC:case sC:case aC:case iC:case uC:case oC:case lC:case cC:case fC:return zg(t,n);case VI:return new r;case XI:case JI:return new r(t);case QI:return zI(t);case ZI:return new r;case eC:return WI(t)}}function Wg(t){return typeof t.constructor=="function"&&!bh(t)?x6(qg(t)):{}}var hC="[object Map]";function pC(t){return fs(t)&&mr(t)==hC}var l1=Si&&Si.isMap,mC=l1?Eh(l1):pC,gC="[object Set]";function bC(t){return fs(t)&&mr(t)==gC}var c1=Si&&Si.isSet,EC=c1?Eh(c1):bC,vC=1,Gg="[object Arguments]",TC="[object Array]",_C="[object Boolean]",AC="[object Date]",yC="[object Error]",Kg="[object Function]",NC="[object GeneratorFunction]",SC="[object Map]",IC="[object Number]",Vg="[object Object]",CC="[object RegExp]",wC="[object Set]",LC="[object String]",OC="[object Symbol]",RC="[object WeakMap]",xC="[object ArrayBuffer]",DC="[object DataView]",kC="[object Float32Array]",PC="[object Float64Array]",MC="[object Int8Array]",BC="[object Int16Array]",FC="[object Int32Array]",UC="[object Uint8Array]",HC="[object Uint8ClampedArray]",qC="[object Uint16Array]",jC="[object Uint32Array]",At={};At[Gg]=At[TC]=At[xC]=At[DC]=At[_C]=At[AC]=At[kC]=At[PC]=At[MC]=At[BC]=At[FC]=At[SC]=At[IC]=At[Vg]=At[CC]=At[wC]=At[LC]=At[OC]=At[UC]=At[HC]=At[qC]=At[jC]=!0;At[yC]=At[Kg]=At[RC]=!1;function Go(t,e,n,r,s,a){var i,u=e&vC;if(i!==void 0)return i;if(!Ws(t))return t;var o=Aa(t);if(o)i=jI(t);else{var f=mr(t),h=f==Kg||f==NC;if(Ru(t))return Yg(t,u);if(f==Vg||f==Gg||h&&!s)i=h?{}:Wg(t);else{if(!At[f])return s?t:{};i=dC(t,f,u)}}a||(a=new Yr);var g=a.get(t);if(g)return g;a.set(t,i),EC(t)?t.forEach(function(b){i.add(Go(b,e,n,b,t,a))}):mC(t)&&t.forEach(function(b,_){i.set(_,Go(b,e,n,_,t,a))});var d=Qf,m=o?void 0:d(t);return j6(m||t,function(b,_){m&&(_=b,b=t[_]),Dg(i,_,Go(b,e,n,_,t,a))}),i}var $C=1,YC=4;function ti(t){return Go(t,$C|YC)}var zC="__lodash_hash_undefined__";function WC(t){return this.__data__.set(t,zC),this}function GC(t){return this.__data__.has(t)}function ml(t){var e=-1,n=t==null?0:t.length;for(this.__data__=new Da;++e<n;)this.add(t[e])}ml.prototype.add=ml.prototype.push=WC;ml.prototype.has=GC;function KC(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 VC(t,e){return t.has(e)}var XC=1,QC=2;function Xg(t,e,n,r,s,a){var i=n&XC,u=t.length,o=e.length;if(u!=o&&!(i&&o>u))return!1;var f=a.get(t),h=a.get(e);if(f&&h)return f==e&&h==t;var g=-1,d=!0,m=n&QC?new ml:void 0;for(a.set(t,e),a.set(e,t);++g<u;){var b=t[g],_=e[g];if(r)var T=i?r(_,b,g,e,t,a):r(b,_,g,t,e,a);if(T!==void 0){if(T)continue;d=!1;break}if(m){if(!KC(e,function(E,O){if(!VC(m,O)&&(b===E||s(b,E,n,r,a)))return m.push(O)})){d=!1;break}}else if(!(b===_||s(b,_,n,r,a))){d=!1;break}}return a.delete(t),a.delete(e),d}function ZC(t){var e=-1,n=Array(t.size);return t.forEach(function(r,s){n[++e]=[s,r]}),n}function JC(t){var e=-1,n=Array(t.size);return t.forEach(function(r){n[++e]=r}),n}var e4=1,t4=2,n4="[object Boolean]",r4="[object Date]",s4="[object Error]",a4="[object Map]",i4="[object Number]",u4="[object RegExp]",o4="[object Set]",l4="[object String]",c4="[object Symbol]",f4="[object ArrayBuffer]",d4="[object DataView]",f1=js?js.prototype:void 0,xc=f1?f1.valueOf:void 0;function h4(t,e,n,r,s,a,i){switch(n){case d4:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case f4:return!(t.byteLength!=e.byteLength||!a(new pl(t),new pl(e)));case n4:case r4:case i4:return no(+t,+e);case s4:return t.name==e.name&&t.message==e.message;case u4:case l4:return t==e+"";case a4:var u=ZC;case o4:var o=r&e4;if(u||(u=JC),t.size!=e.size&&!o)return!1;var f=i.get(t);if(f)return f==e;r|=t4,i.set(t,e);var h=Xg(u(t),u(e),r,s,a,i);return i.delete(t),h;case c4:if(xc)return xc.call(t)==xc.call(e)}return!1}var p4=1,m4=Object.prototype,g4=m4.hasOwnProperty;function b4(t,e,n,r,s,a){var i=n&p4,u=Qf(t),o=u.length,f=Qf(e),h=f.length;if(o!=h&&!i)return!1;for(var g=o;g--;){var d=u[g];if(!(i?d in e:g4.call(e,d)))return!1}var m=a.get(t),b=a.get(e);if(m&&b)return m==e&&b==t;var _=!0;a.set(t,e),a.set(e,t);for(var T=i;++g<o;){d=u[g];var E=t[d],O=e[d];if(r)var L=i?r(O,E,d,e,t,a):r(E,O,d,t,e,a);if(!(L===void 0?E===O||s(E,O,n,r,a):L)){_=!1;break}T||(T=d=="constructor")}if(_&&!T){var B=t.constructor,I=e.constructor;B!=I&&"constructor"in t&&"constructor"in e&&!(typeof B=="function"&&B instanceof B&&typeof I=="function"&&I instanceof I)&&(_=!1)}return a.delete(t),a.delete(e),_}var E4=1,d1="[object Arguments]",h1="[object Array]",Co="[object Object]",v4=Object.prototype,p1=v4.hasOwnProperty;function T4(t,e,n,r,s,a){var i=Aa(t),u=Aa(e),o=i?h1:mr(t),f=u?h1:mr(e);o=o==d1?Co:o,f=f==d1?Co:f;var h=o==Co,g=f==Co,d=o==f;if(d&&Ru(t)){if(!Ru(e))return!1;i=!0,h=!1}if(d&&!h)return a||(a=new Yr),i||vh(t)?Xg(t,e,n,r,s,a):h4(t,e,o,n,r,s,a);if(!(n&E4)){var m=h&&p1.call(t,"__wrapped__"),b=g&&p1.call(e,"__wrapped__");if(m||b){var _=m?t.value():t,T=b?e.value():e;return a||(a=new Yr),s(_,T,n,r,a)}}return d?(a||(a=new Yr),b4(t,e,n,r,s,a)):!1}function Qg(t,e,n,r,s){return t===e?!0:t==null||e==null||!fs(t)&&!fs(e)?t!==t&&e!==e:T4(t,e,n,r,Qg,s)}function _4(t){return function(e,n,r){for(var s=-1,a=Object(e),i=r(e),u=i.length;u--;){var o=i[++s];if(n(a[o],o,a)===!1)break}return e}}var A4=_4();function td(t,e,n){(n!==void 0&&!no(t[e],n)||n===void 0&&!(e in t))&&gh(t,e,n)}function y4(t){return fs(t)&&Bl(t)}function nd(t,e){if(!(e==="constructor"&&typeof t[e]=="function")&&e!="__proto__")return t[e]}function N4(t){return G6(t,Hg(t))}function S4(t,e,n,r,s,a,i){var u=nd(t,n),o=nd(e,n),f=i.get(o);if(f){td(t,n,f);return}var h=a?a(u,o,n+"",t,e,i):void 0,g=h===void 0;if(g){var d=Aa(o),m=!d&&Ru(o),b=!d&&!m&&vh(o);h=o,d||m||b?Aa(u)?h=u:y4(u)?h=k6(u):m?(g=!1,h=Yg(o,!0)):b?(g=!1,h=zg(o,!0)):h=[]:TI(o)||Xf(o)?(h=u,Xf(u)?h=N4(u):(!Ws(u)||mh(u))&&(h=Wg(o))):g=!1}g&&(i.set(o,h),s(h,o,r,a,i),i.delete(o)),td(t,n,h)}function Zg(t,e,n,r,s){t!==e&&A4(e,function(a,i){if(s||(s=new Yr),Ws(a))S4(t,e,i,n,Zg,r,s);else{var u=r?r(nd(t,i),a,i+"",t,e,s):void 0;u===void 0&&(u=a),td(t,i,u)}},Hg)}function _h(t,e){return Qg(t,e)}var Fs=Z6(function(t,e,n){Zg(t,e,n)}),Oe=(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))(Oe||{});class Vr{constructor(e,n,r={}){this.attrName=e,this.keyName=n;const s=Oe.TYPE&Oe.ATTRIBUTE;this.scope=r.scope!=null?r.scope&Oe.LEVEL|s:Oe.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 ni extends Error{constructor(e){e="[Parchment] "+e,super(e),this.message=e,this.name=this.constructor.name}}const Jg=class rd{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 ni(`Unable to create ${n} blot`);const a=s,i=n instanceof Node||n.nodeType===Node.TEXT_NODE?n:a.create(r),u=new a(e,i,r);return rd.blots.set(u.domNode,u),u}find(e,n=!1){return rd.find(e,n)}query(e,n=Oe.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&Oe.LEVEL&Oe.BLOCK?r=this.types.block:e&Oe.LEVEL&Oe.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&Oe.LEVEL&r.scope&&n&Oe.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 ni("Invalid definition");if(r&&n.blotName==="abstract")throw new ni("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})}};Jg.blots=new WeakMap;let Ii=Jg;function m1(t,e){return(t.getAttribute("class")||"").split(/\s+/).filter(n=>n.indexOf(`${e}-`)===0)}class I4 extends Vr{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){m1(e,this.keyName).forEach(n=>{e.classList.remove(n)}),e.classList.length===0&&e.removeAttribute("class")}value(e){const n=(m1(e,this.keyName)[0]||"").slice(this.keyName.length+1);return this.canAdd(e,n)?n:""}}const wr=I4;function Dc(t){const e=t.split("-"),n=e.slice(1).map(r=>r[0].toUpperCase()+r.slice(1)).join("");return e[0]+n}class C4 extends Vr{static keys(e){return(e.getAttribute("style")||"").split(";").map(n=>n.split(":")[0].trim())}add(e,n){return this.canAdd(e,n)?(e.style[Dc(this.keyName)]=n,!0):!1}remove(e){e.style[Dc(this.keyName)]="",e.getAttribute("style")||e.removeAttribute("style")}value(e){const n=e.style[Dc(this.keyName)];return this.canAdd(e,n)?n:""}}const Gs=C4;class w4{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=Ii.find(this.domNode);if(e==null)return;const n=Vr.keys(this.domNode),r=wr.keys(this.domNode),s=Gs.keys(this.domNode);n.concat(r).concat(s).forEach(a=>{const i=e.scroll.query(a,Oe.ATTRIBUTE);i instanceof Vr&&(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 Hl=w4,eb=class{constructor(e,n){this.scroll=e,this.domNode=n,Ii.blots.set(n,this),this.prev=null,this.next=null}static create(e){if(this.tagName==null)throw new ni("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),Ii.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,Oe.BLOT)!=null&&s)a.wrap(r,s);else if(this.scroll.query(r,Oe.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 ni(`Cannot wrap ${e}`);return r.appendChild(this),r}};eb.blotName="abstract";let tb=eb;const nb=class extends tb{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}}};nb.scope=Oe.INLINE_BLOT;let L4=nb;const dn=L4;class O4{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 u=this.iterator(s);let o=u();for(;o&&i<e+n;){const f=o.length();e>i?r(o,e-i,Math.min(n,i+f-e)):r(o,0,Math.min(f,e+n-i)),i+=f,o=u()}}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 g1(t,e){const n=e.find(t);if(n)return n;try{return e.create(t)}catch{const r=e.create(Oe.INLINE);return Array.from(t.childNodes).forEach(s=>{r.domNode.appendChild(s)}),t.parentNode&&t.parentNode.replaceChild(r.domNode,t),r.attach(),r}}const rb=class _s extends tb{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,_s.uiClass&&this.uiNode.classList.add(_s.uiClass),this.uiNode.setAttribute("contenteditable","false"),this.domNode.insertBefore(this.uiNode,this.domNode.firstChild)}build(){this.children=new O4,Array.from(this.domNode.childNodes).filter(e=>e!==this.uiNode).reverse().forEach(e=>{try{const n=g1(e,this.scroll);this.insertBefore(n,this.children.head||void 0)}catch(n){if(n instanceof ni)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 _s?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,u,o)=>{(e.blotName==null&&e(i)||e.blotName!=null&&i instanceof e)&&s.push(i),i instanceof _s&&(s=s.concat(i.descendants(e,u,a))),a-=o}),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===Oe.BLOCK_BLOT?(n.next!=null&&this.splitAfter(n),n.prev!=null&&this.splitAfter(n.prev),n.parent.unwrap(),e=!0):n instanceof _s?n.unwrap():n.remove())})}formatAt(e,n,r,s){this.children.forEachAt(e,n,(a,i,u)=>{a.formatAt(i,u,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 _s?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 _s&&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 u=s.split(a,n);u!=null&&r.appendChild(u)}),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 u=g1(a,this.scroll);(u.next!==i||u.next==null)&&(u.parent!=null&&u.parent.removeChild(this),this.insertBefore(u,i||void 0))}),this.enforceAllowedChildren()}};rb.uiClass="";let R4=rb;const _r=R4;function x4(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 Ya=class za extends _r{static create(e){return super.create(e)}static formats(e,n){const r=n.query(za.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 Hl(this.domNode)}format(e,n){if(e===this.statics.blotName&&!n)this.children.forEach(r=>{r instanceof za||(r=r.wrap(za.blotName,!0)),this.attributes.copy(r)}),this.unwrap();else{const r=this.scroll.query(e,Oe.INLINE);if(r==null)return;r instanceof Vr?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,Oe.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 za&&r.prev===this&&x4(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 za&&this.attributes.move(r),r}};Ya.allowedChildren=[Ya,dn],Ya.blotName="inline",Ya.scope=Oe.INLINE_BLOT,Ya.tagName="SPAN";let D4=Ya;const Ah=D4,Wa=class sd extends _r{static create(e){return super.create(e)}static formats(e,n){const r=n.query(sd.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 Hl(this.domNode)}format(e,n){const r=this.scroll.query(e,Oe.BLOCK);r!=null&&(r instanceof Vr?this.attributes.attribute(r,n):e===this.statics.blotName&&!n?this.replaceWith(sd.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,Oe.BLOCK)!=null?this.format(r,s):super.formatAt(e,n,r,s)}insertAt(e,n,r){if(r==null||this.scroll.query(n,Oe.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()}};Wa.blotName="block",Wa.scope=Oe.BLOCK_BLOT,Wa.tagName="P",Wa.allowedChildren=[Ah,Wa,dn];let k4=Wa;const ku=k4,ad=class extends _r{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())}};ad.blotName="container",ad.scope=Oe.BLOCK_BLOT;let P4=ad;const ql=P4;class M4 extends dn{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=M4,B4={attributes:!0,characterData:!0,characterDataOldValue:!0,childList:!0,subtree:!0},F4=100,Ga=class extends _r{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,B4),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=Oe.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=(o,f=!0)=>{o==null||o===this||o.domNode.parentNode!=null&&(r.has(o.domNode)||r.set(o.domNode,[]),f&&a(o.parent))},i=o=>{r.has(o.domNode)&&(o instanceof _r&&o.children.forEach(i),r.delete(o.domNode),o.optimize(n))};let u=e;for(let o=0;u.length>0;o+=1){if(o>=F4)throw new Error("[Parchment] Maximum optimize iterations reached");for(u.forEach(f=>{const h=this.find(f.target,!0);h!=null&&(h.domNode===f.target&&(f.type==="childList"?(a(this.find(f.previousSibling,!1)),Array.from(f.addedNodes).forEach(g=>{const d=this.find(g,!1);a(d,!1),d instanceof _r&&d.children.forEach(m=>{a(m,!1)})})):f.type==="attributes"&&a(h.prev)),a(h))}),this.children.forEach(i),u=Array.from(this.observer.takeRecords()),s=u.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)}};Ga.blotName="scroll",Ga.defaultChild=ku,Ga.allowedChildren=[ku,ql],Ga.scope=Oe.BLOCK_BLOT,Ga.tagName="DIV";let U4=Ga;const yh=U4,id=class sb extends dn{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 sb&&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}};id.blotName="text",id.scope=Oe.INLINE_BLOT;let H4=id;const gl=H4,q4=Object.freeze(Object.defineProperty({__proto__:null,Attributor:Vr,AttributorStore:Hl,BlockBlot:ku,ClassAttributor:wr,ContainerBlot:ql,EmbedBlot:qn,InlineBlot:Ah,LeafBlot:dn,ParentBlot:_r,Registry:Ii,Scope:Oe,ScrollBlot:yh,StyleAttributor:Gs,TextBlot:gl},Symbol.toStringTag,{value:"Module"}));var Rs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ab(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var wo={exports:{}},kc,b1;function j4(){if(b1)return kc;b1=1;var t=-1,e=1,n=0;function r(v,M,S,U,F){if(v===M)return v?[[n,v]]:[];if(S!=null){var k=Q(v,M,S);if(k)return k}var V=u(v,M),z=v.substring(0,V);v=v.substring(V),M=M.substring(V),V=f(v,M);var j=v.substring(v.length-V);v=v.substring(0,v.length-V),M=M.substring(0,M.length-V);var X=s(v,M);return z&&X.unshift([n,z]),j&&X.push([n,j]),O(X,F),U&&g(X),X}function s(v,M){var S;if(!v)return[[e,M]];if(!M)return[[t,v]];var U=v.length>M.length?v:M,F=v.length>M.length?M:v,k=U.indexOf(F);if(k!==-1)return S=[[e,U.substring(0,k)],[n,F],[e,U.substring(k+F.length)]],v.length>M.length&&(S[0][0]=S[2][0]=t),S;if(F.length===1)return[[t,v],[e,M]];var V=h(v,M);if(V){var z=V[0],j=V[1],X=V[2],J=V[3],ne=V[4],le=r(z,X),be=r(j,J);return le.concat([[n,ne]],be)}return a(v,M)}function a(v,M){for(var S=v.length,U=M.length,F=Math.ceil((S+U)/2),k=F,V=2*F,z=new Array(V),j=new Array(V),X=0;X<V;X++)z[X]=-1,j[X]=-1;z[k+1]=0,j[k+1]=0;for(var J=S-U,ne=J%2!==0,le=0,be=0,pe=0,Re=0,ue=0;ue<F;ue++){for(var me=-ue+le;me<=ue-be;me+=2){var Ne=k+me,_e;me===-ue||me!==ue&&z[Ne-1]<z[Ne+1]?_e=z[Ne+1]:_e=z[Ne-1]+1;for(var ye=_e-me;_e<S&&ye<U&&v.charAt(_e)===M.charAt(ye);)_e++,ye++;if(z[Ne]=_e,_e>S)be+=2;else if(ye>U)le+=2;else if(ne){var Ie=k+J-me;if(Ie>=0&&Ie<V&&j[Ie]!==-1){var Ue=S-j[Ie];if(_e>=Ue)return i(v,M,_e,ye)}}}for(var We=-ue+pe;We<=ue-Re;We+=2){var Ie=k+We,Ue;We===-ue||We!==ue&&j[Ie-1]<j[Ie+1]?Ue=j[Ie+1]:Ue=j[Ie-1]+1;for(var Ge=Ue-We;Ue<S&&Ge<U&&v.charAt(S-Ue-1)===M.charAt(U-Ge-1);)Ue++,Ge++;if(j[Ie]=Ue,Ue>S)Re+=2;else if(Ge>U)pe+=2;else if(!ne){var Ne=k+J-We;if(Ne>=0&&Ne<V&&z[Ne]!==-1){var _e=z[Ne],ye=k+_e-Ne;if(Ue=S-Ue,_e>=Ue)return i(v,M,_e,ye)}}}}return[[t,v],[e,M]]}function i(v,M,S,U){var F=v.substring(0,S),k=M.substring(0,U),V=v.substring(S),z=M.substring(U),j=r(F,k),X=r(V,z);return j.concat(X)}function u(v,M){if(!v||!M||v.charAt(0)!==M.charAt(0))return 0;for(var S=0,U=Math.min(v.length,M.length),F=U,k=0;S<F;)v.substring(k,F)==M.substring(k,F)?(S=F,k=S):U=F,F=Math.floor((U-S)/2+S);return L(v.charCodeAt(F-1))&&F--,F}function o(v,M){var S=v.length,U=M.length;if(S==0||U==0)return 0;S>U?v=v.substring(S-U):S<U&&(M=M.substring(0,S));var F=Math.min(S,U);if(v==M)return F;for(var k=0,V=1;;){var z=v.substring(F-V),j=M.indexOf(z);if(j==-1)return k;V+=j,(j==0||v.substring(F-V)==M.substring(0,V))&&(k=V,V++)}}function f(v,M){if(!v||!M||v.slice(-1)!==M.slice(-1))return 0;for(var S=0,U=Math.min(v.length,M.length),F=U,k=0;S<F;)v.substring(v.length-F,v.length-k)==M.substring(M.length-F,M.length-k)?(S=F,k=S):U=F,F=Math.floor((U-S)/2+S);return B(v.charCodeAt(v.length-F))&&F--,F}function h(v,M){var S=v.length>M.length?v:M,U=v.length>M.length?M:v;if(S.length<4||U.length*2<S.length)return null;function F(be,pe,Re){for(var ue=be.substring(Re,Re+Math.floor(be.length/4)),me=-1,Ne="",_e,ye,Ie,Ue;(me=pe.indexOf(ue,me+1))!==-1;){var We=u(be.substring(Re),pe.substring(me)),Ge=f(be.substring(0,Re),pe.substring(0,me));Ne.length<Ge+We&&(Ne=pe.substring(me-Ge,me)+pe.substring(me,me+We),_e=be.substring(0,Re-Ge),ye=be.substring(Re+We),Ie=pe.substring(0,me-Ge),Ue=pe.substring(me+We))}return Ne.length*2>=be.length?[_e,ye,Ie,Ue,Ne]:null}var k=F(S,U,Math.ceil(S.length/4)),V=F(S,U,Math.ceil(S.length/2)),z;if(!k&&!V)return null;V?k?z=k[4].length>V[4].length?k:V:z=V:z=k;var j,X,J,ne;v.length>M.length?(j=z[0],X=z[1],J=z[2],ne=z[3]):(J=z[0],ne=z[1],j=z[2],X=z[3]);var le=z[4];return[j,X,J,ne,le]}function g(v){for(var M=!1,S=[],U=0,F=null,k=0,V=0,z=0,j=0,X=0;k<v.length;)v[k][0]==n?(S[U++]=k,V=j,z=X,j=0,X=0,F=v[k][1]):(v[k][0]==e?j+=v[k][1].length:X+=v[k][1].length,F&&F.length<=Math.max(V,z)&&F.length<=Math.max(j,X)&&(v.splice(S[U-1],0,[t,F]),v[S[U-1]+1][0]=e,U--,U--,k=U>0?S[U-1]:-1,V=0,z=0,j=0,X=0,F=null,M=!0)),k++;for(M&&O(v),E(v),k=1;k<v.length;){if(v[k-1][0]==t&&v[k][0]==e){var J=v[k-1][1],ne=v[k][1],le=o(J,ne),be=o(ne,J);le>=be?(le>=J.length/2||le>=ne.length/2)&&(v.splice(k,0,[n,ne.substring(0,le)]),v[k-1][1]=J.substring(0,J.length-le),v[k+1][1]=ne.substring(le),k++):(be>=J.length/2||be>=ne.length/2)&&(v.splice(k,0,[n,J.substring(0,be)]),v[k-1][0]=e,v[k-1][1]=ne.substring(0,ne.length-be),v[k+1][0]=t,v[k+1][1]=J.substring(be),k++),k++}k++}}var d=/[^a-zA-Z0-9]/,m=/\s/,b=/[\r\n]/,_=/\n\r?\n$/,T=/^\r?\n\r?\n/;function E(v){function M(be,pe){if(!be||!pe)return 6;var Re=be.charAt(be.length-1),ue=pe.charAt(0),me=Re.match(d),Ne=ue.match(d),_e=me&&Re.match(m),ye=Ne&&ue.match(m),Ie=_e&&Re.match(b),Ue=ye&&ue.match(b),We=Ie&&be.match(_),Ge=Ue&&pe.match(T);return We||Ge?5:Ie||Ue?4:me&&!_e&&ye?3:_e||ye?2:me||Ne?1:0}for(var S=1;S<v.length-1;){if(v[S-1][0]==n&&v[S+1][0]==n){var U=v[S-1][1],F=v[S][1],k=v[S+1][1],V=f(U,F);if(V){var z=F.substring(F.length-V);U=U.substring(0,U.length-V),F=z+F.substring(0,F.length-V),k=z+k}for(var j=U,X=F,J=k,ne=M(U,F)+M(F,k);F.charAt(0)===k.charAt(0);){U+=F.charAt(0),F=F.substring(1)+k.charAt(0),k=k.substring(1);var le=M(U,F)+M(F,k);le>=ne&&(ne=le,j=U,X=F,J=k)}v[S-1][1]!=j&&(j?v[S-1][1]=j:(v.splice(S-1,1),S--),v[S][1]=X,J?v[S+1][1]=J:(v.splice(S+1,1),S--))}S++}}function O(v,M){v.push([n,""]);for(var S=0,U=0,F=0,k="",V="",z;S<v.length;){if(S<v.length-1&&!v[S][1]){v.splice(S,1);continue}switch(v[S][0]){case e:F++,V+=v[S][1],S++;break;case t:U++,k+=v[S][1],S++;break;case n:var j=S-F-U-1;if(M){if(j>=0&&H(v[j][1])){var X=v[j][1].slice(-1);if(v[j][1]=v[j][1].slice(0,-1),k=X+k,V=X+V,!v[j][1]){v.splice(j,1),S--;var J=j-1;v[J]&&v[J][0]===e&&(F++,V=v[J][1]+V,J--),v[J]&&v[J][0]===t&&(U++,k=v[J][1]+k,J--),j=J}}if(I(v[S][1])){var X=v[S][1].charAt(0);v[S][1]=v[S][1].slice(1),k+=X,V+=X}}if(S<v.length-1&&!v[S][1]){v.splice(S,1);break}if(k.length>0||V.length>0){k.length>0&&V.length>0&&(z=u(V,k),z!==0&&(j>=0?v[j][1]+=V.substring(0,z):(v.splice(0,0,[n,V.substring(0,z)]),S++),V=V.substring(z),k=k.substring(z)),z=f(V,k),z!==0&&(v[S][1]=V.substring(V.length-z)+v[S][1],V=V.substring(0,V.length-z),k=k.substring(0,k.length-z)));var ne=F+U;k.length===0&&V.length===0?(v.splice(S-ne,ne),S=S-ne):k.length===0?(v.splice(S-ne,ne,[e,V]),S=S-ne+1):V.length===0?(v.splice(S-ne,ne,[t,k]),S=S-ne+1):(v.splice(S-ne,ne,[t,k],[e,V]),S=S-ne+2)}S!==0&&v[S-1][0]===n?(v[S-1][1]+=v[S][1],v.splice(S,1)):S++,F=0,U=0,k="",V="";break}}v[v.length-1][1]===""&&v.pop();var le=!1;for(S=1;S<v.length-1;)v[S-1][0]===n&&v[S+1][0]===n&&(v[S][1].substring(v[S][1].length-v[S-1][1].length)===v[S-1][1]?(v[S][1]=v[S-1][1]+v[S][1].substring(0,v[S][1].length-v[S-1][1].length),v[S+1][1]=v[S-1][1]+v[S+1][1],v.splice(S-1,1),le=!0):v[S][1].substring(0,v[S+1][1].length)==v[S+1][1]&&(v[S-1][1]+=v[S+1][1],v[S][1]=v[S][1].substring(v[S+1][1].length)+v[S+1][1],v.splice(S+1,1),le=!0)),S++;le&&O(v,M)}function L(v){return v>=55296&&v<=56319}function B(v){return v>=56320&&v<=57343}function I(v){return B(v.charCodeAt(0))}function H(v){return L(v.charCodeAt(v.length-1))}function R(v){for(var M=[],S=0;S<v.length;S++)v[S][1].length>0&&M.push(v[S]);return M}function q(v,M,S,U){return H(v)||I(U)?null:R([[n,v],[t,M],[e,S],[n,U]])}function Q(v,M,S){var U=typeof S=="number"?{index:S,length:0}:S.oldRange,F=typeof S=="number"?null:S.newRange,k=v.length,V=M.length;if(U.length===0&&(F===null||F.length===0)){var z=U.index,j=v.slice(0,z),X=v.slice(z),J=F?F.index:null;e:{var ne=z+V-k;if(J!==null&&J!==ne||ne<0||ne>V)break e;var le=M.slice(0,ne),be=M.slice(ne);if(be!==X)break e;var pe=Math.min(z,ne),Re=j.slice(0,pe),ue=le.slice(0,pe);if(Re!==ue)break e;var me=j.slice(pe),Ne=le.slice(pe);return q(Re,me,Ne,X)}e:{if(J!==null&&J!==z)break e;var _e=z,le=M.slice(0,_e),be=M.slice(_e);if(le!==j)break e;var ye=Math.min(k-_e,V-_e),Ie=X.slice(X.length-ye),Ue=be.slice(be.length-ye);if(Ie!==Ue)break e;var me=X.slice(0,X.length-ye),Ne=be.slice(0,be.length-ye);return q(j,me,Ne,Ie)}}if(U.length>0&&F&&F.length===0)e:{var Re=v.slice(0,U.index),Ie=v.slice(U.index+U.length),pe=Re.length,ye=Ie.length;if(V<pe+ye)break e;var ue=M.slice(0,pe),Ue=M.slice(V-ye);if(Re!==ue||Ie!==Ue)break e;var me=v.slice(pe,k-ye),Ne=M.slice(pe,V-ye);return q(Re,me,Ne,Ie)}return null}function Y(v,M,S,U){return r(v,M,S,U,!0)}return Y.INSERT=e,Y.DELETE=t,Y.EQUAL=n,kc=Y,kc}var au={exports:{}};au.exports;var E1;function ib(){return E1||(E1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=9007199254740991,a="[object Arguments]",i="[object Array]",u="[object Boolean]",o="[object Date]",f="[object Error]",h="[object Function]",g="[object GeneratorFunction]",d="[object Map]",m="[object Number]",b="[object Object]",_="[object Promise]",T="[object RegExp]",E="[object Set]",O="[object String]",L="[object Symbol]",B="[object WeakMap]",I="[object ArrayBuffer]",H="[object DataView]",R="[object Float32Array]",q="[object Float64Array]",Q="[object Int8Array]",Y="[object Int16Array]",v="[object Int32Array]",M="[object Uint8Array]",S="[object Uint8ClampedArray]",U="[object Uint16Array]",F="[object Uint32Array]",k=/[\\^$.*+?()[\]{}|]/g,V=/\w*$/,z=/^\[object .+?Constructor\]$/,j=/^(?:0|[1-9]\d*)$/,X={};X[a]=X[i]=X[I]=X[H]=X[u]=X[o]=X[R]=X[q]=X[Q]=X[Y]=X[v]=X[d]=X[m]=X[b]=X[T]=X[E]=X[O]=X[L]=X[M]=X[S]=X[U]=X[F]=!0,X[f]=X[h]=X[B]=!1;var J=typeof Rs=="object"&&Rs&&Rs.Object===Object&&Rs,ne=typeof self=="object"&&self&&self.Object===Object&&self,le=J||ne||Function("return this")(),be=e&&!e.nodeType&&e,pe=be&&!0&&t&&!t.nodeType&&t,Re=pe&&pe.exports===be;function ue(p,A){return p.set(A[0],A[1]),p}function me(p,A){return p.add(A),p}function Ne(p,A){for(var P=-1,re=p?p.length:0;++P<re&&A(p[P],P,p)!==!1;);return p}function _e(p,A){for(var P=-1,re=A.length,ze=p.length;++P<re;)p[ze+P]=A[P];return p}function ye(p,A,P,re){for(var ze=-1,xe=p?p.length:0;++ze<xe;)P=A(P,p[ze],ze,p);return P}function Ie(p,A){for(var P=-1,re=Array(p);++P<p;)re[P]=A(P);return re}function Ue(p,A){return p==null?void 0:p[A]}function We(p){var A=!1;if(p!=null&&typeof p.toString!="function")try{A=!!(p+"")}catch{}return A}function Ge(p){var A=-1,P=Array(p.size);return p.forEach(function(re,ze){P[++A]=[ze,re]}),P}function zt(p,A){return function(P){return p(A(P))}}function Ke(p){var A=-1,P=Array(p.size);return p.forEach(function(re){P[++A]=re}),P}var Bt=Array.prototype,Qt=Function.prototype,Ft=Object.prototype,Zt=le["__core-js_shared__"],xn=(function(){var p=/[^.]+$/.exec(Zt&&Zt.keys&&Zt.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),Wt=Qt.toString,Ut=Ft.hasOwnProperty,Z=Ft.toString,Te=RegExp("^"+Wt.call(Ut).replace(k,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),Ce=Re?le.Buffer:void 0,ke=le.Symbol,Xe=le.Uint8Array,Me=zt(Object.getPrototypeOf,Object),gt=Object.create,Ht=Ft.propertyIsEnumerable,Dn=Bt.splice,mn=Object.getOwnPropertySymbols,gn=Ce?Ce.isBuffer:void 0,kn=zt(Object.keys,Object),Rr=lr(le,"DataView"),ur=lr(le,"Map"),bn=lr(le,"Promise"),xr=lr(le,"Set"),Zr=lr(le,"WeakMap"),jn=lr(Object,"create"),ve=En(Rr),He=En(ur),Je=En(bn),Qe=En(xr),ce=En(Zr),It=ke?ke.prototype:void 0,$e=It?It.valueOf:void 0;function Ye(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function _t(){this.__data__=jn?jn(null):{}}function Jt(p){return this.has(p)&&delete this.__data__[p]}function Pn(p){var A=this.__data__;if(jn){var P=A[p];return P===r?void 0:P}return Ut.call(A,p)?A[p]:void 0}function Lt(p){var A=this.__data__;return jn?A[p]!==void 0:Ut.call(A,p)}function Ot(p,A){var P=this.__data__;return P[p]=jn&&A===void 0?r:A,this}Ye.prototype.clear=_t,Ye.prototype.delete=Jt,Ye.prototype.get=Pn,Ye.prototype.has=Lt,Ye.prototype.set=Ot;function ot(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Gt(){this.__data__=[]}function qt(p){var A=this.__data__,P=gs(A,p);if(P<0)return!1;var re=A.length-1;return P==re?A.pop():Dn.call(A,P,1),!0}function Ct(p){var A=this.__data__,P=gs(A,p);return P<0?void 0:A[P][1]}function or(p){return gs(this.__data__,p)>-1}function yn(p,A){var P=this.__data__,re=gs(P,p);return re<0?P.push([p,A]):P[re][1]=A,this}ot.prototype.clear=Gt,ot.prototype.delete=qt,ot.prototype.get=Ct,ot.prototype.has=or,ot.prototype.set=yn;function kt(p){var A=-1,P=p?p.length:0;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Ks(){this.__data__={hash:new Ye,map:new(ur||ot),string:new Ye}}function Vs(p){return Zs(this,p).delete(p)}function Pi(p){return Zs(this,p).get(p)}function Mi(p){return Zs(this,p).has(p)}function Bi(p,A){return Zs(this,p).set(p,A),this}kt.prototype.clear=Ks,kt.prototype.delete=Vs,kt.prototype.get=Pi,kt.prototype.has=Mi,kt.prototype.set=Bi;function en(p){this.__data__=new ot(p)}function Fi(){this.__data__=new ot}function Ui(p){return this.__data__.delete(p)}function Hi(p){return this.__data__.get(p)}function Pe(p){return this.__data__.has(p)}function Le(p,A){var P=this.__data__;if(P instanceof ot){var re=P.__data__;if(!ur||re.length<n-1)return re.push([p,A]),this;P=this.__data__=new kt(re)}return P.set(p,A),this}en.prototype.clear=Fi,en.prototype.delete=Ui,en.prototype.get=Hi,en.prototype.has=Pe,en.prototype.set=Le;function et(p,A){var P=$i(p)||Fa(p)?Ie(p.length,String):[],re=P.length,ze=!!re;for(var xe in p)Ut.call(p,xe)&&!(ze&&(xe=="length"||sc(xe,re)))&&P.push(xe);return P}function jt(p,A,P){var re=p[A];(!(Ut.call(p,A)&&fo(re,P))||P===void 0&&!(A in p))&&(p[A]=P)}function gs(p,A){for(var P=p.length;P--;)if(fo(p[P][0],A))return P;return-1}function $n(p,A){return p&&ji(A,zi(A),p)}function Xs(p,A,P,re,ze,xe,ut){var st;if(re&&(st=xe?re(p,ze,xe,ut):re(p)),st!==void 0)return st;if(!kr(p))return p;var Pt=$i(p);if(Pt){if(st=nc(p),!A)return Jl(p,st)}else{var dt=es(p),ln=dt==h||dt==g;if(ho(p))return Ba(p,A);if(dt==b||dt==a||ln&&!xe){if(We(p))return xe?p:{};if(st=Dr(ln?{}:p),!A)return ec(p,$n(st,p))}else{if(!X[dt])return xe?p:{};st=rc(p,dt,Xs,A)}}ut||(ut=new en);var Nn=ut.get(p);if(Nn)return Nn;if(ut.set(p,st),!Pt)var $t=P?tc(p):zi(p);return Ne($t||p,function(cn,tn){$t&&(tn=cn,cn=p[tn]),jt(st,tn,Xs(cn,A,P,re,tn,p,ut))}),st}function zl(p){return kr(p)?gt(p):{}}function Wl(p,A,P){var re=A(p);return $i(p)?re:_e(re,P(p))}function Gl(p){return Z.call(p)}function Kl(p){if(!kr(p)||ic(p))return!1;var A=Yi(p)||We(p)?Te:z;return A.test(En(p))}function Vl(p){if(!lo(p))return kn(p);var A=[];for(var P in Object(p))Ut.call(p,P)&&P!="constructor"&&A.push(P);return A}function Ba(p,A){if(A)return p.slice();var P=new p.constructor(p.length);return p.copy(P),P}function qi(p){var A=new p.constructor(p.byteLength);return new Xe(A).set(new Xe(p)),A}function Qs(p,A){var P=A?qi(p.buffer):p.buffer;return new p.constructor(P,p.byteOffset,p.byteLength)}function uo(p,A,P){var re=A?P(Ge(p),!0):Ge(p);return ye(re,ue,new p.constructor)}function oo(p){var A=new p.constructor(p.source,V.exec(p));return A.lastIndex=p.lastIndex,A}function Xl(p,A,P){var re=A?P(Ke(p),!0):Ke(p);return ye(re,me,new p.constructor)}function Ql(p){return $e?Object($e.call(p)):{}}function Zl(p,A){var P=A?qi(p.buffer):p.buffer;return new p.constructor(P,p.byteOffset,p.length)}function Jl(p,A){var P=-1,re=p.length;for(A||(A=Array(re));++P<re;)A[P]=p[P];return A}function ji(p,A,P,re){P||(P={});for(var ze=-1,xe=A.length;++ze<xe;){var ut=A[ze],st=void 0;jt(P,ut,st===void 0?p[ut]:st)}return P}function ec(p,A){return ji(p,Jr(p),A)}function tc(p){return Wl(p,zi,Jr)}function Zs(p,A){var P=p.__data__;return ac(A)?P[typeof A=="string"?"string":"hash"]:P.map}function lr(p,A){var P=Ue(p,A);return Kl(P)?P:void 0}var Jr=mn?zt(mn,Object):oc,es=Gl;(Rr&&es(new Rr(new ArrayBuffer(1)))!=H||ur&&es(new ur)!=d||bn&&es(bn.resolve())!=_||xr&&es(new xr)!=E||Zr&&es(new Zr)!=B)&&(es=function(p){var A=Z.call(p),P=A==b?p.constructor:void 0,re=P?En(P):void 0;if(re)switch(re){case ve:return H;case He:return d;case Je:return _;case Qe:return E;case ce:return B}return A});function nc(p){var A=p.length,P=p.constructor(A);return A&&typeof p[0]=="string"&&Ut.call(p,"index")&&(P.index=p.index,P.input=p.input),P}function Dr(p){return typeof p.constructor=="function"&&!lo(p)?zl(Me(p)):{}}function rc(p,A,P,re){var ze=p.constructor;switch(A){case I:return qi(p);case u:case o:return new ze(+p);case H:return Qs(p,re);case R:case q:case Q:case Y:case v:case M:case S:case U:case F:return Zl(p,re);case d:return uo(p,re,P);case m:case O:return new ze(p);case T:return oo(p);case E:return Xl(p,re,P);case L:return Ql(p)}}function sc(p,A){return A=A??s,!!A&&(typeof p=="number"||j.test(p))&&p>-1&&p%1==0&&p<A}function ac(p){var A=typeof p;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?p!=="__proto__":p===null}function ic(p){return!!xn&&xn in p}function lo(p){var A=p&&p.constructor,P=typeof A=="function"&&A.prototype||Ft;return p===P}function En(p){if(p!=null){try{return Wt.call(p)}catch{}try{return p+""}catch{}}return""}function co(p){return Xs(p,!0,!0)}function fo(p,A){return p===A||p!==p&&A!==A}function Fa(p){return uc(p)&&Ut.call(p,"callee")&&(!Ht.call(p,"callee")||Z.call(p)==a)}var $i=Array.isArray;function Ua(p){return p!=null&&po(p.length)&&!Yi(p)}function uc(p){return mo(p)&&Ua(p)}var ho=gn||lc;function Yi(p){var A=kr(p)?Z.call(p):"";return A==h||A==g}function po(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=s}function kr(p){var A=typeof p;return!!p&&(A=="object"||A=="function")}function mo(p){return!!p&&typeof p=="object"}function zi(p){return Ua(p)?et(p):Vl(p)}function oc(){return[]}function lc(){return!1}t.exports=co})(au,au.exports)),au.exports}var iu={exports:{}};iu.exports;var v1;function ub(){return v1||(v1=1,(function(t,e){var n=200,r="__lodash_hash_undefined__",s=1,a=2,i=9007199254740991,u="[object Arguments]",o="[object Array]",f="[object AsyncFunction]",h="[object Boolean]",g="[object Date]",d="[object Error]",m="[object Function]",b="[object GeneratorFunction]",_="[object Map]",T="[object Number]",E="[object Null]",O="[object Object]",L="[object Promise]",B="[object Proxy]",I="[object RegExp]",H="[object Set]",R="[object String]",q="[object Symbol]",Q="[object Undefined]",Y="[object WeakMap]",v="[object ArrayBuffer]",M="[object DataView]",S="[object Float32Array]",U="[object Float64Array]",F="[object Int8Array]",k="[object Int16Array]",V="[object Int32Array]",z="[object Uint8Array]",j="[object Uint8ClampedArray]",X="[object Uint16Array]",J="[object Uint32Array]",ne=/[\\^$.*+?()[\]{}|]/g,le=/^\[object .+?Constructor\]$/,be=/^(?:0|[1-9]\d*)$/,pe={};pe[S]=pe[U]=pe[F]=pe[k]=pe[V]=pe[z]=pe[j]=pe[X]=pe[J]=!0,pe[u]=pe[o]=pe[v]=pe[h]=pe[M]=pe[g]=pe[d]=pe[m]=pe[_]=pe[T]=pe[O]=pe[I]=pe[H]=pe[R]=pe[Y]=!1;var Re=typeof Rs=="object"&&Rs&&Rs.Object===Object&&Rs,ue=typeof self=="object"&&self&&self.Object===Object&&self,me=Re||ue||Function("return this")(),Ne=e&&!e.nodeType&&e,_e=Ne&&!0&&t&&!t.nodeType&&t,ye=_e&&_e.exports===Ne,Ie=ye&&Re.process,Ue=(function(){try{return Ie&&Ie.binding&&Ie.binding("util")}catch{}})(),We=Ue&&Ue.isTypedArray;function Ge(p,A){for(var P=-1,re=p==null?0:p.length,ze=0,xe=[];++P<re;){var ut=p[P];A(ut,P,p)&&(xe[ze++]=ut)}return xe}function zt(p,A){for(var P=-1,re=A.length,ze=p.length;++P<re;)p[ze+P]=A[P];return p}function Ke(p,A){for(var P=-1,re=p==null?0:p.length;++P<re;)if(A(p[P],P,p))return!0;return!1}function Bt(p,A){for(var P=-1,re=Array(p);++P<p;)re[P]=A(P);return re}function Qt(p){return function(A){return p(A)}}function Ft(p,A){return p.has(A)}function Zt(p,A){return p==null?void 0:p[A]}function xn(p){var A=-1,P=Array(p.size);return p.forEach(function(re,ze){P[++A]=[ze,re]}),P}function Wt(p,A){return function(P){return p(A(P))}}function Ut(p){var A=-1,P=Array(p.size);return p.forEach(function(re){P[++A]=re}),P}var Z=Array.prototype,Te=Function.prototype,Ce=Object.prototype,ke=me["__core-js_shared__"],Xe=Te.toString,Me=Ce.hasOwnProperty,gt=(function(){var p=/[^.]+$/.exec(ke&&ke.keys&&ke.keys.IE_PROTO||"");return p?"Symbol(src)_1."+p:""})(),Ht=Ce.toString,Dn=RegExp("^"+Xe.call(Me).replace(ne,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mn=ye?me.Buffer:void 0,gn=me.Symbol,kn=me.Uint8Array,Rr=Ce.propertyIsEnumerable,ur=Z.splice,bn=gn?gn.toStringTag:void 0,xr=Object.getOwnPropertySymbols,Zr=mn?mn.isBuffer:void 0,jn=Wt(Object.keys,Object),ve=Jr(me,"DataView"),He=Jr(me,"Map"),Je=Jr(me,"Promise"),Qe=Jr(me,"Set"),ce=Jr(me,"WeakMap"),It=Jr(Object,"create"),$e=En(ve),Ye=En(He),_t=En(Je),Jt=En(Qe),Pn=En(ce),Lt=gn?gn.prototype:void 0,Ot=Lt?Lt.valueOf:void 0;function ot(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Gt(){this.__data__=It?It(null):{},this.size=0}function qt(p){var A=this.has(p)&&delete this.__data__[p];return this.size-=A?1:0,A}function Ct(p){var A=this.__data__;if(It){var P=A[p];return P===r?void 0:P}return Me.call(A,p)?A[p]:void 0}function or(p){var A=this.__data__;return It?A[p]!==void 0:Me.call(A,p)}function yn(p,A){var P=this.__data__;return this.size+=this.has(p)?0:1,P[p]=It&&A===void 0?r:A,this}ot.prototype.clear=Gt,ot.prototype.delete=qt,ot.prototype.get=Ct,ot.prototype.has=or,ot.prototype.set=yn;function kt(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Ks(){this.__data__=[],this.size=0}function Vs(p){var A=this.__data__,P=Ba(A,p);if(P<0)return!1;var re=A.length-1;return P==re?A.pop():ur.call(A,P,1),--this.size,!0}function Pi(p){var A=this.__data__,P=Ba(A,p);return P<0?void 0:A[P][1]}function Mi(p){return Ba(this.__data__,p)>-1}function Bi(p,A){var P=this.__data__,re=Ba(P,p);return re<0?(++this.size,P.push([p,A])):P[re][1]=A,this}kt.prototype.clear=Ks,kt.prototype.delete=Vs,kt.prototype.get=Pi,kt.prototype.has=Mi,kt.prototype.set=Bi;function en(p){var A=-1,P=p==null?0:p.length;for(this.clear();++A<P;){var re=p[A];this.set(re[0],re[1])}}function Fi(){this.size=0,this.__data__={hash:new ot,map:new(He||kt),string:new ot}}function Ui(p){var A=lr(this,p).delete(p);return this.size-=A?1:0,A}function Hi(p){return lr(this,p).get(p)}function Pe(p){return lr(this,p).has(p)}function Le(p,A){var P=lr(this,p),re=P.size;return P.set(p,A),this.size+=P.size==re?0:1,this}en.prototype.clear=Fi,en.prototype.delete=Ui,en.prototype.get=Hi,en.prototype.has=Pe,en.prototype.set=Le;function et(p){var A=-1,P=p==null?0:p.length;for(this.__data__=new en;++A<P;)this.add(p[A])}function jt(p){return this.__data__.set(p,r),this}function gs(p){return this.__data__.has(p)}et.prototype.add=et.prototype.push=jt,et.prototype.has=gs;function $n(p){var A=this.__data__=new kt(p);this.size=A.size}function Xs(){this.__data__=new kt,this.size=0}function zl(p){var A=this.__data__,P=A.delete(p);return this.size=A.size,P}function Wl(p){return this.__data__.get(p)}function Gl(p){return this.__data__.has(p)}function Kl(p,A){var P=this.__data__;if(P instanceof kt){var re=P.__data__;if(!He||re.length<n-1)return re.push([p,A]),this.size=++P.size,this;P=this.__data__=new en(re)}return P.set(p,A),this.size=P.size,this}$n.prototype.clear=Xs,$n.prototype.delete=zl,$n.prototype.get=Wl,$n.prototype.has=Gl,$n.prototype.set=Kl;function Vl(p,A){var P=Fa(p),re=!P&&fo(p),ze=!P&&!re&&Ua(p),xe=!P&&!re&&!ze&&mo(p),ut=P||re||ze||xe,st=ut?Bt(p.length,String):[],Pt=st.length;for(var dt in p)Me.call(p,dt)&&!(ut&&(dt=="length"||ze&&(dt=="offset"||dt=="parent")||xe&&(dt=="buffer"||dt=="byteLength"||dt=="byteOffset")||rc(dt,Pt)))&&st.push(dt);return st}function Ba(p,A){for(var P=p.length;P--;)if(co(p[P][0],A))return P;return-1}function qi(p,A,P){var re=A(p);return Fa(p)?re:zt(re,P(p))}function Qs(p){return p==null?p===void 0?Q:E:bn&&bn in Object(p)?es(p):lo(p)}function uo(p){return kr(p)&&Qs(p)==u}function oo(p,A,P,re,ze){return p===A?!0:p==null||A==null||!kr(p)&&!kr(A)?p!==p&&A!==A:Xl(p,A,P,re,oo,ze)}function Xl(p,A,P,re,ze,xe){var ut=Fa(p),st=Fa(A),Pt=ut?o:Dr(p),dt=st?o:Dr(A);Pt=Pt==u?O:Pt,dt=dt==u?O:dt;var ln=Pt==O,Nn=dt==O,$t=Pt==dt;if($t&&Ua(p)){if(!Ua(A))return!1;ut=!0,ln=!1}if($t&&!ln)return xe||(xe=new $n),ut||mo(p)?ji(p,A,P,re,ze,xe):ec(p,A,Pt,P,re,ze,xe);if(!(P&s)){var cn=ln&&Me.call(p,"__wrapped__"),tn=Nn&&Me.call(A,"__wrapped__");if(cn||tn){var bs=cn?p.value():p,ts=tn?A.value():A;return xe||(xe=new $n),ze(bs,ts,P,re,xe)}}return $t?(xe||(xe=new $n),tc(p,A,P,re,ze,xe)):!1}function Ql(p){if(!po(p)||ac(p))return!1;var A=ho(p)?Dn:le;return A.test(En(p))}function Zl(p){return kr(p)&&Yi(p.length)&&!!pe[Qs(p)]}function Jl(p){if(!ic(p))return jn(p);var A=[];for(var P in Object(p))Me.call(p,P)&&P!="constructor"&&A.push(P);return A}function ji(p,A,P,re,ze,xe){var ut=P&s,st=p.length,Pt=A.length;if(st!=Pt&&!(ut&&Pt>st))return!1;var dt=xe.get(p);if(dt&&xe.get(A))return dt==A;var ln=-1,Nn=!0,$t=P&a?new et:void 0;for(xe.set(p,A),xe.set(A,p);++ln<st;){var cn=p[ln],tn=A[ln];if(re)var bs=ut?re(tn,cn,ln,A,p,xe):re(cn,tn,ln,p,A,xe);if(bs!==void 0){if(bs)continue;Nn=!1;break}if($t){if(!Ke(A,function(ts,Js){if(!Ft($t,Js)&&(cn===ts||ze(cn,ts,P,re,xe)))return $t.push(Js)})){Nn=!1;break}}else if(!(cn===tn||ze(cn,tn,P,re,xe))){Nn=!1;break}}return xe.delete(p),xe.delete(A),Nn}function ec(p,A,P,re,ze,xe,ut){switch(P){case M:if(p.byteLength!=A.byteLength||p.byteOffset!=A.byteOffset)return!1;p=p.buffer,A=A.buffer;case v:return!(p.byteLength!=A.byteLength||!xe(new kn(p),new kn(A)));case h:case g:case T:return co(+p,+A);case d:return p.name==A.name&&p.message==A.message;case I:case R:return p==A+"";case _:var st=xn;case H:var Pt=re&s;if(st||(st=Ut),p.size!=A.size&&!Pt)return!1;var dt=ut.get(p);if(dt)return dt==A;re|=a,ut.set(p,A);var ln=ji(st(p),st(A),re,ze,xe,ut);return ut.delete(p),ln;case q:if(Ot)return Ot.call(p)==Ot.call(A)}return!1}function tc(p,A,P,re,ze,xe){var ut=P&s,st=Zs(p),Pt=st.length,dt=Zs(A),ln=dt.length;if(Pt!=ln&&!ut)return!1;for(var Nn=Pt;Nn--;){var $t=st[Nn];if(!(ut?$t in A:Me.call(A,$t)))return!1}var cn=xe.get(p);if(cn&&xe.get(A))return cn==A;var tn=!0;xe.set(p,A),xe.set(A,p);for(var bs=ut;++Nn<Pt;){$t=st[Nn];var ts=p[$t],Js=A[$t];if(re)var Ph=ut?re(Js,ts,$t,A,p,xe):re(ts,Js,$t,p,A,xe);if(!(Ph===void 0?ts===Js||ze(ts,Js,P,re,xe):Ph)){tn=!1;break}bs||(bs=$t=="constructor")}if(tn&&!bs){var go=p.constructor,bo=A.constructor;go!=bo&&"constructor"in p&&"constructor"in A&&!(typeof go=="function"&&go instanceof go&&typeof bo=="function"&&bo instanceof bo)&&(tn=!1)}return xe.delete(p),xe.delete(A),tn}function Zs(p){return qi(p,zi,nc)}function lr(p,A){var P=p.__data__;return sc(A)?P[typeof A=="string"?"string":"hash"]:P.map}function Jr(p,A){var P=Zt(p,A);return Ql(P)?P:void 0}function es(p){var A=Me.call(p,bn),P=p[bn];try{p[bn]=void 0;var re=!0}catch{}var ze=Ht.call(p);return re&&(A?p[bn]=P:delete p[bn]),ze}var nc=xr?function(p){return p==null?[]:(p=Object(p),Ge(xr(p),function(A){return Rr.call(p,A)}))}:oc,Dr=Qs;(ve&&Dr(new ve(new ArrayBuffer(1)))!=M||He&&Dr(new He)!=_||Je&&Dr(Je.resolve())!=L||Qe&&Dr(new Qe)!=H||ce&&Dr(new ce)!=Y)&&(Dr=function(p){var A=Qs(p),P=A==O?p.constructor:void 0,re=P?En(P):"";if(re)switch(re){case $e:return M;case Ye:return _;case _t:return L;case Jt:return H;case Pn:return Y}return A});function rc(p,A){return A=A??i,!!A&&(typeof p=="number"||be.test(p))&&p>-1&&p%1==0&&p<A}function sc(p){var A=typeof p;return A=="string"||A=="number"||A=="symbol"||A=="boolean"?p!=="__proto__":p===null}function ac(p){return!!gt&&gt in p}function ic(p){var A=p&&p.constructor,P=typeof A=="function"&&A.prototype||Ce;return p===P}function lo(p){return Ht.call(p)}function En(p){if(p!=null){try{return Xe.call(p)}catch{}try{return p+""}catch{}}return""}function co(p,A){return p===A||p!==p&&A!==A}var fo=uo((function(){return arguments})())?uo:function(p){return kr(p)&&Me.call(p,"callee")&&!Rr.call(p,"callee")},Fa=Array.isArray;function $i(p){return p!=null&&Yi(p.length)&&!ho(p)}var Ua=Zr||lc;function uc(p,A){return oo(p,A)}function ho(p){if(!po(p))return!1;var A=Qs(p);return A==m||A==b||A==f||A==B}function Yi(p){return typeof p=="number"&&p>-1&&p%1==0&&p<=i}function po(p){var A=typeof p;return p!=null&&(A=="object"||A=="function")}function kr(p){return p!=null&&typeof p=="object"}var mo=We?Qt(We):Zl;function zi(p){return $i(p)?Vl(p):Jl(p)}function oc(){return[]}function lc(){return!1}t.exports=uc})(iu,iu.exports)),iu.exports}var Lo={},T1;function $4(){if(T1)return Lo;T1=1,Object.defineProperty(Lo,"__esModule",{value:!0});const t=ib(),e=ub();var n;return(function(r){function s(o={},f={},h=!1){typeof o!="object"&&(o={}),typeof f!="object"&&(f={});let g=t(f);h||(g=Object.keys(g).reduce((d,m)=>(g[m]!=null&&(d[m]=g[m]),d),{}));for(const d in o)o[d]!==void 0&&f[d]===void 0&&(g[d]=o[d]);return Object.keys(g).length>0?g:void 0}r.compose=s;function a(o={},f={}){typeof o!="object"&&(o={}),typeof f!="object"&&(f={});const h=Object.keys(o).concat(Object.keys(f)).reduce((g,d)=>(e(o[d],f[d])||(g[d]=f[d]===void 0?null:f[d]),g),{});return Object.keys(h).length>0?h:void 0}r.diff=a;function i(o={},f={}){o=o||{};const h=Object.keys(f).reduce((g,d)=>(f[d]!==o[d]&&o[d]!==void 0&&(g[d]=f[d]),g),{});return Object.keys(o).reduce((g,d)=>(o[d]!==f[d]&&f[d]===void 0&&(g[d]=null),g),h)}r.invert=i;function u(o,f,h=!1){if(typeof o!="object")return f;if(typeof f!="object")return;if(!h)return f;const g=Object.keys(f).reduce((d,m)=>(o[m]===void 0&&(d[m]=f[m]),d),{});return Object.keys(g).length>0?g:void 0}r.transform=u})(n||(n={})),Lo.default=n,Lo}var Oo={},_1;function ob(){if(_1)return Oo;_1=1,Object.defineProperty(Oo,"__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={})),Oo.default=t,Oo}var Ro={},A1;function Y4(){if(A1)return Ro;A1=1,Object.defineProperty(Ro,"__esModule",{value:!0});const t=ob();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 u={};return s.attributes&&(u.attributes=s.attributes),typeof s.retain=="number"?u.retain=r:typeof s.retain=="object"&&s.retain!==null?u.retain=s.retain:typeof s.insert=="string"?u.insert=s.insert.substr(a,r):u.insert=s.insert,u}}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 Ro.default=e,Ro}var y1;function z4(){return y1||(y1=1,(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.AttributeMap=e.OpIterator=e.Op=void 0;const n=j4(),r=ib(),s=ub(),a=$4();e.AttributeMap=a.default;const i=ob();e.Op=i.default;const u=Y4();e.OpIterator=u.default;const o="\0",f=(g,d)=>{if(typeof g!="object"||g===null)throw new Error(`cannot retain a ${typeof g}`);if(typeof d!="object"||d===null)throw new Error(`cannot retain a ${typeof d}`);const m=Object.keys(g)[0];if(!m||m!==Object.keys(d)[0])throw new Error(`embed types not matched: ${m} != ${Object.keys(d)[0]}`);return[m,g[m],d[m]]};class h{constructor(d){Array.isArray(d)?this.ops=d:d!=null&&Array.isArray(d.ops)?this.ops=d.ops:this.ops=[]}static registerEmbed(d,m){this.handlers[d]=m}static unregisterEmbed(d){delete this.handlers[d]}static getHandler(d){const m=this.handlers[d];if(!m)throw new Error(`no handlers for embed type "${d}"`);return m}insert(d,m){const b={};return typeof d=="string"&&d.length===0?this:(b.insert=d,m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b))}delete(d){return d<=0?this:this.push({delete:d})}retain(d,m){if(typeof d=="number"&&d<=0)return this;const b={retain:d};return m!=null&&typeof m=="object"&&Object.keys(m).length>0&&(b.attributes=m),this.push(b)}push(d){let m=this.ops.length,b=this.ops[m-1];if(d=r(d),typeof b=="object"){if(typeof d.delete=="number"&&typeof b.delete=="number")return this.ops[m-1]={delete:b.delete+d.delete},this;if(typeof b.delete=="number"&&d.insert!=null&&(m-=1,b=this.ops[m-1],typeof b!="object"))return this.ops.unshift(d),this;if(s(d.attributes,b.attributes)){if(typeof d.insert=="string"&&typeof b.insert=="string")return this.ops[m-1]={insert:b.insert+d.insert},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this;if(typeof d.retain=="number"&&typeof b.retain=="number")return this.ops[m-1]={retain:b.retain+d.retain},typeof d.attributes=="object"&&(this.ops[m-1].attributes=d.attributes),this}}return m===this.ops.length?this.ops.push(d):this.ops.splice(m,0,d),this}chop(){const d=this.ops[this.ops.length-1];return d&&typeof d.retain=="number"&&!d.attributes&&this.ops.pop(),this}filter(d){return this.ops.filter(d)}forEach(d){this.ops.forEach(d)}map(d){return this.ops.map(d)}partition(d){const m=[],b=[];return this.forEach(_=>{(d(_)?m:b).push(_)}),[m,b]}reduce(d,m){return this.ops.reduce(d,m)}changeLength(){return this.reduce((d,m)=>m.insert?d+i.default.length(m):m.delete?d-m.delete:d,0)}length(){return this.reduce((d,m)=>d+i.default.length(m),0)}slice(d=0,m=1/0){const b=[],_=new u.default(this.ops);let T=0;for(;T<m&&_.hasNext();){let E;T<d?E=_.next(d-T):(E=_.next(m-T),b.push(E)),T+=i.default.length(E)}return new h(b)}compose(d){const m=new u.default(this.ops),b=new u.default(d.ops),_=[],T=b.peek();if(T!=null&&typeof T.retain=="number"&&T.attributes==null){let O=T.retain;for(;m.peekType()==="insert"&&m.peekLength()<=O;)O-=m.peekLength(),_.push(m.next());T.retain-O>0&&b.next(T.retain-O)}const E=new h(_);for(;m.hasNext()||b.hasNext();)if(b.peekType()==="insert")E.push(b.next());else if(m.peekType()==="delete")E.push(m.next());else{const O=Math.min(m.peekLength(),b.peekLength()),L=m.next(O),B=b.next(O);if(B.retain){const I={};if(typeof L.retain=="number")I.retain=typeof B.retain=="number"?O:B.retain;else if(typeof B.retain=="number")L.retain==null?I.insert=L.insert:I.retain=L.retain;else{const R=L.retain==null?"insert":"retain",[q,Q,Y]=f(L[R],B.retain),v=h.getHandler(q);I[R]={[q]:v.compose(Q,Y,R==="retain")}}const H=a.default.compose(L.attributes,B.attributes,typeof L.retain=="number");if(H&&(I.attributes=H),E.push(I),!b.hasNext()&&s(E.ops[E.ops.length-1],I)){const R=new h(m.rest());return E.concat(R).chop()}}else typeof B.delete=="number"&&(typeof L.retain=="number"||typeof L.retain=="object"&&L.retain!==null)&&E.push(B)}return E.chop()}concat(d){const m=new h(this.ops.slice());return d.ops.length>0&&(m.push(d.ops[0]),m.ops=m.ops.concat(d.ops.slice(1))),m}diff(d,m){if(this.ops===d.ops)return new h;const b=[this,d].map(L=>L.map(B=>{if(B.insert!=null)return typeof B.insert=="string"?B.insert:o;const I=L===d?"on":"with";throw new Error("diff() called "+I+" non-document")}).join("")),_=new h,T=n(b[0],b[1],m,!0),E=new u.default(this.ops),O=new u.default(d.ops);return T.forEach(L=>{let B=L[1].length;for(;B>0;){let I=0;switch(L[0]){case n.INSERT:I=Math.min(O.peekLength(),B),_.push(O.next(I));break;case n.DELETE:I=Math.min(B,E.peekLength()),E.next(I),_.delete(I);break;case n.EQUAL:I=Math.min(E.peekLength(),O.peekLength(),B);const H=E.next(I),R=O.next(I);s(H.insert,R.insert)?_.retain(I,a.default.diff(H.attributes,R.attributes)):_.push(R).delete(I);break}B-=I}}),_.chop()}eachLine(d,m=`
67
- `){const b=new u.default(this.ops);let _=new h,T=0;for(;b.hasNext();){if(b.peekType()!=="insert")return;const E=b.peek(),O=i.default.length(E)-b.peekLength(),L=typeof E.insert=="string"?E.insert.indexOf(m,O)-O:-1;if(L<0)_.push(b.next());else if(L>0)_.push(b.next(L));else{if(d(_,b.next(1).attributes||{},T)===!1)return;T+=1,_=new h}}_.length()>0&&d(_,{},T)}invert(d){const m=new h;return this.reduce((b,_)=>{if(_.insert)m.delete(i.default.length(_));else{if(typeof _.retain=="number"&&_.attributes==null)return m.retain(_.retain),b+_.retain;if(_.delete||typeof _.retain=="number"){const T=_.delete||_.retain;return d.slice(b,b+T).forEach(O=>{_.delete?m.push(O):_.retain&&_.attributes&&m.retain(i.default.length(O),a.default.invert(_.attributes,O.attributes))}),b+T}else if(typeof _.retain=="object"&&_.retain!==null){const T=d.slice(b,b+1),E=new u.default(T.ops).next(),[O,L,B]=f(_.retain,E.insert),I=h.getHandler(O);return m.retain({[O]:I.invert(L,B)},a.default.invert(_.attributes,E.attributes)),b+1}}return b},0),m.chop()}transform(d,m=!1){if(m=!!m,typeof d=="number")return this.transformPosition(d,m);const b=d,_=new u.default(this.ops),T=new u.default(b.ops),E=new h;for(;_.hasNext()||T.hasNext();)if(_.peekType()==="insert"&&(m||T.peekType()!=="insert"))E.retain(i.default.length(_.next()));else if(T.peekType()==="insert")E.push(T.next());else{const O=Math.min(_.peekLength(),T.peekLength()),L=_.next(O),B=T.next(O);if(L.delete)continue;if(B.delete)E.push(B);else{const I=L.retain,H=B.retain;let R=typeof H=="object"&&H!==null?H:O;if(typeof I=="object"&&I!==null&&typeof H=="object"&&H!==null){const q=Object.keys(I)[0];if(q===Object.keys(H)[0]){const Q=h.getHandler(q);Q&&(R={[q]:Q.transform(I[q],H[q],m)})}}E.retain(R,a.default.transform(L.attributes,B.attributes,m))}}return E.chop()}transformPosition(d,m=!1){m=!!m;const b=new u.default(this.ops);let _=0;for(;b.hasNext()&&_<=d;){const T=b.peekLength(),E=b.peekType();if(b.next(),E==="delete"){d-=Math.min(T,d-_);continue}else E==="insert"&&(_<d||!m)&&(d+=T);_+=T}return d}}h.Op=i.default,h.OpIterator=u.default,h.AttributeMap=a.default,h.handlers={},e.default=h,t.exports=h,t.exports.default=h})(wo,wo.exports)),wo.exports}var tr=z4();const we=ab(tr);class Lr extends qn{static value(){}optimize(){(this.prev||this.next)&&this.remove()}length(){return 0}value(){return""}}Lr.blotName="break";Lr.tagName="BR";let yr=class extends gl{};const W4={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function jl(t){return t.replace(/[&<>"']/g,e=>W4[e])}const Pr=class Pr extends Ah{static compare(e,n){const r=Pr.order.indexOf(e),s=Pr.order.indexOf(n);return r>=0||s>=0?r-s:e===n?0:e<n?-1:1}formatAt(e,n,r,s){if(Pr.compare(this.statics.blotName,r)<0&&this.scroll.query(r,Oe.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 Pr&&Pr.compare(this.statics.blotName,this.parent.statics.blotName)>0){const n=this.parent.isolate(this.offset(),this.length());this.moveChildren(n),n.wrap(this)}}};Ee(Pr,"allowedChildren",[Pr,Lr,qn,yr]),Ee(Pr,"order",["cursor","inline","link","underline","strike","italic","bold","script","code"]);let Xr=Pr;const N1=1;class an extends ku{constructor(){super(...arguments);Ee(this,"cache",{})}delta(){return this.cache.delta==null&&(this.cache.delta=lb(this)),this.cache.delta}deleteAt(n,r){super.deleteAt(n,r),this.cache={}}formatAt(n,r,s,a){r<=0||(this.scroll.query(s,Oe.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(`
68
- `),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 u=this;a.reduce((o,f)=>(u=u.split(o,!0),u.insertAt(0,f),f.length),n+i.length)}insertBefore(n,r){const{head:s}=this.children;super.insertBefore(n,r),s instanceof Lr&&s.remove(),this.cache={}}length(){return this.cache.length==null&&(this.cache.length=super.length()+N1),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()-N1)){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}}an.blotName="block";an.tagName="P";an.defaultChild=Lr;an.allowedChildren=[Lr,Xr,qn,yr];class er extends qn{attach(){super.attach(),this.attributes=new Hl(this.domNode)}delta(){return new we().insert(this.value(),{...this.formats(),...this.attributes.values()})}format(e,n){const r=this.scroll.query(e,Oe.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(`
69
- `),a=s.pop(),i=s.map(o=>{const f=this.scroll.create(an.blotName);return f.insertAt(0,o),f}),u=this.split(e);i.forEach(o=>{this.parent.insertBefore(o,u)}),a&&this.parent.insertBefore(this.scroll.create("text",a),u)}}er.scope=Oe.BLOCK_BLOT;function lb(t){let e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0;return t.descendants(dn).reduce((n,r)=>r.length()===0?n:n.insert(r.value(),Qn(r,{},e)),new we).insert(`
70
- `,Qn(t))}function Qn(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:Qn(t.parent,e,n)}const zn=class zn extends qn{static value(){}constructor(e,n,r){super(e,n),this.selection=r,this.textNode=document.createTextNode(zn.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!==Oe.BLOCK_BLOT;)s+=r.offset(r.parent),r=r.parent;r!=null&&(this.savedLength=zn.CONTENTS.length,r.optimize(),r.formatAt(s,zn.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 yr?this.prev:null,r=n?n.length():0,s=this.next instanceof yr?this.next:null,a=s?s.text:"",{textNode:i}=this,u=i.data.split(zn.CONTENTS).join("");i.data=zn.CONTENTS;let o;if(n)o=n,(u||s)&&(n.insertAt(n.length(),u+a),s&&s.remove());else if(s)o=s,s.insertAt(0,u);else{const f=document.createTextNode(u);o=this.scroll.create(f),this.parent.insertBefore(o,this)}if(this.remove(),e){const f=(d,m)=>n&&d===n.domNode?m:d===i?r+m-1:s&&d===s.domNode?r+u.length+m:null,h=f(e.start.node,e.start.offset),g=f(e.end.node,e.end.offset);if(h!==null&&g!==null)return{startNode:o.domNode,startOffset:h,endNode:o.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=zn.CONTENTS.length,n.isolate(this.offset(n),this.length()).unwrap(),this.savedLength=0;break}n=n.parent}}value(){return""}};Ee(zn,"blotName","cursor"),Ee(zn,"className","ql-cursor"),Ee(zn,"tagName","span"),Ee(zn,"CONTENTS","\uFEFF");let Ci=zn;var Pc={exports:{}},S1;function G4(){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(o,f,h){this.fn=o,this.context=f,this.once=h||!1}function a(o,f,h,g,d){if(typeof h!="function")throw new TypeError("The listener must be a function");var m=new s(h,g||o,d),b=n?n+f:f;return o._events[b]?o._events[b].fn?o._events[b]=[o._events[b],m]:o._events[b].push(m):(o._events[b]=m,o._eventsCount++),o}function i(o,f){--o._eventsCount===0?o._events=new r:delete o._events[f]}function u(){this._events=new r,this._eventsCount=0}u.prototype.eventNames=function(){var f=[],h,g;if(this._eventsCount===0)return f;for(g in h=this._events)e.call(h,g)&&f.push(n?g.slice(1):g);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(h)):f},u.prototype.listeners=function(f){var h=n?n+f:f,g=this._events[h];if(!g)return[];if(g.fn)return[g.fn];for(var d=0,m=g.length,b=new Array(m);d<m;d++)b[d]=g[d].fn;return b},u.prototype.listenerCount=function(f){var h=n?n+f:f,g=this._events[h];return g?g.fn?1:g.length:0},u.prototype.emit=function(f,h,g,d,m,b){var _=n?n+f:f;if(!this._events[_])return!1;var T=this._events[_],E=arguments.length,O,L;if(T.fn){switch(T.once&&this.removeListener(f,T.fn,void 0,!0),E){case 1:return T.fn.call(T.context),!0;case 2:return T.fn.call(T.context,h),!0;case 3:return T.fn.call(T.context,h,g),!0;case 4:return T.fn.call(T.context,h,g,d),!0;case 5:return T.fn.call(T.context,h,g,d,m),!0;case 6:return T.fn.call(T.context,h,g,d,m,b),!0}for(L=1,O=new Array(E-1);L<E;L++)O[L-1]=arguments[L];T.fn.apply(T.context,O)}else{var B=T.length,I;for(L=0;L<B;L++)switch(T[L].once&&this.removeListener(f,T[L].fn,void 0,!0),E){case 1:T[L].fn.call(T[L].context);break;case 2:T[L].fn.call(T[L].context,h);break;case 3:T[L].fn.call(T[L].context,h,g);break;case 4:T[L].fn.call(T[L].context,h,g,d);break;default:if(!O)for(I=1,O=new Array(E-1);I<E;I++)O[I-1]=arguments[I];T[L].fn.apply(T[L].context,O)}}return!0},u.prototype.on=function(f,h,g){return a(this,f,h,g,!1)},u.prototype.once=function(f,h,g){return a(this,f,h,g,!0)},u.prototype.removeListener=function(f,h,g,d){var m=n?n+f:f;if(!this._events[m])return this;if(!h)return i(this,m),this;var b=this._events[m];if(b.fn)b.fn===h&&(!d||b.once)&&(!g||b.context===g)&&i(this,m);else{for(var _=0,T=[],E=b.length;_<E;_++)(b[_].fn!==h||d&&!b[_].once||g&&b[_].context!==g)&&T.push(b[_]);T.length?this._events[m]=T.length===1?T[0]:T:i(this,m)}return this},u.prototype.removeAllListeners=function(f){var h;return f?(h=n?n+f:f,this._events[h]&&i(this,h)):(this._events=new r,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,t.exports=u})(Pc)),Pc.exports}var K4=G4();const V4=ab(K4),ud=new WeakMap,od=["error","warn","log","info"];let ld="warn";function cb(t){if(ld&&od.indexOf(t)<=od.indexOf(ld)){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 ms(t){return od.reduce((e,n)=>(e[n]=cb.bind(console,n,t),e),{})}ms.level=t=>{ld=t};cb.level=ms.level;const Mc=ms("quill:events"),X4=["selectionchange","mousedown","mouseup","click"];X4.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=ud.get(s);a&&a.emitter&&a.emitter.handleDOM(...n)})})});class Se extends V4{constructor(){super(),this.domListeners={},this.on("error",Mc.error)}emit(){for(var e=arguments.length,n=new Array(e),r=0;r<e;r++)n[r]=arguments[r];return Mc.log.call(Mc,...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:u}=a;(e.target===i||i.contains(e.target))&&u(e,...r)})}listenDOM(e,n,r){this.domListeners[e]||(this.domListeners[e]=[]),this.domListeners[e].push({node:n,handler:r})}}Ee(Se,"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"}),Ee(Se,"sources",{API:"api",SILENT:"silent",USER:"user"});const Bc=ms("quill:selection");class Na{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;this.index=e,this.length=n}}class Q4{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 Na(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,Se.sources.USER),1)}),this.emitter.on(Se.events.SCROLL_BEFORE_UPDATE,()=>{if(!this.hasFocus())return;const r=this.getNativeRange();r!=null&&r.start.node!==this.cursor.textNode&&this.emitter.once(Se.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(u=>u.type==="characterData"||u.type==="childList"||u.type==="attributes"&&u.target===this.root);this.update(i?Se.sources.SILENT:s)}catch{}})}),this.emitter.on(Se.events.SCROLL_OPTIMIZE,(r,s)=>{if(s.range){const{startNode:a,startOffset:i,endNode:u,endOffset:o}=s.range;this.setNativeRange(a,i,u,o),this.update(Se.sources.SILENT)}}),this.update(Se.sources.SILENT)}handleComposition(){this.emitter.on(Se.events.COMPOSITION_BEFORE_START,()=>{this.composing=!0}),this.emitter.on(Se.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(Se.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,Oe.BLOCK))){if(r.start.node!==this.cursor.textNode){const s=this.scroll.find(r.start.node,!1);if(s==null)return;if(s instanceof dn){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),[d]=this.scroll.line(e+1);g===d&&(a=h,i=0)}}[s,i]=a.position(i,!0);const u=document.createRange();if(n>0)return u.setStart(s,i),[a,i]=this.scroll.leaf(e+n),a==null?null:([s,i]=a.position(i,!0),u.setEnd(s,i),u.getBoundingClientRect());let o="left",f;if(s instanceof Text){if(!s.data.length)return null;i<s.data.length?(u.setStart(s,i),u.setEnd(s,i+1)):(u.setStart(s,i-1),u.setEnd(s,i),o="right"),f=u.getBoundingClientRect()}else{if(!(a.domNode instanceof Element))return null;f=a.domNode.getBoundingClientRect(),i>0&&(o="right")}return{bottom:f.top+f.height,height:f.height,left:f[o],right:f[o],top:f.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 Bc.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&&Fc(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[u,o]=i,f=this.scroll.find(u,!0),h=f.offset(this.scroll);return o===0?h:f instanceof dn?h+f.index(u,o):h+f.length()}),s=Math.min(Math.max(...r),this.scroll.length()-1),a=Math.min(s,...r);return new Na(a,s-a)}normalizeNative(e){if(!Fc(this.root,e.startContainer)||!e.collapsed&&!Fc(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,u]=this.scroll.leaf(s);return i?i.position(u,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(Bc.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:u}=this.getNativeRange()||{};if(u==null||a||e!==u.startContainer||n!==u.startOffset||r!==u.endContainer||s!==u.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 o=document.createRange();o.setStart(e,n),o.setEnd(r,s),i.removeAllRanges(),i.addRange(o)}}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]:Se.sources.API;if(typeof n=="string"&&(r=n,n=!1),Bc.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]:Se.sources.USER;const n=this.lastRange,[r,s]=this.getRange();if(this.lastRange=r,this.lastNative=s,this.lastRange!=null&&(this.savedRange=this.lastRange),!_h(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=[Se.events.SELECTION_CHANGE,ti(this.lastRange),ti(n),e];this.emitter.emit(Se.events.EDITOR_CHANGE,...a),e!==Se.sources.SILENT&&this.emitter.emit(...a)}}}function Fc(t,e){try{e.parentNode}catch{return!1}return t.contains(e)}const Z4=/^[ -~]*$/;class J4{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 we;return tw(r.ops.slice()).reduce((i,u)=>{const o=tr.Op.length(u);let f=u.attributes||{},h=!1,g=!1;if(u.insert!=null){if(s.retain(o),typeof u.insert=="string"){const b=u.insert;g=!b.endsWith(`
71
- `)&&(n<=i||!!this.scroll.descendant(er,i)[0]),this.scroll.insertAt(i,b);const[_,T]=this.scroll.line(i);let E=Fs({},Qn(_));if(_ instanceof an){const[O]=_.descendant(dn,T);O&&(E=Fs(E,Qn(O)))}f=tr.AttributeMap.diff(E,f)||{}}else if(typeof u.insert=="object"){const b=Object.keys(u.insert)[0];if(b==null)return i;const _=this.scroll.query(b,Oe.INLINE)!=null;if(_)(n<=i||this.scroll.descendant(er,i)[0])&&(g=!0);else if(i>0){const[T,E]=this.scroll.descendant(dn,i-1);T instanceof yr?T.value()[E]!==`
72
- `&&(h=!0):T instanceof qn&&T.statics.scope===Oe.INLINE_BLOT&&(h=!0)}if(this.scroll.insertAt(i,b,u.insert[b]),_){const[T]=this.scroll.descendant(dn,i);if(T){const E=Fs({},Qn(T));f=tr.AttributeMap.diff(E,f)||{}}}}n+=o}else if(s.push(u),u.retain!==null&&typeof u.retain=="object"){const b=Object.keys(u.retain)[0];if(b==null)return i;this.scroll.updateEmbedAt(i,b,u.retain[b])}Object.keys(f).forEach(b=>{this.scroll.formatAt(i,o,b,f[b])});const d=h?1:0,m=g?1:0;return n+=d+m,s.retain(d),s.delete(m),i+o+d+m},0),s.reduce((i,u)=>typeof u.delete=="number"?(this.scroll.deleteAt(i,u.delete),i):i+tr.Op.length(u),0),this.scroll.batchEnd(),this.scroll.optimize(),this.update(r)}deleteText(e,n){return this.scroll.deleteAt(e,n),this.update(new we().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 we().retain(e).retain(n,ti(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 we().retain(e).retain(n,ti(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 we)}getFormat(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=[],s=[];n===0?this.scroll.path(e).forEach(u=>{const[o]=u;o instanceof an?r.push(o):o instanceof dn&&s.push(o)}):(r=this.scroll.lines(e,n),s=this.scroll.descendants(dn,e,n));const[a,i]=[r,s].map(u=>{const o=u.shift();if(o==null)return{};let f=Qn(o);for(;Object.keys(f).length>0;){const h=u.shift();if(h==null)return f;f=ew(Qn(h),f)}return f});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)?Pu(r,s,n,!0):Pu(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 we().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 we().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,`
73
- `).replace(/\r/g,`
74
- `),this.scroll.insertAt(e,n),Object.keys(r).forEach(s=>{this.scroll.formatAt(e,n.length,s,r[s])}),this.update(new we().retain(e).insert(n,ti(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)!==an.blotName)return!1;const n=e;return n.children.length>1?!1:n.children.head instanceof Lr}removeFormat(e,n){const r=this.getText(e,n),[s,a]=this.scroll.line(e+n);let i=0,u=new we;s!=null&&(i=s.length()-a,u=s.delta().slice(a,a+i-1).insert(`
75
- `));const f=this.getContents(e,n+i).diff(new we().insert(r).concat(u)),h=new we().retain(e).concat(f);return this.applyDelta(h)}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(Z4)&&this.scroll.find(n[0].target)){const a=this.scroll.find(n[0].target),i=Qn(a),u=a.offset(this.scroll),o=n[0].oldValue.replace(Ci.CONTENTS,""),f=new we().insert(o),h=new we().insert(a.value()),g=r&&{oldRange:C1(r.oldRange,-u),newRange:C1(r.newRange,-u)};e=new we().retain(u).concat(f.diff(h,g)).reduce((m,b)=>b.insert?m.insert(b.insert,i):m.push(b),new we),this.delta=s.compose(e)}else this.delta=this.getDelta(),(!e||!_h(s.compose(e),this.delta))&&(e=s.diff(this.delta,r));return e}}function Ka(t,e,n){if(t.length===0){const[m]=Uc(n.pop());return e<=0?`</li></${m}>`:`</li></${m}>${Ka([],e-1,n)}`}const[{child:r,offset:s,length:a,indent:i,type:u},...o]=t,[f,h]=Uc(u);if(i>e)return n.push(u),i===e+1?`<${f}><li${h}>${Pu(r,s,a)}${Ka(o,i,n)}`:`<${f}><li>${Ka(t,e+1,n)}`;const g=n[n.length-1];if(i===e&&u===g)return`</li><li${h}>${Pu(r,s,a)}${Ka(o,i,n)}`;const[d]=Uc(n.pop());return`</li></${d}>${Ka(t,e-1,n)}`}function Pu(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 yr)return jl(t.value().slice(e,e+n)).replaceAll(" ","&nbsp;");if(t instanceof _r){if(t.statics.blotName==="list-container"){const f=[];return t.children.forEachAt(e,n,(h,g,d)=>{const m="formats"in h&&typeof h.formats=="function"?h.formats():{};f.push({child:h,offset:g,length:d,indent:m.indent||0,type:m.list})}),Ka(f,-1,[])}const s=[];if(t.children.forEachAt(e,n,(f,h,g)=>{s.push(Pu(f,h,g))}),r||t.statics.blotName==="list")return s.join("");const{outerHTML:a,innerHTML:i}=t.domNode,[u,o]=a.split(`>${i}<`);return u==="<table"?`<table style="border: 1px solid #000;">${s.join("")}<${o}`:`${u}>${s.join("")}<${o}`}return t.domNode instanceof Element?t.domNode.outerHTML:""}function ew(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 Uc(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,`
76
- `).replace(/\r/g,`
77
- `);return e.insert(r,n.attributes)}return e.push(n)},new we)}function C1(t,e){let{index:n,length:r}=t;return new Na(n+e,r)}function tw(t){const e=[];return t.forEach(n=>{typeof n.insert=="string"?n.insert.split(`
78
- `).forEach((s,a)=>{a&&e.push({insert:`
79
- `,attributes:n.attributes}),s&&e.push({insert:s,attributes:n.attributes})}):e.push(n)}),e}class Or{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.quill=e,this.options=n}}Ee(Or,"DEFAULTS",{});const xo="\uFEFF";class Nh 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(xo),this.rightGuard=document.createTextNode(xo),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(xo).join("");if(e===this.leftGuard)if(this.prev instanceof yr){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 yr?(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=xo,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 nw{constructor(e,n){Ee(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 Nh)&&(this.emitter.emit(Se.events.COMPOSITION_BEFORE_START,e),this.scroll.batchStart(),this.emitter.emit(Se.events.COMPOSITION_START,e),this.isComposing=!0)}handleCompositionEnd(e){this.emitter.emit(Se.events.COMPOSITION_BEFORE_END,e),this.scroll.batchEnd(),this.emitter.emit(Se.events.COMPOSITION_END,e),this.isComposing=!1}}const Au=class Au{constructor(e,n){Ee(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]}};Ee(Au,"DEFAULTS",{modules:{}}),Ee(Au,"themes",{default:Au});let wi=Au;const rw=t=>t.parentElement||t.getRootNode().host||null,sw=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}},Do=t=>{const e=parseInt(t,10);return Number.isNaN(e)?0:e},w1=(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,aw=(t,e)=>{var a,i,u;const n=t.ownerDocument;let r=e,s=t;for(;s;){const o=s===n.body,f=o?{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}:sw(s),h=getComputedStyle(s),g=w1(r.left,r.right,f.left,f.right,Do(h.scrollPaddingLeft),Do(h.scrollPaddingRight)),d=w1(r.top,r.bottom,f.top,f.bottom,Do(h.scrollPaddingTop),Do(h.scrollPaddingBottom));if(g||d)if(o)(u=n.defaultView)==null||u.scrollBy(g,d);else{const{scrollLeft:m,scrollTop:b}=s;d&&(s.scrollTop+=d),g&&(s.scrollLeft+=g);const _=s.scrollLeft-m,T=s.scrollTop-b;r={left:r.left-_,top:r.top-T,right:r.right-_,bottom:r.bottom-T}}s=o||h.position==="fixed"?null:rw(s)}},iw=100,uw=["block","break","cursor","inline","scroll","text"],ow=(t,e,n)=>{const r=new Ii;return uw.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>iw){n.error(`Cycle detected in registering blot requiredContainer: "${s}"`);break}}),r},ri=ms("quill"),ko=new Ii;_r.uiClass="ql-ui";const dr=class dr{static debug(e){e===!0&&(e="log"),ms.level(e)}static find(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return ud.get(e)||ko.find(e,n)}static import(e){return this.imports[e]==null&&ri.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&&ri.warn(`Overwriting ${e} with`,n),this.imports[e]=n,(e.startsWith("blots/")||e.startsWith("formats/"))&&n&&typeof n!="boolean"&&n.blotName!=="abstract"&&ko.register(n),typeof n.register=="function"&&n.register(ko)}}constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(this.options=lw(e,n),this.container=this.options.container,this.container==null){ri.error("Invalid Quill container",e);return}this.options.debug&&dr.debug(this.options.debug);const r=this.container.innerHTML.trim();this.container.classList.add("ql-container"),this.container.innerHTML="",ud.set(this.container,this),this.root=this.addContainer("ql-editor"),this.root.classList.add("ql-blank"),this.emitter=new Se;const s=yh.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 J4(this.scroll),this.selection=new Q4(this.scroll,this.emitter),this.composition=new nw(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(Se.events.EDITOR_CHANGE,i=>{i===Se.events.TEXT_CHANGE&&this.root.classList.toggle("ql-blank",this.editor.isBlank())}),this.emitter.on(Se.events.SCROLL_UPDATE,(i,u)=>{const o=this.selection.lastRange,[f]=this.selection.getRange(),h=o&&f?{oldRange:o,newRange:f}:void 0;cr.call(this,()=>this.editor.update(null,u,h),i)}),this.emitter.on(Se.events.SCROLL_EMBED_UPDATE,(i,u)=>{const o=this.selection.lastRange,[f]=this.selection.getRange(),h=o&&f?{oldRange:o,newRange:f}:void 0;cr.call(this,()=>{const g=new we().retain(i.offset(this)).retain({[i.statics.blotName]:u});return this.editor.update(g,[],h)},dr.sources.USER)}),r){const i=this.clipboard.convert({html:`${r}<p><br></p>`,text:`
80
- `});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]=ns(e,n,r),cr.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]:Se.sources.API;return cr.call(this,()=>{const s=this.getSelection(!0);let a=new we;if(s==null)return a;if(this.scroll.query(e,Oe.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,Se.sources.SILENT),a},r)}formatLine(e,n,r,s,a){let i;return[e,n,i,a]=ns(e,n,r,s,a),cr.call(this,()=>this.editor.formatLine(e,n,i),a,e,0)}formatText(e,n,r,s,a){let i;return[e,n,i,a]=ns(e,n,r,s,a),cr.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]=ns(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]=ns(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]=ns(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]:dr.sources.API;return cr.call(this,()=>this.editor.insertEmbed(e,n,r),s,e)}insertText(e,n,r,s,a){let i;return[e,,i,a]=ns(e,0,r,s,a),cr.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]=ns(e,n,r),cr.call(this,()=>this.editor.removeFormat(e,n),r,e)}scrollRectIntoView(e){aw(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]:Se.sources.API;return cr.call(this,()=>{e=new we(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||dr.sources.API):([e,n,,r]=ns(e,n,r),this.selection.setRange(new Na(Math.max(0,e),n),r),r!==Se.sources.SILENT&&this.scrollSelectionIntoView())}setText(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Se.sources.API;const r=new we().insert(e);return this.setContents(r,n)}update(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Se.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]:Se.sources.API;return cr.call(this,()=>(e=new we(e),this.editor.applyDelta(e)),n,!0)}};Ee(dr,"DEFAULTS",{bounds:null,modules:{clipboard:!0,keyboard:!0,history:!0,uploader:!0},placeholder:"",readOnly:!1,registry:ko,theme:"default"}),Ee(dr,"events",Se.events),Ee(dr,"sources",Se.sources),Ee(dr,"version","2.0.3"),Ee(dr,"imports",{delta:we,parchment:q4,"core/module":Or,"core/theme":wi});let se=dr;function L1(t){return typeof t=="string"?document.querySelector(t):t}function Hc(t){return Object.entries(t??{}).reduce((e,n)=>{let[r,s]=n;return{...e,[r]:s===!0?{}:s}},{})}function O1(t){return Object.fromEntries(Object.entries(t).filter(e=>e[1]!==void 0))}function lw(t,e){const n=L1(t);if(!n)throw new Error("Invalid Quill container");const s=!e.theme||e.theme===se.DEFAULTS.theme?wi:se.import(`themes/${e.theme}`);if(!s)throw new Error(`Invalid theme ${e.theme}. Did you register it?`);const{modules:a,...i}=se.DEFAULTS,{modules:u,...o}=s.DEFAULTS;let f=Hc(e.modules);f!=null&&f.toolbar&&f.toolbar.constructor!==Object&&(f={...f,toolbar:{container:f.toolbar}});const h=Fs({},Hc(a),Hc(u),f),g={...i,...O1(o),...O1(e)};let d=e.registry;return d?e.formats&&ri.warn('Ignoring "formats" option because "registry" is specified'):d=e.formats?ow(e.formats,g.registry,ri):g.registry,{...g,registry:d,container:n,theme:s,modules:Object.entries(h).reduce((m,b)=>{let[_,T]=b;if(!T)return m;const E=se.import(`modules/${_}`);return E==null?(ri.error(`Cannot load ${_} module. Are you sure you registered it?`),m):{...m,[_]:Fs({},E.DEFAULTS||{},T)}},{}),bounds:L1(g.bounds)}}function cr(t,e,n,r){if(!this.isEnabled()&&e===Se.sources.USER&&!this.allowReadOnlyEdits)return new we;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=R1(s,i,e):r!==0&&(s=R1(s,n,r,e)),this.setSelection(s,Se.sources.SILENT)),i.length()>0){const u=[Se.events.TEXT_CHANGE,i,a,e];this.emitter.emit(Se.events.EDITOR_CHANGE,...u),e!==Se.sources.SILENT&&this.emitter.emit(...u)}return i}function ns(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||Se.sources.API,[t,e,a,s]}function R1(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(u=>e.transformPosition(u,r!==Se.sources.USER)):[a,i]=[t.index,t.index+t.length].map(u=>u<e||u===e&&r===Se.sources.USER?u:s>=0?u+s:Math.max(e,u+s)),new Na(a,i-a)}class ka extends ql{}function x1(t){return t instanceof an||t instanceof er}function D1(t){return typeof t.updateContent=="function"}class Va extends yh{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(Se.events.SCROLL_BLOT_MOUNT,e)}emitUnmount(e){this.emitter.emit(Se.events.SCROLL_BLOT_UNMOUNT,e)}emitEmbedUpdate(e,n){this.emitter.emit(Se.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 er||a instanceof er){this.optimize();return}const i=a.children.head instanceof Lr?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,Oe.BLOCK)==null){const s=this.scroll.create(this.statics.defaultChild.blotName);this.appendChild(s),r==null&&n.endsWith(`
81
- `)?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===Oe.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 we().insert(`
82
- `))),s=r.pop();if(s==null)return;this.batchStart();const a=r.shift();if(a){const o=a.type==="block"&&(a.delta.length()===0||!this.descendant(er,e)[0]&&e<this.length()),f=a.type==="block"?a.delta:new we().insert({[a.key]:a.value});qc(this,e,f);const h=a.type==="block"?1:0,g=e+f.length()+h;o&&this.insertAt(g-1,`
83
- `);const d=Qn(this.line(e)[0]),m=tr.AttributeMap.diff(d,a.attributes)||{};Object.keys(m).forEach(b=>{this.formatAt(g-1,1,b,m[b])}),e=g}let[i,u]=this.children.find(e);if(r.length&&(i&&(i=i.split(u),u=0),r.forEach(o=>{if(o.type==="block"){const f=this.createBlock(o.attributes,i||void 0);qc(f,0,o.delta)}else{const f=this.create(o.key,o.value);this.insertBefore(f,i||void 0),Object.keys(o.attributes).forEach(h=>{f.format(h,o.attributes[h])})}})),s.type==="block"&&s.delta.length()){const o=i?i.offset(i.scroll)+u:this.length();qc(this,o,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 dn?[r,s]:[null,-1]}line(e){return e===this.length()?this.line(e-1):this.descendant(x1,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 u=[],o=i;return s.children.forEachAt(a,i,(f,h,g)=>{x1(f)?u.push(f):f instanceof ql&&(u=u.concat(r(f,h,o))),o-=g}),u};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(Se.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=Se.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&&!D1(a)}),e.length>0&&this.emitter.emit(Se.events.SCROLL_BEFORE_UPDATE,n,e),super.update(e.concat([])),e.length>0&&this.emitter.emit(Se.events.SCROLL_UPDATE,n,e)}updateEmbedAt(e,n,r){const[s]=this.descendant(a=>a instanceof er,e);s&&s.statics.blotName===n&&D1(s)&&s.updateContent(r)}handleDragStart(e){e.preventDefault()}deltaToRenderBlocks(e){const n=[];let r=new we;return e.forEach(s=>{const a=s==null?void 0:s.insert;if(a)if(typeof a=="string"){const i=a.split(`
84
- `);i.slice(0,-1).forEach(o=>{r.insert(o,s.attributes),n.push({type:"block",delta:r,attributes:s.attributes??{}}),r=new we});const u=i[i.length-1];u&&r.insert(u,s.attributes)}else{const i=Object.keys(a)[0];if(!i)return;this.query(i,Oe.INLINE)?r.push(s):(r.length()&&n.push({type:"block",delta:r,attributes:{}}),r=new we,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(u=>{let[o,f]=u;this.query(o,Oe.BLOCK&Oe.BLOT)!=null?r=o:s[o]=f});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(u=>{let[o,f]=u;a.formatAt(0,i,o,f)}),a}}Ee(Va,"blotName","scroll"),Ee(Va,"className","ql-editor"),Ee(Va,"tagName","DIV"),Ee(Va,"defaultChild",an),Ee(Va,"allowedChildren",[an,er,ka]);function qc(t,e,n){n.reduce((r,s)=>{const a=tr.Op.length(s);let i=s.attributes||{};if(s.insert!=null){if(typeof s.insert=="string"){const u=s.insert;t.insertAt(r,u);const[o]=t.descendant(dn,r),f=Qn(o);i=tr.AttributeMap.diff(f,i)||{}}else if(typeof s.insert=="object"){const u=Object.keys(s.insert)[0];if(u==null)return r;if(t.insertAt(r,u,s.insert[u]),t.scroll.query(u,Oe.INLINE)!=null){const[f]=t.descendant(dn,r),h=Qn(f);i=tr.AttributeMap.diff(h,i)||{}}}}return Object.keys(i).forEach(u=>{t.formatAt(r,a,u,i[u])}),r+a},e)}const Sh={scope:Oe.BLOCK,whitelist:["right","center","justify"]},cw=new Vr("align","align",Sh),fb=new wr("align","ql-align",Sh),db=new Gs("align","text-align",Sh);class hb extends Gs{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 fw=new wr("color","ql-color",{scope:Oe.INLINE}),Ih=new hb("color","color",{scope:Oe.INLINE}),dw=new wr("background","ql-bg",{scope:Oe.INLINE}),Ch=new hb("background","background-color",{scope:Oe.INLINE});class Pa extends ka{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(`
85
- `).slice(e,e+n)}html(e,n){return`<pre>
86
- ${jl(this.code(e,n))}
87
- </pre>`}}class hn extends an{static register(){se.register(Pa)}}Ee(hn,"TAB"," ");class wh extends Xr{}wh.blotName="code";wh.tagName="CODE";hn.blotName="code-block";hn.className="ql-code-block";hn.tagName="DIV";Pa.blotName="code-block-container";Pa.className="ql-code-block-container";Pa.tagName="DIV";Pa.allowedChildren=[hn];hn.allowedChildren=[yr,Lr,Ci];hn.requiredContainer=Pa;const Lh={scope:Oe.BLOCK,whitelist:["rtl"]},pb=new Vr("direction","dir",Lh),mb=new wr("direction","ql-direction",Lh),gb=new Gs("direction","direction",Lh),bb={scope:Oe.INLINE,whitelist:["serif","monospace"]},Eb=new wr("font","ql-font",bb);class hw extends Gs{value(e){return super.value(e).replace(/["']/g,"")}}const vb=new hw("font","font-family",bb),Tb=new wr("size","ql-size",{scope:Oe.INLINE,whitelist:["small","large","huge"]}),_b=new Gs("size","font-size",{scope:Oe.INLINE,whitelist:["10px","18px","32px"]}),pw=ms("quill:keyboard"),mw=/Mac/i.test(navigator.platform)?"metaKey":"ctrlKey";class $l extends Or{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=bw(e);if(s==null){pw.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 u={...s,key:i,...n,...r};this.bindings[u.key]=this.bindings[u.key]||[],this.bindings[u.key].push(u)})}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=>$l.match(e,E));if(s.length===0)return;const a=se.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[u,o]=this.quill.getLine(i.index),[f,h]=this.quill.getLeaf(i.index),[g,d]=i.length===0?[f,h]:this.quill.getLeaf(i.index+i.length),m=f instanceof gl?f.value().slice(0,h):"",b=g instanceof gl?g.value().slice(d):"",_={collapsed:i.length===0,empty:i.length===0&&u.length()<=1,format:this.quill.getFormat(i),line:u,offset:o,prefix:m,suffix:b,event:e};s.some(E=>{if(E.collapsed!=null&&E.collapsed!==_.collapsed||E.empty!=null&&E.empty!==_.empty||E.offset!=null&&E.offset!==_.offset)return!1;if(Array.isArray(E.format)){if(E.format.every(O=>_.format[O]==null))return!1}else if(typeof E.format=="object"&&!Object.keys(E.format).every(O=>E.format[O]===!0?_.format[O]!=null:E.format[O]===!1?_.format[O]==null:_h(E.format[O],_.format[O])))return!1;return E.prefix!=null&&!E.prefix.test(_.prefix)||E.suffix!=null&&!E.suffix.test(_.suffix)?!1:E.handler.call(this,i,_,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 we().retain(e.index-r).delete(r);if(n.offset===0){const[u]=this.quill.getLine(e.index-1);if(u&&!(u.statics.blotName==="block"&&u.length()<=1)){const f=a.formats(),h=this.quill.getFormat(e.index-1,1);if(s=tr.AttributeMap.diff(f,h)||{},Object.keys(s).length>0){const g=new we().retain(e.index+a.length()-2).retain(1,s);i=i.compose(g)}}}this.quill.updateContents(i,se.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 we().retain(e.index).delete(r);if(n.offset>=a.length()-1){const[u]=this.quill.getLine(e.index+1);if(u){const o=a.formats(),f=this.quill.getFormat(e.index,1);s=tr.AttributeMap.diff(o,f)||{},Object.keys(s).length>0&&(i=i.retain(u.length()-1).retain(1,s))}}this.quill.updateContents(i,se.sources.USER),this.quill.focus()}handleDeleteRange(e){Oh({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,Oe.BLOCK)&&!Array.isArray(n.format[i])&&(a[i]=n.format[i]),a),{}),s=new we().retain(e.index).delete(e.length).insert(`
88
- `,r);this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(e.index+1,se.sources.SILENT),this.quill.focus()}}const gw={bindings:{bold:jc("bold"),italic:jc("italic"),underline:jc("underline"),indent:{key:"Tab",format:["blockquote","indent","list"],handler(t,e){return e.collapsed&&e.offset!==0?!0:(this.quill.format("indent","+1",se.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",se.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",se.sources.USER):e.format.list!=null&&this.quill.format("list",!1,se.sources.USER)}},"indent code-block":k1(!0),"outdent code-block":k1(!1),"remove tab":{key:"Tab",shiftKey:!0,collapsed:!0,prefix:/\t$/,handler(t){this.quill.deleteText(t.index-1,1,se.sources.USER)}},tab:{key:"Tab",handler(t,e){if(e.format.table)return!0;this.quill.history.cutoff();const n=new we().retain(t.index).delete(t.length).insert(" ");return this.quill.updateContents(n,se.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index+1,se.sources.SILENT),!1}},"blockquote empty enter":{key:"Enter",collapsed:!0,format:["blockquote"],empty:!0,handler(){this.quill.format("blockquote",!1,se.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,se.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 we().retain(t.index).insert(`
89
- `,r).retain(e.length()-n-1).retain(1,{list:"unchecked"});this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(t.index+1,se.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 we().retain(t.index).insert(`
90
- `,e.format).retain(n.length()-r-1).retain(1,{header:null});this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(t.index+1,se.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=Ew(n,r,s,a);if(i==null)return;let u=n.offset();if(i<0){const o=new we().retain(u).insert(`
91
- `);this.quill.updateContents(o,se.sources.USER),this.quill.setSelection(t.index+1,t.length,se.sources.SILENT)}else if(i>0){u+=n.length();const o=new we().retain(u).insert(`
92
- `);this.quill.updateContents(o,se.sources.USER),this.quill.setSelection(u,se.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,se.sources.USER):this.quill.setSelection(s+r.length(),se.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," ",se.sources.USER),this.quill.history.cutoff();const i=new we().retain(t.index-s).delete(n+1).retain(r.length()-2-s).retain(1,{list:a});return this.quill.updateContents(i,se.sources.USER),this.quill.history.cutoff(),this.quill.setSelection(t.index-n,se.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 we().retain(t.index+e.length()-n-2).retain(1,{"code-block":null}).delete(1);return this.quill.updateContents(a,se.sources.USER),this.quill.setSelection(t.index-1,se.sources.SILENT),!1}return!0}},"embed left":Po("ArrowLeft",!1),"embed left shift":Po("ArrowLeft",!0),"embed right":Po("ArrowRight",!1),"embed right shift":Po("ArrowRight",!0),"table down":P1(!1),"table up":P1(!0)}};$l.DEFAULTS=gw;function k1(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,se.sources.USER),this.quill.setSelection(e.index+a.length,se.sources.SILENT);return}const i=e.length===0?this.quill.getLines(e.index,1):this.quill.getLines(e);let{index:u,length:o}=e;i.forEach((f,h)=>{t?(f.insertAt(0,a),h===0?u+=a.length:o+=a.length):f.domNode.textContent.startsWith(a)&&(f.deleteAt(0,a.length),h===0?u-=a.length:o-=a.length)}),this.quill.update(se.sources.USER),this.quill.setSelection(u,o,se.sources.SILENT)}}}function Po(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,se.sources.USER):this.quill.setSelection(r.index-1,se.sources.USER):e?this.quill.setSelection(r.index,r.length+1,se.sources.USER):this.quill.setSelection(r.index+r.length+1,se.sources.USER),!1):!0}}}function jc(t){return{key:t[0],shortKey:!0,handler(e,n){this.quill.format(t,!n.format[t],se.sources.USER)}}}function P1(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,u=s;for(;u.prev!=null;)u=u.prev,i=i.next;const o=i.offset(this.quill.scroll)+Math.min(n.offset,i.length()-1);this.quill.setSelection(o,0,se.sources.USER)}}else{const i=s.table()[r];i!=null&&(t?this.quill.setSelection(i.offset(this.quill.scroll)+i.length()-1,0,se.sources.USER):this.quill.setSelection(i.offset(this.quill.scroll),0,se.sources.USER))}return!1}}}function bw(t){if(typeof t=="string"||typeof t=="number")t={key:t};else if(typeof t=="object")t=ti(t);else return null;return t.shortKey&&(t[mw]=t.shortKey,delete t.shortKey),t}function Oh(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=tr.AttributeMap.diff(i,a)||{}}e.deleteText(n,se.sources.USER),Object.keys(s).length>0&&e.formatLine(n.index,1,s,se.sources.USER),e.setSelection(n.index,se.sources.SILENT)}function Ew(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 vw=/font-weight:\s*normal/,Tw=["P","OL","UL"],M1=t=>t&&Tw.includes(t.tagName),_w=t=>{Array.from(t.querySelectorAll("br")).filter(e=>M1(e.previousElementSibling)&&M1(e.nextElementSibling)).forEach(e=>{var n;(n=e.parentNode)==null||n.removeChild(e)})},Aw=t=>{Array.from(t.querySelectorAll('b[style*="font-weight"]')).filter(e=>{var n;return(n=e.getAttribute("style"))==null?void 0:n.match(vw)}).forEach(e=>{var r;const n=t.createDocumentFragment();n.append(...e.childNodes),(r=e.parentNode)==null||r.replaceChild(n,e)})};function yw(t){t.querySelector('[id^="docs-internal-guid-"]')&&(Aw(t),_w(t))}const Nw=/\bmso-list:[^;]*ignore/i,Sw=/\bmso-list:[^;]*\bl(\d+)/i,Iw=/\bmso-list:[^;]*\blevel(\d+)/i,Cw=(t,e)=>{const n=t.getAttribute("style"),r=n==null?void 0:n.match(Sw);if(!r)return null;const s=Number(r[1]),a=n==null?void 0:n.match(Iw),i=a?Number(a[1]):1,u=new RegExp(`@list l${s}:level${i}\\s*\\{[^\\}]*mso-level-number-format:\\s*([\\w-]+)`,"i"),o=e.match(u),f=o&&o[1]==="bullet"?"bullet":"ordered";return{id:s,indent:i,type:f,element:t}},ww=t=>{var i,u;const e=Array.from(t.querySelectorAll("[style*=mso-list]")),n=[],r=[];e.forEach(o=>{(o.getAttribute("style")||"").match(Nw)?n.push(o):r.push(o)}),n.forEach(o=>{var f;return(f=o.parentNode)==null?void 0:f.removeChild(o)});const s=t.documentElement.innerHTML,a=r.map(o=>Cw(o,s)).filter(o=>o);for(;a.length;){const o=[];let f=a.shift();for(;f;)o.push(f),f=a.length&&((i=a[0])==null?void 0:i.element)===f.element.nextElementSibling&&a[0].id===f.id?a.shift():null;const h=document.createElement("ul");o.forEach(m=>{const b=document.createElement("li");b.setAttribute("data-list",m.type),m.indent>1&&b.setAttribute("class",`ql-indent-${m.indent-1}`),b.innerHTML=m.element.innerHTML,h.appendChild(b)});const g=(u=o[0])==null?void 0:u.element,{parentNode:d}=g??{};g&&(d==null||d.replaceChild(h,g)),o.slice(1).forEach(m=>{let{element:b}=m;d==null||d.removeChild(b)})}};function Lw(t){t.documentElement.getAttribute("xmlns:w")==="urn:schemas-microsoft-com:office:word"&&ww(t)}const Ow=[Lw,yw],Rw=t=>{t.documentElement&&Ow.forEach(e=>{e(t)})},xw=ms("quill:clipboard"),Dw=[[Node.TEXT_NODE,zw],[Node.TEXT_NODE,F1],["br",Fw],[Node.ELEMENT_NODE,F1],[Node.ELEMENT_NODE,Bw],[Node.ELEMENT_NODE,Mw],[Node.ELEMENT_NODE,$w],["li",qw],["ol, ul",jw],["pre",Uw],["tr",Yw],["b",$c("bold")],["i",$c("italic")],["strike",$c("strike")],["style",Hw]],kw=[cw,pb].reduce((t,e)=>(t[e.keyName]=e,t),{}),B1=[db,Ch,Ih,gb,vb,_b].reduce((t,e)=>(t[e.keyName]=e,t),{});class Ab extends Or{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=[],Dw.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[hn.blotName])return new we().insert(r||"",{[hn.blotName]:s[hn.blotName]});if(!n)return new we().insert(r||"",s);const a=this.convertHTML(n);return ro(a,`
93
- `)&&(a.ops[a.ops.length-1].attributes==null||s.table)?a.compose(new we().retain(a.length()-1).delete(1)):a}normalizeHTML(e){Rw(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 Rh(this.quill.scroll,r,a,i,s)}dangerouslyPasteHTML(e,n){let r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:se.sources.API;if(typeof e=="string"){const s=this.convert({html:e,text:""});this.quill.setContents(s,n),this.quill.setSelection(0,se.sources.SILENT)}else{const s=this.convert({html:n,text:""});this.quill.updateContents(new we().retain(e).concat(s),r),this.quill.setSelection(e+s.length(),se.sources.SILENT)}}onCaptureCopy(e){var i,u;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),(u=e.clipboardData)==null||u.setData("text/html",s),n&&Oh({range:r,quill:this.quill})}normalizeURIList(e){return e.split(/\r?\n/).filter(n=>n[0]!=="#").join(`
94
- `)}onCapturePaste(e){var i,u,o,f,h;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=(u=e.clipboardData)==null?void 0:u.getData("text/plain");if(!r&&!s){const g=(o=e.clipboardData)==null?void 0:o.getData("text/uri-list");g&&(s=this.normalizeURIList(g))}const a=Array.from(((f=e.clipboardData)==null?void 0:f.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&&((h=g.body.firstElementChild)==null?void 0:h.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);xw.log("onPaste",i,{text:r,html:s});const u=new we().retain(e.index).delete(e.length).concat(i);this.quill.updateContents(u,se.sources.USER),this.quill.setSelection(u.length()-e.length,se.sources.SILENT),this.quill.scrollSelectionIntoView()}prepareMatching(e,n){const r=[],s=[];return this.matchers.forEach(a=>{const[i,u]=a;switch(i){case Node.TEXT_NODE:s.push(u);break;case Node.ELEMENT_NODE:r.push(u);break;default:Array.from(e.querySelectorAll(i)).forEach(o=>{if(n.has(o)){const f=n.get(o);f==null||f.push(u)}else n.set(o,[u])});break}}),[r,s]}}Ee(Ab,"DEFAULTS",{matchers:[]});function Ma(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 we):t}function ro(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 xs(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 Pw(t,e){return t.previousElementSibling&&t.nextElementSibling&&!xs(t.previousElementSibling,e)&&!xs(t.nextElementSibling,e)}const Mo=new WeakMap;function yb(t){return t==null?!1:(Mo.has(t)||(t.tagName==="PRE"?Mo.set(t,!0):Mo.set(t,yb(t.parentNode))),Mo.get(t))}function Rh(t,e,n,r,s){return e.nodeType===e.TEXT_NODE?r.reduce((a,i)=>i(e,a,t),new we):e.nodeType===e.ELEMENT_NODE?Array.from(e.childNodes||[]).reduce((a,i)=>{let u=Rh(t,i,n,r,s);return i.nodeType===e.ELEMENT_NODE&&(u=n.reduce((o,f)=>f(i,o,t),u),u=(s.get(i)||[]).reduce((o,f)=>f(i,o,t),u)),a.concat(u)},new we):new we}function $c(t){return(e,n,r)=>Ma(n,t,!0,r)}function Mw(t,e,n){const r=Vr.keys(t),s=wr.keys(t),a=Gs.keys(t),i={};return r.concat(s).concat(a).forEach(u=>{let o=n.query(u,Oe.ATTRIBUTE);o!=null&&(i[o.attrName]=o.value(t),i[o.attrName])||(o=kw[u],o!=null&&(o.attrName===u||o.keyName===u)&&(i[o.attrName]=o.value(t)||void 0),o=B1[u],o!=null&&(o.attrName===u||o.keyName===u)&&(o=B1[u],i[o.attrName]=o.value(t)||void 0))}),Object.entries(i).reduce((u,o)=>{let[f,h]=o;return Ma(u,f,h,n)},e)}function Bw(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 we().insert(s,r.formats(t,n))}else if(r.prototype instanceof ku&&!ro(e,`
95
- `)&&e.insert(`
96
- `),"blotName"in r&&"formats"in r&&typeof r.formats=="function")return Ma(e,r.blotName,r.formats(t,n),n);return e}function Fw(t,e){return ro(e,`
97
- `)||e.insert(`
98
- `),e}function Uw(t,e,n){const r=n.query("code-block"),s=r&&"formats"in r&&typeof r.formats=="function"?r.formats(t,n):!0;return Ma(e,"code-block",s,n)}function Hw(){return new we}function qw(t,e,n){const r=n.query(t);if(r==null||r.blotName!=="list"||!ro(e,`
99
- `))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,u)=>u.insert?u.attributes&&typeof u.attributes.indent=="number"?i.push(u):i.insert(u.insert,{indent:s,...u.attributes||{}}):i,new we)}function jw(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"),Ma(e,"list",s,n)}function F1(t,e,n){if(!ro(e,`
100
- `)){if(xs(t,n)&&(t.childNodes.length>0||t instanceof HTMLParagraphElement))return e.insert(`
101
- `);if(e.length()>0&&t.nextSibling){let r=t.nextSibling;for(;r!=null;){if(xs(r,n))return e.insert(`
102
- `);const s=n.query(r);if(s&&s.prototype instanceof er)return e.insert(`
103
- `);r=r.firstChild}}}return e}function $w(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,u)=>{let[o,f]=u;return Ma(i,o,f,n)},e),parseFloat(s.textIndent||0)>0?new we().insert(" ").concat(e):e}function Yw(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 u=Array.from(r.querySelectorAll("tr")).indexOf(t)+1;return Ma(e,"table",u,n)}return e}function zw(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(!yb(t)){if(r.trim().length===0&&r.includes(`
104
- `)&&!Pw(t,n))return e;r=r.replace(/[^\S\u00a0]/g," "),r=r.replace(/ {2,}/g," "),(t.previousSibling==null&&t.parentElement!=null&&xs(t.parentElement,n)||t.previousSibling instanceof Element&&xs(t.previousSibling,n))&&(r=r.replace(/^ /,"")),(t.nextSibling==null&&t.parentElement!=null&&xs(t.parentElement,n)||t.nextSibling instanceof Element&&xs(t.nextSibling,n))&&(r=r.replace(/ $/,"")),r=r.replaceAll(" "," ")}return e.insert(r)}class Nb extends Or{constructor(n,r){super(n,r);Ee(this,"lastRecorded",0);Ee(this,"ignoreChange",!1);Ee(this,"stack",{undo:[],redo:[]});Ee(this,"currentRange",null);this.quill.on(se.events.EDITOR_CHANGE,(s,a,i,u)=>{s===se.events.SELECTION_CHANGE?a&&u!==se.sources.SILENT&&(this.currentRange=a):s===se.events.TEXT_CHANGE&&(this.ignoreChange||(!this.options.userOnly||u===se.sources.USER?this.record(a,i):this.transform(a)),this.currentRange=cd(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:cd(s.range,i)}),this.lastRecorded=0,this.ignoreChange=!0,this.quill.updateContents(s.delta,se.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 u=this.stack.undo.pop();u&&(s=s.compose(u.delta),a=u.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){U1(this.stack.undo,n),U1(this.stack.redo,n)}undo(){this.change("undo","redo")}restoreSelection(n){if(n.range)this.quill.setSelection(n.range,se.sources.USER);else{const r=Gw(this.quill.scroll,n.delta);this.quill.setSelection(r,se.sources.USER)}}}Ee(Nb,"DEFAULTS",{delay:1e3,maxStack:100,userOnly:!1});function U1(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&&cd(s.range,n)},n=s.delta.transform(n),t[r].delta.length()===0&&t.splice(r,1)}}function Ww(t,e){const n=e.ops[e.ops.length-1];return n==null?!1:n.insert!=null?typeof n.insert=="string"&&n.insert.endsWith(`
105
- `):n.attributes!=null?Object.keys(n.attributes).some(r=>t.query(r,Oe.BLOCK)!=null):!1}function Gw(t,e){const n=e.reduce((s,a)=>s+(a.delete||0),0);let r=e.length()-n;return Ww(t,e)&&(r-=1),r}function cd(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 Sb extends Or{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 u=document.caretPositionFromPoint(r.clientX,r.clientY);s=document.createRange(),s.setStart(u.offsetNode,u.offset),s.setEnd(u.offsetNode,u.offset)}const a=s&&e.selection.normalizeNative(s);if(a){const u=e.selection.normalizedToRange(a);(i=r.dataTransfer)!=null&&i.files&&this.upload(u,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)}}Sb.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 we().retain(t.index).delete(t.length));this.quill.updateContents(s,Se.sources.USER),this.quill.setSelection(t.index+r.length,Se.sources.SILENT)})}};const Kw=["insertText","insertReplacementText"];class Vw extends Or{constructor(e,n){super(e,n),e.root.addEventListener("beforeinput",r=>{this.handleBeforeInput(r)}),/Android/i.test(navigator.userAgent)||e.on(se.events.COMPOSITION_BEFORE_START,()=>{this.handleCompositionStart()})}deleteRange(e){Oh({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 we().retain(e.index).insert(n,r),se.sources.USER)}else this.deleteRange(e);return this.quill.setSelection(e.index+n.length,0,se.sources.SILENT),!0}handleBeforeInput(e){if(this.quill.composition.isComposing||e.defaultPrevented||!Kw.includes(e.inputType))return;const n=e.getTargetRanges?e.getTargetRanges()[0]:null;if(!n||n.collapsed===!0)return;const r=Xw(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 Xw(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 Qw=/Mac/i.test(navigator.platform),Zw=100,Jw=t=>!!(t.key==="ArrowLeft"||t.key==="ArrowRight"||t.key==="ArrowUp"||t.key==="ArrowDown"||t.key==="Home"||Qw&&t.key==="a"&&t.ctrlKey===!0);class eL extends Or{constructor(n,r){super(n,r);Ee(this,"isListening",!1);Ee(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 _r)||!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),se.sources.USER),!1)}})}handleNavigationShortcuts(){this.quill.root.addEventListener("keydown",n=>{!n.defaultPrevented&&Jw(n)&&this.ensureListeningToSelectionChange()})}ensureListeningToSelectionChange(){if(this.selectionChangeDeadline=Date.now()+Zw,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 _r)||!s.uiNode)return;const a=document.createRange();a.setStartAfter(s.uiNode),a.setEndAfter(s.uiNode),n.removeAllRanges(),n.addRange(a)}}se.register({"blots/block":an,"blots/block/embed":er,"blots/break":Lr,"blots/container":ka,"blots/cursor":Ci,"blots/embed":Nh,"blots/inline":Xr,"blots/scroll":Va,"blots/text":yr,"modules/clipboard":Ab,"modules/history":Nb,"modules/keyboard":$l,"modules/uploader":Sb,"modules/input":Vw,"modules/uiNode":eL});class tL extends wr{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 nL=new tL("indent","ql-indent",{scope:Oe.BLOCK,whitelist:[1,2,3,4,5,6,7,8]});class fd extends an{}Ee(fd,"blotName","blockquote"),Ee(fd,"tagName","blockquote");class dd extends an{static formats(e){return this.tagName.indexOf(e.tagName)+1}}Ee(dd,"blotName","header"),Ee(dd,"tagName",["H1","H2","H3","H4","H5","H6"]);class so extends ka{}so.blotName="list-container";so.tagName="OL";class ao extends an{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(){se.register(so)}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)}}ao.blotName="list";ao.tagName="LI";so.allowedChildren=[ao];ao.requiredContainer=so;class Mu extends Xr{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)}}Ee(Mu,"blotName","bold"),Ee(Mu,"tagName",["STRONG","B"]);class hd extends Mu{}Ee(hd,"blotName","italic"),Ee(hd,"tagName",["EM","I"]);class Ds extends Xr{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 Ib(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))}}Ee(Ds,"blotName","link"),Ee(Ds,"tagName","A"),Ee(Ds,"SANITIZED_URL","about:blank"),Ee(Ds,"PROTOCOL_WHITELIST",["http","https","mailto","tel","sms"]);function Ib(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 pd extends Xr{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"}}Ee(pd,"blotName","script"),Ee(pd,"tagName",["SUB","SUP"]);class md extends Mu{}Ee(md,"blotName","strike"),Ee(md,"tagName",["S","STRIKE"]);class gd extends Xr{}Ee(gd,"blotName","underline"),Ee(gd,"tagName","U");class Ko extends Nh{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>`}}Ee(Ko,"blotName","formula"),Ee(Ko,"className","ql-formula"),Ee(Ko,"tagName","SPAN");const H1=["alt","height","width"];class bd 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 H1.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 Ib(e,["http","https","data"])?e:"//:0"}static value(e){return e.getAttribute("src")}format(e,n){H1.indexOf(e)>-1?n?this.domNode.setAttribute(e,n):this.domNode.removeAttribute(e):super.format(e,n)}}Ee(bd,"blotName","image"),Ee(bd,"tagName","IMG");const q1=["height","width"];class Vo extends er{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 q1.reduce((n,r)=>(e.hasAttribute(r)&&(n[r]=e.getAttribute(r)),n),{})}static sanitize(e){return Ds.sanitize(e)}static value(e){return e.getAttribute("src")}format(e,n){q1.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>`}}Ee(Vo,"blotName","video"),Ee(Vo,"className","ql-video"),Ee(Vo,"tagName","IFRAME");const uu=new wr("code-token","hljs",{scope:Oe.INLINE});class ds extends Xr{static formats(e,n){for(;e!=null&&e!==n.domNode;){if(e.classList&&e.classList.contains(hn.className))return super.formats(e,n);e=e.parentNode}}constructor(e,n,r){super(e,n,r),uu.add(this.domNode,r)}format(e,n){e!==ds.blotName?super.format(e,n):n?uu.add(this.domNode,n):(uu.remove(this.domNode),this.domNode.classList.remove(this.statics.className))}optimize(){super.optimize(...arguments),uu.value(this.domNode)||this.unwrap()}}ds.blotName="code-token";ds.className="ql-token";class Zn extends hn{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(),ds.blotName,!1),super.replaceWith(e,n)}}class Tu extends Pa{attach(){super.attach(),this.forceNext=!1,this.scroll.emitMount(this)}format(e,n){e===Zn.blotName&&(this.forceNext=!0,this.children.forEach(r=>{r.format(e,n)}))}formatAt(e,n,r,s){r===Zn.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(`
106
- `)}
107
- `,a=Zn.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((o,f)=>o.concat(lb(f,!1)),new we),u=e(s,a);i.diff(u).reduce((o,f)=>{let{retain:h,attributes:g}=f;return h?(g&&Object.keys(g).forEach(d=>{[Zn.blotName,ds.blotName].includes(d)&&this.formatAt(o,h,d,g[d])}),o+h):o},0)}this.cachedText=s,this.forceNext=!1}}html(e,n){const[r]=this.children.find(e);return`<pre data-language="${r?Zn.formats(r.domNode):"plain"}">
108
- ${jl(this.code(e,n))}
109
- </pre>`}optimize(e){if(super.optimize(e),this.parent!=null&&this.children.head!=null&&this.uiNode!=null){const n=Zn.formats(this.children.head.domNode);n!==this.uiNode.value&&(this.uiNode.value=n)}}}Tu.allowedChildren=[Zn];Zn.requiredContainer=Tu;Zn.allowedChildren=[ds,Ci,yr,Lr];const rL=(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 Cb extends Or{static register(){se.register(ds,!0),se.register(Zn,!0),se.register(Tu,!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(se.events.SCROLL_BLOT_MOUNT,e=>{if(!(e instanceof Tu))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(Zn.blotName,n.value),this.quill.root.focus(),this.highlight(e,!0)}),e.uiNode==null&&(e.attachUI(n),e.children.head&&(n.value=Zn.formats(e.children.head.domNode)))})}initTimer(){let e=null;this.quill.on(se.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(se.sources.USER);const r=this.quill.getSelection();(e==null?this.quill.scroll.descendants(Tu):[e]).forEach(a=>{a.highlight(this.highlightBlot,n)}),this.quill.update(se.sources.SILENT),r!=null&&this.quill.setSelection(r,se.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 jl(e).split(`
110
- `).reduce((s,a,i)=>(i!==0&&s.insert(`
111
- `,{[hn.blotName]:n}),s.insert(a)),new we);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(hn.className),r.innerHTML=rL(this.options.hljs,n,e),Rh(this.quill.scroll,r,[(s,a)=>{const i=uu.value(s);return i?a.compose(new we().retain(a.length(),{[ds.blotName]:i})):a}],[(s,a)=>s.data.split(`
112
- `).reduce((i,u,o)=>(o!==0&&i.insert(`
113
- `,{[hn.blotName]:n}),i.insert(u)),a)],new WeakMap)}}Cb.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 yu=class yu extends an{static create(e){const n=super.create();return e?n.setAttribute("data-row",e):n.setAttribute("data-row",xh()),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===yu.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()}};Ee(yu,"blotName","table"),Ee(yu,"tagName","TD");let gr=yu;class hs extends ka{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}}Ee(hs,"blotName","table-row"),Ee(hs,"tagName","TR");class zr extends ka{}Ee(zr,"blotName","table-body"),Ee(zr,"tagName","TBODY");class Li extends ka{balanceCells(){const e=this.descendants(hs),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=gr.formats(r.children.head.domNode));const a=this.scroll.create(gr.blotName,s);r.appendChild(a),a.optimize()})})}cells(e){return this.rows().map(n=>n.children.at(e))}deleteColumn(e){const[n]=this.descendant(zr);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(zr);n==null||n.children.head==null||n.children.forEach(r=>{const s=r.children.at(e),a=gr.formats(r.children.head.domNode),i=this.scroll.create(gr.blotName,a);r.insertBefore(i,s)})}insertRow(e){const[n]=this.descendant(zr);if(n==null||n.children.head==null)return;const r=xh(),s=this.scroll.create(hs.blotName);n.children.head.children.forEach(()=>{const i=this.scroll.create(gr.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)}}Ee(Li,"blotName","table-container"),Ee(Li,"tagName","TABLE");Li.allowedChildren=[zr];zr.requiredContainer=Li;zr.allowedChildren=[hs];hs.requiredContainer=zr;hs.allowedChildren=[gr];gr.requiredContainer=hs;function xh(){return`row-${Math.random().toString(36).slice(2,6)}`}class sL extends Or{static register(){se.register(gr),se.register(hs),se.register(zr),se.register(Li)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Li).forEach(e=>{e.balanceCells()})}deleteColumn(){const[e,,n]=this.getTable();n!=null&&(e.deleteColumn(n.cellOffset()),this.quill.update(se.sources.USER))}deleteRow(){const[,e]=this.getTable();e!=null&&(e.remove(),this.quill.update(se.sources.USER))}deleteTable(){const[e]=this.getTable();if(e==null)return;const n=e.offset();e.remove(),this.quill.update(se.sources.USER),this.quill.setSelection(n,se.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!==gr.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(se.sources.USER);let u=s.rowOffset();e===0&&(u+=1),this.quill.setSelection(n.index+u,n.length,se.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(se.sources.USER),e>0?this.quill.setSelection(n,se.sources.SILENT):this.quill.setSelection(n.index+s.children.length,n.length,se.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(`
114
- `).join("");return a.insert(i,{table:xh()})},new we().retain(r.index));this.quill.updateContents(s,se.sources.USER),this.quill.setSelection(r.index,se.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(se.events.SCROLL_OPTIMIZE,e=>{e.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(se.events.TEXT_CHANGE,(r,s,a)=>{a===se.sources.USER&&this.balanceTables()}),!0):!1)})}}const j1=ms("quill:toolbar");class Dh extends Or{constructor(e,n){var r,s;if(super(e,n),Array.isArray(this.options.container)){const a=document.createElement("div");a.setAttribute("role","toolbar"),aL(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)){j1.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 u;const i=(u=this.options.handlers)==null?void 0:u[a];i&&this.addHandler(a,i)}),Array.from(this.container.querySelectorAll("button, select")).forEach(a=>{this.attach(a)}),this.quill.on(se.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){j1.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 u=e.options[e.selectedIndex];u.hasAttribute("selected")?a=!1:a=u.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 we().retain(i.index).delete(i.length).insert({[n]:a}),se.sources.USER)}else this.quill.format(n,a,se.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 u=n[s];typeof u=="string"&&(u=u.replace(/"/g,'\\"')),i=a.querySelector(`option[value="${u}"]`)}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],u=i===a.getAttribute("value")||i!=null&&i.toString()===a.getAttribute("value")||i==null&&!a.getAttribute("value");a.classList.toggle("ql-active",u),a.setAttribute("aria-pressed",u.toString())}else{const i=n[s]!=null;a.classList.toggle("ql-active",i),a.setAttribute("aria-pressed",i.toString())}})}}Dh.DEFAULTS={};function $1(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 aL(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")$1(r,s);else{const a=Object.keys(s)[0],i=s[a];Array.isArray(i)?iL(r,a,i):$1(r,a,i)}}),t.appendChild(r)})}function iL(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)}Dh.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,Oe.INLINE)!=null&&this.quill.format(n,!1,se.sources.USER)})}else this.quill.removeFormat(t.index,t.length,se.sources.USER)},direction(t){const{align:e}=this.quill.getFormat();t==="rtl"&&e==null?this.quill.format("align","right",se.sources.USER):!t&&e==="right"&&this.quill.format("align",!1,se.sources.USER),this.quill.format("direction",t,se.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,se.sources.USER)}},link(t){t===!0&&(t=prompt("Enter link URL:")),this.quill.format("link",t,se.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,se.sources.USER):this.quill.format("list","unchecked",se.sources.USER):this.quill.format("list",t,se.sources.USER)}}};const uL='<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>',oL='<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>',lL='<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>',cL='<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>',fL='<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>',dL='<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>',hL='<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>',pL='<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>',mL='<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>',gL='<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>',bL='<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>',EL='<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>',vL='<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>',TL='<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>',_L='<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>',AL='<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>',yL='<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>',NL='<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>',SL='<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>',IL='<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>',CL='<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>',wL='<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>',LL='<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>',OL='<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>',RL='<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>',xL='<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>',DL='<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>',kL='<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>',PL='<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>',ML='<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>',BL='<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>',FL='<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>',Bu={align:{"":uL,center:oL,right:lL,justify:cL},background:fL,blockquote:dL,bold:hL,clean:pL,code:Y1,"code-block":Y1,color:mL,direction:{"":gL,rtl:bL},formula:EL,header:{1:vL,2:TL,3:_L,4:AL,5:yL,6:NL},italic:SL,image:IL,indent:{"+1":CL,"-1":wL},link:LL,list:{bullet:OL,check:RL,ordered:xL},script:{sub:DL,super:kL},strike:PL,table:ML,underline:BL,video:FL},UL='<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 z1=0;function W1(t,e){t.setAttribute(e,`${t.getAttribute(e)!=="true"}`)}class Yl{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=UL,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-${z1}`,z1+=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 wb extends Yl{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 Lb extends Yl{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 HL=t=>{const{overflowY:e}=getComputedStyle(t,null);return e!=="visible"&&e!=="clip"};class Ob{constructor(e,n){this.quill=e,this.boundsContainer=n||document.body,this.root=e.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,HL(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 u=a.bottom-a.top,o=e.bottom-e.top+u;this.root.style.top=`${r-o}px`,this.root.classList.add("ql-flip")}return i}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const qL=[!1,"center","right","justify"],jL=["#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"],$L=[!1,"serif","monospace"],YL=["1","2","3",!1],zL=["small",!1,"large","huge"];class io extends wi{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&&eu(s,qL),typeof n.align=="object"))return new Lb(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&&eu(s,jL,a==="background"?"#ffffff":"#000000"),new wb(s,n[a])}return s.querySelector("option")==null&&(s.classList.contains("ql-font")?eu(s,$L):s.classList.contains("ql-header")?eu(s,YL):s.classList.contains("ql-size")&&eu(s,zL)),new Yl(s)});const r=()=>{this.pickers.forEach(s=>{s.update()})};this.quill.on(Se.events.EDITOR_CHANGE,r)}}io.DEFAULTS=Fs({},wi.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 Rb extends Ob{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,Se.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",e,Se.sources.USER)),this.quill.root.scrollTop=n;break}case"video":e=WL(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,Se.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Se.sources.USER),this.quill.setSelection(r+2,Se.sources.USER)}break}}this.textbox.value="",this.hide()}}function WL(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 eu(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 GL=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class xb extends Rb{constructor(e,n){super(e,n),this.quill.on(Se.events.EDITOR_CHANGE,(r,s,a,i)=>{if(r===Se.events.SELECTION_CHANGE)if(s!=null&&s.length>0&&i===Se.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const u=this.quill.getLines(s.index,s.length);if(u.length===1){const o=this.quill.getBounds(s);o!=null&&this.position(o)}else{const o=u[u.length-1],f=this.quill.getIndex(o),h=Math.min(o.length()-1,s.index+s.length-f),g=this.quill.getBounds(new Na(f,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(Se.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}}Ee(xb,"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 Db extends io{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=GL),super(e,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(e){this.tooltip=new xb(this.quill,this.options.bounds),e.container!=null&&(this.tooltip.root.appendChild(e.container),this.buildButtons(e.container.querySelectorAll("button"),Bu),this.buildPickers(e.container.querySelectorAll("select"),Bu))}}Db.DEFAULTS=Fs({},io.DEFAULTS,{modules:{toolbar:{handlers:{link(t){t?this.quill.theme.tooltip.edit():this.quill.format("link",!1,se.sources.USER)}}}}});const KL=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class kb extends Rb{constructor(){super(...arguments);Ee(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,Se.sources.USER),delete this.linkRange}n.preventDefault(),this.hide()}),this.quill.on(Se.events.SELECTION_CHANGE,(n,r,s)=>{if(n!=null){if(n.length===0&&s===Se.sources.USER){const[a,i]=this.quill.scroll.descendant(Ds,n.index);if(a!=null){this.linkRange=new Na(n.index-i,a.length());const u=Ds.formats(a.domNode);this.preview.textContent=u,this.preview.setAttribute("href",u),this.show();const o=this.quill.getBounds(this.linkRange);o!=null&&this.position(o);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}Ee(kb,"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 Pb extends io{constructor(e,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=KL),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"),Bu),this.buildPickers(e.container.querySelectorAll("select"),Bu),this.tooltip=new kb(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)}))}}Pb.DEFAULTS=Fs({},io.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,se.sources.USER)}}}}});se.register({"attributors/attribute/direction":pb,"attributors/class/align":fb,"attributors/class/background":dw,"attributors/class/color":fw,"attributors/class/direction":mb,"attributors/class/font":Eb,"attributors/class/size":Tb,"attributors/style/align":db,"attributors/style/background":Ch,"attributors/style/color":Ih,"attributors/style/direction":gb,"attributors/style/font":vb,"attributors/style/size":_b},!0);se.register({"formats/align":fb,"formats/direction":mb,"formats/indent":nL,"formats/background":Ch,"formats/color":Ih,"formats/font":Eb,"formats/size":Tb,"formats/blockquote":fd,"formats/code-block":hn,"formats/header":dd,"formats/list":ao,"formats/bold":Mu,"formats/code":wh,"formats/italic":hd,"formats/link":Ds,"formats/script":pd,"formats/strike":md,"formats/underline":gd,"formats/formula":Ko,"formats/image":bd,"formats/video":Vo,"modules/syntax":Cb,"modules/table":sL,"modules/toolbar":Dh,"themes/bubble":Db,"themes/snow":Pb,"ui/icons":Bu,"ui/picker":Yl,"ui/icon-picker":Lb,"ui/color-picker":wb,"ui/tooltip":Ob},!0);const G1="/api/read?path=",Mb=/src="([^"]*)"/g,VL=/&nbsp;/g;function XL(t){return t===""||t.startsWith("/")||t.startsWith("data:")?!1:!/^[a-z][a-z0-9+.-]*:/i.test(t)}function K1(t,e){return t.replace(Mb,(n,r)=>XL(r)?`src="${eo(e,r)}"`:n)}function V1(t,e){const n=`content/${e===""?"":`${e}/`}`;return t.replace(Mb,(r,s)=>{const a=s.indexOf(G1);if(a===-1)return r;const i=decodeURIComponent(s.slice(a+G1.length));return i.startsWith(n)?`src="${i.slice(n.length)}"`:r}).replace(VL," ")}var QL=G('<div class="rte svelte-1afg4yo"><div></div></div>');function ZL(t,e){ct(e,!0);const n=se.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"]];wa(()=>{const d=new se(r,{theme:"bubble",modules:{toolbar:a},...e.placeholder!==void 0&&{placeholder:e.placeholder}});e.labelledBy!==void 0&&(d.root.setAttribute("aria-labelledby",e.labelledBy),d.root.setAttribute("aria-multiline","true"));const m=d.getModule("toolbar");m.addHandler("image",()=>o(d)),m.addHandler("link",()=>u(d));const b=T=>{T.preventDefault(),setTimeout(()=>i(d),0)};d.root.addEventListener("contextmenu",b),e.value&&d.clipboard.dangerouslyPasteHTML(K1(e.value,e.itemDir),"silent");const _=()=>e.onchange(V1(d.root.innerHTML,e.itemDir));return d.on("text-change",_),s=d,()=>{d.off("text-change",_),d.root.removeEventListener("contextmenu",b)}});function i(d){var T;const m=d.getSelection(!0);if(m===null)return;const b=d.theme,_=d.getBounds(m.index,m.length);((T=b.tooltip)==null?void 0:T.show)!==void 0&&b.tooltip.position!==void 0&&_&&(b.tooltip.show(),b.tooltip.position(_))}function u(d){const m=d.getSelection(!0);if(m===null)return;const b=d.getFormat(m).link??"";wg(b).then(_=>{if(_!==null)if(_==="")d.formatText(m.index,m.length,"link",!1,"user");else if(m.length>0)d.formatText(m.index,m.length,"link",_,"user");else{const T=Ou(_)?Kf(_):_;d.insertText(m.index,T,{link:_},"user")}})}function o(d){const m=document.createElement("input");m.type="file",m.accept="image/*",m.onchange=()=>{var _;const b=(_=m.files)==null?void 0:_[0];b&&f(d,b)},m.click()}async function f(d,m){try{const b=await ih(e.itemDir,m),_=d.getSelection(!0);d.insertEmbed(_.index,"image",eo(e.itemDir,b),"user"),d.setSelection(_.index+1,0)}catch(b){console.error("Inline image upload failed",b)}}Dt(()=>{const d=e.value;s&&V1(s.root.innerHTML,e.itemDir)!==d&&s.clipboard.dangerouslyPasteHTML(K1(d,e.itemDir),"silent")});var h=QL(),g=C(h);on(g,d=>r=d,()=>r),$(t,h),ft()}var JL=G('<span class="req svelte-1bn65uv" aria-hidden="true">*</span>'),eO=G('<textarea rows="3"></textarea>'),tO=G('<input type="date" class="svelte-1bn65uv"/>'),nO=G('<input type="time" class="svelte-1bn65uv"/>'),rO=G('<input type="email" class="svelte-1bn65uv"/>'),sO=G('<input type="tel" inputmode="tel" class="svelte-1bn65uv"/>'),aO=G('<input type="text" class="svelte-1bn65uv"/>'),iO=G('<p class="hint svelte-1bn65uv"> </p>'),uO=G("<p> </p>"),oO=G('<div class="field svelte-1bn65uv"><label class="field-label svelte-1bn65uv"> <!> <span class="type svelte-1bn65uv"> </span></label> <!> <!> <!></div>'),lO=G('<button type="button" class="restore svelte-1bn65uv">Restore to last opened</button>'),cO=G('<button type="button" class="icon-btn svelte-1bn65uv" title="Edit item (template, move, rename, delete)" aria-label="Edit item settings"><!></button>'),fO=G('<p class="hint svelte-1bn65uv">Loading fields…</p>'),dO=G('<p class="hint svelte-1bn65uv">This template defines no author fields beyond the title.</p>'),hO=G(`<details class="meta-section svelte-1bn65uv"><summary class="svelte-1bn65uv">Meta &amp; SEO</summary> <p class="meta-note svelte-1bn65uv">From the document shell, these fill every page's &lt;head&gt;.</p> <!></details>`),pO=G("<!> <!>",1),mO=G('<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),gO=G('<div><div class="form-pane svelte-1bn65uv"><form class="form svelte-1bn65uv"><header class="form-head svelte-1bn65uv"><div class="titles"><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 bO(t,e){ct(e,!0);const n=Jn(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=ee(!1);const i=()=>new Date().toISOString().slice(0,10);function u(){y(a,!c(a)),c(a)&&(c(E).published??"").trim()===""&&(c(E).published=i()),R()}let o=ee(!1),f=ee(Et([]));function h(){y(o,!0),e.onmove&&Bf().then(ve=>y(f,ve,!0))}async function g(ve){var He;ve!==e.templateName&&(await Y(),(He=e.onchangetemplate)==null||He.call(e,ve))}const d=Ae(()=>e.path.includes("/")?e.path.slice(0,e.path.lastIndexOf("/")):""),m=new Set(["richtext","image","file","authors"]);function b(ve){return m.has(ve.type)?void 0:`f-${ve.name}`}let _=ee(Et([])),T=ee(!0),E=ee(Et({})),O=ee(null);const L=700;let B,I=!1;wa(()=>{H();const ve=()=>void Y();return window.addEventListener("beforeunload",ve),()=>{window.removeEventListener("beforeunload",ve),Y()}});async function H(){y(T,!0);const[ve,He]=await Promise.all([my(e.templateName),by()]),Je=ve.filter(Ye=>Ye.name!=="title"&&Ye.name!=="published"),Qe=new Set(Je.map(Ye=>Ye.name)),ce=He.filter(Ye=>Ye.name!=="published"&&!Qe.has(Ye.name)),It=[r,s,...Je,...ce],$e={};for(const Ye of It)$e[Ye.name]=jy(e.item,Ye.name);$e.published=($e.published??"").slice(0,10),y(a,e.item.isPublished,!0),y(_,It,!0),y(F,Je,!0),y(k,ce,!0),y(E,$e,!0),lN(localStorage,e.path,$e),y(O,cN(localStorage,e.path),!0),y(T,!1)}function R(){I=!0,clearTimeout(B),B=setTimeout(()=>void Y(),L)}function q(ve,He){const Je=c(E)[ve]??"";c(E)[ve]=He,R(),Je!==""&&Je!==He&&Q(Je)}async function Q(ve){if(/^(\/|[a-z][a-z0-9+.-]*:)/i.test(ve))return;Object.values(c(E)).some(Je=>typeof Je=="string"&&Je.includes(ve))||await Ny(c(d),ve)}async function Y(){var He;if(clearTimeout(B),!I)return;const ve=$0(e.item,c(_),c(E),c(a));ys.saving();try{await mg(e.path,ve),I=!1,ys.saved(),(He=e.onsaved)==null||He.call(e,e.path,c(E).title??e.item.title,c(a))}catch{ys.failed(()=>void Y())}}async function v(){c(O)===null||!await dl("Restore this item to when you opened it? Edits since then will be lost.",{title:"Restore item",confirmLabel:"Restore",danger:!0})||(y(E,{...c(O)},!0),R())}const M=new Set(["text","code"]);function S(ve,He){return ve.maxLength!==void 0&&ve.minLength!==void 0?`${He} / ${ve.maxLength} characters (min ${ve.minLength})`:ve.maxLength!==void 0?`${He} / ${ve.maxLength} characters`:`${He} characters (min ${ve.minLength})`}function U(ve,He){return ve.minLength!==void 0&&He>0&&He<ve.minLength?!0:ve.maxLength!==void 0&&He>ve.maxLength}let F=ee(Et([])),k=ee(Et([]));const V=Ae(()=>c(O)!==null&&JSON.stringify(c(E))!==JSON.stringify(c(O))),z="nanoesis:preview-open";let j=ee(localStorage.getItem(z)==="true");function X(ve){y(j,ve,!0),localStorage.setItem(z,String(ve))}const J=Ae(()=>{if(c(T))return null;try{return{...Qu(JSON.parse($0(e.item,c(_),c(E),c(a)))),template:e.templateName}}catch{return null}}),ne="nanoesis:preview-split",le=.2,be=.8;function pe(ve){return Math.min(be,Math.max(le,ve))}function Re(){const ve=Number(localStorage.getItem(ne));return Number.isFinite(ve)&&ve>0?pe(ve):.5}let ue=ee(Et(Re())),me=ee(!1),Ne;function _e(ve){ve.preventDefault(),y(me,!0),ve.currentTarget.setPointerCapture(ve.pointerId)}function ye(ve){if(!c(me))return;const He=Ne.getBoundingClientRect();y(ue,pe((ve.clientX-He.left)/He.width),!0)}function Ie(ve){var He,Je;c(me)&&(y(me,!1),(Je=(He=ve.currentTarget).releasePointerCapture)==null||Je.call(He,ve.pointerId),localStorage.setItem(ne,String(c(ue))))}function Ue(ve){const He=ve.key==="ArrowLeft"?-.02:ve.key==="ArrowRight"?.02:0;He!==0&&(ve.preventDefault(),y(ue,pe(c(ue)+He),!0),localStorage.setItem(ne,String(c(ue))))}var We=gO(),Ge=pt(We);let zt;var Ke=C(Ge),Bt=C(Ke);{const ve=(Qe,ce=_d)=>{var It=oO(),$e=C(It),Ye=C($e),_t=x(Ye);{var Jt=Pe=>{var Le=JL();$(Pe,Le)};he(_t,Pe=>{ce().required&&Pe(Jt)})}var Pn=x(_t,2),Lt=C(Pn),Ot=x($e,2);{var ot=Pe=>{{let Le=Ae(()=>c(E)[ce().name]??""),et=Ae(()=>`lbl-${ce().name}`);ZL(Pe,{get value(){return c(Le)},get itemDir(){return c(d)},get labelledBy(){return c(et)},placeholder:"Write…",onchange:jt=>{c(E)[ce().name]=jt,R()}})}},Gt=Pe=>{var Le=eO();let et;oe(()=>{ge(Le,"id",`f-${ce().name}`),ge(Le,"maxlength",ce().maxLength),ge(Le,"minlength",ce().minLength),et=it(Le,1,"svelte-1bn65uv",null,et,{mono:ce().type==="code"})}),ae("input",Le,R),bt(Le,()=>c(E)[ce().name],jt=>c(E)[ce().name]=jt),$(Pe,Le)},qt=Ae(()=>M.has(ce().type)),Ct=Pe=>{{let Le=Ae(()=>c(E)[ce().name]??""),et=Ae(()=>`lbl-${ce().name}`);MN(Pe,{get value(){return c(Le)},get itemDir(){return c(d)},get labelledBy(){return c(et)},onchange:jt=>q(ce().name,jt)})}},or=Pe=>{{let Le=Ae(()=>c(E)[ce().name]??""),et=Ae(()=>`lbl-${ce().name}`);RN(Pe,{get value(){return c(Le)},get itemDir(){return c(d)},get labelledBy(){return c(et)},onchange:jt=>{c(E)[ce().name]=jt,R()}})}},yn=Pe=>{{let Le=Ae(()=>c(E)[ce().name]??""),et=Ae(()=>`lbl-${ce().name}`);AN(Pe,{get value(){return c(Le)},get labelledBy(){return c(et)},onchange:jt=>{c(E)[ce().name]=jt,R()}})}},kt=Pe=>{{let Le=Ae(()=>c(E)[ce().name]??""),et=Ae(()=>`lbl-${ce().name}`);e6(Pe,{get value(){return c(Le)},get labelledBy(){return c(et)},onchange:jt=>{c(E)[ce().name]=jt,R()}})}},Ks=Pe=>{var Le=tO();oe(()=>ge(Le,"id",`f-${ce().name}`)),ae("input",Le,R),bt(Le,()=>c(E)[ce().name],et=>c(E)[ce().name]=et),$(Pe,Le)},Vs=Pe=>{var Le=nO();oe(()=>ge(Le,"id",`f-${ce().name}`)),ae("input",Le,R),bt(Le,()=>c(E)[ce().name],et=>c(E)[ce().name]=et),$(Pe,Le)},Pi=Pe=>{var Le=rO();oe(()=>{ge(Le,"id",`f-${ce().name}`),ge(Le,"maxlength",ce().maxLength),ge(Le,"minlength",ce().minLength)}),ae("input",Le,R),bt(Le,()=>c(E)[ce().name],et=>c(E)[ce().name]=et),$(Pe,Le)},Mi=Pe=>{var Le=sO();oe(()=>{ge(Le,"id",`f-${ce().name}`),ge(Le,"maxlength",ce().maxLength),ge(Le,"minlength",ce().minLength)}),ae("input",Le,R),bt(Le,()=>c(E)[ce().name],et=>c(E)[ce().name]=et),$(Pe,Le)},Bi=Pe=>{var Le=aO();oe(()=>{ge(Le,"id",`f-${ce().name}`),ge(Le,"maxlength",ce().maxLength),ge(Le,"minlength",ce().minLength)}),ae("input",Le,R),bt(Le,()=>c(E)[ce().name],et=>c(E)[ce().name]=et),$(Pe,Le)};he(Ot,Pe=>{ce().type==="richtext"?Pe(ot):c(qt)?Pe(Gt,1):ce().type==="image"?Pe(Ct,2):ce().type==="file"?Pe(or,3):ce().type==="authors"?Pe(yn,4):ce().type==="url"?Pe(kt,5):ce().type==="date"?Pe(Ks,6):ce().type==="time"?Pe(Vs,7):ce().type==="email"?Pe(Pi,8):ce().type==="phone"?Pe(Mi,9):Pe(Bi,-1)})}var en=x(Ot,2);{var Fi=Pe=>{var Le=iO(),et=C(Le);oe(()=>de(et,ce().help)),$(Pe,Le)};he(en,Pe=>{ce().help&&Pe(Fi)})}var Ui=x(en,2);{var Hi=Pe=>{const Le=Ae(()=>(c(E)[ce().name]??"").length);var et=uO();let jt;var gs=C(et);oe(($n,Xs)=>{jt=it(et,1,"hint count svelte-1bn65uv",null,jt,$n),de(gs,Xs)},[()=>({over:U(ce(),c(Le))}),()=>S(ce(),c(Le))]),$(Pe,et)};he(Ui,Pe=>{(ce().minLength!==void 0||ce().maxLength!==void 0)&&Pe(Hi)})}oe(Pe=>{ge($e,"id",`lbl-${ce().name}`),ge($e,"for",Pe),de(Ye,`${ce().label??""} `),de(Lt,ce().multiple?"references":ce().type)},[()=>b(ce())]),$(Qe,It)};var Qt=C(Bt),Ft=C(Qt),Zt=C(Ft),xn=x(Zt,2),Wt=C(xn),Ut=x(Ft,2),Z=C(Ut),Te=C(Z);{var Ce=Qe=>{var ce=lO();ae("click",ce,v),$(Qe,ce)};he(Te,Qe=>{c(V)&&Qe(Ce)})}var ke=x(Te,2);{var Xe=Qe=>{var ce=cO(),It=C(ce);ch(It,{size:16,"aria-hidden":"true"}),ae("click",ce,h),$(Qe,ce)};he(ke,Qe=>{e.onchangetemplate&&Qe(Xe)})}var Me=x(ke,2);let He;var gt=x(Me,2);let Je;var Ht=C(gt),Dn=x(Z,2),mn=x(C(Dn),2),gn=x(Qt,2);{var kn=Qe=>{var ce=fO();$(Qe,ce)},Rr=Qe=>{var ce=dO();$(Qe,ce)},ur=Qe=>{var ce=pO(),It=pt(ce);wt(It,17,()=>c(F),_t=>_t.name,(_t,Jt)=>{ve(_t,()=>c(Jt))});var $e=x(It,2);{var Ye=_t=>{var Jt=hO(),Pn=x(C(Jt),4);wt(Pn,17,()=>c(k),Lt=>Lt.name,(Lt,Ot)=>{ve(Lt,()=>c(Ot))}),$(_t,Jt)};he($e,_t=>{c(k).length>0&&_t(Ye)})}$(Qe,ce)};he(gn,Qe=>{c(T)?Qe(kn):c(F).length===0&&c(k).length===0?Qe(Rr,1):Qe(ur,-1)})}oe(()=>{de(Wt,e.templateName),He=it(Me,1,"preview-toggle svelte-1bn65uv",null,He,{active:c(j)}),ge(Me,"aria-pressed",c(j)),Je=it(gt,1,"publish-btn svelte-1bn65uv",null,Je,{on:c(a)}),ge(gt,"aria-pressed",c(a)),ge(gt,"title",c(a)?"This page will be published. Click to keep it off the live site.":"This page is not published. Click to publish it."),de(Ht,c(a)?"Publish":"Don't Publish")}),ae("input",Zt,R),bt(Zt,()=>c(E).title,Qe=>c(E).title=Qe),ae("click",Me,()=>X(!c(j))),ae("click",gt,u),ae("input",mn,R),bt(mn,()=>c(E).published,Qe=>c(E).published=Qe)}var bn=x(Ke,2);{var xr=ve=>{var He=mO(),Je=pt(He),Qe=x(Je,2),ce=C(Qe);i6(ce,{get path(){return e.path},get previewItem(){return c(J)},onclose:()=>X(!1)}),oe((It,$e,Ye)=>{ge(Je,"aria-valuemin",It),ge(Je,"aria-valuemax",$e),ge(Je,"aria-valuenow",Ye)},[()=>Math.round(le*100),()=>Math.round(be*100),()=>Math.round(c(ue)*100)]),ae("pointerdown",Je,_e),ae("pointermove",Je,ye),ae("pointerup",Je,Ie),Be("pointercancel",Je,Ie),ae("keydown",Je,Ue),$(ve,He)};he(bn,ve=>{c(j)&&ve(xr)})}on(Ge,ve=>Ne=ve,()=>Ne);var Zr=x(Ge,2);{var jn=ve=>{{let He=Ae(()=>e.onrename?()=>(y(o,!1),e.onrename()):void 0),Je=Ae(()=>e.ondelete?()=>(y(o,!1),e.ondelete()):void 0),Qe=Ae(()=>e.onmove?ce=>(y(o,!1),e.onmove(ce)):void 0);WN(ve,{get templateName(){return e.templateName},get templates(){return n()},get currentFolder(){return c(d)},get folders(){return c(f)},onchangetemplate:ce=>{y(o,!1),g(ce)},get onrename(){return c(He)},get ondelete(){return c(Je)},get onmove(){return c(Qe)},onclose:()=>y(o,!1)})}};he(Zr,ve=>{c(o)&&e.onchangetemplate&&ve(jn)})}oe(()=>{zt=it(Ge,1,"layout svelte-1bn65uv",null,zt,{split:c(j),dragging:c(me)}),em(Ke,c(j)?`flex-basis:${c(ue)*100}%`:void 0)}),Be("submit",Bt,ve=>ve.preventDefault()),ae("focusout",Bt,()=>void Y()),$(t,We),ft()}Tt(["focusout","input","click","pointerdown","pointermove","pointerup","keydown"]);const Bb=""+new URL("nanoesis-logo-CgieIWPg.png",import.meta.url).href,EO="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 _u=ee("idle"),Xo=ee(Et([])),Qo=ee(Et([])),Yc=ee(!1),zc;async function X1(){y(_u,"checking");try{const t=await vy();y(Xo,[...t.errors],!0),y(Qo,[...t.warnings],!0),y(_u,"done")}catch{y(_u,"error")}}const fn={get status(){return c(_u)},get errors(){return c(Xo)},get warnings(){return c(Qo)},get count(){return c(Xo).length+c(Qo).length},get hasProblems(){return c(_u)==="done"&&c(Xo).length+c(Qo).length>0},get panelOpen(){return c(Yc)},refresh(){return clearTimeout(zc),X1()},scheduleRefresh(t=1200){clearTimeout(zc),zc=setTimeout(()=>void X1(),t)},openPanel(){y(Yc,!0)},closePanel(){y(Yc,!1)}};var vO=G('<button type="button" class="retry svelte-jz8lnl">Retry</button>'),TO=G('<button type="button" class="problems svelte-jz8lnl"> </button>'),_O=G('<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 AO(t,e){ct(e,!0);const n=Ae(()=>ys.state==="saving"?"Saving…":ys.state==="error"?"Save failed":"Saved");Dt(()=>{th.value,fn.scheduleRefresh()});const r=Ae(()=>fn.count),s="https://xtrable.com/";var a=_O();let i;var u=C(a),o=C(u),f=x(o,2),h=x(C(f));ge(h,"href",s);var g=x(u,2);let d;var m=C(g),b=C(m),_=x(m,2);{var T=I=>{var H=vO();ae("click",H,()=>ys.retry()),$(I,H)};he(_,I=>{ys.canRetry&&I(T)})}var E=x(g,2);{var O=I=>{var H=TO(),R=C(H);oe(()=>de(R,`${c(r)??""}
115
- ${c(r)===1?"problem":"problems"}`)),ae("click",H,()=>fn.openPanel()),$(I,H)};he(E,I=>{fn.hasProblems&&I(O)})}var L=x(E,2);ge(L,"href",s);var B=C(L);oe(()=>{i=it(a,1,"footer svelte-jz8lnl",null,i,{"has-problems":fn.hasProblems}),ge(o,"src",Bb),d=it(g,1,"save svelte-jz8lnl",null,d,{error:ys.state==="error"}),de(b,c(n)),ge(B,"src",EO)}),$(t,a),ft()}Tt(["click"]);var yO=G("<option> </option>"),NO=G("<option>Top level</option>"),SO=G("<option> </option>"),IO=G('<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>'),CO=G(`<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
116
- page’s title.</p></div>`),wO=G('<p class="error svelte-1uvxo8j" role="alert"> </p>'),LO=G('<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 OO(t,e){ct(e,!0);const n=Jn(e,"folders",19,()=>[]);let r=ee(""),s=ee(!0),a=ee(null),i;const u=Ae(()=>e.folderPath.includes("/")?e.folderPath.slice(0,e.folderPath.lastIndexOf("/")):""),o=Ae(()=>n().filter(S=>S!==e.folderPath&&S!==c(u)&&!S.startsWith(`${e.folderPath}/`))),f=" ";let h=ee(f);wa(()=>{i.showModal(),Oy(e.folderPath).then(S=>{y(r,S,!0)}).finally(()=>{y(s,!1)})});async function g(S){S.preventDefault(),y(a,null);try{await Ry(e.folderPath,c(r)),e.onsaved()}catch(U){y(a,U instanceof Error?U.message:String(U),!0)}}var d=LO(),m=C(d),b=x(C(m),2),_=C(b),T=x(b,2),E=x(C(T),2),O=C(E);O.value=O.__value="";var L=x(O);wt(L,16,()=>e.templates,S=>S,(S,U)=>{var F=yO(),k=C(F),V={};oe(()=>{de(k,U),V!==(V=U)&&(F.value=(F.__value=U)??"")}),$(S,F)});var B=x(T,2);{var I=S=>{var U=IO(),F=x(C(U),2),k=C(F),V=x(C(k),2),z=C(V);z.value=z.__value=f;var j=x(z);{var X=le=>{var be=NO();be.value=be.__value="",$(le,be)};he(j,le=>{c(u)!==""&&le(X)})}var J=x(j);wt(J,16,()=>c(o),le=>le,(le,be)=>{var pe=SO(),Re=C(pe),ue={};oe(()=>{de(Re,`${be??""}/`),ue!==(ue=be)&&(pe.value=(pe.__value=be)??"")}),$(le,pe)});var ne=x(k,2);oe(()=>ne.disabled=c(h)===f),Ta(V,()=>c(h),le=>y(h,le)),ae("click",ne,()=>e.onmove(c(h))),$(S,U)};he(B,S=>{e.onmove&&S(I)})}var H=x(B,2);{var R=S=>{var U=CO(),F=x(C(U),2),k=C(F),V=x(k,2),z=x(V,2);ae("click",k,function(...j){var X;(X=e.onnewsubfolder)==null||X.apply(this,j)}),ae("click",V,function(...j){var X;(X=e.onrenamefolder)==null||X.apply(this,j)}),ae("click",z,function(...j){var X;(X=e.ondeletefolder)==null||X.apply(this,j)}),$(S,U)};he(H,S=>{e.folderPath!==""&&S(R)})}var q=x(H,2);{var Q=S=>{var U=wO(),F=C(U);oe(()=>de(F,c(a))),$(S,U)};he(q,S=>{c(a)&&S(Q)})}var Y=x(q,2),v=C(Y),M=x(v,2);on(d,S=>i=S,()=>i),oe(()=>{de(_,e.folderPath===""?"/ (root)":`${e.folderPath}/`),E.disabled=c(s),M.disabled=c(s)}),Be("cancel",d,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),Be("close",d,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),Be("submit",m,g),Ta(E,()=>c(r),S=>y(r,S)),ae("click",v,function(...S){var U;(U=e.oncancel)==null||U.apply(this,S)}),$(t,d),ft()}Tt(["click"]);var RO=G("<option></option>"),xO=G("<option> </option>"),DO=G('<p class="error svelte-1t0ew8l" role="alert"> </p>'),kO=G('<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 PO(t,e){ct(e,!0);let n=ee(""),r=ee(""),s=ee(""),a=ee(""),i=!1,u=ee(null),o;wa(()=>o.showModal());function f(){i||y(r,os(c(n)),!0)}async function h(M){M.preventDefault(),y(u,null);const S=os(c(r)||c(n));if(S===""){y(u,"A title or slug is required.");return}const U=c(s).split("/").map(k=>os(k)).filter(k=>k!=="").join("/"),F=U===""?S:`${U}/${S}`;try{await Tg(F,c(n).trim()||S,c(a)),e.oncreated(F)}catch(k){y(u,k instanceof Error?k.message:String(k),!0)}}var g=kO(),d=C(g),m=x(C(d),2),b=x(C(m),2);gi(b,!0);var _=x(m,2),T=x(C(_),2),E=x(_,2),O=x(C(E),2),L=x(O,2);wt(L,20,()=>e.folders,M=>M,(M,S)=>{var U=RO(),F={};oe(()=>{F!==(F=S)&&(U.value=(U.__value=S)??"")}),$(M,U)});var B=x(E,2),I=x(C(B),2),H=C(I);H.value=H.__value="";var R=x(H);wt(R,16,()=>e.templates,M=>M,(M,S)=>{var U=xO(),F=C(U),k={};oe(()=>{de(F,S),k!==(k=S)&&(U.value=(U.__value=S)??"")}),$(M,U)});var q=x(B,2);{var Q=M=>{var S=DO(),U=C(S);oe(()=>de(U,c(u))),$(M,S)};he(q,M=>{c(u)&&M(Q)})}var Y=x(q,2),v=C(Y);on(g,M=>o=M,()=>o),oe(M=>ge(T,"placeholder",M),[()=>os(c(n))||"my-item"]),Be("cancel",g,function(...M){var S;(S=e.oncancel)==null||S.apply(this,M)}),Be("close",g,function(...M){var S;(S=e.oncancel)==null||S.apply(this,M)}),Be("submit",d,h),ae("input",b,f),bt(b,()=>c(n),M=>y(n,M)),ae("input",T,()=>i=!0),bt(T,()=>c(r),M=>y(r,M)),bt(O,()=>c(s),M=>y(s,M)),Ta(I,()=>c(a),M=>y(a,M)),ae("click",v,function(...M){var S;(S=e.oncancel)==null||S.apply(this,M)}),$(t,g),ft()}Tt(["input","click"]);var MO=G("<option> </option>"),BO=G(`<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
117
- 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 FO(t,e){ct(e,!0);const n=Ae(()=>e.folderPath===""?"/":`/${e.folderPath}/`);let r=ee(""),s=ee(!1);function a(){y(s,!0),e.oncreate(c(r))}var i=BO(),u=C(i),o=C(u),f=C(o),h=x(o,2),g=x(C(h)),d=C(g),m=x(h,2),b=x(C(m),2),_=C(b);_.value=_.__value="";var T=x(_);wt(T,16,()=>e.templates,L=>L,(L,B)=>{var I=MO(),H=C(I),R={};oe(()=>{de(H,B),R!==(R=B)&&(I.value=(I.__value=B)??"")}),$(L,I)});var E=x(m,2),O=C(E);oe(()=>{de(f,e.name),de(d,c(n)),b.disabled=c(s),E.disabled=c(s),de(O,c(s)?"Creating…":"Create page")}),Ta(b,()=>c(r),L=>y(r,L)),ae("click",E,a),$(t,i),ft()}Tt(["click"]);const Fb="nanoesis:sidebar-width",UO=180,HO=560,qO=260;function Ub(t){return Math.min(HO,Math.max(UO,Math.round(t)))}function jO(){const t=Number(localStorage.getItem(Fb));return Number.isFinite(t)&&t>0?Ub(t):qO}let bl=jO();function Hb(){typeof document<"u"&&document.documentElement.style.setProperty("--tree-width",`${bl}px`)}Hb();function $O(){return bl}function YO(t){bl=Ub(t),Hb(),localStorage.setItem(Fb,String(bl))}var zO=G('<div role="separator" aria-orientation="vertical" aria-label="Resize sidebar" tabindex="0"><span class="grip svelte-1jo2gqq"></span></div>');function WO(t,e){ct(e,!0);let n=ee(null);function r(o){o.preventDefault(),o.currentTarget.setPointerCapture(o.pointerId),y(n,{startX:o.clientX,startWidth:$O()},!0)}function s(o){c(n)!==null&&YO(c(n).startWidth+(o.clientX-c(n).startX))}function a(o){var f,h;c(n)!==null&&((h=(f=o.currentTarget).releasePointerCapture)==null||h.call(f,o.pointerId),y(n,null))}var i=zO();let u;oe(()=>u=it(i,1,"resizer svelte-1jo2gqq",null,u,{dragging:c(n)!==null})),ae("pointerdown",i,r),ae("pointermove",i,s),ae("pointerup",i,a),Be("pointercancel",i,a),$(t,i),ft()}Tt(["pointerdown","pointermove","pointerup"]);var GO=G(`<small class="hint-error svelte-fna247">Doesn't match the new password above.</small>`),KO=G('<p class="error svelte-fna247" role="alert"> </p>'),VO=G('<p class="success svelte-fna247" role="status">Password updated.</p>'),XO=G('<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 QO(t,e){ct(e,!0);let n=Jn(e,"open",15),r=ee(void 0),s=ee(""),a=ee(""),i=ee(""),u=ee(!1),o=ee(null),f=ee(!1);Dt(()=>{c(r)&&(n()&&!c(r).open?(y(s,""),y(a,""),y(i,""),y(o,null),y(f,!1),y(u,!1),c(r).showModal()):!n()&&c(r).open&&c(r).close())});let h=Ae(()=>c(a)!==""&&c(i)!==""&&c(a)!==c(i)),g=Ae(()=>!c(u)&&c(s)!==""&&c(a)!==""&&!c(h));async function d(k){if(k.preventDefault(),!c(g))return;y(u,!0),y(o,null);const V=await ht.changePassword(c(s),c(a));if(y(u,!1),!V.ok){const z=V.error??"Password change failed.";y(o,z.includes("credentials")?"Current password is incorrect.":z,!0);return}y(f,!0),setTimeout(()=>{n(!1)},900)}function m(k){k.preventDefault(),n(!1)}var b=XO(),_=x(C(b),4),T=C(_),E=x(C(T),2),O=x(T,2),L=x(C(O),2),B=x(O,2),I=x(C(B),2),H=x(I,2);{var R=k=>{var V=GO();$(k,V)};he(H,k=>{c(h)&&k(R)})}var q=x(B,2);{var Q=k=>{var V=KO(),z=C(V);oe(()=>de(z,c(o))),$(k,V)};he(q,k=>{c(o)&&k(Q)})}var Y=x(q,2);{var v=k=>{var V=VO();$(k,V)};he(Y,k=>{c(f)&&k(v)})}var M=x(Y,2),S=C(M),U=x(S,2),F=C(U);on(b,k=>y(r,k),()=>c(r)),oe(()=>{U.disabled=!c(g),de(F,c(u)?"Updating…":"Update password")}),Be("cancel",b,m),Be("submit",_,d),bt(E,()=>c(s),k=>y(s,k)),bt(L,()=>c(a),k=>y(a,k)),bt(I,()=>c(i),k=>y(i,k)),ae("click",S,()=>n(!1)),$(t,b),ft()}Tt(["click"]);var ZO=G(`<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),JO=G('<p class="error svelte-szf2lz" role="alert"> </p>'),e8=G('<p class="success svelte-szf2lz" role="status">All your MCP tokens were revoked.</p>'),t8=G('<!> <!> <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),n8=G(`<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
118
- role. Paste it into your client's config as a Bearer token. It keeps working after you sign out,
119
- so treat it like a password.</p> <!></dialog>`);function r8(t,e){ct(e,!0);let n=Jn(e,"open",15),r=ee(void 0),s=ee(!1),a=ee(null),i=ee(null),u=ee(null),o=ee(!1),f=ee(!1);Dt(()=>{c(r)&&(n()&&!c(r).open?(y(s,!1),y(a,null),y(i,null),y(u,null),y(o,!1),y(f,!1),c(r).showModal()):!n()&&c(r).open&&c(r).close())});let h=Ae(()=>c(u)===null?"":new Date(c(u)).toLocaleDateString());async function g(){y(s,!0),y(a,null),y(f,!1),y(o,!1);const B=await ht.createMcpToken();if(y(s,!1),!B.ok||B.token===void 0){y(a,B.error??"Could not create a token.",!0);return}y(i,B.token,!0),y(u,B.expiresAt??null,!0)}async function d(){if(c(i)!==null)try{await navigator.clipboard.writeText(c(i)),y(o,!0)}catch{y(o,!1)}}async function m(){y(s,!0),y(a,null);const B=await ht.revokeMcpTokens();if(y(s,!1),!B.ok){y(a,B.error??"Could not revoke tokens.",!0);return}y(i,null),y(u,null),y(f,!0)}function b(B){var I;(I=B.currentTarget)==null||I.select()}function _(B){B.preventDefault(),n(!1)}var T=n8(),E=x(C(T),4);{var O=B=>{var I=ZO(),H=pt(I),R=C(H),q=C(R),Q=x(R,2),Y=x(H,4),v=C(Y),M=x(v,2),S=C(M);oe(()=>{de(q,`Your new token${c(h)?` · expires ${c(h)}`:""}`),Uv(Q,c(i)),de(S,c(o)?"Copied":"Copy token")}),ae("click",Q,b),ae("click",v,()=>n(!1)),ae("click",M,d),$(B,I)},L=B=>{var I=t8(),H=pt(I);{var R=F=>{var k=JO(),V=C(k);oe(()=>de(V,c(a))),$(F,k)};he(H,F=>{c(a)&&F(R)})}var q=x(H,2);{var Q=F=>{var k=e8();$(F,k)};he(q,F=>{c(f)&&F(Q)})}var Y=x(q,2),v=C(Y),M=x(v,4),S=x(M,2),U=C(S);oe(()=>{v.disabled=c(s),S.disabled=c(s),de(U,c(s)?"Working…":"Create token")}),ae("click",v,m),ae("click",M,()=>n(!1)),ae("click",S,g),$(B,I)};he(E,B=>{c(i)!==null?B(O):B(L,-1)})}on(T,B=>y(r,B),()=>c(r)),Be("cancel",T,_),$(t,T),ft()}Tt(["click"]);var s8=G('<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 a8(t,e){ct(e,!0);let n=ee(!1),r=ee(!1),s=Ae(()=>{var m;return((m=ht.principal)==null?void 0:m.username)??""});function a(){c(f)&&(c(f).open=!1)}function i(){a(),y(n,!0)}function u(){a(),y(r,!0)}async function o(){a(),await ht.logout()}let f=ee(void 0);Dt(()=>{function m(b){c(f)&&c(f).open&&!c(f).contains(b.target)&&(c(f).open=!1)}return document.addEventListener("click",m),()=>document.removeEventListener("click",m)});var h=vr(),g=pt(h);{var d=m=>{var b=s8(),_=pt(b),T=C(_),E=C(T),O=C(E),L=x(T,2),B=C(L),I=C(B),H=x(B,2),R=C(H),q=x(H,2),Q=C(q);on(_,M=>y(f,M),()=>c(f));var Y=x(_,2);QO(Y,{get open(){return c(n)},set open(M){y(n,M,!0)}});var v=x(Y,2);r8(v,{get open(){return c(r)},set open(M){y(r,M,!0)}}),oe(()=>de(O,c(s))),ae("click",I,i),ae("click",R,u),ae("click",Q,o),$(m,b)};he(g,m=>{ht.status==="authenticated"&&ht.principal!==null&&m(d)})}$(t,h),ft()}Tt(["click"]);var i8=G('<p class="error svelte-1e3birj" role="alert"> </p>'),u8=G('<p class="ok svelte-1e3birj" role="status"> </p>'),o8=G('<img alt="Current logo" class="svelte-1e3birj"/>'),l8=G('<span class="preview-empty svelte-1e3birj">No custom logo</span>'),c8=G('<button type="button" class="ghost danger svelte-1e3birj">Remove</button>'),f8=G(`<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
120
- 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 d8(t,e){ct(e,!0);let n=ee(Et(Tn.name??"")),r=ee(!1),s=ee(!1),a=ee(null),i=ee(null),u=ee(void 0);function o(z){y(i,z,!0),setTimeout(()=>y(i,null),1500)}async function f(){y(r,!0),y(a,null);const z=c(n).trim(),j=await YA(z===""?null:z);if(y(r,!1),!j.ok){y(a,j.error,!0);return}await Tn.load(),o("Name saved.")}async function h(z){var ne;const j=z.currentTarget,X=(ne=j.files)==null?void 0:ne[0];if(X===void 0)return;y(s,!0),y(a,null);const J=await zA(X);if(y(s,!1),j.value="",!J.ok){y(a,J.error,!0);return}await Tn.load(),o("Logo updated.")}async function g(){y(a,null);const z=await WA();if(!z.ok){y(a,z.error,!0);return}await Tn.load(),o("Logo removed.")}var d=f8(),m=x(C(d),2);{var b=z=>{var j=i8(),X=C(j);oe(()=>de(X,c(a))),$(z,j)};he(m,z=>{c(a)&&z(b)})}var _=x(m,2);{var T=z=>{var j=u8(),X=C(j);oe(()=>de(X,c(i))),$(z,j)};he(_,z=>{c(i)&&z(T)})}var E=x(_,2),O=x(C(E),2),L=C(O),B=x(L,2),I=C(B),H=x(E,2),R=x(C(H),2),q=C(R),Q=C(q);{var Y=z=>{var j=o8();oe(()=>ge(j,"src",Tn.logoUrl)),$(z,j)},v=z=>{var j=l8();$(z,j)};he(Q,z=>{Tn.logoUrl?z(Y):z(v,-1)})}var M=x(q,2),S=C(M);on(S,z=>y(u,z),()=>c(u));var U=x(S,2),F=C(U),k=x(U,2);{var V=z=>{var j=c8();ae("click",j,g),$(z,j)};he(k,z=>{Tn.logoUrl&&z(V)})}oe(()=>{B.disabled=c(r),de(I,c(r)?"Saving…":"Save"),ge(q,"aria-hidden",Tn.logoUrl===null),U.disabled=c(s),de(F,c(s)?"Uploading…":Tn.logoUrl?"Replace logo…":"Upload logo…")}),bt(L,()=>c(n),z=>y(n,z)),ae("click",B,f),ae("change",S,h),ae("click",U,()=>{var z;return(z=c(u))==null?void 0:z.click()}),$(t,d),ft()}Tt(["click","change"]);var h8=G('<p class="error svelte-8ydvuj" role="alert"> </p>'),p8=G('<p class="ok svelte-8ydvuj" role="status"> </p>'),m8=G(`<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 g8(t,e){ct(e,!0);let n=ee(""),r=ee(!0),s=ee(!1),a=ee(null),i=ee(null);Fy().then(L=>{y(n,L.baseUrl,!0),y(r,!1)});function u(L){y(i,L,!0),setTimeout(()=>y(i,null),1500)}async function o(){y(s,!0),y(a,null);try{await Uy({baseUrl:c(n)}),u("Saved.")}catch(L){y(a,L instanceof Error?L.message:String(L),!0)}finally{y(s,!1)}}var f=m8(),h=x(C(f),2);{var g=L=>{var B=h8(),I=C(B);oe(()=>de(I,c(a))),$(L,B)};he(h,L=>{c(a)&&L(g)})}var d=x(h,2);{var m=L=>{var B=p8(),I=C(B);oe(()=>de(I,c(i))),$(L,B)};he(d,L=>{c(i)&&L(m)})}var b=x(d,2),_=x(C(b),2),T=C(_),E=x(T,2),O=C(E);oe(()=>{T.disabled=c(r),E.disabled=c(r)||c(s),de(O,c(s)?"Saving…":"Save")}),bt(T,()=>c(n),L=>y(n,L)),ae("click",E,o),$(t,f),ft()}Tt(["click"]);async function b8(){const t=await mt("/api/users");if(!t.ok)throw new Error(`Couldn't load users (HTTP ${t.status}).`);return await t.json()}const kh={"content-type":"application/json"};function E8(t){return Oa("/api/users",{method:"POST",headers:kh,body:JSON.stringify(t)})}function Q1(t,e){return Oa(`/api/users/${encodeURIComponent(t)}`,{method:"PATCH",headers:kh,body:JSON.stringify(e)})}function v8(t,e){return Oa(`/api/users/${encodeURIComponent(t)}/password`,{method:"POST",headers:kh,body:JSON.stringify(e)})}function T8(t){return Oa(`/api/users/${encodeURIComponent(t)}`,{method:"DELETE"})}var _8=G('<p class="error svelte-plhp3i" role="alert"> </p>'),A8=G('<p class="muted svelte-plhp3i">Loading users…</p>'),y8=G('<p class="error svelte-plhp3i"> </p>'),N8=G('<span class="you svelte-plhp3i">(you)</span>'),S8=G('<span class="displayname svelte-plhp3i"> <!></span> <span class="username svelte-plhp3i"> </span>',1),I8=G('<span class="you svelte-plhp3i">(you)</span>'),C8=G('<span class="username svelte-plhp3i"> <!></span>'),w8=G('<span class="chip locked svelte-plhp3i">Locked</span>'),L8=G('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),O8=G('<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>'),R8=G('<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>'),x8=G('<label class="rolecheck svelte-plhp3i"><input type="checkbox" class="svelte-plhp3i"/> </label>'),D8=G('<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 k8(t,e){ct(e,!0);const n=[],r=["author","developer","admin"],s={author:"Author",developer:"Developer",admin:"Admin"};let a=ee(Et([])),i=ee(!0),u=ee(null),o=ee(null),f=ee(""),h=ee(""),g=ee(""),d=ee(Et(["author"])),m=ee(!1);const b=Ae(()=>{var ue;return((ue=ht.principal)==null?void 0:ue.userId)??null}),_=Ae(()=>!c(m)&&c(f).trim()!==""&&c(g)!==""&&c(d).length>0);async function T(){y(i,!0),y(u,null);try{y(a,await b8(),!0)}catch(ue){y(u,ue instanceof Error?ue.message:String(ue),!0)}finally{y(i,!1)}}Dt(()=>{T()});async function E(ue){if(ue.preventDefault(),!c(_))return;y(m,!0),y(o,null);const me=await E8({username:c(f).trim(),password:c(g),roles:[...c(d)],...c(h).trim()!==""&&{displayName:c(h).trim()}});if(y(m,!1),!me.ok){y(o,me.error,!0);return}y(f,""),y(h,""),y(g,""),y(d,["author"],!0),await T()}async function O(ue){const me=await bu(`Display name for “${ue.username}”:`,{title:"Edit display name",confirmLabel:"Save",value:ue.displayName??"",placeholder:ue.username});if(me===null)return;y(o,null);const Ne=await Q1(ue.id,{displayName:me});Ne.ok||y(o,Ne.error,!0),await T()}async function L(ue,me){const _e=ue.roles.includes(me)?ue.roles.filter(Ie=>Ie!==me):[...ue.roles,me];if(_e.length===0){y(o,"A user must keep at least one role."),await T();return}y(o,null);const ye=await Q1(ue.id,{roles:_e});ye.ok||y(o,ye.error,!0),await T()}async function B(ue){const me=await bu(`Set a new password for “${ue.username}”:`,{title:"Reset password",confirmLabel:"Set password",placeholder:"New password"});if(me===null)return;y(o,null);const Ne=await v8(ue.id,{newPassword:me});Ne.ok||y(o,Ne.error,!0)}async function I(ue){if(!await dl(`Delete the user “${ue.username}”? This can’t be undone.`,{title:"Delete user",confirmLabel:"Delete",danger:!0}))return;y(o,null);const Ne=await T8(ue.id);if(!Ne.ok){y(o,Ne.error,!0);return}await T()}var H=D8(),R=C(H);{var q=ue=>{var me=_8(),Ne=C(me);oe(()=>de(Ne,c(o))),$(ue,me)};he(R,ue=>{c(o)&&ue(q)})}var Q=x(R,2),Y=C(Q);{var v=ue=>{var me=A8();$(ue,me)},M=ue=>{var me=y8(),Ne=C(me);oe(()=>de(Ne,c(u))),$(ue,me)},S=ue=>{var me=R8(),Ne=x(C(me));wt(Ne,21,()=>c(a),_e=>_e.id,(_e,ye)=>{const Ie=Ae(()=>c(ye).id===c(b));var Ue=O8(),We=C(Ue),Ge=C(We),zt=C(Ge);{var Ke=Ce=>{var ke=S8(),Xe=pt(ke),Me=C(Xe),gt=x(Me);{var Ht=gn=>{var kn=N8();$(gn,kn)};he(gt,gn=>{c(Ie)&&gn(Ht)})}var Dn=x(Xe,2),mn=C(Dn);oe(()=>{de(Me,c(ye).displayName),de(mn,c(ye).username)}),$(Ce,ke)},Bt=Ce=>{var ke=C8(),Xe=C(ke),Me=x(Xe);{var gt=Ht=>{var Dn=I8();$(Ht,Dn)};he(Me,Ht=>{c(Ie)&&Ht(gt)})}oe(()=>de(Xe,c(ye).username)),$(Ce,ke)};he(zt,Ce=>{c(ye).displayName?Ce(Ke):Ce(Bt,-1)})}var Qt=x(Ge,2);{var Ft=Ce=>{var ke=w8();$(Ce,ke)};he(Qt,Ce=>{c(ye).locked&&Ce(Ft)})}var Zt=x(We),xn=C(Zt);wt(xn,21,()=>r,Su,(Ce,ke)=>{var Xe=L8(),Me=C(Xe),gt=x(Me);oe(Ht=>{Hv(Me,Ht),Me.disabled=c(Ie),de(gt,` ${s[c(ke)]??""}`)},[()=>c(ye).roles.includes(c(ke))]),ae("change",Me,()=>L(c(ye),c(ke))),$(Ce,Xe)});var Wt=x(Zt),Ut=C(Wt),Z=x(Ut,2),Te=x(Z,2);oe(()=>{ge(xn,"title",c(Ie)?"You can't change your own roles":void 0),Te.disabled=c(Ie),ge(Te,"title",c(Ie)?"You can't delete your own account":void 0)}),ae("click",Ut,()=>O(c(ye))),ae("click",Z,()=>B(c(ye))),ae("click",Te,()=>I(c(ye))),$(_e,Ue)}),$(ue,me)};he(Y,ue=>{c(i)?ue(v):c(u)?ue(M,1):ue(S,-1)})}var U=x(Q,2),F=x(C(U),2),k=C(F),V=x(C(k),2),z=x(k,2),j=x(C(z),2),X=x(z,2),J=x(C(X),2),ne=x(X,2),le=x(C(ne),2);wt(le,21,()=>r,Su,(ue,me)=>{var Ne=x8(),_e=C(Ne),ye,Ie=x(_e);oe(()=>{ye!==(ye=c(me))&&(_e.value=(_e.__value=c(me))??""),de(Ie,` ${s[c(me)]??""}`)}),$v(n,[],_e,()=>(c(me),c(d)),Ue=>y(d,Ue)),$(ue,Ne)});var be=x(F,2),pe=x(C(be),2),Re=C(pe);oe(()=>{pe.disabled=!c(_),de(Re,c(m)?"Adding…":"Add user")}),Be("submit",U,E),bt(V,()=>c(f),ue=>y(f,ue)),bt(j,()=>c(h),ue=>y(h,ue)),bt(J,()=>c(g),ue=>y(g,ue)),$(t,H),ft()}Tt(["change","click"]);var P8=G('<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></div> <div class="body svelte-1eaqpj"><!></div></dialog>');function M8(t,e){ct(e,!0);let n=Jn(e,"open",15),r=ee(void 0),s=ee("users");Dt(()=>{c(r)&&(n()&&!c(r).open?(y(s,"users"),c(r).showModal()):!n()&&c(r).open&&c(r).close())});function a(H){H.preventDefault(),n(!1)}var i=P8(),u=C(i),o=x(C(u),2),f=C(o);fh(f,{size:18,"aria-hidden":"true"});var h=x(u,2),g=C(h);let d;var m=x(g,2);let b;var _=x(m,2);let T;var E=x(h,2),O=C(E);{var L=H=>{k8(H,{})},B=H=>{d8(H,{})},I=H=>{g8(H,{})};he(O,H=>{c(s)==="users"?H(L):c(s)==="branding"?H(B,1):H(I,-1)})}on(i,H=>y(r,H),()=>c(r)),oe(()=>{ge(g,"aria-selected",c(s)==="users"),d=it(g,1,"svelte-1eaqpj",null,d,{selected:c(s)==="users"}),ge(m,"aria-selected",c(s)==="branding"),b=it(m,1,"svelte-1eaqpj",null,b,{selected:c(s)==="branding"}),ge(_,"aria-selected",c(s)==="site"),T=it(_,1,"svelte-1eaqpj",null,T,{selected:c(s)==="site"})}),Be("cancel",i,a),ae("click",o,()=>n(!1)),ae("click",g,()=>y(s,"users")),ae("click",m,()=>y(s,"branding")),ae("click",_,()=>y(s,"site")),$(t,i),ft()}Tt(["click"]);const Wc="nanoesis-theme";function B8(t){return t==="system"||t==="light"||t==="dark"}function Z1(t,e){return t==="light"||t==="dark"?t:e?"dark":"light"}function F8(){let t=ee("system"),e=ee(!1);const n=()=>{document.documentElement.dataset.theme=Z1(c(t),c(e))};return{get choice(){return c(t)},get resolved(){return Z1(c(t),c(e))},init(){const r=localStorage.getItem(Wc);B8(r)&&y(t,r,!0);const s=window.matchMedia("(prefers-color-scheme: dark)");y(e,s.matches,!0),s.addEventListener("change",a=>{y(e,a.matches,!0),n()}),n()},setChoice(r){y(t,r,!0),r==="system"?localStorage.removeItem(Wc):localStorage.setItem(Wc,r),n()}}}const Zo=F8();var U8=G('<button type="button"> </button>'),H8=G('<div class="segmented svelte-1cmi4dh" role="group" aria-label="Theme"></div>');function q8(t,e){ct(e,!1);const n=[{value:"system",label:"System"},{value:"light",label:"Light"},{value:"dark",label:"Dark"}];im();var r=H8();wt(r,5,()=>n,s=>s.value,(s,a)=>{var i=U8();let u;var o=C(i);oe(()=>{u=it(i,1,"option svelte-1cmi4dh",null,u,{selected:Zo.choice===c(a).value}),ge(i,"aria-pressed",Zo.choice===c(a).value),de(o,c(a).label)}),ae("click",i,()=>Zo.setChoice(c(a).value)),$(s,i)}),$(t,r),ft()}Tt(["click"]);var j8=G('<button type="button"> </button>'),$8=G('<div class="segmented svelte-yic9pk" role="group" aria-label="Editor mode"></div>'),Y8=G('<span class="spacer"></span>'),z8=G('<button type="button" class="icon-button svelte-yic9pk" title="Settings" aria-label="Settings"><!></button>'),W8=G('<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 G8(t,e){ct(e,!0);const n=Ae(()=>Tn.logoUrl??Bb),r=Ae(()=>Tn.name??"nanoesis"),s=Ae(()=>ht.canAuthor&&ht.canDevelop);let a=ee(!1);Dt(()=>{ht.canDevelop&&!ht.canAuthor?As.set("templates"):ht.canAuthor&&!ht.canDevelop&&As.set("content")});const i=[{value:"content",label:"Content"},{value:"templates",label:"Templates"}];let u=ee(!1);async function o(){if(!c(u)){y(u,!0);try{const Y=await Ty();if(Y.ok){const v=Y.written;await In(`Published ${v} file${v===1?"":"s"} to the live site.`,{title:"Published"})}else await In(`Fix these, then publish again:
121
-
122
- • ${Y.errors.join(`
123
- • `)}`,{title:`Publish blocked, ${Y.errors.length} ${Y.errors.length===1?"thing":"things"} would break`})}catch(Y){await In(Y instanceof Error?Y.message:String(Y),{title:"Publish failed"})}finally{y(u,!1)}}}var f=W8(),h=pt(f),g=C(h),d=C(g),m=x(d,1,!0),b=x(g,2);{var _=Y=>{var v=$8();wt(v,21,()=>i,M=>M.value,(M,S)=>{var U=j8();let F;var k=C(U);oe(()=>{F=it(U,1,"option svelte-yic9pk",null,F,{selected:As.mode===c(S).value}),ge(U,"aria-pressed",As.mode===c(S).value),de(k,c(S).label)}),ae("click",U,()=>As.set(c(S).value)),$(M,U)}),$(Y,v)},T=Y=>{var v=Y8();$(Y,v)};he(b,Y=>{c(s)?Y(_):Y(T,-1)})}var E=x(b,2),O=C(E);q8(O,{});var L=x(O,2),B=C(L),I=x(L,2);{var H=Y=>{var v=z8(),M=C(v);ch(M,{size:18,"aria-hidden":"true"}),ae("click",v,()=>y(a,!0)),$(Y,v)};he(I,Y=>{ht.isAdmin&&Y(H)})}var R=x(I,2);a8(R,{});var q=x(h,2);{var Q=Y=>{M8(Y,{get open(){return c(a)},set open(v){y(a,v,!0)}})};he(q,Y=>{ht.isAdmin&&Y(Q)})}oe(()=>{ge(d,"src",c(n)),de(m,c(r)),L.disabled=c(u),de(B,c(u)?"Publishing…":"Publish")}),ae("click",L,o),$(t,f),ft()}Tt(["click"]);var K8=G('<li class="hint svelte-2dodtm">Loading…</li>'),V8=G('<li class="hint svelte-2dodtm">Empty</li>'),X8=G('<p class="hint nested svelte-2dodtm">Loading…</p>'),Q8=G("<div><!> <!></div>"),Z8=G('<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>'),J8=G('<li><div draggable="true"><button type="button" class="grip svelte-2dodtm"><!></button> <button type="button"><span class="title svelte-2dodtm"> </span></button></div></li>'),e5=G("<ul><!></ul>");function qb(t,e){ct(e,!0),Dt(()=>{Ml(e.treePath)});const n=Ae(()=>U0(e.treePath)),r=Ae(()=>{var R;return((R=c(n))==null?void 0:R.defaultTemplate)??e.inheritedTemplate}),s=Ae(()=>{var R;return(((R=c(n))==null?void 0:R.entries)??[]).filter(q=>!(q.kind==="item"&&q.slug==="index"))});function a(R){return`tree-group-${R.replace(/\//g,"--")||"root"}`}function i(R){$a(R)||H0(R),e.onopenDir(R)}function u(R){return R.template??c(r)}function o(R){return R.isPublished?void 0:`${R.title}, not published`}function f(R){var Y;const q=[...R],Q=(((Y=c(n))==null?void 0:Y.entries)??[]).map(v=>c(s).includes(v)?q.shift()??v.slug:v.slug);Gy(e.treePath,Q),e.onreorder(e.treePath,Q)}function h(R,q){const Q=c(s).map(v=>v.slug),Y=Q.indexOf(R);Y<0||f(Gf(Q,Y,Y+q))}function g(R,q){R.key==="ArrowUp"?(R.preventDefault(),h(q.slug,-1)):R.key==="ArrowDown"&&(R.preventDefault(),h(q.slug,1))}function d(R,q){iN(R,e.treePath),q.dataTransfer&&(q.dataTransfer.effectAllowed="move",q.dataTransfer.setData("text/plain",R.slug))}function m(R,q){return q.kind==="dir"&&q.path!==R.entry.path&&R.parent!==q.path&&!q.path.startsWith(`${R.entry.path}/`)}function b(R,q){return R.parent===e.treePath&&q.path!==R.entry.path}function _(R,q){const Q=Qa();Q!==null&&(!m(Q,R)&&!b(Q,R)||(q.preventDefault(),q.dataTransfer&&(q.dataTransfer.dropEffect="move"),wc(R.path)))}function T(R,q){q.preventDefault();const Q=Qa();if(Ts(),Q===null)return;if(m(Q,R)){e.onmove(Q.entry.path,Q.entry.kind,R.path);return}if(!b(Q,R))return;const Y=c(s).map(S=>S.slug),v=Y.indexOf(Q.entry.slug),M=Y.indexOf(R.slug);v<0||M<0||f(Gf(Y,v,M))}var E=e5();let O;var L=C(E);{var B=R=>{var q=K8();$(R,q)},I=R=>{var q=V8();$(R,q)},H=R=>{var q=vr(),Q=pt(q);wt(Q,17,()=>c(s),Y=>Y.path,(Y,v)=>{var M=vr(),S=pt(M);{var U=k=>{var V=Z8(),z=C(V);let j;var X=C(z),J=C(X);Yf(J,{size:16,"aria-hidden":"true"});var ne=x(X,2),le=C(ne);{var be=Ke=>{tN(Ke,{size:16,"aria-hidden":"true"})},pe=Ae(()=>$a(c(v).path)),Re=Ke=>{eN(Ke,{size:16,"aria-hidden":"true"})};he(le,Ke=>{c(pe)?Ke(be):Ke(Re,-1)})}var ue=x(ne,2);let me;var Ne=C(ue),_e=C(Ne),ye=x(ue,2),Ie=C(ye),Ue=C(Ie);ch(Ue,{size:16,"aria-hidden":"true"});var We=x(z,2);{var Ge=Ke=>{var Bt=Q8(),Qt=C(Bt);{var Ft=Wt=>{var Ut=X8();$(Wt,Ut)},Zt=Ae(()=>Yy(c(v).path)&&U0(c(v).path)===void 0);he(Qt,Wt=>{c(Zt)&&Wt(Ft)})}var xn=x(Qt,2);{let Wt=Ae(()=>e.level+1);qb(xn,{get treePath(){return c(v).path},get inheritedTemplate(){return c(r)},get level(){return c(Wt)},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 onreorder(){return e.onreorder},get onmove(){return e.onmove}})}oe(Wt=>ge(Bt,"id",Wt),[()=>a(c(v).path)]),$(Ke,Bt)},zt=Ae(()=>$a(c(v).path));he(We,Ke=>{c(zt)&&Ke(Ge)})}oe((Ke,Bt,Qt,Ft)=>{j=it(z,1,"row svelte-2dodtm",null,j,Ke),ge(X,"aria-label",`Reorder ${c(v).name}; arrow keys move it`),ge(ne,"aria-expanded",Bt),ge(ne,"aria-controls",Qt),ge(ne,"aria-label",Ft),me=it(ue,1,"dir svelte-2dodtm",null,me,{active:c(v).path===e.activeDir}),ge(ue,"aria-current",c(v).path===e.activeDir),ge(ue,"title",`${c(v).name}, open this section's page`),de(_e,c(v).name),ge(Ie,"aria-label",`Settings for ${c(v).name}`)},[()=>({active:c(v).path===e.activeDir,"drop-target":j0()===c(v).path}),()=>$a(c(v).path),()=>a(c(v).path),()=>`${$a(c(v).path)?"Collapse":"Expand"} ${c(v).name}`]),Be("dragstart",z,Ke=>d(c(v),Ke)),Be("dragover",z,Ke=>_(c(v),Ke)),Be("dragleave",z,()=>wc(null)),Be("drop",z,Ke=>T(c(v),Ke)),Be("dragend",z,function(...Ke){Ts==null||Ts.apply(this,Ke)}),ae("keydown",X,Ke=>g(Ke,c(v))),ae("click",ne,()=>H0(c(v).path)),ae("click",ue,()=>i(c(v).path)),ae("click",Ie,()=>e.onsettingsDir(c(v).path)),$(k,V)},F=k=>{var V=J8(),z=C(V);let j;var X=C(z),J=C(X);Yf(J,{size:16,"aria-hidden":"true"});var ne=x(X,2);let le;var be=C(ne),pe=C(be);oe((Re,ue)=>{j=it(z,1,"row svelte-2dodtm",null,j,Re),ge(X,"aria-label",`Reorder ${c(v).title}; arrow keys move it`),le=it(ne,1,"item svelte-2dodtm",null,le,{selected:c(v).path===e.selectedPath,unpublished:!c(v).isPublished}),ge(ne,"aria-current",c(v).path===e.selectedPath),ge(ne,"aria-label",ue),ge(ne,"title",c(v).title),de(pe,c(v).title)},[()=>({"drop-target":j0()===c(v).path}),()=>o(c(v))]),Be("dragstart",z,Re=>d(c(v),Re)),Be("dragover",z,Re=>_(c(v),Re)),Be("dragleave",z,()=>wc(null)),Be("drop",z,Re=>T(c(v),Re)),Be("dragend",z,function(...Re){Ts==null||Ts.apply(this,Re)}),ae("keydown",X,Re=>g(Re,c(v))),ae("click",ne,()=>e.onselect(c(v).path,u(c(v)))),$(k,V)};he(S,k=>{c(v).kind==="dir"?k(U):k(F,-1)})}$(Y,M)}),$(R,q)};he(L,R=>{c(n)===void 0?R(B):c(s).length===0?R(I,1):R(H,-1)})}oe(()=>O=it(E,1,"level svelte-2dodtm",null,O,{root:e.level===1})),$(t,E),ft()}Tt(["keydown","click"]);var t5=G('<p class="placeholder pad svelte-whg6dh">Loading editor…</p>'),n5=G('<p class="placeholder svelte-whg6dh"> </p>'),r5=G('<p class="placeholder svelte-whg6dh"> </p>'),s5=G('<li role="option"><span class="result-title svelte-whg6dh"> </span> <span class="result-path svelte-whg6dh"> </span></li>'),a5=G('<ul class="results svelte-whg6dh" role="listbox" id="search-results" aria-label="Search results"></ul>'),i5=G("<div>Move to top level</div>"),u5=G(`<div class="tree-body svelte-whg6dh"><button type="button" title="Home, the site's front page (/)"><!> <span class="home-label">Home</span></button> <!> <!></div>`),o5=G('<div class="work-pad svelte-whg6dh"><p class="placeholder svelte-whg6dh">This item has no template, so no form can be generated.</p></div>'),l5=G(`<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,
124
- the template is the schema. Switch to <strong>Templates</strong> to edit those templates
125
- and components directly.</p></div></div>`),c5=G('<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>'),f5=G('<div class="shell svelte-whg6dh"><!> <div class="shell-body svelte-whg6dh"><!></div> <!></div> <!> <!>',1);function d5(t,e){ct(e,!0);let n=ee(null);Dt(()=>{const Z=zf.target;Z!==null&&(zf.clear(),As.set("content"),I(Z))});let r=ee(null),s=ee(""),a=ee(null),i=ee(!1);function u(Z){return Z==="index"?"":Z.endsWith("/index")?Z.slice(0,-6):null}const o=Ae(()=>c(r)??(c(n)!==null?u(c(n).path):null)),f=Ae(()=>c(n)!==null&&u(c(n).path)!==null),h=Ae(()=>{var Z;return((Z=c(n))==null?void 0:Z.path)==="index"});let g=ee(""),d=ee(Et([])),m=ee(-1),b=ee(void 0),_;Dt(()=>{const Z=c(g);if(clearTimeout(_),Z.trim()===""){y(d,[],!0),y(m,-1);return}return _=setTimeout(()=>{pg(Z).then(Te=>{Z===c(g)&&(y(d,Te,!0),y(m,Te.length>0?0:-1,!0))})},200),()=>clearTimeout(_)});function T(){Wp().then(()=>{var Z,Te;return(Te=(Z=c(b))==null?void 0:Z.children[c(m)])==null?void 0:Te.scrollIntoView({block:"nearest"})})}function E(Z){if(Z.key==="Escape"){y(g,"");return}if(c(d).length!==0){if(Z.key==="ArrowDown")Z.preventDefault(),y(m,(c(m)+1)%c(d).length),T();else if(Z.key==="ArrowUp")Z.preventDefault(),y(m,(c(m)-1+c(d).length)%c(d).length),T();else if(Z.key==="Enter"){Z.preventDefault();const Te=c(d)[c(m)]??c(d)[0];Te!==void 0&&q(Te)}}}wa(()=>{Ml("").catch(Z=>{y(a,Z instanceof Error?Z.message:String(Z),!0)}),z()});function O(Z){return Z.includes("/")?Z.slice(0,Z.lastIndexOf("/")):""}function L(Z){return c(n)!==null&&(c(n).path===Z||c(n).path.startsWith(`${Z}/`))}async function B(Z,Te){try{const Ce=await B0(Z);y(r,null),y(n,{item:Ce,path:Z,templateName:Te},!0)}catch(Ce){await In(Ce instanceof Error?Ce.message:String(Ce))}}async function I(Z){try{const Te=await B0(Z);y(r,null),y(n,{item:Te,path:Z,templateName:await fy(Z,Te.template)},!0)}catch(Te){await In(Te instanceof Error?Te.message:String(Te))}}async function H(Z){const Te=Z===""?"index":`${Z}/index`;await wy(Te)?await I(Te):(y(n,null),await z(),y(s,await Uf(Z),!0),y(r,Z,!0))}async function R(Z){const Te=c(r);if(Te===null)return;const Ce=Te===""?"index":`${Te}/index`,ke=await Uf(Te);try{await Tg(Ce,ke,Z)}catch(Xe){await In(Xe instanceof Error?Xe.message:String(Xe));return}await Yn(Te),await Zi(Ce),await I(Ce)}async function q(Z){y(g,""),await Zi(Z.path),await B(Z.path,Z.template)}async function Q(Z,Te){try{await xy(Z,Te)}catch(Ce){await In(Ce instanceof Error?Ce.message:String(Ce)),await Yn(Z)}}async function Y(Z,Te,Ce){var Me;const ke=O(Z);if(Ce===ke)return;let Xe;try{Xe=Te==="item"?await Py(Z,Ce):await My(Z,Ce)}catch(gt){await In(gt instanceof Error?gt.message:String(gt));return}Te==="item"?await So(hr(Z),hr(Xe)):await So(`${hr(Z)}*`,`${hr(Xe)}:splat`),await Yn(ke),await Yn(Ce),await Zi(Xe),Te==="item"&&((Me=c(n))==null?void 0:Me.path)===Z?await I(Xe):Te==="dir"&&L(Z)&&y(n,null)}async function v(Z){Z.preventDefault();const Te=Qa();Ts(),Te!==null&&Te.parent!==""&&await Y(Te.entry.path,Te.entry.kind,"")}async function M(Z){c(n)!==null&&await Y(c(n).path,"item",Z)}async function S(Z){const Te=c(le);y(le,null),Te!==null&&await Y(Te,"dir",Z)}async function U(Z){if(c(n)===null)return;const{path:Te}=c(n);try{await _y(Te,Z)}catch(Ce){await In(Ce instanceof Error?Ce.message:String(Ce));return}await Yn(O(Te)),await I(Te)}let F=ee(!1),k=ee(Et([])),V=ee(Et([]));async function z(){if(c(k).length===0){const Z=await qf("templates");y(k,Z.filter(Te=>Te!==Zu),!0)}}async function j(){await z(),y(V,await Bf(),!0),y(F,!0)}async function X(Z){y(F,!1),await Yn(O(Z)),await Zi(Z),await I(Z)}async function J(Z){const Te=await bu("New folder name:",{title:"New folder",confirmLabel:"Create"});if(Te===null||Te.trim()==="")return;let Ce;try{Ce=await Ly(Z,Te)}catch(ke){await In(ke instanceof Error?ke.message:String(ke));return}await Yn(Z),await Zi(`${Ce}/_`)}async function ne(){const Z=c(le);y(le,null),Z!==null&&await J(Z)}let le=ee(null);async function be(Z){await z(),y(V,await Bf(),!0),y(le,Z,!0)}async function pe(){const Z=c(le);y(le,null),Z!==null&&await Yn(Z),c(n)!==null&&await I(c(n).path)}async function Re(){const Z=c(le);y(le,null),Z!==null&&await Ne(Z)}async function ue(){const Z=c(le);y(le,null),Z!==null&&await me(Z)}async function me(Z){const Te=Wo(Z);if(await dl(`Delete the folder “${Te}” and everything in it? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await fl(Ja(Z))}catch(ke){await In(ke instanceof Error?ke.message:String(ke));return}L(Z)&&y(n,null),await Yn(O(Z))}}async function Ne(Z){const Te=Wo(Z),Ce=await bu("New URL for this folder (its slug, the name comes from its page title):",{title:"Change URL",value:Te,confirmLabel:"Change URL"});if(Ce===null)return;const ke=os(Ce);if(ke===""||ke===Te)return;const Xe=k0(Z,ke);try{await _a(Ja(Z),Ja(Xe))}catch(Me){await In(Me instanceof Error?Me.message:String(Me));return}await So(`${hr(Z)}*`,`${hr(Xe)}:splat`),L(Z)&&y(n,null),await Yn(O(Z))}async function _e(){if(c(n)===null)return;const{path:Z,item:Te}=c(n);if(await dl(`Delete “${Te.title}”? This can’t be undone.`,{title:"Delete",confirmLabel:"Delete",danger:!0})){try{await fl(Os(Z))}catch(ke){await In(ke instanceof Error?ke.message:String(ke));return}y(n,null),await Yn(O(Z))}}async function ye(){if(c(n)===null)return;const Z=c(n).path,Te=Wo(Z),Ce=await bu("New URL for this page (its slug, the title is separate):",{title:"Change URL",value:Te,confirmLabel:"Change URL"});if(Ce===null)return;const ke=os(Ce);if(ke===""||ke===Te)return;const Xe=k0(Z,ke);try{await _a(Os(Z),Os(Xe))}catch(Me){await In(Me instanceof Error?Me.message:String(Me));return}await So(hr(Z),hr(Xe)),await Yn(O(Z)),await I(Xe)}let Ie=ee(null);Dt(()=>{As.mode==="templates"&&c(Ie)===null&&XA(()=>import("./TemplatesPane-5qsDAK_B.js").then(Z=>Z.T),__vite__mapDeps([0,1]),import.meta.url).then(Z=>{y(Ie,Z.default,!0)})});var Ue=f5(),We=pt(Ue),Ge=C(We);G8(Ge,{});var zt=x(Ge,2),Ke=C(zt);{var Bt=Z=>{var Te=vr(),Ce=pt(Te);{var ke=Me=>{var gt=vr(),Ht=pt(gt);Ov(Ht,()=>c(Ie),(Dn,mn)=>{mn(Dn,{})}),$(Me,gt)},Xe=Me=>{var gt=t5();$(Me,gt)};he(Ce,Me=>{c(Ie)?Me(ke):Me(Xe,-1)})}$(Z,Te)},Qt=Z=>{var Te=c5(),Ce=C(Te),ke=C(Ce),Xe=x(C(ke),2),Me=C(Xe),gt=C(Me);aN(gt,{size:18,"aria-hidden":"true"});var Ht=x(Me,2),Dn=C(Ht);Jy(Dn,{size:18,"aria-hidden":"true"});var mn=x(ke,2),gn=C(mn);Cg(gn,{class:"search-icon",size:16,"aria-hidden":"true"});var kn=x(gn,2),Rr=x(mn,2);{var ur=$e=>{var Ye=n5(),_t=C(Ye);oe(()=>de(_t,`Couldn’t load content: ${c(a)??""}`)),$($e,Ye)},bn=$e=>{var Ye=vr(),_t=pt(Ye);{var Jt=Lt=>{var Ot=r5(),ot=C(Ot);oe(Gt=>de(ot,`No matches for “${Gt??""}”.`),[()=>c(g).trim()]),$(Lt,Ot)},Pn=Lt=>{var Ot=a5();wt(Ot,23,()=>c(d),ot=>ot.path,(ot,Gt,qt)=>{var Ct=s5();let or;var yn=C(Ct),kt=C(yn),Ks=x(yn,2),Vs=C(Ks);oe(()=>{ge(Ct,"id",`search-option-${c(qt)}`),or=it(Ct,1,"result svelte-whg6dh",null,or,{active:c(qt)===c(m),unpublished:!c(Gt).isPublished}),ge(Ct,"aria-selected",c(qt)===c(m)),ge(Ct,"aria-label",c(Gt).isPublished?void 0:`${c(Gt).title}, not published`),de(kt,c(Gt).title),de(Vs,c(Gt).path)}),ae("click",Ct,()=>q(c(Gt))),Be("mouseenter",Ct,()=>y(m,c(qt),!0)),$(ot,Ct)}),on(Ot,ot=>y(b,ot),()=>c(b)),$(Lt,Ot)};he(_t,Lt=>{c(d).length===0?Lt(Jt):Lt(Pn,-1)})}$($e,Ye)},xr=Ae(()=>c(g).trim()!==""),Zr=$e=>{var Ye=u5(),_t=C(Ye);let Jt;var Pn=C(_t);nN(Pn,{size:16,"aria-hidden":"true"});var Lt=x(_t,2);{let qt=Ae(()=>{var Ct;return((Ct=c(n))==null?void 0:Ct.path)??null});qb(Lt,{treePath:"",inheritedTemplate:void 0,level:1,get selectedPath(){return c(qt)},get activeDir(){return c(o)},onselect:B,onopenDir:H,onsettingsDir:be,onreorder:Q,onmove:Y})}var Ot=x(Lt,2);{var ot=qt=>{var Ct=i5();let or;oe(yn=>or=it(Ct,1,"root-drop svelte-whg6dh",null,or,yn),[()=>({over:Qa()!==null&&c(i)})]),Be("dragover",Ct,yn=>{yn.preventDefault(),y(i,!0)}),Be("dragleave",Ct,()=>y(i,!1)),Be("drop",Ct,yn=>{y(i,!1),v(yn)}),$(qt,Ct)},Gt=Ae(()=>{var qt;return Qa()!==null&&((qt=Qa())==null?void 0:qt.parent)!==""});he(Ot,qt=>{c(Gt)&&qt(ot)})}oe(()=>{Jt=it(_t,1,"home-row svelte-whg6dh",null,Jt,{active:c(o)===""}),ge(_t,"aria-current",c(o)==="")}),ae("click",_t,()=>H("")),$($e,Ye)};he(Rr,$e=>{c(a)?$e(ur):c(xr)?$e(bn,1):$e(Zr,-1)})}var jn=x(Ce,2);WO(jn,{});var ve=x(jn,2),He=C(ve);{var Je=$e=>{var Ye=vr(),_t=pt(Ye);Sv(_t,()=>`${c(n).path}\0${c(n).templateName}`,Jt=>{{let Pn=Ae(()=>c(f)?void 0:ye),Lt=Ae(()=>c(h)?void 0:_e);bO(Jt,{get item(){return c(n).item},get templateName(){return c(n).templateName},get path(){return c(n).path},get templates(){return c(k)},get onrename(){return c(Pn)},get ondelete(){return c(Lt)},onchangetemplate:U,onmove:M,onsaved:(Ot,ot,Gt)=>{zy(Ot,ot),Wy(Ot,Gt)}})}}),$($e,Ye)},Qe=$e=>{var Ye=o5();$($e,Ye)},ce=$e=>{FO($e,{get folderPath(){return c(r)},get name(){return c(s)},get templates(){return c(k)},oncreate:R})},It=$e=>{var Ye=l5();$($e,Ye)};he(He,$e=>{c(n)&&c(n).templateName?$e(Je):c(n)?$e(Qe,1):c(r)!==null?$e(ce,2):$e(It,-1)})}oe(()=>{ge(kn,"aria-expanded",c(d).length>0),ge(kn,"aria-activedescendant",c(m)>=0?`search-option-${c(m)}`:void 0)}),ae("click",Me,()=>J("")),ae("click",Ht,j),ae("keydown",kn,E),bt(kn,()=>c(g),$e=>y(g,$e)),$(Z,Te)};he(Ke,Z=>{As.mode==="templates"?Z(Bt):Z(Qt,-1)})}var Ft=x(zt,2);AO(Ft,{});var Zt=x(We,2);{var xn=Z=>{PO(Z,{get folders(){return c(V)},get templates(){return c(k)},oncreated:X,oncancel:()=>y(F,!1)})};he(Zt,Z=>{c(F)&&Z(xn)})}var Wt=x(Zt,2);{var Ut=Z=>{OO(Z,{get folderPath(){return c(le)},get templates(){return c(k)},get folders(){return c(V)},onsaved:pe,oncancel:()=>y(le,null),onnewsubfolder:ne,onrenamefolder:Re,ondeletefolder:ue,onmove:S})};he(Wt,Z=>{c(le)!==null&&Z(Ut)})}$(t,Ue),ft()}Tt(["click","keydown"]);var h5=G('<h2 class="svelte-z86ibt"> </h2>'),p5=G('<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>'),m5=G('<h2 class="svelte-z86ibt"> </h2>'),g5=G("<option> </option>"),b5=G('<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>'),E5=G('<h2 class="svelte-z86ibt"> </h2>'),v5=G('<!> <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),T5=G('<h2 class="svelte-z86ibt"> </h2>'),_5=G('<!> <p class="message svelte-z86ibt"> </p> <div class="actions svelte-z86ibt"><button type="button" class="primary svelte-z86ibt">OK</button></div>',1),A5=G('<dialog aria-label="Dialog" class="svelte-z86ibt"><!></dialog>');function y5(t,e){ct(e,!0);let n,r=ee(""),s=ee("");Dt(()=>{const m=Io.pending;m?(m.kind==="prompt"&&y(r,m.options.value??"",!0),m.kind==="select"&&y(s,""),n.open||n.showModal()):n!=null&&n.open&&n.close()});function a(){const m=Io.pending;(m==null?void 0:m.kind)==="confirm"?Sc(!1):(m==null?void 0:m.kind)==="prompt"?Ic(null):(m==null?void 0:m.kind)==="select"?Cc(null):q0()}function i(m){m.preventDefault(),a()}function u(m){m.target===n&&a()}function o(m){m.preventDefault(),Ic(c(r))}function f(m){m.preventDefault(),c(s)!==""&&Cc(c(s))}var h=A5(),g=C(h);{var d=m=>{const b=Ae(()=>Io.pending);var _=vr(),T=pt(_);{var E=I=>{var H=p5(),R=C(H);{var q=V=>{var z=h5(),j=C(z);oe(()=>de(j,c(b).options.title)),$(V,z)};he(R,V=>{c(b).options.title&&V(q)})}var Q=x(R,2),Y=C(Q),v=C(Y),M=x(Y,2);gi(M,!0);var S=x(Q,2),U=C(S),F=x(U,2),k=C(F);oe(()=>{de(v,c(b).message),ge(M,"placeholder",c(b).options.placeholder??""),de(k,c(b).options.confirmLabel??"OK")}),Be("submit",H,o),bt(M,()=>c(r),V=>y(r,V)),ae("click",U,()=>Ic(null)),$(I,H)},O=I=>{var H=b5(),R=C(H);{var q=X=>{var J=m5(),ne=C(J);oe(()=>de(ne,c(b).options.title)),$(X,J)};he(R,X=>{c(b).options.title&&X(q)})}var Q=x(R,2),Y=C(Q),v=C(Y),M=x(Y,2);gi(M,!0);var S=C(M),U=C(S);S.value=S.__value="";var F=x(S);wt(F,17,()=>c(b).choices,X=>X.value,(X,J)=>{var ne=g5(),le=C(ne),be={};oe(()=>{de(le,c(J).label),be!==(be=c(J).value)&&(ne.value=(ne.__value=c(J).value)??"")}),$(X,ne)});var k=x(Q,2),V=C(k),z=x(V,2),j=C(z);oe(()=>{de(v,c(b).message),de(U,c(b).options.placeholder??"Choose…"),z.disabled=c(s)==="",de(j,c(b).options.confirmLabel??"OK")}),Be("submit",H,f),Ta(M,()=>c(s),X=>y(s,X)),ae("click",V,()=>Cc(null)),$(I,H)},L=I=>{var H=v5(),R=pt(H);{var q=V=>{var z=E5(),j=C(z);oe(()=>de(j,c(b).options.title)),$(V,z)};he(R,V=>{c(b).options.title&&V(q)})}var Q=x(R,2),Y=C(Q),v=x(Q,2),M=C(v),S=C(M),U=x(M,2);let F;var k=C(U);oe(()=>{de(Y,c(b).message),de(S,c(b).options.cancelLabel??"Cancel"),F=it(U,1,"primary svelte-z86ibt",null,F,{danger:c(b).options.danger}),de(k,c(b).options.confirmLabel??"Confirm")}),ae("click",M,()=>Sc(!1)),ae("click",U,()=>Sc(!0)),$(I,H)},B=I=>{var H=_5(),R=pt(H);{var q=S=>{var U=T5(),F=C(U);oe(()=>de(F,c(b).options.title)),$(S,U)};he(R,S=>{c(b).options.title&&S(q)})}var Q=x(R,2),Y=C(Q),v=x(Q,2),M=C(v);oe(()=>de(Y,c(b).message)),ae("click",M,()=>q0()),$(I,H)};he(T,I=>{c(b).kind==="prompt"?I(E):c(b).kind==="select"?I(O,1):c(b).kind==="confirm"?I(L,2):I(B,-1)})}$(m,_)};he(g,m=>{Io.pending&&m(d)})}on(h,m=>n=m,()=>n),Be("cancel",h,i),ae("click",h,u),$(t,h),ft()}Tt(["click"]);var N5=G('<li role="option"><span class="result-title svelte-o6yxmi"> </span> <span class="result-path svelte-o6yxmi"> </span></li>'),S5=G('<ul class="results svelte-o6yxmi" role="listbox" id="link-results"></ul>'),I5=G('<p class="hint svelte-o6yxmi">No matching pages.</p>'),C5=G('<p class="hint svelte-o6yxmi">Type to find a page; it links by reference, so the link follows renames.</p>'),w5=G('<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),L5=G('<label class="url-label svelte-o6yxmi"><span class="svelte-o6yxmi">URL</span> <input type="url" placeholder="https://example.com" class="svelte-o6yxmi"/></label>'),O5=G('<button type="button" class="ghost svelte-o6yxmi">Remove link</button>'),R5=G('<button type="button" class="primary svelte-o6yxmi">Set link</button>'),x5=G('<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),D5=G('<dialog aria-label="Insert link" class="svelte-o6yxmi"><!></dialog>');function k5(t,e){ct(e,!0);let n=ee(void 0),r=ee("page"),s=ee(""),a=ee(Et([])),i=ee(-1),u=ee(""),o=ee(void 0);const f=Ae(()=>GN.pending);Dt(()=>{var L,B;if(c(f)===null){(L=c(n))==null||L.close();return}const O=c(f).current;y(r,O===""||Ou(O)?"page":"url",!0),y(s,""),y(a,[],!0),y(i,-1),y(u,Ou(O)?"":O,!0),(B=c(n))==null||B.showModal()});let h;Dt(()=>{const O=c(s);if(clearTimeout(h),c(r)!=="page"||O.trim()===""){y(a,[],!0),y(i,-1);return}return h=setTimeout(()=>{pg(O).then(L=>{O===c(s)&&(y(a,L,!0),y(i,L.length>0?0:-1,!0))})},200),()=>clearTimeout(h)});function g(O){qa(KN(O.path))}function d(){const O=c(u).trim();O!==""&&qa(O)}function m(){var O,L;(L=(O=c(o))==null?void 0:O.children[c(i)])==null||L.scrollIntoView({block:"nearest"})}function b(O){if(c(a).length!==0){if(O.key==="ArrowDown")O.preventDefault(),y(i,(c(i)+1)%c(a).length),m();else if(O.key==="ArrowUp")O.preventDefault(),y(i,(c(i)-1+c(a).length)%c(a).length),m();else if(O.key==="Enter"){O.preventDefault();const L=c(a)[c(i)]??c(a)[0];L!==void 0&&g(L)}}}var _=D5(),T=C(_);{var E=O=>{var L=x5(),B=x(pt(L),2),I=C(B);let H;var R=x(I,2);let q;var Q=x(B,2),Y=C(Q);{var v=j=>{var X=w5(),J=pt(X),ne=C(J);Cg(ne,{class:"search-icon",size:16,"aria-hidden":"true"});var le=x(ne,2);gi(le,!0);var be=x(J,2),pe=C(be);{var Re=_e=>{var ye=S5();wt(ye,23,()=>c(a),Ie=>Ie.path,(Ie,Ue,We)=>{var Ge=N5();let zt;var Ke=C(Ge),Bt=C(Ke),Qt=x(Ke,2),Ft=C(Qt);oe(()=>{ge(Ge,"id",`link-option-${c(We)}`),zt=it(Ge,1,"result svelte-o6yxmi",null,zt,{active:c(We)===c(i)}),ge(Ge,"aria-selected",c(We)===c(i)),de(Bt,c(Ue).title),de(Ft,c(Ue).path)}),ae("click",Ge,()=>g(c(Ue))),Be("mouseenter",Ge,()=>y(i,c(We),!0)),$(Ie,Ge)}),on(ye,Ie=>y(o,Ie),()=>c(o)),$(_e,ye)},ue=_e=>{var ye=I5();$(_e,ye)},me=Ae(()=>c(s).trim()!==""),Ne=_e=>{var ye=C5();$(_e,ye)};he(pe,_e=>{c(a).length>0?_e(Re):c(me)?_e(ue,1):_e(Ne,-1)})}oe(()=>{ge(le,"aria-expanded",c(a).length>0),ge(le,"aria-activedescendant",c(i)>=0?`link-option-${c(i)}`:void 0)}),ae("keydown",le,b),bt(le,()=>c(s),_e=>y(s,_e)),$(j,X)},M=j=>{var X=L5(),J=x(C(X),2);ae("keydown",J,ne=>{ne.key==="Enter"&&(ne.preventDefault(),d())}),bt(J,()=>c(u),ne=>y(u,ne)),$(j,X)};he(Y,j=>{c(r)==="page"?j(v):j(M,-1)})}var S=x(Q,2),U=C(S),F=x(U,2);{var k=j=>{var X=O5();ae("click",X,()=>qa("")),$(j,X)};he(F,j=>{c(f).current!==""&&j(k)})}var V=x(F,2);{var z=j=>{var X=R5();oe(J=>X.disabled=J,[()=>c(u).trim()===""]),ae("click",X,d),$(j,X)};he(V,j=>{c(r)==="url"&&j(z)})}oe(()=>{H=it(I,1,"tab svelte-o6yxmi",null,H,{active:c(r)==="page"}),ge(I,"aria-selected",c(r)==="page"),q=it(R,1,"tab svelte-o6yxmi",null,q,{active:c(r)==="url"}),ge(R,"aria-selected",c(r)==="url")}),ae("click",I,()=>y(r,"page")),ae("click",R,()=>y(r,"url")),ae("click",U,()=>qa(null)),$(O,L)};he(T,O=>{c(f)!==null&&O(E)})}on(_,O=>y(n,O),()=>c(n)),Be("close",_,()=>qa(null)),Be("cancel",_,()=>qa(null)),$(t,_),ft()}Tt(["click","keydown"]);var P5=G('<img class="brand-logo svelte-2jpsc9" alt="" width="40" height="40"/>'),M5=G(`<p class="lede svelte-2jpsc9">Create your admin account. The first sign-in here becomes the admin, choose a username and
126
- password.</p>`),B5=G('<p class="lede svelte-2jpsc9">Sign in to continue.</p>'),F5=G(`<small class="hint-error svelte-2jpsc9">Passwords don't match.</small>`),U5=G('<label class="svelte-2jpsc9"><span class="svelte-2jpsc9">Confirm password</span> <input type="password" autocomplete="new-password" required="" class="svelte-2jpsc9"/> <!></label>'),H5=G('<p class="error svelte-2jpsc9" role="alert"> </p>'),q5=G('<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 j5(t,e){ct(e,!0);const n=Ae(()=>Tn.name??"nanoesis");let r=ee(""),s=ee(""),a=ee(""),i=ee(!1),u=ee(null),o=Ae(()=>ht.firstRun&&c(a)!==""&&c(s)!==c(a)),f=Ae(()=>!c(i)&&c(r).trim()!==""&&c(s)!==""&&(!ht.firstRun||c(a)!==""&&!c(o)));async function h(j){if(j.preventDefault(),!c(f))return;y(i,!0),y(u,null);const X=await ht.login(c(r),c(s));if(y(i,!1),!X.ok){y(u,g(X.error??"Sign-in failed."),!0);return}}function g(j){return j.includes("locked")?"Account temporarily locked, try again shortly.":j.includes("credentials")?"Invalid credentials. Check your username and password.":j}var d=q5(),m=C(d),b=C(m),_=C(b);{var T=j=>{var X=P5();oe(()=>ge(X,"src",Tn.logoUrl)),$(j,X)};he(_,j=>{Tn.logoUrl&&j(T)})}var E=x(_,2),O=C(E),L=x(E,2);{var B=j=>{var X=M5();$(j,X)},I=j=>{var X=B5();$(j,X)};he(L,j=>{ht.firstRun?j(B):j(I,-1)})}var H=x(b,2),R=C(H),q=x(C(R),2);gi(q,!0);var Q=x(R,2),Y=x(C(Q),2),v=x(Q,2);{var M=j=>{var X=U5(),J=x(C(X),2),ne=x(J,2);{var le=be=>{var pe=F5();$(be,pe)};he(ne,be=>{c(o)&&be(le)})}bt(J,()=>c(a),be=>y(a,be)),$(j,X)};he(v,j=>{ht.firstRun&&j(M)})}var S=x(v,2);{var U=j=>{var X=H5(),J=C(X);oe(()=>de(J,c(u))),$(j,X)};he(S,j=>{c(u)&&j(U)})}var F=x(S,2),k=C(F);{var V=j=>{var X=lf();oe(()=>de(X,ht.firstRun?"Creating…":"Signing in…")),$(j,X)},z=j=>{var X=lf();oe(()=>de(X,ht.firstRun?"Create admin account":"Sign in")),$(j,X)};he(k,j=>{c(i)?j(V):j(z,-1)})}oe(()=>{de(O,c(n)),ge(Y,"autocomplete",ht.firstRun?"new-password":"current-password"),F.disabled=!c(f)}),Be("submit",H,h),bt(q,()=>c(r),j=>y(r,j)),bt(Y,()=>c(s),j=>y(s,j)),$(t,d),ft()}var $5=G('<p class="message svelte-7emrh2" aria-busy="true">Checking the whole site…</p>'),Y5=G('<p class="message svelte-7emrh2">Couldn’t check the site, try Re-check.</p>'),z5=G('<p class="message ok svelte-7emrh2">No problems, the site is ready to publish.</p>'),W5=G('<button type="button" class="open svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></button>'),G5=G('<span class="static svelte-7emrh2"><span class="sev svelte-7emrh2"> </span> <span class="msg svelte-7emrh2"> </span></span>'),K5=G("<li><!></li>"),V5=G('<p class="message svelte-7emrh2"> <!>. Errors block a publish.</p> <ul class="problems svelte-7emrh2"></ul>',1),X5=G('<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 Q5(t,e){ct(e,!0);let n;const r=Ae(()=>fn.errors),s=Ae(()=>fn.warnings);Dt(()=>{fn.panelOpen?n.open||n.showModal():n!=null&&n.open&&n.close()});function a(E){zf.request(E),fn.closePanel()}function i(E){E.preventDefault(),fn.closePanel()}function u(E){E.target===n&&fn.closePanel()}var o=X5(),f=x(C(o),2);{var h=E=>{var O=$5();$(E,O)},g=E=>{var O=Y5();$(E,O)},d=E=>{var O=z5();$(E,O)},m=E=>{var O=V5(),L=pt(O),B=C(L),I=x(B);{var H=q=>{var Q=lf();oe(()=>de(Q,`,
127
- ${c(s).length??""}
128
- ${c(s).length===1?"warning":"warnings"}`)),$(q,Q)};he(I,q=>{c(s).length>0&&q(H)})}var R=x(L,2);wt(R,21,()=>[...c(r),...c(s)],Su,(q,Q)=>{var Y=K5(),v=C(Y);{var M=U=>{var F=W5(),k=C(F),V=C(k),z=x(k,2),j=C(z);oe(()=>{de(V,c(Q).severity),de(j,c(Q).message)}),ae("click",F,()=>a(c(Q).path??"")),$(U,F)},S=U=>{var F=G5(),k=C(F),V=C(k),z=x(k,2),j=C(z);oe(()=>{de(V,c(Q).severity),de(j,c(Q).message)}),$(U,F)};he(v,U=>{c(Q).path?U(M):U(S,-1)})}oe(()=>it(Y,1,Jp(c(Q).severity),"svelte-7emrh2")),$(q,Y)}),oe(()=>de(B,`${c(r).length??""}
129
- ${c(r).length===1?"error":"errors"}`)),$(E,O)};he(f,E=>{fn.status==="checking"?E(h):fn.status==="error"?E(g,1):c(r).length===0&&c(s).length===0?E(d,2):E(m,-1)})}var b=x(f,2),_=C(b),T=x(_,2);on(o,E=>n=E,()=>n),oe(()=>_.disabled=fn.status==="checking"),Be("cancel",o,i),ae("click",o,u),ae("click",_,()=>void fn.refresh()),ae("click",T,()=>fn.closePanel()),$(t,o),ft()}Tt(["click"]);var Z5=G('<main class="loading svelte-1n46o8q" aria-busy="true"></main>'),J5=G("<!> <!> <!> <!>",1);function eR(t,e){ct(e,!1),wa(()=>{Zo.init(),ht.init(),Tn.load()}),im();var n=vr(),r=pt(n);{var s=u=>{var o=Z5();$(u,o)},a=u=>{j5(u,{})},i=u=>{var o=J5(),f=pt(o);d5(f,{});var h=x(f,2);y5(h,{});var g=x(h,2);k5(g,{});var d=x(g,2);Q5(d,{}),$(u,o)};he(r,u=>{ht.status==="loading"?u(s):ht.status==="unauthenticated"?u(a,1):u(i,-1)})}$(t,n),ft()}const tR=[["autocomplete","off"],["data-lpignore","true"],["data-1p-ignore","true"],["data-bwignore","true"],["data-form-type","other"]],nR=new Set(["file","checkbox","radio","range","color","submit","button","reset"]);function jb(t){if((t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement)&&!(t instanceof HTMLInputElement&&nR.has(t.type)))for(const[e,n]of tR)t.setAttribute(e,n)}function J1(t){for(const e of t.querySelectorAll("input, textarea"))jb(e)}function rR(){J1(document);const t=new MutationObserver(e=>{for(const n of e)for(const r of n.addedNodes)r instanceof Element&&(jb(r),J1(r))});return t.observe(document.body,{childList:!0,subtree:!0}),()=>t.disconnect()}const $b=document.getElementById("app");if($b===null)throw new Error("Missing #app mount point");HA().then(()=>{_v(eR,{target:$b}),rR()});export{ER as $,c as A,he as B,tN as C,lR as D,Sv as E,qd as F,Bf as G,cR as H,Cr as I,Iy as J,hR as K,dR as L,wa as M,ft as N,_R as O,Jy as P,bu as Q,Jn as R,Cg as S,Et as T,ct as U,mR as V,_a as W,fh as X,Hy as Y,ir as Z,XA as _,eN as a,ys as a0,pR as a1,AR as a2,y as a3,ge as a4,it as a5,em as a6,de as a7,Uv as a8,x as a9,os as aa,Sr as ab,ee as ac,oe as ad,Zo as ae,Wp as af,bR as ag,Ae as ah,Dt as ai,Hf as b,aN as c,WO as d,In as e,$ as f,Wv as g,on as h,bt as i,C as j,vr as k,oR as l,dl as m,fR as n,uR as o,gR as p,Tt as q,ae as r,fl as s,vR as t,iR as u,wt as v,Be as w,TR as x,pt as y,G as z};