@refrakt-md/editor 0.32.0 → 0.34.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/app/dist/assets/{index-MAa41Aoo.js → index-B9evDjiY.js} +1 -1
- package/app/dist/assets/{index-DC3NN32V.js → index-BEzsLLEi.js} +1 -1
- package/app/dist/assets/{index-B5EwV3L4.js → index-BRNcz3ZN.js} +1 -1
- package/app/dist/assets/{index-9FYuyjkb.js → index-BbKNPcZu.js} +1 -1
- package/app/dist/assets/{index-BYbu3e1g.js → index-BgoT2u0j.js} +1 -1
- package/app/dist/assets/{index-8OoX8730.js → index-BhvgBV4C.js} +1 -1
- package/app/dist/assets/{index-CokXa7Q0.js → index-C3621cGO.js} +1 -1
- package/app/dist/assets/{index-CTvbHdnl.js → index-C6O8opFI.js} +1 -1
- package/app/dist/assets/index-CCQ-z9aR.js +618 -0
- package/app/dist/assets/{index-BcuLfpXj.js → index-CGfziSaO.js} +1 -1
- package/app/dist/assets/{index-BGnYPYsz.js → index-CiVwGhFG.js} +1 -1
- package/app/dist/assets/{index-BX59bp8A.js → index-Cnibris1.js} +1 -1
- package/app/dist/assets/{index-C22IGCT5.js → index-DNGu9cr1.js} +1 -1
- package/app/dist/assets/{index-B_Cn-SCf.js → index-DcwpakCF.js} +1 -1
- package/app/dist/assets/{index-BtDnPCJm.js → index-DyjCpEtL.js} +1 -1
- package/app/dist/assets/{index-dOZj_cPm.js → index-MRvFn3Sl.js} +1 -1
- package/app/dist/assets/{index-CNFIYp8p.js → index-RTh1eW1u.js} +1 -1
- package/app/dist/assets/{index-B4gO_iPW.js → index-ojg7U5eP.js} +1 -1
- package/app/dist/assets/{index-Dy9gwdZ7.js → index-xzyBNgk5.js} +1 -1
- package/app/dist/index.html +1 -1
- package/app/src/lib/api/client.ts +6 -2
- package/app/src/lib/editor/attribute-completion.ts +5 -5
- package/app/src/lib/editor/block-parser.ts +91 -35
- package/app/src/lib/editor/content-model-resolver.ts +1 -1
- package/app/src/lib/editor/inline-markdown.ts +17 -15
- package/app/src/lib/editor/rune-palette.ts +3 -3
- package/app/src/lib/editor/section-mapper.ts +30 -24
- package/app/src/lib/preview/block-renderer.ts +17 -6
- package/app/src/lib/state/editor.svelte.ts +6 -2
- package/dist/community-tags-builder.d.ts.map +1 -1
- package/dist/community-tags-builder.js +4 -1
- package/dist/community-tags-builder.js.map +1 -1
- package/dist/layout-resolver.d.ts.map +1 -1
- package/dist/layout-resolver.js +30 -4
- package/dist/layout-resolver.js.map +1 -1
- package/dist/preview-builder.d.ts.map +1 -1
- package/dist/preview-builder.js +3 -1
- package/dist/preview-builder.js.map +1 -1
- package/dist/preview.d.ts.map +1 -1
- package/dist/preview.js +27 -3
- package/dist/preview.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +26 -12
- package/dist/server.js.map +1 -1
- package/package.json +6 -6
- package/app/dist/assets/index-CzUb_76y.js +0 -618
|
@@ -1,618 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/dockerfile-BKs6k2Af.js","assets/simple-mode-GW_nhZxv.js","assets/factor-kuTfRLto.js","assets/nsis-LdVXkNf5.js","assets/pug-DeIclll2.js","assets/javascript-iXu5QeM3.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const s of i)if(s.type==="childList")for(const o of s.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(i){const s={};return i.integrity&&(s.integrity=i.integrity),i.referrerPolicy&&(s.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?s.credentials="include":i.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(i){if(i.ep)return;i.ep=!0;const s=t(i);fetch(i.href,s)}})();const tm=!1;var Pd=Array.isArray,FP=Array.prototype.indexOf,Za=Array.prototype.includes,Ed=Array.from,XP=Object.defineProperty,$a=Object.getOwnPropertyDescriptor,VP=Object.getOwnPropertyDescriptors,i_=Object.prototype,WP=Array.prototype,uv=Object.getPrototypeOf,Tb=Object.isExtensible;const ss=()=>{};function YP(n){for(var e=0;e<n.length;e++)n[e]()}function s_(){var n,e,t=new Promise((r,i)=>{n=r,e=i});return{promise:t,resolve:n,reject:e}}function Hc(n,e){if(Array.isArray(n))return n;if(!(Symbol.iterator in n))return Array.from(n);const t=[];for(const r of n)if(t.push(r),t.length===e)break;return t}const Hn=2,$f=4,$d=8,o_=1<<24,Cs=16,$i=32,Jo=64,fv=128,ri=512,Xn=1024,Kn=2048,Ti=4096,Xr=8192,Os=16384,dv=32768,Bo=65536,Pb=1<<17,a_=1<<18,fl=1<<19,UP=1<<20,ps=1<<25,jo=32768,nm=1<<21,hv=1<<22,Vs=1<<23,qo=Symbol("$state"),GP=Symbol("legacy props"),HP=Symbol(""),ba=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};function KP(n){throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function JP(){throw new Error("https://svelte.dev/e/async_derived_orphan")}function eE(n,e,t){throw new Error("https://svelte.dev/e/each_key_duplicate")}function tE(n){throw new Error("https://svelte.dev/e/effect_in_teardown")}function nE(){throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function rE(n){throw new Error("https://svelte.dev/e/effect_orphan")}function iE(){throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function sE(n){throw new Error("https://svelte.dev/e/props_invalid_value")}function oE(){throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function aE(){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 uE=1,fE=2,l_=4,dE=8,hE=16,pE=1,mE=4,gE=8,vE=16,c_=1,OE=2,Yn=Symbol(),bE="http://www.w3.org/1999/xhtml";function yE(){console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function wE(){console.warn("https://svelte.dev/e/svelte_boundary_reset_noop")}function u_(n){return n===this.v}function _E(n,e){return n!=n?e==e:n!==e||n!==null&&typeof n=="object"||typeof n=="function"}function f_(n){return!_E(n,this.v)}let kE=!1;const xE=[];function SE(n,e=!1,t=!1){return cf(n,new Map,"",xE,null,t)}function cf(n,e,t,r,i=null,s=!1){if(typeof n=="object"&&n!==null){var o=e.get(n);if(o!==void 0)return o;if(n instanceof Map)return new Map(n);if(n instanceof Set)return new Set(n);if(Pd(n)){var a=Array(n.length);e.set(n,a),i!==null&&e.set(i,a);for(var l=0;l<n.length;l+=1){var c=n[l];l in n&&(a[l]=cf(c,e,t,r,null,s))}return a}if(uv(n)===i_){a={},e.set(n,a),i!==null&&e.set(i,a);for(var u in n)a[u]=cf(n[u],e,t,r,null,s);return a}if(n instanceof Date)return structuredClone(n);if(typeof n.toJSON=="function"&&!s)return cf(n.toJSON(),e,t,r,n)}if(n instanceof EventTarget)return n;try{return structuredClone(n)}catch{return n}}let Vr=null;function Fa(n){Vr=n}function dt(n,e=!1,t){Vr={p:Vr,i:!1,c:null,e:null,s:n,x:null,l:null}}function ht(n){var e=Vr,t=e.e;if(t!==null){e.e=null;for(var r of t)E_(r)}return e.i=!0,Vr=e.p,{}}function d_(){return!0}let Ao=[];function h_(){var n=Ao;Ao=[],YP(n)}function Ui(n){if(Ao.length===0&&!tc){var e=Ao;queueMicrotask(()=>{e===Ao&&h_()})}Ao.push(n)}function AE(){for(;Ao.length>0;)h_()}function p_(n){var e=Ft;if(e===null)return Et.f|=Vs,n;if((e.f&dv)===0){if((e.f&fv)===0)throw n;e.b.error(n)}else Xa(n,e)}function Xa(n,e){for(;e!==null;){if((e.f&fv)!==0)try{e.b.error(n);return}catch(t){n=t}e=e.parent}throw n}const CE=-7169;function Cn(n,e){n.f=n.f&CE|e}function pv(n){(n.f&ri)!==0||n.deps===null?Cn(n,Xn):Cn(n,Ti)}function m_(n){if(n!==null)for(const e of n)(e.f&Hn)===0||(e.f&jo)===0||(e.f^=jo,m_(e.deps))}function g_(n,e,t){(n.f&Kn)!==0?e.add(n):(n.f&Ti)!==0&&t.add(n),m_(n.deps),Cn(n,Xn)}const gu=new Set;let Rt=null,Qf=null,bi=null,wr=[],Qd=null,rm=!1,tc=!1;class Ws{committed=!1;current=new Map;previous=new Map;#e=new Set;#r=new Set;#t=0;#i=0;#a=null;#s=new Set;#n=new Set;#o=new Map;is_fork=!1;#l=!1;is_deferred(){return this.is_fork||this.#i>0}skip_effect(e){this.#o.has(e)||this.#o.set(e,{d:[],m:[]})}unskip_effect(e){var t=this.#o.get(e);if(t){this.#o.delete(e);for(var r of t.d)Cn(r,Kn),_i(r);for(r of t.m)Cn(r,Ti),_i(r)}}process(e){wr=[],this.apply();var t=[],r=[];for(const i of e)this.#c(i,t,r);if(this.is_deferred()){this.#u(r),this.#u(t);for(const[i,s]of this.#o)y_(i,s)}else{for(const i of this.#e)i();this.#e.clear(),this.#t===0&&this.#f(),Qf=this,Rt=null,Eb(r),Eb(t),Qf=null,this.#a?.resolve()}bi=null}#c(e,t,r){e.f^=Xn;for(var i=e.first,s=null;i!==null;){var o=i.f,a=(o&($i|Jo))!==0,l=a&&(o&Xn)!==0,c=l||(o&Xr)!==0||this.#o.has(i);if(!c&&i.fn!==null){a?i.f^=Xn:s!==null&&(o&($f|$d|o_))!==0?s.b.defer_effect(i):(o&$f)!==0?t.push(i):eu(i)&&((o&Cs)!==0&&this.#n.add(i),mc(i));var u=i.first;if(u!==null){i=u;continue}}var f=i.parent;for(i=i.next;i===null&&f!==null;)f===s&&(s=null),i=f.next,f=f.parent}}#u(e){for(var t=0;t<e.length;t+=1)g_(e[t],this.#s,this.#n)}capture(e,t){t!==Yn&&!this.previous.has(e)&&this.previous.set(e,t),(e.f&Vs)===0&&(this.current.set(e,e.v),bi?.set(e,e.v))}activate(){Rt=this,this.apply()}deactivate(){Rt===this&&(Rt=null,bi=null)}flush(){if(this.activate(),wr.length>0){if(v_(),Rt!==null&&Rt!==this)return}else this.#t===0&&this.process([]);this.deactivate()}discard(){for(const e of this.#r)e(this);this.#r.clear()}#f(){if(gu.size>1){this.previous.clear();var e=bi,t=!0;for(const i of gu){if(i===this){t=!1;continue}const s=[];for(const[a,l]of this.current){if(i.current.has(a))if(t&&l!==i.current.get(a))i.current.set(a,l);else continue;s.push(a)}if(s.length===0)continue;const o=[...i.current.keys()].filter(a=>!this.current.has(a));if(o.length>0){var r=wr;wr=[];const a=new Set,l=new Map;for(const c of s)O_(c,o,a,l);if(wr.length>0){Rt=i,i.apply();for(const c of wr)i.#c(c,[],[]);i.deactivate()}wr=r}}Rt=null,bi=e}this.committed=!0,gu.delete(this)}increment(e){this.#t+=1,e&&(this.#i+=1)}decrement(e){this.#t-=1,e&&(this.#i-=1),!this.#l&&(this.#l=!0,Ui(()=>{this.#l=!1,this.is_deferred()?wr.length>0&&this.flush():this.revive()}))}revive(){for(const e of this.#s)this.#n.delete(e),Cn(e,Kn),_i(e);for(const e of this.#n)Cn(e,Ti),_i(e);this.flush()}oncommit(e){this.#e.add(e)}ondiscard(e){this.#r.add(e)}settled(){return(this.#a??=s_()).promise}static ensure(){if(Rt===null){const e=Rt=new Ws;gu.add(Rt),tc||Ui(()=>{Rt===e&&e.flush()})}return Rt}apply(){}}function TE(n){var e=tc;tc=!0;try{for(var t;;){if(AE(),wr.length===0&&(Rt?.flush(),wr.length===0))return Qd=null,t;v_()}}finally{tc=e}}function v_(){rm=!0;var n=null;try{for(var e=0;wr.length>0;){var t=Ws.ensure();if(e++>1e3){var r,i;PE()}t.process(wr),Ys.clear()}}finally{wr=[],rm=!1,Qd=null}}function PE(){try{iE()}catch(n){Xa(n,Qd)}}let cs=null;function Eb(n){var e=n.length;if(e!==0){for(var t=0;t<e;){var r=n[t++];if((r.f&(Os|Xr))===0&&eu(r)&&(cs=new Set,mc(r),r.deps===null&&r.first===null&&r.nodes===null&&(r.teardown===null&&r.ac===null?M_(r):r.fn=null),cs?.size>0)){Ys.clear();for(const i of cs){if((i.f&(Os|Xr))!==0)continue;const s=[i];let o=i.parent;for(;o!==null;)cs.has(o)&&(cs.delete(o),s.push(o)),o=o.parent;for(let a=s.length-1;a>=0;a--){const l=s[a];(l.f&(Os|Xr))===0&&mc(l)}}cs.clear()}}cs=null}}function O_(n,e,t,r){if(!t.has(n)&&(t.add(n),n.reactions!==null))for(const i of n.reactions){const s=i.f;(s&Hn)!==0?O_(i,e,t,r):(s&(hv|Cs))!==0&&(s&Kn)===0&&b_(i,e,r)&&(Cn(i,Kn),_i(i))}}function b_(n,e,t){const r=t.get(n);if(r!==void 0)return r;if(n.deps!==null)for(const i of n.deps){if(Za.call(e,i))return!0;if((i.f&Hn)!==0&&b_(i,e,t))return t.set(i,!0),!0}return t.set(n,!1),!1}function _i(n){for(var e=Qd=n;e.parent!==null;){e=e.parent;var t=e.f;if(rm&&e===Ft&&(t&Cs)!==0&&(t&a_)===0)return;if((t&(Jo|$i))!==0){if((t&Xn)===0)return;e.f^=Xn}}wr.push(e)}function y_(n,e){if(!((n.f&$i)!==0&&(n.f&Xn)!==0)){(n.f&Kn)!==0?e.d.push(n):(n.f&Ti)!==0&&e.m.push(n),Cn(n,Xn);for(var t=n.first;t!==null;)y_(t,e),t=t.next}}function EE(n){let e=0,t=zo(0),r;return()=>{vv()&&(g(t),Rd(()=>(e===0&&(r=Pr(()=>n(()=>nc(t)))),e+=1,()=>{Ui(()=>{e-=1,e===0&&(r?.(),r=void 0,nc(t))})})))}}var $E=Bo|fl|fv;function QE(n,e,t){new LE(n,e,t)}class LE{parent;is_pending=!1;#e;#r=null;#t;#i;#a;#s=null;#n=null;#o=null;#l=null;#c=null;#u=0;#f=0;#p=!1;#h=!1;#m=new Set;#g=new Set;#d=null;#w=EE(()=>(this.#d=zo(this.#u),()=>{this.#d=null}));constructor(e,t,r){this.#e=e,this.#t=t,this.#i=r,this.parent=Ft.b,this.is_pending=!!this.#t.pending,this.#a=Jc(()=>{Ft.b=this;{var i=this.#b();try{this.#s=Hr(()=>r(i))}catch(s){this.error(s)}this.#f>0?this.#O():this.is_pending=!1}return()=>{this.#c?.remove()}},$E)}#_(){try{this.#s=Hr(()=>this.#i(this.#e))}catch(e){this.error(e)}}#k(){const e=this.#t.pending;e&&(this.#n=Hr(()=>e(this.#e)),Ui(()=>{var t=this.#b();this.#s=this.#v(()=>(Ws.ensure(),Hr(()=>this.#i(t)))),this.#f>0?this.#O():(Ro(this.#n,()=>{this.#n=null}),this.is_pending=!1)}))}#b(){var e=this.#e;return this.is_pending&&(this.#c=bs(),this.#e.before(this.#c),e=this.#c),e}defer_effect(e){g_(e,this.#m,this.#g)}is_rendered(){return!this.is_pending&&(!this.parent||this.parent.is_rendered())}has_pending_snippet(){return!!this.#t.pending}#v(e){var t=Ft,r=Et,i=Vr;es(this.#a),ai(this.#a),Fa(this.#a.ctx);try{return e()}catch(s){return p_(s),null}finally{es(t),ai(r),Fa(i)}}#O(){const e=this.#t.pending;this.#s!==null&&(this.#l=document.createDocumentFragment(),this.#l.append(this.#c),D_(this.#s,this.#l)),this.#n===null&&(this.#n=Hr(()=>e(this.#e)))}#y(e){if(!this.has_pending_snippet()){this.parent&&this.parent.#y(e);return}if(this.#f+=e,this.#f===0){this.is_pending=!1;for(const t of this.#m)Cn(t,Kn),_i(t);for(const t of this.#g)Cn(t,Ti),_i(t);this.#m.clear(),this.#g.clear(),this.#n&&Ro(this.#n,()=>{this.#n=null}),this.#l&&(this.#e.before(this.#l),this.#l=null)}}update_pending_count(e){this.#y(e),this.#u+=e,!(!this.#d||this.#p)&&(this.#p=!0,Ui(()=>{this.#p=!1,this.#d&&Va(this.#d,this.#u)}))}get_effect_pending(){return this.#w(),g(this.#d)}error(e){var t=this.#t.onerror;let r=this.#t.failed;if(this.#h||!t&&!r)throw e;this.#s&&(Tr(this.#s),this.#s=null),this.#n&&(Tr(this.#n),this.#n=null),this.#o&&(Tr(this.#o),this.#o=null);var i=!1,s=!1;const o=()=>{if(i){wE();return}i=!0,s&&cE(),Ws.ensure(),this.#u=0,this.#o!==null&&Ro(this.#o,()=>{this.#o=null}),this.is_pending=this.has_pending_snippet(),this.#s=this.#v(()=>(this.#h=!1,Hr(()=>this.#i(this.#e)))),this.#f>0?this.#O():this.is_pending=!1};Ui(()=>{try{s=!0,t?.(e,o),s=!1}catch(a){Xa(a,this.#a&&this.#a.parent)}r&&(this.#o=this.#v(()=>{Ws.ensure(),this.#h=!0;try{return Hr(()=>{r(this.#e,()=>e,()=>o)})}catch(a){return Xa(a,this.#a.parent),null}finally{this.#h=!1}}))})}}function ME(n,e,t,r){const i=Ld;var s=n.filter(d=>!d.settled);if(t.length===0&&s.length===0){r(e.map(i));return}var o=Rt,a=Ft,l=qE(),c=s.length===1?s[0].promise:s.length>1?Promise.all(s.map(d=>d.promise)):null;function u(d){l();try{r(d)}catch(h){(a.f&Os)===0&&Xa(h,a)}o?.deactivate(),im()}if(t.length===0){c.then(()=>u(e.map(i)));return}function f(){l(),Promise.all(t.map(d=>RE(d))).then(d=>u([...e.map(i),...d])).catch(d=>Xa(d,a))}c?c.then(f):f()}function qE(){var n=Ft,e=Et,t=Vr,r=Rt;return function(s=!0){es(n),ai(e),Fa(t),s&&r?.activate()}}function im(){es(null),ai(null),Fa(null)}function Ld(n){var e=Hn|Kn,t=Et!==null&&(Et.f&Hn)!==0?Et:null;return Ft!==null&&(Ft.f|=fl),{ctx:Vr,deps:null,effects:null,equals:u_,f:e,fn:n,reactions:null,rv:0,v:Yn,wv:0,parent:t??Ft,ac:null}}function RE(n,e,t){let r=Ft;r===null&&JP();var i=r.b,s=void 0,o=zo(Yn),a=!Et,l=new Map;return WE(()=>{var c=s_();s=c.promise;try{Promise.resolve(n()).then(c.resolve,c.reject).then(()=>{u===Rt&&u.committed&&u.deactivate(),im()})}catch(h){c.reject(h),im()}var u=Rt;if(a){var f=i.is_rendered();i.update_pending_count(1),u.increment(f),l.get(u)?.reject(ba),l.delete(u),l.set(u,c)}const d=(h,m=void 0)=>{if(u.activate(),m)m!==ba&&(o.f|=Vs,Va(o,m));else{(o.f&Vs)!==0&&(o.f^=Vs),Va(o,h);for(const[p,v]of l){if(l.delete(p),p===u)break;v.reject(ba)}}a&&(i.update_pending_count(-1),u.decrement(f))};c.promise.then(d,h=>d(null,h||"unknown"))}),Ov(()=>{for(const c of l.values())c.reject(ba)}),new Promise(c=>{function u(f){function d(){f===s?c(o):u(s)}f.then(d,d)}u(s)})}function ge(n){const e=Ld(n);return I_(e),e}function w_(n){const e=Ld(n);return e.equals=f_,e}function __(n){var e=n.effects;if(e!==null){n.effects=null;for(var t=0;t<e.length;t+=1)Tr(e[t])}}function DE(n){for(var e=n.parent;e!==null;){if((e.f&Hn)===0)return(e.f&Os)===0?e:null;e=e.parent}return null}function mv(n){var e,t=Ft;es(DE(n));try{n.f&=~jo,__(n),e=z_(n)}finally{es(t)}return e}function k_(n){var e=mv(n);if(!n.equals(e)&&(n.wv=B_(),(!Rt?.is_fork||n.deps===null)&&(n.v=e,n.deps===null))){Cn(n,Xn);return}Ks||(bi!==null?(vv()||Rt?.is_fork)&&bi.set(n,e):pv(n))}let sm=new Set;const Ys=new Map;let x_=!1;function zo(n,e){var t={f:0,v:n,reactions:null,equals:u_,rv:0,wv:0};return t}function J(n,e){const t=zo(n);return I_(t),t}function IE(n,e=!1,t=!0){const r=zo(n);return e||(r.equals=f_),r}function q(n,e,t=!1){Et!==null&&(!ki||(Et.f&Pb)!==0)&&d_()&&(Et.f&(Hn|Cs|hv|Pb))!==0&&(ii===null||!Za.call(ii,n))&&lE();let r=t?Ht(e):e;return Va(n,r)}function Va(n,e){if(!n.equals(e)){var t=n.v;Ks?Ys.set(n,e):Ys.set(n,t),n.v=e;var r=Ws.ensure();if(r.capture(n,t),(n.f&Hn)!==0){const i=n;(n.f&Kn)!==0&&mv(i),pv(i)}n.wv=B_(),S_(n,Kn),Ft!==null&&(Ft.f&Xn)!==0&&(Ft.f&($i|Jo))===0&&(Ur===null?UE([n]):Ur.push(n)),!r.is_fork&&sm.size>0&&!x_&&NE()}return e}function NE(){x_=!1;for(const n of sm)(n.f&Xn)!==0&&Cn(n,Ti),eu(n)&&mc(n);sm.clear()}function Ah(n,e=1){var t=g(n),r=e===1?t++:t--;return q(n,t),r}function nc(n){q(n,n.v+1)}function S_(n,e){var t=n.reactions;if(t!==null)for(var r=t.length,i=0;i<r;i++){var s=t[i],o=s.f,a=(o&Kn)===0;if(a&&Cn(s,e),(o&Hn)!==0){var l=s;bi?.delete(l),(o&jo)===0&&(o&ri&&(s.f|=jo),S_(l,Ti))}else a&&((o&Cs)!==0&&cs!==null&&cs.add(s),_i(s))}}function Ht(n){if(typeof n!="object"||n===null||qo in n)return n;const e=uv(n);if(e!==i_&&e!==WP)return n;var t=new Map,r=Pd(n),i=J(0),s=Do,o=a=>{if(Do===s)return a();var l=Et,c=Do;ai(null),Mb(s);var u=a();return ai(l),Mb(c),u};return r&&t.set("length",J(n.length)),new Proxy(n,{defineProperty(a,l,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&oE();var u=t.get(l);return u===void 0?o(()=>{var f=J(c.value);return t.set(l,f),f}):q(u,c.value,!0),!0},deleteProperty(a,l){var c=t.get(l);if(c===void 0){if(l in a){const u=o(()=>J(Yn));t.set(l,u),nc(i)}}else q(c,Yn),nc(i);return!0},get(a,l,c){if(l===qo)return n;var u=t.get(l),f=l in a;if(u===void 0&&(!f||$a(a,l)?.writable)&&(u=o(()=>{var h=Ht(f?a[l]:Yn),m=J(h);return m}),t.set(l,u)),u!==void 0){var d=g(u);return d===Yn?void 0:d}return Reflect.get(a,l,c)},getOwnPropertyDescriptor(a,l){var c=Reflect.getOwnPropertyDescriptor(a,l);if(c&&"value"in c){var u=t.get(l);u&&(c.value=g(u))}else if(c===void 0){var f=t.get(l),d=f?.v;if(f!==void 0&&d!==Yn)return{enumerable:!0,configurable:!0,value:d,writable:!0}}return c},has(a,l){if(l===qo)return!0;var c=t.get(l),u=c!==void 0&&c.v!==Yn||Reflect.has(a,l);if(c!==void 0||Ft!==null&&(!u||$a(a,l)?.writable)){c===void 0&&(c=o(()=>{var d=u?Ht(a[l]):Yn,h=J(d);return h}),t.set(l,c));var f=g(c);if(f===Yn)return!1}return u},set(a,l,c,u){var f=t.get(l),d=l in a;if(r&&l==="length")for(var h=c;h<f.v;h+=1){var m=t.get(h+"");m!==void 0?q(m,Yn):h in a&&(m=o(()=>J(Yn)),t.set(h+"",m))}if(f===void 0)(!d||$a(a,l)?.writable)&&(f=o(()=>J(void 0)),q(f,Ht(c)),t.set(l,f));else{d=f.v!==Yn;var p=o(()=>Ht(c));q(f,p)}var v=Reflect.getOwnPropertyDescriptor(a,l);if(v?.set&&v.set.call(u,c),!d){if(r&&typeof l=="string"){var O=t.get("length"),b=Number(l);Number.isInteger(b)&&b>=O.v&&q(O,b+1)}nc(i)}return!0},ownKeys(a){g(i);var l=Reflect.ownKeys(a).filter(f=>{var d=t.get(f);return d===void 0||d.v!==Yn});for(var[c,u]of t)u.v!==Yn&&!(c in a)&&l.push(c);return l},setPrototypeOf(){aE()}})}function $b(n){try{if(n!==null&&typeof n=="object"&&qo in n)return n[qo]}catch{}return n}function BE(n,e){return Object.is($b(n),$b(e))}var Zo,A_,C_,T_;function jE(){if(Zo===void 0){Zo=window,A_=/Firefox/.test(navigator.userAgent);var n=Element.prototype,e=Node.prototype,t=Text.prototype;C_=$a(e,"firstChild").get,T_=$a(e,"nextSibling").get,Tb(n)&&(n.__click=void 0,n.__className=void 0,n.__attributes=null,n.__style=void 0,n.__e=void 0),Tb(t)&&(t.__t=void 0)}}function bs(n=""){return document.createTextNode(n)}function Br(n){return C_.call(n)}function Kc(n){return T_.call(n)}function R(n,e){return Br(n)}function tt(n,e=!1){{var t=Br(n);return t instanceof Comment&&t.data===""?Kc(t):t}}function D(n,e=1,t=!1){let r=n;for(;e--;)r=Kc(r);return r}function zE(n){n.textContent=""}function P_(){return!1}function ks(n,e){{const t=document.body;n.autofocus=!0,Ui(()=>{document.activeElement===t&&n.focus()})}}let Qb=!1;function ZE(){Qb||(Qb=!0,document.addEventListener("reset",n=>{Promise.resolve().then(()=>{if(!n.defaultPrevented)for(const e of n.target.elements)e.__on_r?.()})},{capture:!0}))}function Md(n){var e=Et,t=Ft;ai(null),es(null);try{return n()}finally{ai(e),es(t)}}function gv(n,e,t,r=t){n.addEventListener(e,()=>Md(t));const i=n.__on_r;i?n.__on_r=()=>{i(),r(!0)}:n.__on_r=()=>r(!0),ZE()}function FE(n){Ft===null&&(Et===null&&rE(),nE()),Ks&&tE()}function XE(n,e){var t=e.last;t===null?e.last=e.first=n:(t.next=n,n.prev=t,e.last=n)}function Ts(n,e,t){var r=Ft;r!==null&&(r.f&Xr)!==0&&(n|=Xr);var i={ctx:Vr,deps:null,nodes:null,f:n|Kn|ri,first:null,fn:e,last:null,next:null,parent:r,b:r&&r.b,prev:null,teardown:null,wv:0,ac:null};if(t)try{mc(i),i.f|=dv}catch(a){throw Tr(i),a}else e!==null&&_i(i);var s=i;if(t&&s.deps===null&&s.teardown===null&&s.nodes===null&&s.first===s.last&&(s.f&fl)===0&&(s=s.first,(n&Cs)!==0&&(n&Bo)!==0&&s!==null&&(s.f|=Bo)),s!==null&&(s.parent=r,r!==null&&XE(s,r),Et!==null&&(Et.f&Hn)!==0&&(n&Jo)===0)){var o=Et;(o.effects??=[]).push(s)}return i}function vv(){return Et!==null&&!ki}function Ov(n){const e=Ts($d,null,!1);return Cn(e,Xn),e.teardown=n,e}function hn(n){FE();var e=Ft.f,t=!Et&&(e&$i)!==0&&(e&dv)===0;if(t){var r=Vr;(r.e??=[]).push(n)}else return E_(n)}function E_(n){return Ts($f|UP,n,!1)}function VE(n){Ws.ensure();const e=Ts(Jo|fl,n,!0);return(t={})=>new Promise(r=>{t.outro?Ro(e,()=>{Tr(e),r(void 0)}):(Tr(e),r(void 0))})}function qd(n){return Ts($f,n,!1)}function WE(n){return Ts(hv|fl,n,!0)}function Rd(n,e=0){return Ts($d|e,n,!0)}function ce(n,e=[],t=[],r=[]){ME(r,e,t,i=>{Ts($d,()=>n(...i.map(g)),!0)})}function Jc(n,e=0){var t=Ts(Cs|e,n,!0);return t}function Hr(n){return Ts($i|fl,n,!0)}function $_(n){var e=n.teardown;if(e!==null){const t=Ks,r=Et;Lb(!0),ai(null);try{e.call(null)}finally{Lb(t),ai(r)}}}function Q_(n,e=!1){var t=n.first;for(n.first=n.last=null;t!==null;){const i=t.ac;i!==null&&Md(()=>{i.abort(ba)});var r=t.next;(t.f&Jo)!==0?t.parent=null:Tr(t,e),t=r}}function YE(n){for(var e=n.first;e!==null;){var t=e.next;(e.f&$i)===0&&Tr(e),e=t}}function Tr(n,e=!0){var t=!1;(e||(n.f&a_)!==0)&&n.nodes!==null&&n.nodes.end!==null&&(L_(n.nodes.start,n.nodes.end),t=!0),Q_(n,e&&!t),Lf(n,0),Cn(n,Os);var r=n.nodes&&n.nodes.t;if(r!==null)for(const s of r)s.stop();$_(n);var i=n.parent;i!==null&&i.first!==null&&M_(n),n.next=n.prev=n.teardown=n.ctx=n.deps=n.fn=n.nodes=n.ac=null}function L_(n,e){for(;n!==null;){var t=n===e?null:Kc(n);n.remove(),n=t}}function M_(n){var e=n.parent,t=n.prev,r=n.next;t!==null&&(t.next=r),r!==null&&(r.prev=t),e!==null&&(e.first===n&&(e.first=r),e.last===n&&(e.last=t))}function Ro(n,e,t=!0){var r=[];q_(n,r,!0);var i=()=>{t&&Tr(n),e&&e()},s=r.length;if(s>0){var o=()=>--s||i();for(var a of r)a.out(o)}else i()}function q_(n,e,t){if((n.f&Xr)===0){n.f^=Xr;var r=n.nodes&&n.nodes.t;if(r!==null)for(const a of r)(a.is_global||t)&&e.push(a);for(var i=n.first;i!==null;){var s=i.next,o=(i.f&Bo)!==0||(i.f&$i)!==0&&(n.f&Cs)!==0;q_(i,e,o?t:!1),i=s}}}function bv(n){R_(n,!0)}function R_(n,e){if((n.f&Xr)!==0){n.f^=Xr,(n.f&Xn)===0&&(Cn(n,Kn),_i(n));for(var t=n.first;t!==null;){var r=t.next,i=(t.f&Bo)!==0||(t.f&$i)!==0;R_(t,i?e:!1),t=r}var s=n.nodes&&n.nodes.t;if(s!==null)for(const o of s)(o.is_global||e)&&o.in()}}function D_(n,e){if(n.nodes)for(var t=n.nodes.start,r=n.nodes.end;t!==null;){var i=t===r?null:Kc(t);e.append(t),t=i}}let uf=!1,Ks=!1;function Lb(n){Ks=n}let Et=null,ki=!1;function ai(n){Et=n}let Ft=null;function es(n){Ft=n}let ii=null;function I_(n){Et!==null&&(ii===null?ii=[n]:ii.push(n))}let _r=null,Dr=0,Ur=null;function UE(n){Ur=n}let N_=1,Co=0,Do=Co;function Mb(n){Do=n}function B_(){return++N_}function eu(n){var e=n.f;if((e&Kn)!==0)return!0;if(e&Hn&&(n.f&=~jo),(e&Ti)!==0){for(var t=n.deps,r=t.length,i=0;i<r;i++){var s=t[i];if(eu(s)&&k_(s),s.wv>n.wv)return!0}(e&ri)!==0&&bi===null&&Cn(n,Xn)}return!1}function j_(n,e,t=!0){var r=n.reactions;if(r!==null&&!(ii!==null&&Za.call(ii,n)))for(var i=0;i<r.length;i++){var s=r[i];(s.f&Hn)!==0?j_(s,e,!1):e===s&&(t?Cn(s,Kn):(s.f&Xn)!==0&&Cn(s,Ti),_i(s))}}function z_(n){var e=_r,t=Dr,r=Ur,i=Et,s=ii,o=Vr,a=ki,l=Do,c=n.f;_r=null,Dr=0,Ur=null,Et=(c&($i|Jo))===0?n:null,ii=null,Fa(n.ctx),ki=!1,Do=++Co,n.ac!==null&&(Md(()=>{n.ac.abort(ba)}),n.ac=null);try{n.f|=nm;var u=n.fn,f=u(),d=n.deps,h=Rt?.is_fork;if(_r!==null){var m;if(h||Lf(n,Dr),d!==null&&Dr>0)for(d.length=Dr+_r.length,m=0;m<_r.length;m++)d[Dr+m]=_r[m];else n.deps=d=_r;if(vv()&&(n.f&ri)!==0)for(m=Dr;m<d.length;m++)(d[m].reactions??=[]).push(n)}else!h&&d!==null&&Dr<d.length&&(Lf(n,Dr),d.length=Dr);if(d_()&&Ur!==null&&!ki&&d!==null&&(n.f&(Hn|Ti|Kn))===0)for(m=0;m<Ur.length;m++)j_(Ur[m],n);if(i!==null&&i!==n){if(Co++,i.deps!==null)for(let p=0;p<t;p+=1)i.deps[p].rv=Co;if(e!==null)for(const p of e)p.rv=Co;Ur!==null&&(r===null?r=Ur:r.push(...Ur))}return(n.f&Vs)!==0&&(n.f^=Vs),f}catch(p){return p_(p)}finally{n.f^=nm,_r=e,Dr=t,Ur=r,Et=i,ii=s,Fa(o),ki=a,Do=l}}function GE(n,e){let t=e.reactions;if(t!==null){var r=FP.call(t,n);if(r!==-1){var i=t.length-1;i===0?t=e.reactions=null:(t[r]=t[i],t.pop())}}if(t===null&&(e.f&Hn)!==0&&(_r===null||!Za.call(_r,e))){var s=e;(s.f&ri)!==0&&(s.f^=ri,s.f&=~jo),pv(s),__(s),Lf(s,0)}}function Lf(n,e){var t=n.deps;if(t!==null)for(var r=e;r<t.length;r++)GE(n,t[r])}function mc(n){var e=n.f;if((e&Os)===0){Cn(n,Xn);var t=Ft,r=uf;Ft=n,uf=!0;try{(e&(Cs|o_))!==0?YE(n):Q_(n),$_(n);var i=z_(n);n.teardown=typeof i=="function"?i:null,n.wv=N_;var s;tm&&kE&&(n.f&Kn)!==0&&n.deps}finally{uf=r,Ft=t}}}async function HE(){await Promise.resolve(),TE()}function g(n){var e=n.f,t=(e&Hn)!==0;if(Et!==null&&!ki){var r=Ft!==null&&(Ft.f&Os)!==0;if(!r&&(ii===null||!Za.call(ii,n))){var i=Et.deps;if((Et.f&nm)!==0)n.rv<Co&&(n.rv=Co,_r===null&&i!==null&&i[Dr]===n?Dr++:_r===null?_r=[n]:_r.push(n));else{(Et.deps??=[]).push(n);var s=n.reactions;s===null?n.reactions=[Et]:Za.call(s,Et)||s.push(Et)}}}if(Ks&&Ys.has(n))return Ys.get(n);if(t){var o=n;if(Ks){var a=o.v;return((o.f&Xn)===0&&o.reactions!==null||F_(o))&&(a=mv(o)),Ys.set(o,a),a}var l=(o.f&ri)===0&&!ki&&Et!==null&&(uf||(Et.f&ri)!==0),c=o.deps===null;eu(o)&&(l&&(o.f|=ri),k_(o)),l&&!c&&Z_(o)}if(bi?.has(n))return bi.get(n);if((n.f&Vs)!==0)throw n.v;return n.v}function Z_(n){if(n.deps!==null){n.f|=ri;for(const e of n.deps)(e.reactions??=[]).push(n),(e.f&Hn)!==0&&(e.f&ri)===0&&Z_(e)}}function F_(n){if(n.v===Yn)return!0;if(n.deps===null)return!1;for(const e of n.deps)if(Ys.has(e)||(e.f&Hn)!==0&&F_(e))return!0;return!1}function Pr(n){var e=ki;try{return ki=!0,n()}finally{ki=e}}const KE=["touchstart","touchmove"];function JE(n){return KE.includes(n)}const X_=new Set,om=new Set;function e$(n,e,t,r={}){function i(s){if(r.capture||Vl.call(e,s),!s.cancelBubble)return Md(()=>t?.call(this,s))}return n.startsWith("pointer")||n.startsWith("touch")||n==="wheel"?Ui(()=>{e.addEventListener(n,i,r)}):e.addEventListener(n,i,r),i}function st(n,e,t,r,i){var s={capture:r,passive:i},o=e$(n,e,t,s);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&Ov(()=>{e.removeEventListener(n,o,s)})}function Vt(n){for(var e=0;e<n.length;e++)X_.add(n[e]);for(var t of om)t(n)}let qb=null;function Vl(n){var e=this,t=e.ownerDocument,r=n.type,i=n.composedPath?.()||[],s=i[0]||n.target;qb=n;var o=0,a=qb===n&&n.__root;if(a){var l=i.indexOf(a);if(l!==-1&&(e===document||e===window)){n.__root=e;return}var c=i.indexOf(e);if(c===-1)return;l<=c&&(o=l)}if(s=i[o]||n.target,s!==e){XP(n,"currentTarget",{configurable:!0,get(){return s||t}});var u=Et,f=Ft;ai(null),es(null);try{for(var d,h=[];s!==null;){var m=s.assignedSlot||s.parentNode||s.host||null;try{var p=s["__"+r];p!=null&&(!s.disabled||n.target===s)&&p.call(s,n)}catch(v){d?h.push(v):d=v}if(n.cancelBubble||m===e||m===null)break;s=m}if(d){for(let v of h)queueMicrotask(()=>{throw v});throw d}}finally{n.__root=e,delete n.currentTarget,ai(u),es(f)}}}function yv(n){var e=document.createElement("template");return e.innerHTML=n.replaceAll("<!>","<!---->"),e.content}function Fo(n,e){var t=Ft;t.nodes===null&&(t.nodes={start:n,end:e,a:null,t:null})}function W(n,e){var t=(e&c_)!==0,r=(e&OE)!==0,i,s=!n.startsWith("<!>");return()=>{i===void 0&&(i=yv(s?n:"<!>"+n),t||(i=Br(i)));var o=r||A_?document.importNode(i,!0):i.cloneNode(!0);if(t){var a=Br(o),l=o.lastChild;Fo(a,l)}else Fo(o,o);return o}}function t$(n,e,t="svg"){var r=!n.startsWith("<!>"),i=(e&c_)!==0,s=`<${t}>${r?n:"<!>"+n}</${t}>`,o;return()=>{if(!o){var a=yv(s),l=Br(a);if(i)for(o=document.createDocumentFragment();Br(l);)o.appendChild(Br(l));else o=Br(l)}var c=o.cloneNode(!0);if(i){var u=Br(c),f=c.lastChild;Fo(u,f)}else Fo(c,c);return c}}function Ps(n,e){return t$(n,e,"svg")}function Rb(n=""){{var e=bs(n+"");return Fo(e,e),e}}function an(){var n=document.createDocumentFragment(),e=document.createComment(""),t=bs();return n.append(e,t),Fo(e,t),n}function z(n,e){n!==null&&n.before(e)}function Te(n,e){var t=e==null?"":typeof e=="object"?e+"":e;t!==(n.__t??=n.nodeValue)&&(n.__t=t,n.nodeValue=t+"")}function n$(n,e){return r$(n,e)}const oa=new Map;function r$(n,{target:e,anchor:t,props:r={},events:i,context:s,intro:o=!0}){jE();var a=new Set,l=f=>{for(var d=0;d<f.length;d++){var h=f[d];if(!a.has(h)){a.add(h);var m=JE(h);e.addEventListener(h,Vl,{passive:m});var p=oa.get(h);p===void 0?(document.addEventListener(h,Vl,{passive:m}),oa.set(h,1)):oa.set(h,p+1)}}};l(Ed(X_)),om.add(l);var c=void 0,u=VE(()=>{var f=t??e.appendChild(bs());return QE(f,{pending:()=>{}},d=>{dt({});var h=Vr;s&&(h.c=s),i&&(r.$$events=i),c=n(d,r)||{},ht()}),()=>{for(var d of a){e.removeEventListener(d,Vl);var h=oa.get(d);--h===0?(document.removeEventListener(d,Vl),oa.delete(d)):oa.set(d,h)}om.delete(l),f!==t&&f.parentNode?.removeChild(f)}});return i$.set(c,u),c}let i$=new WeakMap;class wv{anchor;#e=new Map;#r=new Map;#t=new Map;#i=new Set;#a=!0;constructor(e,t=!0){this.anchor=e,this.#a=t}#s=()=>{var e=Rt;if(this.#e.has(e)){var t=this.#e.get(e),r=this.#r.get(t);if(r)bv(r),this.#i.delete(t);else{var i=this.#t.get(t);i&&(this.#r.set(t,i.effect),this.#t.delete(t),i.fragment.lastChild.remove(),this.anchor.before(i.fragment),r=i.effect)}for(const[s,o]of this.#e){if(this.#e.delete(s),s===e)break;const a=this.#t.get(o);a&&(Tr(a.effect),this.#t.delete(o))}for(const[s,o]of this.#r){if(s===t||this.#i.has(s))continue;const a=()=>{if(Array.from(this.#e.values()).includes(s)){var c=document.createDocumentFragment();D_(o,c),c.append(bs()),this.#t.set(s,{effect:o,fragment:c})}else Tr(o);this.#i.delete(s),this.#r.delete(s)};this.#a||!r?(this.#i.add(s),Ro(o,a,!1)):a()}}};#n=e=>{this.#e.delete(e);const t=Array.from(this.#e.values());for(const[r,i]of this.#t)t.includes(r)||(Tr(i.effect),this.#t.delete(r))};ensure(e,t){var r=Rt,i=P_();if(t&&!this.#r.has(e)&&!this.#t.has(e))if(i){var s=document.createDocumentFragment(),o=bs();s.append(o),this.#t.set(e,{effect:Hr(()=>t(o)),fragment:s})}else this.#r.set(e,Hr(()=>t(this.anchor)));if(this.#e.set(r,e),i){for(const[a,l]of this.#r)a===e?r.unskip_effect(l):r.skip_effect(l);for(const[a,l]of this.#t)a===e?r.unskip_effect(l.effect):r.skip_effect(l.effect);r.oncommit(this.#s),r.ondiscard(this.#n)}else this.#s()}}function le(n,e,t=!1){var r=new wv(n),i=t?Bo:0;function s(o,a){r.ensure(o,a)}Jc(()=>{var o=!1;e((a,l=0)=>{o=!0,s(l,a)}),o||s(!1,null)},i)}const s$=Symbol("NaN");function Db(n,e,t){var r=new wv(n);Jc(()=>{var i=e();i!==i&&(i=s$),r.ensure(i,t)})}function Yt(n,e){return e}function o$(n,e,t){for(var r=[],i=e.length,s,o=e.length,a=0;a<i;a++){let f=e[a];Ro(f,()=>{if(s){if(s.pending.delete(f),s.done.add(f),s.pending.size===0){var d=n.outrogroups;am(Ed(s.done)),d.delete(s),d.size===0&&(n.outrogroups=null)}}else o-=1},!1)}if(o===0){var l=r.length===0&&t!==null;if(l){var c=t,u=c.parentNode;zE(u),u.append(c),n.items.clear()}am(e,!l)}else s={pending:new Set(e),done:new Set},(n.outrogroups??=new Set).add(s)}function am(n,e=!0){for(var t=0;t<n.length;t++)Tr(n[t],e)}var Ib;function Ct(n,e,t,r,i,s=null){var o=n,a=new Map,l=(e&l_)!==0;if(l){var c=n;o=c.appendChild(bs())}var u=null,f=w_(()=>{var O=t();return Pd(O)?O:O==null?[]:Ed(O)}),d,h=!0;function m(){v.fallback=u,a$(v,d,o,e,r),u!==null&&(d.length===0?(u.f&ps)===0?bv(u):(u.f^=ps,Wl(u,null,o)):Ro(u,()=>{u=null}))}var p=Jc(()=>{d=g(f);for(var O=d.length,b=new Set,w=Rt,S=P_(),_=0;_<O;_+=1){var x=d[_],A=r(x,_),C=h?null:a.get(A);C?(C.v&&Va(C.v,x),C.i&&Va(C.i,_),S&&w.unskip_effect(C.e)):(C=l$(a,h?o:Ib??=bs(),x,A,_,i,e,t),h||(C.e.f|=ps),a.set(A,C)),b.add(A)}if(O===0&&s&&!u&&(h?u=Hr(()=>s(o)):(u=Hr(()=>s(Ib??=bs())),u.f|=ps)),O>b.size&&eE(),!h)if(S){for(const[y,k]of a)b.has(y)||w.skip_effect(k.e);w.oncommit(m),w.ondiscard(()=>{})}else m();g(f)}),v={effect:p,items:a,outrogroups:null,fallback:u};h=!1}function Al(n){for(;n!==null&&(n.f&$i)===0;)n=n.next;return n}function a$(n,e,t,r,i){var s=(r&dE)!==0,o=e.length,a=n.items,l=Al(n.effect.first),c,u=null,f,d=[],h=[],m,p,v,O;if(s)for(O=0;O<o;O+=1)m=e[O],p=i(m,O),v=a.get(p).e,(v.f&ps)===0&&(v.nodes?.a?.measure(),(f??=new Set).add(v));for(O=0;O<o;O+=1){if(m=e[O],p=i(m,O),v=a.get(p).e,n.outrogroups!==null)for(const k of n.outrogroups)k.pending.delete(v),k.done.delete(v);if((v.f&ps)!==0)if(v.f^=ps,v===l)Wl(v,null,t);else{var b=u?u.next:l;v===n.effect.last&&(n.effect.last=v.prev),v.prev&&(v.prev.next=v.next),v.next&&(v.next.prev=v.prev),Ls(n,u,v),Ls(n,v,b),Wl(v,b,t),u=v,d=[],h=[],l=Al(u.next);continue}if((v.f&Xr)!==0&&(bv(v),s&&(v.nodes?.a?.unfix(),(f??=new Set).delete(v))),v!==l){if(c!==void 0&&c.has(v)){if(d.length<h.length){var w=h[0],S;u=w.prev;var _=d[0],x=d[d.length-1];for(S=0;S<d.length;S+=1)Wl(d[S],w,t);for(S=0;S<h.length;S+=1)c.delete(h[S]);Ls(n,_.prev,x.next),Ls(n,u,_),Ls(n,x,w),l=w,u=x,O-=1,d=[],h=[]}else c.delete(v),Wl(v,l,t),Ls(n,v.prev,v.next),Ls(n,v,u===null?n.effect.first:u.next),Ls(n,u,v),u=v;continue}for(d=[],h=[];l!==null&&l!==v;)(c??=new Set).add(l),h.push(l),l=Al(l.next);if(l===null)continue}(v.f&ps)===0&&d.push(v),u=v,l=Al(v.next)}if(n.outrogroups!==null){for(const k of n.outrogroups)k.pending.size===0&&(am(Ed(k.done)),n.outrogroups?.delete(k));n.outrogroups.size===0&&(n.outrogroups=null)}if(l!==null||c!==void 0){var A=[];if(c!==void 0)for(v of c)(v.f&Xr)===0&&A.push(v);for(;l!==null;)(l.f&Xr)===0&&l!==n.fallback&&A.push(l),l=Al(l.next);var C=A.length;if(C>0){var y=(r&l_)!==0&&o===0?t:null;if(s){for(O=0;O<C;O+=1)A[O].nodes?.a?.measure();for(O=0;O<C;O+=1)A[O].nodes?.a?.fix()}o$(n,A,y)}}s&&Ui(()=>{if(f!==void 0)for(v of f)v.nodes?.a?.apply()})}function l$(n,e,t,r,i,s,o,a){var l=(o&uE)!==0?(o&hE)===0?IE(t,!1,!1):zo(t):null,c=(o&fE)!==0?zo(i):null;return{v:l,i:c,e:Hr(()=>(s(e,l??t,c??i,a),()=>{n.delete(r)}))}}function Wl(n,e,t){if(n.nodes)for(var r=n.nodes.start,i=n.nodes.end,s=e&&(e.f&ps)===0?e.nodes.start:t;r!==null;){var o=Kc(r);if(s.before(r),r===i)return;r=o}}function Ls(n,e,t){e===null?n.effect.first=t:e.next=t,t===null?n.effect.last=e:t.prev=e}function V_(n,e,t=!1,r=!1,i=!1){var s=n,o="";ce(()=>{var a=Ft;if(o!==(o=e()??"")&&(a.nodes!==null&&(L_(a.nodes.start,a.nodes.end),a.nodes=null),o!=="")){var l=o+"";t?l=`<svg>${l}</svg>`:r&&(l=`<math>${l}</math>`);var c=yv(l);if((t||r)&&(c=Br(c)),Fo(Br(c),c.lastChild),t||r)for(;Br(c);)s.before(Br(c));else s.before(c)}})}function ya(n,e,...t){var r=new wv(n);Jc(()=>{const i=e()??null;r.ensure(i,i&&(s=>i(s,...t)))},Bo)}function c$(n,e,t){qd(()=>{var r=Pr(()=>e(n,t?.())||{});if(r?.destroy)return()=>r.destroy()})}const Nb=[...`
|
|
3
|
-
\r\f \v\uFEFF`];function u$(n,e,t){var r=n==null?"":""+n;if(t){for(var i in t)if(t[i])r=r?r+" "+i:i;else if(r.length)for(var s=i.length,o=0;(o=r.indexOf(i,o))>=0;){var a=o+s;(o===0||Nb.includes(r[o-1]))&&(a===r.length||Nb.includes(r[a]))?r=(o===0?"":r.substring(0,o))+r.substring(a+1):o=a}}return r===""?null:r}function f$(n,e){return n==null?null:String(n)}function Be(n,e,t,r,i,s){var o=n.__className;if(o!==t||o===void 0){var a=u$(t,r,s);a==null?n.removeAttribute("class"):e?n.className=a:n.setAttribute("class",a),n.__className=t}else if(s&&i!==s)for(var l in s){var c=!!s[l];(i==null||c!==!!i[l])&&n.classList.toggle(l,c)}return s}function Er(n,e,t,r){var i=n.__style;if(i!==e){var s=f$(e);s==null?n.removeAttribute("style"):n.style.cssText=s,n.__style=e}return r}function gc(n,e,t=!1){if(n.multiple){if(e==null)return;if(!Pd(e))return yE();for(var r of n.options)r.selected=e.includes(rc(r));return}for(r of n.options){var i=rc(r);if(BE(i,e)){r.selected=!0;return}}(!t||e!==void 0)&&(n.selectedIndex=-1)}function Mf(n){var e=new MutationObserver(()=>{gc(n,n.__value)});e.observe(n,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),Ov(()=>{e.disconnect()})}function W_(n,e,t=e){var r=new WeakSet,i=!0;gv(n,"change",s=>{var o=s?"[selected]":":checked",a;if(n.multiple)a=[].map.call(n.querySelectorAll(o),rc);else{var l=n.querySelector(o)??n.querySelector("option:not([disabled])");a=l&&rc(l)}t(a),Rt!==null&&r.add(Rt)}),qd(()=>{var s=e();if(n===document.activeElement){var o=Qf??Rt;if(r.has(o))return}if(gc(n,s,i),i&&s===void 0){var a=n.querySelector(":checked");a!==null&&(s=rc(a),t(s))}n.__value=s,i=!1}),Mf(n)}function rc(n){return"__value"in n?n.__value:n.value}const d$=Symbol("is custom element"),h$=Symbol("is html");function sn(n,e){var t=Y_(n);t.value===(t.value=e??void 0)||n.value===e&&(e!==0||n.nodeName!=="PROGRESS")||(n.value=e??"")}function St(n,e,t,r){var i=Y_(n);i[e]!==(i[e]=t)&&(e==="loading"&&(n[HP]=t),t==null?n.removeAttribute(e):typeof t!="string"&&p$(n).includes(e)?n[e]=t:n.setAttribute(e,t))}function Y_(n){return n.__attributes??={[d$]:n.nodeName.includes("-"),[h$]:n.namespaceURI===bE}}var Bb=new Map;function p$(n){var e=n.getAttribute("is")||n.nodeName,t=Bb.get(e);if(t)return t;Bb.set(e,t=[]);for(var r,i=n,s=Element.prototype;s!==i;){r=VP(i);for(var o in r)r[o].set&&t.push(o);i=uv(i)}return t}function Qn(n,e,t=e){var r=new WeakSet;gv(n,"input",async i=>{var s=i?n.defaultValue:n.value;if(s=Ch(n)?Th(s):s,t(s),Rt!==null&&r.add(Rt),await HE(),s!==(s=e())){var o=n.selectionStart,a=n.selectionEnd,l=n.value.length;if(n.value=s??"",a!==null){var c=n.value.length;o===a&&a===l&&c>l?(n.selectionStart=c,n.selectionEnd=c):(n.selectionStart=o,n.selectionEnd=Math.min(a,c))}}}),Pr(e)==null&&n.value&&(t(Ch(n)?Th(n.value):n.value),Rt!==null&&r.add(Rt)),Rd(()=>{var i=e();if(n===document.activeElement){var s=Qf??Rt;if(r.has(s))return}Ch(n)&&i===Th(n.value)||n.type==="date"&&!i&&!n.value||i!==n.value&&(n.value=i??"")})}function lm(n,e,t=e){gv(n,"change",r=>{var i=r?n.defaultChecked:n.checked;t(i)}),Pr(e)==null&&t(n.checked),Rd(()=>{var r=e();n.checked=!!r})}function Ch(n){var e=n.type;return e==="number"||e==="range"}function Th(n){return n===""?null:+n}class _v{#e=new WeakMap;#r;#t;static entries=new WeakMap;constructor(e){this.#t=e}observe(e,t){var r=this.#e.get(e)||new Set;return r.add(t),this.#e.set(e,r),this.#i().observe(e,this.#t),()=>{var i=this.#e.get(e);i.delete(t),i.size===0&&(this.#e.delete(e),this.#r.unobserve(e))}}#i(){return this.#r??(this.#r=new ResizeObserver(e=>{for(var t of e){_v.entries.set(t.target,t);for(var r of this.#e.get(t.target)||[])r(t)}}))}}var m$=new _v({box:"border-box"});function g$(n,e,t){var r=m$.observe(n,()=>t(n[e]));qd(()=>(Pr(()=>t(n[e])),r))}function jb(n,e){return n===e||n?.[qo]===e}function ln(n={},e,t,r){return qd(()=>{var i,s;return Rd(()=>{i=s,s=[],Pr(()=>{n!==t(...s)&&(e(n,...s),i&&jb(t(...i),n)&&e(null,...i))})}),()=>{Ui(()=>{s&&jb(t(...s),n)&&e(null,...s)})}}),n}let vu=!1;function v$(n){var e=vu;try{return vu=!1,[n(),vu]}finally{vu=e}}function xt(n,e,t,r){var i=(t&gE)!==0,s=(t&vE)!==0,o=r,a=!0,l=()=>(a&&(a=!1,o=s?Pr(r):r),o),c;if(i){var u=qo in n||GP in n;c=$a(n,e)?.set??(u&&e in n?b=>n[e]=b:void 0)}var f,d=!1;i?[f,d]=v$(()=>n[e]):f=n[e],f===void 0&&r!==void 0&&(f=l(),c&&(sE(),c(f)));var h;if(h=()=>{var b=n[e];return b===void 0?l():(a=!0,b)},(t&mE)===0)return h;if(c){var m=n.$$legacy;return(function(b,w){return arguments.length>0?((!w||m||d)&&c(w?h():b),b):h()})}var p=!1,v=((t&pE)!==0?Ld:w_)(()=>(p=!1,h()));i&&g(v);var O=Ft;return(function(b,w){if(arguments.length>0){const S=w?g(v):i?Ht(b):b;return q(v,S),p=!0,o!==void 0&&(o=S),b}return Ks&&p||(O.f&Os)!==0?v.v:g(v)})}function ao(n){Vr===null&&KP(),hn(()=>{const e=Pr(n);if(typeof e=="function")return e})}const O$="modulepreload",b$=function(n){return"/"+n},zb={},re=function(e,t,r){let i=Promise.resolve();if(t&&t.length>0){let l=function(c){return Promise.all(c.map(u=>Promise.resolve(u).then(f=>({status:"fulfilled",value:f}),f=>({status:"rejected",reason:f}))))};document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=o?.nonce||o?.getAttribute("nonce");i=l(t.map(c=>{if(c=b$(c),c in zb)return;zb[c]=!0;const u=c.endsWith(".css"),f=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${f}`))return;const d=document.createElement("link");if(d.rel=u?"stylesheet":O$,u||(d.as="script"),d.crossOrigin="",d.href=c,a&&d.setAttribute("nonce",a),document.head.appendChild(d),u)return new Promise((h,m)=>{d.addEventListener("load",h),d.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function s(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return i.then(o=>{for(const a of o||[])a.status==="rejected"&&s(a.reason);return e().catch(s)})},y$="5";typeof window<"u"&&((window.__svelte??={}).v??=new Set).add(y$);const kv=Symbol.for("yaml.alias"),cm=Symbol.for("yaml.document"),Us=Symbol.for("yaml.map"),U_=Symbol.for("yaml.pair"),ts=Symbol.for("yaml.scalar"),dl=Symbol.for("yaml.seq"),li=Symbol.for("yaml.node.type"),lo=n=>!!n&&typeof n=="object"&&n[li]===kv,ea=n=>!!n&&typeof n=="object"&&n[li]===cm,hl=n=>!!n&&typeof n=="object"&&n[li]===Us,pn=n=>!!n&&typeof n=="object"&&n[li]===U_,nn=n=>!!n&&typeof n=="object"&&n[li]===ts,pl=n=>!!n&&typeof n=="object"&&n[li]===dl;function On(n){if(n&&typeof n=="object")switch(n[li]){case Us:case dl:return!0}return!1}function yn(n){if(n&&typeof n=="object")switch(n[li]){case kv:case Us:case ts:case dl:return!0}return!1}const G_=n=>(nn(n)||On(n))&&!!n.anchor,xr=Symbol("break visit"),H_=Symbol("skip children"),Gi=Symbol("remove node");function ta(n,e){const t=K_(e);ea(n)?wa(null,n.contents,t,Object.freeze([n]))===Gi&&(n.contents=null):wa(null,n,t,Object.freeze([]))}ta.BREAK=xr;ta.SKIP=H_;ta.REMOVE=Gi;function wa(n,e,t,r){const i=J_(n,e,t,r);if(yn(i)||pn(i))return ek(n,r,i),wa(n,i,t,r);if(typeof i!="symbol"){if(On(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){const o=wa(s,e.items[s],t,r);if(typeof o=="number")s=o-1;else{if(o===xr)return xr;o===Gi&&(e.items.splice(s,1),s-=1)}}}else if(pn(e)){r=Object.freeze(r.concat(e));const s=wa("key",e.key,t,r);if(s===xr)return xr;s===Gi&&(e.key=null);const o=wa("value",e.value,t,r);if(o===xr)return xr;o===Gi&&(e.value=null)}}return i}async function Dd(n,e){const t=K_(e);ea(n)?await _a(null,n.contents,t,Object.freeze([n]))===Gi&&(n.contents=null):await _a(null,n,t,Object.freeze([]))}Dd.BREAK=xr;Dd.SKIP=H_;Dd.REMOVE=Gi;async function _a(n,e,t,r){const i=await J_(n,e,t,r);if(yn(i)||pn(i))return ek(n,r,i),_a(n,i,t,r);if(typeof i!="symbol"){if(On(e)){r=Object.freeze(r.concat(e));for(let s=0;s<e.items.length;++s){const o=await _a(s,e.items[s],t,r);if(typeof o=="number")s=o-1;else{if(o===xr)return xr;o===Gi&&(e.items.splice(s,1),s-=1)}}}else if(pn(e)){r=Object.freeze(r.concat(e));const s=await _a("key",e.key,t,r);if(s===xr)return xr;s===Gi&&(e.key=null);const o=await _a("value",e.value,t,r);if(o===xr)return xr;o===Gi&&(e.value=null)}}return i}function K_(n){return typeof n=="object"&&(n.Collection||n.Node||n.Value)?Object.assign({Alias:n.Node,Map:n.Node,Scalar:n.Node,Seq:n.Node},n.Value&&{Map:n.Value,Scalar:n.Value,Seq:n.Value},n.Collection&&{Map:n.Collection,Seq:n.Collection},n):n}function J_(n,e,t,r){if(typeof t=="function")return t(n,e,r);if(hl(e))return t.Map?.(n,e,r);if(pl(e))return t.Seq?.(n,e,r);if(pn(e))return t.Pair?.(n,e,r);if(nn(e))return t.Scalar?.(n,e,r);if(lo(e))return t.Alias?.(n,e,r)}function ek(n,e,t){const r=e[e.length-1];if(On(r))r.items[n]=t;else if(pn(r))n==="key"?r.key=t:r.value=t;else if(ea(r))r.contents=t;else{const i=lo(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${i} parent`)}}const w$={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},_$=n=>n.replace(/[!,[\]{}]/g,e=>w$[e]);class cr{constructor(e,t){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},cr.defaultYaml,e),this.tags=Object.assign({},cr.defaultTags,t)}clone(){const e=new cr(this.yaml,this.tags);return e.docStart=this.docStart,e}atDocument(){const e=new cr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:cr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},cr.defaultTags);break}return e}add(e,t){this.atNextDocument&&(this.yaml={explicit:cr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},cr.defaultTags),this.atNextDocument=!1);const r=e.trim().split(/[ \t]+/),i=r.shift();switch(i){case"%TAG":{if(r.length!==2&&(t(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[s,o]=r;return this.tags[s]=o,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return t(0,"%YAML directive should contain exactly one part"),!1;const[s]=r;if(s==="1.1"||s==="1.2")return this.yaml.version=s,!0;{const o=/^\d+\.\d+$/.test(s);return t(6,`Unsupported YAML version ${s}`,o),!1}}default:return t(0,`Unknown directive ${i}`,!0),!1}}tagName(e,t){if(e==="!")return"!";if(e[0]!=="!")return t(`Not a valid tag: ${e}`),null;if(e[1]==="<"){const o=e.slice(2,-1);return o==="!"||o==="!!"?(t(`Verbatim tags aren't resolved, so ${e} is invalid.`),null):(e[e.length-1]!==">"&&t("Verbatim tags must end with a >"),o)}const[,r,i]=e.match(/^(.*!)([^!]*)$/s);i||t(`The ${e} tag has no suffix`);const s=this.tags[r];if(s)try{return s+decodeURIComponent(i)}catch(o){return t(String(o)),null}return r==="!"?e:(t(`Could not resolve tag: ${e}`),null)}tagString(e){for(const[t,r]of Object.entries(this.tags))if(e.startsWith(r))return t+_$(e.substring(r.length));return e[0]==="!"?e:`!<${e}>`}toString(e){const t=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let i;if(e&&r.length>0&&yn(e.contents)){const s={};ta(e.contents,(o,a)=>{yn(a)&&a.tag&&(s[a.tag]=!0)}),i=Object.keys(s)}else i=[];for(const[s,o]of r)s==="!!"&&o==="tag:yaml.org,2002:"||(!e||i.some(a=>a.startsWith(o)))&&t.push(`%TAG ${s} ${o}`);return t.join(`
|
|
4
|
-
`)}}cr.defaultYaml={explicit:!1,version:"1.2"};cr.defaultTags={"!!":"tag:yaml.org,2002:"};function tk(n){if(/[\x00-\x19\s,[\]{}]/.test(n)){const t=`Anchor must not contain whitespace or control characters: ${JSON.stringify(n)}`;throw new Error(t)}return!0}function nk(n){const e=new Set;return ta(n,{Value(t,r){r.anchor&&e.add(r.anchor)}}),e}function rk(n,e){for(let t=1;;++t){const r=`${n}${t}`;if(!e.has(r))return r}}function k$(n,e){const t=[],r=new Map;let i=null;return{onAnchor:s=>{t.push(s),i??(i=nk(n));const o=rk(e,i);return i.add(o),o},setAnchors:()=>{for(const s of t){const o=r.get(s);if(typeof o=="object"&&o.anchor&&(nn(o.node)||On(o.node)))o.node.anchor=o.anchor;else{const a=new Error("Failed to resolve repeated object (this should not happen)");throw a.source=s,a}}},sourceObjects:r}}function ka(n,e,t,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let i=0,s=r.length;i<s;++i){const o=r[i],a=ka(n,r,String(i),o);a===void 0?delete r[i]:a!==o&&(r[i]=a)}else if(r instanceof Map)for(const i of Array.from(r.keys())){const s=r.get(i),o=ka(n,r,i,s);o===void 0?r.delete(i):o!==s&&r.set(i,o)}else if(r instanceof Set)for(const i of Array.from(r)){const s=ka(n,r,i,i);s===void 0?r.delete(i):s!==i&&(r.delete(i),r.add(s))}else for(const[i,s]of Object.entries(r)){const o=ka(n,r,i,s);o===void 0?delete r[i]:o!==s&&(r[i]=o)}return n.call(e,t,r)}function si(n,e,t){if(Array.isArray(n))return n.map((r,i)=>si(r,String(i),t));if(n&&typeof n.toJSON=="function"){if(!t||!G_(n))return n.toJSON(e,t);const r={aliasCount:0,count:1,res:void 0};t.anchors.set(n,r),t.onCreate=s=>{r.res=s,delete t.onCreate};const i=n.toJSON(e,t);return t.onCreate&&t.onCreate(i),i}return typeof n=="bigint"&&!t?.keep?Number(n):n}class xv{constructor(e){Object.defineProperty(this,li,{value:e})}clone(){const e=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(e.range=this.range.slice()),e}toJS(e,{mapAsMap:t,maxAliasCount:r,onAnchor:i,reviver:s}={}){if(!ea(e))throw new TypeError("A document argument is required");const o={anchors:new Map,doc:e,keep:!0,mapAsMap:t===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},a=si(this,"",o);if(typeof i=="function")for(const{count:l,res:c}of o.anchors.values())i(c,l);return typeof s=="function"?ka(s,{"":a},"",a):a}}class Id extends xv{constructor(e){super(kv),this.source=e,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(e,t){let r;t?.aliasResolveCache?r=t.aliasResolveCache:(r=[],ta(e,{Node:(s,o)=>{(lo(o)||G_(o))&&r.push(o)}}),t&&(t.aliasResolveCache=r));let i;for(const s of r){if(s===this)break;s.anchor===this.source&&(i=s)}return i}toJSON(e,t){if(!t)return{source:this.source};const{anchors:r,doc:i,maxAliasCount:s}=t,o=this.resolve(i,t);if(!o){const l=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(l)}let a=r.get(o);if(a||(si(o,null,t),a=r.get(o)),a?.res===void 0){const l="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(l)}if(s>=0&&(a.count+=1,a.aliasCount===0&&(a.aliasCount=ff(i,o,r)),a.count*a.aliasCount>s)){const l="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(l)}return a.res}toString(e,t,r){const i=`*${this.source}`;if(e){if(tk(this.source),e.options.verifyAliasOrder&&!e.anchors.has(this.source)){const s=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(s)}if(e.implicitKey)return`${i} `}return i}}function ff(n,e,t){if(lo(e)){const r=e.resolve(n),i=t&&r&&t.get(r);return i?i.count*i.aliasCount:0}else if(On(e)){let r=0;for(const i of e.items){const s=ff(n,i,t);s>r&&(r=s)}return r}else if(pn(e)){const r=ff(n,e.key,t),i=ff(n,e.value,t);return Math.max(r,i)}return 1}const ik=n=>!n||typeof n!="function"&&typeof n!="object";class ot extends xv{constructor(e){super(ts),this.value=e}toJSON(e,t){return t?.keep?this.value:si(this.value,e,t)}toString(){return String(this.value)}}ot.BLOCK_FOLDED="BLOCK_FOLDED";ot.BLOCK_LITERAL="BLOCK_LITERAL";ot.PLAIN="PLAIN";ot.QUOTE_DOUBLE="QUOTE_DOUBLE";ot.QUOTE_SINGLE="QUOTE_SINGLE";const x$="tag:yaml.org,2002:";function S$(n,e,t){if(e){const r=t.filter(s=>s.tag===e),i=r.find(s=>!s.format)??r[0];if(!i)throw new Error(`Tag ${e} not found`);return i}return t.find(r=>r.identify?.(n)&&!r.format)}function vc(n,e,t){if(ea(n)&&(n=n.contents),yn(n))return n;if(pn(n)){const f=t.schema[Us].createNode?.(t.schema,null,t);return f.items.push(n),f}(n instanceof String||n instanceof Number||n instanceof Boolean||typeof BigInt<"u"&&n instanceof BigInt)&&(n=n.valueOf());const{aliasDuplicateObjects:r,onAnchor:i,onTagObj:s,schema:o,sourceObjects:a}=t;let l;if(r&&n&&typeof n=="object"){if(l=a.get(n),l)return l.anchor??(l.anchor=i(n)),new Id(l.anchor);l={anchor:null,node:null},a.set(n,l)}e?.startsWith("!!")&&(e=x$+e.slice(2));let c=S$(n,e,o.tags);if(!c){if(n&&typeof n.toJSON=="function"&&(n=n.toJSON()),!n||typeof n!="object"){const f=new ot(n);return l&&(l.node=f),f}c=n instanceof Map?o[Us]:Symbol.iterator in Object(n)?o[dl]:o[Us]}s&&(s(c),delete t.onTagObj);const u=c?.createNode?c.createNode(t.schema,n,t):typeof c?.nodeClass?.from=="function"?c.nodeClass.from(t.schema,n,t):new ot(n);return e?u.tag=e:c.default||(u.tag=c.tag),l&&(l.node=u),u}function qf(n,e,t){let r=t;for(let i=e.length-1;i>=0;--i){const s=e[i];if(typeof s=="number"&&Number.isInteger(s)&&s>=0){const o=[];o[s]=r,r=o}else r=new Map([[s,r]])}return vc(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:n,sourceObjects:new Map})}const Yl=n=>n==null||typeof n=="object"&&!!n[Symbol.iterator]().next().done;class sk extends xv{constructor(e,t){super(e),Object.defineProperty(this,"schema",{value:t,configurable:!0,enumerable:!1,writable:!0})}clone(e){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return e&&(t.schema=e),t.items=t.items.map(r=>yn(r)||pn(r)?r.clone(e):r),this.range&&(t.range=this.range.slice()),t}addIn(e,t){if(Yl(e))this.add(t);else{const[r,...i]=e,s=this.get(r,!0);if(On(s))s.addIn(i,t);else if(s===void 0&&this.schema)this.set(r,qf(this.schema,i,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}deleteIn(e){const[t,...r]=e;if(r.length===0)return this.delete(t);const i=this.get(t,!0);if(On(i))return i.deleteIn(r);throw new Error(`Expected YAML collection at ${t}. Remaining path: ${r}`)}getIn(e,t){const[r,...i]=e,s=this.get(r,!0);return i.length===0?!t&&nn(s)?s.value:s:On(s)?s.getIn(i,t):void 0}hasAllNullValues(e){return this.items.every(t=>{if(!pn(t))return!1;const r=t.value;return r==null||e&&nn(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(e){const[t,...r]=e;if(r.length===0)return this.has(t);const i=this.get(t,!0);return On(i)?i.hasIn(r):!1}setIn(e,t){const[r,...i]=e;if(i.length===0)this.set(r,t);else{const s=this.get(r,!0);if(On(s))s.setIn(i,t);else if(s===void 0&&this.schema)this.set(r,qf(this.schema,i,t));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${i}`)}}}const A$=n=>n.replace(/^(?!$)(?: $)?/gm,"#");function ms(n,e){return/^\n+$/.test(n)?n.substring(1):e?n.replace(/^(?! *$)/gm,e):n}const To=(n,e,t)=>n.endsWith(`
|
|
5
|
-
`)?ms(t,e):t.includes(`
|
|
6
|
-
`)?`
|
|
7
|
-
`+ms(t,e):(n.endsWith(" ")?"":" ")+t,ok="flow",um="block",df="quoted";function Nd(n,e,t="flow",{indentAtStart:r,lineWidth:i=80,minContentWidth:s=20,onFold:o,onOverflow:a}={}){if(!i||i<0)return n;i<s&&(s=0);const l=Math.max(1+s,1+i-e.length);if(n.length<=l)return n;const c=[],u={};let f=i-e.length;typeof r=="number"&&(r>i-Math.max(2,s)?c.push(0):f=i-r);let d,h,m=!1,p=-1,v=-1,O=-1;t===um&&(p=Zb(n,p,e.length),p!==-1&&(f=p+l));for(let w;w=n[p+=1];){if(t===df&&w==="\\"){switch(v=p,n[p+1]){case"x":p+=3;break;case"u":p+=5;break;case"U":p+=9;break;default:p+=1}O=p}if(w===`
|
|
8
|
-
`)t===um&&(p=Zb(n,p,e.length)),f=p+e.length+l,d=void 0;else{if(w===" "&&h&&h!==" "&&h!==`
|
|
9
|
-
`&&h!==" "){const S=n[p+1];S&&S!==" "&&S!==`
|
|
10
|
-
`&&S!==" "&&(d=p)}if(p>=f)if(d)c.push(d),f=d+l,d=void 0;else if(t===df){for(;h===" "||h===" ";)h=w,w=n[p+=1],m=!0;const S=p>O+1?p-2:v-1;if(u[S])return n;c.push(S),u[S]=!0,f=S+l,d=void 0}else m=!0}h=w}if(m&&a&&a(),c.length===0)return n;o&&o();let b=n.slice(0,c[0]);for(let w=0;w<c.length;++w){const S=c[w],_=c[w+1]||n.length;S===0?b=`
|
|
11
|
-
${e}${n.slice(0,_)}`:(t===df&&u[S]&&(b+=`${n[S]}\\`),b+=`
|
|
12
|
-
${e}${n.slice(S+1,_)}`)}return b}function Zb(n,e,t){let r=e,i=e+1,s=n[i];for(;s===" "||s===" ";)if(e<i+t)s=n[++e];else{do s=n[++e];while(s&&s!==`
|
|
13
|
-
`);r=e,i=e+1,s=n[i]}return r}const Bd=(n,e)=>({indentAtStart:e?n.indent.length:n.indentAtStart,lineWidth:n.options.lineWidth,minContentWidth:n.options.minContentWidth}),jd=n=>/^(%|---|\.\.\.)/m.test(n);function C$(n,e,t){if(!e||e<0)return!1;const r=e-t,i=n.length;if(i<=r)return!1;for(let s=0,o=0;s<i;++s)if(n[s]===`
|
|
14
|
-
`){if(s-o>r)return!0;if(o=s+1,i-o<=r)return!1}return!0}function ic(n,e){const t=JSON.stringify(n);if(e.options.doubleQuotedAsJSON)return t;const{implicitKey:r}=e,i=e.options.doubleQuotedMinMultiLineLength,s=e.indent||(jd(n)?" ":"");let o="",a=0;for(let l=0,c=t[l];c;c=t[++l])if(c===" "&&t[l+1]==="\\"&&t[l+2]==="n"&&(o+=t.slice(a,l)+"\\ ",l+=1,a=l,c="\\"),c==="\\")switch(t[l+1]){case"u":{o+=t.slice(a,l);const u=t.substr(l+2,4);switch(u){case"0000":o+="\\0";break;case"0007":o+="\\a";break;case"000b":o+="\\v";break;case"001b":o+="\\e";break;case"0085":o+="\\N";break;case"00a0":o+="\\_";break;case"2028":o+="\\L";break;case"2029":o+="\\P";break;default:u.substr(0,2)==="00"?o+="\\x"+u.substr(2):o+=t.substr(l,6)}l+=5,a=l+1}break;case"n":if(r||t[l+2]==='"'||t.length<i)l+=1;else{for(o+=t.slice(a,l)+`
|
|
15
|
-
|
|
16
|
-
`;t[l+2]==="\\"&&t[l+3]==="n"&&t[l+4]!=='"';)o+=`
|
|
17
|
-
`,l+=2;o+=s,t[l+2]===" "&&(o+="\\"),l+=1,a=l+1}break;default:l+=1}return o=a?o+t.slice(a):t,r?o:Nd(o,s,df,Bd(e,!1))}function fm(n,e){if(e.options.singleQuote===!1||e.implicitKey&&n.includes(`
|
|
18
|
-
`)||/[ \t]\n|\n[ \t]/.test(n))return ic(n,e);const t=e.indent||(jd(n)?" ":""),r="'"+n.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
19
|
-
${t}`)+"'";return e.implicitKey?r:Nd(r,t,ok,Bd(e,!1))}function xa(n,e){const{singleQuote:t}=e.options;let r;if(t===!1)r=ic;else{const i=n.includes('"'),s=n.includes("'");i&&!s?r=fm:s&&!i?r=ic:r=t?fm:ic}return r(n,e)}let dm;try{dm=new RegExp(`(^|(?<!
|
|
20
|
-
))
|
|
21
|
-
+(?!
|
|
22
|
-
|$)`,"g")}catch{dm=/\n+(?!\n|$)/g}function hf({comment:n,type:e,value:t},r,i,s){const{blockQuote:o,commentString:a,lineWidth:l}=r.options;if(!o||/\n[\t ]+$/.test(t))return xa(t,r);const c=r.indent||(r.forceBlockIndent||jd(t)?" ":""),u=o==="literal"?!0:o==="folded"||e===ot.BLOCK_FOLDED?!1:e===ot.BLOCK_LITERAL?!0:!C$(t,l,c.length);if(!t)return u?`|
|
|
23
|
-
`:`>
|
|
24
|
-
`;let f,d;for(d=t.length;d>0;--d){const _=t[d-1];if(_!==`
|
|
25
|
-
`&&_!==" "&&_!==" ")break}let h=t.substring(d);const m=h.indexOf(`
|
|
26
|
-
`);m===-1?f="-":t===h||m!==h.length-1?(f="+",s&&s()):f="",h&&(t=t.slice(0,-h.length),h[h.length-1]===`
|
|
27
|
-
`&&(h=h.slice(0,-1)),h=h.replace(dm,`$&${c}`));let p=!1,v,O=-1;for(v=0;v<t.length;++v){const _=t[v];if(_===" ")p=!0;else if(_===`
|
|
28
|
-
`)O=v;else break}let b=t.substring(0,O<v?O+1:v);b&&(t=t.substring(b.length),b=b.replace(/\n+/g,`$&${c}`));let S=(p?c?"2":"1":"")+f;if(n&&(S+=" "+a(n.replace(/ ?[\r\n]+/g," ")),i&&i()),!u){const _=t.replace(/\n+/g,`
|
|
29
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${c}`);let x=!1;const A=Bd(r,!0);o!=="folded"&&e!==ot.BLOCK_FOLDED&&(A.onOverflow=()=>{x=!0});const C=Nd(`${b}${_}${h}`,c,um,A);if(!x)return`>${S}
|
|
30
|
-
${c}${C}`}return t=t.replace(/\n+/g,`$&${c}`),`|${S}
|
|
31
|
-
${c}${b}${t}${h}`}function T$(n,e,t,r){const{type:i,value:s}=n,{actualString:o,implicitKey:a,indent:l,indentStep:c,inFlow:u}=e;if(a&&s.includes(`
|
|
32
|
-
`)||u&&/[[\]{},]/.test(s))return xa(s,e);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(s))return a||u||!s.includes(`
|
|
33
|
-
`)?xa(s,e):hf(n,e,t,r);if(!a&&!u&&i!==ot.PLAIN&&s.includes(`
|
|
34
|
-
`))return hf(n,e,t,r);if(jd(s)){if(l==="")return e.forceBlockIndent=!0,hf(n,e,t,r);if(a&&l===c)return xa(s,e)}const f=s.replace(/\n+/g,`$&
|
|
35
|
-
${l}`);if(o){const d=p=>p.default&&p.tag!=="tag:yaml.org,2002:str"&&p.test?.test(f),{compat:h,tags:m}=e.doc.schema;if(m.some(d)||h?.some(d))return xa(s,e)}return a?f:Nd(f,l,ok,Bd(e,!1))}function tu(n,e,t,r){const{implicitKey:i,inFlow:s}=e,o=typeof n.value=="string"?n:Object.assign({},n,{value:String(n.value)});let{type:a}=n;a!==ot.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(o.value)&&(a=ot.QUOTE_DOUBLE);const l=u=>{switch(u){case ot.BLOCK_FOLDED:case ot.BLOCK_LITERAL:return i||s?xa(o.value,e):hf(o,e,t,r);case ot.QUOTE_DOUBLE:return ic(o.value,e);case ot.QUOTE_SINGLE:return fm(o.value,e);case ot.PLAIN:return T$(o,e,t,r);default:return null}};let c=l(a);if(c===null){const{defaultKeyType:u,defaultStringType:f}=e.options,d=i&&u||f;if(c=l(d),c===null)throw new Error(`Unsupported default string type ${d}`)}return c}function ak(n,e){const t=Object.assign({blockQuote:!0,commentString:A$,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trueStr:"true",verifyAliasOrder:!0},n.schema.toStringOptions,e);let r;switch(t.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:n,flowCollectionPadding:t.flowCollectionPadding?" ":"",indent:"",indentStep:typeof t.indent=="number"?" ".repeat(t.indent):" ",inFlow:r,options:t}}function P$(n,e){if(e.tag){const i=n.filter(s=>s.tag===e.tag);if(i.length>0)return i.find(s=>s.format===e.format)??i[0]}let t,r;if(nn(e)){r=e.value;let i=n.filter(s=>s.identify?.(r));if(i.length>1){const s=i.filter(o=>o.test);s.length>0&&(i=s)}t=i.find(s=>s.format===e.format)??i.find(s=>!s.format)}else r=e,t=n.find(i=>i.nodeClass&&r instanceof i.nodeClass);if(!t){const i=r?.constructor?.name??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${i} value`)}return t}function E$(n,e,{anchors:t,doc:r}){if(!r.directives)return"";const i=[],s=(nn(n)||On(n))&&n.anchor;s&&tk(s)&&(t.add(s),i.push(`&${s}`));const o=n.tag??(e.default?null:e.tag);return o&&i.push(r.directives.tagString(o)),i.join(" ")}function Wa(n,e,t,r){if(pn(n))return n.toString(e,t,r);if(lo(n)){if(e.doc.directives)return n.toString(e);if(e.resolvedAliases?.has(n))throw new TypeError("Cannot stringify circular structure without alias nodes");e.resolvedAliases?e.resolvedAliases.add(n):e.resolvedAliases=new Set([n]),n=n.resolve(e.doc)}let i;const s=yn(n)?n:e.doc.createNode(n,{onTagObj:l=>i=l});i??(i=P$(e.doc.schema.tags,s));const o=E$(s,i,e);o.length>0&&(e.indentAtStart=(e.indentAtStart??0)+o.length+1);const a=typeof i.stringify=="function"?i.stringify(s,e,t,r):nn(s)?tu(s,e,t,r):s.toString(e,t,r);return o?nn(s)||a[0]==="{"||a[0]==="["?`${o} ${a}`:`${o}
|
|
36
|
-
${e.indent}${a}`:a}function $$({key:n,value:e},t,r,i){const{allNullValues:s,doc:o,indent:a,indentStep:l,options:{commentString:c,indentSeq:u,simpleKeys:f}}=t;let d=yn(n)&&n.comment||null;if(f){if(d)throw new Error("With simple keys, key nodes cannot have comments");if(On(n)||!yn(n)&&typeof n=="object"){const A="With simple keys, collection cannot be used as a key value";throw new Error(A)}}let h=!f&&(!n||d&&e==null&&!t.inFlow||On(n)||(nn(n)?n.type===ot.BLOCK_FOLDED||n.type===ot.BLOCK_LITERAL:typeof n=="object"));t=Object.assign({},t,{allNullValues:!1,implicitKey:!h&&(f||!s),indent:a+l});let m=!1,p=!1,v=Wa(n,t,()=>m=!0,()=>p=!0);if(!h&&!t.inFlow&&v.length>1024){if(f)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");h=!0}if(t.inFlow){if(s||e==null)return m&&r&&r(),v===""?"?":h?`? ${v}`:v}else if(s&&!f||e==null&&h)return v=`? ${v}`,d&&!m?v+=To(v,t.indent,c(d)):p&&i&&i(),v;m&&(d=null),h?(d&&(v+=To(v,t.indent,c(d))),v=`? ${v}
|
|
37
|
-
${a}:`):(v=`${v}:`,d&&(v+=To(v,t.indent,c(d))));let O,b,w;yn(e)?(O=!!e.spaceBefore,b=e.commentBefore,w=e.comment):(O=!1,b=null,w=null,e&&typeof e=="object"&&(e=o.createNode(e))),t.implicitKey=!1,!h&&!d&&nn(e)&&(t.indentAtStart=v.length+1),p=!1,!u&&l.length>=2&&!t.inFlow&&!h&&pl(e)&&!e.flow&&!e.tag&&!e.anchor&&(t.indent=t.indent.substring(2));let S=!1;const _=Wa(e,t,()=>S=!0,()=>p=!0);let x=" ";if(d||O||b){if(x=O?`
|
|
38
|
-
`:"",b){const A=c(b);x+=`
|
|
39
|
-
${ms(A,t.indent)}`}_===""&&!t.inFlow?x===`
|
|
40
|
-
`&&w&&(x=`
|
|
41
|
-
|
|
42
|
-
`):x+=`
|
|
43
|
-
${t.indent}`}else if(!h&&On(e)){const A=_[0],C=_.indexOf(`
|
|
44
|
-
`),y=C!==-1,k=t.inFlow??e.flow??e.items.length===0;if(y||!k){let P=!1;if(y&&(A==="&"||A==="!")){let T=_.indexOf(" ");A==="&"&&T!==-1&&T<C&&_[T+1]==="!"&&(T=_.indexOf(" ",T+1)),(T===-1||C<T)&&(P=!0)}P||(x=`
|
|
45
|
-
${t.indent}`)}}else(_===""||_[0]===`
|
|
46
|
-
`)&&(x="");return v+=x+_,t.inFlow?S&&r&&r():w&&!S?v+=To(v,t.indent,c(w)):p&&i&&i(),v}function lk(n,e){(n==="debug"||n==="warn")&&console.warn(e)}const Ou="<<",ys={identify:n=>n===Ou||typeof n=="symbol"&&n.description===Ou,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new ot(Symbol(Ou)),{addToJSMap:ck}),stringify:()=>Ou},Q$=(n,e)=>(ys.identify(e)||nn(e)&&(!e.type||e.type===ot.PLAIN)&&ys.identify(e.value))&&n?.doc.schema.tags.some(t=>t.tag===ys.tag&&t.default);function ck(n,e,t){if(t=n&&lo(t)?t.resolve(n.doc):t,pl(t))for(const r of t.items)Ph(n,e,r);else if(Array.isArray(t))for(const r of t)Ph(n,e,r);else Ph(n,e,t)}function Ph(n,e,t){const r=n&&lo(t)?t.resolve(n.doc):t;if(!hl(r))throw new Error("Merge sources must be maps or map aliases");const i=r.toJSON(null,n,Map);for(const[s,o]of i)e instanceof Map?e.has(s)||e.set(s,o):e instanceof Set?e.add(s):Object.prototype.hasOwnProperty.call(e,s)||Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0});return e}function uk(n,e,{key:t,value:r}){if(yn(t)&&t.addToJSMap)t.addToJSMap(n,e,r);else if(Q$(n,t))ck(n,e,r);else{const i=si(t,"",n);if(e instanceof Map)e.set(i,si(r,i,n));else if(e instanceof Set)e.add(i);else{const s=L$(t,i,n),o=si(r,s,n);s in e?Object.defineProperty(e,s,{value:o,writable:!0,enumerable:!0,configurable:!0}):e[s]=o}}return e}function L$(n,e,t){if(e===null)return"";if(typeof e!="object")return String(e);if(yn(n)&&t?.doc){const r=ak(t.doc,{});r.anchors=new Set;for(const s of t.anchors.keys())r.anchors.add(s.anchor);r.inFlow=!0,r.inStringifyKey=!0;const i=n.toString(r);if(!t.mapKeyWarned){let s=JSON.stringify(i);s.length>40&&(s=s.substring(0,36)+'..."'),lk(t.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${s}. Set mapAsMap: true to use object keys.`),t.mapKeyWarned=!0}return i}return JSON.stringify(e)}function Sv(n,e,t){const r=vc(n,void 0,t),i=vc(e,void 0,t);return new sr(r,i)}class sr{constructor(e,t=null){Object.defineProperty(this,li,{value:U_}),this.key=e,this.value=t}clone(e){let{key:t,value:r}=this;return yn(t)&&(t=t.clone(e)),yn(r)&&(r=r.clone(e)),new sr(t,r)}toJSON(e,t){const r=t?.mapAsMap?new Map:{};return uk(t,r,this)}toString(e,t,r){return e?.doc?$$(this,e,t,r):JSON.stringify(this)}}function fk(n,e,t){return(e.inFlow??n.flow?q$:M$)(n,e,t)}function M$({comment:n,items:e},t,{blockItemPrefix:r,flowChars:i,itemIndent:s,onChompKeep:o,onComment:a}){const{indent:l,options:{commentString:c}}=t,u=Object.assign({},t,{indent:s,type:null});let f=!1;const d=[];for(let m=0;m<e.length;++m){const p=e[m];let v=null;if(yn(p))!f&&p.spaceBefore&&d.push(""),Rf(t,d,p.commentBefore,f),p.comment&&(v=p.comment);else if(pn(p)){const b=yn(p.key)?p.key:null;b&&(!f&&b.spaceBefore&&d.push(""),Rf(t,d,b.commentBefore,f))}f=!1;let O=Wa(p,u,()=>v=null,()=>f=!0);v&&(O+=To(O,s,c(v))),f&&v&&(f=!1),d.push(r+O)}let h;if(d.length===0)h=i.start+i.end;else{h=d[0];for(let m=1;m<d.length;++m){const p=d[m];h+=p?`
|
|
47
|
-
${l}${p}`:`
|
|
48
|
-
`}}return n?(h+=`
|
|
49
|
-
`+ms(c(n),l),a&&a()):f&&o&&o(),h}function q$({items:n},e,{flowChars:t,itemIndent:r}){const{indent:i,indentStep:s,flowCollectionPadding:o,options:{commentString:a}}=e;r+=s;const l=Object.assign({},e,{indent:r,inFlow:!0,type:null});let c=!1,u=0;const f=[];for(let m=0;m<n.length;++m){const p=n[m];let v=null;if(yn(p))p.spaceBefore&&f.push(""),Rf(e,f,p.commentBefore,!1),p.comment&&(v=p.comment);else if(pn(p)){const b=yn(p.key)?p.key:null;b&&(b.spaceBefore&&f.push(""),Rf(e,f,b.commentBefore,!1),b.comment&&(c=!0));const w=yn(p.value)?p.value:null;w?(w.comment&&(v=w.comment),w.commentBefore&&(c=!0)):p.value==null&&b?.comment&&(v=b.comment)}v&&(c=!0);let O=Wa(p,l,()=>v=null);m<n.length-1&&(O+=","),v&&(O+=To(O,r,a(v))),!c&&(f.length>u||O.includes(`
|
|
50
|
-
`))&&(c=!0),f.push(O),u=f.length}const{start:d,end:h}=t;if(f.length===0)return d+h;if(!c){const m=f.reduce((p,v)=>p+v.length+2,2);c=e.options.lineWidth>0&&m>e.options.lineWidth}if(c){let m=d;for(const p of f)m+=p?`
|
|
51
|
-
${s}${i}${p}`:`
|
|
52
|
-
`;return`${m}
|
|
53
|
-
${i}${h}`}else return`${d}${o}${f.join(" ")}${o}${h}`}function Rf({indent:n,options:{commentString:e}},t,r,i){if(r&&i&&(r=r.replace(/^\n+/,"")),r){const s=ms(e(r),n);t.push(s.trimStart())}}function Po(n,e){const t=nn(e)?e.value:e;for(const r of n)if(pn(r)&&(r.key===e||r.key===t||nn(r.key)&&r.key.value===t))return r}class jr extends sk{static get tagName(){return"tag:yaml.org,2002:map"}constructor(e){super(Us,e),this.items=[]}static from(e,t,r){const{keepUndefined:i,replacer:s}=r,o=new this(e),a=(l,c)=>{if(typeof s=="function")c=s.call(t,l,c);else if(Array.isArray(s)&&!s.includes(l))return;(c!==void 0||i)&&o.items.push(Sv(l,c,r))};if(t instanceof Map)for(const[l,c]of t)a(l,c);else if(t&&typeof t=="object")for(const l of Object.keys(t))a(l,t[l]);return typeof e.sortMapEntries=="function"&&o.items.sort(e.sortMapEntries),o}add(e,t){let r;pn(e)?r=e:!e||typeof e!="object"||!("key"in e)?r=new sr(e,e?.value):r=new sr(e.key,e.value);const i=Po(this.items,r.key),s=this.schema?.sortMapEntries;if(i){if(!t)throw new Error(`Key ${r.key} already set`);nn(i.value)&&ik(r.value)?i.value.value=r.value:i.value=r.value}else if(s){const o=this.items.findIndex(a=>s(r,a)<0);o===-1?this.items.push(r):this.items.splice(o,0,r)}else this.items.push(r)}delete(e){const t=Po(this.items,e);return t?this.items.splice(this.items.indexOf(t),1).length>0:!1}get(e,t){const i=Po(this.items,e)?.value;return(!t&&nn(i)?i.value:i)??void 0}has(e){return!!Po(this.items,e)}set(e,t){this.add(new sr(e,t),!0)}toJSON(e,t,r){const i=r?new r:t?.mapAsMap?new Map:{};t?.onCreate&&t.onCreate(i);for(const s of this.items)uk(t,i,s);return i}toString(e,t,r){if(!e)return JSON.stringify(this);for(const i of this.items)if(!pn(i))throw new Error(`Map items must all be pairs; found ${JSON.stringify(i)} instead`);return!e.allNullValues&&this.hasAllNullValues(!1)&&(e=Object.assign({},e,{allNullValues:!0})),fk(this,e,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:e.indent||"",onChompKeep:r,onComment:t})}}const ml={collection:"map",default:!0,nodeClass:jr,tag:"tag:yaml.org,2002:map",resolve(n,e){return hl(n)||e("Expected a mapping for this tag"),n},createNode:(n,e,t)=>jr.from(n,e,t)};class Js extends sk{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(e){super(dl,e),this.items=[]}add(e){this.items.push(e)}delete(e){const t=bu(e);return typeof t!="number"?!1:this.items.splice(t,1).length>0}get(e,t){const r=bu(e);if(typeof r!="number")return;const i=this.items[r];return!t&&nn(i)?i.value:i}has(e){const t=bu(e);return typeof t=="number"&&t<this.items.length}set(e,t){const r=bu(e);if(typeof r!="number")throw new Error(`Expected a valid index, not ${e}.`);const i=this.items[r];nn(i)&&ik(t)?i.value=t:this.items[r]=t}toJSON(e,t){const r=[];t?.onCreate&&t.onCreate(r);let i=0;for(const s of this.items)r.push(si(s,String(i++),t));return r}toString(e,t,r){return e?fk(this,e,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(e.indent||"")+" ",onChompKeep:r,onComment:t}):JSON.stringify(this)}static from(e,t,r){const{replacer:i}=r,s=new this(e);if(t&&Symbol.iterator in Object(t)){let o=0;for(let a of t){if(typeof i=="function"){const l=t instanceof Set?a:String(o++);a=i.call(t,l,a)}s.items.push(vc(a,void 0,r))}}return s}}function bu(n){let e=nn(n)?n.value:n;return e&&typeof e=="string"&&(e=Number(e)),typeof e=="number"&&Number.isInteger(e)&&e>=0?e:null}const gl={collection:"seq",default:!0,nodeClass:Js,tag:"tag:yaml.org,2002:seq",resolve(n,e){return pl(n)||e("Expected a sequence for this tag"),n},createNode:(n,e,t)=>Js.from(n,e,t)},zd={identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify(n,e,t,r){return e=Object.assign({actualString:!0},e),tu(n,e,t,r)}},Zd={identify:n=>n==null,createNode:()=>new ot(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new ot(null),stringify:({source:n},e)=>typeof n=="string"&&Zd.test.test(n)?n:e.options.nullStr},Av={identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:n=>new ot(n[0]==="t"||n[0]==="T"),stringify({source:n,value:e},t){if(n&&Av.test.test(n)){const r=n[0]==="t"||n[0]==="T";if(e===r)return n}return e?t.options.trueStr:t.options.falseStr}};function Qi({format:n,minFractionDigits:e,tag:t,value:r}){if(typeof r=="bigint")return String(r);const i=typeof r=="number"?r:Number(r);if(!isFinite(i))return isNaN(i)?".nan":i<0?"-.inf":".inf";let s=Object.is(r,-0)?"-0":JSON.stringify(r);if(!n&&e&&(!t||t==="tag:yaml.org,2002:float")&&/^\d/.test(s)){let o=s.indexOf(".");o<0&&(o=s.length,s+=".");let a=e-(s.length-o-1);for(;a-- >0;)s+="0"}return s}const dk={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Qi},hk={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Qi(n)}},pk={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(n){const e=new ot(parseFloat(n)),t=n.indexOf(".");return t!==-1&&n[n.length-1]==="0"&&(e.minFractionDigits=n.length-t-1),e},stringify:Qi},Fd=n=>typeof n=="bigint"||Number.isInteger(n),Cv=(n,e,t,{intAsBigInt:r})=>r?BigInt(n):parseInt(n.substring(e),t);function mk(n,e,t){const{value:r}=n;return Fd(r)&&r>=0?t+r.toString(e):Qi(n)}const gk={identify:n=>Fd(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(n,e,t)=>Cv(n,2,8,t),stringify:n=>mk(n,8,"0o")},vk={identify:Fd,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(n,e,t)=>Cv(n,0,10,t),stringify:Qi},Ok={identify:n=>Fd(n)&&n>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(n,e,t)=>Cv(n,2,16,t),stringify:n=>mk(n,16,"0x")},R$=[ml,gl,zd,Zd,Av,gk,vk,Ok,dk,hk,pk];function Fb(n){return typeof n=="bigint"||Number.isInteger(n)}const yu=({value:n})=>JSON.stringify(n),D$=[{identify:n=>typeof n=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:n=>n,stringify:yu},{identify:n=>n==null,createNode:()=>new ot(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:yu},{identify:n=>typeof n=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:n=>n==="true",stringify:yu},{identify:Fb,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(n,e,{intAsBigInt:t})=>t?BigInt(n):parseInt(n,10),stringify:({value:n})=>Fb(n)?n.toString():JSON.stringify(n)},{identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:n=>parseFloat(n),stringify:yu}],I$={default:!0,tag:"",test:/^/,resolve(n,e){return e(`Unresolved plain scalar ${JSON.stringify(n)}`),n}},N$=[ml,gl].concat(D$,I$),Tv={identify:n=>n instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(n,e){if(typeof atob=="function"){const t=atob(n.replace(/[\n\r]/g,"")),r=new Uint8Array(t.length);for(let i=0;i<t.length;++i)r[i]=t.charCodeAt(i);return r}else return e("This environment does not support reading binary tags; either Buffer or atob is required"),n},stringify({comment:n,type:e,value:t},r,i,s){if(!t)return"";const o=t;let a;if(typeof btoa=="function"){let l="";for(let c=0;c<o.length;++c)l+=String.fromCharCode(o[c]);a=btoa(l)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(e??(e=ot.BLOCK_LITERAL),e!==ot.QUOTE_DOUBLE){const l=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),c=Math.ceil(a.length/l),u=new Array(c);for(let f=0,d=0;f<c;++f,d+=l)u[f]=a.substr(d,l);a=u.join(e===ot.BLOCK_LITERAL?`
|
|
54
|
-
`:" ")}return tu({comment:n,type:e,value:a},r,i,s)}};function bk(n,e){if(pl(n))for(let t=0;t<n.items.length;++t){let r=n.items[t];if(!pn(r)){if(hl(r)){r.items.length>1&&e("Each pair must have its own sequence indicator");const i=r.items[0]||new sr(new ot(null));if(r.commentBefore&&(i.key.commentBefore=i.key.commentBefore?`${r.commentBefore}
|
|
55
|
-
${i.key.commentBefore}`:r.commentBefore),r.comment){const s=i.value??i.key;s.comment=s.comment?`${r.comment}
|
|
56
|
-
${s.comment}`:r.comment}r=i}n.items[t]=pn(r)?r:new sr(r)}}else e("Expected a sequence for this tag");return n}function yk(n,e,t){const{replacer:r}=t,i=new Js(n);i.tag="tag:yaml.org,2002:pairs";let s=0;if(e&&Symbol.iterator in Object(e))for(let o of e){typeof r=="function"&&(o=r.call(e,String(s++),o));let a,l;if(Array.isArray(o))if(o.length===2)a=o[0],l=o[1];else throw new TypeError(`Expected [key, value] tuple: ${o}`);else if(o&&o instanceof Object){const c=Object.keys(o);if(c.length===1)a=c[0],l=o[a];else throw new TypeError(`Expected tuple with one key, not ${c.length} keys`)}else a=o;i.items.push(Sv(a,l,t))}return i}const Pv={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:bk,createNode:yk};class Qa extends Js{constructor(){super(),this.add=jr.prototype.add.bind(this),this.delete=jr.prototype.delete.bind(this),this.get=jr.prototype.get.bind(this),this.has=jr.prototype.has.bind(this),this.set=jr.prototype.set.bind(this),this.tag=Qa.tag}toJSON(e,t){if(!t)return super.toJSON(e);const r=new Map;t?.onCreate&&t.onCreate(r);for(const i of this.items){let s,o;if(pn(i)?(s=si(i.key,"",t),o=si(i.value,s,t)):s=si(i,"",t),r.has(s))throw new Error("Ordered maps must not include duplicate keys");r.set(s,o)}return r}static from(e,t,r){const i=yk(e,t,r),s=new this;return s.items=i.items,s}}Qa.tag="tag:yaml.org,2002:omap";const Ev={collection:"seq",identify:n=>n instanceof Map,nodeClass:Qa,default:!1,tag:"tag:yaml.org,2002:omap",resolve(n,e){const t=bk(n,e),r=[];for(const{key:i}of t.items)nn(i)&&(r.includes(i.value)?e(`Ordered maps must not include duplicate keys: ${i.value}`):r.push(i.value));return Object.assign(new Qa,t)},createNode:(n,e,t)=>Qa.from(n,e,t)};function wk({value:n,source:e},t){return e&&(n?_k:kk).test.test(e)?e:n?t.options.trueStr:t.options.falseStr}const _k={identify:n=>n===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new ot(!0),stringify:wk},kk={identify:n=>n===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new ot(!1),stringify:wk},B$={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:n=>n.slice(-3).toLowerCase()==="nan"?NaN:n[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:Qi},j$={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:n=>parseFloat(n.replace(/_/g,"")),stringify(n){const e=Number(n.value);return isFinite(e)?e.toExponential():Qi(n)}},z$={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(n){const e=new ot(parseFloat(n.replace(/_/g,""))),t=n.indexOf(".");if(t!==-1){const r=n.substring(t+1).replace(/_/g,"");r[r.length-1]==="0"&&(e.minFractionDigits=r.length)}return e},stringify:Qi},nu=n=>typeof n=="bigint"||Number.isInteger(n);function Xd(n,e,t,{intAsBigInt:r}){const i=n[0];if((i==="-"||i==="+")&&(e+=1),n=n.substring(e).replace(/_/g,""),r){switch(t){case 2:n=`0b${n}`;break;case 8:n=`0o${n}`;break;case 16:n=`0x${n}`;break}const o=BigInt(n);return i==="-"?BigInt(-1)*o:o}const s=parseInt(n,t);return i==="-"?-1*s:s}function $v(n,e,t){const{value:r}=n;if(nu(r)){const i=r.toString(e);return r<0?"-"+t+i.substr(1):t+i}return Qi(n)}const Z$={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(n,e,t)=>Xd(n,2,2,t),stringify:n=>$v(n,2,"0b")},F$={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(n,e,t)=>Xd(n,1,8,t),stringify:n=>$v(n,8,"0")},X$={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(n,e,t)=>Xd(n,0,10,t),stringify:Qi},V$={identify:nu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(n,e,t)=>Xd(n,2,16,t),stringify:n=>$v(n,16,"0x")};class La extends jr{constructor(e){super(e),this.tag=La.tag}add(e){let t;pn(e)?t=e:e&&typeof e=="object"&&"key"in e&&"value"in e&&e.value===null?t=new sr(e.key,null):t=new sr(e,null),Po(this.items,t.key)||this.items.push(t)}get(e,t){const r=Po(this.items,e);return!t&&pn(r)?nn(r.key)?r.key.value:r.key:r}set(e,t){if(typeof t!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof t}`);const r=Po(this.items,e);r&&!t?this.items.splice(this.items.indexOf(r),1):!r&&t&&this.items.push(new sr(e))}toJSON(e,t){return super.toJSON(e,t,Set)}toString(e,t,r){if(!e)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},e,{allNullValues:!0}),t,r);throw new Error("Set items must all have null values")}static from(e,t,r){const{replacer:i}=r,s=new this(e);if(t&&Symbol.iterator in Object(t))for(let o of t)typeof i=="function"&&(o=i.call(t,o,o)),s.items.push(Sv(o,null,r));return s}}La.tag="tag:yaml.org,2002:set";const Qv={collection:"map",identify:n=>n instanceof Set,nodeClass:La,default:!1,tag:"tag:yaml.org,2002:set",createNode:(n,e,t)=>La.from(n,e,t),resolve(n,e){if(hl(n)){if(n.hasAllNullValues(!0))return Object.assign(new La,n);e("Set items must all have null values")}else e("Expected a mapping for this tag");return n}};function Lv(n,e){const t=n[0],r=t==="-"||t==="+"?n.substring(1):n,i=o=>e?BigInt(o):Number(o),s=r.replace(/_/g,"").split(":").reduce((o,a)=>o*i(60)+i(a),i(0));return t==="-"?i(-1)*s:s}function xk(n){let{value:e}=n,t=o=>o;if(typeof e=="bigint")t=o=>BigInt(o);else if(isNaN(e)||!isFinite(e))return Qi(n);let r="";e<0&&(r="-",e*=t(-1));const i=t(60),s=[e%i];return e<60?s.unshift(0):(e=(e-s[0])/i,s.unshift(e%i),e>=60&&(e=(e-s[0])/i,s.unshift(e))),r+s.map(o=>String(o).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const Sk={identify:n=>typeof n=="bigint"||Number.isInteger(n),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(n,e,{intAsBigInt:t})=>Lv(n,t),stringify:xk},Ak={identify:n=>typeof n=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:n=>Lv(n,!1),stringify:xk},Vd={identify:n=>n instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(n){const e=n.match(Vd.test);if(!e)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,t,r,i,s,o,a]=e.map(Number),l=e[7]?Number((e[7]+"00").substr(1,3)):0;let c=Date.UTC(t,r-1,i,s||0,o||0,a||0,l);const u=e[8];if(u&&u!=="Z"){let f=Lv(u,!1);Math.abs(f)<30&&(f*=60),c-=6e4*f}return new Date(c)},stringify:({value:n})=>n?.toISOString().replace(/(T00:00:00)?\.000Z$/,"")??""},Xb=[ml,gl,zd,Zd,_k,kk,Z$,F$,X$,V$,B$,j$,z$,Tv,ys,Ev,Pv,Qv,Sk,Ak,Vd],Vb=new Map([["core",R$],["failsafe",[ml,gl,zd]],["json",N$],["yaml11",Xb],["yaml-1.1",Xb]]),Wb={binary:Tv,bool:Av,float:pk,floatExp:hk,floatNaN:dk,floatTime:Ak,int:vk,intHex:Ok,intOct:gk,intTime:Sk,map:ml,merge:ys,null:Zd,omap:Ev,pairs:Pv,seq:gl,set:Qv,timestamp:Vd},W$={"tag:yaml.org,2002:binary":Tv,"tag:yaml.org,2002:merge":ys,"tag:yaml.org,2002:omap":Ev,"tag:yaml.org,2002:pairs":Pv,"tag:yaml.org,2002:set":Qv,"tag:yaml.org,2002:timestamp":Vd};function Eh(n,e,t){const r=Vb.get(e);if(r&&!n)return t&&!r.includes(ys)?r.concat(ys):r.slice();let i=r;if(!i)if(Array.isArray(n))i=[];else{const s=Array.from(Vb.keys()).filter(o=>o!=="yaml11").map(o=>JSON.stringify(o)).join(", ");throw new Error(`Unknown schema "${e}"; use one of ${s} or define customTags array`)}if(Array.isArray(n))for(const s of n)i=i.concat(s);else typeof n=="function"&&(i=n(i.slice()));return t&&(i=i.concat(ys)),i.reduce((s,o)=>{const a=typeof o=="string"?Wb[o]:o;if(!a){const l=JSON.stringify(o),c=Object.keys(Wb).map(u=>JSON.stringify(u)).join(", ");throw new Error(`Unknown custom tag ${l}; use one of ${c}`)}return s.includes(a)||s.push(a),s},[])}const Y$=(n,e)=>n.key<e.key?-1:n.key>e.key?1:0;let Ck=class Tk{constructor({compat:e,customTags:t,merge:r,resolveKnownTags:i,schema:s,sortMapEntries:o,toStringDefaults:a}){this.compat=Array.isArray(e)?Eh(e,"compat"):e?Eh(null,e):null,this.name=typeof s=="string"&&s||"core",this.knownTags=i?W$:{},this.tags=Eh(t,this.name,r),this.toStringOptions=a??null,Object.defineProperty(this,Us,{value:ml}),Object.defineProperty(this,ts,{value:zd}),Object.defineProperty(this,dl,{value:gl}),this.sortMapEntries=typeof o=="function"?o:o===!0?Y$:null}clone(){const e=Object.create(Tk.prototype,Object.getOwnPropertyDescriptors(this));return e.tags=this.tags.slice(),e}};function U$(n,e){const t=[];let r=e.directives===!0;if(e.directives!==!1&&n.directives){const l=n.directives.toString(n);l?(t.push(l),r=!0):n.directives.docStart&&(r=!0)}r&&t.push("---");const i=ak(n,e),{commentString:s}=i.options;if(n.commentBefore){t.length!==1&&t.unshift("");const l=s(n.commentBefore);t.unshift(ms(l,""))}let o=!1,a=null;if(n.contents){if(yn(n.contents)){if(n.contents.spaceBefore&&r&&t.push(""),n.contents.commentBefore){const u=s(n.contents.commentBefore);t.push(ms(u,""))}i.forceBlockIndent=!!n.comment,a=n.contents.comment}const l=a?void 0:()=>o=!0;let c=Wa(n.contents,i,()=>a=null,l);a&&(c+=To(c,"",s(a))),(c[0]==="|"||c[0]===">")&&t[t.length-1]==="---"?t[t.length-1]=`--- ${c}`:t.push(c)}else t.push(Wa(n.contents,i));if(n.directives?.docEnd)if(n.comment){const l=s(n.comment);l.includes(`
|
|
57
|
-
`)?(t.push("..."),t.push(ms(l,""))):t.push(`... ${l}`)}else t.push("...");else{let l=n.comment;l&&o&&(l=l.replace(/^\n+/,"")),l&&((!o||a)&&t[t.length-1]!==""&&t.push(""),t.push(ms(s(l),"")))}return t.join(`
|
|
58
|
-
`)+`
|
|
59
|
-
`}let Wd=class Pk{constructor(e,t,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,li,{value:cm});let i=null;typeof t=="function"||Array.isArray(t)?i=t:r===void 0&&t&&(r=t,t=void 0);const s=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=s;let{version:o}=s;r?._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(o=this.directives.yaml.version)):this.directives=new cr({version:o}),this.setSchema(o,r),this.contents=e===void 0?null:this.createNode(e,i,r)}clone(){const e=Object.create(Pk.prototype,{[li]:{value:cm}});return e.commentBefore=this.commentBefore,e.comment=this.comment,e.errors=this.errors.slice(),e.warnings=this.warnings.slice(),e.options=Object.assign({},this.options),this.directives&&(e.directives=this.directives.clone()),e.schema=this.schema.clone(),e.contents=yn(this.contents)?this.contents.clone(e.schema):this.contents,this.range&&(e.range=this.range.slice()),e}add(e){aa(this.contents)&&this.contents.add(e)}addIn(e,t){aa(this.contents)&&this.contents.addIn(e,t)}createAlias(e,t){if(!e.anchor){const r=nk(this);e.anchor=!t||r.has(t)?rk(t||"a",r):t}return new Id(e.anchor)}createNode(e,t,r){let i;if(typeof t=="function")e=t.call({"":e},"",e),i=t;else if(Array.isArray(t)){const v=b=>typeof b=="number"||b instanceof String||b instanceof Number,O=t.filter(v).map(String);O.length>0&&(t=t.concat(O)),i=t}else r===void 0&&t&&(r=t,t=void 0);const{aliasDuplicateObjects:s,anchorPrefix:o,flow:a,keepUndefined:l,onTagObj:c,tag:u}=r??{},{onAnchor:f,setAnchors:d,sourceObjects:h}=k$(this,o||"a"),m={aliasDuplicateObjects:s??!0,keepUndefined:l??!1,onAnchor:f,onTagObj:c,replacer:i,schema:this.schema,sourceObjects:h},p=vc(e,u,m);return a&&On(p)&&(p.flow=!0),d(),p}createPair(e,t,r={}){const i=this.createNode(e,null,r),s=this.createNode(t,null,r);return new sr(i,s)}delete(e){return aa(this.contents)?this.contents.delete(e):!1}deleteIn(e){return Yl(e)?this.contents==null?!1:(this.contents=null,!0):aa(this.contents)?this.contents.deleteIn(e):!1}get(e,t){return On(this.contents)?this.contents.get(e,t):void 0}getIn(e,t){return Yl(e)?!t&&nn(this.contents)?this.contents.value:this.contents:On(this.contents)?this.contents.getIn(e,t):void 0}has(e){return On(this.contents)?this.contents.has(e):!1}hasIn(e){return Yl(e)?this.contents!==void 0:On(this.contents)?this.contents.hasIn(e):!1}set(e,t){this.contents==null?this.contents=qf(this.schema,[e],t):aa(this.contents)&&this.contents.set(e,t)}setIn(e,t){Yl(e)?this.contents=t:this.contents==null?this.contents=qf(this.schema,Array.from(e),t):aa(this.contents)&&this.contents.setIn(e,t)}setSchema(e,t={}){typeof e=="number"&&(e=String(e));let r;switch(e){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new cr({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=e:this.directives=new cr({version:e}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const i=JSON.stringify(e);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${i}`)}}if(t.schema instanceof Object)this.schema=t.schema;else if(r)this.schema=new Ck(Object.assign(r,t));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:e,jsonArg:t,mapAsMap:r,maxAliasCount:i,onAnchor:s,reviver:o}={}){const a={anchors:new Map,doc:this,keep:!e,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof i=="number"?i:100},l=si(this.contents,t??"",a);if(typeof s=="function")for(const{count:c,res:u}of a.anchors.values())s(u,c);return typeof o=="function"?ka(o,{"":l},"",l):l}toJSON(e,t){return this.toJS({json:!0,jsonArg:e,mapAsMap:!1,onAnchor:t})}toString(e={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in e&&(!Number.isInteger(e.indent)||Number(e.indent)<=0)){const t=JSON.stringify(e.indent);throw new Error(`"indent" option must be a positive integer, not ${t}`)}return U$(this,e)}};function aa(n){if(On(n))return!0;throw new Error("Expected a YAML collection as document contents")}class Mv extends Error{constructor(e,t,r,i){super(),this.name=e,this.code=r,this.message=i,this.pos=t}}class Eo extends Mv{constructor(e,t,r){super("YAMLParseError",e,t,r)}}class Ek extends Mv{constructor(e,t,r){super("YAMLWarning",e,t,r)}}const Df=(n,e)=>t=>{if(t.pos[0]===-1)return;t.linePos=t.pos.map(a=>e.linePos(a));const{line:r,col:i}=t.linePos[0];t.message+=` at line ${r}, column ${i}`;let s=i-1,o=n.substring(e.lineStarts[r-1],e.lineStarts[r]).replace(/[\n\r]+$/,"");if(s>=60&&o.length>80){const a=Math.min(s-39,o.length-79);o="…"+o.substring(a),s-=a-1}if(o.length>80&&(o=o.substring(0,79)+"…"),r>1&&/^ *$/.test(o.substring(0,s))){let a=n.substring(e.lineStarts[r-2],e.lineStarts[r-1]);a.length>80&&(a=a.substring(0,79)+`…
|
|
60
|
-
`),o=a+o}if(/[^ ]/.test(o)){let a=1;const l=t.linePos[1];l?.line===r&&l.col>i&&(a=Math.max(1,Math.min(l.col-i,80-s)));const c=" ".repeat(s)+"^".repeat(a);t.message+=`:
|
|
61
|
-
|
|
62
|
-
${o}
|
|
63
|
-
${c}
|
|
64
|
-
`}};function Ya(n,{flow:e,indicator:t,next:r,offset:i,onError:s,parentIndent:o,startOnNewline:a}){let l=!1,c=a,u=a,f="",d="",h=!1,m=!1,p=null,v=null,O=null,b=null,w=null,S=null,_=null;for(const C of n)switch(m&&(C.type!=="space"&&C.type!=="newline"&&C.type!=="comma"&&s(C.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),m=!1),p&&(c&&C.type!=="comment"&&C.type!=="newline"&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),p=null),C.type){case"space":!e&&(t!=="doc-start"||r?.type!=="flow-collection")&&C.source.includes(" ")&&(p=C),u=!0;break;case"comment":{u||s(C,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const y=C.source.substring(1)||" ";f?f+=d+y:f=y,d="",c=!1;break}case"newline":c?f?f+=C.source:(!S||t!=="seq-item-ind")&&(l=!0):d+=C.source,c=!0,h=!0,(v||O)&&(b=C),u=!0;break;case"anchor":v&&s(C,"MULTIPLE_ANCHORS","A node can have at most one anchor"),C.source.endsWith(":")&&s(C.offset+C.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),v=C,_??(_=C.offset),c=!1,u=!1,m=!0;break;case"tag":{O&&s(C,"MULTIPLE_TAGS","A node can have at most one tag"),O=C,_??(_=C.offset),c=!1,u=!1,m=!0;break}case t:(v||O)&&s(C,"BAD_PROP_ORDER",`Anchors and tags must be after the ${C.source} indicator`),S&&s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.source} in ${e??"collection"}`),S=C,c=t==="seq-item-ind"||t==="explicit-key-ind",u=!1;break;case"comma":if(e){w&&s(C,"UNEXPECTED_TOKEN",`Unexpected , in ${e}`),w=C,c=!1,u=!1;break}default:s(C,"UNEXPECTED_TOKEN",`Unexpected ${C.type} token`),c=!1,u=!1}const x=n[n.length-1],A=x?x.offset+x.source.length:i;return m&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&s(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),p&&(c&&p.indent<=o||r?.type==="block-map"||r?.type==="block-seq")&&s(p,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:w,found:S,spaceBefore:l,comment:f,hasNewline:h,anchor:v,tag:O,newlineAfterProp:b,end:A,start:_??A}}function Oc(n){if(!n)return null;switch(n.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(n.source.includes(`
|
|
65
|
-
`))return!0;if(n.end){for(const e of n.end)if(e.type==="newline")return!0}return!1;case"flow-collection":for(const e of n.items){for(const t of e.start)if(t.type==="newline")return!0;if(e.sep){for(const t of e.sep)if(t.type==="newline")return!0}if(Oc(e.key)||Oc(e.value))return!0}return!1;default:return!0}}function hm(n,e,t){if(e?.type==="flow-collection"){const r=e.end[0];r.indent===n&&(r.source==="]"||r.source==="}")&&Oc(e)&&t(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function $k(n,e,t){const{uniqueKeys:r}=n.options;if(r===!1)return!1;const i=typeof r=="function"?r:(s,o)=>s===o||nn(s)&&nn(o)&&s.value===o.value;return e.some(s=>i(s.key,t))}const Yb="All mapping items must start at the same column";function G$({composeNode:n,composeEmptyNode:e},t,r,i,s){const o=s?.nodeClass??jr,a=new o(t.schema);t.atRoot&&(t.atRoot=!1);let l=r.offset,c=null;for(const u of r.items){const{start:f,key:d,sep:h,value:m}=u,p=Ya(f,{indicator:"explicit-key-ind",next:d??h?.[0],offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0}),v=!p.found;if(v){if(d&&(d.type==="block-seq"?i(l,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in d&&d.indent!==r.indent&&i(l,"BAD_INDENT",Yb)),!p.anchor&&!p.tag&&!h){c=p.end,p.comment&&(a.comment?a.comment+=`
|
|
66
|
-
`+p.comment:a.comment=p.comment);continue}(p.newlineAfterProp||Oc(d))&&i(d??f[f.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else p.found?.indent!==r.indent&&i(l,"BAD_INDENT",Yb);t.atKey=!0;const O=p.end,b=d?n(t,d,p,i):e(t,O,f,null,p,i);t.schema.compat&&hm(r.indent,d,i),t.atKey=!1,$k(t,a.items,b)&&i(O,"DUPLICATE_KEY","Map keys must be unique");const w=Ya(h??[],{indicator:"map-value-ind",next:m,offset:b.range[2],onError:i,parentIndent:r.indent,startOnNewline:!d||d.type==="block-scalar"});if(l=w.end,w.found){v&&(m?.type==="block-map"&&!w.hasNewline&&i(l,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),t.options.strict&&p.start<w.found.offset-1024&&i(b.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const S=m?n(t,m,w,i):e(t,l,h,null,w,i);t.schema.compat&&hm(r.indent,m,i),l=S.range[2];const _=new sr(b,S);t.options.keepSourceTokens&&(_.srcToken=u),a.items.push(_)}else{v&&i(b.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),w.comment&&(b.comment?b.comment+=`
|
|
67
|
-
`+w.comment:b.comment=w.comment);const S=new sr(b);t.options.keepSourceTokens&&(S.srcToken=u),a.items.push(S)}}return c&&c<l&&i(c,"IMPOSSIBLE","Map comment with trailing content"),a.range=[r.offset,l,c??l],a}function H$({composeNode:n,composeEmptyNode:e},t,r,i,s){const o=s?.nodeClass??Js,a=new o(t.schema);t.atRoot&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let l=r.offset,c=null;for(const{start:u,value:f}of r.items){const d=Ya(u,{indicator:"seq-item-ind",next:f,offset:l,onError:i,parentIndent:r.indent,startOnNewline:!0});if(!d.found)if(d.anchor||d.tag||f)f?.type==="block-seq"?i(d.end,"BAD_INDENT","All sequence items must start at the same column"):i(l,"MISSING_CHAR","Sequence item without - indicator");else{c=d.end,d.comment&&(a.comment=d.comment);continue}const h=f?n(t,f,d,i):e(t,d.end,u,null,d,i);t.schema.compat&&hm(r.indent,f,i),l=h.range[2],a.items.push(h)}return a.range=[r.offset,l,c??l],a}function ru(n,e,t,r){let i="";if(n){let s=!1,o="";for(const a of n){const{source:l,type:c}=a;switch(c){case"space":s=!0;break;case"comment":{t&&!s&&r(a,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const u=l.substring(1)||" ";i?i+=o+u:i=u,o="";break}case"newline":i&&(o+=l),s=!0;break;default:r(a,"UNEXPECTED_TOKEN",`Unexpected ${c} at node end`)}e+=l.length}}return{comment:i,offset:e}}const $h="Block collections are not allowed within flow collections",Qh=n=>n&&(n.type==="block-map"||n.type==="block-seq");function K$({composeNode:n,composeEmptyNode:e},t,r,i,s){const o=r.start.source==="{",a=o?"flow map":"flow sequence",l=s?.nodeClass??(o?jr:Js),c=new l(t.schema);c.flow=!0;const u=t.atRoot;u&&(t.atRoot=!1),t.atKey&&(t.atKey=!1);let f=r.offset+r.start.source.length;for(let v=0;v<r.items.length;++v){const O=r.items[v],{start:b,key:w,sep:S,value:_}=O,x=Ya(b,{flow:a,indicator:"explicit-key-ind",next:w??S?.[0],offset:f,onError:i,parentIndent:r.indent,startOnNewline:!1});if(!x.found){if(!x.anchor&&!x.tag&&!S&&!_){v===0&&x.comma?i(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`):v<r.items.length-1&&i(x.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${a}`),x.comment&&(c.comment?c.comment+=`
|
|
68
|
-
`+x.comment:c.comment=x.comment),f=x.end;continue}!o&&t.options.strict&&Oc(w)&&i(w,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(v===0)x.comma&&i(x.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${a}`);else if(x.comma||i(x.start,"MISSING_CHAR",`Missing , between ${a} items`),x.comment){let A="";e:for(const C of b)switch(C.type){case"comma":case"space":break;case"comment":A=C.source.substring(1);break e;default:break e}if(A){let C=c.items[c.items.length-1];pn(C)&&(C=C.value??C.key),C.comment?C.comment+=`
|
|
69
|
-
`+A:C.comment=A,x.comment=x.comment.substring(A.length+1)}}if(!o&&!S&&!x.found){const A=_?n(t,_,x,i):e(t,x.end,S,null,x,i);c.items.push(A),f=A.range[2],Qh(_)&&i(A.range,"BLOCK_IN_FLOW",$h)}else{t.atKey=!0;const A=x.end,C=w?n(t,w,x,i):e(t,A,b,null,x,i);Qh(w)&&i(C.range,"BLOCK_IN_FLOW",$h),t.atKey=!1;const y=Ya(S??[],{flow:a,indicator:"map-value-ind",next:_,offset:C.range[2],onError:i,parentIndent:r.indent,startOnNewline:!1});if(y.found){if(!o&&!x.found&&t.options.strict){if(S)for(const T of S){if(T===y.found)break;if(T.type==="newline"){i(T,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}x.start<y.found.offset-1024&&i(y.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else _&&("source"in _&&_.source?.[0]===":"?i(_,"MISSING_CHAR",`Missing space after : in ${a}`):i(y.start,"MISSING_CHAR",`Missing , or : between ${a} items`));const k=_?n(t,_,y,i):y.found?e(t,y.end,S,null,y,i):null;k?Qh(_)&&i(k.range,"BLOCK_IN_FLOW",$h):y.comment&&(C.comment?C.comment+=`
|
|
70
|
-
`+y.comment:C.comment=y.comment);const P=new sr(C,k);if(t.options.keepSourceTokens&&(P.srcToken=O),o){const T=c;$k(t,T.items,C)&&i(A,"DUPLICATE_KEY","Map keys must be unique"),T.items.push(P)}else{const T=new jr(t.schema);T.flow=!0,T.items.push(P);const E=(k??C).range;T.range=[C.range[0],E[1],E[2]],c.items.push(T)}f=k?k.range[2]:y.end}}const d=o?"}":"]",[h,...m]=r.end;let p=f;if(h?.source===d)p=h.offset+h.source.length;else{const v=a[0].toUpperCase()+a.substring(1),O=u?`${v} must end with a ${d}`:`${v} in block collection must be sufficiently indented and end with a ${d}`;i(f,u?"MISSING_CHAR":"BAD_INDENT",O),h&&h.source.length!==1&&m.unshift(h)}if(m.length>0){const v=ru(m,p,t.options.strict,i);v.comment&&(c.comment?c.comment+=`
|
|
71
|
-
`+v.comment:c.comment=v.comment),c.range=[r.offset,p,v.offset]}else c.range=[r.offset,p,p];return c}function Lh(n,e,t,r,i,s){const o=t.type==="block-map"?G$(n,e,t,r,s):t.type==="block-seq"?H$(n,e,t,r,s):K$(n,e,t,r,s),a=o.constructor;return i==="!"||i===a.tagName?(o.tag=a.tagName,o):(i&&(o.tag=i),o)}function J$(n,e,t,r,i){const s=r.tag,o=s?e.directives.tagName(s.source,d=>i(s,"TAG_RESOLVE_FAILED",d)):null;if(t.type==="block-seq"){const{anchor:d,newlineAfterProp:h}=r,m=d&&s?d.offset>s.offset?d:s:d??s;m&&(!h||h.offset<m.offset)&&i(m,"MISSING_CHAR","Missing newline after block sequence props")}const a=t.type==="block-map"?"map":t.type==="block-seq"?"seq":t.start.source==="{"?"map":"seq";if(!s||!o||o==="!"||o===jr.tagName&&a==="map"||o===Js.tagName&&a==="seq")return Lh(n,e,t,i,o);let l=e.schema.tags.find(d=>d.tag===o&&d.collection===a);if(!l){const d=e.schema.knownTags[o];if(d?.collection===a)e.schema.tags.push(Object.assign({},d,{default:!1})),l=d;else return d?i(s,"BAD_COLLECTION_TYPE",`${d.tag} used for ${a} collection, but expects ${d.collection??"scalar"}`,!0):i(s,"TAG_RESOLVE_FAILED",`Unresolved tag: ${o}`,!0),Lh(n,e,t,i,o)}const c=Lh(n,e,t,i,o,l),u=l.resolve?.(c,d=>i(s,"TAG_RESOLVE_FAILED",d),e.options)??c,f=yn(u)?u:new ot(u);return f.range=c.range,f.tag=o,l?.format&&(f.format=l.format),f}function Qk(n,e,t){const r=e.offset,i=eQ(e,n.options.strict,t);if(!i)return{value:"",type:null,comment:"",range:[r,r,r]};const s=i.mode===">"?ot.BLOCK_FOLDED:ot.BLOCK_LITERAL,o=e.source?tQ(e.source):[];let a=o.length;for(let p=o.length-1;p>=0;--p){const v=o[p][1];if(v===""||v==="\r")a=p;else break}if(a===0){const p=i.chomp==="+"&&o.length>0?`
|
|
72
|
-
`.repeat(Math.max(1,o.length-1)):"";let v=r+i.length;return e.source&&(v+=e.source.length),{value:p,type:s,comment:i.comment,range:[r,v,v]}}let l=e.indent+i.indent,c=e.offset+i.length,u=0;for(let p=0;p<a;++p){const[v,O]=o[p];if(O===""||O==="\r")i.indent===0&&v.length>l&&(l=v.length);else{v.length<l&&t(c+v.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),i.indent===0&&(l=v.length),u=p,l===0&&!n.atRoot&&t(c,"BAD_INDENT","Block scalar values in collections must be indented");break}c+=v.length+O.length+1}for(let p=o.length-1;p>=a;--p)o[p][0].length>l&&(a=p+1);let f="",d="",h=!1;for(let p=0;p<u;++p)f+=o[p][0].slice(l)+`
|
|
73
|
-
`;for(let p=u;p<a;++p){let[v,O]=o[p];c+=v.length+O.length+1;const b=O[O.length-1]==="\r";if(b&&(O=O.slice(0,-1)),O&&v.length<l){const S=`Block scalar lines must not be less indented than their ${i.indent?"explicit indentation indicator":"first line"}`;t(c-O.length-(b?2:1),"BAD_INDENT",S),v=""}s===ot.BLOCK_LITERAL?(f+=d+v.slice(l)+O,d=`
|
|
74
|
-
`):v.length>l||O[0]===" "?(d===" "?d=`
|
|
75
|
-
`:!h&&d===`
|
|
76
|
-
`&&(d=`
|
|
77
|
-
|
|
78
|
-
`),f+=d+v.slice(l)+O,d=`
|
|
79
|
-
`,h=!0):O===""?d===`
|
|
80
|
-
`?f+=`
|
|
81
|
-
`:d=`
|
|
82
|
-
`:(f+=d+O,d=" ",h=!1)}switch(i.chomp){case"-":break;case"+":for(let p=a;p<o.length;++p)f+=`
|
|
83
|
-
`+o[p][0].slice(l);f[f.length-1]!==`
|
|
84
|
-
`&&(f+=`
|
|
85
|
-
`);break;default:f+=`
|
|
86
|
-
`}const m=r+i.length+e.source.length;return{value:f,type:s,comment:i.comment,range:[r,m,m]}}function eQ({offset:n,props:e},t,r){if(e[0].type!=="block-scalar-header")return r(e[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:i}=e[0],s=i[0];let o=0,a="",l=-1;for(let d=1;d<i.length;++d){const h=i[d];if(!a&&(h==="-"||h==="+"))a=h;else{const m=Number(h);!o&&m?o=m:l===-1&&(l=n+d)}}l!==-1&&r(l,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${i}`);let c=!1,u="",f=i.length;for(let d=1;d<e.length;++d){const h=e[d];switch(h.type){case"space":c=!0;case"newline":f+=h.source.length;break;case"comment":t&&!c&&r(h,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),f+=h.source.length,u=h.source.substring(1);break;case"error":r(h,"UNEXPECTED_TOKEN",h.message),f+=h.source.length;break;default:{const m=`Unexpected token in block scalar header: ${h.type}`;r(h,"UNEXPECTED_TOKEN",m);const p=h.source;p&&typeof p=="string"&&(f+=p.length)}}}return{mode:s,indent:o,chomp:a,comment:u,length:f}}function tQ(n){const e=n.split(/\n( *)/),t=e[0],r=t.match(/^( *)/),s=[r?.[1]?[r[1],t.slice(r[1].length)]:["",t]];for(let o=1;o<e.length;o+=2)s.push([e[o],e[o+1]]);return s}function Lk(n,e,t){const{offset:r,type:i,source:s,end:o}=n;let a,l;const c=(d,h,m)=>t(r+d,h,m);switch(i){case"scalar":a=ot.PLAIN,l=nQ(s,c);break;case"single-quoted-scalar":a=ot.QUOTE_SINGLE,l=rQ(s,c);break;case"double-quoted-scalar":a=ot.QUOTE_DOUBLE,l=iQ(s,c);break;default:return t(n,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${i}`),{value:"",type:null,comment:"",range:[r,r+s.length,r+s.length]}}const u=r+s.length,f=ru(o,u,e,t);return{value:l,type:a,comment:f.comment,range:[r,u,f.offset]}}function nQ(n,e){let t="";switch(n[0]){case" ":t="a tab character";break;case",":t="flow indicator character ,";break;case"%":t="directive indicator character %";break;case"|":case">":{t=`block scalar indicator ${n[0]}`;break}case"@":case"`":{t=`reserved character ${n[0]}`;break}}return t&&e(0,"BAD_SCALAR_START",`Plain value cannot start with ${t}`),Mk(n)}function rQ(n,e){return(n[n.length-1]!=="'"||n.length===1)&&e(n.length,"MISSING_CHAR","Missing closing 'quote"),Mk(n.slice(1,-1)).replace(/''/g,"'")}function Mk(n){let e,t;try{e=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
87
|
-
`,"sy"),t=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
88
|
-
`,"sy")}catch{e=/(.*?)[ \t]*\r?\n/sy,t=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=e.exec(n);if(!r)return n;let i=r[1],s=" ",o=e.lastIndex;for(t.lastIndex=o;r=t.exec(n);)r[1]===""?s===`
|
|
89
|
-
`?i+=s:s=`
|
|
90
|
-
`:(i+=s+r[1],s=" "),o=t.lastIndex;const a=/[ \t]*(.*)/sy;return a.lastIndex=o,r=a.exec(n),i+s+(r?.[1]??"")}function iQ(n,e){let t="";for(let r=1;r<n.length-1;++r){const i=n[r];if(!(i==="\r"&&n[r+1]===`
|
|
91
|
-
`))if(i===`
|
|
92
|
-
`){const{fold:s,offset:o}=sQ(n,r);t+=s,r=o}else if(i==="\\"){let s=n[++r];const o=oQ[s];if(o)t+=o;else if(s===`
|
|
93
|
-
`)for(s=n[r+1];s===" "||s===" ";)s=n[++r+1];else if(s==="\r"&&n[r+1]===`
|
|
94
|
-
`)for(s=n[++r+1];s===" "||s===" ";)s=n[++r+1];else if(s==="x"||s==="u"||s==="U"){const a={x:2,u:4,U:8}[s];t+=aQ(n,r+1,a,e),r+=a}else{const a=n.substr(r-1,2);e(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),t+=a}}else if(i===" "||i===" "){const s=r;let o=n[r+1];for(;o===" "||o===" ";)o=n[++r+1];o!==`
|
|
95
|
-
`&&!(o==="\r"&&n[r+2]===`
|
|
96
|
-
`)&&(t+=r>s?n.slice(s,r+1):i)}else t+=i}return(n[n.length-1]!=='"'||n.length===1)&&e(n.length,"MISSING_CHAR",'Missing closing "quote'),t}function sQ(n,e){let t="",r=n[e+1];for(;(r===" "||r===" "||r===`
|
|
97
|
-
`||r==="\r")&&!(r==="\r"&&n[e+2]!==`
|
|
98
|
-
`);)r===`
|
|
99
|
-
`&&(t+=`
|
|
100
|
-
`),e+=1,r=n[e+1];return t||(t=" "),{fold:t,offset:e}}const oQ={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
101
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function aQ(n,e,t,r){const i=n.substr(e,t),o=i.length===t&&/^[0-9a-fA-F]+$/.test(i)?parseInt(i,16):NaN;if(isNaN(o)){const a=n.substr(e-2,t+2);return r(e-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${a}`),a}return String.fromCodePoint(o)}function qk(n,e,t,r){const{value:i,type:s,comment:o,range:a}=e.type==="block-scalar"?Qk(n,e,r):Lk(e,n.options.strict,r),l=t?n.directives.tagName(t.source,f=>r(t,"TAG_RESOLVE_FAILED",f)):null;let c;n.options.stringKeys&&n.atKey?c=n.schema[ts]:l?c=lQ(n.schema,i,l,t,r):e.type==="scalar"?c=cQ(n,i,e,r):c=n.schema[ts];let u;try{const f=c.resolve(i,d=>r(t??e,"TAG_RESOLVE_FAILED",d),n.options);u=nn(f)?f:new ot(f)}catch(f){const d=f instanceof Error?f.message:String(f);r(t??e,"TAG_RESOLVE_FAILED",d),u=new ot(i)}return u.range=a,u.source=i,s&&(u.type=s),l&&(u.tag=l),c.format&&(u.format=c.format),o&&(u.comment=o),u}function lQ(n,e,t,r,i){if(t==="!")return n[ts];const s=[];for(const a of n.tags)if(!a.collection&&a.tag===t)if(a.default&&a.test)s.push(a);else return a;for(const a of s)if(a.test?.test(e))return a;const o=n.knownTags[t];return o&&!o.collection?(n.tags.push(Object.assign({},o,{default:!1,test:void 0})),o):(i(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${t}`,t!=="tag:yaml.org,2002:str"),n[ts])}function cQ({atKey:n,directives:e,schema:t},r,i,s){const o=t.tags.find(a=>(a.default===!0||n&&a.default==="key")&&a.test?.test(r))||t[ts];if(t.compat){const a=t.compat.find(l=>l.default&&l.test?.test(r))??t[ts];if(o.tag!==a.tag){const l=e.tagString(o.tag),c=e.tagString(a.tag),u=`Value may be parsed as either ${l} or ${c}`;s(i,"TAG_RESOLVE_FAILED",u,!0)}}return o}function uQ(n,e,t){if(e){t??(t=e.length);for(let r=t-1;r>=0;--r){let i=e[r];switch(i.type){case"space":case"comment":case"newline":n-=i.source.length;continue}for(i=e[++r];i?.type==="space";)n+=i.source.length,i=e[++r];break}}return n}const fQ={composeNode:Rk,composeEmptyNode:qv};function Rk(n,e,t,r){const i=n.atKey,{spaceBefore:s,comment:o,anchor:a,tag:l}=t;let c,u=!0;switch(e.type){case"alias":c=dQ(n,e,r),(a||l)&&r(e,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":c=qk(n,e,l,r),a&&(c.anchor=a.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":c=J$(fQ,n,e,t,r),a&&(c.anchor=a.source.substring(1));break;default:{const f=e.type==="error"?e.message:`Unsupported token (type: ${e.type})`;r(e,"UNEXPECTED_TOKEN",f),c=qv(n,e.offset,void 0,null,t,r),u=!1}}return a&&c.anchor===""&&r(a,"BAD_ALIAS","Anchor cannot be an empty string"),i&&n.options.stringKeys&&(!nn(c)||typeof c.value!="string"||c.tag&&c.tag!=="tag:yaml.org,2002:str")&&r(l??e,"NON_STRING_KEY","With stringKeys, all keys must be strings"),s&&(c.spaceBefore=!0),o&&(e.type==="scalar"&&e.source===""?c.comment=o:c.commentBefore=o),n.options.keepSourceTokens&&u&&(c.srcToken=e),c}function qv(n,e,t,r,{spaceBefore:i,comment:s,anchor:o,tag:a,end:l},c){const u={type:"scalar",offset:uQ(e,t,r),indent:-1,source:""},f=qk(n,u,a,c);return o&&(f.anchor=o.source.substring(1),f.anchor===""&&c(o,"BAD_ALIAS","Anchor cannot be an empty string")),i&&(f.spaceBefore=!0),s&&(f.comment=s,f.range[2]=l),f}function dQ({options:n},{offset:e,source:t,end:r},i){const s=new Id(t.substring(1));s.source===""&&i(e,"BAD_ALIAS","Alias cannot be an empty string"),s.source.endsWith(":")&&i(e+t.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const o=e+t.length,a=ru(r,o,n.strict,i);return s.range=[e,o,a.offset],a.comment&&(s.comment=a.comment),s}function hQ(n,e,{offset:t,start:r,value:i,end:s},o){const a=Object.assign({_directives:e},n),l=new Wd(void 0,a),c={atKey:!1,atRoot:!0,directives:l.directives,options:l.options,schema:l.schema},u=Ya(r,{indicator:"doc-start",next:i??s?.[0],offset:t,onError:o,parentIndent:0,startOnNewline:!0});u.found&&(l.directives.docStart=!0,i&&(i.type==="block-map"||i.type==="block-seq")&&!u.hasNewline&&o(u.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),l.contents=i?Rk(c,i,u,o):qv(c,u.end,r,null,u,o);const f=l.contents.range[2],d=ru(s,f,!1,o);return d.comment&&(l.comment=d.comment),l.range=[t,f,d.offset],l}function Cl(n){if(typeof n=="number")return[n,n+1];if(Array.isArray(n))return n.length===2?n:[n[0],n[1]];const{offset:e,source:t}=n;return[e,e+(typeof t=="string"?t.length:1)]}function Ub(n){let e="",t=!1,r=!1;for(let i=0;i<n.length;++i){const s=n[i];switch(s[0]){case"#":e+=(e===""?"":r?`
|
|
102
|
-
|
|
103
|
-
`:`
|
|
104
|
-
`)+(s.substring(1)||" "),t=!0,r=!1;break;case"%":n[i+1]?.[0]!=="#"&&(i+=1),t=!1;break;default:t||(r=!0),t=!1}}return{comment:e,afterEmptyLine:r}}class Rv{constructor(e={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(t,r,i,s)=>{const o=Cl(t);s?this.warnings.push(new Ek(o,r,i)):this.errors.push(new Eo(o,r,i))},this.directives=new cr({version:e.version||"1.2"}),this.options=e}decorate(e,t){const{comment:r,afterEmptyLine:i}=Ub(this.prelude);if(r){const s=e.contents;if(t)e.comment=e.comment?`${e.comment}
|
|
105
|
-
${r}`:r;else if(i||e.directives.docStart||!s)e.commentBefore=r;else if(On(s)&&!s.flow&&s.items.length>0){let o=s.items[0];pn(o)&&(o=o.key);const a=o.commentBefore;o.commentBefore=a?`${r}
|
|
106
|
-
${a}`:r}else{const o=s.commentBefore;s.commentBefore=o?`${r}
|
|
107
|
-
${o}`:r}}t?(Array.prototype.push.apply(e.errors,this.errors),Array.prototype.push.apply(e.warnings,this.warnings)):(e.errors=this.errors,e.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:Ub(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(e,t=!1,r=-1){for(const i of e)yield*this.next(i);yield*this.end(t,r)}*next(e){switch(e.type){case"directive":this.directives.add(e.source,(t,r,i)=>{const s=Cl(e);s[0]+=t,this.onError(s,"BAD_DIRECTIVE",r,i)}),this.prelude.push(e.source),this.atDirectives=!0;break;case"document":{const t=hQ(this.options,this.directives,e,this.onError);this.atDirectives&&!t.directives.docStart&&this.onError(e,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(t,!1),this.doc&&(yield this.doc),this.doc=t,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(e.source);break;case"error":{const t=e.source?`${e.message}: ${JSON.stringify(e.source)}`:e.message,r=new Eo(Cl(e),"UNEXPECTED_TOKEN",t);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Eo(Cl(e),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const t=ru(e.end,e.offset+e.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),t.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
108
|
-
${t.comment}`:t.comment}this.doc.range[2]=t.offset;break}default:this.errors.push(new Eo(Cl(e),"UNEXPECTED_TOKEN",`Unsupported token ${e.type}`))}}*end(e=!1,t=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(e){const r=Object.assign({_directives:this.directives},this.options),i=new Wd(void 0,r);this.atDirectives&&this.onError(t,"MISSING_CHAR","Missing directives-end indicator line"),i.range=[0,t,t],this.decorate(i,!1),yield i}}}function pQ(n,e=!0,t){if(n){const r=(i,s,o)=>{const a=typeof i=="number"?i:Array.isArray(i)?i[0]:i.offset;if(t)t(a,s,o);else throw new Eo([a,a+1],s,o)};switch(n.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Lk(n,e,r);case"block-scalar":return Qk({options:{strict:e}},n,r)}}return null}function mQ(n,e){const{implicitKey:t=!1,indent:r,inFlow:i=!1,offset:s=-1,type:o="PLAIN"}=e,a=tu({type:o,value:n},{implicitKey:t,indent:r>0?" ".repeat(r):"",inFlow:i,options:{blockQuote:!0,lineWidth:-1}}),l=e.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
109
|
-
`}];switch(a[0]){case"|":case">":{const c=a.indexOf(`
|
|
110
|
-
`),u=a.substring(0,c),f=a.substring(c+1)+`
|
|
111
|
-
`,d=[{type:"block-scalar-header",offset:s,indent:r,source:u}];return Dk(d,l)||d.push({type:"newline",offset:-1,indent:r,source:`
|
|
112
|
-
`}),{type:"block-scalar",offset:s,indent:r,props:d,source:f}}case'"':return{type:"double-quoted-scalar",offset:s,indent:r,source:a,end:l};case"'":return{type:"single-quoted-scalar",offset:s,indent:r,source:a,end:l};default:return{type:"scalar",offset:s,indent:r,source:a,end:l}}}function gQ(n,e,t={}){let{afterKey:r=!1,implicitKey:i=!1,inFlow:s=!1,type:o}=t,a="indent"in n?n.indent:null;if(r&&typeof a=="number"&&(a+=2),!o)switch(n.type){case"single-quoted-scalar":o="QUOTE_SINGLE";break;case"double-quoted-scalar":o="QUOTE_DOUBLE";break;case"block-scalar":{const c=n.props[0];if(c.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o=c.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:o="PLAIN"}const l=tu({type:o,value:e},{implicitKey:i||a===null,indent:a!==null&&a>0?" ".repeat(a):"",inFlow:s,options:{blockQuote:!0,lineWidth:-1}});switch(l[0]){case"|":case">":vQ(n,l);break;case'"':Mh(n,l,"double-quoted-scalar");break;case"'":Mh(n,l,"single-quoted-scalar");break;default:Mh(n,l,"scalar")}}function vQ(n,e){const t=e.indexOf(`
|
|
113
|
-
`),r=e.substring(0,t),i=e.substring(t+1)+`
|
|
114
|
-
`;if(n.type==="block-scalar"){const s=n.props[0];if(s.type!=="block-scalar-header")throw new Error("Invalid block scalar header");s.source=r,n.source=i}else{const{offset:s}=n,o="indent"in n?n.indent:-1,a=[{type:"block-scalar-header",offset:s,indent:o,source:r}];Dk(a,"end"in n?n.end:void 0)||a.push({type:"newline",offset:-1,indent:o,source:`
|
|
115
|
-
`});for(const l of Object.keys(n))l!=="type"&&l!=="offset"&&delete n[l];Object.assign(n,{type:"block-scalar",indent:o,props:a,source:i})}}function Dk(n,e){if(e)for(const t of e)switch(t.type){case"space":case"comment":n.push(t);break;case"newline":return n.push(t),!0}return!1}function Mh(n,e,t){switch(n.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":n.type=t,n.source=e;break;case"block-scalar":{const r=n.props.slice(1);let i=e.length;n.props[0].type==="block-scalar-header"&&(i-=n.props[0].source.length);for(const s of r)s.offset+=i;delete n.props,Object.assign(n,{type:t,source:e,end:r});break}case"block-map":case"block-seq":{const i={type:"newline",offset:n.offset+e.length,indent:n.indent,source:`
|
|
116
|
-
`};delete n.items,Object.assign(n,{type:t,source:e,end:[i]});break}default:{const r="indent"in n?n.indent:-1,i="end"in n&&Array.isArray(n.end)?n.end.filter(s=>s.type==="space"||s.type==="comment"||s.type==="newline"):[];for(const s of Object.keys(n))s!=="type"&&s!=="offset"&&delete n[s];Object.assign(n,{type:t,indent:r,source:e,end:i})}}}const OQ=n=>"type"in n?If(n):pf(n);function If(n){switch(n.type){case"block-scalar":{let e="";for(const t of n.props)e+=If(t);return e+n.source}case"block-map":case"block-seq":{let e="";for(const t of n.items)e+=pf(t);return e}case"flow-collection":{let e=n.start.source;for(const t of n.items)e+=pf(t);for(const t of n.end)e+=t.source;return e}case"document":{let e=pf(n);if(n.end)for(const t of n.end)e+=t.source;return e}default:{let e=n.source;if("end"in n&&n.end)for(const t of n.end)e+=t.source;return e}}}function pf({start:n,key:e,sep:t,value:r}){let i="";for(const s of n)i+=s.source;if(e&&(i+=If(e)),t)for(const s of t)i+=s.source;return r&&(i+=If(r)),i}const pm=Symbol("break visit"),bQ=Symbol("skip children"),Ik=Symbol("remove item");function Xo(n,e){"type"in n&&n.type==="document"&&(n={start:n.start,value:n.value}),Nk(Object.freeze([]),n,e)}Xo.BREAK=pm;Xo.SKIP=bQ;Xo.REMOVE=Ik;Xo.itemAtPath=(n,e)=>{let t=n;for(const[r,i]of e){const s=t?.[r];if(s&&"items"in s)t=s.items[i];else return}return t};Xo.parentCollection=(n,e)=>{const t=Xo.itemAtPath(n,e.slice(0,-1)),r=e[e.length-1][0],i=t?.[r];if(i&&"items"in i)return i;throw new Error("Parent collection not found")};function Nk(n,e,t){let r=t(e,n);if(typeof r=="symbol")return r;for(const i of["key","value"]){const s=e[i];if(s&&"items"in s){for(let o=0;o<s.items.length;++o){const a=Nk(Object.freeze(n.concat([[i,o]])),s.items[o],t);if(typeof a=="number")o=a-1;else{if(a===pm)return pm;a===Ik&&(s.items.splice(o,1),o-=1)}}typeof r=="function"&&i==="key"&&(r=r(e,n))}}return typeof r=="function"?r(e,n):r}const Yd="\uFEFF",Ud="",Gd="",bc="",yQ=n=>!!n&&"items"in n,wQ=n=>!!n&&(n.type==="scalar"||n.type==="single-quoted-scalar"||n.type==="double-quoted-scalar"||n.type==="block-scalar");function _Q(n){switch(n){case Yd:return"<BOM>";case Ud:return"<DOC>";case Gd:return"<FLOW_END>";case bc:return"<SCALAR>";default:return JSON.stringify(n)}}function Bk(n){switch(n){case Yd:return"byte-order-mark";case Ud:return"doc-mode";case Gd:return"flow-error-end";case bc:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
117
|
-
`:case`\r
|
|
118
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(n[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const kQ=Object.freeze(Object.defineProperty({__proto__:null,BOM:Yd,DOCUMENT:Ud,FLOW_END:Gd,SCALAR:bc,createScalarToken:mQ,isCollection:yQ,isScalar:wQ,prettyToken:_Q,resolveAsScalar:pQ,setScalarValue:gQ,stringify:OQ,tokenType:Bk,visit:Xo},Symbol.toStringTag,{value:"Module"}));function hi(n){switch(n){case void 0:case" ":case`
|
|
119
|
-
`:case"\r":case" ":return!0;default:return!1}}const Gb=new Set("0123456789ABCDEFabcdef"),xQ=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),wu=new Set(",[]{}"),SQ=new Set(` ,[]{}
|
|
120
|
-
\r `),qh=n=>!n||SQ.has(n);class jk{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(e,t=!1){if(e){if(typeof e!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+e:e,this.lineEndPos=null}this.atEnd=!t;let r=this.next??"stream";for(;r&&(t||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let e=this.pos,t=this.buffer[e];for(;t===" "||t===" ";)t=this.buffer[++e];return!t||t==="#"||t===`
|
|
121
|
-
`?!0:t==="\r"?this.buffer[e+1]===`
|
|
122
|
-
`:!1}charAt(e){return this.buffer[this.pos+e]}continueScalar(e){let t=this.buffer[e];if(this.indentNext>0){let r=0;for(;t===" ";)t=this.buffer[++r+e];if(t==="\r"){const i=this.buffer[r+e+1];if(i===`
|
|
123
|
-
`||!i&&!this.atEnd)return e+r+1}return t===`
|
|
124
|
-
`||r>=this.indentNext||!t&&!this.atEnd?e+r:-1}if(t==="-"||t==="."){const r=this.buffer.substr(e,3);if((r==="---"||r==="...")&&hi(this.buffer[e+3]))return-1}return e}getLine(){let e=this.lineEndPos;return(typeof e!="number"||e!==-1&&e<this.pos)&&(e=this.buffer.indexOf(`
|
|
125
|
-
`,this.pos),this.lineEndPos=e),e===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[e-1]==="\r"&&(e-=1),this.buffer.substring(this.pos,e))}hasChars(e){return this.pos+e<=this.buffer.length}setNext(e){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=e,null}peek(e){return this.buffer.substr(this.pos,e)}*parseNext(e){switch(e){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let e=this.getLine();if(e===null)return this.setNext("stream");if(e[0]===Yd&&(yield*this.pushCount(1),e=e.substring(1)),e[0]==="%"){let t=e.length,r=e.indexOf("#");for(;r!==-1;){const s=e[r-1];if(s===" "||s===" "){t=r-1;break}else r=e.indexOf("#",r+1)}for(;;){const s=e[t-1];if(s===" "||s===" ")t-=1;else break}const i=(yield*this.pushCount(t))+(yield*this.pushSpaces(!0));return yield*this.pushCount(e.length-i),this.pushNewline(),"stream"}if(this.atLineEnd()){const t=yield*this.pushSpaces(!0);return yield*this.pushCount(e.length-t),yield*this.pushNewline(),"stream"}return yield Ud,yield*this.parseLineStart()}*parseLineStart(){const e=this.charAt(0);if(!e&&!this.atEnd)return this.setNext("line-start");if(e==="-"||e==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const t=this.peek(3);if((t==="---"||t==="...")&&hi(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,t==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!hi(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[e,t]=this.peek(2);if(!t&&!this.atEnd)return this.setNext("block-start");if((e==="-"||e==="?"||e===":")&&hi(t)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const e=this.getLine();if(e===null)return this.setNext("doc");let t=yield*this.pushIndicators();switch(e[t]){case"#":yield*this.pushCount(e.length-t);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(qh),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return t+=yield*this.parseBlockScalarHeader(),t+=yield*this.pushSpaces(!0),yield*this.pushCount(e.length-t),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let e,t,r=-1;do e=yield*this.pushNewline(),e>0?(t=yield*this.pushSpaces(!1),this.indentValue=r=t):t=0,t+=yield*this.pushSpaces(!0);while(e+t>0);const i=this.getLine();if(i===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&i[0]!=="#"||r===0&&(i.startsWith("---")||i.startsWith("..."))&&hi(i[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(i[0]==="]"||i[0]==="}")))return this.flowLevel=0,yield Gd,yield*this.parseLineStart();let s=0;for(;i[s]===",";)s+=yield*this.pushCount(1),s+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(s+=yield*this.pushIndicators(),i[s]){case void 0:return"flow";case"#":return yield*this.pushCount(i.length-s),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(qh),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const o=this.charAt(1);if(this.flowKey||hi(o)||o===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const e=this.charAt(0);let t=this.buffer.indexOf(e,this.pos+1);if(e==="'")for(;t!==-1&&this.buffer[t+1]==="'";)t=this.buffer.indexOf("'",t+2);else for(;t!==-1;){let s=0;for(;this.buffer[t-1-s]==="\\";)s+=1;if(s%2===0)break;t=this.buffer.indexOf('"',t+1)}const r=this.buffer.substring(0,t);let i=r.indexOf(`
|
|
126
|
-
`,this.pos);if(i!==-1){for(;i!==-1;){const s=this.continueScalar(i+1);if(s===-1)break;i=r.indexOf(`
|
|
127
|
-
`,s)}i!==-1&&(t=i-(r[i-1]==="\r"?2:1))}if(t===-1){if(!this.atEnd)return this.setNext("quoted-scalar");t=this.buffer.length}return yield*this.pushToIndex(t+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let e=this.pos;for(;;){const t=this.buffer[++e];if(t==="+")this.blockScalarKeep=!0;else if(t>"0"&&t<="9")this.blockScalarIndent=Number(t)-1;else if(t!=="-")break}return yield*this.pushUntil(t=>hi(t)||t==="#")}*parseBlockScalar(){let e=this.pos-1,t=0,r;e:for(let s=this.pos;r=this.buffer[s];++s)switch(r){case" ":t+=1;break;case`
|
|
128
|
-
`:e=s,t=0;break;case"\r":{const o=this.buffer[s+1];if(!o&&!this.atEnd)return this.setNext("block-scalar");if(o===`
|
|
129
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(t>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=t:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const s=this.continueScalar(e+1);if(s===-1)break;e=this.buffer.indexOf(`
|
|
130
|
-
`,s)}while(e!==-1);if(e===-1){if(!this.atEnd)return this.setNext("block-scalar");e=this.buffer.length}}let i=e+1;for(r=this.buffer[i];r===" ";)r=this.buffer[++i];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
131
|
-
`;)r=this.buffer[++i];e=i-1}else if(!this.blockScalarKeep)do{let s=e-1,o=this.buffer[s];o==="\r"&&(o=this.buffer[--s]);const a=s;for(;o===" ";)o=this.buffer[--s];if(o===`
|
|
132
|
-
`&&s>=this.pos&&s+1+t>a)e=s;else break}while(!0);return yield bc,yield*this.pushToIndex(e+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const e=this.flowLevel>0;let t=this.pos-1,r=this.pos-1,i;for(;i=this.buffer[++r];)if(i===":"){const s=this.buffer[r+1];if(hi(s)||e&&wu.has(s))break;t=r}else if(hi(i)){let s=this.buffer[r+1];if(i==="\r"&&(s===`
|
|
133
|
-
`?(r+=1,i=`
|
|
134
|
-
`,s=this.buffer[r+1]):t=r),s==="#"||e&&wu.has(s))break;if(i===`
|
|
135
|
-
`){const o=this.continueScalar(r+1);if(o===-1)break;r=Math.max(r,o-2)}}else{if(e&&wu.has(i))break;t=r}return!i&&!this.atEnd?this.setNext("plain-scalar"):(yield bc,yield*this.pushToIndex(t+1,!0),e?"flow":"doc")}*pushCount(e){return e>0?(yield this.buffer.substr(this.pos,e),this.pos+=e,e):0}*pushToIndex(e,t){const r=this.buffer.slice(this.pos,e);return r?(yield r,this.pos+=r.length,r.length):(t&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(qh))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const e=this.flowLevel>0,t=this.charAt(1);if(hi(t)||e&&wu.has(t))return e?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let e=this.pos+2,t=this.buffer[e];for(;!hi(t)&&t!==">";)t=this.buffer[++e];return yield*this.pushToIndex(t===">"?e+1:e,!1)}else{let e=this.pos+1,t=this.buffer[e];for(;t;)if(xQ.has(t))t=this.buffer[++e];else if(t==="%"&&Gb.has(this.buffer[e+1])&&Gb.has(this.buffer[e+2]))t=this.buffer[e+=3];else break;return yield*this.pushToIndex(e,!1)}}*pushNewline(){const e=this.buffer[this.pos];return e===`
|
|
136
|
-
`?yield*this.pushCount(1):e==="\r"&&this.charAt(1)===`
|
|
137
|
-
`?yield*this.pushCount(2):0}*pushSpaces(e){let t=this.pos-1,r;do r=this.buffer[++t];while(r===" "||e&&r===" ");const i=t-this.pos;return i>0&&(yield this.buffer.substr(this.pos,i),this.pos=t),i}*pushUntil(e){let t=this.pos,r=this.buffer[t];for(;!e(r);)r=this.buffer[++t];return yield*this.pushToIndex(t,!1)}}class zk{constructor(){this.lineStarts=[],this.addNewLine=e=>this.lineStarts.push(e),this.linePos=e=>{let t=0,r=this.lineStarts.length;for(;t<r;){const s=t+r>>1;this.lineStarts[s]<e?t=s+1:r=s}if(this.lineStarts[t]===e)return{line:t+1,col:1};if(t===0)return{line:0,col:e};const i=this.lineStarts[t-1];return{line:t,col:e-i+1}}}}function Is(n,e){for(let t=0;t<n.length;++t)if(n[t].type===e)return!0;return!1}function Hb(n){for(let e=0;e<n.length;++e)switch(n[e].type){case"space":case"comment":case"newline":break;default:return e}return-1}function Zk(n){switch(n?.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function _u(n){switch(n.type){case"document":return n.start;case"block-map":{const e=n.items[n.items.length-1];return e.sep??e.start}case"block-seq":return n.items[n.items.length-1].start;default:return[]}}function la(n){if(n.length===0)return[];let e=n.length;e:for(;--e>=0;)switch(n[e].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;n[++e]?.type==="space";);return n.splice(e,n.length)}function Kb(n){if(n.start.type==="flow-seq-start")for(const e of n.items)e.sep&&!e.value&&!Is(e.start,"explicit-key-ind")&&!Is(e.sep,"map-value-ind")&&(e.key&&(e.value=e.key),delete e.key,Zk(e.value)?e.value.end?Array.prototype.push.apply(e.value.end,e.sep):e.value.end=e.sep:Array.prototype.push.apply(e.start,e.sep),delete e.sep)}let Dv=class{constructor(e){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new jk,this.onNewLine=e}*parse(e,t=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(e,t))yield*this.next(r);t||(yield*this.end())}*next(e){if(this.source=e,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=e.length;return}const t=Bk(e);if(t)if(t==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=t,yield*this.step(),t){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+e.length);break;case"space":this.atNewLine&&e[0]===" "&&(this.indent+=e.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=e.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=e.length}else{const r=`Not a YAML token: ${e}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:e}),this.offset+=e.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const e=this.peek(1);if(this.type==="doc-end"&&e?.type!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!e)return yield*this.stream();switch(e.type){case"document":return yield*this.document(e);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(e);case"block-scalar":return yield*this.blockScalar(e);case"block-map":return yield*this.blockMap(e);case"block-seq":return yield*this.blockSequence(e);case"flow-collection":return yield*this.flowCollection(e);case"doc-end":return yield*this.documentEnd(e)}yield*this.pop()}peek(e){return this.stack[this.stack.length-e]}*pop(e){const t=e??this.stack.pop();if(!t)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield t;else{const r=this.peek(1);switch(t.type==="block-scalar"?t.indent="indent"in r?r.indent:0:t.type==="flow-collection"&&r.type==="document"&&(t.indent=0),t.type==="flow-collection"&&Kb(t),r.type){case"document":r.value=t;break;case"block-scalar":r.props.push(t);break;case"block-map":{const i=r.items[r.items.length-1];if(i.value){r.items.push({start:[],key:t,sep:[]}),this.onKeyLine=!0;return}else if(i.sep)i.value=t;else{Object.assign(i,{key:t,sep:[]}),this.onKeyLine=!i.explicitKey;return}break}case"block-seq":{const i=r.items[r.items.length-1];i.value?r.items.push({start:[],value:t}):i.value=t;break}case"flow-collection":{const i=r.items[r.items.length-1];!i||i.value?r.items.push({start:[],key:t,sep:[]}):i.sep?i.value=t:Object.assign(i,{key:t,sep:[]});return}default:yield*this.pop(),yield*this.pop(t)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(t.type==="block-map"||t.type==="block-seq")){const i=t.items[t.items.length-1];i&&!i.sep&&!i.value&&i.start.length>0&&Hb(i.start)===-1&&(t.indent===0||i.start.every(s=>s.type!=="comment"||s.indent<t.indent))&&(r.type==="document"?r.end=i.start:r.items.push({start:i.start}),t.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const e={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&e.start.push(this.sourceToken),this.stack.push(e);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(e){if(e.value)return yield*this.lineEnd(e);switch(this.type){case"doc-start":{Hb(e.start)!==-1?(yield*this.pop(),yield*this.step()):e.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":e.start.push(this.sourceToken);return}const t=this.startBlockValue(e);t?this.stack.push(t):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(e){if(this.type==="map-value-ind"){const t=_u(this.peek(2)),r=la(t);let i;e.end?(i=e.end,i.push(this.sourceToken),delete e.end):i=[this.sourceToken];const s={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:r,key:e,sep:i}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=s}else yield*this.lineEnd(e)}*blockScalar(e){switch(this.type){case"space":case"comment":case"newline":e.props.push(this.sourceToken);return;case"scalar":if(e.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let t=this.source.indexOf(`
|
|
138
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
139
|
-
`,t)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,t.value){const r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else if(t.sep)t.sep.push(this.sourceToken);else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return}if(this.indent>=e.indent){const r=!this.onKeyLine&&this.indent===e.indent,i=r&&(t.sep||t.explicitKey)&&this.type!=="seq-item-ind";let s=[];if(i&&t.sep&&!t.value){const o=[];for(let a=0;a<t.sep.length;++a){const l=t.sep[a];switch(l.type){case"newline":o.push(a);break;case"space":break;case"comment":l.indent>e.indent&&(o.length=0);break;default:o.length=0}}o.length>=2&&(s=t.sep.splice(o[1]))}switch(this.type){case"anchor":case"tag":i||t.value?(s.push(this.sourceToken),e.items.push({start:s}),this.onKeyLine=!0):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"explicit-key-ind":!t.sep&&!t.explicitKey?(t.start.push(this.sourceToken),t.explicitKey=!0):i||t.value?(s.push(this.sourceToken),e.items.push({start:s,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(t.explicitKey)if(t.sep)if(t.value)e.items.push({start:[],key:null,sep:[this.sourceToken]});else if(Is(t.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:s,key:null,sep:[this.sourceToken]}]});else if(Zk(t.key)&&!Is(t.sep,"newline")){const o=la(t.start),a=t.key,l=t.sep;l.push(this.sourceToken),delete t.key,delete t.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:a,sep:l}]})}else s.length>0?t.sep=t.sep.concat(s,this.sourceToken):t.sep.push(this.sourceToken);else if(Is(t.start,"newline"))Object.assign(t,{key:null,sep:[this.sourceToken]});else{const o=la(t.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:o,key:null,sep:[this.sourceToken]}]})}else t.sep?t.value||i?e.items.push({start:s,key:null,sep:[this.sourceToken]}):Is(t.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const o=this.flowScalar(this.type);i||t.value?(e.items.push({start:s,key:o,sep:[]}),this.onKeyLine=!0):t.sep?this.stack.push(o):(Object.assign(t,{key:o,sep:[]}),this.onKeyLine=!0);return}default:{const o=this.startBlockValue(e);if(o){if(o.type==="block-seq"){if(!t.explicitKey&&t.sep&&!Is(t.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else r&&e.items.push({start:s});this.stack.push(o);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(e){const t=e.items[e.items.length-1];switch(this.type){case"newline":if(t.value){const r="end"in t.value?t.value.end:void 0;(Array.isArray(r)?r[r.length-1]:void 0)?.type==="comment"?r?.push(this.sourceToken):e.items.push({start:[this.sourceToken]})}else t.start.push(this.sourceToken);return;case"space":case"comment":if(t.value)e.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(t.start,e.indent)){const i=e.items[e.items.length-2]?.value?.end;if(Array.isArray(i)){Array.prototype.push.apply(i,t.start),i.push(this.sourceToken),e.items.pop();return}}t.start.push(this.sourceToken)}return;case"anchor":case"tag":if(t.value||this.indent<=e.indent)break;t.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==e.indent)break;t.value||Is(t.start,"seq-item-ind")?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return}if(this.indent>e.indent){const r=this.startBlockValue(e);if(r){this.stack.push(r);return}}yield*this.pop(),yield*this.step()}*flowCollection(e){const t=e.items[e.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while(r?.type==="flow-collection")}else if(e.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!t||t.sep?e.items.push({start:[this.sourceToken]}):t.start.push(this.sourceToken);return;case"map-value-ind":!t||t.value?e.items.push({start:[],key:null,sep:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):Object.assign(t,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!t||t.value?e.items.push({start:[this.sourceToken]}):t.sep?t.sep.push(this.sourceToken):t.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const i=this.flowScalar(this.type);!t||t.value?e.items.push({start:[],key:i,sep:[]}):t.sep?this.stack.push(i):Object.assign(t,{key:i,sep:[]});return}case"flow-map-end":case"flow-seq-end":e.end.push(this.sourceToken);return}const r=this.startBlockValue(e);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===e.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const i=_u(r),s=la(i);Kb(e);const o=e.end.splice(1,e.end.length);o.push(this.sourceToken);const a={type:"block-map",offset:e.offset,indent:e.indent,items:[{start:s,key:e,sep:o}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=a}else yield*this.lineEnd(e)}}flowScalar(e){if(this.onNewLine){let t=this.source.indexOf(`
|
|
140
|
-
`)+1;for(;t!==0;)this.onNewLine(this.offset+t),t=this.source.indexOf(`
|
|
141
|
-
`,t)+1}return{type:e,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(e){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const t=_u(e),r=la(t);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const t=_u(e),r=la(t);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(e,t){return this.type!=="comment"||this.indent<=t?!1:e.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(e){this.type!=="doc-mode"&&(e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(e){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;default:e.end?e.end.push(this.sourceToken):e.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}};function Fk(n){const e=n.prettyErrors!==!1;return{lineCounter:n.lineCounter||e&&new zk||null,prettyErrors:e}}function AQ(n,e={}){const{lineCounter:t,prettyErrors:r}=Fk(e),i=new Dv(t?.addNewLine),s=new Rv(e),o=Array.from(s.compose(i.parse(n)));if(r&&t)for(const a of o)a.errors.forEach(Df(n,t)),a.warnings.forEach(Df(n,t));return o.length>0?o:Object.assign([],{empty:!0},s.streamInfo())}function Xk(n,e={}){const{lineCounter:t,prettyErrors:r}=Fk(e),i=new Dv(t?.addNewLine),s=new Rv(e);let o=null;for(const a of s.compose(i.parse(n),!0,n.length))if(!o)o=a;else if(o.options.logLevel!=="silent"){o.errors.push(new Eo(a.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&t&&(o.errors.forEach(Df(n,t)),o.warnings.forEach(Df(n,t))),o}function CQ(n,e,t){let r;typeof e=="function"?r=e:t===void 0&&e&&typeof e=="object"&&(t=e);const i=Xk(n,t);if(!i)return null;if(i.warnings.forEach(s=>lk(i.options.logLevel,s)),i.errors.length>0){if(i.options.logLevel!=="silent")throw i.errors[0];i.errors=[]}return i.toJS(Object.assign({reviver:r},t))}function TQ(n,e,t){let r=null;if(typeof e=="function"||Array.isArray(e)?r=e:t===void 0&&e&&(t=e),typeof t=="string"&&(t=t.length),typeof t=="number"){const i=Math.round(t);t=i<1?void 0:i>8?{indent:8}:{indent:i}}if(n===void 0){const{keepUndefined:i}=t??e??{};if(!i)return}return ea(n)&&!r?n.toString(t):new Wd(n,r,t).toString(t)}const Nf=Object.freeze(Object.defineProperty({__proto__:null,Alias:Id,CST:kQ,Composer:Rv,Document:Wd,Lexer:jk,LineCounter:zk,Pair:sr,Parser:Dv,Scalar:ot,Schema:Ck,YAMLError:Mv,YAMLMap:jr,YAMLParseError:Eo,YAMLSeq:Js,YAMLWarning:Ek,isAlias:lo,isCollection:On,isDocument:ea,isMap:hl,isNode:yn,isPair:pn,isScalar:nn,isSeq:pl,parse:CQ,parseAllDocuments:AQ,parseDocument:Xk,stringify:TQ,visit:ta,visitAsync:Dd},Symbol.toStringTag,{value:"Module"}));function PQ(n){const e=n.match(/^---\r?\n([\s\S]*?\r?\n)?---\r?\n?([\s\S]*)$/);if(!e)return{frontmatter:{},body:n};const t=Nf.parse(e[1]??"")??{},r=e[2];return{frontmatter:t,body:r}}function Rh(n,e){return Object.keys(n).length===0?e:`---
|
|
142
|
-
${Nf.stringify(n,{lineWidth:0}).trimEnd()}
|
|
143
|
-
---
|
|
144
|
-
${e}`}let EQ=class{#e=J(null);get tree(){return g(this.#e)}set tree(e){q(this.#e,e,!0)}#r=J(null);get currentPath(){return g(this.#r)}set currentPath(e){q(this.#r,e,!0)}#t=J("");get savedContent(){return g(this.#t)}set savedContent(e){q(this.#t,e,!0)}#i=J("");get editorContent(){return g(this.#i)}set editorContent(e){q(this.#i,e,!0)}#a=J(Ht({}));get frontmatter(){return g(this.#a)}set frontmatter(e){q(this.#a,e,!0)}#s=J("");get bodyContent(){return g(this.#s)}set bodyContent(e){q(this.#s,e,!0)}#n=J(!1);get frontmatterOpen(){return g(this.#n)}set frontmatterOpen(e){q(this.#n,e,!0)}#o=J(!1);get frontmatterRawMode(){return g(this.#o)}set frontmatterRawMode(e){q(this.#o,e,!0)}#l=J("blocks");get editorMode(){return g(this.#l)}set editorMode(e){q(this.#l,e,!0)}#c=J(!1);get treeLoading(){return g(this.#c)}set treeLoading(e){q(this.#c,e,!0)}#u=J(!1);get fileLoading(){return g(this.#u)}set fileLoading(e){q(this.#u,e,!0)}#f=J(!1);get saving(){return g(this.#f)}set saving(e){q(this.#f,e,!0)}#p=J(!1);get saveJustCompleted(){return g(this.#p)}set saveJustCompleted(e){q(this.#p,e,!0)}#h=J(null);get error(){return g(this.#h)}set error(e){q(this.#h,e,!0)}#m=J(Ht([]));get runes(){return g(this.#m)}set runes(e){q(this.#m,e,!0)}#g=J(Ht([]));get routeRules(){return g(this.#g)}set routeRules(e){q(this.#g,e,!0)}#d=J("desktop");get viewport(){return g(this.#d)}set viewport(e){q(this.#d,e,!0)}#w=J("light");get previewTheme(){return g(this.#w)}set previewTheme(e){q(this.#w,e,!0)}#_=J("");get themeCss(){return g(this.#_)}set themeCss(e){q(this.#_,e,!0)}#k=J(null);get themeConfig(){return g(this.#k)}set themeConfig(e){q(this.#k,e,!0)}#b=J(null);get highlightTransform(){return g(this.#b)}set highlightTransform(e){q(this.#b,e,!0)}#v=J("");get highlightCss(){return g(this.#v)}set highlightCss(e){q(this.#v,e,!0)}#O=J(!1);get previewRuntimeAvailable(){return g(this.#O)}set previewRuntimeAvailable(e){q(this.#O,e,!0)}#y=J(!1);get previewRuntimeReady(){return g(this.#y)}set previewRuntimeReady(e){q(this.#y,e,!0)}#x=J(Ht(new Set));get expandedDirs(){return g(this.#x)}set expandedDirs(e){q(this.#x,e,!0)}#S=J(null);get externalChange(){return g(this.#S)}set externalChange(e){q(this.#S,e,!0)}#A=J(null);get communityTags(){return g(this.#A)}set communityTags(e){q(this.#A,e,!0)}#C=J(null);get communityPostTransforms(){return g(this.#C)}set communityPostTransforms(e){q(this.#C,e,!0)}#T=J(null);get communityStyles(){return g(this.#T)}set communityStyles(e){q(this.#T,e,!0)}#P=J(Ht({}));get aggregated(){return g(this.#P)}set aggregated(e){q(this.#P,e,!0)}#E=J(!0);get sidenavOpen(){return g(this.#E)}set sidenavOpen(e){q(this.#E,e,!0)}#$=ge(()=>this.editorContent!==this.savedContent);get dirty(){return g(this.#$)}set dirty(e){q(this.#$,e)}#Q=ge(()=>this.currentPath?.endsWith("_layout.md")?"layout":"page");get currentFileType(){return g(this.#Q)}set currentFileType(e){q(this.#Q,e)}loadFile(e,t){const{frontmatter:r,body:i}=PQ(t);this.currentPath=e,this.savedContent=t,this.editorContent=t,this.frontmatter=r,this.bodyContent=i,this.frontmatterRawMode=!1}updateBody(e){this.bodyContent=e,this.editorContent=Rh(this.frontmatter,e)}updateFrontmatterField(e,t){if(t===void 0||t===""||Array.isArray(t)&&t.length===0){const{[e]:r,...i}=this.frontmatter;this.frontmatter=i}else this.frontmatter={...this.frontmatter,[e]:t};this.editorContent=Rh(this.frontmatter,this.bodyContent)}replaceFrontmatter(e){this.frontmatter=e,this.editorContent=Rh(e,this.bodyContent)}toggleDir(e){const t=new Set(this.expandedDirs);t.has(e)?t.delete(e):t.add(e),this.expandedDirs=t}isDirExpanded(e){return this.expandedDirs.has(e)}};const X=new EQ;var $Q=W('<div class="header__group svelte-1q0qpei"><button>Edit</button> <button>Preview</button></div>'),QQ=W('<span class="header__sep svelte-1q0qpei">/</span>'),LQ=W('<span class="header__crumb header__crumb--current svelte-1q0qpei"><svg class="header__doc-icon svelte-1q0qpei" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M9 1.5H4a1.5 1.5 0 0 0-1.5 1.5v10A1.5 1.5 0 0 0 4 14.5h8A1.5 1.5 0 0 0 13.5 13V6L9 1.5Z" class="svelte-1q0qpei"></path><polyline points="9 1.5 9 6 13.5 6" class="svelte-1q0qpei"></polyline></svg> </span>'),MQ=W('<span class="header__crumb svelte-1q0qpei"> </span>'),qQ=W("<!> <!>",1),RQ=W('<span class="header__dot svelte-1q0qpei" title="Unsaved changes"></span>'),DQ=W('<nav class="header__breadcrumbs svelte-1q0qpei" aria-label="File path"><!> <!></nav>'),IQ=W('<span class="header__error svelte-1q0qpei"> </span>'),NQ=W('<div class="header__group svelte-1q0qpei"><button title="Desktop"><svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1q0qpei"><rect x="1.5" y="2" width="13" height="9" rx="1" class="svelte-1q0qpei"></rect><line x1="5.5" y1="14" x2="10.5" y2="14" class="svelte-1q0qpei"></line><line x1="8" y1="11" x2="8" y2="14" class="svelte-1q0qpei"></line></svg></button> <button title="Tablet"><svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1q0qpei"><rect x="3" y="1.5" width="10" height="13" rx="1.5" class="svelte-1q0qpei"></rect><line x1="7" y1="12.5" x2="9" y2="12.5" class="svelte-1q0qpei"></line></svg></button> <button title="Mobile"><svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1q0qpei"><rect x="4" y="1.5" width="8" height="13" rx="2" class="svelte-1q0qpei"></rect><line x1="7" y1="12.5" x2="9" y2="12.5" class="svelte-1q0qpei"></line></svg></button></div> <span class="header__divider svelte-1q0qpei"></span> <div class="header__group svelte-1q0qpei"><button title="Light mode"><svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1q0qpei"><circle cx="8" cy="8" r="3" class="svelte-1q0qpei"></circle><line x1="8" y1="1.5" x2="8" y2="3" class="svelte-1q0qpei"></line><line x1="8" y1="13" x2="8" y2="14.5" class="svelte-1q0qpei"></line><line x1="2.4" y1="2.4" x2="3.5" y2="3.5" class="svelte-1q0qpei"></line><line x1="12.5" y1="12.5" x2="13.6" y2="13.6" class="svelte-1q0qpei"></line><line x1="1.5" y1="8" x2="3" y2="8" class="svelte-1q0qpei"></line><line x1="13" y1="8" x2="14.5" y2="8" class="svelte-1q0qpei"></line><line x1="2.4" y1="13.6" x2="3.5" y2="12.5" class="svelte-1q0qpei"></line><line x1="12.5" y1="3.5" x2="13.6" y2="2.4" class="svelte-1q0qpei"></line></svg></button> <button title="Dark mode"><svg width="15" height="15" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1q0qpei"><path d="M13.5 8.5a5.5 5.5 0 0 1-7-7 5.5 5.5 0 1 0 7 7Z" class="svelte-1q0qpei"></path></svg></button></div>',1),BQ=W('<div class="header__group svelte-1q0qpei"><button>Code</button> <button>Blocks</button></div>'),jQ=Ps('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="svelte-1q0qpei"><polyline points="3.5 8.5 6.5 11.5 12.5 4.5" class="svelte-1q0qpei"></polyline></svg> Saved',1),zQ=W('<button><!> <kbd class="header__kbd svelte-1q0qpei"></kbd></button>'),ZQ=W('<header class="header svelte-1q0qpei"><button class="header__sidebar-toggle svelte-1q0qpei"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-1q0qpei"><rect x="1.5" y="2.5" width="13" height="11" rx="1.5" class="svelte-1q0qpei"></rect><line x1="5.5" y1="2.5" x2="5.5" y2="13.5" class="svelte-1q0qpei"></line></svg></button> <!> <!> <!> <div class="header__spacer svelte-1q0qpei"></div> <!> <!></header>');function FQ(n,e){dt(e,!0);let t=ge(()=>X.currentPath?X.currentPath.split("/"):[]);const r=ge(()=>X.currentPath&&X.currentFileType!=="layout"),i=ge(()=>X.editorMode==="preview"),s=ge(()=>X.editorMode==="blocks"||X.editorMode==="code");var o=ZQ(),a=R(o);a.__click=()=>{X.sidenavOpen=!X.sidenavOpen};var l=D(a,2);{var c=b=>{var w=$Q(),S=R(w);let _;S.__click=()=>{X.editorMode="blocks"};var x=D(S,2);let A;x.__click=()=>{X.editorMode="preview"},ce(()=>{_=Be(S,1,"header__btn svelte-1q0qpei",null,_,{"header__btn--active":g(s)}),A=Be(x,1,"header__btn svelte-1q0qpei",null,A,{"header__btn--active":g(i)})}),z(b,w)};le(l,b=>{g(r)&&b(c)})}var u=D(l,2);{var f=b=>{var w=DQ(),S=R(w);Ct(S,17,()=>g(t),Yt,(A,C,y)=>{var k=qQ(),P=tt(k);{var T=L=>{var I=QQ();z(L,I)};le(P,L=>{y>0&&L(T)})}var E=D(P,2);{var Q=L=>{var I=LQ(),Z=D(R(I));ce(()=>Te(Z,` ${g(C)??""}`)),z(L,I)},$=L=>{var I=MQ(),Z=R(I);ce(()=>Te(Z,g(C))),z(L,I)};le(E,L=>{y===g(t).length-1?L(Q):L($,!1)})}z(A,k)});var _=D(S,2);{var x=A=>{var C=RQ();z(A,C)};le(_,A=>{X.dirty&&A(x)})}z(b,w)};le(u,b=>{X.currentPath&&b(f)})}var d=D(u,2);{var h=b=>{var w=IQ(),S=R(w);ce(()=>Te(S,X.error)),z(b,w)};le(d,b=>{X.error&&b(h)})}var m=D(d,4);{var p=b=>{var w=an(),S=tt(w);{var _=A=>{var C=NQ(),y=tt(C),k=R(y);let P;k.__click=()=>X.viewport="desktop";var T=D(k,2);let E;T.__click=()=>X.viewport="tablet";var Q=D(T,2);let $;Q.__click=()=>X.viewport="mobile";var L=D(y,4),I=R(L);let Z;I.__click=()=>X.previewTheme="light";var Y=D(I,2);let ne;Y.__click=()=>X.previewTheme="dark",ce(()=>{P=Be(k,1,"header__btn header__btn--icon svelte-1q0qpei",null,P,{"header__btn--active":X.viewport==="desktop"}),E=Be(T,1,"header__btn header__btn--icon svelte-1q0qpei",null,E,{"header__btn--active":X.viewport==="tablet"}),$=Be(Q,1,"header__btn header__btn--icon svelte-1q0qpei",null,$,{"header__btn--active":X.viewport==="mobile"}),Z=Be(I,1,"header__btn header__btn--icon svelte-1q0qpei",null,Z,{"header__btn--active":X.previewTheme==="light"}),ne=Be(Y,1,"header__btn header__btn--icon svelte-1q0qpei",null,ne,{"header__btn--active":X.previewTheme==="dark"})}),z(A,C)},x=A=>{var C=BQ(),y=R(C);let k;y.__click=()=>{X.editorMode="code"};var P=D(y,2);let T;P.__click=()=>{X.editorMode="blocks"},ce(()=>{k=Be(y,1,"header__btn svelte-1q0qpei",null,k,{"header__btn--active":X.editorMode==="code"}),T=Be(P,1,"header__btn svelte-1q0qpei",null,T,{"header__btn--active":X.editorMode==="blocks"})}),z(A,C)};le(S,A=>{g(i)?A(_):g(s)&&A(x,1)})}z(b,w)};le(m,b=>{g(r)&&b(p)})}var v=D(m,2);{var O=b=>{var w=zQ();let S;w.__click=function(...k){e.onsave?.apply(this,k)};var _=R(w);{var x=k=>{var P=jQ();z(k,P)},A=k=>{var P=Rb("Saving...");z(k,P)},C=k=>{var P=Rb("Save");z(k,P)};le(_,k=>{X.saveJustCompleted?k(x):X.saving?k(A,1):k(C,!1)})}var y=D(_,2);y.textContent=`${navigator.platform.includes("Mac")?"⌘":"Ctrl"}S`,ce(()=>{S=Be(w,1,"header__btn header__btn--active svelte-1q0qpei",null,S,{"header__btn--success":X.saveJustCompleted}),w.disabled=!X.dirty||X.saving}),z(b,w)};le(v,b=>{X.currentPath&&b(O)})}ce(()=>St(a,"title",X.sidenavOpen?"Hide sidebar":"Show sidebar")),z(n,o),ht()}Vt(["click"]);var XQ=W('<div><div class="layout__left svelte-c9ce7p"><!></div> <div class="layout__main svelte-c9ce7p"><div class="layout__header svelte-c9ce7p"><!></div> <div class="layout__content svelte-c9ce7p"><div class="layout__panel layout__panel--center svelte-c9ce7p"><div><!></div></div> <div class="layout__panel layout__panel--right svelte-c9ce7p"><!></div></div></div></div>');function VQ(n,e){dt(e,!0);let t=J(0),r=ge(()=>X.editorMode==="code"?"1fr 1fr":"0px 1fr");const i=ge(()=>Math.floor(Math.max(0,g(t))/2));var s=XQ();let o;var a=R(s);Er(a,"width: 360px");var l=R(a);ya(l,()=>e.left);var c=D(a,2),u=R(c),f=R(u);ya(f,()=>e.header);var d=D(u,2),h=R(d),m=R(h);let p;var v=R(m);ya(v,()=>e.center);var O=D(h,2),b=R(O);ya(b,()=>e.right),ce(()=>{o=Be(s,1,"layout svelte-c9ce7p",null,o,{"layout--sidenav-closed":!X.sidenavOpen}),Er(d,`grid-template-columns: ${g(r)??""}`),p=Be(m,1,"layout__center-inner svelte-c9ce7p",null,p,{"slide-out":X.editorMode!=="code"}),Er(m,`min-width: ${g(i)??""}px`)}),g$(c,"clientWidth",w=>q(t,w)),z(n,s),ht()}var WQ=Ps('<svg class="tree-dir__icon svelte-150vzea" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 4h4.5l1.5 1.5H14.5v8.5h-13z"></path><path d="M1.5 4v-1.5h4.5l1.5 1.5"></path></svg>'),YQ=Ps('<svg class="tree-dir__icon svelte-150vzea" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 4h4.5l1.5 1.5H14.5v8.5h-13V2.5h4.5l1.5 1.5"></path></svg>'),UQ=W('<button class="tree-dir__add svelte-150vzea"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),GQ=W('<div class="tree-dir svelte-150vzea" role="treeitem" tabindex="0"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 4 10 8 6 12"></polyline></svg> <!> <span class="tree-dir__name svelte-150vzea"> </span> <!></div>'),HQ=W('<button><svg class="tree-item__icon svelte-150vzea" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><rect x="1.5" y="1.5" width="13" height="13" rx="1.5"></rect><line x1="1.5" y1="5.5" x2="14.5" y2="5.5"></line><line x1="6" y1="5.5" x2="6" y2="14.5"></line></svg> <span class="tree-item__name svelte-150vzea">_layout.md</span></button>'),KQ=W('<span class="tree-item__badge svelte-150vzea">Draft</span>'),JQ=W('<button><svg class="tree-item__icon svelte-150vzea" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M9 1.5H4a1.5 1.5 0 0 0-1.5 1.5v10A1.5 1.5 0 0 0 4 14.5h8A1.5 1.5 0 0 0 13.5 13V6L9 1.5Z"></path><polyline points="9 1.5 9 6 13.5 6"></polyline></svg> <span class="tree-item__name svelte-150vzea"> </span> <!></button>'),e5=W("<!> <!>",1),t5=W("<!> <!>",1);function mm(n,e){dt(e,!0);function t(c,u){e.oncontextmenu&&(c.preventDefault(),e.oncontextmenu(c,u))}function r(c){e.onselectfile(c)}function i(){X.toggleDir(e.node.path||e.node.name)}let s=ge(()=>X.isDirExpanded(e.node.path||e.node.name));var o=an(),a=tt(o);{var l=c=>{var u=t5(),f=tt(u);{var d=p=>{var v=GQ();v.__click=i,v.__keydown=k=>{(k.key==="Enter"||k.key===" ")&&(k.preventDefault(),i())},v.__contextmenu=k=>t(k,e.node);var O=R(v);let b;var w=D(O,2);{var S=k=>{var P=WQ();z(k,P)},_=k=>{var P=YQ();z(k,P)};le(w,k=>{g(s)?k(S):k(_,!1)})}var x=D(w,2),A=R(x),C=D(x,2);{var y=k=>{var P=UQ();P.__click=T=>{T.stopPropagation(),e.onnewpage(e.node.path,T.currentTarget.getBoundingClientRect())},ce(()=>St(P,"title",`New page in ${e.node.name??""}`)),z(k,P)};le(C,k=>{e.onnewpage&&k(y)})}ce(()=>{Er(v,`--depth: ${e.depth-1}`),b=Be(O,0,"tree-dir__chevron svelte-150vzea",null,b,{collapsed:!g(s)}),Te(A,e.node.name)}),z(p,v)};le(f,p=>{e.depth>0&&p(d)})}var h=D(f,2);{var m=p=>{var v=e5(),O=tt(v);{var b=S=>{var _=HQ();let x;_.__click=()=>r(e.node.layout.path),_.__contextmenu=A=>t(A,e.node.layout),ce(()=>{x=Be(_,1,"tree-item tree-item--layout svelte-150vzea",null,x,{active:X.currentPath===e.node.layout.path}),Er(_,`--depth: ${e.depth??""}`)}),z(S,_)};le(O,S=>{e.node.layout&&S(b)})}var w=D(O,2);Ct(w,17,()=>e.node.children??[],Yt,(S,_)=>{var x=an(),A=tt(x);{var C=k=>{{let P=ge(()=>e.depth+1);mm(k,{get node(){return g(_)},get depth(){return g(P)},get onselectfile(){return e.onselectfile},get oncontextmenu(){return e.oncontextmenu},get onnewpage(){return e.onnewpage}})}},y=k=>{var P=JQ();let T;P.__click=()=>r(g(_).path),P.__contextmenu=I=>t(I,g(_));var E=D(R(P),2),Q=R(E),$=D(E,2);{var L=I=>{var Z=KQ();z(I,Z)};le($,I=>{g(_).draft&&I(L)})}ce(()=>{T=Be(P,1,"tree-item svelte-150vzea",null,T,{active:X.currentPath===g(_).path}),Er(P,`--depth: ${e.depth??""}`),Te(Q,g(_).name)}),z(k,P)};le(A,k=>{g(_).type==="directory"?k(C):k(y,!1)})}z(S,x)}),z(p,v)};le(h,p=>{(e.depth===0||g(s))&&p(m)})}z(c,u)};le(a,c=>{e.node.type==="directory"&&c(l)})}z(n,o),ht()}Vt(["click","keydown","contextmenu"]);var n5=W('<div class="cat-nav__skeleton svelte-z46wvt"><div class="skeleton-bar svelte-z46wvt" style="width: 70%"></div> <div class="skeleton-bar svelte-z46wvt" style="width: 55%"></div> <div class="skeleton-bar svelte-z46wvt" style="width: 85%"></div> <div class="skeleton-bar svelte-z46wvt" style="width: 60%; margin-left: 1rem"></div> <div class="skeleton-bar svelte-z46wvt" style="width: 50%; margin-left: 1rem"></div></div>'),r5=W('<span class="tree-item__badge svelte-z46wvt">Draft</span>'),i5=W('<button style="--depth: 0"><svg class="tree-item__icon svelte-z46wvt" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M9 1.5H4a1.5 1.5 0 0 0-1.5 1.5v10A1.5 1.5 0 0 0 4 14.5h8A1.5 1.5 0 0 0 13.5 13V6L9 1.5Z" class="svelte-z46wvt"></path><polyline points="9 1.5 9 6 13.5 6" class="svelte-z46wvt"></polyline></svg> <span class="tree-item__name svelte-z46wvt"> </span> <!></button>'),s5=W('<div class="cat-nav__empty svelte-z46wvt">No content yet</div>'),o5=W('<div class="cat-nav__section svelte-z46wvt"><div class="cat-nav__section-header svelte-z46wvt"><span class="cat-nav__section-name svelte-z46wvt"> </span> <button class="cat-nav__icon-btn svelte-z46wvt"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" class="svelte-z46wvt"><line x1="8" y1="3" x2="8" y2="13" class="svelte-z46wvt"></line><line x1="3" y1="8" x2="13" y2="8" class="svelte-z46wvt"></line></svg></button></div> <!></div>'),a5=W('<div class="cat-nav__list svelte-z46wvt"></div>'),l5=W('<nav class="cat-nav svelte-z46wvt"><div class="cat-nav__header svelte-z46wvt"><span class="cat-nav__title svelte-z46wvt">Content</span> <div class="cat-nav__actions svelte-z46wvt"><button class="cat-nav__icon-btn svelte-z46wvt" title="New category"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" class="svelte-z46wvt"><path d="M1 3h5l1.5 1.5H15v10H1V3z" stroke="currentColor" stroke-width="1.2" class="svelte-z46wvt"></path><path d="M8 7.5v3M6.5 9h3" stroke="currentColor" stroke-width="1.2" stroke-linecap="round" class="svelte-z46wvt"></path></svg></button></div></div> <!></nav>');function c5(n,e){dt(e,!0);function t(d){return d.replace(/\/?\*+$/,"")}function r(d){if(!d)return"Pages";const h=d.split("/").pop();return h.charAt(0).toUpperCase()+h.slice(1)}let i=ge(()=>{const d=X.tree,h=X.routeRules;if(!d)return[];const m=[],p=new Set;for(const O of h){const b=t(O.pattern);if(!b)continue;const w=d.children?.find(S=>S.type==="directory"&&S.name===b)??null;p.add(b),m.push({name:r(b),pattern:O.pattern,layout:O.layout,dirPrefix:b,treeNode:w,rootPages:[]})}const v=(d.children??[]).filter(O=>O.type!=="directory"||!p.has(O.name));return m.unshift({name:"Pages",pattern:"**",layout:"default",dirPrefix:"",treeNode:null,rootPages:v}),m});var s=l5(),o=R(s),a=D(R(o),2),l=R(a);l.__click=d=>e.onnewcategory(d.currentTarget.getBoundingClientRect());var c=D(o,2);{var u=d=>{var h=n5();z(d,h)},f=d=>{var h=a5();Ct(h,21,()=>g(i),Yt,(m,p)=>{var v=o5(),O=R(v),b=R(O),w=R(b),S=D(b,2);S.__click=y=>{const k=y.currentTarget.getBoundingClientRect();e.onnewpage(g(p).dirPrefix||void 0,k)};var _=D(O,2);{var x=y=>{mm(y,{get node(){return g(p).treeNode},depth:0,get onselectfile(){return e.onselectfile},get oncontextmenu(){return e.oncontextmenu},get onnewpage(){return e.onnewpage}})},A=y=>{var k=an(),P=tt(k);Ct(P,17,()=>g(p).rootPages,Yt,(T,E)=>{var Q=an(),$=tt(Q);{var L=Z=>{mm(Z,{get node(){return g(E)},depth:1,get onselectfile(){return e.onselectfile},get oncontextmenu(){return e.oncontextmenu},get onnewpage(){return e.onnewpage}})},I=Z=>{var Y=i5();let ne;Y.__click=()=>e.onselectfile(g(E).path),Y.__contextmenu=fe=>{e.oncontextmenu&&(fe.preventDefault(),e.oncontextmenu(fe,g(E)))};var ae=D(R(Y),2),ie=R(ae),K=D(ae,2);{var he=fe=>{var j=r5();z(fe,j)};le(K,fe=>{g(E).draft&&fe(he)})}ce(()=>{ne=Be(Y,1,"tree-item svelte-z46wvt",null,ne,{active:X.currentPath===g(E).path}),Te(ie,g(E).name)}),z(Z,Y)};le($,Z=>{g(E).type==="directory"?Z(L):Z(I,!1)})}z(T,Q)}),z(y,k)},C=y=>{var k=s5();z(y,k)};le(_,y=>{g(p).dirPrefix&&g(p).treeNode?y(x):g(p).dirPrefix?y(C,!1):y(A,1)})}ce(()=>{Te(w,g(p).name),St(S,"title",`Add to ${g(p).name??""}`)}),z(m,v)}),z(d,h)};le(c,d=>{X.treeLoading?d(u):d(f,!1)})}z(n,s),ht()}Vt(["click","contextmenu"]);var u5=W('<span class="tags-input__tag svelte-14skhb7"> <button class="tags-input__remove svelte-14skhb7">×</button></span>'),f5=W('<div class="tags-input svelte-14skhb7"><!> <input class="tags-input__field svelte-14skhb7" type="text"/></div>');function Vk(n,e){dt(e,!0);let t=J("");function r(c){const u=c.trim();u&&!e.tags.includes(u)&&e.onchange([...e.tags,u]),q(t,"")}function i(c){e.onchange(e.tags.filter((u,f)=>f!==c))}function s(c){c.key==="Enter"||c.key===","?(c.preventDefault(),r(g(t))):c.key==="Backspace"&&g(t)===""&&e.tags.length>0&&i(e.tags.length-1)}var o=f5(),a=R(o);Ct(a,17,()=>e.tags,Yt,(c,u,f)=>{var d=u5(),h=R(d),m=D(h);m.__click=()=>i(f),ce(()=>{Te(h,`${g(u)??""} `),St(m,"aria-label",`Remove ${g(u)??""}`)}),z(c,d)});var l=D(a,2);l.__keydown=s,ce(()=>St(l,"placeholder",e.tags.length===0?"Add tags...":"")),st("blur",l,()=>{g(t).trim()&&r(g(t))}),Qn(l,()=>g(t),c=>q(t,c)),z(n,o),ht()}Vt(["click","keydown"]);var d5=W('<div class="raw-yaml__error svelte-30mbeg"> </div>'),h5=W('<div class="raw-yaml svelte-30mbeg"><textarea></textarea> <!></div>');function p5(n,e){dt(e,!0);let t=J(""),r=J(null);hn(()=>{if(X.frontmatterRawMode){const u=Object.keys(X.frontmatter);q(t,u.length>0?Nf.stringify(X.frontmatter,{lineWidth:0}).trimEnd():"",!0)}});function i(u){const f=u.target.value;if(q(t,f,!0),q(r,null),f.trim()===""){X.replaceFrontmatter({});return}try{const d=Nf.parse(f);d&&typeof d=="object"?X.replaceFrontmatter(d):q(r,"YAML must be an object")}catch(d){q(r,d instanceof Error?d.message:"Invalid YAML",!0)}}var s=h5(),o=R(s);let a;o.__input=i,St(o,"spellcheck",!1);var l=D(o,2);{var c=u=>{var f=d5(),d=R(f);ce(()=>Te(d,g(r))),z(u,f)};le(l,u=>{g(r)&&u(c)})}ce(()=>{a=Be(o,1,"raw-yaml__editor svelte-30mbeg",null,a,{error:g(r)!==null}),sn(o,g(t))}),z(n,s),ht()}Vt(["input"]);var m5=W('<span class="fm-editor__summary-desc svelte-7izpdj"> </span>'),g5=W('<span class="fm-editor__summary svelte-7izpdj"> <!></span>'),v5=W('<div class="fm-editor__mode-track svelte-7izpdj"><button>Form</button> <button>YAML</button></div>'),O5=W('<div class="fm-field fm-field--custom svelte-7izpdj"><span class="fm-field__label svelte-7izpdj"> </span> <div class="fm-field__custom-row svelte-7izpdj"><input class="fm-field__input svelte-7izpdj" type="text"/> <button class="fm-field__remove svelte-7izpdj">×</button></div></div>'),b5=W('<div class="fm-editor__custom-section svelte-7izpdj"><span class="fm-editor__section-label svelte-7izpdj">Custom fields</span> <!></div>'),y5=W('<div class="fm-editor__fields svelte-7izpdj"><label class="fm-field svelte-7izpdj"><span class="fm-field__label svelte-7izpdj">Title</span> <input class="fm-field__input svelte-7izpdj" type="text"/></label> <label class="fm-field svelte-7izpdj"><span class="fm-field__label svelte-7izpdj">Description</span> <textarea class="fm-field__textarea svelte-7izpdj"></textarea></label> <label class="fm-field svelte-7izpdj"><span class="fm-field__label svelte-7izpdj">Slug</span> <input class="fm-field__input svelte-7izpdj" type="text" placeholder="auto-derived from filename"/></label> <div class="fm-editor__row svelte-7izpdj"><label class="fm-field svelte-7izpdj"><span class="fm-field__label svelte-7izpdj">Author</span> <input class="fm-field__input svelte-7izpdj" type="text"/></label> <label class="fm-field svelte-7izpdj"><span class="fm-field__label svelte-7izpdj">Date</span> <input class="fm-field__input svelte-7izpdj" type="date"/></label></div> <div class="fm-editor__row svelte-7izpdj"><label class="fm-field svelte-7izpdj"><span class="fm-field__label svelte-7izpdj">Order</span> <input class="fm-field__input svelte-7izpdj" type="number"/></label> <div class="fm-field svelte-7izpdj"><span class="fm-field__label svelte-7izpdj">Draft</span> <div role="switch" tabindex="0"><div class="fm-toggle__track svelte-7izpdj"><div class="fm-toggle__thumb svelte-7izpdj"></div></div> <span class="fm-toggle__label svelte-7izpdj"> </span></div></div></div> <div class="fm-field svelte-7izpdj"><span class="fm-field__label svelte-7izpdj">Tags</span> <!></div> <!> <div class="fm-editor__add-field svelte-7izpdj"><input class="fm-field__input svelte-7izpdj" type="text" placeholder="Field name"/> <button class="fm-editor__add-btn svelte-7izpdj">+ Add field</button></div></div>'),w5=W('<div><div class="fm-editor__header svelte-7izpdj" role="button" tabindex="0"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="6 4 10 8 6 12"></polyline></svg> <span class="fm-editor__label svelte-7izpdj">Frontmatter <!></span> <!></div> <div><div class="fm-editor__collapse-inner svelte-7izpdj"><div class="fm-editor__body svelte-7izpdj"><!></div></div></div></div>');function _5(n,e){dt(e,!0);let t=xt(e,"forceRawMode",3,!1);hn(()=>{t()&&(X.frontmatterRawMode=!0)});const r=new Set(["title","description","tags","draft","order","date","author","slug"]);let i=J(""),s=ge(()=>Object.entries(X.frontmatter).filter(([p])=>!r.has(p))),o=ge(()=>X.currentFileType==="layout"),a=ge(()=>X.frontmatter.title||""),l=ge(()=>()=>{const p=X.frontmatter.description||"";return p.length>60?p.slice(0,60)+"...":p});function c(p,v){X.updateFrontmatterField(p,v)}function u(){const p=g(i).trim();!p||p in X.frontmatter||(X.updateFrontmatterField(p,""),q(i,""))}function f(p){X.updateFrontmatterField(p,void 0)}var d=an(),h=tt(d);{var m=p=>{var v=w5();let O;var b=R(v);b.__click=()=>{X.frontmatterOpen=!X.frontmatterOpen},b.__keydown=I=>{(I.key==="Enter"||I.key===" ")&&(I.preventDefault(),X.frontmatterOpen=!X.frontmatterOpen)};var w=R(b);let S;var _=D(w,2),x=D(R(_));{var A=I=>{var Z=g5(),Y=R(Z),ne=D(Y);{var ae=K=>{var he=m5(),fe=R(he);ce(j=>Te(fe,`— ${j??""}`),[()=>g(l)()]),z(K,he)},ie=ge(()=>g(l)());le(ne,K=>{g(ie)&&K(ae)})}ce(()=>Te(Y,`${g(a)??""} `)),z(I,Z)};le(x,I=>{!X.frontmatterOpen&&g(a)&&I(A)})}var C=D(_,2);{var y=I=>{var Z=v5();Z.__click=K=>K.stopPropagation(),Z.__keydown=K=>K.stopPropagation();var Y=R(Z);let ne;Y.__click=()=>{X.frontmatterRawMode=!1};var ae=D(Y,2);let ie;ae.__click=()=>{X.frontmatterRawMode=!0},ce(()=>{ne=Be(Y,1,"fm-editor__mode-btn svelte-7izpdj",null,ne,{active:!X.frontmatterRawMode}),ie=Be(ae,1,"fm-editor__mode-btn svelte-7izpdj",null,ie,{active:X.frontmatterRawMode})}),z(I,Z)};le(C,I=>{X.frontmatterOpen&&!t()&&I(y)})}var k=D(b,2);let P;var T=R(k),E=R(T),Q=R(E);{var $=I=>{p5(I,{})},L=I=>{var Z=y5(),Y=R(Z),ne=D(R(Y),2);ne.__input=xe=>c("title",xe.target.value);var ae=D(Y,2),ie=D(R(ae),2);ie.__input=xe=>c("description",xe.target.value),St(ie,"rows",2);var K=D(ae,2),he=D(R(K),2);he.__input=xe=>c("slug",xe.target.value);var fe=D(K,2),j=R(fe),U=D(R(j),2);U.__input=xe=>c("author",xe.target.value);var ue=D(j,2),ke=D(R(ue),2);ke.__input=xe=>c("date",xe.target.value);var Ce=D(fe,2),ve=R(Ce),Ee=D(R(ve),2);Ee.__input=xe=>{const Wn=xe.target.value;c("order",Wn===""?void 0:Number(Wn))};var rt=D(ve,2),Ke=D(R(rt),2);let Ye;Ke.__click=()=>c("draft",X.frontmatter.draft===!0?void 0:!0),Ke.__keydown=xe=>{(xe.key==="Enter"||xe.key===" ")&&(xe.preventDefault(),c("draft",X.frontmatter.draft===!0?void 0:!0))};var Ve=D(R(Ke),2),ze=R(Ve),Bt=D(Ce,2),Nn=D(R(Bt),2);{let xe=ge(()=>X.frontmatter.tags??[]);Vk(Nn,{get tags(){return g(xe)},onchange:Wn=>c("tags",Wn)})}var Jn=D(Bt,2);{var bt=xe=>{var Wn=b5(),Lt=D(R(Wn),2);Ct(Lt,17,()=>g(s),Yt,(Jt,_n)=>{var se=ge(()=>Hc(g(_n),2));let Oe=()=>g(se)[0],_e=()=>g(se)[1];var Ae=O5(),Qe=R(Ae),yt=R(Qe),ct=D(Qe,2),Ue=R(ct);Ue.__input=pt=>c(Oe(),pt.target.value);var wt=D(Ue,2);wt.__click=()=>f(Oe()),ce(pt=>{Te(yt,Oe()),sn(Ue,pt),St(wt,"aria-label",`Remove ${Oe()??""}`)},[()=>String(_e()??"")]),z(Jt,Ae)}),z(xe,Wn)};le(Jn,xe=>{g(s).length>0&&xe(bt)})}var Wt=D(Jn,2),mn=R(Wt);mn.__keydown=xe=>{xe.key==="Enter"&&(xe.preventDefault(),u())};var Vn=D(mn,2);Vn.__click=u,ce(xe=>{sn(ne,X.frontmatter.title??""),sn(ie,X.frontmatter.description??""),sn(he,X.frontmatter.slug??""),sn(U,X.frontmatter.author??""),sn(ke,X.frontmatter.date??""),sn(Ee,X.frontmatter.order??""),Ye=Be(Ke,1,"fm-toggle svelte-7izpdj",null,Ye,{active:X.frontmatter.draft===!0}),St(Ke,"aria-checked",X.frontmatter.draft===!0),Te(ze,X.frontmatter.draft===!0?"Draft":"Published"),Vn.disabled=xe},[()=>!g(i).trim()]),Qn(mn,()=>g(i),xe=>q(i,xe)),z(I,Z)};le(Q,I=>{X.frontmatterRawMode?I($):I(L,!1)})}ce(()=>{O=Be(v,1,"fm-editor svelte-7izpdj",null,O,{"fm-editor--layout":g(o)}),S=Be(w,0,"fm-editor__chevron svelte-7izpdj",null,S,{collapsed:!X.frontmatterOpen}),P=Be(k,1,"fm-editor__collapse svelte-7izpdj",null,P,{open:X.frontmatterOpen})}),z(p,v)};le(h,p=>{X.currentPath&&p(m)})}z(n,d),ht()}Vt(["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2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<n.length;e++)(e%2?Wk:gm).push(t=t+n[e])})();function k5(n){if(n<768)return!1;for(let e=0,t=gm.length;;){let r=e+t>>1;if(n<gm[r])t=r;else if(n>=Wk[r])e=r+1;else return!0;if(e==t)return!1}}function Jb(n){return n>=127462&&n<=127487}const ey=8205;function x5(n,e,t=!0,r=!0){return(t?Yk:S5)(n,e,r)}function Yk(n,e,t){if(e==n.length)return e;e&&Uk(n.charCodeAt(e))&&Gk(n.charCodeAt(e-1))&&e--;let r=Dh(n,e);for(e+=ty(r);e<n.length;){let i=Dh(n,e);if(r==ey||i==ey||t&&k5(i))e+=ty(i),r=i;else if(Jb(i)){let s=0,o=e-2;for(;o>=0&&Jb(Dh(n,o));)s++,o-=2;if(s%2==0)break;e+=2}else break}return e}function S5(n,e,t){for(;e>0;){let r=Yk(n,e-2,t);if(r<e)return r;e--}return 0}function Dh(n,e){let t=n.charCodeAt(e);if(!Gk(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return Uk(r)?(t-55296<<10)+(r-56320)+65536:t}function Uk(n){return n>=56320&&n<57344}function Gk(n){return n>=55296&&n<56320}function ty(n){return n<65536?1:2}let Nt=class Hk{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,r){[e,t]=Ua(this,e,t);let i=[];return this.decompose(0,e,i,2),r.length&&r.decompose(0,r.length,i,3),this.decompose(t,this.length,i,1),Fi.from(i,this.length-(t-e)+r.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=Ua(this,e,t);let r=[];return this.decompose(e,t,r,0),Fi.from(r,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),r=this.length-this.scanIdentical(e,-1),i=new sc(this),s=new sc(e);for(let o=t,a=t;;){if(i.next(o),s.next(o),o=0,i.lineBreak!=s.lineBreak||i.done!=s.done||i.value!=s.value)return!1;if(a+=i.value.length,i.done||a>=r)return!0}}iter(e=1){return new sc(this,e)}iterRange(e,t=this.length){return new Kk(this,e,t)}iterLines(e,t){let r;if(e==null)r=this.iter();else{t==null&&(t=this.lines+1);let i=this.line(e).from;r=this.iterRange(i,Math.max(i,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Jk(r)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?Hk.empty:e.length<=32?new An(e):Fi.from(An.split(e,[]))}};class An extends Nt{constructor(e,t=A5(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.text[s],a=i+o.length;if((t?r:a)>=e)return new C5(i,a,r,o);i=a+1,r++}}decompose(e,t,r,i){let s=e<=0&&t>=this.length?this:new An(ny(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(i&1){let o=r.pop(),a=mf(s.text,o.text.slice(),0,s.length);if(a.length<=32)r.push(new An(a,o.length+s.length));else{let l=a.length>>1;r.push(new An(a.slice(0,l)),new An(a.slice(l)))}}else r.push(s)}replace(e,t,r){if(!(r instanceof An))return super.replace(e,t,r);[e,t]=Ua(this,e,t);let i=mf(this.text,mf(r.text,ny(this.text,0,e)),t),s=this.length+r.length-(t-e);return i.length<=32?new An(i,s):Fi.from(An.split(i,[]),s)}sliceString(e,t=this.length,r=`
|
|
145
|
-
`){[e,t]=Ua(this,e,t);let i="";for(let s=0,o=0;s<=t&&o<this.text.length;o++){let a=this.text[o],l=s+a.length;s>e&&o&&(i+=r),e<l&&t>s&&(i+=a.slice(Math.max(0,e-s),t-s)),s=l+1}return i}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let r=[],i=-1;for(let s of e)r.push(s),i+=s.length+1,r.length==32&&(t.push(new An(r,i)),r=[],i=-1);return i>-1&&t.push(new An(r,i)),t}}class Fi extends Nt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let r of e)this.lines+=r.lines}lineInner(e,t,r,i){for(let s=0;;s++){let o=this.children[s],a=i+o.length,l=r+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,r,i);i=a+1,r=l+1}}decompose(e,t,r,i){for(let s=0,o=0;o<=t&&s<this.children.length;s++){let a=this.children[s],l=o+a.length;if(e<=l&&t>=o){let c=i&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!c?r.push(a):a.decompose(e-o,t-o,r,c)}o=l+1}}replace(e,t,r){if([e,t]=Ua(this,e,t),r.lines<this.lines)for(let i=0,s=0;i<this.children.length;i++){let o=this.children[i],a=s+o.length;if(e>=s&&t<=a){let l=o.replace(e-s,t-s,r),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[i]=l,new Fi(u,this.length-(t-e)+r.length)}return super.replace(s,a,l)}s=a+1}return super.replace(e,t,r)}sliceString(e,t=this.length,r=`
|
|
146
|
-
`){[e,t]=Ua(this,e,t);let i="";for(let s=0,o=0;s<this.children.length&&o<=t;s++){let a=this.children[s],l=o+a.length;o>e&&s&&(i+=r),e<l&&t>o&&(i+=a.sliceString(e-o,t-o,r)),o=l+1}return i}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof Fi))return 0;let r=0,[i,s,o,a]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;i+=t,s+=t){if(i==o||s==a)return r;let l=this.children[i],c=e.children[s];if(l!=c)return r+l.scanIdentical(c,t);r+=l.length+1}}static from(e,t=e.reduce((r,i)=>r+i.length+1,-1)){let r=0;for(let h of e)r+=h.lines;if(r<32){let h=[];for(let m of e)m.flatten(h);return new An(h,t)}let i=Math.max(32,r>>5),s=i<<1,o=i>>1,a=[],l=0,c=-1,u=[];function f(h){let m;if(h.lines>s&&h instanceof Fi)for(let p of h.children)f(p);else h.lines>o&&(l>o||!l)?(d(),a.push(h)):h instanceof An&&l&&(m=u[u.length-1])instanceof An&&h.lines+m.lines<=32?(l+=h.lines,c+=h.length+1,u[u.length-1]=new An(m.text.concat(h.text),m.length+1+h.length)):(l+h.lines>i&&d(),l+=h.lines,c+=h.length+1,u.push(h))}function d(){l!=0&&(a.push(u.length==1?u[0]:Fi.from(u,c)),c=-1,l=u.length=0)}for(let h of e)f(h);return d(),a.length==1?a[0]:new Fi(a,t)}}Nt.empty=new An([""],0);function A5(n){let e=-1;for(let t of n)e+=t.length+1;return e}function mf(n,e,t=0,r=1e9){for(let i=0,s=0,o=!0;s<n.length&&i<=r;s++){let a=n[s],l=i+a.length;l>=t&&(l>r&&(a=a.slice(0,r-i)),i<t&&(a=a.slice(t-i)),o?(e[e.length-1]+=a,o=!1):e.push(a)),i=l+1}return e}function ny(n,e,t){return mf(n,[""],e,t)}class sc{constructor(e,t=1){this.dir=t,this.done=!1,this.lineBreak=!1,this.value="",this.nodes=[e],this.offsets=[t>0?1:(e instanceof An?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let r=this.nodes.length-1,i=this.nodes[r],s=this.offsets[r],o=s>>1,a=i instanceof An?i.text.length:i.children.length;if(o==(t>0?a:0)){if(r==0)return this.done=!0,this.value="",this;t>0&&this.offsets[r-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[r]+=t,e==0)return this.lineBreak=!0,this.value=`
|
|
147
|
-
`,this;e--}else if(i instanceof An){let l=i.text[o+(t<0?-1:0)];if(this.offsets[r]+=t,l.length>Math.max(0,e))return this.value=e==0?l:t>0?l.slice(e):l.slice(0,l.length-e),this;e-=l.length}else{let l=i.children[o+(t<0?-1:0)];e>l.length?(e-=l.length,this.offsets[r]+=t):(t<0&&this.offsets[r]--,this.nodes.push(l),this.offsets.push(t>0?1:(l instanceof An?l.text.length:l.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class Kk{constructor(e,t,r){this.value="",this.done=!1,this.cursor=new sc(e,t>r?-1:1),this.pos=t>r?e.length:0,this.from=Math.min(t,r),this.to=Math.max(t,r)}nextInner(e,t){if(t<0?this.pos<=this.from:this.pos>=this.to)return this.value="",this.done=!0,this;e+=Math.max(0,t<0?this.pos-this.to:this.from-this.pos);let r=t<0?this.pos-this.from:this.to-this.pos;e>r&&(e=r),r-=e;let{value:i}=this.cursor.next(e);return this.pos+=(i.length+e)*t,this.value=i.length<=r?i:t<0?i.slice(i.length-r):i.slice(0,r),this.done=!this.value,this}next(e=0){return e<0?e=Math.max(e,this.from-this.pos):e>0&&(e=Math.min(e,this.to-this.pos)),this.nextInner(e,this.cursor.dir)}get lineBreak(){return this.cursor.lineBreak&&this.value!=""}}class Jk{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:r,value:i}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):r?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=i,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(Nt.prototype[Symbol.iterator]=function(){return this.iter()},sc.prototype[Symbol.iterator]=Kk.prototype[Symbol.iterator]=Jk.prototype[Symbol.iterator]=function(){return this});let C5=class{constructor(e,t,r,i){this.from=e,this.to=t,this.number=r,this.text=i}get length(){return this.to-this.from}};function Ua(n,e,t){return e=Math.max(0,Math.min(n.length,e)),[e,Math.max(e,Math.min(n.length,t))]}function Fn(n,e,t=!0,r=!0){return x5(n,e,t,r)}function T5(n){return n>=56320&&n<57344}function P5(n){return n>=55296&&n<56320}function Ns(n,e){let t=n.charCodeAt(e);if(!P5(t)||e+1==n.length)return t;let r=n.charCodeAt(e+1);return T5(r)?(t-55296<<10)+(r-56320)+65536:t}function e2(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function ko(n){return n<65536?1:2}const vm=/\r\n?|\n/;var fr=(function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n})(fr||(fr={}));class Hi{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;t<this.sections.length;t+=2)e+=this.sections[t];return e}get newLength(){let e=0;for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t+1];e+=r<0?this.sections[t]:r}return e}get empty(){return this.sections.length==0||this.sections.length==2&&this.sections[1]<0}iterGaps(e){for(let t=0,r=0,i=0;t<this.sections.length;){let s=this.sections[t++],o=this.sections[t++];o<0?(e(r,i,s),i+=s):i+=o,r+=s}}iterChangedRanges(e,t=!1){Om(this,e,t)}get invertedDesc(){let e=[];for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];i<0?e.push(r,i):e.push(i,r)}return new Hi(e)}composeDesc(e){return this.empty?e:e.empty?this:t2(this,e)}mapDesc(e,t=!1){return e.empty?this:bm(this,e,t)}mapPos(e,t=-1,r=fr.Simple){let i=0,s=0;for(let o=0;o<this.sections.length;){let a=this.sections[o++],l=this.sections[o++],c=i+a;if(l<0){if(c>e)return s+(e-i);s+=a}else{if(r!=fr.Simple&&c>=e&&(r==fr.TrackDel&&i<e&&c>e||r==fr.TrackBefore&&i<e||r==fr.TrackAfter&&c>e))return null;if(c>e||c==e&&t<0&&!a)return e==i||t<0?s:s+l;s+=l}i=c}if(e>i)throw new RangeError(`Position ${e} is out of range for changeset of length ${i}`);return s}touchesRange(e,t=e){for(let r=0,i=0;r<this.sections.length&&i<=t;){let s=this.sections[r++],o=this.sections[r++],a=i+s;if(o>=0&&i<=t&&a>=e)return i<e&&a>t?"cover":!0;i=a}return!1}toString(){let e="";for(let t=0;t<this.sections.length;){let r=this.sections[t++],i=this.sections[t++];e+=(e?" ":"")+r+(i>=0?":"+i:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some(t=>typeof t!="number"))throw new RangeError("Invalid JSON representation of ChangeDesc");return new Hi(e)}static create(e){return new Hi(e)}}class Dn extends Hi{constructor(e,t){super(e),this.inserted=t}apply(e){if(this.length!=e.length)throw new RangeError("Applying change set to a document with the wrong length");return Om(this,(t,r,i,s,o)=>e=e.replace(i,i+(r-t),o),!1),e}mapDesc(e,t=!1){return bm(this,e,t,!0)}invert(e){let t=this.sections.slice(),r=[];for(let i=0,s=0;i<t.length;i+=2){let o=t[i],a=t[i+1];if(a>=0){t[i]=a,t[i+1]=o;let l=i>>1;for(;r.length<l;)r.push(Nt.empty);r.push(o?e.slice(s,s+o):Nt.empty)}s+=o}return new Dn(t,r)}compose(e){return this.empty?e:e.empty?this:t2(this,e,!0)}map(e,t=!1){return e.empty?this:bm(this,e,t,!0)}iterChanges(e,t=!1){Om(this,e,t)}get desc(){return Hi.create(this.sections)}filter(e){let t=[],r=[],i=[],s=new yc(this);e:for(let o=0,a=0;;){let l=o==e.length?1e9:e[o++];for(;a<l||a==l&&s.len==0;){if(s.done)break e;let u=Math.min(s.len,l-a);rr(i,u,-1);let f=s.ins==-1?-1:s.off==0?s.ins:0;rr(t,u,f),f>0&&Fs(r,t,s.text),s.forward(u),a+=u}let c=e[o++];for(;a<c;){if(s.done)break e;let u=Math.min(s.len,c-a);rr(t,u,-1),rr(i,u,s.ins==-1?-1:s.off==0?s.ins:0),s.forward(u),a+=u}}return{changes:new Dn(t,r),filtered:Hi.create(i)}}toJSON(){let e=[];for(let t=0;t<this.sections.length;t+=2){let r=this.sections[t],i=this.sections[t+1];i<0?e.push(r):i==0?e.push([r]):e.push([r].concat(this.inserted[t>>1].toJSON()))}return e}static of(e,t,r){let i=[],s=[],o=0,a=null;function l(u=!1){if(!u&&!i.length)return;o<t&&rr(i,t-o,-1);let f=new Dn(i,s);a=a?a.compose(f.map(a)):f,i=[],s=[],o=0}function c(u){if(Array.isArray(u))for(let f of u)c(f);else if(u instanceof Dn){if(u.length!=t)throw new RangeError(`Mismatched change set length (got ${u.length}, expected ${t})`);l(),a=a?a.compose(u.map(a)):u}else{let{from:f,to:d=f,insert:h}=u;if(f>d||f<0||d>t)throw new RangeError(`Invalid change range ${f} to ${d} (in doc of length ${t})`);let m=h?typeof h=="string"?Nt.of(h.split(r||vm)):h:Nt.empty,p=m.length;if(f==d&&p==0)return;f<o&&l(),f>o&&rr(i,f-o,-1),rr(i,d-f,p),Fs(s,i,m),o=d}}return c(e),l(!a),a}static empty(e){return new Dn(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],r=[];for(let i=0;i<e.length;i++){let s=e[i];if(typeof s=="number")t.push(s,-1);else{if(!Array.isArray(s)||typeof s[0]!="number"||s.some((o,a)=>a&&typeof o!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;r.length<i;)r.push(Nt.empty);r[i]=Nt.of(s.slice(1)),t.push(s[0],r[i].length)}}}return new Dn(t,r)}static createSet(e,t){return new Dn(e,t)}}function rr(n,e,t,r=!1){if(e==0&&t<=0)return;let i=n.length-2;i>=0&&t<=0&&t==n[i+1]?n[i]+=e:i>=0&&e==0&&n[i]==0?n[i+1]+=t:r?(n[i]+=e,n[i+1]+=t):n.push(e,t)}function Fs(n,e,t){if(t.length==0)return;let r=e.length-2>>1;if(r<n.length)n[n.length-1]=n[n.length-1].append(t);else{for(;n.length<r;)n.push(Nt.empty);n.push(t)}}function Om(n,e,t){let r=n.inserted;for(let i=0,s=0,o=0;o<n.sections.length;){let a=n.sections[o++],l=n.sections[o++];if(l<0)i+=a,s+=a;else{let c=i,u=s,f=Nt.empty;for(;c+=a,u+=l,l&&r&&(f=f.append(r[o-2>>1])),!(t||o==n.sections.length||n.sections[o+1]<0);)a=n.sections[o++],l=n.sections[o++];e(i,c,s,u,f),i=c,s=u}}}function bm(n,e,t,r=!1){let i=[],s=r?[]:null,o=new yc(n),a=new yc(e);for(let l=-1;;){if(o.done&&a.len||a.done&&o.len)throw new Error("Mismatched change set lengths");if(o.ins==-1&&a.ins==-1){let c=Math.min(o.len,a.len);rr(i,c,-1),o.forward(c),a.forward(c)}else if(a.ins>=0&&(o.ins<0||l==o.i||o.off==0&&(a.len<o.len||a.len==o.len&&!t))){let c=a.len;for(rr(i,a.ins,-1);c;){let u=Math.min(o.len,c);o.ins>=0&&l<o.i&&o.len<=u&&(rr(i,0,o.ins),s&&Fs(s,i,o.text),l=o.i),o.forward(u),c-=u}a.next()}else if(o.ins>=0){let c=0,u=o.len;for(;u;)if(a.ins==-1){let f=Math.min(u,a.len);c+=f,u-=f,a.forward(f)}else if(a.ins==0&&a.len<u)u-=a.len,a.next();else break;rr(i,c,l<o.i?o.ins:0),s&&l<o.i&&Fs(s,i,o.text),l=o.i,o.forward(o.len-u)}else{if(o.done&&a.done)return s?Dn.createSet(i,s):Hi.create(i);throw new Error("Mismatched change set lengths")}}}function t2(n,e,t=!1){let r=[],i=t?[]:null,s=new yc(n),o=new yc(e);for(let a=!1;;){if(s.done&&o.done)return i?Dn.createSet(r,i):Hi.create(r);if(s.ins==0)rr(r,s.len,0,a),s.next();else if(o.len==0&&!o.done)rr(r,0,o.ins,a),i&&Fs(i,r,o.text),o.next();else{if(s.done||o.done)throw new Error("Mismatched change set lengths");{let l=Math.min(s.len2,o.len),c=r.length;if(s.ins==-1){let u=o.ins==-1?-1:o.off?0:o.ins;rr(r,l,u,a),i&&u&&Fs(i,r,o.text)}else o.ins==-1?(rr(r,s.off?0:s.len,l,a),i&&Fs(i,r,s.textBit(l))):(rr(r,s.off?0:s.len,o.off?0:o.ins,a),i&&!o.off&&Fs(i,r,o.text));a=(s.ins>l||o.ins>=0&&o.len>l)&&(a||r.length>c),s.forward2(l),o.forward(l)}}}}class yc{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i<e.length?(this.len=e[this.i++],this.ins=e[this.i++]):(this.len=0,this.ins=-2),this.off=0}get done(){return this.ins==-2}get len2(){return this.ins<0?this.len:this.ins}get text(){let{inserted:e}=this.set,t=this.i-2>>1;return t>=e.length?Nt.empty:e[t]}textBit(e){let{inserted:t}=this.set,r=this.i-2>>1;return r>=t.length&&!e?Nt.empty:t[r].slice(this.off,e==null?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){this.ins==-1?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class $o{constructor(e,t,r){this.from=e,this.to=t,this.flags=r}get anchor(){return this.flags&32?this.to:this.from}get head(){return this.flags&32?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return this.flags&8?-1:this.flags&16?1:0}get bidiLevel(){let e=this.flags&7;return e==7?null:e}get goalColumn(){let e=this.flags>>6;return e==16777215?void 0:e}map(e,t=-1){let r,i;return this.empty?r=i=e.mapPos(this.from,t):(r=e.mapPos(this.from,1),i=e.mapPos(this.to,-1)),r==this.from&&i==this.to?this:new $o(r,i,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return me.range(e,t);let r=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return me.range(this.anchor,r)}eq(e,t=!1){return this.anchor==e.anchor&&this.head==e.head&&this.goalColumn==e.goalColumn&&(!t||!this.empty||this.assoc==e.assoc)}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||typeof e.anchor!="number"||typeof e.head!="number")throw new RangeError("Invalid JSON representation for SelectionRange");return me.range(e.anchor,e.head)}static create(e,t,r){return new $o(e,t,r)}}class me{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:me.create(this.ranges.map(r=>r.map(e,t)),this.mainIndex)}eq(e,t=!1){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let r=0;r<this.ranges.length;r++)if(!this.ranges[r].eq(e.ranges[r],t))return!1;return!0}get main(){return this.ranges[this.mainIndex]}asSingle(){return this.ranges.length==1?this:new me([this.main],0)}addRange(e,t=!0){return me.create([e].concat(this.ranges),t?0:this.mainIndex+1)}replaceRange(e,t=this.mainIndex){let r=this.ranges.slice();return r[t]=e,me.create(r,this.mainIndex)}toJSON(){return{ranges:this.ranges.map(e=>e.toJSON()),main:this.mainIndex}}static fromJSON(e){if(!e||!Array.isArray(e.ranges)||typeof e.main!="number"||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new me(e.ranges.map(t=>$o.fromJSON(t)),e.main)}static single(e,t=e){return new me([me.range(e,t)],0)}static create(e,t=0){if(e.length==0)throw new RangeError("A selection needs at least one range");for(let r=0,i=0;i<e.length;i++){let s=e[i];if(s.empty?s.from<=r:s.from<r)return me.normalized(e.slice(),t);r=s.to}return new me(e,t)}static cursor(e,t=0,r,i){return $o.create(e,e,(t==0?0:t<0?8:16)|(r==null?7:Math.min(6,r))|(i??16777215)<<6)}static range(e,t,r,i){let s=(r??16777215)<<6|(i==null?7:Math.min(6,i));return t<e?$o.create(t,e,48|s):$o.create(e,t,(t>e?8:0)|s)}static normalized(e,t=0){let r=e[t];e.sort((i,s)=>i.from-s.from),t=e.indexOf(r);for(let i=1;i<e.length;i++){let s=e[i],o=e[i-1];if(s.empty?s.from<=o.to:s.from<o.to){let a=o.from,l=Math.max(s.to,o.to);i<=t&&t--,e.splice(--i,2,s.anchor>s.head?me.range(l,a):me.range(a,l))}}return new me(e,t)}}function n2(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let Iv=0;class Ie{constructor(e,t,r,i,s){this.combine=e,this.compareInput=t,this.compare=r,this.isStatic=i,this.id=Iv++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new Ie(e.combine||(t=>t),e.compareInput||((t,r)=>t===r),e.compare||(e.combine?(t,r)=>t===r:Nv),!!e.static,e.enables)}of(e){return new gf([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new gf(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new gf(e,this,2,t)}from(e,t){return t||(t=r=>r),this.compute([e],r=>t(r.field(e)))}}function Nv(n,e){return n==e||n.length==e.length&&n.every((t,r)=>t===e[r])}class gf{constructor(e,t,r,i){this.dependencies=e,this.facet=t,this.type=r,this.value=i,this.id=Iv++}dynamicSlot(e){var t;let r=this.value,i=this.facet.compareInput,s=this.id,o=e[s]>>1,a=this.type==2,l=!1,c=!1,u=[];for(let f of this.dependencies)f=="doc"?l=!0:f=="selection"?c=!0:(((t=e[f.id])!==null&&t!==void 0?t:1)&1)==0&&u.push(e[f.id]);return{create(f){return f.values[o]=r(f),1},update(f,d){if(l&&d.docChanged||c&&(d.docChanged||d.selection)||ym(f,u)){let h=r(f);if(a?!ry(h,f.values[o],i):!i(h,f.values[o]))return f.values[o]=h,1}return 0},reconfigure:(f,d)=>{let h,m=d.config.address[s];if(m!=null){let p=jf(d,m);if(this.dependencies.every(v=>v instanceof Ie?d.facet(v)===f.facet(v):v instanceof ui?d.field(v,!1)==f.field(v,!1):!0)||(a?ry(h=r(f),p,i):i(h=r(f),p)))return f.values[o]=p,0}else h=r(f);return f.values[o]=h,1}}}}function ry(n,e,t){if(n.length!=e.length)return!1;for(let r=0;r<n.length;r++)if(!t(n[r],e[r]))return!1;return!0}function ym(n,e){let t=!1;for(let r of e)oc(n,r)&1&&(t=!0);return t}function E5(n,e,t){let r=t.map(l=>n[l.id]),i=t.map(l=>l.type),s=r.filter(l=>!(l&1)),o=n[e.id]>>1;function a(l){let c=[];for(let u=0;u<r.length;u++){let f=jf(l,r[u]);if(i[u]==2)for(let d of f)c.push(d);else c.push(f)}return e.combine(c)}return{create(l){for(let c of r)oc(l,c);return l.values[o]=a(l),1},update(l,c){if(!ym(l,s))return 0;let u=a(l);return e.compare(u,l.values[o])?0:(l.values[o]=u,1)},reconfigure(l,c){let u=ym(l,r),f=c.config.facets[e.id],d=c.facet(e);if(f&&!u&&Nv(t,f))return l.values[o]=d,0;let h=a(l);return e.compare(h,d)?(l.values[o]=d,0):(l.values[o]=h,1)}}}const ku=Ie.define({static:!0});class ui{constructor(e,t,r,i,s){this.id=e,this.createF=t,this.updateF=r,this.compareF=i,this.spec=s,this.provides=void 0}static define(e){let t=new ui(Iv++,e.create,e.update,e.compare||((r,i)=>r===i),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(ku).find(r=>r.field==this);return(t?.create||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:r=>(r.values[t]=this.create(r),1),update:(r,i)=>{let s=r.values[t],o=this.updateF(s,i);return this.compareF(s,o)?0:(r.values[t]=o,1)},reconfigure:(r,i)=>{let s=r.facet(ku),o=i.facet(ku),a;return(a=s.find(l=>l.field==this))&&a!=o.find(l=>l.field==this)?(r.values[t]=a.create(r),1):i.config.address[this.id]!=null?(r.values[t]=i.field(this),0):(r.values[t]=this.create(r),1)}}}init(e){return[this,ku.of({field:this,create:e})]}get extension(){return this}}const xo={lowest:4,low:3,default:2,high:1,highest:0};function Tl(n){return e=>new r2(e,n)}const co={highest:Tl(xo.highest),high:Tl(xo.high),default:Tl(xo.default),low:Tl(xo.low),lowest:Tl(xo.lowest)};class r2{constructor(e,t){this.inner=e,this.prec=t}}class ws{of(e){return new wm(this,e)}reconfigure(e){return ws.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class wm{constructor(e,t){this.compartment=e,this.inner=t}}class Bf{constructor(e,t,r,i,s,o){for(this.base=e,this.compartments=t,this.dynamicSlots=r,this.address=i,this.staticValues=s,this.facets=o,this.statusTemplate=[];this.statusTemplate.length<r.length;)this.statusTemplate.push(0)}staticFacet(e){let t=this.address[e.id];return t==null?e.default:this.staticValues[t>>1]}static resolve(e,t,r){let i=[],s=Object.create(null),o=new Map;for(let d of $5(e,t,o))d instanceof ui?i.push(d):(s[d.facet.id]||(s[d.facet.id]=[])).push(d);let a=Object.create(null),l=[],c=[];for(let d of i)a[d.id]=c.length<<1,c.push(h=>d.slot(h));let u=r?.config.facets;for(let d in s){let h=s[d],m=h[0].facet,p=u&&u[d]||[];if(h.every(v=>v.type==0))if(a[m.id]=l.length<<1|1,Nv(p,h))l.push(r.facet(m));else{let v=m.combine(h.map(O=>O.value));l.push(r&&m.compare(v,r.facet(m))?r.facet(m):v)}else{for(let v of h)v.type==0?(a[v.id]=l.length<<1|1,l.push(v.value)):(a[v.id]=c.length<<1,c.push(O=>v.dynamicSlot(O)));a[m.id]=c.length<<1,c.push(v=>E5(v,m,h))}}let f=c.map(d=>d(a));return new Bf(e,o,f,a,l,s)}}function $5(n,e,t){let r=[[],[],[],[],[]],i=new Map;function s(o,a){let l=i.get(o);if(l!=null){if(l<=a)return;let c=r[l].indexOf(o);c>-1&&r[l].splice(c,1),o instanceof wm&&t.delete(o.compartment)}if(i.set(o,a),Array.isArray(o))for(let c of o)s(c,a);else if(o instanceof wm){if(t.has(o.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(o.compartment)||o.inner;t.set(o.compartment,c),s(c,a)}else if(o instanceof r2)s(o.inner,o.prec);else if(o instanceof ui)r[a].push(o),o.provides&&s(o.provides,a);else if(o instanceof gf)r[a].push(o),o.facet.extensions&&s(o.facet.extensions,xo.default);else{let c=o.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${o}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,a)}}return s(n,xo.default),r.reduce((o,a)=>o.concat(a))}function oc(n,e){if(e&1)return 2;let t=e>>1,r=n.status[t];if(r==4)throw new Error("Cyclic dependency between fields and/or facets");if(r&2)return r;n.status[t]=4;let i=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|i}function jf(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const i2=Ie.define(),_m=Ie.define({combine:n=>n.some(e=>e),static:!0}),s2=Ie.define({combine:n=>n.length?n[0]:void 0,static:!0}),o2=Ie.define(),a2=Ie.define(),l2=Ie.define(),c2=Ie.define({combine:n=>n.length?n[0]:!1});class Es{constructor(e,t){this.type=e,this.value=t}static define(){return new Q5}}class Q5{of(e){return new Es(this,e)}}class L5{constructor(e){this.map=e}of(e){return new Qt(this,e)}}class Qt{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return t===void 0?void 0:t==this.value?this:new Qt(this.type,t)}is(e){return this.type==e}static define(e={}){return new L5(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let r=[];for(let i of e){let s=i.map(t);s&&r.push(s)}return r}}Qt.reconfigure=Qt.define();Qt.appendConfig=Qt.define();class En{constructor(e,t,r,i,s,o){this.startState=e,this.changes=t,this.selection=r,this.effects=i,this.annotations=s,this.scrollIntoView=o,this._doc=null,this._state=null,r&&n2(r,t.newLength),s.some(a=>a.type==En.time)||(this.annotations=s.concat(En.time.of(Date.now())))}static create(e,t,r,i,s,o){return new En(e,t,r,i,s,o)}get newDoc(){return this._doc||(this._doc=this.changes.apply(this.startState.doc))}get newSelection(){return this.selection||this.startState.selection.map(this.changes)}get state(){return this._state||this.startState.applyTransaction(this),this._state}annotation(e){for(let t of this.annotations)if(t.type==e)return t.value}get docChanged(){return!this.changes.empty}get reconfigured(){return this.startState.config!=this.state.config}isUserEvent(e){let t=this.annotation(En.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}En.time=Es.define();En.userEvent=Es.define();En.addToHistory=Es.define();En.remote=Es.define();function M5(n,e){let t=[];for(let r=0,i=0;;){let s,o;if(r<n.length&&(i==e.length||e[i]>=n[r]))s=n[r++],o=n[r++];else if(i<e.length)s=e[i++],o=e[i++];else return t;!t.length||t[t.length-1]<s?t.push(s,o):t[t.length-1]<o&&(t[t.length-1]=o)}}function u2(n,e,t){var r;let i,s,o;return t?(i=e.changes,s=Dn.empty(e.changes.length),o=n.changes.compose(e.changes)):(i=e.changes.map(n.changes),s=n.changes.mapDesc(e.changes,!0),o=n.changes.compose(i)),{changes:o,selection:e.selection?e.selection.map(s):(r=n.selection)===null||r===void 0?void 0:r.map(i),effects:Qt.mapEffects(n.effects,i).concat(Qt.mapEffects(e.effects,s)),annotations:n.annotations.length?n.annotations.concat(e.annotations):e.annotations,scrollIntoView:n.scrollIntoView||e.scrollIntoView}}function km(n,e,t){let r=e.selection,i=Ma(e.annotations);return e.userEvent&&(i=i.concat(En.userEvent.of(e.userEvent))),{changes:e.changes instanceof Dn?e.changes:Dn.of(e.changes||[],t,n.facet(s2)),selection:r&&(r instanceof me?r:me.single(r.anchor,r.head)),effects:Ma(e.effects),annotations:i,scrollIntoView:!!e.scrollIntoView}}function f2(n,e,t){let r=km(n,e.length?e[0]:{},n.doc.length);e.length&&e[0].filter===!1&&(t=!1);for(let s=1;s<e.length;s++){e[s].filter===!1&&(t=!1);let o=!!e[s].sequential;r=u2(r,km(n,e[s],o?r.changes.newLength:n.doc.length),o)}let i=En.create(n,r.changes,r.selection,r.effects,r.annotations,r.scrollIntoView);return R5(t?q5(i):i)}function q5(n){let e=n.startState,t=!0;for(let i of e.facet(o2)){let s=i(n);if(s===!1){t=!1;break}Array.isArray(s)&&(t=t===!0?s:M5(t,s))}if(t!==!0){let i,s;if(t===!1)s=n.changes.invertedDesc,i=Dn.empty(e.doc.length);else{let o=n.changes.filter(t);i=o.changes,s=o.filtered.mapDesc(o.changes).invertedDesc}n=En.create(e,i,n.selection&&n.selection.map(s),Qt.mapEffects(n.effects,s),n.annotations,n.scrollIntoView)}let r=e.facet(a2);for(let i=r.length-1;i>=0;i--){let s=r[i](n);s instanceof En?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof En?n=s[0]:n=f2(e,Ma(s),!1)}return n}function R5(n){let e=n.startState,t=e.facet(l2),r=n;for(let i=t.length-1;i>=0;i--){let s=t[i](n);s&&Object.keys(s).length&&(r=u2(r,km(e,s,n.changes.newLength),!0))}return r==n?n:En.create(e,n.changes,n.selection,r.effects,r.annotations,r.scrollIntoView)}const D5=[];function Ma(n){return n==null?D5:Array.isArray(n)?n:[n]}var Tn=(function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n})(Tn||(Tn={}));const I5=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let xm;try{xm=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function N5(n){if(xm)return xm.test(n);for(let e=0;e<n.length;e++){let t=n[e];if(/\w/.test(t)||t>""&&(t.toUpperCase()!=t.toLowerCase()||I5.test(t)))return!0}return!1}function B5(n){return e=>{if(!/\S/.test(e))return Tn.Space;if(N5(e))return Tn.Word;for(let t=0;t<n.length;t++)if(e.indexOf(n[t])>-1)return Tn.Word;return Tn.Other}}class Pt{constructor(e,t,r,i,s,o){this.config=e,this.doc=t,this.selection=r,this.values=i,this.status=e.statusTemplate.slice(),this.computeSlot=s,o&&(o._state=this);for(let a=0;a<this.config.dynamicSlots.length;a++)oc(this,a<<1);this.computeSlot=null}field(e,t=!0){let r=this.config.address[e.id];if(r==null){if(t)throw new RangeError("Field is not present in this state");return}return oc(this,r),jf(this,r)}update(...e){return f2(this,e,!0)}applyTransaction(e){let t=this.config,{base:r,compartments:i}=t;for(let a of e.effects)a.is(ws.reconfigure)?(t&&(i=new Map,t.compartments.forEach((l,c)=>i.set(c,l)),t=null),i.set(a.value.compartment,a.value.extension)):a.is(Qt.reconfigure)?(t=null,r=a.value):a.is(Qt.appendConfig)&&(t=null,r=Ma(r).concat(a.value));let s;t?s=e.startState.values.slice():(t=Bf.resolve(r,i,this),s=new Pt(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(l,c)=>c.reconfigure(l,this),null).values);let o=e.startState.facet(_m)?e.newSelection:e.newSelection.asSingle();new Pt(t,e.newDoc,o,s,(a,l)=>l.update(a,e),e)}replaceSelection(e){return typeof e=="string"&&(e=this.toText(e)),this.changeByRange(t=>({changes:{from:t.from,to:t.to,insert:e},range:me.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,r=e(t.ranges[0]),i=this.changes(r.changes),s=[r.range],o=Ma(r.effects);for(let a=1;a<t.ranges.length;a++){let l=e(t.ranges[a]),c=this.changes(l.changes),u=c.map(i);for(let d=0;d<a;d++)s[d]=s[d].map(u);let f=i.mapDesc(c,!0);s.push(l.range.map(f)),i=i.compose(u),o=Qt.mapEffects(o,u).concat(Qt.mapEffects(Ma(l.effects),f))}return{changes:i,selection:me.create(s,t.mainIndex),effects:o}}changes(e=[]){return e instanceof Dn?e:Dn.of(e,this.doc.length,this.facet(Pt.lineSeparator))}toText(e){return Nt.of(e.split(this.facet(Pt.lineSeparator)||vm))}sliceDoc(e=0,t=this.doc.length){return this.doc.sliceString(e,t,this.lineBreak)}facet(e){let t=this.config.address[e.id];return t==null?e.default:(oc(this,t),jf(this,t))}toJSON(e){let t={doc:this.sliceDoc(),selection:this.selection.toJSON()};if(e)for(let r in e){let i=e[r];i instanceof ui&&this.config.address[i.id]!=null&&(t[r]=i.spec.toJSON(this.field(e[r]),this))}return t}static fromJSON(e,t={},r){if(!e||typeof e.doc!="string")throw new RangeError("Invalid JSON representation for EditorState");let i=[];if(r){for(let s in r)if(Object.prototype.hasOwnProperty.call(e,s)){let o=r[s],a=e[s];i.push(o.init(l=>o.spec.fromJSON(a,l)))}}return Pt.create({doc:e.doc,selection:me.fromJSON(e.selection),extensions:t.extensions?i.concat([t.extensions]):i})}static create(e={}){let t=Bf.resolve(e.extensions||[],new Map),r=e.doc instanceof Nt?e.doc:Nt.of((e.doc||"").split(t.staticFacet(Pt.lineSeparator)||vm)),i=e.selection?e.selection instanceof me?e.selection:me.single(e.selection.anchor,e.selection.head):me.single(0);return n2(i,r.length),t.staticFacet(_m)||(i=i.asSingle()),new Pt(t,r,i,t.dynamicSlots.map(()=>null),(s,o)=>o.create(s),null)}get tabSize(){return this.facet(Pt.tabSize)}get lineBreak(){return this.facet(Pt.lineSeparator)||`
|
|
148
|
-
`}get readOnly(){return this.facet(c2)}phrase(e,...t){for(let r of this.facet(Pt.phrases))if(Object.prototype.hasOwnProperty.call(r,e)){e=r[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(r,i)=>{if(i=="$")return"$";let s=+(i||1);return!s||s>t.length?r:t[s-1]})),e}languageDataAt(e,t,r=-1){let i=[];for(let s of this.facet(i2))for(let o of s(this,t,r))Object.prototype.hasOwnProperty.call(o,e)&&i.push(o[e]);return i}charCategorizer(e){let t=this.languageDataAt("wordChars",e);return B5(t.length?t[0]:"")}wordAt(e){let{text:t,from:r,length:i}=this.doc.lineAt(e),s=this.charCategorizer(e),o=e-r,a=e-r;for(;o>0;){let l=Fn(t,o,!1);if(s(t.slice(l,o))!=Tn.Word)break;o=l}for(;a<i;){let l=Fn(t,a);if(s(t.slice(a,l))!=Tn.Word)break;a=l}return o==a?null:me.range(o+r,a+r)}}Pt.allowMultipleSelections=_m;Pt.tabSize=Ie.define({combine:n=>n.length?n[0]:4});Pt.lineSeparator=s2;Pt.readOnly=c2;Pt.phrases=Ie.define({compare(n,e){let t=Object.keys(n),r=Object.keys(e);return t.length==r.length&&t.every(i=>n[i]==e[i])}});Pt.languageData=i2;Pt.changeFilter=o2;Pt.transactionFilter=a2;Pt.transactionExtender=l2;ws.reconfigure=Qt.define();function iu(n,e,t={}){let r={};for(let i of n)for(let s of Object.keys(i)){let o=i[s],a=r[s];if(a===void 0)r[s]=o;else if(!(a===o||o===void 0))if(Object.hasOwnProperty.call(t,s))r[s]=t[s](a,o);else throw new Error("Config merge conflict for field "+s)}for(let i in e)r[i]===void 0&&(r[i]=e[i]);return r}class eo{eq(e){return this==e}range(e,t=e){return Sm.create(e,t,this)}}eo.prototype.startSide=eo.prototype.endSide=0;eo.prototype.point=!1;eo.prototype.mapMode=fr.TrackDel;function Bv(n,e){return n==e||n.constructor==e.constructor&&n.eq(e)}let Sm=class d2{constructor(e,t,r){this.from=e,this.to=t,this.value=r}static create(e,t,r){return new d2(e,t,r)}};function Am(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class jv{constructor(e,t,r,i){this.from=e,this.to=t,this.value=r,this.maxPoint=i}get length(){return this.to[this.to.length-1]}findIndex(e,t,r,i=0){let s=r?this.to:this.from;for(let o=i,a=s.length;;){if(o==a)return o;let l=o+a>>1,c=s[l]-e||(r?this.value[l].endSide:this.value[l].startSide)-t;if(l==o)return c>=0?o:a;c>=0?a=l:o=l+1}}between(e,t,r,i){for(let s=this.findIndex(t,-1e9,!0),o=this.findIndex(r,1e9,!1,s);s<o;s++)if(i(this.from[s]+e,this.to[s]+e,this.value[s])===!1)return!1}map(e,t){let r=[],i=[],s=[],o=-1,a=-1;for(let l=0;l<this.value.length;l++){let c=this.value[l],u=this.from[l]+e,f=this.to[l]+e,d,h;if(u==f){let m=t.mapPos(u,c.startSide,c.mapMode);if(m==null||(d=h=m,c.startSide!=c.endSide&&(h=t.mapPos(u,c.endSide),h<d)))continue}else if(d=t.mapPos(u,c.startSide),h=t.mapPos(f,c.endSide),d>h||d==h&&c.startSide>0&&c.endSide<=0)continue;(h-d||c.endSide-c.startSide)<0||(o<0&&(o=d),c.point&&(a=Math.max(a,h-d)),r.push(c),i.push(d-o),s.push(h-o))}return{mapped:r.length?new jv(i,s,r,a):null,pos:o}}}class $t{constructor(e,t,r,i){this.chunkPos=e,this.chunk=t,this.nextLayer=r,this.maxPoint=i}static create(e,t,r,i){return new $t(e,t,r,i)}get length(){let e=this.chunk.length-1;return e<0?0:Math.max(this.chunkEnd(e),this.nextLayer.length)}get size(){if(this.isEmpty)return 0;let e=this.nextLayer.size;for(let t of this.chunk)e+=t.value.length;return e}chunkEnd(e){return this.chunkPos[e]+this.chunk[e].length}update(e){let{add:t=[],sort:r=!1,filterFrom:i=0,filterTo:s=this.length}=e,o=e.filter;if(t.length==0&&!o)return this;if(r&&(t=t.slice().sort(Am)),this.isEmpty)return t.length?$t.of(t):this;let a=new h2(this,null,-1).goto(0),l=0,c=[],u=new Vo;for(;a.value||l<t.length;)if(l<t.length&&(a.from-t[l].from||a.startSide-t[l].value.startSide)>=0){let f=t[l++];u.addInner(f.from,f.to,f.value)||c.push(f)}else a.rangeIndex==1&&a.chunkIndex<this.chunk.length&&(l==t.length||this.chunkEnd(a.chunkIndex)<t[l].from)&&(!o||i>this.chunkEnd(a.chunkIndex)||s<this.chunkPos[a.chunkIndex])&&u.addChunk(this.chunkPos[a.chunkIndex],this.chunk[a.chunkIndex])?a.nextChunk():((!o||i>a.to||s<a.from||o(a.from,a.to,a.value))&&(u.addInner(a.from,a.to,a.value)||c.push(Sm.create(a.from,a.to,a.value))),a.next());return u.finishInner(this.nextLayer.isEmpty&&!c.length?$t.empty:this.nextLayer.update({add:c,filter:o,filterFrom:i,filterTo:s}))}map(e){if(e.empty||this.isEmpty)return this;let t=[],r=[],i=-1;for(let o=0;o<this.chunk.length;o++){let a=this.chunkPos[o],l=this.chunk[o],c=e.touchesRange(a,a+l.length);if(c===!1)i=Math.max(i,l.maxPoint),t.push(l),r.push(e.mapPos(a));else if(c===!0){let{mapped:u,pos:f}=l.map(a,e);u&&(i=Math.max(i,u.maxPoint),t.push(u),r.push(f))}}let s=this.nextLayer.map(e);return t.length==0?s:new $t(r,t,s||$t.empty,i)}between(e,t,r){if(!this.isEmpty){for(let i=0;i<this.chunk.length;i++){let s=this.chunkPos[i],o=this.chunk[i];if(t>=s&&e<=s+o.length&&o.between(s,e-s,t-s,r)===!1)return}this.nextLayer.between(e,t,r)}}iter(e=0){return wc.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return wc.from(e).goto(t)}static compare(e,t,r,i,s=-1){let o=e.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),a=t.filter(f=>f.maxPoint>0||!f.isEmpty&&f.maxPoint>=s),l=iy(o,a,r),c=new Pl(o,l,s),u=new Pl(a,l,s);r.iterGaps((f,d,h)=>sy(c,f,u,d,h,i)),r.empty&&r.length==0&&sy(c,0,u,0,0,i)}static eq(e,t,r=0,i){i==null&&(i=999999999);let s=e.filter(u=>!u.isEmpty&&t.indexOf(u)<0),o=t.filter(u=>!u.isEmpty&&e.indexOf(u)<0);if(s.length!=o.length)return!1;if(!s.length)return!0;let a=iy(s,o),l=new Pl(s,a,0).goto(r),c=new Pl(o,a,0).goto(r);for(;;){if(l.to!=c.to||!Cm(l.active,c.active)||l.point&&(!c.point||!Bv(l.point,c.point)))return!1;if(l.to>i)return!0;l.next(),c.next()}}static spans(e,t,r,i,s=-1){let o=new Pl(e,null,s).goto(t),a=t,l=o.openStart;for(;;){let c=Math.min(o.to,r);if(o.point){let u=o.activeForPoint(o.to),f=o.pointFrom<t?u.length+1:o.point.startSide<0?u.length:Math.min(u.length,l);i.point(a,c,o.point,u,f,o.pointRank),l=Math.min(o.openEnd(c),u.length)}else c>a&&(i.span(a,c,o.active,l),l=o.openEnd(c));if(o.to>r)return l+(o.point&&o.to>r?1:0);a=o.to,o.next()}}static of(e,t=!1){let r=new Vo;for(let i of e instanceof Sm?[e]:t?j5(e):e)r.add(i.from,i.to,i.value);return r.finish()}static join(e){if(!e.length)return $t.empty;let t=e[e.length-1];for(let r=e.length-2;r>=0;r--)for(let i=e[r];i!=$t.empty;i=i.nextLayer)t=new $t(i.chunkPos,i.chunk,t,Math.max(i.maxPoint,t.maxPoint));return t}}$t.empty=new $t([],[],null,-1);function j5(n){if(n.length>1)for(let e=n[0],t=1;t<n.length;t++){let r=n[t];if(Am(e,r)>0)return n.slice().sort(Am);e=r}return n}$t.empty.nextLayer=$t.empty;class Vo{finishChunk(e){this.chunks.push(new jv(this.from,this.to,this.value,this.maxPoint)),this.chunkPos.push(this.chunkStart),this.chunkStart=-1,this.setMaxPoint=Math.max(this.setMaxPoint,this.maxPoint),this.maxPoint=-1,e&&(this.from=[],this.to=[],this.value=[])}constructor(){this.chunks=[],this.chunkPos=[],this.chunkStart=-1,this.last=null,this.lastFrom=-1e9,this.lastTo=-1e9,this.from=[],this.to=[],this.value=[],this.maxPoint=-1,this.setMaxPoint=-1,this.nextLayer=null}add(e,t,r){this.addInner(e,t,r)||(this.nextLayer||(this.nextLayer=new Vo)).add(e,t,r)}addInner(e,t,r){let i=e-this.lastTo||r.startSide-this.last.endSide;if(i<=0&&(e-this.lastFrom||r.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return i<0?!1:(this.from.length==250&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=r,this.lastFrom=e,this.lastTo=t,this.value.push(r),r.point&&(this.maxPoint=Math.max(this.maxPoint,t-e)),!0)}addChunk(e,t){if((e-this.lastTo||t.value[0].startSide-this.last.endSide)<0)return!1;this.from.length&&this.finishChunk(!0),this.setMaxPoint=Math.max(this.setMaxPoint,t.maxPoint),this.chunks.push(t),this.chunkPos.push(e);let r=t.value.length-1;return this.last=t.value[r],this.lastFrom=t.from[r]+e,this.lastTo=t.to[r]+e,!0}finish(){return this.finishInner($t.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=$t.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function iy(n,e,t){let r=new Map;for(let s of n)for(let o=0;o<s.chunk.length;o++)s.chunk[o].maxPoint<=0&&r.set(s.chunk[o],s.chunkPos[o]);let i=new Set;for(let s of e)for(let o=0;o<s.chunk.length;o++){let a=r.get(s.chunk[o]);a!=null&&(t?t.mapPos(a):a)==s.chunkPos[o]&&!t?.touchesRange(a,a+s.chunk[o].length)&&i.add(s.chunk[o])}return i}class h2{constructor(e,t,r,i=0){this.layer=e,this.skip=t,this.minPoint=r,this.rank=i}get startSide(){return this.value?this.value.startSide:0}get endSide(){return this.value?this.value.endSide:0}goto(e,t=-1e9){return this.chunkIndex=this.rangeIndex=0,this.gotoInner(e,t,!1),this}gotoInner(e,t,r){for(;this.chunkIndex<this.layer.chunk.length;){let i=this.layer.chunk[this.chunkIndex];if(!(this.skip&&this.skip.has(i)||this.layer.chunkEnd(this.chunkIndex)<e||i.maxPoint<this.minPoint))break;this.chunkIndex++,r=!1}if(this.chunkIndex<this.layer.chunk.length){let i=this.layer.chunk[this.chunkIndex].findIndex(e-this.layer.chunkPos[this.chunkIndex],t,!0);(!r||this.rangeIndex<i)&&this.setRangeIndex(i)}this.next()}forward(e,t){(this.to-e||this.endSide-t)<0&&this.gotoInner(e,t,!0)}next(){for(;;)if(this.chunkIndex==this.layer.chunk.length){this.from=this.to=1e9,this.value=null;break}else{let e=this.layer.chunkPos[this.chunkIndex],t=this.layer.chunk[this.chunkIndex],r=e+t.from[this.rangeIndex];if(this.from=r,this.to=e+t.to[this.rangeIndex],this.value=t.value[this.rangeIndex],this.setRangeIndex(this.rangeIndex+1),this.minPoint<0||this.value.point&&this.to-this.from>=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex<this.layer.chunk.length&&this.skip.has(this.layer.chunk[this.chunkIndex]);)this.chunkIndex++;this.rangeIndex=0}else this.rangeIndex=e}nextChunk(){this.chunkIndex++,this.rangeIndex=0,this.next()}compare(e){return this.from-e.from||this.startSide-e.startSide||this.rank-e.rank||this.to-e.to||this.endSide-e.endSide}}class wc{constructor(e){this.heap=e}static from(e,t=null,r=-1){let i=[];for(let s=0;s<e.length;s++)for(let o=e[s];!o.isEmpty;o=o.nextLayer)o.maxPoint>=r&&i.push(new h2(o,t,r,s));return i.length==1?i[0]:new wc(i)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let r of this.heap)r.goto(e,t);for(let r=this.heap.length>>1;r>=0;r--)Ih(this.heap,r);return this.next(),this}forward(e,t){for(let r of this.heap)r.forward(e,t);for(let r=this.heap.length>>1;r>=0;r--)Ih(this.heap,r);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(this.heap.length==0)this.from=this.to=1e9,this.value=null,this.rank=-1;else{let e=this.heap[0];this.from=e.from,this.to=e.to,this.value=e.value,this.rank=e.rank,e.value&&e.next(),Ih(this.heap,0)}}}function Ih(n,e){for(let t=n[e];;){let r=(e<<1)+1;if(r>=n.length)break;let i=n[r];if(r+1<n.length&&i.compare(n[r+1])>=0&&(i=n[r+1],r++),t.compare(i)<0)break;n[r]=t,n[e]=i,e=r}}class Pl{constructor(e,t,r){this.minPoint=r,this.active=[],this.activeTo=[],this.activeRank=[],this.minActive=-1,this.point=null,this.pointFrom=0,this.pointRank=0,this.to=-1e9,this.endSide=0,this.openStart=-1,this.cursor=wc.from(e,t,r)}goto(e,t=-1e9){return this.cursor.goto(e,t),this.active.length=this.activeTo.length=this.activeRank.length=0,this.minActive=-1,this.to=e,this.endSide=t,this.openStart=-1,this.next(),this}forward(e,t){for(;this.minActive>-1&&(this.activeTo[this.minActive]-e||this.active[this.minActive].endSide-t)<0;)this.removeActive(this.minActive);this.cursor.forward(e,t)}removeActive(e){xu(this.active,e),xu(this.activeTo,e),xu(this.activeRank,e),this.minActive=oy(this.active,this.activeTo)}addActive(e){let t=0,{value:r,to:i,rank:s}=this.cursor;for(;t<this.activeRank.length&&(s-this.activeRank[t]||i-this.activeTo[t])>0;)t++;Su(this.active,t,r),Su(this.activeTo,t,i),Su(this.activeRank,t,s),e&&Su(e,t,this.cursor.from),this.minActive=oy(this.active,this.activeTo)}next(){let e=this.to,t=this.point;this.point=null;let r=this.openStart<0?[]:null;for(;;){let i=this.minActive;if(i>-1&&(this.activeTo[i]-this.cursor.from||this.active[i].endSide-this.cursor.startSide)<0){if(this.activeTo[i]>e){this.to=this.activeTo[i],this.endSide=this.active[i].endSide;break}this.removeActive(i),r&&xu(r,i)}else if(this.cursor.value)if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}else{let s=this.cursor.value;if(!s.point)this.addActive(r),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from<this.cursor.to)this.cursor.next();else{this.point=s,this.pointFrom=this.cursor.from,this.pointRank=this.cursor.rank,this.to=this.cursor.to,this.endSide=s.endSide,this.cursor.next(),this.forward(this.to,this.endSide);break}}else{this.to=this.endSide=1e9;break}}if(r){this.openStart=0;for(let i=r.length-1;i>=0&&r[i]<e;i--)this.openStart++}}activeForPoint(e){if(!this.active.length)return this.active;let t=[];for(let r=this.active.length-1;r>=0&&!(this.activeRank[r]<this.pointRank);r--)(this.activeTo[r]>e||this.activeTo[r]==e&&this.active[r].endSide>=this.point.endSide)&&t.push(this.active[r]);return t.reverse()}openEnd(e){let t=0;for(let r=this.activeTo.length-1;r>=0&&this.activeTo[r]>e;r--)t++;return t}}function sy(n,e,t,r,i,s){n.goto(e),t.goto(r);let o=r+i,a=r,l=r-e,c=!!s.boundChange;for(let u=!1;;){let f=n.to+l-t.to,d=f||n.endSide-t.endSide,h=d<0?n.to+l:t.to,m=Math.min(h,o);if(n.point||t.point?(n.point&&t.point&&Bv(n.point,t.point)&&Cm(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(a,m,n.point,t.point),u=!1):(u&&s.boundChange(a),m>a&&!Cm(n.active,t.active)&&s.compareRange(a,m,n.active,t.active),c&&m<o&&(f||n.openEnd(h)!=t.openEnd(h))&&(u=!0)),h>o)break;a=h,d<=0&&n.next(),d>=0&&t.next()}}function Cm(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!=e[t]&&!Bv(n[t],e[t]))return!1;return!0}function xu(n,e){for(let t=e,r=n.length-1;t<r;t++)n[t]=n[t+1];n.pop()}function Su(n,e,t){for(let r=n.length-1;r>=e;r--)n[r+1]=n[r];n[e]=t}function oy(n,e){let t=-1,r=1e9;for(let i=0;i<e.length;i++)(e[i]-r||n[i].endSide-n[t].endSide)<0&&(t=i,r=e[i]);return t}function xs(n,e,t=n.length){let r=0;for(let i=0;i<t&&i<n.length;)n.charCodeAt(i)==9?(r+=e-r%e,i++):(r++,i=Fn(n,i));return r}function z5(n,e,t,r){for(let i=0,s=0;;){if(s>=e)return i;if(i==n.length)break;s+=n.charCodeAt(i)==9?t-s%t:1,i=Fn(n,i)}return n.length}const Tm="ͼ",ay=typeof Symbol>"u"?"__"+Tm:Symbol.for(Tm),Pm=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),ly=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class to{constructor(e,t){this.rules=[];let{finish:r}=t||{};function i(o){return/^@/.test(o)?[o]:o.split(/,\s*/)}function s(o,a,l,c){let u=[],f=/^@(\w+)\b/.exec(o[0]),d=f&&f[1]=="keyframes";if(f&&a==null)return l.push(o[0]+";");for(let h in a){let m=a[h];if(/&/.test(h))s(h.split(/,\s*/).map(p=>o.map(v=>p.replace(/&/,v))).reduce((p,v)=>p.concat(v)),m,l);else if(m&&typeof m=="object"){if(!f)throw new RangeError("The value of a property ("+h+") should be a primitive value.");s(i(h),m,u,d)}else m!=null&&u.push(h.replace(/_.*/,"").replace(/[A-Z]/g,p=>"-"+p.toLowerCase())+": "+m+";")}(u.length||d)&&l.push((r&&!f&&!c?o.map(r):o).join(", ")+" {"+u.join(" ")+"}")}for(let o in e)s(i(o),e[o],this.rules)}getRules(){return this.rules.join(`
|
|
149
|
-
`)}static newName(){let e=ly[ay]||1;return ly[ay]=e+1,Tm+e.toString(36)}static mount(e,t,r){let i=e[Pm],s=r&&r.nonce;i?s&&i.setNonce(s):i=new Z5(e,s),i.mount(Array.isArray(t)?t:[t],e)}}let cy=new Map;class Z5{constructor(e,t){let r=e.ownerDocument||e,i=r.defaultView;if(!e.head&&e.adoptedStyleSheets&&i.CSSStyleSheet){let s=cy.get(r);if(s)return e[Pm]=s;this.sheet=new i.CSSStyleSheet,cy.set(r,this)}else this.styleTag=r.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);this.modules=[],e[Pm]=this}mount(e,t){let r=this.sheet,i=0,s=0;for(let o=0;o<e.length;o++){let a=e[o],l=this.modules.indexOf(a);if(l<s&&l>-1&&(this.modules.splice(l,1),s--,l=-1),l==-1){if(this.modules.splice(s++,0,a),r)for(let c=0;c<a.rules.length;c++)r.insertRule(a.rules[c],i++)}else{for(;s<l;)i+=this.modules[s++].rules.length;i+=a.rules.length,s++}}if(r)t.adoptedStyleSheets.indexOf(this.sheet)<0&&(t.adoptedStyleSheets=[this.sheet,...t.adoptedStyleSheets]);else{let o="";for(let l=0;l<this.modules.length;l++)o+=this.modules[l].getRules()+`
|
|
150
|
-
`;this.styleTag.textContent=o;let a=t.head||t;this.styleTag.parentNode!=a&&a.insertBefore(this.styleTag,a.firstChild)}}setNonce(e){this.styleTag&&this.styleTag.getAttribute("nonce")!=e&&this.styleTag.setAttribute("nonce",e)}}var no={8:"Backspace",9:"Tab",10:"Enter",12:"NumLock",13:"Enter",16:"Shift",17:"Control",18:"Alt",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",44:"PrintScreen",45:"Insert",46:"Delete",59:";",61:"=",91:"Meta",92:"Meta",106:"*",107:"+",108:",",109:"-",110:".",111:"/",144:"NumLock",145:"ScrollLock",160:"Shift",161:"Shift",162:"Control",163:"Control",164:"Alt",165:"Alt",173:"-",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},_c={48:")",49:"!",50:"@",51:"#",52:"$",53:"%",54:"^",55:"&",56:"*",57:"(",59:":",61:"+",173:"_",186:":",187:"+",188:"<",189:"_",190:">",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},F5=typeof navigator<"u"&&/Mac/.test(navigator.platform),X5=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var Gn=0;Gn<10;Gn++)no[48+Gn]=no[96+Gn]=String(Gn);for(var Gn=1;Gn<=24;Gn++)no[Gn+111]="F"+Gn;for(var Gn=65;Gn<=90;Gn++)no[Gn]=String.fromCharCode(Gn+32),_c[Gn]=String.fromCharCode(Gn);for(var Nh in no)_c.hasOwnProperty(Nh)||(_c[Nh]=no[Nh]);function V5(n){var e=F5&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||X5&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?_c:no)[n.keyCode]||n.key||"Unidentified";return t=="Esc"&&(t="Escape"),t=="Del"&&(t="Delete"),t=="Left"&&(t="ArrowLeft"),t=="Up"&&(t="ArrowUp"),t=="Right"&&(t="ArrowRight"),t=="Down"&&(t="ArrowDown"),t}function zn(){var n=arguments[0];typeof n=="string"&&(n=document.createElement(n));var e=1,t=arguments[1];if(t&&typeof t=="object"&&t.nodeType==null&&!Array.isArray(t)){for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var i=t[r];typeof i=="string"?n.setAttribute(r,i):i!=null&&(n[r]=i)}e++}for(;e<arguments.length;e++)p2(n,arguments[e]);return n}function p2(n,e){if(typeof e=="string")n.appendChild(document.createTextNode(e));else if(e!=null)if(e.nodeType!=null)n.appendChild(e);else if(Array.isArray(e))for(var t=0;t<e.length;t++)p2(n,e[t]);else throw new RangeError("Unsupported child node: "+e)}let ur=typeof navigator<"u"?navigator:{userAgent:"",vendor:"",platform:""},Em=typeof document<"u"?document:{documentElement:{style:{}}};const $m=/Edge\/(\d+)/.exec(ur.userAgent),m2=/MSIE \d/.test(ur.userAgent),Qm=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ur.userAgent),Hd=!!(m2||Qm||$m),uy=!Hd&&/gecko\/(\d+)/i.test(ur.userAgent),Bh=!Hd&&/Chrome\/(\d+)/.exec(ur.userAgent),W5="webkitFontSmoothing"in Em.documentElement.style,Lm=!Hd&&/Apple Computer/.test(ur.vendor),fy=Lm&&(/Mobile\/\w+/.test(ur.userAgent)||ur.maxTouchPoints>2);var Le={mac:fy||/Mac/.test(ur.platform),windows:/Win/.test(ur.platform),linux:/Linux|X11/.test(ur.platform),ie:Hd,ie_version:m2?Em.documentMode||6:Qm?+Qm[1]:$m?+$m[1]:0,gecko:uy,gecko_version:uy?+(/Firefox\/(\d+)/.exec(ur.userAgent)||[0,0])[1]:0,chrome:!!Bh,chrome_version:Bh?+Bh[1]:0,ios:fy,android:/Android\b/.test(ur.userAgent),webkit_version:W5?+(/\bAppleWebKit\/(\d+)/.exec(ur.userAgent)||[0,0])[1]:0,safari:Lm,safari_version:Lm?+(/\bVersion\/(\d+(\.\d+)?)/.exec(ur.userAgent)||[0,0])[1]:0,tabSize:Em.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};function zv(n,e){for(let t in n)t=="class"&&e.class?e.class+=" "+n.class:t=="style"&&e.style?e.style+=";"+n.style:e[t]=n[t];return e}const zf=Object.create(null);function Zv(n,e,t){if(n==e)return!0;n||(n=zf),e||(e=zf);let r=Object.keys(n),i=Object.keys(e);if(r.length-0!=i.length-0)return!1;for(let s of r)if(s!=t&&(i.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function Y5(n,e){for(let t=n.attributes.length-1;t>=0;t--){let r=n.attributes[t].name;e[r]==null&&n.removeAttribute(r)}for(let t in e){let r=e[t];t=="style"?n.style.cssText=r:n.getAttribute(t)!=r&&n.setAttribute(t,r)}}function dy(n,e,t){let r=!1;if(e)for(let i in e)t&&i in t||(r=!0,i=="style"?n.style.cssText="":n.removeAttribute(i));if(t)for(let i in t)e&&e[i]==t[i]||(r=!0,i=="style"?n.style.cssText=t[i]:n.setAttribute(i,t[i]));return r}function U5(n){let e=Object.create(null);for(let t=0;t<n.attributes.length;t++){let r=n.attributes[t];e[r.name]=r.value}return e}class su{eq(e){return!1}updateDOM(e,t){return!1}compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}get estimatedHeight(){return-1}get lineBreaks(){return 0}ignoreEvent(e){return!0}coordsAt(e,t,r){return null}get isHidden(){return!1}get editable(){return!1}destroy(e){}}var $r=(function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n})($r||($r={}));class ft extends eo{constructor(e,t,r,i){super(),this.startSide=e,this.endSide=t,this.widget=r,this.spec=i}get heightRelevant(){return!1}static mark(e){return new ou(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),r=!!e.block;return t+=r&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Wo(e,t,t,r,e.widget||null,!1)}static replace(e){let t=!!e.block,r,i;if(e.isBlockGap)r=-5e8,i=4e8;else{let{start:s,end:o}=g2(e,t);r=(s?t?-3e8:-1:5e8)-1,i=(o?t?2e8:1:-6e8)+1}return new Wo(e,r,i,t,e.widget||null,!0)}static line(e){return new au(e)}static set(e,t=!1){return $t.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}ft.none=$t.empty;class ou extends ft{constructor(e){let{start:t,end:r}=g2(e);super(t?-1:5e8,r?1:-6e8,null,e),this.tagName=e.tagName||"span",this.attrs=e.class&&e.attributes?zv(e.attributes,{class:e.class}):e.class?{class:e.class}:e.attributes||zf}eq(e){return this==e||e instanceof ou&&this.tagName==e.tagName&&Zv(this.attrs,e.attrs)}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}ou.prototype.point=!1;class au extends ft{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof au&&this.spec.class==e.spec.class&&Zv(this.spec.attributes,e.spec.attributes)}range(e,t=e){if(t!=e)throw new RangeError("Line decoration ranges must be zero-length");return super.range(e,t)}}au.prototype.mapMode=fr.TrackBefore;au.prototype.point=!0;class Wo extends ft{constructor(e,t,r,i,s,o){super(t,r,s,e),this.block=i,this.isReplace=o,this.mapMode=i?t<=0?fr.TrackBefore:fr.TrackAfter:fr.TrackDel}get type(){return this.startSide!=this.endSide?$r.WidgetRange:this.startSide<=0?$r.WidgetBefore:$r.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Wo&&G5(this.widget,e.widget)&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide}range(e,t=e){if(this.isReplace&&(e>t||e==t&&this.startSide>0&&this.endSide<=0))throw new RangeError("Invalid range for replacement decoration");if(!this.isReplace&&t!=e)throw new RangeError("Widget decorations can only have zero-length ranges");return super.range(e,t)}}Wo.prototype.point=!0;function g2(n,e=!1){let{inclusiveStart:t,inclusiveEnd:r}=n;return t==null&&(t=n.inclusive),r==null&&(r=n.inclusive),{start:t??e,end:r??e}}function G5(n,e){return n==e||!!(n&&e&&n.compare(e))}function qa(n,e,t,r=0){let i=t.length-1;i>=0&&t[i]+r>=n?t[i]=Math.max(t[i],e):t.push(n,e)}class kc extends eo{constructor(e,t){super(),this.tagName=e,this.attributes=t}eq(e){return e==this||e instanceof kc&&this.tagName==e.tagName&&Zv(this.attributes,e.attributes)}static create(e){return new kc(e.tagName,e.attributes||zf)}static set(e,t=!1){return $t.of(e,t)}}kc.prototype.startSide=kc.prototype.endSide=-1;function xc(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function Mm(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function ac(n,e){if(!e.anchorNode)return!1;try{return Mm(n,e.anchorNode)}catch{return!1}}function vf(n){return n.nodeType==3?Sc(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function lc(n,e,t,r){return t?hy(n,e,t,r,-1)||hy(n,e,t,r,1):!1}function ro(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Zf(n){return n.nodeType==1&&/^(DIV|P|LI|UL|OL|BLOCKQUOTE|DD|DT|H\d|SECTION|PRE)$/.test(n.nodeName)}function hy(n,e,t,r,i){for(;;){if(n==t&&e==r)return!0;if(e==(i<0?0:Ss(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=ro(n)+(i<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(i<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=i<0?Ss(n):0}else return!1}}function Ss(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Ff(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function H5(n){let e=n.visualViewport;return e?{left:0,right:e.width,top:0,bottom:e.height}:{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function v2(n,e){let t=e.width/n.offsetWidth,r=e.height/n.offsetHeight;return(t>.995&&t<1.005||!isFinite(t)||Math.abs(e.width-n.offsetWidth)<1)&&(t=1),(r>.995&&r<1.005||!isFinite(r)||Math.abs(e.height-n.offsetHeight)<1)&&(r=1),{scaleX:t,scaleY:r}}function K5(n,e,t,r,i,s,o,a){let l=n.ownerDocument,c=l.defaultView||window;for(let u=n,f=!1;u&&!f;)if(u.nodeType==1){let d,h=u==l.body,m=1,p=1;if(h)d=H5(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(f=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let b=u.getBoundingClientRect();({scaleX:m,scaleY:p}=v2(u,b)),d={left:b.left,right:b.left+u.clientWidth*m,top:b.top,bottom:b.top+u.clientHeight*p}}let v=0,O=0;if(i=="nearest")e.top<d.top?(O=e.top-(d.top+o),t>0&&e.bottom>d.bottom+O&&(O=e.bottom-d.bottom+o)):e.bottom>d.bottom&&(O=e.bottom-d.bottom+o,t<0&&e.top-O<d.top&&(O=e.top-(d.top+o)));else{let b=e.bottom-e.top,w=d.bottom-d.top;O=(i=="center"&&b<=w?e.top+b/2-w/2:i=="start"||i=="center"&&t<0?e.top-o:e.bottom-w+o)-d.top}if(r=="nearest"?e.left<d.left?(v=e.left-(d.left+s),t>0&&e.right>d.right+v&&(v=e.right-d.right+s)):e.right>d.right&&(v=e.right-d.right+s,t<0&&e.left<d.left+v&&(v=e.left-(d.left+s))):v=(r=="center"?e.left+(e.right-e.left)/2-(d.right-d.left)/2:r=="start"==a?e.left-s:e.right-(d.right-d.left)+s)-d.left,v||O)if(h)c.scrollBy(v,O);else{let b=0,w=0;if(O){let S=u.scrollTop;u.scrollTop+=O/p,w=(u.scrollTop-S)*p}if(v){let S=u.scrollLeft;u.scrollLeft+=v/m,b=(u.scrollLeft-S)*m}e={left:e.left-b,top:e.top-w,right:e.right-b,bottom:e.bottom-w},b&&Math.abs(b-v)<1&&(r="nearest"),w&&Math.abs(w-O)<1&&(i="nearest")}if(h)break;(e.top<d.top||e.bottom>d.bottom||e.left<d.left||e.right>d.right)&&(e={left:Math.max(e.left,d.left),right:Math.min(e.right,d.right),top:Math.max(e.top,d.top),bottom:Math.min(e.bottom,d.bottom)}),u=u.assignedSlot||u.parentNode}else if(u.nodeType==11)u=u.host;else break}function J5(n){let e=n.ownerDocument,t,r;for(let i=n.parentNode;i&&!(i==e.body||t&&r);)if(i.nodeType==1)!r&&i.scrollHeight>i.clientHeight&&(r=i),!t&&i.scrollWidth>i.clientWidth&&(t=i),i=i.assignedSlot||i.parentNode;else if(i.nodeType==11)i=i.host;else break;return{x:t,y:r}}class eL{constructor(){this.anchorNode=null,this.anchorOffset=0,this.focusNode=null,this.focusOffset=0}eq(e){return this.anchorNode==e.anchorNode&&this.anchorOffset==e.anchorOffset&&this.focusNode==e.focusNode&&this.focusOffset==e.focusOffset}setRange(e){let{anchorNode:t,focusNode:r}=e;this.set(t,Math.min(e.anchorOffset,t?Ss(t):0),r,Math.min(e.focusOffset,r?Ss(r):0))}set(e,t,r,i){this.anchorNode=e,this.anchorOffset=t,this.focusNode=r,this.focusOffset=i}}let yo=null;Le.safari&&Le.safari_version>=26&&(yo=!1);function O2(n){if(n.setActive)return n.setActive();if(yo)return n.focus(yo);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(yo==null?{get preventScroll(){return yo={preventScroll:!0},!0}}:void 0),!yo){yo=!1;for(let t=0;t<e.length;){let r=e[t++],i=e[t++],s=e[t++];r.scrollTop!=i&&(r.scrollTop=i),r.scrollLeft!=s&&(r.scrollLeft=s)}}}let py;function Sc(n,e,t=e){let r=py||(py=document.createRange());return r.setEnd(n,t),r.setStart(n,e),r}function Ra(n,e,t,r){let i={key:e,code:e,keyCode:t,which:t,cancelable:!0};r&&({altKey:i.altKey,ctrlKey:i.ctrlKey,shiftKey:i.shiftKey,metaKey:i.metaKey}=r);let s=new KeyboardEvent("keydown",i);s.synthetic=!0,n.dispatchEvent(s);let o=new KeyboardEvent("keyup",i);return o.synthetic=!0,n.dispatchEvent(o),s.defaultPrevented||o.defaultPrevented}function tL(n){for(;n;){if(n&&(n.nodeType==9||n.nodeType==11&&n.host))return n;n=n.assignedSlot||n.parentNode}return null}function nL(n,e){let t=e.focusNode,r=e.focusOffset;if(!t||e.anchorNode!=t||e.anchorOffset!=r)return!1;for(r=Math.min(r,Ss(t));;)if(r){if(t.nodeType!=1)return!1;let i=t.childNodes[r-1];i.contentEditable=="false"?r--:(t=i,r=Ss(t))}else{if(t==n)return!0;r=ro(t),t=t.parentNode}}function b2(n){return n.scrollTop>Math.max(1,n.scrollHeight-n.clientHeight-4)}function y2(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r>0)return{node:t,offset:r};if(t.nodeType==1&&r>0){if(t.contentEditable=="false")return null;t=t.childNodes[r-1],r=Ss(t)}else if(t.parentNode&&!Zf(t))r=ro(t),t=t.parentNode;else return null}}function w2(n,e){for(let t=n,r=e;;){if(t.nodeType==3&&r<t.nodeValue.length)return{node:t,offset:r};if(t.nodeType==1&&r<t.childNodes.length){if(t.contentEditable=="false")return null;t=t.childNodes[r],r=0}else if(t.parentNode&&!Zf(t))r=ro(t)+1,t=t.parentNode;else return null}}class xi{constructor(e,t,r=!0){this.node=e,this.offset=t,this.precise=r}static before(e,t){return new xi(e.parentNode,ro(e),t)}static after(e,t){return new xi(e.parentNode,ro(e)+1,t)}}var bn=(function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n})(bn||(bn={}));const Yo=bn.LTR,Fv=bn.RTL;function _2(n){let e=[];for(let t=0;t<n.length;t++)e.push(1<<+n[t]);return e}const rL=_2("88888888888888888888888888888888888666888888787833333333337888888000000000000000000000000008888880000000000000000000000000088888888888888888888888888888888888887866668888088888663380888308888800000000000000000000000800000000000000000000000000000008"),iL=_2("4444448826627288999999999992222222222222222222222222222222222222222222222229999999999999999999994444444444644222822222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222222999999949999999229989999223333333333"),qm=Object.create(null),Ri=[];for(let n of["()","[]","{}"]){let e=n.charCodeAt(0),t=n.charCodeAt(1);qm[e]=t,qm[t]=-e}function k2(n){return n<=247?rL[n]:1424<=n&&n<=1524?2:1536<=n&&n<=1785?iL[n-1536]:1774<=n&&n<=2220?4:8192<=n&&n<=8204?256:64336<=n&&n<=65023?4:1}const sL=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac\ufb50-\ufdff]/;class Vi{get dir(){return this.level%2?Fv:Yo}constructor(e,t,r){this.from=e,this.to=t,this.level=r}side(e,t){return this.dir==t==e?this.to:this.from}forward(e,t){return e==(this.dir==t)}static find(e,t,r,i){let s=-1;for(let o=0;o<e.length;o++){let a=e[o];if(a.from<=t&&a.to>=t){if(a.level==r)return o;(s<0||(i!=0?i<0?a.from<t:a.to>t:e[s].level>a.level))&&(s=o)}}if(s<0)throw new RangeError("Index out of range");return s}}function x2(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++){let r=n[t],i=e[t];if(r.from!=i.from||r.to!=i.to||r.direction!=i.direction||!x2(r.inner,i.inner))return!1}return!0}const tn=[];function oL(n,e,t,r,i){for(let s=0;s<=r.length;s++){let o=s?r[s-1].to:e,a=s<r.length?r[s].from:t,l=s?256:i;for(let c=o,u=l,f=l;c<a;c++){let d=k2(n.charCodeAt(c));d==512?d=u:d==8&&f==4&&(d=16),tn[c]=d==4?2:d,d&7&&(f=d),u=d}for(let c=o,u=l,f=l;c<a;c++){let d=tn[c];if(d==128)c<a-1&&u==tn[c+1]&&u&24?d=tn[c]=u:tn[c]=256;else if(d==64){let h=c+1;for(;h<a&&tn[h]==64;)h++;let m=c&&u==8||h<t&&tn[h]==8?f==1?1:8:256;for(let p=c;p<h;p++)tn[p]=m;c=h-1}else d==8&&f==1&&(tn[c]=1);u=d,d&7&&(f=d)}}}function aL(n,e,t,r,i){let s=i==1?2:1;for(let o=0,a=0,l=0;o<=r.length;o++){let c=o?r[o-1].to:e,u=o<r.length?r[o].from:t;for(let f=c,d,h,m;f<u;f++)if(h=qm[d=n.charCodeAt(f)])if(h<0){for(let p=a-3;p>=0;p-=3)if(Ri[p+1]==-h){let v=Ri[p+2],O=v&2?i:v&4?v&1?s:i:0;O&&(tn[f]=tn[Ri[p]]=O),a=p;break}}else{if(Ri.length==189)break;Ri[a++]=f,Ri[a++]=d,Ri[a++]=l}else if((m=tn[f])==2||m==1){let p=m==i;l=p?0:1;for(let v=a-3;v>=0;v-=3){let O=Ri[v+2];if(O&2)break;if(p)Ri[v+2]|=2;else{if(O&4)break;Ri[v+2]|=4}}}}}function lL(n,e,t,r){for(let i=0,s=r;i<=t.length;i++){let o=i?t[i-1].to:n,a=i<t.length?t[i].from:e;for(let l=o;l<a;){let c=tn[l];if(c==256){let u=l+1;for(;;)if(u==a){if(i==t.length)break;u=t[i++].to,a=i<t.length?t[i].from:e}else if(tn[u]==256)u++;else break;let f=s==1,d=(u<e?tn[u]:r)==1,h=f==d?f?1:2:r;for(let m=u,p=i,v=p?t[p-1].to:n;m>l;)m==v&&(m=t[--p].from,v=p?t[p-1].to:n),tn[--m]=h;l=u}else s=c,l++}}}function Rm(n,e,t,r,i,s,o){let a=r%2?2:1;if(r%2==i%2)for(let l=e,c=0;l<t;){let u=!0,f=!1;if(c==s.length||l<s[c].from){let p=tn[l];p!=a&&(u=!1,f=p==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,m=l;e:for(;;)if(c<s.length&&m==s[c].from){if(f)break e;let p=s[c];if(!u)for(let v=p.to,O=c+1;;){if(v==t)break e;if(O<s.length&&s[O].from==v)v=s[O++].to;else{if(tn[v]==a)break e;break}}if(c++,d)d.push(p);else{p.from>l&&o.push(new Vi(l,p.from,h));let v=p.direction==Yo!=!(h%2);Dm(n,v?r+1:r,i,p.inner,p.from,p.to,o),l=p.to}m=p.to}else{if(m==t||(u?tn[m]!=a:tn[m]==a))break;m++}d?Rm(n,l,m,r+1,i,d,o):l<m&&o.push(new Vi(l,m,h)),l=m}else for(let l=t,c=s.length;l>e;){let u=!0,f=!1;if(!c||l>s[c-1].to){let p=tn[l-1];p!=a&&(u=!1,f=p==16)}let d=!u&&a==1?[]:null,h=u?r:r+1,m=l;e:for(;;)if(c&&m==s[c-1].to){if(f)break e;let p=s[--c];if(!u)for(let v=p.from,O=c;;){if(v==e)break e;if(O&&s[O-1].to==v)v=s[--O].from;else{if(tn[v-1]==a)break e;break}}if(d)d.push(p);else{p.to<l&&o.push(new Vi(p.to,l,h));let v=p.direction==Yo!=!(h%2);Dm(n,v?r+1:r,i,p.inner,p.from,p.to,o),l=p.from}m=p.from}else{if(m==e||(u?tn[m-1]!=a:tn[m-1]==a))break;m--}d?Rm(n,m,l,r+1,i,d,o):m<l&&o.push(new Vi(m,l,h)),l=m}}function Dm(n,e,t,r,i,s,o){let a=e%2?2:1;oL(n,i,s,r,a),aL(n,i,s,r,a),lL(i,s,r,a),Rm(n,i,s,e,t,r,o)}function cL(n,e,t){if(!n)return[new Vi(0,0,e==Fv?1:0)];if(e==Yo&&!t.length&&!sL.test(n))return S2(n.length);if(t.length)for(;n.length>tn.length;)tn[tn.length]=256;let r=[],i=e==Yo?0:1;return Dm(n,i,i,t,0,n.length,r),r}function S2(n){return[new Vi(0,n,0)]}let A2="";function uL(n,e,t,r,i){var s;let o=r.head-n.from,a=Vi.find(e,o,(s=r.bidiLevel)!==null&&s!==void 0?s:-1,r.assoc),l=e[a],c=l.side(i,t);if(o==c){let d=a+=i?1:-1;if(d<0||d>=e.length)return null;l=e[a=d],o=l.side(!i,t),c=l.side(i,t)}let u=Fn(n.text,o,l.forward(i,t));(u<l.from||u>l.to)&&(u=c),A2=n.text.slice(Math.min(o,u),Math.max(o,u));let f=a==(i?e.length-1:0)?null:e[a+(i?1:-1)];return f&&u==c&&f.level+(i?0:1)<l.level?me.cursor(f.side(!i,t)+n.from,f.forward(i,t)?1:-1,f.level):me.cursor(u+n.from,l.forward(i,t)?-1:1,l.level)}function fL(n,e,t){for(let r=e;r<t;r++){let i=k2(n.charCodeAt(r));if(i==1)return Yo;if(i==2||i==4)return Fv}return Yo}const C2=Ie.define(),T2=Ie.define(),P2=Ie.define(),E2=Ie.define(),Im=Ie.define(),$2=Ie.define(),Q2=Ie.define(),Xv=Ie.define(),Vv=Ie.define(),L2=Ie.define({combine:n=>n.some(e=>e)}),dL=Ie.define({combine:n=>n.some(e=>e)}),M2=Ie.define();class Da{constructor(e,t="nearest",r="nearest",i=5,s=5,o=!1){this.range=e,this.y=t,this.x=r,this.yMargin=i,this.xMargin=s,this.isSnapshot=o}map(e){return e.empty?this:new Da(this.range.map(e),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}clip(e){return this.range.to<=e.doc.length?this:new Da(me.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Au=Qt.define({map:(n,e)=>n.map(e)}),q2=Qt.define();function zr(n,e,t){let r=n.facet(E2);r.length?r[0](e):window.onerror&&window.onerror(String(e),t,void 0,void 0,e)||(t?console.error(t+":",e):console.error(e))}const hs=Ie.define({combine:n=>n.length?n[0]:!0});let hL=0;const Sa=Ie.define({combine(n){return n.filter((e,t)=>{for(let r=0;r<t;r++)if(n[r].plugin==e.plugin)return!1;return!0})}});class pr{constructor(e,t,r,i,s){this.id=e,this.create=t,this.domEventHandlers=r,this.domEventObservers=i,this.baseExtensions=s(this),this.extension=this.baseExtensions.concat(Sa.of({plugin:this,arg:void 0}))}of(e){return this.baseExtensions.concat(Sa.of({plugin:this,arg:e}))}static define(e,t){const{eventHandlers:r,eventObservers:i,provide:s,decorations:o}=t||{};return new pr(hL++,e,r,i,a=>{let l=[];return o&&l.push(Kd.of(c=>{let u=c.plugin(a);return u?o(u):ft.none})),s&&l.push(s(a)),l})}static fromClass(e,t){return pr.define((r,i)=>new e(r,i),t)}}class jh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}get plugin(){return this.spec&&this.spec.plugin}update(e){if(this.value){if(this.mustUpdate){let t=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(t)}catch(r){if(zr(t.state,r,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.plugin.create(e,this.spec.arg)}catch(t){zr(e.state,t,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(!((t=this.value)===null||t===void 0)&&t.destroy)try{this.value.destroy()}catch(r){zr(e.state,r,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const R2=Ie.define(),Wv=Ie.define(),Kd=Ie.define(),D2=Ie.define(),Yv=Ie.define(),lu=Ie.define(),I2=Ie.define();function my(n,e){let t=n.state.facet(I2);if(!t.length)return t;let r=t.map(s=>s instanceof Function?s(n):s),i=[];return $t.spans(r,e.from,e.to,{point(){},span(s,o,a,l){let c=s-e.from,u=o-e.from,f=i;for(let d=a.length-1;d>=0;d--,l--){let h=a[d].spec.bidiIsolate,m;if(h==null&&(h=fL(e.text,c,u)),l>0&&f.length&&(m=f[f.length-1]).to==c&&m.direction==h)m.to=u,f=m.inner;else{let p={from:c,to:u,direction:h,inner:[]};f.push(p),f=p.inner}}}}),i}const N2=Ie.define();function Uv(n){let e=0,t=0,r=0,i=0;for(let s of n.state.facet(N2)){let o=s(n);o&&(o.left!=null&&(e=Math.max(e,o.left)),o.right!=null&&(t=Math.max(t,o.right)),o.top!=null&&(r=Math.max(r,o.top)),o.bottom!=null&&(i=Math.max(i,o.bottom)))}return{left:e,right:t,top:r,bottom:i}}const Ul=Ie.define();class Jr{constructor(e,t,r,i){this.fromA=e,this.toA=t,this.fromB=r,this.toB=i}join(e){return new Jr(Math.min(this.fromA,e.fromA),Math.max(this.toA,e.toA),Math.min(this.fromB,e.fromB),Math.max(this.toB,e.toB))}addToSet(e){let t=e.length,r=this;for(;t>0;t--){let i=e[t-1];if(!(i.fromA>r.toA)){if(i.toA<r.fromA)break;r=r.join(i),e.splice(t-1,1)}}return e.splice(t,0,r),e}static extendWithRanges(e,t){if(t.length==0)return e;let r=[];for(let i=0,s=0,o=0;;){let a=i<e.length?e[i].fromB:1e9,l=s<t.length?t[s]:1e9,c=Math.min(a,l);if(c==1e9)break;let u=c+o,f=c,d=u;for(;;)if(s<t.length&&t[s]<=f){let h=t[s+1];s+=2,f=Math.max(f,h);for(let m=i;m<e.length&&e[m].fromB<=f;m++)o=e[m].toA-e[m].toB;d=Math.max(d,h+o)}else if(i<e.length&&e[i].fromB<=f){let h=e[i++];f=Math.max(f,h.toB),d=Math.max(d,h.toA),o=h.toA-h.toB}else break;r.push(new Jr(u,d,c,f))}return r}}class Xf{constructor(e,t,r){this.view=e,this.state=t,this.transactions=r,this.flags=0,this.startState=e.state,this.changes=Dn.empty(this.startState.doc.length);for(let s of r)this.changes=this.changes.compose(s.changes);let i=[];this.changes.iterChangedRanges((s,o,a,l)=>i.push(new Jr(s,o,a,l))),this.changedRanges=i}static create(e,t,r){return new Xf(e,t,r)}get viewportChanged(){return(this.flags&4)>0}get viewportMoved(){return(this.flags&8)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&18)>0}get focusChanged(){return(this.flags&1)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some(e=>e.selection)}get empty(){return this.flags==0&&this.transactions.length==0}}const pL=[];class $n{constructor(e,t,r=0){this.dom=e,this.length=t,this.flags=r,this.parent=null,e.cmTile=this}get breakAfter(){return this.flags&1}get children(){return pL}isWidget(){return!1}get isHidden(){return!1}isComposite(){return!1}isLine(){return!1}isText(){return!1}isBlock(){return!1}get domAttrs(){return null}sync(e){if(this.flags|=2,this.flags&4){this.flags&=-5;let t=this.domAttrs;t&&Y5(this.dom,t)}}toString(){return this.constructor.name+(this.children.length?`(${this.children})`:"")+(this.breakAfter?"#":"")}destroy(){this.parent=null}setDOM(e){this.dom=e,e.cmTile=this}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e,t=this.posAtStart){let r=t;for(let i of this.children){if(i==e)return r;r+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}covers(e){return!0}coordsIn(e,t){return null}domPosFor(e,t){let r=ro(this.dom),i=this.length?e>0:t>0;return new xi(this.parent.dom,r+(i?1:0),e==0||e==this.length)}markDirty(e){this.flags&=-3,e&&(this.flags|=4),this.parent&&this.parent.flags&2&&this.parent.markDirty(!1)}get overrideDOMText(){return null}get root(){for(let e=this;e;e=e.parent)if(e instanceof eh)return e;return null}static get(e){return e.cmTile}}class Jd extends $n{constructor(e){super(e,0),this._children=[]}isComposite(){return!0}get children(){return this._children}get lastChild(){return this.children.length?this.children[this.children.length-1]:null}append(e){this.children.push(e),e.parent=this}sync(e){if(this.flags&2)return;super.sync(e);let t=this.dom,r=null,i,s=e?.node==t?e:null,o=0;for(let a of this.children){if(a.sync(e),o+=a.length+a.breakAfter,i=r?r.nextSibling:t.firstChild,s&&i!=a.dom&&(s.written=!0),a.dom.parentNode==t)for(;i&&i!=a.dom;)i=gy(i);else t.insertBefore(a.dom,i);r=a.dom}for(i=r?r.nextSibling:t.firstChild,s&&i&&(s.written=!0);i;)i=gy(i);this.length=o}}function gy(n){let e=n.nextSibling;return n.parentNode.removeChild(n),e}class eh extends Jd{constructor(e,t){super(t),this.view=e}owns(e){for(;e;e=e.parent)if(e==this)return!0;return!1}isBlock(){return!0}nearest(e){for(;;){if(!e)return null;let t=$n.get(e);if(t&&this.owns(t))return t;e=e.parentNode}}blockTiles(e){for(let t=[],r=this,i=0,s=0;;)if(i==r.children.length){if(!t.length)return;r=r.parent,r.breakAfter&&s++,i=t.pop()}else{let o=r.children[i++];if(o instanceof Gs)t.push(i),r=o,i=0;else{let a=s+o.length,l=e(o,s);if(l!==void 0)return l;s=a+o.breakAfter}}}resolveBlock(e,t){let r,i=-1,s,o=-1;if(this.blockTiles((a,l)=>{let c=l+a.length;if(e>=l&&e<=c){if(a.isWidget()&&t>=-1&&t<=1){if(a.flags&32)return!0;a.flags&16&&(r=void 0)}(l<e||e==c&&(t<-1?a.length:a.covers(1)))&&(!r||!a.isWidget()&&r.isWidget())&&(r=a,i=e-l),(c>e||e==l&&(t>1?a.length:a.covers(-1)))&&(!s||!a.isWidget()&&s.isWidget())&&(s=a,o=e-l)}}),!r&&!s)throw new Error("No tile at position "+e);return r&&t<0||!s?{tile:r,offset:i}:{tile:s,offset:o}}}class Gs extends Jd{constructor(e,t){super(e),this.wrapper=t}isBlock(){return!0}covers(e){return this.children.length?e<0?this.children[0].covers(-1):this.lastChild.covers(1):!1}get domAttrs(){return this.wrapper.attributes}static of(e,t){let r=new Gs(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class Ga extends Jd{constructor(e,t){super(e),this.attrs=t}isLine(){return!0}static start(e,t,r){let i=new Ga(t||document.createElement("div"),e);return(!t||!r)&&(i.flags|=4),i}get domAttrs(){return this.attrs}resolveInline(e,t,r){let i=null,s=-1,o=null,a=-1;function l(u,f){for(let d=0,h=0;d<u.children.length&&h<=f;d++){let m=u.children[d],p=h+m.length;p>=f&&(m.isComposite()?l(m,f-h):(!o||o.isHidden&&(t>0||r&&gL(o,m)))&&(p>f||m.flags&32)?(o=m,a=f-h):(h<f||m.flags&16&&!m.isHidden)&&(i=m,s=f-h)),h=p}}l(this,e);let c=(t<0?i:o)||i||o;return c?{tile:c,offset:c==i?s:a}:null}coordsIn(e,t){let r=this.resolveInline(e,t,!0);return r?r.tile.coordsIn(Math.max(0,r.offset),t):mL(this)}domIn(e,t){let r=this.resolveInline(e,t);if(r){let{tile:i,offset:s}=r;if(this.dom.contains(i.dom))return i.isText()?new xi(i.dom,Math.min(i.dom.nodeValue.length,s)):i.domPosFor(s,i.flags&16?1:i.flags&32?-1:t);let o=r.tile.parent,a=!1;for(let l of o.children){if(a)return new xi(l.dom,0);l==r.tile&&(a=!0)}}return new xi(this.dom,0)}}function mL(n){let e=n.dom.lastChild;if(!e)return n.dom.getBoundingClientRect();let t=vf(e);return t[t.length-1]||null}function gL(n,e){let t=n.coordsIn(0,1),r=e.coordsIn(0,1);return t&&r&&r.top<t.bottom}class Ar extends Jd{constructor(e,t){super(e),this.mark=t}get domAttrs(){return this.mark.attrs}static of(e,t){let r=new Ar(t||document.createElement(e.tagName),e);return t||(r.flags|=4),r}}class Qo extends $n{constructor(e,t){super(e,t.length),this.text=t}sync(e){this.flags&2||(super.sync(e),this.dom.nodeValue!=this.text&&(e&&e.node==this.dom&&(e.written=!0),this.dom.nodeValue=this.text))}isText(){return!0}toString(){return JSON.stringify(this.text)}coordsIn(e,t){let r=this.dom.nodeValue.length;e>r&&(e=r);let i=e,s=e,o=0;e==0&&t<0||e==r&&t>=0?Le.chrome||Le.gecko||(e?(i--,o=1):s<r&&(s++,o=-1)):t<0?i--:s<r&&s++;let a=Sc(this.dom,i,s).getClientRects();if(!a.length)return null;let l=a[(o?o<0:t>=0)?0:a.length-1];return Le.safari&&!o&&l.width==0&&(l=Array.prototype.find.call(a,c=>c.width)||l),o?Ff(l,o<0):l||null}static of(e,t){let r=new Qo(t||document.createTextNode(e),e);return t||(r.flags|=2),r}}class Uo extends $n{constructor(e,t,r,i){super(e,t,i),this.widget=r}isWidget(){return!0}get isHidden(){return this.widget.isHidden}covers(e){return this.flags&48?!1:(this.flags&(e<0?64:128))>0}coordsIn(e,t){return this.coordsInWidget(e,t,!1)}coordsInWidget(e,t,r){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;if(r)return Ff(this.dom.getBoundingClientRect(),this.length?e==0:t<=0);{let s=this.dom.getClientRects(),o=null;if(!s.length)return null;let a=this.flags&16?!0:this.flags&32?!1:e>0;for(let l=a?s.length-1:0;o=s[l],!(e>0?l==0:l==s.length-1||o.top<o.bottom);l+=a?-1:1);return Ff(o,!a)}}get overrideDOMText(){if(!this.length)return Nt.empty;let{root:e}=this;if(!e)return Nt.empty;let t=this.posAtStart;return e.view.state.doc.slice(t,t+this.length)}destroy(){super.destroy(),this.widget.destroy(this.dom)}static of(e,t,r,i,s){return s||(s=e.toDOM(t),e.editable||(s.contentEditable="false")),new Uo(s,r,e,i)}}class Vf extends $n{constructor(e){let t=document.createElement("img");t.className="cm-widgetBuffer",t.setAttribute("aria-hidden","true"),super(t,0,e)}get isHidden(){return!0}get overrideDOMText(){return Nt.empty}coordsIn(e){return this.dom.getBoundingClientRect()}}class vL{constructor(e){this.index=0,this.beforeBreak=!1,this.parents=[],this.tile=e}advance(e,t,r){let{tile:i,index:s,beforeBreak:o,parents:a}=this;for(;e||t>0;)if(i.isComposite())if(o){if(!e)break;r&&r.break(),e--,o=!1}else if(s==i.children.length){if(!e&&!a.length)break;r&&r.leave(i),o=!!i.breakAfter,{tile:i,index:s}=a.pop(),s++}else{let l=i.children[s],c=l.breakAfter;(t>0?l.length<=e:l.length<e)&&(!r||r.skip(l,0,l.length)!==!1||!l.isComposite)?(o=!!c,s++,e-=l.length):(a.push({tile:i,index:s}),i=l,s=0,r&&l.isComposite()&&r.enter(l))}else if(s==i.length)o=!!i.breakAfter,{tile:i,index:s}=a.pop(),s++;else if(e){let l=Math.min(e,i.length-s);r&&r.skip(i,s,s+l),e-=l,s+=l}else break;return this.tile=i,this.index=s,this.beforeBreak=o,this}get root(){return this.parents.length?this.parents[0].tile:this.tile}}class OL{constructor(e,t,r,i){this.from=e,this.to=t,this.wrapper=r,this.rank=i}}class bL{constructor(e,t,r){this.cache=e,this.root=t,this.blockWrappers=r,this.curLine=null,this.lastBlock=null,this.afterWidget=null,this.pos=0,this.wrappers=[],this.wrapperPos=0}addText(e,t,r,i){var s;this.flushBuffer();let o=this.ensureMarks(t,r),a=o.lastChild;if(a&&a.isText()&&!(a.flags&8)&&a.length+e.length<512){this.cache.reused.set(a,2);let l=o.children[o.children.length-1]=new Qo(a.dom,a.text+e);l.parent=o}else o.append(i||Qo.of(e,(s=this.cache.find(Qo))===null||s===void 0?void 0:s.dom));this.pos+=e.length,this.afterWidget=null}addComposition(e,t){let r=this.curLine;r.dom!=t.line.dom&&(r.setDOM(this.cache.reused.has(t.line)?zh(t.line.dom):t.line.dom),this.cache.reused.set(t.line,2));let i=r;for(let a=t.marks.length-1;a>=0;a--){let l=t.marks[a],c=i.lastChild;if(c instanceof Ar&&c.mark.eq(l.mark))c.dom!=l.dom&&c.setDOM(zh(l.dom)),i=c;else{if(this.cache.reused.get(l)){let f=$n.get(l.dom);f&&f.setDOM(zh(l.dom))}let u=Ar.of(l.mark,l.dom);i.append(u),i=u}this.cache.reused.set(l,2)}let s=$n.get(e.text);s&&this.cache.reused.set(s,2);let o=new Qo(e.text,e.text.nodeValue);o.flags|=8,i.append(o)}addInlineWidget(e,t,r){let i=this.afterWidget&&e.flags&48&&(this.afterWidget.flags&48)==(e.flags&48);i||this.flushBuffer();let s=this.ensureMarks(t,r);!i&&!(e.flags&16)&&s.append(this.getBuffer(1)),s.append(e),this.pos+=e.length,this.afterWidget=e}addMark(e,t,r){this.flushBuffer(),this.ensureMarks(t,r).append(e),this.pos+=e.length,this.afterWidget=null}addBlockWidget(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}continueWidget(e){let t=this.afterWidget||this.lastBlock;t.length+=e,this.pos+=e}addLineStart(e,t){var r;e||(e=B2);let i=Ga.start(e,t||((r=this.cache.find(Ga))===null||r===void 0?void 0:r.dom),!!t);this.getBlockPos().append(this.lastBlock=this.curLine=i)}addLine(e){this.getBlockPos().append(e),this.pos+=e.length,this.lastBlock=e,this.endLine()}addBreak(){this.lastBlock.flags|=1,this.endLine(),this.pos++}addLineStartIfNotCovered(e){this.blockPosCovered()||this.addLineStart(e)}ensureLine(e){this.curLine||this.addLineStart(e)}ensureMarks(e,t){var r;let i=this.curLine;for(let s=e.length-1;s>=0;s--){let o=e[s],a;if(t>0&&(a=i.lastChild)&&a instanceof Ar&&a.mark.eq(o))i=a,t--;else{let l=Ar.of(o,(r=this.cache.find(Ar,c=>c.mark.eq(o)))===null||r===void 0?void 0:r.dom);i.append(l),i=l,t=0}}return i}endLine(){if(this.curLine){this.flushBuffer();let e=this.curLine.lastChild;(!e||!vy(this.curLine,!1)||e.dom.nodeName!="BR"&&e.isWidget()&&!(Le.ios&&vy(this.curLine,!0)))&&this.curLine.append(this.cache.findWidget(Zh,0,32)||new Uo(Zh.toDOM(),0,Zh,32)),this.curLine=this.afterWidget=null}}updateBlockWrappers(){this.wrapperPos>this.pos+1e4&&(this.blockWrappers.goto(this.pos),this.wrappers.length=0);for(let e=this.wrappers.length-1;e>=0;e--)this.wrappers[e].to<this.pos&&this.wrappers.splice(e,1);for(let e=this.blockWrappers;e.value&&e.from<=this.pos;e.next())if(e.to>=this.pos){let t=new OL(e.from,e.to,e.value,e.rank),r=this.wrappers.length;for(;r>0&&(this.wrappers[r-1].rank-t.rank||this.wrappers[r-1].to-t.to)<0;)r--;this.wrappers.splice(r,0,t)}this.wrapperPos=this.pos}getBlockPos(){var e;this.updateBlockWrappers();let t=this.root;for(let r of this.wrappers){let i=t.lastChild;if(r.from<this.pos&&i instanceof Gs&&i.wrapper.eq(r.wrapper))t=i;else{let s=Gs.of(r.wrapper,(e=this.cache.find(Gs,o=>o.wrapper.eq(r.wrapper)))===null||e===void 0?void 0:e.dom);t.append(s),t=s}}return t}blockPosCovered(){let e=this.lastBlock;return e!=null&&!e.breakAfter&&(!e.isWidget()||(e.flags&160)>0)}getBuffer(e){let t=2|(e<0?16:32),r=this.cache.find(Vf,void 0,1);return r&&(r.flags=t),r||new Vf(t)}flushBuffer(){this.afterWidget&&!(this.afterWidget.flags&32)&&(this.afterWidget.parent.append(this.getBuffer(-1)),this.afterWidget=null)}}class yL{constructor(e){this.skipCount=0,this.text="",this.textOff=0,this.cursor=e.iter()}skip(e){this.textOff+e<=this.text.length?this.textOff+=e:(this.skipCount+=e-(this.text.length-this.textOff),this.text="",this.textOff=0)}next(e){if(this.textOff==this.text.length){let{value:i,lineBreak:s,done:o}=this.cursor.next(this.skipCount);if(this.skipCount=0,o)throw new Error("Ran out of text content when drawing inline views");this.text=i;let a=this.textOff=Math.min(e,i.length);return s?null:i.slice(0,a)}let t=Math.min(this.text.length,this.textOff+e),r=this.text.slice(this.textOff,t);return this.textOff=t,r}}const Wf=[Uo,Ga,Qo,Ar,Vf,Gs,eh];for(let n=0;n<Wf.length;n++)Wf[n].bucket=n;class wL{constructor(e){this.view=e,this.buckets=Wf.map(()=>[]),this.index=Wf.map(()=>0),this.reused=new Map}add(e){let t=e.constructor.bucket,r=this.buckets[t];r.length<6?r.push(e):r[this.index[t]=(this.index[t]+1)%6]=e}find(e,t,r=2){let i=e.bucket,s=this.buckets[i],o=this.index[i];for(let a=s.length-1;a>=0;a--){let l=(a+o)%s.length,c=s[l];if((!t||t(c))&&!this.reused.has(c))return s.splice(l,1),l<o&&this.index[i]--,this.reused.set(c,r),c}return null}findWidget(e,t,r){let i=this.buckets[0];if(i.length)for(let s=0,o=0;;s++){if(s==i.length){if(o)return null;o=1,s=0}let a=i[s];if(!this.reused.has(a)&&(o==0?a.widget.compare(e):a.widget.constructor==e.constructor&&e.updateDOM(a.dom,this.view)))return i.splice(s,1),s<this.index[0]&&this.index[0]--,a.widget==e&&a.length==t&&(a.flags&497)==r?(this.reused.set(a,1),a):(this.reused.set(a,2),new Uo(a.dom,t,e,a.flags&-498|r))}}reuse(e){return this.reused.set(e,1),e}maybeReuse(e,t=2){if(!this.reused.has(e))return this.reused.set(e,t),e.dom}clear(){for(let e=0;e<this.buckets.length;e++)this.buckets[e].length=this.index[e]=0}}class _L{constructor(e,t,r,i,s){this.view=e,this.decorations=i,this.disallowBlockEffectsFor=s,this.openWidget=!1,this.openMarks=0,this.cache=new wL(e),this.text=new yL(e.state.doc),this.builder=new bL(this.cache,new eh(e,e.contentDOM),$t.iter(r)),this.cache.reused.set(t,2),this.old=new vL(t),this.reuseWalker={skip:(o,a,l)=>{if(this.cache.add(o),o.isComposite())return!1},enter:o=>this.cache.add(o),leave:()=>{},break:()=>{}}}run(e,t){let r=t&&this.getCompositionContext(t.text);for(let i=0,s=0,o=0;;){let a=o<e.length?e[o++]:null,l=a?a.fromA:this.old.root.length;if(l>i){let c=l-i;this.preserve(c,!o,!a),i=l,s+=c}if(!a)break;t&&a.fromA<=t.range.fromA&&a.toA>=t.range.toA?(this.forward(a.fromA,t.range.fromA,t.range.fromA<t.range.toA?1:-1),this.emit(s,t.range.fromB),this.cache.clear(),this.builder.addComposition(t,r),this.text.skip(t.range.toB-t.range.fromB),this.forward(t.range.fromA,a.toA),this.emit(t.range.toB,a.toB)):(this.forward(a.fromA,a.toA),this.emit(s,a.toB)),s=a.toB,i=a.toA}return this.builder.curLine&&this.builder.endLine(),this.builder.root}preserve(e,t,r){let i=SL(this.old),s=this.openMarks;this.old.advance(e,r?1:-1,{skip:(o,a,l)=>{if(o.isWidget())if(this.openWidget)this.builder.continueWidget(l-a);else{let c=l>0||a<o.length?Uo.of(o.widget,this.view,l-a,o.flags&496,this.cache.maybeReuse(o)):this.cache.reuse(o);c.flags&256?(c.flags&=-2,this.builder.addBlockWidget(c)):(this.builder.ensureLine(null),this.builder.addInlineWidget(c,i,s),s=i.length)}else if(o.isText())this.builder.ensureLine(null),!a&&l==o.length?this.builder.addText(o.text,i,s,this.cache.reuse(o)):(this.cache.add(o),this.builder.addText(o.text.slice(a,l),i,s)),s=i.length;else if(o.isLine())o.flags&=-2,this.cache.reused.set(o,1),this.builder.addLine(o);else if(o instanceof Vf)this.cache.add(o);else if(o instanceof Ar)this.builder.ensureLine(null),this.builder.addMark(o,i,s),this.cache.reused.set(o,1),s=i.length;else return!1;this.openWidget=!1},enter:o=>{o.isLine()?this.builder.addLineStart(o.attrs,this.cache.maybeReuse(o)):(this.cache.add(o),o instanceof Ar&&i.unshift(o.mark)),this.openWidget=!1},leave:o=>{o.isLine()?i.length&&(i.length=s=0):o instanceof Ar&&(i.shift(),s=Math.min(s,i.length))},break:()=>{this.builder.addBreak(),this.openWidget=!1}}),this.text.skip(e)}emit(e,t){let r=null,i=this.builder,s=0,o=$t.spans(this.decorations,e,t,{point:(a,l,c,u,f,d)=>{if(c instanceof Wo){if(this.disallowBlockEffectsFor[d]){if(c.block)throw new RangeError("Block decorations may not be specified via plugins");if(l>this.view.state.doc.lineAt(a).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}if(s=u.length,f>u.length)i.continueWidget(l-a);else{let h=c.widget||(c.block?Ha.block:Ha.inline),m=kL(c),p=this.cache.findWidget(h,l-a,m)||Uo.of(h,this.view,l-a,m);c.block?(c.startSide>0&&i.addLineStartIfNotCovered(r),i.addBlockWidget(p)):(i.ensureLine(r),i.addInlineWidget(p,u,f))}r=null}else r=xL(r,c);l>a&&this.text.skip(l-a)},span:(a,l,c,u)=>{for(let f=a;f<l;){let d=this.text.next(Math.min(512,l-f));d==null?(i.addLineStartIfNotCovered(r),i.addBreak(),f++):(i.ensureLine(r),i.addText(d,c,f==a?u:c.length),f+=d.length),r=null}}});i.addLineStartIfNotCovered(r),this.openWidget=o>s,this.openMarks=o}forward(e,t,r=1){t-e<=10?this.old.advance(t-e,r,this.reuseWalker):(this.old.advance(5,-1,this.reuseWalker),this.old.advance(t-e-10,-1),this.old.advance(5,r,this.reuseWalker))}getCompositionContext(e){let t=[],r=null;for(let i=e.parentNode;;i=i.parentNode){let s=$n.get(i);if(i==this.view.contentDOM)break;s instanceof Ar?t.push(s):s?.isLine()?r=s:i.nodeName=="DIV"&&!r&&i!=this.view.contentDOM?r=new Ga(i,B2):t.push(Ar.of(new ou({tagName:i.nodeName.toLowerCase(),attributes:U5(i)}),i))}return{line:r,marks:t}}}function vy(n,e){let t=r=>{for(let i of r.children)if((e?i.isText():i.length)||t(i))return!0;return!1};return t(n)}function kL(n){let e=n.isReplace?(n.startSide<0?64:0)|(n.endSide>0?128:0):n.startSide>0?32:16;return n.block&&(e|=256),e}const B2={class:"cm-line"};function xL(n,e){let t=e.spec.attributes,r=e.spec.class;return!t&&!r||(n||(n={class:"cm-line"}),t&&zv(t,n),r&&(n.class+=" "+r)),n}function SL(n){let e=[];for(let t=n.parents.length;t>1;t--){let r=t==n.parents.length?n.tile:n.parents[t].tile;r instanceof Ar&&e.push(r.mark)}return e}function zh(n){let e=$n.get(n);return e&&e.setDOM(n.cloneNode()),n}class Ha extends su{constructor(e){super(),this.tag=e}eq(e){return e.tag==this.tag}toDOM(){return document.createElement(this.tag)}updateDOM(e){return e.nodeName.toLowerCase()==this.tag}get isHidden(){return!0}}Ha.inline=new Ha("span");Ha.block=new Ha("div");const Zh=new class extends su{toDOM(){return document.createElement("br")}get isHidden(){return!0}get editable(){return!0}};class Oy{constructor(e){this.view=e,this.decorations=[],this.blockWrappers=[],this.dynamicDecorationMap=[!1],this.domChanged=null,this.hasComposition=null,this.editContextFormatting=ft.none,this.lastCompositionAfterCursor=!1,this.minWidth=0,this.minWidthFrom=0,this.minWidthTo=0,this.impreciseAnchor=null,this.impreciseHead=null,this.forceSelection=!1,this.lastUpdate=Date.now(),this.updateDeco(),this.tile=new eh(e,e.contentDOM),this.updateInner([new Jr(0,0,0,e.state.doc.length)],null)}update(e){var t;let r=e.changedRanges;this.minWidth>0&&r.length&&(r.every(({fromA:u,toA:f})=>f<this.minWidthFrom||u>this.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0),this.updateEditContextFormatting(e);let i=-1;this.view.inputState.composing>=0&&!this.view.observer.editContext&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?i=this.domChanged.newSel.head:!ML(e.changes,this.hasComposition)&&!e.selectionSet&&(i=e.state.selection.main.head));let s=i>-1?CL(this.view,e.changes,i):null;if(this.domChanged=null,this.hasComposition){let{from:u,to:f}=this.hasComposition;r=new Jr(u,f,e.changes.mapPos(u,-1),e.changes.mapPos(f,1)).addToSet(r.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(Le.ie||Le.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let o=this.decorations,a=this.blockWrappers;this.updateDeco();let l=EL(o,this.decorations,e.changes);l.length&&(r=Jr.extendWithRanges(r,l));let c=QL(a,this.blockWrappers,e.changes);return c.length&&(r=Jr.extendWithRanges(r,c)),s&&!r.some(u=>u.fromA<=s.range.fromA&&u.toA>=s.range.toA)&&(r=s.range.addToSet(r.slice())),this.tile.flags&2&&r.length==0?!1:(this.updateInner(r,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t){this.view.viewState.mustMeasureContent=!0;let{observer:r}=this.view;r.ignore(()=>{if(t||e.length){let o=this.tile,a=new _L(this.view,o,this.blockWrappers,this.decorations,this.dynamicDecorationMap);this.tile=a.run(e,t),Nm(o,a.cache.reused)}this.tile.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.tile.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let s=Le.chrome||Le.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.tile.sync(s),s&&(s.written||r.selectionRange.focusNode!=s.node||!this.tile.dom.contains(s.node))&&(this.forceSelection=!0),this.tile.dom.style.height=""});let i=[];if(this.view.viewport.from||this.view.viewport.to<this.view.state.doc.length)for(let s of this.tile.children)s.isWidget()&&s.widget instanceof Fh&&i.push(s.dom);r.updateGaps(i)}updateEditContextFormatting(e){this.editContextFormatting=this.editContextFormatting.map(e.changes);for(let t of e.transactions)for(let r of t.effects)r.is(q2)&&(this.editContextFormatting=r.value)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let{dom:r}=this.tile,i=this.view.root.activeElement,s=i==r,o=!s&&!(this.view.state.facet(hs)||r.tabIndex>-1)&&ac(r,this.view.observer.selectionRange)&&!(i&&r.contains(i));if(!(s||t||o))return;let a=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,c,u;if(l.empty?u=c=this.inlineDOMNearPos(l.anchor,l.assoc||1):(u=this.inlineDOMNearPos(l.head,l.head==l.from?1:-1),c=this.inlineDOMNearPos(l.anchor,l.anchor==l.from?1:-1)),Le.gecko&&l.empty&&!this.hasComposition&&AL(c)){let d=document.createTextNode("");this.view.observer.ignore(()=>c.node.insertBefore(d,c.node.childNodes[c.offset]||null)),c=u=new xi(d,0),a=!0}let f=this.view.observer.selectionRange;(a||!f.focusNode||(!lc(c.node,c.offset,f.anchorNode,f.anchorOffset)||!lc(u.node,u.offset,f.focusNode,f.focusOffset))&&!this.suppressWidgetCursorChange(f,l))&&(this.view.observer.ignore(()=>{Le.android&&Le.chrome&&r.contains(f.focusNode)&&LL(f.focusNode,r)&&(r.blur(),r.focus({preventScroll:!0}));let d=xc(this.view.root);if(d)if(l.empty){if(Le.gecko){let h=TL(c.node,c.offset);if(h&&h!=3){let m=(h==1?y2:w2)(c.node,c.offset);m&&(c=new xi(m.node,m.offset))}}d.collapse(c.node,c.offset),l.bidiLevel!=null&&d.caretBidiLevel!==void 0&&(d.caretBidiLevel=l.bidiLevel)}else if(d.extend){d.collapse(c.node,c.offset);try{d.extend(u.node,u.offset)}catch{}}else{let h=document.createRange();l.anchor>l.head&&([c,u]=[u,c]),h.setEnd(u.node,u.offset),h.setStart(c.node,c.offset),d.removeAllRanges(),d.addRange(h)}o&&this.view.root.activeElement==r&&(r.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(c,u)),this.impreciseAnchor=c.precise?null:new xi(f.anchorNode,f.anchorOffset),this.impreciseHead=u.precise?null:new xi(f.focusNode,f.focusOffset)}suppressWidgetCursorChange(e,t){return this.hasComposition&&t.empty&&lc(e.focusNode,e.focusOffset,e.anchorNode,e.anchorOffset)&&this.posFromDOM(e.focusNode,e.focusOffset)==t.head}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,r=xc(e.root),{anchorNode:i,anchorOffset:s}=e.observer.selectionRange;if(!r||!t.empty||!t.assoc||!r.modify)return;let o=this.lineAt(t.head,t.assoc);if(!o)return;let a=o.posAtStart;if(t.head==a||t.head==a+o.length)return;let l=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!l||!c||l.bottom>c.top)return;let u=this.domAtPos(t.head+t.assoc,t.assoc);r.collapse(u.node,u.offset),r.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let f=e.observer.selectionRange;e.docView.posFromDOM(f.anchorNode,f.anchorOffset)!=t.from&&r.collapse(i,s)}posFromDOM(e,t){let r=this.tile.nearest(e);if(!r)return this.tile.dom.compareDocumentPosition(e)&2?0:this.view.state.doc.length;let i=r.posAtStart;if(r.isComposite()){let s;if(e==r.dom)s=r.dom.childNodes[t];else{let o=Ss(e)==0?0:t==0?-1:1;for(;;){let a=e.parentNode;if(a==r.dom)break;o==0&&a.firstChild!=a.lastChild&&(e==a.firstChild?o=-1:o=1),e=a}o<0?s=e:s=e.nextSibling}if(s==r.dom.firstChild)return i;for(;s&&!$n.get(s);)s=s.nextSibling;if(!s)return i+r.length;for(let o=0,a=i;;o++){let l=r.children[o];if(l.dom==s)return a;a+=l.length+l.breakAfter}}else return r.isText()?e==r.dom?i+t:i+(t?r.length:0):i}domAtPos(e,t){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.domPosFor(e,t):r.domIn(i,t)}inlineDOMNearPos(e,t){let r,i=-1,s=!1,o,a=-1,l=!1;return this.tile.blockTiles((c,u)=>{if(c.isWidget()){if(c.flags&32&&u>=e)return!0;c.flags&16&&(s=!0)}else{let f=u+c.length;if(u<=e&&(r=c,i=e-u,s=f<e),f>=e&&!o&&(o=c,a=e-u,l=u>e),u>e&&o)return!0}}),!r&&!o?this.domAtPos(e,t):(s&&o?r=null:l&&r&&(o=null),r&&t<0||!o?r.domIn(i,t):o.domIn(a,t))}coordsAt(e,t){let{tile:r,offset:i}=this.tile.resolveBlock(e,t);return r.isWidget()?r.widget instanceof Fh?null:r.coordsInWidget(i,t,!0):r.coordsIn(i,t)}lineAt(e,t){let{tile:r}=this.tile.resolveBlock(e,t);return r.isLine()?r:null}coordsForChar(e){let{tile:t,offset:r}=this.tile.resolveBlock(e,1);if(!t.isLine())return null;function i(s,o){if(s.isComposite())for(let a of s.children){if(a.length>=o){let l=i(a,o);if(l)return l}if(o-=a.length,o<0)break}else if(s.isText()&&o<s.length){let a=Fn(s.text,o);if(a==o)return null;let l=Sc(s.dom,o,a).getClientRects();for(let c=0;c<l.length;c++){let u=l[c];if(c==l.length-1||u.top<u.bottom&&u.left<u.right)return u}}return null}return i(t,r)}measureVisibleLineHeights(e){let t=[],{from:r,to:i}=e,s=this.view.contentDOM.clientWidth,o=s>Math.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,a=-1,l=this.view.textDirection==bn.LTR,c=0,u=(f,d,h)=>{for(let m=0;m<f.children.length&&!(d>i);m++){let p=f.children[m],v=d+p.length,O=p.dom.getBoundingClientRect(),{height:b}=O;if(h&&!m&&(c+=O.top-h.top),p instanceof Gs)v>r&&u(p,d,O);else if(d>=r&&(c>0&&t.push(-c),t.push(b+c),c=0,o)){let w=p.dom.lastChild,S=w?vf(w):[];if(S.length){let _=S[S.length-1],x=l?_.right-O.left:O.right-_.left;x>a&&(a=x,this.minWidth=s,this.minWidthFrom=d,this.minWidthTo=v)}}h&&m==f.children.length-1&&(c+=h.bottom-O.bottom),d=v+p.breakAfter}};return u(this.tile,0,null),t}textDirectionAt(e){let{tile:t}=this.tile.resolveBlock(e,1);return getComputedStyle(t.dom).direction=="rtl"?bn.RTL:bn.LTR}measureTextSize(){let e=this.tile.blockTiles(o=>{if(o.isLine()&&o.children.length&&o.length<=20){let a=0,l;for(let c of o.children){if(!c.isText()||/[^ -~]/.test(c.text))return;let u=vf(c.dom);if(u.length!=1)return;a+=u[0].width,l=u[0].height}if(a)return{lineHeight:o.dom.getBoundingClientRect().height,charWidth:a/o.length,textHeight:l}}});if(e)return e;let t=document.createElement("div"),r,i,s;return t.className="cm-line",t.style.width="99999px",t.style.position="absolute",t.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.tile.dom.appendChild(t);let o=vf(t.firstChild)[0];r=t.getBoundingClientRect().height,i=o&&o.width?o.width/27:7,s=o&&o.height?o.height:r,t.remove()}),{lineHeight:r,charWidth:i,textHeight:s}}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let r=0,i=0;;i++){let s=i==t.viewports.length?null:t.viewports[i],o=s?s.from-1:this.view.state.doc.length;if(o>r){let a=(t.lineBlockAt(o).bottom-t.lineBlockAt(r).top)/this.view.scaleY;e.push(ft.replace({widget:new Fh(a),block:!0,inclusive:!0,isBlockGap:!0}).range(r,o))}if(!s)break;r=s.to+1}return ft.set(e)}updateDeco(){let e=1,t=this.view.state.facet(Kd).map(s=>(this.dynamicDecorationMap[e++]=typeof s=="function")?s(this.view):s),r=!1,i=this.view.state.facet(Yv).map((s,o)=>{let a=typeof s=="function";return a&&(r=!0),a?s(this.view):s});for(i.length&&(this.dynamicDecorationMap[e++]=r,t.push($t.join(i))),this.decorations=[this.editContextFormatting,...t,this.computeBlockGapDeco(),this.view.viewState.lineGapDeco];e<this.decorations.length;)this.dynamicDecorationMap[e++]=!1;this.blockWrappers=this.view.state.facet(D2).map(s=>typeof s=="function"?s(this.view):s)}scrollIntoView(e){if(e.isSnapshot){let c=this.view.viewState.lineBlockAt(e.range.head);this.view.scrollDOM.scrollTop=c.top-e.yMargin,this.view.scrollDOM.scrollLeft=e.xMargin;return}for(let c of this.view.state.facet(M2))try{if(c(this.view,e.range,e))return!0}catch(u){zr(this.view.state,u,"scroll handler")}let{range:t}=e,r=this.coordsAt(t.head,t.empty?t.assoc:t.head>t.anchor?-1:1),i;if(!r)return;!t.empty&&(i=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(r={left:Math.min(r.left,i.left),top:Math.min(r.top,i.top),right:Math.max(r.right,i.right),bottom:Math.max(r.bottom,i.bottom)});let s=Uv(this.view),o={left:r.left-s.left,top:r.top-s.top,right:r.right+s.right,bottom:r.bottom+s.bottom},{offsetWidth:a,offsetHeight:l}=this.view.scrollDOM;K5(this.view.scrollDOM,o,t.head<t.anchor?-1:1,e.x,e.y,Math.max(Math.min(e.xMargin,a),-a),Math.max(Math.min(e.yMargin,l),-l),this.view.textDirection==bn.LTR)}lineHasWidget(e){let t=r=>r.isWidget()||r.children.some(t);return t(this.tile.resolveBlock(e,1).tile)}destroy(){Nm(this.tile)}}function Nm(n,e){let t=e?.get(n);if(t!=1){t==null&&n.destroy();for(let r of n.children)Nm(r,e)}}function AL(n){return n.node.nodeType==1&&n.node.firstChild&&(n.offset==0||n.node.childNodes[n.offset-1].contentEditable=="false")&&(n.offset==n.node.childNodes.length||n.node.childNodes[n.offset].contentEditable=="false")}function j2(n,e){let t=n.observer.selectionRange;if(!t.focusNode)return null;let r=y2(t.focusNode,t.focusOffset),i=w2(t.focusNode,t.focusOffset),s=r||i;if(i&&r&&i.node!=r.node){let a=$n.get(i.node);if(!a||a.isText()&&a.text!=i.node.nodeValue)s=i;else if(n.docView.lastCompositionAfterCursor){let l=$n.get(r.node);!l||l.isText()&&l.text!=r.node.nodeValue||(s=i)}}if(n.docView.lastCompositionAfterCursor=s!=r,!s)return null;let o=e-s.offset;return{from:o,to:o+s.node.nodeValue.length,node:s.node}}function CL(n,e,t){let r=j2(n,t);if(!r)return null;let{node:i,from:s,to:o}=r,a=i.nodeValue;if(/[\n\r]/.test(a)||n.state.doc.sliceString(r.from,r.to)!=a)return null;let l=e.invertedDesc;return{range:new Jr(l.mapPos(s),l.mapPos(o),s,o),text:i}}function TL(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e<n.childNodes.length&&n.childNodes[e].contentEditable=="false"?2:0)}let PL=class{constructor(){this.changes=[]}compareRange(e,t){qa(e,t,this.changes)}comparePoint(e,t){qa(e,t,this.changes)}boundChange(e){qa(e,e,this.changes)}};function EL(n,e,t){let r=new PL;return $t.compare(n,e,t,r),r.changes}class $L{constructor(){this.changes=[]}compareRange(e,t){qa(e,t,this.changes)}comparePoint(){}boundChange(e){qa(e,e,this.changes)}}function QL(n,e,t){let r=new $L;return $t.compare(n,e,t,r),r.changes}function LL(n,e){for(let t=n;t&&t!=e;t=t.assignedSlot||t.parentNode)if(t.nodeType==1&&t.contentEditable=="false")return!0;return!1}function ML(n,e){let t=!1;return e&&n.iterChangedRanges((r,i)=>{r<e.to&&i>e.from&&(t=!0)}),t}class Fh extends su{constructor(e){super(),this.height=e}toDOM(){let e=document.createElement("div");return e.className="cm-gap",this.updateDOM(e),e}eq(e){return e.height==this.height}updateDOM(e){return e.style.height=this.height+"px",!0}get editable(){return!0}get estimatedHeight(){return this.height}ignoreEvent(){return!1}}function qL(n,e,t=1){let r=n.charCategorizer(e),i=n.doc.lineAt(e),s=e-i.from;if(i.length==0)return me.cursor(e);s==0?t=1:s==i.length&&(t=-1);let o=s,a=s;t<0?o=Fn(i.text,s,!1):a=Fn(i.text,s);let l=r(i.text.slice(o,a));for(;o>0;){let c=Fn(i.text,o,!1);if(r(i.text.slice(c,o))!=l)break;o=c}for(;a<i.length;){let c=Fn(i.text,a);if(r(i.text.slice(a,c))!=l)break;a=c}return me.range(o+i.from,a+i.from)}function RL(n,e,t,r,i){let s=Math.round((r-e.left)*n.defaultCharacterWidth);if(n.lineWrapping&&t.height>n.defaultLineHeight*1.5){let a=n.viewState.heightOracle.textHeight,l=Math.floor((i-t.top-(n.defaultLineHeight-a)*.5)/a);s+=l*n.viewState.heightOracle.lineLength}let o=n.state.sliceDoc(t.from,t.to);return t.from+z5(o,s,n.state.tabSize)}function DL(n,e,t){let r=n.lineBlockAt(e);if(Array.isArray(r.type)){let i;for(let s of r.type){if(s.from>e)break;if(!(s.to<e)){if(s.from<e&&s.to>e)return s;(!i||s.type==$r.Text&&(i.type!=s.type||(t<0?s.from<e:s.to>e)))&&(i=s)}}return i||r}return r}function IL(n,e,t,r){let i=DL(n,e.head,e.assoc||-1),s=!r||i.type!=$r.Text||!(n.lineWrapping||i.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>i.from?e.head-1:e.head);if(s){let o=n.dom.getBoundingClientRect(),a=n.textDirectionAt(i.from),l=n.posAtCoords({x:t==(a==bn.LTR)?o.right-1:o.left+1,y:(s.top+s.bottom)/2});if(l!=null)return me.cursor(l,t?-1:1)}return me.cursor(t?i.to:i.from,t?-1:1)}function by(n,e,t,r){let i=n.state.doc.lineAt(e.head),s=n.bidiSpans(i),o=n.textDirectionAt(i.from);for(let a=e,l=null;;){let c=uL(i,s,o,a,t),u=A2;if(!c){if(i.number==(t?n.state.doc.lines:1))return a;u=`
|
|
151
|
-
`,i=n.state.doc.line(i.number+(t?1:-1)),s=n.bidiSpans(i),c=n.visualLineSide(i,!t)}if(l){if(!l(u))return a}else{if(!r)return c;l=r(u)}a=c}}function NL(n,e,t){let r=n.state.charCategorizer(e),i=r(t);return s=>{let o=r(s);return i==Tn.Space&&(i=o),i==o}}function BL(n,e,t,r){let i=e.head,s=t?1:-1;if(i==(t?n.state.doc.length:0))return me.cursor(i,e.assoc);let o=e.goalColumn,a,l=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(i,(e.empty?e.assoc:0)||(t?1:-1)),u=n.documentTop;if(c)o==null&&(o=c.left-l.left),a=s<0?c.top:c.bottom;else{let m=n.viewState.lineBlockAt(i);o==null&&(o=Math.min(l.right-l.left,n.defaultCharacterWidth*(i-m.from))),a=(s<0?m.top:m.bottom)+u}let f=l.left+o,d=r??n.viewState.heightOracle.textHeight>>1,h=Bm(n,{x:f,y:a+d*s},!1,s);return me.cursor(h.pos,h.assoc,void 0,o)}function cc(n,e,t){for(;;){let r=0;for(let i of n)i.between(e-1,e+1,(s,o,a)=>{if(e>s&&e<o){let l=r||t||(e-s<o-e?-1:1);e=l<0?s:o,r=l}});if(!r)return e}}function z2(n,e){let t=null;for(let r=0;r<e.ranges.length;r++){let i=e.ranges[r],s=null;if(i.empty){let o=cc(n,i.from,0);o!=i.from&&(s=me.cursor(o,-1))}else{let o=cc(n,i.from,-1),a=cc(n,i.to,1);(o!=i.from||a!=i.to)&&(s=me.range(i.from==i.anchor?o:a,i.from==i.head?o:a))}s&&(t||(t=e.ranges.slice()),t[r]=s)}return t?me.create(t,e.mainIndex):e}function Xh(n,e,t){let r=cc(n.state.facet(lu).map(i=>i(n)),t.from,e.head>t.from?-1:1);return r==t.from?t:me.cursor(r,r<t.from?1:-1)}class Xi{constructor(e,t){this.pos=e,this.assoc=t}}function Bm(n,e,t,r){let i=n.contentDOM.getBoundingClientRect(),s=i.top+n.viewState.paddingTop,{x:o,y:a}=e,l=a-s,c;for(;;){if(l<0)return new Xi(0,1);if(l>n.viewState.docHeight)return new Xi(n.state.doc.length,-1);if(c=n.elementAtHeight(l),r==null)break;if(c.type==$r.Text){if(r<0?c.to<n.viewport.from:c.from>n.viewport.to)break;let d=n.docView.coordsAt(r<0?c.from:c.to,r>0?-1:1);if(d&&(r<0?d.top<=l+s:d.bottom>=l+s))break}let f=n.viewState.heightOracle.textHeight/2;l=r>0?c.bottom+f:c.top-f}if(n.viewport.from>=c.to||n.viewport.to<=c.from){if(t)return null;if(c.type==$r.Text){let f=RL(n,i,c,o,a);return new Xi(f,f==c.from?1:-1)}}if(c.type!=$r.Text)return l<(c.top+c.bottom)/2?new Xi(c.from,1):new Xi(c.to,-1);let u=n.docView.lineAt(c.from,2);return(!u||u.length!=c.length)&&(u=n.docView.lineAt(c.from,-2)),new jL(n,o,a,n.textDirectionAt(c.from)).scanTile(u,c.from)}class jL{constructor(e,t,r,i){this.view=e,this.x=t,this.y=r,this.baseDir=i,this.line=null,this.spans=null}bidiSpansAt(e){return(!this.line||this.line.from>e||this.line.to<e)&&(this.line=this.view.state.doc.lineAt(e),this.spans=this.view.bidiSpans(this.line)),this}baseDirAt(e,t){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Vi.find(i,e-r.from,-1,t)].level==this.baseDir}dirAt(e,t){let{line:r,spans:i}=this.bidiSpansAt(e);return i[Vi.find(i,e-r.from,-1,t)].dir}bidiIn(e,t){let{spans:r,line:i}=this.bidiSpansAt(e);return r.length>1||r.length&&(r[0].level!=this.baseDir||r[0].to+i.from<t)}scan(e,t){let r=0,i=e.length-1,s=new Set,o=this.bidiIn(e[0],e[i]),a,l,c=-1,u=1e9,f;e:for(;r<i;){let h=i-r,m=r+i>>1;t:if(s.has(m)){let v=r+Math.floor(Math.random()*h);for(let O=0;O<h;O++){if(!s.has(v)){m=v;break t}v++,v==i&&(v=r)}break e}s.add(m);let p=t(m);if(p)for(let v=0;v<p.length;v++){let O=p[v],b=0;if(O.bottom<this.y)(!a||a.bottom<O.bottom)&&(a=O),b=1;else if(O.top>this.y)(!l||l.top>O.top)&&(l=O),b=-1;else{let w=O.left>this.x?this.x-O.left:O.right<this.x?this.x-O.right:0,S=Math.abs(w);S<u&&(c=m,u=S,f=O),w&&(b=w<0==(this.baseDir==bn.LTR)?-1:1)}b==-1&&(!o||this.baseDirAt(e[m],1))?i=m:b==1&&(!o||this.baseDirAt(e[m+1],-1))&&(r=m+1)}}if(!f){let h=a&&(!l||this.y-a.bottom<l.top-this.y)?a:l;return this.y=(h.top+h.bottom)/2,this.scan(e,t)}let d=(o?this.dirAt(e[c],1):this.baseDir)==bn.LTR;return{i:c,after:this.x>(f.left+f.right)/2==d}}scanText(e,t){let r=[];for(let s=0;s<e.length;s=Fn(e.text,s))r.push(t+s);r.push(t+e.length);let i=this.scan(r,s=>{let o=r[s]-t,a=r[s+1]-t;return Sc(e.dom,o,a).getClientRects()});return i.after?new Xi(r[i.i+1],-1):new Xi(r[i.i],1)}scanTile(e,t){if(!e.length)return new Xi(t,1);if(e.children.length==1){let a=e.children[0];if(a.isText())return this.scanText(a,t);if(a.isComposite())return this.scanTile(a,t)}let r=[t];for(let a=0,l=t;a<e.children.length;a++)r.push(l+=e.children[a].length);let i=this.scan(r,a=>{let l=e.children[a];return l.flags&48?null:(l.dom.nodeType==1?l.dom:Sc(l.dom,0,l.length)).getClientRects()}),s=e.children[i.i],o=r[i.i];return s.isText()?this.scanText(s,o):s.isComposite()?this.scanTile(s,o):i.after?new Xi(r[i.i+1],-1):new Xi(o,1)}}const Gl="";class zL{constructor(e,t){this.points=e,this.view=t,this.text="",this.lineSeparator=t.state.facet(Pt.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Gl}readRange(e,t){if(!e)return this;let r=e.parentNode;for(let i=e;;){this.findPointBefore(r,i);let s=this.text.length;this.readNode(i);let o=$n.get(i),a=i.nextSibling;if(a==t){o?.breakAfter&&!a&&r!=this.view.contentDOM&&this.lineBreak();break}let l=$n.get(a);(o&&l?o.breakAfter:(o?o.breakAfter:Zf(i))||Zf(a)&&(i.nodeName!="BR"||o?.isWidget())&&this.text.length>s)&&!FL(a,t)&&this.lineBreak(),i=a}return this.findPointBefore(r,t),this}readTextNode(e){let t=e.nodeValue;for(let r of this.points)r.node==e&&(r.pos=this.text.length+Math.min(r.offset,t.length));for(let r=0,i=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,o=1,a;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,r),o=this.lineSeparator.length):(a=i.exec(t))&&(s=a.index,o=a[0].length),this.append(t.slice(r,s<0?t.length:s)),s<0)break;if(this.lineBreak(),o>1)for(let l of this.points)l.node==e&&l.pos>this.text.length&&(l.pos-=o-1);r=s+o}}readNode(e){let t=$n.get(e),r=t&&t.overrideDOMText;if(r!=null){this.findPointInside(e,r.length);for(let i=r.iter();!i.next().done;)i.lineBreak?this.lineBreak():this.append(i.value)}else e.nodeType==3?this.readTextNode(e):e.nodeName=="BR"?e.nextSibling&&this.lineBreak():e.nodeType==1&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let r of this.points)r.node==e&&e.childNodes[r.offset]==t&&(r.pos=this.text.length)}findPointInside(e,t){for(let r of this.points)(e.nodeType==3?r.node==e:e.contains(r.node))&&(r.pos=this.text.length+(ZL(e,r.node,r.offset)?t:0))}}function ZL(n,e,t){for(;;){if(!e||t<Ss(e))return!1;if(e==n)return!0;t=ro(e)+1,e=e.parentNode}}function FL(n,e){let t;for(;!(n==e||!n);n=n.nextSibling){let r=$n.get(n);if(!r?.isWidget())return!1;r&&(t||(t=[])).push(r)}if(t)for(let r of t){let i=r.overrideDOMText;if(i?.length)return!1}return!0}class yy{constructor(e,t){this.node=e,this.offset=t,this.pos=-1}}class XL{constructor(e,t,r,i){this.typeOver=i,this.bounds=null,this.text="",this.domChanged=t>-1;let{impreciseHead:s,impreciseAnchor:o}=e.docView;if(e.state.readOnly&&t>-1)this.newSel=null;else if(t>-1&&(this.bounds=Z2(e.docView.tile,t,r,0))){let a=s||o?[]:WL(e),l=new zL(a,e);l.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=l.text,this.newSel=YL(a,this.bounds.from)}else{let a=e.observer.selectionRange,l=s&&s.node==a.focusNode&&s.offset==a.focusOffset||!Mm(e.contentDOM,a.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(a.focusNode,a.focusOffset),c=o&&o.node==a.anchorNode&&o.offset==a.anchorOffset||!Mm(e.contentDOM,a.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(a.anchorNode,a.anchorOffset),u=e.viewport;if((Le.ios||Le.chrome)&&e.state.selection.main.empty&&l!=c&&(u.from>0||u.to<e.state.doc.length)){let f=Math.min(l,c),d=Math.max(l,c),h=u.from-f,m=u.to-d;(h==0||h==1||f==0)&&(m==0||m==-1||d==e.state.doc.length)&&(l=0,c=e.state.doc.length)}e.inputState.composing>-1&&e.state.selection.ranges.length>1?this.newSel=e.state.selection.replaceRange(me.range(c,l)):this.newSel=me.single(c,l)}}}function Z2(n,e,t,r){if(n.isComposite()){let i=-1,s=-1,o=-1,a=-1;for(let l=0,c=r,u=r;l<n.children.length;l++){let f=n.children[l],d=c+f.length;if(c<e&&d>t)return Z2(f,e,t,c);if(d>=e&&i==-1&&(i=l,s=c),c>t&&f.dom.parentNode==n.dom){o=l,a=u;break}u=d,c=d+f.breakAfter}return{from:s,to:a<0?r+n.length:a,startDOM:(i?n.children[i-1].dom.nextSibling:null)||n.dom.firstChild,endDOM:o<n.children.length&&o>=0?n.children[o].dom:null}}else return n.isText()?{from:r,to:r+n.length,startDOM:n.dom,endDOM:n.dom.nextSibling}:null}function F2(n,e){let t,{newSel:r}=e,i=n.state.selection.main,s=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:o,to:a}=e.bounds,l=i.from,c=null;(s===8||Le.android&&e.text.length<a-o)&&(l=i.to,c="end");let u=X2(n.state.doc.sliceString(o,a,Gl),e.text,l-o,c);u&&(Le.chrome&&s==13&&u.toB==u.from+2&&e.text.slice(u.from,u.toB)==Gl+Gl&&u.toB--,t={from:o+u.from,to:o+u.toA,insert:Nt.of(e.text.slice(u.from,u.toB).split(Gl))})}else r&&(!n.hasFocus&&n.state.facet(hs)||Yf(r,i))&&(r=null);if(!t&&!r)return!1;if(!t&&e.typeOver&&!i.empty&&r&&r.main.empty?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,i.to)}:(Le.mac||Le.android)&&t&&t.from==t.to&&t.from==i.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(r&&t.insert.length==2&&(r=me.single(r.main.anchor-1,r.main.head-1)),t={from:t.from,to:t.to,insert:Nt.of([t.insert.toString().replace("."," ")])}):t&&t.from>=i.from&&t.to<=i.to&&(t.from!=i.from||t.to!=i.to)&&i.to-i.from-(t.to-t.from)<=4?t={from:i.from,to:i.to,insert:n.state.doc.slice(i.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,i.to))}:n.state.doc.lineAt(i.from).to<i.to&&n.docView.lineHasWidget(i.to)&&n.inputState.insertingTextAt>Date.now()-50?t={from:i.from,to:i.to,insert:n.state.toText(n.inputState.insertingText)}:Le.chrome&&t&&t.from==t.to&&t.from==i.head&&t.insert.toString()==`
|
|
152
|
-
`&&n.lineWrapping&&(r&&(r=me.single(r.main.anchor-1,r.main.head-1)),t={from:i.from,to:i.to,insert:Nt.of([" "])}),t)return Gv(n,t,r,s);if(r&&!Yf(r,i)){let o=!1,a="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(o=!0),a=n.inputState.lastSelectionOrigin,a=="select.pointer"&&(r=z2(n.state.facet(lu).map(l=>l(n)),r))),n.dispatch({selection:r,scrollIntoView:o,userEvent:a}),!0}else return!1}function Gv(n,e,t,r=-1){if(Le.ios&&n.inputState.flushIOSKey(e))return!0;let i=n.state.selection.main;if(Le.android&&(e.to==i.to&&(e.from==i.from||e.from==i.from-1&&n.state.sliceDoc(e.from,i.from)==" ")&&e.insert.length==1&&e.insert.lines==2&&Ra(n.contentDOM,"Enter",13)||(e.from==i.from-1&&e.to==i.to&&e.insert.length==0||r==8&&e.insert.length<e.to-e.from&&e.to>i.head)&&Ra(n.contentDOM,"Backspace",8)||e.from==i.from&&e.to==i.to+1&&e.insert.length==0&&Ra(n.contentDOM,"Delete",46)))return!0;let s=e.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=VL(n,e,t));return n.state.facet($2).some(l=>l(n,e.from,e.to,s,a))||n.dispatch(a()),!0}function VL(n,e,t){let r,i=n.state,s=i.selection.main,o=-1;if(e.from==e.to&&e.from<s.from||e.from>s.to){let l=e.from<s.from?-1:1,c=l<0?s.from:s.to,u=cc(i.facet(lu).map(f=>f(n)),c,l);e.from==u&&(o=u)}if(o>-1)r={changes:e,selection:me.cursor(e.from+e.insert.length,-1)};else if(e.from>=s.from&&e.to<=s.to&&e.to-e.from>=(s.to-s.from)/3&&(!t||t.main.empty&&t.main.from==e.from+e.insert.length)&&n.inputState.composing<0){let l=s.from<e.from?i.sliceDoc(s.from,e.from):"",c=s.to>e.to?i.sliceDoc(e.to,s.to):"";r=i.replaceSelection(n.state.toText(l+e.insert.sliceString(0,void 0,n.state.lineBreak)+c))}else{let l=i.changes(e),c=t&&t.main.to<=l.newLength?t.main:void 0;if(i.selection.ranges.length>1&&(n.inputState.composing>=0||n.inputState.compositionPendingChange)&&e.to<=s.to+10&&e.to>=s.to-10){let u=n.state.sliceDoc(e.from,e.to),f,d=t&&j2(n,t.main.head);if(d){let m=e.insert.length-(e.to-e.from);f={from:d.from,to:d.to-m}}else f=n.state.doc.lineAt(s.head);let h=s.to-e.to;r=i.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:l,range:c||m.map(l)};let p=m.to-h,v=p-u.length;if(n.state.sliceDoc(v,p)!=u||p>=f.from&&v<=f.to)return{range:m};let O=i.changes({from:v,to:p,insert:e.insert}),b=m.to-s.to;return{changes:O,range:c?me.range(Math.max(0,c.anchor+b),Math.max(0,c.head+b)):m.map(O)}})}else r={changes:l,selection:c&&i.selection.replaceRange(c)}}let a="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,a+=".compose",n.inputState.compositionFirstChange&&(a+=".start",n.inputState.compositionFirstChange=!1)),i.update(r,{userEvent:a,scrollIntoView:!0})}function X2(n,e,t,r){let i=Math.min(n.length,e.length),s=0;for(;s<i&&n.charCodeAt(s)==e.charCodeAt(s);)s++;if(s==i&&n.length==e.length)return null;let o=n.length,a=e.length;for(;o>0&&a>0&&n.charCodeAt(o-1)==e.charCodeAt(a-1);)o--,a--;if(r=="end"){let l=Math.max(0,s-Math.min(o,a));t-=o+l-s}if(o<s&&n.length<e.length){let l=t<=s&&t>=o?s-t:0;s-=l,a=s+(a-o),o=s}else if(a<s){let l=t<=s&&t>=a?s-t:0;s-=l,o=s+(o-a),a=s}return{from:s,toA:o,toB:a}}function WL(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new yy(t,r)),(i!=t||s!=r)&&e.push(new yy(i,s))),e}function YL(n,e){if(n.length==0)return null;let t=n[0].pos,r=n.length==2?n[1].pos:t;return t>-1&&r>-1?me.single(t+e,r+e):null}function Yf(n,e){return e.head==n.main.head&&e.anchor==n.main.anchor}class UL{setSelectionOrigin(e){this.lastSelectionOrigin=e,this.lastSelectionTime=Date.now()}constructor(e){this.view=e,this.lastKeyCode=0,this.lastKeyTime=0,this.lastTouchTime=0,this.lastFocusTime=0,this.lastScrollTop=0,this.lastScrollLeft=0,this.pendingIOSKey=void 0,this.tabFocusMode=-1,this.lastSelectionOrigin=null,this.lastSelectionTime=0,this.lastContextMenu=0,this.scrollHandlers=[],this.handlers=Object.create(null),this.composing=-1,this.compositionFirstChange=null,this.compositionEndedAt=0,this.compositionPendingKey=!1,this.compositionPendingChange=!1,this.insertingText="",this.insertingTextAt=0,this.mouseSelection=null,this.draggedContent=null,this.handleEvent=this.handleEvent.bind(this),this.notifiedFocused=e.hasFocus,Le.safari&&e.contentDOM.addEventListener("input",()=>null),Le.gecko&&uM(e.contentDOM.ownerDocument)}handleEvent(e){!rM(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||(this.view.updateState!=0?Promise.resolve().then(()=>this.runHandlers(e.type,e)):this.runHandlers(e.type,e))}runHandlers(e,t){let r=this.handlers[e];if(r){for(let i of r.observers)i(this.view,t);for(let i of r.handlers){if(t.defaultPrevented)break;if(i(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=GL(e),r=this.handlers,i=this.view.contentDOM;for(let s in t)if(s!="scroll"){let o=!t[s].handlers.length,a=r[s];a&&o!=!a.handlers.length&&(i.removeEventListener(s,this.handleEvent),a=null),a||i.addEventListener(s,this.handleEvent,{passive:o})}for(let s in r)s!="scroll"&&!t[s]&&i.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&this.tabFocusMode>-1&&(!this.tabFocusMode||Date.now()<=this.tabFocusMode))return!0;if(this.tabFocusMode>0&&e.keyCode!=27&&W2.indexOf(e.keyCode)<0&&(this.tabFocusMode=-1),Le.android&&Le.chrome&&!e.synthetic&&(e.keyCode==13||e.keyCode==8))return this.view.observer.delayAndroidKey(e.key,e.keyCode),!0;let t;return Le.ios&&!e.synthetic&&!e.altKey&&!e.metaKey&&((t=V2.find(r=>r.keyCode==e.keyCode))&&!e.ctrlKey||HL.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(this.pendingIOSKey=t||e,setTimeout(()=>this.flushIOSKey(),250),!0):(e.keyCode!=229&&this.view.observer.forceFlush(),!1)}flushIOSKey(e){let t=this.pendingIOSKey;return!t||t.key=="Enter"&&e&&e.from<e.to&&/^\S+$/.test(e.insert.toString())?!1:(this.pendingIOSKey=void 0,Ra(this.view.contentDOM,t.key,t.keyCode,t instanceof KeyboardEvent?t:void 0))}ignoreDuringComposition(e){return!/^key/.test(e.type)||e.synthetic?!1:this.composing>0?!0:Le.safari&&!Le.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}update(e){this.view.observer.update(e),this.mouseSelection&&this.mouseSelection.update(e),this.draggedContent&&e.docChanged&&(this.draggedContent=this.draggedContent.map(e.changes)),e.transactions.length&&(this.lastKeyCode=this.lastSelectionTime=0)}destroy(){this.mouseSelection&&this.mouseSelection.destroy()}}function wy(n,e){return(t,r)=>{try{return e.call(n,r,t)}catch(i){zr(t.state,i)}}}function GL(n){let e=Object.create(null);function t(r){return e[r]||(e[r]={observers:[],handlers:[]})}for(let r of n){let i=r.spec,s=i&&i.plugin.domEventHandlers,o=i&&i.plugin.domEventObservers;if(s)for(let a in s){let l=s[a];l&&t(a).handlers.push(wy(r.value,l))}if(o)for(let a in o){let l=o[a];l&&t(a).observers.push(wy(r.value,l))}}for(let r in Pi)t(r).handlers.push(Pi[r]);for(let r in ci)t(r).observers.push(ci[r]);return e}const V2=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],HL="dthko",W2=[16,17,18,20,91,92,224,225],Cu=6;function Tu(n){return Math.max(0,n)*.7+8}function KL(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class JL{constructor(e,t,r,i){this.view=e,this.startEvent=t,this.style=r,this.mustSelect=i,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParents=J5(e.contentDOM),this.atoms=e.state.facet(lu).map(o=>o(e));let s=e.contentDOM.ownerDocument;s.addEventListener("mousemove",this.move=this.move.bind(this)),s.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(Pt.allowMultipleSelections)&&eM(e,t),this.dragging=nM(e,t)&&G2(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&KL(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let t=0,r=0,i=0,s=0,o=this.view.win.innerWidth,a=this.view.win.innerHeight;this.scrollParents.x&&({left:i,right:o}=this.scrollParents.x.getBoundingClientRect()),this.scrollParents.y&&({top:s,bottom:a}=this.scrollParents.y.getBoundingClientRect());let l=Uv(this.view);e.clientX-l.left<=i+Cu?t=-Tu(i-e.clientX):e.clientX+l.right>=o-Cu&&(t=Tu(e.clientX-o)),e.clientY-l.top<=s+Cu?r=-Tu(s-e.clientY):e.clientY+l.bottom>=a-Cu&&(r=Tu(e.clientY-a)),this.setScrollSpeed(t,r)}up(e){this.dragging==null&&this.select(this.lastEvent),this.dragging||e.preventDefault(),this.destroy()}destroy(){this.setScrollSpeed(0,0);let e=this.view.contentDOM.ownerDocument;e.removeEventListener("mousemove",this.move),e.removeEventListener("mouseup",this.up),this.view.inputState.mouseSelection=this.view.inputState.draggedContent=null}setScrollSpeed(e,t){this.scrollSpeed={x:e,y:t},e||t?this.scrolling<0&&(this.scrolling=setInterval(()=>this.scroll(),50)):this.scrolling>-1&&(clearInterval(this.scrolling),this.scrolling=-1)}scroll(){let{x:e,y:t}=this.scrollSpeed;e&&this.scrollParents.x&&(this.scrollParents.x.scrollLeft+=e,e=0),t&&this.scrollParents.y&&(this.scrollParents.y.scrollTop+=t,t=0),(e||t)&&this.view.win.scrollBy(e,t),this.dragging===!1&&this.select(this.lastEvent)}select(e){let{view:t}=this,r=z2(this.atoms,this.style.get(e,this.extend,this.multiple));(this.mustSelect||!r.eq(t.state.selection,this.dragging===!1))&&this.view.dispatch({selection:r,userEvent:"select.pointer"}),this.mustSelect=!1}update(e){e.transactions.some(t=>t.isUserEvent("input.type"))?this.destroy():this.style.update(e)&&setTimeout(()=>this.select(this.lastEvent),20)}}function eM(n,e){let t=n.state.facet(C2);return t.length?t[0](e):Le.mac?e.metaKey:e.ctrlKey}function tM(n,e){let t=n.state.facet(T2);return t.length?t[0](e):Le.mac?!e.altKey:!e.ctrlKey}function nM(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let r=xc(n.root);if(!r||r.rangeCount==0)return!0;let i=r.getRangeAt(0).getClientRects();for(let s=0;s<i.length;s++){let o=i[s];if(o.left<=e.clientX&&o.right>=e.clientX&&o.top<=e.clientY&&o.bottom>=e.clientY)return!0}return!1}function rM(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,r;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(r=$n.get(t))&&r.isWidget()&&!r.isHidden&&r.widget.ignoreEvent(e))return!1;return!0}const Pi=Object.create(null),ci=Object.create(null),Y2=Le.ie&&Le.ie_version<15||Le.ios&&Le.webkit_version<604;function iM(n){let e=n.dom.parentNode;if(!e)return;let t=e.appendChild(document.createElement("textarea"));t.style.cssText="position: fixed; left: -10000px; top: 10px",t.focus(),setTimeout(()=>{n.focus(),t.remove(),U2(n,t.value)},50)}function th(n,e,t){for(let r of n.facet(e))t=r(t,n);return t}function U2(n,e){e=th(n.state,Xv,e);let{state:t}=n,r,i=1,s=t.toText(e),o=s.lines==t.selection.ranges.length;if(jm!=null&&t.selection.ranges.every(l=>l.empty)&&jm==s.toString()){let l=-1;r=t.changeByRange(c=>{let u=t.doc.lineAt(c.from);if(u.from==l)return{range:c};l=u.from;let f=t.toText((o?s.line(i++).text:e)+t.lineBreak);return{changes:{from:u.from,insert:f},range:me.cursor(c.from+f.length)}})}else o?r=t.changeByRange(l=>{let c=s.line(i++);return{changes:{from:l.from,to:l.to,insert:c.text},range:me.cursor(l.from+c.length)}}):r=t.replaceSelection(s);n.dispatch(r,{userEvent:"input.paste",scrollIntoView:!0})}ci.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Pi.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&n.inputState.tabFocusMode!=0&&(n.inputState.tabFocusMode=Date.now()+2e3),!1);ci.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};ci.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Pi.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let r of n.state.facet(P2))if(t=r(n,e),t)break;if(!t&&e.button==0&&(t=oM(n,e)),t){let r=!n.hasFocus;n.inputState.startMouseSelection(new JL(n,e,t,r)),r&&n.observer.ignore(()=>{O2(n.contentDOM);let s=n.root.activeElement;s&&!s.contains(n.contentDOM)&&s.blur()});let i=n.inputState.mouseSelection;if(i)return i.start(e),i.dragging===!1}else n.inputState.setSelectionOrigin("select.pointer");return!1};function _y(n,e,t,r){if(r==1)return me.cursor(e,t);if(r==2)return qL(n.state,e,t);{let i=n.docView.lineAt(e,t),s=n.state.doc.lineAt(i?i.posAtEnd:e),o=i?i.posAtStart:s.from,a=i?i.posAtEnd:s.to;return a<n.state.doc.length&&a==s.to&&a++,me.range(o,a)}}const sM=Le.ie&&Le.ie_version<=11;let ky=null,xy=0,Sy=0;function G2(n){if(!sM)return n.detail;let e=ky,t=Sy;return ky=n,Sy=Date.now(),xy=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(xy+1)%3:1}function oM(n,e){let t=n.posAndSideAtCoords({x:e.clientX,y:e.clientY},!1),r=G2(e),i=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),i=i.map(s.changes))},get(s,o,a){let l=n.posAndSideAtCoords({x:s.clientX,y:s.clientY},!1),c,u=_y(n,l.pos,l.assoc,r);if(t.pos!=l.pos&&!o){let f=_y(n,t.pos,t.assoc,r),d=Math.min(f.from,u.from),h=Math.max(f.to,u.to);u=d<u.from?me.range(d,h):me.range(h,d)}return o?i.replaceRange(i.main.extend(u.from,u.to)):a&&r==1&&i.ranges.length>1&&(c=aM(i,l.pos))?c:a?i.addRange(u):me.create([u])}}}function aM(n,e){for(let t=0;t<n.ranges.length;t++){let{from:r,to:i}=n.ranges[t];if(r<=e&&i>=e)return me.create(n.ranges.slice(0,t).concat(n.ranges.slice(t+1)),n.mainIndex==t?0:n.mainIndex-(n.mainIndex>t?1:0))}return null}Pi.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let i=n.docView.tile.nearest(e.target);if(i&&i.isWidget()){let s=i.posAtStart,o=s+i.length;(s>=t.to||o<=t.from)&&(t=me.range(s,o))}}let{inputState:r}=n;return r.mouseSelection&&(r.mouseSelection.dragging=!0),r.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",th(n.state,Vv,n.state.sliceDoc(t.from,t.to))),e.dataTransfer.effectAllowed="copyMove"),!1};Pi.dragend=n=>(n.inputState.draggedContent=null,!1);function Ay(n,e,t,r){if(t=th(n.state,Xv,t),!t)return;let i=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,o=r&&s&&tM(n,e)?{from:s.from,to:s.to}:null,a={from:i,insert:t},l=n.state.changes(o?[o,a]:a);n.focus(),n.dispatch({changes:l,selection:{anchor:l.mapPos(i,-1),head:l.mapPos(i,1)},userEvent:o?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Pi.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let r=Array(t.length),i=0,s=()=>{++i==t.length&&Ay(n,e,r.filter(o=>o!=null).join(n.state.lineBreak),!1)};for(let o=0;o<t.length;o++){let a=new FileReader;a.onerror=s,a.onload=()=>{/[\x00-\x08\x0e-\x1f]{2}/.test(a.result)||(r[o]=a.result),s()},a.readAsText(t[o])}return!0}else{let r=e.dataTransfer.getData("Text");if(r)return Ay(n,e,r,!0),!0}return!1};Pi.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=Y2?null:e.clipboardData;return t?(U2(n,t.getData("text/plain")||t.getData("text/uri-list")),!0):(iM(n),!1)};function lM(n,e){let t=n.dom.parentNode;if(!t)return;let r=t.appendChild(document.createElement("textarea"));r.style.cssText="position: fixed; left: -10000px; top: 10px",r.value=e,r.focus(),r.selectionEnd=e.length,r.selectionStart=0,setTimeout(()=>{r.remove(),n.focus()},50)}function cM(n){let e=[],t=[],r=!1;for(let i of n.selection.ranges)i.empty||(e.push(n.sliceDoc(i.from,i.to)),t.push(i));if(!e.length){let i=-1;for(let{from:s}of n.selection.ranges){let o=n.doc.lineAt(s);o.number>i&&(e.push(o.text),t.push({from:o.from,to:Math.min(n.doc.length,o.to+1)})),i=o.number}r=!0}return{text:th(n,Vv,e.join(n.lineBreak)),ranges:t,linewise:r}}let jm=null;Pi.copy=Pi.cut=(n,e)=>{if(!ac(n.contentDOM,n.observer.selectionRange))return!1;let{text:t,ranges:r,linewise:i}=cM(n.state);if(!t&&!i)return!1;jm=i?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:r,scrollIntoView:!0,userEvent:"delete.cut"});let s=Y2?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(lM(n,t),!1)};const H2=Es.define();function K2(n,e){let t=[];for(let r of n.facet(Q2)){let i=r(n,e);i&&t.push(i)}return t.length?n.update({effects:t,annotations:H2.of(!0)}):null}function J2(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=K2(n.state,e);t?n.dispatch(t):n.update([])}},10)}ci.focus=n=>{n.inputState.lastFocusTime=Date.now(),!n.scrollDOM.scrollTop&&(n.inputState.lastScrollTop||n.inputState.lastScrollLeft)&&(n.scrollDOM.scrollTop=n.inputState.lastScrollTop,n.scrollDOM.scrollLeft=n.inputState.lastScrollLeft),J2(n)};ci.blur=n=>{n.observer.clearSelectionRange(),J2(n)};ci.compositionstart=ci.compositionupdate=n=>{n.observer.editContext||(n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0))};ci.compositionend=n=>{n.observer.editContext||(n.inputState.composing=-1,n.inputState.compositionEndedAt=Date.now(),n.inputState.compositionPendingKey=!0,n.inputState.compositionPendingChange=n.observer.pendingRecords().length>0,n.inputState.compositionFirstChange=null,Le.chrome&&Le.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50))};ci.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Pi.beforeinput=(n,e)=>{var t,r;if((e.inputType=="insertText"||e.inputType=="insertCompositionText")&&(n.inputState.insertingText=e.data,n.inputState.insertingTextAt=Date.now()),e.inputType=="insertReplacementText"&&n.observer.editContext){let s=(t=e.dataTransfer)===null||t===void 0?void 0:t.getData("text/plain"),o=e.getTargetRanges();if(s&&o.length){let a=o[0],l=n.posAtDOM(a.startContainer,a.startOffset),c=n.posAtDOM(a.endContainer,a.endOffset);return Gv(n,{from:l,to:c,insert:n.state.toText(s)},null),!0}}let i;if(Le.chrome&&Le.android&&(i=V2.find(s=>s.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let s=((r=window.visualViewport)===null||r===void 0?void 0:r.height)||0;setTimeout(()=>{var o;(((o=window.visualViewport)===null||o===void 0?void 0:o.height)||0)>s+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return Le.ios&&e.inputType=="deleteContentForward"&&n.observer.flushSoon(),Le.safari&&e.inputType=="insertText"&&n.inputState.composing>=0&&setTimeout(()=>ci.compositionend(n,e),20),!1};const Cy=new Set;function uM(n){Cy.has(n)||(Cy.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const Ty=["pre-wrap","normal","pre-line","break-spaces"];let Ka=!1;function Py(){Ka=!1}class fM{constructor(e){this.lineWrapping=e,this.doc=Nt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30}heightForGap(e,t){let r=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(r+=Math.max(0,Math.ceil((t-e-r*this.lineLength*.5)/this.lineLength))),this.lineHeight*r}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/Math.max(1,this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return Ty.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let r=0;r<e.length;r++){let i=e[r];i<0?r++:this.heightSamples[Math.floor(i*10)]||(t=!0,this.heightSamples[Math.floor(i*10)]=!0)}return t}refresh(e,t,r,i,s,o){let a=Ty.indexOf(e)>-1,l=Math.abs(t-this.lineHeight)>.3||this.lineWrapping!=a||Math.abs(r-this.charWidth)>.1;if(this.lineWrapping=a,this.lineHeight=t,this.charWidth=r,this.textHeight=i,this.lineLength=s,l){this.heightSamples={};for(let c=0;c<o.length;c++){let u=o[c];u<0?c++:this.heightSamples[Math.floor(u*10)]=!0}}return l}}class dM{constructor(e,t){this.from=e,this.heights=t,this.index=0}get more(){return this.index<this.heights.length}}class yi{constructor(e,t,r,i,s){this.from=e,this.length=t,this.top=r,this.height=i,this._content=s}get type(){return typeof this._content=="number"?$r.Text:Array.isArray(this._content)?this._content:this._content.type}get to(){return this.from+this.length}get bottom(){return this.top+this.height}get widget(){return this._content instanceof Wo?this._content.widget:null}get widgetLineBreaks(){return typeof this._content=="number"?this._content:0}join(e){let t=(Array.isArray(this._content)?this._content:[this]).concat(Array.isArray(e._content)?e._content:[e]);return new yi(this.from,this.length+e.length,this.top,this.height+e.height,t)}}var rn=(function(n){return n[n.ByPos=0]="ByPos",n[n.ByHeight=1]="ByHeight",n[n.ByPosNoHeight=2]="ByPosNoHeight",n})(rn||(rn={}));const Of=.001;class dr{constructor(e,t,r=2){this.length=e,this.height=t,this.flags=r}get outdated(){return(this.flags&2)>0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e){this.height!=e&&(Math.abs(this.height-e)>Of&&(Ka=!0),this.height=e)}replace(e,t,r){return dr.of(r)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,r,i){let s=this,o=r.doc;for(let a=i.length-1;a>=0;a--){let{fromA:l,toA:c,fromB:u,toB:f}=i[a],d=s.lineAt(l,rn.ByPosNoHeight,r.setDoc(t),0,0),h=d.to>=c?d:s.lineAt(c,rn.ByPosNoHeight,r,0,0);for(f+=h.to-c,c=h.to;a>0&&d.from<=i[a-1].toA;)l=i[a-1].fromA,u=i[a-1].fromB,a--,l<d.from&&(d=s.lineAt(l,rn.ByPosNoHeight,r,0,0));u+=d.from-l,l=d.from;let m=Hv.build(r.setDoc(o),e,u,f);s=Uf(s,s.replace(l,c,m))}return s.updateHeight(r,0)}static empty(){return new Ir(0,0,0)}static of(e){if(e.length==1)return e[0];let t=0,r=e.length,i=0,s=0;for(;;)if(t==r)if(i>s*2){let a=e[t-1];a.break?e.splice(--t,1,a.left,null,a.right):e.splice(--t,1,a.left,a.right),r+=1+a.break,i-=a.size}else if(s>i*2){let a=e[r];a.break?e.splice(r,1,a.left,null,a.right):e.splice(r,1,a.left,a.right),r+=2+a.break,s-=a.size}else break;else if(i<s){let a=e[t++];a&&(i+=a.size)}else{let a=e[--r];a&&(s+=a.size)}let o=0;return e[t-1]==null?(o=1,t--):e[t]==null&&(o=1,r++),new pM(dr.of(e.slice(0,t)),o,dr.of(e.slice(r)))}}function Uf(n,e){return n==e?n:(n.constructor!=e.constructor&&(Ka=!0),e)}dr.prototype.size=1;const hM=ft.replace({});class ex extends dr{constructor(e,t,r){super(e,t),this.deco=r,this.spaceAbove=0}mainBlock(e,t){return new yi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.deco||0)}blockAt(e,t,r,i){return this.spaceAbove&&e<r+this.spaceAbove?new yi(i,0,r,this.spaceAbove,hM):this.mainBlock(r,i)}lineAt(e,t,r,i,s){let o=this.mainBlock(i,s);return this.spaceAbove?this.blockAt(0,r,i,s).join(o):o}forEachLine(e,t,r,i,s,o){e<=s+this.length&&t>=s&&o(this.lineAt(0,rn.ByPos,r,i,s))}setMeasuredHeight(e){let t=e.heights[e.index++];t<0?(this.spaceAbove=-t,t=e.heights[e.index++]):this.spaceAbove=0,this.setHeight(t)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more&&this.setMeasuredHeight(i),this.outdated=!1,this}toString(){return`block(${this.length})`}}class Ir extends ex{constructor(e,t,r){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0,this.spaceAbove=r}mainBlock(e,t){return new yi(t,this.length,e+this.spaceAbove,this.height-this.spaceAbove,this.breaks)}replace(e,t,r){let i=r[0];return r.length==1&&(i instanceof Ir||i instanceof Un&&i.flags&4)&&Math.abs(this.length-i.length)<10?(i instanceof Un?i=new Ir(i.length,this.height,this.spaceAbove):i.height=this.height,this.outdated||(i.outdated=!1),i):dr.of(r)}updateHeight(e,t=0,r=!1,i){return i&&i.from<=t&&i.more?this.setMeasuredHeight(i):(r||this.outdated)&&(this.spaceAbove=0,this.setHeight(Math.max(this.widgetHeight,e.heightForLine(this.length-this.collapsed))+this.breaks*e.lineHeight)),this.outdated=!1,this}toString(){return`line(${this.length}${this.collapsed?-this.collapsed:""}${this.widgetHeight?":"+this.widgetHeight:""})`}}class Un extends dr{constructor(e){super(e,0)}heightMetrics(e,t){let r=e.doc.lineAt(t).number,i=e.doc.lineAt(t+this.length).number,s=i-r+1,o,a=0;if(e.lineWrapping){let l=Math.min(this.height,e.lineHeight*s);o=l/s,this.length>s+1&&(a=(this.height-l)/(this.length-s-1))}else o=this.height/s;return{firstLine:r,lastLine:i,perLine:o,perChar:a}}blockAt(e,t,r,i){let{firstLine:s,lastLine:o,perLine:a,perChar:l}=this.heightMetrics(t,i);if(t.lineWrapping){let c=i+(e<t.lineHeight?0:Math.round(Math.max(0,Math.min(1,(e-r)/this.height))*this.length)),u=t.doc.lineAt(c),f=a+u.length*l,d=Math.max(r,e-f/2);return new yi(u.from,u.length,d,f,0)}else{let c=Math.max(0,Math.min(o-s,Math.floor((e-r)/a))),{from:u,length:f}=t.doc.line(s+c);return new yi(u,f,r+a*c,a,0)}}lineAt(e,t,r,i,s){if(t==rn.ByHeight)return this.blockAt(e,r,i,s);if(t==rn.ByPosNoHeight){let{from:h,to:m}=r.doc.lineAt(e);return new yi(h,m-h,0,0,0)}let{firstLine:o,perLine:a,perChar:l}=this.heightMetrics(r,s),c=r.doc.lineAt(e),u=a+c.length*l,f=c.number-o,d=i+a*f+l*(c.from-s-f);return new yi(c.from,c.length,Math.max(i,Math.min(d,i+this.height-u)),u,0)}forEachLine(e,t,r,i,s,o){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:a,perLine:l,perChar:c}=this.heightMetrics(r,s);for(let u=e,f=i;u<=t;){let d=r.doc.lineAt(u);if(u==e){let m=d.number-a;f+=l*m+c*(e-s-m)}let h=l+c*d.length;o(new yi(d.from,d.length,f,h,0)),f+=h,u=d.to+1}}replace(e,t,r){let i=this.length-t;if(i>0){let s=r[r.length-1];s instanceof Un?r[r.length-1]=new Un(s.length+i):r.push(null,new Un(i-1))}if(e>0){let s=r[0];s instanceof Un?r[0]=new Un(e+s.length):r.unshift(new Un(e-1),null)}return dr.of(r)}decomposeLeft(e,t){t.push(new Un(e-1),null)}decomposeRight(e,t){t.push(null,new Un(this.length-e-1))}updateHeight(e,t=0,r=!1,i){let s=t+this.length;if(i&&i.from<=t+this.length&&i.more){let o=[],a=Math.max(t,i.from),l=-1;for(i.from>t&&o.push(new Un(i.from-t-1).updateHeight(e,t));a<=s&&i.more;){let u=e.doc.lineAt(a).length;o.length&&o.push(null);let f=i.heights[i.index++],d=0;f<0&&(d=-f,f=i.heights[i.index++]),l==-1?l=f:Math.abs(f-l)>=Of&&(l=-2);let h=new Ir(u,f,d);h.outdated=!1,o.push(h),a+=u+1}a<=s&&o.push(null,new Un(s-a).updateHeight(e,a));let c=dr.of(o);return(l<0||Math.abs(c.height-this.height)>=Of||Math.abs(l-this.heightMetrics(e,t).perLine)>=Of)&&(Ka=!0),Uf(this,c)}else(r||this.outdated)&&(this.setHeight(e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class pM extends dr{constructor(e,t,r){super(e.length+t+r.length,e.height+r.height,t|(e.outdated||r.outdated?2:0)),this.left=e,this.right=r,this.size=e.size+r.size}get break(){return this.flags&1}blockAt(e,t,r,i){let s=r+this.left.height;return e<s?this.left.blockAt(e,t,r,i):this.right.blockAt(e,t,s,i+this.left.length+this.break)}lineAt(e,t,r,i,s){let o=i+this.left.height,a=s+this.left.length+this.break,l=t==rn.ByHeight?e<o:e<a,c=l?this.left.lineAt(e,t,r,i,s):this.right.lineAt(e,t,r,o,a);if(this.break||(l?c.to<a:c.from>a))return c;let u=t==rn.ByPosNoHeight?rn.ByPosNoHeight:rn.ByPos;return l?c.join(this.right.lineAt(a,u,r,o,a)):this.left.lineAt(a,u,r,i,s).join(c)}forEachLine(e,t,r,i,s,o){let a=i+this.left.height,l=s+this.left.length+this.break;if(this.break)e<l&&this.left.forEachLine(e,t,r,i,s,o),t>=l&&this.right.forEachLine(e,t,r,a,l,o);else{let c=this.lineAt(l,rn.ByPos,r,i,s);e<c.from&&this.left.forEachLine(e,c.from-1,r,i,s,o),c.to>=e&&c.from<=t&&o(c),t>c.to&&this.right.forEachLine(c.to+1,t,r,a,l,o)}}replace(e,t,r){let i=this.left.length+this.break;if(t<i)return this.balanced(this.left.replace(e,t,r),this.right);if(e>this.left.length)return this.balanced(this.left,this.right.replace(e-i,t-i,r));let s=[];e>0&&this.decomposeLeft(e,s);let o=s.length;for(let a of r)s.push(a);if(e>0&&Ey(s,o-1),t<this.length){let a=s.length;this.decomposeRight(t,s),Ey(s,a)}return dr.of(s)}decomposeLeft(e,t){let r=this.left.length;if(e<=r)return this.left.decomposeLeft(e,t);t.push(this.left),this.break&&(r++,e>=r&&t.push(null)),e>r&&this.right.decomposeLeft(e-r,t)}decomposeRight(e,t){let r=this.left.length,i=r+this.break;if(e>=i)return this.right.decomposeRight(e-i,t);e<r&&this.left.decomposeRight(e,t),this.break&&e<i&&t.push(null),t.push(this.right)}balanced(e,t){return e.size>2*t.size||t.size>2*e.size?dr.of(this.break?[e,null,t]:[e,t]):(this.left=Uf(this.left,e),this.right=Uf(this.right,t),this.setHeight(e.height+t.height),this.outdated=e.outdated||t.outdated,this.size=e.size+t.size,this.length=e.length+this.break+t.length,this)}updateHeight(e,t=0,r=!1,i){let{left:s,right:o}=this,a=t+s.length+this.break,l=null;return i&&i.from<=t+s.length&&i.more?l=s=s.updateHeight(e,t,r,i):s.updateHeight(e,t,r),i&&i.from<=a+o.length&&i.more?l=o=o.updateHeight(e,a,r,i):o.updateHeight(e,a,r),l?this.balanced(s,o):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function Ey(n,e){let t,r;n[e]==null&&(t=n[e-1])instanceof Un&&(r=n[e+1])instanceof Un&&n.splice(e-1,3,new Un(t.length+1+r.length))}const mM=5;class Hv{constructor(e,t){this.pos=e,this.oracle=t,this.nodes=[],this.lineStart=-1,this.lineEnd=-1,this.covering=null,this.writtenTo=e}get isCovered(){return this.covering&&this.nodes[this.nodes.length-1]==this.covering}span(e,t){if(this.lineStart>-1){let r=Math.min(t,this.lineEnd),i=this.nodes[this.nodes.length-1];i instanceof Ir?i.length+=r-this.pos:(r>this.pos||!this.isCovered)&&this.nodes.push(new Ir(r-this.pos,-1,0)),this.writtenTo=r,t>r&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,r){if(e<t||r.heightRelevant){let i=r.widget?r.widget.estimatedHeight:0,s=r.widget?r.widget.lineBreaks:0;i<0&&(i=this.oracle.lineHeight);let o=t-e;r.block?this.addBlock(new ex(o,i,r)):(o||s||i>=mM)&&this.addLineDeco(i,s,o)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd<this.pos&&(this.lineEnd=this.oracle.doc.lineAt(this.pos).to)}enterLine(){if(this.lineStart>-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenTo<e&&((this.writtenTo<e-1||this.nodes[this.nodes.length-1]==null)&&this.nodes.push(this.blankContent(this.writtenTo,e-1)),this.nodes.push(null)),this.pos>e&&this.nodes.push(new Ir(this.pos-e,-1,0)),this.writtenTo=this.pos}blankContent(e,t){let r=new Un(t-e);return this.oracle.doc.lineAt(e).to==t&&(r.flags|=4),r}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof Ir)return e;let t=new Ir(0,-1,0);return this.nodes.push(t),t}addBlock(e){this.enterLine();let t=e.deco;t&&t.startSide>0&&!this.isCovered&&this.ensureLine(),this.nodes.push(e),this.writtenTo=this.pos=this.pos+e.length,t&&t.endSide>0&&(this.covering=e)}addLineDeco(e,t,r){let i=this.ensureLine();i.length+=r,i.collapsed+=r,i.widgetHeight=Math.max(i.widgetHeight,e),i.breaks+=t,this.writtenTo=this.pos=this.pos+r}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof Ir)&&!this.isCovered?this.nodes.push(new Ir(0,-1,0)):(this.writtenTo<this.pos||t==null)&&this.nodes.push(this.blankContent(this.writtenTo,this.pos));let r=e;for(let i of this.nodes)i instanceof Ir&&i.updateHeight(this.oracle,r),r+=i?i.length:1;return this.nodes}static build(e,t,r,i){let s=new Hv(r,e);return $t.spans(t,r,i,s,0),s.finish(r)}}function gM(n,e,t){let r=new vM;return $t.compare(n,e,t,r,0),r.changes}class vM{constructor(){this.changes=[]}compareRange(){}comparePoint(e,t,r,i){(e<t||r&&r.heightRelevant||i&&i.heightRelevant)&&qa(e,t,this.changes,5)}}function OM(n,e){let t=n.getBoundingClientRect(),r=n.ownerDocument,i=r.defaultView||window,s=Math.max(0,t.left),o=Math.min(i.innerWidth,t.right),a=Math.max(0,t.top),l=Math.min(i.innerHeight,t.bottom);for(let c=n.parentNode;c&&c!=r.body;)if(c.nodeType==1){let u=c,f=window.getComputedStyle(u);if((u.scrollHeight>u.clientHeight||u.scrollWidth>u.clientWidth)&&f.overflow!="visible"){let d=u.getBoundingClientRect();s=Math.max(s,d.left),o=Math.min(o,d.right),a=Math.max(a,d.top),l=Math.min(c==n.parentNode?i.innerHeight:l,d.bottom)}c=f.position=="absolute"||f.position=="fixed"?u.offsetParent:u.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,o)-t.left,top:a-(t.top+e),bottom:Math.max(a,l)-(t.top+e)}}function bM(n){let e=n.getBoundingClientRect(),t=n.ownerDocument.defaultView||window;return e.left<t.innerWidth&&e.right>0&&e.top<t.innerHeight&&e.bottom>0}function yM(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Vh{constructor(e,t,r,i){this.from=e,this.to=t,this.size=r,this.displaySize=i}static same(e,t){if(e.length!=t.length)return!1;for(let r=0;r<e.length;r++){let i=e[r],s=t[r];if(i.from!=s.from||i.to!=s.to||i.size!=s.size)return!1}return!0}draw(e,t){return ft.replace({widget:new wM(this.displaySize*(t?e.scaleY:e.scaleX),t)}).range(this.from,this.to)}}class wM extends su{constructor(e,t){super(),this.size=e,this.vertical=t}eq(e){return e.size==this.size&&e.vertical==this.vertical}toDOM(){let e=document.createElement("div");return this.vertical?e.style.height=this.size+"px":(e.style.width=this.size+"px",e.style.height="2px",e.style.display="inline-block"),e}get estimatedHeight(){return this.vertical?this.size:-1}}class $y{constructor(e){this.state=e,this.pixelViewport={left:0,right:window.innerWidth,top:0,bottom:0},this.inView=!0,this.paddingTop=0,this.paddingBottom=0,this.contentDOMWidth=0,this.contentDOMHeight=0,this.editorHeight=0,this.editorWidth=0,this.scrollTop=0,this.scrolledToBottom=!1,this.scaleX=1,this.scaleY=1,this.scrollAnchorPos=0,this.scrollAnchorHeight=-1,this.scaler=Qy,this.scrollTarget=null,this.printing=!1,this.mustMeasureContent=!0,this.defaultTextDirection=bn.LTR,this.visibleRanges=[],this.mustEnforceCursorAssoc=!1;let t=e.facet(Wv).some(r=>typeof r!="function"&&r.class=="cm-lineWrapping");this.heightOracle=new fM(t),this.stateDeco=Ly(e),this.heightMap=dr.empty().applyChanges(this.stateDeco,Nt.empty,this.heightOracle.setDoc(e.doc),[new Jr(0,0,0,e.doc.length)]);for(let r=0;r<2&&(this.viewport=this.getViewport(0,null),!!this.updateForViewport());r++);this.updateViewportLines(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=ft.set(this.lineGaps.map(r=>r.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let r=0;r<=1;r++){let i=r?t.head:t.anchor;if(!e.some(({from:s,to:o})=>i>=s&&i<=o)){let{from:s,to:o}=this.lineBlockAt(i);e.push(new Pu(s,o))}}return this.viewports=e.sort((r,i)=>r.from-i.from),this.updateScaler()}updateScaler(){let e=this.scaler;return this.scaler=this.heightMap.height<=7e6?Qy:new Kv(this.heightOracle,this.heightMap,this.viewports),e.eq(this.scaler)?0:2}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(Hl(e,this.scaler))})}update(e,t=null){this.state=e.state;let r=this.stateDeco;this.stateDeco=Ly(this.state);let i=e.changedRanges,s=Jr.extendWithRanges(i,gM(r,this.stateDeco,e?e.changes:Dn.empty(this.state.doc.length))),o=this.heightMap.height,a=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);Py(),this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),(this.heightMap.height!=o||Ka)&&(e.flags|=2),a?(this.scrollAnchorPos=e.changes.mapPos(a.from,-1),this.scrollAnchorHeight=a.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=o);let l=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.head<l.from||t.range.head>l.to)||!this.viewportIsAppropriate(l))&&(l=this.getViewport(0,t));let c=l.from!=this.viewport.from||l.to!=this.viewport.to;this.viewport=l,e.flags|=this.updateForViewport(),(c||!e.changes.empty||e.flags&2)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(this.mapLineGaps(this.lineGaps,e.changes))),e.flags|=this.computeVisibleRanges(e.changes),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&(e.selectionSet||e.focusChanged)&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(dL)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,r=window.getComputedStyle(t),i=this.heightOracle,s=r.whiteSpace;this.defaultTextDirection=r.direction=="rtl"?bn.RTL:bn.LTR;let o=this.heightOracle.mustRefreshForWrapping(s)||this.mustMeasureContent,a=t.getBoundingClientRect(),l=o||this.mustMeasureContent||this.contentDOMHeight!=a.height;this.contentDOMHeight=a.height,this.mustMeasureContent=!1;let c=0,u=0;if(a.width&&a.height){let{scaleX:S,scaleY:_}=v2(t,a);(S>.005&&Math.abs(this.scaleX-S)>.005||_>.005&&Math.abs(this.scaleY-_)>.005)&&(this.scaleX=S,this.scaleY=_,c|=16,o=l=!0)}let f=(parseInt(r.paddingTop)||0)*this.scaleY,d=(parseInt(r.paddingBottom)||0)*this.scaleY;(this.paddingTop!=f||this.paddingBottom!=d)&&(this.paddingTop=f,this.paddingBottom=d,c|=18),this.editorWidth!=e.scrollDOM.clientWidth&&(i.lineWrapping&&(l=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=16);let h=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=h&&(this.scrollAnchorHeight=-1,this.scrollTop=h),this.scrolledToBottom=b2(e.scrollDOM);let m=(this.printing?yM:OM)(t,this.paddingTop),p=m.top-this.pixelViewport.top,v=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let O=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(O!=this.inView&&(this.inView=O,O&&(l=!0)),!this.inView&&!this.scrollTarget&&!bM(e.dom))return 0;let b=a.width;if((this.contentDOMWidth!=b||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=a.width,this.editorHeight=e.scrollDOM.clientHeight,c|=16),l){let S=e.docView.measureVisibleLineHeights(this.viewport);if(i.mustRefreshForHeights(S)&&(o=!0),o||i.lineWrapping&&Math.abs(b-this.contentDOMWidth)>i.charWidth){let{lineHeight:_,charWidth:x,textHeight:A}=e.docView.measureTextSize();o=_>0&&i.refresh(s,_,x,A,Math.max(5,b/x),S),o&&(e.docView.minWidth=0,c|=16)}p>0&&v>0?u=Math.max(p,v):p<0&&v<0&&(u=Math.min(p,v)),Py();for(let _ of this.viewports){let x=_.from==this.viewport.from?S:e.docView.measureVisibleLineHeights(_);this.heightMap=(o?dr.empty().applyChanges(this.stateDeco,Nt.empty,this.heightOracle,[new Jr(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(i,0,o,new dM(_.from,x))}Ka&&(c|=2)}let w=!this.viewportIsAppropriate(this.viewport,u)||this.scrollTarget&&(this.scrollTarget.range.head<this.viewport.from||this.scrollTarget.range.head>this.viewport.to);return w&&(c&2&&(c|=this.updateScaler()),this.viewport=this.getViewport(u,this.scrollTarget),c|=this.updateForViewport()),(c&2||w)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(o?[]:this.lineGaps,e)),c|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),c}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let r=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),i=this.heightMap,s=this.heightOracle,{visibleTop:o,visibleBottom:a}=this,l=new Pu(i.lineAt(o-r*1e3,rn.ByHeight,s,0,0).from,i.lineAt(a+(1-r)*1e3,rn.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(c<l.from||c>l.to){let u=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),f=i.lineAt(c,rn.ByPos,s,0,0),d;t.y=="center"?d=(f.top+f.bottom)/2-u/2:t.y=="start"||t.y=="nearest"&&c<l.from?d=f.top:d=f.bottom-u,l=new Pu(i.lineAt(d-1e3/2,rn.ByHeight,s,0,0).from,i.lineAt(d+u+1e3/2,rn.ByHeight,s,0,0).to)}}return l}mapViewport(e,t){let r=t.mapPos(e.from,-1),i=t.mapPos(e.to,1);return new Pu(this.heightMap.lineAt(r,rn.ByPos,this.heightOracle,0,0).from,this.heightMap.lineAt(i,rn.ByPos,this.heightOracle,0,0).to)}viewportIsAppropriate({from:e,to:t},r=0){if(!this.inView)return!0;let{top:i}=this.heightMap.lineAt(e,rn.ByPos,this.heightOracle,0,0),{bottom:s}=this.heightMap.lineAt(t,rn.ByPos,this.heightOracle,0,0),{visibleTop:o,visibleBottom:a}=this;return(e==0||i<=o-Math.max(10,Math.min(-r,250)))&&(t==this.state.doc.length||s>=a+Math.max(10,Math.min(r,250)))&&i>o-2*1e3&&s<a+2*1e3}mapLineGaps(e,t){if(!e.length||t.empty)return e;let r=[];for(let i of e)t.touchesRange(i.from,i.to)||r.push(new Vh(t.mapPos(i.from),t.mapPos(i.to),i.size,i.displaySize));return r}ensureLineGaps(e,t){let r=this.heightOracle.lineWrapping,i=r?1e4:2e3,s=i>>1,o=i<<1;if(this.defaultTextDirection!=bn.LTR&&!r)return[];let a=[],l=(u,f,d,h)=>{if(f-u<s)return;let m=this.state.selection.main,p=[m.from];m.empty||p.push(m.to);for(let O of p)if(O>u&&O<f){l(u,O-10,d,h),l(O+10,f,d,h);return}let v=kM(e,O=>O.from>=d.from&&O.to<=d.to&&Math.abs(O.from-u)<s&&Math.abs(O.to-f)<s&&!p.some(b=>O.from<b&&O.to>b));if(!v){if(f<d.to&&t&&r&&t.visibleRanges.some(w=>w.from<=f&&w.to>=f)){let w=t.moveToLineBoundary(me.cursor(f),!1,!0).head;w>u&&(f=w)}let O=this.gapSize(d,u,f,h),b=r||O<2e6?O:2e6;v=new Vh(u,f,O,b)}a.push(v)},c=u=>{if(u.length<o||u.type!=$r.Text)return;let f=_M(u.from,u.to,this.stateDeco);if(f.total<o)return;let d=this.scrollTarget?this.scrollTarget.range.head:null,h,m;if(r){let p=i/this.heightOracle.lineLength*this.heightOracle.lineHeight,v,O;if(d!=null){let b=$u(f,d),w=((this.visibleBottom-this.visibleTop)/2+p)/u.height;v=b-w,O=b+w}else v=(this.visibleTop-u.top-p)/u.height,O=(this.visibleBottom-u.top+p)/u.height;h=Eu(f,v),m=Eu(f,O)}else{let p=f.total*this.heightOracle.charWidth,v=i*this.heightOracle.charWidth,O=0;if(p>2e6)for(let x of e)x.from>=u.from&&x.from<u.to&&x.size!=x.displaySize&&x.from*this.heightOracle.charWidth+O<this.pixelViewport.left&&(O=x.size-x.displaySize);let b=this.pixelViewport.left+O,w=this.pixelViewport.right+O,S,_;if(d!=null){let x=$u(f,d),A=((w-b)/2+v)/p;S=x-A,_=x+A}else S=(b-v)/p,_=(w+v)/p;h=Eu(f,S),m=Eu(f,_)}h>u.from&&l(u.from,h,u,f),m<u.to&&l(m,u.to,u,f)};for(let u of this.viewportLines)Array.isArray(u.type)?u.type.forEach(c):c(u);return a}gapSize(e,t,r,i){let s=$u(i,r)-$u(i,t);return this.heightOracle.lineWrapping?e.height*s:i.total*this.heightOracle.charWidth*s}updateLineGaps(e){Vh.same(e,this.lineGaps)||(this.lineGaps=e,this.lineGapDeco=ft.set(e.map(t=>t.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(e){let t=this.stateDeco;this.lineGaps.length&&(t=t.concat(this.lineGapDeco));let r=[];$t.spans(t,this.viewport.from,this.viewport.to,{span(s,o){r.push({from:s,to:o})},point(){}},20);let i=0;if(r.length!=this.visibleRanges.length)i=12;else for(let s=0;s<r.length&&!(i&8);s++){let o=this.visibleRanges[s],a=r[s];(o.from!=a.from||o.to!=a.to)&&(i|=4,e&&e.mapPos(o.from,-1)==a.from&&e.mapPos(o.to,1)==a.to||(i|=8))}return this.visibleRanges=r,i}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Hl(this.heightMap.lineAt(e,rn.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return e>=this.viewportLines[0].top&&e<=this.viewportLines[this.viewportLines.length-1].bottom&&this.viewportLines.find(t=>t.top<=e&&t.bottom>=e)||Hl(this.heightMap.lineAt(this.scaler.fromDOM(e),rn.ByHeight,this.heightOracle,0,0),this.scaler)}scrollAnchorAt(e){let t=this.lineBlockAtHeight(e+8);return t.from>=this.viewport.from||this.viewportLines[0].top-e>200?t:this.viewportLines[0]}elementAtHeight(e){return Hl(this.heightMap.blockAt(this.scaler.fromDOM(e),this.heightOracle,0,0),this.scaler)}get docHeight(){return this.scaler.toDOM(this.heightMap.height)}get contentHeight(){return this.docHeight+this.paddingTop+this.paddingBottom}}class Pu{constructor(e,t){this.from=e,this.to=t}}function _M(n,e,t){let r=[],i=n,s=0;return $t.spans(t,n,e,{span(){},point(o,a){o>i&&(r.push({from:i,to:o}),s+=o-i),i=a}},20),i<e&&(r.push({from:i,to:e}),s+=e-i),{total:s,ranges:r}}function Eu({total:n,ranges:e},t){if(t<=0)return e[0].from;if(t>=1)return e[e.length-1].to;let r=Math.floor(n*t);for(let i=0;;i++){let{from:s,to:o}=e[i],a=o-s;if(r<=a)return s+r;r-=a}}function $u(n,e){let t=0;for(let{from:r,to:i}of n.ranges){if(e<=i){t+=e-r;break}t+=i-r}return t/n.total}function kM(n,e){for(let t of n)if(e(t))return t}const Qy={toDOM(n){return n},fromDOM(n){return n},scale:1,eq(n){return n==this}};function Ly(n){let e=n.facet(Kd).filter(r=>typeof r!="function"),t=n.facet(Yv).filter(r=>typeof r!="function");return t.length&&e.push($t.join(t)),e}class Kv{constructor(e,t,r){let i=0,s=0,o=0;this.viewports=r.map(({from:a,to:l})=>{let c=t.lineAt(a,rn.ByPos,e,0,0).top,u=t.lineAt(l,rn.ByPos,e,0,0).bottom;return i+=u-c,{from:a,to:l,top:c,bottom:u,domTop:0,domBottom:0}}),this.scale=(7e6-i)/(t.height-i);for(let a of this.viewports)a.domTop=o+(a.top-s)*this.scale,o=a.domBottom=a.domTop+(a.bottom-a.top),s=a.bottom}toDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.top)return i+(e-r)*this.scale;if(e<=s.bottom)return s.domTop+(e-s.top);r=s.bottom,i=s.domBottom}}fromDOM(e){for(let t=0,r=0,i=0;;t++){let s=t<this.viewports.length?this.viewports[t]:null;if(!s||e<s.domTop)return r+(e-i)/this.scale;if(e<=s.domBottom)return s.top+(e-s.domTop);r=s.bottom,i=s.domBottom}}eq(e){return e instanceof Kv?this.scale==e.scale&&this.viewports.length==e.viewports.length&&this.viewports.every((t,r)=>t.from==e.viewports[r].from&&t.to==e.viewports[r].to):!1}}function Hl(n,e){if(e.scale==1)return n;let t=e.toDOM(n.top),r=e.toDOM(n.bottom);return new yi(n.from,n.length,t,r-t,Array.isArray(n._content)?n._content.map(i=>Hl(i,e)):n._content)}const Qu=Ie.define({combine:n=>n.join(" ")}),zm=Ie.define({combine:n=>n.indexOf(!0)>-1}),Zm=to.newName(),tx=to.newName(),nx=to.newName(),rx={"&light":"."+tx,"&dark":"."+nx};function Fm(n,e,t){return new to(e,{finish(r){return/&/.test(r)?r.replace(/&\w*/,i=>{if(i=="&")return n;if(!t||!t[i])throw new RangeError(`Unsupported selector: ${i}`);return t[i]}):n+" "+r}})}const xM=Fm("."+Zm,{"&":{position:"relative !important",boxSizing:"border-box","&.cm-focused":{outline:"1px dotted #212121"},display:"flex !important",flexDirection:"column"},".cm-scroller":{display:"flex !important",alignItems:"flex-start !important",fontFamily:"monospace",lineHeight:1.4,height:"100%",overflowX:"auto",position:"relative",zIndex:0,overflowAnchor:"none"},".cm-content":{margin:0,flexGrow:2,flexShrink:0,display:"block",whiteSpace:"pre",wordWrap:"normal",boxSizing:"border-box",minHeight:"100%",padding:"4px 0",outline:"none","&[contenteditable=true]":{WebkitUserModify:"read-write-plaintext-only"}},".cm-lineWrapping":{whiteSpace_fallback:"pre-wrap",whiteSpace:"break-spaces",wordBreak:"break-word",overflowWrap:"anywhere",flexShrink:1},"&light .cm-content":{caretColor:"black"},"&dark .cm-content":{caretColor:"white"},".cm-line":{display:"block",padding:"0 2px 0 6px"},".cm-layer":{position:"absolute",left:0,top:0,contain:"size style","& > *":{position:"absolute"}},"&light .cm-selectionBackground":{background:"#d9d9d9"},"&dark .cm-selectionBackground":{background:"#222"},"&light.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#d7d4f0"},"&dark.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground":{background:"#233"},".cm-cursorLayer":{pointerEvents:"none"},"&.cm-focused > .cm-scroller > .cm-cursorLayer":{animation:"steps(1) cm-blink 1.2s infinite"},"@keyframes cm-blink":{"0%":{},"50%":{opacity:0},"100%":{}},"@keyframes cm-blink2":{"0%":{},"50%":{opacity:0},"100%":{}},".cm-cursor, .cm-dropCursor":{borderLeft:"1.2px solid black",marginLeft:"-0.6px",pointerEvents:"none"},".cm-cursor":{display:"none"},"&dark .cm-cursor":{borderLeftColor:"#ddd"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},".cm-iso":{unicodeBidi:"isolate"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",zIndex:200},".cm-gutters-before":{insetInlineStart:0},".cm-gutters-after":{insetInlineEnd:0},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",border:"0px solid #ddd","&.cm-gutters-before":{borderRightWidth:"1px"},"&.cm-gutters-after":{borderLeftWidth:"1px"}},"&dark .cm-gutters":{backgroundColor:"#333338",color:"#ccc"},".cm-gutter":{display:"flex !important",flexDirection:"column",flexShrink:0,boxSizing:"border-box",minHeight:"100%",overflow:"hidden"},".cm-gutterElement":{boxSizing:"border-box"},".cm-lineNumbers .cm-gutterElement":{padding:"0 3px 0 5px",minWidth:"20px",textAlign:"right",whiteSpace:"nowrap"},"&light .cm-activeLineGutter":{backgroundColor:"#e2f2ff"},"&dark .cm-activeLineGutter":{backgroundColor:"#222227"},".cm-panels":{boxSizing:"border-box",position:"sticky",left:0,right:0,zIndex:300},"&light .cm-panels":{backgroundColor:"#f5f5f5",color:"black"},"&light .cm-panels-top":{borderBottom:"1px solid #ddd"},"&light .cm-panels-bottom":{borderTop:"1px solid #ddd"},"&dark .cm-panels":{backgroundColor:"#333338",color:"white"},".cm-dialog":{padding:"2px 19px 4px 6px",position:"relative","& label":{fontSize:"80%"}},".cm-dialog-close":{position:"absolute",top:"3px",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",fontSize:"14px",padding:"0"},".cm-tab":{display:"inline-block",overflow:"hidden",verticalAlign:"bottom"},".cm-widgetBuffer":{verticalAlign:"text-top",height:"1em",width:0,display:"inline"},".cm-placeholder":{color:"#888",display:"inline-block",verticalAlign:"top",userSelect:"none"},".cm-highlightSpace":{backgroundImage:"radial-gradient(circle at 50% 55%, #aaa 20%, transparent 5%)",backgroundPosition:"center"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="20"><path stroke="%23888" stroke-width="1" fill="none" d="M1 10H196L190 5M190 15L196 10M197 4L197 16"/></svg>')`,backgroundSize:"auto 100%",backgroundPosition:"right 90%",backgroundRepeat:"no-repeat"},".cm-trailingSpace":{backgroundColor:"#ff332255"},".cm-button":{verticalAlign:"middle",color:"inherit",fontSize:"70%",padding:".2em 1em",borderRadius:"1px"},"&light .cm-button":{backgroundImage:"linear-gradient(#eff1f5, #d9d9df)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#b4b4b4, #d0d3d6)"}},"&dark .cm-button":{backgroundImage:"linear-gradient(#393939, #111)",border:"1px solid #888","&:active":{backgroundImage:"linear-gradient(#111, #333)"}},".cm-textfield":{verticalAlign:"middle",color:"inherit",fontSize:"70%",border:"1px solid silver",padding:".2em .5em"},"&light .cm-textfield":{backgroundColor:"white"},"&dark .cm-textfield":{border:"1px solid #555",backgroundColor:"inherit"}},rx),SM={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},Wh=Le.ie&&Le.ie_version<=11;class AM{constructor(e){this.view=e,this.active=!1,this.editContext=null,this.selectionRange=new eL,this.selectionChanged=!1,this.delayedFlush=-1,this.resizeTimeout=-1,this.queue=[],this.delayedAndroidKey=null,this.flushingAndroidKey=-1,this.lastChange=0,this.scrollTargets=[],this.intersection=null,this.resizeScroll=null,this.intersecting=!1,this.gapIntersection=null,this.gaps=[],this.printQuery=null,this.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let r of t)this.queue.push(r);(Le.ie&&Le.ie_version<=11||Le.ios&&e.composing)&&t.some(r=>r.type=="childList"&&r.removedNodes.length||r.type=="characterData"&&r.oldValue.length>r.target.nodeValue.length)?this.flushSoon():this.flush()}),window.EditContext&&Le.android&&e.constructor.EDIT_CONTEXT!==!1&&!(Le.chrome&&Le.chrome_version<126)&&(this.editContext=new TM(e),e.state.facet(hs)&&(e.contentDOM.editContext=this.editContext.editContext)),Wh&&(this.onCharData=t=>{this.queue.push({target:t.target,type:"characterData",oldValue:t.prevValue}),this.flushSoon()}),this.onSelectionChange=this.onSelectionChange.bind(this),this.onResize=this.onResize.bind(this),this.onPrint=this.onPrint.bind(this),this.onScroll=this.onScroll.bind(this),window.matchMedia&&(this.printQuery=window.matchMedia("print")),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate)<Date.now()-75&&this.onResize()}),this.resizeScroll.observe(e.scrollDOM)),this.addWindowListeners(this.win=e.win),this.start(),typeof IntersectionObserver=="function"&&(this.intersection=new IntersectionObserver(t=>{this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),t.length>0&&t[t.length-1].intersectionRatio>0!=this.intersecting&&(this.intersecting=!this.intersecting,this.intersecting!=this.view.inView&&this.onScrollChanged(document.createEvent("Event")))},{threshold:[0,.001]}),this.intersection.observe(this.dom),this.gapIntersection=new IntersectionObserver(t=>{t.length>0&&t[t.length-1].intersectionRatio>0&&this.onScrollChanged(document.createEvent("Event"))},{})),this.listenForScroll(),this.readSelectionRange()}onScrollChanged(e){this.view.inputState.runHandlers("scroll",e),this.intersecting&&this.view.measure()}onScroll(e){this.intersecting&&this.flush(!1),this.editContext&&this.view.requestMeasure(this.editContext.measureReq),this.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(e){(e.type=="change"||!e.type)&&!e.matches||(this.view.viewState.printing=!0,this.view.measure(),setTimeout(()=>{this.view.viewState.printing=!1,this.view.requestMeasure()},500))}updateGaps(e){if(this.gapIntersection&&(e.length!=this.gaps.length||this.gaps.some((t,r)=>t!=e[r]))){this.gapIntersection.disconnect();for(let t of e)this.gapIntersection.observe(t);this.gaps=e}}onSelectionChange(e){let t=this.selectionChanged;if(!this.readSelectionRange()||this.delayedAndroidKey)return;let{view:r}=this,i=this.selectionRange;if(r.state.facet(hs)?r.root.activeElement!=this.dom:!ac(this.dom,i))return;let s=i.anchorNode&&r.docView.tile.nearest(i.anchorNode);if(s&&s.isWidget()&&s.widget.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(Le.ie&&Le.ie_version<=11||Le.android&&Le.chrome)&&!r.state.selection.main.empty&&i.focusNode&&lc(i.focusNode,i.focusOffset,i.anchorNode,i.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=xc(e.root);if(!t)return!1;let r=Le.safari&&e.root.nodeType==11&&e.root.activeElement==this.dom&&CM(this.view,t)||t;if(!r||this.selectionRange.eq(r))return!1;let i=ac(this.dom,r);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime<Date.now()-300&&nL(this.dom,r)?(this.view.inputState.lastFocusTime=0,e.docView.updateSelection(),!1):(this.selectionRange.setRange(r),i&&(this.selectionChanged=!0),!0)}setSelectionRange(e,t){this.selectionRange.set(e.node,e.offset,t.node,t.offset),this.selectionChanged=!1}clearSelectionRange(){this.selectionRange.set(null,0,null,0)}listenForScroll(){this.parentCheck=-1;let e=0,t=null;for(let r=this.dom;r;)if(r.nodeType==1)!t&&e<this.scrollTargets.length&&this.scrollTargets[e]==r?e++:t||(t=this.scrollTargets.slice(0,e)),t&&t.push(r),r=r.assignedSlot||r.parentNode;else if(r.nodeType==11)r=r.host;else break;if(e<this.scrollTargets.length&&!t&&(t=this.scrollTargets.slice(0,e)),t){for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);for(let r of this.scrollTargets=t)r.addEventListener("scroll",this.onScroll)}}ignore(e){if(!this.active)return e();try{return this.stop(),e()}finally{this.start(),this.clear()}}start(){this.active||(this.observer.observe(this.dom,SM),Wh&&this.dom.addEventListener("DOMCharacterDataModified",this.onCharData),this.active=!0)}stop(){this.active&&(this.active=!1,this.observer.disconnect(),Wh&&this.dom.removeEventListener("DOMCharacterDataModified",this.onCharData))}clear(){this.processRecords(),this.queue.length=0,this.selectionChanged=!1}delayAndroidKey(e,t){var r;if(!this.delayedAndroidKey){let i=()=>{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Ra(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(i)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange<Date.now()-50||!!(!((r=this.delayedAndroidKey)===null||r===void 0)&&r.force)})}clearDelayedAndroidKey(){this.win.cancelAnimationFrame(this.flushingAndroidKey),this.delayedAndroidKey=null,this.flushingAndroidKey=-1}flushSoon(){this.delayedFlush<0&&(this.delayedFlush=this.view.win.requestAnimationFrame(()=>{this.delayedFlush=-1,this.flush()}))}forceFlush(){this.delayedFlush>=0&&(this.view.win.cancelAnimationFrame(this.delayedFlush),this.delayedFlush=-1),this.flush()}pendingRecords(){for(let e of this.observer.takeRecords())this.queue.push(e);return this.queue}processRecords(){let e=this.pendingRecords();e.length&&(this.queue=[]);let t=-1,r=-1,i=!1;for(let s of e){let o=this.readMutation(s);o&&(o.typeOver&&(i=!0),t==-1?{from:t,to:r}=o:(t=Math.min(o.from,t),r=Math.max(o.to,r)))}return{from:t,to:r,typeOver:i}}readChange(){let{from:e,to:t,typeOver:r}=this.processRecords(),i=this.selectionChanged&&ac(this.dom,this.selectionRange);if(e<0&&!i)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new XL(this.view,e,t,r);return this.view.docView.domChanged={newSel:s.newSel?s.newSel.main:null},s}flush(e=!0){if(this.delayedFlush>=0||this.delayedAndroidKey)return!1;e&&this.readSelectionRange();let t=this.readChange();if(!t)return this.view.requestMeasure(),!1;let r=this.view.state,i=F2(this.view,t);return this.view.state==r&&(t.domChanged||t.newSel&&!Yf(this.view.state.selection,t.newSel.main))&&this.view.update([]),i}readMutation(e){let t=this.view.docView.tile.nearest(e.target);if(!t||t.isWidget())return null;if(t.markDirty(e.type=="attributes"),e.type=="childList"){let r=My(t,e.previousSibling||e.target.previousSibling,-1),i=My(t,e.nextSibling||e.target.nextSibling,1);return{from:r?t.posAfter(r):t.posAtStart,to:i?t.posBefore(i):t.posAtEnd,typeOver:!1}}else return e.type=="characterData"?{from:t.posAtStart,to:t.posAtEnd,typeOver:e.target.nodeValue==e.oldValue}:null}setWindow(e){e!=this.win&&(this.removeWindowListeners(this.win),this.win=e,this.addWindowListeners(this.win))}addWindowListeners(e){e.addEventListener("resize",this.onResize),this.printQuery?this.printQuery.addEventListener?this.printQuery.addEventListener("change",this.onPrint):this.printQuery.addListener(this.onPrint):e.addEventListener("beforeprint",this.onPrint),e.addEventListener("scroll",this.onScroll),e.document.addEventListener("selectionchange",this.onSelectionChange)}removeWindowListeners(e){e.removeEventListener("scroll",this.onScroll),e.removeEventListener("resize",this.onResize),this.printQuery?this.printQuery.removeEventListener?this.printQuery.removeEventListener("change",this.onPrint):this.printQuery.removeListener(this.onPrint):e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}update(e){this.editContext&&(this.editContext.update(e),e.startState.facet(hs)!=e.state.facet(hs)&&(e.view.contentDOM.editContext=e.state.facet(hs)?this.editContext.editContext:null))}destroy(){var e,t,r;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(r=this.resizeScroll)===null||r===void 0||r.disconnect();for(let i of this.scrollTargets)i.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey),this.editContext&&(this.view.contentDOM.editContext=null,this.editContext.destroy())}}function My(n,e,t){for(;e;){let r=$n.get(e);if(r&&r.parent==n)return r;let i=e.parentNode;e=i!=n.dom?i:t>0?e.nextSibling:e.previousSibling}return null}function qy(n,e){let t=e.startContainer,r=e.startOffset,i=e.endContainer,s=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor,1);return lc(o.node,o.offset,i,s)&&([t,r,i,s]=[i,s,t,r]),{anchorNode:t,anchorOffset:r,focusNode:i,focusOffset:s}}function CM(n,e){if(e.getComposedRanges){let i=e.getComposedRanges(n.root)[0];if(i)return qy(n,i)}let t=null;function r(i){i.preventDefault(),i.stopImmediatePropagation(),t=i.getTargetRanges()[0]}return n.contentDOM.addEventListener("beforeinput",r,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",r,!0),t?qy(n,t):null}class TM{constructor(e){this.from=0,this.to=0,this.pendingContextChange=null,this.handlers=Object.create(null),this.composing=null,this.resetRange(e.state);let t=this.editContext=new window.EditContext({text:e.state.doc.sliceString(this.from,this.to),selectionStart:this.toContextPos(Math.max(this.from,Math.min(this.to,e.state.selection.main.anchor))),selectionEnd:this.toContextPos(e.state.selection.main.head)});this.handlers.textupdate=r=>{let i=e.state.selection.main,{anchor:s,head:o}=i,a=this.toEditorPos(r.updateRangeStart),l=this.toEditorPos(r.updateRangeEnd);e.inputState.composing>=0&&!this.composing&&(this.composing={contextBase:r.updateRangeStart,editorBase:a,drifted:!1});let c=l-a>r.text.length;a==this.from&&s<this.from?a=s:l==this.to&&s>this.to&&(l=s);let u=X2(e.state.sliceDoc(a,l),r.text,(c?i.from:i.to)-a,c?"end":null);if(!u){let d=me.single(this.toEditorPos(r.selectionStart),this.toEditorPos(r.selectionEnd));Yf(d,i)||e.dispatch({selection:d,userEvent:"select"});return}let f={from:u.from+a,to:u.toA+a,insert:Nt.of(r.text.slice(u.from,u.toB).split(`
|
|
153
|
-
`))};if((Le.mac||Le.android)&&f.from==o-1&&/^\. ?$/.test(r.text)&&e.contentDOM.getAttribute("autocorrect")=="off"&&(f={from:a,to:l,insert:Nt.of([r.text.replace("."," ")])}),this.pendingContextChange=f,!e.state.readOnly){let d=this.to-this.from+(f.to-f.from+f.insert.length);Gv(e,f,me.single(this.toEditorPos(r.selectionStart,d),this.toEditorPos(r.selectionEnd,d)))}this.pendingContextChange&&(this.revertPending(e.state),this.setSelection(e.state)),f.from<f.to&&!f.insert.length&&e.inputState.composing>=0&&!/[\\p{Alphabetic}\\p{Number}_]/.test(t.text.slice(Math.max(0,r.updateRangeStart-1),Math.min(t.text.length,r.updateRangeStart+1)))&&this.handlers.compositionend(r)},this.handlers.characterboundsupdate=r=>{let i=[],s=null;for(let o=this.toEditorPos(r.rangeStart),a=this.toEditorPos(r.rangeEnd);o<a;o++){let l=e.coordsForChar(o);s=l&&new DOMRect(l.left,l.top,l.right-l.left,l.bottom-l.top)||s||new DOMRect,i.push(s)}t.updateCharacterBounds(r.rangeStart,i)},this.handlers.textformatupdate=r=>{let i=[];for(let s of r.getTextFormats()){let o=s.underlineStyle,a=s.underlineThickness;if(!/none/i.test(o)&&!/none/i.test(a)){let l=this.toEditorPos(s.rangeStart),c=this.toEditorPos(s.rangeEnd);if(l<c){let u=`text-decoration: underline ${/^[a-z]/.test(o)?o+" ":o=="Dashed"?"dashed ":o=="Squiggle"?"wavy ":""}${/thin/i.test(a)?1:2}px`;i.push(ft.mark({attributes:{style:u}}).range(l,c))}}}e.dispatch({effects:q2.of(ft.set(i))})},this.handlers.compositionstart=()=>{e.inputState.composing<0&&(e.inputState.composing=0,e.inputState.compositionFirstChange=!0)},this.handlers.compositionend=()=>{if(e.inputState.composing=-1,e.inputState.compositionFirstChange=null,this.composing){let{drifted:r}=this.composing;this.composing=null,r&&this.reset(e.state)}};for(let r in this.handlers)t.addEventListener(r,this.handlers[r]);this.measureReq={read:r=>{this.editContext.updateControlBounds(r.contentDOM.getBoundingClientRect());let i=xc(r.root);i&&i.rangeCount&&this.editContext.updateSelectionBounds(i.getRangeAt(0).getBoundingClientRect())}}}applyEdits(e){let t=0,r=!1,i=this.pendingContextChange;return e.changes.iterChanges((s,o,a,l,c)=>{if(r)return;let u=c.length-(o-s);if(i&&o>=i.to)if(i.from==s&&i.to==o&&i.insert.eq(c)){i=this.pendingContextChange=null,t+=u,this.to+=u;return}else i=null,this.revertPending(e.state);if(s+=t,o+=t,o<=this.from)this.from+=u,this.to+=u;else if(s<this.to){if(s<this.from||o>this.to||this.to-this.from+c.length>3e4){r=!0;return}this.editContext.updateText(this.toContextPos(s),this.toContextPos(o),c.toString()),this.to+=u}t+=u}),i&&!r&&this.revertPending(e.state),!r}update(e){let t=this.pendingContextChange,r=e.startState.selection.main;this.composing&&(this.composing.drifted||!e.changes.touchesRange(r.from,r.to)&&e.transactions.some(i=>!i.isUserEvent("input.type")&&i.changes.touchesRange(this.from,this.to)))?(this.composing.drifted=!0,this.composing.editorBase=e.changes.mapPos(this.composing.editorBase)):!this.applyEdits(e)||!this.rangeIsValid(e.state)?(this.pendingContextChange=null,this.reset(e.state)):(e.docChanged||e.selectionSet||t)&&this.setSelection(e.state),(e.geometryChanged||e.docChanged||e.selectionSet)&&e.view.requestMeasure(this.measureReq)}resetRange(e){let{head:t}=e.selection.main;this.from=Math.max(0,t-1e4),this.to=Math.min(e.doc.length,t+1e4)}reset(e){this.resetRange(e),this.editContext.updateText(0,this.editContext.text.length,e.doc.sliceString(this.from,this.to)),this.setSelection(e)}revertPending(e){let t=this.pendingContextChange;this.pendingContextChange=null,this.editContext.updateText(this.toContextPos(t.from),this.toContextPos(t.from+t.insert.length),e.doc.sliceString(t.from,t.to))}setSelection(e){let{main:t}=e.selection,r=this.toContextPos(Math.max(this.from,Math.min(this.to,t.anchor))),i=this.toContextPos(t.head);(this.editContext.selectionStart!=r||this.editContext.selectionEnd!=i)&&this.editContext.updateSelection(r,i)}rangeIsValid(e){let{head:t}=e.selection.main;return!(this.from>0&&t-this.from<500||this.to<e.doc.length&&this.to-t<500||this.to-this.from>1e4*3)}toEditorPos(e,t=this.to-this.from){e=Math.min(e,t);let r=this.composing;return r&&r.drifted?r.editorBase+(e-r.contextBase):e+this.from}toContextPos(e){let t=this.composing;return t&&t.drifted?t.contextBase+(e-t.editorBase):e-this.from}destroy(){for(let e in this.handlers)this.editContext.removeEventListener(e,this.handlers[e])}}class Pe{get state(){return this.viewState.state}get viewport(){return this.viewState.viewport}get visibleRanges(){return this.viewState.visibleRanges}get inView(){return this.viewState.inView}get composing(){return!!this.inputState&&this.inputState.composing>0}get compositionStarted(){return!!this.inputState&&this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){var t;this.plugins=[],this.pluginMap=new Map,this.editorAttrs={},this.contentAttrs={},this.bidiCache=[],this.destroyed=!1,this.updateState=2,this.measureScheduled=-1,this.measureRequests=[],this.contentDOM=document.createElement("div"),this.scrollDOM=document.createElement("div"),this.scrollDOM.tabIndex=-1,this.scrollDOM.className="cm-scroller",this.scrollDOM.appendChild(this.contentDOM),this.announceDOM=document.createElement("div"),this.announceDOM.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:r}=e;this.dispatchTransactions=e.dispatchTransactions||r&&(i=>i.forEach(s=>r(s,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||tL(e.parent)||document,this.viewState=new $y(e.state||Pt.create(e)),e.scrollTo&&e.scrollTo.is(Au)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Sa).map(i=>new jh(i));for(let i of this.plugins)i.update(this);this.observer=new AM(this),this.inputState=new UL(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Oy(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),!((t=document.fonts)===null||t===void 0)&&t.ready&&document.fonts.ready.then(()=>{this.viewState.mustMeasureContent=!0,this.requestMeasure()})}dispatch(...e){let t=e.length==1&&e[0]instanceof En?e:e.length==1&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(this.updateState!=0)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t=!1,r=!1,i,s=this.state;for(let d of e){if(d.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=d.state}if(this.destroyed){this.viewState.state=s;return}let o=this.hasFocus,a=0,l=null;e.some(d=>d.annotation(H2))?(this.inputState.notifiedFocused=o,a=1):o!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=o,l=K2(s,o),l||(a=1));let c=this.observer.delayedAndroidKey,u=null;if(c?(this.observer.clearDelayedAndroidKey(),u=this.observer.readChange(),(u&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(u=null)):this.observer.clear(),s.facet(Pt.phrases)!=this.state.facet(Pt.phrases))return this.setState(s);i=Xf.create(this,s,e),i.flags|=a;let f=this.viewState.scrollTarget;try{this.updateState=2;for(let d of e){if(f&&(f=f.map(d.changes)),d.scrollIntoView){let{main:h}=d.state.selection;f=new Da(h.empty?h:me.cursor(h.head,h.head>h.anchor?-1:1))}for(let h of d.effects)h.is(Au)&&(f=h.value.clip(this.state))}this.viewState.update(i,f),this.bidiCache=Gf.update(this.bidiCache,i.changes),i.empty||(this.updatePlugins(i),this.inputState.update(i)),t=this.docView.update(i),this.state.facet(Ul)!=this.styleModules&&this.mountStyles(),r=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(d=>d.isUserEvent("select.pointer")))}finally{this.updateState=0}if(i.startState.facet(Qu)!=i.state.facet(Qu)&&(this.viewState.mustMeasureContent=!0),(t||r||f||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),t&&this.docViewUpdate(),!i.empty)for(let d of this.state.facet(Im))try{d(i)}catch(h){zr(this.state,h,"update listener")}(l||u)&&Promise.resolve().then(()=>{l&&this.state==l.startState&&this.dispatch(l),u&&!F2(this,u)&&c.force&&Ra(this.contentDOM,c.key,c.keyCode)})}setState(e){if(this.updateState!=0)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed){this.viewState.state=e;return}this.updateState=2;let t=this.hasFocus;try{for(let r of this.plugins)r.destroy(this);this.viewState=new $y(e),this.plugins=e.facet(Sa).map(r=>new jh(r)),this.pluginMap.clear();for(let r of this.plugins)r.update(this);this.docView.destroy(),this.docView=new Oy(this),this.inputState.ensureHandlers(this.plugins),this.mountStyles(),this.updateAttrs(),this.bidiCache=[]}finally{this.updateState=0}t&&this.focus(),this.requestMeasure()}updatePlugins(e){let t=e.startState.facet(Sa),r=e.state.facet(Sa);if(t!=r){let i=[];for(let s of r){let o=t.indexOf(s);if(o<0)i.push(new jh(s));else{let a=this.plugins[o];a.mustUpdate=e,i.push(a)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=i,this.pluginMap.clear()}else for(let i of this.plugins)i.mustUpdate=e;for(let i=0;i<this.plugins.length;i++)this.plugins[i].update(this);t!=r&&this.inputState.ensureHandlers(this.plugins)}docViewUpdate(){for(let e of this.plugins){let t=e.value;if(t&&t.docViewUpdate)try{t.docViewUpdate(this)}catch(r){zr(this.state,r,"doc view update listener")}}}measure(e=!0){if(this.destroyed)return;if(this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey){this.measureScheduled=-1,this.requestMeasure();return}this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,r=this.scrollDOM,i=r.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:o}=this.viewState;Math.abs(i-this.viewState.scrollTop)>1&&(o=-1),this.viewState.scrollAnchorHeight=-1;try{for(let a=0;;a++){if(o<0)if(b2(r))s=-1,o=this.viewState.heightMap.height;else{let h=this.viewState.scrollAnchorAt(i);s=h.from,o=h.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(a>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];l&4||([this.measureRequests,c]=[c,this.measureRequests]);let u=c.map(h=>{try{return h.read(this)}catch(m){return zr(this.state,m),Ry}}),f=Xf.create(this,this.state,[]),d=!1;f.flags|=l,t?t.flags|=l:t=f,this.updateState=2,f.empty||(this.updatePlugins(f),this.inputState.update(f),this.updateAttrs(),d=this.docView.update(f),d&&this.docViewUpdate());for(let h=0;h<c.length;h++)if(u[h]!=Ry)try{let m=c[h];m.write&&m.write(u[h],this)}catch(m){zr(this.state,m)}if(d&&this.docView.updateSelection(!0),!f.viewportChanged&&this.measureRequests.length==0){if(this.viewState.editorHeight)if(this.viewState.scrollTarget){this.docView.scrollIntoView(this.viewState.scrollTarget),this.viewState.scrollTarget=null,o=-1;continue}else{let m=(s<0?this.viewState.heightMap.height:this.viewState.lineBlockAt(s).top)-o;if(m>1||m<-1){i=i+m,r.scrollTop=i/this.scaleY,o=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let a of this.state.facet(Im))a(t)}get themeClasses(){return Zm+" "+(this.state.facet(zm)?nx:tx)+" "+this.state.facet(Qu)}updateAttrs(){let e=Dy(this,R2,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",writingsuggestions:"false",translate:"no",contenteditable:this.state.facet(hs)?"true":"false",class:"cm-content",style:`${Le.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),Dy(this,Wv,t);let r=this.observer.ignore(()=>{let i=dy(this.contentDOM,this.contentAttrs,t),s=dy(this.dom,this.editorAttrs,e);return i||s});return this.editorAttrs=e,this.contentAttrs=t,r}showAnnouncements(e){let t=!0;for(let r of e)for(let i of r.effects)if(i.is(Pe.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=i.value}}mountStyles(){this.styleModules=this.state.facet(Ul);let e=this.state.facet(Pe.cspNonce);to.mount(this.root,this.styleModules.concat(xM).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(this.updateState==2)throw new Error("Reading the editor layout isn't allowed during an update");this.updateState==0&&this.measureScheduled>-1&&this.measure(!1)}requestMeasure(e){if(this.measureScheduled<0&&(this.measureScheduled=this.win.requestAnimationFrame(()=>this.measure())),e){if(this.measureRequests.indexOf(e)>-1)return;if(e.key!=null){for(let t=0;t<this.measureRequests.length;t++)if(this.measureRequests[t].key===e.key){this.measureRequests[t]=e;return}}this.measureRequests.push(e)}}plugin(e){let t=this.pluginMap.get(e);return(t===void 0||t&&t.plugin!=e)&&this.pluginMap.set(e,t=this.plugins.find(r=>r.plugin==e)||null),t&&t.update(this).value}get documentTop(){return this.contentDOM.getBoundingClientRect().top+this.viewState.paddingTop}get documentPadding(){return{top:this.viewState.paddingTop,bottom:this.viewState.paddingBottom}}get scaleX(){return this.viewState.scaleX}get scaleY(){return this.viewState.scaleY}elementAtHeight(e){return this.readMeasured(),this.viewState.elementAtHeight(e)}lineBlockAtHeight(e){return this.readMeasured(),this.viewState.lineBlockAtHeight(e)}get viewportLineBlocks(){return this.viewState.viewportLines}lineBlockAt(e){return this.viewState.lineBlockAt(e)}get contentHeight(){return this.viewState.contentHeight}moveByChar(e,t,r){return Xh(this,e,by(this,e,t,r))}moveByGroup(e,t){return Xh(this,e,by(this,e,t,r=>NL(this,e.head,r)))}visualLineSide(e,t){let r=this.bidiSpans(e),i=this.textDirectionAt(e.from),s=r[t?r.length-1:0];return me.cursor(s.side(t,i)+e.from,s.forward(!t,i)?1:-1)}moveToLineBoundary(e,t,r=!0){return IL(this,e,t,r)}moveVertically(e,t,r){return Xh(this,e,BL(this,e,t,r))}domAtPos(e,t=1){return this.docView.domAtPos(e,t)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){this.readMeasured();let r=Bm(this,e,t);return r&&r.pos}posAndSideAtCoords(e,t=!0){return this.readMeasured(),Bm(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let r=this.docView.coordsAt(e,t);if(!r||r.left==r.right)return r;let i=this.state.doc.lineAt(e),s=this.bidiSpans(i),o=s[Vi.find(s,e-i.from,-1,t)];return Ff(r,o.dir==bn.LTR==t>0)}coordsForChar(e){return this.readMeasured(),this.docView.coordsForChar(e)}get defaultCharacterWidth(){return this.viewState.heightOracle.charWidth}get defaultLineHeight(){return this.viewState.heightOracle.lineHeight}get textDirection(){return this.viewState.defaultTextDirection}textDirectionAt(e){return!this.state.facet(L2)||e<this.viewport.from||e>this.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>PM)return S2(e.length);let t=this.textDirectionAt(e.from),r;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||x2(s.isolates,r=my(this,e))))return s.order;r||(r=my(this,e));let i=cL(e.text,t,r);return this.bidiCache.push(new Gf(e.from,e.to,t,r,!0,i)),i}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||Le.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{O2(this.contentDOM),this.docView.updateSelection()})}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((e.nodeType==9?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){this.root.activeElement==this.contentDOM&&this.contentDOM.blur();for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Au.of(new Da(typeof e=="number"?me.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,r=this.viewState.scrollAnchorAt(e);return Au.of(new Da(me.cursor(r.from),"start","start",r.top-e,t,!0))}setTabFocusMode(e){e==null?this.inputState.tabFocusMode=this.inputState.tabFocusMode<0?0:-1:typeof e=="boolean"?this.inputState.tabFocusMode=e?0:-1:this.inputState.tabFocusMode!=0&&(this.inputState.tabFocusMode=Date.now()+e)}static domEventHandlers(e){return pr.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return pr.define(()=>({}),{eventObservers:e})}static theme(e,t){let r=to.newName(),i=[Qu.of(r),Ul.of(Fm(`.${r}`,e))];return t&&t.dark&&i.push(zm.of(!0)),i}static baseTheme(e){return co.lowest(Ul.of(Fm("."+Zm,e,rx)))}static findFromDOM(e){var t;let r=e.querySelector(".cm-content"),i=r&&$n.get(r)||$n.get(e);return((t=i?.root)===null||t===void 0?void 0:t.view)||null}}Pe.styleModule=Ul;Pe.inputHandler=$2;Pe.clipboardInputFilter=Xv;Pe.clipboardOutputFilter=Vv;Pe.scrollHandler=M2;Pe.focusChangeEffect=Q2;Pe.perLineTextDirection=L2;Pe.exceptionSink=E2;Pe.updateListener=Im;Pe.editable=hs;Pe.mouseSelectionStyle=P2;Pe.dragMovesSelection=T2;Pe.clickAddsSelectionRange=C2;Pe.decorations=Kd;Pe.blockWrappers=D2;Pe.outerDecorations=Yv;Pe.atomicRanges=lu;Pe.bidiIsolatedRanges=I2;Pe.scrollMargins=N2;Pe.darkTheme=zm;Pe.cspNonce=Ie.define({combine:n=>n.length?n[0]:""});Pe.contentAttributes=Wv;Pe.editorAttributes=R2;Pe.lineWrapping=Pe.contentAttributes.of({class:"cm-lineWrapping"});Pe.announce=Qt.define();const PM=4096,Ry={};class Gf{constructor(e,t,r,i,s,o){this.from=e,this.to=t,this.dir=r,this.isolates=i,this.fresh=s,this.order=o}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let r=[],i=e.length?e[e.length-1].dir:bn.LTR;for(let s=Math.max(0,e.length-10);s<e.length;s++){let o=e[s];o.dir==i&&!t.touchesRange(o.from,o.to)&&r.push(new Gf(t.mapPos(o.from,1),t.mapPos(o.to,-1),o.dir,o.isolates,!1,o.order))}return r}}function Dy(n,e,t){for(let r=n.state.facet(e),i=r.length-1;i>=0;i--){let s=r[i],o=typeof s=="function"?s(n):s;o&&zv(o,t)}return t}const EM=Le.mac?"mac":Le.windows?"win":Le.linux?"linux":"key";function $M(n,e){const t=n.split(/-(?!$)/);let r=t[t.length-1];r=="Space"&&(r=" ");let i,s,o,a;for(let l=0;l<t.length-1;++l){const c=t[l];if(/^(cmd|meta|m)$/i.test(c))a=!0;else if(/^a(lt)?$/i.test(c))i=!0;else if(/^(c|ctrl|control)$/i.test(c))s=!0;else if(/^s(hift)?$/i.test(c))o=!0;else if(/^mod$/i.test(c))e=="mac"?a=!0:s=!0;else throw new Error("Unrecognized modifier name: "+c)}return i&&(r="Alt-"+r),s&&(r="Ctrl-"+r),a&&(r="Meta-"+r),o&&(r="Shift-"+r),r}function Lu(n,e,t){return e.altKey&&(n="Alt-"+n),e.ctrlKey&&(n="Ctrl-"+n),e.metaKey&&(n="Meta-"+n),t!==!1&&e.shiftKey&&(n="Shift-"+n),n}const QM=co.default(Pe.domEventHandlers({keydown(n,e){return sx(ix(e.state),n,e,"editor")}})),na=Ie.define({enables:QM}),Iy=new WeakMap;function ix(n){let e=n.facet(na),t=Iy.get(e);return t||Iy.set(e,t=qM(e.reduce((r,i)=>r.concat(i),[]))),t}function LM(n,e,t){return sx(ix(n.state),e,n,t)}let Zs=null;const MM=4e3;function qM(n,e=EM){let t=Object.create(null),r=Object.create(null),i=(o,a)=>{let l=r[o];if(l==null)r[o]=a;else if(l!=a)throw new Error("Key binding "+o+" is used both as a regular binding and as a multi-stroke prefix")},s=(o,a,l,c,u)=>{var f,d;let h=t[o]||(t[o]=Object.create(null)),m=a.split(/ (?!$)/).map(O=>$M(O,e));for(let O=1;O<m.length;O++){let b=m.slice(0,O).join(" ");i(b,!0),h[b]||(h[b]={preventDefault:!0,stopPropagation:!1,run:[w=>{let S=Zs={view:w,prefix:b,scope:o};return setTimeout(()=>{Zs==S&&(Zs=null)},MM),!0}]})}let p=m.join(" ");i(p,!1);let v=h[p]||(h[p]={preventDefault:!1,stopPropagation:!1,run:((d=(f=h._any)===null||f===void 0?void 0:f.run)===null||d===void 0?void 0:d.slice())||[]});l&&v.run.push(l),c&&(v.preventDefault=!0),u&&(v.stopPropagation=!0)};for(let o of n){let a=o.scope?o.scope.split(" "):["editor"];if(o.any)for(let c of a){let u=t[c]||(t[c]=Object.create(null));u._any||(u._any={preventDefault:!1,stopPropagation:!1,run:[]});let{any:f}=o;for(let d in u)u[d].run.push(h=>f(h,Xm))}let l=o[e]||o.key;if(l)for(let c of a)s(c,l,o.run,o.preventDefault,o.stopPropagation),o.shift&&s(c,"Shift-"+l,o.shift,o.preventDefault,o.stopPropagation)}return t}let Xm=null;function sx(n,e,t,r){Xm=e;let i=V5(e),s=Ns(i,0),o=ko(s)==i.length&&i!=" ",a="",l=!1,c=!1,u=!1;Zs&&Zs.view==t&&Zs.scope==r&&(a=Zs.prefix+" ",W2.indexOf(e.keyCode)<0&&(c=!0,Zs=null));let f=new Set,d=v=>{if(v){for(let O of v.run)if(!f.has(O)&&(f.add(O),O(t)))return v.stopPropagation&&(u=!0),!0;v.preventDefault&&(v.stopPropagation&&(u=!0),c=!0)}return!1},h=n[r],m,p;return h&&(d(h[a+Lu(i,e,!o)])?l=!0:o&&(e.altKey||e.metaKey||e.ctrlKey)&&!(Le.windows&&e.ctrlKey&&e.altKey)&&!(Le.mac&&e.altKey&&!(e.ctrlKey||e.metaKey))&&(m=no[e.keyCode])&&m!=i?(d(h[a+Lu(m,e,!0)])||e.shiftKey&&(p=_c[e.keyCode])!=i&&p!=m&&d(h[a+Lu(p,e,!1)]))&&(l=!0):o&&e.shiftKey&&d(h[a+Lu(i,e,!0)])&&(l=!0),!l&&d(h._any)&&(l=!0)),c&&(l=!0),l&&u&&e.stopPropagation(),Xm=null,l}function RM(){return IM}const DM=ft.line({class:"cm-activeLine"}),IM=pr.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.docChanged||n.selectionSet)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=-1,t=[];for(let r of n.state.selection.ranges){let i=n.lineBlockAt(r.head);i.from>e&&(t.push(DM.range(i.from)),e=i.from)}return ft.set(t)}},{decorations:n=>n.decorations}),Mu="-10000px";class NM{constructor(e,t,r,i){this.facet=t,this.createTooltipView=r,this.removeTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(o=>o);let s=null;this.tooltipViews=this.tooltips.map(o=>s=r(o,s))}update(e,t){var r;let i=e.state.facet(this.facet),s=i.filter(l=>l);if(i===this.input){for(let l of this.tooltipViews)l.update&&l.update(e);return!1}let o=[],a=t?[]:null;for(let l=0;l<s.length;l++){let c=s[l],u=-1;if(c){for(let f=0;f<this.tooltips.length;f++){let d=this.tooltips[f];d&&d.create==c.create&&(u=f)}if(u<0)o[l]=this.createTooltipView(c,l?o[l-1]:null),a&&(a[l]=!!c.above);else{let f=o[l]=this.tooltipViews[u];a&&(a[l]=t[u]),f.update&&f.update(e)}}}for(let l of this.tooltipViews)o.indexOf(l)<0&&(this.removeTooltipView(l),(r=l.destroy)===null||r===void 0||r.call(l));return t&&(a.forEach((l,c)=>t[c]=l),t.length=a.length),this.input=i,this.tooltips=s,this.tooltipViews=o,!0}}function BM(n){let e=n.dom.ownerDocument.documentElement;return{top:0,left:0,bottom:e.clientHeight,right:e.clientWidth}}const Yh=Ie.define({combine:n=>{var e,t,r;return{position:Le.ios?"absolute":((e=n.find(i=>i.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(i=>i.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((r=n.find(i=>i.tooltipSpace))===null||r===void 0?void 0:r.tooltipSpace)||BM}}}),Ny=new WeakMap,ox=pr.fromClass(class{constructor(n){this.view=n,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let e=n.state.facet(Yh);this.position=e.position,this.parent=e.parent,this.classes=n.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.resizeObserver=typeof ResizeObserver=="function"?new ResizeObserver(()=>this.measureSoon()):null,this.manager=new NM(n,ax,(t,r)=>this.createTooltip(t,r),t=>{this.resizeObserver&&this.resizeObserver.unobserve(t.dom),t.dom.remove()}),this.above=this.manager.tooltips.map(t=>!!t.above),this.intersectionObserver=typeof IntersectionObserver=="function"?new IntersectionObserver(t=>{Date.now()>this.lastTransaction-50&&t.length>0&&t[t.length-1].intersectionRatio<1&&this.measureSoon()},{threshold:[1]}):null,this.observeIntersection(),n.win.addEventListener("resize",this.measureSoon=this.measureSoon.bind(this)),this.maybeMeasure()}createContainer(){this.parent?(this.container=document.createElement("div"),this.container.style.position="relative",this.container.className=this.view.themeClasses,this.parent.appendChild(this.container)):this.container=this.view.dom}observeIntersection(){if(this.intersectionObserver){this.intersectionObserver.disconnect();for(let n of this.manager.tooltipViews)this.intersectionObserver.observe(n.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout(()=>{this.measureTimeout=-1,this.maybeMeasure()},50))}update(n){n.transactions.length&&(this.lastTransaction=Date.now());let e=this.manager.update(n,this.above);e&&this.observeIntersection();let t=e||n.geometryChanged,r=n.state.facet(Yh);if(r.position!=this.position&&!this.madeAbsolute){this.position=r.position;for(let i of this.manager.tooltipViews)i.dom.style.position=this.position;t=!0}if(r.parent!=this.parent){this.parent&&this.container.remove(),this.parent=r.parent,this.createContainer();for(let i of this.manager.tooltipViews)this.container.appendChild(i.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n,e){let t=n.create(this.view),r=e?e.dom:null;if(t.dom.classList.add("cm-tooltip"),n.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let i=document.createElement("div");i.className="cm-tooltip-arrow",t.dom.appendChild(i)}return t.dom.style.position=this.position,t.dom.style.top=Mu,t.dom.style.left="0px",this.container.insertBefore(t.dom,r),t.mount&&t.mount(this.view),this.resizeObserver&&this.resizeObserver.observe(t.dom),t}destroy(){var n,e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let r of this.manager.tooltipViews)r.dom.remove(),(n=r.destroy)===null||n===void 0||n.call(r);this.parent&&this.container.remove(),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),(t=this.intersectionObserver)===null||t===void 0||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=1,e=1,t=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:s}=this.manager.tooltipViews[0];if(Le.safari){let o=s.getBoundingClientRect();t=Math.abs(o.top+1e4)>1||Math.abs(o.left)>1}else t=!!s.offsetParent&&s.offsetParent!=this.container.ownerDocument.body}if(t||this.position=="absolute")if(this.parent){let s=this.parent.getBoundingClientRect();s.width&&s.height&&(n=s.width/this.parent.offsetWidth,e=s.height/this.parent.offsetHeight)}else({scaleX:n,scaleY:e}=this.view.viewState);let r=this.view.scrollDOM.getBoundingClientRect(),i=Uv(this.view);return{visible:{left:r.left+i.left,top:r.top+i.top,right:r.right-i.right,bottom:r.bottom-i.bottom},parent:this.parent?this.container.getBoundingClientRect():this.view.dom.getBoundingClientRect(),pos:this.manager.tooltips.map((s,o)=>{let a=this.manager.tooltipViews[o];return a.getCoords?a.getCoords(s.pos):this.view.coordsAtPos(s.pos)}),size:this.manager.tooltipViews.map(({dom:s})=>s.getBoundingClientRect()),space:this.view.state.facet(Yh).tooltipSpace(this.view),scaleX:n,scaleY:e,makeAbsolute:t}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let a of this.manager.tooltipViews)a.dom.style.position="absolute"}let{visible:t,space:r,scaleX:i,scaleY:s}=n,o=[];for(let a=0;a<this.manager.tooltips.length;a++){let l=this.manager.tooltips[a],c=this.manager.tooltipViews[a],{dom:u}=c,f=n.pos[a],d=n.size[a];if(!f||l.clip!==!1&&(f.bottom<=Math.max(t.top,r.top)||f.top>=Math.min(t.bottom,r.bottom)||f.right<Math.max(t.left,r.left)-.1||f.left>Math.min(t.right,r.right)+.1)){u.style.top=Mu;continue}let h=l.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=h?7:0,p=d.right-d.left,v=(e=Ny.get(c))!==null&&e!==void 0?e:d.bottom-d.top,O=c.offset||zM,b=this.view.textDirection==bn.LTR,w=d.width>r.right-r.left?b?r.left:r.right-d.width:b?Math.max(r.left,Math.min(f.left-(h?14:0)+O.x,r.right-p)):Math.min(Math.max(r.left,f.left-p+(h?14:0)-O.x),r.right-p),S=this.above[a];!l.strictSide&&(S?f.top-v-m-O.y<r.top:f.bottom+v+m+O.y>r.bottom)&&S==r.bottom-f.bottom>f.top-r.top&&(S=this.above[a]=!S);let _=(S?f.top-r.top:r.bottom-f.bottom)-m;if(_<v&&c.resize!==!1){if(_<this.view.defaultLineHeight){u.style.top=Mu;continue}Ny.set(c,v),u.style.height=(v=_)/s+"px"}else u.style.height&&(u.style.height="");let x=S?f.top-v-m-O.y:f.bottom+m+O.y,A=w+p;if(c.overlap!==!0)for(let C of o)C.left<A&&C.right>w&&C.top<x+v&&C.bottom>x&&(x=S?C.top-v-2-m:C.bottom+m+2);if(this.position=="absolute"?(u.style.top=(x-n.parent.top)/s+"px",By(u,(w-n.parent.left)/i)):(u.style.top=x/s+"px",By(u,w/i)),h){let C=f.left+(b?O.x:-O.x)-(w+14-7);h.style.left=C/i+"px"}c.overlap!==!0&&o.push({left:w,top:x,right:A,bottom:x+v}),u.classList.toggle("cm-tooltip-above",S),u.classList.toggle("cm-tooltip-below",!S),c.positioned&&c.positioned(n.space)}}maybeMeasure(){if(this.manager.tooltips.length&&(this.view.inView&&this.view.requestMeasure(this.measureReq),this.inView!=this.view.inView&&(this.inView=this.view.inView,!this.inView)))for(let n of this.manager.tooltipViews)n.dom.style.top=Mu}},{eventObservers:{scroll(){this.maybeMeasure()}}});function By(n,e){let t=parseInt(n.style.left,10);(isNaN(t)||Math.abs(e-t)>1)&&(n.style.left=e+"px")}const jM=Pe.baseTheme({".cm-tooltip":{zIndex:500,boxSizing:"border-box"},"&light .cm-tooltip":{border:"1px solid #bbb",backgroundColor:"#f5f5f5"},"&light .cm-tooltip-section:not(:first-child)":{borderTop:"1px solid #bbb"},"&dark .cm-tooltip":{backgroundColor:"#333338",color:"white"},".cm-tooltip-arrow":{height:"7px",width:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),zM={x:0,y:0},ax=Ie.define({enables:[ox,jM]});function lx(n,e){let t=n.plugin(ox);if(!t)return null;let r=t.manager.tooltips.indexOf(e);return r<0?null:t.manager.tooltipViews[r]}const jy=Ie.define({combine(n){let e,t;for(let r of n)e=e||r.topContainer,t=t||r.bottomContainer;return{topContainer:e,bottomContainer:t}}});function cx(n,e){let t=n.plugin(ux),r=t?t.specs.indexOf(e):-1;return r>-1?t.panels[r]:null}const ux=pr.fromClass(class{constructor(n){this.input=n.state.facet(Hf),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(jy);this.top=new qu(n,!0,e.topContainer),this.bottom=new qu(n,!1,e.bottomContainer),this.top.sync(this.panels.filter(t=>t.top)),this.bottom.sync(this.panels.filter(t=>!t.top));for(let t of this.panels)t.dom.classList.add("cm-panel"),t.mount&&t.mount()}update(n){let e=n.state.facet(jy);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new qu(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new qu(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(Hf);if(t!=this.input){let r=t.filter(l=>l),i=[],s=[],o=[],a=[];for(let l of r){let c=this.specs.indexOf(l),u;c<0?(u=l(n.view),a.push(u)):(u=this.panels[c],u.update&&u.update(n)),i.push(u),(u.top?s:o).push(u)}this.specs=r,this.panels=i,this.top.sync(s),this.bottom.sync(o);for(let l of a)l.dom.classList.add("cm-panel"),l.mount&&l.mount()}else for(let r of this.panels)r.update&&r.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>Pe.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class qu{constructor(e,t,r){this.view=e,this.top=t,this.container=r,this.dom=void 0,this.classes="",this.panels=[],this.syncClasses()}sync(e){for(let t of this.panels)t.destroy&&e.indexOf(t)<0&&t.destroy();this.panels=e,this.syncDOM()}syncDOM(){if(this.panels.length==0){this.dom&&(this.dom.remove(),this.dom=void 0);return}if(!this.dom){this.dom=document.createElement("div"),this.dom.className=this.top?"cm-panels cm-panels-top":"cm-panels cm-panels-bottom",this.dom.style[this.top?"top":"bottom"]="0";let t=this.container||this.view.dom;t.insertBefore(this.dom,this.top?t.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=zy(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=zy(e)}scrollMargin(){return!this.dom||this.container?0:Math.max(0,this.top?this.dom.getBoundingClientRect().bottom-Math.max(0,this.view.scrollDOM.getBoundingClientRect().top):Math.min(innerHeight,this.view.scrollDOM.getBoundingClientRect().bottom)-this.dom.getBoundingClientRect().top)}syncClasses(){if(!(!this.container||this.classes==this.view.themeClasses)){for(let e of this.classes.split(" "))e&&this.container.classList.remove(e);for(let e of(this.classes=this.view.themeClasses).split(" "))e&&this.container.classList.add(e)}}}function zy(n){let e=n.nextSibling;return n.remove(),e}const Hf=Ie.define({enables:ux});function ZM(n,e){let t,r=new Promise(o=>t=o),i=o=>FM(o,e,t);n.state.field(Uh,!1)?n.dispatch({effects:fx.of(i)}):n.dispatch({effects:Qt.appendConfig.of(Uh.init(()=>[i]))});let s=dx.of(i);return{close:s,result:r.then(o=>((n.win.queueMicrotask||(l=>n.win.setTimeout(l,10)))(()=>{n.state.field(Uh).indexOf(i)>-1&&n.dispatch({effects:s})}),o))}}const Uh=ui.define({create(){return[]},update(n,e){for(let t of e.effects)t.is(fx)?n=[t.value].concat(n):t.is(dx)&&(n=n.filter(r=>r!=t.value));return n},provide:n=>Hf.computeN([n],e=>e.field(n))}),fx=Qt.define(),dx=Qt.define();function FM(n,e,t){let r=e.content?e.content(n,()=>o(null)):null;if(!r){if(r=zn("form"),e.input){let a=zn("input",e.input);/^(text|password|number|email|tel|url)$/.test(a.type)&&a.classList.add("cm-textfield"),a.name||(a.name="input"),r.appendChild(zn("label",(e.label||"")+": ",a))}else r.appendChild(document.createTextNode(e.label||""));r.appendChild(document.createTextNode(" ")),r.appendChild(zn("button",{class:"cm-button",type:"submit"},e.submitLabel||"OK"))}let i=r.nodeName=="FORM"?[r]:r.querySelectorAll("form");for(let a=0;a<i.length;a++){let l=i[a];l.addEventListener("keydown",c=>{c.keyCode==27?(c.preventDefault(),o(null)):c.keyCode==13&&(c.preventDefault(),o(l))}),l.addEventListener("submit",c=>{c.preventDefault(),o(l)})}let s=zn("div",r,zn("button",{onclick:()=>o(null),"aria-label":n.state.phrase("close"),class:"cm-dialog-close",type:"button"},["×"]));e.class&&(s.className=e.class),s.classList.add("cm-dialog");function o(a){s.contains(s.ownerDocument.activeElement)&&n.focus(),t(a)}return{dom:s,top:e.top,mount:()=>{if(e.focus){let a;typeof e.focus=="string"?a=r.querySelector(e.focus):a=r.querySelector("input")||r.querySelector("button"),a&&"select"in a?a.select():a&&"focus"in a&&a.focus()}}}}class io extends eo{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}io.prototype.elementClass="";io.prototype.toDOM=void 0;io.prototype.mapMode=fr.TrackBefore;io.prototype.startSide=io.prototype.endSide=-1;io.prototype.point=!0;const bf=Ie.define(),XM=Ie.define(),yf=Ie.define(),Zy=Ie.define({combine:n=>n.some(e=>e)});function VM(n){return[WM]}const WM=pr.fromClass(class{constructor(n){this.view=n,this.domAfter=null,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters cm-gutters-before",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(yf).map(e=>new Xy(n,e)),this.fixed=!n.state.facet(Zy);for(let e of this.gutters)e.config.side=="after"?this.getDOMAfter().appendChild(e.dom):this.dom.appendChild(e.dom);this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}getDOMAfter(){return this.domAfter||(this.domAfter=document.createElement("div"),this.domAfter.className="cm-gutters cm-gutters-after",this.domAfter.setAttribute("aria-hidden","true"),this.domAfter.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.domAfter.style.position=this.fixed?"sticky":"",this.view.scrollDOM.appendChild(this.domAfter)),this.domAfter}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,r=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(r<(t.to-t.from)*.8)}if(n.geometryChanged){let e=this.view.contentHeight/this.view.scaleY+"px";this.dom.style.minHeight=e,this.domAfter&&(this.domAfter.style.minHeight=e)}this.view.state.facet(Zy)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":"",this.domAfter&&(this.domAfter.style.position=this.fixed?"sticky":"")),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&(this.dom.remove(),this.domAfter&&this.domAfter.remove());let t=$t.iter(this.view.state.facet(bf),this.view.viewport.from),r=[],i=this.gutters.map(s=>new YM(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(r.length&&(r=[]),Array.isArray(s.type)){let o=!0;for(let a of s.type)if(a.type==$r.Text&&o){Vm(t,r,a.from);for(let l of i)l.line(this.view,a,r);o=!1}else if(a.widget)for(let l of i)l.widget(this.view,a)}else if(s.type==$r.Text){Vm(t,r,s.from);for(let o of i)o.line(this.view,s,r)}else if(s.widget)for(let o of i)o.widget(this.view,s);for(let s of i)s.finish();n&&(this.view.scrollDOM.insertBefore(this.dom,e),this.domAfter&&this.view.scrollDOM.appendChild(this.domAfter))}updateGutters(n){let e=n.startState.facet(yf),t=n.state.facet(yf),r=n.docChanged||n.heightChanged||n.viewportChanged||!$t.eq(n.startState.facet(bf),n.state.facet(bf),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let i of this.gutters)i.update(n)&&(r=!0);else{r=!0;let i=[];for(let s of t){let o=e.indexOf(s);o<0?i.push(new Xy(this.view,s)):(this.gutters[o].update(n),i.push(this.gutters[o]))}for(let s of this.gutters)s.dom.remove(),i.indexOf(s)<0&&s.destroy();for(let s of i)s.config.side=="after"?this.getDOMAfter().appendChild(s.dom):this.dom.appendChild(s.dom);this.gutters=i}return r}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove(),this.domAfter&&this.domAfter.remove()}},{provide:n=>Pe.scrollMargins.of(e=>{let t=e.plugin(n);if(!t||t.gutters.length==0||!t.fixed)return null;let r=t.dom.offsetWidth*e.scaleX,i=t.domAfter?t.domAfter.offsetWidth*e.scaleX:0;return e.textDirection==bn.LTR?{left:r,right:i}:{right:r,left:i}})});function Fy(n){return Array.isArray(n)?n:[n]}function Vm(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class YM{constructor(e,t,r){this.gutter=e,this.height=r,this.i=0,this.cursor=$t.iter(e.markers,t.from)}addElement(e,t,r){let{gutter:i}=this,s=(t.top-this.height)/e.scaleY,o=t.height/e.scaleY;if(this.i==i.elements.length){let a=new hx(e,o,s,r);i.elements.push(a),i.dom.appendChild(a.dom)}else i.elements[this.i].update(e,o,s,r);this.height=t.bottom,this.i++}line(e,t,r){let i=[];Vm(this.cursor,i,t.from),r.length&&(i=i.concat(r));let s=this.gutter.config.lineMarker(e,t,i);s&&i.unshift(s);let o=this.gutter;i.length==0&&!o.config.renderEmptyElements||this.addElement(e,t,i)}widget(e,t){let r=this.gutter.config.widgetMarker(e,t.widget,t),i=r?[r]:null;for(let s of e.state.facet(XM)){let o=s(e,t.widget,t);o&&(i||(i=[])).push(o)}i&&this.addElement(e,t,i)}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Xy{constructor(e,t){this.view=e,this.config=t,this.elements=[],this.spacer=null,this.dom=document.createElement("div"),this.dom.className="cm-gutter"+(this.config.class?" "+this.config.class:"");for(let r in t.domEventHandlers)this.dom.addEventListener(r,i=>{let s=i.target,o;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let l=s.getBoundingClientRect();o=(l.top+l.bottom)/2}else o=i.clientY;let a=e.lineBlockAtHeight(o-e.documentTop);t.domEventHandlers[r](e,a,i)&&i.preventDefault()});this.markers=Fy(t.markers(e)),t.initialSpacer&&(this.spacer=new hx(e,0,0,[t.initialSpacer(e)]),this.dom.appendChild(this.spacer.dom),this.spacer.dom.style.cssText+="visibility: hidden; pointer-events: none")}update(e){let t=this.markers;if(this.markers=Fy(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let i=this.config.updateSpacer(this.spacer.markers[0],e);i!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[i])}let r=e.view.viewport;return!$t.eq(this.markers,t,r.from,r.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class hx{constructor(e,t,r,i){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,r,i)}update(e,t,r,i){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=r&&(this.dom.style.marginTop=(this.above=r)?r+"px":""),UM(this.markers,i)||this.setMarkers(e,i)}setMarkers(e,t){let r="cm-gutterElement",i=this.dom.firstChild;for(let s=0,o=0;;){let a=o,l=s<t.length?t[s++]:null,c=!1;if(l){let u=l.elementClass;u&&(r+=" "+u);for(let f=o;f<this.markers.length;f++)if(this.markers[f].compare(l)){a=f,c=!0;break}}else a=this.markers.length;for(;o<a;){let u=this.markers[o++];if(u.toDOM){u.destroy(i);let f=i.nextSibling;i.remove(),i=f}}if(!l)break;l.toDOM&&(c?i=i.nextSibling:this.dom.insertBefore(l.toDOM(e),i)),c&&o++}this.dom.className=r,this.markers=t}destroy(){this.setMarkers(null,[])}}function UM(n,e){if(n.length!=e.length)return!1;for(let t=0;t<n.length;t++)if(!n[t].compare(e[t]))return!1;return!0}const GM=Ie.define(),HM=Ie.define(),Aa=Ie.define({combine(n){return iu(n,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let r=Object.assign({},e);for(let i in t){let s=r[i],o=t[i];r[i]=s?(a,l,c)=>s(a,l,c)||o(a,l,c):o}return r}})}});class Gh extends io{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function Hh(n,e){return n.state.facet(Aa).formatNumber(e,n.state)}const KM=yf.compute([Aa],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(GM)},lineMarker(e,t,r){return r.some(i=>i.toDOM)?null:new Gh(Hh(e,e.state.doc.lineAt(t.from).number))},widgetMarker:(e,t,r)=>{for(let i of e.state.facet(HM)){let s=i(e,t,r);if(s)return s}return null},lineMarkerChange:e=>e.startState.facet(Aa)!=e.state.facet(Aa),initialSpacer(e){return new Gh(Hh(e,Vy(e.state.doc.lines)))},updateSpacer(e,t){let r=Hh(t.view,Vy(t.view.state.doc.lines));return r==e.number?e:new Gh(r)},domEventHandlers:n.facet(Aa).domEventHandlers,side:"before"}));function JM(n={}){return[Aa.of(n),VM(),KM]}function Vy(n){let e=9;for(;e<n;)e=e*10+9;return e}const eq=new class extends io{constructor(){super(...arguments),this.elementClass="cm-activeLineGutter"}},tq=bf.compute(["selection"],n=>{let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.head).from;i>t&&(t=i,e.push(eq.range(i)))}return $t.of(e)});function nq(){return tq}const px=1024;let rq=0;class ei{constructor(e,t){this.from=e,this.to=t}}class et{constructor(e={}){this.id=rq++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")}),this.combine=e.combine||null}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ln.match(e)),t=>{let r=e(t);return r===void 0?null:[this,r]}}}et.closedBy=new et({deserialize:n=>n.split(" ")});et.openedBy=new et({deserialize:n=>n.split(" ")});et.group=new et({deserialize:n=>n.split(" ")});et.isolate=new et({deserialize:n=>{if(n&&n!="rtl"&&n!="ltr"&&n!="auto")throw new RangeError("Invalid value for isolate: "+n);return n||"auto"}});et.contextHash=new et({perNode:!0});et.lookAhead=new et({perNode:!0});et.mounted=new et({perNode:!0});class Ia{constructor(e,t,r,i=!1){this.tree=e,this.overlay=t,this.parser=r,this.bracketed=i}static get(e){return e&&e.props&&e.props[et.mounted.id]}}const iq=Object.create(null);class Ln{constructor(e,t,r,i=0){this.name=e,this.props=t,this.id=r,this.flags=i}static define(e){let t=e.props&&e.props.length?Object.create(null):iq,r=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),i=new Ln(e.name||"",t,e.id,r);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(i)),s){if(s[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[s[0].id]=s[1]}}return i}prop(e){return this.props[e.id]}get isTop(){return(this.flags&1)>0}get isSkipped(){return(this.flags&2)>0}get isError(){return(this.flags&4)>0}get isAnonymous(){return(this.flags&8)>0}is(e){if(typeof e=="string"){if(this.name==e)return!0;let t=this.prop(et.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let r in e)for(let i of r.split(" "))t[i]=e[r];return r=>{for(let i=r.prop(et.group),s=-1;s<(i?i.length:0);s++){let o=t[s<0?r.name:i[s]];if(o)return o}}}}Ln.none=new Ln("",Object.create(null),0,8);class vl{constructor(e){this.types=e;for(let t=0;t<e.length;t++)if(e[t].id!=t)throw new RangeError("Node type ids should correspond to array positions when creating a node set")}extend(...e){let t=[];for(let r of this.types){let i=null;for(let s of e){let o=s(r);if(o){i||(i=Object.assign({},r.props));let a=o[1],l=o[0];l.combine&&l.id in i&&(a=l.combine(i[l.id],a)),i[l.id]=a}}t.push(i?new Ln(r.name,i,r.id,r.flags):r)}return new vl(t)}}const Ru=new WeakMap,Wy=new WeakMap;var Zt;(function(n){n[n.ExcludeBuffers=1]="ExcludeBuffers",n[n.IncludeAnonymous=2]="IncludeAnonymous",n[n.IgnoreMounts=4]="IgnoreMounts",n[n.IgnoreOverlays=8]="IgnoreOverlays",n[n.EnterBracketed=16]="EnterBracketed"})(Zt||(Zt={}));class mt{constructor(e,t,r,i,s){if(this.type=e,this.children=t,this.positions=r,this.length=i,this.props=null,s&&s.length){this.props=Object.create(null);for(let[o,a]of s)this.props[typeof o=="number"?o:o.id]=a}}toString(){let e=Ia.get(this);if(e&&!e.overlay)return e.tree.toString();let t="";for(let r of this.children){let i=r.toString();i&&(t&&(t+=","),t+=i)}return this.type.name?(/\W/.test(this.type.name)&&!this.type.isError?JSON.stringify(this.type.name):this.type.name)+(t.length?"("+t+")":""):t}cursor(e=0){return new Kf(this.topNode,e)}cursorAt(e,t=0,r=0){let i=Ru.get(this)||this.topNode,s=new Kf(i);return s.moveTo(e,t),Ru.set(this,s._tree),s}get topNode(){return new or(this,0,0,null)}resolve(e,t=0){let r=Ac(Ru.get(this)||this.topNode,e,t,!1);return Ru.set(this,r),r}resolveInner(e,t=0){let r=Ac(Wy.get(this)||this.topNode,e,t,!0);return Wy.set(this,r),r}resolveStack(e,t=0){return aq(this,e,t)}iterate(e){let{enter:t,leave:r,from:i=0,to:s=this.length}=e,o=e.mode||0,a=(o&Zt.IncludeAnonymous)>0;for(let l=this.cursor(o|Zt.IncludeAnonymous);;){let c=!1;if(l.from<=s&&l.to>=i&&(!a&&l.type.isAnonymous||t(l)!==!1)){if(l.firstChild())continue;c=!0}for(;c&&r&&(a||!l.type.isAnonymous)&&r(l),!l.nextSibling();){if(!l.parent())return;c=!0}}}prop(e){return e.perNode?this.props?this.props[e.id]:void 0:this.type.prop(e)}get propValues(){let e=[];if(this.props)for(let t in this.props)e.push([+t,this.props[t]]);return e}balance(e={}){return this.children.length<=8?this:tO(Ln.none,this.children,this.positions,0,this.children.length,0,this.length,(t,r,i)=>new mt(this.type,t,r,i,this.propValues),e.makeTree||((t,r,i)=>new mt(Ln.none,t,r,i)))}static build(e){return lq(e)}}mt.empty=new mt(Ln.none,[],[],0);class Jv{constructor(e,t){this.buffer=e,this.index=t}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}get pos(){return this.index}next(){this.index-=4}fork(){return new Jv(this.buffer,this.index)}}class so{constructor(e,t,r){this.buffer=e,this.length=t,this.set=r}get type(){return Ln.none}toString(){let e=[];for(let t=0;t<this.buffer.length;)e.push(this.childString(t)),t=this.buffer[t+3];return e.join(",")}childString(e){let t=this.buffer[e],r=this.buffer[e+3],i=this.set.types[t],s=i.name;if(/\W/.test(s)&&!i.isError&&(s=JSON.stringify(s)),e+=4,r==e)return s;let o=[];for(;e<r;)o.push(this.childString(e)),e=this.buffer[e+3];return s+"("+o.join(",")+")"}findChild(e,t,r,i,s){let{buffer:o}=this,a=-1;for(let l=e;l!=t&&!(mx(s,i,o[l+1],o[l+2])&&(a=l,r>0));l=o[l+3]);return a}slice(e,t,r){let i=this.buffer,s=new Uint16Array(t-e),o=0;for(let a=e,l=0;a<t;){s[l++]=i[a++],s[l++]=i[a++]-r;let c=s[l++]=i[a++]-r;s[l++]=i[a++]-e,o=Math.max(o,c)}return new so(s,o,this.set)}}function mx(n,e,t,r){switch(n){case-2:return t<e;case-1:return r>=e&&t<e;case 0:return t<e&&r>e;case 1:return t<=e&&r>e;case 2:return r>e;case 4:return!0}}function Ac(n,e,t,r){for(var i;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to<e);){let o=!r&&n instanceof or&&n.index<0?null:n.parent;if(!o)return n;n=o}let s=r?0:Zt.IgnoreOverlays;if(r)for(let o=n,a=o.parent;a;o=a,a=o.parent)o instanceof or&&o.index<0&&((i=a.enter(e,t,s))===null||i===void 0?void 0:i.from)!=o.from&&(n=a);for(;;){let o=n.enter(e,t,s);if(!o)return n;n=o}}class gx{cursor(e=0){return new Kf(this,e)}getChild(e,t=null,r=null){let i=Yy(this,e,t,r);return i.length?i[0]:null}getChildren(e,t=null,r=null){return Yy(this,e,t,r)}resolve(e,t=0){return Ac(this,e,t,!1)}resolveInner(e,t=0){return Ac(this,e,t,!0)}matchContext(e){return Wm(this.parent,e)}enterUnfinishedNodesBefore(e){let t=this.childBefore(e),r=this;for(;t;){let i=t.lastChild;if(!i||i.to!=t.to)break;i.type.isError&&i.from==i.to?(r=t,t=i.prevSibling):t=i}return r}get node(){return this}get next(){return this.parent}}class or extends gx{constructor(e,t,r,i){super(),this._tree=e,this.from=t,this.index=r,this._parent=i}get type(){return this._tree.type}get name(){return this._tree.type.name}get to(){return this.from+this._tree.length}nextChild(e,t,r,i,s=0){for(let o=this;;){for(let{children:a,positions:l}=o._tree,c=t>0?a.length:-1;e!=c;e+=t){let u=a[e],f=l[e]+o.from,d;if(!(!(s&Zt.EnterBracketed&&u instanceof mt&&(d=Ia.get(u))&&!d.overlay&&d.bracketed&&r>=f&&r<=f+u.length)&&!mx(i,r,f,f+u.length))){if(u instanceof so){if(s&Zt.ExcludeBuffers)continue;let h=u.findChild(0,u.buffer.length,t,r-f,i);if(h>-1)return new Wi(new sq(o,u,e,f),null,h)}else if(s&Zt.IncludeAnonymous||!u.type.isAnonymous||eO(u)){let h;if(!(s&Zt.IgnoreMounts)&&(h=Ia.get(u))&&!h.overlay)return new or(h.tree,f,e,o);let m=new or(u,f,e,o);return s&Zt.IncludeAnonymous||!m.type.isAnonymous?m:m.nextChild(t<0?u.children.length-1:0,t,r,i,s)}}}if(s&Zt.IncludeAnonymous||!o.type.isAnonymous||(o.index>=0?e=o.index+t:e=t<0?-1:o._parent._tree.children.length,o=o._parent,!o))return null}}get firstChild(){return this.nextChild(0,1,0,4)}get lastChild(){return this.nextChild(this._tree.children.length-1,-1,0,4)}childAfter(e){return this.nextChild(0,1,e,2)}childBefore(e){return this.nextChild(this._tree.children.length-1,-1,e,-2)}prop(e){return this._tree.prop(e)}enter(e,t,r=0){let i;if(!(r&Zt.IgnoreOverlays)&&(i=Ia.get(this._tree))&&i.overlay){let s=e-this.from,o=r&Zt.EnterBracketed&&i.bracketed;for(let{from:a,to:l}of i.overlay)if((t>0||o?a<=s:a<s)&&(t<0||o?l>=s:l>s))return new or(i.tree,i.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,r)}nextSignificantParent(){let e=this;for(;e.type.isAnonymous&&e._parent;)e=e._parent;return e}get parent(){return this._parent?this._parent.nextSignificantParent():null}get nextSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index+1,1,0,4):null}get prevSibling(){return this._parent&&this.index>=0?this._parent.nextChild(this.index-1,-1,0,4):null}get tree(){return this._tree}toTree(){return this._tree}toString(){return this._tree.toString()}}function Yy(n,e,t,r){let i=n.cursor(),s=[];if(!i.firstChild())return s;if(t!=null){for(let o=!1;!o;)if(o=i.type.is(t),!i.nextSibling())return s}for(;;){if(r!=null&&i.type.is(r))return s;if(i.type.is(e)&&s.push(i.node),!i.nextSibling())return r==null?s:[]}}function Wm(n,e,t=e.length-1){for(let r=n;t>=0;r=r.parent){if(!r)return!1;if(!r.type.isAnonymous){if(e[t]&&e[t]!=r.name)return!1;t--}}return!0}class sq{constructor(e,t,r,i){this.parent=e,this.buffer=t,this.index=r,this.start=i}}class Wi extends gx{get name(){return this.type.name}get from(){return this.context.start+this.context.buffer.buffer[this.index+1]}get to(){return this.context.start+this.context.buffer.buffer[this.index+2]}constructor(e,t,r){super(),this.context=e,this._parent=t,this.index=r,this.type=e.buffer.set.types[e.buffer.buffer[r]]}child(e,t,r){let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.context.start,r);return s<0?null:new Wi(this.context,this,s)}get firstChild(){return this.child(1,0,4)}get lastChild(){return this.child(-1,0,4)}childAfter(e){return this.child(1,e,2)}childBefore(e){return this.child(-1,e,-2)}prop(e){return this.type.prop(e)}enter(e,t,r=0){if(r&Zt.ExcludeBuffers)return null;let{buffer:i}=this.context,s=i.findChild(this.index+4,i.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new Wi(this.context,this,s)}get parent(){return this._parent||this.context.parent.nextSignificantParent()}externalSibling(e){return this._parent?null:this.context.parent.nextChild(this.context.index+e,e,0,4)}get nextSibling(){let{buffer:e}=this.context,t=e.buffer[this.index+3];return t<(this._parent?e.buffer[this._parent.index+3]:e.buffer.length)?new Wi(this.context,this._parent,t):this.externalSibling(1)}get prevSibling(){let{buffer:e}=this.context,t=this._parent?this._parent.index+4:0;return this.index==t?this.externalSibling(-1):new Wi(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:r}=this.context,i=this.index+4,s=r.buffer[this.index+3];if(s>i){let o=r.buffer[this.index+1];e.push(r.slice(i,s,o)),t.push(0)}return new mt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function vx(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;s<n.length;s++){let o=n[s];(o.from>t.from||o.to<t.to)&&(t=o,e=s)}let r=t instanceof or&&t.index<0?null:t.parent,i=n.slice();return r?i[e]=r:i.splice(e,1),new oq(i,t)}class oq{constructor(e,t){this.heads=e,this.node=t}get next(){return vx(this.heads)}}function aq(n,e,t){let r=n.resolveInner(e,t),i=null;for(let s=r instanceof or?r:r.context.parent;s;s=s.parent)if(s.index<0){let o=s.parent;(i||(i=[r])).push(o.resolve(e,t)),s=o}else{let o=Ia.get(s.tree);if(o&&o.overlay&&o.overlay[0].from<=e&&o.overlay[o.overlay.length-1].to>=e){let a=new or(o.tree,o.overlay[0].from+s.from,-1,s);(i||(i=[r])).push(Ac(a,e,t,!1))}}return i?vx(i):r}class Kf{get name(){return this.type.name}constructor(e,t=0){if(this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,this.mode=t&~Zt.EnterBracketed,e instanceof or)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let r=e._parent;r;r=r._parent)this.stack.unshift(r.index);this.bufferNode=e,this.yieldBuf(e.index)}}yieldNode(e){return e?(this._tree=e,this.type=e.type,this.from=e.from,this.to=e.to,!0):!1}yieldBuf(e,t){this.index=e;let{start:r,buffer:i}=this.buffer;return this.type=t||i.set.types[i.buffer[e]],this.from=r+i.buffer[e+1],this.to=r+i.buffer[e+2],!0}yield(e){return e?e instanceof or?(this.buffer=null,this.yieldNode(e)):(this.buffer=e.context,this.yieldBuf(e.index,e.type)):!1}toString(){return this.buffer?this.buffer.buffer.childString(this.index):this._tree.toString()}enterChild(e,t,r){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,r,this.mode));let{buffer:i}=this.buffer,s=i.findChild(this.index+4,i.buffer[this.index+3],e,t-this.buffer.start,r);return s<0?!1:(this.stack.push(this.index),this.yieldBuf(s))}firstChild(){return this.enterChild(1,0,4)}lastChild(){return this.enterChild(-1,0,4)}childAfter(e){return this.enterChild(1,e,2)}childBefore(e){return this.enterChild(-1,e,-2)}enter(e,t,r=this.mode){return this.buffer?r&Zt.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,r))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Zt.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Zt.IncludeAnonymous?this.buffer.parent:this.buffer.parent.nextSignificantParent();return this.buffer=null,this.yieldNode(e)}sibling(e){if(!this.buffer)return this._tree._parent?this.yield(this._tree.index<0?null:this._tree._parent.nextChild(this._tree.index+e,e,0,4,this.mode)):!1;let{buffer:t}=this.buffer,r=this.stack.length-1;if(e<0){let i=r<0?0:this.stack[r]+4;if(this.index!=i)return this.yieldBuf(t.findChild(i,this.index,-1,0,4))}else{let i=t.buffer[this.index+3];if(i<(r<0?t.buffer.length:t.buffer[this.stack[r]+3]))return this.yieldBuf(i)}return r<0?this.yield(this.buffer.parent.nextChild(this.buffer.index+e,e,0,4,this.mode)):!1}nextSibling(){return this.sibling(1)}prevSibling(){return this.sibling(-1)}atLastNode(e){let t,r,{buffer:i}=this;if(i){if(e>0){if(this.index<i.buffer.buffer.length)return!1}else for(let s=0;s<this.index;s++)if(i.buffer.buffer[s+3]<this.index)return!1;({index:t,parent:r}=i)}else({index:t,_parent:r}=this._tree);for(;r;{index:t,_parent:r}=r)if(t>-1)for(let s=t+e,o=e<0?-1:r._tree.children.length;s!=o;s+=e){let a=r._tree.children[s];if(this.mode&Zt.IncludeAnonymous||a instanceof so||!a.type.isAnonymous||eO(a))return!1}return!0}move(e,t){if(t&&this.enterChild(e,0,4))return!0;for(;;){if(this.sibling(e))return!0;if(this.atLastNode(e)||!this.parent())return!1}}next(e=!0){return this.move(1,e)}prev(e=!0){return this.move(-1,e)}moveTo(e,t=0){for(;(this.from==this.to||(t<1?this.from>=e:this.from>e)||(t>-1?this.to<=e:this.to<e))&&this.parent(););for(;this.enterChild(1,e,t););return this}get node(){if(!this.buffer)return this._tree;let e=this.bufferNode,t=null,r=0;if(e&&e.context==this.buffer)e:for(let i=this.index,s=this.stack.length;s>=0;){for(let o=e;o;o=o._parent)if(o.index==i){if(i==this.index)return o;t=o,r=s+1;break e}i=this.stack[--s]}for(let i=r;i<this.stack.length;i++)t=new Wi(this.buffer,t,this.stack[i]);return this.bufferNode=new Wi(this.buffer,t,this.index)}get tree(){return this.buffer?null:this._tree._tree}iterate(e,t){for(let r=0;;){let i=!1;if(this.type.isAnonymous||e(this)!==!1){if(this.firstChild()){r++;continue}this.type.isAnonymous||(i=!0)}for(;;){if(i&&t&&t(this),i=this.type.isAnonymous,!r)return;if(this.nextSibling())break;this.parent(),r--,i=!0}}}matchContext(e){if(!this.buffer)return Wm(this.node.parent,e);let{buffer:t}=this.buffer,{types:r}=t.set;for(let i=e.length-1,s=this.stack.length-1;i>=0;s--){if(s<0)return Wm(this._tree,e,i);let o=r[t.buffer[this.stack[s]]];if(!o.isAnonymous){if(e[i]&&e[i]!=o.name)return!1;i--}}return!0}}function eO(n){return n.children.some(e=>e instanceof so||!e.type.isAnonymous||eO(e))}function lq(n){var e;let{buffer:t,nodeSet:r,maxBufferLength:i=px,reused:s=[],minRepeatType:o=r.types.length}=n,a=Array.isArray(t)?new Jv(t,t.length):t,l=r.types,c=0,u=0;function f(_,x,A,C,y,k){let{id:P,start:T,end:E,size:Q}=a,$=u,L=c;if(Q<0)if(a.next(),Q==-1){let ae=s[P];A.push(ae),C.push(T-_);return}else if(Q==-3){c=P;return}else if(Q==-4){u=P;return}else throw new RangeError(`Unrecognized record size: ${Q}`);let I=l[P],Z,Y,ne=T-_;if(E-T<=i&&(Y=v(a.pos-x,y))){let ae=new Uint16Array(Y.size-Y.skip),ie=a.pos-Y.size,K=ae.length;for(;a.pos>ie;)K=O(Y.start,ae,K);Z=new so(ae,E-Y.start,r),ne=Y.start-_}else{let ae=a.pos-Q;a.next();let ie=[],K=[],he=P>=o?P:-1,fe=0,j=E;for(;a.pos>ae;)he>=0&&a.id==he&&a.size>=0?(a.end<=j-i&&(m(ie,K,T,fe,a.end,j,he,$,L),fe=ie.length,j=a.end),a.next()):k>2500?d(T,ae,ie,K):f(T,ae,ie,K,he,k+1);if(he>=0&&fe>0&&fe<ie.length&&m(ie,K,T,fe,T,j,he,$,L),ie.reverse(),K.reverse(),he>-1&&fe>0){let U=h(I,L);Z=tO(I,ie,K,0,ie.length,0,E-T,U,U)}else Z=p(I,ie,K,E-T,$-E,L)}A.push(Z),C.push(ne)}function d(_,x,A,C){let y=[],k=0,P=-1;for(;a.pos>x;){let{id:T,start:E,end:Q,size:$}=a;if($>4)a.next();else{if(P>-1&&E<P)break;P<0&&(P=Q-i),y.push(T,E,Q),k++,a.next()}}if(k){let T=new Uint16Array(k*4),E=y[y.length-2];for(let Q=y.length-3,$=0;Q>=0;Q-=3)T[$++]=y[Q],T[$++]=y[Q+1]-E,T[$++]=y[Q+2]-E,T[$++]=$;A.push(new so(T,y[2]-E,r)),C.push(E-_)}}function h(_,x){return(A,C,y)=>{let k=0,P=A.length-1,T,E;if(P>=0&&(T=A[P])instanceof mt){if(!P&&T.type==_&&T.length==y)return T;(E=T.prop(et.lookAhead))&&(k=C[P]+T.length+E)}return p(_,A,C,y,k,x)}}function m(_,x,A,C,y,k,P,T,E){let Q=[],$=[];for(;_.length>C;)Q.push(_.pop()),$.push(x.pop()+A-y);_.push(p(r.types[P],Q,$,k-y,T-k,E)),x.push(y-A)}function p(_,x,A,C,y,k,P){if(k){let T=[et.contextHash,k];P=P?[T].concat(P):[T]}if(y>25){let T=[et.lookAhead,y];P=P?[T].concat(P):[T]}return new mt(_,x,A,C,P)}function v(_,x){let A=a.fork(),C=0,y=0,k=0,P=A.end-i,T={size:0,start:0,skip:0};e:for(let E=A.pos-_;A.pos>E;){let Q=A.size;if(A.id==x&&Q>=0){T.size=C,T.start=y,T.skip=k,k+=4,C+=4,A.next();continue}let $=A.pos-Q;if(Q<0||$<E||A.start<P)break;let L=A.id>=o?4:0,I=A.start;for(A.next();A.pos>$;){if(A.size<0)if(A.size==-3||A.size==-4)L+=4;else break e;else A.id>=o&&(L+=4);A.next()}y=I,C+=Q,k+=L}return(x<0||C==_)&&(T.size=C,T.start=y,T.skip=k),T.size>4?T:void 0}function O(_,x,A){let{id:C,start:y,end:k,size:P}=a;if(a.next(),P>=0&&C<o){let T=A;if(P>4){let E=a.pos-(P-4);for(;a.pos>E;)A=O(_,x,A)}x[--A]=T,x[--A]=k-_,x[--A]=y-_,x[--A]=C}else P==-3?c=C:P==-4&&(u=C);return A}let b=[],w=[];for(;a.pos>0;)f(n.start||0,n.bufferStart||0,b,w,-1,0);let S=(e=n.length)!==null&&e!==void 0?e:b.length?w[0]+b[0].length:0;return new mt(l[n.topID],b.reverse(),w.reverse(),S)}const Uy=new WeakMap;function wf(n,e){if(!n.isAnonymous||e instanceof so||e.type!=n)return 1;let t=Uy.get(e);if(t==null){t=1;for(let r of e.children){if(r.type!=n||!(r instanceof mt)){t=1;break}t+=wf(n,r)}Uy.set(e,t)}return t}function tO(n,e,t,r,i,s,o,a,l){let c=0;for(let m=r;m<i;m++)c+=wf(n,e[m]);let u=Math.ceil(c*1.5/8),f=[],d=[];function h(m,p,v,O,b){for(let w=v;w<O;){let S=w,_=p[w],x=wf(n,m[w]);for(w++;w<O;w++){let A=wf(n,m[w]);if(x+A>=u)break;x+=A}if(w==S+1){if(x>u){let A=m[S];h(A.children,A.positions,0,A.children.length,p[S]+b);continue}f.push(m[S])}else{let A=p[w-1]+m[w-1].length-_;f.push(tO(n,m,p,S,w,_,A,null,l))}d.push(_+b-s)}}return h(e,t,r,i,0),(a||l)(f,d,o)}class Ox{constructor(){this.map=new WeakMap}setBuffer(e,t,r){let i=this.map.get(e);i||this.map.set(e,i=new Map),i.set(t,r)}getBuffer(e,t){let r=this.map.get(e);return r&&r.get(t)}set(e,t){e instanceof Wi?this.setBuffer(e.context.buffer,e.index,t):e instanceof or&&this.map.set(e.tree,t)}get(e){return e instanceof Wi?this.getBuffer(e.context.buffer,e.index):e instanceof or?this.map.get(e.tree):void 0}cursorSet(e,t){e.buffer?this.setBuffer(e.buffer.buffer,e.index,t):this.map.set(e.tree,t)}cursorGet(e){return e.buffer?this.getBuffer(e.buffer.buffer,e.index):this.map.get(e.tree)}}class _s{constructor(e,t,r,i,s=!1,o=!1){this.from=e,this.to=t,this.tree=r,this.offset=i,this.open=(s?1:0)|(o?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],r=!1){let i=[new _s(0,e.length,e,0,!1,r)];for(let s of t)s.to>e.length&&i.push(s);return i}static applyChanges(e,t,r=128){if(!t.length)return e;let i=[],s=1,o=e.length?e[0]:null;for(let a=0,l=0,c=0;;a++){let u=a<t.length?t[a]:null,f=u?u.fromA:1e9;if(f-l>=r)for(;o&&o.from<f;){let d=o;if(l>=d.from||f<=d.to||c){let h=Math.max(d.from,l)-c,m=Math.min(d.to,f)-c;d=h>=m?null:new _s(h,m,d.tree,d.offset+c,a>0,!!u)}if(d&&i.push(d),o.to>f)break;o=s<e.length?e[s++]:null}if(!u)break;l=u.toA,c=u.toA-u.toB}return i}}class nh{startParse(e,t,r){return typeof e=="string"&&(e=new cq(e)),r=r?r.length?r.map(i=>new ei(i.from,i.to)):[new ei(0,0)]:[new ei(0,e.length)],this.createParse(e,t||[],r)}parse(e,t,r){let i=this.startParse(e,t,r);for(;;){let s=i.advance();if(s)return s}}}class cq{constructor(e){this.string=e}get length(){return this.string.length}chunk(e){return this.string.slice(e)}get lineChunks(){return!1}read(e,t){return this.string.slice(e,t)}}function bx(n){return(e,t,r,i)=>new fq(e,n,t,r,i)}class Gy{constructor(e,t,r,i,s,o){this.parser=e,this.parse=t,this.overlay=r,this.bracketed=i,this.target=s,this.from=o}}function Hy(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class uq{constructor(e,t,r,i,s,o,a,l){this.parser=e,this.predicate=t,this.mounts=r,this.index=i,this.start=s,this.bracketed=o,this.target=a,this.prev=l,this.depth=0,this.ranges=[]}}const Ym=new et({perNode:!0});class fq{constructor(e,t,r,i,s){this.nest=t,this.input=r,this.fragments=i,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let r=this.baseParse.advance();if(!r)return null;if(this.baseParse=null,this.baseTree=r,this.startInner(),this.stoppedAt!=null)for(let i of this.inner)i.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let r=this.baseTree;return this.stoppedAt!=null&&(r=new mt(r.type,r.children,r.positions,r.length,r.propValues.concat([[Ym,this.stoppedAt]]))),r}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let r=Object.assign(Object.create(null),e.target.props);r[et.mounted.id]=new Ia(t,e.overlay,e.parser,e.bracketed),e.target.props=r}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].from<e&&(e=Math.min(e,this.inner[t].parse.parsedPos));return e}stopAt(e){if(this.stoppedAt=e,this.baseParse)this.baseParse.stopAt(e);else for(let t=this.innerDone;t<this.inner.length;t++)this.inner[t].parse.stopAt(e)}startInner(){let e=new pq(this.fragments),t=null,r=null,i=new Kf(new or(this.baseTree,this.ranges[0].from,0,null),Zt.IncludeAnonymous|Zt.IgnoreMounts);e:for(let s,o;;){let a=!0,l;if(this.stoppedAt!=null&&i.from>=this.stoppedAt)a=!1;else if(e.hasNode(i)){if(t){let c=t.mounts.find(u=>u.frag.from<=i.from&&u.frag.to>=i.to&&u.mount.overlay);if(c)for(let u of c.mount.overlay){let f=u.from+c.pos,d=u.to+c.pos;f>=i.from&&d<=i.to&&!t.ranges.some(h=>h.from<d&&h.to>f)&&t.ranges.push({from:f,to:d})}}a=!1}else if(r&&(o=dq(r.ranges,i.from,i.to)))a=o!=2;else if(!i.type.isAnonymous&&(s=this.nest(i,this.input))&&(i.from<i.to||!s.overlay)){i.tree||(hq(i),t&&t.depth++,r&&r.depth++);let c=e.findMounts(i.from,s.parser);if(typeof s.overlay=="function")t=new uq(s.parser,s.overlay,c,this.inner.length,i.from,!!s.bracketed,i.tree,t);else{let u=e1(this.ranges,s.overlay||(i.from<i.to?[new ei(i.from,i.to)]:[]));u.length&&Hy(u),(u.length||!s.overlay)&&this.inner.push(new Gy(s.parser,u.length?s.parser.startParse(this.input,t1(c,u),u):s.parser.startParse(""),s.overlay?s.overlay.map(f=>new ei(f.from-i.from,f.to-i.from)):null,!!s.bracketed,i.tree,u.length?u[0].from:i.from)),s.overlay?u.length&&(r={ranges:u,depth:0,prev:r}):a=!1}}else if(t&&(l=t.predicate(i))&&(l===!0&&(l=new ei(i.from,i.to)),l.from<l.to)){let c=t.ranges.length-1;c>=0&&t.ranges[c].to==l.from?t.ranges[c]={from:t.ranges[c].from,to:l.to}:t.ranges.push(l)}if(a&&i.firstChild())t&&t.depth++,r&&r.depth++;else for(;!i.nextSibling();){if(!i.parent())break e;if(t&&!--t.depth){let c=e1(this.ranges,t.ranges);c.length&&(Hy(c),this.inner.splice(t.index,0,new Gy(t.parser,t.parser.startParse(this.input,t1(t.mounts,c),c),t.ranges.map(u=>new ei(u.from-t.start,u.to-t.start)),t.bracketed,t.target,c[0].from))),t=t.prev}r&&!--r.depth&&(r=r.prev)}}}}function dq(n,e,t){for(let r of n){if(r.from>=t)break;if(r.to>e)return r.from<=e&&r.to>=t?2:1}return 0}function Ky(n,e,t,r,i,s){if(e<t){let o=n.buffer[e+1];r.push(n.slice(e,t,o)),i.push(o-s)}}function hq(n){let{node:e}=n,t=[],r=e.context.buffer;do t.push(n.index),n.parent();while(!n.tree);let i=n.tree,s=i.children.indexOf(r),o=i.children[s],a=o.buffer,l=[s];function c(u,f,d,h,m,p){let v=t[p],O=[],b=[];Ky(o,u,v,O,b,h);let w=a[v+1],S=a[v+2];l.push(O.length);let _=p?c(v+4,a[v+3],o.set.types[a[v]],w,S-w,p-1):e.toTree();return O.push(_),b.push(w-h),Ky(o,a[v+3],f,O,b,h),new mt(d,O,b,m)}i.children[s]=c(0,a.length,Ln.none,0,o.length,t.length-1);for(let u of l){let f=n.tree.children[u],d=n.tree.positions[u];n.yield(new or(f,d+n.from,u,n._tree))}}class Jy{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Zt.IncludeAnonymous|Zt.IgnoreMounts)}moveTo(e){let{cursor:t}=this,r=e-this.offset;for(;!this.done&&t.from<r;)t.to>=e&&t.enter(r,1,Zt.IgnoreOverlays|Zt.ExcludeBuffers)||t.next(!1)||(this.done=!0)}hasNode(e){if(this.moveTo(e.from),!this.done&&this.cursor.from+this.offset==e.from&&this.cursor.tree)for(let t=this.cursor.tree;;){if(t==e.tree)return!0;if(t.children.length&&t.positions[0]==0&&t.children[0]instanceof mt)t=t.children[0];else break}return!1}}let pq=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let r=this.curFrag=e[0];this.curTo=(t=r.tree.prop(Ym))!==null&&t!==void 0?t:r.to,this.inner=new Jy(r.tree,-r.offset)}else this.curFrag=this.inner=null}hasNode(e){for(;this.curFrag&&e.from>=this.curTo;)this.nextFrag();return this.curFrag&&this.curFrag.from<=e.from&&this.curTo>=e.to&&this.inner.hasNode(e)}nextFrag(){var e;if(this.fragI++,this.fragI==this.fragments.length)this.curFrag=this.inner=null;else{let t=this.curFrag=this.fragments[this.fragI];this.curTo=(e=t.tree.prop(Ym))!==null&&e!==void 0?e:t.to,this.inner=new Jy(t.tree,-t.offset)}}findMounts(e,t){var r;let i=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let o=(r=s.tree)===null||r===void 0?void 0:r.prop(et.mounted);if(o&&o.parser==t)for(let a=this.fragI;a<this.fragments.length;a++){let l=this.fragments[a];if(l.from>=s.to)break;l.tree==this.curFrag.tree&&i.push({frag:l,pos:s.from-l.offset,mount:o})}}}return i}};function e1(n,e){let t=null,r=e;for(let i=1,s=0;i<n.length;i++){let o=n[i-1].to,a=n[i].from;for(;s<r.length;s++){let l=r[s];if(l.from>=a)break;l.to<=o||(t||(r=t=e.slice()),l.from<o?(t[s]=new ei(l.from,o),l.to>a&&t.splice(s+1,0,new ei(a,l.to))):l.to>a?t[s--]=new ei(a,l.to):t.splice(s--,1))}}return r}function mq(n,e,t,r){let i=0,s=0,o=!1,a=!1,l=-1e9,c=[];for(;;){let u=i==n.length?1e9:o?n[i].to:n[i].from,f=s==e.length?1e9:a?e[s].to:e[s].from;if(o!=a){let d=Math.max(l,t),h=Math.min(u,f,r);d<h&&c.push(new ei(d,h))}if(l=Math.min(u,f),l==1e9)break;u==l&&(o?(o=!1,i++):o=!0),f==l&&(a?(a=!1,s++):a=!0)}return c}function t1(n,e){let t=[];for(let{pos:r,mount:i,frag:s}of n){let o=r+(i.overlay?i.overlay[0].from:0),a=o+i.tree.length,l=Math.max(s.from,o),c=Math.min(s.to,a);if(i.overlay){let u=i.overlay.map(d=>new ei(d.from+r,d.to+r)),f=mq(e,u,l,c);for(let d=0,h=l;;d++){let m=d==f.length,p=m?c:f[d].from;if(p>h&&t.push(new _s(h,p,i.tree,-o,s.from>=h||s.openStart,s.to<=p||s.openEnd)),m)break;h=f[d].to}}else t.push(new _s(l,c,i.tree,-o,s.from>=o||s.openStart,s.to<=a||s.openEnd))}return t}let gq=0,Zi=class Um{constructor(e,t,r,i){this.name=e,this.set=t,this.base=r,this.modified=i,this.id=gq++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let r=typeof e=="string"?e:"?";if(e instanceof Um&&(t=e),t?.base)throw new Error("Can not derive from a modified tag");let i=new Um(r,[],null,[]);if(i.set.push(i),t)for(let s of t.set)i.set.push(s);return i}static defineModifier(e){let t=new Jf(e);return r=>r.modified.indexOf(t)>-1?r:Jf.get(r.base||r,r.modified.concat(t).sort((i,s)=>i.id-s.id))}},vq=0;class Jf{constructor(e){this.name=e,this.instances=[],this.id=vq++}static get(e,t){if(!t.length)return e;let r=t[0].instances.find(a=>a.base==e&&Oq(t,a.modified));if(r)return r;let i=[],s=new Zi(e.name,i,e,t);for(let a of t)a.instances.push(s);let o=bq(t);for(let a of e.set)if(!a.modified.length)for(let l of o)i.push(Jf.get(a,l));return s}}function Oq(n,e){return n.length==e.length&&n.every((t,r)=>t==e[r])}function bq(n){let e=[[]];for(let t=0;t<n.length;t++)for(let r=0,i=e.length;r<i;r++)e.push(e[r].concat(n[t]));return e.sort((t,r)=>r.length-t.length)}function Ol(n){let e=Object.create(null);for(let t in n){let r=n[t];Array.isArray(r)||(r=[r]);for(let i of t.split(" "))if(i){let s=[],o=2,a=i;for(let f=0;;){if(a=="..."&&f>0&&f+3==i.length){o=1;break}let d=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(a);if(!d)throw new RangeError("Invalid path: "+i);if(s.push(d[0]=="*"?"":d[0][0]=='"'?JSON.parse(d[0]):d[0]),f+=d[0].length,f==i.length)break;let h=i[f++];if(f==i.length&&h=="!"){o=0;break}if(h!="/")throw new RangeError("Invalid path: "+i);a=i.slice(f)}let l=s.length-1,c=s[l];if(!c)throw new RangeError("Invalid path: "+i);let u=new Cc(r,o,l>0?s.slice(0,l):null);e[c]=u.sort(e[c])}}return yx.add(e)}const yx=new et({combine(n,e){let t,r,i;for(;n||e;){if(!n||e&&n.depth>=e.depth?(i=e,e=e.next):(i=n,n=n.next),t&&t.mode==i.mode&&!i.context&&!t.context)continue;let s=new Cc(i.tags,i.mode,i.context);t?t.next=s:r=s,t=s}return r}});class Cc{constructor(e,t,r,i){this.tags=e,this.mode=t,this.context=r,this.next=i}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth<this.depth?(this.next=e,this):(e.next=this.sort(e.next),e)}get depth(){return this.context?this.context.length:0}}Cc.empty=new Cc([],2,null);function wx(n,e){let t=Object.create(null);for(let s of n)if(!Array.isArray(s.tag))t[s.tag.id]=s.class;else for(let o of s.tag)t[o.id]=s.class;let{scope:r,all:i=null}=e||{};return{style:s=>{let o=i;for(let a of s)for(let l of a.set){let c=t[l.id];if(c){o=o?o+" "+c:c;break}}return o},scope:r}}function yq(n,e){let t=null;for(let r of n){let i=r.style(e);i&&(t=t?t+" "+i:i)}return t}function wq(n,e,t,r=0,i=n.length){let s=new _q(r,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),r,i,"",s.highlighters),s.flush(i)}class _q{constructor(e,t,r){this.at=e,this.highlighters=t,this.span=r,this.class=""}startSpan(e,t){t!=this.class&&(this.flush(e),e>this.at&&(this.at=e),this.class=t)}flush(e){e>this.at&&this.class&&this.span(this.at,e,this.class)}highlightRange(e,t,r,i,s){let{type:o,from:a,to:l}=e;if(a>=r||l<=t)return;o.isTop&&(s=this.highlighters.filter(h=>!h.scope||h.scope(o)));let c=i,u=kq(e)||Cc.empty,f=yq(s,u.tags);if(f&&(c&&(c+=" "),c+=f,u.mode==1&&(i+=(i?" ":"")+f)),this.startSpan(Math.max(t,a),c),u.opaque)return;let d=e.tree&&e.tree.prop(et.mounted);if(d&&d.overlay){let h=e.node.enter(d.overlay[0].from+a,1),m=this.highlighters.filter(v=>!v.scope||v.scope(d.tree.type)),p=e.firstChild();for(let v=0,O=a;;v++){let b=v<d.overlay.length?d.overlay[v]:null,w=b?b.from+a:l,S=Math.max(t,O),_=Math.min(r,w);if(S<_&&p)for(;e.from<_&&(this.highlightRange(e,S,_,i,s),this.startSpan(Math.min(_,e.to),c),!(e.to>=w||!e.nextSibling())););if(!b||w>r)break;O=b.to+a,O>t&&(this.highlightRange(h.cursor(),Math.max(t,b.from+a),Math.min(r,O),"",m),this.startSpan(Math.min(r,O),c))}p&&e.parent()}else if(e.firstChild()){d&&(i="");do if(!(e.to<=t)){if(e.from>=r)break;this.highlightRange(e,t,r,i,s),this.startSpan(Math.min(r,e.to),c)}while(e.nextSibling());e.parent()}}}function kq(n){let e=n.type.prop(yx);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Se=Zi.define,Du=Se(),Bs=Se(),n1=Se(Bs),r1=Se(Bs),js=Se(),Iu=Se(js),Kh=Se(js),zi=Se(),ho=Se(zi),Di=Se(),Ii=Se(),Gm=Se(),El=Se(Gm),Nu=Se(),N={comment:Du,lineComment:Se(Du),blockComment:Se(Du),docComment:Se(Du),name:Bs,variableName:Se(Bs),typeName:n1,tagName:Se(n1),propertyName:r1,attributeName:Se(r1),className:Se(Bs),labelName:Se(Bs),namespace:Se(Bs),macroName:Se(Bs),literal:js,string:Iu,docString:Se(Iu),character:Se(Iu),attributeValue:Se(Iu),number:Kh,integer:Se(Kh),float:Se(Kh),bool:Se(js),regexp:Se(js),escape:Se(js),color:Se(js),url:Se(js),keyword:Di,self:Se(Di),null:Se(Di),atom:Se(Di),unit:Se(Di),modifier:Se(Di),operatorKeyword:Se(Di),controlKeyword:Se(Di),definitionKeyword:Se(Di),moduleKeyword:Se(Di),operator:Ii,derefOperator:Se(Ii),arithmeticOperator:Se(Ii),logicOperator:Se(Ii),bitwiseOperator:Se(Ii),compareOperator:Se(Ii),updateOperator:Se(Ii),definitionOperator:Se(Ii),typeOperator:Se(Ii),controlOperator:Se(Ii),punctuation:Gm,separator:Se(Gm),bracket:El,angleBracket:Se(El),squareBracket:Se(El),paren:Se(El),brace:Se(El),content:zi,heading:ho,heading1:Se(ho),heading2:Se(ho),heading3:Se(ho),heading4:Se(ho),heading5:Se(ho),heading6:Se(ho),contentSeparator:Se(zi),list:Se(zi),quote:Se(zi),emphasis:Se(zi),strong:Se(zi),link:Se(zi),monospace:Se(zi),strikethrough:Se(zi),inserted:Se(),deleted:Se(),changed:Se(),invalid:Se(),meta:Nu,documentMeta:Se(Nu),annotation:Se(Nu),processingInstruction:Se(Nu),definition:Zi.defineModifier("definition"),constant:Zi.defineModifier("constant"),function:Zi.defineModifier("function"),standard:Zi.defineModifier("standard"),local:Zi.defineModifier("local"),special:Zi.defineModifier("special")};for(let n in N){let e=N[n];e instanceof Zi&&(e.name=n)}wx([{tag:N.link,class:"tok-link"},{tag:N.heading,class:"tok-heading"},{tag:N.emphasis,class:"tok-emphasis"},{tag:N.strong,class:"tok-strong"},{tag:N.keyword,class:"tok-keyword"},{tag:N.atom,class:"tok-atom"},{tag:N.bool,class:"tok-bool"},{tag:N.url,class:"tok-url"},{tag:N.labelName,class:"tok-labelName"},{tag:N.inserted,class:"tok-inserted"},{tag:N.deleted,class:"tok-deleted"},{tag:N.literal,class:"tok-literal"},{tag:N.string,class:"tok-string"},{tag:N.number,class:"tok-number"},{tag:[N.regexp,N.escape,N.special(N.string)],class:"tok-string2"},{tag:N.variableName,class:"tok-variableName"},{tag:N.local(N.variableName),class:"tok-variableName tok-local"},{tag:N.definition(N.variableName),class:"tok-variableName tok-definition"},{tag:N.special(N.variableName),class:"tok-variableName2"},{tag:N.definition(N.propertyName),class:"tok-propertyName tok-definition"},{tag:N.typeName,class:"tok-typeName"},{tag:N.namespace,class:"tok-namespace"},{tag:N.className,class:"tok-className"},{tag:N.macroName,class:"tok-macroName"},{tag:N.propertyName,class:"tok-propertyName"},{tag:N.operator,class:"tok-operator"},{tag:N.comment,class:"tok-comment"},{tag:N.meta,class:"tok-meta"},{tag:N.invalid,class:"tok-invalid"},{tag:N.punctuation,class:"tok-punctuation"}]);var Jh;const Xs=new et;function rh(n){return Ie.define({combine:n?e=>e.concat(n):void 0})}const nO=new et;class Zr{constructor(e,t,r=[],i=""){this.data=e,this.name=i,Pt.prototype.hasOwnProperty("tree")||Object.defineProperty(Pt.prototype,"tree",{get(){return wn(this)}}),this.parser=t,this.extension=[tl.of(this),Pt.languageData.of((s,o,a)=>{let l=i1(s,o,a),c=l.type.prop(Xs);if(!c)return[];let u=s.facet(c),f=l.type.prop(nO);if(f){let d=l.resolve(o-l.from,a);for(let h of f)if(h.test(d,s)){let m=s.facet(h.facet);return h.type=="replace"?m:m.concat(u)}}return u})].concat(r)}isActiveAt(e,t,r=-1){return i1(e,t,r).type.prop(Xs)==this.data}findRegions(e){let t=e.facet(tl);if(t?.data==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let r=[],i=(s,o)=>{if(s.prop(Xs)==this.data){r.push({from:o,to:o+s.length});return}let a=s.prop(et.mounted);if(a){if(a.tree.prop(Xs)==this.data){if(a.overlay)for(let l of a.overlay)r.push({from:l.from+o,to:l.to+o});else r.push({from:o,to:o+s.length});return}else if(a.overlay){let l=r.length;if(i(a.tree,a.overlay[0].from+o),r.length>l)return}}for(let l=0;l<s.children.length;l++){let c=s.children[l];c instanceof mt&&i(c,s.positions[l]+o)}};return i(wn(e),0),r}get allowsNesting(){return!0}}Zr.setState=Qt.define();function i1(n,e,t){let r=n.facet(tl),i=wn(n).topNode;if(!r||r.allowsNesting)for(let s=i;s;s=s.enter(e,t,Zt.ExcludeBuffers|Zt.EnterBracketed))s.type.isTop&&(i=s);return i}class Ja extends Zr{constructor(e,t,r){super(e,t,[],r),this.parser=t}static define(e){let t=rh(e.languageData);return new Ja(t,e.parser.configure({props:[Xs.add(r=>r.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ja(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function wn(n){let e=n.field(Zr.state,!1);return e?e.tree:mt.empty}class xq{constructor(e){this.doc=e,this.cursorPos=0,this.string="",this.cursor=e.iter()}get length(){return this.doc.length}syncTo(e){return this.string=this.cursor.next(e-this.cursorPos).value,this.cursorPos=e+this.string.length,this.cursorPos-this.string.length}chunk(e){return this.syncTo(e),this.string}get lineChunks(){return!0}read(e,t){let r=this.cursorPos-this.string.length;return e<r||t>=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-r,t-r)}}let $l=null;class Go{constructor(e,t,r=[],i,s,o,a,l){this.parser=e,this.state=t,this.fragments=r,this.tree=i,this.treeLen=s,this.viewport=o,this.skipped=a,this.scheduleOn=l,this.parse=null,this.tempSkipped=[]}static create(e,t,r){return new Go(e,t,[],mt.empty,0,r,[],null)}startParse(){return this.parser.startParse(new xq(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=mt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var r;if(typeof e=="number"){let i=Date.now()+e;e=()=>Date.now()>i}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t<this.state.doc.length&&this.parse.stopAt(t);;){let i=this.parse.advance();if(i)if(this.fragments=this.withoutTempSkipped(_s.addTree(i,this.fragments,this.parse.stoppedAt!=null)),this.treeLen=(r=this.parse.stoppedAt)!==null&&r!==void 0?r:this.state.doc.length,this.tree=i,this.parse=null,this.treeLen<(t??this.state.doc.length))this.parse=this.startParse();else return!0;if(e())return!1}})}takeTree(){let e,t;this.parse&&(e=this.parse.parsedPos)>=this.treeLen&&((this.parse.stoppedAt==null||this.parse.stoppedAt>e)&&this.parse.stopAt(e),this.withContext(()=>{for(;!(t=this.parse.advance()););}),this.treeLen=e,this.tree=t,this.fragments=this.withoutTempSkipped(_s.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=$l;$l=this;try{return e()}finally{$l=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=s1(e,t.from,t.to);return e}changes(e,t){let{fragments:r,tree:i,treeLen:s,viewport:o,skipped:a}=this;if(this.takeTree(),!e.empty){let l=[];if(e.iterChangedRanges((c,u,f,d)=>l.push({fromA:c,toA:u,fromB:f,toB:d})),r=_s.applyChanges(r,l),i=mt.empty,s=0,o={from:e.mapPos(o.from,-1),to:e.mapPos(o.to,1)},this.skipped.length){a=[];for(let c of this.skipped){let u=e.mapPos(c.from,1),f=e.mapPos(c.to,-1);u<f&&a.push({from:u,to:f})}}}return new Go(this.parser,t,r,i,s,o,a,this.scheduleOn)}updateViewport(e){if(this.viewport.from==e.from&&this.viewport.to==e.to)return!1;this.viewport=e;let t=this.skipped.length;for(let r=0;r<this.skipped.length;r++){let{from:i,to:s}=this.skipped[r];i<e.to&&s>e.from&&(this.fragments=s1(this.fragments,i,s),this.skipped.splice(r--,1))}return this.skipped.length>=t?!1:(this.reset(),!0)}reset(){this.parse&&(this.takeTree(),this.parse=null)}skipUntilInView(e,t){this.skipped.push({from:e,to:t})}static getSkippingParser(e){return new class extends nh{createParse(t,r,i){let s=i[0].from,o=i[i.length-1].to;return{parsedPos:s,advance(){let l=$l;if(l){for(let c of i)l.tempSkipped.push(c);e&&(l.scheduleOn=l.scheduleOn?Promise.all([l.scheduleOn,e]):e)}return this.parsedPos=o,new mt(Ln.none,[],[],o-s)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&t[0].from==0&&t[0].to>=e}static get(){return $l}}function s1(n,e,t){return _s.applyChanges(n,[{fromA:e,toA:t,fromB:e,toB:t}])}class el{constructor(e){this.context=e,this.tree=e.tree}apply(e){if(!e.docChanged&&this.tree==this.context.tree)return this;let t=this.context.changes(e.changes,e.state),r=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,r)||t.takeTree(),new el(t)}static init(e){let t=Math.min(3e3,e.doc.length),r=Go.create(e.facet(tl).parser,e,{from:0,to:t});return r.work(20,t)||r.takeTree(),new el(r)}}Zr.state=ui.define({create:el.init,update(n,e){for(let t of e.effects)if(t.is(Zr.setState))return t.value;return e.startState.facet(tl)!=e.state.facet(tl)?el.init(e.state):n.apply(e)}});let _x=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(_x=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const ep=typeof navigator<"u"&&(!((Jh=navigator.scheduling)===null||Jh===void 0)&&Jh.isInputPending)?()=>navigator.scheduling.isInputPending():null,Sq=pr.fromClass(class{constructor(e){this.view=e,this.working=null,this.workScheduled=0,this.chunkEnd=-1,this.chunkBudget=-1,this.work=this.work.bind(this),this.scheduleWork()}update(e){let t=this.view.state.field(Zr.state).context;(t.updateViewport(e.view.viewport)||this.view.viewport.to>t.treeLen)&&this.scheduleWork(),(e.docChanged||e.selectionSet)&&(this.view.hasFocus&&(this.chunkBudget+=50),this.scheduleWork()),this.checkAsyncSchedule(t)}scheduleWork(){if(this.working)return;let{state:e}=this.view,t=e.field(Zr.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=_x(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEnd<t&&(this.chunkEnd<0||this.view.hasFocus)&&(this.chunkEnd=t+3e4,this.chunkBudget=3e3),this.chunkBudget<=0)return;let{state:r,viewport:{to:i}}=this.view,s=r.field(Zr.state);if(s.tree==s.context.tree&&s.context.isDone(i+1e5))return;let o=Date.now()+Math.min(this.chunkBudget,100,e&&!ep?Math.max(25,e.timeRemaining()-5):1e9),a=s.context.treeLen<i&&r.doc.length>i+1e3,l=s.context.work(()=>ep&&ep()||Date.now()>o,i+(a?0:1e5));this.chunkBudget-=Date.now()-t,(l||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Zr.setState.of(new el(s.context))})),this.chunkBudget>0&&!(l&&!a)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>zr(this.view.state,t)).then(()=>this.workScheduled--),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),tl=Ie.define({combine(n){return n.length?n[0]:null},enables:n=>[Zr.state,Sq,Pe.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class nl{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}class ee{constructor(e,t,r,i,s,o=void 0){this.name=e,this.alias=t,this.extensions=r,this.filename=i,this.loadFunc=s,this.support=o,this.loading=null}load(){return this.loading||(this.loading=this.loadFunc().then(e=>this.support=e,e=>{throw this.loading=null,e}))}static of(e){let{load:t,support:r}=e;if(!t){if(!r)throw new RangeError("Must pass either 'load' or 'support' to LanguageDescription.of");t=()=>Promise.resolve(r)}return new ee(e.name,(e.alias||[]).concat(e.name).map(i=>i.toLowerCase()),e.extensions||[],e.filename,t,r)}static matchFilename(e,t){for(let i of e)if(i.filename&&i.filename.test(t))return i;let r=/\.([^.]+)$/.exec(t);if(r){for(let i of e)if(i.extensions.indexOf(r[1])>-1)return i}return null}static matchLanguageName(e,t,r=!0){t=t.toLowerCase();for(let i of e)if(i.alias.some(s=>s==t))return i;if(r)for(let i of e)for(let s of i.alias){let o=t.indexOf(s);if(o>-1&&(s.length>2||!/\w/.test(t[o-1])&&!/\w/.test(t[o+s.length])))return i}return null}}const Aq=Ie.define(),cu=Ie.define({combine:n=>{if(!n.length)return" ";let e=n[0];if(!e||/\S/.test(e)||Array.from(e).some(t=>t!=e[0]))throw new Error("Invalid indent unit: "+JSON.stringify(n[0]));return e}});function Ho(n){let e=n.facet(cu);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function ed(n,e){let t="",r=n.tabSize,i=n.facet(cu)[0];if(i==" "){for(;e>=r;)t+=" ",e-=r;i=" "}for(let s=0;s<e;s++)t+=i;return t}function kx(n,e){n instanceof Pt&&(n=new ih(n));for(let r of n.state.facet(Aq)){let i=r(n,e);if(i!==void 0)return i}let t=wn(n.state);return t.length>=e?Cq(n,t,e):null}class ih{constructor(e,t={}){this.state=e,this.options=t,this.unit=Ho(e)}lineAt(e,t=1){let r=this.state.doc.lineAt(e),{simulateBreak:i,simulateDoubleBreak:s}=this.options;return i!=null&&i>=r.from&&i<=r.to?s&&i==e?{text:"",from:e}:(t<0?i<e:i<=e)?{text:r.text.slice(i-r.from),from:i}:{text:r.text.slice(0,i-r.from),from:r.from}:r}textAfterPos(e,t=1){if(this.options.simulateDoubleBreak&&e==this.options.simulateBreak)return"";let{text:r,from:i}=this.lineAt(e,t);return r.slice(e-i,Math.min(r.length,e+100-i))}column(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.countColumn(r,e-i),o=this.options.overrideIndentation?this.options.overrideIndentation(i):-1;return o>-1&&(s+=o-this.countColumn(r,r.search(/\S|$/))),s}countColumn(e,t=e.length){return xs(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:r,from:i}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let o=s(i);if(o>-1)return o}return this.countColumn(r,r.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const bl=new et;function Cq(n,e,t){let r=e.resolveStack(t),i=e.resolveInner(t,-1).resolve(t,0).enterUnfinishedNodesBefore(t);if(i!=r.node){let s=[];for(let o=i;o&&!(o.from<r.node.from||o.to>r.node.to||o.from==r.node.from&&o.type==r.node.type);o=o.parent)s.push(o);for(let o=s.length-1;o>=0;o--)r={node:s[o],next:r}}return xx(r,n,t)}function xx(n,e,t){for(let r=n;r;r=r.next){let i=Pq(r.node);if(i)return i(rO.create(e,t,r))}return 0}function Tq(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function Pq(n){let e=n.type.prop(bl);if(e)return e;let t=n.firstChild,r;if(t&&(r=t.type.prop(et.closedBy))){let i=n.lastChild,s=i&&r.indexOf(i.name)>-1;return o=>Sx(o,!0,1,void 0,s&&!Tq(o)?i.from:void 0)}return n.parent==null?Eq:null}function Eq(){return 0}class rO extends ih{constructor(e,t,r){super(e.state,e.options),this.base=e,this.pos=t,this.context=r}get node(){return this.context.node}static create(e,t,r){return new rO(e,t,r)}get textAfter(){return this.textAfterPos(this.pos)}get baseIndent(){return this.baseIndentFor(this.node)}baseIndentFor(e){let t=this.state.doc.lineAt(e.from);for(;;){let r=e.resolve(t.from);for(;r.parent&&r.parent.from==r.from;)r=r.parent;if($q(r,e))break;t=this.state.doc.lineAt(r.from)}return this.lineIndent(t.from)}continue(){return xx(this.context.next,this.base,this.pos)}}function $q(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function Qq(n){let e=n.node,t=e.childAfter(e.from),r=e.lastChild;if(!t)return null;let i=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),o=i==null||i<=s.from?s.to:Math.min(s.to,i);for(let a=t.to;;){let l=e.childAfter(a);if(!l||l==r)return null;if(!l.type.isSkipped){if(l.from>=o)return null;let c=/^ */.exec(s.text.slice(t.to-s.from))[0].length;return{from:t.from,to:t.to+c}}a=l.to}}function Lq({closing:n,align:e=!0,units:t=1}){return r=>Sx(r,e,t,n)}function Sx(n,e,t,r,i){let s=n.textAfter,o=s.match(/^\s*/)[0].length,a=r&&s.slice(o,o+r.length)==r||i==n.pos+o,l=e?Qq(n):null;return l?a?n.column(l.from):n.column(l.to):n.baseIndent+(a?0:n.unit*t)}const Mq=n=>n.baseIndent;function _f({except:n,units:e=1}={}){return t=>{let r=n&&n.test(t.textAfter);return t.baseIndent+(r?0:e*t.unit)}}const qq=Ie.define(),uu=new et;function Ax(n){let e=n.firstChild,t=n.lastChild;return e&&e.to<t.from?{from:e.to,to:t.type.isError?n.to:t.from}:null}class yl{constructor(e,t){this.specs=e;let r;function i(a){let l=to.newName();return(r||(r=Object.create(null)))["."+l]=a,l}const s=typeof t.all=="string"?t.all:t.all?i(t.all):void 0,o=t.scope;this.scope=o instanceof Zr?a=>a.prop(Xs)==o.data:o?a=>a==o:void 0,this.style=wx(e.map(a=>({tag:a.tag,class:a.class||i(Object.assign({},a,{tag:null}))})),{all:s}).style,this.module=r?new to(r):null,this.themeType=t.themeType}static define(e,t){return new yl(e,t||{})}}const Hm=Ie.define(),Cx=Ie.define({combine(n){return n.length?[n[0]]:null}});function tp(n){let e=n.facet(Hm);return e.length?e:n.facet(Cx)}function Tc(n,e){let t=[Dq],r;return n instanceof yl&&(n.module&&t.push(Pe.styleModule.of(n.module)),r=n.themeType),e?.fallback?t.push(Cx.of(n)):r?t.push(Hm.computeN([Pe.darkTheme],i=>i.facet(Pe.darkTheme)==(r=="dark")?[n]:[])):t.push(Hm.of(n)),t}class Rq{constructor(e){this.markCache=Object.create(null),this.tree=wn(e.state),this.decorations=this.buildDeco(e,tp(e.state)),this.decoratedTo=e.viewport.to}update(e){let t=wn(e.state),r=tp(e.state),i=r!=tp(e.startState),{viewport:s}=e.view,o=e.changes.mapPos(this.decoratedTo,1);t.length<s.to&&!i&&t.type==this.tree.type&&o>=s.to?(this.decorations=this.decorations.map(e.changes),this.decoratedTo=o):(t!=this.tree||e.viewportChanged||i)&&(this.tree=t,this.decorations=this.buildDeco(e.view,r),this.decoratedTo=s.to)}buildDeco(e,t){if(!t||!this.tree.length)return ft.none;let r=new Vo;for(let{from:i,to:s}of e.visibleRanges)wq(this.tree,t,(o,a,l)=>{r.add(o,a,this.markCache[l]||(this.markCache[l]=ft.mark({class:l})))},i,s);return r.finish()}}const Dq=co.high(pr.fromClass(Rq,{decorations:n=>n.decorations})),Tx=yl.define([{tag:N.meta,color:"#404740"},{tag:N.link,textDecoration:"underline"},{tag:N.heading,textDecoration:"underline",fontWeight:"bold"},{tag:N.emphasis,fontStyle:"italic"},{tag:N.strong,fontWeight:"bold"},{tag:N.strikethrough,textDecoration:"line-through"},{tag:N.keyword,color:"#708"},{tag:[N.atom,N.bool,N.url,N.contentSeparator,N.labelName],color:"#219"},{tag:[N.literal,N.inserted],color:"#164"},{tag:[N.string,N.deleted],color:"#a11"},{tag:[N.regexp,N.escape,N.special(N.string)],color:"#e40"},{tag:N.definition(N.variableName),color:"#00f"},{tag:N.local(N.variableName),color:"#30a"},{tag:[N.typeName,N.namespace],color:"#085"},{tag:N.className,color:"#167"},{tag:[N.special(N.variableName),N.macroName],color:"#256"},{tag:N.definition(N.propertyName),color:"#00c"},{tag:N.comment,color:"#940"},{tag:N.invalid,color:"#f00"}]),Iq=1e4,Nq="()[]{}",Px=new et;function Km(n,e,t){let r=n.prop(e<0?et.openedBy:et.closedBy);if(r)return r;if(n.name.length==1){let i=t.indexOf(n.name);if(i>-1&&i%2==(e<0?1:0))return[t[i+e]]}return null}function Jm(n){let e=n.type.prop(Px);return e?e(n.node):n}function Ca(n,e,t,r={}){let i=r.maxScanDistance||Iq,s=r.brackets||Nq,o=wn(n),a=o.resolveInner(e,t);for(let l=a;l;l=l.parent){let c=Km(l.type,t,s);if(c&&l.from<l.to){let u=Jm(l);if(u&&(t>0?e>=u.from&&e<u.to:e>u.from&&e<=u.to))return Bq(n,e,t,l,u,c,s)}}return jq(n,e,t,o,a.type,i,s)}function Bq(n,e,t,r,i,s,o){let a=r.parent,l={from:i.from,to:i.to},c=0,u=a?.cursor();if(u&&(t<0?u.childBefore(r.from):u.childAfter(r.to)))do if(t<0?u.to<=r.from:u.from>=r.to){if(c==0&&s.indexOf(u.type.name)>-1&&u.from<u.to){let f=Jm(u);return{start:l,end:f?{from:f.from,to:f.to}:void 0,matched:!0}}else if(Km(u.type,t,o))c++;else if(Km(u.type,-t,o)){if(c==0){let f=Jm(u);return{start:l,end:f&&f.from<f.to?{from:f.from,to:f.to}:void 0,matched:!1}}c--}}while(t<0?u.prevSibling():u.nextSibling());return{start:l,matched:!1}}function jq(n,e,t,r,i,s,o){let a=t<0?n.sliceDoc(e-1,e):n.sliceDoc(e,e+1),l=o.indexOf(a);if(l<0||l%2==0!=t>0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},u=n.doc.iterRange(e,t>0?n.doc.length:0),f=0;for(let d=0;!u.next().done&&d<=s;){let h=u.value;t<0&&(d+=h.length);let m=e+d*t;for(let p=t>0?0:h.length-1,v=t>0?h.length:-1;p!=v;p+=t){let O=o.indexOf(h[p]);if(!(O<0||r.resolveInner(m+p,1).type!=i))if(O%2==0==t>0)f++;else{if(f==1)return{start:c,end:{from:m+p,to:m+p+1},matched:O>>1==l>>1};f--}}t>0&&(d+=h.length)}return u.done?{start:c,matched:!1}:null}function o1(n,e,t,r=0,i=0){e==null&&(e=n.search(/[^\s\u00a0]/),e==-1&&(e=n.length));let s=i;for(let o=r;o<e;o++)n.charCodeAt(o)==9?s+=t-s%t:s++;return s}class Ex{constructor(e,t,r,i){this.string=e,this.tabSize=t,this.indentUnit=r,this.overrideIndent=i,this.pos=0,this.start=0,this.lastColumnPos=0,this.lastColumnValue=0}eol(){return this.pos>=this.string.length}sol(){return this.pos==0}peek(){return this.string.charAt(this.pos)||void 0}next(){if(this.pos<this.string.length)return this.string.charAt(this.pos++)}eat(e){let t=this.string.charAt(this.pos),r;if(typeof e=="string"?r=t==e:r=t&&(e instanceof RegExp?e.test(t):e(t)),r)return++this.pos,t}eatWhile(e){let t=this.pos;for(;this.eat(e););return this.pos>t}eatSpace(){let e=this.pos;for(;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e}skipToEnd(){this.pos=this.string.length}skipTo(e){let t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0}backUp(e){this.pos-=e}column(){return this.lastColumnPos<this.start&&(this.lastColumnValue=o1(this.string,this.start,this.tabSize,this.lastColumnPos,this.lastColumnValue),this.lastColumnPos=this.start),this.lastColumnValue}indentation(){var e;return(e=this.overrideIndent)!==null&&e!==void 0?e:o1(this.string,null,this.tabSize)}match(e,t,r){if(typeof e=="string"){let i=o=>r?o.toLowerCase():o,s=this.string.substr(this.pos,e.length);return i(s)==i(e)?(t!==!1&&(this.pos+=e.length),!0):null}else{let i=this.string.slice(this.pos).match(e);return i&&i.index>0?null:(i&&t!==!1&&(this.pos+=i[0].length),i)}}current(){return this.string.slice(this.start,this.pos)}}function zq(n){return{name:n.name||"",token:n.token,blankLine:n.blankLine||(()=>{}),startState:n.startState||(()=>!0),copyState:n.copyState||Zq,indent:n.indent||(()=>null),languageData:n.languageData||{},tokenTable:n.tokenTable||oO,mergeTokens:n.mergeTokens!==!1}}function Zq(n){if(typeof n!="object")return n;let e={};for(let t in n){let r=n[t];e[t]=r instanceof Array?r.slice():r}return e}const a1=new WeakMap;class iO extends Zr{constructor(e){let t=rh(e.languageData),r=zq(e),i,s=new class extends nh{createParse(o,a,l){return new Xq(i,o,a,l)}};super(t,s,[],e.name),this.topNode=Yq(t,this),i=this,this.streamParser=r,this.stateAfter=new et({perNode:!0}),this.tokenTable=e.tokenTable?new Mx(r.tokenTable):Wq}static define(e){return new iO(e)}getIndent(e){let t,{overrideIndentation:r}=e.options;r&&(t=a1.get(e.state),t!=null&&t<e.pos-1e4&&(t=void 0));let i=sO(this,e.node.tree,e.node.from,e.node.from,t??e.pos),s,o;if(i?(o=i.state,s=i.pos+1):(o=this.streamParser.startState(e.unit),s=e.node.from),e.pos-s>1e4)return null;for(;s<e.pos;){let l=e.state.doc.lineAt(s),c=Math.min(e.pos,l.to);if(l.length){let u=r?r(l.from):-1,f=new Ex(l.text,e.state.tabSize,e.unit,u<0?void 0:u);for(;f.pos<c-l.from;)Qx(this.streamParser.token,f,o)}else this.streamParser.blankLine(o,e.unit);if(c==e.pos)break;s=l.to+1}let a=e.lineAt(e.pos);return r&&t==null&&a1.set(e.state,a.from),this.streamParser.indent(o,/^\s*(.*)/.exec(a.text)[1],e)}get allowsNesting(){return!1}}function sO(n,e,t,r,i){let s=t>=r&&t+e.length<=i&&e.prop(n.stateAfter);if(s)return{state:n.streamParser.copyState(s),pos:t+e.length};for(let o=e.children.length-1;o>=0;o--){let a=e.children[o],l=t+e.positions[o],c=a instanceof mt&&l<i&&sO(n,a,l,r,i);if(c)return c}return null}function $x(n,e,t,r,i){if(i&&t<=0&&r>=e.length)return e;!i&&t==0&&e.type==n.topNode&&(i=!0);for(let s=e.children.length-1;s>=0;s--){let o=e.positions[s],a=e.children[s],l;if(o<r&&a instanceof mt){if(!(l=$x(n,a,t-o,r-o,i)))break;return i?new mt(e.type,e.children.slice(0,s).concat(l),e.positions.slice(0,s+1),o+l.length):l}}return null}function Fq(n,e,t,r,i){for(let s of e){let o=s.from+(s.openStart?25:0),a=s.to-(s.openEnd?25:0),l=o<=t&&a>t&&sO(n,s.tree,0-s.offset,t,a),c;if(l&&l.pos<=r&&(c=$x(n,s.tree,t+s.offset,l.pos+s.offset,!1)))return{state:l.state,tree:c}}return{state:n.streamParser.startState(i?Ho(i):4),tree:mt.empty}}let Xq=class{constructor(e,t,r,i){this.lang=e,this.input=t,this.fragments=r,this.ranges=i,this.stoppedAt=null,this.chunks=[],this.chunkPos=[],this.chunk=[],this.chunkReused=void 0,this.rangeIndex=0,this.to=i[i.length-1].to;let s=Go.get(),o=i[0].from,{state:a,tree:l}=Fq(e,r,o,this.to,s?.state);this.state=a,this.parsedPos=this.chunkStart=o+l.length;for(let c=0;c<l.children.length;c++)this.chunks.push(l.children[c]),this.chunkPos.push(l.positions[c]);s&&this.parsedPos<s.viewport.from-1e5&&i.some(c=>c.from<=s.viewport.from&&c.to>=s.viewport.from)&&(this.state=this.lang.streamParser.startState(Ho(s.state)),s.skipUntilInView(this.parsedPos,s.viewport.from),this.parsedPos=s.viewport.from),this.moveRangeIndex()}advance(){let e=Go.get(),t=this.stoppedAt==null?this.to:Math.min(this.to,this.stoppedAt),r=Math.min(t,this.chunkStart+512);for(e&&(r=Math.min(r,e.viewport.to));this.parsedPos<r;)this.parseLine(e);return this.chunkStart<this.parsedPos&&this.finishChunk(),this.parsedPos>=t?this.finish():e&&this.parsedPos>=e.viewport.to?(e.skipUntilInView(this.parsedPos,t),this.finish()):null}stopAt(e){this.stoppedAt=e}lineAfter(e){let t=this.input.chunk(e);if(this.input.lineChunks)t==`
|
|
154
|
-
`&&(t="");else{let r=t.indexOf(`
|
|
155
|
-
`);r>-1&&(t=t.slice(0,r))}return e+t.length<=this.to?t:t.slice(0,this.to-e)}nextLine(){let e=this.parsedPos,t=this.lineAfter(e),r=e+t.length;for(let i=this.rangeIndex;;){let s=this.ranges[i].to;if(s>=r||(t=t.slice(0,s-(r-t.length)),i++,i==this.ranges.length))break;let o=this.ranges[i].from,a=this.lineAfter(o);t+=a,r=o+a.length}return{line:t,end:r}}skipGapsTo(e,t,r){for(;;){let i=this.ranges[this.rangeIndex].to,s=e+t;if(r>0?i>s:i>=s)break;let o=this.ranges[++this.rangeIndex].from;t+=o-i}return t}moveRangeIndex(){for(;this.ranges[this.rangeIndex].to<this.parsedPos;)this.rangeIndex++}emitToken(e,t,r,i){let s=4;if(this.ranges.length>1){i=this.skipGapsTo(t,i,1),t+=i;let a=this.chunk.length;i=this.skipGapsTo(r,i,-1),r+=i,s+=this.chunk.length-a}let o=this.chunk.length-4;return this.lang.streamParser.mergeTokens&&s==4&&o>=0&&this.chunk[o]==e&&this.chunk[o+2]==t?this.chunk[o+2]=r:this.chunk.push(e,t,r,s),i}parseLine(e){let{line:t,end:r}=this.nextLine(),i=0,{streamParser:s}=this.lang,o=new Ex(t,e?e.state.tabSize:4,e?Ho(e.state):2);if(o.eol())s.blankLine(this.state,o.indentUnit);else for(;!o.eol();){let a=Qx(s.token,o,this.state);if(a&&(i=this.emitToken(this.lang.tokenTable.resolve(a),this.parsedPos+o.start,this.parsedPos+o.pos,i)),o.start>1e4)break}this.parsedPos=r,this.moveRangeIndex(),this.parsedPos<this.to&&this.parsedPos++}finishChunk(){let e=mt.build({buffer:this.chunk,start:this.chunkStart,length:this.parsedPos-this.chunkStart,nodeSet:Vq,topID:0,maxBufferLength:512,reused:this.chunkReused});e=new mt(e.type,e.children,e.positions,e.length,[[this.lang.stateAfter,this.lang.streamParser.copyState(this.state)]]),this.chunks.push(e),this.chunkPos.push(this.chunkStart-this.ranges[0].from),this.chunk=[],this.chunkReused=void 0,this.chunkStart=this.parsedPos}finish(){return new mt(this.lang.topNode,this.chunks,this.chunkPos,this.parsedPos-this.ranges[0].from).balance()}};function Qx(n,e,t){e.start=e.pos;for(let r=0;r<10;r++){let i=n(e,t);if(e.pos>e.start)return i}throw new Error("Stream parser failed to advance stream.")}const oO=Object.create(null),Pc=[Ln.none],Vq=new vl(Pc),l1=[],c1=Object.create(null),Lx=Object.create(null);for(let[n,e]of[["variable","variableName"],["variable-2","variableName.special"],["string-2","string.special"],["def","variableName.definition"],["tag","tagName"],["attribute","attributeName"],["type","typeName"],["builtin","variableName.standard"],["qualifier","modifier"],["error","invalid"],["header","heading"],["property","propertyName"]])Lx[n]=qx(oO,e);class Mx{constructor(e){this.extra=e,this.table=Object.assign(Object.create(null),Lx)}resolve(e){return e?this.table[e]||(this.table[e]=qx(this.extra,e)):0}}const Wq=new Mx(oO);function np(n,e){l1.indexOf(n)>-1||(l1.push(n),console.warn(e))}function qx(n,e){let t=[];for(let a of e.split(" ")){let l=[];for(let c of a.split(".")){let u=n[c]||N[c];u?typeof u=="function"?l.length?l=l.map(u):np(c,`Modifier ${c} used at start of tag`):l.length?np(c,`Tag ${c} used as modifier`):l=Array.isArray(u)?u:[u]:np(c,`Unknown highlighting tag ${c}`)}for(let c of l)t.push(c)}if(!t.length)return 0;let r=e.replace(/ /g,"_"),i=r+" "+t.map(a=>a.id),s=c1[i];if(s)return s.id;let o=c1[i]=Ln.define({id:Pc.length,name:r,props:[Ol({[r]:t})]});return Pc.push(o),o.id}function Yq(n,e){let t=Ln.define({id:Pc.length,name:"Document",props:[Xs.add(()=>n),bl.add(()=>r=>e.getIndent(r))],top:!0});return Pc.push(t),t}bn.RTL,bn.LTR;const Uq=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),r=lO(n.state,t.from);return r.line?Gq(n):r.block?Kq(n):!1};function aO(n,e){return({state:t,dispatch:r})=>{if(t.readOnly)return!1;let i=n(e,t);return i?(r(t.update(i)),!0):!1}}const Gq=aO(tR,0),Hq=aO(Rx,0),Kq=aO((n,e)=>Rx(n,e,eR(e)),0);function lO(n,e){let t=n.languageDataAt("commentTokens",e,1);return t.length?t[0]:{}}const Ql=50;function Jq(n,{open:e,close:t},r,i){let s=n.sliceDoc(r-Ql,r),o=n.sliceDoc(i,i+Ql),a=/\s*$/.exec(s)[0].length,l=/^\s*/.exec(o)[0].length,c=s.length-a;if(s.slice(c-e.length,c)==e&&o.slice(l,l+t.length)==t)return{open:{pos:r-a,margin:a&&1},close:{pos:i+l,margin:l&&1}};let u,f;i-r<=2*Ql?u=f=n.sliceDoc(r,i):(u=n.sliceDoc(r,r+Ql),f=n.sliceDoc(i-Ql,i));let d=/^\s*/.exec(u)[0].length,h=/\s*$/.exec(f)[0].length,m=f.length-h-t.length;return u.slice(d,d+e.length)==e&&f.slice(m,m+t.length)==t?{open:{pos:r+d+e.length,margin:/\s/.test(u.charAt(d+e.length))?1:0},close:{pos:i-h-t.length,margin:/\s/.test(f.charAt(m-1))?1:0}}:null}function eR(n){let e=[];for(let t of n.selection.ranges){let r=n.doc.lineAt(t.from),i=t.to<=r.to?r:n.doc.lineAt(t.to);i.from>r.from&&i.from==t.to&&(i=t.to==r.to+1?r:n.doc.lineAt(t.to-1));let s=e.length-1;s>=0&&e[s].to>r.from?e[s].to=i.to:e.push({from:r.from+/^\s*/.exec(r.text)[0].length,to:i.to})}return e}function Rx(n,e,t=e.selection.ranges){let r=t.map(s=>lO(e,s.from).block);if(!r.every(s=>s))return null;let i=t.map((s,o)=>Jq(e,r[o],s.from,s.to));if(n!=2&&!i.every(s=>s))return{changes:e.changes(t.map((s,o)=>i[o]?[]:[{from:s.from,insert:r[o].open+" "},{from:s.to,insert:" "+r[o].close}]))};if(n!=1&&i.some(s=>s)){let s=[];for(let o=0,a;o<i.length;o++)if(a=i[o]){let l=r[o],{open:c,close:u}=a;s.push({from:c.pos-l.open.length,to:c.pos+c.margin},{from:u.pos-u.margin,to:u.pos+l.close.length})}return{changes:s}}return null}function tR(n,e,t=e.selection.ranges){let r=[],i=-1;e:for(let{from:s,to:o}of t){let a=r.length,l=1e9,c;for(let u=s;u<=o;){let f=e.doc.lineAt(u);if(c==null&&(c=lO(e,f.from).line,!c))continue e;if(f.from>i&&(s==o||o>f.from)){i=f.from;let d=/^\s*/.exec(f.text)[0].length,h=d==f.length,m=f.text.slice(d,d+c.length)==c?d:-1;d<f.text.length&&d<l&&(l=d),r.push({line:f,comment:m,token:c,indent:d,empty:h,single:!1})}u=f.to+1}if(l<1e9)for(let u=a;u<r.length;u++)r[u].indent<r[u].line.text.length&&(r[u].indent=l);r.length==a+1&&(r[a].single=!0)}if(n!=2&&r.some(s=>s.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:a,token:l,indent:c,empty:u,single:f}of r)(f||!u)&&s.push({from:a.from+c,insert:l+" "});let o=e.changes(s);return{changes:o,selection:e.selection.map(o,1)}}else if(n!=1&&r.some(s=>s.comment>=0)){let s=[];for(let{line:o,comment:a,token:l}of r)if(a>=0){let c=o.from+a,u=c+l.length;o.text[u-o.from]==" "&&u++,s.push({from:c,to:u})}return{changes:s}}return null}const eg=Es.define(),nR=Es.define(),rR=Ie.define(),Dx=Ie.define({combine(n){return iu(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(r,i)=>e(r,i)||t(r,i)})}}),Ix=ui.define({create(){return Yi.empty},update(n,e){let t=e.state.facet(Dx),r=e.annotation(eg);if(r){let l=Cr.fromTransaction(e,r.selection),c=r.side,u=c==0?n.undone:n.done;return l?u=td(u,u.length,t.minDepth,l):u=jx(u,e.startState.selection),new Yi(c==0?r.rest:u,c==0?u:r.rest)}let i=e.annotation(nR);if((i=="full"||i=="before")&&(n=n.isolate()),e.annotation(En.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=Cr.fromTransaction(e),o=e.annotation(En.time),a=e.annotation(En.userEvent);return s?n=n.addChanges(s,o,a,t,e):e.selection&&(n=n.addSelection(e.startState.selection,o,a,t.newGroupDelay)),(i=="full"||i=="after")&&(n=n.isolate()),n},toJSON(n){return{done:n.done.map(e=>e.toJSON()),undone:n.undone.map(e=>e.toJSON())}},fromJSON(n){return new Yi(n.done.map(Cr.fromJSON),n.undone.map(Cr.fromJSON))}});function cO(n={}){return[Ix,Dx.of(n),Pe.domEventHandlers({beforeinput(e,t){let r=e.inputType=="historyUndo"?Nx:e.inputType=="historyRedo"?tg:null;return r?(e.preventDefault(),r(t)):!1}})]}function sh(n,e){return function({state:t,dispatch:r}){if(!e&&t.readOnly)return!1;let i=t.field(Ix,!1);if(!i)return!1;let s=i.pop(n,t,e);return s?(r(s),!0):!1}}const Nx=sh(0,!1),tg=sh(1,!1),iR=sh(0,!0),sR=sh(1,!0);class Cr{constructor(e,t,r,i,s){this.changes=e,this.effects=t,this.mapped=r,this.startSelection=i,this.selectionsAfter=s}setSelAfter(e){return new Cr(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,r;return{changes:(e=this.changes)===null||e===void 0?void 0:e.toJSON(),mapped:(t=this.mapped)===null||t===void 0?void 0:t.toJSON(),startSelection:(r=this.startSelection)===null||r===void 0?void 0:r.toJSON(),selectionsAfter:this.selectionsAfter.map(i=>i.toJSON())}}static fromJSON(e){return new Cr(e.changes&&Dn.fromJSON(e.changes),[],e.mapped&&Hi.fromJSON(e.mapped),e.startSelection&&me.fromJSON(e.startSelection),e.selectionsAfter.map(me.fromJSON))}static fromTransaction(e,t){let r=ti;for(let i of e.startState.facet(rR)){let s=i(e);s.length&&(r=r.concat(s))}return!r.length&&e.changes.empty?null:new Cr(e.changes.invert(e.startState.doc),r,void 0,t||e.startState.selection,ti)}static selection(e){return new Cr(void 0,ti,void 0,void 0,e)}}function td(n,e,t,r){let i=e+1>t+20?e-t-1:0,s=n.slice(i,e);return s.push(r),s}function oR(n,e){let t=[],r=!1;return n.iterChangedRanges((i,s)=>t.push(i,s)),e.iterChangedRanges((i,s,o,a)=>{for(let l=0;l<t.length;){let c=t[l++],u=t[l++];a>=c&&o<=u&&(r=!0)}}),r}function aR(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,r)=>t.empty!=e.ranges[r].empty).length===0}function Bx(n,e){return n.length?e.length?n.concat(e):n:e}const ti=[],lR=200;function jx(n,e){if(n.length){let t=n[n.length-1],r=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-lR));return r.length&&r[r.length-1].eq(e)?n:(r.push(e),td(n,n.length-1,1e9,t.setSelAfter(r)))}else return[Cr.selection([e])]}function cR(n){let e=n[n.length-1],t=n.slice();return t[n.length-1]=e.setSelAfter(e.selectionsAfter.slice(0,e.selectionsAfter.length-1)),t}function rp(n,e){if(!n.length)return n;let t=n.length,r=ti;for(;t;){let i=uR(n[t-1],e,r);if(i.changes&&!i.changes.empty||i.effects.length){let s=n.slice(0,t);return s[t-1]=i,s}else e=i.mapped,t--,r=i.selectionsAfter}return r.length?[Cr.selection(r)]:ti}function uR(n,e,t){let r=Bx(n.selectionsAfter.length?n.selectionsAfter.map(a=>a.map(e)):ti,t);if(!n.changes)return Cr.selection(r);let i=n.changes.map(e),s=e.mapDesc(n.changes,!0),o=n.mapped?n.mapped.composeDesc(s):s;return new Cr(i,Qt.mapEffects(n.effects,e),o,n.startSelection.map(s),r)}const fR=/^(input\.type|delete)($|\.)/;class Yi{constructor(e,t,r=0,i=void 0){this.done=e,this.undone=t,this.prevTime=r,this.prevUserEvent=i}isolate(){return this.prevTime?new Yi(this.done,this.undone):this}addChanges(e,t,r,i,s){let o=this.done,a=o[o.length-1];return a&&a.changes&&!a.changes.empty&&e.changes&&(!r||fR.test(r))&&(!a.selectionsAfter.length&&t-this.prevTime<i.newGroupDelay&&i.joinToEvent(s,oR(a.changes,e.changes))||r=="input.type.compose")?o=td(o,o.length-1,i.minDepth,new Cr(e.changes.compose(a.changes),Bx(Qt.mapEffects(e.effects,a.changes),a.effects),a.mapped,a.startSelection,ti)):o=td(o,o.length,i.minDepth,e),new Yi(o,ti,t,r)}addSelection(e,t,r,i){let s=this.done.length?this.done[this.done.length-1].selectionsAfter:ti;return s.length>0&&t-this.prevTime<i&&r==this.prevUserEvent&&r&&/^select($|\.)/.test(r)&&aR(s[s.length-1],e)?this:new Yi(jx(this.done,e),this.undone,t,r)}addMapping(e){return new Yi(rp(this.done,e),rp(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,r){let i=e==0?this.done:this.undone;if(i.length==0)return null;let s=i[i.length-1],o=s.selectionsAfter[0]||(s.startSelection?s.startSelection.map(s.changes.invertedDesc,1):t.selection);if(r&&s.selectionsAfter.length)return t.update({selection:s.selectionsAfter[s.selectionsAfter.length-1],annotations:eg.of({side:e,rest:cR(i),selection:o}),userEvent:e==0?"select.undo":"select.redo",scrollIntoView:!0});if(s.changes){let a=i.length==1?ti:i.slice(0,i.length-1);return s.mapped&&(a=rp(a,s.mapped)),t.update({changes:s.changes,selection:s.startSelection,effects:s.effects,annotations:eg.of({side:e,rest:a,selection:o}),filter:!1,userEvent:e==0?"undo":"redo",scrollIntoView:!0})}else return null}}Yi.empty=new Yi(ti,ti);const uO=[{key:"Mod-z",run:Nx,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:tg,preventDefault:!0},{linux:"Ctrl-Shift-z",run:tg,preventDefault:!0},{key:"Mod-u",run:iR,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:sR,preventDefault:!0}];function wl(n,e){return me.create(n.ranges.map(e),n.mainIndex)}function Li(n,e){return n.update({selection:e,scrollIntoView:!0,userEvent:"select"})}function Mi({state:n,dispatch:e},t){let r=wl(n.selection,t);return r.eq(n.selection,!0)?!1:(e(Li(n,r)),!0)}function oh(n,e){return me.cursor(e?n.to:n.from)}function zx(n,e){return Mi(n,t=>t.empty?n.moveByChar(t,e):oh(t,e))}function ar(n){return n.textDirectionAt(n.state.selection.main.head)==bn.LTR}const Zx=n=>zx(n,!ar(n)),Fx=n=>zx(n,ar(n));function Xx(n,e){return Mi(n,t=>t.empty?n.moveByGroup(t,e):oh(t,e))}const dR=n=>Xx(n,!ar(n)),hR=n=>Xx(n,ar(n));function pR(n,e,t){if(e.type.prop(t))return!0;let r=e.to-e.from;return r&&(r>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function ah(n,e,t){let r=wn(n).resolveInner(e.head),i=t?et.closedBy:et.openedBy;for(let l=e.head;;){let c=t?r.childAfter(l):r.childBefore(l);if(!c)break;pR(n,c,i)?r=c:l=t?c.to:c.from}let s=r.type.prop(i),o,a;return s&&(o=t?Ca(n,r.from,1):Ca(n,r.to,-1))&&o.matched?a=t?o.end.to:o.end.from:a=t?r.to:r.from,me.cursor(a,t?-1:1)}const mR=n=>Mi(n,e=>ah(n.state,e,!ar(n))),gR=n=>Mi(n,e=>ah(n.state,e,ar(n)));function Vx(n,e){return Mi(n,t=>{if(!t.empty)return oh(t,e);let r=n.moveVertically(t,e);return r.head!=t.head?r:n.moveToLineBoundary(t,e)})}const Wx=n=>Vx(n,!1),Yx=n=>Vx(n,!0);function Ux(n){let e=n.scrollDOM.clientHeight<n.scrollDOM.scrollHeight-2,t=0,r=0,i;if(e){for(let s of n.state.facet(Pe.scrollMargins)){let o=s(n);o?.top&&(t=Math.max(o?.top,t)),o?.bottom&&(r=Math.max(o?.bottom,r))}i=n.scrollDOM.clientHeight-t-r}else i=(n.dom.ownerDocument.defaultView||window).innerHeight;return{marginTop:t,marginBottom:r,selfScroll:e,height:Math.max(n.defaultLineHeight,i-5)}}function Gx(n,e){let t=Ux(n),{state:r}=n,i=wl(r.selection,o=>o.empty?n.moveVertically(o,e,t.height):oh(o,e));if(i.eq(r.selection))return!1;let s;if(t.selfScroll){let o=n.coordsAtPos(r.selection.main.head),a=n.scrollDOM.getBoundingClientRect(),l=a.top+t.marginTop,c=a.bottom-t.marginBottom;o&&o.top>l&&o.bottom<c&&(s=Pe.scrollIntoView(i.main.head,{y:"start",yMargin:o.top-l}))}return n.dispatch(Li(r,i),{effects:s}),!0}const u1=n=>Gx(n,!1),ng=n=>Gx(n,!0);function uo(n,e,t){let r=n.lineBlockAt(e.head),i=n.moveToLineBoundary(e,t);if(i.head==e.head&&i.head!=(t?r.to:r.from)&&(i=n.moveToLineBoundary(e,t,!1)),!t&&i.head==r.from&&r.length){let s=/^\s*/.exec(n.state.sliceDoc(r.from,Math.min(r.from+100,r.to)))[0].length;s&&e.head!=r.from+s&&(i=me.cursor(r.from+s))}return i}const vR=n=>Mi(n,e=>uo(n,e,!0)),OR=n=>Mi(n,e=>uo(n,e,!1)),bR=n=>Mi(n,e=>uo(n,e,!ar(n))),yR=n=>Mi(n,e=>uo(n,e,ar(n))),wR=n=>Mi(n,e=>me.cursor(n.lineBlockAt(e.head).from,1)),_R=n=>Mi(n,e=>me.cursor(n.lineBlockAt(e.head).to,-1));function kR(n,e,t){let r=!1,i=wl(n.selection,s=>{let o=Ca(n,s.head,-1)||Ca(n,s.head,1)||s.head>0&&Ca(n,s.head-1,1)||s.head<n.doc.length&&Ca(n,s.head+1,-1);if(!o||!o.end)return s;r=!0;let a=o.start.from==s.head?o.end.to:o.end.from;return me.cursor(a)});return r?(e(Li(n,i)),!0):!1}const xR=({state:n,dispatch:e})=>kR(n,e);function fi(n,e){let t=wl(n.state.selection,r=>{let i=e(r);return me.range(r.anchor,i.head,i.goalColumn,i.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(Li(n.state,t)),!0)}function Hx(n,e){return fi(n,t=>n.moveByChar(t,e))}const Kx=n=>Hx(n,!ar(n)),Jx=n=>Hx(n,ar(n));function eS(n,e){return fi(n,t=>n.moveByGroup(t,e))}const SR=n=>eS(n,!ar(n)),AR=n=>eS(n,ar(n)),CR=n=>fi(n,e=>ah(n.state,e,!ar(n))),TR=n=>fi(n,e=>ah(n.state,e,ar(n)));function tS(n,e){return fi(n,t=>n.moveVertically(t,e))}const nS=n=>tS(n,!1),rS=n=>tS(n,!0);function iS(n,e){return fi(n,t=>n.moveVertically(t,e,Ux(n).height))}const f1=n=>iS(n,!1),d1=n=>iS(n,!0),PR=n=>fi(n,e=>uo(n,e,!0)),ER=n=>fi(n,e=>uo(n,e,!1)),$R=n=>fi(n,e=>uo(n,e,!ar(n))),QR=n=>fi(n,e=>uo(n,e,ar(n))),LR=n=>fi(n,e=>me.cursor(n.lineBlockAt(e.head).from)),MR=n=>fi(n,e=>me.cursor(n.lineBlockAt(e.head).to)),h1=({state:n,dispatch:e})=>(e(Li(n,{anchor:0})),!0),p1=({state:n,dispatch:e})=>(e(Li(n,{anchor:n.doc.length})),!0),m1=({state:n,dispatch:e})=>(e(Li(n,{anchor:n.selection.main.anchor,head:0})),!0),g1=({state:n,dispatch:e})=>(e(Li(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),qR=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),RR=({state:n,dispatch:e})=>{let t=lh(n).map(({from:r,to:i})=>me.range(r,Math.min(i+1,n.doc.length)));return e(n.update({selection:me.create(t),userEvent:"select"})),!0},DR=({state:n,dispatch:e})=>{let t=wl(n.selection,r=>{let i=wn(n),s=i.resolveStack(r.from,1);if(r.empty){let o=i.resolveStack(r.from,-1);o.node.from>=s.node.from&&o.node.to<=s.node.to&&(s=o)}for(let o=s;o;o=o.next){let{node:a}=o;if((a.from<r.from&&a.to>=r.to||a.to>r.to&&a.from<=r.from)&&o.next)return me.range(a.to,a.from)}return r});return t.eq(n.selection)?!1:(e(Li(n,t)),!0)};function sS(n,e){let{state:t}=n,r=t.selection,i=t.selection.ranges.slice();for(let s of t.selection.ranges){let o=t.doc.lineAt(s.head);if(e?o.to<n.state.doc.length:o.from>0)for(let a=s;;){let l=n.moveVertically(a,e);if(l.head<o.from||l.head>o.to){i.some(c=>c.head==l.head)||i.push(l);break}else{if(l.head==a.head)break;a=l}}}return i.length==r.ranges.length?!1:(n.dispatch(Li(t,me.create(i,i.length-1))),!0)}const IR=n=>sS(n,!1),NR=n=>sS(n,!0),BR=({state:n,dispatch:e})=>{let t=n.selection,r=null;return t.ranges.length>1?r=me.create([t.main]):t.main.empty||(r=me.create([me.cursor(t.main.head)])),r?(e(Li(n,r)),!0):!1};function fu(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:r}=n,i=r.changeByRange(s=>{let{from:o,to:a}=s;if(o==a){let l=e(s);l<o?(t="delete.backward",l=Bu(n,l,!1)):l>o&&(t="delete.forward",l=Bu(n,l,!0)),o=Math.min(o,l),a=Math.max(a,l)}else o=Bu(n,o,!1),a=Bu(n,a,!0);return o==a?{range:s}:{changes:{from:o,to:a},range:me.cursor(o,o<s.head?-1:1)}});return i.changes.empty?!1:(n.dispatch(r.update(i,{scrollIntoView:!0,userEvent:t,effects:t=="delete.selection"?Pe.announce.of(r.phrase("Selection deleted")):void 0})),!0)}function Bu(n,e,t){if(n instanceof Pe)for(let r of n.state.facet(Pe.atomicRanges).map(i=>i(n)))r.between(e,e,(i,s)=>{i<e&&s>e&&(e=t?s:i)});return e}const oS=(n,e,t)=>fu(n,r=>{let i=r.from,{state:s}=n,o=s.doc.lineAt(i),a,l;if(t&&!e&&i>o.from&&i<o.from+200&&!/[^ \t]/.test(a=o.text.slice(0,i-o.from))){if(a[a.length-1]==" ")return i-1;let c=xs(a,s.tabSize),u=c%Ho(s)||Ho(s);for(let f=0;f<u&&a[a.length-1-f]==" ";f++)i--;l=i}else l=Fn(o.text,i-o.from,e,e)+o.from,l==i&&o.number!=(e?s.doc.lines:1)?l+=e?1:-1:!e&&/[\ufe00-\ufe0f]/.test(o.text.slice(l-o.from,i-o.from))&&(l=Fn(o.text,l-o.from,!1,!1)+o.from);return l}),rg=n=>oS(n,!1,!0),aS=n=>oS(n,!0,!1),lS=(n,e)=>fu(n,t=>{let r=t.head,{state:i}=n,s=i.doc.lineAt(r),o=i.charCategorizer(r);for(let a=null;;){if(r==(e?s.to:s.from)){r==t.head&&s.number!=(e?i.doc.lines:1)&&(r+=e?1:-1);break}let l=Fn(s.text,r-s.from,e)+s.from,c=s.text.slice(Math.min(r,l)-s.from,Math.max(r,l)-s.from),u=o(c);if(a!=null&&u!=a)break;(c!=" "||r!=t.head)&&(a=u),r=l}return r}),cS=n=>lS(n,!1),jR=n=>lS(n,!0),zR=n=>fu(n,e=>{let t=n.lineBlockAt(e.head).to;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),ZR=n=>fu(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),FR=n=>fu(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head<t?t:Math.min(n.state.doc.length,e.head+1)}),XR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>({changes:{from:r.from,to:r.to,insert:Nt.of(["",""])},range:me.cursor(r.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},VR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(r=>{if(!r.empty||r.from==0||r.from==n.doc.length)return{range:r};let i=r.from,s=n.doc.lineAt(i),o=i==s.from?i-1:Fn(s.text,i-s.from,!1)+s.from,a=i==s.to?i+1:Fn(s.text,i-s.from,!0)+s.from;return{changes:{from:o,to:a,insert:n.doc.slice(i,a).append(n.doc.slice(o,i))},range:me.cursor(a)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function lh(n){let e=[],t=-1;for(let r of n.selection.ranges){let i=n.doc.lineAt(r.from),s=n.doc.lineAt(r.to);if(!r.empty&&r.to==s.from&&(s=n.doc.lineAt(r.to-1)),t>=i.number){let o=e[e.length-1];o.to=s.to,o.ranges.push(r)}else e.push({from:i.from,to:s.to,ranges:[r]});t=s.number+1}return e}function uS(n,e,t){if(n.readOnly)return!1;let r=[],i=[];for(let s of lh(n)){if(t?s.to==n.doc.length:s.from==0)continue;let o=n.doc.lineAt(t?s.to+1:s.from-1),a=o.length+1;if(t){r.push({from:s.to,to:o.to},{from:s.from,insert:o.text+n.lineBreak});for(let l of s.ranges)i.push(me.range(Math.min(n.doc.length,l.anchor+a),Math.min(n.doc.length,l.head+a)))}else{r.push({from:o.from,to:s.from},{from:s.to,insert:n.lineBreak+o.text});for(let l of s.ranges)i.push(me.range(l.anchor-a,l.head-a))}}return r.length?(e(n.update({changes:r,scrollIntoView:!0,selection:me.create(i,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const WR=({state:n,dispatch:e})=>uS(n,e,!1),YR=({state:n,dispatch:e})=>uS(n,e,!0);function fS(n,e,t){if(n.readOnly)return!1;let r=[];for(let s of lh(n))t?r.push({from:s.from,insert:n.doc.slice(s.from,s.to)+n.lineBreak}):r.push({from:s.to,insert:n.lineBreak+n.doc.slice(s.from,s.to)});let i=n.changes(r);return e(n.update({changes:i,selection:n.selection.map(i,t?1:-1),scrollIntoView:!0,userEvent:"input.copyline"})),!0}const UR=({state:n,dispatch:e})=>fS(n,e,!1),GR=({state:n,dispatch:e})=>fS(n,e,!0),HR=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(lh(e).map(({from:i,to:s})=>(i>0?i--:s<e.doc.length&&s++,{from:i,to:s}))),r=wl(e.selection,i=>{let s;if(n.lineWrapping){let o=n.lineBlockAt(i.head),a=n.coordsAtPos(i.head,i.assoc||1);a&&(s=o.bottom+n.documentTop-a.bottom+n.defaultLineHeight/2)}return n.moveVertically(i,!0,s)}).map(t);return n.dispatch({changes:t,selection:r,scrollIntoView:!0,userEvent:"delete.line"}),!0};function KR(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=wn(n).resolveInner(e),r=t.childBefore(e),i=t.childAfter(e),s;return r&&i&&r.to<=e&&i.from>=e&&(s=r.type.prop(et.closedBy))&&s.indexOf(i.name)>-1&&n.doc.lineAt(r.to).from==n.doc.lineAt(i.from).from&&!/\S/.test(n.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}const v1=dS(!1),JR=dS(!0);function dS(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let r=e.changeByRange(i=>{let{from:s,to:o}=i,a=e.doc.lineAt(s),l=!n&&s==o&&KR(e,s);n&&(s=o=(o<=a.to?a:e.doc.lineAt(o)).to);let c=new ih(e,{simulateBreak:s,simulateDoubleBreak:!!l}),u=kx(c,s);for(u==null&&(u=xs(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));o<a.to&&/\s/.test(a.text[o-a.from]);)o++;l?{from:s,to:o}=l:s>a.from&&s<a.from+100&&!/\S/.test(a.text.slice(0,s))&&(s=a.from);let f=["",ed(e,u)];return l&&f.push(ed(e,c.lineIndent(a.from,-1))),{changes:{from:s,to:o,insert:Nt.of(f)},range:me.cursor(s+1+f[1].length)}});return t(e.update(r,{scrollIntoView:!0,userEvent:"input"})),!0}}function fO(n,e){let t=-1;return n.changeByRange(r=>{let i=[];for(let o=r.from;o<=r.to;){let a=n.doc.lineAt(o);a.number>t&&(r.empty||r.to>a.from)&&(e(a,i,r),t=a.number),o=a.to+1}let s=n.changes(i);return{changes:i,range:me.range(s.mapPos(r.anchor,1),s.mapPos(r.head,1))}})}const eD=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),r=new ih(n,{overrideIndentation:s=>{let o=t[s];return o??-1}}),i=fO(n,(s,o,a)=>{let l=kx(r,s.from);if(l==null)return;/\S/.test(s.text)||(l=0);let c=/^\s*/.exec(s.text)[0],u=ed(n,l);(c!=u||a.from<s.from+c.length)&&(t[s.from]=l,o.push({from:s.from,to:s.from+c.length,insert:u}))});return i.changes.empty||e(n.update(i,{userEvent:"indent"})),!0},hS=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(fO(n,(t,r)=>{r.push({from:t.from,insert:n.facet(cu)})}),{userEvent:"input.indent"})),!0),pS=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(fO(n,(t,r)=>{let i=/^\s*/.exec(t.text)[0];if(!i)return;let s=xs(i,n.tabSize),o=0,a=ed(n,Math.max(0,s-Ho(n)));for(;o<i.length&&o<a.length&&i.charCodeAt(o)==a.charCodeAt(o);)o++;r.push({from:t.from+o,to:t.from+i.length,insert:a.slice(o)})}),{userEvent:"delete.dedent"})),!0),tD=n=>(n.setTabFocusMode(),!0),nD=[{key:"Ctrl-b",run:Zx,shift:Kx,preventDefault:!0},{key:"Ctrl-f",run:Fx,shift:Jx},{key:"Ctrl-p",run:Wx,shift:nS},{key:"Ctrl-n",run:Yx,shift:rS},{key:"Ctrl-a",run:wR,shift:LR},{key:"Ctrl-e",run:_R,shift:MR},{key:"Ctrl-d",run:aS},{key:"Ctrl-h",run:rg},{key:"Ctrl-k",run:zR},{key:"Ctrl-Alt-h",run:cS},{key:"Ctrl-o",run:XR},{key:"Ctrl-t",run:VR},{key:"Ctrl-v",run:ng}],rD=[{key:"ArrowLeft",run:Zx,shift:Kx,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:dR,shift:SR,preventDefault:!0},{mac:"Cmd-ArrowLeft",run:bR,shift:$R,preventDefault:!0},{key:"ArrowRight",run:Fx,shift:Jx,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:hR,shift:AR,preventDefault:!0},{mac:"Cmd-ArrowRight",run:yR,shift:QR,preventDefault:!0},{key:"ArrowUp",run:Wx,shift:nS,preventDefault:!0},{mac:"Cmd-ArrowUp",run:h1,shift:m1},{mac:"Ctrl-ArrowUp",run:u1,shift:f1},{key:"ArrowDown",run:Yx,shift:rS,preventDefault:!0},{mac:"Cmd-ArrowDown",run:p1,shift:g1},{mac:"Ctrl-ArrowDown",run:ng,shift:d1},{key:"PageUp",run:u1,shift:f1},{key:"PageDown",run:ng,shift:d1},{key:"Home",run:OR,shift:ER,preventDefault:!0},{key:"Mod-Home",run:h1,shift:m1},{key:"End",run:vR,shift:PR,preventDefault:!0},{key:"Mod-End",run:p1,shift:g1},{key:"Enter",run:v1,shift:v1},{key:"Mod-a",run:qR},{key:"Backspace",run:rg,shift:rg,preventDefault:!0},{key:"Delete",run:aS,preventDefault:!0},{key:"Mod-Backspace",mac:"Alt-Backspace",run:cS,preventDefault:!0},{key:"Mod-Delete",mac:"Alt-Delete",run:jR,preventDefault:!0},{mac:"Mod-Backspace",run:ZR,preventDefault:!0},{mac:"Mod-Delete",run:FR,preventDefault:!0}].concat(nD.map(n=>({mac:n.key,run:n.run,shift:n.shift}))),dO=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:mR,shift:CR},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:gR,shift:TR},{key:"Alt-ArrowUp",run:WR},{key:"Shift-Alt-ArrowUp",run:UR},{key:"Alt-ArrowDown",run:YR},{key:"Shift-Alt-ArrowDown",run:GR},{key:"Mod-Alt-ArrowUp",run:IR},{key:"Mod-Alt-ArrowDown",run:NR},{key:"Escape",run:BR},{key:"Mod-Enter",run:JR},{key:"Alt-l",mac:"Ctrl-l",run:RR},{key:"Mod-i",run:DR,preventDefault:!0},{key:"Mod-[",run:pS},{key:"Mod-]",run:hS},{key:"Mod-Alt-\\",run:eD},{key:"Shift-Mod-k",run:HR},{key:"Shift-Mod-\\",run:xR},{key:"Mod-/",run:Uq},{key:"Alt-A",run:Hq},{key:"Ctrl-m",mac:"Shift-Alt-m",run:tD}].concat(rD),iD={key:"Tab",run:hS,shift:pS};class hO{constructor(e,t,r,i){this.state=e,this.pos=t,this.explicit=r,this.view=i,this.abortListeners=[],this.abortOnDocChange=!1}tokenBefore(e){let t=wn(this.state).resolveInner(this.pos,-1);for(;t&&e.indexOf(t.name)<0;)t=t.parent;return t?{from:t.from,to:this.pos,text:this.state.sliceDoc(t.from,this.pos),type:t.type}:null}matchBefore(e){let t=this.state.doc.lineAt(this.pos),r=Math.max(t.from,this.pos-250),i=t.text.slice(r-t.from,this.pos-t.from),s=i.search(gS(e,!1));return s<0?null:{from:r+s,to:this.pos,text:i.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t,r){e=="abort"&&this.abortListeners&&(this.abortListeners.push(t),r&&r.onDocChange&&(this.abortOnDocChange=!0))}}function O1(n){let e=Object.keys(n).join(""),t=/\w/.test(e);return t&&(e=e.replace(/\w/g,"")),`[${t?"\\w":""}${e.replace(/[^\w\s]/g,"\\$&")}]`}function sD(n){let e=Object.create(null),t=Object.create(null);for(let{label:i}of n){e[i[0]]=!0;for(let s=1;s<i.length;s++)t[i[s]]=!0}let r=O1(e)+O1(t)+"*$";return[new RegExp("^"+r),new RegExp(r)]}function mS(n){let e=n.map(i=>typeof i=="string"?{label:i}:i),[t,r]=e.every(i=>/^\w+$/.test(i.label))?[/\w*$/,/\w+$/]:sD(e);return i=>{let s=i.matchBefore(r);return s||i.explicit?{from:s?s.from:i.pos,options:e,validFor:t}:null}}function oD(n,e){return t=>{for(let r=wn(t.state).resolveInner(t.pos,-1);r;r=r.parent){if(n.indexOf(r.name)>-1)return null;if(r.type.isTop)break}return e(t)}}class b1{constructor(e,t,r,i){this.completion=e,this.source=t,this.match=r,this.score=i}}function Io(n){return n.selection.main.from}function gS(n,e){var t;let{source:r}=n,i=e&&r[0]!="^",s=r[r.length-1]!="$";return!i&&!s?n:new RegExp(`${i?"^":""}(?:${r})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const pO=Es.define();function aD(n,e,t,r){let{main:i}=n.selection,s=t-i.from,o=r-i.from;return{...n.changeByRange(a=>{if(a!=i&&t!=r&&n.sliceDoc(a.from+s,a.from+o)!=n.sliceDoc(t,r))return{range:a};let l=n.toText(e);return{changes:{from:a.from+s,to:r==i.from?a.to:a.from+o,insert:l},range:me.cursor(a.from+s+l.length)}}),scrollIntoView:!0,userEvent:"input.complete"}}const y1=new WeakMap;function lD(n){if(!Array.isArray(n))return n;let e=y1.get(n);return e||y1.set(n,e=mS(n)),e}const nd=Qt.define(),Ec=Qt.define();class cD{constructor(e){this.pattern=e,this.chars=[],this.folded=[],this.any=[],this.precise=[],this.byWord=[],this.score=0,this.matched=[];for(let t=0;t<e.length;){let r=Ns(e,t),i=ko(r);this.chars.push(r);let s=e.slice(t,t+i),o=s.toUpperCase();this.folded.push(Ns(o==s?s.toLowerCase():o,0)),t+=i}this.astral=e.length!=this.chars.length}ret(e,t){return this.score=e,this.matched=t,this}match(e){if(this.pattern.length==0)return this.ret(-100,[]);if(e.length<this.pattern.length)return null;let{chars:t,folded:r,any:i,precise:s,byWord:o}=this;if(t.length==1){let b=Ns(e,0),w=ko(b),S=w==e.length?0:-100;if(b!=t[0])if(b==r[0])S+=-200;else return null;return this.ret(S,[0,w])}let a=e.indexOf(this.pattern);if(a==0)return this.ret(e.length==this.pattern.length?0:-100,[0,this.pattern.length]);let l=t.length,c=0;if(a<0){for(let b=0,w=Math.min(e.length,200);b<w&&c<l;){let S=Ns(e,b);(S==t[c]||S==r[c])&&(i[c++]=b),b+=ko(S)}if(c<l)return null}let u=0,f=0,d=!1,h=0,m=-1,p=-1,v=/[a-z]/.test(e),O=!0;for(let b=0,w=Math.min(e.length,200),S=0;b<w&&f<l;){let _=Ns(e,b);a<0&&(u<l&&_==t[u]&&(s[u++]=b),h<l&&(_==t[h]||_==r[h]?(h==0&&(m=b),p=b+1,h++):h=0));let x,A=_<255?_>=48&&_<=57||_>=97&&_<=122?2:_>=65&&_<=90?1:0:(x=e2(_))!=x.toLowerCase()?1:x!=x.toUpperCase()?2:0;(!b||A==1&&v||S==0&&A!=0)&&(t[f]==_||r[f]==_&&(d=!0)?o[f++]=b:o.length&&(O=!1)),S=A,b+=ko(_)}return f==l&&o[0]==0&&O?this.result(-100+(d?-200:0),o,e):h==l&&m==0?this.ret(-200-e.length+(p==e.length?0:-100),[0,p]):a>-1?this.ret(-700-e.length,[a,a+this.pattern.length]):h==l?this.ret(-900-e.length,[m,p]):f==l?this.result(-100+(d?-200:0)+-700+(O?0:-1100),o,e):t.length==2?null:this.result((i[0]?-700:0)+-200+-1100,i,e)}result(e,t,r){let i=[],s=0;for(let o of t){let a=o+(this.astral?ko(Ns(r,o)):1);s&&i[s-1]==o?i[s-1]=a:(i[s++]=o,i[s++]=a)}return this.ret(e-r.length,i)}}class uD{constructor(e){this.pattern=e,this.matched=[],this.score=0,this.folded=e.toLowerCase()}match(e){if(e.length<this.pattern.length)return null;let t=e.slice(0,this.pattern.length),r=t==this.pattern?0:t.toLowerCase()==this.folded?-200:null;return r==null?null:(this.matched=[0,t.length],this.score=r+(e.length==this.pattern.length?0:-100),this)}}const Zn=Ie.define({combine(n){return iu(n,{activateOnTyping:!0,activateOnCompletion:()=>!1,activateOnTypingDelay:100,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:fD,filterStrict:!1,compareCompletions:(e,t)=>(e.sortText||e.label).localeCompare(t.sortText||t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>r=>w1(e(r),t(r)),optionClass:(e,t)=>r=>w1(e(r),t(r)),addToOptions:(e,t)=>e.concat(t),filterStrict:(e,t)=>e||t})}});function w1(n,e){return n?e?n+" "+e:n:e}function fD(n,e,t,r,i,s){let o=n.textDirection==bn.RTL,a=o,l=!1,c="top",u,f,d=e.left-i.left,h=i.right-e.right,m=r.right-r.left,p=r.bottom-r.top;if(a&&d<Math.min(m,h)?a=!1:!a&&h<Math.min(m,d)&&(a=!0),m<=(a?d:h))u=Math.max(i.top,Math.min(t.top,i.bottom-p))-e.top,f=Math.min(400,a?d:h);else{l=!0,f=Math.min(400,(o?e.right:i.right-e.left)-30);let b=i.bottom-e.bottom;b>=p||b>e.top?u=t.bottom-e.top:(c="bottom",u=e.bottom-t.top)}let v=(e.bottom-e.top)/s.offsetHeight,O=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${u/v}px; max-width: ${f/O}px`,class:"cm-completionInfo-"+(l?o?"left-narrow":"right-narrow":a?"left":"right")}}function dD(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let r=document.createElement("div");return r.classList.add("cm-completionIcon"),t.type&&r.classList.add(...t.type.split(/\s+/g).map(i=>"cm-completionIcon-"+i)),r.setAttribute("aria-hidden","true"),r},position:20}),e.push({render(t,r,i,s){let o=document.createElement("span");o.className="cm-completionLabel";let a=t.displayLabel||t.label,l=0;for(let c=0;c<s.length;){let u=s[c++],f=s[c++];u>l&&o.appendChild(document.createTextNode(a.slice(l,u)));let d=o.appendChild(document.createElement("span"));d.appendChild(document.createTextNode(a.slice(u,f))),d.className="cm-completionMatchedText",l=f}return l<a.length&&o.appendChild(document.createTextNode(a.slice(l))),o},position:50},{render(t){if(!t.detail)return null;let r=document.createElement("span");return r.className="cm-completionDetail",r.textContent=t.detail,r},position:80}),e.sort((t,r)=>t.position-r.position).map(t=>t.render)}function ip(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let i=Math.floor(e/t);return{from:i*t,to:(i+1)*t}}let r=Math.floor((n-e)/t);return{from:n-(r+1)*t,to:n-r*t}}class hD{constructor(e,t,r){this.view=e,this.stateField=t,this.applyCompletion=r,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:l=>this.placeInfo(l),key:this},this.space=null,this.currentClass="";let i=e.state.field(t),{options:s,selected:o}=i.open,a=e.state.facet(Zn);this.optionContent=dD(a),this.optionClass=a.optionClass,this.tooltipClass=a.tooltipClass,this.range=ip(s.length,o,a.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",l=>{let{options:c}=e.state.field(t).open;for(let u=l.target,f;u&&u!=this.dom;u=u.parentNode)if(u.nodeName=="LI"&&(f=/-(\d+)$/.exec(u.id))&&+f[1]<c.length){this.applyCompletion(e,c[+f[1]]),l.preventDefault();return}}),this.dom.addEventListener("focusout",l=>{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Zn).closeOnBlur&&l.relatedTarget!=e.contentDOM&&e.dispatch({effects:Ec.of(null)})}),this.showOptions(s,i.id)}mount(){this.updateSel()}showOptions(e,t){this.list&&this.list.remove(),this.list=this.dom.appendChild(this.createListBox(e,t,this.range)),this.list.addEventListener("scroll",()=>{this.info&&this.view.requestMeasure(this.placeInfoReq)})}update(e){var t;let r=e.state.field(this.stateField),i=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),r!=i){let{options:s,selected:o,disabled:a}=r.open;(!i.open||i.open.options!=s)&&(this.range=ip(s.length,o,e.state.facet(Zn).maxRenderedOptions),this.showOptions(s,r.id)),this.updateSel(),a!=((t=i.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!a)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let r of this.currentClass.split(" "))r&&this.dom.classList.remove(r);for(let r of t.split(" "))r&&this.dom.classList.add(r);this.currentClass=t}}positioned(e){this.space=e,this.info&&this.view.requestMeasure(this.placeInfoReq)}updateSel(){let e=this.view.state.field(this.stateField),t=e.open;(t.selected>-1&&t.selected<this.range.from||t.selected>=this.range.to)&&(this.range=ip(t.options.length,t.selected,this.view.state.facet(Zn).maxRenderedOptions),this.showOptions(t.options,e.id));let r=this.updateSelectedOption(t.selected);if(r){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:s}=i;if(!s)return;let o=typeof s=="string"?document.createTextNode(s):s(i);if(!o)return;"then"in o?o.then(a=>{a&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(a,i)}).catch(a=>zr(this.view.state,a,"completion info")):(this.addInfoPane(o,i),r.setAttribute("aria-describedby",this.info.id))}}addInfoPane(e,t){this.destroyInfo();let r=this.info=document.createElement("div");if(r.className="cm-tooltip cm-completionInfo",r.id="cm-completionInfo-"+Math.floor(Math.random()*65535).toString(16),e.nodeType!=null)r.appendChild(e),this.infoDestroy=null;else{let{dom:i,destroy:s}=e;r.appendChild(i),this.infoDestroy=s||null}this.dom.appendChild(r),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let r=this.list.firstChild,i=this.range.from;r;r=r.nextSibling,i++)r.nodeName!="LI"||!r.id?i--:i==e?r.hasAttribute("aria-selected")||(r.setAttribute("aria-selected","true"),t=r):r.hasAttribute("aria-selected")&&(r.removeAttribute("aria-selected"),r.removeAttribute("aria-describedby"));return t&&mD(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),r=this.info.getBoundingClientRect(),i=e.getBoundingClientRect(),s=this.space;if(!s){let o=this.dom.ownerDocument.documentElement;s={left:0,top:0,right:o.clientWidth,bottom:o.clientHeight}}return i.top>Math.min(s.bottom,t.bottom)-10||i.bottom<Math.max(s.top,t.top)+10?null:this.view.state.facet(Zn).positionInfo(this.view,t,i,r,s,this.dom)}placeInfo(e){this.info&&(e?(e.style&&(this.info.style.cssText=e.style),this.info.className="cm-tooltip cm-completionInfo "+(e.class||"")):this.info.style.cssText="top: -1e6px")}createListBox(e,t,r){const i=document.createElement("ul");i.id=t,i.setAttribute("role","listbox"),i.setAttribute("aria-expanded","true"),i.setAttribute("aria-label",this.view.state.phrase("Completions")),i.addEventListener("mousedown",o=>{o.target==i&&o.preventDefault()});let s=null;for(let o=r.from;o<r.to;o++){let{completion:a,match:l}=e[o],{section:c}=a;if(c){let d=typeof c=="string"?c:c.name;if(d!=s&&(o>r.from||r.from==0))if(s=d,typeof c!="string"&&c.header)i.appendChild(c.header(c));else{let h=i.appendChild(document.createElement("completion-section"));h.textContent=d}}const u=i.appendChild(document.createElement("li"));u.id=t+"-"+o,u.setAttribute("role","option");let f=this.optionClass(a);f&&(u.className=f);for(let d of this.optionContent){let h=d(a,this.view.state,this.view,l);h&&u.appendChild(h)}}return r.from&&i.classList.add("cm-completionListIncompleteTop"),r.to<e.length&&i.classList.add("cm-completionListIncompleteBottom"),i}destroyInfo(){this.info&&(this.infoDestroy&&this.infoDestroy(),this.info.remove(),this.info=null)}destroy(){this.destroyInfo()}}function pD(n,e){return t=>new hD(t,n,e)}function mD(n,e){let t=n.getBoundingClientRect(),r=e.getBoundingClientRect(),i=t.height/n.offsetHeight;r.top<t.top?n.scrollTop-=(t.top-r.top)/i:r.bottom>t.bottom&&(n.scrollTop+=(r.bottom-t.bottom)/i)}function _1(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function gD(n,e){let t=[],r=null,i=null,s=u=>{t.push(u);let{section:f}=u.completion;if(f){r||(r=[]);let d=typeof f=="string"?f:f.name;r.some(h=>h.name==d)||r.push(typeof f=="string"?{name:d}:f)}},o=e.facet(Zn);for(let u of n)if(u.hasResult()){let f=u.result.getMatch;if(u.result.filter===!1)for(let d of u.result.options)s(new b1(d,u.source,f?f(d):[],1e9-t.length));else{let d=e.sliceDoc(u.from,u.to),h,m=o.filterStrict?new uD(d):new cD(d);for(let p of u.result.options)if(h=m.match(p.label)){let v=p.displayLabel?f?f(p,h.matched):[]:h.matched,O=h.score+(p.boost||0);if(s(new b1(p,u.source,v,O)),typeof p.section=="object"&&p.section.rank==="dynamic"){let{name:b}=p.section;i||(i=Object.create(null)),i[b]=Math.max(O,i[b]||-1e9)}}}}if(r){let u=Object.create(null),f=0,d=(h,m)=>(h.rank==="dynamic"&&m.rank==="dynamic"?i[m.name]-i[h.name]:0)||(typeof h.rank=="number"?h.rank:1e9)-(typeof m.rank=="number"?m.rank:1e9)||(h.name<m.name?-1:1);for(let h of r.sort(d))f-=1e5,u[h.name]=f;for(let h of t){let{section:m}=h.completion;m&&(h.score+=u[typeof m=="string"?m:m.name])}}let a=[],l=null,c=o.compareCompletions;for(let u of t.sort((f,d)=>d.score-f.score||c(f.completion,d.completion))){let f=u.completion;!l||l.label!=f.label||l.detail!=f.detail||l.type!=null&&f.type!=null&&l.type!=f.type||l.apply!=f.apply||l.boost!=f.boost?a.push(u):_1(u.completion)>_1(l)&&(a[a.length-1]=u),l=u.completion}return a}class Ta{constructor(e,t,r,i,s,o){this.options=e,this.attrs=t,this.tooltip=r,this.timestamp=i,this.selected=s,this.disabled=o}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Ta(this.options,k1(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,r,i,s,o){if(i&&!o&&e.some(c=>c.isPending))return i.setDisabled();let a=gD(e,t);if(!a.length)return i&&e.some(c=>c.isPending)?i.setDisabled():null;let l=t.facet(Zn).selectOnOpen?0:-1;if(i&&i.selected!=l&&i.selected!=-1){let c=i.options[i.selected].completion;for(let u=0;u<a.length;u++)if(a[u].completion==c){l=u;break}}return new Ta(a,k1(r,l),{pos:e.reduce((c,u)=>u.hasResult()?Math.min(c,u.from):c,1e8),create:_D,above:s.aboveCursor},i?i.timestamp:Date.now(),l,!1)}map(e){return new Ta(this.options,this.attrs,{...this.tooltip,pos:e.mapPos(this.tooltip.pos)},this.timestamp,this.selected,this.disabled)}setDisabled(){return new Ta(this.options,this.attrs,this.tooltip,this.timestamp,this.selected,!0)}}class rd{constructor(e,t,r){this.active=e,this.id=t,this.open=r}static start(){return new rd(yD,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,r=t.facet(Zn),s=(r.override||t.languageDataAt("autocomplete",Io(t)).map(lD)).map(l=>(this.active.find(u=>u.source==l)||new ni(l,this.active.some(u=>u.state!=0)?1:0)).update(e,r));s.length==this.active.length&&s.every((l,c)=>l==this.active[c])&&(s=this.active);let o=this.open,a=e.effects.some(l=>l.is(mO));o&&e.docChanged&&(o=o.map(e.changes)),e.selection||s.some(l=>l.hasResult()&&e.changes.touchesRange(l.from,l.to))||!vD(s,this.active)||a?o=Ta.build(s,t,this.id,o,r,a):o&&o.disabled&&!s.some(l=>l.isPending)&&(o=null),!o&&s.every(l=>!l.isPending)&&s.some(l=>l.hasResult())&&(s=s.map(l=>l.hasResult()?new ni(l.source,0):l));for(let l of e.effects)l.is(OS)&&(o=o&&o.setSelected(l.value,this.id));return s==this.active&&o==this.open?this:new rd(s,this.id,o)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:this.active.length?OD:bD}}function vD(n,e){if(n==e)return!0;for(let t=0,r=0;;){for(;t<n.length&&!n[t].hasResult();)t++;for(;r<e.length&&!e[r].hasResult();)r++;let i=t==n.length,s=r==e.length;if(i||s)return i==s;if(n[t++].result!=e[r++].result)return!1}}const OD={"aria-autocomplete":"list"},bD={};function k1(n,e){let t={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":n};return e>-1&&(t["aria-activedescendant"]=n+"-"+e),t}const yD=[];function vS(n,e){if(n.isUserEvent("input.complete")){let r=n.annotation(pO);if(r&&e.activateOnCompletion(r))return 12}let t=n.isUserEvent("input.type");return t&&e.activateOnTyping?5:t?1:n.isUserEvent("delete.backward")?2:n.selection?8:n.docChanged?16:0}class ni{constructor(e,t,r=!1){this.source=e,this.state=t,this.explicit=r}hasResult(){return!1}get isPending(){return this.state==1}update(e,t){let r=vS(e,t),i=this;(r&8||r&16&&this.touches(e))&&(i=new ni(i.source,0)),r&4&&i.state==0&&(i=new ni(this.source,1)),i=i.updateFor(e,r);for(let s of e.effects)if(s.is(nd))i=new ni(i.source,1,s.value);else if(s.is(Ec))i=new ni(i.source,0);else if(s.is(mO))for(let o of s.value)o.source==i.source&&(i=o);return i}updateFor(e,t){return this.map(e.changes)}map(e){return this}touches(e){return e.changes.touchesRange(Io(e.state))}}class Na extends ni{constructor(e,t,r,i,s,o){super(e,3,t),this.limit=r,this.result=i,this.from=s,this.to=o}hasResult(){return!0}updateFor(e,t){var r;if(!(t&3))return this.map(e.changes);let i=this.result;i.map&&!e.changes.empty&&(i=i.map(i,e.changes));let s=e.changes.mapPos(this.from),o=e.changes.mapPos(this.to,1),a=Io(e.state);if(a>o||!i||t&2&&(Io(e.startState)==this.from||a<this.limit))return new ni(this.source,t&4?1:0);let l=e.changes.mapPos(this.limit);return wD(i.validFor,e.state,s,o)?new Na(this.source,this.explicit,l,i,s,o):i.update&&(i=i.update(i,s,o,new hO(e.state,a,!1)))?new Na(this.source,this.explicit,l,i,i.from,(r=i.to)!==null&&r!==void 0?r:Io(e.state)):new ni(this.source,1,this.explicit)}map(e){return e.empty?this:(this.result.map?this.result.map(this.result,e):this.result)?new Na(this.source,this.explicit,e.mapPos(this.limit),this.result,e.mapPos(this.from),e.mapPos(this.to,1)):new ni(this.source,0)}touches(e){return e.changes.touchesRange(this.from,this.to)}}function wD(n,e,t,r){if(!n)return!1;let i=e.sliceDoc(t,r);return typeof n=="function"?n(i,t,r,e):gS(n,!0).test(i)}const mO=Qt.define({map(n,e){return n.map(t=>t.map(e))}}),OS=Qt.define(),Sr=ui.define({create(){return rd.start()},update(n,e){return n.update(e)},provide:n=>[ax.from(n,e=>e.tooltip),Pe.contentAttributes.from(n,e=>e.attrs)]});function gO(n,e){const t=e.completion.apply||e.completion.label;let r=n.state.field(Sr).active.find(i=>i.source==e.source);return r instanceof Na?(typeof t=="string"?n.dispatch({...aD(n.state,t,r.from,r.to),annotations:pO.of(e.completion)}):t(n,e.completion,r.from,r.to),!0):!1}const _D=pD(Sr,gO);function ju(n,e="option"){return t=>{let r=t.state.field(Sr,!1);if(!r||!r.open||r.open.disabled||Date.now()-r.open.timestamp<t.state.facet(Zn).interactionDelay)return!1;let i=1,s;e=="page"&&(s=lx(t,r.open.tooltip))&&(i=Math.max(2,Math.floor(s.dom.offsetHeight/s.dom.querySelector("li").offsetHeight)-1));let{length:o}=r.open.options,a=r.open.selected>-1?r.open.selected+i*(n?1:-1):n?0:o-1;return a<0?a=e=="page"?0:o-1:a>=o&&(a=e=="page"?o-1:0),t.dispatch({effects:OS.of(a)}),!0}}const kD=n=>{let e=n.state.field(Sr,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestamp<n.state.facet(Zn).interactionDelay?!1:gO(n,e.open.options[e.open.selected])},uc=n=>n.state.field(Sr,!1)?(n.dispatch({effects:nd.of(!0)}),!0):!1,xD=n=>{let e=n.state.field(Sr,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:Ec.of(null)}),!0)};class SD{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const AD=50,CD=1e3,TD=pr.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.pendingStart=!1,this.composing=0;for(let e of n.state.field(Sr).active)e.isPending&&this.startQuery(e)}update(n){let e=n.state.field(Sr),t=n.state.facet(Zn);if(!n.selectionSet&&!n.docChanged&&n.startState.field(Sr)==e)return;let r=n.transactions.some(s=>{let o=vS(s,t);return o&8||(s.selection||s.docChanged)&&!(o&3)});for(let s=0;s<this.running.length;s++){let o=this.running[s];if(r||o.context.abortOnDocChange&&n.docChanged||o.updates.length+n.transactions.length>AD&&Date.now()-o.time>CD){for(let a of o.context.abortListeners)try{a()}catch(l){zr(this.view.state,l)}o.context.abortListeners=null,this.running.splice(s--,1)}else o.updates.push(...n.transactions)}this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),n.transactions.some(s=>s.effects.some(o=>o.is(nd)))&&(this.pendingStart=!0);let i=this.pendingStart?50:t.activateOnTypingDelay;if(this.debounceUpdate=e.active.some(s=>s.isPending&&!this.running.some(o=>o.active.source==s.source))?setTimeout(()=>this.startUpdate(),i):-1,this.composing!=0)for(let s of n.transactions)s.isUserEvent("input.type")?this.composing=2:this.composing==2&&s.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1,this.pendingStart=!1;let{state:n}=this.view,e=n.field(Sr);for(let t of e.active)t.isPending&&!this.running.some(r=>r.active.source==t.source)&&this.startQuery(t);this.running.length&&e.open&&e.open.disabled&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Zn).updateSyncTime))}startQuery(n){let{state:e}=this.view,t=Io(e),r=new hO(e,t,n.explicit,this.view),i=new SD(n,r);this.running.push(i),Promise.resolve(n.source(r)).then(s=>{i.context.aborted||(i.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:Ec.of(null)}),zr(this.view.state,s)})}scheduleAccept(){this.running.every(n=>n.done!==void 0)?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout(()=>this.accept(),this.view.state.facet(Zn).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Zn),r=this.view.state.field(Sr);for(let i=0;i<this.running.length;i++){let s=this.running[i];if(s.done===void 0)continue;if(this.running.splice(i--,1),s.done){let a=Io(s.updates.length?s.updates[0].startState:this.view.state),l=Math.min(a,s.done.from+(s.active.explicit?0:1)),c=new Na(s.active.source,s.active.explicit,l,s.done,s.done.from,(n=s.done.to)!==null&&n!==void 0?n:a);for(let u of s.updates)c=c.update(u,t);if(c.hasResult()){e.push(c);continue}}let o=r.active.find(a=>a.source==s.active.source);if(o&&o.isPending)if(s.done==null){let a=new ni(s.active.source,0);for(let l of s.updates)a=a.update(l,t);a.isPending||e.push(a)}else this.startQuery(o)}(e.length||r.open&&r.open.disabled)&&this.view.dispatch({effects:mO.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(Sr,!1);if(e&&e.tooltip&&this.view.state.facet(Zn).closeOnBlur){let t=e.open&&lx(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&setTimeout(()=>this.view.dispatch({effects:Ec.of(null)}),10)}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:nd.of(!1)}),20),this.composing=0}}}),PD=typeof navigator=="object"&&/Win/.test(navigator.platform),ED=co.highest(Pe.domEventHandlers({keydown(n,e){let t=e.state.field(Sr,!1);if(!t||!t.open||t.open.disabled||t.open.selected<0||n.key.length>1||n.ctrlKey&&!(PD&&n.altKey)||n.metaKey)return!1;let r=t.open.options[t.open.selected],i=t.active.find(o=>o.source==r.source),s=r.completion.commitCharacters||i.result.commitCharacters;return s&&s.indexOf(n.key)>-1&&gO(e,r),!1}})),bS=Pe.baseTheme({".cm-tooltip.cm-tooltip-autocomplete":{"& > ul":{fontFamily:"monospace",whiteSpace:"nowrap",overflow:"hidden auto",maxWidth_fallback:"700px",maxWidth:"min(700px, 95vw)",minWidth:"250px",maxHeight:"10em",height:"100%",listStyle:"none",margin:0,padding:0,"& > li, & > completion-section":{padding:"1px 3px",lineHeight:1.2},"& > li":{overflowX:"hidden",textOverflow:"ellipsis",cursor:"pointer"},"& > completion-section":{display:"list-item",borderBottom:"1px solid silver",paddingLeft:"0.5em",opacity:.7}}},"&light .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#17c",color:"white"},"&light .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#777"},"&dark .cm-tooltip-autocomplete ul li[aria-selected]":{background:"#347",color:"white"},"&dark .cm-tooltip-autocomplete-disabled ul li[aria-selected]":{background:"#444"},".cm-completionListIncompleteTop:before, .cm-completionListIncompleteBottom:after":{content:'"···"',opacity:.5,display:"block",textAlign:"center"},".cm-tooltip.cm-completionInfo":{position:"absolute",padding:"3px 9px",width:"max-content",maxWidth:"400px",boxSizing:"border-box",whiteSpace:"pre-line"},".cm-completionInfo.cm-completionInfo-left":{right:"100%"},".cm-completionInfo.cm-completionInfo-right":{left:"100%"},".cm-completionInfo.cm-completionInfo-left-narrow":{right:"30px"},".cm-completionInfo.cm-completionInfo-right-narrow":{left:"30px"},"&light .cm-snippetField":{backgroundColor:"#00000022"},"&dark .cm-snippetField":{backgroundColor:"#ffffff22"},".cm-snippetFieldPosition":{verticalAlign:"text-top",width:0,height:"1.15em",display:"inline-block",margin:"0 -0.7px -.7em",borderLeft:"1.4px dotted #888"},".cm-completionMatchedText":{textDecoration:"underline"},".cm-completionDetail":{marginLeft:"0.5em",fontStyle:"italic"},".cm-completionIcon":{fontSize:"90%",width:".8em",display:"inline-block",textAlign:"center",paddingRight:".6em",opacity:"0.6",boxSizing:"content-box"},".cm-completionIcon-function, .cm-completionIcon-method":{"&:after":{content:"'ƒ'"}},".cm-completionIcon-class":{"&:after":{content:"'○'"}},".cm-completionIcon-interface":{"&:after":{content:"'◌'"}},".cm-completionIcon-variable":{"&:after":{content:"'𝑥'"}},".cm-completionIcon-constant":{"&:after":{content:"'𝐶'"}},".cm-completionIcon-type":{"&:after":{content:"'𝑡'"}},".cm-completionIcon-enum":{"&:after":{content:"'∪'"}},".cm-completionIcon-property":{"&:after":{content:"'□'"}},".cm-completionIcon-keyword":{"&:after":{content:"'🔑︎'"}},".cm-completionIcon-namespace":{"&:after":{content:"'▢'"}},".cm-completionIcon-text":{"&:after":{content:"'abc'",fontSize:"50%",verticalAlign:"middle"}}});class $D{constructor(e,t,r,i){this.field=e,this.line=t,this.from=r,this.to=i}}class vO{constructor(e,t,r){this.field=e,this.from=t,this.to=r}map(e){let t=e.mapPos(this.from,-1,fr.TrackDel),r=e.mapPos(this.to,1,fr.TrackDel);return t==null||r==null?null:new vO(this.field,t,r)}}class OO{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let r=[],i=[t],s=e.doc.lineAt(t),o=/^\s*/.exec(s.text)[0];for(let l of this.lines){if(r.length){let c=o,u=/^\t*/.exec(l)[0].length;for(let f=0;f<u;f++)c+=e.facet(cu);i.push(t+c.length-u),l=c+l.slice(u)}r.push(l),t+=l.length+1}let a=this.fieldPositions.map(l=>new vO(l.field,i[l.line]+l.from,i[l.line]+l.to));return{text:r,ranges:a}}static parse(e){let t=[],r=[],i=[],s;for(let o of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^{}]*))?|((?:\\[{}]|[^{}])*))\}/.exec(o);){let a=s[1]?+s[1]:null,l=s[2]||s[3]||"",c=-1,u=l.replace(/\\[{}]/g,f=>f[1]);for(let f=0;f<t.length;f++)(a!=null?t[f].seq==a:u&&t[f].name==u)&&(c=f);if(c<0){let f=0;for(;f<t.length&&(a==null||t[f].seq!=null&&t[f].seq<a);)f++;t.splice(f,0,{seq:a,name:u}),c=f;for(let d of i)d.field>=c&&d.field++}for(let f of i)if(f.line==r.length&&f.from>s.index){let d=s[2]?3+(s[1]||"").length:2;f.from-=d,f.to-=d}i.push(new $D(c,r.length,s.index,s.index+u.length)),o=o.slice(0,s.index)+l+o.slice(s.index+s[0].length)}o=o.replace(/\\([{}])/g,(a,l,c)=>{for(let u of i)u.line==r.length&&u.from>c&&(u.from--,u.to--);return l}),r.push(o)}return new OO(r,i)}}let QD=ft.widget({widget:new class extends su{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),LD=ft.mark({class:"cm-snippetField"});class _l{constructor(e,t){this.ranges=e,this.active=t,this.deco=ft.set(e.map(r=>(r.from==r.to?QD:LD).range(r.from,r.to)),!0)}map(e){let t=[];for(let r of this.ranges){let i=r.map(e);if(!i)return null;t.push(i)}return new _l(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(r=>r.field==this.active&&r.from<=t.from&&r.to>=t.to))}}const du=Qt.define({map(n,e){return n&&n.map(e)}}),MD=Qt.define(),$c=ui.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(du))return t.value;if(t.is(MD)&&n)return new _l(n.ranges,t.value)}return n&&e.docChanged&&(n=n.map(e.changes)),n&&e.selection&&!n.selectionInsideField(e.selection)&&(n=null),n},provide:n=>Pe.decorations.from(n,e=>e?e.deco:ft.none)});function bO(n,e){return me.create(n.filter(t=>t.field==e).map(t=>me.range(t.from,t.to)))}function qD(n){let e=OO.parse(n);return(t,r,i,s)=>{let{text:o,ranges:a}=e.instantiate(t.state,i),{main:l}=t.state.selection,c={changes:{from:i,to:s==l.from?l.to:s,insert:Nt.of(o)},scrollIntoView:!0,annotations:r?[pO.of(r),En.userEvent.of("input.complete")]:void 0};if(a.length&&(c.selection=bO(a,0)),a.some(u=>u.field>0)){let u=new _l(a,0),f=c.effects=[du.of(u)];t.state.field($c,!1)===void 0&&f.push(Qt.appendConfig.of([$c,BD,jD,bS]))}t.dispatch(t.state.update(c))}}function yS(n){return({state:e,dispatch:t})=>{let r=e.field($c,!1);if(!r||n<0&&r.active==0)return!1;let i=r.active+n,s=n>0&&!r.ranges.some(o=>o.field==i+n);return t(e.update({selection:bO(r.ranges,i),effects:du.of(s?null:new _l(r.ranges,i)),scrollIntoView:!0})),!0}}const RD=({state:n,dispatch:e})=>n.field($c,!1)?(e(n.update({effects:du.of(null)})),!0):!1,DD=yS(1),ID=yS(-1),ND=[{key:"Tab",run:DD,shift:ID},{key:"Escape",run:RD}],x1=Ie.define({combine(n){return n.length?n[0]:ND}}),BD=co.highest(na.compute([x1],n=>n.facet(x1)));function yr(n,e){return{...e,apply:qD(n)}}const jD=Pe.domEventHandlers({mousedown(n,e){let t=e.state.field($c,!1),r;if(!t||(r=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let i=t.ranges.find(s=>s.from<=r&&s.to>=r);return!i||i.field==t.active?!1:(e.dispatch({selection:bO(t.ranges,i.field),effects:du.of(t.ranges.some(s=>s.field>i.field)?new _l(t.ranges,i.field):null),scrollIntoView:!0}),!0)}}),wS=new class extends eo{};wS.startSide=1;wS.endSide=-1;function ig(n={}){return[ED,Sr,Zn.of(n),TD,ZD,bS]}const zD=[{key:"Ctrl-Space",run:uc},{mac:"Alt-`",run:uc},{mac:"Alt-i",run:uc},{key:"Escape",run:xD},{key:"ArrowDown",run:ju(!0)},{key:"ArrowUp",run:ju(!1)},{key:"PageDown",run:ju(!0,"page")},{key:"PageUp",run:ju(!1,"page")},{key:"Enter",run:kD}],ZD=co.highest(na.computeN([Zn],n=>n.facet(Zn).defaultKeymap?[zD]:[]));class id{static create(e,t,r,i,s){let o=i+(i<<8)+e+(t<<4)|0;return new id(e,t,r,o,s,[],[])}constructor(e,t,r,i,s,o,a){this.type=e,this.value=t,this.from=r,this.hash=i,this.end=s,this.children=o,this.positions=a,this.hashProp=[[et.contextHash,i]]}addChild(e,t){e.prop(et.contextHash)!=this.hash&&(e=new mt(e.type,e.children,e.positions,e.length,this.hashProp)),this.children.push(e),this.positions.push(t)}toTree(e,t=this.end){let r=this.children.length-1;return r>=0&&(t=Math.max(t,this.positions[r]+this.children[r].length+this.from)),new mt(e.types[this.type],this.children,this.positions,t-this.from).balance({makeTree:(i,s,o)=>new mt(Ln.none,i,s,o,this.hashProp)})}}var we;(function(n){n[n.Document=1]="Document",n[n.CodeBlock=2]="CodeBlock",n[n.FencedCode=3]="FencedCode",n[n.Blockquote=4]="Blockquote",n[n.HorizontalRule=5]="HorizontalRule",n[n.BulletList=6]="BulletList",n[n.OrderedList=7]="OrderedList",n[n.ListItem=8]="ListItem",n[n.ATXHeading1=9]="ATXHeading1",n[n.ATXHeading2=10]="ATXHeading2",n[n.ATXHeading3=11]="ATXHeading3",n[n.ATXHeading4=12]="ATXHeading4",n[n.ATXHeading5=13]="ATXHeading5",n[n.ATXHeading6=14]="ATXHeading6",n[n.SetextHeading1=15]="SetextHeading1",n[n.SetextHeading2=16]="SetextHeading2",n[n.HTMLBlock=17]="HTMLBlock",n[n.LinkReference=18]="LinkReference",n[n.Paragraph=19]="Paragraph",n[n.CommentBlock=20]="CommentBlock",n[n.ProcessingInstructionBlock=21]="ProcessingInstructionBlock",n[n.Escape=22]="Escape",n[n.Entity=23]="Entity",n[n.HardBreak=24]="HardBreak",n[n.Emphasis=25]="Emphasis",n[n.StrongEmphasis=26]="StrongEmphasis",n[n.Link=27]="Link",n[n.Image=28]="Image",n[n.InlineCode=29]="InlineCode",n[n.HTMLTag=30]="HTMLTag",n[n.Comment=31]="Comment",n[n.ProcessingInstruction=32]="ProcessingInstruction",n[n.Autolink=33]="Autolink",n[n.HeaderMark=34]="HeaderMark",n[n.QuoteMark=35]="QuoteMark",n[n.ListMark=36]="ListMark",n[n.LinkMark=37]="LinkMark",n[n.EmphasisMark=38]="EmphasisMark",n[n.CodeMark=39]="CodeMark",n[n.CodeText=40]="CodeText",n[n.CodeInfo=41]="CodeInfo",n[n.LinkTitle=42]="LinkTitle",n[n.LinkLabel=43]="LinkLabel",n[n.URL=44]="URL"})(we||(we={}));class FD{constructor(e,t){this.start=e,this.content=t,this.marks=[],this.parsers=[]}}class XD{constructor(){this.text="",this.baseIndent=0,this.basePos=0,this.depth=0,this.markers=[],this.pos=0,this.indent=0,this.next=-1}forward(){this.basePos>this.pos&&this.forwardInner()}forwardInner(){let e=this.skipSpace(this.basePos);this.indent=this.countIndent(e,this.pos,this.indent),this.pos=e,this.next=e==this.text.length?-1:this.text.charCodeAt(e)}skipSpace(e){return fc(this.text,e)}reset(e){for(this.text=e,this.baseIndent=this.basePos=this.pos=this.indent=0,this.forwardInner(),this.depth=1;this.markers.length;)this.markers.pop()}moveBase(e){this.basePos=e,this.baseIndent=this.countIndent(e,this.pos,this.indent)}moveBaseColumn(e){this.baseIndent=e,this.basePos=this.findColumn(e)}addMarker(e){this.markers.push(e)}countIndent(e,t=0,r=0){for(let i=t;i<e;i++)r+=this.text.charCodeAt(i)==9?4-r%4:1;return r}findColumn(e){let t=0;for(let r=0;t<this.text.length&&r<e;t++)r+=this.text.charCodeAt(t)==9?4-r%4:1;return t}scrub(){if(!this.baseIndent)return this.text;let e="";for(let t=0;t<this.basePos;t++)e+=" ";return e+this.text.slice(this.basePos)}}function S1(n,e,t){if(t.pos==t.text.length||n!=e.block&&t.indent>=e.stack[t.depth+1].value+t.baseIndent)return!0;if(t.indent>=t.baseIndent+4)return!1;let r=(n.type==we.OrderedList?_O:wO)(t,e,!1);return r>0&&(n.type!=we.BulletList||yO(t,e,!1)<0)&&t.text.charCodeAt(t.pos+r-1)==n.value}const _S={[we.Blockquote](n,e,t){return t.next!=62?!1:(t.markers.push(Tt(we.QuoteMark,e.lineStart+t.pos,e.lineStart+t.pos+1)),t.moveBase(t.pos+(di(t.text.charCodeAt(t.pos+1))?2:1)),n.end=e.lineStart+t.text.length,!0)},[we.ListItem](n,e,t){return t.indent<t.baseIndent+n.value&&t.next>-1?!1:(t.moveBaseColumn(t.baseIndent+n.value),!0)},[we.OrderedList]:S1,[we.BulletList]:S1,[we.Document](){return!0}};function di(n){return n==32||n==9||n==10||n==13}function fc(n,e=0){for(;e<n.length&&di(n.charCodeAt(e));)e++;return e}function A1(n,e,t){for(;e>t&&di(n.charCodeAt(e-1));)e--;return e}function kS(n){if(n.next!=96&&n.next!=126)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;if(e<n.pos+3)return-1;if(n.next==96){for(let t=e;t<n.text.length;t++)if(n.text.charCodeAt(t)==96)return-1}return e}function xS(n){return n.next!=62?-1:n.text.charCodeAt(n.pos+1)==32?2:1}function yO(n,e,t){if(n.next!=42&&n.next!=45&&n.next!=95)return-1;let r=1;for(let i=n.pos+1;i<n.text.length;i++){let s=n.text.charCodeAt(i);if(s==n.next)r++;else if(!di(s))return-1}return t&&n.next==45&&CS(n)>-1&&n.depth==e.stack.length&&e.parser.leafBlockParsers.indexOf($S.SetextHeading)>-1||r<3?-1:1}function SS(n,e){for(let t=n.stack.length-1;t>=0;t--)if(n.stack[t].type==e)return!0;return!1}function wO(n,e,t){return(n.next==45||n.next==43||n.next==42)&&(n.pos==n.text.length-1||di(n.text.charCodeAt(n.pos+1)))&&(!t||SS(e,we.BulletList)||n.skipSpace(n.pos+2)<n.text.length)?1:-1}function _O(n,e,t){let r=n.pos,i=n.next;for(;i>=48&&i<=57;){r++;if(r==n.text.length)return-1;i=n.text.charCodeAt(r)}return r==n.pos||r>n.pos+9||i!=46&&i!=41||r<n.text.length-1&&!di(n.text.charCodeAt(r+1))||t&&!SS(e,we.OrderedList)&&(n.skipSpace(r+1)==n.text.length||r>n.pos+1||n.next!=49)?-1:r+1-n.pos}function AS(n){if(n.next!=35)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==35;)e++;if(e<n.text.length&&n.text.charCodeAt(e)!=32)return-1;let t=e-n.pos;return t>6?-1:t}function CS(n){if(n.next!=45&&n.next!=61||n.indent>=n.baseIndent+4)return-1;let e=n.pos+1;for(;e<n.text.length&&n.text.charCodeAt(e)==n.next;)e++;let t=e;for(;e<n.text.length&&di(n.text.charCodeAt(e));)e++;return e==n.text.length?t:-1}const sg=/^[ \t]*$/,TS=/-->/,PS=/\?>/,og=[[/^<(?:script|pre|style)(?:\s|>|$)/i,/<\/(?:script|pre|style)>/i],[/^\s*<!--/,TS],[/^\s*<\?/,PS],[/^\s*<![A-Z]/,/>/],[/^\s*<!\[CDATA\[/,/\]\]>/],[/^\s*<\/?(?:address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h1|h2|h3|h4|h5|h6|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul)(?:\s|\/?>|$)/i,sg],[/^\s*(?:<\/[a-z][\w-]*\s*>|<[a-z][\w-]*(\s+[a-z:_][\w-.]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*>)\s*$/i,sg]];function ES(n,e,t){if(n.next!=60)return-1;let r=n.text.slice(n.pos);for(let i=0,s=og.length-(t?1:0);i<s;i++)if(og[i][0].test(r))return i;return-1}function C1(n,e){let t=n.countIndent(e,n.pos,n.indent),r=n.countIndent(n.skipSpace(e),e,t);return r>=t+5?t+1:r}function Ms(n,e,t){let r=n.length-1;r>=0&&n[r].to==e&&n[r].type==we.CodeText?n[r].to=t:n.push(Tt(we.CodeText,e,t))}const zu={LinkReference:void 0,IndentedCode(n,e){let t=e.baseIndent+4;if(e.indent<t)return!1;let r=e.findColumn(t),i=n.lineStart+r,s=n.lineStart+e.text.length,o=[],a=[];for(Ms(o,i,s);n.nextLine()&&e.depth>=n.stack.length;)if(e.pos==e.text.length){Ms(a,n.lineStart-1,n.lineStart);for(let l of e.markers)a.push(l)}else{if(e.indent<t)break;{if(a.length){for(let c of a)c.type==we.CodeText?Ms(o,c.from,c.to):o.push(c);a=[]}Ms(o,n.lineStart-1,n.lineStart);for(let c of e.markers)o.push(c);s=n.lineStart+e.text.length;let l=n.lineStart+e.findColumn(e.baseIndent+4);l<s&&Ms(o,l,s)}}return a.length&&(a=a.filter(l=>l.type!=we.CodeText),a.length&&(e.markers=a.concat(e.markers))),n.addNode(n.buffer.writeElements(o,-i).finish(we.CodeBlock,s-i),i),!0},FencedCode(n,e){let t=kS(e);if(t<0)return!1;let r=n.lineStart+e.pos,i=e.next,s=t-e.pos,o=e.skipSpace(t),a=A1(e.text,e.text.length,o),l=[Tt(we.CodeMark,r,r+s)];o<a&&l.push(Tt(we.CodeInfo,n.lineStart+o,n.lineStart+a));for(let c=!0,u=!0,f=!1;n.nextLine()&&e.depth>=n.stack.length;c=!1){let d=e.pos;if(e.indent-e.baseIndent<4)for(;d<e.text.length&&e.text.charCodeAt(d)==i;)d++;if(d-e.pos>=s&&e.skipSpace(d)==e.text.length){for(let h of e.markers)l.push(h);u&&f&&Ms(l,n.lineStart-1,n.lineStart),l.push(Tt(we.CodeMark,n.lineStart+e.pos,n.lineStart+d)),n.nextLine();break}else{f=!0,c||(Ms(l,n.lineStart-1,n.lineStart),u=!1);for(let p of e.markers)l.push(p);let h=n.lineStart+e.basePos,m=n.lineStart+e.text.length;h<m&&(Ms(l,h,m),u=!1)}}return n.addNode(n.buffer.writeElements(l,-r).finish(we.FencedCode,n.prevLineEnd()-r),r),!0},Blockquote(n,e){let t=xS(e);return t<0?!1:(n.startContext(we.Blockquote,e.pos),n.addNode(we.QuoteMark,n.lineStart+e.pos,n.lineStart+e.pos+1),e.moveBase(e.pos+t),null)},HorizontalRule(n,e){if(yO(e,n,!1)<0)return!1;let t=n.lineStart+e.pos;return n.nextLine(),n.addNode(we.HorizontalRule,t),!0},BulletList(n,e){let t=wO(e,n,!1);if(t<0)return!1;n.block.type!=we.BulletList&&n.startContext(we.BulletList,e.basePos,e.next);let r=C1(e,e.pos+1);return n.startContext(we.ListItem,e.basePos,r-e.baseIndent),n.addNode(we.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},OrderedList(n,e){let t=_O(e,n,!1);if(t<0)return!1;n.block.type!=we.OrderedList&&n.startContext(we.OrderedList,e.basePos,e.text.charCodeAt(e.pos+t-1));let r=C1(e,e.pos+t);return n.startContext(we.ListItem,e.basePos,r-e.baseIndent),n.addNode(we.ListMark,n.lineStart+e.pos,n.lineStart+e.pos+t),e.moveBaseColumn(r),null},ATXHeading(n,e){let t=AS(e);if(t<0)return!1;let r=e.pos,i=n.lineStart+r,s=A1(e.text,e.text.length,r),o=s;for(;o>r&&e.text.charCodeAt(o-1)==e.next;)o--;(o==s||o==r||!di(e.text.charCodeAt(o-1)))&&(o=e.text.length);let a=n.buffer.write(we.HeaderMark,0,t).writeElements(n.parser.parseInline(e.text.slice(r+t+1,o),i+t+1),-i);o<e.text.length&&a.write(we.HeaderMark,o-r,s-r);let l=a.finish(we.ATXHeading1-1+t,e.text.length-r);return n.nextLine(),n.addNode(l,i),!0},HTMLBlock(n,e){let t=ES(e,n,!1);if(t<0)return!1;let r=n.lineStart+e.pos,i=og[t][1],s=[],o=i!=sg;for(;!i.test(e.text)&&n.nextLine();){if(e.depth<n.stack.length){o=!1;break}for(let c of e.markers)s.push(c)}o&&n.nextLine();let a=i==TS?we.CommentBlock:i==PS?we.ProcessingInstructionBlock:we.HTMLBlock,l=n.prevLineEnd();return n.addNode(n.buffer.writeElements(s,-r).finish(a,l-r),r),!0},SetextHeading:void 0};class VD{constructor(e){this.stage=0,this.elts=[],this.pos=0,this.start=e.start,this.advance(e.content)}nextLine(e,t,r){if(this.stage==-1)return!1;let i=r.content+`
|
|
156
|
-
`+t.scrub(),s=this.advance(i);return s>-1&&s<i.length?this.complete(e,r,s):!1}finish(e,t){return(this.stage==2||this.stage==3)&&fc(t.content,this.pos)==t.content.length?this.complete(e,t,t.content.length):!1}complete(e,t,r){return e.addLeafElement(t,Tt(we.LinkReference,this.start,this.start+r,this.elts)),!0}nextStage(e){return e?(this.pos=e.to-this.start,this.elts.push(e),this.stage++,!0):(e===!1&&(this.stage=-1),!1)}advance(e){for(;;){if(this.stage==-1)return-1;if(this.stage==0){if(!this.nextStage(BS(e,this.pos,this.start,!0)))return-1;if(e.charCodeAt(this.pos)!=58)return this.stage=-1;this.elts.push(Tt(we.LinkMark,this.pos+this.start,this.pos+this.start+1)),this.pos++}else if(this.stage==1){if(!this.nextStage(IS(e,fc(e,this.pos),this.start)))return-1}else if(this.stage==2){let t=fc(e,this.pos),r=0;if(t>this.pos){let i=NS(e,t,this.start);if(i){let s=sp(e,i.to-this.start);s>0&&(this.nextStage(i),r=s)}}return r||(r=sp(e,this.pos)),r>0&&r<e.length?r:-1}else return sp(e,this.pos)}}}function sp(n,e){for(;e<n.length;e++){let t=n.charCodeAt(e);if(t==10)break;if(!di(t))return-1}return e}class WD{nextLine(e,t,r){let i=t.depth<e.stack.length?-1:CS(t),s=t.next;if(i<0)return!1;let o=Tt(we.HeaderMark,e.lineStart+t.pos,e.lineStart+i);return e.nextLine(),e.addLeafElement(r,Tt(s==61?we.SetextHeading1:we.SetextHeading2,r.start,e.prevLineEnd(),[...e.parser.parseInline(r.content,r.start),o])),!0}finish(){return!1}}const $S={LinkReference(n,e){return e.content.charCodeAt(0)==91?new VD(e):null},SetextHeading(){return new WD}},YD=[(n,e)=>AS(e)>=0,(n,e)=>kS(e)>=0,(n,e)=>xS(e)>=0,(n,e)=>wO(e,n,!0)>=0,(n,e)=>_O(e,n,!0)>=0,(n,e)=>yO(e,n,!0)>=0,(n,e)=>ES(e,n,!0)>=0],UD={text:"",end:0};class GD{constructor(e,t,r,i){this.parser=e,this.input=t,this.ranges=i,this.line=new XD,this.atEnd=!1,this.reusePlaceholders=new Map,this.stoppedAt=null,this.rangeI=0,this.to=i[i.length-1].to,this.lineStart=this.absoluteLineStart=this.absoluteLineEnd=i[0].from,this.block=id.create(we.Document,0,this.lineStart,0,0),this.stack=[this.block],this.fragments=r.length?new JD(r,t):null,this.readLine()}get parsedPos(){return this.absoluteLineStart}advance(){if(this.stoppedAt!=null&&this.absoluteLineStart>this.stoppedAt)return this.finish();let{line:e}=this;for(;;){for(let r=0;;){let i=e.depth<this.stack.length?this.stack[this.stack.length-1]:null;for(;r<e.markers.length&&(!i||e.markers[r].from<i.end);){let s=e.markers[r++];this.addNode(s.type,s.from,s.to)}if(!i)break;this.finishContext()}if(e.pos<e.text.length)break;if(!this.nextLine())return this.finish()}if(this.fragments&&this.reuseFragment(e.basePos))return null;e:for(;;){for(let r of this.parser.blockParsers)if(r){let i=r(this,e);if(i!=!1){if(i==!0)return null;e.forward();continue e}}break}let t=new FD(this.lineStart+e.pos,e.text.slice(e.pos));for(let r of this.parser.leafBlockParsers)if(r){let i=r(this,t);i&&t.parsers.push(i)}e:for(;this.nextLine()&&e.pos!=e.text.length;){if(e.indent<e.baseIndent+4){for(let r of this.parser.endLeafBlock)if(r(this,e,t))break e}for(let r of t.parsers)if(r.nextLine(this,e,t))return null;t.content+=`
|
|
157
|
-
`+e.scrub();for(let r of e.markers)t.marks.push(r)}return this.finishLeaf(t),null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}reuseFragment(e){if(!this.fragments.moveTo(this.absoluteLineStart+e,this.absoluteLineStart)||!this.fragments.matches(this.block.hash))return!1;let t=this.fragments.takeNodes(this);return t?(this.absoluteLineStart+=t,this.lineStart=jS(this.absoluteLineStart,this.ranges),this.moveRangeI(),this.absoluteLineStart<this.to?(this.lineStart++,this.absoluteLineStart++,this.readLine()):(this.atEnd=!0,this.readLine()),!0):!1}get depth(){return this.stack.length}parentType(e=this.depth-1){return this.parser.nodeSet.types[this.stack[e].type]}nextLine(){return this.lineStart+=this.line.text.length,this.absoluteLineEnd>=this.to?(this.absoluteLineStart=this.absoluteLineEnd,this.atEnd=!0,this.readLine(),!1):(this.lineStart++,this.absoluteLineStart=this.absoluteLineEnd+1,this.moveRangeI(),this.readLine(),!0)}peekLine(){return this.scanLine(this.absoluteLineEnd+1).text}moveRangeI(){for(;this.rangeI<this.ranges.length-1&&this.absoluteLineStart>=this.ranges[this.rangeI].to;)this.rangeI++,this.absoluteLineStart=Math.max(this.absoluteLineStart,this.ranges[this.rangeI].from)}scanLine(e){let t=UD;if(t.end=e,e>=this.to)t.text="";else if(t.text=this.lineChunkAt(e),t.end+=t.text.length,this.ranges.length>1){let r=this.absoluteLineStart,i=this.rangeI;for(;this.ranges[i].to<t.end;){i++;let s=this.ranges[i].from,o=this.lineChunkAt(s);t.end=s+o.length,t.text=t.text.slice(0,this.ranges[i-1].to-r)+o,r=t.end-t.text.length}}return t}readLine(){let{line:e}=this,{text:t,end:r}=this.scanLine(this.absoluteLineStart);for(this.absoluteLineEnd=r,e.reset(t);e.depth<this.stack.length;e.depth++){let i=this.stack[e.depth],s=this.parser.skipContextMarkup[i.type];if(!s)throw new Error("Unhandled block context "+we[i.type]);let o=this.line.markers.length;if(!s(i,this,e)){this.line.markers.length>o&&(i.end=this.line.markers[this.line.markers.length-1].to),e.forward();break}e.forward()}}lineChunkAt(e){let t=this.input.chunk(e),r;if(this.input.lineChunks)r=t==`
|
|
158
|
-
`?"":t;else{let i=t.indexOf(`
|
|
159
|
-
`);r=i<0?t:t.slice(0,i)}return e+r.length>this.to?r.slice(0,this.to-e):r}prevLineEnd(){return this.atEnd?this.lineStart:this.lineStart-1}startContext(e,t,r=0){this.block=id.create(e,r,this.lineStart+t,this.block.hash,this.lineStart+this.line.text.length),this.stack.push(this.block)}startComposite(e,t,r=0){this.startContext(this.parser.getNodeType(e),t,r)}addNode(e,t,r){typeof e=="number"&&(e=new mt(this.parser.nodeSet.types[e],rl,rl,(r??this.prevLineEnd())-t)),this.block.addChild(e,t-this.block.from)}addElement(e){this.block.addChild(e.toTree(this.parser.nodeSet),e.from-this.block.from)}addLeafElement(e,t){this.addNode(this.buffer.writeElements(lg(t.children,e.marks),-t.from).finish(t.type,t.to-t.from),t.from)}finishContext(){let e=this.stack.pop(),t=this.stack[this.stack.length-1];t.addChild(e.toTree(this.parser.nodeSet),e.from-t.from),this.block=t}finish(){for(;this.stack.length>1;)this.finishContext();return this.addGaps(this.block.toTree(this.parser.nodeSet,this.lineStart))}addGaps(e){return this.ranges.length>1?QS(this.ranges,0,e.topNode,this.ranges[0].from,this.reusePlaceholders):e}finishLeaf(e){for(let r of e.parsers)if(r.finish(this,e))return;let t=lg(this.parser.parseInline(e.content,e.start),e.marks);this.addNode(this.buffer.writeElements(t,-e.start).finish(we.Paragraph,e.content.length),e.start)}elt(e,t,r,i){return typeof e=="string"?Tt(this.parser.getNodeType(e),t,r,i):new qS(e,t)}get buffer(){return new MS(this.parser.nodeSet)}}function QS(n,e,t,r,i){let s=n[e].to,o=[],a=[],l=t.from+r;function c(u,f){for(;f?u>=s:u>s;){let d=n[e+1].from-s;r+=d,u+=d,e++,s=n[e].to}}for(let u=t.firstChild;u;u=u.nextSibling){c(u.from+r,!0);let f=u.from+r,d,h=i.get(u.tree);h?d=h:u.to+r>s?(d=QS(n,e,u,r,i),c(u.to+r,!1)):d=u.toTree(),o.push(d),a.push(f-l)}return c(t.to+r,!1),new mt(t.type,o,a,t.to+r-l,t.tree?t.tree.propValues:void 0)}class ch extends nh{constructor(e,t,r,i,s,o,a,l,c){super(),this.nodeSet=e,this.blockParsers=t,this.leafBlockParsers=r,this.blockNames=i,this.endLeafBlock=s,this.skipContextMarkup=o,this.inlineParsers=a,this.inlineNames=l,this.wrappers=c,this.nodeTypes=Object.create(null);for(let u of e.types)this.nodeTypes[u.name]=u.id}createParse(e,t,r){let i=new GD(this,e,t,r);for(let s of this.wrappers)i=s(i,e,t,r);return i}configure(e){let t=ag(e);if(!t)return this;let{nodeSet:r,skipContextMarkup:i}=this,s=this.blockParsers.slice(),o=this.leafBlockParsers.slice(),a=this.blockNames.slice(),l=this.inlineParsers.slice(),c=this.inlineNames.slice(),u=this.endLeafBlock.slice(),f=this.wrappers;if(Ll(t.defineNodes)){i=Object.assign({},i);let d=r.types.slice(),h;for(let m of t.defineNodes){let{name:p,block:v,composite:O,style:b}=typeof m=="string"?{name:m}:m;if(d.some(_=>_.name==p))continue;O&&(i[d.length]=(_,x,A)=>O(x,A,_.value));let w=d.length,S=O?["Block","BlockContext"]:v?w>=we.ATXHeading1&&w<=we.SetextHeading2?["Block","LeafBlock","Heading"]:["Block","LeafBlock"]:void 0;d.push(Ln.define({id:w,name:p,props:S&&[[et.group,S]]})),b&&(h||(h={}),Array.isArray(b)||b instanceof Zi?h[p]=b:Object.assign(h,b))}r=new vl(d),h&&(r=r.extend(Ol(h)))}if(Ll(t.props)&&(r=r.extend(...t.props)),Ll(t.remove))for(let d of t.remove){let h=this.blockNames.indexOf(d),m=this.inlineNames.indexOf(d);h>-1&&(s[h]=o[h]=void 0),m>-1&&(l[m]=void 0)}if(Ll(t.parseBlock))for(let d of t.parseBlock){let h=a.indexOf(d.name);if(h>-1)s[h]=d.parse,o[h]=d.leaf;else{let m=d.before?Zu(a,d.before):d.after?Zu(a,d.after)+1:a.length-1;s.splice(m,0,d.parse),o.splice(m,0,d.leaf),a.splice(m,0,d.name)}d.endLeaf&&u.push(d.endLeaf)}if(Ll(t.parseInline))for(let d of t.parseInline){let h=c.indexOf(d.name);if(h>-1)l[h]=d.parse;else{let m=d.before?Zu(c,d.before):d.after?Zu(c,d.after)+1:c.length-1;l.splice(m,0,d.parse),c.splice(m,0,d.name)}}return t.wrap&&(f=f.concat(t.wrap)),new ch(r,s,o,a,u,i,l,c,f)}getNodeType(e){let t=this.nodeTypes[e];if(t==null)throw new RangeError(`Unknown node type '${e}'`);return t}parseInline(e,t){let r=new kO(this,e,t);e:for(let i=t;i<r.end;){let s=r.char(i);for(let o of this.inlineParsers)if(o){let a=o(r,s,i);if(a>=0){i=a;continue e}}i++}return r.resolveMarkers(0)}}function Ll(n){return n!=null&&n.length>0}function ag(n){if(!Array.isArray(n))return n;if(n.length==0)return null;let e=ag(n[0]);if(n.length==1)return e;let t=ag(n.slice(1));if(!t||!e)return e||t;let r=(o,a)=>(o||rl).concat(a||rl),i=e.wrap,s=t.wrap;return{props:r(e.props,t.props),defineNodes:r(e.defineNodes,t.defineNodes),parseBlock:r(e.parseBlock,t.parseBlock),parseInline:r(e.parseInline,t.parseInline),remove:r(e.remove,t.remove),wrap:i?s?(o,a,l,c)=>i(s(o,a,l,c),a,l,c):i:s}}function Zu(n,e){let t=n.indexOf(e);if(t<0)throw new RangeError(`Position specified relative to unknown parser ${e}`);return t}let LS=[Ln.none];for(let n=1,e;e=we[n];n++)LS[n]=Ln.define({id:n,name:e,props:n>=we.Escape?[]:[[et.group,n in _S?["Block","BlockContext"]:["Block","LeafBlock"]]],top:e=="Document"});const rl=[];class MS{constructor(e){this.nodeSet=e,this.content=[],this.nodes=[]}write(e,t,r,i=0){return this.content.push(e,t,r,4+i*4),this}writeElements(e,t=0){for(let r of e)r.writeTo(this,t);return this}finish(e,t){return mt.build({buffer:this.content,nodeSet:this.nodeSet,reused:this.nodes,topID:e,length:t})}}let Qc=class{constructor(e,t,r,i=rl){this.type=e,this.from=t,this.to=r,this.children=i}writeTo(e,t){let r=e.content.length;e.writeElements(this.children,t),e.content.push(this.type,this.from+t,this.to+t,e.content.length+4-r)}toTree(e){return new MS(e).writeElements(this.children,-this.from).finish(this.type,this.to-this.from)}};class qS{constructor(e,t){this.tree=e,this.from=t}get to(){return this.from+this.tree.length}get type(){return this.tree.type.id}get children(){return rl}writeTo(e,t){e.nodes.push(this.tree),e.content.push(e.nodes.length-1,this.from+t,this.to+t,-1)}toTree(){return this.tree}}function Tt(n,e,t,r){return new Qc(n,e,t,r)}const RS={resolve:"Emphasis",mark:"EmphasisMark"},DS={resolve:"Emphasis",mark:"EmphasisMark"},So={},sd={};class Nr{constructor(e,t,r,i){this.type=e,this.from=t,this.to=r,this.side=i}}const T1="!\"#$%&'()*+,-./:;<=>?@[\\]^_`{|}~";let Lc=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\xA1\u2010-\u2027]/;try{Lc=new RegExp("[\\p{S}|\\p{P}]","u")}catch{}const op={Escape(n,e,t){if(e!=92||t==n.end-1)return-1;let r=n.char(t+1);for(let i=0;i<T1.length;i++)if(T1.charCodeAt(i)==r)return n.append(Tt(we.Escape,t,t+2));return-1},Entity(n,e,t){if(e!=38)return-1;let r=/^(?:#\d+|#x[a-f\d]+|\w+);/i.exec(n.slice(t+1,t+31));return r?n.append(Tt(we.Entity,t,t+1+r[0].length)):-1},InlineCode(n,e,t){if(e!=96||t&&n.char(t-1)==96)return-1;let r=t+1;for(;r<n.end&&n.char(r)==96;)r++;let i=r-t,s=0;for(;r<n.end;r++)if(n.char(r)==96){if(s++,s==i&&n.char(r+1)!=96)return n.append(Tt(we.InlineCode,t,r+1,[Tt(we.CodeMark,t,t+i),Tt(we.CodeMark,r+1-i,r+1)]))}else s=0;return-1},HTMLTag(n,e,t){if(e!=60||t==n.end-1)return-1;let r=n.slice(t+1,n.end),i=/^(?:[a-z][-\w+.]+:[^\s>]+|[a-z\d.!#$%&'*+/=?^_`{|}~-]+@[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?(?:\.[a-z\d](?:[a-z\d-]{0,61}[a-z\d])?)*)>/i.exec(r);if(i)return n.append(Tt(we.Autolink,t,t+1+i[0].length,[Tt(we.LinkMark,t,t+1),Tt(we.URL,t+1,t+i[0].length),Tt(we.LinkMark,t+i[0].length,t+1+i[0].length)]));let s=/^!--[^>](?:-[^-]|[^-])*?-->/i.exec(r);if(s)return n.append(Tt(we.Comment,t,t+1+s[0].length));let o=/^\?[^]*?\?>/.exec(r);if(o)return n.append(Tt(we.ProcessingInstruction,t,t+1+o[0].length));let a=/^(?:![A-Z][^]*?>|!\[CDATA\[[^]*?\]\]>|\/\s*[a-zA-Z][\w-]*\s*>|\s*[a-zA-Z][\w-]*(\s+[a-zA-Z:_][\w-.:]*(?:\s*=\s*(?:[^\s"'=<>`]+|'[^']*'|"[^"]*"))?)*\s*(\/\s*)?>)/.exec(r);return a?n.append(Tt(we.HTMLTag,t,t+1+a[0].length)):-1},Emphasis(n,e,t){if(e!=95&&e!=42)return-1;let r=t+1;for(;n.char(r)==e;)r++;let i=n.slice(t-1,t),s=n.slice(r,r+1),o=Lc.test(i),a=Lc.test(s),l=/\s|^$/.test(i),c=/\s|^$/.test(s),u=!c&&(!a||l||o),f=!l&&(!o||c||a),d=u&&(e==42||!f||o),h=f&&(e==42||!u||a);return n.append(new Nr(e==95?RS:DS,t,r,(d?1:0)|(h?2:0)))},HardBreak(n,e,t){if(e==92&&n.char(t+1)==10)return n.append(Tt(we.HardBreak,t,t+2));if(e==32){let r=t+1;for(;n.char(r)==32;)r++;if(n.char(r)==10&&r>=t+2)return n.append(Tt(we.HardBreak,t,r+1))}return-1},Link(n,e,t){return e==91?n.append(new Nr(So,t,t+1,1)):-1},Image(n,e,t){return e==33&&n.char(t+1)==91?n.append(new Nr(sd,t,t+2,1)):-1},LinkEnd(n,e,t){if(e!=93)return-1;for(let r=n.parts.length-1;r>=0;r--){let i=n.parts[r];if(i instanceof Nr&&(i.type==So||i.type==sd)){if(!i.side||n.skipSpace(i.to)==t&&!/[(\[]/.test(n.slice(t+1,t+2)))return n.parts[r]=null,-1;let s=n.takeContent(r),o=n.parts[r]=HD(n,s,i.type==So?we.Link:we.Image,i.from,t+1);if(i.type==So)for(let a=0;a<r;a++){let l=n.parts[a];l instanceof Nr&&l.type==So&&(l.side=0)}return o.to}}return-1}};function HD(n,e,t,r,i){let{text:s}=n,o=n.char(i),a=i;if(e.unshift(Tt(we.LinkMark,r,r+(t==we.Image?2:1))),e.push(Tt(we.LinkMark,i-1,i)),o==40){let l=n.skipSpace(i+1),c=IS(s,l-n.offset,n.offset),u;c&&(l=n.skipSpace(c.to),l!=c.to&&(u=NS(s,l-n.offset,n.offset),u&&(l=n.skipSpace(u.to)))),n.char(l)==41&&(e.push(Tt(we.LinkMark,i,i+1)),a=l+1,c&&e.push(c),u&&e.push(u),e.push(Tt(we.LinkMark,l,a)))}else if(o==91){let l=BS(s,i-n.offset,n.offset,!1);l&&(e.push(l),a=l.to)}return Tt(t,r,a,e)}function IS(n,e,t){if(n.charCodeAt(e)==60){for(let i=e+1;i<n.length;i++){let s=n.charCodeAt(i);if(s==62)return Tt(we.URL,e+t,i+1+t);if(s==60||s==10)return!1}return null}else{let i=0,s=e;for(let o=!1;s<n.length;s++){let a=n.charCodeAt(s);if(di(a))break;if(o)o=!1;else if(a==40)i++;else if(a==41){if(!i)break;i--}else a==92&&(o=!0)}return s>e?Tt(we.URL,e+t,s+t):s==n.length?null:!1}}function NS(n,e,t){let r=n.charCodeAt(e);if(r!=39&&r!=34&&r!=40)return!1;let i=r==40?41:r;for(let s=e+1,o=!1;s<n.length;s++){let a=n.charCodeAt(s);if(o)o=!1;else{if(a==i)return Tt(we.LinkTitle,e+t,s+1+t);a==92&&(o=!0)}}return null}function BS(n,e,t,r){for(let i=!1,s=e+1,o=Math.min(n.length,s+999);s<o;s++){let a=n.charCodeAt(s);if(i)i=!1;else{if(a==93)return r?!1:Tt(we.LinkLabel,e+t,s+1+t);if(r&&!di(a)&&(r=!1),a==91)return!1;a==92&&(i=!0)}}return null}class kO{constructor(e,t,r){this.parser=e,this.text=t,this.offset=r,this.parts=[]}char(e){return e>=this.end?-1:this.text.charCodeAt(e-this.offset)}get end(){return this.offset+this.text.length}slice(e,t){return this.text.slice(e-this.offset,t-this.offset)}append(e){return this.parts.push(e),e.to}addDelimiter(e,t,r,i,s){return this.append(new Nr(e,t,r,(i?1:0)|(s?2:0)))}get hasOpenLink(){for(let e=this.parts.length-1;e>=0;e--){let t=this.parts[e];if(t instanceof Nr&&(t.type==So||t.type==sd))return!0}return!1}addElement(e){return this.append(e)}resolveMarkers(e){for(let r=e;r<this.parts.length;r++){let i=this.parts[r];if(!(i instanceof Nr&&i.type.resolve&&i.side&2))continue;let s=i.type==RS||i.type==DS,o=i.to-i.from,a,l=r-1;for(;l>=e;l--){let p=this.parts[l];if(p instanceof Nr&&p.side&1&&p.type==i.type&&!(s&&(i.side&1||p.side&2)&&(p.to-p.from+o)%3==0&&((p.to-p.from)%3||o%3))){a=p;break}}if(!a)continue;let c=i.type.resolve,u=[],f=a.from,d=i.to;if(s){let p=Math.min(2,a.to-a.from,o);f=a.to-p,d=i.from+p,c=p==1?"Emphasis":"StrongEmphasis"}a.type.mark&&u.push(this.elt(a.type.mark,f,a.to));for(let p=l+1;p<r;p++)this.parts[p]instanceof Qc&&u.push(this.parts[p]),this.parts[p]=null;i.type.mark&&u.push(this.elt(i.type.mark,i.from,d));let h=this.elt(c,f,d,u);this.parts[l]=s&&a.from!=f?new Nr(a.type,a.from,f,a.side):null,(this.parts[r]=s&&i.to!=d?new Nr(i.type,d,i.to,i.side):null)?this.parts.splice(r,0,h):this.parts[r]=h}let t=[];for(let r=e;r<this.parts.length;r++){let i=this.parts[r];i instanceof Qc&&t.push(i)}return t}findOpeningDelimiter(e){for(let t=this.parts.length-1;t>=0;t--){let r=this.parts[t];if(r instanceof Nr&&r.type==e&&r.side&1)return t}return null}takeContent(e){let t=this.resolveMarkers(e);return this.parts.length=e,t}getDelimiterAt(e){let t=this.parts[e];return t instanceof Nr?t:null}skipSpace(e){return fc(this.text,e-this.offset)+this.offset}elt(e,t,r,i){return typeof e=="string"?Tt(this.parser.getNodeType(e),t,r,i):new qS(e,t)}}kO.linkStart=So;kO.imageStart=sd;function lg(n,e){if(!e.length)return n;if(!n.length)return e;let t=n.slice(),r=0;for(let i of e){for(;r<t.length&&t[r].to<i.to;)r++;if(r<t.length&&t[r].from<i.from){let s=t[r];s instanceof Qc&&(t[r]=new Qc(s.type,s.from,s.to,lg(s.children,[i])))}else t.splice(r++,0,i)}return t}const KD=[we.CodeBlock,we.ListItem,we.OrderedList,we.BulletList];let JD=class{constructor(e,t){this.fragments=e,this.input=t,this.i=0,this.fragment=null,this.fragmentEnd=-1,this.cursor=null,e.length&&(this.fragment=e[this.i++])}nextFragment(){this.fragment=this.i<this.fragments.length?this.fragments[this.i++]:null,this.cursor=null,this.fragmentEnd=-1}moveTo(e,t){for(;this.fragment&&this.fragment.to<=e;)this.nextFragment();if(!this.fragment||this.fragment.from>(e?e-1:0))return!1;if(this.fragmentEnd<0){let s=this.fragment.to;for(;s>0&&this.input.read(s-1,s)!=`
|
|
160
|
-
`;)s--;this.fragmentEnd=s?s-1:0}let r=this.cursor;r||(r=this.cursor=this.fragment.tree.cursor(),r.firstChild());let i=e+this.fragment.offset;for(;r.to<=i;)if(!r.parent())return!1;for(;;){if(r.from>=i)return this.fragment.from<=t;if(!r.childAfter(i))return!1}}matches(e){let t=this.cursor.tree;return t&&t.prop(et.contextHash)==e}takeNodes(e){let t=this.cursor,r=this.fragment.offset,i=this.fragmentEnd-(this.fragment.openEnd?1:0),s=e.absoluteLineStart,o=s,a=e.block.children.length,l=o,c=a;for(;;){if(t.to-r>i){if(t.type.isAnonymous&&t.firstChild())continue;break}let u=jS(t.from-r,e.ranges);if(t.to-r<=e.ranges[e.rangeI].to)e.addNode(t.tree,u);else{let f=new mt(e.parser.nodeSet.types[we.Paragraph],[],[],0,e.block.hashProp);e.reusePlaceholders.set(f,t.tree),e.addNode(f,u)}if(t.type.is("Block")&&(KD.indexOf(t.type.id)<0?(o=t.to-r,a=e.block.children.length):(o=l,a=c),l=t.to-r,c=e.block.children.length),!t.nextSibling())break}for(;e.block.children.length>a;)e.block.children.pop(),e.block.positions.pop();return o-s}};function jS(n,e){let t=n;for(let r=1;r<e.length;r++){let i=e[r-1].to,s=e[r].from;i<n&&(t-=s-i)}return t}const e3=Ol({"Blockquote/...":N.quote,HorizontalRule:N.contentSeparator,"ATXHeading1/... SetextHeading1/...":N.heading1,"ATXHeading2/... SetextHeading2/...":N.heading2,"ATXHeading3/...":N.heading3,"ATXHeading4/...":N.heading4,"ATXHeading5/...":N.heading5,"ATXHeading6/...":N.heading6,"Comment CommentBlock":N.comment,Escape:N.escape,Entity:N.character,"Emphasis/...":N.emphasis,"StrongEmphasis/...":N.strong,"Link/... Image/...":N.link,"OrderedList/... BulletList/...":N.list,"BlockQuote/...":N.quote,"InlineCode CodeText":N.monospace,"URL Autolink":N.url,"HeaderMark HardBreak QuoteMark ListMark LinkMark EmphasisMark CodeMark":N.processingInstruction,"CodeInfo LinkLabel":N.labelName,LinkTitle:N.string,Paragraph:N.content}),t3=new ch(new vl(LS).extend(e3),Object.keys(zu).map(n=>zu[n]),Object.keys(zu).map(n=>$S[n]),Object.keys(zu),YD,_S,Object.keys(op).map(n=>op[n]),Object.keys(op),[]);function n3(n,e,t){let r=[];for(let i=n.firstChild,s=e;;i=i.nextSibling){let o=i?i.from:t;if(o>s&&r.push({from:s,to:o}),!i)break;s=i.to}return r}function r3(n){let{codeParser:e,htmlParser:t}=n;return{wrap:bx((i,s)=>{let o=i.type.id;if(e&&(o==we.CodeBlock||o==we.FencedCode)){let a="";if(o==we.FencedCode){let c=i.node.getChild(we.CodeInfo);c&&(a=s.read(c.from,c.to))}let l=e(a);if(l)return{parser:l,overlay:c=>c.type.id==we.CodeText,bracketed:o==we.FencedCode}}else if(t&&(o==we.HTMLBlock||o==we.HTMLTag||o==we.CommentBlock))return{parser:t,overlay:n3(i.node,i.from,i.to)};return null})}}const i3={resolve:"Strikethrough",mark:"StrikethroughMark"},s3={defineNodes:[{name:"Strikethrough",style:{"Strikethrough/...":N.strikethrough}},{name:"StrikethroughMark",style:N.processingInstruction}],parseInline:[{name:"Strikethrough",parse(n,e,t){if(e!=126||n.char(t+1)!=126||n.char(t+2)==126)return-1;let r=n.slice(t-1,t),i=n.slice(t+2,t+3),s=/\s|^$/.test(r),o=/\s|^$/.test(i),a=Lc.test(r),l=Lc.test(i);return n.addDelimiter(i3,t,t+2,!o&&(!l||s||a),!s&&(!a||o||l))},after:"Emphasis"}]};function dc(n,e,t=0,r,i=0){let s=0,o=!0,a=-1,l=-1,c=!1,u=()=>{r.push(n.elt("TableCell",i+a,i+l,n.parser.parseInline(e.slice(a,l),i+a)))};for(let f=t;f<e.length;f++){let d=e.charCodeAt(f);d==124&&!c?((!o||a>-1)&&s++,o=!1,r&&(a>-1&&u(),r.push(n.elt("TableDelimiter",f+i,f+i+1))),a=l=-1):(c||d!=32&&d!=9)&&(a<0&&(a=f),l=f+1),c=!c&&d==92}return a>-1&&(s++,r&&u()),s}function P1(n,e){for(let t=e;t<n.length;t++){let r=n.charCodeAt(t);if(r==124)return!0;r==92&&t++}return!1}const zS=/^\|?(\s*:?-+:?\s*\|)+(\s*:?-+:?\s*)?$/;class E1{constructor(){this.rows=null}nextLine(e,t,r){if(this.rows==null){this.rows=!1;let i;if((t.next==45||t.next==58||t.next==124)&&zS.test(i=t.text.slice(t.pos))){let s=[];dc(e,r.content,0,s,r.start)==dc(e,i,t.pos)&&(this.rows=[e.elt("TableHeader",r.start,r.start+r.content.length,s),e.elt("TableDelimiter",e.lineStart+t.pos,e.lineStart+t.text.length)])}}else if(this.rows){let i=[];dc(e,t.text,t.pos,i,e.lineStart),this.rows.push(e.elt("TableRow",e.lineStart+t.pos,e.lineStart+t.text.length,i))}return!1}finish(e,t){return this.rows?(e.addLeafElement(t,e.elt("Table",t.start,t.start+t.content.length,this.rows)),!0):!1}}const o3={defineNodes:[{name:"Table",block:!0},{name:"TableHeader",style:{"TableHeader/...":N.heading}},"TableRow",{name:"TableCell",style:N.content},{name:"TableDelimiter",style:N.processingInstruction}],parseBlock:[{name:"Table",leaf(n,e){return P1(e.content,0)?new E1:null},endLeaf(n,e,t){if(t.parsers.some(i=>i instanceof E1)||!P1(e.text,e.basePos))return!1;let r=n.peekLine();return zS.test(r)&&dc(n,e.text,e.basePos)==dc(n,r,e.basePos)},before:"SetextHeading"}]};class a3{nextLine(){return!1}finish(e,t){return e.addLeafElement(t,e.elt("Task",t.start,t.start+t.content.length,[e.elt("TaskMarker",t.start,t.start+3),...e.parser.parseInline(t.content.slice(3),t.start+3)])),!0}}const l3={defineNodes:[{name:"Task",block:!0,style:N.list},{name:"TaskMarker",style:N.atom}],parseBlock:[{name:"TaskList",leaf(n,e){return/^\[[ xX]\][ \t]/.test(e.content)&&n.parentType().name=="ListItem"?new a3:null},after:"SetextHeading"}]},$1=/(www\.)|(https?:\/\/)|([\w.+-]{1,100}@)|(mailto:|xmpp:)/gy,Q1=/[\w-]+(\.[\w-]+)+(\/[^\s<]*)?/gy,c3=/[\w-]+\.[\w-]+($|\/)/,L1=/[\w.+-]+@[\w-]+(\.[\w.-]+)+/gy,M1=/\/[a-zA-Z\d@.]+/gy;function q1(n,e,t,r){let i=0;for(let s=e;s<t;s++)n[s]==r&&i++;return i}function u3(n,e){Q1.lastIndex=e;let t=Q1.exec(n);if(!t||c3.exec(t[0])[0].indexOf("_")>-1)return-1;let r=e+t[0].length;for(;;){let i=n[r-1],s;if(/[?!.,:*_~]/.test(i)||i==")"&&q1(n,e,r,")")>q1(n,e,r,"("))r--;else if(i==";"&&(s=/&(?:#\d+|#x[a-f\d]+|\w+);$/.exec(n.slice(e,r))))r=e+s.index;else break}return r}function R1(n,e){L1.lastIndex=e;let t=L1.exec(n);if(!t)return-1;let r=t[0][t[0].length-1];return r=="_"||r=="-"?-1:e+t[0].length-(r=="."?1:0)}const f3={parseInline:[{name:"Autolink",parse(n,e,t){let r=t-n.offset;if(r&&/\w/.test(n.text[r-1]))return-1;$1.lastIndex=r;let i=$1.exec(n.text),s=-1;if(!i)return-1;if(i[1]||i[2]){if(s=u3(n.text,r+i[0].length),s>-1&&n.hasOpenLink){let o=/([^\[\]]|\[[^\]]*\])*/.exec(n.text.slice(r,s));s=r+o[0].length}}else i[3]?s=R1(n.text,r):(s=R1(n.text,r+i[0].length),s>-1&&i[0]=="xmpp:"&&(M1.lastIndex=s,i=M1.exec(n.text),i&&(s=i.index+i[0].length)));return s<0?-1:(n.addElement(n.elt("URL",t,s+n.offset)),s+n.offset)}}]},d3=[o3,l3,s3,f3];function ZS(n,e,t){return(r,i,s)=>{if(i!=n||r.char(s+1)==n)return-1;let o=[r.elt(t,s,s+1)];for(let a=s+1;a<r.end;a++){let l=r.char(a);if(l==n)return r.addElement(r.elt(e,s,a+1,o.concat(r.elt(t,a,a+1))));if(l==92&&o.push(r.elt("Escape",a,a+++2)),di(l))break}return-1}}const h3={defineNodes:[{name:"Superscript",style:N.special(N.content)},{name:"SuperscriptMark",style:N.processingInstruction}],parseInline:[{name:"Superscript",parse:ZS(94,"Superscript","SuperscriptMark")}]},p3={defineNodes:[{name:"Subscript",style:N.special(N.content)},{name:"SubscriptMark",style:N.processingInstruction}],parseInline:[{name:"Subscript",parse:ZS(126,"Subscript","SubscriptMark")}]},m3={defineNodes:[{name:"Emoji",style:N.character}],parseInline:[{name:"Emoji",parse(n,e,t){let r;return e!=58||!(r=/^[a-zA-Z_0-9]+:/.exec(n.slice(t+1,n.end)))?-1:n.addElement(n.elt("Emoji",t,t+1+r[0].length))}}]};var D1={};class od{constructor(e,t,r,i,s,o,a,l,c,u=0,f){this.p=e,this.stack=t,this.state=r,this.reducePos=i,this.pos=s,this.score=o,this.buffer=a,this.bufferBase=l,this.curContext=c,this.lookAhead=u,this.parent=f}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,r=0){let i=e.parser.context;return new od(e,[],t,r,r,0,[],0,i?new I1(i,i.start):null,0,null)}get context(){return this.curContext?this.curContext.context:null}pushState(e,t){this.stack.push(this.state,t,this.bufferBase+this.buffer.length),this.state=e}reduce(e){var t;let r=e>>19,i=e&65535,{parser:s}=this.p,o=this.reducePos<this.pos-25&&this.setLookAhead(this.pos),a=s.dynamicPrecedence(i);if(a&&(this.score+=a),r==0){this.pushState(s.getGoto(this.state,i,!0),this.reducePos),i<s.minRepeatTerm&&this.storeNode(i,this.reducePos,this.reducePos,o?8:4,!0),this.reduceContext(i,this.reducePos);return}let l=this.stack.length-(r-1)*3-(e&262144?6:0),c=l?this.stack[l-2]:this.p.ranges[0].from,u=this.reducePos-c;u>=2e3&&!(!((t=this.p.parser.nodeSet.types[i])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=u):this.p.lastBigReductionSize<u&&(this.p.bigReductionCount=1,this.p.lastBigReductionStart=c,this.p.lastBigReductionSize=u));let f=l?this.stack[l-1]:0,d=this.bufferBase+this.buffer.length-f;if(i<s.minRepeatTerm||e&131072){let h=s.stateFlag(this.state,1)?this.pos:this.reducePos;this.storeNode(i,c,h,d+4,!0)}if(e&262144)this.state=this.stack[l];else{let h=this.stack[l-3];this.state=s.getGoto(h,i,!0)}for(;this.stack.length>l;)this.stack.pop();this.reduceContext(i,c)}storeNode(e,t,r,i=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]<this.buffer.length+this.bufferBase)){let o=this,a=this.buffer.length;if(a==0&&o.parent&&(a=o.bufferBase-o.parent.bufferBase,o=o.parent),a>0&&o.buffer[a-4]==0&&o.buffer[a-1]>-1){if(t==r)return;if(o.buffer[a-2]>=t){o.buffer[a-2]=r;return}}}if(!s||this.pos==r)this.buffer.push(e,t,r,i);else{let o=this.buffer.length;if(o>0&&(this.buffer[o-4]!=0||this.buffer[o-1]<0)){let a=!1;for(let l=o;l>0&&this.buffer[l-2]>r;l-=4)if(this.buffer[l-1]>=0){a=!0;break}if(a)for(;o>0&&this.buffer[o-2]>r;)this.buffer[o]=this.buffer[o-4],this.buffer[o+1]=this.buffer[o-3],this.buffer[o+2]=this.buffer[o-2],this.buffer[o+3]=this.buffer[o-1],o-=4,i>4&&(i-=4)}this.buffer[o]=e,this.buffer[o+1]=t,this.buffer[o+2]=r,this.buffer[o+3]=i}}shift(e,t,r,i){if(e&131072)this.pushState(e&65535,this.pos);else if((e&262144)==0){let s=e,{parser:o}=this.p;this.pos=i;let a=o.stateFlag(s,1);!a&&(i>r||t<=o.maxNode)&&(this.reducePos=i),this.pushState(s,a?r:Math.min(r,this.reducePos)),this.shiftContext(t,r),t<=o.maxNode&&this.buffer.push(t,r,i,4)}else this.pos=i,this.shiftContext(t,r),t<=this.p.parser.maxNode&&this.buffer.push(t,r,i,4)}apply(e,t,r,i){e&65536?this.reduce(e):this.shift(e,t,r,i)}useNode(e,t){let r=this.p.reused.length-1;(r<0||this.p.reused[r]!=e)&&(this.p.reused.push(e),r++);let i=this.pos;this.reducePos=this.pos=i+e.length,this.pushState(t,i),this.buffer.push(r,i,this.reducePos,-1),this.curContext&&this.updateContext(this.curContext.tracker.reuse(this.curContext.context,e,this,this.p.stream.reset(this.pos-e.length)))}split(){let e=this,t=e.buffer.length;for(;t>0&&e.buffer[t-2]>e.reducePos;)t-=4;let r=e.buffer.slice(t),i=e.bufferBase+t;for(;e&&i==e.bufferBase;)e=e.parent;return new od(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,r,i,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let r=e<=this.p.parser.maxNode;r&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,r?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new g3(this);;){let r=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(r==0)return!1;if((r&65536)==0)return!0;t.reduce(r)}}recoverByInsert(e){if(this.stack.length>=300)return[];let t=this.p.parser.nextStates(this.state);if(t.length>8||this.stack.length>=120){let i=[];for(let s=0,o;s<t.length;s+=2)(o=t[s+1])!=this.state&&this.p.parser.hasAction(o,e)&&i.push(t[s],o);if(this.stack.length<120)for(let s=0;i.length<8&&s<t.length;s+=2){let o=t[s+1];i.some((a,l)=>l&1&&a==o)||i.push(t[s],o)}t=i}let r=[];for(let i=0;i<t.length&&r.length<4;i+=2){let s=t[i+1];if(s==this.state)continue;let o=this.split();o.pushState(s,this.pos),o.storeNode(0,o.pos,o.pos,4,!0),o.shiftContext(t[i],this.pos),o.reducePos=this.pos,o.score-=200,r.push(o)}return r}forceReduce(){let{parser:e}=this.p,t=e.stateSlot(this.state,5);if((t&65536)==0)return!1;if(!e.validAction(this.state,t)){let r=t>>19,i=t&65535,s=this.stack.length-r*3;if(s<0||e.getGoto(this.stack[s],i,!1)<0){let o=this.findForcedReduction();if(o==null)return!1;t=o}this.storeNode(0,this.pos,this.pos,4,!0),this.score-=100}return this.reducePos=this.pos,this.reduce(t),!0}findForcedReduction(){let{parser:e}=this.p,t=[],r=(i,s)=>{if(!t.includes(i))return t.push(i),e.allActions(i,o=>{if(!(o&393216))if(o&65536){let a=(o>>19)-s;if(a>1){let l=o&65535,c=this.stack.length-a*3;if(c>=0&&e.getGoto(this.stack[c],l,!1)>=0)return a<<19|65536|l}}else{let a=r(o,s+1);if(a!=null)return a}})};return r(this.state,0)}forceAll(){for(;!this.p.parser.stateFlag(this.state,2);)if(!this.forceReduce()){this.storeNode(0,this.pos,this.pos,4,!0);break}return this}get deadEnd(){if(this.stack.length!=3)return!1;let{parser:e}=this.p;return e.data[e.stateSlot(this.state,1)]==65535&&!e.stateSlot(this.state,4)}restart(){this.storeNode(0,this.pos,this.pos,4,!0),this.state=this.stack[0],this.stack.length=0}sameState(e){if(this.state!=e.state||this.stack.length!=e.stack.length)return!1;for(let t=0;t<this.stack.length;t+=3)if(this.stack[t]!=e.stack[t])return!1;return!0}get parser(){return this.p.parser}dialectEnabled(e){return this.p.parser.dialect.flags[e]}shiftContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.shift(this.curContext.context,e,this,this.p.stream.reset(t)))}reduceContext(e,t){this.curContext&&this.updateContext(this.curContext.tracker.reduce(this.curContext.context,e,this,this.p.stream.reset(t)))}emitContext(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-3)&&this.buffer.push(this.curContext.hash,this.pos,this.pos,-3)}emitLookAhead(){let e=this.buffer.length-1;(e<0||this.buffer[e]!=-4)&&this.buffer.push(this.lookAhead,this.pos,this.pos,-4)}updateContext(e){if(e!=this.curContext.context){let t=new I1(this.curContext.tracker,e);t.hash!=this.curContext.hash&&this.emitContext(),this.curContext=t}}setLookAhead(e){return e<=this.lookAhead?!1:(this.emitLookAhead(),this.lookAhead=e,!0)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class I1{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class g3{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,r=e>>19;r==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(r-1)*3;let i=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=i}}class ad{constructor(e,t,r){this.stack=e,this.pos=t,this.index=r,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new ad(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;e!=null&&(this.index=this.stack.bufferBase-e.bufferBase,this.stack=e,this.buffer=e.buffer)}get id(){return this.buffer[this.index-4]}get start(){return this.buffer[this.index-3]}get end(){return this.buffer[this.index-2]}get size(){return this.buffer[this.index-1]}next(){this.index-=4,this.pos-=4,this.index==0&&this.maybeNext()}fork(){return new ad(this.stack,this.pos,this.index)}}function Kl(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let r=0,i=0;r<n.length;){let s=0;for(;;){let o=n.charCodeAt(r++),a=!1;if(o==126){s=65535;break}o>=92&&o--,o>=34&&o--;let l=o-32;if(l>=46&&(l-=46,a=!0),s+=l,a)break;s*=46}t?t[i++]=s:t=new e(s)}return t}class kf{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const N1=new kf;class v3{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=N1,this.rangeIndex=0,this.pos=this.chunkPos=t[0].from,this.range=t[0],this.end=t[t.length-1].to,this.readNext()}resolveOffset(e,t){let r=this.range,i=this.rangeIndex,s=this.pos+e;for(;s<r.from;){if(!i)return null;let o=this.ranges[--i];s-=r.from-o.to,r=o}for(;t<0?s>r.to:s>=r.to;){if(i==this.ranges.length-1)return null;let o=this.ranges[++i];s+=o.from-r.to,r=o}return s}clipPos(e){if(e>=this.range.from&&e<this.range.to)return e;for(let t of this.ranges)if(t.to>e)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,r,i;if(t>=0&&t<this.chunk.length)r=this.pos+e,i=this.chunk.charCodeAt(t);else{let s=this.resolveOffset(e,1);if(s==null)return-1;if(r=s,r>=this.chunk2Pos&&r<this.chunk2Pos+this.chunk2.length)i=this.chunk2.charCodeAt(r-this.chunk2Pos);else{let o=this.rangeIndex,a=this.range;for(;a.to<=r;)a=this.ranges[++o];this.chunk2=this.input.chunk(this.chunk2Pos=r),r+this.chunk2.length>a.to&&(this.chunk2=this.chunk2.slice(0,a.to-r)),i=this.chunk2.charCodeAt(0)}}return r>=this.token.lookAhead&&(this.token.lookAhead=r+1),i}acceptToken(e,t=0){let r=t?this.resolveOffset(t,-1):this.pos;if(r==null||r<this.token.start)throw new RangeError("Token end out of bounds");this.token.value=e,this.token.end=r}acceptTokenTo(e,t){this.token.value=e,this.token.end=t}getChunk(){if(this.pos>=this.chunk2Pos&&this.pos<this.chunk2Pos+this.chunk2.length){let{chunk:e,chunkPos:t}=this;this.chunk=this.chunk2,this.chunkPos=this.chunk2Pos,this.chunk2=e,this.chunk2Pos=t,this.chunkOff=this.pos-this.chunkPos}else{this.chunk2=this.chunk,this.chunk2Pos=this.chunkPos;let e=this.input.chunk(this.pos),t=this.pos+e.length;this.chunk=t>this.range.to?e.slice(0,this.range.to-this.pos):e,this.chunkPos=this.pos,this.chunkOff=0}}readNext(){return this.chunkOff>=this.chunk.length&&(this.getChunk(),this.chunkOff==this.chunk.length)?this.next=-1:this.next=this.chunk.charCodeAt(this.chunkOff)}advance(e=1){for(this.chunkOff+=e;this.pos+e>=this.range.to;){if(this.rangeIndex==this.ranges.length-1)return this.setDone();e-=this.range.to-this.pos,this.range=this.ranges[++this.rangeIndex],this.pos=this.range.from}return this.pos+=e,this.pos>=this.token.lookAhead&&(this.token.lookAhead=this.pos+1),this.readNext()}setDone(){return this.pos=this.chunkPos=this.end,this.range=this.ranges[this.rangeIndex=this.ranges.length-1],this.chunk="",this.next=-1}reset(e,t){if(t?(this.token=t,t.start=e,t.lookAhead=e+1,t.value=t.extended=-1):this.token=N1,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e<this.range.from;)this.range=this.ranges[--this.rangeIndex];for(;e>=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&e<this.chunkPos+this.chunk.length?this.chunkOff=e-this.chunkPos:(this.chunk="",this.chunkOff=0),this.readNext()}return this}read(e,t){if(e>=this.chunkPos&&t<=this.chunkPos+this.chunk.length)return this.chunk.slice(e-this.chunkPos,t-this.chunkPos);if(e>=this.chunk2Pos&&t<=this.chunk2Pos+this.chunk2.length)return this.chunk2.slice(e-this.chunk2Pos,t-this.chunk2Pos);if(e>=this.range.from&&t<=this.range.to)return this.input.read(e,t);let r="";for(let i of this.ranges){if(i.from>=t)break;i.to>e&&(r+=this.input.read(Math.max(i.from,e),Math.min(i.to,t)))}return r}}class Ba{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:r}=t.p;FS(this.data,e,t,this.id,r.data,r.tokenPrecTable)}}Ba.prototype.contextual=Ba.prototype.fallback=Ba.prototype.extend=!1;class ld{constructor(e,t,r){this.precTable=t,this.elseToken=r,this.data=typeof e=="string"?Kl(e):e}token(e,t){let r=e.pos,i=0;for(;;){let s=e.next<0,o=e.resolveOffset(1,1);if(FS(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||i++,o==null)break;e.reset(o,e.token)}i&&(e.reset(r,e.token),e.acceptToken(this.elseToken,i))}}ld.prototype.contextual=Ba.prototype.fallback=Ba.prototype.extend=!1;class Wr{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function FS(n,e,t,r,i,s){let o=0,a=1<<r,{dialect:l}=t.p.parser;e:for(;(a&n[o])!=0;){let c=n[o+1];for(let h=o+3;h<c;h+=2)if((n[h+1]&a)>0){let m=n[h];if(l.allows(m)&&(e.token.value==-1||e.token.value==m||O3(m,e.token.value,i,s))){e.acceptToken(m);break}}let u=e.next,f=0,d=n[o+2];if(e.next<0&&d>f&&n[c+d*3-3]==65535){o=n[c+d*3-1];continue e}for(;f<d;){let h=f+d>>1,m=c+h+(h<<1),p=n[m],v=n[m+1]||65536;if(u<p)d=h;else if(u>=v)f=h+1;else{o=n[m+2],e.advance();continue e}}break}}function B1(n,e,t){for(let r=e,i;(i=n[r])!=65535;r++)if(i==t)return r-e;return-1}function O3(n,e,t,r){let i=B1(t,r,e);return i<0||B1(t,r,n)<i}const Mr=typeof process<"u"&&D1&&/\bparse\b/.test(D1.LOG);let ap=null;function j1(n,e,t){let r=n.cursor(Zt.IncludeAnonymous);for(r.moveTo(e);;)if(!(t<0?r.childBefore(e):r.childAfter(e)))for(;;){if((t<0?r.to<e:r.from>e)&&!r.type.isError)return t<0?Math.max(0,Math.min(r.to-1,e-25)):Math.min(n.length,Math.max(r.from+1,e+25));if(t<0?r.prevSibling():r.nextSibling())break;if(!r.parent())return t<0?0:n.length}}class b3{constructor(e,t){this.fragments=e,this.nodeSet=t,this.i=0,this.fragment=null,this.safeFrom=-1,this.safeTo=-1,this.trees=[],this.start=[],this.index=[],this.nextFragment()}nextFragment(){let e=this.fragment=this.i==this.fragments.length?null:this.fragments[this.i++];if(e){for(this.safeFrom=e.openStart?j1(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?j1(e.tree,e.to+e.offset,-1)-e.offset:e.to;this.trees.length;)this.trees.pop(),this.start.pop(),this.index.pop();this.trees.push(e.tree),this.start.push(-e.offset),this.index.push(0),this.nextStart=this.safeFrom}else this.nextStart=1e9}nodeAt(e){if(e<this.nextStart)return null;for(;this.fragment&&this.safeTo<=e;)this.nextFragment();if(!this.fragment)return null;for(;;){let t=this.trees.length-1;if(t<0)return this.nextFragment(),null;let r=this.trees[t],i=this.index[t];if(i==r.children.length){this.trees.pop(),this.start.pop(),this.index.pop();continue}let s=r.children[i],o=this.start[t]+r.positions[i];if(o>e)return this.nextStart=o,null;if(s instanceof mt){if(o==e){if(o<this.safeFrom)return null;let a=o+s.length;if(a<=this.safeTo){let l=s.prop(et.lookAhead);if(!l||a+l<this.fragment.to)return s}}this.index[t]++,o+s.length>=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(o),this.index.push(0))}else this.index[t]++,this.nextStart=o+s.length}}}class y3{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(r=>new kf)}getActions(e){let t=0,r=null,{parser:i}=e.p,{tokenizers:s}=i,o=i.stateSlot(e.state,3),a=e.curContext?e.curContext.hash:0,l=0;for(let c=0;c<s.length;c++){if((1<<c&o)==0)continue;let u=s[c],f=this.tokens[c];if(!(r&&!u.fallback)&&((u.contextual||f.start!=e.pos||f.mask!=o||f.context!=a)&&(this.updateCachedToken(f,u,e),f.mask=o,f.context=a),f.lookAhead>f.end+25&&(l=Math.max(f.lookAhead,l)),f.value!=0)){let d=t;if(f.extended>-1&&(t=this.addActions(e,f.extended,f.end,t)),t=this.addActions(e,f.value,f.end,t),!u.extend&&(r=f,t>d))break}}for(;this.actions.length>t;)this.actions.pop();return l&&e.setLookAhead(l),!r&&e.pos==this.stream.end&&(r=new kf,r.value=e.p.parser.eofTerm,r.start=r.end=e.pos,t=this.addActions(e,r.value,r.end,t)),this.mainToken=r,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new kf,{pos:r,p:i}=e;return t.start=r,t.end=Math.min(r+1,i.stream.end),t.value=r==i.stream.end?i.parser.eofTerm:0,t}updateCachedToken(e,t,r){let i=this.stream.clipPos(r.pos);if(t.token(this.stream.reset(i,e),r),e.value>-1){let{parser:s}=r.p;for(let o=0;o<s.specialized.length;o++)if(s.specialized[o]==e.value){let a=s.specializers[o](this.stream.read(e.start,e.end),r);if(a>=0&&r.p.parser.dialect.allows(a>>1)){(a&1)==0?e.value=a>>1:e.extended=a>>1;break}}}else e.value=0,e.end=this.stream.clipPos(i+1)}putAction(e,t,r,i){for(let s=0;s<i;s+=3)if(this.actions[s]==e)return i;return this.actions[i++]=e,this.actions[i++]=t,this.actions[i++]=r,i}addActions(e,t,r,i){let{state:s}=e,{parser:o}=e.p,{data:a}=o;for(let l=0;l<2;l++)for(let c=o.stateSlot(s,l?2:1);;c+=3){if(a[c]==65535)if(a[c+1]==1)c=us(a,c+2);else{i==0&&a[c+1]==2&&(i=this.putAction(us(a,c+2),t,r,i));break}a[c]==t&&(i=this.putAction(us(a,c+1),t,r,i))}return i}}class w3{constructor(e,t,r,i){this.parser=e,this.input=t,this.ranges=i,this.recovering=0,this.nextStackID=9812,this.minStackPos=0,this.reused=[],this.stoppedAt=null,this.lastBigReductionStart=-1,this.lastBigReductionSize=0,this.bigReductionCount=0,this.stream=new v3(t,i),this.tokens=new y3(e,this.stream),this.topTerm=e.top[1];let{from:s}=i[0];this.stacks=[od.start(this,e.top[0],s)],this.fragments=r.length&&this.stream.end-s>e.bufferLength*4?new b3(r,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,r=this.stacks=[],i,s;if(this.bigReductionCount>300&&e.length==1){let[o]=e;for(;o.forceReduce()&&o.stack.length&&o.stack[o.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let o=0;o<e.length;o++){let a=e[o];for(;;){if(this.tokens.mainToken=null,a.pos>t)r.push(a);else{if(this.advanceStack(a,r,e))continue;{i||(i=[],s=[]),i.push(a);let l=this.tokens.getMainToken(a);s.push(l.value,l.end)}}break}}if(!r.length){let o=i&&k3(i);if(o)return Mr&&console.log("Finish with "+this.stackID(o)),this.stackToTree(o);if(this.parser.strict)throw Mr&&i&&console.log("Stuck with token "+(this.tokens.mainToken?this.parser.getName(this.tokens.mainToken.value):"none")),new SyntaxError("No parse at "+t);this.recovering||(this.recovering=5)}if(this.recovering&&i){let o=this.stoppedAt!=null&&i[0].pos>this.stoppedAt?i[0]:this.runRecovery(i,s,r);if(o)return Mr&&console.log("Force-finish "+this.stackID(o)),this.stackToTree(o.forceAll())}if(this.recovering){let o=this.recovering==1?1:this.recovering*3;if(r.length>o)for(r.sort((a,l)=>l.score-a.score);r.length>o;)r.pop();r.some(a=>a.reducePos>t)&&this.recovering--}else if(r.length>1){e:for(let o=0;o<r.length-1;o++){let a=r[o];for(let l=o+1;l<r.length;l++){let c=r[l];if(a.sameState(c)||a.buffer.length>500&&c.buffer.length>500)if((a.score-c.score||a.buffer.length-c.buffer.length)>0)r.splice(l--,1);else{r.splice(o--,1);continue e}}}r.length>12&&(r.sort((o,a)=>a.score-o.score),r.splice(12,r.length-12))}this.minStackPos=r[0].pos;for(let o=1;o<r.length;o++)r[o].pos<this.minStackPos&&(this.minStackPos=r[o].pos);return null}stopAt(e){if(this.stoppedAt!=null&&this.stoppedAt<e)throw new RangeError("Can't move stoppedAt forward");this.stoppedAt=e}advanceStack(e,t,r){let i=e.pos,{parser:s}=this,o=Mr?this.stackID(e)+" -> ":"";if(this.stoppedAt!=null&&i>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,u=c?e.curContext.hash:0;for(let f=this.fragments.nodeAt(i);f;){let d=this.parser.nodeSet.types[f.type.id]==f.type?s.getGoto(e.state,f.type.id):-1;if(d>-1&&f.length&&(!c||(f.prop(et.contextHash)||0)==u))return e.useNode(f,d),Mr&&console.log(o+this.stackID(e)+` (via reuse of ${s.getName(f.type.id)})`),!0;if(!(f instanceof mt)||f.children.length==0||f.positions[0]>0)break;let h=f.children[0];if(h instanceof mt&&f.positions[0]==0)f=h;else break}}let a=s.stateSlot(e.state,4);if(a>0)return e.reduce(a),Mr&&console.log(o+this.stackID(e)+` (via always-reduce ${s.getName(a&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let c=0;c<l.length;){let u=l[c++],f=l[c++],d=l[c++],h=c==l.length||!r,m=h?e:e.split(),p=this.tokens.mainToken;if(m.apply(u,f,p?p.start:m.pos,d),Mr&&console.log(o+this.stackID(m)+` (via ${(u&65536)==0?"shift":`reduce of ${s.getName(u&65535)}`} for ${s.getName(f)} @ ${i}${m==e?"":", split"})`),h)return!0;m.pos>i?t.push(m):r.push(m)}return!1}advanceFully(e,t){let r=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>r)return z1(e,t),!0}}runRecovery(e,t,r){let i=null,s=!1;for(let o=0;o<e.length;o++){let a=e[o],l=t[o<<1],c=t[(o<<1)+1],u=Mr?this.stackID(a)+" -> ":"";if(a.deadEnd&&(s||(s=!0,a.restart(),Mr&&console.log(u+this.stackID(a)+" (restarted)"),this.advanceFully(a,r))))continue;let f=a.split(),d=u;for(let h=0;h<10&&f.forceReduce()&&(Mr&&console.log(d+this.stackID(f)+" (via force-reduce)"),!this.advanceFully(f,r));h++)Mr&&(d=this.stackID(f)+" -> ");for(let h of a.recoverByInsert(l))Mr&&console.log(u+this.stackID(h)+" (via recover-insert)"),this.advanceFully(h,r);this.stream.end>a.pos?(c==a.pos&&(c++,l=0),a.recoverByDelete(l,c),Mr&&console.log(u+this.stackID(a)+` (via recover-delete ${this.parser.getName(l)})`),z1(a,r)):(!i||i.score<f.score)&&(i=f)}return i}stackToTree(e){return e.close(),mt.build({buffer:ad.create(e),nodeSet:this.parser.nodeSet,topID:this.topTerm,maxBufferLength:this.parser.bufferLength,reused:this.reused,start:this.ranges[0].from,length:e.pos-this.ranges[0].from,minRepeatType:this.parser.minRepeatTerm})}stackID(e){let t=(ap||(ap=new WeakMap)).get(e);return t||ap.set(e,t=String.fromCodePoint(this.nextStackID++)),t+e}}function z1(n,e){for(let t=0;t<e.length;t++){let r=e[t];if(r.pos==n.pos&&r.sameState(n)){e[t].score<n.score&&(e[t]=n);return}}e.push(n)}class _3{constructor(e,t,r){this.source=e,this.flags=t,this.disabled=r}allows(e){return!this.disabled||this.disabled[e]==0}}const lp=n=>n;class XS{constructor(e){this.start=e.start,this.shift=e.shift||lp,this.reduce=e.reduce||lp,this.reuse=e.reuse||lp,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class il extends nh{constructor(e){if(super(),this.wrappers=[],e.version!=14)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let a=0;a<e.repeatNodeCount;a++)t.push("");let r=Object.keys(e.topRules).map(a=>e.topRules[a][1]),i=[];for(let a=0;a<t.length;a++)i.push([]);function s(a,l,c){i[a].push([l,l.deserialize(String(c))])}if(e.nodeProps)for(let a of e.nodeProps){let l=a[0];typeof l=="string"&&(l=et[l]);for(let c=1;c<a.length;){let u=a[c++];if(u>=0)s(u,l,a[c++]);else{let f=a[c+-u];for(let d=-u;d>0;d--)s(a[c++],l,f);c++}}}this.nodeSet=new vl(t.map((a,l)=>Ln.define({name:l>=this.minRepeatTerm?void 0:a,id:l,props:i[l],top:r.indexOf(l)>-1,error:l==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(l)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=px;let o=Kl(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let a=0;a<this.specializerSpecs.length;a++)this.specialized[a]=this.specializerSpecs[a].term;this.specializers=this.specializerSpecs.map(Z1),this.states=Kl(e.states,Uint32Array),this.data=Kl(e.stateData),this.goto=Kl(e.goto),this.maxTerm=e.maxTerm,this.tokenizers=e.tokenizers.map(a=>typeof a=="number"?new Ba(o,a):a),this.topRules=e.topRules,this.dialects=e.dialects||{},this.dynamicPrecedences=e.dynamicPrecedences||null,this.tokenPrecTable=e.tokenPrec,this.termNames=e.termNames||null,this.maxNode=this.nodeSet.types.length-1,this.dialect=this.parseDialect(),this.top=this.topRules[Object.keys(this.topRules)[0]]}createParse(e,t,r){let i=new w3(this,e,t,r);for(let s of this.wrappers)i=s(i,e,t,r);return i}getGoto(e,t,r=!1){let i=this.goto;if(t>=i[0])return-1;for(let s=i[t+1];;){let o=i[s++],a=o&1,l=i[s++];if(a&&r)return l;for(let c=s+(o>>1);s<c;s++)if(i[s]==e)return l;if(a)return-1}}hasAction(e,t){let r=this.data;for(let i=0;i<2;i++)for(let s=this.stateSlot(e,i?2:1),o;;s+=3){if((o=r[s])==65535)if(r[s+1]==1)o=r[s=us(r,s+2)];else{if(r[s+1]==2)return us(r,s+2);break}if(o==t||o==0)return us(r,s+1)}return 0}stateSlot(e,t){return this.states[e*6+t]}stateFlag(e,t){return(this.stateSlot(e,0)&t)>0}validAction(e,t){return!!this.allActions(e,r=>r==t?!0:null)}allActions(e,t){let r=this.stateSlot(e,4),i=r?t(r):void 0;for(let s=this.stateSlot(e,1);i==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=us(this.data,s+2);else break;i=t(us(this.data,s+1))}return i}nextStates(e){let t=[];for(let r=this.stateSlot(e,1);;r+=3){if(this.data[r]==65535)if(this.data[r+1]==1)r=us(this.data,r+2);else break;if((this.data[r+2]&1)==0){let i=this.data[r+1];t.some((s,o)=>o&1&&s==i)||t.push(this.data[r],i)}}return t}configure(e){let t=Object.assign(Object.create(il.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let r=this.topRules[e.top];if(!r)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=r}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(r=>{let i=e.tokenizers.find(s=>s.from==r);return i?i.to:r})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((r,i)=>{let s=e.specializers.find(a=>a.from==r.external);if(!s)return r;let o=Object.assign(Object.assign({},r),{external:s.to});return t.specializers[i]=Z1(o),o})),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),e.strict!=null&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),e.bufferLength!=null&&(t.bufferLength=e.bufferLength),t}hasWrappers(){return this.wrappers.length>0}getName(e){return this.termNames?this.termNames[e]:String(e<=this.maxNode&&this.nodeSet.types[e].name||e)}get eofTerm(){return this.maxNode+1}get topNode(){return this.nodeSet.types[this.top[1]]}dynamicPrecedence(e){let t=this.dynamicPrecedences;return t==null?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),r=t.map(()=>!1);if(e)for(let s of e.split(" ")){let o=t.indexOf(s);o>=0&&(r[o]=!0)}let i=null;for(let s=0;s<t.length;s++)if(!r[s])for(let o=this.dialects[t[s]],a;(a=this.data[o++])!=65535;)(i||(i=new Uint8Array(this.maxTerm+1)))[a]=1;return new _3(e,r,i)}static deserialize(e){return new il(e)}}function us(n,e){return n[e]|n[e+1]<<16}function k3(n){let e=null;for(let t of n){let r=t.p.stoppedAt;(t.pos==t.p.stream.end||r!=null&&t.pos>r)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.score<t.score)&&(e=t)}return e}function Z1(n){if(n.external){let e=n.extend?1:0;return(t,r)=>n.external(t,r)<<1|e}return n.get}const x3=55,S3=1,A3=56,C3=2,T3=57,P3=3,F1=4,E3=5,xO=6,VS=7,WS=8,YS=9,US=10,$3=11,Q3=12,L3=13,cp=58,M3=14,q3=15,X1=59,GS=21,R3=23,HS=24,D3=25,cg=27,KS=28,I3=29,N3=32,B3=35,j3=37,z3=38,Z3=0,F3=1,X3={area:!0,base:!0,br:!0,col:!0,command:!0,embed:!0,frame:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0,menuitem:!0},V3={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},V1={dd:{dd:!0,dt:!0},dt:{dd:!0,dt:!0},li:{li:!0},option:{option:!0,optgroup:!0},optgroup:{optgroup:!0},p:{address:!0,article:!0,aside:!0,blockquote:!0,dir:!0,div:!0,dl:!0,fieldset:!0,footer:!0,form:!0,h1:!0,h2:!0,h3:!0,h4:!0,h5:!0,h6:!0,header:!0,hgroup:!0,hr:!0,menu:!0,nav:!0,ol:!0,p:!0,pre:!0,section:!0,table:!0,ul:!0},rp:{rp:!0,rt:!0},rt:{rp:!0,rt:!0},tbody:{tbody:!0,tfoot:!0},td:{td:!0,th:!0},tfoot:{tbody:!0},th:{td:!0,th:!0},thead:{tbody:!0,tfoot:!0},tr:{tr:!0}};function W3(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}let W1=null,Y1=null,U1=0;function ug(n,e){let t=n.pos+e;if(U1==t&&Y1==n)return W1;let r=n.peek(e),i="";for(;W3(r);)i+=String.fromCharCode(r),r=n.peek(++e);return Y1=n,U1=t,W1=i?i.toLowerCase():r==Y3||r==U3?void 0:null}const JS=60,cd=62,SO=47,Y3=63,U3=33,G3=45;function G1(n,e){this.name=n,this.parent=e}const H3=[xO,US,VS,WS,YS],K3=new XS({start:null,shift(n,e,t,r){return H3.indexOf(e)>-1?new G1(ug(r,1)||"",n):n},reduce(n,e){return e==GS&&n?n.parent:n},reuse(n,e,t,r){let i=e.type.id;return i==xO||i==j3?new G1(ug(r,1)||"",n):n},strict:!1}),J3=new Wr((n,e)=>{if(n.next!=JS){n.next<0&&e.context&&n.acceptToken(cp);return}n.advance();let t=n.next==SO;t&&n.advance();let r=ug(n,0);if(r===void 0)return;if(!r)return n.acceptToken(t?q3:M3);let i=e.context?e.context.name:null;if(t){if(r==i)return n.acceptToken($3);if(i&&V3[i])return n.acceptToken(cp,-2);if(e.dialectEnabled(Z3))return n.acceptToken(Q3);for(let s=e.context;s;s=s.parent)if(s.name==r)return;n.acceptToken(L3)}else{if(r=="script")return n.acceptToken(VS);if(r=="style")return n.acceptToken(WS);if(r=="textarea")return n.acceptToken(YS);if(X3.hasOwnProperty(r))return n.acceptToken(US);i&&V1[i]&&V1[i][r]?n.acceptToken(cp,-1):n.acceptToken(xO)}},{contextual:!0}),eI=new Wr(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(X1);break}if(n.next==G3)e++;else if(n.next==cd&&e>=2){t>=3&&n.acceptToken(X1,-2);break}else e=0;n.advance()}});function tI(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const nI=new Wr((n,e)=>{if(n.next==SO&&n.peek(1)==cd){let t=e.dialectEnabled(F3)||tI(e.context);n.acceptToken(t?E3:F1,2)}else n.next==cd&&n.acceptToken(F1,1)});function AO(n,e,t){let r=2+n.length;return new Wr(i=>{for(let s=0,o=0,a=0;;a++){if(i.next<0){a&&i.acceptToken(e);break}if(s==0&&i.next==JS||s==1&&i.next==SO||s>=2&&s<r&&i.next==n.charCodeAt(s-2))s++,o++;else if(s==r&&i.next==cd){a>o?i.acceptToken(e,-o):i.acceptToken(t,-(o-2));break}else if((i.next==10||i.next==13)&&a){i.acceptToken(e,1);break}else s=o=0;i.advance()}})}const rI=AO("script",x3,S3),iI=AO("style",A3,C3),sI=AO("textarea",T3,P3),oI=Ol({"Text RawText IncompleteTag IncompleteCloseTag":N.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":N.angleBracket,TagName:N.tagName,"MismatchedCloseTag/TagName":[N.tagName,N.invalid],AttributeName:N.attributeName,"AttributeValue UnquotedAttributeValue":N.attributeValue,Is:N.definitionOperator,"EntityReference CharacterReference":N.character,Comment:N.blockComment,ProcessingInst:N.processingInstruction,DoctypeDecl:N.documentMeta}),aI=il.deserialize({version:14,states:",xOVO!rOOO!ZQ#tO'#CrO!`Q#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_OS~OUSOVPOWQOXROYTO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O|_O!eZO~OgaO~OgbO~OgcO~OgdO~OgeO~O!XfOPmP![mP~O!YiOQpP![pP~O!ZlORsP![sP~OUSOVPOWQOXROYTOZqO[]O][O^^O_^Oa^Ob^Oc^Od^Oy^O!eZO~O![rO~P#gO!]sO!fuO~OgvO~OgwO~OS|OT}OiyO~OS!POT}OiyO~OS!ROT}OiyO~OS!TOT}OiyO~OS}OT}OiyO~O!XfOPmX![mX~OP!WO![!XO~O!YiOQpX![pX~OQ!ZO![!XO~O!ZlORsX![sX~OR!]O![!XO~O![!XO~P#gOg!_O~O!]sO!f!aO~OS!bO~OS!cO~Oj!dOShXThXihX~OS!fOT!gOiyO~OS!hOT!gOiyO~OS!iOT!gOiyO~OS!jOT!gOiyO~OS!gOT!gOiyO~Og!kO~Og!lO~Og!mO~OS!nO~Ol!qO!a!oO!c!pO~OS!rO~OS!sO~OS!tO~Ob!uOc!uOd!uO!a!wO!b!uO~Ob!xOc!xOd!xO!c!wO!d!xO~Ob!uOc!uOd!uO!a!{O!b!uO~Ob!xOc!xOd!xO!c!{O!d!xO~OT~cbd!ey|!e~",goto:"%q!aPPPPPPPPPPPPPPPPPPPPP!b!hP!nPP!zP!}#Q#T#Z#^#a#g#j#m#s#y!bP!b!bP$P$V$m$s$y%P%V%]%cPPPPPPPP%iX^OX`pXUOX`pezabcde{!O!Q!S!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ!ObQ!QcQ!SdQ!UeZ!e{!O!Q!S!UQ!v!oR!z!vQ!y!pR!|!yQgUR!VgQjVR!YjQmWR![mQpXR!^pQtZR!`tS_O`ToXp",nodeNames:"⚠ StartCloseTag StartCloseTag StartCloseTag EndTag SelfClosingEndTag StartTag StartTag StartTag StartTag StartTag StartCloseTag StartCloseTag StartCloseTag IncompleteTag IncompleteCloseTag Document Text EntityReference CharacterReference InvalidEntity Element OpenTag TagName Attribute AttributeName Is AttributeValue UnquotedAttributeValue ScriptText CloseTag OpenTag StyleText CloseTag OpenTag TextareaText CloseTag OpenTag CloseTag SelfClosingTag Comment ProcessingInst MismatchedCloseTag CloseTag DoctypeDecl",maxTerm:68,context:K3,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,22,31,34,37,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,30,33,36,38,"OpenTag"],["group",-10,14,15,18,19,20,21,40,41,42,43,"Entity",17,"Entity TextContent",-3,29,32,35,"TextContent Entity"],["isolate",-11,22,30,31,33,34,36,37,38,39,42,43,"ltr",-3,27,28,40,""]],propSources:[oI],skippedNodes:[0],repeatNodeCount:9,tokenData:"!<p!aR!YOX$qXY,QYZ,QZ[$q[]&X]^,Q^p$qpq,Qqr-_rs3_sv-_vw3}wxHYx}-_}!OH{!O!P-_!P!Q$q!Q![-_![!]Mz!]!^-_!^!_!$S!_!`!;x!`!a&X!a!c-_!c!}Mz!}#R-_#R#SMz#S#T1k#T#oMz#o#s-_#s$f$q$f%W-_%W%oMz%o%p-_%p&aMz&a&b-_&b1pMz1p4U-_4U4dMz4d4e-_4e$ISMz$IS$I`-_$I`$IbMz$Ib$Kh-_$Kh%#tMz%#t&/x-_&/x&EtMz&Et&FV-_&FV;'SMz;'S;:j!#|;:j;=`3X<%l?&r-_?&r?AhMz?Ah?BY$q?BY?MnMz?MnO$q!Z$|caPlW!b`!dpOX$qXZ&XZ[$q[^&X^p$qpq&Xqr$qrs&}sv$qvw+Pwx(tx!^$q!^!_*V!_!a&X!a#S$q#S#T&X#T;'S$q;'S;=`+z<%lO$q!R&bXaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&Xq'UVaP!dpOv&}wx'kx!^&}!^!_(V!_;'S&};'S;=`(n<%lO&}P'pTaPOv'kw!^'k!_;'S'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Y!+q#Y;'S*V;'S;=`*s<%lO*V!R!4{Y!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!a!4t!a!b!:]!b;'S!4t;'S;=`!;r<%lO!4tq!5pV!dpOv!5kvx!6Vx!a!5k!a!b!7W!b;'S!5k;'S;=`!8V<%lO!5kP!6YTO!a!6V!a!b!6i!b;'S!6V;'S;=`!7Q<%lO!6VP!6lTO!`!6V!`!a!6{!a;'S!6V;'S;=`!7Q<%lO!6VP!7QOyPP!7TP;=`<%l!6Vq!7]V!dpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!dpyPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!b`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!b`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!b`yPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!b`!dpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!b`!dpyPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!<TXjSaP!b`!dpOr&Xrs&}sv&Xwx(tx!^&X!^!_*V!_;'S&X;'S;=`*y<%lO&X",tokenizers:[rI,iI,sI,nI,J3,eI,0,1,2,3,4,5],topRules:{Document:[0,16]},dialects:{noMatch:0,selfClosing:515},tokenPrec:517});function eA(n,e){let t=Object.create(null);for(let r of n.getChildren(HS)){let i=r.getChild(D3),s=r.getChild(cg)||r.getChild(KS);i&&(t[e.read(i.from,i.to)]=s?s.type.id==cg?e.read(s.from+1,s.to-1):e.read(s.from,s.to):"")}return t}function H1(n,e){let t=n.getChild(R3);return t?e.read(t.from,t.to):" "}function up(n,e,t){let r;for(let i of t)if(!i.attrs||i.attrs(r||(r=eA(n.node.parent.firstChild,e))))return{parser:i.parser,bracketed:!0};return null}function tA(n=[],e=[]){let t=[],r=[],i=[],s=[];for(let a of n)(a.tag=="script"?t:a.tag=="style"?r:a.tag=="textarea"?i:s).push(a);let o=e.length?Object.create(null):null;for(let a of e)(o[a.name]||(o[a.name]=[])).push(a);return bx((a,l)=>{let c=a.type.id;if(c==I3)return up(a,l,t);if(c==N3)return up(a,l,r);if(c==B3)return up(a,l,i);if(c==GS&&s.length){let u=a.node,f=u.firstChild,d=f&&H1(f,l),h;if(d){for(let m of s)if(m.tag==d&&(!m.attrs||m.attrs(h||(h=eA(f,l))))){let p=u.lastChild,v=p.type.id==z3?p.from:u.to;if(v>f.to)return{parser:m.parser,overlay:[{from:f.to,to:v}]}}}}if(o&&c==HS){let u=a.node,f;if(f=u.firstChild){let d=o[l.read(f.from,f.to)];if(d)for(let h of d){if(h.tagName&&h.tagName!=H1(u.parent,l))continue;let m=u.lastChild;if(m.type.id==cg){let p=m.from+1,v=m.lastChild,O=m.to-(v&&v.isError?0:1);if(O>p)return{parser:h.parser,overlay:[{from:p,to:O}],bracketed:!0}}else if(m.type.id==KS)return{parser:h.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}const lI=122,K1=1,cI=123,uI=124,nA=2,fI=125,dI=3,hI=4,rA=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],pI=58,mI=40,iA=95,gI=91,xf=45,vI=46,OI=35,bI=37,yI=38,wI=92,_I=10,kI=42;function Mc(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function CO(n){return n>=48&&n<=57}function J1(n){return CO(n)||n>=97&&n<=102||n>=65&&n<=70}const sA=(n,e,t)=>(r,i)=>{for(let s=!1,o=0,a=0;;a++){let{next:l}=r;if(Mc(l)||l==xf||l==iA||s&&CO(l))!s&&(l!=xf||a>0)&&(s=!0),o===a&&l==xf&&o++,r.advance();else if(l==wI&&r.peek(1)!=_I){if(r.advance(),J1(r.next)){do r.advance();while(J1(r.next));r.next==32&&r.advance()}else r.next>-1&&r.advance();s=!0}else{s&&r.acceptToken(o==2&&i.canShift(nA)?e:l==mI?t:n);break}}},xI=new Wr(sA(cI,nA,uI)),SI=new Wr(sA(fI,dI,hI)),AI=new Wr(n=>{if(rA.includes(n.peek(-1))){let{next:e}=n;(Mc(e)||e==iA||e==OI||e==vI||e==kI||e==gI||e==pI&&Mc(n.peek(1))||e==xf||e==yI)&&n.acceptToken(lI)}}),CI=new Wr(n=>{if(!rA.includes(n.peek(-1))){let{next:e}=n;if(e==bI&&(n.advance(),n.acceptToken(K1)),Mc(e)){do n.advance();while(Mc(n.next)||CO(n.next));n.acceptToken(K1)}}}),TI=Ol({"AtKeyword import charset namespace keyframes media supports":N.definitionKeyword,"from to selector":N.keyword,NamespaceName:N.namespace,KeyframeName:N.labelName,KeyframeRangeName:N.operatorKeyword,TagName:N.tagName,ClassName:N.className,PseudoClassName:N.constant(N.className),IdName:N.labelName,"FeatureName PropertyName":N.propertyName,AttributeName:N.attributeName,NumberLiteral:N.number,KeywordQuery:N.keyword,UnaryQueryOp:N.operatorKeyword,"CallTag ValueName":N.atom,VariableName:N.variableName,Callee:N.operatorKeyword,Unit:N.unit,"UniversalSelector NestingSelector":N.definitionOperator,"MatchOp CompareOp":N.compareOperator,"ChildOp SiblingOp, LogicOp":N.logicOperator,BinOp:N.arithmeticOperator,Important:N.modifier,Comment:N.blockComment,ColorLiteral:N.color,"ParenthesizedContent StringLiteral":N.string,":":N.punctuation,"PseudoOp #":N.derefOperator,"; ,":N.separator,"( )":N.paren,"[ ]":N.squareBracket,"{ }":N.brace}),PI={__proto__:null,lang:38,"nth-child":38,"nth-last-child":38,"nth-of-type":38,"nth-last-of-type":38,dir:38,"host-context":38,if:84,url:124,"url-prefix":124,domain:124,regexp:124},EI={__proto__:null,or:98,and:98,not:106,only:106,layer:170},$I={__proto__:null,selector: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#f!YQ#l![Q$v#iQ$w#jQ$z#mS%V$R%XR&i%xQ#h!YQ%w$tR&w&hR$|#mR$n#`QlPR#_zQ!_]Q!nbQ$O!gR%U$P",nodeNames:"⚠ Unit VariableName VariableName QueryCallee Comment StyleSheet RuleSet UniversalSelector TagSelector TagName NestingSelector ClassSelector . ClassName PseudoClassSelector : :: PseudoClassName PseudoClassName ) ( ArgList ValueName ParenthesizedValue AtKeyword # ; ] [ BracketedValue } { BracedValue ColorLiteral NumberLiteral StringLiteral BinaryExpression BinOp CallExpression Callee IfExpression if ArgList IfBranch KeywordQuery FeatureQuery FeatureName BinaryQuery LogicOp ComparisonQuery CompareOp UnaryQuery UnaryQueryOp ParenthesizedQuery SelectorQuery selector ParenthesizedSelector CallQuery ArgList , CallLiteral CallTag ParenthesizedContent PseudoClassName ArgList IdSelector IdName AttributeSelector AttributeName MatchOp ChildSelector ChildOp DescendantSelector SiblingSelector SiblingOp Block Declaration PropertyName Important ImportStatement import Layer layer LayerName layer MediaStatement media CharsetStatement charset NamespaceStatement namespace NamespaceName KeyframesStatement keyframes KeyframeName KeyframeList KeyframeSelector KeyframeRangeName SupportsStatement supports ScopeStatement scope to AtRule Styles",maxTerm:143,nodeProps:[["isolate",-2,5,36,""],["openedBy",20,"(",28,"[",31,"{"],["closedBy",21,")",29,"]",32,"}"]],propSources:[TI],skippedNodes:[0,5,106],repeatNodeCount:15,tokenData:"JQ~R!YOX$qX^%i^p$qpq%iqr({rs-ust/itu6Wuv$qvw7Qwx7cxy9Qyz9cz{9h{|:R|}>t}!O?V!O!P?t!P!Q@]!Q![AU![!]BP!]!^B{!^!_C^!_!`DY!`!aDm!a!b$q!b!cEn!c!}$q!}#OG{#O#P$q#P#QH^#Q#R6W#R#o$q#o#pHo#p#q6W#q#rIQ#r#sIc#s#y$q#y#z%i#z$f$q$f$g%i$g#BY$q#BY#BZ%i#BZ$IS$q$IS$I_%i$I_$I|$q$I|$JO%i$JO$JT$q$JT$JU%i$JU$KV$q$KV$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Oy%Qz;'S%Q;'S;=`%c<%lO%QjDtV!jQ!TWOy%Qz!_%Q!_!`Cu!`!aEZ!a;'S%Q;'S;=`%c<%lO%QbEbS!jQ!a`Oy%Qz;'S%Q;'S;=`%c<%lO%QjEqYOy%Qz}%Q}!OFa!O!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjFfW!a`Oy%Qz!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjGV[iY!a`Oy%Qz}%Q}!OGO!O!Q%Q!Q![GO![!c%Q!c!}GO!}#T%Q#T#oGO#o;'S%Q;'S;=`%c<%lO%QjHQSmYOy%Qz;'S%Q;'S;=`%c<%lO%QnHcSl^Oy%Qz;'S%Q;'S;=`%c<%lO%QjHtSpYOy%Qz;'S%Q;'S;=`%c<%lO%QjIVSoYOy%Qz;'S%Q;'S;=`%c<%lO%QfIhU!mQOy%Qz!_%Q!_!`6m!`;'S%Q;'S;=`%c<%lO%Q`I}P;=`<%l$q",tokenizers:[AI,CI,xI,SI,1,2,3,4,new ld("m~RRYZ[z{a~~g~aO#v~~dP!P!Qg~lO#w~~",28,129)],topRules:{StyleSheet:[0,6],Styles:[1,105]},dynamicPrecedences:{76:1},specialized:[{term:124,get:n=>PI[n]||-1},{term:125,get:n=>EI[n]||-1},{term:4,get:n=>$I[n]||-1},{term:25,get:n=>QI[n]||-1},{term:123,get:n=>LI[n]||-1}],tokenPrec:1963});let fp=null;function dp(){if(!fp&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let r in n)r!="cssText"&&r!="cssFloat"&&typeof n[r]=="string"&&(/[A-Z]/.test(r)&&(r=r.replace(/[A-Z]/g,i=>"-"+i.toLowerCase())),t.has(r)||(e.push(r),t.add(r)));fp=e.sort().map(r=>({type:"property",label:r,apply:r+": "}))}return fp||[]}const e0=["active","after","any-link","autofill","backdrop","before","checked","cue","default","defined","disabled","empty","enabled","file-selector-button","first","first-child","first-letter","first-line","first-of-type","focus","focus-visible","focus-within","fullscreen","has","host","host-context","hover","in-range","indeterminate","invalid","is","lang","last-child","last-of-type","left","link","marker","modal","not","nth-child","nth-last-child","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","part","placeholder","placeholder-shown","read-only","read-write","required","right","root","scope","selection","slotted","target","target-text","valid","visited","where"].map(n=>({type:"class",label:n})),t0=["above","absolute","activeborder","additive","activecaption","after-white-space","ahead","alias","all","all-scroll","alphabetic","alternate","always","antialiased","appworkspace","asterisks","attr","auto","auto-flow","avoid","avoid-column","avoid-page","avoid-region","axis-pan","background","backwards","baseline","below","bidi-override","blink","block","block-axis","bold","bolder","border","border-box","both","bottom","break","break-all","break-word","bullets","button","button-bevel","buttonface","buttonhighlight","buttonshadow","buttontext","calc","capitalize","caps-lock-indicator","caption","captiontext","caret","cell","center","checkbox","circle","cjk-decimal","clear","clip","close-quote","col-resize","collapse","color","color-burn","color-dodge","column","column-reverse","compact","condensed","contain","content","contents","content-box","context-menu","continuous","copy","counter","counters","cover","crop","cross","crosshair","currentcolor","cursive","cyclic","darken","dashed","decimal","decimal-leading-zero","default","default-button","dense","destination-atop","destination-in","destination-out","destination-over","difference","disc","discard","disclosure-closed","disclosure-open","document","dot-dash","dot-dot-dash","dotted","double","down","e-resize","ease","ease-in","ease-in-out","ease-out","element","ellipse","ellipsis","embed","end","ethiopic-abegede-gez","ethiopic-halehame-aa-er","ethiopic-halehame-gez","ew-resize","exclusion","expanded","extends","extra-condensed","extra-expanded","fantasy","fast","fill","fill-box","fixed","flat","flex","flex-end","flex-start","footnotes","forwards","from","geometricPrecision","graytext","grid","groove","hand","hard-light","help","hidden","hide","higher","highlight","highlighttext","horizontal","hsl","hsla","hue","icon","ignore","inactiveborder","inactivecaption","inactivecaptiontext","infinite","infobackground","infotext","inherit","initial","inline","inline-axis","inline-block","inline-flex","inline-grid","inline-table","inset","inside","intrinsic","invert","italic","justify","keep-all","landscape","large","larger","left","level","lighter","lighten","line-through","linear","linear-gradient","lines","list-item","listbox","listitem","local","logical","loud","lower","lower-hexadecimal","lower-latin","lower-norwegian","lowercase","ltr","luminosity","manipulation","match","matrix","matrix3d","medium","menu","menutext","message-box","middle","min-intrinsic","mix","monospace","move","multiple","multiple_mask_images","multiply","n-resize","narrower","ne-resize","nesw-resize","no-close-quote","no-drop","no-open-quote","no-repeat","none","normal","not-allowed","nowrap","ns-resize","numbers","numeric","nw-resize","nwse-resize","oblique","opacity","open-quote","optimizeLegibility","optimizeSpeed","outset","outside","outside-shape","overlay","overline","padding","padding-box","painted","page","paused","perspective","pinch-zoom","plus-darker","plus-lighter","pointer","polygon","portrait","pre","pre-line","pre-wrap","preserve-3d","progress","push-button","radial-gradient","radio","read-only","read-write","read-write-plaintext-only","rectangle","region","relative","repeat","repeating-linear-gradient","repeating-radial-gradient","repeat-x","repeat-y","reset","reverse","rgb","rgba","ridge","right","rotate","rotate3d","rotateX","rotateY","rotateZ","round","row","row-resize","row-reverse","rtl","run-in","running","s-resize","sans-serif","saturation","scale","scale3d","scaleX","scaleY","scaleZ","screen","scroll","scrollbar","scroll-position","se-resize","self-start","self-end","semi-condensed","semi-expanded","separate","serif","show","single","skew","skewX","skewY","skip-white-space","slide","slider-horizontal","slider-vertical","sliderthumb-horizontal","sliderthumb-vertical","slow","small","small-caps","small-caption","smaller","soft-light","solid","source-atop","source-in","source-out","source-over","space","space-around","space-between","space-evenly","spell-out","square","start","static","status-bar","stretch","stroke","stroke-box","sub","subpixel-antialiased","svg_masks","super","sw-resize","symbolic","symbols","system-ui","table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row","table-row-group","text","text-bottom","text-top","textarea","textfield","thick","thin","threeddarkshadow","threedface","threedhighlight","threedlightshadow","threedshadow","to","top","transform","translate","translate3d","translateX","translateY","translateZ","transparent","ultra-condensed","ultra-expanded","underline","unidirectional-pan","unset","up","upper-latin","uppercase","url","var","vertical","vertical-text","view-box","visible","visibleFill","visiblePainted","visibleStroke","visual","w-resize","wait","wave","wider","window","windowframe","windowtext","words","wrap","wrap-reverse","x-large","x-small","xor","xx-large","xx-small"].map(n=>({type:"keyword",label:n})).concat(["aliceblue","antiquewhite","aqua","aquamarine","azure","beige","bisque","black","blanchedalmond","blue","blueviolet","brown","burlywood","cadetblue","chartreuse","chocolate","coral","cornflowerblue","cornsilk","crimson","cyan","darkblue","darkcyan","darkgoldenrod","darkgray","darkgreen","darkkhaki","darkmagenta","darkolivegreen","darkorange","darkorchid","darkred","darksalmon","darkseagreen","darkslateblue","darkslategray","darkturquoise","darkviolet","deeppink","deepskyblue","dimgray","dodgerblue","firebrick","floralwhite","forestgreen","fuchsia","gainsboro","ghostwhite","gold","goldenrod","gray","grey","green","greenyellow","honeydew","hotpink","indianred","indigo","ivory","khaki","lavender","lavenderblush","lawngreen","lemonchiffon","lightblue","lightcoral","lightcyan","lightgoldenrodyellow","lightgray","lightgreen","lightpink","lightsalmon","lightseagreen","lightskyblue","lightslategray","lightsteelblue","lightyellow","lime","limegreen","linen","magenta","maroon","mediumaquamarine","mediumblue","mediumorchid","mediumpurple","mediumseagreen","mediumslateblue","mediumspringgreen","mediumturquoise","mediumvioletred","midnightblue","mintcream","mistyrose","moccasin","navajowhite","navy","oldlace","olive","olivedrab","orange","orangered","orchid","palegoldenrod","palegreen","paleturquoise","palevioletred","papayawhip","peachpuff","peru","pink","plum","powderblue","purple","rebeccapurple","red","rosybrown","royalblue","saddlebrown","salmon","sandybrown","seagreen","seashell","sienna","silver","skyblue","slateblue","slategray","snow","springgreen","steelblue","tan","teal","thistle","tomato","turquoise","violet","wheat","white","whitesmoke","yellow","yellowgreen"].map(n=>({type:"constant",label:n}))),qI=["a","abbr","address","article","aside","b","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","dd","del","details","dfn","dialog","div","dl","dt","em","figcaption","figure","footer","form","header","hgroup","h1","h2","h3","h4","h5","h6","hr","html","i","iframe","img","input","ins","kbd","label","legend","li","main","meter","nav","ol","output","p","pre","ruby","section","select","small","source","span","strong","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","tr","u","ul"].map(n=>({type:"type",label:n})),RI=["@charset","@color-profile","@container","@counter-style","@font-face","@font-feature-values","@font-palette-values","@import","@keyframes","@layer","@media","@namespace","@page","@position-try","@property","@scope","@starting-style","@supports","@view-transition"].map(n=>({type:"keyword",label:n})),os=/^(\w[\w-]*|-\w[\w-]*|)$/,DI=/^-(-[\w-]*)?$/;function II(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let r=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return r?.name!="Callee"?!1:e.sliceString(r.from,r.to)=="var"}const n0=new Ox,NI=["Declaration"];function BI(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function oA(n,e,t){if(e.to-e.from>4096){let r=n0.get(e);if(r)return r;let i=[],s=new Set,o=e.cursor(Zt.IncludeAnonymous);if(o.firstChild())do for(let a of oA(n,o.node,t))s.has(a.label)||(s.add(a.label),i.push(a));while(o.nextSibling());return n0.set(e,i),i}else{let r=[],i=new Set;return e.cursor().iterate(s=>{var o;if(t(s)&&s.matchContext(NI)&&((o=s.node.nextSibling)===null||o===void 0?void 0:o.name)==":"){let a=n.sliceString(s.from,s.to);i.has(a)||(i.add(a),r.push({label:a,type:"variable"}))}}),r}}const aA=n=>e=>{let{state:t,pos:r}=e,i=wn(t).resolveInner(r,-1),s=i.type.isError&&i.from==i.to-1&&t.doc.sliceString(i.from,i.to)=="-";if(i.name=="PropertyName"||(s||i.name=="TagName")&&/^(Block|Styles)$/.test(i.resolve(i.to).name))return{from:i.from,options:dp(),validFor:os};if(i.name=="ValueName")return{from:i.from,options:t0,validFor:os};if(i.name=="PseudoClassName")return{from:i.from,options:e0,validFor:os};if(n(i)||(e.explicit||s)&&II(i,t.doc))return{from:n(i)||s?i.from:r,options:oA(t.doc,BI(i),n),validFor:DI};if(i.name=="TagName"){for(let{parent:l}=i;l;l=l.parent)if(l.name=="Block")return{from:i.from,options:dp(),validFor:os};return{from:i.from,options:qI,validFor:os}}if(i.name=="AtKeyword")return{from:i.from,options:RI,validFor:os};if(!e.explicit)return null;let o=i.resolve(r),a=o.childBefore(r);return a&&a.name==":"&&o.name=="PseudoClassSelector"?{from:r,options:e0,validFor:os}:a&&a.name==":"&&o.name=="Declaration"||o.name=="ArgList"?{from:r,options:t0,validFor:os}:o.name=="Block"||o.name=="Styles"?{from:r,options:dp(),validFor:os}:null},lA=aA(n=>n.name=="VariableName"),qc=Ja.define({name:"css",parser:MI.configure({props:[bl.add({Declaration:_f()}),uu.add({"Block KeyframeList":Ax})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function cA(){return new nl(qc,qc.data.of({autocomplete:lA}))}const jI=Object.freeze(Object.defineProperty({__proto__:null,css:cA,cssCompletionSource:lA,cssLanguage:qc,defineCSSCompletionSource:aA},Symbol.toStringTag,{value:"Module"})),zI=316,ZI=317,r0=1,FI=2,XI=3,VI=4,WI=318,YI=320,UI=321,GI=5,HI=6,KI=0,fg=[9,10,11,12,13,32,133,160,5760,8192,8193,8194,8195,8196,8197,8198,8199,8200,8201,8202,8232,8233,8239,8287,12288],uA=125,JI=59,dg=47,eN=42,tN=43,nN=45,rN=60,iN=44,sN=63,oN=46,aN=91,lN=new XS({start:!1,shift(n,e){return e==GI||e==HI||e==YI?n:e==UI},strict:!1}),cN=new Wr((n,e)=>{let{next:t}=n;(t==uA||t==-1||e.context)&&n.acceptToken(WI)},{contextual:!0,fallback:!0}),uN=new Wr((n,e)=>{let{next:t}=n,r;fg.indexOf(t)>-1||t==dg&&((r=n.peek(1))==dg||r==eN)||t!=uA&&t!=JI&&t!=-1&&!e.context&&n.acceptToken(zI)},{contextual:!0}),fN=new Wr((n,e)=>{n.next==aN&&!e.context&&n.acceptToken(ZI)},{contextual:!0}),dN=new Wr((n,e)=>{let{next:t}=n;if(t==tN||t==nN){if(n.advance(),t==n.next){n.advance();let r=!e.context&&e.canShift(r0);n.acceptToken(r?r0:FI)}}else t==sN&&n.peek(1)==oN&&(n.advance(),n.advance(),(n.next<48||n.next>57)&&n.acceptToken(XI))},{contextual:!0});function hp(n,e){return n>=65&&n<=90||n>=97&&n<=122||n==95||n>=192||!e&&n>=48&&n<=57}const hN=new Wr((n,e)=>{if(n.next!=rN||!e.dialectEnabled(KI)||(n.advance(),n.next==dg))return;let t=0;for(;fg.indexOf(n.next)>-1;)n.advance(),t++;if(hp(n.next,!0)){for(n.advance(),t++;hp(n.next,!1);)n.advance(),t++;for(;fg.indexOf(n.next)>-1;)n.advance(),t++;if(n.next==iN)return;for(let r=0;;r++){if(r==7){if(!hp(n.next,!0))return;break}if(n.next!="extends".charCodeAt(r))break;n.advance(),t++}}n.acceptToken(VI,-t)}),pN=Ol({"get set async static":N.modifier,"for while do if else switch try catch finally return throw break continue default case defer":N.controlKeyword,"in of await yield void typeof delete instanceof as satisfies":N.operatorKeyword,"let var const using function class extends":N.definitionKeyword,"import export from":N.moduleKeyword,"with debugger new":N.keyword,TemplateString:N.special(N.string),super:N.atom,BooleanLiteral:N.bool,this:N.self,null:N.null,Star:N.modifier,VariableName:N.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":N.function(N.variableName),VariableDefinition:N.definition(N.variableName),Label:N.labelName,PropertyName:N.propertyName,PrivatePropertyName:N.special(N.propertyName),"CallExpression/MemberExpression/PropertyName":N.function(N.propertyName),"FunctionDeclaration/VariableDefinition":N.function(N.definition(N.variableName)),"ClassDeclaration/VariableDefinition":N.definition(N.className),"NewExpression/VariableName":N.className,PropertyDefinition:N.definition(N.propertyName),PrivatePropertyDefinition:N.definition(N.special(N.propertyName)),UpdateOp:N.updateOperator,"LineComment Hashbang":N.lineComment,BlockComment:N.blockComment,Number:N.number,String:N.string,Escape:N.escape,ArithOp:N.arithmeticOperator,LogicOp:N.logicOperator,BitOp:N.bitwiseOperator,CompareOp:N.compareOperator,RegExp:N.regexp,Equals:N.definitionOperator,Arrow:N.function(N.punctuation),": Spread":N.punctuation,"( )":N.paren,"[ ]":N.squareBracket,"{ }":N.brace,"InterpolationStart InterpolationEnd":N.special(N.brace),".":N.derefOperator,", ;":N.separator,"@":N.meta,TypeName:N.typeName,TypeDefinition:N.definition(N.typeName),"type enum interface implements namespace module declare":N.definitionKeyword,"abstract global Privacy readonly override":N.modifier,"is keyof unique infer asserts":N.operatorKeyword,JSXAttributeValue:N.attributeValue,JSXText:N.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":N.angleBracket,"JSXIdentifier JSXNameSpacedName":N.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":N.attributeName,"JSXBuiltin/JSXIdentifier":N.standard(N.tagName)}),mN={__proto__:null,export:20,as:25,from:33,default:36,async:41,function:42,in:52,out:55,const:56,extends:60,this:64,true:72,false:72,null:84,void:88,typeof:92,super:108,new:142,delete:154,yield:163,await:167,class:172,public:235,private:235,protected:235,readonly:237,instanceof:256,satisfies:259,import:292,keyof:349,unique:353,infer:359,asserts:395,is:397,abstract:417,implements:419,type:421,let:424,var:426,using:429,interface:435,enum:439,namespace:445,module:447,declare:451,global:455,defer:471,for:476,of:485,while:488,with:492,do:496,if:500,else:502,switch:506,case:512,try:518,catch:522,finally:526,return:530,throw:534,break:538,continue:542,debugger:546},gN={__proto__:null,async:129,get:131,set:133,declare:195,public:197,private:197,protected:197,static:199,abstract:201,override:203,readonly:209,accessor:211,new:401},vN={__proto__:null,"<":193},ON=il.deserialize({version:14,states:"$F|Q%TQlOOO%[QlOOO'_QpOOP(lO`OOO*zQ!0MxO'#CiO+RO#tO'#CjO+aO&jO'#CjO+oO#@ItO'#DaO.QQlO'#DgO.bQlO'#DrO%[QlO'#DzO0fQlO'#ESOOQ!0Lf'#E['#E[O1PQ`O'#EXOOQO'#Ep'#EpOOQO'#Il'#IlO1XQ`O'#GsO1dQ`O'#EoO1iQ`O'#EoO3hQ!0MxO'#JrO6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=fQ:o9_Q;W:ZQ;`:mQ<W#SR=v>SR#[WR'Z!el!tQ!r!v!y!z'`'l'm'n-e-u1o5{5}S'V!e-]U*j$|*Z*oS-Y'W'_S0U*k*qQ0^*rQ2u-cQ4v0[R4{0_R({#xQ!fQT-d'`-e]!qQ!r'`-e1o5{Q#p]R'i<VR)f$dY!uQ'`-e1o5{Q'k!rS'u!v!yS'w!z5}S-t'l'mQ-v'nR3T-uT#kZ%eS#jZ%eS%km,oU(g#h#i#lS.Y(h(iQ.^(jQ0t+^Q3Y.ZU3Z.[.]._S7S3[3]R9`7Td#^W#W#Z%h(T(^*Y+Z.T/mr#gZm#h#i#l%e(h(i(j+^.Z.[.]._3[3]7TS*]$x*bQ/t*^Q2U,oQ2l-VQ4`/pQ6q2dQ7s4aQ9W6rT=m'X+[V#aW%h*YU#`W%h*YS(U#W(^U(Z#Z+Z/mS-['X+[T.O(T.TV'^!e%i*ZQ$lfR)x$qT)m$l)nR4V/UT*_$x*bT*h${*YQ0w+fQ1g,VQ3_.fQ5t1iQ6P1qQ7X3cQ8r6SQ9c7WQ:^8qQ:p9bQ;Z:`Q;c:rQ;n;[R;q;dnqOXst!Z#d%m&r&t&u&w,s,x2[2_Q&l!VR,h&itmOXst!U!V!Z#d%m&i&r&t&u&w,s,x2[2_R,o&oT%lm,oR1k,XR,g&gQ&U|S+}&V&WR1^,OR+s&PT&p!W&sT&q!W&sT2^,x2_",nodeNames:"⚠ ArithOp ArithOp ?. JSXStartTag LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > < TypeParamList in out const TypeDefinition extends ThisType this LiteralType ArithOp Number BooleanLiteral TemplateType InterpolationEnd Interpolation InterpolationStart NullType null VoidType void TypeofType typeof MemberExpression . PropertyName [ TemplateString Escape Interpolation super RegExp ] ArrayExpression Spread , } { ObjectExpression Property async get set PropertyDefinition Block : NewTarget new NewExpression ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression TypeArgList CompareOp < declare Privacy static abstract override PrivatePropertyDefinition PropertyDeclaration readonly accessor Optional TypeAnnotation Equals StaticBlock FunctionExpression ArrowFunction ParamList ParamList ArrayPattern ObjectPattern PatternProperty Privacy readonly Arrow MemberExpression BinaryExpression ArithOp ArithOp ArithOp ArithOp BitOp CompareOp instanceof satisfies CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression InstantiationExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast < ArrowFunction TypeParamList SequenceExpression InstantiationExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate asserts is NewSignature new UnionType LogicOp IntersectionType LogicOp ConditionalType ParameterizedType ClassDeclaration abstract implements type VariableDeclaration let var using TypeAliasDeclaration InterfaceDeclaration interface EnumDeclaration enum EnumBody NamespaceDeclaration namespace module AmbientDeclaration declare GlobalDeclaration global ClassDeclaration ClassBody AmbientFunctionDeclaration ExportGroup VariableName VariableName ImportDeclaration defer ImportGroup ForStatement for ForSpec ForInSpec ForOfSpec of WhileStatement while WithStatement with DoStatement do IfStatement if else SwitchStatement switch SwitchBody CaseLabel case DefaultLabel TryStatement try CatchClause catch FinallyClause finally ReturnStatement return ThrowStatement throw BreakStatement break ContinueStatement continue DebuggerStatement debugger LabeledStatement ExpressionStatement SingleExpression SingleClassItem",maxTerm:380,context:lN,nodeProps:[["isolate",-8,5,6,14,37,39,51,53,55,""],["group",-26,9,17,19,68,207,211,215,216,218,221,224,234,237,243,245,247,249,252,258,264,266,268,270,272,274,275,"Statement",-34,13,14,32,35,36,42,51,54,55,57,62,70,72,76,80,82,84,85,110,111,120,121,136,139,141,142,143,144,145,147,148,167,169,171,"Expression",-23,31,33,37,41,43,45,173,175,177,178,180,181,182,184,185,186,188,189,190,201,203,205,206,"Type",-3,88,103,109,"ClassItem"],["openedBy",23,"<",38,"InterpolationStart",56,"[",60,"{",73,"(",160,"JSXStartCloseTag"],["closedBy",-2,24,168,">",40,"InterpolationEnd",50,"]",61,"}",74,")",165,"JSXEndTag"]],propSources:[pN],skippedNodes:[0,5,6,278],repeatNodeCount:37,tokenData:"$Fq07[R!bOX%ZXY+gYZ-yZ[+g[]%Z]^.c^p%Zpq+gqr/mrs3cst:_tuEruvJSvwLkwx! Yxy!'iyz!(sz{!)}{|!,q|}!.O}!O!,q!O!P!/Y!P!Q!9j!Q!R#:O!R![#<_![!]#I_!]!^#Jk!^!_#Ku!_!`$![!`!a$$v!a!b$*T!b!c$,r!c!}Er!}#O$-|#O#P$/W#P#Q$4o#Q#R$5y#R#SEr#S#T$7W#T#o$8b#o#p$<r#p#q$=h#q#r$>x#r#s$@U#s$f%Z$f$g+g$g#BYEr#BY#BZ$A`#BZ$ISEr$IS$I_$A`$I_$I|Er$I|$I}$Dk$I}$JO$Dk$JO$JTEr$JT$JU$A`$JU$KVEr$KV$KW$A`$KW&FUEr&FU&FV$A`&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$A`?HUOEr(n%d_$i&j(Wp(Z!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$i&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$i&j(Z!bOY&}YZ&cZw&}wx&cx!^&}!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g#p$g%Z$g;'SEr;'S;=`I|<%lOEr",tokenizers:[uN,fN,dN,hN,2,3,4,5,6,7,8,9,10,11,12,13,14,cN,new ld("$S~RRtu[#O#Pg#S#T#|~_P#o#pb~gOx~~jVO#i!P#i#j!U#j#l!P#l#m!q#m;'S!P;'S;=`#v<%lO!P~!UO!U~~!XS!Q![!e!c!i!e#T#Z!e#o#p#Z~!hR!Q![!q!c!i!q#T#Z!q~!tR!Q![!}!c!i!}#T#Z!}~#QR!Q![!P!c!i!P#T#Z!P~#^R!Q![#g!c!i#g#T#Z#g~#jS!Q![#g!c!i#g#T#Z#g#q#r!P~#yP;=`<%l!P~$RO(c~~",141,340),new ld("j~RQYZXz{^~^O(Q~~aP!P!Qd~iO(R~~",25,323)],topRules:{Script:[0,7],SingleExpression:[1,276],SingleClassItem:[2,277]},dialects:{jsx:0,ts:15175},dynamicPrecedences:{80:1,82:1,94:1,169:1,199:1},specialized:[{term:327,get:n=>mN[n]||-1},{term:343,get:n=>gN[n]||-1},{term:95,get:n=>vN[n]||-1}],tokenPrec:15201}),TO=[yr("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),yr("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),yr("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),yr("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),yr("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),yr(`try {
|
|
161
|
-
\${}
|
|
162
|
-
} catch (\${error}) {
|
|
163
|
-
\${}
|
|
164
|
-
}`,{label:"try",detail:"/ catch block",type:"keyword"}),yr("if (${}) {\n ${}\n}",{label:"if",detail:"block",type:"keyword"}),yr(`if (\${}) {
|
|
165
|
-
\${}
|
|
166
|
-
} else {
|
|
167
|
-
\${}
|
|
168
|
-
}`,{label:"if",detail:"/ else block",type:"keyword"}),yr(`class \${name} {
|
|
169
|
-
constructor(\${params}) {
|
|
170
|
-
\${}
|
|
171
|
-
}
|
|
172
|
-
}`,{label:"class",detail:"definition",type:"keyword"}),yr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),yr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],fA=TO.concat([yr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),yr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),yr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),i0=new Ox,dA=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Ml(n){return(e,t)=>{let r=e.node.getChild("VariableDefinition");return r&&t(r,n),!0}}const bN=["FunctionDeclaration"],yN={FunctionDeclaration:Ml("function"),ClassDeclaration:Ml("class"),ClassExpression:()=>!0,EnumDeclaration:Ml("constant"),TypeAliasDeclaration:Ml("type"),NamespaceDeclaration:Ml("namespace"),VariableDefinition(n,e){n.matchContext(bN)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function hA(n,e){let t=i0.get(e);if(t)return t;let r=[],i=!0;function s(o,a){let l=n.sliceString(o.from,o.to);r.push({label:l,type:a})}return e.cursor(Zt.IncludeAnonymous).iterate(o=>{if(i)i=!1;else if(o.name){let a=yN[o.name];if(a&&a(o,s)||dA.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of hA(n,o.node))r.push(a);return!1}}),i0.set(e,r),r}const ud=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,PO=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function pA(n){let e=wn(n.state).resolveInner(n.pos,-1);if(PO.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&ud.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let r=[];for(let i=e;i;i=i.parent)dA.has(i.name)&&(r=r.concat(hA(n.state.doc,i)));return{options:r,from:t?e.from:n.pos,validFor:ud}}function pp(n,e,t){var r;let i=[];for(;;){let s=e.firstChild,o;if(s?.name=="VariableName")return i.push(n(s)),{path:i.reverse(),name:t};if(s?.name=="MemberExpression"&&((r=o=s.lastChild)===null||r===void 0?void 0:r.name)=="PropertyName")i.push(n(o)),e=s;else return null}}function mA(n){let e=r=>n.state.doc.sliceString(r.from,r.to),t=wn(n.state).resolveInner(n.pos,-1);return t.name=="PropertyName"?pp(e,t.parent,e(t)):(t.name=="."||t.name=="?.")&&t.parent.name=="MemberExpression"?pp(e,t.parent,""):PO.indexOf(t.name)>-1?null:t.name=="VariableName"||t.to-t.from<20&&ud.test(e(t))?{path:[],name:e(t)}:t.name=="MemberExpression"?pp(e,t,""):n.explicit?{path:[],name:""}:null}function wN(n,e){let t=[],r=new Set;for(let i=0;;i++){for(let o of(Object.getOwnPropertyNames||Object.keys)(n)){if(!/^[a-zA-Z_$\xaa-\uffdc][\w$\xaa-\uffdc]*$/.test(o)||r.has(o))continue;r.add(o);let a;try{a=n[o]}catch{continue}t.push({label:o,type:typeof a=="function"?/^[A-Z]/.test(o)?"class":e?"function":"method":e?"variable":"property",boost:-i})}let s=Object.getPrototypeOf(n);if(!s)return t;n=s}}function _N(n){let e=new Map;return t=>{let r=mA(t);if(!r)return null;let i=n;for(let o of r.path)if(i=i[o],!i)return null;let s=e.get(i);return s||e.set(i,s=wN(i,!r.path.length)),{from:t.pos-r.name.length,options:s,validFor:ud}}}const oi=Ja.define({name:"javascript",parser:ON.configure({props:[bl.add({IfStatement:_f({except:/^\s*({|else\b)/}),TryStatement:_f({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:Mq,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),r=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:r?1:2)*n.unit},Block:Lq({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":_f({except:/^\s*{/}),JSXElement(n){let e=/^\s*<\//.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},JSXEscape(n){let e=/\s*\}/.test(n.textAfter);return n.lineIndent(n.node.from)+(e?0:n.unit)},"JSXOpenTag JSXSelfClosingTag"(n){return n.column(n.node.from)+n.unit}}),uu.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":Ax,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),gA={test:n=>/^JSX/.test(n.name),facet:rh({commentTokens:{block:{open:"{/*",close:"*/}"}}})},EO=oi.configure({dialect:"ts"},"typescript"),$O=oi.configure({dialect:"jsx",props:[nO.add(n=>n.isTop?[gA]:void 0)]}),QO=oi.configure({dialect:"jsx ts",props:[nO.add(n=>n.isTop?[gA]:void 0)]},"typescript");let vA=n=>({label:n,type:"keyword"});const OA="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(vA),kN=OA.concat(["declare","implements","private","protected","public"].map(vA));function bA(n={}){let e=n.jsx?n.typescript?QO:$O:n.typescript?EO:oi,t=n.typescript?fA.concat(kN):TO.concat(OA);return new nl(e,[oi.data.of({autocomplete:oD(PO,mS(t))}),oi.data.of({autocomplete:pA}),n.jsx?yA:[]])}function xN(n){for(;;){if(n.name=="JSXOpenTag"||n.name=="JSXSelfClosingTag"||n.name=="JSXFragmentTag")return n;if(n.name=="JSXEscape"||!n.parent)return null;n=n.parent}}function s0(n,e,t=n.length){for(let r=e?.firstChild;r;r=r.nextSibling)if(r.name=="JSXIdentifier"||r.name=="JSXBuiltin"||r.name=="JSXNamespacedName"||r.name=="JSXMemberExpression")return n.sliceString(r.from,Math.min(r.to,t));return""}const SN=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),yA=Pe.inputHandler.of((n,e,t,r,i)=>{if((SN?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||r!=">"&&r!="/"||!oi.isActiveAt(n.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c;let{head:u}=l,f=wn(o).resolveInner(u-1,-1),d;if(f.name=="JSXStartTag"&&(f=f.parent),!(o.doc.sliceString(u-1,u)!=r||f.name=="JSXAttributeValue"&&f.to>u)){if(r==">"&&f.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(r=="/"&&f.name=="JSXStartCloseTag"){let h=f.parent,m=h.parent;if(m&&h.from==u-2&&((d=s0(o.doc,m.firstChild,u))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let p=`${d}>`;return{range:me.cursor(u+p.length,-1),changes:{from:u,insert:p}}}}else if(r==">"){let h=xN(f);if(h&&h.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(d=s0(o.doc,h,u)))return{range:l,changes:{from:u,insert:`</${d}>`}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});function AN(n,e){return e||(e={parserOptions:{ecmaVersion:2019,sourceType:"module"},env:{browser:!0,node:!0,es6:!0,es2015:!0,es2017:!0,es2020:!0},rules:{}},n.getRules().forEach((t,r)=>{var i;!((i=t.meta.docs)===null||i===void 0)&&i.recommended&&(e.rules[r]=2)})),t=>{let{state:r}=t,i=[];for(let{from:s,to:o}of oi.findRegions(r)){let a=r.doc.lineAt(s),l={line:a.number-1,col:s-a.from,pos:s};for(let c of n.verify(r.sliceDoc(s,o),e))i.push(CN(c,r.doc,l))}return i}}function o0(n,e,t,r){return t.line(n+r.line).from+e+(n==1?r.col-1:-1)}function CN(n,e,t){let r=o0(n.line,n.column,e,t),i={from:r,to:n.endLine!=null&&n.endColumn!=1?o0(n.endLine,n.endColumn,e,t):r,message:n.message,source:n.ruleId?"eslint:"+n.ruleId:"eslint",severity:n.severity==1?"warning":"error"};if(n.fix){let{range:s,text:o}=n.fix,a=s[0]+t.pos-r,l=s[1]+t.pos-r;i.actions=[{name:"fix",apply(c,u){c.dispatch({changes:{from:u+a,to:u+l,insert:o},scrollIntoView:!0})}}]}return i}const Fu=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:yA,completionPath:mA,esLint:AN,javascript:bA,javascriptLanguage:oi,jsxLanguage:$O,localCompletionSource:pA,scopeCompletionSource:_N,snippets:TO,tsxLanguage:QO,typescriptLanguage:EO,typescriptSnippets:fA},Symbol.toStringTag,{value:"Module"})),ql=["_blank","_self","_top","_parent"],mp=["ascii","utf-8","utf-16","latin1","latin1"],gp=["get","post","put","delete"],vp=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],qr=["true","false"],Fe={},TN={a:{attrs:{href:null,ping:null,type:null,media:null,target:ql,hreflang:null}},abbr:Fe,address:Fe,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Fe,aside:Fe,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Fe,base:{attrs:{href:null,target:ql}},bdi:Fe,bdo:Fe,blockquote:{attrs:{cite:null}},body:Fe,br:Fe,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:vp,formmethod:gp,formnovalidate:["novalidate"],formtarget:ql,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Fe,center:Fe,cite:Fe,code:Fe,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Fe,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Fe,div:Fe,dl:Fe,dt:Fe,em:Fe,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Fe,figure:Fe,footer:Fe,form:{attrs:{action:null,name:null,"accept-charset":mp,autocomplete:["on","off"],enctype:vp,method:gp,novalidate:["novalidate"],target:ql}},h1:Fe,h2:Fe,h3:Fe,h4:Fe,h5:Fe,h6:Fe,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Fe,hgroup:Fe,hr:Fe,html:{attrs:{manifest:null}},i:Fe,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:vp,formmethod:gp,formnovalidate:["novalidate"],formtarget:ql,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Fe,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Fe,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Fe,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:mp,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Fe,noscript:Fe,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Fe,param:{attrs:{name:null,value:null}},pre:Fe,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Fe,rt:Fe,ruby:Fe,samp:Fe,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:mp}},section:Fe,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Fe,source:{attrs:{src:null,type:null,media:null}},span:Fe,strong:Fe,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Fe,summary:Fe,sup:Fe,table:Fe,tbody:Fe,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Fe,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Fe,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Fe,time:{attrs:{datetime:null}},title:Fe,tr:Fe,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Fe,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Fe},wA={accesskey:null,class:null,contenteditable:qr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:qr,autocorrect:qr,autocapitalize:qr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":qr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":qr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":qr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":qr,"aria-hidden":qr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":qr,"aria-multiselectable":qr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":qr,"aria-relevant":null,"aria-required":qr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},_A="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(n=>"on"+n);for(let n of _A)wA[n]=null;class Rc{constructor(e,t){this.tags={...TN,...e},this.globalAttrs={...wA,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Rc.default=new Rc;function sl(n,e,t=n.length){if(!e)return"";let r=e.firstChild,i=r&&r.getChild("TagName");return i?n.sliceString(i.from,Math.min(i.to,t)):""}function ol(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function kA(n,e,t){let r=t.tags[sl(n,ol(e))];return r?.children||t.allTags}function LO(n,e){let t=[];for(let r=ol(e);r&&!r.type.isTop;r=ol(r.parent)){let i=sl(n,r);if(i&&r.lastChild.name=="CloseTag")break;i&&t.indexOf(i)<0&&(e.name=="EndTag"||e.from>=r.firstChild.to)&&t.push(i)}return t}const xA=/^[:\-\.\w\u00b7-\uffff]*$/;function a0(n,e,t,r,i){let s=/\s*>/.test(n.sliceDoc(i,i+5))?"":">",o=ol(t,t.name=="StartTag"||t.name=="TagName");return{from:r,to:i,options:kA(n.doc,o,e).map(a=>({label:a,type:"type"})).concat(LO(n.doc,t).map((a,l)=>({label:"/"+a,apply:"/"+a+s,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function l0(n,e,t,r){let i=/\s*>/.test(n.sliceDoc(r,r+5))?"":">";return{from:t,to:r,options:LO(n.doc,e).map((s,o)=>({label:s,apply:s+i,type:"type",boost:99-o})),validFor:xA}}function PN(n,e,t,r){let i=[],s=0;for(let o of kA(n.doc,t,e))i.push({label:"<"+o,type:"type"});for(let o of LO(n.doc,t))i.push({label:"</"+o+">",type:"type",boost:99-s++});return{from:r,to:r,options:i,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function EN(n,e,t,r,i){let s=ol(t),o=s?e.tags[sl(n.doc,s)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:r,to:i,options:l.map(c=>({label:c,type:"property"})),validFor:xA}}function $N(n,e,t,r,i){var s;let o=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),a=[],l;if(o){let c=n.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let f=ol(t),d=f?e.tags[sl(n.doc,f)]:null;u=d?.attrs&&d.attrs[c]}if(u){let f=n.sliceDoc(r,i).toLowerCase(),d='"',h='"';/^['"]/.test(f)?(l=f[0]=='"'?/^[^"]*$/:/^[^']*$/,d="",h=n.sliceDoc(i,i+1)==f[0]?"":f[0],f=f.slice(1),r++):l=/^[^\s<>='"]*$/;for(let m of u)a.push({label:m,apply:d+m+h,type:"constant"})}}return{from:r,to:i,options:a,validFor:l}}function SA(n,e){let{state:t,pos:r}=e,i=wn(t).resolveInner(r,-1),s=i.resolve(r);for(let o=r,a;s==i&&(a=i.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;s=i=a,o=l.from}return i.name=="TagName"?i.parent&&/CloseTag$/.test(i.parent.name)?l0(t,i,i.from,r):a0(t,n,i,i.from,r):i.name=="StartTag"||i.name=="IncompleteTag"?a0(t,n,i,r,r):i.name=="StartCloseTag"||i.name=="IncompleteCloseTag"?l0(t,i,r,r):i.name=="OpenTag"||i.name=="SelfClosingTag"||i.name=="AttributeName"?EN(t,n,i,i.name=="AttributeName"?i.from:r,r):i.name=="Is"||i.name=="AttributeValue"||i.name=="UnquotedAttributeValue"?$N(t,n,i,i.name=="Is"?r:i.from,r):e.explicit&&(s.name=="Element"||s.name=="Text"||s.name=="Document")?PN(t,n,i,r):null}function AA(n){return SA(Rc.default,n)}function CA(n){let{extraTags:e,extraGlobalAttributes:t}=n,r=t||e?new Rc(e,t):Rc.default;return i=>SA(r,i)}const QN=oi.parser.configure({top:"SingleExpression"}),TA=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:EO.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:$O.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:QO.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:QN},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:oi.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:qc.parser}],PA=[{name:"style",parser:qc.parser.configure({top:"Styles"})}].concat(_A.map(n=>({name:n,parser:oi.parser}))),EA=Ja.define({name:"html",parser:aI.configure({props:[bl.add({Element(n){let e=/^(\s*)(<\/)?/.exec(n.textAfter);return n.node.to<=n.pos+e[0].length?n.continue():n.lineIndent(n.node.from)+(e[2]?0:n.unit)},"OpenTag CloseTag SelfClosingTag"(n){return n.column(n.node.from)+n.unit},Document(n){if(n.pos+/\s*/.exec(n.textAfter)[0].length<n.node.to)return n.continue();let e=null,t;for(let r=n.node;;){let i=r.lastChild;if(!i||i.name!="Element"||i.to!=r.to)break;e=r=i}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?n.lineIndent(e.from)+n.unit:null}}),uu.add({Element(n){let e=n.firstChild,t=n.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:n.to}}}),Px.add({"OpenTag CloseTag":n=>n.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),hc=EA.configure({wrap:tA(TA,PA)});function $A(n={}){let e="",t;n.matchClosingTags===!1&&(e="noMatch"),n.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(n.nestedLanguages&&n.nestedLanguages.length||n.nestedAttributes&&n.nestedAttributes.length)&&(t=tA((n.nestedLanguages||[]).concat(TA),(n.nestedAttributes||[]).concat(PA)));let r=t?EA.configure({wrap:t,dialect:e}):e?hc.configure({dialect:e}):hc;return new nl(r,[hc.data.of({autocomplete:CA(n)}),n.autoCloseTags!==!1?QA:[],bA().support,cA().support])}const c0=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),QA=Pe.inputHandler.of((n,e,t,r,i)=>{if(n.composing||n.state.readOnly||e!=t||r!=">"&&r!="/"||!hc.isActiveAt(n.state,e,-1))return!1;let s=i(),{state:o}=s,a=o.changeByRange(l=>{var c,u,f;let d=o.doc.sliceString(l.from-1,l.to)==r,{head:h}=l,m=wn(o).resolveInner(h,-1),p;if(d&&r==">"&&m.name=="EndTag"){let v=m.parent;if(((u=(c=v.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(p=sl(o.doc,v.parent,h))&&!c0.has(p)){let O=h+(o.doc.sliceString(h,h+1)===">"?1:0),b=`</${p}>`;return{range:l,changes:{from:h,to:O,insert:b}}}}else if(d&&r=="/"&&m.name=="IncompleteCloseTag"){let v=m.parent;if(m.from==h-2&&((f=v.lastChild)===null||f===void 0?void 0:f.name)!="CloseTag"&&(p=sl(o.doc,v,h))&&!c0.has(p)){let O=h+(o.doc.sliceString(h,h+1)===">"?1:0),b=`${p}>`;return{range:me.cursor(h+b.length,-1),changes:{from:h,to:O,insert:b}}}}return{range:l}});return a.changes.empty?!1:(n.dispatch([s,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),LN=Object.freeze(Object.defineProperty({__proto__:null,autoCloseTags:QA,html:$A,htmlCompletionSource:AA,htmlCompletionSourceWith:CA,htmlLanguage:hc},Symbol.toStringTag,{value:"Module"})),LA=rh({commentTokens:{block:{open:"<!--",close:"-->"}}}),MA=new et,qA=t3.configure({props:[uu.add(n=>!n.is("Block")||n.is("Document")||hg(n)!=null||MN(n)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),MA.add(hg),bl.add({Document:()=>null}),Xs.add({Document:LA})]});function hg(n){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(n.name);return e?+e[1]:void 0}function MN(n){return n.name=="OrderedList"||n.name=="BulletList"}function qN(n,e){let t=n;for(;;){let r=t.nextSibling,i;if(!r||(i=hg(r.type))!=null&&i<=e)break;t=r}return t.to}const RN=qq.of((n,e,t)=>{for(let r=wn(n).resolveInner(t,-1);r&&!(r.from<e);r=r.parent){let i=r.type.prop(MA);if(i==null)continue;let s=qN(r,i);if(s>t)return{from:t,to:s}}return null});function MO(n){return new Zr(LA,n,[],"markdown")}const RA=MO(qA),DN=qA.configure([d3,p3,h3,m3,{props:[uu.add({Table:(n,e)=>({from:e.doc.lineAt(n.from).to,to:n.to})})]}]),Dc=MO(DN);function IN(n,e){return t=>{if(t&&n){let r=null;if(t=/\S*/.exec(t)[0],typeof n=="function"?r=n(t):r=ee.matchLanguageName(n,t,!0),r instanceof ee)return r.support?r.support.language.parser:Go.getSkippingParser(r.load());if(r)return r.parser}return e?e.parser:null}}class Op{constructor(e,t,r,i,s,o,a){this.node=e,this.from=t,this.to=r,this.spaceBefore=i,this.spaceAfter=s,this.type=o,this.item=a}blank(e,t=!0){let r=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;r.length<e;)r+=" ";return r}else{for(let i=this.to-this.from-r.length-this.spaceAfter.length;i>0;i--)r+=" ";return r+(t?this.spaceAfter:"")}}marker(e,t){let r=this.node.name=="OrderedList"?String(+IA(this.item,e)[2]+t):"";return this.spaceBefore+r+this.type+this.spaceAfter}}function DA(n,e){let t=[],r=[];for(let i=n;i;i=i.parent){if(i.name=="FencedCode")return r;(i.name=="ListItem"||i.name=="Blockquote")&&t.push(i)}for(let i=t.length-1;i>=0;i--){let s=t[i],o,a=e.lineAt(s.from),l=s.from-a.from;if(s.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))r.push(new Op(s,l,l+o[0].length,"",o[1],">",null));else if(s.name=="ListItem"&&s.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),r.push(new Op(s.parent,l,l+u,o[1],c,o[2],s))}else if(s.name=="ListItem"&&s.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let f=o[2];o[3]&&(f+=o[3].replace(/[xX]/," ")),r.push(new Op(s.parent,l,l+u,o[1],c,f,s))}}return r}function IA(n,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(n.from,n.from+10))}function bp(n,e,t,r=0){for(let i=-1,s=n;;){if(s.name=="ListItem"){let a=IA(s,e),l=+a[2];if(i>=0){if(l!=i+1)return;t.push({from:s.from+a[1].length,to:s.from+a[0].length,insert:String(i+2+r)})}i=l}let o=s.nextSibling;if(!o)break;s=o}}function qO(n,e){let t=/^[ \t]*/.exec(n)[0].length;if(!t||e.facet(cu)!=" ")return n;let r=xs(n,4,t),i="";for(let s=r;s>0;)s>=4?(i+=" ",s-=4):(i+=" ",s--);return i+n.slice(t)}const NA=(n={})=>({state:e,dispatch:t})=>{let r=wn(e),{doc:i}=e,s=null,o=e.changeByRange(a=>{if(!a.empty||!Dc.isActiveAt(e,a.from,-1)&&!Dc.isActiveAt(e,a.from,1))return s={range:a};let l=a.from,c=i.lineAt(l),u=DA(r.resolveInner(l,-1),i);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return s={range:a};let f=u[u.length-1];if(f.to-f.spaceAfter.length>l-c.from)return s={range:a};let d=l>=f.to-f.spaceAfter.length&&!/\S/.test(c.text.slice(f.to));if(f.item&&d){let O=f.node.firstChild,b=f.node.getChild("ListItem","ListItem");if(O.to>=l||b&&b.to<l||c.from>0&&!/[^\s>]/.test(i.lineAt(c.from-1).text)||n.nonTightLists===!1){let w=u.length>1?u[u.length-2]:null,S,_="";w&&w.item?(S=c.from+w.from,_=w.marker(i,1)):S=c.from+(w?w.to:0);let x=[{from:S,to:l,insert:_}];return f.node.name=="OrderedList"&&bp(f.item,i,x,-2),w&&w.node.name=="OrderedList"&&bp(w.item,i,x),{range:me.cursor(S+_.length),changes:x}}else{let w=f0(u,e,c);return{range:me.cursor(l+w.length+1),changes:{from:c.from,insert:w+e.lineBreak}}}}if(f.node.name=="Blockquote"&&d&&c.from){let O=i.lineAt(c.from-1),b=/>\s*$/.exec(O.text);if(b&&b.index==f.from){let w=e.changes([{from:O.from+b.index,to:O.to},{from:c.from+f.from,to:c.to}]);return{range:a.map(w),changes:w}}}let h=[];f.node.name=="OrderedList"&&bp(f.item,i,h);let m=f.item&&f.item.from<c.from,p="";if(!m||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=f.to)for(let O=0,b=u.length-1;O<=b;O++)p+=O==b&&!m?u[O].marker(i,1):u[O].blank(O<b?xs(c.text,4,u[O+1].from)-p.length:null);let v=l;for(;v>c.from&&/\s/.test(c.text.charAt(v-c.from-1));)v--;return p=qO(p,e),NN(f.node,e.doc)&&(p=f0(u,e,c)+e.lineBreak+p),h.push({from:v,to:l,insert:e.lineBreak+p}),{range:me.cursor(v+p.length+1),changes:h}});return s?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},BA=NA();function u0(n){return n.name=="QuoteMark"||n.name=="ListMark"}function NN(n,e){if(n.name!="OrderedList"&&n.name!="BulletList")return!1;let t=n.firstChild,r=n.getChild("ListItem","ListItem");if(!r)return!1;let i=e.lineAt(t.to),s=e.lineAt(r.from),o=/^[\s>]*$/.test(i.text);return i.number+(o?0:1)<s.number}function f0(n,e,t){let r="";for(let i=0,s=n.length-2;i<=s;i++)r+=n[i].blank(i<s?xs(t.text,4,n[i+1].from)-r.length:null,i<s);return qO(r,e)}function BN(n,e){let t=n.resolveInner(e,-1),r=e;u0(t)&&(r=t.from,t=t.parent);for(let i;i=t.childBefore(r);)if(u0(i))r=i.from;else if(i.name=="OrderedList"||i.name=="BulletList")t=i.lastChild,r=t.to;else break;return t}const jA=({state:n,dispatch:e})=>{let t=wn(n),r=null,i=n.changeByRange(s=>{let o=s.from,{doc:a}=n;if(s.empty&&Dc.isActiveAt(n,s.from)){let l=a.lineAt(o),c=DA(BN(t,o),a);if(c.length){let u=c[c.length-1],f=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>f&&!/\S/.test(l.text.slice(f,o-l.from)))return{range:me.cursor(l.from+f),changes:{from:l.from+f,to:o}};if(o-l.from==f&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let d=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let h=u.blank(xs(l.text,4,u.to)-xs(l.text,4,u.from));return d==l.from&&(h=qO(h,n)),{range:me.cursor(d+h.length),changes:{from:d,to:l.from+u.to,insert:h}}}if(d<o)return{range:me.cursor(d),changes:{from:d,to:o}}}}}return r={range:s}});return r?!1:(e(n.update(i,{scrollIntoView:!0,userEvent:"delete"})),!0)},zA=[{key:"Enter",run:BA},{key:"Backspace",run:jA}],ZA=$A({matchClosingTags:!1});function al(n={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:r=!0,base:{parser:i}=RA,completeHTMLTags:s=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=ZA}=n;if(!(i instanceof ch))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=n.extensions?[n.extensions]:[],c=[a.support,RN],u;o&&c.push(FA),t instanceof nl?(c.push(t.support),u=t.language):t&&(u=t);let f=e||u?IN(e,u):void 0;l.push(r3({codeParser:f,htmlParser:a.language.parser})),r&&c.push(co.high(na.of(zA)));let d=MO(i.configure(l));return s&&c.push(d.data.of({autocomplete:jN})),new nl(d,c)}function jN(n){let{state:e,pos:t}=n,r=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!r)return null;let i=wn(e).resolveInner(t,-1);for(;i&&!i.type.isTop;){if(i.name=="CodeBlock"||i.name=="FencedCode"||i.name=="ProcessingInstructionBlock"||i.name=="CommentBlock"||i.name=="Link"||i.name=="Image")return null;i=i.parent}return{from:t-r[0].length,to:t,options:zN(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let yp=null;function zN(){if(yp)return yp;let n=AA(new hO(Pt.create({extensions:ZA}),0,!0));return yp=n?n.options:[]}const ZN=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,FA=Pe.domEventHandlers({paste:(n,e)=>{var t;let{main:r}=e.state.selection;if(r.empty)return!1;let i=(t=n.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!i||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(i)||(/^www\./.test(i)&&(i="https://"+i),!Dc.isActiveAt(e.state,r.from,1)))return!1;let s=wn(e.state),o=!1;return s.iterate({from:r.from,to:r.to,enter:a=>{(a.from>r.from||ZN.test(a.name))&&(o=!0)},leave:a=>{a.to<r.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:r.from,insert:"["},{from:r.to,insert:`](${i})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),FN=Object.freeze(Object.defineProperty({__proto__:null,commonmarkLanguage:RA,deleteMarkupBackward:jA,insertNewlineContinueMarkup:BA,insertNewlineContinueMarkupCommand:NA,markdown:al,markdownKeymap:zA,markdownLanguage:Dc,pasteURLAsLink:FA},Symbol.toStringTag,{value:"Module"})),d0=typeof String.prototype.normalize=="function"?n=>n.normalize("NFKD"):n=>n;class ll{constructor(e,t,r=0,i=e.length,s,o){this.test=o,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(r,i),this.bufferStart=r,this.normalize=s?a=>s(d0(a)):d0,this.query=this.normalize(t)}peek(){if(this.bufferPos==this.buffer.length){if(this.bufferStart+=this.buffer.length,this.iter.next(),this.iter.done)return-1;this.bufferPos=0,this.buffer=this.iter.value}return Ns(this.buffer,this.bufferPos)}next(){for(;this.matches.length;)this.matches.pop();return this.nextOverlapping()}nextOverlapping(){for(;;){let e=this.peek();if(e<0)return this.done=!0,this;let t=e2(e),r=this.bufferStart+this.bufferPos;this.bufferPos+=ko(e);let i=this.normalize(t);if(i.length)for(let s=0,o=r;;s++){let a=i.charCodeAt(s),l=this.match(a,o,this.bufferPos+this.bufferStart);if(s==i.length-1){if(l)return this.value=l,this;break}o==r&&s<t.length&&t.charCodeAt(s)==a&&o++}}}match(e,t,r){let i=null;for(let s=0;s<this.matches.length;s+=2){let o=this.matches[s],a=!1;this.query.charCodeAt(o)==e&&(o==this.query.length-1?i={from:this.matches[s+1],to:r}:(this.matches[s]++,a=!0)),a||(this.matches.splice(s,2),s-=2)}return this.query.charCodeAt(0)==e&&(this.query.length==1?i={from:t,to:r}:this.matches.push(1,t)),i&&this.test&&!this.test(i.from,i.to,this.buffer,this.bufferStart)&&(i=null),i}}typeof Symbol<"u"&&(ll.prototype[Symbol.iterator]=function(){return this});const XA={from:-1,to:-1,match:/.*/.exec("")},RO="gm"+(/x/.unicode==null?"":"u");class VA{constructor(e,t,r,i=0,s=e.length){if(this.text=e,this.to=s,this.curLine="",this.done=!1,this.value=XA,/\\[sWDnr]|\n|\r|\[\^/.test(t))return new WA(e,t,r,i,s);this.re=new RegExp(t,RO+(r?.ignoreCase?"i":"")),this.test=r?.test,this.iter=e.iter();let o=e.lineAt(i);this.curLineStart=o.from,this.matchPos=fd(e,i),this.getLine(this.curLineStart)}getLine(e){this.iter.next(e),this.iter.lineBreak?this.curLine="":(this.curLine=this.iter.value,this.curLineStart+this.curLine.length>this.to&&(this.curLine=this.curLine.slice(0,this.to-this.curLineStart)),this.iter.next())}nextLine(){this.curLineStart=this.curLineStart+this.curLine.length+1,this.curLineStart>this.to?this.curLine="":this.getLine(0)}next(){for(let e=this.matchPos-this.curLineStart;;){this.re.lastIndex=e;let t=this.matchPos<=this.to&&this.re.exec(this.curLine);if(t){let r=this.curLineStart+t.index,i=r+t[0].length;if(this.matchPos=fd(this.text,i+(r==i?1:0)),r==this.curLineStart+this.curLine.length&&this.nextLine(),(r<i||r>this.value.to)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length<this.to)this.nextLine(),e=0;else return this.done=!0,this}}}const wp=new WeakMap;class ja{constructor(e,t){this.from=e,this.text=t}get to(){return this.from+this.text.length}static get(e,t,r){let i=wp.get(e);if(!i||i.from>=r||i.to<=t){let a=new ja(t,e.sliceString(t,r));return wp.set(e,a),a}if(i.from==t&&i.to==r)return i;let{text:s,from:o}=i;return o>t&&(s=e.sliceString(t,o)+s,o=t),i.to<r&&(s+=e.sliceString(i.to,r)),wp.set(e,new ja(o,s)),new ja(t,s.slice(t-o,r-o))}}class WA{constructor(e,t,r,i,s){this.text=e,this.to=s,this.done=!1,this.value=XA,this.matchPos=fd(e,i),this.re=new RegExp(t,RO+(r?.ignoreCase?"i":"")),this.test=r?.test,this.flat=ja.get(e,i,this.chunkEnd(i+5e3))}chunkEnd(e){return e>=this.to?this.to:this.text.lineAt(e).to}next(){for(;;){let e=this.re.lastIndex=this.matchPos-this.flat.from,t=this.re.exec(this.flat.text);if(t&&!t[0]&&t.index==e&&(this.re.lastIndex=e+1,t=this.re.exec(this.flat.text)),t){let r=this.flat.from+t.index,i=r+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(r,i,t)))return this.value={from:r,to:i,match:t},this.matchPos=fd(this.text,i+(r==i?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=ja.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(VA.prototype[Symbol.iterator]=WA.prototype[Symbol.iterator]=function(){return this});function XN(n){try{return new RegExp(n,RO),!0}catch{return!1}}function fd(n,e){if(e>=n.length)return e;let t=n.lineAt(e),r;for(;e<t.to&&(r=t.text.charCodeAt(e-t.from))>=56320&&r<57344;)e++;return e}const VN=n=>{let{state:e}=n,t=String(e.doc.lineAt(n.state.selection.main.head).number),{close:r,result:i}=ZM(n,{label:e.phrase("Go to line"),input:{type:"text",name:"line",value:t},focus:!0,submitLabel:e.phrase("go")});return i.then(s=>{let o=s&&/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(s.elements.line.value);if(!o){n.dispatch({effects:r});return}let a=e.doc.lineAt(e.selection.main.head),[,l,c,u,f]=o,d=u?+u.slice(1):0,h=c?+c:a.number;if(c&&f){let v=h/100;l&&(v=v*(l=="-"?-1:1)+a.number/e.doc.lines),h=Math.round(e.doc.lines*v)}else c&&l&&(h=h*(l=="-"?-1:1)+a.number);let m=e.doc.line(Math.max(1,Math.min(e.doc.lines,h))),p=me.cursor(m.from+Math.max(0,Math.min(d,m.length)));n.dispatch({effects:[r,Pe.scrollIntoView(p.from,{y:"center"})],selection:p})}),!0},WN={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},YN=Ie.define({combine(n){return iu(n,WN,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function YA(n){return[JN,KN]}const UN=ft.mark({class:"cm-selectionMatch"}),GN=ft.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function h0(n,e,t,r){return(t==0||n(e.sliceDoc(t-1,t))!=Tn.Word)&&(r==e.doc.length||n(e.sliceDoc(r,r+1))!=Tn.Word)}function HN(n,e,t,r){return n(e.sliceDoc(t,t+1))==Tn.Word&&n(e.sliceDoc(r-1,r))==Tn.Word}const KN=pr.fromClass(class{constructor(n){this.decorations=this.getDeco(n)}update(n){(n.selectionSet||n.docChanged||n.viewportChanged)&&(this.decorations=this.getDeco(n.view))}getDeco(n){let e=n.state.facet(YN),{state:t}=n,r=t.selection;if(r.ranges.length>1)return ft.none;let i=r.main,s,o=null;if(i.empty){if(!e.highlightWordAroundCursor)return ft.none;let l=t.wordAt(i.head);if(!l)return ft.none;o=t.charCategorizer(i.head),s=t.sliceDoc(l.from,l.to)}else{let l=i.to-i.from;if(l<e.minSelectionLength||l>200)return ft.none;if(e.wholeWords){if(s=t.sliceDoc(i.from,i.to),o=t.charCategorizer(i.head),!(h0(o,t,i.from,i.to)&&HN(o,t,i.from,i.to)))return ft.none}else if(s=t.sliceDoc(i.from,i.to),!s)return ft.none}let a=[];for(let l of n.visibleRanges){let c=new ll(t.doc,s,l.from,l.to);for(;!c.next().done;){let{from:u,to:f}=c.value;if((!o||h0(o,t,u,f))&&(i.empty&&u<=i.from&&f>=i.to?a.push(GN.range(u,f)):(u>=i.to||f<=i.from)&&a.push(UN.range(u,f)),a.length>e.maxMatches))return ft.none}}return ft.set(a)}},{decorations:n=>n.decorations}),JN=Pe.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),e4=({state:n,dispatch:e})=>{let{selection:t}=n,r=me.create(t.ranges.map(i=>n.wordAt(i.head)||me.cursor(i.head)),t.mainIndex);return r.eq(t)?!1:(e(n.update({selection:r})),!0)};function t4(n,e){let{main:t,ranges:r}=n.selection,i=n.wordAt(t.head),s=i&&i.from==t.from&&i.to==t.to;for(let o=!1,a=new ll(n.doc,e,r[r.length-1].to);;)if(a.next(),a.done){if(o)return null;a=new ll(n.doc,e,0,Math.max(0,r[r.length-1].from-1)),o=!0}else{if(o&&r.some(l=>l.from==a.value.from))continue;if(s){let l=n.wordAt(a.value.from);if(!l||l.from!=a.value.from||l.to!=a.value.to)continue}return a.value}}const n4=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return e4({state:n,dispatch:e});let r=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=r))return!1;let i=t4(n,r);return i?(e(n.update({selection:n.selection.addRange(me.range(i.from,i.to),!1),effects:Pe.scrollIntoView(i.to)})),!0):!1},kl=Ie.define({combine(n){return iu(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new m4(e),scrollToMatch:e=>Pe.scrollIntoView(e)})}});class UA{constructor(e){this.search=e.search,this.caseSensitive=!!e.caseSensitive,this.literal=!!e.literal,this.regexp=!!e.regexp,this.replace=e.replace||"",this.valid=!!this.search&&(!this.regexp||XN(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord,this.test=e.test}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,r)=>r=="n"?`
|
|
173
|
-
`:r=="r"?"\r":r=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord&&this.test==e.test}create(){return this.regexp?new l4(this):new s4(this)}getCursor(e,t=0,r){let i=e.doc?e:Pt.create({doc:e});return r==null&&(r=i.doc.length),this.regexp?va(this,i,t,r):ga(this,i,t,r)}}class GA{constructor(e){this.spec=e}}function r4(n,e,t){return(r,i,s,o)=>{if(t&&!t(r,i,s,o))return!1;let a=r>=o&&i<=o+s.length?s.slice(r-o,i-o):e.doc.sliceString(r,i);return n(a,e,r,i)}}function ga(n,e,t,r){let i;return n.wholeWord&&(i=i4(e.doc,e.charCategorizer(e.selection.main.head))),n.test&&(i=r4(n.test,e,i)),new ll(e.doc,n.unquoted,t,r,n.caseSensitive?void 0:s=>s.toLowerCase(),i)}function i4(n,e){return(t,r,i,s)=>((s>t||s+i.length<r)&&(s=Math.max(0,t-2),i=n.sliceString(s,Math.min(n.length,r+2))),(e(dd(i,t-s))!=Tn.Word||e(hd(i,t-s))!=Tn.Word)&&(e(hd(i,r-s))!=Tn.Word||e(dd(i,r-s))!=Tn.Word))}class s4 extends GA{constructor(e){super(e)}nextMatch(e,t,r){let i=ga(this.spec,e,r,e.doc.length).nextOverlapping();if(i.done){let s=Math.min(e.doc.length,t+this.spec.unquoted.length);i=ga(this.spec,e,0,s).nextOverlapping()}return i.done||i.value.from==t&&i.value.to==r?null:i.value}prevMatchInRange(e,t,r){for(let i=r;;){let s=Math.max(t,i-1e4-this.spec.unquoted.length),o=ga(this.spec,e,s,i),a=null;for(;!o.nextOverlapping().done;)a=o.value;if(a)return a;if(s==t)return null;i-=1e4}}prevMatch(e,t,r){let i=this.prevMatchInRange(e,0,t);return i||(i=this.prevMatchInRange(e,Math.max(0,r-this.spec.unquoted.length),e.doc.length)),i&&(i.from!=t||i.to!=r)?i:null}getReplacement(e){return this.spec.unquote(this.spec.replace)}matchAll(e,t){let r=ga(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=ga(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(r+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}function o4(n,e,t){return(r,i,s)=>(!t||t(r,i,s))&&n(s[0],e,r,i)}function va(n,e,t,r){let i;return n.wholeWord&&(i=a4(e.charCategorizer(e.selection.main.head))),n.test&&(i=o4(n.test,e,i)),new VA(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:i},t,r)}function dd(n,e){return n.slice(Fn(n,e,!1),e)}function hd(n,e){return n.slice(e,Fn(n,e))}function a4(n){return(e,t,r)=>!r[0].length||(n(dd(r.input,r.index))!=Tn.Word||n(hd(r.input,r.index))!=Tn.Word)&&(n(hd(r.input,r.index+r[0].length))!=Tn.Word||n(dd(r.input,r.index+r[0].length))!=Tn.Word)}class l4 extends GA{nextMatch(e,t,r){let i=va(this.spec,e,r,e.doc.length).next();return i.done&&(i=va(this.spec,e,0,t).next()),i.done?null:i.value}prevMatchInRange(e,t,r){for(let i=1;;i++){let s=Math.max(t,r-i*1e4),o=va(this.spec,e,s,r),a=null;for(;!o.next().done;)a=o.value;if(a&&(s==t||a.from>s+10))return a;if(s==t)return null}}prevMatch(e,t,r){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,r,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&]|\d+)/g,(t,r)=>{if(r=="&")return e.match[0];if(r=="$")return"$";for(let i=r.length;i>0;i--){let s=+r.slice(0,i);if(s>0&&s<e.match.length)return e.match[s]+r.slice(i)}return t})}matchAll(e,t){let r=va(this.spec,e,0,e.doc.length),i=[];for(;!r.next().done;){if(i.length>=t)return null;i.push(r.value)}return i}highlight(e,t,r,i){let s=va(this.spec,e,Math.max(0,t-250),Math.min(r+250,e.doc.length));for(;!s.next().done;)i(s.value.from,s.value.to)}}const Ic=Qt.define(),DO=Qt.define(),Hs=ui.define({create(n){return new _p(pg(n).create(),null)},update(n,e){for(let t of e.effects)t.is(Ic)?n=new _p(t.value.create(),n.panel):t.is(DO)&&(n=new _p(n.query,t.value?IO:null));return n},provide:n=>Hf.from(n,e=>e.panel)});class _p{constructor(e,t){this.query=e,this.panel=t}}const c4=ft.mark({class:"cm-searchMatch"}),u4=ft.mark({class:"cm-searchMatch cm-searchMatch-selected"}),f4=pr.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(Hs))}update(n){let e=n.state.field(Hs);(e!=n.startState.field(Hs)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return ft.none;let{view:t}=this,r=new Vo;for(let i=0,s=t.visibleRanges,o=s.length;i<o;i++){let{from:a,to:l}=s[i];for(;i<o-1&&l>s[i+1].from-500;)l=s[++i].to;n.highlight(t.state,a,l,(c,u)=>{let f=t.state.selection.ranges.some(d=>d.from==c&&d.to==u);r.add(c,u,f?u4:c4)})}return r.finish()}},{decorations:n=>n.decorations});function hu(n){return e=>{let t=e.state.field(Hs,!1);return t&&t.query.spec.valid?n(e,t):JA(e)}}const pd=hu((n,{query:e})=>{let{to:t}=n.state.selection.main,r=e.nextMatch(n.state,t,t);if(!r)return!1;let i=me.single(r.from,r.to),s=n.state.facet(kl);return n.dispatch({selection:i,effects:[NO(n,r),s.scrollToMatch(i.main,n)],userEvent:"select.search"}),KA(n),!0}),md=hu((n,{query:e})=>{let{state:t}=n,{from:r}=t.selection.main,i=e.prevMatch(t,r,r);if(!i)return!1;let s=me.single(i.from,i.to),o=n.state.facet(kl);return n.dispatch({selection:s,effects:[NO(n,i),o.scrollToMatch(s.main,n)],userEvent:"select.search"}),KA(n),!0}),d4=hu((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:me.create(t.map(r=>me.range(r.from,r.to))),userEvent:"select.search.matches"}),!0)}),h4=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:r,to:i}=t.main,s=[],o=0;for(let a=new ll(n.doc,n.sliceDoc(r,i));!a.next().done;){if(s.length>1e3)return!1;a.value.from==r&&(o=s.length),s.push(me.range(a.value.from,a.value.to))}return e(n.update({selection:me.create(s,o),userEvent:"select.search.matches"})),!0},p0=hu((n,{query:e})=>{let{state:t}=n,{from:r,to:i}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,r,r);if(!s)return!1;let o=s,a=[],l,c,u=[];o.from==r&&o.to==i&&(c=t.toText(e.getReplacement(o)),a.push({from:o.from,to:o.to,insert:c}),o=e.nextMatch(t,o.from,o.to),u.push(Pe.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(r).number)+".")));let f=n.state.changes(a);return o&&(l=me.single(o.from,o.to).map(f),u.push(NO(n,o)),u.push(t.facet(kl).scrollToMatch(l.main,n))),n.dispatch({changes:f,selection:l,effects:u,userEvent:"input.replace"}),!0}),p4=hu((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(i=>{let{from:s,to:o}=i;return{from:s,to:o,insert:e.getReplacement(i)}});if(!t.length)return!1;let r=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:Pe.announce.of(r),userEvent:"input.replace.all"}),!0});function IO(n){return n.state.facet(kl).createPanel(n)}function pg(n,e){var t,r,i,s,o;let a=n.selection.main,l=a.empty||a.to>a.from+100?"":n.sliceDoc(a.from,a.to);if(e&&!l)return e;let c=n.facet(kl);return new UA({search:((t=e?.literal)!==null&&t!==void 0?t:c.literal)?l:l.replace(/\n/g,"\\n"),caseSensitive:(r=e?.caseSensitive)!==null&&r!==void 0?r:c.caseSensitive,literal:(i=e?.literal)!==null&&i!==void 0?i:c.literal,regexp:(s=e?.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(o=e?.wholeWord)!==null&&o!==void 0?o:c.wholeWord})}function HA(n){let e=cx(n,IO);return e&&e.dom.querySelector("[main-field]")}function KA(n){let e=HA(n);e&&e==n.root.activeElement&&e.select()}const JA=n=>{let e=n.state.field(Hs,!1);if(e&&e.panel){let t=HA(n);if(t&&t!=n.root.activeElement){let r=pg(n.state,e.query.spec);r.valid&&n.dispatch({effects:Ic.of(r)}),t.focus(),t.select()}}else n.dispatch({effects:[DO.of(!0),e?Ic.of(pg(n.state,e.query.spec)):Qt.appendConfig.of(v4)]});return!0},eC=n=>{let e=n.state.field(Hs,!1);if(!e||!e.panel)return!1;let t=cx(n,IO);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:DO.of(!1)}),!0},tC=[{key:"Mod-f",run:JA,scope:"editor search-panel"},{key:"F3",run:pd,shift:md,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:pd,shift:md,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:eC,scope:"editor search-panel"},{key:"Mod-Shift-l",run:h4},{key:"Mod-Alt-g",run:VN},{key:"Mod-d",run:n4,preventDefault:!0}];class m4{constructor(e){this.view=e;let t=this.query=e.state.field(Hs).query.spec;this.commit=this.commit.bind(this),this.searchField=zn("input",{value:t.search,placeholder:Rr(e,"Find"),"aria-label":Rr(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=zn("input",{value:t.replace,placeholder:Rr(e,"Replace"),"aria-label":Rr(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=zn("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=zn("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=zn("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function r(i,s,o){return zn("button",{class:"cm-button",name:i,onclick:s,type:"button"},o)}this.dom=zn("div",{onkeydown:i=>this.keydown(i),class:"cm-search"},[this.searchField,r("next",()=>pd(e),[Rr(e,"next")]),r("prev",()=>md(e),[Rr(e,"previous")]),r("select",()=>d4(e),[Rr(e,"all")]),zn("label",null,[this.caseField,Rr(e,"match case")]),zn("label",null,[this.reField,Rr(e,"regexp")]),zn("label",null,[this.wordField,Rr(e,"by word")]),...e.state.readOnly?[]:[zn("br"),this.replaceField,r("replace",()=>p0(e),[Rr(e,"replace")]),r("replaceAll",()=>p4(e),[Rr(e,"replace all")])],zn("button",{name:"close",onclick:()=>eC(e),"aria-label":Rr(e,"close"),type:"button"},["×"])])}commit(){let e=new UA({search:this.searchField.value,caseSensitive:this.caseField.checked,regexp:this.reField.checked,wholeWord:this.wordField.checked,replace:this.replaceField.value});e.eq(this.query)||(this.query=e,this.view.dispatch({effects:Ic.of(e)}))}keydown(e){LM(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?md:pd)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),p0(this.view))}update(e){for(let t of e.transactions)for(let r of t.effects)r.is(Ic)&&!r.value.eq(this.query)&&this.setQuery(r.value)}setQuery(e){this.query=e,this.searchField.value=e.search,this.replaceField.value=e.replace,this.caseField.checked=e.caseSensitive,this.reField.checked=e.regexp,this.wordField.checked=e.wholeWord}mount(){this.searchField.select()}get pos(){return 80}get top(){return this.view.state.facet(kl).top}}function Rr(n,e){return n.state.phrase(e)}const Xu=30,Vu=/[\s\.,:;?!]/;function NO(n,{from:e,to:t}){let r=n.state.doc.lineAt(e),i=n.state.doc.lineAt(t).to,s=Math.max(r.from,e-Xu),o=Math.min(i,t+Xu),a=n.state.sliceDoc(s,o);if(s!=r.from){for(let l=0;l<Xu;l++)if(!Vu.test(a[l+1])&&Vu.test(a[l])){a=a.slice(l);break}}if(o!=i){for(let l=a.length-1;l>a.length-Xu;l--)if(!Vu.test(a[l-1])&&Vu.test(a[l])){a=a.slice(0,l);break}}return Pe.announce.of(`${n.state.phrase("current match")}. ${a} ${n.state.phrase("on line")} ${r.number}.`)}const g4=Pe.baseTheme({".cm-panel.cm-search":{padding:"2px 6px 4px",position:"relative","& [name=close]":{position:"absolute",top:"0",right:"4px",backgroundColor:"inherit",border:"none",font:"inherit",padding:0,margin:0},"& input, & button, & label":{margin:".2em .6em .2em 0"},"& input[type=checkbox]":{marginRight:".2em"},"& label":{fontSize:"80%",whiteSpace:"pre"}},"&light .cm-searchMatch":{backgroundColor:"#ffff0054"},"&dark .cm-searchMatch":{backgroundColor:"#00ffff8a"},"&light .cm-searchMatch-selected":{backgroundColor:"#ff6a0054"},"&dark .cm-searchMatch-selected":{backgroundColor:"#ff00ff8a"}}),v4=[Hs,co.low(f4),g4];function O4(n){return n.replace(/\$\{\d+\|([^,}]+)[^}]*\}/g,"$1").replace(/\$\{\d+:([^}]*)}/g,"$1").replace(/\$\d+/g,"")}function b4(n){if(n.snippet&&n.snippet.length>0)return n.snippet.map(O4).join(`
|
|
174
|
-
`);const e=[];for(const[r,i]of Object.entries(n.attributes))if(i.required){const s=i.values?.[0]??"";e.push(`${r}="${s}"`)}const t=e.length>0?" "+e.join(" "):"";return n.selfClosing?`{% ${n.name}${t} /%}`:`{% ${n.name}${t} %}
|
|
175
|
-
|
|
176
|
-
{% /${n.name} %}`}function mg(n){return e=>{const t=e.matchBefore(/\/\w*/);if(!t||t.from>0&&e.state.doc.sliceString(t.from-1,t.from).trim()!=="")return null;const r=n();if(r.length===0)return null;const i=t.from,s=r.map(o=>({label:o.name,detail:o.category,info:o.description,section:o.category,type:"keyword",apply:(a,l,c,u)=>{const f=b4(o);a.dispatch({changes:{from:i,to:u,insert:f},selection:{anchor:o.selfClosing?i+f.indexOf("/%}"):i+f.indexOf("%}")+2+1}})}}));return{from:i+1,options:s,filter:!0}}}function y4(n,e){const t=n.slice(Math.max(0,e-500),e),r=t.lastIndexOf("%}"),i=t.lastIndexOf("{%");if(i===-1||r!==-1&&r>i)return null;const s=t.slice(i+2).trimStart();if(s.startsWith("/"))return null;const o=s.match(/^(\w[\w-]*)/);if(!o)return null;const a=o[1],c=s.slice(o[0].length).match(/(\w[\w-]*)="[^"]*$/);if(c){const u=t.lastIndexOf('="');return{tagName:a,attrName:c[1],valueStart:Math.max(0,e-500)+u+2}}return{tagName:a}}function w4(n,e,t){const r=t.design;if(!r?.contexts)return[];const i=Object.keys(r.contexts);return n==="sandbox"&&e==="context"||n==="design-context"&&e==="scope"?i:[]}function gg(n,e){return t=>{const r=t.state.doc.toString(),i=t.pos,s=y4(r,i);if(!s)return null;const o=n(),a=new Map;for(const h of o){a.set(h.name,h);for(const m of h.aliases)a.set(m,h)}const l=a.get(s.tagName);if(!l)return null;if(s.attrName&&s.valueStart!==void 0){const h=l.attributes[s.attrName];if(h?.values?.length)return{from:s.valueStart,options:h.values.map(p=>({label:p,type:"enum"})),filter:!0};const m=e?w4(s.tagName,s.attrName,e()):[];return m.length?{from:s.valueStart,options:m.map(p=>({label:p,type:"variable"})),filter:!0}:null}const c=t.matchBefore(/\w*/);if(!c||!t.explicit&&c.from===c.to)return null;const u=r.slice(Math.max(0,i-500),i),f=new Set([...u.matchAll(/(\w[\w-]*)="/g)].map(h=>h[1])),d=Object.entries(l.attributes).filter(([h])=>!f.has(h)).map(([h,m])=>({label:h,detail:m.required?"required":void 0,type:"property",apply:`${h}="`,boost:m.required?1:0}));return d.length===0?null:{from:c.from,options:d,filter:!0}}}const _4=ft.mark({class:"cm-markdoc-tag"}),m0=ft.mark({class:"cm-markdoc-bracket"}),k4=ft.mark({class:"cm-markdoc-name"}),g0=/\{%\s*(\/?)(\w[\w-]*)((?:\s+[^%]*)?)(\/?)\s*%\}/g;function v0(n){const e=[];for(const{from:r,to:i}of n.visibleRanges){const s=n.state.doc.sliceString(r,i);g0.lastIndex=0;let o;for(;(o=g0.exec(s))!==null;){const a=r+o.index,l=a+o[0].length;e.push({from:a,to:l,deco:_4}),e.push({from:a,to:a+2,deco:m0}),e.push({from:l-2,to:l,deco:m0});const c=o[1],u=o[2],f=o[0].indexOf(c+u,2),d=a+f+c.length;e.push({from:d,to:d+u.length,deco:k4})}}e.sort((r,i)=>r.from-i.from||r.to-i.to);const t=new Vo;for(const r of e)t.add(r.from,r.to,r.deco);return t.finish()}const x4=pr.fromClass(class{decorations;constructor(n){this.decorations=v0(n)}update(n){(n.docChanged||n.viewportChanged)&&(this.decorations=v0(n.view))}},{decorations:n=>n.decorations});function Nc(){return x4}const S4=Pe.theme({"&":{backgroundColor:"#f8fafc",color:"#1a1a2e",fontSize:"13px",height:"100%"},".cm-scroller":{overflow:"auto",fontFamily:"'SF Mono', 'Fira Code', ui-monospace, monospace",lineHeight:"1.6"},".cm-content":{padding:"1rem 0",caretColor:"#1e293b"},".cm-gutters":{backgroundColor:"#f8fafc",color:"#94a3b8",border:"none",paddingRight:"0.5rem"},".cm-activeLineGutter":{backgroundColor:"#e2e8f0",color:"#64748b"},".cm-activeLine":{backgroundColor:"rgba(0, 0, 0, 0.03)"},".cm-cursor":{borderLeftColor:"#1e293b"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"rgba(14, 165, 233, 0.2)"},".cm-selectionBackground":{backgroundColor:"rgba(14, 165, 233, 0.12)"},"&.cm-focused":{outline:"none"},".cm-tooltip.cm-tooltip-autocomplete":{border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.12)",backgroundColor:"#ffffff",overflow:"hidden"},".cm-tooltip.cm-tooltip-autocomplete ul":{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12px",maxHeight:"280px"},".cm-tooltip.cm-tooltip-autocomplete ul li":{padding:"4px 8px",borderBottom:"1px solid #f1f5f9"},".cm-tooltip.cm-tooltip-autocomplete ul li[aria-selected]":{backgroundColor:"#f0f9ff",color:"#0369a1"},".cm-tooltip.cm-completionInfo":{border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",backgroundColor:"#ffffff",padding:"6px 10px",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12px",color:"#475569",maxWidth:"300px"},".cm-completionDetail":{color:"#94a3b8",fontStyle:"normal",marginLeft:"0.5em"},".cm-markdoc-tag":{backgroundColor:"rgba(217, 119, 6, 0.06)",borderRadius:"2px"},".cm-markdoc-bracket":{color:"#94a3b8"},".cm-markdoc-name":{color:"#d97706",fontWeight:"600"}},{dark:!1}),nC=yl.define([{tag:N.heading1,color:"#0369a1",fontWeight:"bold",fontSize:"1.4em"},{tag:N.heading2,color:"#0369a1",fontWeight:"bold",fontSize:"1.2em"},{tag:N.heading3,color:"#0369a1",fontWeight:"bold",fontSize:"1.1em"},{tag:N.heading,color:"#0369a1",fontWeight:"bold"},{tag:N.emphasis,color:"#9333ea",fontStyle:"italic"},{tag:N.strong,color:"#9333ea",fontWeight:"bold"},{tag:N.link,color:"#0ea5e9",textDecoration:"underline"},{tag:N.url,color:"#0ea5e9"},{tag:N.quote,color:"#64748b"},{tag:N.monospace,color:"#16a34a"},{tag:N.processingInstruction,color:"#d97706"},{tag:N.meta,color:"#94a3b8"},{tag:N.comment,color:"#94a3b8"},{tag:N.punctuation,color:"#94a3b8"}]);var A4=W('<div class="md-editor__empty svelte-12tkyig"><span class="md-editor__empty-text svelte-12tkyig">Select a file to edit</span></div>'),C4=W("<div></div> <!>",1);function rC(n,e){dt(e,!0);let t,r;hn(()=>{if(!t)return;const c=Pt.create({doc:Pr(()=>X.bodyContent),extensions:[JM(),nq(),RM(),cO(),al(),S4,Tc(nC),YA(),na.of([...dO,...uO,...tC,{key:"Mod-/",run:u=>(uc(u),!0)}]),Pe.updateListener.of(u=>{u.docChanged&&X.updateBody(u.state.doc.toString())}),Pe.lineWrapping,Nc(),ig({override:[mg(()=>X.runes),gg(()=>X.runes,()=>X.aggregated)],icons:!1})]});return r=new Pe({state:c,parent:t}),()=>{r?.destroy()}}),hn(()=>{const c=X.bodyContent;if(!r)return;const u=r.state.doc.toString();c!==u&&r.dispatch({changes:{from:0,to:r.state.doc.length,insert:c}})});var i=C4(),s=tt(i);let o;ln(s,c=>t=c,()=>t);var a=D(s,2);{var l=c=>{var u=A4();z(c,u)};le(a,c=>{X.currentPath||c(l)})}ce(()=>o=Be(s,1,"md-editor svelte-12tkyig",null,o,{hidden:!X.currentPath})),z(n,i),ht()}function T4(n){let e=5381;for(let t=0;t<n.length;t++)e=(e<<5)+e+n.charCodeAt(t)>>>0;return e.toString(36)}function as(n,e){const t=T4(n),r=e.get(t)??0;return e.set(t,r+1),r===0?`blk_${t}`:`blk_${t}_${r}`}const Bc=/^\{%\s+(\w[\w-]*)((?:\s+\w[\w-]*(?:="[^"]*"|=[\w.-]+)?)*)\s*(\/?)\s*%\}/;function iC(n){return new RegExp(`^\\{%\\s+/${n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*%\\}`)}function gd(n){const e={},t=/(\w[\w-]*)(?:="([^"]*)"|=([\w.-]+))?/g;let r;for(;(r=t.exec(n))!==null;)e[r[1]]=r[2]??r[3]??"true";return e}function P4(n){return n!==""&&!isNaN(Number(n))}function Sf(n){const e=[];for(const[t,r]of Object.entries(n))r==="true"?e.push(t):r==="false"||P4(r)?e.push(`${t}=${r}`):e.push(`${t}="${r}"`);return e.length>0?" "+e.join(" "):""}function sC(n){const e=n.split(`
|
|
177
|
-
`),t=[],r=new Map;let i=0;for(;i<e.length;){const o=e[i].trimStart();if(o===""){i++;continue}if(o.startsWith("```")||o.startsWith("~~~")){const u=o[0];let f=3;for(;f<o.length&&o[f]===u;)f++;const d=o.slice(0,f),h=o.slice(f).trim(),m=i;i++;const p=[];for(;i<e.length&&!e[i].trimStart().startsWith(d);)p.push(e[i]),i++;i<e.length&&i++;const v=e.slice(m,i).join(`
|
|
178
|
-
`);t.push({id:as(v,r),type:"fence",source:v,startLine:m,endLine:i,language:h,code:p.join(`
|
|
179
|
-
`)});continue}const a=Bc.exec(o);if(a){const u=a[1],f=a[2]??"",d=a[3]==="/",h=i;if(d){i++;const m=e.slice(h,i).join(`
|
|
180
|
-
`);t.push({id:as(m,r),type:"rune",source:m,startLine:h,endLine:i,runeName:u,selfClosing:!0,attributes:gd(f),innerContent:""})}else{i++;const m=iC(u),p=[];let v=1;for(;i<e.length;){const b=e[i].trimStart(),w=Bc.exec(b);if(w&&w[1]===u&&w[3]!=="/"&&v++,m.test(b)&&(v--,v===0))break;p.push(e[i]),i++}i<e.length&&i++;const O=e.slice(h,i).join(`
|
|
181
|
-
`);t.push({id:as(O,r),type:"rune",source:O,startLine:h,endLine:i,runeName:u,selfClosing:!1,attributes:gd(f),innerContent:p.join(`
|
|
182
|
-
`)})}continue}const l=o.match(/^(#{1,6})\s+(.*)/);if(l){const u=i;i++;const f=e.slice(u,i).join(`
|
|
183
|
-
`);t.push({id:as(f,r),type:"heading",source:f,startLine:u,endLine:i,level:l[1].length,text:l[2]});continue}if(/^(---+|___+|\*\*\*+)\s*$/.test(o)){const u=i;i++;const f=e.slice(u,i).join(`
|
|
184
|
-
`);t.push({id:as(f,r),type:"hr",source:f,startLine:u,endLine:i});continue}if(/^!\[.*\]\(.*\)\s*$/.test(o)){const u=i;i++;const f=e.slice(u,i).join(`
|
|
185
|
-
`);t.push({id:as(f,r),type:"image",source:f,startLine:u,endLine:i});continue}if(o.startsWith(">")){const u=i;for(;i<e.length&&(e[i].trimStart().startsWith(">")||e[i].trim()!==""&&!vd(e[i]));)i++;const f=e.slice(u,i).join(`
|
|
186
|
-
`);t.push({id:as(f,r),type:"quote",source:f,startLine:u,endLine:i});continue}const c=o.match(/^(\d+\.|[-*+])\s/);if(c){const u=/^\d+\./.test(c[1]),f=i;for(;i<e.length;){const h=e[i].trimStart();if(/^(\d+\.|[-*+])\s/.test(h)||h===""&&i+1<e.length&&/^(\s+|\d+\.|[-*+]\s)/.test(e[i+1])||h!==""&&e[i].startsWith(" "))i++;else break}const d=e.slice(f,i).join(`
|
|
187
|
-
`);t.push({id:as(d,r),type:"list",source:d,startLine:f,endLine:i,ordered:u});continue}{const u=i;for(;i<e.length&&e[i].trim()!==""&&!vd(e[i]);)i++;const f=e.slice(u,i).join(`
|
|
188
|
-
`);t.push({id:as(f,r),type:"paragraph",source:f,startLine:u,endLine:i})}}return t}function vd(n){const e=n.trimStart();return!!(e.startsWith("#")||e.startsWith("```")||e.startsWith("~~~")||Bc.test(e)||/^(---+|___+|\*\*\*+)\s*$/.test(e)||e.startsWith(">")||/^(\d+\.|[-*+])\s/.test(e)||/^!\[.*\]\(.*\)\s*$/.test(e))}function BO(n){if(!n.trim())return[];const e=n.split(`
|
|
189
|
-
`),t=[];let r=0;for(;r<e.length;){const s=e[r].trimStart();if(s===""){r++;continue}if(s.startsWith("```")||s.startsWith("~~~")){const l=s[0];let c=3;for(;c<s.length&&s[c]===l;)c++;const u=s.slice(0,c),f=s.slice(c).trim(),d=r;r++;const h=r;for(;r<e.length&&!e[r].trimStart().startsWith(u);)r++;const m=e.slice(h,r).join(`
|
|
190
|
-
`);r<e.length&&r++,t.push({type:"fence",label:f?`Code (${f})`:"Code",source:e.slice(d,r).join(`
|
|
191
|
-
`),fenceLanguage:f,fenceCode:m});continue}const o=Bc.exec(s);if(o){const l=o[1],c=o[2]??"",u=o[3]==="/",f=r;if(u)r++,t.push({type:"rune",label:l,source:e.slice(f,r).join(`
|
|
192
|
-
`),runeName:l,selfClosing:!0,attributes:gd(c),innerContent:"",children:[]});else{r++;const d=iC(l),h=[];let m=1;for(;r<e.length;){const v=e[r].trimStart(),O=Bc.exec(v);if(O&&O[1]===l&&O[3]!=="/"&&m++,d.test(v)&&(m--,m===0))break;h.push(e[r]),r++}r<e.length&&r++;const p=h.join(`
|
|
193
|
-
`);t.push({type:"rune",label:l,source:e.slice(f,r).join(`
|
|
194
|
-
`),runeName:l,selfClosing:!1,attributes:gd(c),innerContent:p,children:BO(p)})}continue}const a=s.match(/^(#{1,6})\s+(.*)/);if(a){const l=a[1].length,c=a[2];r++,t.push({type:"heading",label:`${"#".repeat(l)} ${c}`,source:e.slice(r-1,r).join(`
|
|
195
|
-
`),headingLevel:l,headingText:c});continue}if(/^(---+|___+|\*\*\*+)\s*$/.test(s)){r++,t.push({type:"hr",label:"Divider",source:e.slice(r-1,r).join(`
|
|
196
|
-
`)});continue}if(/^!\[.*\]\(.*\)\s*$/.test(s)){r++,t.push({type:"image",label:"Image",source:e.slice(r-1,r).join(`
|
|
197
|
-
`)});continue}if(s.startsWith(">")){const l=r;for(;r<e.length&&(e[r].trimStart().startsWith(">")||e[r].trim()!==""&&!vd(e[r]));)r++;const c=e.slice(l,r).join(`
|
|
198
|
-
`);t.push({type:"quote",label:"Blockquote",source:c});continue}if(/^(\d+\.|[-*+])\s/.test(s)){const l=r,c=/^\d+\./.test(s);for(;r<e.length;){const u=e[r].trimStart();if(/^(\d+\.|[-*+])\s/.test(u)){if(/^\d+\./.test(u)!==c&&r>l)break;r++}else if(u===""&&r+1<e.length&&/^(\s+|\d+\.|[-*+]\s)/.test(e[r+1])){const f=e[r+1].trimStart();if(/^(\d+\.|[-*+])\s/.test(f)&&/^\d+\./.test(f)!==c)break;r++}else if(u!==""&&e[r].startsWith(" "))r++;else break}t.push({type:"list",label:c?"Ordered list":"List",source:e.slice(l,r).join(`
|
|
199
|
-
`),listOrdered:c});continue}{const l=r;for(;r<e.length&&e[r].trim()!==""&&!vd(e[r]);)r++;const c=e.slice(l,r).join(`
|
|
200
|
-
`),u=c.length>40?c.slice(0,40)+"…":c;t.push({type:"paragraph",label:u,source:c})}}return t}function Wu(n,e,t){const r=n.indexOf(e);return r===-1?n:n.slice(0,r)+t+n.slice(r+e.length)}function oC(n){switch(n.includes("|")?n.split("|")[0]:n){case"heading":return"## Heading";case"heading:1":return"# Heading";case"heading:2":return"## Heading";case"heading:3":return"### Heading";case"heading:4":return"#### Heading";case"heading:5":return"##### Heading";case"heading:6":return"###### Heading";case"paragraph":return"Text content";case"list":case"list:unordered":return`- Item 1
|
|
201
|
-
- Item 2`;case"list:ordered":return`1. Item 1
|
|
202
|
-
2. Item 2`;case"fence":return"```\ncode\n```";case"image":return"";case"blockquote":case"quote":return"> Quote";case"any":return"Content";default:return"Content"}}function E4(n,e,t,r){const{field:i,fields:s}=fo(e,t,r);if(!i||i.filled)return n;const o=i.template||oC(i.match);return e.type==="delimited"&&r?I4(n,e,r,t,s,o):e.type==="sequence"?aC(n,e.fields,t,o):n}function $4(n,e,t,r){const{field:i}=fo(e,t,r);if(!i||!i.filled||i.nodes.length===0)return n;let s=n;for(let o=i.nodes.length-1;o>=0;o--){const a=i.nodes[o].source;s=jO(s,a)}return s=s.replace(/\n{3,}/g,`
|
|
203
|
-
|
|
204
|
-
`),s}function Q4(n,e,t,r){const{field:i}=fo(e,t,r);if(!i||!i.filled||i.nodes.length===0)return n;const s=i.template||"- New item",o=i.nodes[i.nodes.length-1],a=n.indexOf(o.source);if(a===-1)return n;let l=s;if(i.match==="list:ordered"){const u=o.source.match(/^(\d+)\./),f=u?parseInt(u[1],10)+1:i.nodes.length+1;l=s.replace(/^\d+\./,`${f}.`)}const c=a+o.source.length;return n.slice(0,c)+`
|
|
205
|
-
`+l+n.slice(c)}function L4(n,e,t,r,i){const{field:s}=fo(e,t,i);if(!s||!s.filled||s.nodes.length===0)return n;const o=s.nodes[0],a=uh(o.source);if(r<0||r>=a.length)return n;if(a.length===1)return jO(n,o.source);const c=a.filter((f,d)=>d!==r).join(`
|
|
206
|
-
|
|
207
|
-
`),u=n.indexOf(o.source);return u===-1?n:n.slice(0,u)+c+n.slice(u+o.source.length)}function M4(n,e,t,r,i,s){if(r===i)return n;const{field:o}=fo(e,t,s);if(!o||!o.filled||o.nodes.length===0)return n;const a=o.nodes[0],l=uh(a.source);if(r<0||r>=l.length||i<0||i>=l.length)return n;const c=[...l],[u]=c.splice(r,1);if(c.splice(i,0,u),o.match==="list:ordered"||/^\d+\.\s/.test(l[0]))for(let m=0;m<c.length;m++)c[m]=c[m].replace(/^\d+\./,`${m+1}.`);const d=c.join(`
|
|
208
|
-
`),h=n.indexOf(a.source);return h===-1?n:n.slice(0,h)+d+n.slice(h+a.source.length)}function q4(n,e,t,r){const{field:i}=fo(e,t,r);if(!i||!i.filled||i.nodes.length===0)return n;const s=i.template||oC(i.match),o=i.nodes[i.nodes.length-1],a=n.indexOf(o.source);if(a===-1)return n;const l=a+o.source.length;return n.slice(0,l)+`
|
|
209
|
-
|
|
210
|
-
`+s+n.slice(l)}function R4(n,e,t,r,i){const{field:s}=fo(e,t,i);if(!s||!s.filled||s.nodes.length===0||r<0||r>=s.nodes.length)return n;const o=s.nodes[r].source;let a=jO(n,o);return a=a.replace(/\n{3,}/g,`
|
|
211
|
-
|
|
212
|
-
`),a}function D4(n,e,t,r,i,s){if(r===i)return n;const{field:o}=fo(e,t,s);if(!o||!o.filled||o.nodes.length===0||r<0||r>=o.nodes.length||i<0||i>=o.nodes.length)return n;const l=[...o.nodes.map(v=>v.source)],[c]=l.splice(r,1);l.splice(i,0,c);const u=o.nodes[0].source,f=o.nodes[o.nodes.length-1].source,d=n.indexOf(u),h=n.indexOf(f);if(d===-1||h===-1)return n;const m=h+f.length,p=l.join(`
|
|
213
|
-
|
|
214
|
-
`);return n.slice(0,d)+p+n.slice(m)}function uh(n){const e=n.split(`
|
|
215
|
-
`),t=[];let r=[];for(const i of e)/^[-*+]\s|^\d+\.\s/.test(i)&&r.length>0?(t.push(r.join(`
|
|
216
|
-
`)),r=[i]):r.push(i);return r.length>0&&t.push(r.join(`
|
|
217
|
-
`)),t}function fo(n,e,t){if(n.type==="sequence")return{field:n.fields.find(i=>i.name===e)??null,fields:n.fields};if(n.type==="delimited"&&t){const r=n.zones.find(s=>s.name===t);return r?{field:r.fields.find(s=>s.name===e)??null,fields:r.fields}:{field:null,fields:null}}return{field:null,fields:null}}function jO(n,e){const t=n.indexOf(e);if(t===-1)return n;let r=t,i=t+e.length;for(;r>0&&n[r-1]===`
|
|
218
|
-
`;)r--;for(r>0&&r++;i<n.length&&n[i]===`
|
|
219
|
-
`;)i++;return n.slice(0,r)+n.slice(i)}function aC(n,e,t,r){const i=e.findIndex(a=>a.name===t);if(i===-1)return n;let s=null;for(let a=i-1;a>=0;a--)if(e[a].filled&&e[a].nodes.length>0){const l=e[a].nodes;s=l[l.length-1];break}if(s){const a=n.indexOf(s.source);if(a!==-1){const l=a+s.source.length;return n.slice(0,l)+`
|
|
220
|
-
|
|
221
|
-
`+r+n.slice(l)}}for(let a=i+1;a<e.length;a++)if(e[a].filled&&e[a].nodes.length>0){const l=e[a].nodes[0],c=n.indexOf(l.source);if(c!==-1)return n.slice(0,c)+r+`
|
|
222
|
-
|
|
223
|
-
`+n.slice(c)}const o=n.trimEnd();return o+(o?`
|
|
224
|
-
|
|
225
|
-
`:"")+r}function I4(n,e,t,r,i,s){const o=e.zones.findIndex(p=>p.name===t);if(o===-1)return n;const a=n.split(`
|
|
226
|
-
`),l=[];for(let p=0;p<a.length;p++)a[p].trim()==="---"&&l.push(p);if(o>0&&l.length<o){const p=n.trimEnd(),v=o-l.length;let O="";for(let b=0;b<v;b++)O+=`
|
|
227
|
-
|
|
228
|
-
---`;return p+O+`
|
|
229
|
-
|
|
230
|
-
`+s}const c=o===0?0:l[o-1]+1,u=o<l.length?l[o]:a.length,f=a.slice(c,u).join(`
|
|
231
|
-
`),d=aC(f,i,r,s),h=a.slice(0,c).join(`
|
|
232
|
-
`),m=a.slice(u).join(`
|
|
233
|
-
`);return[h,d,m].filter(Boolean).join(`
|
|
234
|
-
`)}function vg(n){return n.map(e=>e.source).join(`
|
|
235
|
-
|
|
236
|
-
`)}function nr(n){const e=Sf(n.attributes);if(n.selfClosing)return`{% ${n.runeName}${e} /%}`;const t=n.innerContent.trim();return t?`{% ${n.runeName}${e} %}
|
|
237
|
-
${t}
|
|
238
|
-
{% /${n.runeName} %}`:`{% ${n.runeName}${e} %}
|
|
239
|
-
|
|
240
|
-
{% /${n.runeName} %}`}function Og(n){return"#".repeat(n.level)+" "+n.text}function Od(n){return"```"+n.language+`
|
|
241
|
-
`+n.code+"\n```"}function N4(n){const e=new Map;for(const t of n){e.set(t.name,t);for(const r of t.aliases)e.set(r,t)}return e}function B4(n,e){const t=n.split(`
|
|
242
|
-
`),r=new RegExp(`^\\{%\\s+${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\b.*%\\}\\s*$`),i=new RegExp(`^\\{%\\s+/${e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}\\s*%\\}\\s*$`);let s=0,o=t.length;return r.test(t[0].trim())&&(s=1),o>s&&i.test(t[o-1].trim())&&(o-=1),t.slice(s,o).join(`
|
|
243
|
-
`).trim()}function zO(n){switch(n.type){case"prose":return"Prose";case"heading":return`H${n.level}`;case"rune":return n.runeName;case"fence":{const e=n.language;return e?`Code (${e})`:"Code"}case"list":return n.ordered?"Ordered List":"List";case"quote":return"Blockquote";case"hr":return"Divider";case"image":return"Image";case"paragraph":return"Paragraph";default:return n.type}}function O0(n){const e=[];let t=[];function r(){if(t.length===0)return;const i=t.map(s=>s.source).join(`
|
|
244
|
-
|
|
245
|
-
`);e.push({id:`prose_${t[0].id}`,type:"prose",children:[...t],source:i,startLine:t[0].startLine,endLine:t[t.length-1].endLine}),t=[]}for(const i of n)i.type==="rune"?(r(),e.push(i)):t.push(i);return r(),e}var j4=Object.create,fh=Object.defineProperty,z4=Object.getOwnPropertyDescriptor,Z4=Object.getOwnPropertyNames,F4=Object.getPrototypeOf,X4=Object.prototype.hasOwnProperty,lC=n=>fh(n,"__esModule",{value:!0}),qe=(n,e)=>function(){return e||(0,n[Object.keys(n)[0]])((e={exports:{}}).exports,e),e.exports},cC=(n,e)=>{lC(n);for(var t in e)fh(n,t,{get:e[t],enumerable:!0})},V4=(n,e,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Z4(e))!X4.call(n,r)&&r!=="default"&&fh(n,r,{get:()=>e[r],enumerable:!(t=z4(e,r))||t.enumerable});return n},dh=n=>V4(lC(fh(n!=null?j4(F4(n)):{},"default",n&&n.__esModule&&"default"in n?{get:()=>n.default,enumerable:!0}:{value:n,enumerable:!0})),n),uC=qe({"src/grammar/tag.js"(n,e){function t(s,o){function a(){this.constructor=s}a.prototype=o.prototype,s.prototype=new a}function r(s,o,a,l){this.message=s,this.expected=o,this.found=a,this.location=l,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,r)}t(r,Error),r.buildMessage=function(s,o,a){var l={literal:function(p){return'"'+u(p.text)+'"'},class:function(p){var v=p.parts.map(function(O){return Array.isArray(O)?f(O[0])+"-"+f(O[1]):f(O)});return"["+(p.inverted?"^":"")+v+"]"},any:function(){return"any character"},end:function(){return"end of input"},other:function(p){return p.description},not:function(p){return"not "+d(p.expected)}};function c(p){return p.charCodeAt(0).toString(16).toUpperCase()}function u(p){return p.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+c(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+c(v)})}function f(p){return p.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,function(v){return"\\x0"+c(v)}).replace(/[\x10-\x1F\x7F-\x9F]/g,function(v){return"\\x"+c(v)})}function d(p){return l[p.type](p)}function h(p){var v=p.map(d),O,b;if(v.sort(),v.length>0){for(O=1,b=1;O<v.length;O++)v[O-1]!==v[O]&&(v[b]=v[O],b++);v.length=b}switch(v.length){case 1:return v[0];case 2:return v[0]+" or "+v[1];default:return v.slice(0,-1).join(", ")+", or "+v[v.length-1]}}function m(p){return p?'"'+u(p)+'"':"end of input"}return"Expected "+h(s)+" but "+m(o)+" found."};function i(s,o){o=o!==void 0?o:{};var a={},l={Top:$e},c=$e,u="/",f=".",d="#",h="=",m="(",p=")",v=",",O="[",b="]",w="null",S="true",_="false",x="{",A="}",C=":",y='"',k="\\",P="n",T="r",E="t",Q=/^[$@]/,$=/^[0-9]/,L=/^[^\0-\x1F"\\]/,I=/^[a-zA-Z0-9_\-]/,Z=/^[ \n\t]/,Y=Mn("/",!1),ne=qn("tag name"),ae=qn("class"),ie=qn("id"),K=Mn("=",!1),he=Mn("(",!1),fe=Mn(")",!1),j=Mn(",",!1),U=qn("variable"),ue=qn("null"),ke=qn("boolean"),Ce=Mn("[",!1),ve=Mn("]",!1),Ee=Mn("{",!1),rt=Mn("}",!1),Ke=Mn(":",!1),Ye=qn("number"),Ve=qn("string"),ze=qn("identifier"),Bt=qn("whitespace"),Nn=function(M){return{type:"variable",meta:{variable:M}}},Jn=function(M){return{type:"annotation",meta:{attributes:M}}},bt=function(M,V){return V},Wt=function(M,V,G,oe){V&&(G=G||[],G.unshift({type:"attribute",name:"primary",value:V}));const[be,Ne]=oe?["tag",0]:["tag_open",1];return{type:be,nesting:Ne,meta:{tag:M,attributes:G}}},mn=function(M){return{type:"tag_close",nesting:-1,meta:{tag:M}}},Vn=function(M,V){return M?[M,...V]:[]},xe=function(M){return M},Wn=function(M){return M},Lt=function(M){return M},Jt=function(M){return M},_n=function(M){return{type:"class",name:M,value:!0}},se=function(M){return{type:"attribute",name:"id",value:M}},Oe=function(M,V){return{type:"attribute",name:M,value:V}},_e=function(M,V,G){return V?[V,...G]:[]},Ae=function(M,V){let G={};for(let[oe,{name:be,value:Ne}]of V.entries())G[be||oe]=Ne;return new zP(M,G)},Qe=function(M){return M},yt=function(M,V){return{name:M,value:V}},ct=function(M){return M},Ue=function(M,V,G){return M==="@"?[V,...G]:new jP([V,...G])},wt=function(){return null},pt=function(){return!0},at=function(){return!1},_t=function(M,V){return[M,...V]},xn=function(M){return M||[]},jt=function(M,V){return Object.assign(M,...V)},en=function(M){return M||{}},gt=function(M,V){return M==="$$mdtype"?{}:{[M]:V}},Ut=function(){return parseFloat(qi())},Bn=function(M){return M.join("")},er=function(){return`
|
|
246
|
-
`},mr=function(){return"\r"},cn=function(){return" "},Mt=function(M){return M},F=0,Ze=0,un=[{line:1,column:1}],Sn=[],We=0,gr;if("startRule"in o){if(!(o.startRule in l))throw new Error(`Can't start parsing from rule "`+o.startRule+'".');c=l[o.startRule]}function qi(){return s.substring(Ze,F)}function Mn(M,V){return{type:"literal",text:M,ignoreCase:V}}function ns(){return{type:"end"}}function qn(M){return{type:"other",description:M}}function $s(M){var V=un[M],G;if(V)return V;for(G=M-1;!un[G];)G--;for(V=un[G],V={line:V.line,column:V.column};G<M;)s.charCodeAt(G)===10?(V.line++,V.column=1):V.column++,G++;return un[M]=V,V}var rs=typeof o.filename=="string"&&o.filename.length>0;function vr(M,V){var G={};rs&&(G.filename=o.filename);var oe=$s(M);G.start={offset:M,line:oe.line,column:oe.column};var be=$s(V);return G.end={offset:V,line:be.line,column:be.column},G}function H(){Sn.push({pos:F,variants:[]})}function te(M){var V=Sn[Sn.length-1];F<V.pos||(F>V.pos&&(V.pos=F,V.variants=[]),V.variants.push(M))}function de(M,V,G){return new r(r.buildMessage(M,V,G),M,V,G)}function ye(){var M=Sn[0],V=M.pos;return de(M.variants,V<s.length?s.charAt(V):null,V<s.length?vr(V,V+1):vr(V,V))}function $e(){var M;return M=Je(),M===a&&(M=Ge(),M===a&&(M=He(),M===a&&(M=it()))),M}function Je(){var M,V;return M=F,V=wb(),V===a&&(V=Lr()),V!==a&&(Ze=M,V=Nn(V)),M=V,M}function Ge(){var M,V,G,oe;if(M=F,V=lt(),V!==a){for(G=[],oe=kt();oe!==a;)G.push(oe),oe=kt();Ze=M,M=Jn(V)}else F=M,M=a;return M}function He(){var M,V,G,oe,be,Ne,vt,Or=function(Qs){We===0&&te(Qs)};if(M=F,V=qt(),V!==a){for(G=[],oe=kt();oe!==a;)G.push(oe),oe=kt();for(oe=F,be=sa(),be!==a?(Ne=kt(),Ne===a&&(Ne=null),Ze=oe,oe=bt(V,be)):(F=oe,oe=a),oe===a&&(oe=null),be=lt(),be===a&&(be=null),Ne=[],vt=kt();vt!==a;)Ne.push(vt),vt=kt();Or(Y),s.charCodeAt(F)===47?(vt=u,F++):vt=a,vt===a&&(vt=null),Ze=M,M=Wt(V,oe,be,vt)}else F=M,M=a;return M}function it(){var M,V,G,oe=function(be){We===0&&te(be)};return M=F,oe(Y),s.charCodeAt(F)===47?(V=u,F++):V=a,V!==a?(G=qt(),G!==a?(Ze=M,M=mn(G)):(F=M,M=a)):(F=M,M=a),M}function qt(){var M,V=function(G){We===0&&te(G)};return V(ne),We++,M=is(),We--,M}function lt(){var M,V,G,oe;if(M=F,V=fn(),V!==a){for(G=[],oe=Pn();oe!==a;)G.push(oe),oe=Pn();Ze=M,M=Vn(V,G)}else F=M,M=a;return M}function Pn(){var M,V,G;if(M=F,V=[],G=kt(),G!==a)for(;G!==a;)V.push(G),G=kt();else V=a;return V!==a?(G=fn(),G!==a?(Ze=M,M=xe(G)):(F=M,M=a)):(F=M,M=a),M}function fn(){var M,V;return M=F,V=jn(),V!==a&&(Ze=M,V=Wn(V)),M=V,M===a&&(M=F,V=ut(),V!==a&&(Ze=M,V=Lt(V)),M=V,M===a&&(M=F,V=Yr(),V!==a&&(Ze=M,V=Jt(V)),M=V)),M}function ut(){var M,V,G,oe=function(be){We===0&&te(be)};return oe(ae),We++,M=F,s.charCodeAt(F)===46?(V=f,F++):V=a,V!==a?(G=is(),G!==a?(Ze=M,M=_n(G)):(F=M,M=a)):(F=M,M=a),We--,M}function jn(){var M,V,G,oe=function(be){We===0&&te(be)};return oe(ie),We++,M=F,s.charCodeAt(F)===35?(V=d,F++):V=a,V!==a?(G=is(),G!==a?(Ze=M,M=se(G)):(F=M,M=a)):(F=M,M=a),We--,M}function Yr(){var M,V,G,oe,be=function(Ne){We===0&&te(Ne)};return M=F,V=is(),V!==a?(be(K),s.charCodeAt(F)===61?(G=h,F++):G=a,G!==a?(oe=sa(),oe!==a?(Ze=M,M=Oe(V,oe)):(F=M,M=a)):(F=M,M=a)):(F=M,M=a),M}function Lr(){var M,V,G,oe,be,Ne,vt,Or,Qs=function(ZP){We===0&&te(ZP)};if(M=F,V=is(),V!==a)if(Qs(he),s.charCodeAt(F)===40?(G=m,F++):G=a,G!==a){for(oe=[],be=kt();be!==a;)oe.push(be),be=kt();for(be=F,Ne=ra(),Ne===a&&(Ne=null),vt=[],Or=ia();Or!==a;)vt.push(Or),Or=ia();Ze=be,be=_e(V,Ne,vt),Qs(fe),s.charCodeAt(F)===41?(Ne=p,F++):Ne=a,Ne!==a?(Ze=M,M=Ae(V,be)):(F=M,M=a)}else F=M,M=a;else F=M,M=a;return M}function ra(){var M,V,G,oe,be=function(Ne){We===0&&te(Ne)};return M=F,V=F,G=is(),G!==a?(be(K),s.charCodeAt(F)===61?(oe=h,F++):oe=a,oe!==a?(Ze=V,V=Qe(G)):(F=V,V=a)):(F=V,V=a),V===a&&(V=null),G=sa(),G!==a?(Ze=M,M=yt(V,G)):(F=M,M=a),M}function ia(){var M,V,G,oe,be,Ne=function(vt){We===0&&te(vt)};for(M=F,V=[],G=kt();G!==a;)V.push(G),G=kt();if(Ne(j),s.charCodeAt(F)===44?(G=v,F++):G=a,G!==a){for(oe=[],be=kt();be!==a;)oe.push(be),be=kt();be=ra(),be!==a?(Ze=M,M=ct(be)):(F=M,M=a)}else F=M,M=a;return M}function on(){var M,V,G,oe=function(be){We===0&&te(be)};for(M=F,V=[],G=kt();G!==a;)V.push(G),G=kt();return oe(j),s.charCodeAt(F)===44?(G=v,F++):G=a,G!==a?(V=[V,G],M=V):(F=M,M=a),M===a&&(M=null),M}function wb(){var M,V,G,oe,be,Ne=function(vt){We===0&&te(vt)};if(Ne(U),We++,M=F,Q.test(s.charAt(F))?(V=s.charAt(F),F++):V=a,V!==a)if(G=is(),G!==a){for(oe=[],be=_b();be!==a;)oe.push(be),be=_b();Ze=M,M=Ue(V,G,oe)}else F=M,M=a;else F=M,M=a;return We--,M}function _b(){var M,V,G,oe;return M=F,s.charCodeAt(F)===46?(V=f,F++):V=a,V!==a?(G=is(),G!==a?(Ze=M,M=Qe(G)):(F=M,M=a)):(F=M,M=a),M===a&&(M=F,s.charCodeAt(F)===91?(V=O,F++):V=a,V!==a?(G=Ab(),G===a&&(G=Sh()),G!==a?(s.charCodeAt(F)===93?(oe=b,F++):oe=a,oe!==a?(Ze=M,M=ct(G)):(F=M,M=a)):(F=M,M=a)):(F=M,M=a)),M}function sa(){var M;return M=RP(),M===a&&(M=DP(),M===a&&(M=Sh(),M===a&&(M=Ab(),M===a&&(M=IP(),M===a&&(M=NP(),M===a&&(M=Lr(),M===a&&(M=wb()))))))),M}function RP(){var M,V,G=function(oe){We===0&&te(oe)};return G(ue),We++,M=F,s.substr(F,4)===w?(V=w,F+=4):V=a,V!==a&&(Ze=M,V=wt()),M=V,We--,M}function DP(){var M,V,G=function(oe){We===0&&te(oe)};return G(ke),We++,M=F,s.substr(F,4)===S?(V=S,F+=4):V=a,V!==a&&(Ze=M,V=pt()),M=V,M===a&&(M=F,s.substr(F,5)===_?(V=_,F+=5):V=a,V!==a&&(Ze=M,V=at()),M=V),We--,M}function IP(){var M,V,G,oe,be,Ne,vt,Or=function(Qs){We===0&&te(Qs)};if(M=F,Or(Ce),s.charCodeAt(F)===91?(V=O,F++):V=a,V!==a){for(G=[],oe=kt();oe!==a;)G.push(oe),oe=kt();if(oe=F,be=sa(),be!==a){for(Ne=[],vt=kb();vt!==a;)Ne.push(vt),vt=kb();vt=on(),Ze=oe,oe=_t(be,Ne)}else F=oe,oe=a;for(oe===a&&(oe=null),be=[],Ne=kt();Ne!==a;)be.push(Ne),Ne=kt();Or(ve),s.charCodeAt(F)===93?(Ne=b,F++):Ne=a,Ne!==a?(Ze=M,M=xn(oe)):(F=M,M=a)}else F=M,M=a;return M}function kb(){var M,V,G,oe,be,Ne=function(vt){We===0&&te(vt)};for(M=F,V=[],G=kt();G!==a;)V.push(G),G=kt();if(Ne(j),s.charCodeAt(F)===44?(G=v,F++):G=a,G!==a){for(oe=[],be=kt();be!==a;)oe.push(be),be=kt();be=sa(),be!==a?(Ze=M,M=ct(be)):(F=M,M=a)}else F=M,M=a;return M}function NP(){var M,V,G,oe,be,Ne,vt,Or=function(Qs){We===0&&te(Qs)};if(M=F,Or(Ee),s.charCodeAt(F)===123?(V=x,F++):V=a,V!==a){for(G=[],oe=kt();oe!==a;)G.push(oe),oe=kt();if(oe=F,be=Sb(),be!==a){for(Ne=[],vt=xb();vt!==a;)Ne.push(vt),vt=xb();vt=on(),Ze=oe,oe=jt(be,Ne)}else F=oe,oe=a;for(oe===a&&(oe=null),be=[],Ne=kt();Ne!==a;)be.push(Ne),Ne=kt();Or(rt),s.charCodeAt(F)===125?(Ne=A,F++):Ne=a,Ne!==a?(Ze=M,M=en(oe)):(F=M,M=a)}else F=M,M=a;return M}function xb(){var M,V,G,oe,be,Ne=function(vt){We===0&&te(vt)};for(M=F,V=[],G=kt();G!==a;)V.push(G),G=kt();if(Ne(j),s.charCodeAt(F)===44?(G=v,F++):G=a,G!==a){for(oe=[],be=kt();be!==a;)oe.push(be),be=kt();be=Sb(),be!==a?(Ze=M,M=xe(be)):(F=M,M=a)}else F=M,M=a;return M}function Sb(){var M,V,G,oe,be,Ne=function(vt){We===0&&te(vt)};if(M=F,V=is(),V===a&&(V=Sh()),V!==a)if(Ne(Ke),s.charCodeAt(F)===58?(G=C,F++):G=a,G!==a){for(oe=[],be=kt();be!==a;)oe.push(be),be=kt();be=sa(),be!==a?(Ze=M,M=gt(V,be)):(F=M,M=a)}else F=M,M=a;else F=M,M=a;return M}function Ab(){var M,V,G,oe,be,Ne,vt=function(Or){We===0&&te(Or)};if(vt(Ye),We++,M=F,s.charCodeAt(F)===45&&F++,V=[],$.test(s.charAt(F))?(G=s.charAt(F),F++):G=a,G!==a)for(;G!==a;)V.push(G),$.test(s.charAt(F))?(G=s.charAt(F),F++):G=a;else V=a;if(V!==a){if(G=F,s.charCodeAt(F)===46?(oe=f,F++):oe=a,oe!==a){if(be=[],$.test(s.charAt(F))?(Ne=s.charAt(F),F++):Ne=a,Ne!==a)for(;Ne!==a;)be.push(Ne),$.test(s.charAt(F))?(Ne=s.charAt(F),F++):Ne=a;else be=a;be!==a?(oe=[oe,be],G=oe):(F=G,G=a)}else F=G,G=a;G===a&&(G=null),Ze=M,M=Ut()}else F=M,M=a;return We--,M}function Sh(){var M,V,G,oe,be=function(Ne){We===0&&te(Ne)};if(be(Ve),We++,M=F,s.charCodeAt(F)===34?(V=y,F++):V=a,V!==a){for(G=[],oe=Cb();oe!==a;)G.push(oe),oe=Cb();s.charCodeAt(F)===34?(oe=y,F++):oe=a,oe!==a?(Ze=M,M=Bn(G)):(F=M,M=a)}else F=M,M=a;return We--,M}function Cb(){var M;return L.test(s.charAt(F))?(M=s.charAt(F),F++):M=a,M===a&&(M=BP()),M}function BP(){var M,V,G,oe;return M=F,s.charCodeAt(F)===92?(V=k,F++):V=a,V!==a?(s.charCodeAt(F)===34?(G=y,F++):G=a,G===a&&(s.charCodeAt(F)===92?(G=k,F++):G=a,G===a&&(G=F,s.charCodeAt(F)===110?(oe=P,F++):oe=a,oe!==a&&(Ze=G,oe=er()),G=oe,G===a&&(G=F,s.charCodeAt(F)===114?(oe=T,F++):oe=a,oe!==a&&(Ze=G,oe=mr()),G=oe,G===a&&(G=F,s.charCodeAt(F)===116?(oe=E,F++):oe=a,oe!==a&&(Ze=G,oe=cn()),G=oe)))),G!==a?(Ze=M,M=Mt(G)):(F=M,M=a)):(F=M,M=a),M}function is(){var M,V,G,oe=function(be){We===0&&te(be)};if(oe(ze),We++,M=F,V=[],I.test(s.charAt(F))?(G=s.charAt(F),F++):G=a,G!==a)for(;G!==a;)V.push(G),I.test(s.charAt(F))?(G=s.charAt(F),F++):G=a;else V=a;return V!==a?M=s.substring(M,F):M=V,We--,M}function kt(){var M,V=function(G){We===0&&te(G)};return V(Bt),We++,Z.test(s.charAt(F))?(M=s.charAt(F),F++):M=a,We--,M}const{Variable:jP,Function:zP}=o;if(H(),gr=c(),gr!==a&&F===s.length)return gr;throw gr!==a&&F<s.length&&te(ns()),ye()}e.exports={SyntaxError:r,parse:i}}}),W4=qe({"node_modules/entities/lib/maps/entities.json"(n,e){e.exports={Aacute:"Á",aacute:"á",Abreve:"Ă",abreve:"ă",ac:"∾",acd:"∿",acE:"∾̳",Acirc:"Â",acirc:"â",acute:"´",Acy:"А",acy:"а",AElig:"Æ",aelig:"æ",af:"",Afr:"𝔄",afr:"𝔞",Agrave:"À",agrave:"à",alefsym:"ℵ",aleph:"ℵ",Alpha:"Α",alpha:"α",Amacr:"Ā",amacr:"ā",amalg:"⨿",amp:"&",AMP:"&",andand:"⩕",And:"⩓",and:"∧",andd:"⩜",andslope:"⩘",andv:"⩚",ang:"∠",ange:"⦤",angle:"∠",angmsdaa:"⦨",angmsdab:"⦩",angmsdac:"⦪",angmsdad:"⦫",angmsdae:"⦬",angmsdaf:"⦭",angmsdag:"⦮",angmsdah:"⦯",angmsd:"∡",angrt:"∟",angrtvb:"⊾",angrtvbd:"⦝",angsph:"∢",angst:"Å",angzarr:"⍼",Aogon:"Ą",aogon:"ą",Aopf:"𝔸",aopf:"𝕒",apacir:"⩯",ap:"≈",apE:"⩰",ape:"≊",apid:"≋",apos:"'",ApplyFunction:"",approx:"≈",approxeq:"≊",Aring:"Å",aring:"å",Ascr:"𝒜",ascr:"𝒶",Assign:"≔",ast:"*",asymp:"≈",asympeq:"≍",Atilde:"Ã",atilde:"ã",Auml:"Ä",auml:"ä",awconint:"∳",awint:"⨑",backcong:"≌",backepsilon:"϶",backprime:"‵",backsim:"∽",backsimeq:"⋍",Backslash:"∖",Barv:"⫧",barvee:"⊽",barwed:"⌅",Barwed:"⌆",barwedge:"⌅",bbrk:"⎵",bbrktbrk:"⎶",bcong:"≌",Bcy:"Б",bcy:"б",bdquo:"„",becaus:"∵",because:"∵",Because:"∵",bemptyv:"⦰",bepsi:"϶",bernou:"ℬ",Bernoullis:"ℬ",Beta:"Β",beta:"β",beth:"ℶ",between:"≬",Bfr:"𝔅",bfr:"𝔟",bigcap:"⋂",bigcirc:"◯",bigcup:"⋃",bigodot:"⨀",bigoplus:"⨁",bigotimes:"⨂",bigsqcup:"⨆",bigstar:"★",bigtriangledown:"▽",bigtriangleup:"△",biguplus:"⨄",bigvee:"⋁",bigwedge:"⋀",bkarow:"⤍",blacklozenge:"⧫",blacksquare:"▪",blacktriangle:"▴",blacktriangledown:"▾",blacktriangleleft:"◂",blacktriangleright:"▸",blank:"␣",blk12:"▒",blk14:"░",blk34:"▓",block:"█",bne:"=⃥",bnequiv:"≡⃥",bNot:"⫭",bnot:"⌐",Bopf:"𝔹",bopf:"𝕓",bot:"⊥",bottom:"⊥",bowtie:"⋈",boxbox:"⧉",boxdl:"┐",boxdL:"╕",boxDl:"╖",boxDL:"╗",boxdr:"┌",boxdR:"╒",boxDr:"╓",boxDR:"╔",boxh:"─",boxH:"═",boxhd:"┬",boxHd:"╤",boxhD:"╥",boxHD:"╦",boxhu:"┴",boxHu:"╧",boxhU:"╨",boxHU:"╩",boxminus:"⊟",boxplus:"⊞",boxtimes:"⊠",boxul:"┘",boxuL:"╛",boxUl:"╜",boxUL:"╝",boxur:"└",boxuR:"╘",boxUr:"╙",boxUR:"╚",boxv:"│",boxV:"║",boxvh:"┼",boxvH:"╪",boxVh:"╫",boxVH:"╬",boxvl:"┤",boxvL:"╡",boxVl:"╢",boxVL:"╣",boxvr:"├",boxvR:"╞",boxVr:"╟",boxVR:"╠",bprime:"‵",breve:"˘",Breve:"˘",brvbar:"¦",bscr:"𝒷",Bscr:"ℬ",bsemi:"⁏",bsim:"∽",bsime:"⋍",bsolb:"⧅",bsol:"\\",bsolhsub:"⟈",bull:"•",bullet:"•",bump:"≎",bumpE:"⪮",bumpe:"≏",Bumpeq:"≎",bumpeq:"≏",Cacute:"Ć",cacute:"ć",capand:"⩄",capbrcup:"⩉",capcap:"⩋",cap:"∩",Cap:"⋒",capcup:"⩇",capdot:"⩀",CapitalDifferentialD:"ⅅ",caps:"∩︀",caret:"⁁",caron:"ˇ",Cayleys:"ℭ",ccaps:"⩍",Ccaron:"Č",ccaron:"č",Ccedil:"Ç",ccedil:"ç",Ccirc:"Ĉ",ccirc:"ĉ",Cconint:"∰",ccups:"⩌",ccupssm:"⩐",Cdot:"Ċ",cdot:"ċ",cedil:"¸",Cedilla:"¸",cemptyv:"⦲",cent:"¢",centerdot:"·",CenterDot:"·",cfr:"𝔠",Cfr:"ℭ",CHcy:"Ч",chcy:"ч",check:"✓",checkmark:"✓",Chi:"Χ",chi:"χ",circ:"ˆ",circeq:"≗",circlearrowleft:"↺",circlearrowright:"↻",circledast:"⊛",circledcirc:"⊚",circleddash:"⊝",CircleDot:"⊙",circledR:"®",circledS:"Ⓢ",CircleMinus:"⊖",CirclePlus:"⊕",CircleTimes:"⊗",cir:"○",cirE:"⧃",cire:"≗",cirfnint:"⨐",cirmid:"⫯",cirscir:"⧂",ClockwiseContourIntegral:"∲",CloseCurlyDoubleQuote:"”",CloseCurlyQuote:"’",clubs:"♣",clubsuit:"♣",colon:":",Colon:"∷",Colone:"⩴",colone:"≔",coloneq:"≔",comma:",",commat:"@",comp:"∁",compfn:"∘",complement:"∁",complexes:"ℂ",cong:"≅",congdot:"⩭",Congruent:"≡",conint:"∮",Conint:"∯",ContourIntegral:"∮",copf:"𝕔",Copf:"ℂ",coprod:"∐",Coproduct:"∐",copy:"©",COPY:"©",copysr:"℗",CounterClockwiseContourIntegral:"∳",crarr:"↵",cross:"✗",Cross:"⨯",Cscr:"𝒞",cscr:"𝒸",csub:"⫏",csube:"⫑",csup:"⫐",csupe:"⫒",ctdot:"⋯",cudarrl:"⤸",cudarrr:"⤵",cuepr:"⋞",cuesc:"⋟",cularr:"↶",cularrp:"⤽",cupbrcap:"⩈",cupcap:"⩆",CupCap:"≍",cup:"∪",Cup:"⋓",cupcup:"⩊",cupdot:"⊍",cupor:"⩅",cups:"∪︀",curarr:"↷",curarrm:"⤼",curlyeqprec:"⋞",curlyeqsucc:"⋟",curlyvee:"⋎",curlywedge:"⋏",curren:"¤",curvearrowleft:"↶",curvearrowright:"↷",cuvee:"⋎",cuwed:"⋏",cwconint:"∲",cwint:"∱",cylcty:"⌭",dagger:"†",Dagger:"‡",daleth:"ℸ",darr:"↓",Darr:"↡",dArr:"⇓",dash:"‐",Dashv:"⫤",dashv:"⊣",dbkarow:"⤏",dblac:"˝",Dcaron:"Ď",dcaron:"ď",Dcy:"Д",dcy:"д",ddagger:"‡",ddarr:"⇊",DD:"ⅅ",dd:"ⅆ",DDotrahd:"⤑",ddotseq:"⩷",deg:"°",Del:"∇",Delta:"Δ",delta:"δ",demptyv:"⦱",dfisht:"⥿",Dfr:"𝔇",dfr:"𝔡",dHar:"⥥",dharl:"⇃",dharr:"⇂",DiacriticalAcute:"´",DiacriticalDot:"˙",DiacriticalDoubleAcute:"˝",DiacriticalGrave:"`",DiacriticalTilde:"˜",diam:"⋄",diamond:"⋄",Diamond:"⋄",diamondsuit:"♦",diams:"♦",die:"¨",DifferentialD:"ⅆ",digamma:"ϝ",disin:"⋲",div:"÷",divide:"÷",divideontimes:"⋇",divonx:"⋇",DJcy:"Ђ",djcy:"ђ",dlcorn:"⌞",dlcrop:"⌍",dollar:"$",Dopf:"𝔻",dopf:"𝕕",Dot:"¨",dot:"˙",DotDot:"⃜",doteq:"≐",doteqdot:"≑",DotEqual:"≐",dotminus:"∸",dotplus:"∔",dotsquare:"⊡",doublebarwedge:"⌆",DoubleContourIntegral:"∯",DoubleDot:"¨",DoubleDownArrow:"⇓",DoubleLeftArrow:"⇐",DoubleLeftRightArrow:"⇔",DoubleLeftTee:"⫤",DoubleLongLeftArrow:"⟸",DoubleLongLeftRightArrow:"⟺",DoubleLongRightArrow:"⟹",DoubleRightArrow:"⇒",DoubleRightTee:"⊨",DoubleUpArrow:"⇑",DoubleUpDownArrow:"⇕",DoubleVerticalBar:"∥",DownArrowBar:"⤓",downarrow:"↓",DownArrow:"↓",Downarrow:"⇓",DownArrowUpArrow:"⇵",DownBreve:"̑",downdownarrows:"⇊",downharpoonleft:"⇃",downharpoonright:"⇂",DownLeftRightVector:"⥐",DownLeftTeeVector:"⥞",DownLeftVectorBar:"⥖",DownLeftVector:"↽",DownRightTeeVector:"⥟",DownRightVectorBar:"⥗",DownRightVector:"⇁",DownTeeArrow:"↧",DownTee:"⊤",drbkarow:"⤐",drcorn:"⌟",drcrop:"⌌",Dscr:"𝒟",dscr:"𝒹",DScy:"Ѕ",dscy:"ѕ",dsol:"⧶",Dstrok:"Đ",dstrok:"đ",dtdot:"⋱",dtri:"▿",dtrif:"▾",duarr:"⇵",duhar:"⥯",dwangle:"⦦",DZcy:"Џ",dzcy:"џ",dzigrarr:"⟿",Eacute:"É",eacute:"é",easter:"⩮",Ecaron:"Ě",ecaron:"ě",Ecirc:"Ê",ecirc:"ê",ecir:"≖",ecolon:"≕",Ecy:"Э",ecy:"э",eDDot:"⩷",Edot:"Ė",edot:"ė",eDot:"≑",ee:"ⅇ",efDot:"≒",Efr:"𝔈",efr:"𝔢",eg:"⪚",Egrave:"È",egrave:"è",egs:"⪖",egsdot:"⪘",el:"⪙",Element:"∈",elinters:"⏧",ell:"ℓ",els:"⪕",elsdot:"⪗",Emacr:"Ē",emacr:"ē",empty:"∅",emptyset:"∅",EmptySmallSquare:"◻",emptyv:"∅",EmptyVerySmallSquare:"▫",emsp13:" ",emsp14:" ",emsp:" ",ENG:"Ŋ",eng:"ŋ",ensp:" ",Eogon:"Ę",eogon:"ę",Eopf:"𝔼",eopf:"𝕖",epar:"⋕",eparsl:"⧣",eplus:"⩱",epsi:"ε",Epsilon:"Ε",epsilon:"ε",epsiv:"ϵ",eqcirc:"≖",eqcolon:"≕",eqsim:"≂",eqslantgtr:"⪖",eqslantless:"⪕",Equal:"⩵",equals:"=",EqualTilde:"≂",equest:"≟",Equilibrium:"⇌",equiv:"≡",equivDD:"⩸",eqvparsl:"⧥",erarr:"⥱",erDot:"≓",escr:"ℯ",Escr:"ℰ",esdot:"≐",Esim:"⩳",esim:"≂",Eta:"Η",eta:"η",ETH:"Ð",eth:"ð",Euml:"Ë",euml:"ë",euro:"€",excl:"!",exist:"∃",Exists:"∃",expectation:"ℰ",exponentiale:"ⅇ",ExponentialE:"ⅇ",fallingdotseq:"≒",Fcy:"Ф",fcy:"ф",female:"♀",ffilig:"ffi",fflig:"ff",ffllig:"ffl",Ffr:"𝔉",ffr:"𝔣",filig:"fi",FilledSmallSquare:"◼",FilledVerySmallSquare:"▪",fjlig:"fj",flat:"♭",fllig:"fl",fltns:"▱",fnof:"ƒ",Fopf:"𝔽",fopf:"𝕗",forall:"∀",ForAll:"∀",fork:"⋔",forkv:"⫙",Fouriertrf:"ℱ",fpartint:"⨍",frac12:"½",frac13:"⅓",frac14:"¼",frac15:"⅕",frac16:"⅙",frac18:"⅛",frac23:"⅔",frac25:"⅖",frac34:"¾",frac35:"⅗",frac38:"⅜",frac45:"⅘",frac56:"⅚",frac58:"⅝",frac78:"⅞",frasl:"⁄",frown:"⌢",fscr:"𝒻",Fscr:"ℱ",gacute:"ǵ",Gamma:"Γ",gamma:"γ",Gammad:"Ϝ",gammad:"ϝ",gap:"⪆",Gbreve:"Ğ",gbreve:"ğ",Gcedil:"Ģ",Gcirc:"Ĝ",gcirc:"ĝ",Gcy:"Г",gcy:"г",Gdot:"Ġ",gdot:"ġ",ge:"≥",gE:"≧",gEl:"⪌",gel:"⋛",geq:"≥",geqq:"≧",geqslant:"⩾",gescc:"⪩",ges:"⩾",gesdot:"⪀",gesdoto:"⪂",gesdotol:"⪄",gesl:"⋛︀",gesles:"⪔",Gfr:"𝔊",gfr:"𝔤",gg:"≫",Gg:"⋙",ggg:"⋙",gimel:"ℷ",GJcy:"Ѓ",gjcy:"ѓ",gla:"⪥",gl:"≷",glE:"⪒",glj:"⪤",gnap:"⪊",gnapprox:"⪊",gne:"⪈",gnE:"≩",gneq:"⪈",gneqq:"≩",gnsim:"⋧",Gopf:"𝔾",gopf:"𝕘",grave:"`",GreaterEqual:"≥",GreaterEqualLess:"⋛",GreaterFullEqual:"≧",GreaterGreater:"⪢",GreaterLess:"≷",GreaterSlantEqual:"⩾",GreaterTilde:"≳",Gscr:"𝒢",gscr:"ℊ",gsim:"≳",gsime:"⪎",gsiml:"⪐",gtcc:"⪧",gtcir:"⩺",gt:">",GT:">",Gt:"≫",gtdot:"⋗",gtlPar:"⦕",gtquest:"⩼",gtrapprox:"⪆",gtrarr:"⥸",gtrdot:"⋗",gtreqless:"⋛",gtreqqless:"⪌",gtrless:"≷",gtrsim:"≳",gvertneqq:"≩︀",gvnE:"≩︀",Hacek:"ˇ",hairsp:" ",half:"½",hamilt:"ℋ",HARDcy:"Ъ",hardcy:"ъ",harrcir:"⥈",harr:"↔",hArr:"⇔",harrw:"↭",Hat:"^",hbar:"ℏ",Hcirc:"Ĥ",hcirc:"ĥ",hearts:"♥",heartsuit:"♥",hellip:"…",hercon:"⊹",hfr:"𝔥",Hfr:"ℌ",HilbertSpace:"ℋ",hksearow:"⤥",hkswarow:"⤦",hoarr:"⇿",homtht:"∻",hookleftarrow:"↩",hookrightarrow:"↪",hopf:"𝕙",Hopf:"ℍ",horbar:"―",HorizontalLine:"─",hscr:"𝒽",Hscr:"ℋ",hslash:"ℏ",Hstrok:"Ħ",hstrok:"ħ",HumpDownHump:"≎",HumpEqual:"≏",hybull:"⁃",hyphen:"‐",Iacute:"Í",iacute:"í",ic:"",Icirc:"Î",icirc:"î",Icy:"И",icy:"и",Idot:"İ",IEcy:"Е",iecy:"е",iexcl:"¡",iff:"⇔",ifr:"𝔦",Ifr:"ℑ",Igrave:"Ì",igrave:"ì",ii:"ⅈ",iiiint:"⨌",iiint:"∭",iinfin:"⧜",iiota:"℩",IJlig:"IJ",ijlig:"ij",Imacr:"Ī",imacr:"ī",image:"ℑ",ImaginaryI:"ⅈ",imagline:"ℐ",imagpart:"ℑ",imath:"ı",Im:"ℑ",imof:"⊷",imped:"Ƶ",Implies:"⇒",incare:"℅",in:"∈",infin:"∞",infintie:"⧝",inodot:"ı",intcal:"⊺",int:"∫",Int:"∬",integers:"ℤ",Integral:"∫",intercal:"⊺",Intersection:"⋂",intlarhk:"⨗",intprod:"⨼",InvisibleComma:"",InvisibleTimes:"",IOcy:"Ё",iocy:"ё",Iogon:"Į",iogon:"į",Iopf:"𝕀",iopf:"𝕚",Iota:"Ι",iota:"ι",iprod:"⨼",iquest:"¿",iscr:"𝒾",Iscr:"ℐ",isin:"∈",isindot:"⋵",isinE:"⋹",isins:"⋴",isinsv:"⋳",isinv:"∈",it:"",Itilde:"Ĩ",itilde:"ĩ",Iukcy:"І",iukcy:"і",Iuml:"Ï",iuml:"ï",Jcirc:"Ĵ",jcirc:"ĵ",Jcy:"Й",jcy:"й",Jfr:"𝔍",jfr:"𝔧",jmath:"ȷ",Jopf:"𝕁",jopf:"𝕛",Jscr:"𝒥",jscr:"𝒿",Jsercy:"Ј",jsercy:"ј",Jukcy:"Є",jukcy:"є",Kappa:"Κ",kappa:"κ",kappav:"ϰ",Kcedil:"Ķ",kcedil:"ķ",Kcy:"К",kcy:"к",Kfr:"𝔎",kfr:"𝔨",kgreen:"ĸ",KHcy:"Х",khcy:"х",KJcy:"Ќ",kjcy:"ќ",Kopf:"𝕂",kopf:"𝕜",Kscr:"𝒦",kscr:"𝓀",lAarr:"⇚",Lacute:"Ĺ",lacute:"ĺ",laemptyv:"⦴",lagran:"ℒ",Lambda:"Λ",lambda:"λ",lang:"⟨",Lang:"⟪",langd:"⦑",langle:"⟨",lap:"⪅",Laplacetrf:"ℒ",laquo:"«",larrb:"⇤",larrbfs:"⤟",larr:"←",Larr:"↞",lArr:"⇐",larrfs:"⤝",larrhk:"↩",larrlp:"↫",larrpl:"⤹",larrsim:"⥳",larrtl:"↢",latail:"⤙",lAtail:"⤛",lat:"⪫",late:"⪭",lates:"⪭︀",lbarr:"⤌",lBarr:"⤎",lbbrk:"❲",lbrace:"{",lbrack:"[",lbrke:"⦋",lbrksld:"⦏",lbrkslu:"⦍",Lcaron:"Ľ",lcaron:"ľ",Lcedil:"Ļ",lcedil:"ļ",lceil:"⌈",lcub:"{",Lcy:"Л",lcy:"л",ldca:"⤶",ldquo:"“",ldquor:"„",ldrdhar:"⥧",ldrushar:"⥋",ldsh:"↲",le:"≤",lE:"≦",LeftAngleBracket:"⟨",LeftArrowBar:"⇤",leftarrow:"←",LeftArrow:"←",Leftarrow:"⇐",LeftArrowRightArrow:"⇆",leftarrowtail:"↢",LeftCeiling:"⌈",LeftDoubleBracket:"⟦",LeftDownTeeVector:"⥡",LeftDownVectorBar:"⥙",LeftDownVector:"⇃",LeftFloor:"⌊",leftharpoondown:"↽",leftharpoonup:"↼",leftleftarrows:"⇇",leftrightarrow:"↔",LeftRightArrow:"↔",Leftrightarrow:"⇔",leftrightarrows:"⇆",leftrightharpoons:"⇋",leftrightsquigarrow:"↭",LeftRightVector:"⥎",LeftTeeArrow:"↤",LeftTee:"⊣",LeftTeeVector:"⥚",leftthreetimes:"⋋",LeftTriangleBar:"⧏",LeftTriangle:"⊲",LeftTriangleEqual:"⊴",LeftUpDownVector:"⥑",LeftUpTeeVector:"⥠",LeftUpVectorBar:"⥘",LeftUpVector:"↿",LeftVectorBar:"⥒",LeftVector:"↼",lEg:"⪋",leg:"⋚",leq:"≤",leqq:"≦",leqslant:"⩽",lescc:"⪨",les:"⩽",lesdot:"⩿",lesdoto:"⪁",lesdotor:"⪃",lesg:"⋚︀",lesges:"⪓",lessapprox:"⪅",lessdot:"⋖",lesseqgtr:"⋚",lesseqqgtr:"⪋",LessEqualGreater:"⋚",LessFullEqual:"≦",LessGreater:"≶",lessgtr:"≶",LessLess:"⪡",lesssim:"≲",LessSlantEqual:"⩽",LessTilde:"≲",lfisht:"⥼",lfloor:"⌊",Lfr:"𝔏",lfr:"𝔩",lg:"≶",lgE:"⪑",lHar:"⥢",lhard:"↽",lharu:"↼",lharul:"⥪",lhblk:"▄",LJcy:"Љ",ljcy:"љ",llarr:"⇇",ll:"≪",Ll:"⋘",llcorner:"⌞",Lleftarrow:"⇚",llhard:"⥫",lltri:"◺",Lmidot:"Ŀ",lmidot:"ŀ",lmoustache:"⎰",lmoust:"⎰",lnap:"⪉",lnapprox:"⪉",lne:"⪇",lnE:"≨",lneq:"⪇",lneqq:"≨",lnsim:"⋦",loang:"⟬",loarr:"⇽",lobrk:"⟦",longleftarrow:"⟵",LongLeftArrow:"⟵",Longleftarrow:"⟸",longleftrightarrow:"⟷",LongLeftRightArrow:"⟷",Longleftrightarrow:"⟺",longmapsto:"⟼",longrightarrow:"⟶",LongRightArrow:"⟶",Longrightarrow:"⟹",looparrowleft:"↫",looparrowright:"↬",lopar:"⦅",Lopf:"𝕃",lopf:"𝕝",loplus:"⨭",lotimes:"⨴",lowast:"∗",lowbar:"_",LowerLeftArrow:"↙",LowerRightArrow:"↘",loz:"◊",lozenge:"◊",lozf:"⧫",lpar:"(",lparlt:"⦓",lrarr:"⇆",lrcorner:"⌟",lrhar:"⇋",lrhard:"⥭",lrm:"",lrtri:"⊿",lsaquo:"‹",lscr:"𝓁",Lscr:"ℒ",lsh:"↰",Lsh:"↰",lsim:"≲",lsime:"⪍",lsimg:"⪏",lsqb:"[",lsquo:"‘",lsquor:"‚",Lstrok:"Ł",lstrok:"ł",ltcc:"⪦",ltcir:"⩹",lt:"<",LT:"<",Lt:"≪",ltdot:"⋖",lthree:"⋋",ltimes:"⋉",ltlarr:"⥶",ltquest:"⩻",ltri:"◃",ltrie:"⊴",ltrif:"◂",ltrPar:"⦖",lurdshar:"⥊",luruhar:"⥦",lvertneqq:"≨︀",lvnE:"≨︀",macr:"¯",male:"♂",malt:"✠",maltese:"✠",Map:"⤅",map:"↦",mapsto:"↦",mapstodown:"↧",mapstoleft:"↤",mapstoup:"↥",marker:"▮",mcomma:"⨩",Mcy:"М",mcy:"м",mdash:"—",mDDot:"∺",measuredangle:"∡",MediumSpace:" ",Mellintrf:"ℳ",Mfr:"𝔐",mfr:"𝔪",mho:"℧",micro:"µ",midast:"*",midcir:"⫰",mid:"∣",middot:"·",minusb:"⊟",minus:"−",minusd:"∸",minusdu:"⨪",MinusPlus:"∓",mlcp:"⫛",mldr:"…",mnplus:"∓",models:"⊧",Mopf:"𝕄",mopf:"𝕞",mp:"∓",mscr:"𝓂",Mscr:"ℳ",mstpos:"∾",Mu:"Μ",mu:"μ",multimap:"⊸",mumap:"⊸",nabla:"∇",Nacute:"Ń",nacute:"ń",nang:"∠⃒",nap:"≉",napE:"⩰̸",napid:"≋̸",napos:"ʼn",napprox:"≉",natural:"♮",naturals:"ℕ",natur:"♮",nbsp:" ",nbump:"≎̸",nbumpe:"≏̸",ncap:"⩃",Ncaron:"Ň",ncaron:"ň",Ncedil:"Ņ",ncedil:"ņ",ncong:"≇",ncongdot:"⩭̸",ncup:"⩂",Ncy:"Н",ncy:"н",ndash:"–",nearhk:"⤤",nearr:"↗",neArr:"⇗",nearrow:"↗",ne:"≠",nedot:"≐̸",NegativeMediumSpace:"",NegativeThickSpace:"",NegativeThinSpace:"",NegativeVeryThinSpace:"",nequiv:"≢",nesear:"⤨",nesim:"≂̸",NestedGreaterGreater:"≫",NestedLessLess:"≪",NewLine:`
|
|
247
|
-
`,nexist:"∄",nexists:"∄",Nfr:"𝔑",nfr:"𝔫",ngE:"≧̸",nge:"≱",ngeq:"≱",ngeqq:"≧̸",ngeqslant:"⩾̸",nges:"⩾̸",nGg:"⋙̸",ngsim:"≵",nGt:"≫⃒",ngt:"≯",ngtr:"≯",nGtv:"≫̸",nharr:"↮",nhArr:"⇎",nhpar:"⫲",ni:"∋",nis:"⋼",nisd:"⋺",niv:"∋",NJcy:"Њ",njcy:"њ",nlarr:"↚",nlArr:"⇍",nldr:"‥",nlE:"≦̸",nle:"≰",nleftarrow:"↚",nLeftarrow:"⇍",nleftrightarrow:"↮",nLeftrightarrow:"⇎",nleq:"≰",nleqq:"≦̸",nleqslant:"⩽̸",nles:"⩽̸",nless:"≮",nLl:"⋘̸",nlsim:"≴",nLt:"≪⃒",nlt:"≮",nltri:"⋪",nltrie:"⋬",nLtv:"≪̸",nmid:"∤",NoBreak:"",NonBreakingSpace:" ",nopf:"𝕟",Nopf:"ℕ",Not:"⫬",not:"¬",NotCongruent:"≢",NotCupCap:"≭",NotDoubleVerticalBar:"∦",NotElement:"∉",NotEqual:"≠",NotEqualTilde:"≂̸",NotExists:"∄",NotGreater:"≯",NotGreaterEqual:"≱",NotGreaterFullEqual:"≧̸",NotGreaterGreater:"≫̸",NotGreaterLess:"≹",NotGreaterSlantEqual:"⩾̸",NotGreaterTilde:"≵",NotHumpDownHump:"≎̸",NotHumpEqual:"≏̸",notin:"∉",notindot:"⋵̸",notinE:"⋹̸",notinva:"∉",notinvb:"⋷",notinvc:"⋶",NotLeftTriangleBar:"⧏̸",NotLeftTriangle:"⋪",NotLeftTriangleEqual:"⋬",NotLess:"≮",NotLessEqual:"≰",NotLessGreater:"≸",NotLessLess:"≪̸",NotLessSlantEqual:"⩽̸",NotLessTilde:"≴",NotNestedGreaterGreater:"⪢̸",NotNestedLessLess:"⪡̸",notni:"∌",notniva:"∌",notnivb:"⋾",notnivc:"⋽",NotPrecedes:"⊀",NotPrecedesEqual:"⪯̸",NotPrecedesSlantEqual:"⋠",NotReverseElement:"∌",NotRightTriangleBar:"⧐̸",NotRightTriangle:"⋫",NotRightTriangleEqual:"⋭",NotSquareSubset:"⊏̸",NotSquareSubsetEqual:"⋢",NotSquareSuperset:"⊐̸",NotSquareSupersetEqual:"⋣",NotSubset:"⊂⃒",NotSubsetEqual:"⊈",NotSucceeds:"⊁",NotSucceedsEqual:"⪰̸",NotSucceedsSlantEqual:"⋡",NotSucceedsTilde:"≿̸",NotSuperset:"⊃⃒",NotSupersetEqual:"⊉",NotTilde:"≁",NotTildeEqual:"≄",NotTildeFullEqual:"≇",NotTildeTilde:"≉",NotVerticalBar:"∤",nparallel:"∦",npar:"∦",nparsl:"⫽⃥",npart:"∂̸",npolint:"⨔",npr:"⊀",nprcue:"⋠",nprec:"⊀",npreceq:"⪯̸",npre:"⪯̸",nrarrc:"⤳̸",nrarr:"↛",nrArr:"⇏",nrarrw:"↝̸",nrightarrow:"↛",nRightarrow:"⇏",nrtri:"⋫",nrtrie:"⋭",nsc:"⊁",nsccue:"⋡",nsce:"⪰̸",Nscr:"𝒩",nscr:"𝓃",nshortmid:"∤",nshortparallel:"∦",nsim:"≁",nsime:"≄",nsimeq:"≄",nsmid:"∤",nspar:"∦",nsqsube:"⋢",nsqsupe:"⋣",nsub:"⊄",nsubE:"⫅̸",nsube:"⊈",nsubset:"⊂⃒",nsubseteq:"⊈",nsubseteqq:"⫅̸",nsucc:"⊁",nsucceq:"⪰̸",nsup:"⊅",nsupE:"⫆̸",nsupe:"⊉",nsupset:"⊃⃒",nsupseteq:"⊉",nsupseteqq:"⫆̸",ntgl:"≹",Ntilde:"Ñ",ntilde:"ñ",ntlg:"≸",ntriangleleft:"⋪",ntrianglelefteq:"⋬",ntriangleright:"⋫",ntrianglerighteq:"⋭",Nu:"Ν",nu:"ν",num:"#",numero:"№",numsp:" ",nvap:"≍⃒",nvdash:"⊬",nvDash:"⊭",nVdash:"⊮",nVDash:"⊯",nvge:"≥⃒",nvgt:">⃒",nvHarr:"⤄",nvinfin:"⧞",nvlArr:"⤂",nvle:"≤⃒",nvlt:"<⃒",nvltrie:"⊴⃒",nvrArr:"⤃",nvrtrie:"⊵⃒",nvsim:"∼⃒",nwarhk:"⤣",nwarr:"↖",nwArr:"⇖",nwarrow:"↖",nwnear:"⤧",Oacute:"Ó",oacute:"ó",oast:"⊛",Ocirc:"Ô",ocirc:"ô",ocir:"⊚",Ocy:"О",ocy:"о",odash:"⊝",Odblac:"Ő",odblac:"ő",odiv:"⨸",odot:"⊙",odsold:"⦼",OElig:"Œ",oelig:"œ",ofcir:"⦿",Ofr:"𝔒",ofr:"𝔬",ogon:"˛",Ograve:"Ò",ograve:"ò",ogt:"⧁",ohbar:"⦵",ohm:"Ω",oint:"∮",olarr:"↺",olcir:"⦾",olcross:"⦻",oline:"‾",olt:"⧀",Omacr:"Ō",omacr:"ō",Omega:"Ω",omega:"ω",Omicron:"Ο",omicron:"ο",omid:"⦶",ominus:"⊖",Oopf:"𝕆",oopf:"𝕠",opar:"⦷",OpenCurlyDoubleQuote:"“",OpenCurlyQuote:"‘",operp:"⦹",oplus:"⊕",orarr:"↻",Or:"⩔",or:"∨",ord:"⩝",order:"ℴ",orderof:"ℴ",ordf:"ª",ordm:"º",origof:"⊶",oror:"⩖",orslope:"⩗",orv:"⩛",oS:"Ⓢ",Oscr:"𝒪",oscr:"ℴ",Oslash:"Ø",oslash:"ø",osol:"⊘",Otilde:"Õ",otilde:"õ",otimesas:"⨶",Otimes:"⨷",otimes:"⊗",Ouml:"Ö",ouml:"ö",ovbar:"⌽",OverBar:"‾",OverBrace:"⏞",OverBracket:"⎴",OverParenthesis:"⏜",para:"¶",parallel:"∥",par:"∥",parsim:"⫳",parsl:"⫽",part:"∂",PartialD:"∂",Pcy:"П",pcy:"п",percnt:"%",period:".",permil:"‰",perp:"⊥",pertenk:"‱",Pfr:"𝔓",pfr:"𝔭",Phi:"Φ",phi:"φ",phiv:"ϕ",phmmat:"ℳ",phone:"☎",Pi:"Π",pi:"π",pitchfork:"⋔",piv:"ϖ",planck:"ℏ",planckh:"ℎ",plankv:"ℏ",plusacir:"⨣",plusb:"⊞",pluscir:"⨢",plus:"+",plusdo:"∔",plusdu:"⨥",pluse:"⩲",PlusMinus:"±",plusmn:"±",plussim:"⨦",plustwo:"⨧",pm:"±",Poincareplane:"ℌ",pointint:"⨕",popf:"𝕡",Popf:"ℙ",pound:"£",prap:"⪷",Pr:"⪻",pr:"≺",prcue:"≼",precapprox:"⪷",prec:"≺",preccurlyeq:"≼",Precedes:"≺",PrecedesEqual:"⪯",PrecedesSlantEqual:"≼",PrecedesTilde:"≾",preceq:"⪯",precnapprox:"⪹",precneqq:"⪵",precnsim:"⋨",pre:"⪯",prE:"⪳",precsim:"≾",prime:"′",Prime:"″",primes:"ℙ",prnap:"⪹",prnE:"⪵",prnsim:"⋨",prod:"∏",Product:"∏",profalar:"⌮",profline:"⌒",profsurf:"⌓",prop:"∝",Proportional:"∝",Proportion:"∷",propto:"∝",prsim:"≾",prurel:"⊰",Pscr:"𝒫",pscr:"𝓅",Psi:"Ψ",psi:"ψ",puncsp:" ",Qfr:"𝔔",qfr:"𝔮",qint:"⨌",qopf:"𝕢",Qopf:"ℚ",qprime:"⁗",Qscr:"𝒬",qscr:"𝓆",quaternions:"ℍ",quatint:"⨖",quest:"?",questeq:"≟",quot:'"',QUOT:'"',rAarr:"⇛",race:"∽̱",Racute:"Ŕ",racute:"ŕ",radic:"√",raemptyv:"⦳",rang:"⟩",Rang:"⟫",rangd:"⦒",range:"⦥",rangle:"⟩",raquo:"»",rarrap:"⥵",rarrb:"⇥",rarrbfs:"⤠",rarrc:"⤳",rarr:"→",Rarr:"↠",rArr:"⇒",rarrfs:"⤞",rarrhk:"↪",rarrlp:"↬",rarrpl:"⥅",rarrsim:"⥴",Rarrtl:"⤖",rarrtl:"↣",rarrw:"↝",ratail:"⤚",rAtail:"⤜",ratio:"∶",rationals:"ℚ",rbarr:"⤍",rBarr:"⤏",RBarr:"⤐",rbbrk:"❳",rbrace:"}",rbrack:"]",rbrke:"⦌",rbrksld:"⦎",rbrkslu:"⦐",Rcaron:"Ř",rcaron:"ř",Rcedil:"Ŗ",rcedil:"ŗ",rceil:"⌉",rcub:"}",Rcy:"Р",rcy:"р",rdca:"⤷",rdldhar:"⥩",rdquo:"”",rdquor:"”",rdsh:"↳",real:"ℜ",realine:"ℛ",realpart:"ℜ",reals:"ℝ",Re:"ℜ",rect:"▭",reg:"®",REG:"®",ReverseElement:"∋",ReverseEquilibrium:"⇋",ReverseUpEquilibrium:"⥯",rfisht:"⥽",rfloor:"⌋",rfr:"𝔯",Rfr:"ℜ",rHar:"⥤",rhard:"⇁",rharu:"⇀",rharul:"⥬",Rho:"Ρ",rho:"ρ",rhov:"ϱ",RightAngleBracket:"⟩",RightArrowBar:"⇥",rightarrow:"→",RightArrow:"→",Rightarrow:"⇒",RightArrowLeftArrow:"⇄",rightarrowtail:"↣",RightCeiling:"⌉",RightDoubleBracket:"⟧",RightDownTeeVector:"⥝",RightDownVectorBar:"⥕",RightDownVector:"⇂",RightFloor:"⌋",rightharpoondown:"⇁",rightharpoonup:"⇀",rightleftarrows:"⇄",rightleftharpoons:"⇌",rightrightarrows:"⇉",rightsquigarrow:"↝",RightTeeArrow:"↦",RightTee:"⊢",RightTeeVector:"⥛",rightthreetimes:"⋌",RightTriangleBar:"⧐",RightTriangle:"⊳",RightTriangleEqual:"⊵",RightUpDownVector:"⥏",RightUpTeeVector:"⥜",RightUpVectorBar:"⥔",RightUpVector:"↾",RightVectorBar:"⥓",RightVector:"⇀",ring:"˚",risingdotseq:"≓",rlarr:"⇄",rlhar:"⇌",rlm:"",rmoustache:"⎱",rmoust:"⎱",rnmid:"⫮",roang:"⟭",roarr:"⇾",robrk:"⟧",ropar:"⦆",ropf:"𝕣",Ropf:"ℝ",roplus:"⨮",rotimes:"⨵",RoundImplies:"⥰",rpar:")",rpargt:"⦔",rppolint:"⨒",rrarr:"⇉",Rrightarrow:"⇛",rsaquo:"›",rscr:"𝓇",Rscr:"ℛ",rsh:"↱",Rsh:"↱",rsqb:"]",rsquo:"’",rsquor:"’",rthree:"⋌",rtimes:"⋊",rtri:"▹",rtrie:"⊵",rtrif:"▸",rtriltri:"⧎",RuleDelayed:"⧴",ruluhar:"⥨",rx:"℞",Sacute:"Ś",sacute:"ś",sbquo:"‚",scap:"⪸",Scaron:"Š",scaron:"š",Sc:"⪼",sc:"≻",sccue:"≽",sce:"⪰",scE:"⪴",Scedil:"Ş",scedil:"ş",Scirc:"Ŝ",scirc:"ŝ",scnap:"⪺",scnE:"⪶",scnsim:"⋩",scpolint:"⨓",scsim:"≿",Scy:"С",scy:"с",sdotb:"⊡",sdot:"⋅",sdote:"⩦",searhk:"⤥",searr:"↘",seArr:"⇘",searrow:"↘",sect:"§",semi:";",seswar:"⤩",setminus:"∖",setmn:"∖",sext:"✶",Sfr:"𝔖",sfr:"𝔰",sfrown:"⌢",sharp:"♯",SHCHcy:"Щ",shchcy:"щ",SHcy:"Ш",shcy:"ш",ShortDownArrow:"↓",ShortLeftArrow:"←",shortmid:"∣",shortparallel:"∥",ShortRightArrow:"→",ShortUpArrow:"↑",shy:"",Sigma:"Σ",sigma:"σ",sigmaf:"ς",sigmav:"ς",sim:"∼",simdot:"⩪",sime:"≃",simeq:"≃",simg:"⪞",simgE:"⪠",siml:"⪝",simlE:"⪟",simne:"≆",simplus:"⨤",simrarr:"⥲",slarr:"←",SmallCircle:"∘",smallsetminus:"∖",smashp:"⨳",smeparsl:"⧤",smid:"∣",smile:"⌣",smt:"⪪",smte:"⪬",smtes:"⪬︀",SOFTcy:"Ь",softcy:"ь",solbar:"⌿",solb:"⧄",sol:"/",Sopf:"𝕊",sopf:"𝕤",spades:"♠",spadesuit:"♠",spar:"∥",sqcap:"⊓",sqcaps:"⊓︀",sqcup:"⊔",sqcups:"⊔︀",Sqrt:"√",sqsub:"⊏",sqsube:"⊑",sqsubset:"⊏",sqsubseteq:"⊑",sqsup:"⊐",sqsupe:"⊒",sqsupset:"⊐",sqsupseteq:"⊒",square:"□",Square:"□",SquareIntersection:"⊓",SquareSubset:"⊏",SquareSubsetEqual:"⊑",SquareSuperset:"⊐",SquareSupersetEqual:"⊒",SquareUnion:"⊔",squarf:"▪",squ:"□",squf:"▪",srarr:"→",Sscr:"𝒮",sscr:"𝓈",ssetmn:"∖",ssmile:"⌣",sstarf:"⋆",Star:"⋆",star:"☆",starf:"★",straightepsilon:"ϵ",straightphi:"ϕ",strns:"¯",sub:"⊂",Sub:"⋐",subdot:"⪽",subE:"⫅",sube:"⊆",subedot:"⫃",submult:"⫁",subnE:"⫋",subne:"⊊",subplus:"⪿",subrarr:"⥹",subset:"⊂",Subset:"⋐",subseteq:"⊆",subseteqq:"⫅",SubsetEqual:"⊆",subsetneq:"⊊",subsetneqq:"⫋",subsim:"⫇",subsub:"⫕",subsup:"⫓",succapprox:"⪸",succ:"≻",succcurlyeq:"≽",Succeeds:"≻",SucceedsEqual:"⪰",SucceedsSlantEqual:"≽",SucceedsTilde:"≿",succeq:"⪰",succnapprox:"⪺",succneqq:"⪶",succnsim:"⋩",succsim:"≿",SuchThat:"∋",sum:"∑",Sum:"∑",sung:"♪",sup1:"¹",sup2:"²",sup3:"³",sup:"⊃",Sup:"⋑",supdot:"⪾",supdsub:"⫘",supE:"⫆",supe:"⊇",supedot:"⫄",Superset:"⊃",SupersetEqual:"⊇",suphsol:"⟉",suphsub:"⫗",suplarr:"⥻",supmult:"⫂",supnE:"⫌",supne:"⊋",supplus:"⫀",supset:"⊃",Supset:"⋑",supseteq:"⊇",supseteqq:"⫆",supsetneq:"⊋",supsetneqq:"⫌",supsim:"⫈",supsub:"⫔",supsup:"⫖",swarhk:"⤦",swarr:"↙",swArr:"⇙",swarrow:"↙",swnwar:"⤪",szlig:"ß",Tab:" ",target:"⌖",Tau:"Τ",tau:"τ",tbrk:"⎴",Tcaron:"Ť",tcaron:"ť",Tcedil:"Ţ",tcedil:"ţ",Tcy:"Т",tcy:"т",tdot:"⃛",telrec:"⌕",Tfr:"𝔗",tfr:"𝔱",there4:"∴",therefore:"∴",Therefore:"∴",Theta:"Θ",theta:"θ",thetasym:"ϑ",thetav:"ϑ",thickapprox:"≈",thicksim:"∼",ThickSpace:" ",ThinSpace:" ",thinsp:" ",thkap:"≈",thksim:"∼",THORN:"Þ",thorn:"þ",tilde:"˜",Tilde:"∼",TildeEqual:"≃",TildeFullEqual:"≅",TildeTilde:"≈",timesbar:"⨱",timesb:"⊠",times:"×",timesd:"⨰",tint:"∭",toea:"⤨",topbot:"⌶",topcir:"⫱",top:"⊤",Topf:"𝕋",topf:"𝕥",topfork:"⫚",tosa:"⤩",tprime:"‴",trade:"™",TRADE:"™",triangle:"▵",triangledown:"▿",triangleleft:"◃",trianglelefteq:"⊴",triangleq:"≜",triangleright:"▹",trianglerighteq:"⊵",tridot:"◬",trie:"≜",triminus:"⨺",TripleDot:"⃛",triplus:"⨹",trisb:"⧍",tritime:"⨻",trpezium:"⏢",Tscr:"𝒯",tscr:"𝓉",TScy:"Ц",tscy:"ц",TSHcy:"Ћ",tshcy:"ћ",Tstrok:"Ŧ",tstrok:"ŧ",twixt:"≬",twoheadleftarrow:"↞",twoheadrightarrow:"↠",Uacute:"Ú",uacute:"ú",uarr:"↑",Uarr:"↟",uArr:"⇑",Uarrocir:"⥉",Ubrcy:"Ў",ubrcy:"ў",Ubreve:"Ŭ",ubreve:"ŭ",Ucirc:"Û",ucirc:"û",Ucy:"У",ucy:"у",udarr:"⇅",Udblac:"Ű",udblac:"ű",udhar:"⥮",ufisht:"⥾",Ufr:"𝔘",ufr:"𝔲",Ugrave:"Ù",ugrave:"ù",uHar:"⥣",uharl:"↿",uharr:"↾",uhblk:"▀",ulcorn:"⌜",ulcorner:"⌜",ulcrop:"⌏",ultri:"◸",Umacr:"Ū",umacr:"ū",uml:"¨",UnderBar:"_",UnderBrace:"⏟",UnderBracket:"⎵",UnderParenthesis:"⏝",Union:"⋃",UnionPlus:"⊎",Uogon:"Ų",uogon:"ų",Uopf:"𝕌",uopf:"𝕦",UpArrowBar:"⤒",uparrow:"↑",UpArrow:"↑",Uparrow:"⇑",UpArrowDownArrow:"⇅",updownarrow:"↕",UpDownArrow:"↕",Updownarrow:"⇕",UpEquilibrium:"⥮",upharpoonleft:"↿",upharpoonright:"↾",uplus:"⊎",UpperLeftArrow:"↖",UpperRightArrow:"↗",upsi:"υ",Upsi:"ϒ",upsih:"ϒ",Upsilon:"Υ",upsilon:"υ",UpTeeArrow:"↥",UpTee:"⊥",upuparrows:"⇈",urcorn:"⌝",urcorner:"⌝",urcrop:"⌎",Uring:"Ů",uring:"ů",urtri:"◹",Uscr:"𝒰",uscr:"𝓊",utdot:"⋰",Utilde:"Ũ",utilde:"ũ",utri:"▵",utrif:"▴",uuarr:"⇈",Uuml:"Ü",uuml:"ü",uwangle:"⦧",vangrt:"⦜",varepsilon:"ϵ",varkappa:"ϰ",varnothing:"∅",varphi:"ϕ",varpi:"ϖ",varpropto:"∝",varr:"↕",vArr:"⇕",varrho:"ϱ",varsigma:"ς",varsubsetneq:"⊊︀",varsubsetneqq:"⫋︀",varsupsetneq:"⊋︀",varsupsetneqq:"⫌︀",vartheta:"ϑ",vartriangleleft:"⊲",vartriangleright:"⊳",vBar:"⫨",Vbar:"⫫",vBarv:"⫩",Vcy:"В",vcy:"в",vdash:"⊢",vDash:"⊨",Vdash:"⊩",VDash:"⊫",Vdashl:"⫦",veebar:"⊻",vee:"∨",Vee:"⋁",veeeq:"≚",vellip:"⋮",verbar:"|",Verbar:"‖",vert:"|",Vert:"‖",VerticalBar:"∣",VerticalLine:"|",VerticalSeparator:"❘",VerticalTilde:"≀",VeryThinSpace:" ",Vfr:"𝔙",vfr:"𝔳",vltri:"⊲",vnsub:"⊂⃒",vnsup:"⊃⃒",Vopf:"𝕍",vopf:"𝕧",vprop:"∝",vrtri:"⊳",Vscr:"𝒱",vscr:"𝓋",vsubnE:"⫋︀",vsubne:"⊊︀",vsupnE:"⫌︀",vsupne:"⊋︀",Vvdash:"⊪",vzigzag:"⦚",Wcirc:"Ŵ",wcirc:"ŵ",wedbar:"⩟",wedge:"∧",Wedge:"⋀",wedgeq:"≙",weierp:"℘",Wfr:"𝔚",wfr:"𝔴",Wopf:"𝕎",wopf:"𝕨",wp:"℘",wr:"≀",wreath:"≀",Wscr:"𝒲",wscr:"𝓌",xcap:"⋂",xcirc:"◯",xcup:"⋃",xdtri:"▽",Xfr:"𝔛",xfr:"𝔵",xharr:"⟷",xhArr:"⟺",Xi:"Ξ",xi:"ξ",xlarr:"⟵",xlArr:"⟸",xmap:"⟼",xnis:"⋻",xodot:"⨀",Xopf:"𝕏",xopf:"𝕩",xoplus:"⨁",xotime:"⨂",xrarr:"⟶",xrArr:"⟹",Xscr:"𝒳",xscr:"𝓍",xsqcup:"⨆",xuplus:"⨄",xutri:"△",xvee:"⋁",xwedge:"⋀",Yacute:"Ý",yacute:"ý",YAcy:"Я",yacy:"я",Ycirc:"Ŷ",ycirc:"ŷ",Ycy:"Ы",ycy:"ы",yen:"¥",Yfr:"𝔜",yfr:"𝔶",YIcy:"Ї",yicy:"ї",Yopf:"𝕐",yopf:"𝕪",Yscr:"𝒴",yscr:"𝓎",YUcy:"Ю",yucy:"ю",yuml:"ÿ",Yuml:"Ÿ",Zacute:"Ź",zacute:"ź",Zcaron:"Ž",zcaron:"ž",Zcy:"З",zcy:"з",Zdot:"Ż",zdot:"ż",zeetrf:"ℨ",ZeroWidthSpace:"",Zeta:"Ζ",zeta:"ζ",zfr:"𝔷",Zfr:"ℨ",ZHcy:"Ж",zhcy:"ж",zigrarr:"⇝",zopf:"𝕫",Zopf:"ℤ",Zscr:"𝒵",zscr:"𝓏",zwj:"",zwnj:""}}}),fC=qe({"node_modules/markdown-it/lib/common/entities.js"(n,e){e.exports=W4()}}),ZO=qe({"node_modules/uc.micro/categories/P/regex.js"(n,e){e.exports=/[!-#%-\*,-\/:;\?@\[-\]_\{\}\xA1\xA7\xAB\xB6\xB7\xBB\xBF\u037E\u0387\u055A-\u055F\u0589\u058A\u05BE\u05C0\u05C3\u05C6\u05F3\u05F4\u0609\u060A\u060C\u060D\u061B\u061E\u061F\u066A-\u066D\u06D4\u0700-\u070D\u07F7-\u07F9\u0830-\u083E\u085E\u0964\u0965\u0970\u09FD\u0A76\u0AF0\u0C84\u0DF4\u0E4F\u0E5A\u0E5B\u0F04-\u0F12\u0F14\u0F3A-\u0F3D\u0F85\u0FD0-\u0FD4\u0FD9\u0FDA\u104A-\u104F\u10FB\u1360-\u1368\u1400\u166D\u166E\u169B\u169C\u16EB-\u16ED\u1735\u1736\u17D4-\u17D6\u17D8-\u17DA\u1800-\u180A\u1944\u1945\u1A1E\u1A1F\u1AA0-\u1AA6\u1AA8-\u1AAD\u1B5A-\u1B60\u1BFC-\u1BFF\u1C3B-\u1C3F\u1C7E\u1C7F\u1CC0-\u1CC7\u1CD3\u2010-\u2027\u2030-\u2043\u2045-\u2051\u2053-\u205E\u207D\u207E\u208D\u208E\u2308-\u230B\u2329\u232A\u2768-\u2775\u27C5\u27C6\u27E6-\u27EF\u2983-\u2998\u29D8-\u29DB\u29FC\u29FD\u2CF9-\u2CFC\u2CFE\u2CFF\u2D70\u2E00-\u2E2E\u2E30-\u2E4E\u3001-\u3003\u3008-\u3011\u3014-\u301F\u3030\u303D\u30A0\u30FB\uA4FE\uA4FF\uA60D-\uA60F\uA673\uA67E\uA6F2-\uA6F7\uA874-\uA877\uA8CE\uA8CF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA95F\uA9C1-\uA9CD\uA9DE\uA9DF\uAA5C-\uAA5F\uAADE\uAADF\uAAF0\uAAF1\uABEB\uFD3E\uFD3F\uFE10-\uFE19\uFE30-\uFE52\uFE54-\uFE61\uFE63\uFE68\uFE6A\uFE6B\uFF01-\uFF03\uFF05-\uFF0A\uFF0C-\uFF0F\uFF1A\uFF1B\uFF1F\uFF20\uFF3B-\uFF3D\uFF3F\uFF5B\uFF5D\uFF5F-\uFF65]|\uD800[\uDD00-\uDD02\uDF9F\uDFD0]|\uD801\uDD6F|\uD802[\uDC57\uDD1F\uDD3F\uDE50-\uDE58\uDE7F\uDEF0-\uDEF6\uDF39-\uDF3F\uDF99-\uDF9C]|\uD803[\uDF55-\uDF59]|\uD804[\uDC47-\uDC4D\uDCBB\uDCBC\uDCBE-\uDCC1\uDD40-\uDD43\uDD74\uDD75\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDDF\uDE38-\uDE3D\uDEA9]|\uD805[\uDC4B-\uDC4F\uDC5B\uDC5D\uDCC6\uDDC1-\uDDD7\uDE41-\uDE43\uDE60-\uDE6C\uDF3C-\uDF3E]|\uD806[\uDC3B\uDE3F-\uDE46\uDE9A-\uDE9C\uDE9E-\uDEA2]|\uD807[\uDC41-\uDC45\uDC70\uDC71\uDEF7\uDEF8]|\uD809[\uDC70-\uDC74]|\uD81A[\uDE6E\uDE6F\uDEF5\uDF37-\uDF3B\uDF44]|\uD81B[\uDE97-\uDE9A]|\uD82F\uDC9F|\uD836[\uDE87-\uDE8B]|\uD83A[\uDD5E\uDD5F]/}}),Y4=qe({"node_modules/mdurl/encode.js"(n,e){var t={};function r(s){var o,a,l=t[s];if(l)return l;for(l=t[s]=[],o=0;o<128;o++)a=String.fromCharCode(o),/^[0-9a-z]$/i.test(a)?l.push(a):l.push("%"+("0"+o.toString(16).toUpperCase()).slice(-2));for(o=0;o<s.length;o++)l[s.charCodeAt(o)]=s[o];return l}function i(s,o,a){var l,c,u,f,d,h="";for(typeof o!="string"&&(a=o,o=i.defaultChars),typeof a>"u"&&(a=!0),d=r(o),l=0,c=s.length;l<c;l++){if(u=s.charCodeAt(l),a&&u===37&&l+2<c&&/^[0-9a-f]{2}$/i.test(s.slice(l+1,l+3))){h+=s.slice(l,l+3),l+=2;continue}if(u<128){h+=d[u];continue}if(u>=55296&&u<=57343){if(u>=55296&&u<=56319&&l+1<c&&(f=s.charCodeAt(l+1),f>=56320&&f<=57343)){h+=encodeURIComponent(s[l]+s[l+1]),l++;continue}h+="%EF%BF%BD";continue}h+=encodeURIComponent(s[l])}return h}i.defaultChars=";/?:@&=+$,-_.!~*'()#",i.componentChars="-_.!~*'()",e.exports=i}}),U4=qe({"node_modules/mdurl/decode.js"(n,e){var t={};function r(s){var o,a,l=t[s];if(l)return l;for(l=t[s]=[],o=0;o<128;o++)a=String.fromCharCode(o),l.push(a);for(o=0;o<s.length;o++)a=s.charCodeAt(o),l[a]="%"+("0"+a.toString(16).toUpperCase()).slice(-2);return l}function i(s,o){var a;return typeof o!="string"&&(o=i.defaultChars),a=r(o),s.replace(/(%[a-f0-9]{2})+/gi,function(l){var c,u,f,d,h,m,p,v="";for(c=0,u=l.length;c<u;c+=3){if(f=parseInt(l.slice(c+1,c+3),16),f<128){v+=a[f];continue}if((f&224)===192&&c+3<u&&(d=parseInt(l.slice(c+4,c+6),16),(d&192)===128)){p=f<<6&1984|d&63,p<128?v+="��":v+=String.fromCharCode(p),c+=3;continue}if((f&240)===224&&c+6<u&&(d=parseInt(l.slice(c+4,c+6),16),h=parseInt(l.slice(c+7,c+9),16),(d&192)===128&&(h&192)===128)){p=f<<12&61440|d<<6&4032|h&63,p<2048||p>=55296&&p<=57343?v+="���":v+=String.fromCharCode(p),c+=6;continue}if((f&248)===240&&c+9<u&&(d=parseInt(l.slice(c+4,c+6),16),h=parseInt(l.slice(c+7,c+9),16),m=parseInt(l.slice(c+10,c+12),16),(d&192)===128&&(h&192)===128&&(m&192)===128)){p=f<<18&1835008|d<<12&258048|h<<6&4032|m&63,p<65536||p>1114111?v+="����":(p-=65536,v+=String.fromCharCode(55296+(p>>10),56320+(p&1023))),c+=9;continue}v+="�"}return v})}i.defaultChars=";/?:@&=+$,#",i.componentChars="",e.exports=i}}),G4=qe({"node_modules/mdurl/format.js"(n,e){e.exports=function(r){var i="";return i+=r.protocol||"",i+=r.slashes?"//":"",i+=r.auth?r.auth+"@":"",r.hostname&&r.hostname.indexOf(":")!==-1?i+="["+r.hostname+"]":i+=r.hostname||"",i+=r.port?":"+r.port:"",i+=r.pathname||"",i+=r.search||"",i+=r.hash||"",i}}}),H4=qe({"node_modules/mdurl/parse.js"(n,e){function t(){this.protocol=null,this.slashes=null,this.auth=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.pathname=null}var r=/^([a-z0-9.+-]+:)/i,i=/:[0-9]*$/,s=/^(\/\/?(?!\/)[^\?\s]*)(\?[^\s]*)?$/,o=["<",">",'"',"`"," ","\r",`
|
|
248
|
-
`," "],a=["{","}","|","\\","^","`"].concat(o),l=["'"].concat(a),c=["%","/","?",";","#"].concat(l),u=["/","?","#"],f=255,d=/^[+a-z0-9A-Z_-]{0,63}$/,h=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,m={javascript:!0,"javascript:":!0},p={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0};function v(O,b){if(O&&O instanceof t)return O;var w=new t;return w.parse(O,b),w}t.prototype.parse=function(O,b){var w,S,_,x,A,C=O;if(C=C.trim(),!b&&O.split("#").length===1){var y=s.exec(C);if(y)return this.pathname=y[1],y[2]&&(this.search=y[2]),this}var k=r.exec(C);if(k&&(k=k[0],_=k.toLowerCase(),this.protocol=k,C=C.substr(k.length)),(b||k||C.match(/^\/\/[^@\/]+@[^@\/]+/))&&(A=C.substr(0,2)==="//",A&&!(k&&m[k])&&(C=C.substr(2),this.slashes=!0)),!m[k]&&(A||k&&!p[k])){var P=-1;for(w=0;w<u.length;w++)x=C.indexOf(u[w]),x!==-1&&(P===-1||x<P)&&(P=x);var T,E;for(P===-1?E=C.lastIndexOf("@"):E=C.lastIndexOf("@",P),E!==-1&&(T=C.slice(0,E),C=C.slice(E+1),this.auth=T),P=-1,w=0;w<c.length;w++)x=C.indexOf(c[w]),x!==-1&&(P===-1||x<P)&&(P=x);P===-1&&(P=C.length),C[P-1]===":"&&P--;var Q=C.slice(0,P);C=C.slice(P),this.parseHost(Q),this.hostname=this.hostname||"";var $=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!$){var L=this.hostname.split(/\./);for(w=0,S=L.length;w<S;w++){var I=L[w];if(I&&!I.match(d)){for(var Z="",Y=0,ne=I.length;Y<ne;Y++)I.charCodeAt(Y)>127?Z+="x":Z+=I[Y];if(!Z.match(d)){var ae=L.slice(0,w),ie=L.slice(w+1),K=I.match(h);K&&(ae.push(K[1]),ie.unshift(K[2])),ie.length&&(C=ie.join(".")+C),this.hostname=ae.join(".");break}}}}this.hostname.length>f&&(this.hostname=""),$&&(this.hostname=this.hostname.substr(1,this.hostname.length-2))}var he=C.indexOf("#");he!==-1&&(this.hash=C.substr(he),C=C.slice(0,he));var fe=C.indexOf("?");return fe!==-1&&(this.search=C.substr(fe),C=C.slice(0,fe)),C&&(this.pathname=C),p[_]&&this.hostname&&!this.pathname&&(this.pathname=""),this},t.prototype.parseHost=function(O){var b=i.exec(O);b&&(b=b[0],b!==":"&&(this.port=b.substr(1)),O=O.substr(0,O.length-b.length)),O&&(this.hostname=O)},e.exports=v}}),dC=qe({"node_modules/mdurl/index.js"(n,e){e.exports.encode=Y4(),e.exports.decode=U4(),e.exports.format=G4(),e.exports.parse=H4()}}),hC=qe({"node_modules/uc.micro/properties/Any/regex.js"(n,e){e.exports=/[\0-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/}}),pC=qe({"node_modules/uc.micro/categories/Cc/regex.js"(n,e){e.exports=/[\0-\x1F\x7F-\x9F]/}}),K4=qe({"node_modules/uc.micro/categories/Cf/regex.js"(n,e){e.exports=/[\xAD\u0600-\u0605\u061C\u06DD\u070F\u08E2\u180E\u200B-\u200F\u202A-\u202E\u2060-\u2064\u2066-\u206F\uFEFF\uFFF9-\uFFFB]|\uD804[\uDCBD\uDCCD]|\uD82F[\uDCA0-\uDCA3]|\uD834[\uDD73-\uDD7A]|\uDB40[\uDC01\uDC20-\uDC7F]/}}),mC=qe({"node_modules/uc.micro/categories/Z/regex.js"(n,e){e.exports=/[ \xA0\u1680\u2000-\u200A\u2028\u2029\u202F\u205F\u3000]/}}),J4=qe({"node_modules/uc.micro/index.js"(n){n.Any=hC(),n.Cc=pC(),n.Cf=K4(),n.P=ZO(),n.Z=mC()}}),Xt=qe({"node_modules/markdown-it/lib/common/utils.js"(n){function e(Q){return Object.prototype.toString.call(Q)}function t(Q){return e(Q)==="[object String]"}var r=Object.prototype.hasOwnProperty;function i(Q,$){return r.call(Q,$)}function s(Q){var $=Array.prototype.slice.call(arguments,1);return $.forEach(function(L){if(L){if(typeof L!="object")throw new TypeError(L+"must be object");Object.keys(L).forEach(function(I){Q[I]=L[I]})}}),Q}function o(Q,$,L){return[].concat(Q.slice(0,$),L,Q.slice($+1))}function a(Q){return!(Q>=55296&&Q<=57343||Q>=64976&&Q<=65007||(Q&65535)===65535||(Q&65535)===65534||Q>=0&&Q<=8||Q===11||Q>=14&&Q<=31||Q>=127&&Q<=159||Q>1114111)}function l(Q){if(Q>65535){Q-=65536;var $=55296+(Q>>10),L=56320+(Q&1023);return String.fromCharCode($,L)}return String.fromCharCode(Q)}var c=/\\([!"#$%&'()*+,\-.\/:;<=>?@[\\\]^_`{|}~])/g,u=/&([a-z#][a-z0-9]{1,31});/gi,f=new RegExp(c.source+"|"+u.source,"gi"),d=/^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))/i,h=fC();function m(Q,$){var L=0;return i(h,$)?h[$]:$.charCodeAt(0)===35&&d.test($)&&(L=$[1].toLowerCase()==="x"?parseInt($.slice(2),16):parseInt($.slice(1),10),a(L))?l(L):Q}function p(Q){return Q.indexOf("\\")<0?Q:Q.replace(c,"$1")}function v(Q){return Q.indexOf("\\")<0&&Q.indexOf("&")<0?Q:Q.replace(f,function($,L,I){return L||m($,I)})}var O=/[&<>"]/,b=/[&<>"]/g,w={"&":"&","<":"<",">":">",'"':"""};function S(Q){return w[Q]}function _(Q){return O.test(Q)?Q.replace(b,S):Q}var x=/[.?*+^$[\]\\(){}|-]/g;function A(Q){return Q.replace(x,"\\$&")}function C(Q){switch(Q){case 9:case 32:return!0}return!1}function y(Q){if(Q>=8192&&Q<=8202)return!0;switch(Q){case 9:case 10:case 11:case 12:case 13:case 32:case 160:case 5760:case 8239:case 8287:case 12288:return!0}return!1}var k=ZO();function P(Q){return k.test(Q)}function T(Q){switch(Q){case 33:case 34:case 35:case 36:case 37:case 38:case 39:case 40:case 41:case 42:case 43:case 44:case 45:case 46:case 47:case 58:case 59:case 60:case 61:case 62:case 63:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 124:case 125:case 126:return!0;default:return!1}}function E(Q){return Q=Q.trim().replace(/\s+/g," "),"ẞ".toLowerCase()==="Ṿ"&&(Q=Q.replace(/ẞ/g,"ß")),Q.toLowerCase().toUpperCase()}n.lib={},n.lib.mdurl=dC(),n.lib.ucmicro=J4(),n.assign=s,n.isString=t,n.has=i,n.unescapeMd=p,n.unescapeAll=v,n.isValidEntityCode=a,n.fromCodePoint=l,n.escapeHtml=_,n.arrayReplaceAt=o,n.isSpace=C,n.isWhiteSpace=y,n.isMdAsciiPunct=T,n.isPunctChar=P,n.escapeRE=A,n.normalizeReference=E}}),eB=qe({"node_modules/markdown-it/lib/helpers/parse_link_label.js"(n,e){e.exports=function(r,i,s){var o,a,l,c,u=-1,f=r.posMax,d=r.pos;for(r.pos=i+1,o=1;r.pos<f;){if(l=r.src.charCodeAt(r.pos),l===93&&(o--,o===0)){a=!0;break}if(c=r.pos,r.md.inline.skipToken(r),l===91){if(c===r.pos-1)o++;else if(s)return r.pos=d,-1}}return a&&(u=r.pos),r.pos=d,u}}}),tB=qe({"node_modules/markdown-it/lib/helpers/parse_link_destination.js"(n,e){var t=Xt().unescapeAll;e.exports=function(i,s,o){var a,l,c=0,u=s,f={ok:!1,pos:0,lines:0,str:""};if(i.charCodeAt(s)===60){for(s++;s<o;){if(a=i.charCodeAt(s),a===10||a===60)return f;if(a===62)return f.pos=s+1,f.str=t(i.slice(u+1,s)),f.ok=!0,f;if(a===92&&s+1<o){s+=2;continue}s++}return f}for(l=0;s<o&&(a=i.charCodeAt(s),!(a===32||a<32||a===127));){if(a===92&&s+1<o){if(i.charCodeAt(s+1)===32)break;s+=2;continue}if(a===40&&(l++,l>32))return f;if(a===41){if(l===0)break;l--}s++}return u===s||l!==0||(f.str=t(i.slice(u,s)),f.lines=c,f.pos=s,f.ok=!0),f}}}),nB=qe({"node_modules/markdown-it/lib/helpers/parse_link_title.js"(n,e){var t=Xt().unescapeAll;e.exports=function(i,s,o){var a,l,c=0,u=s,f={ok:!1,pos:0,lines:0,str:""};if(s>=o||(l=i.charCodeAt(s),l!==34&&l!==39&&l!==40))return f;for(s++,l===40&&(l=41);s<o;){if(a=i.charCodeAt(s),a===l)return f.pos=s+1,f.lines=c,f.str=t(i.slice(u+1,s)),f.ok=!0,f;if(a===40&&l===41)return f;a===10?c++:a===92&&s+1<o&&(s++,i.charCodeAt(s)===10&&c++),s++}return f}}}),rB=qe({"node_modules/markdown-it/lib/helpers/index.js"(n){n.parseLinkLabel=eB(),n.parseLinkDestination=tB(),n.parseLinkTitle=nB()}}),iB=qe({"node_modules/markdown-it/lib/renderer.js"(n,e){var t=Xt().assign,r=Xt().unescapeAll,i=Xt().escapeHtml,s={};s.code_inline=function(a,l,c,u,f){var d=a[l];return"<code"+f.renderAttrs(d)+">"+i(a[l].content)+"</code>"},s.code_block=function(a,l,c,u,f){var d=a[l];return"<pre"+f.renderAttrs(d)+"><code>"+i(a[l].content)+`</code></pre>
|
|
249
|
-
`},s.fence=function(a,l,c,u,f){var d=a[l],h=d.info?r(d.info).trim():"",m="",p="",v,O,b,w,S;return h&&(b=h.split(/(\s+)/g),m=b[0],p=b.slice(2).join("")),c.highlight?v=c.highlight(d.content,m,p)||i(d.content):v=i(d.content),v.indexOf("<pre")===0?v+`
|
|
250
|
-
`:h?(O=d.attrIndex("class"),w=d.attrs?d.attrs.slice():[],O<0?w.push(["class",c.langPrefix+m]):(w[O]=w[O].slice(),w[O][1]+=" "+c.langPrefix+m),S={attrs:w},"<pre><code"+f.renderAttrs(S)+">"+v+`</code></pre>
|
|
251
|
-
`):"<pre><code"+f.renderAttrs(d)+">"+v+`</code></pre>
|
|
252
|
-
`},s.image=function(a,l,c,u,f){var d=a[l];return d.attrs[d.attrIndex("alt")][1]=f.renderInlineAsText(d.children,c,u),f.renderToken(a,l,c)},s.hardbreak=function(a,l,c){return c.xhtmlOut?`<br />
|
|
253
|
-
`:`<br>
|
|
254
|
-
`},s.softbreak=function(a,l,c){return c.breaks?c.xhtmlOut?`<br />
|
|
255
|
-
`:`<br>
|
|
256
|
-
`:`
|
|
257
|
-
`},s.text=function(a,l){return i(a[l].content)},s.html_block=function(a,l){return a[l].content},s.html_inline=function(a,l){return a[l].content};function o(){this.rules=t({},s)}o.prototype.renderAttrs=function(l){var c,u,f;if(!l.attrs)return"";for(f="",c=0,u=l.attrs.length;c<u;c++)f+=" "+i(l.attrs[c][0])+'="'+i(l.attrs[c][1])+'"';return f},o.prototype.renderToken=function(l,c,u){var f,d="",h=!1,m=l[c];return m.hidden?"":(m.block&&m.nesting!==-1&&c&&l[c-1].hidden&&(d+=`
|
|
258
|
-
`),d+=(m.nesting===-1?"</":"<")+m.tag,d+=this.renderAttrs(m),m.nesting===0&&u.xhtmlOut&&(d+=" /"),m.block&&(h=!0,m.nesting===1&&c+1<l.length&&(f=l[c+1],(f.type==="inline"||f.hidden||f.nesting===-1&&f.tag===m.tag)&&(h=!1))),d+=h?`>
|
|
259
|
-
`:">",d)},o.prototype.renderInline=function(a,l,c){for(var u,f="",d=this.rules,h=0,m=a.length;h<m;h++)u=a[h].type,typeof d[u]<"u"?f+=d[u](a,h,l,c,this):f+=this.renderToken(a,h,l);return f},o.prototype.renderInlineAsText=function(a,l,c){for(var u="",f=0,d=a.length;f<d;f++)a[f].type==="text"?u+=a[f].content:a[f].type==="image"?u+=this.renderInlineAsText(a[f].children,l,c):a[f].type==="softbreak"&&(u+=`
|
|
260
|
-
`);return u},o.prototype.render=function(a,l,c){var u,f,d,h="",m=this.rules;for(u=0,f=a.length;u<f;u++)d=a[u].type,d==="inline"?h+=this.renderInline(a[u].children,l,c):typeof m[d]<"u"?h+=m[a[u].type](a,u,l,c,this):h+=this.renderToken(a,u,l,c);return h},e.exports=o}}),FO=qe({"node_modules/markdown-it/lib/ruler.js"(n,e){function t(){this.__rules__=[],this.__cache__=null}t.prototype.__find__=function(r){for(var i=0;i<this.__rules__.length;i++)if(this.__rules__[i].name===r)return i;return-1},t.prototype.__compile__=function(){var r=this,i=[""];r.__rules__.forEach(function(s){s.enabled&&s.alt.forEach(function(o){i.indexOf(o)<0&&i.push(o)})}),r.__cache__={},i.forEach(function(s){r.__cache__[s]=[],r.__rules__.forEach(function(o){o.enabled&&(s&&o.alt.indexOf(s)<0||r.__cache__[s].push(o.fn))})})},t.prototype.at=function(r,i,s){var o=this.__find__(r),a=s||{};if(o===-1)throw new Error("Parser rule not found: "+r);this.__rules__[o].fn=i,this.__rules__[o].alt=a.alt||[],this.__cache__=null},t.prototype.before=function(r,i,s,o){var a=this.__find__(r),l=o||{};if(a===-1)throw new Error("Parser rule not found: "+r);this.__rules__.splice(a,0,{name:i,enabled:!0,fn:s,alt:l.alt||[]}),this.__cache__=null},t.prototype.after=function(r,i,s,o){var a=this.__find__(r),l=o||{};if(a===-1)throw new Error("Parser rule not found: "+r);this.__rules__.splice(a+1,0,{name:i,enabled:!0,fn:s,alt:l.alt||[]}),this.__cache__=null},t.prototype.push=function(r,i,s){var o=s||{};this.__rules__.push({name:r,enabled:!0,fn:i,alt:o.alt||[]}),this.__cache__=null},t.prototype.enable=function(r,i){Array.isArray(r)||(r=[r]);var s=[];return r.forEach(function(o){var a=this.__find__(o);if(a<0){if(i)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[a].enabled=!0,s.push(o)},this),this.__cache__=null,s},t.prototype.enableOnly=function(r,i){Array.isArray(r)||(r=[r]),this.__rules__.forEach(function(s){s.enabled=!1}),this.enable(r,i)},t.prototype.disable=function(r,i){Array.isArray(r)||(r=[r]);var s=[];return r.forEach(function(o){var a=this.__find__(o);if(a<0){if(i)return;throw new Error("Rules manager: invalid rule name "+o)}this.__rules__[a].enabled=!1,s.push(o)},this),this.__cache__=null,s},t.prototype.getRules=function(r){return this.__cache__===null&&this.__compile__(),this.__cache__[r]||[]},e.exports=t}}),sB=qe({"node_modules/markdown-it/lib/rules_core/normalize.js"(n,e){var t=/\r\n?|\n/g,r=/\0/g;e.exports=function(s){var o;o=s.src.replace(t,`
|
|
261
|
-
`),o=o.replace(r,"�"),s.src=o}}}),oB=qe({"node_modules/markdown-it/lib/rules_core/block.js"(n,e){e.exports=function(r){var i;r.inlineMode?(i=new r.Token("inline","",0),i.content=r.src,i.map=[0,1],i.children=[],r.tokens.push(i)):r.md.block.parse(r.src,r.md,r.env,r.tokens)}}}),aB=qe({"node_modules/markdown-it/lib/rules_core/inline.js"(n,e){e.exports=function(r){var i=r.tokens,s,o,a;for(o=0,a=i.length;o<a;o++)s=i[o],s.type==="inline"&&r.md.inline.parse(s.content,r.md,r.env,s.children)}}}),lB=qe({"node_modules/markdown-it/lib/rules_core/linkify.js"(n,e){var t=Xt().arrayReplaceAt;function r(s){return/^<a[>\s]/i.test(s)}function i(s){return/^<\/a\s*>/i.test(s)}e.exports=function(o){var a,l,c,u,f,d,h,m,p,v,O,b,w,S,_,x,A=o.tokens,C;if(o.md.options.linkify){for(l=0,c=A.length;l<c;l++)if(!(A[l].type!=="inline"||!o.md.linkify.pretest(A[l].content)))for(u=A[l].children,w=0,a=u.length-1;a>=0;a--){if(d=u[a],d.type==="link_close"){for(a--;u[a].level!==d.level&&u[a].type!=="link_open";)a--;continue}if(d.type==="html_inline"&&(r(d.content)&&w>0&&w--,i(d.content)&&w++),!(w>0)&&d.type==="text"&&o.md.linkify.test(d.content)){for(p=d.content,C=o.md.linkify.match(p),h=[],b=d.level,O=0,m=0;m<C.length;m++)S=C[m].url,_=o.md.normalizeLink(S),o.md.validateLink(_)&&(x=C[m].text,C[m].schema?C[m].schema==="mailto:"&&!/^mailto:/i.test(x)?x=o.md.normalizeLinkText("mailto:"+x).replace(/^mailto:/,""):x=o.md.normalizeLinkText(x):x=o.md.normalizeLinkText("http://"+x).replace(/^http:\/\//,""),v=C[m].index,v>O&&(f=new o.Token("text","",0),f.content=p.slice(O,v),f.level=b,h.push(f)),f=new o.Token("link_open","a",1),f.attrs=[["href",_]],f.level=b++,f.markup="linkify",f.info="auto",h.push(f),f=new o.Token("text","",0),f.content=x,f.level=b,h.push(f),f=new o.Token("link_close","a",-1),f.level=--b,f.markup="linkify",f.info="auto",h.push(f),O=C[m].lastIndex);O<p.length&&(f=new o.Token("text","",0),f.content=p.slice(O),f.level=b,h.push(f)),A[l].children=u=t(u,a,h)}}}}}}),cB=qe({"node_modules/markdown-it/lib/rules_core/replacements.js"(n,e){var t=/\+-|\.\.|\?\?\?\?|!!!!|,,|--/,r=/\((c|tm|r|p)\)/i,i=/\((c|tm|r|p)\)/ig,s={c:"©",r:"®",p:"§",tm:"™"};function o(c,u){return s[u.toLowerCase()]}function a(c){var u,f,d=0;for(u=c.length-1;u>=0;u--)f=c[u],f.type==="text"&&!d&&(f.content=f.content.replace(i,o)),f.type==="link_open"&&f.info==="auto"&&d--,f.type==="link_close"&&f.info==="auto"&&d++}function l(c){var u,f,d=0;for(u=c.length-1;u>=0;u--)f=c[u],f.type==="text"&&!d&&t.test(f.content)&&(f.content=f.content.replace(/\+-/g,"±").replace(/\.{2,}/g,"…").replace(/([?!])…/g,"$1..").replace(/([?!]){4,}/g,"$1$1$1").replace(/,{2,}/g,",").replace(/(^|[^-])---(?=[^-]|$)/mg,"$1—").replace(/(^|\s)--(?=\s|$)/mg,"$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/mg,"$1–")),f.type==="link_open"&&f.info==="auto"&&d--,f.type==="link_close"&&f.info==="auto"&&d++}e.exports=function(u){var f;if(u.md.options.typographer)for(f=u.tokens.length-1;f>=0;f--)u.tokens[f].type==="inline"&&(r.test(u.tokens[f].content)&&a(u.tokens[f].children),t.test(u.tokens[f].content)&&l(u.tokens[f].children))}}}),uB=qe({"node_modules/markdown-it/lib/rules_core/smartquotes.js"(n,e){var t=Xt().isWhiteSpace,r=Xt().isPunctChar,i=Xt().isMdAsciiPunct,s=/['"]/,o=/['"]/g,a="’";function l(u,f,d){return u.substr(0,f)+d+u.substr(f+1)}function c(u,f){var d,h,m,p,v,O,b,w,S,_,x,A,C,y,k,P,T,E,Q,$,L;for(Q=[],d=0;d<u.length;d++){for(h=u[d],b=u[d].level,T=Q.length-1;T>=0&&!(Q[T].level<=b);T--);if(Q.length=T+1,h.type==="text"){m=h.content,v=0,O=m.length;e:for(;v<O&&(o.lastIndex=v,p=o.exec(m),!!p);){if(k=P=!0,v=p.index+1,E=p[0]==="'",S=32,p.index-1>=0)S=m.charCodeAt(p.index-1);else for(T=d-1;T>=0&&!(u[T].type==="softbreak"||u[T].type==="hardbreak");T--)if(u[T].content){S=u[T].content.charCodeAt(u[T].content.length-1);break}if(_=32,v<O)_=m.charCodeAt(v);else for(T=d+1;T<u.length&&!(u[T].type==="softbreak"||u[T].type==="hardbreak");T++)if(u[T].content){_=u[T].content.charCodeAt(0);break}if(x=i(S)||r(String.fromCharCode(S)),A=i(_)||r(String.fromCharCode(_)),C=t(S),y=t(_),y?k=!1:A&&(C||x||(k=!1)),C?P=!1:x&&(y||A||(P=!1)),_===34&&p[0]==='"'&&S>=48&&S<=57&&(P=k=!1),k&&P&&(k=x,P=A),!k&&!P){E&&(h.content=l(h.content,p.index,a));continue}if(P){for(T=Q.length-1;T>=0&&(w=Q[T],!(Q[T].level<b));T--)if(w.single===E&&Q[T].level===b){w=Q[T],E?($=f.md.options.quotes[2],L=f.md.options.quotes[3]):($=f.md.options.quotes[0],L=f.md.options.quotes[1]),h.content=l(h.content,p.index,L),u[w.token].content=l(u[w.token].content,w.pos,$),v+=L.length-1,w.token===d&&(v+=$.length-1),m=h.content,O=m.length,Q.length=T;continue e}}k?Q.push({token:d,pos:p.index,single:E,level:b}):P&&E&&(h.content=l(h.content,p.index,a))}}}}e.exports=function(f){var d;if(f.md.options.typographer)for(d=f.tokens.length-1;d>=0;d--)f.tokens[d].type!=="inline"||!s.test(f.tokens[d].content)||c(f.tokens[d].children,f)}}}),XO=qe({"node_modules/markdown-it/lib/token.js"(n,e){function t(r,i,s){this.type=r,this.tag=i,this.attrs=null,this.map=null,this.nesting=s,this.level=0,this.children=null,this.content="",this.markup="",this.info="",this.meta=null,this.block=!1,this.hidden=!1}t.prototype.attrIndex=function(i){var s,o,a;if(!this.attrs)return-1;for(s=this.attrs,o=0,a=s.length;o<a;o++)if(s[o][0]===i)return o;return-1},t.prototype.attrPush=function(i){this.attrs?this.attrs.push(i):this.attrs=[i]},t.prototype.attrSet=function(i,s){var o=this.attrIndex(i),a=[i,s];o<0?this.attrPush(a):this.attrs[o]=a},t.prototype.attrGet=function(i){var s=this.attrIndex(i),o=null;return s>=0&&(o=this.attrs[s][1]),o},t.prototype.attrJoin=function(i,s){var o=this.attrIndex(i);o<0?this.attrPush([i,s]):this.attrs[o][1]=this.attrs[o][1]+" "+s},e.exports=t}}),fB=qe({"node_modules/markdown-it/lib/rules_core/state_core.js"(n,e){var t=XO();function r(i,s,o){this.src=i,this.env=o,this.tokens=[],this.inlineMode=!1,this.md=s}r.prototype.Token=t,e.exports=r}}),dB=qe({"node_modules/markdown-it/lib/parser_core.js"(n,e){var t=FO(),r=[["normalize",sB()],["block",oB()],["inline",aB()],["linkify",lB()],["replacements",cB()],["smartquotes",uB()]];function i(){this.ruler=new t;for(var s=0;s<r.length;s++)this.ruler.push(r[s][0],r[s][1])}i.prototype.process=function(s){var o,a,l;for(l=this.ruler.getRules(""),o=0,a=l.length;o<a;o++)l[o](s)},i.prototype.State=fB(),e.exports=i}}),hB=qe({"node_modules/markdown-it/lib/rules_block/table.js"(n,e){var t=Xt().isSpace;function r(s,o){var a=s.bMarks[o]+s.tShift[o],l=s.eMarks[o];return s.src.substr(a,l-a)}function i(s){var o=[],a=0,l=s.length,c,u=!1,f=0,d="";for(c=s.charCodeAt(a);a<l;)c===124&&(u?(d+=s.substring(f,a-1),f=a):(o.push(d+s.substring(f,a)),d="",f=a+1)),u=c===92,a++,c=s.charCodeAt(a);return o.push(d+s.substring(f)),o}e.exports=function(o,a,l,c){var u,f,d,h,m,p,v,O,b,w,S,_,x,A,C,y,k,P;if(a+2>l||(p=a+1,o.sCount[p]<o.blkIndent)||!o.md.options.allowIndentation&&o.sCount[p]-o.blkIndent>=4||(d=o.bMarks[p]+o.tShift[p],d>=o.eMarks[p])||(k=o.src.charCodeAt(d++),k!==124&&k!==45&&k!==58)||d>=o.eMarks[p]||(P=o.src.charCodeAt(d++),P!==124&&P!==45&&P!==58&&!t(P))||k===45&&t(P))return!1;for(;d<o.eMarks[p];){if(u=o.src.charCodeAt(d),u!==124&&u!==45&&u!==58&&!t(u))return!1;d++}for(f=r(o,a+1),v=f.split("|"),w=[],h=0;h<v.length;h++){if(S=v[h].trim(),!S){if(h===0||h===v.length-1)continue;return!1}if(!/^:?-+:?$/.test(S))return!1;S.charCodeAt(S.length-1)===58?w.push(S.charCodeAt(0)===58?"center":"right"):S.charCodeAt(0)===58?w.push("left"):w.push("")}if(f=r(o,a).trim(),f.indexOf("|")===-1||!o.md.options.allowIndentation&&o.sCount[a]-o.blkIndent>=4||(v=i(f),v.length&&v[0]===""&&v.shift(),v.length&&v[v.length-1]===""&&v.pop(),O=v.length,O===0||O!==w.length))return!1;if(c)return!0;for(A=o.parentType,o.parentType="table",y=o.md.block.ruler.getRules("blockquote"),b=o.push("table_open","table",1),b.map=_=[a,0],b=o.push("thead_open","thead",1),b.map=[a,a+1],b=o.push("tr_open","tr",1),b.map=[a,a+1],h=0;h<v.length;h++)b=o.push("th_open","th",1),w[h]&&(b.attrs=[["style","text-align:"+w[h]]]),b=o.push("inline","",0),b.content=v[h].trim(),b.children=[],b=o.push("th_close","th",-1);for(b=o.push("tr_close","tr",-1),b=o.push("thead_close","thead",-1),p=a+2;p<l&&!(o.sCount[p]<o.blkIndent);p++){for(C=!1,h=0,m=y.length;h<m;h++)if(y[h](o,p,l,!0)){C=!0;break}if(C||(f=r(o,p).trim(),!f)||!o.md.options.allowIndentation&&o.sCount[p]-o.blkIndent>=4)break;for(v=i(f),v.length&&v[0]===""&&v.shift(),v.length&&v[v.length-1]===""&&v.pop(),p===a+2&&(b=o.push("tbody_open","tbody",1),b.map=x=[a+2,0]),b=o.push("tr_open","tr",1),b.map=[p,p+1],h=0;h<O;h++)b=o.push("td_open","td",1),w[h]&&(b.attrs=[["style","text-align:"+w[h]]]),b=o.push("inline","",0),b.content=v[h]?v[h].trim():"",b.children=[],b=o.push("td_close","td",-1);b=o.push("tr_close","tr",-1)}return x&&(b=o.push("tbody_close","tbody",-1),x[1]=p),b=o.push("table_close","table",-1),_[1]=p,o.parentType=A,o.line=p,!0}}}),pB=qe({"node_modules/markdown-it/lib/rules_block/code.js"(n,e){e.exports=function(r,i,s){if(r.md.options.allowIndentation)return!1;var o,a,l;if(r.sCount[i]-r.blkIndent<4)return!1;for(a=o=i+1;o<s;){if(r.isEmpty(o)){o++;continue}if(r.sCount[o]-r.blkIndent>=4){o++,a=o;continue}break}return r.line=a,l=r.push("code_block","code",0),l.content=r.getLines(i,a,4+r.blkIndent,!1)+`
|
|
262
|
-
`,l.map=[i,r.line],!0}}}),mB=qe({"node_modules/markdown-it/lib/rules_block/fence.js"(n,e){e.exports=function(r,i,s,o){var a,l,c,u,f,d,h,m=!1,p=r.bMarks[i]+r.tShift[i],v=r.eMarks[i];if(!r.md.options.allowIndentation&&r.sCount[i]-r.blkIndent>=4||p+3>v||(a=r.src.charCodeAt(p),a!==126&&a!==96)||(f=p,p=r.skipChars(p,a),l=p-f,l<3)||(h=r.src.slice(f,p),c=r.src.slice(p,v),a===96&&c.indexOf(String.fromCharCode(a))>=0))return!1;if(o)return!0;for(u=i;u++,!(u>=s||(p=f=r.bMarks[u]+r.tShift[u],v=r.eMarks[u],p<v&&r.sCount[u]<r.blkIndent));)if(r.src.charCodeAt(p)===a&&!(!r.md.options.allowIndentation&&r.sCount[u]-r.blkIndent>=4)&&(p=r.skipChars(p,a),!(p-f<l)&&(p=r.skipSpaces(p),!(p<v)))){m=!0;break}return l=r.sCount[i],r.line=u+(m?1:0),d=r.push("fence","code",0),d.info=c,d.content=r.getLines(i+1,u,l,!0),d.markup=h,d.map=[i,r.line],!0}}}),gB=qe({"node_modules/markdown-it/lib/rules_block/blockquote.js"(n,e){var t=Xt().isSpace;e.exports=function(i,s,o,a){var l,c,u,f,d,h,m,p,v,O,b,w,S,_,x,A,C,y,k,P,T=i.lineMax,E=i.bMarks[s]+i.tShift[s],Q=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||i.src.charCodeAt(E++)!==62)return!1;if(a)return!0;for(f=v=i.sCount[s]+1,i.src.charCodeAt(E)===32?(E++,f++,v++,l=!1,A=!0):i.src.charCodeAt(E)===9?(A=!0,(i.bsCount[s]+v)%4===3?(E++,f++,v++,l=!1):l=!0):A=!1,O=[i.bMarks[s]],i.bMarks[s]=E;E<Q&&(c=i.src.charCodeAt(E),t(c));){c===9?v+=4-(v+i.bsCount[s]+(l?1:0))%4:v++;E++}for(b=[i.bsCount[s]],i.bsCount[s]=i.sCount[s]+1+(A?1:0),h=E>=Q,_=[i.sCount[s]],i.sCount[s]=v-f,x=[i.tShift[s]],i.tShift[s]=E-i.bMarks[s],y=i.md.block.ruler.getRules("blockquote"),S=i.parentType,i.parentType="blockquote",p=s+1;p<o&&(P=i.sCount[p]<i.blkIndent,E=i.bMarks[p]+i.tShift[p],Q=i.eMarks[p],!(E>=Q));p++){if(i.src.charCodeAt(E++)===62&&!P){for(f=v=i.sCount[p]+1,i.src.charCodeAt(E)===32?(E++,f++,v++,l=!1,A=!0):i.src.charCodeAt(E)===9?(A=!0,(i.bsCount[p]+v)%4===3?(E++,f++,v++,l=!1):l=!0):A=!1,O.push(i.bMarks[p]),i.bMarks[p]=E;E<Q&&(c=i.src.charCodeAt(E),t(c));){c===9?v+=4-(v+i.bsCount[p]+(l?1:0))%4:v++;E++}h=E>=Q,b.push(i.bsCount[p]),i.bsCount[p]=i.sCount[p]+1+(A?1:0),_.push(i.sCount[p]),i.sCount[p]=v-f,x.push(i.tShift[p]),i.tShift[p]=E-i.bMarks[p];continue}if(h)break;for(C=!1,u=0,d=y.length;u<d;u++)if(y[u](i,p,o,!0)){C=!0;break}if(C){i.lineMax=p,i.blkIndent!==0&&(O.push(i.bMarks[p]),b.push(i.bsCount[p]),x.push(i.tShift[p]),_.push(i.sCount[p]),i.sCount[p]-=i.blkIndent);break}O.push(i.bMarks[p]),b.push(i.bsCount[p]),x.push(i.tShift[p]),_.push(i.sCount[p]),i.sCount[p]=-1}for(w=i.blkIndent,i.blkIndent=0,k=i.push("blockquote_open","blockquote",1),k.markup=">",k.map=m=[s,0],i.md.block.tokenize(i,s,p),k=i.push("blockquote_close","blockquote",-1),k.markup=">",i.lineMax=T,i.parentType=S,m[1]=i.line,u=0;u<x.length;u++)i.bMarks[u+s]=O[u],i.tShift[u+s]=x[u],i.sCount[u+s]=_[u],i.bsCount[u+s]=b[u];return i.blkIndent=w,!0}}}),vB=qe({"node_modules/markdown-it/lib/rules_block/hr.js"(n,e){var t=Xt().isSpace;e.exports=function(i,s,o,a){var l,c,u,f,d=i.bMarks[s]+i.tShift[s],h=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||(l=i.src.charCodeAt(d++),l!==42&&l!==45&&l!==95))return!1;for(c=1;d<h;){if(u=i.src.charCodeAt(d++),u!==l&&!t(u))return!1;u===l&&c++}return c<3?!1:(a||(i.line=s+1,f=i.push("hr","hr",0),f.map=[s,i.line],f.markup=Array(c+1).join(String.fromCharCode(l))),!0)}}}),OB=qe({"node_modules/markdown-it/lib/rules_block/list.js"(n,e){var t=Xt().isSpace;function r(o,a){var l,c,u,f;return c=o.bMarks[a]+o.tShift[a],u=o.eMarks[a],l=o.src.charCodeAt(c++),l!==42&&l!==45&&l!==43||c<u&&(f=o.src.charCodeAt(c),!t(f))?-1:c}function i(o,a){var l,c=o.bMarks[a]+o.tShift[a],u=c,f=o.eMarks[a];if(u+1>=f||(l=o.src.charCodeAt(u++),l<48||l>57))return-1;for(;;){if(u>=f)return-1;if(l=o.src.charCodeAt(u++),l>=48&&l<=57){if(u-c>=10)return-1;continue}if(l===41||l===46)break;return-1}return u<f&&(l=o.src.charCodeAt(u),!t(l))?-1:u}function s(o,a){var l,c,u=o.level+2;for(l=a+2,c=o.tokens.length-2;l<c;l++)o.tokens[l].level===u&&o.tokens[l].type==="paragraph_open"&&(o.tokens[l+2].hidden=!0,o.tokens[l].hidden=!0,l+=2)}e.exports=function(a,l,c,u){var f,d,h,m,p,v,O,b,w,S,_,x,A,C,y,k,P,T,E,Q,$,L,I,Z,Y,ne,ae,ie,K=!1,he=!0;if(!a.md.options.allowIndentation&&a.sCount[l]-a.blkIndent>=4||!a.md.options.allowIndentation&&a.listIndent>=0&&a.sCount[l]-a.listIndent>=4&&a.sCount[l]<a.blkIndent)return!1;if(u&&a.parentType==="paragraph"&&a.sCount[l]>=a.blkIndent&&(K=!0),(I=i(a,l))>=0){if(O=!0,Y=a.bMarks[l]+a.tShift[l],A=Number(a.src.slice(Y,I-1)),K&&A!==1)return!1}else if((I=r(a,l))>=0)O=!1;else return!1;if(K&&a.skipSpaces(I)>=a.eMarks[l])return!1;if(x=a.src.charCodeAt(I-1),u)return!0;for(_=a.tokens.length,O?(ie=a.push("ordered_list_open","ol",1),A!==1&&(ie.attrs=[["start",A]])):ie=a.push("bullet_list_open","ul",1),ie.map=S=[l,0],ie.markup=String.fromCharCode(x),y=l,Z=!1,ae=a.md.block.ruler.getRules("list"),T=a.parentType,a.parentType="list";y<c;){for(L=I,C=a.eMarks[y],v=k=a.sCount[y]+I-(a.bMarks[l]+a.tShift[l]);L<C;){if(f=a.src.charCodeAt(L),f===9)k+=4-(k+a.bsCount[y])%4;else if(f===32)k++;else break;L++}if(d=L,d>=C?p=1:p=k-v,!a.md.options.allowIndentation&&p>4&&(p=1),m=v+p,ie=a.push("list_item_open","li",1),ie.markup=String.fromCharCode(x),ie.map=b=[l,0],O&&(ie.info=a.src.slice(Y,I-1)),$=a.tight,Q=a.tShift[l],E=a.sCount[l],P=a.listIndent,a.listIndent=a.blkIndent,a.blkIndent=m,a.tight=!0,a.tShift[l]=d-a.bMarks[l],a.sCount[l]=k,d>=C&&a.isEmpty(l+1)?a.line=Math.min(a.line+2,c):a.md.block.tokenize(a,l,c,!0),(!a.tight||Z)&&(he=!1),Z=a.line-l>1&&a.isEmpty(a.line-1),a.blkIndent=a.listIndent,a.listIndent=P,a.tShift[l]=Q,a.sCount[l]=E,a.tight=$,ie=a.push("list_item_close","li",-1),ie.markup=String.fromCharCode(x),y=l=a.line,b[1]=y,d=a.bMarks[l],y>=c||a.sCount[y]<a.blkIndent||!a.md.options.allowIndentation&&a.sCount[l]-a.blkIndent>=4)break;for(ne=!1,h=0,w=ae.length;h<w;h++)if(ae[h](a,y,c,!0)){ne=!0;break}if(ne)break;if(O){if(I=i(a,y),I<0)break;Y=a.bMarks[y]+a.tShift[y]}else if(I=r(a,y),I<0)break;if(x!==a.src.charCodeAt(I-1))break}return O?ie=a.push("ordered_list_close","ol",-1):ie=a.push("bullet_list_close","ul",-1),ie.markup=String.fromCharCode(x),S[1]=y,a.line=y,a.parentType=T,he&&s(a,_),!0}}}),bB=qe({"node_modules/markdown-it/lib/rules_block/reference.js"(n,e){var t=Xt().normalizeReference,r=Xt().isSpace;e.exports=function(s,o,a,l){var c,u,f,d,h,m,p,v,O,b,w,S,_,x,A,C,y=0,k=s.bMarks[o]+s.tShift[o],P=s.eMarks[o],T=o+1;if(!s.md.options.allowIndentation&&s.sCount[o]-s.blkIndent>=4||s.src.charCodeAt(k)!==91)return!1;for(;++k<P;)if(s.src.charCodeAt(k)===93&&s.src.charCodeAt(k-1)!==92){if(k+1===P||s.src.charCodeAt(k+1)!==58)return!1;break}for(d=s.lineMax,A=s.md.block.ruler.getRules("reference"),b=s.parentType,s.parentType="reference";T<d&&!s.isEmpty(T);T++)if(!(!s.md.options.allowIndentation&&s.sCount[T]-s.blkIndent>3)&&!(s.sCount[T]<0)){for(x=!1,m=0,p=A.length;m<p;m++)if(A[m](s,T,d,!0)){x=!0;break}if(x)break}for(_=s.getLines(o,T,s.blkIndent,!1).trim(),P=_.length,k=1;k<P;k++){if(c=_.charCodeAt(k),c===91)return!1;if(c===93){O=k;break}else c===10?y++:c===92&&(k++,k<P&&_.charCodeAt(k)===10&&y++)}if(O<0||_.charCodeAt(O+1)!==58)return!1;for(k=O+2;k<P;k++)if(c=_.charCodeAt(k),c===10)y++;else if(!r(c))break;if(w=s.md.helpers.parseLinkDestination(_,k,P),!w.ok||(h=s.md.normalizeLink(w.str),!s.md.validateLink(h)))return!1;for(k=w.pos,y+=w.lines,u=k,f=y,S=k;k<P;k++)if(c=_.charCodeAt(k),c===10)y++;else if(!r(c))break;for(w=s.md.helpers.parseLinkTitle(_,k,P),k<P&&S!==k&&w.ok?(C=w.str,k=w.pos,y+=w.lines):(C="",k=u,y=f);k<P&&(c=_.charCodeAt(k),!!r(c));)k++;if(k<P&&_.charCodeAt(k)!==10&&C)for(C="",k=u,y=f;k<P&&(c=_.charCodeAt(k),!!r(c));)k++;return k<P&&_.charCodeAt(k)!==10||(v=t(_.slice(1,O)),!v)?!1:(l||(typeof s.env.references>"u"&&(s.env.references={}),typeof s.env.references[v]>"u"&&(s.env.references[v]={title:C,href:h}),s.parentType=b,s.line=o+y+1),!0)}}}),yB=qe({"node_modules/markdown-it/lib/common/html_blocks.js"(n,e){e.exports=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","section","source","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"]}}),gC=qe({"node_modules/markdown-it/lib/common/html_re.js"(n,e){var t="[a-zA-Z_:][a-zA-Z0-9:._-]*",r="[^\"'=<>`\\x00-\\x20]+",i="'[^']*'",s='"[^"]*"',o="(?:"+r+"|"+i+"|"+s+")",a="(?:\\s+"+t+"(?:\\s*=\\s*"+o+")?)",l="<[A-Za-z][A-Za-z0-9\\-]*"+a+"*\\s*\\/?>",c="<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>",u="<!---->|<!--(?:-?[^>-])(?:-?[^-])*-->",f="<[?][\\s\\S]*?[?]>",d="<![A-Z]+\\s+[^>]*>",h="<!\\[CDATA\\[[\\s\\S]*?\\]\\]>",m=new RegExp("^(?:"+l+"|"+c+"|"+u+"|"+f+"|"+d+"|"+h+")"),p=new RegExp("^(?:"+l+"|"+c+")");e.exports.HTML_TAG_RE=m,e.exports.HTML_OPEN_CLOSE_TAG_RE=p}}),wB=qe({"node_modules/markdown-it/lib/rules_block/html_block.js"(n,e){var t=yB(),r=gC().HTML_OPEN_CLOSE_TAG_RE,i=[[/^<(script|pre|style|textarea)(?=(\s|>|$))/i,/<\/(script|pre|style|textarea)>/i,!0],[/^<!--/,/-->/,!0],[/^<\?/,/\?>/,!0],[/^<![A-Z]/,/>/,!0],[/^<!\[CDATA\[/,/\]\]>/,!0],[new RegExp("^</?("+t.join("|")+")(?=(\\s|/?>|$))","i"),/^$/,!0],[new RegExp(r.source+"\\s*$"),/^$/,!1]];e.exports=function(o,a,l,c){var u,f,d,h,m=o.bMarks[a]+o.tShift[a],p=o.eMarks[a];if(!o.md.options.allowIndentation&&o.sCount[a]-o.blkIndent>=4||!o.md.options.html||o.src.charCodeAt(m)!==60)return!1;for(h=o.src.slice(m,p),u=0;u<i.length&&!i[u][0].test(h);u++);if(u===i.length)return!1;if(c)return i[u][2];if(f=a+1,!i[u][1].test(h)){for(;f<l&&!(o.sCount[f]<o.blkIndent);f++)if(m=o.bMarks[f]+o.tShift[f],p=o.eMarks[f],h=o.src.slice(m,p),i[u][1].test(h)){h.length!==0&&f++;break}}return o.line=f,d=o.push("html_block","",0),d.map=[a,f],d.content=o.getLines(a,f,o.blkIndent,!0),!0}}}),_B=qe({"node_modules/markdown-it/lib/rules_block/heading.js"(n,e){var t=Xt().isSpace;e.exports=function(i,s,o,a){var l,c,u,f,d=i.bMarks[s]+i.tShift[s],h=i.eMarks[s];if(!i.md.options.allowIndentation&&i.sCount[s]-i.blkIndent>=4||(l=i.src.charCodeAt(d),l!==35||d>=h))return!1;for(c=1,l=i.src.charCodeAt(++d);l===35&&d<h&&c<=6;)c++,l=i.src.charCodeAt(++d);return c>6||d<h&&!t(l)?!1:(a||(h=i.skipSpacesBack(h,d),u=i.skipCharsBack(h,35,d),u>d&&t(i.src.charCodeAt(u-1))&&(h=u),i.line=s+1,f=i.push("heading_open","h"+String(c),1),f.markup="########".slice(0,c),f.map=[s,i.line],f=i.push("inline","",0),f.content=i.src.slice(d,h).trim(),f.map=[s,i.line],f.children=[],f=i.push("heading_close","h"+String(c),-1),f.markup="########".slice(0,c)),!0)}}}),kB=qe({"node_modules/markdown-it/lib/rules_block/lheading.js"(n,e){e.exports=function(r,i,s){var o,a,l,c,u,f,d,h,m,p=i+1,v,O=r.md.block.ruler.getRules("paragraph");if(!r.md.options.allowIndentation&&r.sCount[i]-r.blkIndent>=4)return!1;for(v=r.parentType,r.parentType="paragraph";p<s&&!r.isEmpty(p);p++)if(!(!r.md.options.allowIndentation&&r.sCount[p]-r.blkIndent>3)){if(r.sCount[p]>=r.blkIndent&&(f=r.bMarks[p]+r.tShift[p],d=r.eMarks[p],f<d&&(m=r.src.charCodeAt(f),(m===45||m===61)&&(f=r.skipChars(f,m),f=r.skipSpaces(f),f>=d)))){h=m===61?1:2;break}if(!(r.sCount[p]<0)){for(a=!1,l=0,c=O.length;l<c;l++)if(O[l](r,p,s,!0)){a=!0;break}if(a)break}}return h?(o=r.getLines(i,p,r.blkIndent,!1).trim(),r.line=p+1,u=r.push("heading_open","h"+String(h),1),u.markup=String.fromCharCode(m),u.map=[i,r.line],u=r.push("inline","",0),u.content=o,u.map=[i,r.line-1],u.children=[],u=r.push("heading_close","h"+String(h),-1),u.markup=String.fromCharCode(m),r.parentType=v,!0):!1}}}),xB=qe({"node_modules/markdown-it/lib/rules_block/paragraph.js"(n,e){e.exports=function(r,i){var s,o,a,l,c,u,f=i+1,d=r.md.block.ruler.getRules("paragraph"),h=r.lineMax;for(u=r.parentType,r.parentType="paragraph";f<h&&!r.isEmpty(f);f++)if(!(!r.md.options.allowIndentation&&r.sCount[f]-r.blkIndent>3)&&!(r.sCount[f]<0)){for(o=!1,a=0,l=d.length;a<l;a++)if(d[a](r,f,h,!0)){o=!0;break}if(o)break}return s=r.getLines(i,f,r.blkIndent,!1).trim(),r.line=f,c=r.push("paragraph_open","p",1),c.map=[i,r.line],c=r.push("inline","",0),c.content=s,c.map=[i,r.line],c.children=[],c=r.push("paragraph_close","p",-1),r.parentType=u,!0}}}),SB=qe({"node_modules/markdown-it/lib/rules_block/state_block.js"(n,e){var t=XO(),r=Xt().isSpace;function i(s,o,a,l){var c,u,f,d,h,m,p,v;for(this.src=s,this.md=o,this.env=a,this.tokens=l,this.bMarks=[],this.eMarks=[],this.tShift=[],this.sCount=[],this.bsCount=[],this.blkIndent=0,this.line=0,this.lineMax=0,this.tight=!1,this.ddIndent=-1,this.listIndent=-1,this.parentType="root",this.level=0,this.result="",u=this.src,v=!1,f=d=m=p=0,h=u.length;d<h;d++){if(c=u.charCodeAt(d),!v)if(r(c)){m++,c===9?p+=4-p%4:p++;continue}else v=!0;(c===10||d===h-1)&&(c!==10&&d++,this.bMarks.push(f),this.eMarks.push(d),this.tShift.push(m),this.sCount.push(p),this.bsCount.push(0),v=!1,m=0,p=0,f=d+1)}this.bMarks.push(u.length),this.eMarks.push(u.length),this.tShift.push(0),this.sCount.push(0),this.bsCount.push(0),this.lineMax=this.bMarks.length-1}i.prototype.push=function(s,o,a){var l=new t(s,o,a);return l.block=!0,a<0&&this.level--,l.level=this.level,a>0&&this.level++,this.tokens.push(l),l},i.prototype.isEmpty=function(o){return this.bMarks[o]+this.tShift[o]>=this.eMarks[o]},i.prototype.skipEmptyLines=function(o){for(var a=this.lineMax;o<a&&!(this.bMarks[o]+this.tShift[o]<this.eMarks[o]);o++);return o},i.prototype.skipSpaces=function(o){for(var a,l=this.src.length;o<l&&(a=this.src.charCodeAt(o),!!r(a));o++);return o},i.prototype.skipSpacesBack=function(o,a){if(o<=a)return o;for(;o>a;)if(!r(this.src.charCodeAt(--o)))return o+1;return o},i.prototype.skipChars=function(o,a){for(var l=this.src.length;o<l&&this.src.charCodeAt(o)===a;o++);return o},i.prototype.skipCharsBack=function(o,a,l){if(o<=l)return o;for(;o>l;)if(a!==this.src.charCodeAt(--o))return o+1;return o},i.prototype.getLines=function(o,a,l,c){var u,f,d,h,m,p,v,O=o;if(o>=a)return"";for(p=new Array(a-o),u=0;O<a;O++,u++){for(f=0,v=h=this.bMarks[O],O+1<a||c?m=this.eMarks[O]+1:m=this.eMarks[O];h<m&&f<l;){if(d=this.src.charCodeAt(h),r(d))d===9?f+=4-(f+this.bsCount[O])%4:f++;else if(h-v<this.tShift[O])f++;else break;h++}f>l?p[u]=new Array(f-l+1).join(" ")+this.src.slice(h,m):p[u]=this.src.slice(h,m)}return p.join("")},i.prototype.Token=t,e.exports=i}}),AB=qe({"node_modules/markdown-it/lib/parser_block.js"(n,e){var t=FO(),r=[["table",hB(),["paragraph","reference"]],["code",pB()],["fence",mB(),["paragraph","reference","blockquote","list"]],["blockquote",gB(),["paragraph","reference","blockquote","list"]],["hr",vB(),["paragraph","reference","blockquote","list"]],["list",OB(),["paragraph","reference","blockquote"]],["reference",bB()],["html_block",wB(),["paragraph","reference","blockquote"]],["heading",_B(),["paragraph","reference","blockquote"]],["lheading",kB()],["paragraph",xB()]];function i(){this.ruler=new t;for(var s=0;s<r.length;s++)this.ruler.push(r[s][0],r[s][1],{alt:(r[s][2]||[]).slice()})}i.prototype.tokenize=function(s,o,a){for(var l,c,u=this.ruler.getRules(""),f=u.length,d=o,h=!1,m=s.md.options.maxNesting;d<a&&(s.line=d=s.skipEmptyLines(d),!(d>=a||s.sCount[d]<s.blkIndent));){if(s.level>=m){s.line=a;break}for(c=0;c<f&&(l=u[c](s,d,a,!1),!l);c++);s.tight=!h,s.isEmpty(s.line-1)&&(h=!0),d=s.line,d<a&&s.isEmpty(d)&&(h=!0,d++,s.line=d)}},i.prototype.parse=function(s,o,a,l){var c;s&&(c=new this.State(s,o,a,l),this.tokenize(c,c.line,c.lineMax))},i.prototype.State=SB(),e.exports=i}}),CB=qe({"node_modules/markdown-it/lib/rules_inline/text.js"(n,e){function t(r){switch(r){case 10:case 33:case 35:case 36:case 37:case 38:case 42:case 43:case 45:case 58:case 60:case 61:case 62:case 64:case 91:case 92:case 93:case 94:case 95:case 96:case 123:case 125:case 126:return!0;default:return!1}}e.exports=function(i,s){for(var o=i.pos;o<i.posMax&&!t(i.src.charCodeAt(o));)o++;return o===i.pos?!1:(s||(i.pending+=i.src.slice(i.pos,o)),i.pos=o,!0)}}}),TB=qe({"node_modules/markdown-it/lib/rules_inline/newline.js"(n,e){var t=Xt().isSpace;e.exports=function(i,s){var o,a,l,c=i.pos;if(i.src.charCodeAt(c)!==10)return!1;if(o=i.pending.length-1,a=i.posMax,!s)if(o>=0&&i.pending.charCodeAt(o)===32)if(o>=1&&i.pending.charCodeAt(o-1)===32){for(l=o-1;l>=1&&i.pending.charCodeAt(l-1)===32;)l--;i.pending=i.pending.slice(0,l),i.push("hardbreak","br",0)}else i.pending=i.pending.slice(0,-1),i.push("softbreak","br",0);else i.push("softbreak","br",0);for(c++;c<a&&t(i.src.charCodeAt(c));)c++;return i.pos=c,!0}}}),PB=qe({"node_modules/markdown-it/lib/rules_inline/escape.js"(n,e){var t=Xt().isSpace,r=[];for(i=0;i<256;i++)r.push(0);var i;"\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(s){r[s.charCodeAt(0)]=1}),e.exports=function(o,a){var l,c=o.pos,u=o.posMax;if(o.src.charCodeAt(c)!==92)return!1;if(c++,c<u){if(l=o.src.charCodeAt(c),l<256&&r[l]!==0)return a||(o.pending+=o.src[c]),o.pos+=2,!0;if(l===10){for(a||o.push("hardbreak","br",0),c++;c<u&&(l=o.src.charCodeAt(c),!!t(l));)c++;return o.pos=c,!0}}return a||(o.pending+="\\"),o.pos++,!0}}}),EB=qe({"node_modules/markdown-it/lib/rules_inline/backticks.js"(n,e){e.exports=function(r,i){var s,o,a,l,c,u,f,d,h=r.pos,m=r.src.charCodeAt(h);if(m!==96)return!1;for(s=h,h++,o=r.posMax;h<o&&r.src.charCodeAt(h)===96;)h++;if(a=r.src.slice(s,h),f=a.length,r.backticksScanned&&(r.backticks[f]||0)<=s)return i||(r.pending+=a),r.pos+=f,!0;for(c=u=h;(c=r.src.indexOf("`",u))!==-1;){for(u=c+1;u<o&&r.src.charCodeAt(u)===96;)u++;if(d=u-c,d===f)return i||(l=r.push("code_inline","code",0),l.markup=a,l.content=r.src.slice(h,c).replace(/\n/g," ").replace(/^ (.+) $/,"$1")),r.pos=u,!0;r.backticks[d]=c}return r.backticksScanned=!0,i||(r.pending+=a),r.pos+=f,!0}}}),b0=qe({"node_modules/markdown-it/lib/rules_inline/strikethrough.js"(n,e){e.exports.tokenize=function(i,s){var o,a,l,c,u,f=i.pos,d=i.src.charCodeAt(f);if(s||d!==126||(a=i.scanDelims(i.pos,!0),c=a.length,u=String.fromCharCode(d),c<2))return!1;for(c%2&&(l=i.push("text","",0),l.content=u,c--),o=0;o<c;o+=2)l=i.push("text","",0),l.content=u+u,i.delimiters.push({marker:d,length:0,token:i.tokens.length-1,end:-1,open:a.can_open,close:a.can_close});return i.pos+=a.length,!0};function t(r,i){var s,o,a,l,c,u=[],f=i.length;for(s=0;s<f;s++)a=i[s],a.marker===126&&a.end!==-1&&(l=i[a.end],c=r.tokens[a.token],c.type="s_open",c.tag="s",c.nesting=1,c.markup="~~",c.content="",c=r.tokens[l.token],c.type="s_close",c.tag="s",c.nesting=-1,c.markup="~~",c.content="",r.tokens[l.token-1].type==="text"&&r.tokens[l.token-1].content==="~"&&u.push(l.token-1));for(;u.length;){for(s=u.pop(),o=s+1;o<r.tokens.length&&r.tokens[o].type==="s_close";)o++;o--,s!==o&&(c=r.tokens[o],r.tokens[o]=r.tokens[s],r.tokens[s]=c)}}e.exports.postProcess=function(i){var s,o=i.tokens_meta,a=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<a;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),y0=qe({"node_modules/markdown-it/lib/rules_inline/emphasis.js"(n,e){e.exports.tokenize=function(i,s){var o,a,l,c=i.pos,u=i.src.charCodeAt(c);if(s||u!==95&&u!==42)return!1;for(a=i.scanDelims(i.pos,u===42),o=0;o<a.length;o++)l=i.push("text","",0),l.content=String.fromCharCode(u),i.delimiters.push({marker:u,length:a.length,token:i.tokens.length-1,end:-1,open:a.can_open,close:a.can_close});return i.pos+=a.length,!0};function t(r,i){var s,o,a,l,c,u,f=i.length;for(s=f-1;s>=0;s--)o=i[s],!(o.marker!==95&&o.marker!==42)&&o.end!==-1&&(a=i[o.end],u=s>0&&i[s-1].end===o.end+1&&i[s-1].marker===o.marker&&i[s-1].token===o.token-1&&i[o.end+1].token===a.token+1,c=String.fromCharCode(o.marker),l=r.tokens[o.token],l.type=u?"strong_open":"em_open",l.tag=u?"strong":"em",l.nesting=1,l.markup=u?c+c:c,l.content="",l=r.tokens[a.token],l.type=u?"strong_close":"em_close",l.tag=u?"strong":"em",l.nesting=-1,l.markup=u?c+c:c,l.content="",u&&(r.tokens[i[s-1].token].content="",r.tokens[i[o.end+1].token].content="",s--))}e.exports.postProcess=function(i){var s,o=i.tokens_meta,a=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<a;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),$B=qe({"node_modules/markdown-it/lib/rules_inline/link.js"(n,e){var t=Xt().normalizeReference,r=Xt().isSpace;e.exports=function(s,o){var a,l,c,u,f,d,h,m,p,v="",O="",b=s.pos,w=s.posMax,S=s.pos,_=!0;if(s.src.charCodeAt(s.pos)!==91||(f=s.pos+1,u=s.md.helpers.parseLinkLabel(s,s.pos,!0),u<0))return!1;if(d=u+1,d<w&&s.src.charCodeAt(d)===40){for(_=!1,d++;d<w&&(l=s.src.charCodeAt(d),!(!r(l)&&l!==10));d++);if(d>=w)return!1;if(S=d,h=s.md.helpers.parseLinkDestination(s.src,d,s.posMax),h.ok){for(v=s.md.normalizeLink(h.str),s.md.validateLink(v)?d=h.pos:v="",S=d;d<w&&(l=s.src.charCodeAt(d),!(!r(l)&&l!==10));d++);if(h=s.md.helpers.parseLinkTitle(s.src,d,s.posMax),d<w&&S!==d&&h.ok)for(O=h.str,d=h.pos;d<w&&(l=s.src.charCodeAt(d),!(!r(l)&&l!==10));d++);}(d>=w||s.src.charCodeAt(d)!==41)&&(_=!0),d++}if(_){if(typeof s.env.references>"u")return!1;if(d<w&&s.src.charCodeAt(d)===91?(S=d+1,d=s.md.helpers.parseLinkLabel(s,d),d>=0?c=s.src.slice(S,d++):d=u+1):d=u+1,c||(c=s.src.slice(f,u)),m=s.env.references[t(c)],!m)return s.pos=b,!1;v=m.href,O=m.title}return o||(s.pos=f,s.posMax=u,p=s.push("link_open","a",1),p.attrs=a=[["href",v]],O&&a.push(["title",O]),s.md.inline.tokenize(s),p=s.push("link_close","a",-1)),s.pos=d,s.posMax=w,!0}}}),QB=qe({"node_modules/markdown-it/lib/rules_inline/image.js"(n,e){var t=Xt().normalizeReference,r=Xt().isSpace;e.exports=function(s,o){var a,l,c,u,f,d,h,m,p,v,O,b,w,S="",_=s.pos,x=s.posMax;if(s.src.charCodeAt(s.pos)!==33||s.src.charCodeAt(s.pos+1)!==91||(d=s.pos+2,f=s.md.helpers.parseLinkLabel(s,s.pos+1,!1),f<0))return!1;if(h=f+1,h<x&&s.src.charCodeAt(h)===40){for(h++;h<x&&(l=s.src.charCodeAt(h),!(!r(l)&&l!==10));h++);if(h>=x)return!1;for(w=h,p=s.md.helpers.parseLinkDestination(s.src,h,s.posMax),p.ok&&(S=s.md.normalizeLink(p.str),s.md.validateLink(S)?h=p.pos:S=""),w=h;h<x&&(l=s.src.charCodeAt(h),!(!r(l)&&l!==10));h++);if(p=s.md.helpers.parseLinkTitle(s.src,h,s.posMax),h<x&&w!==h&&p.ok)for(v=p.str,h=p.pos;h<x&&(l=s.src.charCodeAt(h),!(!r(l)&&l!==10));h++);else v="";if(h>=x||s.src.charCodeAt(h)!==41)return s.pos=_,!1;h++}else{if(typeof s.env.references>"u")return!1;if(h<x&&s.src.charCodeAt(h)===91?(w=h+1,h=s.md.helpers.parseLinkLabel(s,h),h>=0?u=s.src.slice(w,h++):h=f+1):h=f+1,u||(u=s.src.slice(d,f)),m=s.env.references[t(u)],!m)return s.pos=_,!1;S=m.href,v=m.title}return o||(c=s.src.slice(d,f),s.md.inline.parse(c,s.md,s.env,b=[]),O=s.push("image","img",0),O.attrs=a=[["src",S],["alt",""]],O.children=b,O.content=c,v&&a.push(["title",v])),s.pos=h,s.posMax=x,!0}}}),LB=qe({"node_modules/markdown-it/lib/rules_inline/autolink.js"(n,e){var t=/^([a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/,r=/^([a-zA-Z][a-zA-Z0-9+.\-]{1,31}):([^<>\x00-\x20]*)$/;e.exports=function(s,o){var a,l,c,u,f,d,h=s.pos;if(s.src.charCodeAt(h)!==60)return!1;for(f=s.pos,d=s.posMax;;){if(++h>=d||(u=s.src.charCodeAt(h),u===60))return!1;if(u===62)break}return a=s.src.slice(f+1,h),r.test(a)?(l=s.md.normalizeLink(a),s.md.validateLink(l)?(o||(c=s.push("link_open","a",1),c.attrs=[["href",l]],c.markup="autolink",c.info="auto",c=s.push("text","",0),c.content=s.md.normalizeLinkText(a),c=s.push("link_close","a",-1),c.markup="autolink",c.info="auto"),s.pos+=a.length+2,!0):!1):t.test(a)?(l=s.md.normalizeLink("mailto:"+a),s.md.validateLink(l)?(o||(c=s.push("link_open","a",1),c.attrs=[["href",l]],c.markup="autolink",c.info="auto",c=s.push("text","",0),c.content=s.md.normalizeLinkText(a),c=s.push("link_close","a",-1),c.markup="autolink",c.info="auto"),s.pos+=a.length+2,!0):!1):!1}}}),MB=qe({"node_modules/markdown-it/lib/rules_inline/html_inline.js"(n,e){var t=gC().HTML_TAG_RE;function r(i){var s=i|32;return s>=97&&s<=122}e.exports=function(s,o){var a,l,c,u,f=s.pos;return!s.md.options.html||(c=s.posMax,s.src.charCodeAt(f)!==60||f+2>=c)||(a=s.src.charCodeAt(f+1),a!==33&&a!==63&&a!==47&&!r(a))||(l=s.src.slice(f).match(t),!l)?!1:(o||(u=s.push("html_inline","",0),u.content=s.src.slice(f,f+l[0].length)),s.pos+=l[0].length,!0)}}}),qB=qe({"node_modules/markdown-it/lib/rules_inline/entity.js"(n,e){var t=fC(),r=Xt().has,i=Xt().isValidEntityCode,s=Xt().fromCodePoint,o=/^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i,a=/^&([a-z][a-z0-9]{1,31});/i;e.exports=function(c,u){var f,d,h,m=c.pos,p=c.posMax;if(c.src.charCodeAt(m)!==38)return!1;if(m+1<p){if(f=c.src.charCodeAt(m+1),f===35){if(h=c.src.slice(m).match(o),h)return u||(d=h[1][0].toLowerCase()==="x"?parseInt(h[1].slice(1),16):parseInt(h[1],10),c.pending+=i(d)?s(d):s(65533)),c.pos+=h[0].length,!0}else if(h=c.src.slice(m).match(a),h&&r(t,h[1]))return u||(c.pending+=t[h[1]]),c.pos+=h[0].length,!0}return u||(c.pending+="&"),c.pos++,!0}}}),RB=qe({"node_modules/markdown-it/lib/rules_inline/balance_pairs.js"(n,e){function t(r,i){var s,o,a,l,c,u,f,d,h={},m=i.length;if(m){var p=0,v=-2,O=[];for(s=0;s<m;s++)if(a=i[s],O.push(0),(i[p].marker!==a.marker||v!==a.token-1)&&(p=s),v=a.token,a.length=a.length||0,!!a.close){for(h.hasOwnProperty(a.marker)||(h[a.marker]=[-1,-1,-1,-1,-1,-1]),c=h[a.marker][(a.open?3:0)+a.length%3],o=p-O[p]-1,u=o;o>c;o-=O[o]+1)if(l=i[o],l.marker===a.marker&&l.open&&l.end<0&&(f=!1,(l.close||a.open)&&(l.length+a.length)%3===0&&(l.length%3!==0||a.length%3!==0)&&(f=!0),!f)){d=o>0&&!i[o-1].open?O[o-1]+1:0,O[s]=s-o+d,O[o]=d,a.open=!1,l.end=s,l.close=!1,u=-1,v=-2;break}u!==-1&&(h[a.marker][(a.open?3:0)+(a.length||0)%3]=u)}}}e.exports=function(i){var s,o=i.tokens_meta,a=i.tokens_meta.length;for(t(i,i.delimiters),s=0;s<a;s++)o[s]&&o[s].delimiters&&t(i,o[s].delimiters)}}}),DB=qe({"node_modules/markdown-it/lib/rules_inline/text_collapse.js"(n,e){e.exports=function(r){var i,s,o=0,a=r.tokens,l=r.tokens.length;for(i=s=0;i<l;i++)a[i].nesting<0&&o--,a[i].level=o,a[i].nesting>0&&o++,a[i].type==="text"&&i+1<l&&a[i+1].type==="text"?a[i+1].content=a[i].content+a[i+1].content:(i!==s&&(a[s]=a[i]),s++);i!==s&&(a.length=s)}}}),IB=qe({"node_modules/markdown-it/lib/rules_inline/state_inline.js"(n,e){var t=XO(),r=Xt().isWhiteSpace,i=Xt().isPunctChar,s=Xt().isMdAsciiPunct;function o(a,l,c,u){this.src=a,this.env=c,this.md=l,this.tokens=u,this.tokens_meta=Array(u.length),this.pos=0,this.posMax=this.src.length,this.level=0,this.pending="",this.pendingLevel=0,this.cache={},this.delimiters=[],this._prev_delimiters=[],this.backticks={},this.backticksScanned=!1}o.prototype.pushPending=function(){var a=new t("text","",0);return a.content=this.pending,a.level=this.pendingLevel,this.tokens.push(a),this.pending="",a},o.prototype.push=function(a,l,c){this.pending&&this.pushPending();var u=new t(a,l,c),f=null;return c<0&&(this.level--,this.delimiters=this._prev_delimiters.pop()),u.level=this.level,c>0&&(this.level++,this._prev_delimiters.push(this.delimiters),this.delimiters=[],f={delimiters:this.delimiters}),this.pendingLevel=this.level,this.tokens.push(u),this.tokens_meta.push(f),u},o.prototype.scanDelims=function(a,l){var c=a,u,f,d,h,m,p,v,O,b,w=!0,S=!0,_=this.posMax,x=this.src.charCodeAt(a);for(u=a>0?this.src.charCodeAt(a-1):32;c<_&&this.src.charCodeAt(c)===x;)c++;return d=c-a,f=c<_?this.src.charCodeAt(c):32,v=s(u)||i(String.fromCharCode(u)),b=s(f)||i(String.fromCharCode(f)),p=r(u),O=r(f),O?w=!1:b&&(p||v||(w=!1)),p?S=!1:v&&(O||b||(S=!1)),l?(h=w,m=S):(h=w&&(!S||v),m=S&&(!w||b)),{can_open:h,can_close:m,length:d}},o.prototype.Token=t,e.exports=o}}),NB=qe({"node_modules/markdown-it/lib/parser_inline.js"(n,e){var t=FO(),r=[["text",CB()],["newline",TB()],["escape",PB()],["backticks",EB()],["strikethrough",b0().tokenize],["emphasis",y0().tokenize],["link",$B()],["image",QB()],["autolink",LB()],["html_inline",MB()],["entity",qB()]],i=[["balance_pairs",RB()],["strikethrough",b0().postProcess],["emphasis",y0().postProcess],["text_collapse",DB()]];function s(){var o;for(this.ruler=new t,o=0;o<r.length;o++)this.ruler.push(r[o][0],r[o][1]);for(this.ruler2=new t,o=0;o<i.length;o++)this.ruler2.push(i[o][0],i[o][1])}s.prototype.skipToken=function(o){var a,l,c=o.pos,u=this.ruler.getRules(""),f=u.length,d=o.md.options.maxNesting,h=o.cache;if(typeof h[c]<"u"){o.pos=h[c];return}if(o.level<d)for(l=0;l<f&&(o.level++,a=u[l](o,!0),o.level--,!a);l++);else o.pos=o.posMax;a||o.pos++,h[c]=o.pos},s.prototype.tokenize=function(o){for(var a,l,c=this.ruler.getRules(""),u=c.length,f=o.posMax,d=o.md.options.maxNesting;o.pos<f;){if(o.level<d)for(l=0;l<u&&(a=c[l](o,!1),!a);l++);if(a){if(o.pos>=f)break;continue}o.pending+=o.src[o.pos++]}o.pending&&o.pushPending()},s.prototype.parse=function(o,a,l,c){var u,f,d,h=new this.State(o,a,l,c);for(this.tokenize(h),f=this.ruler2.getRules(""),d=f.length,u=0;u<d;u++)f[u](h)},s.prototype.State=IB(),e.exports=s}}),BB=qe({"node_modules/linkify-it/lib/re.js"(n,e){e.exports=function(t){var r={};r.src_Any=hC().source,r.src_Cc=pC().source,r.src_Z=mC().source,r.src_P=ZO().source,r.src_ZPCc=[r.src_Z,r.src_P,r.src_Cc].join("|"),r.src_ZCc=[r.src_Z,r.src_Cc].join("|");var i="[><|]";return r.src_pseudo_letter="(?:(?!"+i+"|"+r.src_ZPCc+")"+r.src_Any+")",r.src_ip4="(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)",r.src_auth="(?:(?:(?!"+r.src_ZCc+"|[@/\\[\\]()]).)+@)?",r.src_port="(?::(?:6(?:[0-4]\\d{3}|5(?:[0-4]\\d{2}|5(?:[0-2]\\d|3[0-5])))|[1-5]?\\d{1,4}))?",r.src_host_terminator="(?=$|"+i+"|"+r.src_ZPCc+")(?!-|_|:\\d|\\.-|\\.(?!$|"+r.src_ZPCc+"))",r.src_path="(?:[/?#](?:(?!"+r.src_ZCc+"|"+i+`|[()[\\]{}.,"'?!\\-;]).|\\[(?:(?!`+r.src_ZCc+"|\\]).)*\\]|\\((?:(?!"+r.src_ZCc+"|[)]).)*\\)|\\{(?:(?!"+r.src_ZCc+'|[}]).)*\\}|\\"(?:(?!'+r.src_ZCc+`|["]).)+\\"|\\'(?:(?!`+r.src_ZCc+"|[']).)+\\'|\\'(?="+r.src_pseudo_letter+"|[-]).|\\.{2,}[a-zA-Z0-9%/&]|\\.(?!"+r.src_ZCc+"|[.]).|"+(t&&t["---"]?"\\-(?!--(?:[^-]|$))(?:-*)|":"\\-+|")+",(?!"+r.src_ZCc+").|;(?!"+r.src_ZCc+").|\\!+(?!"+r.src_ZCc+"|[!]).|\\?(?!"+r.src_ZCc+"|[?]).)+|\\/)?",r.src_email_name='[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]*',r.src_xn="xn--[a-z0-9\\-]{1,59}",r.src_domain_root="(?:"+r.src_xn+"|"+r.src_pseudo_letter+"{1,63})",r.src_domain="(?:"+r.src_xn+"|(?:"+r.src_pseudo_letter+")|(?:"+r.src_pseudo_letter+"(?:-|"+r.src_pseudo_letter+"){0,61}"+r.src_pseudo_letter+"))",r.src_host="(?:(?:(?:(?:"+r.src_domain+")\\.)*"+r.src_domain+"))",r.tpl_host_fuzzy="(?:"+r.src_ip4+"|(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%)))",r.tpl_host_no_ip_fuzzy="(?:(?:(?:"+r.src_domain+")\\.)+(?:%TLDS%))",r.src_host_strict=r.src_host+r.src_host_terminator,r.tpl_host_fuzzy_strict=r.tpl_host_fuzzy+r.src_host_terminator,r.src_host_port_strict=r.src_host+r.src_port+r.src_host_terminator,r.tpl_host_port_fuzzy_strict=r.tpl_host_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_port_no_ip_fuzzy_strict=r.tpl_host_no_ip_fuzzy+r.src_port+r.src_host_terminator,r.tpl_host_fuzzy_test="localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:"+r.src_ZPCc+"|>|$))",r.tpl_email_fuzzy="(^|"+i+'|"|\\(|'+r.src_ZCc+")("+r.src_email_name+"@"+r.tpl_host_fuzzy_strict+")",r.tpl_link_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_fuzzy_strict+r.src_path+")",r.tpl_link_no_ip_fuzzy="(^|(?![.:/\\-_@])(?:[$+<=>^`||]|"+r.src_ZPCc+"))((?![$+<=>^`||])"+r.tpl_host_port_no_ip_fuzzy_strict+r.src_path+")",r}}}),jB=qe({"node_modules/linkify-it/index.js"(n,e){function t(_){var x=Array.prototype.slice.call(arguments,1);return x.forEach(function(A){A&&Object.keys(A).forEach(function(C){_[C]=A[C]})}),_}function r(_){return Object.prototype.toString.call(_)}function i(_){return r(_)==="[object String]"}function s(_){return r(_)==="[object Object]"}function o(_){return r(_)==="[object RegExp]"}function a(_){return r(_)==="[object Function]"}function l(_){return _.replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}var c={fuzzyLink:!0,fuzzyEmail:!0,fuzzyIP:!1};function u(_){return Object.keys(_||{}).reduce(function(x,A){return x||c.hasOwnProperty(A)},!1)}var f={"http:":{validate:function(_,x,A){var C=_.slice(x);return A.re.http||(A.re.http=new RegExp("^\\/\\/"+A.re.src_auth+A.re.src_host_port_strict+A.re.src_path,"i")),A.re.http.test(C)?C.match(A.re.http)[0].length:0}},"https:":"http:","ftp:":"http:","//":{validate:function(_,x,A){var C=_.slice(x);return A.re.no_http||(A.re.no_http=new RegExp("^"+A.re.src_auth+"(?:localhost|(?:(?:"+A.re.src_domain+")\\.)+"+A.re.src_domain_root+")"+A.re.src_port+A.re.src_host_terminator+A.re.src_path,"i")),A.re.no_http.test(C)?x>=3&&_[x-3]===":"||x>=3&&_[x-3]==="/"?0:C.match(A.re.no_http)[0].length:0}},"mailto:":{validate:function(_,x,A){var C=_.slice(x);return A.re.mailto||(A.re.mailto=new RegExp("^"+A.re.src_email_name+"@"+A.re.src_host_strict,"i")),A.re.mailto.test(C)?C.match(A.re.mailto)[0].length:0}}},d="a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]",h="biz|com|edu|gov|net|org|pro|web|xxx|aero|asia|coop|info|museum|name|shop|рф".split("|");function m(_){_.__index__=-1,_.__text_cache__=""}function p(_){return function(x,A){var C=x.slice(A);return _.test(C)?C.match(_)[0].length:0}}function v(){return function(_,x){x.normalize(_)}}function O(_){var x=_.re=BB()(_.__opts__),A=_.__tlds__.slice();_.onCompile(),_.__tlds_replaced__||A.push(d),A.push(x.src_xn),x.src_tlds=A.join("|");function C(T){return T.replace("%TLDS%",x.src_tlds)}x.email_fuzzy=RegExp(C(x.tpl_email_fuzzy),"i"),x.link_fuzzy=RegExp(C(x.tpl_link_fuzzy),"i"),x.link_no_ip_fuzzy=RegExp(C(x.tpl_link_no_ip_fuzzy),"i"),x.host_fuzzy_test=RegExp(C(x.tpl_host_fuzzy_test),"i");var y=[];_.__compiled__={};function k(T,E){throw new Error('(LinkifyIt) Invalid schema "'+T+'": '+E)}Object.keys(_.__schemas__).forEach(function(T){var E=_.__schemas__[T];if(E!==null){var Q={validate:null,link:null};if(_.__compiled__[T]=Q,s(E)){o(E.validate)?Q.validate=p(E.validate):a(E.validate)?Q.validate=E.validate:k(T,E),a(E.normalize)?Q.normalize=E.normalize:E.normalize?k(T,E):Q.normalize=v();return}if(i(E)){y.push(T);return}k(T,E)}}),y.forEach(function(T){_.__compiled__[_.__schemas__[T]]&&(_.__compiled__[T].validate=_.__compiled__[_.__schemas__[T]].validate,_.__compiled__[T].normalize=_.__compiled__[_.__schemas__[T]].normalize)}),_.__compiled__[""]={validate:null,normalize:v()};var P=Object.keys(_.__compiled__).filter(function(T){return T.length>0&&_.__compiled__[T]}).map(l).join("|");_.re.schema_test=RegExp("(^|(?!_)(?:[><|]|"+x.src_ZPCc+"))("+P+")","i"),_.re.schema_search=RegExp("(^|(?!_)(?:[><|]|"+x.src_ZPCc+"))("+P+")","ig"),_.re.pretest=RegExp("("+_.re.schema_test.source+")|("+_.re.host_fuzzy_test.source+")|@","i"),m(_)}function b(_,x){var A=_.__index__,C=_.__last_index__,y=_.__text_cache__.slice(A,C);this.schema=_.__schema__.toLowerCase(),this.index=A+x,this.lastIndex=C+x,this.raw=y,this.text=y,this.url=y}function w(_,x){var A=new b(_,x);return _.__compiled__[A.schema].normalize(A,_),A}function S(_,x){if(!(this instanceof S))return new S(_,x);x||u(_)&&(x=_,_={}),this.__opts__=t({},c,x),this.__index__=-1,this.__last_index__=-1,this.__schema__="",this.__text_cache__="",this.__schemas__=t({},f,_),this.__compiled__={},this.__tlds__=h,this.__tlds_replaced__=!1,this.re={},O(this)}S.prototype.add=function(x,A){return this.__schemas__[x]=A,O(this),this},S.prototype.set=function(x){return this.__opts__=t(this.__opts__,x),this},S.prototype.test=function(x){if(this.__text_cache__=x,this.__index__=-1,!x.length)return!1;var A,C,y,k,P,T,E,Q,$;if(this.re.schema_test.test(x)){for(E=this.re.schema_search,E.lastIndex=0;(A=E.exec(x))!==null;)if(k=this.testSchemaAt(x,A[2],E.lastIndex),k){this.__schema__=A[2],this.__index__=A.index+A[1].length,this.__last_index__=A.index+A[0].length+k;break}}return this.__opts__.fuzzyLink&&this.__compiled__["http:"]&&(Q=x.search(this.re.host_fuzzy_test),Q>=0&&(this.__index__<0||Q<this.__index__)&&(C=x.match(this.__opts__.fuzzyIP?this.re.link_fuzzy:this.re.link_no_ip_fuzzy))!==null&&(P=C.index+C[1].length,(this.__index__<0||P<this.__index__)&&(this.__schema__="",this.__index__=P,this.__last_index__=C.index+C[0].length))),this.__opts__.fuzzyEmail&&this.__compiled__["mailto:"]&&($=x.indexOf("@"),$>=0&&(y=x.match(this.re.email_fuzzy))!==null&&(P=y.index+y[1].length,T=y.index+y[0].length,(this.__index__<0||P<this.__index__||P===this.__index__&&T>this.__last_index__)&&(this.__schema__="mailto:",this.__index__=P,this.__last_index__=T))),this.__index__>=0},S.prototype.pretest=function(x){return this.re.pretest.test(x)},S.prototype.testSchemaAt=function(x,A,C){return this.__compiled__[A.toLowerCase()]?this.__compiled__[A.toLowerCase()].validate(x,C,this):0},S.prototype.match=function(x){var A=0,C=[];this.__index__>=0&&this.__text_cache__===x&&(C.push(w(this,A)),A=this.__last_index__);for(var y=A?x.slice(A):x;this.test(y);)C.push(w(this,A)),y=y.slice(this.__last_index__),A+=this.__last_index__;return C.length?C:null},S.prototype.tlds=function(x,A){return x=Array.isArray(x)?x:[x],A?(this.__tlds__=this.__tlds__.concat(x).sort().filter(function(C,y,k){return C!==k[y-1]}).reverse(),O(this),this):(this.__tlds__=x.slice(),this.__tlds_replaced__=!0,O(this),this)},S.prototype.normalize=function(x){x.schema||(x.url="http://"+x.url),x.schema==="mailto:"&&!/^mailto:/i.test(x.url)&&(x.url="mailto:"+x.url)},S.prototype.onCompile=function(){},e.exports=S}}),zB=qe({"node_modules/punycode/punycode.js"(n,e){var t=2147483647,r=36,i=1,s=26,o=38,a=700,l=72,c=128,u="-",f=/^xn--/,d=/[^\0-\x7E]/,h=/[\x2E\u3002\uFF0E\uFF61]/g,m={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},p=r-i,v=Math.floor,O=String.fromCharCode;function b($){throw new RangeError(m[$])}function w($,L){const I=[];let Z=$.length;for(;Z--;)I[Z]=L($[Z]);return I}function S($,L){const I=$.split("@");let Z="";I.length>1&&(Z=I[0]+"@",$=I[1]),$=$.replace(h,".");const Y=$.split("."),ne=w(Y,L).join(".");return Z+ne}function _($){const L=[];let I=0;const Z=$.length;for(;I<Z;){const Y=$.charCodeAt(I++);if(Y>=55296&&Y<=56319&&I<Z){const ne=$.charCodeAt(I++);(ne&64512)==56320?L.push(((Y&1023)<<10)+(ne&1023)+65536):(L.push(Y),I--)}else L.push(Y)}return L}var x=$=>String.fromCodePoint(...$),A=function($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:r},C=function($,L){return $+22+75*($<26)-((L!=0)<<5)},y=function($,L,I){let Z=0;for($=I?v($/a):$>>1,$+=v($/L);$>p*s>>1;Z+=r)$=v($/p);return v(Z+(p+1)*$/($+o))},k=function($){const L=[],I=$.length;let Z=0,Y=c,ne=l,ae=$.lastIndexOf(u);ae<0&&(ae=0);for(let ie=0;ie<ae;++ie)$.charCodeAt(ie)>=128&&b("not-basic"),L.push($.charCodeAt(ie));for(let ie=ae>0?ae+1:0;ie<I;){let K=Z;for(let fe=1,j=r;;j+=r){ie>=I&&b("invalid-input");const U=A($.charCodeAt(ie++));(U>=r||U>v((t-Z)/fe))&&b("overflow"),Z+=U*fe;const ue=j<=ne?i:j>=ne+s?s:j-ne;if(U<ue)break;const ke=r-ue;fe>v(t/ke)&&b("overflow"),fe*=ke}const he=L.length+1;ne=y(Z-K,he,K==0),v(Z/he)>t-Y&&b("overflow"),Y+=v(Z/he),Z%=he,L.splice(Z++,0,Y)}return String.fromCodePoint(...L)},P=function($){const L=[];$=_($);let I=$.length,Z=c,Y=0,ne=l;for(const K of $)K<128&&L.push(O(K));let ae=L.length,ie=ae;for(ae&&L.push(u);ie<I;){let K=t;for(const fe of $)fe>=Z&&fe<K&&(K=fe);const he=ie+1;K-Z>v((t-Y)/he)&&b("overflow"),Y+=(K-Z)*he,Z=K;for(const fe of $)if(fe<Z&&++Y>t&&b("overflow"),fe==Z){let j=Y;for(let U=r;;U+=r){const ue=U<=ne?i:U>=ne+s?s:U-ne;if(j<ue)break;const ke=j-ue,Ce=r-ue;L.push(O(C(ue+ke%Ce,0))),j=v(ke/Ce)}L.push(O(C(j,0))),ne=y(Y,he,ie==ae),Y=0,++ie}++Y,++Z}return L.join("")},T=function($){return S($,function(L){return f.test(L)?k(L.slice(4).toLowerCase()):L})},E=function($){return S($,function(L){return d.test(L)?"xn--"+P(L):L})},Q={version:"2.1.0",ucs2:{decode:_,encode:x},decode:k,encode:P,toASCII:E,toUnicode:T};e.exports=Q}}),ZB=qe({"node_modules/markdown-it/lib/presets/default.js"(n,e){e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:100},components:{core:{},block:{},inline:{}}}}}),FB=qe({"node_modules/markdown-it/lib/presets/zero.js"(n,e){e.exports={options:{html:!1,xhtmlOut:!1,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["paragraph"]},inline:{rules:["text"],rules2:["balance_pairs","text_collapse"]}}}}}),XB=qe({"node_modules/markdown-it/lib/presets/commonmark.js"(n,e){e.exports={options:{html:!0,xhtmlOut:!0,breaks:!1,langPrefix:"language-",linkify:!1,typographer:!1,quotes:"“”‘’",highlight:null,maxNesting:20},components:{core:{rules:["normalize","block","inline"]},block:{rules:["blockquote","code","fence","heading","hr","html_block","lheading","list","reference","paragraph"]},inline:{rules:["autolink","backticks","emphasis","entity","escape","html_inline","image","link","newline","text"],rules2:["balance_pairs","emphasis","text_collapse"]}}}}}),vC=qe({"node_modules/markdown-it/lib/index.js"(n,e){var t=Xt(),r=rB(),i=iB(),s=dB(),o=AB(),a=NB(),l=jB(),c=dC(),u=zB(),f={default:ZB(),zero:FB(),commonmark:XB()},d=/^(vbscript|javascript|file|data):/,h=/^data:image\/(gif|png|jpeg|webp);/;function m(w){var S=w.trim().toLowerCase();return d.test(S)?!!h.test(S):!0}var p=["http:","https:","mailto:"];function v(w){var S=c.parse(w,!0);if(S.hostname&&(!S.protocol||p.indexOf(S.protocol)>=0))try{S.hostname=u.toASCII(S.hostname)}catch{}return c.encode(c.format(S))}function O(w){var S=c.parse(w,!0);if(S.hostname&&(!S.protocol||p.indexOf(S.protocol)>=0))try{S.hostname=u.toUnicode(S.hostname)}catch{}return c.decode(c.format(S),c.decode.defaultChars+"%")}function b(w,S){if(!(this instanceof b))return new b(w,S);S||t.isString(w)||(S=w||{},w="default"),this.inline=new a,this.block=new o,this.core=new s,this.renderer=new i,this.linkify=new l,this.validateLink=m,this.normalizeLink=v,this.normalizeLinkText=O,this.utils=t,this.helpers=t.assign({},r),this.options={},this.configure(w),S&&this.set(S)}b.prototype.set=function(w){return t.assign(this.options,w),this},b.prototype.configure=function(w){var S=this,_;if(t.isString(w)&&(_=w,w=f[_],!w))throw new Error('Wrong `markdown-it` preset "'+_+'", check name');if(!w)throw new Error("Wrong `markdown-it` preset, can't be empty");return w.options&&S.set(w.options),w.components&&Object.keys(w.components).forEach(function(x){w.components[x].rules&&S[x].ruler.enableOnly(w.components[x].rules),w.components[x].rules2&&S[x].ruler2.enableOnly(w.components[x].rules2)}),this},b.prototype.enable=function(w,S){var _=[];Array.isArray(w)||(w=[w]),["core","block","inline"].forEach(function(A){_=_.concat(this[A].ruler.enable(w,!0))},this),_=_.concat(this.inline.ruler2.enable(w,!0));var x=w.filter(function(A){return _.indexOf(A)<0});if(x.length&&!S)throw new Error("MarkdownIt. Failed to enable unknown rule(s): "+x);return this},b.prototype.disable=function(w,S){var _=[];Array.isArray(w)||(w=[w]),["core","block","inline"].forEach(function(A){_=_.concat(this[A].ruler.disable(w,!0))},this),_=_.concat(this.inline.ruler2.disable(w,!0));var x=w.filter(function(A){return _.indexOf(A)<0});if(x.length&&!S)throw new Error("MarkdownIt. Failed to disable unknown rule(s): "+x);return this},b.prototype.use=function(w){var S=[this].concat(Array.prototype.slice.call(arguments,1));return w.apply(w,S),this},b.prototype.parse=function(w,S){if(typeof w!="string")throw new Error("Input data should be a String");var _=new this.core.State(w,this,S);return this.core.process(_),_.tokens},b.prototype.render=function(w,S){return S=S||{},this.renderer.render(this.parse(w,S),this.options,S)},b.prototype.parseInline=function(w,S){var _=new this.core.State(w,this,S);return _.inlineMode=!0,this.core.process(_),_.tokens},b.prototype.renderInline=function(w,S){return S=S||{},this.renderer.render(this.parseInline(w,S),this.options,S)},e.exports=b}}),VB=qe({"node_modules/markdown-it/index.js"(n,e){e.exports=vC()}}),OC={};cC(OC,{getAstValues:()=>bg,isAst:()=>VO,isFunction:()=>WB,isVariable:()=>YB,resolve:()=>jc});function VO(n){return!!n?.$$mdtype}function WB(n){return n?.$$mdtype==="Function"}function YB(n){return n?.$$mdtype==="Variable"}function*bg(n){if(!(n==null||typeof n!="object")){if(Array.isArray(n))for(const e of n)yield*bg(e);if(VO(n)&&(yield n),Object.getPrototypeOf(n)===Object.prototype)for(const e of Object.values(n))yield*bg(e)}}function jc(n,e={}){if(n==null||typeof n!="object")return n;if(Array.isArray(n))return n.map(r=>jc(r,e));if(VO(n)&&n?.resolve instanceof Function)return n.resolve(e);if(Object.getPrototypeOf(n)!==Object.prototype)return n;const t={};for(const[r,i]of Object.entries(n))t[r]=jc(i,e);return t}var Ei=class{constructor(e="div",t={},r=[]){this.$$mdtype="Tag",this.name=e,this.attributes=t,this.children=r}};Ei.isTag=n=>n?.$$mdtype==="Tag";var UB=class{validate(n,e,t){return typeof n=="string"||typeof n=="object"?[]:[{id:"attribute-type-invalid",level:"error",message:`Attribute '${t}' must be type 'string | object'`}]}transform(n){if(!n||typeof n=="string")return n;const e=[];for(const[t,r]of Object.entries(n??{}))r&&e.push(t);return e.join(" ")}},GB=class{validate(n){return typeof n=="string"&&n.match(/^[a-zA-Z]/)?[]:[{id:"attribute-value-invalid",level:"error",message:"The 'id' attribute must start with a letter"}]}},w0=dh(uC()),hh=class{constructor(n=[]){this.$$mdtype="Variable",this.path=n}resolve({variables:n}={}){return n instanceof Function?n(this.path):this.path.reduce((e={},t)=>e[t],n)}},ph=class{constructor(n,e){this.$$mdtype="Function",this.name=n,this.parameters=e}resolve(n={}){const e=n?.functions?.[this.name];if(!e)return null;const t=jc(this.parameters,n);return e.transform?.(t,n)}},_0;(function(n){n[n.normal=0]="normal",n[n.string=1]="string",n[n.escape=2]="escape"})(_0||(_0={}));var hr="{%",Ki="%}",HB=/^[a-zA-Z0-9_-]+$/;function bd(n){return typeof n=="string"&&HB.test(n)}function No(n){return n&&typeof n=="object"&&typeof n.then=="function"}function mh(n,e=0){let t=0;for(let r=e;r<n.length;r++){const i=n[r];switch(t){case 1:switch(i){case'"':t=0;break;case"\\":t=2;break}break;case 2:t=1;break;case 0:if(i==='"')t=1;else if(n.startsWith(Ki,r))return r}}return null}function KB(n,e,t){try{return(0,w0.parse)(n,{Variable:hh,Function:ph})}catch(r){if(!(r instanceof w0.SyntaxError))throw r;const{message:i,location:{start:s,end:o}}=r,a={start:{line:e,character:s.offset+t},end:{line:e+1,character:o.offset+t}};return{type:"error",meta:{error:{message:i,location:a}}}}}function bC(n,e=0){let t=e+1;const r=[];let i=0;for(let s=0;s<n.length;s++){if(n[s]===`
|
|
263
|
-
`){t++;continue}if(!n.startsWith(hr,s))continue;const o=mh(n,s);if(o==null){s=s+hr.length;continue}const a=n.slice(s,o+Ki.length),l=n.slice(s+hr.length,o),c=n.lastIndexOf(`
|
|
264
|
-
`,s),u=n.indexOf(`
|
|
265
|
-
`,o),f=n.slice(c,u),d=KB(l.trim(),t,s-c),h=f.trim()===a?c:s,m=n.slice(i,h);r.push({type:"text",start:i,end:s-1,content:m}),r.push({map:[t,t+1],position:{start:s-c,end:s-c+a.length},start:s,end:s+a.length-1,info:a,...d}),i=o+Ki.length,s=i-1}return r.push({type:"text",start:i,end:n.length-1,content:n.slice(i)}),r}var WO={class:{type:UB,render:!0},id:{type:GB,render:!0}},Jl={findSchema(n,{nodes:e={},tags:t={}}={}){return n.tag?t[n.tag]:e[n.type]},attributes(n,e={}){const t=this.findSchema(n,e)??{},r={},i={...WO,...t.attributes};for(const[s,o]of Object.entries(i)){if(o.render==!1)continue;const a=typeof o.render=="string"?o.render:s;let l=n.attributes[s];if(typeof o.type=="function"){const c=new o.type;c.transform&&(l=c.transform(l,e))}l=l===void 0?o.default:l,l!==void 0&&(r[a]=l)}if(t.slots)for(const[s,o]of Object.entries(t.slots)){if(o.render===!1)continue;const a=typeof o.render=="string"?o.render:s;n.slots[s]&&(r[a]=this.node(n.slots[s],e))}return r},children(n,e={}){const t=n.children.flatMap(r=>this.node(r,e));return t.some(No)?Promise.all(t):t},node(n,e={}){const t=this.findSchema(n,e)??{};if(t&&t.transform instanceof Function)return t.transform(n,e);const r=this.children(n,e);if(!t||!t.render)return r;const i=this.attributes(n,e);return No(i)||No(r)?Promise.all([i,r]).then(s=>new Ei(t.render,...s)):new Ei(t.render,i,r)}},gh=class{constructor(e="node",t={},r=[],i){this.$$mdtype="Node",this.errors=[],this.lines=[],this.inline=!1,this.attributes=t,this.children=r,this.type=e,this.tag=i,this.annotations=[],this.slots={}}*walk(){for(const e of[...Object.values(this.slots),...this.children])yield e,yield*e.walk()}push(e){this.children.push(e)}resolve(e={}){return Object.assign(new gh,this,{children:this.children.map(t=>t.resolve(e)),attributes:jc(this.attributes,e),slots:Object.fromEntries(Object.entries(this.slots).map(([t,r])=>[t,r.resolve(e)]))})}findSchema(e={}){return Jl.findSchema(this,e)}transformAttributes(e={}){return Jl.attributes(this,e)}transformChildren(e){return Jl.children(this,e)}transform(e){return Jl.node(this,e)}},yC={Function:ph,Node:gh,Variable:hh};function JB(n,e){if(!e)return e;const t=yC[e.$$mdtype];return t?Object.assign(new t,e):e}function ej(n){return JSON.parse(n,JB)}var Qr={...yC,...OC,fromJSON:ej},Rn=" ",yg=", ",Dt=`
|
|
266
|
-
`,tj=".",k0="-",nj=80,rj=["strong","em","s"],ij=(n,e)=>Math.max(n,e),kp=(n,e=2)=>({...n,indent:(n.indent||0)+e});function*br(n,e){for(const t of n.children)yield*fs(t,e)}function*Yu(n){yield[...n].join("").trim()}function*xp(n){yield`| ${n.join(" | ")} |`}function yd(n){if(n!==void 0)return Qr.isAst(n)?wd(n):n===null?"null":Array.isArray(n)?"["+n.map(yd).join(yg)+"]":typeof n=="object"?"{"+Object.entries(n).map(([e,t])=>`${bd(e)?e:`"${e}"`}: ${yd(t)}`).join(yg)+"}":JSON.stringify(n)}function wg(n){const e=yd(n.value);if(e!==void 0)return n.name==="primary"?e:n.name==="id"&&typeof n.value=="string"&&bd(n.value)?"#"+n.value:n.type==="class"&&bd(n.name)?"."+n.name:`${n.name}=${e}`}function*sj(n){for(const[e,t]of Object.entries(n.attributes))if(e==="class"&&typeof t=="object"&&!Qr.isAst(t))for(const r of Object.keys(t))yield wg({type:"class",name:r,value:t});else yield wg({type:"attribute",name:e,value:t})}function*Rl(n){n.annotations.length&&(yield hr+Rn,yield n.annotations.map(wg).join(Rn),yield Rn+Ki)}function*oj(n){yield"$",yield n.path.map((e,t)=>t===0?e:bd(e)?"."+e:typeof e=="number"?`[${e}]`:`["${e}"]`).join("")}function*aj(n){yield n.name,yield"(",yield Object.values(n.parameters).map(yd).join(yg),yield")"}function*x0(n){let e;do{const{value:t,done:r}=n.next();if(r)return;e=t.trimStart()}while(!e.length);yield e,yield*n}function*Uu(n,e){yield n.replace(e,"\\$&").replace(new RegExp(" ","g")," ")}function*lj(n,e={}){const t={...e,parent:n},r=Rn.repeat(t.indent||0);switch(n.type){case"document":{n.attributes.frontmatter&&n.attributes.frontmatter.length&&(yield"---"+Dt+n.attributes.frontmatter+Dt+"---"+Dt+Dt),yield*x0(br(n,t));break}case"heading":{yield Dt,yield r,yield"#".repeat(n.attributes.level||1),yield Rn,yield*x0(br(n,t)),yield*Rl(n),yield Dt;break}case"paragraph":{yield Dt,yield*br(n,t),yield*Rl(n),yield Dt;break}case"inline":{yield r,yield*br(n,t);break}case"image":{yield"!",yield"[",yield*fs(n.attributes.alt,t),yield"]",yield"(",yield*typeof n.attributes.src=="string"?Uu(n.attributes.src,/[()]/):fs(n.attributes.src,t),n.attributes.title&&(yield Rn+`"${n.attributes.title}"`),yield")";break}case"link":{yield"[",yield*br(n,t),yield"]",yield"(",yield*typeof n.attributes.href=="string"?Uu(n.attributes.href,/[()]/g):fs(n.attributes.href,t),n.attributes.title&&(yield Rn+`"${n.attributes.title}"`),yield")";break}case"text":{const{content:i}=n.attributes;Qr.isAst(i)?(yield hr+Rn,yield*fs(i,t),yield Rn+Ki):e.parent&&rj.includes(e.parent.type)?yield*Uu(i,/[*_~]/g):yield*Uu(i,/^[*>#]/);break}case"blockquote":{const i=">"+Rn;yield n.children.map(s=>wd(s,t).trimStart()).map(s=>Dt+r+i+s).join(r+i);break}case"hr":{yield Dt,yield r,yield"---",yield Dt;break}case"fence":{yield Dt,yield r;const s=(n.attributes.content.match(/`{3,}/g)||[]).map(a=>a.length).reduce(ij,0),o="`".repeat(s?s+1:3);yield o,n.attributes.language&&(yield n.attributes.language),n.annotations.length&&(yield Rn),yield*Rl(n),yield Dt,yield r,yield n.attributes.content.split(Dt).join(Dt+r),yield o,yield Dt;break}case"tag":{n.inline||(yield Dt,yield r);const i=hr+Rn,s=[...sj(n)].filter(c=>c!==void 0),o=[i+n.tag,...s],a=o.join(Rn),l=a.length+i.length*2>(e.maxTagOpeningWidth||nj);yield(!n.inline&&l?o.join(Dt+Rn.repeat(i.length)+r):a)+Rn+(n.children.length?"":"/")+Ki,n.children.length&&(yield*br(n,t.allowIndentation?kp(t):t),n.inline||(yield r),yield hr+Rn+"/"+n.tag+Rn+Ki),n.inline||(yield Dt);break}case"list":{const i=n.children.some(s=>s.children.some(o=>o.type==="paragraph"));for(let s=0;s<n.children.length;s++){const o=n.attributes.ordered?`${s===0?n.attributes.start??"1":"1"}${n.attributes.marker??tj}`:n.attributes.marker??k0;let a=wd(n.children[s],kp(t,o.length+1));(!i||s===n.children.length-1)&&(a=a.trim()),yield Dt+r+o+" "+a}yield Dt;break}case"item":{for(let i=0;i<n.children.length;i++)yield*fs(n.children[i],t),i===0&&(yield*Rl(n));break}case"strong":{yield n.attributes.marker??"**",yield*Yu(br(n,t)),yield n.attributes.marker??"**";break}case"em":{yield n.attributes.marker??"*",yield*Yu(br(n,t)),yield n.attributes.marker??"*";break}case"code":{yield"`",yield*Yu(fs(n.attributes.content,t)),yield"`";break}case"s":{yield"~~",yield*Yu(br(n,t)),yield"~~";break}case"hardbreak":{yield"\\"+Dt,yield r;break}case"softbreak":{yield Dt,yield r;break}case"table":{const i=[...br(n,kp(t))];if(e.parent&&e.parent.type==="tag"&&e.parent.tag==="table"){for(let s=0;s<i.length;s++){const o=i[s];if(typeof o=="string")o.trim().length&&(yield Dt,yield o);else{s!==0&&(yield Dt,yield r+"---");for(const a of o)yield Dt+r+k0+" "+a}}yield Dt}else{const s=[];for(const l of i)for(let c=0;c<l.length;c++)s[c]=s[c]?Math.max(s[c],l[c].length):l[c].length;const[o,...a]=i;yield Dt,yield*xp(o.map((l,c)=>l+Rn.repeat(s[c]-l.length))),yield Dt,yield*xp(o.map((l,c)=>"-".repeat(s[c]))),yield Dt;for(const l of a)yield*xp(l.map((c,u)=>c+Rn.repeat(s[u]-c.length))),yield Dt}break}case"thead":{const[i]=[...br(n,t)];yield i||[];break}case"tr":{yield[...br(n,t)];break}case"td":case"th":{yield[...br(n,t),...Rl(n)].join("").trim();break}case"tbody":{yield*br(n,t);break}case"comment":{yield"<!-- "+n.attributes.content+` -->
|
|
267
|
-
`;break}}}function*fs(n,e={}){switch(typeof n){case"undefined":break;case"boolean":case"number":case"string":{yield n.toString();break}case"object":{if(n===null)break;if(Array.isArray(n)){for(const t of n)yield*fs(t,e);break}switch(n.$$mdtype){case"Function":{yield*aj(n);break}case"Node":yield*lj(n,e);break;case"Variable":{yield*oj(n);break}default:throw new Error(`Unimplemented: "${n.$$mdtype}"`)}break}}}function wd(n,e){let t="";for(const r of fs(n,e))t+=r;return t.trimStart()}function pu(n){return n!==!1&&n!==void 0&&n!==null}function cj(n){const e=[{condition:n.attributes.primary,children:[]}];for(const t of n.children)t.type==="tag"&&t.tag==="else"?e.push({condition:"primary"in t.attributes?t.attributes.primary:!0,children:[]}):e[e.length-1].children.push(t);return e}var uj={attributes:{primary:{type:Object,render:!1}},transform(n,e){const t=cj(n);for(const{condition:r,children:i}of t)if(pu(r)){const s=i.flatMap(o=>o.transform(e));return s.some(No)?Promise.all(s).then(o=>o.flat()):s}return[]}},fj={selfClosing:!0,attributes:{primary:{type:Object,render:!1}}},dj={transform(n){return Object.values(n).every(e=>pu(e))}},hj={transform(n){return Object.values(n).find(e=>pu(e))!==void 0}},pj={parameters:{0:{required:!0}},transform(n){return!pu(n[0])}},mj={transform(n){const e=Object.values(n);return e.every(t=>t===e[0])}},gj={transform(n){return JSON.stringify(n[0],null,2)}},vj={transform(n){return n[0]===void 0?n[1]:n[0]}},wC={and:dj,or:hj,not:pj,equals:mj,default:vj,debug:gj};function Sp(n,e="td"){n.type="tr",n.attributes={};for(const t of n.children)t.type=e;return n}function Oj(n){for(const e of n.walk()){if(e.type!=="tag"||e.tag!=="table")continue;const[t,...r]=e.children;if(!t||t.type==="table")continue;const i=new Qr.Node("table",e.attributes,[new Qr.Node("thead"),new Qr.Node("tbody")]),[s,o]=i.children;t.type==="list"&&s.push(Sp(t,"th"));for(const a of r){if(a.type==="list")Sp(a);else if(a.type==="tag"&&a.tag==="if"){const l=[];for(const c of a.children)c.type!=="hr"&&(c.type==="list"&&Sp(c),l.push(c));a.children=l}else continue;o.push(a)}e.children=[i]}}var _C=[Oj],S0={ordered_list:"list",bullet_list:"list",code_inline:"code",list_item:"item",variable:"text"};function A0(n,e){for(const t of e){n.annotations.push(t);const{name:r,value:i,type:s}=t;s==="attribute"?(n.attributes[r]!==void 0&&n.errors.push({id:"duplicate-attribute",level:"warning",message:`Attribute '${r}' already set`}),n.attributes[r]=i):s==="class"&&(n.attributes.class?n.attributes.class[r]=i:n.attributes.class={[r]:i})}}function bj(n,e){switch(e){case"heading":return{level:Number(n.tag.replace("h",""))};case"list":{const t=n.attrs?Object.fromEntries(n.attrs):void 0,r=n.type.startsWith("ordered");return r&&t?.start?{ordered:!0,start:t.start,marker:n.markup}:{ordered:r,marker:n.markup}}case"link":{const t=Object.fromEntries(n.attrs);return t.title?{href:t.href,title:t.title}:{href:t.href}}case"image":{const t=Object.fromEntries(n.attrs);return t.title?{alt:n.content,src:t.src,title:t.title}:{alt:n.content,src:t.src}}case"em":case"strong":return{marker:n.markup};case"text":case"code":case"comment":return{content:(n.meta||{}).variable||n.content};case"fence":{const[t]=n.info.split(" ",1);return t===""||t===hr?{content:n.content}:{content:n.content,language:t}}case"td":case"th":{if(n.attrs){const t=Object.fromEntries(n.attrs);let r;if(t.style&&(t.style.includes("left")?r="left":t.style.includes("center")?r="center":t.style.includes("right")&&(r="right")),r)return{align:r}}return{}}default:return{}}}function kC(n,e,t,r,i,s){if(n.type==="frontmatter"){e[0].attributes.frontmatter=n.content;return}if(n.hidden||n.type==="text"&&n.content==="")return;const o=n.errors||[],a=e[e.length-1],{tag:l,attributes:c,error:u}=n.meta||{};if(n.type==="annotation")return s?A0(s,c):a.errors.push({id:"no-inline-annotations",level:"error",message:`Can't apply inline annotations to '${a.type}'`});let f=n.type.replace(/_(open|close)$/,"");if(S0[f]&&(f=S0[f]),f==="error"){const{message:v,location:O}=u;o.push({id:"parse-error",level:"critical",message:v,location:O})}if(n.nesting<0){if(a.type===f&&a.tag===l)return a.lines&&n.map&&a.lines.push(...n.map),e.pop();o.push({id:"missing-opening",level:"critical",message:`Node '${f}' is missing opening`})}const d=bj(n,f),h=new gh(f,d,void 0,l||void 0),{position:m={}}=n;if(h.errors=o,i!==!1&&(h.lines=n.map||a.lines||[],h.location={file:t,start:{line:h.lines[0],character:m.start},end:{line:h.lines[1],character:m.end}}),s&&(h.inline=!0),c&&["tag","fence","image"].includes(f)&&A0(h,c),r&&l==="slot"&&typeof h.attributes.primary=="string"?a.slots[h.attributes.primary]=h:a.push(h),n.nesting>0&&e.push(h),!Array.isArray(n.children))return;if(h.type==="inline"&&(s=a),e.push(h),!(f==="image"))for(const v of n.children)kC(v,e,t,r,i,s);e.pop()}function yj(n,e){const t=new gh("document"),r=[t];typeof e=="string"&&(e={file:e});for(const i of n)kC(i,r,e?.file,e?.slots,e?.location);if(r.length>1)for(const i of r.slice(1))i.errors.push({id:"missing-closing",level:"critical",message:`Node '${i.tag||i.type}' is missing closing`});for(const i of _C)i(t);return t}var YO={};cC(YO,{blockquote:()=>Aj,code:()=>jj,comment:()=>Xj,document:()=>wj,em:()=>Dj,error:()=>Vj,fence:()=>Sj,hardbreak:()=>Zj,heading:()=>_j,hr:()=>Pj,image:()=>xj,inline:()=>Nj,item:()=>Cj,link:()=>Bj,list:()=>Tj,node:()=>Wj,paragraph:()=>kj,s:()=>Ij,softbreak:()=>Fj,strong:()=>Rj,table:()=>Ej,tbody:()=>Mj,td:()=>$j,text:()=>zj,th:()=>Qj,thead:()=>qj,tr:()=>Lj});var wj={render:"article",children:["heading","paragraph","image","table","tag","fence","blockquote","comment","list","hr"],attributes:{frontmatter:{render:!1}}},_j={children:["inline"],attributes:{level:{type:Number,render:!1,required:!0}},transform(n,e){return new Ei(`h${n.attributes.level}`,n.transformAttributes(e),n.transformChildren(e))}},kj={render:"p",children:["inline"]},xj={render:"img",attributes:{src:{type:String,required:!0},alt:{type:String},title:{type:String}}},Sj={render:"pre",attributes:{content:{type:String,render:!1,required:!0},language:{type:String,render:"data-language"},process:{type:Boolean,render:!1,default:!0}},transform(n,e){const t=n.transformAttributes(e),r=n.children.length?n.transformChildren(e):[n.attributes.content];return new Ei("pre",t,r)}},Aj={render:"blockquote",children:["heading","paragraph","image","table","tag","fence","blockquote","list","hr"]},Cj={render:"li",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"]},Tj={children:["item"],attributes:{ordered:{type:Boolean,render:!1,required:!0},start:{type:Number},marker:{type:String,render:!1}},transform(n,e){return new Ei(n.attributes.ordered?"ol":"ul",n.transformAttributes(e),n.transformChildren(e))}},Pj={render:"hr"},Ej={render:"table"},$j={render:"td",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"],attributes:{align:{type:String},colspan:{type:Number,render:"colSpan"},rowspan:{type:Number,render:"rowSpan"}}},Qj={render:"th",attributes:{width:{type:String},align:{type:String},colspan:{type:Number,render:"colSpan"},rowspan:{type:Number,render:"rowSpan"}}},Lj={render:"tr",children:["th","td"]},Mj={render:"tbody",children:["tr","tag"]},qj={render:"thead",children:["tr"]},Rj={render:"strong",children:["em","s","link","code","text","tag"],attributes:{marker:{type:String,render:!1}}},Dj={render:"em",children:["strong","s","link","code","text","tag"],attributes:{marker:{type:String,render:!1}}},Ij={render:"s",children:["strong","em","link","code","text","tag"]},Nj={children:["strong","em","s","code","text","tag","link","image","hardbreak","softbreak","comment"]},Bj={render:"a",children:["strong","em","s","code","text","tag"],attributes:{href:{type:String,required:!0},title:{type:String}}},jj={render:"code",attributes:{content:{type:String,render:!1,required:!0}},transform(n,e){const t=n.transformAttributes(e);return new Ei("code",t,[n.attributes.content])}},zj={attributes:{content:{type:String,required:!0}},transform(n){return n.attributes.content}},Zj={render:"br"},Fj={transform(){return" "}},Xj={attributes:{content:{type:String,required:!0}}},Vj={},Wj={},Yj=dh(VB()),{escapeHtml:C0}=(0,Yj.default)().utils,Uj=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);function Af(n){if(typeof n=="string"||typeof n=="number")return C0(String(n));if(Array.isArray(n))return n.map(Af).join("");if(n===null||typeof n!="object"||!Ei.isTag(n))return"";const{name:e,attributes:t,children:r=[]}=n;if(!e)return Af(r);let i=`<${e}`;for(const[s,o]of Object.entries(t??{}))i+=` ${s.toLowerCase()}="${C0(String(o))}"`;return i+=">",Uj.has(e)||(r.length&&(i+=Af(r)),i+=`</${e}>`),i}function Gj(n,e){return typeof n!="string"||n[0]!==n[0].toUpperCase()?n:e instanceof Function?e(n):e[n]}function Hj(n,e,{components:t={}}={}){function r(s){if(s==null||typeof s!="object")return s;if(Array.isArray(s))return s.map(a=>r(a));if(s.$$mdtype==="Tag")return i(s);if(typeof s!="object")return s;const o={};for(const[a,l]of Object.entries(s))o[a]=r(l);return o}function i(s){if(Array.isArray(s))return e.createElement(e.Fragment,null,...s.map(i));if(s===null||typeof s!="object"||!Ei.isTag(s))return s;const{name:o,attributes:{class:a,...l}={},children:c=[]}=s;return a&&(l.className=a),e.createElement(Gj(o,t),Object.keys(l).length==0?null:r(l),...c.map(i))}return i(n)}function Kj(n,e){return typeof n!="string"?"Fragment":n[0]!==n[0].toUpperCase()?n:e instanceof Function?e(n):e[n]}function T0(n){return n.map(UO).join(", ")}function _g(n){return n==null||typeof n!="object"?JSON.stringify(n):Array.isArray(n)?`[${n.map(t=>_g(t)).join(", ")}]`:n.$$mdtype==="Tag"?UO(n):typeof n!="object"?JSON.stringify(n):`{${Object.entries(n).map(([t,r])=>[JSON.stringify(t),_g(r)].join(": ")).join(", ")}}`}function UO(n){if(Array.isArray(n))return`React.createElement(React.Fragment, null, ${T0(n)})`;if(n===null||typeof n!="object"||!Ei.isTag(n))return JSON.stringify(n);const{name:e,attributes:{class:t,...r}={},children:i=[]}=n;return t&&(r.className=t),`React.createElement(
|
|
268
|
-
tagName(${JSON.stringify(e)}, components),
|
|
269
|
-
${Object.keys(r).length==0?"null":_g(r)},
|
|
270
|
-
${T0(i)})`}function Jj(n){return`
|
|
271
|
-
(({components = {}} = {}) => {
|
|
272
|
-
${Kj}
|
|
273
|
-
return ${UO(n)};
|
|
274
|
-
})
|
|
275
|
-
`}var ez={html:Af,react:Hj,reactStatic:Jj},tz=class{validate(n,e){const{partials:t={}}=e;return t[n]?[]:[{id:"attribute-value-invalid",level:"error",message:`Partial \`${n}\` not found. The 'file' attribute must be set in \`config.partials\``}]}},nz={inline:!1,selfClosing:!0,attributes:{file:{type:tz,render:!1,required:!0},variables:{type:Object,render:!1}},transform(n,e){const{partials:t={}}=e,{file:r,variables:i}=n.attributes,s=t[r];if(!s)return null;const o={...e,variables:{...e.variables,...i,"$$partial:filename":r}},a=l=>l.resolve(o).transformChildren(o);return Array.isArray(s)?s.flatMap(a):a(s)}},rz={children:["table"],inline:!1},iz={attributes:{primary:{type:String,required:!0}}},xC={else:fj,if:uj,partial:nz,slot:iz,table:rz},sz=dh(vC()),_d=dh(uC());function SC(n,e,t){try{const{type:r,meta:i,nesting:s=0}=(0,_d.parse)(e,{Variable:hh,Function:ph}),o=n.push(r,"",s);return o.info=e,o.meta=i,n.delimiters||(n.delimiters=[]),o}catch(r){if(!(r instanceof _d.SyntaxError))throw r;const{message:i,location:{start:s,end:o}}=r,a=t?{start:{offset:s.offset+t},end:{offset:o.offset+t}}:null,l=n.push("error","",0);return l.meta={error:{message:i,location:a}},l}}function oz(n,e,t,r){const i=n.bMarks[e]+n.tShift[e],s=n.eMarks[e];if(!n.src.startsWith(hr,i))return!1;const o=mh(n.src,i),a=n.src.slice(0,s).trim().length;if(!o||o<a-Ki.length)return!1;const l=i+hr.length,c=n.src.slice(l,o).trim(),u=n.src.slice(i,o+Ki.length).split(`
|
|
276
|
-
`).length;if(c[0]==="$")return!1;if(r)return!0;const f=SC(n,c,l);return f.map=[e,e+u],n.line+=u,!0}function az(n,e){if(!n.src.startsWith(hr,n.pos))return!1;const t=mh(n.src,n.pos);if(!t)return!1;const r=n.src.slice(n.pos+hr.length,t);return e||SC(n,r.trim()),n.pos=t+Ki.length,!0}function lz(n){let e;for(e of n.tokens)if(e.type==="fence"){if(e.info.includes(hr)){const t=e.info.indexOf(hr),r=mh(e.info,t),i=e.info.slice(t+hr.length,r);try{const{meta:s}=(0,_d.parse)(i.trim(),{Variable:hh,Function:ph});e.meta=s}catch(s){if(!(s instanceof _d.SyntaxError))throw s;e.errors||(e.errors=[]),e.errors.push({id:"fence-tag-error",level:"error",message:`Syntax error in fence tag: ${s.message}`})}}e?.meta?.attributes?.find(t=>t.name==="process"&&!t.value)||(e.children=bC(e.content,e.map[0]))}}function cz(n){n.block.ruler.before("paragraph","annotations",oz,{alt:["paragraph","blockquote"]}),n.inline.ruler.push("containers",az),n.core.ruler.push("annotations",lz)}var AC="---";function CC(n,e){return n.src.slice(n.bMarks[e],n.eMarks[e]).trim()}function uz(n,e){for(let t=1;t<e;t++)if(CC(n,t)===AC)return t}function fz(n,e,t,r){if(e!=0||CC(n,0)!=AC)return!1;const i=uz(n,t);if(!i)return!1;if(r)return!0;const s=n.push("frontmatter","",0);return s.content=n.src.slice(n.eMarks[0],n.bMarks[i]).trim(),s.map=[0,i],s.hidden=!0,n.line=i+1,!0}function dz(n){n.block.ruler.before("hr","frontmatter",fz)}var kd="<!--",kg="-->";function hz(n,e,t,r){const i=n.bMarks[e]+n.tShift[e];if(!n.src.startsWith(kd,i))return!1;const s=n.src.indexOf(kg,i);if(!s)return!1;if(r)return!0;const o=n.src.slice(i+kd.length,s),a=o.split(`
|
|
277
|
-
`).length,l=n.push("comment","",0);return l.content=o.trim(),l.map=[e,e+a],n.line+=a,!0}function pz(n,e){if(!n.src.startsWith(kd,n.pos))return!1;const t=n.src.indexOf(kg,n.pos);if(!t)return!1;if(e)return!0;const r=n.src.slice(n.pos+kd.length,t),i=n.push("comment","",0);return i.content=r.trim(),n.pos=t+kg.length,!0}function mz(n){n.block.ruler.before("table","comment",hz,{alt:["paragraph"]}),n.inline.ruler.push("comment",pz)}var TC=class{constructor(n={}){this.parser=new sz.default(n),this.parser.use(cz,"annotations",{}),this.parser.use(dz,"frontmatter",{}),this.parser.disable(["lheading","code"]),n.allowComments&&this.parser.use(mz,"comments",{})}tokenize(n){return this.parser.parse(n.toString(),{})}},gz={String,Number,Array,Object,Boolean};function GO(n,e,t,r){if(!n)return!0;if(Qr.isFunction(e)&&t.validation?.validateFunctions){const i=t.functions?.[e.name];return i?.returns?Array.isArray(i.returns)?i.returns.find(s=>s===n)!==void 0:i.returns===n:!0}if(Qr.isAst(e))return!0;if(Array.isArray(n))return n.some(i=>GO(i,e,t,r));if(typeof n=="string"&&(n=gz[n]),typeof n=="function"){const i=new n;if(i.validate)return i.validate(e,t,r)}return e!=null&&e.constructor===n}function HO(n){return typeof n=="string"?n:Array.isArray(n)?n.map(HO).join(" | "):n.name}function vz(n,e){const t=e.functions?.[n.name],r=[];if(!t)return[{id:"function-undefined",level:"critical",message:`Undefined function: '${n.name}'`}];if(t.validate&&r.push(...t.validate(n,e)),t.parameters)for(const[i,s]of Object.entries(n.parameters)){const o=t.parameters?.[i];if(!o){r.push({id:"parameter-undefined",level:"error",message:`Invalid parameter: '${i}'`});continue}if(!(Qr.isAst(s)&&!Qr.isFunction(s))&&o.type){const a=GO(o.type,s,e,i);a===!1?r.push({id:"parameter-type-invalid",level:"error",message:`Parameter '${i}' of '${n.name}' must be type of '${HO(o.type)}'`}):Array.isArray(a)&&r.push(...a)}}for(const[i,{required:s}]of Object.entries(t.parameters??{}))s&&n.parameters[i]===void 0&&r.push({id:"parameter-missing-required",level:"error",message:`Missing required parameter: '${i}'`});return r}function Oz(n,e){return n.length<=e?JSON.stringify(n):`[${n.slice(0,e).map(r=>JSON.stringify(r)).join(",")}, ... ${n.length-e} more]`}function PC(n,e){const t=n.findSchema(e),r=[...n.errors||[]];if(!t)return r.push({id:n.tag?"tag-undefined":"node-undefined",level:"critical",message:n.tag?`Undefined tag: '${n.tag}'`:`Undefined node: '${n.type}'`}),r;t.inline!=null&&n.inline!==t.inline&&r.push({id:"tag-placement-invalid",level:"critical",message:`'${n.tag}' tag should be ${t.inline?"inline":"block"}`}),t.selfClosing&&n.children.length>0&&r.push({id:"tag-selfclosing-has-children",level:"critical",message:`'${n.tag}' tag should be self-closing`});const i={...WO,...t.attributes};for(const s of Object.keys(n.slots))t.slots?.[s]||r.push({id:"slot-undefined",level:"error",message:`Invalid slot: '${s}'`});for(let[s,o]of Object.entries(n.attributes)){const a=i[s];if(!a){r.push({id:"attribute-undefined",level:"error",message:`Invalid attribute: '${s}'`});continue}let{type:l,matches:c,errorLevel:u}=a;if(Qr.isAst(o))if(Qr.isFunction(o)&&e.validation?.validateFunctions)r.push(...vz(o,e));else if(Qr.isVariable(o)&&e.variables){let f=!1,d=e.variables;for(const h of o.path){if(!Object.prototype.hasOwnProperty.call(d,h)){f=!0;break}d=d[h]}f&&r.push({id:"variable-undefined",level:"error",message:`Undefined variable: '${o.path.join(".")}'`})}else continue;if(o=o,l){const f=GO(l,o,e,s);f===!1&&r.push({id:"attribute-type-invalid",level:u||"error",message:`Attribute '${s}' must be type of '${HO(l)}'`}),Array.isArray(f)&&r.push(...f)}if(typeof c=="function"&&(c=c(e)),Array.isArray(c)&&!c.includes(o)&&r.push({id:"attribute-value-invalid",level:u||"error",message:`Attribute '${s}' must match one of ${Oz(c,8)}. Got '${o}' instead.`}),c instanceof RegExp&&!c.test(o)&&r.push({id:"attribute-value-invalid",level:u||"error",message:`Attribute '${s}' must match ${c}. Got '${o}' instead.`}),typeof a.validate=="function"){const f=a.validate(o,e,s);Array.isArray(f)&&r.push(...f)}}for(const[s,{required:o}]of Object.entries(i))o&&n.attributes[s]===void 0&&r.push({id:"attribute-missing-required",level:"error",message:`Missing required attribute: '${s}'`});if(t.slots)for(const[s,{required:o}]of Object.entries(t.slots))o&&n.slots[s]===void 0&&r.push({id:"slot-missing-required",level:"error",message:`Missing required slot: '${s}'`});for(const{type:s}of n.children)t.children&&s!=="error"&&!t.children.includes(s)&&r.push({id:"child-invalid",level:"warning",message:`Can't nest '${s}' in '${n.tag||n.type}'`});if(t.validate){const s=t.validate(n,e);if(No(s))return s.then(o=>r.concat(o));r.push(...s)}return r}function*EC(n,e=[]){yield[n,e];for(const t of[...Object.values(n.slots),...n.children])yield*EC(t,[...e,n])}function bz(n,e){const t=[...EC(n)].map(([r,i])=>{const{type:s,lines:o,location:a}=r,l={...e,validation:{...e.validation,parents:i}},c=PC(r,l);return No(c)?c.then(u=>u.map(f=>({type:s,lines:o,location:a,error:f}))):c.map(u=>({type:s,lines:o,location:a,error:u}))});return t.some(No)?Promise.all(t).then(r=>r.flat()):t.flat()}var yz=new TC;function $C(n={}){return{...n,tags:{...xC,...n.tags},nodes:{...YO,...n.nodes},functions:{...wC,...n.functions}}}function QC(n,e){return typeof n=="string"&&(n=yz.tokenize(n)),yj(n,e)}function LC(n,e){return Array.isArray(n)?n.flatMap(t=>t.resolve(e)):n.resolve(e)}function MC(n,e){const t=$C(e),r=LC(n,t);return Array.isArray(r)?r.flatMap(i=>i.transform(t)):r.transform(t)}function qC(n,e){const t=$C(e);return bz(n,t)}function wz(n,e={},...t){return{name:n,attributes:e,children:t}}var B=class{constructor(n){this.parse=QC,this.resolve=e=>LC(e,this.config),this.transform=e=>MC(e,this.config),this.validate=e=>qC(e,this.config),this.config=n}};B.nodes=YO;B.tags=xC;B.functions=wC;B.globalAttributes=WO;B.renderers=ez;B.transforms=_C;B.Ast=Qr;B.Tag=Ei;B.Tokenizer=TC;B.parseTags=bC;B.transformer=Jl;B.validator=PC;B.parse=QC;B.transform=MC;B.validate=qC;B.createElement=wz;B.truthy=pu;B.format=wd;function _z(n){if(!n)return"";const t=B.parse(n);if(!t.children?.length)return xd(n);const r=t.children[0];return r?.children?.length?Oa(r.children):xd(n)}function Oa(n){return n.map(kz).join("")}function kz(n){switch(n.type){case"text":return xd(n.attributes.content??"");case"strong":return`<strong>${Oa(n.children)}</strong>`;case"em":return`<em>${Oa(n.children)}</em>`;case"s":return`<s>${Oa(n.children)}</s>`;case"code":return`<code>${xd(n.attributes.content??"")}</code>`;case"link":{const e=n.attributes.href??"",t=n.attributes.title,r=t?` title="${P0(t)}"`:"";return`<a href="${P0(e)}"${r}>${Oa(n.children)}</a>`}case"hardbreak":return" ";case"softbreak":return" ";default:return n.children?.length?Oa(n.children):""}}function xz(n){return wo(n.childNodes)}function wo(n){const e=[];for(const t of n)e.push(Cz(t));return e.join("")}const Sz=3,Az=1;function Cz(n){if(n.nodeType===Sz)return Tz(n.textContent??"");if(n.nodeType!==Az)return"";const e=n;switch(e.tagName){case"STRONG":case"B":return`**${wo(e.childNodes)}**`;case"EM":case"I":return`*${wo(e.childNodes)}*`;case"S":case"STRIKE":case"DEL":return`~~${wo(e.childNodes)}~~`;case"CODE":return`\`${e.textContent??""}\``;case"A":{const r=e.getAttribute("href")??"";return`[${wo(e.childNodes)}](${r})`}case"BR":return" ";case"DIV":case"P":case"SPAN":return wo(e.childNodes);default:return wo(e.childNodes)}}function Si(n){return n.replace(/\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/!\[([^\]]*)\]\([^)]*\)/g,"$1").replace(/\*\*(.+?)\*\*/g,"$1").replace(/__(.+?)__/g,"$1").replace(/\*(.+?)\*/g,"$1").replace(/_(.+?)_/g,"$1").replace(/~~(.+?)~~/g,"$1").replace(/`([^`]+)`/g,"$1")}function xd(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function P0(n){return n.replace(/&/g,"&").replace(/"/g,""").replace(/</g,"<").replace(/>/g,">")}function Tz(n){return n.replace(/([\\*_`~\[\]])/g,"\\$1")}function E0(n){for(const e of Array.from(n.querySelectorAll("b"))){const t=document.createElement("strong");t.innerHTML=e.innerHTML,e.replaceWith(t)}for(const e of Array.from(n.querySelectorAll("i"))){const t=document.createElement("em");t.innerHTML=e.innerHTML,e.replaceWith(t)}for(const e of Array.from(n.querySelectorAll("span[style]"))){const t=e.style,r=e.parentNode;if(r)if(t.fontWeight==="bold"||parseInt(t.fontWeight)>=700){const i=document.createElement("strong");i.innerHTML=e.innerHTML,e.replaceWith(i)}else if(t.fontStyle==="italic"){const i=document.createElement("em");i.innerHTML=e.innerHTML,e.replaceWith(i)}else{for(;e.firstChild;)r.insertBefore(e.firstChild,e);e.remove()}}for(const e of Array.from(n.querySelectorAll("div, p"))){const t=e.parentNode;if(!(!t||e===n)){for(e.previousSibling&&t.insertBefore(document.createTextNode(" "),e);e.firstChild;)t.insertBefore(e.firstChild,e);e.remove()}}}function Pz(n){const e=n.trim(),t=e.match(/^(#{1,6}\s+)(.*)/);if(t)return{text:t[2],prefix:t[1]};const r=e.match(/^(>\s*)(.*)/);return r?{text:r[2],prefix:r[1]}:{text:e,prefix:""}}function Ji(n){return n.replace(/\s+/g," ").trim().toLowerCase()}function RC(n,e,t){const r=BO(n),i=Ji(t);for(const s of r){const{text:o,prefix:a}=Pz(s.source),l=Si(o);if(Ji(l)===i)return{dataName:e,text:l,source:s.source,sourcePrefix:a,inlineSource:o};if(s.type==="paragraph"){const c=s.source.split(`
|
|
278
|
-
`).map(f=>f.trim()).join(" "),u=Si(c);if(Ji(u)===i)return{dataName:e,text:u,source:s.source,sourcePrefix:"",inlineSource:c}}}for(const s of r){if(s.type!=="list")continue;const o=$z(s.source,e,i);if(o)return o}for(const s of r)if(s.children){const o=RC(s.innerContent??"",e,t);if(o)return o}return null}function Ez(n){const e=n.split(`
|
|
279
|
-
`),t=[];let r=[];for(const i of e)/^[-*+]\s|^\d+\.\s/.test(i)&&r.length>0?(t.push(r.join(`
|
|
280
|
-
`)),r=[i]):r.push(i);return r.length>0&&t.push(r.join(`
|
|
281
|
-
`)),t}function $z(n,e,t){const r=Ez(n);for(const i of r){const s=i.split(`
|
|
282
|
-
`),o=s[0],a=o.match(/^([-*+]\s+|(\d+)\.\s+)(.*)/);if(a){const[,c,,u]=a,f=Si(u);if(Ji(f)===t)return{dataName:e,text:f,source:o,sourcePrefix:c,inlineSource:u}}const l=o.match(/^([-*+]\s+.*?)\*\*(.+?)\*\*(.*)/);if(l){const[,c,u]=l;if(Ji(u)===t)return{dataName:e,text:u,source:o,sourcePrefix:c,inlineSource:`**${u}**${l[3]}`}}if(s.length>1){const c=s.slice(1).map(d=>d.replace(/^\s+/,"")).filter(Boolean),u=c.join(" "),f=Si(u);if(c.length>0&&Ji(f)===t){const d=s.slice(1).join(`
|
|
283
|
-
`),h=s.slice(1).find(b=>b.trim().length>0),m=h?.match(/^(\s+)/),p=m?m[1]:"",v=h?d.indexOf(h):0,O=d.slice(0,v)+p;return{dataName:e,text:f,source:d,sourcePrefix:O,inlineSource:u}}}}return null}function Qz(n,e,t){const r=e.sourcePrefix+t,i=n.indexOf(e.source);return i===-1?n:n.slice(0,i)+r+n.slice(i+e.source.length)}function Lz(n,e,t){const r=Ji(e),i=n.split(`
|
|
284
|
-
`);for(const s of i){const o=s.match(/^(\s*[-*+]\s+)\[([^\]]*)\]\(([^)]*)\)\s*$/);if(!o)continue;const[,a,l,c]=o;if(Ji(l)===r||c===t)return{source:s,listPrefix:a,text:l,href:c}}return null}function Mz(n,e,t,r){const i=`${e.listPrefix}[${t}](${r})`,s=n.indexOf(e.source);return s===-1?n:n.slice(0,s)+i+n.slice(s+e.source.length)}function qz(n,e){const t=Ji(e),r=/^((`{3,})(\w*)[^\n]*\n)([\s\S]*?)\n\2\s*$/gm;let i;for(;(i=r.exec(n))!==null;){const[s,o,a,l,c]=i;if(Ji(c)===t)return{source:s,code:c,language:l||"",opener:o.trimEnd(),delimiter:a}}return null}function Rz(n,e,t){const r=e.opener+`
|
|
285
|
-
`+t+`
|
|
286
|
-
`+e.delimiter,i=n.indexOf(e.source);return i===-1?n:n.slice(0,i)+r+n.slice(i+e.source.length)}function Dz(n,e,t){const i=e.opener.slice(e.delimiter.length).replace(/^\w*/,"").trim(),o=e.delimiter+t+(i?" "+i:"")+`
|
|
287
|
-
`+e.code+`
|
|
288
|
-
`+e.delimiter,a=n.indexOf(e.source);return a===-1?n:n.slice(0,a)+o+n.slice(a+e.source.length)}function Iz(n,e){const t=n.split(`
|
|
289
|
-
`);for(const r of t){const i=r.trim().match(/^!\[([^\]]*)\]\(([^)]*)\)\s*$/);if(!i)continue;const[,s,o]=i;if(o===e)return{source:r.trim(),alt:s,src:o}}return null}function Nz(n,e,t,r){const i=``,s=n.indexOf(e.source);return s===-1?n:n.slice(0,s)+i+n.slice(s+e.source.length)}function Bz(n,e){const t=/\{%\s*icon\s+[^%]*name=["']([^"']+)["'][^%]*\/%\}/g;let r;for(;(r=t.exec(n))!==null;){const[i,s]=r;if(s===e)return{source:i,name:s}}return null}function jz(n,e,t){const r=e.source.replace(/name=["'][^"']+["']/,`name="${t}"`),i=n.indexOf(e.source);return i===-1?n:n.slice(0,i)+r+n.slice(i+e.source.length)}function zz(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Ap,$0;function Zz(){if($0)return Ap;$0=1;function n(i){if(typeof i!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(i))}function e(i,s){for(var o="",a=0,l=-1,c=0,u,f=0;f<=i.length;++f){if(f<i.length)u=i.charCodeAt(f);else{if(u===47)break;u=47}if(u===47){if(!(l===f-1||c===1))if(l!==f-1&&c===2){if(o.length<2||a!==2||o.charCodeAt(o.length-1)!==46||o.charCodeAt(o.length-2)!==46){if(o.length>2){var d=o.lastIndexOf("/");if(d!==o.length-1){d===-1?(o="",a=0):(o=o.slice(0,d),a=o.length-1-o.lastIndexOf("/")),l=f,c=0;continue}}else if(o.length===2||o.length===1){o="",a=0,l=f,c=0;continue}}s&&(o.length>0?o+="/..":o="..",a=2)}else o.length>0?o+="/"+i.slice(l+1,f):o=i.slice(l+1,f),a=f-l-1;l=f,c=0}else u===46&&c!==-1?++c:c=-1}return o}function t(i,s){var o=s.dir||s.root,a=s.base||(s.name||"")+(s.ext||"");return o?o===s.root?o+a:o+i+a:a}var r={resolve:function(){for(var s="",o=!1,a,l=arguments.length-1;l>=-1&&!o;l--){var c;l>=0?c=arguments[l]:(a===void 0&&(a=process.cwd()),c=a),n(c),c.length!==0&&(s=c+"/"+s,o=c.charCodeAt(0)===47)}return s=e(s,!o),o?s.length>0?"/"+s:"/":s.length>0?s:"."},normalize:function(s){if(n(s),s.length===0)return".";var o=s.charCodeAt(0)===47,a=s.charCodeAt(s.length-1)===47;return s=e(s,!o),s.length===0&&!o&&(s="."),s.length>0&&a&&(s+="/"),o?"/"+s:s},isAbsolute:function(s){return n(s),s.length>0&&s.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var s,o=0;o<arguments.length;++o){var a=arguments[o];n(a),a.length>0&&(s===void 0?s=a:s+="/"+a)}return s===void 0?".":r.normalize(s)},relative:function(s,o){if(n(s),n(o),s===o||(s=r.resolve(s),o=r.resolve(o),s===o))return"";for(var a=1;a<s.length&&s.charCodeAt(a)===47;++a);for(var l=s.length,c=l-a,u=1;u<o.length&&o.charCodeAt(u)===47;++u);for(var f=o.length,d=f-u,h=c<d?c:d,m=-1,p=0;p<=h;++p){if(p===h){if(d>h){if(o.charCodeAt(u+p)===47)return o.slice(u+p+1);if(p===0)return o.slice(u+p)}else c>h&&(s.charCodeAt(a+p)===47?m=p:p===0&&(m=0));break}var v=s.charCodeAt(a+p),O=o.charCodeAt(u+p);if(v!==O)break;v===47&&(m=p)}var b="";for(p=a+m+1;p<=l;++p)(p===l||s.charCodeAt(p)===47)&&(b.length===0?b+="..":b+="/..");return b.length>0?b+o.slice(u+m):(u+=m,o.charCodeAt(u)===47&&++u,o.slice(u))},_makeLong:function(s){return s},dirname:function(s){if(n(s),s.length===0)return".";for(var o=s.charCodeAt(0),a=o===47,l=-1,c=!0,u=s.length-1;u>=1;--u)if(o=s.charCodeAt(u),o===47){if(!c){l=u;break}}else c=!1;return l===-1?a?"/":".":a&&l===1?"//":s.slice(0,l)},basename:function(s,o){if(o!==void 0&&typeof o!="string")throw new TypeError('"ext" argument must be a string');n(s);var a=0,l=-1,c=!0,u;if(o!==void 0&&o.length>0&&o.length<=s.length){if(o.length===s.length&&o===s)return"";var f=o.length-1,d=-1;for(u=s.length-1;u>=0;--u){var h=s.charCodeAt(u);if(h===47){if(!c){a=u+1;break}}else d===-1&&(c=!1,d=u+1),f>=0&&(h===o.charCodeAt(f)?--f===-1&&(l=u):(f=-1,l=d))}return a===l?l=d:l===-1&&(l=s.length),s.slice(a,l)}else{for(u=s.length-1;u>=0;--u)if(s.charCodeAt(u)===47){if(!c){a=u+1;break}}else l===-1&&(c=!1,l=u+1);return l===-1?"":s.slice(a,l)}},extname:function(s){n(s);for(var o=-1,a=0,l=-1,c=!0,u=0,f=s.length-1;f>=0;--f){var d=s.charCodeAt(f);if(d===47){if(!c){a=f+1;break}continue}l===-1&&(c=!1,l=f+1),d===46?o===-1?o=f:u!==1&&(u=1):o!==-1&&(u=-1)}return o===-1||l===-1||u===0||u===1&&o===l-1&&o===a+1?"":s.slice(o,l)},format:function(s){if(s===null||typeof s!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof s);return t("/",s)},parse:function(s){n(s);var o={root:"",dir:"",base:"",ext:"",name:""};if(s.length===0)return o;var a=s.charCodeAt(0),l=a===47,c;l?(o.root="/",c=1):c=0;for(var u=-1,f=0,d=-1,h=!0,m=s.length-1,p=0;m>=c;--m){if(a=s.charCodeAt(m),a===47){if(!h){f=m+1;break}continue}d===-1&&(h=!1,d=m+1),a===46?u===-1?u=m:p!==1&&(p=1):u!==-1&&(p=-1)}return u===-1||d===-1||p===0||p===1&&u===d-1&&u===f+1?d!==-1&&(f===0&&l?o.base=o.name=s.slice(1,d):o.base=o.name=s.slice(f,d)):(f===0&&l?(o.name=s.slice(1,u),o.base=s.slice(1,d)):(o.name=s.slice(f,u),o.base=s.slice(f,d)),o.ext=s.slice(u,d)),f>0?o.dir=s.slice(0,f-1):l&&(o.dir="/"),o},sep:"/",delimiter:":",win32:null,posix:null};return r.posix=r,Ap=r,Ap}var Fz=Zz();const Xz=zz(Fz);var Cp={},Tp={},Q0;function KO(){return Q0||(Q0=1,(function(n){const e=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",t=e+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",r="["+e+"]["+t+"]*",i=new RegExp("^"+r+"$"),s=function(a,l){const c=[];let u=l.exec(a);for(;u;){const f=[];f.startIndex=l.lastIndex-u[0].length;const d=u.length;for(let h=0;h<d;h++)f.push(u[h]);c.push(f),u=l.exec(a)}return c},o=function(a){const l=i.exec(a);return!(l===null||typeof l>"u")};n.isExist=function(a){return typeof a<"u"},n.isEmptyObject=function(a){return Object.keys(a).length===0},n.merge=function(a,l,c){if(l){const u=Object.keys(l),f=u.length;for(let d=0;d<f;d++)c==="strict"?a[u[d]]=[l[u[d]]]:a[u[d]]=l[u[d]]}},n.getValue=function(a){return n.isExist(a)?a:""},n.isName=o,n.getAllMatches=s,n.nameRegexp=r})(Tp)),Tp}var L0;function DC(){if(L0)return Cp;L0=1;const n=KO(),e={allowBooleanAttributes:!1,unpairedTags:[]};Cp.validate=function(O,b){b=Object.assign({},e,b);const w=[];let S=!1,_=!1;O[0]==="\uFEFF"&&(O=O.substr(1));for(let x=0;x<O.length;x++)if(O[x]==="<"&&O[x+1]==="?"){if(x+=2,x=r(O,x),x.err)return x}else if(O[x]==="<"){let A=x;if(x++,O[x]==="!"){x=i(O,x);continue}else{let C=!1;O[x]==="/"&&(C=!0,x++);let y="";for(;x<O.length&&O[x]!==">"&&O[x]!==" "&&O[x]!==" "&&O[x]!==`
|
|
290
|
-
`&&O[x]!=="\r";x++)y+=O[x];if(y=y.trim(),y[y.length-1]==="/"&&(y=y.substring(0,y.length-1),x--),!m(y)){let T;return y.trim().length===0?T="Invalid space after '<'.":T="Tag '"+y+"' is an invalid name.",d("InvalidTag",T,p(O,x))}const k=a(O,x);if(k===!1)return d("InvalidAttr","Attributes for '"+y+"' have open quote.",p(O,x));let P=k.value;if(x=k.index,P[P.length-1]==="/"){const T=x-P.length;P=P.substring(0,P.length-1);const E=c(P,b);if(E===!0)S=!0;else return d(E.err.code,E.err.msg,p(O,T+E.err.line))}else if(C)if(k.tagClosed){if(P.trim().length>0)return d("InvalidTag","Closing tag '"+y+"' can't have attributes or invalid starting.",p(O,A));if(w.length===0)return d("InvalidTag","Closing tag '"+y+"' has not been opened.",p(O,A));{const T=w.pop();if(y!==T.tagName){let E=p(O,T.tagStartPos);return d("InvalidTag","Expected closing tag '"+T.tagName+"' (opened in line "+E.line+", col "+E.col+") instead of closing tag '"+y+"'.",p(O,A))}w.length==0&&(_=!0)}}else return d("InvalidTag","Closing tag '"+y+"' doesn't have proper closing.",p(O,x));else{const T=c(P,b);if(T!==!0)return d(T.err.code,T.err.msg,p(O,x-P.length+T.err.line));if(_===!0)return d("InvalidXml","Multiple possible root nodes found.",p(O,x));b.unpairedTags.indexOf(y)!==-1||w.push({tagName:y,tagStartPos:A}),S=!0}for(x++;x<O.length;x++)if(O[x]==="<")if(O[x+1]==="!"){x++,x=i(O,x);continue}else if(O[x+1]==="?"){if(x=r(O,++x),x.err)return x}else break;else if(O[x]==="&"){const T=f(O,x);if(T==-1)return d("InvalidChar","char '&' is not expected.",p(O,x));x=T}else if(_===!0&&!t(O[x]))return d("InvalidXml","Extra text at the end",p(O,x));O[x]==="<"&&x--}}else{if(t(O[x]))continue;return d("InvalidChar","char '"+O[x]+"' is not expected.",p(O,x))}if(S){if(w.length==1)return d("InvalidTag","Unclosed tag '"+w[0].tagName+"'.",p(O,w[0].tagStartPos));if(w.length>0)return d("InvalidXml","Invalid '"+JSON.stringify(w.map(x=>x.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return d("InvalidXml","Start tag expected.",1);return!0};function t(O){return O===" "||O===" "||O===`
|
|
291
|
-
`||O==="\r"}function r(O,b){const w=b;for(;b<O.length;b++)if(O[b]=="?"||O[b]==" "){const S=O.substr(w,b-w);if(b>5&&S==="xml")return d("InvalidXml","XML declaration allowed only at the start of the document.",p(O,b));if(O[b]=="?"&&O[b+1]==">"){b++;break}else continue}return b}function i(O,b){if(O.length>b+5&&O[b+1]==="-"&&O[b+2]==="-"){for(b+=3;b<O.length;b++)if(O[b]==="-"&&O[b+1]==="-"&&O[b+2]===">"){b+=2;break}}else if(O.length>b+8&&O[b+1]==="D"&&O[b+2]==="O"&&O[b+3]==="C"&&O[b+4]==="T"&&O[b+5]==="Y"&&O[b+6]==="P"&&O[b+7]==="E"){let w=1;for(b+=8;b<O.length;b++)if(O[b]==="<")w++;else if(O[b]===">"&&(w--,w===0))break}else if(O.length>b+9&&O[b+1]==="["&&O[b+2]==="C"&&O[b+3]==="D"&&O[b+4]==="A"&&O[b+5]==="T"&&O[b+6]==="A"&&O[b+7]==="["){for(b+=8;b<O.length;b++)if(O[b]==="]"&&O[b+1]==="]"&&O[b+2]===">"){b+=2;break}}return b}const s='"',o="'";function a(O,b){let w="",S="",_=!1;for(;b<O.length;b++){if(O[b]===s||O[b]===o)S===""?S=O[b]:S!==O[b]||(S="");else if(O[b]===">"&&S===""){_=!0;break}w+=O[b]}return S!==""?!1:{value:w,index:b,tagClosed:_}}const l=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function c(O,b){const w=n.getAllMatches(O,l),S={};for(let _=0;_<w.length;_++){if(w[_][1].length===0)return d("InvalidAttr","Attribute '"+w[_][2]+"' has no space in starting.",v(w[_]));if(w[_][3]!==void 0&&w[_][4]===void 0)return d("InvalidAttr","Attribute '"+w[_][2]+"' is without value.",v(w[_]));if(w[_][3]===void 0&&!b.allowBooleanAttributes)return d("InvalidAttr","boolean attribute '"+w[_][2]+"' is not allowed.",v(w[_]));const x=w[_][2];if(!h(x))return d("InvalidAttr","Attribute '"+x+"' is an invalid name.",v(w[_]));if(!S.hasOwnProperty(x))S[x]=1;else return d("InvalidAttr","Attribute '"+x+"' is repeated.",v(w[_]))}return!0}function u(O,b){let w=/\d/;for(O[b]==="x"&&(b++,w=/[\da-fA-F]/);b<O.length;b++){if(O[b]===";")return b;if(!O[b].match(w))break}return-1}function f(O,b){if(b++,O[b]===";")return-1;if(O[b]==="#")return b++,u(O,b);let w=0;for(;b<O.length;b++,w++)if(!(O[b].match(/\w/)&&w<20)){if(O[b]===";")break;return-1}return b}function d(O,b,w){return{err:{code:O,msg:b,line:w.line||w,col:w.col}}}function h(O){return n.isName(O)}function m(O){return n.isName(O)}function p(O,b){const w=O.substring(0,b).split(/\r?\n/);return{line:w.length,col:w[w.length-1].length+1}}function v(O){return O.startIndex+O[1].length}return Cp}var Gu={},M0;function Vz(){if(M0)return Gu;M0=1;const n={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,r){return r},attributeValueProcessor:function(t,r){return r},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,r,i){return t}},e=function(t){return Object.assign({},n,t)};return Gu.buildOptions=e,Gu.defaultOptions=n,Gu}var Pp,q0;function Wz(){if(q0)return Pp;q0=1;class n{constructor(t){this.tagname=t,this.child=[],this[":@"]={}}add(t,r){t==="__proto__"&&(t="#__proto__"),this.child.push({[t]:r})}addChild(t){t.tagname==="__proto__"&&(t.tagname="#__proto__"),t[":@"]&&Object.keys(t[":@"]).length>0?this.child.push({[t.tagname]:t.child,":@":t[":@"]}):this.child.push({[t.tagname]:t.child})}}return Pp=n,Pp}var Ep,R0;function Yz(){if(R0)return Ep;R0=1;const n=KO();function e(c,u){const f={};if(c[u+3]==="O"&&c[u+4]==="C"&&c[u+5]==="T"&&c[u+6]==="Y"&&c[u+7]==="P"&&c[u+8]==="E"){u=u+9;let d=1,h=!1,m=!1,p="";for(;u<c.length;u++)if(c[u]==="<"&&!m){if(h&&i(c,u)){u+=7;let v,O;[v,O,u]=t(c,u+1),O.indexOf("&")===-1&&(f[l(v)]={regx:RegExp(`&${v};`,"g"),val:O})}else if(h&&s(c,u))u+=8;else if(h&&o(c,u))u+=8;else if(h&&a(c,u))u+=9;else if(r)m=!0;else throw new Error("Invalid DOCTYPE");d++,p=""}else if(c[u]===">"){if(m?c[u-1]==="-"&&c[u-2]==="-"&&(m=!1,d--):d--,d===0)break}else c[u]==="["?h=!0:p+=c[u];if(d!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:f,i:u}}function t(c,u){let f="";for(;u<c.length&&c[u]!=="'"&&c[u]!=='"';u++)f+=c[u];if(f=f.trim(),f.indexOf(" ")!==-1)throw new Error("External entites are not supported");const d=c[u++];let h="";for(;u<c.length&&c[u]!==d;u++)h+=c[u];return[f,h,u]}function r(c,u){return c[u+1]==="!"&&c[u+2]==="-"&&c[u+3]==="-"}function i(c,u){return c[u+1]==="!"&&c[u+2]==="E"&&c[u+3]==="N"&&c[u+4]==="T"&&c[u+5]==="I"&&c[u+6]==="T"&&c[u+7]==="Y"}function s(c,u){return c[u+1]==="!"&&c[u+2]==="E"&&c[u+3]==="L"&&c[u+4]==="E"&&c[u+5]==="M"&&c[u+6]==="E"&&c[u+7]==="N"&&c[u+8]==="T"}function o(c,u){return c[u+1]==="!"&&c[u+2]==="A"&&c[u+3]==="T"&&c[u+4]==="T"&&c[u+5]==="L"&&c[u+6]==="I"&&c[u+7]==="S"&&c[u+8]==="T"}function a(c,u){return c[u+1]==="!"&&c[u+2]==="N"&&c[u+3]==="O"&&c[u+4]==="T"&&c[u+5]==="A"&&c[u+6]==="T"&&c[u+7]==="I"&&c[u+8]==="O"&&c[u+9]==="N"}function l(c){if(n.isName(c))return c;throw new Error(`Invalid entity name ${c}`)}return Ep=e,Ep}var $p,D0;function Uz(){if(D0)return $p;D0=1;const n=/^[-+]?0x[a-fA-F0-9]+$/,e=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,t={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function r(o,a={}){if(a=Object.assign({},t,a),!o||typeof o!="string")return o;let l=o.trim();if(a.skipLike!==void 0&&a.skipLike.test(l))return o;if(o==="0")return 0;if(a.hex&&n.test(l))return s(l,16);if(l.search(/[eE]/)!==-1){const c=l.match(/^([-\+])?(0*)([0-9]*(\.[0-9]*)?[eE][-\+]?[0-9]+)$/);if(c){if(a.leadingZeros)l=(c[1]||"")+c[3];else if(!(c[2]==="0"&&c[3][0]==="."))return o;return a.eNotation?Number(l):o}else return o}else{const c=e.exec(l);if(c){const u=c[1],f=c[2];let d=i(c[3]);if(!a.leadingZeros&&f.length>0&&u&&l[2]!==".")return o;if(!a.leadingZeros&&f.length>0&&!u&&l[1]!==".")return o;if(a.leadingZeros&&f===o)return 0;{const h=Number(l),m=""+h;return m.search(/[eE]/)!==-1?a.eNotation?h:o:l.indexOf(".")!==-1?m==="0"&&d===""||m===d||u&&m==="-"+d?h:o:f?d===m||u+d===m?h:o:l===m||l===u+m?h:o}}else return o}}function i(o){return o&&o.indexOf(".")!==-1&&(o=o.replace(/0+$/,""),o==="."?o="0":o[0]==="."?o="0"+o:o[o.length-1]==="."&&(o=o.substr(0,o.length-1))),o}function s(o,a){if(parseInt)return parseInt(o,a);if(Number.parseInt)return Number.parseInt(o,a);if(window&&window.parseInt)return window.parseInt(o,a);throw new Error("parseInt, Number.parseInt, window.parseInt are not supported")}return $p=r,$p}var Qp,I0;function IC(){if(I0)return Qp;I0=1;function n(e){return typeof e=="function"?e:Array.isArray(e)?t=>{for(const r of e)if(typeof r=="string"&&t===r||r instanceof RegExp&&r.test(t))return!0}:()=>!1}return Qp=n,Qp}var Lp,N0;function Gz(){if(N0)return Lp;N0=1;const n=KO(),e=Wz(),t=Yz(),r=Uz(),i=IC();class s{constructor(x){this.options=x,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"¢"},pound:{regex:/&(pound|#163);/g,val:"£"},yen:{regex:/&(yen|#165);/g,val:"¥"},euro:{regex:/&(euro|#8364);/g,val:"€"},copyright:{regex:/&(copy|#169);/g,val:"©"},reg:{regex:/&(reg|#174);/g,val:"®"},inr:{regex:/&(inr|#8377);/g,val:"₹"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(A,C)=>String.fromCharCode(Number.parseInt(C,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(A,C)=>String.fromCharCode(Number.parseInt(C,16))}},this.addExternalEntities=o,this.parseXml=f,this.parseTextData=a,this.resolveNameSpace=l,this.buildAttributesMap=u,this.isItStopNode=p,this.replaceEntitiesValue=h,this.readStopNodeData=w,this.saveTextToParentTag=m,this.addChild=d,this.ignoreAttributesFn=i(this.options.ignoreAttributes)}}function o(_){const x=Object.keys(_);for(let A=0;A<x.length;A++){const C=x[A];this.lastEntities[C]={regex:new RegExp("&"+C+";","g"),val:_[C]}}}function a(_,x,A,C,y,k,P){if(_!==void 0&&(this.options.trimValues&&!C&&(_=_.trim()),_.length>0)){P||(_=this.replaceEntitiesValue(_));const T=this.options.tagValueProcessor(x,_,A,y,k);return T==null?_:typeof T!=typeof _||T!==_?T:this.options.trimValues?S(_,this.options.parseTagValue,this.options.numberParseOptions):_.trim()===_?S(_,this.options.parseTagValue,this.options.numberParseOptions):_}}function l(_){if(this.options.removeNSPrefix){const x=_.split(":"),A=_.charAt(0)==="/"?"/":"";if(x[0]==="xmlns")return"";x.length===2&&(_=A+x[1])}return _}const c=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function u(_,x,A){if(this.options.ignoreAttributes!==!0&&typeof _=="string"){const C=n.getAllMatches(_,c),y=C.length,k={};for(let P=0;P<y;P++){const T=this.resolveNameSpace(C[P][1]);if(this.ignoreAttributesFn(T,x))continue;let E=C[P][4],Q=this.options.attributeNamePrefix+T;if(T.length)if(this.options.transformAttributeName&&(Q=this.options.transformAttributeName(Q)),Q==="__proto__"&&(Q="#__proto__"),E!==void 0){this.options.trimValues&&(E=E.trim()),E=this.replaceEntitiesValue(E);const $=this.options.attributeValueProcessor(T,E,x);$==null?k[Q]=E:typeof $!=typeof E||$!==E?k[Q]=$:k[Q]=S(E,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(k[Q]=!0)}if(!Object.keys(k).length)return;if(this.options.attributesGroupName){const P={};return P[this.options.attributesGroupName]=k,P}return k}}const f=function(_){_=_.replace(/\r\n?/g,`
|
|
292
|
-
`);const x=new e("!xml");let A=x,C="",y="";for(let k=0;k<_.length;k++)if(_[k]==="<")if(_[k+1]==="/"){const T=O(_,">",k,"Closing Tag is not closed.");let E=_.substring(k+2,T).trim();if(this.options.removeNSPrefix){const L=E.indexOf(":");L!==-1&&(E=E.substr(L+1))}this.options.transformTagName&&(E=this.options.transformTagName(E)),A&&(C=this.saveTextToParentTag(C,A,y));const Q=y.substring(y.lastIndexOf(".")+1);if(E&&this.options.unpairedTags.indexOf(E)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: </${E}>`);let $=0;Q&&this.options.unpairedTags.indexOf(Q)!==-1?($=y.lastIndexOf(".",y.lastIndexOf(".")-1),this.tagsNodeStack.pop()):$=y.lastIndexOf("."),y=y.substring(0,$),A=this.tagsNodeStack.pop(),C="",k=T}else if(_[k+1]==="?"){let T=b(_,k,!1,"?>");if(!T)throw new Error("Pi Tag is not closed.");if(C=this.saveTextToParentTag(C,A,y),!(this.options.ignoreDeclaration&&T.tagName==="?xml"||this.options.ignorePiTags)){const E=new e(T.tagName);E.add(this.options.textNodeName,""),T.tagName!==T.tagExp&&T.attrExpPresent&&(E[":@"]=this.buildAttributesMap(T.tagExp,y,T.tagName)),this.addChild(A,E,y)}k=T.closeIndex+1}else if(_.substr(k+1,3)==="!--"){const T=O(_,"-->",k+4,"Comment is not closed.");if(this.options.commentPropName){const E=_.substring(k+4,T-2);C=this.saveTextToParentTag(C,A,y),A.add(this.options.commentPropName,[{[this.options.textNodeName]:E}])}k=T}else if(_.substr(k+1,2)==="!D"){const T=t(_,k);this.docTypeEntities=T.entities,k=T.i}else if(_.substr(k+1,2)==="!["){const T=O(_,"]]>",k,"CDATA is not closed.")-2,E=_.substring(k+9,T);C=this.saveTextToParentTag(C,A,y);let Q=this.parseTextData(E,A.tagname,y,!0,!1,!0,!0);Q==null&&(Q=""),this.options.cdataPropName?A.add(this.options.cdataPropName,[{[this.options.textNodeName]:E}]):A.add(this.options.textNodeName,Q),k=T+2}else{let T=b(_,k,this.options.removeNSPrefix),E=T.tagName;const Q=T.rawTagName;let $=T.tagExp,L=T.attrExpPresent,I=T.closeIndex;this.options.transformTagName&&(E=this.options.transformTagName(E)),A&&C&&A.tagname!=="!xml"&&(C=this.saveTextToParentTag(C,A,y,!1));const Z=A;if(Z&&this.options.unpairedTags.indexOf(Z.tagname)!==-1&&(A=this.tagsNodeStack.pop(),y=y.substring(0,y.lastIndexOf("."))),E!==x.tagname&&(y+=y?"."+E:E),this.isItStopNode(this.options.stopNodes,y,E)){let Y="";if($.length>0&&$.lastIndexOf("/")===$.length-1)E[E.length-1]==="/"?(E=E.substr(0,E.length-1),y=y.substr(0,y.length-1),$=E):$=$.substr(0,$.length-1),k=T.closeIndex;else if(this.options.unpairedTags.indexOf(E)!==-1)k=T.closeIndex;else{const ae=this.readStopNodeData(_,Q,I+1);if(!ae)throw new Error(`Unexpected end of ${Q}`);k=ae.i,Y=ae.tagContent}const ne=new e(E);E!==$&&L&&(ne[":@"]=this.buildAttributesMap($,y,E)),Y&&(Y=this.parseTextData(Y,E,y,!0,L,!0,!0)),y=y.substr(0,y.lastIndexOf(".")),ne.add(this.options.textNodeName,Y),this.addChild(A,ne,y)}else{if($.length>0&&$.lastIndexOf("/")===$.length-1){E[E.length-1]==="/"?(E=E.substr(0,E.length-1),y=y.substr(0,y.length-1),$=E):$=$.substr(0,$.length-1),this.options.transformTagName&&(E=this.options.transformTagName(E));const Y=new e(E);E!==$&&L&&(Y[":@"]=this.buildAttributesMap($,y,E)),this.addChild(A,Y,y),y=y.substr(0,y.lastIndexOf("."))}else{const Y=new e(E);this.tagsNodeStack.push(A),E!==$&&L&&(Y[":@"]=this.buildAttributesMap($,y,E)),this.addChild(A,Y,y),A=Y}C="",k=I}}else C+=_[k];return x.child};function d(_,x,A){const C=this.options.updateTag(x.tagname,A,x[":@"]);C===!1||(typeof C=="string"&&(x.tagname=C),_.addChild(x))}const h=function(_){if(this.options.processEntities){for(let x in this.docTypeEntities){const A=this.docTypeEntities[x];_=_.replace(A.regx,A.val)}for(let x in this.lastEntities){const A=this.lastEntities[x];_=_.replace(A.regex,A.val)}if(this.options.htmlEntities)for(let x in this.htmlEntities){const A=this.htmlEntities[x];_=_.replace(A.regex,A.val)}_=_.replace(this.ampEntity.regex,this.ampEntity.val)}return _};function m(_,x,A,C){return _&&(C===void 0&&(C=Object.keys(x.child).length===0),_=this.parseTextData(_,x.tagname,A,!1,x[":@"]?Object.keys(x[":@"]).length!==0:!1,C),_!==void 0&&_!==""&&x.add(this.options.textNodeName,_),_=""),_}function p(_,x,A){const C="*."+A;for(const y in _){const k=_[y];if(C===k||x===k)return!0}return!1}function v(_,x,A=">"){let C,y="";for(let k=x;k<_.length;k++){let P=_[k];if(C)P===C&&(C="");else if(P==='"'||P==="'")C=P;else if(P===A[0])if(A[1]){if(_[k+1]===A[1])return{data:y,index:k}}else return{data:y,index:k};else P===" "&&(P=" ");y+=P}}function O(_,x,A,C){const y=_.indexOf(x,A);if(y===-1)throw new Error(C);return y+x.length-1}function b(_,x,A,C=">"){const y=v(_,x+1,C);if(!y)return;let k=y.data;const P=y.index,T=k.search(/\s/);let E=k,Q=!0;T!==-1&&(E=k.substring(0,T),k=k.substring(T+1).trimStart());const $=E;if(A){const L=E.indexOf(":");L!==-1&&(E=E.substr(L+1),Q=E!==y.data.substr(L+1))}return{tagName:E,tagExp:k,closeIndex:P,attrExpPresent:Q,rawTagName:$}}function w(_,x,A){const C=A;let y=1;for(;A<_.length;A++)if(_[A]==="<")if(_[A+1]==="/"){const k=O(_,">",A,`${x} is not closed`);if(_.substring(A+2,k).trim()===x&&(y--,y===0))return{tagContent:_.substring(C,A),i:k};A=k}else if(_[A+1]==="?")A=O(_,"?>",A+1,"StopNode is not closed.");else if(_.substr(A+1,3)==="!--")A=O(_,"-->",A+3,"StopNode is not closed.");else if(_.substr(A+1,2)==="![")A=O(_,"]]>",A,"StopNode is not closed.")-2;else{const k=b(_,A,">");k&&((k&&k.tagName)===x&&k.tagExp[k.tagExp.length-1]!=="/"&&y++,A=k.closeIndex)}}function S(_,x,A){if(x&&typeof _=="string"){const C=_.trim();return C==="true"?!0:C==="false"?!1:r(_,A)}else return n.isExist(_)?_:""}return Lp=s,Lp}var Mp={},B0;function Hz(){if(B0)return Mp;B0=1;function n(s,o){return e(s,o)}function e(s,o,a){let l;const c={};for(let u=0;u<s.length;u++){const f=s[u],d=t(f);let h="";if(a===void 0?h=d:h=a+"."+d,d===o.textNodeName)l===void 0?l=f[d]:l+=""+f[d];else{if(d===void 0)continue;if(f[d]){let m=e(f[d],o,h);const p=i(m,o);f[":@"]?r(m,f[":@"],h,o):Object.keys(m).length===1&&m[o.textNodeName]!==void 0&&!o.alwaysCreateTextNode?m=m[o.textNodeName]:Object.keys(m).length===0&&(o.alwaysCreateTextNode?m[o.textNodeName]="":m=""),c[d]!==void 0&&c.hasOwnProperty(d)?(Array.isArray(c[d])||(c[d]=[c[d]]),c[d].push(m)):o.isArray(d,h,p)?c[d]=[m]:c[d]=m}}}return typeof l=="string"?l.length>0&&(c[o.textNodeName]=l):l!==void 0&&(c[o.textNodeName]=l),c}function t(s){const o=Object.keys(s);for(let a=0;a<o.length;a++){const l=o[a];if(l!==":@")return l}}function r(s,o,a,l){if(o){const c=Object.keys(o),u=c.length;for(let f=0;f<u;f++){const d=c[f];l.isArray(d,a+"."+d,!0,!0)?s[d]=[o[d]]:s[d]=o[d]}}}function i(s,o){const{textNodeName:a}=o,l=Object.keys(s).length;return!!(l===0||l===1&&(s[a]||typeof s[a]=="boolean"||s[a]===0))}return Mp.prettify=n,Mp}var qp,j0;function Kz(){if(j0)return qp;j0=1;const{buildOptions:n}=Vz(),e=Gz(),{prettify:t}=Hz(),r=DC();class i{constructor(o){this.externalEntities={},this.options=n(o)}parse(o,a){if(typeof o!="string")if(o.toString)o=o.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(a){a===!0&&(a={});const u=r.validate(o,a);if(u!==!0)throw Error(`${u.err.msg}:${u.err.line}:${u.err.col}`)}const l=new e(this.options);l.addExternalEntities(this.externalEntities);const c=l.parseXml(o);return this.options.preserveOrder||c===void 0?c:t(c,this.options)}addEntity(o,a){if(a.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(o.indexOf("&")!==-1||o.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'");if(a==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[o]=a}}return qp=i,qp}var Rp,z0;function Jz(){if(z0)return Rp;z0=1;const n=`
|
|
293
|
-
`;function e(a,l){let c="";return l.format&&l.indentBy.length>0&&(c=n),t(a,l,"",c)}function t(a,l,c,u){let f="",d=!1;for(let h=0;h<a.length;h++){const m=a[h],p=r(m);if(p===void 0)continue;let v="";if(c.length===0?v=p:v=`${c}.${p}`,p===l.textNodeName){let _=m[p];s(v,l)||(_=l.tagValueProcessor(p,_),_=o(_,l)),d&&(f+=u),f+=_,d=!1;continue}else if(p===l.cdataPropName){d&&(f+=u),f+=`<![CDATA[${m[p][0][l.textNodeName]}]]>`,d=!1;continue}else if(p===l.commentPropName){f+=u+`<!--${m[p][0][l.textNodeName]}-->`,d=!0;continue}else if(p[0]==="?"){const _=i(m[":@"],l),x=p==="?xml"?"":u;let A=m[p][0][l.textNodeName];A=A.length!==0?" "+A:"",f+=x+`<${p}${A}${_}?>`,d=!0;continue}let O=u;O!==""&&(O+=l.indentBy);const b=i(m[":@"],l),w=u+`<${p}${b}`,S=t(m[p],l,v,O);l.unpairedTags.indexOf(p)!==-1?l.suppressUnpairedNode?f+=w+">":f+=w+"/>":(!S||S.length===0)&&l.suppressEmptyNode?f+=w+"/>":S&&S.endsWith(">")?f+=w+`>${S}${u}</${p}>`:(f+=w+">",S&&u!==""&&(S.includes("/>")||S.includes("</"))?f+=u+l.indentBy+S+u:f+=S,f+=`</${p}>`),d=!0}return f}function r(a){const l=Object.keys(a);for(let c=0;c<l.length;c++){const u=l[c];if(a.hasOwnProperty(u)&&u!==":@")return u}}function i(a,l){let c="";if(a&&!l.ignoreAttributes)for(let u in a){if(!a.hasOwnProperty(u))continue;let f=l.attributeValueProcessor(u,a[u]);f=o(f,l),f===!0&&l.suppressBooleanAttributes?c+=` ${u.substr(l.attributeNamePrefix.length)}`:c+=` ${u.substr(l.attributeNamePrefix.length)}="${f}"`}return c}function s(a,l){a=a.substr(0,a.length-l.textNodeName.length-1);let c=a.substr(a.lastIndexOf(".")+1);for(let u in l.stopNodes)if(l.stopNodes[u]===a||l.stopNodes[u]==="*."+c)return!0;return!1}function o(a,l){if(a&&a.length>0&&l.processEntities)for(let c=0;c<l.entities.length;c++){const u=l.entities[c];a=a.replace(u.regex,u.val)}return a}return Rp=e,Rp}var Dp,Z0;function e8(){if(Z0)return Dp;Z0=1;const n=Jz(),e=IC(),t={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(a,l){return l},attributeValueProcessor:function(a,l){return l},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function r(a){this.options=Object.assign({},t,a),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=e(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=o),this.processTextOrObjNode=i,this.options.format?(this.indentate=s,this.tagEndChar=`>
|
|
294
|
-
`,this.newLine=`
|
|
295
|
-
`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}r.prototype.build=function(a){return this.options.preserveOrder?n(a,this.options):(Array.isArray(a)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(a={[this.options.arrayNodeName]:a}),this.j2x(a,0,[]).val)},r.prototype.j2x=function(a,l,c){let u="",f="";const d=c.join(".");for(let h in a)if(Object.prototype.hasOwnProperty.call(a,h))if(typeof a[h]>"u")this.isAttribute(h)&&(f+="");else if(a[h]===null)this.isAttribute(h)?f+="":h[0]==="?"?f+=this.indentate(l)+"<"+h+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+h+"/"+this.tagEndChar;else if(a[h]instanceof Date)f+=this.buildTextValNode(a[h],h,"",l);else if(typeof a[h]!="object"){const m=this.isAttribute(h);if(m&&!this.ignoreAttributesFn(m,d))u+=this.buildAttrPairStr(m,""+a[h]);else if(!m)if(h===this.options.textNodeName){let p=this.options.tagValueProcessor(h,""+a[h]);f+=this.replaceEntitiesValue(p)}else f+=this.buildTextValNode(a[h],h,"",l)}else if(Array.isArray(a[h])){const m=a[h].length;let p="",v="";for(let O=0;O<m;O++){const b=a[h][O];if(!(typeof b>"u"))if(b===null)h[0]==="?"?f+=this.indentate(l)+"<"+h+"?"+this.tagEndChar:f+=this.indentate(l)+"<"+h+"/"+this.tagEndChar;else if(typeof b=="object")if(this.options.oneListGroup){const w=this.j2x(b,l+1,c.concat(h));p+=w.val,this.options.attributesGroupName&&b.hasOwnProperty(this.options.attributesGroupName)&&(v+=w.attrStr)}else p+=this.processTextOrObjNode(b,h,l,c);else if(this.options.oneListGroup){let w=this.options.tagValueProcessor(h,b);w=this.replaceEntitiesValue(w),p+=w}else p+=this.buildTextValNode(b,h,"",l)}this.options.oneListGroup&&(p=this.buildObjectNode(p,h,v,l)),f+=p}else if(this.options.attributesGroupName&&h===this.options.attributesGroupName){const m=Object.keys(a[h]),p=m.length;for(let v=0;v<p;v++)u+=this.buildAttrPairStr(m[v],""+a[h][m[v]])}else f+=this.processTextOrObjNode(a[h],h,l,c);return{attrStr:u,val:f}},r.prototype.buildAttrPairStr=function(a,l){return l=this.options.attributeValueProcessor(a,""+l),l=this.replaceEntitiesValue(l),this.options.suppressBooleanAttributes&&l==="true"?" "+a:" "+a+'="'+l+'"'};function i(a,l,c,u){const f=this.j2x(a,c+1,u.concat(l));return a[this.options.textNodeName]!==void 0&&Object.keys(a).length===1?this.buildTextValNode(a[this.options.textNodeName],l,f.attrStr,c):this.buildObjectNode(f.val,l,f.attrStr,c)}r.prototype.buildObjectNode=function(a,l,c,u){if(a==="")return l[0]==="?"?this.indentate(u)+"<"+l+c+"?"+this.tagEndChar:this.indentate(u)+"<"+l+c+this.closeTag(l)+this.tagEndChar;{let f="</"+l+this.tagEndChar,d="";return l[0]==="?"&&(d="?",f=""),(c||c==="")&&a.indexOf("<")===-1?this.indentate(u)+"<"+l+c+d+">"+a+f:this.options.commentPropName!==!1&&l===this.options.commentPropName&&d.length===0?this.indentate(u)+`<!--${a}-->`+this.newLine:this.indentate(u)+"<"+l+c+d+this.tagEndChar+a+this.indentate(u)+f}},r.prototype.closeTag=function(a){let l="";return this.options.unpairedTags.indexOf(a)!==-1?this.options.suppressUnpairedNode||(l="/"):this.options.suppressEmptyNode?l="/":l=`></${a}`,l},r.prototype.buildTextValNode=function(a,l,c,u){if(this.options.cdataPropName!==!1&&l===this.options.cdataPropName)return this.indentate(u)+`<![CDATA[${a}]]>`+this.newLine;if(this.options.commentPropName!==!1&&l===this.options.commentPropName)return this.indentate(u)+`<!--${a}-->`+this.newLine;if(l[0]==="?")return this.indentate(u)+"<"+l+c+"?"+this.tagEndChar;{let f=this.options.tagValueProcessor(l,a);return f=this.replaceEntitiesValue(f),f===""?this.indentate(u)+"<"+l+c+this.closeTag(l)+this.tagEndChar:this.indentate(u)+"<"+l+c+">"+f+"</"+l+this.tagEndChar}},r.prototype.replaceEntitiesValue=function(a){if(a&&a.length>0&&this.options.processEntities)for(let l=0;l<this.options.entities.length;l++){const c=this.options.entities[l];a=a.replace(c.regex,c.val)}return a};function s(a){return this.options.indentBy.repeat(a)}function o(a){return a.startsWith(this.options.attributeNamePrefix)&&a!==this.options.textNodeName?a.substr(this.attrPrefixLen):!1}return Dp=r,Dp}var Ip,F0;function t8(){if(F0)return Ip;F0=1;const n=DC(),e=Kz(),t=e8();return Ip={XMLParser:e,XMLValidator:n,XMLBuilder:t},Ip}var n8=t8();const r8="RFTO",i8="RFTC";function s8(n){return n.includes("")?n.replaceAll(r8,"{%").replaceAll(i8,"%}"):n}const{Tag:Np}=B;function o8(n,e){const t=n.match(/^<svg\s([^>]*)>/);if(!t)return new Np("span",{class:"rf-icon","data-icon":e});const i={...X0(t[1]),class:"rf-icon","data-icon":e},s=[],o=["path","circle","line","polyline","rect","polygon","ellipse"],a=new RegExp(`<(${o.join("|")})\\s([^>]*?)\\s*/?>`,"g");let l;for(;(l=a.exec(n))!==null;){const c=l[1],u=X0(l[2]);s.push(new Np(c,u))}return new Np("svg",i,s)}function X0(n){const e={},t=/([\w-]+)="([^"]*)"/g;let r;for(;(r=t.exec(n))!==null;)e[r[1]]=r[2];return e}const{Tag:a8}=B;function l8(n){const e=n.indexOf("/");return e===-1?{group:"global",name:n}:{group:n.substring(0,e),name:n.substring(e+1)}}function NC(n,e,t={}){const{group:r,name:i}=l8(n),o=e.variables?.__icons?.[r]?.[i];if(o){const l=o8(o,n);return t.size&&(l.attributes.width=t.size,l.attributes.height=t.size),t.label&&(l.attributes.role="img",l.attributes["aria-label"]=t.label),{tag:l,found:!0}}const a={class:"rf-icon","data-icon":n};return t.size&&(a.style=`width:${t.size};height:${t.size}`),t.label&&(a.role="img",a["aria-label"]=t.label),{tag:new a8("span",a),found:!1}}const{Tag:gs}=B,xg={cover:{w:1600,h:900},square:{w:1e3,h:1e3},portrait:{w:750,h:1e3},wide:{w:2400,h:1e3},banner:{w:1800,h:600},avatar:{w:1e3,h:1e3,round:!0},thumbnail:{w:800,h:600}},V0=Object.keys(xg),BC="cover",dn=n=>Math.round(n);function c8(n,e={}){const t=xg[n]?n:BC,r=xg[t],{w:i,h:s}=r,o=r.round?f8(i,s):u8(i,s),a={class:"rf-placeholder","data-shape":t,viewBox:`0 0 ${i} ${s}`,preserveAspectRatio:"xMidYMid slice",width:"100%",fill:"none"};return e.label?(a.role="img",a["aria-label"]=e.label):a["aria-hidden"]="true",new gs("svg",a,o)}function u8(n,e){const t=dn(Math.min(n,e)*.008),r=dn(Math.min(n,e)*.1),i=`M0 ${dn(e*.72)} Q ${dn(n*.28)} ${dn(e*.55)} ${dn(n*.5)} ${dn(e*.7)} T ${n} ${dn(e*.64)} L ${n} ${e} L 0 ${e} Z`;return[new gs("rect",{x:0,y:0,width:n,height:e,fill:"var(--rf-color-surface)"}),new gs("circle",{cx:dn(n*.76),cy:dn(e*.3),r,fill:"var(--rf-color-border)"}),new gs("path",{d:i,fill:"var(--rf-color-muted)"}),new gs("rect",{x:dn(t/2),y:dn(t/2),width:dn(n-t),height:dn(e-t),fill:"none",stroke:"var(--rf-color-border)","stroke-width":t})]}function f8(n,e){const t=dn(n/2),r=dn(e/2),i=dn(Math.min(n,e)*.02),s=dn(n/2-i),o=dn(n*.16),a=dn(e*.42),l=`M ${dn(n*.24)} ${e} Q ${t} ${dn(e*.6)} ${dn(n*.76)} ${e} Z`;return[new gs("circle",{cx:t,cy:r,r:dn(n/2),fill:"var(--rf-color-surface)"}),new gs("path",{d:l,fill:"var(--rf-color-muted)"}),new gs("circle",{cx:t,cy:a,r:o,fill:"var(--rf-color-muted)"}),new gs("circle",{cx:t,cy:r,r:s,fill:"none",stroke:"var(--rf-color-border)","stroke-width":i})]}const{Tag:tJ}=B,jC=new Map;function zC(n,e){jC.set(n.toLowerCase(),e)}const d8=/^([a-zA-Z][a-zA-Z0-9+.-]*):(.*)$/s;function h8(n,e){const t=d8.exec(n);if(!t)return null;const r=jC.get(t[1].toLowerCase());return r?r(t[2],e):null}zC("icon",(n,e)=>{const{tag:t,found:r}=NC(n,e.config,{label:e.alt});return r||console.warn(`[refrakt] icon: unknown icon name "${n}" — falling back to a neutral glyph.`),t});zC("placeholder",(n,e)=>(n&&!V0.includes(n)&&console.warn(`[refrakt] placeholder: unknown shape "${n}" — falling back to "${BC}". Known shapes: ${V0.join(", ")}.`),c8(n,{label:e.alt})));const{dirname:ZC,join:FC,isAbsolute:p8}=Xz,{Tag:Ai}=B,m8={children:["inline"],attributes:{level:{type:"Number",required:!0,render:!1},property:{type:String,required:!1}},transform(n,e){const t=n.transformAttributes(e),r=n.transformChildren(e);return(!t.id||typeof t.id!="string")&&(t.id=r.filter(i=>typeof i=="string").join(" ").replace(/[?{}%]/g,"").replace(/\s+/g,"-").toLowerCase()),new Ai(`h${n.attributes.level}`,t,r)}},g8={children:["inline"],attributes:{property:{type:String,required:!1}},render:"p"},v8={render:"fence",attributes:{content:{type:String,render:!1},process:{type:Boolean,render:!1,default:!1},language:{type:String,render:!1,default:"shell"},source:{type:String,render:!1},lines:{type:String,render:!1},linenumbers:{type:Boolean,render:!1,default:!1},highlight:{type:String,render:!1},label:{type:String,render:!1}},transform(n,e){const t=n.attributes.language||"shell",r={"data-language":t},i={"data-language":t},s=n.attributes.source;typeof s=="string"&&s.length>0&&(r["data-source"]=s,i["data-source"]=s);const o=n.attributes.lines;if(typeof o=="string"&&o.length>0){r["data-lines"]=o,i["data-lines"]=o;const c=/^(\d+)/.exec(o.trim());if(c){const u=Number(c[1]);if(Number.isFinite(u)&&u>0){const f=typeof r.style=="string"?`${r.style}; `:"";r.style=`${f}--rf-start-line: ${u-1}`}}}n.attributes.linenumbers===!0&&(r["data-linenumbers"]="true",i["data-linenumbers"]="true");const a=n.attributes.highlight;typeof a=="string"&&a.length>0&&(r["data-highlight-lines"]=a,i["data-highlight-lines"]=a);for(const[c,u]of Object.entries(n.attributes))c.startsWith("data-")&&(r[c]=u,i[c]=u);const l=new Ai("pre",r,[new Ai("code",i,[s8(n.attributes.content)])]);return new Ai("div",{class:"rf-codeblock"},[l])}},O8={children:["item"],attributes:{ordered:{type:Boolean,render:!1,required:!0},start:{type:Number},marker:{type:String,render:!1}},transform(n,e){return new Ai(n.attributes.ordered?"ol":"ul",n.transformAttributes(e),n.transformChildren(e))}},b8={render:"li",children:["inline","heading","paragraph","image","table","tag","fence","blockquote","list","hr"],attributes:{property:{type:String,required:!1},typeof:{type:String,required:!1}}},y8={render:"em",children:["strong","s","link","code","text","tag"],attributes:{marker:{type:String,render:!0}}},w8={render:"strong",children:["em","s","link","code","text","tag"],attributes:{marker:{type:String,render:!0}}},_8={attributes:{content:{type:String,required:!0},property:{type:String,required:!1}},transform(n,e){const t=n.transformAttributes(e);return t.property?new Ai("span",{"data-field":t.property},[n.attributes.content]):n.attributes.content}},XC={children:["strong","em","s","code","text","tag"],attributes:{href:{type:String,required:!0},title:{type:String}},render:"a",transform(n,e){const{urls:t,path:r}=e.variables||{},i=r?ZC(r):"/";let s=n.attributes;const o=i!=="/"?FC(i,n.attributes.href):n.attributes.href;if(o in(t||{})){const a=t[o];s={...s,href:a}}return new Ai(this.render,s,n.transformChildren(e))}},k8=B.nodes.hardbreak,x8={render:"img",attributes:{src:{type:String,required:!0},alt:{type:String},title:{type:String},property:{type:String}},transform(n,e){const t=n.transformAttributes(e),r=h8(n.attributes.src,{alt:typeof t.alt=="string"?t.alt:void 0,title:typeof t.title=="string"?t.title:void 0,property:typeof t.property=="string"?t.property:void 0,config:e});if(r)return t.property&&(r.attributes["data-field"]=t.property),r;const i=e.variables?.svg||[];let s=n.attributes.src;!p8(s)&&e.variables?.path&&(s=FC("/",ZC(e.variables.path),s));const o=i.find(a=>a._id===s);if(o){let l=new n8.XMLParser({ignoreAttributes:!1}).parse(o.content);const c=Sg("svg",l.svg);return t.property&&(c.attributes["data-field"]=t.property),c.attributes.xmlns=void 0,c}return new Ai(this.render,t,n.transformChildren(e))}},S8={children:["thead","tbody","tr"],attributes:{},transform(n,e){const t=new Ai("table",n.transformAttributes(e),n.transformChildren(e));return new Ai("div",{class:"rf-table-wrapper"},[t])}},A8={...B.nodes.td,attributes:{...B.nodes.td.attributes??{},"data-value":{type:String}}};function Sg(n,e){if(Array.isArray(e))return e.map(i=>Sg(n,i));let t=[],r={};for(const[i,s]of Object.entries(e))i.startsWith("@_")?r[i.slice(2)]=s:i==="#text"?t.push(s):t.push(Sg(i,s));return new Ai(n,r,t)}const{Tag:nJ}=B,{Ast:Cf}=B;function C8(n){let e,t;return{filtered:n.filter(i=>i.type==="tag"&&i.tag==="tint"?(e=i,!1):i.type==="tag"&&i.tag==="bg"?(t=i,!1):!0),tintNode:e,bgNode:t}}function zc(n,e){if(e==="any")return!0;if(e.includes("|"))return e.split("|").some(t=>zc(n,t));if(e.startsWith("heading:")){const t=parseInt(e.slice(8),10);return n.type==="heading"&&n.attributes?.level===t}if(e==="list:ordered")return n.type==="list"&&n.attributes?.ordered===!0;if(e==="list:unordered")return n.type==="list"&&n.attributes?.ordered!==!0;if(e.startsWith("tag:")){const t=e.slice(4);return n.type==="tag"&&n.tag===t}return e==="image"?n.type==="image"||VC(n)!==null:n.type===e}function VC(n){if(n.type!=="paragraph")return null;const t=(n.children??[]).flatMap(r=>r.type==="inline"?r.children??[]:[r]).filter(r=>!(r.type==="text"&&String(r.attributes?.content??"").trim()==="")&&r.type!=="softbreak");return t.length===1&&t[0].type==="image"?t[0]:null}function Pa(n,e){const t={};let r=0;for(const i of e){if(r>=n.length)continue;const s=n[r];if(zc(s,i.match)){const o=i.match==="image"?a=>VC(a)??a:a=>a;if(i.greedy){const a=[];for(;r<n.length&&zc(n[r],i.match);)a.push(o(n[r])),r++;t[i.name]=a}else t[i.name]=o(s),r++;if(i.itemModel)if(i.emitTag){const a=i.greedy?t[i.name]:[t[i.name]],l=[];for(const c of a){if(!c||c.type!=="list")continue;const u=Ag(c,i.itemModel),f=c.children??[];for(let d=0;d<u.length;d++){const h={},m=i.emitAttributes;if(m)for(const[v,O]of Object.entries(m))if(O.startsWith("$")){const b=O.slice(1).split("|");h[v]=b.map(w=>u[d][w.trim()]).find(w=>w!=null&&w!=="")??""}else h[v]=O;const p=f[d]?.children?.slice(1)??[];l.push(new Cf.Node("tag",h,p,i.emitTag))}}t[i.name]=l}else{const a=t[i.name];a&&typeof a=="object"&&"type"in a&&(t[`${i.name}Data`]=Ag(a,i.itemModel))}}else i.optional||r++}return t}function T8(n,e){const t=[[]];for(const i of n)zc(i,e.delimiter)?t.push([]):t[t.length-1].push(i);if(e.dynamicZones&&e.zoneModel)return{zones:t.map(i=>Zc(i,e.zoneModel))};const r={};if(e.zones){const i=t.length===1?e.zones.findIndex(s=>s.primary):-1;for(let s=0;s<e.zones.length;s++){const o=e.zones[s];let a;i>=0?a=s===i?t[0]:[]:a=s<t.length?t[s]:[],r[o.name]=Pa(a,o.fields)}}return r}function W0(n){const e=[];for(const t of n.walk())t.type==="text"&&t.attributes?.content&&e.push(t.attributes.content);return e.join(" ")}function Y0(n,e){const t={};let r=n;for(const i of e.fields)if(i.pattern==="remainder")t[i.name]=r.trim(),r="";else{const s=r.match(i.pattern);s?(t[i.name]=(s[1]||s[0]).trim(),r=r.slice(s[0].length)):i.optional||(t[i.name]=r.trim())}return t}function P8(n){return n.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")}function E8(n,e,t){const r=n.toLowerCase().trim(),i=[];for(const[s,o]of Object.entries(e)){if(s.toLowerCase()===r)return{canonicalName:s,definition:o};if(o.alias?.some(a=>a.toLowerCase()===r))return{canonicalName:s,definition:o};if(o.i18nAliases){for(const a of i)if(o.i18nAliases[a]?.some(l=>l.toLowerCase()===r))return{canonicalName:s,definition:o}}}}function $8(n,e,t){const r=e.sectionHeading;let i;if(r.includes(":"))i=parseInt(r.split(":")[1],10);else{const u=n.filter(f=>f.type==="heading");if(u.length>=2){const f=u[0].attributes?.level,d=u[1].attributes?.level;f!==void 0&&d!==void 0&&d>f?i=u.filter(m=>m.attributes?.level===d).length>=2?d:f:i=f}else i=u[0]?.attributes?.level}if(i===void 0){if(e.implicitSection&&e.emitTag){const f=e.fields?Pa([],e.fields):{},d=new Cf.Node("tag",{...e.implicitSection.attributes??{}},n,e.emitTag);return{...f,sections:[d]}}return{...e.fields?Pa(n,e.fields):{},sections:[]}}const s=[],o=[];let a=null;for(const u of n)u.type==="heading"&&u.attributes?.level===i?(a&&o.push(a),a={headingNode:u,body:[]}):a?a.body.push(u):s.push(u);if(a&&o.push(a),o.length===0&&e.implicitSection&&e.emitTag){const u=e.fields?Pa([],e.fields):{},f=new Cf.Node("tag",{...e.implicitSection.attributes??{}},n,e.emitTag);return{...u,sections:[f]}}const l=e.fields?Pa(s,e.fields):{};if(e.emitTag){const u=o.map(f=>{const d=W0(f.headingNode),h=e.headingExtract?Y0(d,e.headingExtract):{},m={};if(e.emitAttributes)for(const[p,v]of Object.entries(e.emitAttributes))v==="$heading"?m[p]=d:v.startsWith("$")?m[p]=h[v.slice(1)]??"":m[p]=v;return new Cf.Node("tag",m,f.body,e.emitTag)});return{...l,sections:u}}const c=o.map(u=>{const f=W0(u.headingNode),d=e.headingExtract?Y0(f,e.headingExtract):{},h=e.knownSections?E8(f,e.knownSections):void 0,m=h?.definition.model??e.sectionModel,p=Zc(u.body,m),v=h?h.definition.canonicalSlug??P8(h.canonicalName):void 0;return{$heading:f,$headingNode:u.headingNode,...h?{$canonicalName:h.canonicalName}:{},...v?{$canonicalSlug:v}:{},...Object.fromEntries(Object.entries(d).map(([O,b])=>[`$${O}`,b])),...p}});return{...l,sections:c}}function Q8(n,e,t){if("hasChild"in n)return e.some(r=>zc(r,n.hasChild));if("in"in n){const r=String(t[n.attribute]??"");return n.in.includes(r)}return"exists"in n?t[n.attribute]!=null&&t[n.attribute]!=="":!1}function L8(n){return"when"in n&&Array.isArray(n.when)}function M8(n){if(n.type==="text")return n.attributes?.content??"";const e=[];for(const t of n.walk())t.type==="text"&&t.attributes?.content&&e.push(t.attributes.content);return e.join("")}function q8(n,e){if(n.type===e)return n;if(n.type==="link"&&e!=="link"){for(const t of n.children??[])if(t.type===e)return t}if((n.type==="strong"||n.type==="em")&&e!==n.type){for(const t of n.children??[])if(t.type===e)return t}return null}function Ag(n,e){return(n.children??[]).map(r=>{const i={},s=[];for(const c of r.children??[])c.type==="inline"?s.push(...c.children??[]):s.push(c);const o=new Set,a=new Set;for(const c of e.fields)if(c.match!=="text"){if(c.match==="list"){const u=s.findIndex((f,d)=>!o.has(d)&&f.type==="list");u>=0&&(o.add(u),i[c.name]=c.itemModel?Ag(s[u],c.itemModel):s[u]);continue}if(c.match==="paragraph"&&c.greedy){const u=[];s.forEach((f,d)=>{!o.has(d)&&f.type==="paragraph"&&(o.add(d),u.push(f))}),u.length>0&&(i[c.name]=u);continue}for(let u=0;u<s.length;u++){if(o.has(u)||a.has(u)&&c.match!==s[u].type)continue;const f=s[u],d=q8(f,c.match);if(d){if(d===f?o.add(u):a.add(u),c.extract){const h=f.attributes?.[c.extract]!=null?f:d;i[c.name]=h.attributes?.[c.extract]}else i[c.name]=M8(d);break}}}for(const c of a)o.add(c);const l=e.fields.filter(c=>c.match==="text");if(l.length>0){let u=s.filter((f,d)=>!o.has(d)).filter(f=>f.type==="text"||f.type==="softbreak").map(f=>f.attributes?.content??"").join("").trim();for(const f of l)if(f.pattern==="remainder"){const d=u.trim();(d||!f.optional)&&(i[f.name]=d)}else if(f.pattern instanceof RegExp){const d=u.match(f.pattern);d&&(i[f.name]=d[1]??d[0],u=u.replace(f.pattern,""))}}return i})}function Zc(n,e,t,r){if(L8(e)){for(const i of e.when)if(Q8(i.condition,n,t??{}))return Zc(n,i.model,t);return Zc(n,e.default,t)}switch(e.type){case"sequence":return Pa(n,e.fields);case"sections":return $8(n,e);case"delimited":return T8(n,e);case"custom":return{children:e.processChildren(n,t??{})};default:return{}}}function R8(n,e,t,r){const{filtered:i,tintNode:s,bgNode:o}=C8(n);return{content:Zc(i,e,t),tintNode:s,bgNode:o}}const D8=new Map;function I8(n,e){D8.set(n,e)}const N8=new WeakMap,B8=new Set(["tint","tint-mode","bg","width","reading","dropcap","spacing","inset","elevation","prominence","reveal","stagger","frame","frame-aspect","frame-displace","frame-displace-mode","frame-offset","frame-oversize","frame-place","frame-anchor","frame-overflow","frame-shadow","substrate","substrate-size","substrate-opacity","substrate-fill","substrate-target","bg-gradient","bg-from","bg-to","bg-via","bg-gradient-type","scrim","scrim-type","scrim-strength","scrim-blur","scrim-tone"]);function As(n){return n.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function Kt(n){return typeof n=="object"&&n!==null&&!Array.isArray(n)&&n.$$mdtype==="Tag"}function At(n,e={},t=[]){return{$$mdtype:"Tag",name:n,attributes:e,children:t}}function j8(n,e){const t=As(e);return n.children.find(r=>Kt(r)&&r.name==="meta"&&r.attributes["data-field"]===t)}function vh(n){for(const e of n){if(!Kt(e))continue;if(e.attributes?.["data-section"]==="media")return e;const t=e.children?vh(e.children):void 0;if(t)return t}}function JO(n,e){for(const t of n){if(!Kt(t))continue;if(t.attributes?.["data-name"]===e)return t;const r=t.children?JO(t.children,e):void 0;if(r)return r}}function Ot(n,e,t){return j8(n,e)?.attributes.content??t}function z8(n){const e=n.attributes?.["data-rune-fields"];if(typeof e!="string"||e.length===0)return{};try{const t=JSON.parse(e);return t&&typeof t=="object"&&!Array.isArray(t)?t:{}}catch{return{}}}function Lo(n,e,t){const i=z8(n)[e];if(i!=null&&typeof i!="object")return typeof i=="string"?i:String(i);const s=As(e),o=(n.children??[]).find(a=>!!a&&typeof a=="object"&&a.$$mdtype==="Tag"&&a.name==="meta"&&a.attributes?.["data-field"]===s);return o?o.attributes.content:void 0}const Z8={none:"0",tight:"var(--rf-spacing-sm)",default:"var(--rf-spacing-md)",loose:"var(--rf-spacing-xl)"};function F8(n){return Z8[n]??n}function X8(n){return n.split(/\s+/).map(e=>`${e}fr`).join(" ")}const Bp={none:"0",sm:"var(--rf-spacing-sm)",md:"var(--rf-spacing-md)",lg:"var(--rf-spacing-lg)",xl:"var(--rf-spacing-xl)","2xl":"var(--rf-spacing-section)","3xl":"var(--rf-spacing-section-loose)","4xl":"var(--rf-spacing-section-breathe)"};function V8(n){const e=Bp[n];return e===void 0?(console.warn(`[refrakt] Unknown offset "${n}" — expected one of ${Object.keys(Bp).join(", ")}. Falling back to "none".`),Bp.none):e}const W8={top:"start",center:"center",bottom:"end",stretch:"stretch",baseline:"baseline"};function U0(n){return W8[n]??n}const Y8={left:{x:"start",y:"center"},center:{x:"center",y:"center"},right:{x:"end",y:"center"},top:{x:"center",y:"start"},bottom:{x:"center",y:"end"},"top left":{x:"start",y:"start"},"top center":{x:"center",y:"start"},"top right":{x:"end",y:"start"},"bottom left":{x:"start",y:"end"},"bottom center":{x:"center",y:"end"},"bottom right":{x:"end",y:"end"}};function U8(n){return Y8[n]??{x:"center",y:"center"}}const eb=["block","modifiers","sections","mediaSlots","frameTarget","universalAttributes","provides"];[...eb];function G8(n,e=eb){return e.filter(t=>t in n)}function H8(n){return`may not override the identity field "${n}" — it is rune identity, not theme configuration (ADR-028)`}const G0=new Set;function K8(n){G0.has(n.path)||(G0.add(n.path),console.warn(`[refrakt] ${n.message}`))}function J8(n,e,t={}){if(!n)return e;const r=t.guardIdentity?e6(e,t):e,i={...n,...r};if((n.metaFields||e.metaFields)&&(i.metaFields={...n.metaFields,...e.metaFields}),n.blocks||e.blocks){const s={...n.blocks};if(e.blocks)for(const[o,a]of Object.entries(e.blocks))s[o]=a;i.blocks=s}if((n.layout||e.layout)&&(i.layout={...n.layout,...e.layout}),n.variants||e.variants){const s={...n.variants};if(e.variants)for(const[o,a]of Object.entries(e.variants))s[o]={...s[o],...a};i.variants=s}return i}function e6(n,e){const t=G8(n,eb);if(t.length===0)return n;const r=e.runeName??"<rune>",i=e.onViolation??K8,s={...n};for(const o of t){delete s[o];const a=`runes.${r}.${o}`;i({path:a,rune:r,field:o,message:`${a}: theme overrides ${H8(o)}. The override is ignored; the rune's own declaration stands.`})}return s}const WC=["fine","ui","prose"];function YC(n){return typeof n=="string"&&WC.includes(n)?n:void 0}function UC(n){return YC(n.authorAttr)??n.runeDefault??n.regionDefault??"ui"}const Oh="ui",Cg={fine:{dropcap:!1},ui:{dropcap:!1},prose:{dropcap:!0}},GC="en";function t6(n){return typeof n=="string"&&n.trim()!==""?n.trim():GC}function n6(n,e={}){return{locale:t6(n),strings:e}}function tb(n,e,t){const r=n.strings[e];return typeof r=="string"?r:t}class r6{seen=new Set;emit(e){if(e.dedupeKey!==void 0){const t=`${e.code}\0${e.dedupeKey}`;if(this.seen.has(t))return;this.seen.add(t)}e.severity==="error"?console.error(e.message):console.warn(e.message)}reset(){this.seen.clear()}}function i6(n){const e=new Map;for(const s of n){if(e.has(s.name))throw new Error(`[refrakt] duplicate facet "${s.name}" in the registry`);e.set(s.name,s)}const t=[],r=new Map,i=(s,o)=>{const a=r.get(s.name);if(a!=="done"){if(a==="visiting")throw new Error(`[refrakt] facet dependency cycle: ${[...o,s.name].join(" → ")}`);r.set(s.name,"visiting");for(const l of s.after??[]){const c=e.get(l);if(!c)throw new Error(`[refrakt] facet "${s.name}" declares after: "${l}", which is not a registered facet`);i(c,[...o,s.name])}r.set(s.name,"done"),t.push(s)}};for(const s of n)i(s,[]);return t}function HC(n,e){return{...n,axis:t=>e.axes[t]??e.state[t]}}const s6=()=>({axes:{},state:{},classes:[],dataAttrs:{},styles:[],consumes:[],stripAttrs:[],layers:[],absorbs:[],warnings:[],carry:new Map});function o6(n,e,t){const r=s6(),i=HC(e,r);for(const s of n){if(s.appliesTo&&!s.appliesTo(i))continue;const o=s.resolve(i);if(o&&(o.axes&&Object.assign(r.axes,o.axes),o.state&&Object.assign(r.state,o.state),o.classes&&r.classes.push(...o.classes),o.dataAttrs&&Object.assign(r.dataAttrs,o.dataAttrs),o.styles&&r.styles.push(...o.styles),o.consumes&&r.consumes.push(...o.consumes),o.stripAttrs&&r.stripAttrs.push(...o.stripAttrs),o.layers&&r.layers.push(...o.layers),o.absorbs&&r.absorbs.push(...o.absorbs),o.carry!==void 0&&r.carry.set(s.name,o.carry),o.warnings)){r.warnings.push(...o.warnings);for(const a of o.warnings)t.emit(a)}}return r}function a6(n,e,t,r,i){const s=HC(e,t);for(const o of n){if(!o.postAssemble||o.appliesTo&&!o.appliesTo(s))continue;const a=o.postAssemble(s,r,t.carry.get(o.name));if(a){t.warnings.push(...a);for(const l of a)i.emit(l)}}}const l6=["sunken","flush","flat","raised","floating","overlay"],c6={none:"flat",sm:"raised",md:"raised",lg:"floating"},u6={name:"elevation",attributes:["elevation"],resolve(n){const e=n.tag.attributes?.elevation??n.config.defaultElevation;if(typeof e!="string"||e==="")return null;const t=c6[e];return t?{axes:{elevation:t},warnings:[{code:"elevation-deprecated-alias",message:`[refrakt] elevation="${e}" is deprecated (SPEC-107) — use "${t}". The alias will be removed in a future minor.`}]}:{axes:{elevation:e}}}},f6={axis:"elevation",contract:{description:"The chrome/depth ladder (SPEC-107). The skin maps each rung to a chrome bundle by attribute, so there is no BEM class.",source:"attribute",inputs:["elevation"],values:l6,dataAttributes:["data-elevation"],condition:"emitted only when the author sets it or the rune declares `defaultElevation`"},describeForRune:n=>n.defaultElevation?{default:n.defaultElevation}:null},d6=["quiet","normal","prominent","display"],h6=new Set(["header","preamble","title","description"]);function KC(n){return!!n&&Object.values(n).some(e=>h6.has(e))}const p6={name:"prominence",attributes:["prominence"],appliesTo:n=>!!(n.tag.attributes?.prominence??n.config.defaultProminence),resolve(n){const e=n.tag.attributes?.prominence??n.config.defaultProminence;return KC(n.config.sections)?{axes:{prominence:String(e)}}:{warnings:[{code:"prominence-unsupported",message:`[refrakt] prominence is not supported on "${n.rune}" — it applies only to runes with a page-section header. Ignored.`}]}}},m6={axis:"prominence",contract:{description:"Header emphasis (SPEC-107). Scales a rune's page-section header; the skin maps it to a type register by attribute, so there is no BEM class.",source:"attribute",inputs:["prominence"],values:d6,dataAttributes:["data-prominence"],condition:"requires a page-section header — a `sections` role of header, preamble, title or description. Dropped with a warning otherwise."},describeForRune:n=>KC(n.sections)?n.defaultProminence?{default:n.defaultProminence}:null:"this rune has no page-section header"},g6={name:"content-place",after:["modifiers"],appliesTo:n=>!!(n.axis("content-place")??n.tag.attributes?.["content-place"]),resolve(n){const e=n.axis("content-place");if(!e)return{warnings:[{code:"content-place-undeclared",message:`[refrakt] \`content-place\` on \`${n.rune}\` has nothing to anchor — the rune declares no \`content-place\` modifier, so the value is never read. Ignored.`,dedupeKey:n.rune}]};if(n.axis("media-position")!=="cover")return{warnings:[{code:"content-place-outside-cover",message:`[refrakt] \`content-place\` on \`${n.rune}\` is only active in \`media-position="cover"\` — it anchors the overlay, and there's no overlay outside cover. Ignored.`,dedupeKey:n.rune}]};if(e==="auto")return null;const[t,r]=e.trim().split(/\s+/),i=[];return t&&i.push(["--cover-place-block",t]),r&&i.push(["--cover-place-inline",r]),t==="start"?i.push(["--cover-scrim-dir","to bottom"]):t==="center"&&(i.push(["--cover-scrim-image","radial-gradient(ellipse farthest-side at center, rgb(0 0 0 / 0.55) 40%, transparent 100%)"]),i.push(["--cover-scrim-mask","radial-gradient(ellipse farthest-side at center, #000 50%, transparent 100%)"])),{styles:i}}},v6={axis:"content-place",contract:{description:"The cover overlay anchor (SPEC-089): a 2-axis logical placement (block × inline) that also steers the default scrim so it follows the content edge.",source:"meta",inputs:["content-place"],customProperties:["--cover-place-block","--cover-place-inline","--cover-scrim-dir","--cover-scrim-image","--cover-scrim-mask"],condition:"active only when `media-position` resolves to `cover`; `auto` emits nothing and is left to the CSS container query. `--cover-scrim-dir` here is overridden by an explicit `scrim` edge, which the `cover` axis declares later."},describeForRune:n=>n.modifiers?.["content-place"]?null:"this rune declares no `content-place` modifier"},O6={top:"to top",bottom:"to bottom",left:"to left",right:"to right"},JC=["scrim","scrim-type","scrim-blur","scrim-tone"],H0="scrim-strength",b6={name:"cover",after:["modifiers","content-place","tint"],appliesTo:n=>n.axis("media-position")==="cover",resolve(n){const e={state:{cover:"true"},consumes:[...JC],dataAttrs:{},styles:[]},t=Ot(n.tag,"scrim");t==="none"&&(e.dataAttrs["data-scrim"]="none");const r=Ot(n.tag,"scrim-type");if(r&&t!=="none"&&(e.dataAttrs["data-scrim-type"]=r,r==="frost")){const o=Ot(n.tag,"scrim-blur");o&&(e.dataAttrs["data-scrim-blur"]=o)}const i=O6[t??""];return i&&e.styles.push(["--cover-scrim-dir",i]),Ot(n.tag,H0)!==void 0&&(e.consumes.push(H0),t!=="none"&&(e.warnings=[{code:"scrim-strength-in-cover",message:`[refrakt] \`scrim-strength\` is not honoured in cover mode — on \`${n.rune}\` the scrim is rendered by the media well, which has no strength control. Ignored.`,dedupeKey:n.rune}])),e},postAssemble(n,e){if(Ot(n.tag,"scrim")==="none"||n.config.rootAttributes?.["data-cover-scope"]==="header"||n.axis("color-scheme"))return;const r=JO(e,"content");r&&(r.attributes={...r.attributes,"data-color-scheme":Ot(n.tag,"scrim-tone")??"dark"})}},y6={axis:"cover",contract:{description:'Cover-mode chrome (SPEC-089): with `media-position="cover"` the media fills the surface and the content sits over it, so the scrim is rerouted from the background layer to the media well.',source:"meta",inputs:JC,dataAttributes:["data-scrim","data-scrim-type","data-scrim-blur"],customProperties:["--cover-scrim-dir"],target:'the rune root, except `data-color-scheme`, which is scoped to the `[data-name="content"]` overlay so only text on the darkened media flips',condition:"active only when `media-position` resolves to `cover`"},describeForRune:n=>n.modifiers?.["media-position"]?null:"this rune declares no `media-position` modifier, so it cannot enter cover mode"};function eT(n,e){if(n.attributes={...n.attributes,...e.dataAttrs},e.styles.length){const t=e.styles.map(([i,s])=>`${i}: ${s}`).join("; "),r=n.attributes.style?String(n.attributes.style):"";n.attributes.style=r?`${r}; ${t}`:t}}function bh(n){return n?Object.values(n).includes("media"):!1}const w6=["frame-aspect","frame-displace","frame-displace-mode","frame-offset","frame-oversize","frame-place","frame-anchor","frame-overflow","frame-shadow"];function _6(n,e,t){const r=[],i=u=>{const f=Ot(n,u);return f!=null&&r.push(u),f??void 0},s=i("frame");let o={};if(s&&e[s]){let u=e[s];u.extends&&e[u.extends]&&(u={...e[u.extends],...u}),o={...u},delete o.extends}const a={aspect:i("frame-aspect"),displace:i("frame-displace"),displaceMode:i("frame-displace-mode"),offset:i("frame-offset"),oversize:i("frame-oversize"),place:i("frame-place"),anchor:i("frame-anchor"),overflow:i("frame-overflow"),shadow:i("frame-shadow")};for(const[u,f]of Object.entries(a))f!==void 0&&(o[u]=f);if(r.length===0)return null;o.displace&&!o.displaceMode&&t==="bleed"&&(o.displaceMode="bleed");const l={},c=[];if(s&&(l["data-frame"]=s),o.displace&&(l["data-displace"]=o.displace),o.displaceMode&&(l["data-displace-mode"]=o.displaceMode),o.shadow&&(l["data-frame-shadow"]=o.shadow),o.overflow==="bleed"&&(l["data-frame-overflow"]="bleed"),o.aspect&&c.push(["--frame-aspect",o.aspect]),o.offset&&c.push(["--frame-offset",V8(o.offset)]),o.oversize&&c.push(["--frame-oversize",o.oversize]),o.anchor&&c.push(["--frame-anchor",o.anchor]),o.place){const{x:u,y:f}=U8(o.place);c.push(["--frame-place-x",u],["--frame-place-y",f])}return{dataAttrs:l,styles:c,consumes:r}}const K0=n=>({code:"frame-no-target",message:`[refrakt] \`frame\` on \`${n}\` has no frame target — set \`frameTarget\` or give the rune a media section. Frame chrome ignored.`,dedupeKey:n}),k6={name:"frame",resolve(n){const e=_6(n.tag,n.theme.frames,n.config.guestFit);if(!e)return null;const t=[];let r=n.config.frameTarget??(bh(n.config.sections)?"media":null);return r||t.push(K0(n.rune)),e.dataAttrs["data-frame-overflow"]==="bleed"&&n.config.guestFit!=="bleed"&&(delete e.dataAttrs["data-frame-overflow"],t.push({code:"frame-overflow-on-clip-host",message:`[refrakt] \`frame-overflow="bleed"\` has no effect on \`${n.rune}\` — a clip host crops its media guest. Use it on a bleed host (hero, feature), or drop it.`,dedupeKey:n.rune})),{consumes:e.consumes,...r==="self"?{dataAttrs:e.dataAttrs,styles:e.styles}:{},...t.length?{warnings:t}:{},carry:{chrome:e,target:r}}},postAssemble(n,e,t){const{chrome:r,target:i}=t??{};if(!r||i!=="media")return;const s=vh(e);if(!s)return[K0(n.rune)];eT(s,r)}},x6={axis:"frame",contract:{description:"Surface chrome (SPEC-086): a named preset from the theme registry with inline `frame-*` overrides layered on top.",source:"meta",inputs:["frame",...w6],dataAttributes:["data-frame","data-displace","data-displace-mode","data-frame-shadow","data-frame-overflow"],customProperties:["--frame-aspect","--frame-offset","--frame-oversize","--frame-anchor","--frame-place-x","--frame-place-y"],condition:'lands on the surface named by `frameTarget`, defaulting to the media zone when the rune declares one. With no target the metas are still consumed but the chrome is dropped with a warning. `data-frame-overflow="bleed"` is stripped with a warning on a clip host.'},describeForRune:n=>{const e=n.frameTarget??(bh(n.sections)?"media":null);return e?{target:e==="self"?"the rune root":'[data-section="media"]'}:"this rune declares neither a `frameTarget` nor a media section"}},J0={sm:"12px",md:"16px",lg:"24px"},ew={sm:"0.25",md:"0.5",lg:"0.85"};function S6(n){const e=[],t=u=>{const f=Ot(n,u);return f!=null&&e.push(u),f??void 0},r=t("substrate"),i=t("substrate-size"),s=t("substrate-opacity"),o=t("substrate-fill"),a=t("substrate-target");if(!r)return null;const l={"data-substrate":r};o&&(l["data-substrate-fill"]=o);const c=[];return i&&J0[i]&&c.push(["--substrate-cell",J0[i]]),s&&ew[s]&&c.push(["--substrate-opacity",ew[s]]),{chrome:{dataAttrs:l,styles:c,consumes:e},targetOverride:a}}const tw=n=>({code:"substrate-no-media",message:`[refrakt] \`substrate-target="media"\` on \`${n}\` has no media section — substrate ignored.`,dedupeKey:n}),A6={name:"substrate",resolve(n){const e=S6(n.tag);if(!e)return null;const{chrome:t,targetOverride:r}=e;let i=r==="self"||r==="media"?r:n.config.substrateTarget??"self";const s=[];return i==="media"&&!bh(n.config.sections)&&(s.push(tw(n.rune)),i=null),{consumes:t.consumes,...i==="self"?{dataAttrs:t.dataAttrs,styles:t.styles}:{},...s.length?{warnings:s}:{},carry:{chrome:t,target:i}}},postAssemble(n,e,t){const{chrome:r,target:i}=t??{};if(!r||i!=="media")return;const s=vh(e);if(!s)return[tw(n.rune)];eT(s,r)}},C6={axis:"substrate",contract:{description:"Generated pattern fills (SPEC-087). Markers only — the engine sets the attributes and cell/opacity custom properties, CSS draws the pattern.",source:"meta",inputs:["substrate","substrate-size","substrate-opacity","substrate-fill","substrate-target"],dataAttributes:["data-substrate","data-substrate-fill"],customProperties:["--substrate-cell","--substrate-opacity"],condition:'defaults to the rune root. `substrate-target="media"` moves it to the media zone, and is dropped with a warning on a rune with no media section. The facets are inert without a `substrate` pattern.'},describeForRune:n=>n.substrateTarget!=="media"?null:bh(n.sections)?{target:'[data-section="media"]'}:"this rune targets the media zone but declares no media section"},tT=["bg","surface","text","muted","primary","border"],T6={name:"tint",appliesTo:n=>!!(Ot(n.tag,"tint")||Ot(n.tag,"tint-mode")),resolve(n){const e=Ot(n.tag,"tint"),t=Ot(n.tag,"tint-mode"),r={},i={};let s=t;const o=e&&e!=="custom"?n.theme.tints[e]:void 0;if(o){for(const[f,d]of Object.entries(o.light??{}))d&&(r[f]=d);for(const[f,d]of Object.entries(o.dark??{}))d&&(i[f]=d);!s&&o.lockMode&&(s=o.lockMode)}const a=["tint","tint-mode"];for(const f of tT){const d=Ot(n.tag,`tint-${f}`);d&&(r[f]=d,a.push(`tint-${f}`));const h=Ot(n.tag,`tint-dark-${f}`);h&&(i[f]=h,a.push(`tint-dark-${f}`))}const l=Object.keys(r).length>0,c={};(e||l)&&(c["data-tint"]=e||"custom"),s&&s!=="auto"&&(c["data-color-scheme"]=s),Object.keys(i).length>0&&(c["data-tint-dark"]="");const u=[];for(const[f,d]of Object.entries(r))u.push([`--tint-${f}`,d]);for(const[f,d]of Object.entries(i))u.push([`--tint-dark-${f}`,d]);return{consumes:a,dataAttrs:c,styles:u,...l||o?{classes:[`${n.block}--tinted`]}:{},...c["data-color-scheme"]?{state:{"color-scheme":c["data-color-scheme"]}}:{}}}},P6={axis:"tint",contract:{description:"Per-rune colour override (SPEC-053): a named tint from the theme registry, with inline per-token overrides layered on top.",source:"meta",inputs:["tint","tint-mode","tint-{token}","tint-dark-{token}"],tokens:tT,selectors:[".{block}--tinted"],dataAttributes:["data-tint","data-color-scheme","data-tint-dark"],customProperties:["--tint-{token}","--tint-dark-{token}"],condition:"the `--tinted` class only when colour tokens actually resolve — a bare `tint-mode` locks the colour scheme without tinting anything"},describeForRune:(n,e)=>({selectors:[`.${e}--tinted`]})},E6={"to-t":"to top","to-b":"to bottom","to-l":"to left","to-r":"to right","to-tr":"to top right","to-br":"to bottom right","to-bl":"to bottom left","to-tl":"to top left"},nw={sm:"0.3",md:"0.55",lg:"0.8"},jp={sm:"4px",md:"8px",lg:"16px"},$6=/^[a-z][a-z0-9-]*$/,nT=["bg-preset","bg-src","bg-video","bg-overlay","bg-blur","bg-position","bg-fit","bg-opacity","bg-fixed","bg-gradient","bg-from","bg-via","bg-to","bg-gradient-type","bg-overlay-opacity","scrim","scrim-type","scrim-strength","scrim-blur","scrim-tone"];function Q6(n){if(n==="transparent")return"transparent";const e=n.indexOf("/");if(e>0&&e<n.length-1){const t=n.slice(0,e),r=n.slice(e+1).replace(/%$/,""),i=parseFloat(r);if(Number.isFinite(i)){const s=i>1?i/100:i;if(s>=0&&s<=1)return`color-mix(in srgb, var(--rf-color-${t}) ${s*100}%, transparent)`}}return`var(--rf-color-${n})`}function rw(n){const e=n.stops.filter(i=>!!i).map(Q6);if(e.length<2)return null;const t=n.type??"linear";return t==="radial"?`radial-gradient(${e.join(", ")})`:t==="conic"?`conic-gradient(${e.join(", ")})`:`linear-gradient(${E6[n.direction??"to-b"]??"to bottom"}, ${e.join(", ")})`}function iw(n,e){if(!n||!e[n])return;const t=e[n];if(t.extends&&e[t.extends]){const r=e[t.extends];return{...r,params:{...r.params,...t.params},style:{...r.style,...t.style}}}return t}const L6={name:"bg",after:["cover","tint"],resolve(n){const{tag:e}=n,t=n.theme.backgrounds,r=(e.children??[]).find(E=>Kt(E)&&E.attributes?.["data-bg-guest"]!==void 0)??null,i=Ot(e,"bg-preset"),s=Ot(e,"bg-src"),o=Ot(e,"bg-video"),a=Ot(e,"bg-gradient"),l=Ot(e,"bg-from"),c=Ot(e,"bg-via"),u=Ot(e,"bg-to"),f=Ot(e,"bg-gradient-type"),d=iw(i,t)?.gradient;let h=null;if(a||l||c||u||f){const E=[l,c,u].filter(Q=>!!Q);h=rw({type:f??d?.type,direction:a??d?.direction,stops:E.length>=2?E:d?.stops??E})}else d&&(h=rw(d));const m=Ot(e,"scrim"),p=Ot(e,"bg-overlay"),v=n.axis("cover")==="true",O=m&&m!=="none"&&!v;if(!(i||s||o||h||O||p||r))return null;const b=iw(i,t)?.style??{},w=[];for(const[E,Q]of Object.entries(b))w.push(`${E}: ${Q}`);s?w.push(`--bg-image: url(${s})`):h&&w.push(`--bg-image: ${h}`);const S=Ot(e,"bg-position"),_=Ot(e,"bg-blur"),x=Ot(e,"bg-fit"),A=Ot(e,"bg-opacity");S&&w.push(`--bg-position: ${S}`),_&&w.push(`--bg-blur: ${jp[_]??_}`),x&&w.push(`--bg-fit: ${x}`),A&&w.push(`--bg-opacity: ${A}`);const C={"data-name":"bg"};i&&(C["data-bg-preset"]=i),w.length&&(C.style=w.join("; ")),Ot(e,"bg-fixed")&&(C["data-bg-fixed"]="");const y=[],k=[],P={},T={};if(o&&y.push(At("video",{"data-name":"bg-video",autoplay:"",muted:"",loop:"",playsinline:"",src:o,...w.length?{style:w.filter(E=>!E.startsWith("--bg-image")).join("; ")}:{}})),r&&y.push(r),p){const E=Ot(e,"bg-overlay-opacity"),Q={"data-name":"bg-overlay"};if(p==="dark"||p==="light")Q["data-bg-overlay"]=p,E&&(Q.style=`opacity: ${E}`);else if($6.test(p)){const $=[`background: var(--rf-color-${p})`];E&&$.push(`opacity: ${E}`),Q.style=$.join("; ")}else k.push({code:"raw-css-overlay",message:`[refrakt] raw-CSS \`overlay\` on \`${n.rune}\` is deprecated (SPEC-088) — use \`overlay="dark|light|<token>"\` for a flat wash or \`scrim\` for a legibility gradient. The raw passthrough will be removed in a future minor.`,dedupeKey:n.rune}),Q.style=`background: ${p}`;y.push(At("div",Q))}if(O){const E=Ot(e,"scrim-type")??"gradient",Q=Ot(e,"scrim-tone")??"dark",$={"data-name":"scrim","data-scrim":E,"data-scrim-tone":Q,"data-scrim-dir":m};if(E==="frost"){const L=Ot(e,"scrim-blur")??"md";$.style=`--scrim-blur: ${jp[L]??jp.md}`}else{const L=Ot(e,"scrim-strength")??"md";$.style=`--scrim-strength: ${nw[L]??nw.md}`}y.push(At("div",$)),n.axis("color-scheme")||(P["data-color-scheme"]=Q,T["color-scheme"]=Q)}return P["data-bg"]="",{classes:[`${n.block}--has-bg`],dataAttrs:P,consumes:nT,layers:[{placement:"before-content",element:At("div",C,y)}],...r?{absorbs:[r]}:{},...Object.keys(T).length?{state:T}:{},...k.length?{warnings:k}:{}}}},M6={axis:"bg",contract:{description:"The background layer (SPEC-088): image, video, gradient, flat overlay wash and legibility scrim, in a single injected layer behind the rune's content.",source:"meta",inputs:nT,selectors:[".{block}--has-bg"],dataAttributes:["data-bg","data-color-scheme"],customProperties:["--bg-image","--bg-position","--bg-blur","--bg-fit","--bg-opacity","--scrim-strength","--scrim-blur"],elements:['[data-name="bg"]','[data-name="bg-video"]','[data-name="bg-overlay"]','[data-name="scrim"]'],condition:"the layer is raised only when a preset, image, video, gradient, overlay, scrim or `{% bg %}` sandbox guest resolves. In cover mode the scrim is routed to the media well instead, and `data-color-scheme` yields to a scheme a tint already claimed."},describeForRune:(n,e)=>({selectors:[`.${e}--has-bg`]})},q6={name:"width",attributes:["width"],resolve(n){const e=n.tag.attributes?.width??n.config.defaultWidth;return!e||e==="content"?null:{axes:{width:e},classes:[`${n.block}--${e}`]}}},R6={name:"content-measure",resolve:n=>n.config.contentMeasure==="anchored"?{axes:{"content-measure":"anchored"}}:null},D6={name:"spacing",attributes:["spacing"],resolve(n){const e=n.tag.attributes?.spacing;return!e||e==="default"?null:{axes:{spacing:e},classes:[`${n.block}--spacing-${e}`]}}},I6={name:"inset",attributes:["inset"],resolve(n){const e=n.tag.attributes?.inset;return!e||e==="default"?null:{axes:{inset:e},classes:[`${n.block}--inset-${e}`]}}},N6={axis:"width",contract:{description:"The track a block rune occupies.",source:"attribute",inputs:["width"],dataAttributes:["data-width"],classPattern:".{block}--{value}",condition:"suppressed at the `content` default"},describeForRune:n=>n.defaultWidth?{default:n.defaultWidth}:null},B6={axis:"content-measure",contract:{description:"A page-section rune anchors its content to the text measure when bled to the `wide` track; only the surface and background widen.",source:"config",inputs:["contentMeasure"],values:["anchored"],dataAttributes:["data-content-measure"],condition:'not author-facing — emitted only when the rune declares `contentMeasure: "anchored"`'},describeForRune:n=>n.contentMeasure==="anchored"?{default:"anchored"}:null},j6={axis:"spacing",contract:{description:"Block-level rhythm override.",source:"attribute",inputs:["spacing"],dataAttributes:["data-spacing"],classPattern:".{block}--spacing-{value}",condition:"suppressed at the `default` value"},describeForRune:()=>null},z6={axis:"inset",contract:{description:"Internal padding override.",source:"attribute",inputs:["inset"],dataAttributes:["data-inset"],classPattern:".{block}--inset-{value}",condition:"suppressed at the `default` value"},describeForRune:()=>null},Z6=["full","compact","minimal"],F6={name:"density",attributes:["density"],resolve:n=>({state:{density:String(n.tag.attributes?.density??n.parentConfig?.childDensity??n.config.defaultDensity??"full")}})},X6={axis:"density",contract:{description:"How tightly a rune packs its content (SPEC-025).",source:"attribute",inputs:["density"],values:Z6,default:"full",dataAttributes:["data-density"],condition:"always present on the rune root; resolution is author ▸ the parent rune's `childDensity` ▸ this rune's `defaultDensity` ▸ `full`"},describeForRune:n=>n.defaultDensity?{default:n.defaultDensity}:null},nb="prose";function yh(n){return n.provides?.includes(nb)??!1}const wh="this rune declares no prose body",V6={name:"reading",resolve(n){const e=UC({authorAttr:n.tag.attributes?.reading,runeDefault:n.config.defaultReading});if(!yh(n.config)){const t=YC(n.tag.attributes?.reading);return t?{warnings:[{code:"reading-without-prose",message:`[refrakt] reading="${t}" on "${n.rune}" has nothing to apply to — ${wh}, so no element carries an editorial register. Ignored.`,dedupeKey:`${n.rune}:${t}`}]}:null}return{state:{reading:e}}}},W6={name:"dropcap",after:["reading"],appliesTo:n=>!!n.tag.attributes?.dropcap,resolve(n){if(!yh(n.config))return{warnings:[{code:"dropcap-without-prose",message:`[refrakt] dropcap on "${n.rune}" has nothing to apply to — ${wh}. Ignored.`,dedupeKey:n.rune}]};const e=n.axis("reading")??Oh;return Cg[e]?.dropcap===!0?{state:{dropcap:"true"}}:{warnings:[{code:"dropcap-off-register",message:`[refrakt] dropcap is honoured only on a prose body — ignored on "${n.rune}" (reading="${e}").`}]}}},Y6={axis:"reading",contract:{description:"Editorial register for body text (SPEC-108). The author picks the register; the theme owns the magnitude.",source:"attribute",inputs:["reading"],values:WC,default:Oh,dataAttributes:["data-reading"],target:'[data-section="body"]',condition:"suppressed at the `ui` default, so unmarked bodies carry no attribute"},requires:nb,describeForRune:n=>yh(n)?n.defaultReading?{default:n.defaultReading}:null:wh},U6={axis:"dropcap",contract:{description:"Per-instance drop-cap opt-in (SPEC-108).",source:"attribute",inputs:["dropcap"],dataAttributes:["data-dropcap"],target:'[data-section="body"]',condition:"honoured only when the resolved reading register enables it (`prose`); dropped with a warning otherwise"},requires:nb,describeForRune:n=>yh(n)?null:wh};function rT(n,e,t){for(let r=0;r<n.length;r++){const i=n[r];if(!Kt(i))continue;if(i.attributes?.["data-field"]===e||i.attributes?.["data-name"]===e){const o=i.attributes?.style?String(i.attributes.style):"",a=`--rf-reveal-index: ${t.n}`;n[r]={...i,attributes:{...i.attributes,style:o?`${o}; ${a}`:a}},t.n++}else i.children.length>0&&rT(i.children,e,t)}}const G6={name:"motion",attributes:["reveal","stagger"],resolve(n){const e=n.tag.attributes?.reveal,t=!!n.tag.attributes?.stagger;if(!e&&!t)return null;const r={};return e&&(r.reveal=String(e)),t&&(r.stagger=""),{axes:r,...t?{carry:!0}:{}}},postAssemble(n,e,t){t!==!0||!n.config.staggerItems||rT(e,n.config.staggerItems,{n:0})}},H6={axis:"motion",contract:{description:"Scroll-reveal entrance (SPEC-105). The author declares the character, the theme owns the choreography, a behaviour owns the timing.",source:"attribute",inputs:["reveal","stagger"],dataAttributes:["data-reveal","data-stagger"],customProperties:["--rf-reveal-index"],condition:"`--rf-reveal-index` is stamped on the cascade items named by the rune's `staggerItems`; without `staggerItems`, `stagger` marks the root and nothing else"},describeForRune:n=>n.staggerItems?{target:`[data-name="${n.staggerItems}"], [data-field="${n.staggerItems}"]`}:null};function K6(n,e,t){const r=n.fields[e];return r!=null&&typeof r!="object"?r:Ot(n.tag,e,t)}const J6={name:"modifiers",resolve(n){if(!n.config.modifiers)return null;const e={},t=[],r={},i=[];for(const[s,o]of Object.entries(n.config.modifiers)){o.source==="attribute"&&i.push(s);const a=o.source==="meta"?K6(n,s,o.default):n.tag.attributes[s]??o.default;if(a){if(e[s]=a,o.noBemClass||t.push(`${n.block}--${a}`),o.valueMap){const l=o.valueMap[a]??a;if(o.mapTarget){const c=o.mapTarget.startsWith("data-")?o.mapTarget:`data-${o.mapTarget}`;r[c]=l}else e[s]=l}}else a===""&&(e[s]="")}return{...Object.keys(e).length?{axes:e}:{},...t.length?{classes:t}:{},...Object.keys(r).length?{dataAttrs:r}:{},...i.length?{stripAttrs:i}:{}}}},e9={name:"context-modifiers",resolve(n){const e=n.parentRune?n.config.contextModifiers?.[n.parentRune]:void 0;return e?{classes:[`${n.block}--${e}`]}:null}},t9={name:"static-modifiers",resolve(n){const e=n.config.staticModifiers;return e?.length?{classes:e.map(t=>`${n.block}--${t}`)}:null}},n9={inline:"this rune is inline — the block-level universal axes have nothing to act on",configurator:"this rune supplies axis values to its parent rather than carrying its own",none:"this rune declares no universal attributes"};function r9(n){for(const e of Object.values(n.contract))Array.isArray(e)&&Object.freeze(e);return Object.freeze(n.contract),Object.freeze(n)}const i9=[P6,N6,B6,j6,z6,X6,Y6,U6,f6,m6,H6,v6,y6,x6,C6,M6].map(r9),iT=[J6,e9,t9,T6,q6,R6,D6,I6,F6,V6,W6,u6,p6,G6,g6,b6,k6,A6,L6],s9=new Set(iT.flatMap(n=>[...n.attributes??[]])),sw=i6(iT),Fc={duration(n){const e=n.match(/PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?/);if(!e)return n;const t=[];return e[1]&&t.push(`${e[1]}h`),e[2]&&t.push(`${e[2]}m`),e[3]&&t.push(`${e[3]}s`),t.join(" ")||n},uppercase:n=>n.toUpperCase(),capitalize:n=>n.charAt(0).toUpperCase()+n.slice(1)};function o9(n){const e=n.match(/PT(?:(\d+)H)?(?:(\d+)M)?(?:(\d+)S)?/);if(!e)return null;const t={};return e[1]&&(t.hours=parseInt(e[1],10)),e[2]&&(t.minutes=parseInt(e[2],10)),e[3]&&(t.seconds=parseInt(e[3],10)),t}function a9(n,e){const t=Fc.duration(n);if(!e||e.locale===GC)return t;const r=Intl.DurationFormat;if(typeof r!="function")return t;const i=o9(n);if(!i)return t;try{return new r(e.locale,{style:"short"}).format(i)}catch{return t}}function l9(n){const{prefix:e,runes:t,icons:r={},tints:i={},backgrounds:s={},frames:o={}}=n,a=n6(n.locale,n.strings),l=new Map(Object.keys(t).map(f=>[As(f),f])),c=new r6;function u(f,d){if(f==null||typeof f=="string"||typeof f=="number")return f;if(Array.isArray(f))return f.map(v=>u(v,d));if(!Kt(f))return f;const h=f.attributes?.["data-i18n"];if(h){const{["data-i18n"]:v,...O}=f.attributes,b=f.children.find(w=>typeof w=="string")??"";return{...f,attributes:O,children:[tb(a,h,b)]}}const m=f.attributes?.["data-rune"],p=m?l.get(m):void 0;if(p)return v9(f,t[p],e,r,i,s,o,t,l,u,a,c,d);if(f.name==="li"){const v=O9(f);if(v)return{...v,children:v.children.map(O=>u(O,d))}}return{...f,children:f.children.map(v=>u(v,d))}}return f=>u(f)}function c9(n){if(typeof n!="string"||n.length===0)return{};try{const e=JSON.parse(n);return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}catch{return{}}}function u9(n,e,t,r){const i=e[t];return i!=null&&typeof i!="object"?i:Ot(n,t,r)}function f9(n,e,t){if(!n.variants)return n;let r=n;for(const[i,s]of Object.entries(n.variants)){const o=n.modifiers?.[i];if(!o)continue;const a=o.source==="attribute"?e.attributes[i]??o.default:u9(e,t,i,o.default);a&&s[a]&&(r=J8(r,s[a]))}return r}const d9=JO;function h9(n){const e=[],t=r=>{if(Kt(r)){r.name==="rf-sandbox"&&e.push(r);for(const i of r.children??[])t(i)}};return t(n),e}function p9(n,e,t){const r=i=>{if(!Kt(i))return;const s=i.attributes?.["data-rune"];if(s){const o=t.get(s);if(o&&e[o]?.interactive)return s}for(const o of i.children??[]){const a=r(o);if(a)return a}};for(const i of n.children??[]){const s=r(i);if(s)return s}}function m9(n,e){return{code:"interactive-guest-in-link",dedupeKey:`interactive-guest:${n}:${e}`,message:`[refrakt] interactive guest \`${e}\` in a linked \`${n}\` — its controls are inert under the whole-tile link. Drop \`href\` or the interactivity.`}}function g9(n,e){return{code:"non-eager-cover-sandbox",dedupeKey:`cover-sandbox:${n}:${e}`,message:`[refrakt] \`activation="${e}"\` on a sandbox serving as a \`${n}\` cover backdrop — the backdrop is inert (pointer-events: none), so the poster/Run affordance is unreachable. Drop \`activation\` (eager is the background mode).`}}function v9(n,e,t,r,i,s,o,a,l,c,u,f,d){const h=`${t}-${e.block}`,m=n.attributes?.["data-rune"];if(e.requiresParent&&e.requiresParent!=="*"){const j=As(e.requiresParent);d!==j&&f.emit($9(m??e.block,e.requiresParent,d))}const p=c9(n.attributes["data-rune-fields"]);e=f9(e,n,p);const v=[],O={},b=d?l.get(d):void 0,w={tag:n,config:e,block:h,rune:m??h,parentRune:d,parentConfig:b?a[b]:void 0,fields:p,theme:{tints:i,backgrounds:s,frames:o}},S=o6(sw,w,f);Object.assign(O,S.axes),v.push(...S.classes);const _=S.state.reading??Oh,x=S.state.dropcap==="true",A=S.state.density??"full",C=S.state.cover==="true",y={};for(const[j,U]of Object.entries(O)){const ue=j.replace(/([A-Z])/g,"-$1").toLowerCase();y[`data-${ue}`]=U}Object.assign(y,S.dataAttrs);const k=n.attributes.class||"",P=[h,...v,k].filter(Boolean).join(" ");let T=S.absorbs.length?n.children.filter(j=>!S.absorbs.includes(j)):n.children;if(e.autoLabel&&(T=sT(T,e.autoLabel)),e.blocks||e.layout)T=T9(e,h,T,O,u,f);else if(e.structure){const j=[],U=[];for(const[ue,ke]of Object.entries(e.structure)){const Ce=Tf(ke,ue,O,r,u,e);Ce&&(ke.before?j.push(Ce):U.push(Ce))}if(e.contentWrapper){const ue=At(e.contentWrapper.tag,{"data-name":e.contentWrapper.ref},T);T=[...j,ue,...U]}else(j.length||U.length)&&(T=[...j,...T,...U])}else e.contentWrapper&&(T=[At(e.contentWrapper.tag,{"data-name":e.contentWrapper.ref},T)]);const E=S.layers.filter(j=>j.placement==="before-content").map(j=>j.element);E.length&&(T=[...E,...T]);let Q=T.map(j=>Kt(j)?c(rb(j,h,e.sections,e.mediaSlots,e.guestFit,_,x),m):c(j,m));e.projection&&(Q=b9(Q,e.projection,h,e.sections,e.mediaSlots,e.guestFit,_,x));const $=!!d9(Q,"link");if($||C){const j=vh(Q);if(j){if(j.attributes={...j.attributes,"data-guest-posture":"presentational"},$){const U=p9(j,a,l);U&&f.emit(m9(m??e.block,U))}if(C)for(const U of h9(j)){(U.attributes?.["data-height"]??"auto")==="auto"&&(U.attributes={...U.attributes,"data-height":"fill"});const ue=U.attributes?.["data-activation"];(ue==="visible"||ue==="click")&&f.emit(g9(m??e.block,String(ue)))}}}const L=e.modifiers?new Set(Object.keys(e.modifiers).map(j=>As(j))):void 0,I=new Set(S.consumes),Z=Q.filter(j=>{if(!Kt(j))return!0;const U=j;if(U.name!=="meta"||!U.attributes["data-field"])return!0;const ue=U.attributes["data-field"];return!(L?.has(ue)||I.has(ue))});if(e.sequence){const j=e.sequenceDirection?O[e.sequenceDirection.fromModifier]??e.sequenceDirection.default:void 0;oT(Z,e.sequence,j)}let Y=n.attributes.style||"";const ne=[];if(e.styles)for(const[j,U]of Object.entries(e.styles)){const ue=O[j];ue&&(typeof U=="string"?ne.push(`${U}: ${ue}`):U.transform?ne.push(`${U.prop}: ${U.transform(ue)}`):U.template?ne.push(`${U.prop}: ${U.template.replace("{}",ue)}`):ne.push(`${U.prop}: ${ue}`))}for(const[j,U]of S.styles)ne.push(`${j}: ${U}`);a6(sw,w,S,Z,f),ne.length&&(Y=Y?`${Y}; ${ne.join("; ")}`:ne.join("; "));const{"data-rune":ae,"data-rune-fields":ie,...K}=n.attributes,he=Object.fromEntries(Object.entries(K).filter(([j])=>!s9.has(j)&&!S.stripAttrs.includes(j))),fe={...n,attributes:{...he,...y,class:P,"data-rune":m,"data-density":A,...e.rootAttributes||{},...Y?{style:Y}:{}},children:Z};return e.postTransform?e.postTransform(fe,{modifiers:O,parentType:d,fields:p}):fe}function sT(n,e){return n.map(t=>{if(!Kt(t))return t;const r=e[t.name]??e[t.attributes?.["data-field"]],i=r&&!t.attributes["data-name"]?{...t,attributes:{...t.attributes,"data-name":r}}:t;return i.children.length===0?i:{...i,children:sT(i.children,e)}})}function rb(n,e,t,r,i,s,o){const a=n.attributes["data-name"];if(a){const l=`${e}__${a}`,c=n.attributes.class||"",u=n.children.map(h=>Kt(h)?rb(h,e,t,r,i,s,o):h),f=t?.[a],d=r?.[a];return{...n,attributes:{...n.attributes,class:[l,c].filter(Boolean).join(" "),...f?{"data-section":f}:{},...f==="body"&&s&&s!==Oh?{"data-reading":s}:{},...f==="body"&&o?{"data-dropcap":"true"}:{},...d?{"data-media":d}:{},...f==="media"?{"data-guest-fit":i??"clip"}:{}},children:u}}return n}const ow=/^\[(x|X|>|\s|-)\]\s*/,aw={x:"checked",X:"checked"," ":"unchecked",">":"active","-":"skipped"};function O9(n){const e=n.children;if(e.length===0)return null;const t=e[0];if(typeof t=="string"){const r=t.match(ow);if(!r)return null;const i=aw[r[1]]??"unchecked",s=t.slice(r[0].length);return{...n,attributes:{...n.attributes,"data-checked":i},children:[s,...e.slice(1)]}}if(Kt(t)&&t.name==="p"&&t.children.length>0){const r=t.children[0];if(typeof r=="string"){const i=r.match(ow);if(!i)return null;const s=aw[i[1]]??"unchecked",o=r.slice(i[0].length),a={...t,children:[o,...t.children.slice(1)]};return{...n,attributes:{...n.attributes,"data-checked":s},children:[a,...e.slice(1)]}}}return null}function oT(n,e,t){for(let r=0;r<n.length;r++){const i=n[r];if(Kt(i))if(i.name==="ol"){const s={...i.attributes,"data-sequence":e};t&&(s["data-sequence-direction"]=t),n[r]={...i,attributes:s}}else i.children.length>0&&oT(i.children,e,t)}}function aT(n,e){const t=n.findIndex(r=>Kt(r)&&r.attributes?.["data-name"]===e);if(t!==-1){const r=n[t],i=[...n.slice(0,t),...n.slice(t+1)];return{element:r,rest:i}}for(let r=0;r<n.length;r++){const i=n[r];if(!Kt(i))continue;const s=i;if(s.attributes?.["data-name"]!=="preamble")continue;const o=aT(s.children,e);if(!o)continue;const a=[...n];return o.rest.length===0?a.splice(r,1):a[r]={...s,children:o.rest},{element:o.element,rest:a}}return null}function lT(n,e){for(const t of n){if(!Kt(t))continue;const r=t;if(r.attributes?.["data-name"]===e)return r;const i=lT(r.children,e);if(i)return i}return null}function cT(n,e,t,r){return n.map(i=>{if(!Kt(i))return i;const s=i;if(s.attributes?.["data-name"]===e){const a=r==="prepend"?[t,...s.children]:[...s.children,t];return{...s,children:a}}const o=cT(s.children,e,t,r);return o!==s.children?{...s,children:o}:i})}function b9(n,e,t,r,i,s,o,a){let l=[...n];if(e.hide){const c=new Set(e.hide);l=l.filter(u=>{if(!Kt(u))return!0;const f=u.attributes?.["data-name"];return!f||!c.has(f)})}if(e.group)for(const[c,u]of Object.entries(e.group)){const f=new Set(u.members),d=[];let h=-1;for(let m=l.length-1;m>=0;m--){const p=l[m];if(!Kt(p))continue;const v=p.attributes?.["data-name"];v&&f.has(v)&&(d.unshift(p),(h===-1||m<h)&&(h=m),l.splice(m,1))}if(d.length>0){let m=At(u.tag,{"data-name":c},d);m=rb(m,t,r,i,s,o,a),l.splice(h,0,m)}}if(e.relocate)for(const[c,u]of Object.entries(e.relocate)){const f=aT(l,c);if(!f)continue;l=f.rest,lT(l,u.into)&&(l=cT(l,u.into,f.element,u.position??"append"))}return l}function mu(n,e,t,r,i){if(r===void 0)return;if(!n)return r;const s=i??`${e?.scope??"core"}.${e?.block??""}.${t}`;return tb(n,s,r)}function _h(n,e,t){if(!n||!t||e?.i18nEnums?.[t]===void 0)return t;const r=`${e.scope??"core"}.${e.block??""}.${t}`;return tb(n,r,t)}function Tf(n,e,t,r,i,s){if(n.condition&&!t[n.condition]||n.conditionAny&&!n.conditionAny.some(u=>t[u]))return null;const o=n.ref??e;if(n.repeat){const u=parseInt(t[n.repeat.count]??"",10);if(!u||u<0||isNaN(u))return At(n.tag,{"data-name":o},[]);const f=n.repeat.max??10,d=Math.min(u,f),h=n.repeat.filled?parseInt(t[n.repeat.filled]??"0",10):0,m=Math.max(0,Math.min(h,d)),p=[];for(let v=0;v<d;v++){const O=v<m;if(O&&n.repeat.filledElement){const b=Tf(n.repeat.filledElement,n.repeat.filledElement.ref??"",t,r,i,s);b&&p.push(b)}else{const b=Tf(n.repeat.element,n.repeat.element.ref??"",t,r,i,s);b&&(n.repeat.filled?p.push({...b,attributes:{...b.attributes,"data-filled":O?"true":"false"}}):p.push(b))}}return At(n.tag,{"data-name":o},p)}const a={};if(n.attrs)for(const[u,f]of Object.entries(n.attrs))typeof f=="string"?a[u]=f:"fromModifier"in f&&(a[u]=t[f.fromModifier]??"");const l={"data-name":o,...a};if(n.metaType&&(l["data-meta-type"]=n.metaType),n.sentimentMap&&n.metaText){const u=t[n.metaText];if(u){const f=n.sentimentMap[u];f&&(l["data-meta-sentiment"]=f)}}if(n.icon)return At(n.tag,l,[]);if(n.metaText){const u=t[n.metaText]??"";let f=_h(i,s,u);if(f===u&&n.transform&&Fc[n.transform]&&(f=Fc[n.transform](f)),n.label){const d={"data-meta-label":""};n.labelHidden&&(d["data-meta-label-hidden"]="");const h=mu(i,s,n.ref??e,n.label,n.i18nKey)??n.label,m=At("span",d,[h]);let p=f;n.textPrefix&&(p=n.textPrefix+p),n.textSuffix&&(p=p+n.textSuffix);const v=At("span",{"data-meta-value":""},[p]);return At(n.tag,l,[m,v])}return n.textPrefix&&(f=n.textPrefix+f),n.textSuffix&&(f=f+n.textSuffix),At(n.tag,l,[f])}const c=[];if(n.children)for(const u of n.children)if(typeof u=="string")c.push(u);else{const f=Tf(u,u.ref??"",t,r,i,s);f&&c.push(f)}return At(n.tag,l,c)}function y9(n,e,t,r){const i=e[n];if(!i)return null;if(i.condition){const l=t[i.condition];if(!(i.renderWhenEmpty?l!==void 0:!!l))return null}let s=t[n]??"";if(!s&&i.condition&&!i.renderWhenEmpty)return null;i.transform==="duration"?s=a9(s,r):i.transform&&Fc[i.transform]&&(s=Fc[i.transform](s));const o=i.href?t[i.href]??"":void 0;if(i.href&&!o)return null;const a=i.rating?t[i.rating.total??""]||"5":void 0;return{name:n,value:s,field:i,href:o,ratingTotal:a}}function uT(n,e={includeLabel:!0},t,r){const{field:i,value:s}=n,o={class:"rf-badge"};if(i.metaType&&(o["data-meta-type"]=i.metaType),i.sentimentMap){const u=i.sentimentMap[s];u&&(o["data-meta-sentiment"]=u)}const a=i.tag??"span",l={...o};a==="time"&&s&&(l.datetime=s);const c=_h(t,r,s);if(e.includeLabel&&i.label){const u=mu(t,r,n.name,i.label,i.i18nKey)??i.label;return At(a,l,[At("span",{"data-meta-label":""},[u]),At("span",{"data-meta-value":""},[c])])}return At(a,l,[c])}function w9(n,e,t){const{field:r,value:i}=n,s={};r.metaType&&(s["data-meta-type"]=r.metaType);const o=r.tag??"span";return o==="time"&&i&&(s.datetime=i),At(o,s,[_h(e,t,i)])}function fT(n){const e=n.field.splitOn;return!e||!n.value?[n.value].filter(Boolean):n.value.split(e).map(t=>t.trim()).filter(Boolean)}const _9=new Set(["status","category","tag"]);function dT(n){return n.metaType!==void 0&&_9.has(n.metaType)}function k9(n,e,t){const r=mu(e,t,n.name,n.field.label,n.field.i18nKey)??n.value;return At("a",{href:n.href??"","data-meta-type":"link"},[r])}function x9(n){const e=Math.max(0,parseInt(n.value,10)||0),t=Math.max(0,parseInt(n.ratingTotal??"5",10)||5),r=[];for(let i=0;i<t;i++)r.push(At("span",{"data-filled":i<e?"true":"false"},[]));return At("span",{"data-meta-type":"rating"},r)}function S9(n,e,t){const r=n.field.icon.group,i={};n.field.metaType&&(i["data-meta-type"]=n.field.metaType);const s=mu(e,t,n.name,n.field.label,n.field.i18nKey)??_h(e,t,n.value);return At(n.field.tag??"span",i,[At("span",{"data-icon-group":r,"data-icon":n.value},[]),At("span",{"data-meta-value":""},[s])])}function Tg(n,e=!1,t,r){return n.field.href?k9(n,t,r):n.field.rating?x9(n):n.field.icon?S9(n,t,r):dT(n.field)?uT(n,{includeLabel:e},t,r):w9(n,t,r)}function A9(n,e,t,r,i){if(e.length===0)return null;const s=[];for(const{resolved:a,align:l}of e){const c=a.field.splitOn&&a.value?fT(a).map(u=>Tg({...a,value:u},!1,r,i)):[Tg(a,!1,r,i)];l==="end"&&c.length>0&&(c[0]={...c[0],attributes:{...c[0].attributes,"data-align":"end"}}),s.push(...c)}const o={"data-name":n,"data-zone":n,"data-zone-layout":"bar"};return t===!1&&(o["data-wrap"]="false"),At("div",o,s)}function C9(n,e,t,r){if(e.length===0)return null;const i=e.map(s=>{const o=mu(t,r,s.name,s.field.label??s.name,s.field.i18nKey)??s.name,a=At("dt",{"data-meta-label":""},[o]);let l;if(s.field.splitOn&&s.value){const c=fT(s).map(u=>Tg({...s,value:u},!1,t,r));l=At("dd",{"data-multi-value":""},c)}else if(dT(s.field))l=At("dd",{},[uT(s,{includeLabel:!1},t,r)]);else{const c={};s.field.metaType&&(c["data-meta-type"]=s.field.metaType);const u=s.field.tag==="time"&&s.value?At("time",{datetime:s.value},[s.value]):s.value;l=At("dd",c,[u])}return At("div",{"data-name":"row","data-field":s.name},[a,l])});return At("dl",{"data-name":n,"data-zone":n,"data-zone-layout":"definition-list"},i)}function T9(n,e,t,r,i,s){const o=n.blocks??{},a=n.layout??{},l=n.metaFields??{},c=h=>{const m=o[h];if(!m)return null;const p=[];for(const v of m.fields){const O=typeof v=="string"?v:v.field,b=typeof v=="string"?void 0:v.align,w=y9(O,l,r,i);w&&p.push({resolved:w,align:b})}return p.length===0?null:m.layout==="bar"?A9(h,p,m.wrap??!0,i,n):C9(h,p.map(v=>v.resolved),i,n)};if(Object.keys(a).length===0)return t;const u={layout:a,renderBlock:c,warnings:s},f=a.root;if(f){const h=Array.isArray(f)?f:f.children,m=Pg(t),p=new Set,v=Sd(h,m,p,u,["root"]),O=t.filter(b=>!(Kt(b)&&b.attributes["data-name"]&&p.has(b.attributes["data-name"])));return[...v,...O]}let d=t;for(const[h,m]of Object.entries(a)){const p=Array.isArray(m)?m:m.children;d=Q9(d,h,v=>{const O=Pg(v),b=new Set,w=Sd(p,O,b,u,[h]),S=v.filter(_=>!(Kt(_)&&_.attributes["data-name"]&&b.has(_.attributes["data-name"])));return[...w,...S]})}return d}function P9(n){return{code:"layout-cycle",dedupeKey:`layout-cycle:${n}`,message:`[refrakt] layout reference cycle at "${n}" — skipping to break the loop.`}}const E9=new Set(["accordion-item","tab","tab-panel","breadcrumb-item","juxtapose-panel","bento-cell","definition","step","tier","map-pin","itinerary-day","itinerary-stop"]);function $9(n,e,t){const r=t?`nested directly in \`${t}\``:"at the top level";return{code:"requires-parent",dedupeKey:`requires-parent:${n}<${t??""}`,severity:E9.has(n)?"error":"warn",message:`[refrakt] \`${n}\` requires parent \`${As(e)}\` — found ${r}.`}}function Pg(n){const e=new Map;for(const t of n)Kt(t)&&t.attributes["data-name"]&&e.set(t.attributes["data-name"],t);return e}function Sd(n,e,t,r,i){const s=[];for(const o of n){if(t.has(o))continue;if(i.includes(o)){r.warnings.emit(P9(o));continue}const a=r.layout[o];if(a&&!Array.isArray(a)&&a.tag){t.add(o);const u=Sd(a.children,e,t,r,[...i,o]);s.push(At(a.tag,{"data-name":o,...a.attrs??{}},u));continue}if(a){const u=e.get(o);if(u){t.add(o);const f=Array.isArray(a)?a:a.children,d=Pg(u.children),h=new Set,m=Sd(f,d,h,r,[...i,o]),p=u.children.filter(v=>!(Kt(v)&&v.attributes["data-name"]&&h.has(v.attributes["data-name"])));s.push({...u,children:[...m,...p]});continue}}const l=r.renderBlock(o);if(l){t.add(o),s.push(l);continue}const c=e.get(o);if(c){t.add(o),s.push(c);continue}}return s}function Q9(n,e,t){let r=!1;const i=s=>s.map(o=>r||!Kt(o)?o:o.attributes["data-name"]===e?(r=!0,{...o,children:t(o.children)}):{...o,children:i(o.children)});return i(n)}const L9={"layout.openMenu":"Open menu","layout.closeMenu":"Close menu","layout.search":"Search","layout.menu":"Menu","layout.plan":"Plan","layout.toggleNavigation":"Toggle navigation","layout.navigationMenu":"Navigation menu","layout.pageNavigation":"Page navigation","layout.planNavigation":"Plan navigation","layout.toggleColorTheme":"Toggle color theme","layout.jumpToSection":"Jump to section"};new Map(Object.entries(L9).map(([n,e])=>[e,n]));const M9=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),q9=new Set(["$$mdtype"]);function hT(n){return n.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""")}function R9(n){const e=[];for(const[t,r]of Object.entries(n))if(!q9.has(t)&&!(r==null||r===!1)){if(r===!0){e.push(t);continue}e.push(`${t}="${hT(String(r))}"`)}return e.length?" "+e.join(" "):""}function D9(n,e){return ec(n)}function ec(n){if(n==null)return"";if(typeof n=="string")return hT(n);if(typeof n=="number")return String(n);if(Array.isArray(n))return n.map(ec).join("");if(!Kt(n))return"";const e=n.name;if(!e)return n.children.map(ec).join("");const t=R9(n.attributes);if(M9.has(e))return`<${e}${t} />`;const i=n.attributes?.["data-codeblock"]||n.attributes?.["data-raw-html"]?n.children.map(s=>typeof s=="string"?s:ec(s)).join(""):n.children.map(ec).join("");return`<${e}${t}>${i}</${e}>`}function I9(n,e,t,r){if(!n)return null;const i=n.endsWith("/")?n.slice(0,-1):n,s=e&&e.length>0?e:"main",o=t.split("/").map(l=>encodeURIComponent(l)).join("/"),a=r?`#${N9(r)}`:"";return`${i}/blob/${s}/${o}${a}`}function N9(n){const e=n.trim(),t=e.indexOf("-");if(t<0)return`L${e}`;const r=e.slice(0,t).trim(),i=e.slice(t+1).trim();return i?`L${r}-L${i}`:`L${r}`}const{Tag:rJ}=B,lw={tint:["tint","tint-mode"],bg:["bg","bg-gradient","bg-from","bg-to","bg-via","bg-gradient-type","scrim","scrim-type","scrim-strength","scrim-blur","scrim-tone"],width:["width"],spacing:["spacing"],inset:["inset"],elevation:["elevation"],prominence:["prominence"],reading:["reading"],dropcap:["dropcap"],motion:["reveal","stagger"],frame:["frame","frame-aspect","frame-displace","frame-displace-mode","frame-offset","frame-oversize","frame-place","frame-anchor","frame-overflow","frame-shadow"],substrate:["substrate","substrate-size","substrate-opacity","substrate-fill","substrate-target"]},B9=n9;function j9(n={}){const e=n.posture??"auto";if(e!=="auto"){const s=B9[e];return{available:new Set,unavailable:new Map(Object.keys(lw).map(o=>[o,s]))}}const t={block:"",sections:n.structure?.sections,mediaSlots:n.structure?.mediaSlots,frameTarget:n.structure?.frameTarget,provides:n.structure?.provides,modifiers:Object.fromEntries([...n.declaredAttributes??[]].map(s=>[s,{source:"attribute"}]))},r=new Map;for(const s of i9){const o=s.describeForRune(t,"");typeof o=="string"&&r.set(s.axis,o)}const i=new Set;for(const[s,o]of Object.entries(lw))if(!r.has(s))for(const a of o)i.add(a);return{available:i,unavailable:r}}function z9(n,e){if(typeof e=="function")return e(n);const t=typeof e=="string"?{node:e}:e;return!(t.node&&n.type!==t.node||t.descendant&&!Array.from(n.walk()).some(r=>r.type===t.descendant)||t.descendantTag&&!Array.from(n.walk()).some(r=>r.type==="tag"&&r.tag===t.descendantTag))}const{Ast:cw}=B;function*pT(n){yield n;for(const e of n.children)B.Tag.isTag(e)?yield*pT(e):yield e}function ib(n){const e=n?.level,t=n?.include;return r=>{const i=e??r.find(c=>c.type==="heading")?.attributes.level;if(!i)return r;let s;const o=new cw.Node("list"),a=[];let l=[];for(let c=0;c<r.length;c++){const u=r[c];if(u.type==="heading"&&u.attributes.level===i)o.children.push(new cw.Node("item",{},[u])),s=c;else if(s===void 0)a.push(u);else if(!t||t.some(f=>z9(u,f))){const f=o.children.at(-1);f&&f.children.push(u)}else{l=r.slice(c);break}}return o.children.length===0?r:[...a,o,...l]}}class Re{constructor(e){this.nodes=e,this.offset=0}static fromData(e,t){return new Re([new B.Tag(t,{},[e])])}wrap(e,t={}){return new Re([new B.Tag(e,t,this.nodes)])}tag(e){const t=this.nodes.filter(r=>B.Tag.isTag(r)&&r.name===e);return new Re(t)}tags(...e){const t=this.nodes.filter(r=>B.Tag.isTag(r)&&e.includes(r.name));return new Re(t)}headings(){return this.tags("h1","h2","h3","h4","h5","h6")}typeof(e){return new Re(this.nodes.filter(t=>B.Tag.isTag(t)&&t.attributes["data-rune"]===As(e)))}concat(...e){const t=e.map(r=>r instanceof Re?r.nodes:r).flat();return new Re([...this.nodes,...t])}flatten(){const e=this.nodes.map(t=>B.Tag.isTag(t)?Array.from(pT(t)):t).flat();return new Re(e)}limit(e){return new Re(this.nodes.slice(0,e))}slice(e,t){return new Re(this.nodes.slice(e,t))}toArray(){return this.nodes}count(){return this.nodes.length}next(){return this.nodes[this.offset++]}}function Me(n){const e=n.rune,t=n.typeof??n.schemaOrgType;if(n.properties&&n.refs){const c=new Set(Object.keys(n.properties)),u=Object.keys(n.refs).filter(f=>c.has(f));if(u.length>0)throw new Error(`Rune "${e}" has naming collisions between properties and refs: ${u.join(", ")}. Properties and refs share a flat namespace (ADR-008) and must have unique names.`)}const r=new Set;for(const c of Object.values(n.schema??{})){if(c===void 0)continue;const u=c instanceof Re?c.nodes:Array.isArray(c)?c:[c];for(const f of u)r.add(f)}const i={},s=new Set;for(const[c,u]of Object.entries(n.properties??{})){if(u===void 0)continue;const f=u instanceof Re?u.nodes:Array.isArray(u)?u:[u],d=[];f.forEach(h=>{if(B.Tag.isTag(h)){const m=h.name==="meta"&&r.has(h);m||(h.attributes["data-field"]=As(c)),h.name==="meta"&&h.attributes.content!==void 0&&(d.push(h.attributes.content),m||s.add(h))}}),d.length===1?i[c]=d[0]:d.length>1&&(i[c]=d)}for(const[c,u]of Object.entries(n.refs||{})){if(u===void 0)continue;(u instanceof Re?u.nodes:Array.isArray(u)?u:[u]).forEach(d=>{B.Tag.isTag(d)&&(d.attributes["data-name"]=c)})}const o=new Set;for(const[c,u]of Object.entries(n.schema??{})){if(u===void 0)continue;(u instanceof Re?u.nodes:Array.isArray(u)?u:[u]).forEach(d=>{if(B.Tag.isTag(d)){if(d.name==="meta"&&(d.attributes.content===void 0||d.attributes.content==="")){o.add(d);return}d.attributes.property=c}})}const a=(Array.isArray(n.children)?n.children:[n.children]).filter(c=>!o.has(c)&&!s.has(c));return new B.Tag(n.tag,{id:n.id,"data-field":n.property?As(n.property):n.property,"data-rune":e,typeof:t,class:n.class,...Object.keys(i).length>0?{"data-rune-fields":JSON.stringify(i)}:{}},a)}function Z9(n){return n.replace(/<script\b[^>]*>[\s\S]*?<\/script\s*>/gi,"")}function F9(n){let e=n.replace(/\s+on[a-z]+\s*=\s*"[^"]*"/gi,"");return e=e.replace(/\s+on[a-z]+\s*=\s*'[^']*'/gi,""),e=e.replace(/\s+on[a-z]+\s*=\s*[^\s>]+/gi,""),e}function X9(n){return n.replace(/(\s(?:href|src|action|formaction|xlink:href)\s*=\s*)(["'])\s*javascript:[^"']*\2/gi,"$1$2$2")}function V9(n){let e=n.replace(/<iframe\b[^>]*>[\s\S]*?<\/iframe\s*>/gi,"");return e=e.replace(/<object\b[^>]*>[\s\S]*?<\/object\s*>/gi,""),e=e.replace(/<embed\b[^>]*\/?>/gi,""),e=e.replace(/<iframe\b[^>]*\/>/gi,""),e=e.replace(/<object\b[^>]*\/>/gi,""),e}function W9(n,e){if(e.trust==="trusted"||e.allowJs)return n;let t=Z9(n);return t=F9(t),t=X9(t),t=V9(t),t}const Y9=new WeakMap,Eg=new WeakMap;function xl(n,e){Eg.set(n,{...Eg.get(n),universalAttributes:e})}function nt(n){return Array.isArray(n)?n:n!=null?[n]:[]}const U9={tint:{type:String,required:!1,description:"Color tint preset applied to this block"},"tint-mode":{type:String,required:!1,matches:["auto","dark","light"],description:"Whether the tint adapts to auto, dark, or light mode"},bg:{type:String,required:!1,description:"Background preset applied to this block"},width:{type:String,required:!1,matches:["compact","narrow","content","wide","full"],description:"Maximum width constraint for this block"},reading:{type:String,required:!1,matches:["fine","ui","prose"],description:"Reading register for this block’s body (SPEC-108): fine | ui | prose. The theme owns the editorial treatment."},dropcap:{type:Boolean,required:!1,description:"Style the opening letter of a prose body as a drop cap (SPEC-108). Honoured only when the body reads as prose; ignored otherwise."},spacing:{type:String,required:!1,matches:["flush","tight","default","loose","breathe"],description:"Vertical spacing above and below this block"},inset:{type:String,required:!1,matches:["flush","tight","default","loose","breathe"],description:"Inner padding of this block"},elevation:{type:String,required:!1,matches:["sunken","flush","flat","raised","floating","overlay","none","sm","md","lg"],description:"Surface depth on the SPEC-107 ladder (sunken→overlay); none/sm/md/lg are deprecated aliases"},prominence:{type:String,required:!1,matches:["quiet","normal","prominent","display"],description:"Section-header emphasis (only on page-section-header family runes)"},reveal:{type:String,required:!1,matches:["none","fade","slide","scale","blur"],description:"Scroll-reveal entrance character (none|fade|slide|scale|blur); the theme owns the choreography"},stagger:{type:Boolean,required:!1,description:"Cascade this block's items in as it reveals (no-op on single-child runes)"},frame:{type:String,required:!1,description:"Named frame preset presenting this block's media surface"},"frame-aspect":{type:String,required:!1,description:'Aspect ratio of the framed media, e.g. "16/9"'},"frame-displace":{type:String,required:!1,matches:["top","bottom","end","bottom-end","top-end"],description:"Edge/corner the framed guest moves toward"},"frame-displace-mode":{type:String,required:!1,matches:["peek","bleed"],description:"How displacement renders: `peek` (default) translates the guest visually inside its frame target; `bleed` uses negative margin on the media zone so following layout pulls up — extends past a section like a hero without leaving a gap above"},"frame-offset":{type:String,required:!1,matches:["none","sm","md","lg","xl","2xl","3xl","4xl"],description:"Displacement distance (non-linear named scale: sm…xl ride the block-spacing tokens, 2xl/3xl/4xl step up to section-spacing for bleed-mode displacements that clear a section edge)"},"frame-oversize":{type:String,required:!1,description:"How far the guest exceeds its slot (scale factor)"},"frame-place":{type:String,required:!1,description:'Guest-box alignment in the slot (e.g. "left top")'},"frame-anchor":{type:String,required:!1,description:"Crop focal point when the guest is cut (object-position)"},"frame-overflow":{type:String,required:!1,matches:["clip","bleed"],description:"How the frame handles a guest whose content is wider than it: `clip` (default) keeps it inside the rounded frame; `bleed` runs an overflowing guest out to the layout edge on a narrow viewport so it reads as cropped by the screen (a bleed host only — hero/feature)"},"frame-shadow":{type:String,required:!1,matches:["none","sm","md","lg"],description:"Silhouette drop-shadow strength for the framed media"},substrate:{type:String,required:!1,matches:["dots","grid","lines","cross","checker","none"],description:"Generated surface pattern"},"substrate-size":{type:String,required:!1,matches:["sm","md","lg"],description:"Pattern cell size"},"substrate-opacity":{type:String,required:!1,matches:["sm","md","lg"],description:"Pattern ink strength"},"substrate-fill":{type:String,required:!1,matches:["inherit","inset"],description:"Surface fill the pattern sits on (full colour stays with tint)"},"substrate-target":{type:String,required:!1,matches:["self","media"],description:"Which surface the pattern fills (overrides the rune/theme default)"},"bg-gradient":{type:String,required:!1,matches:["to-t","to-b","to-l","to-r","to-tr","to-br","to-bl","to-tl"],description:"Gradient direction (bounded named set)"},"bg-from":{type:String,required:!1,description:"Gradient start colour — a semantic token name (→ var(--rf-color-*))"},"bg-to":{type:String,required:!1,description:"Gradient end colour — a semantic token name"},"bg-via":{type:String,required:!1,description:"Optional middle gradient stop — a semantic token name"},"bg-gradient-type":{type:String,required:!1,matches:["linear","radial","conic"],description:"Gradient type"},scrim:{type:String,required:!1,matches:["top","bottom","left","right","none"],description:'Scrim direction (heaviest edge); presence turns the scrim on, "none" opts out of the default cover scrim'},"scrim-type":{type:String,required:!1,matches:["gradient","frost"],description:"Scrim treatment: gradient (default) or frost (backdrop blur)"},"scrim-strength":{type:String,required:!1,matches:["sm","md","lg"],description:"Gradient scrim strength"},"scrim-blur":{type:String,required:!1,matches:["none","sm","md","lg"],description:"Frost scrim blur amount"},"scrim-tone":{type:String,required:!1,matches:["dark","light"],description:"Whether the scrim darkens (for light text) or lightens (for dark text)"}},G9=["bg-gradient","bg-from","bg-to","bg-via","bg-gradient-type","scrim","scrim-type","scrim-strength","scrim-blur","scrim-tone"],H9=["frame-aspect","frame-displace","frame-displace-mode","frame-offset","frame-oversize","frame-place","frame-anchor","frame-overflow","frame-shadow"],K9=["substrate-size","substrate-opacity","substrate-fill","substrate-target"];function J9(n,e){if(!B.Tag.isTag(n))return n;const t=[];if(e.tintNode){const i=B.transform(e.tintNode,e.config);if(B.Tag.isTag(i))for(const s of i.children)B.Tag.isTag(s)&&s.name==="meta"&&t.push(s)}const r=i=>t.some(s=>B.Tag.isTag(s)&&s.attributes["data-field"]===i);return e.tint&&!r("tint")&&t.push(new B.Tag("meta",{"data-field":"tint",content:e.tint})),e["tint-mode"]&&e["tint-mode"]!=="auto"&&!r("tint-mode")&&t.push(new B.Tag("meta",{"data-field":"tint-mode",content:e["tint-mode"]})),t.length===0||(n.children=[...n.children,...t]),n}function mT(n){const e=Array.isArray(n)?n:[n];for(const t of e){if(!B.Tag.isTag(t))continue;if(t.name==="rf-sandbox")return t;const r=mT(t.children);if(r)return r}}function uw(n){return new B.Tag(n.name,{...n.attributes,"data-bg-guest":"","data-guest-posture":"backdrop","data-height":"fill","data-activation":"eager"},n.children)}const fw=new WeakMap;function eZ(n,e,t){const r=`${n.src}\0${n.framework??""}\0${n.dependencies??""}`;let i=fw.get(t);i||(i=new Map,fw.set(t,i));const s=i.get(r);if(s)return uw(s);const o={src:n.src};n.framework&&(o.framework=n.framework),n.dependencies&&(o.dependencies=n.dependencies);const a=new B.Ast.Node("tag",o,[],"sandbox"),l=mT(B.transform(a,e));if(l)return i.set(r,l),uw(l)}function tZ(n,e){if(!B.Tag.isTag(n))return n;const t=[],r=[];if(e.bgNode){const s=B.transform(e.bgNode,e.config);if(B.Tag.isTag(s))for(const o of s.children)B.Tag.isTag(o)&&(o.name==="meta"?t.push(o):o.attributes["data-bg-guest"]!==void 0&&r.push(o))}const i=t.some(s=>B.Tag.isTag(s)&&s.attributes["data-field"]==="bg-preset");if(e.bg&&!i&&t.push(new B.Tag("meta",{"data-field":"bg-preset",content:e.bg})),e.bg&&r.length===0){const s=e.config?.variables?.__backgrounds,o=s?.[e.bg];if(o&&s){const a=o.extends?s[o.extends]:void 0,l=o.sandbox||a?.sandbox?{...a?.sandbox,...o.sandbox}:void 0;if(l?.src){const c=eZ(l,e.config,s);c&&r.push(c)}}}return t.length===0&&r.length===0||(n.children=[...n.children,...t,...r]),n}function nZ(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];e.frame&&!t("frame")&&r.push(new B.Tag("meta",{"data-field":"frame",content:String(e.frame)}));for(const i of H9){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function rZ(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];for(const i of G9){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function iZ(n,e){if(!B.Tag.isTag(n))return n;const t=i=>n.children.some(s=>B.Tag.isTag(s)&&s.name==="meta"&&s.attributes["data-field"]===i),r=[];e.substrate&&!t("substrate")&&r.push(new B.Tag("meta",{"data-field":"substrate",content:String(e.substrate)}));for(const i of K9){const s=e[i];s!=null&&s!==""&&!t(i)&&r.push(new B.Tag("meta",{"data-field":i,content:String(s)}))}return r.length===0||(n.children=[...n.children,...r]),n}function Xe(n){const e={};n.base&&Object.assign(e,n.base),n.attributes&&Object.assign(e,n.attributes);const{available:t}=j9({posture:n.universalAttributes,structure:{...n.sections&&{sections:n.sections},...n.mediaSlots&&{mediaSlots:n.mediaSlots},...n.frameTarget&&{frameTarget:n.frameTarget},...n.provides&&{provides:n.provides}},declaredAttributes:Object.keys(e)});for(const[s,o]of Object.entries(U9))t.has(s)&&(e[s]=o);n.deferBody&&(e["__deferred-body"]={type:String,required:!1});const r=n.deprecations;if(r){for(const[s,o]of Object.entries(r))if(!e[s]){const a=e[o.newName];e[s]={type:a?.type??String,required:!1,deprecated:!0}}}const i={attributes:e,...n.selfClosing!=null&&{selfClosing:n.selfClosing},transform:(s,o)=>{if(r){for(const[p,v]of Object.entries(r))if(s.attributes[p]!==void 0&&s.attributes[v.newName]===void 0){const O=v.transform?v.transform(s.attributes[p],s.attributes):s.attributes[p];O!==void 0&&(s.attributes[v.newName]=O)}}const a=s.transformAttributes(o),l=typeof n.contentModel=="function"?n.contentModel(a):n.contentModel,{content:c,tintNode:u,bgNode:f}=R8(s.children,l,a),d=n.transform(c,a,o,s),h={tintNode:u,bgNode:f,tint:a.tint,"tint-mode":a["tint-mode"],bg:a.bg,config:o},m=tZ(J9(d,h),h);return B.Tag.isTag(m)&&(a.width&&(m.attributes.width=a.width),a.spacing&&(m.attributes.spacing=a.spacing),a.inset&&(m.attributes.inset=a.inset),a.elevation&&(m.attributes.elevation=a.elevation),a.prominence&&(m.attributes.prominence=a.prominence),a.reveal&&(m.attributes.reveal=a.reveal),a.stagger&&(m.attributes.stagger=a.stagger),a.reading&&(m.attributes.reading=a.reading),a.dropcap&&(m.attributes.dropcap=a.dropcap)),rZ(iZ(nZ(m,a),a),a)}};return r&&(i.validate=s=>{const o=[];for(const[a,l]of Object.entries(r))s.attributes[a]!==void 0&&o.push({id:"deprecated-attribute",level:"warning",message:`Attribute "${a}" is deprecated. Use "${l.newName}" instead.`});return o}),n.deferBody&&(i.deferBody=!0),Y9.set(i,n.contentModel),Eg.set(i,{...n.sections&&{sections:n.sections},...n.mediaSlots&&{mediaSlots:n.mediaSlots},...n.frameTarget&&{frameTarget:n.frameTarget},universalAttributes:n.universalAttributes??"auto",...n.provides&&{provides:n.provides}}),n.base&&N8.set(i,n.base),i}const{Tag:Hu}=B,sZ=Xe({attributes:{type:{type:String},tag:{type:String},lines:{type:Array},error:{type:Object}},contentModel:{type:"sequence",fields:[]},transform(n,e){const t=e.error,r=new Hu("td",{},[t.id]),i=new Hu("td",{},[e.tag]),s=new Hu("td",{},[t.level]),o=new Hu("td",{},[t.message]);return Me({rune:"error",tag:"tr",property:"error",properties:{code:r,tag:i,level:s,message:o},children:[i,r,s,o]})}});class oZ{validate(e,t,r){return typeof e!="string"?[{id:"attribute-type-invalid",level:"critical",message:`Attribute '${r}' is not a string`}]:[]}}class aZ extends oZ{transform(e){return e?e.split(" ").map(t=>t.trim()):[]}}const{Tag:lZ}=B,cZ=["row","column","dense","row dense","column dense"];function uZ(n,e){return!n||n.length===0?e.map(t=>({colspan:1,rowspan:void 0,children:t})):n.map((t,r)=>{const[i,s]=t.split(":");return{colspan:parseInt(i),rowspan:s?parseInt(s):void 0,children:e[r]}}).filter(t=>t.children!==void 0)}function fZ(n){const e=n.items.map(({children:r,colspan:i,rowspan:s})=>r.wrap("div",{"data-colspan":i,"data-rowspan":s}).toArray()).flat(),t={"data-layout":"grid","data-columns":n.columns,"data-rows":n.rows,"data-flow":n.flow};return new lZ("div",t,e)}const{Tag:qs}=B,dZ=["columns","auto","masonry"],hZ=Xe({attributes:{columns:{type:Number,required:!1,description:"Number of grid columns"},rows:{type:Number,required:!1,description:"Number of grid rows"},flow:{type:String,required:!1,matches:cZ.slice(),description:"Direction items fill the grid"},spans:{type:aZ,required:!1,description:"Column span widths for each cell (space-separated)"},ratio:{type:String,required:!1,description:'Column width ratio (e.g. "2 1 1")'},gap:{type:String,required:!1,matches:["none","tight","default","loose"],description:"Space between grid cells"},valign:{type:String,required:!1,matches:["top","center","bottom","stretch","baseline"],description:"Vertical alignment of cell content"},collapse:{type:String,required:!1,matches:["sm","md","lg","never"],description:"Breakpoint at which grid collapses to a single column"},mode:{type:String,required:!1,matches:["columns","auto","masonry"],default:"columns",description:"Grid sizing: fixed columns, auto-fit, or masonry"},min:{type:String,required:!1,description:"Minimum cell width for auto-fit mode"},aspect:{type:String,required:!1,description:"Aspect ratio for grid cells"},stack:{type:String,required:!1,matches:["natural","reverse"],description:"Stacking order when collapsed"}},contentModel:{type:"delimited",delimiter:"hr",dynamicZones:!0,zoneModel:{type:"sequence",fields:[{name:"content",match:"any",greedy:!0,optional:!0}]}},deprecations:{layout:{newName:"spans",transform:(n,e)=>{if(typeof n=="string"&&dZ.includes(n)){e.mode=n;return}return n}}},transform(n,e,t){const i=(n.zones??[]).map(p=>new Re(B.transform(nt(p.content),t))),s=fZ({items:uZ(e.spans,i),rows:e.rows,columns:e.columns,flow:e.flow}),o=e.ratio?new qs("meta",{content:e.ratio}):void 0,a=e.gap&&e.gap!=="default"?new qs("meta",{content:e.gap}):void 0,l=e.valign?new qs("meta",{content:e.valign}):void 0,c=e.collapse?new qs("meta",{content:e.collapse}):void 0,u=e.mode&&e.mode!=="columns"?new qs("meta",{content:e.mode}):void 0,f=e.min?new qs("meta",{content:e.min}):void 0,d=e.aspect?new qs("meta",{content:e.aspect}):void 0,h=e.stack?new qs("meta",{content:e.stack}):void 0,m=[o,a,l,c,u,f,d,h].filter(Boolean);return Me({rune:"grid",tag:"section",children:[...m,s],properties:{...u?{mode:u}:{},ratio:o,gap:a,valign:l,collapse:c,...f?{min:f}:{},...d?{aspect:d}:{},...h?{stack:h}:{}},refs:{cell:new Re(s.children).tag("div")}})}}),{Tag:Dl}=B,pZ={js:"JavaScript",ts:"TypeScript",py:"Python",rb:"Ruby",rs:"Rust",go:"Go",sh:"Shell",bash:"Bash",zsh:"Zsh",shell:"Shell",html:"HTML",css:"CSS",json:"JSON",yaml:"YAML",sql:"SQL",swift:"Swift",kt:"Kotlin",java:"Java",cpp:"C++",c:"C",cs:"C#",php:"PHP"};function mZ(n){return pZ[n]||n.charAt(0).toUpperCase()+n.slice(1)}function gZ(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function vZ(n,e){if(!n)return"";const t=gZ(n);return t?e?`${t}:${e}`:t:""}const OZ=["scroll","wrap","hide"],gT={topbar:"header"},bZ=Xe({sections:gT,attributes:{title:{type:String,required:!1,description:"Title displayed above the code group"},labels:{type:String,required:!1,description:"Comma-separated custom tab labels"},overflow:{type:String,required:!1,matches:OZ.slice(),description:"How overflowing code is handled"}},contentModel:{type:"sequence",fields:[{name:"panels",match:"fence",greedy:!0}]},transform(n,e,t){const r=e.labels?.split(",").map(p=>p.trim())??[],i={},s=[];if(e.title!==void 0){const p=new Dl("meta",{content:e.title});i.title=p,s.push(p)}const o=e.overflow;if(o&&o!=="scroll"){const p=new Dl("meta",{content:o});i.overflow=p,s.push(p)}const a=nt(n.panels);if(a.length===1&&r.length===0){const p=B.transform(a[0],t);return s.push(p),Me({rune:"code-group",tag:"section",properties:i,refs:{},children:s})}const c=[],u=[];for(const p of a){const v=p.attributes.language||"shell",O=typeof p.attributes.label=="string"?p.attributes.label:"",b=vZ(typeof p.attributes.source=="string"?p.attributes.source:void 0,typeof p.attributes.lines=="string"?p.attributes.lines:void 0),w=r[c.length]||O||b||mZ(v),S=new Dl("span",{},[w]);c.push(new Dl("button",{"data-name":"tab",role:"tab"},[S]));const _=B.transform(p,t);u.push(new Dl("div",{role:"tabpanel"},[_]))}const f=new Re(c),d=new Re(u),h=f.wrap("div",{role:"tablist"}),m=d.wrap("div");return s.push(h.next(),m.next()),Me({rune:"code-group",tag:"section",properties:i,refs:{tabs:h,panels:m,panel:d},children:s})}}),yZ=Xe({attributes:{path:{type:String,required:!0,description:"Path to the source file, relative to the project root. Rejected if it escapes the root."},lines:{type:String,required:!1,description:'Line range. Formats: "10-25", "10-" (to EOF), "-20" (from start), "10" (single line). 1-indexed, inclusive.'},lang:{type:String,required:!1,description:"Syntax-highlighting language hint. Overrides the extension-based inference."},linenumbers:{type:Boolean,required:!1,description:'Show line numbers in the gutter. Starting number derives from the `lines` range start (e.g. lines="74-125" → first line is 74), so numbers reflect the file\'s real offsets. WORK-304.'},highlight:{type:String,required:!1,description:'Range(s) to emphasize without cropping — Shiki-style format: "74-78", "74-78,82,90-92". Indices are file coordinates (same frame as `lines=`). Use this when you want full context visible but want to draw the eye to specific lines. WORK-304.'}},contentModel:{type:"sequence",fields:[]},transform(n,e){throw new Error("snippet rune reached the transform phase — its preprocess hook was not wired through. Ensure the content pipeline runs registered `preprocess` hooks before `Markdoc.transform` (snippet pre-resolves to a Markdoc `fence` node; see SPEC-062 § Composition).")}}),wZ=Xe({attributes:{src:{type:String,required:!0,description:"Path to the source file, relative to the project root (sandboxed)."},format:{type:String,required:!1,matches:["csv","tsv","json","ndjson"],description:"Source format. Inferred from the file extension; override for ambiguity."},delimiter:{type:String,required:!1,description:"Override the field separator (CSV/TSV)."},header:{type:Boolean,required:!1,description:"Whether the first row is the header (default true). false synthesizes col1…"},root:{type:String,required:!1,description:"JSON: dotted path / JSON Pointer to the array or map within the document."},orient:{type:String,required:!1,matches:["records","values","index"],description:"JSON: how each element maps to a row. records/values auto-detected; index is explicit."},"key-column":{type:String,required:!1,description:"JSON: when orient=index, the header for the synthesized key column."},columns:{type:String,required:!1,description:`Select + order + rename: "name as Product, revenue as 'Revenue ($)'".`},where:{type:String,required:!1,description:"Filter rows with the field:value grammar (SPEC-070)."},sort:{type:String,required:!1,description:'Sort by a column; "-" prefix for descending.'},limit:{type:Number,required:!1,description:"Maximum number of rows."},offset:{type:Number,required:!1,description:"Skip this many rows before limiting."},numeric:{type:String,required:!1,description:"Comma-separated columns to force to numeric typing (emits data-value)."},text:{type:String,required:!1,description:"Comma-separated columns to force to text typing."}},contentModel:{type:"sequence",fields:[]},transform(n,e){throw new Error("data rune reached the transform phase — its preprocess hook was not wired through. Ensure the content pipeline runs registered `preprocess` hooks before `Markdoc.transform` (data pre-resolves to a Markdoc `table` node; see SPEC-103 § Architecture).")}}),{Tag:_Z}=B,kZ=["caution","check","note","warning"],vT={header:"header"},xZ=Xe({sections:vT,attributes:{type:{type:String,matches:kZ.slice(),errorLevel:"critical",description:"Visual style: caution, check, note, or warning"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new _Z("meta",{content:e.type??"note"}),s=new Re(B.transform(nt(n.body),t)).wrap("div");return Me({rune:"hint",tag:"section",property:"contentSection",properties:{hintType:r},refs:{body:s.tag("div")},children:[r,s.next()]})}}),OT={"media-position":{type:String,required:!1,matches:["top","bottom","start","end","cover"],description:"Where the media zone sits relative to the content: above (top), below (bottom), or beside (start/end)"},"media-ratio":{type:String,required:!1,matches:["1/3","2/5","1/2","3/5","2/3"],description:"Media zone’s share of the row width when media is beside content (start/end)"},valign:{type:String,required:!1,matches:["top","center","bottom","stretch"],description:"Cross-axis alignment when media is beside content (start/end); applies to the shorter zone"},collapse:{type:String,required:!1,matches:["sm","md","lg","never"],description:"Breakpoint at which side-by-side layouts collapse to a single stacked column"}};I8(OT,{name:"split layout",description:"Layout controls shared by media+content runes — `media-position`, `media-ratio`, `valign`, `collapse`."});const SZ=OT;Xe({contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=n.body?Array.isArray(n.body)?n.body:[n.body]:[],i=new Re(B.transform(r,{...t,nodes:{...t.nodes,text:{transform(s){return new B.Tag("span",{},[s.attributes.content])}}}}));return new B.Tag("li",{},i.toArray())}});function AZ(n){const e=n["media-position"]||"top",t=n["media-ratio"],r=n.valign,i=n.collapse,s=e==="start"||e==="end",o=new B.Tag("meta",{content:e}),a=s&&t?new B.Tag("meta",{content:t}):void 0,l=s&&r?new B.Tag("meta",{content:r}):void 0,c=i?new B.Tag("meta",{content:i}):void 0,u=[o];return a&&u.push(a),l&&u.push(l),c&&u.push(c),{metas:{mediaPosition:o,mediaRatio:a,valign:l,collapse:c},children:u}}function CZ(n){const e=[[]];for(const t of n)t.type==="hr"?e.push([]):e[e.length-1].push(t);return e.length===1?{media:[],body:e[0],footer:[]}:e.length===2?{media:e[0],body:e[1],footer:[]}:{media:e[0],body:e.slice(1,-1).flat(),footer:e[e.length-1]}}function bT(n){return B.Tag.isTag(n)&&n.name==="svg"&&/\b(rf-placeholder|rf-icon)\b/.test(String(n.attributes?.class??""))}function Xc(n){return B.Tag.isTag(n)&&(n.name==="img"||n.name==="video"||bT(n))}function TZ(n){for(const e of n.toArray()){if(Xc(e))return e;if(B.Tag.isTag(e)&&e.name==="p"){const t=e.children.find(r=>Xc(r));if(t)return t}}}function PZ(n){return n.map(e=>B.Tag.isTag(e)&&e.name==="p"&&e.children.length===1&&B.Tag.isTag(e.children[0])&&(e.children[0].name==="img"||e.children[0].attributes?.["data-rune"]||bT(e.children[0]))?e.children[0]:e)}function Sl(n){const e=n.nodes,t=c=>B.Tag.isTag(c)&&/^h[1-6]$/.test(c.name),r=c=>B.Tag.isTag(c)&&c.name==="p",i=e.findIndex(t);if(i===-1)return{eyebrow:void 0,headline:void 0,image:n.tag("img").limit(1),blurb:e.find(r)};const s=e.slice(0,i).findIndex(r);let o,a;if(s!==-1)o=e[s],a=i;else{const c=e.findIndex((u,f)=>f>i&&t(u));c!==-1?(o=e[i],a=c):(o=void 0,a=i)}const l=e.findIndex((c,u)=>u>a&&r(c));return{eyebrow:o,headline:e[a],image:n.tag("img").limit(1),blurb:l!==-1?e[l]:void 0}}const{Ast:yT,Tag:EZ}=B,$Z=Xe({attributes:{name:{type:String,required:!0},image:{type:String,required:!1}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){let r=new Re([]);e.image&&(r=r.concat(B.transform(new yT.Node("image",{src:e.image}),t))),r=r.concat(new EZ("span",{},[e.name??""]));const i=new Re(B.transform(nt(n.body),t)),s=r.tag("span"),o=r.tag("svg");return[Me({rune:"tab",tag:"button",properties:{image:o},refs:{name:s},children:r.toArray()}),Me({rune:"tab-panel",tag:"div",properties:{},children:i.toArray()})]}});function QZ(n){const e=ib()(n),t=e.length-1;if(!e[t]||e[t].type!=="list")return n;const r=e[t].children.map(i=>{const s=i.children[0],o=Array.from(s.walk()).find(l=>l.type==="image"),a=Array.from(s.walk()).filter(l=>l.type==="text").map(l=>l.attributes.content);return new yT.Node("tag",{name:a,image:o?o.attributes.src:void 0},i.children.slice(1),"tab")});return e.splice(t,1,...r),e}const wT={preamble:"preamble",headline:"title",blurb:"description"},LZ=Xe({sections:wT,attributes:{},contentModel:()=>({type:"custom",processChildren:n=>QZ(n),description:"Converts headings at the specified level to tab tags, extracting tab name and optional image from heading content."}),transform(n,e,t){const r=nt(n.children),i=[],s=[];for(const h of r)h.type==="tag"&&h.tag==="tab"?s.push(h):(h.type==="heading"||h.type==="paragraph")&&i.push(h);const o=new Re(B.transform(i,t)),a=new Re(B.transform(s,t)),l=a.tag("button").typeof("Tab"),c=a.tag("div").typeof("TabPanel"),u=l.wrap("div",{role:"tablist"}),f=c.wrap("div"),d=o.count()>0?[o.wrap("header").next(),u.next(),f.next()]:[u.next(),f.next()];return Me({rune:"tab-group",tag:"section",class:e.class,property:"contentSection",properties:{},refs:{...Sl(o),tabs:u,panels:f},children:d})}}),_T="__nav-auto",kT="auto";function sb(n){return B.Tag.isTag(n)&&(n.name==="ul"||n.name==="ol")}const MZ=Xe({contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),{...t,nodes:{...t.nodes,text:{transform(v){return new B.Tag("span",{"data-field":"slug"},[v.attributes.content])}}}})),i=r.tag("a").toArray(),s=r.tag("span"),o=r.tag("ul"),a=r.toArray().filter(v=>B.Tag.isTag(v)&&v.attributes?.["data-rune"]==="badge"),l=r.tag("p").toArray(),c=[],u=[];for(const v of l)v.children.some(b=>B.Tag.isTag(b)&&b.name==="a")?c.push(v):u.push(v);const f=c.flatMap(v=>v.children.filter(O=>B.Tag.isTag(O)&&O.name==="a")),d=[...i,...f],h=u.flatMap(v=>v.children),m=h.length>0?new B.Tag("span",{"data-name":"description",class:"rf-nav-item__description"},h):void 0;if(d.length>0){const v=m?d.map(b=>({...b,children:[...b.children??[],m]})):d,O=[];if(a.length>0){for(const b of a)b.attributes["data-name"]="badge";O.push(...a)}return Me({rune:"nav-item",tag:"li",properties:m?{description:m}:{},children:[...v,...O]})}const p=[];if(s.count()>0&&p.push(...s.toArray()),m&&p.push(m),a.length>0){for(const v of a)v.attributes["data-name"]="badge";p.push(...a)}return o.count()>0&&p.push(...o.toArray()),Me({rune:"nav-item",tag:"li",properties:{slug:s,...m?{description:m}:{},children:o.count()>0?o.flatten().tag("li"):void 0},children:p})}});function qZ(n){const e=[],t=[];let r=null;const i=()=>{r&&(t.push(r),r=null)};for(const s of n){if(B.Tag.isTag(s)&&/^h[1-6]$/.test(s.name)){i(),r={kind:"group",heading:s,children:[]};continue}if(B.Tag.isTag(s)&&s.name==="hr"){r&&i(),t.push({kind:"column-break"});continue}if(!r){B.Tag.isTag(s)&&sb(s)&&e.push(...s.children.filter(o=>B.Tag.isTag(o)&&o.name==="li"));continue}r.children.push(s)}return i(),{topLevel:e,sequence:t}}function RZ(n){const e=u=>B.Tag.isTag(u)?u.name==="ul"||u.name==="ol"?!0:!!u.attributes?.["data-rune"]:!1,t=u=>B.Tag.isTag(u)&&!e(u);let r=-1,i=-1;n.forEach((u,f)=>{e(u)&&(r===-1&&(r=f),i=f)});let s,o;if(r!==-1){for(let u=0;u<r;u++)if(t(n[u])){s=u;break}for(let u=n.length-1;u>i;u--)if(t(n[u])){o=u;break}}else{const u=[];n.forEach((f,d)=>{t(f)&&u.push(d)}),u.length===1?s=u[0]:u.length>=2&&(s=u[0],o=u[u.length-1])}const a=s!==void 0?n[s]:void 0,l=o!==void 0?n[o]:void 0,c=[];return n.forEach((u,f)=>{f===s||f===o||c.push(u)}),{intro:a,body:c,footer:l}}function DZ(n){const{intro:e,body:t,footer:r}=RZ(n.children),i=[];for(const a of t)B.Tag.isTag(a)&&sb(a)&&i.push(...a.children.filter(l=>B.Tag.isTag(l)&&l.name==="li"));const s=[];e&&s.push(new B.Tag("div",{"data-name":"intro"},[e])),s.push(...t),r&&s.push(new B.Tag("div",{"data-name":"footer"},[r]));const o=[n.heading];return s.length>0&&o.push(new B.Tag("div",{"data-name":"panel"},s)),Me({rune:"nav-group",tag:"section",properties:{title:n.heading,item:i},children:o})}function IZ(n){const e=[];let t=[];for(const r of n)r.kind==="column-break"?(t.length>0&&e.push(t),t=[]):t.push(r);return t.length>0&&e.push(t),e}const NZ=Xe({attributes:{ordered:{type:Boolean,required:!1,description:"Use numbered list for navigation items"},auto:{type:Boolean,required:!1,description:"Automatically generate from child pages"},layout:{type:String,required:!1,matches:["vertical","menubar","columns","cards","strip"],description:"Presentation layout: sidebar (vertical), horizontal menubar (header), column grid (footer), cards (section landing), or strip (compact secondary nav). Defaults to vertical."},collapsible:{type:Boolean,required:!1,description:"Make each group collapsible. The group containing the current page auto-expands; others start collapsed. Only meaningful for vertical layout."},defaultOpen:{type:String,required:!1,description:"Comma-separated group titles to expand by default, overriding the URL-driven auto-open behaviour."}},contentModel:{type:"custom",processChildren:n=>ib({level:1})(n),description:"Top-level (#) headings become nav groups; the list directly under each heading becomes the group's items. Items are page slugs — wrap in markdown links to set custom labels, or use plain text to resolve the page title. Without headings, a single list becomes a flat nav."},transform(n,e,t){const r=!!e.collapsible,i=t.variables?.__sourcePath,s=v=>{if(e.layout&&(v.attributes.layout=e.layout),i&&(v.attributes["data-source-path"]=i),e.auto&&(v.attributes["data-auto"]="true"),r){v.attributes["data-collapsible"]="true";const O=v.attributes.class??"";v.attributes.class=[O,"rf-nav--collapsible"].filter(Boolean).join(" "),typeof e.defaultOpen=="string"&&e.defaultOpen.trim()&&(v.attributes["data-default-open"]=e.defaultOpen.trim())}return v},o=v=>e.layout==="menubar"?[new B.Tag("button",{"data-name":"trigger",type:"button","aria-label":"Toggle navigation","aria-expanded":"false"},[]),...v]:v;if(e.auto){const v=new B.Tag("meta",{"data-field":_T,content:"true"});return s(Me({rune:"nav",tag:"nav",properties:{group:[],item:[]},children:o([v])}))}const a=new Re(B.transform(nt(n.children),{...t,nodes:{...t.nodes,item:MZ,list:{transform(v,O){return new B.Tag("ul",{},v.transformChildren(O))}}}}));if(e.layout==="strip"){const v=a.flatten().tag("li");return s(Me({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:v},children:a.toArray()}))}const{topLevel:l,sequence:c}=qZ(a.toArray()),u=c.filter(v=>v.kind==="group"),f=u.length>0,d=c.some(v=>v.kind==="column-break");if(!f){if(e.layout==="columns"&&d){const O=[];let b=[];const w=()=>{b.length>0&&(O.push([new B.Tag("ul",{},b)]),b=[])};for(const x of a.toArray()){if(B.Tag.isTag(x)&&x.name==="hr"){w();continue}B.Tag.isTag(x)&&sb(x)&&b.push(...x.children.filter(A=>B.Tag.isTag(A)&&A.name==="li"))}w();const S=O.map(x=>new B.Tag("div",{"data-name":"column"},x)),_=a.flatten().tag("li");return s(Me({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:_},children:o(S)}))}const v=a.flatten().tag("li");return s(Me({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:[],item:v},children:o(a.toArray())}))}const h=u.map(DZ);if(r)for(const v of h)v.attributes["data-collapsed"]=kT;const m=l.length>0?new B.Tag("div",{"data-name":"top-level"},[new B.Tag("ul",{},l)]):null,p=h.flatMap(v=>{const O=[],b=w=>{if(B.Tag.isTag(w)){if(w.name==="li"){O.push(w);return}for(const S of w.children)b(S)}};for(const w of v.children)b(w);return O});if(e.layout==="columns"&&d){const v=IZ(c),O=new Map(u.map((w,S)=>[w,h[S]])),b=v.map(w=>new B.Tag("div",{"data-name":"column"},w.map(S=>O.get(S)).filter(Boolean)));return s(Me({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:h,item:[...l,...p]},children:o(m?[m,...b]:b)}))}return s(Me({rune:"nav",tag:"nav",class:e.ordered?"ordered":void 0,properties:{group:h,item:[...l,...p]},children:o(m?[m,...h]:h)}))}}),{Tag:BZ}=B,jZ=["replace","prepend","append"],zZ=Xe({attributes:{name:{type:String,required:!0,description:"Name of the layout region to fill"},mode:{type:String,required:!1,matches:jZ.slice(),errorLevel:"critical",default:"replace",description:"How content is placed: replace, prepend, or append"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",greedy:!0,optional:!0}]},transform(n,e,t){const r=B.transform(nt(n.body),t);return new BZ("div",{"data-region":e.name,"data-mode":e.mode},r)}}),{Tag:ZZ}=B,FZ=Xe({attributes:{extends:{type:String,required:!1,default:"parent",description:"Layout inheritance: parent or none"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",greedy:!0,optional:!0}]},transform(n,e,t){const r=B.transform(nt(n.body),t);return new ZZ("div",{"data-layout-def":!0,"data-extends":e.extends},r)}}),{Tag:XZ}=B,VZ=Xe({attributes:{summary:{type:String,required:!1,description:"Clickable summary text shown when collapsed"},open:{type:Boolean,required:!1,description:"Expand the details section by default"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=e.summary||"Details",s=new XZ("summary",{},[i]),o=r.wrap("div"),a=Me({rune:"details",tag:"details",properties:{summary:s},refs:{body:o.tag("div")},children:[s,o.next()]});return e.open&&(a.attributes.open=!0),a}}),{Tag:po}=B,$g="data-drawer-title-auto",WZ=["right","left","top","bottom"],YZ=["sm","md","lg"];function UZ(n){const e=n.findIndex(t=>t.type==="hr");return e<0?{body:n,footer:null}:{body:n.slice(0,e),footer:n.slice(e+1)}}const xT={header:"header",body:"body",footer:"footer"},GZ=Xe({sections:xT,provides:["prose"],attributes:{id:{type:String,required:!0,description:'Stable id for the drawer. Used in entity registration and as the `id="drawer-{value}"` on the rendered element so xref triggers can target it via fragment.'},title:{type:String,required:!1,description:"Panel heading text. Rendered in the drawer header (or as a heading in the no-JS in-flow rendering)."},headingLevel:{type:Number,required:!1,description:"Heading level (1-6) for the title. When omitted, the level is auto-detected from outline position (one deeper than the nearest preceding heading). Out-of-range values are clamped to the 1-6 range."},shortcut:{type:String,required:!1,description:'Keyboard shortcut that opens the drawer when behaviors are loaded (e.g. ".", "cmd+k"). Surfaces as `data-shortcut`; the progressive-enhancement layer wires the listener.'},side:{type:String,required:!1,matches:WZ.slice(),description:'Edge the panel slides from when enhanced. Defaults to "right".'},size:{type:String,required:!1,matches:YZ.slice(),description:'Panel size. "sm" / "md" (default) / "lg" — width for left/right sides, height for top/bottom.'}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.id,i=e.title,s=e.side??"right",o=e.size??"md",a=typeof e.headingLevel=="number"?Math.min(6,Math.max(1,Math.trunc(e.headingLevel))):void 0,l=i?a?new po(`h${a}`,{},[i]):new po("h3",{[$g]:"true"},[i]):void 0,c=new po("button",{type:"button","aria-label":"Close",hidden:!0},["×"]),u=[];l&&u.push(l),u.push(c);const f=new po("header",{},u),d=UZ(nt(n.body)),h=new Re(B.transform(d.body,t)).wrap("div"),m=d.footer!==null?new Re(B.transform(d.footer,t)).wrap("footer"):null,p={side:new po("meta",{content:s}),size:new po("meta",{content:o})};e.shortcut&&(p.shortcut=new po("meta",{content:e.shortcut}));const v=Me({rune:"drawer",tag:"section",id:`drawer-${r}`,properties:p,refs:{header:f,...l?{title:l}:{},close:c,body:h.tag("div"),...m?{footer:m.tag("footer")}:{}},children:[...Object.values(p),f,h.next(),...m?[m.next()]:[]]});return v.attributes["data-drawer-id"]=r,v}}),{Tag:Ku}=B,HZ=["small","medium","large","full"],KZ=["left","center","right"],ST={caption:"description"},AT="self",JZ=Xe({sections:ST,frameTarget:AT,attributes:{size:{type:String,required:!1,matches:HZ.slice(),description:"Display width of the figure"},align:{type:String,required:!1,matches:KZ.slice(),description:"Horizontal alignment of the figure"},caption:{type:String,required:!1,description:"Caption text displayed below the figure"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=r.flatten().toArray().filter(f=>Xc(f)),s=r.tag("p").toArray().filter(f=>{const d=(f.children||[]).filter(h=>B.Tag.isTag(h));return!(d.length===1&&Xc(d[0]))}),o=e.caption||void 0,a=o?new Ku("figcaption",{},[o]):s.length>0?new Ku("figcaption",{},[s[0]]):void 0,l=e.size?new Ku("meta",{content:e.size}):void 0,c=e.align?new Ku("meta",{content:e.align}):void 0,u=[...i];return a&&u.push(a),l&&u.push(l),c&&u.push(c),Me({rune:"figure",schemaOrgType:"ImageObject",tag:"figure",properties:{...l?{size:l}:{},...c?{align:c}:{}},refs:{...a?{caption:a}:{}},schema:{...i.length>0?{contentUrl:i[0]}:{},...a?{caption:a}:{}},children:u})}}),dw={grid:"grid",carousel:"carousel"};function eF(n,...e){return[...n,...e]}const{Tag:mo}=B,tF=Xe({attributes:{layout:{type:String,required:!1,matches:eF([dw.grid,dw.carousel],"masonry"),description:"Arrangement of images in the gallery"},columns:{type:Number,required:!1,description:"Number of columns in grid layout"},lightbox:{type:Boolean,required:!1,description:"Allow clicking images to view full-size"},caption:{type:String,required:!1,description:"Caption text displayed below the gallery"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=e.layout??"grid",s=e.columns??3,o=e.lightbox??!0,a=e.caption??"",c=r.flatten().toArray().filter(O=>Xc(O)).map(O=>{const b=O.attributes?.alt||O.attributes?.["aria-label"]||"",w=[O];return b&&w.push(new mo("figcaption",{},[b])),new mo("figure",{"data-name":"item"},w)}),u=new mo("meta",{content:i}),f=new mo("meta",{content:String(o)}),d=s!==3?new mo("meta",{content:String(s)}):void 0,h=a?new mo("figcaption",{},[a]):void 0,m=new mo("div",{"data-name":"items"},c),v=[...[u,f,d].filter(Boolean),m];return h&&v.push(h),Me({rune:"gallery",schemaOrgType:"ImageGallery",tag:"figure",properties:{layout:u,lightbox:f,...d?{columns:d}:{},...h?{caption:h}:{}},children:v})}}),{Tag:zp}=B,CT={body:"body"},nF=Xe({sections:CT,provides:["prose"],attributes:{name:{type:String,required:!0}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new zp("summary",{},[e.name??""]),i=new Re(B.transform(nt(n.body),t)).wrap("div"),s=i.tag("div");for(const o of s.nodes)zp.isTag(o)&&(o.attributes.typeof="Answer",o.children=[new zp("div",{property:"text"},o.children)]);return Me({rune:"accordion-item",schemaOrgType:"Question",tag:"details",properties:{name:r},refs:{body:s},schema:{name:r,acceptedAnswer:s},children:[r,i.next()]})}}),TT={preamble:"preamble",headline:"title",blurb:"description"},rF=Xe({sections:TT,attributes:{multiple:{type:Boolean,required:!1,description:"Allow multiple panels to be open at once"}},contentModel:()=>({type:"sections",sectionHeading:"heading",emitTag:"accordion-item",emitAttributes:{name:"$heading"},fields:[{name:"header",match:"heading|paragraph",optional:!0,greedy:!0},{name:"items",match:"tag",optional:!0,greedy:!0}],sectionModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]}}),transform(n,e,t){const r=new Re(B.transform(nt(n.header),t)),i=[...nt(n.items),...nt(n.sections)],o=new Re(B.transform(i,t)).tag("details").typeof("AccordionItem"),a=o.wrap("div"),l=r.count()>0?[r.wrap("header").next(),a.next()]:[a.next()];return Me({rune:"accordion",schemaOrgType:"FAQPage",tag:"section",property:"contentSection",properties:{item:o},refs:{...Sl(r),items:a},schema:{mainEntity:o},children:l})}}),{Tag:Il}=B,iF=Xe({attributes:{depth:{type:Number,required:!1,default:3,description:"Maximum heading depth to include"},ordered:{type:Boolean,required:!1,default:!1,description:"Use numbered list instead of bullets"}},contentModel:{type:"sequence",fields:[]},transform(n,e,t){const r=t.variables?.headings||[],i=e.depth+1,o=r.filter(u=>u.level>=2&&u.level<=i).map(u=>new Il("li",{"data-level":u.level},[new Il("a",{href:`#${u.id}`},[u.text])])),a=new Il("ul",{},o),l=new Il("meta",{content:e.depth}),c=new Il("meta",{content:e.ordered});return Me({rune:"table-of-contents",tag:"nav",properties:{depth:l,ordered:c},refs:{list:a},children:[l,c,a]})}}),{Tag:ca}=B,sF=["16:9","4:3","1:1","auto"];function oF(n){try{const e=new URL(n),t=e.hostname.replace("www.","");if(t==="youtube.com"||t==="youtu.be"){let r="";return t==="youtu.be"?r=e.pathname.slice(1):r=e.searchParams.get("v")||"",{provider:"youtube",embedUrl:r?`https://www.youtube-nocookie.com/embed/${r}`:n,type:"video"}}if(t==="vimeo.com")return{provider:"vimeo",embedUrl:`https://player.vimeo.com/video/${e.pathname.slice(1)}`,type:"video"};if(t==="twitter.com"||t==="x.com")return{provider:"twitter",embedUrl:n,type:"tweet"};if(t==="codepen.io")return{provider:"codepen",embedUrl:n.replace("/pen/","/embed/"),type:"codepen"};if(t==="open.spotify.com")return{provider:"spotify",embedUrl:n.replace("open.spotify.com/","open.spotify.com/embed/"),type:"spotify"}}catch{}return{provider:"generic",embedUrl:n,type:"generic"}}const aF=Xe({attributes:{url:{type:String,required:!0,description:"URL of the content to embed"},type:{type:String,required:!1,description:"Override auto-detected embed type"},aspect:{type:String,required:!1,matches:sF.slice(),description:"Aspect ratio of the embed frame"},title:{type:String,required:!1,description:"Accessible title for the embed iframe"}},contentModel:{type:"sequence",fields:[{name:"fallback",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.url??"",i=oF(r),s=e.aspect??"16:9",o=e.title||"Embedded content",[a,l]=s.split(":").map(Number),c=l&&a?l/a*100:56.25,u=new ca("meta",{content:r}),f=new ca("meta",{content:e.title??""}),d=new ca("meta",{content:i.embedUrl}),h=new ca("meta",{content:i.provider}),m=new Re(B.transform(nt(n.fallback),t)).wrap("div"),p=m.tag("div"),v=[u,f,d];let O;if(i.embedUrl){const b=new ca("iframe",{src:i.embedUrl,title:o,frameborder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowfullscreen:"",loading:"lazy"},[]);O=new ca("div",{style:`padding-bottom: ${c}%`},[b]),v.push(O)}return v.push(m.next()),Me({rune:"embed",schemaOrgType:"VideoObject",tag:"figure",properties:{provider:h},refs:{...O?{wrapper:O}:{},fallback:p},schema:{name:f,contentUrl:u,embedUrl:d},children:v})}}),{Tag:pi}=B,PT="__breadcrumb-auto",lF=Xe({attributes:{separator:{type:String,required:!1,default:"/",description:"Character between breadcrumb items"},auto:{type:Boolean,required:!1,default:!1,description:"Automatically generate from page hierarchy"}},contentModel:n=>n.auto?{type:"sequence",fields:[]}:{type:"sequence",fields:[{name:"list",match:"list",optional:!0,greedy:!0}]},transform(n,e,t){const r=new pi("meta",{content:e.separator});if(e.auto){const l=new pi("meta",{"data-field":PT,content:"true"}),c=new pi("ol",{},[]);return Me({rune:"breadcrumb",schemaOrgType:"BreadcrumbList",tag:"nav",properties:{separator:r},refs:{items:c},children:[r,l,c]})}const i=new Re(B.transform(nt(n.list),t)),s=[];let o=0;for(const l of i.toArray())if(pi.isTag(l)&&(l.name==="ul"||l.name==="ol")){for(const c of l.children)if(pi.isTag(c)&&c.name==="li"){o++;const u=new pi("meta",{content:o}),f=c.children.find(d=>pi.isTag(d)&&d.name==="a");if(f){const d=new pi("span",{hidden:!0},f.children),h=new pi("a",{href:f.attributes.href},f.children);s.push(Me({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:d,url:h},schema:{name:d,item:h,position:u},children:[d,h,u]}))}else{const d=c.children.filter(m=>typeof m=="string").join("").trim(),h=new pi("span",{},d?[d]:c.children);s.push(Me({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:h},schema:{name:h,position:u},children:[h,u]}))}}}const a=new pi("ol",{},s);return Me({rune:"breadcrumb",schemaOrgType:"BreadcrumbList",tag:"nav",properties:{separator:r},refs:{items:a},schema:{itemListElement:s},children:[r,a]})}}),{Tag:Ni}=B,Qg="__pagination-auto",cF=Xe({attributes:{auto:{type:Boolean,required:!1,default:!1,description:"Derive prev/next from sibling page order"},prev:{type:String,required:!1,description:"Explicit previous page (slug or URL)"},next:{type:String,required:!1,description:"Explicit next page (slug or URL)"},scope:{type:String,required:!1,matches:["siblings","section"],default:"siblings",description:"Auto-mode scope: direct siblings, or all pages in the current top-level section"},"prev-label":{type:String,required:!1,description:"Override label for the previous link"},"next-label":{type:String,required:!1,description:"Override label for the next link"}},contentModel:{type:"sequence",fields:[]},selfClosing:!0,transform(n,e,t){if(e.auto){const i=new Ni("meta",{"data-field":Qg,content:"true"}),s=e.scope?new Ni("meta",{"data-field":"scope",content:String(e.scope)}):null,o=e["prev-label"]?new Ni("meta",{"data-field":"prev-label",content:String(e["prev-label"])}):null,a=e["next-label"]?new Ni("meta",{"data-field":"next-label",content:String(e["next-label"])}):null,l=[i,s,o,a].filter(Boolean);return Me({rune:"pagination",tag:"nav",children:l})}const r=[];if(e.prev){const s=String(e.prev).startsWith("/")||/^[a-z]+:\/\//i.test(String(e.prev))?String(e.prev):`__slug:${e.prev}`,o=e["prev-label"]??String(e.prev);r.push(new Ni("a",{href:s,"data-direction":"prev","data-name":"prev"},[new Ni("span",{"data-name":"marker"},["←"]),new Ni("span",{"data-name":"label"},[o])]))}if(e.next){const s=String(e.next).startsWith("/")||/^[a-z]+:\/\//i.test(String(e.next))?String(e.next):`__slug:${e.next}`,o=e["next-label"]??String(e.next);r.push(new Ni("a",{href:s,"data-direction":"next","data-name":"next"},[new Ni("span",{"data-name":"label"},[o]),new Ni("span",{"data-name":"marker"},["→"])]))}return Me({rune:"pagination",tag:"nav",children:r})}}),{Ast:Lg,Tag:gn}=B,uF=/^(.+)\s*:\s*([€$£¥]?\s*[\d].*)$/;function fF(n){const e=n.replace(/[€$£¥\s]/g,"").replace(/,/g,""),t=e.match(/^([\d.]+)\s*[-–]\s*([\d.]+)/);if(t)return(parseFloat(t[1])+parseFloat(t[2]))/2;const r=parseFloat(e);return isNaN(r)?0:r}const dF={USD:"$",EUR:"€",GBP:"£",JPY:"¥",CNY:"¥",AUD:"A$",CAD:"C$",CHF:"CHF ",SEK:"kr",NOK:"kr",DKK:"kr",INR:"₹",KRW:"₩",BRL:"R$",MXN:"MX$",ZAR:"R"};function hF(n,e,t,r){if(r&&r!=="en"&&t&&/^[A-Za-z]{3}$/.test(t))try{return new Intl.NumberFormat(r,{style:"currency",currency:t.toUpperCase()}).format(n)}catch{}const i=(n%1===0?String(n):n.toFixed(2)).split(".");return i[0]=i[0].replace(/\B(?=(\d{3})+(?!\d))/g,","),e+i.join(".")}function pF(n){let e=0;const t=n.match(/(\d+)\s*day/i),r=n.match(/(\d+)\s*week/i),i=n.match(/(\d+)\s*month/i);if(t&&(e+=parseInt(t[1])),r&&(e+=parseInt(r[1])*7),i&&(e+=parseInt(i[1])*30),e===0){const s=parseInt(n);isNaN(s)||(e=s)}return e}function hw(n,e){try{const t=JSON.parse(String(n.attributes["data-rune-fields"]??"{}"));if(t[e]!==void 0&&t[e]!==null)return String(t[e])}catch{}return""}const mF=/^(.+?)\s*\((?:estimate|est\.?)\)\s*$/i,gF=/^~(.+?)~$/;function vF(n){const e=[];let t=!1;for(const o of n.walk())o.type==="text"&&o.attributes.content&&e.push(o.attributes.content),o.type==="s"&&(t=!0);const r=e.join(" ").trim(),i=r.match(mF);if(i)return{label:i[1].trim(),estimate:!0};const s=r.match(gF);return s?{label:s[1].trim(),estimate:!0}:t?{label:r,estimate:!0}:{label:r,estimate:!1}}const OF=Xe({attributes:{description:{type:String,required:!1,description:"Line item description"},amount:{type:String,required:!1,description:"Line item amount"}},contentModel:{type:"sequence",fields:[]},transform(n,e){const t=new gn("span",{},[e.description??""]),r=new gn("span",{},[e.amount??""]);return Me({rune:"budget-line-item",tag:"li",properties:{description:t,amount:r},children:[t,r]})}});function bF(n){const e=[];for(const t of n)if(t.type==="list")for(const r of t.children){const i=[];for(const a of r.walk())a.type==="text"&&a.attributes.content&&i.push(a.attributes.content);const s=i.join(" ").trim(),o=s.match(uF);o?e.push(new Lg.Node("tag",{description:o[1].trim(),amount:o[2].trim()},[],"budget-line-item")):e.push(new Lg.Node("tag",{description:s,amount:""},[],"budget-line-item"))}else e.push(t);return e}function yF(n){let e=0;for(const t of n)t.type==="tag"&&t.tag==="budget-line-item"&&t.attributes.amount&&(e+=fF(t.attributes.amount));return e}const wF=Xe({attributes:{label:{type:String,required:!0},estimate:{type:Boolean,required:!1}},contentModel:{type:"custom",processChildren:bF,description:'Converts list items into budget-line-item tags with "Description: $Amount" pattern.'},transform(n,e,t){const r=nt(n.children),i=yF(r),s=new Re(B.transform(r,t)),o=new gn("meta",{content:e.label??""}),a=new gn("meta",{content:e.estimate?"estimate":"false"}),l=new gn("meta",{content:String(i)}),c=s.tag("li").typeof("BudgetLineItem"),u=new gn("ul",{},c.toArray());return Me({rune:"budget-category",tag:"div",properties:{label:o,estimate:a,lineItem:c,subtotal:l},refs:{"line-items":u},children:[o,a,l,u]})}}),_F=["detailed","summary"];function kF(n){const e=n,t=e.reduce((l,c,u)=>(c.type==="heading"&&l.push({idx:u,level:c.attributes.level}),l),[]);let r=[],i=e;t.length>=2&&t[0].level<t[1].level&&(r=e.slice(0,t[1].idx),i=e.slice(t[1].idx));const s=ib()(i),o=s.length-1;if(!s[o]||s[o].type!=="list")return n;const a=s[o].children.map(l=>{const c=l.children[0],{label:u,estimate:f}=vF(c);return new Lg.Node("tag",{label:u,estimate:f},l.children.slice(1),"budget-category")});return s.splice(o,1,...a),[...r,...s]}const ET={preamble:"preamble",headline:"title",footer:"footer"},xF=Xe({sections:ET,attributes:{currency:{type:String,required:!1,description:"Currency symbol or code (e.g. USD, EUR)"},duration:{type:String,required:!1,description:'Budget duration for per-day calculations (e.g. "5 days", "1 month")'},showPerDay:{type:Boolean,required:!1,description:"Show per-day cost breakdown"},variant:{type:String,required:!1,matches:_F.slice(),description:"Display style: detailed line items or summary"}},contentModel:{type:"custom",processChildren:kF,description:'Converts headings into budget-category tags with estimate parsing, where list items become budget-line-items with "Description: $Amount" pattern.'},transform(n,e,t){const r=nt(n.children),i=[],s=[];for(const L of r)L.type==="tag"?s.push(L):(L.type==="paragraph"||L.type==="heading")&&i.push(L);const o=new Re(B.transform(i,t)),a=new Re(B.transform(s,t)),l=Sl(o),c=e.currency??"USD",u=e.duration??"",f=e.showPerDay??!0,d=e.variant??"detailed",h=dF[c.toUpperCase()]||c+" ",m=t?.variables?.locale??void 0,p=L=>hF(L,h,c,m),v=new gn("meta",{content:c}),O=new gn("meta",{content:u}),b=new gn("meta",{content:String(f)}),w=new gn("meta",{content:d}),S=a.tag("div").typeof("BudgetCategory"),_=S.toArray();let x=0;for(const L of _){if(!B.Tag.isTag(L))continue;const I=hw(L,"label"),Z=parseFloat(hw(L,"subtotal"))||0;x+=Z;const Y=new gn("div",{class:"rf-budget-category__header"},[new gn("span",{class:"rf-budget-category__label"},[I]),new gn("span",{class:"rf-budget-category__subtotal"},[p(Z)])]);L.children=[Y,...L.children]}const A=new gn("div",{},_),C=u?pF(u):0,y=!!u&&f&&C>0,k=y?x/C:0,P=[new gn("div",{class:"rf-budget__total"},[new gn("span",{class:"rf-budget__total-label","data-i18n":"core.budget.total"},["Total"]),new gn("span",{class:"rf-budget__total-amount"},[p(x)])])];y&&P.push(new gn("div",{class:"rf-budget__per-day"},[new gn("span",{class:"rf-budget__per-day-label","data-i18n":"core.budget.perDay"},["Per day"]),new gn("span",{class:"rf-budget__per-day-amount"},[p(k)])]));const T=new gn("div",{class:"rf-budget__footer"},P),E=new gn("meta",{content:String(x)}),Q=new gn("meta",{content:String(k)}),$=[v,O,b,w,...o.toArray(),A,T];return Me({rune:"budget",schemaOrgType:"ItemList",tag:"section",property:"contentSection",properties:{currency:v,duration:O,showPerDay:b,variant:w,category:S,total:E,...y?{perDay:Q}:{}},refs:{...l,categories:A},children:$})}}),{Tag:ls}=B,SF=["side-by-side","stacked"],AF=Xe({attributes:{layout:{type:String,required:!1,matches:SF.slice(),description:"Display panels side-by-side or stacked"},labels:{type:String,required:!1,description:"Comma-separated custom labels for each panel"},title:{type:String,required:!1,description:"Optional title displayed above the panels"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=e.layout??"side-by-side",s=e.labels??"",o=e.title??"",a=new ls("meta",{content:i}),l=[],c=s?s.split(",").map(m=>m.trim()):[];let u=0;for(const m of r.toArray()){let p;if(ls.isTag(m)&&m.name==="pre")p=m;else if(ls.isTag(m)&&m.name==="div"&&m.attributes.class==="rf-codeblock"){const v=m.children.find(O=>ls.isTag(O)&&O.name==="pre");v&&(p=v)}if(p&&ls.isTag(p)){const v=c[u]||p.attributes["data-language"]||`Panel ${u+1}`,O=new ls("span",{"data-label":!0},[v]);l.push(new ls("div",{"data-panel":!0},[O,m])),u++}}const f=new ls("div",{"data-panels":!0},l),d=o?[new ls("div",{"data-name":"header"},[o])]:[],h=Me({rune:"compare",tag:"div",properties:{layout:a},refs:{panels:f},children:[a,...d,f]});return h.attributes["data-code-host"]=!0,h}}),{Tag:Bi}=B,$T={table:"body"},CF=Xe({sections:$T,attributes:{sortable:{type:String,required:!1,description:'Column names to enable sorting, or "all"'},searchable:{type:Boolean,required:!1,description:"Show a search input to filter rows"},pageSize:{type:Number,required:!1,description:"Rows per page; 0 disables pagination"},defaultSort:{type:String,required:!1,description:"Column to sort by initially"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=new Bi("meta",{content:e.sortable??""}),s=new Bi("meta",{content:String(e.searchable??!1)}),o=new Bi("meta",{content:String(e.pageSize??0)}),a=new Bi("meta",{content:e.defaultSort??""});let l;const c=r.tag("table");if(c.count()>0)l=c.next();else{const f=r.toArray().find(h=>Bi.isTag(h)&&h.name==="div"&&h.attributes.class==="rf-table-wrapper"),d=f&&Bi.isTag(f)?f.children.find(h=>Bi.isTag(h)&&h.name==="table"):void 0;l=d&&Bi.isTag(d)?d:new Bi("table",{},[])}const u=new Bi("div",{},[l]);return Me({rune:"data-table",schemaOrgType:"Dataset",tag:"div",properties:{sortable:i,searchable:s,pageSize:o,defaultSort:a},refs:{scroll:u,table:l},children:[i,s,o,a,u]})}}),{Tag:kn}=B,TF=["unified","split","inline"];function PF(n,e){const t=n.split(`
|
|
296
|
-
`),r=e.split(`
|
|
297
|
-
`),i=t.length,s=r.length,o=Array.from({length:i+1},()=>new Array(s+1).fill(0));for(let u=1;u<=i;u++)for(let f=1;f<=s;f++)o[u][f]=t[u-1]===r[f-1]?o[u-1][f-1]+1:Math.max(o[u-1][f],o[u][f-1]);let a=i,l=s;const c=[];for(;a>0||l>0;)a>0&&l>0&&t[a-1]===r[l-1]?(c.push({type:"equal",text:t[a-1]}),a--,l--):l>0&&(a===0||o[a][l-1]>=o[a-1][l])?(c.push({type:"add",text:r[l-1]}),l--):(c.push({type:"remove",text:t[a-1]}),a--);return c.reverse(),c}function EF(n){const e=[],t=[];let r=1,i=1,s=0;for(;s<n.length;)if(n[s].type==="equal")e.push({hunk:n[s],num:r++}),t.push({hunk:n[s],num:i++}),s++;else{const o=[],a=[];for(;s<n.length&&n[s].type==="remove";)o.push(n[s]),s++;for(;s<n.length&&n[s].type==="add";)a.push(n[s]),s++;const l=Math.max(o.length,a.length);for(let c=0;c<l;c++)e.push(c<o.length?{hunk:o[c],num:r++}:null),t.push(c<a.length?{hunk:a[c],num:i++}:null)}return{before:e,after:t}}function $F(n){const e=[];let t=1,r=1;for(const i of n)i.type==="equal"?(e.push({hunk:i,beforeNum:t,afterNum:r}),t++,r++):i.type==="remove"?(e.push({hunk:i,beforeNum:t,afterNum:null}),t++):i.type==="add"&&(e.push({hunk:i,beforeNum:null,afterNum:r}),r++);return e}function QF(n,e,t=0,r=0){const s=$F(n).map(({hunk:o,beforeNum:a,afterNum:l})=>new kn("span",{"data-name":"line","data-line-status":o.type},[new kn("span",{"data-name":"gutter-num","data-side":"before"},[a!=null?String(a+t):""]),new kn("span",{"data-name":"gutter-num","data-side":"after"},[l!=null?String(l+r):""]),new kn("span",{"data-name":"line-content",...e?{"data-language":e}:{}},[o.text])]));return[new kn("pre",{"data-name":"code","data-copy-selector":'[data-name="line-content"]'},[new kn("div",{"data-name":"rows"},s)])]}function LF(n,e,t=0,r=0){const{before:i,after:s}=EF(n);function o(a,l,c){return a.map(u=>{const f=u?u.hunk.type:"empty";return new kn("span",{"data-name":"line","data-line-status":f},[new kn("span",{"data-name":"gutter-num","data-side":l},[u?String(u.num+c):""]),new kn("span",{"data-name":"line-content",...u&&e?{"data-language":e}:{}},[u?u.hunk.text:""])])})}return[new kn("div",{"data-name":"split-container"},[new kn("div",{"data-name":"panel"},[new kn("pre",{"data-name":"code","data-copy-selector":'[data-name="line-content"]'},[new kn("div",{"data-name":"rows"},o(i,"before",t))])]),new kn("div",{"data-name":"panel"},[new kn("pre",{"data-name":"code","data-copy-selector":'[data-name="line-content"]'},[new kn("div",{"data-name":"rows"},o(s,"after",r))])])])]}function pw(n){if(typeof n!="string"||n.length===0)return 0;const e=/^(\d+)/.exec(n.trim());if(!e)return 0;const t=Number(e[1]);return Number.isFinite(t)&&t>0?t-1:0}function MF(n,e,t){if(n)return[new kn("div",{"data-name":"header"},[n])];if(e&&t)return e===t?[new kn("div",{"data-name":"header"},[e])]:[new kn("div",{"data-name":"header"},[`${e} → ${t}`])];const r=e||t;return r?[new kn("div",{"data-name":"header"},[r])]:[]}const qF=Xe({attributes:{mode:{type:String,required:!1,matches:TF.slice(),description:"Diff display style: unified, split, or inline"},language:{type:String,required:!1,description:"Programming language for syntax highlighting"},title:{type:String,required:!1,description:"Optional title or filename displayed above the diff"}},contentModel:{type:"sequence",fields:[{name:"fences",match:"fence",greedy:!0}]},transform(n,e){const t=e.mode??"unified",r=e.language??"",i=e.title??"",s=new kn("meta",{content:t}),o=new kn("meta",{content:r}),a=nt(n.fences),l=a.length>0?(a[0].attributes.content||"").replace(/\n$/,""):"",c=a.length>1?(a[1].attributes.content||"").replace(/\n$/,""):"",u=r||a.length>0&&a[0].attributes.language||"",f=a.length>0&&typeof a[0].attributes.source=="string"?a[0].attributes.source:void 0,d=a.length>1&&typeof a[1].attributes.source=="string"?a[1].attributes.source:void 0,h=a.length>0?pw(a[0].attributes.lines):0,m=a.length>1?pw(a[1].attributes.lines):0,p=PF(l,c),v=t==="split"?LF(p,u,h,m):QF(p,u,h,m),O=MF(i,f,d),b=Me({rune:"diff",tag:"div",properties:{mode:s,language:o},children:[s,o,...O,...v]});return b.attributes["data-code-host"]=!0,b}}),{Tag:ua}=B,RF=["bar","line","pie","area"];function DF(n){for(const e of n)if(B.Tag.isTag(e)){if(e.name==="table")return e;if(e.name==="div"){const t=e.children.find(r=>B.Tag.isTag(r)&&r.name==="table");if(t&&B.Tag.isTag(t))return t}}}const IF=Xe({attributes:{type:{type:String,required:!1,matches:RF.slice(),description:"Chart visualization type"},title:{type:String,required:!1,description:"Title displayed above the chart"},stacked:{type:Boolean,required:!1,description:"Stack data series instead of grouping"},"tick-count":{type:Number,required:!1,description:"Approximate number of Y-axis ticks (default 5). Ignored when tick-step is set."},"tick-step":{type:Number,required:!1,description:"Explicit unit-span between Y-axis ticks (e.g. 10, 0.5). Overrides tick-count."},"label-angle":{type:String,required:!1,description:'X-axis label rotation: "auto" (default) rotates -45° when slots are crowded, "0" forces horizontal, or any explicit degree (e.g. "-45", "-90").'}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=B.transform(nt(n.body),t),i=e.type??"bar",s=e.title??"",o=e.stacked??!1,a=e["tick-count"],l=e["tick-step"],c=e["label-angle"],u=DF(r),f=u?[u]:r;u&&(u.attributes["data-name"]="data",s&&(u.children=[new ua("caption",{},[s]),...u.children]));const d=new ua("meta",{content:i}),h=new ua("meta",{content:String(o)}),m=a!=null?new ua("meta",{content:String(a)}):void 0,p=l!=null?new ua("meta",{content:String(l)}):void 0,v=c!=null&&c!==""?new ua("meta",{content:String(c)}):void 0,O=Me({rune:"chart",tag:"figure",properties:{type:d,stacked:h,...m?{"tick-count":m}:{},...p?{"tick-step":p}:{},...v?{"label-angle":v}:{}},children:f});return O.name="rf-chart",O}}),{Tag:fa}=B,NF=["mermaid","plantuml","ascii"],BF=Xe({attributes:{language:{type:String,required:!1,matches:NF.slice(),description:"Diagram language: mermaid, plantuml, or ascii"},title:{type:String,required:!1,description:"Title displayed above the diagram"}},contentModel:{type:"sequence",fields:[{name:"source",match:"fence"}]},transform(n,e){const t=e.language??"mermaid",r=e.title??"",s=nt(n.source)[0]?.attributes?.content||"",o=new fa("meta",{content:t}),a=[];let l;r&&(l=new fa("figcaption",{},[r]),a.push(l));let c;const u=[];s&&(c=new fa("pre",{},[new fa("code",{},[s])]),u.push(c));const f=new fa("div",{},u);a.push(f),s&&a.push(new fa("template",{"data-content":"source"},[s]));const d=Me({rune:"diagram",tag:"figure",properties:{language:o},refs:{...l?{title:l}:{},container:f,...c?{source:c}:{}},children:a});return d.name="rf-diagram",d}}),{Tag:jF}=B,zF=["sidenote","footnote","tooltip"],QT={body:"body"},ZF=Xe({sections:QT,provides:["prose"],attributes:{variant:{type:String,required:!1,matches:zF.slice(),description:"Display style: sidenote, footnote, or tooltip"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new jF("meta",{content:e.variant??"sidenote"}),s=new Re(B.transform(nt(n.body),t)).wrap("div");return Me({rune:"sidenote",tag:"aside",properties:{variant:r},refs:{body:s},children:[r,s.next()]})}}),{Ast:Ju,Tag:mw}=B,FF=Xe({attributes:{speaker:{type:String,required:!1},align:{type:String,required:!1,matches:["left","right"]}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new mw("span",{},[e.speaker??""]),i=new mw("meta",{content:e.align??"left"}),s=new Re(B.transform(nt(n.body),t)).wrap("div");return Me({rune:"conversation-message",tag:"div",properties:{speaker:r,align:i},refs:{body:s.tag("div")},children:[r,i,s.next()]})}});function XF(n,e){const t=e.speakers?String(e.speakers).split(",").map(s=>s.trim()):[],r=[];let i=0;for(const s of n)if(s.type==="blockquote"){let o="";const a=[...s.children],l=a.length>0&&a[0].type==="paragraph"?a[0]:null,c=l&&l.children[0]?.type==="inline"?l.children[0]:l;if(c){const f=c.children[0];f&&f.type==="strong"&&(o=Array.from(f.walk()).filter(h=>h.type==="text").map(h=>h.attributes.content).join("").replace(/:\s*$/,""))}if(!o&&t.length>0&&(o=t[i%t.length],c)){const f=new Ju.Node("strong",{},[new Ju.Node("text",{content:`${o}:`},[])]),d=new Ju.Node("text",{content:" "},[]);c.children=[f,d,...c.children]}const u=i%2===0?"left":"right";r.push(new Ju.Node("tag",{speaker:o,align:u},s.children,"conversation-message")),i++}else r.push(s);return r}const VF=Xe({attributes:{speakers:{type:String,required:!1,description:"Comma-separated speaker names for alternating messages"}},contentModel:{type:"custom",processChildren:(n,e)=>XF(n,e),description:"Converts blockquotes to conversation messages with alternating left/right alignment. Extracts speaker name from bold text in first paragraph, falls back to speakers list."},transform(n,e,t){const i=new Re(B.transform(nt(n.children),t)).tag("div").typeof("ConversationMessage"),s=i.wrap("div");return Me({rune:"conversation",tag:"div",properties:{message:i},refs:{messages:s},children:[s.next()]})}}),{Tag:LT}=B,WF=["click","scroll","auto"],YF=Xe({attributes:{name:{type:String,required:!0}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new LT("span",{},[e.name??""]),i=new Re(B.transform(nt(n.body),t)).wrap("div");return Me({rune:"reveal-step",tag:"div",properties:{name:r},refs:{body:i.tag("div")},children:[r,i.next()]})}}),MT={preamble:"preamble",headline:"title",blurb:"description"},UF=Xe({sections:MT,attributes:{mode:{type:String,required:!1,matches:WF.slice(),description:"Step progression: click, scroll, or auto"}},contentModel:()=>({type:"sections",sectionHeading:"heading",emitTag:"reveal-step",emitAttributes:{name:"$heading"},fields:[{name:"header",match:"heading|paragraph",optional:!0,greedy:!0},{name:"items",match:"tag",optional:!0,greedy:!0}],sectionModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]}}),transform(n,e,t){const r=new Re(B.transform(nt(n.header),t)),i=[...nt(n.items),...nt(n.sections)],s=new Re(B.transform(i,t)),o=new LT("meta",{content:e.mode??"click"}),a=s.tag("div").typeof("RevealStep"),l=a.wrap("div"),c=r.count()>0?[r.wrap("header").next(),o,l.next()]:[o,l.next()];return Me({rune:"reveal",tag:"section",property:"contentSection",properties:{step:a},refs:{...Sl(r),steps:l},children:c})}}),{Tag:GF}=B,HF=["start","center","end"],qT={preamble:"preamble",headline:"title",blurb:"description"},KF=Xe({sections:qT,attributes:{align:{type:String,required:!1,matches:HF.slice(),description:"Header alignment: start (default), center, or end"}},contentModel:{type:"sequence",fields:[{name:"eyebrow",match:"paragraph",optional:!0},{name:"headline",match:"heading",optional:!0},{name:"blurb",match:"paragraph",optional:!0},{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=[n.eyebrow,n.headline,n.blurb].filter(Boolean),i=new Re(B.transform(r,t)),s=new Re(B.transform(nt(n.body),t)).wrap("div"),o=e.align||"start",a=new GF("meta",{content:o}),l=i.count()>0?[i.wrap("header").next()]:[],c=[a,...l,s.next()];return Me({rune:"section",tag:"section",property:"contentSection",properties:{align:a},refs:{...Sl(i),body:s},children:c})}}),{Tag:Nl}=B,JF=["slider","toggle","fade","auto"],e7=["horizontal","vertical"],t7=Xe({attributes:{variant:{type:String,required:!1,matches:JF.slice(),description:"Interaction mode: slider, toggle, fade, or auto"},orientation:{type:String,required:!1,matches:e7.slice(),description:"Divider axis for slider/auto variants (horizontal or vertical)"},position:{type:Number,required:!1,description:"Initial slider position as a percentage (0-100)"},duration:{type:Number,required:!1,description:"Animation duration in milliseconds (fade/auto variants)"},labels:{type:String,required:!1,description:"Comma-separated custom labels for the two panels"}},contentModel:{type:"delimited",delimiter:"hr",dynamicZones:!0,zoneModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]}},transform(n,e,t){const r=n.zones??[],i=e.labels?e.labels.split(",").map(d=>d.trim()):[],s=r.map((d,h)=>{const p=new Re(PZ(B.transform(nt(d.body),t))).wrap("div"),v=i[h],O=v?new Nl("span",{},[v]):void 0;return Me({rune:"juxtapose-panel",tag:"div",properties:{},refs:{...O?{name:O}:{},body:p.tag("div")},children:[...O?[O]:[],p.next()]})}),o=new Re(s).tag("div").typeof("JuxtaposePanel"),a=o.wrap("div"),l=new Nl("meta",{content:e.variant??"slider"}),c=new Nl("meta",{content:e.orientation??"vertical"}),u=new Nl("meta",{content:String(e.position??50)}),f=new Nl("meta",{content:String(e.duration??1e3)});return Me({rune:"juxtapose",tag:"section",properties:{panel:o,variant:l,orientation:c,position:u,duration:f},refs:{panels:a},children:[l,c,u,f,a.next()]})}}),{Tag:n7}=B,r7=Xe({contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)).wrap("div");return Me({rune:"annotate-note",tag:"aside",properties:{},refs:{body:r.tag("div")},children:[r.next()]})}}),i7=["margin","tooltip","inline"],RT={body:"body"},s7=Xe({sections:RT,provides:["prose"],attributes:{variant:{type:String,required:!1,matches:i7.slice(),description:"Annotation display style: margin, tooltip, or inline"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=new n7("meta",{content:e.variant??"margin"}),s=r.tag("aside").typeof("AnnotateNote"),o=r.wrap("div");return Me({rune:"annotate",tag:"div",properties:{note:s,variant:i},refs:{body:o.tag("div")},children:[i,o.next()]})}}),{Ast:go,Tag:Gt}=B,o7=["stacked","inline","compact"],a7=["GET","POST"],l7=[[["email","e-mail"],"email"],[["phone","telephone","mobile","cell"],"tel"],[["website","url","homepage","link"],"url"],[["date","birthday","dob"],"date"],[["number","amount","quantity","age","count"],"number"],[["password","pin","passcode"],"password"],[["message","comments","description","feedback","notes","bio","about"],"textarea"],[["file","upload","attachment","resume","document","cv"],"file"]];function c7(n){const e=n.toLowerCase();for(const[t,r]of l7)if(t.some(i=>e.includes(i)))return r;return"text"}function u7(n){const e=n.match(/^(.+?)\s*\(([^)]+)\)\s*$/);if(!e)return{name:n.trim(),optional:!1,placeholder:""};const t=e[1].trim(),r=e[2],i=/\boptional\b/i.test(r),s=r.match(/placeholder:\s*["']?([^"',]+)["']?/i),o=s?s[1].trim():"";return{name:t,optional:i,placeholder:o}}function vo(n){return Array.from(n.walk()).filter(e=>e.type==="text").map(e=>e.attributes.content).join("")}function f7(n){if(n.type!=="paragraph")return!1;const e=Array.from(n.walk());if(!e.some(s=>s.type==="strong"))return!1;const r=e.filter(s=>s.type==="text").map(s=>s.attributes.content).join(""),i=e.filter(s=>s.type==="strong").flatMap(s=>Array.from(s.walk()).filter(o=>o.type==="text")).map(s=>s.attributes.content).join("");return r.trim()===i.trim()&&r.trim().length>0}function d7(n){const e=/\(multiple\)/i.test(n)||/select all/i.test(n),t=/\(radio\)/i.test(n),r=/\(optional\)/i.test(n);return{label:n.replace(/\s*\(multiple\)/gi,"").replace(/\s*\(radio\)/gi,"").replace(/\s*\(optional\)/gi,"").trim(),multiple:e,radio:t,optional:r}}const h7=Xe({attributes:{name:{type:String,required:!1},fieldType:{type:String,required:!1},required:{type:Boolean,required:!1},placeholder:{type:String,required:!1},options:{type:String,required:!1}},contentModel:{type:"sequence",fields:[]},transform(n,e){const t=e.name??"",r=e.fieldType??"text",i=e.required??!0,s=e.placeholder??"",o=e.options??"",a=`field-${t.toLowerCase().replace(/\s+/g,"-")}`,l=o?o.split(",").map(m=>m.trim()).filter(Boolean):[];if(r==="submit")return new Gt("button",{type:"submit","data-name":"submit"},[t]);if(r==="separator")return new Gt("hr",{"data-name":"separator"},[]);if(r==="help")return new Gt("p",{"data-name":"help"},[t]);if(r==="description")return new Gt("p",{"data-name":"text"},[t]);if(r==="group")return new Gt("fieldset",{class:"rf-form-fieldset"},[new Gt("legend",{},[t])]);if(r==="radio"||r==="checkbox"){const m=[t];i&&m.push(new Gt("span",{"data-name":"required","aria-hidden":"true"},["*"]));const p=l.map((O,b)=>new Gt("label",{class:"rf-form-choice"},[new Gt("input",{type:r,name:a,value:O,...i&&r==="radio"&&b===0?{required:""}:{}},[]),new Gt("span",{},[O])])),v=new Gt("meta",{"data-field":"field-type",content:r});return new Gt("fieldset",{"data-rune":"form-field",class:"rf-form-choice-group"},[v,new Gt("legend",{},m),...p])}const c=[t];i&&c.push(new Gt("span",{"data-name":"required","aria-hidden":"true"},["*"]));const u=new Gt("label",{for:a},c);let f;r==="textarea"?f=new Gt("textarea",{id:a,name:a,...s?{placeholder:s}:{},...i?{required:""}:{},rows:"4"},[]):r==="select"?f=new Gt("select",{id:a,name:a,...i?{required:""}:{}},[new Gt("option",{value:"",disabled:"",selected:""},["Select an option"]),...l.map(m=>new Gt("option",{value:m},[m]))]):f=new Gt("input",{type:r,id:a,name:a,...s?{placeholder:s}:{},...i?{required:""}:{}},[]);const d=new Gt("div",{},[u,f]),h=new Gt("meta",{content:r});return Me({rune:"form-field",tag:"div",properties:{fieldType:h},refs:{body:d},children:[h,d]})}});function p7(n){const e=[];let t=null,r=-1;for(let s=n.length-1;s>=0;s--)if(f7(n[s])){r=s;break}const i=()=>{if(t){const s=vo(t);e.push(new go.Node("tag",{name:s,fieldType:"help",required:!1,placeholder:"",options:""},[],"form-field")),t=null}};for(let s=0;s<n.length;s++){const o=n[s];if(o.type==="heading"){i();const a=vo(o);e.push(new go.Node("tag",{name:a,fieldType:"group",required:!1,placeholder:"",options:""},[],"form-field"))}else if(o.type==="list"&&t){const a=vo(t),l=d7(a),c=[];for(const f of o.children)f.type==="item"&&c.push(vo(f));let u;l.multiple?u="checkbox":l.radio||c.length<=4?u="radio":u="select",e.push(new go.Node("tag",{name:l.label,fieldType:u,required:!l.optional,placeholder:"",options:c.join(",")},[],"form-field")),t=null}else if(o.type==="list"){i();for(const a of o.children)if(a.type==="item"){const l=vo(a),c=u7(l),u=c7(c.name);e.push(new go.Node("tag",{name:c.name,fieldType:u,required:!c.optional,placeholder:c.placeholder,options:""},[],"form-field"))}}else if(o.type==="blockquote")i(),t=o;else if(s===r){i();const a=vo(o);e.push(new go.Node("tag",{name:a,fieldType:"submit",required:!1,placeholder:"",options:""},[],"form-field"))}else if(o.type==="hr")i(),e.push(new go.Node("tag",{name:"",fieldType:"separator",required:!1,placeholder:"",options:""},[],"form-field"));else if(o.type==="paragraph"){i();const a=vo(o);e.push(new go.Node("tag",{name:a,fieldType:"description",required:!1,placeholder:"",options:""},[],"form-field"))}else i(),e.push(o)}return i(),e}const DT={body:"body"},m7=Xe({sections:DT,attributes:{action:{type:String,required:!0,description:"URL the form submits to"},method:{type:String,required:!1,matches:a7.slice(),description:"HTTP method for form submission"},success:{type:String,required:!1,description:"Message shown after successful submission"},error:{type:String,required:!1,description:"Message shown when submission fails"},variant:{type:String,required:!1,matches:o7.slice(),description:"Form layout style"},name:{type:String,required:!1,description:"Form name for identification"},honeypot:{type:Boolean,required:!1,description:"Include a hidden field to prevent spam"}},contentModel:{type:"custom",processChildren:n=>p7(n),description:"Multi-pass form field parser with type inference and selection detection. Converts lists to text inputs, blockquote + list to selection fields, headings to fieldsets, bold paragraphs to submit buttons, and blockquotes to help text."},transform(n,e,t){const r=new Re(B.transform(nt(n.children),t)),i=new Gt("meta",{content:e.action??""}),s=new Gt("meta",{content:e.method??"POST"}),o=new Gt("meta",{content:e.success??""}),a=new Gt("meta",{content:e.error??""}),l=new Gt("meta",{content:e.variant??"stacked"}),c=new Gt("meta",{content:String(e.honeypot??!0)}),u=r.tag("div").typeof("FormField"),f=r.wrap("div");return Me({rune:"form",tag:"form",properties:{action:i,method:s,success:o,error:a,variant:l,honeypot:c,field:u},refs:{body:f},children:[i,s,o,a,l,c,f.next()]})}}),g7={".html":"html",".css":"css",".js":"js",".svg":"svg",".glsl-vert":"glsl-vert",".glsl-frag":"glsl-frag"};function v7(n,e){return n.endsWith("/")?n+e:n+"/"+e}function O7(n){if(n.endsWith(".glsl-vert"))return"glsl-vert";if(n.endsWith(".glsl-frag"))return"glsl-frag";const e=n.lastIndexOf(".");if(e===-1)return null;const t=n.slice(e);return g7[t]??null}function b7(n,e,t,r,i){const s=[],o=[];if(i&&!i(n))return{content:"",panels:[],errors:[`Sandbox src directory not found: "${e}"`],warnings:[]};const a=r(n);if(a.length===0)return{content:"",panels:[],errors:[],warnings:[`Sandbox src directory "${e}" contains no .html, .css, or .js files`]};const l=[];for(const y of a.sort()){const k=O7(y);if(!k)continue;const P=t(v7(n,y));P!=null&&l.push({name:y,role:k,content:P})}if(l.length===0)return{content:"",panels:[],errors:[],warnings:[`Sandbox src directory "${e}" contains no .html, .css, or .js files`]};const c=new Map;for(const y of l){const k=c.get(y.role)??[];k.push(y),c.set(y.role,k)}const u=c.get("html")??[];let f;u.length>1?(f=u.find(y=>y.name==="index.html")??u[0],o.push(`Sandbox src "${e}" has multiple .html files — using ${f.name}`)):u.length===1?f=u[0]:o.push(`Sandbox src "${e}" has no .html file — body will be empty`);const d=c.get("css")??[],h=d.map(y=>y.content).join(`
|
|
298
|
-
`),m=c.get("js")??[];let p=m.map(y=>y.content).join(`
|
|
299
|
-
`);const O=(c.get("svg")??[]).map(y=>y.content).join(`
|
|
300
|
-
`),b=(c.get("glsl-vert")??[])[0],w=(c.get("glsl-frag")??[])[0];let S="";b&&(S+=`const VERTEX_SHADER = \`${gw(b.content)}\`;
|
|
301
|
-
`),w&&(S+=`const FRAGMENT_SHADER = \`${gw(w.content)}\`;
|
|
302
|
-
`),S&&(p=S+p);const _=(f?.content??"")+(O?`
|
|
303
|
-
`+O:""),x=[];_&&x.push(`<div data-source="HTML">
|
|
304
|
-
${_}
|
|
305
|
-
</div>`),h&&x.push(`<style data-source="CSS">
|
|
306
|
-
${h}
|
|
307
|
-
</style>`),p&&x.push(`<script data-source="JavaScript">
|
|
308
|
-
${p}
|
|
309
|
-
<\/script>`);const A=x.join(`
|
|
310
|
-
`),C=[];if(f&&C.push({label:"HTML",language:"html",content:_,origin:`${e}/${f.name}`}),h){const y=d.map(k=>`${e}/${k.name}`).join(", ");C.push({label:"CSS",language:"css",content:h,origin:y})}if(p){const y=[];b&&y.push(`${e}/${b.name}`),w&&y.push(`${e}/${w.name}`),y.push(...m.map(k=>`${e}/${k.name}`)),C.push({label:"JavaScript",language:"javascript",content:p,origin:y.join(", ")})}return{content:A,panels:C,errors:s,warnings:o}}function y7(n,e){const t=da(n,"div","HTML"),r=da(n,"style","CSS"),i=da(n,"script","JavaScript"),s=da(e,"div","HTML"),o=da(e,"style","CSS"),a=da(e,"script","JavaScript"),l=Zp(t,s),c=Zp(r,o),u=Zp(i,a),f=[];return l&&f.push(`<div data-source="HTML">
|
|
311
|
-
${l}
|
|
312
|
-
</div>`),c&&f.push(`<style data-source="CSS">
|
|
313
|
-
${c}
|
|
314
|
-
</style>`),u&&f.push(`<script data-source="JavaScript">
|
|
315
|
-
${u}
|
|
316
|
-
<\/script>`),f.join(`
|
|
317
|
-
`)}function da(n,e,t){const r=new RegExp(`<${e}[^>]*data-source="${t}"[^>]*>([\\s\\S]*?)</${e}>`,"i");return n.match(r)?.[1]?.trim()??""}function Zp(n,e){return n&&e?n+`
|
|
318
|
-
`+e:n||e}function gw(n){return n.replace(/\\/g,"\\\\").replace(/`/g,"\\`").replace(/\$\{/g,"\\${")}const{Tag:ef}=B;function vw(n){const e=n.split(`
|
|
319
|
-
`),t=e.filter(i=>i.trim().length>0).map(i=>i.match(/^(\s*)/)?.[0].length??0),r=t.length>0?Math.min(...t):0;return r>0?e.map(i=>i.slice(r)).join(`
|
|
320
|
-
`):n}function Ow(n){const e=[],t=/<(\w+)\b([^>]*?)\bdata-source(?:="([^"]*)")?([^>]*)>([\s\S]*?)<\/\1>/g;let r;for(;(r=t.exec(n))!==null;){const[,i,s,o,a,l]=r,c=i==="style"?"css":i==="script"?"javascript":"html",u=c.charAt(0).toUpperCase()+c.slice(1);let f;if(i==="style"||i==="script")f=vw(l.trim());else{const d=(s+a).replace(/\s{2,}/g," ").trim(),h=d?` ${d}`:"",m=vw(l).split(`
|
|
321
|
-
`).map(p=>p.trim().length>0?" "+p:p).join(`
|
|
322
|
-
`);f=`<${i}${h}>${m}</${i}>`.trim()}e.push({label:o||u,language:c,content:f})}return e}function bw(n,e){const t=e.variables?.__source;if(typeof t=="string"&&n.lines?.length>=2){const r=t.split(`
|
|
323
|
-
`),i=n.lines[0]+1,s=n.lines[n.lines.length-1]-1;return r.slice(i,s).join(`
|
|
324
|
-
`).trim()}return""}const w7=Xe({attributes:{src:{type:String,required:!1,description:"Directory containing external source files"},framework:{type:String,required:!1,description:"JavaScript framework for the sandbox"},dependencies:{type:String,required:!1,description:"Comma-separated npm packages to include"},label:{type:String,required:!1,description:"Label displayed above the sandbox"},height:{type:[Number,String],required:!1,description:'Height of the sandbox iframe: pixels, "fill" (host owns height), or auto'},context:{type:String,required:!1,description:"Shared context scope for multiple sandboxes"},activation:{type:String,required:!1,matches:["eager","visible","click"],description:"When to mount the iframe: eager (default) | visible | click"},poster:{type:String,required:!1,description:"Poster image URL shown until a non-eager sandbox activates"},data:{type:String,required:!1,description:'Registry query (SPEC-070 field-match, e.g. "type:page") bound into the iframe as window.RF_DATA'},"data-fields":{type:String,required:!1,description:"Comma-separated entity data fields to project into the payload"},"data-shape":{type:String,required:!1,description:"Payload shape: flat (default) | tree (nest by parentUrl) | graph (nodes + SPEC-072 edges)"},"data-limit":{type:Number,required:!1,description:"Max records in the payload (default 500)"}},contentModel:{type:"sequence",fields:[]},transform(n,e,t,r){const i=e.src??"",s=e.framework??"",o=e.dependencies??"",a=e.label??"",l=e.height,c=e.data??"",u=e["data-fields"]??"",f=e["data-shape"]??"",d=e["data-limit"],h=e.activation==="visible"||e.activation==="click"?e.activation:"",m=e.poster??"";let p="",v=[];const O=t.variables?.__sandboxFiles,b=t.variables?.__sandboxExamplesDir;if(i&&O&&b!==void 0){const y=b?b.endsWith("/")?b+i:b+"/"+i:i,k=b7(y,i,T=>O.read(T),T=>O.list(T),T=>O.exists(T));k.errors.length>0?(p=`<div data-source="HTML"><pre style="color:red;padding:1rem">${k.errors.join(`
|
|
325
|
-
`)}</pre></div>`,v=[]):(p=k.content,v=k.panels.map(T=>({label:T.label,language:T.language,content:T.content,origin:T.origin})));const P=bw(r,t);P&&(p=y7(p,P),v=Ow(p))}else p=bw(r,t),v=Ow(p);const w=t.variables?.__securityPolicy??{trust:"trusted",allowJs:!0,sandboxOrigin:void 0},S=W9(p,w),_=S?new ef("pre",{"data-language":"html"},[new ef("code",{"data-language":"html"},[S])]):void 0,x=v.filter(y=>y.origin).map(y=>`${y.label} ${y.origin}`),A=[];_&&A.push(new ef("template",{"data-content":"fallback"},[_])),A.push(new ef("template",{"data-content":"source"},[S]));const C=Me({rune:"sandbox",tag:"div",children:A});return C.name="rf-sandbox",Object.assign(C.attributes,{"data-source-content":S,...s?{"data-framework":s}:{},...o?{"data-dependencies":o}:{},...a?{"data-label":a}:{},"data-height":typeof l=="number"?String(l):l==="fill"?"fill":typeof l=="string"&&/^\d+$/.test(l)?l:"auto",...x.length>0?{"data-source-origins":x.join(`
|
|
326
|
-
`)}:{},"data-security-mode":w.trust,"data-allow-js":w.allowJs?"true":"false",...w.sandboxOrigin?{"data-sandbox-origin":w.sandboxOrigin}:{},...h?{"data-activation":h,...m?{"data-poster":m}:{}}:{},...c?{"data-rf-query":c,...u?{"data-rf-fields":u}:{},...f?{"data-rf-shape":f}:{},...d!=null?{"data-rf-limit":String(d)}:{}}:{}}),C}}),IT={selfClosing:!0,attributes:{name:{type:String,required:!0,description:'Icon name, optionally prefixed with group (e.g., "rocket" or "hint/warning")'},size:{type:String,required:!1,description:"CSS size override for the icon"}},transform(n,e){const t=n.attributes.name,r=n.attributes.size;return NC(t,e,{size:r}).tag}};xl(IT,"inline");const{Tag:yw}=B,_7=["left","center","right"],k7=["default","accent","editorial"],NT={body:"body"},x7=Xe({sections:NT,provides:["prose"],attributes:{align:{type:String,required:!1,matches:_7.slice(),description:"Text alignment of the quote"},variant:{type:String,required:!1,matches:k7.slice(),description:"Visual style of the quote block"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=new yw("meta",{content:e.align??"center"}),s=new yw("meta",{content:e.variant??"default"}),o=r.tag("blockquote"),l=[...o.count()>0?o.limit(1).toArray():r.tag("p").toArray(),i,s];return Me({rune:"pull-quote",tag:"blockquote",properties:{align:i,variant:s},children:l})}}),{Tag:Fp}=B,S7=["left","center","right","justify"],BT={body:"body"},A7=Xe({sections:BT,provides:["prose"],attributes:{columns:{type:Number,required:!1,description:"Number of text columns"},lead:{type:Boolean,required:!1,description:"Style the first paragraph as a lead"},align:{type:String,required:!1,matches:S7.slice(),description:"Text alignment"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=e.columns??1,s=e.lead??!1,o=e.align??"left",a=i>1?new Fp("meta",{content:String(i)}):void 0,l=s?new Fp("meta",{content:"lead"}):void 0,c=o!=="left"?new Fp("meta",{content:o}):void 0,u=r.wrap("div"),f=[];return a&&f.push(a),l&&f.push(l),c&&f.push(c),f.push(u.next()),Me({rune:"text-block",tag:"div",properties:{...a?{columns:a}:{},...l?{lead:l}:{},...c?{align:c}:{}},refs:{body:u.tag("div")},children:f})}}),{Tag:Bl}=B,C7=["left","right"],T7=["1:2","1:1","2:1"],jT={body:"body",media:"media"},zT={media:"cover"},P7=Xe({sections:jT,provides:["prose"],mediaSlots:zT,attributes:{align:{type:String,required:!1,matches:C7.slice(),description:"Side the media appears on"},ratio:{type:String,required:!1,matches:T7.slice(),description:"Width ratio between media and text"},wrap:{type:Boolean,required:!1,description:"Wrap text around the media"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=e.align??"left",s=e.ratio??"1:1",o=e.wrap??!1,a=new Bl("meta",{content:i}),l=new Bl("meta",{content:s}),c=o?new Bl("meta",{content:"true"}):void 0,u=[],f=[];for(const p of r.toArray())B.Tag.isTag(p)&&p.name==="p"&&p.children.length===1&&B.Tag.isTag(p.children[0])&&p.children[0].name==="img"?u.push(p.children[0]):B.Tag.isTag(p)&&p.name==="img"?u.push(p):f.push(p);const d=new Bl("div",{},u),h=new Bl("div",{},f),m=[a,l];return c&&m.push(c),m.push(d,h),Me({rune:"media-text",tag:"div",properties:{align:a,ratio:l,...c?{wrap:c}:{}},refs:{media:d,body:h},children:m})}}),{Tag:ha}=B,E7=["background","surface","primary","secondary","accent","border"],$7=/^\s*(\w+)\s*:\s*(.+)\s*$/;function ww(n){const e=[];for(const t of n.walk())t.type==="text"&&t.attributes.content&&e.push(t.attributes.content);return e.join(" ").trim()}function Q7(n){const e={},t={};let r="light";for(const i of n){if(i.type==="heading"){const s=ww(i).toLowerCase();s==="dark"?r="dark":s==="light"&&(r="light");continue}if(i.type==="list")for(const s of i.children){const a=ww(s).match($7);if(a){const l=a[1].toLowerCase(),c=a[2].trim();E7.includes(l)&&(r==="dark"?t[l]=c:e[l]=c)}}}return{light:e,dark:t}}const ZT={attributes:{preset:{type:String,required:!1,description:"Named tint preset from the theme"},mode:{type:String,required:!1,matches:["auto","dark","light"],description:"Whether the tint adapts to auto, dark, or light mode"}},transform(n,e){const t=n.transformAttributes(e).preset,r=n.transformAttributes(e).mode,{light:i,dark:s}=Q7(n.children),o=[];t?o.push(new ha("meta",{"data-field":"tint",content:t})):(Object.keys(i).length>0||Object.keys(s).length>0)&&o.push(new ha("meta",{"data-field":"tint",content:"custom"})),r&&r!=="auto"&&o.push(new ha("meta",{"data-field":"tint-mode",content:r}));for(const[a,l]of Object.entries(i))o.push(new ha("meta",{"data-field":`tint-${a}`,content:l}));for(const[a,l]of Object.entries(s))o.push(new ha("meta",{"data-field":`tint-dark-${a}`,content:l}));return new ha("div",{"data-tint-source":!0},o)}};xl(ZT,"configurator");const{Tag:_w}=B,L7=["none","soft","hard","elevated"],M7=["none","top","bottom","both","end","bottom-end","top-end"],q7={soft:"sm",hard:"md",elevated:"lg"},kw=new Set;function jl(n,e){kw.has(n)||(kw.add(n),console.warn(`[refrakt] showcase \`${n}\` is deprecated (SPEC-086) — use \`${e}\`. The alias will be removed in a future minor.`))}const FT={viewport:"body"},XT="self",R7=Xe({sections:FT,frameTarget:XT,attributes:{shadow:{type:String,required:!1,matches:L7.slice(),description:"Shadow style around the showcase content"},bleed:{type:String,required:!1,matches:M7.slice(),description:"Direction content extends beyond its container"},offset:{type:String,required:!1,description:"CSS offset from the container edge"},aspect:{type:String,required:!1,description:"Aspect ratio of the showcase area"},place:{type:String,required:!1,matches:["left","center","right","top","bottom","top left","top center","top right","bottom left","bottom center","bottom right"],description:"Position of content within the showcase area"}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=new Re(B.transform(nt(n.body),t)),i=e.shadow??"none",s=e.bleed??"none",o=e.offset??"",a=e.aspect??"",l=e.place??"",c={},u=[],f=(h,m)=>{const p=new _w("meta",{content:m});c[h]=p,u.push(p)};i&&i!=="none"&&(jl("shadow","frame-shadow"),f("frame-shadow",q7[i]??i)),s&&s!=="none"&&(jl("bleed","frame-displace"),f("frame-displace",s)),o&&(jl("offset","frame-offset"),f("frame-offset",o)),a&&(jl("aspect","frame-aspect"),f("frame-aspect",a)),l&&(jl("place","frame-place"),f("frame-place",l));const d=new _w("div",{},r.toArray());return u.push(d),Me({rune:"showcase",tag:"div",properties:c,refs:{viewport:d},children:u})}}),{Tag:tr}=B,D7=new Set(["video","audio","figure"]);function VT(n){for(const e of n){if(!B.Tag.isTag(e))continue;const t=e.attributes?.["data-rune"];if(e.name==="rf-sandbox"||t||D7.has(e.name))return e;const r=VT(e.children);if(r)return r}}function I7(n){return n.name==="rf-sandbox"?"sandbox":String(n.attributes?.["data-rune"]??n.name)}const WT={attributes:{preset:{type:String,required:!1,description:"Named background preset from the theme"},src:{type:String,required:!1,description:"URL of the background image"},video:{type:String,required:!1,description:"URL of a background video"},overlay:{type:String,required:!1,description:"Flat wash over the background: none | dark | light | a token name (raw CSS is deprecated)"},"overlay-opacity":{type:String,required:!1,description:"Opacity of a token-coloured overlay wash (0 to 1)"},gradient:{type:String,required:!1,matches:["to-t","to-b","to-l","to-r","to-tr","to-br","to-bl","to-tl"],description:"Gradient direction (token-driven fill)"},from:{type:String,required:!1,description:"Gradient start colour — semantic token name"},to:{type:String,required:!1,description:"Gradient end colour — semantic token name"},via:{type:String,required:!1,description:"Optional middle gradient stop — semantic token name"},"gradient-type":{type:String,required:!1,matches:["linear","radial","conic"],description:"Gradient type: linear (default), radial, conic"},blur:{type:String,required:!1,matches:["none","sm","md","lg"],description:"Blur intensity applied to the background"},position:{type:String,required:!1,description:"CSS background-position value"},fit:{type:String,required:!1,matches:["cover","contain"],description:"How the background image fills its container"},opacity:{type:String,required:!1,description:"Opacity of the background layer (0 to 1)"},fixed:{type:Boolean,required:!1,description:"Fix the background so it stays in place while scrolling"}},transform(n,e){const t=n.transformAttributes(e),r=[];t.preset&&r.push(new tr("meta",{"data-field":"bg-preset",content:t.preset})),t.src&&r.push(new tr("meta",{"data-field":"bg-src",content:t.src})),t.video&&r.push(new tr("meta",{"data-field":"bg-video",content:t.video})),t.overlay&&t.overlay!=="none"&&r.push(new tr("meta",{"data-field":"bg-overlay",content:t.overlay})),t["overlay-opacity"]&&r.push(new tr("meta",{"data-field":"bg-overlay-opacity",content:t["overlay-opacity"]})),t.gradient&&r.push(new tr("meta",{"data-field":"bg-gradient",content:t.gradient})),t.from&&r.push(new tr("meta",{"data-field":"bg-from",content:t.from})),t.to&&r.push(new tr("meta",{"data-field":"bg-to",content:t.to})),t.via&&r.push(new tr("meta",{"data-field":"bg-via",content:t.via})),t["gradient-type"]&&r.push(new tr("meta",{"data-field":"bg-gradient-type",content:t["gradient-type"]})),t.blur&&t.blur!=="none"&&r.push(new tr("meta",{"data-field":"bg-blur",content:t.blur})),t.position&&t.position!=="center"&&r.push(new tr("meta",{"data-field":"bg-position",content:t.position})),t.fit&&t.fit!=="cover"&&r.push(new tr("meta",{"data-field":"bg-fit",content:t.fit})),t.opacity&&t.opacity!=="1"&&r.push(new tr("meta",{"data-field":"bg-opacity",content:t.opacity})),t.fixed&&r.push(new tr("meta",{"data-field":"bg-fixed",content:"true"}));const i=[];if(n.children?.length){const o=n.children.map(l=>B.transform(l,e)).flat().filter(Boolean),a=VT(o);if(a){const l=I7(a);l!=="sandbox"?console.warn(`[refrakt] bg backdrop guest must be presentational (a sandbox); "${l}" carries content chrome — place it in the media zone as a positioned guest, or use \`bg video="…"\` for a bare video backdrop.`):(a.attributes={...a.attributes,"data-bg-guest":"","data-guest-posture":"backdrop","data-height":"fill","data-activation":"eager"},i.push(a))}}return new tr("div",{"data-bg-source":!0},[...r,...i])}};xl(WT,"configurator");const{Tag:pa}=B,N7=["date-desc","date-asc","title-asc","title-desc"],B7=["list","grid","compact"],YT={preamble:"preamble",headline:"title",blurb:"description",content:"body"},j7=Xe({sections:YT,provides:["prose"],attributes:{folder:{type:String,required:!0,description:'Content folder path to list blog posts from (e.g. "/blog")'},sort:{type:String,required:!1,default:"date-desc",matches:N7.slice(),description:"Sort order: date-desc, date-asc, title-asc, title-desc"},filter:{type:String,required:!1,default:"",description:'Filter expression to match against frontmatter fields (e.g. "tag:javascript" or "draft:false")'},limit:{type:Number,required:!1,description:"Maximum number of posts to display"},layout:{type:String,required:!1,default:"list",matches:B7.slice(),description:"Display layout: list, grid, or compact"}},contentModel:{type:"sequence",fields:[{name:"headline",match:"heading",optional:!0},{name:"blurb",match:"paragraph",optional:!0}]},transform(n,e,t){const r=[n.headline,n.blurb].filter(Boolean),i=new Re(B.transform(r,t)),s=new pa("meta",{content:e.folder}),o=new pa("meta",{content:e.sort||"date-desc"}),a=new pa("meta",{content:e.filter||""}),l=new pa("meta",{content:e.limit!=null?String(e.limit):""}),c=new pa("meta",{content:e.layout||"list"}),u=new pa("div",{},[]),f=Sl(i),d=i.count()>0?[i.wrap("header").next()]:[],h=[s,o,a,l,c,...d,u];return Me({rune:"blog",schemaOrgType:"Blog",tag:"section",property:"contentSection",properties:{folder:s,sort:o,filter:a,limit:l,layout:c},refs:{...f,posts:u},children:h})}}),{Tag:z7}=B,ob="xref",UT={selfClosing:!0,inline:!0,attributes:{primary:{type:String,required:!0,description:"Entity ID or name to resolve"},label:{type:String,required:!1,description:"Custom link text (defaults to entity title)"},type:{type:String,required:!1,description:"Entity type hint for disambiguation"},preview:{type:String,required:!1,matches:["drawer"],description:"Preview target. `\"drawer\"` hoists a drawer containing the entity's expanded content + a link to its resolved page URL in the chrome footer, leaving an inline link at the call site that opens it. Absent → today's behaviour (just the inline link). SPEC-078."}},transform(n,e){const t=n.attributes.primary,r=n.attributes.label,i=n.attributes.type,s=n.attributes.preview,o={"data-rune":ob,"data-xref-id":t};return r&&(o["data-xref-label"]=r),i&&(o["data-xref-type"]=i),s&&(o["data-xref-preview"]=s),new z7("span",o,[r||t])}};xl(UT,"inline");const{Tag:Z7}=B,ab="expand-pending",GT={selfClosing:!0,attributes:{primary:{type:String,required:!0,description:"Entity ID or name to substitute inline. Same lookup chain as xref."},level:{type:Number,required:!1,description:"Optional heading-demotion opt-in. When set, embedded headings shift by `N - 1` and the embed joins the host outline instead of staying TOC-isolated."},type:{type:String,required:!1,description:"Entity type hint for disambiguation when the same ID/name lives in multiple registries."},canonical:{type:Boolean,required:!1,description:`When true, append a visible "View canonical" link pointing at the entity's canonical URL.`},label:{type:String,required:!1,description:"Custom label for the canonical link (only meaningful when `canonical=true`)."}},transform(n,e){const t=n.attributes.primary,r=n.attributes.level,i=n.attributes.type,s=n.attributes.canonical===!0,o=n.attributes.label,a={"data-rune":ab,"data-expand-id":t};return typeof r=="number"&&(a["data-expand-level"]=String(r)),i&&(a["data-expand-type"]=i),s&&(a["data-expand-canonical"]="true"),o&&(a["data-expand-label"]=o),new Z7("div",a,[])}};xl(GT,"none");const{Ast:iJ}=B,F7="__deferred-body";function lb(n){const e=n[F7];return typeof e=="string"&&e.length>0?e:void 0}function cb(n,e,t){const r=B.parse(n),i={...e??{},variables:{...e?.variables??{},...t}},s=B.transform(r,i);return B.Tag.isTag(s)&&s.name==="article"&&!s.attributes?.class&&!s.attributes?.["data-rune"]?s.children:s}const{Tag:xw}=B,HT="__collection-sentinel",X7=Xe({attributes:{type:{type:String,required:!1,default:"",description:"Entity type(s), comma-separated."},filter:{type:String,required:!1,default:"",description:"field:value clauses (SPEC-070 grammar)."},sort:{type:String,required:!1,default:"",description:"Sort field (prefix - for descending)."},group:{type:String,required:!1,default:"",description:"Group-by field."},limit:{type:String,required:!1,default:"",description:"Max items."},show:{type:String,required:!1,default:"",description:"Alias for type (entity types to include)."},fields:{type:String,required:!1,default:"",description:"Comma-separated data fields to project."},layout:{type:String,required:!1,default:"list",description:"Arrangement: list (stacked) | grid (multi-column) | table (aligned columns). Item chrome comes from the item — the no-body built-in, or a rune like {% card %} in the body template."},"group-display":{type:String,required:!1,default:"headings",matches:["headings","accordion"],description:"How groups are presented when `group` is set: headings (default) or accordion (collapsible native <details> panels, styled like the accordion rune, with a per-group count)."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when the query yields nothing (no-body form; body-template form uses a fallback zone). Absent → render nothing."}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(o,a)=>new xw("meta",{"data-field":o,content:a}),r=lb(e)??"",i=[t("collection-type",String(e.type??e.show??"")),t("collection-filter",String(e.filter??"")),t("collection-sort",String(e.sort??"")),t("collection-group",String(e.group??"")),t("collection-limit",String(e.limit??"")),t("collection-fields",String(e.fields??"")),t("collection-layout",String(e.layout??"list")),t("collection-group-display",String(e["group-display"]??"headings")),t("collection-empty",String(e.empty??"")),t(HT,"true")];r&&i.push(t("collection-body",r));const s=new xw("div",{"data-name":"items"},[]);return Me({rune:"collection",tag:"section",properties:{},refs:{items:s},children:[...i,s]})}}),{Tag:Sw}=B,KT="__relationships-sentinel",V7=Xe({attributes:{of:{type:String,required:!1,default:"",description:"Entity to describe — an id (e.g. `of=$item.id`) or a bound entity."},kind:{type:String,required:!1,default:"",description:'Edge kinds to include, comma-separated (e.g. "blocks,blocked-by").'},type:{type:String,required:!1,default:"",description:"Restrict related entity types, comma-separated."},group:{type:String,required:!1,default:"kind",description:"Group-by: kind (default) | type | none."},"group-display":{type:String,required:!1,default:"headings",matches:["headings","accordion"],description:"How groups are presented: headings (default) or accordion (collapsible native <details> panels, styled like the accordion rune, with a per-group count)."},sort:{type:String,required:!1,default:"",description:"Sort related entities by a field (prefix - for descending)."},limit:{type:String,required:!1,default:"",description:"Max edges."},fields:{type:String,required:!1,default:"",description:"Comma-separated data fields to project in the no-body built-in."},layout:{type:String,required:!1,default:"list",description:"Arrangement: list (stacked) | grid (multi-column). Item chrome comes from the item — the no-body built-in, or a rune like {% card %} in the body template."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when there are no edges (no-body form; body form uses a fallback zone). Absent → render nothing."}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(l,c)=>new Sw("meta",{"data-field":l,content:c}),r=lb(e)??"",i=e.of,s=String(i&&typeof i=="object"?i.id??"":i??""),o=[t("relationships-of",s),t("relationships-kind",String(e.kind??"")),t("relationships-type",String(e.type??"")),t("relationships-group",String(e.group??"kind")),t("relationships-group-display",String(e["group-display"]??"headings")),t("relationships-sort",String(e.sort??"")),t("relationships-limit",String(e.limit??"")),t("relationships-fields",String(e.fields??"")),t("relationships-layout",String(e.layout??"list")),t("relationships-empty",String(e.empty??"")),t(KT,"true")];r&&o.push(t("relationships-body",r));const a=new Sw("div",{"data-name":"items"},[]);return Me({rune:"relationships",tag:"section",properties:{},refs:{items:a},children:[...o,a]})}}),{Tag:W7}=B,JT="__aggregate-sentinel",Y7=Xe({attributes:{type:{type:String,required:!1,default:"",description:"Entity type(s), comma-separated."},filter:{type:String,required:!1,default:"",description:"field:value clauses defining the primary set being measured (SPEC-070 grammar)."},value:{type:String,required:!1,default:"",description:'Optional secondary field:value clause defining the achieved subset within `filter` (e.g. value="status:done"). When set, $item.value is the count matching both; $item.percent is the ratio. Without it, the rune is a pure count + breakdown — no progress-bar semantics.'},group:{type:String,required:!1,default:"",description:"Group-by field; omit to render the body once with totals."},sort:{type:String,required:!1,default:"",description:"Sort groups by `key`, `count`, `value`, or `percent` (prefix `-` for descending). Honors SPEC-072 domain-aware ordering when the group field has one."},limit:{type:String,required:!1,default:"",description:"Cap the number of groups (after sort)."},empty:{type:String,required:!1,default:"",description:"Fallback text shown when the query matches no entities (self-closing form; body form uses a fallback zone). Absent → render nothing."},layout:{type:String,required:!1,default:"",matches:["chart"],description:"Render mode. Default: inline integer (no body) or body-zoned template. `chart` draws the grouped counts as an SVG via the `chart` rune's pipeline instead of a body."},"chart-type":{type:String,required:!1,default:"bar",matches:["bar","line","area","pie"],description:'Chart visualization type when layout="chart" (default bar).'},"chart-title":{type:String,required:!1,default:"",description:'Title for the chart (rendered as the data table caption) when layout="chart".'}},deferBody:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=(a,l)=>new W7("meta",{"data-field":a,content:l}),r=lb(e)??"",i=r.length>0,s=String(e.layout??""),o=[t("aggregate-type",String(e.type??"")),t("aggregate-filter",String(e.filter??"")),t("aggregate-value",String(e.value??"")),t("aggregate-group",String(e.group??"")),t("aggregate-sort",String(e.sort??"")),t("aggregate-limit",String(e.limit??"")),t("aggregate-empty",String(e.empty??"")),t("aggregate-layout",s),t("aggregate-chart-type",String(e["chart-type"]??"bar")),t("aggregate-chart-title",String(e["chart-title"]??"")),t(JT,"true")];return r&&o.push(t("aggregate-body",r)),Me({rune:"aggregate",tag:i||s==="chart"?"section":"span",properties:{},children:o})}}),{Tag:Aw}=B,eP="__file-ref-sentinel",U7=Xe({attributes:{path:{type:String,required:!0,description:"Project-root-relative file path. Same sandbox as snippet — absolute paths, traversal escapes, and out-of-root symlinks are rejected."},lines:{type:String,required:!1,description:'Line range. `"42-58"` (range), `"42"` (single line). Drives both the GitHub anchor (#L42-L58) and the drawer-body snippet slice when `preview="drawer"`.'},label:{type:String,required:!1,description:"Display text for the inline link. Defaults to the filename (e.g. `token-contract.ts`). Pass an explicit label when the file-ref refers to a symbol within the file rather than the file itself."},preview:{type:String,required:!1,matches:["drawer"],description:'Preview target. `"drawer"` hoists a drawer with the file\'s snippet + a GitHub footer link, leaving an inline link at the call site that opens it. Absent → no preview, just the inline link.'}},selfClosing:!0,contentModel:{type:"sequence",fields:[]},transform(n,e){const t=String(e.path??""),r=e.lines!==void 0?String(e.lines):"",i=e.label!==void 0?String(e.label):"",s=e.preview!==void 0?String(e.preview):"",o=G7(t),a=(u,f)=>new Aw("meta",{"data-field":u,content:f}),l=[a("file-ref-path",t),a("file-ref-lines",r),a("file-ref-label",i),a("file-ref-preview",s),a(eP,"true")],c=new Aw("a",{},[i||o]);return Me({rune:"file-ref",tag:"span",properties:{},refs:{link:c},children:[...l,c]})}});function G7(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}const{Tag:Ci}=B,H7=/^h([1-6])$/;function K7(n,e){const t=n.attributes?.[e];return typeof t=="string"?t:void 0}function J7(n,e,t){for(const r of n){const i=[],s=new Set;Mg(r.renderable,o=>{const a=K7(o,"data-drawer-id");if(!a){t.error("drawer rune is missing required `id` attribute",r.url);return}s.has(a)&&t.warn(`drawer id="${a}" is declared more than once on this page — last declaration wins`,r.url),s.add(a),i.push({id:a,title:eX(o),side:Lo(o,"side")??"right",size:Lo(o,"size")??"md",shortcut:Lo(o,"shortcut")})});for(const o of i)e.register({type:"drawer",id:o.id,scope:"page",sourceUrl:`${r.url}#drawer-${o.id}`,data:{title:o.title,side:o.side,size:o.size,shortcut:o.shortcut}})}}function Mg(n,e){if(Array.isArray(n)){for(const r of n)Mg(r,e);return}if(!Ci.isTag(n))return;const t=n;if(t.attributes?.["data-rune"]==="drawer"){e(t);return}if(t.children)for(const r of t.children)Mg(r,e)}function eX(n){const e=tP(n,"title");if(!e)return;const t=qg(e);return t.length>0?t:void 0}function tP(n,e){if(n.attributes?.["data-name"]===e)return n;for(const t of n.children??[])if(Ci.isTag(t)){const r=tP(t,e);if(r)return r}}function qg(n){return typeof n=="string"?n:Array.isArray(n)?n.map(qg).join(""):Ci.isTag(n)?(n.children??[]).map(qg).join(""):""}function tX(n){const e={lastHeadingLevel:0,mutated:!1},t=Rg(n,e);return e.mutated?t:n}function Rg(n,e){if(typeof n=="string"||typeof n=="number"||n==null)return n;if(Array.isArray(n)){let a=!1;const l=n.map(c=>{const u=Rg(c,e);return u!==c&&(a=!0),u});return a?l:n}if(!Ci.isTag(n))return n;const t=n,r=H7.exec(t.name);if(t.attributes?.[$g]==="true"){const a=e.lastHeadingLevel===0?1:e.lastHeadingLevel,l=Math.min(6,Math.max(1,a+1));e.mutated=!0;const c={...t.attributes};return delete c[$g],new Ci(`h${l}`,c,t.children)}if(r&&(e.lastHeadingLevel=Number(r[1])),!t.children||t.children.length===0)return t;let s=!1;const o=t.children.map(a=>{const l=Rg(a,e);return l!==a&&(s=!0),l});return s?new Ci(t.name,t.attributes,o):t}const ub="hoist-drawer",nP=new Map;function rP(n,e){nP.set(n,e)}function nX(n){const e={},t=n.attributes;if(!t)return e;for(const[r,i]of Object.entries(t))r.startsWith("data-")&&typeof i=="string"&&(e[r.slice(5)]=i);return e}function rX(n,e,t,r,i){const s=iX(n),o=new Map,l={payloads:o,seenIds:new Set,authorIds:s,drawerDepth:0,pageUrl:e,ctx:i,mutated:!1},c=Dg(n,l);if(o.size===0)return l.mutated?c:n;const u={pageUrl:e,registry:t,projectFiles:r,ctx:i},f=[];for(const d of o.values()){const h=d.source;if(!h){i.warn(`hoist drawer payload is missing required \`source\` attribute (target-id=${d["target-id"]??"?"})`,e);continue}const m=nP.get(h);if(!m){i.warn(`hoist drawer source "${h}" has no registered builder — skipping target-id=${d["target-id"]??"?"}`,e);continue}const p=m(d,u);p&&f.push(p)}if(f.length===0)return c;if(Array.isArray(c))return[...c,...f];if(Ci.isTag(c)){const d=c;return new Ci(d.name,d.attributes,[...d.children??[],...f])}return[c,...f]}function iX(n){const e=new Set,t=r=>{if(Array.isArray(r)){for(const s of r)t(s);return}if(!Ci.isTag(r))return;const i=r;if(i.attributes?.["data-rune"]==="drawer"){const s=i.attributes?.["data-drawer-id"];typeof s=="string"&&e.add(s);return}for(const s of i.children??[])t(s)};return t(n),e}function Dg(n,e){if(Array.isArray(n)){let o=!1;const a=[];for(const l of n){const c=Dg(l,e);c!==l&&(o=!0),c!==zl&&a.push(c)}return o?(e.mutated=!0,a):n}if(!Ci.isTag(n))return n;const t=n;if(t.name==="meta"&&t.attributes?.["data-field"]===ub){const o=nX(t),a=o["target-id"];return a?e.authorIds.has(a)?(e.ctx.info(`Hoist preview "${a}" (source=${o.source??"?"}) collides with an author-declared {% drawer id="${a}" %} on this page — author drawer wins, hoist defers.`,e.pageUrl),zl):(e.drawerDepth>0&&e.ctx.info(`Hoist preview "${a}" (source=${o.source??"?"}) appears inside another drawer's body — nested previews stack on modern browsers, consider not nesting.`,e.pageUrl),e.seenIds.has(a)||(e.payloads.set(a,o),e.seenIds.add(a)),zl):(e.ctx.warn("hoist drawer sentinel is missing required `data-target-id` attribute",e.pageUrl),zl)}const r=t.attributes?.["data-rune"]==="drawer";if(r&&e.drawerDepth++,!t.children||t.children.length===0)return r&&e.drawerDepth--,t;let i=!1;const s=[];for(const o of t.children){const a=Dg(o,e);a!==o&&(i=!0),a!==zl&&s.push(a)}return r&&e.drawerDepth--,i?(e.mutated=!0,new Ci(t.name,t.attributes,s)):t}const zl=Symbol("hoist-strip");function sX(n,e){const t=n.toLowerCase().replace(/[^a-z0-9.]+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"");if(!e)return t;const r=e.trim(),i=r.indexOf("-");if(i<0)return`${t}-L${r}`;const s=r.slice(0,i).trim(),o=r.slice(i+1).trim();return o?`${t}-L${s}-L${o}`:`${t}-L${s}`}function oX(n){if(n==null||n==="")return null;if(typeof n!="string")throw new Kr(`snippet \`lines\` attribute must be a string, got ${typeof n}`);const e=n.trim();if(e.length===0)return null;if(/^\d+$/.test(e)){const a=Number(e);if(!Number.isFinite(a)||a<1)throw new Kr(`snippet \`lines\` value "${n}" is not a positive integer`);return{start:a,end:a}}const t=/^(\d*)-(\d*)$/.exec(e);if(!t)throw new Kr(`snippet \`lines\` value "${n}" is malformed; expected "N", "N-M", "N-", or "-M"`);const r=t[1],i=t[2],s=r.length>0?Number(r):void 0,o=i.length>0?Number(i):void 0;if(s!==void 0&&(!Number.isFinite(s)||s<1))throw new Kr(`snippet \`lines\` start "${r}" is not a positive integer`);if(o!==void 0&&(!Number.isFinite(o)||o<1))throw new Kr(`snippet \`lines\` end "${i}" is not a positive integer`);if(s!==void 0&&o!==void 0&&o<s)throw new Kr(`snippet \`lines\` value "${n}" is inverted (end before start)`);return{start:s,end:o}}function aX(n,e){if(e===null)return{sliced:n,warnings:[]};const t=n.split(`
|
|
327
|
-
`),r=t.length,i=e.start??1;let s=e.end??r;const o=[];if(i>r)throw new Kr(`snippet \`lines\` start ${i} is past end of file (${r} lines)`);return s>r&&(o.push(`snippet \`lines\` end ${s} exceeds file length; clamped to ${r}`),s=r),{sliced:t.slice(i-1,s).join(`
|
|
328
|
-
`),warnings:o}}function iP(n){const e=n.files.read(n.pathAttr);if(e===null){const s=n.referencingPage?`
|
|
329
|
-
|
|
330
|
-
Referenced from: ${n.referencingPage}`:"";throw new Kr(`snippet path "${n.pathAttr}" cannot be resolved — the file is missing, not a regular file, or outside the project root.${s}`)}const t=oX(n.lines),{sliced:r,warnings:i}=aX(e,t);return{content:r,relativePath:n.pathAttr,warnings:i}}function lX(n){const e=n.files.read(n.relativePath);if(e===null)throw new Kr(`source file "${n.relativePath}" cannot be resolved — it is missing, not a regular file, or outside the project root`);return e}class Kr extends Error{constructor(e){super(e),this.name="SnippetSandboxError"}}const cX=Object.freeze({".ts":"typescript",".tsx":"typescript",".js":"javascript",".jsx":"javascript",".mjs":"javascript",".cjs":"javascript",".svelte":"svelte",".vue":"vue",".md":"markdoc",".markdoc":"markdoc",".json":"json",".jsonc":"jsonc",".html":"html",".css":"css",".yml":"yaml",".yaml":"yaml",".toml":"toml",".sh":"bash",".bash":"bash"}),Cw="text";function sP(n){if(typeof n!="string"||n.length===0)return Cw;let e;const t=Math.max(n.lastIndexOf("/"),n.lastIndexOf("\\")),r=t>=0?n.slice(t+1):n,i=r.lastIndexOf(".");return i===-1?e="."+r.toLowerCase():i===0?e=r.toLowerCase():e=r.slice(i).toLowerCase(),cX[e]??Cw}const{Tag:lr}=B;function fb(n){return lr.isTag(n)}function tf(n,e){for(const t of n.children??[])if(fb(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function uX(n){return(n.children??[]).some(e=>fb(e)&&e.name==="meta"&&e.attributes["data-field"]===eP)}function fX(n){return{path:tf(n,"file-ref-path"),lines:tf(n,"file-ref-lines"),label:tf(n,"file-ref-label"),preview:tf(n,"file-ref-preview")}}function oP(n){if(!n)return"";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function dX(n,e,t,r,i){const s={value:!1},o=a=>{if(Array.isArray(a)){let f=!1;const d=a.map(h=>{const m=o(h);return m!==h&&(f=!0),m});return f?d:a}if(!fb(a))return a;const l=a;if(l.attributes?.["data-rune"]==="file-ref"&&uX(l))return hX(l,e,t,r,i,s);if(!l.children||l.children.length===0)return l;let c=!1;const u=l.children.map(f=>{const d=o(f);return d!==f&&(c=!0),d});return c?new lr(l.name,l.attributes,u):l};return o(n)}function hX(n,e,t,r,i,s){const o=fX(n),a=o.label||oP(o.path)||o.path,l=sX(o.path,o.lines),c=o.preview==="drawer",u=I9(t,r,o.path,o.lines);!u&&!s.value&&(i.warn(`file-ref on this page has no GitHub URL — site config is missing \`repoUrl\` (path="${o.path}"). Configure \`SiteConfig.repoUrl\` to render canonical "View source" links.`,e),s.value=!0);const f={};c?(f.href=`#drawer-${l}`,f["aria-controls"]=`drawer-${l}`,f["aria-expanded"]="false",f["data-target-type"]="drawer"):u&&(f.href=u);const h=[new lr("a",f,[a])];if(c){const m=new lr("meta",{"data-field":ub,"data-source":"file-ref","data-target-id":l,"data-title":a,"data-path":o.path,"data-lines":o.lines,"data-github-url":u??""});h.push(m)}return new lr(n.name,n.attributes,h)}function pX(n,e){const t=n.path,r=n.lines,i=n.title||oP(t),s=n["target-id"],o=n["github-url"];if(!t||!s)return e.ctx.warn("file-ref hoist payload missing required path or target-id",e.pageUrl),null;if(!e.projectFiles)return e.ctx.error(`file-ref hoist for "${t}" requires a file provider in the pipeline; none was threaded through. Drawer body will be empty.`,e.pageUrl),null;let a="",l="text";try{const w=iP({files:e.projectFiles,pathAttr:t,lines:r||void 0,referencingPage:e.pageUrl});a=w.content,l=sP(w.relativePath);for(const S of w.warnings)e.ctx.warn(`file-ref ${t}: ${S}`,e.pageUrl)}catch(w){const S=w instanceof Kr?w.message:`file-ref ${t}: ${w instanceof Error?w.message:String(w)}`;return e.ctx.error(S,e.pageUrl),null}const c=new lr("pre",{"data-language":l,"data-codeblock":"true"},[new lr("code",{"data-language":l,"data-codeblock":"true"},[a])]),u=new lr("figure",{class:"rf-snippet","data-rune":"snippet","data-source-path":t,...r?{"data-lines":r}:{}},[c]),f=new lr("div",{"data-name":"body",class:"rf-drawer__body"},[u]),d=new lr("h3",{"data-name":"title",class:"rf-drawer__title"},[i]),h=new lr("button",{type:"button","aria-label":"Close",hidden:!0,"data-name":"close",class:"rf-drawer__close"},["×"]),m=new lr("header",{"data-name":"header",class:"rf-drawer__header"},[d,h]),p=[];o&&p.push(new lr("a",{href:o,rel:"external noopener",target:"_blank"},["View source on GitHub →"]));const v=p.length>0?new lr("footer",{"data-name":"footer",class:"rf-drawer__footer"},p):null,O=[m,f];return v&&O.push(v),new lr("section",{id:`drawer-${s}`,class:"rf-drawer","data-rune":"drawer","data-drawer-id":s,"data-side":"right","data-size":"md"},O)}rP("file-ref",pX);const{Tag:Gr}=B;function mX(n){return Gr.isTag(n)}function gX(n,e,t,r){const i=s=>{if(Array.isArray(s)){let c=!1;const u=[];for(const f of s){const d=i(f);d!==f&&(c=!0),Array.isArray(d)?u.push(...d):u.push(d)}return c?u:s}if(!mX(s))return s;const o=s;if(o.attributes?.["data-rune"]===ob&&o.attributes?.["data-xref-preview"]==="drawer")return vX(o,t,r,e);if(!o.children||o.children.length===0)return o;let a=!1;const l=[];for(const c of o.children){const u=i(c);u!==c&&(a=!0),Array.isArray(u)?l.push(...u):l.push(u)}return a?new Gr(o.name,o.attributes,l):o};return i(n)}function vX(n,e,t,r){const i=n.attributes,s=String(i["data-xref-id"]??""),o=i["data-xref-label"];if(!s)return t.warn(`xref preview placeholder on ${r} has no entity id`,r),[n];const a=e?aP(e,s):void 0,l=o||(a?Tw(a):s),c=a?Tw(a):s,u=s,f=new Gr("a",{class:"rf-xref",href:`#drawer-${u}`,"aria-controls":`drawer-${u}`,"aria-expanded":"false","data-target-type":"drawer","data-xref-id":s},[l]),d=new Gr("meta",{"data-field":ub,"data-source":"xref","data-target-id":u,"data-title":c,"data-entity-id":s});return[f,d]}function aP(n,e){const t=n.getTypes?.()??[];for(const r of t){const i=n.getById(r,e);if(i)return i}}function Tw(n){const e=n.data;return String(e.title??e.name??n.id)}function OX(n,e){const t=n["entity-id"]||n["target-id"],r=n["target-id"],i=n.title||t;if(!t||!r)return e.ctx.warn("xref hoist payload missing required entity-id or target-id",e.pageUrl),null;const s=e.registry?aP(e.registry,t):void 0,o=new Gr("h3",{"data-name":"title",class:"rf-drawer__title"},[i]),a=new Gr("button",{type:"button","aria-label":"Close",hidden:!0,"data-name":"close",class:"rf-drawer__close"},["×"]),l=new Gr("header",{"data-name":"header",class:"rf-drawer__header"},[o,a]),u=[new Gr("div",{"data-rune":ab,"data-expand-id":t},[])],f=new Gr("div",{"data-name":"body",class:"rf-drawer__body"},u),d=s?.sourceUrl??"",h=d?new Gr("footer",{"data-name":"footer",class:"rf-drawer__footer"},[new Gr("a",{href:d},["View full page →"])]):null,m=[l,f];return h&&m.push(h),new Gr("section",{id:`drawer-${r}`,class:"rf-drawer","data-rune":"drawer","data-drawer-id":r,"data-side":"right","data-size":"md"},m)}rP("xref",OX);const{Tag:Zl}=B,bX=["fraction","percent","none"],yX=["positive","caution","negative"];function Ig(n){return typeof n=="string"?n:Array.isArray(n)?n.map(Ig).join(""):B.Tag.isTag(n)?Ig(n.children??[]):""}const wX=Xe({attributes:{value:{type:Number,required:!1,description:"Completed amount (paired with `max`)."},max:{type:Number,required:!1,description:"Total amount (paired with `value`)."},percent:{type:Number,required:!1,description:"Direct percentage 0–100, when there is no count."},display:{type:String,required:!1,matches:bX.slice(),description:"Readout: fraction (default with value/max), percent, or none."},sentiment:{type:String,required:!1,matches:yX.slice(),description:"Tone cue: positive / caution / negative. Absent → the neutral primary fill."}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=e.value!=null?Number(e.value):void 0,i=e.max!=null?Number(e.max):void 0,s=e.percent!=null?Number(e.percent):void 0,o=_=>Math.max(0,Math.min(100,_)),a=r!=null&&i!=null&&Number.isFinite(r)&&Number.isFinite(i)&&i>0,l=a?o(Math.round(r/i*100)):s!=null&&Number.isFinite(s)?o(s):0,c=e.display||(a?"fraction":"percent");let u="";c==="fraction"&&a?u=`${r}/${i}`:c==="percent"&&(u=`${l}%`);const d=new Re(B.transform(nt(n.body),t)).toArray(),h=Ig(d).trim(),m=e.sentiment,p=m?new Zl("meta",{content:m}):void 0,v=new Zl("span",{},[]),O=new Zl("span",{},[v]),b={track:O,fill:v},w=p?[p]:[];if(d.length>0){const _=new Zl("span",{},d);b.label=_,w.push(_)}if(u){const _=new Zl("span",{},[u]);b.value=_,w.push(_)}w.push(O);const S=Me({rune:"progress",tag:"div",properties:p?{sentiment:p}:{},refs:b,children:w});return S.attributes.role="progressbar",S.attributes["aria-valuemin"]="0",a?(S.attributes["aria-valuenow"]=String(r),S.attributes["aria-valuemax"]=String(i)):(S.attributes["aria-valuenow"]=String(l),S.attributes["aria-valuemax"]="100"),h&&(S.attributes["aria-label"]=h),S.attributes.style=`--rf-progress: ${l}%`,S}}),{Tag:Oo}=B,lP={media:"media",body:"body"},_X=Xe({sections:lP,provides:["prose"],base:SZ,attributes:{href:{type:String,required:!1,default:"",description:"Optional link target; makes the whole card clickable."},"content-place":{type:String,required:!1,description:'Cover overlay anchor: "<block> <inline>" (e.g. "end start") or "auto"'},height:{type:String,required:!1,matches:["sm","md","lg","xl"],description:"Intrinsic card height (named scale) for cover / bg-only cards"},aspect:{type:String,required:!1,description:'Intrinsic card aspect ratio (e.g. "16/9", "3/4") for cover / bg-only cards'}},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const{media:r,body:i,footer:s}=CZ(nt(n.body)),{metas:o,children:a}=AZ(e),l=e["content-place"],c=e.height,u=e.aspect,f=l?new Oo("meta",{content:l}):void 0,d=c?new Oo("meta",{content:c}):void 0,h=u?new Oo("meta",{content:u}):void 0,m=[...a];if(f&&m.push(f),d&&m.push(d),h&&m.push(h),r.length>0){const k=new Re(B.transform(r,t)),P=TZ(k),T=P?[P]:k.toArray();m.push(new Oo("div",{"data-section":"media","data-name":"media"},T))}let p,v=i;i.length>=2&&i[0].type==="paragraph"&&i[1].type==="heading"&&(p=i[0],v=i.slice(1));let O;if(p){const P=new Re(B.transform([p],t)).toArray()[0];B.Tag.isTag(P)&&(O=P)}const w=new Re(B.transform(v,t)).toArray(),S=w.find(k=>B.Tag.isTag(k)&&/^h[1-6]$/.test(k.name)),_=new Oo("div",{"data-name":"body"},w);let x;if(s.length>0){const k=new Re(B.transform(s,t));x=new Oo("footer",{"data-name":"footer"},k.toArray())}O&&m.push(O),m.push(_),x&&m.push(x);let A;const C=String(e.href??"");C&&(A=new Oo("a",{"data-name":"link",href:C,"aria-hidden":"true",tabindex:"-1"},[]),m.push(A));const y={body:_};return S&&(y.title=S),O&&(y.eyebrow=O),x&&(y.footer=x),A&&(y.link=A),Me({rune:"card",tag:"div",properties:{"media-position":o.mediaPosition,"content-place":f,height:d,aspect:h},refs:y,children:m})}}),{Tag:kX}=B,xX=["positive","negative","caution","neutral"],SX=["status","category","quantity","temporal","tag","id"],cP={inline:!0,attributes:{sentiment:{type:String,required:!1,matches:xX.slice(),description:"Sentiment dimension: positive, negative, caution, neutral. Default: neutral."},type:{type:String,required:!1,matches:SX.slice(),description:"Meta-type dimension: status, category, quantity, temporal, tag, id. Default: tag."}},transform(n,e){const t=n.attributes.sentiment??"neutral",r=n.attributes.type??"tag",i={class:"rf-badge","data-rune":"badge","data-meta-sentiment":t,"data-meta-type":r},s=n.transformChildren(e);return new kX("span",i,s)}};xl(cP,"inline");const{Tag:Xp}=B;function AX(n){const e=n.findIndex(t=>t.type==="hr");return e<0?{left:n,right:[]}:{left:n.slice(0,e),right:n.slice(e+1)}}const CX=Xe({attributes:{},contentModel:{type:"sequence",fields:[{name:"body",match:"any",optional:!0,greedy:!0}]},transform(n,e,t){const r=AX(nt(n.body)),i=B.transform(r.left,t),s=B.transform(r.right,t),o=new Xp("div",{},i),a=r.right.length>0?new Xp("div",{"data-align":"end"},s):null,l=a?[o,a]:[o];return new Xp("div",{"data-rune":"bar","data-zone-layout":"bar"},l)}}),{Ast:nf,Tag:bo}=B;function TX(n){const e=n.children??[];if(e.length===0)return null;let t,r;const i=e[0];if(i?.type==="inline")t=i,r=e.slice(1);else if(i?.type==="paragraph")t=i.children?.[0],r=e.slice(1);else return null;if(!t||t.type!=="inline")return null;const s=t.children??[];if(s.length===0)return null;const o=s[0];if(!o||o.type!=="strong")return null;const a=o.children??[];let l="";for(const p of a)p.type==="text"&&typeof p.attributes?.content=="string"&&(l+=p.attributes.content);if(!l.endsWith(":"))return null;const c=l.slice(0,-1),u=[new nf.Node("text",{content:c})],f=s.slice(1),d=(()=>{const p=f[0];if(p?.type==="text"&&typeof p.attributes?.content=="string"){const v=p.attributes.content.replace(/^\s+/,"");return v===""?f.slice(1):[new nf.Node("text",{content:v}),...f.slice(1)]}return f})(),h=d.length>0?[new nf.Node("inline",{},d)]:[],m=h.length>0?[new nf.Node("paragraph",{},h)]:[];return{term:u,rest:h,restBlocks:[...m,...r]}}const PX=Xe({attributes:{},contentModel:{type:"sequence",fields:[{name:"list",match:"list",optional:!1}]},transform(n,e,t){const i=nt(n.list).find(a=>a.type==="list");if(!i)return new bo("dl",{"data-rune":"deflist","data-zone-layout":"definition-list"},[]);const s=(i.children??[]).filter(a=>a.type==="item"),o=[];for(const a of s){const l=TX(a);let c,u;if(l){const f=B.transform(l.term,t),d=B.transform(l.restBlocks,t);c=new bo("dt",{"data-meta-label":""},f),u=new bo("dd",{},Pw(d))}else{const f=B.transform(a.children??[],t);c=new bo("dt",{"data-meta-label":""},[]),u=new bo("dd",{},Pw(f)),EX(a)}o.push(new bo("div",{"data-name":"row"},[c,u]))}return new bo("dl",{"data-rune":"deflist","data-zone-layout":"definition-list"},o)}});function Pw(n){if(n.length!==1)return n;const e=n[0];return!B.Tag.isTag(e)||e.name!=="p"?n:e.children}const Ew=new Set;function EX(n){const e=n.location??null,t=e?`${e.start?.line??"?"}:${e.start?.character??"?"}`:"unknown";Ew.has(t)||(Ew.add(t),console.warn(`[refrakt] {% deflist %} item at line ${e?.start?.line??"?"} lacks a \`**Term:**\` prefix — rendered with empty <dt>. Prefix the item with bold term text ending in \`:\` to label it.`))}class $X{constructor(e){this.name=e.name,this.aliases=e.aliases??[],this.schema=e.schema,this.description=e.description??"",this.seoType=e.seoType,this.typeName=e.typeName,this.schemaOrgType=e.schemaOrgType,this.authoringHints=e.authoringHints,this.category=e.category,this.snippet=e.snippet}get names(){return[this.name,...this.aliases]}}function je(n){return new $X(n)}function QX(n){const e={};for(const t of Object.values(n))for(const r of t.names)e[r]=t.schema;return e}const{Ast:LX}=B;class sJ extends LX.Node{constructor(e,t,r,i){super(e,t,r,i)}transform(e){return super.transform(e)}}[...B8];const MX=new Set(["id","type","sourceFile","sourceUrl"]);function qX(n){const e=[];let t="",r=!1;for(const i of n){if(i==='"'){r=!r;continue}if(!r&&/\s/.test(i)){t&&(e.push(t),t="");continue}t+=i}return t&&e.push(t),e}function Vc(n){const e=[],t=new Map;if(!n||!n.trim())return{clauses:[],warnings:e};for(const r of qX(n)){const i=r.indexOf(":");if(i===-1){e.push(`Ignored filter clause "${r}": expected field:value`);continue}const s=r.slice(0,i);if(!s){e.push(`Ignored filter clause "${r}": empty field name`);continue}const o=r.slice(i+1),a=t.get(s);a?a.push(o):t.set(s,[o])}return{clauses:[...t.entries()].map(([r,i])=>({field:r,values:i})),warnings:e}}function uP(n,e){return e==="url"?n.sourceUrl??n.data.url??"":MX.has(e)?n[e]:n.data[e]}function RX(n){const e=n.split("*").map(t=>t.replace(/[.+?^${}()|[\]\\]/g,"\\$&"));return new RegExp("^"+e.join(".*")+"$")}const DX=/^\/(.+)\/([gimsuy]*)$/,IX=/[\\^$.+?()[\]{}|]/;function fP(n,e){const t=e.match(DX);if(t&&(t[2].length>0||IX.test(t[1])))try{return new RegExp(t[1],t[2]).test(n)}catch{return n===e}return e.includes("*")?RX(e).test(n):n===e}function NX(n){if(Array.isArray(n))return n.map(t=>String(t??""));const e=String(n??"");return e.includes(",")?e.split(",").map(t=>t.trim()):[e]}function kh(n,e){for(const t of e.clauses){const r=NX(uP(n,t.field));if(!t.values.some(s=>r.some(o=>fP(o,s))))return!1}return!0}function za(n){return String(n??"").replace(/([a-z0-9])([A-Z])/g,"$1 $2").replace(/[-_]+/g," ").replace(/\b\w/g,e=>e.toUpperCase()).trim()}const{Tag:zs,Ast:BX}=B;function db(n){if(!n)return{template:""};const e=B.parse(`
|
|
331
|
-
`+n),t=[[]];for(const s of e.children)s.type==="hr"?t.push([]):t[t.length-1].push(s);if(t.length===1)return{template:n};const r=s=>s.length?B.format(new BX.Node("document",{},s)):"",i=t.map(r);return i.length===2?{preamble:i[0]||void 0,template:i[1]}:{preamble:i[0]||void 0,template:i[1],fallback:i[2]||void 0}}class jX{constructor(e,t={}){this.matches=e,this.overrides=t}order(e,t){return this.overrides[e]?.[t]??this.matches[e]?.[t]}rank(e,t,r){const i=this.order(e,t);return i?i.indexOf(r):-1}}function hb(n){const e={},t=n?.tags??{};for(const[r,i]of Object.entries(t)){const s=i?.attributes;if(s)for(const[o,a]of Object.entries(s)){const l=a?.matches;Array.isArray(l)&&l.every(c=>typeof c=="string")&&((e[r]??={})[o]=l)}}return new jX(e,n?.orderings??{})}function dP(n){return n.sourceUrl||String(n.data.url??"")}function zX(n){const e=n.data;return String(e.title??e.name??n.id)}function Fr(n,e){const t=uP(n,e);return Array.isArray(t)?t.join(", "):String(t??"")}function hP(n,e){const t=dP(n),r=zX(n),i=`${e}__title`;return t?new zs("a",{class:i,href:t},[r]):new zs("span",{class:i},[r])}function ZX(n){return n.id||String(n.data?.name??"")}function pb(n,e){const t=n.data?.status,r=t?e?.sentiments?.[n.type]?.status?.[t]??"":"";return{id:n.id,identifier:ZX(n),type:n.type,url:dP(n),data:n.data,sentiment:r,mixed:e?.mixed??!1,group:e?.group??"",groupCount:e?.groupCount??0}}function FX(n,e,t){if(!e)return n;let r=e.trim(),i=1;r.startsWith("-")?(i=-1,r=r.slice(1)):r.endsWith("-desc")?(i=-1,r=r.slice(0,-5)):r.endsWith("-asc")&&(r=r.slice(0,-4));const s=t&&n.some(o=>t.order(o.type,r));return[...n].sort((o,a)=>{if(s){const d=t.rank(o.type,r,Fr(o,r)),h=t.rank(a.type,r,Fr(a,r)),m=d>=0,p=h>=0;if(m&&p){if(d!==h)return(d-h)*i}else if(m!==p)return m?-1:1}const l=Fr(o,r),c=Fr(a,r),u=Number(l),f=Number(c);return l!==""&&c!==""&&Number.isFinite(u)&&Number.isFinite(f)?(u-f)*i:l.localeCompare(c)*i})}function pP(n,e){const t=new Map;for(const r of n){const i=e(r),s=t.get(i);s?s.push(r):t.set(i,[r])}return t}function Ng(n,e,t){const r=pP(n,o=>Fr(o,e)||"(none)");if(!t||![...n].some(o=>t.order(o.type,e)))return r;const i=o=>{let a=1/0;for(const l of o){const c=t.rank(l.type,e,Fr(l,e));c>=0&&c<a&&(a=c)}return a},s=[...r.entries()].sort((o,a)=>i(o[1])-i(a[1]));return new Map(s)}function mP(n){const e=n.map(t=>new zs("details",{class:"rf-accordion-item","data-group":t.key},[new zs("summary",{class:"rf-accordion-item__header"},[new zs("span",{class:"rf-accordion-item__title"},[t.label]),new zs("span",{class:"rf-accordion-item__count"},[String(t.count)])]),new zs("div",{class:"rf-accordion-item__body"},t.nodes)]));return[new zs("div",{class:"rf-accordion"},e)]}function vs(n,e,t){const r=cb(n,e,t);return Array.isArray(r)?r:[r]}const{Tag:It,Ast:XX}=B;function Bg(n){return hP(n,"rf-collection")}function mb(n){return It.isTag(n)}function ji(n,e){for(const t of n.children??[])if(mb(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function VX(n){return(n.children??[]).some(e=>mb(e)&&e.name==="meta"&&e.attributes["data-field"]===HT)}function WX(n){const e=ji(n,"collection-limit"),t=Number(e);return{types:ji(n,"collection-type").split(",").map(r=>r.trim()).filter(Boolean),filter:ji(n,"collection-filter"),sort:ji(n,"collection-sort"),group:ji(n,"collection-group"),groupDisplay:ji(n,"collection-group-display")||"headings",limit:e&&Number.isFinite(t)&&t>0?Math.floor(t):void 0,fields:ji(n,"collection-fields").split(",").map(r=>r.trim()).filter(Boolean),layout:ji(n,"collection-layout")||"list",bodySource:ji(n,"collection-body"),empty:ji(n,"collection-empty")}}function YX(n,e){const t=e.fields.map(r=>new It("span",{class:"rf-collection__field","data-field":r},[Fr(n,r)]));return e.layout==="list"?new It("div",{class:"rf-collection__item","data-entity-id":n.id},[Bg(n)]):new It("article",{class:"rf-collection__card","data-entity-id":n.id},[Bg(n),...t])}function UX(n,e,t){const r=B.parse(n),i=[];let s=null;for(const o of r.children)if(o.type==="heading"){const a=B.format(o).replace(/^#+\s*/,"").trim();a.includes("$item")&&e.warn(`collection: $item in a table column heading ("${a}") is not per-row; use a static label`,t),s={label:a,cellNodes:[]},i.push({label:a,cellSource:""})}else s&&(s.cellNodes.push(o),i[i.length-1].cellSource=B.format(new XX.Node("document",{},s.cellNodes)));return i}function GX(n,e,t,r,i,s){const o=UX(e,r,i);if(!t)return r.error("collection — table column templates present but no embedConfig threaded through the pipeline",i),new It("table",{class:"rf-collection__table"},[]);const a=new It("thead",{},[new It("tr",{},o.map(c=>new It("th",{},[c.label])))]),l=n.map(c=>{const u=pb(c,s),f=o.map(d=>{const h=cb(d.cellSource,t,{item:u}),m=Array.isArray(h)?h:[h];return new It("td",{},m)});return new It("tr",{"data-entity-id":c.id},f)});return new It("table",{class:"rf-collection__table"},[a,new It("tbody",{},l)])}function HX(n,e){const t=[new It("th",{},["Title"]),...e.fields.map(s=>new It("th",{},[za(s)]))],r=new It("thead",{},[new It("tr",{},t)]),i=n.map(s=>{const o=[new It("td",{},[Bg(s)]),...e.fields.map(a=>new It("td",{"data-field":a},[Fr(s,a)]))];return new It("tr",{"data-entity-id":s.id},o)});return new It("table",{class:"rf-collection__table"},[r,new It("tbody",{},i)])}function KX(n,e,t,r,i,s){return t?n.map(o=>{const a=pb(o,s),l=cb(e,t,{item:a}),c=Array.isArray(l)?l:[l];return new It("div",{class:"rf-collection__item","data-entity-id":o.id,"data-block":""},c)}):(r.error("collection — body template present but no embedConfig threaded through the pipeline",i),[])}function rf(n,e,t,r){if(!e.group)return r(n);const i=Ng(n,e.group,t);if(e.groupDisplay==="accordion")return mP([...i].map(([o,a])=>({key:o,label:o,count:a.length,nodes:r(a,{group:o,groupCount:a.length})})));const s=[];for(const[o,a]of i)s.push(new It("div",{class:"rf-collection__group","data-group":o},[new It("h3",{class:"rf-collection__group-title"},[o]),...r(a,{group:o,groupCount:a.length})]));return s}function JX(n,e,t,r,i,s){const o=WX(n);let a=[];for(const b of o.types)a.push(...e.getAll(b));if(o.filter){const b=Vc(o.filter);for(const w of b.warnings)i.warn(`collection filter: ${w}`,s);a=a.filter(w=>kh(w,b))}a=FX(a,o.sort,r);const l=a.length;o.limit!==void 0&&a.length>o.limit&&(a=a.slice(0,o.limit));const c={count:l,shown:a.length},u=db(o.bodySource),f=u.template,d={...n.attributes,"data-type":o.types.join(","),"data-layout":o.layout},m={mixed:new Set(a.map(b=>b.type)).size>1&&o.group!=="type",sentiments:t?.sentiments};if(a.length===0){const b=[];return u.fallback&&t?b.push(new It("div",{"data-name":"empty",class:"rf-collection__empty"},vs(u.fallback,t,c))):o.empty&&b.push(new It("div",{"data-name":"empty",class:"rf-collection__empty"},[o.empty])),new It(n.name,d,b)}let p;o.layout==="table"&&f?p=rf(a,o,r,(b,w)=>[GX(b,f,t,i,s,{...m,...w})]):f?p=rf(a,o,r,(b,w)=>KX(b,f,t,i,s,{...m,...w})):o.layout==="table"?p=rf(a,o,r,b=>[HX(b,o)]):p=rf(a,o,r,b=>b.map(w=>YX(w,o)));const v=new It("div",{"data-name":"items",class:"rf-collection__items"},p),O=[];return u.preamble&&t&&O.push(new It("div",{"data-name":"preamble",class:"rf-collection__preamble"},vs(u.preamble,t,c))),new It(n.name,d,[...O,v])}function eV(n,e,t,r,i){const s=hb(r),o=a=>{if(Array.isArray(a))return a.map(o);if(!mb(a))return a;const l=a;return l.attributes?.["data-rune"]==="collection"&&VX(l)?JX(l,t,r,s,i,e):!l.children||l.children.length===0?l:new It(l.name,l.attributes,l.children.map(o))};return o(n)}const{Tag:kr}=B;function gb(n){return kr.isTag(n)}function mi(n,e){for(const t of n.children??[])if(gb(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function tV(n){return(n.children??[]).some(e=>gb(e)&&e.name==="meta"&&e.attributes["data-field"]===KT)}function Vp(n){return n.split(",").map(e=>e.trim()).filter(Boolean)}function nV(n){const e=mi(n,"relationships-limit"),t=Number(e);return{of:mi(n,"relationships-of"),kinds:Vp(mi(n,"relationships-kind")),types:Vp(mi(n,"relationships-type")),group:mi(n,"relationships-group")||"kind",groupDisplay:mi(n,"relationships-group-display")||"headings",sort:mi(n,"relationships-sort"),limit:e&&Number.isFinite(t)&&t>0?Math.floor(t):void 0,fields:Vp(mi(n,"relationships-fields")),layout:mi(n,"relationships-layout")||"list",bodySource:mi(n,"relationships-body"),empty:mi(n,"relationships-empty")}}function rV(n,e,t){if(!e)return n;let r=e.trim(),i=1;r.startsWith("-")?(i=-1,r=r.slice(1)):r.endsWith("-desc")?(i=-1,r=r.slice(0,-5)):r.endsWith("-asc")&&(r=r.slice(0,-4));const s=n.some(o=>t.order(o.target.type,r));return[...n].sort((o,a)=>{if(s){const u=t.rank(o.target.type,r,Fr(o.target,r)),f=t.rank(a.target.type,r,Fr(a.target,r)),d=u>=0,h=f>=0;if(d&&h){if(u!==f)return(u-f)*i}else if(d!==h)return d?-1:1}const l=Fr(o.target,r),c=Fr(a.target,r);return l.localeCompare(c)*i})}function $w(n){return hP(n,"rf-relationships")}function iV(n,e){const t=e.fields.map(i=>new kr("span",{class:"rf-relationships__field","data-field":i},[Fr(n.target,i)])),r={"data-entity-id":n.target.id,"data-kind":n.kind};return e.layout==="grid"?new kr("article",{class:"rf-relationships__card",...r},[$w(n.target),...t]):new kr("div",{class:"rf-relationships__item",...r},[$w(n.target),...t])}function Wp(n,e,t,r){return n.map(i=>{if(t&&r){const s=vs(t,r,{item:pb(i.target),kind:i.kind});return new kr("div",{class:"rf-relationships__item","data-entity-id":i.target.id,"data-kind":i.kind,"data-block":""},s)}return iV(i,e)})}function sV(n,e,t,r,i,s){const o=nV(n);o.of||i.warn("relationships — no `of` entity given (pass of=$item.id on an entity page)",s);let a=o.of&&e.getRelated?e.getRelated(o.of,{kind:o.kinds.length?o.kinds:void 0,type:o.types.length?o.types:void 0}):[];a=rV(a,o.sort,r);const l=a.length;o.limit!==void 0&&a.length>o.limit&&(a=a.slice(0,o.limit));const c={count:l,shown:a.length},u=db(o.bodySource),f=u.template,d={...n.attributes,"data-of":o.of,"data-layout":o.layout};if(a.length===0){const v=[];return u.fallback&&t?v.push(new kr("div",{"data-name":"empty",class:"rf-relationships__empty"},vs(u.fallback,t,c))):o.empty&&v.push(new kr("div",{"data-name":"empty",class:"rf-relationships__empty"},[o.empty])),new kr(n.name,d,v)}let h;if(o.group==="none")h=Wp(a,o,f,t);else{const v=o.group==="type"?b=>b.target.type:b=>b.kind,O=pP(a,v);if(o.groupDisplay==="accordion")h=mP([...O].map(([b,w])=>({key:b,label:za(b),count:w.length,nodes:Wp(w,o,f,t)})));else{h=[];for(const[b,w]of O)h.push(new kr("div",{class:"rf-relationships__group","data-group":b},[new kr("h3",{class:"rf-relationships__group-title"},[za(b)]),...Wp(w,o,f,t)]))}}const m=new kr("div",{"data-name":"items",class:"rf-relationships__items"},h),p=[];return u.preamble&&t&&p.push(new kr("div",{"data-name":"preamble",class:"rf-relationships__preamble"},vs(u.preamble,t,c))),new kr(n.name,d,[...p,m])}function oV(n,e,t,r,i){const s=hb(r),o=a=>{if(Array.isArray(a))return a.map(o);if(!gb(a))return a;const l=a;return l.attributes?.["data-rune"]==="relationships"&&tV(l)?sV(l,t,r,s,i,e):!l.children||l.children.length===0?l:new kr(l.name,l.attributes,l.children.map(o))};return o(n)}const{Tag:vn}=B;function vb(n){return vn.isTag(n)}function gi(n,e){for(const t of n.children??[])if(vb(t)&&t.name==="meta"&&t.attributes["data-field"]===e)return String(t.attributes.content??"");return""}function aV(n){return(n.children??[]).some(e=>vb(e)&&e.name==="meta"&&e.attributes["data-field"]===JT)}function lV(n){const e=gi(n,"aggregate-limit"),t=Number(e);return{types:gi(n,"aggregate-type").split(",").map(r=>r.trim()).filter(Boolean),filter:gi(n,"aggregate-filter"),value:gi(n,"aggregate-value"),group:gi(n,"aggregate-group"),sort:gi(n,"aggregate-sort"),limit:e&&Number.isFinite(t)&&t>0?Math.floor(t):void 0,bodySource:gi(n,"aggregate-body"),empty:gi(n,"aggregate-empty"),layout:gi(n,"aggregate-layout"),chartType:gi(n,"aggregate-chart-type")||"bar",chartTitle:gi(n,"aggregate-chart-title")}}function cV(n,e,t,r){const i=f=>new vn("td",{},[f]),s=f=>new vn("th",{},[f]),o=[za(e.group||"group"),"Count"];t&&o.push("Value");const a=new vn("tr",{},o.map(s)),l=n.map(([f,d])=>{const h=gP(r,d,e.group,f),p=[h?new vn("td",{"data-meta-sentiment":h},[za(f)]):i(za(f)),i(String(d.length))];return t&&p.push(i(String(Mo(d,t)))),new vn("tr",{},p)}),c=[];e.chartTitle&&c.push(new vn("caption",{},[e.chartTitle])),c.push(new vn("thead",{},[a])),c.push(new vn("tbody",{},l));const u=new vn("table",{"data-name":"data"},c);return new vn("rf-chart",{"data-rune":"chart","data-rune-fields":JSON.stringify({type:e.chartType,stacked:"false"}),"data-type":e.chartType,"data-stacked":"false"},[u])}function Ad(n,e){return e<=0?0:Math.round(n/e*100)}function Mo(n,e){return e?n.filter(t=>kh(t,e)).length:n.length}function gP(n,e,t,r){const i=e[0]?.type??"";return n?.[i]?.[t]?.[r]??""}function Qw(n,e,t,r,i){if(!e)return n;let s=e.trim(),o=1;return s.startsWith("-")?(o=-1,s=s.slice(1)):s.endsWith("-desc")?(o=-1,s=s.slice(0,-5)):s.endsWith("-asc")&&(s=s.slice(0,-4)),s==="count"?[...n].sort(([,a],[,l])=>(a.length-l.length)*o):s==="value"?[...n].sort(([,a],[,l])=>(Mo(a,i)-Mo(l,i))*o):s==="percent"?[...n].sort(([,a],[,l])=>{const c=Ad(Mo(a,i),a.length),u=Ad(Mo(l,i),l.length);return(c-u)*o}):[...n].sort(([a,l],[c,u])=>{const f=l[0]?.type??"",d=u[0]?.type??"",h=r.rank(f,t,a),m=r.rank(d,t,c),p=h>=0,v=m>=0;if(p&&v){if(h!==m)return(h-m)*o}else if(p!==v)return p?-1:1;return a.localeCompare(c)*o})}function uV(n,e,t,r,i,s){const o=lV(n);let a=[];for(const S of o.types)a.push(...e.getAll(S));if(o.filter){const S=Vc(o.filter);for(const _ of S.warnings)i.warn(`aggregate filter: ${_}`,s);a=a.filter(_=>kh(_,S))}const l=o.value?Vc(o.value):null;if(l)for(const S of l.warnings)i.warn(`aggregate value: ${S}`,s);const c=a.length,u=Mo(a,l),f=o.value?Ad(u,c):100;if(o.layout==="chart"){if(c===0)return new vn("div",{"data-name":"empty",class:"rf-aggregate__empty"},o.empty?[o.empty]:[]);let S=[...Ng(a,o.group,r).entries()];return S=Qw(S,o.sort,o.group,r,l),o.limit!==void 0&&S.length>o.limit&&(S=S.slice(0,o.limit)),cV(S,o,l,t?.sentiments)}if(!o.bodySource)return new vn(n.name,{...n.attributes,"data-aggregate":"count","data-count":String(c)},[String(c)]);const d=db(o.bodySource),h=d.template,m={...n.attributes,"data-aggregate":"breakdown"};if(c===0){const S=[];if(d.fallback&&t){const _={item:{key:"",count:0,value:0,percent:0,total:0,shown:0}};S.push(new vn("div",{"data-name":"empty",class:"rf-aggregate__empty"},vs(d.fallback,t,_)))}else o.empty&&S.push(new vn("div",{"data-name":"empty",class:"rf-aggregate__empty"},[o.empty]));return new vn(n.name,m,S)}const p=[];if(d.preamble&&t){const S={item:{count:c,value:u,percent:f,total:c}};p.push(new vn("div",{"data-name":"preamble",class:"rf-aggregate__preamble"},vs(d.preamble,t,S)))}if(!o.group){const S=[...p];if(h&&t){const _={item:{key:"",count:c,value:u,percent:f,total:c,shown:1}};S.push(new vn("div",{"data-name":"items",class:"rf-aggregate__items"},vs(h,t,_)))}return new vn(n.name,m,S)}let v=[...Ng(a,o.group,r).entries()];v=Qw(v,o.sort,o.group,r,l),o.limit!==void 0&&v.length>o.limit&&(v=v.slice(0,o.limit));const O=v.length,b=[];if(h&&t)for(const[S,_]of v){const x=_.length,A=Mo(_,l),C=o.value?Ad(A,x):100,y={item:{key:S,count:x,value:A,percent:C,total:c,shown:O,sentiment:gP(t?.sentiments,_,o.group,S)}},k=vs(h,t,y);b.push(new vn("div",{class:"rf-aggregate__group","data-group":S,"data-block":""},k))}const w=new vn("div",{"data-name":"items",class:"rf-aggregate__items"},b);return new vn(n.name,m,[...p,w])}function fV(n,e,t,r,i){const s=hb(r),o=a=>{if(Array.isArray(a))return a.map(o);if(!vb(a))return a;const l=a;return l.attributes?.["data-rune"]==="aggregate"&&aV(l)?uV(l,t,r,s,i,e):!l.children||l.children.length===0?l:new vn(l.name,l.attributes,l.children.map(o))};return o(n)}const{Tag:Ob}=B,dV=500;function vP(n){return Ob.isTag(n)}function hV(n){const e=String(n.attributes["data-rf-query"]??"").trim();if(!e)return null;const t=Number(n.attributes["data-rf-limit"]);return{expr:e,fields:String(n.attributes["data-rf-fields"]??"").split(",").map(r=>r.trim()).filter(Boolean),shape:String(n.attributes["data-rf-shape"]??"flat")||"flat",limit:Number.isFinite(t)&&t>0?Math.floor(t):void 0}}function pV(n,e){const t=n.data,r=String(n.sourceUrl??t.url??"");let i;if(e.length>0){i={};for(const s of e)i[s]=t[s]}else i={...t};return{id:n.id,type:n.type,url:r,data:i}}function Lw(n){return n.length>1&&n.endsWith("/")?n.slice(0,-1):n}function mV(n){const e=new Map;for(const r of n)e.set(Lw(r.url),{...r,children:[]});const t=[];for(const r of e.values()){const i=Lw(String(r.data.parentUrl??"")),s=i?e.get(i):void 0;s&&s!==r?s.children.push(r):t.push(r)}return t}function gV(n,e){if(!e.getRelated)return[];const t=new Set(n.map(i=>i.id)),r=[];for(const i of n)for(const s of e.getRelated(i.id))t.has(s.toId)&&r.push({from:s.fromId,to:s.toId,kind:s.kind});return r}function vV(n){return(n.children??[]).some(e=>vP(e)&&e.name==="template"&&e.attributes["data-content"]==="fallback")}function OV(n,e,t,r,i){const s=Vc(e.expr);for(const h of s.warnings)r.warn(`sandbox data: ${h}`,i);const o=s.clauses.find(h=>h.field==="type"),a=o?o.values:[];if(a.length===0)return r.warn(`sandbox data="${e.expr}": no entity type — include a "type:<name>" clause`,i),n;let l=[];for(const h of a)l.push(...t.getAll(h));const c={clauses:s.clauses.filter(h=>h.field!=="type")};c.clauses.length>0&&(l=l.filter(h=>kh(h,c)));let u=l.map(h=>pV(h,e.fields));const f=e.limit??dV;u.length>f&&(r.warn(`data-bound sandbox query "${e.expr}" yielded ${u.length} records, over the ${f} cap — truncated`,i),u=u.slice(0,f)),vV(n)||r.warn("data-bound sandbox has no fallback — provide a no-WebGL fallback (e.g. a {% collection %} with the same query) for accessibility",i);const d=e.shape==="tree"?{shape:"tree",tree:mV(u)}:e.shape==="graph"?{shape:"graph",nodes:u,edges:gV(u,t)}:{shape:"flat",records:u};return new Ob(n.name,{...n.attributes,"data-rf-records":JSON.stringify(d)},n.children??[])}function jg(n,e,t,r){if(Array.isArray(n))return n.map(o=>jg(o,e,t,r));if(!vP(n))return n;const i=(n.children??[]).map(o=>jg(o,e,t,r));let s=new Ob(n.name,n.attributes,i);if(s.name==="rf-sandbox"&&s.attributes["data-rf-query"]){const o=hV(s);o&&(s=OV(s,o,e,t,r))}return s}const{Tag:bV}=B;function zg(n){return n==null||typeof n=="string"||typeof n=="number"?n:bV.isTag(n)?{$$mdtype:"Tag",name:n.name,attributes:n.attributes,children:n.children.map(zg)}:n}function yV(n){return Array.isArray(n)?n.map(zg):zg(n)}const{Tag:Cd}=B;function wV(n,e,t,r){const i=r?[r]:n.getTypes();for(const s of i){const o=n.getById(s,e,t);if(o)return o}}function _V(n,e,t){const r=e.toLowerCase(),i=t?[t]:n.getTypes(),s=[];for(const o of i)for(const a of n.getAll(o)){const l=a.data.name??"",c=a.data.title??"";(l.toLowerCase()===r||c.toLowerCase()===r)&&s.push(a)}return s}function Mw(n){const e=n.data.url||n.sourceUrl;if(!e)return;const t=n.data.headingId;return t?`${e}#${t}`:e}function qw(n,e,t){if(e)return e;if(t){const r=t.data.title,i=t.data.name,s=t.data.text;return r||i||s||n}return n}const OP=/\{([a-zA-Z_$][a-zA-Z0-9_$]*)\}/g;function kV(n){return n.split("/").map(encodeURIComponent).join("/")}function xV(n,e,t){return n.replace(OP,(r,i)=>{const s=i==="id"?e:t[i]??"";return kV(s)})}function SV(n,e,t){return n.replace(OP,(r,i)=>i==="id"?e:t[i]??"")}function AV(n,e){for(const t of e){const r=t.match.exec(n);if(!r)continue;const i=r.groups??{};return{url:xV(t.template,n,i),label:SV(t.label,n,i),type:t.type}}}function CV(n,e){const t=n.indexOf("#");if(t<0)return n;const r=n.slice(0,t),i=n.slice(t),s=o=>o.endsWith("/")?o.slice(0,-1):o;return s(r)===s(e)?i:n}function TV(n,e,t,r){let i=wV(r.registry,n,r.pageUrl,t);if(!i){const c=_V(r.registry,n,t);if(c.length===1)i=c[0];else if(c.length>1){if(new Set(c.map(f=>Mw(f)??f.sourceUrl??"")).size>1){const f=c.map(d=>`${d.type} "${d.data.title||d.data.name||d.id}" on ${d.sourceUrl??"(no URL)"}`).join(", ");r.ctx.warn(`xref "${n}" on ${r.pageUrl} — matches ${c.length} entities (${f}). Add type hint to disambiguate.`,r.pageUrl)}i=c[0]}}const s=i?Mw(i):void 0;let o;if(i&&s)o={href:s,label:qw(n,e,i),type:i.type,source:"registry",targetType:i.type,entityId:i.id};else{const c=AV(n,r.patterns);c&&(o={href:c.url,label:qw(n,e,i)||c.label,type:i?.type??c.type,source:"pattern",targetType:i?.type,entityId:i?.id},!i&&!e&&(o.label=c.label))}if(!o)return r.ctx.warn(`xref "${n}" on ${r.pageUrl} — entity not found`,r.pageUrl),{tag:new Cd("span",{class:"rf-xref rf-xref--unresolved","data-xref-id":n},[e||n])};o.href===r.pageUrl&&r.ctx.info(`xref "${n}" on ${r.pageUrl} — references itself`,r.pageUrl);const a=CV(o.href,r.pageUrl),l={class:`rf-xref rf-xref--${o.type}`,href:a,"data-xref-id":o.entityId??n,"data-xref-source":o.source};return o.targetType&&(l["data-target-type"]=o.targetType),{tag:new Cd("a",l,[o.label])}}function PV(n,e,t,r,i){return Zg(n,{pageUrl:e,registry:t,patterns:r,ctx:i})}function Zg(n,e){if(!Cd.isTag(n)){if(Array.isArray(n)){const i=n,s=i.map(o=>Zg(o,e));return s.every((o,a)=>o===i[a])?n:s}return n}const t=n;if(t.attributes?.["data-rune"]===ob){const i=t.attributes["data-xref-id"],s=t.attributes["data-xref-label"],o=t.attributes["data-xref-type"];return i?TV(i,s,o,e).tag:new Cd("span",{class:"rf-xref rf-xref--unresolved"},[s||"?"])}const r=(t.children??[]).map(i=>Zg(i,e));return r.every((i,s)=>i===t.children[s])?t:{...t,children:r}}const{Ast:bP,Tag:Fg}=B;function sf(n,e){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"&&"$$mdtype"in n){const t=n;if(t.$$mdtype==="Variable"&&Array.isArray(t.path)){let r=e;for(const i of t.path){if(r==null)return"";r=r[i]}return r==null?"":String(r)}}return""}const EV=new Set(["code-group","diff"]);function $V(n,e,t){if(!t.sandbox)return;let r=!1;return yP(n,e,t,t.sandbox,i=>{i&&(r=!0)}),r?n:void 0}function yP(n,e,t,r,i){if(n.children)for(let s=0;s<n.children.length;s++){const o=n.children[s];if(o.type==="tag"&&o.tag==="snippet"){n.children[s]=QV(o,e,t,r),i(!0);continue}yP(o,e,t,r,i)}}function Yp(n,e){return new bP.Node("fence",{content:`snippet error: ${e}
|
|
332
|
-
`,language:"text",source:n||"(unresolved)","data-snippet-error":e})}function QV(n,e,t,r){const i=sf(n.attributes.path,t.variables),s=n.attributes.lines!==void 0?sf(n.attributes.lines,t.variables):void 0,o=n.attributes.lang!==void 0?sf(n.attributes.lang,t.variables):void 0,a=n.attributes.linenumbers===!0,l=n.attributes.highlight!==void 0?sf(n.attributes.highlight,t.variables):void 0;if(!i){const d="snippet `path` attribute is required (and an unresolvable variable reference resolves to empty)";return t.error(d,e.url),Yp("",d)}let c;try{c=iP({files:r,pathAttr:i,lines:s||void 0,referencingPage:e.relativePath})}catch(d){if(d instanceof Kr)return t.error(d.message,e.url),Yp(i,d.message);const h=d.message??String(d);return t.error(`snippet "${i}" failed unexpectedly: ${h}`,e.url),Yp(i,h)}for(const d of c.warnings)t.warn(d,e.url);const u=o&&o.length>0?o:sP(c.relativePath),f={content:c.content,language:u,source:c.relativePath};return s&&(f.lines=s),a&&(f.linenumbers=!0),l&&l.length>0&&(f.highlight=l),new bP.Node("fence",f)}function LV(n,e,t){const r=Xg(n.renderable,!1);return r===n.renderable?n:{...n,renderable:r}}function Xg(n,e){if(Array.isArray(n)){let l=!1;const c=n.map(u=>{const f=Xg(u,e);return f!==u&&(l=!0),f});return l?c:n}if(!Fg.isTag(n))return n;const t=n,r=t.attributes?.["data-rune"],i=typeof r=="string"&&EV.has(r),s=e||i;if(t.name==="pre"&&t.attributes?.["data-source"]!==void 0&&!e)return MV(t);if(!t.children||t.children.length===0)return t;let o=!1;const a=t.children.map(l=>{const c=Xg(l,s);return c!==l&&(o=!0),c});return o?new Fg(t.name,t.attributes,a):t}function MV(n){const e=n.attributes,t=String(e["data-source"]??""),r=e["data-lines"]!==void 0?String(e["data-lines"]):void 0,i={class:"rf-snippet","data-rune":"snippet","data-source-path":t};return r&&(i["data-lines"]=r),new Fg("figure",i,[n])}class ir extends Error{constructor(e){super(e),this.name="DataSourceError"}}function qV(n){const e=n.lastIndexOf(".");if(e===-1)return null;switch(n.slice(e+1).toLowerCase()){case"csv":return"csv";case"tsv":return"tsv";case"json":return"json";case"ndjson":case"jsonl":return"ndjson";default:return null}}function RV(n,e){const t=[];let r=[],i="",s=!1,o=!1;const a=()=>{r.push(i),i=""},l=()=>{a(),t.push(r),r=[],o=!1};for(let c=0;c<n.length;c++){const u=n[c];if(s){u==='"'?n[c+1]==='"'?(i+='"',c++):s=!1:i+=u;continue}if(u==='"'){s=!0,o=!0;continue}if(u===e){a(),o=!0;continue}if(u==="\r"){o=!0;continue}if(u===`
|
|
333
|
-
`){l();continue}i+=u,o=!0}return(o||i.length>0||r.length>0)&&l(),t}function DV(n,e){const t=e.delimiter&&e.delimiter.length>0?e.delimiter:e.format==="tsv"?" ":",",r=RV(n,t).filter(c=>!(c.length===1&&c[0]===""));if(r.length===0)throw new ir("source is empty (no rows)");const i=e.header!==!1;let s,o;if(i)s=r[0].map(c=>c.trim()),o=1;else{const c=r.reduce((u,f)=>Math.max(u,f.length),0);s=Array.from({length:c},(u,f)=>`col${f+1}`),o=0}const a=s.length,l=[];for(let c=o;c<r.length;c++){const u=r[c],f=[];for(let d=0;d<a;d++)f.push(u[d]??"");l.push(f)}return{headers:s,rows:l}}function Vg(n){return n==null?"":Array.isArray(n)?n.map(e=>e==null?"":String(e)).join(", "):typeof n=="object"?JSON.stringify(n):String(n)}function wP(n,e="",t={}){for(const[r,i]of Object.entries(n)){const s=e?`${e}.${r}`:r;i!==null&&typeof i=="object"&&!Array.isArray(i)?wP(i,s,t):t[s]=Vg(i)}return t}function Wg(n,e){const t=n.map(o=>wP(o)),r=new Set,i=[];e&&(i.push(e.header),r.add(e.header));for(const o of t)for(const a of Object.keys(o))r.has(a)||(r.add(a),i.push(a));const s=t.map((o,a)=>i.map((l,c)=>e&&c===0?e.values[a]:o[l]??""));return{headers:i,rows:s}}function IV(n,e){if(!e)return n;const t=e.startsWith("/")?e.slice(1).split("/").map(i=>i.replace(/~1/g,"/").replace(/~0/g,"~")):e.split(".");let r=n;for(const i of t){if(r===null||typeof r!="object")throw new ir(`root path "${e}" does not resolve to a value`);r=r[i]}if(r===void 0)throw new ir(`root path "${e}" not found in the document`);return r}function NV(n,e={}){let t;try{t=JSON.parse(n)}catch(o){throw new ir(`invalid JSON — ${o.message}`)}const r=IV(t,e.root??"");let i=e.orient;if(!i)if(Array.isArray(r))i=Array.isArray(r[0])?"values":"records";else throw r&&typeof r=="object"?new ir('source is an object map — set orient="index" (with key-column) to tabulate it'):new ir("source is not an array or object of records");if(i==="values"){if(!Array.isArray(r)||r.length===0)throw new ir('orient="values" expects a non-empty array of arrays');const[o,...a]=r,l=o.map(Vg),c=a.map(u=>l.map((f,d)=>Vg(u[d])));return{headers:l,rows:c}}if(i==="index"){if(!r||typeof r!="object"||Array.isArray(r))throw new ir('orient="index" expects an object map ({ key: record, … })');const o=Object.entries(r),a=o.map(([,c])=>c&&typeof c=="object"&&!Array.isArray(c)?c:{value:c}),l=o.map(([c])=>c);return Wg(a,{header:e.keyColumn&&e.keyColumn.length>0?e.keyColumn:"key",values:l})}if(!Array.isArray(r))throw new ir('orient="records" expects an array of objects');const s=r.map(o=>o&&typeof o=="object"&&!Array.isArray(o)?o:{value:o});return Wg(s)}function BV(n){const e=[],t=n.split(`
|
|
334
|
-
`);for(let r=0;r<t.length;r++){const i=t[r].trim();if(i==="")continue;let s;try{s=JSON.parse(i)}catch(o){throw new ir(`invalid NDJSON on line ${r+1} — ${o.message}`)}e.push(s&&typeof s=="object"&&!Array.isArray(s)?s:{value:s})}if(e.length===0)throw new ir("source is empty (no NDJSON records)");return Wg(e)}function Ea(n){const e=n.trim();if(e==="")return null;const t=e.replace(/[$£€¥₹]/g,"").replace(/,/g,"").replace(/\s/g,"");if(!/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(t))return null;const r=Number(t);return Number.isFinite(r)?r:null}function _P(n,e){return n.indexOf(e)}function jV(n){const e=zV(n,","),t=[];for(const r of e){const i=r.trim();if(i==="")continue;const s=/^(.*?)\s+as\s+(.+)$/i.exec(i);s?t.push({source:Up(s[1].trim()),as:Up(s[2].trim())}):t.push({source:Up(i)})}return t}function zV(n,e){const t=[];let r="",i=null;for(const s of n){if(i){s===i?i=null:r+=s;continue}if(s==='"'||s==="'"){i=s;continue}if(s===e){t.push(r),r="";continue}r+=s}return t.push(r),t}function Up(n){return n.length>=2&&(n[0]==='"'&&n[n.length-1]==='"'||n[0]==="'"&&n[n.length-1]==="'")?n.slice(1,-1):n}function ZV(n,e){const t=Vc(e);if(t.clauses.length===0)return{table:n,warnings:t.warnings};const r=new Map(n.headers.map((s,o)=>[s,o])),i=n.rows.filter(s=>t.clauses.every(o=>{const a=r.get(o.field),l=a===void 0?"":s[a]??"";return o.values.some(c=>fP(l,c))}));return{table:{headers:n.headers,rows:i},warnings:t.warnings}}function FV(n,e){if(!e||e.trim()==="")return{table:n,sources:[...n.headers]};const r=jV(e).map(a=>({sel:a,idx:_P(n.headers,a.source)})).filter(a=>a.idx!==-1);if(r.length===0)return{table:n,sources:[...n.headers]};const i=r.map(a=>a.sel.as??a.sel.source),s=r.map(a=>a.sel.source),o=n.rows.map(a=>r.map(l=>a[l.idx]??""));return{table:{headers:i,rows:o},sources:s}}function XV(n,e){if(!e||e.trim()==="")return n;const t=e.trim(),r=t.startsWith("-"),i=r?t.slice(1).trim():t,s=_P(n.headers,i);if(s===-1)return n;const o=n.rows.map(c=>c[s]??""),a=o.every(c=>c.trim()===""||Ea(c)!==null)&&o.some(c=>Ea(c)!==null),l=[...n.rows].sort((c,u)=>{const f=c[s]??"",d=u[s]??"";let h;if(a){const m=Ea(f),p=Ea(d);m===null&&p===null?h=0:m===null?h=1:p===null?h=-1:h=m-p}else h=f.localeCompare(d,void 0,{numeric:!0,sensitivity:"base"});return r?-h:h});return{headers:n.headers,rows:l}}function VV(n,e,t){const r=t&&t>0?t:0;if(r===0&&(e===void 0||e<0))return n;const i=e!==void 0&&e>=0?r+e:void 0;return{headers:n.headers,rows:n.rows.slice(r,i)}}function WV(n,e={}){const t=new Set(e.numeric??[]),r=new Set(e.text??[]),i=e.sources,s=n.headers.map((a,l)=>{const c=i?.[l]??a;return r.has(a)||r.has(c)?"text":t.has(a)||t.has(c)||YV(n.rows,l)?"numeric":"text"}),o=n.rows.map(a=>a.map((l,c)=>({text:l,value:s[c]==="numeric"?Ea(l):null})));return{headers:n.headers,columnTypes:s,rows:o}}function YV(n,e){let t=!1;for(const r of n){const i=r[e]??"";if(i.trim()!==""){if(Ea(i)===null)return!1;t=!0}}return t}const{Ast:vi}=B;function Yg(n){return new vi.Node("inline",{},[new vi.Node("text",{content:n})])}function UV(n){const e=n.headers.map(s=>new vi.Node("th",{},[Yg(s)])),t=new vi.Node("thead",{},[new vi.Node("tr",{},e)]),r=n.rows.map(s=>{const o=s.map((a,l)=>{const c=n.columnTypes[l]==="numeric"&&a.value!==null?{"data-value":String(a.value)}:{};return new vi.Node("td",c,[Yg(a.text)])});return new vi.Node("tr",{},o)}),i=new vi.Node("tbody",{},r);return new vi.Node("table",{},[t,i])}function Rw(n){const e=new vi.Node("paragraph",{},[Yg(n)]);return new vi.Node("tag",{type:"caution"},[e],"hint")}function Oi(n,e){if(n==null)return"";if(typeof n=="string")return n;if(typeof n=="number"||typeof n=="boolean")return String(n);if(typeof n=="object"&&"$$mdtype"in n){const t=n;if(t.$$mdtype==="Variable"&&Array.isArray(t.path)){let r=e;for(const i of t.path){if(r==null)return"";r=r[i]}return r==null?"":String(r)}}return""}function Dw(n){return n.split(",").map(e=>e.trim()).filter(e=>e.length>0)}function GV(n,e,t){if(!t.sandbox)return;let r=!1;return kP(n,e,t,t.sandbox,()=>{r=!0}),r?n:void 0}function kP(n,e,t,r,i){if(n.children)for(let s=0;s<n.children.length;s++){const o=n.children[s];if(o.type==="tag"&&o.tag==="data"){n.children[s]=HV(o,e,t,r),i();continue}kP(o,e,t,r,i)}}function HV(n,e,t,r){const i=n.attributes,s=Oi(i.src,t.variables);if(!s){const o="data `src` attribute is required (and an unresolvable variable reference resolves to empty)";return t.error(o,e.url),Rw(`data error: ${o}`)}try{const o=r.read(s);if(o===null)throw new ir(`source "${s}" cannot be resolved — the file is missing or outside the project root`);const a=KV(s,Oi(i.format,t.variables)),l=JV(o,a,i,t),{table:c,warnings:u}=ZV(l,Oi(i.where,t.variables)||void 0);for(const b of u)t.warn(`data "${s}": ${b}`,e.url);const f=XV(c,Oi(i.sort,t.variables)||void 0),{table:d,sources:h}=FV(f,Oi(i.columns,t.variables)||void 0),m=VV(d,Iw(i.limit),Iw(i.offset));if(m.rows.length===0)throw new ir("result is empty after projection (no rows to render)");const p=Dw(Oi(i.numeric,t.variables)),v=Dw(Oi(i.text,t.variables)),O=WV(m,{numeric:p,text:v,sources:h});return UV(O)}catch(o){const a=o instanceof ir?o.message:`unexpected failure — ${o instanceof Error?o.message:String(o)}`;return t.error(`data "${s}": ${a}`,e.url),Rw(`data error: ${a}`)}}function KV(n,e){if(e)return e;const t=qV(n);if(t)return t;throw new ir(`could not infer format from "${n}" — add format="csv|tsv|json|ndjson"`)}function JV(n,e,t,r){switch(e){case"csv":case"tsv":return DV(n,{format:e,delimiter:Oi(t.delimiter,r.variables)||void 0,header:t.header===void 0?void 0:t.header!==!1});case"json":{const i=Oi(t.orient,r.variables);return NV(n,{root:Oi(t.root,r.variables)||void 0,orient:i||void 0,keyColumn:Oi(t["key-column"],r.variables)||void 0})}case"ndjson":return BV(n);default:throw new ir(`unsupported format "${e}"`)}}function Iw(n){if(typeof n=="number"&&Number.isFinite(n))return n;if(typeof n=="string"&&n.trim()!==""){const e=Number(n);return Number.isFinite(e)?e:void 0}}const{Tag:Ko}=B,xP=/^h[1-6]$/,Ug="data-outline-scope";function eW(n){const e=new Set;return Kg(n,[],e),e.size>0&&Jg(n,e),n}function tW(n){const e=[];return Gg(n,!1,e),e}function Gg(n,e,t){if(Array.isArray(n)){for(const o of n)Gg(o,e,t);return}if(!Ko.isTag(n))return;const r=n,i=r.attributes;if(xP.test(r.name)){if(e)return;const o=Number(r.name.slice(1)),a=typeof i?.id=="string"?i.id:"",l=Hg(r);a&&l&&t.push({level:o,text:l,id:a});return}const s=e||i&&typeof i[Ug]=="string";if(!(!r.children||r.children.length===0))for(const o of r.children)Gg(o,!!s,t)}function Hg(n){return typeof n=="string"?n:typeof n=="number"?String(n):Array.isArray(n)?n.map(Hg).join(""):Ko.isTag(n)?(n.children??[]).map(Hg).join(""):""}function Kg(n,e,t){if(Array.isArray(n)){for(const a of n)Kg(a,e,t);return}if(!Ko.isTag(n))return;const r=n,i=r.attributes,s=i&&typeof i[Ug]=="string"?i[Ug]:void 0;if(xP.test(r.name)&&e.length>0){const a=e[e.length-1],l=typeof i?.id=="string"?i.id:void 0;l&&!l.startsWith(`${a}--`)&&(t.add(l),r.attributes.id=`${a}--${l}`);return}const o=s!==void 0?[...e,s]:e;if(!(!r.children||r.children.length===0))for(const a of r.children)Kg(a,o,t)}function Jg(n,e){if(Array.isArray(n)){for(const i of n)Jg(i,e);return}if(!Ko.isTag(n))return;const t=n;if(t.attributes?.["data-rune"]==="table-of-contents"){nW(t,e);return}if(t.children)for(const i of t.children)Jg(i,e)}function nW(n,e){for(const t of n.children??[])ev(t,e)}function ev(n,e){if(Array.isArray(n)){for(const r of n)ev(r,e);return}if(!Ko.isTag(n))return;const t=n;(t.name==="ul"||t.name==="ol")&&(t.children=(t.children??[]).filter(r=>{if(!Ko.isTag(r))return!0;const i=r;return i.name!=="li"?!0:!SP(i,e)}));for(const r of t.children??[])ev(r,e)}function SP(n,e){for(const t of n.children??[]){if(!Ko.isTag(t))continue;const r=t;if(r.name==="a"){const i=r.attributes?.href;if(typeof i=="string"&&i.startsWith("#")&&e.has(i.slice(1)))return!0}if(SP(r,e))return!0}return!1}const{Tag:Wc}=B,rW=new Map;function iW(n,e,t,r,i,s){return Td(n,{pageUrl:e,registry:t,patterns:r,embedConfig:i,ctx:s,parseCache:rW},[])}function Td(n,e,t){if(Array.isArray(n)){let a=!1;const l=n.map(c=>{const u=Td(c,e,t);return u!==c&&(a=!0),u});return a?l:n}if(!Wc.isTag(n))return n;const r=n;if(r.attributes?.["data-rune"]===ab)return sW(r,e,t);if(!r.children||r.children.length===0)return r;let s=!1;const o=r.children.map(a=>{const l=Td(a,e,t);return l!==a&&(s=!0),l});return s?new Wc(r.name,r.attributes,o):r}function sW(n,e,t){const r=n.attributes,i=String(r["data-expand-id"]??""),s=r["data-expand-type"],o=r["data-expand-level"],a=r["data-expand-canonical"]==="true",l=r["data-expand-label"];if(!i)return e.ctx.error(`expand placeholder is missing \`primary\`/id attribute on ${e.pageUrl}`,e.pageUrl),Rs(i,"missing id attribute");const c=o!==void 0?Number(o):void 0,u=oW(e.registry,i,e.pageUrl,s);if(!u)return e.ctx.error(`expand "${i}" on ${e.pageUrl} — entity not found`,e.pageUrl),Rs(i,"entity not found");if(!u.embed&&!(u.sourceFile&&u.extract))return e.ctx.error(`expand "${i}" on ${e.pageUrl} — entity type "${u.type}" does not support embedding (no embed() or sourceFile/extract)`,e.pageUrl),Rs(i,`entity type "${u.type}" does not support embedding`);if(t.some(w=>w.type===u.type&&w.id===u.id)){const w=[...t,{type:u.type,id:u.id}].map(S=>`${S.id} (${S.type})`).join(" → ");return e.ctx.error(`expand cycle detected on ${e.pageUrl}. Cycle: ${w}`,e.pageUrl),Rs(i,"cycle detected")}let f;if(u.embed)f=u.embed();else{const w=e.embedConfig?.projectFiles;if(!w)return e.ctx.error(`expand "${i}" — no file provider configured (embedConfig.projectFiles is unset)`,e.pageUrl),Rs(i,"no file provider configured");let S;try{S=cW(u.sourceFile,w,e.parseCache)}catch(_){const x=(_ instanceof Kr,_.message);return e.ctx.error(`expand "${i}" — failed to read source file "${u.sourceFile}": ${x}`,e.pageUrl),Rs(i,x)}f=u.extract(S)}if(!f)return e.ctx.error(`expand "${i}" — extractor returned no content; the entity may be out-of-sync with the registry`,e.pageUrl),Rs(i,"extractor returned no content");let d=f;if(c!==void 0&&c!==1){const w=c-1,S=[];d=AP(f,w,S),S.length>0&&e.ctx.warn(`expand "${i}" at ${e.pageUrl} — heading demotion (level=${c}) would push ${S.length} heading(s) past H6. Clamped to H6: ${S.map(_=>`"${_}"`).join(", ")}`,e.pageUrl)}if(!e.embedConfig)return e.ctx.error(`expand "${i}" — no embedConfig threaded through the pipeline`,e.pageUrl),Rs(i,"no embed transform config");const h=[...t,{type:u.type,id:u.id}],m=B.transform(d,e.embedConfig),p=Td(m,e,h),v=aW(u,e.patterns),O={"data-rune":"expand","data-entity-id":u.id,"data-entity-type":u.type,"data-source":"registry"};c===void 0&&(O["data-outline-scope"]=u.id),v&&(O["data-canonical-href"]=v);const b=[];if(Array.isArray(p)?b.push(...p):b.push(p),a){const w=l||lW(u),S={class:v?"rf-expand__canonical-link":"rf-expand__canonical-link rf-xref--unresolved"};v&&(S.href=v),b.push(new Wc("a",S,[w]))}return new Wc("section",O,b)}function oW(n,e,t,r){const i=r?[r]:n.getTypes();for(const o of i){const a=n.getById(o,e,t);if(a)return a}const s=e.toLowerCase();for(const o of i)for(const a of n.getAll(o)){const l=a.data.name??"",c=a.data.title??"";if(l.toLowerCase()===s||c.toLowerCase()===s)return a}}function aW(n,e){const t=n.sourceUrl,i=n.data.url||t;if(i){const s=n.data.headingId;return s?`${i}#${s}`:i}for(const s of e){const o=s.match.exec(n.id);if(!o)continue;const a=o.groups??{},l=/\{([a-zA-Z_$][a-zA-Z0-9_$]*)\}/g;return s.template.replace(l,(c,u)=>(u==="id"?n.id:a[u]??"").split("/").map(encodeURIComponent).join("/"))}}function lW(n){const e=n.data.title,t=n.data.name;return e?`View ${n.type}: ${e}`:t?`View ${n.type}: ${t}`:`View ${n.type} ${n.id}`}function cW(n,e,t){const r=t.get(n);if(r)return r;const i=lX({files:e,relativePath:n}),s=B.parse(i);return t.set(n,s),s}function AP(n,e,t){if(n.type==="heading"){const i=n.attributes.level+e;if(i>6){const s=uW(n);t.push(s),n.attributes.level=6}else n.attributes.level=i}for(const r of n.children??[])AP(r,e,t);return n}function uW(n){const e=[];for(const t of n.walk())t.type==="text"&&typeof t.attributes.content=="string"&&e.push(t.attributes.content);return e.join("")}function Rs(n,e){return new Wc("section",{"data-rune":"expand","data-entity-id":n,"data-expand-error":e},[`expand "${n}" — ${e}`])}const{Tag:De}=B,Fl={header:"preamble",eyebrow:"eyebrow",headline:"headline",blurb:"blurb",image:"image"},fW={runes:{Accordion:{block:"accordion",defaultDensity:"full",sections:TT,autoLabel:Fl,editHints:{headline:"inline",eyebrow:"inline",blurb:"inline"}},AccordionItem:{block:"accordion-item",parent:"Accordion",requiresParent:"Accordion",rootAttributes:{"data-state":"closed"},autoLabel:{name:"header"},sections:CT,provides:["prose"],sectionRoleExceptions:{header:"The `header` slot is the <summary> disclosure control, not a page-section header. `header` would inherit the chrome-row rhythm (a 3rem margin under every summary); `title` would tighten every summary's line-height while leaving `prominence` inert anyway, since `.rf-accordion-item__header` pins the control's font size on purpose. The parent Accordion already holds `title`."},editHints:{header:"inline",body:"none"}},Details:{block:"details",defaultElevation:"flush",autoLabel:{summary:"summary"},editHints:{summary:"inline",body:"none"}},Grid:{block:"grid",defaultDensity:"full",childDensity:"compact",modifiers:{mode:{source:"meta",default:"columns"},collapse:{source:"meta",noBemClass:!0},aspect:{source:"meta",noBemClass:!0},stack:{source:"meta",noBemClass:!0},ratio:{source:"meta",noBemClass:!0},valign:{source:"meta",noBemClass:!0},gap:{source:"meta",noBemClass:!0},min:{source:"meta",noBemClass:!0}},styles:{ratio:{prop:"--grid-ratio",transform:X8},valign:{prop:"--grid-valign",transform:U0},gap:{prop:"--grid-gap",transform:F8},min:"--grid-min",aspect:"--grid-aspect"},editHints:{cell:"none"}},CodeGroup:{block:"codegroup",interactive:!0,defaultDensity:"compact",defaultElevation:"flat",modifiers:{title:{source:"meta",noBemClass:!0},overflow:{source:"meta",default:"scroll"}},metaFields:{title:{metaType:"code",condition:"title",renderWhenEmpty:!0}},blocks:{topbar:{fields:["title"],layout:"bar"}},layout:{root:["topbar"]},sections:gT,rootAttributes:{"data-code-host":"true"},editHints:{panel:"code"}},PageSection:{block:"page-section"},TableOfContents:{block:"toc",defaultElevation:"flush"},Snippet:{block:"snippet"},Data:{block:"data"},Expand:{block:"expand",universalAttributes:"none"},Badge:{block:"badge",universalAttributes:"inline"},Bar:{block:"bar"},Deflist:{block:"deflist"},Collection:{block:"collection"},Relationships:{block:"relationships"},FileRef:{block:"file-ref"},Aggregate:{block:"aggregate"},Progress:{block:"progress",modifiers:{sentiment:{source:"meta"}}},Card:{block:"card",modifiers:{"media-position":{source:"meta",default:"top",noBemClass:!0},"media-ratio":{source:"meta",noBemClass:!0},valign:{source:"meta",noBemClass:!0},collapse:{source:"meta",noBemClass:!0},"content-place":{source:"meta",noBemClass:!0},height:{source:"meta",noBemClass:!0},aspect:{source:"meta",noBemClass:!0}},sections:lP,provides:["prose"],layout:{root:["media","content"],content:{tag:"div",children:["eyebrow","body","footer"]}},variants:{"media-position":{cover:{staticModifiers:["cover"],rootAttributes:{"data-cover-scope":"full"}}}},styles:{valign:{prop:"--split-valign",transform:U0},aspect:"aspect-ratio"}},Embed:{block:"embed",defaultDensity:"compact",defaultElevation:"flat",modifiers:{provider:{source:"meta",default:"generic",noBemClass:!0}},editHints:{fallback:"none"}},Breadcrumb:{block:"breadcrumb",defaultDensity:"minimal",defaultElevation:"flush",editHints:{items:"none"},modifiers:{separator:{source:"meta",default:"/",noBemClass:!0}},styles:{separator:{prop:"--separator",template:'"{}"'}}},BreadcrumbItem:{block:"breadcrumb-item",parent:"Breadcrumb",requiresParent:"Breadcrumb"},Blog:{block:"blog",defaultDensity:"full",sections:YT,provides:["prose"],contentWrapper:{tag:"div",ref:"content"},modifiers:{layout:{source:"meta",default:"list"},sort:{source:"meta",default:"date-desc",noBemClass:!0},filter:{source:"meta",noBemClass:!0},limit:{source:"meta",noBemClass:!0},folder:{source:"meta",noBemClass:!0}},autoLabel:Fl,editHints:{headline:"inline",blurb:"inline"}},Budget:{block:"budget",defaultDensity:"full",defaultElevation:"flat",sections:ET,editHints:{headline:"inline"},modifiers:{currency:{source:"meta",default:"USD"},duration:{source:"meta"},showPerDay:{source:"meta",default:"true"},variant:{source:"meta",default:"detailed"}},metaFields:{duration:{metaType:"category",condition:"duration"},currency:{metaType:"category",condition:"currency"}},blocks:{meta:{fields:["duration",{field:"currency",align:"end"}],layout:"bar"}},layout:{root:["meta","preamble"],preamble:{tag:"header",children:["headline","blurb","image"]}}},BudgetCategory:{block:"budget-category",parent:"Budget",modifiers:{estimate:{source:"meta",default:"false"},label:{source:"meta",noBemClass:!0},subtotal:{source:"meta",noBemClass:!0}},editHints:{label:"none",subtotal:"none"}},BudgetLineItem:{block:"budget-line-item",parent:"Budget"},Hint:{block:"hint",defaultDensity:"compact",defaultElevation:"sunken",modifiers:{hintType:{source:"meta",default:"note"}},contextModifiers:{hero:"in-hero",feature:"in-feature"},sections:vT,i18nEnums:{note:"Note",warning:"Warning",caution:"Caution",check:"Check"},metaFields:{hintType:{icon:{group:"hint"}}},blocks:{header:{fields:["hintType"],layout:"bar"}},layout:{root:["header"]}},Drawer:{block:"drawer",defaultDensity:"compact",modifiers:{side:{source:"meta",default:"right"},size:{source:"meta",default:"md"},shortcut:{source:"meta",noBemClass:!0}},sections:xT,provides:["prose"],editHints:{title:"inline",body:"none",close:"none",footer:"none"}},Figure:{block:"figure",defaultDensity:"compact",defaultElevation:"flat",frameTarget:AT,modifiers:{size:{source:"meta",default:"default"},align:{source:"meta",default:"center"}},sections:ST,editHints:{caption:"inline"}},Gallery:{block:"gallery",defaultDensity:"full",defaultElevation:"flat",childDensity:"compact",modifiers:{layout:{source:"meta",default:"grid"},lightbox:{source:"meta",default:"true",noBemClass:!0},columns:{source:"meta",noBemClass:!0}},styles:{columns:"--gallery-columns"},editHints:{items:"none"}},Sidenote:{block:"sidenote",defaultDensity:"full",defaultElevation:"flush",defaultReading:"fine",modifiers:{variant:{source:"meta",default:"sidenote"}},sections:QT,provides:["prose"],editHints:{body:"inline"}},Compare:{block:"compare",defaultDensity:"full",modifiers:{layout:{source:"meta",default:"side-by-side"}},editHints:{panels:"none"}},Conversation:{block:"conversation",defaultDensity:"compact",defaultElevation:"flush",editHints:{messages:"none"}},ConversationMessage:{block:"conversation-message",parent:"Conversation",modifiers:{align:{source:"meta",default:"left"}},editHints:{body:"inline"}},Annotate:{block:"annotate",defaultDensity:"full",defaultElevation:"flush",modifiers:{variant:{source:"meta",default:"margin"}},sections:RT,provides:["prose"],editHints:{body:"none",notes:"none"}},AnnotateNote:{block:"annotate-note",parent:"Annotate",editHints:{body:"inline"}},Nav:{block:"nav",defaultDensity:"compact",defaultElevation:"flush",modifiers:{layout:{source:"attribute"}},postTransform(n){return{...n,name:"rf-nav"}}},NavGroup:{block:"nav-group",parent:"Nav"},Pagination:{block:"pagination",defaultDensity:"compact",modifiers:{scope:{source:"meta",default:"siblings",noBemClass:!0}}},NavItem:{block:"nav-item",parent:"Nav",postTransform(n){let e="";const t=n.children.filter(i=>Kt(i)&&i.name==="span"&&i.attributes["data-field"]==="slug"?(e=i.children.filter(s=>typeof s=="string").join(""),!1):!0);if(e)return t.unshift(e),{...n,attributes:{...n.attributes,"data-slug":e},children:t};const r=t.map(i=>{if(Kt(i)&&i.name==="a"){const s=i.attributes.class||"";return{...i,attributes:{...i.attributes,class:["rf-nav-item__link",s].filter(Boolean).join(" ")}}}return i});return{...n,children:r}}},Diff:{block:"diff",modifiers:{mode:{source:"meta",default:"unified"}},editHints:{line:"none","gutter-num":"none","gutter-prefix":"none","line-content":"none"}},Chart:{block:"chart",defaultDensity:"compact",defaultElevation:"sunken",modifiers:{type:{source:"meta",default:"bar",noBemClass:!0},stacked:{source:"meta",noBemClass:!0},"tick-count":{source:"meta",noBemClass:!0},"tick-step":{source:"meta",noBemClass:!0},"label-angle":{source:"meta",noBemClass:!0}},editHints:{data:"none"}},PullQuote:{block:"pullquote",defaultDensity:"compact",defaultElevation:"flush",defaultReading:"prose",modifiers:{align:{source:"meta",default:"center"},variant:{source:"meta",default:"default"}},sections:NT,provides:["prose"],editHints:{body:"inline"}},TextBlock:{block:"textblock",defaultDensity:"full",defaultElevation:"flush",defaultReading:"prose",modifiers:{columns:{source:"meta"},lead:{source:"meta"},align:{source:"meta",default:"left"}},sections:BT,provides:["prose"],editHints:{body:"none"}},MediaText:{block:"mediatext",defaultDensity:"full",modifiers:{align:{source:"meta",default:"left"},ratio:{source:"meta",default:"1:1"},wrap:{source:"meta"}},sections:jT,provides:["prose"],mediaSlots:zT,editHints:{media:"image",body:"none"}},Showcase:{block:"showcase",defaultDensity:"compact",childDensity:"compact",sections:FT,frameTarget:XT,contextModifiers:{"bento-cell":"in-bento-cell"},editHints:{viewport:"none"}},TabGroup:{block:"tabs",interactive:!0,defaultDensity:"full",sections:wT,autoLabel:Fl,editHints:{headline:"inline",eyebrow:"inline",blurb:"inline"}},Tab:{block:"tab",parent:"TabGroup",requiresParent:"TabGroup",rootAttributes:{"data-state":"inactive"},editHints:{name:"inline"}},TabPanel:{block:"tab-panel",parent:"TabGroup",requiresParent:"TabGroup",rootAttributes:{"data-state":"inactive"}},DataTable:{block:"datatable",interactive:!0,defaultDensity:"compact",defaultElevation:"sunken",sections:$T,modifiers:{searchable:{source:"meta",default:"false"},sortable:{source:"meta"},pageSize:{source:"meta",default:"0"},defaultSort:{source:"meta"}},editHints:{table:"none"}},Form:{block:"form",interactive:!0,defaultDensity:"full",defaultElevation:"flat",sections:DT,modifiers:{variant:{source:"meta",default:"stacked"},action:{source:"meta"},method:{source:"meta",default:"POST"},success:{source:"meta"},error:{source:"meta"},honeypot:{source:"meta",default:"true"}},editHints:{body:"none"}},FormField:{block:"form-field",parent:"Form",modifiers:{fieldType:{source:"meta"}}},Reveal:{block:"reveal",defaultDensity:"full",defaultElevation:"flat",modifiers:{mode:{source:"meta",default:"click"}},sections:MT,autoLabel:Fl,editHints:{headline:"inline",eyebrow:"inline",blurb:"inline",steps:"none"}},RevealStep:{block:"reveal-step",parent:"Reveal",rootAttributes:{"data-state":"closed"},editHints:{body:"none"}},Section:{block:"section",modifiers:{align:{source:"meta",default:"start"}},sections:qT,autoLabel:Fl,editHints:{headline:"inline",eyebrow:"inline",blurb:"inline",body:"none"}},Juxtapose:{block:"juxtapose",interactive:!0,defaultDensity:"compact",modifiers:{variant:{source:"meta",default:"slider"},orientation:{source:"meta",default:"vertical",noBemClass:!0},position:{source:"meta",default:"50",noBemClass:!0},duration:{source:"meta",default:"1000",noBemClass:!0}},styles:{position:"--jx-position",duration:"--jx-duration"},editHints:{panels:"none"}},JuxtaposePanel:{block:"juxtapose-panel",parent:"Juxtapose",requiresParent:"Juxtapose",rootAttributes:{"data-state":"inactive"},editHints:{body:"none"}},Diagram:{block:"diagram",defaultDensity:"compact",defaultElevation:"sunken",editHints:{source:"code"},modifiers:{language:{source:"meta",default:"mermaid",noBemClass:!0}}},Tint:{block:"tint",parent:"*",universalAttributes:"configurator"},Bg:{block:"bg",parent:"*",universalAttributes:"configurator"},Region:{block:"region",parent:"Layout"},Sandbox:{block:"sandbox",interactive:!0,defaultDensity:"compact",editHints:{source:"code"}}}},dW=fW;function hW(n){const e=new Map;for(const r of n)e.set(r.url,{url:r.url,title:r.title,children:[]});const t={url:"/",title:"Root",children:[]};for(const r of n){const i=e.get(r.url);r.url==="/"?(t.title=r.title,t.children=i.children,e.set("/",t)):(e.get(r.parentUrl)??t).children.push(i)}return t}function pW(n){const e=new Map;for(const r of n)r.url!=="/"&&e.set(r.url,r.parentUrl);const t=new Map;for(const r of n){const i=[];let s=e.get(r.url);for(;s!==void 0;)i.unshift(s),s=e.get(s);t.set(r.url,i)}return t}function mW(n){if(n==="/"||!n.includes("/"))return"/";const e=n.endsWith("/")?n.slice(0,-1):n,t=e.lastIndexOf("/");return t<=0?"/":e.slice(0,t+1)}function tv(n,e,t,r,i){if(!De.isTag(n)){if(Array.isArray(n)){const a=n.map(l=>tv(l,e,t,r,i));return a.every((l,c)=>l===n[c])?n:a}return n}const s=n;if(s.attributes?.["data-rune"]==="breadcrumb"&&s.children?.some(l=>De.isTag(l)&&l.attributes?.["data-field"]===PT))return gW(s,e,t,r,i);const o=(s.children??[]).map(a=>tv(a,e,t,r,i));return o.every((a,l)=>a===s.children[l])?s:{...s,children:o}}function gW(n,e,t,r,i){const s=t.get(e);if(s===void 0)return i.warn(`Breadcrumb auto: page URL "${e}" not found in page registry`,e),n;const a=n.children?.find(m=>De.isTag(m)&&m.name==="meta"&&!m.attributes?.["data-field"])?.attributes?.content??"/",l=[];for(const m of s){const p=r.get(m);if(!p)continue;const v=new De("span",{hidden:!0},[p.title]),O=new De("a",{href:m},[p.title]);l.push(Me({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:v,url:O},children:[v,O]}))}const u=r.get(e)?.title??e,f=new De("span",{},[u]);l.push(Me({rune:"breadcrumb-item",schemaOrgType:"ListItem",tag:"li",properties:{name:f},children:[f]}));const d=new De("meta",{content:a}),h=new De("ol",{},l);return Me({rune:"breadcrumb",schemaOrgType:"BreadcrumbList",tag:"nav",properties:{separator:d},refs:{items:h},children:[d,h]})}function nv(n,e,t,r){if(!De.isTag(n)){if(Array.isArray(n)){const o=n.map(a=>nv(a,e,t,r));return o.every((a,l)=>a===n[l])?n:o}return n}const i=n;if(i.attributes?.["data-rune"]==="nav"&&i.children?.some(a=>De.isTag(a)&&a.attributes?.["data-field"]===_T))return vW(e,t,r,i);const s=(i.children??[]).map(o=>nv(o,e,t,r));return s.every((o,a)=>o===i.children[a])?i:{...i,children:s}}function vW(n,e,t,r){const i=Array.from(e.values()).filter(c=>c.parentUrl===n&&c.url!==n);i.length===0&&t.warn(`Nav auto: page '${n}' has no registered child pages`,n);const s=i.map(c=>{const u=new De("span",{"data-field":"slug"},[c.title]),f=new De("a",{href:c.url},[u]);return Me({rune:"nav-item",tag:"li",properties:{slug:u},children:[f]})}),o=new De("ul",{},s),a=Me({rune:"nav",tag:"nav",properties:{group:[],item:s},children:[o]}),l=["layout","data-layout","data-auto","data-source-path","data-collapsible","data-default-open"];for(const c of l){const u=r?.attributes?.[c];u!==void 0&&(a.attributes[c]=u)}return a}function pc(n){let e=n.trim();return e.length>1&&e.endsWith("/")&&(e=e.slice(0,-1)),e.endsWith("/index")&&(e=e.slice(0,-6)||"/"),e.toLowerCase()}function OW(n){const e=n.split("/").filter(Boolean);return e.pop(),e.length===0?"/":"/"+e.join("/")+"/"}function bW(n,e){if(n===e)return 0;if(n.length===0)return e.length;if(e.length===0)return n.length;const t=new Array(e.length+1),r=new Array(e.length+1);for(let i=0;i<=e.length;i++)t[i]=i;for(let i=1;i<=n.length;i++){r[0]=i;for(let s=1;s<=e.length;s++){const o=n[i-1]===e[s-1]?0:1;r[s]=Math.min(r[s-1]+1,t[s]+1,t[s-1]+o)}for(let s=0;s<=e.length;s++)t[s]=r[s]}return t[e.length]}function yW(n,e,t){const r=e.endsWith("/")?e:e+"/",i=n.toLowerCase(),s=[],o=[],a=(r+n).replace(/\/+/g,"/").toLowerCase();for(const c of t.values()){const u=c.url,f=u.toLowerCase(),h=(u.split("/").filter(Boolean).pop()??"").toLowerCase();if(h===i&&f!==a){s.push(u);continue}if(f.startsWith(r.toLowerCase())){const m=bW(i,h);m>0&&m<=2&&o.push({url:u,distance:m})}}return s.sort(),o.sort((c,u)=>c.distance-u.distance||c.url.localeCompare(u.url)),[...s,...o.map(c=>c.url)].slice(0,3)}function wW(n,e,t){if(n.startsWith("/"))return{ok:!0,url:n};const r=e.endsWith("/")?e:e+"/",i=(r+n).replace(/\/+/g,"/"),s=pc(i);for(const a of t.values())if(pc(a.url)===s)return{ok:!0,url:a.url};const o=yW(n.includes("/")?n.split("/").pop():n,r,t);return{ok:!1,reason:"not-found",attemptedUrl:i,suggestions:o}}function Nw(n,e){let t=0;for(;t<n.length&&t<e.length&&n[t]===e[t];)t++;return t}function Yc(n,e,t){const r=Array.from(e.values()).filter(i=>i.url.endsWith("/"+n)||i.url==="/"+n);return r.length===0?null:r.length===1?r[0].url:r.slice().sort((i,s)=>Nw(s.url,t)-Nw(i.url,t))[0].url}function Uc(n){const e=n.attributes?.["data-slug"];if(e)return String(e);const t=r=>{if(!De.isTag(r)){if(Array.isArray(r))for(const s of r){const o=t(s);if(o)return o}return null}const i=r;if(i.name==="span"&&i.attributes?.["data-field"]==="slug"){const s=[];for(const o of i.children??[])typeof o=="string"&&s.push(o);return s.join("").trim()||null}for(const s of i.children??[]){const o=t(s);if(o)return o}return null};return t(n)}function _W(n,e,t){const r=[],i=s=>{if(!De.isTag(s)){Array.isArray(s)&&s.forEach(i);return}const o=s;if(o.attributes?.["data-rune"]==="nav-item"){const a=Gc(o);if(a)r.push(a);else{const l=Uc(o);if(l){const c=Yc(l,e,t);c&&r.push(c)}}}(o.children??[]).forEach(i)};return(n.children??[]).forEach(i),r}function kW(n){const e=t=>{if(typeof t=="string")return t;if(!De.isTag(t)){if(Array.isArray(t))for(const i of t){const s=e(i);if(s)return s}return null}const r=t;if(r.attributes?.["data-field"]==="title"){const i=[];for(const s of r.children??[])typeof s=="string"&&i.push(s);if(i.length>0)return i.join("").trim()}for(const i of r.children??[]){const s=e(i);if(s)return s}return null};return e(n)??""}function xW(n,e){for(const t of e){if(!t)continue;if(n===t)return!0;const r=t.endsWith("/")?t:t+"/";if(n.startsWith(r))return!0}return!1}function Pf(n,e,t){if(!De.isTag(n)){if(Array.isArray(n)){const s=n.map(o=>Pf(o,e,t));return s.every((o,a)=>o===n[a])?n:s}return n}const r=n;if(r.attributes?.["data-rune"]==="nav"&&r.attributes?.["data-collapsible"]==="true"){const s=String(r.attributes?.["data-default-open"]??""),o=s?s.split(",").map(u=>u.trim()).filter(Boolean):[],a=[],l=u=>{if(!De.isTag(u))return;const f=u;f.attributes?.["data-rune"]==="nav-group"&&a.push(f),(f.children??[]).forEach(l)};(r.children??[]).forEach(l);for(const u of a){if(u.attributes?.["data-collapsed"]!==kT)continue;const f=kW(u),d=f&&o.includes(f),h=_W(u,t,e),m=xW(e,h);u.attributes["data-collapsed"]=d||m?"false":"true"}const c=(r.children??[]).map(u=>Pf(u,e,t));return c.every((u,f)=>u===r.children[f])?r:{...r,children:c}}const i=(r.children??[]).map(s=>Pf(s,e,t));return i.every((s,o)=>s===r.children[o])?r:{...r,children:i}}function Bw(n,e,t){const r=e?.title??t??"",i=e?.description,s=e?.icon,o=e?.url??t??"",a=[];s&&a.push(new De("rf-icon",{name:s,"data-name":"icon",class:"rf-nav-item__icon"},[])),a.push(new De("span",{"data-name":"title",class:"rf-nav-item__title"},[r])),i&&a.push(new De("span",{"data-name":"description",class:"rf-nav-item__description"},[i]));const l=o?new De("a",{href:o,class:"rf-nav-item__link"},a):new De("span",{class:"rf-nav-item__link"},a);return{...n,children:[l]}}function Gc(n){const e=t=>{if(!De.isTag(t)){if(Array.isArray(t))for(const i of t){const s=e(i);if(s)return s}return null}const r=t;if(r.name==="a"&&r.attributes?.href)return String(r.attributes.href);for(const i of r.children??[]){const s=e(i);if(s)return s}return null};return e(n)}function SW(n,e,t){const r=Gc(n);if(r){const s=/^[a-z]+:\/\//i.test(r);return{url:r,isExternal:s}}const i=Uc(n);if(i){const s=Yc(i,e,t);return s?{url:s,isExternal:!1}:null}return null}function AW(n,e){const t=(n.children??[]).map(r=>{if(!De.isTag(r))return r;const i=r;if(i.name!=="a")return r;const s=(i.children??[]).some(l=>De.isTag(l)&&l.attributes?.["data-name"]==="icon"),o=(i.children??[]).some(l=>De.isTag(l)&&l.attributes?.["data-name"]==="description"),a=[...i.children??[]];return e.icon&&!s&&a.unshift(new De("rf-icon",{name:e.icon,"data-name":"icon",class:"rf-nav-item__icon"},[])),e.description&&!o&&a.push(new De("span",{"data-name":"description",class:"rf-nav-item__description"},[e.description])),{...i,children:a}});return{...n,children:t}}function rv(n,e,t){if(!De.isTag(n)){if(Array.isArray(n)){const s=n.map(o=>rv(o,e,t));return s.every((o,a)=>o===n[a])?n:s}return n}const r=n;if(r.attributes?.["data-rune"]==="nav"){const o=(r.attributes?.["data-layout"]??r.attributes?.layout)==="cards",a=r.attributes?.["data-auto"]==="true";if(o||a){const l=u=>{if(!De.isTag(u))return Array.isArray(u)?u.map(l):u;const f=u;if(f.attributes?.["data-rune"]==="nav-item"){const h=SW(f,t,e);if(!h)return f;if(o){if(h.isExternal)return Bw(f,null,h.url);const v=t.get(h.url),O=v?{url:v.url,title:v.title,description:v.description,icon:v.icon}:null;return Bw(f,O,h.url)}if(h.isExternal)return f;const m=t.get(h.url);if(!m)return f;const p={url:m.url,title:m.title,description:m.description,icon:m.icon};return AW(f,p)}const d=(f.children??[]).map(l);return d.every((h,m)=>h===f.children[m])?f:{...f,children:d}},c=(r.children??[]).map(l);return{...r,children:c}}}const i=(r.children??[]).map(s=>rv(s,e,t));return i.every((s,o)=>s===r.children[o])?r:{...r,children:i}}function CW(n){return/^[a-z]+:\/\//i.test(n)||n.startsWith("mailto:")||n.startsWith("//")}function TW(n,e,t,r){const i=e?` in ${e}`:"",s=`Nav item \`${n}\`${i} cannot be resolved (no page at \`${t}\`).`;if(r.length===0)return s;const o=["","Did you mean one of:",...r.map(a=>` - ${a}`),"","Use a multi-segment slug (e.g. `section/page`) or an explicit `[Label](/path)` link."];return s+`
|
|
335
|
-
`+o.join(`
|
|
336
|
-
`)}function PW(n,e,t,r){const i=n.attributes?.["data-source-path"],s=OW(i??""),o=a=>{if(!De.isTag(a)){if(Array.isArray(a)){const u=a.map(o);return u.every((f,d)=>f===a[d])?a:u}return a}const l=a;if(l.attributes?.["data-rune"]==="nav-item"){if(Gc(l))return l;const f=Uc(l);if(!f)return l;const d=wW(f,s,e);if(!d.ok)return t.error(TW(f,i,d.attemptedUrl,d.suggestions),r),l;const m=e.get(d.url)?.title??f,p=new De("a",{href:d.url},[m]),v=(l.children??[]).filter(O=>{if(typeof O=="string")return!1;if(De.isTag(O)){const b=O;if(b.name==="span"&&b.attributes?.["data-field"]==="slug")return!1}return!0});return{...l,children:[p,...v]}}const c=(l.children??[]).map(o);return c.every((u,f)=>u===l.children[f])?l:{...l,children:c}};return o(n)}function iv(n,e,t,r){if(!De.isTag(n)){if(Array.isArray(n)){const o=n.map(a=>iv(a,e,t,r));return o.every((a,l)=>a===n[l])?n:o}return n}const i=n;if(i.attributes?.["data-rune"]==="nav")return PW(i,e,t,r);const s=(i.children??[]).map(o=>iv(o,e,t,r));return s.every((o,a)=>o===i.children[a])?i:{...i,children:s}}function EW(n,e){const t=pc(e),r=s=>{const o=[],a=f=>{if(!De.isTag(f)){Array.isArray(f)&&f.forEach(a);return}const d=f;if(d.name==="a"&&typeof d.attributes?.href=="string"){const h=String(d.attributes.href);CW(h)||o.push({tag:d,href:h})}(d.children??[]).forEach(a)};(s.children??[]).forEach(a);let l=null;for(const{tag:f,href:d}of o)if(pc(d)===t){l=f;break}let c=null,u=0;for(const{tag:f,href:d}of o){if(f===l)continue;const h=pc(d);if(h==="/"&&t==="/")continue;h!==t&&(t.startsWith(h+"/")||h==="/"&&t.startsWith("/"))&&h.length>u&&(c=f,u=h.length)}return l&&(l.attributes["aria-current"]="page"),c&&(c.attributes["data-active"]="ancestor"),s},i=s=>{if(!De.isTag(s))return Array.isArray(s)&&s.forEach(i),s;const o=s;return o.attributes?.["data-rune"]==="nav"?(r(o),o):((o.children??[]).forEach(i),o)};return i(n),n}function $W(n,e,t){const r=[],i=s=>{if(!De.isTag(s)){Array.isArray(s)&&s.forEach(i);return}const o=s;if(o.attributes?.["data-rune"]==="nav"){const a=o.attributes?.layout??o.attributes?.["data-layout"];if(a&&a!=="vertical"){(o.children??[]).forEach(i);return}const l=[],c=u=>{if(!De.isTag(u)){Array.isArray(u)&&u.forEach(c);return}const f=u;f.attributes?.["data-rune"]==="nav-group"&&l.push(f),(f.children??[]).forEach(c)};if((o.children??[]).forEach(c),l.length===0){const u=[],f=d=>{if(!De.isTag(d)){Array.isArray(d)&&d.forEach(f);return}const h=d;if(h.attributes?.["data-rune"]==="nav-item"){const m=Gc(h);if(m)/^[a-z]+:\/\//i.test(m)||u.push(m);else{const p=Uc(h);if(p){const v=Yc(p,e,t);v&&u.push(v)}}}(h.children??[]).forEach(f)};(o.children??[]).forEach(f),u.length>0&&r.push(u)}else for(const u of l){const f=[],d=h=>{if(!De.isTag(h)){Array.isArray(h)&&h.forEach(d);return}const m=h;if(m.attributes?.["data-rune"]==="nav-item"){const p=Gc(m);if(p)/^[a-z]+:\/\//i.test(p)||f.push(p);else{const v=Uc(m);if(v){const O=Yc(v,e,t);O&&f.push(O)}}}(m.children??[]).forEach(d)};(u.children??[]).forEach(d),f.length>0&&r.push(f)}}(o.children??[]).forEach(i)};return i(n),r}function QW(n,e,t){const r=e.get(n);if(!r)return[];const i=Array.from(e.values());let s;if(t==="section"){let o=n,a=r;for(;a&&a.parentUrl&&a.parentUrl!=="/";){const c=e.get(a.parentUrl);if(!c)break;o=c.url,a=c}const l=o.endsWith("/")?o:o+"/";s=i.filter(c=>c.url===o||c.url.startsWith(l))}else s=i.filter(o=>o.parentUrl===r.parentUrl);return s.sort((o,a)=>{const l=o.order??Number.POSITIVE_INFINITY,c=a.order??Number.POSITIVE_INFINITY;return l!==c?l-c:o.url.localeCompare(a.url)}),s.map(o=>({url:o.url,title:o.title}))}function LW(n,e,t){const r=n.indexOf(e);if(r===-1)return{prev:null,next:null};const i=r>0?n[r-1]:null,s=r<n.length-1?n[r+1]:null,o=a=>{if(!a)return null;const l=t.get(a);return l?{url:l.url,title:l.title}:{url:a,title:a}};return{prev:o(i),next:o(s)}}function jw(n,e,t){const r=e==="prev"?"←":"→",i=t??n.title,s=e==="prev"?[new De("span",{"data-name":"marker"},[r]),new De("span",{"data-name":"label"},[i])]:[new De("span",{"data-name":"label"},[i]),new De("span",{"data-name":"marker"},[r])];return new De("a",{href:n.url,"data-direction":e,"data-name":e},s)}function sv(n,e,t,r){if(!De.isTag(n)){if(Array.isArray(n)){const o=n.map(a=>sv(a,e,t,r));return o.every((a,l)=>a===n[l])?n:o}return n}const i=n;if(i.attributes?.["data-rune"]==="pagination"){if((i.children??[]).some(l=>De.isTag(l)&&l.attributes?.["data-field"]===Qg)){const l=(i.children??[]).find(A=>De.isTag(A)&&A.attributes?.["data-field"]==="scope"),u=String(l?l.attributes?.content??"":i.attributes?.["data-scope"]??"")==="section"?"section":"siblings",f=(i.children??[]).find(A=>De.isTag(A)&&A.attributes?.["data-field"]==="prev-label"),d=(i.children??[]).find(A=>De.isTag(A)&&A.attributes?.["data-field"]==="next-label"),h=f?String(f.attributes.content??""):void 0,m=d?String(d.attributes.content??""):void 0;if(Array.from(t.values()).some(A=>A.parentUrl===e&&A.url!==e))return{...i,children:[]};let v=null;const O=$W(r,t,e);for(const A of O)if(A.includes(e)){v=A;break}let b=null,w=null;if(v)({prev:b,next:w}=LW(v,e,t));else{const A=QW(e,t,u),C=A.findIndex(y=>y.url===e);C!==-1&&(b=C>0?A[C-1]:null,w=C<A.length-1?A[C+1]:null)}const S=[];b&&S.push(jw(b,"prev",h)),w&&S.push(jw(w,"next",m));const _=new Set([Qg,"prev-label","next-label","scope"]),x=(i.children??[]).filter(A=>{if(!De.isTag(A)||A.name!=="meta")return!0;const C=A.attributes?.["data-field"];return!_.has(C)});return{...i,children:[...x,...S]}}const a=(i.children??[]).map(l=>{if(!De.isTag(l))return l;if(l.name==="a"&&typeof l.attributes?.href=="string"&&l.attributes.href.startsWith("__slug:")){const c=l.attributes.href.slice(7),u=Yc(c,t,e);if(u){const d=t.get(u)?.title??c,h=(l.children??[]).map(m=>De.isTag(m)&&m.attributes?.["data-name"]==="label"&&(m.children??[]).filter(v=>typeof v=="string").join("")===c?{...m,children:[d]}:m);return{...l,attributes:{...l.attributes,href:u},children:h}}}return l});return{...i,children:a}}const s=(i.children??[]).map(o=>sv(o,e,t,r));return s.every((o,a)=>o===i.children[a])?i:{...i,children:s}}function ov(n,e){if(De.isTag(n)){const t=e(n);if(t!==n)return t;const r=n.children.map(s=>ov(s,e));return r.some((s,o)=>s!==n.children[o])?new De(n.name,n.attributes,r):n}return Array.isArray(n)?n.map(t=>ov(t,e)):n}function MW(n){let e=n.trim();return e.startsWith("/")||(e="/"+e),e.endsWith("/")||(e+="/"),e}function qW(n,e){return n.startsWith(e)?n.slice(e.length).replace(/\/$/,"").split("/").filter(Boolean).length===1:!1}function RW(n){return!n||!n.trim()?[]:n.split(",").map(e=>{const t=e.indexOf(":");return t===-1?{field:e.trim(),value:""}:{field:e.slice(0,t).trim(),value:e.slice(t+1).trim()}})}function DW(n,e){for(const{field:t,value:r}of e){const i=n.frontmatter[t];if(r===""){if(i==null)return!1}else if(Array.isArray(i)){if(!i.some(s=>String(s).toLowerCase()===r.toLowerCase()))return!1}else if(String(i??"").toLowerCase()!==r.toLowerCase())return!1}return!0}function IW(n,e){const t=[...n];switch(e){case"date-asc":t.sort((r,i)=>(r.date||"").localeCompare(i.date||""));break;case"title-asc":t.sort((r,i)=>r.title.localeCompare(i.title));break;case"title-desc":t.sort((r,i)=>i.title.localeCompare(r.title));break;default:t.sort((r,i)=>(i.date||"").localeCompare(r.date||""));break}return t}function NW(n){const t=[new De("h3",{},[new De("a",{href:n.url},[n.title])])];return n.date&&t.push(new De("time",{datetime:n.date},[n.date])),n.description&&t.push(new De("p",{},[n.description])),new De("article",{"data-name":"post"},t)}function BW(n,e,t,r){let i=!1;const s=ov(n,o=>{if(o.attributes["data-rune"]!=="blog")return o;const a=Lo(o,"folder")??"",l=Lo(o,"sort")||"date-desc",c=Lo(o,"filter")??"",u=Lo(o,"limit")??"",f=u?parseInt(u,10):void 0;if(!a)return t.warn("Blog rune missing folder attribute",r),o;const d=MW(a),h=RW(c);let m=e.filter(w=>!(w.draft||!qW(w.url,d)||h.length>0&&!DW(w,h)));m=IW(m,l),f&&f>0&&(m=m.slice(0,f));const p=o.children.find(w=>De.isTag(w)&&w.attributes["data-name"]==="posts");if(!De.isTag(p))return o;const v=m.map(NW);i=!0;const O=new De(p.name,p.attributes,v),b=o.children.map(w=>w===p?O:w);return new De(o.name,o.attributes,b)});return i?s:n}const jW=new Set(["layout","tint","tint-mode","tint-lock","slug","redirect","type","id"]);function zW(n={}){const e=n.xrefPatterns??[],t=n.embedConfig,r=n.repoUrl,i=n.repoBranch;return{preprocess(s,o,a){const l=$V(s,o,a),c=GV(s,o,a);return l||c?s:void 0},register(s,o,a){for(const l of s){const c=mW(l.url),u=o.getById("page",l.url);u&&u.sourceUrl!==l.url&&a.warn(`Page '${l.url}' already registered from '${u.sourceUrl}'`,l.url);const f={};for(const[d,h]of Object.entries(l.frontmatter))jW.has(d)||(f[d]=h);o.register({type:"page",id:l.url,sourceUrl:l.url,data:{...f,title:l.title,url:l.url,parentUrl:c,draft:l.frontmatter.draft??!1,description:l.frontmatter.description,date:l.frontmatter.date,order:l.frontmatter.order,icon:l.frontmatter.icon}});for(const d of l.headings){const h=`${l.url}#${d.id}`,m=o.getById("heading",h);m&&m.sourceUrl!==l.url&&a.warn(`Heading '${h}' already registered from '${m.sourceUrl}'`,l.url),o.register({type:"heading",id:h,sourceUrl:l.url,data:{level:d.level,text:d.text,headingId:d.id,url:l.url}})}}J7(s,o,a)},aggregate(s,o){const a=s.getAll("page"),l=a.map(m=>({url:m.data.url,title:m.data.title,parentUrl:m.data.parentUrl,description:m.data.description,icon:m.data.icon,order:m.data.order})),c=hW(l),u=pW(l),f=new Map(l.map(m=>[m.url,m])),d=new Map;for(const m of s.getAll("heading"))d.set(m.id,m.data);const h=a.map(m=>({title:m.data.title||"",url:m.data.url||m.id,date:m.data.date||"",description:m.data.description||"",draft:m.data.draft||!1,frontmatter:m.data}));return{pageTree:c,breadcrumbPaths:u,pagesByUrl:f,headingIndex:d,allPosts:h,registry:s,xrefPatterns:e,embedConfig:t,repoUrl:r,repoBranch:i}},postProcess(s,o,a){const l=o.__core__;if(!l)return s;let c=tv(s.renderable,s.url,l.breadcrumbPaths,l.pagesByUrl,a);c=nv(c,s.url,l.pagesByUrl,a),c=iv(c,l.pagesByUrl,a,s.url),c=Pf(c,s.url,l.pagesByUrl),c=rv(c,s.url,l.pagesByUrl),c=sv(c,s.url,l.pagesByUrl,c),c=EW(c,s.url),c=BW(c,l.allPosts,a,s.url),c=tX(c),c=dX(c,s.url,l.repoUrl,l.repoBranch,a),c=gX(c,s.url,l.registry,a),c=rX(c,s.url,l.registry,l.embedConfig?.projectFiles,a),c=iW(c,s.url,l.registry,l.xrefPatterns??[],l.embedConfig,a),c=eV(c,s.url,l.registry,l.embedConfig,a),c=oV(c,s.url,l.registry,l.embedConfig,a),c=fV(c,s.url,l.registry,l.embedConfig,a),c=jg(c,l.registry,a,s.url),c=PV(c,s.url,l.registry,l.xrefPatterns??[],a);const u=LV(c===s.renderable?s:{...s,renderable:c});eW(u.renderable);const f=tW(u.renderable);return f.length>0||u.headings.length>0?{...u,headings:f}:u}}}zW();const ZW={nav:je({name:"nav",schema:NZ,description:"Navigation structure with page slug references and optional grouping",typeName:"Nav",category:"Site",snippet:["{% nav %}","## ${1:Section}","","- ${2:page-slug}","- ${3:another-page}","{% /nav %}"]}),region:je({name:"region",schema:zZ,description:"Named content block within a layout definition",snippet:['{% region name="${1:header}" %}',"$0","{% /region %}"]}),layout:je({name:"layout",schema:FZ,description:"Layout definition containing named regions",category:"Site",snippet:["{% layout %}",'{% region name="${1:header}" %}',"$0","{% /region %}","{% /layout %}"]}),codegroup:je({name:"codegroup",schema:bZ,description:"Tabbed code block with language tabs",typeName:"CodeGroup",category:"Code & Data",snippet:["{% codegroup %}","```${1:js}","$0","```","","```${2:ts}","","```","{% /codegroup %}"]}),error:je({name:"error",schema:sZ,description:"Error reporting table",typeName:"Error",category:"Semantic"}),grid:je({name:"grid",aliases:["columns"],schema:hZ,description:"Grid layout container with configurable columns and rows",typeName:"Grid",category:"Layout",snippet:["{% grid columns=${1:2} %}","${2:First column content}","","---","","${3:Second column content}","{% /grid %}"]}),hint:je({name:"hint",aliases:["callout","alert"],schema:xZ,description:"Callout/admonition block with type variants (note, warning, caution, check)",typeName:"Hint",category:"Content",snippet:['{% hint type="${1|note,warning,caution,check|}" %}',"$0","{% /hint %}"]}),tab:je({name:"tab",schema:$Z,description:"Individual tab within a tab group",typeName:"Tab"}),tabs:je({name:"tabs",schema:LZ,description:"Tabbed interface with tab panels",typeName:"TabGroup",category:"Layout",snippet:["{% tabs %}","## ${1:Tab One}","","${2:Content for tab one.}","","## ${3:Tab Two}","","${4:Content for tab two.}","{% /tabs %}"]}),details:je({name:"details",schema:VZ,description:"Collapsible disclosure block for supplementary content",typeName:"Details",category:"Content",snippet:['{% details summary="${1:Click to expand}" %}',"$0","{% /details %}"]}),drawer:je({name:"drawer",schema:GZ,description:"Modal side panel addressed by id. Triggered by xrefs anywhere on the page; falls back to in-flow rendering without JS.",typeName:"Drawer",category:"Layout",snippet:['{% drawer id="${1:auth-explainer}" title="${2:Auth system}" %}',"$0","{% /drawer %}"]}),figure:je({name:"figure",schema:JZ,description:"Enhanced image with caption, attribution, and sizing",seoType:"ImageObject",typeName:"Figure",schemaOrgType:"ImageObject",category:"Content",snippet:['{% figure size="${1|medium,small,large,full|}" %}',"","","${4:Caption text}","{% /figure %}"]}),gallery:je({name:"gallery",schema:tF,description:"Multi-image container with grid, carousel, or masonry layout and optional lightbox",seoType:"ImageGallery",typeName:"Gallery",schemaOrgType:"ImageGallery",category:"Content",snippet:['{% gallery layout="${1|grid,carousel,masonry|}" %}',"","","","{% /gallery %}"]}),accordion:je({name:"accordion",aliases:["faq"],schema:rF,description:"Collapsible accordion sections where headings become toggleable headers",seoType:"FAQPage",typeName:"Accordion",schemaOrgType:"FAQPage",category:"Layout",snippet:["{% accordion %}","## ${1:First Question}","","${2:Answer to the first question.}","","## ${3:Second Question}","","${4:Answer to the second question.}","{% /accordion %}"]}),"accordion-item":je({name:"accordion-item",schema:nF,description:"Individual accordion section",typeName:"AccordionItem",schemaOrgType:"Question"}),toc:je({name:"toc",aliases:["table-of-contents"],schema:iF,description:"Auto-generated table of contents from document headings",typeName:"TableOfContents",category:"Site",snippet:["{% toc /%}"]}),embed:je({name:"embed",schema:aF,description:"Embedded content from external services (YouTube, Twitter, CodePen, Spotify)",seoType:"VideoObject",typeName:"Embed",schemaOrgType:"VideoObject",category:"Content",snippet:['{% embed url="${1:https://}" /%}']}),breadcrumb:je({name:"breadcrumb",schema:lF,description:"Navigation breadcrumb trail showing page hierarchy",seoType:"BreadcrumbList",typeName:"Breadcrumb",schemaOrgType:"BreadcrumbList",category:"Site",snippet:["{% breadcrumb /%}"]}),pagination:je({name:"pagination",schema:cF,description:"Sequential prev/next links for ordered docs and tutorials",typeName:"Pagination",category:"Site",snippet:["{% pagination auto /%}"]}),budget:je({name:"budget",schema:xF,description:"Structured cost breakdown with categories, line items, and auto-calculated totals",seoType:"ItemList",typeName:"Budget",schemaOrgType:"ItemList",category:"Semantic",snippet:["{% budget %}","## ${1:Category}","","- ${2:Item description}: \\$${3:100}","- ${4:Another item}: \\$${5:200}","{% /budget %}"]}),"budget-category":je({name:"budget-category",schema:wF,description:"Cost category within a budget containing line items",typeName:"BudgetCategory"}),"budget-line-item":je({name:"budget-line-item",schema:OF,description:"Individual budget line item with description and amount",typeName:"BudgetLineItem"}),compare:je({name:"compare",schema:AF,description:"Side-by-side code comparison with labeled panels",typeName:"Compare",category:"Code & Data",snippet:["{% compare %}","```${1:js}","${2:// Before}","```","","```${3:js}","${4:// After}","```","{% /compare %}"]}),datatable:je({name:"datatable",aliases:["data-table"],schema:CF,description:"Interactive data table with sorting, filtering, and pagination from a Markdown table",seoType:"Dataset",typeName:"DataTable",schemaOrgType:"Dataset",category:"Code & Data",snippet:["{% datatable %}","| ${1:Column A} | ${2:Column B} | ${3:Column C} |","|---|---|---|","| ${4:Data} | ${5:Data} | ${6:Data} |","{% /datatable %}"]}),diff:je({name:"diff",schema:qF,description:"Side-by-side or unified diff view between two code blocks",typeName:"Diff",category:"Code & Data",snippet:["{% diff %}","```${1:js}","${2:// Before}","```","","```${3:js}","${4:// After}","```","{% /diff %}"]}),snippet:je({name:"snippet",schema:yZ,description:"Embed a project file as a syntax-highlighted code block. Composes inside codegroup, diff, and any future fence-consuming rune via pre-resolve (SPEC-062).",typeName:"Snippet",category:"Code & Data",snippet:['{% snippet path="${1:src/lib/foo.ts}" /%}']}),data:je({name:"data",schema:wZ,description:"Ingest an external tabular source (CSV/TSV/JSON/NDJSON) and emit a Markdown table. Composes inside chart and datatable, and renders standalone, via pre-resolve (SPEC-103).",typeName:"Data",category:"Code & Data",snippet:['{% data src="${1:data/revenue.csv}" /%}']}),chart:je({name:"chart",schema:IF,description:"Chart visualization from a Markdown table. First column becomes axis labels, header row becomes series names.",typeName:"Chart",category:"Code & Data",snippet:['{% chart type="${1|bar,line,pie,area|}" %}',"| ${2:Label} | ${3:Series A} | ${4:Series B} |","|---|---|---|","| ${5:Item 1} | ${6:10} | ${7:20} |","| ${8:Item 2} | ${9:30} | ${10:15} |","{% /chart %}"]}),diagram:je({name:"diagram",schema:BF,description:"Diagram rendering from Mermaid, PlantUML, or ASCII art code blocks",typeName:"Diagram",category:"Code & Data",snippet:['{% diagram language="${1|mermaid,plantuml,ascii|}" %}',"```${1:mermaid}","$0","```","{% /diagram %}"]}),sidenote:je({name:"sidenote",aliases:["footnote","marginnote"],schema:ZF,description:"Margin note or footnote displayed alongside the main content",typeName:"Sidenote",category:"Content",snippet:["{% sidenote %}","$0","{% /sidenote %}"]}),conversation:je({name:"conversation",aliases:["dialogue","chat"],schema:VF,description:"Chat/dialogue display where blockquotes become alternating speaker messages",typeName:"Conversation",category:"Semantic",snippet:["{% conversation %}","> **${1:Alice}**: ${2:Hello!}","","> **${3:Bob}**: ${4:Hi there!}","{% /conversation %}"]}),"conversation-message":je({name:"conversation-message",schema:FF,description:"Individual message within a conversation",typeName:"ConversationMessage"}),reveal:je({name:"reveal",schema:UF,description:"Progressive disclosure where headings become reveal steps shown one at a time",typeName:"Reveal",category:"Layout",snippet:["{% reveal %}","## ${1:Step One}","","${2:Content revealed first.}","","## ${3:Step Two}","","${4:Content revealed next.}","{% /reveal %}"]}),"reveal-step":je({name:"reveal-step",schema:YF,description:"Individual step within a reveal sequence",typeName:"RevealStep"}),section:je({name:"section",schema:KF,description:"A generic page section: an eyebrow/headline/blurb header above arbitrary body content",typeName:"Section",category:"Layout",snippet:["{% section %}","Eyebrow","","## ${1:Section title}","","${2:A short supporting blurb.}","","${3:Body content — a bento, cards, anything.}","{% /section %}"]}),juxtapose:je({name:"juxtapose",schema:t7,description:"Side-by-side comparison with interactive reveal (slider, toggle, fade, or auto)",typeName:"Juxtapose",category:"Layout"}),annotate:je({name:"annotate",schema:s7,description:"Content with margin annotations. Nested note tags appear as margin notes alongside the main text.",typeName:"Annotate",category:"Layout",snippet:["{% annotate %}","${1:Main content here.}","","{% note %}","${2:Margin note content.}","{% /note %}","","${3:More main content.}","{% /annotate %}"]}),note:je({name:"note",schema:r7,description:"Annotation note within an annotate block",typeName:"AnnotateNote"}),form:je({name:"form",aliases:["contact-form"],schema:m7,description:"Accessible HTML form from Markdown. Lists become input fields with smart type inference, blockquotes followed by lists become select/radio/checkbox groups.",typeName:"Form",category:"Content",snippet:['{% form action="${1:/api/contact}" %}',"- Name","- Email","- Message","","**${2:Submit}**","{% /form %}"]}),"form-field":je({name:"form-field",schema:h7,description:"Individual form field with inferred type",typeName:"FormField"}),sandbox:je({name:"sandbox",schema:w7,description:"Isolated HTML/CSS/JS rendering in an iframe with optional framework loading",typeName:"Sandbox",category:"Code & Data",snippet:['{% sandbox framework="${1|,tailwind,bootstrap,bulma,pico|}" %}',"$0","{% /sandbox %}"]}),pullquote:je({name:"pullquote",aliases:["pull-quote"],schema:x7,description:"Decorative pull quote for magazine-style emphasis with float and block modes",typeName:"PullQuote",category:"Content",snippet:['{% pullquote variant="${1|default,accent,editorial|}" %}',"> ${2:Quote text to emphasize.}","{% /pullquote %}"]}),textblock:je({name:"textblock",aliases:["text-block","prose"],schema:A7,description:"Text formatting block with drop caps, multi-column layout, lead paragraphs, and alignment control",typeName:"TextBlock",category:"Content",snippet:["{% textblock dropcap %}","${1:Formatted text content with drop cap styling.}","{% /textblock %}"]}),mediatext:je({name:"mediatext",aliases:["media-text"],schema:P7,description:"Image and text side by side with configurable ratio and optional text wrapping",typeName:"MediaText",category:"Layout",snippet:['{% mediatext align="${1|left,right|}" ratio="${2|1:1,1:2,2:1|}" %}',"","","${5:Text content displayed alongside the image.}","{% /mediatext %}"]}),icon:je({name:"icon",schema:IT,description:"Inline icon resolved by name from the theme icon registry. Self-closing.",category:"Content",snippet:['{% icon name="${1:icon-name}" /%}']}),tint:je({name:"tint",schema:ZT,description:"Section-level colour override via CSS custom properties. Declared as first child of a block rune.",typeName:"Tint",snippet:["{% tint %}","- background: ${1:#1a1a2e}","- primary: ${2:#e94560}","- accent: ${3:#0f3460}","{% /tint %}"]}),showcase:je({name:"showcase",schema:R7,description:"Media presentation wrapper with shadow, bleed displacement, and aspect ratio enforcement",typeName:"Showcase",category:"Layout",snippet:['{% showcase shadow="${1|none,soft,hard,elevated|}" %}',"$0","{% /showcase %}"]}),bg:je({name:"bg",schema:WT,description:"Background image/video directive — modifies parent section backdrop",typeName:"Bg",snippet:['{% bg src="${1:/path/to/image.jpg}" overlay="${2:rgba(0,0,0,0.5)}" /%}']}),blog:je({name:"blog",schema:j7,description:"Blog post listing with filtering, sorting, and multiple layouts. Displays pages from a content folder as a navigable blog index.",seoType:"Blog",typeName:"Blog",schemaOrgType:"Blog",category:"Semantic"}),xref:je({name:"xref",aliases:["ref"],schema:UT,description:"Inline cross-reference that resolves an entity by ID or name from the registry. Self-closing."}),expand:je({name:"expand",schema:GT,description:"Substitute a registered entity's source content inline. Reads the entity's sourceFile via the plan plugin (or any plugin that registers extractable entities) and inlines it. Symmetric with `xref`: same lookup chain, different output (content rather than a link).",typeName:"Expand",category:"Content",snippet:['{% expand "${1:SPEC-001}" /%}']}),badge:je({name:"badge",schema:cP,description:"Inline pill that flags a piece of content (status, category, recency, tag). Visual variant from the universal metadata-system dimensions (sentiment, rank, type).",typeName:"Badge",category:"Content",snippet:['{% badge sentiment="${1|positive,negative,caution,neutral|}" %}',"${2:Label}","{% /badge %}"]}),bar:je({name:"bar",schema:CX,description:'Block-level wrapper that renders the SPEC-080 `bar` layout primitive (a horizontal flex row) over author-written content. Body splits on a top-level `---` into a left group and a right group; the right group is pushed to the end via `data-align="end"`. Position-agnostic.',typeName:"Bar",category:"Content",snippet:["{% bar %}","${1:Left side}","---","${2:Right side}","{% /bar %}"]}),deflist:je({name:"deflist",aliases:["definitions","terms"],schema:PX,description:"Block-level wrapper that renders the SPEC-079 definition-list layout primitive over a markdown list. Each `- **Term:** value` item becomes a <dt>/<dd> pair. Inline runes compose naturally inside <dd>.",typeName:"Deflist",category:"Content",snippet:["{% deflist %}","- **${1:Term}:** ${2:Value}","- **${3:Term}:** ${4:Value}","{% /deflist %}"]}),collection:je({name:"collection",schema:X7,description:"Render a list, grid, or table of registry entities — the plural counterpart to ref/expand. Queries the registry by type with a field:value filter, sort, group, and limit; projects fields into a built-in layout or a per-item body template ($item bound).",typeName:"Collection",category:"Content",snippet:['{% collection type="${1:work}" filter="${2:status:ready}" sort="${3:priority}" /%}']}),relationships:je({name:"relationships",schema:V7,description:"Render an entity's relationship edges, grouped by kind — the plural-graph counterpart to ref/expand. Reads the registry relationship graph for `of` (an id, e.g. of=$item.id); each item is a related entity with its edge $kind bound. Generic over kind, so it serves any domain (plan, storytelling, …).",typeName:"Relationships",category:"Content",snippet:['{% relationships of="${1:WORK-1}" /%}']}),aggregate:je({name:"aggregate",schema:Y7,description:'Project numbers — counts (and per-group breakdowns) over the registry — beside collection (items) and relationships (edges). Two modes: a no-body inline integer (`{% aggregate type="work" filter="status:done" /%}`) or a body-zoned form whose preamble / template / fallback zones bind `$item` to a totals / per-group / zeros projection. Use the optional `value` sub-filter (e.g. `value="status:done"`) to drive a progress-bar ratio without a second query.',typeName:"Aggregate",category:"Content",snippet:['{% aggregate type="${1:work}" filter="${2:status:done}" /%}']}),"file-ref":je({name:"file-ref",schema:U7,description:'Path-based inline reference to a project file — third member of the Registry family beside `xref` (id → link) and `expand` (id → inlined content). Resolves to a deep-link `<a>` pointing at `{repoUrl}/blob/{repoBranch}/{path}#L{start}-L{end}` on GitHub. With `preview="drawer"`, hoists a drawer containing the file\'s snippet and a "View source on GitHub →" footer link, leaving an inline link at the call site that opens it.',typeName:"FileRef",category:"Content",snippet:['{% file-ref path="${1:packages/types/src/token-contract.ts}" lines="${2:42-58}" label="${3:ThemeTokensConfig}" /%}']}),progress:je({name:"progress",schema:wX,description:"A generic completion bar. Renders a ratio from supplied numbers — value+max (or percent) — with an optional body label; computes nothing itself. Feed it an aggregate (e.g. value=$item.data.progressDone max=$item.data.progressTotal).",typeName:"Progress",category:"Content",snippet:['{% progress value="${1:3}" max="${2:10}" /%}']}),card:je({name:"card",schema:_X,description:"A generic, self-contained content card. The body splits on `---` into [media] / body / [footer]: the media zone holds any content (image, codegroup, sandbox, …) and lays out beside the body on wide screens / as a full-bleed header on mobile; the footer is a muted meta row. Optional `href` makes the whole card a link. Knows nothing about the registry — usable standalone or inside a collection body template.",typeName:"Card",category:"Content",snippet:['{% card href="${1:/posts/slug/}" %}',"### ${2:Title}","${3:A short summary.}","{% /card %}"]})},zw={...QX(ZW),link:XC,...B.tags},FW={heading:m8,paragraph:g8,fence:v8,list:O8,item:b8,em:y8,strong:w8,text:_8,link:XC,hardbreak:k8,image:x8,table:S8,thead:B.nodes.thead,tbody:B.nodes.tbody,th:B.nodes.th,tr:B.nodes.tr,td:A8,error:B.nodes.error},XW=new Set(["nav","nav-group","nav-item"]);function VW(n,e,t){const r={...n.runes};for(const[i,s]of Object.entries(dW.runes)){if(!r[i])continue;const o={};s.postTransform&&(o.postTransform=s.postTransform),s.styles&&(o.styles=s.styles),Object.keys(o).length&&(r[i]={...r[i],...o})}if(e)for(const[i,s]of Object.entries(e))r[i]&&(r[i]={...r[i],postTransform:s});if(t)for(const[i,s]of Object.entries(t))r[i]&&(r[i]={...r[i],styles:s});return{...n,runes:r}}function CP(n,e,t,r,i,s,o){const a=B.parse(n),l=VW(e,i,o),c=r?{...zw,...r}:zw,u=B.transform(a,{tags:c,nodes:FW,variables:{__source:n,__icons:l.icons}});let f=yV(u);s&&(f=av(f,s));const d=TP(f);let m=l9(l)(f);return t&&(m=t(m)),{html:D9(m),isComponent:d}}function TP(n){return n==null||typeof n=="string"||typeof n=="number"?!1:Array.isArray(n)?n.some(TP):"attributes"in n&&n.attributes?.["data-rune"]?XW.has(n.attributes["data-rune"]):!1}function av(n,e){if(n==null||typeof n=="string"||typeof n=="number")return n;if(Array.isArray(n))return n.map(r=>av(r,e));const t=n;if(t.attributes?.["data-rune"]==="sandbox"){const i=e.design?.contexts??{},o=t.children?.find(l=>l?.attributes?.["data-field"]==="context")?.attributes?.content??"default",a=i[o];if(a){const l={$$mdtype:"Tag",name:"meta",attributes:{"data-field":"design-tokens",content:JSON.stringify(a)},children:[]};return{...t,children:[...t.children??[],l]}}}if(t.children?.length){const r=t.children.map(i=>av(i,e));return{...t,children:r}}return t}function Zw(n){return n.hasAttribute("x-data")||n.hasAttribute("data-controller")}let WW=0;function oo(n){return`${n}-${++WW}`}const YW={"behavior.copy.copy":"Copy code","behavior.copy.copied":"Copied","behavior.gallery.lightbox":"Image lightbox","behavior.gallery.close":"Close lightbox","behavior.gallery.previous":"Previous image","behavior.gallery.next":"Next image","behavior.gallery.viewImage":"View image {n}","behavior.preview.preview":"Preview","behavior.preview.viewSource":"View source","behavior.preview.auto":"Auto","behavior.preview.light":"Light","behavior.preview.dark":"Dark","behavior.preview.systemPreference":"System preference","behavior.preview.lightMode":"Light mode","behavior.preview.darkMode":"Dark mode","behavior.preview.markdoc":"Markdoc","behavior.preview.rune":"Rune","behavior.preview.html":"HTML","behavior.reveal.continue":"Continue","behavior.reveal.startOver":"Start over","behavior.search.placeholder":"Search documentation...","behavior.search.noResults":"No results found.","behavior.search.unavailable":"Search is not available.","behavior.search.toNavigate":"to navigate","behavior.search.toSelect":"to select","behavior.search.esc":"Esc","behavior.datatable.filter":"Filter rows...","behavior.datatable.prev":"Prev","behavior.datatable.next":"Next","behavior.form.submitting":"Submitting...","behavior.form.success":"Form submitted successfully.","behavior.form.error":"Something went wrong. Please try again.","behavior.form.selectOption":"Select an option","behavior.juxtapose.slider":"Comparison slider","behavior.juxtapose.toggle":"Comparison toggle","behavior.juxtapose.panel":"Panel {n}","behavior.carousel.previous":"Previous","behavior.carousel.next":"Next","behavior.mobileMenu.open":"Open menu","behavior.mobileMenu.close":"Close menu","behavior.sectionNav.pageSections":"Page sections","behavior.audio.play":"Play","behavior.audio.pause":"Pause","behavior.audio.seek":"Seek","behavior.sandbox.content":"Sandboxed user content","behavior.map.moreInfo":"More info"};let Xl;function UW(){if(Xl!==void 0)return Xl??{};if(Xl=null,typeof document>"u")return{};const n=document.getElementById("rf-strings");if(!n||!n.textContent)return{};try{const e=JSON.parse(n.textContent);e&&typeof e=="object"&&!Array.isArray(e)&&(Xl=e)}catch{}return Xl??{}}function PP(n,e){return e===void 0?n:n.replace(/\{n\}/g,String(e))}function zt(n,e){const t=UW()[n]??YW[n]??n;return PP(t,e)}function cl(n,e,t,r){const i=n?.getAttribute(e);return i!=null?PP(i,r):zt(t,r)}const GW="http://www.w3.org/2000/svg",Fw='<rect x="9" y="9" width="13" height="13" rx="2" ry="2"/><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"/>',HW='<polyline points="20 6 9 17 4 12"/>';function Gp(n){const e=document.createElementNS(GW,"svg");return e.setAttribute("width","16"),e.setAttribute("height","16"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.innerHTML=n,e}function KW(n){const e=n.getAttribute("data-copy-selector");if(e){const t=n.querySelectorAll(e);return Array.from(t).map(r=>r.textContent??"").join(`
|
|
337
|
-
`)}return n.textContent??""}function JW(n){const e=n.querySelectorAll("pre"),t=[];for(const r of e){const i=r.parentElement;if(i?.classList.contains("rf-codeblock")&&i.querySelector(":scope > .rf-codeblock__copy"))continue;const s=document.createElement("button");s.className="rf-codeblock__copy",s.type="button";const o=cl(r,"data-i18n-copy","behavior.copy.copy"),a=cl(r,"data-i18n-copied","behavior.copy.copied");s.setAttribute("aria-label",o),s.appendChild(Gp(Fw));let l;const c=()=>{const f=KW(r);navigator.clipboard.writeText(f).then(()=>{s.innerHTML="",s.appendChild(Gp(HW)),s.setAttribute("aria-label",a),s.classList.add("rf-codeblock__copy--copied"),l&&clearTimeout(l),l=setTimeout(()=>{s.innerHTML="",s.appendChild(Gp(Fw)),s.setAttribute("aria-label",o),s.classList.remove("rf-codeblock__copy--copied")},2e3)})};s.addEventListener("click",c);const u=r.parentElement?.classList.contains("rf-codeblock")?r.parentElement:null;if(u)u.appendChild(s),t.push(()=>{s.removeEventListener("click",c),l&&clearTimeout(l),s.remove()});else{const f=document.createElement("div");f.className="rf-codeblock",r.parentNode?.insertBefore(f,r),f.appendChild(r),f.appendChild(s),t.push(()=>{s.removeEventListener("click",c),l&&clearTimeout(l),f.parentNode?.insertBefore(r,f),f.remove()})}}return()=>t.forEach(r=>r())}function Xw(n){const e=Array.from(n.querySelectorAll("details"));if(e.length===0)return()=>{};const t=n.hasAttribute("data-multiple"),r=[];for(const o of e){const a=o.querySelector("summary");if(!a)continue;const l=oo("rf-accordion-panel"),c=oo("rf-accordion-trigger");a.id=c,a.setAttribute("aria-expanded",String(o.open)),o.setAttribute("data-state",o.open?"open":"closed"),a.setAttribute("data-state",o.open?"active":"inactive");const u=Array.from(o.children).find(d=>d instanceof HTMLElement&&d.tagName!=="SUMMARY");u&&(u.id=l,u.setAttribute("role","region"),u.setAttribute("aria-labelledby",c),a.setAttribute("aria-controls",l));const f=()=>{if(a.setAttribute("aria-expanded",String(o.open)),o.setAttribute("data-state",o.open?"open":"closed"),a.setAttribute("data-state",o.open?"active":"inactive"),!t&&o.open){for(const d of e)if(d!==o&&d.open){d.open=!1;const h=d.querySelector("summary");h?.setAttribute("aria-expanded","false"),d.setAttribute("data-state","closed"),h?.setAttribute("data-state","inactive")}}};o.addEventListener("toggle",f),r.push(()=>o.removeEventListener("toggle",f))}const i=e.map(o=>o.querySelector("summary")).filter(o=>o!==null),s=o=>{const a=o.target,l=i.indexOf(a);if(l===-1)return;let c=null;switch(o.key){case"ArrowDown":c=(l+1)%i.length;break;case"ArrowUp":c=(l-1+i.length)%i.length;break;case"Home":c=0;break;case"End":c=i.length-1;break;default:return}c!==null&&(o.preventDefault(),i[c].focus())};return n.addEventListener("keydown",s),r.push(()=>n.removeEventListener("keydown",s)),()=>r.forEach(o=>o())}const ul=new Map,Vw=new WeakSet;function eY(n){let e=ul.get(n);return e||(e=new Map,ul.set(n,e)),e}function tY(n){const e=n.split("+").map(i=>i.trim().toLowerCase()).filter(Boolean);if(e.length===0)return null;const t=e[e.length-1];if(!t)return null;const r=new Set(e.slice(0,-1));return{key:t,cmd:r.has("cmd")||r.has("meta"),ctrl:r.has("ctrl")||r.has("control"),alt:r.has("alt")||r.has("option"),shift:r.has("shift")}}function nY(n,e){if(e.key.toLowerCase()!==n.key)return!1;const t=e.metaKey||e.ctrlKey,r=n.cmd||n.ctrl;return!(r&&!t||!r&&t||n.alt!==e.altKey||n.shift!==e.shiftKey)}function rY(n){const e=n.activeElement;if(!e)return!1;const t=e.tagName;return!!(t==="INPUT"||t==="TEXTAREA"||t==="SELECT"||e.isContentEditable)}function iY(n){const e=n.ownerDocument;if(!e||!e.defaultView)return()=>{};const t=e.defaultView,r=n instanceof t.HTMLDialogElement?n:sY(n);if(!r)return()=>{};const i=r.id;if(!i)return()=>{};const s=r.querySelector(".rf-drawer__close");s&&(s.hidden=!1);const o=r.getAttribute("data-shortcut")??void 0,a=o?tY(o)??void 0:void 0,l=eY(e);if(l.has(i))return()=>{};if(a)for(const v of l.values())v.shortcut&&Yw(v.shortcut)===Yw(a)&&console.warn(`[refrakt drawer] shortcut "${o}" is registered by drawers "${v.id}" and "${i}"; the later one wins.`);l.set(i,{dialog:r,id:i,shortcut:a});const c=[],u=`#${i}`,f=v=>{v.preventDefault(),lv(r)},d=[];if(e.querySelectorAll('a[data-target-type="drawer"]').forEach(v=>{const O=v.getAttribute("href")??"";(O===u||O.endsWith(u))&&(v.addEventListener("click",f),d.push(v))}),c.push(()=>{for(const v of d)v.removeEventListener("click",f)}),s){const v=()=>Ef(r);s.addEventListener("click",v),c.push(()=>s.removeEventListener("click",v))}const h=v=>{v.target===r&&Ef(r)};r.addEventListener("click",h),c.push(()=>r.removeEventListener("click",h));const m=v=>{v.preventDefault(),Ef(r)};r.addEventListener("cancel",m),c.push(()=>r.removeEventListener("cancel",m));const p=()=>{r.setAttribute("data-state","closed"),t.location.hash===u&&t.history.replaceState(null,"",t.location.pathname+t.location.search),Ww(e)};return r.addEventListener("close",p),c.push(()=>r.removeEventListener("close",p)),t.location.hash===u&&t.queueMicrotask(()=>{r.open||lv(r)}),Vw.has(e)||(Vw.add(e),lY(e)),()=>{for(const v of c)v();l.delete(i),Ww(e)}}function sY(n){const e=n.ownerDocument;if(!e)return null;const t=e.createElement("dialog");for(const r of Array.from(n.attributes))t.setAttribute(r.name,r.value);for(;n.firstChild;)t.appendChild(n.firstChild);return n.parentNode&&n.parentNode.replaceChild(t,n),t.setAttribute("data-state","closed"),t}function lv(n){const e=n.ownerDocument;if(!e||!e.defaultView)return;const t=e.defaultView,r=ul.get(e);if(r)for(const i of r.values())i.dialog!==n&&i.dialog.open&&i.dialog.close();if(!n.open)try{n.showModal()}catch{n.setAttribute("open","")}if(n.setAttribute("data-state","open"),aY(e),n.id){const i=`#${n.id}`;t.location.hash!==i&&t.history.replaceState(null,"",t.location.pathname+t.location.search+i)}}const oY=280;function Ef(n){if(!n.open||n.getAttribute("data-state")==="closing")return;n.setAttribute("data-state","closing");let e=!1;const t=()=>{if(!e){e=!0,n.removeEventListener("animationend",r),i!==void 0&&clearTimeout(i);try{n.close()}catch{n.removeAttribute("open")}}},r=s=>{s.target===n&&(s.animationName&&!s.animationName.startsWith("rf-drawer-slide-out")||t())};n.addEventListener("animationend",r);const i=setTimeout(t,oY)}function aY(n){n.documentElement.classList.add("rf-drawer-open")}function Ww(n){const e=ul.get(n);if(!e){n.documentElement.classList.remove("rf-drawer-open");return}for(const t of e.values())if(t.dialog.open)return;n.documentElement.classList.remove("rf-drawer-open")}function Yw(n){const e=[];return(n.cmd||n.ctrl)&&e.push("mod"),n.alt&&e.push("alt"),n.shift&&e.push("shift"),e.push(n.key),e.join("+")}function lY(n){const e=n.defaultView;if(!e)return;const t=i=>{if(rY(n))return;const s=ul.get(n);if(!s)return;let o;for(const a of s.values())a.shortcut&&nY(a.shortcut,i)&&(o=a);o&&(i.preventDefault(),lv(o.dialog))};n.addEventListener("keydown",t);const r=()=>{const i=ul.get(n);if(i)for(const s of i.values())s.dialog.open&&e.location.hash!==`#${s.id}`&&Ef(s.dialog)};e.addEventListener("popstate",r)}function Uw(n){const e=n.querySelector('[data-name="tabs"]'),t=n.querySelector('[data-name="panels"]');if(!e||!t)return()=>{};const r=Array.from(e.children).filter(d=>d instanceof HTMLElement&&d.tagName==="BUTTON"),i=Array.from(t.children).filter(d=>d instanceof HTMLElement);if(r.length===0||i.length===0)return()=>{};const s=r.map(()=>oo("rf-tab")),o=i.map(()=>oo("rf-tabpanel"));for(let d=0;d<r.length;d++)r[d].id=s[d],o[d]&&r[d].setAttribute("aria-controls",o[d]);for(let d=0;d<i.length;d++)o[d]&&(i[d].id=o[d]),s[d]&&i[d].setAttribute("aria-labelledby",s[d]);const a=r[0].className.split(" ")[0]||"";let l=0;function c(d){l=d;for(let h=0;h<r.length;h++){const m=h===l;r[h].setAttribute("aria-selected",String(m)),r[h].setAttribute("data-state",m?"active":"inactive"),a&&r[h].classList.toggle(`${a}--active`,m)}for(let h=0;h<i.length;h++){const m=h===l;i[h].hidden=!m,i[h].setAttribute("data-state",m?"active":"inactive")}}c(0);const u=[];for(let d=0;d<r.length;d++){const h=()=>c(d);r[d].addEventListener("click",h),u.push(()=>r[d].removeEventListener("click",h))}const f=d=>{const h=d.target,m=r.indexOf(h);if(m===-1)return;let p=null;switch(d.key){case"ArrowRight":p=(m+1)%r.length;break;case"ArrowLeft":p=(m-1+r.length)%r.length;break;case"Home":p=0;break;case"End":p=r.length-1;break;default:return}p!==null&&(d.preventDefault(),r[p].focus(),c(p))};return e.addEventListener("keydown",f),u.push(()=>e.removeEventListener("keydown",f)),()=>{u.forEach(d=>d());for(const d of r)d.removeAttribute("id"),d.removeAttribute("aria-controls"),d.removeAttribute("aria-selected"),d.removeAttribute("data-state"),a&&d.classList.remove(`${a}--active`);for(const d of i)d.hidden=!1,d.removeAttribute("id"),d.removeAttribute("aria-labelledby"),d.removeAttribute("data-state")}}function cY(n){const e=n.querySelector('[data-name="steps"]')||n,t=Array.from(e.querySelectorAll('[data-rune="reveal-step"]'));if(t.length===0)return()=>{};let r=1;const i=document.createElement("button");i.className="rf-reveal__next",i.textContent=cl(n,"data-i18n-continue","behavior.reveal.continue");const s=document.createElement("button");s.className="rf-reveal__reset",s.textContent=cl(n,"data-i18n-start-over","behavior.reveal.startOver");function o(){for(let c=0;c<t.length;c++){const u=c<r;t[c].classList.toggle("rf-reveal-step--visible",u),t[c].classList.toggle("rf-reveal-step--hidden",!u),t[c].setAttribute("data-state",u?"open":"closed")}r<t.length?(i.parentNode||n.appendChild(i),s.remove()):t.length>1?(i.remove(),s.parentNode||n.appendChild(s)):(i.remove(),s.remove())}const a=()=>{r<t.length&&(r++,o())},l=()=>{r=1,o()};return i.addEventListener("click",a),s.addEventListener("click",l),o(),()=>{i.removeEventListener("click",a),s.removeEventListener("click",l),i.remove(),s.remove();for(const c of t)c.classList.remove("rf-reveal-step--visible","rf-reveal-step--hidden"),c.removeAttribute("data-state")}}function uY(n){const e=n.querySelector("table");if(!e)return()=>{};const t=e.closest(".rf-datatable__scroll")??e,r=n.getAttribute("data-searchable")==="true",s=(n.getAttribute("data-sortable")||"").split(",").map(y=>y.trim()).filter(Boolean),o=parseInt(n.getAttribute("data-page-size")||"0",10),a=n.getAttribute("data-default-sort")||"",l=Array.from(e.querySelectorAll("th")),c=l.map(y=>y.textContent?.trim()||""),u=e.querySelectorAll("tbody tr"),f=Array.from(u.length>0?u:e.querySelectorAll("tr:not(:first-child)")).map(y=>{const k=Array.from(y.querySelectorAll("td"));return{el:y,cells:k.map(P=>P.textContent?.trim()||""),dataValues:k.map(P=>P.getAttribute("data-value"))}}),d=f.map(y=>y.el);let h="",m=a,p="asc",v=0;const O=[];let b=null,w=null;if(r){b=document.createElement("div"),b.className="rf-datatable__toolbar",w=document.createElement("input"),w.type="search",w.placeholder=zt("behavior.datatable.filter"),w.className="rf-datatable__input",b.appendChild(w),t.before(b);const y=()=>{h=w.value,v=0,C()};w.addEventListener("input",y),O.push(()=>w.removeEventListener("input",y))}for(const y of l){const k=y.textContent?.trim()||"";if(!s.includes(k))continue;y.style.cursor="pointer",y.style.userSelect="none";const P=()=>{m===k?p=p==="asc"?"desc":"asc":(m=k,p="asc"),v=0,C()};y.addEventListener("click",P),O.push(()=>{y.removeEventListener("click",P),y.style.cursor="",y.style.userSelect=""})}let S=null,_=null,x=null,A=null;if(o>0){S=document.createElement("div"),S.className="rf-datatable__pagination",_=document.createElement("button"),_.className="rf-datatable__page-btn",_.textContent=`← ${zt("behavior.datatable.prev")}`,A=document.createElement("span"),A.className="rf-datatable__page-info",x=document.createElement("button"),x.className="rf-datatable__page-btn",x.textContent=`${zt("behavior.datatable.next")} →`,S.appendChild(_),S.appendChild(A),S.appendChild(x),t.after(S);const y=()=>{v>0&&(v--,C())},k=()=>{v++,C()};_.addEventListener("click",y),x.addEventListener("click",k),O.push(()=>{_.removeEventListener("click",y),x.removeEventListener("click",k)})}function C(){let y=[...f];if(h){const Q=h.toLowerCase();y=y.filter($=>$.cells.some(L=>L.toLowerCase().includes(Q)))}if(m){const Q=c.indexOf(m);Q>=0&&y.sort(($,L)=>{const I=$.dataValues[Q],Z=L.dataValues[Q],Y=I!==null?Number(I):NaN,ne=Z!==null?Number(Z):NaN,ae=I!==null&&Z!==null&&!Number.isNaN(Y)&&!Number.isNaN(ne)?Y-ne:$.cells[Q].localeCompare(L.cells[Q],void 0,{numeric:!0});return p==="asc"?ae:-ae})}const k=y.length,P=o>0?Math.ceil(k/o):1;v>=P&&(v=Math.max(0,P-1));const T=o>0?y.slice(v*o,(v+1)*o):y,E=e.querySelector("tbody")||e;for(const Q of f)Q.el.style.display="none";for(const Q of T)Q.el.style.display="",E.appendChild(Q.el);for(const Q of l){const $=Q.textContent?.replace(/[▲▼]/g,"").trim()||"",L=Q.querySelector(".rf-datatable__sort-indicator");if(s.includes($))if(m===$)if(L)L.textContent=p==="asc"?" ▲":" ▼";else{const I=document.createElement("span");I.className="rf-datatable__sort-indicator",I.textContent=p==="asc"?" ▲":" ▼",Q.appendChild(I)}else L?.remove()}S&&_&&x&&A&&(_.disabled=v===0,x.disabled=v>=P-1,A.textContent=`${v+1} / ${P}`,P<=1?S.hidden=!0:S.hidden=!1)}return C(),()=>{O.forEach(k=>k()),b?.remove(),S?.remove();for(const k of l)k.querySelector(".rf-datatable__sort-indicator")?.remove();const y=e.querySelector("tbody")||e;for(const k of d)k.style.display="",y.appendChild(k)}}function fY(n){const e=n.tagName==="FORM"?n:n.querySelector("form");if(!e)return()=>{};const t=n.getAttribute("data-action")||e.getAttribute("action")||"",r=n.getAttribute("data-method")||e.getAttribute("method")||"POST",i=n.getAttribute("data-success")||zt("behavior.form.success"),s=n.getAttribute("data-error")||zt("behavior.form.error"),o=n.getAttribute("data-honeypot")!=="false";let a=null;if(o){a=document.createElement("div"),a.className="rf-form__hp",a.setAttribute("aria-hidden","true"),a.style.display="none";const f=document.createElement("input");f.type="text",f.name="_gotcha",f.setAttribute("autocomplete","off"),f.tabIndex=-1,a.appendChild(f),e.prepend(a)}const l=document.createElement("div");l.className="rf-form__status",l.hidden=!0,e.appendChild(l);function c(f,d){l.hidden=!1,l.className=`rf-form__status rf-form__status--${f}`,l.setAttribute("role",f==="submitting"?"status":"alert"),l.setAttribute("data-state",f),l.textContent=d}const u=async f=>{if(f.preventDefault(),!!t){c("submitting",zt("behavior.form.submitting"));try{const d=new FormData(e);(await fetch(t,{method:r,body:d,headers:{Accept:"application/json"}})).ok?(c("success",i),e.reset()):c("error",s)}catch{c("error",s)}}};return e.addEventListener("submit",u),()=>{e.removeEventListener("submit",u),a?.remove(),l.remove()}}const dY="http://www.w3.org/2000/svg";function of(n){const e=document.createElementNS(dY,"svg");return e.setAttribute("width","14"),e.setAttribute("height","14"),e.setAttribute("viewBox","0 0 24 24"),e.setAttribute("fill","none"),e.setAttribute("stroke","currentColor"),e.setAttribute("stroke-width","2"),e.setAttribute("stroke-linecap","round"),e.setAttribute("stroke-linejoin","round"),e.innerHTML=n,e}const ds={eye:'<path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/>',code:'<polyline points="16 18 22 12 16 6"/><polyline points="8 6 2 12 8 18"/>',mobile:'<rect x="5" y="2" width="14" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/>',tablet:'<rect x="4" y="2" width="16" height="20" rx="2" ry="2"/><line x1="12" y1="18" x2="12.01" y2="18"/>',desktop:'<rect x="2" y="3" width="20" height="14" rx="2" ry="2"/><line x1="8" y1="21" x2="16" y2="21"/><line x1="12" y1="17" x2="12" y2="21"/>',sun:'<circle cx="12" cy="12" r="5"/><line x1="12" y1="1" x2="12" y2="3"/><line x1="12" y1="21" x2="12" y2="23"/><line x1="4.22" y1="4.22" x2="5.64" y2="5.64"/><line x1="18.36" y1="18.36" x2="19.78" y2="19.78"/><line x1="1" y1="12" x2="3" y2="12"/><line x1="21" y1="12" x2="23" y2="12"/><line x1="4.22" y1="19.78" x2="5.64" y2="18.36"/><line x1="18.36" y1="5.64" x2="19.78" y2="4.22"/>',moon:'<path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"/>'},hY={mobile:ds.mobile,tablet:ds.tablet,desktop:ds.desktop},ma={mobile:{width:375,label:"375px"},tablet:{width:768,label:"768px"},desktop:{width:null,label:"Full"}};function pY(n){const e=n.getAttribute("data-theme")||"auto",r=(n.getAttribute("data-responsive")||"").split(",").map(L=>L.trim()).filter(L=>L in ma),i=r.length>0,s=n.querySelector('[data-name="source"]'),o=n.querySelector('[data-name="html-source"]'),a=n.querySelector('[data-name="themed-source"]'),l=Array.from(n.children).filter(L=>L!==s&&L!==o&&L!==a&&!L.matches?.("meta[data-field]")),c=s!==null||o!==null;let u="preview",f=e,d=i?r[r.length-1]:null;const h=[],m=document.createElement("div");m.className="rf-preview__toolbar";const p=document.createElement("div");p.className="rf-preview__toolbar-left",m.appendChild(p);const v=document.createElement("span");v.className="rf-preview__title",p.appendChild(v);const O=document.createElement("div");O.className="rf-preview__controls",m.appendChild(O);let b=null,w=null;if(c){const L=document.createElement("div");L.className="rf-preview__view-toggle",b=document.createElement("button"),b.className="rf-preview__toggle-btn rf-preview__toggle-btn--active",b.setAttribute("aria-label",zt("behavior.preview.preview")),b.setAttribute("title",zt("behavior.preview.preview")),b.appendChild(of(ds.eye)),w=document.createElement("button"),w.className="rf-preview__toggle-btn",w.setAttribute("aria-label",zt("behavior.preview.viewSource")),w.setAttribute("title",zt("behavior.preview.viewSource")),w.appendChild(of(ds.code)),L.appendChild(b),L.appendChild(w),p.appendChild(L);const I=()=>{u="preview",$()},Z=()=>{u="code",$()};b.addEventListener("click",I),w.addEventListener("click",Z),h.push(()=>{b.removeEventListener("click",I),w.removeEventListener("click",Z)})}const S=new Map;if(i){const L=document.createElement("div");L.className="rf-preview__viewport-toggle";for(const I of r){const Z=document.createElement("button");Z.className="rf-preview__toggle-btn",Z.setAttribute("aria-label",`${ma[I].label} viewport`),Z.setAttribute("title",ma[I].label),Z.appendChild(of(hY[I]||ds.desktop));const Y=()=>{d=I,$()};Z.addEventListener("click",Y),h.push(()=>Z.removeEventListener("click",Y)),L.appendChild(Z),S.set(I,Z)}O.appendChild(L)}const _=document.createElement("div");_.className="rf-preview__toggle";const x=[{mode:"auto",label:zt("behavior.preview.auto"),title:zt("behavior.preview.systemPreference"),icon:ds.desktop},{mode:"light",label:zt("behavior.preview.light"),title:zt("behavior.preview.lightMode"),icon:ds.sun},{mode:"dark",label:zt("behavior.preview.dark"),title:zt("behavior.preview.darkMode"),icon:ds.moon}],A=new Map;for(const L of x){const I=document.createElement("button");I.className="rf-preview__toggle-btn",I.setAttribute("aria-label",`${L.label} theme`),I.setAttribute("title",L.title),I.appendChild(of(L.icon));const Z=()=>{f=L.mode,$()};I.addEventListener("click",Z),h.push(()=>I.removeEventListener("click",Z)),_.appendChild(I),A.set(L.mode,I)}O.appendChild(_);const C=document.createElement("div");C.className="rf-preview__canvas";let y=null,k=null;if(i){y=document.createElement("div"),y.className="rf-preview__viewport-frame",k=document.createElement("span"),k.className="rf-preview__viewport-label",k.hidden=!0,y.appendChild(k);for(const L of l)y.appendChild(L);C.appendChild(y)}else for(const L of l)C.appendChild(L);const P=[];let T=null,E=null,Q="";if(c){if(T=document.createElement("div"),T.className="rf-preview__source",s){const L=document.createElement("div");L.appendChild(s),P.push({key:"markdoc",label:zt("behavior.preview.markdoc"),panel:L})}if(o){const L=document.createElement("div");L.appendChild(o),P.push({key:"rune",label:zt("behavior.preview.rune"),panel:L})}if(a){const L=document.createElement("div");L.appendChild(a),P.push({key:"html",label:zt("behavior.preview.html"),panel:L})}if(Q=P[0]?.key??"",P.length>1){const L=document.createElement("div");L.className="rf-preview__source-tabs",E=new Map;for(const I of P){const Z=document.createElement("button");Z.className="rf-preview__source-tab",I.key===Q&&Z.classList.add("rf-preview__source-tab--active"),Z.textContent=I.label;const Y=()=>{Q=I.key,$()};Z.addEventListener("click",Y),h.push(()=>Z.removeEventListener("click",Y)),L.appendChild(Z),E.set(I.key,Z)}T.appendChild(L)}for(const L of P)L.panel.hidden=L.key!==Q,T.appendChild(L.panel)}n.appendChild(m),T&&n.appendChild(T),n.appendChild(C);function $(){if(b&&w&&(b.classList.toggle("rf-preview__toggle-btn--active",u==="preview"),w.classList.toggle("rf-preview__toggle-btn--active",u==="code")),T&&(T.hidden=u!=="code"),C.hidden=u==="code"&&c,O.hidden=u==="code"&&c,E)for(const[I,Z]of E)Z.classList.toggle("rf-preview__source-tab--active",Q===I);for(const I of P)I.panel.hidden=I.key!==Q;for(const[I,Z]of S)Z.classList.toggle("rf-preview__toggle-btn--active",d===I);if(y){const I=d&&ma[d]?ma[d].width:null;y.classList.toggle("rf-preview__viewport-frame--constrained",!!I),y.style.maxWidth=I?`${I}px`:"",k&&(I&&d?(k.textContent=ma[d].label,k.hidden=!1):k.hidden=!0)}for(const[I,Z]of A)Z.classList.toggle("rf-preview__toggle-btn--active",f===I);const L=f==="auto"?void 0:f;L?C.setAttribute("data-color-scheme",L):C.removeAttribute("data-color-scheme");for(const I of C.querySelectorAll("rf-sandbox"))typeof I.setTheme=="function"&&I.setTheme(L||"auto")}return $(),()=>{h.forEach(L=>L()),s&&n.appendChild(s),o&&n.appendChild(o),a&&n.appendChild(a);for(const L of Array.from(y?.children??C.children))L!==k&&n.appendChild(L);m.remove(),C.remove(),T?.remove()}}function mY(n){if(!n.parentElement?.matches('[data-section="media"]'))return()=>{};if(n.getAttribute("data-fit")==="none")return()=>{};const e=n.querySelector(".rf-mockup__frame");if(!e)return()=>{};const t=()=>{const i=parseFloat(getComputedStyle(e).getPropertyValue("--mockup-device-width")),s=getComputedStyle(n),o=(parseFloat(s.paddingLeft)||0)+(parseFloat(s.paddingRight)||0),a=n.clientWidth-o,l=i>0&&a>0?a/i:1;e.style.setProperty("--mockup-fit-scale",String(l))};t();const r=new ResizeObserver(t);return r.observe(n),()=>{r.disconnect(),e.style.removeProperty("--mockup-fit-scale")}}function gY(n){const e=n.querySelectorAll("[data-scrollspy]"),t=[];for(const r of e){const i=r.querySelectorAll('a[href^="#"]');if(i.length===0)continue;const s=new Map,o=[];for(const c of i){const u=c.getAttribute("href").slice(1),f=document.getElementById(u);if(!f)continue;const d=c.closest("li");d&&(s.set(f,d),o.push(f))}if(o.length===0)continue;let a=null;const l=new IntersectionObserver(c=>{for(const u of c)if(u.isIntersecting){const f=s.get(u.target);f&&f!==a&&(a?.removeAttribute("data-active"),f.setAttribute("data-active",""),a=f);break}},{rootMargin:"0px 0px -80% 0px"});for(const c of o)l.observe(c);t.push(()=>{l.disconnect(),a?.removeAttribute("data-active")})}return()=>t.forEach(r=>r())}const vY='[data-reveal]:not([data-reveal="none"])';function OY(n){const e=Array.from(n.querySelectorAll(vY));if(e.length===0)return()=>{};if((n instanceof Document?n.documentElement:n.ownerDocument?.documentElement??n).setAttribute("data-animate",""),typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches||typeof IntersectionObserver>"u"){for(const s of e)s.setAttribute("data-in-view","");return()=>{}}const i=new IntersectionObserver((s,o)=>{for(const a of s)a.isIntersecting&&(a.target.setAttribute("data-in-view",""),o.unobserve(a.target))},{rootMargin:"0px 0px -10% 0px"});for(const s of e)i.observe(s);return()=>i.disconnect()}function bY(n){const e=n.querySelectorAll("[data-version-switcher]"),t=[];for(const r of e){const i=r.querySelector("select");if(!i)continue;const s=()=>{const o=i.value;o&&o!==window.location.pathname&&(window.location.href=o)};i.addEventListener("change",s),t.push(()=>i.removeEventListener("change",s))}return()=>t.forEach(r=>r())}function yY(n){const e=[];if(n.getAttribute("data-lightbox")==="true"){const t=wY(n);t&&e.push(t)}return()=>e.forEach(t=>t())}function wY(n){const e=Array.from(n.querySelectorAll('[data-name="item"]'));if(e.length===0)return;let t=null,r=0;function i(d){return d.querySelector("img")?.getAttribute("src")||""}function s(d){return d.querySelector("img")?.getAttribute("alt")||""}function o(d){r=d,e[r]?.setAttribute("data-state","selected"),t=document.createElement("div"),t.className="rf-gallery__lightbox",t.setAttribute("role","dialog"),t.setAttribute("aria-modal","true"),t.setAttribute("aria-label",zt("behavior.gallery.lightbox"));const h=document.createElement("img");h.src=i(e[r]),h.alt=s(e[r]);const m=document.createElement("button");m.className="rf-gallery__lightbox-close",m.setAttribute("aria-label",zt("behavior.gallery.close")),m.textContent="×";const p=document.createElement("button");p.className="rf-gallery__lightbox-nav rf-gallery__lightbox-nav--prev",p.setAttribute("aria-label",zt("behavior.gallery.previous")),p.textContent="‹";const v=document.createElement("button");v.className="rf-gallery__lightbox-nav rf-gallery__lightbox-nav--next",v.setAttribute("aria-label",zt("behavior.gallery.next")),v.textContent="›",t.appendChild(h),t.appendChild(m),e.length>1&&(t.appendChild(p),t.appendChild(v)),m.addEventListener("click",l),p.addEventListener("click",()=>a(-1)),v.addEventListener("click",()=>a(1)),t.addEventListener("click",O=>{O.target===t&&l()}),document.body.appendChild(t),document.addEventListener("keydown",c),m.focus()}function a(d){if(!t)return;e[r]?.removeAttribute("data-state"),r=(r+d+e.length)%e.length,e[r]?.setAttribute("data-state","selected");const h=t.querySelector("img");h&&(h.src=i(e[r]),h.alt=s(e[r]))}function l(){t&&(e[r]?.removeAttribute("data-state"),document.removeEventListener("keydown",c),t.remove(),t=null,e[r]?.focus())}function c(d){d.key==="Escape"&&(d.preventDefault(),l()),d.key==="ArrowLeft"&&(d.preventDefault(),a(-1)),d.key==="ArrowRight"&&(d.preventDefault(),a(1))}const u=[];e.forEach((d,h)=>{const m=()=>o(h);d.addEventListener("click",m),d.setAttribute("tabindex","0"),d.setAttribute("role","button"),d.setAttribute("aria-label",s(d)||zt("behavior.gallery.viewImage",h+1)),u.push([d,m])});const f=d=>{if(d.key==="Enter"||d.key===" "){d.preventDefault();const h=d.currentTarget,m=e.indexOf(h);m>=0&&o(m)}};return e.forEach(d=>d.addEventListener("keydown",f)),()=>{l();for(const[d,h]of u)d.removeEventListener("click",h),d.removeAttribute("tabindex"),d.removeAttribute("role"),d.removeAttribute("aria-label");e.forEach(d=>d.removeEventListener("keydown",f))}}function _Y(n){const e=n.querySelector('[data-name="items"]');if(!e)return;const t=Array.from(e.children);if(t.length===0)return;const r=e.parentElement??n;let i;const s=getComputedStyle(r).position;if(s==="static"||s===""){const d=r.style.position;r.style.position="relative",i=()=>{r.style.position=d}}const o=document.createElement("button");o.className="rf-carousel__nav rf-carousel__nav--prev",o.setAttribute("aria-label",cl(n,"data-i18n-previous","behavior.carousel.previous")),o.textContent="‹";const a=document.createElement("button");a.className="rf-carousel__nav rf-carousel__nav--next",a.setAttribute("aria-label",cl(n,"data-i18n-next","behavior.carousel.next")),a.textContent="›",r.appendChild(o),r.appendChild(a);function l(d){const h=t[0];if(!h)return;const m=parseFloat(getComputedStyle(e).columnGap),p=h.offsetWidth+(Number.isFinite(m)?m:0);e.scrollBy({left:d*p,behavior:"smooth"})}const c=()=>l(-1),u=()=>l(1);o.addEventListener("click",c),a.addEventListener("click",u);const f=d=>{d.key==="ArrowLeft"&&(d.preventDefault(),l(-1)),d.key==="ArrowRight"&&(d.preventDefault(),l(1))};return n.setAttribute("tabindex","0"),n.addEventListener("keydown",f),()=>{o.removeEventListener("click",c),a.removeEventListener("click",u),n.removeEventListener("keydown",f),o.remove(),a.remove(),n.removeAttribute("tabindex"),i?.()}}function kY(n){switch(n.getAttribute("data-variant")||"slider"){case"toggle":return AY(n);case"fade":return CY(n);case"auto":return TY(n);default:return SY(n)}}function xh(n){const e=n.querySelector('[data-name="panels"]')||n;return Array.from(e.querySelectorAll(':scope > [data-rune="juxtapose-panel"]'))}function xY(n){return n.querySelector('[data-name="name"]')?.textContent?.trim()||""}function SY(n){const e=xh(n);if(e.length<2)return()=>{};const r=(n.getAttribute("data-orientation")||"vertical")==="horizontal",i=n.querySelector('[data-name="panels"]');if(!i)return()=>{};i.style.position="relative",i.style.overflow="hidden",e[0].style.position="absolute",e[0].style.inset="0",e[0].style.zIndex="2",e[0].style.willChange="clip-path",e[1].style.position="relative",e[1].style.zIndex="1";for(const v of e)for(const O of v.querySelectorAll('iframe[loading="lazy"]'))O.loading="eager";const s=document.createElement("div");s.className="rf-juxtapose__divider",s.setAttribute("role","slider"),s.setAttribute("aria-label",zt("behavior.juxtapose.slider")),s.setAttribute("aria-valuemin","0"),s.setAttribute("aria-valuemax","100"),s.setAttribute("tabindex","0");const o=document.createElement("div");o.className="rf-juxtapose__divider-handle",s.appendChild(o),i.appendChild(s);function a(v){const O=Math.max(0,Math.min(100,v));n.style.setProperty("--jx-position",String(O)),s.setAttribute("aria-valuenow",String(Math.round(O))),r?(e[0].style.clipPath=`inset(0 0 ${100-O}% 0)`,s.style.top=`${O}%`,s.style.left=""):(e[0].style.clipPath=`inset(0 ${100-O}% 0 0)`,s.style.left=`${O}%`,s.style.top="")}const l=parseFloat(n.style.getPropertyValue("--jx-position"))||50;a(l);let c=!1;function u(v){const O=i.getBoundingClientRect();return r?(v.clientY-O.top)/O.height*100:(v.clientX-O.left)/O.width*100}const f=v=>{c=!0,s.setPointerCapture(v.pointerId),a(u(v)),v.preventDefault()},d=v=>{c&&a(u(v))},h=v=>{c&&(c=!1,s.releasePointerCapture(v.pointerId))},m=v=>{v.target===s||s.contains(v.target)||(c=!0,s.setPointerCapture(v.pointerId),a(u(v)))};s.addEventListener("pointerdown",f),s.addEventListener("pointermove",d),s.addEventListener("pointerup",h),i.addEventListener("pointerdown",m),i.addEventListener("pointermove",d),i.addEventListener("pointerup",h);const p=v=>{const O=parseFloat(n.style.getPropertyValue("--jx-position"))||50,b=v.shiftKey?10:2,w=r?["ArrowUp"]:["ArrowLeft"],S=r?["ArrowDown"]:["ArrowRight"];w.includes(v.key)?(a(O-b),v.preventDefault()):S.includes(v.key)?(a(O+b),v.preventDefault()):v.key==="Home"?(a(0),v.preventDefault()):v.key==="End"&&(a(100),v.preventDefault())};return s.addEventListener("keydown",p),()=>{s.removeEventListener("pointerdown",f),s.removeEventListener("pointermove",d),s.removeEventListener("pointerup",h),i.removeEventListener("pointerdown",m),i.removeEventListener("pointermove",d),i.removeEventListener("pointerup",h),s.removeEventListener("keydown",p),s.remove(),i.style.position="",i.style.overflow="";for(const v of e)v.style.position="",v.style.inset="",v.style.zIndex="",v.style.clipPath="",v.style.willChange=""}}function AY(n){const e=xh(n);if(e.length<2)return()=>{};let t=0;const r=document.createElement("div");r.className="rf-juxtapose__toggle-bar",r.setAttribute("role","radiogroup"),r.setAttribute("aria-label",zt("behavior.juxtapose.toggle"));const i=e.map((l,c)=>{const u=document.createElement("button");return u.className="rf-juxtapose__toggle-btn",u.setAttribute("role","radio"),u.textContent=xY(l)||zt("behavior.juxtapose.panel",c+1),r.appendChild(u),u}),s=n.querySelector('[data-name="panels"]');s?s.parentNode.insertBefore(r,s):n.insertBefore(r,n.firstChild);function o(){e.forEach((l,c)=>{const u=c===t;l.hidden=!u,l.setAttribute("data-state",u?"active":"inactive")}),i.forEach((l,c)=>{const u=c===t;l.setAttribute("aria-checked",String(u)),l.setAttribute("data-state",u?"active":"inactive"),l.classList.toggle("rf-juxtapose__toggle-btn--active",u)})}const a=l=>{const c=l.target.closest(".rf-juxtapose__toggle-btn");if(!c)return;const u=i.indexOf(c);u>=0&&(t=u,o())};return r.addEventListener("click",a),o(),()=>{r.removeEventListener("click",a),r.remove();for(const l of e)l.hidden=!1,l.removeAttribute("data-state")}}function CY(n){const e=xh(n);if(e.length<2)return()=>{};const t=n.querySelector('[data-name="panels"]');if(!t)return()=>{};const r=parseInt(n.style.getPropertyValue("--jx-duration")||"1000",10);t.style.position="relative",e[0].style.position="relative",e[0].style.zIndex="1",e[1].style.position="absolute",e[1].style.inset="0",e[1].style.zIndex="2",e[1].style.opacity="0",e[1].style.transition=`opacity ${r}ms ease`;for(const l of e)for(const c of l.querySelectorAll('iframe[loading="lazy"]'))c.loading="eager";let i=!1;const s=()=>{i||(e[1].style.opacity="1")},o=()=>{i||(e[1].style.opacity="0")},a=()=>{i=!i,e[1].style.opacity=i?"1":"0"};return t.addEventListener("mouseenter",s),t.addEventListener("mouseleave",o),t.addEventListener("click",a),t.setAttribute("aria-live","polite"),()=>{t.removeEventListener("mouseenter",s),t.removeEventListener("mouseleave",o),t.removeEventListener("click",a),t.removeAttribute("aria-live"),t.style.position="";for(const l of e)l.style.position="",l.style.inset="",l.style.zIndex="",l.style.opacity="",l.style.transition=""}}function TY(n){const e=xh(n);if(e.length<2)return()=>{};const r=(n.getAttribute("data-orientation")||"vertical")==="horizontal",i=n.querySelector('[data-name="panels"]');if(!i)return()=>{};const s=parseFloat(n.style.getPropertyValue("--jx-position"))||50,o=parseInt(n.style.getPropertyValue("--jx-duration")||"1000",10);i.style.position="relative",i.style.overflow="hidden",e[0].style.position="absolute",e[0].style.inset="0",e[0].style.zIndex="2",e[0].style.willChange="clip-path",e[1].style.position="relative",e[1].style.zIndex="1";for(const d of e)for(const h of d.querySelectorAll('iframe[loading="lazy"]'))h.loading="eager";function a(d){n.style.setProperty("--jx-position",String(d)),r?e[0].style.clipPath=`inset(0 0 ${100-d}% 0)`:e[0].style.clipPath=`inset(0 ${100-d}% 0 0)`}a(0);let l=null,c=!1;function u(){if(c)return;c=!0;const d=performance.now(),h=0;function m(p){const v=p-d,O=Math.min(v/o,1),b=1-Math.pow(1-O,3);a(h+(s-h)*b),O<1&&(l=requestAnimationFrame(m))}l=requestAnimationFrame(m)}const f=new IntersectionObserver(d=>{for(const h of d)h.isIntersecting&&u()},{threshold:.3});return f.observe(n),()=>{f.disconnect(),l!==null&&cancelAnimationFrame(l),i.style.position="",i.style.overflow="";for(const d of e)d.style.position="",d.style.inset="",d.style.zIndex="",d.style.clipPath="",d.style.willChange=""}}function PY(n){if(n.getAttribute("data-collapsible")!=="true")return()=>{};const e=Array.from(n.querySelectorAll('[data-rune="nav-group"]'));if(e.length===0)return()=>{};const t=[];for(const r of e){const i=r.querySelector('[data-field="title"], h1, h2, h3, h4, h5, h6');if(!i)continue;const s=r.querySelector(':scope > [data-name="panel"], :scope > ul, :scope > ol');if(!s)continue;const o=i.id||oo("rf-nav-trigger"),a=s.id||oo("rf-nav-panel");i.id=o,s.id=a,(r.getAttribute("data-collapsed")??"true")!=="false"&&r.setAttribute("data-collapsed","true"),i.setAttribute("role","button"),i.setAttribute("tabindex","0"),i.setAttribute("aria-controls",a),i.setAttribute("aria-expanded",r.getAttribute("data-collapsed")==="false"?"true":"false"),s.setAttribute("aria-labelledby",o);const c=()=>{const d=r.getAttribute("data-collapsed")==="false",h=s.getBoundingClientRect().height,m=d?0:s.scrollHeight;s.style.height=h+"px",s.offsetHeight,r.setAttribute("data-collapsed",d?"true":"false"),i.setAttribute("aria-expanded",d?"false":"true"),s.style.height=m+"px";const p=()=>{s.style.height="",s.removeEventListener("transitionend",v),clearTimeout(O)},v=b=>{b.target!==s||b.propertyName!=="height"||p()};s.addEventListener("transitionend",v);const O=setTimeout(p,260)},u=d=>{d.preventDefault(),c()},f=d=>{(d.key==="Enter"||d.key===" ")&&(d.preventDefault(),c())};i.addEventListener("click",u),i.addEventListener("keydown",f),t.push(()=>{i.removeEventListener("click",u),i.removeEventListener("keydown",f)})}return()=>t.forEach(r=>r())}function EY(n){if(n.getAttribute("data-layout")!=="menubar")return()=>{};const e=[],t=Array.from(n.querySelectorAll('[data-rune="nav-group"]')),r=new Map,i=new Map;for(const f of t){const d=f.querySelector('[data-field="title"], h1, h2, h3, h4, h5, h6'),h=f.querySelector(":scope > ul, :scope > ol");if(!d||!h)continue;const m=d.id||oo("rf-nav-trigger"),p=h.id||oo("rf-nav-panel");d.id=m,h.id=p,d.setAttribute("role","button"),d.setAttribute("tabindex","0"),d.setAttribute("aria-haspopup","true"),d.setAttribute("aria-expanded","false"),d.setAttribute("aria-controls",p),h.setAttribute("role","menu"),h.setAttribute("aria-labelledby",m),f.setAttribute("data-open","false"),r.set(f,d),i.set(f,h)}const s=f=>{for(const[d,h]of r)d!==f&&(d.setAttribute("data-open","false"),h.setAttribute("aria-expanded","false"))},o=f=>{const d=r.get(f);d&&(s(f),f.setAttribute("data-open","true"),d.setAttribute("aria-expanded","true"))},a=f=>{f.getAttribute("data-open")==="true"?s():o(f)};for(const[f,d]of r){const h=i.get(f),m=O=>{O.preventDefault(),a(f)},p=O=>{switch(O.key){case"Enter":case" ":O.preventDefault(),a(f);break;case"ArrowDown":{O.preventDefault(),o(f),h.querySelector("a, button, [tabindex]")?.focus();break}case"ArrowRight":case"ArrowLeft":{O.preventDefault();const b=Array.from(r.keys()),w=b.indexOf(f);if(w===-1)break;const S=O.key==="ArrowRight"?b[(w+1)%b.length]:b[(w-1+b.length)%b.length];r.get(S)?.focus(),f.getAttribute("data-open")==="true"&&o(S);break}case"Escape":s(),d.focus();break}};d.addEventListener("click",m),d.addEventListener("keydown",p),e.push(()=>{d.removeEventListener("click",m),d.removeEventListener("keydown",p)});const v=O=>{const b=Array.from(h.querySelectorAll("a, button")),w=document.activeElement,S=w?b.indexOf(w):-1;switch(O.key){case"ArrowDown":O.preventDefault(),b[Math.min(S+1,b.length-1)]?.focus();break;case"ArrowUp":O.preventDefault(),S<=0?d.focus():b[S-1]?.focus();break;case"Escape":O.preventDefault(),s(),d.focus();break}};h.addEventListener("keydown",v),e.push(()=>h.removeEventListener("keydown",v))}const l=f=>{n.contains(f.target)||s()},c=f=>{const d=f.relatedTarget;(!d||!n.contains(d))&&s()};document.addEventListener("click",l),n.addEventListener("focusout",c),e.push(()=>document.removeEventListener("click",l)),e.push(()=>n.removeEventListener("focusout",c));const u=n.querySelector(':scope > [data-name="trigger"]');if(u){const f=d=>{d.preventDefault();const h=n.getAttribute("data-open")==="true";n.setAttribute("data-open",h?"false":"true"),u.setAttribute("aria-expanded",h?"false":"true")};u.addEventListener("click",f),e.push(()=>u.removeEventListener("click",f))}return()=>e.forEach(f=>f())}const bb=typeof HTMLElement<"u"?HTMLElement:class{};function EP(n,e){const t=n.querySelector(`[data-content="${e}"]`);return t?t instanceof HTMLTemplateElement?t.content.textContent||t.textContent||"":t.textContent||"":""}function $Y(){const n=document.documentElement.dataset.theme;return n==="dark"?!0:n==="light"?!1:matchMedia("(prefers-color-scheme: dark)").matches}function QY(n){const e=s=>Math.round(Math.max(0,Math.min(255,s))).toString(16).padStart(2,"0"),t=(s,o,a,l)=>{let c="#"+e(s)+e(o)+e(a);return l!==void 0&&l<1&&(c+=e(l*255)),c},r=n.match(/rgba?\(([^)]+)\)/i);if(r){const[s,o,a,l]=r[1].split(/[\s,/]+/).filter(Boolean).map(parseFloat);return[s,o,a].some(Number.isNaN)?null:t(s,o,a,l)}const i=n.match(/color\(srgb\s+([^)]+)\)/i);if(i){const[s,o,a,l]=i[1].split(/[\s/]+/).filter(Boolean).map(parseFloat);return[s,o,a].some(Number.isNaN)?null:t(s*255,o*255,a*255,l)}return null}class LY extends bb{themeObserver;mediaQuery;mediaListener;source="";container=null;language="mermaid";connectedCallback(){requestAnimationFrame(()=>this.tryRender())}disconnectedCallback(){this.themeObserver?.disconnect(),this.mediaQuery&&this.mediaListener&&this.mediaQuery.removeEventListener("change",this.mediaListener)}tryRender(e=0){if(this.language=this.dataset.language||"mermaid",this.source=EP(this,"source"),this.container=this.querySelector(".rf-diagram__container"),!!this.container){if(!this.source){e<3&&requestAnimationFrame(()=>this.tryRender(e+1));return}this.language==="mermaid"?(this.renderMermaid(),this.watchThemeChanges()):this.language==="ascii"&&(this.container.textContent=this.source,this.container.style.fontFamily="var(--rf-font-mono)",this.container.style.whiteSpace="pre")}}watchThemeChanges(){this.themeObserver?.disconnect(),this.themeObserver=new MutationObserver(()=>this.renderMermaid()),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-color-scheme"],subtree:!0}),this.mediaQuery||(this.mediaQuery=matchMedia("(prefers-color-scheme: dark)"),this.mediaListener=()=>{document.documentElement.dataset.theme||this.renderMermaid()},this.mediaQuery.addEventListener("change",this.mediaListener))}async renderMermaid(){if(!(!this.container||!this.source))try{const t=(await import("https://cdn.jsdelivr.net/npm/mermaid@11/dist/mermaid.esm.min.mjs")).default,r=getComputedStyle(this.container),i=$Y(),s=document.createElement("span");s.style.cssText="position:absolute;width:0;height:0;visibility:hidden",this.container.appendChild(s);const o=(c,u)=>(s.style.color="",s.style.color=`var(${c}, ${u})`,QY(getComputedStyle(s).color)??u);t.initialize({startOnLoad:!1,theme:i?"dark":"base",themeVariables:{darkMode:i,primaryColor:o("--rf-color-surface","#fbfaf7"),primaryTextColor:o("--rf-color-text","#1c1a17"),primaryBorderColor:o("--rf-color-border","#e2e0dd"),secondaryColor:o("--rf-color-surface-hover","#ecebe8"),secondaryTextColor:o("--rf-color-text","#1c1a17"),secondaryBorderColor:o("--rf-color-border","#e2e0dd"),tertiaryColor:o("--rf-color-info-bg","#e8edf4"),tertiaryTextColor:o("--rf-color-text","#1c1a17"),tertiaryBorderColor:o("--rf-color-info-border","#c5d2e0"),lineColor:o("--rf-color-muted","#6b6661"),textColor:o("--rf-color-text","#1c1a17"),mainBkg:o("--rf-color-surface","#fbfaf7"),nodeBorder:o("--rf-color-border","#e2e0dd"),clusterBkg:o("--rf-color-surface","#fbfaf7"),clusterBorder:o("--rf-color-border","#e2e0dd"),edgeLabelBackground:o("--rf-color-surface","#fbfaf7"),fontSize:"14px",fontFamily:r.getPropertyValue("--rf-font-sans").trim()||"system-ui, sans-serif"}}),s.remove();const a="mermaid-"+Math.random().toString(36).slice(2),{svg:l}=await t.render(a,this.source);this.container.innerHTML=l,this.dataset.rendered=""}catch{}}}const af={openstreetmap:{street:"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png",terrain:"https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png",dark:"https://{s}.basemaps.cartocdn.com/dark_all/{z}/{x}/{y}{r}.png",minimal:"https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}{r}.png"},mapbox:{street:"streets-v12",satellite:"satellite-streets-v12",terrain:"outdoors-v12",dark:"dark-v11",minimal:"light-v11"}},Gw={openstreetmap:'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',mapbox:'© <a href="https://www.mapbox.com/">Mapbox</a>'},Hp=new Map;async function Kp(n){if(Hp.has(n))return Hp.get(n);try{const e=`https://nominatim.openstreetmap.org/search?q=${encodeURIComponent(n)}&format=json&limit=1`,r=await(await fetch(e,{headers:{"User-Agent":"refrakt-md-map-rune/1.0"}})).json();if(r.length>0){const i=[parseFloat(r[0].lat),parseFloat(r[0].lon)];return Hp.set(n,i),i}}catch{}return null}class MY extends bb{mapInstance=null;initializing=!1;connectedCallback(){const e=this.extractPins();e.length>0&&this.initLeaflet(e)}disconnectedCallback(){this.mapInstance&&(this.mapInstance.remove(),this.mapInstance=null)}extractPins(){const e=[],t=this.querySelector("ol");if(!t)return e;for(const r of t.querySelectorAll('li[data-rune="map-pin"]')){const i=s=>r.querySelector(`[data-name="${s}"]`)?.textContent||"";e.push({name:i("name"),description:i("description"),lat:parseFloat(r.dataset.lat||"")||0,lng:parseFloat(r.dataset.lng||"")||0,address:r.dataset.address||"",url:r.dataset.url||"",group:r.dataset.group||""})}return e}async initLeaflet(e){if(!(this.initializing||this.mapInstance)){this.initializing=!0;try{const t=this.getRootNode(),r=t instanceof ShadowRoot?t:document.head;if(!t.querySelector('link[href*="leaflet@1.9.4"]')){const C=document.createElement("link");C.rel="stylesheet",C.href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css",r.appendChild(C)}const s=await import("https://unpkg.com/leaflet@1.9.4/dist/leaflet-src.esm.js"),o=this.dataset.center||"",a=this.dataset.zoom||"",l=this.dataset.style||"street",c=this.dataset.provider||"openstreetmap",u=this.dataset.interactive!=="false",f=this.dataset.route==="true",d=this.dataset.cluster==="true",h=this.dataset.apiKey||"",p=(await Promise.all(e.map(async C=>{if(C.lat&&C.lng)return{...C};if(C.address){const y=await Kp(C.address);if(y)return{...C,lat:y[0],lng:y[1]}}if(C.name){const y=await Kp(C.name);if(y)return{...C,lat:y[0],lng:y[1]}}return null}))).filter(C=>C!==null&&C.lat!==0&&C.lng!==0);if(p.length===0)return;let v=this.querySelector(".rf-map__container");v||(v=document.createElement("div"),v.className="rf-map__container",this.prepend(v));const O=v.querySelector(".rf-map__fallback");O&&O.remove();let b;if(o){const C=o.match(/(-?\d+\.?\d*)\s*,\s*(-?\d+\.?\d*)/);C?b=[parseFloat(C[1]),parseFloat(C[2])]:b=await Kp(o)||[p[0].lat,p[0].lng]}else{const C=p.map(k=>k.lat),y=p.map(k=>k.lng);b=[(Math.min(...C)+Math.max(...C))/2,(Math.min(...y)+Math.max(...y))/2]}const w=a?parseInt(a):13,S=s.map(v,{zoomControl:u,dragging:u,scrollWheelZoom:u,doubleClickZoom:u,touchZoom:u}).setView(b,w);if(c==="mapbox"){const C=af.mapbox[l]||af.mapbox.street;s.tileLayer(`https://api.mapbox.com/styles/v1/mapbox/${C}/tiles/256/{z}/{x}/{y}@2x?access_token=${h}`,{attribution:Gw.mapbox,tileSize:512,zoomOffset:-1}).addTo(S)}else{const C=af.openstreetmap[l]||af.openstreetmap.street;s.tileLayer(C,{attribution:Gw.openstreetmap}).addTo(S)}const _=new Map;for(const C of p){const y=C.group||"";_.has(y)||_.set(y,[]),_.get(y).push(C)}const x=[],A={};for(const[C,y]of _){const k=y.map(P=>{const T=s.marker([P.lat,P.lng]);let E="";return P.name&&(E+=`<strong>${P.name}</strong>`),P.description&&(E+=`<br><em>${P.description}</em>`),P.address&&(E+=`<br><small>${P.address}</small>`),P.url&&(E+=`<br><a href="${P.url}" target="_blank" rel="noopener">${zt("behavior.map.moreInfo")}</a>`),E&&T.bindPopup(E),T});if(C){const P=s.layerGroup(k).addTo(S);A[C]=P}else k.forEach(P=>P.addTo(S));x.push(...k)}if(Object.keys(A).length>0&&s.control.layers(null,A).addTo(S),f&&p.length>1){const C=p.map(y=>[y.lat,y.lng]);s.polyline(C,{color:"var(--rf-color-primary, #3b82f6)",weight:3,opacity:.7,dashArray:"8, 8"}).addTo(S)}if(d&&x.length>0)try{const C="https://unpkg.com/leaflet.markercluster@1.5.3/dist/leaflet.markercluster-src.js",y="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.css",k="https://unpkg.com/leaflet.markercluster@1.5.3/dist/MarkerCluster.Default.css";for(const T of[y,k])if(!t.querySelector(`link[href="${T}"]`)){const E=document.createElement("link");E.rel="stylesheet",E.href=T,r.appendChild(E)}await new Promise((T,E)=>{const Q=document.createElement("script");Q.src=C,Q.onload=()=>T(),Q.onerror=E,document.head.appendChild(Q)});const P=s.markerClusterGroup();x.forEach(T=>{T.remove(),P.addLayer(T)}),S.addLayer(P)}catch{}if(!o&&!a&&p.length>1){const C=s.latLngBounds(p.map(y=>[y.lat,y.lng]));S.fitBounds(C,{padding:[30,30]})}this.mapInstance=S}catch(t){console.warn("Map rune: Leaflet failed to load",t)}finally{this.initializing=!1}}}}class wi{static pages=[];static currentUrl="";static designTokens=null;static theme="auto";static themeListeners=[];static onThemeChange(e){return wi.themeListeners.push(e),()=>{wi.themeListeners=wi.themeListeners.filter(t=>t!==e)}}static setTheme(e){wi.theme=e;for(const t of wi.themeListeners)t(e)}}const lf={tailwind:['<script src="https://cdn.tailwindcss.com"><\/script>','<script>tailwind.config = { darkMode: "class" }<\/script>'],bootstrap:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5/dist/css/bootstrap.min.css">'],bulma:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@1/css/bulma.min.css">'],pico:['<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css">']},Hw={heading:"sans-serif",body:"sans-serif",mono:"monospace",display:"sans-serif",caption:"sans-serif"};function qY(n,e){return e?n>0:n>24}class RY extends bb{iframe=null;messageHandler=null;_overflowing=!1;themeCleanup=null;ancestorObserver=null;_activation="eager";_poster="";_activated=!1;_io=null;_backdrop=!1;_onScreen=!1;_visHandler=null;_content="";_framework="";_dependencies="";_label="Sandbox";_heightAttr="auto";_tokens=null;_localScheme=null;_rfData="";_untrusted=!1;_allowJs=!0;_sandboxOrigin="";connectedCallback(){this._content=this.dataset.sourceContent||EP(this,"source"),this._rfData=this.dataset.rfRecords||"",this._framework=this.dataset.framework||"",this._dependencies=this.dataset.dependencies||"",this._label=this.dataset.label||"Sandbox",this._heightAttr=this.dataset.height||"auto",this._untrusted=this.dataset.securityMode==="untrusted",this._allowJs=this.dataset.allowJs!=="false",this._sandboxOrigin=this.dataset.sandboxOrigin||"";const e=this.dataset.activation;this._activation=e==="visible"||e==="click"?e:"eager",this._poster=this.dataset.poster||"",this._localScheme=this.getAttribute("data-color-scheme");const t=this.dataset.designTokens;if(this._tokens=t?JSON.parse(t):wi.designTokens,this._backdrop=this.dataset.guestPosture==="backdrop",this._backdrop){this.initBackdrop();return}if(this._activation!=="eager"){this.renderPoster();return}this.activate()}effectiveTheme(){const e=this._localScheme?null:this.closest("[data-color-scheme]")?.getAttribute("data-color-scheme");return this._localScheme||e||wi.theme}activate(){if(!this._activated&&(this._activated=!0,this._io&&!this._backdrop&&(this._io.disconnect(),this._io=null),this.buildIframe(this.effectiveTheme()),!this._localScheme)){this.themeCleanup=wi.onThemeChange(t=>{this.closest("[data-color-scheme]")||this.setTheme(t)}),this.ancestorObserver=new MutationObserver(()=>{const r=this.closest("[data-color-scheme]")?.getAttribute("data-color-scheme");this.setTheme(r||wi.theme)});let e=this.parentElement;for(;e;)this.ancestorObserver.observe(e,{attributes:!0,attributeFilter:["data-color-scheme"]}),e=e.parentElement}}renderPoster(){const e=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches,t=document.createElement("div");if(t.className="rf-sandbox__poster",this._heightAttr==="fill"?t.style.height="100%":this._heightAttr!=="auto"&&(t.style.height=`${parseInt(this._heightAttr,10)}px`),this._poster){const i=document.createElement("img");i.className="rf-sandbox__poster-image",i.src=this._poster,i.alt="",i.loading="lazy",t.appendChild(i)}const r=document.createElement("button");r.type="button",r.className="rf-sandbox__activate",r.textContent=`Run ${this._label}`,r.setAttribute("aria-label",`Run ${this._label} sandbox`),r.addEventListener("click",()=>this.activate(),{once:!0}),t.appendChild(r),this.replaceChildren(t),this._activation==="visible"&&!e&&typeof IntersectionObserver<"u"&&(this._io=new IntersectionObserver(i=>{i.some(s=>s.isIntersecting)&&this.activate()},{rootMargin:"200px"}),this._io.observe(this))}initBackdrop(){if(!(typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion: reduce)").matches)){if(this._visHandler=()=>{document.hidden?this.suspend():this._onScreen&&this.activate()},document.addEventListener("visibilitychange",this._visHandler),typeof IntersectionObserver>"u"){this._onScreen=!0,this.activate();return}this._io=new IntersectionObserver(t=>{this._onScreen=t.some(r=>r.isIntersecting),this._onScreen&&!document.hidden?this.activate():this.suspend()},{rootMargin:"200px"}),this._io.observe(this)}}suspend(){this._activated&&(this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.themeCleanup&&(this.themeCleanup(),this.themeCleanup=null),this.ancestorObserver&&(this.ancestorObserver.disconnect(),this.ancestorObserver=null),this.iframe?.remove(),this.iframe=null,this._activated=!1)}disconnectedCallback(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.themeCleanup&&(this.themeCleanup(),this.themeCleanup=null),this.ancestorObserver&&(this.ancestorObserver.disconnect(),this.ancestorObserver=null),this._io&&(this._io.disconnect(),this._io=null),this._visHandler&&(document.removeEventListener("visibilitychange",this._visHandler),this._visHandler=null),this.iframe=null}buildIframe(e){const t=this.iframe?.style.height;this.iframe=document.createElement("iframe");const r=this._untrusted?"allow-scripts":"allow-scripts allow-same-origin";if(this.iframe.setAttribute("sandbox",r),this._untrusted&&this._sandboxOrigin){const a=new URLSearchParams({framework:this._framework,dependencies:this._dependencies,theme:e||"auto",height:this._heightAttr});this.iframe.src=`${this._sandboxOrigin.replace(/\/$/,"")}/render?${a.toString()}`;const l=c=>{c.data?.type==="rf-sandbox-ready"&&c.source===this.iframe?.contentWindow&&(this.iframe.contentWindow.postMessage({type:"rf-sandbox-content",content:this._content,tokens:this._tokens},this._sandboxOrigin),window.removeEventListener("message",l))};window.addEventListener("message",l)}else this.iframe.srcdoc=this.buildSrcdoc(this._content,this._framework,this._dependencies,this._tokens,e,this._rfData);this.iframe.title=this._label,this.iframe.setAttribute("frameborder","0"),this.iframe.loading="lazy";const i=this._heightAttr==="fill"?"100%":t||(this._heightAttr!=="auto"?parseInt(this._heightAttr)+"px":"150px");this.iframe.style.cssText=`width: 100%; border: none; height: ${i};`;const s=this._untrusted?this.buildUntrustedBanner():null;this.messageHandler&&window.removeEventListener("message",this.messageHandler);const o=this._heightAttr==="auto";this.messageHandler=a=>{a.data?.type!=="rf-sandbox-resize"||a.source!==this.iframe?.contentWindow||(o&&(this.iframe.style.height=a.data.height+"px"),this.updateOverflow(a.data.scrollWidth))},window.addEventListener("message",this.messageHandler),s?this.replaceChildren(s,this.iframe):this.replaceChildren(this.iframe)}updateOverflow(e){if(!this.iframe||typeof e!="number")return;const t=e-this.iframe.clientWidth;this._overflowing=qY(t,this._overflowing),this.toggleAttribute("data-overflowing",this._overflowing)}buildUntrustedBanner(){const e=document.createElement("div");return e.className="rf-sandbox__untrusted-banner",e.setAttribute("role","note"),e.setAttribute("aria-label",zt("behavior.sandbox.content")),e.textContent="Sandboxed user content — do not enter sensitive information.",e}setTheme(e){this._localScheme||this._activated&&this.buildIframe(e)}buildSrcdoc(e,t,r,i,s,o){const a=this.buildDependencyTags(t,r,i),l=o?`<script type="application/json" id="rf-data">${o.replace(/<\//g,"<\\/")}<\/script>
|
|
338
|
-
<script>window.RF_DATA = Object.freeze(JSON.parse(document.getElementById('rf-data').textContent));<\/script>`:"";s=s||wi.theme;const c=s==="dark"?' class="dark" data-theme="dark" style="color-scheme:dark"':s==="light"?' data-theme="light" style="color-scheme:light"':"",u=s==="dark"?' class="dark"':"",f=s==="dark"||s==="light"?` data-theme="${s}"`:"",d=e.replace(/\s*data-source(?:="[^"]*")?/g,""),h=this.buildCspMetaTag();return`<!DOCTYPE html>
|
|
339
|
-
<html${c}>
|
|
340
|
-
<head>${h?`
|
|
341
|
-
${h}`:""}
|
|
342
|
-
<meta charset="utf-8">
|
|
343
|
-
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
344
|
-
${a}
|
|
345
|
-
<style>
|
|
346
|
-
body { margin: 0; font-family: system-ui, -apple-system, sans-serif; color-scheme: light dark; overflow: hidden; }
|
|
347
|
-
body.dark, body[data-theme="dark"] { color-scheme: dark; }
|
|
348
|
-
</style>
|
|
349
|
-
${l?l+`
|
|
350
|
-
`:""}</head>
|
|
351
|
-
<body${u}${f}>
|
|
352
|
-
${d}
|
|
353
|
-
<script>
|
|
354
|
-
var ro = new ResizeObserver(function() {
|
|
355
|
-
parent.postMessage({ type: 'rf-sandbox-resize', height: document.body.scrollHeight, scrollWidth: document.body.scrollWidth }, '*');
|
|
356
|
-
});
|
|
357
|
-
ro.observe(document.body);
|
|
358
|
-
<\/script>
|
|
359
|
-
<script>
|
|
360
|
-
// The Tailwind CDN may ignore darkMode:"class" config and generate
|
|
361
|
-
// @media (prefers-color-scheme: dark) rules instead. On desktop this
|
|
362
|
-
// works via parent color-scheme propagation; on mobile it doesn't.
|
|
363
|
-
// Fix: when theme is forced (not auto), rewrite the media-query rules:
|
|
364
|
-
// - dark: duplicate as .dark ancestor selectors, remove originals
|
|
365
|
-
// - light: just remove originals (prevents OS dark from leaking in)
|
|
366
|
-
// - auto: leave untouched (media query follows OS preference)
|
|
367
|
-
var forcedTheme = document.body.getAttribute('data-theme');
|
|
368
|
-
function patchDarkCSS() {
|
|
369
|
-
if (!forcedTheme) return; // auto — leave media queries intact
|
|
370
|
-
try {
|
|
371
|
-
for (var i = 0; i < document.styleSheets.length; i++) {
|
|
372
|
-
var sheet = document.styleSheets[i], rules;
|
|
373
|
-
try { rules = sheet.cssRules; } catch(e) { continue; }
|
|
374
|
-
for (var j = rules.length - 1; j >= 0; j--) {
|
|
375
|
-
var r = rules[j];
|
|
376
|
-
if (r instanceof CSSMediaRule && r.conditionText === '(prefers-color-scheme: dark)') {
|
|
377
|
-
if (forcedTheme === 'dark') {
|
|
378
|
-
for (var k = 0; k < r.cssRules.length; k++) {
|
|
379
|
-
var inner = r.cssRules[k];
|
|
380
|
-
if (inner.cssText) {
|
|
381
|
-
sheet.insertRule('.dark ' + inner.cssText, rules.length);
|
|
382
|
-
}
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
// Remove original media query rule — for dark, the .dark
|
|
386
|
-
// ancestor selectors replace it; for light, removing it
|
|
387
|
-
// prevents OS dark preference from leaking in.
|
|
388
|
-
sheet.deleteRule(j);
|
|
389
|
-
}
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
} catch(e) {}
|
|
393
|
-
}
|
|
394
|
-
// Run after Tailwind CDN generates CSS (deferred to after current task)
|
|
395
|
-
if (document.readyState === 'loading') {
|
|
396
|
-
document.addEventListener('DOMContentLoaded', function() { setTimeout(patchDarkCSS, 0); });
|
|
397
|
-
} else {
|
|
398
|
-
setTimeout(patchDarkCSS, 0);
|
|
399
|
-
}
|
|
400
|
-
// Also re-patch when Tailwind re-generates (MutationObserver on style tags)
|
|
401
|
-
new MutationObserver(function(mutations) {
|
|
402
|
-
for (var m = 0; m < mutations.length; m++) {
|
|
403
|
-
for (var n = 0; n < mutations[m].addedNodes.length; n++) {
|
|
404
|
-
if (mutations[m].addedNodes[n].nodeName === 'STYLE') { setTimeout(patchDarkCSS, 0); return; }
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
}).observe(document.head, { childList: true });
|
|
408
|
-
<\/script>${!s||s==="auto"?`
|
|
409
|
-
<script>if(window.matchMedia('(prefers-color-scheme:dark)').matches){document.body.classList.add('dark');document.body.setAttribute('data-theme','dark')}<\/script>`:""}
|
|
410
|
-
</body>
|
|
411
|
-
</html>`}buildCspMetaTag(){if(!this._untrusted)return"";const e=new Set,t=l=>{try{const c=new URL(l);e.add(`${c.protocol}//${c.host}`)}catch{}};if(this._framework&&lf[this._framework])for(const l of lf[this._framework]){const c=l.match(/(?:src|href)="([^"]+)"/);c&&t(c[1])}if(this._dependencies)for(const l of this._dependencies.split(",").map(c=>c.trim()).filter(Boolean))t(l);const r=["'unsafe-inline'",...e].join(" "),i=["data:","https://fonts.gstatic.com",...e].join(" "),s=["data:",...e].join(" ");return`<meta http-equiv="Content-Security-Policy" content="${["default-src 'none'",`script-src ${this._allowJs?["'unsafe-inline'",...e].join(" "):"'none'"}`,`style-src ${r}`,`font-src ${i}`,`img-src ${s}`,"connect-src 'none'","form-action 'none'","base-uri 'none'","frame-src 'none'","object-src 'none'"].join("; ")}">`}buildDependencyTags(e,t,r){const i=[];if(r&&i.push(this.buildDesignTokenTags(r)),e&&lf[e])if(e==="tailwind"&&r){i.push('<script src="https://cdn.tailwindcss.com"><\\/script>');const s=this.buildTailwindTokenConfig(r);s?i.push(s):i.push('<script>tailwind.config = { darkMode: "class" }<\\/script>')}else i.push(...lf[e]);if(t)for(const s of t.split(",").map(o=>o.trim()).filter(Boolean))s.endsWith(".css")?i.push(`<link rel="stylesheet" href="${s}">`):i.push(`<script src="${s}"><\\/script>`);return i.join(`
|
|
412
|
-
`)}buildDesignTokenTags(e){const t=[];if(e.fonts&&e.fonts.length>0){const s=`https://fonts.googleapis.com/css2?${e.fonts.map(o=>{const a=o.family.replace(/ /g,"+"),l=o.weights.sort((c,u)=>c-u).join(";");return`family=${a}:wght@${l}`}).join("&")}&display=swap`;t.push('<link rel="preconnect" href="https://fonts.googleapis.com">'),t.push('<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>'),t.push(`<link href="${s}" rel="stylesheet">`)}const r=[];if(e.fonts)for(const i of e.fonts){const s=Hw[i.role]||"sans-serif";r.push(` --font-${i.role}: '${i.family}', ${s};`)}if(e.colors)for(const i of e.colors){const s=i.name.toLowerCase().replace(/\s+/g,"-");r.push(` --color-${s}: ${i.value};`)}if(e.spacing?.unit&&r.push(` --spacing-unit: ${e.spacing.unit};`),e.radii)for(const i of e.radii){const s=i.name.toLowerCase().replace(/\s+/g,"-");r.push(` --radius-${s}: ${i.value};`)}if(e.shadows)for(const i of e.shadows){const s=i.name.toLowerCase().replace(/\s+/g,"-");r.push(` --shadow-${s}: ${i.value};`)}if(r.length>0){const i=[`:root {
|
|
413
|
-
${r.join(`
|
|
414
|
-
`)}
|
|
415
|
-
}`];if(e.fonts){const s=e.fonts.find(l=>l.role==="body"),o=e.fonts.find(l=>l.role==="heading"),a=e.fonts.find(l=>l.role==="mono");s&&i.push("body { font-family: var(--font-body); }"),o&&i.push("h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); }"),a&&i.push("code, pre, kbd { font-family: var(--font-mono); }")}t.push(`<style>
|
|
416
|
-
${i.join(`
|
|
417
|
-
`)}
|
|
418
|
-
</style>`)}return t.join(`
|
|
419
|
-
`)}buildTailwindTokenConfig(e){const t={};if(e.fonts){t.fontFamily={};for(const r of e.fonts){const i=Hw[r.role]||"sans-serif";t.fontFamily[r.role]=[`'${r.family}'`,i]}}if(e.colors){t.colors={};for(const r of e.colors){const i=r.name.toLowerCase().replace(/\s+/g,"-");t.colors[i]=r.value}}if(e.radii){t.borderRadius={};for(const r of e.radii){const i=r.name.toLowerCase().replace(/\s+/g,"-");t.borderRadius[i]=r.value}}return Object.keys(t).length===0?"":`<script>tailwind.config = { darkMode: "class", theme: { extend: ${JSON.stringify(t)} } }<\/script>`}}function DY(n){const e=[],t=PY(n);t&&e.push(t);const r=EY(n);return r&&e.push(r),()=>e.forEach(i=>i?.())}const IY={accordion:Xw,"accordion-item":Xw,"tab-group":Uw,"code-group":Uw,reveal:cY,"data-table":uY,form:fY,preview:pY,mockup:mY,gallery:yY,juxtapose:kY,nav:DY,drawer:iY},NY={carousel:_Y};function $P(n=document,e){const t=[];n.querySelectorAll("[data-rune]").forEach(a=>{const l=a.getAttribute("data-rune");if(Zw(a)||a.closest('[data-guest-posture="presentational"]'))return;const c=IY[l];if(c){const u=c(a);u&&t.push(u)}}),n.querySelectorAll("[data-layout]").forEach(a=>{if(Zw(a)||a.closest('[data-guest-posture="presentational"]'))return;const l=a.getAttribute("data-layout"),c=NY[l];if(c){const u=c(a);u&&t.push(u)}});const r=JW(n);t.push(r);const i=gY(n);t.push(i);const s=OY(n);t.push(s);const o=bY(n);return t.push(o),()=>t.forEach(a=>a())}var BY=W('<span class="block-card__drag svelte-15i1bgj" title="Drag to reorder"><svg width="8" height="14" viewBox="0 0 8 14" fill="currentColor"><circle cx="2" cy="2" r="1.2"></circle><circle cx="6" cy="2" r="1.2"></circle><circle cx="2" cy="7" r="1.2"></circle><circle cx="6" cy="7" r="1.2"></circle><circle cx="2" cy="12" r="1.2"></circle><circle cx="6" cy="12" r="1.2"></circle></svg></span>'),jY=W('<div class="block-card__inline-preview svelte-15i1bgj"></div>'),zY=W('<div class="block-card svelte-15i1bgj"><!> <!></div>');function ZY(n,e){dt(e,!0);let t=xt(e,"highlightCss",3,""),r=xt(e,"highlightTransform",3,null),i=xt(e,"communityTags",3,null),s=xt(e,"communityPostTransforms",3,null),o=xt(e,"communityStyles",3,null),a=xt(e,"aggregated",19,()=>({})),l=xt(e,"dragHandle",3,!0),c=xt(e,"readOnly",3,!1),u=J(void 0),f=null,d,h=null;function m(A){return A.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/([A-Z])([A-Z][a-z])/g,"$1-$2").toLowerCase()}function p(A){const C=new Map;for(const[y,k]of Object.entries(A.runes))C.set(m(y),k);return C}function v(A,C,y){let k=A,P=null,T=null;for(;k&&k!==C;)k.hasAttribute("data-name")&&!P&&(P=k),k.hasAttribute("data-rune")&&!T&&(T=k),k=k.parentElement;if(P){const E=P.getAttribute("data-name");let Q=P.parentElement,$;for(;Q&&Q!==C;){const I=Q.getAttribute("data-rune");if(I){$=y.get(I);break}Q=Q.parentElement}const L=$?.editHints?.[E];if(L&&L!=="none")return{type:"section",el:P,dataName:E,editType:L}}return T?{type:"rune",el:T}:null}function O(A,C){let y=null,k=null;const P=75,T=document.createElement("div");T.className="rf-edit-tooltip",A.appendChild(T);function E($,L){T.textContent=$,T.style.left=`${L.clientX+12}px`,T.style.top=`${L.clientY+12}px`,T.classList.add("rf-tooltip-visible")}function Q(){T.classList.remove("rf-tooltip-visible")}A.addEventListener("mouseover",$=>{const L=v($.target,A,C),I=L?.el??null;if(k!==null&&(clearTimeout(k),k=null),I!==y)if(I&&y&&y.contains(I))y.classList.remove("rf-editable-hover"),y=I,y.classList.add("rf-editable-hover");else if(y&&I&&I.contains(y)){const Z=y;k=setTimeout(()=>{y===Z&&(Z.classList.remove("rf-editable-hover"),y=I,y.classList.add("rf-editable-hover")),k=null},P);return}else y?.classList.remove("rf-editable-hover"),y=I,y?.classList.add("rf-editable-hover");if(L){const Z=L.type==="section"?L.dataName:L.el.getAttribute("data-rune")??"";E(Z,$)}else Q()}),A.addEventListener("mousemove",$=>{T.classList.contains("rf-tooltip-visible")&&(T.style.left=`${$.clientX+12}px`,T.style.top=`${$.clientY+12}px`)}),A.addEventListener("mouseout",$=>{const L=$.relatedTarget;if(y&&(!L||!y.contains(L))){k!==null&&clearTimeout(k);const I=y;k=setTimeout(()=>{I.classList.remove("rf-editable-hover"),y===I&&(y=null),k=null},P),Q()}}),A.addEventListener("click",$=>{Q();const L=v($.target,A,C);if(L)if($.preventDefault(),$.stopPropagation(),L.type==="section"){const{el:I,dataName:Z,editType:Y}=L,ne=I.getBoundingClientRect(),ae=Y==="link"?I.querySelector("a"):null,ie=Y==="image"?I.querySelector("img"):null,K=Y==="code"?I.querySelector("code"):null,he=Y==="icon"?I.hasAttribute("data-icon")?I:I.querySelector("[data-icon]"):null;e.onsectionclick?.({dataName:Z,text:(K??I).textContent?.trim()??"",rect:ne,editType:Y,href:ae?.getAttribute("href")??ie?.getAttribute("src")??void 0,iconName:he?.getAttribute("data-icon")??void 0})}else{const I=$,Z=Array.from(A.querySelectorAll("[data-rune]"));let Y;Z.length>1&&L.el!==Z[0]&&(Y=Z.indexOf(L.el)-1),e.onruneclick?.({x:I.clientX,y:I.clientY,nestedRuneIndex:Y})}})}hn(()=>{if(!g(u)||!e.themeConfig)return;f||(f=g(u).attachShadow({mode:"open"}));const A=e.block.source,C=e.themeConfig,y=e.themeCss,k=t()||"",P=r();return clearTimeout(d),d=setTimeout(()=>{if(f){h&&(h(),h=null);try{const{html:T,isComponent:E}=CP(A,C,P,i()??void 0,s()??void 0,a(),o()??void 0);if(E)f.innerHTML=`<style>
|
|
420
|
-
:host { display: block; padding: 0.75rem 1.5rem; }
|
|
421
|
-
.placeholder { display: flex; align-items: center; gap: 0.5rem; color: #888; font-family: system-ui, sans-serif; font-size: 13px; }
|
|
422
|
-
.placeholder svg { opacity: 0.5; }
|
|
423
|
-
</style>
|
|
424
|
-
<div class="placeholder">
|
|
425
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round">
|
|
426
|
-
<rect x="2" y="2" width="12" height="12" rx="2" />
|
|
427
|
-
<path d="M6 6l4 4M10 6l-4 4" />
|
|
428
|
-
</svg>
|
|
429
|
-
Interactive component — see full preview
|
|
430
|
-
</div>`;else{const Q=y.replace(/:root/g,":host").replace(/\bhtml\s*\{/g,":host {");f.innerHTML=`<style>${Q}
|
|
431
|
-
${k}
|
|
432
|
-
:host { display: block; }
|
|
433
|
-
.rf-preview-wrapper {
|
|
434
|
-
font-family: var(--rf-font-sans, system-ui, -apple-system, sans-serif);
|
|
435
|
-
color: var(--rf-color-text, #1a1a2e);
|
|
436
|
-
line-height: 1.6;
|
|
437
|
-
--rf-content-max: calc(100% - 6rem);
|
|
438
|
-
--rf-content-gutter: 1.5rem;
|
|
439
|
-
}
|
|
440
|
-
.rf-preview-wrapper > article {
|
|
441
|
-
display: grid;
|
|
442
|
-
grid-template-columns:
|
|
443
|
-
[full-start] 1fr
|
|
444
|
-
[wide-start] minmax(0, var(--rf-wide-inset, 8rem))
|
|
445
|
-
[content-start] min(var(--rf-content-max), 100% - var(--rf-content-gutter) * 2)
|
|
446
|
-
[content-end] minmax(0, var(--rf-wide-inset, 8rem))
|
|
447
|
-
[wide-end] 1fr
|
|
448
|
-
[full-end];
|
|
449
|
-
}
|
|
450
|
-
.rf-preview-wrapper > article > * { grid-column: content; }
|
|
451
|
-
.rf-preview-wrapper > article > [data-width="wide"] { grid-column: wide; }
|
|
452
|
-
.rf-preview-wrapper > article > [data-width="full"],
|
|
453
|
-
.rf-preview-wrapper > article > :is([data-tint], [data-color-scheme]):not([data-width]) {
|
|
454
|
-
grid-column: full;
|
|
455
|
-
padding-inline: max(var(--rf-content-gutter, 1.5rem), calc((100% - var(--rf-content-max)) / 2));
|
|
456
|
-
}
|
|
457
|
-
/* Base: invisible outline + transition (persists on remove for fade-out) */
|
|
458
|
-
[data-name] {
|
|
459
|
-
outline: 2px dashed transparent;
|
|
460
|
-
outline-offset: 4px;
|
|
461
|
-
border-radius: 4px;
|
|
462
|
-
transition: outline-color 150ms ease;
|
|
463
|
-
}
|
|
464
|
-
[data-rune] {
|
|
465
|
-
outline: 2px dashed transparent;
|
|
466
|
-
outline-offset: 4px;
|
|
467
|
-
border-radius: 4px;
|
|
468
|
-
transition: outline-color 150ms ease;
|
|
469
|
-
}
|
|
470
|
-
/* Editable section hover affordance */
|
|
471
|
-
[data-name].rf-editable-hover {
|
|
472
|
-
outline-color: rgba(59, 130, 246, 0.5);
|
|
473
|
-
}
|
|
474
|
-
[data-name].rf-editable-hover,
|
|
475
|
-
[data-name].rf-editable-hover * {
|
|
476
|
-
cursor: text !important;
|
|
477
|
-
}
|
|
478
|
-
/* Rune root hover affordance — opens block edit panel */
|
|
479
|
-
[data-rune].rf-editable-hover {
|
|
480
|
-
outline-color: rgba(59, 130, 246, 0.3);
|
|
481
|
-
}
|
|
482
|
-
[data-rune].rf-editable-hover,
|
|
483
|
-
[data-rune].rf-editable-hover * {
|
|
484
|
-
cursor: pointer !important;
|
|
485
|
-
}
|
|
486
|
-
/* Hover tooltip */
|
|
487
|
-
.rf-edit-tooltip {
|
|
488
|
-
position: fixed;
|
|
489
|
-
padding: 2px 8px;
|
|
490
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
491
|
-
font-size: 11px;
|
|
492
|
-
font-weight: 600;
|
|
493
|
-
line-height: 1.4;
|
|
494
|
-
color: #fff;
|
|
495
|
-
background: rgba(30, 41, 59, 0.9);
|
|
496
|
-
border-radius: 4px;
|
|
497
|
-
pointer-events: none;
|
|
498
|
-
z-index: 10000;
|
|
499
|
-
white-space: nowrap;
|
|
500
|
-
opacity: 0;
|
|
501
|
-
transition: opacity 120ms ease;
|
|
502
|
-
}
|
|
503
|
-
.rf-edit-tooltip.rf-tooltip-visible {
|
|
504
|
-
opacity: 1;
|
|
505
|
-
}
|
|
506
|
-
</style>
|
|
507
|
-
<div class="rf-preview-wrapper">${T}</div>`;const $=f.querySelector(".rf-preview-wrapper");$&&(h=$P($),$.addEventListener("click",L=>{L.target.closest("a")&&L.preventDefault()},!0),!c()&&(e.onsectionclick||e.onruneclick)&&e.block.type==="rune"&&O($,p(C)))}}catch{f&&(f.innerHTML="<style>:host { display: block; padding: 0.75rem 1.5rem; color: #999; font-family: system-ui; font-size: 12px; }</style><em>Preview unavailable</em>")}}},50),()=>{clearTimeout(d),h&&(h(),h=null)}});var b=zY(),w=R(b);{var S=A=>{var C=BY();z(A,C)};le(w,A=>{l()&&A(S)})}var _=D(w,2);{var x=A=>{var C=jY();ln(C,y=>q(u,y),()=>g(u)),z(A,C)};le(_,A=>{e.themeConfig&&A(x)})}ce(()=>St(b,"draggable",l()?"true":"false")),st("dragstart",b,function(...A){e.ondragstart?.apply(this,A)}),st("dragover",b,function(...A){e.ondragover?.apply(this,A)}),st("drop",b,function(...A){e.ondrop?.apply(this,A)}),z(n,b),ht()}var FY=W('<span class="prose-card__drag svelte-1oewfd6" title="Drag to reorder"><svg width="8" height="14" viewBox="0 0 8 14" fill="currentColor"><circle cx="2" cy="2" r="1.2"></circle><circle cx="6" cy="2" r="1.2"></circle><circle cx="2" cy="7" r="1.2"></circle><circle cx="6" cy="7" r="1.2"></circle><circle cx="2" cy="12" r="1.2"></circle><circle cx="6" cy="12" r="1.2"></circle></svg></span>'),XY=W('<div class="prose-card__preview svelte-1oewfd6"></div>'),VY=W('<div class="prose-card svelte-1oewfd6"><!> <!></div>');function WY(n,e){dt(e,!0);let t=xt(e,"highlightCss",3,""),r=xt(e,"highlightTransform",3,null),i=xt(e,"communityTags",3,null),s=xt(e,"communityPostTransforms",3,null),o=xt(e,"communityStyles",3,null),a=xt(e,"aggregated",19,()=>({})),l=xt(e,"dragHandle",3,!0),c=xt(e,"readOnly",3,!1),u=J(void 0),f=null,d,h=null;const m=new Set(["H1","H2","H3","H4","H5","H6","P","PRE","UL","OL","BLOCKQUOTE","HR","TABLE"]);function p(y){return y.startsWith("H")&&y.length===2?`h${y[1]}`:{P:"paragraph",PRE:"code",UL:"list",OL:"list",BLOCKQUOTE:"quote",HR:"divider",TABLE:"table"}[y]??y.toLowerCase()}function v(y,k){let P=y;for(;P&&P!==k;){if(m.has(P.tagName))return P;P=P.parentElement}return null}function O(y){const k=(y.textContent??"").trim(),P=y.tagName;for(let T=0;T<e.block.children.length;T++){const E=e.block.children[T];if(P.startsWith("H")&&P.length===2&&E.type==="heading"){const Q=Si(E.text??"").trim();if(k===Q)return T}else if(P==="P"&&E.type==="paragraph"){const Q=Si(E.source).trim();if(k===Q)return T}else if(P==="PRE"&&E.type==="fence"){const $=(y.querySelector("code")??y).textContent?.trim()??"",L=(E.code??"").trim();if($===L)return T}else if((P==="UL"||P==="OL")&&E.type==="list"){const Q=E.source.replace(/^[-*+\d.]+\s*/gm,"").trim();if(k.includes(Q.slice(0,30))||Q.includes(k.slice(0,30)))return T}else if(P==="BLOCKQUOTE"&&E.type==="quote"){const Q=E.source.replace(/^>\s*/gm,"").trim();if(k===Q)return T}else if(P==="HR"&&E.type==="hr")return T}return-1}function b(y){let k=null,P=null;const T=75,E=document.createElement("div");E.className="rf-edit-tooltip",y.appendChild(E);function Q(L,I){E.textContent=L,E.style.left=`${I.clientX+12}px`,E.style.top=`${I.clientY+12}px`,E.classList.add("rf-tooltip-visible")}function $(){E.classList.remove("rf-tooltip-visible")}y.addEventListener("mouseover",L=>{const I=v(L.target,y);P!==null&&(clearTimeout(P),P=null),I===k||(k?.classList.remove("rf-editable-hover"),k=I,k?.classList.add("rf-editable-hover")),I?(y.classList.remove("rf-block-hover"),Q(p(I.tagName),L)):e.onblockclick?(y.classList.add("rf-block-hover"),Q("prose",L)):$()}),y.addEventListener("mousemove",L=>{E.classList.contains("rf-tooltip-visible")&&(E.style.left=`${L.clientX+12}px`,E.style.top=`${L.clientY+12}px`)}),y.addEventListener("mouseout",L=>{const I=L.relatedTarget;if(y.classList.remove("rf-block-hover"),k&&(!I||!k.contains(I))){P!==null&&clearTimeout(P);const Z=k;P=setTimeout(()=>{Z.classList.remove("rf-editable-hover"),k===Z&&(k=null),P=null},T),$()}}),y.addEventListener("click",L=>{$();const I=v(L.target,y);if(!I){e.onblockclick?.({x:L.clientX,y:L.clientY});return}L.preventDefault(),L.stopPropagation();const Z=O(I);if(Z===-1)return;const Y=e.block.children[Z],ne=I.getBoundingClientRect();I.tagName;const ae={elementType:Y.type,text:(I.textContent??"").trim(),rect:ne,childIndex:Z};Y.type==="heading"?ae.headingLevel=Y.level:Y.type==="fence"&&(ae.fenceLanguage=Y.language??"",ae.fenceCode=Y.code??""),e.onsectionclick?.(ae)})}const w=`
|
|
508
|
-
/* Wrapper: inset border on dead-space hover */
|
|
509
|
-
.rf-preview-wrapper {
|
|
510
|
-
transition: box-shadow 150ms ease;
|
|
511
|
-
cursor: pointer;
|
|
512
|
-
}
|
|
513
|
-
.rf-preview-wrapper.rf-block-hover {
|
|
514
|
-
box-shadow: inset 0 0 0 2px rgba(59, 130, 246, 0.5);
|
|
515
|
-
border-radius: 4px;
|
|
516
|
-
}
|
|
517
|
-
/* Block-level elements: invisible outline + transition */
|
|
518
|
-
h1, h2, h3, h4, h5, h6, p, pre, ul, ol, blockquote, hr, table {
|
|
519
|
-
outline: 2px dashed transparent;
|
|
520
|
-
outline-offset: 4px;
|
|
521
|
-
border-radius: 4px;
|
|
522
|
-
transition: outline-color 150ms ease;
|
|
523
|
-
}
|
|
524
|
-
/* Hover affordance */
|
|
525
|
-
.rf-editable-hover {
|
|
526
|
-
outline-color: rgba(59, 130, 246, 0.5);
|
|
527
|
-
}
|
|
528
|
-
.rf-editable-hover, .rf-editable-hover * {
|
|
529
|
-
cursor: text !important;
|
|
530
|
-
}
|
|
531
|
-
/* Hover tooltip */
|
|
532
|
-
.rf-edit-tooltip {
|
|
533
|
-
position: fixed;
|
|
534
|
-
padding: 2px 8px;
|
|
535
|
-
font-family: system-ui, -apple-system, sans-serif;
|
|
536
|
-
font-size: 11px;
|
|
537
|
-
font-weight: 600;
|
|
538
|
-
line-height: 1.4;
|
|
539
|
-
color: #fff;
|
|
540
|
-
background: rgba(30, 41, 59, 0.9);
|
|
541
|
-
border-radius: 4px;
|
|
542
|
-
pointer-events: none;
|
|
543
|
-
z-index: 10000;
|
|
544
|
-
white-space: nowrap;
|
|
545
|
-
opacity: 0;
|
|
546
|
-
transition: opacity 120ms ease;
|
|
547
|
-
}
|
|
548
|
-
.rf-edit-tooltip.rf-tooltip-visible {
|
|
549
|
-
opacity: 1;
|
|
550
|
-
}
|
|
551
|
-
`;hn(()=>{if(!g(u)||!e.themeConfig)return;(!f||f.host!==g(u))&&(f=g(u).attachShadow({mode:"open"}));const y=e.block.source,k=e.themeConfig,P=e.themeCss,T=t()||"",E=r();return clearTimeout(d),d=setTimeout(()=>{if(f){h&&(h(),h=null);try{const{html:Q}=CP(y,k,E,i()??void 0,s()??void 0,a(),o()??void 0),$=P.replace(/:root/g,":host").replace(/\bhtml\s*\{/g,":host {");f.innerHTML=`<style>${$}
|
|
552
|
-
${T}
|
|
553
|
-
:host { display: block; }
|
|
554
|
-
.rf-preview-wrapper {
|
|
555
|
-
font-family: var(--rf-font-sans, system-ui, -apple-system, sans-serif);
|
|
556
|
-
color: var(--rf-color-text, #1a1a2e);
|
|
557
|
-
line-height: 1.6;
|
|
558
|
-
--rf-content-max: calc(100% - 6rem);
|
|
559
|
-
--rf-content-gutter: 1.5rem;
|
|
560
|
-
}
|
|
561
|
-
.rf-preview-wrapper > article {
|
|
562
|
-
display: grid;
|
|
563
|
-
grid-template-columns:
|
|
564
|
-
[full-start] 1fr
|
|
565
|
-
[wide-start] minmax(0, var(--rf-wide-inset, 8rem))
|
|
566
|
-
[content-start] min(var(--rf-content-max), 100% - var(--rf-content-gutter) * 2)
|
|
567
|
-
[content-end] minmax(0, var(--rf-wide-inset, 8rem))
|
|
568
|
-
[wide-end] 1fr
|
|
569
|
-
[full-end];
|
|
570
|
-
}
|
|
571
|
-
.rf-preview-wrapper > article > * { grid-column: content; }
|
|
572
|
-
${!c()&&e.onsectionclick?w:""}
|
|
573
|
-
</style>
|
|
574
|
-
<div class="rf-preview-wrapper">${Q}</div>`;const L=f.querySelector(".rf-preview-wrapper");L&&(h=$P(L),L.addEventListener("click",I=>{I.target.closest("a")&&I.preventDefault()},!0),!c()&&e.onsectionclick&&b(L))}catch{f&&(f.innerHTML="<style>:host { display: block; padding: 0.75rem 1.5rem; color: #999; font-family: system-ui; font-size: 12px; }</style><em>Preview unavailable</em>")}}},50),()=>{clearTimeout(d),h&&(h(),h=null)}});var S=VY(),_=R(S);{var x=y=>{var k=FY();z(y,k)};le(_,y=>{l()&&y(x)})}var A=D(_,2);{var C=y=>{var k=XY();ln(k,P=>q(u,P),()=>g(u)),z(y,k)};le(A,y=>{e.themeConfig&&y(C)})}ce(()=>St(S,"draggable",l()?"true":"false")),st("dragstart",S,function(...y){e.ondragstart?.apply(this,y)}),st("dragover",S,function(...y){e.ondragover?.apply(this,y)}),st("drop",S,function(...y){e.ondrop?.apply(this,y)}),z(n,S),ht()}function cv(n,e){if(e==="any")return!0;if(e.includes("|"))return e.split("|").some(t=>cv(n,t));if(e.startsWith("heading:")){const t=parseInt(e.slice(8),10);return n.type==="heading"&&n.headingLevel===t}if(e==="list:ordered")return n.type==="list"&&n.listOrdered===!0;if(e==="list:unordered")return n.type==="list"&&n.listOrdered!==!0;if(e.startsWith("tag:")){const t=e.slice(4);return n.type==="rune"&&n.runeName===t}return e==="blockquote"?n.type==="quote":n.type===e}function Jp(n,e){const t=[];let r=0;for(const i of e){const s={name:i.name,match:i.match,optional:i.optional??!1,greedy:i.greedy??!1,filled:!1,nodes:[],description:i.description,template:i.template,emitTag:i.emitTag};if(i.greedy){for(;r<n.length&&cv(n[r],i.match);)s.nodes.push(n[r]),r++;s.filled=s.nodes.length>0}else r<n.length&&cv(n[r],i.match)&&(s.nodes.push(n[r]),s.filled=!0,r++);t.push(s)}return t}function YY(n,e){switch(e.type){case"sequence":return{type:"sequence",fields:Jp(n,e.fields)};case"delimited":{const t=[],r=[[]];for(const i of n)i.type==="hr"?r.push([]):r[r.length-1].push(i);if(e.zones)for(let i=0;i<e.zones.length;i++){const s=e.zones[i],o=r[i]??[];t.push({name:s.name,fields:Jp(o,s.fields)})}else if(e.dynamicZones&&e.zoneModel)for(let i=0;i<r.length;i++)t.push({name:`zone-${i+1}`,fields:Jp(r[i],e.zoneModel.fields)});return{type:"delimited",delimiter:e.delimiter,zones:t}}case"sections":return{type:"sections",description:`Sections split by ${e.sectionHeading}${e.emitTag?`, each emits ${e.emitTag}`:""}`};case"custom":return{type:"custom",description:e.description}}}var UY=W('<span class="rune-attrs__required svelte-ong743">*</span>'),GY=W('<span class="rune-attrs__info svelte-ong743"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="7"></circle><line x1="8" y1="7" x2="8" y2="11"></line><circle cx="8" cy="4.5" r="0.5" fill="currentColor" stroke="none"></circle></svg></span>'),HY=W('<button type="button"> </button>'),KY=Ps('<svg class="rune-attrs__check svelte-ong743" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8l3.5 3.5L13 5"></path></svg>'),JY=Ps('<svg class="rune-attrs__check svelte-ong743" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M3 8l3.5 3.5L13 5"></path></svg>'),eU=W('<button type="button"><span class="rune-attrs__option-label svelte-ong743"> </span> <!></button>'),tU=W('<div class="rune-attrs__dropdown svelte-ong743"><button type="button"><span class="rune-attrs__option-label rune-attrs__option-label--default svelte-ong743">default</span> <!></button> <!></div>'),nU=W('<div class="rune-attrs__enum svelte-ong743"><button type="button"> </button> <!></div>'),rU=W('<input class="rune-attrs__inline-input svelte-ong743"/>'),iU=W('<button type="button"> </button>'),sU=W('<div class="rune-attrs__row svelte-ong743"><span class="rune-attrs__label svelte-ong743"> <!> <!></span> <!></div>'),oU=W('<span class="rune-attrs__empty svelte-ong743">No attributes</span>'),aU=W('<div class="rune-attrs svelte-ong743"><!> <!></div>');function Kw(n,e){dt(e,!0);const t=new Set(["ratio","align","gap","collapse"]),r=new Set(Object.values(Cg).flatMap(y=>Object.keys(y)));let i=ge(()=>UC({authorAttr:e.attributes.reading,runeDefault:e.runeInfo.defaultReading}));function s(y){return r.has(y)?!Cg[g(i)]?.[y]:!1}function o(y,k){const P={...e.attributes};k===""||k===void 0?delete P[y]:P[y]=k,e.onchange(P)}function a(y){return y.replace(/-/g," ").replace(/\b\w/g,k=>k.toUpperCase())}function l(y){if(!t.has(y)||!("layout"in e.runeInfo.attributes))return!1;const k=e.attributes.layout??"";return k!=="split"&&k!=="split-reverse"}let c=ge(()=>Object.entries(e.runeInfo.attributes).filter(([y])=>!l(y)&&!s(y)).sort(([,y],[,k])=>y.required===k.required?0:y.required?-1:1)),u=J(null),f;function d(y){q(u,g(u)===y?null:y,!0)}function h(y,k){o(y,k),q(u,null)}function m(y){g(u)&&f&&!f.contains(y.target)&&q(u,null)}function p(y){y.key==="Escape"&&g(u)&&(q(u,null),y.stopPropagation())}let v=J(null),O=J("");function b(y,k){q(v,y,!0),q(O,k,!0)}function w(y){o(y,g(O)),q(v,null)}function S(y,k){y.key==="Enter"?w(k):y.key==="Escape"&&(q(v,null),y.stopPropagation())}var _=aU();st("mousedown",Zo,m),st("keydown",Zo,p);var x=R(_);Ct(x,17,()=>g(c),([y,k])=>y,(y,k)=>{var P=ge(()=>Hc(g(k),2));let T=()=>g(P)[0],E=()=>g(P)[1];const Q=ge(()=>e.attributes[T()]??"");var $=sU(),L=R($),I=R(L),Z=D(I);{var Y=U=>{var ue=UY();z(U,ue)};le(Z,U=>{E().required&&U(Y)})}var ne=D(Z,2);{var ae=U=>{var ue=GY();ce(()=>St(ue,"data-tooltip",E().description)),z(U,ue)};le(ne,U=>{E().description&&U(ae)})}var ie=D(L,2);{var K=U=>{var ue=HY();let ke;ue.__click=()=>o(T(),g(Q)==="true"?"":"true");var Ce=R(ue);ce(()=>{ke=Be(ue,1,"rune-attrs__value svelte-ong743",null,ke,{active:g(Q)==="true"}),Te(Ce,g(Q)==="true"?"Yes":"No")}),z(U,ue)},he=U=>{var ue=nU(),ke=R(ue);let Ce;ke.__click=()=>d(T());var ve=R(ke),Ee=D(ke,2);{var rt=Ke=>{var Ye=tU(),Ve=R(Ye);let ze;Ve.__click=()=>h(T(),"");var Bt=D(R(Ve),2);{var Nn=bt=>{var Wt=KY();z(bt,Wt)};le(Bt,bt=>{g(Q)||bt(Nn)})}var Jn=D(Ve,2);Ct(Jn,17,()=>E().values,Yt,(bt,Wt)=>{var mn=eU();let Vn;mn.__click=()=>h(T(),g(Wt));var xe=R(mn),Wn=R(xe),Lt=D(xe,2);{var Jt=_n=>{var se=JY();z(_n,se)};le(Lt,_n=>{g(Q)===g(Wt)&&_n(Jt)})}ce(()=>{Vn=Be(mn,1,"rune-attrs__option svelte-ong743",null,Vn,{selected:g(Q)===g(Wt)}),Te(Wn,g(Wt))}),z(bt,mn)}),ce(()=>ze=Be(Ve,1,"rune-attrs__option svelte-ong743",null,ze,{selected:!g(Q)})),z(Ke,Ye)};le(Ee,Ke=>{g(u)===T()&&Ke(rt)})}ce(()=>{Ce=Be(ke,1,"rune-attrs__value svelte-ong743",null,Ce,{active:!!g(Q),open:g(u)===T()}),Te(ve,g(Q)||"default")}),z(U,ue)},fe=U=>{var ue=rU();ue.__keydown=ke=>S(ke,T()),ks(ue),ce(()=>St(ue,"type",E().type==="Number"?"number":"text")),st("blur",ue,()=>w(T())),Qn(ue,()=>g(O),ke=>q(O,ke)),z(U,ue)},j=U=>{var ue=iU();let ke;ue.__click=()=>b(T(),g(Q));var Ce=R(ue);ce(()=>{ke=Be(ue,1,"rune-attrs__value svelte-ong743",null,ke,{active:!!g(Q)}),Te(Ce,g(Q)||(E().required?"required":"default"))}),z(U,ue)};le(ie,U=>{E().type==="Boolean"?U(K):E().values&&E().values.length>0?U(he,1):g(v)===T()?U(fe,2):U(j,!1)})}ce(U=>Te(I,`${U??""} `),[()=>a(T())]),z(y,$)});var A=D(x,2);{var C=y=>{var k=oU();z(y,k)};le(A,y=>{g(c).length===0&&y(C)})}ln(_,y=>f=y,()=>f),z(n,_),ht()}Vt(["click","keydown"]);var lU=W('<div class="tree-node svelte-16z33d"><button type="button"><span class="tree-node__indicator svelte-16z33d">▾</span> <span class="tree-node__rune-dot svelte-16z33d"></span> <span class="tree-node__label tree-node__label--rune svelte-16z33d"> </span></button></div>'),cU=W('<button type="button"><span class="tree-node__indicator svelte-16z33d"> </span> <span class="tree-node__rune-dot svelte-16z33d"></span> <span class="tree-node__label tree-node__label--rune svelte-16z33d"> </span></button>'),uU=W('<button type="button"><svg class="tree-node__icon svelte-16z33d" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="tree-node__label tree-node__label--content svelte-16z33d"> </span></button>'),fU=W('<div class="tree-node svelte-16z33d"><!></div> <!>',1),dU=W("<!> <!>",1);function QP(n,e){dt(e,!0);let t=xt(e,"isRootActive",3,!1),r=xt(e,"depth",3,0),i=xt(e,"pathPrefix",19,()=>[]);function s(d){return d.length!==e.activePath.length?!1:d.every((h,m)=>h===e.activePath[m])}function o(d){return d.length>e.activePath.length?!1:d.every((h,m)=>h===e.activePath[m])}const a={heading:"M3 3v10M13 3v10M3 8h10",paragraph:"M2 4h12M2 8h12M2 12h8",fence:"M5 4L2 8l3 4M11 4l3 4-3 4",list:"M4 4h10M4 8h10M4 12h10M2 4h0M2 8h0M2 12h0",quote:"M4 4h8M4 7h6M1 3v8",hr:"M2 8h12",image:"M2 2h12v12H2zM5 5l-3 7h12l-4-5-2 2.5"};var l=dU(),c=tt(l);{var u=d=>{var h=lU(),m=R(h);let p;m.__click=function(...b){e.onrootclick?.apply(this,b)};var v=D(R(m),4),O=R(v);ce(()=>{p=Be(m,1,"tree-node__btn tree-node__btn--rune svelte-16z33d",null,p,{active:t()}),Te(O,e.rootLabel)}),z(d,h)};le(c,d=>{e.rootLabel&&e.onrootclick&&d(u)})}var f=D(c,2);Ct(f,17,()=>e.nodes,Yt,(d,h,m)=>{const p=ge(()=>[...i(),m]),v=ge(()=>g(h).type==="rune"),O=ge(()=>s(g(p))),b=ge(()=>o(g(p))&&!g(O)),w=ge(()=>g(v)&&!g(h).selfClosing&&g(h).children&&g(h).children.length>0);var S=fU(),_=tt(S),x=R(_);{var A=P=>{var T=cU();let E;T.__click=()=>e.onselect(g(p));var Q=R(T),$=R(Q),L=D(Q,4),I=R(L);ce(()=>{E=Be(T,1,"tree-node__btn tree-node__btn--rune svelte-16z33d",null,E,{active:g(O),ancestor:g(b)}),Te($,g(w)?"▾":"▸"),Te(I,g(h).label)}),z(P,T)},C=P=>{var T=uU();let E;T.__click=()=>e.onselect(g(p));var Q=R(T),$=R(Q),L=D(Q,2),I=R(L);ce(()=>{E=Be(T,1,"tree-node__btn tree-node__btn--content svelte-16z33d",null,E,{active:g(O)}),St($,"d",a[g(h).type]??"M2 4h12M2 8h12M2 12h8"),Te(I,g(h).label)}),z(P,T)};le(x,P=>{g(v)?P(A):P(C,!1)})}var y=D(_,2);{var k=P=>{var T=an(),E=tt(T);{let Q=ge(()=>r()+1);QP(E,{get nodes(){return g(h).children},get activePath(){return e.activePath},get onselect(){return e.onselect},get depth(){return g(Q)},get pathPrefix(){return g(p)}})}z(P,T)};le(y,P=>{g(w)&&g(h).children&&P(k)})}ce(()=>Er(_,`padding-left: ${(r()+(e.rootLabel?1:0))*16}px`)),z(d,S)}),z(n,l),ht()}Vt(["click"]);var hU=W('<button type="button" class="cm-tree__preview-line cm-tree__preview-line--rune svelte-1d9gzqq"><span class="cm-tree__rune-dot svelte-1d9gzqq"></span> </button>'),pU=W('<button type="button" class="cm-tree__preview-line cm-tree__preview-line--clickable svelte-1d9gzqq"> </button>'),mU=W('<div draggable="true"><span class="cm-tree__preview-grip svelte-1d9gzqq" title="Drag to reorder"><svg width="6" height="10" viewBox="0 0 6 10" fill="none"><circle cx="1.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="8.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="8.5" r="1" fill="currentColor"></circle></svg></span> <button type="button" class="cm-tree__preview-text cm-tree__preview-text--clickable svelte-1d9gzqq"> </button> <button type="button" class="cm-tree__preview-remove svelte-1d9gzqq" title="Remove item"><svg width="10" height="10" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"></line><line x1="12" y1="4" x2="4" y2="12"></line></svg></button></div>'),gU=W('<div draggable="true"><span class="cm-tree__preview-grip svelte-1d9gzqq" title="Drag to reorder"><svg width="6" height="10" viewBox="0 0 6 10" fill="none"><circle cx="1.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="1.5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="5" r="1" fill="currentColor"></circle><circle cx="1.5" cy="8.5" r="1" fill="currentColor"></circle><circle cx="4.5" cy="8.5" r="1" fill="currentColor"></circle></svg></span> <button type="button" class="cm-tree__preview-text cm-tree__preview-text--clickable svelte-1d9gzqq"> </button> <button type="button" class="cm-tree__preview-remove svelte-1d9gzqq" title="Remove item"><svg width="10" height="10" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="4" y1="4" x2="12" y2="12"></line><line x1="12" y1="4" x2="4" y2="12"></line></svg></button></div>'),vU=W('<span class="cm-tree__required-badge svelte-1d9gzqq">required</span>'),OU=W('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),bU=W('<!> <button type="button" class="cm-tree__action cm-tree__action--remove svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button>',1),yU=W('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),wU=W('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),_U=W('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),kU=W('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),xU=W('<button type="button"><svg class="cm-tree__field-icon svelte-1d9gzqq" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="cm-tree__field-name svelte-1d9gzqq"> </span> <!> <span class="cm-tree__field-spacer svelte-1d9gzqq"></span> <!></button> <!>',1),SU=W('<div class="cm-tree__fields svelte-1d9gzqq"></div>'),AU=W('<div class="cm-tree__delimiter svelte-1d9gzqq"><span class="cm-tree__delimiter-line svelte-1d9gzqq"></span></div>'),CU=W('<span class="cm-tree__required-badge svelte-1d9gzqq">required</span>'),TU=W('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),PU=W('<!> <button type="button" class="cm-tree__action cm-tree__action--remove svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button>',1),EU=W('<button type="button" class="cm-tree__action cm-tree__action--add svelte-1d9gzqq"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round"><line x1="8" y1="3" x2="8" y2="13"></line><line x1="3" y1="8" x2="13" y2="8"></line></svg></button>'),$U=W('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),QU=W('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),LU=W('<div class="cm-tree__previews svelte-1d9gzqq"><!></div>'),MU=W('<button type="button"><svg class="cm-tree__field-icon svelte-1d9gzqq" width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="cm-tree__field-name svelte-1d9gzqq"> </span> <!> <span class="cm-tree__field-spacer svelte-1d9gzqq"></span> <!></button> <!>',1),qU=W('<!> <div class="cm-tree__zone svelte-1d9gzqq"><div class="cm-tree__zone-label svelte-1d9gzqq"> </div> <div class="cm-tree__fields svelte-1d9gzqq"></div></div>',1),RU=W('<div class="cm-tree__description svelte-1d9gzqq"> </div>'),DU=W('<div class="cm-tree svelte-1d9gzqq"><div class="cm-tree__root svelte-1d9gzqq"><span class="cm-tree__rune-dot svelte-1d9gzqq"></span> <span class="cm-tree__root-label svelte-1d9gzqq"> </span></div> <!></div>');function IU(n,e){dt(e,!0);const t=(T,E=ss,Q=ss,$=ss)=>{var L=an(),I=tt(L);Ct(I,17,E,Yt,(Z,Y)=>{var ne=an(),ae=tt(ne);{var ie=he=>{var fe=hU();fe.__click=()=>e.onnavigaterune(Q(),g(Y).nodeIndex,$());var j=D(R(fe));ce(()=>Te(j,` ${g(Y).text??""}`)),z(he,fe)},K=he=>{var fe=pU();fe.__click=U=>e.oneditfield(Q(),U.currentTarget.getBoundingClientRect(),$(),g(Y).nodeIndex);var j=R(fe);ce(()=>Te(j,g(Y).text)),z(he,fe)};le(ae,he=>{g(Y).type==="rune"&&g(Y).nodeIndex!==void 0?he(ie):he(K,!1)})}z(Z,ne)}),z(T,L)},r=(T,E=ss,Q=ss,$=ss)=>{var L=an(),I=tt(L);Ct(I,17,E,Yt,(Z,Y)=>{var ne=mU();let ae;var ie=D(R(ne),2);ie.__click=fe=>{fe.stopPropagation(),e.oneditlistitem(Q(),g(Y).index,fe.currentTarget.getBoundingClientRect(),$())};var K=R(ie),he=D(ie,2);he.__click=()=>e.onremovelistitem(Q(),g(Y).index,$()),ce(()=>{ae=Be(ne,1,"cm-tree__preview-item svelte-1d9gzqq",null,ae,{"cm-tree__preview-item--drag-over":g(o)===Q()&&g(a)===$()&&g(c)===g(Y).index&&g(l)!==g(Y).index,"cm-tree__preview-item--dragging":g(o)===Q()&&g(a)===$()&&g(l)===g(Y).index}),Te(K,g(Y).text)}),st("dragstart",ne,fe=>u(fe,Q(),g(Y).index,$())),st("dragover",ne,fe=>f(fe,g(Y).index)),st("drop",ne,fe=>d(fe,g(Y).index)),st("dragend",ne,h),z(Z,ne)}),z(T,L)},i=(T,E=ss,Q=ss,$=ss)=>{var L=an(),I=tt(L);Ct(I,17,E,Yt,(Z,Y)=>{var ne=gU();let ae;var ie=D(R(ne),2);ie.__click=fe=>{fe.stopPropagation(),e.oneditfield(Q(),fe.currentTarget.getBoundingClientRect(),$(),g(Y).index)};var K=R(ie),he=D(ie,2);he.__click=()=>e.onremovelistitem(Q(),g(Y).index,$()),ce(()=>{ae=Be(ne,1,"cm-tree__preview-item svelte-1d9gzqq",null,ae,{"cm-tree__preview-item--drag-over":g(o)===Q()&&g(a)===$()&&g(c)===g(Y).index&&g(l)!==g(Y).index,"cm-tree__preview-item--dragging":g(o)===Q()&&g(a)===$()&&g(l)===g(Y).index}),Te(K,g(Y).text)}),st("dragstart",ne,fe=>u(fe,Q(),g(Y).index,$())),st("dragover",ne,fe=>f(fe,g(Y).index)),st("drop",ne,fe=>d(fe,g(Y).index)),st("dragend",ne,h),z(Z,ne)}),z(T,L)};let s=xt(e,"selectedField",3,null),o=J(null),a=J(void 0),l=J(null),c=J(null);function u(T,E,Q,$){q(o,E,!0),q(a,$,!0),q(l,Q,!0),q(c,Q,!0),T.dataTransfer&&(T.dataTransfer.effectAllowed="move",T.dataTransfer.setData("text/plain",String(Q)))}function f(T,E){g(l)!==null&&(T.preventDefault(),T.dataTransfer&&(T.dataTransfer.dropEffect="move"),q(c,E,!0))}function d(T,E){T.preventDefault(),g(l)!==null&&g(l)!==E&&g(o)!==null&&e.onreorderlistitem(g(o),g(l),E,g(a)),q(o,null),q(a,void 0),q(l,null),q(c,null)}function h(){q(o,null),q(a,void 0),q(l,null),q(c,null)}function m(T){return T==="list"||T.startsWith("list:")}function p(T){return T.greedy&&T.filled&&T.match!=="any"}function v(T){return T.nodes.map((E,Q)=>{let $;if(E.type==="fence")$=E.fenceLanguage?`[${E.fenceLanguage}]`:"[code]";else if(E.type==="heading"&&E.headingText)$=E.headingText;else if(E.type==="rune"&&E.runeName)$=E.runeName;else if(E.type==="image")$="[image]";else{const L=E.source.replace(/\n/g," ").trim();$=L.length>50?L.slice(0,47)+"...":L}return{text:$.length>50?$.slice(0,47)+"...":$,index:Q}})}function O(T){switch(T.includes("|")?T.split("|")[0]:T){case"heading":case"heading:1":case"heading:2":case"heading:3":case"heading:4":case"heading:5":case"heading:6":return"M3 3v10M13 3v10M3 8h10";case"paragraph":return"M2 4h12M2 8h12M2 12h8";case"fence":return"M5 4L2 8l3 4M11 4l3 4-3 4";case"list":case"list:ordered":case"list:unordered":return"M4 4h10M4 8h10M4 12h10M2 4h0M2 8h0M2 12h0";case"blockquote":case"quote":return"M4 4h8M4 7h6M1 3v8";case"image":return"M2 2h12v12H2zM5 5l-3 7h12l-4-5-2 2.5";case"any":return"M2 8h12M8 2v12";default:return"M2 4h12M2 8h12M2 12h8"}}function b(T){const E=[];for(const Q of T){if(Q.type!=="list")continue;const $=uh(Q.source);for(let L=0;L<$.length;L++){const Z=$[L].split(`
|
|
575
|
-
`)[0].replace(/^[-*+]\s+|^\d+\.\s+/,"").trim();Z&&E.push({text:Z.length>50?Z.slice(0,47)+"...":Z,index:L})}}return E}function w(T){const E=[];for(let Q=0;Q<T.length;Q++){const $=T[Q];if($.type==="heading"&&$.headingText)E.push({text:$.headingText,type:"text",nodeIndex:Q});else if($.type==="paragraph"){const L=$.source.replace(/\n/g," ").trim();E.push({text:L.length>60?L.slice(0,57)+"...":L,type:"text",nodeIndex:Q})}else if($.type==="rune"&&$.runeName)E.push({text:$.runeName,type:"rune",nodeIndex:Q});else if($.type==="fence"){const L=$.fenceLanguage?`[${$.fenceLanguage}]`:"[code]";E.push({text:L,type:"text",nodeIndex:Q})}else if($.type==="list"){const L=$.source.split(`
|
|
576
|
-
`).filter(I=>I.match(/^[-*\d.]\s/)).map(I=>I.replace(/^[-*\d.]+\s+/,"").trim()).filter(Boolean);for(const I of L.slice(0,3))E.push({text:I.length>50?I.slice(0,47)+"...":I,type:"text"});L.length>3&&E.push({text:`... +${L.length-3} more`,type:"text"})}else if($.type==="image")E.push({text:"[image]",type:"text",nodeIndex:Q});else{const L=$.source.replace(/\n/g," ").trim();L&&E.push({text:L.length>50?L.slice(0,47)+"...":L,type:"text",nodeIndex:Q})}}return E}var S=DU(),_=R(S),x=D(R(_),2),A=R(x),C=D(_,2);{var y=T=>{var E=SU();Ct(E,21,()=>e.structure.fields,Yt,(Q,$)=>{const L=ge(()=>w(g($).nodes)),I=ge(()=>m(g($).match)?b(g($).nodes):[]),Z=ge(()=>p(g($))?v(g($)):[]);var Y=xU(),ne=tt(Y);let ae;ne.__click=()=>e.onfieldselect(g($).name);var ie=R(ne),K=R(ie),he=D(ie,2),fe=R(he),j=D(he,2);{var U=Ve=>{var ze=vU();z(Ve,ze)};le(j,Ve=>{!g($).optional&&!g($).filled&&Ve(U)})}var ue=D(j,4);{var ke=Ve=>{var ze=bU(),Bt=tt(ze);{var Nn=Wt=>{var mn=OU();mn.__click=Vn=>{Vn.stopPropagation(),e.onappenditem(g($).name)},ce(()=>St(mn,"title",`Add item to ${g($).name??""}`)),z(Wt,mn)},Jn=ge(()=>m(g($).match)||p(g($)));le(Bt,Wt=>{g(Jn)&&Wt(Nn)})}var bt=D(Bt,2);bt.__click=Wt=>{Wt.stopPropagation(),e.onremovefield(g($).name)},ce(()=>St(bt,"title",`Remove ${g($).name??""}`)),z(Ve,ze)},Ce=Ve=>{var ze=yU();ze.__click=Bt=>{Bt.stopPropagation(),e.onaddfield(g($).name)},ce(()=>St(ze,"title",`Add ${g($).name??""}`)),z(Ve,ze)};le(ue,Ve=>{g($).filled?Ve(ke):Ve(Ce,!1)})}var ve=D(ne,2);{var Ee=Ve=>{var ze=wU(),Bt=R(ze);r(Bt,()=>g(I),()=>g($).name),z(Ve,ze)},rt=ge(()=>g($).filled&&m(g($).match)&&g(I).length>0),Ke=Ve=>{var ze=_U(),Bt=R(ze);i(Bt,()=>g(Z),()=>g($).name),z(Ve,ze)},Ye=Ve=>{var ze=kU(),Bt=R(ze);t(Bt,()=>g(L),()=>g($).name),z(Ve,ze)};le(ve,Ve=>{g(rt)?Ve(Ee):g($).filled&&g(Z).length>0?Ve(Ke,1):g($).filled&&g(L).length>0&&Ve(Ye,2)})}ce(Ve=>{ae=Be(ne,1,"cm-tree__field svelte-1d9gzqq",null,ae,{"cm-tree__field--filled":g($).filled,"cm-tree__field--empty":!g($).filled,"cm-tree__field--required":!g($).optional&&!g($).filled,"cm-tree__field--selected":s()===g($).name}),St(K,"d",Ve),Te(fe,g($).name)},[()=>O(g($).match)]),z(Q,Y)}),z(T,E)},k=T=>{var E=an(),Q=tt(E);Ct(Q,17,()=>e.structure.zones,Yt,($,L,I)=>{var Z=qU(),Y=tt(Z);{var ne=fe=>{var j=AU();z(fe,j)};le(Y,fe=>{I>0&&fe(ne)})}var ae=D(Y,2),ie=R(ae),K=R(ie),he=D(ie,2);Ct(he,21,()=>g(L).fields,Yt,(fe,j)=>{const U=ge(()=>w(g(j).nodes)),ue=ge(()=>m(g(j).match)?b(g(j).nodes):[]),ke=ge(()=>p(g(j))?v(g(j)):[]);var Ce=MU(),ve=tt(Ce);let Ee;ve.__click=()=>e.onfieldselect(g(j).name,g(L).name);var rt=R(ve),Ke=R(rt),Ye=D(rt,2),Ve=R(Ye),ze=D(Ye,2);{var Bt=Lt=>{var Jt=CU();z(Lt,Jt)};le(ze,Lt=>{!g(j).optional&&!g(j).filled&&Lt(Bt)})}var Nn=D(ze,4);{var Jn=Lt=>{var Jt=PU(),_n=tt(Jt);{var se=Ae=>{var Qe=TU();Qe.__click=yt=>{yt.stopPropagation(),e.onappenditem(g(j).name,g(L).name)},ce(()=>St(Qe,"title",`Add item to ${g(j).name??""}`)),z(Ae,Qe)},Oe=ge(()=>m(g(j).match)||p(g(j)));le(_n,Ae=>{g(Oe)&&Ae(se)})}var _e=D(_n,2);_e.__click=Ae=>{Ae.stopPropagation(),e.onremovefield(g(j).name,g(L).name)},ce(()=>St(_e,"title",`Remove ${g(j).name??""}`)),z(Lt,Jt)},bt=Lt=>{var Jt=EU();Jt.__click=_n=>{_n.stopPropagation(),e.onaddfield(g(j).name,g(L).name)},ce(()=>St(Jt,"title",`Add ${g(j).name??""}`)),z(Lt,Jt)};le(Nn,Lt=>{g(j).filled?Lt(Jn):Lt(bt,!1)})}var Wt=D(ve,2);{var mn=Lt=>{var Jt=$U(),_n=R(Jt);r(_n,()=>g(ue),()=>g(j).name,()=>g(L).name),z(Lt,Jt)},Vn=ge(()=>g(j).filled&&m(g(j).match)&&g(ue).length>0),xe=Lt=>{var Jt=QU(),_n=R(Jt);i(_n,()=>g(ke),()=>g(j).name,()=>g(L).name),z(Lt,Jt)},Wn=Lt=>{var Jt=LU(),_n=R(Jt);t(_n,()=>g(U),()=>g(j).name,()=>g(L).name),z(Lt,Jt)};le(Wt,Lt=>{g(Vn)?Lt(mn):g(j).filled&&g(ke).length>0?Lt(xe,1):g(j).filled&&g(U).length>0&&Lt(Wn,2)})}ce(Lt=>{Ee=Be(ve,1,"cm-tree__field svelte-1d9gzqq",null,Ee,{"cm-tree__field--filled":g(j).filled,"cm-tree__field--empty":!g(j).filled,"cm-tree__field--required":!g(j).optional&&!g(j).filled,"cm-tree__field--selected":s()===`${g(L).name}.${g(j).name}`}),St(Ke,"d",Lt),Te(Ve,g(j).name)},[()=>O(g(j).match)]),z(fe,Ce)}),ce(()=>Te(K,g(L).name)),z($,Z)}),z(T,E)},P=T=>{var E=RU(),Q=R(E);ce(()=>Te(Q,e.structure.description)),z(T,E)};le(C,T=>{e.structure.type==="sequence"?T(y):e.structure.type==="delimited"?T(k,1):(e.structure.type==="sections"||e.structure.type==="custom")&&T(P,2)})}ce(()=>Te(A,e.rootLabel)),z(n,S),ht()}Vt(["click"]);function pe(n){return new nl(iO.define(n))}function Ds(n){return re(()=>import("./index-CTvbHdnl.js"),[]).then(e=>e.sql({dialect:e[n]}))}const LP=[ee.of({name:"C",extensions:["c","h","ino"],load(){return re(()=>import("./index-BcuLfpXj.js"),[]).then(n=>n.cpp())}}),ee.of({name:"C++",alias:["cpp"],extensions:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],load(){return re(()=>import("./index-BcuLfpXj.js"),[]).then(n=>n.cpp())}}),ee.of({name:"CQL",alias:["cassandra"],extensions:["cql"],load(){return Ds("Cassandra")}}),ee.of({name:"CSS",extensions:["css"],load(){return re(()=>Promise.resolve().then(()=>jI),void 0).then(n=>n.css())}}),ee.of({name:"Go",extensions:["go"],load(){return re(()=>import("./index-DC3NN32V.js"),[]).then(n=>n.go())}}),ee.of({name:"HTML",alias:["xhtml"],extensions:["html","htm","handlebars","hbs"],load(){return re(()=>Promise.resolve().then(()=>LN),void 0).then(n=>n.html())}}),ee.of({name:"Java",extensions:["java"],load(){return re(()=>import("./index-CokXa7Q0.js"),[]).then(n=>n.java())}}),ee.of({name:"JavaScript",alias:["ecmascript","js","node"],extensions:["js","mjs","cjs"],load(){return re(()=>Promise.resolve().then(()=>Fu),void 0).then(n=>n.javascript())}}),ee.of({name:"Jinja",extensions:["j2","jinja","jinja2"],load(){return re(()=>import("./index-9FYuyjkb.js"),[]).then(n=>n.jinja())}}),ee.of({name:"JSON",alias:["json5"],extensions:["json","map"],load(){return re(()=>import("./index-BtDnPCJm.js"),[]).then(n=>n.json())}}),ee.of({name:"JSX",extensions:["jsx"],load(){return re(()=>Promise.resolve().then(()=>Fu),void 0).then(n=>n.javascript({jsx:!0}))}}),ee.of({name:"LESS",extensions:["less"],load(){return re(()=>import("./index-B_Cn-SCf.js"),[]).then(n=>n.less())}}),ee.of({name:"Liquid",extensions:["liquid"],load(){return re(()=>import("./index-BYbu3e1g.js"),[]).then(n=>n.liquid())}}),ee.of({name:"MariaDB SQL",load(){return Ds("MariaSQL")}}),ee.of({name:"Markdown",extensions:["md","markdown","mkd"],load(){return re(()=>Promise.resolve().then(()=>FN),void 0).then(n=>n.markdown())}}),ee.of({name:"MS SQL",load(){return Ds("MSSQL")}}),ee.of({name:"MySQL",load(){return Ds("MySQL")}}),ee.of({name:"PHP",extensions:["php","php3","php4","php5","php7","phtml"],load(){return re(()=>import("./index-B4gO_iPW.js"),[]).then(n=>n.php())}}),ee.of({name:"PLSQL",extensions:["pls"],load(){return Ds("PLSQL")}}),ee.of({name:"PostgreSQL",load(){return Ds("PostgreSQL")}}),ee.of({name:"Python",extensions:["BUILD","bzl","py","pyw"],filename:/^(BUCK|BUILD)$/,load(){return re(()=>import("./index-dOZj_cPm.js"),[]).then(n=>n.python())}}),ee.of({name:"Rust",extensions:["rs"],load(){return re(()=>import("./index-BX59bp8A.js"),[]).then(n=>n.rust())}}),ee.of({name:"Sass",extensions:["sass"],load(){return re(()=>import("./index-BGnYPYsz.js"),[]).then(n=>n.sass({indented:!0}))}}),ee.of({name:"SCSS",extensions:["scss"],load(){return re(()=>import("./index-BGnYPYsz.js"),[]).then(n=>n.sass())}}),ee.of({name:"SQL",extensions:["sql"],load(){return Ds("StandardSQL")}}),ee.of({name:"SQLite",load(){return Ds("SQLite")}}),ee.of({name:"TSX",extensions:["tsx"],load(){return re(()=>Promise.resolve().then(()=>Fu),void 0).then(n=>n.javascript({jsx:!0,typescript:!0}))}}),ee.of({name:"TypeScript",alias:["ts"],extensions:["ts","mts","cts"],load(){return re(()=>Promise.resolve().then(()=>Fu),void 0).then(n=>n.javascript({typescript:!0}))}}),ee.of({name:"WebAssembly",extensions:["wat","wast"],load(){return re(()=>import("./index-B5EwV3L4.js"),[]).then(n=>n.wast())}}),ee.of({name:"XML",alias:["rss","wsdl","xsd"],extensions:["xml","xsl","xsd","svg"],load(){return re(()=>import("./index-Dy9gwdZ7.js"),[]).then(n=>n.xml())}}),ee.of({name:"YAML",alias:["yml"],extensions:["yaml","yml"],load(){return re(()=>import("./index-8OoX8730.js"),[]).then(n=>n.yaml())}}),ee.of({name:"APL",extensions:["dyalog","apl"],load(){return re(()=>import("./apl-B4CMkyY2.js"),[]).then(n=>pe(n.apl))}}),ee.of({name:"PGP",alias:["asciiarmor"],extensions:["asc","pgp","sig"],load(){return re(()=>import("./asciiarmor-Df11BRmG.js"),[]).then(n=>pe(n.asciiArmor))}}),ee.of({name:"ASN.1",extensions:["asn","asn1"],load(){return re(()=>import("./asn1-EdZsLKOL.js"),[]).then(n=>pe(n.asn1({})))}}),ee.of({name:"Asterisk",filename:/^extensions\.conf$/i,load(){return re(()=>import("./asterisk-B-8jnY81.js"),[]).then(n=>pe(n.asterisk))}}),ee.of({name:"Brainfuck",extensions:["b","bf"],load(){return re(()=>import("./brainfuck-C4LP7Hcl.js"),[]).then(n=>pe(n.brainfuck))}}),ee.of({name:"Cobol",extensions:["cob","cpy"],load(){return re(()=>import("./cobol-CWcv1MsR.js"),[]).then(n=>pe(n.cobol))}}),ee.of({name:"C#",alias:["csharp","cs"],extensions:["cs"],load(){return re(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.csharp))}}),ee.of({name:"Clojure",extensions:["clj","cljc","cljx"],load(){return re(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),ee.of({name:"ClojureScript",extensions:["cljs"],load(){return re(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),ee.of({name:"Closure Stylesheets (GSS)",extensions:["gss"],load(){return re(()=>import("./css-BnMrqG3P.js"),[]).then(n=>pe(n.gss))}}),ee.of({name:"CMake",extensions:["cmake","cmake.in"],filename:/^CMakeLists\.txt$/,load(){return re(()=>import("./cmake-BQqOBYOt.js"),[]).then(n=>pe(n.cmake))}}),ee.of({name:"CoffeeScript",alias:["coffee","coffee-script"],extensions:["coffee"],load(){return re(()=>import("./coffeescript-S37ZYGWr.js"),[]).then(n=>pe(n.coffeeScript))}}),ee.of({name:"Common Lisp",alias:["lisp"],extensions:["cl","lisp","el"],load(){return re(()=>import("./commonlisp-DBKNyK5s.js"),[]).then(n=>pe(n.commonLisp))}}),ee.of({name:"Cypher",extensions:["cyp","cypher"],load(){return re(()=>import("./cypher-C_CwsFkJ.js"),[]).then(n=>pe(n.cypher))}}),ee.of({name:"Cython",extensions:["pyx","pxd","pxi"],load(){return re(()=>import("./python-BuPzkPfP.js"),[]).then(n=>pe(n.cython))}}),ee.of({name:"Crystal",extensions:["cr"],load(){return re(()=>import("./crystal-SjHAIU92.js"),[]).then(n=>pe(n.crystal))}}),ee.of({name:"D",extensions:["d"],load(){return re(()=>import("./d-pRatUO7H.js"),[]).then(n=>pe(n.d))}}),ee.of({name:"Dart",extensions:["dart"],load(){return re(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.dart))}}),ee.of({name:"diff",extensions:["diff","patch"],load(){return re(()=>import("./diff-DbItnlRl.js"),[]).then(n=>pe(n.diff))}}),ee.of({name:"Dockerfile",filename:/^Dockerfile$/,load(){return re(()=>import("./dockerfile-BKs6k2Af.js"),__vite__mapDeps([0,1])).then(n=>pe(n.dockerFile))}}),ee.of({name:"DTD",extensions:["dtd"],load(){return re(()=>import("./dtd-DF_7sFjM.js"),[]).then(n=>pe(n.dtd))}}),ee.of({name:"Dylan",extensions:["dylan","dyl","intr"],load(){return re(()=>import("./dylan-DwRh75JA.js"),[]).then(n=>pe(n.dylan))}}),ee.of({name:"EBNF",load(){return re(()=>import("./ebnf-CDyGwa7X.js"),[]).then(n=>pe(n.ebnf))}}),ee.of({name:"ECL",extensions:["ecl"],load(){return re(()=>import("./ecl-Cabwm37j.js"),[]).then(n=>pe(n.ecl))}}),ee.of({name:"edn",extensions:["edn"],load(){return re(()=>import("./clojure-BMjYHr_A.js"),[]).then(n=>pe(n.clojure))}}),ee.of({name:"Eiffel",extensions:["e"],load(){return re(()=>import("./eiffel-CnydiIhH.js"),[]).then(n=>pe(n.eiffel))}}),ee.of({name:"Elm",extensions:["elm"],load(){return re(()=>import("./elm-vLlmbW-K.js"),[]).then(n=>pe(n.elm))}}),ee.of({name:"Erlang",extensions:["erl"],load(){return re(()=>import("./erlang-BNw1qcRV.js"),[]).then(n=>pe(n.erlang))}}),ee.of({name:"Esper",load(){return re(()=>import("./sql-D0XecflT.js"),[]).then(n=>pe(n.esper))}}),ee.of({name:"Factor",extensions:["factor"],load(){return re(()=>import("./factor-kuTfRLto.js"),__vite__mapDeps([2,1])).then(n=>pe(n.factor))}}),ee.of({name:"FCL",load(){return re(()=>import("./fcl-Kvtd6kyn.js"),[]).then(n=>pe(n.fcl))}}),ee.of({name:"Forth",extensions:["forth","fth","4th"],load(){return re(()=>import("./forth-Ffai-XNe.js"),[]).then(n=>pe(n.forth))}}),ee.of({name:"Fortran",extensions:["f","for","f77","f90","f95"],load(){return re(()=>import("./fortran-DYz_wnZ1.js"),[]).then(n=>pe(n.fortran))}}),ee.of({name:"F#",alias:["fsharp"],extensions:["fs"],load(){return re(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.fSharp))}}),ee.of({name:"Gas",extensions:["s"],load(){return re(()=>import("./gas-Bneqetm1.js"),[]).then(n=>pe(n.gas))}}),ee.of({name:"Gherkin",extensions:["feature"],load(){return re(()=>import("./gherkin-heZmZLOM.js"),[]).then(n=>pe(n.gherkin))}}),ee.of({name:"Groovy",extensions:["groovy","gradle"],filename:/^Jenkinsfile$/,load(){return re(()=>import("./groovy-D9Dt4D0W.js"),[]).then(n=>pe(n.groovy))}}),ee.of({name:"Haskell",extensions:["hs"],load(){return re(()=>import("./haskell-Cw1EW3IL.js"),[]).then(n=>pe(n.haskell))}}),ee.of({name:"Haxe",extensions:["hx"],load(){return re(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>pe(n.haxe))}}),ee.of({name:"HXML",extensions:["hxml"],load(){return re(()=>import("./haxe-H-WmDvRZ.js"),[]).then(n=>pe(n.hxml))}}),ee.of({name:"HTTP",load(){return re(()=>import("./http-DBlCnlav.js"),[]).then(n=>pe(n.http))}}),ee.of({name:"IDL",extensions:["pro"],load(){return re(()=>import("./idl-BEugSyMb.js"),[]).then(n=>pe(n.idl))}}),ee.of({name:"JSON-LD",alias:["jsonld"],extensions:["jsonld"],load(){return re(()=>import("./javascript-iXu5QeM3.js"),[]).then(n=>pe(n.jsonld))}}),ee.of({name:"Julia",extensions:["jl"],load(){return re(()=>import("./julia-DuME0IfC.js"),[]).then(n=>pe(n.julia))}}),ee.of({name:"Kotlin",extensions:["kt","kts"],load(){return re(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.kotlin))}}),ee.of({name:"LiveScript",alias:["ls"],extensions:["ls"],load(){return re(()=>import("./livescript-BwQOo05w.js"),[]).then(n=>pe(n.liveScript))}}),ee.of({name:"Lua",extensions:["lua"],load(){return re(()=>import("./lua-BgMRiT3U.js"),[]).then(n=>pe(n.lua))}}),ee.of({name:"mIRC",extensions:["mrc"],load(){return re(()=>import("./mirc-CjQqDB4T.js"),[]).then(n=>pe(n.mirc))}}),ee.of({name:"Mathematica",extensions:["m","nb","wl","wls"],load(){return re(()=>import("./mathematica-DTrFuWx2.js"),[]).then(n=>pe(n.mathematica))}}),ee.of({name:"Modelica",extensions:["mo"],load(){return re(()=>import("./modelica-Dc1JOy9r.js"),[]).then(n=>pe(n.modelica))}}),ee.of({name:"MUMPS",extensions:["mps"],load(){return re(()=>import("./mumps-BT43cFF4.js"),[]).then(n=>pe(n.mumps))}}),ee.of({name:"Mbox",extensions:["mbox"],load(){return re(()=>import("./mbox-CNhZ1qSd.js"),[]).then(n=>pe(n.mbox))}}),ee.of({name:"Nginx",filename:/nginx.*\.conf$/i,load(){return re(()=>import("./nginx-DdIZxoE0.js"),[]).then(n=>pe(n.nginx))}}),ee.of({name:"NSIS",extensions:["nsh","nsi"],load(){return re(()=>import("./nsis-LdVXkNf5.js"),__vite__mapDeps([3,1])).then(n=>pe(n.nsis))}}),ee.of({name:"NTriples",extensions:["nt","nq"],load(){return re(()=>import("./ntriples-BfvgReVJ.js"),[]).then(n=>pe(n.ntriples))}}),ee.of({name:"Objective-C",alias:["objective-c","objc"],extensions:["m"],load(){return re(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.objectiveC))}}),ee.of({name:"Objective-C++",alias:["objective-c++","objc++"],extensions:["mm"],load(){return re(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.objectiveCpp))}}),ee.of({name:"OCaml",extensions:["ml","mli","mll","mly"],load(){return re(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.oCaml))}}),ee.of({name:"Octave",extensions:["m"],load(){return re(()=>import("./octave-Ck1zUtKM.js"),[]).then(n=>pe(n.octave))}}),ee.of({name:"Oz",extensions:["oz"],load(){return re(()=>import("./oz-BzwKVEFT.js"),[]).then(n=>pe(n.oz))}}),ee.of({name:"Pascal",extensions:["p","pas"],load(){return re(()=>import("./pascal--L3eBynH.js"),[]).then(n=>pe(n.pascal))}}),ee.of({name:"Perl",extensions:["pl","pm"],load(){return re(()=>import("./perl-CdXCOZ3F.js"),[]).then(n=>pe(n.perl))}}),ee.of({name:"Pig",extensions:["pig"],load(){return re(()=>import("./pig-CevX1Tat.js"),[]).then(n=>pe(n.pig))}}),ee.of({name:"PowerShell",extensions:["ps1","psd1","psm1"],load(){return re(()=>import("./powershell-CFHJl5sT.js"),[]).then(n=>pe(n.powerShell))}}),ee.of({name:"Properties files",alias:["ini","properties"],extensions:["properties","ini","in"],load(){return re(()=>import("./properties-C78fOPTZ.js"),[]).then(n=>pe(n.properties))}}),ee.of({name:"ProtoBuf",extensions:["proto"],load(){return re(()=>import("./protobuf-ChK-085T.js"),[]).then(n=>pe(n.protobuf))}}),ee.of({name:"Pug",alias:["jade"],extensions:["pug","jade"],load(){return re(()=>import("./pug-DeIclll2.js"),__vite__mapDeps([4,5])).then(n=>pe(n.pug))}}),ee.of({name:"Puppet",extensions:["pp"],load(){return re(()=>import("./puppet-DMA9R1ak.js"),[]).then(n=>pe(n.puppet))}}),ee.of({name:"Q",extensions:["q"],load(){return re(()=>import("./q-pXgVlZs6.js"),[]).then(n=>pe(n.q))}}),ee.of({name:"R",alias:["rscript"],extensions:["r","R"],load(){return re(()=>import("./r-B6wPVr8A.js"),[]).then(n=>pe(n.r))}}),ee.of({name:"RPM Changes",load(){return re(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>pe(n.rpmChanges))}}),ee.of({name:"RPM Spec",extensions:["spec"],load(){return re(()=>import("./rpm-CTu-6PCP.js"),[]).then(n=>pe(n.rpmSpec))}}),ee.of({name:"Ruby",alias:["jruby","macruby","rake","rb","rbx"],extensions:["rb"],filename:/^(Gemfile|Rakefile)$/,load(){return re(()=>import("./ruby-B2Rjki9n.js"),[]).then(n=>pe(n.ruby))}}),ee.of({name:"SAS",extensions:["sas"],load(){return re(()=>import("./sas-B4kiWyti.js"),[]).then(n=>pe(n.sas))}}),ee.of({name:"Scala",extensions:["scala"],load(){return re(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.scala))}}),ee.of({name:"Scheme",extensions:["scm","ss"],load(){return re(()=>import("./scheme-C41bIUwD.js"),[]).then(n=>pe(n.scheme))}}),ee.of({name:"Shell",alias:["bash","sh","zsh"],extensions:["sh","ksh","bash"],filename:/^PKGBUILD$/,load(){return re(()=>import("./shell-CjFT_Tl9.js"),[]).then(n=>pe(n.shell))}}),ee.of({name:"Sieve",extensions:["siv","sieve"],load(){return re(()=>import("./sieve-C3Gn_uJK.js"),[]).then(n=>pe(n.sieve))}}),ee.of({name:"Smalltalk",extensions:["st"],load(){return re(()=>import("./smalltalk-CnHTOXQT.js"),[]).then(n=>pe(n.smalltalk))}}),ee.of({name:"Solr",load(){return re(()=>import("./solr-DehyRSwq.js"),[]).then(n=>pe(n.solr))}}),ee.of({name:"SML",extensions:["sml","sig","fun","smackspec"],load(){return re(()=>import("./mllike-CXdrOF99.js"),[]).then(n=>pe(n.sml))}}),ee.of({name:"SPARQL",alias:["sparul"],extensions:["rq","sparql"],load(){return re(()=>import("./sparql-DkYu6x3z.js"),[]).then(n=>pe(n.sparql))}}),ee.of({name:"Spreadsheet",alias:["excel","formula"],load(){return re(()=>import("./spreadsheet-BCZA_wO0.js"),[]).then(n=>pe(n.spreadsheet))}}),ee.of({name:"Squirrel",extensions:["nut"],load(){return re(()=>import("./clike-B9uivgTg.js"),[]).then(n=>pe(n.squirrel))}}),ee.of({name:"Stylus",extensions:["styl"],load(){return re(()=>import("./stylus-B533Al4x.js"),[]).then(n=>pe(n.stylus))}}),ee.of({name:"Swift",extensions:["swift"],load(){return re(()=>import("./swift-BzpIVaGY.js"),[]).then(n=>pe(n.swift))}}),ee.of({name:"sTeX",load(){return re(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>pe(n.stex))}}),ee.of({name:"LaTeX",alias:["tex"],extensions:["text","ltx","tex"],load(){return re(()=>import("./stex-C3f8Ysf7.js"),[]).then(n=>pe(n.stex))}}),ee.of({name:"SystemVerilog",extensions:["v","sv","svh"],load(){return re(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>pe(n.verilog))}}),ee.of({name:"Tcl",extensions:["tcl"],load(){return re(()=>import("./tcl-DVfN8rqt.js"),[]).then(n=>pe(n.tcl))}}),ee.of({name:"Textile",extensions:["textile"],load(){return re(()=>import("./textile-CnDTJFAw.js"),[]).then(n=>pe(n.textile))}}),ee.of({name:"TiddlyWiki",load(){return re(()=>import("./tiddlywiki-DO-Gjzrf.js"),[]).then(n=>pe(n.tiddlyWiki))}}),ee.of({name:"Tiki wiki",load(){return re(()=>import("./tiki-DGYXhP31.js"),[]).then(n=>pe(n.tiki))}}),ee.of({name:"TOML",extensions:["toml"],load(){return re(()=>import("./toml-Bm5Em-hy.js"),[]).then(n=>pe(n.toml))}}),ee.of({name:"Troff",extensions:["1","2","3","4","5","6","7","8","9"],load(){return re(()=>import("./troff-wAsdV37c.js"),[]).then(n=>pe(n.troff))}}),ee.of({name:"TTCN",extensions:["ttcn","ttcn3","ttcnpp"],load(){return re(()=>import("./ttcn-CfJYG6tj.js"),[]).then(n=>pe(n.ttcn))}}),ee.of({name:"TTCN_CFG",extensions:["cfg"],load(){return re(()=>import("./ttcn-cfg-B9xdYoR4.js"),[]).then(n=>pe(n.ttcnCfg))}}),ee.of({name:"Turtle",extensions:["ttl"],load(){return re(()=>import("./turtle-B1tBg_DP.js"),[]).then(n=>pe(n.turtle))}}),ee.of({name:"Web IDL",extensions:["webidl"],load(){return re(()=>import("./webidl-ZXfAyPTL.js"),[]).then(n=>pe(n.webIDL))}}),ee.of({name:"VB.NET",extensions:["vb"],load(){return re(()=>import("./vb-CmGdzxic.js"),[]).then(n=>pe(n.vb))}}),ee.of({name:"VBScript",extensions:["vbs"],load(){return re(()=>import("./vbscript-BuJXcnF6.js"),[]).then(n=>pe(n.vbScript))}}),ee.of({name:"Velocity",extensions:["vtl"],load(){return re(()=>import("./velocity-D8B20fx6.js"),[]).then(n=>pe(n.velocity))}}),ee.of({name:"Verilog",extensions:["v"],load(){return re(()=>import("./verilog-C6RDOZhf.js"),[]).then(n=>pe(n.verilog))}}),ee.of({name:"VHDL",extensions:["vhd","vhdl"],load(){return re(()=>import("./vhdl-lSbBsy5d.js"),[]).then(n=>pe(n.vhdl))}}),ee.of({name:"XQuery",extensions:["xy","xquery","xq","xqm","xqy"],load(){return re(()=>import("./xquery-DzFWVndE.js"),[]).then(n=>pe(n.xQuery))}}),ee.of({name:"Yacas",extensions:["ys"],load(){return re(()=>import("./yacas-BJ4BC0dw.js"),[]).then(n=>pe(n.yacas))}}),ee.of({name:"Z80",extensions:["z80"],load(){return re(()=>import("./z80-Hz9HOZM7.js"),[]).then(n=>pe(n.z80))}}),ee.of({name:"MscGen",extensions:["mscgen","mscin","msc"],load(){return re(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.mscgen))}}),ee.of({name:"Xù",extensions:["xu"],load(){return re(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.xu))}}),ee.of({name:"MsGenny",extensions:["msgenny"],load(){return re(()=>import("./mscgen-BA5vi2Kp.js"),[]).then(n=>pe(n.msgenny))}}),ee.of({name:"Vue",extensions:["vue"],load(){return re(()=>import("./index-C22IGCT5.js"),[]).then(n=>n.vue())}}),ee.of({name:"Angular Template",load(){return re(()=>import("./index-MAa41Aoo.js"),[]).then(n=>n.angular())}})];var NU=W('<div class="inline-editor svelte-1ewoogg"></div>');function _o(n,e){dt(e,!0);let t,r=J(void 0),i="";const s=new ws,o=new ws,a=new ws,l=Pe.theme({"&":{color:"#1a1a2e",fontSize:"13px",height:"auto"},".cm-scroller":{overflow:"visible",fontFamily:"'SF Mono', 'Fira Code', ui-monospace, monospace",lineHeight:"1.6"},".cm-content":{padding:"0.75rem",caretColor:"#1e293b",minHeight:"3rem"},".cm-cursor":{borderLeftColor:"#1e293b"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"rgba(14, 165, 233, 0.2)"},".cm-selectionBackground":{backgroundColor:"rgba(14, 165, 233, 0.12)"},"&.cm-focused":{outline:"none"},".cm-activeLine":{backgroundColor:"transparent"},".cm-tooltip.cm-tooltip-autocomplete":{border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 8px 24px rgba(0, 0, 0, 0.12)",backgroundColor:"#ffffff",overflow:"hidden"},".cm-tooltip.cm-tooltip-autocomplete ul":{fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12px",maxHeight:"280px"},".cm-tooltip.cm-tooltip-autocomplete ul li":{padding:"4px 8px",borderBottom:"1px solid #f1f5f9"},".cm-tooltip.cm-tooltip-autocomplete ul li[aria-selected]":{backgroundColor:"#f0f9ff",color:"#0369a1"},".cm-tooltip.cm-completionInfo":{border:"1px solid #e2e8f0",borderRadius:"6px",boxShadow:"0 4px 12px rgba(0, 0, 0, 0.08)",backgroundColor:"#ffffff",padding:"6px 10px",fontFamily:"system-ui, -apple-system, sans-serif",fontSize:"12px",color:"#475569",maxWidth:"300px"},".cm-completionDetail":{color:"#94a3b8",fontStyle:"normal",marginLeft:"0.5em"},".cm-markdoc-tag":{backgroundColor:"rgba(217, 119, 6, 0.06)",borderRadius:"2px"},".cm-markdoc-bracket":{color:"#94a3b8"},".cm-markdoc-name":{color:"#d97706",fontWeight:"600"}},{dark:!1});hn(()=>{if(!t)return;const u=!!Pr(()=>e.language)?.trim(),f=Pt.create({doc:Pr(()=>e.content),extensions:[s.of(al()),o.of(u?[]:Nc()),a.of(u?[]:ig({override:[mg(e.runes),gg(e.runes,e.aggregated)],icons:!1})),cO(),l,Tc(nC),Tc(Tx),YA(),na.of([...dO,...uO,...tC,{key:"Mod-/",run:h=>(uc(h),!0)}]),Pe.updateListener.of(h=>{h.docChanged&&(i=h.state.doc.toString(),e.onchange(i))}),Pe.lineWrapping]}),d=new Pe({state:f,parent:t});return q(r,d,!0),()=>{q(r,void 0),d.destroy()}}),hn(()=>{const u=g(r);if(!u)return;const f=e.language?.trim();if(!f){u.dispatch({effects:[s.reconfigure(al()),o.reconfigure(Nc()),a.reconfigure(ig({override:[mg(e.runes),gg(e.runes,e.aggregated)],icons:!1}))]});return}u.dispatch({effects:[o.reconfigure([]),a.reconfigure([])]});const d=ee.matchLanguageName(LP,f,!0);d&&d.load().then(h=>{g(r)===u&&u.dispatch({effects:s.reconfigure(h)})})}),hn(()=>{const u=e.content,f=g(r);if(!f)return;const d=f.state.doc.toString();if(u!==d){if(i&&d===i){i="";return}i="",f.dispatch({changes:{from:0,to:f.state.doc.length,insert:u}})}});var c=NU();ln(c,u=>t=u,()=>t),z(n,c),ht()}var BU=W('<span class="edit-panel__category svelte-1t8cclf"> </span>'),jU=Ps('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><circle cx="8" cy="8" r="2"></circle><path d="M6.7 1.6h2.6l.4 1.8.8.4 1.7-.7 1.8 1.8-.7 1.7.4.8 1.8.4v2.6l-1.8.4-.4.8.7 1.7-1.8 1.8-1.7-.7-.8.4-.4 1.8H6.7l-.4-1.8-.8-.4-1.7.7-1.8-1.8.7-1.7-.4-.8-1.8-.4V6.7l1.8-.4.4-.8-.7-1.7 1.8-1.8 1.7.7.8-.4z"></path></svg> Settings',1),zU=Ps('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h4M2 7h4M6 11h4M6 15h4M4 3v8M8 11v4"></path></svg> Structure',1),ZU=Ps('<svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4h12M2 8h12M2 12h8"></path></svg> Content',1),FU=W('<button type="button"><!></button>'),XU=W('<div class="edit-panel__tabs svelte-1t8cclf"></div>'),VU=W('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Level</span> <select class="edit-panel__select svelte-1t8cclf"><option>H1</option><option>H2</option><option>H3</option><option>H4</option><option>H5</option><option>H6</option></select></label> <label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Text</span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label></div>'),WU=W('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Language</span> <input class="edit-panel__input svelte-1t8cclf" type="text" placeholder="e.g. js, python, html"/></label></div>'),YU=W('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">No settings for this element</span></div>'),UU=W('<label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf"> </span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label>'),GU=W('<div class="edit-panel__unknown svelte-1t8cclf"><span class="edit-panel__unknown-label svelte-1t8cclf"> </span> <!></div>'),HU=W('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),KU=W('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),JU=W('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),eG=W('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),tG=W('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">Edit heading text in Settings</span></div>'),nG=W('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Source</span> <textarea class="edit-panel__textarea svelte-1t8cclf"></textarea></label></div>'),rG=W('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),iG=W('<div class="edit-panel__empty-tab svelte-1t8cclf"><span class="edit-panel__empty-tab-text svelte-1t8cclf">This rune has no inner content</span></div>'),sG=W('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),oG=W('<div class="edit-panel__tab-panel svelte-1t8cclf"><!></div>'),aG=W("<!> <!> <!>",1),lG=W('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Level</span> <select class="edit-panel__select svelte-1t8cclf"><option>H1</option><option>H2</option><option>H3</option><option>H4</option><option>H5</option><option>H6</option></select></label> <label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Text</span> <input class="edit-panel__input svelte-1t8cclf" type="text"/></label></div>'),cG=W('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Language</span> <input class="edit-panel__input svelte-1t8cclf" type="text" placeholder="e.g. js, python, html"/></label></div> <div class="edit-panel__content-editor svelte-1t8cclf"><!></div>',1),uG=W('<div class="edit-panel__content-editor svelte-1t8cclf"><!></div>'),fG=W('<div class="edit-panel__field-group svelte-1t8cclf"><label class="edit-panel__field svelte-1t8cclf"><span class="edit-panel__field-label svelte-1t8cclf">Source</span> <textarea class="edit-panel__textarea svelte-1t8cclf"></textarea></label></div>'),dG=W('<div class="edit-panel__body svelte-1t8cclf"><!></div>'),hG=W('<div class="edit-panel svelte-1t8cclf"><div class="edit-panel__top svelte-1t8cclf"><div class="edit-panel__header svelte-1t8cclf"><span class="edit-panel__type svelte-1t8cclf"> </span> <!> <div class="edit-panel__spacer svelte-1t8cclf"></div> <button class="edit-panel__btn edit-panel__btn--danger svelte-1t8cclf" title="Remove block"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="2" x2="10" y2="2"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button> <button class="edit-panel__btn svelte-1t8cclf" title="Close panel">×</button></div> <!></div> <!></div>');function pG(n,e){dt(e,!0);let t=xt(e,"aggregated",19,()=>({})),r=xt(e,"initialRuneIndex",3,null),i=ge(()=>zO(e.block)),s=ge(()=>e.block.type==="rune"?e.runeMap.get(e.block.runeName)??null:null),o=ge(()=>g(s)?.category??null),a=J(Ht([])),l=ge(()=>{if(e.block.type!=="rune")return[];const se=e.block;return se.selfClosing||!se.innerContent.trim()?[]:BO(se.innerContent)}),c=ge(()=>g(l).some(se=>se.type==="rune")),u=ge(()=>g(O)?.type==="rune"&&g(b)?g(b):g(s)),f=ge(()=>g(O)?.type==="rune"&&g(O).children?g(O).children:g(l)),d=ge(()=>g(u)?.contentModel!=null),h=ge(()=>g(u)?.contentModel?YY(g(f),g(u).contentModel):null),m=J(null);function p(se,Oe){let _e=0;function Ae(Qe,yt){for(let ct=0;ct<Qe.length;ct++)if(Qe[ct].type==="rune"){if(_e===Oe)return[...yt,ct];_e++;const Ue=Ae(Qe[ct].children??[],[...yt,ct]);if(Ue)return Ue}return null}return Ae(se,[])}hn(()=>{if(r()!=null&&g(l).length>0){const se=p(g(l),r());se&&q(a,se,!0)}});function v(se,Oe){if(Oe.length===0)return null;const[_e,...Ae]=Oe,Qe=se[_e];return Qe?Ae.length===0?Qe:v(Qe.children??[],Ae):null}let O=ge(()=>v(g(l),g(a))),b=ge(()=>g(O)?.runeName?e.runeMap.get(g(O).runeName)??null:null),w=ge(()=>g(O)!=null&&g(O).type!=="rune"),S=ge(()=>g(O)?g(O).type==="rune"?g(O).runeName??g(i):g(O).type:g(i)),_=J("settings"),x=ge(()=>{if(e.block.type!=="rune")return[];const se=e.block,Oe=["settings"];return(g(d)||!g(O)&&g(c))&&Oe.push("structure"),se.selfClosing||Oe.push("content"),Oe});hn(()=>{g(_)==="structure"&&!g(x).includes("structure")&&q(_,"settings")});function A(se){q(a,se,!0);const Oe=v(g(l),se);Oe&&Oe.type!=="rune"&&q(_,"content")}function C(){q(a,[],!0)}function y(se,Oe){q(m,Oe?`${Oe}.${se}`:se,!0)}function k(se){const Oe=e.block;if(g(O)?.type==="rune"&&g(O).innerContent!==void 0){const _e=se(g(O).innerContent);if(_e===g(O).innerContent)return;const Ae=Sf(g(O).attributes??{}),Qe=_e.trim(),yt=Qe?`{% ${g(O).runeName}${Ae} %}
|
|
577
|
-
${Qe}
|
|
578
|
-
{% /${g(O).runeName} %}`:`{% ${g(O).runeName}${Ae} %}
|
|
579
|
-
|
|
580
|
-
{% /${g(O).runeName} %}`,ct=Wu(Oe.innerContent,g(O).source,yt),Ue={...Oe,innerContent:ct,source:""};Ue.source=nr(Ue),e.onupdate(Ue)}else{const _e=se(Oe.innerContent);if(_e===Oe.innerContent)return;const Ae={...Oe,innerContent:_e,source:""};Ae.source=nr(Ae),e.onupdate(Ae)}}function P(se,Oe){g(h)&&k(_e=>E4(_e,g(h),se,Oe))}function T(se,Oe){g(h)&&k(_e=>$4(_e,g(h),se,Oe))}function E(se,Oe){return g(h)?g(h).type==="sequence"?g(h).fields.find(_e=>_e.name===se)??null:g(h).type==="delimited"&&Oe?g(h).zones.find(Ae=>Ae.name===Oe)?.fields.find(Ae=>Ae.name===se)??null:null:null}function Q(se){return se.greedy&&se.match!=="any"}function $(se,Oe){if(!g(h))return;const _e=E(se,Oe);_e&&Q(_e)?k(Ae=>q4(Ae,g(h),se,Oe)):k(Ae=>Q4(Ae,g(h),se,Oe))}function L(se,Oe,_e){if(!g(h))return;const Ae=E(se,_e);Ae&&Q(Ae)?k(Qe=>R4(Qe,g(h),se,Oe,_e)):k(Qe=>L4(Qe,g(h),se,Oe,_e))}function I(se,Oe,_e,Ae){if(!g(h))return;const Qe=E(se,Ae);Qe&&Q(Qe)?k(yt=>D4(yt,g(h),se,Oe,_e,Ae)):k(yt=>M4(yt,g(h),se,Oe,_e,Ae))}function Z(se,Oe,_e,Ae){if(!g(h))return;let Qe;if(g(h).type==="sequence"?Qe=g(h).fields.find(jt=>jt.name===se):g(h).type==="delimited"&&_e&&(Qe=g(h).zones.find(en=>en.name===_e)?.fields.find(en=>en.name===se)),!Qe||!Qe.filled)return;const yt=Ae??0;if(yt>=Qe.nodes.length||Ae===void 0&&Qe.nodes.length!==1)return;const ct=Qe.nodes[yt],Ue=ct.source;if(ct.type==="fence"&&e.oneditcode){const jt=ct.fenceCode??"",en=ct.fenceLanguage??"",gt=Ue.split(`
|
|
581
|
-
`)[0],Ut=gt.match(/^(`{3,}|~{3,})/),Bn=Ut?Ut[1]:"```",er={source:Ue,code:jt,language:en,opener:gt,delimiter:Bn};e.oneditcode(jt,en,Oe,er);return}if(!e.oneditfield)return;const wt=Ue.trim();let pt="",at=wt;const _t=wt.match(/^(#{1,6}\s+)(.*)/);if(_t)pt=_t[1],at=_t[2];else{const jt=wt.match(/^(>\s*)(.*)/);jt&&(pt=jt[1],at=jt[2])}const xn={dataName:se,text:Si(at),source:Ue,sourcePrefix:pt,inlineSource:at};e.oneditfield(se,at,Oe,xn)}function Y(se,Oe,_e,Ae){if(!g(h)||!e.oneditfield)return;let Qe;if(g(h).type==="sequence"?Qe=g(h).fields.find(xn=>xn.name===se):g(h).type==="delimited"&&Ae&&(Qe=g(h).zones.find(jt=>jt.name===Ae)?.fields.find(jt=>jt.name===se)),!Qe||!Qe.filled||Qe.nodes.length===0)return;const yt=Qe.nodes[0],ct=uh(yt.source);if(Oe<0||Oe>=ct.length)return;const Ue=ct[Oe],wt=Ue.match(/^([-*+]\s+|\d+\.\s+)/),pt=wt?wt[1]:"",at=wt?Ue.slice(pt.length):Ue,_t={dataName:`${se}[${Oe}]`,text:Si(at),source:Ue,sourcePrefix:pt,inlineSource:at};e.oneditfield(`${se}[${Oe}]`,at,_e,_t)}function ne(se,Oe,_e){if(!g(h))return;let Ae;if(g(h).type==="sequence"?Ae=g(h).fields.find(Ue=>Ue.name===se):g(h).type==="delimited"&&_e&&(Ae=g(h).zones.find(wt=>wt.name===_e)?.fields.find(wt=>wt.name===se)),!Ae||Oe<0||Oe>=Ae.nodes.length)return;const Qe=Ae.nodes[Oe];if(Qe.type!=="rune")return;const ct=g(f).findIndex(Ue=>Ue.source===Qe.source);ct!==-1&&(g(O)?.type==="rune"?q(a,[...g(a),ct],!0):q(a,[ct],!0),q(_,"settings"))}function ae(se){const _e={...e.block,text:se,source:""};_e.source=Og(_e),e.onupdate(_e)}function ie(se){const _e={...e.block,level:se,source:""};_e.source=Og(_e),e.onupdate(_e)}function K(se){const _e={...e.block,attributes:se,source:""};_e.source=nr(_e),e.onupdate(_e)}function he(se){const _e={...e.block,innerContent:se,source:""};_e.source=nr(_e),e.onupdate(_e)}function fe(se){if(!g(O)||!g(O).runeName)return;const Oe=g(O).source,_e=Sf(se);let Ae;if(g(O).selfClosing)Ae=`{% ${g(O).runeName}${_e} /%}`;else{const Ue=(g(O).innerContent??"").trim();Ae=Ue?`{% ${g(O).runeName}${_e} %}
|
|
582
|
-
${Ue}
|
|
583
|
-
{% /${g(O).runeName} %}`:`{% ${g(O).runeName}${_e} %}
|
|
584
|
-
|
|
585
|
-
{% /${g(O).runeName} %}`}const Qe=e.block,yt=Wu(Qe.innerContent,Oe,Ae),ct={...Qe,innerContent:yt,source:""};ct.source=nr(ct),e.onupdate(ct)}function j(se){if(!g(O)||!g(O).runeName)return;const Oe=g(O).source,_e=Sf(g(O).attributes??{}),Ae=se.trim(),Qe=Ae?`{% ${g(O).runeName}${_e} %}
|
|
586
|
-
${Ae}
|
|
587
|
-
{% /${g(O).runeName} %}`:`{% ${g(O).runeName}${_e} %}
|
|
588
|
-
|
|
589
|
-
{% /${g(O).runeName} %}`,yt=e.block,ct=Wu(yt.innerContent,Oe,Qe),Ue={...yt,innerContent:ct,source:""};Ue.source=nr(Ue),e.onupdate(Ue)}function U(se){const _e={...e.block,code:se,source:""};_e.source=Od(_e),e.onupdate(_e)}function ue(se){const _e={...e.block,language:se,source:""};_e.source=Od(_e),e.onupdate(_e)}function ke(se){e.onupdate({...e.block,source:se})}function Ce(se){if(!g(O))return;const Oe=e.block,_e=Wu(Oe.innerContent,g(O).source,se),Ae={...Oe,innerContent:_e,source:""};Ae.source=nr(Ae),e.onupdate(Ae)}function ve(se){g(O)&&Ce(`${"#".repeat(se)} ${g(O).headingText??""}`)}function Ee(se){g(O)&&Ce(`${"#".repeat(g(O).headingLevel??1)} ${se}`)}function rt(se){if(!g(O))return;const Oe=g(O).fenceCode??"";Ce(`\`\`\`${se}
|
|
590
|
-
${Oe}
|
|
591
|
-
\`\`\``)}function Ke(se){if(!g(O))return;const Oe=g(O).fenceLanguage??"";Ce(`\`\`\`${Oe}
|
|
592
|
-
${se}
|
|
593
|
-
\`\`\``)}function Ye(se){Ce(se)}var Ve=hG(),ze=R(Ve),Bt=R(ze),Nn=R(Bt),Jn=R(Nn),bt=D(Nn,2);{var Wt=se=>{var Oe=BU(),_e=R(Oe);ce(()=>Te(_e,g(o))),z(se,Oe)};le(bt,se=>{!g(w)&&g(o)&&se(Wt)})}var mn=D(bt,4);mn.__click=function(...se){e.onremove?.apply(this,se)};var Vn=D(mn,2);Vn.__click=function(...se){e.onclose?.apply(this,se)};var xe=D(Bt,2);{var Wn=se=>{var Oe=XU();Ct(Oe,21,()=>g(x),Yt,(_e,Ae)=>{var Qe=FU();let yt;Qe.__click=()=>q(_,g(Ae),!0);var ct=R(Qe);{var Ue=at=>{var _t=jU();z(at,_t)},wt=at=>{var _t=zU();z(at,_t)},pt=at=>{var _t=ZU();z(at,_t)};le(ct,at=>{g(Ae)==="settings"?at(Ue):g(Ae)==="structure"?at(wt,1):g(Ae)==="content"&&at(pt,2)})}ce(()=>yt=Be(Qe,1,"edit-panel__tab svelte-1t8cclf",null,yt,{active:g(_)===g(Ae)})),z(_e,Qe)}),z(se,Oe)};le(xe,se=>{e.block.type==="rune"&&g(x).length>1&&se(Wn)})}var Lt=D(ze,2);{var Jt=se=>{const Oe=ge(()=>e.block);var _e=aG(),Ae=tt(_e);{var Qe=pt=>{var at=HU(),_t=R(at);{var xn=gt=>{var Ut=an(),Bn=tt(Ut);{var er=Mt=>{var F=VU(),Ze=R(F),un=D(R(Ze),2);un.__change=vr=>ve(Number(vr.target.value));var Sn=R(un);Sn.value=Sn.__value="1";var We=D(Sn);We.value=We.__value="2";var gr=D(We);gr.value=gr.__value="3";var qi=D(gr);qi.value=qi.__value="4";var Mn=D(qi);Mn.value=Mn.__value="5";var ns=D(Mn);ns.value=ns.__value="6";var qn;Mf(un);var $s=D(Ze,2),rs=D(R($s),2);rs.__input=vr=>Ee(vr.target.value),ce(vr=>{qn!==(qn=vr)&&(un.value=(un.__value=vr)??"",gc(un,vr)),sn(rs,g(O).headingText??"")},[()=>String(g(O).headingLevel??1)]),z(Mt,F)},mr=Mt=>{var F=WU(),Ze=R(F),un=D(R(Ze),2);un.__input=Sn=>rt(Sn.target.value),ce(()=>sn(un,g(O).fenceLanguage??"")),z(Mt,F)},cn=Mt=>{var F=YU();z(Mt,F)};le(Bn,Mt=>{g(O).type==="heading"?Mt(er):g(O).type==="fence"?Mt(mr,1):Mt(cn,!1)})}z(gt,Ut)},jt=gt=>{{let Ut=ge(()=>g(O).attributes??{});Kw(gt,{get runeInfo(){return g(b)},get attributes(){return g(Ut)},onchange:fe})}},en=gt=>{var Ut=an(),Bn=tt(Ut);{var er=cn=>{Kw(cn,{get runeInfo(){return g(s)},get attributes(){return g(Oe).attributes},onchange:K})},mr=cn=>{var Mt=GU(),F=R(Mt),Ze=R(F),un=D(F,2);Ct(un,17,()=>Object.entries(g(Oe).attributes),Yt,(Sn,We)=>{var gr=ge(()=>Hc(g(We),2));let qi=()=>g(gr)[0],Mn=()=>g(gr)[1];var ns=UU(),qn=R(ns),$s=R(qn),rs=D(qn,2);rs.__input=vr=>{const H={...g(Oe).attributes,[qi()]:vr.target.value};K(H)},ce(()=>{Te($s,qi()),sn(rs,Mn())}),z(Sn,ns)}),ce(()=>Te(Ze,`Unknown rune: ${g(Oe).runeName??""}`)),z(cn,Mt)};le(Bn,cn=>{g(s)?cn(er):cn(mr,!1)})}z(gt,Ut)};le(_t,gt=>{g(w)&&g(O)?gt(xn):g(O)&&g(b)?gt(jt,1):g(O)||gt(en,2)})}z(pt,at)};le(Ae,pt=>{g(_)==="settings"&&pt(Qe)})}var yt=D(Ae,2);{var ct=pt=>{var at=KU(),_t=R(at);{var xn=en=>{{let gt=ge(()=>g(O)?.runeName??g(Oe).runeName);IU(en,{get structure(){return g(h)},get rootLabel(){return g(gt)},onaddfield:P,onremovefield:T,onappenditem:$,onremovelistitem:L,onreorderlistitem:I,oneditfield:Z,oneditlistitem:Y,onnavigaterune:ne,onfieldselect:y,get selectedField(){return g(m)}})}},jt=en=>{{let gt=ge(()=>g(a).length===0);QP(en,{get nodes(){return g(l)},get activePath(){return g(a)},onselect:A,get rootLabel(){return g(Oe).runeName},onrootclick:C,get isRootActive(){return g(gt)}})}};le(_t,en=>{g(d)&&g(h)?en(xn):!g(O)&&g(c)&&en(jt,1)})}z(pt,at)};le(yt,pt=>{g(_)==="structure"&&pt(ct)})}var Ue=D(yt,2);{var wt=pt=>{var at=oG(),_t=R(at);{var xn=gt=>{var Ut=an(),Bn=tt(Ut);{var er=F=>{var Ze=JU(),un=R(Ze);{let Sn=ge(()=>g(O).fenceCode??"");_o(un,{get content(){return g(Sn)},onchange:Ke,get language(){return g(O).fenceLanguage},get runes(){return e.runes},aggregated:()=>t()})}z(F,Ze)},mr=F=>{var Ze=eG(),un=R(Ze);_o(un,{get content(){return g(O).source},onchange:Ye,get runes(){return e.runes},aggregated:()=>t()}),z(F,Ze)},cn=F=>{var Ze=tG();z(F,Ze)},Mt=F=>{var Ze=nG(),un=R(Ze),Sn=D(R(un),2);Sn.__input=We=>Ye(We.target.value),ce(We=>{sn(Sn,g(O).source),St(Sn,"rows",We)},[()=>Math.max(4,g(O).source.split(`
|
|
594
|
-
`).length)]),z(F,Ze)};le(Bn,F=>{g(O).type==="fence"?F(er):g(O).type==="paragraph"?F(mr,1):g(O).type==="heading"?F(cn,2):F(Mt,!1)})}z(gt,Ut)},jt=gt=>{var Ut=an(),Bn=tt(Ut);{var er=cn=>{var Mt=rG(),F=R(Mt);_o(F,{get content(){return g(O).innerContent},onchange:j,get runes(){return e.runes},aggregated:()=>t()}),z(cn,Mt)},mr=cn=>{var Mt=iG();z(cn,Mt)};le(Bn,cn=>{!g(O).selfClosing&&g(O).innerContent!==void 0?cn(er):cn(mr,!1)})}z(gt,Ut)},en=gt=>{var Ut=sG(),Bn=R(Ut);_o(Bn,{get content(){return g(Oe).innerContent},onchange:he,get runes(){return e.runes},aggregated:()=>t()}),z(gt,Ut)};le(_t,gt=>{g(w)&&g(O)?gt(xn):g(O)&&g(b)?gt(jt,1):g(O)||gt(en,2)})}z(pt,at)};le(Ue,pt=>{g(_)==="content"&&!g(Oe).selfClosing&&pt(wt)})}z(se,_e)},_n=se=>{var Oe=dG(),_e=R(Oe);{var Ae=Ue=>{const wt=ge(()=>e.block);var pt=lG(),at=R(pt),_t=D(R(at),2);_t.__change=Mt=>ie(Number(Mt.target.value));var xn=R(_t);xn.value=xn.__value="1";var jt=D(xn);jt.value=jt.__value="2";var en=D(jt);en.value=en.__value="3";var gt=D(en);gt.value=gt.__value="4";var Ut=D(gt);Ut.value=Ut.__value="5";var Bn=D(Ut);Bn.value=Bn.__value="6";var er;Mf(_t);var mr=D(at,2),cn=D(R(mr),2);cn.__input=Mt=>ae(Mt.target.value),ce(Mt=>{er!==(er=Mt)&&(_t.value=(_t.__value=Mt)??"",gc(_t,Mt)),sn(cn,g(wt).text)},[()=>String(g(wt).level)]),z(Ue,pt)},Qe=Ue=>{const wt=ge(()=>e.block);var pt=cG(),at=tt(pt),_t=R(at),xn=D(R(_t),2);xn.__input=gt=>ue(gt.target.value);var jt=D(at,2),en=R(jt);_o(en,{get content(){return g(wt).code},onchange:U,get language(){return g(wt).language},get runes(){return e.runes},aggregated:()=>t()}),ce(()=>sn(xn,g(wt).language)),z(Ue,pt)},yt=Ue=>{var wt=uG(),pt=R(wt);_o(pt,{get content(){return e.block.source},onchange:ke,get runes(){return e.runes},aggregated:()=>t()}),z(Ue,wt)},ct=Ue=>{var wt=fG(),pt=R(wt),at=D(R(pt),2);at.__input=_t=>ke(_t.target.value),ce(_t=>{sn(at,e.block.source),St(at,"rows",_t)},[()=>Math.max(4,e.block.source.split(`
|
|
595
|
-
`).length)]),z(Ue,wt)};le(_e,Ue=>{e.block.type==="heading"?Ue(Ae):e.block.type==="fence"?Ue(Qe,1):e.block.type==="paragraph"?Ue(yt,2):Ue(ct,!1)})}z(se,Oe)};le(Lt,se=>{e.block.type==="rune"?se(Jt):se(_n,!1)})}ce(()=>Te(Jn,g(S))),z(n,Ve),ht()}Vt(["click","change","input"]);var mG=W('<div draggable="true"><span class="structure-item__drag svelte-1lv3l5p" title="Drag to reorder"><svg width="8" height="12" viewBox="0 0 8 12" fill="currentColor"><circle cx="2" cy="2" r="1"></circle><circle cx="6" cy="2" r="1"></circle><circle cx="2" cy="6" r="1"></circle><circle cx="6" cy="6" r="1"></circle><circle cx="2" cy="10" r="1"></circle><circle cx="6" cy="10" r="1"></circle></svg></span> <span class="structure-item__icon svelte-1lv3l5p"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><!></svg></span> <span class="structure-item__info svelte-1lv3l5p"><span class="structure-item__type svelte-1lv3l5p"> </span> <span class="structure-item__preview svelte-1lv3l5p"> </span></span> <button class="structure-item__remove svelte-1lv3l5p" title="Remove"><svg width="12" height="12" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><line x1="4" y1="4" x2="12" y2="12"></line><line x1="12" y1="4" x2="4" y2="12"></line></svg></button></div>'),gG=W('<div class="edit-panel__tab-panel svelte-1lv3l5p"><div class="structure-list svelte-1lv3l5p"></div></div>'),vG=W('<div class="edit-panel__tab-panel svelte-1lv3l5p"><div class="edit-panel__content-editor svelte-1lv3l5p"><!></div></div>'),OG=W('<div class="edit-panel svelte-1lv3l5p"><div class="edit-panel__top svelte-1lv3l5p"><div class="edit-panel__header svelte-1lv3l5p"><span class="edit-panel__type svelte-1lv3l5p">prose</span> <span class="edit-panel__count svelte-1lv3l5p"> </span> <div class="edit-panel__spacer svelte-1lv3l5p"></div> <button class="edit-panel__btn edit-panel__btn--danger svelte-1lv3l5p" title="Remove block"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><polyline points="3 6 3 14 13 14 13 6"></polyline><line x1="1" y1="4" x2="15" y2="4"></line><line x1="6" y1="2" x2="10" y2="2"></line><line x1="6" y1="8" x2="6" y2="12"></line><line x1="10" y1="8" x2="10" y2="12"></line></svg></button> <button class="edit-panel__btn svelte-1lv3l5p" title="Close panel">×</button></div> <div class="edit-panel__tabs svelte-1lv3l5p"><button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 3h4M2 7h4M6 11h4M6 15h4M4 3v8M8 11v4"></path></svg> Structure</button> <button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M2 4h12M2 8h12M2 12h8"></path></svg> Content</button></div></div> <!> <!></div>');function bG(n,e){dt(e,!0);let t=xt(e,"aggregated",19,()=>({})),r=J("structure");function i($){switch($.type){case"heading":return $.text;case"paragraph":return $.source.length>60?$.source.slice(0,60)+"...":$.source;case"fence":{const L=$,I=L.language?`${L.language}: `:"",Z=L.code.split(`
|
|
596
|
-
`)[0]??"";return I+(Z.length>50?Z.slice(0,50)+"...":Z)}case"list":return $.source.split(`
|
|
597
|
-
`)[0]??"";case"quote":return $.source.replace(/^>\s*/gm,"").split(`
|
|
598
|
-
`)[0]??"";case"hr":return"---";case"image":return $.source;default:return $.source.split(`
|
|
599
|
-
`)[0]??""}}function s($){switch($.type){case"heading":return'<path d="M3 3v10M13 3v10M3 8h10" />';case"paragraph":return'<path d="M2 4h12M2 8h12M2 12h8" />';case"fence":return'<polyline points="4 6 1 9 4 12" /><polyline points="12 6 15 9 12 12" />';case"list":return'<circle cx="3" cy="4" r="1" fill="currentColor" /><line x1="6" y1="4" x2="14" y2="4" /><circle cx="3" cy="8" r="1" fill="currentColor" /><line x1="6" y1="8" x2="14" y2="8" /><circle cx="3" cy="12" r="1" fill="currentColor" /><line x1="6" y1="12" x2="14" y2="12" />';case"quote":return'<path d="M3 5h10M5 5v8M5 9h6" />';case"hr":return'<line x1="2" y1="8" x2="14" y2="8" />';case"image":return'<rect x="2" y="2" width="12" height="12" rx="1" /><circle cx="5.5" cy="5.5" r="1.5" /><path d="M14 10l-3-3-5 5" />';default:return'<path d="M2 4h12M2 8h12M2 12h8" />'}}let o=J(null),a=J(null);function l($,L){q(o,L,!0),$.dataTransfer&&($.dataTransfer.effectAllowed="move",$.dataTransfer.setData("text/plain",String(L)))}function c($,L){$.preventDefault(),$.dataTransfer&&($.dataTransfer.dropEffect="move"),q(a,L,!0)}function u($,L){$.preventDefault(),g(o)!==null&&g(o)!==L&&d(g(o),L),q(o,null),q(a,null)}function f(){q(o,null),q(a,null)}function d($,L){const I=[...e.block.children],[Z]=I.splice($,1);I.splice(L,0,Z);const Y=vg(I);e.onupdate({...e.block,children:I,source:Y})}function h($){const L=e.block.children.filter((Z,Y)=>Y!==$);if(L.length===0){e.onremove();return}const I=vg(L);e.onupdate({...e.block,children:L,source:I})}function m($){if(!$.trim()){e.onremove();return}const L=sC($);e.onupdate({...e.block,children:L,source:$})}var p=OG(),v=R(p),O=R(v),b=D(R(O),2),w=R(b),S=D(b,4);S.__click=function(...$){e.onremove?.apply(this,$)};var _=D(S,2);_.__click=function(...$){e.onclose?.apply(this,$)};var x=D(O,2),A=R(x);let C;A.__click=()=>q(r,"structure");var y=D(A,2);let k;y.__click=()=>q(r,"content");var P=D(v,2);{var T=$=>{var L=gG(),I=R(L);Ct(I,23,()=>e.block.children,Z=>Z.id,(Z,Y,ne)=>{var ae=mG();let ie;var K=D(R(ae),2),he=R(K),fe=R(he);V_(fe,()=>s(g(Y)),!0);var j=D(K,2),U=R(j),ue=R(U),ke=D(U,2),Ce=R(ke),ve=D(j,2);ve.__click=()=>h(g(ne)),ce((Ee,rt)=>{ie=Be(ae,1,"structure-item svelte-1lv3l5p",null,ie,{"drag-source":g(o)===g(ne),"drag-over":g(a)===g(ne)&&g(o)!==g(ne)}),Te(ue,Ee),Te(Ce,rt)},[()=>zO(g(Y)),()=>i(g(Y))]),st("dragstart",ae,Ee=>l(Ee,g(ne))),st("dragover",ae,Ee=>c(Ee,g(ne))),st("drop",ae,Ee=>u(Ee,g(ne))),st("dragend",ae,f),z(Z,ae)}),z($,L)};le(P,$=>{g(r)==="structure"&&$(T)})}var E=D(P,2);{var Q=$=>{var L=vG(),I=R(L),Z=R(I);_o(Z,{get content(){return e.block.source},onchange:m,get runes(){return e.runes},aggregated:()=>t()}),z($,L)};le(E,$=>{g(r)==="content"&&$(Q)})}ce(()=>{Te(w,`${e.block.children.length??""} block${e.block.children.length!==1?"s":""}`),C=Be(A,1,"edit-panel__tab svelte-1lv3l5p",null,C,{active:g(r)==="structure"}),k=Be(y,1,"edit-panel__tab svelte-1lv3l5p",null,k,{active:g(r)==="content"})}),z(n,p),ht()}Vt(["click"]);var yG=W('<div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w"> </span> <div class="edit-panel__custom-row svelte-1wxsk8w"><input class="edit-panel__input svelte-1wxsk8w" type="text"/> <button class="edit-panel__remove-btn svelte-1wxsk8w">×</button></div></div>'),wG=W('<div class="edit-panel__custom-section svelte-1wxsk8w"><span class="edit-panel__section-label svelte-1wxsk8w">Custom fields</span> <!></div>'),_G=W('<div class="edit-panel svelte-1wxsk8w"><div class="edit-panel__header svelte-1wxsk8w"><span class="edit-panel__type svelte-1wxsk8w">Frontmatter</span> <div class="edit-panel__spacer svelte-1wxsk8w"></div> <button class="edit-panel__btn svelte-1wxsk8w" title="Close panel">×</button></div> <div class="edit-panel__body svelte-1wxsk8w"><div class="edit-panel__field-group svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Title</span> <input class="edit-panel__input svelte-1wxsk8w" type="text"/></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Description</span> <textarea class="edit-panel__textarea svelte-1wxsk8w"></textarea></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Slug</span> <input class="edit-panel__input svelte-1wxsk8w" type="text" placeholder="auto-derived from filename"/></label> <div class="edit-panel__row svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Author</span> <input class="edit-panel__input svelte-1wxsk8w" type="text"/></label> <label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Date</span> <input class="edit-panel__input svelte-1wxsk8w" type="date"/></label></div> <div class="edit-panel__row svelte-1wxsk8w"><label class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Order</span> <input class="edit-panel__input svelte-1wxsk8w" type="number"/></label> <div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Draft</span> <div role="switch" tabindex="0"><div class="fm-toggle__track svelte-1wxsk8w"><div class="fm-toggle__thumb svelte-1wxsk8w"></div></div> <span class="fm-toggle__label svelte-1wxsk8w"> </span></div></div></div> <div class="edit-panel__field svelte-1wxsk8w"><span class="edit-panel__field-label svelte-1wxsk8w">Tags</span> <!></div> <!> <div class="edit-panel__add-field svelte-1wxsk8w"><input class="edit-panel__input svelte-1wxsk8w" type="text" placeholder="Field name"/> <button class="edit-panel__add-btn svelte-1wxsk8w">+ Add field</button></div></div></div></div>');function kG(n,e){dt(e,!0);const t=new Set(["title","description","tags","draft","order","date","author","slug"]);let r=J(""),i=ge(()=>Object.entries(X.frontmatter).filter(([K])=>!t.has(K)));function s(K,he){X.updateFrontmatterField(K,he)}function o(){const K=g(r).trim();!K||K in X.frontmatter||(X.updateFrontmatterField(K,""),q(r,""))}function a(K){X.updateFrontmatterField(K,void 0)}var l=_G(),c=R(l),u=D(R(c),4);u.__click=function(...K){e.onclose?.apply(this,K)};var f=D(c,2),d=R(f),h=R(d),m=D(R(h),2);m.__input=K=>s("title",K.target.value);var p=D(h,2),v=D(R(p),2);v.__input=K=>s("description",K.target.value),St(v,"rows",2);var O=D(p,2),b=D(R(O),2);b.__input=K=>s("slug",K.target.value);var w=D(O,2),S=R(w),_=D(R(S),2);_.__input=K=>s("author",K.target.value);var x=D(S,2),A=D(R(x),2);A.__input=K=>s("date",K.target.value);var C=D(w,2),y=R(C),k=D(R(y),2);k.__input=K=>{const he=K.target.value;s("order",he===""?void 0:Number(he))};var P=D(y,2),T=D(R(P),2);let E;T.__click=()=>s("draft",X.frontmatter.draft===!0?void 0:!0),T.__keydown=K=>{(K.key==="Enter"||K.key===" ")&&(K.preventDefault(),s("draft",X.frontmatter.draft===!0?void 0:!0))};var Q=D(R(T),2),$=R(Q),L=D(C,2),I=D(R(L),2);{let K=ge(()=>X.frontmatter.tags??[]);Vk(I,{get tags(){return g(K)},onchange:he=>s("tags",he)})}var Z=D(L,2);{var Y=K=>{var he=wG(),fe=D(R(he),2);Ct(fe,17,()=>g(i),Yt,(j,U)=>{var ue=ge(()=>Hc(g(U),2));let ke=()=>g(ue)[0],Ce=()=>g(ue)[1];var ve=yG(),Ee=R(ve),rt=R(Ee),Ke=D(Ee,2),Ye=R(Ke);Ye.__input=ze=>s(ke(),ze.target.value);var Ve=D(Ye,2);Ve.__click=()=>a(ke()),ce(ze=>{Te(rt,ke()),sn(Ye,ze),St(Ve,"aria-label",`Remove ${ke()??""}`)},[()=>String(Ce()??"")]),z(j,ve)}),z(K,he)};le(Z,K=>{g(i).length>0&&K(Y)})}var ne=D(Z,2),ae=R(ne);ae.__keydown=K=>{K.key==="Enter"&&(K.preventDefault(),o())};var ie=D(ae,2);ie.__click=o,ce(K=>{sn(m,X.frontmatter.title??""),sn(v,X.frontmatter.description??""),sn(b,X.frontmatter.slug??""),sn(_,X.frontmatter.author??""),sn(A,X.frontmatter.date??""),sn(k,X.frontmatter.order??""),E=Be(T,1,"fm-toggle svelte-1wxsk8w",null,E,{active:X.frontmatter.draft===!0}),St(T,"aria-checked",X.frontmatter.draft===!0),Te($,X.frontmatter.draft===!0?"Draft":"Published"),ie.disabled=K},[()=>!g(r).trim()]),Qn(ae,()=>g(r),K=>q(r,K)),z(n,l),ht()}Vt(["click","input","keydown"]);var xG=W('<button type="button"> </button>'),SG=W('<div class="insert-dialog__tabs svelte-gvk8wi"></div>'),AG=W('<div class="insert-dialog__empty svelte-gvk8wi"> </div>'),CG=W('<span class="insert-dialog__rune-desc svelte-gvk8wi"> </span>'),TG=W('<button class="insert-dialog__btn insert-dialog__btn--rune svelte-gvk8wi"><span class="insert-dialog__rune-dot svelte-gvk8wi"></span> <span class="insert-dialog__rune-info svelte-gvk8wi"><span class="insert-dialog__rune-name svelte-gvk8wi"> </span> <!></span></button>'),PG=W('<div class="insert-dialog__grid svelte-gvk8wi"></div>'),EG=W('<button class="insert-dialog__btn svelte-gvk8wi"><svg class="insert-dialog__btn-icon svelte-gvk8wi" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path></path></svg> <span class="insert-dialog__btn-info svelte-gvk8wi"><span class="insert-dialog__btn-name svelte-gvk8wi"> </span> <span class="insert-dialog__btn-desc svelte-gvk8wi"> </span></span></button>'),$G=W('<span class="insert-dialog__rune-desc svelte-gvk8wi"> </span>'),QG=W('<button class="insert-dialog__btn insert-dialog__btn--rune svelte-gvk8wi"><span class="insert-dialog__rune-dot svelte-gvk8wi"></span> <span class="insert-dialog__rune-info svelte-gvk8wi"><span class="insert-dialog__rune-name svelte-gvk8wi"> </span> <!></span></button>'),LG=W('<div class="insert-dialog__grid svelte-gvk8wi"><!> <!></div>'),MG=W('<dialog class="insert-dialog svelte-gvk8wi"><div class="insert-dialog__inner svelte-gvk8wi"><div class="insert-dialog__header svelte-gvk8wi"><h2 class="insert-dialog__title svelte-gvk8wi">Insert Block</h2> <div class="insert-dialog__search-wrap svelte-gvk8wi"><svg class="insert-dialog__search-icon svelte-gvk8wi" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><circle cx="7" cy="7" r="4.5"></circle><path d="M10.5 10.5L14 14"></path></svg> <input class="insert-dialog__search svelte-gvk8wi" type="text" placeholder="Search blocks..."/></div> <button class="insert-dialog__close svelte-gvk8wi"><svg width="16" height="16" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><path d="M4 4l8 8M12 4l-8 8"></path></svg></button></div> <!> <div class="insert-dialog__body svelte-gvk8wi"><!></div></div></dialog>');function qG(n,e){dt(e,!0);const t=["Content","Section","Layout","Code & Data","Semantic","Design","Site"];let r=J("Content"),i=J(""),s,o,a=ge(()=>{const y=new Set(e.runesByCategory.keys()),k=t.filter(P=>y.has(P));for(const P of y)k.includes(P)||k.push(P);return k}),l=ge(()=>{if(!g(i).trim())return null;const y=g(i).toLowerCase();return e.runes.filter(k=>k.name.toLowerCase().includes(y)||k.description&&k.description.toLowerCase().includes(y))});const c=[{type:"heading",name:"Heading",description:"Section heading",icon:"M3 3v10M13 3v10M3 8h10"},{type:"paragraph",name:"Paragraph",description:"Body text",icon:"M2 4h12M2 8h12M2 12h8"},{type:"fence",name:"Code Block",description:"Fenced code",icon:"M5 4L2 8l3 4M11 4l3 4-3 4"},{type:"hr",name:"Divider",description:"Horizontal rule",icon:"M2 8h12"}];hn(()=>{s?.showModal(),o?.focus()});function u(y){y.target===s&&e.onclose()}function f(y){e.oninsert(y)}function d(y){e.oninsert("rune",y)}var h=MG();h.__click=u,h.__keydown=y=>{y.key==="Escape"&&(y.preventDefault(),e.onclose())};var m=R(h),p=R(m),v=D(R(p),2),O=D(R(v),2);ln(O,y=>o=y,()=>o);var b=D(v,2);b.__click=function(...y){e.onclose?.apply(this,y)};var w=D(p,2);{var S=y=>{var k=SG();Ct(k,21,()=>g(a),Yt,(P,T)=>{var E=xG();let Q;E.__click=()=>q(r,g(T),!0);var $=R(E);ce(()=>{Q=Be(E,1,"insert-dialog__tab svelte-gvk8wi",null,Q,{active:g(r)===g(T)}),Te($,g(T))}),z(P,E)}),z(y,k)};le(w,y=>{g(l)||y(S)})}var _=D(w,2),x=R(_);{var A=y=>{var k=an(),P=tt(k);{var T=Q=>{var $=AG(),L=R($);ce(()=>Te(L,`No blocks match "${g(i)??""}"`)),z(Q,$)},E=Q=>{var $=PG();Ct($,21,()=>g(l),Yt,(L,I)=>{var Z=TG();Z.__click=()=>d(g(I).name);var Y=D(R(Z),2),ne=R(Y),ae=R(ne),ie=D(ne,2);{var K=he=>{var fe=CG(),j=R(fe);ce(()=>Te(j,g(I).description)),z(he,fe)};le(ie,he=>{g(I).description&&he(K)})}ce(()=>Te(ae,g(I).name)),z(L,Z)}),z(Q,$)};le(P,Q=>{g(l).length===0?Q(T):Q(E,!1)})}z(y,k)},C=y=>{var k=LG(),P=R(k);{var T=Q=>{var $=an(),L=tt($);Ct(L,17,()=>c,Yt,(I,Z)=>{var Y=EG();Y.__click=()=>f(g(Z).type);var ne=R(Y),ae=R(ne),ie=D(ne,2),K=R(ie),he=R(K),fe=D(K,2),j=R(fe);ce(()=>{St(ae,"d",g(Z).icon),Te(he,g(Z).name),Te(j,g(Z).description)}),z(I,Y)}),z(Q,$)};le(P,Q=>{g(r)==="Content"&&Q(T)})}var E=D(P,2);Ct(E,17,()=>e.runesByCategory.get(g(r))??[],Yt,(Q,$)=>{var L=QG();L.__click=()=>d(g($).name);var I=D(R(L),2),Z=R(I),Y=R(Z),ne=D(Z,2);{var ae=ie=>{var K=$G(),he=R(K);ce(()=>Te(he,g($).description)),z(ie,K)};le(ne,ie=>{g($).description&&ie(ae)})}ce(()=>Te(Y,g($).name)),z(Q,L)}),z(y,k)};le(x,y=>{g(l)?y(A):y(C,!1)})}ln(h,y=>s=y,()=>s),st("close",h,function(...y){e.onclose?.apply(this,y)}),Qn(O,()=>g(i),y=>q(i,y)),z(n,h),ht()}Vt(["click","keydown"]);var RG=W('<div class="inline-edit-popover__link-editor svelte-1c50n5q"><div class="inline-edit-popover__link-row svelte-1c50n5q"><label class="inline-edit-popover__link-label svelte-1c50n5q">Text</label> <input class="inline-edit-popover__link-input svelte-1c50n5q" type="text"/></div> <div class="inline-edit-popover__link-row svelte-1c50n5q"><label class="inline-edit-popover__link-label svelte-1c50n5q">URL</label> <input class="inline-edit-popover__link-input svelte-1c50n5q" type="text" placeholder="https://..."/></div> <div class="inline-edit-popover__link-actions svelte-1c50n5q"><button class="inline-edit-popover__link-btn inline-edit-popover__link-btn--apply svelte-1c50n5q">Apply</button> <button class="inline-edit-popover__link-btn inline-edit-popover__link-btn--remove svelte-1c50n5q">Remove link</button></div></div>'),DG=W('<div><div class="inline-edit-popover__header svelte-1c50n5q"><span class="inline-edit-popover__label svelte-1c50n5q"> </span> <button class="inline-edit-popover__close svelte-1c50n5q" aria-label="Close">×</button></div> <div class="inline-edit-popover__toolbar svelte-1c50n5q"><button title="Bold (Ctrl+B)"><strong>B</strong></button> <button title="Italic (Ctrl+I)"><em>I</em></button> <button title="Inline code"></></button> <button class="inline-edit-popover__tool-btn svelte-1c50n5q" title="Link (Ctrl+K)"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M6.5 9.5a3 3 0 0 0 4.2.3l2-2a3 3 0 0 0-4.2-4.3l-1.1 1.1"></path><path d="M9.5 6.5a3 3 0 0 0-4.2-.3l-2 2a3 3 0 0 0 4.2 4.3l1.1-1.1"></path></svg></button></div> <div class="inline-edit-popover__editable svelte-1c50n5q" contenteditable="true"></div> <!></div>');function Jw(n,e){dt(e,!0);let t,r,i=J(0),s=J(0),o=J(!0),a=J(null),l=J(void 0),c;ao(()=>{r.innerHTML=_z(e.inlineSource);const j=t.getBoundingClientRect(),U=j.width,ue=j.height,ke=8;let Ce=e.anchorRect.left+e.anchorRect.width/2-U/2;Ce<ke&&(Ce=ke),Ce+U>window.innerWidth-ke&&(Ce=window.innerWidth-U-ke),q(i,Ce,!0);const ve=e.anchorRect.top-ue-ke;ve>=ke?(q(s,ve),q(o,!0)):(q(s,e.anchorRect.bottom+ke),q(o,!1)),r.focus();const Ee=window.getSelection();if(Ee&&r.childNodes.length>0){const Ye=document.createRange();Ye.selectNodeContents(r),Ye.collapse(!1),Ee.removeAllRanges(),Ee.addRange(Ye)}function rt(Ye){t&&!t.contains(Ye.target)&&e.onclose()}function Ke(Ye){Ye.key==="Escape"&&(g(a)?q(a,null):e.onclose())}return requestAnimationFrame(()=>{document.addEventListener("mousedown",rt)}),document.addEventListener("keydown",Ke),()=>{document.removeEventListener("mousedown",rt),document.removeEventListener("keydown",Ke),clearTimeout(c)}});function u(){clearTimeout(c),c=setTimeout(()=>{E0(r);const j=xz(r);e.onchange(j)},100)}function f(j){if(j.key==="Enter"){j.preventDefault();return}(j.metaKey||j.ctrlKey)&&(j.key==="b"?(j.preventDefault(),m("bold")):j.key==="i"?(j.preventDefault(),m("italic")):j.key==="k"&&(j.preventDefault(),p()))}function d(j){j.preventDefault();const U=j.clipboardData?.getData("text/plain")??"";document.execCommand("insertText",!1,U)}function h(j){const ue=j.target.closest("a");ue&&r.contains(ue)&&(j.preventDefault(),v(ue))}function m(j){r.focus();const U=window.getSelection();if(!(!U||U.rangeCount===0)){if(j==="code"){const ue=U.getRangeAt(0);if(ue.collapsed)return;const ke=C(ue.commonAncestorContainer,"CODE",r);if(ke){const Ce=document.createTextNode(ke.textContent??"");ke.replaceWith(Ce);const ve=document.createRange();ve.selectNode(Ce),U.removeAllRanges(),U.addRange(ve)}else{const Ce=document.createElement("code");Ce.textContent=ue.toString(),ue.deleteContents(),ue.insertNode(Ce);const ve=document.createRange();ve.selectNodeContents(Ce),U.removeAllRanges(),U.addRange(ve)}}else{const ue=j==="bold"?"bold":"italic";document.execCommand(ue,!1)}E0(r),u()}}function p(){const j=window.getSelection();if(!j||j.rangeCount===0)return;const U=j.getRangeAt(0),ue=C(U.commonAncestorContainer,"A",r);if(ue){v(ue);return}if(U.collapsed)return;const ke=U.toString(),Ce=document.createElement("a");Ce.href="",Ce.textContent=ke,U.deleteContents(),U.insertNode(Ce),v(Ce)}function v(j){q(a,{anchorEl:j,href:j.getAttribute("href")??"",text:j.textContent??"",rect:j.getBoundingClientRect()},!0),requestAnimationFrame(()=>{g(l)?.focus(),g(l)?.select()})}function O(){g(a)&&(g(a).anchorEl.href=g(a).href,g(a).anchorEl.textContent=g(a).text,q(a,null),r.focus(),u())}function b(){if(!g(a))return;const j=document.createTextNode(g(a).anchorEl.textContent??"");g(a).anchorEl.replaceWith(j),q(a,null),r.focus(),u()}function w(j){j.key==="Enter"&&(j.preventDefault(),O())}let S=J(!1),_=J(!1),x=J(!1);function A(){q(S,document.queryCommandState("bold"),!0),q(_,document.queryCommandState("italic"),!0);const j=window.getSelection();j&&j.rangeCount>0?q(x,!!C(j.getRangeAt(0).commonAncestorContainer,"CODE",r)):q(x,!1)}function C(j,U,ue){let ke=j;for(;ke&&ke!==ue;){if(ke.nodeType===globalThis.Node.ELEMENT_NODE&&ke.tagName===U)return ke;ke=ke.parentNode}return null}var y=DG();let k;var P=R(y),T=R(P),E=R(T),Q=D(T,2);Q.__click=function(...j){e.onclose?.apply(this,j)};var $=D(P,2),L=R($);let I;L.__click=()=>m("bold");var Z=D(L,2);let Y;Z.__click=()=>m("italic");var ne=D(Z,2);let ae;ne.__click=()=>m("code");var ie=D(ne,2);ie.__click=p;var K=D($,2);K.__input=u,K.__keydown=f,K.__keyup=A,K.__mouseup=A,K.__click=h,ln(K,j=>r=j,()=>r);var he=D(K,2);{var fe=j=>{var U=RG(),ue=R(U),ke=D(R(ue),2);ke.__keydown=w;var Ce=D(ue,2),ve=D(R(Ce),2);ve.__keydown=w,ln(ve,Ye=>q(l,Ye),()=>g(l));var Ee=D(Ce,2),rt=R(Ee);rt.__click=O;var Ke=D(rt,2);Ke.__click=b,Qn(ke,()=>g(a).text,Ye=>g(a).text=Ye),Qn(ve,()=>g(a).href,Ye=>g(a).href=Ye),z(j,U)};le(he,j=>{g(a)&&j(fe)})}ln(y,j=>t=j,()=>t),ce(()=>{k=Be(y,1,"inline-edit-popover svelte-1c50n5q",null,k,{above:g(o),below:!g(o)}),Er(y,`left: ${g(i)??""}px; top: ${g(s)??""}px`),Te(E,e.dataName),I=Be(L,1,"inline-edit-popover__tool-btn svelte-1c50n5q",null,I,{active:g(S)}),Y=Be(Z,1,"inline-edit-popover__tool-btn svelte-1c50n5q",null,Y,{active:g(_)}),ae=Be(ne,1,"inline-edit-popover__tool-btn inline-edit-popover__tool-btn--code svelte-1c50n5q",null,ae,{active:g(x)})}),st("paste",K,d),z(n,y),ht()}Vt(["click","input","keydown","keyup","mouseup"]);var IG=W('<div><div class="action-edit-popover__header svelte-15w9shn"><span class="action-edit-popover__label svelte-15w9shn">action</span> <button class="action-edit-popover__close svelte-15w9shn" aria-label="Close">×</button></div> <div class="action-edit-popover__row svelte-15w9shn"><label class="action-edit-popover__field-label svelte-15w9shn">Text</label> <input class="action-edit-popover__input svelte-15w9shn" type="text"/></div> <div class="action-edit-popover__row svelte-15w9shn"><label class="action-edit-popover__field-label svelte-15w9shn">URL</label> <input class="action-edit-popover__input svelte-15w9shn" type="text" placeholder="https://..."/></div> <div class="action-edit-popover__actions svelte-15w9shn"><button class="action-edit-popover__btn action-edit-popover__btn--apply svelte-15w9shn">Apply</button> <button class="action-edit-popover__btn action-edit-popover__btn--remove svelte-15w9shn">Remove</button></div></div>');function NG(n,e){dt(e,!0);let t,r,i=J(0),s=J(0),o=J(!0),a=J(Ht(e.text)),l=J(Ht(e.href));ao(()=>{const x=t.getBoundingClientRect(),A=x.width,C=x.height,y=8;let k=e.anchorRect.left+e.anchorRect.width/2-A/2;k<y&&(k=y),k+A>window.innerWidth-y&&(k=window.innerWidth-A-y),q(i,k,!0);const P=e.anchorRect.top-C-y;P>=y?(q(s,P),q(o,!0)):(q(s,e.anchorRect.bottom+y),q(o,!1)),r?.focus(),r?.select();function T(Q){t&&!t.contains(Q.target)&&c()}function E(Q){Q.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("mousedown",T)}),document.addEventListener("keydown",E),()=>{document.removeEventListener("mousedown",T),document.removeEventListener("keydown",E)}});function c(){(g(a)!==e.text||g(l)!==e.href)&&e.onchange(g(a),g(l)),e.onclose()}function u(x){x.key==="Enter"&&(x.preventDefault(),c())}var f=IG();let d;var h=R(f),m=D(R(h),2);m.__click=function(...x){e.onclose?.apply(this,x)};var p=D(h,2),v=D(R(p),2);v.__keydown=u,ln(v,x=>r=x,()=>r);var O=D(p,2),b=D(R(O),2);b.__keydown=u;var w=D(O,2),S=R(w);S.__click=c;var _=D(S,2);_.__click=function(...x){e.onremove?.apply(this,x)},ln(f,x=>t=x,()=>t),ce(()=>{d=Be(f,1,"action-edit-popover svelte-15w9shn",null,d,{above:g(o),below:!g(o)}),Er(f,`left: ${g(i)??""}px; top: ${g(s)??""}px`)}),Qn(v,()=>g(a),x=>q(a,x)),Qn(b,()=>g(l),x=>q(l,x)),z(n,f),ht()}Vt(["click","keydown"]);var BG=W("<option> </option>"),jG=W('<div><div class="code-edit-popover__header svelte-rmoejq"><span class="code-edit-popover__label svelte-rmoejq">code</span> <button class="code-edit-popover__close svelte-rmoejq" aria-label="Close">×</button></div> <div class="code-edit-popover__toolbar svelte-rmoejq"><select class="code-edit-popover__lang-select svelte-rmoejq"><option>No language</option><!></select></div> <div class="code-edit-popover__editor svelte-rmoejq"></div> <div class="code-edit-popover__actions svelte-rmoejq"><button class="code-edit-popover__btn code-edit-popover__btn--apply svelte-rmoejq">Apply</button> <button class="code-edit-popover__btn code-edit-popover__btn--remove svelte-rmoejq">Remove</button></div></div>');function zG(n,e){dt(e,!0);const t=["bash","sh","shell","javascript","typescript","python","html","css","json","yaml","markdown","markdoc","go","rust","java","c","cpp","ruby","php","sql","swift","kotlin","dart","lua","r","perl","scala","haskell","elixir","toml","xml","graphql","dockerfile","diff","plaintext"];let r,i,s=J(void 0),o=J(0),a=J(0),l=J(!0),c=J(Ht(e.code)),u=J(Ht(e.language));const f=new ws,d=new ws,h=yl.define([{tag:N.keyword,color:"#8839ef"},{tag:[N.atom,N.bool],color:"#fe640b"},{tag:N.number,color:"#fe640b"},{tag:[N.string,N.special(N.string)],color:"#40a02b"},{tag:[N.regexp,N.escape],color:"#ea76cb"},{tag:N.definition(N.variableName),color:"#1e66f5"},{tag:N.local(N.variableName),color:"#1e66f5"},{tag:N.variableName,color:"#4c4f69"},{tag:N.definition(N.propertyName),color:"#1e66f5"},{tag:N.propertyName,color:"#1e66f5"},{tag:[N.typeName,N.className,N.namespace],color:"#df8e1d"},{tag:[N.macroName,N.labelName],color:"#d20f39"},{tag:N.function(N.variableName),color:"#1e66f5"},{tag:N.operator,color:"#04a5e5"},{tag:N.punctuation,color:"#7c7f93"},{tag:N.comment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.lineComment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.blockComment,color:"#9ca0b0",fontStyle:"italic"},{tag:N.meta,color:"#7c7f93"},{tag:N.link,color:"#1e66f5",textDecoration:"underline"},{tag:N.url,color:"#1e66f5"},{tag:N.invalid,color:"#d20f39"}]),m=Pe.theme({"&":{fontSize:"13px",height:"auto",backgroundColor:"var(--ed-surface-1, #f8fafc)",border:"1px solid var(--ed-border-default, #e2e8f0)",borderRadius:"var(--ed-radius-sm, 4px)"},"&.cm-focused":{outline:"none",borderColor:"var(--ed-accent, #3b82f6)",boxShadow:"0 0 0 2px var(--ed-accent-ring, rgba(59, 130, 246, 0.2))"},".cm-scroller":{overflow:"auto",maxHeight:"12rem",fontFamily:"var(--ed-font-mono, 'SF Mono', 'Fira Code', monospace)",lineHeight:"1.5"},".cm-content":{padding:"var(--ed-space-2, 0.5rem)",caretColor:"#1e293b",minHeight:"3rem"},".cm-cursor":{borderLeftColor:"#1e293b"},"&.cm-focused .cm-selectionBackground, ::selection":{backgroundColor:"rgba(14, 165, 233, 0.2)"},".cm-selectionBackground":{backgroundColor:"rgba(14, 165, 233, 0.12)"},".cm-activeLine":{backgroundColor:"transparent"},".cm-markdoc-tag":{backgroundColor:"rgba(217, 119, 6, 0.06)",borderRadius:"2px"},".cm-markdoc-bracket":{color:"#94a3b8"},".cm-markdoc-name":{color:"#d97706",fontWeight:"600"}},{dark:!1}),p=ge(()=>t.includes(g(u))||!g(u)?t:[g(u),...t]);function v(){if(!r)return;const I=r.getBoundingClientRect(),Z=I.width,Y=I.height,ne=8;let ae=e.anchorRect.left+e.anchorRect.width/2-Z/2;ae<ne&&(ae=ne),ae+Z>window.innerWidth-ne&&(ae=window.innerWidth-Z-ne),q(o,ae,!0);const ie=e.anchorRect.top-Y-ne;ie>=ne?(q(a,ie),q(l,!0)):(q(a,e.anchorRect.bottom+ne),q(l,!1))}ao(()=>{v();function I(Y){r&&!r.contains(Y.target)&&b()}function Z(Y){Y.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("mousedown",I)}),document.addEventListener("keydown",Z),()=>{document.removeEventListener("mousedown",I),document.removeEventListener("keydown",Z)}}),hn(()=>{if(!i)return;const I=Pt.create({doc:Pr(()=>g(c)),extensions:[f.of(al()),d.of(Pr(()=>g(u))==="markdoc"?Nc():[]),cO(),m,Tc(h),Tc(Tx,{fallback:!0}),na.of([...dO,...uO,iD,{key:"Mod-Enter",run:()=>(b(),!0)},{key:"Escape",run:()=>(e.onclose(),!0)}]),Pe.updateListener.of(Y=>{Y.docChanged&&q(c,Y.state.doc.toString(),!0)}),Pe.lineWrapping]}),Z=new Pe({state:I,parent:i});return q(s,Z,!0),Z.focus(),O(Z,Pr(()=>g(u))),requestAnimationFrame(()=>v()),()=>{q(s,void 0),Z.destroy()}});function O(I,Z){const Y=Z?.trim();if(!Y)return;if(Y==="markdoc"){I.dispatch({effects:[f.reconfigure(al()),d.reconfigure(Nc())]});return}I.dispatch({effects:d.reconfigure([])});const ne=ee.matchLanguageName(LP,Y,!0);ne&&ne.load().then(ae=>{I.dispatch({effects:f.reconfigure(ae)})}).catch(console.error)}function b(){g(c)!==e.code&&e.onchange(g(c)),e.onclose()}function w(I){const Z=I.target;q(u,Z.value,!0),e.onlanguagechange(g(u)),g(s)&&O(g(s),g(u))}var S=jG();let _;var x=R(S),A=D(R(x),2);A.__click=function(...I){e.onclose?.apply(this,I)};var C=D(x,2),y=R(C);y.__change=w;var k=R(y);k.value=k.__value="";var P=D(k);Ct(P,17,()=>g(p),Yt,(I,Z)=>{var Y=BG(),ne=R(Y),ae={};ce(()=>{Te(ne,g(Z)),ae!==(ae=g(Z))&&(Y.value=(Y.__value=g(Z))??"")}),z(I,Y)});var T;Mf(y);var E=D(C,2);ln(E,I=>i=I,()=>i);var Q=D(E,2),$=R(Q);$.__click=b;var L=D($,2);L.__click=function(...I){e.onremove?.apply(this,I)},ln(S,I=>r=I,()=>r),ce(()=>{_=Be(S,1,"code-edit-popover svelte-rmoejq",null,_,{above:g(l),below:!g(l)}),Er(S,`left: ${g(o)??""}px; top: ${g(a)??""}px`),T!==(T=g(u))&&(y.value=(y.__value=g(u))??"",gc(y,g(u)))}),z(n,S),ht()}Vt(["click","change"]);const In="";async function e_(){const n=await fetch(`${In}/api/tree`);if(!n.ok)throw new Error(`Failed to load tree: ${n.status}`);return n.json()}async function em(n){const e=await fetch(`${In}/api/files/${encodeURIComponent(n)}`);if(!e.ok)throw new Error(`Failed to load file: ${e.status}`);return e.json()}async function ZG(n,e){const t=await fetch(`${In}/api/files/${encodeURIComponent(n)}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})});if(!t.ok)throw new Error(`Failed to save file: ${t.status}`)}async function FG(n,e){const t=await fetch(`${In}/api/preview`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:e})});if(!t.ok)throw new Error(`Preview failed: ${t.status}`);return t.text()}async function XG(n,e){const t=await fetch(`${In}/api/preview-data`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n,content:e})});if(!t.ok)throw new Error(`Preview data failed: ${t.status}`);return t.json()}async function VG(){const n=await fetch(`${In}/api/config`);if(!n.ok)throw new Error(`Config failed: ${n.status}`);return n.json()}async function WG(){const n=await fetch(`${In}/api/route-rules`);if(!n.ok)throw new Error(`Failed to load route rules: ${n.status}`);return(await n.json()).routeRules}async function YG(n){const e=await fetch(`${In}/api/route-rules`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({routeRules:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to update route rules: ${e.status}`)}}async function UG(n){const e=await fetch(`${In}/api/pages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to create page: ${e.status}`)}return e.json()}async function t_(n){const e=await fetch(`${In}/api/directories`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to create directory: ${e.status}`)}return e.json()}async function GG(n,e){const t=await fetch(`${In}/api/rename`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({oldPath:n,newName:e})});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r.error??`Failed to rename: ${t.status}`)}return t.json()}async function HG(n){const e=await fetch(`${In}/api/duplicate`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to duplicate: ${e.status}`)}return e.json()}async function KG(n){const e=await fetch(`${In}/api/files/${encodeURIComponent(n)}`,{method:"DELETE"});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to delete: ${e.status}`)}}async function JG(n){const e=await fetch(`${In}/api/toggle-draft`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:n})});if(!e.ok){const t=await e.json().catch(()=>({}));throw new Error(t.error??`Failed to toggle draft: ${e.status}`)}return e.json()}async function eH(){const n=await fetch(`${In}/api/assets`);if(!n.ok)throw new Error(`Failed to load assets: ${n.status}`);return(await n.json()).images}async function tH(n){const e=new FormData;e.append("file",n);const t=await fetch(`${In}/api/assets/upload`,{method:"POST",body:e});if(!t.ok){const r=await t.json().catch(()=>({}));throw new Error(r.error??`Upload failed: ${t.status}`)}return t.json()}async function nH(){const n=await fetch(`${In}/api/runes`);if(!n.ok)throw new Error(`Failed to load runes: ${n.status}`);return(await n.json()).runes}async function rH(){const n=await fetch(`${In}/api/aggregated`);return n.ok?n.json():{}}function iH(n){const e=new EventSource(`${In}/api/events`);return e.addEventListener("file-changed",t=>n("file-changed",JSON.parse(t.data))),e.addEventListener("file-created",t=>n("file-created",JSON.parse(t.data))),e.addEventListener("file-deleted",t=>n("file-deleted",JSON.parse(t.data))),()=>e.close()}var sH=W('<div class="image-edit-modal__empty svelte-1yd8alm">Loading images...</div>'),oH=W('<div class="image-edit-modal__empty svelte-1yd8alm">No images found. Upload one to get started.</div>'),aH=W('<div class="image-edit-modal__empty svelte-1yd8alm"> </div>'),lH=W('<button><img loading="lazy" class="svelte-1yd8alm"/></button>'),cH=W('<div class="image-edit-modal__grid svelte-1yd8alm"></div>'),uH=W('<div class="image-edit-backdrop svelte-1yd8alm" role="dialog" aria-modal="true" aria-label="Select image"><div><div class="image-edit-modal__header svelte-1yd8alm"><span class="image-edit-modal__label svelte-1yd8alm">image</span> <button class="image-edit-modal__close svelte-1yd8alm" aria-label="Close">×</button></div> <div class="image-edit-modal__search svelte-1yd8alm"><input class="image-edit-modal__search-input svelte-1yd8alm" type="text" placeholder="Search images..."/></div> <div class="image-edit-modal__grid-area svelte-1yd8alm"><!></div> <div class="image-edit-modal__upload-bar svelte-1yd8alm"><button class="image-edit-modal__upload-btn svelte-1yd8alm"> </button> <span class="image-edit-modal__upload-hint svelte-1yd8alm">or drag & drop</span> <input type="file" accept="image/*" style="display: none"/></div> <div class="image-edit-modal__footer svelte-1yd8alm"><div class="image-edit-modal__row svelte-1yd8alm"><label class="image-edit-modal__field-label svelte-1yd8alm" for="image-alt">Alt</label> <input id="image-alt" class="image-edit-modal__input svelte-1yd8alm" type="text" placeholder="Describe this image..."/></div> <div class="image-edit-modal__actions svelte-1yd8alm"><button class="image-edit-modal__btn image-edit-modal__btn--apply svelte-1yd8alm">Apply</button> <button class="image-edit-modal__btn image-edit-modal__btn--remove svelte-1yd8alm">Remove</button></div></div></div></div>');function fH(n,e){dt(e,!0);let t,r,i,s=J(Ht([])),o=J(!0),a=J(!1),l=J(""),c=J(Ht(e.currentSrc)),u=J(Ht(e.currentAlt)),f=J(!1);const d=ge(()=>g(l)?g(s).filter(ve=>ve.name.toLowerCase().includes(g(l).toLowerCase())):g(s));ao(()=>{h();function ve(Ee){Ee.key==="Escape"&&e.onclose()}return document.addEventListener("keydown",ve),()=>document.removeEventListener("keydown",ve)});async function h(){q(o,!0);try{q(s,await eH(),!0)}catch{q(s,[],!0)}q(o,!1)}function m(ve){ve.target===ve.currentTarget&&e.onclose()}function p(ve){if(q(c,ve.path,!0),!g(u)){const Ee=ve.name.replace(/\.[^.]+$/,"").replace(/[-_]/g," ");q(u,Ee,!0)}}function v(){g(c)&&e.onchange(g(c),g(u))}function O(){r?.click()}async function b(ve){const Ee=ve.target,rt=Ee.files?.[0];rt&&(await w(rt),Ee.value="")}async function w(ve){if(ve.type.startsWith("image/")){q(a,!0);try{const Ee=await tH(ve);if(await h(),q(c,Ee.path,!0),!g(u)){const rt=Ee.name.replace(/\.[^.]+$/,"").replace(/[-_]/g," ");q(u,rt,!0)}}catch(Ee){console.error("Upload failed:",Ee)}q(a,!1)}}function S(ve){ve.preventDefault(),q(f,!0)}function _(){q(f,!1)}async function x(ve){ve.preventDefault(),q(f,!1);const Ee=ve.dataTransfer?.files[0];Ee&&await w(Ee)}function A(ve){ve.key==="Enter"&&(ve.preventDefault(),v())}var C=uH();C.__click=m,C.__keydown=()=>{};var y=R(C);let k;var P=R(y),T=D(R(P),2);T.__click=function(...ve){e.onclose?.apply(this,ve)};var E=D(P,2),Q=R(E),$=D(E,2),L=R($);{var I=ve=>{var Ee=sH();z(ve,Ee)},Z=ve=>{var Ee=oH();z(ve,Ee)},Y=ve=>{var Ee=aH(),rt=R(Ee);ce(()=>Te(rt,`No images match "${g(l)??""}"`)),z(ve,Ee)},ne=ve=>{var Ee=cH();Ct(Ee,21,()=>g(d),rt=>rt.path,(rt,Ke)=>{var Ye=lH();let Ve;Ye.__click=()=>p(g(Ke));var ze=R(Ye);ce(()=>{Ve=Be(Ye,1,"image-edit-modal__thumb svelte-1yd8alm",null,Ve,{selected:g(c)===g(Ke).path}),St(Ye,"title",g(Ke).name),St(ze,"src",g(Ke).path),St(ze,"alt",g(Ke).name)}),z(rt,Ye)}),z(ve,Ee)};le(L,ve=>{g(o)?ve(I):g(d).length===0&&!g(l)?ve(Z,1):g(d).length===0?ve(Y,2):ve(ne,!1)})}var ae=D($,2),ie=R(ae);ie.__click=O;var K=R(ie),he=D(ie,4);he.__change=b,ln(he,ve=>r=ve,()=>r);var fe=D(ae,2),j=R(fe),U=D(R(j),2);U.__keydown=A,ln(U,ve=>i=ve,()=>i);var ue=D(j,2),ke=R(ue);ke.__click=v;var Ce=D(ke,2);Ce.__click=function(...ve){e.onremove?.apply(this,ve)},ln(y,ve=>t=ve,()=>t),ce(()=>{k=Be(y,1,"image-edit-modal svelte-1yd8alm",null,k,{"drag-over":g(f)}),ie.disabled=g(a),Te(K,g(a)?"Uploading...":"Upload image"),ke.disabled=!g(c)}),st("dragover",y,S),st("dragleave",y,_),st("drop",y,x),Qn(Q,()=>g(l),ve=>q(l,ve)),Qn(U,()=>g(u),ve=>q(u,ve)),z(n,C),ht()}Vt(["click","keydown","change"]);var dH=W('<div class="icon-picker-modal__empty svelte-1rc2pkk">No icons available.</div>'),hH=W('<div class="icon-picker-modal__empty svelte-1rc2pkk"> </div>'),pH=W('<button><span class="icon-picker-modal__icon-svg svelte-1rc2pkk"><!></span> <span class="icon-picker-modal__icon-name svelte-1rc2pkk"> </span></button>'),mH=W('<div class="icon-picker-modal__group svelte-1rc2pkk"><div class="icon-picker-modal__group-label svelte-1rc2pkk"> </div> <div class="icon-picker-modal__grid svelte-1rc2pkk"></div></div>'),gH=W('<div class="icon-picker-backdrop svelte-1rc2pkk" role="dialog" aria-modal="true" aria-label="Select icon"><div class="icon-picker-modal svelte-1rc2pkk"><div class="icon-picker-modal__header svelte-1rc2pkk"><span class="icon-picker-modal__label svelte-1rc2pkk">icon</span> <button class="icon-picker-modal__close svelte-1rc2pkk" aria-label="Close">×</button></div> <div class="icon-picker-modal__search svelte-1rc2pkk"><input class="icon-picker-modal__search-input svelte-1rc2pkk" type="text" placeholder="Search icons..."/></div> <div class="icon-picker-modal__grid-area svelte-1rc2pkk"><!></div> <div class="icon-picker-modal__footer svelte-1rc2pkk"><button class="icon-picker-modal__btn icon-picker-modal__btn--apply svelte-1rc2pkk">Apply</button> <button class="icon-picker-modal__btn icon-picker-modal__btn--cancel svelte-1rc2pkk">Cancel</button></div></div></div>');function vH(n,e){dt(e,!0);let t,r=J(Ht(e.currentIcon)),i=J("");const s=ge(()=>{const y=[];for(const[k,P]of Object.entries(e.icons))for(const[T,E]of Object.entries(P)){const Q=k==="global"?T:`${k}/${T}`;y.push({name:T,qualifiedName:Q,group:k,svg:E})}return y}),o=ge(()=>g(i)?g(s).filter(y=>y.name.toLowerCase().includes(g(i).toLowerCase())||y.qualifiedName.toLowerCase().includes(g(i).toLowerCase())):g(s)),a=ge(()=>{const y=new Map;for(const k of g(o)){const P=y.get(k.group)??[];P.push(k),y.set(k.group,P)}return y});ao(()=>{t?.focus();function y(k){k.key==="Escape"&&e.onclose()}return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)});function l(y){y.target===y.currentTarget&&e.onclose()}function c(y){q(r,y.qualifiedName,!0)}function u(){g(r)&&e.onchange(g(r))}var f=gH();f.__click=l,f.__keydown=()=>{};var d=R(f),h=R(d),m=D(R(h),2);m.__click=function(...y){e.onclose?.apply(this,y)};var p=D(h,2),v=R(p);ln(v,y=>t=y,()=>t);var O=D(p,2),b=R(O);{var w=y=>{var k=dH();z(y,k)},S=y=>{var k=hH(),P=R(k);ce(()=>Te(P,`No icons match "${g(i)??""}"`)),z(y,k)},_=y=>{var k=an(),P=tt(k);Ct(P,17,()=>[...g(a)],([T,E])=>T,(T,E)=>{var Q=ge(()=>Hc(g(E),2));let $=()=>g(Q)[0],L=()=>g(Q)[1];var I=mH(),Z=R(I),Y=R(Z),ne=D(Z,2);Ct(ne,21,L,ae=>ae.qualifiedName,(ae,ie)=>{var K=pH();let he;K.__click=()=>c(g(ie));var fe=R(K),j=R(fe);V_(j,()=>g(ie).svg);var U=D(fe,2),ue=R(U);ce(()=>{he=Be(K,1,"icon-picker-modal__icon svelte-1rc2pkk",null,he,{selected:g(r)===g(ie).qualifiedName}),St(K,"title",g(ie).qualifiedName),Te(ue,g(ie).name)}),z(ae,K)}),ce(()=>Te(Y,$())),z(T,I)}),z(y,k)};le(b,y=>{g(s).length===0?y(w):g(o).length===0?y(S,1):y(_,!1)})}var x=D(O,2),A=R(x);A.__click=u;var C=D(A,2);C.__click=function(...y){e.onclose?.apply(this,y)},ce(()=>A.disabled=!g(r)),Qn(v,()=>g(i),y=>q(i,y)),z(n,f),ht()}Vt(["click","keydown"]);var OH=W('<div class="block-editor__empty svelte-10brcoc"><svg class="block-editor__empty-icon svelte-10brcoc" width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="6" y="8" width="36" height="32" rx="3"></rect><line x1="14" y1="18" x2="34" y2="18"></line><line x1="14" y1="24" x2="28" y2="24"></line><line x1="14" y1="30" x2="22" y2="30"></line></svg> <span class="block-editor__empty-text svelte-10brcoc">No content blocks yet</span> <span class="block-editor__empty-hint svelte-10brcoc">Use the + button to add your first block</span></div>'),bH=W('<span class="block-editor__fm-desc svelte-10brcoc"> </span>'),yH=W('<div class="block-editor__fm-header svelte-10brcoc"><div class="block-editor__fm-info svelte-10brcoc"><span class="block-editor__fm-title svelte-10brcoc"> </span> <!></div> <button title="Edit frontmatter"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><path d="M11.5 1.5l3 3L5 14H2v-3L11.5 1.5z"></path></svg> Edit</button></div>'),wH=W('<button class="block-editor__insert-marker block-editor__insert-marker--top svelte-10brcoc" title="Insert block above"><svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="2" x2="5" y2="8"></line><line x1="2" y1="5" x2="8" y2="5"></line></svg></button> <button class="block-editor__insert-marker block-editor__insert-marker--bottom svelte-10brcoc" title="Insert block below"><svg width="10" height="10" viewBox="0 0 10 10" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"><line x1="5" y1="2" x2="5" y2="8"></line><line x1="2" y1="5" x2="8" y2="5"></line></svg></button>',1),_H=W('<button class="block-editor__hover-label svelte-10brcoc"> </button>'),kH=W('<div><div class="block-editor__block-cell svelte-10brcoc"><!></div> <!> <!></div>'),xH=W('<div class="block-editor__popover-backdrop svelte-10brcoc"></div> <div class="block-editor__popover svelte-10brcoc"><!></div>',1),SH=W('<div class="block-editor svelte-10brcoc"><!> <div class="block-editor__stage svelte-10brcoc"><div class="block-editor__scroll svelte-10brcoc"><div class="block-editor__list-wrap svelte-10brcoc"><!> <!></div></div></div> <!> <!> <!> <!> <!> <!> <!> <!></div>');function AH(n,e){dt(e,!0);let t=xt(e,"highlightCss",3,""),r=xt(e,"highlightTransform",3,null),i=xt(e,"showInsertMenu",3,!0),s=xt(e,"frontmatter",19,()=>({})),o=xt(e,"readOnly",3,!1),a=xt(e,"communityTags",3,null),l=xt(e,"communityPostTransforms",3,null),c=xt(e,"communityStyles",3,null),u=xt(e,"aggregated",19,()=>({})),f=J(Ht([])),d=ge(()=>N4(e.runes)),h="";function m(H,te){if(H.length===0)return;const de=new Set(H.map(He=>He.id)),ye=new Set(te.map(He=>He.id)),$e=H.filter(He=>!ye.has(He.id)),Je=te.filter(He=>!de.has(He.id));if($e.length===0||Je.length===0)return;const Ge=[...$e];for(const He of Je){let it=-1,qt=1/0;for(let lt=0;lt<Ge.length;lt++){const Pn=Ge[lt],fn=Pn.type===He.type?0:1e3,ut=Math.abs(Pn.startLine-He.startLine)+fn;ut<qt&&(qt=ut,it=lt)}it>=0&&(He.id=Ge[it].id,Ge.splice(it,1))}}hn(()=>{const H=e.bodyContent;if(H!==h){const te=sC(H);m(g(f),te),q(f,te,!0),h=H,q(k,null),q(A,!1),q(T,null),q(ze,null),q(S,null)}});function p(){const H=vg(g(f));h=H,e.onchange(H)}let v=ge(()=>O0(g(f)));function O(H){const te=g(v)[H];if(!te)return[0,0];if(te.type==="prose"){const ye=te.children[0],$e=te.children[te.children.length-1],Je=g(f).indexOf(ye),Ge=g(f).indexOf($e);return[Je,Ge]}const de=g(f).indexOf(te);return[de,de]}function b(H,te){const[de,ye]=O(H),$e=g(f).slice(de,ye+1);m($e,te.children),q(f,[...g(f).slice(0,de),...te.children,...g(f).slice(ye+1)],!0),p()}function w(H,te){const de=g(v)[H];if(!de||de.type!=="prose")return;const ye=de.children[te.childIndex];if(!ye)return;const[$e]=O(H),Je=$e+te.childIndex;if(ye.type==="fence"){const lt=ye,Pn=lt.code,fn=lt.language,ut=ye.source.split(`
|
|
600
|
-
`)[0],jn=ut.match(/^(`{3,}|~{3,})/),Yr=jn?jn[1]:"```";q(xe,{blockIndex:Je,rect:te.rect,mapping:{source:ye.source,code:Pn,language:fn,opener:ut,delimiter:Yr}},!0);return}const Ge=ye.source.trim();let He="",it=Ge;if(ye.type==="heading"){const lt=Ge.match(/^(#{1,6}\s+)(.*)/);lt&&(He=lt[1],it=lt[2])}else if(ye.type==="quote"){const lt=Ge.match(/^(>\s*)(.*)/);lt&&(He=lt[1],it=lt[2])}const qt={dataName:ye.type,text:Si(it),source:Ge,sourcePrefix:He,inlineSource:it};q(S,{editorIndex:H,childIndex:te.childIndex,flatIndex:Je,inlineSource:it,rect:te.rect,mapping:qt},!0)}let S=J(null);function _(H){if(!g(S))return;const te=g(f)[g(S).flatIndex];if(!te)return;const de=g(S).mapping.sourcePrefix+H;let ye;te.type==="heading"?(ye={...te,text:H,source:""},ye.source=Og(ye)):ye={...te,source:de},q(S,{...g(S),inlineSource:H,mapping:{...g(S).mapping,text:Si(H),source:de,inlineSource:H}},!0),fe(g(S).flatIndex,ye)}function x(){q(S,null)}let A=J(!1),C=ge(()=>s().title||""),y=ge(()=>()=>{const H=s().description||"";return H.length>80?H.slice(0,80)+"...":H}),k=J(null),P=J(null),T=J(null),E=J(null),Q=J(0);const $=420,L=12;function I(H){if(!H.target.closest(".edit-panel__header")||H.target.closest("button"))return;H.preventDefault();const de=H.currentTarget,ye=de.getBoundingClientRect(),$e=H.clientX,Je=H.clientY,Ge=ye.left,He=ye.top;function it(lt){de.style.left=`${Ge+(lt.clientX-$e)}px`,de.style.top=`${He+(lt.clientY-Je)}px`}function qt(){window.removeEventListener("mousemove",it),window.removeEventListener("mouseup",qt)}window.addEventListener("mousemove",it),window.addEventListener("mouseup",qt)}let Z=ge(()=>{if(!g(T))return"";const H=window.innerWidth,te=window.innerHeight;let de=g(T).x+L;de+$>H-16&&(de=g(T).x-$-L),de<16&&(de=H-$-16);let ye=g(T).y;const $e=te-120,Je=te-Math.min(600,$e)-16;return ye>Je&&(ye=Je),ye<60&&(ye=60),`left: ${de}px; top: ${ye}px; max-height: min(600px, ${$e}px);`});function Y(H,te,de){q(A,!1),g(v)[H]&&(g(k)===H?(q(k,null),q(T,null),q(E,null)):(Ah(Q),q(k,H,!0),q(T,{x:te,y:de},!0),q(E,null)))}function ne(H,te,de,ye){q(A,!1),Ah(Q),q(k,H,!0),q(T,{x:te,y:de},!0),q(E,ye??null,!0)}function ae(H){q(k,null),g(A)?(q(A,!1),q(T,null)):(q(A,!0),q(T,{x:H.clientX,y:H.clientY},!0))}function ie(H){if(!o()&&H.key==="Escape"){if(g(S)){x();return}(g(k)!==null||g(A))&&(q(k,null),q(A,!1),q(T,null),q(E,null))}}function K(){(g(k)!==null||g(A))&&(q(k,null),q(A,!1),q(T,null),q(E,null))}function he(){g(T)&&q(T,{...g(T)},!0)}function fe(H,te){q(f,g(f).map((de,ye)=>ye===H?te:de),!0),p()}function j(H){const[te,de]=O(H);g(k)!==null&&(g(k)===H?q(k,null):g(k)>H&&Ah(k,-1)),q(f,[...g(f).slice(0,te),...g(f).slice(de+1)],!0),p()}let U=J(null),ue=J(null);function ke(H,te){q(U,te,!0),q(k,null),q(A,!1),q(T,null),H.dataTransfer&&(H.dataTransfer.effectAllowed="move",H.dataTransfer.setData("text/plain",String(te)))}function Ce(H,te){H.preventDefault(),H.dataTransfer&&(H.dataTransfer.dropEffect="move"),q(ue,te,!0)}function ve(H,te){if(H.preventDefault(),g(U)!==null&&g(U)!==te){const[de,ye]=O(g(U)),$e=g(f).slice(de,ye+1),Je=[...g(f).slice(0,de),...g(f).slice(ye+1)];let Ge;if(te>=g(v).length)Ge=Je.length;else{const[He]=O(te);Ge=He>ye?He-$e.length:He}if(Je.splice(Ge,0,...$e),q(f,Je,!0),g(k)!==null)if(g(k)===g(U))q(k,te>g(U)?te-1:te,!0);else{let He=g(k);g(U)<g(k)&&te>=g(k)?He--:g(U)>g(k)&&te<=g(k)&&He++,q(k,He,!0)}p()}q(U,null),q(ue,null)}let Ee=J(!1),rt=J(null);function Ke(H){q(rt,H,!0),q(Ee,!0)}function Ye(){q(Ee,!1),q(rt,null)}function Ve(H,te){let de;const ye=`blk_new_${Date.now()}`;switch(H){case"heading":de={id:ye,type:"heading",source:"## New heading",startLine:0,endLine:0,level:2,text:"New heading"};break;case"paragraph":de={id:ye,type:"paragraph",source:"New paragraph text.",startLine:0,endLine:0};break;case"fence":de={id:ye,type:"fence",source:"```\n\n```",startLine:0,endLine:0,language:"",code:""};break;case"hr":de={id:ye,type:"hr",source:"---",startLine:0,endLine:0};break;case"rune":{const Ge=te??"hint",He=g(d).get(Ge),it=He?.selfClosing??!1,qt={};if(He)for(const[fn,ut]of Object.entries(He.attributes))ut.required&&(qt[fn]=ut.values?.[0]??"");const lt=Object.entries(qt).map(([fn,ut])=>`${fn}="${ut}"`).join(" "),Pn=lt?" "+lt:"";if(it)de={id:ye,type:"rune",source:`{% ${Ge}${Pn} /%}`,startLine:0,endLine:0,runeName:Ge,selfClosing:!0,attributes:qt,innerContent:""};else{const fn=He?.example?B4(He.example,Ge):"";de={id:ye,type:"rune",source:`{% ${Ge}${Pn} %}
|
|
601
|
-
${fn}
|
|
602
|
-
{% /${Ge} %}`,startLine:0,endLine:0,runeName:Ge,selfClosing:!1,attributes:qt,innerContent:fn}}break}}const $e=g(rt)??g(v).length;let Je;if($e>=g(v).length)Je=g(f).length;else{const[Ge]=O($e);Je=Ge}if(q(f,[...g(f).slice(0,Je),de,...g(f).slice(Je)],!0),q(rt,null),q(Ee,!1),q(A,!1),H==="rune"){const Ge=O0(g(f));q(k,Ge.findIndex(He=>He.type==="rune"&&He===g(f)[Je]),!0),g(k)===-1&&q(k,null)}else q(k,null);p()}let ze=J(null);function Bt(H,te){const de=g(v)[H];if(!de||de.type!=="rune")return;const[ye]=O(H),$e=g(f)[ye];if($e.type!=="rune")return;const Je=$e,Ge=ye;if(te.editType==="link"){const it=Lz(Je.innerContent,te.text,te.href??"");if(!it)return;q(bt,{blockIndex:Ge,rect:te.rect,mapping:it},!0);return}if(te.editType==="code"){const it=qz(Je.innerContent,te.text);if(!it)return;q(xe,{blockIndex:Ge,rect:te.rect,mapping:it},!0);return}if(te.editType==="image"){const it=te.href??"",qt=Iz(Je.innerContent,it);if(!qt)return;q(se,{blockIndex:Ge,mapping:qt},!0);return}if(te.editType==="icon"){const it=te.iconName??"",qt=Bz(Je.innerContent,it);if(!qt)return;q(Qe,{blockIndex:Ge,mapping:qt},!0);return}const He=RC(Je.innerContent,te.dataName,te.text);He&&q(ze,{blockIndex:Ge,dataName:te.dataName,inlineSource:He.inlineSource,rect:te.rect,mapping:He},!0)}function Nn(H){if(!g(ze))return;const te=g(f)[g(ze).blockIndex];if(te.type!=="rune")return;const de=te,ye=Qz(de.innerContent,g(ze).mapping,H),$e={...de,innerContent:ye,source:""};$e.source=nr($e),q(ze,{...g(ze),inlineSource:H,mapping:{...g(ze).mapping,text:Si(H),source:g(ze).mapping.sourcePrefix+H,inlineSource:H}},!0),fe(g(ze).blockIndex,$e)}function Jn(){q(ze,null)}let bt=J(null);function Wt(H,te){if(!g(bt))return;const de=g(f)[g(bt).blockIndex];if(de.type!=="rune")return;const ye=de,$e=Mz(ye.innerContent,g(bt).mapping,H,te),Je={...ye,innerContent:$e,source:""};Je.source=nr(Je),fe(g(bt).blockIndex,Je)}function mn(){if(!g(bt))return;const H=g(bt).blockIndex,te=g(f)[H];if(te.type!=="rune")return;const de=te,ye=de.innerContent.replace(g(bt).mapping.source+`
|
|
603
|
-
`,"").replace(g(bt).mapping.source,""),$e={...de,innerContent:ye,source:""};$e.source=nr($e),q(bt,null),fe(H,$e)}function Vn(){q(bt,null)}let xe=J(null);function Wn(H){if(!g(xe))return;const te=g(f)[g(xe).blockIndex];if(te.type==="fence"){const Ge={...te,code:H,source:""};Ge.source=Od(Ge),fe(g(xe).blockIndex,Ge);return}if(te.type!=="rune")return;const de=te,ye=Rz(de.innerContent,g(xe).mapping,H),$e={...de,innerContent:ye,source:""};$e.source=nr($e),fe(g(xe).blockIndex,$e)}function Lt(){if(!g(xe))return;const H=g(xe).blockIndex,te=g(f)[H];if(te.type==="fence"){q(xe,null),q(f,g(f).filter((Je,Ge)=>Ge!==H),!0),p();return}if(te.type!=="rune")return;const de=te,ye=de.innerContent.replace(g(xe).mapping.source+`
|
|
604
|
-
`,"").replace(g(xe).mapping.source,""),$e={...de,innerContent:ye,source:""};$e.source=nr($e),q(xe,null),fe(H,$e)}function Jt(){q(xe,null)}function _n(H){if(!g(xe))return;const te=g(f)[g(xe).blockIndex];if(te.type==="fence"){const lt={...te,language:H,source:""};lt.source=Od(lt);const fn=g(xe).mapping.opener.slice(g(xe).mapping.delimiter.length).replace(/^\w*/,"").trim(),ut=g(xe).mapping.delimiter+H+(fn?" "+fn:""),jn=ut+`
|
|
605
|
-
`+g(xe).mapping.code+`
|
|
606
|
-
`+g(xe).mapping.delimiter;q(xe,{...g(xe),mapping:{...g(xe).mapping,language:H,opener:ut,source:jn}},!0),fe(g(xe).blockIndex,lt);return}if(te.type!=="rune")return;const de=te,ye=Dz(de.innerContent,g(xe).mapping,H),$e={...de,innerContent:ye,source:""};$e.source=nr($e);const Ge=g(xe).mapping.opener.slice(g(xe).mapping.delimiter.length).replace(/^\w*/,"").trim(),He=g(xe).mapping.delimiter+H+(Ge?" "+Ge:""),it=He+`
|
|
607
|
-
`+g(xe).mapping.code+`
|
|
608
|
-
`+g(xe).mapping.delimiter;q(xe,{...g(xe),mapping:{...g(xe).mapping,language:H,opener:He,source:it}},!0),fe(g(xe).blockIndex,$e)}let se=J(null);function Oe(H,te){if(!g(se))return;const de=g(f)[g(se).blockIndex];if(de.type!=="rune")return;const ye=de,$e=Nz(ye.innerContent,g(se).mapping,te,H),Je={...ye,innerContent:$e,source:""};Je.source=nr(Je),fe(g(se).blockIndex,Je)}function _e(){if(!g(se))return;const H=g(se).blockIndex,te=g(f)[H];if(te.type!=="rune")return;const de=te,ye=de.innerContent.replace(g(se).mapping.source+`
|
|
609
|
-
`,"").replace(g(se).mapping.source,""),$e={...de,innerContent:ye,source:""};$e.source=nr($e),q(se,null),fe(H,$e)}function Ae(){q(se,null)}let Qe=J(null);function yt(H){if(!g(Qe))return;const te=g(f)[g(Qe).blockIndex];if(te.type!=="rune")return;const de=te,ye=jz(de.innerContent,g(Qe).mapping,H),$e={...de,innerContent:ye,source:""};$e.source=nr($e),fe(g(Qe).blockIndex,$e)}function ct(){q(Qe,null)}function Ue(H,te,de,ye){if(g(k)===null)return;const[$e]=O(g(k));q(xe,null),q(ze,{blockIndex:$e,dataName:H,inlineSource:te,rect:de,mapping:ye},!0)}function wt(H,te,de,ye){if(g(k)===null)return;const[$e]=O(g(k));q(ze,null),q(xe,{blockIndex:$e,rect:de,mapping:ye},!0)}let pt=ge(()=>{const H=new Map;for(const te of e.runes){const de=H.get(te.category)??[];de.push(te),H.set(te.category,de)}return H});var at=SH();st("keydown",Zo,ie),st("resize",Zo,he);var _t=R(at);{var xn=H=>{var te=OH();z(H,te)};le(_t,H=>{g(f).length===0&&!o()&&H(xn)})}var jt=D(_t,2),en=R(jt),gt=R(en),Ut=R(gt);{var Bn=H=>{var te=yH(),de=R(te),ye=R(de),$e=R(ye),Je=D(ye,2);{var Ge=lt=>{var Pn=bH(),fn=R(Pn);ce(ut=>Te(fn,ut),[()=>g(y)()]),z(lt,Pn)},He=ge(()=>g(y)());le(Je,lt=>{g(He)&<(Ge)})}var it=D(de,2);let qt;it.__click=lt=>ae(lt),ce(()=>{Te($e,g(C)||"Untitled"),qt=Be(it,1,"block-editor__fm-edit svelte-10brcoc",null,qt,{active:g(A)})}),z(H,te)};le(Ut,H=>{o()||H(Bn)})}var er=D(Ut,2);Ct(er,19,()=>g(v),H=>H.id,(H,te,de)=>{var ye=kH();let $e;var Je=R(ye),Ge=R(Je);{var He=ut=>{{let jn=ge(()=>o()?void 0:on=>w(g(de),on)),Yr=ge(()=>o()?void 0:on=>Y(g(de),on.x,on.y)),Lr=ge(()=>o()?void 0:on=>ke(on,g(de))),ra=ge(()=>o()?void 0:on=>Ce(on,g(de))),ia=ge(()=>o()?void 0:on=>ve(on,g(de)));WY(ut,{get block(){return g(te)},get themeConfig(){return e.themeConfig},get themeCss(){return e.themeCss},get highlightCss(){return t()},get highlightTransform(){return r()},get communityTags(){return a()},get communityPostTransforms(){return l()},get communityStyles(){return c()},get aggregated(){return u()},get readOnly(){return o()},get onsectionclick(){return g(jn)},get onblockclick(){return g(Yr)},get ondragstart(){return g(Lr)},get ondragover(){return g(ra)},get ondrop(){return g(ia)}})}},it=ut=>{{let jn=ge(()=>o()?void 0:on=>Bt(g(de),on)),Yr=ge(()=>o()?void 0:on=>ne(g(de),on.x,on.y,on.nestedRuneIndex)),Lr=ge(()=>o()?void 0:on=>ke(on,g(de))),ra=ge(()=>o()?void 0:on=>Ce(on,g(de))),ia=ge(()=>o()?void 0:on=>ve(on,g(de)));ZY(ut,{get block(){return g(te)},get themeConfig(){return e.themeConfig},get themeCss(){return e.themeCss},get highlightCss(){return t()},get highlightTransform(){return r()},get communityTags(){return a()},get communityPostTransforms(){return l()},get communityStyles(){return c()},get aggregated(){return u()},get readOnly(){return o()},get onsectionclick(){return g(jn)},get onruneclick(){return g(Yr)},get ondragstart(){return g(Lr)},get ondragover(){return g(ra)},get ondrop(){return g(ia)}})}};le(Ge,ut=>{g(te).type==="prose"?ut(He):ut(it,!1)})}var qt=D(Je,2);{var lt=ut=>{var jn=wH(),Yr=tt(jn);Yr.__click=()=>Ke(g(de));var Lr=D(Yr,2);Lr.__click=()=>Ke(g(de)+1),z(ut,jn)};le(qt,ut=>{!o()&&i()&&ut(lt)})}var Pn=D(qt,2);{var fn=ut=>{var jn=_H();jn.__click=Lr=>Y(g(de),Lr.clientX,Lr.clientY);var Yr=R(jn);ce(Lr=>{St(jn,"aria-pressed",g(k)===g(de)),Te(Yr,Lr)},[()=>zO(g(te))]),z(ut,jn)};le(Pn,ut=>{o()||ut(fn)})}ce(()=>$e=Be(ye,1,"block-editor__row svelte-10brcoc",null,$e,{hovered:!o()&&g(P)===g(de),active:!o()&&g(k)===g(de),"drag-source":!o()&&g(U)===g(de),"drag-over":!o()&&g(ue)===g(de)&&g(U)!==g(de)})),st("mouseenter",ye,()=>{o()||q(P,g(de),!0)}),st("mouseleave",ye,()=>{!o()&&g(P)===g(de)&&q(P,null)}),z(H,ye)});var mr=D(jt,2);{var cn=H=>{var te=xH(),de=tt(te);de.__mousedown=()=>{q(k,null),q(A,!1),q(T,null),q(E,null)};var ye=D(de,2);ye.__mousedown=I;var $e=R(ye);{var Je=it=>{kG(it,{onclose:()=>{q(A,!1),q(T,null)}})},Ge=it=>{const qt=ge(()=>g(f)[O(g(k))[0]]);var lt=an(),Pn=tt(lt);Db(Pn,()=>g(Q),fn=>{pG(fn,{get block(){return g(qt)},get runeMap(){return g(d)},runes:()=>e.runes,get aggregated(){return u()},get initialRuneIndex(){return g(E)},onupdate:ut=>fe(O(g(k))[0],ut),onremove:()=>{const ut=g(k);q(k,null),q(T,null),q(E,null),j(ut)},onclose:()=>{q(k,null),q(T,null),q(E,null)},oneditfield:Ue,oneditcode:wt})}),z(it,lt)},He=it=>{const qt=ge(()=>g(v)[g(k)]);var lt=an(),Pn=tt(lt);Db(Pn,()=>g(Q),fn=>{bG(fn,{get block(){return g(qt)},runes:()=>e.runes,get aggregated(){return u()},onupdate:ut=>b(g(k),ut),onremove:()=>{const ut=g(k);q(k,null),q(T,null),j(ut)},onclose:()=>{q(k,null),q(T,null)}})}),z(it,lt)};le($e,it=>{g(A)?it(Je):g(k)!==null&&g(v)[g(k)]?.type==="rune"?it(Ge,1):g(k)!==null&&g(v)[g(k)]?.type==="prose"&&it(He,2)})}ce(()=>Er(ye,g(Z))),z(H,te)};le(mr,H=>{!o()&&(g(k)!==null||g(A))&&H(cn)})}var Mt=D(mr,2);{var F=H=>{qG(H,{get runes(){return e.runes},get runesByCategory(){return g(pt)},oninsert:Ve,onclose:Ye})};le(Mt,H=>{g(Ee)&&H(F)})}var Ze=D(Mt,2);{var un=H=>{Jw(H,{get anchorRect(){return g(ze).rect},get dataName(){return g(ze).dataName},get inlineSource(){return g(ze).inlineSource},onchange:Nn,onclose:Jn})};le(Ze,H=>{g(ze)&&H(un)})}var Sn=D(Ze,2);{var We=H=>{NG(H,{get anchorRect(){return g(bt).rect},get text(){return g(bt).mapping.text},get href(){return g(bt).mapping.href},onchange:Wt,onremove:mn,onclose:Vn})};le(Sn,H=>{g(bt)&&H(We)})}var gr=D(Sn,2);{var qi=H=>{zG(H,{get anchorRect(){return g(xe).rect},get code(){return g(xe).mapping.code},get language(){return g(xe).mapping.language},onchange:Wn,onlanguagechange:_n,onremove:Lt,onclose:Jt})};le(gr,H=>{g(xe)&&H(qi)})}var Mn=D(gr,2);{var ns=H=>{fH(H,{get currentSrc(){return g(se).mapping.src},get currentAlt(){return g(se).mapping.alt},onchange:(te,de)=>{Oe(te,de),Ae()},onremove:_e,onclose:Ae})};le(Mn,H=>{g(se)&&H(ns)})}var qn=D(Mn,2);{var $s=H=>{{let te=ge(()=>e.themeConfig?.icons??{});vH(H,{get icons(){return g(te)},get currentIcon(){return g(Qe).mapping.name},onchange:de=>{yt(de),ct()},onclose:ct})}};le(qn,H=>{g(Qe)&&H($s)})}var rs=D(qn,2);{var vr=H=>{Jw(H,{get anchorRect(){return g(S).rect},get dataName(){return g(S).mapping.dataName},get inlineSource(){return g(S).inlineSource},onchange:_,onclose:x})};le(rs,H=>{g(S)&&H(vr)})}st("scroll",gt,K),z(n,at),ht()}Vt(["click","mousedown"]);const n_=/\{%\s*region\s+([^%]*?)%\}([\s\S]*?)\{%\s*\/region\s*%\}/g,r_=/(\w+)="([^"]*)"/g;function CH(n){const e=[];let t;for(n_.lastIndex=0;(t=n_.exec(n))!==null;){const r=t[1],i=t[2],s={};let o;for(r_.lastIndex=0;(o=r_.exec(r))!==null;)s[o[1]]=o[2];const a=s.name||"",l=s.mode||"replace";let c=i;c.startsWith(`
|
|
610
|
-
`)&&(c=c.slice(1)),c.endsWith(`
|
|
611
|
-
`)&&(c=c.slice(0,-1)),e.push({name:a,mode:l,content:c})}return{regions:e}}function TH(n){const e=["{% layout %}"];for(const t of n.regions){const r=t.mode!=="replace"?` mode="${t.mode}"`:"";e.push(`{% region name="${t.name}"${r} %}`),e.push(t.content),e.push("{% /region %}"),e.push("")}return e.push("{% /layout %}"),e.join(`
|
|
612
|
-
`)}const yb=/\{%\s*nav\s*%\}/,MP=/\{%\s*\/nav\s*%\}/;function PH(n){return yb.test(n)}function EH(n){const e=yb.exec(n);if(!e)return null;const t=e.index+e[0].length,r=MP.exec(n.slice(t));if(!r)return null;let i=n.slice(t,t+r.index);return i.startsWith(`
|
|
613
|
-
`)&&(i=i.slice(1)),i.endsWith(`
|
|
614
|
-
`)&&(i=i.slice(0,-1)),i}function $H(n,e){const t=yb.exec(n);if(!t)return n;const r=t.index+t[0].length,i=MP.exec(n.slice(r));if(!i)return n;const s=n.slice(0,r),o=n.slice(r+i.index);return`${s}
|
|
615
|
-
${e}
|
|
616
|
-
${o}`}function QH(n){const e=n.split(`
|
|
617
|
-
`),t=[],r=[];let i=null;for(const s of e){const o=s.trim(),a=o.match(/^##\s+(.+)$/);if(a){i={title:a[1],items:[]},t.push(i);continue}const l=o.match(/^-\s+(.+)$/);if(l){const c=l[1].trim();i?i.items.push(c):r.push(c);continue}}return{groups:t,ungrouped:r}}function LH(n){const e=[];for(const t of n.ungrouped)e.push(`- ${t}`);n.ungrouped.length>0&&n.groups.length>0&&e.push("");for(let t=0;t<n.groups.length;t++){const r=n.groups[t];e.push(`## ${r.title}`),e.push("");for(const i of r.items)e.push(`- ${i}`);t<n.groups.length-1&&e.push("")}return e.join(`
|
|
618
|
-
`)}var MH=W('<input class="nav-item__input svelte-8xlxf2" type="text"/>'),qH=W('<button class="nav-item__slug svelte-8xlxf2"> </button>'),RH=W('<div class="nav-item svelte-8xlxf2"><button class="nav-item__grip svelte-8xlxf2" title="Drag to reorder"><svg width="10" height="14" viewBox="0 0 10 14" fill="none"><circle cx="3" cy="3" r="1.2" fill="currentColor"></circle><circle cx="7" cy="3" r="1.2" fill="currentColor"></circle><circle cx="3" cy="7" r="1.2" fill="currentColor"></circle><circle cx="7" cy="7" r="1.2" fill="currentColor"></circle><circle cx="3" cy="11" r="1.2" fill="currentColor"></circle><circle cx="7" cy="11" r="1.2" fill="currentColor"></circle></svg></button> <!> <button class="nav-item__remove svelte-8xlxf2" title="Remove item"><svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div>');function DH(n,e){dt(e,!0);let t=J(!1),r=J(Ht(e.slug));function i(){q(r,e.slug,!0),q(t,!0)}function s(){const h=g(r).trim();h&&h!==e.slug&&e.onchange(h),q(t,!1)}function o(h){h.key==="Enter"?(h.preventDefault(),s()):h.key==="Escape"&&q(t,!1)}var a=RH(),l=R(a);l.__pointerdown=function(...h){e.ondragstart?.apply(this,h)};var c=D(l,2);{var u=h=>{var m=MH();m.__keydown=o,ks(m),st("blur",m,s),Qn(m,()=>g(r),p=>q(r,p)),z(h,m)},f=h=>{var m=qH();m.__dblclick=i;var p=R(m);ce(()=>Te(p,e.slug)),z(h,m)};le(c,h=>{g(t)?h(u):h(f,!1)})}var d=D(c,2);d.__click=function(...h){e.ondelete?.apply(this,h)},z(n,a),ht()}Vt(["pointerdown","keydown","dblclick","click"]);var IH=W('<div role="listitem"><!></div>'),NH=W('<div class="nav-editor__add-item svelte-1h0zo48"><input class="nav-editor__add-input svelte-1h0zo48" type="text" placeholder="Page slug..."/></div>'),BH=W('<button class="nav-editor__add-item-btn svelte-1h0zo48">+ Add item</button>'),jH=W('<div class="nav-editor__group svelte-1h0zo48"><div class="nav-editor__group-header svelte-1h0zo48"><input class="nav-editor__group-title svelte-1h0zo48" type="text" placeholder="Group title"/> <button class="nav-editor__group-delete svelte-1h0zo48" title="Delete group"><svg width="12" height="12" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div> <div class="nav-editor__items svelte-1h0zo48"></div> <!></div>'),zH=W('<div class="nav-editor__add-group svelte-1h0zo48"><input class="nav-editor__add-input svelte-1h0zo48" type="text" placeholder="Group title..."/></div>'),ZH=W('<button class="nav-editor__add-group-btn svelte-1h0zo48">+ Add group</button>'),FH=W('<div class="nav-editor svelte-1h0zo48"><!> <!></div>');function XH(n,e){dt(e,!0);let t=J(Ht({groups:[],ungrouped:[]})),r=J(null),i=J(""),s=J(""),o=J(!1),a=J(null),l=J(null);hn(()=>{const k=EH(e.content);k!==null&&q(t,QH(k),!0)});function c(){const k=LH(g(t)),P=$H(e.content,k);e.onchange(P)}function u(k,P){g(t).groups[k]={...g(t).groups[k],title:P},q(t,{...g(t)},!0),c()}function f(k){const P=g(t).groups[k];P.items.length>0&&!confirm(`Delete group "${P.title}" and its ${P.items.length} items?`)||(g(t).groups.splice(k,1),q(t,{...g(t)},!0),c())}function d(){const k=g(s).trim();k&&(g(t).groups.push({title:k,items:[]}),q(t,{...g(t)},!0),q(s,""),q(o,!1),c())}function h(k,P,T){g(t).groups[k].items[P]=T,q(t,{...g(t)},!0),c()}function m(k,P){g(t).groups[k].items.splice(P,1),q(t,{...g(t)},!0),c()}function p(k){const P=g(i).trim();P&&(g(t).groups[k].items.push(P),q(t,{...g(t)},!0),q(i,""),q(r,null),c())}function v(k,P){k.key==="Enter"?(k.preventDefault(),p(P)):k.key==="Escape"&&(q(r,null),q(i,""))}function O(k){k.key==="Enter"?(k.preventDefault(),d()):k.key==="Escape"&&(q(o,!1),q(s,""))}function b(k,P,T){k.currentTarget.setPointerCapture(k.pointerId),q(a,{groupIdx:P,itemIdx:T},!0)}function w(k,P,T){g(a)&&q(l,{groupIdx:P,itemIdx:T},!0)}function S(k){if(!g(a)||!g(l)){q(a,null),q(l,null);return}const{groupIdx:P,itemIdx:T}=g(a),{groupIdx:E,itemIdx:Q}=g(l);if(P===E&&T===Q){q(a,null),q(l,null);return}const[$]=g(t).groups[P].items.splice(T,1);let L=Q;P===E&&T<Q&&(L=Q-1),g(t).groups[E].items.splice(L,0,$),q(t,{...g(t)},!0),q(a,null),q(l,null),c()}var _=FH(),x=R(_);Ct(x,17,()=>g(t).groups,Yt,(k,P,T)=>{var E=jH(),Q=R(E),$=R(Q);$.__input=ae=>u(T,ae.target.value);var L=D($,2);L.__click=()=>f(T);var I=D(Q,2);Ct(I,21,()=>g(P).items,Yt,(ae,ie,K)=>{var he=IH();let fe;he.__pointermove=U=>w(U,T,K),he.__pointerup=S;var j=R(he);DH(j,{get slug(){return g(ie)},onchange:U=>h(T,K,U),ondelete:()=>m(T,K),ondragstart:U=>b(U,T,K)}),ce(()=>fe=Be(he,1,"nav-editor__item-wrapper svelte-1h0zo48",null,fe,{"drag-over":g(l)?.groupIdx===T&&g(l)?.itemIdx===K})),z(ae,he)});var Z=D(I,2);{var Y=ae=>{var ie=NH(),K=R(ie);K.__keydown=he=>v(he,T),ks(K),st("blur",K,()=>{q(r,null),q(i,"")}),Qn(K,()=>g(i),he=>q(i,he)),z(ae,ie)},ne=ae=>{var ie=BH();ie.__click=()=>{q(r,T,!0),q(i,"")},z(ae,ie)};le(Z,ae=>{g(r)===T?ae(Y):ae(ne,!1)})}ce(()=>sn($,g(P).title)),z(k,E)});var A=D(x,2);{var C=k=>{var P=zH(),T=R(P);T.__keydown=O,ks(T),st("blur",T,()=>{q(o,!1),q(s,"")}),Qn(T,()=>g(s),E=>q(s,E)),z(k,P)},y=k=>{var P=ZH();P.__click=()=>{q(o,!0),q(s,"")},z(k,P)};le(A,k=>{g(o)?k(C):k(y,!1)})}z(n,_),ht()}Vt(["input","click","pointermove","pointerup","keydown"]);var VH=W("<button> </button>"),WH=W("<button> </button>"),YH=W('<textarea class="region-card__textarea svelte-1ah7fba" placeholder="Region content..." rows="4"></textarea>'),UH=W('<div class="region-card svelte-1ah7fba"><div class="region-card__header svelte-1ah7fba"><div class="region-card__name-row svelte-1ah7fba"><input class="region-card__name svelte-1ah7fba" type="text" placeholder="Region name"/> <div class="region-card__mode svelte-1ah7fba"></div></div> <div class="region-card__actions svelte-1ah7fba"><!> <button class="region-card__delete-btn svelte-1ah7fba" title="Delete region"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M4 4l8 8M12 4l-8 8" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg></button></div></div> <div class="region-card__body svelte-1ah7fba"><!></div></div>');function GH(n,e){dt(e,!0);let t=J(!1),r=ge(()=>PH(e.region.content));function i(C){const y=C.target;e.onchange({...e.region,name:y.value})}function s(C){e.onchange({...e.region,mode:C})}function o(C){const y=C.target;e.onchange({...e.region,content:y.value})}function a(C){e.onchange({...e.region,content:C})}function l(){e.region.content.trim()&&!confirm(`Delete region "${e.region.name}"? Its content will be lost.`)||e.ondelete()}function c(C){C.style.height="auto",C.style.height=`${C.scrollHeight}px`}function u(C){const y=C.target;c(y),o(C)}var f=UH(),d=R(f),h=R(d),m=R(h);m.__input=i;var p=D(m,2);Ct(p,20,()=>["replace","prepend","append"],Yt,(C,y)=>{var k=VH();let P;k.__click=()=>s(y);var T=R(k);ce(()=>{P=Be(k,1,"region-card__mode-btn svelte-1ah7fba",null,P,{active:e.region.mode===y}),Te(T,y)}),z(C,k)});var v=D(h,2),O=R(v);{var b=C=>{var y=WH();let k;y.__click=()=>{q(t,!g(t))};var P=R(y);ce(()=>{k=Be(y,1,"region-card__toggle-btn svelte-1ah7fba",null,k,{active:g(t)}),Te(P,g(t)?"Text":"Visual")}),z(C,y)};le(O,C=>{g(r)&&C(b)})}var w=D(O,2);w.__click=l;var S=D(d,2),_=R(S);{var x=C=>{XH(C,{get content(){return e.region.content},onchange:a})},A=C=>{var y=YH();y.__input=u,c$(y,k=>c?.(k)),ce(()=>sn(y,e.region.content)),z(C,y)};le(_,C=>{g(r)&&g(t)?C(x):C(A,!1)})}ce(()=>sn(m,e.region.name)),z(n,f),ht()}Vt(["input","click"]);var HH=W('<span class="layout-editor__path svelte-u2phg9"> </span>'),KH=W('<div class="layout-editor__raw svelte-u2phg9"><!></div>'),JH=W('<div class="layout-editor__empty svelte-u2phg9"><p class="svelte-u2phg9">No regions defined. Add a region to get started.</p></div>'),eK=W('<div class="layout-editor__regions svelte-u2phg9"><!> <!> <button class="layout-editor__add-btn svelte-u2phg9"><svg width="14" height="14" viewBox="0 0 16 16" fill="none"><path d="M8 3v10M3 8h10" stroke="currentColor" stroke-width="1.5" stroke-linecap="round"></path></svg> Add Region</button></div>'),tK=W('<div class="layout-editor svelte-u2phg9"><div class="layout-editor__header svelte-u2phg9"><div class="layout-editor__title-row svelte-u2phg9"><svg class="layout-editor__icon svelte-u2phg9" width="16" height="16" viewBox="0 0 16 16" fill="none"><rect x="1" y="1" width="14" height="14" rx="2" stroke="currentColor" stroke-width="1.2"></rect><path d="M1 5h14M6 5v10" stroke="currentColor" stroke-width="1.2"></path></svg> <span class="layout-editor__title svelte-u2phg9">Layout</span> <!></div> <div class="layout-editor__mode-track svelte-u2phg9"><button>Visual</button> <button>Raw</button></div></div> <!></div>');function nK(n,e){dt(e,!0);let t=J(!1),r=J(Ht({regions:[]})),i="";hn(()=>{const x=X.editorContent;x!==i&&(q(r,CH(x),!0),i=x)});function s(){const x=TH(g(r));i=x,X.editorContent=x,X.bodyContent=x}function o(x,A){g(r).regions[x]=A,q(r,{...g(r)},!0),s()}function a(x){g(r).regions.splice(x,1),q(r,{...g(r)},!0),s()}function l(){g(r).regions.push({name:"",mode:"replace",content:""}),q(r,{...g(r)},!0),s()}var c=tK(),u=R(c),f=R(u),d=D(R(f),4);{var h=x=>{var A=HH(),C=R(A);ce(()=>Te(C,X.currentPath)),z(x,A)};le(d,x=>{X.currentPath&&x(h)})}var m=D(f,2),p=R(m);let v;p.__click=()=>{q(t,!1)};var O=D(p,2);let b;O.__click=()=>{q(t,!0)};var w=D(u,2);{var S=x=>{var A=KH(),C=R(A);rC(C,{}),z(x,A)},_=x=>{var A=eK(),C=R(A);{var y=T=>{var E=JH();z(T,E)};le(C,T=>{g(r).regions.length===0&&T(y)})}var k=D(C,2);Ct(k,17,()=>g(r).regions,Yt,(T,E,Q)=>{GH(T,{get region(){return g(E)},onchange:$=>o(Q,$),ondelete:()=>a(Q)})});var P=D(k,2);P.__click=l,z(x,A)};le(w,x=>{g(t)?x(S):x(_,!1)})}ce(()=>{v=Be(p,1,"layout-editor__mode-btn svelte-u2phg9",null,v,{active:!g(t)}),b=Be(O,1,"layout-editor__mode-btn svelte-u2phg9",null,b,{active:g(t)})}),z(n,c),ht()}Vt(["click"]);var rK=W('<div class="preview__empty svelte-1iqwj2q"><svg class="preview__empty-icon svelte-1iqwj2q" width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round"><rect x="4" y="8" width="40" height="32" rx="3" class="svelte-1iqwj2q"></rect><line x1="4" y1="16" x2="44" y2="16" class="svelte-1iqwj2q"></line><circle cx="10" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><circle cx="15" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><circle cx="20" cy="12" r="1.5" fill="currentColor" stroke="none" class="svelte-1iqwj2q"></circle><line x1="14" y1="26" x2="34" y2="26" class="svelte-1iqwj2q"></line><line x1="14" y1="32" x2="28" y2="32" class="svelte-1iqwj2q"></line></svg> <span class="preview__empty-text svelte-1iqwj2q">Select a page to preview</span></div>'),iK=W('<div class="preview__progress svelte-1iqwj2q"></div>'),sK=W('<iframe title="Preview" src="/preview/" class="preview__iframe svelte-1iqwj2q"></iframe>'),oK=W('<iframe title="Preview" class="preview__iframe svelte-1iqwj2q"></iframe>'),aK=W('<div class="preview__container svelte-1iqwj2q"><!> <div class="preview__viewport svelte-1iqwj2q"><!></div></div>');function lK(n,e){dt(e,!0);let t=J(""),r=J(void 0),i=J(void 0),s,o=new Map,a=J(!1);const l=ge(()=>g(t).replace("<html",`<html data-theme="${X.previewTheme}"`));hn(()=>{function m(p){if(p.data?.type==="preview-ready")X.previewRuntimeReady=!0;else if(p.data?.type==="preview-navigate"){const v=p.data.href,O=o.get(v);O&&e.onnavigate&&e.onnavigate(O)}}return window.addEventListener("message",m),()=>window.removeEventListener("message",m)});const c=ge(()=>X.previewRuntimeAvailable&&X.previewRuntimeReady);hn(()=>{const m=SE(X.routeRules);g(c)&&g(r)?.contentWindow&&g(r).contentWindow.postMessage({type:"route-rules-update",routeRules:m},"*")}),hn(()=>{const m=X.previewTheme;g(c)&&g(r)?.contentWindow&&g(r).contentWindow.postMessage({type:"theme-update",theme:m},"*")}),hn(()=>{const m=X.currentPath,p=X.editorContent,v=g(c);if(!m||!p){q(t,"");return}return q(a,!0),clearTimeout(s),s=setTimeout(async()=>{try{if(v){const O=await XG(m,p);O.pages&&(o=new Map(O.pages.map(b=>[b.url,b.path]))),g(r)?.contentWindow?.postMessage({type:"preview-update",page:O},"*")}else q(t,await FG(m,p),!0)}catch{}finally{q(a,!1)}},400),()=>clearTimeout(s)});var u=an(),f=tt(u);{var d=m=>{var p=rK();z(m,p)},h=m=>{var p=aK(),v=R(p);{var O=x=>{var A=iK();z(x,A)};le(v,x=>{g(a)&&x(O)})}var b=D(v,2),w=R(b);{var S=x=>{var A=sK();ln(A,C=>q(r,C),()=>g(r)),z(x,A)},_=x=>{var A=oK();ln(A,C=>q(i,C),()=>g(i)),ce(()=>St(A,"srcdoc",g(l))),z(x,A)};le(w,x=>{X.previewRuntimeAvailable?x(S):x(_,!1)})}z(m,p)};le(f,m=>{X.currentPath?m(h,!1):m(d)})}z(n,u),ht()}var cK=W('<div class="page-card svelte-1nxc0wz"><!></div>');function uK(n,e){dt(e,!0);const t={desktop:1440,tablet:768,mobile:375},r=ge(()=>X.editorMode==="preview"?t[X.viewport]??1440:1440);var i=cK(),s=R(i);ya(s,()=>e.children),ce(()=>Er(i,`--page-card-width: ${g(r)??""}px`)),z(n,i),ht()}var fK=W('<div class="popover svelte-ohlzgl"><!></div>');function qP(n,e){dt(e,!0);let t,r=J(e.anchorRect.x+e.anchorRect.width+8),i=J(Ht(e.anchorRect.y));ao(()=>{if(t){const c=t.getBoundingClientRect();c.right>window.innerWidth-8&&q(r,e.anchorRect.x-c.width-8),c.bottom>window.innerHeight-8&&q(i,window.innerHeight-c.height-8),g(i)<8&&q(i,8)}function a(c){t&&!t.contains(c.target)&&e.onclose()}function l(c){c.key==="Escape"&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("click",a)}),document.addEventListener("keydown",l),()=>{document.removeEventListener("click",a),document.removeEventListener("keydown",l)}});var s=fK(),o=R(s);ya(o,()=>e.children),ln(s,a=>t=a,()=>t),ce(()=>Er(s,`left: ${g(r)??""}px; top: ${g(i)??""}px`)),z(n,s),ht()}var dK=W('<span class="modal__location svelte-vqemeo"> </span>'),hK=W('<span class="modal__hint svelte-vqemeo">Auto-derived from title</span>'),pK=W('<label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Title</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="My New Page"/></label> <label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Slug</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="my-new-page"/> <!></label> <label class="modal__checkbox svelte-vqemeo"><input type="checkbox"/> <span>Create as draft</span></label> <div class="modal__actions svelte-vqemeo"><button type="button" class="modal__btn modal__btn--cancel svelte-vqemeo">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-vqemeo">Create</button></div>',1),mK=W('<span class="modal__error svelte-vqemeo">Use lowercase letters, numbers, and hyphens</span>'),gK=W('<label class="modal__field svelte-vqemeo"><span class="modal__label svelte-vqemeo">Name</span> <input class="modal__input svelte-vqemeo" type="text" placeholder="my-section"/> <!></label> <label class="modal__checkbox svelte-vqemeo"><input type="checkbox"/> <span>Create with _layout.md</span></label> <div class="modal__actions svelte-vqemeo"><button type="button" class="modal__btn modal__btn--cancel svelte-vqemeo">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-vqemeo">Create</button></div>',1),vK=W('<form class="modal__form svelte-vqemeo"><div class="modal__tabs svelte-vqemeo"><button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M9 1.5H4a1.5 1.5 0 0 0-1.5 1.5v10A1.5 1.5 0 0 0 4 14.5h8A1.5 1.5 0 0 0 13.5 13V6L9 1.5Z"></path><polyline points="9 1.5 9 6 13.5 6"></polyline></svg> File</button> <button type="button"><svg width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path d="M1.5 4h4.5l1.5 1.5H14.5v8.5h-13z"></path><path d="M1.5 4v-1.5h4.5l1.5 1.5"></path></svg> Folder</button></div> <!> <!></form>');function OK(n,e){dt(e,!0);let t=xt(e,"initialDirectory",3,""),r=J("file"),i=J(""),s=J(""),o=J(!1),a=J(!1),l=ge(()=>g(i).toLowerCase().replace(/[^a-z0-9\s-]/g,"").replace(/\s+/g,"-").replace(/-+/g,"-").replace(/^-|-$/g,"")),c=ge(()=>g(o)?g(s):g(l)),u=J(""),f=J(!0),d=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(u)));function h(m){if(m.preventDefault(),g(r)==="file"){if(!g(c))return;e.oncreate({directory:t(),slug:g(c),title:g(i)||g(c),template:"blank",draft:g(a)})}else{if(!g(d))return;e.oncreatefolder({parent:t(),name:g(u),createLayout:g(f)})}}qP(n,{get anchorRect(){return e.anchorRect},get onclose(){return e.onclose},children:(m,p)=>{var v=vK(),O=R(v),b=R(O);let w;b.__click=()=>q(r,"file");var S=D(b,2);let _;S.__click=()=>q(r,"folder");var x=D(O,2);{var A=P=>{var T=dK(),E=R(T);ce(()=>Te(E,`in ${t()??""}/`)),z(P,T)};le(x,P=>{t()&&P(A)})}var C=D(x,2);{var y=P=>{var T=pK(),E=tt(T),Q=D(R(E),2);ks(Q);var $=D(E,2),L=D(R($),2);L.__input=he=>{q(s,he.target.value,!0),q(o,!0)};var I=D(L,2);{var Z=he=>{var fe=hK();z(he,fe)};le(I,he=>{!g(o)&&g(i)&&he(Z)})}var Y=D($,2),ne=R(Y),ae=D(Y,2),ie=R(ae);ie.__click=function(...he){e.onclose?.apply(this,he)};var K=D(ie,2);ce(()=>{sn(L,g(c)),K.disabled=!g(c)}),Qn(Q,()=>g(i),he=>q(i,he)),lm(ne,()=>g(a),he=>q(a,he)),z(P,T)},k=P=>{var T=gK(),E=tt(T),Q=D(R(E),2);ks(Q);var $=D(Q,2);{var L=ie=>{var K=mK();z(ie,K)};le($,ie=>{g(u)&&!g(d)&&ie(L)})}var I=D(E,2),Z=R(I),Y=D(I,2),ne=R(Y);ne.__click=function(...ie){e.onclose?.apply(this,ie)};var ae=D(ne,2);ce(()=>ae.disabled=!g(d)),Qn(Q,()=>g(u),ie=>q(u,ie)),lm(Z,()=>g(f),ie=>q(f,ie)),z(P,T)};le(C,P=>{g(r)==="file"?P(y):P(k,!1)})}ce(()=>{w=Be(b,1,"modal__tab svelte-vqemeo",null,w,{active:g(r)==="file"}),_=Be(S,1,"modal__tab svelte-vqemeo",null,_,{active:g(r)==="folder"})}),st("submit",v,h),z(m,v)},$$slots:{default:!0}}),ht()}Vt(["click","input"]);var bK=W('<span class="modal__error svelte-fv7j9w">Use lowercase letters, numbers, and hyphens</span>'),yK=W("<option> </option>"),wK=W('<dialog class="modal svelte-fv7j9w"><form class="modal__form svelte-fv7j9w"><h2 class="modal__title svelte-fv7j9w">New Directory</h2> <label class="modal__field svelte-fv7j9w"><span class="modal__label svelte-fv7j9w">Name</span> <input class="modal__input svelte-fv7j9w" type="text" placeholder="my-section"/> <!></label> <label class="modal__field svelte-fv7j9w"><span class="modal__label svelte-fv7j9w">Parent directory</span> <select class="modal__select svelte-fv7j9w"></select></label> <label class="modal__checkbox svelte-fv7j9w"><input type="checkbox"/> <span>Create with _layout.md</span></label> <div class="modal__actions svelte-fv7j9w"><button type="button" class="modal__btn modal__btn--cancel svelte-fv7j9w">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-fv7j9w">Create</button></div></form></dialog>');function _K(n,e){dt(e,!0);let t=J(""),r=J(""),i=J(!0),s;function o(C,y=[]){if(!C||C.type!=="directory")return y;y.push(C.path);for(const k of C.children??[])o(k,y);return y}let a=ge(()=>o(X.tree)),l=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(t)));hn(()=>{s&&!s.open&&s.showModal()});function c(C){C.preventDefault(),g(l)&&e.oncreate({parent:g(r),name:g(t),createLayout:g(i)})}function u(C){C.key==="Escape"&&e.onclose()}var f=wK();f.__keydown=u;var d=R(f),h=D(R(d),2),m=D(R(h),2);ks(m);var p=D(m,2);{var v=C=>{var y=bK();z(C,y)};le(p,C=>{g(t)&&!g(l)&&C(v)})}var O=D(h,2),b=D(R(O),2);Ct(b,21,()=>g(a),Yt,(C,y)=>{var k=yK(),P=R(k),T={};ce(()=>{Te(P,g(y)||"/ (root)"),T!==(T=g(y))&&(k.value=(k.__value=g(y))??"")}),z(C,k)});var w=D(O,2),S=R(w),_=D(w,2),x=R(_);x.__click=function(...C){e.onclose?.apply(this,C)};var A=D(x,2);ln(f,C=>s=C,()=>s),ce(()=>A.disabled=!g(l)),st("close",f,function(...C){e.onclose?.apply(this,C)}),st("submit",d,c),Qn(m,()=>g(t),C=>q(t,C)),W_(b,()=>g(r),C=>q(r,C)),lm(S,()=>g(i),C=>q(i,C)),z(n,f),ht()}Vt(["keydown","click"]);var kK=W('<span class="modal__error svelte-e8lnud">Use lowercase letters, numbers, and hyphens</span>'),xK=W('<span class="modal__hint svelte-e8lnud"> </span>'),SK=W("<option> </option>"),AK=W('<form class="modal__form svelte-e8lnud"><h2 class="modal__title svelte-e8lnud">New Category</h2> <p class="modal__desc svelte-e8lnud">Creates a directory with a route rule and layout.</p> <label class="modal__field svelte-e8lnud"><span class="modal__label svelte-e8lnud">Name</span> <input class="modal__input svelte-e8lnud" type="text" placeholder="tutorials"/> <!></label> <label class="modal__field svelte-e8lnud"><span class="modal__label svelte-e8lnud">Layout</span> <select class="modal__select svelte-e8lnud"></select></label> <div class="modal__actions svelte-e8lnud"><button type="button" class="modal__btn modal__btn--cancel svelte-e8lnud">Cancel</button> <button type="submit" class="modal__btn modal__btn--primary svelte-e8lnud">Create</button></div></form>');function CK(n,e){dt(e,!0);let t=J(""),r=J("default"),i=ge(()=>/^[a-z0-9][a-z0-9-]*$/.test(g(t))),s=ge(()=>{const a=X.themeConfig;return a?.layouts?Object.keys(a.layouts):["default"]});function o(a){a.preventDefault(),g(i)&&e.oncreate({name:g(t),layout:g(r)})}qP(n,{get anchorRect(){return e.anchorRect},get onclose(){return e.onclose},children:(a,l)=>{var c=AK(),u=D(R(c),4),f=D(R(u),2);ks(f);var d=D(f,2);{var h=S=>{var _=kK();z(S,_)},m=S=>{var _=xK(),x=R(_);ce(()=>Te(x,`Pattern: ${g(t)??""}/** · Directory: ${g(t)??""}/`)),z(S,_)};le(d,S=>{g(t)&&!g(i)?S(h):g(t)&&S(m,1)})}var p=D(u,2),v=D(R(p),2);Ct(v,21,()=>g(s),Yt,(S,_)=>{var x=SK(),A=R(x),C={};ce(()=>{Te(A,g(_)),C!==(C=g(_))&&(x.value=(x.__value=g(_))??"")}),z(S,x)});var O=D(p,2),b=R(O);b.__click=function(...S){e.onclose?.apply(this,S)};var w=D(b,2);ce(()=>w.disabled=!g(i)),st("submit",c,o),Qn(f,()=>g(t),S=>q(t,S)),W_(v,()=>g(r),S=>q(r,S)),z(a,c)},$$slots:{default:!0}}),ht()}Vt(["click"]);var TK=Ps('<svg class="context-menu__icon svelte-1ksg7ac" width="14" height="14" viewBox="0 0 16 16" fill="none" stroke="currentColor" stroke-width="1.3" stroke-linecap="round" stroke-linejoin="round"><path></path></svg>'),PK=W("<button><!> </button>"),EK=W('<div class="context-menu svelte-1ksg7ac"></div>');function $K(n,e){dt(e,!0);let t,r=J(Ht(e.x)),i=J(Ht(e.y));function s(l){switch(l){case"Rename":return"M12.5 3.5l-9 9L2 16l3.5-1.5 9-9zM10.5 5.5l2 2";case"Duplicate":return"M5 3h6l3 3v7H5zM3 6v9h8";case"Delete":return"M3 5h12M6 5V3h6v2M5 5v9h8V5";case"Publish":case"Set as Draft":return"M2 8h5v6H2zM9 4h5v10H9z";default:return null}}ao(()=>{if(t){const c=t.getBoundingClientRect();c.right>window.innerWidth&&q(r,window.innerWidth-c.width-4),c.bottom>window.innerHeight&&q(i,window.innerHeight-c.height-4)}function l(c){t&&!t.contains(c.target)&&e.onclose()}return requestAnimationFrame(()=>{document.addEventListener("click",l),document.addEventListener("contextmenu",l)}),()=>{document.removeEventListener("click",l),document.removeEventListener("contextmenu",l)}});function o(l){l(),e.onclose()}var a=EK();Ct(a,21,()=>e.items,Yt,(l,c)=>{const u=ge(()=>s(g(c).label));var f=PK();let d;f.__click=()=>o(g(c).action);var h=R(f);{var m=v=>{var O=TK(),b=R(O);ce(()=>St(b,"d",g(u))),z(v,O)};le(h,v=>{g(u)&&v(m)})}var p=D(h);ce(()=>{d=Be(f,1,"context-menu__item svelte-1ksg7ac",null,d,{danger:g(c).danger}),Te(p,` ${g(c).label??""}`)}),z(l,f)}),ln(a,l=>t=l,()=>t),ce(()=>Er(a,`left: ${g(r)??""}px; top: ${g(i)??""}px`)),z(n,a),ht()}Vt(["click"]);var QK=W('<dialog class="dialog svelte-19l8tke"><form class="dialog__form svelte-19l8tke"><h2 class="dialog__title svelte-19l8tke">Rename</h2> <input class="dialog__input svelte-19l8tke" type="text"/> <div class="dialog__actions svelte-19l8tke"><button type="button" class="dialog__btn dialog__btn--cancel svelte-19l8tke">Cancel</button> <button type="submit" class="dialog__btn dialog__btn--primary svelte-19l8tke">Rename</button></div></form></dialog>');function LK(n,e){dt(e,!0);let t=J(Ht(e.currentName)),r;hn(()=>{r&&!r.open&&r.showModal()});function i(f){f.preventDefault();const d=g(t).trim();d&&d!==e.currentName&&e.onrename(d)}var s=QK(),o=R(s),a=D(R(o),2);ks(a),a.__keydown=f=>{f.key==="Escape"&&e.onclose()};var l=D(a,2),c=R(l);c.__click=function(...f){e.onclose?.apply(this,f)};var u=D(c,2);ln(s,f=>r=f,()=>r),ce(f=>u.disabled=f,[()=>!g(t).trim()||g(t).trim()===e.currentName]),st("close",s,function(...f){e.onclose?.apply(this,f)}),st("submit",o,i),Qn(a,()=>g(t),f=>q(t,f)),z(n,s),ht()}Vt(["keydown","click"]);var MK=W('<dialog class="dialog svelte-1r8rwv8"><form class="dialog__form svelte-1r8rwv8"><h2 class="dialog__title svelte-1r8rwv8"> </h2> <p class="dialog__message svelte-1r8rwv8"> </p> <div class="dialog__actions svelte-1r8rwv8"><button type="button" class="dialog__btn dialog__btn--cancel svelte-1r8rwv8">Cancel</button> <button type="submit" class="dialog__btn dialog__btn--danger svelte-1r8rwv8"> </button></div></form></dialog>');function qK(n,e){dt(e,!0);let t=xt(e,"confirmLabel",3,"Delete"),r;hn(()=>{r&&!r.open&&r.showModal()});function i(p){p.preventDefault(),e.onconfirm()}var s=MK(),o=R(s),a=R(o),l=R(a),c=D(a,2),u=R(c),f=D(c,2),d=R(f);d.__click=function(...p){e.onclose?.apply(this,p)};var h=D(d,2),m=R(h);ln(s,p=>r=p,()=>r),ce(()=>{Te(l,e.title),Te(u,e.message),Te(m,t())}),st("close",s,function(...p){e.onclose?.apply(this,p)}),st("submit",o,i),z(n,s),ht()}Vt(["click"]);var RK=W('<div class="banner svelte-toaoe3"><span class="banner__text svelte-toaoe3"> </span> <button class="banner__btn banner__btn--reload svelte-toaoe3">Reload</button> <button class="banner__btn banner__btn--dismiss svelte-toaoe3">Dismiss</button></div>');function DK(n,e){dt(e,!0);const t=ge(()=>X.externalChange?.event==="file-deleted");var r=an(),i=tt(r);{var s=o=>{var a=RK(),l=R(a),c=R(l),u=D(l,2);u.__click=function(...d){e.onreload?.apply(this,d)};var f=D(u,2);f.__click=()=>{X.externalChange=null},ce(()=>Te(c,g(t)?"This file was deleted outside the editor.":"This file was changed outside the editor.")),z(o,a)};le(i,o=>{X.externalChange&&o(s)})}z(n,r),ht()}Vt(["click"]);var IK=W("<!> <!>",1),NK=W("<!> <!>",1),BK=W('<div class="editor-placeholder svelte-16t0oly"><svg width="40" height="40" viewBox="0 0 48 48" fill="none" stroke="currentColor" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" class="svelte-16t0oly"><rect x="6" y="4" width="24" height="32" rx="2"></rect><polyline points="20 4 20 14 30 14"></polyline><line x1="12" y1="22" x2="24" y2="22"></line><line x1="12" y1="27" x2="20" y2="27"></line><path d="M34 24l6 6M34 36l6-6"></path></svg> <span>Select a file to edit</span></div>'),jK=W('<div class="editor-app svelte-16t0oly"><!></div> <!> <!> <!> <!> <!> <!>',1);function zK(n,e){dt(e,!0),customElements.get("rf-diagram")||customElements.define("rf-diagram",LY),customElements.get("rf-sandbox")||customElements.define("rf-sandbox",RY),customElements.get("rf-map")||customElements.define("rf-map",MY);let t=J(!1),r=J(!1),i=J(!1),s=J(""),o=J(null),a=J(null),l=J(null),c=J(null),u=J(null),f="",d=0;ao(()=>{(async()=>{X.treeLoading=!0;try{const[ue,ke,Ce,ve,Ee]=await Promise.all([e_(),nH(),VG(),WG(),rH()]);X.tree=ue,X.runes=ke,X.previewRuntimeAvailable=Ce.previewRuntime,X.themeCss=Ce.themeCss,X.themeConfig=Ce.themeConfig,X.routeRules=ve??[],X.aggregated=Ee,Ce.hasCommunityTags&&re(()=>import("/api/community-tags.js"),[]).then(Ke=>{X.communityTags=Ke.communityTags??null,X.communityPostTransforms=Ke.communityPostTransforms??null,X.communityStyles=Ke.communityStyles??null}).catch(()=>{}),re(async()=>{const{createHighlightTransform:Ke}=await import("./index-CNFIYp8p.js");return{createHighlightTransform:Ke}},[]).then(({createHighlightTransform:Ke})=>Ke().then(Ye=>{X.highlightTransform=Ye,X.highlightCss=Ye.css})).catch(()=>{});const rt=ue.children?.find(Ke=>Ke.type==="page"&&Ke.name==="index.md");rt&&m(rt.path)}catch(ue){X.error=ue instanceof Error?ue.message:"Failed to load content tree"}finally{X.treeLoading=!1}})();let j;const U=iH((ue,ke)=>{if(clearTimeout(j),j=setTimeout(()=>h(),500),ke.path===X.currentPath){if(f===ke.path&&Date.now()-d<2e3)return;X.externalChange={path:ke.path,event:ue}}});return()=>{U(),clearTimeout(j)}});async function h(){try{X.tree=await e_()}catch{}}async function m(j){if(!(X.dirty&&!confirm("You have unsaved changes. Discard them?"))){X.externalChange=null,X.fileLoading=!0,X.error=null;try{const U=await em(j);X.loadFile(j,U.raw)}catch(U){X.error=U instanceof Error?U.message:"Failed to load file"}finally{X.fileLoading=!1}}}async function p(){if(!(!X.currentPath||!X.dirty)){X.saving=!0,X.error=null;try{f=X.currentPath,d=Date.now(),await ZG(X.currentPath,X.editorContent),X.savedContent=X.editorContent,X.saveJustCompleted=!0,setTimeout(()=>{X.saveJustCompleted=!1},1500)}catch(j){X.error=j instanceof Error?j.message:"Failed to save file"}finally{X.saving=!1}}}function v(j){(j.metaKey||j.ctrlKey)&&j.key==="s"&&(j.preventDefault(),p())}async function O(j){try{const U=await UG(j);q(t,!1),await h(),await m(U.path)}catch(U){X.error=U instanceof Error?U.message:"Failed to create page"}}async function b(j){try{await t_(j),q(r,!1),q(t,!1),await h()}catch(U){X.error=U instanceof Error?U.message:"Failed to create directory"}}async function w(j){try{await t_({parent:"",name:j.name,createLayout:!0});const U={pattern:`${j.name}/**`,layout:j.layout},ue=[...X.routeRules],ke=ue.findIndex(Ce=>Ce.pattern==="**");ke>=0?ue.splice(ke,0,U):ue.push(U),await YG(ue),X.routeRules=ue,q(i,!1),await h()}catch(U){X.error=U instanceof Error?U.message:"Failed to create category"}}function S(j,U){q(l,{x:j.clientX,y:j.clientY,node:U},!0)}function _(j){const U=[];return j.type==="page"||j.type==="layout"?(U.push({label:"Rename",action:()=>{q(c,j,!0)}}),j.type==="page"&&(U.push({label:"Duplicate",action:()=>A(j)}),U.push({label:j.draft?"Publish":"Set as Draft",action:()=>k(j)})),U.push({label:"Delete",action:()=>{q(u,j,!0)},danger:!0})):j.type==="directory"&&(U.push({label:"Rename",action:()=>{q(c,j,!0)}}),U.push({label:"Delete",action:()=>{q(u,j,!0)},danger:!0})),U}async function x(j){if(!g(c))return;const U=g(c).path;try{const ue=await GG(U,j);q(c,null),await h(),X.currentPath===U&&await m(ue.newPath)}catch(ue){X.error=ue instanceof Error?ue.message:"Failed to rename"}}async function A(j){try{const U=await HG(j.path);await h(),await m(U.path)}catch(U){X.error=U instanceof Error?U.message:"Failed to duplicate"}}async function C(){if(!g(u))return;const j=g(u).path;try{await KG(j),q(u,null),await h(),X.currentPath===j&&(X.currentPath=null,X.editorContent="",X.savedContent="",X.bodyContent="",X.frontmatter={})}catch(U){X.error=U instanceof Error?U.message:"Failed to delete"}}async function y(){if(!(X.dirty&&!confirm("You have unsaved changes. Reload will discard them."))){if(X.externalChange?.event==="file-deleted")X.currentPath=null,X.editorContent="",X.savedContent="",X.bodyContent="",X.frontmatter={};else if(X.externalChange){const j=await em(X.externalChange.path);X.loadFile(j.path,j.raw)}X.externalChange=null}}async function k(j){try{if(await JG(j.path),await h(),X.currentPath===j.path){const U=await em(j.path);X.loadFile(j.path,U.raw)}}catch(U){X.error=U instanceof Error?U.message:"Failed to toggle draft"}}var P=jK();st("keydown",Zo,v);var T=tt(P),E=R(T);VQ(E,{header:Ce=>{FQ(Ce,{onsave:p})},left:Ce=>{c5(Ce,{onselectfile:m,onnewpage:(ve,Ee)=>{q(s,ve??"",!0),q(o,Ee,!0),q(t,!0)},onnewdirectory:ve=>{q(r,!0)},onnewcategory:ve=>{q(a,ve,!0),q(i,!0)},oncontextmenu:S})},center:Ce=>{var ve=NK(),Ee=tt(ve);DK(Ee,{onreload:y});var rt=D(Ee,2);{var Ke=Ve=>{nK(Ve,{})},Ye=Ve=>{var ze=IK(),Bt=tt(ze);_5(Bt,{forceRawMode:!0});var Nn=D(Bt,2);rC(Nn,{}),z(Ve,ze)};le(rt,Ve=>{X.currentFileType==="layout"?Ve(Ke):X.currentPath&&Ve(Ye,1)})}z(Ce,ve)},right:Ce=>{var ve=an(),Ee=tt(ve);{var rt=Ye=>{var Ve=BK();z(Ye,Ve)},Ke=Ye=>{uK(Ye,{children:(Ve,ze)=>{var Bt=an(),Nn=tt(Bt);{var Jn=Wt=>{lK(Wt,{onnavigate:m})},bt=Wt=>{{let mn=ge(()=>X.editorMode==="code");AH(Wt,{get bodyContent(){return X.bodyContent},onchange:Vn=>X.updateBody(Vn),get runes(){return X.runes},get themeConfig(){return X.themeConfig},get themeCss(){return X.themeCss},get highlightCss(){return X.highlightCss},get highlightTransform(){return X.highlightTransform},get frontmatter(){return X.frontmatter},get readOnly(){return g(mn)},get communityTags(){return X.communityTags},get communityPostTransforms(){return X.communityPostTransforms},get communityStyles(){return X.communityStyles},get aggregated(){return X.aggregated}})}};le(Nn,Wt=>{X.editorMode==="preview"?Wt(Jn):Wt(bt,!1)})}z(Ve,Bt)},$$slots:{default:!0}})};le(Ee,Ye=>{X.currentPath?X.currentFileType!=="layout"&&Ye(Ke,1):Ye(rt)})}z(Ce,ve)},$$slots:{header:!0,left:!0,center:!0,right:!0}});var Q=D(T,2);{var $=j=>{OK(j,{oncreate:O,oncreatefolder:b,onclose:()=>{q(t,!1)},get initialDirectory(){return g(s)},get anchorRect(){return g(o)}})};le(Q,j=>{g(t)&&g(o)&&j($)})}var L=D(Q,2);{var I=j=>{CK(j,{oncreate:w,onclose:()=>{q(i,!1)},get anchorRect(){return g(a)}})};le(L,j=>{g(i)&&g(a)&&j(I)})}var Z=D(L,2);{var Y=j=>{_K(j,{oncreate:b,onclose:()=>{q(r,!1)}})};le(Z,j=>{g(r)&&j(Y)})}var ne=D(Z,2);{var ae=j=>{{let U=ge(()=>_(g(l).node));$K(j,{get x(){return g(l).x},get y(){return g(l).y},get items(){return g(U)},onclose:()=>{q(l,null)}})}};le(ne,j=>{g(l)&&j(ae)})}var ie=D(ne,2);{var K=j=>{LK(j,{get currentName(){return g(c).name},onrename:x,onclose:()=>{q(c,null)}})};le(ie,j=>{g(c)&&j(K)})}var he=D(ie,2);{var fe=j=>{{let U=ge(()=>g(u).type==="directory"?"directory":"file");qK(j,{get title(){return`Delete ${g(U)??""}`},get message(){return`Are you sure you want to delete "${g(u).name??""}"? This cannot be undone.`},onconfirm:C,onclose:()=>{q(u,null)}})}};le(he,j=>{g(u)&&j(fe)})}z(n,P),ht()}n$(zK,{target:document.getElementById("app")});export{XS as C,Wr as E,Zt as I,Ja as L,Ox as N,re as _,nl as a,bl as b,_f as c,oD as d,mS as e,uu as f,il as g,wn as h,Kt as i,ld as j,Mq as k,Lq as l,Ax as m,yr as n,Pe as o,me as p,$A as q,bx as r,Ol as s,N as t,aA as u,Px as v,oi as w};
|