diff --git a/develop/assets/FileSaver.min-BMYjv9ER.js b/develop/assets/FileSaver.min-yl_Rp0vC.js similarity index 97% rename from develop/assets/FileSaver.min-BMYjv9ER.js rename to develop/assets/FileSaver.min-yl_Rp0vC.js index 2ae1f6d..de88e9c 100644 --- a/develop/assets/FileSaver.min-BMYjv9ER.js +++ b/develop/assets/FileSaver.min-yl_Rp0vC.js @@ -1 +1 @@ -import{g as j,c as s}from"./index-BocD5m97.js";var E={exports:{}};(function(b,S){(function(p,i){i()})(s,function(){function p(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,r){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){u(o.response,t,r)},o.onerror=function(){console.error("could not download file")},o.send()}function v(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function l(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof s=="object"&&s.global===s?s:void 0,m=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!m?function(e,t,r){var o=a.URL||a.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin===location.origin?l(n):v(n.href)?i(e,t,r):l(n,n.target="_blank")):(n.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(n.href)},4e4),setTimeout(function(){l(n)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(p(e,r),t);else if(v(e))i(e,t,r);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){l(o)})}}:function(e,t,r,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,r);var n=e.type==="application/octet-stream",h=/constructor/i.test(a.HTMLElement)||a.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||n&&h||m)&&typeof FileReader<"u"){var d=new FileReader;d.onloadend=function(){var c=d.result;c=w?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=c:location=c,o=null},d.readAsDataURL(e)}else{var y=a.URL||a.webkitURL,f=y.createObjectURL(e);o?o.location=f:location.href=f,o=null,setTimeout(function(){y.revokeObjectURL(f)},4e4)}});a.saveAs=u.saveAs=u,b.exports=u})})(E);var L=E.exports;const R=j(L),A=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));export{A as F}; +import{g as j,c as s}from"./index-HAa2DkAb.js";var E={exports:{}};(function(b,S){(function(p,i){i()})(s,function(){function p(e,t){return typeof t>"u"?t={autoBom:!1}:typeof t!="object"&&(console.warn("Deprecated: Expected third argument to be a object"),t={autoBom:!t}),t.autoBom&&/^\s*(?:text\/\S*|application\/xml|\S*\/\S*\+xml)\s*;.*charset\s*=\s*utf-8/i.test(e.type)?new Blob(["\uFEFF",e],{type:e.type}):e}function i(e,t,r){var o=new XMLHttpRequest;o.open("GET",e),o.responseType="blob",o.onload=function(){u(o.response,t,r)},o.onerror=function(){console.error("could not download file")},o.send()}function v(e){var t=new XMLHttpRequest;t.open("HEAD",e,!1);try{t.send()}catch{}return 200<=t.status&&299>=t.status}function l(e){try{e.dispatchEvent(new MouseEvent("click"))}catch{var t=document.createEvent("MouseEvents");t.initMouseEvent("click",!0,!0,window,0,0,0,80,20,!1,!1,!1,!1,0,null),e.dispatchEvent(t)}}var a=typeof window=="object"&&window.window===window?window:typeof self=="object"&&self.self===self?self:typeof s=="object"&&s.global===s?s:void 0,m=a.navigator&&/Macintosh/.test(navigator.userAgent)&&/AppleWebKit/.test(navigator.userAgent)&&!/Safari/.test(navigator.userAgent),u=a.saveAs||(typeof window!="object"||window!==a?function(){}:"download"in HTMLAnchorElement.prototype&&!m?function(e,t,r){var o=a.URL||a.webkitURL,n=document.createElement("a");t=t||e.name||"download",n.download=t,n.rel="noopener",typeof e=="string"?(n.href=e,n.origin===location.origin?l(n):v(n.href)?i(e,t,r):l(n,n.target="_blank")):(n.href=o.createObjectURL(e),setTimeout(function(){o.revokeObjectURL(n.href)},4e4),setTimeout(function(){l(n)},0))}:"msSaveOrOpenBlob"in navigator?function(e,t,r){if(t=t||e.name||"download",typeof e!="string")navigator.msSaveOrOpenBlob(p(e,r),t);else if(v(e))i(e,t,r);else{var o=document.createElement("a");o.href=e,o.target="_blank",setTimeout(function(){l(o)})}}:function(e,t,r,o){if(o=o||open("","_blank"),o&&(o.document.title=o.document.body.innerText="downloading..."),typeof e=="string")return i(e,t,r);var n=e.type==="application/octet-stream",h=/constructor/i.test(a.HTMLElement)||a.safari,w=/CriOS\/[\d]+/.test(navigator.userAgent);if((w||n&&h||m)&&typeof FileReader<"u"){var d=new FileReader;d.onloadend=function(){var c=d.result;c=w?c:c.replace(/^data:[^;]*;/,"data:attachment/file;"),o?o.location.href=c:location=c,o=null},d.readAsDataURL(e)}else{var y=a.URL||a.webkitURL,f=y.createObjectURL(e);o?o.location=f:location.href=f,o=null,setTimeout(function(){y.revokeObjectURL(f)},4e4)}});a.saveAs=u.saveAs=u,b.exports=u})})(E);var L=E.exports;const R=j(L),A=Object.freeze(Object.defineProperty({__proto__:null,default:R},Symbol.toStringTag,{value:"Module"}));export{A as F}; diff --git a/develop/assets/index-BocD5m97.js b/develop/assets/index-HAa2DkAb.js similarity index 71% rename from develop/assets/index-BocD5m97.js rename to develop/assets/index-HAa2DkAb.js index bc59dcb..12310a2 100644 --- a/develop/assets/index-BocD5m97.js +++ b/develop/assets/index-HAa2DkAb.js @@ -1,19 +1,19 @@ -var DW=Object.defineProperty;var VW=(n,e,t)=>e in n?DW(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Uh=(n,e,t)=>VW(n,typeof e!="symbol"?e+"":e,t);import*as qW from"https://cdn.jsdelivr.net/npm/minizinc/dist/minizinc.mjs";import*as IW from"https://cdn.jsdelivr.net/npm/minizinc@edge/dist/minizinc.mjs";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function Qe(){}const vd=n=>n;function LW(n,e){for(const t in e)n[t]=e[t];return n}function Fb(n){return n()}function hm(){return Object.create(null)}function Ft(n){n.forEach(Fb)}function Gc(n){return typeof n=="function"}function Oi(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let Wf;function Om(n,e){return n===e?!0:(Wf||(Wf=document.createElement("a")),Wf.href=e,n===Wf.href)}function NW(n){return Object.keys(n).length===0}function jW(n,...e){if(n==null){for(const i of e)i(void 0);return Qe}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function $O(n,e,t){n.$$.on_destroy.push(jW(e,t))}function Zi(n,e,t,i){if(n){const r=Gb(n,e,t,i);return n[0](r)}}function Gb(n,e,t,i){return n[1]&&i?LW(t.ctx.slice(),n[1](i(e))):t.ctx}function Ri(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],l=Math.max(e.dirty.length,r.length);for(let o=0;o32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),wd=Hb?n=>requestAnimationFrame(n):Qe;const _l=new Set;function Jb(n){_l.forEach(e=>{e.c(n)||(_l.delete(e),e.f())}),_l.size!==0&&wd(Jb)}function e$(n){let e;return _l.size===0&&wd(Jb),{promise:new Promise(t=>{_l.add(e={c:n,f:t})}),abort(){_l.delete(e)}}}const FW=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Q(n,e){n.appendChild(e)}function t$(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function GW(n){const e=k("style");return e.textContent="/* empty */",HW(t$(n),e),e.sheet}function HW(n,e){return Q(n.head||n,e),e.sheet}function Y(n,e,t){n.insertBefore(e,t||null)}function A(n){n.parentNode&&n.parentNode.removeChild(n)}function di(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function i$(n){return function(e){return e.preventDefault(),n.call(this,e)}}function v(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Bo(n){return n===""?null:+n}function KW(n){return Array.from(n.childNodes)}function Ne(n,e){e=""+e,n.data!==e&&(n.data=e)}function si(n,e){n.value=e??""}function pm(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function Yl(n,e,t){for(let i=0;ie.__value)}function ne(n,e,t){n.classList.toggle(e,!!t)}function n$(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}const dc=new Map;let pc=0;function e4(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function t4(n,e){const t={stylesheet:GW(e),rules:{}};return dc.set(n,t),t}function vO(n,e,t,i,r,s,l,o=0){const a=16.666/i;let c=`{ +var Vx=Object.defineProperty;var qx=(n,e,t)=>e in n?Vx(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Uh=(n,e,t)=>qx(n,typeof e!="symbol"?e+"":e,t);import*as Ix from"https://cdn.jsdelivr.net/npm/minizinc/dist/minizinc.mjs";import*as Lx from"https://cdn.jsdelivr.net/npm/minizinc@edge/dist/minizinc.mjs";(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const l of s.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function i(r){if(r.ep)return;r.ep=!0;const s=t(r);fetch(r.href,s)}})();function Qe(){}const vd=n=>n;function Nx(n,e){for(const t in e)n[t]=e[t];return n}function Gb(n){return n()}function hm(){return Object.create(null)}function Ft(n){n.forEach(Gb)}function Gc(n){return typeof n=="function"}function Oi(n,e){return n!=n?e==e:n!==e||n&&typeof n=="object"||typeof n=="function"}let xf;function Om(n,e){return n===e?!0:(xf||(xf=document.createElement("a")),xf.href=e,n===xf.href)}function jx(n){return Object.keys(n).length===0}function Bx(n,...e){if(n==null){for(const i of e)i(void 0);return Qe}const t=n.subscribe(...e);return t.unsubscribe?()=>t.unsubscribe():t}function $O(n,e,t){n.$$.on_destroy.push(Bx(e,t))}function Zi(n,e,t,i){if(n){const r=Hb(n,e,t,i);return n[0](r)}}function Hb(n,e,t,i){return n[1]&&i?Nx(t.ctx.slice(),n[1](i(e))):t.ctx}function Ri(n,e,t,i){if(n[2]&&i){const r=n[2](i(t));if(e.dirty===void 0)return r;if(typeof r=="object"){const s=[],l=Math.max(e.dirty.length,r.length);for(let o=0;o32){const e=[],t=n.ctx.length/32;for(let i=0;iwindow.performance.now():()=>Date.now(),wd=Kb?n=>requestAnimationFrame(n):Qe;const kl=new Set;function e$(n){kl.forEach(e=>{e.c(n)||(kl.delete(e),e.f())}),kl.size!==0&&wd(e$)}function t$(n){let e;return kl.size===0&&wd(e$),{promise:new Promise(t=>{kl.add(e={c:n,f:t})}),abort(){kl.delete(e)}}}const Gx=typeof window<"u"?window:typeof globalThis<"u"?globalThis:global;function Q(n,e){n.appendChild(e)}function i$(n){if(!n)return document;const e=n.getRootNode?n.getRootNode():n.ownerDocument;return e&&e.host?e:n.ownerDocument}function Hx(n){const e=k("style");return e.textContent="/* empty */",Kx(i$(n),e),e.sheet}function Kx(n,e){return Q(n.head||n,e),e.sheet}function Y(n,e,t){n.insertBefore(e,t||null)}function X(n){n.parentNode&&n.parentNode.removeChild(n)}function di(n,e){for(let t=0;tn.removeEventListener(e,t,i)}function n$(n){return function(e){return e.preventDefault(),n.call(this,e)}}function v(n,e,t){t==null?n.removeAttribute(e):n.getAttribute(e)!==t&&n.setAttribute(e,t)}function Bo(n){return n===""?null:+n}function Jx(n){return Array.from(n.childNodes)}function Le(n,e){e=""+e,n.data!==e&&(n.data=e)}function si(n,e){n.value=e??""}function pm(n,e,t,i){t==null?n.style.removeProperty(e):n.style.setProperty(e,t,"")}function Yl(n,e,t){for(let i=0;ie.__value)}function ne(n,e,t){n.classList.toggle(e,!!t)}function r$(n,e,{bubbles:t=!1,cancelable:i=!1}={}){return new CustomEvent(n,{detail:e,bubbles:t,cancelable:i})}const dc=new Map;let pc=0;function t4(n){let e=5381,t=n.length;for(;t--;)e=(e<<5)-e^n.charCodeAt(t);return e>>>0}function i4(n,e){const t={stylesheet:Hx(e),rules:{}};return dc.set(n,t),t}function vO(n,e,t,i,r,s,l,o=0){const a=16.666/i;let c=`{ `;for(let y=0;y<=1;y+=a){const _=e+(t-e)*s(y);c+=y*100+`%{${l(_,1-_)}} `}const h=c+`100% {${l(t,1-t)}} -}`,O=`__svelte_${e4(h)}_${o}`,p=t$(n),{stylesheet:g,rules:m}=dc.get(p)||t4(p,n);m[O]||(m[O]=!0,g.insertRule(`@keyframes ${O} ${h}`,g.cssRules.length));const $=n.style.animation||"";return n.style.animation=`${$?`${$}, `:""}${O} ${i}ms linear ${r}ms 1 both`,pc+=1,O}function r$(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),r=t.length-i.length;r&&(n.style.animation=i.join(", "),pc-=r,pc||i4())}function i4(){wd(()=>{pc||(dc.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&A(e)}),dc.clear())})}function n4(n,e,t,i){if(!e)return Qe;const r=n.getBoundingClientRect();if(e.left===r.left&&e.right===r.right&&e.top===r.top&&e.bottom===r.bottom)return Qe;const{delay:s=0,duration:l=300,easing:o=vd,start:a=Kb()+s,end:c=a+l,tick:h=Qe,css:O}=t(n,{from:e,to:r},i);let p=!0,g=!1,m;function $(){O&&(m=vO(n,0,1,l,s,o,O)),s||(g=!0)}function y(){O&&r$(n,m),p=!1}return e$(_=>{if(!g&&_>=a&&(g=!0),g&&_>=c&&(h(1,0),y()),!p)return!1;if(g){const W=_-a,R=0+1*o(W/l);h(R,1-R)}return!0}),$(),h(0,1),y}function r4(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,r=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,s4(n,r)}}function s4(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),r=i.transform==="none"?"":i.transform;n.style.transform=`${r} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Fo;function Do(n){Fo=n}function s$(){if(!Fo)throw new Error("Function called outside component initialization");return Fo}function Hc(n){s$().$$.on_mount.push(n)}function en(){const n=s$();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const s=n$(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,s)}),!s.defaultPrevented}return!0}}function mm(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const Sl=[],Et=[];let Pl=[];const wO=[],l$=Promise.resolve();let QO=!1;function o$(){QO||(QO=!0,l$.then(a$))}function Fn(){return o$(),l$}function Hn(n){Pl.push(n)}function Vo(n){wO.push(n)}const Eh=new Set;let pl=0;function a$(){if(pl!==0)return;const n=Fo;do{try{for(;pln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Pl=e}let Qo;function a4(){return Qo||(Qo=Promise.resolve(),Qo.then(()=>{Qo=null})),Qo}function zh(n,e,t){n.dispatchEvent(n$(`${e?"intro":"outro"}${t}`))}const tc=new Set;let Er;function Je(){Er={r:0,c:[],p:Er}}function et(){Er.r||Ft(Er.c),Er=Er.p}function M(n,e){n&&n.i&&(tc.delete(n),n.i(e))}function j(n,e,t,i){if(n&&n.o){if(tc.has(n))return;tc.add(n),Er.c.push(()=>{tc.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const f4={duration:0};function yl(n,e,t,i){let s=e(n,t,{direction:"both"}),l=i?0:1,o=null,a=null,c=null,h;function O(){c&&r$(n,c)}function p(m,$){const y=m.b-l;return $*=Math.abs(y),{a:l,b:m.b,d:y,duration:$,start:m.start,end:m.start+$,group:m.group}}function g(m){const{delay:$=0,duration:y=300,easing:_=vd,tick:W=Qe,css:R}=s||f4,X={start:Kb()+$,b:m};m||(X.group=Er,Er.r+=1),"inert"in n&&(m?h!==void 0&&(n.inert=h):(h=n.inert,n.inert=!0)),o||a?a=X:(R&&(O(),c=vO(n,l,m,y,$,_,R)),m&&W(0,1),o=p(X,y),Hn(()=>zh(n,m,"start")),e$(C=>{if(a&&C>a.start&&(o=p(a,y),a=null,zh(n,o.b,"start"),R&&(O(),c=vO(n,l,o.b,o.duration,0,_,s.css))),o){if(C>=o.end)W(l=o.b,1-l),zh(n,o.b,"end"),a||(o.b?O():--o.group.r||Ft(o.group.c)),o=null;else if(C>=o.start){const E=C-o.start;l=o.a+o.d*_(E/o.duration),W(l,1-l)}}return!!(o||a)}))}return{run(m){Gc(s)?a4().then(()=>{s=s({direction:m?"in":"out"}),g(m)}):g(m)},end(){O(),o=a=null}}}function st(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function c4(n,e){j(n,1,1,()=>{e.delete(n.key)})}function u4(n,e){n.f(),c4(n,e)}function h4(n,e,t,i,r,s,l,o,a,c,h,O){let p=n.length,g=s.length,m=p;const $={};for(;m--;)$[n[m].key]=m;const y=[],_=new Map,W=new Map,R=[];for(m=g;m--;){const D=O(r,s,m),z=t(D);let F=l.get(z);F?R.push(()=>F.p(D,e)):(F=c(z,D),F.c()),_.set(z,y[m]=F),z in $&&W.set(z,Math.abs(m-$[z]))}const X=new Set,C=new Set;function E(D){M(D,1),D.m(o,h),l.set(D.key,D),h=D.first,g--}for(;p&&g;){const D=y[g-1],z=n[p-1],F=D.key,B=z.key;D===z?(h=D.first,p--,g--):_.has(B)?!l.has(F)||X.has(F)?E(D):C.has(B)?p--:W.get(F)>W.get(B)?(C.add(F),E(D)):(X.add(B),p--):(a(z,l),p--)}for(;p--;){const D=n[p];_.has(D.key)||a(D,l)}for(;g;)E(y[g-1]);return Ft(R),y}function qo(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function Ae(n){n&&n.c()}function Re(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),Hn(()=>{const s=n.$$.on_mount.map(Fb).filter(Gc);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ft(s),n.$$.on_mount=[]}),r.forEach(Hn)}function Xe(n,e){const t=n.$$;t.fragment!==null&&(o4(t.after_update),Ft(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function O4(n,e){n.$$.dirty[0]===-1&&(Sl.push(n),o$(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const m=g.length?g[0]:p;return c.ctx&&r(c.ctx[O],c.ctx[O]=m)&&(!c.skip_bound&&c.bound[O]&&c.bound[O](m),h&&O4(n,O)),p}):[],c.update(),h=!0,Ft(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){const O=KW(e.target);c.fragment&&c.fragment.l(O),O.forEach(A)}else c.fragment&&c.fragment.c();e.intro&&M(n.$$.fragment),Re(n,e.target,e.anchor),a$()}Do(a)}class $i{constructor(){Uh(this,"$$");Uh(this,"$$set")}$destroy(){Xe(this,1),this.$destroy=Qe}$on(e,t){if(!Gc(t))return Qe;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!NW(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const d4="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(d4);const p4="modulepreload",g4=function(n){return"/develop/"+n},Sm={},bm=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=Promise.allSettled(t.map(a=>{if(a=g4(a),a in Sm)return;Sm[a]=!0;const c=a.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${h}`))return;const O=document.createElement("link");if(O.rel=c?"stylesheet":p4,c||(O.as="script"),O.crossOrigin="",O.href=a,o&&O.setAttribute("nonce",o),document.head.appendChild(O),c)return new Promise((p,g)=>{O.addEventListener("load",p),O.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}function s(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return r.then(l=>{for(const o of l||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};class mt{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,i){let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),hr.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),hr.from(i,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),i=this.length-this.scanIdentical(e,-1),r=new Io(this),s=new Io(e);for(let l=t,o=t;;){if(r.next(l),s.next(l),l=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new Io(this,e)}iterRange(e,t=this.length){return new f$(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new c$(i)}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]?mt.empty:e.length<=32?new ni(e):hr.from(ni.split(e,[]))}}class ni extends mt{constructor(e,t=m4(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.text[s],o=r+l.length;if((t?i:o)>=e)return new S4(r,o,i,l);r=o+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new ni($m(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let l=i.pop(),o=ic(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new ni(o,l.length+s.length));else{let a=o.length>>1;i.push(new ni(o.slice(0,a)),new ni(o.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof ni))return super.replace(e,t,i);let r=ic(this.text,ic(i.text,$m(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new ni(r,s):hr.from(ni.split(r,[]),s)}sliceString(e,t=this.length,i=` +}`,O=`__svelte_${t4(h)}_${o}`,p=i$(n),{stylesheet:g,rules:m}=dc.get(p)||i4(p,n);m[O]||(m[O]=!0,g.insertRule(`@keyframes ${O} ${h}`,g.cssRules.length));const $=n.style.animation||"";return n.style.animation=`${$?`${$}, `:""}${O} ${i}ms linear ${r}ms 1 both`,pc+=1,O}function s$(n,e){const t=(n.style.animation||"").split(", "),i=t.filter(e?s=>s.indexOf(e)<0:s=>s.indexOf("__svelte")===-1),r=t.length-i.length;r&&(n.style.animation=i.join(", "),pc-=r,pc||n4())}function n4(){wd(()=>{pc||(dc.forEach(n=>{const{ownerNode:e}=n.stylesheet;e&&X(e)}),dc.clear())})}function r4(n,e,t,i){if(!e)return Qe;const r=n.getBoundingClientRect();if(e.left===r.left&&e.right===r.right&&e.top===r.top&&e.bottom===r.bottom)return Qe;const{delay:s=0,duration:l=300,easing:o=vd,start:a=Jb()+s,end:c=a+l,tick:h=Qe,css:O}=t(n,{from:e,to:r},i);let p=!0,g=!1,m;function $(){O&&(m=vO(n,0,1,l,s,o,O)),s||(g=!0)}function y(){O&&s$(n,m),p=!1}return t$(_=>{if(!g&&_>=a&&(g=!0),g&&_>=c&&(h(1,0),y()),!p)return!1;if(g){const x=_-a,R=0+1*o(x/l);h(R,1-R)}return!0}),$(),h(0,1),y}function s4(n){const e=getComputedStyle(n);if(e.position!=="absolute"&&e.position!=="fixed"){const{width:t,height:i}=e,r=n.getBoundingClientRect();n.style.position="absolute",n.style.width=t,n.style.height=i,l4(n,r)}}function l4(n,e){const t=n.getBoundingClientRect();if(e.left!==t.left||e.top!==t.top){const i=getComputedStyle(n),r=i.transform==="none"?"":i.transform;n.style.transform=`${r} translate(${e.left-t.left}px, ${e.top-t.top}px)`}}let Fo;function Do(n){Fo=n}function l$(){if(!Fo)throw new Error("Function called outside component initialization");return Fo}function Hc(n){l$().$$.on_mount.push(n)}function en(){const n=l$();return(e,t,{cancelable:i=!1}={})=>{const r=n.$$.callbacks[e];if(r){const s=r$(e,t,{cancelable:i});return r.slice().forEach(l=>{l.call(n,s)}),!s.defaultPrevented}return!0}}function mm(n,e){const t=n.$$.callbacks[e.type];t&&t.slice().forEach(i=>i.call(this,e))}const bl=[],Et=[];let Pl=[];const wO=[],o$=Promise.resolve();let QO=!1;function a$(){QO||(QO=!0,o$.then(f$))}function Fn(){return a$(),o$}function Hn(n){Pl.push(n)}function Vo(n){wO.push(n)}const Eh=new Set;let gl=0;function f$(){if(gl!==0)return;const n=Fo;do{try{for(;gln.indexOf(i)===-1?e.push(i):t.push(i)),t.forEach(i=>i()),Pl=e}let Qo;function f4(){return Qo||(Qo=Promise.resolve(),Qo.then(()=>{Qo=null})),Qo}function zh(n,e,t){n.dispatchEvent(r$(`${e?"intro":"outro"}${t}`))}const tc=new Set;let Er;function Je(){Er={r:0,c:[],p:Er}}function et(){Er.r||Ft(Er.c),Er=Er.p}function D(n,e){n&&n.i&&(tc.delete(n),n.i(e))}function j(n,e,t,i){if(n&&n.o){if(tc.has(n))return;tc.add(n),Er.c.push(()=>{tc.delete(n),i&&(t&&n.d(1),i())}),n.o(e)}else i&&i()}const c4={duration:0};function vl(n,e,t,i){let s=e(n,t,{direction:"both"}),l=i?0:1,o=null,a=null,c=null,h;function O(){c&&s$(n,c)}function p(m,$){const y=m.b-l;return $*=Math.abs(y),{a:l,b:m.b,d:y,duration:$,start:m.start,end:m.start+$,group:m.group}}function g(m){const{delay:$=0,duration:y=300,easing:_=vd,tick:x=Qe,css:R}=s||c4,A={start:Jb()+$,b:m};m||(A.group=Er,Er.r+=1),"inert"in n&&(m?h!==void 0&&(n.inert=h):(h=n.inert,n.inert=!0)),o||a?a=A:(R&&(O(),c=vO(n,l,m,y,$,_,R)),m&&x(0,1),o=p(A,y),Hn(()=>zh(n,m,"start")),t$(C=>{if(a&&C>a.start&&(o=p(a,y),a=null,zh(n,o.b,"start"),R&&(O(),c=vO(n,l,o.b,o.duration,0,_,s.css))),o){if(C>=o.end)x(l=o.b,1-l),zh(n,o.b,"end"),a||(o.b?O():--o.group.r||Ft(o.group.c)),o=null;else if(C>=o.start){const z=C-o.start;l=o.a+o.d*_(z/o.duration),x(l,1-l)}}return!!(o||a)}))}return{run(m){Gc(s)?f4().then(()=>{s=s({direction:m?"in":"out"}),g(m)}):g(m)},end(){O(),o=a=null}}}function st(n){return(n==null?void 0:n.length)!==void 0?n:Array.from(n)}function u4(n,e){j(n,1,1,()=>{e.delete(n.key)})}function h4(n,e){n.f(),u4(n,e)}function O4(n,e,t,i,r,s,l,o,a,c,h,O){let p=n.length,g=s.length,m=p;const $={};for(;m--;)$[n[m].key]=m;const y=[],_=new Map,x=new Map,R=[];for(m=g;m--;){const V=O(r,s,m),M=t(V);let B=l.get(M);B?R.push(()=>B.p(V,e)):(B=c(M,V),B.c()),_.set(M,y[m]=B),M in $&&x.set(M,Math.abs(m-$[M]))}const A=new Set,C=new Set;function z(V){D(V,1),V.m(o,h),l.set(V.key,V),h=V.first,g--}for(;p&&g;){const V=y[g-1],M=n[p-1],B=V.key,N=M.key;V===M?(h=V.first,p--,g--):_.has(N)?!l.has(B)||A.has(B)?z(V):C.has(N)?p--:x.get(B)>x.get(N)?(C.add(B),z(V)):(A.add(N),p--):(a(M,l),p--)}for(;p--;){const V=n[p];_.has(V.key)||a(V,l)}for(;g;)z(y[g-1]);return Ft(R),y}function qo(n,e,t){const i=n.$$.props[e];i!==void 0&&(n.$$.bound[i]=t,t(n.$$.ctx[i]))}function Ae(n){n&&n.c()}function Re(n,e,t){const{fragment:i,after_update:r}=n.$$;i&&i.m(e,t),Hn(()=>{const s=n.$$.on_mount.map(Gb).filter(Gc);n.$$.on_destroy?n.$$.on_destroy.push(...s):Ft(s),n.$$.on_mount=[]}),r.forEach(Hn)}function Xe(n,e){const t=n.$$;t.fragment!==null&&(a4(t.after_update),Ft(t.on_destroy),t.fragment&&t.fragment.d(e),t.on_destroy=t.fragment=null,t.ctx=[])}function d4(n,e){n.$$.dirty[0]===-1&&(bl.push(n),a$(),n.$$.dirty.fill(0)),n.$$.dirty[e/31|0]|=1<{const m=g.length?g[0]:p;return c.ctx&&r(c.ctx[O],c.ctx[O]=m)&&(!c.skip_bound&&c.bound[O]&&c.bound[O](m),h&&d4(n,O)),p}):[],c.update(),h=!0,Ft(c.before_update),c.fragment=i?i(c.ctx):!1,e.target){if(e.hydrate){const O=Jx(e.target);c.fragment&&c.fragment.l(O),O.forEach(X)}else c.fragment&&c.fragment.c();e.intro&&D(n.$$.fragment),Re(n,e.target,e.anchor),f$()}Do(a)}class $i{constructor(){Uh(this,"$$");Uh(this,"$$set")}$destroy(){Xe(this,1),this.$destroy=Qe}$on(e,t){if(!Gc(t))return Qe;const i=this.$$.callbacks[e]||(this.$$.callbacks[e]=[]);return i.push(t),()=>{const r=i.indexOf(t);r!==-1&&i.splice(r,1)}}$set(e){this.$$set&&!jx(e)&&(this.$$.skip_bound=!0,this.$$set(e),this.$$.skip_bound=!1)}}const p4="4";typeof window<"u"&&(window.__svelte||(window.__svelte={v:new Set})).v.add(p4);const g4="modulepreload",m4=function(n){return"/develop/"+n},Sm={},bm=function(e,t,i){let r=Promise.resolve();if(t&&t.length>0){document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),o=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));r=Promise.allSettled(t.map(a=>{if(a=m4(a),a in Sm)return;Sm[a]=!0;const c=a.endsWith(".css"),h=c?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${h}`))return;const O=document.createElement("link");if(O.rel=c?"stylesheet":g4,c||(O.as="script"),O.crossOrigin="",O.href=a,o&&O.setAttribute("nonce",o),document.head.appendChild(O),c)return new Promise((p,g)=>{O.addEventListener("load",p),O.addEventListener("error",()=>g(new Error(`Unable to preload CSS for ${a}`)))})}))}function s(l){const o=new Event("vite:preloadError",{cancelable:!0});if(o.payload=l,window.dispatchEvent(o),!o.defaultPrevented)throw l}return r.then(l=>{for(const o of l||[])o.status==="rejected"&&s(o.reason);return e().catch(s)})};class mt{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,i){let r=[];return this.decompose(0,e,r,2),i.length&&i.decompose(0,i.length,r,3),this.decompose(t,this.length,r,1),hr.from(r,this.length-(t-e)+i.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){let i=[];return this.decompose(e,t,i,0),hr.from(i,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),i=this.length-this.scanIdentical(e,-1),r=new Io(this),s=new Io(e);for(let l=t,o=t;;){if(r.next(l),s.next(l),l=0,r.lineBreak!=s.lineBreak||r.done!=s.done||r.value!=s.value)return!1;if(o+=r.value.length,r.done||o>=i)return!0}}iter(e=1){return new Io(this,e)}iterRange(e,t=this.length){return new c$(this,e,t)}iterLines(e,t){let i;if(e==null)i=this.iter();else{t==null&&(t=this.lines+1);let r=this.line(e).from;i=this.iterRange(r,Math.max(r,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new u$(i)}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]?mt.empty:e.length<=32?new ni(e):hr.from(ni.split(e,[]))}}class ni extends mt{constructor(e,t=S4(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.text[s],o=r+l.length;if((t?i:o)>=e)return new b4(r,o,i,l);r=o+1,i++}}decompose(e,t,i,r){let s=e<=0&&t>=this.length?this:new ni($m(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(r&1){let l=i.pop(),o=ic(s.text,l.text.slice(),0,s.length);if(o.length<=32)i.push(new ni(o,l.length+s.length));else{let a=o.length>>1;i.push(new ni(o.slice(0,a)),new ni(o.slice(a)))}}else i.push(s)}replace(e,t,i){if(!(i instanceof ni))return super.replace(e,t,i);let r=ic(this.text,ic(i.text,$m(this.text,0,e)),t),s=this.length+i.length-(t-e);return r.length<=32?new ni(r,s):hr.from(ni.split(r,[]),s)}sliceString(e,t=this.length,i=` `){let r="";for(let s=0,l=0;s<=t&&le&&l&&(r+=i),es&&(r+=o.slice(Math.max(0,e-s),t-s)),s=a+1}return r}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let i=[],r=-1;for(let s of e)i.push(s),r+=s.length+1,i.length==32&&(t.push(new ni(i,r)),i=[],r=-1);return r>-1&&t.push(new ni(i,r)),t}}class hr extends mt{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let i of e)this.lines+=i.lines}lineInner(e,t,i,r){for(let s=0;;s++){let l=this.children[s],o=r+l.length,a=i+l.lines-1;if((t?a:o)>=e)return l.lineInner(e,t,i,r);r=o+1,i=a+1}}decompose(e,t,i,r){for(let s=0,l=0;l<=t&&s=l){let c=r&((l<=e?1:0)|(a>=t?2:0));l>=e&&a<=t&&!c?i.push(o):o.decompose(e-l,t-l,i,c)}l=a+1}}replace(e,t,i){if(i.lines=s&&t<=o){let a=l.replace(e-s,t-s,i),c=this.lines-l.lines+a.lines;if(a.lines>4&&a.lines>c>>6){let h=this.children.slice();return h[r]=a,new hr(h,this.length-(t-e)+i.length)}return super.replace(s,o,a)}s=o+1}return super.replace(e,t,i)}sliceString(e,t=this.length,i=` -`){let r="";for(let s=0,l=0;se&&s&&(r+=i),el&&(r+=o.sliceString(e-l,t-l,i)),l=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof hr))return 0;let i=0,[r,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==l||s==o)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let g of e)i+=g.lines;if(i<32){let g=[];for(let m of e)m.flatten(g);return new ni(g,t)}let r=Math.max(32,i>>5),s=r<<1,l=r>>1,o=[],a=0,c=-1,h=[];function O(g){let m;if(g.lines>s&&g instanceof hr)for(let $ of g.children)O($);else g.lines>l&&(a>l||!a)?(p(),o.push(g)):g instanceof ni&&a&&(m=h[h.length-1])instanceof ni&&g.lines+m.lines<=32?(a+=g.lines,c+=g.length+1,h[h.length-1]=new ni(m.text.concat(g.text),m.length+1+g.length)):(a+g.lines>r&&p(),a+=g.lines,c+=g.length+1,h.push(g))}function p(){a!=0&&(o.push(h.length==1?h[0]:hr.from(h,c)),c=-1,a=h.length=0)}for(let g of e)O(g);return p(),o.length==1?o[0]:new hr(o,t)}}mt.empty=new ni([""],0);function m4(n){let e=-1;for(let t of n)e+=t.length+1;return e}function ic(n,e,t=0,i=1e9){for(let r=0,s=0,l=!0;s=t&&(a>i&&(o=o.slice(0,i-r)),r0?1:(e instanceof ni?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],l=s>>1,o=r instanceof ni?r.text.length:r.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` -`,this;e--}else if(r instanceof ni){let a=r.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ni?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class f${constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Io(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}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 i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),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 c${constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(mt.prototype[Symbol.iterator]=function(){return this.iter()},Io.prototype[Symbol.iterator]=f$.prototype[Symbol.iterator]=c$.prototype[Symbol.iterator]=function(){return this});class S4{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}}let xl="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,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,,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(n=>n?parseInt(n,36):1);for(let n=1;nn)return xl[e-1]<=n;return!1}function ym(n){return n>=127462&&n<=127487}const vm=8205;function Ei(n,e,t=!0,i=!0){return(t?u$:$4)(n,e,i)}function u$(n,e,t){if(e==n.length)return e;e&&h$(n.charCodeAt(e))&&O$(n.charCodeAt(e-1))&&e--;let i=Qi(n,e);for(e+=Zn(i);e=0&&ym(Qi(n,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function $4(n,e,t){for(;e>0;){let i=u$(n,e-2,t);if(i=56320&&n<57344}function O$(n){return n>=55296&&n<56320}function Qi(n,e){let t=n.charCodeAt(e);if(!O$(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return h$(i)?(t-55296<<10)+(i-56320)+65536:t}function Qd(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Zn(n){return n<65536?1:2}const _O=/\r\n?|\n/;var ki=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ki||(ki={}));class mr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=o}else{if(i!=ki.Simple&&c>=e&&(i==ki.TrackDel&&re||i==ki.TrackBefore&&re))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i=0&&r<=t&&o>=e)return rt?"cover":!0;r=o}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}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 mr(e)}static create(e){return new mr(e)}}class ui extends mr{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 kO(this,(t,i,r,s,l)=>e=e.replace(r,r+(i-t),l),!1),e}mapDesc(e,t=!1){return PO(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r=0){t[r]=o,t[r+1]=l;let a=r>>1;for(;i.length0&&ds(i,t,s.text),s.forward(h),o+=h}let c=e[l++];for(;o>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],l=0,o=null;function a(h=!1){if(!h&&!r.length)return;lp||O<0||p>t)throw new RangeError(`Invalid change range ${O} to ${p} (in doc of length ${t})`);let m=g?typeof g=="string"?mt.of(g.split(i||_O)):g:mt.empty,$=m.length;if(O==p&&$==0)return;Ol&&Ti(r,O-l,-1),Ti(r,p-O,$),ds(s,r,m),l=p}}return c(e),a(!o),o}static empty(e){return new ui(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;ro&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length=0&&t<=0&&t==n[r+1]?n[r]+=e:e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function ds(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||l==n.sections.length||n.sections[l+1]<0);)o=n.sections[l++],a=n.sections[l++];e(r,c,s,h,O),r=c,s=h}}}function PO(n,e,t,i=!1){let r=[],s=i?[]:null,l=new Go(n),o=new Go(e);for(let a=-1;;)if(l.ins==-1&&o.ins==-1){let c=Math.min(l.len,o.len);Ti(r,c,-1),l.forward(c),o.forward(c)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len=0&&a=0){let c=0,h=l.len;for(;h;)if(o.ins==-1){let O=Math.min(h,o.len);c+=O,h-=O,o.forward(O)}else if(o.ins==0&&o.lena||l.ins>=0&&l.len>a)&&(o||i.length>c),s.forward2(a),l.forward(a)}}}}class Go{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?mt.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?mt.empty:t[i].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 js{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}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 i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new js(i,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return ee.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ee.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}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 ee.range(e.anchor,e.head)}static create(e,t,i){return new js(e,t,i)}}class ee{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:ee.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.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 ee(e.ranges.map(t=>js.fromJSON(t)),e.main)}static single(e,t=e){return new ee([ee.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 i=0,r=0;re?8:0)|s)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;rs.head?ee.range(a,o):ee.range(o,a))}}return new ee(e,t)}}function p$(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let _d=0;class _e{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=_d++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new _e(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:kd),!!e.static,e.enables)}of(e){return new nc([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nc(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nc(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function kd(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class nc{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=_d++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,a=!1,c=!1,h=[];for(let O of this.dependencies)O=="doc"?a=!0:O=="selection"?c=!0:((t=e[O.id])!==null&&t!==void 0?t:1)&1||h.push(e[O.id]);return{create(O){return O.values[l]=i(O),1},update(O,p){if(a&&p.docChanged||c&&(p.docChanged||p.selection)||xO(O,h)){let g=i(O);if(o?!wm(g,O.values[l],r):!r(g,O.values[l]))return O.values[l]=g,1}return 0},reconfigure:(O,p)=>{let g,m=p.config.address[s];if(m!=null){let $=mc(p,m);if(this.dependencies.every(y=>y instanceof _e?p.facet(y)===O.facet(y):y instanceof pi?p.field(y,!1)==O.field(y,!1):!0)||(o?wm(g=i(O),$,r):r(g=i(O),$)))return O.values[l]=$,0}else g=i(O);return O.values[l]=g,1}}}}function wm(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),r=t.map(a=>a.type),s=i.filter(a=>!(a&1)),l=n[e.id]>>1;function o(a){let c=[];for(let h=0;hi===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Qm).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],l=this.updateF(s,r);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,r)=>r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Qm.of({field:this,create:e})]}get extension(){return this}}const qs={lowest:4,low:3,default:2,high:1,highest:0};function _o(n){return e=>new g$(e,n)}const Ks={highest:_o(qs.highest),high:_o(qs.high),default:_o(qs.default),low:_o(qs.low),lowest:_o(qs.lowest)};class g${constructor(e,t){this.inner=e,this.prec=t}}class ql{of(e){return new WO(this,e)}reconfigure(e){return ql.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class WO{constructor(e,t){this.compartment=e,this.inner=t}}class gc{constructor(e,t,i,r,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let r=[],s=Object.create(null),l=new Map;for(let p of v4(e,t,l))p instanceof pi?r.push(p):(s[p.facet.id]||(s[p.facet.id]=[])).push(p);let o=Object.create(null),a=[],c=[];for(let p of r)o[p.id]=c.length<<1,c.push(g=>p.slot(g));let h=i==null?void 0:i.config.facets;for(let p in s){let g=s[p],m=g[0].facet,$=h&&h[p]||[];if(g.every(y=>y.type==0))if(o[m.id]=a.length<<1|1,kd($,g))a.push(i.facet(m));else{let y=m.combine(g.map(_=>_.value));a.push(i&&m.compare(y,i.facet(m))?i.facet(m):y)}else{for(let y of g)y.type==0?(o[y.id]=a.length<<1|1,a.push(y.value)):(o[y.id]=c.length<<1,c.push(_=>y.dynamicSlot(_)));o[m.id]=c.length<<1,c.push(y=>y4(y,m,g))}}let O=c.map(p=>p(o));return new gc(e,l,O,o,a,s)}}function v4(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(l,o){let a=r.get(l);if(a!=null){if(a<=o)return;let c=i[a].indexOf(l);c>-1&&i[a].splice(c,1),l instanceof WO&&t.delete(l.compartment)}if(r.set(l,o),Array.isArray(l))for(let c of l)s(c,o);else if(l instanceof WO){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(l.compartment)||l.inner;t.set(l.compartment,c),s(c,o)}else if(l instanceof g$)s(l.inner,l.prec);else if(l instanceof pi)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof nc)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,qs.default);else{let c=l.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,o)}}return s(n,qs.default),i.reduce((l,o)=>l.concat(o))}function Lo(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function mc(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const m$=_e.define(),S$=_e.define({combine:n=>n.some(e=>e),static:!0}),b$=_e.define({combine:n=>n.length?n[0]:void 0,static:!0}),$$=_e.define(),y$=_e.define(),v$=_e.define(),w$=_e.define({combine:n=>n.length?n[0]:!1});class Ir{constructor(e,t){this.type=e,this.value=t}static define(){return new w4}}class w4{of(e){return new Ir(this,e)}}class Q4{constructor(e){this.map=e}of(e){return new Le(this,e)}}class Le{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 Le(this.type,t)}is(e){return this.type==e}static define(e={}){return new Q4(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}Le.reconfigure=Le.define();Le.appendConfig=Le.define();class hi{constructor(e,t,i,r,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&p$(i,t.newLength),s.some(o=>o.type==hi.time)||(this.annotations=s.concat(hi.time.of(Date.now())))}static create(e,t,i,r,s,l){return new hi(e,t,i,r,s,l)}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(hi.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}hi.time=Ir.define();hi.userEvent=Ir.define();hi.addToHistory=Ir.define();hi.remote=Ir.define();function _4(n,e){let t=[];for(let i=0,r=0;;){let s,l;if(i=n[i]))s=n[i++],l=n[i++];else if(r=0;r--){let s=i[r](n);s instanceof hi?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof hi?n=s[0]:n=_$(e,Wl(s),!1)}return n}function P4(n){let e=n.startState,t=e.facet(v$),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=Q$(i,CO(e,s,n.changes.newLength),!0))}return i==n?n:hi.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const x4=[];function Wl(n){return n==null?x4:Array.isArray(n)?n:[n]}var Lt=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(Lt||(Lt={}));const W4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let TO;try{TO=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function C4(n){if(TO)return TO.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||W4.test(t)))return!0}return!1}function T4(n){return e=>{if(!/\S/.test(e))return Lt.Space;if(C4(e))return Lt.Word;for(let t=0;t-1)return Lt.Word;return Lt.Other}}class Ot{constructor(e,t,i,r,s,l){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;or.set(a,o)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(Le.reconfigure)?(t=null,i=l.value):l.is(Le.appendConfig)&&(t=null,i=Wl(i).concat(l.value));let s;t?s=e.startState.values.slice():(t=gc.resolve(i,r,this),s=new Ot(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,a)=>a.reconfigure(o,this),null).values),new Ot(t,e.newDoc,e.newSelection,s,(l,o)=>o.update(l,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:ee.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],l=Wl(i.effects);for(let o=1;ol.spec.fromJSON(o,a)))}}return Ot.create({doc:e.doc,selection:ee.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=gc.resolve(e.extensions||[],new Map),i=e.doc instanceof mt?e.doc:mt.of((e.doc||"").split(t.staticFacet(Ot.lineSeparator)||_O)),r=e.selection?e.selection instanceof ee?e.selection:ee.single(e.selection.anchor,e.selection.head):ee.single(0);return p$(r,i.length),t.staticFacet(S$)||(r=r.asSingle()),new Ot(t,i,r,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(Ot.tabSize)}get lineBreak(){return this.facet(Ot.lineSeparator)||` -`}get readOnly(){return this.facet(w$)}phrase(e,...t){for(let i of this.facet(Ot.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(m$))for(let l of s(this,t,i))Object.prototype.hasOwnProperty.call(l,e)&&r.push(l[e]);return r}charCategorizer(e){return T4(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-i,o=e-i;for(;l>0;){let a=Ei(t,l,!1);if(s(t.slice(a,l))!=Lt.Word)break;l=a}for(;on.length?n[0]:4});Ot.lineSeparator=b$;Ot.readOnly=w$;Ot.phrases=_e.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});Ot.languageData=m$;Ot.changeFilter=$$;Ot.transactionFilter=y$;Ot.transactionExtender=v$;ql.reconfigure=Le.define();function br(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let l=r[s],o=i[s];if(o===void 0)i[s]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](o,l);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Fs{eq(e){return this==e}range(e,t=e){return ZO.create(e,t,this)}}Fs.prototype.startSide=Fs.prototype.endSide=0;Fs.prototype.point=!1;Fs.prototype.mapMode=ki.TrackDel;let ZO=class k${constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new k$(e,t,i)}};function RO(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Pd{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let l=r,o=s.length;;){if(l==o)return l;let a=l+o>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==l)return c>=0?l:o;c>=0?o=a:l=a+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),l=this.findIndex(i,1e9,!1,s);sg||p==g&&c.startSide>0&&c.endSide<=0)continue;(g-p||c.endSide-c.startSide)<0||(l<0&&(l=p),c.point&&(o=Math.max(o,g-p)),i.push(c),r.push(p-l),s.push(g-l))}return{mapped:i.length?new Pd(r,s,i,o):null,pos:l}}}class vt{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new vt(e,t,i,r)}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:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(i&&(t=t.slice().sort(RO)),this.isEmpty)return t.length?vt.of(t):this;let o=new P$(this,null,-1).goto(0),a=0,c=[],h=new ys;for(;o.value||a=0){let O=t[a++];h.addInner(O.from,O.to,O.value)||c.push(O)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||so.to||s=s&&e<=s+l.length&&l.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Ho.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ho.from(e).goto(t)}static compare(e,t,i,r,s=-1){let l=e.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),o=t.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),a=_m(l,o,i),c=new ko(l,a,s),h=new ko(o,a,s);i.iterGaps((O,p,g)=>km(c,O,h,p,g,r)),i.empty&&i.length==0&&km(c,0,h,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),l=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let o=_m(s,l),a=new ko(s,o,0).goto(i),c=new ko(l,o,0).goto(i);for(;;){if(a.to!=c.to||!XO(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,t,i,r,s=-1){let l=new ko(e,null,s).goto(t),o=t,a=l.openStart;for(;;){let c=Math.min(l.to,i);if(l.point){let h=l.activeForPoint(l.to),O=l.pointFromo&&(r.span(o,c,l.active,a),a=l.openEnd(c));if(l.to>i)return a+(l.point&&l.to>i?1:0);o=l.to,l.next()}}static of(e,t=!1){let i=new ys;for(let r of e instanceof ZO?[e]:t?Z4(e):e)i.add(r.from,r.to,r.value);return i.finish()}}vt.empty=new vt([],[],null,-1);function Z4(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(RO);e=i}return n}vt.empty.nextLayer=vt.empty;class ys{finishChunk(e){this.chunks.push(new Pd(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,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new ys)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<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=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.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 i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(vt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=vt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function _m(n,e,t){let i=new Map;for(let s of n)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new P$(l,t,i,s));return r.length==1?r[0]:new Ho(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Mh(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Mh(this.heap,i);(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(),Mh(this.heap,0)}}}function Mh(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class ko{constructor(e,t,i){this.minPoint=i,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=Ho.from(e,t,i)}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){Cf(this.active,e),Cf(this.activeTo,e),Cf(this.activeRank,e),this.minActive=Pm(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Cf(i,r)}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(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function km(n,e,t,i,r,s){n.goto(e),t.goto(i);let l=i+r,o=i,a=i-e;for(;;){let c=n.to+a-t.to||n.endSide-t.endSide,h=c<0?n.to+a:t.to,O=Math.min(h,l);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&XO(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(o,O,n.point,t.point):O>o&&!XO(n.active,t.active)&&s.compareRange(o,O,n.active,t.active),h>l)break;o=h,c<=0&&n.next(),c>=0&&t.next()}}function XO(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Pm(n,e){let t=-1,i=1e9;for(let r=0;r=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=Ei(n,r)}return i===!0?-1:n.length}const YO="ͼ",xm=typeof Symbol>"u"?"__"+YO:Symbol.for(YO),UO=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),Wm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class vs{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,o,a,c){let h=[],O=/^@(\w+)\b/.exec(l[0]),p=O&&O[1]=="keyframes";if(O&&o==null)return a.push(l[0]+";");for(let g in o){let m=o[g];if(/&/.test(g))s(g.split(/,\s*/).map($=>l.map(y=>$.replace(/&/,y))).reduce(($,y)=>$.concat(y)),m,a);else if(m&&typeof m=="object"){if(!O)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(r(g),m,h,p)}else m!=null&&h.push(g.replace(/_.*/,"").replace(/[A-Z]/g,$=>"-"+$.toLowerCase())+": "+m+";")}(h.length||p)&&a.push((i&&!O&&!c?l.map(i):l).join(", ")+" {"+h.join(" ")+"}")}for(let l in e)s(r(l),e[l],this.rules)}getRules(){return this.rules.join(` -`)}static newName(){let e=Wm[xm]||1;return Wm[xm]=e+1,YO+e.toString(36)}static mount(e,t,i){let r=e[UO],s=i&&i.nonce;r?s&&r.setNonce(s):r=new R4(e,s),r.mount(Array.isArray(t)?t:[t])}}let Cm=new Map;class R4{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Cm.get(i);if(s)return e.adoptedStyleSheets=[s.sheet,...e.adoptedStyleSheets],e[UO]=s;this.sheet=new r.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Cm.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let s=e.head||e;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],e[UO]=this}mount(e){let t=this.sheet,i=0,r=0;for(let s=0;s-1&&(this.modules.splice(o,1),r--,o=-1),o==-1){if(this.modules.splice(r++,0,l),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},X4=typeof navigator<"u"&&/Mac/.test(navigator.platform),A4=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var _i=0;_i<10;_i++)ws[48+_i]=ws[96+_i]=String(_i);for(var _i=1;_i<=24;_i++)ws[_i+111]="F"+_i;for(var _i=65;_i<=90;_i++)ws[_i]=String.fromCharCode(_i+32),Ko[_i]=String.fromCharCode(_i);for(var Dh in ws)Ko.hasOwnProperty(Dh)||(Ko[Dh]=ws[Dh]);function Y4(n){var e=X4&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||A4&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ko:ws)[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 Sc(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function EO(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function U4(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function rc(n,e){if(!e.anchorNode)return!1;try{return EO(n,e.anchorNode)}catch{return!1}}function Jo(n){return n.nodeType==3?Gs(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function bc(n,e,t,i){return t?Tm(n,e,t,i,-1)||Tm(n,e,t,i,1):!1}function ea(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Tm(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:Mr(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=ea(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?Mr(n):0}else return!1}}function Mr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function xd(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function E4(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function z4(n,e,t,i,r,s,l,o){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,O=!1;h&&!O;)if(h.nodeType==1){let p,g=h==a.body,m=1,$=1;if(g)p=E4(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(O=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let W=h.getBoundingClientRect();m=W.width/h.offsetWidth,$=W.height/h.offsetHeight,p={left:W.left,right:W.left+h.clientWidth*m,top:W.top,bottom:W.top+h.clientHeight*$}}let y=0,_=0;if(r=="nearest")e.top0&&e.bottom>p.bottom+_&&(_=e.bottom-p.bottom+_+l)):e.bottom>p.bottom&&(_=e.bottom-p.bottom+l,t<0&&e.top-_0&&e.right>p.right+y&&(y=e.right-p.right+y+s)):e.right>p.right&&(y=e.right-p.right+s,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class D4{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:i}=e;this.set(t,Math.min(e.anchorOffset,t?Mr(t):0),i,Math.min(e.focusOffset,i?Mr(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let gl=null;function x$(n){if(n.setActive)return n.setActive();if(gl)return n.focus(gl);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(gl==null?{get preventScroll(){return gl={preventScroll:!0},!0}}:void 0),!gl){gl=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class Yi{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Yi(e.parentNode,ea(e),t)}static after(e,t){return new Yi(e.parentNode,ea(e)+1,t)}}const Wd=[];class Dt{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,r=null,s;for(let l of this.children){if(l.flags&7){if(!l.dom&&(s=r?r.nextSibling:i.firstChild)){let o=Dt.get(s);(!o||!o.parent&&o.canReuseDOM(l))&&l.reuseDOM(s)}l.sync(e,t),l.flags&=-8}if(s=r?r.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&s!=l.dom&&(t.written=!0),l.dom.parentNode==i)for(;s&&s!=l.dom;)s=Rm(s);else i.insertBefore(l.dom,s);r=l.dom}for(s=r?r.nextSibling:i.firstChild,s&&t&&t.node==i&&(t.written=!0);s;)s=Rm(s)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let r=Mr(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;r==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?r=-1:r=1),e=s}r<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Dt.get(i);)i=i.nextSibling;if(!i)return this.length;for(let r=0,s=0;;r++){let l=this.children[r];if(l.dom==i)return s;s+=l.length+l.breakAfter}}domBoundsAround(e,t,i=0){let r=-1,s=-1,l=-1,o=-1;for(let a=0,c=i,h=i;at)return O.domBoundsAround(e,t,c);if(p>=e&&r==-1&&(r=a,s=c),c>t&&O.dom.parentNode==this.dom){l=a,o=h;break}h=p,c=p+O.breakAfter}return{from:s,to:o<0?i+this.length:o,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=Wd){this.markDirty();for(let r=e;rthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function Z$(n,e,t,i,r,s,l,o,a){let{children:c}=n,h=c.length?c[e]:null,O=s.length?s[s.length-1]:null,p=O?O.breakAfter:l;if(!(e==i&&h&&!l&&!p&&s.length<2&&h.merge(t,r,s.length?O:null,t==0,o,a))){if(i0&&(!l&&s.length&&h.merge(t,h.length,s[0],!1,o,0)?h.breakAfter=s.shift().breakAfter:(t2);var xe={mac:Ym||/Mac/.test(dn.platform),windows:/Win/.test(dn.platform),linux:/Linux|X11/.test(dn.platform),ie:Kc,ie_version:X$?zO.documentMode||6:DO?+DO[1]:MO?+MO[1]:0,gecko:Xm,gecko_version:Xm?+(/Firefox\/(\d+)/.exec(dn.userAgent)||[0,0])[1]:0,chrome:!!Vh,chrome_version:Vh?+Vh[1]:0,ios:Ym,android:/Android\b/.test(dn.userAgent),webkit:Am,safari:A$,webkit_version:Am?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:zO.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const I4=256;class Dr extends Dt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Dr)||this.length-(t-e)+i.length>I4||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Dr(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Yi(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return L4(this.dom,e,t)}}class Vr extends Dt{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let r of t)r.setParent(this)}setAttrs(e){if(W$(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,r,s,l){return i&&(!(i instanceof Vr&&i.mark.eq(this.mark))||e&&s<=0||te&&t.push(i=e&&(r=s),i=a,s++}let l=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new Vr(this.mark,t,l)}domAtPos(e){return Y$(this,e)}coordsAt(e,t){return E$(this,e,t)}}function L4(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let r=e,s=e,l=0;e==0&&t<0||e==i&&t>=0?xe.chrome||xe.gecko||(e?(r--,l=1):s=0)?0:o.length-1];return xe.safari&&!l&&a.width==0&&(a=Array.prototype.find.call(o,c=>c.width)||a),l?xd(a,l<0):a||null}class ps extends Dt{static create(e,t,i){return new ps(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=ps.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,r,s,l){return i&&(!(i instanceof ps)||!this.widget.compare(i.widget)||e>0&&s<=0||t0)?Yi.before(this.dom):Yi.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let l=this.side?this.side<0:e>0;for(let o=l?r.length-1:0;s=r[o],!(e>0?o==0:o==r.length-1||s.top0?Yi.before(this.dom):Yi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return mt.empty}get isHidden(){return!0}}Dr.prototype.children=ps.prototype.children=Ul.prototype.children=Wd;function Y$(n,e){let t=n.dom,{children:i}=n,r=0;for(let s=0;rs&&e0;s--){let l=i[s-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let s=r;s0&&e instanceof Vr&&r.length&&(i=r[r.length-1])instanceof Vr&&i.mark.eq(e.mark)?U$(i,e.children[0],t-1):(r.push(e),e.setParent(n)),n.length+=e.length}function E$(n,e,t){let i=null,r=-1,s=null,l=-1;function o(c,h){for(let O=0,p=0;O=h&&(g.children.length?o(g,h-p):(!s||s.isHidden&&t>0)&&(m>h||p==m&&g.getSide()>0)?(s=g,l=h-p):(p-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function qO(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function j4(n){let e=Object.create(null);for(let t=0;t0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Cd(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){U$(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=VO(t,this.attrs||{})),i&&(this.attrs=VO({class:i},this.attrs||{}))}domAtPos(e){return Y$(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(W$(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(qO(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&Dt.get(r)instanceof Vr;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((i=Dt.get(r))===null||i===void 0?void 0:i.isEditable)==!1&&(!xe.ios||!this.children.some(s=>s instanceof Dr))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Dr)||/[^ -~]/.test(i.text))return null;let r=Jo(i.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=E$(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=i.bottom-i.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof ci)return s;if(l>t)break}r=l+s.breakAfter}return null}}class Ss extends Dt{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,r,s,l){return i&&(!(i instanceof Ss)||!this.widget.compare(i.widget)||e>0&&s<=0||t0}}class Lr{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,i){return null}get isHidden(){return!1}destroy(e){}}var Ii=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Ii||(Ii={}));class Ye extends Fs{constructor(e,t,i,r){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new da(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Qs(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:l}=z$(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(l?t?2e8:1:-6e8)+1}return new Qs(e,i,r,t,e.widget||null,!0)}static line(e){return new pa(e)}static set(e,t=!1){return vt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ye.none=vt.empty;class da extends Ye{constructor(e){let{start:t,end:i}=z$(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof da&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&Cd(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}da.prototype.point=!1;class pa extends Ye{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof pa&&this.spec.class==e.spec.class&&Cd(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)}}pa.prototype.mapMode=ki.TrackBefore;pa.prototype.point=!0;class Qs extends Ye{constructor(e,t,i,r,s,l){super(t,i,s,e),this.block=r,this.isReplace=l,this.mapMode=r?t<=0?ki.TrackBefore:ki.TrackAfter:ki.TrackDel}get type(){return this.startSide!=this.endSide?Ii.WidgetRange:this.startSide<=0?Ii.WidgetBefore:Ii.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Qs&&B4(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)}}Qs.prototype.point=!0;function z$(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function B4(n,e){return n==e||!!(n&&e&&n.compare(e))}function IO(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class No{constructor(e,t,i,r){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Ss&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ci),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Zf(new Ul(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Ss)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:l,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(l){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Zf(new Dr(this.text.slice(this.textOff,this.textOff+r)),t),i),this.atCursorPos=!0,this.textOff+=r,e-=r,i=0}}span(e,t,i,r){this.buildText(t-e,i,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,i,r,s,l){if(this.disallowBlockEffectsFor[l]&&i instanceof Qs){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=t-e;if(i instanceof Qs)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ss(i.widget||new Em("div"),o,i));else{let a=ps.create(i.widget||new Em("span"),o,o?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&s<=r.length&&(e0),h=!a.isEditable&&(er.length||i.startSide<=0),O=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),c&&(O.append(Zf(new Ul(1),r),s),s=r.length+Math.max(0,s-r.length)),O.append(Zf(a,r),s),this.atCursorPos=h,this.pendingBuffer=h?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,i,r,s){let l=new No(e,t,i,s);return l.openEnd=vt.spans(r,t,i,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function Zf(n,e){for(let t of e)n=new Vr(t,[n],n.length);return n}class Em extends Lr{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}}const M$=_e.define(),D$=_e.define(),V$=_e.define(),q$=_e.define(),LO=_e.define(),I$=_e.define(),L$=_e.define(),N$=_e.define({combine:n=>n.some(e=>e)}),j$=_e.define({combine:n=>n.some(e=>e)});class Tl{constructor(e,t="nearest",i="nearest",r=5,s=5,l=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new Tl(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 Tl(ee.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Rf=Le.define({map:(n,e)=>n.map(e)});function An(n,e,t){let i=n.facet(q$);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Jc=_e.define({combine:n=>n.length?n[0]:!0});let F4=0;const Ao=_e.define();class li{constructor(e,t,i,r,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.extension=s(this)}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:s,decorations:l}=t||{};return new li(F4++,e,i,r,o=>{let a=[Ao.of(o)];return l&&a.push(ta.of(c=>{let h=c.plugin(o);return h?l(h):Ye.none})),s&&a.push(s(o)),a})}static fromClass(e,t){return li.define(i=>new e(i),t)}}class qh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}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(i){if(An(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){An(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(i){An(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const B$=_e.define(),Td=_e.define(),ta=_e.define(),Zd=_e.define(),F$=_e.define();function zm(n,e,t){let i=n.state.facet(F$);if(!i.length)return i;let r=i.map(l=>l instanceof Function?l(n):l),s=[];return vt.spans(r,e,t,{point(){},span(l,o,a,c){let h=s;for(let O=a.length-1;O>=0;O--,c--){let p=a[O].spec.bidiIsolate,g;if(p!=null)if(c>0&&h.length&&(g=h[h.length-1]).to==l&&g.direction==p)g.to=o,h=g.inner;else{let m={from:l,to:o,direction:p,inner:[]};h.push(m),h=m.inner}}}}),s}const G$=_e.define();function H$(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(G$)){let l=s(n);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(i=Math.max(i,l.top)),l.bottom!=null&&(r=Math.max(r,l.bottom)))}return{left:e,right:t,top:i,bottom:r}}const Yo=_e.define();class Yn{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Yn(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,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toAh)break;s+=2}if(!a)return i;new Yn(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),l=a.toA,o=a.toB}}}class $c{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=ui.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,l,o,a)=>r.push(new Yn(s,l,o,a))),this.changedRanges=r}static create(e,t,i){return new $c(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}}var jt=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(jt||(jt={}));const ia=jt.LTR,K$=jt.RTL;function J$(n){let e=[];for(let t=0;t=t){if(o.level==i)return l;(s<0||(r!=0?r<0?o.fromt:e[s].level>o.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function ey(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;$-=3)if(or[$+1]==-g){let y=or[$+2],_=y&2?r:y&4?y&1?s:r:0;_&&(Xt[O]=Xt[or[$]]=_),o=$;break}}else{if(or.length==189)break;or[o++]=O,or[o++]=p,or[o++]=a}else if((m=Xt[O])==2||m==1){let $=m==r;a=$?0:1;for(let y=o-3;y>=0;y-=3){let _=or[y+2];if(_&2)break;if($)or[y+2]|=2;else{if(_&4)break;or[y+2]|=4}}}}}function i5(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let l=r?t[r-1].to:n,o=ra;)m==y&&(m=t[--$].from,y=$?t[$-1].to:n),Xt[--m]=g;a=h}else s=c,a++}}}function jO(n,e,t,i,r,s,l){let o=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;aa&&l.push(new gs(a,$.from,g));let y=$.direction==ia!=!(g%2);BO(n,y?i+1:i,r,$.inner,$.from,$.to,l),a=$.to}m=$.to}else{if(m==t||(h?Xt[m]!=o:Xt[m]==o))break;m++}p?jO(n,a,m,i+1,r,p,l):ae;){let h=!0,O=!1;if(!c||a>s[c-1].to){let $=Xt[a-1];$!=o&&(h=!1,O=$==16)}let p=!h&&o==1?[]:null,g=h?i:i+1,m=a;e:for(;;)if(c&&m==s[c-1].to){if(O)break e;let $=s[--c];if(!h)for(let y=$.from,_=c;;){if(y==e)break e;if(_&&s[_-1].to==y)y=s[--_].from;else{if(Xt[y-1]==o)break e;break}}if(p)p.push($);else{$.toXt.length;)Xt[Xt.length]=256;let i=[],r=e==ia?0:1;return BO(n,r,r,t,0,n.length,i),i}function ty(n){return[new gs(0,n,0)]}let iy="";function r5(n,e,t,i,r){var s;let l=i.head-n.from,o=-1;if(l==0){if(!r||!n.length)return null;e[0].level!=t&&(l=e[0].side(!1,t),o=0)}else if(l==n.length){if(r)return null;let p=e[e.length-1];p.level!=t&&(l=p.side(!0,t),o=e.length-1)}o<0&&(o=gs.find(e,l,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc));let a=e[o];l==a.side(r,t)&&(a=e[o+=r?1:-1],l=a.side(!r,t));let c=r==(a.dir==t),h=Ei(n.text,l,c);if(iy=n.text.slice(Math.min(l,h),Math.max(l,h)),h!=a.side(r,t))return ee.cursor(h+n.from,c?-1:1,a.level);let O=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return!O&&a.level!=t?ee.cursor(r?n.to:n.from,r?-1:1,t):O&&O.level0&&i.length&&(i.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let r=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!u5(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?l5(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Yn(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(xe.ie||xe.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.updateDeco(),a=f5(l,o,e.changes);return i=Yn.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=xe.chrome||xe.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||r.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?r[l]:null;if(!o)break;let{fromA:a,toA:c,fromB:h,toB:O}=o,p,g,m,$;if(i&&i.range.fromBh){let X=No.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),C=No.build(this.view.state.doc,i.range.toB,O,this.decorations,this.dynamicDecorationMap);g=X.breakAtStart,m=X.openStart,$=C.openEnd;let E=this.compositionView(i);C.breakAtStart?E.breakAfter=1:C.content.length&&E.merge(E.length,E.length,C.content[0],!1,C.openStart,0)&&(E.breakAfter=C.content[0].breakAfter,C.content.shift()),X.content.length&&E.merge(0,0,X.content[X.content.length-1],!0,0,X.openEnd)&&X.content.pop(),p=X.content.concat(E).concat(C.content)}else({content:p,breakAtStart:g,openStart:m,openEnd:$}=No.build(this.view.state.doc,h,O,this.decorations,this.dynamicDecorationMap));let{i:y,off:_}=s.findPos(c,1),{i:W,off:R}=s.findPos(a,-1);Z$(this,W,R,y,_,p,g,m,$)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new Dr(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new Vr(r,[t],t.length);let i=new ci;return i.append(t,0),i}fixCompositionDOM(e){let t=(s,l)=>{l.flags|=8|(l.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(l);let o=Dt.get(s);o&&o!=l&&(o.dom=null),l.setDOM(s)},i=this.childPos(e.range.fromB,1),r=this.children[i.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)i=r.childPos(i.off,1),r=r.children[i.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,r=i==this.dom,s=!r&&rc(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(r||t||s))return;let l=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),c=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(xe.gecko&&o.empty&&!this.hasComposition&&s5(a)){let O=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(O,a.node.childNodes[a.offset]||null)),a=c=new Yi(O,0),l=!0}let h=this.view.observer.selectionRange;(l||!h.focusNode||!bc(a.node,a.offset,h.anchorNode,h.anchorOffset)||!bc(c.node,c.offset,h.focusNode,h.focusOffset))&&(this.view.observer.ignore(()=>{xe.android&&xe.chrome&&this.dom.contains(h.focusNode)&&c5(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let O=Sc(this.view.root);if(O)if(o.empty){if(xe.gecko){let p=o5(a.node,a.offset);if(p&&p!=3){let g=ry(a.node,a.offset,p==1?1:-1);g&&(a=new Yi(g.node,g.offset))}}O.collapse(a.node,a.offset),o.bidiLevel!=null&&O.caretBidiLevel!==void 0&&(O.caretBidiLevel=o.bidiLevel)}else if(O.extend){O.collapse(a.node,a.offset);try{O.extend(c.node,c.offset)}catch{}}else{let p=document.createRange();o.anchor>o.head&&([a,c]=[c,a]),p.setEnd(c.node,c.offset),p.setStart(a.node,a.offset),O.removeAllRanges(),O.addRange(p)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Yi(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Yi(h.focusNode,h.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Sc(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let l=ci.find(this,t.head);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let O=e.observer.selectionRange;e.docView.posFromDOM(O.anchorNode,O.anchorOffset)!=t.from&&i.collapse(r,s)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let r=e.offset;!i&&r=0;r--){let s=Dt.get(t.childNodes[r]);s instanceof ci&&(i=s.domAtPos(s.length))}return i?new Yi(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=Dt.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;l--){let o=this.children[l],a=s-o.breakAfter,c=a-o.length;if(ae||o.covers(1))&&(!i||o instanceof ci&&!(i instanceof ci&&t>=0))&&(i=o,r=c),s=c}return i?i.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),r=this.children[t];if(!(r instanceof ci))return null;for(;r.children.length;){let{i:o,off:a}=r.childPos(i,1);for(;;o++){if(o==r.children.length)return null;if((r=r.children[o]).length)break}i=a}if(!(r instanceof Dr))return null;let s=Ei(r.text,i);if(s==i)return null;let l=Gs(r.dom,i,s).getClientRects();for(let o=0;oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==jt.LTR;for(let c=0,h=0;hr)break;if(c>=i){let g=O.dom.getBoundingClientRect();if(t.push(g.height),l){let m=O.dom.lastChild,$=m?Jo(m):[];if($.length){let y=$[$.length-1],_=a?y.right-g.left:g.right-y.left;_>o&&(o=_,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=p)}}}c=p+O.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?jt.RTL:jt.LTR}measureTextSize(){for(let s of this.children)if(s instanceof ci){let l=s.measureTextSize();if(l)return l}let e=document.createElement("div"),t,i,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=Jo(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new T$(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],l=s?s.from-1:this.length;if(l>i){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Ye.replace({widget:new Dm(o),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!s)break;i=s.to+1}return Ye.set(e)}updateDeco(){let e=this.view.state.facet(ta).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),r;if(!i)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=H$(this.view),l={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;z4(this.view.scrollDOM,l,t.head0)i=i.childNodes[r-1],r=Mr(i);else break}if(t>=0)for(let i=n,r=e;;){if(i.nodeType==3)return{node:i,offset:r};if(i.nodeType==1&&r=0)i=i.childNodes[r],r=0;else break}return null}function o5(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}function h5(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return ee.cursor(e);s==0?t=1:s==r.length&&(t=-1);let l=s,o=s;t<0?l=Ei(r.text,s,!1):o=Ei(r.text,s);let a=i(r.text.slice(l,o));for(;l>0;){let c=Ei(r.text,l,!1);if(i(r.text.slice(c,l))!=a)break;l=c}for(;on?e.left-n:Math.max(0,n-e.right)}function d5(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Ih(n,e){return n.tope.top+1}function Vm(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function FO(n,e,t){let i,r,s,l,o=!1,a,c,h,O;for(let m=n.firstChild;m;m=m.nextSibling){let $=Jo(m);for(let y=0;y<$.length;y++){let _=$[y];r&&Ih(r,_)&&(_=Vm(qm(_,r.bottom),r.top));let W=O5(e,_),R=d5(t,_);if(W==0&&R==0)return m.nodeType==3?Im(m,e,t):FO(m,e,t);if(!i||l>R||l==R&&s>W){i=m,r=_,s=W,l=R;let X=R?t<_.top?-1:1:W?e<_.left?-1:1:0;o=!X||(X>0?y<$.length-1:y>0)}W==0?t>_.bottom&&(!h||h.bottom<_.bottom)?(a=m,h=_):t<_.top&&(!O||O.top>_.top)&&(c=m,O=_):h&&Ih(h,_)?h=qm(h,_.bottom):O&&Ih(O,_)&&(O=Vm(O,_.top))}}if(h&&h.bottom>=t?(i=a,r=h):O&&O.top<=t&&(i=c,r=O),!i)return{node:n,offset:0};let p=Math.max(r.left,Math.min(r.right,e));if(i.nodeType==3)return Im(i,p,t);if(o&&i.contentEditable!="false")return FO(i,p,t);let g=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(r.left+r.right)/2?1:0);return{node:n,offset:g}}function Im(n,e,t){let i=n.nodeValue.length,r=-1,s=1e9,l=0;for(let o=0;ot?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&O=(h.left+h.right)/2,g=p;if((xe.chrome||xe.gecko)&&Gs(n,o).getBoundingClientRect().left==h.right&&(g=!p),O<=0)return{node:n,offset:o+(g?1:0)};r=o+(g?1:0),s=O}}}return{node:n,offset:r>-1?r:l>0?n.nodeValue.length:0}}function sy(n,e,t,i=-1){var r,s;let l=n.contentDOM.getBoundingClientRect(),o=l.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:O}=e,p=O-o;if(p<0)return 0;if(p>c)return n.state.doc.length;for(let X=n.viewState.heightOracle.textHeight/2,C=!1;a=n.elementAtHeight(p),a.type!=Ii.Text;)for(;p=i>0?a.bottom+X:a.top-X,!(p>=0&&p<=c);){if(C)return t?null:0;C=!0,i=-i}O=o+p;let g=a.from;if(gn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Lm(n,l,a,h,O);let m=n.dom.ownerDocument,$=n.root.elementFromPoint?n.root:m,y=$.elementFromPoint(h,O);y&&!n.contentDOM.contains(y)&&(y=null),y||(h=Math.max(l.left+1,Math.min(l.right-1,h)),y=$.elementFromPoint(h,O),y&&!n.contentDOM.contains(y)&&(y=null));let _,W=-1;if(y&&((r=n.docView.nearest(y))===null||r===void 0?void 0:r.isEditable)!=!1){if(m.caretPositionFromPoint){let X=m.caretPositionFromPoint(h,O);X&&({offsetNode:_,offset:W}=X)}else if(m.caretRangeFromPoint){let X=m.caretRangeFromPoint(h,O);X&&({startContainer:_,startOffset:W}=X,(!n.contentDOM.contains(_)||xe.safari&&p5(_,W,h)||xe.chrome&&g5(_,W,h))&&(_=void 0))}}if(!_||!n.docView.dom.contains(_)){let X=ci.find(n.docView,g);if(!X)return p>a.top+a.height/2?a.to:a.from;({node:_,offset:W}=FO(X.dom,h,O))}let R=n.docView.nearest(_);if(!R)return null;if(R.isWidget&&((s=R.dom)===null||s===void 0?void 0:s.nodeType)==1){let X=R.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let o=n.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(n.defaultLineHeight-o)*.5)/o);s+=a*n.viewState.heightOracle.lineLength}let l=n.state.sliceDoc(t.from,t.to);return t.from+AO(l,s,n.state.tabSize)}function p5(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let r=n.nextSibling;r;r=r.nextSibling)if(r.nodeType!=1||r.nodeName!="BR")return!1;return Gs(n,i-1,i).getBoundingClientRect().left>t}function g5(n,e,t){if(e!=0)return!1;for(let r=n;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let i=n.nodeType==1?n.getBoundingClientRect():Gs(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function GO(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==Ii.Text))return i}return t}function m5(n,e,t,i){let r=GO(n,e.head),s=!i||r.type!=Ii.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let l=n.dom.getBoundingClientRect(),o=n.textDirectionAt(r.from),a=n.posAtCoords({x:t==(o==jt.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(a!=null)return ee.cursor(a,t?-1:1)}return ee.cursor(t?r.to:r.from,t?-1:1)}function Nm(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),l=n.textDirectionAt(r.from);for(let o=e,a=null;;){let c=r5(r,s,l,o,t),h=iy;if(!c){if(r.number==(t?n.state.doc.lines:1))return o;h=` -`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),c=ee.cursor(t?r.from:r.to)}if(a){if(!a(h))return o}else{if(!i)return c;a=i(h)}o=c}}function S5(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let l=i(s);return r==Lt.Space&&(r=l),r==l}}function b5(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return ee.cursor(r,e.assoc);let l=e.goalColumn,o,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(r,e.assoc||-1),h=n.documentTop;if(c)l==null&&(l=c.left-a.left),o=s<0?c.top:c.bottom;else{let g=n.viewState.lineBlockAt(r);l==null&&(l=Math.min(a.right-a.left,n.defaultCharacterWidth*(r-g.from))),o=(s<0?g.top:g.bottom)+h}let O=a.left+l,p=i??n.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let m=o+(p+g)*s,$=sy(n,{x:O,y:m},!1,s);if(ma.bottom||(s<0?$r)){let y=n.docView.coordsForChar($),_=!y||m{if(e>s&&er(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:ee.cursor(i,inull),xe.gecko&&Y5(e.contentDOM.ownerDocument)}handleEvent(e){!x5(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=y5(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let l=!t[s].handlers.length,o=i[s];o&&l!=!o.handlers.length&&(r.removeEventListener(s,this.handleEvent),o=null),o||r.addEventListener(s,this.handleEvent,{passive:l})}for(let s in i)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()i.keyCode==e.keyCode))&&!e.ctrlKey||v5.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(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Cl(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:xe.safari&&!xe.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}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 jm(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){An(t.state,r)}}}function y5(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec;if(r&&r.domEventHandlers)for(let s in r.domEventHandlers){let l=r.domEventHandlers[s];l&&t(s).handlers.push(jm(i.value,l))}if(r&&r.domEventObservers)for(let s in r.domEventObservers){let l=r.domEventObservers[s];l&&t(s).observers.push(jm(i.value,l))}}for(let i in Kn)t(i).handlers.push(Kn[i]);for(let i in Jn)t(i).observers.push(Jn[i]);return e}const ly=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],v5="dthko",oy=[16,17,18,20,91,92,224,225],Xf=6;function Af(n){return Math.max(0,n)*.7+8}function w5(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class Q5{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=M4(e.contentDOM),this.atoms=e.state.facet(Zd).map(l=>l(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(Ot.allowMultipleSelections)&&_5(e,t),this.dragging=P5(e,t)&&uy(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&w5(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,r=0,s=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},l=H$(this.view);e.clientX-l.left<=s.left+Xf?i=-Af(s.left-e.clientX):e.clientX+l.right>=s.right-Xf&&(i=Af(e.clientX-s.right)),e.clientY-l.top<=s.top+Xf?r=-Af(s.top-e.clientY):e.clientY+l.bottom>=s.bottom-Xf&&(r=Af(e.clientY-s.bottom)),this.setScrollSpeed(i,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(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function _5(n,e){let t=n.state.facet(M$);return t.length?t[0](e):xe.mac?e.metaKey:e.ctrlKey}function k5(n,e){let t=n.state.facet(D$);return t.length?t[0](e):xe.mac?!e.altKey:!e.ctrlKey}function P5(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Sc(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function x5(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Dt.get(t))&&i.ignoreEvent(e))return!1;return!0}const Kn=Object.create(null),Jn=Object.create(null),ay=xe.ie&&xe.ie_version<15||xe.ios&&xe.webkit_version<604;function W5(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(),fy(n,t.value)},50)}function fy(n,e){let{state:t}=n,i,r=1,s=t.toText(e),l=s.lines==t.selection.ranges.length;if(HO!=null&&t.selection.ranges.every(a=>a.empty)&&HO==s.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let O=t.toText((l?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:O},range:ee.cursor(c.from+O.length)}})}else l?i=t.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:ee.cursor(a.from+c.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Jn.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Kn.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Jn.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Jn.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Kn.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(V$))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=Z5(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new Q5(n,e,t,i)),i&&n.observer.ignore(()=>x$(n.contentDOM));let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function Bm(n,e,t,i){if(i==1)return ee.cursor(e,t);if(i==2)return h5(n.state,e,t);{let r=ci.find(n.docView,e),s=n.state.doc.lineAt(r?r.posAtEnd:e),l=r?r.posAtStart:s.from,o=r?r.posAtEnd:s.to;return on>=e.top&&n<=e.bottom,Fm=(n,e,t)=>cy(e,t)&&n>=t.left&&n<=t.right;function C5(n,e,t,i){let r=ci.find(n.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let l=r.coordsAt(s,-1);if(l&&Fm(t,i,l))return-1;let o=r.coordsAt(s,1);return o&&Fm(t,i,o)?1:l&&cy(i,l)?-1:1}function Gm(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:C5(n,t,e.clientX,e.clientY)}}const T5=xe.ie&&xe.ie_version<=11;let Hm=null,Km=0,Jm=0;function uy(n){if(!T5)return n.detail;let e=Hm,t=Jm;return Hm=n,Jm=Date.now(),Km=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Km+1)%3:1}function Z5(n,e){let t=Gm(n,e),i=uy(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,l,o){let a=Gm(n,s),c,h=Bm(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!l){let O=Bm(n,t.pos,t.bias,i),p=Math.min(O.from,h.from),g=Math.max(O.to,h.to);h=p1&&(c=R5(r,a.pos))?c:o?r.addRange(h):ee.create([h])}}}function R5(n,e){for(let t=0;t=e)return ee.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}Kn.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,l=s+r.length;(s>=t.to||l<=t.from)&&(t=ee.range(s,l))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Kn.dragend=n=>(n.inputState.draggedContent=null,!1);function e1(n,e,t,i){if(!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,l=i&&s&&k5(n,e)?{from:s.from,to:s.to}:null,o={from:r,insert:t},a=n.state.changes(l?[l,o]:o);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Kn.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&e1(n,e,i.filter(l=>l!=null).join(n.state.lineBreak),!1)};for(let l=0;l{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(i[l]=o.result),s()},o.readAsText(t[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return e1(n,e,i,!0),!0}return!1};Kn.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=ay?null:e.clipboardData;return t?(fy(n,t.getData("text/plain")||t.getData("text/uri-text")),!0):(W5(n),!1)};function X5(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function A5(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let l=n.doc.lineAt(s);l.number>r&&(e.push(l.text),t.push({from:l.from,to:Math.min(n.doc.length,l.to+1)})),r=l.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let HO=null;Kn.copy=Kn.cut=(n,e)=>{let{text:t,ranges:i,linewise:r}=A5(n.state);if(!t&&!r)return!1;HO=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=ay?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(X5(n,t),!1)};const hy=Ir.define();function Oy(n,e){let t=[];for(let i of n.facet(L$)){let r=i(n,e);r&&t.push(r)}return t?n.update({effects:t,annotations:hy.of(!0)}):null}function dy(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=Oy(n.state,e);t?n.dispatch(t):n.update([])}},10)}Jn.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),dy(n)};Jn.blur=n=>{n.observer.clearSelectionRange(),dy(n)};Jn.compositionstart=Jn.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};Jn.compositionend=n=>{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,xe.chrome&&xe.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Jn.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Kn.beforeinput=(n,e)=>{var t;let i;if(xe.chrome&&xe.android&&(i=ly.find(r=>r.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let r=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>r+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return!1};const t1=new Set;function Y5(n){t1.has(n)||(t1.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const i1=["pre-wrap","normal","pre-line","break-spaces"];class U5{constructor(e){this.lineWrapping=e,this.doc=mt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return i1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>lc&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return Li.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,l=i.doc;for(let o=r.length-1;o>=0;o--){let{fromA:a,toA:c,fromB:h,toB:O}=r[o],p=s.lineAt(a,Mt.ByPosNoHeight,i.setDoc(t),0,0),g=p.to>=c?p:s.lineAt(c,Mt.ByPosNoHeight,i,0,0);for(O+=g.to-c,c=g.to;o>0&&p.from<=r[o-1].toA;)a=r[o-1].fromA,h=r[o-1].fromB,o--,as*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),i+=1+o.break,r-=o.size}else if(s>r*2){let o=e[i];o.break?e.splice(i,1,o.left,null,o.right):e.splice(i,1,o.left,o.right),i+=2+o.break,s-=o.size}else break;else if(r=s&&l(this.blockAt(0,i,r,s))}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(e,r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class hn extends py{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,r){return new Or(r,this.length,i,this.height,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof hn||r instanceof wi&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof wi?r=new hn(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Li.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(i||this.outdated)&&this.setHeight(e,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 wi extends Li{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,l,o=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);l=a/s,this.length>s+1&&(o=(this.height-a)/(this.length-s-1))}else l=this.height/s;return{firstLine:i,lastLine:r,perLine:l,perChar:o}}blockAt(e,t,i,r){let{firstLine:s,lastLine:l,perLine:o,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let c=r+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),h=t.doc.lineAt(c),O=o+h.length*a,p=Math.max(i,e-O/2);return new Or(h.from,h.length,p,O,0)}else{let c=Math.max(0,Math.min(l-s,Math.floor((e-i)/o))),{from:h,length:O}=t.doc.line(s+c);return new Or(h,O,i+o*c,o,0)}}lineAt(e,t,i,r,s){if(t==Mt.ByHeight)return this.blockAt(e,i,r,s);if(t==Mt.ByPosNoHeight){let{from:g,to:m}=i.doc.lineAt(e);return new Or(g,m-g,0,0,0)}let{firstLine:l,perLine:o,perChar:a}=this.heightMetrics(i,s),c=i.doc.lineAt(e),h=o+c.length*a,O=c.number-l,p=r+o*O+a*(c.from-s-O);return new Or(c.from,c.length,Math.max(r,Math.min(p,r+this.height-h)),h,0)}forEachLine(e,t,i,r,s,l){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:o,perLine:a,perChar:c}=this.heightMetrics(i,s);for(let h=e,O=r;h<=t;){let p=i.doc.lineAt(h);if(h==e){let m=p.number-o;O+=a*m+c*(e-s-m)}let g=a+c*p.length;l(new Or(p.from,p.length,O,g,0)),O+=g,h=p.to+1}}replace(e,t,i){let r=this.length-t;if(r>0){let s=i[i.length-1];s instanceof wi?i[i.length-1]=new wi(s.length+r):i.push(null,new wi(r-1))}if(e>0){let s=i[0];s instanceof wi?i[0]=new wi(e+s.length):i.unshift(new wi(e-1),null)}return Li.of(i)}decomposeLeft(e,t){t.push(new wi(e-1),null)}decomposeRight(e,t){t.push(null,new wi(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let l=[],o=Math.max(t,r.from),a=-1;for(r.from>t&&l.push(new wi(r.from-t-1).updateHeight(e,t));o<=s&&r.more;){let h=e.doc.lineAt(o).length;l.length&&l.push(null);let O=r.heights[r.index++];a==-1?a=O:Math.abs(O-a)>=lc&&(a=-2);let p=new hn(h,O);p.outdated=!1,l.push(p),o+=h+1}o<=s&&l.push(null,new wi(s-o).updateHeight(e,o));let c=Li.of(l);return(a<0||Math.abs(c.height-this.height)>=lc||Math.abs(a-this.heightMetrics(e,t).perLine)>=lc)&&(e.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class z5 extends Li{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return eo))return c;let h=t==Mt.ByPosNoHeight?Mt.ByPosNoHeight:Mt.ByPos;return a?c.join(this.right.lineAt(o,h,i,l,o)):this.left.lineAt(o,h,i,r,s).join(c)}forEachLine(e,t,i,r,s,l){let o=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,o,a,l);else{let c=this.lineAt(a,Mt.ByPos,i,r,s);e=e&&c.from<=t&&l(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,o,a,l)}}replace(e,t,i){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let o of i)s.push(o);if(e>0&&n1(s,l-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Li.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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,i=!1,r){let{left:s,right:l}=this,o=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=o+l.length&&r.more?a=l=l.updateHeight(e,o,i,r):l.updateHeight(e,o,i),a?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function n1(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof wi&&(i=n[e+1])instanceof wi&&n.splice(e-1,3,new wi(t.length+1+i.length))}const M5=5;class Rd{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 i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof hn?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new hn(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=M5)&&this.addLineDeco(r,s,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new hn(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new wi(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof hn)return e;let t=new hn(0,-1);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,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof hn)&&!this.isCovered?this.nodes.push(new hn(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&O.overflow!="visible"){let p=h.getBoundingClientRect();s=Math.max(s,p.left),l=Math.min(l,p.right),o=Math.max(o,p.top),a=c==n.parentNode?p.bottom:Math.min(a,p.bottom)}c=O.position=="absolute"||O.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,a)-(t.top+e)}}function I5(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Nh{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new U5(t),this.stateDeco=e.facet(ta).filter(i=>typeof i!="function"),this.heightMap=Li.empty().applyChanges(this.stateDeco,mt.empty,this.heightOracle.setDoc(e.doc),[new Yn(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ye.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:l})=>r>=s&&r<=l)){let{from:s,to:l}=this.lineBlockAt(r);e.push(new Yf(s,l))}}this.viewports=e.sort((i,r)=>i.from-r.from),this.scaler=this.heightMap.height<=7e6?s1:new B5(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Uo(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ta).filter(h=>typeof h!="function");let r=e.changedRanges,s=Yn.extendWithRanges(r,D5(i,this.stateDeco,e?e.changes:ui.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=l&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),c&&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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(j$)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?jt.RTL:jt.LTR;let l=this.heightOracle.mustRefreshForWrapping(s),o=t.getBoundingClientRect(),a=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,h=0;if(o.width&&o.height){let X=o.width/t.offsetWidth,C=o.height/t.offsetHeight;(X>.995&&X<1.005||!isFinite(X)||Math.abs(o.width-t.offsetWidth)<1)&&(X=1),(C>.995&&C<1.005||!isFinite(C)||Math.abs(o.height-t.offsetHeight)<1)&&(C=1),(this.scaleX!=X||this.scaleY!=C)&&(this.scaleX=X,this.scaleY=C,c|=8,l=a=!0)}let O=(parseInt(i.paddingTop)||0)*this.scaleY,p=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=O||this.paddingBottom!=p)&&(this.paddingTop=O,this.paddingBottom=p,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=C$(e.scrollDOM);let m=(this.printing?I5:q5)(t,this.paddingTop),$=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let W=o.width;if((this.contentDOMWidth!=W||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let X=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(X)&&(l=!0),l||r.lineWrapping&&Math.abs(W-this.contentDOMWidth)>r.charWidth){let{lineHeight:C,charWidth:E,textHeight:D}=e.docView.measureTextSize();l=C>0&&r.refresh(s,C,E,D,W/E,X),l&&(e.docView.minWidth=0,c|=8)}$>0&&y>0?h=Math.max($,y):$<0&&y<0&&(h=Math.min($,y)),r.heightChanged=!1;for(let C of this.viewports){let E=C.from==this.viewport.from?X:e.docView.measureVisibleLineHeights(C);this.heightMap=(l?Li.empty().applyChanges(this.stateDeco,mt.empty,this.heightOracle,[new Yn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,l,new E5(C.from,E))}r.heightChanged&&(c|=2)}let R=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return R&&(this.viewport=this.getViewport(h,this.scrollTarget)),this.updateForViewport(),(c&2||R)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]: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 i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,a=new Yf(r.lineAt(l-i*1e3,Mt.ByHeight,s,0,0).from,r.lineAt(o+(1-i)*1e3,Mt.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),O=r.lineAt(c,Mt.ByPos,s,0,0),p;t.y=="center"?p=(O.top+O.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c=o+Math.max(10,Math.min(i,250)))&&r>l-2*1e3&&s>1,l=r<<1;if(this.defaultTextDirection!=jt.LTR&&!i)return[];let o=[],a=(c,h,O,p)=>{if(h-cc&&yy.from>=O.from&&y.to<=O.to&&Math.abs(y.from-c)y.from<_&&y.to>_));if(!$){if(hy.from<=h&&y.to>=h)){let y=t.moveToLineBoundary(ee.cursor(h),!1,!0).head;y>c&&(h=y)}$=new Nh(c,h,this.gapSize(O,c,h,p))}o.push($)};for(let c of this.viewportLines){if(c.lengthc.from&&a(c.from,p,c,h),gt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];vt.spans(e,this.viewport.from,this.viewport.to,{span(r,s){t.push({from:r,to:s})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((r,s)=>r.from!=t[s].from||r.to!=t[s].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Uo(this.heightMap.lineAt(e,Mt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Uo(this.heightMap.lineAt(this.scaler.fromDOM(e),Mt.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 Uo(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 Yf{constructor(e,t){this.from=e,this.to=t}}function N5(n,e,t){let i=[],r=n,s=0;return vt.spans(t,n,e,{span(){},point(l,o){l>r&&(i.push({from:r,to:l}),s+=l-r),r=o}},20),r=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:l}=e[r],o=l-s;if(i<=o)return s+i;i-=o}}function Ef(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function j5(n,e){for(let t of n)if(e(t))return t}const s1={toDOM(n){return n},fromDOM(n){return n},scale:1};class B5{constructor(e,t,i){let r=0,s=0,l=0;this.viewports=i.map(({from:o,to:a})=>{let c=t.lineAt(o,Mt.ByPos,e,0,0).top,h=t.lineAt(a,Mt.ByPos,e,0,0).bottom;return r+=h-c,{from:o,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let o of this.viewports)o.domTop=l+(o.top-s)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=tUo(r,e)):n._content)}const zf=_e.define({combine:n=>n.join(" ")}),KO=_e.define({combine:n=>n.indexOf(!0)>-1}),JO=vs.newName(),gy=vs.newName(),my=vs.newName(),Sy={"&light":"."+gy,"&dark":"."+my};function ed(n,e,t){return new vs(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const F5=ed("."+JO,{"&":{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},".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:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&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",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&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},"&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-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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,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"}},Sy),Eo="￿";class G5{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Ot.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Eo}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let l=r.nextSibling;if(l==t)break;let o=Dt.get(r),a=Dt.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:l1(r))||l1(l)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&this.lineBreak(),r=l}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,o;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(o=r.exec(t))&&(s=o.index,l=o[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=l-1);i=s+l}}readNode(e){if(e.cmIgnore)return;let t=Dt.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.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 i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(H5(e,i.node,i.offset)?t:0))}}function H5(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let o=s||l?[]:t3(e),a=new G5(o,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=i3(o,this.bounds.from)}else{let o=e.observer.selectionRange,a=s&&s.node==o.focusNode&&s.offset==o.focusOffset||!EO(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),c=l&&l.node==o.anchorNode&&l.offset==o.anchorOffset||!EO(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset);this.newSel=ee.single(c,a)}}}function by(n,e){let t,{newSel:i}=e,r=n.state.selection.main,s=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:o}=e.bounds,a=r.from,c=null;(s===8||xe.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:n.state.doc.slice(r.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,r.to))}:(xe.mac||xe.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=ee.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:mt.of([" "])}):xe.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` - `&&n.lineWrapping&&(i&&(i=ee.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:mt.of([" "])}),t){if(xe.ios&&n.inputState.flushIOSKey()||xe.android&&(t.from==r.from&&t.to==r.to&&t.insert.length==1&&t.insert.lines==2&&Cl(n.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||s==8&&t.insert.lengthr.head)&&Cl(n.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&Cl(n.contentDOM,"Delete",46)))return!0;let l=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=J5(n,t,i));return n.state.facet(I$).some(c=>c(n,t.from,t.to,l,a))||n.dispatch(a()),!0}else if(i&&!i.main.eq(r)){let l=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),o=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:l,userEvent:o}),!0}else return!1}function J5(n,e,t){let i,r=n.state,s=r.selection.main;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 o=s.frome.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(n.state.toText(o+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let o=r.changes(e),a=t&&t.main.to<=o.newLength?t.main:void 0;if(r.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=n.state.sliceDoc(e.from,e.to),h,O=t&&ny(n,t.main.head);if(O){let m=e.insert.length-(e.to-e.from);h={from:O.from,to:O.to-m}}else h=n.state.doc.lineAt(s.head);let p=s.to-e.to,g=s.to-s.from;i=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:o,range:a||m.map(o)};let $=m.to-p,y=$-c.length;if(m.to-m.from!=g||n.state.sliceDoc(y,$)!=c||m.to>=h.from&&m.from<=h.to)return{range:m};let _=r.changes({from:y,to:$,insert:e.insert}),W=m.to-s.to;return{changes:_,range:a?ee.range(Math.max(0,a.anchor+W),Math.max(0,a.head+W)):m.map(_)}})}else i={changes:o,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=".compose",n.inputState.compositionFirstChange&&(l+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function e3(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s0&&o>0&&n.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(i=="end"){let a=Math.max(0,s-Math.min(l,o));t-=l+a-s}if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}else if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}return{from:s,toA:l,toB:o}}function t3(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new o1(t,i)),(r!=t||s!=i)&&e.push(new o1(r,s))),e}function i3(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?ee.single(t+e,i+e):null}const n3={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jh=xe.ie&&xe.ie_version<=11;class r3{constructor(e){this.view=e,this.active=!1,this.selectionRange=new D4,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.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(xe.ie&&xe.ie_version<=11||xe.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),jh&&(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),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){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.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){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,i)=>t!=e[i]))){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:i}=this,r=this.selectionRange;if(i.state.facet(Jc)?i.root.activeElement!=this.dom:!rc(i.dom,r))return;let s=r.anchorNode&&i.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(xe.ie&&xe.ie_version<=11||xe.android&&xe.chrome)&&!i.state.selection.main.empty&&r.focusNode&&bc(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=xe.safari&&e.root.nodeType==11&&U4(this.dom.ownerDocument)==this.dom&&s3(this.view)||Sc(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=rc(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Cl(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{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,i=-1,r=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(r=!0),t==-1?{from:t,to:i}=l:(t=Math.min(l.from,t),i=Math.max(l.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&rc(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new K5(this.view,e,t,i);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 i=this.view.state,r=by(this.view,t);return this.view.state==i&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=a1(t,e.previousSibling||e.target.previousSibling,-1),r=a1(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):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),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),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function a1(n,e,t){for(;e;){let i=Dt.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function s3(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,r=e.startOffset,s=e.endContainer,l=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return bc(o.node,o.offset,s,l)&&([i,r,s,l]=[s,l,i,r]),{anchorNode:i,anchorOffset:r,focusNode:s,focusOffset:l}}class de{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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){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.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(r=>t(r,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||V4(e.parent)||document,this.viewState=new r1(e.state||Ot.create(e)),e.scrollTo&&e.scrollTo.is(Rf)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ao).map(i=>new qh(i));for(let i of this.plugins)i.update(this);this.observer=new r3(this),this.inputState=new $5(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Mm(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof hi?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,i=!1,r,s=this.state;for(let p of e){if(p.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=p.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,o=0,a=null;e.some(p=>p.annotation(hy))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,a=Oy(s,l),a||(o=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(Ot.phrases)!=this.state.facet(Ot.phrases))return this.setState(s);r=$c.create(this,s,e),r.flags|=o;let O=this.viewState.scrollTarget;try{this.updateState=2;for(let p of e){if(O&&(O=O.map(p.changes)),p.scrollIntoView){let{main:g}=p.state.selection;O=new Tl(g.empty?g:ee.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of p.effects)g.is(Rf)&&(O=g.value.clip(this.state))}this.viewState.update(r,O),this.bidiCache=yc.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Yo)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(p=>p.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(zf)!=r.state.facet(zf)&&(this.viewState.mustMeasureContent=!0),(t||i||O||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!r.empty)for(let p of this.state.facet(LO))try{p(r)}catch(g){An(this.state,g,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!by(this,h)&&c.force&&Cl(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 i of this.plugins)i.destroy(this);this.viewState=new r1(e),this.plugins=e.facet(Ao).map(i=>new qh(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Mm(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(Ao),i=e.state.facet(Ao);if(t!=i){let r=[];for(let s of i){let l=t.indexOf(s);if(l<0)r.push(new qh(s));else{let o=this.plugins[l];o.mustUpdate=e,r.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-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,i=this.scrollDOM,r=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:l}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(C$(i))s=-1,l=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(r);s=g.from,l=g.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(g=>{try{return g.read(this)}catch(m){return An(this.state,m),f1}}),O=$c.create(this,this.state,[]),p=!1;O.flags|=a,t?t.flags|=a:t=O,this.updateState=2,O.empty||(this.updatePlugins(O),this.inputState.update(O),this.updateAttrs(),p=this.docView.update(O));for(let g=0;g1||m<-1){r=r+m,i.scrollTop=r/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(LO))o(t)}get themeClasses(){return JO+" "+(this.state.facet(KO)?my:gy)+" "+this.state.facet(zf)}updateAttrs(){let e=c1(this,B$,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Jc)?"true":"false",class:"cm-content",style:`${xe.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),c1(this,Td,t);let i=this.observer.ignore(()=>{let r=qO(this.contentDOM,this.contentAttrs,t),s=qO(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(de.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Yo);let e=this.state.facet(de.cspNonce);vs.mount(this.root,this.styleModules.concat(F5).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;ti.spec==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,i){return Lh(this,e,Nm(this,e,t,i))}moveByGroup(e,t){return Lh(this,e,Nm(this,e,t,i=>S5(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return m5(this,e,t,i)}moveVertically(e,t,i){return Lh(this,e,b5(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),sy(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),l=s[gs.find(s,e-r.from,-1,t)];return xd(i,l.dir==jt.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(N$)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>l3)return ty(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||ey(s.isolates,i=zm(this,e.from,e.to))))return s.order;i||(i=zm(this,e.from,e.to));let r=n5(e.text,t,i);return this.bidiCache.push(new yc(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||xe.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{x$(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(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Rf.of(new Tl(typeof e=="number"?ee.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Rf.of(new Tl(ee.cursor(i.from),"start","start",i.top-e,t,!0))}static domEventHandlers(e){return li.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return li.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=vs.newName(),r=[zf.of(i),Yo.of(ed(`.${i}`,e))];return t&&t.dark&&r.push(KO.of(!0)),r}static baseTheme(e){return Ks.lowest(Yo.of(ed("."+JO,e,Sy)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&Dt.get(i)||Dt.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}de.styleModule=Yo;de.inputHandler=I$;de.focusChangeEffect=L$;de.perLineTextDirection=N$;de.exceptionSink=q$;de.updateListener=LO;de.editable=Jc;de.mouseSelectionStyle=V$;de.dragMovesSelection=D$;de.clickAddsSelectionRange=M$;de.decorations=ta;de.atomicRanges=Zd;de.bidiIsolatedRanges=F$;de.scrollMargins=G$;de.darkTheme=KO;de.cspNonce=_e.define({combine:n=>n.length?n[0]:""});de.contentAttributes=Td;de.editorAttributes=B$;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=Le.define();const l3=4096,f1={};class yc{constructor(e,t,i,r,s,l){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=l}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:jt.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=i[r],l=typeof s=="function"?s(n):s;l&&VO(l,t)}return t}const o3=xe.mac?"mac":xe.windows?"win":xe.linux?"linux":"key";function a3(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,l,o;for(let a=0;ai.concat(r),[]))),t}function c3(n,e,t){return yy($y(n.state),e,n,t)}let Os=null;const u3=4e3;function h3(n,e=o3){let t=Object.create(null),i=Object.create(null),r=(l,o)=>{let a=i[l];if(a==null)i[l]=o;else if(a!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},s=(l,o,a,c,h)=>{var O,p;let g=t[l]||(t[l]=Object.create(null)),m=o.split(/ (?!$)/).map(_=>a3(_,e));for(let _=1;_{let X=Os={view:R,prefix:W,scope:l};return setTimeout(()=>{Os==X&&(Os=null)},u3),!0}]})}let $=m.join(" ");r($,!1);let y=g[$]||(g[$]={preventDefault:!1,stopPropagation:!1,run:((p=(O=g._any)===null||O===void 0?void 0:O.run)===null||p===void 0?void 0:p.slice())||[]});a&&y.run.push(a),c&&(y.preventDefault=!0),h&&(y.stopPropagation=!0)};for(let l of n){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let c of o){let h=t[c]||(t[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let O in h)h[O].run.push(l.any)}let a=l[e]||l.key;if(a)for(let c of o)s(c,a,l.run,l.preventDefault,l.stopPropagation),l.shift&&s(c,"Shift-"+a,l.shift,l.preventDefault,l.stopPropagation)}return t}function yy(n,e,t,i){let r=Y4(e),s=Qi(r,0),l=Zn(s)==r.length&&r!=" ",o="",a=!1,c=!1,h=!1;Os&&Os.view==t&&Os.scope==i&&(o=Os.prefix+" ",oy.indexOf(e.keyCode)<0&&(c=!0,Os=null));let O=new Set,p=y=>{if(y){for(let _ of y.run)if(!O.has(_)&&(O.add(_),_(t,e)))return y.stopPropagation&&(h=!0),!0;y.preventDefault&&(y.stopPropagation&&(h=!0),c=!0)}return!1},g=n[i],m,$;return g&&(p(g[o+Mf(r,e,!l)])?a=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(xe.windows&&e.ctrlKey&&e.altKey)&&(m=ws[e.keyCode])&&m!=r?(p(g[o+Mf(m,e,!0)])||e.shiftKey&&($=Ko[e.keyCode])!=r&&$!=m&&p(g[o+Mf($,e,!1)]))&&(a=!0):l&&e.shiftKey&&p(g[o+Mf(r,e,!0)])&&(a=!0),!a&&p(g._any)&&(a=!0)),c&&(a=!0),a&&h&&e.stopPropagation(),a}class ma{constructor(e,t,i,r,s){this.className=e,this.left=t,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=vy(e);return[new ma(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return O3(e,t,i)}}function vy(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==jt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function h1(n,e,t){let i=ee.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:Ii.Text}}function O3(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),r=Math.min(t.to,n.viewport.to),s=n.textDirection==jt.LTR,l=n.contentDOM,o=l.getBoundingClientRect(),a=vy(n),c=l.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),O=o.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),p=o.right-(h?parseInt(h.paddingRight):0),g=GO(n,i),m=GO(n,r),$=g.type==Ii.Text?g:null,y=m.type==Ii.Text?m:null;if($&&(n.lineWrapping||g.widgetLineBreaks)&&($=h1(n,i,$)),y&&(n.lineWrapping||m.widgetLineBreaks)&&(y=h1(n,r,y)),$&&y&&$.from==y.from)return W(R(t.from,t.to,$));{let C=$?R(t.from,null,$):X(g,!1),E=y?R(null,t.to,y):X(m,!0),D=[];return($||g).to<(y||m).from-($&&y?1:0)||g.widgetLineBreaks>1&&C.bottom+n.defaultLineHeight/2L&&ae.from=Se)break;ke>ye&&q(Math.max(Ie,ye),C==null&&Ie<=L,Math.min(ke,Se),E==null&&ke>=re,Ue.dir)}if(ye=ge.to+1,ye>=Se)break}return B.length==0&&q(L,C==null,re,E==null,n.textDirection),{top:z,bottom:F,horizontal:B}}function X(C,E){let D=o.top+(E?C.top:C.bottom);return{top:D,bottom:D,horizontal:[]}}}function d3(n,e){return n.constructor==e.constructor&&n.eq(e)}class p3{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(oc)!=e.state.facet(oc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,i=e.facet(oc);for(;t!d3(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[i].constructor&&r.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const oc=_e.define();function wy(n){return[li.define(e=>new p3(e,n)),oc.of(n)]}const Qy=!xe.ios,na=_e.define({combine(n){return br(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function g3(n={}){return[na.of(n),m3,S3,b3,j$.of(!0)]}function _y(n){return n.startState.facet(na)!=n.state.facet(na)}const m3=wy({above:!0,markers(n){let{state:e}=n,t=e.facet(na),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty?!s||Qy:t.drawRangeCursor){let l=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=r.empty?r:ee.cursor(r.head,r.head>r.anchor?-1:1);for(let a of ma.forRange(n,l,o))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=_y(n);return t&&O1(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){O1(e.state,n)},class:"cm-cursorLayer"});function O1(n,e){e.style.animationDuration=n.facet(na).cursorBlinkRate+"ms"}const S3=wy({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:ma.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||_y(n)},class:"cm-selectionLayer"}),ky={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};Qy&&(ky[".cm-line"].caretColor="transparent !important");const b3=Ks.highest(de.theme(ky)),Py=Le.define({map(n,e){return n==null?null:e.mapPos(n)}}),zo=pi.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Py)?i.value:t,n)}}),$3=li.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(zo);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(zo)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(zo),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(zo)!=n&&this.view.dispatch({effects:Py.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function y3(){return[zo,$3]}function d1(n,e,t,i,r){e.lastIndex=0;for(let s=n.iterRange(t,i),l=t,o;!s.next().done;l+=s.value.length)if(!s.lineBreak)for(;o=e.exec(s.value);)r(l+o.index,o)}function v3(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:r,to:s}of t)r=Math.max(n.state.doc.lineAt(r).from,r-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class w3{constructor(e){const{regexp:t,decoration:i,decorate:r,boundary:s,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(o,a,c,h)=>r(h,c,c+o[0].length,o,a);else if(typeof i=="function")this.addMatch=(o,a,c,h)=>{let O=i(o,a,c);O&&h(c,c+o[0].length,O)};else if(i)this.addMatch=(o,a,c,h)=>h(c,c+o[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=l}createDeco(e){let t=new ys,i=t.add.bind(t);for(let{from:r,to:s}of v3(e,this.maxLength))d1(e.state.doc,this.regexp,r,s,(l,o)=>this.addMatch(o,e,l,i));return t.finish()}updateDeco(e,t){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,l,o,a)=>{a>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),i,r):t}updateRange(e,t,i,r){for(let s of e.visibleRanges){let l=Math.max(s.from,i),o=Math.min(s.to,r);if(o>l){let a=e.state.doc.lineAt(l),c=a.toa.from;l--)if(this.boundary.test(a.text[l-1-a.from])){h=l;break}for(;op.push(_.range($,y));if(a==c)for(this.regexp.lastIndex=h-a.from;(g=this.regexp.exec(a.text))&&g.indexthis.addMatch(y,e,$,m));t=t.update({filterFrom:h,filterTo:O,filter:($,y)=>$O,add:p})}}return t}}const td=/x/.unicode!=null?"gu":"g",Q3=new RegExp(`[\0-\b ---Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,td),_3={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Bh=null;function k3(){var n;if(Bh==null&&typeof document<"u"&&document.body){let e=document.body.style;Bh=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Bh||!1}const ac=_e.define({combine(n){let e=br(n,{render:null,specialChars:Q3,addSpecialChars:null});return(e.replaceTabs=!k3())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,td)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,td)),e}});function P3(n={}){return[ac.of(n),x3()]}let p1=null;function x3(){return p1||(p1=li.fromClass(class{constructor(n){this.view=n,this.decorations=Ye.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(ac)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new w3({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,s=Qi(e[0],0);if(s==9){let l=r.lineAt(i),o=t.state.tabSize,a=Il(l.text,o,i-l.from);return Ye.replace({widget:new Z3((o-a%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Ye.replace({widget:new T3(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(ac);n.startState.facet(ac)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const W3="•";function C3(n){return n>=32?W3:n==10?"␤":String.fromCharCode(9216+n)}class T3 extends Lr{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=C3(this.code),i=e.state.phrase("Control character")+" "+(_3[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class Z3 extends Lr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function R3(){return A3}const X3=Ye.line({class:"cm-activeLine"}),A3=li.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 i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(X3.range(r.from)),e=r.from)}return Ye.set(t)}},{decorations:n=>n.decorations}),id=2e3;function Y3(n,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>id||t.off>id||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=i;a<=r;a++){let c=n.doc.line(a);c.length<=o&&s.push(ee.range(c.from+l,c.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=i;a<=r;a++){let c=n.doc.line(a),h=AO(c.text,l,n.tabSize,!0);if(h<0)s.push(ee.cursor(c.to));else{let O=AO(c.text,o,n.tabSize);s.push(ee.range(c.from+h,c.from+O))}}}return s}function U3(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function g1(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),r=t-i.from,s=r>id?-1:r==i.length?U3(n,e.clientX):Il(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:s,off:r}}function E3(n,e){let t=g1(n,e),i=n.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),l=r.state.doc.lineAt(s);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},i=i.map(r.changes)}},get(r,s,l){let o=g1(n,r);if(!o)return i;let a=Y3(n.state,t,o);return a.length?l?ee.create(a.concat(i.ranges)):ee.create(a):i}}:null}function z3(n){let e=t=>t.altKey&&t.button==0;return de.mouseSelectionStyle.of((t,i)=>e(i)?E3(t,i):null)}const M3={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},D3={style:"cursor: crosshair"};function V3(n={}){let[e,t]=M3[n.key||"Alt"],i=li.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,de.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?D3:null})]}const Po="-10000px";class xy{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(r=>r),this.tooltipViews=this.tooltips.map(i)}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let l=[],o=t?[]:null;for(let a=0;at[c]=a),t.length=o.length),this.input=r,this.tooltips=s,this.tooltipViews=l,!0}}function q3(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Fh=_e.define({combine:n=>{var e,t,i;return{position:xe.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||q3}}}),m1=new WeakMap,Wy=li.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(Fh);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.manager=new xy(n,Xd,t=>this.createTooltip(t)),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,i=n.state.facet(Fh);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Po,e.dom.style.left="0px",this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(xe.gecko)i=r.offsetParent!=this.container.ownerDocument.body;else if(this.view.scaleX!=1||this.view.scaleY!=1)i=!0;else if(r.style.top==Po&&r.style.left=="0px"){let s=r.getBoundingClientRect();i=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(i||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(e=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((r,s)=>{let l=this.manager.tooltipViews[s];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Fh).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{editor:t,space:i,scaleX:r,scaleY:s}=n,l=[];for(let o=0;o=Math.min(t.bottom,i.bottom)||O.rightMath.min(t.right,i.right)+.1){h.style.top=Po;continue}let g=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=g?7:0,$=p.right-p.left,y=(e=m1.get(c))!==null&&e!==void 0?e:p.bottom-p.top,_=c.offset||L3,W=this.view.textDirection==jt.LTR,R=p.width>i.right-i.left?W?i.left:i.right-p.width:W?Math.min(O.left-(g?14:0)+_.x,i.right-$):Math.max(i.left,O.left-$+(g?14:0)-_.x),X=this.above[o];!a.strictSide&&(X?O.top-(p.bottom-p.top)-_.yi.bottom)&&X==i.bottom-O.bottom>O.top-i.top&&(X=this.above[o]=!X);let C=(X?O.top-i.top:i.bottom-O.bottom)-m;if(CR&&z.topE&&(E=X?z.top-y-2-m:z.bottom+m+2);if(this.position=="absolute"?(h.style.top=(E-n.parent.top)/s+"px",h.style.left=(R-n.parent.left)/r+"px"):(h.style.top=E/s+"px",h.style.left=R/r+"px"),g){let z=O.left+(W?_.x:-_.x)-(R+14-7);g.style.left=z/r+"px"}c.overlap!==!0&&l.push({left:R,top:E,right:D,bottom:E+y}),h.classList.toggle("cm-tooltip-above",X),h.classList.toggle("cm-tooltip-below",!X),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=Po}},{eventObservers:{scroll(){this.maybeMeasure()}}}),I3=de.baseTheme({".cm-tooltip":{zIndex:100,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:`${7*2}px`,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"}}}),L3={x:0,y:0},Xd=_e.define({enables:[Wy,I3]}),vc=_e.define();class Ad{static create(e){return new Ad(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new xy(e,vc,t=>this.createHostedView(t))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const N3=Xd.compute([vc],n=>{let e=n.facet(vc).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Ad.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class j3{constructor(e,t,i,r,s){this.view=e,this.source=t,this.field=i,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(h=>h.from<=r&&h.to>=r),c=a&&a.dir==jt.RTL?-1:1;s=t.x{this.pending==o&&(this.pending=null,a&&e.dispatch({effects:this.setHover.of(a)}))},a=>An(e.state,a,"hover tooltip"))}else l&&e.dispatch({effects:this.setHover.of(l)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let i=this.active;if(i&&!S1(this.lastMove.target)||this.pending){let{pos:r}=i||this.pending,s=(t=i==null?void 0:i.end)!==null&&t!==void 0?t:r;(r==s?this.view.posAtCoords(this.lastMove)!=r:!B3(this.view,r,s,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!S1(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function S1(n){for(let e=n;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function B3(n,e,t,i,r,s){let l=n.scrollDOM.getBoundingClientRect(),o=n.documentTop+n.documentPadding.top+n.contentHeight;if(l.left>i||l.rightr||Math.min(l.bottom,o)=e&&a<=t}function F3(n,e={}){let t=Le.define(),i=pi.define({create(){return null},update(r,s){if(r&&(e.hideOnChange&&(s.docChanged||s.selection)||e.hideOn&&e.hideOn(s,r)))return null;if(r&&s.docChanged){let l=s.changes.mapPos(r.pos,-1,ki.TrackDel);if(l==null)return null;let o=Object.assign(Object.create(null),r);o.pos=l,r.end!=null&&(o.end=s.changes.mapPos(r.end)),r=o}for(let l of s.effects)l.is(t)&&(r=l.value),l.is(G3)&&(r=null);return r},provide:r=>vc.from(r)});return[i,li.define(r=>new j3(r,n,i,t,e.hoverTime||300)),N3]}function Cy(n,e){let t=n.plugin(Wy);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const G3=Le.define(),b1=_e.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function ra(n,e){let t=n.plugin(Ty),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Ty=li.fromClass(class{constructor(n){this.input=n.state.facet(sa),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(b1);this.top=new Df(n,!0,e.topContainer),this.bottom=new Df(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(b1);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Df(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Df(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(sa);if(t!=this.input){let i=t.filter(a=>a),r=[],s=[],l=[],o=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),o.push(h)):(h=this.panels[c],h.update&&h.update(n)),r.push(h),(h.top?s:l).push(h)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Df{constructor(e,t,i){this.view=e,this.top=t,this.container=i,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=$1(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=$1(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 $1(n){let e=n.nextSibling;return n.remove(),e}const sa=_e.define({enables:Ty});class qr extends Fs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}qr.prototype.elementClass="";qr.prototype.toDOM=void 0;qr.prototype.mapMode=ki.TrackBefore;qr.prototype.startSide=qr.prototype.endSide=-1;qr.prototype.point=!0;const fc=_e.define(),H3={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>vt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},jo=_e.define();function K3(n){return[Zy(),jo.of(Object.assign(Object.assign({},H3),n))]}const y1=_e.define({combine:n=>n.some(e=>e)});function Zy(n){return[J3]}const J3=li.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(jo).map(e=>new w1(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(y1),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(y1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=vt.iter(this.view.state.facet(fc),this.view.viewport.from),i=[],r=this.gutters.map(s=>new eC(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let l=!0;for(let o of s.type)if(o.type==Ii.Text&&l){nd(t,i,o.from);for(let a of r)a.line(this.view,o,i);l=!1}else if(o.widget)for(let a of r)a.widget(this.view,o)}else if(s.type==Ii.Text){nd(t,i,s.from);for(let l of r)l.line(this.view,s,i)}else if(s.widget)for(let l of r)l.widget(this.view,s);for(let s of r)s.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(jo),t=n.state.facet(jo),i=n.docChanged||n.heightChanged||n.viewportChanged||!vt.eq(n.startState.facet(fc),n.state.facet(fc),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let l=e.indexOf(s);l<0?r.push(new w1(this.view,s)):(this.gutters[l].update(n),r.push(this.gutters[l]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==jt.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function v1(n){return Array.isArray(n)?n:[n]}function nd(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class eC{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=vt.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==r.elements.length){let o=new Ry(e,l,s,i);r.elements.push(o),r.dom.appendChild(o.dom)}else r.elements[this.i].update(e,l,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];nd(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let l=this.gutter;r.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t);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 w1{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 i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,l;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=r.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[i](e,o,r)&&r.preventDefault()});this.markers=v1(t.markers(e)),t.initialSpacer&&(this.spacer=new Ry(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=v1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!vt.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Ry{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),tC(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,l=0;;){let o=l,a=ss(o,a,c)||l(o,a,c):l}return i}})}});class Gh extends qr{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(vl).formatNumber(e,n.state)}const nC=jo.compute([vl],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(iC)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new Gh(Hh(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(vl)!=e.state.facet(vl),initialSpacer(e){return new Gh(Hh(e,Q1(e.state.doc.lines)))},updateSpacer(e,t){let i=Hh(t.view,Q1(t.view.state.doc.lines));return i==e.number?e:new Gh(i)},domEventHandlers:n.facet(vl).domEventHandlers}));function rC(n={}){return[vl.of(n),Zy(),nC]}function Q1(n){let e=9;for(;e{let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.head).from;r>t&&(t=r,e.push(sC.range(r)))}return vt.of(e)});function oC(){return lC}function aC(n){let e;return{c(){e=k("div"),v(e,"class","mzn-editor svelte-1fycn7h")},m(t,i){Y(t,e,i),n[7](e)},p:Qe,i:Qe,o:Qe,d(t){t&&A(e),n[7](null)}}}function fC(n,e,t){let{state:i}=e,r,s;Hc(()=>{t(6,s=new de({parent:r}))});function l(){return s||null}function o(){return s?s.state:null}async function a(O){s&&(await Fn(),s.dispatch({selection:{anchor:O}}))}function c(){s.focus()}function h(O){Et[O?"unshift":"push"](()=>{r=O,t(0,r)})}return n.$$set=O=>{"state"in O&&t(1,i=O.state)},n.$$.update=()=>{n.$$.dirty&66&&s&&i&&s.state!==i&&s.setState(i)},[r,i,l,o,a,c,s,h]}class cC extends $i{constructor(e){super(),bi(this,e,fC,aC,Oi,{state:1,getView:2,getState:3,setCursor:4,focus:5})}get getView(){return this.$$.ctx[2]}get getState(){return this.$$.ctx[3]}get setCursor(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}var Wn=typeof window<"u"?window:null,Yd=Wn===null,la=Yd?void 0:Wn.document,Ln="addEventListener",Nn="removeEventListener",Kh="getBoundingClientRect",xo="_a",jn="_b",Yr="_c",Vf="horizontal",Bn=function(){return!1},uC=Yd?"calc":["","-webkit-","-moz-","-o-"].filter(function(n){var e=la.createElement("div");return e.style.cssText="width:"+n+"calc(9px)",!!e.style.length}).shift()+"calc",Xy=function(n){return typeof n=="string"||n instanceof String},_1=function(n){if(Xy(n)){var e=la.querySelector(n);if(!e)throw new Error("Selector "+n+" did not match a DOM element");return e}return n},Ci=function(n,e,t){var i=n[e];return i!==void 0?i:t},qf=function(n,e,t,i){if(e){if(i==="end")return 0;if(i==="center")return n/2}else if(t){if(i==="start")return 0;if(i==="center")return n/2}return n},hC=function(n,e){var t=la.createElement("div");return t.className="gutter gutter-"+e,t},OC=function(n,e,t){var i={};return Xy(e)?i[n]=e:i[n]=uC+"("+e+"% - "+t+"px)",i},dC=function(n,e){var t;return t={},t[n]=e+"px",t},pC=function(n,e){if(e===void 0&&(e={}),Yd)return{};var t=n,i,r,s,l,o,a;Array.from&&(t=Array.from(t));var c=_1(t[0]),h=c.parentNode,O=getComputedStyle?getComputedStyle(h):null,p=O?O.flexDirection:null,g=Ci(e,"sizes")||t.map(function(){return 100/t.length}),m=Ci(e,"minSize",100),$=Array.isArray(m)?m:t.map(function(){return m}),y=Ci(e,"maxSize",1/0),_=Array.isArray(y)?y:t.map(function(){return y}),W=Ci(e,"expandToMin",!1),R=Ci(e,"gutterSize",10),X=Ci(e,"gutterAlign","center"),C=Ci(e,"snapOffset",30),E=Array.isArray(C)?C:t.map(function(){return C}),D=Ci(e,"dragInterval",1),z=Ci(e,"direction",Vf),F=Ci(e,"cursor",z===Vf?"col-resize":"row-resize"),B=Ci(e,"gutter",hC),q=Ci(e,"elementStyle",OC),L=Ci(e,"gutterStyle",dC);z===Vf?(i="width",r="clientX",s="left",l="right",o="clientWidth"):z==="vertical"&&(i="height",r="clientY",s="top",l="bottom",o="clientHeight");function re(oe,H,ue,ce){var Ee=q(i,H,ue,ce);Object.keys(Ee).forEach(function(tt){oe.style[tt]=Ee[tt]})}function ae(oe,H,ue){var ce=L(i,H,ue);Object.keys(ce).forEach(function(Ee){oe.style[Ee]=ce[Ee]})}function ye(){return a.map(function(oe){return oe.size})}function Se(oe){return"touches"in oe?oe.touches[0][r]:oe[r]}function ge(oe){var H=a[this.a],ue=a[this.b],ce=H.size+ue.size;H.size=oe/this.size*ce,ue.size=ce-oe/this.size*ce,re(H.element,H.size,this[jn],H.i),re(ue.element,ue.size,this[Yr],ue.i)}function Ue(oe){var H,ue=a[this.a],ce=a[this.b];this.dragging&&(H=Se(oe)-this.start+(this[jn]-this.dragOffset),D>1&&(H=Math.round(H/D)*D),H<=ue.minSize+ue.snapOffset+this[jn]?H=ue.minSize+this[jn]:H>=this.size-(ce.minSize+ce.snapOffset+this[Yr])&&(H=this.size-(ce.minSize+this[Yr])),H>=ue.maxSize-ue.snapOffset+this[jn]?H=ue.maxSize+this[jn]:H<=this.size-(ce.maxSize-ce.snapOffset+this[Yr])&&(H=this.size-(ce.maxSize+this[Yr])),ge.call(this,H),Ci(e,"onDrag",Bn)(ye()))}function Ie(){var oe=a[this.a].element,H=a[this.b].element,ue=oe[Kh](),ce=H[Kh]();this.size=ue[i]+ce[i]+this[jn]+this[Yr],this.start=ue[s],this.end=ue[l]}function ke(oe){if(!getComputedStyle)return null;var H=getComputedStyle(oe);if(!H)return null;var ue=oe[o];return ue===0?null:(z===Vf?ue-=parseFloat(H.paddingLeft)+parseFloat(H.paddingRight):ue-=parseFloat(H.paddingTop)+parseFloat(H.paddingBottom),ue)}function We(oe){var H=ke(h);if(H===null||$.reduce(function(tt,ft){return tt+ft},0)>H)return oe;var ue=0,ce=[],Ee=oe.map(function(tt,ft){var je=H*tt/100,At=qf(R,ft===0,ft===oe.length-1,X),ut=$[ft]+At;return je0&&ce[ft]-ue>0){var At=Math.min(ue,ce[ft]-ue);ue-=At,je=tt-At}return je/H*100})}function lt(){var oe=this,H=a[oe.a].element,ue=a[oe.b].element;oe.dragging&&Ci(e,"onDragEnd",Bn)(ye()),oe.dragging=!1,Wn[Nn]("mouseup",oe.stop),Wn[Nn]("touchend",oe.stop),Wn[Nn]("touchcancel",oe.stop),Wn[Nn]("mousemove",oe.move),Wn[Nn]("touchmove",oe.move),oe.stop=null,oe.move=null,H[Nn]("selectstart",Bn),H[Nn]("dragstart",Bn),ue[Nn]("selectstart",Bn),ue[Nn]("dragstart",Bn),H.style.userSelect="",H.style.webkitUserSelect="",H.style.MozUserSelect="",H.style.pointerEvents="",ue.style.userSelect="",ue.style.webkitUserSelect="",ue.style.MozUserSelect="",ue.style.pointerEvents="",oe.gutter.style.cursor="",oe.parent.style.cursor="",la.body.style.cursor=""}function Vt(oe){if(!("button"in oe&&oe.button!==0)){var H=this,ue=a[H.a].element,ce=a[H.b].element;H.dragging||Ci(e,"onDragStart",Bn)(ye()),oe.preventDefault(),H.dragging=!0,H.move=Ue.bind(H),H.stop=lt.bind(H),Wn[Ln]("mouseup",H.stop),Wn[Ln]("touchend",H.stop),Wn[Ln]("touchcancel",H.stop),Wn[Ln]("mousemove",H.move),Wn[Ln]("touchmove",H.move),ue[Ln]("selectstart",Bn),ue[Ln]("dragstart",Bn),ce[Ln]("selectstart",Bn),ce[Ln]("dragstart",Bn),ue.style.userSelect="none",ue.style.webkitUserSelect="none",ue.style.MozUserSelect="none",ue.style.pointerEvents="none",ce.style.userSelect="none",ce.style.webkitUserSelect="none",ce.style.MozUserSelect="none",ce.style.pointerEvents="none",H.gutter.style.cursor=F,H.parent.style.cursor=F,la.body.style.cursor=F,Ie.call(H),H.dragOffset=Se(oe)-H.end}}g=We(g);var Qt=[];a=t.map(function(oe,H){var ue={element:_1(oe),size:g[H],minSize:$[H],maxSize:_[H],snapOffset:E[H],i:H},ce;if(H>0&&(ce={a:H-1,b:H,dragging:!1,direction:z,parent:h},ce[jn]=qf(R,H-1===0,!1,X),ce[Yr]=qf(R,!1,H===t.length-1,X),p==="row-reverse"||p==="column-reverse")){var Ee=ce.a;ce.a=ce.b,ce.b=Ee}if(H>0){var tt=B(H,z,ue.element);ae(tt,R,H),ce[xo]=Vt.bind(ce),tt[Ln]("mousedown",ce[xo]),tt[Ln]("touchstart",ce[xo]),h.insertBefore(tt,ue.element),ce.gutter=tt}return re(ue.element,ue.size,qf(R,H===0,H===t.length-1,X),H),H>0&&Qt.push(ce),ue});function pt(oe){var H=oe.i===Qt.length,ue=H?Qt[oe.i-1]:Qt[oe.i];Ie.call(ue);var ce=H?ue.size-oe.minSize-ue[Yr]:oe.minSize+ue[jn];ge.call(ue,ce)}a.forEach(function(oe){var H=oe.element[Kh]()[i];H0){var Ee=Qt[ce-1],tt=a[Ee.a],ft=a[Ee.b];tt.size=H[ce-1],ft.size=ue,re(tt.element,tt.size,Ee[jn],tt.i),re(ft.element,ft.size,Ee[Yr],ft.i)}})}function $e(oe,H){Qt.forEach(function(ue){if(H!==!0?ue.parent.removeChild(ue.gutter):(ue.gutter[Nn]("mousedown",ue[xo]),ue.gutter[Nn]("touchstart",ue[xo])),oe!==!0){var ce=q(i,ue.a.size,ue[jn]);Object.keys(ce).forEach(function(Ee){a[ue.a].element.style[Ee]="",a[ue.b].element.style[Ee]=""})}})}return{setSizes:qt,getSizes:ye,collapse:function(H){pt(a[H])},destroy:$e,parent:h,pairs:Qt}};const gC=n=>({}),k1=n=>({}),mC=n=>({}),P1=n=>({});function SC(n){let e,t,i,r,s;const l=n[6].panelA,o=Zi(l,n,n[5],P1),a=n[6].panelB,c=Zi(a,n,n[5],k1);return{c(){e=k("div"),t=k("div"),o&&o.c(),i=N(),r=k("div"),c&&c.c(),v(t,"class","split-panel svelte-1k68mj4"),ne(t,"no-splitter",n[1]!=="all"),ne(t,"is-hidden",!If("a",n[1])),v(r,"class","split-panel svelte-1k68mj4"),ne(r,"no-splitter",n[1]!=="all"),ne(r,"is-hidden",!If("b",n[1])),v(e,"class","split svelte-1k68mj4"),ne(e,"horizontal",n[0]==="horizontal")},m(h,O){Y(h,e,O),Q(e,t),o&&o.m(t,null),n[7](t),Q(e,i),Q(e,r),c&&c.m(r,null),n[8](r),s=!0},p(h,[O]){o&&o.p&&(!s||O&32)&&Xi(o,l,h,h[5],s?Ri(l,h[5],O,mC):Ai(h[5]),P1),(!s||O&2)&&ne(t,"no-splitter",h[1]!=="all"),(!s||O&2)&&ne(t,"is-hidden",!If("a",h[1])),c&&c.p&&(!s||O&32)&&Xi(c,a,h,h[5],s?Ri(a,h[5],O,gC):Ai(h[5]),k1),(!s||O&2)&&ne(r,"no-splitter",h[1]!=="all"),(!s||O&2)&&ne(r,"is-hidden",!If("b",h[1])),(!s||O&1)&&ne(e,"horizontal",h[0]==="horizontal")},i(h){s||(M(o,h),M(c,h),s=!0)},o(h){j(o,h),j(c,h),s=!1},d(h){h&&A(e),o&&o.d(h),n[7](null),c&&c.d(h),n[8](null)}}}function If(n,e){return e==="all"||e===n}function bC(n,e,t){let{$$slots:i={},$$scope:r}=e,{direction:s="horizontal"}=e,{split:l=50}=e,{showPanels:o="all"}=e,a,c,h=null;function O(y,_){p(),_==="all"&&a&&c&&(h=pC([a,c],{direction:y,minSize:0,sizes:[l,100-l],onDragEnd(W){t(4,l=W[0])}}))}function p(){h&&(h.destroy(),h=null)}function g(y){h&&h.getSizes()[0]!==y&&h.setSizes([y,100-y])}Hc(()=>(O(s,o),p));function m(y){Et[y?"unshift":"push"](()=>{a=y,t(2,a)})}function $(y){Et[y?"unshift":"push"](()=>{c=y,t(3,c)})}return n.$$set=y=>{"direction"in y&&t(0,s=y.direction),"split"in y&&t(4,l=y.split),"showPanels"in y&&t(1,o=y.showPanels),"$$scope"in y&&t(5,r=y.$$scope)},n.$$.update=()=>{n.$$.dirty&3&&O(s,o),n.$$.dirty&16&&g(l)},[s,o,a,c,l,r,i,m,$]}class $C extends $i{constructor(e){super(),bi(this,e,bC,SC,Oi,{direction:0,split:4,showPanels:1})}}function yC(n,e){e&&e!=="lg"&&e!=="sm"&&e!=="xs"?n.style.fontSize=e.replace("x","em"):n.style.fontSize=""}function vC(n,e,t,i,r,s=1,l="",o=""){let a=1,c=1;r&&(r=="horizontal"?a=-1:r=="vertical"?c=-1:a=c=-1),typeof n=="string"&&(n=parseFloat(n)),typeof e=="string"&&(e=parseFloat(e)),typeof t=="string"&&(t=parseFloat(t));const h=`${e*s}${l}`,O=`${t*s}${l}`;let p=`translate(${h},${O}) scale(${a*n},${c*n})`;return i&&(p+=` rotate(${i}${o})`),p}function x1(n){let e,t,i,r,s,l,o;function a(O,p){return typeof O[16][4]=="string"?QC:wC}let c=a(n),h=c(n);return{c(){e=kl("svg"),t=kl("g"),i=kl("g"),h.c(),v(i,"transform",n[15]),v(t,"transform",r="translate("+n[16][0]/2+" "+n[16][1]/2+")"),v(t,"transform-origin",s=n[16][0]/4+" 0"),v(e,"id",n[1]),v(e,"class",l="svelte-fa svelte-fa-base "+n[0]+" svelte-bvo74f"),v(e,"style",n[2]),v(e,"viewBox",o="0 0 "+n[16][0]+" "+n[16][1]),v(e,"aria-hidden","true"),v(e,"role","img"),v(e,"xmlns","http://www.w3.org/2000/svg"),ne(e,"pulse",n[8]),ne(e,"svelte-fa-size-lg",n[3]==="lg"),ne(e,"svelte-fa-size-sm",n[3]==="sm"),ne(e,"svelte-fa-size-xs",n[3]==="xs"),ne(e,"svelte-fa-fw",n[5]),ne(e,"svelte-fa-pull-left",n[6]==="left"),ne(e,"svelte-fa-pull-right",n[6]==="right"),ne(e,"spin",n[7])},m(O,p){Y(O,e,p),Q(e,t),Q(t,i),h.m(i,null),n[23](e)},p(O,p){c===(c=a(O))&&h?h.p(O,p):(h.d(1),h=c(O),h&&(h.c(),h.m(i,null))),p&32768&&v(i,"transform",O[15]),p&65536&&r!==(r="translate("+O[16][0]/2+" "+O[16][1]/2+")")&&v(t,"transform",r),p&65536&&s!==(s=O[16][0]/4+" 0")&&v(t,"transform-origin",s),p&2&&v(e,"id",O[1]),p&1&&l!==(l="svelte-fa svelte-fa-base "+O[0]+" svelte-bvo74f")&&v(e,"class",l),p&4&&v(e,"style",O[2]),p&65536&&o!==(o="0 0 "+O[16][0]+" "+O[16][1])&&v(e,"viewBox",o),p&257&&ne(e,"pulse",O[8]),p&9&&ne(e,"svelte-fa-size-lg",O[3]==="lg"),p&9&&ne(e,"svelte-fa-size-sm",O[3]==="sm"),p&9&&ne(e,"svelte-fa-size-xs",O[3]==="xs"),p&33&&ne(e,"svelte-fa-fw",O[5]),p&65&&ne(e,"svelte-fa-pull-left",O[6]==="left"),p&65&&ne(e,"svelte-fa-pull-right",O[6]==="right"),p&129&&ne(e,"spin",O[7])},d(O){O&&A(e),h.d(),n[23](null)}}}function wC(n){let e,t,i,r,s,l,o,a,c,h;return{c(){e=kl("path"),l=kl("path"),v(e,"d",t=n[16][4][0]),v(e,"fill",i=n[10]||n[4]||"currentColor"),v(e,"fill-opacity",r=n[13]!=!1?n[11]:n[12]),v(e,"transform",s="translate("+n[16][0]/-2+" "+n[16][1]/-2+")"),v(l,"d",o=n[16][4][1]),v(l,"fill",a=n[9]||n[4]||"currentColor"),v(l,"fill-opacity",c=n[13]!=!1?n[12]:n[11]),v(l,"transform",h="translate("+n[16][0]/-2+" "+n[16][1]/-2+")")},m(O,p){Y(O,e,p),Y(O,l,p)},p(O,p){p&65536&&t!==(t=O[16][4][0])&&v(e,"d",t),p&1040&&i!==(i=O[10]||O[4]||"currentColor")&&v(e,"fill",i),p&14336&&r!==(r=O[13]!=!1?O[11]:O[12])&&v(e,"fill-opacity",r),p&65536&&s!==(s="translate("+O[16][0]/-2+" "+O[16][1]/-2+")")&&v(e,"transform",s),p&65536&&o!==(o=O[16][4][1])&&v(l,"d",o),p&528&&a!==(a=O[9]||O[4]||"currentColor")&&v(l,"fill",a),p&14336&&c!==(c=O[13]!=!1?O[12]:O[11])&&v(l,"fill-opacity",c),p&65536&&h!==(h="translate("+O[16][0]/-2+" "+O[16][1]/-2+")")&&v(l,"transform",h)},d(O){O&&(A(e),A(l))}}}function QC(n){let e,t,i,r;return{c(){e=kl("path"),v(e,"d",t=n[16][4]),v(e,"fill",i=n[4]||n[9]||"currentColor"),v(e,"transform",r="translate("+n[16][0]/-2+" "+n[16][1]/-2+")")},m(s,l){Y(s,e,l)},p(s,l){l&65536&&t!==(t=s[16][4])&&v(e,"d",t),l&528&&i!==(i=s[4]||s[9]||"currentColor")&&v(e,"fill",i),l&65536&&r!==(r="translate("+s[16][0]/-2+" "+s[16][1]/-2+")")&&v(e,"transform",r)},d(s){s&&A(e)}}}function _C(n){let e,t=n[16][4]&&x1(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,[r]){i[16][4]?t?t.p(i,r):(t=x1(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Qe,o:Qe,d(i){i&&A(e),t&&t.d(i)}}}function kC(n,e,t){let i,r,{class:s=void 0}=e,{id:l=void 0}=e,{style:o=void 0}=e,{icon:a}=e,{size:c=void 0}=e,{color:h=void 0}=e,{fw:O=!1}=e,{pull:p=void 0}=e,{scale:g=1}=e,{translateX:m=0}=e,{translateY:$=0}=e,{rotate:y=void 0}=e,{flip:_=void 0}=e,{spin:W=!1}=e,{pulse:R=!1}=e,{primaryColor:X=""}=e,{secondaryColor:C=""}=e,{primaryOpacity:E=1}=e,{secondaryOpacity:D=.4}=e,{swapOpacity:z=!1}=e,F;function B(q){Et[q?"unshift":"push"](()=>{F=q,t(14,F)})}return n.$$set=q=>{"class"in q&&t(0,s=q.class),"id"in q&&t(1,l=q.id),"style"in q&&t(2,o=q.style),"icon"in q&&t(17,a=q.icon),"size"in q&&t(3,c=q.size),"color"in q&&t(4,h=q.color),"fw"in q&&t(5,O=q.fw),"pull"in q&&t(6,p=q.pull),"scale"in q&&t(18,g=q.scale),"translateX"in q&&t(19,m=q.translateX),"translateY"in q&&t(20,$=q.translateY),"rotate"in q&&t(21,y=q.rotate),"flip"in q&&t(22,_=q.flip),"spin"in q&&t(7,W=q.spin),"pulse"in q&&t(8,R=q.pulse),"primaryColor"in q&&t(9,X=q.primaryColor),"secondaryColor"in q&&t(10,C=q.secondaryColor),"primaryOpacity"in q&&t(11,E=q.primaryOpacity),"secondaryOpacity"in q&&t(12,D=q.secondaryOpacity),"swapOpacity"in q&&t(13,z=q.swapOpacity)},n.$$.update=()=>{n.$$.dirty&16392&&F&&c&&yC(F,c),n.$$.dirty&131072&&t(16,i=a&&a.icon||[0,0,"",[],""]),n.$$.dirty&8126464&&t(15,r=vC(g,m,$,y,_,512))},[s,l,o,c,h,O,p,W,R,X,C,E,D,z,F,r,i,a,g,m,$,y,_,B]}class wt extends $i{constructor(e){super(),bi(this,e,kC,_C,Oi,{class:0,id:1,style:2,icon:17,size:3,color:4,fw:5,pull:6,scale:18,translateX:19,translateY:20,rotate:21,flip:22,spin:7,pulse:8,primaryColor:9,secondaryColor:10,primaryOpacity:11,secondaryOpacity:12,swapOpacity:13})}}const rd={prefix:"fas",iconName:"lock",icon:[448,512,[128274],"f023","M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"]},Ay={prefix:"fas",iconName:"share-nodes",icon:[448,512,["share-alt"],"f1e0","M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"]},W1={prefix:"fas",iconName:"eye-slash",icon:[640,512,[],"f070","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"]},PC={prefix:"fas",iconName:"shuffle",icon:[512,512,[128256,"random"],"f074","M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"]},xC={prefix:"fas",iconName:"clipboard",icon:[384,512,[128203],"f328","M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM112 192l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]},Yy={prefix:"fas",iconName:"arrow-up-right-from-square",icon:[512,512,["external-link"],"f08e","M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]},C1={prefix:"fas",iconName:"lock-open",icon:[576,512,[],"f3c1","M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"]},WC={prefix:"fas",iconName:"forward-fast",icon:[512,512,[9197,"fast-forward"],"f050","M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7 224 416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7 448 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 118.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96l0 118.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96L0 416c0 12.4 7.2 23.7 18.4 29z"]},T1={prefix:"fas",iconName:"eye",icon:[576,512,[128065],"f06e","M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"]},Uy={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]},CC={prefix:"fas",iconName:"gear",icon:[512,512,[9881,"cog"],"f013","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]},Ey=CC,TC={prefix:"fas",iconName:"folder-tree",icon:[576,512,[],"f802","M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32l0 96L0 384c0 35.3 28.7 64 64 64l192 0 0-64L64 384l0-224 192 0 0-64L64 96l0-64zM288 192c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4L409.4 9.4c-6-6-14.1-9.4-22.6-9.4L320 0c-17.7 0-32 14.3-32 32l0 160zm0 288c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4l-13.3-13.3c-6-6-14.1-9.4-22.6-9.4L320 288c-17.7 0-32 14.3-32 32l0 160z"]},ZC={prefix:"fas",iconName:"download",icon:[512,512,[],"f019","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]},RC={prefix:"fas",iconName:"stop",icon:[384,512,[9209],"f04d","M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]},XC={prefix:"fas",iconName:"angle-down",icon:[448,512,[8964],"f107","M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]},AC={prefix:"fas",iconName:"eraser",icon:[576,512,[],"f12d","M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7L288 480l9.4 0L512 480c17.7 0 32-14.3 32-32s-14.3-32-32-32l-124.1 0L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416l-9.4 0-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"]},YC={prefix:"fas",iconName:"play",icon:[384,512,[9654],"f04b","M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"]},zy={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},My={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},UC={prefix:"fas",iconName:"hammer",icon:[576,512,[128296],"f6e3","M413.5 237.5c-28.2 4.8-58.2-3.6-80-25.4l-38.1-38.1C280.4 159 272 138.8 272 117.6l0-12.1L192.3 62c-5.3-2.9-8.6-8.6-8.3-14.7s3.9-11.5 9.5-14l47.2-21C259.1 4.2 279 0 299.2 0l18.1 0c36.7 0 72 14 98.7 39.1l44.6 42c24.2 22.8 33.2 55.7 26.6 86L503 183l8-8c9.4-9.4 24.6-9.4 33.9 0l24 24c9.4 9.4 9.4 24.6 0 33.9l-88 88c-9.4 9.4-24.6 9.4-33.9 0l-24-24c-9.4-9.4-9.4-24.6 0-33.9l8-8-17.5-17.5zM27.4 377.1L260.9 182.6c3.5 4.9 7.5 9.6 11.8 14l38.1 38.1c6 6 12.4 11.2 19.2 15.7L134.9 484.6c-14.5 17.4-36 27.4-58.6 27.4C34.1 512 0 477.8 0 435.7c0-22.6 10.1-44.1 27.4-58.6z"]},Dy={prefix:"fas",iconName:"rotate",icon:[512,512,[128260,"sync-alt"],"f2f1","M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z"]},Vy={prefix:"fas",iconName:"clock-rotate-left",icon:[512,512,["history"],"f1da","M75 75L41 41C25.9 25.9 0 36.6 0 57.9L0 168c0 13.3 10.7 24 24 24l110.1 0c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1c0-13.3-10.7-24-24-24z"]};function EC(n){let e,t,i,r,s,l,o,a,c=n[0]&&!n[3]&&Z1(n);return{c(){e=k("span"),t=pe(n[1]),i=pe(n[2]),r=N(),c&&c.c(),s=Gt(),v(e,"class","filename svelte-1ul6ap")},m(h,O){Y(h,e,O),Q(e,t),Q(e,i),Y(h,r,O),c&&c.m(h,O),Y(h,s,O),l=!0,o||(a=le(e,"click",n[8]),o=!0)},p(h,O){(!l||O&2)&&Ne(t,h[1]),(!l||O&4)&&Ne(i,h[2]),h[0]&&!h[3]?c?(c.p(h,O),O&9&&M(c,1)):(c=Z1(h),c.c(),M(c,1),c.m(s.parentNode,s)):c&&(Je(),j(c,1,1,()=>{c=null}),et())},i(h){l||(M(c),l=!0)},o(h){j(c),l=!1},d(h){h&&(A(e),A(r),A(s)),c&&c.d(h),o=!1,a()}}}function zC(n){let e,t,i,r,s;return{c(){e=k("input"),i=pe(n[2]),v(e,"size",t=n[4].length||n[1].length),v(e,"placeholder",n[1])},m(l,o){Y(l,e,o),n[11](e),si(e,n[4]),Y(l,i,o),r||(s=[le(e,"input",n[12]),le(e,"blur",n[10]),le(e,"keyup",n[9])],r=!0)},p(l,o){o&18&&t!==(t=l[4].length||l[1].length)&&v(e,"size",t),o&2&&v(e,"placeholder",l[1]),o&16&&e.value!==l[4]&&si(e,l[4]),o&4&&Ne(i,l[2])},i:Qe,o:Qe,d(l){l&&(A(e),A(i)),n[11](null),r=!1,Ft(s)}}}function Z1(n){let e,t,i,r,s;return t=new wt({props:{icon:My}}),{c(){e=k("span"),Ae(t.$$.fragment),v(e,"class","close-tab svelte-1ul6ap")},m(l,o){Y(l,e,o),Re(t,e,null),i=!0,r||(s=le(e,"click",n[13]),r=!0)},p:Qe,i(l){i||(M(t.$$.fragment,l),i=!0)},o(l){j(t.$$.fragment,l),i=!1},d(l){l&&A(e),Xe(t),r=!1,s()}}}function MC(n){let e,t,i,r,s,l;const o=[zC,EC],a=[];function c(h,O){return h[5]?0:1}return t=c(n),i=a[t]=o[t](n),{c(){e=k("a"),i.c(),v(e,"class","filename-link svelte-1ul6ap"),ne(e,"active",n[0]),ne(e,"readonly",n[3])},m(h,O){Y(h,e,O),a[t].m(e,null),r=!0,s||(l=le(e,"click",n[14]),s=!0)},p(h,[O]){let p=t;t=c(h),t===p?a[t].p(h,O):(Je(),j(a[p],1,1,()=>{a[p]=null}),et(),i=a[t],i?i.p(h,O):(i=a[t]=o[t](h),i.c()),M(i,1),i.m(e,null)),(!r||O&1)&&ne(e,"active",h[0]),(!r||O&8)&&ne(e,"readonly",h[3])},i(h){r||(M(i),r=!0)},o(h){j(i),r=!1},d(h){h&&A(e),a[t].d(),s=!1,l()}}}function DC(n,e,t){let{active:i=!1}=e,{name:r="Untitled"}=e,{suffix:s=".mzn"}=e,{readonly:l=!1}=e;const o=en();let a=!1,c,h="";async function O(){!i||l||(t(5,a=!0),t(4,h=r),await Fn(),c.focus())}function p(W){W.key==="Enter"?(W.preventDefault(),g()):W.key==="Escape"&&t(5,a=!1)}function g(){t(5,a=!1),h.length>0&&o("rename",{name:h,suffix:s})}function m(W){Et[W?"unshift":"push"](()=>{c=W,t(6,c)})}function $(){h=this.value,t(4,h)}const y=()=>o("close"),_=()=>{a||o("click")};return n.$$set=W=>{"active"in W&&t(0,i=W.active),"name"in W&&t(1,r=W.name),"suffix"in W&&t(2,s=W.suffix),"readonly"in W&&t(3,l=W.readonly)},n.$$.update=()=>{n.$$.dirty&16&&/[\/\\\.]/.test(h)&&t(4,h=h.replaceAll(/[\/\\\.]/g,""))},[i,r,s,l,h,a,c,o,O,p,g,m,$,y,_]}class VC extends $i{constructor(e){super(),bi(this,e,DC,MC,Oi,{active:0,name:1,suffix:2,readonly:3})}}function qy(n){const e=n-1;return e*e*e+1}function qC(n,{from:e,to:t},i={}){const r=getComputedStyle(n),s=r.transform==="none"?"":r.transform,[l,o]=r.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*l/t.width-(t.left+l),c=e.top+e.height*o/t.height-(t.top+o),{delay:h=0,duration:O=g=>Math.sqrt(g)*120,easing:p=qy}=i;return{delay:h,duration:Gc(O)?O(Math.sqrt(a*a+c*c)):O,easing:p,css:(g,m)=>{const $=m*a,y=m*c,_=g+m*e.width/t.width,W=g+m*e.height/t.height;return`transform: ${s} translate(${$}px, ${y}px) scale(${_}, ${W});`}}}function R1(n,e,t){const i=n.slice();return i[19]=e[t],i}function X1(n,e){let t,i,r,s=Qe,l,o,a;function c(){return e[11](e[19])}function h(...m){return e[12](e[19],...m)}function O(...m){return e[13](e[19],...m)}i=new VC({props:{name:e[19].stem,suffix:e[19].suffix,active:e[0]===e[19].index,readonly:e[1]||e[19].readonlyTab}}),i.$on("click",c),i.$on("rename",h),i.$on("close",O);function p(...m){return e[14](e[19],...m)}function g(...m){return e[15](e[19],...m)}return{key:n,first:null,c(){t=k("li"),Ae(i.$$.fragment),v(t,"draggable",!0),ne(t,"is-active",e[0]===e[19].index),this.first=t},m(m,$){Y(m,t,$),Re(i,t,null),l=!0,o||(a=[le(t,"dragstart",p),le(t,"dragover",e[7]),le(t,"drop",g)],o=!0)},p(m,$){e=m;const y={};$&4&&(y.name=e[19].stem),$&4&&(y.suffix=e[19].suffix),$&5&&(y.active=e[0]===e[19].index),$&6&&(y.readonly=e[1]||e[19].readonlyTab),i.$set(y),(!l||$&5)&&ne(t,"is-active",e[0]===e[19].index)},r(){r=t.getBoundingClientRect()},f(){r4(t),s()},a(){s(),s=n4(t,r,qC,{duration:200})},i(m){l||(M(i.$$.fragment,m),l=!0)},o(m){j(i.$$.fragment,m),l=!1},d(m){m&&A(t),Xe(i),o=!1,Ft(a)}}}function A1(n){let e,t,i,r,s,l,o,a,c,h,O,p;return r=new wt({props:{icon:zy}}),c=new wt({props:{icon:TC}}),{c(){e=k("li"),t=k("a"),i=k("span"),Ae(r.$$.fragment),s=N(),l=k("li"),o=k("button"),a=k("span"),Ae(c.$$.fragment),v(i,"class","icon add-icon svelte-7ub6h4"),v(t,"title","Add new file"),v(a,"class","icon"),v(o,"class","button is-small"),v(o,"title","Manage files"),v(l,"class","right svelte-7ub6h4")},m(g,m){Y(g,e,m),Q(e,t),Q(t,i),Re(r,i,null),Y(g,s,m),Y(g,l,m),Q(l,o),Q(o,a),Re(c,a,null),h=!0,O||(p=[le(t,"click",n[16]),le(o,"click",n[17])],O=!0)},p:Qe,i(g){h||(M(r.$$.fragment,g),M(c.$$.fragment,g),h=!0)},o(g){j(r.$$.fragment,g),j(c.$$.fragment,g),h=!1},d(g){g&&(A(e),A(s),A(l)),Xe(r),Xe(c),O=!1,Ft(p)}}}function IC(n){let e,t,i=[],r=new Map,s,l,o=st(n[2]);const a=h=>h[19].name;for(let h=0;h{c=null}),et()):c?(c.p(h,O),O&2&&M(c,1)):(c=A1(h),c.c(),M(c,1),c.m(t,null))},i(h){if(!l){for(let O=0;Oa(E.index),y=(E,D)=>c(D,E.index),_=(E,D)=>m(E.index),W=(E,D)=>O(D,E.index),R=(E,D)=>g(D,E.index),X=()=>o("newFile"),C=()=>o("manageFiles");return n.$$set=E=>{"files"in E&&t(10,r=E.files),"currentIndex"in E&&t(0,s=E.currentIndex),"readonly"in E&&t(1,l=E.readonly)},n.$$.update=()=>{n.$$.dirty&1024&&t(2,i=r.map((E,D)=>{const z=E.name.endsWith(".mzc.mzn")?E.name.length-8:E.name.lastIndexOf(".");return{...E,stem:E.name.substring(0,z),suffix:E.name.substring(z),index:D}}).filter(E=>!E.hidden))},[s,l,i,o,a,c,O,p,g,m,r,$,y,_,W,R,X,C]}class NC extends $i{constructor(e){super(),bi(this,e,LC,IC,Oi,{files:10,currentIndex:0,readonly:1})}}function Y1(n,{delay:e=0,duration:t=400,easing:i=vd}={}){const r=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*r}`}}function wc(n,{delay:e=0,duration:t=400,easing:i=qy,x:r=0,y:s=0,opacity:l=0}={}){const o=getComputedStyle(n),a=+o.opacity,c=o.transform==="none"?"":o.transform,h=a*(1-l),[O,p]=dm(r),[g,m]=dm(s);return{delay:e,duration:t,easing:i,css:($,y)=>` +`){let r="";for(let s=0,l=0;se&&s&&(r+=i),el&&(r+=o.sliceString(e-l,t-l,i)),l=a+1}return r}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof hr))return 0;let i=0,[r,s,l,o]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;r+=t,s+=t){if(r==l||s==o)return i;let a=this.children[r],c=e.children[s];if(a!=c)return i+a.scanIdentical(c,t);i+=a.length+1}}static from(e,t=e.reduce((i,r)=>i+r.length+1,-1)){let i=0;for(let g of e)i+=g.lines;if(i<32){let g=[];for(let m of e)m.flatten(g);return new ni(g,t)}let r=Math.max(32,i>>5),s=r<<1,l=r>>1,o=[],a=0,c=-1,h=[];function O(g){let m;if(g.lines>s&&g instanceof hr)for(let $ of g.children)O($);else g.lines>l&&(a>l||!a)?(p(),o.push(g)):g instanceof ni&&a&&(m=h[h.length-1])instanceof ni&&g.lines+m.lines<=32?(a+=g.lines,c+=g.length+1,h[h.length-1]=new ni(m.text.concat(g.text),m.length+1+g.length)):(a+g.lines>r&&p(),a+=g.lines,c+=g.length+1,h.push(g))}function p(){a!=0&&(o.push(h.length==1?h[0]:hr.from(h,c)),c=-1,a=h.length=0)}for(let g of e)O(g);return p(),o.length==1?o[0]:new hr(o,t)}}mt.empty=new ni([""],0);function S4(n){let e=-1;for(let t of n)e+=t.length+1;return e}function ic(n,e,t=0,i=1e9){for(let r=0,s=0,l=!0;s=t&&(a>i&&(o=o.slice(0,i-r)),r0?1:(e instanceof ni?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let i=this.nodes.length-1,r=this.nodes[i],s=this.offsets[i],l=s>>1,o=r instanceof ni?r.text.length:r.children.length;if(l==(t>0?o:0)){if(i==0)return this.done=!0,this.value="",this;t>0&&this.offsets[i-1]++,this.nodes.pop(),this.offsets.pop()}else if((s&1)==(t>0?0:1)){if(this.offsets[i]+=t,e==0)return this.lineBreak=!0,this.value=` +`,this;e--}else if(r instanceof ni){let a=r.text[l+(t<0?-1:0)];if(this.offsets[i]+=t,a.length>Math.max(0,e))return this.value=e==0?a:t>0?a.slice(e):a.slice(0,a.length-e),this;e-=a.length}else{let a=r.children[l+(t<0?-1:0)];e>a.length?(e-=a.length,this.offsets[i]+=t):(t<0&&this.offsets[i]--,this.nodes.push(a),this.offsets.push(t>0?1:(a instanceof ni?a.text.length:a.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class c${constructor(e,t,i){this.value="",this.done=!1,this.cursor=new Io(e,t>i?-1:1),this.pos=t>i?e.length:0,this.from=Math.min(t,i),this.to=Math.max(t,i)}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 i=t<0?this.pos-this.from:this.to-this.pos;e>i&&(e=i),i-=e;let{value:r}=this.cursor.next(e);return this.pos+=(r.length+e)*t,this.value=r.length<=i?r:t<0?r.slice(r.length-i):r.slice(0,i),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 u${constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:i,value:r}=this.inner.next(e);return t?(this.done=!0,this.value=""):i?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=r,this.afterBreak=!1),this}get lineBreak(){return!1}}typeof Symbol<"u"&&(mt.prototype[Symbol.iterator]=function(){return this.iter()},Io.prototype[Symbol.iterator]=c$.prototype[Symbol.iterator]=u$.prototype[Symbol.iterator]=function(){return this});class b4{constructor(e,t,i,r){this.from=e,this.to=t,this.number=i,this.text=r}get length(){return this.to-this.from}}let Wl="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,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(n=>n?parseInt(n,36):1);for(let n=1;nn)return Wl[e-1]<=n;return!1}function ym(n){return n>=127462&&n<=127487}const vm=8205;function Ei(n,e,t=!0,i=!0){return(t?h$:y4)(n,e,i)}function h$(n,e,t){if(e==n.length)return e;e&&O$(n.charCodeAt(e))&&d$(n.charCodeAt(e-1))&&e--;let i=Qi(n,e);for(e+=Zn(i);e=0&&ym(Qi(n,l));)s++,l-=2;if(s%2==0)break;e+=2}else break}return e}function y4(n,e,t){for(;e>0;){let i=h$(n,e-2,t);if(i=56320&&n<57344}function d$(n){return n>=55296&&n<56320}function Qi(n,e){let t=n.charCodeAt(e);if(!d$(t)||e+1==n.length)return t;let i=n.charCodeAt(e+1);return O$(i)?(t-55296<<10)+(i-56320)+65536:t}function Qd(n){return n<=65535?String.fromCharCode(n):(n-=65536,String.fromCharCode((n>>10)+55296,(n&1023)+56320))}function Zn(n){return n<65536?1:2}const _O=/\r\n?|\n/;var ki=function(n){return n[n.Simple=0]="Simple",n[n.TrackDel=1]="TrackDel",n[n.TrackBefore=2]="TrackBefore",n[n.TrackAfter=3]="TrackAfter",n}(ki||(ki={}));class mr{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return s+(e-r);s+=o}else{if(i!=ki.Simple&&c>=e&&(i==ki.TrackDel&&re||i==ki.TrackBefore&&re))return null;if(c>e||c==e&&t<0&&!o)return e==r||t<0?s:s+a;s+=a}r=c}if(e>r)throw new RangeError(`Position ${e} is out of range for changeset of length ${r}`);return s}touchesRange(e,t=e){for(let i=0,r=0;i=0&&r<=t&&o>=e)return rt?"cover":!0;r=o}return!1}toString(){let e="";for(let t=0;t=0?":"+r:"")}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 mr(e)}static create(e){return new mr(e)}}class ui extends mr{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 kO(this,(t,i,r,s,l)=>e=e.replace(r,r+(i-t),l),!1),e}mapDesc(e,t=!1){return PO(this,e,t,!0)}invert(e){let t=this.sections.slice(),i=[];for(let r=0,s=0;r=0){t[r]=o,t[r+1]=l;let a=r>>1;for(;i.length0&&ds(i,t,s.text),s.forward(h),o+=h}let c=e[l++];for(;o>1].toJSON()))}return e}static of(e,t,i){let r=[],s=[],l=0,o=null;function a(h=!1){if(!h&&!r.length)return;lp||O<0||p>t)throw new RangeError(`Invalid change range ${O} to ${p} (in doc of length ${t})`);let m=g?typeof g=="string"?mt.of(g.split(i||_O)):g:mt.empty,$=m.length;if(O==p&&$==0)return;Ol&&Ti(r,O-l,-1),Ti(r,p-O,$),ds(s,r,m),l=p}}return c(e),a(!o),o}static empty(e){return new ui(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],i=[];for(let r=0;ro&&typeof l!="string"))throw new RangeError("Invalid JSON representation of ChangeSet");if(s.length==1)t.push(s[0],0);else{for(;i.length=0&&t<=0&&t==n[r+1]?n[r]+=e:e==0&&n[r]==0?n[r+1]+=t:i?(n[r]+=e,n[r+1]+=t):n.push(e,t)}function ds(n,e,t){if(t.length==0)return;let i=e.length-2>>1;if(i>1])),!(t||l==n.sections.length||n.sections[l+1]<0);)o=n.sections[l++],a=n.sections[l++];e(r,c,s,h,O),r=c,s=h}}}function PO(n,e,t,i=!1){let r=[],s=i?[]:null,l=new Go(n),o=new Go(e);for(let a=-1;;)if(l.ins==-1&&o.ins==-1){let c=Math.min(l.len,o.len);Ti(r,c,-1),l.forward(c),o.forward(c)}else if(o.ins>=0&&(l.ins<0||a==l.i||l.off==0&&(o.len=0&&a=0){let c=0,h=l.len;for(;h;)if(o.ins==-1){let O=Math.min(h,o.len);c+=O,h-=O,o.forward(O)}else if(o.ins==0&&o.lena||l.ins>=0&&l.len>a)&&(o||i.length>c),s.forward2(a),l.forward(a)}}}}class Go{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?mt.empty:e[t]}textBit(e){let{inserted:t}=this.set,i=this.i-2>>1;return i>=t.length&&!e?mt.empty:t[i].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 js{constructor(e,t,i){this.from=e,this.to=t,this.flags=i}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 i,r;return this.empty?i=r=e.mapPos(this.from,t):(i=e.mapPos(this.from,1),r=e.mapPos(this.to,-1)),i==this.from&&r==this.to?this:new js(i,r,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return ee.range(e,t);let i=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return ee.range(this.anchor,i)}eq(e){return this.anchor==e.anchor&&this.head==e.head}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 ee.range(e.anchor,e.head)}static create(e,t,i){return new js(e,t,i)}}class ee{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:ee.create(this.ranges.map(i=>i.map(e,t)),this.mainIndex)}eq(e){if(this.ranges.length!=e.ranges.length||this.mainIndex!=e.mainIndex)return!1;for(let t=0;te.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 ee(e.ranges.map(t=>js.fromJSON(t)),e.main)}static single(e,t=e){return new ee([ee.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 i=0,r=0;re?8:0)|s)}static normalized(e,t=0){let i=e[t];e.sort((r,s)=>r.from-s.from),t=e.indexOf(i);for(let r=1;rs.head?ee.range(a,o):ee.range(o,a))}}return new ee(e,t)}}function g$(n,e){for(let t of n.ranges)if(t.to>e)throw new RangeError("Selection points outside of document")}let _d=0;class _e{constructor(e,t,i,r,s){this.combine=e,this.compareInput=t,this.compare=i,this.isStatic=r,this.id=_d++,this.default=e([]),this.extensions=typeof s=="function"?s(this):s}get reader(){return this}static define(e={}){return new _e(e.combine||(t=>t),e.compareInput||((t,i)=>t===i),e.compare||(e.combine?(t,i)=>t===i:kd),!!e.static,e.enables)}of(e){return new nc([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nc(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new nc(e,this,2,t)}from(e,t){return t||(t=i=>i),this.compute([e],i=>t(i.field(e)))}}function kd(n,e){return n==e||n.length==e.length&&n.every((t,i)=>t===e[i])}class nc{constructor(e,t,i,r){this.dependencies=e,this.facet=t,this.type=i,this.value=r,this.id=_d++}dynamicSlot(e){var t;let i=this.value,r=this.facet.compareInput,s=this.id,l=e[s]>>1,o=this.type==2,a=!1,c=!1,h=[];for(let O of this.dependencies)O=="doc"?a=!0:O=="selection"?c=!0:((t=e[O.id])!==null&&t!==void 0?t:1)&1||h.push(e[O.id]);return{create(O){return O.values[l]=i(O),1},update(O,p){if(a&&p.docChanged||c&&(p.docChanged||p.selection)||WO(O,h)){let g=i(O);if(o?!wm(g,O.values[l],r):!r(g,O.values[l]))return O.values[l]=g,1}return 0},reconfigure:(O,p)=>{let g,m=p.config.address[s];if(m!=null){let $=mc(p,m);if(this.dependencies.every(y=>y instanceof _e?p.facet(y)===O.facet(y):y instanceof pi?p.field(y,!1)==O.field(y,!1):!0)||(o?wm(g=i(O),$,r):r(g=i(O),$)))return O.values[l]=$,0}else g=i(O);return O.values[l]=g,1}}}}function wm(n,e,t){if(n.length!=e.length)return!1;for(let i=0;in[a.id]),r=t.map(a=>a.type),s=i.filter(a=>!(a&1)),l=n[e.id]>>1;function o(a){let c=[];for(let h=0;hi===r),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(Qm).find(i=>i.field==this);return((t==null?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:i=>(i.values[t]=this.create(i),1),update:(i,r)=>{let s=i.values[t],l=this.updateF(s,r);return this.compareF(s,l)?0:(i.values[t]=l,1)},reconfigure:(i,r)=>r.config.address[this.id]!=null?(i.values[t]=r.field(this),0):(i.values[t]=this.create(i),1)}}init(e){return[this,Qm.of({field:this,create:e})]}get extension(){return this}}const qs={lowest:4,low:3,default:2,high:1,highest:0};function _o(n){return e=>new m$(e,n)}const Js={highest:_o(qs.highest),high:_o(qs.high),default:_o(qs.default),low:_o(qs.low),lowest:_o(qs.lowest)};class m${constructor(e,t){this.inner=e,this.prec=t}}class ql{of(e){return new xO(this,e)}reconfigure(e){return ql.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class xO{constructor(e,t){this.compartment=e,this.inner=t}}class gc{constructor(e,t,i,r,s,l){for(this.base=e,this.compartments=t,this.dynamicSlots=i,this.address=r,this.staticValues=s,this.facets=l,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,i){let r=[],s=Object.create(null),l=new Map;for(let p of w4(e,t,l))p instanceof pi?r.push(p):(s[p.facet.id]||(s[p.facet.id]=[])).push(p);let o=Object.create(null),a=[],c=[];for(let p of r)o[p.id]=c.length<<1,c.push(g=>p.slot(g));let h=i==null?void 0:i.config.facets;for(let p in s){let g=s[p],m=g[0].facet,$=h&&h[p]||[];if(g.every(y=>y.type==0))if(o[m.id]=a.length<<1|1,kd($,g))a.push(i.facet(m));else{let y=m.combine(g.map(_=>_.value));a.push(i&&m.compare(y,i.facet(m))?i.facet(m):y)}else{for(let y of g)y.type==0?(o[y.id]=a.length<<1|1,a.push(y.value)):(o[y.id]=c.length<<1,c.push(_=>y.dynamicSlot(_)));o[m.id]=c.length<<1,c.push(y=>v4(y,m,g))}}let O=c.map(p=>p(o));return new gc(e,l,O,o,a,s)}}function w4(n,e,t){let i=[[],[],[],[],[]],r=new Map;function s(l,o){let a=r.get(l);if(a!=null){if(a<=o)return;let c=i[a].indexOf(l);c>-1&&i[a].splice(c,1),l instanceof xO&&t.delete(l.compartment)}if(r.set(l,o),Array.isArray(l))for(let c of l)s(c,o);else if(l instanceof xO){if(t.has(l.compartment))throw new RangeError("Duplicate use of compartment in extensions");let c=e.get(l.compartment)||l.inner;t.set(l.compartment,c),s(c,o)}else if(l instanceof m$)s(l.inner,l.prec);else if(l instanceof pi)i[o].push(l),l.provides&&s(l.provides,o);else if(l instanceof nc)i[o].push(l),l.facet.extensions&&s(l.facet.extensions,qs.default);else{let c=l.extension;if(!c)throw new Error(`Unrecognized extension value in extension set (${l}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);s(c,o)}}return s(n,qs.default),i.reduce((l,o)=>l.concat(o))}function Lo(n,e){if(e&1)return 2;let t=e>>1,i=n.status[t];if(i==4)throw new Error("Cyclic dependency between fields and/or facets");if(i&2)return i;n.status[t]=4;let r=n.computeSlot(n,n.config.dynamicSlots[t]);return n.status[t]=2|r}function mc(n,e){return e&1?n.config.staticValues[e>>1]:n.values[e>>1]}const S$=_e.define(),b$=_e.define({combine:n=>n.some(e=>e),static:!0}),$$=_e.define({combine:n=>n.length?n[0]:void 0,static:!0}),y$=_e.define(),v$=_e.define(),w$=_e.define(),Q$=_e.define({combine:n=>n.length?n[0]:!1});class Ir{constructor(e,t){this.type=e,this.value=t}static define(){return new Q4}}class Q4{of(e){return new Ir(this,e)}}class _4{constructor(e){this.map=e}of(e){return new Ne(this,e)}}class Ne{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 Ne(this.type,t)}is(e){return this.type==e}static define(e={}){return new _4(e.map||(t=>t))}static mapEffects(e,t){if(!e.length)return e;let i=[];for(let r of e){let s=r.map(t);s&&i.push(s)}return i}}Ne.reconfigure=Ne.define();Ne.appendConfig=Ne.define();class hi{constructor(e,t,i,r,s,l){this.startState=e,this.changes=t,this.selection=i,this.effects=r,this.annotations=s,this.scrollIntoView=l,this._doc=null,this._state=null,i&&g$(i,t.newLength),s.some(o=>o.type==hi.time)||(this.annotations=s.concat(hi.time.of(Date.now())))}static create(e,t,i,r,s,l){return new hi(e,t,i,r,s,l)}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(hi.userEvent);return!!(t&&(t==e||t.length>e.length&&t.slice(0,e.length)==e&&t[e.length]=="."))}}hi.time=Ir.define();hi.userEvent=Ir.define();hi.addToHistory=Ir.define();hi.remote=Ir.define();function k4(n,e){let t=[];for(let i=0,r=0;;){let s,l;if(i=n[i]))s=n[i++],l=n[i++];else if(r=0;r--){let s=i[r](n);s instanceof hi?n=s:Array.isArray(s)&&s.length==1&&s[0]instanceof hi?n=s[0]:n=k$(e,xl(s),!1)}return n}function W4(n){let e=n.startState,t=e.facet(w$),i=n;for(let r=t.length-1;r>=0;r--){let s=t[r](n);s&&Object.keys(s).length&&(i=_$(i,CO(e,s,n.changes.newLength),!0))}return i==n?n:hi.create(e,n.changes,n.selection,i.effects,i.annotations,i.scrollIntoView)}const x4=[];function xl(n){return n==null?x4:Array.isArray(n)?n:[n]}var Lt=function(n){return n[n.Word=0]="Word",n[n.Space=1]="Space",n[n.Other=2]="Other",n}(Lt||(Lt={}));const C4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let TO;try{TO=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch{}function T4(n){if(TO)return TO.test(n);for(let e=0;e"€"&&(t.toUpperCase()!=t.toLowerCase()||C4.test(t)))return!0}return!1}function Z4(n){return e=>{if(!/\S/.test(e))return Lt.Space;if(T4(e))return Lt.Word;for(let t=0;t-1)return Lt.Word;return Lt.Other}}class Ot{constructor(e,t,i,r,s,l){this.config=e,this.doc=t,this.selection=i,this.values=r,this.status=e.statusTemplate.slice(),this.computeSlot=s,l&&(l._state=this);for(let o=0;or.set(a,o)),t=null),r.set(l.value.compartment,l.value.extension)):l.is(Ne.reconfigure)?(t=null,i=l.value):l.is(Ne.appendConfig)&&(t=null,i=xl(i).concat(l.value));let s;t?s=e.startState.values.slice():(t=gc.resolve(i,r,this),s=new Ot(t,this.doc,this.selection,t.dynamicSlots.map(()=>null),(o,a)=>a.reconfigure(o,this),null).values),new Ot(t,e.newDoc,e.newSelection,s,(l,o)=>o.update(l,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:ee.cursor(t.from+e.length)}))}changeByRange(e){let t=this.selection,i=e(t.ranges[0]),r=this.changes(i.changes),s=[i.range],l=xl(i.effects);for(let o=1;ol.spec.fromJSON(o,a)))}}return Ot.create({doc:e.doc,selection:ee.fromJSON(e.selection),extensions:t.extensions?r.concat([t.extensions]):r})}static create(e={}){let t=gc.resolve(e.extensions||[],new Map),i=e.doc instanceof mt?e.doc:mt.of((e.doc||"").split(t.staticFacet(Ot.lineSeparator)||_O)),r=e.selection?e.selection instanceof ee?e.selection:ee.single(e.selection.anchor,e.selection.head):ee.single(0);return g$(r,i.length),t.staticFacet(b$)||(r=r.asSingle()),new Ot(t,i,r,t.dynamicSlots.map(()=>null),(s,l)=>l.create(s),null)}get tabSize(){return this.facet(Ot.tabSize)}get lineBreak(){return this.facet(Ot.lineSeparator)||` +`}get readOnly(){return this.facet(Q$)}phrase(e,...t){for(let i of this.facet(Ot.phrases))if(Object.prototype.hasOwnProperty.call(i,e)){e=i[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,(i,r)=>{if(r=="$")return"$";let s=+(r||1);return!s||s>t.length?i:t[s-1]})),e}languageDataAt(e,t,i=-1){let r=[];for(let s of this.facet(S$))for(let l of s(this,t,i))Object.prototype.hasOwnProperty.call(l,e)&&r.push(l[e]);return r}charCategorizer(e){return Z4(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:i,length:r}=this.doc.lineAt(e),s=this.charCategorizer(e),l=e-i,o=e-i;for(;l>0;){let a=Ei(t,l,!1);if(s(t.slice(a,l))!=Lt.Word)break;l=a}for(;on.length?n[0]:4});Ot.lineSeparator=$$;Ot.readOnly=Q$;Ot.phrases=_e.define({compare(n,e){let t=Object.keys(n),i=Object.keys(e);return t.length==i.length&&t.every(r=>n[r]==e[r])}});Ot.languageData=S$;Ot.changeFilter=y$;Ot.transactionFilter=v$;Ot.transactionExtender=w$;ql.reconfigure=Ne.define();function br(n,e,t={}){let i={};for(let r of n)for(let s of Object.keys(r)){let l=r[s],o=i[s];if(o===void 0)i[s]=l;else if(!(o===l||l===void 0))if(Object.hasOwnProperty.call(t,s))i[s]=t[s](o,l);else throw new Error("Config merge conflict for field "+s)}for(let r in e)i[r]===void 0&&(i[r]=e[r]);return i}class Gs{eq(e){return this==e}range(e,t=e){return ZO.create(e,t,this)}}Gs.prototype.startSide=Gs.prototype.endSide=0;Gs.prototype.point=!1;Gs.prototype.mapMode=ki.TrackDel;let ZO=class P${constructor(e,t,i){this.from=e,this.to=t,this.value=i}static create(e,t,i){return new P$(e,t,i)}};function RO(n,e){return n.from-e.from||n.value.startSide-e.value.startSide}class Pd{constructor(e,t,i,r){this.from=e,this.to=t,this.value=i,this.maxPoint=r}get length(){return this.to[this.to.length-1]}findIndex(e,t,i,r=0){let s=i?this.to:this.from;for(let l=r,o=s.length;;){if(l==o)return l;let a=l+o>>1,c=s[a]-e||(i?this.value[a].endSide:this.value[a].startSide)-t;if(a==l)return c>=0?l:o;c>=0?o=a:l=a+1}}between(e,t,i,r){for(let s=this.findIndex(t,-1e9,!0),l=this.findIndex(i,1e9,!1,s);sg||p==g&&c.startSide>0&&c.endSide<=0)continue;(g-p||c.endSide-c.startSide)<0||(l<0&&(l=p),c.point&&(o=Math.max(o,g-p)),i.push(c),r.push(p-l),s.push(g-l))}return{mapped:i.length?new Pd(r,s,i,o):null,pos:l}}}class vt{constructor(e,t,i,r){this.chunkPos=e,this.chunk=t,this.nextLayer=i,this.maxPoint=r}static create(e,t,i,r){return new vt(e,t,i,r)}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:i=!1,filterFrom:r=0,filterTo:s=this.length}=e,l=e.filter;if(t.length==0&&!l)return this;if(i&&(t=t.slice().sort(RO)),this.isEmpty)return t.length?vt.of(t):this;let o=new W$(this,null,-1).goto(0),a=0,c=[],h=new ys;for(;o.value||a=0){let O=t[a++];h.addInner(O.from,O.to,O.value)||c.push(O)}else o.rangeIndex==1&&o.chunkIndexthis.chunkEnd(o.chunkIndex)||so.to||s=s&&e<=s+l.length&&l.between(s,e-s,t-s,i)===!1)return}this.nextLayer.between(e,t,i)}}iter(e=0){return Ho.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return Ho.from(e).goto(t)}static compare(e,t,i,r,s=-1){let l=e.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),o=t.filter(O=>O.maxPoint>0||!O.isEmpty&&O.maxPoint>=s),a=_m(l,o,i),c=new ko(l,a,s),h=new ko(o,a,s);i.iterGaps((O,p,g)=>km(c,O,h,p,g,r)),i.empty&&i.length==0&&km(c,0,h,0,0,r)}static eq(e,t,i=0,r){r==null&&(r=999999999);let s=e.filter(h=>!h.isEmpty&&t.indexOf(h)<0),l=t.filter(h=>!h.isEmpty&&e.indexOf(h)<0);if(s.length!=l.length)return!1;if(!s.length)return!0;let o=_m(s,l),a=new ko(s,o,0).goto(i),c=new ko(l,o,0).goto(i);for(;;){if(a.to!=c.to||!XO(a.active,c.active)||a.point&&(!c.point||!a.point.eq(c.point)))return!1;if(a.to>r)return!0;a.next(),c.next()}}static spans(e,t,i,r,s=-1){let l=new ko(e,null,s).goto(t),o=t,a=l.openStart;for(;;){let c=Math.min(l.to,i);if(l.point){let h=l.activeForPoint(l.to),O=l.pointFromo&&(r.span(o,c,l.active,a),a=l.openEnd(c));if(l.to>i)return a+(l.point&&l.to>i?1:0);o=l.to,l.next()}}static of(e,t=!1){let i=new ys;for(let r of e instanceof ZO?[e]:t?R4(e):e)i.add(r.from,r.to,r.value);return i.finish()}}vt.empty=new vt([],[],null,-1);function R4(n){if(n.length>1)for(let e=n[0],t=1;t0)return n.slice().sort(RO);e=i}return n}vt.empty.nextLayer=vt.empty;class ys{finishChunk(e){this.chunks.push(new Pd(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,i){this.addInner(e,t,i)||(this.nextLayer||(this.nextLayer=new ys)).add(e,t,i)}addInner(e,t,i){let r=e-this.lastTo||i.startSide-this.last.endSide;if(r<=0&&(e-this.lastFrom||i.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return r<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=i,this.lastFrom=e,this.lastTo=t,this.value.push(i),i.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 i=t.value.length-1;return this.last=t.value[i],this.lastFrom=t.from[i]+e,this.lastTo=t.to[i]+e,!0}finish(){return this.finishInner(vt.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),this.chunks.length==0)return e;let t=vt.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function _m(n,e,t){let i=new Map;for(let s of n)for(let l=0;l=this.minPoint)break}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=i&&r.push(new W$(l,t,i,s));return r.length==1?r[0]:new Ho(r)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let i of this.heap)i.goto(e,t);for(let i=this.heap.length>>1;i>=0;i--)Mh(this.heap,i);return this.next(),this}forward(e,t){for(let i of this.heap)i.forward(e,t);for(let i=this.heap.length>>1;i>=0;i--)Mh(this.heap,i);(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(),Mh(this.heap,0)}}}function Mh(n,e){for(let t=n[e];;){let i=(e<<1)+1;if(i>=n.length)break;let r=n[i];if(i+1=0&&(r=n[i+1],i++),t.compare(r)<0)break;n[i]=t,n[e]=r,e=i}}class ko{constructor(e,t,i){this.minPoint=i,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=Ho.from(e,t,i)}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){Cf(this.active,e),Cf(this.activeTo,e),Cf(this.activeRank,e),this.minActive=Pm(this.active,this.activeTo)}addActive(e){let t=0,{value:i,to:r,rank:s}=this.cursor;for(;t-1&&(this.activeTo[r]-this.cursor.from||this.active[r].endSide-this.cursor.startSide)<0){if(this.activeTo[r]>e){this.to=this.activeTo[r],this.endSide=this.active[r].endSide;break}this.removeActive(r),i&&Cf(i,r)}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(i),this.cursor.next();else if(t&&this.cursor.to==this.to&&this.cursor.from=0&&i[r]=0&&!(this.activeRank[i]e||this.activeTo[i]==e&&this.active[i].endSide>=this.point.endSide)&&t.push(this.active[i]);return t.reverse()}openEnd(e){let t=0;for(let i=this.activeTo.length-1;i>=0&&this.activeTo[i]>e;i--)t++;return t}}function km(n,e,t,i,r,s){n.goto(e),t.goto(i);let l=i+r,o=i,a=i-e;for(;;){let c=n.to+a-t.to||n.endSide-t.endSide,h=c<0?n.to+a:t.to,O=Math.min(h,l);if(n.point||t.point?n.point&&t.point&&(n.point==t.point||n.point.eq(t.point))&&XO(n.activeForPoint(n.to),t.activeForPoint(t.to))||s.comparePoint(o,O,n.point,t.point):O>o&&!XO(n.active,t.active)&&s.compareRange(o,O,n.active,t.active),h>l)break;o=h,c<=0&&n.next(),c>=0&&t.next()}}function XO(n,e){if(n.length!=e.length)return!1;for(let t=0;t=e;i--)n[i+1]=n[i];n[e]=t}function Pm(n,e){let t=-1,i=1e9;for(let r=0;r=e)return r;if(r==n.length)break;s+=n.charCodeAt(r)==9?t-s%t:1,r=Ei(n,r)}return i===!0?-1:n.length}const YO="ͼ",Wm=typeof Symbol>"u"?"__"+YO:Symbol.for(YO),UO=typeof Symbol>"u"?"__styleSet"+Math.floor(Math.random()*1e8):Symbol("styleSet"),xm=typeof globalThis<"u"?globalThis:typeof window<"u"?window:{};class vs{constructor(e,t){this.rules=[];let{finish:i}=t||{};function r(l){return/^@/.test(l)?[l]:l.split(/,\s*/)}function s(l,o,a,c){let h=[],O=/^@(\w+)\b/.exec(l[0]),p=O&&O[1]=="keyframes";if(O&&o==null)return a.push(l[0]+";");for(let g in o){let m=o[g];if(/&/.test(g))s(g.split(/,\s*/).map($=>l.map(y=>$.replace(/&/,y))).reduce(($,y)=>$.concat(y)),m,a);else if(m&&typeof m=="object"){if(!O)throw new RangeError("The value of a property ("+g+") should be a primitive value.");s(r(g),m,h,p)}else m!=null&&h.push(g.replace(/_.*/,"").replace(/[A-Z]/g,$=>"-"+$.toLowerCase())+": "+m+";")}(h.length||p)&&a.push((i&&!O&&!c?l.map(i):l).join(", ")+" {"+h.join(" ")+"}")}for(let l in e)s(r(l),e[l],this.rules)}getRules(){return this.rules.join(` +`)}static newName(){let e=xm[Wm]||1;return xm[Wm]=e+1,YO+e.toString(36)}static mount(e,t,i){let r=e[UO],s=i&&i.nonce;r?s&&r.setNonce(s):r=new X4(e,s),r.mount(Array.isArray(t)?t:[t])}}let Cm=new Map;class X4{constructor(e,t){let i=e.ownerDocument||e,r=i.defaultView;if(!e.head&&e.adoptedStyleSheets&&r.CSSStyleSheet){let s=Cm.get(i);if(s)return e.adoptedStyleSheets=[s.sheet,...e.adoptedStyleSheets],e[UO]=s;this.sheet=new r.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],Cm.set(i,this)}else{this.styleTag=i.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let s=e.head||e;s.insertBefore(this.styleTag,s.firstChild)}this.modules=[],e[UO]=this}mount(e){let t=this.sheet,i=0,r=0;for(let s=0;s-1&&(this.modules.splice(o,1),r--,o=-1),o==-1){if(this.modules.splice(r++,0,l),t)for(let a=0;a",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},A4=typeof navigator<"u"&&/Mac/.test(navigator.platform),Y4=typeof navigator<"u"&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);for(var _i=0;_i<10;_i++)ws[48+_i]=ws[96+_i]=String(_i);for(var _i=1;_i<=24;_i++)ws[_i+111]="F"+_i;for(var _i=65;_i<=90;_i++)ws[_i]=String.fromCharCode(_i+32),Ko[_i]=String.fromCharCode(_i);for(var Dh in ws)Ko.hasOwnProperty(Dh)||(Ko[Dh]=ws[Dh]);function U4(n){var e=A4&&n.metaKey&&n.shiftKey&&!n.ctrlKey&&!n.altKey||Y4&&n.shiftKey&&n.key&&n.key.length==1||n.key=="Unidentified",t=!e&&n.key||(n.shiftKey?Ko:ws)[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 Sc(n){let e;return n.nodeType==11?e=n.getSelection?n:n.ownerDocument:e=n,e.getSelection()}function EO(n,e){return e?n==e||n.contains(e.nodeType!=1?e.parentNode:e):!1}function E4(n){let e=n.activeElement;for(;e&&e.shadowRoot;)e=e.shadowRoot.activeElement;return e}function rc(n,e){if(!e.anchorNode)return!1;try{return EO(n,e.anchorNode)}catch{return!1}}function Jo(n){return n.nodeType==3?Hs(n,0,n.nodeValue.length).getClientRects():n.nodeType==1?n.getClientRects():[]}function bc(n,e,t,i){return t?Tm(n,e,t,i,-1)||Tm(n,e,t,i,1):!1}function ea(n){for(var e=0;;e++)if(n=n.previousSibling,!n)return e}function Tm(n,e,t,i,r){for(;;){if(n==t&&e==i)return!0;if(e==(r<0?0:Mr(n))){if(n.nodeName=="DIV")return!1;let s=n.parentNode;if(!s||s.nodeType!=1)return!1;e=ea(n)+(r<0?0:1),n=s}else if(n.nodeType==1){if(n=n.childNodes[e+(r<0?-1:0)],n.nodeType==1&&n.contentEditable=="false")return!1;e=r<0?Mr(n):0}else return!1}}function Mr(n){return n.nodeType==3?n.nodeValue.length:n.childNodes.length}function Wd(n,e){let t=e?n.left:n.right;return{left:t,right:t,top:n.top,bottom:n.bottom}}function z4(n){return{left:0,right:n.innerWidth,top:0,bottom:n.innerHeight}}function M4(n,e,t,i,r,s,l,o){let a=n.ownerDocument,c=a.defaultView||window;for(let h=n,O=!1;h&&!O;)if(h.nodeType==1){let p,g=h==a.body,m=1,$=1;if(g)p=z4(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(h).position)&&(O=!0),h.scrollHeight<=h.clientHeight&&h.scrollWidth<=h.clientWidth){h=h.assignedSlot||h.parentNode;continue}let x=h.getBoundingClientRect();m=x.width/h.offsetWidth,$=x.height/h.offsetHeight,p={left:x.left,right:x.left+h.clientWidth*m,top:x.top,bottom:x.top+h.clientHeight*$}}let y=0,_=0;if(r=="nearest")e.top0&&e.bottom>p.bottom+_&&(_=e.bottom-p.bottom+_+l)):e.bottom>p.bottom&&(_=e.bottom-p.bottom+l,t<0&&e.top-_0&&e.right>p.right+y&&(y=e.right-p.right+y+s)):e.right>p.right&&(y=e.right-p.right+s,t<0&&e.leftt.clientHeight||t.scrollWidth>t.clientWidth)return t;t=t.assignedSlot||t.parentNode}else if(t.nodeType==11)t=t.host;else break;return null}class V4{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:i}=e;this.set(t,Math.min(e.anchorOffset,t?Mr(t):0),i,Math.min(e.focusOffset,i?Mr(i):0))}set(e,t,i,r){this.anchorNode=e,this.anchorOffset=t,this.focusNode=i,this.focusOffset=r}}let ml=null;function x$(n){if(n.setActive)return n.setActive();if(ml)return n.focus(ml);let e=[];for(let t=n;t&&(e.push(t,t.scrollTop,t.scrollLeft),t!=t.ownerDocument);t=t.parentNode);if(n.focus(ml==null?{get preventScroll(){return ml={preventScroll:!0},!0}}:void 0),!ml){ml=!1;for(let t=0;tMath.max(1,n.scrollHeight-n.clientHeight-4)}class Yi{constructor(e,t,i=!0){this.node=e,this.offset=t,this.precise=i}static before(e,t){return new Yi(e.parentNode,ea(e),t)}static after(e,t){return new Yi(e.parentNode,ea(e)+1,t)}}const xd=[];class Dt{constructor(){this.parent=null,this.dom=null,this.flags=2}get overrideDOMText(){return null}get posAtStart(){return this.parent?this.parent.posBefore(this):0}get posAtEnd(){return this.posAtStart+this.length}posBefore(e){let t=this.posAtStart;for(let i of this.children){if(i==e)return t;t+=i.length+i.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(this.flags&2){let i=this.dom,r=null,s;for(let l of this.children){if(l.flags&7){if(!l.dom&&(s=r?r.nextSibling:i.firstChild)){let o=Dt.get(s);(!o||!o.parent&&o.canReuseDOM(l))&&l.reuseDOM(s)}l.sync(e,t),l.flags&=-8}if(s=r?r.nextSibling:i.firstChild,t&&!t.written&&t.node==i&&s!=l.dom&&(t.written=!0),l.dom.parentNode==i)for(;s&&s!=l.dom;)s=Rm(s);else i.insertBefore(l.dom,s);r=l.dom}for(s=r?r.nextSibling:i.firstChild,s&&t&&t.node==i&&(t.written=!0);s;)s=Rm(s)}else if(this.flags&1)for(let i of this.children)i.flags&7&&(i.sync(e,t),i.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let i;if(e==this.dom)i=this.dom.childNodes[t];else{let r=Mr(e)==0?0:t==0?-1:1;for(;;){let s=e.parentNode;if(s==this.dom)break;r==0&&s.firstChild!=s.lastChild&&(e==s.firstChild?r=-1:r=1),e=s}r<0?i=e:i=e.nextSibling}if(i==this.dom.firstChild)return 0;for(;i&&!Dt.get(i);)i=i.nextSibling;if(!i)return this.length;for(let r=0,s=0;;r++){let l=this.children[r];if(l.dom==i)return s;s+=l.length+l.breakAfter}}domBoundsAround(e,t,i=0){let r=-1,s=-1,l=-1,o=-1;for(let a=0,c=i,h=i;at)return O.domBoundsAround(e,t,c);if(p>=e&&r==-1&&(r=a,s=c),c>t&&O.dom.parentNode==this.dom){l=a,o=h;break}h=p,c=p+O.breakAfter}return{from:s,to:o<0?i+this.length:o,startDOM:(r?this.children[r-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:l=0?this.children[l].dom:null}}markDirty(e=!1){this.flags|=2,this.markParentsDirty(e)}markParentsDirty(e){for(let t=this.parent;t;t=t.parent){if(e&&(t.flags|=2),t.flags&1)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,this.flags&7&&this.markParentsDirty(!0))}setDOM(e){this.dom!=e&&(this.dom&&(this.dom.cmView=null),this.dom=e,e.cmView=this)}get rootView(){for(let e=this;;){let t=e.parent;if(!t)return e;e=t}}replaceChildren(e,t,i=xd){this.markDirty();for(let r=e;rthis.pos||e==this.pos&&(t>0||this.i==0||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let i=this.children[--this.i];this.pos-=i.length+i.breakAfter}}}function R$(n,e,t,i,r,s,l,o,a){let{children:c}=n,h=c.length?c[e]:null,O=s.length?s[s.length-1]:null,p=O?O.breakAfter:l;if(!(e==i&&h&&!l&&!p&&s.length<2&&h.merge(t,r,s.length?O:null,t==0,o,a))){if(i0&&(!l&&s.length&&h.merge(t,h.length,s[0],!1,o,0)?h.breakAfter=s.shift().breakAfter:(t2);var We={mac:Ym||/Mac/.test(dn.platform),windows:/Win/.test(dn.platform),linux:/Linux|X11/.test(dn.platform),ie:Kc,ie_version:A$?zO.documentMode||6:DO?+DO[1]:MO?+MO[1]:0,gecko:Xm,gecko_version:Xm?+(/Firefox\/(\d+)/.exec(dn.userAgent)||[0,0])[1]:0,chrome:!!Vh,chrome_version:Vh?+Vh[1]:0,ios:Ym,android:/Android\b/.test(dn.userAgent),webkit:Am,safari:Y$,webkit_version:Am?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:zO.documentElement.style.tabSize!=null?"tab-size":"-moz-tab-size"};const L4=256;class Dr extends Dt{constructor(e){super(),this.text=e}get length(){return this.text.length}createDOM(e){this.setDOM(e||document.createTextNode(this.text))}sync(e,t){this.dom||this.createDOM(),this.dom.nodeValue!=this.text&&(t&&t.node==this.dom&&(t.written=!0),this.dom.nodeValue=this.text)}reuseDOM(e){e.nodeType==3&&this.createDOM(e)}merge(e,t,i){return this.flags&8||i&&(!(i instanceof Dr)||this.length-(t-e)+i.length>L4||i.flags&8)?!1:(this.text=this.text.slice(0,e)+(i?i.text:"")+this.text.slice(t),this.markDirty(),!0)}split(e){let t=new Dr(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=this.flags&8,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Yi(this.dom,e)}domBoundsAround(e,t,i){return{from:i,to:i+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return N4(this.dom,e,t)}}class Vr extends Dt{constructor(e,t=[],i=0){super(),this.mark=e,this.children=t,this.length=i;for(let r of t)r.setParent(this)}setAttrs(e){if(C$(e),this.mark.class&&(e.className=this.mark.class),this.mark.attrs)for(let t in this.mark.attrs)e.setAttribute(t,this.mark.attrs[t]);return e}canReuseDOM(e){return super.canReuseDOM(e)&&!((this.flags|e.flags)&8)}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?this.flags&4&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,i,r,s,l){return i&&(!(i instanceof Vr&&i.mark.eq(this.mark))||e&&s<=0||te&&t.push(i=e&&(r=s),i=a,s++}let l=this.length-e;return this.length=e,r>-1&&(this.children.length=r,this.markDirty()),new Vr(this.mark,t,l)}domAtPos(e){return U$(this,e)}coordsAt(e,t){return z$(this,e,t)}}function N4(n,e,t){let i=n.nodeValue.length;e>i&&(e=i);let r=e,s=e,l=0;e==0&&t<0||e==i&&t>=0?We.chrome||We.gecko||(e?(r--,l=1):s=0)?0:o.length-1];return We.safari&&!l&&a.width==0&&(a=Array.prototype.find.call(o,c=>c.width)||a),l?Wd(a,l<0):a||null}class ps extends Dt{static create(e,t,i){return new ps(e,t,i)}constructor(e,t,i){super(),this.widget=e,this.length=t,this.side=i,this.prevWidget=null}split(e){let t=ps.create(this.widget,this.length-e,this.side);return this.length-=e,t}sync(e){(!this.dom||!this.widget.updateDOM(this.dom,e))&&(this.dom&&this.prevWidget&&this.prevWidget.destroy(this.dom),this.prevWidget=null,this.setDOM(this.widget.toDOM(e)),this.dom.contentEditable="false")}getSide(){return this.side}merge(e,t,i,r,s,l){return i&&(!(i instanceof ps)||!this.widget.compare(i.widget)||e>0&&s<=0||t0)?Yi.before(this.dom):Yi.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let i=this.widget.coordsAt(this.dom,e,t);if(i)return i;let r=this.dom.getClientRects(),s=null;if(!r.length)return null;let l=this.side?this.side<0:e>0;for(let o=l?r.length-1:0;s=r[o],!(e>0?o==0:o==r.length-1||s.top0?Yi.before(this.dom):Yi.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return mt.empty}get isHidden(){return!0}}Dr.prototype.children=ps.prototype.children=Ul.prototype.children=xd;function U$(n,e){let t=n.dom,{children:i}=n,r=0;for(let s=0;rs&&e0;s--){let l=i[s-1];if(l.dom.parentNode==t)return l.domAtPos(l.length)}for(let s=r;s0&&e instanceof Vr&&r.length&&(i=r[r.length-1])instanceof Vr&&i.mark.eq(e.mark)?E$(i,e.children[0],t-1):(r.push(e),e.setParent(n)),n.length+=e.length}function z$(n,e,t){let i=null,r=-1,s=null,l=-1;function o(c,h){for(let O=0,p=0;O=h&&(g.children.length?o(g,h-p):(!s||s.isHidden&&t>0)&&(m>h||p==m&&g.getSide()>0)?(s=g,l=h-p):(p-1?1:0)!=r.length-(t&&r.indexOf(t)>-1?1:0))return!1;for(let s of i)if(s!=t&&(r.indexOf(s)==-1||n[s]!==e[s]))return!1;return!0}function qO(n,e,t){let i=!1;if(e)for(let r in e)t&&r in t||(i=!0,r=="style"?n.style.cssText="":n.removeAttribute(r));if(t)for(let r in t)e&&e[r]==t[r]||(i=!0,r=="style"?n.style.cssText=t[r]:n.setAttribute(r,t[r]));return i}function B4(n){let e=Object.create(null);for(let t=0;t0&&this.children[i-1].length==0;)this.children[--i].destroy();return this.children.length=i,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=this.prevAttrs===void 0?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){Cd(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){E$(this,e,t)}addLineDeco(e){let t=e.spec.attributes,i=e.spec.class;t&&(this.attrs=VO(t,this.attrs||{})),i&&(this.attrs=VO({class:i},this.attrs||{}))}domAtPos(e){return U$(this,e)}reuseDOM(e){e.nodeName=="DIV"&&(this.setDOM(e),this.flags|=6)}sync(e,t){var i;this.dom?this.flags&4&&(C$(this.dom),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0):(this.setDOM(document.createElement("div")),this.dom.className="cm-line",this.prevAttrs=this.attrs?null:void 0),this.prevAttrs!==void 0&&(qO(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let r=this.dom.lastChild;for(;r&&Dt.get(r)instanceof Vr;)r=r.lastChild;if(!r||!this.length||r.nodeName!="BR"&&((i=Dt.get(r))===null||i===void 0?void 0:i.isEditable)==!1&&(!We.ios||!this.children.some(s=>s instanceof Dr))){let s=document.createElement("BR");s.cmIgnore=!0,this.dom.appendChild(s)}}measureTextSize(){if(this.children.length==0||this.length>20)return null;let e=0,t;for(let i of this.children){if(!(i instanceof Dr)||/[^ -~]/.test(i.text))return null;let r=Jo(i.dom);if(r.length!=1)return null;e+=r[0].width,t=r[0].height}return e?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:e/this.length,textHeight:t}:null}coordsAt(e,t){let i=z$(this,e,t);if(!this.children.length&&i&&this.parent){let{heightOracle:r}=this.parent.view.viewState,s=i.bottom-i.top;if(Math.abs(s-r.lineHeight)<2&&r.textHeight=t){if(s instanceof ci)return s;if(l>t)break}r=l+s.breakAfter}return null}}class Ss extends Dt{constructor(e,t,i){super(),this.widget=e,this.length=t,this.deco=i,this.breakAfter=0,this.prevWidget=null}merge(e,t,i,r,s,l){return i&&(!(i instanceof Ss)||!this.widget.compare(i.widget)||e>0&&s<=0||t0}}class Lr{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,i){return null}get isHidden(){return!1}destroy(e){}}var Ii=function(n){return n[n.Text=0]="Text",n[n.WidgetBefore=1]="WidgetBefore",n[n.WidgetAfter=2]="WidgetAfter",n[n.WidgetRange=3]="WidgetRange",n}(Ii||(Ii={}));class Ye extends Gs{constructor(e,t,i,r){super(),this.startSide=e,this.endSide=t,this.widget=i,this.spec=r}get heightRelevant(){return!1}static mark(e){return new da(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),i=!!e.block;return t+=i&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new Qs(e,t,t,i,e.widget||null,!1)}static replace(e){let t=!!e.block,i,r;if(e.isBlockGap)i=-5e8,r=4e8;else{let{start:s,end:l}=M$(e,t);i=(s?t?-3e8:-1:5e8)-1,r=(l?t?2e8:1:-6e8)+1}return new Qs(e,i,r,t,e.widget||null,!0)}static line(e){return new pa(e)}static set(e,t=!1){return vt.of(e,t)}hasHeight(){return this.widget?this.widget.estimatedHeight>-1:!1}}Ye.none=vt.empty;class da extends Ye{constructor(e){let{start:t,end:i}=M$(e);super(t?-1:5e8,i?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,i;return this==e||e instanceof da&&this.tagName==e.tagName&&(this.class||((t=this.attrs)===null||t===void 0?void 0:t.class))==(e.class||((i=e.attrs)===null||i===void 0?void 0:i.class))&&Cd(this.attrs,e.attrs,"class")}range(e,t=e){if(e>=t)throw new RangeError("Mark decorations may not be empty");return super.range(e,t)}}da.prototype.point=!1;class pa extends Ye{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof pa&&this.spec.class==e.spec.class&&Cd(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)}}pa.prototype.mapMode=ki.TrackBefore;pa.prototype.point=!0;class Qs extends Ye{constructor(e,t,i,r,s,l){super(t,i,s,e),this.block=r,this.isReplace=l,this.mapMode=r?t<=0?ki.TrackBefore:ki.TrackAfter:ki.TrackDel}get type(){return this.startSide!=this.endSide?Ii.WidgetRange:this.startSide<=0?Ii.WidgetBefore:Ii.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof Qs&&F4(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)}}Qs.prototype.point=!0;function M$(n,e=!1){let{inclusiveStart:t,inclusiveEnd:i}=n;return t==null&&(t=n.inclusive),i==null&&(i=n.inclusive),{start:t??e,end:i??e}}function F4(n,e){return n==e||!!(n&&e&&n.compare(e))}function IO(n,e,t,i=0){let r=t.length-1;r>=0&&t[r]+i>=n?t[r]=Math.max(t[r],e):t.push(n,e)}class No{constructor(e,t,i,r){this.doc=e,this.pos=t,this.end=i,this.disallowBlockEffectsFor=r,this.content=[],this.curLine=null,this.breakAtStart=0,this.pendingBuffer=0,this.bufferMarks=[],this.atCursorPos=!0,this.openStart=-1,this.openEnd=-1,this.text="",this.textOff=0,this.cursor=e.iter(),this.skip=t}posCovered(){if(this.content.length==0)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof Ss&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new ci),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(Zf(new Ul(-1),e),e.length),this.pendingBuffer=0)}addBlockWidget(e){this.flushBuffer(),this.curLine=null,this.content.push(e)}finish(e){this.pendingBuffer&&e<=this.bufferMarks.length?this.flushBuffer():this.pendingBuffer=0,!this.posCovered()&&!(e&&this.content.length&&this.content[this.content.length-1]instanceof Ss)&&this.getLine()}buildText(e,t,i){for(;e>0;){if(this.textOff==this.text.length){let{value:s,lineBreak:l,done:o}=this.cursor.next(this.skip);if(this.skip=0,o)throw new Error("Ran out of text content when drawing inline views");if(l){this.posCovered()||this.getLine(),this.content.length?this.content[this.content.length-1].breakAfter=1:this.breakAtStart=1,this.flushBuffer(),this.curLine=null,this.atCursorPos=!0,e--;continue}else this.text=s,this.textOff=0}let r=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-i)),this.getLine().append(Zf(new Dr(this.text.slice(this.textOff,this.textOff+r)),t),i),this.atCursorPos=!0,this.textOff+=r,e-=r,i=0}}span(e,t,i,r){this.buildText(t-e,i,r),this.pos=t,this.openStart<0&&(this.openStart=r)}point(e,t,i,r,s,l){if(this.disallowBlockEffectsFor[l]&&i instanceof Qs){if(i.block)throw new RangeError("Block decorations may not be specified via plugins");if(t>this.doc.lineAt(this.pos).to)throw new RangeError("Decorations that replace line breaks may not be specified via plugins")}let o=t-e;if(i instanceof Qs)if(i.block)i.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new Ss(i.widget||new Em("div"),o,i));else{let a=ps.create(i.widget||new Em("span"),o,o?0:i.startSide),c=this.atCursorPos&&!a.isEditable&&s<=r.length&&(e0),h=!a.isEditable&&(er.length||i.startSide<=0),O=this.getLine();this.pendingBuffer==2&&!c&&!a.isEditable&&(this.pendingBuffer=0),this.flushBuffer(r),c&&(O.append(Zf(new Ul(1),r),s),s=r.length+Math.max(0,s-r.length)),O.append(Zf(a,r),s),this.atCursorPos=h,this.pendingBuffer=h?er.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=r.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(i);o&&(this.textOff+o<=this.text.length?this.textOff+=o:(this.skip+=o-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=s)}static build(e,t,i,r,s){let l=new No(e,t,i,s);return l.openEnd=vt.spans(r,t,i,l),l.openStart<0&&(l.openStart=l.openEnd),l.finish(l.openEnd),l}}function Zf(n,e){for(let t of e)n=new Vr(t,[n],n.length);return n}class Em extends Lr{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}}const D$=_e.define(),V$=_e.define(),q$=_e.define(),I$=_e.define(),LO=_e.define(),L$=_e.define(),N$=_e.define(),j$=_e.define({combine:n=>n.some(e=>e)}),B$=_e.define({combine:n=>n.some(e=>e)});class Tl{constructor(e,t="nearest",i="nearest",r=5,s=5,l=!1){this.range=e,this.y=t,this.x=i,this.yMargin=r,this.xMargin=s,this.isSnapshot=l}map(e){return e.empty?this:new Tl(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 Tl(ee.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Rf=Ne.define({map:(n,e)=>n.map(e)});function An(n,e,t){let i=n.facet(I$);i.length?i[0](e):window.onerror?window.onerror(String(e),t,void 0,void 0,e):t?console.error(t+":",e):console.error(e)}const Jc=_e.define({combine:n=>n.length?n[0]:!0});let G4=0;const Ao=_e.define();class li{constructor(e,t,i,r,s){this.id=e,this.create=t,this.domEventHandlers=i,this.domEventObservers=r,this.extension=s(this)}static define(e,t){const{eventHandlers:i,eventObservers:r,provide:s,decorations:l}=t||{};return new li(G4++,e,i,r,o=>{let a=[Ao.of(o)];return l&&a.push(ta.of(c=>{let h=c.plugin(o);return h?l(h):Ye.none})),s&&a.push(s(o)),a})}static fromClass(e,t){return li.define(i=>new e(i),t)}}class qh{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}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(i){if(An(t.state,i,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch{}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(t){An(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(i){An(e.state,i,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const F$=_e.define(),Td=_e.define(),ta=_e.define(),Zd=_e.define(),G$=_e.define();function zm(n,e,t){let i=n.state.facet(G$);if(!i.length)return i;let r=i.map(l=>l instanceof Function?l(n):l),s=[];return vt.spans(r,e,t,{point(){},span(l,o,a,c){let h=s;for(let O=a.length-1;O>=0;O--,c--){let p=a[O].spec.bidiIsolate,g;if(p!=null)if(c>0&&h.length&&(g=h[h.length-1]).to==l&&g.direction==p)g.to=o,h=g.inner;else{let m={from:l,to:o,direction:p,inner:[]};h.push(m),h=m.inner}}}}),s}const H$=_e.define();function K$(n){let e=0,t=0,i=0,r=0;for(let s of n.state.facet(H$)){let l=s(n);l&&(l.left!=null&&(e=Math.max(e,l.left)),l.right!=null&&(t=Math.max(t,l.right)),l.top!=null&&(i=Math.max(i,l.top)),l.bottom!=null&&(r=Math.max(r,l.bottom)))}return{left:e,right:t,top:i,bottom:r}}const Yo=_e.define();class Yn{constructor(e,t,i,r){this.fromA=e,this.toA=t,this.fromB=i,this.toB=r}join(e){return new Yn(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,i=this;for(;t>0;t--){let r=e[t-1];if(!(r.fromA>i.toA)){if(r.toAh)break;s+=2}if(!a)return i;new Yn(a.fromA,a.toA,a.fromB,a.toB).addToSet(i),l=a.toA,o=a.toB}}}class $c{constructor(e,t,i){this.view=e,this.state=t,this.transactions=i,this.flags=0,this.startState=e.state,this.changes=ui.empty(this.startState.doc.length);for(let s of i)this.changes=this.changes.compose(s.changes);let r=[];this.changes.iterChangedRanges((s,l,o,a)=>r.push(new Yn(s,l,o,a))),this.changedRanges=r}static create(e,t,i){return new $c(e,t,i)}get viewportChanged(){return(this.flags&4)>0}get heightChanged(){return(this.flags&2)>0}get geometryChanged(){return this.docChanged||(this.flags&10)>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}}var jt=function(n){return n[n.LTR=0]="LTR",n[n.RTL=1]="RTL",n}(jt||(jt={}));const ia=jt.LTR,J$=jt.RTL;function ey(n){let e=[];for(let t=0;t=t){if(o.level==i)return l;(s<0||(r!=0?r<0?o.fromt:e[s].level>o.level))&&(s=l)}}if(s<0)throw new RangeError("Index out of range");return s}}function ty(n,e){if(n.length!=e.length)return!1;for(let t=0;t=0;$-=3)if(or[$+1]==-g){let y=or[$+2],_=y&2?r:y&4?y&1?s:r:0;_&&(Xt[O]=Xt[or[$]]=_),o=$;break}}else{if(or.length==189)break;or[o++]=O,or[o++]=p,or[o++]=a}else if((m=Xt[O])==2||m==1){let $=m==r;a=$?0:1;for(let y=o-3;y>=0;y-=3){let _=or[y+2];if(_&2)break;if($)or[y+2]|=2;else{if(_&4)break;or[y+2]|=4}}}}}function n5(n,e,t,i){for(let r=0,s=i;r<=t.length;r++){let l=r?t[r-1].to:n,o=ra;)m==y&&(m=t[--$].from,y=$?t[$-1].to:n),Xt[--m]=g;a=h}else s=c,a++}}}function jO(n,e,t,i,r,s,l){let o=i%2?2:1;if(i%2==r%2)for(let a=e,c=0;aa&&l.push(new gs(a,$.from,g));let y=$.direction==ia!=!(g%2);BO(n,y?i+1:i,r,$.inner,$.from,$.to,l),a=$.to}m=$.to}else{if(m==t||(h?Xt[m]!=o:Xt[m]==o))break;m++}p?jO(n,a,m,i+1,r,p,l):ae;){let h=!0,O=!1;if(!c||a>s[c-1].to){let $=Xt[a-1];$!=o&&(h=!1,O=$==16)}let p=!h&&o==1?[]:null,g=h?i:i+1,m=a;e:for(;;)if(c&&m==s[c-1].to){if(O)break e;let $=s[--c];if(!h)for(let y=$.from,_=c;;){if(y==e)break e;if(_&&s[_-1].to==y)y=s[--_].from;else{if(Xt[y-1]==o)break e;break}}if(p)p.push($);else{$.toXt.length;)Xt[Xt.length]=256;let i=[],r=e==ia?0:1;return BO(n,r,r,t,0,n.length,i),i}function iy(n){return[new gs(0,n,0)]}let ny="";function s5(n,e,t,i,r){var s;let l=i.head-n.from,o=-1;if(l==0){if(!r||!n.length)return null;e[0].level!=t&&(l=e[0].side(!1,t),o=0)}else if(l==n.length){if(r)return null;let p=e[e.length-1];p.level!=t&&(l=p.side(!0,t),o=e.length-1)}o<0&&(o=gs.find(e,l,(s=i.bidiLevel)!==null&&s!==void 0?s:-1,i.assoc));let a=e[o];l==a.side(r,t)&&(a=e[o+=r?1:-1],l=a.side(!r,t));let c=r==(a.dir==t),h=Ei(n.text,l,c);if(ny=n.text.slice(Math.min(l,h),Math.max(l,h)),h!=a.side(r,t))return ee.cursor(h+n.from,c?-1:1,a.level);let O=o==(r?e.length-1:0)?null:e[o+(r?1:-1)];return!O&&a.level!=t?ee.cursor(r?n.to:n.from,r?-1:1,t):O&&O.level0&&i.length&&(i.every(({fromA:c,toA:h})=>hthis.minWidthTo)?(this.minWidthFrom=e.changes.mapPos(this.minWidthFrom,1),this.minWidthTo=e.changes.mapPos(this.minWidthTo,1)):this.minWidth=this.minWidthFrom=this.minWidthTo=0);let r=-1;this.view.inputState.composing>=0&&(!((t=this.domChanged)===null||t===void 0)&&t.newSel?r=this.domChanged.newSel.head:!h5(e.changes,this.hasComposition)&&!e.selectionSet&&(r=e.state.selection.main.head));let s=r>-1?o5(this.view,e.changes,r):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:c,to:h}=this.hasComposition;i=new Yn(c,h,e.changes.mapPos(c,-1),e.changes.mapPos(h,1)).addToSet(i.slice())}this.hasComposition=s?{from:s.range.fromB,to:s.range.toB}:null,(We.ie||We.chrome)&&!s&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let l=this.decorations,o=this.updateDeco(),a=c5(l,o,e.changes);return i=Yn.extendWithRanges(i,a),!(this.flags&7)&&i.length==0?!1:(this.updateInner(i,e.startState.doc.length,s),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,i){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,i);let{observer:r}=this.view;r.ignore(()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let l=We.chrome||We.ios?{node:r.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,l),this.flags&=-8,l&&(l.written||r.selectionRange.focusNode!=l.node)&&(this.forceSelection=!0),this.dom.style.height=""}),this.markedForComposition.forEach(l=>l.flags&=-9);let s=[];if(this.view.viewport.from||this.view.viewport.to=0?r[l]:null;if(!o)break;let{fromA:a,toA:c,fromB:h,toB:O}=o,p,g,m,$;if(i&&i.range.fromBh){let A=No.build(this.view.state.doc,h,i.range.fromB,this.decorations,this.dynamicDecorationMap),C=No.build(this.view.state.doc,i.range.toB,O,this.decorations,this.dynamicDecorationMap);g=A.breakAtStart,m=A.openStart,$=C.openEnd;let z=this.compositionView(i);C.breakAtStart?z.breakAfter=1:C.content.length&&z.merge(z.length,z.length,C.content[0],!1,C.openStart,0)&&(z.breakAfter=C.content[0].breakAfter,C.content.shift()),A.content.length&&z.merge(0,0,A.content[A.content.length-1],!0,0,A.openEnd)&&A.content.pop(),p=A.content.concat(z).concat(C.content)}else({content:p,breakAtStart:g,openStart:m,openEnd:$}=No.build(this.view.state.doc,h,O,this.decorations,this.dynamicDecorationMap));let{i:y,off:_}=s.findPos(c,1),{i:x,off:R}=s.findPos(a,-1);R$(this,x,R,y,_,p,g,m,$)}i&&this.fixCompositionDOM(i)}compositionView(e){let t=new Dr(e.text.nodeValue);t.flags|=8;for(let{deco:r}of e.marks)t=new Vr(r,[t],t.length);let i=new ci;return i.append(t,0),i}fixCompositionDOM(e){let t=(s,l)=>{l.flags|=8|(l.children.some(a=>a.flags&7)?1:0),this.markedForComposition.add(l);let o=Dt.get(s);o&&o!=l&&(o.dom=null),l.setDOM(s)},i=this.childPos(e.range.fromB,1),r=this.children[i.i];t(e.line,r);for(let s=e.marks.length-1;s>=-1;s--)i=r.childPos(i.off,1),r=r.children[i.i],t(s>=0?e.marks[s].node:e.text,r)}updateSelection(e=!1,t=!1){(e||!this.view.observer.selectionRange.focusNode)&&this.view.observer.readSelectionRange();let i=this.view.root.activeElement,r=i==this.dom,s=!r&&rc(this.dom,this.view.observer.selectionRange)&&!(i&&this.dom.contains(i));if(!(r||t||s))return;let l=this.forceSelection;this.forceSelection=!1;let o=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(o.anchor)),c=o.empty?a:this.moveToLine(this.domAtPos(o.head));if(We.gecko&&o.empty&&!this.hasComposition&&l5(a)){let O=document.createTextNode("");this.view.observer.ignore(()=>a.node.insertBefore(O,a.node.childNodes[a.offset]||null)),a=c=new Yi(O,0),l=!0}let h=this.view.observer.selectionRange;(l||!h.focusNode||!bc(a.node,a.offset,h.anchorNode,h.anchorOffset)||!bc(c.node,c.offset,h.focusNode,h.focusOffset))&&(this.view.observer.ignore(()=>{We.android&&We.chrome&&this.dom.contains(h.focusNode)&&u5(h.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let O=Sc(this.view.root);if(O)if(o.empty){if(We.gecko){let p=a5(a.node,a.offset);if(p&&p!=3){let g=sy(a.node,a.offset,p==1?1:-1);g&&(a=new Yi(g.node,g.offset))}}O.collapse(a.node,a.offset),o.bidiLevel!=null&&O.caretBidiLevel!==void 0&&(O.caretBidiLevel=o.bidiLevel)}else if(O.extend){O.collapse(a.node,a.offset);try{O.extend(c.node,c.offset)}catch{}}else{let p=document.createRange();o.anchor>o.head&&([a,c]=[c,a]),p.setEnd(c.node,c.offset),p.setStart(a.node,a.offset),O.removeAllRanges(),O.addRange(p)}s&&this.view.root.activeElement==this.dom&&(this.dom.blur(),i&&i.focus())}),this.view.observer.setSelectionRange(a,c)),this.impreciseAnchor=a.precise?null:new Yi(h.anchorNode,h.anchorOffset),this.impreciseHead=c.precise?null:new Yi(h.focusNode,h.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,i=Sc(e.root),{anchorNode:r,anchorOffset:s}=e.observer.selectionRange;if(!i||!t.empty||!t.assoc||!i.modify)return;let l=ci.find(this,t.head);if(!l)return;let o=l.posAtStart;if(t.head==o||t.head==o+l.length)return;let a=this.coordsAt(t.head,-1),c=this.coordsAt(t.head,1);if(!a||!c||a.bottom>c.top)return;let h=this.domAtPos(t.head+t.assoc);i.collapse(h.node,h.offset),i.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let O=e.observer.selectionRange;e.docView.posFromDOM(O.anchorNode,O.anchorOffset)!=t.from&&i.collapse(r,s)}moveToLine(e){let t=this.dom,i;if(e.node!=t)return e;for(let r=e.offset;!i&&r=0;r--){let s=Dt.get(t.childNodes[r]);s instanceof ci&&(i=s.domAtPos(s.length))}return i?new Yi(i.node,i.offset,!0):e}nearest(e){for(let t=e;t;){let i=Dt.get(t);if(i&&i.rootView==this)return i;t=t.parentNode}return null}posFromDOM(e,t){let i=this.nearest(e);if(!i)throw new RangeError("Trying to find position for a DOM position outside of the document");return i.localPosFromDOM(e,t)+i.posAtStart}domAtPos(e){let{i:t,off:i}=this.childCursor().findPos(e,-1);for(;t=0;l--){let o=this.children[l],a=s-o.breakAfter,c=a-o.length;if(ae||o.covers(1))&&(!i||o instanceof ci&&!(i instanceof ci&&t>=0))&&(i=o,r=c),s=c}return i?i.coordsAt(e-r,t):null}coordsForChar(e){let{i:t,off:i}=this.childPos(e,1),r=this.children[t];if(!(r instanceof ci))return null;for(;r.children.length;){let{i:o,off:a}=r.childPos(i,1);for(;;o++){if(o==r.children.length)return null;if((r=r.children[o]).length)break}i=a}if(!(r instanceof Dr))return null;let s=Ei(r.text,i);if(s==i)return null;let l=Hs(r.dom,i,s).getClientRects();for(let o=0;oMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,o=-1,a=this.view.textDirection==jt.LTR;for(let c=0,h=0;hr)break;if(c>=i){let g=O.dom.getBoundingClientRect();if(t.push(g.height),l){let m=O.dom.lastChild,$=m?Jo(m):[];if($.length){let y=$[$.length-1],_=a?y.right-g.left:g.right-y.left;_>o&&(o=_,this.minWidth=s,this.minWidthFrom=c,this.minWidthTo=p)}}}c=p+O.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return getComputedStyle(this.children[t].dom).direction=="rtl"?jt.RTL:jt.LTR}measureTextSize(){for(let s of this.children)if(s instanceof ci){let l=s.measureTextSize();if(l)return l}let e=document.createElement("div"),t,i,r;return e.className="cm-line",e.style.width="99999px",e.style.position="absolute",e.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore(()=>{this.dom.appendChild(e);let s=Jo(e.firstChild)[0];t=e.getBoundingClientRect().height,i=s?s.width/27:7,r=s?s.height:t,e.remove()}),{lineHeight:t,charWidth:i,textHeight:r}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new Z$(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let i=0,r=0;;r++){let s=r==t.viewports.length?null:t.viewports[r],l=s?s.from-1:this.length;if(l>i){let o=(t.lineBlockAt(l).bottom-t.lineBlockAt(i).top)/this.view.scaleY;e.push(Ye.replace({widget:new Dm(o),block:!0,inclusive:!0,isBlockGap:!0}).range(i,l))}if(!s)break;i=s.to+1}return Ye.set(e)}updateDeco(){let e=this.view.state.facet(ta).map((t,i)=>(this.dynamicDecorationMap[i]=typeof t=="function")?t(this.view):t);for(let t=e.length;tt.anchor?-1:1),r;if(!i)return;!t.empty&&(r=this.coordsAt(t.anchor,t.anchor>t.head?-1:1))&&(i={left:Math.min(i.left,r.left),top:Math.min(i.top,r.top),right:Math.max(i.right,r.right),bottom:Math.max(i.bottom,r.bottom)});let s=K$(this.view),l={left:i.left-s.left,top:i.top-s.top,right:i.right+s.right,bottom:i.bottom+s.bottom},{offsetWidth:o,offsetHeight:a}=this.view.scrollDOM;M4(this.view.scrollDOM,l,t.head0)i=i.childNodes[r-1],r=Mr(i);else break}if(t>=0)for(let i=n,r=e;;){if(i.nodeType==3)return{node:i,offset:r};if(i.nodeType==1&&r=0)i=i.childNodes[r],r=0;else break}return null}function a5(n,e){return n.nodeType!=1?0:(e&&n.childNodes[e-1].contentEditable=="false"?1:0)|(e{ie.from&&(t=!0)}),t}function O5(n,e,t=1){let i=n.charCategorizer(e),r=n.doc.lineAt(e),s=e-r.from;if(r.length==0)return ee.cursor(e);s==0?t=1:s==r.length&&(t=-1);let l=s,o=s;t<0?l=Ei(r.text,s,!1):o=Ei(r.text,s);let a=i(r.text.slice(l,o));for(;l>0;){let c=Ei(r.text,l,!1);if(i(r.text.slice(c,l))!=a)break;l=c}for(;on?e.left-n:Math.max(0,n-e.right)}function p5(n,e){return e.top>n?e.top-n:Math.max(0,n-e.bottom)}function Ih(n,e){return n.tope.top+1}function Vm(n,e){return en.bottom?{top:n.top,left:n.left,right:n.right,bottom:e}:n}function FO(n,e,t){let i,r,s,l,o=!1,a,c,h,O;for(let m=n.firstChild;m;m=m.nextSibling){let $=Jo(m);for(let y=0;y<$.length;y++){let _=$[y];r&&Ih(r,_)&&(_=Vm(qm(_,r.bottom),r.top));let x=d5(e,_),R=p5(t,_);if(x==0&&R==0)return m.nodeType==3?Im(m,e,t):FO(m,e,t);if(!i||l>R||l==R&&s>x){i=m,r=_,s=x,l=R;let A=R?t<_.top?-1:1:x?e<_.left?-1:1:0;o=!A||(A>0?y<$.length-1:y>0)}x==0?t>_.bottom&&(!h||h.bottom<_.bottom)?(a=m,h=_):t<_.top&&(!O||O.top>_.top)&&(c=m,O=_):h&&Ih(h,_)?h=qm(h,_.bottom):O&&Ih(O,_)&&(O=Vm(O,_.top))}}if(h&&h.bottom>=t?(i=a,r=h):O&&O.top<=t&&(i=c,r=O),!i)return{node:n,offset:0};let p=Math.max(r.left,Math.min(r.right,e));if(i.nodeType==3)return Im(i,p,t);if(o&&i.contentEditable!="false")return FO(i,p,t);let g=Array.prototype.indexOf.call(n.childNodes,i)+(e>=(r.left+r.right)/2?1:0);return{node:n,offset:g}}function Im(n,e,t){let i=n.nodeValue.length,r=-1,s=1e9,l=0;for(let o=0;ot?h.top-t:t-h.bottom)-1;if(h.left-1<=e&&h.right+1>=e&&O=(h.left+h.right)/2,g=p;if((We.chrome||We.gecko)&&Hs(n,o).getBoundingClientRect().left==h.right&&(g=!p),O<=0)return{node:n,offset:o+(g?1:0)};r=o+(g?1:0),s=O}}}return{node:n,offset:r>-1?r:l>0?n.nodeValue.length:0}}function ly(n,e,t,i=-1){var r,s;let l=n.contentDOM.getBoundingClientRect(),o=l.top+n.viewState.paddingTop,a,{docHeight:c}=n.viewState,{x:h,y:O}=e,p=O-o;if(p<0)return 0;if(p>c)return n.state.doc.length;for(let A=n.viewState.heightOracle.textHeight/2,C=!1;a=n.elementAtHeight(p),a.type!=Ii.Text;)for(;p=i>0?a.bottom+A:a.top-A,!(p>=0&&p<=c);){if(C)return t?null:0;C=!0,i=-i}O=o+p;let g=a.from;if(gn.viewport.to)return n.viewport.to==n.state.doc.length?n.state.doc.length:t?null:Lm(n,l,a,h,O);let m=n.dom.ownerDocument,$=n.root.elementFromPoint?n.root:m,y=$.elementFromPoint(h,O);y&&!n.contentDOM.contains(y)&&(y=null),y||(h=Math.max(l.left+1,Math.min(l.right-1,h)),y=$.elementFromPoint(h,O),y&&!n.contentDOM.contains(y)&&(y=null));let _,x=-1;if(y&&((r=n.docView.nearest(y))===null||r===void 0?void 0:r.isEditable)!=!1){if(m.caretPositionFromPoint){let A=m.caretPositionFromPoint(h,O);A&&({offsetNode:_,offset:x}=A)}else if(m.caretRangeFromPoint){let A=m.caretRangeFromPoint(h,O);A&&({startContainer:_,startOffset:x}=A,(!n.contentDOM.contains(_)||We.safari&&g5(_,x,h)||We.chrome&&m5(_,x,h))&&(_=void 0))}}if(!_||!n.docView.dom.contains(_)){let A=ci.find(n.docView,g);if(!A)return p>a.top+a.height/2?a.to:a.from;({node:_,offset:x}=FO(A.dom,h,O))}let R=n.docView.nearest(_);if(!R)return null;if(R.isWidget&&((s=R.dom)===null||s===void 0?void 0:s.nodeType)==1){let A=R.dom.getBoundingClientRect();return e.yn.defaultLineHeight*1.5){let o=n.viewState.heightOracle.textHeight,a=Math.floor((r-t.top-(n.defaultLineHeight-o)*.5)/o);s+=a*n.viewState.heightOracle.lineLength}let l=n.state.sliceDoc(t.from,t.to);return t.from+AO(l,s,n.state.tabSize)}function g5(n,e,t){let i;if(n.nodeType!=3||e!=(i=n.nodeValue.length))return!1;for(let r=n.nextSibling;r;r=r.nextSibling)if(r.nodeType!=1||r.nodeName!="BR")return!1;return Hs(n,i-1,i).getBoundingClientRect().left>t}function m5(n,e,t){if(e!=0)return!1;for(let r=n;;){let s=r.parentNode;if(!s||s.nodeType!=1||s.firstChild!=r)return!1;if(s.classList.contains("cm-line"))break;r=s}let i=n.nodeType==1?n.getBoundingClientRect():Hs(n,0,Math.max(n.nodeValue.length,1)).getBoundingClientRect();return t-i.left>5}function GO(n,e){let t=n.lineBlockAt(e);if(Array.isArray(t.type)){for(let i of t.type)if(i.to>e||i.to==e&&(i.to==t.to||i.type==Ii.Text))return i}return t}function S5(n,e,t,i){let r=GO(n,e.head),s=!i||r.type!=Ii.Text||!(n.lineWrapping||r.widgetLineBreaks)?null:n.coordsAtPos(e.assoc<0&&e.head>r.from?e.head-1:e.head);if(s){let l=n.dom.getBoundingClientRect(),o=n.textDirectionAt(r.from),a=n.posAtCoords({x:t==(o==jt.LTR)?l.right-1:l.left+1,y:(s.top+s.bottom)/2});if(a!=null)return ee.cursor(a,t?-1:1)}return ee.cursor(t?r.to:r.from,t?-1:1)}function Nm(n,e,t,i){let r=n.state.doc.lineAt(e.head),s=n.bidiSpans(r),l=n.textDirectionAt(r.from);for(let o=e,a=null;;){let c=s5(r,s,l,o,t),h=ny;if(!c){if(r.number==(t?n.state.doc.lines:1))return o;h=` +`,r=n.state.doc.line(r.number+(t?1:-1)),s=n.bidiSpans(r),c=ee.cursor(t?r.from:r.to)}if(a){if(!a(h))return o}else{if(!i)return c;a=i(h)}o=c}}function b5(n,e,t){let i=n.state.charCategorizer(e),r=i(t);return s=>{let l=i(s);return r==Lt.Space&&(r=l),r==l}}function $5(n,e,t,i){let r=e.head,s=t?1:-1;if(r==(t?n.state.doc.length:0))return ee.cursor(r,e.assoc);let l=e.goalColumn,o,a=n.contentDOM.getBoundingClientRect(),c=n.coordsAtPos(r,e.assoc||-1),h=n.documentTop;if(c)l==null&&(l=c.left-a.left),o=s<0?c.top:c.bottom;else{let g=n.viewState.lineBlockAt(r);l==null&&(l=Math.min(a.right-a.left,n.defaultCharacterWidth*(r-g.from))),o=(s<0?g.top:g.bottom)+h}let O=a.left+l,p=i??n.viewState.heightOracle.textHeight>>1;for(let g=0;;g+=10){let m=o+(p+g)*s,$=ly(n,{x:O,y:m},!1,s);if(ma.bottom||(s<0?$r)){let y=n.docView.coordsForChar($),_=!y||m{if(e>s&&er(n)),t.from,e.head>t.from?-1:1);return i==t.from?t:ee.cursor(i,inull),We.gecko&&U5(e.contentDOM.ownerDocument)}handleEvent(e){!x5(this.view,e)||this.ignoreDuringComposition(e)||e.type=="keydown"&&this.keydown(e)||this.runHandlers(e.type,e)}runHandlers(e,t){let i=this.handlers[e];if(i){for(let r of i.observers)r(this.view,t);for(let r of i.handlers){if(t.defaultPrevented)break;if(r(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=v5(e),i=this.handlers,r=this.view.contentDOM;for(let s in t)if(s!="scroll"){let l=!t[s].handlers.length,o=i[s];o&&l!=!o.handlers.length&&(r.removeEventListener(s,this.handleEvent),o=null),o||r.addEventListener(s,this.handleEvent,{passive:l})}for(let s in i)s!="scroll"&&!t[s]&&r.removeEventListener(s,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),e.keyCode==9&&Date.now()i.keyCode==e.keyCode))&&!e.ctrlKey||w5.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(){let e=this.pendingIOSKey;return e?(this.pendingIOSKey=void 0,Cl(this.view.contentDOM,e.key,e.keyCode)):!1}ignoreDuringComposition(e){return/^key/.test(e.type)?this.composing>0?!0:We.safari&&!We.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100?(this.compositionPendingKey=!1,!0):!1:!1}startMouseSelection(e){this.mouseSelection&&this.mouseSelection.destroy(),this.mouseSelection=e}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 jm(n,e){return(t,i)=>{try{return e.call(n,i,t)}catch(r){An(t.state,r)}}}function v5(n){let e=Object.create(null);function t(i){return e[i]||(e[i]={observers:[],handlers:[]})}for(let i of n){let r=i.spec;if(r&&r.domEventHandlers)for(let s in r.domEventHandlers){let l=r.domEventHandlers[s];l&&t(s).handlers.push(jm(i.value,l))}if(r&&r.domEventObservers)for(let s in r.domEventObservers){let l=r.domEventObservers[s];l&&t(s).observers.push(jm(i.value,l))}}for(let i in Kn)t(i).handlers.push(Kn[i]);for(let i in Jn)t(i).observers.push(Jn[i]);return e}const oy=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],w5="dthko",ay=[16,17,18,20,91,92,224,225],Xf=6;function Af(n){return Math.max(0,n)*.7+8}function Q5(n,e){return Math.max(Math.abs(n.clientX-e.clientX),Math.abs(n.clientY-e.clientY))}class _5{constructor(e,t,i,r){this.view=e,this.startEvent=t,this.style=i,this.mustSelect=r,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=D4(e.contentDOM),this.atoms=e.state.facet(Zd).map(l=>l(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(Ot.allowMultipleSelections)&&k5(e,t),this.dragging=W5(e,t)&&hy(t)==1?null:!1}start(e){this.dragging===!1&&this.select(e)}move(e){var t;if(e.buttons==0)return this.destroy();if(this.dragging||this.dragging==null&&Q5(this.startEvent,e)<10)return;this.select(this.lastEvent=e);let i=0,r=0,s=((t=this.scrollParent)===null||t===void 0?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},l=K$(this.view);e.clientX-l.left<=s.left+Xf?i=-Af(s.left-e.clientX):e.clientX+l.right>=s.right-Xf&&(i=Af(e.clientX-s.right)),e.clientY-l.top<=s.top+Xf?r=-Af(s.top-e.clientY):e.clientY+l.bottom>=s.bottom-Xf&&(r=Af(e.clientY-s.bottom)),this.setScrollSpeed(i,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(){this.scrollParent?(this.scrollParent.scrollLeft+=this.scrollSpeed.x,this.scrollParent.scrollTop+=this.scrollSpeed.y):this.view.win.scrollBy(this.scrollSpeed.x,this.scrollSpeed.y),this.dragging===!1&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let i=0;ithis.select(this.lastEvent),20)}}function k5(n,e){let t=n.state.facet(D$);return t.length?t[0](e):We.mac?e.metaKey:e.ctrlKey}function P5(n,e){let t=n.state.facet(V$);return t.length?t[0](e):We.mac?!e.altKey:!e.ctrlKey}function W5(n,e){let{main:t}=n.state.selection;if(t.empty)return!1;let i=Sc(n.root);if(!i||i.rangeCount==0)return!0;let r=i.getRangeAt(0).getClientRects();for(let s=0;s=e.clientX&&l.top<=e.clientY&&l.bottom>=e.clientY)return!0}return!1}function x5(n,e){if(!e.bubbles)return!0;if(e.defaultPrevented)return!1;for(let t=e.target,i;t!=n.contentDOM;t=t.parentNode)if(!t||t.nodeType==11||(i=Dt.get(t))&&i.ignoreEvent(e))return!1;return!0}const Kn=Object.create(null),Jn=Object.create(null),fy=We.ie&&We.ie_version<15||We.ios&&We.webkit_version<604;function C5(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(),cy(n,t.value)},50)}function cy(n,e){let{state:t}=n,i,r=1,s=t.toText(e),l=s.lines==t.selection.ranges.length;if(HO!=null&&t.selection.ranges.every(a=>a.empty)&&HO==s.toString()){let a=-1;i=t.changeByRange(c=>{let h=t.doc.lineAt(c.from);if(h.from==a)return{range:c};a=h.from;let O=t.toText((l?s.line(r++).text:e)+t.lineBreak);return{changes:{from:h.from,insert:O},range:ee.cursor(c.from+O.length)}})}else l?i=t.changeByRange(a=>{let c=s.line(r++);return{changes:{from:a.from,to:a.to,insert:c.text},range:ee.cursor(a.from+c.length)}}):i=t.replaceSelection(s);n.dispatch(i,{userEvent:"input.paste",scrollIntoView:!0})}Jn.scroll=n=>{n.inputState.lastScrollTop=n.scrollDOM.scrollTop,n.inputState.lastScrollLeft=n.scrollDOM.scrollLeft};Kn.keydown=(n,e)=>(n.inputState.setSelectionOrigin("select"),e.keyCode==27&&(n.inputState.lastEscPress=Date.now()),!1);Jn.touchstart=(n,e)=>{n.inputState.lastTouchTime=Date.now(),n.inputState.setSelectionOrigin("select.pointer")};Jn.touchmove=n=>{n.inputState.setSelectionOrigin("select.pointer")};Kn.mousedown=(n,e)=>{if(n.observer.flush(),n.inputState.lastTouchTime>Date.now()-2e3)return!1;let t=null;for(let i of n.state.facet(q$))if(t=i(n,e),t)break;if(!t&&e.button==0&&(t=R5(n,e)),t){let i=!n.hasFocus;n.inputState.startMouseSelection(new _5(n,e,t,i)),i&&n.observer.ignore(()=>x$(n.contentDOM));let r=n.inputState.mouseSelection;if(r)return r.start(e),r.dragging===!1}return!1};function Bm(n,e,t,i){if(i==1)return ee.cursor(e,t);if(i==2)return O5(n.state,e,t);{let r=ci.find(n.docView,e),s=n.state.doc.lineAt(r?r.posAtEnd:e),l=r?r.posAtStart:s.from,o=r?r.posAtEnd:s.to;return on>=e.top&&n<=e.bottom,Fm=(n,e,t)=>uy(e,t)&&n>=t.left&&n<=t.right;function T5(n,e,t,i){let r=ci.find(n.docView,e);if(!r)return 1;let s=e-r.posAtStart;if(s==0)return 1;if(s==r.length)return-1;let l=r.coordsAt(s,-1);if(l&&Fm(t,i,l))return-1;let o=r.coordsAt(s,1);return o&&Fm(t,i,o)?1:l&&uy(i,l)?-1:1}function Gm(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1);return{pos:t,bias:T5(n,t,e.clientX,e.clientY)}}const Z5=We.ie&&We.ie_version<=11;let Hm=null,Km=0,Jm=0;function hy(n){if(!Z5)return n.detail;let e=Hm,t=Jm;return Hm=n,Jm=Date.now(),Km=!e||t>Date.now()-400&&Math.abs(e.clientX-n.clientX)<2&&Math.abs(e.clientY-n.clientY)<2?(Km+1)%3:1}function R5(n,e){let t=Gm(n,e),i=hy(e),r=n.state.selection;return{update(s){s.docChanged&&(t.pos=s.changes.mapPos(t.pos),r=r.map(s.changes))},get(s,l,o){let a=Gm(n,s),c,h=Bm(n,a.pos,a.bias,i);if(t.pos!=a.pos&&!l){let O=Bm(n,t.pos,t.bias,i),p=Math.min(O.from,h.from),g=Math.max(O.to,h.to);h=p1&&(c=X5(r,a.pos))?c:o?r.addRange(h):ee.create([h])}}}function X5(n,e){for(let t=0;t=e)return ee.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}Kn.dragstart=(n,e)=>{let{selection:{main:t}}=n.state;if(e.target.draggable){let r=n.docView.nearest(e.target);if(r&&r.isWidget){let s=r.posAtStart,l=s+r.length;(s>=t.to||l<=t.from)&&(t=ee.range(s,l))}}let{inputState:i}=n;return i.mouseSelection&&(i.mouseSelection.dragging=!0),i.draggedContent=t,e.dataTransfer&&(e.dataTransfer.setData("Text",n.state.sliceDoc(t.from,t.to)),e.dataTransfer.effectAllowed="copyMove"),!1};Kn.dragend=n=>(n.inputState.draggedContent=null,!1);function e1(n,e,t,i){if(!t)return;let r=n.posAtCoords({x:e.clientX,y:e.clientY},!1),{draggedContent:s}=n.inputState,l=i&&s&&P5(n,e)?{from:s.from,to:s.to}:null,o={from:r,insert:t},a=n.state.changes(l?[l,o]:o);n.focus(),n.dispatch({changes:a,selection:{anchor:a.mapPos(r,-1),head:a.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),n.inputState.draggedContent=null}Kn.drop=(n,e)=>{if(!e.dataTransfer)return!1;if(n.state.readOnly)return!0;let t=e.dataTransfer.files;if(t&&t.length){let i=Array(t.length),r=0,s=()=>{++r==t.length&&e1(n,e,i.filter(l=>l!=null).join(n.state.lineBreak),!1)};for(let l=0;l{/[\x00-\x08\x0e-\x1f]{2}/.test(o.result)||(i[l]=o.result),s()},o.readAsText(t[l])}return!0}else{let i=e.dataTransfer.getData("Text");if(i)return e1(n,e,i,!0),!0}return!1};Kn.paste=(n,e)=>{if(n.state.readOnly)return!0;n.observer.flush();let t=fy?null:e.clipboardData;return t?(cy(n,t.getData("text/plain")||t.getData("text/uri-text")),!0):(C5(n),!1)};function A5(n,e){let t=n.dom.parentNode;if(!t)return;let i=t.appendChild(document.createElement("textarea"));i.style.cssText="position: fixed; left: -10000px; top: 10px",i.value=e,i.focus(),i.selectionEnd=e.length,i.selectionStart=0,setTimeout(()=>{i.remove(),n.focus()},50)}function Y5(n){let e=[],t=[],i=!1;for(let r of n.selection.ranges)r.empty||(e.push(n.sliceDoc(r.from,r.to)),t.push(r));if(!e.length){let r=-1;for(let{from:s}of n.selection.ranges){let l=n.doc.lineAt(s);l.number>r&&(e.push(l.text),t.push({from:l.from,to:Math.min(n.doc.length,l.to+1)})),r=l.number}i=!0}return{text:e.join(n.lineBreak),ranges:t,linewise:i}}let HO=null;Kn.copy=Kn.cut=(n,e)=>{let{text:t,ranges:i,linewise:r}=Y5(n.state);if(!t&&!r)return!1;HO=r?t:null,e.type=="cut"&&!n.state.readOnly&&n.dispatch({changes:i,scrollIntoView:!0,userEvent:"delete.cut"});let s=fy?null:e.clipboardData;return s?(s.clearData(),s.setData("text/plain",t),!0):(A5(n,t),!1)};const Oy=Ir.define();function dy(n,e){let t=[];for(let i of n.facet(N$)){let r=i(n,e);r&&t.push(r)}return t?n.update({effects:t,annotations:Oy.of(!0)}):null}function py(n){setTimeout(()=>{let e=n.hasFocus;if(e!=n.inputState.notifiedFocused){let t=dy(n.state,e);t?n.dispatch(t):n.update([])}},10)}Jn.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),py(n)};Jn.blur=n=>{n.observer.clearSelectionRange(),py(n)};Jn.compositionstart=Jn.compositionupdate=n=>{n.inputState.compositionFirstChange==null&&(n.inputState.compositionFirstChange=!0),n.inputState.composing<0&&(n.inputState.composing=0)};Jn.compositionend=n=>{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,We.chrome&&We.android?n.observer.flushSoon():n.inputState.compositionPendingChange?Promise.resolve().then(()=>n.observer.flush()):setTimeout(()=>{n.inputState.composing<0&&n.docView.hasComposition&&n.update([])},50)};Jn.contextmenu=n=>{n.inputState.lastContextMenu=Date.now()};Kn.beforeinput=(n,e)=>{var t;let i;if(We.chrome&&We.android&&(i=oy.find(r=>r.inputType==e.inputType))&&(n.observer.delayAndroidKey(i.key,i.keyCode),i.key=="Backspace"||i.key=="Delete")){let r=((t=window.visualViewport)===null||t===void 0?void 0:t.height)||0;setTimeout(()=>{var s;(((s=window.visualViewport)===null||s===void 0?void 0:s.height)||0)>r+10&&n.hasFocus&&(n.contentDOM.blur(),n.focus())},100)}return!1};const t1=new Set;function U5(n){t1.has(n)||(t1.add(n),n.addEventListener("copy",()=>{}),n.addEventListener("cut",()=>{}))}const i1=["pre-wrap","normal","pre-line","break-spaces"];class E5{constructor(e){this.lineWrapping=e,this.doc=mt.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let i=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(i+=Math.max(0,Math.ceil((t-e-i*this.lineLength*.5)/this.lineLength))),this.lineHeight*i}heightForLine(e){return this.lineWrapping?(1+Math.max(0,Math.ceil((e-this.lineLength)/(this.lineLength-5))))*this.lineHeight:this.lineHeight}setDoc(e){return this.doc=e,this}mustRefreshForWrapping(e){return i1.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let i=0;i-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=o;if(this.lineWrapping=o,this.lineHeight=t,this.charWidth=i,this.textHeight=r,this.lineLength=s,a){this.heightSamples={};for(let c=0;c0}set outdated(e){this.flags=(e?2:0)|this.flags&-3}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>lc&&(e.heightChanged=!0),this.height=t)}replace(e,t,i){return Li.of(i)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,i,r){let s=this,l=i.doc;for(let o=r.length-1;o>=0;o--){let{fromA:a,toA:c,fromB:h,toB:O}=r[o],p=s.lineAt(a,Mt.ByPosNoHeight,i.setDoc(t),0,0),g=p.to>=c?p:s.lineAt(c,Mt.ByPosNoHeight,i,0,0);for(O+=g.to-c,c=g.to;o>0&&p.from<=r[o-1].toA;)a=r[o-1].fromA,h=r[o-1].fromB,o--,as*2){let o=e[t-1];o.break?e.splice(--t,1,o.left,null,o.right):e.splice(--t,1,o.left,o.right),i+=1+o.break,r-=o.size}else if(s>r*2){let o=e[i];o.break?e.splice(i,1,o.left,null,o.right):e.splice(i,1,o.left,o.right),i+=2+o.break,s-=o.size}else break;else if(r=s&&l(this.blockAt(0,i,r,s))}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more&&this.setHeight(e,r.heights[r.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class hn extends gy{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,i,r){return new Or(r,this.length,i,this.height,this.breaks)}replace(e,t,i){let r=i[0];return i.length==1&&(r instanceof hn||r instanceof wi&&r.flags&4)&&Math.abs(this.length-r.length)<10?(r instanceof wi?r=new hn(r.length,this.height):r.height=this.height,this.outdated||(r.outdated=!1),r):Li.of(i)}updateHeight(e,t=0,i=!1,r){return r&&r.from<=t&&r.more?this.setHeight(e,r.heights[r.index++]):(i||this.outdated)&&this.setHeight(e,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 wi extends Li{constructor(e){super(e,0)}heightMetrics(e,t){let i=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,s=r-i+1,l,o=0;if(e.lineWrapping){let a=Math.min(this.height,e.lineHeight*s);l=a/s,this.length>s+1&&(o=(this.height-a)/(this.length-s-1))}else l=this.height/s;return{firstLine:i,lastLine:r,perLine:l,perChar:o}}blockAt(e,t,i,r){let{firstLine:s,lastLine:l,perLine:o,perChar:a}=this.heightMetrics(t,r);if(t.lineWrapping){let c=r+Math.round(Math.max(0,Math.min(1,(e-i)/this.height))*this.length),h=t.doc.lineAt(c),O=o+h.length*a,p=Math.max(i,e-O/2);return new Or(h.from,h.length,p,O,0)}else{let c=Math.max(0,Math.min(l-s,Math.floor((e-i)/o))),{from:h,length:O}=t.doc.line(s+c);return new Or(h,O,i+o*c,o,0)}}lineAt(e,t,i,r,s){if(t==Mt.ByHeight)return this.blockAt(e,i,r,s);if(t==Mt.ByPosNoHeight){let{from:g,to:m}=i.doc.lineAt(e);return new Or(g,m-g,0,0,0)}let{firstLine:l,perLine:o,perChar:a}=this.heightMetrics(i,s),c=i.doc.lineAt(e),h=o+c.length*a,O=c.number-l,p=r+o*O+a*(c.from-s-O);return new Or(c.from,c.length,Math.max(r,Math.min(p,r+this.height-h)),h,0)}forEachLine(e,t,i,r,s,l){e=Math.max(e,s),t=Math.min(t,s+this.length);let{firstLine:o,perLine:a,perChar:c}=this.heightMetrics(i,s);for(let h=e,O=r;h<=t;){let p=i.doc.lineAt(h);if(h==e){let m=p.number-o;O+=a*m+c*(e-s-m)}let g=a+c*p.length;l(new Or(p.from,p.length,O,g,0)),O+=g,h=p.to+1}}replace(e,t,i){let r=this.length-t;if(r>0){let s=i[i.length-1];s instanceof wi?i[i.length-1]=new wi(s.length+r):i.push(null,new wi(r-1))}if(e>0){let s=i[0];s instanceof wi?i[0]=new wi(e+s.length):i.unshift(new wi(e-1),null)}return Li.of(i)}decomposeLeft(e,t){t.push(new wi(e-1),null)}decomposeRight(e,t){t.push(null,new wi(this.length-e-1))}updateHeight(e,t=0,i=!1,r){let s=t+this.length;if(r&&r.from<=t+this.length&&r.more){let l=[],o=Math.max(t,r.from),a=-1;for(r.from>t&&l.push(new wi(r.from-t-1).updateHeight(e,t));o<=s&&r.more;){let h=e.doc.lineAt(o).length;l.length&&l.push(null);let O=r.heights[r.index++];a==-1?a=O:Math.abs(O-a)>=lc&&(a=-2);let p=new hn(h,O);p.outdated=!1,l.push(p),o+=h+1}o<=s&&l.push(null,new wi(s-o).updateHeight(e,o));let c=Li.of(l);return(a<0||Math.abs(c.height-this.height)>=lc||Math.abs(a-this.heightMetrics(e,t).perLine)>=lc)&&(e.heightChanged=!0),c}else(i||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1);return this}toString(){return`gap(${this.length})`}}class M5 extends Li{constructor(e,t,i){super(e.length+t+i.length,e.height+i.height,t|(e.outdated||i.outdated?2:0)),this.left=e,this.right=i,this.size=e.size+i.size}get break(){return this.flags&1}blockAt(e,t,i,r){let s=i+this.left.height;return eo))return c;let h=t==Mt.ByPosNoHeight?Mt.ByPosNoHeight:Mt.ByPos;return a?c.join(this.right.lineAt(o,h,i,l,o)):this.left.lineAt(o,h,i,r,s).join(c)}forEachLine(e,t,i,r,s,l){let o=r+this.left.height,a=s+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,i,o,a,l);else{let c=this.lineAt(a,Mt.ByPos,i,r,s);e=e&&c.from<=t&&l(c),t>c.to&&this.right.forEachLine(c.to+1,t,i,o,a,l)}}replace(e,t,i){let r=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-r,t-r,i));let s=[];e>0&&this.decomposeLeft(e,s);let l=s.length;for(let o of i)s.push(o);if(e>0&&n1(s,l-1),t=i&&t.push(null)),e>i&&this.right.decomposeLeft(e-i,t)}decomposeRight(e,t){let i=this.left.length,r=i+this.break;if(e>=r)return this.right.decomposeRight(e-r,t);e2*t.size||t.size>2*e.size?Li.of(this.break?[e,null,t]:[e,t]):(this.left=e,this.right=t,this.height=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,i=!1,r){let{left:s,right:l}=this,o=t+s.length+this.break,a=null;return r&&r.from<=t+s.length&&r.more?a=s=s.updateHeight(e,t,i,r):s.updateHeight(e,t,i),r&&r.from<=o+l.length&&r.more?a=l=l.updateHeight(e,o,i,r):l.updateHeight(e,o,i),a?this.balanced(s,l):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function n1(n,e){let t,i;n[e]==null&&(t=n[e-1])instanceof wi&&(i=n[e+1])instanceof wi&&n.splice(e-1,3,new wi(t.length+1+i.length))}const D5=5;class Rd{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 i=Math.min(t,this.lineEnd),r=this.nodes[this.nodes.length-1];r instanceof hn?r.length+=i-this.pos:(i>this.pos||!this.isCovered)&&this.nodes.push(new hn(i-this.pos,-1)),this.writtenTo=i,t>i&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,i){if(e=D5)&&this.addLineDeco(r,s,l)}else t>e&&this.span(e,t);this.lineEnd>-1&&this.lineEnd-1)return;let{from:e,to:t}=this.oracle.doc.lineAt(this.pos);this.lineStart=e,this.lineEnd=t,this.writtenToe&&this.nodes.push(new hn(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let i=new wi(t-e);return this.oracle.doc.lineAt(e).to==t&&(i.flags|=4),i}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof hn)return e;let t=new hn(0,-1);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,i){let r=this.ensureLine();r.length+=i,r.collapsed+=i,r.widgetHeight=Math.max(r.widgetHeight,e),r.breaks+=t,this.writtenTo=this.pos=this.pos+i}finish(e){let t=this.nodes.length==0?null:this.nodes[this.nodes.length-1];this.lineStart>-1&&!(t instanceof hn)&&!this.isCovered?this.nodes.push(new hn(0,-1)):(this.writtenToh.clientHeight||h.scrollWidth>h.clientWidth)&&O.overflow!="visible"){let p=h.getBoundingClientRect();s=Math.max(s,p.left),l=Math.min(l,p.right),o=Math.max(o,p.top),a=c==n.parentNode?p.bottom:Math.min(a,p.bottom)}c=O.position=="absolute"||O.position=="fixed"?h.offsetParent:h.parentNode}else if(c.nodeType==11)c=c.host;else break;return{left:s-t.left,right:Math.max(s,l)-t.left,top:o-(t.top+e),bottom:Math.max(o,a)-(t.top+e)}}function L5(n,e){let t=n.getBoundingClientRect();return{left:0,right:t.right-t.left,top:e,bottom:t.bottom-(t.top+e)}}class Nh{constructor(e,t,i){this.from=e,this.to=t,this.size=i}static same(e,t){if(e.length!=t.length)return!1;for(let i=0;itypeof i!="function"&&i.class=="cm-lineWrapping");this.heightOracle=new E5(t),this.stateDeco=e.facet(ta).filter(i=>typeof i!="function"),this.heightMap=Li.empty().applyChanges(this.stateDeco,mt.empty,this.heightOracle.setDoc(e.doc),[new Yn(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=Ye.set(this.lineGaps.map(i=>i.draw(this,!1))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let i=0;i<=1;i++){let r=i?t.head:t.anchor;if(!e.some(({from:s,to:l})=>r>=s&&r<=l)){let{from:s,to:l}=this.lineBlockAt(r);e.push(new Yf(s,l))}}this.viewports=e.sort((i,r)=>i.from-r.from),this.scaler=this.heightMap.height<=7e6?s1:new F5(this.heightOracle,this.heightMap,this.viewports)}updateViewportLines(){this.viewportLines=[],this.heightMap.forEachLine(this.viewport.from,this.viewport.to,this.heightOracle.setDoc(this.state.doc),0,0,e=>{this.viewportLines.push(this.scaler.scale==1?e:Uo(e,this.scaler))})}update(e,t=null){this.state=e.state;let i=this.stateDeco;this.stateDeco=this.state.facet(ta).filter(h=>typeof h!="function");let r=e.changedRanges,s=Yn.extendWithRanges(r,V5(i,this.stateDeco,e?e.changes:ui.empty(this.state.doc.length))),l=this.heightMap.height,o=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),s),this.heightMap.height!=l&&(e.flags|=2),o?(this.scrollAnchorPos=e.changes.mapPos(o.from,-1),this.scrollAnchorHeight=o.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=s.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let c=!e.changes.empty||e.flags&2||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),c&&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(),t&&(this.scrollTarget=t),!this.mustEnforceCursorAssoc&&e.selectionSet&&e.view.lineWrapping&&e.state.selection.main.empty&&e.state.selection.main.assoc&&!e.state.facet(B$)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,i=window.getComputedStyle(t),r=this.heightOracle,s=i.whiteSpace;this.defaultTextDirection=i.direction=="rtl"?jt.RTL:jt.LTR;let l=this.heightOracle.mustRefreshForWrapping(s),o=t.getBoundingClientRect(),a=l||this.mustMeasureContent||this.contentDOMHeight!=o.height;this.contentDOMHeight=o.height,this.mustMeasureContent=!1;let c=0,h=0;if(o.width&&o.height){let A=o.width/t.offsetWidth,C=o.height/t.offsetHeight;(A>.995&&A<1.005||!isFinite(A)||Math.abs(o.width-t.offsetWidth)<1)&&(A=1),(C>.995&&C<1.005||!isFinite(C)||Math.abs(o.height-t.offsetHeight)<1)&&(C=1),(this.scaleX!=A||this.scaleY!=C)&&(this.scaleX=A,this.scaleY=C,c|=8,l=a=!0)}let O=(parseInt(i.paddingTop)||0)*this.scaleY,p=(parseInt(i.paddingBottom)||0)*this.scaleY;(this.paddingTop!=O||this.paddingBottom!=p)&&(this.paddingTop=O,this.paddingBottom=p,c|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(r.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,c|=8);let g=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=g&&(this.scrollAnchorHeight=-1,this.scrollTop=g),this.scrolledToBottom=T$(e.scrollDOM);let m=(this.printing?L5:I5)(t,this.paddingTop),$=m.top-this.pixelViewport.top,y=m.bottom-this.pixelViewport.bottom;this.pixelViewport=m;let _=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(_!=this.inView&&(this.inView=_,_&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let x=o.width;if((this.contentDOMWidth!=x||this.editorHeight!=e.scrollDOM.clientHeight)&&(this.contentDOMWidth=o.width,this.editorHeight=e.scrollDOM.clientHeight,c|=8),a){let A=e.docView.measureVisibleLineHeights(this.viewport);if(r.mustRefreshForHeights(A)&&(l=!0),l||r.lineWrapping&&Math.abs(x-this.contentDOMWidth)>r.charWidth){let{lineHeight:C,charWidth:z,textHeight:V}=e.docView.measureTextSize();l=C>0&&r.refresh(s,C,z,V,x/z,A),l&&(e.docView.minWidth=0,c|=8)}$>0&&y>0?h=Math.max($,y):$<0&&y<0&&(h=Math.min($,y)),r.heightChanged=!1;for(let C of this.viewports){let z=C.from==this.viewport.from?A:e.docView.measureVisibleLineHeights(C);this.heightMap=(l?Li.empty().applyChanges(this.stateDeco,mt.empty,this.heightOracle,[new Yn(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(r,0,l,new z5(C.from,z))}r.heightChanged&&(c|=2)}let R=!this.viewportIsAppropriate(this.viewport,h)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return R&&(this.viewport=this.getViewport(h,this.scrollTarget)),this.updateForViewport(),(c&2||R)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(l?[]: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 i=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),r=this.heightMap,s=this.heightOracle,{visibleTop:l,visibleBottom:o}=this,a=new Yf(r.lineAt(l-i*1e3,Mt.ByHeight,s,0,0).from,r.lineAt(o+(1-i)*1e3,Mt.ByHeight,s,0,0).to);if(t){let{head:c}=t.range;if(ca.to){let h=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),O=r.lineAt(c,Mt.ByPos,s,0,0),p;t.y=="center"?p=(O.top+O.bottom)/2-h/2:t.y=="start"||t.y=="nearest"&&c=o+Math.max(10,Math.min(i,250)))&&r>l-2*1e3&&s>1,l=r<<1;if(this.defaultTextDirection!=jt.LTR&&!i)return[];let o=[],a=(c,h,O,p)=>{if(h-cc&&yy.from>=O.from&&y.to<=O.to&&Math.abs(y.from-c)y.from<_&&y.to>_));if(!$){if(hy.from<=h&&y.to>=h)){let y=t.moveToLineBoundary(ee.cursor(h),!1,!0).head;y>c&&(h=y)}$=new Nh(c,h,this.gapSize(O,c,h,p))}o.push($)};for(let c of this.viewportLines){if(c.lengthc.from&&a(c.from,p,c,h),gt.draw(this,this.heightOracle.lineWrapping))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];vt.spans(e,this.viewport.from,this.viewport.to,{span(r,s){t.push({from:r,to:s})},point(){}},20);let i=t.length!=this.visibleRanges.length||this.visibleRanges.some((r,s)=>r.from!=t[s].from||r.to!=t[s].to);return this.visibleRanges=t,i?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find(t=>t.from<=e&&t.to>=e)||Uo(this.heightMap.lineAt(e,Mt.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return Uo(this.heightMap.lineAt(this.scaler.fromDOM(e),Mt.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 Uo(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 Yf{constructor(e,t){this.from=e,this.to=t}}function j5(n,e,t){let i=[],r=n,s=0;return vt.spans(t,n,e,{span(){},point(l,o){l>r&&(i.push({from:r,to:l}),s+=l-r),r=o}},20),r=1)return e[e.length-1].to;let i=Math.floor(n*t);for(let r=0;;r++){let{from:s,to:l}=e[r],o=l-s;if(i<=o)return s+i;i-=o}}function Ef(n,e){let t=0;for(let{from:i,to:r}of n.ranges){if(e<=r){t+=e-i;break}t+=r-i}return t/n.total}function B5(n,e){for(let t of n)if(e(t))return t}const s1={toDOM(n){return n},fromDOM(n){return n},scale:1};class F5{constructor(e,t,i){let r=0,s=0,l=0;this.viewports=i.map(({from:o,to:a})=>{let c=t.lineAt(o,Mt.ByPos,e,0,0).top,h=t.lineAt(a,Mt.ByPos,e,0,0).bottom;return r+=h-c,{from:o,to:a,top:c,bottom:h,domTop:0,domBottom:0}}),this.scale=(7e6-r)/(t.height-r);for(let o of this.viewports)o.domTop=l+(o.top-s)*this.scale,l=o.domBottom=o.domTop+(o.bottom-o.top),s=o.bottom}toDOM(e){for(let t=0,i=0,r=0;;t++){let s=tUo(r,e)):n._content)}const zf=_e.define({combine:n=>n.join(" ")}),KO=_e.define({combine:n=>n.indexOf(!0)>-1}),JO=vs.newName(),my=vs.newName(),Sy=vs.newName(),by={"&light":"."+my,"&dark":"."+Sy};function ed(n,e,t){return new vs(e,{finish(i){return/&/.test(i)?i.replace(/&\w*/,r=>{if(r=="&")return n;if(!t||!t[r])throw new RangeError(`Unsupported selector: ${r}`);return t[r]}):n+" "+i}})}const G5=ed("."+JO,{"&":{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},".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:"#444"},".cm-dropCursor":{position:"absolute"},"&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor":{display:"block"},"&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",insetInlineStart:0,zIndex:200},"&light .cm-gutters":{backgroundColor:"#f5f5f5",color:"#6c6c6c",borderRight:"1px solid #ddd"},"&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},"&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-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"},".cm-highlightSpace:before":{content:"attr(data-display)",position:"absolute",pointerEvents:"none",color:"#888"},".cm-highlightTab":{backgroundImage:`url('data:image/svg+xml,')`,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"}},by),Eo="￿";class H5{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(Ot.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Eo}readRange(e,t){if(!e)return this;let i=e.parentNode;for(let r=e;;){this.findPointBefore(i,r);let s=this.text.length;this.readNode(r);let l=r.nextSibling;if(l==t)break;let o=Dt.get(r),a=Dt.get(l);(o&&a?o.breakAfter:(o?o.breakAfter:l1(r))||l1(l)&&(r.nodeName!="BR"||r.cmIgnore)&&this.text.length>s)&&this.lineBreak(),r=l}return this.findPointBefore(i,t),this}readTextNode(e){let t=e.nodeValue;for(let i of this.points)i.node==e&&(i.pos=this.text.length+Math.min(i.offset,t.length));for(let i=0,r=this.lineSeparator?null:/\r\n?|\n/g;;){let s=-1,l=1,o;if(this.lineSeparator?(s=t.indexOf(this.lineSeparator,i),l=this.lineSeparator.length):(o=r.exec(t))&&(s=o.index,l=o[0].length),this.append(t.slice(i,s<0?t.length:s)),s<0)break;if(this.lineBreak(),l>1)for(let a of this.points)a.node==e&&a.pos>this.text.length&&(a.pos-=l-1);i=s+l}}readNode(e){if(e.cmIgnore)return;let t=Dt.get(e),i=t&&t.overrideDOMText;if(i!=null){this.findPointInside(e,i.length);for(let r=i.iter();!r.next().done;)r.lineBreak?this.lineBreak():this.append(r.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 i of this.points)i.node==e&&e.childNodes[i.offset]==t&&(i.pos=this.text.length)}findPointInside(e,t){for(let i of this.points)(e.nodeType==3?i.node==e:e.contains(i.node))&&(i.pos=this.text.length+(K5(e,i.node,i.offset)?t:0))}}function K5(n,e,t){for(;;){if(!e||t-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,i,0))){let o=s||l?[]:i3(e),a=new H5(o,e.state);a.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=a.text,this.newSel=n3(o,this.bounds.from)}else{let o=e.observer.selectionRange,a=s&&s.node==o.focusNode&&s.offset==o.focusOffset||!EO(e.contentDOM,o.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(o.focusNode,o.focusOffset),c=l&&l.node==o.anchorNode&&l.offset==o.anchorOffset||!EO(e.contentDOM,o.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(o.anchorNode,o.anchorOffset);this.newSel=ee.single(c,a)}}}function $y(n,e){let t,{newSel:i}=e,r=n.state.selection.main,s=n.inputState.lastKeyTime>Date.now()-100?n.inputState.lastKeyCode:-1;if(e.bounds){let{from:l,to:o}=e.bounds,a=r.from,c=null;(s===8||We.android&&e.text.length=r.from&&t.to<=r.to&&(t.from!=r.from||t.to!=r.to)&&r.to-r.from-(t.to-t.from)<=4?t={from:r.from,to:r.to,insert:n.state.doc.slice(r.from,t.from).append(t.insert).append(n.state.doc.slice(t.to,r.to))}:(We.mac||We.android)&&t&&t.from==t.to&&t.from==r.head-1&&/^\. ?$/.test(t.insert.toString())&&n.contentDOM.getAttribute("autocorrect")=="off"?(i&&t.insert.length==2&&(i=ee.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:mt.of([" "])}):We.chrome&&t&&t.from==t.to&&t.from==r.head&&t.insert.toString()==` + `&&n.lineWrapping&&(i&&(i=ee.single(i.main.anchor-1,i.main.head-1)),t={from:r.from,to:r.to,insert:mt.of([" "])}),t){if(We.ios&&n.inputState.flushIOSKey()||We.android&&(t.from==r.from&&t.to==r.to&&t.insert.length==1&&t.insert.lines==2&&Cl(n.contentDOM,"Enter",13)||(t.from==r.from-1&&t.to==r.to&&t.insert.length==0||s==8&&t.insert.lengthr.head)&&Cl(n.contentDOM,"Backspace",8)||t.from==r.from&&t.to==r.to+1&&t.insert.length==0&&Cl(n.contentDOM,"Delete",46)))return!0;let l=t.insert.toString();n.inputState.composing>=0&&n.inputState.composing++;let o,a=()=>o||(o=e3(n,t,i));return n.state.facet(L$).some(c=>c(n,t.from,t.to,l,a))||n.dispatch(a()),!0}else if(i&&!i.main.eq(r)){let l=!1,o="select";return n.inputState.lastSelectionTime>Date.now()-50&&(n.inputState.lastSelectionOrigin=="select"&&(l=!0),o=n.inputState.lastSelectionOrigin),n.dispatch({selection:i,scrollIntoView:l,userEvent:o}),!0}else return!1}function e3(n,e,t){let i,r=n.state,s=r.selection.main;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 o=s.frome.to?r.sliceDoc(e.to,s.to):"";i=r.replaceSelection(n.state.toText(o+e.insert.sliceString(0,void 0,n.state.lineBreak)+a))}else{let o=r.changes(e),a=t&&t.main.to<=o.newLength?t.main:void 0;if(r.selection.ranges.length>1&&n.inputState.composing>=0&&e.to<=s.to&&e.to>=s.to-10){let c=n.state.sliceDoc(e.from,e.to),h,O=t&&ry(n,t.main.head);if(O){let m=e.insert.length-(e.to-e.from);h={from:O.from,to:O.to-m}}else h=n.state.doc.lineAt(s.head);let p=s.to-e.to,g=s.to-s.from;i=r.changeByRange(m=>{if(m.from==s.from&&m.to==s.to)return{changes:o,range:a||m.map(o)};let $=m.to-p,y=$-c.length;if(m.to-m.from!=g||n.state.sliceDoc(y,$)!=c||m.to>=h.from&&m.from<=h.to)return{range:m};let _=r.changes({from:y,to:$,insert:e.insert}),x=m.to-s.to;return{changes:_,range:a?ee.range(Math.max(0,a.anchor+x),Math.max(0,a.head+x)):m.map(_)}})}else i={changes:o,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(n.composing||n.inputState.compositionPendingChange&&n.inputState.compositionEndedAt>Date.now()-50)&&(n.inputState.compositionPendingChange=!1,l+=".compose",n.inputState.compositionFirstChange&&(l+=".start",n.inputState.compositionFirstChange=!1)),r.update(i,{userEvent:l,scrollIntoView:!0})}function t3(n,e,t,i){let r=Math.min(n.length,e.length),s=0;for(;s0&&o>0&&n.charCodeAt(l-1)==e.charCodeAt(o-1);)l--,o--;if(i=="end"){let a=Math.max(0,s-Math.min(l,o));t-=l+a-s}if(l=l?s-t:0;s-=a,o=s+(o-l),l=s}else if(o=o?s-t:0;s-=a,l=s+(l-o),o=s}return{from:s,toA:l,toB:o}}function i3(n){let e=[];if(n.root.activeElement!=n.contentDOM)return e;let{anchorNode:t,anchorOffset:i,focusNode:r,focusOffset:s}=n.observer.selectionRange;return t&&(e.push(new o1(t,i)),(r!=t||s!=i)&&e.push(new o1(r,s))),e}function n3(n,e){if(n.length==0)return null;let t=n[0].pos,i=n.length==2?n[1].pos:t;return t>-1&&i>-1?ee.single(t+e,i+e):null}const r3={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},jh=We.ie&&We.ie_version<=11;class s3{constructor(e){this.view=e,this.active=!1,this.selectionRange=new V4,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.parentCheck=-1,this.dom=e.contentDOM,this.observer=new MutationObserver(t=>{for(let i of t)this.queue.push(i);(We.ie&&We.ie_version<=11||We.ios&&e.composing)&&t.some(i=>i.type=="childList"&&i.removedNodes.length||i.type=="characterData"&&i.oldValue.length>i.target.nodeValue.length)?this.flushSoon():this.flush()}),jh&&(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),typeof ResizeObserver=="function"&&(this.resizeScroll=new ResizeObserver(()=>{var t;((t=this.view.docView)===null||t===void 0?void 0:t.lastUpdate){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.onScrollChanged(e)}onResize(){this.resizeTimeout<0&&(this.resizeTimeout=setTimeout(()=>{this.resizeTimeout=-1,this.view.requestMeasure()},50))}onPrint(){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,i)=>t!=e[i]))){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:i}=this,r=this.selectionRange;if(i.state.facet(Jc)?i.root.activeElement!=this.dom:!rc(i.dom,r))return;let s=r.anchorNode&&i.docView.nearest(r.anchorNode);if(s&&s.ignoreEvent(e)){t||(this.selectionChanged=!1);return}(We.ie&&We.ie_version<=11||We.android&&We.chrome)&&!i.state.selection.main.empty&&r.focusNode&&bc(r.focusNode,r.focusOffset,r.anchorNode,r.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=We.safari&&e.root.nodeType==11&&E4(this.dom.ownerDocument)==this.dom&&l3(this.view)||Sc(e.root);if(!t||this.selectionRange.eq(t))return!1;let i=rc(this.dom,t);return i&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let s=this.delayedAndroidKey;s&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=s.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&s.force&&Cl(this.dom,s.key,s.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(r)}(!this.delayedAndroidKey||e=="Enter")&&(this.delayedAndroidKey={key:e,keyCode:t,force:this.lastChange{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,i=-1,r=!1;for(let s of e){let l=this.readMutation(s);l&&(l.typeOver&&(r=!0),t==-1?{from:t,to:i}=l:(t=Math.min(l.from,t),i=Math.max(l.to,i)))}return{from:t,to:i,typeOver:r}}readChange(){let{from:e,to:t,typeOver:i}=this.processRecords(),r=this.selectionChanged&&rc(this.dom,this.selectionRange);if(e<0&&!r)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let s=new J5(this.view,e,t,i);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 i=this.view.state,r=$y(this.view,t);return this.view.state==i&&this.view.update([]),r}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty(e.type=="attributes"),e.type=="attributes"&&(t.flags|=4),e.type=="childList"){let i=a1(t,e.previousSibling||e.target.previousSibling,-1),r=a1(t,e.nextSibling||e.target.nextSibling,1);return{from:i?t.posAfter(i):t.posAtStart,to:r?t.posBefore(r):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),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),e.removeEventListener("beforeprint",this.onPrint),e.document.removeEventListener("selectionchange",this.onSelectionChange)}destroy(){var e,t,i;this.stop(),(e=this.intersection)===null||e===void 0||e.disconnect(),(t=this.gapIntersection)===null||t===void 0||t.disconnect(),(i=this.resizeScroll)===null||i===void 0||i.disconnect();for(let r of this.scrollTargets)r.removeEventListener("scroll",this.onScroll);this.removeWindowListeners(this.win),clearTimeout(this.parentCheck),clearTimeout(this.resizeTimeout),this.win.cancelAnimationFrame(this.delayedFlush),this.win.cancelAnimationFrame(this.flushingAndroidKey)}}function a1(n,e,t){for(;e;){let i=Dt.get(e);if(i&&i.parent==n)return i;let r=e.parentNode;e=r!=n.dom?r:t>0?e.nextSibling:e.previousSibling}return null}function l3(n){let e=null;function t(a){a.preventDefault(),a.stopImmediatePropagation(),e=a.getTargetRanges()[0]}if(n.contentDOM.addEventListener("beforeinput",t,!0),n.dom.ownerDocument.execCommand("indent"),n.contentDOM.removeEventListener("beforeinput",t,!0),!e)return null;let i=e.startContainer,r=e.startOffset,s=e.endContainer,l=e.endOffset,o=n.docView.domAtPos(n.state.selection.main.anchor);return bc(o.node,o.offset,s,l)&&([i,r,s,l]=[s,l,i,r]),{anchorNode:i,anchorOffset:r,focusNode:s,focusOffset:l}}class de{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.composing>0}get compositionStarted(){return this.inputState.composing>=0}get root(){return this._root}get win(){return this.dom.ownerDocument.defaultView||window}constructor(e={}){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.style.cssText="position: fixed; top: -10000px",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(i=>i.forEach(r=>t(r,this)))||(i=>this.update(i)),this.dispatch=this.dispatch.bind(this),this._root=e.root||q4(e.parent)||document,this.viewState=new r1(e.state||Ot.create(e)),e.scrollTo&&e.scrollTo.is(Rf)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(Ao).map(i=>new qh(i));for(let i of this.plugins)i.update(this);this.observer=new s3(this),this.inputState=new y5(this),this.inputState.ensureHandlers(this.plugins),this.docView=new Mm(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure(),e.parent&&e.parent.appendChild(this.dom)}dispatch(...e){let t=e.length==1&&e[0]instanceof hi?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,i=!1,r,s=this.state;for(let p of e){if(p.startState!=s)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");s=p.state}if(this.destroyed){this.viewState.state=s;return}let l=this.hasFocus,o=0,a=null;e.some(p=>p.annotation(Oy))?(this.inputState.notifiedFocused=l,o=1):l!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=l,a=dy(s,l),a||(o=1));let c=this.observer.delayedAndroidKey,h=null;if(c?(this.observer.clearDelayedAndroidKey(),h=this.observer.readChange(),(h&&!this.state.doc.eq(s.doc)||!this.state.selection.eq(s.selection))&&(h=null)):this.observer.clear(),s.facet(Ot.phrases)!=this.state.facet(Ot.phrases))return this.setState(s);r=$c.create(this,s,e),r.flags|=o;let O=this.viewState.scrollTarget;try{this.updateState=2;for(let p of e){if(O&&(O=O.map(p.changes)),p.scrollIntoView){let{main:g}=p.state.selection;O=new Tl(g.empty?g:ee.cursor(g.head,g.head>g.anchor?-1:1))}for(let g of p.effects)g.is(Rf)&&(O=g.value.clip(this.state))}this.viewState.update(r,O),this.bidiCache=yc.update(this.bidiCache,r.changes),r.empty||(this.updatePlugins(r),this.inputState.update(r)),t=this.docView.update(r),this.state.facet(Yo)!=this.styleModules&&this.mountStyles(),i=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(t,e.some(p=>p.isUserEvent("select.pointer")))}finally{this.updateState=0}if(r.startState.facet(zf)!=r.state.facet(zf)&&(this.viewState.mustMeasureContent=!0),(t||i||O||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!r.empty)for(let p of this.state.facet(LO))try{p(r)}catch(g){An(this.state,g,"update listener")}(a||h)&&Promise.resolve().then(()=>{a&&this.state==a.startState&&this.dispatch(a),h&&!$y(this,h)&&c.force&&Cl(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 i of this.plugins)i.destroy(this);this.viewState=new r1(e),this.plugins=e.facet(Ao).map(i=>new qh(i)),this.pluginMap.clear();for(let i of this.plugins)i.update(this);this.docView=new Mm(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(Ao),i=e.state.facet(Ao);if(t!=i){let r=[];for(let s of i){let l=t.indexOf(s);if(l<0)r.push(new qh(s));else{let o=this.plugins[l];o.mustUpdate=e,r.push(o)}}for(let s of this.plugins)s.mustUpdate!=e&&s.destroy(this);this.plugins=r,this.pluginMap.clear()}else for(let r of this.plugins)r.mustUpdate=e;for(let r=0;r-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,i=this.scrollDOM,r=i.scrollTop*this.scaleY,{scrollAnchorPos:s,scrollAnchorHeight:l}=this.viewState;Math.abs(r-this.viewState.scrollTop)>1&&(l=-1),this.viewState.scrollAnchorHeight=-1;try{for(let o=0;;o++){if(l<0)if(T$(i))s=-1,l=this.viewState.heightMap.height;else{let g=this.viewState.scrollAnchorAt(r);s=g.from,l=g.top}this.updateState=1;let a=this.viewState.measure(this);if(!a&&!this.measureRequests.length&&this.viewState.scrollTarget==null)break;if(o>5){console.warn(this.measureRequests.length?"Measure loop restarted more than 5 times":"Viewport failed to stabilize");break}let c=[];a&4||([this.measureRequests,c]=[c,this.measureRequests]);let h=c.map(g=>{try{return g.read(this)}catch(m){return An(this.state,m),f1}}),O=$c.create(this,this.state,[]),p=!1;O.flags|=a,t?t.flags|=a:t=O,this.updateState=2,O.empty||(this.updatePlugins(O),this.inputState.update(O),this.updateAttrs(),p=this.docView.update(O));for(let g=0;g1||m<-1){r=r+m,i.scrollTop=r/this.scaleY,l=-1;continue}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let o of this.state.facet(LO))o(t)}get themeClasses(){return JO+" "+(this.state.facet(KO)?Sy:my)+" "+this.state.facet(zf)}updateAttrs(){let e=c1(this,F$,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(Jc)?"true":"false",class:"cm-content",style:`${We.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),c1(this,Td,t);let i=this.observer.ignore(()=>{let r=qO(this.contentDOM,this.contentAttrs,t),s=qO(this.dom,this.editorAttrs,e);return r||s});return this.editorAttrs=e,this.contentAttrs=t,i}showAnnouncements(e){let t=!0;for(let i of e)for(let r of i.effects)if(r.is(de.announce)){t&&(this.announceDOM.textContent=""),t=!1;let s=this.announceDOM.appendChild(document.createElement("div"));s.textContent=r.value}}mountStyles(){this.styleModules=this.state.facet(Yo);let e=this.state.facet(de.cspNonce);vs.mount(this.root,this.styleModules.concat(G5).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;ti.spec==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,i){return Lh(this,e,Nm(this,e,t,i))}moveByGroup(e,t){return Lh(this,e,Nm(this,e,t,i=>b5(this,e.head,i)))}moveToLineBoundary(e,t,i=!0){return S5(this,e,t,i)}moveVertically(e,t,i){return Lh(this,e,$5(this,e,t,i))}domAtPos(e){return this.docView.domAtPos(e)}posAtDOM(e,t=0){return this.docView.posFromDOM(e,t)}posAtCoords(e,t=!0){return this.readMeasured(),ly(this,e,t)}coordsAtPos(e,t=1){this.readMeasured();let i=this.docView.coordsAt(e,t);if(!i||i.left==i.right)return i;let r=this.state.doc.lineAt(e),s=this.bidiSpans(r),l=s[gs.find(s,e-r.from,-1,t)];return Wd(i,l.dir==jt.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(j$)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>o3)return iy(e.length);let t=this.textDirectionAt(e.from),i;for(let s of this.bidiCache)if(s.from==e.from&&s.dir==t&&(s.fresh||ty(s.isolates,i=zm(this,e.from,e.to))))return s.order;i||(i=zm(this,e.from,e.to));let r=r5(e.text,t,i);return this.bidiCache.push(new yc(e.from,e.to,t,i,!0,r)),r}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||We.safari&&((e=this.inputState)===null||e===void 0?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore(()=>{x$(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(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Rf.of(new Tl(typeof e=="number"?ee.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,i=this.viewState.scrollAnchorAt(e);return Rf.of(new Tl(ee.cursor(i.from),"start","start",i.top-e,t,!0))}static domEventHandlers(e){return li.define(()=>({}),{eventHandlers:e})}static domEventObservers(e){return li.define(()=>({}),{eventObservers:e})}static theme(e,t){let i=vs.newName(),r=[zf.of(i),Yo.of(ed(`.${i}`,e))];return t&&t.dark&&r.push(KO.of(!0)),r}static baseTheme(e){return Js.lowest(Yo.of(ed("."+JO,e,by)))}static findFromDOM(e){var t;let i=e.querySelector(".cm-content"),r=i&&Dt.get(i)||Dt.get(e);return((t=r==null?void 0:r.rootView)===null||t===void 0?void 0:t.view)||null}}de.styleModule=Yo;de.inputHandler=L$;de.focusChangeEffect=N$;de.perLineTextDirection=j$;de.exceptionSink=I$;de.updateListener=LO;de.editable=Jc;de.mouseSelectionStyle=q$;de.dragMovesSelection=V$;de.clickAddsSelectionRange=D$;de.decorations=ta;de.atomicRanges=Zd;de.bidiIsolatedRanges=G$;de.scrollMargins=H$;de.darkTheme=KO;de.cspNonce=_e.define({combine:n=>n.length?n[0]:""});de.contentAttributes=Td;de.editorAttributes=F$;de.lineWrapping=de.contentAttributes.of({class:"cm-lineWrapping"});de.announce=Ne.define();const o3=4096,f1={};class yc{constructor(e,t,i,r,s,l){this.from=e,this.to=t,this.dir=i,this.isolates=r,this.fresh=s,this.order=l}static update(e,t){if(t.empty&&!e.some(s=>s.fresh))return e;let i=[],r=e.length?e[e.length-1].dir:jt.LTR;for(let s=Math.max(0,e.length-10);s=0;r--){let s=i[r],l=typeof s=="function"?s(n):s;l&&VO(l,t)}return t}const a3=We.mac?"mac":We.windows?"win":We.linux?"linux":"key";function f3(n,e){const t=n.split(/-(?!$)/);let i=t[t.length-1];i=="Space"&&(i=" ");let r,s,l,o;for(let a=0;ai.concat(r),[]))),t}function u3(n,e,t){return vy(yy(n.state),e,n,t)}let Os=null;const h3=4e3;function O3(n,e=a3){let t=Object.create(null),i=Object.create(null),r=(l,o)=>{let a=i[l];if(a==null)i[l]=o;else if(a!=o)throw new Error("Key binding "+l+" is used both as a regular binding and as a multi-stroke prefix")},s=(l,o,a,c,h)=>{var O,p;let g=t[l]||(t[l]=Object.create(null)),m=o.split(/ (?!$)/).map(_=>f3(_,e));for(let _=1;_{let A=Os={view:R,prefix:x,scope:l};return setTimeout(()=>{Os==A&&(Os=null)},h3),!0}]})}let $=m.join(" ");r($,!1);let y=g[$]||(g[$]={preventDefault:!1,stopPropagation:!1,run:((p=(O=g._any)===null||O===void 0?void 0:O.run)===null||p===void 0?void 0:p.slice())||[]});a&&y.run.push(a),c&&(y.preventDefault=!0),h&&(y.stopPropagation=!0)};for(let l of n){let o=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let c of o){let h=t[c]||(t[c]=Object.create(null));h._any||(h._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let O in h)h[O].run.push(l.any)}let a=l[e]||l.key;if(a)for(let c of o)s(c,a,l.run,l.preventDefault,l.stopPropagation),l.shift&&s(c,"Shift-"+a,l.shift,l.preventDefault,l.stopPropagation)}return t}function vy(n,e,t,i){let r=U4(e),s=Qi(r,0),l=Zn(s)==r.length&&r!=" ",o="",a=!1,c=!1,h=!1;Os&&Os.view==t&&Os.scope==i&&(o=Os.prefix+" ",ay.indexOf(e.keyCode)<0&&(c=!0,Os=null));let O=new Set,p=y=>{if(y){for(let _ of y.run)if(!O.has(_)&&(O.add(_),_(t,e)))return y.stopPropagation&&(h=!0),!0;y.preventDefault&&(y.stopPropagation&&(h=!0),c=!0)}return!1},g=n[i],m,$;return g&&(p(g[o+Mf(r,e,!l)])?a=!0:l&&(e.altKey||e.metaKey||e.ctrlKey)&&!(We.windows&&e.ctrlKey&&e.altKey)&&(m=ws[e.keyCode])&&m!=r?(p(g[o+Mf(m,e,!0)])||e.shiftKey&&($=Ko[e.keyCode])!=r&&$!=m&&p(g[o+Mf($,e,!1)]))&&(a=!0):l&&e.shiftKey&&p(g[o+Mf(r,e,!0)])&&(a=!0),!a&&p(g._any)&&(a=!0)),c&&(a=!0),a&&h&&e.stopPropagation(),a}class ma{constructor(e,t,i,r,s){this.className=e,this.left=t,this.top=i,this.width=r,this.height=s}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className!=this.className?!1:(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",this.width!=null&&(e.style.width=this.width+"px"),e.style.height=this.height+"px"}eq(e){return this.left==e.left&&this.top==e.top&&this.width==e.width&&this.height==e.height&&this.className==e.className}static forRange(e,t,i){if(i.empty){let r=e.coordsAtPos(i.head,i.assoc||1);if(!r)return[];let s=wy(e);return[new ma(t,r.left-s.left,r.top-s.top,null,r.bottom-r.top)]}else return d3(e,t,i)}}function wy(n){let e=n.scrollDOM.getBoundingClientRect();return{left:(n.textDirection==jt.LTR?e.left:e.right-n.scrollDOM.clientWidth*n.scaleX)-n.scrollDOM.scrollLeft*n.scaleX,top:e.top-n.scrollDOM.scrollTop*n.scaleY}}function h1(n,e,t){let i=ee.cursor(e);return{from:Math.max(t.from,n.moveToLineBoundary(i,!1,!0).from),to:Math.min(t.to,n.moveToLineBoundary(i,!0,!0).from),type:Ii.Text}}function d3(n,e,t){if(t.to<=n.viewport.from||t.from>=n.viewport.to)return[];let i=Math.max(t.from,n.viewport.from),r=Math.min(t.to,n.viewport.to),s=n.textDirection==jt.LTR,l=n.contentDOM,o=l.getBoundingClientRect(),a=wy(n),c=l.querySelector(".cm-line"),h=c&&window.getComputedStyle(c),O=o.left+(h?parseInt(h.paddingLeft)+Math.min(0,parseInt(h.textIndent)):0),p=o.right-(h?parseInt(h.paddingRight):0),g=GO(n,i),m=GO(n,r),$=g.type==Ii.Text?g:null,y=m.type==Ii.Text?m:null;if($&&(n.lineWrapping||g.widgetLineBreaks)&&($=h1(n,i,$)),y&&(n.lineWrapping||m.widgetLineBreaks)&&(y=h1(n,r,y)),$&&y&&$.from==y.from)return x(R(t.from,t.to,$));{let C=$?R(t.from,null,$):A(g,!1),z=y?R(null,t.to,y):A(m,!0),V=[];return($||g).to<(y||m).from-($&&y?1:0)||g.widgetLineBreaks>1&&C.bottom+n.defaultLineHeight/2U&&ae.from=Se)break;ke>ye&&G(Math.max(Ie,ye),C==null&&Ie<=U,Math.min(ke,Se),z==null&&ke>=re,Ue.dir)}if(ye=ge.to+1,ye>=Se)break}return N.length==0&&G(U,C==null,re,z==null,n.textDirection),{top:M,bottom:B,horizontal:N}}function A(C,z){let V=o.top+(z?C.top:C.bottom);return{top:V,bottom:V,horizontal:[]}}}function p3(n,e){return n.constructor==e.constructor&&n.eq(e)}class g3{constructor(e,t){this.view=e,this.layer=t,this.drawn=[],this.scaleX=1,this.scaleY=1,this.measureReq={read:this.measure.bind(this),write:this.draw.bind(this)},this.dom=e.scrollDOM.appendChild(document.createElement("div")),this.dom.classList.add("cm-layer"),t.above&&this.dom.classList.add("cm-layer-above"),t.class&&this.dom.classList.add(t.class),this.scale(),this.dom.setAttribute("aria-hidden","true"),this.setOrder(e.state),e.requestMeasure(this.measureReq),t.mount&&t.mount(this.dom,e)}update(e){e.startState.facet(oc)!=e.state.facet(oc)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,i=e.facet(oc);for(;t!p3(t,this.drawn[i]))){let t=this.dom.firstChild,i=0;for(let r of e)r.update&&t&&r.constructor&&this.drawn[i].constructor&&r.update(t,this.drawn[i])?(t=t.nextSibling,i++):this.dom.insertBefore(r.draw(),t);for(;t;){let r=t.nextSibling;t.remove(),t=r}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const oc=_e.define();function Qy(n){return[li.define(e=>new g3(e,n)),oc.of(n)]}const _y=!We.ios,na=_e.define({combine(n){return br(n,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})}});function m3(n={}){return[na.of(n),S3,b3,$3,B$.of(!0)]}function ky(n){return n.startState.facet(na)!=n.state.facet(na)}const S3=Qy({above:!0,markers(n){let{state:e}=n,t=e.facet(na),i=[];for(let r of e.selection.ranges){let s=r==e.selection.main;if(r.empty?!s||_y:t.drawRangeCursor){let l=s?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",o=r.empty?r:ee.cursor(r.head,r.head>r.anchor?-1:1);for(let a of ma.forRange(n,l,o))i.push(a)}}return i},update(n,e){n.transactions.some(i=>i.selection)&&(e.style.animationName=e.style.animationName=="cm-blink"?"cm-blink2":"cm-blink");let t=ky(n);return t&&O1(n.state,e),n.docChanged||n.selectionSet||t},mount(n,e){O1(e.state,n)},class:"cm-cursorLayer"});function O1(n,e){e.style.animationDuration=n.facet(na).cursorBlinkRate+"ms"}const b3=Qy({above:!1,markers(n){return n.state.selection.ranges.map(e=>e.empty?[]:ma.forRange(n,"cm-selectionBackground",e)).reduce((e,t)=>e.concat(t))},update(n,e){return n.docChanged||n.selectionSet||n.viewportChanged||ky(n)},class:"cm-selectionLayer"}),Py={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};_y&&(Py[".cm-line"].caretColor="transparent !important");const $3=Js.highest(de.theme(Py)),Wy=Ne.define({map(n,e){return n==null?null:e.mapPos(n)}}),zo=pi.define({create(){return null},update(n,e){return n!=null&&(n=e.changes.mapPos(n)),e.effects.reduce((t,i)=>i.is(Wy)?i.value:t,n)}}),y3=li.fromClass(class{constructor(n){this.view=n,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(n){var e;let t=n.state.field(zo);t==null?this.cursor!=null&&((e=this.cursor)===null||e===void 0||e.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(n.startState.field(zo)!=t||n.docChanged||n.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:n}=this,e=n.state.field(zo),t=e!=null&&n.coordsAtPos(e);if(!t)return null;let i=n.scrollDOM.getBoundingClientRect();return{left:t.left-i.left+n.scrollDOM.scrollLeft*n.scaleX,top:t.top-i.top+n.scrollDOM.scrollTop*n.scaleY,height:t.bottom-t.top}}drawCursor(n){if(this.cursor){let{scaleX:e,scaleY:t}=this.view;n?(this.cursor.style.left=n.left/e+"px",this.cursor.style.top=n.top/t+"px",this.cursor.style.height=n.height/t+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(n){this.view.state.field(zo)!=n&&this.view.dispatch({effects:Wy.of(n)})}},{eventObservers:{dragover(n){this.setDropPos(this.view.posAtCoords({x:n.clientX,y:n.clientY}))},dragleave(n){(n.target==this.view.contentDOM||!this.view.contentDOM.contains(n.relatedTarget))&&this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function v3(){return[zo,y3]}function d1(n,e,t,i,r){e.lastIndex=0;for(let s=n.iterRange(t,i),l=t,o;!s.next().done;l+=s.value.length)if(!s.lineBreak)for(;o=e.exec(s.value);)r(l+o.index,o)}function w3(n,e){let t=n.visibleRanges;if(t.length==1&&t[0].from==n.viewport.from&&t[0].to==n.viewport.to)return t;let i=[];for(let{from:r,to:s}of t)r=Math.max(n.state.doc.lineAt(r).from,r-e),s=Math.min(n.state.doc.lineAt(s).to,s+e),i.length&&i[i.length-1].to>=r?i[i.length-1].to=s:i.push({from:r,to:s});return i}class Q3{constructor(e){const{regexp:t,decoration:i,decorate:r,boundary:s,maxLength:l=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,r)this.addMatch=(o,a,c,h)=>r(h,c,c+o[0].length,o,a);else if(typeof i=="function")this.addMatch=(o,a,c,h)=>{let O=i(o,a,c);O&&h(c,c+o[0].length,O)};else if(i)this.addMatch=(o,a,c,h)=>h(c,c+o[0].length,i);else throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.boundary=s,this.maxLength=l}createDeco(e){let t=new ys,i=t.add.bind(t);for(let{from:r,to:s}of w3(e,this.maxLength))d1(e.state.doc,this.regexp,r,s,(l,o)=>this.addMatch(o,e,l,i));return t.finish()}updateDeco(e,t){let i=1e9,r=-1;return e.docChanged&&e.changes.iterChanges((s,l,o,a)=>{a>e.view.viewport.from&&o1e3?this.createDeco(e.view):r>-1?this.updateRange(e.view,t.map(e.changes),i,r):t}updateRange(e,t,i,r){for(let s of e.visibleRanges){let l=Math.max(s.from,i),o=Math.min(s.to,r);if(o>l){let a=e.state.doc.lineAt(l),c=a.toa.from;l--)if(this.boundary.test(a.text[l-1-a.from])){h=l;break}for(;op.push(_.range($,y));if(a==c)for(this.regexp.lastIndex=h-a.from;(g=this.regexp.exec(a.text))&&g.indexthis.addMatch(y,e,$,m));t=t.update({filterFrom:h,filterTo:O,filter:($,y)=>$O,add:p})}}return t}}const td=/x/.unicode!=null?"gu":"g",_3=new RegExp(`[\0-\b +--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\uFEFF-]`,td),k3={0:"null",7:"bell",8:"backspace",10:"newline",11:"vertical tab",13:"carriage return",27:"escape",8203:"zero width space",8204:"zero width non-joiner",8205:"zero width joiner",8206:"left-to-right mark",8207:"right-to-left mark",8232:"line separator",8237:"left-to-right override",8238:"right-to-left override",8294:"left-to-right isolate",8295:"right-to-left isolate",8297:"pop directional isolate",8233:"paragraph separator",65279:"zero width no-break space",65532:"object replacement"};let Bh=null;function P3(){var n;if(Bh==null&&typeof document<"u"&&document.body){let e=document.body.style;Bh=((n=e.tabSize)!==null&&n!==void 0?n:e.MozTabSize)!=null}return Bh||!1}const ac=_e.define({combine(n){let e=br(n,{render:null,specialChars:_3,addSpecialChars:null});return(e.replaceTabs=!P3())&&(e.specialChars=new RegExp(" |"+e.specialChars.source,td)),e.addSpecialChars&&(e.specialChars=new RegExp(e.specialChars.source+"|"+e.addSpecialChars.source,td)),e}});function W3(n={}){return[ac.of(n),x3()]}let p1=null;function x3(){return p1||(p1=li.fromClass(class{constructor(n){this.view=n,this.decorations=Ye.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(n.state.facet(ac)),this.decorations=this.decorator.createDeco(n)}makeDecorator(n){return new Q3({regexp:n.specialChars,decoration:(e,t,i)=>{let{doc:r}=t.state,s=Qi(e[0],0);if(s==9){let l=r.lineAt(i),o=t.state.tabSize,a=Il(l.text,o,i-l.from);return Ye.replace({widget:new R3((o-a%o)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[s]||(this.decorationCache[s]=Ye.replace({widget:new Z3(n,s)}))},boundary:n.replaceTabs?void 0:/[^]/})}update(n){let e=n.state.facet(ac);n.startState.facet(ac)!=e?(this.decorator=this.makeDecorator(e),this.decorations=this.decorator.createDeco(n.view)):this.decorations=this.decorator.updateDeco(n,this.decorations)}},{decorations:n=>n.decorations}))}const C3="•";function T3(n){return n>=32?C3:n==10?"␤":String.fromCharCode(9216+n)}class Z3 extends Lr{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=T3(this.code),i=e.state.phrase("Control character")+" "+(k3[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,i,t);if(r)return r;let s=document.createElement("span");return s.textContent=t,s.title=i,s.setAttribute("aria-label",i),s.className="cm-specialChar",s}ignoreEvent(){return!1}}class R3 extends Lr{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent=" ",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}function X3(){return Y3}const A3=Ye.line({class:"cm-activeLine"}),Y3=li.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 i of n.state.selection.ranges){let r=n.lineBlockAt(i.head);r.from>e&&(t.push(A3.range(r.from)),e=r.from)}return Ye.set(t)}},{decorations:n=>n.decorations}),id=2e3;function U3(n,e,t){let i=Math.min(e.line,t.line),r=Math.max(e.line,t.line),s=[];if(e.off>id||t.off>id||e.col<0||t.col<0){let l=Math.min(e.off,t.off),o=Math.max(e.off,t.off);for(let a=i;a<=r;a++){let c=n.doc.line(a);c.length<=o&&s.push(ee.range(c.from+l,c.to+o))}}else{let l=Math.min(e.col,t.col),o=Math.max(e.col,t.col);for(let a=i;a<=r;a++){let c=n.doc.line(a),h=AO(c.text,l,n.tabSize,!0);if(h<0)s.push(ee.cursor(c.to));else{let O=AO(c.text,o,n.tabSize);s.push(ee.range(c.from+h,c.from+O))}}}return s}function E3(n,e){let t=n.coordsAtPos(n.viewport.from);return t?Math.round(Math.abs((t.left-e)/n.defaultCharacterWidth)):-1}function g1(n,e){let t=n.posAtCoords({x:e.clientX,y:e.clientY},!1),i=n.state.doc.lineAt(t),r=t-i.from,s=r>id?-1:r==i.length?E3(n,e.clientX):Il(i.text,n.state.tabSize,t-i.from);return{line:i.number,col:s,off:r}}function z3(n,e){let t=g1(n,e),i=n.state.selection;return t?{update(r){if(r.docChanged){let s=r.changes.mapPos(r.startState.doc.line(t.line).from),l=r.state.doc.lineAt(s);t={line:l.number,col:t.col,off:Math.min(t.off,l.length)},i=i.map(r.changes)}},get(r,s,l){let o=g1(n,r);if(!o)return i;let a=U3(n.state,t,o);return a.length?l?ee.create(a.concat(i.ranges)):ee.create(a):i}}:null}function M3(n){let e=t=>t.altKey&&t.button==0;return de.mouseSelectionStyle.of((t,i)=>e(i)?z3(t,i):null)}const D3={Alt:[18,n=>!!n.altKey],Control:[17,n=>!!n.ctrlKey],Shift:[16,n=>!!n.shiftKey],Meta:[91,n=>!!n.metaKey]},V3={style:"cursor: crosshair"};function q3(n={}){let[e,t]=D3[n.key||"Alt"],i=li.fromClass(class{constructor(r){this.view=r,this.isDown=!1}set(r){this.isDown!=r&&(this.isDown=r,this.view.update([]))}},{eventObservers:{keydown(r){this.set(r.keyCode==e||t(r))},keyup(r){(r.keyCode==e||!t(r))&&this.set(!1)},mousemove(r){this.set(t(r))}}});return[i,de.contentAttributes.of(r=>{var s;return!((s=r.plugin(i))===null||s===void 0)&&s.isDown?V3:null})]}const Po="-10000px";class xy{constructor(e,t,i){this.facet=t,this.createTooltipView=i,this.input=e.state.facet(t),this.tooltips=this.input.filter(r=>r),this.tooltipViews=this.tooltips.map(i)}update(e,t){var i;let r=e.state.facet(this.facet),s=r.filter(a=>a);if(r===this.input){for(let a of this.tooltipViews)a.update&&a.update(e);return!1}let l=[],o=t?[]:null;for(let a=0;at[c]=a),t.length=o.length),this.input=r,this.tooltips=s,this.tooltipViews=l,!0}}function I3(n){let{win:e}=n;return{top:0,left:0,bottom:e.innerHeight,right:e.innerWidth}}const Fh=_e.define({combine:n=>{var e,t,i;return{position:We.ios?"absolute":((e=n.find(r=>r.position))===null||e===void 0?void 0:e.position)||"fixed",parent:((t=n.find(r=>r.parent))===null||t===void 0?void 0:t.parent)||null,tooltipSpace:((i=n.find(r=>r.tooltipSpace))===null||i===void 0?void 0:i.tooltipSpace)||I3}}}),m1=new WeakMap,Cy=li.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(Fh);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.manager=new xy(n,Xd,t=>this.createTooltip(t)),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,i=n.state.facet(Fh);if(i.position!=this.position&&!this.madeAbsolute){this.position=i.position;for(let r of this.manager.tooltipViews)r.dom.style.position=this.position;t=!0}if(i.parent!=this.parent){this.parent&&this.container.remove(),this.parent=i.parent,this.createContainer();for(let r of this.manager.tooltipViews)this.container.appendChild(r.dom);t=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);t&&this.maybeMeasure()}createTooltip(n){let e=n.create(this.view);if(e.dom.classList.add("cm-tooltip"),n.arrow&&!e.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let t=document.createElement("div");t.className="cm-tooltip-arrow",e.dom.appendChild(t)}return e.dom.style.position=this.position,e.dom.style.top=Po,e.dom.style.left="0px",this.container.appendChild(e.dom),e.mount&&e.mount(this.view),e}destroy(){var n,e;this.view.win.removeEventListener("resize",this.measureSoon);for(let t of this.manager.tooltipViews)t.dom.remove(),(n=t.destroy)===null||n===void 0||n.call(t);this.parent&&this.container.remove(),(e=this.intersectionObserver)===null||e===void 0||e.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let n=this.view.dom.getBoundingClientRect(),e=1,t=1,i=!1;if(this.position=="fixed"&&this.manager.tooltipViews.length){let{dom:r}=this.manager.tooltipViews[0];if(We.gecko)i=r.offsetParent!=this.container.ownerDocument.body;else if(this.view.scaleX!=1||this.view.scaleY!=1)i=!0;else if(r.style.top==Po&&r.style.left=="0px"){let s=r.getBoundingClientRect();i=Math.abs(s.top+1e4)>1||Math.abs(s.left)>1}}if(i||this.position=="absolute")if(this.parent){let r=this.parent.getBoundingClientRect();r.width&&r.height&&(e=r.width/this.parent.offsetWidth,t=r.height/this.parent.offsetHeight)}else({scaleX:e,scaleY:t}=this.view.viewState);return{editor:n,parent:this.parent?this.container.getBoundingClientRect():n,pos:this.manager.tooltips.map((r,s)=>{let l=this.manager.tooltipViews[s];return l.getCoords?l.getCoords(r.pos):this.view.coordsAtPos(r.pos)}),size:this.manager.tooltipViews.map(({dom:r})=>r.getBoundingClientRect()),space:this.view.state.facet(Fh).tooltipSpace(this.view),scaleX:e,scaleY:t,makeAbsolute:i}}writeMeasure(n){var e;if(n.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let o of this.manager.tooltipViews)o.dom.style.position="absolute"}let{editor:t,space:i,scaleX:r,scaleY:s}=n,l=[];for(let o=0;o=Math.min(t.bottom,i.bottom)||O.rightMath.min(t.right,i.right)+.1){h.style.top=Po;continue}let g=a.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,m=g?7:0,$=p.right-p.left,y=(e=m1.get(c))!==null&&e!==void 0?e:p.bottom-p.top,_=c.offset||N3,x=this.view.textDirection==jt.LTR,R=p.width>i.right-i.left?x?i.left:i.right-p.width:x?Math.min(O.left-(g?14:0)+_.x,i.right-$):Math.max(i.left,O.left-$+(g?14:0)-_.x),A=this.above[o];!a.strictSide&&(A?O.top-(p.bottom-p.top)-_.yi.bottom)&&A==i.bottom-O.bottom>O.top-i.top&&(A=this.above[o]=!A);let C=(A?O.top-i.top:i.bottom-O.bottom)-m;if(CR&&M.topz&&(z=A?M.top-y-2-m:M.bottom+m+2);if(this.position=="absolute"?(h.style.top=(z-n.parent.top)/s+"px",h.style.left=(R-n.parent.left)/r+"px"):(h.style.top=z/s+"px",h.style.left=R/r+"px"),g){let M=O.left+(x?_.x:-_.x)-(R+14-7);g.style.left=M/r+"px"}c.overlap!==!0&&l.push({left:R,top:z,right:V,bottom:z+y}),h.classList.toggle("cm-tooltip-above",A),h.classList.toggle("cm-tooltip-below",!A),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=Po}},{eventObservers:{scroll(){this.maybeMeasure()}}}),L3=de.baseTheme({".cm-tooltip":{zIndex:100,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:`${7*2}px`,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"}}}),N3={x:0,y:0},Xd=_e.define({enables:[Cy,L3]}),vc=_e.define();class Ad{static create(e){return new Ad(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new xy(e,vc,t=>this.createHostedView(t))}createHostedView(e){let t=e.create(this.view);return t.dom.classList.add("cm-tooltip-section"),this.dom.appendChild(t.dom),this.mounted&&t.mount&&t.mount(this.view),t}mount(e){for(let t of this.manager.tooltipViews)t.mount&&t.mount(e);this.mounted=!0}positioned(e){for(let t of this.manager.tooltipViews)t.positioned&&t.positioned(e)}update(e){this.manager.update(e)}destroy(){var e;for(let t of this.manager.tooltipViews)(e=t.destroy)===null||e===void 0||e.call(t)}passProp(e){let t;for(let i of this.manager.tooltipViews){let r=i[e];if(r!==void 0){if(t===void 0)t=r;else if(t!==r)return}}return t}get offset(){return this.passProp("offset")}get getCoords(){return this.passProp("getCoords")}get overlap(){return this.passProp("overlap")}get resize(){return this.passProp("resize")}}const j3=Xd.compute([vc],n=>{let e=n.facet(vc).filter(t=>t);return e.length===0?null:{pos:Math.min(...e.map(t=>t.pos)),end:Math.max(...e.filter(t=>t.end!=null).map(t=>t.end)),create:Ad.create,above:e[0].above,arrow:e.some(t=>t.arrow)}});class B3{constructor(e,t,i,r,s){this.view=e,this.source=t,this.field=i,this.setHover=r,this.hoverTime=s,this.hoverTimeout=-1,this.restartTimeout=-1,this.pending=null,this.lastMove={x:0,y:0,target:e.dom,time:0},this.checkHover=this.checkHover.bind(this),e.dom.addEventListener("mouseleave",this.mouseleave=this.mouseleave.bind(this)),e.dom.addEventListener("mousemove",this.mousemove=this.mousemove.bind(this))}update(){this.pending&&(this.pending=null,clearTimeout(this.restartTimeout),this.restartTimeout=setTimeout(()=>this.startHover(),20))}get active(){return this.view.state.field(this.field)}checkHover(){if(this.hoverTimeout=-1,this.active)return;let e=Date.now()-this.lastMove.time;eo.bottom||t.xo.right+e.defaultCharacterWidth)return;let a=e.bidiSpans(e.state.doc.lineAt(r)).find(h=>h.from<=r&&h.to>=r),c=a&&a.dir==jt.RTL?-1:1;s=t.x{this.pending==o&&(this.pending=null,a&&e.dispatch({effects:this.setHover.of(a)}))},a=>An(e.state,a,"hover tooltip"))}else l&&e.dispatch({effects:this.setHover.of(l)})}mousemove(e){var t;this.lastMove={x:e.clientX,y:e.clientY,target:e.target,time:Date.now()},this.hoverTimeout<0&&(this.hoverTimeout=setTimeout(this.checkHover,this.hoverTime));let i=this.active;if(i&&!S1(this.lastMove.target)||this.pending){let{pos:r}=i||this.pending,s=(t=i==null?void 0:i.end)!==null&&t!==void 0?t:r;(r==s?this.view.posAtCoords(this.lastMove)!=r:!F3(this.view,r,s,e.clientX,e.clientY))&&(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1,this.active&&!S1(e.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function S1(n){for(let e=n;e;e=e.parentNode)if(e.nodeType==1&&e.classList.contains("cm-tooltip"))return!0;return!1}function F3(n,e,t,i,r,s){let l=n.scrollDOM.getBoundingClientRect(),o=n.documentTop+n.documentPadding.top+n.contentHeight;if(l.left>i||l.rightr||Math.min(l.bottom,o)=e&&a<=t}function G3(n,e={}){let t=Ne.define(),i=pi.define({create(){return null},update(r,s){if(r&&(e.hideOnChange&&(s.docChanged||s.selection)||e.hideOn&&e.hideOn(s,r)))return null;if(r&&s.docChanged){let l=s.changes.mapPos(r.pos,-1,ki.TrackDel);if(l==null)return null;let o=Object.assign(Object.create(null),r);o.pos=l,r.end!=null&&(o.end=s.changes.mapPos(r.end)),r=o}for(let l of s.effects)l.is(t)&&(r=l.value),l.is(H3)&&(r=null);return r},provide:r=>vc.from(r)});return[i,li.define(r=>new B3(r,n,i,t,e.hoverTime||300)),j3]}function Ty(n,e){let t=n.plugin(Cy);if(!t)return null;let i=t.manager.tooltips.indexOf(e);return i<0?null:t.manager.tooltipViews[i]}const H3=Ne.define(),b1=_e.define({combine(n){let e,t;for(let i of n)e=e||i.topContainer,t=t||i.bottomContainer;return{topContainer:e,bottomContainer:t}}});function ra(n,e){let t=n.plugin(Zy),i=t?t.specs.indexOf(e):-1;return i>-1?t.panels[i]:null}const Zy=li.fromClass(class{constructor(n){this.input=n.state.facet(sa),this.specs=this.input.filter(t=>t),this.panels=this.specs.map(t=>t(n));let e=n.state.facet(b1);this.top=new Df(n,!0,e.topContainer),this.bottom=new Df(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(b1);this.top.container!=e.topContainer&&(this.top.sync([]),this.top=new Df(n.view,!0,e.topContainer)),this.bottom.container!=e.bottomContainer&&(this.bottom.sync([]),this.bottom=new Df(n.view,!1,e.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let t=n.state.facet(sa);if(t!=this.input){let i=t.filter(a=>a),r=[],s=[],l=[],o=[];for(let a of i){let c=this.specs.indexOf(a),h;c<0?(h=a(n.view),o.push(h)):(h=this.panels[c],h.update&&h.update(n)),r.push(h),(h.top?s:l).push(h)}this.specs=i,this.panels=r,this.top.sync(s),this.bottom.sync(l);for(let a of o)a.dom.classList.add("cm-panel"),a.mount&&a.mount()}else for(let i of this.panels)i.update&&i.update(n)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return t&&{top:t.top.scrollMargin(),bottom:t.bottom.scrollMargin()}})});class Df{constructor(e,t,i){this.view=e,this.top=t,this.container=i,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=$1(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=$1(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 $1(n){let e=n.nextSibling;return n.remove(),e}const sa=_e.define({enables:Zy});class qr extends Gs{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}qr.prototype.elementClass="";qr.prototype.toDOM=void 0;qr.prototype.mapMode=ki.TrackBefore;qr.prototype.startSide=qr.prototype.endSide=-1;qr.prototype.point=!0;const fc=_e.define(),K3={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>vt.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},jo=_e.define();function J3(n){return[Ry(),jo.of(Object.assign(Object.assign({},K3),n))]}const y1=_e.define({combine:n=>n.some(e=>e)});function Ry(n){return[eC]}const eC=li.fromClass(class{constructor(n){this.view=n,this.prevViewport=n.viewport,this.dom=document.createElement("div"),this.dom.className="cm-gutters",this.dom.setAttribute("aria-hidden","true"),this.dom.style.minHeight=this.view.contentHeight/this.view.scaleY+"px",this.gutters=n.state.facet(jo).map(e=>new w1(n,e));for(let e of this.gutters)this.dom.appendChild(e.dom);this.fixed=!n.state.facet(y1),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),n.scrollDOM.insertBefore(this.dom,n.contentDOM)}update(n){if(this.updateGutters(n)){let e=this.prevViewport,t=n.view.viewport,i=Math.min(e.to,t.to)-Math.max(e.from,t.from);this.syncGutters(i<(t.to-t.from)*.8)}n.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(y1)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=n.view.viewport}syncGutters(n){let e=this.dom.nextSibling;n&&this.dom.remove();let t=vt.iter(this.view.state.facet(fc),this.view.viewport.from),i=[],r=this.gutters.map(s=>new tC(s,this.view.viewport,-this.view.documentPadding.top));for(let s of this.view.viewportLineBlocks)if(i.length&&(i=[]),Array.isArray(s.type)){let l=!0;for(let o of s.type)if(o.type==Ii.Text&&l){nd(t,i,o.from);for(let a of r)a.line(this.view,o,i);l=!1}else if(o.widget)for(let a of r)a.widget(this.view,o)}else if(s.type==Ii.Text){nd(t,i,s.from);for(let l of r)l.line(this.view,s,i)}else if(s.widget)for(let l of r)l.widget(this.view,s);for(let s of r)s.finish();n&&this.view.scrollDOM.insertBefore(this.dom,e)}updateGutters(n){let e=n.startState.facet(jo),t=n.state.facet(jo),i=n.docChanged||n.heightChanged||n.viewportChanged||!vt.eq(n.startState.facet(fc),n.state.facet(fc),n.view.viewport.from,n.view.viewport.to);if(e==t)for(let r of this.gutters)r.update(n)&&(i=!0);else{i=!0;let r=[];for(let s of t){let l=e.indexOf(s);l<0?r.push(new w1(this.view,s)):(this.gutters[l].update(n),r.push(this.gutters[l]))}for(let s of this.gutters)s.dom.remove(),r.indexOf(s)<0&&s.destroy();for(let s of r)this.dom.appendChild(s.dom);this.gutters=r}return i}destroy(){for(let n of this.gutters)n.destroy();this.dom.remove()}},{provide:n=>de.scrollMargins.of(e=>{let t=e.plugin(n);return!t||t.gutters.length==0||!t.fixed?null:e.textDirection==jt.LTR?{left:t.dom.offsetWidth*e.scaleX}:{right:t.dom.offsetWidth*e.scaleX}})});function v1(n){return Array.isArray(n)?n:[n]}function nd(n,e,t){for(;n.value&&n.from<=t;)n.from==t&&e.push(n.value),n.next()}class tC{constructor(e,t,i){this.gutter=e,this.height=i,this.i=0,this.cursor=vt.iter(e.markers,t.from)}addElement(e,t,i){let{gutter:r}=this,s=(t.top-this.height)/e.scaleY,l=t.height/e.scaleY;if(this.i==r.elements.length){let o=new Xy(e,l,s,i);r.elements.push(o),r.dom.appendChild(o.dom)}else r.elements[this.i].update(e,l,s,i);this.height=t.bottom,this.i++}line(e,t,i){let r=[];nd(this.cursor,r,t.from),i.length&&(r=r.concat(i));let s=this.gutter.config.lineMarker(e,t,r);s&&r.unshift(s);let l=this.gutter;r.length==0&&!l.config.renderEmptyElements||this.addElement(e,t,r)}widget(e,t){let i=this.gutter.config.widgetMarker(e,t.widget,t);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 w1{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 i in t.domEventHandlers)this.dom.addEventListener(i,r=>{let s=r.target,l;if(s!=this.dom&&this.dom.contains(s)){for(;s.parentNode!=this.dom;)s=s.parentNode;let a=s.getBoundingClientRect();l=(a.top+a.bottom)/2}else l=r.clientY;let o=e.lineBlockAtHeight(l-e.documentTop);t.domEventHandlers[i](e,o,r)&&r.preventDefault()});this.markers=v1(t.markers(e)),t.initialSpacer&&(this.spacer=new Xy(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=v1(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let r=this.config.updateSpacer(this.spacer.markers[0],e);r!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[r])}let i=e.view.viewport;return!vt.eq(this.markers,t,i.from,i.to)||(this.config.lineMarkerChange?this.config.lineMarkerChange(e):!1)}destroy(){for(let e of this.elements)e.destroy()}}class Xy{constructor(e,t,i,r){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,i,r)}update(e,t,i,r){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=i&&(this.dom.style.marginTop=(this.above=i)?i+"px":""),iC(this.markers,r)||this.setMarkers(e,r)}setMarkers(e,t){let i="cm-gutterElement",r=this.dom.firstChild;for(let s=0,l=0;;){let o=l,a=ss(o,a,c)||l(o,a,c):l}return i}})}});class Gh extends qr{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(wl).formatNumber(e,n.state)}const rC=jo.compute([wl],n=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers(e){return e.state.facet(nC)},lineMarker(e,t,i){return i.some(r=>r.toDOM)?null:new Gh(Hh(e,e.state.doc.lineAt(t.from).number))},widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(wl)!=e.state.facet(wl),initialSpacer(e){return new Gh(Hh(e,Q1(e.state.doc.lines)))},updateSpacer(e,t){let i=Hh(t.view,Q1(t.view.state.doc.lines));return i==e.number?e:new Gh(i)},domEventHandlers:n.facet(wl).domEventHandlers}));function sC(n={}){return[wl.of(n),Ry(),rC]}function Q1(n){let e=9;for(;e{let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.head).from;r>t&&(t=r,e.push(lC.range(r)))}return vt.of(e)});function aC(){return oC}function fC(n){let e;return{c(){e=k("div"),v(e,"class","mzn-editor svelte-1fycn7h")},m(t,i){Y(t,e,i),n[7](e)},p:Qe,i:Qe,o:Qe,d(t){t&&X(e),n[7](null)}}}function cC(n,e,t){let{state:i}=e,r,s;Hc(()=>{t(6,s=new de({parent:r}))});function l(){return s||null}function o(){return s?s.state:null}async function a(O){s&&(await Fn(),s.dispatch({selection:{anchor:O}}))}function c(){s.focus()}function h(O){Et[O?"unshift":"push"](()=>{r=O,t(0,r)})}return n.$$set=O=>{"state"in O&&t(1,i=O.state)},n.$$.update=()=>{n.$$.dirty&66&&s&&i&&s.state!==i&&s.setState(i)},[r,i,l,o,a,c,s,h]}class uC extends $i{constructor(e){super(),bi(this,e,cC,fC,Oi,{state:1,getView:2,getState:3,setCursor:4,focus:5})}get getView(){return this.$$.ctx[2]}get getState(){return this.$$.ctx[3]}get setCursor(){return this.$$.ctx[4]}get focus(){return this.$$.ctx[5]}}var xn=typeof window<"u"?window:null,Yd=xn===null,la=Yd?void 0:xn.document,Ln="addEventListener",Nn="removeEventListener",Kh="getBoundingClientRect",Wo="_a",jn="_b",Yr="_c",Vf="horizontal",Bn=function(){return!1},hC=Yd?"calc":["","-webkit-","-moz-","-o-"].filter(function(n){var e=la.createElement("div");return e.style.cssText="width:"+n+"calc(9px)",!!e.style.length}).shift()+"calc",Ay=function(n){return typeof n=="string"||n instanceof String},_1=function(n){if(Ay(n)){var e=la.querySelector(n);if(!e)throw new Error("Selector "+n+" did not match a DOM element");return e}return n},Ci=function(n,e,t){var i=n[e];return i!==void 0?i:t},qf=function(n,e,t,i){if(e){if(i==="end")return 0;if(i==="center")return n/2}else if(t){if(i==="start")return 0;if(i==="center")return n/2}return n},OC=function(n,e){var t=la.createElement("div");return t.className="gutter gutter-"+e,t},dC=function(n,e,t){var i={};return Ay(e)?i[n]=e:i[n]=hC+"("+e+"% - "+t+"px)",i},pC=function(n,e){var t;return t={},t[n]=e+"px",t},gC=function(n,e){if(e===void 0&&(e={}),Yd)return{};var t=n,i,r,s,l,o,a;Array.from&&(t=Array.from(t));var c=_1(t[0]),h=c.parentNode,O=getComputedStyle?getComputedStyle(h):null,p=O?O.flexDirection:null,g=Ci(e,"sizes")||t.map(function(){return 100/t.length}),m=Ci(e,"minSize",100),$=Array.isArray(m)?m:t.map(function(){return m}),y=Ci(e,"maxSize",1/0),_=Array.isArray(y)?y:t.map(function(){return y}),x=Ci(e,"expandToMin",!1),R=Ci(e,"gutterSize",10),A=Ci(e,"gutterAlign","center"),C=Ci(e,"snapOffset",30),z=Array.isArray(C)?C:t.map(function(){return C}),V=Ci(e,"dragInterval",1),M=Ci(e,"direction",Vf),B=Ci(e,"cursor",M===Vf?"col-resize":"row-resize"),N=Ci(e,"gutter",OC),G=Ci(e,"elementStyle",dC),U=Ci(e,"gutterStyle",pC);M===Vf?(i="width",r="clientX",s="left",l="right",o="clientWidth"):M==="vertical"&&(i="height",r="clientY",s="top",l="bottom",o="clientHeight");function re(oe,H,ue,ce){var Ee=G(i,H,ue,ce);Object.keys(Ee).forEach(function(tt){oe.style[tt]=Ee[tt]})}function ae(oe,H,ue){var ce=U(i,H,ue);Object.keys(ce).forEach(function(Ee){oe.style[Ee]=ce[Ee]})}function ye(){return a.map(function(oe){return oe.size})}function Se(oe){return"touches"in oe?oe.touches[0][r]:oe[r]}function ge(oe){var H=a[this.a],ue=a[this.b],ce=H.size+ue.size;H.size=oe/this.size*ce,ue.size=ce-oe/this.size*ce,re(H.element,H.size,this[jn],H.i),re(ue.element,ue.size,this[Yr],ue.i)}function Ue(oe){var H,ue=a[this.a],ce=a[this.b];this.dragging&&(H=Se(oe)-this.start+(this[jn]-this.dragOffset),V>1&&(H=Math.round(H/V)*V),H<=ue.minSize+ue.snapOffset+this[jn]?H=ue.minSize+this[jn]:H>=this.size-(ce.minSize+ce.snapOffset+this[Yr])&&(H=this.size-(ce.minSize+this[Yr])),H>=ue.maxSize-ue.snapOffset+this[jn]?H=ue.maxSize+this[jn]:H<=this.size-(ce.maxSize-ce.snapOffset+this[Yr])&&(H=this.size-(ce.maxSize+this[Yr])),ge.call(this,H),Ci(e,"onDrag",Bn)(ye()))}function Ie(){var oe=a[this.a].element,H=a[this.b].element,ue=oe[Kh](),ce=H[Kh]();this.size=ue[i]+ce[i]+this[jn]+this[Yr],this.start=ue[s],this.end=ue[l]}function ke(oe){if(!getComputedStyle)return null;var H=getComputedStyle(oe);if(!H)return null;var ue=oe[o];return ue===0?null:(M===Vf?ue-=parseFloat(H.paddingLeft)+parseFloat(H.paddingRight):ue-=parseFloat(H.paddingTop)+parseFloat(H.paddingBottom),ue)}function xe(oe){var H=ke(h);if(H===null||$.reduce(function(tt,ft){return tt+ft},0)>H)return oe;var ue=0,ce=[],Ee=oe.map(function(tt,ft){var je=H*tt/100,At=qf(R,ft===0,ft===oe.length-1,A),ut=$[ft]+At;return je0&&ce[ft]-ue>0){var At=Math.min(ue,ce[ft]-ue);ue-=At,je=tt-At}return je/H*100})}function lt(){var oe=this,H=a[oe.a].element,ue=a[oe.b].element;oe.dragging&&Ci(e,"onDragEnd",Bn)(ye()),oe.dragging=!1,xn[Nn]("mouseup",oe.stop),xn[Nn]("touchend",oe.stop),xn[Nn]("touchcancel",oe.stop),xn[Nn]("mousemove",oe.move),xn[Nn]("touchmove",oe.move),oe.stop=null,oe.move=null,H[Nn]("selectstart",Bn),H[Nn]("dragstart",Bn),ue[Nn]("selectstart",Bn),ue[Nn]("dragstart",Bn),H.style.userSelect="",H.style.webkitUserSelect="",H.style.MozUserSelect="",H.style.pointerEvents="",ue.style.userSelect="",ue.style.webkitUserSelect="",ue.style.MozUserSelect="",ue.style.pointerEvents="",oe.gutter.style.cursor="",oe.parent.style.cursor="",la.body.style.cursor=""}function Vt(oe){if(!("button"in oe&&oe.button!==0)){var H=this,ue=a[H.a].element,ce=a[H.b].element;H.dragging||Ci(e,"onDragStart",Bn)(ye()),oe.preventDefault(),H.dragging=!0,H.move=Ue.bind(H),H.stop=lt.bind(H),xn[Ln]("mouseup",H.stop),xn[Ln]("touchend",H.stop),xn[Ln]("touchcancel",H.stop),xn[Ln]("mousemove",H.move),xn[Ln]("touchmove",H.move),ue[Ln]("selectstart",Bn),ue[Ln]("dragstart",Bn),ce[Ln]("selectstart",Bn),ce[Ln]("dragstart",Bn),ue.style.userSelect="none",ue.style.webkitUserSelect="none",ue.style.MozUserSelect="none",ue.style.pointerEvents="none",ce.style.userSelect="none",ce.style.webkitUserSelect="none",ce.style.MozUserSelect="none",ce.style.pointerEvents="none",H.gutter.style.cursor=B,H.parent.style.cursor=B,la.body.style.cursor=B,Ie.call(H),H.dragOffset=Se(oe)-H.end}}g=xe(g);var Qt=[];a=t.map(function(oe,H){var ue={element:_1(oe),size:g[H],minSize:$[H],maxSize:_[H],snapOffset:z[H],i:H},ce;if(H>0&&(ce={a:H-1,b:H,dragging:!1,direction:M,parent:h},ce[jn]=qf(R,H-1===0,!1,A),ce[Yr]=qf(R,!1,H===t.length-1,A),p==="row-reverse"||p==="column-reverse")){var Ee=ce.a;ce.a=ce.b,ce.b=Ee}if(H>0){var tt=N(H,M,ue.element);ae(tt,R,H),ce[Wo]=Vt.bind(ce),tt[Ln]("mousedown",ce[Wo]),tt[Ln]("touchstart",ce[Wo]),h.insertBefore(tt,ue.element),ce.gutter=tt}return re(ue.element,ue.size,qf(R,H===0,H===t.length-1,A),H),H>0&&Qt.push(ce),ue});function pt(oe){var H=oe.i===Qt.length,ue=H?Qt[oe.i-1]:Qt[oe.i];Ie.call(ue);var ce=H?ue.size-oe.minSize-ue[Yr]:oe.minSize+ue[jn];ge.call(ue,ce)}a.forEach(function(oe){var H=oe.element[Kh]()[i];H0){var Ee=Qt[ce-1],tt=a[Ee.a],ft=a[Ee.b];tt.size=H[ce-1],ft.size=ue,re(tt.element,tt.size,Ee[jn],tt.i),re(ft.element,ft.size,Ee[Yr],ft.i)}})}function $e(oe,H){Qt.forEach(function(ue){if(H!==!0?ue.parent.removeChild(ue.gutter):(ue.gutter[Nn]("mousedown",ue[Wo]),ue.gutter[Nn]("touchstart",ue[Wo])),oe!==!0){var ce=G(i,ue.a.size,ue[jn]);Object.keys(ce).forEach(function(Ee){a[ue.a].element.style[Ee]="",a[ue.b].element.style[Ee]=""})}})}return{setSizes:qt,getSizes:ye,collapse:function(H){pt(a[H])},destroy:$e,parent:h,pairs:Qt}};const mC=n=>({}),k1=n=>({}),SC=n=>({}),P1=n=>({});function bC(n){let e,t,i,r,s;const l=n[6].panelA,o=Zi(l,n,n[5],P1),a=n[6].panelB,c=Zi(a,n,n[5],k1);return{c(){e=k("div"),t=k("div"),o&&o.c(),i=L(),r=k("div"),c&&c.c(),v(t,"class","split-panel svelte-1k68mj4"),ne(t,"no-splitter",n[1]!=="all"),ne(t,"is-hidden",!If("a",n[1])),v(r,"class","split-panel svelte-1k68mj4"),ne(r,"no-splitter",n[1]!=="all"),ne(r,"is-hidden",!If("b",n[1])),v(e,"class","split svelte-1k68mj4"),ne(e,"horizontal",n[0]==="horizontal")},m(h,O){Y(h,e,O),Q(e,t),o&&o.m(t,null),n[7](t),Q(e,i),Q(e,r),c&&c.m(r,null),n[8](r),s=!0},p(h,[O]){o&&o.p&&(!s||O&32)&&Xi(o,l,h,h[5],s?Ri(l,h[5],O,SC):Ai(h[5]),P1),(!s||O&2)&&ne(t,"no-splitter",h[1]!=="all"),(!s||O&2)&&ne(t,"is-hidden",!If("a",h[1])),c&&c.p&&(!s||O&32)&&Xi(c,a,h,h[5],s?Ri(a,h[5],O,mC):Ai(h[5]),k1),(!s||O&2)&&ne(r,"no-splitter",h[1]!=="all"),(!s||O&2)&&ne(r,"is-hidden",!If("b",h[1])),(!s||O&1)&&ne(e,"horizontal",h[0]==="horizontal")},i(h){s||(D(o,h),D(c,h),s=!0)},o(h){j(o,h),j(c,h),s=!1},d(h){h&&X(e),o&&o.d(h),n[7](null),c&&c.d(h),n[8](null)}}}function If(n,e){return e==="all"||e===n}function $C(n,e,t){let{$$slots:i={},$$scope:r}=e,{direction:s="horizontal"}=e,{split:l=50}=e,{showPanels:o="all"}=e,a,c,h=null;function O(y,_){p(),_==="all"&&a&&c&&(h=gC([a,c],{direction:y,minSize:0,sizes:[l,100-l],onDragEnd(x){t(4,l=x[0])}}))}function p(){h&&(h.destroy(),h=null)}function g(y){h&&h.getSizes()[0]!==y&&h.setSizes([y,100-y])}Hc(()=>(O(s,o),p));function m(y){Et[y?"unshift":"push"](()=>{a=y,t(2,a)})}function $(y){Et[y?"unshift":"push"](()=>{c=y,t(3,c)})}return n.$$set=y=>{"direction"in y&&t(0,s=y.direction),"split"in y&&t(4,l=y.split),"showPanels"in y&&t(1,o=y.showPanels),"$$scope"in y&&t(5,r=y.$$scope)},n.$$.update=()=>{n.$$.dirty&3&&O(s,o),n.$$.dirty&16&&g(l)},[s,o,a,c,l,r,i,m,$]}class yC extends $i{constructor(e){super(),bi(this,e,$C,bC,Oi,{direction:0,split:4,showPanels:1})}}function vC(n,e){e&&e!=="lg"&&e!=="sm"&&e!=="xs"?n.style.fontSize=e.replace("x","em"):n.style.fontSize=""}function wC(n,e,t,i,r,s=1,l="",o=""){let a=1,c=1;r&&(r=="horizontal"?a=-1:r=="vertical"?c=-1:a=c=-1),typeof n=="string"&&(n=parseFloat(n)),typeof e=="string"&&(e=parseFloat(e)),typeof t=="string"&&(t=parseFloat(t));const h=`${e*s}${l}`,O=`${t*s}${l}`;let p=`translate(${h},${O}) scale(${a*n},${c*n})`;return i&&(p+=` rotate(${i}${o})`),p}function W1(n){let e,t,i,r,s,l,o,a=n[3]&&x1(n);function c(p,g){return typeof p[17][4]=="string"?_C:QC}let h=c(n),O=h(n);return{c(){e=Fs("svg"),a&&a.c(),t=Fs("g"),i=Fs("g"),O.c(),v(i,"transform",n[16]),v(t,"transform",r="translate("+n[17][0]/2+" "+n[17][1]/2+")"),v(t,"transform-origin",s=n[17][0]/4+" 0"),v(e,"id",n[1]),v(e,"class",l="svelte-fa svelte-fa-base "+n[0]+" svelte-bvo74f"),v(e,"style",n[2]),v(e,"viewBox",o="0 0 "+n[17][0]+" "+n[17][1]),v(e,"aria-hidden","true"),v(e,"role","img"),v(e,"xmlns","http://www.w3.org/2000/svg"),ne(e,"pulse",n[9]),ne(e,"svelte-fa-size-lg",n[4]==="lg"),ne(e,"svelte-fa-size-sm",n[4]==="sm"),ne(e,"svelte-fa-size-xs",n[4]==="xs"),ne(e,"svelte-fa-fw",n[6]),ne(e,"svelte-fa-pull-left",n[7]==="left"),ne(e,"svelte-fa-pull-right",n[7]==="right"),ne(e,"spin",n[8])},m(p,g){Y(p,e,g),a&&a.m(e,null),Q(e,t),Q(t,i),O.m(i,null),n[24](e)},p(p,g){p[3]?a?a.p(p,g):(a=x1(p),a.c(),a.m(e,t)):a&&(a.d(1),a=null),h===(h=c(p))&&O?O.p(p,g):(O.d(1),O=h(p),O&&(O.c(),O.m(i,null))),g&65536&&v(i,"transform",p[16]),g&131072&&r!==(r="translate("+p[17][0]/2+" "+p[17][1]/2+")")&&v(t,"transform",r),g&131072&&s!==(s=p[17][0]/4+" 0")&&v(t,"transform-origin",s),g&2&&v(e,"id",p[1]),g&1&&l!==(l="svelte-fa svelte-fa-base "+p[0]+" svelte-bvo74f")&&v(e,"class",l),g&4&&v(e,"style",p[2]),g&131072&&o!==(o="0 0 "+p[17][0]+" "+p[17][1])&&v(e,"viewBox",o),g&513&&ne(e,"pulse",p[9]),g&17&&ne(e,"svelte-fa-size-lg",p[4]==="lg"),g&17&&ne(e,"svelte-fa-size-sm",p[4]==="sm"),g&17&&ne(e,"svelte-fa-size-xs",p[4]==="xs"),g&65&&ne(e,"svelte-fa-fw",p[6]),g&129&&ne(e,"svelte-fa-pull-left",p[7]==="left"),g&129&&ne(e,"svelte-fa-pull-right",p[7]==="right"),g&257&&ne(e,"spin",p[8])},d(p){p&&X(e),a&&a.d(),O.d(),n[24](null)}}}function x1(n){let e,t;return{c(){e=Fs("title"),t=pe(n[3])},m(i,r){Y(i,e,r),Q(e,t)},p(i,r){r&8&&Le(t,i[3])},d(i){i&&X(e)}}}function QC(n){let e,t,i,r,s,l,o,a,c,h;return{c(){e=Fs("path"),l=Fs("path"),v(e,"d",t=n[17][4][0]),v(e,"fill",i=n[11]||n[5]||"currentColor"),v(e,"fill-opacity",r=n[14]!=!1?n[12]:n[13]),v(e,"transform",s="translate("+n[17][0]/-2+" "+n[17][1]/-2+")"),v(l,"d",o=n[17][4][1]),v(l,"fill",a=n[10]||n[5]||"currentColor"),v(l,"fill-opacity",c=n[14]!=!1?n[13]:n[12]),v(l,"transform",h="translate("+n[17][0]/-2+" "+n[17][1]/-2+")")},m(O,p){Y(O,e,p),Y(O,l,p)},p(O,p){p&131072&&t!==(t=O[17][4][0])&&v(e,"d",t),p&2080&&i!==(i=O[11]||O[5]||"currentColor")&&v(e,"fill",i),p&28672&&r!==(r=O[14]!=!1?O[12]:O[13])&&v(e,"fill-opacity",r),p&131072&&s!==(s="translate("+O[17][0]/-2+" "+O[17][1]/-2+")")&&v(e,"transform",s),p&131072&&o!==(o=O[17][4][1])&&v(l,"d",o),p&1056&&a!==(a=O[10]||O[5]||"currentColor")&&v(l,"fill",a),p&28672&&c!==(c=O[14]!=!1?O[13]:O[12])&&v(l,"fill-opacity",c),p&131072&&h!==(h="translate("+O[17][0]/-2+" "+O[17][1]/-2+")")&&v(l,"transform",h)},d(O){O&&(X(e),X(l))}}}function _C(n){let e,t,i,r;return{c(){e=Fs("path"),v(e,"d",t=n[17][4]),v(e,"fill",i=n[5]||n[10]||"currentColor"),v(e,"transform",r="translate("+n[17][0]/-2+" "+n[17][1]/-2+")")},m(s,l){Y(s,e,l)},p(s,l){l&131072&&t!==(t=s[17][4])&&v(e,"d",t),l&1056&&i!==(i=s[5]||s[10]||"currentColor")&&v(e,"fill",i),l&131072&&r!==(r="translate("+s[17][0]/-2+" "+s[17][1]/-2+")")&&v(e,"transform",r)},d(s){s&&X(e)}}}function kC(n){let e,t=n[17][4]&&W1(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,[r]){i[17][4]?t?t.p(i,r):(t=W1(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Qe,o:Qe,d(i){i&&X(e),t&&t.d(i)}}}function PC(n,e,t){let i,r,{class:s=void 0}=e,{id:l=void 0}=e,{style:o=void 0}=e,{icon:a}=e,{title:c=void 0}=e,{size:h=void 0}=e,{color:O=void 0}=e,{fw:p=!1}=e,{pull:g=void 0}=e,{scale:m=1}=e,{translateX:$=0}=e,{translateY:y=0}=e,{rotate:_=void 0}=e,{flip:x=void 0}=e,{spin:R=!1}=e,{pulse:A=!1}=e,{primaryColor:C=""}=e,{secondaryColor:z=""}=e,{primaryOpacity:V=1}=e,{secondaryOpacity:M=.4}=e,{swapOpacity:B=!1}=e,N;function G(U){Et[U?"unshift":"push"](()=>{N=U,t(15,N)})}return n.$$set=U=>{"class"in U&&t(0,s=U.class),"id"in U&&t(1,l=U.id),"style"in U&&t(2,o=U.style),"icon"in U&&t(18,a=U.icon),"title"in U&&t(3,c=U.title),"size"in U&&t(4,h=U.size),"color"in U&&t(5,O=U.color),"fw"in U&&t(6,p=U.fw),"pull"in U&&t(7,g=U.pull),"scale"in U&&t(19,m=U.scale),"translateX"in U&&t(20,$=U.translateX),"translateY"in U&&t(21,y=U.translateY),"rotate"in U&&t(22,_=U.rotate),"flip"in U&&t(23,x=U.flip),"spin"in U&&t(8,R=U.spin),"pulse"in U&&t(9,A=U.pulse),"primaryColor"in U&&t(10,C=U.primaryColor),"secondaryColor"in U&&t(11,z=U.secondaryColor),"primaryOpacity"in U&&t(12,V=U.primaryOpacity),"secondaryOpacity"in U&&t(13,M=U.secondaryOpacity),"swapOpacity"in U&&t(14,B=U.swapOpacity)},n.$$.update=()=>{n.$$.dirty&32784&&N&&h&&vC(N,h),n.$$.dirty&262144&&t(17,i=a&&a.icon||[0,0,"",[],""]),n.$$.dirty&16252928&&t(16,r=wC(m,$,y,_,x,512))},[s,l,o,c,h,O,p,g,R,A,C,z,V,M,B,N,r,i,a,m,$,y,_,x,G]}class wt extends $i{constructor(e){super(),bi(this,e,PC,kC,Oi,{class:0,id:1,style:2,icon:18,title:3,size:4,color:5,fw:6,pull:7,scale:19,translateX:20,translateY:21,rotate:22,flip:23,spin:8,pulse:9,primaryColor:10,secondaryColor:11,primaryOpacity:12,secondaryOpacity:13,swapOpacity:14})}}const rd={prefix:"fas",iconName:"lock",icon:[448,512,[128274],"f023","M144 144l0 48 160 0 0-48c0-44.2-35.8-80-80-80s-80 35.8-80 80zM80 192l0-48C80 64.5 144.5 0 224 0s144 64.5 144 144l0 48 16 0c35.3 0 64 28.7 64 64l0 192c0 35.3-28.7 64-64 64L64 512c-35.3 0-64-28.7-64-64L0 256c0-35.3 28.7-64 64-64l16 0z"]},Yy={prefix:"fas",iconName:"share-nodes",icon:[448,512,["share-alt"],"f1e0","M352 224c53 0 96-43 96-96s-43-96-96-96s-96 43-96 96c0 4 .2 8 .7 11.9l-94.1 47C145.4 170.2 121.9 160 96 160c-53 0-96 43-96 96s43 96 96 96c25.9 0 49.4-10.2 66.6-26.9l94.1 47c-.5 3.9-.7 7.8-.7 11.9c0 53 43 96 96 96s96-43 96-96s-43-96-96-96c-25.9 0-49.4 10.2-66.6 26.9l-94.1-47c.5-3.9 .7-7.8 .7-11.9s-.2-8-.7-11.9l94.1-47C302.6 213.8 326.1 224 352 224z"]},C1={prefix:"fas",iconName:"eye-slash",icon:[640,512,[],"f070","M38.8 5.1C28.4-3.1 13.3-1.2 5.1 9.2S-1.2 34.7 9.2 42.9l592 464c10.4 8.2 25.5 6.3 33.7-4.1s6.3-25.5-4.1-33.7L525.6 386.7c39.6-40.6 66.4-86.1 79.9-118.4c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C465.5 68.8 400.8 32 320 32c-68.2 0-125 26.3-169.3 60.8L38.8 5.1zM223.1 149.5C248.6 126.2 282.7 112 320 112c79.5 0 144 64.5 144 144c0 24.9-6.3 48.3-17.4 68.7L408 294.5c8.4-19.3 10.6-41.4 4.8-63.3c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3c0 10.2-2.4 19.8-6.6 28.3l-90.3-70.8zM373 389.9c-16.4 6.5-34.3 10.1-53 10.1c-79.5 0-144-64.5-144-144c0-6.9 .5-13.6 1.4-20.2L83.1 161.5C60.3 191.2 44 220.8 34.5 243.7c-3.3 7.9-3.3 16.7 0 24.6c14.9 35.7 46.2 87.7 93 131.1C174.5 443.2 239.2 480 320 480c47.8 0 89.9-12.9 126.2-32.5L373 389.9z"]},WC={prefix:"fas",iconName:"shuffle",icon:[512,512,[128256,"random"],"f074","M403.8 34.4c12-5 25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-10.1 0-19.6 4.7-25.6 12.8L284 229.3 244 176l31.2-41.6C293.3 110.2 321.8 96 352 96l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6zM164 282.7L204 336l-31.2 41.6C154.7 401.8 126.2 416 96 416l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c10.1 0 19.6-4.7 25.6-12.8L164 282.7zm274.6 188c-9.2 9.2-22.9 11.9-34.9 6.9s-19.8-16.6-19.8-29.6l0-32-32 0c-30.2 0-58.7-14.2-76.8-38.4L121.6 172.8c-6-8.1-15.5-12.8-25.6-12.8l-64 0c-17.7 0-32-14.3-32-32s14.3-32 32-32l64 0c30.2 0 58.7 14.2 76.8 38.4L326.4 339.2c6 8.1 15.5 12.8 25.6 12.8l32 0 0-32c0-12.9 7.8-24.6 19.8-29.6s25.7-2.2 34.9 6.9l64 64c6 6 9.4 14.1 9.4 22.6s-3.4 16.6-9.4 22.6l-64 64z"]},xC={prefix:"fas",iconName:"clipboard",icon:[384,512,[128203],"f328","M192 0c-41.8 0-77.4 26.7-90.5 64L64 64C28.7 64 0 92.7 0 128L0 448c0 35.3 28.7 64 64 64l256 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64l-37.5 0C269.4 26.7 233.8 0 192 0zm0 64a32 32 0 1 1 0 64 32 32 0 1 1 0-64zM112 192l160 0c8.8 0 16 7.2 16 16s-7.2 16-16 16l-160 0c-8.8 0-16-7.2-16-16s7.2-16 16-16z"]},Uy={prefix:"fas",iconName:"arrow-up-right-from-square",icon:[512,512,["external-link"],"f08e","M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32l82.7 0L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3l0 82.7c0 17.7 14.3 32 32 32s32-14.3 32-32l0-160c0-17.7-14.3-32-32-32L320 0zM80 32C35.8 32 0 67.8 0 112L0 432c0 44.2 35.8 80 80 80l320 0c44.2 0 80-35.8 80-80l0-112c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 112c0 8.8-7.2 16-16 16L80 448c-8.8 0-16-7.2-16-16l0-320c0-8.8 7.2-16 16-16l112 0c17.7 0 32-14.3 32-32s-14.3-32-32-32L80 32z"]},T1={prefix:"fas",iconName:"lock-open",icon:[576,512,[],"f3c1","M352 144c0-44.2 35.8-80 80-80s80 35.8 80 80l0 48c0 17.7 14.3 32 32 32s32-14.3 32-32l0-48C576 64.5 511.5 0 432 0S288 64.5 288 144l0 48L64 192c-35.3 0-64 28.7-64 64L0 448c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-192c0-35.3-28.7-64-64-64l-32 0 0-48z"]},CC={prefix:"fas",iconName:"forward-fast",icon:[512,512,[9197,"fast-forward"],"f050","M18.4 445c11.2 5.3 24.5 3.6 34.1-4.4L224 297.7 224 416c0 12.4 7.2 23.7 18.4 29s24.5 3.6 34.1-4.4L448 297.7 448 416c0 17.7 14.3 32 32 32s32-14.3 32-32l0-320c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 118.3L276.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S224 83.6 224 96l0 118.3L52.5 71.4c-9.5-7.9-22.8-9.7-34.1-4.4S0 83.6 0 96L0 416c0 12.4 7.2 23.7 18.4 29z"]},Z1={prefix:"fas",iconName:"eye",icon:[576,512,[128065],"f06e","M288 32c-80.8 0-145.5 36.8-192.6 80.6C48.6 156 17.3 208 2.5 243.7c-3.3 7.9-3.3 16.7 0 24.6C17.3 304 48.6 356 95.4 399.4C142.5 443.2 207.2 480 288 480s145.5-36.8 192.6-80.6c46.8-43.5 78.1-95.4 93-131.1c3.3-7.9 3.3-16.7 0-24.6c-14.9-35.7-46.2-87.7-93-131.1C433.5 68.8 368.8 32 288 32zM144 256a144 144 0 1 1 288 0 144 144 0 1 1 -288 0zm144-64c0 35.3-28.7 64-64 64c-7.1 0-13.9-1.2-20.3-3.3c-5.5-1.8-11.9 1.6-11.7 7.4c.3 6.9 1.3 13.8 3.2 20.7c13.7 51.2 66.4 81.6 117.6 67.9s81.6-66.4 67.9-117.6c-11.1-41.5-47.8-69.4-88.6-71.1c-5.8-.2-9.2 6.1-7.4 11.7c2.1 6.4 3.3 13.2 3.3 20.3z"]},Ey={prefix:"fas",iconName:"trash",icon:[448,512,[],"f1f8","M135.2 17.7L128 32 32 32C14.3 32 0 46.3 0 64S14.3 96 32 96l384 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-96 0-7.2-14.3C307.4 6.8 296.3 0 284.2 0L163.8 0c-12.1 0-23.2 6.8-28.6 17.7zM416 128L32 128 53.2 467c1.6 25.3 22.6 45 47.9 45l245.8 0c25.3 0 46.3-19.7 47.9-45L416 128z"]},TC={prefix:"fas",iconName:"gear",icon:[512,512,[9881,"cog"],"f013","M495.9 166.6c3.2 8.7 .5 18.4-6.4 24.6l-43.3 39.4c1.1 8.3 1.7 16.8 1.7 25.4s-.6 17.1-1.7 25.4l43.3 39.4c6.9 6.2 9.6 15.9 6.4 24.6c-4.4 11.9-9.7 23.3-15.8 34.3l-4.7 8.1c-6.6 11-14 21.4-22.1 31.2c-5.9 7.2-15.7 9.6-24.5 6.8l-55.7-17.7c-13.4 10.3-28.2 18.9-44 25.4l-12.5 57.1c-2 9.1-9 16.3-18.2 17.8c-13.8 2.3-28 3.5-42.5 3.5s-28.7-1.2-42.5-3.5c-9.2-1.5-16.2-8.7-18.2-17.8l-12.5-57.1c-15.8-6.5-30.6-15.1-44-25.4L83.1 425.9c-8.8 2.8-18.6 .3-24.5-6.8c-8.1-9.8-15.5-20.2-22.1-31.2l-4.7-8.1c-6.1-11-11.4-22.4-15.8-34.3c-3.2-8.7-.5-18.4 6.4-24.6l43.3-39.4C64.6 273.1 64 264.6 64 256s.6-17.1 1.7-25.4L22.4 191.2c-6.9-6.2-9.6-15.9-6.4-24.6c4.4-11.9 9.7-23.3 15.8-34.3l4.7-8.1c6.6-11 14-21.4 22.1-31.2c5.9-7.2 15.7-9.6 24.5-6.8l55.7 17.7c13.4-10.3 28.2-18.9 44-25.4l12.5-57.1c2-9.1 9-16.3 18.2-17.8C227.3 1.2 241.5 0 256 0s28.7 1.2 42.5 3.5c9.2 1.5 16.2 8.7 18.2 17.8l12.5 57.1c15.8 6.5 30.6 15.1 44 25.4l55.7-17.7c8.8-2.8 18.6-.3 24.5 6.8c8.1 9.8 15.5 20.2 22.1 31.2l4.7 8.1c6.1 11 11.4 22.4 15.8 34.3zM256 336a80 80 0 1 0 0-160 80 80 0 1 0 0 160z"]},zy=TC,ZC={prefix:"fas",iconName:"folder-tree",icon:[576,512,[],"f802","M64 32C64 14.3 49.7 0 32 0S0 14.3 0 32l0 96L0 384c0 35.3 28.7 64 64 64l192 0 0-64L64 384l0-224 192 0 0-64L64 96l0-64zM288 192c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4L409.4 9.4c-6-6-14.1-9.4-22.6-9.4L320 0c-17.7 0-32 14.3-32 32l0 160zm0 288c0 17.7 14.3 32 32 32l224 0c17.7 0 32-14.3 32-32l0-128c0-17.7-14.3-32-32-32l-98.7 0c-8.5 0-16.6-3.4-22.6-9.4l-13.3-13.3c-6-6-14.1-9.4-22.6-9.4L320 288c-17.7 0-32 14.3-32 32l0 160z"]},RC={prefix:"fas",iconName:"download",icon:[512,512,[],"f019","M288 32c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 242.7-73.4-73.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0l128-128c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L288 274.7 288 32zM64 352c-35.3 0-64 28.7-64 64l0 32c0 35.3 28.7 64 64 64l384 0c35.3 0 64-28.7 64-64l0-32c0-35.3-28.7-64-64-64l-101.5 0-45.3 45.3c-25 25-65.5 25-90.5 0L165.5 352 64 352zm368 56a24 24 0 1 1 0 48 24 24 0 1 1 0-48z"]},XC={prefix:"fas",iconName:"stop",icon:[384,512,[9209],"f04d","M0 128C0 92.7 28.7 64 64 64H320c35.3 0 64 28.7 64 64V384c0 35.3-28.7 64-64 64H64c-35.3 0-64-28.7-64-64V128z"]},AC={prefix:"fas",iconName:"angle-down",icon:[448,512,[8964],"f107","M201.4 374.6c12.5 12.5 32.8 12.5 45.3 0l160-160c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L224 306.7 86.6 169.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3l160 160z"]},YC={prefix:"fas",iconName:"eraser",icon:[576,512,[],"f12d","M290.7 57.4L57.4 290.7c-25 25-25 65.5 0 90.5l80 80c12 12 28.3 18.7 45.3 18.7L288 480l9.4 0L512 480c17.7 0 32-14.3 32-32s-14.3-32-32-32l-124.1 0L518.6 285.3c25-25 25-65.5 0-90.5L381.3 57.4c-25-25-65.5-25-90.5 0zM297.4 416l-9.4 0-105.4 0-80-80L227.3 211.3 364.7 348.7 297.4 416z"]},UC={prefix:"fas",iconName:"play",icon:[384,512,[9654],"f04b","M73 39c-14.8-9.1-33.4-9.4-48.5-.9S0 62.6 0 80L0 432c0 17.4 9.4 33.4 24.5 41.9s33.7 8.1 48.5-.9L361 297c14.3-8.7 23-24.2 23-41s-8.7-32.2-23-41L73 39z"]},My={prefix:"fas",iconName:"plus",icon:[448,512,[10133,61543,"add"],"2b","M256 80c0-17.7-14.3-32-32-32s-32 14.3-32 32l0 144L48 224c-17.7 0-32 14.3-32 32s14.3 32 32 32l144 0 0 144c0 17.7 14.3 32 32 32s32-14.3 32-32l0-144 144 0c17.7 0 32-14.3 32-32s-14.3-32-32-32l-144 0 0-144z"]},Dy={prefix:"fas",iconName:"xmark",icon:[384,512,[128473,10005,10006,10060,215,"close","multiply","remove","times"],"f00d","M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"]},EC={prefix:"fas",iconName:"hammer",icon:[576,512,[128296],"f6e3","M413.5 237.5c-28.2 4.8-58.2-3.6-80-25.4l-38.1-38.1C280.4 159 272 138.8 272 117.6l0-12.1L192.3 62c-5.3-2.9-8.6-8.6-8.3-14.7s3.9-11.5 9.5-14l47.2-21C259.1 4.2 279 0 299.2 0l18.1 0c36.7 0 72 14 98.7 39.1l44.6 42c24.2 22.8 33.2 55.7 26.6 86L503 183l8-8c9.4-9.4 24.6-9.4 33.9 0l24 24c9.4 9.4 9.4 24.6 0 33.9l-88 88c-9.4 9.4-24.6 9.4-33.9 0l-24-24c-9.4-9.4-9.4-24.6 0-33.9l8-8-17.5-17.5zM27.4 377.1L260.9 182.6c3.5 4.9 7.5 9.6 11.8 14l38.1 38.1c6 6 12.4 11.2 19.2 15.7L134.9 484.6c-14.5 17.4-36 27.4-58.6 27.4C34.1 512 0 477.8 0 435.7c0-22.6 10.1-44.1 27.4-58.6z"]},Vy={prefix:"fas",iconName:"rotate",icon:[512,512,[128260,"sync-alt"],"f2f1","M142.9 142.9c-17.5 17.5-30.1 38-37.8 59.8c-5.9 16.7-24.2 25.4-40.8 19.5s-25.4-24.2-19.5-40.8C55.6 150.7 73.2 122 97.6 97.6c87.2-87.2 228.3-87.5 315.8-1L455 55c6.9-6.9 17.2-8.9 26.2-5.2s14.8 12.5 14.8 22.2l0 128c0 13.3-10.7 24-24 24l-8.4 0c0 0 0 0 0 0L344 224c-9.7 0-18.5-5.8-22.2-14.8s-1.7-19.3 5.2-26.2l41.1-41.1c-62.6-61.5-163.1-61.2-225.3 1zM16 312c0-13.3 10.7-24 24-24l7.6 0 .7 0L168 288c9.7 0 18.5 5.8 22.2 14.8s1.7 19.3-5.2 26.2l-41.1 41.1c62.6 61.5 163.1 61.2 225.3-1c17.5-17.5 30.1-38 37.8-59.8c5.9-16.7 24.2-25.4 40.8-19.5s25.4 24.2 19.5 40.8c-10.8 30.6-28.4 59.3-52.9 83.8c-87.2 87.2-228.3 87.5-315.8 1L57 457c-6.9 6.9-17.2 8.9-26.2 5.2S16 449.7 16 440l0-119.6 0-.7 0-7.6z"]},qy={prefix:"fas",iconName:"clock-rotate-left",icon:[512,512,["history"],"f1da","M75 75L41 41C25.9 25.9 0 36.6 0 57.9L0 168c0 13.3 10.7 24 24 24l110.1 0c21.4 0 32.1-25.9 17-41l-30.8-30.8C155 85.5 203 64 256 64c106 0 192 86 192 192s-86 192-192 192c-40.8 0-78.6-12.7-109.7-34.4c-14.5-10.1-34.4-6.6-44.6 7.9s-6.6 34.4 7.9 44.6C151.2 495 201.7 512 256 512c141.4 0 256-114.6 256-256S397.4 0 256 0C185.3 0 121.3 28.7 75 75zm181 53c-13.3 0-24 10.7-24 24l0 104c0 6.4 2.5 12.5 7 17l72 72c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-65-65 0-94.1c0-13.3-10.7-24-24-24z"]};function zC(n){let e,t,i,r,s,l,o,a,c=n[0]&&!n[3]&&R1(n);return{c(){e=k("span"),t=pe(n[1]),i=pe(n[2]),r=L(),c&&c.c(),s=Gt(),v(e,"class","filename svelte-1ul6ap")},m(h,O){Y(h,e,O),Q(e,t),Q(e,i),Y(h,r,O),c&&c.m(h,O),Y(h,s,O),l=!0,o||(a=le(e,"click",n[8]),o=!0)},p(h,O){(!l||O&2)&&Le(t,h[1]),(!l||O&4)&&Le(i,h[2]),h[0]&&!h[3]?c?(c.p(h,O),O&9&&D(c,1)):(c=R1(h),c.c(),D(c,1),c.m(s.parentNode,s)):c&&(Je(),j(c,1,1,()=>{c=null}),et())},i(h){l||(D(c),l=!0)},o(h){j(c),l=!1},d(h){h&&(X(e),X(r),X(s)),c&&c.d(h),o=!1,a()}}}function MC(n){let e,t,i,r,s;return{c(){e=k("input"),i=pe(n[2]),v(e,"size",t=n[4].length||n[1].length),v(e,"placeholder",n[1])},m(l,o){Y(l,e,o),n[11](e),si(e,n[4]),Y(l,i,o),r||(s=[le(e,"input",n[12]),le(e,"blur",n[10]),le(e,"keyup",n[9])],r=!0)},p(l,o){o&18&&t!==(t=l[4].length||l[1].length)&&v(e,"size",t),o&2&&v(e,"placeholder",l[1]),o&16&&e.value!==l[4]&&si(e,l[4]),o&4&&Le(i,l[2])},i:Qe,o:Qe,d(l){l&&(X(e),X(i)),n[11](null),r=!1,Ft(s)}}}function R1(n){let e,t,i,r,s;return t=new wt({props:{icon:Dy}}),{c(){e=k("span"),Ae(t.$$.fragment),v(e,"class","close-tab svelte-1ul6ap")},m(l,o){Y(l,e,o),Re(t,e,null),i=!0,r||(s=le(e,"click",n[13]),r=!0)},p:Qe,i(l){i||(D(t.$$.fragment,l),i=!0)},o(l){j(t.$$.fragment,l),i=!1},d(l){l&&X(e),Xe(t),r=!1,s()}}}function DC(n){let e,t,i,r,s,l;const o=[MC,zC],a=[];function c(h,O){return h[5]?0:1}return t=c(n),i=a[t]=o[t](n),{c(){e=k("a"),i.c(),v(e,"class","filename-link svelte-1ul6ap"),ne(e,"active",n[0]),ne(e,"readonly",n[3])},m(h,O){Y(h,e,O),a[t].m(e,null),r=!0,s||(l=le(e,"click",n[14]),s=!0)},p(h,[O]){let p=t;t=c(h),t===p?a[t].p(h,O):(Je(),j(a[p],1,1,()=>{a[p]=null}),et(),i=a[t],i?i.p(h,O):(i=a[t]=o[t](h),i.c()),D(i,1),i.m(e,null)),(!r||O&1)&&ne(e,"active",h[0]),(!r||O&8)&&ne(e,"readonly",h[3])},i(h){r||(D(i),r=!0)},o(h){j(i),r=!1},d(h){h&&X(e),a[t].d(),s=!1,l()}}}function VC(n,e,t){let{active:i=!1}=e,{name:r="Untitled"}=e,{suffix:s=".mzn"}=e,{readonly:l=!1}=e;const o=en();let a=!1,c,h="";async function O(){!i||l||(t(5,a=!0),t(4,h=r),await Fn(),c.focus())}function p(x){x.key==="Enter"?(x.preventDefault(),g()):x.key==="Escape"&&t(5,a=!1)}function g(){t(5,a=!1),h.length>0&&o("rename",{name:h,suffix:s})}function m(x){Et[x?"unshift":"push"](()=>{c=x,t(6,c)})}function $(){h=this.value,t(4,h)}const y=()=>o("close"),_=()=>{a||o("click")};return n.$$set=x=>{"active"in x&&t(0,i=x.active),"name"in x&&t(1,r=x.name),"suffix"in x&&t(2,s=x.suffix),"readonly"in x&&t(3,l=x.readonly)},n.$$.update=()=>{n.$$.dirty&16&&/[\/\\\.]/.test(h)&&t(4,h=h.replaceAll(/[\/\\\.]/g,""))},[i,r,s,l,h,a,c,o,O,p,g,m,$,y,_]}class qC extends $i{constructor(e){super(),bi(this,e,VC,DC,Oi,{active:0,name:1,suffix:2,readonly:3})}}function Iy(n){const e=n-1;return e*e*e+1}function IC(n,{from:e,to:t},i={}){const r=getComputedStyle(n),s=r.transform==="none"?"":r.transform,[l,o]=r.transformOrigin.split(" ").map(parseFloat),a=e.left+e.width*l/t.width-(t.left+l),c=e.top+e.height*o/t.height-(t.top+o),{delay:h=0,duration:O=g=>Math.sqrt(g)*120,easing:p=Iy}=i;return{delay:h,duration:Gc(O)?O(Math.sqrt(a*a+c*c)):O,easing:p,css:(g,m)=>{const $=m*a,y=m*c,_=g+m*e.width/t.width,x=g+m*e.height/t.height;return`transform: ${s} translate(${$}px, ${y}px) scale(${_}, ${x});`}}}function X1(n,e,t){const i=n.slice();return i[19]=e[t],i}function A1(n,e){let t,i,r,s=Qe,l,o,a;function c(){return e[11](e[19])}function h(...m){return e[12](e[19],...m)}function O(...m){return e[13](e[19],...m)}i=new qC({props:{name:e[19].stem,suffix:e[19].suffix,active:e[0]===e[19].index,readonly:e[1]||e[19].readonlyTab}}),i.$on("click",c),i.$on("rename",h),i.$on("close",O);function p(...m){return e[14](e[19],...m)}function g(...m){return e[15](e[19],...m)}return{key:n,first:null,c(){t=k("li"),Ae(i.$$.fragment),v(t,"draggable",!0),ne(t,"is-active",e[0]===e[19].index),this.first=t},m(m,$){Y(m,t,$),Re(i,t,null),l=!0,o||(a=[le(t,"dragstart",p),le(t,"dragover",e[7]),le(t,"drop",g)],o=!0)},p(m,$){e=m;const y={};$&4&&(y.name=e[19].stem),$&4&&(y.suffix=e[19].suffix),$&5&&(y.active=e[0]===e[19].index),$&6&&(y.readonly=e[1]||e[19].readonlyTab),i.$set(y),(!l||$&5)&&ne(t,"is-active",e[0]===e[19].index)},r(){r=t.getBoundingClientRect()},f(){s4(t),s()},a(){s(),s=r4(t,r,IC,{duration:200})},i(m){l||(D(i.$$.fragment,m),l=!0)},o(m){j(i.$$.fragment,m),l=!1},d(m){m&&X(t),Xe(i),o=!1,Ft(a)}}}function Y1(n){let e,t,i,r,s,l,o,a,c,h,O,p;return r=new wt({props:{icon:My}}),c=new wt({props:{icon:ZC}}),{c(){e=k("li"),t=k("a"),i=k("span"),Ae(r.$$.fragment),s=L(),l=k("li"),o=k("button"),a=k("span"),Ae(c.$$.fragment),v(i,"class","icon add-icon svelte-7ub6h4"),v(t,"title","Add new file"),v(a,"class","icon"),v(o,"class","button is-small"),v(o,"title","Manage files"),v(l,"class","right svelte-7ub6h4")},m(g,m){Y(g,e,m),Q(e,t),Q(t,i),Re(r,i,null),Y(g,s,m),Y(g,l,m),Q(l,o),Q(o,a),Re(c,a,null),h=!0,O||(p=[le(t,"click",n[16]),le(o,"click",n[17])],O=!0)},p:Qe,i(g){h||(D(r.$$.fragment,g),D(c.$$.fragment,g),h=!0)},o(g){j(r.$$.fragment,g),j(c.$$.fragment,g),h=!1},d(g){g&&(X(e),X(s),X(l)),Xe(r),Xe(c),O=!1,Ft(p)}}}function LC(n){let e,t,i=[],r=new Map,s,l,o=st(n[2]);const a=h=>h[19].name;for(let h=0;h{c=null}),et()):c?(c.p(h,O),O&2&&D(c,1)):(c=Y1(h),c.c(),D(c,1),c.m(t,null))},i(h){if(!l){for(let O=0;Oa(z.index),y=(z,V)=>c(V,z.index),_=(z,V)=>m(z.index),x=(z,V)=>O(V,z.index),R=(z,V)=>g(V,z.index),A=()=>o("newFile"),C=()=>o("manageFiles");return n.$$set=z=>{"files"in z&&t(10,r=z.files),"currentIndex"in z&&t(0,s=z.currentIndex),"readonly"in z&&t(1,l=z.readonly)},n.$$.update=()=>{n.$$.dirty&1024&&t(2,i=r.map((z,V)=>{const M=z.name.endsWith(".mzc.mzn")?z.name.length-8:z.name.lastIndexOf(".");return{...z,stem:z.name.substring(0,M),suffix:z.name.substring(M),index:V}}).filter(z=>!z.hidden))},[s,l,i,o,a,c,O,p,g,m,r,$,y,_,x,R,A,C]}class jC extends $i{constructor(e){super(),bi(this,e,NC,LC,Oi,{files:10,currentIndex:0,readonly:1})}}function U1(n,{delay:e=0,duration:t=400,easing:i=vd}={}){const r=+getComputedStyle(n).opacity;return{delay:e,duration:t,easing:i,css:s=>`opacity: ${s*r}`}}function wc(n,{delay:e=0,duration:t=400,easing:i=Iy,x:r=0,y:s=0,opacity:l=0}={}){const o=getComputedStyle(n),a=+o.opacity,c=o.transform==="none"?"":o.transform,h=a*(1-l),[O,p]=dm(r),[g,m]=dm(s);return{delay:e,duration:t,easing:i,css:($,y)=>` transform: ${c} translate(${(1-$)*O}${p}, ${(1-$)*g}${m}); - opacity: ${a-h*y}`}}const jC=n=>({}),U1=n=>({});function E1(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,W;const R=n[6].default,X=Zi(R,n,n[5],null),C=n[6].footer,E=Zi(C,n,n[5],U1),D=E||BC(n);return{c(){e=k("form"),t=k("div"),i=N(),r=k("div"),s=k("header"),l=k("p"),o=pe(n[0]),a=N(),c=k("button"),h=N(),O=k("section"),X&&X.c(),p=N(),g=k("footer"),D&&D.c(),v(t,"class","modal-background"),v(l,"class","modal-card-title"),v(c,"type","button"),v(c,"class","delete"),v(c,"aria-label","close"),v(s,"class","modal-card-head"),v(O,"class","modal-card-body"),v(g,"class","modal-card-foot"),v(r,"class","modal-card"),v(e,"tabindex","0"),v(e,"class","modal is-active")},m(z,F){Y(z,e,F),Q(e,t),Q(e,i),Q(e,r),Q(r,s),Q(s,l),Q(l,o),Q(s,a),Q(s,c),Q(r,h),Q(r,O),X&&X.m(O,null),Q(r,p),Q(r,g),D&&D.m(g,null),n[7](e),y=!0,_||(W=[le(t,"click",n[4]),le(c,"click",n[4]),le(e,"submit",i$(n[8]))],_=!0)},p(z,F){(!y||F&1)&&Ne(o,z[0]),X&&X.p&&(!y||F&32)&&Xi(X,R,z,z[5],y?Ri(R,z[5],F,null):Ai(z[5]),null),E&&E.p&&(!y||F&32)&&Xi(E,C,z,z[5],y?Ri(C,z[5],F,jC):Ai(z[5]),U1)},i(z){y||(M(X,z),M(D,z),z&&Hn(()=>{y&&(m||(m=yl(r,wc,{y:-200,duration:200},!0)),m.run(1))}),z&&Hn(()=>{y&&($||($=yl(e,Y1,{duration:200},!0)),$.run(1))}),y=!0)},o(z){j(X,z),j(D,z),z&&(m||(m=yl(r,wc,{y:-200,duration:200},!1)),m.run(0)),z&&($||($=yl(e,Y1,{duration:200},!1)),$.run(0)),y=!1},d(z){z&&A(e),X&&X.d(z),D&&D.d(z),z&&m&&m.end(),n[7](null),z&&$&&$.end(),_=!1,Ft(W)}}}function BC(n){let e,t,i;return{c(){e=k("button"),e.textContent="Cancel",v(e,"class","button")},m(r,s){Y(r,e,s),t||(i=le(e,"click",n[4]),t=!0)},p:Qe,d(r){r&&A(e),t=!1,i()}}}function FC(n){let e,t,i=n[1]&&E1(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&M(i,1)):(i=E1(r),i.c(),M(i,1),i.m(e.parentNode,e)):i&&(Je(),j(i,1,1,()=>{i=null}),et())},i(r){t||(M(i),t=!0)},o(r){j(i),t=!1},d(r){r&&A(e),i&&i.d(r)}}}function GC(n,e,t){let{$$slots:i={},$$scope:r}=e,{title:s}=e,{active:l=!1}=e;const o=en();let a;async function c(g){g&&(await Fn(),a&&a.focus(),o("activate"))}function h(){o("cancel")}function O(g){Et[g?"unshift":"push"](()=>{a=g,t(2,a)})}const p=()=>o("submit");return n.$$set=g=>{"title"in g&&t(0,s=g.title),"active"in g&&t(1,l=g.active),"$$scope"in g&&t(5,r=g.$$scope)},n.$$.update=()=>{n.$$.dirty&2&&c(l)},[s,l,a,o,h,r,i,O,p]}class _s extends $i{constructor(e){super(),bi(this,e,GC,FC,Oi,{title:0,active:1})}}const Iy=1024;let HC=0;class Rn{constructor(e,t){this.from=e,this.to=t}}class at{constructor(e={}){this.id=HC++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ni.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}at.closedBy=new at({deserialize:n=>n.split(" ")});at.openedBy=new at({deserialize:n=>n.split(" ")});at.group=new at({deserialize:n=>n.split(" ")});at.contextHash=new at({perNode:!0});at.lookAhead=new at({perNode:!0});at.mounted=new at({perNode:!0});class oa{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[at.mounted.id]}}const KC=Object.create(null);class Ni{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):KC,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Ni(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),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 r}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(at.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(at.group),s=-1;s<(r?r.length:0);s++){let l=t[s<0?i.name:r[s]];if(l)return l}}}}Ni.none=new Ni("",Object.create(null),0,8);class Ud{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|Ut.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(o||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.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:Md(Ni.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new Bt(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new Bt(Ni.none,t,i,r)))}static build(e){return iT(e)}}Bt.empty=new Bt(Ni.none,[],[],0);class Ed{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 Ed(this.buffer,this.index)}}class ks{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Ni.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function aa(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?o.length:-1;e!=c;e+=t){let h=o[e],O=a[e]+l.from;if(Ly(r,i,O,O+h.length)){if(h instanceof ks){if(s&Ut.ExcludeBuffers)continue;let p=h.findChild(0,h.buffer.length,t,i-O,r);if(p>-1)return new dr(new JC(l,h,e,O),null,p)}else if(s&Ut.IncludeAnonymous||!h.type.isAnonymous||zd(h)){let p;if(!(s&Ut.IgnoreMounts)&&(p=oa.get(h))&&!p.overlay)return new zi(p.tree,O,e,l);let g=new zi(h,O,e,l);return s&Ut.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(t<0?h.children.length-1:0,t,i,r)}}}if(s&Ut.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))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)}enter(e,t,i=0){let r;if(!(i&Ut.IgnoreOverlays)&&(r=oa.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:l,to:o}of r.overlay)if((t>0?l<=s:l=s:o>s))return new zi(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}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 M1(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(;!r.type.is(t);)if(!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function sd(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class JC{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class dr extends Ny{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,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new dr(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)}enter(e,t,i=0){if(i&Ut.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new dr(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 dr(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 dr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let l=i.buffer[this.index+1];e.push(i.slice(r,s,l)),t.push(0)}return new Bt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function jy(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;st.from||l.to=e){let o=new zi(l.tree,l.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(aa(o,e,t,!1))}}return r?jy(r):i}class Qc{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof zi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.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:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof zi?(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,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);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,i=this.mode){return this.buffer?i&Ut.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ut.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ut.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,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<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,i,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,l=e<0?-1:i._tree.children.length;s!=l;s+=e){let o=i._tree.children[s];if(this.mode&Ut.IncludeAnonymous||o instanceof ks||!o.type.isAnonymous||zd(o))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=0;){for(let l=e;l;l=l._parent)if(l.index==r){if(r==this.index)return l;t=l,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return sd(this.node,e,r);let l=i[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[r]&&e[r]!=l.name)return!1;r--}}return!0}}function zd(n){return n.children.some(e=>e instanceof ks||!e.type.isAnonymous||zd(e))}function iT(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=Iy,reused:s=[],minRepeatType:l=i.types.length}=n,o=Array.isArray(t)?new Ed(t,t.length):t,a=i.types,c=0,h=0;function O(C,E,D,z,F,B){let{id:q,start:L,end:re,size:ae}=o,ye=h;for(;ae<0;)if(o.next(),ae==-1){let ke=s[q];D.push(ke),z.push(L-C);return}else if(ae==-3){c=q;return}else if(ae==-4){h=q;return}else throw new RangeError(`Unrecognized record size: ${ae}`);let Se=a[q],ge,Ue,Ie=L-C;if(re-L<=r&&(Ue=y(o.pos-E,F))){let ke=new Uint16Array(Ue.size-Ue.skip),We=o.pos-Ue.size,lt=ke.length;for(;o.pos>We;)lt=_(Ue.start,ke,lt);ge=new ks(ke,re-Ue.start,i),Ie=Ue.start-C}else{let ke=o.pos-ae;o.next();let We=[],lt=[],Vt=q>=l?q:-1,Qt=0,pt=re;for(;o.pos>ke;)Vt>=0&&o.id==Vt&&o.size>=0?(o.end<=pt-r&&(m(We,lt,L,Qt,o.end,pt,Vt,ye),Qt=We.length,pt=o.end),o.next()):B>2500?p(L,ke,We,lt):O(L,ke,We,lt,Vt,B+1);if(Vt>=0&&Qt>0&&Qt-1&&Qt>0){let qt=g(Se);ge=Md(Se,We,lt,0,We.length,0,re-L,qt,qt)}else ge=$(Se,We,lt,re-L,ye-re)}D.push(ge),z.push(Ie)}function p(C,E,D,z){let F=[],B=0,q=-1;for(;o.pos>E;){let{id:L,start:re,end:ae,size:ye}=o;if(ye>4)o.next();else{if(q>-1&&re=0;ae-=3)L[ye++]=F[ae],L[ye++]=F[ae+1]-re,L[ye++]=F[ae+2]-re,L[ye++]=ye;D.push(new ks(L,F[2]-re,i)),z.push(re-C)}}function g(C){return(E,D,z)=>{let F=0,B=E.length-1,q,L;if(B>=0&&(q=E[B])instanceof Bt){if(!B&&q.type==C&&q.length==z)return q;(L=q.prop(at.lookAhead))&&(F=D[B]+q.length+L)}return $(C,E,D,z,F)}}function m(C,E,D,z,F,B,q,L){let re=[],ae=[];for(;C.length>z;)re.push(C.pop()),ae.push(E.pop()+D-F);C.push($(i.types[q],re,ae,B-F,L-B)),E.push(F-D)}function $(C,E,D,z,F=0,B){if(c){let q=[at.contextHash,c];B=B?[q].concat(B):[q]}if(F>25){let q=[at.lookAhead,F];B=B?[q].concat(B):[q]}return new Bt(C,E,D,z,B)}function y(C,E){let D=o.fork(),z=0,F=0,B=0,q=D.end-r,L={size:0,start:0,skip:0};e:for(let re=D.pos-C;D.pos>re;){let ae=D.size;if(D.id==E&&ae>=0){L.size=z,L.start=F,L.skip=B,B+=4,z+=4,D.next();continue}let ye=D.pos-ae;if(ae<0||ye=l?4:0,ge=D.start;for(D.next();D.pos>ye;){if(D.size<0)if(D.size==-3)Se+=4;else break e;else D.id>=l&&(Se+=4);D.next()}F=ge,z+=ae,B+=Se}return(E<0||z==C)&&(L.size=z,L.start=F,L.skip=B),L.size>4?L:void 0}function _(C,E,D){let{id:z,start:F,end:B,size:q}=o;if(o.next(),q>=0&&z4){let re=o.pos-(q-4);for(;o.pos>re;)D=_(C,E,D)}E[--D]=L,E[--D]=B-C,E[--D]=F-C,E[--D]=z}else q==-3?c=z:q==-4&&(h=z);return D}let W=[],R=[];for(;o.pos>0;)O(n.start||0,n.bufferStart||0,W,R,-1,0);let X=(e=n.length)!==null&&e!==void 0?e:W.length?R[0]+W[0].length:0;return new Bt(a[n.topID],W.reverse(),R.reverse(),X)}const D1=new WeakMap;function cc(n,e){if(!n.isAnonymous||e instanceof ks||e.type!=n)return 1;let t=D1.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof Bt)){t=1;break}t+=cc(n,i)}D1.set(e,t)}return t}function Md(n,e,t,i,r,s,l,o,a){let c=0;for(let m=i;m=h)break;E+=D}if(R==X+1){if(E>h){let D=m[X];g(D.children,D.positions,0,D.children.length,$[X]+W);continue}O.push(m[X])}else{let D=$[R-1]+m[R-1].length-C;O.push(Md(n,m,$,X,R,C,D,null,a))}p.push(C+W-s)}}return g(e,t,i,r,0),(o||a)(O,p,l)}class By{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof dr?this.setBuffer(e.context.buffer,e.index,t):e instanceof zi&&this.map.set(e.tree,t)}get(e){return e instanceof dr?this.getBuffer(e.context.buffer,e.index):e instanceof zi?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 zr{constructor(e,t,i,r,s=!1,l=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new zr(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,l=e.length?e[0]:null;for(let o=0,a=0,c=0;;o++){let h=o=i)for(;l&&l.from=p.from||O<=p.to||c){let g=Math.max(p.from,a)-c,m=Math.min(p.to,O)-c;p=g>=m?null:new zr(g,m,p.tree,p.offset+c,o>0,!!h)}if(p&&r.push(p),l.to>O)break;l=snew Rn(r.from,r.to)):[new Rn(0,0)]:[new Rn(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class nT{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 rT(n){return(e,t,i,r)=>new lT(e,n,t,i,r)}class V1{constructor(e,t,i,r,s){this.parser=e,this.parse=t,this.overlay=i,this.target=r,this.from=s}}function q1(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class sT{constructor(e,t,i,r,s,l,o){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const ld=new at({perNode:!0});class lT{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Bt(i.type,i.children,i.positions,i.length,i.propValues.concat([[ld,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[at.mounted.id]=new oa(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let c=t.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let O=h.from+c.pos,p=h.to+c.pos;O>=r.from&&p<=r.to&&!t.ranges.some(g=>g.fromO)&&t.ranges.push({from:O,to:p})}}o=!1}else if(i&&(l=oT(i.ranges,r.from,r.to)))o=l!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Rn(O.from-r.from,O.to-r.from)):null,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):o=!1}}else t&&(a=t.predicate(r))&&(a===!0&&(a=new Rn(r.from,r.to)),a.fromnew Rn(h.from-t.start,h.to-t.start)),t.target,c[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function oT(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function I1(n,e,t,i,r,s){if(e=e.to);i++);let l=r.children[i],o=l.buffer,a=[i];function c(h,O,p,g,m,$){let y=t[$],_=[],W=[];I1(l,h,y,_,W,g);let R=o[y+1],X=o[y+2];a.push(_.length);let C=$?c(y+4,o[y+3],l.set.types[o[y]],R,X-R,$-1):e.toTree();return _.push(C),W.push(R-g),I1(l,o[y+3],O,_,W,g),new Bt(p,_,W,m)}r.children[i]=c(0,o.length,Ni.none,0,l.length,t.length-1);for(let h of a){let O=n.tree.children[h],p=n.tree.positions[h];n.yield(new zi(O,p+n.from,h,n._tree))}}class L1{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Ut.IncludeAnonymous|Ut.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,Ut.IgnoreOverlays|Ut.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 Bt)t=t.children[0];else break}return!1}}let fT=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(ld))!==null&&t!==void 0?t:i.to,this.inner=new L1(i.tree,-i.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(ld))!==null&&e!==void 0?e:t.to,this.inner=new L1(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(i=s.tree)===null||i===void 0?void 0:i.prop(at.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:l})}}}return r}};function N1(n,e){let t=null,i=e;for(let r=1,s=0;r=o)break;a.to<=l||(t||(i=t=e.slice()),a.fromo&&t.splice(s+1,0,new Rn(o,a.to))):a.to>o?t[s--]=new Rn(o,a.to):t.splice(s--,1))}}return i}function cT(n,e,t,i){let r=0,s=0,l=!1,o=!1,a=-1e9,c=[];for(;;){let h=r==n.length?1e9:l?n[r].to:n[r].from,O=s==e.length?1e9:o?e[s].to:e[s].from;if(l!=o){let p=Math.max(a,t),g=Math.min(h,O,i);pnew Rn(p.from+i,p.to+i)),O=cT(e,h,a,c);for(let p=0,g=a;;p++){let m=p==O.length,$=m?c:O[p].from;if($>g&&t.push(new zr(g,$,r.tree,-l,s.from>=g||s.openStart,s.to<=$||s.openEnd)),m)break;g=O[p].to}}else t.push(new zr(a,c,r.tree,-l,s.from>=l||s.openStart,s.to<=o||s.openEnd))}return t}var B1={};class _c{constructor(e,t,i,r,s,l,o,a,c,h=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=s,this.score=l,this.buffer=o,this.bufferBase=a,this.curContext=c,this.lookAhead=h,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new _c(e,[],t,i,i,0,[],0,r?new F1(r,r.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 i=e>>19,r=e&65535,{parser:s}=this.p,l=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&l.buffer[o-4]==0&&l.buffer[o-1]>-1){if(t==i)return;if(l.buffer[o-2]>=t){l.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let l=this.buffer.length;if(l>0&&this.buffer[l-4]!=0){let o=!1;for(let a=l;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){o=!0;break}if(o)for(;l>0&&this.buffer[l-2]>i;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,r>4&&(r-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=i,this.buffer[l+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4);else{let s=e,{parser:l}=this.p;(r>this.pos||t<=l.maxNode)&&(this.pos=r,l.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,i),this.shiftContext(t,i),t<=l.maxNode&&this.buffer.push(t,i,r,4)}}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,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 i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new _c(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new uT(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}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 r=[];for(let s=0,l;sa&1&&o==l)||r.push(t[s],l)}t=r}let i=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}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=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,l=>{if(!(l&393216))if(l&65536){let o=(l>>19)-s;if(o>1){let a=l&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return o<<19|65536|a}}else{let o=i(l,s+1);if(o!=null)return o}})};return i(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;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class F1{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class uT{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class kc{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new kc(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 kc(this.stack,this.pos,this.index)}}function Mo(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i=92&&l--,l>=34&&l--;let a=l-32;if(a>=46&&(a-=46,o=!0),s+=a,o)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class uc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const G1=new uc;class hT{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=G1,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 i=this.range,r=this.rangeIndex,s=this.pos+e;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let l=this.ranges[++r];s+=l.from-i.to,i=l}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t=this.chunk2Pos&&io.to&&(this.chunk2=this.chunk2.slice(0,o.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.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=G1,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&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 i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class Zl{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;Gy(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Zl.prototype.contextual=Zl.prototype.fallback=Zl.prototype.extend=!1;class Pc{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?Mo(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,l=e.resolveOffset(1,1);if(Gy(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,l==null)break;e.reset(l,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}}Pc.prototype.contextual=Zl.prototype.fallback=Zl.prototype.extend=!1;class $r{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Gy(n,e,t,i,r,s){let l=0,o=1<0){let m=n[g];if(a.allows(m)&&(e.token.value==-1||e.token.value==m||OT(m,e.token.value,r,s))){e.acceptToken(m);break}}let h=e.next,O=0,p=n[l+2];if(e.next<0&&p>O&&n[c+p*3-3]==65535){l=n[c+p*3-1];continue e}for(;O>1,m=c+g+(g<<1),$=n[m],y=n[m+1]||65536;if(h<$)p=g;else if(h>=y)O=g+1;else{l=n[m+2],e.advance();continue e}}break}}function H1(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function OT(n,e,t,i){let r=H1(t,i,e);return r<0||H1(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class dT{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?K1(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?K1(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(ee)return this.nextStart=l,null;if(s instanceof Bt){if(l==e){if(l=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+s.length}}}class pT{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new uc)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,l=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let c=0;cO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let p=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!h.extend&&(i=O,t>p))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new uc,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new uc,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let l=0;l=0&&i.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;se.bufferLength*4?new dT(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;lt)i.push(o);else{if(this.advanceStack(o,i,e))continue;{r||(r=[],s=[]),r.push(o);let a=this.tokens.getMainToken(o);s.push(a.value,a.end)}}break}}if(!i.length){let l=r&&ST(r);if(l)return fn&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw fn&&r&&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&&r){let l=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(l)return fn&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(i.length>l)for(i.sort((o,a)=>a.score-o.score);i.length>l;)i.pop();i.some(o=>o.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let l=0;l500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(l--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let l=1;l ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,h=c?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let p=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(p>-1&&O.length&&(!c||(O.prop(at.contextHash)||0)==h))return e.useNode(O,p),fn&&console.log(l+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof Bt)||O.children.length==0||O.positions[0]>0)break;let g=O.children[0];if(g instanceof Bt&&O.positions[0]==0)O=g;else break}}let o=s.stateSlot(e.state,4);if(o>0)return e.reduce(o),fn&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;cr?t.push(m):i.push(m)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return J1(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let l=0;l ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),fn&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))))continue;let O=o.split(),p=h;for(let g=0;O.forceReduce()&&g<10&&(fn&&console.log(p+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));g++)fn&&(p=this.stackID(O)+" -> ");for(let g of o.recoverByInsert(a))fn&&console.log(h+this.stackID(g)+" (via recover-insert)"),this.advanceFully(g,i);this.stream.end>o.pos?(c==o.pos&&(c++,a=0),o.recoverByDelete(a,c),fn&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),J1(o,i)):(!r||r.scoren;class Hy{constructor(e){this.start=e.start,this.shift=e.shift||eO,this.reduce=e.reduce||eO,this.reuse=e.reuse||eO,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ps extends Fy{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 o=0;oe.topRules[o][1]),r=[];for(let o=0;o=0)s(h,a,o[c++]);else{let O=o[c+-h];for(let p=-h;p>0;p--)s(o[c++],a,O);c++}}}this.nodeSet=new Ud(t.map((o,a)=>Ni.define({name:a>=this.minRepeatTerm?void 0:o,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Iy;let l=Mo(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new Zl(l,o):o),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,i){let r=new gT(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let l=r[s++],o=l&1,a=r[s++];if(o&&i)return a;for(let c=s+(l>>1);s0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ur(this.data,s+2);else break;r=t(Ur(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ur(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];t.some((s,l)=>l&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(Ps.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(o=>o.from==i.external);if(!s)return i;let l=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=e0(l),l})),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),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let l=t.indexOf(s);l>=0&&(i[l]=!0)}let r=null;for(let s=0;si)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}const bT={__proto__:null,annotation:12,array:20,var:24,par:26,opt:28,ann:32,bool:34,float:36,int:38,string:40,_:50,true:62,false:64,infinity:68,"∅":74,in:92,where:94,if:98,then:100,elseif:102,else:104,endif:106,xor:110,subset:112,superset:114,union:116,diff:118,symdiff:120,intersect:122,div:124,mod:126,default:128,let:132,constraint:140,not:144,"¬":146,any:170,of:172,set:176,tuple:180,record:184,op:190,enum:198,function:202,solve:206,satisfy:208,maximize:210,minimize:212,include:216,output:220,predicate:224,test:226,type:230},$T=Ps.deserialize({version:14,states:"!0jQ]QPOOOOQO'#F]'#F]O&XQPO'#CvO&`QPO'#CxOOQO'#C}'#C}O&gQPO'#DSO&nOQO'#DTO$kQPO'#DWOOQO'#Fc'#FcO*}QPO'#CgO+eQPO'#DrO$kQPO'#DuO$kQPO'#DuO/qQPO'#FbOOQO'#Fb'#FbOOQO'#Cg'#CgOOQO'#F`'#F`OOQO'#F['#F[Q/xQPO'#EtQ]QPOOOOQO'#Ck'#CkOOQO'#Ct'#CtOOQO'#Cz'#CzOOQO'#DQ'#DQO$kQPO'#D^O/}QPO'#DsO0UQPO'#DoO0ZQPO'#CgO0wQPO'#CgO1hQPO'#E`O1|QPO'#CeO2RQPO'#EVO2W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)Y)^)`)u)x*[Q{QQ!QRQ!UTQ!]VQ!sZU!t[$d'jQ!{hQ!|iW#Qkl$|$}Q#bxQ#i|Q#r!SQ#x!VQ#z!XQ$T!`Q$U!aQ$V!bQ$W!cQ$X!dQ$Y!eQ$Z!fQ$[!gQ$]!hS$^!i!pQ$_!jQ$`!kQ$a!lQ$b!mQ$c!nS$h!q+RQ$j!uQ$q!xQ$s!}S$y#T&kQ%]#_Q%^#`S%b#f'X^%c#g%d'U'W'd(n(uU%g#k%j'ZQ%l#nQ%v#}Q%w$PQ&U$kQ&^$oQ&_$rQ&a$sQ&h$wQ&y%WQ&{%YQ&|%ZQ'Q%_Q'`%oU'i%}'l(wQ'n&QQ'o&RQ'v&YQ(P&`Q(Q&bQ(R&cQ(h&zQ(k'PQ(l'RQ(m'SQ(y'sQ)S'|Q)T(OQ)e(iQ)m(xQ)o(zQ)p(|Q)q)RQ*Q)fQ*R)gQ*U)nQ*X)rQ*`*PQ*b*VQ*e*oQ*f*pQ*g*qQ*h*rQ*i*sQ*j*tQ*k*uQ*l*vS*m*d*wQ*n*xQ+S*{Q+T+ZQ+U*|Q+V*}Q+W+OQ+X+PR+Y+Q",nodeNames:"⚠ LineComment BlockComment SourceFile Annotation Identifier Keyword QuotedIdentifier Parameter ArrayType Keyword TypeBase Keyword Keyword Keyword PrimitiveType Keyword Keyword Keyword Keyword Keyword TypeInstId TypeInstEnumId Absent Anonymous Keyword ArrayLiteral2d ArrayLiteral2dRow ArrayLiteral ArrayLiteralMember BooleanLiteral Keyword Keyword Infinity Keyword Number EmptySet Keyword SetLiteral StringLiteral Interpolation TupleLiteral RecordLiteral RecordMember ArrayComprehension Generator Keyword Keyword IfThenElse Keyword Keyword Keyword Keyword Keyword InfixOperator Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword LetExpression Keyword LetItems Declaration Constraint Keyword PrefixOperator Keyword Keyword PostfixOperator SetComprehension Call Application GeneratorCall GeneratorCallGenerators ParenthesisedExpression IndexedAccess TupleAccess Number RecordAccess Keyword Keyword SetType Keyword TupleType Keyword RecordType Keyword RecordTypeField OperationType Keyword AnyType Assignment Enumeration Keyword FunctionItem Keyword Goal Keyword Keyword Keyword Keyword Include Keyword Output Keyword Predicate Keyword Keyword TypeAlias Keyword",maxTerm:210,skippedNodes:[0,1,2],repeatNodeCount:19,tokenData:"!8_~R!oOX&SXY&qYZ'nZ]&S]^&q^p&Spq&qqr(Prs)Xsu&Suv)^vw&Swx*lxy,ryz-]z{-v{|.a|}/k}!O0U!O!P1`!P!Q3Z!Q!R9g!R![@|![!]Bz!]!^DU!^!_Do!_!`Is!`!aJ}!a!c&S!c!}LX!}#OM[#O#PNf#P#Q!#p#Q#R!$Z#R#SLX#S#T&S#T#oLX#o#p!$t#p#q!%_#q#r!&f#r#s!'P#s%#t&S%#t%#u!.O%#u%#v&S%#v%#w!.i%#w%%W&S%%W%%X!/S%%X%%Y&S%%Y%%Z!/m%%Z%%[&S%%[%%]!0W%%]%&b&S%&b%&c!0q%&c%&p&S%&p%&q!1[%&q%&x&S%&x%&y!1u%&y%'R&S%'R%'S!2`%'S%'T!2y%'T%'U!3d%'U%'V!3}%'V%(^&S%(^%(_!4h%(_%(b&S%(b%(c!5R%(c%(d!5l%(d%)U&S%)U%)V!6V%)V%)W!6p%)W%*]&S%*]%*^!7Z%*^%Gc&S%Gc%Gd!7t%Gd;'S&S;'S;=`&k<%lO&SQ&XU$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SQ&nP;=`<%l&SV&x[$bQ#}TOX&SXY&qYZ'nZ]&S]^&q^p&Spq&qqr&Ss#O&S#P;'S&S;'S;=`&k<%lO&ST'sS#}TXY'nYZ'n]^'npq'nR(UW$bQOY&SZr&Ss!_&S!_!`(n!`#O&S#P;'S&S;'S;=`&k<%lO&SR(uU$vP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&S~)^O$a~V)eWPT$bQOY)^Zr)^rs)}s#O)^#O#P)}#P;'S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S&S;'S;=`&k<%lO&SR!0xU%OP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!1cU%UP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!1|U$^P$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!2gU$sP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!3QU$pP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!3kU%VP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!4UU%TP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!4oU$wP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!5YU$zP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!5sU$}P$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!6^U%PP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!6wU%QP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!7bU$qP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!7{U$gP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&S",tokenizers:[0,1,2],topRules:{SourceFile:[0,3]},specialized:[{term:5,get:n=>bT[n]||-1}],tokenPrec:0});let yT=0;class Tn{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=yT++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Tn&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Tn(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new xc(e);return i=>i.modified.indexOf(t)>-1?i:xc.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let vT=0;class xc{constructor(e){this.name=e,this.instances=[],this.id=vT++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(o=>o.base==e&&wT(t,o.modified));if(i)return i;let r=[],s=new Tn(e.name,r,e,t);for(let o of t)o.instances.push(s);let l=QT(t);for(let o of e.set)if(!o.modified.length)for(let a of l)r.push(xc.get(o,a));return s}}function wT(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function QT(n){let e=[[]];for(let t=0;ti.length-t.length)}function Ll(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],l=2,o=r;for(let O=0;;){if(o=="..."&&O>0&&O+3==r.length){l=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!p)throw new RangeError("Invalid path: "+r);if(s.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),O+=p[0].length,O==r.length)break;let g=r[O++];if(O==r.length&&g=="!"){l=0;break}if(g!="/")throw new RangeError("Invalid path: "+r);o=r.slice(O)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let h=new Wc(i,l,a>0?s.slice(0,a):null);e[c]=h.sort(e[c])}}return Ky.add(e)}const Ky=new at;class Wc{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=r;for(let o of s)for(let a of o.set){let c=t[a.id];if(c){l=l?l+" "+c:c;break}}return l},scope:i}}function _T(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function kT(n,e,t,i=0,r=n.length){let s=new PT(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class PT{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,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,i,r,s){let{type:l,from:o,to:a}=e;if(o>=i||a<=t)return;l.isTop&&(s=this.highlighters.filter(g=>!g.scope||g.scope(l)));let c=r,h=xT(e)||Wc.empty,O=_T(s,h.tags);if(O&&(c&&(c+=" "),c+=O,h.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,o),c),h.opaque)return;let p=e.tree&&e.tree.prop(at.mounted);if(p&&p.overlay){let g=e.node.enter(p.overlay[0].from+o,1),m=this.highlighters.filter(y=>!y.scope||y.scope(p.tree.type)),$=e.firstChild();for(let y=0,_=o;;y++){let W=y=R||!e.nextSibling())););if(!W||R>i)break;_=W.to+o,_>t&&(this.highlightRange(g.cursor(),Math.max(t,W.from+o),Math.min(i,_),"",m),this.startSpan(Math.min(i,_),c))}$&&e.parent()}else if(e.firstChild()){p&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}}function xT(n){let e=n.type.prop(Ky);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Oe=Tn.define,Nf=Oe(),us=Oe(),t0=Oe(us),i0=Oe(us),hs=Oe(),jf=Oe(hs),tO=Oe(hs),cr=Oe(),Vs=Oe(cr),ar=Oe(),fr=Oe(),od=Oe(),Wo=Oe(od),Bf=Oe(),b={comment:Nf,lineComment:Oe(Nf),blockComment:Oe(Nf),docComment:Oe(Nf),name:us,variableName:Oe(us),typeName:t0,tagName:Oe(t0),propertyName:i0,attributeName:Oe(i0),className:Oe(us),labelName:Oe(us),namespace:Oe(us),macroName:Oe(us),literal:hs,string:jf,docString:Oe(jf),character:Oe(jf),attributeValue:Oe(jf),number:tO,integer:Oe(tO),float:Oe(tO),bool:Oe(hs),regexp:Oe(hs),escape:Oe(hs),color:Oe(hs),url:Oe(hs),keyword:ar,self:Oe(ar),null:Oe(ar),atom:Oe(ar),unit:Oe(ar),modifier:Oe(ar),operatorKeyword:Oe(ar),controlKeyword:Oe(ar),definitionKeyword:Oe(ar),moduleKeyword:Oe(ar),operator:fr,derefOperator:Oe(fr),arithmeticOperator:Oe(fr),logicOperator:Oe(fr),bitwiseOperator:Oe(fr),compareOperator:Oe(fr),updateOperator:Oe(fr),definitionOperator:Oe(fr),typeOperator:Oe(fr),controlOperator:Oe(fr),punctuation:od,separator:Oe(od),bracket:Wo,angleBracket:Oe(Wo),squareBracket:Oe(Wo),paren:Oe(Wo),brace:Oe(Wo),content:cr,heading:Vs,heading1:Oe(Vs),heading2:Oe(Vs),heading3:Oe(Vs),heading4:Oe(Vs),heading5:Oe(Vs),heading6:Oe(Vs),contentSeparator:Oe(cr),list:Oe(cr),quote:Oe(cr),emphasis:Oe(cr),strong:Oe(cr),link:Oe(cr),monospace:Oe(cr),strikethrough:Oe(cr),inserted:Oe(),deleted:Oe(),changed:Oe(),invalid:Oe(),meta:Bf,documentMeta:Oe(Bf),annotation:Oe(Bf),processingInstruction:Oe(Bf),definition:Tn.defineModifier("definition"),constant:Tn.defineModifier("constant"),function:Tn.defineModifier("function"),standard:Tn.defineModifier("standard"),local:Tn.defineModifier("local"),special:Tn.defineModifier("special")};for(let n in b){let e=b[n];e instanceof Tn&&(e.name=n)}Jy([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var iO;const wl=new at;function ev(n){return _e.define({combine:n?e=>e.concat(n):void 0})}const Dd=new at;class Gn{constructor(e,t,i=[],r=""){this.data=e,this.name=r,Ot.prototype.hasOwnProperty("tree")||Object.defineProperty(Ot.prototype,"tree",{get(){return ei(this)}}),this.parser=t,this.extension=[Ws.of(this),Ot.languageData.of((s,l,o)=>{let a=n0(s,l,o),c=a.type.prop(wl);if(!c)return[];let h=s.facet(c),O=a.type.prop(Dd);if(O){let p=a.resolve(l-a.from,o);for(let g of O)if(g.test(p,s)){let m=s.facet(g.facet);return g.type=="replace"?m:m.concat(h)}}return h})].concat(i)}isActiveAt(e,t,i=-1){return n0(e,t,i).type.prop(wl)==this.data}findRegions(e){let t=e.facet(Ws);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,l)=>{if(s.prop(wl)==this.data){i.push({from:l,to:l+s.length});return}let o=s.prop(at.mounted);if(o){if(o.tree.prop(wl)==this.data){if(o.overlay)for(let a of o.overlay)i.push({from:a.from+l,to:a.to+l});else i.push({from:l,to:l+s.length});return}else if(o.overlay){let a=i.length;if(r(o.tree,o.overlay[0].from+l),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new xs(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ei(n){let e=n.field(Gn.state,!1);return e?e.tree:Bt.empty}class WT{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 i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Co=null;class Cc{constructor(e,t,i=[],r,s,l,o,a){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Cc(e,t,[],Bt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new WT(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Bt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=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(zr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Co;Co=this;try{return e()}finally{Co=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=r0(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,h,O,p)=>a.push({fromA:c,toA:h,fromB:O,toB:p})),i=zr.applyChanges(i,a),r=Bt.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let h=e.mapPos(c.from,1),O=e.mapPos(c.to,-1);he.from&&(this.fragments=r0(this.fragments,r,s),this.skipped.splice(i--,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 Fy{createParse(t,i,r){let s=r[0].from,l=r[r.length-1].to;return{parsedPos:s,advance(){let a=Co;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new Bt(Ni.none,[],[],l-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 Co}}function r0(n,e,t){return zr.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),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new El(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Cc.create(e.facet(Ws).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new El(i)}}Gn.state=pi.define({create:El.init,update(n,e){for(let t of e.effects)if(t.is(Gn.setState))return t.value;return e.startState.facet(Ws)!=e.state.facet(Ws)?El.init(e.state):n.apply(e)}});let tv=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(tv=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const nO=typeof navigator<"u"&&(!((iO=navigator.scheduling)===null||iO===void 0)&&iO.isInputPending)?()=>navigator.scheduling.isInputPending():null,CT=li.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(Gn.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(Gn.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=tv(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>nO&&nO()||Date.now()>l,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Gn.setState.of(new El(s.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>An(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()}}}),Ws=_e.define({combine(n){return n.length?n[0]:null},enables:n=>[Gn.state,CT,de.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Sa{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const TT=_e.define(),eu=_e.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 Tc(n){let e=n.facet(eu);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function fa(n,e){let t="",i=n.tabSize,r=n.facet(eu)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let s=0;s=e?ZT(n,t,e):null}class tu{constructor(e,t={}){this.state=e,this.options=t,this.unit=Tc(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=l-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return Il(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let l=s(r);if(l>-1)return l}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Nl=new at;function ZT(n,e,t){let i=e.resolveStack(t),r=i.node.enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let l=r;l!=i.node;l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)i={node:s[l],next:i}}return iv(i,n,t)}function iv(n,e,t){for(let i=n;i;i=i.next){let r=XT(i.node);if(r)return r(qd.create(e,t,i))}return 0}function RT(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function XT(n){let e=n.type.prop(Nl);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(at.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return l=>nv(l,!0,1,void 0,s&&!RT(l)?r.from:void 0)}return n.parent==null?AT:null}function AT(){return 0}class qd extends tu{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new qd(e,t,i)}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 i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(YT(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return iv(this.context.next,this.base,this.pos)}}function YT(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function UT(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),l=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromnv(i,e,t,n)}function nv(n,e,t,i,r){let s=n.textAfter,l=s.match(/^\s*/)[0].length,o=i&&s.slice(l,l+i.length)==i||r==n.pos+l,a=e?UT(n):null;return a?o?n.column(a.from):n.column(a.to):n.baseIndent+(o?0:n.unit*t)}const ET=n=>n.baseIndent;function Rl({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const zT=200;function MT(){return Ot.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+zT)return n;let s=t.sliceString(r.from,i);if(!e.some(c=>c.test(s)))return n;let{state:l}=n,o=-1,a=[];for(let{head:c}of l.selection.ranges){let h=l.doc.lineAt(c);if(h.from==o)continue;o=h.from;let O=Vd(l,h.from);if(O==null)continue;let p=/^\s*/.exec(h.text)[0],g=fa(l,O);p!=g&&a.push({from:h.from,to:h.from+p.length,insert:g})}return a.length?[n,{changes:a,sequential:!0}]:n})}const DT=_e.define(),jl=new at;function ur(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(s&&o.from=e&&c.to>t&&(s=c)}}return s}function qT(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Zc(n,e,t){for(let i of n.facet(DT)){let r=i(n,e,t);if(r)return r}return VT(n,e,t)}function rv(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const iu=Le.define({map:rv}),ba=Le.define({map:rv});function sv(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const Hs=pi.define({create(){return Ye.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(iu)&&!IT(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(av),r=i?Ye.replace({widget:new HT(i(e.state,t.value))}):s0;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(ba)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(r,s)=>{ri&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(r,s)=>s<=i||r>=i}))}return n},provide:n=>de.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!r||r.from>s)&&(r={from:s,to:l})}),r}function IT(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function lv(n,e){return n.field(Hs,!1)?e:e.concat(Le.appendConfig.of(fv()))}const LT=n=>{for(let e of sv(n)){let t=Zc(n.state,e.from,e.to);if(t)return n.dispatch({effects:lv(n.state,[iu.of(t),ov(n,t)])}),!0}return!1},NT=n=>{if(!n.state.field(Hs,!1))return!1;let e=[];for(let t of sv(n)){let i=Rc(n.state,t.from,t.to);i&&e.push(ba.of(i),ov(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function ov(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return de.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const jT=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(Hs,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,r)=>{t.push(ba.of({from:i,to:r}))}),n.dispatch({effects:t}),!0},FT=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:LT},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:NT},{key:"Ctrl-Alt-[",run:jT},{key:"Ctrl-Alt-]",run:BT}],GT={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},av=_e.define({combine(n){return br(n,GT)}});function fv(n){return[Hs,eZ]}function cv(n,e){let{state:t}=n,i=t.facet(av),r=l=>{let o=n.lineBlockAt(n.posAtDOM(l.target)),a=Rc(n.state,o.from,o.to);a&&n.dispatch({effects:ba.of(a)}),l.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const s0=Ye.replace({widget:new class extends Lr{toDOM(n){return cv(n,null)}}});class HT extends Lr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return cv(e,this.value)}}const KT={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class rO extends qr{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function JT(n={}){let e=Object.assign(Object.assign({},KT),n),t=new rO(e,!0),i=new rO(e,!1),r=li.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(Ws)!=l.state.facet(Ws)||l.startState.field(Hs,!1)!=l.state.field(Hs,!1)||ei(l.startState)!=ei(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new ys;for(let a of l.viewportLineBlocks){let c=Rc(l.state,a.from,a.to)?i:Zc(l.state,a.from,a.to)?t:null;c&&o.add(a.from,a.from,c)}return o.finish()}}),{domEventHandlers:s}=e;return[r,K3({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(r))===null||o===void 0?void 0:o.markers)||vt.empty},initialSpacer(){return new rO(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(l,o,a)=>{if(s.click&&s.click(l,o,a))return!0;let c=Rc(l.state,o.from,o.to);if(c)return l.dispatch({effects:ba.of(c)}),!0;let h=Zc(l.state,o.from,o.to);return h?(l.dispatch({effects:iu.of(h)}),!0):!1}})}),fv()]}const eZ=de.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class $a{constructor(e,t){this.specs=e;let i;function r(o){let a=vs.newName();return(i||(i=Object.create(null)))["."+a]=o,a}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,l=t.scope;this.scope=l instanceof Gn?o=>o.prop(wl)==l.data:l?o=>o==l:void 0,this.style=Jy(e.map(o=>({tag:o.tag,class:o.class||r(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=i?new vs(i):null,this.themeType=t.themeType}static define(e,t){return new $a(e,t||{})}}const ad=_e.define(),uv=_e.define({combine(n){return n.length?[n[0]]:null}});function sO(n){let e=n.facet(ad);return e.length?e:n.facet(uv)}function hv(n,e){let t=[iZ],i;return n instanceof $a&&(n.module&&t.push(de.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(uv.of(n)):i?t.push(ad.computeN([de.darkTheme],r=>r.facet(de.darkTheme)==(i=="dark")?[n]:[])):t.push(ad.of(n)),t}class tZ{constructor(e){this.markCache=Object.create(null),this.tree=ei(e.state),this.decorations=this.buildDeco(e,sO(e.state))}update(e){let t=ei(e.state),i=sO(e.state),r=i!=sO(e.startState);t.length{i.add(l,o,this.markCache[a]||(this.markCache[a]=Ye.mark({class:a})))},r,s);return i.finish()}}const iZ=Ks.high(li.fromClass(tZ,{decorations:n=>n.decorations})),nZ=$a.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),rZ=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),Ov=1e4,dv="()[]{}",pv=_e.define({combine(n){return br(n,{afterCursor:!0,brackets:dv,maxScanDistance:Ov,renderMatch:oZ})}}),sZ=Ye.mark({class:"cm-matchingBracket"}),lZ=Ye.mark({class:"cm-nonmatchingBracket"});function oZ(n){let e=[],t=n.matched?sZ:lZ;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const aZ=pi.define({create(){return Ye.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(pv);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=pr(e.state,r.head,-1,i)||r.head>0&&pr(e.state,r.head-1,1,i)||i.afterCursor&&(pr(e.state,r.head,1,i)||r.headde.decorations.from(n)}),fZ=[aZ,rZ];function cZ(n={}){return[pv.of(n),fZ]}const gv=new at;function fd(n,e,t){let i=n.prop(e<0?at.openedBy:at.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function cd(n){let e=n.type.prop(gv);return e?e(n.node):n}function pr(n,e,t,i={}){let r=i.maxScanDistance||Ov,s=i.brackets||dv,l=ei(n),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let c=fd(a.type,t,s);if(c&&a.from0?e>=h.from&&eh.from&&e<=h.to))return uZ(n,e,t,a,h,c,s)}}return hZ(n,e,t,l,o.type,r,s)}function uZ(n,e,t,i,r,s,l){let o=i.parent,a={from:r.from,to:r.to},c=0,h=o==null?void 0:o.cursor();if(h&&(t<0?h.childBefore(i.from):h.childAfter(i.to)))do if(t<0?h.to<=i.from:h.from>=i.to){if(c==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},h=n.doc.iterRange(e,t>0?n.doc.length:0),O=0;for(let p=0;!h.next().done&&p<=s;){let g=h.value;t<0&&(p+=g.length);let m=e+p*t;for(let $=t>0?0:g.length-1,y=t>0?g.length:-1;$!=y;$+=t){let _=l.indexOf(g[$]);if(!(_<0||i.resolveInner(m+$,1).type!=r))if(_%2==0==t>0)O++;else{if(O==1)return{start:c,end:{from:m+$,to:m+$+1},matched:_>>1==a>>1};O--}}t>0&&(p+=g.length)}return h.done?{start:c,matched:!1}:null}const OZ=Object.create(null),l0=[Ni.none],o0=[],dZ=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"]])dZ[n]=pZ(OZ,e);function lO(n,e){o0.indexOf(n)>-1||(o0.push(n),console.warn(e))}function pZ(n,e){let t=[];for(let s of e.split(" ")){let l=[];for(let o of s.split(".")){let a=n[o]||b[o];a?typeof a=="function"?l.length?l=l.map(a):lO(o,`Modifier ${o} used at start of tag`):l.length?lO(o,`Tag ${o} used as modifier`):l=Array.isArray(a)?a:[a]:lO(o,`Unknown highlighting tag ${o}`)}for(let o of l)t.push(o)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=Ni.define({id:l0.length,name:i,props:[Ll({[i]:t})]});return l0.push(r),r.id}const gZ=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Ld(n.state,t.from);return i.line?mZ(n):i.block?bZ(n):!1};function Id(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}const mZ=Id(vZ,0),SZ=Id(mv,0),bZ=Id((n,e)=>mv(n,e,yZ(e)),0);function Ld(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const To=50;function $Z(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-To,i),l=n.sliceDoc(r,r+To),o=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(l)[0].length,c=s.length-o;if(s.slice(c-e.length,c)==e&&l.slice(a,a+t.length)==t)return{open:{pos:i-o,margin:o&&1},close:{pos:r+a,margin:a&&1}};let h,O;r-i<=2*To?h=O=n.sliceDoc(i,r):(h=n.sliceDoc(i,i+To),O=n.sliceDoc(r-To,r));let p=/^\s*/.exec(h)[0].length,g=/\s*$/.exec(O)[0].length,m=O.length-g-t.length;return h.slice(p,p+e.length)==e&&O.slice(m,m+t.length)==t?{open:{pos:i+p+e.length,margin:/\s/.test(h.charAt(p+e.length))?1:0},close:{pos:r-g-t.length,margin:/\s/.test(O.charAt(m-1))?1:0}}:null}function yZ(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to),s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function mv(n,e,t=e.selection.ranges){let i=t.map(s=>Ld(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,l)=>$Z(e,i[l],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,l)=>r[l]?[]:[{from:s.from,insert:i[l].open+" "},{from:s.to,insert:" "+i[l].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let l=0,o;lr&&(s==l||l>O.from)){r=O.from;let p=/^\s*/.exec(O.text)[0].length,g=p==O.length,m=O.text.slice(p,p+c.length)==c?p:-1;ps.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:a,indent:c,empty:h,single:O}of i)(O||!h)&&s.push({from:o.from+c,insert:a+" "});let l=e.changes(s);return{changes:l,selection:e.selection.map(l,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:l,comment:o,token:a}of i)if(o>=0){let c=l.from+o,h=c+a.length;l.text[h-l.from]==" "&&h++,s.push({from:c,to:h})}return{changes:s}}return null}const ud=Ir.define(),wZ=Ir.define(),QZ=_e.define(),Sv=_e.define({combine(n){return br(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}});function _Z(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const bv=pi.define({create(){return gr.empty},update(n,e){let t=e.state.facet(Sv),i=e.annotation(ud);if(i){let a=e.docChanged?ee.single(_Z(e.changes)):void 0,c=Ji.fromTransaction(e,a),h=i.side,O=h==0?n.undone:n.done;return c?O=Xc(O,O.length,t.minDepth,c):O=vv(O,e.startState.selection),new gr(h==0?i.rest:O,h==0?O:i.rest)}let r=e.annotation(wZ);if((r=="full"||r=="before")&&(n=n.isolate()),e.annotation(hi.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=Ji.fromTransaction(e),l=e.annotation(hi.time),o=e.annotation(hi.userEvent);return s?n=n.addChanges(s,l,o,t,e):e.selection&&(n=n.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(r=="full"||r=="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 gr(n.done.map(Ji.fromJSON),n.undone.map(Ji.fromJSON))}});function kZ(n={}){return[bv,Sv.of(n),de.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?$v:e.inputType=="historyRedo"?hd:null;return i?(e.preventDefault(),i(t)):!1}})]}function nu(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field(bv,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}const $v=nu(0,!1),hd=nu(1,!1),PZ=nu(0,!0),xZ=nu(1,!0);class Ji{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new Ji(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;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:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new Ji(e.changes&&ui.fromJSON(e.changes),[],e.mapped&&mr.fromJSON(e.mapped),e.startSelection&&ee.fromJSON(e.startSelection),e.selectionsAfter.map(ee.fromJSON))}static fromTransaction(e,t){let i=Xn;for(let r of e.startState.facet(QZ)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new Ji(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Xn)}static selection(e){return new Ji(void 0,Xn,void 0,void 0,e)}}function Xc(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function WZ(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,l,o)=>{for(let a=0;a=c&&l<=h&&(i=!0)}}),i}function CZ(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function yv(n,e){return n.length?e.length?n.concat(e):n:e}const Xn=[],TZ=200;function vv(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-TZ));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Xc(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Ji.selection([e])]}function ZZ(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 oO(n,e){if(!n.length)return n;let t=n.length,i=Xn;for(;t;){let r=RZ(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[Ji.selection(i)]:Xn}function RZ(n,e,t){let i=yv(n.selectionsAfter.length?n.selectionsAfter.map(o=>o.map(e)):Xn,t);if(!n.changes)return Ji.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),l=n.mapped?n.mapped.composeDesc(s):s;return new Ji(r,Le.mapEffects(n.effects,e),l,n.startSelection.map(s),i)}const XZ=/^(input\.type|delete)($|\.)/;class gr{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new gr(this.done,this.undone):this}addChanges(e,t,i,r,s){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!i||XZ.test(i))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):ru(t,e))}function Mi(n){return n.textDirectionAt(n.state.selection.main.head)==jt.LTR}const Qv=n=>wv(n,!Mi(n)),_v=n=>wv(n,Mi(n));function kv(n,e){return er(n,t=>t.empty?n.moveByGroup(t,e):ru(t,e))}const YZ=n=>kv(n,!Mi(n)),UZ=n=>kv(n,Mi(n));function EZ(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function su(n,e,t){let i=ei(n).resolveInner(e.head),r=t?at.closedBy:at.openedBy;for(let a=e.head;;){let c=t?i.childAfter(a):i.childBefore(a);if(!c)break;EZ(n,c,r)?i=c:a=t?c.to:c.from}let s=i.type.prop(r),l,o;return s&&(l=t?pr(n,i.from,1):pr(n,i.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?i.to:i.from,ee.cursor(o,t?-1:1)}const zZ=n=>er(n,e=>su(n.state,e,!Mi(n))),MZ=n=>er(n,e=>su(n.state,e,Mi(n)));function Pv(n,e){return er(n,t=>{if(!t.empty)return ru(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const xv=n=>Pv(n,!1),Wv=n=>Pv(n,!0);function Cv(n){let e=n.scrollDOM.clientHeightl.empty?n.moveVertically(l,e,t.height):ru(l,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let l=n.coordsAtPos(i.selection.main.head),o=n.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,c=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomTv(n,!1),Od=n=>Tv(n,!0);function Cs(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=ee.cursor(i.from+s))}return r}const DZ=n=>er(n,e=>Cs(n,e,!0)),VZ=n=>er(n,e=>Cs(n,e,!1)),qZ=n=>er(n,e=>Cs(n,e,!Mi(n))),IZ=n=>er(n,e=>Cs(n,e,Mi(n))),LZ=n=>er(n,e=>ee.cursor(n.lineBlockAt(e.head).from,1)),NZ=n=>er(n,e=>ee.cursor(n.lineBlockAt(e.head).to,-1));function jZ(n,e,t){let i=!1,r=Bl(n.selection,s=>{let l=pr(n,s.head,-1)||pr(n,s.head,1)||s.head>0&&pr(n,s.head-1,1)||s.headjZ(n,e);function Un(n,e){let t=Bl(n.state.selection,i=>{let r=e(i);return ee.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(yr(n.state,t)),!0)}function Zv(n,e){return Un(n,t=>n.moveByChar(t,e))}const Rv=n=>Zv(n,!Mi(n)),Xv=n=>Zv(n,Mi(n));function Av(n,e){return Un(n,t=>n.moveByGroup(t,e))}const FZ=n=>Av(n,!Mi(n)),GZ=n=>Av(n,Mi(n)),HZ=n=>Un(n,e=>su(n.state,e,!Mi(n))),KZ=n=>Un(n,e=>su(n.state,e,Mi(n)));function Yv(n,e){return Un(n,t=>n.moveVertically(t,e))}const Uv=n=>Yv(n,!1),Ev=n=>Yv(n,!0);function zv(n,e){return Un(n,t=>n.moveVertically(t,e,Cv(n).height))}const f0=n=>zv(n,!1),c0=n=>zv(n,!0),JZ=n=>Un(n,e=>Cs(n,e,!0)),eR=n=>Un(n,e=>Cs(n,e,!1)),tR=n=>Un(n,e=>Cs(n,e,!Mi(n))),iR=n=>Un(n,e=>Cs(n,e,Mi(n))),nR=n=>Un(n,e=>ee.cursor(n.lineBlockAt(e.head).from)),rR=n=>Un(n,e=>ee.cursor(n.lineBlockAt(e.head).to)),u0=({state:n,dispatch:e})=>(e(yr(n,{anchor:0})),!0),h0=({state:n,dispatch:e})=>(e(yr(n,{anchor:n.doc.length})),!0),O0=({state:n,dispatch:e})=>(e(yr(n,{anchor:n.selection.main.anchor,head:0})),!0),d0=({state:n,dispatch:e})=>(e(yr(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),sR=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),lR=({state:n,dispatch:e})=>{let t=lu(n).map(({from:i,to:r})=>ee.range(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:ee.create(t),userEvent:"select"})),!0},oR=({state:n,dispatch:e})=>{let t=Bl(n.selection,i=>{var r;let s=ei(n).resolveStack(i.from,1);for(let l=s;l;l=l.next){let{node:o}=l;if((o.from=i.to||o.to>i.to&&o.from<=i.from)&&(!((r=o.parent)===null||r===void 0)&&r.parent))return ee.range(o.to,o.from)}return i});return e(yr(n,t)),!0},aR=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=ee.create([t.main]):t.main.empty||(i=ee.create([ee.cursor(t.main.head)])),i?(e(yr(n,i)),!0):!1};function ya(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,r=i.changeByRange(s=>{let{from:l,to:o}=s;if(l==o){let a=e(s);al&&(t="delete.forward",a=Ff(n,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=Ff(n,l,!1),o=Ff(n,o,!0);return l==o?{range:s}:{changes:{from:l,to:o},range:ee.cursor(l,lr(n)))i.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}const Mv=(n,e)=>ya(n,t=>{let i=t.from,{state:r}=n,s=r.doc.lineAt(i),l,o;if(!e&&i>s.from&&iMv(n,!1),Dv=n=>Mv(n,!0),Vv=(n,e)=>ya(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let o=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=Ei(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),h=l(c);if(o!=null&&h!=o)break;(c!=" "||i!=t.head)&&(o=h),i=a}return i}),qv=n=>Vv(n,!1),fR=n=>Vv(n,!0),cR=n=>ya(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headya(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),hR=n=>ya(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:mt.of(["",""])},range:ee.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},dR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),l=r==s.from?r-1:Ei(s.text,r-s.from,!1)+s.from,o=r==s.to?r+1:Ei(s.text,r-s.from,!0)+s.from;return{changes:{from:l,to:o,insert:n.doc.slice(r,o).append(n.doc.slice(l,r))},range:ee.cursor(o)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function lu(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let l=e[e.length-1];l.to=s.to,l.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function Iv(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of lu(n)){if(t?s.to==n.doc.length:s.from==0)continue;let l=n.doc.lineAt(t?s.to+1:s.from-1),o=l.length+1;if(t){i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+n.lineBreak});for(let a of s.ranges)r.push(ee.range(Math.min(n.doc.length,a.anchor+o),Math.min(n.doc.length,a.head+o)))}else{i.push({from:l.from,to:s.from},{from:s.to,insert:n.lineBreak+l.text});for(let a of s.ranges)r.push(ee.range(a.anchor-o,a.head-o))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:ee.create(r,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const pR=({state:n,dispatch:e})=>Iv(n,e,!1),gR=({state:n,dispatch:e})=>Iv(n,e,!0);function Lv(n,e,t){if(n.readOnly)return!1;let i=[];for(let r of lu(n))t?i.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):i.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const mR=({state:n,dispatch:e})=>Lv(n,e,!1),SR=({state:n,dispatch:e})=>Lv(n,e,!0),bR=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(lu(e).map(({from:r,to:s})=>(r>0?r--:sn.moveVertically(r,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function $R(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ei(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(at.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const yR=Nv(!1),vR=Nv(!0);function Nv(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:l}=r,o=e.doc.lineAt(s),a=!n&&s==l&&$R(e,s);n&&(s=l=(l<=o.to?o:e.doc.lineAt(l)).to);let c=new tu(e,{simulateBreak:s,simulateDoubleBreak:!!a}),h=Vd(c,s);for(h==null&&(h=Il(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));lo.from&&s{let r=[];for(let l=i.from;l<=i.to;){let o=n.doc.lineAt(l);o.number>t&&(i.empty||i.to>o.from)&&(e(o,r,i),t=o.number),l=o.to+1}let s=n.changes(r);return{changes:r,range:ee.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const wR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new tu(n,{overrideIndentation:s=>{let l=t[s];return l??-1}}),r=Nd(n,(s,l,o)=>{let a=Vd(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],h=fa(n,a);(c!=h||o.fromn.readOnly?!1:(e(n.update(Nd(n,(t,i)=>{i.push({from:t.from,insert:n.facet(eu)})}),{userEvent:"input.indent"})),!0),Bv=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Nd(n,(t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=Il(r,n.tabSize),l=0,o=fa(n,Math.max(0,s-Tc(n)));for(;l({mac:n.key,run:n.run,shift:n.shift}))),kR=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:zZ,shift:HZ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:MZ,shift:KZ},{key:"Alt-ArrowUp",run:pR},{key:"Shift-Alt-ArrowUp",run:mR},{key:"Alt-ArrowDown",run:gR},{key:"Shift-Alt-ArrowDown",run:SR},{key:"Escape",run:aR},{key:"Mod-Enter",run:vR},{key:"Alt-l",mac:"Ctrl-l",run:lR},{key:"Mod-i",run:oR,preventDefault:!0},{key:"Mod-[",run:Bv},{key:"Mod-]",run:jv},{key:"Mod-Alt-\\",run:wR},{key:"Shift-Mod-k",run:bR},{key:"Shift-Mod-\\",run:BZ},{key:"Mod-/",run:gZ},{key:"Alt-A",run:SZ}].concat(_R),PR={key:"Tab",run:jv,shift:Bv};function Yt(){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 i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];typeof r=="string"?n.setAttribute(i,r):r!=null&&(n[i]=r)}e++}for(;en.normalize("NFKD"):n=>n;class zl{constructor(e,t,i=0,r=e.length,s,l){this.test=l,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?o=>s(p0(o)):p0,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 Qi(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=Qd(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Zn(e);let r=this.normalize(t);for(let s=0,l=i;;s++){let o=r.charCodeAt(s),a=this.match(o,l);if(s==r.length-1){if(a)return this.value=a,this;break}l==i&&sthis.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 i=this.curLineStart+t.index,r=i+t[0].length;if(this.matchPos=Ac(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=t){let o=new Xl(t,e.sliceString(t,i));return aO.set(e,o),o}if(r.from==t&&r.to==i)return r;let{text:s,from:l}=r;return l>t&&(s=e.sliceString(t,l)+s,l=t),r.to=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 i=this.flat.from+t.index,r=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this.matchPos=Ac(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Xl.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Hv.prototype[Symbol.iterator]=Kv.prototype[Symbol.iterator]=function(){return this});function xR(n){try{return new RegExp(n,jd),!0}catch{return!1}}function Ac(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function pd(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Yt("input",{class:"cm-textfield",name:"line",value:e}),i=Yt("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:Yc.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),r())},onsubmit:s=>{s.preventDefault(),r()}},Yt("label",n.state.phrase("Go to line"),": ",t)," ",Yt("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function r(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:l}=n,o=l.doc.lineAt(l.selection.main.head),[,a,c,h,O]=s,p=h?+h.slice(1):0,g=c?+c:o.number;if(c&&O){let y=g/100;a&&(y=y*(a=="-"?-1:1)+o.number/l.doc.lines),g=Math.round(l.doc.lines*y)}else c&&a&&(g=g*(a=="-"?-1:1)+o.number);let m=l.doc.line(Math.max(1,Math.min(l.doc.lines,g))),$=ee.cursor(m.from+Math.max(0,Math.min(p,m.length)));n.dispatch({effects:[Yc.of(!1),de.scrollIntoView($.from,{y:"center"})],selection:$}),n.focus()}return{dom:i}}const Yc=Le.define(),g0=pi.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Yc)&&(n=t.value);return n},provide:n=>sa.from(n,e=>e?pd:null)}),WR=n=>{let e=ra(n,pd);if(!e){let t=[Yc.of(!0)];n.state.field(g0,!1)==null&&t.push(Le.appendConfig.of([g0,CR])),n.dispatch({effects:t}),e=ra(n,pd)}return e&&e.dom.querySelector("input").select(),!0},CR=de.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),TR={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},ZR=_e.define({combine(n){return br(n,TR,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function RR(n){return[ER,UR]}const XR=Ye.mark({class:"cm-selectionMatch"}),AR=Ye.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function m0(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=Lt.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=Lt.Word)}function YR(n,e,t,i){return n(e.sliceDoc(t,t+1))==Lt.Word&&n(e.sliceDoc(i-1,i))==Lt.Word}const UR=li.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(ZR),{state:t}=n,i=t.selection;if(i.ranges.length>1)return Ye.none;let r=i.main,s,l=null;if(r.empty){if(!e.highlightWordAroundCursor)return Ye.none;let a=t.wordAt(r.head);if(!a)return Ye.none;l=t.charCategorizer(r.head),s=t.sliceDoc(a.from,a.to)}else{let a=r.to-r.from;if(a200)return Ye.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),l=t.charCategorizer(r.head),!(m0(l,t,r.from,r.to)&&YR(l,t,r.from,r.to)))return Ye.none}else if(s=t.sliceDoc(r.from,r.to).trim(),!s)return Ye.none}let o=[];for(let a of n.visibleRanges){let c=new zl(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:h,to:O}=c.value;if((!l||m0(l,t,h,O))&&(r.empty&&h<=r.from&&O>=r.to?o.push(AR.range(h,O)):(h>=r.to||O<=r.from)&&o.push(XR.range(h,O)),o.length>e.maxMatches))return Ye.none}}return Ye.set(o)}},{decorations:n=>n.decorations}),ER=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),zR=({state:n,dispatch:e})=>{let{selection:t}=n,i=ee.create(t.ranges.map(r=>n.wordAt(r.head)||ee.cursor(r.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function MR(n,e){let{main:t,ranges:i}=n.selection,r=n.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let l=!1,o=new zl(n.doc,e,i[i.length-1].to);;)if(o.next(),o.done){if(l)return null;o=new zl(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),l=!0}else{if(l&&i.some(a=>a.from==o.value.from))continue;if(s){let a=n.wordAt(o.value.from);if(!a||a.from!=o.value.from||a.to!=o.value.to)continue}return o.value}}const DR=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return zR({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=i))return!1;let r=MR(n,i);return r?(e(n.update({selection:n.selection.addRange(ee.range(r.from,r.to),!1),effects:de.scrollIntoView(r.to)})),!0):!1},Fl=_e.define({combine(n){return br(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new JR(e),scrollToMatch:e=>de.scrollIntoView(e)})}});class Jv{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||xR(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` -`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new LR(this):new qR(this)}getCursor(e,t=0,i){let r=e.doc?e:Ot.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?$l(this,r,t,i):bl(this,r,t,i)}}class ew{constructor(e){this.spec=e}}function bl(n,e,t,i){return new zl(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),n.wholeWord?VR(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function VR(n,e){return(t,i,r,s)=>((s>t||s+r.length=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=bl(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function $l(n,e,t,i){return new Hv(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?IR(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Uc(n,e){return n.slice(Ei(n,e,!1),e)}function Ec(n,e){return n.slice(e,Ei(n,e))}function IR(n){return(e,t,i)=>!i[0].length||(n(Uc(i.input,i.index))!=Lt.Word||n(Ec(i.input,i.index))!=Lt.Word)&&(n(Ec(i.input,i.index+i[0].length))!=Lt.Word||n(Uc(i.input,i.index+i[0].length))!=Lt.Word)}class LR extends ew{nextMatch(e,t,i){let r=$l(this.spec,e,i,e.doc.length).next();return r.done&&(r=$l(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let s=Math.max(t,i-r*1e4),l=$l(this.spec,e,s,i),o=null;for(;!l.next().done;)o=l.value;if(o&&(s==t||o.from>s+10))return o;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=$l(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const ca=Le.define(),Bd=Le.define(),bs=pi.define({create(n){return new fO(gd(n).create(),null)},update(n,e){for(let t of e.effects)t.is(ca)?n=new fO(t.value.create(),n.panel):t.is(Bd)&&(n=new fO(n.query,t.value?Fd:null));return n},provide:n=>sa.from(n,e=>e.panel)});class fO{constructor(e,t){this.query=e,this.panel=t}}const NR=Ye.mark({class:"cm-searchMatch"}),jR=Ye.mark({class:"cm-searchMatch cm-searchMatch-selected"}),BR=li.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(bs))}update(n){let e=n.state.field(bs);(e!=n.startState.field(bs)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ye.none;let{view:t}=this,i=new ys;for(let r=0,s=t.visibleRanges,l=s.length;rs[r+1].from-2*250;)a=s[++r].to;n.highlight(t.state,o,a,(c,h)=>{let O=t.state.selection.ranges.some(p=>p.from==c&&p.to==h);i.add(c,h,O?jR:NR)})}return i.finish()}},{decorations:n=>n.decorations});function va(n){return e=>{let t=e.state.field(bs,!1);return t&&t.query.spec.valid?n(e,t):nw(e)}}const zc=va((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let r=ee.single(i.from,i.to),s=n.state.facet(Fl);return n.dispatch({selection:r,effects:[Gd(n,i),s.scrollToMatch(r.main,n)],userEvent:"select.search"}),iw(n),!0}),Mc=va((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let s=ee.single(r.from,r.to),l=n.state.facet(Fl);return n.dispatch({selection:s,effects:[Gd(n,r),l.scrollToMatch(s.main,n)],userEvent:"select.search"}),iw(n),!0}),FR=va((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:ee.create(t.map(i=>ee.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),GR=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:r}=t.main,s=[],l=0;for(let o=new zl(n.doc,n.sliceDoc(i,r));!o.next().done;){if(s.length>1e3)return!1;o.value.from==i&&(l=s.length),s.push(ee.range(o.value.from,o.value.to))}return e(n.update({selection:ee.create(s,l),userEvent:"select.search.matches"})),!0},S0=va((n,{query:e})=>{let{state:t}=n,{from:i,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,i,i);if(!s)return!1;let l=[],o,a,c=[];if(s.from==i&&s.to==r&&(a=t.toText(e.getReplacement(s)),l.push({from:s.from,to:s.to,insert:a}),s=e.nextMatch(t,s.from,s.to),c.push(de.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),s){let h=l.length==0||l[0].from>=s.to?0:s.to-s.from-a.length;o=ee.single(s.from-h,s.to-h),c.push(Gd(n,s)),c.push(t.facet(Fl).scrollToMatch(o.main,n))}return n.dispatch({changes:l,selection:o,effects:c,userEvent:"input.replace"}),!0}),HR=va((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(r=>{let{from:s,to:l}=r;return{from:s,to:l,insert:e.getReplacement(r)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:de.announce.of(i),userEvent:"input.replace.all"}),!0});function Fd(n){return n.state.facet(Fl).createPanel(n)}function gd(n,e){var t,i,r,s,l;let o=n.selection.main,a=o.empty||o.to>o.from+100?"":n.sliceDoc(o.from,o.to);if(e&&!a)return e;let c=n.facet(Fl);return new Jv({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(l=e==null?void 0:e.wholeWord)!==null&&l!==void 0?l:c.wholeWord})}function tw(n){let e=ra(n,Fd);return e&&e.dom.querySelector("[main-field]")}function iw(n){let e=tw(n);e&&e==n.root.activeElement&&e.select()}const nw=n=>{let e=n.state.field(bs,!1);if(e&&e.panel){let t=tw(n);if(t&&t!=n.root.activeElement){let i=gd(n.state,e.query.spec);i.valid&&n.dispatch({effects:ca.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Bd.of(!0),e?ca.of(gd(n.state,e.query.spec)):Le.appendConfig.of(tX)]});return!0},rw=n=>{let e=n.state.field(bs,!1);if(!e||!e.panel)return!1;let t=ra(n,Fd);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Bd.of(!1)}),!0},KR=[{key:"Mod-f",run:nw,scope:"editor search-panel"},{key:"F3",run:zc,shift:Mc,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:zc,shift:Mc,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:rw,scope:"editor search-panel"},{key:"Mod-Shift-l",run:GR},{key:"Alt-g",run:WR},{key:"Mod-d",run:DR,preventDefault:!0}];class JR{constructor(e){this.view=e;let t=this.query=e.state.field(bs).query.spec;this.commit=this.commit.bind(this),this.searchField=Yt("input",{value:t.search,placeholder:cn(e,"Find"),"aria-label":cn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Yt("input",{value:t.replace,placeholder:cn(e,"Replace"),"aria-label":cn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Yt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Yt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Yt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(r,s,l){return Yt("button",{class:"cm-button",name:r,onclick:s,type:"button"},l)}this.dom=Yt("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>zc(e),[cn(e,"next")]),i("prev",()=>Mc(e),[cn(e,"previous")]),i("select",()=>FR(e),[cn(e,"all")]),Yt("label",null,[this.caseField,cn(e,"match case")]),Yt("label",null,[this.reField,cn(e,"regexp")]),Yt("label",null,[this.wordField,cn(e,"by word")]),...e.state.readOnly?[]:[Yt("br"),this.replaceField,i("replace",()=>S0(e),[cn(e,"replace")]),i("replaceAll",()=>HR(e),[cn(e,"replace all")])],Yt("button",{name:"close",onclick:()=>rw(e),"aria-label":cn(e,"close"),type:"button"},["×"])])}commit(){let e=new Jv({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:ca.of(e)}))}keydown(e){c3(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Mc:zc)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),S0(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(ca)&&!i.value.eq(this.query)&&this.setQuery(i.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(Fl).top}}function cn(n,e){return n.state.phrase(e)}const Gf=30,Hf=/[\s\.,:;?!]/;function Gd(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),r=n.state.doc.lineAt(t).to,s=Math.max(i.from,e-Gf),l=Math.min(r,t+Gf),o=n.state.sliceDoc(s,l);if(s!=i.from){for(let a=0;ao.length-Gf;a--)if(!Hf.test(o[a-1])&&Hf.test(o[a])){o=o.slice(0,a);break}}return de.announce.of(`${n.state.phrase("current match")}. ${o} ${n.state.phrase("on line")} ${i.number}.`)}const eX=de.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"}}),tX=[bs,Ks.low(BR),eX];class sw{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ei(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),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(ow(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function b0(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 iX(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:iX(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function nX(n,e){return t=>{for(let i=ei(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class $0{constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}}function $s(n){return n.selection.main.from}function ow(n,e){var t;let{source:i}=n,r=e&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?n:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const aw=Ir.define();function rX(n,e,t,i){let{main:r}=n.selection,s=t-r.from,l=i-r.from;return Object.assign(Object.assign({},n.changeByRange(o=>o!=r&&t!=i&&n.sliceDoc(o.from+s,o.from+l)!=n.sliceDoc(t,i)?{range:o}:{changes:{from:o.from+s,to:i==r.from?o.to:o.from+l,insert:e},range:ee.cursor(o.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const y0=new WeakMap;function sX(n){if(!Array.isArray(n))return n;let e=y0.get(n);return e||y0.set(n,e=lw(n)),e}const Hd=Le.define(),ua=Le.define();class lX{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=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(E=Qd(C))!=E.toLowerCase()?1:E!=E.toUpperCase()?2:0;(!W||D==1&&y||X==0&&D!=0)&&(t[O]==C||i[O]==C&&(p=!0)?l[O++]=W:l.length&&(_=!1)),X=D,W+=Zn(C)}return O==a&&l[0]==0&&_?this.result(-100+(p?-200:0),l,e):g==a&&m==0?this.ret(-200-e.length+($==e.length?0:-100),[0,$]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):g==a?this.ret(-900-e.length,[m,$]):O==a?this.result(-100+(p?-200:0)+-700+(_?0:-1100),l,e):t.length==2?!1:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],s=0;for(let l of t){let o=l+(this.astral?Zn(Qi(i,l)):1);s&&r[s-1]==l?r[s-1]=o:(r[s++]=l,r[s++]=o)}return this.ret(e-i.length,r)}}const Ui=_e.define({combine(n){return br(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:oX,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>v0(e(i),t(i)),optionClass:(e,t)=>i=>v0(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function v0(n,e){return n?e?n+" "+e:n:e}function oX(n,e,t,i,r,s){let l=n.textDirection==jt.RTL,o=l,a=!1,c="top",h,O,p=e.left-r.left,g=r.right-e.right,m=i.right-i.left,$=i.bottom-i.top;if(o&&p=$||W>e.top?h=t.bottom-e.top:(c="bottom",h=e.bottom-t.top)}let y=(e.bottom-e.top)/s.offsetHeight,_=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${h/y}px; max-width: ${O/_}px`,class:"cm-completionInfo-"+(a?l?"left-narrow":"right-narrow":o?"left":"right")}}function aX(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,r,s){let l=document.createElement("span");l.className="cm-completionLabel";let o=t.displayLabel||t.label,a=0;for(let c=0;ca&&l.appendChild(document.createTextNode(o.slice(a,h)));let p=l.appendChild(document.createElement("span"));p.appendChild(document.createTextNode(o.slice(h,O))),p.className="cm-completionMatchedText",a=O}return at.position-i.position).map(t=>t.render)}function cO(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class fX{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:l}=r.open,o=e.state.facet(Ui);this.optionContent=aX(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=cO(s.length,l,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(t).open;for(let h=a.target,O;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(O=/-(\d+)$/.exec(h.id))&&+O[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Ui).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:ua.of(null)})}),this.showOptions(s,r.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 i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:l,disabled:o}=i.open;(!r.open||r.open.options!=s)&&(this.range=cO(s.length,l,e.state.facet(Ui).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);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;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=cO(t.options.length,t.selected,this.view.state.facet(Ui).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let s=typeof r=="string"?document.createTextNode(r):r(i);if(!s)return;"then"in s?s.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,i)}).catch(l=>An(this.view.state,l,"completion info")):this.addInfoPane(s,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&uX(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let l=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:l.innerWidth,bottom:l.innerHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottomi.from||i.from==0))if(s=p,typeof c!="string"&&c.header)r.appendChild(c.header(c));else{let g=r.appendChild(document.createElement("completion-section"));g.textContent=p}}const h=r.appendChild(document.createElement("li"));h.id=t+"-"+l,h.setAttribute("role","option");let O=this.optionClass(o);O&&(h.className=O);for(let p of this.optionContent){let g=p(o,this.view.state,this.view,a);g&&h.appendChild(g)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew fX(t,n,e)}function uX(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function w0(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function hX(n,e){let t=[],i=null,r=a=>{t.push(a);let{section:c}=a.completion;if(c){i||(i=[]);let h=typeof c=="string"?c:c.name;i.some(O=>O.name==h)||i.push(typeof c=="string"?{name:h}:c)}};for(let a of n)if(a.hasResult()){let c=a.result.getMatch;if(a.result.filter===!1)for(let h of a.result.options)r(new $0(h,a.source,c?c(h):[],1e9-t.length));else{let h=new lX(e.sliceDoc(a.from,a.to));for(let O of a.result.options)if(h.match(O.label)){let p=O.displayLabel?c?c(O,h.matched):[]:h.matched;r(new $0(O,a.source,p,h.score+(O.boost||0)))}}}if(i){let a=Object.create(null),c=0,h=(O,p)=>{var g,m;return((g=O.rank)!==null&&g!==void 0?g:1e9)-((m=p.rank)!==null&&m!==void 0?m:1e9)||(O.nameh.score-c.score||o(c.completion,h.completion))){let c=a.completion;!l||l.label!=c.label||l.detail!=c.detail||l.type!=null&&c.type!=null&&l.type!=c.type||l.apply!=c.apply||l.boost!=c.boost?s.push(a):w0(a.completion)>w0(l)&&(s[s.length-1]=a),l=a.completion}return s}class Ql{constructor(e,t,i,r,s,l){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=l}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new Ql(this.options,Q0(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,s){let l=hX(e,t);if(!l.length)return r&&e.some(a=>a.state==1)?new Ql(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let o=t.facet(Ui).selectOnOpen?0:-1;if(r&&r.selected!=o&&r.selected!=-1){let a=r.options[r.selected].completion;for(let c=0;cc.hasResult()?Math.min(a,c.from):a,1e8),create:mX,above:s.aboveCursor},r?r.timestamp:Date.now(),o,!1)}map(e){return new Ql(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Dc{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Dc(pX,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Ui),s=(i.override||t.languageDataAt("autocomplete",$s(t)).map(sX)).map(o=>(this.active.find(c=>c.source==o)||new Ki(o,this.active.some(c=>c.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((o,a)=>o==this.active[a])&&(s=this.active);let l=this.open;l&&e.docChanged&&(l=l.map(e.changes)),e.selection||s.some(o=>o.hasResult()&&e.changes.touchesRange(o.from,o.to))||!OX(s,this.active)?l=Ql.build(s,t,this.id,l,i):l&&l.disabled&&!s.some(o=>o.state==1)&&(l=null),!l&&s.every(o=>o.state!=1)&&s.some(o=>o.hasResult())&&(s=s.map(o=>o.hasResult()?new Ki(o.source,0):o));for(let o of e.effects)o.is(cw)&&(l=l&&l.setSelected(o.value,this.id));return s==this.active&&l==this.open?this:new Dc(s,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:dX}}function OX(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const pX=[];function md(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class Ki{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=md(e),r=this;i?r=r.handleUserEvent(e,i,t):e.docChanged?r=r.handleChange(e):e.selection&&r.state!=0&&(r=new Ki(r.source,0));for(let s of e.effects)if(s.is(Hd))r=new Ki(r.source,1,s.value?$s(e.state):-1);else if(s.is(ua))r=new Ki(r.source,0);else if(s.is(fw))for(let l of s.value)l.source==r.source&&(r=l);return r}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new Ki(this.source,1)}handleChange(e){return e.changes.touchesRange($s(e.startState))?new Ki(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Ki(this.source,this.state,e.mapPos(this.explicitPos))}}class Al extends Ki{constructor(e,t,i,r,s){super(e,2,t),this.result=i,this.from=r,this.to=s}hasResult(){return!0}handleUserEvent(e,t,i){var r;let s=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),o=$s(e.state);if((this.explicitPos<0?o<=s:ol||t=="delete"&&$s(e.startState)==this.from)return new Ki(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),c;return gX(this.result.validFor,e.state,s,l)?new Al(this.source,a,this.result,s,l):this.result.update&&(c=this.result.update(this.result,s,l,new sw(e.state,o,a>=0)))?new Al(this.source,a,c,c.from,(r=c.to)!==null&&r!==void 0?r:$s(e.state)):new Ki(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ki(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Al(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function gX(n,e,t,i){if(!n)return!1;let r=e.sliceDoc(t,i);return typeof n=="function"?n(r,t,i,e):ow(n,!0).test(r)}const fw=Le.define({map(n,e){return n.map(t=>t.map(e))}}),cw=Le.define(),On=pi.define({create(){return Dc.start()},update(n,e){return n.update(e)},provide:n=>[Xd.from(n,e=>e.tooltip),de.contentAttributes.from(n,e=>e.attrs)]});function uw(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(On).active.find(r=>r.source==e.source);return i instanceof Al?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},rX(n.state,t,i.from,i.to)),{annotations:aw.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}const mX=cX(On,uw);function Kf(n,e="option"){return t=>{let i=t.state.field(On,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(n?1:-1):n?0:l-1;return o<0?o=e=="page"?0:l-1:o>=l&&(o=e=="page"?l-1:0),t.dispatch({effects:cw.of(o)}),!0}}const SX=n=>{let e=n.state.field(On,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(On,!1)?(n.dispatch({effects:Hd.of(!0)}),!0):!1,$X=n=>{let e=n.state.field(On,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:ua.of(null)}),!0)};class yX{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const vX=50,wX=1e3,QX=li.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(On).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(On);if(!n.selectionSet&&!n.docChanged&&n.startState.field(On)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!md(i));for(let i=0;ivX&&Date.now()-r.time>wX){for(let s of r.context.abortListeners)try{s()}catch(l){An(this.view.state,l)}r.context.abortListeners=null,this.running.splice(i--,1)}else r.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(r=>r.active.source==i.source))?setTimeout(()=>this.startUpdate(),50):-1,this.composing!=0)for(let i of n.transactions)md(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(On);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=$s(e),i=new sw(e,t,n.explicitPos==t),r=new yX(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ua.of(null)}),An(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(Ui).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ui);for(let i=0;il.source==r.active.source);if(s&&s.state==1)if(r.done==null){let l=new Ki(r.active.source,0);for(let o of r.updates)l=l.update(o,t);l.state!=1&&e.push(l)}else this.startQuery(s)}e.length&&this.view.dispatch({effects:fw.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(On,!1);if(e&&e.tooltip&&this.view.state.facet(Ui).closeOnBlur){let t=e.open&&Cy(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:ua.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Hd.of(!1)}),20),this.composing=0}}}),hw=de.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"},".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 _X{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}}class Kd{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,ki.TrackDel),i=e.mapPos(this.to,1,ki.TrackDel);return t==null||i==null?null:new Kd(this.field,t,i)}}class Jd{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),l=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(i.length){let c=l,h=/^\t*/.exec(a)[0].length;for(let O=0;Onew Kd(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:i,ranges:o}}static parse(e){let t=[],i=[],r=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(l);){let o=s[1]?+s[1]:null,a=s[2]||s[3]||"",c=-1;for(let h=0;h=c&&O.field++}r.push(new _X(c,i.length,s.index,s.index+a.length)),l=l.slice(0,s.index)+a+l.slice(s.index+s[0].length)}for(let o;o=/\\([{}])/.exec(l);){l=l.slice(0,o.index)+o[1]+l.slice(o.index+o[0].length);for(let a of r)a.line==i.length&&a.from>o.index&&(a.from--,a.to--)}i.push(l)}return new Jd(i,r)}}let kX=Ye.widget({widget:new class extends Lr{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),PX=Ye.mark({class:"cm-snippetField"});class Gl{constructor(e,t){this.ranges=e,this.active=t,this.deco=Ye.set(e.map(i=>(i.from==i.to?kX:PX).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new Gl(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const wa=Le.define({map(n,e){return n&&n.map(e)}}),xX=Le.define(),ha=pi.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(wa))return t.value;if(t.is(xX)&&n)return new Gl(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=>de.decorations.from(n,e=>e?e.deco:Ye.none)});function ep(n,e){return ee.create(n.filter(t=>t.field==e).map(t=>ee.range(t.from,t.to)))}function WX(n){let e=Jd.parse(n);return(t,i,r,s)=>{let{text:l,ranges:o}=e.instantiate(t.state,r),a={changes:{from:r,to:s,insert:mt.of(l)},scrollIntoView:!0,annotations:i?aw.of(i):void 0};if(o.length&&(a.selection=ep(o,0)),o.length>1){let c=new Gl(o,0),h=a.effects=[wa.of(c)];t.state.field(ha,!1)===void 0&&h.push(Le.appendConfig.of([ha,XX,AX,hw]))}t.dispatch(t.state.update(a))}}function Ow(n){return({state:e,dispatch:t})=>{let i=e.field(ha,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(l=>l.field==r+n);return t(e.update({selection:ep(i.ranges,r),effects:wa.of(s?null:new Gl(i.ranges,r)),scrollIntoView:!0})),!0}}const CX=({state:n,dispatch:e})=>n.field(ha,!1)?(e(n.update({effects:wa.of(null)})),!0):!1,TX=Ow(1),ZX=Ow(-1),RX=[{key:"Tab",run:TX,shift:ZX},{key:"Escape",run:CX}],_0=_e.define({combine(n){return n.length?n[0]:RX}}),XX=Ks.highest(ga.compute([_0],n=>n.facet(_0)));function Hi(n,e){return Object.assign(Object.assign({},e),{apply:WX(n)})}const AX=de.domEventHandlers({mousedown(n,e){let t=e.state.field(ha,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:ep(t.ranges,r.field),effects:wa.of(t.ranges.some(s=>s.field>r.field)?new Gl(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),Oa={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Bs=Le.define({map(n,e){let t=e.mapPos(n,-1,ki.TrackAfter);return t??void 0}}),tp=new class extends Fs{};tp.startSide=1;tp.endSide=-1;const dw=pi.define({create(){return vt.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}n=n.map(e.changes);for(let t of e.effects)t.is(Bs)&&(n=n.update({add:[tp.range(t.value,t.value+1)]}));return n}});function YX(){return[EX,dw]}const uO="()[]{}<>";function pw(n){for(let e=0;e{if((UX?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let r=n.state.selection.main;if(i.length>2||i.length==2&&Zn(Qi(i,0))==1||e!=r.from||t!=r.to)return!1;let s=DX(n.state,i);return s?(n.dispatch(s),!0):!1}),zX=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=gw(n,n.selection.main.head).brackets||Oa.brackets,r=null,s=n.changeByRange(l=>{if(l.empty){let o=VX(n.doc,l.head);for(let a of i)if(a==o&&ou(n.doc,l.head)==pw(Qi(a,0)))return{changes:{from:l.head-a.length,to:l.head+a.length},range:ee.cursor(l.head-a.length)}}return{range:r=l}});return r||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},MX=[{key:"Backspace",run:zX}];function DX(n,e){let t=gw(n,n.selection.main.head),i=t.brackets||Oa.brackets;for(let r of i){let s=pw(Qi(r,0));if(e==r)return s==r?LX(n,r,i.indexOf(r+r+r)>-1,t):qX(n,r,s,t.before||Oa.before);if(e==s&&mw(n,n.selection.main.from))return IX(n,r,s)}return null}function mw(n,e){let t=!1;return n.field(dw).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function ou(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Zn(Qi(t,0)))}function VX(n,e){let t=n.sliceString(e-2,e);return Zn(Qi(t,0))==t.length?t:t.slice(1)}function qX(n,e,t,i){let r=null,s=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:t,from:l.to}],effects:Bs.of(l.to+e.length),range:ee.range(l.anchor+e.length,l.head+e.length)};let o=ou(n.doc,l.head);return!o||/\s/.test(o)||i.indexOf(o)>-1?{changes:{insert:e+t,from:l.head},effects:Bs.of(l.head+e.length),range:ee.cursor(l.head+e.length)}:{range:r=l}});return r?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function IX(n,e,t){let i=null,r=n.changeByRange(s=>s.empty&&ou(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:ee.cursor(s.head+t.length)}:i={range:s});return i?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function LX(n,e,t,i){let r=i.stringPrefixes||Oa.stringPrefixes,s=null,l=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:Bs.of(o.to+e.length),range:ee.range(o.anchor+e.length,o.head+e.length)};let a=o.head,c=ou(n.doc,a),h;if(c==e){if(k0(n,a))return{changes:{insert:e+e,from:a},effects:Bs.of(a+e.length),range:ee.cursor(a+e.length)};if(mw(n,a)){let p=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+p.length,insert:p},range:ee.cursor(a+p.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(h=P0(n,a-2*e.length,r))>-1&&k0(n,h))return{changes:{insert:e+e+e+e,from:a},effects:Bs.of(a+e.length),range:ee.cursor(a+e.length)};if(n.charCategorizer(a)(c)!=Lt.Word&&P0(n,a,r)>-1&&!NX(n,a,e,r))return{changes:{insert:e+e,from:a},effects:Bs.of(a+e.length),range:ee.cursor(a+e.length)}}return{range:s=o}});return s?null:n.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function k0(n,e){let t=ei(n).resolveInner(e+1);return t.parent&&t.from==e}function NX(n,e,t,i){let r=ei(n).resolveInner(e,-1),s=i.reduce((l,o)=>Math.max(l,o.length),0);for(let l=0;l<5;l++){let o=n.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),a=o.indexOf(t);if(!a||a>-1&&i.indexOf(o.slice(0,a))>-1){let h=r.firstChild;for(;h&&h.from==r.from&&h.to-h.from>t.length+a;){if(n.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let c=r.to==e&&r.parent;if(!c)break;r=c}return!1}function P0(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=Lt.Word)return e;for(let r of t){let s=e-r.length;if(n.sliceDoc(s,e)==r&&i(n.sliceDoc(s-1,s))!=Lt.Word)return s}return-1}function jX(n={}){return[On,Ui.of(n),QX,BX,hw]}const Sw=[{key:"Ctrl-Space",run:bX},{key:"Escape",run:$X},{key:"ArrowDown",run:Kf(!0)},{key:"ArrowUp",run:Kf(!1)},{key:"PageDown",run:Kf(!0,"page")},{key:"PageUp",run:Kf(!1,"page")},{key:"Enter",run:SX}],BX=Ks.highest(ga.computeN([Ui],n=>n.facet(Ui).defaultKeymap?[Sw]:[]));class FX{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Is{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let r=e,s=i.facet(yw).markerFilter;s&&(r=s(r));let l=Ye.set(r.map(o=>o.from==o.to||o.from==o.to-1&&i.doc.lineAt(o.from).to==o.from?Ye.widget({widget:new rA(o),diagnostic:o}).range(o.from):Ye.mark({attributes:{class:"cm-lintRange cm-lintRange-"+o.severity+(o.markClass?" "+o.markClass:"")},diagnostic:o}).range(o.from,o.to)),!0);return new Is(l,t,Ml(l))}}function Ml(n,e=null,t=0){let i=null;return n.between(t,1e9,(r,s,{spec:l})=>{if(!(e&&l.diagnostic!=e))return i=new FX(r,s,l.diagnostic),!1}),i}function GX(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(i=>i.is(bw))||n.changes.touchesRange(t.from,t.to))}function HX(n,e){return n.field(pn,!1)?e:e.concat(Le.appendConfig.of(oA))}const bw=Le.define(),ip=Le.define(),$w=Le.define(),pn=pi.define({create(){return new Is(Ye.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),i=null;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=Ml(t,n.selected.diagnostic,r)||Ml(t,null,r)}n=new Is(t,n.panel,i)}for(let t of e.effects)t.is(bw)?n=Is.init(t.value,n.panel,e.state):t.is(ip)?n=new Is(n.diagnostics,t.value?au.open:null,n.selected):t.is($w)&&(n=new Is(n.diagnostics,n.panel,t.value));return n},provide:n=>[sa.from(n,e=>e.panel),de.decorations.from(n,e=>e.diagnostics)]}),KX=Ye.mark({class:"cm-lintRange cm-lintRange-active"});function JX(n,e,t){let{diagnostics:i}=n.state.field(pn),r=[],s=2e8,l=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:h})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(eww(n,t,!1)))}const tA=n=>{let e=n.state.field(pn,!1);(!e||!e.panel)&&n.dispatch({effects:HX(n.state,[ip.of(!0)])});let t=ra(n,au.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},x0=n=>{let e=n.state.field(pn,!1);return!e||!e.panel?!1:(n.dispatch({effects:ip.of(!1)}),!0)},iA=n=>{let e=n.state.field(pn,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},nA=[{key:"Mod-Shift-m",run:tA,preventDefault:!0},{key:"F8",run:iA}],yw=_e.define({combine(n){return Object.assign({sources:n.map(e=>e.source)},br(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function vw(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;is.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function ww(n,e,t){var i;let r=t?vw(e.actions):[];return Yt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Yt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,l)=>{let o=!1,a=p=>{if(p.preventDefault(),o)return;o=!0;let g=Ml(n.state.field(pn).diagnostics,e);g&&s.apply(n,g.from,g.to)},{name:c}=s,h=r[l]?c.indexOf(r[l]):-1,O=h<0?c:[c.slice(0,h),Yt("u",c.slice(h,h+1)),c.slice(h+1)];return Yt("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${r[l]})"`}.`},O)}),e.source&&Yt("div",{class:"cm-diagnosticSource"},e.source))}class rA extends Lr{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Yt("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class W0{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=ww(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class au{constructor(e){this.view=e,this.items=[];let t=r=>{if(r.keyCode==27)x0(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],l=vw(s.actions);for(let o=0;o{for(let s=0;sx0(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(pn).selected;if(!e)return-1;for(let t=0;t{let c=-1,h;for(let O=i;Oi&&(this.items.splice(i,c-i),r=!0)),t&&h.diagnostic==t.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:o})=>{let a=o.height/this.list.offsetHeight;l.topo.bottom&&(this.list.scrollTop+=(l.bottom-o.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(pn),i=Ml(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:$w.of(i)})}static open(e){return new au(e)}}function sA(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function Jf(n){return sA(``,'width="6" height="3"')}const lA=de.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Jf("#d11")},".cm-lintRange-warning":{backgroundImage:Jf("orange")},".cm-lintRange-info":{backgroundImage:Jf("#999")},".cm-lintRange-hint":{backgroundImage:Jf("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),oA=[pn,de.decorations.compute([pn],n=>{let{selected:e,panel:t}=n.field(pn);return!e||!t||e.from==e.to?Ye.none:Ye.set([KX.range(e.from,e.to)])}),F3(JX,{hideOn:GX}),lA],aA=[rC(),oC(),P3(),kZ(),JT(),g3(),y3(),Ot.allowMultipleSelections.of(!0),MT(),hv(nZ,{fallback:!0}),cZ(),YX(),jX(),z3(),V3(),R3(),RR(),ga.of([...MX,...kR,...KR,...AZ,...FT,...Sw,...nA])],yi=({variant:n,settings:e,styles:t})=>{const i=de.theme({"&":{backgroundColor:e.background,color:e.foreground},".cm-content":{caretColor:e.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:e.caret},"&.cm-focused .cm-selectionBackgroundm .cm-selectionBackground, .cm-content ::selection":{backgroundColor:e.selection},".cm-activeLine":{backgroundColor:e.lineHighlight},".cm-gutters":{backgroundColor:e.gutterBackground,color:e.gutterForeground},".cm-activeLineGutter":{backgroundColor:e.lineHighlight}},{dark:n==="dark"}),r=$a.define(t);return[i,hv(r)]};yi({variant:"dark",settings:{background:"#200020",foreground:"#D0D0FF",caret:"#7070FF",selection:"#80000080",gutterBackground:"#200020",gutterForeground:"#C080C0",lineHighlight:"#80000040"},styles:[{tag:b.comment,color:"#404080"},{tag:[b.string,b.regexp],color:"#999999"},{tag:b.number,color:"#7090B0"},{tag:[b.bool,b.null],color:"#8080A0"},{tag:[b.punctuation,b.derefOperator],color:"#805080"},{tag:b.keyword,color:"#60B0FF"},{tag:b.definitionKeyword,color:"#B0FFF0"},{tag:b.moduleKeyword,color:"#60B0FF"},{tag:b.operator,color:"#A0A0FF"},{tag:[b.variableName,b.self],color:"#008080"},{tag:b.operatorKeyword,color:"#A0A0FF"},{tag:b.controlKeyword,color:"#80A0FF"},{tag:b.className,color:"#70E080"},{tag:[b.function(b.propertyName),b.propertyName],color:"#50A0A0"},{tag:b.tagName,color:"#009090"},{tag:b.modifier,color:"#B0FFF0"},{tag:[b.squareBracket,b.attributeName],color:"#D0D0FF"}]});yi({variant:"light",settings:{background:"#fcfcfc",foreground:"#5c6166",caret:"#ffaa33",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#8a919966",lineHighlight:"#8a91991a"},styles:[{tag:b.comment,color:"#787b8099"},{tag:b.string,color:"#86b300"},{tag:b.regexp,color:"#4cbf99"},{tag:[b.number,b.bool,b.null],color:"#ffaa33"},{tag:b.variableName,color:"#5c6166"},{tag:[b.definitionKeyword,b.modifier],color:"#fa8d3e"},{tag:[b.keyword,b.special(b.brace)],color:"#fa8d3e"},{tag:b.operator,color:"#ed9366"},{tag:b.separator,color:"#5c6166b3"},{tag:b.punctuation,color:"#5c6166"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#f2ae49"},{tag:[b.className,b.definition(b.typeName)],color:"#22a4e6"},{tag:[b.tagName,b.typeName,b.self,b.labelName],color:"#55b4d4"},{tag:b.angleBracket,color:"#55b4d480"},{tag:b.attributeName,color:"#f2ae49"}]});yi({variant:"dark",settings:{background:"#15191EFA",foreground:"#EEF2F7",caret:"#C4C4C4",selection:"#90B2D557",gutterBackground:"#15191EFA",gutterForeground:"#aaaaaa95",lineHighlight:"#57575712"},styles:[{tag:b.comment,color:"#6E6E6E"},{tag:[b.string,b.regexp,b.special(b.brace)],color:"#5C81B3"},{tag:b.number,color:"#C1E1B8"},{tag:b.bool,color:"#53667D"},{tag:[b.definitionKeyword,b.modifier,b.function(b.propertyName)],color:"#A3D295",fontWeight:"bold"},{tag:[b.keyword,b.moduleKeyword,b.operatorKeyword,b.operator],color:"#697A8E",fontWeight:"bold"},{tag:[b.variableName,b.attributeName],color:"#708E67"},{tag:[b.function(b.variableName),b.definition(b.propertyName),b.derefOperator],color:"#fff"},{tag:b.tagName,color:"#A3D295"}]});yi({variant:"dark",settings:{background:"#2e241d",foreground:"#BAAE9E",caret:"#A7A7A7",selection:"#DDF0FF33",gutterBackground:"#28211C",gutterForeground:"#BAAE9E90",lineHighlight:"#FFFFFF08"},styles:[{tag:b.comment,color:"#666666"},{tag:[b.string,b.special(b.brace)],color:"#54BE0D"},{tag:b.regexp,color:"#E9C062"},{tag:b.number,color:"#CF6A4C"},{tag:[b.keyword,b.operator],color:"#5EA6EA"},{tag:b.variableName,color:"#7587A6"},{tag:[b.definitionKeyword,b.modifier],color:"#F9EE98"},{tag:[b.propertyName,b.function(b.variableName)],color:"#937121"},{tag:[b.typeName,b.angleBracket,b.tagName],color:"#9B859D"}]});yi({variant:"dark",settings:{background:"#3b2627",foreground:"#E6E1C4",caret:"#E6E1C4",selection:"#16120E",gutterBackground:"#3b2627",gutterForeground:"#E6E1C490",lineHighlight:"#1F1611"},styles:[{tag:b.comment,color:"#6B4E32"},{tag:[b.keyword,b.operator,b.derefOperator],color:"#EF5D32"},{tag:b.className,color:"#EFAC32",fontWeight:"bold"},{tag:[b.typeName,b.propertyName,b.function(b.variableName),b.definition(b.variableName)],color:"#EFAC32"},{tag:b.definition(b.typeName),color:"#EFAC32",fontWeight:"bold"},{tag:b.labelName,color:"#EFAC32",fontWeight:"bold"},{tag:[b.number,b.bool],color:"#6C99BB"},{tag:[b.variableName,b.self],color:"#7DAF9C"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#D9D762"},{tag:[b.angleBracket,b.tagName,b.attributeName],color:"#EFCB43"}]});yi({variant:"dark",settings:{background:"#000205",foreground:"#FFFFFF",caret:"#E60065",selection:"#E60C6559",gutterBackground:"#000205",gutterForeground:"#ffffff90",lineHighlight:"#4DD7FC1A"},styles:[{tag:b.comment,color:"#404040"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#00D8FF"},{tag:b.number,color:"#E62286"},{tag:[b.variableName,b.attributeName,b.self],color:"#E62286",fontWeight:"bold"},{tag:b.function(b.variableName),color:"#fff",fontWeight:"bold"}]});yi({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#BDD5FC",gutterBackground:"#fff",gutterForeground:"#00000070",lineHighlight:"#FFFBD1"},styles:[{tag:b.comment,color:"#BCC8BA"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#5D90CD"},{tag:[b.number,b.bool,b.null],color:"#46A609"},{tag:b.keyword,color:"#AF956F"},{tag:[b.definitionKeyword,b.modifier],color:"#C52727"},{tag:[b.angleBracket,b.tagName,b.attributeName],color:"#606060"},{tag:b.self,color:"#000"}]});yi({variant:"dark",settings:{background:"#00254b",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#B36539BF",gutterBackground:"#00254b",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},styles:[{tag:b.comment,color:"#0088FF"},{tag:b.string,color:"#3AD900"},{tag:b.regexp,color:"#80FFC2"},{tag:[b.number,b.bool,b.null],color:"#FF628C"},{tag:[b.definitionKeyword,b.modifier],color:"#FFEE80"},{tag:b.variableName,color:"#CCCCCC"},{tag:b.self,color:"#FF80E1"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.definition(b.typeName),b.labelName],color:"#FFDD00"},{tag:[b.keyword,b.operator],color:"#FF9D00"},{tag:[b.propertyName,b.typeName],color:"#80FFBB"},{tag:b.special(b.brace),color:"#EDEF7D"},{tag:b.attributeName,color:"#9EFFFF"},{tag:b.derefOperator,color:"#fff"}]});yi({variant:"dark",settings:{background:"#060521",foreground:"#E0E0E0",caret:"#FFFFFFA6",selection:"#122BBB",gutterBackground:"#060521",gutterForeground:"#E0E0E090",lineHighlight:"#FFFFFF0F"},styles:[{tag:b.comment,color:"#AEAEAE"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#8DFF8E"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.function(b.definition(b.variableName)),b.definition(b.typeName)],color:"#A3EBFF"},{tag:[b.number,b.bool,b.null],color:"#62E9BD"},{tag:[b.keyword,b.operator],color:"#2BF1DC"},{tag:[b.definitionKeyword,b.modifier],color:"#F8FBB1"},{tag:[b.variableName,b.self],color:"#B683CA"},{tag:[b.angleBracket,b.tagName,b.typeName,b.propertyName],color:"#60A4F1"},{tag:b.derefOperator,color:"#E0E0E0"},{tag:b.attributeName,color:"#7BACCA"}]});yi({variant:"dark",settings:{background:"#2d2f3f",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"#44475a",gutterBackground:"#282a36",gutterForeground:"rgb(144, 145, 148)",lineHighlight:"#44475a"},styles:[{tag:b.comment,color:"#6272a4"},{tag:[b.string,b.special(b.brace)],color:"#f1fa8c"},{tag:[b.number,b.self,b.bool,b.null],color:"#bd93f9"},{tag:[b.keyword,b.operator],color:"#ff79c6"},{tag:[b.definitionKeyword,b.typeName],color:"#8be9fd"},{tag:b.definition(b.typeName),color:"#f8f8f2"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.attributeName],color:"#50fa7b"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#80C7FF",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#C1E2F8"},styles:[{tag:b.comment,color:"#AAAAAA"},{tag:[b.keyword,b.operator,b.typeName,b.tagName,b.propertyName],color:"#2F6F9F",fontWeight:"bold"},{tag:[b.attributeName,b.definition(b.propertyName)],color:"#4F9FD0"},{tag:[b.className,b.string,b.special(b.brace)],color:"#CF4F5F"},{tag:b.number,color:"#CF4F5F",fontWeight:"bold"},{tag:b.variableName,fontWeight:"bold"}]});yi({variant:"light",settings:{background:"#f2f1f8",foreground:"#0c006b",caret:"#5c49e9",selection:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#e1def3"},styles:[{tag:b.comment,color:"#9995b7"},{tag:b.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[b.definitionKeyword,b.modifier],color:"#ff5792"},{tag:[b.className,b.tagName,b.definition(b.typeName)],color:"#0094f0"},{tag:[b.number,b.bool,b.null,b.special(b.brace)],color:"#5842ff"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#0095a8"},{tag:b.typeName,color:"#b3694d"},{tag:[b.propertyName,b.variableName],color:"#fa8900"},{tag:b.operator,color:"#ff5792"},{tag:b.self,color:"#e64100"},{tag:[b.string,b.regexp],color:"#00b368"},{tag:[b.paren,b.bracket],color:"#0431fa"},{tag:b.labelName,color:"#00bdd6"},{tag:b.attributeName,color:"#e64100"},{tag:b.angleBracket,color:"#9995b7"}]});yi({variant:"light",settings:{background:"#faf4ed",foreground:"#575279",caret:"#575279",selection:"#6e6a8614",gutterBackground:"#faf4ed",gutterForeground:"#57527970",lineHighlight:"#6e6a860d"},styles:[{tag:b.comment,color:"#9893a5"},{tag:[b.bool,b.null],color:"#286983"},{tag:b.number,color:"#d7827e"},{tag:b.className,color:"#d7827e"},{tag:[b.angleBracket,b.tagName,b.typeName],color:"#56949f"},{tag:b.attributeName,color:"#907aa9"},{tag:b.punctuation,color:"#797593"},{tag:[b.keyword,b.modifier],color:"#286983"},{tag:[b.string,b.regexp],color:"#ea9d34"},{tag:b.variableName,color:"#d7827e"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#FFFD0054",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#00000008"},styles:[{tag:b.comment,color:"#CFCFCF"},{tag:[b.number,b.bool,b.null],color:"#E66C29"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.labelName,b.definition(b.typeName)],color:"#2EB43B"},{tag:b.keyword,color:"#D8B229"},{tag:b.operator,color:"#4EA44E",fontWeight:"bold"},{tag:[b.definitionKeyword,b.modifier],color:"#925A47"},{tag:b.string,color:"#704D3D"},{tag:b.typeName,color:"#2F8996"},{tag:[b.variableName,b.propertyName],color:"#77ACB0"},{tag:b.self,color:"#77ACB0",fontWeight:"bold"},{tag:b.regexp,color:"#E3965E"},{tag:[b.tagName,b.angleBracket],color:"#BAA827"},{tag:b.attributeName,color:"#B06520"},{tag:b.derefOperator,color:"#000"}]});yi({variant:"light",settings:{background:"#fef7e5",foreground:"#586E75",caret:"#000000",selection:"#073642",gutterBackground:"#fef7e5",gutterForeground:"#586E7580",lineHighlight:"#EEE8D5"},styles:[{tag:b.comment,color:"#93A1A1"},{tag:b.string,color:"#2AA198"},{tag:b.regexp,color:"#D30102"},{tag:b.number,color:"#D33682"},{tag:b.variableName,color:"#268BD2"},{tag:[b.keyword,b.operator,b.punctuation],color:"#859900"},{tag:[b.definitionKeyword,b.modifier],color:"#073642",fontWeight:"bold"},{tag:[b.className,b.self,b.definition(b.propertyName)],color:"#268BD2"},{tag:b.function(b.variableName),color:"#268BD2"},{tag:[b.bool,b.null],color:"#B58900"},{tag:b.tagName,color:"#268BD2",fontWeight:"bold"},{tag:b.angleBracket,color:"#93A1A1"},{tag:b.attributeName,color:"#93A1A1"},{tag:b.typeName,color:"#859900"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C80",lineHighlight:"#EFEFEF"},styles:[{tag:b.comment,color:"#8E908C"},{tag:[b.variableName,b.self,b.propertyName,b.attributeName,b.regexp],color:"#C82829"},{tag:[b.number,b.bool,b.null],color:"#F5871F"},{tag:[b.className,b.typeName,b.definition(b.typeName)],color:"#C99E00"},{tag:[b.string,b.special(b.brace)],color:"#718C00"},{tag:b.operator,color:"#3E999F"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#4271AE"},{tag:b.keyword,color:"#8959A8"},{tag:b.derefOperator,color:"#4D4D4C"}]});const fA=Ll({String:b.string,Number:b.number,"True False":b.bool,PropertyName:b.propertyName,Null:b.null,",":b.separator,"[ ]":b.squareBracket,"{ }":b.brace}),cA=Ps.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[fA],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),uA=xs.define({name:"json",parser:cA.configure({props:[Nl.add({Object:Rl({except:/^\s*\}/}),Array:Rl({except:/^\s*\]/})}),jl.add({"Object Array":ur})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function hA(){return new Sa(uA)}const OA=54,dA=1,pA=55,gA=2,mA=56,SA=3,C0=4,bA=5,Vc=6,Qw=7,_w=8,kw=9,Pw=10,$A=11,yA=12,vA=13,hO=57,wA=14,T0=58,xw=20,QA=22,Ww=23,_A=24,Sd=26,Cw=27,kA=28,PA=31,xA=34,WA=36,CA=37,TA=0,ZA=1,RA={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},XA={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},Z0={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 AA(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}function Tw(n){return n==9||n==10||n==13||n==32}let R0=null,X0=null,A0=0;function bd(n,e){let t=n.pos+e;if(A0==t&&X0==n)return R0;let i=n.peek(e);for(;Tw(i);)i=n.peek(++e);let r="";for(;AA(i);)r+=String.fromCharCode(i),i=n.peek(++e);return X0=n,A0=t,R0=r?r.toLowerCase():i==YA||i==UA?void 0:null}const Zw=60,qc=62,np=47,YA=63,UA=33,EA=45;function Y0(n,e){this.name=n,this.parent=e,this.hash=e?e.hash:0;for(let t=0;t-1?new Y0(bd(i,1)||"",n):n},reduce(n,e){return e==xw&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==Vc||r==WA?new Y0(bd(i,1)||"",n):n},hash(n){return n?n.hash:0},strict:!1}),DA=new $r((n,e)=>{if(n.next!=Zw){n.next<0&&e.context&&n.acceptToken(hO);return}n.advance();let t=n.next==np;t&&n.advance();let i=bd(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?wA:Vc);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken($A);if(r&&XA[r])return n.acceptToken(hO,-2);if(e.dialectEnabled(TA))return n.acceptToken(yA);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(vA)}else{if(i=="script")return n.acceptToken(Qw);if(i=="style")return n.acceptToken(_w);if(i=="textarea")return n.acceptToken(kw);if(RA.hasOwnProperty(i))return n.acceptToken(Pw);r&&Z0[r]&&Z0[r][i]?n.acceptToken(hO,-1):n.acceptToken(Vc)}},{contextual:!0}),VA=new $r(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(T0);break}if(n.next==EA)e++;else if(n.next==qc&&e>=2){t>=3&&n.acceptToken(T0,-2);break}else e=0;n.advance()}});function qA(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const IA=new $r((n,e)=>{if(n.next==np&&n.peek(1)==qc){let t=e.dialectEnabled(ZA)||qA(e.context);n.acceptToken(t?bA:C0,2)}else n.next==qc&&n.acceptToken(C0,1)});function rp(n,e,t){let i=2+n.length;return new $r(r=>{for(let s=0,l=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(e);break}if(s==0&&r.next==Zw||s==1&&r.next==np||s>=2&&sl?r.acceptToken(e,-l):r.acceptToken(t,-(l-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(e,1);break}else s=l=0;r.advance()}})}const LA=rp("script",OA,dA),NA=rp("style",pA,gA),jA=rp("textarea",mA,SA),BA=Ll({"Text RawText":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),FA=Ps.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[OOO`'#Da'#DaO'WO!rO,59[O'_Q#tO'#DROOO`,59[,59[OOOp'#Db'#DbO'dO$fO,59oOOO`,59o,59oO'lQ#|O,59qO'qQ#|O,59rOOO`-E7W-E7WO'vQ&rO'#CsOOQW'#DZ'#DZO(UQ&rO1G.wOOOa1G.w1G.wO(^Q&rO1G/QOOOb1G/Q1G/QO(fQ&rO1G/TOO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a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!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 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:67,context:MA,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]],propSources:[BA],skippedNodes:[0],repeatNodeCount:9,tokenData:"!]tw8twx7Sx!P8t!P!Q5u!Q!]8t!]!^/^!^!a7S!a#S8t#S#T;{#T#s8t#s$f5u$f;'S8t;'S;=`>V<%l?Ah8t?Ah?BY5u?BY?Mn8t?MnO5u!Z5zbkWOX5uXZ7SZ[5u[^7S^p5uqr5urs7Sst+Ptw5uwx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5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=o.type.id;if(c==kA)return OO(o,a,t);if(c==PA)return OO(o,a,i);if(c==xA)return OO(o,a,r);if(c==xw&&s.length){let h=o.node,O=h.firstChild,p=O&&U0(O,a),g;if(p){for(let m of s)if(m.tag==p&&(!m.attrs||m.attrs(g||(g=Rw(h,a))))){let $=h.lastChild,y=$.type.id==CA?$.from:h.to;if(y>O.to)return{parser:m.parser,overlay:[{from:O.to,to:y}]}}}}if(l&&c==Ww){let h=o.node,O;if(O=h.firstChild){let p=l[a.read(O.from,O.to)];if(p)for(let g of p){if(g.tagName&&g.tagName!=U0(h.parent,a))continue;let m=h.lastChild;if(m.type.id==Sd){let $=m.from+1,y=m.lastChild,_=m.to-(y&&y.isError?0:1);if(_>$)return{parser:g.parser,overlay:[{from:$,to:_}]}}else if(m.type.id==Cw)return{parser:g.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}const GA=96,E0=1,HA=97,KA=98,z0=2,Aw=[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],JA=58,eY=40,Yw=95,tY=91,hc=45,iY=46,nY=35,rY=37,sY=38,lY=92,oY=10;function Ic(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function aY(n){return n>=48&&n<=57}const fY=new $r((n,e)=>{for(let t=!1,i=0,r=0;;r++){let{next:s}=n;if(Ic(s)||s==hc||s==Yw||t&&aY(s))!t&&(s!=hc||r>0)&&(t=!0),i===r&&s==hc&&i++,n.advance();else if(s==lY&&n.peek(1)!=oY)n.advance(),n.next>-1&&n.advance(),t=!0;else{t&&n.acceptToken(s==eY?HA:i==2&&e.canShift(z0)?z0:KA);break}}}),cY=new $r(n=>{if(Aw.includes(n.peek(-1))){let{next:e}=n;(Ic(e)||e==Yw||e==nY||e==iY||e==tY||e==JA||e==hc||e==sY)&&n.acceptToken(GA)}}),uY=new $r(n=>{if(!Aw.includes(n.peek(-1))){let{next:e}=n;if(e==rY&&(n.advance(),n.acceptToken(E0)),Ic(e)){do n.advance();while(Ic(n.next));n.acceptToken(E0)}}}),hY=Ll({"AtKeyword import charset namespace keyframes media supports":b.definitionKeyword,"from to selector":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,MatchOp:b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; ,":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),OY={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},dY={__proto__:null,"@import":114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specialized:[{term:97,get:n=>OY[n]||-1},{term:56,get:n=>dY[n]||-1},{term:98,get:n=>pY[n]||-1}],tokenPrec:1169});let dO=null;function pO(){if(!dO&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));dO=e.sort().map(i=>({type:"property",label:i}))}return dO||[]}const M0=["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})),D0=["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}))),mY=["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})),fs=/^(\w[\w-]*|-\w[\w-]*|)$/,SY=/^-(-[\w-]*)?$/;function bY(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const V0=new By,$Y=["Declaration"];function yY(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function Uw(n,e,t){if(e.to-e.from>4096){let i=V0.get(e);if(i)return i;let r=[],s=new Set,l=e.cursor(Ut.IncludeAnonymous);if(l.firstChild())do for(let o of Uw(n,l.node,t))s.has(o.label)||(s.add(o.label),r.push(o));while(l.nextSibling());return V0.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var l;if(t(s)&&s.matchContext($Y)&&((l=s.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let o=n.sliceString(s.from,s.to);r.has(o)||(r.add(o),i.push({label:o,type:"variable"}))}}),i}}const vY=n=>e=>{let{state:t,pos:i}=e,r=ei(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:pO(),validFor:fs};if(r.name=="ValueName")return{from:r.from,options:D0,validFor:fs};if(r.name=="PseudoClassName")return{from:r.from,options:M0,validFor:fs};if(n(r)||(e.explicit||s)&&bY(r,t.doc))return{from:n(r)||s?r.from:i,options:Uw(t.doc,yY(r),n),validFor:SY};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:pO(),validFor:fs};return{from:r.from,options:mY,validFor:fs}}if(!e.explicit)return null;let l=r.resolve(i),o=l.childBefore(i);return o&&o.name==":"&&l.name=="PseudoClassSelector"?{from:i,options:M0,validFor:fs}:o&&o.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:i,options:D0,validFor:fs}:l.name=="Block"||l.name=="Styles"?{from:i,options:pO(),validFor:fs}:null},wY=vY(n=>n.name=="VariableName"),Lc=xs.define({name:"css",parser:gY.configure({props:[Nl.add({Declaration:Rl()}),jl.add({"Block KeyframeList":ur})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function QY(){return new Sa(Lc,Lc.data.of({autocomplete:wY}))}const _Y=304,q0=1,kY=2,PY=305,xY=307,WY=308,CY=3,TY=4,ZY=[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],Ew=125,RY=59,I0=47,XY=42,AY=43,YY=45,UY=new Hy({start:!1,shift(n,e){return e==CY||e==TY||e==xY?n:e==WY},strict:!1}),EY=new $r((n,e)=>{let{next:t}=n;(t==Ew||t==-1||e.context)&&n.acceptToken(PY)},{contextual:!0,fallback:!0}),zY=new $r((n,e)=>{let{next:t}=n,i;ZY.indexOf(t)>-1||t==I0&&((i=n.peek(1))==I0||i==XY)||t!=Ew&&t!=RY&&t!=-1&&!e.context&&n.acceptToken(_Y)},{contextual:!0}),MY=new $r((n,e)=>{let{next:t}=n;if((t==AY||t==YY)&&(n.advance(),t==n.next)){n.advance();let i=!e.context&&e.canShift(q0);n.acceptToken(i?q0:kY)}},{contextual:!0}),DY=Ll({"get set async static":b.modifier,"for while do if else switch try catch finally return throw break continue default case":b.controlKeyword,"in of await yield void typeof delete instanceof":b.operatorKeyword,"let var const using function class extends":b.definitionKeyword,"import export from":b.moduleKeyword,"with debugger as new":b.keyword,TemplateString:b.special(b.string),super:b.atom,BooleanLiteral:b.bool,this:b.self,null:b.null,Star:b.modifier,VariableName:b.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":b.function(b.variableName),VariableDefinition:b.definition(b.variableName),Label:b.labelName,PropertyName:b.propertyName,PrivatePropertyName:b.special(b.propertyName),"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),"FunctionDeclaration/VariableDefinition":b.function(b.definition(b.variableName)),"ClassDeclaration/VariableDefinition":b.definition(b.className),PropertyDefinition:b.definition(b.propertyName),PrivatePropertyDefinition:b.definition(b.special(b.propertyName)),UpdateOp:b.updateOperator,"LineComment Hashbang":b.lineComment,BlockComment:b.blockComment,Number:b.number,String:b.string,Escape:b.escape,ArithOp:b.arithmeticOperator,LogicOp:b.logicOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,RegExp:b.regexp,Equals:b.definitionOperator,Arrow:b.function(b.punctuation),": Spread":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,"InterpolationStart InterpolationEnd":b.special(b.brace),".":b.derefOperator,", ;":b.separator,"@":b.meta,TypeName:b.typeName,TypeDefinition:b.definition(b.typeName),"type enum interface implements namespace module declare":b.definitionKeyword,"abstract global Privacy readonly override":b.modifier,"is keyof unique infer":b.operatorKeyword,JSXAttributeValue:b.attributeValue,JSXText:b.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":b.angleBracket,"JSXIdentifier JSXNameSpacedName":b.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":b.attributeName,"JSXBuiltin/JSXIdentifier":b.standard(b.tagName)}),VY={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},qY={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},IY={__proto__:null,"<":139},LY=Ps.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'#IVQ`QUOOO`QUOOO%[QUO'#DoO9mQUO'#D{O9tQUO'#D}O9ZQSO'#GlO9{Q,UO'#CmO:ZQSO'#EhO:fQSO'#EsO:kQ,UO'#F`O;YQSO'#GlOOQO'#KR'#KRO;_QSO'#KRO;mQSO'#GtO;mQSO'#GuO;mQSO'#GwO9ZQSO'#GzO]QSO'#HZO>eQSO'#HaO>eQ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+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList 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 : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression 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 in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate 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 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:367,context:UY,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[DY],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!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#8g!R![#:v![!]#Gv!]!^#IS!^!_#J^!_!`#Nu!`!a$#a!a!b$(n!b!c$,m!c!}Er!}#O$-w#O#P$/R#P#Q$4j#Q#R$5t#R#SEr#S#T$7R#T#o$8]#o#p$s#r#s$@P#s$f%Z$f$g+g$g#BYEr#BY#BZ$AZ#BZ$ISEr$IS$I_$AZ$I_$I|Er$I|$I}$Df$I}$JO$Df$JO$JTEr$JT$J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/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#VY[n]||-1},{term:330,get:n=>qY[n]||-1},{term:68,get:n=>IY[n]||-1}],tokenPrec:12868}),zw=[Hi("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Hi("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Hi("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Hi("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Hi("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Hi(`try { + opacity: ${a-h*y}`}}const BC=n=>({}),E1=n=>({});function z1(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,x;const R=n[6].default,A=Zi(R,n,n[5],null),C=n[6].footer,z=Zi(C,n,n[5],E1),V=z||FC(n);return{c(){e=k("form"),t=k("div"),i=L(),r=k("div"),s=k("header"),l=k("p"),o=pe(n[0]),a=L(),c=k("button"),h=L(),O=k("section"),A&&A.c(),p=L(),g=k("footer"),V&&V.c(),v(t,"class","modal-background"),v(l,"class","modal-card-title"),v(c,"type","button"),v(c,"class","delete"),v(c,"aria-label","close"),v(s,"class","modal-card-head"),v(O,"class","modal-card-body"),v(g,"class","modal-card-foot"),v(r,"class","modal-card"),v(e,"tabindex","0"),v(e,"class","modal is-active")},m(M,B){Y(M,e,B),Q(e,t),Q(e,i),Q(e,r),Q(r,s),Q(s,l),Q(l,o),Q(s,a),Q(s,c),Q(r,h),Q(r,O),A&&A.m(O,null),Q(r,p),Q(r,g),V&&V.m(g,null),n[7](e),y=!0,_||(x=[le(t,"click",n[4]),le(c,"click",n[4]),le(e,"submit",n$(n[8]))],_=!0)},p(M,B){(!y||B&1)&&Le(o,M[0]),A&&A.p&&(!y||B&32)&&Xi(A,R,M,M[5],y?Ri(R,M[5],B,null):Ai(M[5]),null),z&&z.p&&(!y||B&32)&&Xi(z,C,M,M[5],y?Ri(C,M[5],B,BC):Ai(M[5]),E1)},i(M){y||(D(A,M),D(V,M),M&&Hn(()=>{y&&(m||(m=vl(r,wc,{y:-200,duration:200},!0)),m.run(1))}),M&&Hn(()=>{y&&($||($=vl(e,U1,{duration:200},!0)),$.run(1))}),y=!0)},o(M){j(A,M),j(V,M),M&&(m||(m=vl(r,wc,{y:-200,duration:200},!1)),m.run(0)),M&&($||($=vl(e,U1,{duration:200},!1)),$.run(0)),y=!1},d(M){M&&X(e),A&&A.d(M),V&&V.d(M),M&&m&&m.end(),n[7](null),M&&$&&$.end(),_=!1,Ft(x)}}}function FC(n){let e,t,i;return{c(){e=k("button"),e.textContent="Cancel",v(e,"class","button")},m(r,s){Y(r,e,s),t||(i=le(e,"click",n[4]),t=!0)},p:Qe,d(r){r&&X(e),t=!1,i()}}}function GC(n){let e,t,i=n[1]&&z1(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,[s]){r[1]?i?(i.p(r,s),s&2&&D(i,1)):(i=z1(r),i.c(),D(i,1),i.m(e.parentNode,e)):i&&(Je(),j(i,1,1,()=>{i=null}),et())},i(r){t||(D(i),t=!0)},o(r){j(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function HC(n,e,t){let{$$slots:i={},$$scope:r}=e,{title:s}=e,{active:l=!1}=e;const o=en();let a;async function c(g){g&&(await Fn(),a&&a.focus(),o("activate"))}function h(){o("cancel")}function O(g){Et[g?"unshift":"push"](()=>{a=g,t(2,a)})}const p=()=>o("submit");return n.$$set=g=>{"title"in g&&t(0,s=g.title),"active"in g&&t(1,l=g.active),"$$scope"in g&&t(5,r=g.$$scope)},n.$$.update=()=>{n.$$.dirty&2&&c(l)},[s,l,a,o,h,r,i,O,p]}class _s extends $i{constructor(e){super(),bi(this,e,HC,GC,Oi,{title:0,active:1})}}const Ly=1024;let KC=0;class Rn{constructor(e,t){this.from=e,this.to=t}}class at{constructor(e={}){this.id=KC++,this.perNode=!!e.perNode,this.deserialize=e.deserialize||(()=>{throw new Error("This node type doesn't define a deserialize function")})}add(e){if(this.perNode)throw new RangeError("Can't add per-node props to node types");return typeof e!="function"&&(e=Ni.match(e)),t=>{let i=e(t);return i===void 0?null:[this,i]}}}at.closedBy=new at({deserialize:n=>n.split(" ")});at.openedBy=new at({deserialize:n=>n.split(" ")});at.group=new at({deserialize:n=>n.split(" ")});at.contextHash=new at({perNode:!0});at.lookAhead=new at({perNode:!0});at.mounted=new at({perNode:!0});class oa{constructor(e,t,i){this.tree=e,this.overlay=t,this.parser=i}static get(e){return e&&e.props&&e.props[at.mounted.id]}}const JC=Object.create(null);class Ni{constructor(e,t,i,r=0){this.name=e,this.props=t,this.id=i,this.flags=r}static define(e){let t=e.props&&e.props.length?Object.create(null):JC,i=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(e.name==null?8:0),r=new Ni(e.name||"",t,e.id,i);if(e.props){for(let s of e.props)if(Array.isArray(s)||(s=s(r)),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 r}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(at.group);return t?t.indexOf(e)>-1:!1}return this.id==e}static match(e){let t=Object.create(null);for(let i in e)for(let r of i.split(" "))t[r]=e[i];return i=>{for(let r=i.prop(at.group),s=-1;s<(r?r.length:0);s++){let l=t[s<0?i.name:r[s]];if(l)return l}}}}Ni.none=new Ni("",Object.create(null),0,8);class Ud{constructor(e){this.types=e;for(let t=0;t0;for(let a=this.cursor(l|Ut.IncludeAnonymous);;){let c=!1;if(a.from<=s&&a.to>=r&&(!o&&a.type.isAnonymous||t(a)!==!1)){if(a.firstChild())continue;c=!0}for(;c&&i&&(o||!a.type.isAnonymous)&&i(a),!a.nextSibling();){if(!a.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:Md(Ni.none,this.children,this.positions,0,this.children.length,0,this.length,(t,i,r)=>new Bt(this.type,t,i,r,this.propValues),e.makeTree||((t,i,r)=>new Bt(Ni.none,t,i,r)))}static build(e){return nT(e)}}Bt.empty=new Bt(Ni.none,[],[],0);class Ed{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 Ed(this.buffer,this.index)}}class ks{constructor(e,t,i){this.buffer=e,this.length=t,this.set=i}get type(){return Ni.none}toString(){let e=[];for(let t=0;t0));a=l[a+3]);return o}slice(e,t,i){let r=this.buffer,s=new Uint16Array(t-e),l=0;for(let o=e,a=0;o=e&&te;case 1:return t<=e&&i>e;case 2:return i>e;case 4:return!0}}function aa(n,e,t,i){for(var r;n.from==n.to||(t<1?n.from>=e:n.from>e)||(t>-1?n.to<=e:n.to0?o.length:-1;e!=c;e+=t){let h=o[e],O=a[e]+l.from;if(Ny(r,i,O,O+h.length)){if(h instanceof ks){if(s&Ut.ExcludeBuffers)continue;let p=h.findChild(0,h.buffer.length,t,i-O,r);if(p>-1)return new dr(new eT(l,h,e,O),null,p)}else if(s&Ut.IncludeAnonymous||!h.type.isAnonymous||zd(h)){let p;if(!(s&Ut.IgnoreMounts)&&(p=oa.get(h))&&!p.overlay)return new zi(p.tree,O,e,l);let g=new zi(h,O,e,l);return s&Ut.IncludeAnonymous||!g.type.isAnonymous?g:g.nextChild(t<0?h.children.length-1:0,t,i,r)}}}if(s&Ut.IncludeAnonymous||!l.type.isAnonymous||(l.index>=0?e=l.index+t:e=t<0?-1:l._parent._tree.children.length,l=l._parent,!l))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)}enter(e,t,i=0){let r;if(!(i&Ut.IgnoreOverlays)&&(r=oa.get(this._tree))&&r.overlay){let s=e-this.from;for(let{from:l,to:o}of r.overlay)if((t>0?l<=s:l=s:o>s))return new zi(r.tree,r.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,i)}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 D1(n,e,t,i){let r=n.cursor(),s=[];if(!r.firstChild())return s;if(t!=null){for(;!r.type.is(t);)if(!r.nextSibling())return s}for(;;){if(i!=null&&r.type.is(i))return s;if(r.type.is(e)&&s.push(r.node),!r.nextSibling())return i==null?s:[]}}function sd(n,e,t=e.length-1){for(let i=n.parent;t>=0;i=i.parent){if(!i)return!1;if(!i.type.isAnonymous){if(e[t]&&e[t]!=i.name)return!1;t--}}return!0}class eT{constructor(e,t,i,r){this.parent=e,this.buffer=t,this.index=i,this.start=r}}class dr extends jy{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,i){super(),this.context=e,this._parent=t,this.index=i,this.type=e.buffer.set.types[e.buffer.buffer[i]]}child(e,t,i){let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.context.start,i);return s<0?null:new dr(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)}enter(e,t,i=0){if(i&Ut.ExcludeBuffers)return null;let{buffer:r}=this.context,s=r.findChild(this.index+4,r.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return s<0?null:new dr(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 dr(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 dr(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:i}=this.context,r=this.index+4,s=i.buffer[this.index+3];if(s>r){let l=i.buffer[this.index+1];e.push(i.slice(r,s,l)),t.push(0)}return new Bt(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function By(n){if(!n.length)return null;let e=0,t=n[0];for(let s=1;st.from||l.to=e){let o=new zi(l.tree,l.overlay[0].from+s.from,-1,s);(r||(r=[i])).push(aa(o,e,t,!1))}}return r?By(r):i}class Qc{get name(){return this.type.name}constructor(e,t=0){if(this.mode=t,this.buffer=null,this.stack=[],this.index=0,this.bufferNode=null,e instanceof zi)this.yieldNode(e);else{this._tree=e.context.parent,this.buffer=e.context;for(let i=e._parent;i;i=i._parent)this.stack.unshift(i.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:i,buffer:r}=this.buffer;return this.type=t||r.set.types[r.buffer[e]],this.from=i+r.buffer[e+1],this.to=i+r.buffer[e+2],!0}yield(e){return e?e instanceof zi?(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,i){if(!this.buffer)return this.yield(this._tree.nextChild(e<0?this._tree._tree.children.length-1:0,e,t,i,this.mode));let{buffer:r}=this.buffer,s=r.findChild(this.index+4,r.buffer[this.index+3],e,t-this.buffer.start,i);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,i=this.mode){return this.buffer?i&Ut.ExcludeBuffers?!1:this.enterChild(1,e,t):this.yield(this._tree.enter(e,t,i))}parent(){if(!this.buffer)return this.yieldNode(this.mode&Ut.IncludeAnonymous?this._tree._parent:this._tree.parent);if(this.stack.length)return this.yieldBuf(this.stack.pop());let e=this.mode&Ut.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,i=this.stack.length-1;if(e<0){let r=i<0?0:this.stack[i]+4;if(this.index!=r)return this.yieldBuf(t.findChild(r,this.index,-1,0,4))}else{let r=t.buffer[this.index+3];if(r<(i<0?t.buffer.length:t.buffer[this.stack[i]+3]))return this.yieldBuf(r)}return i<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,i,{buffer:r}=this;if(r){if(e>0){if(this.index-1)for(let s=t+e,l=e<0?-1:i._tree.children.length;s!=l;s+=e){let o=i._tree.children[s];if(this.mode&Ut.IncludeAnonymous||o instanceof ks||!o.type.isAnonymous||zd(o))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=0;){for(let l=e;l;l=l._parent)if(l.index==r){if(r==this.index)return l;t=l,i=s+1;break e}r=this.stack[--s]}for(let r=i;r=0;s--){if(s<0)return sd(this.node,e,r);let l=i[t.buffer[this.stack[s]]];if(!l.isAnonymous){if(e[r]&&e[r]!=l.name)return!1;r--}}return!0}}function zd(n){return n.children.some(e=>e instanceof ks||!e.type.isAnonymous||zd(e))}function nT(n){var e;let{buffer:t,nodeSet:i,maxBufferLength:r=Ly,reused:s=[],minRepeatType:l=i.types.length}=n,o=Array.isArray(t)?new Ed(t,t.length):t,a=i.types,c=0,h=0;function O(C,z,V,M,B,N){let{id:G,start:U,end:re,size:ae}=o,ye=h;for(;ae<0;)if(o.next(),ae==-1){let ke=s[G];V.push(ke),M.push(U-C);return}else if(ae==-3){c=G;return}else if(ae==-4){h=G;return}else throw new RangeError(`Unrecognized record size: ${ae}`);let Se=a[G],ge,Ue,Ie=U-C;if(re-U<=r&&(Ue=y(o.pos-z,B))){let ke=new Uint16Array(Ue.size-Ue.skip),xe=o.pos-Ue.size,lt=ke.length;for(;o.pos>xe;)lt=_(Ue.start,ke,lt);ge=new ks(ke,re-Ue.start,i),Ie=Ue.start-C}else{let ke=o.pos-ae;o.next();let xe=[],lt=[],Vt=G>=l?G:-1,Qt=0,pt=re;for(;o.pos>ke;)Vt>=0&&o.id==Vt&&o.size>=0?(o.end<=pt-r&&(m(xe,lt,U,Qt,o.end,pt,Vt,ye),Qt=xe.length,pt=o.end),o.next()):N>2500?p(U,ke,xe,lt):O(U,ke,xe,lt,Vt,N+1);if(Vt>=0&&Qt>0&&Qt-1&&Qt>0){let qt=g(Se);ge=Md(Se,xe,lt,0,xe.length,0,re-U,qt,qt)}else ge=$(Se,xe,lt,re-U,ye-re)}V.push(ge),M.push(Ie)}function p(C,z,V,M){let B=[],N=0,G=-1;for(;o.pos>z;){let{id:U,start:re,end:ae,size:ye}=o;if(ye>4)o.next();else{if(G>-1&&re=0;ae-=3)U[ye++]=B[ae],U[ye++]=B[ae+1]-re,U[ye++]=B[ae+2]-re,U[ye++]=ye;V.push(new ks(U,B[2]-re,i)),M.push(re-C)}}function g(C){return(z,V,M)=>{let B=0,N=z.length-1,G,U;if(N>=0&&(G=z[N])instanceof Bt){if(!N&&G.type==C&&G.length==M)return G;(U=G.prop(at.lookAhead))&&(B=V[N]+G.length+U)}return $(C,z,V,M,B)}}function m(C,z,V,M,B,N,G,U){let re=[],ae=[];for(;C.length>M;)re.push(C.pop()),ae.push(z.pop()+V-B);C.push($(i.types[G],re,ae,N-B,U-N)),z.push(B-V)}function $(C,z,V,M,B=0,N){if(c){let G=[at.contextHash,c];N=N?[G].concat(N):[G]}if(B>25){let G=[at.lookAhead,B];N=N?[G].concat(N):[G]}return new Bt(C,z,V,M,N)}function y(C,z){let V=o.fork(),M=0,B=0,N=0,G=V.end-r,U={size:0,start:0,skip:0};e:for(let re=V.pos-C;V.pos>re;){let ae=V.size;if(V.id==z&&ae>=0){U.size=M,U.start=B,U.skip=N,N+=4,M+=4,V.next();continue}let ye=V.pos-ae;if(ae<0||ye=l?4:0,ge=V.start;for(V.next();V.pos>ye;){if(V.size<0)if(V.size==-3)Se+=4;else break e;else V.id>=l&&(Se+=4);V.next()}B=ge,M+=ae,N+=Se}return(z<0||M==C)&&(U.size=M,U.start=B,U.skip=N),U.size>4?U:void 0}function _(C,z,V){let{id:M,start:B,end:N,size:G}=o;if(o.next(),G>=0&&M4){let re=o.pos-(G-4);for(;o.pos>re;)V=_(C,z,V)}z[--V]=U,z[--V]=N-C,z[--V]=B-C,z[--V]=M}else G==-3?c=M:G==-4&&(h=M);return V}let x=[],R=[];for(;o.pos>0;)O(n.start||0,n.bufferStart||0,x,R,-1,0);let A=(e=n.length)!==null&&e!==void 0?e:x.length?R[0]+x[0].length:0;return new Bt(a[n.topID],x.reverse(),R.reverse(),A)}const V1=new WeakMap;function cc(n,e){if(!n.isAnonymous||e instanceof ks||e.type!=n)return 1;let t=V1.get(e);if(t==null){t=1;for(let i of e.children){if(i.type!=n||!(i instanceof Bt)){t=1;break}t+=cc(n,i)}V1.set(e,t)}return t}function Md(n,e,t,i,r,s,l,o,a){let c=0;for(let m=i;m=h)break;z+=V}if(R==A+1){if(z>h){let V=m[A];g(V.children,V.positions,0,V.children.length,$[A]+x);continue}O.push(m[A])}else{let V=$[R-1]+m[R-1].length-C;O.push(Md(n,m,$,A,R,C,V,null,a))}p.push(C+x-s)}}return g(e,t,i,r,0),(o||a)(O,p,l)}class Fy{constructor(){this.map=new WeakMap}setBuffer(e,t,i){let r=this.map.get(e);r||this.map.set(e,r=new Map),r.set(t,i)}getBuffer(e,t){let i=this.map.get(e);return i&&i.get(t)}set(e,t){e instanceof dr?this.setBuffer(e.context.buffer,e.index,t):e instanceof zi&&this.map.set(e.tree,t)}get(e){return e instanceof dr?this.getBuffer(e.context.buffer,e.index):e instanceof zi?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 zr{constructor(e,t,i,r,s=!1,l=!1){this.from=e,this.to=t,this.tree=i,this.offset=r,this.open=(s?1:0)|(l?2:0)}get openStart(){return(this.open&1)>0}get openEnd(){return(this.open&2)>0}static addTree(e,t=[],i=!1){let r=[new zr(0,e.length,e,0,!1,i)];for(let s of t)s.to>e.length&&r.push(s);return r}static applyChanges(e,t,i=128){if(!t.length)return e;let r=[],s=1,l=e.length?e[0]:null;for(let o=0,a=0,c=0;;o++){let h=o=i)for(;l&&l.from=p.from||O<=p.to||c){let g=Math.max(p.from,a)-c,m=Math.min(p.to,O)-c;p=g>=m?null:new zr(g,m,p.tree,p.offset+c,o>0,!!h)}if(p&&r.push(p),l.to>O)break;l=snew Rn(r.from,r.to)):[new Rn(0,0)]:[new Rn(0,e.length)],this.createParse(e,t||[],i)}parse(e,t,i){let r=this.startParse(e,t,i);for(;;){let s=r.advance();if(s)return s}}}class rT{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 sT(n){return(e,t,i,r)=>new oT(e,n,t,i,r)}class q1{constructor(e,t,i,r,s){this.parser=e,this.parse=t,this.overlay=i,this.target=r,this.from=s}}function I1(n){if(!n.length||n.some(e=>e.from>=e.to))throw new RangeError("Invalid inner parse ranges given: "+JSON.stringify(n))}class lT{constructor(e,t,i,r,s,l,o){this.parser=e,this.predicate=t,this.mounts=i,this.index=r,this.start=s,this.target=l,this.prev=o,this.depth=0,this.ranges=[]}}const ld=new at({perNode:!0});class oT{constructor(e,t,i,r,s){this.nest=t,this.input=i,this.fragments=r,this.ranges=s,this.inner=[],this.innerDone=0,this.baseTree=null,this.stoppedAt=null,this.baseParse=e}advance(){if(this.baseParse){let i=this.baseParse.advance();if(!i)return null;if(this.baseParse=null,this.baseTree=i,this.startInner(),this.stoppedAt!=null)for(let r of this.inner)r.parse.stopAt(this.stoppedAt)}if(this.innerDone==this.inner.length){let i=this.baseTree;return this.stoppedAt!=null&&(i=new Bt(i.type,i.children,i.positions,i.length,i.propValues.concat([[ld,this.stoppedAt]]))),i}let e=this.inner[this.innerDone],t=e.parse.advance();if(t){this.innerDone++;let i=Object.assign(Object.create(null),e.target.props);i[at.mounted.id]=new oa(t,e.overlay,e.parser),e.target.props=i}return null}get parsedPos(){if(this.baseParse)return 0;let e=this.input.length;for(let t=this.innerDone;t=this.stoppedAt)o=!1;else if(e.hasNode(r)){if(t){let c=t.mounts.find(h=>h.frag.from<=r.from&&h.frag.to>=r.to&&h.mount.overlay);if(c)for(let h of c.mount.overlay){let O=h.from+c.pos,p=h.to+c.pos;O>=r.from&&p<=r.to&&!t.ranges.some(g=>g.fromO)&&t.ranges.push({from:O,to:p})}}o=!1}else if(i&&(l=aT(i.ranges,r.from,r.to)))o=l!=2;else if(!r.type.isAnonymous&&(s=this.nest(r,this.input))&&(r.fromnew Rn(O.from-r.from,O.to-r.from)):null,r.tree,h.length?h[0].from:r.from)),s.overlay?h.length&&(i={ranges:h,depth:0,prev:i}):o=!1}}else t&&(a=t.predicate(r))&&(a===!0&&(a=new Rn(r.from,r.to)),a.fromnew Rn(h.from-t.start,h.to-t.start)),t.target,c[0].from))),t=t.prev}i&&!--i.depth&&(i=i.prev)}}}}function aT(n,e,t){for(let i of n){if(i.from>=t)break;if(i.to>e)return i.from<=e&&i.to>=t?2:1}return 0}function L1(n,e,t,i,r,s){if(e=e.to);i++);let l=r.children[i],o=l.buffer,a=[i];function c(h,O,p,g,m,$){let y=t[$],_=[],x=[];L1(l,h,y,_,x,g);let R=o[y+1],A=o[y+2];a.push(_.length);let C=$?c(y+4,o[y+3],l.set.types[o[y]],R,A-R,$-1):e.toTree();return _.push(C),x.push(R-g),L1(l,o[y+3],O,_,x,g),new Bt(p,_,x,m)}r.children[i]=c(0,o.length,Ni.none,0,l.length,t.length-1);for(let h of a){let O=n.tree.children[h],p=n.tree.positions[h];n.yield(new zi(O,p+n.from,h,n._tree))}}class N1{constructor(e,t){this.offset=t,this.done=!1,this.cursor=e.cursor(Ut.IncludeAnonymous|Ut.IgnoreMounts)}moveTo(e){let{cursor:t}=this,i=e-this.offset;for(;!this.done&&t.from=e&&t.enter(i,1,Ut.IgnoreOverlays|Ut.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 Bt)t=t.children[0];else break}return!1}}let cT=class{constructor(e){var t;if(this.fragments=e,this.curTo=0,this.fragI=0,e.length){let i=this.curFrag=e[0];this.curTo=(t=i.tree.prop(ld))!==null&&t!==void 0?t:i.to,this.inner=new N1(i.tree,-i.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(ld))!==null&&e!==void 0?e:t.to,this.inner=new N1(t.tree,-t.offset)}}findMounts(e,t){var i;let r=[];if(this.inner){this.inner.cursor.moveTo(e,1);for(let s=this.inner.cursor.node;s;s=s.parent){let l=(i=s.tree)===null||i===void 0?void 0:i.prop(at.mounted);if(l&&l.parser==t)for(let o=this.fragI;o=s.to)break;a.tree==this.curFrag.tree&&r.push({frag:a,pos:s.from-a.offset,mount:l})}}}return r}};function j1(n,e){let t=null,i=e;for(let r=1,s=0;r=o)break;a.to<=l||(t||(i=t=e.slice()),a.fromo&&t.splice(s+1,0,new Rn(o,a.to))):a.to>o?t[s--]=new Rn(o,a.to):t.splice(s--,1))}}return i}function uT(n,e,t,i){let r=0,s=0,l=!1,o=!1,a=-1e9,c=[];for(;;){let h=r==n.length?1e9:l?n[r].to:n[r].from,O=s==e.length?1e9:o?e[s].to:e[s].from;if(l!=o){let p=Math.max(a,t),g=Math.min(h,O,i);pnew Rn(p.from+i,p.to+i)),O=uT(e,h,a,c);for(let p=0,g=a;;p++){let m=p==O.length,$=m?c:O[p].from;if($>g&&t.push(new zr(g,$,r.tree,-l,s.from>=g||s.openStart,s.to<=$||s.openEnd)),m)break;g=O[p].to}}else t.push(new zr(a,c,r.tree,-l,s.from>=l||s.openStart,s.to<=o||s.openEnd))}return t}var F1={};class _c{constructor(e,t,i,r,s,l,o,a,c,h=0,O){this.p=e,this.stack=t,this.state=i,this.reducePos=r,this.pos=s,this.score=l,this.buffer=o,this.bufferBase=a,this.curContext=c,this.lookAhead=h,this.parent=O}toString(){return`[${this.stack.filter((e,t)=>t%3==0).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,i=0){let r=e.parser.context;return new _c(e,[],t,i,i,0,[],0,r?new G1(r,r.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 i=e>>19,r=e&65535,{parser:s}=this.p,l=this.reducePos=2e3&&!(!((t=this.p.parser.nodeSet.types[r])===null||t===void 0)&&t.isAnonymous)&&(c==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=h):this.p.lastBigReductionSizea;)this.stack.pop();this.reduceContext(r,c)}storeNode(e,t,i,r=4,s=!1){if(e==0&&(!this.stack.length||this.stack[this.stack.length-1]0&&l.buffer[o-4]==0&&l.buffer[o-1]>-1){if(t==i)return;if(l.buffer[o-2]>=t){l.buffer[o-2]=i;return}}}if(!s||this.pos==i)this.buffer.push(e,t,i,r);else{let l=this.buffer.length;if(l>0&&this.buffer[l-4]!=0){let o=!1;for(let a=l;a>0&&this.buffer[a-2]>i;a-=4)if(this.buffer[a-1]>=0){o=!0;break}if(o)for(;l>0&&this.buffer[l-2]>i;)this.buffer[l]=this.buffer[l-4],this.buffer[l+1]=this.buffer[l-3],this.buffer[l+2]=this.buffer[l-2],this.buffer[l+3]=this.buffer[l-1],l-=4,r>4&&(r-=4)}this.buffer[l]=e,this.buffer[l+1]=t,this.buffer[l+2]=i,this.buffer[l+3]=r}}shift(e,t,i,r){if(e&131072)this.pushState(e&65535,this.pos);else if(e&262144)this.pos=r,this.shiftContext(t,i),t<=this.p.parser.maxNode&&this.buffer.push(t,i,r,4);else{let s=e,{parser:l}=this.p;(r>this.pos||t<=l.maxNode)&&(this.pos=r,l.stateFlag(s,1)||(this.reducePos=r)),this.pushState(s,i),this.shiftContext(t,i),t<=l.maxNode&&this.buffer.push(t,i,r,4)}}apply(e,t,i,r){e&65536?this.reduce(e):this.shift(e,t,i,r)}useNode(e,t){let i=this.p.reused.length-1;(i<0||this.p.reused[i]!=e)&&(this.p.reused.push(e),i++);let r=this.pos;this.reducePos=this.pos=r+e.length,this.pushState(t,r),this.buffer.push(i,r,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 i=e.buffer.slice(t),r=e.bufferBase+t;for(;e&&r==e.bufferBase;)e=e.parent;return new _c(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,i,r,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let i=e<=this.p.parser.maxNode;i&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,i?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new hT(this);;){let i=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(i==0)return!1;if(!(i&65536))return!0;t.reduce(i)}}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 r=[];for(let s=0,l;sa&1&&o==l)||r.push(t[s],l)}t=r}let i=[];for(let r=0;r>19,r=t&65535,s=this.stack.length-i*3;if(s<0||e.getGoto(this.stack[s],r,!1)<0){let l=this.findForcedReduction();if(l==null)return!1;t=l}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=[],i=(r,s)=>{if(!t.includes(r))return t.push(r),e.allActions(r,l=>{if(!(l&393216))if(l&65536){let o=(l>>19)-s;if(o>1){let a=l&65535,c=this.stack.length-o*3;if(c>=0&&e.getGoto(this.stack[c],a,!1)>=0)return o<<19|65536|a}}else{let o=i(l,s+1);if(o!=null)return o}})};return i(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;tthis.lookAhead&&(this.emitLookAhead(),this.lookAhead=e)}close(){this.curContext&&this.curContext.tracker.strict&&this.emitContext(),this.lookAhead>0&&this.emitLookAhead()}}class G1{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class hT{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=e&65535,i=e>>19;i==0?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=(i-1)*3;let r=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=r}}class kc{constructor(e,t,i){this.stack=e,this.pos=t,this.index=i,this.buffer=e.buffer,this.index==0&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new kc(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 kc(this.stack,this.pos,this.index)}}function Mo(n,e=Uint16Array){if(typeof n!="string")return n;let t=null;for(let i=0,r=0;i=92&&l--,l>=34&&l--;let a=l-32;if(a>=46&&(a-=46,o=!0),s+=a,o)break;s*=46}t?t[r++]=s:t=new e(s)}return t}class uc{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const H1=new uc;class OT{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=H1,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 i=this.range,r=this.rangeIndex,s=this.pos+e;for(;si.to:s>=i.to;){if(r==this.ranges.length-1)return null;let l=this.ranges[++r];s+=l.from-i.to,i=l}return s}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t=this.chunkOff+e,i,r;if(t>=0&&t=this.chunk2Pos&&io.to&&(this.chunk2=this.chunk2.slice(0,o.to-i)),r=this.chunk2.charCodeAt(0)}}return i>=this.token.lookAhead&&(this.token.lookAhead=i+1),r}acceptToken(e,t=0){let i=t?this.resolveOffset(t,-1):this.pos;if(i==null||i=this.chunk2Pos&&this.posthis.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=H1,this.pos!=e){if(this.pos=e,e==this.end)return this.setDone(),this;for(;e=this.range.to;)this.range=this.ranges[++this.rangeIndex];e>=this.chunkPos&&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 i="";for(let r of this.ranges){if(r.from>=t)break;r.to>e&&(i+=this.input.read(Math.max(r.from,e),Math.min(r.to,t)))}return i}}class Zl{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:i}=t.p;Hy(this.data,e,t,this.id,i.data,i.tokenPrecTable)}}Zl.prototype.contextual=Zl.prototype.fallback=Zl.prototype.extend=!1;class Pc{constructor(e,t,i){this.precTable=t,this.elseToken=i,this.data=typeof e=="string"?Mo(e):e}token(e,t){let i=e.pos,r=0;for(;;){let s=e.next<0,l=e.resolveOffset(1,1);if(Hy(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(this.elseToken==null)return;if(s||r++,l==null)break;e.reset(l,e.token)}r&&(e.reset(i,e.token),e.acceptToken(this.elseToken,r))}}Pc.prototype.contextual=Zl.prototype.fallback=Zl.prototype.extend=!1;class $r{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Hy(n,e,t,i,r,s){let l=0,o=1<0){let m=n[g];if(a.allows(m)&&(e.token.value==-1||e.token.value==m||dT(m,e.token.value,r,s))){e.acceptToken(m);break}}let h=e.next,O=0,p=n[l+2];if(e.next<0&&p>O&&n[c+p*3-3]==65535){l=n[c+p*3-1];continue e}for(;O>1,m=c+g+(g<<1),$=n[m],y=n[m+1]||65536;if(h<$)p=g;else if(h>=y)O=g+1;else{l=n[m+2],e.advance();continue e}}break}}function K1(n,e,t){for(let i=e,r;(r=n[i])!=65535;i++)if(r==t)return i-e;return-1}function dT(n,e,t,i){let r=K1(t,i,e);return r<0||K1(t,i,n)e)&&!i.type.isError)return t<0?Math.max(0,Math.min(i.to-1,e-25)):Math.min(n.length,Math.max(i.from+1,e+25));if(t<0?i.prevSibling():i.nextSibling())break;if(!i.parent())return t<0?0:n.length}}class pT{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(ee)return this.nextStart=l,null;if(s instanceof Bt){if(l==e){if(l=Math.max(this.safeFrom,e)&&(this.trees.push(s),this.start.push(l),this.index.push(0))}else this.index[t]++,this.nextStart=l+s.length}}}class gT{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map(i=>new uc)}getActions(e){let t=0,i=null,{parser:r}=e.p,{tokenizers:s}=r,l=r.stateSlot(e.state,3),o=e.curContext?e.curContext.hash:0,a=0;for(let c=0;cO.end+25&&(a=Math.max(O.lookAhead,a)),O.value!=0)){let p=t;if(O.extended>-1&&(t=this.addActions(e,O.extended,O.end,t)),t=this.addActions(e,O.value,O.end,t),!h.extend&&(i=O,t>p))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),!i&&e.pos==this.stream.end&&(i=new uc,i.value=e.p.parser.eofTerm,i.start=i.end=e.pos,t=this.addActions(e,i.value,i.end,t)),this.mainToken=i,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new uc,{pos:i,p:r}=e;return t.start=i,t.end=Math.min(i+1,r.stream.end),t.value=i==r.stream.end?r.parser.eofTerm:0,t}updateCachedToken(e,t,i){let r=this.stream.clipPos(i.pos);if(t.token(this.stream.reset(r,e),i),e.value>-1){let{parser:s}=i.p;for(let l=0;l=0&&i.p.parser.dialect.allows(o>>1)){o&1?e.extended=o>>1:e.value=o>>1;break}}}else e.value=0,e.end=this.stream.clipPos(r+1)}putAction(e,t,i,r){for(let s=0;se.bufferLength*4?new pT(i,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e=this.stacks,t=this.minStackPos,i=this.stacks=[],r,s;if(this.bigReductionCount>300&&e.length==1){let[l]=e;for(;l.forceReduce()&&l.stack.length&&l.stack[l.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let l=0;lt)i.push(o);else{if(this.advanceStack(o,i,e))continue;{r||(r=[],s=[]),r.push(o);let a=this.tokens.getMainToken(o);s.push(a.value,a.end)}}break}}if(!i.length){let l=r&&bT(r);if(l)return fn&&console.log("Finish with "+this.stackID(l)),this.stackToTree(l);if(this.parser.strict)throw fn&&r&&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&&r){let l=this.stoppedAt!=null&&r[0].pos>this.stoppedAt?r[0]:this.runRecovery(r,s,i);if(l)return fn&&console.log("Force-finish "+this.stackID(l)),this.stackToTree(l.forceAll())}if(this.recovering){let l=this.recovering==1?1:this.recovering*3;if(i.length>l)for(i.sort((o,a)=>a.score-o.score);i.length>l;)i.pop();i.some(o=>o.reducePos>t)&&this.recovering--}else if(i.length>1){e:for(let l=0;l500&&c.buffer.length>500)if((o.score-c.score||o.buffer.length-c.buffer.length)>0)i.splice(a--,1);else{i.splice(l--,1);continue e}}}i.length>12&&i.splice(12,i.length-12)}this.minStackPos=i[0].pos;for(let l=1;l ":"";if(this.stoppedAt!=null&&r>this.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let c=e.curContext&&e.curContext.tracker.strict,h=c?e.curContext.hash:0;for(let O=this.fragments.nodeAt(r);O;){let p=this.parser.nodeSet.types[O.type.id]==O.type?s.getGoto(e.state,O.type.id):-1;if(p>-1&&O.length&&(!c||(O.prop(at.contextHash)||0)==h))return e.useNode(O,p),fn&&console.log(l+this.stackID(e)+` (via reuse of ${s.getName(O.type.id)})`),!0;if(!(O instanceof Bt)||O.children.length==0||O.positions[0]>0)break;let g=O.children[0];if(g instanceof Bt&&O.positions[0]==0)O=g;else break}}let o=s.stateSlot(e.state,4);if(o>0)return e.reduce(o),fn&&console.log(l+this.stackID(e)+` (via always-reduce ${s.getName(o&65535)})`),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let a=this.tokens.getActions(e);for(let c=0;cr?t.push(m):i.push(m)}return!1}advanceFully(e,t){let i=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>i)return e0(e,t),!0}}runRecovery(e,t,i){let r=null,s=!1;for(let l=0;l ":"";if(o.deadEnd&&(s||(s=!0,o.restart(),fn&&console.log(h+this.stackID(o)+" (restarted)"),this.advanceFully(o,i))))continue;let O=o.split(),p=h;for(let g=0;O.forceReduce()&&g<10&&(fn&&console.log(p+this.stackID(O)+" (via force-reduce)"),!this.advanceFully(O,i));g++)fn&&(p=this.stackID(O)+" -> ");for(let g of o.recoverByInsert(a))fn&&console.log(h+this.stackID(g)+" (via recover-insert)"),this.advanceFully(g,i);this.stream.end>o.pos?(c==o.pos&&(c++,a=0),o.recoverByDelete(a,c),fn&&console.log(h+this.stackID(o)+` (via recover-delete ${this.parser.getName(a)})`),e0(o,i)):(!r||r.scoren;class Ky{constructor(e){this.start=e.start,this.shift=e.shift||eO,this.reduce=e.reduce||eO,this.reuse=e.reuse||eO,this.hash=e.hash||(()=>0),this.strict=e.strict!==!1}}class Ps extends Gy{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 o=0;oe.topRules[o][1]),r=[];for(let o=0;o=0)s(h,a,o[c++]);else{let O=o[c+-h];for(let p=-h;p>0;p--)s(o[c++],a,O);c++}}}this.nodeSet=new Ud(t.map((o,a)=>Ni.define({name:a>=this.minRepeatTerm?void 0:o,id:a,props:r[a],top:i.indexOf(a)>-1,error:a==0,skipped:e.skippedNodes&&e.skippedNodes.indexOf(a)>-1}))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Ly;let l=Mo(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let o=0;otypeof o=="number"?new Zl(l,o):o),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,i){let r=new mT(this,e,t,i);for(let s of this.wrappers)r=s(r,e,t,i);return r}getGoto(e,t,i=!1){let r=this.goto;if(t>=r[0])return-1;for(let s=r[t+1];;){let l=r[s++],o=l&1,a=r[s++];if(o&&i)return a;for(let c=s+(l>>1);s0}validAction(e,t){return!!this.allActions(e,i=>i==t?!0:null)}allActions(e,t){let i=this.stateSlot(e,4),r=i?t(i):void 0;for(let s=this.stateSlot(e,1);r==null;s+=3){if(this.data[s]==65535)if(this.data[s+1]==1)s=Ur(this.data,s+2);else break;r=t(Ur(this.data,s+1))}return r}nextStates(e){let t=[];for(let i=this.stateSlot(e,1);;i+=3){if(this.data[i]==65535)if(this.data[i+1]==1)i=Ur(this.data,i+2);else break;if(!(this.data[i+2]&1)){let r=this.data[i+1];t.some((s,l)=>l&1&&s==r)||t.push(this.data[i],r)}}return t}configure(e){let t=Object.assign(Object.create(Ps.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let i=this.topRules[e.top];if(!i)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=i}return e.tokenizers&&(t.tokenizers=this.tokenizers.map(i=>{let r=e.tokenizers.find(s=>s.from==i);return r?r.to:i})),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map((i,r)=>{let s=e.specializers.find(o=>o.from==i.external);if(!s)return i;let l=Object.assign(Object.assign({},i),{external:s.to});return t.specializers[r]=t0(l),l})),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),i=t.map(()=>!1);if(e)for(let s of e.split(" ")){let l=t.indexOf(s);l>=0&&(i[l]=!0)}let r=null;for(let s=0;si)&&t.p.parser.stateFlag(t.state,2)&&(!e||e.scoren.external(t,i)<<1|e}return n.get}const $T={__proto__:null,annotation:12,array:20,var:24,par:26,opt:28,ann:32,bool:34,float:36,int:38,string:40,_:50,true:62,false:64,infinity:68,"∅":74,in:92,where:94,if:98,then:100,elseif:102,else:104,endif:106,xor:110,subset:112,superset:114,union:116,diff:118,symdiff:120,intersect:122,div:124,mod:126,default:128,let:132,constraint:140,not:144,"¬":146,any:170,of:172,set:176,tuple:180,record:184,op:190,enum:198,function:202,solve:206,satisfy:208,maximize:210,minimize:212,include:216,output:220,predicate:224,test:226,type:230},yT=Ps.deserialize({version:14,states:"!0jQ]QPOOOOQO'#F]'#F]O&XQPO'#CvO&`QPO'#CxOOQO'#C}'#C}O&gQPO'#DSO&nOQO'#DTO$kQPO'#DWOOQO'#Fc'#FcO*}QPO'#CgO+eQPO'#DrO$kQPO'#DuO$kQPO'#DuO/qQPO'#FbOOQO'#Fb'#FbOOQO'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b(cQ%X#ZQ%`#dR(j&}WYOc#O$uQ#]uQ%Q#VQ%R#WW%S#X&q(`)^Q%U#YQ&i$xS&u%V&wQ'T%aQ(U&jQ([&oQ)X(ZQ)_(bQ)t)UU)v)Y)x*[Q)|)`R*Y)u!^XOcu#O#U#V#W#X#Y$u$x%V%a&j&l&o&q&w(X(Z(`(b)U)W)Y)^)`)u)x*[Q{QQ!QRQ!UTQ!]VQ!sZU!t[$d'jQ!{hQ!|iW#Qkl$|$}Q#bxQ#i|Q#r!SQ#x!VQ#z!XQ$T!`Q$U!aQ$V!bQ$W!cQ$X!dQ$Y!eQ$Z!fQ$[!gQ$]!hS$^!i!pQ$_!jQ$`!kQ$a!lQ$b!mQ$c!nS$h!q+RQ$j!uQ$q!xQ$s!}S$y#T&kQ%]#_Q%^#`S%b#f'X^%c#g%d'U'W'd(n(uU%g#k%j'ZQ%l#nQ%v#}Q%w$PQ&U$kQ&^$oQ&_$rQ&a$sQ&h$wQ&y%WQ&{%YQ&|%ZQ'Q%_Q'`%oU'i%}'l(wQ'n&QQ'o&RQ'v&YQ(P&`Q(Q&bQ(R&cQ(h&zQ(k'PQ(l'RQ(m'SQ(y'sQ)S'|Q)T(OQ)e(iQ)m(xQ)o(zQ)p(|Q)q)RQ*Q)fQ*R)gQ*U)nQ*X)rQ*`*PQ*b*VQ*e*oQ*f*pQ*g*qQ*h*rQ*i*sQ*j*tQ*k*uQ*l*vS*m*d*wQ*n*xQ+S*{Q+T+ZQ+U*|Q+V*}Q+W+OQ+X+PR+Y+Q",nodeNames:"⚠ LineComment BlockComment SourceFile Annotation Identifier Keyword QuotedIdentifier Parameter ArrayType Keyword TypeBase Keyword Keyword Keyword PrimitiveType Keyword Keyword Keyword Keyword Keyword TypeInstId TypeInstEnumId Absent Anonymous Keyword ArrayLiteral2d ArrayLiteral2dRow ArrayLiteral ArrayLiteralMember BooleanLiteral Keyword Keyword Infinity Keyword Number EmptySet Keyword SetLiteral StringLiteral Interpolation TupleLiteral RecordLiteral RecordMember ArrayComprehension Generator Keyword Keyword IfThenElse Keyword Keyword Keyword Keyword Keyword InfixOperator Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword Keyword LetExpression Keyword LetItems Declaration Constraint Keyword PrefixOperator Keyword Keyword PostfixOperator SetComprehension Call Application GeneratorCall GeneratorCallGenerators ParenthesisedExpression IndexedAccess TupleAccess Number RecordAccess Keyword Keyword SetType Keyword TupleType Keyword RecordType Keyword RecordTypeField OperationType Keyword AnyType Assignment Enumeration Keyword FunctionItem Keyword Goal Keyword Keyword Keyword Keyword Include Keyword Output Keyword Predicate Keyword Keyword TypeAlias Keyword",maxTerm:210,skippedNodes:[0,1,2],repeatNodeCount:19,tokenData:"!8_~R!oOX&SXY&qYZ'nZ]&S]^&q^p&Spq&qqr(Prs)Xsu&Suv)^vw&Swx*lxy,ryz-]z{-v{|.a|}/k}!O0U!O!P1`!P!Q3Z!Q!R9g!R![@|![!]Bz!]!^DU!^!_Do!_!`Is!`!aJ}!a!c&S!c!}LX!}#OM[#O#PNf#P#Q!#p#Q#R!$Z#R#SLX#S#T&S#T#oLX#o#p!$t#p#q!%_#q#r!&f#r#s!'P#s%#t&S%#t%#u!.O%#u%#v&S%#v%#w!.i%#w%%W&S%%W%%X!/S%%X%%Y&S%%Y%%Z!/m%%Z%%[&S%%[%%]!0W%%]%&b&S%&b%&c!0q%&c%&p&S%&p%&q!1[%&q%&x&S%&x%&y!1u%&y%'R&S%'R%'S!2`%'S%'T!2y%'T%'U!3d%'U%'V!3}%'V%(^&S%(^%(_!4h%(_%(b&S%(b%(c!5R%(c%(d!5l%(d%)U&S%)U%)V!6V%)V%)W!6p%)W%*]&S%*]%*^!7Z%*^%Gc&S%Gc%Gd!7t%Gd;'S&S;'S;=`&k<%lO&SQ&XU$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SQ&nP;=`<%l&SV&x[$bQ#}TOX&SXY&qYZ'nZ]&S]^&q^p&Spq&qqr&Ss#O&S#P;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S&S;'S;=`&k<%lO&SR!.pU$jP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!/ZU$nP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!/tU$kP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!0_U$hP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!0xU%OP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!1cU%UP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!1|U$^P$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!2gU$sP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!3QU$pP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!3kU%VP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!4UU%TP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!4oU$wP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!5YU$zP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!5sU$}P$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!6^U%PP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!6wU%QP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!7bU$qP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&SR!7{U$gP$bQOY&SZr&Ss#O&S#P;'S&S;'S;=`&k<%lO&S",tokenizers:[0,1,2],topRules:{SourceFile:[0,3]},specialized:[{term:5,get:n=>$T[n]||-1}],tokenPrec:0});let vT=0;class Tn{constructor(e,t,i,r){this.name=e,this.set=t,this.base=i,this.modified=r,this.id=vT++}toString(){let{name:e}=this;for(let t of this.modified)t.name&&(e=`${t.name}(${e})`);return e}static define(e,t){let i=typeof e=="string"?e:"?";if(e instanceof Tn&&(t=e),t!=null&&t.base)throw new Error("Can not derive from a modified tag");let r=new Tn(i,[],null,[]);if(r.set.push(r),t)for(let s of t.set)r.set.push(s);return r}static defineModifier(e){let t=new Wc(e);return i=>i.modified.indexOf(t)>-1?i:Wc.get(i.base||i,i.modified.concat(t).sort((r,s)=>r.id-s.id))}}let wT=0;class Wc{constructor(e){this.name=e,this.instances=[],this.id=wT++}static get(e,t){if(!t.length)return e;let i=t[0].instances.find(o=>o.base==e&&QT(t,o.modified));if(i)return i;let r=[],s=new Tn(e.name,r,e,t);for(let o of t)o.instances.push(s);let l=_T(t);for(let o of e.set)if(!o.modified.length)for(let a of l)r.push(Wc.get(o,a));return s}}function QT(n,e){return n.length==e.length&&n.every((t,i)=>t==e[i])}function _T(n){let e=[[]];for(let t=0;ti.length-t.length)}function Ll(n){let e=Object.create(null);for(let t in n){let i=n[t];Array.isArray(i)||(i=[i]);for(let r of t.split(" "))if(r){let s=[],l=2,o=r;for(let O=0;;){if(o=="..."&&O>0&&O+3==r.length){l=1;break}let p=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(o);if(!p)throw new RangeError("Invalid path: "+r);if(s.push(p[0]=="*"?"":p[0][0]=='"'?JSON.parse(p[0]):p[0]),O+=p[0].length,O==r.length)break;let g=r[O++];if(O==r.length&&g=="!"){l=0;break}if(g!="/")throw new RangeError("Invalid path: "+r);o=r.slice(O)}let a=s.length-1,c=s[a];if(!c)throw new RangeError("Invalid path: "+r);let h=new xc(i,l,a>0?s.slice(0,a):null);e[c]=h.sort(e[c])}}return Jy.add(e)}const Jy=new at;class xc{constructor(e,t,i,r){this.tags=e,this.mode=t,this.context=i,this.next=r}get opaque(){return this.mode==0}get inherit(){return this.mode==1}sort(e){return!e||e.depth{let l=r;for(let o of s)for(let a of o.set){let c=t[a.id];if(c){l=l?l+" "+c:c;break}}return l},scope:i}}function kT(n,e){let t=null;for(let i of n){let r=i.style(e);r&&(t=t?t+" "+r:r)}return t}function PT(n,e,t,i=0,r=n.length){let s=new WT(i,Array.isArray(e)?e:[e],t);s.highlightRange(n.cursor(),i,r,"",s.highlighters),s.flush(r)}class WT{constructor(e,t,i){this.at=e,this.highlighters=t,this.span=i,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,i,r,s){let{type:l,from:o,to:a}=e;if(o>=i||a<=t)return;l.isTop&&(s=this.highlighters.filter(g=>!g.scope||g.scope(l)));let c=r,h=xT(e)||xc.empty,O=kT(s,h.tags);if(O&&(c&&(c+=" "),c+=O,h.mode==1&&(r+=(r?" ":"")+O)),this.startSpan(Math.max(t,o),c),h.opaque)return;let p=e.tree&&e.tree.prop(at.mounted);if(p&&p.overlay){let g=e.node.enter(p.overlay[0].from+o,1),m=this.highlighters.filter(y=>!y.scope||y.scope(p.tree.type)),$=e.firstChild();for(let y=0,_=o;;y++){let x=y=R||!e.nextSibling())););if(!x||R>i)break;_=x.to+o,_>t&&(this.highlightRange(g.cursor(),Math.max(t,x.from+o),Math.min(i,_),"",m),this.startSpan(Math.min(i,_),c))}$&&e.parent()}else if(e.firstChild()){p&&(r="");do if(!(e.to<=t)){if(e.from>=i)break;this.highlightRange(e,t,i,r,s),this.startSpan(Math.min(i,e.to),c)}while(e.nextSibling());e.parent()}}}function xT(n){let e=n.type.prop(Jy);for(;e&&e.context&&!n.matchContext(e.context);)e=e.next;return e||null}const Oe=Tn.define,Nf=Oe(),us=Oe(),i0=Oe(us),n0=Oe(us),hs=Oe(),jf=Oe(hs),tO=Oe(hs),cr=Oe(),Vs=Oe(cr),ar=Oe(),fr=Oe(),od=Oe(),xo=Oe(od),Bf=Oe(),b={comment:Nf,lineComment:Oe(Nf),blockComment:Oe(Nf),docComment:Oe(Nf),name:us,variableName:Oe(us),typeName:i0,tagName:Oe(i0),propertyName:n0,attributeName:Oe(n0),className:Oe(us),labelName:Oe(us),namespace:Oe(us),macroName:Oe(us),literal:hs,string:jf,docString:Oe(jf),character:Oe(jf),attributeValue:Oe(jf),number:tO,integer:Oe(tO),float:Oe(tO),bool:Oe(hs),regexp:Oe(hs),escape:Oe(hs),color:Oe(hs),url:Oe(hs),keyword:ar,self:Oe(ar),null:Oe(ar),atom:Oe(ar),unit:Oe(ar),modifier:Oe(ar),operatorKeyword:Oe(ar),controlKeyword:Oe(ar),definitionKeyword:Oe(ar),moduleKeyword:Oe(ar),operator:fr,derefOperator:Oe(fr),arithmeticOperator:Oe(fr),logicOperator:Oe(fr),bitwiseOperator:Oe(fr),compareOperator:Oe(fr),updateOperator:Oe(fr),definitionOperator:Oe(fr),typeOperator:Oe(fr),controlOperator:Oe(fr),punctuation:od,separator:Oe(od),bracket:xo,angleBracket:Oe(xo),squareBracket:Oe(xo),paren:Oe(xo),brace:Oe(xo),content:cr,heading:Vs,heading1:Oe(Vs),heading2:Oe(Vs),heading3:Oe(Vs),heading4:Oe(Vs),heading5:Oe(Vs),heading6:Oe(Vs),contentSeparator:Oe(cr),list:Oe(cr),quote:Oe(cr),emphasis:Oe(cr),strong:Oe(cr),link:Oe(cr),monospace:Oe(cr),strikethrough:Oe(cr),inserted:Oe(),deleted:Oe(),changed:Oe(),invalid:Oe(),meta:Bf,documentMeta:Oe(Bf),annotation:Oe(Bf),processingInstruction:Oe(Bf),definition:Tn.defineModifier("definition"),constant:Tn.defineModifier("constant"),function:Tn.defineModifier("function"),standard:Tn.defineModifier("standard"),local:Tn.defineModifier("local"),special:Tn.defineModifier("special")};for(let n in b){let e=b[n];e instanceof Tn&&(e.name=n)}ev([{tag:b.link,class:"tok-link"},{tag:b.heading,class:"tok-heading"},{tag:b.emphasis,class:"tok-emphasis"},{tag:b.strong,class:"tok-strong"},{tag:b.keyword,class:"tok-keyword"},{tag:b.atom,class:"tok-atom"},{tag:b.bool,class:"tok-bool"},{tag:b.url,class:"tok-url"},{tag:b.labelName,class:"tok-labelName"},{tag:b.inserted,class:"tok-inserted"},{tag:b.deleted,class:"tok-deleted"},{tag:b.literal,class:"tok-literal"},{tag:b.string,class:"tok-string"},{tag:b.number,class:"tok-number"},{tag:[b.regexp,b.escape,b.special(b.string)],class:"tok-string2"},{tag:b.variableName,class:"tok-variableName"},{tag:b.local(b.variableName),class:"tok-variableName tok-local"},{tag:b.definition(b.variableName),class:"tok-variableName tok-definition"},{tag:b.special(b.variableName),class:"tok-variableName2"},{tag:b.definition(b.propertyName),class:"tok-propertyName tok-definition"},{tag:b.typeName,class:"tok-typeName"},{tag:b.namespace,class:"tok-namespace"},{tag:b.className,class:"tok-className"},{tag:b.macroName,class:"tok-macroName"},{tag:b.propertyName,class:"tok-propertyName"},{tag:b.operator,class:"tok-operator"},{tag:b.comment,class:"tok-comment"},{tag:b.meta,class:"tok-meta"},{tag:b.invalid,class:"tok-invalid"},{tag:b.punctuation,class:"tok-punctuation"}]);var iO;const Ql=new at;function tv(n){return _e.define({combine:n?e=>e.concat(n):void 0})}const Dd=new at;class Gn{constructor(e,t,i=[],r=""){this.data=e,this.name=r,Ot.prototype.hasOwnProperty("tree")||Object.defineProperty(Ot.prototype,"tree",{get(){return ei(this)}}),this.parser=t,this.extension=[xs.of(this),Ot.languageData.of((s,l,o)=>{let a=r0(s,l,o),c=a.type.prop(Ql);if(!c)return[];let h=s.facet(c),O=a.type.prop(Dd);if(O){let p=a.resolve(l-a.from,o);for(let g of O)if(g.test(p,s)){let m=s.facet(g.facet);return g.type=="replace"?m:m.concat(h)}}return h})].concat(i)}isActiveAt(e,t,i=-1){return r0(e,t,i).type.prop(Ql)==this.data}findRegions(e){let t=e.facet(xs);if((t==null?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let i=[],r=(s,l)=>{if(s.prop(Ql)==this.data){i.push({from:l,to:l+s.length});return}let o=s.prop(at.mounted);if(o){if(o.tree.prop(Ql)==this.data){if(o.overlay)for(let a of o.overlay)i.push({from:a.from+l,to:a.to+l});else i.push({from:l,to:l+s.length});return}else if(o.overlay){let a=i.length;if(r(o.tree,o.overlay[0].from+l),i.length>a)return}}for(let a=0;ai.isTop?t:void 0)]}),e.name)}configure(e,t){return new Ws(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function ei(n){let e=n.field(Gn.state,!1);return e?e.tree:Bt.empty}class CT{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 i=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-i,t-i)}}let Co=null;class Cc{constructor(e,t,i=[],r,s,l,o,a){this.parser=e,this.state=t,this.fragments=i,this.tree=r,this.treeLen=s,this.viewport=l,this.skipped=o,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,i){return new Cc(e,t,[],Bt.empty,0,i,[],null)}startParse(){return this.parser.startParse(new CT(this.state.doc),this.fragments)}work(e,t){return t!=null&&t>=this.state.doc.length&&(t=void 0),this.tree!=Bt.empty&&this.isDone(t??this.state.doc.length)?(this.takeTree(),!0):this.withContext(()=>{var i;if(typeof e=="number"){let r=Date.now()+e;e=()=>Date.now()>r}for(this.parse||(this.parse=this.startParse()),t!=null&&(this.parse.stoppedAt==null||this.parse.stoppedAt>t)&&t=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(zr.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=Co;Co=this;try{return e()}finally{Co=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=s0(e,t.from,t.to);return e}changes(e,t){let{fragments:i,tree:r,treeLen:s,viewport:l,skipped:o}=this;if(this.takeTree(),!e.empty){let a=[];if(e.iterChangedRanges((c,h,O,p)=>a.push({fromA:c,toA:h,fromB:O,toB:p})),i=zr.applyChanges(i,a),r=Bt.empty,s=0,l={from:e.mapPos(l.from,-1),to:e.mapPos(l.to,1)},this.skipped.length){o=[];for(let c of this.skipped){let h=e.mapPos(c.from,1),O=e.mapPos(c.to,-1);he.from&&(this.fragments=s0(this.fragments,r,s),this.skipped.splice(i--,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 Gy{createParse(t,i,r){let s=r[0].from,l=r[r.length-1].to;return{parsedPos:s,advance(){let a=Co;if(a){for(let c of r)a.tempSkipped.push(c);e&&(a.scheduleOn=a.scheduleOn?Promise.all([a.scheduleOn,e]):e)}return this.parsedPos=l,new Bt(Ni.none,[],[],l-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 Co}}function s0(n,e,t){return zr.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),i=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,i)||t.takeTree(),new El(t)}static init(e){let t=Math.min(3e3,e.doc.length),i=Cc.create(e.facet(xs).parser,e,{from:0,to:t});return i.work(20,t)||i.takeTree(),new El(i)}}Gn.state=pi.define({create:El.init,update(n,e){for(let t of e.effects)if(t.is(Gn.setState))return t.value;return e.startState.facet(xs)!=e.state.facet(xs)?El.init(e.state):n.apply(e)}});let iv=n=>{let e=setTimeout(()=>n(),500);return()=>clearTimeout(e)};typeof requestIdleCallback<"u"&&(iv=n=>{let e=-1,t=setTimeout(()=>{e=requestIdleCallback(n,{timeout:400})},100);return()=>e<0?clearTimeout(t):cancelIdleCallback(e)});const nO=typeof navigator<"u"&&(!((iO=navigator.scheduling)===null||iO===void 0)&&iO.isInputPending)?()=>navigator.scheduling.isInputPending():null,TT=li.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(Gn.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(Gn.state);(t.tree!=t.context.tree||!t.context.isDone(e.doc.length))&&(this.working=iv(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndr+1e3,a=s.context.work(()=>nO&&nO()||Date.now()>l,r+(o?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(s.context.takeTree(),this.view.dispatch({effects:Gn.setState.of(new El(s.context))})),this.chunkBudget>0&&!(a&&!o)&&this.scheduleWork(),this.checkAsyncSchedule(s.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then(()=>this.scheduleWork()).catch(t=>An(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()}}}),xs=_e.define({combine(n){return n.length?n[0]:null},enables:n=>[Gn.state,TT,de.contentAttributes.compute([n],e=>{let t=e.facet(n);return t&&t.name?{"data-language":t.name}:{}})]});class Sa{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const ZT=_e.define(),eu=_e.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 Tc(n){let e=n.facet(eu);return e.charCodeAt(0)==9?n.tabSize*e.length:e.length}function fa(n,e){let t="",i=n.tabSize,r=n.facet(eu)[0];if(r==" "){for(;e>=i;)t+=" ",e-=i;r=" "}for(let s=0;s=e?RT(n,t,e):null}class tu{constructor(e,t={}){this.state=e,this.options=t,this.unit=Tc(e)}lineAt(e,t=1){let i=this.state.doc.lineAt(e),{simulateBreak:r,simulateDoubleBreak:s}=this.options;return r!=null&&r>=i.from&&r<=i.to?s&&r==e?{text:"",from:e}:(t<0?r-1&&(s+=l-this.countColumn(i,i.search(/\S|$/))),s}countColumn(e,t=e.length){return Il(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:i,from:r}=this.lineAt(e,t),s=this.options.overrideIndentation;if(s){let l=s(r);if(l>-1)return l}return this.countColumn(i,i.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const Nl=new at;function RT(n,e,t){let i=e.resolveStack(t),r=i.node.enterUnfinishedNodesBefore(t);if(r!=i.node){let s=[];for(let l=r;l!=i.node;l=l.parent)s.push(l);for(let l=s.length-1;l>=0;l--)i={node:s[l],next:i}}return nv(i,n,t)}function nv(n,e,t){for(let i=n;i;i=i.next){let r=AT(i.node);if(r)return r(qd.create(e,t,i))}return 0}function XT(n){return n.pos==n.options.simulateBreak&&n.options.simulateDoubleBreak}function AT(n){let e=n.type.prop(Nl);if(e)return e;let t=n.firstChild,i;if(t&&(i=t.type.prop(at.closedBy))){let r=n.lastChild,s=r&&i.indexOf(r.name)>-1;return l=>rv(l,!0,1,void 0,s&&!XT(l)?r.from:void 0)}return n.parent==null?YT:null}function YT(){return 0}class qd extends tu{constructor(e,t,i){super(e.state,e.options),this.base=e,this.pos=t,this.context=i}get node(){return this.context.node}static create(e,t,i){return new qd(e,t,i)}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 i=e.resolve(t.from);for(;i.parent&&i.parent.from==i.from;)i=i.parent;if(UT(i,e))break;t=this.state.doc.lineAt(i.from)}return this.lineIndent(t.from)}continue(){return nv(this.context.next,this.base,this.pos)}}function UT(n,e){for(let t=e;t;t=t.parent)if(n==t)return!0;return!1}function ET(n){let e=n.node,t=e.childAfter(e.from),i=e.lastChild;if(!t)return null;let r=n.options.simulateBreak,s=n.state.doc.lineAt(t.from),l=r==null||r<=s.from?s.to:Math.min(s.to,r);for(let o=t.to;;){let a=e.childAfter(o);if(!a||a==i)return null;if(!a.type.isSkipped)return a.fromrv(i,e,t,n)}function rv(n,e,t,i,r){let s=n.textAfter,l=s.match(/^\s*/)[0].length,o=i&&s.slice(l,l+i.length)==i||r==n.pos+l,a=e?ET(n):null;return a?o?n.column(a.from):n.column(a.to):n.baseIndent+(o?0:n.unit*t)}const zT=n=>n.baseIndent;function Rl({except:n,units:e=1}={}){return t=>{let i=n&&n.test(t.textAfter);return t.baseIndent+(i?0:e*t.unit)}}const MT=200;function DT(){return Ot.transactionFilter.of(n=>{if(!n.docChanged||!n.isUserEvent("input.type")&&!n.isUserEvent("input.complete"))return n;let e=n.startState.languageDataAt("indentOnInput",n.startState.selection.main.head);if(!e.length)return n;let t=n.newDoc,{head:i}=n.newSelection.main,r=t.lineAt(i);if(i>r.from+MT)return n;let s=t.sliceString(r.from,i);if(!e.some(c=>c.test(s)))return n;let{state:l}=n,o=-1,a=[];for(let{head:c}of l.selection.ranges){let h=l.doc.lineAt(c);if(h.from==o)continue;o=h.from;let O=Vd(l,h.from);if(O==null)continue;let p=/^\s*/.exec(h.text)[0],g=fa(l,O);p!=g&&a.push({from:h.from,to:h.from+p.length,insert:g})}return a.length?[n,{changes:a,sequential:!0}]:n})}const VT=_e.define(),jl=new at;function ur(n){let e=n.firstChild,t=n.lastChild;return e&&e.tot)continue;if(s&&o.from=e&&c.to>t&&(s=c)}}return s}function IT(n){let e=n.lastChild;return e&&e.to==n.to&&e.type.isError}function Zc(n,e,t){for(let i of n.facet(VT)){let r=i(n,e,t);if(r)return r}return qT(n,e,t)}function sv(n,e){let t=e.mapPos(n.from,1),i=e.mapPos(n.to,-1);return t>=i?void 0:{from:t,to:i}}const iu=Ne.define({map:sv}),ba=Ne.define({map:sv});function lv(n){let e=[];for(let{head:t}of n.state.selection.ranges)e.some(i=>i.from<=t&&i.to>=t)||e.push(n.lineBlockAt(t));return e}const Ks=pi.define({create(){return Ye.none},update(n,e){n=n.map(e.changes);for(let t of e.effects)if(t.is(iu)&&!LT(n,t.value.from,t.value.to)){let{preparePlaceholder:i}=e.state.facet(fv),r=i?Ye.replace({widget:new KT(i(e.state,t.value))}):l0;n=n.update({add:[r.range(t.value.from,t.value.to)]})}else t.is(ba)&&(n=n.update({filter:(i,r)=>t.value.from!=i||t.value.to!=r,filterFrom:t.value.from,filterTo:t.value.to}));if(e.selection){let t=!1,{head:i}=e.selection.main;n.between(i,i,(r,s)=>{ri&&(t=!0)}),t&&(n=n.update({filterFrom:i,filterTo:i,filter:(r,s)=>s<=i||r>=i}))}return n},provide:n=>de.decorations.from(n),toJSON(n,e){let t=[];return n.between(0,e.doc.length,(i,r)=>{t.push(i,r)}),t},fromJSON(n){if(!Array.isArray(n)||n.length%2)throw new RangeError("Invalid JSON for fold state");let e=[];for(let t=0;t{(!r||r.from>s)&&(r={from:s,to:l})}),r}function LT(n,e,t){let i=!1;return n.between(e,e,(r,s)=>{r==e&&s==t&&(i=!0)}),i}function ov(n,e){return n.field(Ks,!1)?e:e.concat(Ne.appendConfig.of(cv()))}const NT=n=>{for(let e of lv(n)){let t=Zc(n.state,e.from,e.to);if(t)return n.dispatch({effects:ov(n.state,[iu.of(t),av(n,t)])}),!0}return!1},jT=n=>{if(!n.state.field(Ks,!1))return!1;let e=[];for(let t of lv(n)){let i=Rc(n.state,t.from,t.to);i&&e.push(ba.of(i),av(n,i,!1))}return e.length&&n.dispatch({effects:e}),e.length>0};function av(n,e,t=!0){let i=n.state.doc.lineAt(e.from).number,r=n.state.doc.lineAt(e.to).number;return de.announce.of(`${n.state.phrase(t?"Folded lines":"Unfolded lines")} ${i} ${n.state.phrase("to")} ${r}.`)}const BT=n=>{let{state:e}=n,t=[];for(let i=0;i{let e=n.state.field(Ks,!1);if(!e||!e.size)return!1;let t=[];return e.between(0,n.state.doc.length,(i,r)=>{t.push(ba.of({from:i,to:r}))}),n.dispatch({effects:t}),!0},GT=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:NT},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:jT},{key:"Ctrl-Alt-[",run:BT},{key:"Ctrl-Alt-]",run:FT}],HT={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},fv=_e.define({combine(n){return br(n,HT)}});function cv(n){return[Ks,tZ]}function uv(n,e){let{state:t}=n,i=t.facet(fv),r=l=>{let o=n.lineBlockAt(n.posAtDOM(l.target)),a=Rc(n.state,o.from,o.to);a&&n.dispatch({effects:ba.of(a)}),l.preventDefault()};if(i.placeholderDOM)return i.placeholderDOM(n,r,e);let s=document.createElement("span");return s.textContent=i.placeholderText,s.setAttribute("aria-label",t.phrase("folded code")),s.title=t.phrase("unfold"),s.className="cm-foldPlaceholder",s.onclick=r,s}const l0=Ye.replace({widget:new class extends Lr{toDOM(n){return uv(n,null)}}});class KT extends Lr{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return uv(e,this.value)}}const JT={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class rO extends qr{constructor(e,t){super(),this.config=e,this.open=t}eq(e){return this.config==e.config&&this.open==e.open}toDOM(e){if(this.config.markerDOM)return this.config.markerDOM(this.open);let t=document.createElement("span");return t.textContent=this.open?this.config.openText:this.config.closedText,t.title=e.state.phrase(this.open?"Fold line":"Unfold line"),t}}function eZ(n={}){let e=Object.assign(Object.assign({},JT),n),t=new rO(e,!0),i=new rO(e,!1),r=li.fromClass(class{constructor(l){this.from=l.viewport.from,this.markers=this.buildMarkers(l)}update(l){(l.docChanged||l.viewportChanged||l.startState.facet(xs)!=l.state.facet(xs)||l.startState.field(Ks,!1)!=l.state.field(Ks,!1)||ei(l.startState)!=ei(l.state)||e.foldingChanged(l))&&(this.markers=this.buildMarkers(l.view))}buildMarkers(l){let o=new ys;for(let a of l.viewportLineBlocks){let c=Rc(l.state,a.from,a.to)?i:Zc(l.state,a.from,a.to)?t:null;c&&o.add(a.from,a.from,c)}return o.finish()}}),{domEventHandlers:s}=e;return[r,J3({class:"cm-foldGutter",markers(l){var o;return((o=l.plugin(r))===null||o===void 0?void 0:o.markers)||vt.empty},initialSpacer(){return new rO(e,!1)},domEventHandlers:Object.assign(Object.assign({},s),{click:(l,o,a)=>{if(s.click&&s.click(l,o,a))return!0;let c=Rc(l.state,o.from,o.to);if(c)return l.dispatch({effects:ba.of(c)}),!0;let h=Zc(l.state,o.from,o.to);return h?(l.dispatch({effects:iu.of(h)}),!0):!1}})}),cv()]}const tZ=de.baseTheme({".cm-foldPlaceholder":{backgroundColor:"#eee",border:"1px solid #ddd",color:"#888",borderRadius:".2em",margin:"0 1px",padding:"0 1px",cursor:"pointer"},".cm-foldGutter span":{padding:"0 1px",cursor:"pointer"}});class $a{constructor(e,t){this.specs=e;let i;function r(o){let a=vs.newName();return(i||(i=Object.create(null)))["."+a]=o,a}const s=typeof t.all=="string"?t.all:t.all?r(t.all):void 0,l=t.scope;this.scope=l instanceof Gn?o=>o.prop(Ql)==l.data:l?o=>o==l:void 0,this.style=ev(e.map(o=>({tag:o.tag,class:o.class||r(Object.assign({},o,{tag:null}))})),{all:s}).style,this.module=i?new vs(i):null,this.themeType=t.themeType}static define(e,t){return new $a(e,t||{})}}const ad=_e.define(),hv=_e.define({combine(n){return n.length?[n[0]]:null}});function sO(n){let e=n.facet(ad);return e.length?e:n.facet(hv)}function Ov(n,e){let t=[nZ],i;return n instanceof $a&&(n.module&&t.push(de.styleModule.of(n.module)),i=n.themeType),e!=null&&e.fallback?t.push(hv.of(n)):i?t.push(ad.computeN([de.darkTheme],r=>r.facet(de.darkTheme)==(i=="dark")?[n]:[])):t.push(ad.of(n)),t}class iZ{constructor(e){this.markCache=Object.create(null),this.tree=ei(e.state),this.decorations=this.buildDeco(e,sO(e.state))}update(e){let t=ei(e.state),i=sO(e.state),r=i!=sO(e.startState);t.length{i.add(l,o,this.markCache[a]||(this.markCache[a]=Ye.mark({class:a})))},r,s);return i.finish()}}const nZ=Js.high(li.fromClass(iZ,{decorations:n=>n.decorations})),rZ=$a.define([{tag:b.meta,color:"#404740"},{tag:b.link,textDecoration:"underline"},{tag:b.heading,textDecoration:"underline",fontWeight:"bold"},{tag:b.emphasis,fontStyle:"italic"},{tag:b.strong,fontWeight:"bold"},{tag:b.strikethrough,textDecoration:"line-through"},{tag:b.keyword,color:"#708"},{tag:[b.atom,b.bool,b.url,b.contentSeparator,b.labelName],color:"#219"},{tag:[b.literal,b.inserted],color:"#164"},{tag:[b.string,b.deleted],color:"#a11"},{tag:[b.regexp,b.escape,b.special(b.string)],color:"#e40"},{tag:b.definition(b.variableName),color:"#00f"},{tag:b.local(b.variableName),color:"#30a"},{tag:[b.typeName,b.namespace],color:"#085"},{tag:b.className,color:"#167"},{tag:[b.special(b.variableName),b.macroName],color:"#256"},{tag:b.definition(b.propertyName),color:"#00c"},{tag:b.comment,color:"#940"},{tag:b.invalid,color:"#f00"}]),sZ=de.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),dv=1e4,pv="()[]{}",gv=_e.define({combine(n){return br(n,{afterCursor:!0,brackets:pv,maxScanDistance:dv,renderMatch:aZ})}}),lZ=Ye.mark({class:"cm-matchingBracket"}),oZ=Ye.mark({class:"cm-nonmatchingBracket"});function aZ(n){let e=[],t=n.matched?lZ:oZ;return e.push(t.range(n.start.from,n.start.to)),n.end&&e.push(t.range(n.end.from,n.end.to)),e}const fZ=pi.define({create(){return Ye.none},update(n,e){if(!e.docChanged&&!e.selection)return n;let t=[],i=e.state.facet(gv);for(let r of e.state.selection.ranges){if(!r.empty)continue;let s=pr(e.state,r.head,-1,i)||r.head>0&&pr(e.state,r.head-1,1,i)||i.afterCursor&&(pr(e.state,r.head,1,i)||r.headde.decorations.from(n)}),cZ=[fZ,sZ];function uZ(n={}){return[gv.of(n),cZ]}const mv=new at;function fd(n,e,t){let i=n.prop(e<0?at.openedBy:at.closedBy);if(i)return i;if(n.name.length==1){let r=t.indexOf(n.name);if(r>-1&&r%2==(e<0?1:0))return[t[r+e]]}return null}function cd(n){let e=n.type.prop(mv);return e?e(n.node):n}function pr(n,e,t,i={}){let r=i.maxScanDistance||dv,s=i.brackets||pv,l=ei(n),o=l.resolveInner(e,t);for(let a=o;a;a=a.parent){let c=fd(a.type,t,s);if(c&&a.from0?e>=h.from&&eh.from&&e<=h.to))return hZ(n,e,t,a,h,c,s)}}return OZ(n,e,t,l,o.type,r,s)}function hZ(n,e,t,i,r,s,l){let o=i.parent,a={from:r.from,to:r.to},c=0,h=o==null?void 0:o.cursor();if(h&&(t<0?h.childBefore(i.from):h.childAfter(i.to)))do if(t<0?h.to<=i.from:h.from>=i.to){if(c==0&&s.indexOf(h.type.name)>-1&&h.from0)return null;let c={from:t<0?e-1:e,to:t>0?e+1:e},h=n.doc.iterRange(e,t>0?n.doc.length:0),O=0;for(let p=0;!h.next().done&&p<=s;){let g=h.value;t<0&&(p+=g.length);let m=e+p*t;for(let $=t>0?0:g.length-1,y=t>0?g.length:-1;$!=y;$+=t){let _=l.indexOf(g[$]);if(!(_<0||i.resolveInner(m+$,1).type!=r))if(_%2==0==t>0)O++;else{if(O==1)return{start:c,end:{from:m+$,to:m+$+1},matched:_>>1==a>>1};O--}}t>0&&(p+=g.length)}return h.done?{start:c,matched:!1}:null}const dZ=Object.create(null),o0=[Ni.none],a0=[],pZ=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"]])pZ[n]=gZ(dZ,e);function lO(n,e){a0.indexOf(n)>-1||(a0.push(n),console.warn(e))}function gZ(n,e){let t=[];for(let s of e.split(" ")){let l=[];for(let o of s.split(".")){let a=n[o]||b[o];a?typeof a=="function"?l.length?l=l.map(a):lO(o,`Modifier ${o} used at start of tag`):l.length?lO(o,`Tag ${o} used as modifier`):l=Array.isArray(a)?a:[a]:lO(o,`Unknown highlighting tag ${o}`)}for(let o of l)t.push(o)}if(!t.length)return 0;let i=e.replace(/ /g,"_"),r=Ni.define({id:o0.length,name:i,props:[Ll({[i]:t})]});return o0.push(r),r.id}const mZ=n=>{let{state:e}=n,t=e.doc.lineAt(e.selection.main.from),i=Ld(n.state,t.from);return i.line?SZ(n):i.block?$Z(n):!1};function Id(n,e){return({state:t,dispatch:i})=>{if(t.readOnly)return!1;let r=n(e,t);return r?(i(t.update(r)),!0):!1}}const SZ=Id(wZ,0),bZ=Id(Sv,0),$Z=Id((n,e)=>Sv(n,e,vZ(e)),0);function Ld(n,e){let t=n.languageDataAt("commentTokens",e);return t.length?t[0]:{}}const To=50;function yZ(n,{open:e,close:t},i,r){let s=n.sliceDoc(i-To,i),l=n.sliceDoc(r,r+To),o=/\s*$/.exec(s)[0].length,a=/^\s*/.exec(l)[0].length,c=s.length-o;if(s.slice(c-e.length,c)==e&&l.slice(a,a+t.length)==t)return{open:{pos:i-o,margin:o&&1},close:{pos:r+a,margin:a&&1}};let h,O;r-i<=2*To?h=O=n.sliceDoc(i,r):(h=n.sliceDoc(i,i+To),O=n.sliceDoc(r-To,r));let p=/^\s*/.exec(h)[0].length,g=/\s*$/.exec(O)[0].length,m=O.length-g-t.length;return h.slice(p,p+e.length)==e&&O.slice(m,m+t.length)==t?{open:{pos:i+p+e.length,margin:/\s/.test(h.charAt(p+e.length))?1:0},close:{pos:r-g-t.length,margin:/\s/.test(O.charAt(m-1))?1:0}}:null}function vZ(n){let e=[];for(let t of n.selection.ranges){let i=n.doc.lineAt(t.from),r=t.to<=i.to?i:n.doc.lineAt(t.to),s=e.length-1;s>=0&&e[s].to>i.from?e[s].to=r.to:e.push({from:i.from+/^\s*/.exec(i.text)[0].length,to:r.to})}return e}function Sv(n,e,t=e.selection.ranges){let i=t.map(s=>Ld(e,s.from).block);if(!i.every(s=>s))return null;let r=t.map((s,l)=>yZ(e,i[l],s.from,s.to));if(n!=2&&!r.every(s=>s))return{changes:e.changes(t.map((s,l)=>r[l]?[]:[{from:s.from,insert:i[l].open+" "},{from:s.to,insert:" "+i[l].close}]))};if(n!=1&&r.some(s=>s)){let s=[];for(let l=0,o;lr&&(s==l||l>O.from)){r=O.from;let p=/^\s*/.exec(O.text)[0].length,g=p==O.length,m=O.text.slice(p,p+c.length)==c?p:-1;ps.comment<0&&(!s.empty||s.single))){let s=[];for(let{line:o,token:a,indent:c,empty:h,single:O}of i)(O||!h)&&s.push({from:o.from+c,insert:a+" "});let l=e.changes(s);return{changes:l,selection:e.selection.map(l,1)}}else if(n!=1&&i.some(s=>s.comment>=0)){let s=[];for(let{line:l,comment:o,token:a}of i)if(o>=0){let c=l.from+o,h=c+a.length;l.text[h-l.from]==" "&&h++,s.push({from:c,to:h})}return{changes:s}}return null}const ud=Ir.define(),QZ=Ir.define(),_Z=_e.define(),bv=_e.define({combine(n){return br(n,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(i,r)=>e(i,r)||t(i,r)})}});function kZ(n){let e=0;return n.iterChangedRanges((t,i)=>e=i),e}const $v=pi.define({create(){return gr.empty},update(n,e){let t=e.state.facet(bv),i=e.annotation(ud);if(i){let a=e.docChanged?ee.single(kZ(e.changes)):void 0,c=Ji.fromTransaction(e,a),h=i.side,O=h==0?n.undone:n.done;return c?O=Xc(O,O.length,t.minDepth,c):O=wv(O,e.startState.selection),new gr(h==0?i.rest:O,h==0?O:i.rest)}let r=e.annotation(QZ);if((r=="full"||r=="before")&&(n=n.isolate()),e.annotation(hi.addToHistory)===!1)return e.changes.empty?n:n.addMapping(e.changes.desc);let s=Ji.fromTransaction(e),l=e.annotation(hi.time),o=e.annotation(hi.userEvent);return s?n=n.addChanges(s,l,o,t,e):e.selection&&(n=n.addSelection(e.startState.selection,l,o,t.newGroupDelay)),(r=="full"||r=="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 gr(n.done.map(Ji.fromJSON),n.undone.map(Ji.fromJSON))}});function PZ(n={}){return[$v,bv.of(n),de.domEventHandlers({beforeinput(e,t){let i=e.inputType=="historyUndo"?yv:e.inputType=="historyRedo"?hd:null;return i?(e.preventDefault(),i(t)):!1}})]}function nu(n,e){return function({state:t,dispatch:i}){if(!e&&t.readOnly)return!1;let r=t.field($v,!1);if(!r)return!1;let s=r.pop(n,t,e);return s?(i(s),!0):!1}}const yv=nu(0,!1),hd=nu(1,!1),WZ=nu(0,!0),xZ=nu(1,!0);class Ji{constructor(e,t,i,r,s){this.changes=e,this.effects=t,this.mapped=i,this.startSelection=r,this.selectionsAfter=s}setSelAfter(e){return new Ji(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,i;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:(i=this.startSelection)===null||i===void 0?void 0:i.toJSON(),selectionsAfter:this.selectionsAfter.map(r=>r.toJSON())}}static fromJSON(e){return new Ji(e.changes&&ui.fromJSON(e.changes),[],e.mapped&&mr.fromJSON(e.mapped),e.startSelection&&ee.fromJSON(e.startSelection),e.selectionsAfter.map(ee.fromJSON))}static fromTransaction(e,t){let i=Xn;for(let r of e.startState.facet(_Z)){let s=r(e);s.length&&(i=i.concat(s))}return!i.length&&e.changes.empty?null:new Ji(e.changes.invert(e.startState.doc),i,void 0,t||e.startState.selection,Xn)}static selection(e){return new Ji(void 0,Xn,void 0,void 0,e)}}function Xc(n,e,t,i){let r=e+1>t+20?e-t-1:0,s=n.slice(r,e);return s.push(i),s}function CZ(n,e){let t=[],i=!1;return n.iterChangedRanges((r,s)=>t.push(r,s)),e.iterChangedRanges((r,s,l,o)=>{for(let a=0;a=c&&l<=h&&(i=!0)}}),i}function TZ(n,e){return n.ranges.length==e.ranges.length&&n.ranges.filter((t,i)=>t.empty!=e.ranges[i].empty).length===0}function vv(n,e){return n.length?e.length?n.concat(e):n:e}const Xn=[],ZZ=200;function wv(n,e){if(n.length){let t=n[n.length-1],i=t.selectionsAfter.slice(Math.max(0,t.selectionsAfter.length-ZZ));return i.length&&i[i.length-1].eq(e)?n:(i.push(e),Xc(n,n.length-1,1e9,t.setSelAfter(i)))}else return[Ji.selection([e])]}function RZ(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 oO(n,e){if(!n.length)return n;let t=n.length,i=Xn;for(;t;){let r=XZ(n[t-1],e,i);if(r.changes&&!r.changes.empty||r.effects.length){let s=n.slice(0,t);return s[t-1]=r,s}else e=r.mapped,t--,i=r.selectionsAfter}return i.length?[Ji.selection(i)]:Xn}function XZ(n,e,t){let i=vv(n.selectionsAfter.length?n.selectionsAfter.map(o=>o.map(e)):Xn,t);if(!n.changes)return Ji.selection(i);let r=n.changes.map(e),s=e.mapDesc(n.changes,!0),l=n.mapped?n.mapped.composeDesc(s):s;return new Ji(r,Ne.mapEffects(n.effects,e),l,n.startSelection.map(s),i)}const AZ=/^(input\.type|delete)($|\.)/;class gr{constructor(e,t,i=0,r=void 0){this.done=e,this.undone=t,this.prevTime=i,this.prevUserEvent=r}isolate(){return this.prevTime?new gr(this.done,this.undone):this}addChanges(e,t,i,r,s){let l=this.done,o=l[l.length-1];return o&&o.changes&&!o.changes.empty&&e.changes&&(!i||AZ.test(i))&&(!o.selectionsAfter.length&&t-this.prevTime0&&t-this.prevTimet.empty?n.moveByChar(t,e):ru(t,e))}function Mi(n){return n.textDirectionAt(n.state.selection.main.head)==jt.LTR}const _v=n=>Qv(n,!Mi(n)),kv=n=>Qv(n,Mi(n));function Pv(n,e){return er(n,t=>t.empty?n.moveByGroup(t,e):ru(t,e))}const UZ=n=>Pv(n,!Mi(n)),EZ=n=>Pv(n,Mi(n));function zZ(n,e,t){if(e.type.prop(t))return!0;let i=e.to-e.from;return i&&(i>2||/[^\s,.;:]/.test(n.sliceDoc(e.from,e.to)))||e.firstChild}function su(n,e,t){let i=ei(n).resolveInner(e.head),r=t?at.closedBy:at.openedBy;for(let a=e.head;;){let c=t?i.childAfter(a):i.childBefore(a);if(!c)break;zZ(n,c,r)?i=c:a=t?c.to:c.from}let s=i.type.prop(r),l,o;return s&&(l=t?pr(n,i.from,1):pr(n,i.to,-1))&&l.matched?o=t?l.end.to:l.end.from:o=t?i.to:i.from,ee.cursor(o,t?-1:1)}const MZ=n=>er(n,e=>su(n.state,e,!Mi(n))),DZ=n=>er(n,e=>su(n.state,e,Mi(n)));function Wv(n,e){return er(n,t=>{if(!t.empty)return ru(t,e);let i=n.moveVertically(t,e);return i.head!=t.head?i:n.moveToLineBoundary(t,e)})}const xv=n=>Wv(n,!1),Cv=n=>Wv(n,!0);function Tv(n){let e=n.scrollDOM.clientHeightl.empty?n.moveVertically(l,e,t.height):ru(l,e));if(r.eq(i.selection))return!1;let s;if(t.selfScroll){let l=n.coordsAtPos(i.selection.main.head),o=n.scrollDOM.getBoundingClientRect(),a=o.top+t.marginTop,c=o.bottom-t.marginBottom;l&&l.top>a&&l.bottomZv(n,!1),Od=n=>Zv(n,!0);function Cs(n,e,t){let i=n.lineBlockAt(e.head),r=n.moveToLineBoundary(e,t);if(r.head==e.head&&r.head!=(t?i.to:i.from)&&(r=n.moveToLineBoundary(e,t,!1)),!t&&r.head==i.from&&i.length){let s=/^\s*/.exec(n.state.sliceDoc(i.from,Math.min(i.from+100,i.to)))[0].length;s&&e.head!=i.from+s&&(r=ee.cursor(i.from+s))}return r}const VZ=n=>er(n,e=>Cs(n,e,!0)),qZ=n=>er(n,e=>Cs(n,e,!1)),IZ=n=>er(n,e=>Cs(n,e,!Mi(n))),LZ=n=>er(n,e=>Cs(n,e,Mi(n))),NZ=n=>er(n,e=>ee.cursor(n.lineBlockAt(e.head).from,1)),jZ=n=>er(n,e=>ee.cursor(n.lineBlockAt(e.head).to,-1));function BZ(n,e,t){let i=!1,r=Bl(n.selection,s=>{let l=pr(n,s.head,-1)||pr(n,s.head,1)||s.head>0&&pr(n,s.head-1,1)||s.headBZ(n,e);function Un(n,e){let t=Bl(n.state.selection,i=>{let r=e(i);return ee.range(i.anchor,r.head,r.goalColumn,r.bidiLevel||void 0)});return t.eq(n.state.selection)?!1:(n.dispatch(yr(n.state,t)),!0)}function Rv(n,e){return Un(n,t=>n.moveByChar(t,e))}const Xv=n=>Rv(n,!Mi(n)),Av=n=>Rv(n,Mi(n));function Yv(n,e){return Un(n,t=>n.moveByGroup(t,e))}const GZ=n=>Yv(n,!Mi(n)),HZ=n=>Yv(n,Mi(n)),KZ=n=>Un(n,e=>su(n.state,e,!Mi(n))),JZ=n=>Un(n,e=>su(n.state,e,Mi(n)));function Uv(n,e){return Un(n,t=>n.moveVertically(t,e))}const Ev=n=>Uv(n,!1),zv=n=>Uv(n,!0);function Mv(n,e){return Un(n,t=>n.moveVertically(t,e,Tv(n).height))}const c0=n=>Mv(n,!1),u0=n=>Mv(n,!0),eR=n=>Un(n,e=>Cs(n,e,!0)),tR=n=>Un(n,e=>Cs(n,e,!1)),iR=n=>Un(n,e=>Cs(n,e,!Mi(n))),nR=n=>Un(n,e=>Cs(n,e,Mi(n))),rR=n=>Un(n,e=>ee.cursor(n.lineBlockAt(e.head).from)),sR=n=>Un(n,e=>ee.cursor(n.lineBlockAt(e.head).to)),h0=({state:n,dispatch:e})=>(e(yr(n,{anchor:0})),!0),O0=({state:n,dispatch:e})=>(e(yr(n,{anchor:n.doc.length})),!0),d0=({state:n,dispatch:e})=>(e(yr(n,{anchor:n.selection.main.anchor,head:0})),!0),p0=({state:n,dispatch:e})=>(e(yr(n,{anchor:n.selection.main.anchor,head:n.doc.length})),!0),lR=({state:n,dispatch:e})=>(e(n.update({selection:{anchor:0,head:n.doc.length},userEvent:"select"})),!0),oR=({state:n,dispatch:e})=>{let t=lu(n).map(({from:i,to:r})=>ee.range(i,Math.min(r+1,n.doc.length)));return e(n.update({selection:ee.create(t),userEvent:"select"})),!0},aR=({state:n,dispatch:e})=>{let t=Bl(n.selection,i=>{var r;let s=ei(n).resolveStack(i.from,1);for(let l=s;l;l=l.next){let{node:o}=l;if((o.from=i.to||o.to>i.to&&o.from<=i.from)&&(!((r=o.parent)===null||r===void 0)&&r.parent))return ee.range(o.to,o.from)}return i});return e(yr(n,t)),!0},fR=({state:n,dispatch:e})=>{let t=n.selection,i=null;return t.ranges.length>1?i=ee.create([t.main]):t.main.empty||(i=ee.create([ee.cursor(t.main.head)])),i?(e(yr(n,i)),!0):!1};function ya(n,e){if(n.state.readOnly)return!1;let t="delete.selection",{state:i}=n,r=i.changeByRange(s=>{let{from:l,to:o}=s;if(l==o){let a=e(s);al&&(t="delete.forward",a=Ff(n,a,!0)),l=Math.min(l,a),o=Math.max(o,a)}else l=Ff(n,l,!1),o=Ff(n,o,!0);return l==o?{range:s}:{changes:{from:l,to:o},range:ee.cursor(l,lr(n)))i.between(e,e,(r,s)=>{re&&(e=t?s:r)});return e}const Dv=(n,e)=>ya(n,t=>{let i=t.from,{state:r}=n,s=r.doc.lineAt(i),l,o;if(!e&&i>s.from&&iDv(n,!1),Vv=n=>Dv(n,!0),qv=(n,e)=>ya(n,t=>{let i=t.head,{state:r}=n,s=r.doc.lineAt(i),l=r.charCategorizer(i);for(let o=null;;){if(i==(e?s.to:s.from)){i==t.head&&s.number!=(e?r.doc.lines:1)&&(i+=e?1:-1);break}let a=Ei(s.text,i-s.from,e)+s.from,c=s.text.slice(Math.min(i,a)-s.from,Math.max(i,a)-s.from),h=l(c);if(o!=null&&h!=o)break;(c!=" "||i!=t.head)&&(o=h),i=a}return i}),Iv=n=>qv(n,!1),cR=n=>qv(n,!0),uR=n=>ya(n,e=>{let t=n.lineBlockAt(e.head).to;return e.headya(n,e=>{let t=n.moveToLineBoundary(e,!1).head;return e.head>t?t:Math.max(0,e.head-1)}),OR=n=>ya(n,e=>{let t=n.moveToLineBoundary(e,!0).head;return e.head{if(n.readOnly)return!1;let t=n.changeByRange(i=>({changes:{from:i.from,to:i.to,insert:mt.of(["",""])},range:ee.cursor(i.from)}));return e(n.update(t,{scrollIntoView:!0,userEvent:"input"})),!0},pR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=n.changeByRange(i=>{if(!i.empty||i.from==0||i.from==n.doc.length)return{range:i};let r=i.from,s=n.doc.lineAt(r),l=r==s.from?r-1:Ei(s.text,r-s.from,!1)+s.from,o=r==s.to?r+1:Ei(s.text,r-s.from,!0)+s.from;return{changes:{from:l,to:o,insert:n.doc.slice(r,o).append(n.doc.slice(l,r))},range:ee.cursor(o)}});return t.changes.empty?!1:(e(n.update(t,{scrollIntoView:!0,userEvent:"move.character"})),!0)};function lu(n){let e=[],t=-1;for(let i of n.selection.ranges){let r=n.doc.lineAt(i.from),s=n.doc.lineAt(i.to);if(!i.empty&&i.to==s.from&&(s=n.doc.lineAt(i.to-1)),t>=r.number){let l=e[e.length-1];l.to=s.to,l.ranges.push(i)}else e.push({from:r.from,to:s.to,ranges:[i]});t=s.number+1}return e}function Lv(n,e,t){if(n.readOnly)return!1;let i=[],r=[];for(let s of lu(n)){if(t?s.to==n.doc.length:s.from==0)continue;let l=n.doc.lineAt(t?s.to+1:s.from-1),o=l.length+1;if(t){i.push({from:s.to,to:l.to},{from:s.from,insert:l.text+n.lineBreak});for(let a of s.ranges)r.push(ee.range(Math.min(n.doc.length,a.anchor+o),Math.min(n.doc.length,a.head+o)))}else{i.push({from:l.from,to:s.from},{from:s.to,insert:n.lineBreak+l.text});for(let a of s.ranges)r.push(ee.range(a.anchor-o,a.head-o))}}return i.length?(e(n.update({changes:i,scrollIntoView:!0,selection:ee.create(r,n.selection.mainIndex),userEvent:"move.line"})),!0):!1}const gR=({state:n,dispatch:e})=>Lv(n,e,!1),mR=({state:n,dispatch:e})=>Lv(n,e,!0);function Nv(n,e,t){if(n.readOnly)return!1;let i=[];for(let r of lu(n))t?i.push({from:r.from,insert:n.doc.slice(r.from,r.to)+n.lineBreak}):i.push({from:r.to,insert:n.lineBreak+n.doc.slice(r.from,r.to)});return e(n.update({changes:i,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const SR=({state:n,dispatch:e})=>Nv(n,e,!1),bR=({state:n,dispatch:e})=>Nv(n,e,!0),$R=n=>{if(n.state.readOnly)return!1;let{state:e}=n,t=e.changes(lu(e).map(({from:r,to:s})=>(r>0?r--:sn.moveVertically(r,!0)).map(t);return n.dispatch({changes:t,selection:i,scrollIntoView:!0,userEvent:"delete.line"}),!0};function yR(n,e){if(/\(\)|\[\]|\{\}/.test(n.sliceDoc(e-1,e+1)))return{from:e,to:e};let t=ei(n).resolveInner(e),i=t.childBefore(e),r=t.childAfter(e),s;return i&&r&&i.to<=e&&r.from>=e&&(s=i.type.prop(at.closedBy))&&s.indexOf(r.name)>-1&&n.doc.lineAt(i.to).from==n.doc.lineAt(r.from).from&&!/\S/.test(n.sliceDoc(i.to,r.from))?{from:i.to,to:r.from}:null}const vR=jv(!1),wR=jv(!0);function jv(n){return({state:e,dispatch:t})=>{if(e.readOnly)return!1;let i=e.changeByRange(r=>{let{from:s,to:l}=r,o=e.doc.lineAt(s),a=!n&&s==l&&yR(e,s);n&&(s=l=(l<=o.to?o:e.doc.lineAt(l)).to);let c=new tu(e,{simulateBreak:s,simulateDoubleBreak:!!a}),h=Vd(c,s);for(h==null&&(h=Il(/^\s*/.exec(e.doc.lineAt(s).text)[0],e.tabSize));lo.from&&s{let r=[];for(let l=i.from;l<=i.to;){let o=n.doc.lineAt(l);o.number>t&&(i.empty||i.to>o.from)&&(e(o,r,i),t=o.number),l=o.to+1}let s=n.changes(r);return{changes:r,range:ee.range(s.mapPos(i.anchor,1),s.mapPos(i.head,1))}})}const QR=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let t=Object.create(null),i=new tu(n,{overrideIndentation:s=>{let l=t[s];return l??-1}}),r=Nd(n,(s,l,o)=>{let a=Vd(i,s.from);if(a==null)return;/\S/.test(s.text)||(a=0);let c=/^\s*/.exec(s.text)[0],h=fa(n,a);(c!=h||o.fromn.readOnly?!1:(e(n.update(Nd(n,(t,i)=>{i.push({from:t.from,insert:n.facet(eu)})}),{userEvent:"input.indent"})),!0),Fv=({state:n,dispatch:e})=>n.readOnly?!1:(e(n.update(Nd(n,(t,i)=>{let r=/^\s*/.exec(t.text)[0];if(!r)return;let s=Il(r,n.tabSize),l=0,o=fa(n,Math.max(0,s-Tc(n)));for(;l({mac:n.key,run:n.run,shift:n.shift}))),PR=[{key:"Alt-ArrowLeft",mac:"Ctrl-ArrowLeft",run:MZ,shift:KZ},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:DZ,shift:JZ},{key:"Alt-ArrowUp",run:gR},{key:"Shift-Alt-ArrowUp",run:SR},{key:"Alt-ArrowDown",run:mR},{key:"Shift-Alt-ArrowDown",run:bR},{key:"Escape",run:fR},{key:"Mod-Enter",run:wR},{key:"Alt-l",mac:"Ctrl-l",run:oR},{key:"Mod-i",run:aR,preventDefault:!0},{key:"Mod-[",run:Fv},{key:"Mod-]",run:Bv},{key:"Mod-Alt-\\",run:QR},{key:"Shift-Mod-k",run:$R},{key:"Shift-Mod-\\",run:FZ},{key:"Mod-/",run:mZ},{key:"Alt-A",run:bZ}].concat(kR),WR={key:"Tab",run:Bv,shift:Fv};function Yt(){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 i in t)if(Object.prototype.hasOwnProperty.call(t,i)){var r=t[i];typeof r=="string"?n.setAttribute(i,r):r!=null&&(n[i]=r)}e++}for(;en.normalize("NFKD"):n=>n;class zl{constructor(e,t,i=0,r=e.length,s,l){this.test=l,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(i,r),this.bufferStart=i,this.normalize=s?o=>s(g0(o)):g0,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 Qi(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=Qd(e),i=this.bufferStart+this.bufferPos;this.bufferPos+=Zn(e);let r=this.normalize(t);for(let s=0,l=i;;s++){let o=r.charCodeAt(s),a=this.match(o,l);if(s==r.length-1){if(a)return this.value=a,this;break}l==i&&sthis.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 i=this.curLineStart+t.index,r=i+t[0].length;if(this.matchPos=Ac(this.text,r+(i==r?1:0)),i==this.curLineStart+this.curLine.length&&this.nextLine(),(ithis.value.to)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this;e=this.matchPos-this.curLineStart}else if(this.curLineStart+this.curLine.length=i||r.to<=t){let o=new Xl(t,e.sliceString(t,i));return aO.set(e,o),o}if(r.from==t&&r.to==i)return r;let{text:s,from:l}=r;return l>t&&(s=e.sliceString(t,l)+s,l=t),r.to=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 i=this.flat.from+t.index,r=i+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(i,r,t)))return this.value={from:i,to:r,match:t},this.matchPos=Ac(this.text,r+(i==r?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=Xl.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+this.flat.text.length*2))}}}typeof Symbol<"u"&&(Kv.prototype[Symbol.iterator]=Jv.prototype[Symbol.iterator]=function(){return this});function xR(n){try{return new RegExp(n,jd),!0}catch{return!1}}function Ac(n,e){if(e>=n.length)return e;let t=n.lineAt(e),i;for(;e=56320&&i<57344;)e++;return e}function pd(n){let e=String(n.state.doc.lineAt(n.state.selection.main.head).number),t=Yt("input",{class:"cm-textfield",name:"line",value:e}),i=Yt("form",{class:"cm-gotoLine",onkeydown:s=>{s.keyCode==27?(s.preventDefault(),n.dispatch({effects:Yc.of(!1)}),n.focus()):s.keyCode==13&&(s.preventDefault(),r())},onsubmit:s=>{s.preventDefault(),r()}},Yt("label",n.state.phrase("Go to line"),": ",t)," ",Yt("button",{class:"cm-button",type:"submit"},n.state.phrase("go")));function r(){let s=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!s)return;let{state:l}=n,o=l.doc.lineAt(l.selection.main.head),[,a,c,h,O]=s,p=h?+h.slice(1):0,g=c?+c:o.number;if(c&&O){let y=g/100;a&&(y=y*(a=="-"?-1:1)+o.number/l.doc.lines),g=Math.round(l.doc.lines*y)}else c&&a&&(g=g*(a=="-"?-1:1)+o.number);let m=l.doc.line(Math.max(1,Math.min(l.doc.lines,g))),$=ee.cursor(m.from+Math.max(0,Math.min(p,m.length)));n.dispatch({effects:[Yc.of(!1),de.scrollIntoView($.from,{y:"center"})],selection:$}),n.focus()}return{dom:i}}const Yc=Ne.define(),m0=pi.define({create(){return!0},update(n,e){for(let t of e.effects)t.is(Yc)&&(n=t.value);return n},provide:n=>sa.from(n,e=>e?pd:null)}),CR=n=>{let e=ra(n,pd);if(!e){let t=[Yc.of(!0)];n.state.field(m0,!1)==null&&t.push(Ne.appendConfig.of([m0,TR])),n.dispatch({effects:t}),e=ra(n,pd)}return e&&e.dom.querySelector("input").select(),!0},TR=de.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),ZR={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},RR=_e.define({combine(n){return br(n,ZR,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})}});function XR(n){return[zR,ER]}const AR=Ye.mark({class:"cm-selectionMatch"}),YR=Ye.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function S0(n,e,t,i){return(t==0||n(e.sliceDoc(t-1,t))!=Lt.Word)&&(i==e.doc.length||n(e.sliceDoc(i,i+1))!=Lt.Word)}function UR(n,e,t,i){return n(e.sliceDoc(t,t+1))==Lt.Word&&n(e.sliceDoc(i-1,i))==Lt.Word}const ER=li.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(RR),{state:t}=n,i=t.selection;if(i.ranges.length>1)return Ye.none;let r=i.main,s,l=null;if(r.empty){if(!e.highlightWordAroundCursor)return Ye.none;let a=t.wordAt(r.head);if(!a)return Ye.none;l=t.charCategorizer(r.head),s=t.sliceDoc(a.from,a.to)}else{let a=r.to-r.from;if(a200)return Ye.none;if(e.wholeWords){if(s=t.sliceDoc(r.from,r.to),l=t.charCategorizer(r.head),!(S0(l,t,r.from,r.to)&&UR(l,t,r.from,r.to)))return Ye.none}else if(s=t.sliceDoc(r.from,r.to).trim(),!s)return Ye.none}let o=[];for(let a of n.visibleRanges){let c=new zl(t.doc,s,a.from,a.to);for(;!c.next().done;){let{from:h,to:O}=c.value;if((!l||S0(l,t,h,O))&&(r.empty&&h<=r.from&&O>=r.to?o.push(YR.range(h,O)):(h>=r.to||O<=r.from)&&o.push(AR.range(h,O)),o.length>e.maxMatches))return Ye.none}}return Ye.set(o)}},{decorations:n=>n.decorations}),zR=de.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),MR=({state:n,dispatch:e})=>{let{selection:t}=n,i=ee.create(t.ranges.map(r=>n.wordAt(r.head)||ee.cursor(r.head)),t.mainIndex);return i.eq(t)?!1:(e(n.update({selection:i})),!0)};function DR(n,e){let{main:t,ranges:i}=n.selection,r=n.wordAt(t.head),s=r&&r.from==t.from&&r.to==t.to;for(let l=!1,o=new zl(n.doc,e,i[i.length-1].to);;)if(o.next(),o.done){if(l)return null;o=new zl(n.doc,e,0,Math.max(0,i[i.length-1].from-1)),l=!0}else{if(l&&i.some(a=>a.from==o.value.from))continue;if(s){let a=n.wordAt(o.value.from);if(!a||a.from!=o.value.from||a.to!=o.value.to)continue}return o.value}}const VR=({state:n,dispatch:e})=>{let{ranges:t}=n.selection;if(t.some(s=>s.from===s.to))return MR({state:n,dispatch:e});let i=n.sliceDoc(t[0].from,t[0].to);if(n.selection.ranges.some(s=>n.sliceDoc(s.from,s.to)!=i))return!1;let r=DR(n,i);return r?(e(n.update({selection:n.selection.addRange(ee.range(r.from,r.to),!1),effects:de.scrollIntoView(r.to)})),!0):!1},Fl=_e.define({combine(n){return br(n,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new eX(e),scrollToMatch:e=>de.scrollIntoView(e)})}});class ew{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||xR(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,(t,i)=>i=="n"?` +`:i=="r"?"\r":i=="t"?" ":"\\")}eq(e){return this.search==e.search&&this.replace==e.replace&&this.caseSensitive==e.caseSensitive&&this.regexp==e.regexp&&this.wholeWord==e.wholeWord}create(){return this.regexp?new NR(this):new IR(this)}getCursor(e,t=0,i){let r=e.doc?e:Ot.create({doc:e});return i==null&&(i=r.doc.length),this.regexp?yl(this,r,t,i):$l(this,r,t,i)}}class tw{constructor(e){this.spec=e}}function $l(n,e,t,i){return new zl(e.doc,n.unquoted,t,i,n.caseSensitive?void 0:r=>r.toLowerCase(),n.wholeWord?qR(e.doc,e.charCategorizer(e.selection.main.head)):void 0)}function qR(n,e){return(t,i,r,s)=>((s>t||s+r.length=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=$l(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(i+this.spec.unquoted.length,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}function yl(n,e,t,i){return new Kv(e.doc,n.search,{ignoreCase:!n.caseSensitive,test:n.wholeWord?LR(e.charCategorizer(e.selection.main.head)):void 0},t,i)}function Uc(n,e){return n.slice(Ei(n,e,!1),e)}function Ec(n,e){return n.slice(e,Ei(n,e))}function LR(n){return(e,t,i)=>!i[0].length||(n(Uc(i.input,i.index))!=Lt.Word||n(Ec(i.input,i.index))!=Lt.Word)&&(n(Ec(i.input,i.index+i[0].length))!=Lt.Word||n(Uc(i.input,i.index+i[0].length))!=Lt.Word)}class NR extends tw{nextMatch(e,t,i){let r=yl(this.spec,e,i,e.doc.length).next();return r.done&&(r=yl(this.spec,e,0,t).next()),r.done?null:r.value}prevMatchInRange(e,t,i){for(let r=1;;r++){let s=Math.max(t,i-r*1e4),l=yl(this.spec,e,s,i),o=null;for(;!l.next().done;)o=l.value;if(o&&(s==t||o.from>s+10))return o;if(s==t)return null}}prevMatch(e,t,i){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,i,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace.replace(/\$([$&\d+])/g,(t,i)=>i=="$"?"$":i=="&"?e.match[0]:i!="0"&&+i=t)return null;r.push(i.value)}return r}highlight(e,t,i,r){let s=yl(this.spec,e,Math.max(0,t-250),Math.min(i+250,e.doc.length));for(;!s.next().done;)r(s.value.from,s.value.to)}}const ca=Ne.define(),Bd=Ne.define(),bs=pi.define({create(n){return new fO(gd(n).create(),null)},update(n,e){for(let t of e.effects)t.is(ca)?n=new fO(t.value.create(),n.panel):t.is(Bd)&&(n=new fO(n.query,t.value?Fd:null));return n},provide:n=>sa.from(n,e=>e.panel)});class fO{constructor(e,t){this.query=e,this.panel=t}}const jR=Ye.mark({class:"cm-searchMatch"}),BR=Ye.mark({class:"cm-searchMatch cm-searchMatch-selected"}),FR=li.fromClass(class{constructor(n){this.view=n,this.decorations=this.highlight(n.state.field(bs))}update(n){let e=n.state.field(bs);(e!=n.startState.field(bs)||n.docChanged||n.selectionSet||n.viewportChanged)&&(this.decorations=this.highlight(e))}highlight({query:n,panel:e}){if(!e||!n.spec.valid)return Ye.none;let{view:t}=this,i=new ys;for(let r=0,s=t.visibleRanges,l=s.length;rs[r+1].from-2*250;)a=s[++r].to;n.highlight(t.state,o,a,(c,h)=>{let O=t.state.selection.ranges.some(p=>p.from==c&&p.to==h);i.add(c,h,O?BR:jR)})}return i.finish()}},{decorations:n=>n.decorations});function va(n){return e=>{let t=e.state.field(bs,!1);return t&&t.query.spec.valid?n(e,t):rw(e)}}const zc=va((n,{query:e})=>{let{to:t}=n.state.selection.main,i=e.nextMatch(n.state,t,t);if(!i)return!1;let r=ee.single(i.from,i.to),s=n.state.facet(Fl);return n.dispatch({selection:r,effects:[Gd(n,i),s.scrollToMatch(r.main,n)],userEvent:"select.search"}),nw(n),!0}),Mc=va((n,{query:e})=>{let{state:t}=n,{from:i}=t.selection.main,r=e.prevMatch(t,i,i);if(!r)return!1;let s=ee.single(r.from,r.to),l=n.state.facet(Fl);return n.dispatch({selection:s,effects:[Gd(n,r),l.scrollToMatch(s.main,n)],userEvent:"select.search"}),nw(n),!0}),GR=va((n,{query:e})=>{let t=e.matchAll(n.state,1e3);return!t||!t.length?!1:(n.dispatch({selection:ee.create(t.map(i=>ee.range(i.from,i.to))),userEvent:"select.search.matches"}),!0)}),HR=({state:n,dispatch:e})=>{let t=n.selection;if(t.ranges.length>1||t.main.empty)return!1;let{from:i,to:r}=t.main,s=[],l=0;for(let o=new zl(n.doc,n.sliceDoc(i,r));!o.next().done;){if(s.length>1e3)return!1;o.value.from==i&&(l=s.length),s.push(ee.range(o.value.from,o.value.to))}return e(n.update({selection:ee.create(s,l),userEvent:"select.search.matches"})),!0},b0=va((n,{query:e})=>{let{state:t}=n,{from:i,to:r}=t.selection.main;if(t.readOnly)return!1;let s=e.nextMatch(t,i,i);if(!s)return!1;let l=[],o,a,c=[];if(s.from==i&&s.to==r&&(a=t.toText(e.getReplacement(s)),l.push({from:s.from,to:s.to,insert:a}),s=e.nextMatch(t,s.from,s.to),c.push(de.announce.of(t.phrase("replaced match on line $",t.doc.lineAt(i).number)+"."))),s){let h=l.length==0||l[0].from>=s.to?0:s.to-s.from-a.length;o=ee.single(s.from-h,s.to-h),c.push(Gd(n,s)),c.push(t.facet(Fl).scrollToMatch(o.main,n))}return n.dispatch({changes:l,selection:o,effects:c,userEvent:"input.replace"}),!0}),KR=va((n,{query:e})=>{if(n.state.readOnly)return!1;let t=e.matchAll(n.state,1e9).map(r=>{let{from:s,to:l}=r;return{from:s,to:l,insert:e.getReplacement(r)}});if(!t.length)return!1;let i=n.state.phrase("replaced $ matches",t.length)+".";return n.dispatch({changes:t,effects:de.announce.of(i),userEvent:"input.replace.all"}),!0});function Fd(n){return n.state.facet(Fl).createPanel(n)}function gd(n,e){var t,i,r,s,l;let o=n.selection.main,a=o.empty||o.to>o.from+100?"":n.sliceDoc(o.from,o.to);if(e&&!a)return e;let c=n.facet(Fl);return new ew({search:((t=e==null?void 0:e.literal)!==null&&t!==void 0?t:c.literal)?a:a.replace(/\n/g,"\\n"),caseSensitive:(i=e==null?void 0:e.caseSensitive)!==null&&i!==void 0?i:c.caseSensitive,literal:(r=e==null?void 0:e.literal)!==null&&r!==void 0?r:c.literal,regexp:(s=e==null?void 0:e.regexp)!==null&&s!==void 0?s:c.regexp,wholeWord:(l=e==null?void 0:e.wholeWord)!==null&&l!==void 0?l:c.wholeWord})}function iw(n){let e=ra(n,Fd);return e&&e.dom.querySelector("[main-field]")}function nw(n){let e=iw(n);e&&e==n.root.activeElement&&e.select()}const rw=n=>{let e=n.state.field(bs,!1);if(e&&e.panel){let t=iw(n);if(t&&t!=n.root.activeElement){let i=gd(n.state,e.query.spec);i.valid&&n.dispatch({effects:ca.of(i)}),t.focus(),t.select()}}else n.dispatch({effects:[Bd.of(!0),e?ca.of(gd(n.state,e.query.spec)):Ne.appendConfig.of(iX)]});return!0},sw=n=>{let e=n.state.field(bs,!1);if(!e||!e.panel)return!1;let t=ra(n,Fd);return t&&t.dom.contains(n.root.activeElement)&&n.focus(),n.dispatch({effects:Bd.of(!1)}),!0},JR=[{key:"Mod-f",run:rw,scope:"editor search-panel"},{key:"F3",run:zc,shift:Mc,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:zc,shift:Mc,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:sw,scope:"editor search-panel"},{key:"Mod-Shift-l",run:HR},{key:"Alt-g",run:CR},{key:"Mod-d",run:VR,preventDefault:!0}];class eX{constructor(e){this.view=e;let t=this.query=e.state.field(bs).query.spec;this.commit=this.commit.bind(this),this.searchField=Yt("input",{value:t.search,placeholder:cn(e,"Find"),"aria-label":cn(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=Yt("input",{value:t.replace,placeholder:cn(e,"Replace"),"aria-label":cn(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=Yt("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=Yt("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=Yt("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit});function i(r,s,l){return Yt("button",{class:"cm-button",name:r,onclick:s,type:"button"},l)}this.dom=Yt("div",{onkeydown:r=>this.keydown(r),class:"cm-search"},[this.searchField,i("next",()=>zc(e),[cn(e,"next")]),i("prev",()=>Mc(e),[cn(e,"previous")]),i("select",()=>GR(e),[cn(e,"all")]),Yt("label",null,[this.caseField,cn(e,"match case")]),Yt("label",null,[this.reField,cn(e,"regexp")]),Yt("label",null,[this.wordField,cn(e,"by word")]),...e.state.readOnly?[]:[Yt("br"),this.replaceField,i("replace",()=>b0(e),[cn(e,"replace")]),i("replaceAll",()=>KR(e),[cn(e,"replace all")])],Yt("button",{name:"close",onclick:()=>sw(e),"aria-label":cn(e,"close"),type:"button"},["×"])])}commit(){let e=new ew({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:ca.of(e)}))}keydown(e){u3(this.view,e,"search-panel")?e.preventDefault():e.keyCode==13&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Mc:zc)(this.view)):e.keyCode==13&&e.target==this.replaceField&&(e.preventDefault(),b0(this.view))}update(e){for(let t of e.transactions)for(let i of t.effects)i.is(ca)&&!i.value.eq(this.query)&&this.setQuery(i.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(Fl).top}}function cn(n,e){return n.state.phrase(e)}const Gf=30,Hf=/[\s\.,:;?!]/;function Gd(n,{from:e,to:t}){let i=n.state.doc.lineAt(e),r=n.state.doc.lineAt(t).to,s=Math.max(i.from,e-Gf),l=Math.min(r,t+Gf),o=n.state.sliceDoc(s,l);if(s!=i.from){for(let a=0;ao.length-Gf;a--)if(!Hf.test(o[a-1])&&Hf.test(o[a])){o=o.slice(0,a);break}}return de.announce.of(`${n.state.phrase("current match")}. ${o} ${n.state.phrase("on line")} ${i.number}.`)}const tX=de.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"}}),iX=[bs,Js.low(FR),tX];class lw{constructor(e,t,i){this.state=e,this.pos=t,this.explicit=i,this.abortListeners=[]}tokenBefore(e){let t=ei(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),i=Math.max(t.from,this.pos-250),r=t.text.slice(i-t.from,this.pos-t.from),s=r.search(aw(e,!1));return s<0?null:{from:i+s,to:this.pos,text:r.slice(s)}}get aborted(){return this.abortListeners==null}addEventListener(e,t){e=="abort"&&this.abortListeners&&this.abortListeners.push(t)}}function $0(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 nX(n){let e=Object.create(null),t=Object.create(null);for(let{label:r}of n){e[r[0]]=!0;for(let s=1;stypeof r=="string"?{label:r}:r),[t,i]=e.every(r=>/^\w+$/.test(r.label))?[/\w*$/,/\w+$/]:nX(e);return r=>{let s=r.matchBefore(i);return s||r.explicit?{from:s?s.from:r.pos,options:e,validFor:t}:null}}function rX(n,e){return t=>{for(let i=ei(t.state).resolveInner(t.pos,-1);i;i=i.parent){if(n.indexOf(i.name)>-1)return null;if(i.type.isTop)break}return e(t)}}class y0{constructor(e,t,i,r){this.completion=e,this.source=t,this.match=i,this.score=r}}function $s(n){return n.selection.main.from}function aw(n,e){var t;let{source:i}=n,r=e&&i[0]!="^",s=i[i.length-1]!="$";return!r&&!s?n:new RegExp(`${r?"^":""}(?:${i})${s?"$":""}`,(t=n.flags)!==null&&t!==void 0?t:n.ignoreCase?"i":"")}const fw=Ir.define();function sX(n,e,t,i){let{main:r}=n.selection,s=t-r.from,l=i-r.from;return Object.assign(Object.assign({},n.changeByRange(o=>o!=r&&t!=i&&n.sliceDoc(o.from+s,o.from+l)!=n.sliceDoc(t,i)?{range:o}:{changes:{from:o.from+s,to:i==r.from?o.to:o.from+l,insert:e},range:ee.cursor(o.from+s+e.length)})),{scrollIntoView:!0,userEvent:"input.complete"})}const v0=new WeakMap;function lX(n){if(!Array.isArray(n))return n;let e=v0.get(n);return e||v0.set(n,e=ow(n)),e}const Hd=Ne.define(),ua=Ne.define();class oX{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=48&&C<=57||C>=97&&C<=122?2:C>=65&&C<=90?1:0:(z=Qd(C))!=z.toLowerCase()?1:z!=z.toUpperCase()?2:0;(!x||V==1&&y||A==0&&V!=0)&&(t[O]==C||i[O]==C&&(p=!0)?l[O++]=x:l.length&&(_=!1)),A=V,x+=Zn(C)}return O==a&&l[0]==0&&_?this.result(-100+(p?-200:0),l,e):g==a&&m==0?this.ret(-200-e.length+($==e.length?0:-100),[0,$]):o>-1?this.ret(-700-e.length,[o,o+this.pattern.length]):g==a?this.ret(-900-e.length,[m,$]):O==a?this.result(-100+(p?-200:0)+-700+(_?0:-1100),l,e):t.length==2?!1:this.result((r[0]?-700:0)+-200+-1100,r,e)}result(e,t,i){let r=[],s=0;for(let l of t){let o=l+(this.astral?Zn(Qi(i,l)):1);s&&r[s-1]==l?r[s-1]=o:(r[s++]=l,r[s++]=o)}return this.ret(e-i.length,r)}}const Ui=_e.define({combine(n){return br(n,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:aX,compareCompletions:(e,t)=>e.label.localeCompare(t.label),interactionDelay:75,updateSyncTime:100},{defaultKeymap:(e,t)=>e&&t,closeOnBlur:(e,t)=>e&&t,icons:(e,t)=>e&&t,tooltipClass:(e,t)=>i=>w0(e(i),t(i)),optionClass:(e,t)=>i=>w0(e(i),t(i)),addToOptions:(e,t)=>e.concat(t)})}});function w0(n,e){return n?e?n+" "+e:n:e}function aX(n,e,t,i,r,s){let l=n.textDirection==jt.RTL,o=l,a=!1,c="top",h,O,p=e.left-r.left,g=r.right-e.right,m=i.right-i.left,$=i.bottom-i.top;if(o&&p=$||x>e.top?h=t.bottom-e.top:(c="bottom",h=e.bottom-t.top)}let y=(e.bottom-e.top)/s.offsetHeight,_=(e.right-e.left)/s.offsetWidth;return{style:`${c}: ${h/y}px; max-width: ${O/_}px`,class:"cm-completionInfo-"+(a?l?"left-narrow":"right-narrow":o?"left":"right")}}function fX(n){let e=n.addToOptions.slice();return n.icons&&e.push({render(t){let i=document.createElement("div");return i.classList.add("cm-completionIcon"),t.type&&i.classList.add(...t.type.split(/\s+/g).map(r=>"cm-completionIcon-"+r)),i.setAttribute("aria-hidden","true"),i},position:20}),e.push({render(t,i,r,s){let l=document.createElement("span");l.className="cm-completionLabel";let o=t.displayLabel||t.label,a=0;for(let c=0;ca&&l.appendChild(document.createTextNode(o.slice(a,h)));let p=l.appendChild(document.createElement("span"));p.appendChild(document.createTextNode(o.slice(h,O))),p.className="cm-completionMatchedText",a=O}return at.position-i.position).map(t=>t.render)}function cO(n,e,t){if(n<=t)return{from:0,to:n};if(e<0&&(e=0),e<=n>>1){let r=Math.floor(e/t);return{from:r*t,to:(r+1)*t}}let i=Math.floor((n-e)/t);return{from:n-(i+1)*t,to:n-i*t}}class cX{constructor(e,t,i){this.view=e,this.stateField=t,this.applyCompletion=i,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:a=>this.placeInfo(a),key:this},this.space=null,this.currentClass="";let r=e.state.field(t),{options:s,selected:l}=r.open,o=e.state.facet(Ui);this.optionContent=fX(o),this.optionClass=o.optionClass,this.tooltipClass=o.tooltipClass,this.range=cO(s.length,l,o.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",a=>{let{options:c}=e.state.field(t).open;for(let h=a.target,O;h&&h!=this.dom;h=h.parentNode)if(h.nodeName=="LI"&&(O=/-(\d+)$/.exec(h.id))&&+O[1]{let c=e.state.field(this.stateField,!1);c&&c.tooltip&&e.state.facet(Ui).closeOnBlur&&a.relatedTarget!=e.contentDOM&&e.dispatch({effects:ua.of(null)})}),this.showOptions(s,r.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 i=e.state.field(this.stateField),r=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),i!=r){let{options:s,selected:l,disabled:o}=i.open;(!r.open||r.open.options!=s)&&(this.range=cO(s.length,l,e.state.facet(Ui).maxRenderedOptions),this.showOptions(s,i.id)),this.updateSel(),o!=((t=r.open)===null||t===void 0?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!o)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let i of this.currentClass.split(" "))i&&this.dom.classList.remove(i);for(let i of t.split(" "))i&&this.dom.classList.add(i);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;if((t.selected>-1&&t.selected=this.range.to)&&(this.range=cO(t.options.length,t.selected,this.view.state.facet(Ui).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:i}=t.options[t.selected],{info:r}=i;if(!r)return;let s=typeof r=="string"?document.createTextNode(r):r(i);if(!s)return;"then"in s?s.then(l=>{l&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(l,i)}).catch(l=>An(this.view.state,l,"completion info")):this.addInfoPane(s,i)}}addInfoPane(e,t){this.destroyInfo();let i=this.info=document.createElement("div");if(i.className="cm-tooltip cm-completionInfo",e.nodeType!=null)i.appendChild(e),this.infoDestroy=null;else{let{dom:r,destroy:s}=e;i.appendChild(r),this.infoDestroy=s||null}this.dom.appendChild(i),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let i=this.list.firstChild,r=this.range.from;i;i=i.nextSibling,r++)i.nodeName!="LI"||!i.id?r--:r==e?i.hasAttribute("aria-selected")||(i.setAttribute("aria-selected","true"),t=i):i.hasAttribute("aria-selected")&&i.removeAttribute("aria-selected");return t&&hX(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),i=this.info.getBoundingClientRect(),r=e.getBoundingClientRect(),s=this.space;if(!s){let l=this.dom.ownerDocument.defaultView||window;s={left:0,top:0,right:l.innerWidth,bottom:l.innerHeight}}return r.top>Math.min(s.bottom,t.bottom)-10||r.bottomi.from||i.from==0))if(s=p,typeof c!="string"&&c.header)r.appendChild(c.header(c));else{let g=r.appendChild(document.createElement("completion-section"));g.textContent=p}}const h=r.appendChild(document.createElement("li"));h.id=t+"-"+l,h.setAttribute("role","option");let O=this.optionClass(o);O&&(h.className=O);for(let p of this.optionContent){let g=p(o,this.view.state,this.view,a);g&&h.appendChild(g)}}return i.from&&r.classList.add("cm-completionListIncompleteTop"),i.tonew cX(t,n,e)}function hX(n,e){let t=n.getBoundingClientRect(),i=e.getBoundingClientRect(),r=t.height/n.offsetHeight;i.topt.bottom&&(n.scrollTop+=(i.bottom-t.bottom)/r)}function Q0(n){return(n.boost||0)*100+(n.apply?10:0)+(n.info?5:0)+(n.type?1:0)}function OX(n,e){let t=[],i=null,r=a=>{t.push(a);let{section:c}=a.completion;if(c){i||(i=[]);let h=typeof c=="string"?c:c.name;i.some(O=>O.name==h)||i.push(typeof c=="string"?{name:h}:c)}};for(let a of n)if(a.hasResult()){let c=a.result.getMatch;if(a.result.filter===!1)for(let h of a.result.options)r(new y0(h,a.source,c?c(h):[],1e9-t.length));else{let h=new oX(e.sliceDoc(a.from,a.to));for(let O of a.result.options)if(h.match(O.label)){let p=O.displayLabel?c?c(O,h.matched):[]:h.matched;r(new y0(O,a.source,p,h.score+(O.boost||0)))}}}if(i){let a=Object.create(null),c=0,h=(O,p)=>{var g,m;return((g=O.rank)!==null&&g!==void 0?g:1e9)-((m=p.rank)!==null&&m!==void 0?m:1e9)||(O.nameh.score-c.score||o(c.completion,h.completion))){let c=a.completion;!l||l.label!=c.label||l.detail!=c.detail||l.type!=null&&c.type!=null&&l.type!=c.type||l.apply!=c.apply||l.boost!=c.boost?s.push(a):Q0(a.completion)>Q0(l)&&(s[s.length-1]=a),l=a.completion}return s}class _l{constructor(e,t,i,r,s,l){this.options=e,this.attrs=t,this.tooltip=i,this.timestamp=r,this.selected=s,this.disabled=l}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new _l(this.options,_0(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,i,r,s){let l=OX(e,t);if(!l.length)return r&&e.some(a=>a.state==1)?new _l(r.options,r.attrs,r.tooltip,r.timestamp,r.selected,!0):null;let o=t.facet(Ui).selectOnOpen?0:-1;if(r&&r.selected!=o&&r.selected!=-1){let a=r.options[r.selected].completion;for(let c=0;cc.hasResult()?Math.min(a,c.from):a,1e8),create:SX,above:s.aboveCursor},r?r.timestamp:Date.now(),o,!1)}map(e){return new _l(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class Dc{constructor(e,t,i){this.active=e,this.id=t,this.open=i}static start(){return new Dc(gX,"cm-ac-"+Math.floor(Math.random()*2e6).toString(36),null)}update(e){let{state:t}=e,i=t.facet(Ui),s=(i.override||t.languageDataAt("autocomplete",$s(t)).map(lX)).map(o=>(this.active.find(c=>c.source==o)||new Ki(o,this.active.some(c=>c.state!=0)?1:0)).update(e,i));s.length==this.active.length&&s.every((o,a)=>o==this.active[a])&&(s=this.active);let l=this.open;l&&e.docChanged&&(l=l.map(e.changes)),e.selection||s.some(o=>o.hasResult()&&e.changes.touchesRange(o.from,o.to))||!dX(s,this.active)?l=_l.build(s,t,this.id,l,i):l&&l.disabled&&!s.some(o=>o.state==1)&&(l=null),!l&&s.every(o=>o.state!=1)&&s.some(o=>o.hasResult())&&(s=s.map(o=>o.hasResult()?new Ki(o.source,0):o));for(let o of e.effects)o.is(uw)&&(l=l&&l.setSelected(o.value,this.id));return s==this.active&&l==this.open?this:new Dc(s,this.id,l)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:pX}}function dX(n,e){if(n==e)return!0;for(let t=0,i=0;;){for(;t-1&&(t["aria-activedescendant"]=n+"-"+e),t}const gX=[];function md(n){return n.isUserEvent("input.type")?"input":n.isUserEvent("delete.backward")?"delete":null}class Ki{constructor(e,t,i=-1){this.source=e,this.state=t,this.explicitPos=i}hasResult(){return!1}update(e,t){let i=md(e),r=this;i?r=r.handleUserEvent(e,i,t):e.docChanged?r=r.handleChange(e):e.selection&&r.state!=0&&(r=new Ki(r.source,0));for(let s of e.effects)if(s.is(Hd))r=new Ki(r.source,1,s.value?$s(e.state):-1);else if(s.is(ua))r=new Ki(r.source,0);else if(s.is(cw))for(let l of s.value)l.source==r.source&&(r=l);return r}handleUserEvent(e,t,i){return t=="delete"||!i.activateOnTyping?this.map(e.changes):new Ki(this.source,1)}handleChange(e){return e.changes.touchesRange($s(e.startState))?new Ki(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Ki(this.source,this.state,e.mapPos(this.explicitPos))}}class Al extends Ki{constructor(e,t,i,r,s){super(e,2,t),this.result=i,this.from=r,this.to=s}hasResult(){return!0}handleUserEvent(e,t,i){var r;let s=e.changes.mapPos(this.from),l=e.changes.mapPos(this.to,1),o=$s(e.state);if((this.explicitPos<0?o<=s:ol||t=="delete"&&$s(e.startState)==this.from)return new Ki(this.source,t=="input"&&i.activateOnTyping?1:0);let a=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos),c;return mX(this.result.validFor,e.state,s,l)?new Al(this.source,a,this.result,s,l):this.result.update&&(c=this.result.update(this.result,s,l,new lw(e.state,o,a>=0)))?new Al(this.source,a,c,c.from,(r=c.to)!==null&&r!==void 0?r:$s(e.state)):new Ki(this.source,1,a)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Ki(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Al(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}function mX(n,e,t,i){if(!n)return!1;let r=e.sliceDoc(t,i);return typeof n=="function"?n(r,t,i,e):aw(n,!0).test(r)}const cw=Ne.define({map(n,e){return n.map(t=>t.map(e))}}),uw=Ne.define(),On=pi.define({create(){return Dc.start()},update(n,e){return n.update(e)},provide:n=>[Xd.from(n,e=>e.tooltip),de.contentAttributes.from(n,e=>e.attrs)]});function hw(n,e){const t=e.completion.apply||e.completion.label;let i=n.state.field(On).active.find(r=>r.source==e.source);return i instanceof Al?(typeof t=="string"?n.dispatch(Object.assign(Object.assign({},sX(n.state,t,i.from,i.to)),{annotations:fw.of(e.completion)})):t(n,e.completion,i.from,i.to),!0):!1}const SX=uX(On,hw);function Kf(n,e="option"){return t=>{let i=t.state.field(On,!1);if(!i||!i.open||i.open.disabled||Date.now()-i.open.timestamp-1?i.open.selected+r*(n?1:-1):n?0:l-1;return o<0?o=e=="page"?0:l-1:o>=l&&(o=e=="page"?l-1:0),t.dispatch({effects:uw.of(o)}),!0}}const bX=n=>{let e=n.state.field(On,!1);return n.state.readOnly||!e||!e.open||e.open.selected<0||e.open.disabled||Date.now()-e.open.timestampn.state.field(On,!1)?(n.dispatch({effects:Hd.of(!0)}),!0):!1,yX=n=>{let e=n.state.field(On,!1);return!e||!e.active.some(t=>t.state!=0)?!1:(n.dispatch({effects:ua.of(null)}),!0)};class vX{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const wX=50,QX=1e3,_X=li.fromClass(class{constructor(n){this.view=n,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let e of n.state.field(On).active)e.state==1&&this.startQuery(e)}update(n){let e=n.state.field(On);if(!n.selectionSet&&!n.docChanged&&n.startState.field(On)==e)return;let t=n.transactions.some(i=>(i.selection||i.docChanged)&&!md(i));for(let i=0;iwX&&Date.now()-r.time>QX){for(let s of r.context.abortListeners)try{s()}catch(l){An(this.view.state,l)}r.context.abortListeners=null,this.running.splice(i--,1)}else r.updates.push(...n.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=e.active.some(i=>i.state==1&&!this.running.some(r=>r.active.source==i.source))?setTimeout(()=>this.startUpdate(),50):-1,this.composing!=0)for(let i of n.transactions)md(i)=="input"?this.composing=2:this.composing==2&&i.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:n}=this.view,e=n.field(On);for(let t of e.active)t.state==1&&!this.running.some(i=>i.active.source==t.source)&&this.startQuery(t)}startQuery(n){let{state:e}=this.view,t=$s(e),i=new lw(e,t,n.explicitPos==t),r=new vX(n,i);this.running.push(r),Promise.resolve(n.source(i)).then(s=>{r.context.aborted||(r.done=s||null,this.scheduleAccept())},s=>{this.view.dispatch({effects:ua.of(null)}),An(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(Ui).updateSyncTime))}accept(){var n;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let e=[],t=this.view.state.facet(Ui);for(let i=0;il.source==r.active.source);if(s&&s.state==1)if(r.done==null){let l=new Ki(r.active.source,0);for(let o of r.updates)l=l.update(o,t);l.state!=1&&e.push(l)}else this.startQuery(s)}e.length&&this.view.dispatch({effects:cw.of(e)})}},{eventHandlers:{blur(n){let e=this.view.state.field(On,!1);if(e&&e.tooltip&&this.view.state.facet(Ui).closeOnBlur){let t=e.open&&Ty(this.view,e.open.tooltip);(!t||!t.dom.contains(n.relatedTarget))&&this.view.dispatch({effects:ua.of(null)})}},compositionstart(){this.composing=1},compositionend(){this.composing==3&&setTimeout(()=>this.view.dispatch({effects:Hd.of(!1)}),20),this.composing=0}}}),Ow=de.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"},".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 kX{constructor(e,t,i,r){this.field=e,this.line=t,this.from=i,this.to=r}}class Kd{constructor(e,t,i){this.field=e,this.from=t,this.to=i}map(e){let t=e.mapPos(this.from,-1,ki.TrackDel),i=e.mapPos(this.to,1,ki.TrackDel);return t==null||i==null?null:new Kd(this.field,t,i)}}class Jd{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let i=[],r=[t],s=e.doc.lineAt(t),l=/^\s*/.exec(s.text)[0];for(let a of this.lines){if(i.length){let c=l,h=/^\t*/.exec(a)[0].length;for(let O=0;Onew Kd(a.field,r[a.line]+a.from,r[a.line]+a.to));return{text:i,ranges:o}}static parse(e){let t=[],i=[],r=[],s;for(let l of e.split(/\r\n?|\n/)){for(;s=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(l);){let o=s[1]?+s[1]:null,a=s[2]||s[3]||"",c=-1;for(let h=0;h=c&&O.field++}r.push(new kX(c,i.length,s.index,s.index+a.length)),l=l.slice(0,s.index)+a+l.slice(s.index+s[0].length)}for(let o;o=/\\([{}])/.exec(l);){l=l.slice(0,o.index)+o[1]+l.slice(o.index+o[0].length);for(let a of r)a.line==i.length&&a.from>o.index&&(a.from--,a.to--)}i.push(l)}return new Jd(i,r)}}let PX=Ye.widget({widget:new class extends Lr{toDOM(){let n=document.createElement("span");return n.className="cm-snippetFieldPosition",n}ignoreEvent(){return!1}}}),WX=Ye.mark({class:"cm-snippetField"});class Gl{constructor(e,t){this.ranges=e,this.active=t,this.deco=Ye.set(e.map(i=>(i.from==i.to?PX:WX).range(i.from,i.to)))}map(e){let t=[];for(let i of this.ranges){let r=i.map(e);if(!r)return null;t.push(r)}return new Gl(t,this.active)}selectionInsideField(e){return e.ranges.every(t=>this.ranges.some(i=>i.field==this.active&&i.from<=t.from&&i.to>=t.to))}}const wa=Ne.define({map(n,e){return n&&n.map(e)}}),xX=Ne.define(),ha=pi.define({create(){return null},update(n,e){for(let t of e.effects){if(t.is(wa))return t.value;if(t.is(xX)&&n)return new Gl(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=>de.decorations.from(n,e=>e?e.deco:Ye.none)});function ep(n,e){return ee.create(n.filter(t=>t.field==e).map(t=>ee.range(t.from,t.to)))}function CX(n){let e=Jd.parse(n);return(t,i,r,s)=>{let{text:l,ranges:o}=e.instantiate(t.state,r),a={changes:{from:r,to:s,insert:mt.of(l)},scrollIntoView:!0,annotations:i?fw.of(i):void 0};if(o.length&&(a.selection=ep(o,0)),o.length>1){let c=new Gl(o,0),h=a.effects=[wa.of(c)];t.state.field(ha,!1)===void 0&&h.push(Ne.appendConfig.of([ha,AX,YX,Ow]))}t.dispatch(t.state.update(a))}}function dw(n){return({state:e,dispatch:t})=>{let i=e.field(ha,!1);if(!i||n<0&&i.active==0)return!1;let r=i.active+n,s=n>0&&!i.ranges.some(l=>l.field==r+n);return t(e.update({selection:ep(i.ranges,r),effects:wa.of(s?null:new Gl(i.ranges,r)),scrollIntoView:!0})),!0}}const TX=({state:n,dispatch:e})=>n.field(ha,!1)?(e(n.update({effects:wa.of(null)})),!0):!1,ZX=dw(1),RX=dw(-1),XX=[{key:"Tab",run:ZX,shift:RX},{key:"Escape",run:TX}],k0=_e.define({combine(n){return n.length?n[0]:XX}}),AX=Js.highest(ga.compute([k0],n=>n.facet(k0)));function Hi(n,e){return Object.assign(Object.assign({},e),{apply:CX(n)})}const YX=de.domEventHandlers({mousedown(n,e){let t=e.state.field(ha,!1),i;if(!t||(i=e.posAtCoords({x:n.clientX,y:n.clientY}))==null)return!1;let r=t.ranges.find(s=>s.from<=i&&s.to>=i);return!r||r.field==t.active?!1:(e.dispatch({selection:ep(t.ranges,r.field),effects:wa.of(t.ranges.some(s=>s.field>r.field)?new Gl(t.ranges,r.field):null),scrollIntoView:!0}),!0)}}),Oa={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},Bs=Ne.define({map(n,e){let t=e.mapPos(n,-1,ki.TrackAfter);return t??void 0}}),tp=new class extends Gs{};tp.startSide=1;tp.endSide=-1;const pw=pi.define({create(){return vt.empty},update(n,e){if(e.selection){let t=e.state.doc.lineAt(e.selection.main.head);n=n.update({filter:i=>i>=t.from&&i<=t.to})}n=n.map(e.changes);for(let t of e.effects)t.is(Bs)&&(n=n.update({add:[tp.range(t.value,t.value+1)]}));return n}});function UX(){return[zX,pw]}const uO="()[]{}<>";function gw(n){for(let e=0;e{if((EX?n.composing:n.compositionStarted)||n.state.readOnly)return!1;let r=n.state.selection.main;if(i.length>2||i.length==2&&Zn(Qi(i,0))==1||e!=r.from||t!=r.to)return!1;let s=VX(n.state,i);return s?(n.dispatch(s),!0):!1}),MX=({state:n,dispatch:e})=>{if(n.readOnly)return!1;let i=mw(n,n.selection.main.head).brackets||Oa.brackets,r=null,s=n.changeByRange(l=>{if(l.empty){let o=qX(n.doc,l.head);for(let a of i)if(a==o&&ou(n.doc,l.head)==gw(Qi(a,0)))return{changes:{from:l.head-a.length,to:l.head+a.length},range:ee.cursor(l.head-a.length)}}return{range:r=l}});return r||e(n.update(s,{scrollIntoView:!0,userEvent:"delete.backward"})),!r},DX=[{key:"Backspace",run:MX}];function VX(n,e){let t=mw(n,n.selection.main.head),i=t.brackets||Oa.brackets;for(let r of i){let s=gw(Qi(r,0));if(e==r)return s==r?NX(n,r,i.indexOf(r+r+r)>-1,t):IX(n,r,s,t.before||Oa.before);if(e==s&&Sw(n,n.selection.main.from))return LX(n,r,s)}return null}function Sw(n,e){let t=!1;return n.field(pw).between(0,n.doc.length,i=>{i==e&&(t=!0)}),t}function ou(n,e){let t=n.sliceString(e,e+2);return t.slice(0,Zn(Qi(t,0)))}function qX(n,e){let t=n.sliceString(e-2,e);return Zn(Qi(t,0))==t.length?t:t.slice(1)}function IX(n,e,t,i){let r=null,s=n.changeByRange(l=>{if(!l.empty)return{changes:[{insert:e,from:l.from},{insert:t,from:l.to}],effects:Bs.of(l.to+e.length),range:ee.range(l.anchor+e.length,l.head+e.length)};let o=ou(n.doc,l.head);return!o||/\s/.test(o)||i.indexOf(o)>-1?{changes:{insert:e+t,from:l.head},effects:Bs.of(l.head+e.length),range:ee.cursor(l.head+e.length)}:{range:r=l}});return r?null:n.update(s,{scrollIntoView:!0,userEvent:"input.type"})}function LX(n,e,t){let i=null,r=n.changeByRange(s=>s.empty&&ou(n.doc,s.head)==t?{changes:{from:s.head,to:s.head+t.length,insert:t},range:ee.cursor(s.head+t.length)}:i={range:s});return i?null:n.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function NX(n,e,t,i){let r=i.stringPrefixes||Oa.stringPrefixes,s=null,l=n.changeByRange(o=>{if(!o.empty)return{changes:[{insert:e,from:o.from},{insert:e,from:o.to}],effects:Bs.of(o.to+e.length),range:ee.range(o.anchor+e.length,o.head+e.length)};let a=o.head,c=ou(n.doc,a),h;if(c==e){if(P0(n,a))return{changes:{insert:e+e,from:a},effects:Bs.of(a+e.length),range:ee.cursor(a+e.length)};if(Sw(n,a)){let p=t&&n.sliceDoc(a,a+e.length*3)==e+e+e?e+e+e:e;return{changes:{from:a,to:a+p.length,insert:p},range:ee.cursor(a+p.length)}}}else{if(t&&n.sliceDoc(a-2*e.length,a)==e+e&&(h=W0(n,a-2*e.length,r))>-1&&P0(n,h))return{changes:{insert:e+e+e+e,from:a},effects:Bs.of(a+e.length),range:ee.cursor(a+e.length)};if(n.charCategorizer(a)(c)!=Lt.Word&&W0(n,a,r)>-1&&!jX(n,a,e,r))return{changes:{insert:e+e,from:a},effects:Bs.of(a+e.length),range:ee.cursor(a+e.length)}}return{range:s=o}});return s?null:n.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function P0(n,e){let t=ei(n).resolveInner(e+1);return t.parent&&t.from==e}function jX(n,e,t,i){let r=ei(n).resolveInner(e,-1),s=i.reduce((l,o)=>Math.max(l,o.length),0);for(let l=0;l<5;l++){let o=n.sliceDoc(r.from,Math.min(r.to,r.from+t.length+s)),a=o.indexOf(t);if(!a||a>-1&&i.indexOf(o.slice(0,a))>-1){let h=r.firstChild;for(;h&&h.from==r.from&&h.to-h.from>t.length+a;){if(n.sliceDoc(h.to-t.length,h.to)==t)return!1;h=h.firstChild}return!0}let c=r.to==e&&r.parent;if(!c)break;r=c}return!1}function W0(n,e,t){let i=n.charCategorizer(e);if(i(n.sliceDoc(e-1,e))!=Lt.Word)return e;for(let r of t){let s=e-r.length;if(n.sliceDoc(s,e)==r&&i(n.sliceDoc(s-1,s))!=Lt.Word)return s}return-1}function BX(n={}){return[On,Ui.of(n),_X,FX,Ow]}const bw=[{key:"Ctrl-Space",run:$X},{key:"Escape",run:yX},{key:"ArrowDown",run:Kf(!0)},{key:"ArrowUp",run:Kf(!1)},{key:"PageDown",run:Kf(!0,"page")},{key:"PageUp",run:Kf(!1,"page")},{key:"Enter",run:bX}],FX=Js.highest(ga.computeN([Ui],n=>n.facet(Ui).defaultKeymap?[bw]:[]));class GX{constructor(e,t,i){this.from=e,this.to=t,this.diagnostic=i}}class Is{constructor(e,t,i){this.diagnostics=e,this.panel=t,this.selected=i}static init(e,t,i){let r=e,s=i.facet(vw).markerFilter;s&&(r=s(r));let l=Ye.set(r.map(o=>o.from==o.to||o.from==o.to-1&&i.doc.lineAt(o.from).to==o.from?Ye.widget({widget:new sA(o),diagnostic:o}).range(o.from):Ye.mark({attributes:{class:"cm-lintRange cm-lintRange-"+o.severity+(o.markClass?" "+o.markClass:"")},diagnostic:o}).range(o.from,o.to)),!0);return new Is(l,t,Ml(l))}}function Ml(n,e=null,t=0){let i=null;return n.between(t,1e9,(r,s,{spec:l})=>{if(!(e&&l.diagnostic!=e))return i=new GX(r,s,l.diagnostic),!1}),i}function HX(n,e){let t=n.startState.doc.lineAt(e.pos);return!!(n.effects.some(i=>i.is($w))||n.changes.touchesRange(t.from,t.to))}function KX(n,e){return n.field(pn,!1)?e:e.concat(Ne.appendConfig.of(aA))}const $w=Ne.define(),ip=Ne.define(),yw=Ne.define(),pn=pi.define({create(){return new Is(Ye.none,null,null)},update(n,e){if(e.docChanged){let t=n.diagnostics.map(e.changes),i=null;if(n.selected){let r=e.changes.mapPos(n.selected.from,1);i=Ml(t,n.selected.diagnostic,r)||Ml(t,null,r)}n=new Is(t,n.panel,i)}for(let t of e.effects)t.is($w)?n=Is.init(t.value,n.panel,e.state):t.is(ip)?n=new Is(n.diagnostics,t.value?au.open:null,n.selected):t.is(yw)&&(n=new Is(n.diagnostics,n.panel,t.value));return n},provide:n=>[sa.from(n,e=>e.panel),de.decorations.from(n,e=>e.diagnostics)]}),JX=Ye.mark({class:"cm-lintRange cm-lintRange-active"});function eA(n,e,t){let{diagnostics:i}=n.state.field(pn),r=[],s=2e8,l=0;i.between(e-(t<0?1:0),e+(t>0?1:0),(a,c,{spec:h})=>{e>=a&&e<=c&&(a==c||(e>a||t>0)&&(eQw(n,t,!1)))}const iA=n=>{let e=n.state.field(pn,!1);(!e||!e.panel)&&n.dispatch({effects:KX(n.state,[ip.of(!0)])});let t=ra(n,au.open);return t&&t.dom.querySelector(".cm-panel-lint ul").focus(),!0},x0=n=>{let e=n.state.field(pn,!1);return!e||!e.panel?!1:(n.dispatch({effects:ip.of(!1)}),!0)},nA=n=>{let e=n.state.field(pn,!1);if(!e)return!1;let t=n.state.selection.main,i=e.diagnostics.iter(t.to+1);return!i.value&&(i=e.diagnostics.iter(0),!i.value||i.from==t.from&&i.to==t.to)?!1:(n.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0}),!0)},rA=[{key:"Mod-Shift-m",run:iA,preventDefault:!0},{key:"F8",run:nA}],vw=_e.define({combine(n){return Object.assign({sources:n.map(e=>e.source)},br(n.map(e=>e.config),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?i=>e(i)||t(i):e:t}))}});function ww(n){let e=[];if(n)e:for(let{name:t}of n){for(let i=0;is.toLowerCase()==r.toLowerCase())){e.push(r);continue e}}e.push("")}return e}function Qw(n,e,t){var i;let r=t?ww(e.actions):[];return Yt("li",{class:"cm-diagnostic cm-diagnostic-"+e.severity},Yt("span",{class:"cm-diagnosticText"},e.renderMessage?e.renderMessage():e.message),(i=e.actions)===null||i===void 0?void 0:i.map((s,l)=>{let o=!1,a=p=>{if(p.preventDefault(),o)return;o=!0;let g=Ml(n.state.field(pn).diagnostics,e);g&&s.apply(n,g.from,g.to)},{name:c}=s,h=r[l]?c.indexOf(r[l]):-1,O=h<0?c:[c.slice(0,h),Yt("u",c.slice(h,h+1)),c.slice(h+1)];return Yt("button",{type:"button",class:"cm-diagnosticAction",onclick:a,onmousedown:a,"aria-label":` Action: ${c}${h<0?"":` (access key "${r[l]})"`}.`},O)}),e.source&&Yt("div",{class:"cm-diagnosticSource"},e.source))}class sA extends Lr{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return Yt("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class C0{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(Math.random()*4294967295).toString(16),this.dom=Qw(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class au{constructor(e){this.view=e,this.items=[];let t=r=>{if(r.keyCode==27)x0(this.view),this.view.focus();else if(r.keyCode==38||r.keyCode==33)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(r.keyCode==40||r.keyCode==34)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(r.keyCode==36)this.moveSelection(0);else if(r.keyCode==35)this.moveSelection(this.items.length-1);else if(r.keyCode==13)this.view.focus();else if(r.keyCode>=65&&r.keyCode<=90&&this.selectedIndex>=0){let{diagnostic:s}=this.items[this.selectedIndex],l=ww(s.actions);for(let o=0;o{for(let s=0;sx0(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(pn).selected;if(!e)return-1;for(let t=0;t{let c=-1,h;for(let O=i;Oi&&(this.items.splice(i,c-i),r=!0)),t&&h.diagnostic==t.diagnostic?h.dom.hasAttribute("aria-selected")||(h.dom.setAttribute("aria-selected","true"),s=h):h.dom.hasAttribute("aria-selected")&&h.dom.removeAttribute("aria-selected"),i++});i({sel:s.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:l,panel:o})=>{let a=o.height/this.list.offsetHeight;l.topo.bottom&&(this.list.scrollTop+=(l.bottom-o.bottom)/a)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),r&&this.sync()}sync(){let e=this.list.firstChild;function t(){let i=e;e=i.nextSibling,i.remove()}for(let i of this.items)if(i.dom.parentNode==this.list){for(;e!=i.dom;)t();e=i.dom.nextSibling}else this.list.insertBefore(i.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=this.view.state.field(pn),i=Ml(t.diagnostics,this.items[e].diagnostic);i&&this.view.dispatch({selection:{anchor:i.from,head:i.to},scrollIntoView:!0,effects:yw.of(i)})}static open(e){return new au(e)}}function lA(n,e='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(n)}')`}function Jf(n){return lA(``,'width="6" height="3"')}const oA=de.baseTheme({".cm-diagnostic":{padding:"3px 6px 3px 8px",marginLeft:"-1px",display:"block",whiteSpace:"pre-wrap"},".cm-diagnostic-error":{borderLeft:"5px solid #d11"},".cm-diagnostic-warning":{borderLeft:"5px solid orange"},".cm-diagnostic-info":{borderLeft:"5px solid #999"},".cm-diagnostic-hint":{borderLeft:"5px solid #66d"},".cm-diagnosticAction":{font:"inherit",border:"none",padding:"2px 4px",backgroundColor:"#444",color:"white",borderRadius:"3px",marginLeft:"8px",cursor:"pointer"},".cm-diagnosticSource":{fontSize:"70%",opacity:.7},".cm-lintRange":{backgroundPosition:"left bottom",backgroundRepeat:"repeat-x",paddingBottom:"0.7px"},".cm-lintRange-error":{backgroundImage:Jf("#d11")},".cm-lintRange-warning":{backgroundImage:Jf("orange")},".cm-lintRange-info":{backgroundImage:Jf("#999")},".cm-lintRange-hint":{backgroundImage:Jf("#66d")},".cm-lintRange-active":{backgroundColor:"#ffdd9980"},".cm-tooltip-lint":{padding:0,margin:0},".cm-lintPoint":{position:"relative","&:after":{content:'""',position:"absolute",bottom:0,left:"-2px",borderLeft:"3px solid transparent",borderRight:"3px solid transparent",borderBottom:"4px solid #d11"}},".cm-lintPoint-warning":{"&:after":{borderBottomColor:"orange"}},".cm-lintPoint-info":{"&:after":{borderBottomColor:"#999"}},".cm-lintPoint-hint":{"&:after":{borderBottomColor:"#66d"}},".cm-panel.cm-panel-lint":{position:"relative","& ul":{maxHeight:"100px",overflowY:"auto","& [aria-selected]":{backgroundColor:"#ddd","& u":{textDecoration:"underline"}},"&:focus [aria-selected]":{background_fallback:"#bdf",backgroundColor:"Highlight",color_fallback:"white",color:"HighlightText"},"& u":{textDecoration:"none"},padding:0,margin:0},"& [name=close]":{position:"absolute",top:"0",right:"2px",background:"inherit",border:"none",font:"inherit",padding:0,margin:0}}}),aA=[pn,de.decorations.compute([pn],n=>{let{selected:e,panel:t}=n.field(pn);return!e||!t||e.from==e.to?Ye.none:Ye.set([JX.range(e.from,e.to)])}),G3(eA,{hideOn:HX}),oA],fA=[sC(),aC(),W3(),PZ(),eZ(),m3(),v3(),Ot.allowMultipleSelections.of(!0),DT(),Ov(rZ,{fallback:!0}),uZ(),UX(),BX(),M3(),q3(),X3(),XR(),ga.of([...DX,...PR,...JR,...YZ,...GT,...bw,...rA])],yi=({variant:n,settings:e,styles:t})=>{const i=de.theme({"&":{backgroundColor:e.background,color:e.foreground},".cm-content":{caretColor:e.caret},".cm-cursor, .cm-dropCursor":{borderLeftColor:e.caret},"&.cm-focused .cm-selectionBackgroundm .cm-selectionBackground, .cm-content ::selection":{backgroundColor:e.selection},".cm-activeLine":{backgroundColor:e.lineHighlight},".cm-gutters":{backgroundColor:e.gutterBackground,color:e.gutterForeground},".cm-activeLineGutter":{backgroundColor:e.lineHighlight}},{dark:n==="dark"}),r=$a.define(t);return[i,Ov(r)]};yi({variant:"dark",settings:{background:"#200020",foreground:"#D0D0FF",caret:"#7070FF",selection:"#80000080",gutterBackground:"#200020",gutterForeground:"#C080C0",lineHighlight:"#80000040"},styles:[{tag:b.comment,color:"#404080"},{tag:[b.string,b.regexp],color:"#999999"},{tag:b.number,color:"#7090B0"},{tag:[b.bool,b.null],color:"#8080A0"},{tag:[b.punctuation,b.derefOperator],color:"#805080"},{tag:b.keyword,color:"#60B0FF"},{tag:b.definitionKeyword,color:"#B0FFF0"},{tag:b.moduleKeyword,color:"#60B0FF"},{tag:b.operator,color:"#A0A0FF"},{tag:[b.variableName,b.self],color:"#008080"},{tag:b.operatorKeyword,color:"#A0A0FF"},{tag:b.controlKeyword,color:"#80A0FF"},{tag:b.className,color:"#70E080"},{tag:[b.function(b.propertyName),b.propertyName],color:"#50A0A0"},{tag:b.tagName,color:"#009090"},{tag:b.modifier,color:"#B0FFF0"},{tag:[b.squareBracket,b.attributeName],color:"#D0D0FF"}]});yi({variant:"light",settings:{background:"#fcfcfc",foreground:"#5c6166",caret:"#ffaa33",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#8a919966",lineHighlight:"#8a91991a"},styles:[{tag:b.comment,color:"#787b8099"},{tag:b.string,color:"#86b300"},{tag:b.regexp,color:"#4cbf99"},{tag:[b.number,b.bool,b.null],color:"#ffaa33"},{tag:b.variableName,color:"#5c6166"},{tag:[b.definitionKeyword,b.modifier],color:"#fa8d3e"},{tag:[b.keyword,b.special(b.brace)],color:"#fa8d3e"},{tag:b.operator,color:"#ed9366"},{tag:b.separator,color:"#5c6166b3"},{tag:b.punctuation,color:"#5c6166"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#f2ae49"},{tag:[b.className,b.definition(b.typeName)],color:"#22a4e6"},{tag:[b.tagName,b.typeName,b.self,b.labelName],color:"#55b4d4"},{tag:b.angleBracket,color:"#55b4d480"},{tag:b.attributeName,color:"#f2ae49"}]});yi({variant:"dark",settings:{background:"#15191EFA",foreground:"#EEF2F7",caret:"#C4C4C4",selection:"#90B2D557",gutterBackground:"#15191EFA",gutterForeground:"#aaaaaa95",lineHighlight:"#57575712"},styles:[{tag:b.comment,color:"#6E6E6E"},{tag:[b.string,b.regexp,b.special(b.brace)],color:"#5C81B3"},{tag:b.number,color:"#C1E1B8"},{tag:b.bool,color:"#53667D"},{tag:[b.definitionKeyword,b.modifier,b.function(b.propertyName)],color:"#A3D295",fontWeight:"bold"},{tag:[b.keyword,b.moduleKeyword,b.operatorKeyword,b.operator],color:"#697A8E",fontWeight:"bold"},{tag:[b.variableName,b.attributeName],color:"#708E67"},{tag:[b.function(b.variableName),b.definition(b.propertyName),b.derefOperator],color:"#fff"},{tag:b.tagName,color:"#A3D295"}]});yi({variant:"dark",settings:{background:"#2e241d",foreground:"#BAAE9E",caret:"#A7A7A7",selection:"#DDF0FF33",gutterBackground:"#28211C",gutterForeground:"#BAAE9E90",lineHighlight:"#FFFFFF08"},styles:[{tag:b.comment,color:"#666666"},{tag:[b.string,b.special(b.brace)],color:"#54BE0D"},{tag:b.regexp,color:"#E9C062"},{tag:b.number,color:"#CF6A4C"},{tag:[b.keyword,b.operator],color:"#5EA6EA"},{tag:b.variableName,color:"#7587A6"},{tag:[b.definitionKeyword,b.modifier],color:"#F9EE98"},{tag:[b.propertyName,b.function(b.variableName)],color:"#937121"},{tag:[b.typeName,b.angleBracket,b.tagName],color:"#9B859D"}]});yi({variant:"dark",settings:{background:"#3b2627",foreground:"#E6E1C4",caret:"#E6E1C4",selection:"#16120E",gutterBackground:"#3b2627",gutterForeground:"#E6E1C490",lineHighlight:"#1F1611"},styles:[{tag:b.comment,color:"#6B4E32"},{tag:[b.keyword,b.operator,b.derefOperator],color:"#EF5D32"},{tag:b.className,color:"#EFAC32",fontWeight:"bold"},{tag:[b.typeName,b.propertyName,b.function(b.variableName),b.definition(b.variableName)],color:"#EFAC32"},{tag:b.definition(b.typeName),color:"#EFAC32",fontWeight:"bold"},{tag:b.labelName,color:"#EFAC32",fontWeight:"bold"},{tag:[b.number,b.bool],color:"#6C99BB"},{tag:[b.variableName,b.self],color:"#7DAF9C"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#D9D762"},{tag:[b.angleBracket,b.tagName,b.attributeName],color:"#EFCB43"}]});yi({variant:"dark",settings:{background:"#000205",foreground:"#FFFFFF",caret:"#E60065",selection:"#E60C6559",gutterBackground:"#000205",gutterForeground:"#ffffff90",lineHighlight:"#4DD7FC1A"},styles:[{tag:b.comment,color:"#404040"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#00D8FF"},{tag:b.number,color:"#E62286"},{tag:[b.variableName,b.attributeName,b.self],color:"#E62286",fontWeight:"bold"},{tag:b.function(b.variableName),color:"#fff",fontWeight:"bold"}]});yi({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#BDD5FC",gutterBackground:"#fff",gutterForeground:"#00000070",lineHighlight:"#FFFBD1"},styles:[{tag:b.comment,color:"#BCC8BA"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#5D90CD"},{tag:[b.number,b.bool,b.null],color:"#46A609"},{tag:b.keyword,color:"#AF956F"},{tag:[b.definitionKeyword,b.modifier],color:"#C52727"},{tag:[b.angleBracket,b.tagName,b.attributeName],color:"#606060"},{tag:b.self,color:"#000"}]});yi({variant:"dark",settings:{background:"#00254b",foreground:"#FFFFFF",caret:"#FFFFFF",selection:"#B36539BF",gutterBackground:"#00254b",gutterForeground:"#FFFFFF70",lineHighlight:"#00000059"},styles:[{tag:b.comment,color:"#0088FF"},{tag:b.string,color:"#3AD900"},{tag:b.regexp,color:"#80FFC2"},{tag:[b.number,b.bool,b.null],color:"#FF628C"},{tag:[b.definitionKeyword,b.modifier],color:"#FFEE80"},{tag:b.variableName,color:"#CCCCCC"},{tag:b.self,color:"#FF80E1"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.definition(b.typeName),b.labelName],color:"#FFDD00"},{tag:[b.keyword,b.operator],color:"#FF9D00"},{tag:[b.propertyName,b.typeName],color:"#80FFBB"},{tag:b.special(b.brace),color:"#EDEF7D"},{tag:b.attributeName,color:"#9EFFFF"},{tag:b.derefOperator,color:"#fff"}]});yi({variant:"dark",settings:{background:"#060521",foreground:"#E0E0E0",caret:"#FFFFFFA6",selection:"#122BBB",gutterBackground:"#060521",gutterForeground:"#E0E0E090",lineHighlight:"#FFFFFF0F"},styles:[{tag:b.comment,color:"#AEAEAE"},{tag:[b.string,b.special(b.brace),b.regexp],color:"#8DFF8E"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.function(b.definition(b.variableName)),b.definition(b.typeName)],color:"#A3EBFF"},{tag:[b.number,b.bool,b.null],color:"#62E9BD"},{tag:[b.keyword,b.operator],color:"#2BF1DC"},{tag:[b.definitionKeyword,b.modifier],color:"#F8FBB1"},{tag:[b.variableName,b.self],color:"#B683CA"},{tag:[b.angleBracket,b.tagName,b.typeName,b.propertyName],color:"#60A4F1"},{tag:b.derefOperator,color:"#E0E0E0"},{tag:b.attributeName,color:"#7BACCA"}]});yi({variant:"dark",settings:{background:"#2d2f3f",foreground:"#f8f8f2",caret:"#f8f8f0",selection:"#44475a",gutterBackground:"#282a36",gutterForeground:"rgb(144, 145, 148)",lineHighlight:"#44475a"},styles:[{tag:b.comment,color:"#6272a4"},{tag:[b.string,b.special(b.brace)],color:"#f1fa8c"},{tag:[b.number,b.self,b.bool,b.null],color:"#bd93f9"},{tag:[b.keyword,b.operator],color:"#ff79c6"},{tag:[b.definitionKeyword,b.typeName],color:"#8be9fd"},{tag:b.definition(b.typeName),color:"#f8f8f2"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.attributeName],color:"#50fa7b"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#80C7FF",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#C1E2F8"},styles:[{tag:b.comment,color:"#AAAAAA"},{tag:[b.keyword,b.operator,b.typeName,b.tagName,b.propertyName],color:"#2F6F9F",fontWeight:"bold"},{tag:[b.attributeName,b.definition(b.propertyName)],color:"#4F9FD0"},{tag:[b.className,b.string,b.special(b.brace)],color:"#CF4F5F"},{tag:b.number,color:"#CF4F5F",fontWeight:"bold"},{tag:b.variableName,fontWeight:"bold"}]});yi({variant:"light",settings:{background:"#f2f1f8",foreground:"#0c006b",caret:"#5c49e9",selection:"#d5d1f2",gutterBackground:"#f2f1f8",gutterForeground:"#0c006b70",lineHighlight:"#e1def3"},styles:[{tag:b.comment,color:"#9995b7"},{tag:b.keyword,color:"#ff5792",fontWeight:"bold"},{tag:[b.definitionKeyword,b.modifier],color:"#ff5792"},{tag:[b.className,b.tagName,b.definition(b.typeName)],color:"#0094f0"},{tag:[b.number,b.bool,b.null,b.special(b.brace)],color:"#5842ff"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#0095a8"},{tag:b.typeName,color:"#b3694d"},{tag:[b.propertyName,b.variableName],color:"#fa8900"},{tag:b.operator,color:"#ff5792"},{tag:b.self,color:"#e64100"},{tag:[b.string,b.regexp],color:"#00b368"},{tag:[b.paren,b.bracket],color:"#0431fa"},{tag:b.labelName,color:"#00bdd6"},{tag:b.attributeName,color:"#e64100"},{tag:b.angleBracket,color:"#9995b7"}]});yi({variant:"light",settings:{background:"#faf4ed",foreground:"#575279",caret:"#575279",selection:"#6e6a8614",gutterBackground:"#faf4ed",gutterForeground:"#57527970",lineHighlight:"#6e6a860d"},styles:[{tag:b.comment,color:"#9893a5"},{tag:[b.bool,b.null],color:"#286983"},{tag:b.number,color:"#d7827e"},{tag:b.className,color:"#d7827e"},{tag:[b.angleBracket,b.tagName,b.typeName],color:"#56949f"},{tag:b.attributeName,color:"#907aa9"},{tag:b.punctuation,color:"#797593"},{tag:[b.keyword,b.modifier],color:"#286983"},{tag:[b.string,b.regexp],color:"#ea9d34"},{tag:b.variableName,color:"#d7827e"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#000000",caret:"#000000",selection:"#FFFD0054",gutterBackground:"#FFFFFF",gutterForeground:"#00000070",lineHighlight:"#00000008"},styles:[{tag:b.comment,color:"#CFCFCF"},{tag:[b.number,b.bool,b.null],color:"#E66C29"},{tag:[b.className,b.definition(b.propertyName),b.function(b.variableName),b.labelName,b.definition(b.typeName)],color:"#2EB43B"},{tag:b.keyword,color:"#D8B229"},{tag:b.operator,color:"#4EA44E",fontWeight:"bold"},{tag:[b.definitionKeyword,b.modifier],color:"#925A47"},{tag:b.string,color:"#704D3D"},{tag:b.typeName,color:"#2F8996"},{tag:[b.variableName,b.propertyName],color:"#77ACB0"},{tag:b.self,color:"#77ACB0",fontWeight:"bold"},{tag:b.regexp,color:"#E3965E"},{tag:[b.tagName,b.angleBracket],color:"#BAA827"},{tag:b.attributeName,color:"#B06520"},{tag:b.derefOperator,color:"#000"}]});yi({variant:"light",settings:{background:"#fef7e5",foreground:"#586E75",caret:"#000000",selection:"#073642",gutterBackground:"#fef7e5",gutterForeground:"#586E7580",lineHighlight:"#EEE8D5"},styles:[{tag:b.comment,color:"#93A1A1"},{tag:b.string,color:"#2AA198"},{tag:b.regexp,color:"#D30102"},{tag:b.number,color:"#D33682"},{tag:b.variableName,color:"#268BD2"},{tag:[b.keyword,b.operator,b.punctuation],color:"#859900"},{tag:[b.definitionKeyword,b.modifier],color:"#073642",fontWeight:"bold"},{tag:[b.className,b.self,b.definition(b.propertyName)],color:"#268BD2"},{tag:b.function(b.variableName),color:"#268BD2"},{tag:[b.bool,b.null],color:"#B58900"},{tag:b.tagName,color:"#268BD2",fontWeight:"bold"},{tag:b.angleBracket,color:"#93A1A1"},{tag:b.attributeName,color:"#93A1A1"},{tag:b.typeName,color:"#859900"}]});yi({variant:"light",settings:{background:"#FFFFFF",foreground:"#4D4D4C",caret:"#AEAFAD",selection:"#D6D6D6",gutterBackground:"#FFFFFF",gutterForeground:"#4D4D4C80",lineHighlight:"#EFEFEF"},styles:[{tag:b.comment,color:"#8E908C"},{tag:[b.variableName,b.self,b.propertyName,b.attributeName,b.regexp],color:"#C82829"},{tag:[b.number,b.bool,b.null],color:"#F5871F"},{tag:[b.className,b.typeName,b.definition(b.typeName)],color:"#C99E00"},{tag:[b.string,b.special(b.brace)],color:"#718C00"},{tag:b.operator,color:"#3E999F"},{tag:[b.definition(b.propertyName),b.function(b.variableName)],color:"#4271AE"},{tag:b.keyword,color:"#8959A8"},{tag:b.derefOperator,color:"#4D4D4C"}]});const cA=Ll({String:b.string,Number:b.number,"True False":b.bool,PropertyName:b.propertyName,Null:b.null,",":b.separator,"[ ]":b.squareBracket,"{ }":b.brace}),uA=Ps.deserialize({version:14,states:"$bOVQPOOOOQO'#Cb'#CbOnQPO'#CeOvQPO'#CjOOQO'#Cp'#CpQOQPOOOOQO'#Cg'#CgO}QPO'#CfO!SQPO'#CrOOQO,59P,59PO![QPO,59PO!aQPO'#CuOOQO,59U,59UO!iQPO,59UOVQPO,59QOqQPO'#CkO!nQPO,59^OOQO1G.k1G.kOVQPO'#ClO!vQPO,59aOOQO1G.p1G.pOOQO1G.l1G.lOOQO,59V,59VOOQO-E6i-E6iOOQO,59W,59WOOQO-E6j-E6j",stateData:"#O~OcOS~OQSORSOSSOTSOWQO]ROePO~OVXOeUO~O[[O~PVOg^O~Oh_OVfX~OVaO~OhbO[iX~O[dO~Oh_OVfa~OhbO[ia~O",goto:"!kjPPPPPPkPPkqwPPk{!RPPP!XP!ePP!hXSOR^bQWQRf_TVQ_Q`WRg`QcZRicQTOQZRQe^RhbRYQR]R",nodeNames:"⚠ JsonText True False Null Number String } { Object Property PropertyName ] [ Array",maxTerm:25,nodeProps:[["openedBy",7,"{",12,"["],["closedBy",8,"}",13,"]"]],propSources:[cA],skippedNodes:[0],repeatNodeCount:2,tokenData:"(|~RaXY!WYZ!W]^!Wpq!Wrs!]|}$u}!O$z!Q!R%T!R![&c![!]&t!}#O&y#P#Q'O#Y#Z'T#b#c'r#h#i(Z#o#p(r#q#r(w~!]Oc~~!`Wpq!]qr!]rs!xs#O!]#O#P!}#P;'S!];'S;=`$o<%lO!]~!}Oe~~#QXrs!]!P!Q!]#O#P!]#U#V!]#Y#Z!]#b#c!]#f#g!]#h#i!]#i#j#m~#pR!Q![#y!c!i#y#T#Z#y~#|R!Q![$V!c!i$V#T#Z$V~$YR!Q![$c!c!i$c#T#Z$c~$fR!Q![!]!c!i!]#T#Z!]~$rP;=`<%l!]~$zOh~~$}Q!Q!R%T!R![&c~%YRT~!O!P%c!g!h%w#X#Y%w~%fP!Q![%i~%nRT~!Q![%i!g!h%w#X#Y%w~%zR{|&T}!O&T!Q![&Z~&WP!Q![&Z~&`PT~!Q![&Z~&hST~!O!P%c!Q![&c!g!h%w#X#Y%w~&yOg~~'OO]~~'TO[~~'WP#T#U'Z~'^P#`#a'a~'dP#g#h'g~'jP#X#Y'm~'rOR~~'uP#i#j'x~'{P#`#a(O~(RP#`#a(U~(ZOS~~(^P#f#g(a~(dP#i#j(g~(jP#X#Y(m~(rOQ~~(wOW~~(|OV~",tokenizers:[0],topRules:{JsonText:[0,1]},tokenPrec:0}),hA=Ws.define({name:"json",parser:uA.configure({props:[Nl.add({Object:Rl({except:/^\s*\}/}),Array:Rl({except:/^\s*\]/})}),jl.add({"Object Array":ur})]}),languageData:{closeBrackets:{brackets:["[","{",'"']},indentOnInput:/^\s*[\}\]]$/}});function OA(){return new Sa(hA)}const dA=54,pA=1,gA=55,mA=2,SA=56,bA=3,T0=4,$A=5,Vc=6,_w=7,kw=8,Pw=9,Ww=10,yA=11,vA=12,wA=13,hO=57,QA=14,Z0=58,xw=20,_A=22,Cw=23,kA=24,Sd=26,Tw=27,PA=28,WA=31,xA=34,CA=36,TA=37,ZA=0,RA=1,XA={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},AA={dd:!0,li:!0,optgroup:!0,option:!0,p:!0,rp:!0,rt:!0,tbody:!0,td:!0,tfoot:!0,th:!0,tr:!0},R0={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 YA(n){return n==45||n==46||n==58||n>=65&&n<=90||n==95||n>=97&&n<=122||n>=161}function Zw(n){return n==9||n==10||n==13||n==32}let X0=null,A0=null,Y0=0;function bd(n,e){let t=n.pos+e;if(Y0==t&&A0==n)return X0;let i=n.peek(e);for(;Zw(i);)i=n.peek(++e);let r="";for(;YA(i);)r+=String.fromCharCode(i),i=n.peek(++e);return A0=n,Y0=t,X0=r?r.toLowerCase():i==UA||i==EA?void 0:null}const Rw=60,qc=62,np=47,UA=63,EA=33,zA=45;function U0(n,e){this.name=n,this.parent=e,this.hash=e?e.hash:0;for(let t=0;t-1?new U0(bd(i,1)||"",n):n},reduce(n,e){return e==xw&&n?n.parent:n},reuse(n,e,t,i){let r=e.type.id;return r==Vc||r==CA?new U0(bd(i,1)||"",n):n},hash(n){return n?n.hash:0},strict:!1}),VA=new $r((n,e)=>{if(n.next!=Rw){n.next<0&&e.context&&n.acceptToken(hO);return}n.advance();let t=n.next==np;t&&n.advance();let i=bd(n,0);if(i===void 0)return;if(!i)return n.acceptToken(t?QA:Vc);let r=e.context?e.context.name:null;if(t){if(i==r)return n.acceptToken(yA);if(r&&AA[r])return n.acceptToken(hO,-2);if(e.dialectEnabled(ZA))return n.acceptToken(vA);for(let s=e.context;s;s=s.parent)if(s.name==i)return;n.acceptToken(wA)}else{if(i=="script")return n.acceptToken(_w);if(i=="style")return n.acceptToken(kw);if(i=="textarea")return n.acceptToken(Pw);if(XA.hasOwnProperty(i))return n.acceptToken(Ww);r&&R0[r]&&R0[r][i]?n.acceptToken(hO,-1):n.acceptToken(Vc)}},{contextual:!0}),qA=new $r(n=>{for(let e=0,t=0;;t++){if(n.next<0){t&&n.acceptToken(Z0);break}if(n.next==zA)e++;else if(n.next==qc&&e>=2){t>=3&&n.acceptToken(Z0,-2);break}else e=0;n.advance()}});function IA(n){for(;n;n=n.parent)if(n.name=="svg"||n.name=="math")return!0;return!1}const LA=new $r((n,e)=>{if(n.next==np&&n.peek(1)==qc){let t=e.dialectEnabled(RA)||IA(e.context);n.acceptToken(t?$A:T0,2)}else n.next==qc&&n.acceptToken(T0,1)});function rp(n,e,t){let i=2+n.length;return new $r(r=>{for(let s=0,l=0,o=0;;o++){if(r.next<0){o&&r.acceptToken(e);break}if(s==0&&r.next==Rw||s==1&&r.next==np||s>=2&&sl?r.acceptToken(e,-l):r.acceptToken(t,-(l-2));break}else if((r.next==10||r.next==13)&&o){r.acceptToken(e,1);break}else s=l=0;r.advance()}})}const NA=rp("script",dA,pA),jA=rp("style",gA,mA),BA=rp("textarea",SA,bA),FA=Ll({"Text RawText":b.content,"StartTag StartCloseTag SelfClosingEndTag EndTag":b.angleBracket,TagName:b.tagName,"MismatchedCloseTag/TagName":[b.tagName,b.invalid],AttributeName:b.attributeName,"AttributeValue UnquotedAttributeValue":b.attributeValue,Is:b.definitionOperator,"EntityReference CharacterReference":b.character,Comment:b.blockComment,ProcessingInst:b.processingInstruction,DoctypeDecl:b.documentMeta}),GA=Ps.deserialize({version:14,states:",xOVO!rOOO!WQ#tO'#CqO!]Q#tO'#CzO!bQ#tO'#C}O!gQ#tO'#DQO!lQ#tO'#DSO!qOaO'#CpO!|ObO'#CpO#XOdO'#CpO$eO!rO'#CpOOO`'#Cp'#CpO$lO$fO'#DTO$tQ#tO'#DVO$yQ#tO'#DWOOO`'#Dk'#DkOOO`'#DY'#DYQVO!rOOO%OQ&rO,59]O%WQ&rO,59fO%`Q&rO,59iO%hQ&rO,59lO%sQ&rO,59nOOOa'#D^'#D^O%{OaO'#CxO&WOaO,59[OOOb'#D_'#D_O&`ObO'#C{O&kObO,59[OOOd'#D`'#D`O&sOdO'#DOO'OOdO,59[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X~OR!]O!Z!XO~O!Z!XO~P#dOf!_O~O![sO!e!aO~OS!bO~OS!cO~Oi!dOSgXhgXTgX~OS!fOhyO~OS!gOhyO~OS!hOhyO~OS!iOT!jOhyO~OS!jOhyO~Of!kO~Of!lO~Of!mO~OS!nO~Ok!qO!`!oO!b!pO~OS!rO~OS!sO~OS!tO~Oa!uOb!uOc!uO!`!wO!a!uO~Oa!xOb!xOc!xO!b!wO!c!xO~Oa!uOb!uOc!uO!`!{O!a!uO~Oa!xOb!xOc!xO!b!{O!c!xO~OT~bac!dx{!d~",goto:"%p!`PPPPPPPPPPPPPPPPPPPP!a!gP!mPP!yP!|#P#S#Y#]#`#f#i#l#r#x!aP!a!aP$O$U$l$r$x%O%U%[%bPPPPPPPP%hX^OX`pXUOX`pezabcde{}!P!R!UR!q!dRhUR!XhXVOX`pRkVR!XkXWOX`pRnWR!XnXXOX`pQrXR!XpXYOX`pQ`ORx`Q{aQ}bQ!PcQ!RdQ!UeZ!e{}!P!R!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 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:67,context:DA,nodeProps:[["closedBy",-10,1,2,3,7,8,9,10,11,12,13,"EndTag",6,"EndTag SelfClosingEndTag",-4,21,30,33,36,"CloseTag"],["openedBy",4,"StartTag StartCloseTag",5,"StartTag",-4,29,32,35,37,"OpenTag"],["group",-9,14,17,18,19,20,39,40,41,42,"Entity",16,"Entity TextContent",-3,28,31,34,"TextContent Entity"]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!cpOv!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!7QOxPP!7TP;=`<%l!6Vq!7]V!cpOv!5kvx!6Vx!`!5k!`!a!7r!a;'S!5k;'S;=`!8V<%lO!5kq!7yS!cpxPOv(Vx;'S(V;'S;=`(h<%lO(Vq!8YP;=`<%l!5ka!8bX!a`Or!8]rs!6Vsv!8]vw!6Vw!a!8]!a!b!8}!b;'S!8];'S;=`!:V<%lO!8]a!9SX!a`Or!8]rs!6Vsv!8]vw!6Vw!`!8]!`!a!9o!a;'S!8];'S;=`!:V<%lO!8]a!9vT!a`xPOr)esv)ew;'S)e;'S;=`)y<%lO)ea!:YP;=`<%l!8]!R!:dY!a`!cpOr!4trs!5ksv!4tvw!6Vwx!8]x!`!4t!`!a!;S!a;'S!4t;'S;=`!;r<%lO!4t!R!;]V!a`!cpxPOr*Vrs(Vsv*Vwx)ex;'S*V;'S;=`*s<%lO*V!R!;uP;=`<%l!4t!V!{let c=o.type.id;if(c==PA)return OO(o,a,t);if(c==WA)return OO(o,a,i);if(c==xA)return OO(o,a,r);if(c==xw&&s.length){let h=o.node,O=h.firstChild,p=O&&E0(O,a),g;if(p){for(let m of s)if(m.tag==p&&(!m.attrs||m.attrs(g||(g=Xw(h,a))))){let $=h.lastChild,y=$.type.id==TA?$.from:h.to;if(y>O.to)return{parser:m.parser,overlay:[{from:O.to,to:y}]}}}}if(l&&c==Cw){let h=o.node,O;if(O=h.firstChild){let p=l[a.read(O.from,O.to)];if(p)for(let g of p){if(g.tagName&&g.tagName!=E0(h.parent,a))continue;let m=h.lastChild;if(m.type.id==Sd){let $=m.from+1,y=m.lastChild,_=m.to-(y&&y.isError?0:1);if(_>$)return{parser:g.parser,overlay:[{from:$,to:_}]}}else if(m.type.id==Tw)return{parser:g.parser,overlay:[{from:m.from,to:m.to}]}}}}return null})}const HA=96,z0=1,KA=97,JA=98,M0=2,Yw=[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],e7=58,t7=40,Uw=95,i7=91,hc=45,n7=46,r7=35,s7=37,l7=38,o7=92,a7=10;function Ic(n){return n>=65&&n<=90||n>=97&&n<=122||n>=161}function f7(n){return n>=48&&n<=57}const c7=new $r((n,e)=>{for(let t=!1,i=0,r=0;;r++){let{next:s}=n;if(Ic(s)||s==hc||s==Uw||t&&f7(s))!t&&(s!=hc||r>0)&&(t=!0),i===r&&s==hc&&i++,n.advance();else if(s==o7&&n.peek(1)!=a7)n.advance(),n.next>-1&&n.advance(),t=!0;else{t&&n.acceptToken(s==t7?KA:i==2&&e.canShift(M0)?M0:JA);break}}}),u7=new $r(n=>{if(Yw.includes(n.peek(-1))){let{next:e}=n;(Ic(e)||e==Uw||e==r7||e==n7||e==i7||e==e7||e==hc||e==l7)&&n.acceptToken(HA)}}),h7=new $r(n=>{if(!Yw.includes(n.peek(-1))){let{next:e}=n;if(e==s7&&(n.advance(),n.acceptToken(z0)),Ic(e)){do n.advance();while(Ic(n.next));n.acceptToken(z0)}}}),O7=Ll({"AtKeyword import charset namespace keyframes media supports":b.definitionKeyword,"from to selector":b.keyword,NamespaceName:b.namespace,KeyframeName:b.labelName,KeyframeRangeName:b.operatorKeyword,TagName:b.tagName,ClassName:b.className,PseudoClassName:b.constant(b.className),IdName:b.labelName,"FeatureName PropertyName":b.propertyName,AttributeName:b.attributeName,NumberLiteral:b.number,KeywordQuery:b.keyword,UnaryQueryOp:b.operatorKeyword,"CallTag ValueName":b.atom,VariableName:b.variableName,Callee:b.operatorKeyword,Unit:b.unit,"UniversalSelector NestingSelector":b.definitionOperator,MatchOp:b.compareOperator,"ChildOp SiblingOp, LogicOp":b.logicOperator,BinOp:b.arithmeticOperator,Important:b.modifier,Comment:b.blockComment,ColorLiteral:b.color,"ParenthesizedContent StringLiteral":b.string,":":b.punctuation,"PseudoOp #":b.derefOperator,"; ,":b.separator,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace}),d7={__proto__:null,lang:32,"nth-child":32,"nth-last-child":32,"nth-of-type":32,"nth-last-of-type":32,dir:32,"host-context":32,url:60,"url-prefix":60,domain:60,regexp:60,selector:134},p7={__proto__:null,"@import":114,"@media":138,"@charset":142,"@namespace":146,"@keyframes":152,"@supports":164},g7={__proto__:null,not:128,only:128},m7=Ps.deserialize({version:14,states:"9bQYQ[OOO#_Q[OOP#fOWOOOOQP'#Cd'#CdOOQP'#Cc'#CcO#kQ[O'#CfO$_QXO'#CaO$fQ[O'#ChO$qQ[O'#DPO$vQ[O'#DTOOQP'#Ej'#EjO${QdO'#DeO%gQ[O'#DrO${QdO'#DtO%xQ[O'#DvO&TQ[O'#DyO&]Q[O'#EPO&kQ[O'#EROOQS'#Ei'#EiOOQS'#EU'#EUQYQ[OOO&rQXO'#CdO'gQWO'#DaO'lQWO'#EpO'wQ[O'#EpQOQWOOP(RO#tO'#C_POOO)C@X)C@XOOQP'#Cg'#CgOOQP,59Q,59QO#kQ[O,59QO(^Q[O'#EXO(xQWO,58{O)QQ[O,59SO$qQ[O,59kO$vQ[O,59oO(^Q[O,59sO(^Q[O,59uO(^Q[O,59vO)]Q[O'#D`OOQS,58{,58{OOQP'#Ck'#CkOOQO'#C}'#C}OOQP,59S,59SO)dQWO,59SO)iQWO,59SOOQP'#DR'#DROOQP,59k,59kOOQO'#DV'#DVO)nQ`O,59oOOQS'#Cp'#CpO${QdO'#CqO)vQvO'#CsO+TQtO,5:POOQO'#Cx'#CxO)iQWO'#CwO+iQWO'#CyOOQS'#Em'#EmOOQO'#Dh'#DhO+nQ[O'#DoO+|QWO'#EqO&]Q[O'#DmO,[QWO'#DpOOQO'#Er'#ErO({QWO,5:^O,aQpO,5:`OOQS'#Dx'#DxO,iQWO,5:bO,nQ[O,5:bOOQO'#D{'#D{O,vQWO,5:eO,{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=`%o<%lO%^nIcS!Q^Oy%^z;'S%^;'S;=`%o<%lO%^fItU!PQOy%^z!_%^!_!`6y!`;'S%^;'S;=`%o<%lO%^`JZP;=`<%l$}",tokenizers:[u7,h7,c7,1,2,3,4,new Pc("m~RRYZ[z{a~~g~aO#Z~~dP!P!Qg~lO#[~~",28,102)],topRules:{StyleSheet:[0,4],Styles:[1,84]},specialized:[{term:97,get:n=>d7[n]||-1},{term:56,get:n=>p7[n]||-1},{term:98,get:n=>g7[n]||-1}],tokenPrec:1169});let dO=null;function pO(){if(!dO&&typeof document=="object"&&document.body){let{style:n}=document.body,e=[],t=new Set;for(let i in n)i!="cssText"&&i!="cssFloat"&&typeof n[i]=="string"&&(/[A-Z]/.test(i)&&(i=i.replace(/[A-Z]/g,r=>"-"+r.toLowerCase())),t.has(i)||(e.push(i),t.add(i)));dO=e.sort().map(i=>({type:"property",label:i}))}return dO||[]}const D0=["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})),V0=["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}))),S7=["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})),fs=/^(\w[\w-]*|-\w[\w-]*|)$/,b7=/^-(-[\w-]*)?$/;function $7(n,e){var t;if((n.name=="("||n.type.isError)&&(n=n.parent||n),n.name!="ArgList")return!1;let i=(t=n.parent)===null||t===void 0?void 0:t.firstChild;return(i==null?void 0:i.name)!="Callee"?!1:e.sliceString(i.from,i.to)=="var"}const q0=new Fy,y7=["Declaration"];function v7(n){for(let e=n;;){if(e.type.isTop)return e;if(!(e=e.parent))return n}}function Ew(n,e,t){if(e.to-e.from>4096){let i=q0.get(e);if(i)return i;let r=[],s=new Set,l=e.cursor(Ut.IncludeAnonymous);if(l.firstChild())do for(let o of Ew(n,l.node,t))s.has(o.label)||(s.add(o.label),r.push(o));while(l.nextSibling());return q0.set(e,r),r}else{let i=[],r=new Set;return e.cursor().iterate(s=>{var l;if(t(s)&&s.matchContext(y7)&&((l=s.node.nextSibling)===null||l===void 0?void 0:l.name)==":"){let o=n.sliceString(s.from,s.to);r.has(o)||(r.add(o),i.push({label:o,type:"variable"}))}}),i}}const w7=n=>e=>{let{state:t,pos:i}=e,r=ei(t).resolveInner(i,-1),s=r.type.isError&&r.from==r.to-1&&t.doc.sliceString(r.from,r.to)=="-";if(r.name=="PropertyName"||(s||r.name=="TagName")&&/^(Block|Styles)$/.test(r.resolve(r.to).name))return{from:r.from,options:pO(),validFor:fs};if(r.name=="ValueName")return{from:r.from,options:V0,validFor:fs};if(r.name=="PseudoClassName")return{from:r.from,options:D0,validFor:fs};if(n(r)||(e.explicit||s)&&$7(r,t.doc))return{from:n(r)||s?r.from:i,options:Ew(t.doc,v7(r),n),validFor:b7};if(r.name=="TagName"){for(let{parent:a}=r;a;a=a.parent)if(a.name=="Block")return{from:r.from,options:pO(),validFor:fs};return{from:r.from,options:S7,validFor:fs}}if(!e.explicit)return null;let l=r.resolve(i),o=l.childBefore(i);return o&&o.name==":"&&l.name=="PseudoClassSelector"?{from:i,options:D0,validFor:fs}:o&&o.name==":"&&l.name=="Declaration"||l.name=="ArgList"?{from:i,options:V0,validFor:fs}:l.name=="Block"||l.name=="Styles"?{from:i,options:pO(),validFor:fs}:null},Q7=w7(n=>n.name=="VariableName"),Lc=Ws.define({name:"css",parser:m7.configure({props:[Nl.add({Declaration:Rl()}),jl.add({"Block KeyframeList":ur})]}),languageData:{commentTokens:{block:{open:"/*",close:"*/"}},indentOnInput:/^\s*\}$/,wordChars:"-"}});function _7(){return new Sa(Lc,Lc.data.of({autocomplete:Q7}))}const k7=304,I0=1,P7=2,W7=305,x7=307,C7=308,T7=3,Z7=4,R7=[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],zw=125,X7=59,L0=47,A7=42,Y7=43,U7=45,E7=new Ky({start:!1,shift(n,e){return e==T7||e==Z7||e==x7?n:e==C7},strict:!1}),z7=new $r((n,e)=>{let{next:t}=n;(t==zw||t==-1||e.context)&&n.acceptToken(W7)},{contextual:!0,fallback:!0}),M7=new $r((n,e)=>{let{next:t}=n,i;R7.indexOf(t)>-1||t==L0&&((i=n.peek(1))==L0||i==A7)||t!=zw&&t!=X7&&t!=-1&&!e.context&&n.acceptToken(k7)},{contextual:!0}),D7=new $r((n,e)=>{let{next:t}=n;if((t==Y7||t==U7)&&(n.advance(),t==n.next)){n.advance();let i=!e.context&&e.canShift(I0);n.acceptToken(i?I0:P7)}},{contextual:!0}),V7=Ll({"get set async static":b.modifier,"for while do if else switch try catch finally return throw break continue default case":b.controlKeyword,"in of await yield void typeof delete instanceof":b.operatorKeyword,"let var const using function class extends":b.definitionKeyword,"import export from":b.moduleKeyword,"with debugger as new":b.keyword,TemplateString:b.special(b.string),super:b.atom,BooleanLiteral:b.bool,this:b.self,null:b.null,Star:b.modifier,VariableName:b.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":b.function(b.variableName),VariableDefinition:b.definition(b.variableName),Label:b.labelName,PropertyName:b.propertyName,PrivatePropertyName:b.special(b.propertyName),"CallExpression/MemberExpression/PropertyName":b.function(b.propertyName),"FunctionDeclaration/VariableDefinition":b.function(b.definition(b.variableName)),"ClassDeclaration/VariableDefinition":b.definition(b.className),PropertyDefinition:b.definition(b.propertyName),PrivatePropertyDefinition:b.definition(b.special(b.propertyName)),UpdateOp:b.updateOperator,"LineComment Hashbang":b.lineComment,BlockComment:b.blockComment,Number:b.number,String:b.string,Escape:b.escape,ArithOp:b.arithmeticOperator,LogicOp:b.logicOperator,BitOp:b.bitwiseOperator,CompareOp:b.compareOperator,RegExp:b.regexp,Equals:b.definitionOperator,Arrow:b.function(b.punctuation),": Spread":b.punctuation,"( )":b.paren,"[ ]":b.squareBracket,"{ }":b.brace,"InterpolationStart InterpolationEnd":b.special(b.brace),".":b.derefOperator,", ;":b.separator,"@":b.meta,TypeName:b.typeName,TypeDefinition:b.definition(b.typeName),"type enum interface implements namespace module declare":b.definitionKeyword,"abstract global Privacy readonly override":b.modifier,"is keyof unique infer":b.operatorKeyword,JSXAttributeValue:b.attributeValue,JSXText:b.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":b.angleBracket,"JSXIdentifier JSXNameSpacedName":b.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":b.attributeName,"JSXBuiltin/JSXIdentifier":b.standard(b.tagName)}),q7={__proto__:null,export:16,as:21,from:29,default:32,async:37,function:38,extends:48,this:52,true:60,false:60,null:72,void:76,typeof:80,super:98,new:132,delete:148,yield:157,await:161,class:166,public:223,private:223,protected:223,readonly:225,instanceof:244,satisfies:247,in:248,const:250,import:282,keyof:337,unique:341,infer:347,is:383,abstract:403,implements:405,type:407,let:410,var:412,using:415,interface:421,enum:425,namespace:431,module:433,declare:437,global:441,for:460,of:469,while:472,with:476,do:480,if:484,else:486,switch:490,case:496,try:502,catch:506,finally:510,return:514,throw:518,break:522,continue:526,debugger:530},I7={__proto__:null,async:119,get:121,set:123,declare:183,public:185,private:185,protected:185,static:187,abstract:189,override:191,readonly:197,accessor:199,new:387},L7={__proto__:null,"<":139},N7=Ps.deserialize({version:14,states:"$6zO%TQUOOO%[QUOOO'_QWOOP(lOSOOO*zQ(CjO'#CgO+ROpO'#ChO+aO!bO'#ChO+oO07`O'#D[O.QQUO'#DbO.bQUO'#DmO%[QUO'#DwO0fQUO'#EPOOQ(CY'#EX'#EXO1PQSO'#EUOOQO'#Ej'#EjOOQO'#Id'#IdO1XQSO'#GlO1dQSO'#EiO1iQSO'#EiO3kQ(CjO'#JeO6[Q(CjO'#JfO6xQSO'#FXO6}Q#tO'#FpOOQ(CY'#Fa'#FaO7YO&jO'#FaO7hQ,UO'#FwO9OQSO'#FvOOQ(CY'#Jf'#JfOOQ(CW'#Je'#JeO9TQSO'#GpOOQQ'#KQ'#KQO9`QSO'#IQO9eQ(C[O'#IROOQQ'#JR'#JROOQQ'#IV'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T)d$k)eR3`.pT*T$x*VR*]${Q0V+VQ2j.TQ4x0|Q6Q2nQ7^4{Q7}6PQ8j7]Q8|7|Q9]8lQ9e9OQ9j9^R9m9fnqOXst!Z#c%f&i&k&l&n,b,g1g1jQ&c!VR,V&`tmOXst!U!V!Z#c%f&`&i&k&l&n,b,g1g1jR,^&fT%em,^R0v+vR,U&^Q%||R+n%}R+d%wT&g!W&jT&h!W&jT1i,g1j",nodeNames:"⚠ ArithOp ArithOp LineComment BlockComment Script Hashbang ExportDeclaration export Star as VariableName String Escape from ; default FunctionDeclaration async function VariableDefinition > TypeParamList 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 : NewExpression new TypeArgList CompareOp < ) ( ArgList UnaryExpression delete LogicOp BitOp YieldExpression yield AwaitExpression await ParenthesizedExpression ClassExpression class ClassBody MethodDeclaration Decorator @ MemberExpression PrivatePropertyName CallExpression 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 in const CompareOp BitOp BitOp BitOp LogicOp LogicOp ConditionalExpression LogicOp LogicOp AssignmentExpression UpdateOp PostfixExpression CallExpression TaggedTemplateExpression DynamicImport import ImportMeta JSXElement JSXSelfCloseEndTag JSXStartTag JSXSelfClosingTag JSXIdentifier JSXBuiltin JSXIdentifier JSXNamespacedName JSXMemberExpression JSXSpreadAttribute JSXAttribute JSXAttributeValue JSXEscape JSXEndTag JSXOpenTag JSXFragmentTag JSXText JSXEscape JSXStartCloseTag JSXCloseTag PrefixCast ArrowFunction TypeParamList SequenceExpression KeyofType keyof UniqueType unique ImportType InferredType infer TypeName ParenthesizedType FunctionSignature ParamList NewSignature IndexedType TupleType Label ArrayType ReadonlyType ObjectType MethodType PropertyType IndexSignature PropertyDefinition CallSignature TypePredicate 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 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:367,context:E7,nodeProps:[["group",-26,7,15,17,63,200,204,208,209,211,214,217,227,229,235,237,239,241,244,250,256,258,260,262,264,266,267,"Statement",-32,11,12,26,29,30,36,46,49,50,52,57,65,73,77,79,81,82,104,105,114,115,132,135,137,138,139,140,142,143,163,164,166,"Expression",-23,25,27,31,35,37,39,167,169,171,172,174,175,176,178,179,180,182,183,184,194,196,198,199,"Type",-3,85,97,103,"ClassItem"],["openedBy",32,"InterpolationStart",51,"[",55,"{",70,"(",144,"JSXStartTag",156,"JSXStartTag JSXStartCloseTag"],["closedBy",34,"InterpolationEnd",45,"]",56,"}",71,")",145,"JSXSelfCloseEndTag JSXEndTag",161,"JSXEndTag"]],propSources:[V7],skippedNodes:[0,3,4,270],repeatNodeCount:33,tokenData:"$Fl(CSR!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#8g!R![#:v![!]#Gv!]!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_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'yp'|!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$/l#?tf$e&j'yp'|!bm$'|OY%ZYZ&cZr%Zrs&}sw%Zwx(rx!Q%Z!Q!R#?i!R!S#?i!S!^%Z!^!_*g!_#O%Z#O#P&c#P#R%Z#R#S#?i#S#b%Z#b#c#q7[n]||-1},{term:330,get:n=>I7[n]||-1},{term:68,get:n=>L7[n]||-1}],tokenPrec:12868}),Mw=[Hi("function ${name}(${params}) {\n ${}\n}",{label:"function",detail:"definition",type:"keyword"}),Hi("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n ${}\n}",{label:"for",detail:"loop",type:"keyword"}),Hi("for (let ${name} of ${collection}) {\n ${}\n}",{label:"for",detail:"of loop",type:"keyword"}),Hi("do {\n ${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),Hi("while (${}) {\n ${}\n}",{label:"while",detail:"loop",type:"keyword"}),Hi(`try { \${} } catch (\${error}) { \${} @@ -25,17 +25,17 @@ var DW=Object.defineProperty;var VW=(n,e,t)=>e in n?DW(n,e,{enumerable:!0,config constructor(\${params}) { \${} } -}`,{label:"class",detail:"definition",type:"keyword"}),Hi('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Hi('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],NY=zw.concat([Hi("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Hi("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Hi("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),L0=new By,Mw=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Zo(n){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,n),!0}}const jY=["FunctionDeclaration"],BY={FunctionDeclaration:Zo("function"),ClassDeclaration:Zo("class"),ClassExpression:()=>!0,EnumDeclaration:Zo("constant"),TypeAliasDeclaration:Zo("type"),NamespaceDeclaration:Zo("namespace"),VariableDefinition(n,e){n.matchContext(jY)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function Dw(n,e){let t=L0.get(e);if(t)return t;let i=[],r=!0;function s(l,o){let a=n.sliceString(l.from,l.to);i.push({label:a,type:o})}return e.cursor(Ut.IncludeAnonymous).iterate(l=>{if(r)r=!1;else if(l.name){let o=BY[l.name];if(o&&o(l,s)||Mw.has(l.name))return!1}else if(l.to-l.from>8192){for(let o of Dw(n,l.node))i.push(o);return!1}}),L0.set(e,i),i}const N0=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,Vw=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function FY(n){let e=ei(n.state).resolveInner(n.pos,-1);if(Vw.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&N0.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)Mw.has(r.name)&&(i=i.concat(Dw(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:N0}}const Sr=xs.define({name:"javascript",parser:LY.configure({props:[Nl.add({IfStatement:Rl({except:/^\s*({|else\b)/}),TryStatement:Rl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:ET,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:cs({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Rl({except:/^{/}),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}}),jl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":ur,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),qw={test:n=>/^JSX/.test(n.name),facet:ev({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Iw=Sr.configure({dialect:"ts"},"typescript"),Lw=Sr.configure({dialect:"jsx",props:[Dd.add(n=>n.isTop?[qw]:void 0)]}),Nw=Sr.configure({dialect:"jsx ts",props:[Dd.add(n=>n.isTop?[qw]:void 0)]},"typescript");let jw=n=>({label:n,type:"keyword"});const Bw="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(jw),GY=Bw.concat(["declare","implements","private","protected","public"].map(jw));function HY(n={}){let e=n.jsx?n.typescript?Nw:Lw:n.typescript?Iw:Sr,t=n.typescript?NY.concat(GY):zw.concat(Bw);return new Sa(e,[Sr.data.of({autocomplete:nX(Vw,lw(t))}),Sr.data.of({autocomplete:FY}),n.jsx?e9:[]])}function KY(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 j0(n,e,t=n.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return n.sliceString(i.from,Math.min(i.to,t));return""}const JY=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),e9=de.inputHandler.of((n,e,t,i,r)=>{if((JY?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=">"&&i!="/"||!Sr.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(a=>{var c;let{head:h}=a,O=ei(l).resolveInner(h-1,-1),p;if(O.name=="JSXStartTag"&&(O=O.parent),!(l.doc.sliceString(h-1,h)!=i||O.name=="JSXAttributeValue"&&O.to>h)){if(i==">"&&O.name=="JSXFragmentTag")return{range:a,changes:{from:h,insert:""}};if(i=="/"&&O.name=="JSXStartCloseTag"){let g=O.parent,m=g.parent;if(m&&g.from==h-2&&((p=j0(l.doc,m.firstChild,h))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let $=`${p}>`;return{range:ee.cursor(h+$.length,-1),changes:{from:h,insert:$}}}}else if(i==">"){let g=KY(O);if(g&&!/^\/?>|^<\//.test(l.doc.sliceString(h,h+2))&&(p=j0(l.doc,g,h)))return{range:a,changes:{from:h,insert:``}}}}return{range:a}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Ro=["_blank","_self","_top","_parent"],gO=["ascii","utf-8","utf-16","latin1","latin1"],mO=["get","post","put","delete"],SO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],un=["true","false"],Te={},t9={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ro,hreflang:null}},abbr:Te,address:Te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Te,aside:Te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Te,base:{attrs:{href:null,target:Ro}},bdi:Te,bdo:Te,blockquote:{attrs:{cite:null}},body:Te,br:Te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:SO,formmethod:mO,formnovalidate:["novalidate"],formtarget:Ro,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Te,center:Te,cite:Te,code:Te,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:Te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Te,div:Te,dl:Te,dt:Te,em:Te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Te,figure:Te,footer:Te,form:{attrs:{action:null,name:null,"accept-charset":gO,autocomplete:["on","off"],enctype:SO,method:mO,novalidate:["novalidate"],target:Ro}},h1:Te,h2:Te,h3:Te,h4:Te,h5:Te,h6:Te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Te,hgroup:Te,hr:Te,html:{attrs:{manifest:null}},i:Te,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:SO,formmethod:mO,formnovalidate:["novalidate"],formtarget:Ro,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:Te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Te,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:Te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:gO,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:Te,noscript:Te,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:Te,param:{attrs:{name:null,value:null}},pre:Te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Te,rt:Te,ruby:Te,samp:Te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:gO}},section:Te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Te,source:{attrs:{src:null,type:null,media:null}},span:Te,strong:Te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Te,summary:Te,sup:Te,table:Te,tbody:Te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Te,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:Te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Te,time:{attrs:{datetime:null}},title:Te,tr:Te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Te,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:Te},Fw={accesskey:null,class:null,contenteditable:un,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:un,autocorrect:un,autocapitalize:un,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":un,"aria-autocomplete":["inline","list","both","none"],"aria-busy":un,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":un,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":un,"aria-hidden":un,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":un,"aria-multiselectable":un,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":un,"aria-relevant":null,"aria-required":un,"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},Gw="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 Gw)Fw[n]=null;class Nc{constructor(e,t){this.tags=Object.assign(Object.assign({},t9),e),this.globalAttrs=Object.assign(Object.assign({},Fw),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Nc.default=new Nc;function Dl(n,e,t=n.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?n.sliceString(r.from,Math.min(r.to,t)):""}function Vl(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function Hw(n,e,t){let i=t.tags[Dl(n,Vl(e))];return(i==null?void 0:i.children)||t.allTags}function sp(n,e){let t=[];for(let i=Vl(e);i&&!i.type.isTop;i=Vl(i.parent)){let r=Dl(n,i);if(r&&i.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(r)}return t}const Kw=/^[:\-\.\w\u00b7-\uffff]*$/;function B0(n,e,t,i,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">",l=Vl(t,!0);return{from:i,to:r,options:Hw(n.doc,l,e).map(o=>({label:o,type:"type"})).concat(sp(n.doc,t).map((o,a)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function F0(n,e,t,i){let r=/\s*>/.test(n.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:sp(n.doc,e).map((s,l)=>({label:s,apply:s+r,type:"type",boost:99-l})),validFor:Kw}}function i9(n,e,t,i){let r=[],s=0;for(let l of Hw(n.doc,t,e))r.push({label:"<"+l,type:"type"});for(let l of sp(n.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function n9(n,e,t,i,r){let s=Vl(t),l=s?e.tags[Dl(n.doc,s)]:null,o=l&&l.attrs?Object.keys(l.attrs):[],a=l&&l.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:a.map(c=>({label:c,type:"property"})),validFor:Kw}}function r9(n,e,t,i,r){var s;let l=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],a;if(l){let c=n.sliceDoc(l.from,l.to),h=e.globalAttrs[c];if(!h){let O=Vl(t),p=O?e.tags[Dl(n.doc,O)]:null;h=(p==null?void 0:p.attrs)&&p.attrs[c]}if(h){let O=n.sliceDoc(i,r).toLowerCase(),p='"',g='"';/^['"]/.test(O)?(a=O[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",g=n.sliceDoc(r,r+1)==O[0]?"":O[0],O=O.slice(1),i++):a=/^[^\s<>='"]*$/;for(let m of h)o.push({label:m,apply:p+m+g,type:"constant"})}}return{from:i,to:r,options:o,validFor:a}}function s9(n,e){let{state:t,pos:i}=e,r=ei(t).resolveInner(i,-1),s=r.resolve(i);for(let l=i,o;s==r&&(o=r.childBefore(l));){let a=o.lastChild;if(!a||!a.type.isError||a.froms9(i,r)}const o9=Sr.parser.configure({top:"SingleExpression"}),Jw=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:Iw.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:Lw.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:Nw.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:o9},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:Sr.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:Lc.parser}],eQ=[{name:"style",parser:Lc.parser.configure({top:"Styles"})}].concat(Gw.map(n=>({name:n,parser:Sr.parser}))),tQ=xs.define({name:"html",parser:FA.configure({props:[Nl.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].lengthn.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Oc=tQ.configure({wrap:Xw(Jw,eQ)});function a9(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=Xw((n.nestedLanguages||[]).concat(Jw),(n.nestedAttributes||[]).concat(eQ)));let i=t?tQ.configure({wrap:t,dialect:e}):e?Oc.configure({dialect:e}):Oc;return new Sa(i,[Oc.data.of({autocomplete:l9(n)}),n.autoCloseTags!==!1?f9:[],HY().support,QY().support])}const G0=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),f9=de.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=">"&&i!="/"||!Oc.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(a=>{var c,h,O;let p=l.doc.sliceString(a.from-1,a.to)==i,{head:g}=a,m=ei(l).resolveInner(g,-1),$;if(p&&i==">"&&m.name=="EndTag"){let y=m.parent;if(((h=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&($=Dl(l.doc,y.parent,g))&&!G0.has($)){let _=g+(l.doc.sliceString(g,g+1)===">"?1:0),W=``;return{range:a,changes:{from:g,to:_,insert:W}}}}else if(p&&i=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==g-2&&((O=y.lastChild)===null||O===void 0?void 0:O.name)!="CloseTag"&&($=Dl(l.doc,y,g))&&!G0.has($)){let _=g+(l.doc.sliceString(g,g+1)===">"?1:0),W=`${$}>`;return{range:ee.cursor(g+W.length,-1),changes:{from:g,to:_,insert:W}}}}return{range:a}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var Xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function x8(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var jc={exports:{}};/** +}`,{label:"class",detail:"definition",type:"keyword"}),Hi('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Hi('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],j7=Mw.concat([Hi("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Hi("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Hi("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),N0=new Fy,Dw=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Zo(n){return(e,t)=>{let i=e.node.getChild("VariableDefinition");return i&&t(i,n),!0}}const B7=["FunctionDeclaration"],F7={FunctionDeclaration:Zo("function"),ClassDeclaration:Zo("class"),ClassExpression:()=>!0,EnumDeclaration:Zo("constant"),TypeAliasDeclaration:Zo("type"),NamespaceDeclaration:Zo("namespace"),VariableDefinition(n,e){n.matchContext(B7)||e(n,"variable")},TypeDefinition(n,e){e(n,"type")},__proto__:null};function Vw(n,e){let t=N0.get(e);if(t)return t;let i=[],r=!0;function s(l,o){let a=n.sliceString(l.from,l.to);i.push({label:a,type:o})}return e.cursor(Ut.IncludeAnonymous).iterate(l=>{if(r)r=!1;else if(l.name){let o=F7[l.name];if(o&&o(l,s)||Dw.has(l.name))return!1}else if(l.to-l.from>8192){for(let o of Vw(n,l.node))i.push(o);return!1}}),N0.set(e,i),i}const j0=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,qw=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function G7(n){let e=ei(n.state).resolveInner(n.pos,-1);if(qw.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&j0.test(n.state.sliceDoc(e.from,e.to));if(!t&&!n.explicit)return null;let i=[];for(let r=e;r;r=r.parent)Dw.has(r.name)&&(i=i.concat(Vw(n.state.doc,r)));return{options:i,from:t?e.from:n.pos,validFor:j0}}const Sr=Ws.define({name:"javascript",parser:N7.configure({props:[Nl.add({IfStatement:Rl({except:/^\s*({|else\b)/}),TryStatement:Rl({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:zT,SwitchBody:n=>{let e=n.textAfter,t=/^\s*\}/.test(e),i=/^\s*(case|default)\b/.test(e);return n.baseIndent+(t?0:i?1:2)*n.unit},Block:cs({closing:"}"}),ArrowFunction:n=>n.baseIndent+n.unit,"TemplateString BlockComment":()=>null,"Statement Property":Rl({except:/^{/}),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}}),jl.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":ur,BlockComment(n){return{from:n.from+2,to:n.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),Iw={test:n=>/^JSX/.test(n.name),facet:tv({commentTokens:{block:{open:"{/*",close:"*/}"}}})},Lw=Sr.configure({dialect:"ts"},"typescript"),Nw=Sr.configure({dialect:"jsx",props:[Dd.add(n=>n.isTop?[Iw]:void 0)]}),jw=Sr.configure({dialect:"jsx ts",props:[Dd.add(n=>n.isTop?[Iw]:void 0)]},"typescript");let Bw=n=>({label:n,type:"keyword"});const Fw="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(Bw),H7=Fw.concat(["declare","implements","private","protected","public"].map(Bw));function K7(n={}){let e=n.jsx?n.typescript?jw:Nw:n.typescript?Lw:Sr,t=n.typescript?j7.concat(H7):Mw.concat(Fw);return new Sa(e,[Sr.data.of({autocomplete:rX(qw,ow(t))}),Sr.data.of({autocomplete:G7}),n.jsx?tY:[]])}function J7(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 B0(n,e,t=n.length){for(let i=e==null?void 0:e.firstChild;i;i=i.nextSibling)if(i.name=="JSXIdentifier"||i.name=="JSXBuiltin"||i.name=="JSXNamespacedName"||i.name=="JSXMemberExpression")return n.sliceString(i.from,Math.min(i.to,t));return""}const eY=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),tY=de.inputHandler.of((n,e,t,i,r)=>{if((eY?n.composing:n.compositionStarted)||n.state.readOnly||e!=t||i!=">"&&i!="/"||!Sr.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(a=>{var c;let{head:h}=a,O=ei(l).resolveInner(h-1,-1),p;if(O.name=="JSXStartTag"&&(O=O.parent),!(l.doc.sliceString(h-1,h)!=i||O.name=="JSXAttributeValue"&&O.to>h)){if(i==">"&&O.name=="JSXFragmentTag")return{range:a,changes:{from:h,insert:""}};if(i=="/"&&O.name=="JSXStartCloseTag"){let g=O.parent,m=g.parent;if(m&&g.from==h-2&&((p=B0(l.doc,m.firstChild,h))||((c=m.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let $=`${p}>`;return{range:ee.cursor(h+$.length,-1),changes:{from:h,insert:$}}}}else if(i==">"){let g=J7(O);if(g&&!/^\/?>|^<\//.test(l.doc.sliceString(h,h+2))&&(p=B0(l.doc,g,h)))return{range:a,changes:{from:h,insert:``}}}}return{range:a}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Ro=["_blank","_self","_top","_parent"],gO=["ascii","utf-8","utf-16","latin1","latin1"],mO=["get","post","put","delete"],SO=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],un=["true","false"],Te={},iY={a:{attrs:{href:null,ping:null,type:null,media:null,target:Ro,hreflang:null}},abbr:Te,address:Te,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Te,aside:Te,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Te,base:{attrs:{href:null,target:Ro}},bdi:Te,bdo:Te,blockquote:{attrs:{cite:null}},body:Te,br:Te,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:SO,formmethod:mO,formnovalidate:["novalidate"],formtarget:Ro,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Te,center:Te,cite:Te,code:Te,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:Te,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Te,div:Te,dl:Te,dt:Te,em:Te,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Te,figure:Te,footer:Te,form:{attrs:{action:null,name:null,"accept-charset":gO,autocomplete:["on","off"],enctype:SO,method:mO,novalidate:["novalidate"],target:Ro}},h1:Te,h2:Te,h3:Te,h4:Te,h5:Te,h6:Te,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Te,hgroup:Te,hr:Te,html:{attrs:{manifest:null}},i:Te,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:SO,formmethod:mO,formnovalidate:["novalidate"],formtarget:Ro,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:Te,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Te,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:Te,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:gO,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:Te,noscript:Te,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:Te,param:{attrs:{name:null,value:null}},pre:Te,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Te,rt:Te,ruby:Te,samp:Te,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:gO}},section:Te,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Te,source:{attrs:{src:null,type:null,media:null}},span:Te,strong:Te,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Te,summary:Te,sup:Te,table:Te,tbody:Te,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Te,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:Te,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Te,time:{attrs:{datetime:null}},title:Te,tr:Te,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Te,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:Te},Gw={accesskey:null,class:null,contenteditable:un,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:un,autocorrect:un,autocapitalize:un,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":un,"aria-autocomplete":["inline","list","both","none"],"aria-busy":un,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":un,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":un,"aria-hidden":un,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":un,"aria-multiselectable":un,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":un,"aria-relevant":null,"aria-required":un,"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},Hw="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 Hw)Gw[n]=null;class Nc{constructor(e,t){this.tags=Object.assign(Object.assign({},iY),e),this.globalAttrs=Object.assign(Object.assign({},Gw),t),this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}Nc.default=new Nc;function Dl(n,e,t=n.length){if(!e)return"";let i=e.firstChild,r=i&&i.getChild("TagName");return r?n.sliceString(r.from,Math.min(r.to,t)):""}function Vl(n,e=!1){for(;n;n=n.parent)if(n.name=="Element")if(e)e=!1;else return n;return null}function Kw(n,e,t){let i=t.tags[Dl(n,Vl(e))];return(i==null?void 0:i.children)||t.allTags}function sp(n,e){let t=[];for(let i=Vl(e);i&&!i.type.isTop;i=Vl(i.parent)){let r=Dl(n,i);if(r&&i.lastChild.name=="CloseTag")break;r&&t.indexOf(r)<0&&(e.name=="EndTag"||e.from>=i.firstChild.to)&&t.push(r)}return t}const Jw=/^[:\-\.\w\u00b7-\uffff]*$/;function F0(n,e,t,i,r){let s=/\s*>/.test(n.sliceDoc(r,r+5))?"":">",l=Vl(t,!0);return{from:i,to:r,options:Kw(n.doc,l,e).map(o=>({label:o,type:"type"})).concat(sp(n.doc,t).map((o,a)=>({label:"/"+o,apply:"/"+o+s,type:"type",boost:99-a}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function G0(n,e,t,i){let r=/\s*>/.test(n.sliceDoc(i,i+5))?"":">";return{from:t,to:i,options:sp(n.doc,e).map((s,l)=>({label:s,apply:s+r,type:"type",boost:99-l})),validFor:Jw}}function nY(n,e,t,i){let r=[],s=0;for(let l of Kw(n.doc,t,e))r.push({label:"<"+l,type:"type"});for(let l of sp(n.doc,t))r.push({label:"",type:"type",boost:99-s++});return{from:i,to:i,options:r,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function rY(n,e,t,i,r){let s=Vl(t),l=s?e.tags[Dl(n.doc,s)]:null,o=l&&l.attrs?Object.keys(l.attrs):[],a=l&&l.globalAttrs===!1?o:o.length?o.concat(e.globalAttrNames):e.globalAttrNames;return{from:i,to:r,options:a.map(c=>({label:c,type:"property"})),validFor:Jw}}function sY(n,e,t,i,r){var s;let l=(s=t.parent)===null||s===void 0?void 0:s.getChild("AttributeName"),o=[],a;if(l){let c=n.sliceDoc(l.from,l.to),h=e.globalAttrs[c];if(!h){let O=Vl(t),p=O?e.tags[Dl(n.doc,O)]:null;h=(p==null?void 0:p.attrs)&&p.attrs[c]}if(h){let O=n.sliceDoc(i,r).toLowerCase(),p='"',g='"';/^['"]/.test(O)?(a=O[0]=='"'?/^[^"]*$/:/^[^']*$/,p="",g=n.sliceDoc(r,r+1)==O[0]?"":O[0],O=O.slice(1),i++):a=/^[^\s<>='"]*$/;for(let m of h)o.push({label:m,apply:p+m+g,type:"constant"})}}return{from:i,to:r,options:o,validFor:a}}function lY(n,e){let{state:t,pos:i}=e,r=ei(t).resolveInner(i,-1),s=r.resolve(i);for(let l=i,o;s==r&&(o=r.childBefore(l));){let a=o.lastChild;if(!a||!a.type.isError||a.fromlY(i,r)}const aY=Sr.parser.configure({top:"SingleExpression"}),eQ=[{tag:"script",attrs:n=>n.type=="text/typescript"||n.lang=="ts",parser:Lw.parser},{tag:"script",attrs:n=>n.type=="text/babel"||n.type=="text/jsx",parser:Nw.parser},{tag:"script",attrs:n=>n.type=="text/typescript-jsx",parser:jw.parser},{tag:"script",attrs(n){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(n.type)},parser:aY},{tag:"script",attrs(n){return!n.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(n.type)},parser:Sr.parser},{tag:"style",attrs(n){return(!n.lang||n.lang=="css")&&(!n.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(n.type))},parser:Lc.parser}],tQ=[{name:"style",parser:Lc.parser.configure({top:"Styles"})}].concat(Hw.map(n=>({name:n,parser:Sr.parser}))),iQ=Ws.define({name:"html",parser:GA.configure({props:[Nl.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].lengthn.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:""}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-._"}}),Oc=iQ.configure({wrap:Aw(eQ,tQ)});function fY(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=Aw((n.nestedLanguages||[]).concat(eQ),(n.nestedAttributes||[]).concat(tQ)));let i=t?iQ.configure({wrap:t,dialect:e}):e?Oc.configure({dialect:e}):Oc;return new Sa(i,[Oc.data.of({autocomplete:oY(n)}),n.autoCloseTags!==!1?cY:[],K7().support,_7().support])}const H0=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),cY=de.inputHandler.of((n,e,t,i,r)=>{if(n.composing||n.state.readOnly||e!=t||i!=">"&&i!="/"||!Oc.isActiveAt(n.state,e,-1))return!1;let s=r(),{state:l}=s,o=l.changeByRange(a=>{var c,h,O;let p=l.doc.sliceString(a.from-1,a.to)==i,{head:g}=a,m=ei(l).resolveInner(g,-1),$;if(p&&i==">"&&m.name=="EndTag"){let y=m.parent;if(((h=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&($=Dl(l.doc,y.parent,g))&&!H0.has($)){let _=g+(l.doc.sliceString(g,g+1)===">"?1:0),x=``;return{range:a,changes:{from:g,to:_,insert:x}}}}else if(p&&i=="/"&&m.name=="IncompleteCloseTag"){let y=m.parent;if(m.from==g-2&&((O=y.lastChild)===null||O===void 0?void 0:O.name)!="CloseTag"&&($=Dl(l.doc,y,g))&&!H0.has($)){let _=g+(l.doc.sliceString(g,g+1)===">"?1:0),x=`${$}>`;return{range:ee.cursor(g+x.length,-1),changes:{from:g,to:_,insert:x}}}}return{range:a}});return o.changes.empty?!1:(n.dispatch([s,l.update(o,{userEvent:"input.complete",scrollIntoView:!0})]),!0)});var Xo=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function x8(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var jc={exports:{}};/** * @license * Lodash * Copyright OpenJS Foundation and other contributors * Released under MIT license * Based on Underscore.js 1.8.3 * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors - */jc.exports;(function(n,e){(function(){var t,i="4.17.21",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",c=500,h="__lodash_placeholder__",O=1,p=2,g=4,m=1,$=2,y=1,_=2,W=4,R=8,X=16,C=32,E=64,D=128,z=256,F=512,B=30,q="...",L=800,re=16,ae=1,ye=2,Se=3,ge=1/0,Ue=9007199254740991,Ie=17976931348623157e292,ke=NaN,We=4294967295,lt=We-1,Vt=We>>>1,Qt=[["ary",D],["bind",y],["bindKey",_],["curry",R],["curryRight",X],["flip",F],["partial",C],["partialRight",E],["rearg",z]],pt="[object Arguments]",qt="[object Array]",$e="[object AsyncFunction]",oe="[object Boolean]",H="[object Date]",ue="[object DOMException]",ce="[object Error]",Ee="[object Function]",tt="[object GeneratorFunction]",ft="[object Map]",je="[object Number]",At="[object Null]",ut="[object Object]",En="[object Promise]",_t="[object Proxy]",xt="[object RegExp]",St="[object Set]",Be="[object String]",fe="[object Symbol]",Fe="[object Undefined]",He="[object WeakMap]",gi="[object WeakSet]",Wt="[object ArrayBuffer]",gt="[object DataView]",zn="[object Float32Array]",oi="[object Float64Array]",Ht="[object Int8Array]",gn="[object Int16Array]",Ct="[object Int32Array]",De="[object Uint8Array]",mn="[object Uint8ClampedArray]",ri="[object Uint16Array]",Kt="[object Uint32Array]",Sn=/\b__p \+= '';/g,tr=/\b(__p \+=) '' \+/g,Nr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zt=/&(?:amp|lt|gt|quot|#39);/g,Ts=/[&<>"']/g,Zs=RegExp(zt.source),Hl=RegExp(Ts.source),jr=/<%-([\s\S]+?)%>/g,Pi=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,we=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,Br=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mn=/[\\^$.*+?()[\]{}|]/g,vr=RegExp(Mn.source),ir=/^\s+/,Rs=/\s/,nr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,kt=/\{\n\/\* \[wrapped with (.+)\] \*/,wr=/,? & /,Fr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kl=/[()=,{}\[\]\/\s]/,Jl=/\\(\\)?/g,Qa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qr=/\w*$/,_r=/^[-+]0x[0-9a-f]+$/i,eo=/^0b[01]+$/i,Js=/^\[object .+?Constructor\]$/,fu=/^0o[0-7]+$/i,_a=/^(?:0|[1-9]\d*)$/,ka=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kr=/($^)/,Pa=/['\n\r\u2028\u2029\\]/g,el="\\ud800-\\udfff",cu="\\u0300-\\u036f",uu="\\ufe20-\\ufe2f",bn="\\u20d0-\\u20ff",Gr=cu+uu+bn,Hr="\\u2700-\\u27bf",to="a-z\\xdf-\\xf6\\xf8-\\xff",hu="\\xac\\xb1\\xd7\\xf7",Ou="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",du="\\u2000-\\u206f",pu=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",xa="A-Z\\xc0-\\xd6\\xd8-\\xde",Wa="\\ufe0e\\ufe0f",Ca=hu+Ou+du+pu,io="['’]",gu="["+el+"]",Ta="["+Ca+"]",tl="["+Gr+"]",Za="\\d+",mu="["+Hr+"]",Ra="["+to+"]",Xa="[^"+el+Ca+Za+Hr+to+xa+"]",no="\\ud83c[\\udffb-\\udfff]",Su="(?:"+tl+"|"+no+")",Aa="[^"+el+"]",ro="(?:\\ud83c[\\udde6-\\uddff]){2}",so="[\\ud800-\\udbff][\\udc00-\\udfff]",Kr="["+xa+"]",Ya="\\u200d",Ua="(?:"+Ra+"|"+Xa+")",bu="(?:"+Kr+"|"+Xa+")",Ea="(?:"+io+"(?:d|ll|m|re|s|t|ve))?",za="(?:"+io+"(?:D|LL|M|RE|S|T|VE))?",Ma=Su+"?",Da="["+Wa+"]?",$u="(?:"+Ya+"(?:"+[Aa,ro,so].join("|")+")"+Da+Ma+")*",yu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Va=Da+Ma+$u,wu="(?:"+[mu,ro,so].join("|")+")"+Va,Qu="(?:"+[Aa+tl+"?",tl,ro,so,gu].join("|")+")",_u=RegExp(io,"g"),ku=RegExp(tl,"g"),lo=RegExp(no+"(?="+no+")|"+Qu+Va,"g"),Pu=RegExp([Kr+"?"+Ra+"+"+Ea+"(?="+[Ta,Kr,"$"].join("|")+")",bu+"+"+za+"(?="+[Ta,Kr+Ua,"$"].join("|")+")",Kr+"?"+Ua+"+"+Ea,Kr+"+"+za,vu,yu,Za,wu].join("|"),"g"),xu=RegExp("["+Ya+el+Gr+Wa+"]"),Wu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tu=-1,Tt={};Tt[zn]=Tt[oi]=Tt[Ht]=Tt[gn]=Tt[Ct]=Tt[De]=Tt[mn]=Tt[ri]=Tt[Kt]=!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Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},Ru={"&":"&","<":"<",">":">",'"':""","'":"'"},Z={"&":"&","<":"<",">":">",""":'"',"'":"'"},he={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},be=parseFloat,Pe=parseInt,ze=typeof Xo=="object"&&Xo&&Xo.Object===Object&&Xo,it=typeof self=="object"&&self&&self.Object===Object&&self,Ze=ze||it||Function("return this")(),mi=e&&!e.nodeType&&e,Zt=mi&&!0&&n&&!n.nodeType&&n,Jr=Zt&&Zt.exports===mi,oo=Jr&&ze.process,$n=function(){try{var V=Zt&&Zt.require&&Zt.require("util").types;return V||oo&&oo.binding&&oo.binding("util")}catch{}}(),op=$n&&$n.isArrayBuffer,ap=$n&&$n.isDate,fp=$n&&$n.isMap,cp=$n&&$n.isRegExp,up=$n&&$n.isSet,hp=$n&&$n.isTypedArray;function nn(V,K,G){switch(G.length){case 0:return V.call(K);case 1:return V.call(K,G[0]);case 2:return V.call(K,G[0],G[1]);case 3:return V.call(K,G[0],G[1],G[2])}return V.apply(K,G)}function cQ(V,K,G,ve){for(var Ge=-1,bt=V==null?0:V.length;++Ge-1}function Xu(V,K,G){for(var ve=-1,Ge=V==null?0:V.length;++ve-1;);return G}function $p(V,K){for(var G=V.length;G--&&il(K,V[G],0)>-1;);return G}function bQ(V,K){for(var G=V.length,ve=0;G--;)V[G]===K&&++ve;return ve}var $Q=Eu(Zu),yQ=Eu(Ru);function vQ(V){return"\\"+he[V]}function wQ(V,K){return V==null?t:V[K]}function nl(V){return xu.test(V)}function QQ(V){return Wu.test(V)}function _Q(V){for(var K,G=[];!(K=V.next()).done;)G.push(K.value);return G}function Vu(V){var K=-1,G=Array(V.size);return V.forEach(function(ve,Ge){G[++K]=[Ge,ve]}),G}function yp(V,K){return function(G){return V(K(G))}}function is(V,K){for(var G=-1,ve=V.length,Ge=0,bt=[];++G-1}function h_(f,u){var d=this.__data__,S=of(d,f);return S<0?(++this.size,d.push([f,u])):d[S][1]=u,this}Pr.prototype.clear=a_,Pr.prototype.delete=f_,Pr.prototype.get=c_,Pr.prototype.has=u_,Pr.prototype.set=h_;function xr(f){var u=-1,d=f==null?0:f.length;for(this.clear();++u=u?f:u)),f}function Qn(f,u,d,S,w,x){var T,U=u&O,I=u&p,te=u&g;if(d&&(T=w?d(f,S,w,x):d(f)),T!==t)return T;if(!Nt(f))return f;var ie=Ke(f);if(ie){if(T=gk(f),!U)return ji(f,T)}else{var se=Wi(f),me=se==Ee||se==tt;if(as(f))return ng(f,U);if(se==ut||se==pt||me&&!w){if(T=I||me?{}:vg(f),!U)return I?sk(f,x_(T,f)):rk(f,Rp(T,f))}else{if(!Pt[se])return w?f:{};T=mk(f,se,U)}}x||(x=new Vn);var Ce=x.get(f);if(Ce)return Ce;x.set(f,T),Hg(f)?f.forEach(function(qe){T.add(Qn(qe,u,d,qe,f,x))}):Fg(f)&&f.forEach(function(qe,ct){T.set(ct,Qn(qe,u,d,ct,f,x))});var Ve=te?I?dh:Oh:I?Fi:Si,rt=ie?t:Ve(f);return yn(rt||f,function(qe,ct){rt&&(ct=qe,qe=f[ct]),po(T,ct,Qn(qe,u,d,ct,f,x))}),T}function W_(f){var u=Si(f);return function(d){return Xp(d,f,u)}}function Xp(f,u,d){var S=d.length;if(f==null)return!S;for(f=Rt(f);S--;){var w=d[S],x=u[w],T=f[w];if(T===t&&!(w in f)||!x(T))return!1}return!0}function Ap(f,u,d){if(typeof f!="function")throw new vn(l);return vo(function(){f.apply(t,d)},u)}function go(f,u,d,S){var w=-1,x=qa,T=!0,U=f.length,I=[],te=u.length;if(!U)return I;d&&(u=It(u,rn(d))),S?(x=Xu,T=!1):u.length>=r&&(x=ao,T=!1,u=new Ys(u));e:for(;++ww?0:w+d),S=S===t||S>w?w:nt(S),S<0&&(S+=w),S=d>S?0:Jg(S);d0&&d(U)?u>1?vi(U,u-1,d,S,w):ts(w,U):S||(w[w.length]=U)}return w}var Fu=fg(),Ep=fg(!0);function rr(f,u){return f&&Fu(f,u,Si)}function Gu(f,u){return f&&Ep(f,u,Si)}function ff(f,u){return es(u,function(d){return Rr(f[d])})}function Es(f,u){u=ls(u,f);for(var d=0,S=u.length;f!=null&&du}function Z_(f,u){return f!=null&&yt.call(f,u)}function R_(f,u){return f!=null&&u in Rt(f)}function X_(f,u,d){return f>=xi(u,d)&&f=120&&ie.length>=120)?new Ys(T&&ie):t}ie=f[0];var se=-1,me=U[0];e:for(;++se-1;)U!==f&&Ja.call(U,I,1),Ja.call(f,I,1);return f}function Fp(f,u){for(var d=f?u.length:0,S=d-1;d--;){var w=u[d];if(d==S||w!==x){var x=w;Zr(w)?Ja.call(f,w,1):lh(f,w)}}return f}function nh(f,u){return f+nf(Wp()*(u-f+1))}function j_(f,u,d,S){for(var w=-1,x=fi(tf((u-f)/(d||1)),0),T=G(x);x--;)T[S?x:++w]=f,f+=d;return T}function rh(f,u){var d="";if(!f||u<1||u>Ue)return d;do u%2&&(d+=f),u=nf(u/2),u&&(f+=f);while(u);return d}function ot(f,u){return yh(_g(f,u,Gi),f+"")}function B_(f){return Zp(dl(f))}function F_(f,u){var d=dl(f);return $f(d,Us(u,0,d.length))}function bo(f,u,d,S){if(!Nt(f))return f;u=ls(u,f);for(var w=-1,x=u.length,T=x-1,U=f;U!=null&&++ww?0:w+u),d=d>w?w:d,d<0&&(d+=w),w=u>d?0:d-u>>>0,u>>>=0;for(var x=G(w);++S>>1,T=f[x];T!==null&&!ln(T)&&(d?T<=u:T=r){var te=u?null:fk(f);if(te)return La(te);T=!1,w=ao,I=new Ys}else I=u?[]:U;e:for(;++S=S?f:_n(f,u,d)}var ig=MQ||function(f){return Ze.clearTimeout(f)};function ng(f,u){if(u)return f.slice();var d=f.length,S=Qp?Qp(d):new f.constructor(d);return f.copy(S),S}function ch(f){var u=new f.constructor(f.byteLength);return new Ha(u).set(new Ha(f)),u}function ek(f,u){var d=u?ch(f.buffer):f.buffer;return new f.constructor(d,f.byteOffset,f.byteLength)}function tk(f){var u=new f.constructor(f.source,Qr.exec(f));return u.lastIndex=f.lastIndex,u}function ik(f){return Oo?Rt(Oo.call(f)):{}}function rg(f,u){var d=u?ch(f.buffer):f.buffer;return new f.constructor(d,f.byteOffset,f.length)}function sg(f,u){if(f!==u){var d=f!==t,S=f===null,w=f===f,x=ln(f),T=u!==t,U=u===null,I=u===u,te=ln(u);if(!U&&!te&&!x&&f>u||x&&T&&I&&!U&&!te||S&&T&&I||!d&&I||!w)return 1;if(!S&&!x&&!te&&f=U)return I;var te=d[S];return I*(te=="desc"?-1:1)}}return f.index-u.index}function lg(f,u,d,S){for(var w=-1,x=f.length,T=d.length,U=-1,I=u.length,te=fi(x-T,0),ie=G(I+te),se=!S;++U1?d[w-1]:t,T=w>2?d[2]:t;for(x=f.length>3&&typeof x=="function"?(w--,x):t,T&&Vi(d[0],d[1],T)&&(x=w<3?t:x,w=1),u=Rt(u);++S-1?w[x?u[T]:T]:t}}function hg(f){return Tr(function(u){var d=u.length,S=d,w=wn.prototype.thru;for(f&&u.reverse();S--;){var x=u[S];if(typeof x!="function")throw new vn(l);if(w&&!T&&Sf(x)=="wrapper")var T=new wn([],!0)}for(S=T?S:d;++S1&&dt.reverse(),ie&&IU))return!1;var te=x.get(f),ie=x.get(u);if(te&&ie)return te==u&&ie==f;var se=-1,me=!0,Ce=d&$?new Ys:t;for(x.set(f,u),x.set(u,f);++se1?"& ":"")+u[S],u=u.join(d>2?", ":" "),f.replace(nr,`{ + */jc.exports;(function(n,e){(function(){var t,i="4.17.21",r=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",l="Expected a function",o="Invalid `variable` option passed into `_.template`",a="__lodash_hash_undefined__",c=500,h="__lodash_placeholder__",O=1,p=2,g=4,m=1,$=2,y=1,_=2,x=4,R=8,A=16,C=32,z=64,V=128,M=256,B=512,N=30,G="...",U=800,re=16,ae=1,ye=2,Se=3,ge=1/0,Ue=9007199254740991,Ie=17976931348623157e292,ke=NaN,xe=4294967295,lt=xe-1,Vt=xe>>>1,Qt=[["ary",V],["bind",y],["bindKey",_],["curry",R],["curryRight",A],["flip",B],["partial",C],["partialRight",z],["rearg",M]],pt="[object Arguments]",qt="[object Array]",$e="[object AsyncFunction]",oe="[object Boolean]",H="[object Date]",ue="[object DOMException]",ce="[object Error]",Ee="[object Function]",tt="[object GeneratorFunction]",ft="[object Map]",je="[object Number]",At="[object Null]",ut="[object Object]",En="[object Promise]",_t="[object Proxy]",Wt="[object RegExp]",St="[object Set]",Be="[object String]",fe="[object Symbol]",Fe="[object Undefined]",He="[object WeakMap]",gi="[object WeakSet]",xt="[object ArrayBuffer]",gt="[object DataView]",zn="[object Float32Array]",oi="[object Float64Array]",Ht="[object Int8Array]",gn="[object Int16Array]",Ct="[object Int32Array]",De="[object Uint8Array]",mn="[object Uint8ClampedArray]",ri="[object Uint16Array]",Kt="[object Uint32Array]",Sn=/\b__p \+= '';/g,tr=/\b(__p \+=) '' \+/g,Nr=/(__e\(.*?\)|\b__t\)) \+\n'';/g,zt=/&(?:amp|lt|gt|quot|#39);/g,Ts=/[&<>"']/g,Zs=RegExp(zt.source),Hl=RegExp(Ts.source),jr=/<%-([\s\S]+?)%>/g,Pi=/<%([\s\S]+?)%>/g,J=/<%=([\s\S]+?)%>/g,we=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,tn=/^\w*$/,Br=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Mn=/[\\^$.*+?()[\]{}|]/g,vr=RegExp(Mn.source),ir=/^\s+/,Rs=/\s/,nr=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,kt=/\{\n\/\* \[wrapped with (.+)\] \*/,wr=/,? & /,Fr=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Kl=/[()=,{}\[\]\/\s]/,Jl=/\\(\\)?/g,Qa=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Qr=/\w*$/,_r=/^[-+]0x[0-9a-f]+$/i,eo=/^0b[01]+$/i,el=/^\[object .+?Constructor\]$/,fu=/^0o[0-7]+$/i,_a=/^(?:0|[1-9]\d*)$/,ka=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,kr=/($^)/,Pa=/['\n\r\u2028\u2029\\]/g,tl="\\ud800-\\udfff",cu="\\u0300-\\u036f",uu="\\ufe20-\\ufe2f",bn="\\u20d0-\\u20ff",Gr=cu+uu+bn,Hr="\\u2700-\\u27bf",to="a-z\\xdf-\\xf6\\xf8-\\xff",hu="\\xac\\xb1\\xd7\\xf7",Ou="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",du="\\u2000-\\u206f",pu=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Wa="A-Z\\xc0-\\xd6\\xd8-\\xde",xa="\\ufe0e\\ufe0f",Ca=hu+Ou+du+pu,io="['’]",gu="["+tl+"]",Ta="["+Ca+"]",il="["+Gr+"]",Za="\\d+",mu="["+Hr+"]",Ra="["+to+"]",Xa="[^"+tl+Ca+Za+Hr+to+Wa+"]",no="\\ud83c[\\udffb-\\udfff]",Su="(?:"+il+"|"+no+")",Aa="[^"+tl+"]",ro="(?:\\ud83c[\\udde6-\\uddff]){2}",so="[\\ud800-\\udbff][\\udc00-\\udfff]",Kr="["+Wa+"]",Ya="\\u200d",Ua="(?:"+Ra+"|"+Xa+")",bu="(?:"+Kr+"|"+Xa+")",Ea="(?:"+io+"(?:d|ll|m|re|s|t|ve))?",za="(?:"+io+"(?:D|LL|M|RE|S|T|VE))?",Ma=Su+"?",Da="["+xa+"]?",$u="(?:"+Ya+"(?:"+[Aa,ro,so].join("|")+")"+Da+Ma+")*",yu="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",vu="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",Va=Da+Ma+$u,wu="(?:"+[mu,ro,so].join("|")+")"+Va,Qu="(?:"+[Aa+il+"?",il,ro,so,gu].join("|")+")",_u=RegExp(io,"g"),ku=RegExp(il,"g"),lo=RegExp(no+"(?="+no+")|"+Qu+Va,"g"),Pu=RegExp([Kr+"?"+Ra+"+"+Ea+"(?="+[Ta,Kr,"$"].join("|")+")",bu+"+"+za+"(?="+[Ta,Kr+Ua,"$"].join("|")+")",Kr+"?"+Ua+"+"+Ea,Kr+"+"+za,vu,yu,Za,wu].join("|"),"g"),Wu=RegExp("["+Ya+tl+Gr+xa+"]"),xu=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Cu=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Tu=-1,Tt={};Tt[zn]=Tt[oi]=Tt[Ht]=Tt[gn]=Tt[Ct]=Tt[De]=Tt[mn]=Tt[ri]=Tt[Kt]=!0,Tt[pt]=Tt[qt]=Tt[xt]=Tt[oe]=Tt[gt]=Tt[H]=Tt[ce]=Tt[Ee]=Tt[ft]=Tt[je]=Tt[ut]=Tt[Wt]=Tt[St]=Tt[Be]=Tt[He]=!1;var Pt={};Pt[pt]=Pt[qt]=Pt[xt]=Pt[gt]=Pt[oe]=Pt[H]=Pt[zn]=Pt[oi]=Pt[Ht]=Pt[gn]=Pt[Ct]=Pt[ft]=Pt[je]=Pt[ut]=Pt[Wt]=Pt[St]=Pt[Be]=Pt[fe]=Pt[De]=Pt[mn]=Pt[ri]=Pt[Kt]=!0,Pt[ce]=Pt[Ee]=Pt[He]=!1;var Zu={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"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":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},be=parseFloat,Pe=parseInt,ze=typeof Xo=="object"&&Xo&&Xo.Object===Object&&Xo,it=typeof self=="object"&&self&&self.Object===Object&&self,Ze=ze||it||Function("return this")(),mi=e&&!e.nodeType&&e,Zt=mi&&!0&&n&&!n.nodeType&&n,Jr=Zt&&Zt.exports===mi,oo=Jr&&ze.process,$n=function(){try{var q=Zt&&Zt.require&&Zt.require("util").types;return q||oo&&oo.binding&&oo.binding("util")}catch{}}(),op=$n&&$n.isArrayBuffer,ap=$n&&$n.isDate,fp=$n&&$n.isMap,cp=$n&&$n.isRegExp,up=$n&&$n.isSet,hp=$n&&$n.isTypedArray;function nn(q,K,F){switch(F.length){case 0:return q.call(K);case 1:return q.call(K,F[0]);case 2:return q.call(K,F[0],F[1]);case 3:return q.call(K,F[0],F[1],F[2])}return q.apply(K,F)}function uQ(q,K,F,ve){for(var Ge=-1,bt=q==null?0:q.length;++Ge-1}function Xu(q,K,F){for(var ve=-1,Ge=q==null?0:q.length;++ve-1;);return F}function $p(q,K){for(var F=q.length;F--&&nl(K,q[F],0)>-1;);return F}function $Q(q,K){for(var F=q.length,ve=0;F--;)q[F]===K&&++ve;return ve}var yQ=Eu(Zu),vQ=Eu(Ru);function wQ(q){return"\\"+he[q]}function QQ(q,K){return q==null?t:q[K]}function rl(q){return Wu.test(q)}function _Q(q){return xu.test(q)}function kQ(q){for(var K,F=[];!(K=q.next()).done;)F.push(K.value);return F}function Vu(q){var K=-1,F=Array(q.size);return q.forEach(function(ve,Ge){F[++K]=[Ge,ve]}),F}function yp(q,K){return function(F){return q(K(F))}}function is(q,K){for(var F=-1,ve=q.length,Ge=0,bt=[];++F-1}function O2(f,u){var d=this.__data__,S=of(d,f);return S<0?(++this.size,d.push([f,u])):d[S][1]=u,this}Pr.prototype.clear=f2,Pr.prototype.delete=c2,Pr.prototype.get=u2,Pr.prototype.has=h2,Pr.prototype.set=O2;function Wr(f){var u=-1,d=f==null?0:f.length;for(this.clear();++u=u?f:u)),f}function Qn(f,u,d,S,w,W){var T,E=u&O,I=u&p,te=u&g;if(d&&(T=w?d(f,S,w,W):d(f)),T!==t)return T;if(!Nt(f))return f;var ie=Ke(f);if(ie){if(T=m_(f),!E)return ji(f,T)}else{var se=xi(f),me=se==Ee||se==tt;if(as(f))return ng(f,E);if(se==ut||se==pt||me&&!w){if(T=I||me?{}:vg(f),!E)return I?l_(f,x2(T,f)):s_(f,Rp(T,f))}else{if(!Pt[se])return w?f:{};T=S_(f,se,E)}}W||(W=new Vn);var Ce=W.get(f);if(Ce)return Ce;W.set(f,T),Hg(f)?f.forEach(function(qe){T.add(Qn(qe,u,d,qe,f,W))}):Fg(f)&&f.forEach(function(qe,ct){T.set(ct,Qn(qe,u,d,ct,f,W))});var Ve=te?I?dh:Oh:I?Fi:Si,rt=ie?t:Ve(f);return yn(rt||f,function(qe,ct){rt&&(ct=qe,qe=f[ct]),po(T,ct,Qn(qe,u,d,ct,f,W))}),T}function C2(f){var u=Si(f);return function(d){return Xp(d,f,u)}}function Xp(f,u,d){var S=d.length;if(f==null)return!S;for(f=Rt(f);S--;){var w=d[S],W=u[w],T=f[w];if(T===t&&!(w in f)||!W(T))return!1}return!0}function Ap(f,u,d){if(typeof f!="function")throw new vn(l);return vo(function(){f.apply(t,d)},u)}function go(f,u,d,S){var w=-1,W=qa,T=!0,E=f.length,I=[],te=u.length;if(!E)return I;d&&(u=It(u,rn(d))),S?(W=Xu,T=!1):u.length>=r&&(W=ao,T=!1,u=new Ys(u));e:for(;++ww?0:w+d),S=S===t||S>w?w:nt(S),S<0&&(S+=w),S=d>S?0:Jg(S);d0&&d(E)?u>1?vi(E,u-1,d,S,w):ts(w,E):S||(w[w.length]=E)}return w}var Fu=fg(),Ep=fg(!0);function rr(f,u){return f&&Fu(f,u,Si)}function Gu(f,u){return f&&Ep(f,u,Si)}function ff(f,u){return es(u,function(d){return Rr(f[d])})}function Es(f,u){u=ls(u,f);for(var d=0,S=u.length;f!=null&&du}function R2(f,u){return f!=null&&yt.call(f,u)}function X2(f,u){return f!=null&&u in Rt(f)}function A2(f,u,d){return f>=Wi(u,d)&&f=120&&ie.length>=120)?new Ys(T&&ie):t}ie=f[0];var se=-1,me=E[0];e:for(;++se-1;)E!==f&&Ja.call(E,I,1),Ja.call(f,I,1);return f}function Fp(f,u){for(var d=f?u.length:0,S=d-1;d--;){var w=u[d];if(d==S||w!==W){var W=w;Zr(w)?Ja.call(f,w,1):lh(f,w)}}return f}function nh(f,u){return f+nf(xp()*(u-f+1))}function B2(f,u,d,S){for(var w=-1,W=fi(tf((u-f)/(d||1)),0),T=F(W);W--;)T[S?W:++w]=f,f+=d;return T}function rh(f,u){var d="";if(!f||u<1||u>Ue)return d;do u%2&&(d+=f),u=nf(u/2),u&&(f+=f);while(u);return d}function ot(f,u){return yh(_g(f,u,Gi),f+"")}function F2(f){return Zp(pl(f))}function G2(f,u){var d=pl(f);return $f(d,Us(u,0,d.length))}function bo(f,u,d,S){if(!Nt(f))return f;u=ls(u,f);for(var w=-1,W=u.length,T=W-1,E=f;E!=null&&++ww?0:w+u),d=d>w?w:d,d<0&&(d+=w),w=u>d?0:d-u>>>0,u>>>=0;for(var W=F(w);++S>>1,T=f[W];T!==null&&!ln(T)&&(d?T<=u:T=r){var te=u?null:c_(f);if(te)return La(te);T=!1,w=ao,I=new Ys}else I=u?[]:E;e:for(;++S=S?f:_n(f,u,d)}var ig=DQ||function(f){return Ze.clearTimeout(f)};function ng(f,u){if(u)return f.slice();var d=f.length,S=Qp?Qp(d):new f.constructor(d);return f.copy(S),S}function ch(f){var u=new f.constructor(f.byteLength);return new Ha(u).set(new Ha(f)),u}function t_(f,u){var d=u?ch(f.buffer):f.buffer;return new f.constructor(d,f.byteOffset,f.byteLength)}function i_(f){var u=new f.constructor(f.source,Qr.exec(f));return u.lastIndex=f.lastIndex,u}function n_(f){return Oo?Rt(Oo.call(f)):{}}function rg(f,u){var d=u?ch(f.buffer):f.buffer;return new f.constructor(d,f.byteOffset,f.length)}function sg(f,u){if(f!==u){var d=f!==t,S=f===null,w=f===f,W=ln(f),T=u!==t,E=u===null,I=u===u,te=ln(u);if(!E&&!te&&!W&&f>u||W&&T&&I&&!E&&!te||S&&T&&I||!d&&I||!w)return 1;if(!S&&!W&&!te&&f=E)return I;var te=d[S];return I*(te=="desc"?-1:1)}}return f.index-u.index}function lg(f,u,d,S){for(var w=-1,W=f.length,T=d.length,E=-1,I=u.length,te=fi(W-T,0),ie=F(I+te),se=!S;++E1?d[w-1]:t,T=w>2?d[2]:t;for(W=f.length>3&&typeof W=="function"?(w--,W):t,T&&Vi(d[0],d[1],T)&&(W=w<3?t:W,w=1),u=Rt(u);++S-1?w[W?u[T]:T]:t}}function hg(f){return Tr(function(u){var d=u.length,S=d,w=wn.prototype.thru;for(f&&u.reverse();S--;){var W=u[S];if(typeof W!="function")throw new vn(l);if(w&&!T&&Sf(W)=="wrapper")var T=new wn([],!0)}for(S=T?S:d;++S1&&dt.reverse(),ie&&IE))return!1;var te=W.get(f),ie=W.get(u);if(te&&ie)return te==u&&ie==f;var se=-1,me=!0,Ce=d&$?new Ys:t;for(W.set(f,u),W.set(u,f);++se1?"& ":"")+u[S],u=u.join(d>2?", ":" "),f.replace(nr,`{ /* [wrapped with `+u+`] */ -`)}function bk(f){return Ke(f)||Ds(f)||!!(Pp&&f&&f[Pp])}function Zr(f,u){var d=typeof f;return u=u??Ue,!!u&&(d=="number"||d!="symbol"&&_a.test(f))&&f>-1&&f%1==0&&f0){if(++u>=L)return arguments[0]}else u=0;return f.apply(t,arguments)}}function $f(f,u){var d=-1,S=f.length,w=S-1;for(u=u===t?S:u;++d1?f[u-1]:t;return d=typeof d=="function"?(f.pop(),d):t,Ug(f,d)});function Eg(f){var u=P(f);return u.__chain__=!0,u}function C2(f,u){return u(f),f}function yf(f,u){return u(f)}var T2=Tr(function(f){var u=f.length,d=u?f[0]:0,S=this.__wrapped__,w=function(x){return Bu(x,f)};return u>1||this.__actions__.length||!(S instanceof ht)||!Zr(d)?this.thru(w):(S=S.slice(d,+d+(u?1:0)),S.__actions__.push({func:yf,args:[w],thisArg:t}),new wn(S,this.__chain__).thru(function(x){return u&&!x.length&&x.push(t),x}))});function Z2(){return Eg(this)}function R2(){return new wn(this.value(),this.__chain__)}function X2(){this.__values__===t&&(this.__values__=Kg(this.value()));var f=this.__index__>=this.__values__.length,u=f?t:this.__values__[this.__index__++];return{done:f,value:u}}function A2(){return this}function Y2(f){for(var u,d=this;d instanceof lf;){var S=Tg(d);S.__index__=0,S.__values__=t,u?w.__wrapped__=S:u=S;var w=S;d=d.__wrapped__}return w.__wrapped__=f,u}function U2(){var f=this.__wrapped__;if(f instanceof ht){var u=f;return this.__actions__.length&&(u=new ht(this)),u=u.reverse(),u.__actions__.push({func:yf,args:[vh],thisArg:t}),new wn(u,this.__chain__)}return this.thru(vh)}function E2(){return eg(this.__wrapped__,this.__actions__)}var z2=Of(function(f,u,d){yt.call(f,d)?++f[d]:Wr(f,d,1)});function M2(f,u,d){var S=Ke(f)?Op:C_;return d&&Vi(f,u,d)&&(u=t),S(f,Me(u,3))}function D2(f,u){var d=Ke(f)?es:Up;return d(f,Me(u,3))}var V2=ug(Zg),q2=ug(Rg);function I2(f,u){return vi(vf(f,u),1)}function L2(f,u){return vi(vf(f,u),ge)}function N2(f,u,d){return d=d===t?1:nt(d),vi(vf(f,u),d)}function zg(f,u){var d=Ke(f)?yn:rs;return d(f,Me(u,3))}function Mg(f,u){var d=Ke(f)?uQ:Yp;return d(f,Me(u,3))}var j2=Of(function(f,u,d){yt.call(f,d)?f[d].push(u):Wr(f,d,[u])});function B2(f,u,d,S){f=Bi(f)?f:dl(f),d=d&&!S?nt(d):0;var w=f.length;return d<0&&(d=fi(w+d,0)),Pf(f)?d<=w&&f.indexOf(u,d)>-1:!!w&&il(f,u,d)>-1}var F2=ot(function(f,u,d){var S=-1,w=typeof u=="function",x=Bi(f)?G(f.length):[];return rs(f,function(T){x[++S]=w?nn(u,T,d):mo(T,u,d)}),x}),G2=Of(function(f,u,d){Wr(f,d,u)});function vf(f,u){var d=Ke(f)?It:qp;return d(f,Me(u,3))}function H2(f,u,d,S){return f==null?[]:(Ke(u)||(u=u==null?[]:[u]),d=S?t:d,Ke(d)||(d=d==null?[]:[d]),jp(f,u,d))}var K2=Of(function(f,u,d){f[d?0:1].push(u)},function(){return[[],[]]});function J2(f,u,d){var S=Ke(f)?Au:mp,w=arguments.length<3;return S(f,Me(u,4),d,w,rs)}function eP(f,u,d){var S=Ke(f)?hQ:mp,w=arguments.length<3;return S(f,Me(u,4),d,w,Yp)}function tP(f,u){var d=Ke(f)?es:Up;return d(f,_f(Me(u,3)))}function iP(f){var u=Ke(f)?Zp:B_;return u(f)}function nP(f,u,d){(d?Vi(f,u,d):u===t)?u=1:u=nt(u);var S=Ke(f)?__:F_;return S(f,u)}function rP(f){var u=Ke(f)?k_:H_;return u(f)}function sP(f){if(f==null)return 0;if(Bi(f))return Pf(f)?rl(f):f.length;var u=Wi(f);return u==ft||u==St?f.size:eh(f).length}function lP(f,u,d){var S=Ke(f)?Yu:K_;return d&&Vi(f,u,d)&&(u=t),S(f,Me(u,3))}var oP=ot(function(f,u){if(f==null)return[];var d=u.length;return d>1&&Vi(f,u[0],u[1])?u=[]:d>2&&Vi(u[0],u[1],u[2])&&(u=[u[0]]),jp(f,vi(u,1),[])}),wf=DQ||function(){return Ze.Date.now()};function aP(f,u){if(typeof u!="function")throw new vn(l);return f=nt(f),function(){if(--f<1)return u.apply(this,arguments)}}function Dg(f,u,d){return u=d?t:u,u=f&&u==null?f.length:u,Cr(f,D,t,t,t,t,u)}function Vg(f,u){var d;if(typeof u!="function")throw new vn(l);return f=nt(f),function(){return--f>0&&(d=u.apply(this,arguments)),f<=1&&(u=t),d}}var Qh=ot(function(f,u,d){var S=y;if(d.length){var w=is(d,hl(Qh));S|=C}return Cr(f,S,u,d,w)}),qg=ot(function(f,u,d){var S=y|_;if(d.length){var w=is(d,hl(qg));S|=C}return Cr(u,S,f,d,w)});function Ig(f,u,d){u=d?t:u;var S=Cr(f,R,t,t,t,t,t,u);return S.placeholder=Ig.placeholder,S}function Lg(f,u,d){u=d?t:u;var S=Cr(f,X,t,t,t,t,t,u);return S.placeholder=Lg.placeholder,S}function Ng(f,u,d){var S,w,x,T,U,I,te=0,ie=!1,se=!1,me=!0;if(typeof f!="function")throw new vn(l);u=Pn(u)||0,Nt(d)&&(ie=!!d.leading,se="maxWait"in d,x=se?fi(Pn(d.maxWait)||0,u):x,me="trailing"in d?!!d.trailing:me);function Ce(ii){var In=S,Ar=w;return S=w=t,te=ii,T=f.apply(Ar,In),T}function Ve(ii){return te=ii,U=vo(ct,u),ie?Ce(ii):T}function rt(ii){var In=ii-I,Ar=ii-te,um=u-In;return se?xi(um,x-Ar):um}function qe(ii){var In=ii-I,Ar=ii-te;return I===t||In>=u||In<0||se&&Ar>=x}function ct(){var ii=wf();if(qe(ii))return dt(ii);U=vo(ct,rt(ii))}function dt(ii){return U=t,me&&S?Ce(ii):(S=w=t,T)}function on(){U!==t&&ig(U),te=0,S=I=w=U=t}function qi(){return U===t?T:dt(wf())}function an(){var ii=wf(),In=qe(ii);if(S=arguments,w=this,I=ii,In){if(U===t)return Ve(I);if(se)return ig(U),U=vo(ct,u),Ce(I)}return U===t&&(U=vo(ct,u)),T}return an.cancel=on,an.flush=qi,an}var fP=ot(function(f,u){return Ap(f,1,u)}),cP=ot(function(f,u,d){return Ap(f,Pn(u)||0,d)});function uP(f){return Cr(f,F)}function Qf(f,u){if(typeof f!="function"||u!=null&&typeof u!="function")throw new vn(l);var d=function(){var S=arguments,w=u?u.apply(this,S):S[0],x=d.cache;if(x.has(w))return x.get(w);var T=f.apply(this,S);return d.cache=x.set(w,T)||x,T};return d.cache=new(Qf.Cache||xr),d}Qf.Cache=xr;function _f(f){if(typeof f!="function")throw new vn(l);return function(){var u=arguments;switch(u.length){case 0:return!f.call(this);case 1:return!f.call(this,u[0]);case 2:return!f.call(this,u[0],u[1]);case 3:return!f.call(this,u[0],u[1],u[2])}return!f.apply(this,u)}}function hP(f){return Vg(2,f)}var OP=J_(function(f,u){u=u.length==1&&Ke(u[0])?It(u[0],rn(Me())):It(vi(u,1),rn(Me()));var d=u.length;return ot(function(S){for(var w=-1,x=xi(S.length,d);++w=u}),Ds=Mp(function(){return arguments}())?Mp:function(f){return Jt(f)&&yt.call(f,"callee")&&!kp.call(f,"callee")},Ke=G.isArray,xP=op?rn(op):Y_;function Bi(f){return f!=null&&kf(f.length)&&!Rr(f)}function ti(f){return Jt(f)&&Bi(f)}function WP(f){return f===!0||f===!1||Jt(f)&&Di(f)==oe}var as=qQ||Yh,CP=ap?rn(ap):U_;function TP(f){return Jt(f)&&f.nodeType===1&&!wo(f)}function ZP(f){if(f==null)return!0;if(Bi(f)&&(Ke(f)||typeof f=="string"||typeof f.splice=="function"||as(f)||Ol(f)||Ds(f)))return!f.length;var u=Wi(f);if(u==ft||u==St)return!f.size;if(yo(f))return!eh(f).length;for(var d in f)if(yt.call(f,d))return!1;return!0}function RP(f,u){return So(f,u)}function XP(f,u,d){d=typeof d=="function"?d:t;var S=d?d(f,u):t;return S===t?So(f,u,t,d):!!S}function kh(f){if(!Jt(f))return!1;var u=Di(f);return u==ce||u==ue||typeof f.message=="string"&&typeof f.name=="string"&&!wo(f)}function AP(f){return typeof f=="number"&&xp(f)}function Rr(f){if(!Nt(f))return!1;var u=Di(f);return u==Ee||u==tt||u==$e||u==_t}function Bg(f){return typeof f=="number"&&f==nt(f)}function kf(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=Ue}function Nt(f){var u=typeof f;return f!=null&&(u=="object"||u=="function")}function Jt(f){return f!=null&&typeof f=="object"}var Fg=fp?rn(fp):z_;function YP(f,u){return f===u||Ju(f,u,gh(u))}function UP(f,u,d){return d=typeof d=="function"?d:t,Ju(f,u,gh(u),d)}function EP(f){return Gg(f)&&f!=+f}function zP(f){if(vk(f))throw new Ge(s);return Dp(f)}function MP(f){return f===null}function DP(f){return f==null}function Gg(f){return typeof f=="number"||Jt(f)&&Di(f)==je}function wo(f){if(!Jt(f)||Di(f)!=ut)return!1;var u=Ka(f);if(u===null)return!0;var d=yt.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&Ba.call(d)==UQ}var Ph=cp?rn(cp):M_;function VP(f){return Bg(f)&&f>=-Ue&&f<=Ue}var Hg=up?rn(up):D_;function Pf(f){return typeof f=="string"||!Ke(f)&&Jt(f)&&Di(f)==Be}function ln(f){return typeof f=="symbol"||Jt(f)&&Di(f)==fe}var Ol=hp?rn(hp):V_;function qP(f){return f===t}function IP(f){return Jt(f)&&Wi(f)==He}function LP(f){return Jt(f)&&Di(f)==gi}var NP=mf(th),jP=mf(function(f,u){return f<=u});function Kg(f){if(!f)return[];if(Bi(f))return Pf(f)?Dn(f):ji(f);if(fo&&f[fo])return _Q(f[fo]());var u=Wi(f),d=u==ft?Vu:u==St?La:dl;return d(f)}function Xr(f){if(!f)return f===0?f:0;if(f=Pn(f),f===ge||f===-ge){var u=f<0?-1:1;return u*Ie}return f===f?f:0}function nt(f){var u=Xr(f),d=u%1;return u===u?d?u-d:u:0}function Jg(f){return f?Us(nt(f),0,We):0}function Pn(f){if(typeof f=="number")return f;if(ln(f))return ke;if(Nt(f)){var u=typeof f.valueOf=="function"?f.valueOf():f;f=Nt(u)?u+"":u}if(typeof f!="string")return f===0?f:+f;f=Sp(f);var d=eo.test(f);return d||fu.test(f)?Pe(f.slice(2),d?2:8):_r.test(f)?ke:+f}function em(f){return sr(f,Fi(f))}function BP(f){return f?Us(nt(f),-Ue,Ue):f===0?f:0}function $t(f){return f==null?"":sn(f)}var FP=cl(function(f,u){if(yo(u)||Bi(u)){sr(u,Si(u),f);return}for(var d in u)yt.call(u,d)&&po(f,d,u[d])}),tm=cl(function(f,u){sr(u,Fi(u),f)}),xf=cl(function(f,u,d,S){sr(u,Fi(u),f,S)}),GP=cl(function(f,u,d,S){sr(u,Si(u),f,S)}),HP=Tr(Bu);function KP(f,u){var d=fl(f);return u==null?d:Rp(d,u)}var JP=ot(function(f,u){f=Rt(f);var d=-1,S=u.length,w=S>2?u[2]:t;for(w&&Vi(u[0],u[1],w)&&(S=1);++d1),x}),sr(f,dh(f),d),S&&(d=Qn(d,O|p|g,ck));for(var w=u.length;w--;)lh(d,u[w]);return d});function mx(f,u){return nm(f,_f(Me(u)))}var Sx=Tr(function(f,u){return f==null?{}:L_(f,u)});function nm(f,u){if(f==null)return{};var d=It(dh(f),function(S){return[S]});return u=Me(u),Bp(f,d,function(S,w){return u(S,w[0])})}function bx(f,u,d){u=ls(u,f);var S=-1,w=u.length;for(w||(w=1,f=t);++Su){var S=f;f=u,u=S}if(d||f%1||u%1){var w=Wp();return xi(f+w*(u-f+be("1e-"+((w+"").length-1))),u)}return nh(f,u)}var Cx=ul(function(f,u,d){return u=u.toLowerCase(),f+(d?lm(u):u)});function lm(f){return Ch($t(f).toLowerCase())}function om(f){return f=$t(f),f&&f.replace(ka,$Q).replace(ku,"")}function Tx(f,u,d){f=$t(f),u=sn(u);var S=f.length;d=d===t?S:Us(nt(d),0,S);var w=d;return d-=u.length,d>=0&&f.slice(d,w)==u}function Zx(f){return f=$t(f),f&&Hl.test(f)?f.replace(Ts,yQ):f}function Rx(f){return f=$t(f),f&&vr.test(f)?f.replace(Mn,"\\$&"):f}var Xx=ul(function(f,u,d){return f+(d?"-":"")+u.toLowerCase()}),Ax=ul(function(f,u,d){return f+(d?" ":"")+u.toLowerCase()}),Yx=cg("toLowerCase");function Ux(f,u,d){f=$t(f),u=nt(u);var S=u?rl(f):0;if(!u||S>=u)return f;var w=(u-S)/2;return gf(nf(w),d)+f+gf(tf(w),d)}function Ex(f,u,d){f=$t(f),u=nt(u);var S=u?rl(f):0;return u&&S>>0,d?(f=$t(f),f&&(typeof u=="string"||u!=null&&!Ph(u))&&(u=sn(u),!u&&nl(f))?os(Dn(f),0,d):f.split(u,d)):[]}var Lx=ul(function(f,u,d){return f+(d?" ":"")+Ch(u)});function Nx(f,u,d){return f=$t(f),d=d==null?0:Us(nt(d),0,f.length),u=sn(u),f.slice(d,d+u.length)==u}function jx(f,u,d){var S=P.templateSettings;d&&Vi(f,u,d)&&(u=t),f=$t(f),u=xf({},u,S,mg);var w=xf({},u.imports,S.imports,mg),x=Si(w),T=Du(w,x),U,I,te=0,ie=u.interpolate||kr,se="__p += '",me=qu((u.escape||kr).source+"|"+ie.source+"|"+(ie===J?Qa:kr).source+"|"+(u.evaluate||kr).source+"|$","g"),Ce="//# sourceURL="+(yt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tu+"]")+` -`;f.replace(me,function(qe,ct,dt,on,qi,an){return dt||(dt=on),se+=f.slice(te,an).replace(Pa,vQ),ct&&(U=!0,se+=`' + +`)}function $_(f){return Ke(f)||Ds(f)||!!(Pp&&f&&f[Pp])}function Zr(f,u){var d=typeof f;return u=u??Ue,!!u&&(d=="number"||d!="symbol"&&_a.test(f))&&f>-1&&f%1==0&&f0){if(++u>=U)return arguments[0]}else u=0;return f.apply(t,arguments)}}function $f(f,u){var d=-1,S=f.length,w=S-1;for(u=u===t?S:u;++d1?f[u-1]:t;return d=typeof d=="function"?(f.pop(),d):t,Ug(f,d)});function Eg(f){var u=P(f);return u.__chain__=!0,u}function Tk(f,u){return u(f),f}function yf(f,u){return u(f)}var Zk=Tr(function(f){var u=f.length,d=u?f[0]:0,S=this.__wrapped__,w=function(W){return Bu(W,f)};return u>1||this.__actions__.length||!(S instanceof ht)||!Zr(d)?this.thru(w):(S=S.slice(d,+d+(u?1:0)),S.__actions__.push({func:yf,args:[w],thisArg:t}),new wn(S,this.__chain__).thru(function(W){return u&&!W.length&&W.push(t),W}))});function Rk(){return Eg(this)}function Xk(){return new wn(this.value(),this.__chain__)}function Ak(){this.__values__===t&&(this.__values__=Kg(this.value()));var f=this.__index__>=this.__values__.length,u=f?t:this.__values__[this.__index__++];return{done:f,value:u}}function Yk(){return this}function Uk(f){for(var u,d=this;d instanceof lf;){var S=Tg(d);S.__index__=0,S.__values__=t,u?w.__wrapped__=S:u=S;var w=S;d=d.__wrapped__}return w.__wrapped__=f,u}function Ek(){var f=this.__wrapped__;if(f instanceof ht){var u=f;return this.__actions__.length&&(u=new ht(this)),u=u.reverse(),u.__actions__.push({func:yf,args:[vh],thisArg:t}),new wn(u,this.__chain__)}return this.thru(vh)}function zk(){return eg(this.__wrapped__,this.__actions__)}var Mk=Of(function(f,u,d){yt.call(f,d)?++f[d]:xr(f,d,1)});function Dk(f,u,d){var S=Ke(f)?Op:T2;return d&&Vi(f,u,d)&&(u=t),S(f,Me(u,3))}function Vk(f,u){var d=Ke(f)?es:Up;return d(f,Me(u,3))}var qk=ug(Zg),Ik=ug(Rg);function Lk(f,u){return vi(vf(f,u),1)}function Nk(f,u){return vi(vf(f,u),ge)}function jk(f,u,d){return d=d===t?1:nt(d),vi(vf(f,u),d)}function zg(f,u){var d=Ke(f)?yn:rs;return d(f,Me(u,3))}function Mg(f,u){var d=Ke(f)?hQ:Yp;return d(f,Me(u,3))}var Bk=Of(function(f,u,d){yt.call(f,d)?f[d].push(u):xr(f,d,[u])});function Fk(f,u,d,S){f=Bi(f)?f:pl(f),d=d&&!S?nt(d):0;var w=f.length;return d<0&&(d=fi(w+d,0)),Pf(f)?d<=w&&f.indexOf(u,d)>-1:!!w&&nl(f,u,d)>-1}var Gk=ot(function(f,u,d){var S=-1,w=typeof u=="function",W=Bi(f)?F(f.length):[];return rs(f,function(T){W[++S]=w?nn(u,T,d):mo(T,u,d)}),W}),Hk=Of(function(f,u,d){xr(f,d,u)});function vf(f,u){var d=Ke(f)?It:qp;return d(f,Me(u,3))}function Kk(f,u,d,S){return f==null?[]:(Ke(u)||(u=u==null?[]:[u]),d=S?t:d,Ke(d)||(d=d==null?[]:[d]),jp(f,u,d))}var Jk=Of(function(f,u,d){f[d?0:1].push(u)},function(){return[[],[]]});function eP(f,u,d){var S=Ke(f)?Au:mp,w=arguments.length<3;return S(f,Me(u,4),d,w,rs)}function tP(f,u,d){var S=Ke(f)?OQ:mp,w=arguments.length<3;return S(f,Me(u,4),d,w,Yp)}function iP(f,u){var d=Ke(f)?es:Up;return d(f,_f(Me(u,3)))}function nP(f){var u=Ke(f)?Zp:F2;return u(f)}function rP(f,u,d){(d?Vi(f,u,d):u===t)?u=1:u=nt(u);var S=Ke(f)?k2:G2;return S(f,u)}function sP(f){var u=Ke(f)?P2:K2;return u(f)}function lP(f){if(f==null)return 0;if(Bi(f))return Pf(f)?sl(f):f.length;var u=xi(f);return u==ft||u==St?f.size:eh(f).length}function oP(f,u,d){var S=Ke(f)?Yu:J2;return d&&Vi(f,u,d)&&(u=t),S(f,Me(u,3))}var aP=ot(function(f,u){if(f==null)return[];var d=u.length;return d>1&&Vi(f,u[0],u[1])?u=[]:d>2&&Vi(u[0],u[1],u[2])&&(u=[u[0]]),jp(f,vi(u,1),[])}),wf=VQ||function(){return Ze.Date.now()};function fP(f,u){if(typeof u!="function")throw new vn(l);return f=nt(f),function(){if(--f<1)return u.apply(this,arguments)}}function Dg(f,u,d){return u=d?t:u,u=f&&u==null?f.length:u,Cr(f,V,t,t,t,t,u)}function Vg(f,u){var d;if(typeof u!="function")throw new vn(l);return f=nt(f),function(){return--f>0&&(d=u.apply(this,arguments)),f<=1&&(u=t),d}}var Qh=ot(function(f,u,d){var S=y;if(d.length){var w=is(d,Ol(Qh));S|=C}return Cr(f,S,u,d,w)}),qg=ot(function(f,u,d){var S=y|_;if(d.length){var w=is(d,Ol(qg));S|=C}return Cr(u,S,f,d,w)});function Ig(f,u,d){u=d?t:u;var S=Cr(f,R,t,t,t,t,t,u);return S.placeholder=Ig.placeholder,S}function Lg(f,u,d){u=d?t:u;var S=Cr(f,A,t,t,t,t,t,u);return S.placeholder=Lg.placeholder,S}function Ng(f,u,d){var S,w,W,T,E,I,te=0,ie=!1,se=!1,me=!0;if(typeof f!="function")throw new vn(l);u=Pn(u)||0,Nt(d)&&(ie=!!d.leading,se="maxWait"in d,W=se?fi(Pn(d.maxWait)||0,u):W,me="trailing"in d?!!d.trailing:me);function Ce(ii){var In=S,Ar=w;return S=w=t,te=ii,T=f.apply(Ar,In),T}function Ve(ii){return te=ii,E=vo(ct,u),ie?Ce(ii):T}function rt(ii){var In=ii-I,Ar=ii-te,um=u-In;return se?Wi(um,W-Ar):um}function qe(ii){var In=ii-I,Ar=ii-te;return I===t||In>=u||In<0||se&&Ar>=W}function ct(){var ii=wf();if(qe(ii))return dt(ii);E=vo(ct,rt(ii))}function dt(ii){return E=t,me&&S?Ce(ii):(S=w=t,T)}function on(){E!==t&&ig(E),te=0,S=I=w=E=t}function qi(){return E===t?T:dt(wf())}function an(){var ii=wf(),In=qe(ii);if(S=arguments,w=this,I=ii,In){if(E===t)return Ve(I);if(se)return ig(E),E=vo(ct,u),Ce(I)}return E===t&&(E=vo(ct,u)),T}return an.cancel=on,an.flush=qi,an}var cP=ot(function(f,u){return Ap(f,1,u)}),uP=ot(function(f,u,d){return Ap(f,Pn(u)||0,d)});function hP(f){return Cr(f,B)}function Qf(f,u){if(typeof f!="function"||u!=null&&typeof u!="function")throw new vn(l);var d=function(){var S=arguments,w=u?u.apply(this,S):S[0],W=d.cache;if(W.has(w))return W.get(w);var T=f.apply(this,S);return d.cache=W.set(w,T)||W,T};return d.cache=new(Qf.Cache||Wr),d}Qf.Cache=Wr;function _f(f){if(typeof f!="function")throw new vn(l);return function(){var u=arguments;switch(u.length){case 0:return!f.call(this);case 1:return!f.call(this,u[0]);case 2:return!f.call(this,u[0],u[1]);case 3:return!f.call(this,u[0],u[1],u[2])}return!f.apply(this,u)}}function OP(f){return Vg(2,f)}var dP=e_(function(f,u){u=u.length==1&&Ke(u[0])?It(u[0],rn(Me())):It(vi(u,1),rn(Me()));var d=u.length;return ot(function(S){for(var w=-1,W=Wi(S.length,d);++w=u}),Ds=Mp(function(){return arguments}())?Mp:function(f){return Jt(f)&&yt.call(f,"callee")&&!kp.call(f,"callee")},Ke=F.isArray,xP=op?rn(op):U2;function Bi(f){return f!=null&&kf(f.length)&&!Rr(f)}function ti(f){return Jt(f)&&Bi(f)}function CP(f){return f===!0||f===!1||Jt(f)&&Di(f)==oe}var as=IQ||Yh,TP=ap?rn(ap):E2;function ZP(f){return Jt(f)&&f.nodeType===1&&!wo(f)}function RP(f){if(f==null)return!0;if(Bi(f)&&(Ke(f)||typeof f=="string"||typeof f.splice=="function"||as(f)||dl(f)||Ds(f)))return!f.length;var u=xi(f);if(u==ft||u==St)return!f.size;if(yo(f))return!eh(f).length;for(var d in f)if(yt.call(f,d))return!1;return!0}function XP(f,u){return So(f,u)}function AP(f,u,d){d=typeof d=="function"?d:t;var S=d?d(f,u):t;return S===t?So(f,u,t,d):!!S}function kh(f){if(!Jt(f))return!1;var u=Di(f);return u==ce||u==ue||typeof f.message=="string"&&typeof f.name=="string"&&!wo(f)}function YP(f){return typeof f=="number"&&Wp(f)}function Rr(f){if(!Nt(f))return!1;var u=Di(f);return u==Ee||u==tt||u==$e||u==_t}function Bg(f){return typeof f=="number"&&f==nt(f)}function kf(f){return typeof f=="number"&&f>-1&&f%1==0&&f<=Ue}function Nt(f){var u=typeof f;return f!=null&&(u=="object"||u=="function")}function Jt(f){return f!=null&&typeof f=="object"}var Fg=fp?rn(fp):M2;function UP(f,u){return f===u||Ju(f,u,gh(u))}function EP(f,u,d){return d=typeof d=="function"?d:t,Ju(f,u,gh(u),d)}function zP(f){return Gg(f)&&f!=+f}function MP(f){if(w_(f))throw new Ge(s);return Dp(f)}function DP(f){return f===null}function VP(f){return f==null}function Gg(f){return typeof f=="number"||Jt(f)&&Di(f)==je}function wo(f){if(!Jt(f)||Di(f)!=ut)return!1;var u=Ka(f);if(u===null)return!0;var d=yt.call(u,"constructor")&&u.constructor;return typeof d=="function"&&d instanceof d&&Ba.call(d)==EQ}var Ph=cp?rn(cp):D2;function qP(f){return Bg(f)&&f>=-Ue&&f<=Ue}var Hg=up?rn(up):V2;function Pf(f){return typeof f=="string"||!Ke(f)&&Jt(f)&&Di(f)==Be}function ln(f){return typeof f=="symbol"||Jt(f)&&Di(f)==fe}var dl=hp?rn(hp):q2;function IP(f){return f===t}function LP(f){return Jt(f)&&xi(f)==He}function NP(f){return Jt(f)&&Di(f)==gi}var jP=mf(th),BP=mf(function(f,u){return f<=u});function Kg(f){if(!f)return[];if(Bi(f))return Pf(f)?Dn(f):ji(f);if(fo&&f[fo])return kQ(f[fo]());var u=xi(f),d=u==ft?Vu:u==St?La:pl;return d(f)}function Xr(f){if(!f)return f===0?f:0;if(f=Pn(f),f===ge||f===-ge){var u=f<0?-1:1;return u*Ie}return f===f?f:0}function nt(f){var u=Xr(f),d=u%1;return u===u?d?u-d:u:0}function Jg(f){return f?Us(nt(f),0,xe):0}function Pn(f){if(typeof f=="number")return f;if(ln(f))return ke;if(Nt(f)){var u=typeof f.valueOf=="function"?f.valueOf():f;f=Nt(u)?u+"":u}if(typeof f!="string")return f===0?f:+f;f=Sp(f);var d=eo.test(f);return d||fu.test(f)?Pe(f.slice(2),d?2:8):_r.test(f)?ke:+f}function em(f){return sr(f,Fi(f))}function FP(f){return f?Us(nt(f),-Ue,Ue):f===0?f:0}function $t(f){return f==null?"":sn(f)}var GP=ul(function(f,u){if(yo(u)||Bi(u)){sr(u,Si(u),f);return}for(var d in u)yt.call(u,d)&&po(f,d,u[d])}),tm=ul(function(f,u){sr(u,Fi(u),f)}),Wf=ul(function(f,u,d,S){sr(u,Fi(u),f,S)}),HP=ul(function(f,u,d,S){sr(u,Si(u),f,S)}),KP=Tr(Bu);function JP(f,u){var d=cl(f);return u==null?d:Rp(d,u)}var eW=ot(function(f,u){f=Rt(f);var d=-1,S=u.length,w=S>2?u[2]:t;for(w&&Vi(u[0],u[1],w)&&(S=1);++d1),W}),sr(f,dh(f),d),S&&(d=Qn(d,O|p|g,u_));for(var w=u.length;w--;)lh(d,u[w]);return d});function SW(f,u){return nm(f,_f(Me(u)))}var bW=Tr(function(f,u){return f==null?{}:N2(f,u)});function nm(f,u){if(f==null)return{};var d=It(dh(f),function(S){return[S]});return u=Me(u),Bp(f,d,function(S,w){return u(S,w[0])})}function $W(f,u,d){u=ls(u,f);var S=-1,w=u.length;for(w||(w=1,f=t);++Su){var S=f;f=u,u=S}if(d||f%1||u%1){var w=xp();return Wi(f+w*(u-f+be("1e-"+((w+"").length-1))),u)}return nh(f,u)}var TW=hl(function(f,u,d){return u=u.toLowerCase(),f+(d?lm(u):u)});function lm(f){return Ch($t(f).toLowerCase())}function om(f){return f=$t(f),f&&f.replace(ka,yQ).replace(ku,"")}function ZW(f,u,d){f=$t(f),u=sn(u);var S=f.length;d=d===t?S:Us(nt(d),0,S);var w=d;return d-=u.length,d>=0&&f.slice(d,w)==u}function RW(f){return f=$t(f),f&&Hl.test(f)?f.replace(Ts,vQ):f}function XW(f){return f=$t(f),f&&vr.test(f)?f.replace(Mn,"\\$&"):f}var AW=hl(function(f,u,d){return f+(d?"-":"")+u.toLowerCase()}),YW=hl(function(f,u,d){return f+(d?" ":"")+u.toLowerCase()}),UW=cg("toLowerCase");function EW(f,u,d){f=$t(f),u=nt(u);var S=u?sl(f):0;if(!u||S>=u)return f;var w=(u-S)/2;return gf(nf(w),d)+f+gf(tf(w),d)}function zW(f,u,d){f=$t(f),u=nt(u);var S=u?sl(f):0;return u&&S>>0,d?(f=$t(f),f&&(typeof u=="string"||u!=null&&!Ph(u))&&(u=sn(u),!u&&rl(f))?os(Dn(f),0,d):f.split(u,d)):[]}var NW=hl(function(f,u,d){return f+(d?" ":"")+Ch(u)});function jW(f,u,d){return f=$t(f),d=d==null?0:Us(nt(d),0,f.length),u=sn(u),f.slice(d,d+u.length)==u}function BW(f,u,d){var S=P.templateSettings;d&&Vi(f,u,d)&&(u=t),f=$t(f),u=Wf({},u,S,mg);var w=Wf({},u.imports,S.imports,mg),W=Si(w),T=Du(w,W),E,I,te=0,ie=u.interpolate||kr,se="__p += '",me=qu((u.escape||kr).source+"|"+ie.source+"|"+(ie===J?Qa:kr).source+"|"+(u.evaluate||kr).source+"|$","g"),Ce="//# sourceURL="+(yt.call(u,"sourceURL")?(u.sourceURL+"").replace(/\s/g," "):"lodash.templateSources["+ ++Tu+"]")+` +`;f.replace(me,function(qe,ct,dt,on,qi,an){return dt||(dt=on),se+=f.slice(te,an).replace(Pa,wQ),ct&&(E=!0,se+=`' + __e(`+ct+`) + '`),qi&&(I=!0,se+=`'; `+qi+`; @@ -47,13 +47,13 @@ __p += '`),dt&&(se+=`' + } `;else if(Kl.test(Ve))throw new Ge(o);se=(I?se.replace(Sn,""):se).replace(tr,"$1").replace(Nr,"$1;"),se="function("+(Ve||"obj")+`) { `+(Ve?"":`obj || (obj = {}); -`)+"var __t, __p = ''"+(U?", __e = _.escape":"")+(I?`, __j = Array.prototype.join; +`)+"var __t, __p = ''"+(E?", __e = _.escape":"")+(I?`, __j = Array.prototype.join; function print() { __p += __j.call(arguments, '') } `:`; `)+se+`return __p -}`;var rt=fm(function(){return bt(x,Ce+"return "+se).apply(t,T)});if(rt.source=se,kh(rt))throw rt;return rt}function Bx(f){return $t(f).toLowerCase()}function Fx(f){return $t(f).toUpperCase()}function Gx(f,u,d){if(f=$t(f),f&&(d||u===t))return Sp(f);if(!f||!(u=sn(u)))return f;var S=Dn(f),w=Dn(u),x=bp(S,w),T=$p(S,w)+1;return os(S,x,T).join("")}function Hx(f,u,d){if(f=$t(f),f&&(d||u===t))return f.slice(0,vp(f)+1);if(!f||!(u=sn(u)))return f;var S=Dn(f),w=$p(S,Dn(u))+1;return os(S,0,w).join("")}function Kx(f,u,d){if(f=$t(f),f&&(d||u===t))return f.replace(ir,"");if(!f||!(u=sn(u)))return f;var S=Dn(f),w=bp(S,Dn(u));return os(S,w).join("")}function Jx(f,u){var d=B,S=q;if(Nt(u)){var w="separator"in u?u.separator:w;d="length"in u?nt(u.length):d,S="omission"in u?sn(u.omission):S}f=$t(f);var x=f.length;if(nl(f)){var T=Dn(f);x=T.length}if(d>=x)return f;var U=d-rl(S);if(U<1)return S;var I=T?os(T,0,U).join(""):f.slice(0,U);if(w===t)return I+S;if(T&&(U+=I.length-U),Ph(w)){if(f.slice(U).search(w)){var te,ie=I;for(w.global||(w=qu(w.source,$t(Qr.exec(w))+"g")),w.lastIndex=0;te=w.exec(ie);)var se=te.index;I=I.slice(0,se===t?U:se)}}else if(f.indexOf(sn(w),U)!=U){var me=I.lastIndexOf(w);me>-1&&(I=I.slice(0,me))}return I+S}function eW(f){return f=$t(f),f&&Zs.test(f)?f.replace(zt,WQ):f}var tW=ul(function(f,u,d){return f+(d?" ":"")+u.toUpperCase()}),Ch=cg("toUpperCase");function am(f,u,d){return f=$t(f),u=d?t:u,u===t?QQ(f)?ZQ(f):pQ(f):f.match(u)||[]}var fm=ot(function(f,u){try{return nn(f,t,u)}catch(d){return kh(d)?d:new Ge(d)}}),iW=Tr(function(f,u){return yn(u,function(d){d=lr(d),Wr(f,d,Qh(f[d],f))}),f});function nW(f){var u=f==null?0:f.length,d=Me();return f=u?It(f,function(S){if(typeof S[1]!="function")throw new vn(l);return[d(S[0]),S[1]]}):[],ot(function(S){for(var w=-1;++wUe)return[];var d=We,S=xi(f,We);u=Me(u),f-=We;for(var w=Mu(S,u);++d0||u<0)?new ht(d):(f<0?d=d.takeRight(-f):f&&(d=d.drop(f)),u!==t&&(u=nt(u),d=u<0?d.dropRight(-u):d.take(u-f)),d)},ht.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},ht.prototype.toArray=function(){return this.take(We)},rr(ht.prototype,function(f,u){var d=/^(?:filter|find|map|reject)|While$/.test(u),S=/^(?:head|last)$/.test(u),w=P[S?"take"+(u=="last"?"Right":""):u],x=S||/^find/.test(u);w&&(P.prototype[u]=function(){var T=this.__wrapped__,U=S?[1]:arguments,I=T instanceof ht,te=U[0],ie=I||Ke(T),se=function(ct){var dt=w.apply(P,ts([ct],U));return S&&me?dt[0]:dt};ie&&d&&typeof te=="function"&&te.length!=1&&(I=ie=!1);var me=this.__chain__,Ce=!!this.__actions__.length,Ve=x&&!me,rt=I&&!Ce;if(!x&&ie){T=rt?T:new ht(this);var qe=f.apply(T,U);return qe.__actions__.push({func:yf,args:[se],thisArg:t}),new wn(qe,me)}return Ve&&rt?f.apply(this,U):(qe=this.thru(se),Ve?S?qe.value()[0]:qe.value():qe)})}),yn(["pop","push","shift","sort","splice","unshift"],function(f){var u=Na[f],d=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",S=/^(?:pop|shift)$/.test(f);P.prototype[f]=function(){var w=arguments;if(S&&!this.__chain__){var x=this.value();return u.apply(Ke(x)?x:[],w)}return this[d](function(T){return u.apply(Ke(T)?T:[],w)})}}),rr(ht.prototype,function(f,u){var d=P[u];if(d){var S=d.name+"";yt.call(al,S)||(al[S]=[]),al[S].push({name:u,func:d})}}),al[df(t,_).name]=[{name:"wrapper",func:t}],ht.prototype.clone=e_,ht.prototype.reverse=t_,ht.prototype.value=i_,P.prototype.at=T2,P.prototype.chain=Z2,P.prototype.commit=R2,P.prototype.next=X2,P.prototype.plant=Y2,P.prototype.reverse=U2,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=E2,P.prototype.first=P.prototype.head,fo&&(P.prototype[fo]=A2),P},sl=RQ();Zt?((Zt.exports=sl)._=sl,mi._=sl):Ze._=sl}).call(Xo)})(jc,jc.exports);var c9=jc.exports;const u9=xs.define({parser:$T.configure({props:[Nl.add({ParenthesisedExpression:cs({closing:")",align:!1}),Application:cs({closing:")",align:!1}),GeneratorCallGenerators:cs({closing:")",align:!1}),LetItems:cs({closing:"}",align:!1}),ArrayLiteral:cs({closing:"]",align:!1}),ArrayLiteral2d:cs({closing:"|]",align:!1}),SetLiteral:cs({closing:"}",align:!1})}),jl.add({ParenthesisedExpression:ur,Application:ur,GeneratorCallGenerators:ur,LetItems:ur,ArrayLiteral:ur,ArrayLiteral2d:ur,SetLiteral:ur}),Ll({Keyword:b.keyword,"Identifier QuotedIdentifier":b.variableName,"Call/Identifier Call/QuotedIdentifier GeneratorCall/Identifier GeneratorCall/QuotedIdentifier":b.name,Absent:b.null,Anonymous:b.null,BooleanLiteral:b.bool,Number:b.number,Infinity:b.number,StringLiteral:b.string,LineComment:b.comment,BlockComment:b.comment,"( )":b.paren,"{ }":b.paren,"[ ]":b.paren})]}),languageData:{commentTokens:{line:"%"}}});function H0(){return new Sa(u9)}const iQ=yi({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#999",lineHighlight:"#90909020"},styles:[{tag:b.comment,color:"slategray"},{tag:b.string,color:"#690"},{tag:[b.number,b.bool,b.null],color:"#905"},{tag:b.variableName,color:"#000000"},{tag:b.name,color:"#07a"},{tag:[b.keyword],color:"#07a"}]}),nQ=yi({variant:"dark",settings:{background:"var(--bulma-scheme-main-bis)",foreground:"#F6F6F6",caret:"#EEE",selection:"#036dd626",gutterBackground:"var(--bulma-scheme-main-ter)",gutterForeground:"var(--bulma-text)",lineHighlight:"#90909014"},styles:[{tag:b.comment,color:"slategray"},{tag:b.string,color:"#e09177"},{tag:[b.number,b.bool,b.null],color:"#a9e07e"},{tag:b.variableName,color:"#FFFFFF"},{tag:b.name,color:"#e6cf77"},{tag:[b.keyword],color:"#54a2e3"}]}),lp=new ql,Ls=new ql,h9=Ls.reconfigure(de.editable.of(!1)),O9=Ls.reconfigure(de.editable.of(!0)),d9=lp.reconfigure(iQ),p9=lp.reconfigure(nQ);function ec(n,e,t,i=!1){const r=[aA,ga.of([PR]),lp.of(t?nQ:iQ),de.theme({"&":{height:"100%"},"&.cm-editor.cm-focused":{outline:"none"},".cm-content, .cm-gutter":{minHeight:"100%"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"#036dd638"}})];return n===".json"||n===".mpc"?[...r,Ls.of(de.editable.of(!i)),hA()]:n===".mzc"?[...r,Ls.of(de.editable.of(!1))]:n===".dzn"?[...r,Ls.of(de.editable.of(!i)),H0()]:n===".html"?[...r,Ls.of(de.editable.of(!i)),a9()]:[...r,Ls.of(de.editable.of(!i)),H0(),de.updateListener.of(c9.debounce(e,250))]}function K0(n,e,t){const i=n.slice();return i[4]=e[t],i}function J0(n,e,t){const i=n.slice();return i[7]=e[t],i}function eS(n,e,t){const i=n.slice();return i[10]=e[t],i[12]=t,i}function g9(n){let e,t,i=Bc(n[0].location)+"",r,s,l,o,a,c,h;return{c(){e=k("pre"),t=k("a"),r=pe(i),l=pe(":"),o=N(),a=k("br"),v(t,"class",s="mzn-link mzn-"+n[0].type+" svelte-w513p9"),v(e,"class","svelte-w513p9")},m(O,p){Y(O,e,p),Q(e,t),Q(t,r),Q(e,l),Y(O,o,p),Y(O,a,p),c||(h=le(t,"click",n[3]),c=!0)},p(O,p){p&1&&i!==(i=Bc(O[0].location)+"")&&Ne(r,i),p&1&&s!==(s="mzn-link mzn-"+O[0].type+" svelte-w513p9")&&v(t,"class",s)},d(O){O&&(A(e),A(o),A(a)),c=!1,h()}}}function m9(n){let e,t=st(n[0].stack),i=[];for(let r=0;rr("goto",{location:o.location}),l=()=>r("goto",{location:i.location});return n.$$set=o=>{"msg"in o&&t(0,i=o.msg)},[i,r,s,l]}class rQ extends $i{constructor(e){super(),bi(this,e,w9,v9,Oi,{msg:0})}}function oS(n,e,t){const i=n.slice();return i[40]=e[t],i}function aS(n,e,t){const i=n.slice();return i[43]=e[t],i}function fS(n,e,t){const i=n.slice();return i[52]=e[t],i}function cS(n,e,t){const i=n.slice();return i[49]=e[t],i}function uS(n,e,t){const i=n.slice();return i[46]=e[t],i}const Q9=n=>({}),hS=n=>({});function OS(n,e,t){const i=n.slice();return i[46]=e[t],i}function dS(n){let e,t,i,r,s,l,o,a,c,h,O,p,g;function m(z,F){return z[13].length===0?k9:_9}let $=m(n),y=$(n),_=st(n[14]),W=[];for(let z=0;z<_.length;z+=1)W[z]=pS(OS(n,_,z));let R=n[19]&&gS(n),X=n[18]&&mS(n),C=n[17]&&SS(n),E=n[16]&&bS(n),D=n[15]&&$S(n);return{c(){e=k("button"),y.c(),i=N();for(let z=0;z{o=null}),et()),c[2]?a?(a.p(c,h),h[0]&4&&M(a,1)):(a=wS(c),a.c(),M(a,1),a.m(e,null)):a&&(Je(),j(a,1,1,()=>{a=null}),et())},i(c){r||(M(l,c),M(o),M(a),r=!0)},o(c){j(l,c),j(o),j(a),r=!1},d(c){c&&A(e),l&&l.d(c),o&&o.d(),a&&a.d()}}}function vS(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:AC}}),{c(){e=k("p"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small"),v(t,"title","Clear output on each run"),ne(t,"is-primary",n[0]),ne(t,"is-light",!n[0]),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Re(r,i,null),s=!0,l||(o=le(t,"click",n[33]),l=!0)},p(a,c){(!s||c[0]&1)&&ne(t,"is-primary",a[0]),(!s||c[0]&1)&&ne(t,"is-light",!a[0])},i(a){s||(M(r.$$.fragment,a),s=!0)},o(a){j(r.$$.fragment,a),s=!1},d(a){a&&A(e),Xe(r),l=!1,o()}}}function wS(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:Uy}}),{c(){e=k("p"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small is-danger"),v(t,"title","Clear output"),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Re(r,i,null),s=!0,l||(o=le(t,"click",n[34]),l=!0)},p:Qe,i(a){s||(M(r.$$.fragment,a),s=!0)},o(a){j(r.$$.fragment,a),s=!1},d(a){a&&A(e),Xe(r),l=!1,o()}}}function P9(n){let e;return{c(){e=pe("Running")},m(t,i){Y(t,e,i)},d(t){t&&A(e)}}}function x9(n){let e;return{c(){e=pe("Compiling")},m(t,i){Y(t,e,i)},d(t){t&&A(e)}}}function W9(n){let e,t,i,r=Fc(n[43].runTime)+"",s,l,o=n[43].code&&QS(n);return{c(){o&&o.c(),e=N(),t=k("pre"),i=pe("Finished in "),s=pe(r),l=pe("."),v(t,"class","mzn-runtime")},m(a,c){o&&o.m(a,c),Y(a,e,c),Y(a,t,c),Q(t,i),Q(t,s),Q(t,l)},p(a,c){a[43].code?o?o.p(a,c):(o=QS(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[0]&2&&r!==(r=Fc(a[43].runTime)+"")&&Ne(s,r)},i:Qe,o:Qe,d(a){a&&(A(e),A(t)),o&&o.d(a)}}}function C9(n){let e,t,i=(n[43].type==="error"&&n[12]||n[43].type==="warning"&&n[11])&&_S(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,s){r[43].type==="error"&&r[12]||r[43].type==="warning"&&r[11]?i?(i.p(r,s),s[0]&6146&&M(i,1)):(i=_S(r),i.c(),M(i,1),i.m(e.parentNode,e)):i&&(Je(),j(i,1,1,()=>{i=null}),et())},i(r){t||(M(i),t=!0)},o(r){j(i),t=!1},d(r){r&&A(e),i&&i.d(r)}}}function T9(n){let e,t=n[23][n[43].status]+"",i,r,s;return{c(){e=k("pre"),i=pe(t),r=N(),s=k("br")},m(l,o){Y(l,e,o),Q(e,i),Y(l,r,o),Y(l,s,o)},p(l,o){o[0]&2&&t!==(t=l[23][l[43].status]+"")&&Ne(i,t)},i:Qe,o:Qe,d(l){l&&(A(e),A(r),A(s))}}}function Z9(n){let e,t,i;return{c(){e=k("pre"),e.textContent="Stopped.",t=N(),i=k("br"),v(e,"class","mzn-runtime")},m(r,s){Y(r,e,s),Y(r,t,s),Y(r,i,s)},p:Qe,i:Qe,o:Qe,d(r){r&&(A(e),A(t),A(i))}}}function R9(n){let e,t=n[8]&&kS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[8]?t?t.p(i,r):(t=kS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Qe,o:Qe,d(i){i&&A(e),t&&t.d(i)}}}function X9(n){let e,t=n[9]&&xS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[9]?t?t.p(i,r):(t=xS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Qe,o:Qe,d(i){i&&A(e),t&&t.d(i)}}}function A9(n){let e,t=n[43].comment+"",i;return{c(){e=k("pre"),i=pe(t),v(e,"class","mzn-comment")},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&2&&t!==(t=r[43].comment+"")&&Ne(i,t)},i:Qe,o:Qe,d(r){r&&A(e)}}}function Y9(n){let e=n[13].indexOf(n[43].section)===-1&&!n[43].section.startsWith("mzn_vis_"),t,i=e&&WS(n);return{c(){i&&i.c(),t=Gt()},m(r,s){i&&i.m(r,s),Y(r,t,s)},p(r,s){s[0]&8194&&(e=r[13].indexOf(r[43].section)===-1&&!r[43].section.startsWith("mzn_vis_")),e?i?i.p(r,s):(i=WS(r),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},i:Qe,o:Qe,d(r){r&&A(t),i&&i.d(r)}}}function U9(n){let e,t=n[10]&&CS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[10]?t?t.p(i,r):(t=CS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Qe,o:Qe,d(i){i&&A(e),t&&t.d(i)}}}function E9(n){let e,t,i,r,s,l,o,a=st(US(n[43],n[13])),c=[];for(let O=0;Oj(c[O],1,1,()=>{c[O]=null});return{c(){e=k("span"),t=k("pre"),t.textContent="% Solution checker report:",i=N(),r=k("br"),s=N();for(let O=0;O%%%mzn-stat-end',i=N(),r=k("br")},m(o,a){for(let c=0;c{i=null}),et())},i(r){t||(M(i),t=!0)},o(r){j(i),t=!1},d(r){r&&A(e),i&&i.d(r)}}}function q9(n){let e,t=n[49].message+"",i;return{c(){e=k("pre"),i=pe(t)},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&8194&&t!==(t=r[49].message+"")&&Ne(i,t)},i:Qe,o:Qe,d(r){r&&A(e)}}}function TS(n){let e,t;return e=new rQ({props:{msg:n[49]}}),e.$on("goto",n[35]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,r){const s={};r[0]&8194&&(s.msg=i[49]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function ZS(n){let e,t,i,r;const s=[q9,V9],l=[];function o(a,c){return a[49].type==="text"?0:a[49].type==="error"||a[49].type==="warning"?1:-1}return~(e=o(n))&&(t=l[e]=s[e](n)),{c(){t&&t.c(),i=Gt()},m(a,c){~e&&l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?~e&&l[e].p(a,c):(t&&(Je(),j(l[h],1,1,()=>{l[h]=null}),et()),~e?(t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){r||(M(t),r=!0)},o(a){j(t),r=!1},d(a){a&&A(i),~e&&l[e].d(a)}}}function RS(n){let e;function t(s,l){if(typeof s[43].output[s[46]]!="string")return L9;if(s[46]!=="raw")return I9}let i=t(n),r=i&&i(n);return{c(){r&&r.c(),e=Gt()},m(s,l){r&&r.m(s,l),Y(s,e,l)},p(s,l){i===(i=t(s))&&r?r.p(s,l):(r&&r.d(1),r=i&&i(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){s&&A(e),r&&r.d(s)}}}function I9(n){let e,t=n[43].output[n[46]]+"",i;return{c(){e=k("pre"),i=pe(t)},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&2&&t!==(t=r[43].output[r[46]]+"")&&Ne(i,t)},d(r){r&&A(e)}}}function L9(n){let e,t=JSON.stringify(n[43].output[n[46]],null,2)+"",i,r,s;return{c(){e=k("pre"),i=pe(t),r=N(),s=k("br")},m(l,o){Y(l,e,o),Q(e,i),Y(l,r,o),Y(l,s,o)},p(l,o){o[0]&2&&t!==(t=JSON.stringify(l[43].output[l[46]],null,2)+"")&&Ne(i,t)},d(l){l&&(A(e),A(r),A(s))}}}function XS(n){let e=n[13].indexOf(n[46])===-1&&!n[46].startsWith("mzn_vis_"),t,i=e&&RS(n);return{c(){i&&i.c(),t=Gt()},m(r,s){i&&i.m(r,s),Y(r,t,s)},p(r,s){s[0]&8194&&(e=r[13].indexOf(r[46])===-1&&!r[46].startsWith("mzn_vis_")),e?i?i.p(r,s):(i=RS(r),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(r){r&&A(t),i&&i.d(r)}}}function AS(n){let e,t,i,r;const s=[z9,E9,U9,Y9,A9,X9,R9,Z9,T9,C9,W9],l=[];function o(a,c){return a[43].type==="solution"?0:a[43].type==="checker"?1:a[43].type==="time"?2:a[43].type==="trace"?3:a[43].type==="comment"?4:a[43].type==="stderr"?5:a[43].type==="statistics"?6:a[43].type==="cancel"?7:a[43].type==="status"?8:a[43].type==="error"||a[43].type==="warning"?9:a[43].type==="exit"?10:-1}return~(e=o(n))&&(t=l[e]=s[e](n)),{c(){t&&t.c(),i=Gt()},m(a,c){~e&&l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?~e&&l[e].p(a,c):(t&&(Je(),j(l[h],1,1,()=>{l[h]=null}),et()),~e?(t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i)):t=null)},i(a){r||(M(t),r=!0)},o(a){j(t),r=!1},d(a){a&&A(i),~e&&l[e].d(a)}}}function YS(n){let e,t,i,r=n[40].files.join(", ")+"",s,l,o,a,c;function h(y,_){return y[40].isCompile?x9:P9}let O=h(n),p=O(n),g=st(n[40].output),m=[];for(let y=0;yj(m[y],1,1,()=>{m[y]=null});return{c(){e=k("details"),t=k("summary"),p.c(),i=N(),s=pe(r),l=N(),o=k("div");for(let y=0;yj(O[g],1,1,()=>{O[g]=null});return{c(){e=k("div"),t=k("div"),a&&a.c(),i=N(),c&&c.c(),r=N(),s=k("div"),l=k("div");for(let g=0;g{c=null}),et()),(!o||m[0]&48)&&ne(t,"is-empty",!g[4]&&!g[5]),(!o||m[0]&64)&&ne(t,"is-tab",g[6]),m[0]&8404738){h=st(g[1]);let $;for($=0;$0&&(s+=`${e}h `),(e>0||t>0)&&(s+=`${t}m `),(e>0||t>0||i>0)&&(s+=`${i}s `),e==0&&t==0&&(i>0&&(s+=" "),s+=`${r}msec`),s.trimEnd()}function US(n,e){const t=[];let i=[];const r=()=>{if(i.length>0){const s=i.join("").split(` +}`;var rt=fm(function(){return bt(W,Ce+"return "+se).apply(t,T)});if(rt.source=se,kh(rt))throw rt;return rt}function FW(f){return $t(f).toLowerCase()}function GW(f){return $t(f).toUpperCase()}function HW(f,u,d){if(f=$t(f),f&&(d||u===t))return Sp(f);if(!f||!(u=sn(u)))return f;var S=Dn(f),w=Dn(u),W=bp(S,w),T=$p(S,w)+1;return os(S,W,T).join("")}function KW(f,u,d){if(f=$t(f),f&&(d||u===t))return f.slice(0,vp(f)+1);if(!f||!(u=sn(u)))return f;var S=Dn(f),w=$p(S,Dn(u))+1;return os(S,0,w).join("")}function JW(f,u,d){if(f=$t(f),f&&(d||u===t))return f.replace(ir,"");if(!f||!(u=sn(u)))return f;var S=Dn(f),w=bp(S,Dn(u));return os(S,w).join("")}function ex(f,u){var d=N,S=G;if(Nt(u)){var w="separator"in u?u.separator:w;d="length"in u?nt(u.length):d,S="omission"in u?sn(u.omission):S}f=$t(f);var W=f.length;if(rl(f)){var T=Dn(f);W=T.length}if(d>=W)return f;var E=d-sl(S);if(E<1)return S;var I=T?os(T,0,E).join(""):f.slice(0,E);if(w===t)return I+S;if(T&&(E+=I.length-E),Ph(w)){if(f.slice(E).search(w)){var te,ie=I;for(w.global||(w=qu(w.source,$t(Qr.exec(w))+"g")),w.lastIndex=0;te=w.exec(ie);)var se=te.index;I=I.slice(0,se===t?E:se)}}else if(f.indexOf(sn(w),E)!=E){var me=I.lastIndexOf(w);me>-1&&(I=I.slice(0,me))}return I+S}function tx(f){return f=$t(f),f&&Zs.test(f)?f.replace(zt,CQ):f}var ix=hl(function(f,u,d){return f+(d?" ":"")+u.toUpperCase()}),Ch=cg("toUpperCase");function am(f,u,d){return f=$t(f),u=d?t:u,u===t?_Q(f)?RQ(f):gQ(f):f.match(u)||[]}var fm=ot(function(f,u){try{return nn(f,t,u)}catch(d){return kh(d)?d:new Ge(d)}}),nx=Tr(function(f,u){return yn(u,function(d){d=lr(d),xr(f,d,Qh(f[d],f))}),f});function rx(f){var u=f==null?0:f.length,d=Me();return f=u?It(f,function(S){if(typeof S[1]!="function")throw new vn(l);return[d(S[0]),S[1]]}):[],ot(function(S){for(var w=-1;++wUe)return[];var d=xe,S=Wi(f,xe);u=Me(u),f-=xe;for(var w=Mu(S,u);++d0||u<0)?new ht(d):(f<0?d=d.takeRight(-f):f&&(d=d.drop(f)),u!==t&&(u=nt(u),d=u<0?d.dropRight(-u):d.take(u-f)),d)},ht.prototype.takeRightWhile=function(f){return this.reverse().takeWhile(f).reverse()},ht.prototype.toArray=function(){return this.take(xe)},rr(ht.prototype,function(f,u){var d=/^(?:filter|find|map|reject)|While$/.test(u),S=/^(?:head|last)$/.test(u),w=P[S?"take"+(u=="last"?"Right":""):u],W=S||/^find/.test(u);w&&(P.prototype[u]=function(){var T=this.__wrapped__,E=S?[1]:arguments,I=T instanceof ht,te=E[0],ie=I||Ke(T),se=function(ct){var dt=w.apply(P,ts([ct],E));return S&&me?dt[0]:dt};ie&&d&&typeof te=="function"&&te.length!=1&&(I=ie=!1);var me=this.__chain__,Ce=!!this.__actions__.length,Ve=W&&!me,rt=I&&!Ce;if(!W&&ie){T=rt?T:new ht(this);var qe=f.apply(T,E);return qe.__actions__.push({func:yf,args:[se],thisArg:t}),new wn(qe,me)}return Ve&&rt?f.apply(this,E):(qe=this.thru(se),Ve?S?qe.value()[0]:qe.value():qe)})}),yn(["pop","push","shift","sort","splice","unshift"],function(f){var u=Na[f],d=/^(?:push|sort|unshift)$/.test(f)?"tap":"thru",S=/^(?:pop|shift)$/.test(f);P.prototype[f]=function(){var w=arguments;if(S&&!this.__chain__){var W=this.value();return u.apply(Ke(W)?W:[],w)}return this[d](function(T){return u.apply(Ke(T)?T:[],w)})}}),rr(ht.prototype,function(f,u){var d=P[u];if(d){var S=d.name+"";yt.call(fl,S)||(fl[S]=[]),fl[S].push({name:u,func:d})}}),fl[df(t,_).name]=[{name:"wrapper",func:t}],ht.prototype.clone=t2,ht.prototype.reverse=i2,ht.prototype.value=n2,P.prototype.at=Zk,P.prototype.chain=Rk,P.prototype.commit=Xk,P.prototype.next=Ak,P.prototype.plant=Uk,P.prototype.reverse=Ek,P.prototype.toJSON=P.prototype.valueOf=P.prototype.value=zk,P.prototype.first=P.prototype.head,fo&&(P.prototype[fo]=Yk),P},ll=XQ();Zt?((Zt.exports=ll)._=ll,mi._=ll):Ze._=ll}).call(Xo)})(jc,jc.exports);var uY=jc.exports;const hY=Ws.define({parser:yT.configure({props:[Nl.add({ParenthesisedExpression:cs({closing:")",align:!1}),Application:cs({closing:")",align:!1}),GeneratorCallGenerators:cs({closing:")",align:!1}),LetItems:cs({closing:"}",align:!1}),ArrayLiteral:cs({closing:"]",align:!1}),ArrayLiteral2d:cs({closing:"|]",align:!1}),SetLiteral:cs({closing:"}",align:!1})}),jl.add({ParenthesisedExpression:ur,Application:ur,GeneratorCallGenerators:ur,LetItems:ur,ArrayLiteral:ur,ArrayLiteral2d:ur,SetLiteral:ur}),Ll({Keyword:b.keyword,"Identifier QuotedIdentifier":b.variableName,"Call/Identifier Call/QuotedIdentifier GeneratorCall/Identifier GeneratorCall/QuotedIdentifier":b.name,Absent:b.null,Anonymous:b.null,BooleanLiteral:b.bool,Number:b.number,Infinity:b.number,StringLiteral:b.string,LineComment:b.comment,BlockComment:b.comment,"( )":b.paren,"{ }":b.paren,"[ ]":b.paren})]}),languageData:{commentTokens:{line:"%"}}});function K0(){return new Sa(hY)}const nQ=yi({variant:"light",settings:{background:"#fff",foreground:"#000",caret:"#000",selection:"#036dd626",gutterBackground:"#fcfcfc",gutterForeground:"#999",lineHighlight:"#90909020"},styles:[{tag:b.comment,color:"slategray"},{tag:b.string,color:"#690"},{tag:[b.number,b.bool,b.null],color:"#905"},{tag:b.variableName,color:"#000000"},{tag:b.name,color:"#07a"},{tag:[b.keyword],color:"#07a"}]}),rQ=yi({variant:"dark",settings:{background:"var(--bulma-scheme-main-bis)",foreground:"#F6F6F6",caret:"#EEE",selection:"#036dd626",gutterBackground:"var(--bulma-scheme-main-ter)",gutterForeground:"var(--bulma-text)",lineHighlight:"#90909014"},styles:[{tag:b.comment,color:"slategray"},{tag:b.string,color:"#e09177"},{tag:[b.number,b.bool,b.null],color:"#a9e07e"},{tag:b.variableName,color:"#FFFFFF"},{tag:b.name,color:"#e6cf77"},{tag:[b.keyword],color:"#54a2e3"}]}),lp=new ql,Ls=new ql,OY=Ls.reconfigure(de.editable.of(!1)),dY=Ls.reconfigure(de.editable.of(!0)),pY=lp.reconfigure(nQ),gY=lp.reconfigure(rQ);function ec(n,e,t,i=!1){const r=[fA,ga.of([WR]),lp.of(t?rQ:nQ),de.theme({"&":{height:"100%"},"&.cm-editor.cm-focused":{outline:"none"},".cm-content, .cm-gutter":{minHeight:"100%"},"&.cm-focused .cm-selectionBackground":{backgroundColor:"#036dd638"}})];return n===".json"||n===".mpc"?[...r,Ls.of(de.editable.of(!i)),OA()]:n===".mzc"?[...r,Ls.of(de.editable.of(!1))]:n===".dzn"?[...r,Ls.of(de.editable.of(!i)),K0()]:n===".html"?[...r,Ls.of(de.editable.of(!i)),fY()]:[...r,Ls.of(de.editable.of(!i)),K0(),de.updateListener.of(uY.debounce(e,250))]}function J0(n,e,t){const i=n.slice();return i[4]=e[t],i}function eS(n,e,t){const i=n.slice();return i[7]=e[t],i}function tS(n,e,t){const i=n.slice();return i[10]=e[t],i[12]=t,i}function mY(n){let e,t,i=Bc(n[0].location)+"",r,s,l,o,a,c,h;return{c(){e=k("pre"),t=k("a"),r=pe(i),l=pe(":"),o=L(),a=k("br"),v(t,"class",s="mzn-link mzn-"+n[0].type+" svelte-w513p9"),v(e,"class","svelte-w513p9")},m(O,p){Y(O,e,p),Q(e,t),Q(t,r),Q(e,l),Y(O,o,p),Y(O,a,p),c||(h=le(t,"click",n[3]),c=!0)},p(O,p){p&1&&i!==(i=Bc(O[0].location)+"")&&Le(r,i),p&1&&s!==(s="mzn-link mzn-"+O[0].type+" svelte-w513p9")&&v(t,"class",s)},d(O){O&&(X(e),X(o),X(a)),c=!1,h()}}}function SY(n){let e,t=st(n[0].stack),i=[];for(let r=0;rr("goto",{location:o.location}),l=()=>r("goto",{location:i.location});return n.$$set=o=>{"msg"in o&&t(0,i=o.msg)},[i,r,s,l]}class sQ extends $i{constructor(e){super(),bi(this,e,QY,wY,Oi,{msg:0})}}function aS(n,e,t){const i=n.slice();return i[40]=e[t],i}function fS(n,e,t){const i=n.slice();return i[43]=e[t],i}function cS(n,e,t){const i=n.slice();return i[52]=e[t],i}function uS(n,e,t){const i=n.slice();return i[49]=e[t],i}function hS(n,e,t){const i=n.slice();return i[46]=e[t],i}const _Y=n=>({}),OS=n=>({});function dS(n,e,t){const i=n.slice();return i[46]=e[t],i}function pS(n){let e,t,i,r,s,l,o,a,c,h,O,p,g;function m(M,B){return M[13].length===0?PY:kY}let $=m(n),y=$(n),_=st(n[14]),x=[];for(let M=0;M<_.length;M+=1)x[M]=gS(dS(n,_,M));let R=n[19]&&mS(n),A=n[18]&&SS(n),C=n[17]&&bS(n),z=n[16]&&$S(n),V=n[15]&&yS(n);return{c(){e=k("button"),y.c(),i=L();for(let M=0;M{o=null}),et()),c[2]?a?(a.p(c,h),h[0]&4&&D(a,1)):(a=QS(c),a.c(),D(a,1),a.m(e,null)):a&&(Je(),j(a,1,1,()=>{a=null}),et())},i(c){r||(D(l,c),D(o),D(a),r=!0)},o(c){j(l,c),j(o),j(a),r=!1},d(c){c&&X(e),l&&l.d(c),o&&o.d(),a&&a.d()}}}function wS(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:YC}}),{c(){e=k("p"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small"),v(t,"title","Clear output on each run"),ne(t,"is-primary",n[0]),ne(t,"is-light",!n[0]),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Re(r,i,null),s=!0,l||(o=le(t,"click",n[33]),l=!0)},p(a,c){(!s||c[0]&1)&&ne(t,"is-primary",a[0]),(!s||c[0]&1)&&ne(t,"is-light",!a[0])},i(a){s||(D(r.$$.fragment,a),s=!0)},o(a){j(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function QS(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:Ey}}),{c(){e=k("p"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small is-danger"),v(t,"title","Clear output"),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Re(r,i,null),s=!0,l||(o=le(t,"click",n[34]),l=!0)},p:Qe,i(a){s||(D(r.$$.fragment,a),s=!0)},o(a){j(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function WY(n){let e;return{c(){e=pe("Running")},m(t,i){Y(t,e,i)},d(t){t&&X(e)}}}function xY(n){let e;return{c(){e=pe("Compiling")},m(t,i){Y(t,e,i)},d(t){t&&X(e)}}}function CY(n){let e,t,i,r=Fc(n[43].runTime)+"",s,l,o=n[43].code&&_S(n);return{c(){o&&o.c(),e=L(),t=k("pre"),i=pe("Finished in "),s=pe(r),l=pe("."),v(t,"class","mzn-runtime")},m(a,c){o&&o.m(a,c),Y(a,e,c),Y(a,t,c),Q(t,i),Q(t,s),Q(t,l)},p(a,c){a[43].code?o?o.p(a,c):(o=_S(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c[0]&2&&r!==(r=Fc(a[43].runTime)+"")&&Le(s,r)},i:Qe,o:Qe,d(a){a&&(X(e),X(t)),o&&o.d(a)}}}function TY(n){let e,t,i=(n[43].type==="error"&&n[12]||n[43].type==="warning"&&n[11])&&kS(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,s){r[43].type==="error"&&r[12]||r[43].type==="warning"&&r[11]?i?(i.p(r,s),s[0]&6146&&D(i,1)):(i=kS(r),i.c(),D(i,1),i.m(e.parentNode,e)):i&&(Je(),j(i,1,1,()=>{i=null}),et())},i(r){t||(D(i),t=!0)},o(r){j(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function ZY(n){let e,t=n[23][n[43].status]+"",i,r,s;return{c(){e=k("pre"),i=pe(t),r=L(),s=k("br")},m(l,o){Y(l,e,o),Q(e,i),Y(l,r,o),Y(l,s,o)},p(l,o){o[0]&2&&t!==(t=l[23][l[43].status]+"")&&Le(i,t)},i:Qe,o:Qe,d(l){l&&(X(e),X(r),X(s))}}}function RY(n){let e,t,i;return{c(){e=k("pre"),e.textContent="Stopped.",t=L(),i=k("br"),v(e,"class","mzn-runtime")},m(r,s){Y(r,e,s),Y(r,t,s),Y(r,i,s)},p:Qe,i:Qe,o:Qe,d(r){r&&(X(e),X(t),X(i))}}}function XY(n){let e,t=n[8]&&PS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[8]?t?t.p(i,r):(t=PS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Qe,o:Qe,d(i){i&&X(e),t&&t.d(i)}}}function AY(n){let e,t=n[9]&&xS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[9]?t?t.p(i,r):(t=xS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Qe,o:Qe,d(i){i&&X(e),t&&t.d(i)}}}function YY(n){let e,t=n[43].comment+"",i;return{c(){e=k("pre"),i=pe(t),v(e,"class","mzn-comment")},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&2&&t!==(t=r[43].comment+"")&&Le(i,t)},i:Qe,o:Qe,d(r){r&&X(e)}}}function UY(n){let e=n[13].indexOf(n[43].section)===-1&&!n[43].section.startsWith("mzn_vis_"),t,i=e&&CS(n);return{c(){i&&i.c(),t=Gt()},m(r,s){i&&i.m(r,s),Y(r,t,s)},p(r,s){s[0]&8194&&(e=r[13].indexOf(r[43].section)===-1&&!r[43].section.startsWith("mzn_vis_")),e?i?i.p(r,s):(i=CS(r),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},i:Qe,o:Qe,d(r){r&&X(t),i&&i.d(r)}}}function EY(n){let e,t=n[10]&&TS(n);return{c(){t&&t.c(),e=Gt()},m(i,r){t&&t.m(i,r),Y(i,e,r)},p(i,r){i[10]?t?t.p(i,r):(t=TS(i),t.c(),t.m(e.parentNode,e)):t&&(t.d(1),t=null)},i:Qe,o:Qe,d(i){i&&X(e),t&&t.d(i)}}}function zY(n){let e,t,i,r,s,l,o,a=st(ES(n[43],n[13])),c=[];for(let O=0;Oj(c[O],1,1,()=>{c[O]=null});return{c(){e=k("span"),t=k("pre"),t.textContent="% Solution checker report:",i=L(),r=k("br"),s=L();for(let O=0;O%%%mzn-stat-end',i=L(),r=k("br")},m(o,a){for(let c=0;c{i=null}),et())},i(r){t||(D(i),t=!0)},o(r){j(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function IY(n){let e,t=n[49].message+"",i;return{c(){e=k("pre"),i=pe(t)},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&8194&&t!==(t=r[49].message+"")&&Le(i,t)},i:Qe,o:Qe,d(r){r&&X(e)}}}function ZS(n){let e,t;return e=new sQ({props:{msg:n[49]}}),e.$on("goto",n[35]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,r){const s={};r[0]&8194&&(s.msg=i[49]),e.$set(s)},i(i){t||(D(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function RS(n){let e,t,i,r;const s=[IY,qY],l=[];function o(a,c){return a[49].type==="text"?0:a[49].type==="error"||a[49].type==="warning"?1:-1}return~(e=o(n))&&(t=l[e]=s[e](n)),{c(){t&&t.c(),i=Gt()},m(a,c){~e&&l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?~e&&l[e].p(a,c):(t&&(Je(),j(l[h],1,1,()=>{l[h]=null}),et()),~e?(t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),D(t,1),t.m(i.parentNode,i)):t=null)},i(a){r||(D(t),r=!0)},o(a){j(t),r=!1},d(a){a&&X(i),~e&&l[e].d(a)}}}function XS(n){let e;function t(s,l){if(typeof s[43].output[s[46]]!="string")return NY;if(s[46]!=="raw")return LY}let i=t(n),r=i&&i(n);return{c(){r&&r.c(),e=Gt()},m(s,l){r&&r.m(s,l),Y(s,e,l)},p(s,l){i===(i=t(s))&&r?r.p(s,l):(r&&r.d(1),r=i&&i(s),r&&(r.c(),r.m(e.parentNode,e)))},d(s){s&&X(e),r&&r.d(s)}}}function LY(n){let e,t=n[43].output[n[46]]+"",i;return{c(){e=k("pre"),i=pe(t)},m(r,s){Y(r,e,s),Q(e,i)},p(r,s){s[0]&2&&t!==(t=r[43].output[r[46]]+"")&&Le(i,t)},d(r){r&&X(e)}}}function NY(n){let e,t=JSON.stringify(n[43].output[n[46]],null,2)+"",i,r,s;return{c(){e=k("pre"),i=pe(t),r=L(),s=k("br")},m(l,o){Y(l,e,o),Q(e,i),Y(l,r,o),Y(l,s,o)},p(l,o){o[0]&2&&t!==(t=JSON.stringify(l[43].output[l[46]],null,2)+"")&&Le(i,t)},d(l){l&&(X(e),X(r),X(s))}}}function AS(n){let e=n[13].indexOf(n[46])===-1&&!n[46].startsWith("mzn_vis_"),t,i=e&&XS(n);return{c(){i&&i.c(),t=Gt()},m(r,s){i&&i.m(r,s),Y(r,t,s)},p(r,s){s[0]&8194&&(e=r[13].indexOf(r[46])===-1&&!r[46].startsWith("mzn_vis_")),e?i?i.p(r,s):(i=XS(r),i.c(),i.m(t.parentNode,t)):i&&(i.d(1),i=null)},d(r){r&&X(t),i&&i.d(r)}}}function YS(n){let e,t,i,r;const s=[MY,zY,EY,UY,YY,AY,XY,RY,ZY,TY,CY],l=[];function o(a,c){return a[43].type==="solution"?0:a[43].type==="checker"?1:a[43].type==="time"?2:a[43].type==="trace"?3:a[43].type==="comment"?4:a[43].type==="stderr"?5:a[43].type==="statistics"?6:a[43].type==="cancel"?7:a[43].type==="status"?8:a[43].type==="error"||a[43].type==="warning"?9:a[43].type==="exit"?10:-1}return~(e=o(n))&&(t=l[e]=s[e](n)),{c(){t&&t.c(),i=Gt()},m(a,c){~e&&l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?~e&&l[e].p(a,c):(t&&(Je(),j(l[h],1,1,()=>{l[h]=null}),et()),~e?(t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),D(t,1),t.m(i.parentNode,i)):t=null)},i(a){r||(D(t),r=!0)},o(a){j(t),r=!1},d(a){a&&X(i),~e&&l[e].d(a)}}}function US(n){let e,t,i,r=n[40].files.join(", ")+"",s,l,o,a,c;function h(y,_){return y[40].isCompile?xY:WY}let O=h(n),p=O(n),g=st(n[40].output),m=[];for(let y=0;yj(m[y],1,1,()=>{m[y]=null});return{c(){e=k("details"),t=k("summary"),p.c(),i=L(),s=pe(r),l=L(),o=k("div");for(let y=0;yj(O[g],1,1,()=>{O[g]=null});return{c(){e=k("div"),t=k("div"),a&&a.c(),i=L(),c&&c.c(),r=L(),s=k("div"),l=k("div");for(let g=0;g{c=null}),et()),(!o||m[0]&48)&&ne(t,"is-empty",!g[4]&&!g[5]),(!o||m[0]&64)&&ne(t,"is-tab",g[6]),m[0]&8404738){h=st(g[1]);let $;for($=0;$0&&(s+=`${e}h `),(e>0||t>0)&&(s+=`${t}m `),(e>0||t>0||i>0)&&(s+=`${i}s `),e==0&&t==0&&(i>0&&(s+=" "),s+=`${r}msec`),s.trimEnd()}function ES(n,e){const t=[];let i=[];const r=()=>{if(i.length>0){const s=i.join("").split(` `);s[s.length-1]===""&&s.splice(s.length-1,1),t.push({type:"text",message:s.map(l=>`% ${l}`).join(` -`)}),i=[]}};if(n.messages){for(const s of n.messages)if(s.type==="solution")for(const l of s.sections)e.indexOf(l)===-1&&l!=="raw"&&i.push(n.output[l]);else s.type==="trace"?e.indexOf(s.section)===-1&&s.section!=="raw"&&i.push(s.message):(r(),t.push(s));r()}else{for(const s of n.sections)e.indexOf(s)===-1&&s!=="raw"&&i.push(n.output[s]);r()}return t}function j9(n,e,t){let i,r,s,l,o,a,{$$slots:c={},$$scope:h}=e;const O=en();let{output:p}=e,{autoClearOutput:g=!1}=e,{showClearOutput:m=!0}=e,{showAutoClearOutput:$=!0}=e,{showSectionToggles:y=!0}=e,{showRightControls:_=!0}=e,{isTab:W=!1}=e,R,X=!0,C=!0,E=!0,D=!0,z=!0;function F($e){const oe=$e.flatMap(ce=>ce.output),H=new Set([...oe.filter(ce=>ce.type==="solution"||ce.type==="checker").flatMap(ce=>ce.sections.filter(Ee=>ce.output[Ee].length>0)),...oe.filter(ce=>ce.type==="trace").map(ce=>ce.section)].filter(ce=>ce!=="raw"&&!ce.startsWith("mzn_vis_"))),ue=[...H.values()];return ue.sort(),t(13,L=L.filter(ce=>H.has(ce))),ue}function B($e){L.indexOf($e)===-1?t(13,L=[...L,$e]):t(13,L=L.filter(oe=>oe!==$e))}function q(){L.length===0?t(13,L=[...a]):t(13,L=[])}let L=[];const re={ALL_SOLUTIONS:"==========",OPTIMAL_SOLUTION:"==========",UNSATISFIABLE:"=====UNSATISFIABLE=====",UNSAT_OR_UNBOUNDED:"=====UNSATorUNBOUNDED=====",UNBOUNDED:"=====UNBOUNDED=====",UNKNOWN:"=====UNKNOWN=====",ERROR:"=====ERROR====="};async function ae($e){R&&(await Fn(),R.scrollTo(0,R.scrollHeight))}const ye=()=>q(),Se=$e=>B($e),ge=()=>t(8,X=!X),Ue=()=>t(9,C=!C),Ie=()=>t(10,E=!E),ke=()=>t(11,D=!D),We=()=>t(12,z=!z),lt=()=>t(0,g=!g),Vt=()=>O("clear");function Qt($e){mm.call(this,n,$e)}function pt($e){mm.call(this,n,$e)}function qt($e){Et[$e?"unshift":"push"](()=>{R=$e,t(7,R)})}return n.$$set=$e=>{"output"in $e&&t(1,p=$e.output),"autoClearOutput"in $e&&t(0,g=$e.autoClearOutput),"showClearOutput"in $e&&t(2,m=$e.showClearOutput),"showAutoClearOutput"in $e&&t(3,$=$e.showAutoClearOutput),"showSectionToggles"in $e&&t(4,y=$e.showSectionToggles),"showRightControls"in $e&&t(5,_=$e.showRightControls),"isTab"in $e&&t(6,W=$e.isTab),"$$scope"in $e&&t(24,h=$e.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(19,i=p.some($e=>$e.output.some(oe=>oe.type==="statistics"))),n.$$.dirty[0]&2&&t(18,r=p.some($e=>$e.output.some(oe=>oe.type==="stderr"))),n.$$.dirty[0]&2&&t(17,s=p.some($e=>$e.output.some(oe=>oe.type==="time"))),n.$$.dirty[0]&2&&t(16,l=p.some($e=>$e.output.some(oe=>oe.type==="warning"||oe.type==="checker"&&oe.messages&&oe.messages.some(H=>H.type==="warning")))),n.$$.dirty[0]&2&&t(15,o=p.some($e=>$e.output.some(oe=>oe.type==="error"||oe.type==="checker"&&oe.messages&&oe.messages.some(H=>H.type==="error")))),n.$$.dirty[0]&2&&t(14,a=F(p)),n.$$.dirty[0]&2&&ae()},[g,p,m,$,y,_,W,R,X,C,E,D,z,L,a,o,l,s,r,i,O,B,q,re,h,c,ye,Se,ge,Ue,Ie,ke,We,lt,Vt,Qt,pt,qt]}class B9 extends $i{constructor(e){super(),bi(this,e,j9,N9,Oi,{output:1,autoClearOutput:0,showClearOutput:2,showAutoClearOutput:3,showSectionToggles:4,showRightControls:5,isTab:6},null,[-1,-1])}}const F9=`const MiniZincIDE = (() => { +`)}),i=[]}};if(n.messages){for(const s of n.messages)if(s.type==="solution")for(const l of s.sections)e.indexOf(l)===-1&&l!=="raw"&&i.push(n.output[l]);else s.type==="trace"?e.indexOf(s.section)===-1&&s.section!=="raw"&&i.push(s.message):(r(),t.push(s));r()}else{for(const s of n.sections)e.indexOf(s)===-1&&s!=="raw"&&i.push(n.output[s]);r()}return t}function BY(n,e,t){let i,r,s,l,o,a,{$$slots:c={},$$scope:h}=e;const O=en();let{output:p}=e,{autoClearOutput:g=!1}=e,{showClearOutput:m=!0}=e,{showAutoClearOutput:$=!0}=e,{showSectionToggles:y=!0}=e,{showRightControls:_=!0}=e,{isTab:x=!1}=e,R,A=!0,C=!0,z=!0,V=!0,M=!0;function B($e){const oe=$e.flatMap(ce=>ce.output),H=new Set([...oe.filter(ce=>ce.type==="solution"||ce.type==="checker").flatMap(ce=>ce.sections.filter(Ee=>ce.output[Ee].length>0)),...oe.filter(ce=>ce.type==="trace").map(ce=>ce.section)].filter(ce=>ce!=="raw"&&!ce.startsWith("mzn_vis_"))),ue=[...H.values()];return ue.sort(),t(13,U=U.filter(ce=>H.has(ce))),ue}function N($e){U.indexOf($e)===-1?t(13,U=[...U,$e]):t(13,U=U.filter(oe=>oe!==$e))}function G(){U.length===0?t(13,U=[...a]):t(13,U=[])}let U=[];const re={ALL_SOLUTIONS:"==========",OPTIMAL_SOLUTION:"==========",UNSATISFIABLE:"=====UNSATISFIABLE=====",UNSAT_OR_UNBOUNDED:"=====UNSATorUNBOUNDED=====",UNBOUNDED:"=====UNBOUNDED=====",UNKNOWN:"=====UNKNOWN=====",ERROR:"=====ERROR====="};async function ae($e){R&&(await Fn(),R.scrollTo(0,R.scrollHeight))}const ye=()=>G(),Se=$e=>N($e),ge=()=>t(8,A=!A),Ue=()=>t(9,C=!C),Ie=()=>t(10,z=!z),ke=()=>t(11,V=!V),xe=()=>t(12,M=!M),lt=()=>t(0,g=!g),Vt=()=>O("clear");function Qt($e){mm.call(this,n,$e)}function pt($e){mm.call(this,n,$e)}function qt($e){Et[$e?"unshift":"push"](()=>{R=$e,t(7,R)})}return n.$$set=$e=>{"output"in $e&&t(1,p=$e.output),"autoClearOutput"in $e&&t(0,g=$e.autoClearOutput),"showClearOutput"in $e&&t(2,m=$e.showClearOutput),"showAutoClearOutput"in $e&&t(3,$=$e.showAutoClearOutput),"showSectionToggles"in $e&&t(4,y=$e.showSectionToggles),"showRightControls"in $e&&t(5,_=$e.showRightControls),"isTab"in $e&&t(6,x=$e.isTab),"$$scope"in $e&&t(24,h=$e.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&2&&t(19,i=p.some($e=>$e.output.some(oe=>oe.type==="statistics"))),n.$$.dirty[0]&2&&t(18,r=p.some($e=>$e.output.some(oe=>oe.type==="stderr"))),n.$$.dirty[0]&2&&t(17,s=p.some($e=>$e.output.some(oe=>oe.type==="time"))),n.$$.dirty[0]&2&&t(16,l=p.some($e=>$e.output.some(oe=>oe.type==="warning"||oe.type==="checker"&&oe.messages&&oe.messages.some(H=>H.type==="warning")))),n.$$.dirty[0]&2&&t(15,o=p.some($e=>$e.output.some(oe=>oe.type==="error"||oe.type==="checker"&&oe.messages&&oe.messages.some(H=>H.type==="error")))),n.$$.dirty[0]&2&&t(14,a=B(p)),n.$$.dirty[0]&2&&ae()},[g,p,m,$,y,_,x,R,A,C,z,V,M,U,a,o,l,s,r,i,O,N,G,re,h,c,ye,Se,ge,Ue,Ie,ke,xe,lt,Vt,Qt,pt,qt]}class FY extends $i{constructor(e){super(),bi(this,e,BY,jY,Oi,{output:1,autoClearOutput:0,showClearOutput:2,showAutoClearOutput:3,showSectionToggles:4,showRightControls:5,isTab:6},null,[-1,-1])}}const GY=`const MiniZincIDE = (() => { const callbacks = {}; const responses = []; const freeSlots = []; @@ -194,7 +194,7 @@ function print() { __p += __j.call(arguments, '') } getFinishTime, }; })(); -`;function ES(n,e,t){const i=n.slice();return i[23]=e[t],i[24]=e,i[25]=t,i}function zS(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,W,R;return y=new wt({props:{icon:WC}}),{c(){e=k("div"),t=k("div"),t.innerHTML="Solution:",i=N(),r=k("div"),s=k("input"),o=N(),a=k("div"),c=k("input"),O=N(),p=k("div"),g=k("p"),m=k("button"),$=k("span"),Ae(y.$$.fragment),v(t,"class","solution-label svelte-g2g7zr"),v(s,"class","input is-small"),v(s,"type","number"),v(s,"min",l=n[2]>0?1:0),v(s,"max",n[2]),v(c,"type","range"),v(c,"min",h=n[2]>0?1:0),v(c,"max",n[2]),v(c,"class","svelte-g2g7zr"),v(a,"class","solution-slider svelte-g2g7zr"),v($,"class","icon"),v(m,"class","button is-small"),v(m,"title","Follow latest solution"),ne(m,"is-primary",n[0]),ne(m,"is-light",!n[0]),v(g,"class","control"),v(p,"class","field has-addons svelte-g2g7zr"),v(e,"class","top svelte-g2g7zr")},m(X,C){Y(X,e,C),Q(e,t),Q(e,i),Q(e,r),Q(r,s),si(s,n[1]),Q(e,o),Q(e,a),Q(a,c),si(c,n[1]),Q(e,O),Q(e,p),Q(p,g),Q(g,m),Q(m,$),Re(y,$,null),_=!0,W||(R=[le(s,"input",n[12]),le(c,"change",n[13]),le(c,"input",n[13]),le(m,"click",n[14])],W=!0)},p(X,C){(!_||C&4&&l!==(l=X[2]>0?1:0))&&v(s,"min",l),(!_||C&4)&&v(s,"max",X[2]),C&2&&Bo(s.value)!==X[1]&&si(s,X[1]),(!_||C&4&&h!==(h=X[2]>0?1:0))&&v(c,"min",h),(!_||C&4)&&v(c,"max",X[2]),C&2&&si(c,X[1]),(!_||C&1)&&ne(m,"is-primary",X[0]),(!_||C&1)&&ne(m,"is-light",!X[0])},i(X){_||(M(y.$$.fragment,X),_=!0)},o(X){j(y.$$.fragment,X),_=!1},d(X){X&&A(e),Xe(y),W=!1,Ft(R)}}}function MS(n){let e,t,i=n[24],r=n[25],s,l;const o=()=>n[15](e,i,r),a=()=>n[15](null,i,r);function c(...h){return n[16](n[23],...h)}return{c(){e=k("iframe"),v(e,"class","vis-window svelte-g2g7zr"),Om(e.src,t=n[23].url)||v(e,"src",t),v(e,"title","Visualisation")},m(h,O){Y(h,e,O),o(),s||(l=le(e,"load",c),s=!0)},p(h,O){n=h,O&8&&!Om(e.src,t=n[23].url)&&v(e,"src",t),(i!==n[24]||r!==n[25])&&(a(),i=n[24],r=n[25],o())},d(h){h&&A(e),a(),s=!1,l()}}}function G9(n){let e,t,i,r,s,l,o,a=n[2]>0&&zS(n),c=st(n[3]),h=[];for(let O=0;O0?a?(a.p(O,p),p&4&&M(a,1)):(a=zS(O),a.c(),M(a,1),a.m(e,t)):a&&(Je(),j(a,1,1,()=>{a=null}),et()),p&8){c=st(O[3]);let g;for(g=0;g{re=ke});ae.then(ke=>{ke.contentWindow.postMessage({event:"init",payload:L},"*")});const ye=s.reduce((ke,We)=>({...ke,[We.name]:We.state.doc.toString()}),{}),Se=[],ge=new DOMParser().parseFromString(q,"text/html");for(const ke of ge.getElementsByTagName("script")){const We=ke.getAttribute("src");if(We==="/minizinc-ide.js")ke.src=H9;else if(We in ye&&We.endsWith(".js")){const lt=URL.createObjectURL(new Blob([ye[We]],{type:"text/javascript; charset=utf-8"}));ke.src=lt,Se.push(lt)}}for(const ke of ge.getElementsByTagName("link")){const We=ke.getAttribute("href");if(We in ye&&We.endsWith(".css")){const lt=URL.createObjectURL(new Blob([ye[We]],{type:"text/css; charset=utf-8"}));ke.href=lt,Se.push(lt)}}const Ue=new XMLSerializer().serializeToString(ge.doctype)+ge.documentElement.outerHTML,Ie=URL.createObjectURL(new Blob([Ue],{type:"text/html; charset=utf-8"}));t(3,O=[...O,{key:B,url:Ie,extraUrls:Se,makeReady:re,ready:ae,solutions:[],element:null}])}function y(B,q){for(const L in B){const re=O.find(ye=>ye.key===L);if(!re){console.error(`Did not find visualisation for ${L}`);continue}const ae={time:q,data:B[L]};re.solutions.push(ae),xn({event:"solution",payload:ae},re)}t(2,h++,h)}function _(B,q){p={status:B,time:q};for(let L=0;Lre.element.contentWindow===B.source);switch(q.event){case"rebroadcast":for(const ae of O)xn(q.message,ae);q.message.event==="goToSolution"&&(l=q.message.payload===-1,t(0,o=q.message.payload===-1),a=q.message.payload+1,t(1,c=q.message.payload+1));break;case"solve":r("solve",{modelFile:q.modelFile,dataFiles:q.dataFiles,options:q.options});break;case"getNumSolutions":xn({event:"response",id:q.id,payload:L.solutions.length},L);break;case"getSolution":const re=q.index<0?q.index+L.solutions.length:q.index;if(re<0||re>=L.solutions.length)xn({event:"error",id:q.id,message:"Solution index out of range"},L);else{xn({event:"response",id:q.id,payload:L.solutions[q.index===-1?L.solutions.length-1:q.index]},L);break}case"getAllSolutions":xn({event:"response",id:q.id,payload:L.solutions},L);break;case"getStatus":xn({event:"response",id:q.id,payload:p},L);break;case"getFinishTime":xn({event:"response",id:q.id,payload:g},L);break}}function X(B,q,L){if(o&&a===c&&(a=h,t(1,c=h)),o!==l){l=o;for(const re of O)xn({event:"goToSolution",payload:o?-1:c-1},re)}if(a!==c){a=c,l=!1,t(0,o=!1);for(const re of O)xn({event:"goToSolution",payload:c-1},re)}}function C(){c=Bo(this.value),t(1,c)}function E(){c=Bo(this.value),t(1,c)}const D=()=>t(0,o=!o);function z(B,q,L){Et[B?"unshift":"push"](()=>{q[L].element=B,t(3,O)})}const F=(B,q)=>B.makeReady(q.target);return n.$$set=B=>{"files"in B&&t(6,s=B.files)},n.$$.update=()=>{n.$$.dirty&8&&t(4,i=Math.ceil(Math.sqrt(O.length))),n.$$.dirty&7&&X()},[o,c,h,O,i,R,s,m,$,y,_,W,C,E,D,z,F]}class J9 extends $i{constructor(e){super(),bi(this,e,K9,G9,Oi,{files:6,reset:7,addVisualisation:8,addSolution:9,status:10,finish:11})}get reset(){return this.$$.ctx[7]}get addVisualisation(){return this.$$.ctx[8]}get addSolution(){return this.$$.ctx[9]}get status(){return this.$$.ctx[10]}get finish(){return this.$$.ctx[11]}}const DS=[".mzn",".mzc",".dzn",".json",".html",".js",".css"];async function sQ(n){const e=n.startsWith("http://")||n.startsWith("https://")?n:`http://${n}`,t=e.split("/").pop();if(!t.endsWith(".mzp")&&DS.every(r=>!t.endsWith(r)))throw new Error("File type not recognised");const i=await fetch(new URL(e));if(!i.ok)throw new Error(`Request failed (${i.status} ${i.statusText})`);if(t.endsWith(".mzp")){const r=await i.json(),s=[],l=r.openFiles[r.openTab];let o=0;for(const c of r.projectFiles){const h=c.split("/").pop();if(DS.every(g=>!h.endsWith(g)))continue;c===l&&(o=s.length);const O=await fetch(new URL(c,e));if(!O.ok)throw new Error(`Request failed (${O.status} ${O.statusText})`);const p=await O.text();s.push({name:h,contents:p,hidden:r.openFiles.indexOf(c)===-1})}let a=r.selectedBuiltinConfigId;return a==="org.gecode.gecode"?a="org.minizinc.gecode_presolver":a==="org.chuffed.chuffed"&&(a="org.minizinc.chuffed"),{files:s,tab:o,solverId:a,timestamp:Date.now()}}else{const r=await i.text();return{files:[{name:t,contents:r}],timestamp:Date.now()}}}function e7(n){let e,t;return e=new _s({props:{active:n[0],title:"Create new file",$$slots:{default:[i7]},$$scope:{ctx:n}}}),e.$on("activate",n[8]),e.$on("cancel",n[23]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,r){const s={};r&1&&(s.active=i[0]),r&134217770&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function t7(n){let e,t;return e=new _s({props:{active:n[0],title:"Import from URL",$$slots:{footer:[r7],default:[n7]},$$scope:{ctx:n}}}),e.$on("activate",n[8]),e.$on("cancel",n[14]),e.$on("submit",n[10]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,r){const s={};r&1&&(s.active=i[0]),r&134217816&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function i7(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,W,R,X,C,E,D,z,F,B,q,L,re,ae,ye,Se,ge,Ue,Ie;return{c(){e=k("aside"),t=k("p"),t.textContent="Model",i=N(),r=k("ul"),s=k("li"),l=k("button"),l.textContent="Model file (.mzn)",o=N(),a=k("li"),c=k("button"),c.textContent="Solution checker model (.mzc.mzn)",h=N(),O=k("p"),O.textContent="Data",p=N(),g=k("ul"),m=k("li"),$=k("button"),$.textContent="Data file (.dzn)",y=N(),_=k("li"),W=k("button"),W.textContent="JSON data file (.json)",R=N(),X=k("p"),X.textContent="Visualisation",C=N(),E=k("ul"),D=k("li"),z=k("button"),z.textContent="Custom visualisation (.html)",F=N(),B=k("p"),B.textContent="Import",q=N(),L=k("ul"),re=k("li"),ae=k("button"),ae.textContent="Upload file(s)",ye=N(),Se=k("li"),ge=k("button"),ge.textContent="Import from URL",v(t,"class","menu-label"),v(l,"type","button"),v(c,"type","button"),v(r,"class","menu-list"),v(O,"class","menu-label"),v($,"type","button"),v(W,"type","button"),v(g,"class","menu-list"),v(X,"class","menu-label"),v(z,"type","button"),v(E,"class","menu-list"),v(B,"class","menu-label"),v(ae,"type","button"),v(ge,"type","button"),v(L,"class","menu-list"),v(e,"class","menu")},m(ke,We){Y(ke,e,We),Q(e,t),Q(e,i),Q(e,r),Q(r,s),Q(s,l),n[15](l),Q(r,o),Q(r,a),Q(a,c),Q(e,h),Q(e,O),Q(e,p),Q(e,g),Q(g,m),Q(m,$),Q(g,y),Q(g,_),Q(_,W),Q(e,R),Q(e,X),Q(e,C),Q(e,E),Q(E,D),Q(D,z),Q(e,F),Q(e,B),Q(e,q),Q(e,L),Q(L,re),Q(re,ae),Q(L,ye),Q(L,Se),Q(Se,ge),Ue||(Ie=[le(l,"click",n[16]),le(c,"click",n[17]),le($,"click",n[18]),le(W,"click",n[19]),le(z,"click",n[20]),le(ae,"click",n[21]),le(ge,"click",n[22])],Ue=!0)},p:Qe,d(ke){ke&&A(e),n[15](null),Ue=!1,Ft(Ie)}}}function VS(n){let e,t;return{c(){e=k("div"),t=pe(n[6]),v(e,"class","error svelte-6l40ed")},m(i,r){Y(i,e,r),Q(e,t)},p(i,r){r&64&&Ne(t,i[6])},d(i){i&&A(e)}}}function n7(n){let e,t,i,r,s,l,o=n[6]&&VS(n);return{c(){o&&o.c(),e=N(),t=k("div"),i=k("p"),r=k("input"),v(r,"class","input"),v(r,"type","text"),v(r,"pattern",".+\\.(mzn|dzn|json|js|html|css|mzp|mzc)"),r.required=!0,v(i,"class","control is-expanded"),v(t,"class","field")},m(a,c){o&&o.m(a,c),Y(a,e,c),Y(a,t,c),Q(t,i),Q(i,r),n[12](r),si(r,n[4]),s||(l=le(r,"input",n[13]),s=!0)},p(a,c){a[6]?o?o.p(a,c):(o=VS(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c&16&&r.value!==a[4]&&si(r,a[4])},d(a){a&&(A(e),A(t)),o&&o.d(a),n[12](null),s=!1,l()}}}function r7(n){let e,t,i,r,s,l;return{c(){e=k("div"),t=k("button"),t.textContent="OK",i=N(),r=k("button"),r.textContent="Cancel",v(t,"class","button is-primary"),v(r,"class","button"),v(r,"type","button"),v(e,"slot","footer")},m(o,a){Y(o,e,a),Q(e,t),Q(e,i),Q(e,r),s||(l=le(r,"click",n[11]),s=!0)},p:Qe,d(o){o&&A(e),s=!1,l()}}}function s7(n){let e,t,i,r,s,l,o;const a=[t7,e7],c=[];function h(O,p){return O[5]?0:1}return e=h(n),t=c[e]=a[e](n),{c(){t.c(),i=N(),r=k("input"),v(r,"class","is-hidden svelte-6l40ed"),v(r,"type","file"),r.multiple=!0,v(r,"accept",".mzn,.mzc,.dzn,.json,.html,.js,.css")},m(O,p){c[e].m(O,p),Y(O,i,p),Y(O,r,p),n[24](r),s=!0,l||(o=[le(r,"change",n[25]),le(r,"change",n[9])],l=!0)},p(O,[p]){let g=e;e=h(O),e===g?c[e].p(O,p):(Je(),j(c[g],1,1,()=>{c[g]=null}),et(),t=c[e],t?t.p(O,p):(t=c[e]=a[e](O),t.c()),M(t,1),t.m(i.parentNode,i))},i(O){s||(M(t),s=!0)},o(O){j(t),s=!1},d(O){O&&(A(i),A(r)),c[e].d(O),n[24](null),l=!1,Ft(o)}}}function l7(n,e,t){let{active:i=!1}=e;const r=en();let s,l,o,a="",c=!1,h=null;function O(ae){t(5,c=!1),t(4,a=""),t(6,h=null)}async function p(){await Fn(),o&&o.focus()}async function g(){const ae=[];for(const Se of l)ae.push(new Promise((ge,Ue)=>{const Ie=new FileReader;Ie.onload=()=>{ge({name:Se.name,contents:Ie.result})},Ie.onerror=ke=>Ue(ke),Ie.readAsText(Se)}));const ye=await Promise.all(ae);r("open",{files:ye})}async function m(){try{r("open",await sQ(a))}catch(ae){t(6,h=`Failed to import from URL: ${ae.message||ae}`),console.error(ae)}}const $=()=>r("cancel");function y(ae){Et[ae?"unshift":"push"](()=>{o=ae,t(3,o)})}function _(){a=this.value,t(4,a)}const W=()=>r("cancel");function R(ae){Et[ae?"unshift":"push"](()=>{o=ae,t(3,o)})}const X=()=>r("new",{type:".mzn"}),C=()=>r("new",{type:".mzc.mzn"}),E=()=>r("new",{type:".dzn"}),D=()=>r("new",{type:".json"}),z=()=>r("new",{type:".html"}),F=()=>s.click(),B=()=>t(5,c=!0),q=()=>r("cancel");function L(ae){Et[ae?"unshift":"push"](()=>{s=ae,t(1,s)})}function re(){l=this.files,t(2,l)}return n.$$set=ae=>{"active"in ae&&t(0,i=ae.active)},n.$$.update=()=>{n.$$.dirty&1&&O()},[i,s,l,o,a,c,h,r,p,g,m,$,y,_,W,R,X,C,E,D,z,F,B,q,L,re]}class o7 extends $i{constructor(e){super(),bi(this,e,l7,s7,Oi,{active:0})}}function qS(n,e,t){const i=n.slice();return i[14]=e[t],i}function IS(n,e,t){const i=n.slice();return i[17]=e[t].file,i[18]=e[t].index,i}function a7(n){let e,t,i,r,s,l,o;i=new wt({props:{icon:n[17].readOnly?rd:C1}});function a(){return n[11](n[18],n[17])}return{c(){e=k("button"),t=k("span"),Ae(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small"),v(e,"title",r="Click to "+(n[17].readOnly?"unlock":"lock")+" this file for editing"),v(e,"type","button"),ne(e,"is-primary",!n[17].readOnly),ne(e,"is-light",n[17].readOnly)},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),s=!0,l||(o=le(e,"click",a),l=!0)},p(c,h){n=c;const O={};h&2&&(O.icon=n[17].readOnly?rd:C1),i.$set(O),(!s||h&2&&r!==(r="Click to "+(n[17].readOnly?"unlock":"lock")+" this file for editing"))&&v(e,"title",r),(!s||h&2)&&ne(e,"is-primary",!n[17].readOnly),(!s||h&2)&&ne(e,"is-light",n[17].readOnly)},i(c){s||(M(i.$$.fragment,c),s=!0)},o(c){j(i.$$.fragment,c),s=!1},d(c){c&&A(e),Xe(i),l=!1,o()}}}function f7(n){let e,t,i,r;return i=new wt({props:{icon:rd}}),{c(){e=k("button"),t=k("span"),Ae(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small is-light"),v(e,"title","Compiled checkers are read only"),v(e,"type","button"),e.disabled=!0},m(s,l){Y(s,e,l),Q(e,t),Re(i,t,null),r=!0},p:Qe,i(s){r||(M(i.$$.fragment,s),r=!0)},o(s){j(i.$$.fragment,s),r=!1},d(s){s&&A(e),Xe(i)}}}function LS(n){let e,t,i=n[17].name+"",r,s,l,o,a,c,h,O,p,g,m,$,y,_,W,R,X,C,E,D,z,F,B;p=new wt({props:{icon:n[17].hidden?W1:T1}});function q(){return n[10](n[18],n[17])}const L=[f7,a7],re=[];function ae(Se,ge){return ge&2&&(y=null),y==null&&(y=!!Se[17].name.endsWith(".mzc")),y?0:1}_=ae(n,-1),W=re[_]=L[_](n),D=new wt({props:{icon:Uy}});function ye(){return n[12](n[18])}return{c(){e=k("tr"),t=k("td"),r=pe(i),s=N(),l=k("td"),o=k("div"),a=k("div"),c=k("p"),h=k("button"),O=k("span"),Ae(p.$$.fragment),m=N(),$=k("p"),W.c(),R=N(),X=k("p"),C=k("button"),E=k("span"),Ae(D.$$.fragment),v(O,"class","icon"),v(h,"class","button is-small"),v(h,"title",g="Click to "+(n[17].hidden?"show":"hide")+" this file"),v(h,"type","button"),ne(h,"is-primary",!n[17].hidden),ne(h,"is-light",n[17].hidden),v(c,"class","control"),v($,"class","control"),v(E,"class","icon"),v(C,"class","button is-small is-danger"),v(C,"title","Delete this file"),v(C,"type","button"),v(X,"class","control"),v(a,"class","field is-grouped"),v(o,"class","tool-buttons svelte-1bgv9sn")},m(Se,ge){Y(Se,e,ge),Q(e,t),Q(t,r),Q(e,s),Q(e,l),Q(l,o),Q(o,a),Q(a,c),Q(c,h),Q(h,O),Re(p,O,null),Q(a,m),Q(a,$),re[_].m($,null),Q(a,R),Q(a,X),Q(X,C),Q(C,E),Re(D,E,null),z=!0,F||(B=[le(h,"click",q),le(C,"click",ye)],F=!0)},p(Se,ge){n=Se,(!z||ge&2)&&i!==(i=n[17].name+"")&&Ne(r,i);const Ue={};ge&2&&(Ue.icon=n[17].hidden?W1:T1),p.$set(Ue),(!z||ge&2&&g!==(g="Click to "+(n[17].hidden?"show":"hide")+" this file"))&&v(h,"title",g),(!z||ge&2)&&ne(h,"is-primary",!n[17].hidden),(!z||ge&2)&&ne(h,"is-light",n[17].hidden);let Ie=_;_=ae(n,ge),_===Ie?re[_].p(n,ge):(Je(),j(re[Ie],1,1,()=>{re[Ie]=null}),et(),W=re[_],W?W.p(n,ge):(W=re[_]=L[_](n),W.c()),M(W,1),W.m($,null))},i(Se){z||(M(p.$$.fragment,Se),M(W),M(D.$$.fragment,Se),z=!0)},o(Se){j(p.$$.fragment,Se),j(W),j(D.$$.fragment,Se),z=!1},d(Se){Se&&A(e),Xe(p),re[_].d(),Xe(D),F=!1,Ft(B)}}}function NS(n){let e,t=n[14].label+"",i,r,s,l,o=st(n[14].files),a=[];for(let h=0;hj(a[h],1,1,()=>{a[h]=null});return{c(){e=k("p"),i=pe(t),r=N(),s=k("table");for(let h=0;hj(p[m],1,1,()=>{p[m]=null});return s=new wt({props:{icon:zy}}),{c(){for(let m=0;mAccept',v(e,"slot","footer")},m(t,i){Y(t,e,i)},p:Qe,d(t){t&&A(e)}}}function h7(n){let e,t;return e=new _s({props:{active:n[0],title:"Manage files",$$slots:{footer:[u7],default:[c7]},$$scope:{ctx:n}}}),e.$on("submit",n[3]),e.$on("cancel",n[3]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,[r]){const s={};r&1&&(s.active=i[0]),r&2097154&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function O7(n,e,t){let i,r,s,l,o,a,{active:c=!1}=e,{files:h=[]}=e;const O=en();function p(){O("close")}const g=(_,W)=>O("modifyFile",{index:_,options:{hidden:!W.hidden}}),m=(_,W)=>O("modifyFile",{index:_,options:{readOnly:!W.readOnly}}),$=_=>O("delete",{index:_}),y=()=>O("newFile");return n.$$set=_=>{"active"in _&&t(0,c=_.active),"files"in _&&t(4,h=_.files)},n.$$.update=()=>{n.$$.dirty&16&&t(9,i=h.map((_,W)=>({file:_,index:W}))),n.$$.dirty&512&&t(8,r=i.filter(_=>_.file.name.endsWith(".mzn")&&!_.file.name.endsWith(".mzc.mzn")).sort((_,W)=>_.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(7,s=i.filter(_=>_.file.name.endsWith(".dzn")||_.file.name.endsWith(".json")).sort((_,W)=>_.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(6,l=i.filter(_=>_.file.name.endsWith(".mzc")||_.file.name.endsWith(".mzc.mzn")).sort((_,W)=>_.file.name.localeCompare(W.file.name))),n.$$.dirty&512&&t(5,o=i.filter(_=>!_.file.name.endsWith(".mzn")&&!_.file.name.endsWith(".mzc")&&!_.file.name.endsWith(".dzn")&&!_.file.name.endsWith(".json")).sort((_,W)=>_.file.name.localeCompare(W.file.name))),n.$$.dirty&480&&t(1,a=[{label:"Model files",files:r},{label:"Data files",files:s},{label:"Solution checkers",files:l},{label:"Other files",files:o}].filter(_=>_.files.length>0))},[c,a,O,p,h,o,l,s,r,i,g,m,$,y]}class d7 extends $i{constructor(e){super(),bi(this,e,O7,h7,Oi,{active:0,files:4})}}function jS(n,e,t){const i=n.slice();return i[9]=e[t],i}function BS(n){let e,t=n[9]+"",i,r;return{c(){e=k("option"),i=pe(t),e.__value=r=n[9],si(e,e.__value),v(e,"class","svelte-1x5266v")},m(s,l){Y(s,e,l),Q(e,i)},p(s,l){l&1&&t!==(t=s[9]+"")&&Ne(i,t),l&1&&r!==(r=s[9])&&(e.__value=r,si(e,e.__value))},d(s){s&&A(e)}}}function p7(n){let e,t,i,r,s,l=st(n[0]),o=[];for(let a=0;an[6].call(t)),v(e,"class","select is-fullwidth is-multiple svelte-1x5266v")},m(a,c){Y(a,e,c),Q(e,t);for(let h=0;h0&&t(2,l=p[0])}function a(){i("accept",{modelFile:l})}const c=()=>i("cancel");function h(){l=yO(this),t(2,l),t(0,r)}const O=()=>i("cancel");return n.$$set=p=>{"modelFiles"in p&&t(0,r=p.modelFiles),"active"in p&&t(1,s=p.active)},n.$$.update=()=>{n.$$.dirty&1&&o(r)},[r,s,l,i,a,c,h,O]}class b7 extends $i{constructor(e){super(),bi(this,e,S7,m7,Oi,{modelFiles:0,active:1})}}function FS(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function GS(n,e,t){const i=n.slice();return i[22]=e[t],i}function HS(n){let e,t,i,r,s,l,o,a,c;return{c(){e=k("div"),t=k("ul"),i=k("li"),r=k("a"),r.textContent="Enter parameters",s=N(),l=k("li"),o=k("a"),o.textContent="Select data file",ne(i,"is-active",!n[2]),ne(l,"is-active",n[2]),v(e,"class","tabs")},m(h,O){Y(h,e,O),Q(e,t),Q(t,i),Q(i,r),Q(t,s),Q(t,l),Q(l,o),a||(c=[le(r,"click",n[13]),le(o,"click",n[14])],a=!0)},p(h,O){O&4&&ne(i,"is-active",!h[2]),O&4&&ne(l,"is-active",h[2])},d(h){h&&A(e),a=!1,Ft(c)}}}function $7(n){let e,t=st(n[5]),i=[];for(let r=0;rn[16].call(t)),v(e,"class","select is-fullwidth is-multiple")},m(a,c){Y(a,e,c),Q(e,t);for(let h=0;hF[B]===void 0?{name:B,value:""}:{name:B,value:F[B]}))}function $(){r?s("accept",{dataFiles:h}):s("accept",{parameters:O.reduce((F,B)=>({...F,[B.name]:B.value}),{})})}const y=()=>s("cancel"),_=()=>t(2,c=!1),W=()=>t(2,c=!0);function R(F){Et[F?"unshift":"push"](()=>{p=F,t(6,p)})}function X(){h=JW(this),t(4,h),t(1,a)}function C(F){Et[F?"unshift":"push"](()=>{p=F,t(6,p)})}function E(F,B){F[B].value=this.value,t(5,O)}function D(F,B){F[B].value=this.value,t(5,O)}const z=()=>s("cancel");return n.$$set=F=>{"active"in F&&t(0,l=F.active),"parameters"in F&&t(11,o=F.parameters),"dataFiles"in F&&t(1,a=F.dataFiles)},n.$$.update=()=>{n.$$.dirty&2048&&m(o),n.$$.dirty&2&&t(3,i=a.length>0),n.$$.dirty&12&&t(7,r=i&&c)},[l,a,c,i,h,O,p,r,s,g,$,o,y,_,W,R,X,C,E,D,z]}class x7 extends $i{constructor(e){super(),bi(this,e,P7,k7,Oi,{active:0,parameters:11,dataFiles:1})}}function eb(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,W,R=Cn(n[1],"-a"),X,C=Cn(n[1],"-f"),E,D,z,F,B,q,L,re,ae,ye=Cn(n[1],"-v"),Se,ge,Ue,Ie,ke,We,lt,Vt=Cn(n[1],"-s"),Qt,pt,qt,$e,oe,H,ue,ce,Ee,tt,ft,je,At,ut,En,_t;r=new wt({props:{icon:My}});let xt=R&&tb(n),St=C&&ib(n),Be=ye&&nb(n),fe=Vt&&rb(n);return{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),s=N(),l=k("form"),o=k("h5"),o.textContent="Solving options",a=N(),c=k("div"),h=k("p"),O=k("input"),p=N(),g=k("label"),g.textContent="Time limit (s)",m=N(),$=k("p"),y=k("input"),W=N(),xt&&xt.c(),X=N(),St&&St.c(),E=N(),D=k("h5"),D.textContent="Output options",z=N(),F=k("div"),B=k("p"),q=k("input"),L=N(),re=k("label"),re.textContent="Verbose compilation",ae=N(),Be&&Be.c(),Se=N(),ge=k("div"),Ue=k("p"),Ie=k("input"),ke=N(),We=k("label"),We.textContent="Compilation statistics",lt=N(),fe&&fe.c(),Qt=N(),pt=k("div"),qt=k("p"),$e=k("input"),oe=N(),H=k("label"),H.textContent="Timing information",ue=N(),ce=k("div"),Ee=k("p"),Ee.innerHTML='',tt=N(),ft=k("p"),je=k("button"),je.textContent="Reset to defaults",v(i,"class","icon"),v(t,"class","button is-text is-small exit-button svelte-makhy9"),v(o,"class","title is-5 svelte-makhy9"),v(O,"id","enable-timelimit"),v(O,"type","checkbox"),v(O,"class","svelte-makhy9"),v(g,"for","enable-timelimit"),v(g,"class","svelte-makhy9"),v(h,"class","control checkbox-control svelte-makhy9"),v(y,"class","input is-fullwidth"),v(y,"type","number"),v(y,"step","1"),v(y,"min",0),y.disabled=_=!n[3].enableTimeLimit,v($,"class","control is-expanded"),v(c,"class","field is-grouped"),v(D,"class","title is-5 svelte-makhy9"),v(q,"id","enable-verbose-compile"),v(q,"type","checkbox"),v(q,"class","svelte-makhy9"),v(re,"for","enable-verbose-compile"),v(re,"class","svelte-makhy9"),v(B,"class","control checkbox-control svelte-makhy9"),v(F,"class","field"),v(Ie,"id","enable-compilation-satistics"),v(Ie,"type","checkbox"),v(Ie,"class","svelte-makhy9"),v(We,"for","enable-compilation-satistics"),v(We,"class","svelte-makhy9"),v(Ue,"class","control checkbox-control svelte-makhy9"),v(ge,"class","field"),v($e,"id","enable-timing-information"),v($e,"type","checkbox"),v($e,"class","svelte-makhy9"),v(H,"for","enable-timing-information"),v(H,"class","svelte-makhy9"),v(qt,"class","control checkbox-control svelte-makhy9"),v(pt,"class","field"),v(Ee,"class","control"),v(je,"type","button"),v(je,"class","button is-danger"),v(ft,"class","control"),v(ce,"class","field is-grouped bottom-buttons svelte-makhy9"),v(e,"class","config-window svelte-makhy9")},m(Fe,He){Y(Fe,e,He),Q(e,t),Q(t,i),Re(r,i,null),Q(e,s),Q(e,l),Q(l,o),Q(l,a),Q(l,c),Q(c,h),Q(h,O),O.checked=n[3].enableTimeLimit,Q(h,p),Q(h,g),Q(c,m),Q(c,$),Q($,y),si(y,n[3].timeLimit),Q(l,W),xt&&xt.m(l,null),Q(l,X),St&&St.m(l,null),Q(l,E),Q(l,D),Q(l,z),Q(l,F),Q(F,B),Q(B,q),q.checked=n[3].verboseCompilation,Q(B,L),Q(B,re),Q(l,ae),Be&&Be.m(l,null),Q(l,Se),Q(l,ge),Q(ge,Ue),Q(Ue,Ie),Ie.checked=n[3].compilerStatistics,Q(Ue,ke),Q(Ue,We),Q(l,lt),fe&&fe.m(l,null),Q(l,Qt),Q(l,pt),Q(pt,qt),Q(qt,$e),$e.checked=n[3].outputTime,Q(qt,oe),Q(qt,H),Q(l,ue),Q(l,ce),Q(ce,Ee),Q(ce,tt),Q(ce,ft),Q(ft,je),ut=!0,En||(_t=[le(t,"click",n[10]),le(O,"change",n[11]),le(y,"input",n[12]),le(q,"change",n[15]),le(Ie,"change",n[17]),le($e,"change",n[19]),le(je,"click",n[2]),le(l,"submit",i$(n[20]))],En=!0)},p(Fe,He){He&8&&(O.checked=Fe[3].enableTimeLimit),(!ut||He&8&&_!==(_=!Fe[3].enableTimeLimit))&&(y.disabled=_),He&8&&Bo(y.value)!==Fe[3].timeLimit&&si(y,Fe[3].timeLimit),He&2&&(R=Cn(Fe[1],"-a")),R?xt?xt.p(Fe,He):(xt=tb(Fe),xt.c(),xt.m(l,X)):xt&&(xt.d(1),xt=null),He&2&&(C=Cn(Fe[1],"-f")),C?St?St.p(Fe,He):(St=ib(Fe),St.c(),St.m(l,E)):St&&(St.d(1),St=null),He&8&&(q.checked=Fe[3].verboseCompilation),He&2&&(ye=Cn(Fe[1],"-v")),ye?Be?Be.p(Fe,He):(Be=nb(Fe),Be.c(),Be.m(l,Se)):Be&&(Be.d(1),Be=null),He&8&&(Ie.checked=Fe[3].compilerStatistics),He&2&&(Vt=Cn(Fe[1],"-s")),Vt?fe?fe.p(Fe,He):(fe=rb(Fe),fe.c(),fe.m(l,Qt)):fe&&(fe.d(1),fe=null),He&8&&($e.checked=Fe[3].outputTime)},i(Fe){ut||(M(r.$$.fragment,Fe),Fe&&Hn(()=>{ut&&(At||(At=yl(e,wc,{x:100,duration:200},!0)),At.run(1))}),ut=!0)},o(Fe){j(r.$$.fragment,Fe),Fe&&(At||(At=yl(e,wc,{x:100,duration:200},!1)),At.run(0)),ut=!1},d(Fe){Fe&&A(e),Xe(r),xt&&xt.d(),St&&St.d(),Be&&Be.d(),fe&&fe.d(),Fe&&At&&At.end(),En=!1,Ft(_t)}}}function tb(n){let e,t,i,r,s,l,o;return{c(){e=k("div"),t=k("p"),i=k("input"),r=N(),s=k("label"),s.textContent="All solutions (for satisfication problems)",v(i,"id","enable-all-solutions"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-all-solutions"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].allSolutions,Q(t,r),Q(t,s),l||(o=le(i,"change",n[13]),l=!0)},p(a,c){c&8&&(i.checked=a[3].allSolutions)},d(a){a&&A(e),l=!1,o()}}}function ib(n){let e,t,i,r,s,l,o;return{c(){e=k("div"),t=k("p"),i=k("input"),r=N(),s=k("label"),s.textContent="Free search",v(i,"id","enable-free-search"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-free-search"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].freeSearch,Q(t,r),Q(t,s),l||(o=le(i,"change",n[14]),l=!0)},p(a,c){c&8&&(i.checked=a[3].freeSearch)},d(a){a&&A(e),l=!1,o()}}}function nb(n){let e,t,i,r,s,l,o;return{c(){e=k("div"),t=k("p"),i=k("input"),r=N(),s=k("label"),s.textContent="Verbose solving",v(i,"id","enable-verbose-solve"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-verbose-solve"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].verboseSolving,Q(t,r),Q(t,s),l||(o=le(i,"change",n[16]),l=!0)},p(a,c){c&8&&(i.checked=a[3].verboseSolving)},d(a){a&&A(e),l=!1,o()}}}function rb(n){let e,t,i,r,s,l,o;return{c(){e=k("div"),t=k("p"),i=k("input"),r=N(),s=k("label"),s.textContent="Solving statistics",v(i,"id","enable-solving-satistics"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-solving-satistics"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].solvingStatistics,Q(t,r),Q(t,s),l||(o=le(i,"change",n[18]),l=!0)},p(a,c){c&8&&(i.checked=a[3].solvingStatistics)},d(a){a&&A(e),l=!1,o()}}}function W7(n){let e,t,i=n[0]&&eb(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,[s]){r[0]?i?(i.p(r,s),s&1&&M(i,1)):(i=eb(r),i.c(),M(i,1),i.m(e.parentNode,e)):i&&(Je(),j(i,1,1,()=>{i=null}),et())},i(r){t||(M(i),t=!0)},o(r){j(i),t=!1},d(r){r&&A(e),i&&i.d(r)}}}function Cn(n,e){return n.indexOf(e)!==-1}function C7(n,e,t){const i=en();let{active:r}=e,{stdFlags:s=[]}=e;const l={enableTimeLimit:!1,timeLimit:1,allSolutions:!1,verboseCompilation:!1,verboseSolving:!1,compilerStatistics:!1,solvingStatistics:!1,outputTime:!1,freeSearch:!1};let o={...l};function a(B){const q=B*1e3;q!==Math.floor(q)&&t(3,o.timeLimit=Math.floor(q)/1e3,o)}function c(){for(const B in o)if(l[B]!==o[B])return!1;return!0}function h(){t(3,o={...l})}function O(B){const q={...l};for(const L in l)L in B&&(q[L]=B[L]);t(3,o=q)}function p(){return{...o}}function g(B){const q={solver:B};return o.enableTimeLimit&&o.timeLimit>0&&(q["time-limit"]=o.timeLimit*1e3),o.allSolutions&&Cn(s,"-a")&&(q["all-satisfaction"]=!0),o.verboseCompilation&&(q["verbose-compilation"]=!0),o.verboseSolving&&Cn(s,"-v")&&(q["verbose-solving"]=!0),o.compilerStatistics&&(q["compiler-statistics"]=!0),o.solvingStatistics&&Cn(s,"-s")&&(q["solver-statistics"]=!0),o.outputTime&&(q["output-time"]=!0),o.freeSearch&&Cn(s,"-f")&&(q["free-search"]=!0),q}function m(B){const q={solver:B};return o.verboseCompilation&&(q["verbose-compilation"]=!0),o.compilerStatistics&&(q["compiler-statistics"]=!0),q}const $=()=>i("close");function y(){o.enableTimeLimit=this.checked,t(3,o)}function _(){o.timeLimit=Bo(this.value),t(3,o)}function W(){o.allSolutions=this.checked,t(3,o)}function R(){o.freeSearch=this.checked,t(3,o)}function X(){o.verboseCompilation=this.checked,t(3,o)}function C(){o.verboseSolving=this.checked,t(3,o)}function E(){o.compilerStatistics=this.checked,t(3,o)}function D(){o.solvingStatistics=this.checked,t(3,o)}function z(){o.outputTime=this.checked,t(3,o)}const F=()=>i("close");return n.$$set=B=>{"active"in B&&t(0,r=B.active),"stdFlags"in B&&t(1,s=B.stdFlags)},n.$$.update=()=>{n.$$.dirty&8&&a(o.timeLimit)},[r,s,h,o,i,c,O,p,g,m,$,y,_,W,R,X,C,E,D,z,F]}class T7 extends $i{constructor(e){super(),bi(this,e,C7,W7,Oi,{active:0,stdFlags:1,isDefault:5,reset:2,load:6,save:7,getSolvingConfiguration:8,getCompilationConfiguration:9})}get isDefault(){return this.$$.ctx[5]}get reset(){return this.$$.ctx[2]}get load(){return this.$$.ctx[6]}get save(){return this.$$.ctx[7]}get getSolvingConfiguration(){return this.$$.ctx[8]}get getCompilationConfiguration(){return this.$$.ctx[9]}}function sb(n,e,t){const i=n.slice();return i[14]=e[t],i}const Z7=n=>({item:n&4}),lb=n=>({item:n[14]}),R7=n=>({item:n&8}),ob=n=>({item:n[3]});function ab(n){let e;const t=n[9].selected,i=Zi(t,n,n[8],ob),r=i||X7(n);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),e=!0},p(s,l){i?i.p&&(!e||l&264)&&Xi(i,t,s,s[8],e?Ri(t,s[8],l,R7):Ai(s[8]),ob):r&&r.p&&(!e||l&8)&&r.p(s,e?l:-1)},i(s){e||(M(r,s),e=!0)},o(s){j(r,s),e=!1},d(s){r&&r.d(s)}}}function X7(n){let e=n[3].label+"",t;return{c(){t=pe(e)},m(i,r){Y(i,t,r)},p(i,r){r&8&&e!==(e=i[3].label+"")&&Ne(t,e)},d(i){i&&A(t)}}}function A7(n){let e=n[14].label+"",t;return{c(){t=pe(e)},m(i,r){Y(i,t,r)},p(i,r){r&4&&e!==(e=i[14].label+"")&&Ne(t,e)},d(i){i&&A(t)}}}function fb(n){let e,t,i,r,s;const l=n[9].item,o=Zi(l,n,n[8],lb),a=o||A7(n);function c(){return n[11](n[14])}return{c(){e=k("a"),a&&a.c(),t=N(),v(e,"href","javascript:void(0);"),v(e,"class","dropdown-item"),ne(e,"is-active",n[3]===n[14])},m(h,O){Y(h,e,O),a&&a.m(e,null),Q(e,t),i=!0,r||(s=le(e,"click",c),r=!0)},p(h,O){n=h,o?o.p&&(!i||O&260)&&Xi(o,l,n,n[8],i?Ri(l,n[8],O,Z7):Ai(n[8]),lb):a&&a.p&&(!i||O&4)&&a.p(n,i?O:-1),(!i||O&12)&&ne(e,"is-active",n[3]===n[14])},i(h){i||(M(a,h),i=!0)},o(h){j(a,h),i=!1},d(h){h&&A(e),a&&a.d(h),r=!1,s()}}}function Y7(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$=n[3]&&ab(n);a=new wt({props:{icon:XC}});let y=st(n[2]),_=[];for(let R=0;Rj(_[R],1,1,()=>{_[R]=null});return{c(){e=N(),t=k("div"),i=k("div"),r=k("button"),s=k("span"),$&&$.c(),l=N(),o=k("span"),Ae(a.$$.fragment),c=N(),h=k("div"),O=k("div");for(let R=0;R<_.length;R+=1)_[R].c();v(o,"class","icon is-small"),v(r,"class","button"),r.disabled=n[4],v(i,"class","dropdown-trigger"),v(O,"class","dropdown-content"),v(h,"class","dropdown-menu"),v(t,"class","dropdown"),v(t,"title",n[1]),ne(t,"is-active",n[0])},m(R,X){Y(R,e,X),Y(R,t,X),Q(t,i),Q(i,r),Q(r,s),$&&$.m(s,null),Q(r,l),Q(r,o),Re(a,o,null),Q(t,c),Q(t,h),Q(h,O);for(let C=0;C<_.length;C+=1)_[C]&&_[C].m(O,null);n[12](t),p=!0,g||(m=[le(document.body,"click",n[7]),le(r,"click",n[10])],g=!0)},p(R,[X]){if(R[3]?$?($.p(R,X),X&8&&M($,1)):($=ab(R),$.c(),M($,1),$.m(s,null)):$&&(Je(),j($,1,1,()=>{$=null}),et()),(!p||X&16)&&(r.disabled=R[4]),X&332){y=st(R[2]);let C;for(C=0;Ct(0,c=!c),$=_=>p(_);function y(_){Et[_?"unshift":"push"](()=>{O=_,t(5,O)})}return n.$$set=_=>{"title"in _&&t(1,l=_.title),"items"in _&&t(2,o=_.items),"currentItem"in _&&t(3,a=_.currentItem),"active"in _&&t(0,c=_.active),"disabled"in _&&t(4,h=_.disabled),"$$scope"in _&&t(8,r=_.$$scope)},[c,l,o,a,h,O,p,g,r,i,m,$,y]}class E7 extends $i{constructor(e){super(),bi(this,e,U7,Y7,Oi,{title:1,items:2,currentItem:3,active:0,disabled:4})}}const lQ=Le.define({map:(n,e)=>({from:e.mapPos(n.from),to:e.mapPos(n.to),msg:n.msg,type:n.type})}),oQ=Le.define(),cb=pi.define({create(){return Ye.none},update(n,e){n=n.map(e.changes);for(const t of e.effects)t.is(oQ)&&(n=Ye.none),t.is(lQ)&&(n=n.update({add:[Ye.mark({class:`cm-mzn-underline-${t.value.type}`,attributes:{title:t.value.msg}}).range(t.value.from,t.value.to)]}));return n},provide:n=>de.decorations.from(n)});function $d(n,e,t){let i,r=1,s=1;for(i=0;i=n&&s>=e)return i;s++,t[i]===` -`&&(r++,s=1)}return i}function z7(n,e,t){const i=e.map(r=>lQ.of({from:$d(r.location.firstLine,r.location.firstColumn,n),to:$d(r.location.lastLine,r.location.lastColumn,n)+1,msg:`${r.type==="error"?"Error":"Warning"}: ${r.what}: ${r.message}`,type:r.type}));t.state.field(cb,!1)||i.push(Le.appendConfig.of([cb])),t.dispatch({effects:[oQ.of(null),...i]})}const ml=[];function aQ(n,e=Qe){let t;const i=new Set;function r(o){if(Oi(n,o)&&(n=o,t)){const a=!ml.length;for(const c of i)c[1](),ml.push(c,n);if(a){for(let c=0;c{i.delete(c),i.size===0&&t&&(t(),t=null)}}return{set:r,update:s,subscribe:l}}const fQ=n=>{const e=window.matchMedia(n);return aQ(e.matches,t=>{const i=()=>t(window.matchMedia(n).matches);return e.addEventListener("change",i),()=>e.removeEventListener("change",i)})},M7=fQ("(prefers-color-scheme: dark)"),D7=fQ("(max-width: 768px)"),V7=n=>({isMobile:n[1]&4194304}),ub=n=>({isMobile:n[53]}),q7=n=>({isMobile:n[1]&4194304}),hb=n=>({isMobile:n[53]}),I7=n=>({isMobile:n[1]&4194304}),Ob=n=>({isMobile:n[53]}),L7=n=>({isMobile:n[1]&4194304}),db=n=>({isMobile:n[53]}),N7=n=>({isMobile:n[1]&4194304}),pb=n=>({isMobile:n[53]});function gb(n,e,t){const i=n.slice();return i[157]=e[t],i[159]=t,i}const j7=n=>({isMobile:n[1]&4194304}),mb=n=>({isMobile:n[53]});function Sb(n,e,t){const i=n.slice();return i[157]=e[t],i[159]=t,i}const B7=n=>({isMobile:n[1]&4194304}),bb=n=>({isMobile:n[53]}),F7=n=>({isMobile:n[1]&4194304}),$b=n=>({isMobile:n[53]});function G7(n){let e,t,i,r,s,l,o,a,c;return s=new wt({props:{icon:YC}}),{c(){e=k("button"),t=k("span"),t.textContent="Run",i=N(),r=k("span"),Ae(s.$$.fragment),v(r,"class","icon"),v(e,"class","button is-primary"),v(e,"title","Run the current file"),e.disabled=l=!n[50]},m(h,O){Y(h,e,O),Q(e,t),Q(e,i),Q(e,r),Re(s,r,null),o=!0,a||(c=le(e,"click",n[62]),a=!0)},p(h,O){(!o||O[1]&524288&&l!==(l=!h[50]))&&(e.disabled=l)},i(h){o||(M(s.$$.fragment,h),o=!0)},o(h){j(s.$$.fragment,h),o=!1},d(h){h&&A(e),Xe(s),a=!1,c()}}}function H7(n){let e,t,i,r,s,l,o,a;return s=new wt({props:{icon:RC}}),{c(){e=k("button"),t=k("span"),t.textContent="Stop",i=N(),r=k("span"),Ae(s.$$.fragment),v(r,"class","icon"),v(e,"class","button is-danger"),v(e,"title","Cancel solving")},m(c,h){Y(c,e,h),Q(e,t),Q(e,i),Q(e,r),Re(s,r,null),l=!0,o||(a=le(e,"click",n[64]),o=!0)},p:Qe,i(c){l||(M(s.$$.fragment,c),l=!0)},o(c){j(s.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(s),o=!1,a()}}}function yb(n){let e,t,i,r,s,l;return{c(){e=k("div"),t=k("button"),i=k("span"),i.textContent="Compile",v(t,"class","button"),v(t,"title","Compile the current file and show the resultant FlatZinc"),t.disabled=r=n[47]||!n[49],v(e,"class","control")},m(o,a){Y(o,e,a),Q(e,t),Q(t,i),s||(l=le(t,"click",n[63]),s=!0)},p(o,a){a[1]&327680&&r!==(r=o[47]||!o[49])&&(t.disabled=r)},d(o){o&&A(e),s=!1,l()}}}function vb(n){let e,t,i;return t=new E7({props:{items:n[52],currentItem:n[0]?n[19].edge:n[19].latest,disabled:n[47],title:"Configure MiniZinc version",$$slots:{item:[K7,({item:r})=>({161:r}),({item:r})=>[0,0,0,0,0,r?64:0]]},$$scope:{ctx:n}}}),t.$on("selectItem",n[71]),{c(){e=k("div"),Ae(t.$$.fragment),v(e,"class","control")},m(r,s){Y(r,e,s),Re(t,e,null),i=!0},p(r,s){const l={};s[1]&2097152&&(l.items=r[52]),s[0]&524289&&(l.currentItem=r[0]?r[19].edge:r[19].latest),s[1]&65536&&(l.disabled=r[47]),s[4]&8192|s[5]&64&&(l.$$scope={dirty:s,ctx:r}),t.$set(l)},i(r){i||(M(t.$$.fragment,r),i=!0)},o(r){j(t.$$.fragment,r),i=!1},d(r){r&&A(e),Xe(t)}}}function K7(n){let e,t=n[161].label+"",i,r,s=n[161].detail+"",l,o;return{c(){e=k("span"),i=pe(t),r=pe(" ("),l=pe(s),o=pe(")"),v(e,"slot","item")},m(a,c){Y(a,e,c),Q(e,i),Q(e,r),Q(e,l),Q(e,o)},p(a,c){c[5]&64&&t!==(t=a[161].label+"")&&Ne(i,t),c[5]&64&&s!==(s=a[161].detail+"")&&Ne(l,s)},d(a){a&&A(e)}}}function wb(n){let e,t,i,r,s,l=st(n[23]),o=[];for(let a=0;an[93].call(i)),v(t,"class","select is-fullwidth"),v(e,"class","control is-expanded")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i);for(let h=0;hSolver:',r=N(),s=k("div"),l=k("div"),o=k("select");for(let $=0;$n[94].call(o)),v(l,"class","select is-fullwidth"),v(s,"class","control is-expanded"),v(t,"class","field has-addons"),v(e,"class","navbar-item is-hidden-mobile")},m($,y){Y($,e,y),Q(e,t),Q(t,i),Q(t,r),Q(t,s),Q(s,l),Q(l,o);for(let _=0;_{m=null}),et())},i($){c||(M(m),c=!0)},o($){j(m),c=!1},d($){$&&A(e),di(g,$),m&&m.d(),h=!1,O()}}}function kb(n){let e,t=n[157].name+"",i,r,s=n[157].version+"",l,o;return{c(){e=k("option"),i=pe(t),r=N(),l=pe(s),o=N(),e.__value=n[159],si(e,e.__value)},m(a,c){Y(a,e,c),Q(e,i),Q(e,r),Q(e,l),Q(e,o)},p(a,c){c[0]&8388608&&t!==(t=a[157].name+"")&&Ne(i,t),c[0]&8388608&&s!==(s=a[157].version+"")&&Ne(l,s)},d(a){a&&A(e)}}}function Pb(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:Ey}}),{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Solver configuration"),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Re(r,i,null),s=!0,l||(o=le(t,"click",n[55]),l=!0)},p:Qe,i(a){s||(M(r.$$.fragment,a),s=!0)},o(a){j(r.$$.fragment,a),s=!1},d(a){a&&A(e),Xe(r),l=!1,o()}}}function J7(n){let e,t,i,r,s,l,o;const a=n[92]["navbar-before-share-buttons"],c=Zi(a,n,n[137],Ob);let h=n[10]&&xb(n),O=n[11]&&Wb(n),p=n[12]&&Cb(n);const g=n[92]["navbar-share-buttons"],m=Zi(g,n,n[137],hb);return{c(){c&&c.c(),e=N(),t=k("div"),i=k("div"),h&&h.c(),r=N(),O&&O.c(),s=N(),p&&p.c(),l=N(),m&&m.c(),v(i,"class","field has-addons"),v(t,"class","navbar-item")},m($,y){c&&c.m($,y),Y($,e,y),Y($,t,y),Q(t,i),h&&h.m(i,null),Q(i,r),O&&O.m(i,null),Q(i,s),p&&p.m(i,null),Q(i,l),m&&m.m(i,null),o=!0},p($,y){c&&c.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(c,a,$,$[137],o?Ri(a,$[137],y,I7):Ai($[137]),Ob),$[10]?h?(h.p($,y),y[0]&1024&&M(h,1)):(h=xb($),h.c(),M(h,1),h.m(i,r)):h&&(Je(),j(h,1,1,()=>{h=null}),et()),$[11]?O?(O.p($,y),y[0]&2048&&M(O,1)):(O=Wb($),O.c(),M(O,1),O.m(i,s)):O&&(Je(),j(O,1,1,()=>{O=null}),et()),$[12]?p?(p.p($,y),y[0]&4096&&M(p,1)):(p=Cb($),p.c(),M(p,1),p.m(i,l)):p&&(Je(),j(p,1,1,()=>{p=null}),et()),m&&m.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(m,g,$,$[137],o?Ri(g,$[137],y,q7):Ai($[137]),hb)},i($){o||(M(c,$),M(h),M(O),M(p),M(m,$),o=!0)},o($){j(c,$),j(h),j(O),j(p),j(m,$),o=!1},d($){$&&(A(e),A(t)),c&&c.d($),h&&h.d(),O&&O.d(),p&&p.d(),m&&m.d($)}}}function e8(n){let e,t,i,r,s,l,o,a=n[8]&&!n[47]&&n[49]&&Tb(n),c=n[9]&&n[5]&&n[23].length>0&&Zb(n),h=n[4]&&!n[47]&&Rb(n);const O=n[92]["navbar-before-share-buttons"],p=Zi(O,n,n[137],db);let g=n[10]&&n[18]===0&&Xb(n),m=n[12]&&n[18]===0&&Ab(n);return{c(){a&&a.c(),e=N(),c&&c.c(),t=N(),h&&h.c(),i=N(),p&&p.c(),r=N(),g&&g.c(),s=N(),m&&m.c(),l=Gt()},m($,y){a&&a.m($,y),Y($,e,y),c&&c.m($,y),Y($,t,y),h&&h.m($,y),Y($,i,y),p&&p.m($,y),Y($,r,y),g&&g.m($,y),Y($,s,y),m&&m.m($,y),Y($,l,y),o=!0},p($,y){$[8]&&!$[47]&&$[49]?a?(a.p($,y),y[0]&256|y[1]&327680&&M(a,1)):(a=Tb($),a.c(),M(a,1),a.m(e.parentNode,e)):a&&(Je(),j(a,1,1,()=>{a=null}),et()),$[9]&&$[5]&&$[23].length>0?c?(c.p($,y),y[0]&8389152&&M(c,1)):(c=Zb($),c.c(),M(c,1),c.m(t.parentNode,t)):c&&(Je(),j(c,1,1,()=>{c=null}),et()),$[4]&&!$[47]?h?(h.p($,y),y[0]&16|y[1]&65536&&M(h,1)):(h=Rb($),h.c(),M(h,1),h.m(i.parentNode,i)):h&&(Je(),j(h,1,1,()=>{h=null}),et()),p&&p.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(p,O,$,$[137],o?Ri(O,$[137],y,L7):Ai($[137]),db),$[10]&&$[18]===0?g?(g.p($,y),y[0]&263168&&M(g,1)):(g=Xb($),g.c(),M(g,1),g.m(s.parentNode,s)):g&&(Je(),j(g,1,1,()=>{g=null}),et()),$[12]&&$[18]===0?m?(m.p($,y),y[0]&266240&&M(m,1)):(m=Ab($),m.c(),M(m,1),m.m(l.parentNode,l)):m&&(Je(),j(m,1,1,()=>{m=null}),et())},i($){o||(M(a),M(c),M(h),M(p,$),M(g),M(m),o=!0)},o($){j(a),j(c),j(h),j(p,$),j(g),j(m),o=!1},d($){$&&(A(e),A(t),A(i),A(r),A(s),A(l)),a&&a.d($),c&&c.d($),h&&h.d($),p&&p.d($),g&&g.d($),m&&m.d($)}}}function xb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:Ay}}),{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Share"),t.disabled=s=n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Re(r,i,null),l=!0,o||(a=le(t,"click",n[101]),o=!0)},p(c,h){(!l||h[0]&262144&&s!==(s=c[18]!==0))&&(t.disabled=s)},i(c){l||(M(r.$$.fragment,c),l=!0)},o(c){j(r.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(r),o=!1,a()}}}function Wb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:ZC}}),{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button"),v(t,"title","Download project"),t.disabled=s=n[37]||n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Re(r,i,null),l=!0,o||(a=le(t,"click",n[102]),o=!0)},p(c,h){(!l||h[0]&262144|h[1]&64&&s!==(s=c[37]||c[18]!==0))&&(t.disabled=s)},i(c){l||(M(r.$$.fragment,c),l=!0)},o(c){j(r.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(r),o=!1,a()}}}function Cb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:Yy}}),{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Open in playground"),t.disabled=s=n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Re(r,i,null),l=!0,o||(a=le(t,"click",n[68]),o=!0)},p(c,h){(!l||h[0]&262144&&s!==(s=c[18]!==0))&&(t.disabled=s)},i(c){l||(M(r.$$.fragment,c),l=!0)},o(c){j(r.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(r),o=!1,a()}}}function Tb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:UC}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=N(),s=k("span"),s.textContent="Compile current file",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[96]),o=!0)},p:Qe,i(c){l||(M(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(i),o=!1,a()}}}function Zb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Ey}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=N(),s=k("span"),s.textContent="Solver configuration",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[97]),o=!0)},p:Qe,i(c){l||(M(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(i),o=!1,a()}}}function Rb(n){let e,t,i,r,s,l,o=n[0]?"latest":"edge",a,c,h,O,p;return i=new wt({props:{icon:PC}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=N(),s=k("span"),l=pe("Switch to the "),a=pe(o),c=pe(" version of MiniZinc"),v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(g,m){Y(g,e,m),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),Q(s,l),Q(s,a),Q(s,c),h=!0,O||(p=le(e,"click",n[98]),O=!0)},p(g,m){(!h||m[0]&1)&&o!==(o=g[0]?"latest":"edge")&&Ne(a,o)},i(g){h||(M(i.$$.fragment,g),h=!0)},o(g){j(i.$$.fragment,g),h=!1},d(g){g&&A(e),Xe(i),O=!1,p()}}}function Xb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Ay}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=N(),s=k("span"),s.textContent="Share this project",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[99]),o=!0)},p:Qe,i(c){l||(M(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(i),o=!1,a()}}}function Ab(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Yy}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=N(),s=k("span"),s.textContent="Open in MiniZinc Playground",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[100]),o=!0)},p:Qe,i(c){l||(M(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(i),o=!1,a()}}}function Yb(n){let e,t,i;return t=new NC({props:{files:n[20],currentIndex:n[21],readonly:!n[7]}}),t.$on("selectTab",n[110]),t.$on("reorder",n[111]),t.$on("newFile",n[112]),t.$on("rename",n[58]),t.$on("close",n[113]),t.$on("manageFiles",n[114]),{c(){e=k("div"),Ae(t.$$.fragment),v(e,"class","top svelte-hl0lfa")},m(r,s){Y(r,e,s),Re(t,e,null),i=!0},p(r,s){const l={};s[0]&1048576&&(l.files=r[20]),s[0]&2097152&&(l.currentIndex=r[21]),s[0]&128&&(l.readonly=!r[7]),t.$set(l)},i(r){i||(M(t.$$.fragment,r),i=!0)},o(r){j(t.$$.fragment,r),i=!1},d(r){r&&A(e),Xe(t)}}}function Ub(n){let e,t,i={state:n[51]};return e=new cC({props:i}),n[115](e),{c(){Ae(e.$$.fragment)},m(r,s){Re(e,r,s),t=!0},p(r,s){const l={};s[1]&1048576&&(l.state=r[51]),e.$set(l)},i(r){t||(M(e.$$.fragment,r),t=!0)},o(r){j(e.$$.fragment,r),t=!1},d(r){n[115](null),Xe(e,r)}}}function t8(n){let e,t,i,r,s=n[6]&&Yb(n),l=n[51]&&Ub(n);return{c(){e=k("div"),s&&s.c(),t=N(),i=k("div"),l&&l.c(),v(i,"class","grow svelte-hl0lfa"),v(e,"class","panel stack svelte-hl0lfa"),v(e,"slot","panelA")},m(o,a){Y(o,e,a),s&&s.m(e,null),Q(e,t),Q(e,i),l&&l.m(i,null),r=!0},p(o,a){o[6]?s?(s.p(o,a),a[0]&64&&M(s,1)):(s=Yb(o),s.c(),M(s,1),s.m(e,t)):s&&(Je(),j(s,1,1,()=>{s=null}),et()),o[51]?l?(l.p(o,a),a[1]&1048576&&M(l,1)):(l=Ub(o),l.c(),M(l,1),l.m(i,null)):l&&(Je(),j(l,1,1,()=>{l=null}),et())},i(o){r||(M(s),M(l),r=!0)},o(o){j(s),j(l),r=!1},d(o){o&&A(e),s&&s.d(),l&&l.d()}}}function Eb(n){let e,t,i,r,s,l,o,a,c,h,O,p,g=n[13]&&zb(n);return{c(){e=k("div"),t=k("div"),i=k("ul"),r=k("li"),s=k("a"),s.textContent="Output",l=N(),o=k("li"),a=k("a"),a.textContent="Visualisation",c=N(),g&&g.c(),v(s,"href","javascript:void(0);"),ne(r,"is-active",!n[43]),v(a,"href","javascript:void(0);"),ne(o,"is-active",n[43]),v(t,"class","tabs is-boxed"),v(e,"class","top svelte-hl0lfa")},m(m,$){Y(m,e,$),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Q(i,l),Q(i,o),Q(o,a),Q(i,c),g&&g.m(i,null),h=!0,O||(p=[le(s,"click",n[103]),le(a,"click",n[104])],O=!0)},p(m,$){(!h||$[1]&4096)&&ne(r,"is-active",!m[43]),(!h||$[1]&4096)&&ne(o,"is-active",m[43]),m[13]?g?(g.p(m,$),$[0]&8192&&M(g,1)):(g=zb(m),g.c(),M(g,1),g.m(i,null)):g&&(Je(),j(g,1,1,()=>{g=null}),et())},i(m){h||(M(g),h=!0)},o(m){j(g),h=!1},d(m){m&&A(e),g&&g.d(),O=!1,Ft(p)}}}function zb(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:Dy}}),{c(){e=k("li"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small"),v(t,"title","Switch orientation"),v(e,"class","tab-end svelte-hl0lfa")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Re(r,i,null),s=!0,l||(o=le(t,"click",n[70]),l=!0)},p:Qe,i(a){s||(M(r.$$.fragment,a),s=!0)},o(a){j(r.$$.fragment,a),s=!1},d(a){a&&A(e),Xe(r),l=!1,o()}}}function Mb(n){let e,t,i,r,s,l;return i=new wt({props:{icon:Dy}}),{c(){e=k("button"),t=k("span"),Ae(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small"),v(e,"title","Switch orientation")},m(o,a){Y(o,e,a),Q(e,t),Re(i,t,null),r=!0,s||(l=le(e,"click",n[70]),s=!0)},p:Qe,i(o){r||(M(i.$$.fragment,o),r=!0)},o(o){j(i.$$.fragment,o),r=!1},d(o){o&&A(e),Xe(i),s=!1,l()}}}function i8(n){let e,t,i=n[13]&&!n[42]&&Mb(n);return{c(){e=k("p"),i&&i.c(),v(e,"class","control"),v(e,"slot","before-right-controls")},m(r,s){Y(r,e,s),i&&i.m(e,null),t=!0},p(r,s){r[13]&&!r[42]?i?(i.p(r,s),s[0]&8192|s[1]&2048&&M(i,1)):(i=Mb(r),i.c(),M(i,1),i.m(e,null)):i&&(Je(),j(i,1,1,()=>{i=null}),et())},i(r){t||(M(i),t=!0)},o(r){j(i),t=!1},d(r){r&&A(e),i&&i.d()}}}function n8(n){let e,t,i,r,s,l,o,a,c,h,O=n[42]&&Eb(n),p={files:n[20]};s=new J9({props:p}),n[105](s),s.$on("solve",n[106]);function g($){n[107]($)}let m={output:n[33],showClearOutput:n[14],showAutoClearOutput:n[15],showSectionToggles:n[16],showRightControls:n[17],isTab:n[42],$$slots:{"before-right-controls":[i8]},$$scope:{ctx:n}};return n[1]!==void 0&&(m.autoClearOutput=n[1]),a=new B9({props:m}),Et.push(()=>qo(a,"autoClearOutput",g)),a.$on("clear",n[108]),a.$on("goto",n[109]),{c(){e=k("div"),O&&O.c(),t=N(),i=k("div"),r=k("div"),Ae(s.$$.fragment),l=N(),o=k("div"),Ae(a.$$.fragment),v(r,"class","tab-window svelte-hl0lfa"),ne(r,"visible",n[43]),v(o,"class","tab-window svelte-hl0lfa"),ne(o,"visible",!n[42]||!n[43]),v(i,"class","grow svelte-hl0lfa"),v(e,"class","panel stack svelte-hl0lfa"),v(e,"slot","panelB")},m($,y){Y($,e,y),O&&O.m(e,null),Q(e,t),Q(e,i),Q(i,r),Re(s,r,null),Q(i,l),Q(i,o),Re(a,o,null),h=!0},p($,y){$[42]?O?(O.p($,y),y[1]&2048&&M(O,1)):(O=Eb($),O.c(),M(O,1),O.m(e,t)):O&&(Je(),j(O,1,1,()=>{O=null}),et());const _={};y[0]&1048576&&(_.files=$[20]),s.$set(_),(!h||y[1]&4096)&&ne(r,"visible",$[43]);const W={};y[1]&4&&(W.output=$[33]),y[0]&16384&&(W.showClearOutput=$[14]),y[0]&32768&&(W.showAutoClearOutput=$[15]),y[0]&65536&&(W.showSectionToggles=$[16]),y[0]&131072&&(W.showRightControls=$[17]),y[1]&2048&&(W.isTab=$[42]),y[0]&8192|y[1]&2048|y[4]&8192&&(W.$$scope={dirty:y,ctx:$}),!c&&y[0]&2&&(c=!0,W.autoClearOutput=$[1],Vo(()=>c=!1)),a.$set(W),(!h||y[1]&6144)&&ne(o,"visible",!$[42]||!$[43])},i($){h||(M(O),M(s.$$.fragment,$),M(a.$$.fragment,$),h=!0)},o($){j(O),j(s.$$.fragment,$),j(a.$$.fragment,$),h=!1},d($){$&&A(e),O&&O.d(),n[105](null),Xe(s),Xe(a)}}}function r8(n){let e,t,i,r=n[20][n[29]].name+"",s,l,o,a;return{c(){e=k("p"),t=pe("Are you sure you wish to delete "),i=k("code"),s=pe(r),l=pe("?"),o=N(),a=k("p"),a.textContent="This cannot be undone."},m(c,h){Y(c,e,h),Q(e,t),Q(e,i),Q(i,s),Q(e,l),Y(c,o,h),Y(c,a,h)},p(c,h){h[0]&537919488&&r!==(r=c[20][c[29]].name+"")&&Ne(s,r)},d(c){c&&(A(e),A(o),A(a))}}}function s8(n){let e,t,i,r,s,l;return{c(){e=k("div"),t=k("button"),t.textContent="Delete",i=N(),r=k("button"),r.textContent="Cancel",v(t,"class","button is-danger"),v(r,"type","button"),v(r,"class","button"),v(e,"slot","footer")},m(o,a){Y(o,e,a),Q(e,t),Q(e,i),Q(e,r),s||(l=[le(t,"click",n[126]),le(r,"click",n[127])],s=!0)},p:Qe,d(o){o&&A(e),s=!1,Ft(l)}}}function l8(n){let e,t,i,r,s,l,o,a,c,h,O;return a=new wt({props:{icon:xC}}),{c(){e=k("div"),t=k("p"),i=k("input"),r=N(),s=k("p"),l=k("button"),o=k("span"),Ae(a.$$.fragment),v(i,"class","input"),v(i,"type","text"),i.value=n[39],i.readOnly=!0,v(t,"class","control is-expanded"),v(o,"class","icon"),v(l,"type","button"),v(l,"class","button"),ne(l,"is-primary",!n[40]),ne(l,"is-success",n[40]),v(s,"class","control"),v(e,"class","field has-addons")},m(p,g){Y(p,e,g),Q(e,t),Q(t,i),n[134](i),Q(e,r),Q(e,s),Q(s,l),Q(l,o),Re(a,o,null),c=!0,h||(O=[le(i,"click",n[135]),le(l,"click",n[67])],h=!0)},p(p,g){(!c||g[1]&256&&i.value!==p[39])&&(i.value=p[39]),(!c||g[1]&512)&&ne(l,"is-primary",!p[40]),(!c||g[1]&512)&&ne(l,"is-success",p[40])},i(p){c||(M(a.$$.fragment,p),c=!0)},o(p){j(a.$$.fragment,p),c=!1},d(p){p&&A(e),n[134](null),Xe(a),h=!1,Ft(O)}}}function o8(n){let e,t,i,r;return{c(){e=k("div"),t=k("button"),t.textContent="Done",v(t,"class","button is-primary"),v(e,"slot","footer")},m(s,l){Y(s,e,l),Q(e,t),i||(r=le(t,"click",n[133]),i=!0)},p:Qe,d(s){s&&A(e),i=!1,r()}}}function a8(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,W,R,X,C,E,D,z,F,B,q,L,re,ae,ye,Se,ge,Ue,Ie,ke,We,lt,Vt,Qt,pt,qt,$e,oe,H,ue,ce,Ee,tt,ft,je,At,ut,En,_t,xt,St;const Be=n[92]["navbar-before-run-buttons"],fe=Zi(Be,n,n[137],$b),Fe=[H7,G7],He=[];function gi(J,we){return J[47]?0:1}O=gi(n),p=He[O]=Fe[O](n);let Wt=!n[53]&&n[8]&&yb(n),gt=!n[53]&&n[4]&&vb(n);const zn=n[92]["navbar-run-buttons"],oi=Zi(zn,n,n[137],bb);let Ht=n[53]&&n[5]&&n[23].length>0&&wb(n);const gn=n[92]["navbar-after-run-buttons"],Ct=Zi(gn,n,n[137],mb);let De=n[5]&&n[23].length>0&&_b(n);const mn=n[92]["navbar-after-solver-selector"],ri=Zi(mn,n,n[137],pb),Kt=[e8,J7],Sn=[];function tr(J,we){return J[53]?0:1}Se=tr(n),ge=Sn[Se]=Kt[Se](n);const Nr=n[92]["navbar-after-share-buttons"],zt=Zi(Nr,n,n[137],ub);function Ts(J){n[116](J)}let Zs={direction:n[2],showPanels:n[48],$$slots:{panelB:[n8],panelA:[t8]},$$scope:{ctx:n}};n[3]!==void 0&&(Zs.split=n[3]),lt=new $C({props:Zs}),Et.push(()=>qo(lt,"split",Ts));let Hl={active:n[35],stdFlags:n[45]};pt=new T7({props:Hl}),n[117](pt),pt.$on("close",n[118]),$e=new d7({props:{active:n[30],files:n[20]}}),$e.$on("close",n[119]),$e.$on("delete",n[120]),$e.$on("modifyFile",n[121]),$e.$on("newFile",n[122]),H=new o7({props:{active:n[28]}}),H.$on("cancel",n[123]),H.$on("new",n[124]),H.$on("open",n[125]),ce=new _s({props:{active:n[29]!==null,title:"Delete file",$$slots:{footer:[s8],default:[r8]},$$scope:{ctx:n}}}),ce.$on("cancel",n[128]),tt=new b7({props:{active:n[31],modelFiles:n[44]}}),tt.$on("accept",n[129]),tt.$on("cancel",n[130]),je=new x7({props:{active:n[32],dataFiles:n[46],parameters:n[34]}}),je.$on("accept",n[131]),je.$on("cancel",n[132]),ut=new _s({props:{active:n[39],title:"Share this project",$$slots:{footer:[o8],default:[l8]},$$scope:{ctx:n}}}),ut.$on("cancel",n[136]);const jr=n[92].default,Pi=Zi(jr,n,n[137],null);return{c(){e=k("div"),t=k("div"),i=k("div"),r=k("div"),s=k("nav"),l=k("div"),fe&&fe.c(),o=N(),a=k("div"),c=k("div"),h=k("div"),p.c(),g=N(),Wt&&Wt.c(),m=N(),gt&>.c(),$=N(),oi&&oi.c(),y=N(),Ht&&Ht.c(),_=N(),Ct&&Ct.c(),W=N(),De&&De.c(),R=N(),ri&&ri.c(),X=N(),C=k("a"),E=k("span"),D=N(),z=k("span"),F=N(),B=k("span"),q=N(),L=k("div"),re=k("div"),ae=N(),ye=k("div"),ge.c(),Ue=N(),zt&&zt.c(),Ie=N(),ke=k("div"),We=k("div"),Ae(lt.$$.fragment),Qt=N(),Ae(pt.$$.fragment),qt=N(),Ae($e.$$.fragment),oe=N(),Ae(H.$$.fragment),ue=N(),Ae(ce.$$.fragment),Ee=N(),Ae(tt.$$.fragment),ft=N(),Ae(je.$$.fragment),At=N(),Ae(ut.$$.fragment),En=N(),Pi&&Pi.c(),v(h,"class","control"),v(c,"class","field navbar-run-buttons has-addons svelte-hl0lfa"),v(a,"class","navbar-item is-expanded"),v(E,"aria-hidden","true"),v(z,"aria-hidden","true"),v(B,"aria-hidden","true"),v(C,"role","button"),v(C,"class","navbar-burger"),v(C,"aria-label","menu"),v(C,"aria-expanded",n[26]),ne(C,"is-active",n[26]),v(l,"class","navbar-brand"),v(re,"class","navbar-start is-hidden-tablet"),v(ye,"class","navbar-end"),v(L,"class","navbar-menu"),ne(L,"is-active",n[26]),v(s,"class","navbar"),v(r,"class","top svelte-hl0lfa"),v(We,"class","left svelte-hl0lfa"),v(ke,"class","grow main-panel svelte-hl0lfa"),v(i,"class","stack svelte-hl0lfa"),v(t,"class","mzn-playground-wrapper svelte-hl0lfa"),ne(t,"is-dark",n[24]),v(e,"class","mzn-playground svelte-hl0lfa")},m(J,we){Y(J,e,we),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Q(s,l),fe&&fe.m(l,null),Q(l,o),Q(l,a),Q(a,c),Q(c,h),He[O].m(h,null),Q(c,g),Wt&&Wt.m(c,null),Q(c,m),gt&>.m(c,null),Q(c,$),oi&&oi.m(c,null),Q(c,y),Ht&&Ht.m(c,null),Q(l,_),Ct&&Ct.m(l,null),Q(l,W),De&&De.m(l,null),Q(l,R),ri&&ri.m(l,null),Q(l,X),Q(l,C),Q(C,E),Q(C,D),Q(C,z),Q(C,F),Q(C,B),Q(s,q),Q(s,L),Q(L,re),Q(L,ae),Q(L,ye),Sn[Se].m(ye,null),Q(ye,Ue),zt&&zt.m(ye,null),Q(i,Ie),Q(i,ke),Q(ke,We),Re(lt,We,null),Q(ke,Qt),Re(pt,ke,null),Q(t,qt),Re($e,t,null),Q(t,oe),Re(H,t,null),Q(t,ue),Re(ce,t,null),Q(t,Ee),Re(tt,t,null),Q(t,ft),Re(je,t,null),Q(t,At),Re(ut,t,null),Q(t,En),Pi&&Pi.m(t,null),_t=!0,xt||(St=le(C,"click",n[95]),xt=!0)},p(J,we){fe&&fe.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(fe,Be,J,J[137],_t?Ri(Be,J[137],we,F7):Ai(J[137]),$b);let tn=O;O=gi(J),O===tn?He[O].p(J,we):(Je(),j(He[tn],1,1,()=>{He[tn]=null}),et(),p=He[O],p?p.p(J,we):(p=He[O]=Fe[O](J),p.c()),M(p,1),p.m(h,null)),!J[53]&&J[8]?Wt?Wt.p(J,we):(Wt=yb(J),Wt.c(),Wt.m(c,m)):Wt&&(Wt.d(1),Wt=null),!J[53]&&J[4]?gt?(gt.p(J,we),we[0]&16|we[1]&4194304&&M(gt,1)):(gt=vb(J),gt.c(),M(gt,1),gt.m(c,$)):gt&&(Je(),j(gt,1,1,()=>{gt=null}),et()),oi&&oi.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(oi,zn,J,J[137],_t?Ri(zn,J[137],we,B7):Ai(J[137]),bb),J[53]&&J[5]&&J[23].length>0?Ht?Ht.p(J,we):(Ht=wb(J),Ht.c(),Ht.m(c,null)):Ht&&(Ht.d(1),Ht=null),Ct&&Ct.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(Ct,gn,J,J[137],_t?Ri(gn,J[137],we,j7):Ai(J[137]),mb),J[5]&&J[23].length>0?De?(De.p(J,we),we[0]&8388640&&M(De,1)):(De=_b(J),De.c(),M(De,1),De.m(l,R)):De&&(Je(),j(De,1,1,()=>{De=null}),et()),ri&&ri.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(ri,mn,J,J[137],_t?Ri(mn,J[137],we,N7):Ai(J[137]),pb),(!_t||we[0]&67108864)&&v(C,"aria-expanded",J[26]),(!_t||we[0]&67108864)&&ne(C,"is-active",J[26]);let Br=Se;Se=tr(J),Se===Br?Sn[Se].p(J,we):(Je(),j(Sn[Br],1,1,()=>{Sn[Br]=null}),et(),ge=Sn[Se],ge?ge.p(J,we):(ge=Sn[Se]=Kt[Se](J),ge.c()),M(ge,1),ge.m(ye,Ue)),zt&&zt.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(zt,Nr,J,J[137],_t?Ri(Nr,J[137],we,V7):Ai(J[137]),ub),(!_t||we[0]&67108864)&&ne(L,"is-active",J[26]);const Mn={};we[0]&4&&(Mn.direction=J[2]),we[1]&131072&&(Mn.showPanels=J[48]),we[0]&1916002498|we[1]&1055748|we[4]&8192&&(Mn.$$scope={dirty:we,ctx:J}),!Vt&&we[0]&8&&(Vt=!0,Mn.split=J[3],Vo(()=>Vt=!1)),lt.$set(Mn);const vr={};we[1]&16&&(vr.active=J[35]),we[1]&16384&&(vr.stdFlags=J[45]),pt.$set(vr);const ir={};we[0]&1073741824&&(ir.active=J[30]),we[0]&1048576&&(ir.files=J[20]),$e.$set(ir);const Rs={};we[0]&268435456&&(Rs.active=J[28]),H.$set(Rs);const nr={};we[0]&536870912&&(nr.active=J[29]!==null),we[0]&537919488|we[4]&8192&&(nr.$$scope={dirty:we,ctx:J}),ce.$set(nr);const kt={};we[1]&1&&(kt.active=J[31]),we[1]&8192&&(kt.modelFiles=J[44]),tt.$set(kt);const wr={};we[1]&2&&(wr.active=J[32]),we[1]&32768&&(wr.dataFiles=J[46]),we[1]&8&&(wr.parameters=J[34]),je.$set(wr);const Fr={};we[1]&256&&(Fr.active=J[39]),we[1]&896|we[4]&8192&&(Fr.$$scope={dirty:we,ctx:J}),ut.$set(Fr),Pi&&Pi.p&&(!_t||we[4]&8192)&&Xi(Pi,jr,J,J[137],_t?Ri(jr,J[137],we,null):Ai(J[137]),null),(!_t||we[0]&16777216)&&ne(t,"is-dark",J[24])},i(J){_t||(M(fe,J),M(p),M(gt),M(oi,J),M(Ct,J),M(De),M(ri,J),M(ge),M(zt,J),M(lt.$$.fragment,J),M(pt.$$.fragment,J),M($e.$$.fragment,J),M(H.$$.fragment,J),M(ce.$$.fragment,J),M(tt.$$.fragment,J),M(je.$$.fragment,J),M(ut.$$.fragment,J),M(Pi,J),_t=!0)},o(J){j(fe,J),j(p),j(gt),j(oi,J),j(Ct,J),j(De),j(ri,J),j(ge),j(zt,J),j(lt.$$.fragment,J),j(pt.$$.fragment,J),j($e.$$.fragment,J),j(H.$$.fragment,J),j(ce.$$.fragment,J),j(tt.$$.fragment,J),j(je.$$.fragment,J),j(ut.$$.fragment,J),j(Pi,J),_t=!1},d(J){J&&A(e),fe&&fe.d(J),He[O].d(),Wt&&Wt.d(),gt&>.d(),oi&&oi.d(J),Ht&&Ht.d(),Ct&&Ct.d(J),De&&De.d(),ri&&ri.d(J),Sn[Se].d(),zt&&zt.d(J),Xe(lt),n[117](null),Xe(pt),Xe($e),Xe(H),Xe(ce),Xe(tt),Xe(je),Xe(ut),Pi&&Pi.d(J),xt=!1,St()}}}function Db(n,e){n.effects=n.effects?[...n.effects,e]:[e]}function f8(n,e,t){let i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,W,R,X,C;$O(n,M7,Z=>t(91,X=Z)),$O(n,D7,Z=>t(53,C=Z));let{$$slots:E={},$$scope:D}=e,{showVersionSwitcher:z=!0}=e,{showSolverDropdown:F=!0}=e,{edgeMiniZinc:B=!1}=e,{autoClearOutput:q=!1}=e,{showTabs:L=!0}=e,{canEditTabs:re=!0}=e,{compilationEnabled:ae=!0}=e,{project:ye}=e,{enabledSolvers:Se=null}=e,{canEditSolverSettings:ge=!0}=e,{showShareButton:Ue=!0}=e,{showDownloadButton:Ie=!0}=e,{externalPlaygroundURL:ke=null}=e,{splitterDirection:We="vertical"}=e,{splitterSize:lt=75}=e,{canSwitchOrientation:Vt=!0}=e,{showClearOutput:Qt=!0}=e,{showAutoClearOutput:pt=!0}=e,{showOutputSectionToggles:qt=!0}=e,{showOutputRightControls:$e=!0}=e,{theme:oe="auto"}=e,{hideOutputOnStartup:H=!0}=e,{autoFocus:ue=!0}=e;const ce=en();let Ee=0,tt=[],ft,je,At={latest:{label:"Latest",detail:"stable"},edge:{label:"Edge",detail:"development"}};function ut(Z){const he=B?IW:qW;if(je!==he){t(18,Ee++,Ee);const be=ft;ft=new Promise(async(Pe,ze)=>{be&&await be,je&&je.shutdown(),je=he,je.shutdown(),await je.init();const[it]=/version \d+\.\d+\.\d+(?:, build .*)?$/m.exec(await je.version()),Ze=B?"edge":"latest";t(19,At={...At,[Ze]:{...At[Ze],detail:it}}),t(83,tt=await je.solvers()),await Fn(),t(18,Ee--,Ee),Pe()})}return ft}const En=new Promise((Z,he)=>{Hc(()=>{ut(),Z()})});async function _t(Z){t(0,B=Z.minizincVersion==="edge"),await En,t(20,fe=[]),Zs(Z.files,ue),t(21,He=Z.tab||0),await ut(),Z.solverId?t(22,Kt=y.findIndex(he=>he.id===Z.solverId)):t(22,Kt=y.findIndex(he=>he.extraInfo&&he.extraInfo.isDefault)||0),Z.solverConfig?gi.load(Z.solverConfig):gi.reset()}async function xt(Z){const he=fe.length;Zs(Z.files),Z.tab!==void 0&&Z.tab!==null&&Z.tab>=0&&zt(he+Z.tab),Z.solverId&&(await ut(),t(22,Kt=y.findIndex(be=>be.id===Z.solverId)))}function St(){return fe.length>0}let Be,fe=[],Fe=!1,He=0,gi,Wt=!1,gt=null,zn=!1,oi=!1,Ht=null,gn=!1,Ct=[],De=null,mn=[],ri={},Kt=-1;async function Sn(Z,he){if(await ut(),Kt<0||Kt>=y.length){const be=y.findIndex(Pe=>Pe.extraInfo&&Pe.extraInfo.isDefault);be!==-1&&t(22,Kt=be)}}let tr=!1;function Nr(){t(35,tr=!tr)}async function zt(Z,he=!0){for(Be&&He=0&&fe[Z].hidden;)Z--;Z===-1&&(Z=fe.findIndex(be=>!be.hidden)),t(21,He=Z),await Fn(),Be&&h&&(he&&Be.focus(),h.scrollTop!==void 0&&Be.getView().requestMeasure({read(be){be.scrollDOM.scrollTo(h.scrollLeft,h.scrollTop)}}))}function Ts(Z){let he=`Untitled${Z}`,be=2;for(;fe.find(Pe=>Pe.name===he);)he=`Untitled-${be++}${Z}`;t(20,fe=[...fe,{name:he,state:Ot.create({extensions:ec(Z,kr,R)})}]),zt(fe.length-1),t(28,Wt=!1)}function Zs(Z,he=!0){let be=[];for(const Pe of Z){const ze=Pe.name.endsWith(".mzc.mzn")?Pe.name.length-8:Pe.name.lastIndexOf("."),it=Pe.name.substring(0,ze).replaceAll(/[\/\\\.]/g,""),Ze=Pe.name.substring(ze);let mi=`${it}${Ze}`,Zt=2;for(;fe.find(oo=>oo.name===mi);)mi=`${it}-${Zt++}${Ze}`;const Jr=ec(Ze,kr,R,Pe.readOnly);be.push({...Pe,hidden:Pe.hidden||Ze===".mzc",name:mi,state:Ot.create({doc:Pe.contents,extensions:Jr,selection:{anchor:Pe.anchor||0}})})}t(20,fe=[...fe,...be]),zt(fe.length-1,he),t(28,Wt=!1)}function Hl(Z){const{index:he,name:be,suffix:Pe}=Z.detail;let ze=be,it=2;for(;fe.some(Ze=>Ze===ze+Pe);)ze=`${be}-${it++}`;h&&t(87,h.state=Be.getState(),h),t(20,fe=[...fe.slice(0,he),{...fe[he],name:be+Pe},...fe.slice(he+1)])}function jr(Z){const he=r===1&&!fe[Z].hidden;t(20,fe=[...fe.slice(0,Z),...fe.slice(Z+1),...he?[{name:"Untitled.mzn",state:Ot.create({extensions:ec(".mzn",kr,R)})}]:[]]),He>=fe.length?zt(fe.length-1):zt(He),t(29,gt=null)}function Pi(Z,he){h&&t(87,h.state=Be.getState(),h);const be={...fe[Z],...he};"readOnly"in he&&Db(be,he.readOnly?h9:O9),t(20,fe=[...fe.slice(0,Z),be,...fe.slice(Z+1)]),zt(He)}function J(Z,he){let be;Z0){await Fn();const he=Be.getView();he&&he.state===Z.state&&(he.dispatch({effects:Z.effects}),Z.effects=[])}}let tn=null;async function Br(Z){t(18,Ee++,Ee),t(87,h.state=Be.getState(),h);let he=O?h:null;if(!he){if(m.length===0)return t(18,Ee--,Ee),!1;if(m.length===1)he=fe.find(ze=>ze.name===m[0]);else try{const ze=await new Promise((it,Ze)=>{t(36,tn=it),t(31,oi=!0)});if(!ze)return t(18,Ee--,Ee),!1;he=fe.find(it=>it.name===ze.modelFile)}finally{t(31,oi=!1)}}const be=new je.Model,Pe=[he.name];{const ze=he.name.substring(0,he.name.length-4),it=fe.find(Ze=>Ze.name===`${ze}.mzc`||Ze.name===`${ze}.mzc.mzn`);it&&Pe.push(it.name)}he!==h&&Pe.push(h.name);for(const ze of fe)be.addFile(ze.name,ze.state.doc.toString(),Pe.indexOf(ze.name)!==-1);try{const{input:ze}=await be.interface({options:gi.getCompilationConfiguration(_.id)});if(Object.keys(ze).length>0){const it={};for(const Ze in ze)it[Ze]=ri[Ze];t(34,ri=it),p&&mn.indexOf(h.name)===-1&&(mn=[...mn,h.name]);try{const Ze=await new Promise((mi,Zt)=>{t(36,tn=mi),t(32,Ht=!0)});if(!Ze)return t(18,Ee--,Ee),!1;if(Ze.parameters){let mi="";for(const Zt in Ze.parameters)Ze.parameters[Zt].trim().length>0&&(mi+=`${Zt} = ${Ze.parameters[Zt]}; -`);be.addDznString(mi),t(34,ri=Ze.parameters)}else{for(const mi of Ze.dataFiles)Pe.indexOf(mi)===-1&&(be.addFile(mi),Pe.push(mi));mn=Ze.dataFiles}}finally{t(32,Ht=!1)}}}catch(ze){console.error(ze)}return t(18,Ee--,Ee),{model:be,fileList:Pe}}async function Mn(){if(g){const ze=new je.Model;ze.addFile(h.name,h.state.doc.toString());const it=[h.name],Ze=gi.getSolvingConfiguration(_.id);await vr(ze,it,Ze);return}const Z=await Br();if(!Z)return;const{model:he,fileList:be}=Z,Pe=gi.getSolvingConfiguration(_.id);await vr(he,be,Pe)}async function vr(Z,he,be){t(84,gn=!0);const Pe=Date.now();q&&t(33,Ct=[]),t(33,Ct=[...Ct,{files:he,output:[]}]),t(85,De=Z.solve({options:be,jsonOutput:!1})),wr(),De.on("error",kt),De.on("warning",kt),De.on("solution",ze=>kt(ze,Date.now()-Pe)),De.on("status",ze=>kt(ze,Date.now()-Pe)),De.on("statistics",kt),De.on("trace",ze=>kt(ze,Date.now()-Pe)),De.on("statistics",kt),De.on("comment",kt),De.on("time",kt),De.on("checker",kt),De.on("stderr",kt);try{await De,kt({type:"exit",code:0,runTime:Date.now()-Pe})}catch(ze){kt({type:"exit",code:ze.code,runTime:Date.now()-Pe})}t(85,De=null)}async function ir(){t(84,gn=!0);const Z=await Br();if(!Z)return;wr();const{model:he,fileList:be}=Z,Pe=be[0],ze=Date.now();q&&t(33,Ct=[]),t(33,Ct=[...Ct,{files:be,isCompile:!0,output:[]}]),t(85,De=he.compile({options:gi.getCompilationConfiguration(_.id)})),De.on("error",kt),De.on("warning",kt),De.on("statistics",kt),De.on("trace",kt),De.on("statistics",kt),De.on("stderr",kt);try{const it=await De;t(20,fe=[...fe,{name:`${Pe.substring(0,Pe.indexOf("."))}.fzn`,state:Ot.create({extensions:ec(".fzn",kr,R),doc:it})}]),zt(fe.length-1),kt({type:"exit",code:0,runTime:Date.now()-ze})}catch(it){kt({type:"exit",code:it.code,runTime:Date.now()-ze})}t(85,De=null)}function Rs(){kt({type:"cancel"}),De.cancel()}let nr=null;function kt(Z,he){nr?nr.then(()=>{nr=Fr(Z,he)}):nr=Fr(Z,he),Ct[Ct.length-1].output.push(Z),t(33,Ct)}function wr(){bn&&bn.reset(),t(42,Gr=!1),t(43,Hr=!1)}async function Fr(Z,he){if(Z.type==="trace"&&Z.section.startsWith("mzn_vis_")){Gr||(t(42,Gr=!0),t(43,Hr=!0)),await Fn();const be=fe.find(ze=>ze.name===Z.message.url);let Pe=null;if(be)Pe=be.state.doc.toString();else try{Pe=await je.readStdlibFileContents(Z.message.url)}catch(ze){console.error(ze);return}if(Pe===null){console.error(`Failed to get visualisation file ${Z.message.url}`);return}bn.addVisualisation(Z.section,Pe,Z.message.userData);return}if(Gr){for(;!bn;)await Fn();switch(Z.type){case"solution":bn.addSolution(Z.sections.filter(be=>be.startsWith("mzn_vis_")).reduce((be,Pe)=>({...be,[Pe]:Z.output[Pe]}),{}),"time"in Z?Z.time:he);break;case"status":bn.status(Z.status,"time"in Z?Z.time:he);break;case"exit":bn.status("time"in Z?Z.time:he);break}}}function Kl(){return h&&t(87,h.state=Be.getState(),h),{files:fe.map(Z=>({name:Z.name,contents:Z.state.doc.toString(),...Z.hidden?{hidden:!0}:{},...Z.readOnly?{readOnly:!0}:{}})),tab:He,solverId:_.id,solverConfig:gi.save(),minizincVersion:B?"edge":"latest"}}let Jl=!1;async function Qa(){t(37,Jl=!0);try{const Z=(await bm(async()=>{const{default:Zt}=await import("./jszip.min-Bl2THA8X.js").then(Jr=>Jr.j);return{default:Zt}},[])).default,he=(await bm(async()=>{const{default:Zt}=await import("./FileSaver.min-BMYjv9ER.js").then(Jr=>Jr.F);return{default:Zt}},[])).default,be=Kl(),Pe=fe.map(Zt=>Zt.name),ze=fe.filter(Zt=>!Zt.hidden).map(Zt=>Zt.name);let it=_.id;it==="org.minizinc.gecode_presolver"?it="org.gecode.gecode":it==="org.minizinc.chuffed"&&(it="org.chuffed.chuffed");const Ze=new Z;for(const Zt of be.files)Ze.file(Zt.name,Zt.contents);Ze.file("Project.mzp",JSON.stringify({version:105,projectFiles:Pe,openFiles:ze,openTab:be.tab,selectedBuiltinConfigId:it,selectedBuiltinConfigVersion:"default"}));const mi=await Ze.generateAsync({type:"blob"});he.saveAs(mi,"Project.zip")}catch(Z){console.error(Z)}finally{t(37,Jl=!1)}}let Qr,_r=null,eo=!1;function Js(Z){const he=Kl(),be=new URL(Z);return be.hash=`#project=${encodeURIComponent(JSON.stringify(he))}`,t(40,eo=!1),be.toString()}function fu(){Qr.select(),Qr.setSelectionRange(0,_r.length),navigator.clipboard.writeText(_r),t(40,eo=!0)}function _a(){ke&&window.open(Js(ke),"_blank").focus()}let ka=null;async function kr(Z){const he=Z.view;if(!(Ee!==0||!_||!h||!h.name.endsWith(".mzn")))try{const be=he.state.doc.toString();if(be===ka)return;ka=be;const Pe=new je.Model;for(const Ze of fe)Pe.addFile(Ze.name,Ze.state.doc.toString(),!1);const ze=Pe.addString(be),it=await Pe.check({options:gi.getCompilationConfiguration(_.id)});if(he.state.doc.toString()!==be)return;z7(be,it.filter(Ze=>Ze.location.filename===ze),he)}catch(be){console.error(be)}}function Pa(Z){const he=fe.findIndex(be=>be.name===Z.filename);if(he!==-1){zt(he);const be=fe[he].state.doc.toString(),Pe=$d(Z.firstLine,Z.firstColumn,be);Be.focus(),Be.setCursor(Pe)}}function el(){We==="horizontal"?t(2,We="vertical"):t(2,We="horizontal")}function cu(Z){t(0,B=Z.detail.item===At.edge)}function uu(Z){h&&t(87,h.state=Be.getState(),h),fe.forEach(he=>Db(he,Z?p9:d9)),we(h)}let bn,Gr=!1,Hr=!1;function to(Z){De&&Rs();const he=[Z.modelFile],be=Z.modelFile.substring(0,Z.modelFile.length-4),Pe=fe.find(it=>it.name===`${be}.mzc`||it.name===`${be}.mzc.mzn`);if(Pe&&he.push(Pe.name),Z.dataFiles)for(const it of Z.dataFiles)he.push(it);const ze=new je.Model;for(const it of fe)ze.addFile(it.name,it.state.doc.toString(),he.indexOf(it.name)!==-1);vr(ze,he,Z.options||gi.getSolvingConfiguration(_.id))}function hu(){return Kt===(y.findIndex(Z=>Z.extraInfo&&Z.extraInfo.isDefault)||0)}function Ou(){return gi.isDefault()}function du(){Kt=yO(this),t(22,Kt)}function pu(){Kt=yO(this),t(22,Kt)}const xa=()=>{t(26,Fe=!Fe),t(35,tr=!1)},Wa=()=>{ir(),t(26,Fe=!1)},Ca=()=>{Nr(),t(26,Fe=!1)},io=()=>{t(0,B=!B),t(26,Fe=!1)},gu=()=>{t(39,_r=Js(window.location.href)),t(26,Fe=!1)},Ta=()=>{_a(),t(26,Fe=!1)},tl=()=>t(39,_r=Js(window.location.href)),Za=()=>Qa(),mu=()=>{t(43,Hr=!1)},Ra=()=>{t(43,Hr=!0)};function Xa(Z){Et[Z?"unshift":"push"](()=>{bn=Z,t(41,bn)})}const no=Z=>to(Z.detail);function Su(Z){q=Z,t(1,q)}const Aa=()=>t(33,Ct=[]),ro=Z=>Pa(Z.detail.location),so=Z=>zt(Z.detail.index),Kr=Z=>J(Z.detail.src,Z.detail.dest),Ya=()=>t(28,Wt=!0),Ua=Z=>t(29,gt=Z.detail.index),bu=()=>t(30,zn=!0);function Ea(Z){Et[Z?"unshift":"push"](()=>{Be=Z,t(25,Be)})}function za(Z){lt=Z,t(3,lt)}function Ma(Z){Et[Z?"unshift":"push"](()=>{gi=Z,t(27,gi)})}const Da=()=>t(35,tr=!1),$u=()=>t(30,zn=!1),yu=Z=>t(29,gt=Z.detail.index),vu=Z=>Pi(Z.detail.index,Z.detail.options),Va=()=>t(28,Wt=!0),wu=()=>t(28,Wt=!1),Qu=Z=>Ts(Z.detail.type),_u=Z=>xt(Z.detail),ku=()=>jr(gt),lo=()=>t(29,gt=null),Pu=()=>t(29,gt=null),xu=Z=>tn(Z.detail),Wu=()=>tn(!1),Cu=Z=>tn(Z.detail),Tu=()=>tn(!1),Tt=()=>t(39,_r=null);function Pt(Z){Et[Z?"unshift":"push"](()=>{Qr=Z,t(38,Qr)})}const Zu=()=>Qr.select(),Ru=()=>t(39,_r=null);return n.$$set=Z=>{"showVersionSwitcher"in Z&&t(4,z=Z.showVersionSwitcher),"showSolverDropdown"in Z&&t(5,F=Z.showSolverDropdown),"edgeMiniZinc"in Z&&t(0,B=Z.edgeMiniZinc),"autoClearOutput"in Z&&t(1,q=Z.autoClearOutput),"showTabs"in Z&&t(6,L=Z.showTabs),"canEditTabs"in Z&&t(7,re=Z.canEditTabs),"compilationEnabled"in Z&&t(8,ae=Z.compilationEnabled),"project"in Z&&t(73,ye=Z.project),"enabledSolvers"in Z&&t(74,Se=Z.enabledSolvers),"canEditSolverSettings"in Z&&t(9,ge=Z.canEditSolverSettings),"showShareButton"in Z&&t(10,Ue=Z.showShareButton),"showDownloadButton"in Z&&t(11,Ie=Z.showDownloadButton),"externalPlaygroundURL"in Z&&t(12,ke=Z.externalPlaygroundURL),"splitterDirection"in Z&&t(2,We=Z.splitterDirection),"splitterSize"in Z&&t(3,lt=Z.splitterSize),"canSwitchOrientation"in Z&&t(13,Vt=Z.canSwitchOrientation),"showClearOutput"in Z&&t(14,Qt=Z.showClearOutput),"showAutoClearOutput"in Z&&t(15,pt=Z.showAutoClearOutput),"showOutputSectionToggles"in Z&&t(16,qt=Z.showOutputSectionToggles),"showOutputRightControls"in Z&&t(17,$e=Z.showOutputRightControls),"theme"in Z&&t(75,oe=Z.theme),"hideOutputOnStartup"in Z&&t(76,H=Z.hideOutputOnStartup),"autoFocus"in Z&&t(77,ue=Z.autoFocus),"$$scope"in Z&&t(137,D=Z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&524288&&t(52,i=[At.latest,At.edge]),n.$$.dirty[0]&1&&ut(),n.$$.dirty[2]&2048&&_t(ye),n.$$.dirty[0]&1048576&&(r=fe.filter(Z=>!Z.hidden).length),n.$$.dirty[0]&3145728&&t(87,h=HeSe.indexOf(Z.id)!==-1):tt),n.$$.dirty[0]&12582912&&t(86,_=Kt>=0&&KtZ.name.endsWith(".mzn")&&!Z.name.endsWith(".mzc.mzn")).map(Z=>Z.name)),n.$$.dirty[0]&1048576&&t(46,$=fe.filter(Z=>Z.name.endsWith(".dzn")||Z.name.endsWith(".json")).map(Z=>Z.name)),n.$$.dirty[0]&12582912&&Sn(),n.$$.dirty[2]&16777216&&t(45,W=_?_.stdFlags:[]),n.$$.dirty[2]&33554432&&we(h),n.$$.dirty[2]&536879104&&t(24,R={dark:!0,light:!1,auto:X}[oe]),n.$$.dirty[0]&16777216&&uu(R),n.$$.dirty[0]&8388608&&ce("solversChanged",{solvers:y})},[B,q,We,lt,z,F,L,re,ae,ge,Ue,Ie,ke,Vt,Qt,pt,qt,$e,Ee,At,fe,He,Kt,y,R,Be,Fe,gi,Wt,gt,zn,oi,Ht,Ct,ri,tr,tn,Jl,Qr,_r,eo,bn,Gr,Hr,m,W,$,c,a,o,l,s,i,C,xt,Nr,zt,Ts,Hl,jr,Pi,J,Mn,ir,Rs,Qa,Js,fu,_a,Pa,el,cu,to,ye,Se,oe,H,ue,_t,St,Kl,hu,Ou,tt,gn,De,_,h,g,p,O,X,E,du,pu,xa,Wa,Ca,io,gu,Ta,tl,Za,mu,Ra,Xa,no,Su,Aa,ro,so,Kr,Ya,Ua,bu,Ea,za,Ma,Da,$u,yu,vu,Va,wu,Qu,_u,ku,lo,Pu,xu,Wu,Cu,Tu,Tt,Pt,Zu,Ru,D]}class c8 extends $i{constructor(e){super(),bi(this,e,f8,a8,Oi,{showVersionSwitcher:4,showSolverDropdown:5,edgeMiniZinc:0,autoClearOutput:1,showTabs:6,canEditTabs:7,compilationEnabled:8,project:73,enabledSolvers:74,canEditSolverSettings:9,showShareButton:10,showDownloadButton:11,externalPlaygroundURL:12,splitterDirection:2,splitterSize:3,canSwitchOrientation:13,showClearOutput:14,showAutoClearOutput:15,showOutputSectionToggles:16,showOutputRightControls:17,theme:75,hideOutputOnStartup:76,autoFocus:77,loadProject:78,hasFiles:79,getProject:80,isDefaultSolver:81,isDefaultSolverConfig:82},null,[-1,-1,-1,-1,-1,-1])}get loadProject(){return this.$$.ctx[78]}get hasFiles(){return this.$$.ctx[79]}get getProject(){return this.$$.ctx[80]}get isDefaultSolver(){return this.$$.ctx[81]}get isDefaultSolverConfig(){return this.$$.ctx[82]}}function Vb(n,e,t){const i=n.slice();return i[10]=e[t],i[12]=t,i}function qb(n){let e;return{c(){e=k("p"),e.textContent="No recent projects.",v(e,"class","has-text-centered")},m(t,i){Y(t,e,i)},p:Qe,d(t){t&&A(e)}}}function Ib(n){let e,t,i=Lb(n[10])+"",r,s,l,o,a=n[10].solver+"",c,h,O,p=new Date(n[10].timestamp).toLocaleString()+"",g,m,$,y;function _(){return n[7](n[12])}return{c(){e=k("div"),t=k("div"),r=pe(i),s=N(),l=k("div"),o=k("div"),c=pe(a),h=N(),O=k("div"),g=pe(p),m=N(),v(l,"class","info is-size-7 svelte-wl1zgv"),v(e,"class","item svelte-wl1zgv"),ne(e,"has-background-primary",n[2]===n[12]),ne(e,"has-text-white",n[2]===n[12])},m(W,R){Y(W,e,R),Q(e,t),Q(t,r),Q(e,s),Q(e,l),Q(l,o),Q(o,c),Q(l,h),Q(l,O),Q(O,g),Q(e,m),$||(y=[le(e,"click",_),le(e,"dblclick",n[5])],$=!0)},p(W,R){n=W,R&2&&i!==(i=Lb(n[10])+"")&&Ne(r,i),R&2&&a!==(a=n[10].solver+"")&&Ne(c,a),R&2&&p!==(p=new Date(n[10].timestamp).toLocaleString()+"")&&Ne(g,p),R&4&&ne(e,"has-background-primary",n[2]===n[12]),R&4&&ne(e,"has-text-white",n[2]===n[12])},d(W){W&&A(e),$=!1,Ft(y)}}}function u8(n){let e,t=st(n[1]),i=[];for(let s=0;si.name);return n.files.length>3&&t.push(`+${n.files.length-3} more…`),t.join(", ")}return n.files.map(t=>t.name).join(", ")}function d8(n,e,t){let i;const r=en();let{active:s=!1}=e,{projects:l=[]}=e,o=-1;function a(g){g||t(2,o=-1)}function c(){i&&r("accept",{project:l[o]})}const h=()=>r("cancel"),O=g=>t(2,o=g),p=()=>r("cancel");return n.$$set=g=>{"active"in g&&t(0,s=g.active),"projects"in g&&t(1,l=g.projects)},n.$$.update=()=>{n.$$.dirty&6&&t(3,i=o>=0&&o{const t=localStorage.getItem(yd);if(t&&t.length>0){ms=!0;try{e(i=>({...i,...JSON.parse(t)}))}catch(i){console.error(i)}ms=!1}window.addEventListener("storage",i=>{if(i.storageArea===localStorage&&i.key===yd&&i.newValue.length>0){ms=!0;try{e(r=>({...r,...JSON.parse(i.newValue)}))}catch(r){console.error(r)}ms=!1}})});Ns.subscribe(n=>{ms||(Object.keys(n.sessions).length>Nb&&(ms=!0,Ns.update(e=>{const t=Object.keys(e.sessions).map(i=>({key:i,value:e.sessions[i]}));return t.sort((i,r)=>r.value.timestamp-i.value.timestamp),ms=!0,{...e,sessions:t.slice(0,Nb).reduce((i,r)=>({...i,[r.key]:r.value}),{})}}),ms=!1),localStorage.setItem(yd,JSON.stringify(n)))});const{document:g8,window:jb}=FW;function m8(n){let e,t;return e=new p8({props:{projects:n[5],active:n[4]}}),e.$on("cancel",n[12]),e.$on("accept",n[13]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,r){const s={};r&32&&(s.projects=i[5]),r&16&&(s.active=i[4]),e.$set(s)},i(i){t||(M(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function S8(n){let e,t,i,r,s,l,o,a,c;return l=new wt({props:{icon:Vy}}),{c(){e=k("div"),t=k("div"),i=k("div"),r=k("button"),s=k("span"),Ae(l.$$.fragment),v(s,"class","icon"),v(r,"class","button"),v(r,"title","Open recent project"),v(i,"class","control"),v(t,"class","field"),v(e,"class","navbar-item")},m(h,O){Y(h,e,O),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Re(l,s,null),o=!0,a||(c=le(r,"click",n[11]),a=!0)},p:Qe,i(h){o||(M(l.$$.fragment,h),o=!0)},o(h){j(l.$$.fragment,h),o=!1},d(h){h&&A(e),Xe(l),a=!1,c()}}}function b8(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Vy}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=N(),s=k("span"),s.textContent="Open recent project",v(t,"class","icon"),v(e,"class","navbar-item mobile-menu-item"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[10]),o=!0)},p:Qe,i(c){l||(M(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&A(e),Xe(i),o=!1,a()}}}function $8(n){let e,t,i,r;const s=[b8,S8],l=[];function o(a,c){return a[25]?0:1}return e=o(n),t=l[e]=s[e](n),{c(){t.c(),i=Gt()},m(a,c){l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?l[e].p(a,c):(Je(),j(l[h],1,1,()=>{l[h]=null}),et(),t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),M(t,1),t.m(i.parentNode,i))},i(a){r||(M(t),r=!0)},o(a){j(t),r=!1},d(a){a&&A(i),l[e].d(a)}}}function y8(n){let e,t,i,r,s,l,o,a,c;function h(m){n[15](m)}function O(m){n[16](m)}function p(m){n[17](m)}let g={project:n[3],$$slots:{"navbar-before-share-buttons":[$8,({isMobile:m})=>({25:m}),({isMobile:m})=>m?33554432:0],default:[m8]},$$scope:{ctx:n}};return n[1].autoClearOutput!==void 0&&(g.autoClearOutput=n[1].autoClearOutput),n[1].splitterDirection!==void 0&&(g.splitterDirection=n[1].splitterDirection),n[1].splitterSize!==void 0&&(g.splitterSize=n[1].splitterSize),i=new c8({props:g}),n[14](i),Et.push(()=>qo(i,"autoClearOutput",h)),Et.push(()=>qo(i,"splitterDirection",O)),Et.push(()=>qo(i,"splitterSize",p)),i.$on("solversChanged",n[18]),{c(){e=N(),t=k("div"),Ae(i.$$.fragment),v(t,"class","playground-app svelte-tuc1wl")},m(m,$){Y(m,e,$),Y(m,t,$),Re(i,t,null),o=!0,a||(c=[le(jb,"beforeunload",n[7]),le(jb,"hashchange",n[6]),le(g8,"visibilitychange",n[9])],a=!0)},p(m,[$]){const y={};$&8&&(y.project=m[3]),$&100663346&&(y.$$scope={dirty:$,ctx:m}),!r&&$&2&&(r=!0,y.autoClearOutput=m[1].autoClearOutput,Vo(()=>r=!1)),!s&&$&2&&(s=!0,y.splitterDirection=m[1].splitterDirection,Vo(()=>s=!1)),!l&&$&2&&(l=!0,y.splitterSize=m[1].splitterSize,Vo(()=>l=!1)),i.$set(y)},i(m){o||(M(i.$$.fragment,m),o=!0)},o(m){j(i.$$.fragment,m),o=!1},d(m){m&&(A(e),A(t)),n[14](null),Xe(i),a=!1,Ft(c)}}}const bO=`% Use this editor as a MiniZinc scratch book -`,Bb="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function v8(n,e,t){let i,r;$O(n,Ns,L=>t(1,r=L));let s,l={files:[]},o=null,a=!1,c=[];function h(L,re){return!s||!re?[]:Object.entries(re.sessions).map(([ae,ye])=>{const Se=L.find(ge=>ge.id===ye.solverId);return{key:ae,files:ye.files,timestamp:ye.timestamp,solver:Se?Se.name:""}}).filter(ae=>ae.key!==sessionStorage.mznPlaygroundSession).sort((ae,ye)=>ye.timestamp-ae.timestamp)}function O(){const L=()=>Array(6).fill(0).map(()=>Bb[Math.floor(Math.random()*Bb.length)]).join("");let re=L();for(;re in r.sessions;)re=L();return re}function p(L){return L.solverId||(L.solver===0?L.solverId="org.minizinc.gecode_presolver":l.solver===1&&(L.solverId="org.minizinc.mip.coin-bc")),L}let g=!1;async function m(){const L=window.location.hash;if(L.length>0&&(g=!0,window.history.replaceState(void 0,void 0,window.location.pathname+window.location.search),g=!1),!g){if(L.startsWith("#project="))try{const re=decodeURIComponent(L.substring(9));y(O(),{...JSON.parse(re),timestamp:Date.now()});return}catch(re){console.error(re)}if(L.startsWith("#code="))try{const re=decodeURIComponent(L.substring(6));y(O(),{files:[{name:"Playground.mzn",contents:re,anchor:re.length}],timestamp:Date.now()});return}catch(re){console.error(re)}if(L.startsWith("#url="))try{const re=decodeURIComponent(L.substring(5));y(O(),await sQ(re));return}catch(re){console.error(re)}if(sessionStorage.mznPlaygroundSession&&r.sessions[sessionStorage.mznPlaygroundSession]){y(sessionStorage.mznPlaygroundSession,r.sessions[sessionStorage.mznPlaygroundSession]);return}l.files.length===0&&y(O(),{files:[{name:"Playground.mzn",contents:bO,anchor:bO.length}],timestamp:Date.now()})}}Hc(()=>m());function $(){if(sessionStorage.mznPlaygroundSession&&s.hasFiles())try{const L=s.getProject();if(!(sessionStorage.mznPlaygroundSession in r.sessions)&&s.isDefaultSolver()&&s.isDefaultSolverConfig()&&L.files.length===1&&L.files[0].name==="Playground.mzn"&&L.files[0].contents===bO)return;o=Date.now(),BW(Ns,r.sessions[sessionStorage.mznPlaygroundSession]={...L,timestamp:o},r)}catch(L){console.error(L)}}function y(L,re){$();try{const ae=p(re);sessionStorage.mznPlaygroundSession=L,t(3,l=ae),o=re.timestamp}catch(ae){console.error(ae)}t(4,a=!1),t(5,i=h(c,r))}function _(L){o!==null&&sessionStorage.mznPlaygroundSession in L.sessions&&L.sessions[sessionStorage.mznPlaygroundSession].timestamp>o&&(sessionStorage.mznPlaygroundSession=O(),t(5,i=h(c,L)))}const W=()=>{document.hidden&&$()},R=()=>t(4,a=!0),X=()=>t(4,a=!0),C=()=>t(4,a=!1),E=L=>y(L.detail.project.key,r.sessions[L.detail.project.key]);function D(L){Et[L?"unshift":"push"](()=>{s=L,t(2,s)})}function z(L){n.$$.not_equal(r.autoClearOutput,L)&&(r.autoClearOutput=L,Ns.set(r))}function F(L){n.$$.not_equal(r.splitterDirection,L)&&(r.splitterDirection=L,Ns.set(r))}function B(L){n.$$.not_equal(r.splitterSize,L)&&(r.splitterSize=L,Ns.set(r))}const q=L=>t(0,c=L.detail.solvers);return n.$$.update=()=>{n.$$.dirty&3&&t(5,i=h(c,r)),n.$$.dirty&2&&_(r)},[c,r,s,l,a,i,m,$,y,W,R,X,C,E,D,z,F,B,q]}class w8 extends $i{constructor(e){super(),bi(this,e,v8,y8,Oi,{})}}new w8({target:document.getElementById("app")});export{Xo as c,x8 as g}; +`;function zS(n,e,t){const i=n.slice();return i[23]=e[t],i[24]=e,i[25]=t,i}function MS(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,x,R;return y=new wt({props:{icon:CC}}),{c(){e=k("div"),t=k("div"),t.innerHTML="Solution:",i=L(),r=k("div"),s=k("input"),o=L(),a=k("div"),c=k("input"),O=L(),p=k("div"),g=k("p"),m=k("button"),$=k("span"),Ae(y.$$.fragment),v(t,"class","solution-label svelte-g2g7zr"),v(s,"class","input is-small"),v(s,"type","number"),v(s,"min",l=n[2]>0?1:0),v(s,"max",n[2]),v(c,"type","range"),v(c,"min",h=n[2]>0?1:0),v(c,"max",n[2]),v(c,"class","svelte-g2g7zr"),v(a,"class","solution-slider svelte-g2g7zr"),v($,"class","icon"),v(m,"class","button is-small"),v(m,"title","Follow latest solution"),ne(m,"is-primary",n[0]),ne(m,"is-light",!n[0]),v(g,"class","control"),v(p,"class","field has-addons svelte-g2g7zr"),v(e,"class","top svelte-g2g7zr")},m(A,C){Y(A,e,C),Q(e,t),Q(e,i),Q(e,r),Q(r,s),si(s,n[1]),Q(e,o),Q(e,a),Q(a,c),si(c,n[1]),Q(e,O),Q(e,p),Q(p,g),Q(g,m),Q(m,$),Re(y,$,null),_=!0,x||(R=[le(s,"input",n[12]),le(c,"change",n[13]),le(c,"input",n[13]),le(m,"click",n[14])],x=!0)},p(A,C){(!_||C&4&&l!==(l=A[2]>0?1:0))&&v(s,"min",l),(!_||C&4)&&v(s,"max",A[2]),C&2&&Bo(s.value)!==A[1]&&si(s,A[1]),(!_||C&4&&h!==(h=A[2]>0?1:0))&&v(c,"min",h),(!_||C&4)&&v(c,"max",A[2]),C&2&&si(c,A[1]),(!_||C&1)&&ne(m,"is-primary",A[0]),(!_||C&1)&&ne(m,"is-light",!A[0])},i(A){_||(D(y.$$.fragment,A),_=!0)},o(A){j(y.$$.fragment,A),_=!1},d(A){A&&X(e),Xe(y),x=!1,Ft(R)}}}function DS(n){let e,t,i=n[24],r=n[25],s,l;const o=()=>n[15](e,i,r),a=()=>n[15](null,i,r);function c(...h){return n[16](n[23],...h)}return{c(){e=k("iframe"),v(e,"class","vis-window svelte-g2g7zr"),Om(e.src,t=n[23].url)||v(e,"src",t),v(e,"title","Visualisation")},m(h,O){Y(h,e,O),o(),s||(l=le(e,"load",c),s=!0)},p(h,O){n=h,O&8&&!Om(e.src,t=n[23].url)&&v(e,"src",t),(i!==n[24]||r!==n[25])&&(a(),i=n[24],r=n[25],o())},d(h){h&&X(e),a(),s=!1,l()}}}function HY(n){let e,t,i,r,s,l,o,a=n[2]>0&&MS(n),c=st(n[3]),h=[];for(let O=0;O0?a?(a.p(O,p),p&4&&D(a,1)):(a=MS(O),a.c(),D(a,1),a.m(e,t)):a&&(Je(),j(a,1,1,()=>{a=null}),et()),p&8){c=st(O[3]);let g;for(g=0;g{re=ke});ae.then(ke=>{ke.contentWindow.postMessage({event:"init",payload:U},"*")});const ye=s.reduce((ke,xe)=>({...ke,[xe.name]:xe.state.doc.toString()}),{}),Se=[],ge=new DOMParser().parseFromString(G,"text/html");for(const ke of ge.getElementsByTagName("script")){const xe=ke.getAttribute("src");if(xe==="/minizinc-ide.js")ke.src=KY;else if(xe in ye&&xe.endsWith(".js")){const lt=URL.createObjectURL(new Blob([ye[xe]],{type:"text/javascript; charset=utf-8"}));ke.src=lt,Se.push(lt)}}for(const ke of ge.getElementsByTagName("link")){const xe=ke.getAttribute("href");if(xe in ye&&xe.endsWith(".css")){const lt=URL.createObjectURL(new Blob([ye[xe]],{type:"text/css; charset=utf-8"}));ke.href=lt,Se.push(lt)}}const Ue=new XMLSerializer().serializeToString(ge.doctype)+ge.documentElement.outerHTML,Ie=URL.createObjectURL(new Blob([Ue],{type:"text/html; charset=utf-8"}));t(3,O=[...O,{key:N,url:Ie,extraUrls:Se,makeReady:re,ready:ae,solutions:[],element:null}])}function y(N,G){for(const U in N){const re=O.find(ye=>ye.key===U);if(!re){console.error(`Did not find visualisation for ${U}`);continue}const ae={time:G,data:N[U]};re.solutions.push(ae),Wn({event:"solution",payload:ae},re)}t(2,h++,h)}function _(N,G){p={status:N,time:G};for(let U=0;Ure.element.contentWindow===N.source);switch(G.event){case"rebroadcast":for(const ae of O)Wn(G.message,ae);G.message.event==="goToSolution"&&(l=G.message.payload===-1,t(0,o=G.message.payload===-1),a=G.message.payload+1,t(1,c=G.message.payload+1));break;case"solve":r("solve",{modelFile:G.modelFile,dataFiles:G.dataFiles,options:G.options});break;case"getNumSolutions":Wn({event:"response",id:G.id,payload:U.solutions.length},U);break;case"getSolution":const re=G.index<0?G.index+U.solutions.length:G.index;if(re<0||re>=U.solutions.length)Wn({event:"error",id:G.id,message:"Solution index out of range"},U);else{Wn({event:"response",id:G.id,payload:U.solutions[G.index===-1?U.solutions.length-1:G.index]},U);break}case"getAllSolutions":Wn({event:"response",id:G.id,payload:U.solutions},U);break;case"getStatus":Wn({event:"response",id:G.id,payload:p},U);break;case"getFinishTime":Wn({event:"response",id:G.id,payload:g},U);break}}function A(N,G,U){if(o&&a===c&&(a=h,t(1,c=h)),o!==l){l=o;for(const re of O)Wn({event:"goToSolution",payload:o?-1:c-1},re)}if(a!==c){a=c,l=!1,t(0,o=!1);for(const re of O)Wn({event:"goToSolution",payload:c-1},re)}}function C(){c=Bo(this.value),t(1,c)}function z(){c=Bo(this.value),t(1,c)}const V=()=>t(0,o=!o);function M(N,G,U){Et[N?"unshift":"push"](()=>{G[U].element=N,t(3,O)})}const B=(N,G)=>N.makeReady(G.target);return n.$$set=N=>{"files"in N&&t(6,s=N.files)},n.$$.update=()=>{n.$$.dirty&8&&t(4,i=Math.ceil(Math.sqrt(O.length))),n.$$.dirty&7&&A()},[o,c,h,O,i,R,s,m,$,y,_,x,C,z,V,M,B]}class e9 extends $i{constructor(e){super(),bi(this,e,JY,HY,Oi,{files:6,reset:7,addVisualisation:8,addSolution:9,status:10,finish:11})}get reset(){return this.$$.ctx[7]}get addVisualisation(){return this.$$.ctx[8]}get addSolution(){return this.$$.ctx[9]}get status(){return this.$$.ctx[10]}get finish(){return this.$$.ctx[11]}}const VS=[".mzn",".mzc",".dzn",".json",".html",".js",".css"];async function lQ(n){const e=n.startsWith("http://")||n.startsWith("https://")?n:`http://${n}`,t=e.split("/").pop();if(!t.endsWith(".mzp")&&VS.every(r=>!t.endsWith(r)))throw new Error("File type not recognised");const i=await fetch(new URL(e));if(!i.ok)throw new Error(`Request failed (${i.status} ${i.statusText})`);if(t.endsWith(".mzp")){const r=await i.json(),s=[],l=r.openFiles[r.openTab];let o=0;for(const c of r.projectFiles){const h=c.split("/").pop();if(VS.every(g=>!h.endsWith(g)))continue;c===l&&(o=s.length);const O=await fetch(new URL(c,e));if(!O.ok)throw new Error(`Request failed (${O.status} ${O.statusText})`);const p=await O.text();s.push({name:h,contents:p,hidden:r.openFiles.indexOf(c)===-1})}let a=r.selectedBuiltinConfigId;return a==="org.gecode.gecode"?a="org.minizinc.gecode_presolver":a==="org.chuffed.chuffed"&&(a="org.minizinc.chuffed"),{files:s,tab:o,solverId:a,timestamp:Date.now()}}else{const r=await i.text();return{files:[{name:t,contents:r}],timestamp:Date.now()}}}function t9(n){let e,t;return e=new _s({props:{active:n[0],title:"Create new file",$$slots:{default:[n9]},$$scope:{ctx:n}}}),e.$on("activate",n[8]),e.$on("cancel",n[23]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,r){const s={};r&1&&(s.active=i[0]),r&134217770&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(D(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function i9(n){let e,t;return e=new _s({props:{active:n[0],title:"Import from URL",$$slots:{footer:[s9],default:[r9]},$$scope:{ctx:n}}}),e.$on("activate",n[8]),e.$on("cancel",n[14]),e.$on("submit",n[10]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,r){const s={};r&1&&(s.active=i[0]),r&134217816&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(D(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function n9(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,x,R,A,C,z,V,M,B,N,G,U,re,ae,ye,Se,ge,Ue,Ie;return{c(){e=k("aside"),t=k("p"),t.textContent="Model",i=L(),r=k("ul"),s=k("li"),l=k("button"),l.textContent="Model file (.mzn)",o=L(),a=k("li"),c=k("button"),c.textContent="Solution checker model (.mzc.mzn)",h=L(),O=k("p"),O.textContent="Data",p=L(),g=k("ul"),m=k("li"),$=k("button"),$.textContent="Data file (.dzn)",y=L(),_=k("li"),x=k("button"),x.textContent="JSON data file (.json)",R=L(),A=k("p"),A.textContent="Visualisation",C=L(),z=k("ul"),V=k("li"),M=k("button"),M.textContent="Custom visualisation (.html)",B=L(),N=k("p"),N.textContent="Import",G=L(),U=k("ul"),re=k("li"),ae=k("button"),ae.textContent="Upload file(s)",ye=L(),Se=k("li"),ge=k("button"),ge.textContent="Import from URL",v(t,"class","menu-label"),v(l,"type","button"),v(c,"type","button"),v(r,"class","menu-list"),v(O,"class","menu-label"),v($,"type","button"),v(x,"type","button"),v(g,"class","menu-list"),v(A,"class","menu-label"),v(M,"type","button"),v(z,"class","menu-list"),v(N,"class","menu-label"),v(ae,"type","button"),v(ge,"type","button"),v(U,"class","menu-list"),v(e,"class","menu")},m(ke,xe){Y(ke,e,xe),Q(e,t),Q(e,i),Q(e,r),Q(r,s),Q(s,l),n[15](l),Q(r,o),Q(r,a),Q(a,c),Q(e,h),Q(e,O),Q(e,p),Q(e,g),Q(g,m),Q(m,$),Q(g,y),Q(g,_),Q(_,x),Q(e,R),Q(e,A),Q(e,C),Q(e,z),Q(z,V),Q(V,M),Q(e,B),Q(e,N),Q(e,G),Q(e,U),Q(U,re),Q(re,ae),Q(U,ye),Q(U,Se),Q(Se,ge),Ue||(Ie=[le(l,"click",n[16]),le(c,"click",n[17]),le($,"click",n[18]),le(x,"click",n[19]),le(M,"click",n[20]),le(ae,"click",n[21]),le(ge,"click",n[22])],Ue=!0)},p:Qe,d(ke){ke&&X(e),n[15](null),Ue=!1,Ft(Ie)}}}function qS(n){let e,t;return{c(){e=k("div"),t=pe(n[6]),v(e,"class","error svelte-6l40ed")},m(i,r){Y(i,e,r),Q(e,t)},p(i,r){r&64&&Le(t,i[6])},d(i){i&&X(e)}}}function r9(n){let e,t,i,r,s,l,o=n[6]&&qS(n);return{c(){o&&o.c(),e=L(),t=k("div"),i=k("p"),r=k("input"),v(r,"class","input"),v(r,"type","text"),v(r,"pattern",".+\\.(mzn|dzn|json|js|html|css|mzp|mzc)"),r.required=!0,v(i,"class","control is-expanded"),v(t,"class","field")},m(a,c){o&&o.m(a,c),Y(a,e,c),Y(a,t,c),Q(t,i),Q(i,r),n[12](r),si(r,n[4]),s||(l=le(r,"input",n[13]),s=!0)},p(a,c){a[6]?o?o.p(a,c):(o=qS(a),o.c(),o.m(e.parentNode,e)):o&&(o.d(1),o=null),c&16&&r.value!==a[4]&&si(r,a[4])},d(a){a&&(X(e),X(t)),o&&o.d(a),n[12](null),s=!1,l()}}}function s9(n){let e,t,i,r,s,l;return{c(){e=k("div"),t=k("button"),t.textContent="OK",i=L(),r=k("button"),r.textContent="Cancel",v(t,"class","button is-primary"),v(r,"class","button"),v(r,"type","button"),v(e,"slot","footer")},m(o,a){Y(o,e,a),Q(e,t),Q(e,i),Q(e,r),s||(l=le(r,"click",n[11]),s=!0)},p:Qe,d(o){o&&X(e),s=!1,l()}}}function l9(n){let e,t,i,r,s,l,o;const a=[i9,t9],c=[];function h(O,p){return O[5]?0:1}return e=h(n),t=c[e]=a[e](n),{c(){t.c(),i=L(),r=k("input"),v(r,"class","is-hidden svelte-6l40ed"),v(r,"type","file"),r.multiple=!0,v(r,"accept",".mzn,.mzc,.dzn,.json,.html,.js,.css")},m(O,p){c[e].m(O,p),Y(O,i,p),Y(O,r,p),n[24](r),s=!0,l||(o=[le(r,"change",n[25]),le(r,"change",n[9])],l=!0)},p(O,[p]){let g=e;e=h(O),e===g?c[e].p(O,p):(Je(),j(c[g],1,1,()=>{c[g]=null}),et(),t=c[e],t?t.p(O,p):(t=c[e]=a[e](O),t.c()),D(t,1),t.m(i.parentNode,i))},i(O){s||(D(t),s=!0)},o(O){j(t),s=!1},d(O){O&&(X(i),X(r)),c[e].d(O),n[24](null),l=!1,Ft(o)}}}function o9(n,e,t){let{active:i=!1}=e;const r=en();let s,l,o,a="",c=!1,h=null;function O(ae){t(5,c=!1),t(4,a=""),t(6,h=null)}async function p(){await Fn(),o&&o.focus()}async function g(){const ae=[];for(const Se of l)ae.push(new Promise((ge,Ue)=>{const Ie=new FileReader;Ie.onload=()=>{ge({name:Se.name,contents:Ie.result})},Ie.onerror=ke=>Ue(ke),Ie.readAsText(Se)}));const ye=await Promise.all(ae);r("open",{files:ye})}async function m(){try{r("open",await lQ(a))}catch(ae){t(6,h=`Failed to import from URL: ${ae.message||ae}`),console.error(ae)}}const $=()=>r("cancel");function y(ae){Et[ae?"unshift":"push"](()=>{o=ae,t(3,o)})}function _(){a=this.value,t(4,a)}const x=()=>r("cancel");function R(ae){Et[ae?"unshift":"push"](()=>{o=ae,t(3,o)})}const A=()=>r("new",{type:".mzn"}),C=()=>r("new",{type:".mzc.mzn"}),z=()=>r("new",{type:".dzn"}),V=()=>r("new",{type:".json"}),M=()=>r("new",{type:".html"}),B=()=>s.click(),N=()=>t(5,c=!0),G=()=>r("cancel");function U(ae){Et[ae?"unshift":"push"](()=>{s=ae,t(1,s)})}function re(){l=this.files,t(2,l)}return n.$$set=ae=>{"active"in ae&&t(0,i=ae.active)},n.$$.update=()=>{n.$$.dirty&1&&O()},[i,s,l,o,a,c,h,r,p,g,m,$,y,_,x,R,A,C,z,V,M,B,N,G,U,re]}class a9 extends $i{constructor(e){super(),bi(this,e,o9,l9,Oi,{active:0})}}function IS(n,e,t){const i=n.slice();return i[14]=e[t],i}function LS(n,e,t){const i=n.slice();return i[17]=e[t].file,i[18]=e[t].index,i}function f9(n){let e,t,i,r,s,l,o;i=new wt({props:{icon:n[17].readOnly?rd:T1}});function a(){return n[11](n[18],n[17])}return{c(){e=k("button"),t=k("span"),Ae(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small"),v(e,"title",r="Click to "+(n[17].readOnly?"unlock":"lock")+" this file for editing"),v(e,"type","button"),ne(e,"is-primary",!n[17].readOnly),ne(e,"is-light",n[17].readOnly)},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),s=!0,l||(o=le(e,"click",a),l=!0)},p(c,h){n=c;const O={};h&2&&(O.icon=n[17].readOnly?rd:T1),i.$set(O),(!s||h&2&&r!==(r="Click to "+(n[17].readOnly?"unlock":"lock")+" this file for editing"))&&v(e,"title",r),(!s||h&2)&&ne(e,"is-primary",!n[17].readOnly),(!s||h&2)&&ne(e,"is-light",n[17].readOnly)},i(c){s||(D(i.$$.fragment,c),s=!0)},o(c){j(i.$$.fragment,c),s=!1},d(c){c&&X(e),Xe(i),l=!1,o()}}}function c9(n){let e,t,i,r;return i=new wt({props:{icon:rd}}),{c(){e=k("button"),t=k("span"),Ae(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small is-light"),v(e,"title","Compiled checkers are read only"),v(e,"type","button"),e.disabled=!0},m(s,l){Y(s,e,l),Q(e,t),Re(i,t,null),r=!0},p:Qe,i(s){r||(D(i.$$.fragment,s),r=!0)},o(s){j(i.$$.fragment,s),r=!1},d(s){s&&X(e),Xe(i)}}}function NS(n){let e,t,i=n[17].name+"",r,s,l,o,a,c,h,O,p,g,m,$,y,_,x,R,A,C,z,V,M,B,N;p=new wt({props:{icon:n[17].hidden?C1:Z1}});function G(){return n[10](n[18],n[17])}const U=[c9,f9],re=[];function ae(Se,ge){return ge&2&&(y=null),y==null&&(y=!!Se[17].name.endsWith(".mzc")),y?0:1}_=ae(n,-1),x=re[_]=U[_](n),V=new wt({props:{icon:Ey}});function ye(){return n[12](n[18])}return{c(){e=k("tr"),t=k("td"),r=pe(i),s=L(),l=k("td"),o=k("div"),a=k("div"),c=k("p"),h=k("button"),O=k("span"),Ae(p.$$.fragment),m=L(),$=k("p"),x.c(),R=L(),A=k("p"),C=k("button"),z=k("span"),Ae(V.$$.fragment),v(O,"class","icon"),v(h,"class","button is-small"),v(h,"title",g="Click to "+(n[17].hidden?"show":"hide")+" this file"),v(h,"type","button"),ne(h,"is-primary",!n[17].hidden),ne(h,"is-light",n[17].hidden),v(c,"class","control"),v($,"class","control"),v(z,"class","icon"),v(C,"class","button is-small is-danger"),v(C,"title","Delete this file"),v(C,"type","button"),v(A,"class","control"),v(a,"class","field is-grouped"),v(o,"class","tool-buttons svelte-1bgv9sn")},m(Se,ge){Y(Se,e,ge),Q(e,t),Q(t,r),Q(e,s),Q(e,l),Q(l,o),Q(o,a),Q(a,c),Q(c,h),Q(h,O),Re(p,O,null),Q(a,m),Q(a,$),re[_].m($,null),Q(a,R),Q(a,A),Q(A,C),Q(C,z),Re(V,z,null),M=!0,B||(N=[le(h,"click",G),le(C,"click",ye)],B=!0)},p(Se,ge){n=Se,(!M||ge&2)&&i!==(i=n[17].name+"")&&Le(r,i);const Ue={};ge&2&&(Ue.icon=n[17].hidden?C1:Z1),p.$set(Ue),(!M||ge&2&&g!==(g="Click to "+(n[17].hidden?"show":"hide")+" this file"))&&v(h,"title",g),(!M||ge&2)&&ne(h,"is-primary",!n[17].hidden),(!M||ge&2)&&ne(h,"is-light",n[17].hidden);let Ie=_;_=ae(n,ge),_===Ie?re[_].p(n,ge):(Je(),j(re[Ie],1,1,()=>{re[Ie]=null}),et(),x=re[_],x?x.p(n,ge):(x=re[_]=U[_](n),x.c()),D(x,1),x.m($,null))},i(Se){M||(D(p.$$.fragment,Se),D(x),D(V.$$.fragment,Se),M=!0)},o(Se){j(p.$$.fragment,Se),j(x),j(V.$$.fragment,Se),M=!1},d(Se){Se&&X(e),Xe(p),re[_].d(),Xe(V),B=!1,Ft(N)}}}function jS(n){let e,t=n[14].label+"",i,r,s,l,o=st(n[14].files),a=[];for(let h=0;hj(a[h],1,1,()=>{a[h]=null});return{c(){e=k("p"),i=pe(t),r=L(),s=k("table");for(let h=0;hj(p[m],1,1,()=>{p[m]=null});return s=new wt({props:{icon:My}}),{c(){for(let m=0;mAccept',v(e,"slot","footer")},m(t,i){Y(t,e,i)},p:Qe,d(t){t&&X(e)}}}function O9(n){let e,t;return e=new _s({props:{active:n[0],title:"Manage files",$$slots:{footer:[h9],default:[u9]},$$scope:{ctx:n}}}),e.$on("submit",n[3]),e.$on("cancel",n[3]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,[r]){const s={};r&1&&(s.active=i[0]),r&2097154&&(s.$$scope={dirty:r,ctx:i}),e.$set(s)},i(i){t||(D(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function d9(n,e,t){let i,r,s,l,o,a,{active:c=!1}=e,{files:h=[]}=e;const O=en();function p(){O("close")}const g=(_,x)=>O("modifyFile",{index:_,options:{hidden:!x.hidden}}),m=(_,x)=>O("modifyFile",{index:_,options:{readOnly:!x.readOnly}}),$=_=>O("delete",{index:_}),y=()=>O("newFile");return n.$$set=_=>{"active"in _&&t(0,c=_.active),"files"in _&&t(4,h=_.files)},n.$$.update=()=>{n.$$.dirty&16&&t(9,i=h.map((_,x)=>({file:_,index:x}))),n.$$.dirty&512&&t(8,r=i.filter(_=>_.file.name.endsWith(".mzn")&&!_.file.name.endsWith(".mzc.mzn")).sort((_,x)=>_.file.name.localeCompare(x.file.name))),n.$$.dirty&512&&t(7,s=i.filter(_=>_.file.name.endsWith(".dzn")||_.file.name.endsWith(".json")).sort((_,x)=>_.file.name.localeCompare(x.file.name))),n.$$.dirty&512&&t(6,l=i.filter(_=>_.file.name.endsWith(".mzc")||_.file.name.endsWith(".mzc.mzn")).sort((_,x)=>_.file.name.localeCompare(x.file.name))),n.$$.dirty&512&&t(5,o=i.filter(_=>!_.file.name.endsWith(".mzn")&&!_.file.name.endsWith(".mzc")&&!_.file.name.endsWith(".dzn")&&!_.file.name.endsWith(".json")).sort((_,x)=>_.file.name.localeCompare(x.file.name))),n.$$.dirty&480&&t(1,a=[{label:"Model files",files:r},{label:"Data files",files:s},{label:"Solution checkers",files:l},{label:"Other files",files:o}].filter(_=>_.files.length>0))},[c,a,O,p,h,o,l,s,r,i,g,m,$,y]}class p9 extends $i{constructor(e){super(),bi(this,e,d9,O9,Oi,{active:0,files:4})}}function BS(n,e,t){const i=n.slice();return i[9]=e[t],i}function FS(n){let e,t=n[9]+"",i,r;return{c(){e=k("option"),i=pe(t),e.__value=r=n[9],si(e,e.__value),v(e,"class","svelte-1x5266v")},m(s,l){Y(s,e,l),Q(e,i)},p(s,l){l&1&&t!==(t=s[9]+"")&&Le(i,t),l&1&&r!==(r=s[9])&&(e.__value=r,si(e,e.__value))},d(s){s&&X(e)}}}function g9(n){let e,t,i,r,s,l=st(n[0]),o=[];for(let a=0;an[6].call(t)),v(e,"class","select is-fullwidth is-multiple svelte-1x5266v")},m(a,c){Y(a,e,c),Q(e,t);for(let h=0;h0&&t(2,l=p[0])}function a(){i("accept",{modelFile:l})}const c=()=>i("cancel");function h(){l=yO(this),t(2,l),t(0,r)}const O=()=>i("cancel");return n.$$set=p=>{"modelFiles"in p&&t(0,r=p.modelFiles),"active"in p&&t(1,s=p.active)},n.$$.update=()=>{n.$$.dirty&1&&o(r)},[r,s,l,i,a,c,h,O]}class $9 extends $i{constructor(e){super(),bi(this,e,b9,S9,Oi,{modelFiles:0,active:1})}}function GS(n,e,t){const i=n.slice();return i[25]=e[t],i[26]=e,i[27]=t,i}function HS(n,e,t){const i=n.slice();return i[22]=e[t],i}function KS(n){let e,t,i,r,s,l,o,a,c;return{c(){e=k("div"),t=k("ul"),i=k("li"),r=k("a"),r.textContent="Enter parameters",s=L(),l=k("li"),o=k("a"),o.textContent="Select data file",ne(i,"is-active",!n[2]),ne(l,"is-active",n[2]),v(e,"class","tabs")},m(h,O){Y(h,e,O),Q(e,t),Q(t,i),Q(i,r),Q(t,s),Q(t,l),Q(l,o),a||(c=[le(r,"click",n[13]),le(o,"click",n[14])],a=!0)},p(h,O){O&4&&ne(i,"is-active",!h[2]),O&4&&ne(l,"is-active",h[2])},d(h){h&&X(e),a=!1,Ft(c)}}}function y9(n){let e,t=st(n[5]),i=[];for(let r=0;rn[16].call(t)),v(e,"class","select is-fullwidth is-multiple")},m(a,c){Y(a,e,c),Q(e,t);for(let h=0;hB[N]===void 0?{name:N,value:""}:{name:N,value:B[N]}))}function $(){r?s("accept",{dataFiles:h}):s("accept",{parameters:O.reduce((B,N)=>({...B,[N.name]:N.value}),{})})}const y=()=>s("cancel"),_=()=>t(2,c=!1),x=()=>t(2,c=!0);function R(B){Et[B?"unshift":"push"](()=>{p=B,t(6,p)})}function A(){h=e4(this),t(4,h),t(1,a)}function C(B){Et[B?"unshift":"push"](()=>{p=B,t(6,p)})}function z(B,N){B[N].value=this.value,t(5,O)}function V(B,N){B[N].value=this.value,t(5,O)}const M=()=>s("cancel");return n.$$set=B=>{"active"in B&&t(0,l=B.active),"parameters"in B&&t(11,o=B.parameters),"dataFiles"in B&&t(1,a=B.dataFiles)},n.$$.update=()=>{n.$$.dirty&2048&&m(o),n.$$.dirty&2&&t(3,i=a.length>0),n.$$.dirty&12&&t(7,r=i&&c)},[l,a,c,i,h,O,p,r,s,g,$,o,y,_,x,R,A,C,z,V,M]}class x9 extends $i{constructor(e){super(),bi(this,e,W9,P9,Oi,{active:0,parameters:11,dataFiles:1})}}function tb(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,x,R=Cn(n[1],"-a"),A,C=Cn(n[1],"-f"),z,V,M,B,N,G,U,re,ae,ye=Cn(n[1],"-v"),Se,ge,Ue,Ie,ke,xe,lt,Vt=Cn(n[1],"-s"),Qt,pt,qt,$e,oe,H,ue,ce,Ee,tt,ft,je,At,ut,En,_t;r=new wt({props:{icon:Dy}});let Wt=R&&ib(n),St=C&&nb(n),Be=ye&&rb(n),fe=Vt&&sb(n);return{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),s=L(),l=k("form"),o=k("h5"),o.textContent="Solving options",a=L(),c=k("div"),h=k("p"),O=k("input"),p=L(),g=k("label"),g.textContent="Time limit (s)",m=L(),$=k("p"),y=k("input"),x=L(),Wt&&Wt.c(),A=L(),St&&St.c(),z=L(),V=k("h5"),V.textContent="Output options",M=L(),B=k("div"),N=k("p"),G=k("input"),U=L(),re=k("label"),re.textContent="Verbose compilation",ae=L(),Be&&Be.c(),Se=L(),ge=k("div"),Ue=k("p"),Ie=k("input"),ke=L(),xe=k("label"),xe.textContent="Compilation statistics",lt=L(),fe&&fe.c(),Qt=L(),pt=k("div"),qt=k("p"),$e=k("input"),oe=L(),H=k("label"),H.textContent="Timing information",ue=L(),ce=k("div"),Ee=k("p"),Ee.innerHTML='',tt=L(),ft=k("p"),je=k("button"),je.textContent="Reset to defaults",v(i,"class","icon"),v(t,"class","button is-text is-small exit-button svelte-makhy9"),v(o,"class","title is-5 svelte-makhy9"),v(O,"id","enable-timelimit"),v(O,"type","checkbox"),v(O,"class","svelte-makhy9"),v(g,"for","enable-timelimit"),v(g,"class","svelte-makhy9"),v(h,"class","control checkbox-control svelte-makhy9"),v(y,"class","input is-fullwidth"),v(y,"type","number"),v(y,"step","1"),v(y,"min",0),y.disabled=_=!n[3].enableTimeLimit,v($,"class","control is-expanded"),v(c,"class","field is-grouped"),v(V,"class","title is-5 svelte-makhy9"),v(G,"id","enable-verbose-compile"),v(G,"type","checkbox"),v(G,"class","svelte-makhy9"),v(re,"for","enable-verbose-compile"),v(re,"class","svelte-makhy9"),v(N,"class","control checkbox-control svelte-makhy9"),v(B,"class","field"),v(Ie,"id","enable-compilation-satistics"),v(Ie,"type","checkbox"),v(Ie,"class","svelte-makhy9"),v(xe,"for","enable-compilation-satistics"),v(xe,"class","svelte-makhy9"),v(Ue,"class","control checkbox-control svelte-makhy9"),v(ge,"class","field"),v($e,"id","enable-timing-information"),v($e,"type","checkbox"),v($e,"class","svelte-makhy9"),v(H,"for","enable-timing-information"),v(H,"class","svelte-makhy9"),v(qt,"class","control checkbox-control svelte-makhy9"),v(pt,"class","field"),v(Ee,"class","control"),v(je,"type","button"),v(je,"class","button is-danger"),v(ft,"class","control"),v(ce,"class","field is-grouped bottom-buttons svelte-makhy9"),v(e,"class","config-window svelte-makhy9")},m(Fe,He){Y(Fe,e,He),Q(e,t),Q(t,i),Re(r,i,null),Q(e,s),Q(e,l),Q(l,o),Q(l,a),Q(l,c),Q(c,h),Q(h,O),O.checked=n[3].enableTimeLimit,Q(h,p),Q(h,g),Q(c,m),Q(c,$),Q($,y),si(y,n[3].timeLimit),Q(l,x),Wt&&Wt.m(l,null),Q(l,A),St&&St.m(l,null),Q(l,z),Q(l,V),Q(l,M),Q(l,B),Q(B,N),Q(N,G),G.checked=n[3].verboseCompilation,Q(N,U),Q(N,re),Q(l,ae),Be&&Be.m(l,null),Q(l,Se),Q(l,ge),Q(ge,Ue),Q(Ue,Ie),Ie.checked=n[3].compilerStatistics,Q(Ue,ke),Q(Ue,xe),Q(l,lt),fe&&fe.m(l,null),Q(l,Qt),Q(l,pt),Q(pt,qt),Q(qt,$e),$e.checked=n[3].outputTime,Q(qt,oe),Q(qt,H),Q(l,ue),Q(l,ce),Q(ce,Ee),Q(ce,tt),Q(ce,ft),Q(ft,je),ut=!0,En||(_t=[le(t,"click",n[10]),le(O,"change",n[11]),le(y,"input",n[12]),le(G,"change",n[15]),le(Ie,"change",n[17]),le($e,"change",n[19]),le(je,"click",n[2]),le(l,"submit",n$(n[20]))],En=!0)},p(Fe,He){He&8&&(O.checked=Fe[3].enableTimeLimit),(!ut||He&8&&_!==(_=!Fe[3].enableTimeLimit))&&(y.disabled=_),He&8&&Bo(y.value)!==Fe[3].timeLimit&&si(y,Fe[3].timeLimit),He&2&&(R=Cn(Fe[1],"-a")),R?Wt?Wt.p(Fe,He):(Wt=ib(Fe),Wt.c(),Wt.m(l,A)):Wt&&(Wt.d(1),Wt=null),He&2&&(C=Cn(Fe[1],"-f")),C?St?St.p(Fe,He):(St=nb(Fe),St.c(),St.m(l,z)):St&&(St.d(1),St=null),He&8&&(G.checked=Fe[3].verboseCompilation),He&2&&(ye=Cn(Fe[1],"-v")),ye?Be?Be.p(Fe,He):(Be=rb(Fe),Be.c(),Be.m(l,Se)):Be&&(Be.d(1),Be=null),He&8&&(Ie.checked=Fe[3].compilerStatistics),He&2&&(Vt=Cn(Fe[1],"-s")),Vt?fe?fe.p(Fe,He):(fe=sb(Fe),fe.c(),fe.m(l,Qt)):fe&&(fe.d(1),fe=null),He&8&&($e.checked=Fe[3].outputTime)},i(Fe){ut||(D(r.$$.fragment,Fe),Fe&&Hn(()=>{ut&&(At||(At=vl(e,wc,{x:100,duration:200},!0)),At.run(1))}),ut=!0)},o(Fe){j(r.$$.fragment,Fe),Fe&&(At||(At=vl(e,wc,{x:100,duration:200},!1)),At.run(0)),ut=!1},d(Fe){Fe&&X(e),Xe(r),Wt&&Wt.d(),St&&St.d(),Be&&Be.d(),fe&&fe.d(),Fe&&At&&At.end(),En=!1,Ft(_t)}}}function ib(n){let e,t,i,r,s,l,o;return{c(){e=k("div"),t=k("p"),i=k("input"),r=L(),s=k("label"),s.textContent="All solutions (for satisfication problems)",v(i,"id","enable-all-solutions"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-all-solutions"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].allSolutions,Q(t,r),Q(t,s),l||(o=le(i,"change",n[13]),l=!0)},p(a,c){c&8&&(i.checked=a[3].allSolutions)},d(a){a&&X(e),l=!1,o()}}}function nb(n){let e,t,i,r,s,l,o;return{c(){e=k("div"),t=k("p"),i=k("input"),r=L(),s=k("label"),s.textContent="Free search",v(i,"id","enable-free-search"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-free-search"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].freeSearch,Q(t,r),Q(t,s),l||(o=le(i,"change",n[14]),l=!0)},p(a,c){c&8&&(i.checked=a[3].freeSearch)},d(a){a&&X(e),l=!1,o()}}}function rb(n){let e,t,i,r,s,l,o;return{c(){e=k("div"),t=k("p"),i=k("input"),r=L(),s=k("label"),s.textContent="Verbose solving",v(i,"id","enable-verbose-solve"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-verbose-solve"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].verboseSolving,Q(t,r),Q(t,s),l||(o=le(i,"change",n[16]),l=!0)},p(a,c){c&8&&(i.checked=a[3].verboseSolving)},d(a){a&&X(e),l=!1,o()}}}function sb(n){let e,t,i,r,s,l,o;return{c(){e=k("div"),t=k("p"),i=k("input"),r=L(),s=k("label"),s.textContent="Solving statistics",v(i,"id","enable-solving-satistics"),v(i,"type","checkbox"),v(i,"class","svelte-makhy9"),v(s,"for","enable-solving-satistics"),v(s,"class","svelte-makhy9"),v(t,"class","control checkbox-control svelte-makhy9"),v(e,"class","field")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),i.checked=n[3].solvingStatistics,Q(t,r),Q(t,s),l||(o=le(i,"change",n[18]),l=!0)},p(a,c){c&8&&(i.checked=a[3].solvingStatistics)},d(a){a&&X(e),l=!1,o()}}}function C9(n){let e,t,i=n[0]&&tb(n);return{c(){i&&i.c(),e=Gt()},m(r,s){i&&i.m(r,s),Y(r,e,s),t=!0},p(r,[s]){r[0]?i?(i.p(r,s),s&1&&D(i,1)):(i=tb(r),i.c(),D(i,1),i.m(e.parentNode,e)):i&&(Je(),j(i,1,1,()=>{i=null}),et())},i(r){t||(D(i),t=!0)},o(r){j(i),t=!1},d(r){r&&X(e),i&&i.d(r)}}}function Cn(n,e){return n.indexOf(e)!==-1}function T9(n,e,t){const i=en();let{active:r}=e,{stdFlags:s=[]}=e;const l={enableTimeLimit:!1,timeLimit:1,allSolutions:!1,verboseCompilation:!1,verboseSolving:!1,compilerStatistics:!1,solvingStatistics:!1,outputTime:!1,freeSearch:!1};let o={...l};function a(N){const G=N*1e3;G!==Math.floor(G)&&t(3,o.timeLimit=Math.floor(G)/1e3,o)}function c(){for(const N in o)if(l[N]!==o[N])return!1;return!0}function h(){t(3,o={...l})}function O(N){const G={...l};for(const U in l)U in N&&(G[U]=N[U]);t(3,o=G)}function p(){return{...o}}function g(N){const G={solver:N};return o.enableTimeLimit&&o.timeLimit>0&&(G["time-limit"]=o.timeLimit*1e3),o.allSolutions&&Cn(s,"-a")&&(G["all-satisfaction"]=!0),o.verboseCompilation&&(G["verbose-compilation"]=!0),o.verboseSolving&&Cn(s,"-v")&&(G["verbose-solving"]=!0),o.compilerStatistics&&(G["compiler-statistics"]=!0),o.solvingStatistics&&Cn(s,"-s")&&(G["solver-statistics"]=!0),o.outputTime&&(G["output-time"]=!0),o.freeSearch&&Cn(s,"-f")&&(G["free-search"]=!0),G}function m(N){const G={solver:N};return o.verboseCompilation&&(G["verbose-compilation"]=!0),o.compilerStatistics&&(G["compiler-statistics"]=!0),G}const $=()=>i("close");function y(){o.enableTimeLimit=this.checked,t(3,o)}function _(){o.timeLimit=Bo(this.value),t(3,o)}function x(){o.allSolutions=this.checked,t(3,o)}function R(){o.freeSearch=this.checked,t(3,o)}function A(){o.verboseCompilation=this.checked,t(3,o)}function C(){o.verboseSolving=this.checked,t(3,o)}function z(){o.compilerStatistics=this.checked,t(3,o)}function V(){o.solvingStatistics=this.checked,t(3,o)}function M(){o.outputTime=this.checked,t(3,o)}const B=()=>i("close");return n.$$set=N=>{"active"in N&&t(0,r=N.active),"stdFlags"in N&&t(1,s=N.stdFlags)},n.$$.update=()=>{n.$$.dirty&8&&a(o.timeLimit)},[r,s,h,o,i,c,O,p,g,m,$,y,_,x,R,A,C,z,V,M,B]}class Z9 extends $i{constructor(e){super(),bi(this,e,T9,C9,Oi,{active:0,stdFlags:1,isDefault:5,reset:2,load:6,save:7,getSolvingConfiguration:8,getCompilationConfiguration:9})}get isDefault(){return this.$$.ctx[5]}get reset(){return this.$$.ctx[2]}get load(){return this.$$.ctx[6]}get save(){return this.$$.ctx[7]}get getSolvingConfiguration(){return this.$$.ctx[8]}get getCompilationConfiguration(){return this.$$.ctx[9]}}function lb(n,e,t){const i=n.slice();return i[14]=e[t],i}const R9=n=>({item:n&4}),ob=n=>({item:n[14]}),X9=n=>({item:n&8}),ab=n=>({item:n[3]});function fb(n){let e;const t=n[9].selected,i=Zi(t,n,n[8],ab),r=i||A9(n);return{c(){r&&r.c()},m(s,l){r&&r.m(s,l),e=!0},p(s,l){i?i.p&&(!e||l&264)&&Xi(i,t,s,s[8],e?Ri(t,s[8],l,X9):Ai(s[8]),ab):r&&r.p&&(!e||l&8)&&r.p(s,e?l:-1)},i(s){e||(D(r,s),e=!0)},o(s){j(r,s),e=!1},d(s){r&&r.d(s)}}}function A9(n){let e=n[3].label+"",t;return{c(){t=pe(e)},m(i,r){Y(i,t,r)},p(i,r){r&8&&e!==(e=i[3].label+"")&&Le(t,e)},d(i){i&&X(t)}}}function Y9(n){let e=n[14].label+"",t;return{c(){t=pe(e)},m(i,r){Y(i,t,r)},p(i,r){r&4&&e!==(e=i[14].label+"")&&Le(t,e)},d(i){i&&X(t)}}}function cb(n){let e,t,i,r,s;const l=n[9].item,o=Zi(l,n,n[8],ob),a=o||Y9(n);function c(){return n[11](n[14])}return{c(){e=k("a"),a&&a.c(),t=L(),v(e,"href","javascript:void(0);"),v(e,"class","dropdown-item"),ne(e,"is-active",n[3]===n[14])},m(h,O){Y(h,e,O),a&&a.m(e,null),Q(e,t),i=!0,r||(s=le(e,"click",c),r=!0)},p(h,O){n=h,o?o.p&&(!i||O&260)&&Xi(o,l,n,n[8],i?Ri(l,n[8],O,R9):Ai(n[8]),ob):a&&a.p&&(!i||O&4)&&a.p(n,i?O:-1),(!i||O&12)&&ne(e,"is-active",n[3]===n[14])},i(h){i||(D(a,h),i=!0)},o(h){j(a,h),i=!1},d(h){h&&X(e),a&&a.d(h),r=!1,s()}}}function U9(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$=n[3]&&fb(n);a=new wt({props:{icon:AC}});let y=st(n[2]),_=[];for(let R=0;Rj(_[R],1,1,()=>{_[R]=null});return{c(){e=L(),t=k("div"),i=k("div"),r=k("button"),s=k("span"),$&&$.c(),l=L(),o=k("span"),Ae(a.$$.fragment),c=L(),h=k("div"),O=k("div");for(let R=0;R<_.length;R+=1)_[R].c();v(o,"class","icon is-small"),v(r,"class","button"),r.disabled=n[4],v(i,"class","dropdown-trigger"),v(O,"class","dropdown-content"),v(h,"class","dropdown-menu"),v(t,"class","dropdown"),v(t,"title",n[1]),ne(t,"is-active",n[0])},m(R,A){Y(R,e,A),Y(R,t,A),Q(t,i),Q(i,r),Q(r,s),$&&$.m(s,null),Q(r,l),Q(r,o),Re(a,o,null),Q(t,c),Q(t,h),Q(h,O);for(let C=0;C<_.length;C+=1)_[C]&&_[C].m(O,null);n[12](t),p=!0,g||(m=[le(document.body,"click",n[7]),le(r,"click",n[10])],g=!0)},p(R,[A]){if(R[3]?$?($.p(R,A),A&8&&D($,1)):($=fb(R),$.c(),D($,1),$.m(s,null)):$&&(Je(),j($,1,1,()=>{$=null}),et()),(!p||A&16)&&(r.disabled=R[4]),A&332){y=st(R[2]);let C;for(C=0;Ct(0,c=!c),$=_=>p(_);function y(_){Et[_?"unshift":"push"](()=>{O=_,t(5,O)})}return n.$$set=_=>{"title"in _&&t(1,l=_.title),"items"in _&&t(2,o=_.items),"currentItem"in _&&t(3,a=_.currentItem),"active"in _&&t(0,c=_.active),"disabled"in _&&t(4,h=_.disabled),"$$scope"in _&&t(8,r=_.$$scope)},[c,l,o,a,h,O,p,g,r,i,m,$,y]}class z9 extends $i{constructor(e){super(),bi(this,e,E9,U9,Oi,{title:1,items:2,currentItem:3,active:0,disabled:4})}}const oQ=Ne.define({map:(n,e)=>({from:e.mapPos(n.from),to:e.mapPos(n.to),msg:n.msg,type:n.type})}),aQ=Ne.define(),ub=pi.define({create(){return Ye.none},update(n,e){n=n.map(e.changes);for(const t of e.effects)t.is(aQ)&&(n=Ye.none),t.is(oQ)&&(n=n.update({add:[Ye.mark({class:`cm-mzn-underline-${t.value.type}`,attributes:{title:t.value.msg}}).range(t.value.from,t.value.to)]}));return n},provide:n=>de.decorations.from(n)});function $d(n,e,t){let i,r=1,s=1;for(i=0;i=n&&s>=e)return i;s++,t[i]===` +`&&(r++,s=1)}return i}function M9(n,e,t){const i=e.map(r=>oQ.of({from:$d(r.location.firstLine,r.location.firstColumn,n),to:$d(r.location.lastLine,r.location.lastColumn,n)+1,msg:`${r.type==="error"?"Error":"Warning"}: ${r.what}: ${r.message}`,type:r.type}));t.state.field(ub,!1)||i.push(Ne.appendConfig.of([ub])),t.dispatch({effects:[aQ.of(null),...i]})}const Sl=[];function fQ(n,e=Qe){let t;const i=new Set;function r(o){if(Oi(n,o)&&(n=o,t)){const a=!Sl.length;for(const c of i)c[1](),Sl.push(c,n);if(a){for(let c=0;c{i.delete(c),i.size===0&&t&&(t(),t=null)}}return{set:r,update:s,subscribe:l}}const cQ=n=>{const e=window.matchMedia(n);return fQ(e.matches,t=>{const i=()=>t(window.matchMedia(n).matches);return e.addEventListener("change",i),()=>e.removeEventListener("change",i)})},D9=cQ("(prefers-color-scheme: dark)"),V9=cQ("(max-width: 768px)"),q9=n=>({isMobile:n[1]&4194304}),hb=n=>({isMobile:n[53]}),I9=n=>({isMobile:n[1]&4194304}),Ob=n=>({isMobile:n[53]}),L9=n=>({isMobile:n[1]&4194304}),db=n=>({isMobile:n[53]}),N9=n=>({isMobile:n[1]&4194304}),pb=n=>({isMobile:n[53]}),j9=n=>({isMobile:n[1]&4194304}),gb=n=>({isMobile:n[53]});function mb(n,e,t){const i=n.slice();return i[157]=e[t],i[159]=t,i}const B9=n=>({isMobile:n[1]&4194304}),Sb=n=>({isMobile:n[53]});function bb(n,e,t){const i=n.slice();return i[157]=e[t],i[159]=t,i}const F9=n=>({isMobile:n[1]&4194304}),$b=n=>({isMobile:n[53]}),G9=n=>({isMobile:n[1]&4194304}),yb=n=>({isMobile:n[53]});function H9(n){let e,t,i,r,s,l,o,a,c;return s=new wt({props:{icon:UC}}),{c(){e=k("button"),t=k("span"),t.textContent="Run",i=L(),r=k("span"),Ae(s.$$.fragment),v(r,"class","icon"),v(e,"class","button is-primary"),v(e,"title","Run the current file"),e.disabled=l=!n[50]},m(h,O){Y(h,e,O),Q(e,t),Q(e,i),Q(e,r),Re(s,r,null),o=!0,a||(c=le(e,"click",n[62]),a=!0)},p(h,O){(!o||O[1]&524288&&l!==(l=!h[50]))&&(e.disabled=l)},i(h){o||(D(s.$$.fragment,h),o=!0)},o(h){j(s.$$.fragment,h),o=!1},d(h){h&&X(e),Xe(s),a=!1,c()}}}function K9(n){let e,t,i,r,s,l,o,a;return s=new wt({props:{icon:XC}}),{c(){e=k("button"),t=k("span"),t.textContent="Stop",i=L(),r=k("span"),Ae(s.$$.fragment),v(r,"class","icon"),v(e,"class","button is-danger"),v(e,"title","Cancel solving")},m(c,h){Y(c,e,h),Q(e,t),Q(e,i),Q(e,r),Re(s,r,null),l=!0,o||(a=le(e,"click",n[64]),o=!0)},p:Qe,i(c){l||(D(s.$$.fragment,c),l=!0)},o(c){j(s.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(s),o=!1,a()}}}function vb(n){let e,t,i,r,s,l;return{c(){e=k("div"),t=k("button"),i=k("span"),i.textContent="Compile",v(t,"class","button"),v(t,"title","Compile the current file and show the resultant FlatZinc"),t.disabled=r=n[47]||!n[49],v(e,"class","control")},m(o,a){Y(o,e,a),Q(e,t),Q(t,i),s||(l=le(t,"click",n[63]),s=!0)},p(o,a){a[1]&327680&&r!==(r=o[47]||!o[49])&&(t.disabled=r)},d(o){o&&X(e),s=!1,l()}}}function wb(n){let e,t,i;return t=new z9({props:{items:n[52],currentItem:n[0]?n[19].edge:n[19].latest,disabled:n[47],title:"Configure MiniZinc version",$$slots:{item:[J9,({item:r})=>({161:r}),({item:r})=>[0,0,0,0,0,r?64:0]]},$$scope:{ctx:n}}}),t.$on("selectItem",n[71]),{c(){e=k("div"),Ae(t.$$.fragment),v(e,"class","control")},m(r,s){Y(r,e,s),Re(t,e,null),i=!0},p(r,s){const l={};s[1]&2097152&&(l.items=r[52]),s[0]&524289&&(l.currentItem=r[0]?r[19].edge:r[19].latest),s[1]&65536&&(l.disabled=r[47]),s[4]&8192|s[5]&64&&(l.$$scope={dirty:s,ctx:r}),t.$set(l)},i(r){i||(D(t.$$.fragment,r),i=!0)},o(r){j(t.$$.fragment,r),i=!1},d(r){r&&X(e),Xe(t)}}}function J9(n){let e,t=n[161].label+"",i,r,s=n[161].detail+"",l,o;return{c(){e=k("span"),i=pe(t),r=pe(" ("),l=pe(s),o=pe(")"),v(e,"slot","item")},m(a,c){Y(a,e,c),Q(e,i),Q(e,r),Q(e,l),Q(e,o)},p(a,c){c[5]&64&&t!==(t=a[161].label+"")&&Le(i,t),c[5]&64&&s!==(s=a[161].detail+"")&&Le(l,s)},d(a){a&&X(e)}}}function Qb(n){let e,t,i,r,s,l=st(n[23]),o=[];for(let a=0;an[93].call(i)),v(t,"class","select is-fullwidth"),v(e,"class","control is-expanded")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i);for(let h=0;hSolver:',r=L(),s=k("div"),l=k("div"),o=k("select");for(let $=0;$n[94].call(o)),v(l,"class","select is-fullwidth"),v(s,"class","control is-expanded"),v(t,"class","field has-addons"),v(e,"class","navbar-item is-hidden-mobile")},m($,y){Y($,e,y),Q(e,t),Q(t,i),Q(t,r),Q(t,s),Q(s,l),Q(l,o);for(let _=0;_{m=null}),et())},i($){c||(D(m),c=!0)},o($){j(m),c=!1},d($){$&&X(e),di(g,$),m&&m.d(),h=!1,O()}}}function Pb(n){let e,t=n[157].name+"",i,r,s=n[157].version+"",l,o;return{c(){e=k("option"),i=pe(t),r=L(),l=pe(s),o=L(),e.__value=n[159],si(e,e.__value)},m(a,c){Y(a,e,c),Q(e,i),Q(e,r),Q(e,l),Q(e,o)},p(a,c){c[0]&8388608&&t!==(t=a[157].name+"")&&Le(i,t),c[0]&8388608&&s!==(s=a[157].version+"")&&Le(l,s)},d(a){a&&X(e)}}}function Wb(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:zy}}),{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Solver configuration"),v(e,"class","control")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Re(r,i,null),s=!0,l||(o=le(t,"click",n[55]),l=!0)},p:Qe,i(a){s||(D(r.$$.fragment,a),s=!0)},o(a){j(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function e8(n){let e,t,i,r,s,l,o;const a=n[92]["navbar-before-share-buttons"],c=Zi(a,n,n[137],db);let h=n[10]&&xb(n),O=n[11]&&Cb(n),p=n[12]&&Tb(n);const g=n[92]["navbar-share-buttons"],m=Zi(g,n,n[137],Ob);return{c(){c&&c.c(),e=L(),t=k("div"),i=k("div"),h&&h.c(),r=L(),O&&O.c(),s=L(),p&&p.c(),l=L(),m&&m.c(),v(i,"class","field has-addons"),v(t,"class","navbar-item")},m($,y){c&&c.m($,y),Y($,e,y),Y($,t,y),Q(t,i),h&&h.m(i,null),Q(i,r),O&&O.m(i,null),Q(i,s),p&&p.m(i,null),Q(i,l),m&&m.m(i,null),o=!0},p($,y){c&&c.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(c,a,$,$[137],o?Ri(a,$[137],y,L9):Ai($[137]),db),$[10]?h?(h.p($,y),y[0]&1024&&D(h,1)):(h=xb($),h.c(),D(h,1),h.m(i,r)):h&&(Je(),j(h,1,1,()=>{h=null}),et()),$[11]?O?(O.p($,y),y[0]&2048&&D(O,1)):(O=Cb($),O.c(),D(O,1),O.m(i,s)):O&&(Je(),j(O,1,1,()=>{O=null}),et()),$[12]?p?(p.p($,y),y[0]&4096&&D(p,1)):(p=Tb($),p.c(),D(p,1),p.m(i,l)):p&&(Je(),j(p,1,1,()=>{p=null}),et()),m&&m.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(m,g,$,$[137],o?Ri(g,$[137],y,I9):Ai($[137]),Ob)},i($){o||(D(c,$),D(h),D(O),D(p),D(m,$),o=!0)},o($){j(c,$),j(h),j(O),j(p),j(m,$),o=!1},d($){$&&(X(e),X(t)),c&&c.d($),h&&h.d(),O&&O.d(),p&&p.d(),m&&m.d($)}}}function t8(n){let e,t,i,r,s,l,o,a=n[8]&&!n[47]&&n[49]&&Zb(n),c=n[9]&&n[5]&&n[23].length>0&&Rb(n),h=n[4]&&!n[47]&&Xb(n);const O=n[92]["navbar-before-share-buttons"],p=Zi(O,n,n[137],pb);let g=n[10]&&n[18]===0&&Ab(n),m=n[12]&&n[18]===0&&Yb(n);return{c(){a&&a.c(),e=L(),c&&c.c(),t=L(),h&&h.c(),i=L(),p&&p.c(),r=L(),g&&g.c(),s=L(),m&&m.c(),l=Gt()},m($,y){a&&a.m($,y),Y($,e,y),c&&c.m($,y),Y($,t,y),h&&h.m($,y),Y($,i,y),p&&p.m($,y),Y($,r,y),g&&g.m($,y),Y($,s,y),m&&m.m($,y),Y($,l,y),o=!0},p($,y){$[8]&&!$[47]&&$[49]?a?(a.p($,y),y[0]&256|y[1]&327680&&D(a,1)):(a=Zb($),a.c(),D(a,1),a.m(e.parentNode,e)):a&&(Je(),j(a,1,1,()=>{a=null}),et()),$[9]&&$[5]&&$[23].length>0?c?(c.p($,y),y[0]&8389152&&D(c,1)):(c=Rb($),c.c(),D(c,1),c.m(t.parentNode,t)):c&&(Je(),j(c,1,1,()=>{c=null}),et()),$[4]&&!$[47]?h?(h.p($,y),y[0]&16|y[1]&65536&&D(h,1)):(h=Xb($),h.c(),D(h,1),h.m(i.parentNode,i)):h&&(Je(),j(h,1,1,()=>{h=null}),et()),p&&p.p&&(!o||y[1]&4194304|y[4]&8192)&&Xi(p,O,$,$[137],o?Ri(O,$[137],y,N9):Ai($[137]),pb),$[10]&&$[18]===0?g?(g.p($,y),y[0]&263168&&D(g,1)):(g=Ab($),g.c(),D(g,1),g.m(s.parentNode,s)):g&&(Je(),j(g,1,1,()=>{g=null}),et()),$[12]&&$[18]===0?m?(m.p($,y),y[0]&266240&&D(m,1)):(m=Yb($),m.c(),D(m,1),m.m(l.parentNode,l)):m&&(Je(),j(m,1,1,()=>{m=null}),et())},i($){o||(D(a),D(c),D(h),D(p,$),D(g),D(m),o=!0)},o($){j(a),j(c),j(h),j(p,$),j(g),j(m),o=!1},d($){$&&(X(e),X(t),X(i),X(r),X(s),X(l)),a&&a.d($),c&&c.d($),h&&h.d($),p&&p.d($),g&&g.d($),m&&m.d($)}}}function xb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:Yy}}),{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Share"),t.disabled=s=n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Re(r,i,null),l=!0,o||(a=le(t,"click",n[101]),o=!0)},p(c,h){(!l||h[0]&262144&&s!==(s=c[18]!==0))&&(t.disabled=s)},i(c){l||(D(r.$$.fragment,c),l=!0)},o(c){j(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function Cb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:RC}}),{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button"),v(t,"title","Download project"),t.disabled=s=n[37]||n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Re(r,i,null),l=!0,o||(a=le(t,"click",n[102]),o=!0)},p(c,h){(!l||h[0]&262144|h[1]&64&&s!==(s=c[37]||c[18]!==0))&&(t.disabled=s)},i(c){l||(D(r.$$.fragment,c),l=!0)},o(c){j(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function Tb(n){let e,t,i,r,s,l,o,a;return r=new wt({props:{icon:Uy}}),{c(){e=k("div"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-primary"),v(t,"title","Open in playground"),t.disabled=s=n[18]!==0,v(e,"class","control")},m(c,h){Y(c,e,h),Q(e,t),Q(t,i),Re(r,i,null),l=!0,o||(a=le(t,"click",n[68]),o=!0)},p(c,h){(!l||h[0]&262144&&s!==(s=c[18]!==0))&&(t.disabled=s)},i(c){l||(D(r.$$.fragment,c),l=!0)},o(c){j(r.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(r),o=!1,a()}}}function Zb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:EC}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=L(),s=k("span"),s.textContent="Compile current file",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[96]),o=!0)},p:Qe,i(c){l||(D(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Rb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:zy}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=L(),s=k("span"),s.textContent="Solver configuration",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[97]),o=!0)},p:Qe,i(c){l||(D(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Xb(n){let e,t,i,r,s,l,o=n[0]?"latest":"edge",a,c,h,O,p;return i=new wt({props:{icon:WC}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=L(),s=k("span"),l=pe("Switch to the "),a=pe(o),c=pe(" version of MiniZinc"),v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(g,m){Y(g,e,m),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),Q(s,l),Q(s,a),Q(s,c),h=!0,O||(p=le(e,"click",n[98]),O=!0)},p(g,m){(!h||m[0]&1)&&o!==(o=g[0]?"latest":"edge")&&Le(a,o)},i(g){h||(D(i.$$.fragment,g),h=!0)},o(g){j(i.$$.fragment,g),h=!1},d(g){g&&X(e),Xe(i),O=!1,p()}}}function Ab(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Yy}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=L(),s=k("span"),s.textContent="Share this project",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[99]),o=!0)},p:Qe,i(c){l||(D(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Yb(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:Uy}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=L(),s=k("span"),s.textContent="Open in MiniZinc Playground",v(t,"class","icon svelte-hl0lfa"),v(e,"class","navbar-item mobile-menu-item svelte-hl0lfa"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[100]),o=!0)},p:Qe,i(c){l||(D(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function Ub(n){let e,t,i;return t=new jC({props:{files:n[20],currentIndex:n[21],readonly:!n[7]}}),t.$on("selectTab",n[110]),t.$on("reorder",n[111]),t.$on("newFile",n[112]),t.$on("rename",n[58]),t.$on("close",n[113]),t.$on("manageFiles",n[114]),{c(){e=k("div"),Ae(t.$$.fragment),v(e,"class","top svelte-hl0lfa")},m(r,s){Y(r,e,s),Re(t,e,null),i=!0},p(r,s){const l={};s[0]&1048576&&(l.files=r[20]),s[0]&2097152&&(l.currentIndex=r[21]),s[0]&128&&(l.readonly=!r[7]),t.$set(l)},i(r){i||(D(t.$$.fragment,r),i=!0)},o(r){j(t.$$.fragment,r),i=!1},d(r){r&&X(e),Xe(t)}}}function Eb(n){let e,t,i={state:n[51]};return e=new uC({props:i}),n[115](e),{c(){Ae(e.$$.fragment)},m(r,s){Re(e,r,s),t=!0},p(r,s){const l={};s[1]&1048576&&(l.state=r[51]),e.$set(l)},i(r){t||(D(e.$$.fragment,r),t=!0)},o(r){j(e.$$.fragment,r),t=!1},d(r){n[115](null),Xe(e,r)}}}function i8(n){let e,t,i,r,s=n[6]&&Ub(n),l=n[51]&&Eb(n);return{c(){e=k("div"),s&&s.c(),t=L(),i=k("div"),l&&l.c(),v(i,"class","grow svelte-hl0lfa"),v(e,"class","panel stack svelte-hl0lfa"),v(e,"slot","panelA")},m(o,a){Y(o,e,a),s&&s.m(e,null),Q(e,t),Q(e,i),l&&l.m(i,null),r=!0},p(o,a){o[6]?s?(s.p(o,a),a[0]&64&&D(s,1)):(s=Ub(o),s.c(),D(s,1),s.m(e,t)):s&&(Je(),j(s,1,1,()=>{s=null}),et()),o[51]?l?(l.p(o,a),a[1]&1048576&&D(l,1)):(l=Eb(o),l.c(),D(l,1),l.m(i,null)):l&&(Je(),j(l,1,1,()=>{l=null}),et())},i(o){r||(D(s),D(l),r=!0)},o(o){j(s),j(l),r=!1},d(o){o&&X(e),s&&s.d(),l&&l.d()}}}function zb(n){let e,t,i,r,s,l,o,a,c,h,O,p,g=n[13]&&Mb(n);return{c(){e=k("div"),t=k("div"),i=k("ul"),r=k("li"),s=k("a"),s.textContent="Output",l=L(),o=k("li"),a=k("a"),a.textContent="Visualisation",c=L(),g&&g.c(),v(s,"href","javascript:void(0);"),ne(r,"is-active",!n[43]),v(a,"href","javascript:void(0);"),ne(o,"is-active",n[43]),v(t,"class","tabs is-boxed"),v(e,"class","top svelte-hl0lfa")},m(m,$){Y(m,e,$),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Q(i,l),Q(i,o),Q(o,a),Q(i,c),g&&g.m(i,null),h=!0,O||(p=[le(s,"click",n[103]),le(a,"click",n[104])],O=!0)},p(m,$){(!h||$[1]&4096)&&ne(r,"is-active",!m[43]),(!h||$[1]&4096)&&ne(o,"is-active",m[43]),m[13]?g?(g.p(m,$),$[0]&8192&&D(g,1)):(g=Mb(m),g.c(),D(g,1),g.m(i,null)):g&&(Je(),j(g,1,1,()=>{g=null}),et())},i(m){h||(D(g),h=!0)},o(m){j(g),h=!1},d(m){m&&X(e),g&&g.d(),O=!1,Ft(p)}}}function Mb(n){let e,t,i,r,s,l,o;return r=new wt({props:{icon:Vy}}),{c(){e=k("li"),t=k("button"),i=k("span"),Ae(r.$$.fragment),v(i,"class","icon"),v(t,"class","button is-small"),v(t,"title","Switch orientation"),v(e,"class","tab-end svelte-hl0lfa")},m(a,c){Y(a,e,c),Q(e,t),Q(t,i),Re(r,i,null),s=!0,l||(o=le(t,"click",n[70]),l=!0)},p:Qe,i(a){s||(D(r.$$.fragment,a),s=!0)},o(a){j(r.$$.fragment,a),s=!1},d(a){a&&X(e),Xe(r),l=!1,o()}}}function Db(n){let e,t,i,r,s,l;return i=new wt({props:{icon:Vy}}),{c(){e=k("button"),t=k("span"),Ae(i.$$.fragment),v(t,"class","icon"),v(e,"class","button is-small"),v(e,"title","Switch orientation")},m(o,a){Y(o,e,a),Q(e,t),Re(i,t,null),r=!0,s||(l=le(e,"click",n[70]),s=!0)},p:Qe,i(o){r||(D(i.$$.fragment,o),r=!0)},o(o){j(i.$$.fragment,o),r=!1},d(o){o&&X(e),Xe(i),s=!1,l()}}}function n8(n){let e,t,i=n[13]&&!n[42]&&Db(n);return{c(){e=k("p"),i&&i.c(),v(e,"class","control"),v(e,"slot","before-right-controls")},m(r,s){Y(r,e,s),i&&i.m(e,null),t=!0},p(r,s){r[13]&&!r[42]?i?(i.p(r,s),s[0]&8192|s[1]&2048&&D(i,1)):(i=Db(r),i.c(),D(i,1),i.m(e,null)):i&&(Je(),j(i,1,1,()=>{i=null}),et())},i(r){t||(D(i),t=!0)},o(r){j(i),t=!1},d(r){r&&X(e),i&&i.d()}}}function r8(n){let e,t,i,r,s,l,o,a,c,h,O=n[42]&&zb(n),p={files:n[20]};s=new e9({props:p}),n[105](s),s.$on("solve",n[106]);function g($){n[107]($)}let m={output:n[33],showClearOutput:n[14],showAutoClearOutput:n[15],showSectionToggles:n[16],showRightControls:n[17],isTab:n[42],$$slots:{"before-right-controls":[n8]},$$scope:{ctx:n}};return n[1]!==void 0&&(m.autoClearOutput=n[1]),a=new FY({props:m}),Et.push(()=>qo(a,"autoClearOutput",g)),a.$on("clear",n[108]),a.$on("goto",n[109]),{c(){e=k("div"),O&&O.c(),t=L(),i=k("div"),r=k("div"),Ae(s.$$.fragment),l=L(),o=k("div"),Ae(a.$$.fragment),v(r,"class","tab-window svelte-hl0lfa"),ne(r,"visible",n[43]),v(o,"class","tab-window svelte-hl0lfa"),ne(o,"visible",!n[42]||!n[43]),v(i,"class","grow svelte-hl0lfa"),v(e,"class","panel stack svelte-hl0lfa"),v(e,"slot","panelB")},m($,y){Y($,e,y),O&&O.m(e,null),Q(e,t),Q(e,i),Q(i,r),Re(s,r,null),Q(i,l),Q(i,o),Re(a,o,null),h=!0},p($,y){$[42]?O?(O.p($,y),y[1]&2048&&D(O,1)):(O=zb($),O.c(),D(O,1),O.m(e,t)):O&&(Je(),j(O,1,1,()=>{O=null}),et());const _={};y[0]&1048576&&(_.files=$[20]),s.$set(_),(!h||y[1]&4096)&&ne(r,"visible",$[43]);const x={};y[1]&4&&(x.output=$[33]),y[0]&16384&&(x.showClearOutput=$[14]),y[0]&32768&&(x.showAutoClearOutput=$[15]),y[0]&65536&&(x.showSectionToggles=$[16]),y[0]&131072&&(x.showRightControls=$[17]),y[1]&2048&&(x.isTab=$[42]),y[0]&8192|y[1]&2048|y[4]&8192&&(x.$$scope={dirty:y,ctx:$}),!c&&y[0]&2&&(c=!0,x.autoClearOutput=$[1],Vo(()=>c=!1)),a.$set(x),(!h||y[1]&6144)&&ne(o,"visible",!$[42]||!$[43])},i($){h||(D(O),D(s.$$.fragment,$),D(a.$$.fragment,$),h=!0)},o($){j(O),j(s.$$.fragment,$),j(a.$$.fragment,$),h=!1},d($){$&&X(e),O&&O.d(),n[105](null),Xe(s),Xe(a)}}}function s8(n){let e,t,i,r=n[20][n[29]].name+"",s,l,o,a;return{c(){e=k("p"),t=pe("Are you sure you wish to delete "),i=k("code"),s=pe(r),l=pe("?"),o=L(),a=k("p"),a.textContent="This cannot be undone."},m(c,h){Y(c,e,h),Q(e,t),Q(e,i),Q(i,s),Q(e,l),Y(c,o,h),Y(c,a,h)},p(c,h){h[0]&537919488&&r!==(r=c[20][c[29]].name+"")&&Le(s,r)},d(c){c&&(X(e),X(o),X(a))}}}function l8(n){let e,t,i,r,s,l;return{c(){e=k("div"),t=k("button"),t.textContent="Delete",i=L(),r=k("button"),r.textContent="Cancel",v(t,"class","button is-danger"),v(r,"type","button"),v(r,"class","button"),v(e,"slot","footer")},m(o,a){Y(o,e,a),Q(e,t),Q(e,i),Q(e,r),s||(l=[le(t,"click",n[126]),le(r,"click",n[127])],s=!0)},p:Qe,d(o){o&&X(e),s=!1,Ft(l)}}}function o8(n){let e,t,i,r,s,l,o,a,c,h,O;return a=new wt({props:{icon:xC}}),{c(){e=k("div"),t=k("p"),i=k("input"),r=L(),s=k("p"),l=k("button"),o=k("span"),Ae(a.$$.fragment),v(i,"class","input"),v(i,"type","text"),i.value=n[39],i.readOnly=!0,v(t,"class","control is-expanded"),v(o,"class","icon"),v(l,"type","button"),v(l,"class","button"),ne(l,"is-primary",!n[40]),ne(l,"is-success",n[40]),v(s,"class","control"),v(e,"class","field has-addons")},m(p,g){Y(p,e,g),Q(e,t),Q(t,i),n[134](i),Q(e,r),Q(e,s),Q(s,l),Q(l,o),Re(a,o,null),c=!0,h||(O=[le(i,"click",n[135]),le(l,"click",n[67])],h=!0)},p(p,g){(!c||g[1]&256&&i.value!==p[39])&&(i.value=p[39]),(!c||g[1]&512)&&ne(l,"is-primary",!p[40]),(!c||g[1]&512)&&ne(l,"is-success",p[40])},i(p){c||(D(a.$$.fragment,p),c=!0)},o(p){j(a.$$.fragment,p),c=!1},d(p){p&&X(e),n[134](null),Xe(a),h=!1,Ft(O)}}}function a8(n){let e,t,i,r;return{c(){e=k("div"),t=k("button"),t.textContent="Done",v(t,"class","button is-primary"),v(e,"slot","footer")},m(s,l){Y(s,e,l),Q(e,t),i||(r=le(t,"click",n[133]),i=!0)},p:Qe,d(s){s&&X(e),i=!1,r()}}}function f8(n){let e,t,i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,x,R,A,C,z,V,M,B,N,G,U,re,ae,ye,Se,ge,Ue,Ie,ke,xe,lt,Vt,Qt,pt,qt,$e,oe,H,ue,ce,Ee,tt,ft,je,At,ut,En,_t,Wt,St;const Be=n[92]["navbar-before-run-buttons"],fe=Zi(Be,n,n[137],yb),Fe=[K9,H9],He=[];function gi(J,we){return J[47]?0:1}O=gi(n),p=He[O]=Fe[O](n);let xt=!n[53]&&n[8]&&vb(n),gt=!n[53]&&n[4]&&wb(n);const zn=n[92]["navbar-run-buttons"],oi=Zi(zn,n,n[137],$b);let Ht=n[53]&&n[5]&&n[23].length>0&&Qb(n);const gn=n[92]["navbar-after-run-buttons"],Ct=Zi(gn,n,n[137],Sb);let De=n[5]&&n[23].length>0&&kb(n);const mn=n[92]["navbar-after-solver-selector"],ri=Zi(mn,n,n[137],gb),Kt=[t8,e8],Sn=[];function tr(J,we){return J[53]?0:1}Se=tr(n),ge=Sn[Se]=Kt[Se](n);const Nr=n[92]["navbar-after-share-buttons"],zt=Zi(Nr,n,n[137],hb);function Ts(J){n[116](J)}let Zs={direction:n[2],showPanels:n[48],$$slots:{panelB:[r8],panelA:[i8]},$$scope:{ctx:n}};n[3]!==void 0&&(Zs.split=n[3]),lt=new yC({props:Zs}),Et.push(()=>qo(lt,"split",Ts));let Hl={active:n[35],stdFlags:n[45]};pt=new Z9({props:Hl}),n[117](pt),pt.$on("close",n[118]),$e=new p9({props:{active:n[30],files:n[20]}}),$e.$on("close",n[119]),$e.$on("delete",n[120]),$e.$on("modifyFile",n[121]),$e.$on("newFile",n[122]),H=new a9({props:{active:n[28]}}),H.$on("cancel",n[123]),H.$on("new",n[124]),H.$on("open",n[125]),ce=new _s({props:{active:n[29]!==null,title:"Delete file",$$slots:{footer:[l8],default:[s8]},$$scope:{ctx:n}}}),ce.$on("cancel",n[128]),tt=new $9({props:{active:n[31],modelFiles:n[44]}}),tt.$on("accept",n[129]),tt.$on("cancel",n[130]),je=new x9({props:{active:n[32],dataFiles:n[46],parameters:n[34]}}),je.$on("accept",n[131]),je.$on("cancel",n[132]),ut=new _s({props:{active:n[39],title:"Share this project",$$slots:{footer:[a8],default:[o8]},$$scope:{ctx:n}}}),ut.$on("cancel",n[136]);const jr=n[92].default,Pi=Zi(jr,n,n[137],null);return{c(){e=k("div"),t=k("div"),i=k("div"),r=k("div"),s=k("nav"),l=k("div"),fe&&fe.c(),o=L(),a=k("div"),c=k("div"),h=k("div"),p.c(),g=L(),xt&&xt.c(),m=L(),gt&>.c(),$=L(),oi&&oi.c(),y=L(),Ht&&Ht.c(),_=L(),Ct&&Ct.c(),x=L(),De&&De.c(),R=L(),ri&&ri.c(),A=L(),C=k("a"),z=k("span"),V=L(),M=k("span"),B=L(),N=k("span"),G=L(),U=k("div"),re=k("div"),ae=L(),ye=k("div"),ge.c(),Ue=L(),zt&&zt.c(),Ie=L(),ke=k("div"),xe=k("div"),Ae(lt.$$.fragment),Qt=L(),Ae(pt.$$.fragment),qt=L(),Ae($e.$$.fragment),oe=L(),Ae(H.$$.fragment),ue=L(),Ae(ce.$$.fragment),Ee=L(),Ae(tt.$$.fragment),ft=L(),Ae(je.$$.fragment),At=L(),Ae(ut.$$.fragment),En=L(),Pi&&Pi.c(),v(h,"class","control"),v(c,"class","field navbar-run-buttons has-addons svelte-hl0lfa"),v(a,"class","navbar-item is-expanded"),v(z,"aria-hidden","true"),v(M,"aria-hidden","true"),v(N,"aria-hidden","true"),v(C,"role","button"),v(C,"class","navbar-burger"),v(C,"aria-label","menu"),v(C,"aria-expanded",n[26]),ne(C,"is-active",n[26]),v(l,"class","navbar-brand"),v(re,"class","navbar-start is-hidden-tablet"),v(ye,"class","navbar-end"),v(U,"class","navbar-menu"),ne(U,"is-active",n[26]),v(s,"class","navbar"),v(r,"class","top svelte-hl0lfa"),v(xe,"class","left svelte-hl0lfa"),v(ke,"class","grow main-panel svelte-hl0lfa"),v(i,"class","stack svelte-hl0lfa"),v(t,"class","mzn-playground-wrapper svelte-hl0lfa"),ne(t,"is-dark",n[24]),v(e,"class","mzn-playground svelte-hl0lfa")},m(J,we){Y(J,e,we),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Q(s,l),fe&&fe.m(l,null),Q(l,o),Q(l,a),Q(a,c),Q(c,h),He[O].m(h,null),Q(c,g),xt&&xt.m(c,null),Q(c,m),gt&>.m(c,null),Q(c,$),oi&&oi.m(c,null),Q(c,y),Ht&&Ht.m(c,null),Q(l,_),Ct&&Ct.m(l,null),Q(l,x),De&&De.m(l,null),Q(l,R),ri&&ri.m(l,null),Q(l,A),Q(l,C),Q(C,z),Q(C,V),Q(C,M),Q(C,B),Q(C,N),Q(s,G),Q(s,U),Q(U,re),Q(U,ae),Q(U,ye),Sn[Se].m(ye,null),Q(ye,Ue),zt&&zt.m(ye,null),Q(i,Ie),Q(i,ke),Q(ke,xe),Re(lt,xe,null),Q(ke,Qt),Re(pt,ke,null),Q(t,qt),Re($e,t,null),Q(t,oe),Re(H,t,null),Q(t,ue),Re(ce,t,null),Q(t,Ee),Re(tt,t,null),Q(t,ft),Re(je,t,null),Q(t,At),Re(ut,t,null),Q(t,En),Pi&&Pi.m(t,null),_t=!0,Wt||(St=le(C,"click",n[95]),Wt=!0)},p(J,we){fe&&fe.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(fe,Be,J,J[137],_t?Ri(Be,J[137],we,G9):Ai(J[137]),yb);let tn=O;O=gi(J),O===tn?He[O].p(J,we):(Je(),j(He[tn],1,1,()=>{He[tn]=null}),et(),p=He[O],p?p.p(J,we):(p=He[O]=Fe[O](J),p.c()),D(p,1),p.m(h,null)),!J[53]&&J[8]?xt?xt.p(J,we):(xt=vb(J),xt.c(),xt.m(c,m)):xt&&(xt.d(1),xt=null),!J[53]&&J[4]?gt?(gt.p(J,we),we[0]&16|we[1]&4194304&&D(gt,1)):(gt=wb(J),gt.c(),D(gt,1),gt.m(c,$)):gt&&(Je(),j(gt,1,1,()=>{gt=null}),et()),oi&&oi.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(oi,zn,J,J[137],_t?Ri(zn,J[137],we,F9):Ai(J[137]),$b),J[53]&&J[5]&&J[23].length>0?Ht?Ht.p(J,we):(Ht=Qb(J),Ht.c(),Ht.m(c,null)):Ht&&(Ht.d(1),Ht=null),Ct&&Ct.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(Ct,gn,J,J[137],_t?Ri(gn,J[137],we,B9):Ai(J[137]),Sb),J[5]&&J[23].length>0?De?(De.p(J,we),we[0]&8388640&&D(De,1)):(De=kb(J),De.c(),D(De,1),De.m(l,R)):De&&(Je(),j(De,1,1,()=>{De=null}),et()),ri&&ri.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(ri,mn,J,J[137],_t?Ri(mn,J[137],we,j9):Ai(J[137]),gb),(!_t||we[0]&67108864)&&v(C,"aria-expanded",J[26]),(!_t||we[0]&67108864)&&ne(C,"is-active",J[26]);let Br=Se;Se=tr(J),Se===Br?Sn[Se].p(J,we):(Je(),j(Sn[Br],1,1,()=>{Sn[Br]=null}),et(),ge=Sn[Se],ge?ge.p(J,we):(ge=Sn[Se]=Kt[Se](J),ge.c()),D(ge,1),ge.m(ye,Ue)),zt&&zt.p&&(!_t||we[1]&4194304|we[4]&8192)&&Xi(zt,Nr,J,J[137],_t?Ri(Nr,J[137],we,q9):Ai(J[137]),hb),(!_t||we[0]&67108864)&&ne(U,"is-active",J[26]);const Mn={};we[0]&4&&(Mn.direction=J[2]),we[1]&131072&&(Mn.showPanels=J[48]),we[0]&1916002498|we[1]&1055748|we[4]&8192&&(Mn.$$scope={dirty:we,ctx:J}),!Vt&&we[0]&8&&(Vt=!0,Mn.split=J[3],Vo(()=>Vt=!1)),lt.$set(Mn);const vr={};we[1]&16&&(vr.active=J[35]),we[1]&16384&&(vr.stdFlags=J[45]),pt.$set(vr);const ir={};we[0]&1073741824&&(ir.active=J[30]),we[0]&1048576&&(ir.files=J[20]),$e.$set(ir);const Rs={};we[0]&268435456&&(Rs.active=J[28]),H.$set(Rs);const nr={};we[0]&536870912&&(nr.active=J[29]!==null),we[0]&537919488|we[4]&8192&&(nr.$$scope={dirty:we,ctx:J}),ce.$set(nr);const kt={};we[1]&1&&(kt.active=J[31]),we[1]&8192&&(kt.modelFiles=J[44]),tt.$set(kt);const wr={};we[1]&2&&(wr.active=J[32]),we[1]&32768&&(wr.dataFiles=J[46]),we[1]&8&&(wr.parameters=J[34]),je.$set(wr);const Fr={};we[1]&256&&(Fr.active=J[39]),we[1]&896|we[4]&8192&&(Fr.$$scope={dirty:we,ctx:J}),ut.$set(Fr),Pi&&Pi.p&&(!_t||we[4]&8192)&&Xi(Pi,jr,J,J[137],_t?Ri(jr,J[137],we,null):Ai(J[137]),null),(!_t||we[0]&16777216)&&ne(t,"is-dark",J[24])},i(J){_t||(D(fe,J),D(p),D(gt),D(oi,J),D(Ct,J),D(De),D(ri,J),D(ge),D(zt,J),D(lt.$$.fragment,J),D(pt.$$.fragment,J),D($e.$$.fragment,J),D(H.$$.fragment,J),D(ce.$$.fragment,J),D(tt.$$.fragment,J),D(je.$$.fragment,J),D(ut.$$.fragment,J),D(Pi,J),_t=!0)},o(J){j(fe,J),j(p),j(gt),j(oi,J),j(Ct,J),j(De),j(ri,J),j(ge),j(zt,J),j(lt.$$.fragment,J),j(pt.$$.fragment,J),j($e.$$.fragment,J),j(H.$$.fragment,J),j(ce.$$.fragment,J),j(tt.$$.fragment,J),j(je.$$.fragment,J),j(ut.$$.fragment,J),j(Pi,J),_t=!1},d(J){J&&X(e),fe&&fe.d(J),He[O].d(),xt&&xt.d(),gt&>.d(),oi&&oi.d(J),Ht&&Ht.d(),Ct&&Ct.d(J),De&&De.d(),ri&&ri.d(J),Sn[Se].d(),zt&&zt.d(J),Xe(lt),n[117](null),Xe(pt),Xe($e),Xe(H),Xe(ce),Xe(tt),Xe(je),Xe(ut),Pi&&Pi.d(J),Wt=!1,St()}}}function Vb(n,e){n.effects=n.effects?[...n.effects,e]:[e]}function c8(n,e,t){let i,r,s,l,o,a,c,h,O,p,g,m,$,y,_,x,R,A,C;$O(n,D9,Z=>t(91,A=Z)),$O(n,V9,Z=>t(53,C=Z));let{$$slots:z={},$$scope:V}=e,{showVersionSwitcher:M=!0}=e,{showSolverDropdown:B=!0}=e,{edgeMiniZinc:N=!1}=e,{autoClearOutput:G=!1}=e,{showTabs:U=!0}=e,{canEditTabs:re=!0}=e,{compilationEnabled:ae=!0}=e,{project:ye}=e,{enabledSolvers:Se=null}=e,{canEditSolverSettings:ge=!0}=e,{showShareButton:Ue=!0}=e,{showDownloadButton:Ie=!0}=e,{externalPlaygroundURL:ke=null}=e,{splitterDirection:xe="vertical"}=e,{splitterSize:lt=75}=e,{canSwitchOrientation:Vt=!0}=e,{showClearOutput:Qt=!0}=e,{showAutoClearOutput:pt=!0}=e,{showOutputSectionToggles:qt=!0}=e,{showOutputRightControls:$e=!0}=e,{theme:oe="auto"}=e,{hideOutputOnStartup:H=!0}=e,{autoFocus:ue=!0}=e;const ce=en();let Ee=0,tt=[],ft,je,At={latest:{label:"Latest",detail:"stable"},edge:{label:"Edge",detail:"development"}};function ut(Z){const he=N?Lx:Ix;if(je!==he){t(18,Ee++,Ee);const be=ft;ft=new Promise(async(Pe,ze)=>{be&&await be,je&&je.shutdown(),je=he,je.shutdown(),await je.init();const[it]=/version \d+\.\d+\.\d+(?:, build .*)?$/m.exec(await je.version()),Ze=N?"edge":"latest";t(19,At={...At,[Ze]:{...At[Ze],detail:it}}),t(83,tt=await je.solvers()),await Fn(),t(18,Ee--,Ee),Pe()})}return ft}const En=new Promise((Z,he)=>{Hc(()=>{ut(),Z()})});async function _t(Z){t(0,N=Z.minizincVersion==="edge"),await En,t(20,fe=[]),Zs(Z.files,ue),t(21,He=Z.tab||0),await ut(),Z.solverId?t(22,Kt=y.findIndex(he=>he.id===Z.solverId)):t(22,Kt=y.findIndex(he=>he.extraInfo&&he.extraInfo.isDefault)||0),Z.solverConfig?gi.load(Z.solverConfig):gi.reset()}async function Wt(Z){const he=fe.length;Zs(Z.files),Z.tab!==void 0&&Z.tab!==null&&Z.tab>=0&&zt(he+Z.tab),Z.solverId&&(await ut(),t(22,Kt=y.findIndex(be=>be.id===Z.solverId)))}function St(){return fe.length>0}let Be,fe=[],Fe=!1,He=0,gi,xt=!1,gt=null,zn=!1,oi=!1,Ht=null,gn=!1,Ct=[],De=null,mn=[],ri={},Kt=-1;async function Sn(Z,he){if(await ut(),Kt<0||Kt>=y.length){const be=y.findIndex(Pe=>Pe.extraInfo&&Pe.extraInfo.isDefault);be!==-1&&t(22,Kt=be)}}let tr=!1;function Nr(){t(35,tr=!tr)}async function zt(Z,he=!0){for(Be&&He=0&&fe[Z].hidden;)Z--;Z===-1&&(Z=fe.findIndex(be=>!be.hidden)),t(21,He=Z),await Fn(),Be&&h&&(he&&Be.focus(),h.scrollTop!==void 0&&Be.getView().requestMeasure({read(be){be.scrollDOM.scrollTo(h.scrollLeft,h.scrollTop)}}))}function Ts(Z){let he=`Untitled${Z}`,be=2;for(;fe.find(Pe=>Pe.name===he);)he=`Untitled-${be++}${Z}`;t(20,fe=[...fe,{name:he,state:Ot.create({extensions:ec(Z,kr,R)})}]),zt(fe.length-1),t(28,xt=!1)}function Zs(Z,he=!0){let be=[];for(const Pe of Z){const ze=Pe.name.endsWith(".mzc.mzn")?Pe.name.length-8:Pe.name.lastIndexOf("."),it=Pe.name.substring(0,ze).replaceAll(/[\/\\\.]/g,""),Ze=Pe.name.substring(ze);let mi=`${it}${Ze}`,Zt=2;for(;fe.find(oo=>oo.name===mi);)mi=`${it}-${Zt++}${Ze}`;const Jr=ec(Ze,kr,R,Pe.readOnly);be.push({...Pe,hidden:Pe.hidden||Ze===".mzc",name:mi,state:Ot.create({doc:Pe.contents,extensions:Jr,selection:{anchor:Pe.anchor||0}})})}t(20,fe=[...fe,...be]),zt(fe.length-1,he),t(28,xt=!1)}function Hl(Z){const{index:he,name:be,suffix:Pe}=Z.detail;let ze=be,it=2;for(;fe.some(Ze=>Ze===ze+Pe);)ze=`${be}-${it++}`;h&&t(87,h.state=Be.getState(),h),t(20,fe=[...fe.slice(0,he),{...fe[he],name:be+Pe},...fe.slice(he+1)])}function jr(Z){const he=r===1&&!fe[Z].hidden;t(20,fe=[...fe.slice(0,Z),...fe.slice(Z+1),...he?[{name:"Untitled.mzn",state:Ot.create({extensions:ec(".mzn",kr,R)})}]:[]]),He>=fe.length?zt(fe.length-1):zt(He),t(29,gt=null)}function Pi(Z,he){h&&t(87,h.state=Be.getState(),h);const be={...fe[Z],...he};"readOnly"in he&&Vb(be,he.readOnly?OY:dY),t(20,fe=[...fe.slice(0,Z),be,...fe.slice(Z+1)]),zt(He)}function J(Z,he){let be;Z0){await Fn();const he=Be.getView();he&&he.state===Z.state&&(he.dispatch({effects:Z.effects}),Z.effects=[])}}let tn=null;async function Br(Z){t(18,Ee++,Ee),t(87,h.state=Be.getState(),h);let he=O?h:null;if(!he){if(m.length===0)return t(18,Ee--,Ee),!1;if(m.length===1)he=fe.find(ze=>ze.name===m[0]);else try{const ze=await new Promise((it,Ze)=>{t(36,tn=it),t(31,oi=!0)});if(!ze)return t(18,Ee--,Ee),!1;he=fe.find(it=>it.name===ze.modelFile)}finally{t(31,oi=!1)}}const be=new je.Model,Pe=[he.name];{const ze=he.name.substring(0,he.name.length-4),it=fe.find(Ze=>Ze.name===`${ze}.mzc`||Ze.name===`${ze}.mzc.mzn`);it&&Pe.push(it.name)}he!==h&&Pe.push(h.name);for(const ze of fe)be.addFile(ze.name,ze.state.doc.toString(),Pe.indexOf(ze.name)!==-1);try{const{input:ze}=await be.interface({options:gi.getCompilationConfiguration(_.id)});if(Object.keys(ze).length>0){const it={};for(const Ze in ze)it[Ze]=ri[Ze];t(34,ri=it),p&&mn.indexOf(h.name)===-1&&(mn=[...mn,h.name]);try{const Ze=await new Promise((mi,Zt)=>{t(36,tn=mi),t(32,Ht=!0)});if(!Ze)return t(18,Ee--,Ee),!1;if(Ze.parameters){let mi="";for(const Zt in Ze.parameters)Ze.parameters[Zt].trim().length>0&&(mi+=`${Zt} = ${Ze.parameters[Zt]}; +`);be.addDznString(mi),t(34,ri=Ze.parameters)}else{for(const mi of Ze.dataFiles)Pe.indexOf(mi)===-1&&(be.addFile(mi),Pe.push(mi));mn=Ze.dataFiles}}finally{t(32,Ht=!1)}}}catch(ze){console.error(ze)}return t(18,Ee--,Ee),{model:be,fileList:Pe}}async function Mn(){if(g){const ze=new je.Model;ze.addFile(h.name,h.state.doc.toString());const it=[h.name],Ze=gi.getSolvingConfiguration(_.id);await vr(ze,it,Ze);return}const Z=await Br();if(!Z)return;const{model:he,fileList:be}=Z,Pe=gi.getSolvingConfiguration(_.id);await vr(he,be,Pe)}async function vr(Z,he,be){t(84,gn=!0);const Pe=Date.now();G&&t(33,Ct=[]),t(33,Ct=[...Ct,{files:he,output:[]}]),t(85,De=Z.solve({options:be,jsonOutput:!1})),wr(),De.on("error",kt),De.on("warning",kt),De.on("solution",ze=>kt(ze,Date.now()-Pe)),De.on("status",ze=>kt(ze,Date.now()-Pe)),De.on("statistics",kt),De.on("trace",ze=>kt(ze,Date.now()-Pe)),De.on("statistics",kt),De.on("comment",kt),De.on("time",kt),De.on("checker",kt),De.on("stderr",kt);try{await De,kt({type:"exit",code:0,runTime:Date.now()-Pe})}catch(ze){kt({type:"exit",code:ze.code,runTime:Date.now()-Pe})}t(85,De=null)}async function ir(){t(84,gn=!0);const Z=await Br();if(!Z)return;wr();const{model:he,fileList:be}=Z,Pe=be[0],ze=Date.now();G&&t(33,Ct=[]),t(33,Ct=[...Ct,{files:be,isCompile:!0,output:[]}]),t(85,De=he.compile({options:gi.getCompilationConfiguration(_.id)})),De.on("error",kt),De.on("warning",kt),De.on("statistics",kt),De.on("trace",kt),De.on("statistics",kt),De.on("stderr",kt);try{const it=await De;t(20,fe=[...fe,{name:`${Pe.substring(0,Pe.indexOf("."))}.fzn`,state:Ot.create({extensions:ec(".fzn",kr,R),doc:it})}]),zt(fe.length-1),kt({type:"exit",code:0,runTime:Date.now()-ze})}catch(it){kt({type:"exit",code:it.code,runTime:Date.now()-ze})}t(85,De=null)}function Rs(){kt({type:"cancel"}),De.cancel()}let nr=null;function kt(Z,he){nr?nr.then(()=>{nr=Fr(Z,he)}):nr=Fr(Z,he),Ct[Ct.length-1].output.push(Z),t(33,Ct)}function wr(){bn&&bn.reset(),t(42,Gr=!1),t(43,Hr=!1)}async function Fr(Z,he){if(Z.type==="trace"&&Z.section.startsWith("mzn_vis_")){Gr||(t(42,Gr=!0),t(43,Hr=!0)),await Fn();const be=fe.find(ze=>ze.name===Z.message.url);let Pe=null;if(be)Pe=be.state.doc.toString();else try{Pe=await je.readStdlibFileContents(Z.message.url)}catch(ze){console.error(ze);return}if(Pe===null){console.error(`Failed to get visualisation file ${Z.message.url}`);return}bn.addVisualisation(Z.section,Pe,Z.message.userData);return}if(Gr){for(;!bn;)await Fn();switch(Z.type){case"solution":bn.addSolution(Z.sections.filter(be=>be.startsWith("mzn_vis_")).reduce((be,Pe)=>({...be,[Pe]:Z.output[Pe]}),{}),"time"in Z?Z.time:he);break;case"status":bn.status(Z.status,"time"in Z?Z.time:he);break;case"exit":bn.status("time"in Z?Z.time:he);break}}}function Kl(){return h&&t(87,h.state=Be.getState(),h),{files:fe.map(Z=>({name:Z.name,contents:Z.state.doc.toString(),...Z.hidden?{hidden:!0}:{},...Z.readOnly?{readOnly:!0}:{}})),tab:He,solverId:_.id,solverConfig:gi.save(),minizincVersion:N?"edge":"latest"}}let Jl=!1;async function Qa(){t(37,Jl=!0);try{const Z=(await bm(async()=>{const{default:Zt}=await import("./jszip.min-DrXWpbGW.js").then(Jr=>Jr.j);return{default:Zt}},[])).default,he=(await bm(async()=>{const{default:Zt}=await import("./FileSaver.min-yl_Rp0vC.js").then(Jr=>Jr.F);return{default:Zt}},[])).default,be=Kl(),Pe=fe.map(Zt=>Zt.name),ze=fe.filter(Zt=>!Zt.hidden).map(Zt=>Zt.name);let it=_.id;it==="org.minizinc.gecode_presolver"?it="org.gecode.gecode":it==="org.minizinc.chuffed"&&(it="org.chuffed.chuffed");const Ze=new Z;for(const Zt of be.files)Ze.file(Zt.name,Zt.contents);Ze.file("Project.mzp",JSON.stringify({version:105,projectFiles:Pe,openFiles:ze,openTab:be.tab,selectedBuiltinConfigId:it,selectedBuiltinConfigVersion:"default"}));const mi=await Ze.generateAsync({type:"blob"});he.saveAs(mi,"Project.zip")}catch(Z){console.error(Z)}finally{t(37,Jl=!1)}}let Qr,_r=null,eo=!1;function el(Z){const he=Kl(),be=new URL(Z);return be.hash=`#project=${encodeURIComponent(JSON.stringify(he))}`,t(40,eo=!1),be.toString()}function fu(){Qr.select(),Qr.setSelectionRange(0,_r.length),navigator.clipboard.writeText(_r),t(40,eo=!0)}function _a(){ke&&window.open(el(ke),"_blank").focus()}let ka=null;async function kr(Z){const he=Z.view;if(!(Ee!==0||!_||!h||!h.name.endsWith(".mzn")))try{const be=he.state.doc.toString();if(be===ka)return;ka=be;const Pe=new je.Model;for(const Ze of fe)Pe.addFile(Ze.name,Ze.state.doc.toString(),!1);const ze=Pe.addString(be),it=await Pe.check({options:gi.getCompilationConfiguration(_.id)});if(he.state.doc.toString()!==be)return;M9(be,it.filter(Ze=>Ze.location.filename===ze),he)}catch(be){console.error(be)}}function Pa(Z){const he=fe.findIndex(be=>be.name===Z.filename);if(he!==-1){zt(he);const be=fe[he].state.doc.toString(),Pe=$d(Z.firstLine,Z.firstColumn,be);Be.focus(),Be.setCursor(Pe)}}function tl(){xe==="horizontal"?t(2,xe="vertical"):t(2,xe="horizontal")}function cu(Z){t(0,N=Z.detail.item===At.edge)}function uu(Z){h&&t(87,h.state=Be.getState(),h),fe.forEach(he=>Vb(he,Z?gY:pY)),we(h)}let bn,Gr=!1,Hr=!1;function to(Z){De&&Rs();const he=[Z.modelFile],be=Z.modelFile.substring(0,Z.modelFile.length-4),Pe=fe.find(it=>it.name===`${be}.mzc`||it.name===`${be}.mzc.mzn`);if(Pe&&he.push(Pe.name),Z.dataFiles)for(const it of Z.dataFiles)he.push(it);const ze=new je.Model;for(const it of fe)ze.addFile(it.name,it.state.doc.toString(),he.indexOf(it.name)!==-1);vr(ze,he,Z.options||gi.getSolvingConfiguration(_.id))}function hu(){return Kt===(y.findIndex(Z=>Z.extraInfo&&Z.extraInfo.isDefault)||0)}function Ou(){return gi.isDefault()}function du(){Kt=yO(this),t(22,Kt)}function pu(){Kt=yO(this),t(22,Kt)}const Wa=()=>{t(26,Fe=!Fe),t(35,tr=!1)},xa=()=>{ir(),t(26,Fe=!1)},Ca=()=>{Nr(),t(26,Fe=!1)},io=()=>{t(0,N=!N),t(26,Fe=!1)},gu=()=>{t(39,_r=el(window.location.href)),t(26,Fe=!1)},Ta=()=>{_a(),t(26,Fe=!1)},il=()=>t(39,_r=el(window.location.href)),Za=()=>Qa(),mu=()=>{t(43,Hr=!1)},Ra=()=>{t(43,Hr=!0)};function Xa(Z){Et[Z?"unshift":"push"](()=>{bn=Z,t(41,bn)})}const no=Z=>to(Z.detail);function Su(Z){G=Z,t(1,G)}const Aa=()=>t(33,Ct=[]),ro=Z=>Pa(Z.detail.location),so=Z=>zt(Z.detail.index),Kr=Z=>J(Z.detail.src,Z.detail.dest),Ya=()=>t(28,xt=!0),Ua=Z=>t(29,gt=Z.detail.index),bu=()=>t(30,zn=!0);function Ea(Z){Et[Z?"unshift":"push"](()=>{Be=Z,t(25,Be)})}function za(Z){lt=Z,t(3,lt)}function Ma(Z){Et[Z?"unshift":"push"](()=>{gi=Z,t(27,gi)})}const Da=()=>t(35,tr=!1),$u=()=>t(30,zn=!1),yu=Z=>t(29,gt=Z.detail.index),vu=Z=>Pi(Z.detail.index,Z.detail.options),Va=()=>t(28,xt=!0),wu=()=>t(28,xt=!1),Qu=Z=>Ts(Z.detail.type),_u=Z=>Wt(Z.detail),ku=()=>jr(gt),lo=()=>t(29,gt=null),Pu=()=>t(29,gt=null),Wu=Z=>tn(Z.detail),xu=()=>tn(!1),Cu=Z=>tn(Z.detail),Tu=()=>tn(!1),Tt=()=>t(39,_r=null);function Pt(Z){Et[Z?"unshift":"push"](()=>{Qr=Z,t(38,Qr)})}const Zu=()=>Qr.select(),Ru=()=>t(39,_r=null);return n.$$set=Z=>{"showVersionSwitcher"in Z&&t(4,M=Z.showVersionSwitcher),"showSolverDropdown"in Z&&t(5,B=Z.showSolverDropdown),"edgeMiniZinc"in Z&&t(0,N=Z.edgeMiniZinc),"autoClearOutput"in Z&&t(1,G=Z.autoClearOutput),"showTabs"in Z&&t(6,U=Z.showTabs),"canEditTabs"in Z&&t(7,re=Z.canEditTabs),"compilationEnabled"in Z&&t(8,ae=Z.compilationEnabled),"project"in Z&&t(73,ye=Z.project),"enabledSolvers"in Z&&t(74,Se=Z.enabledSolvers),"canEditSolverSettings"in Z&&t(9,ge=Z.canEditSolverSettings),"showShareButton"in Z&&t(10,Ue=Z.showShareButton),"showDownloadButton"in Z&&t(11,Ie=Z.showDownloadButton),"externalPlaygroundURL"in Z&&t(12,ke=Z.externalPlaygroundURL),"splitterDirection"in Z&&t(2,xe=Z.splitterDirection),"splitterSize"in Z&&t(3,lt=Z.splitterSize),"canSwitchOrientation"in Z&&t(13,Vt=Z.canSwitchOrientation),"showClearOutput"in Z&&t(14,Qt=Z.showClearOutput),"showAutoClearOutput"in Z&&t(15,pt=Z.showAutoClearOutput),"showOutputSectionToggles"in Z&&t(16,qt=Z.showOutputSectionToggles),"showOutputRightControls"in Z&&t(17,$e=Z.showOutputRightControls),"theme"in Z&&t(75,oe=Z.theme),"hideOutputOnStartup"in Z&&t(76,H=Z.hideOutputOnStartup),"autoFocus"in Z&&t(77,ue=Z.autoFocus),"$$scope"in Z&&t(137,V=Z.$$scope)},n.$$.update=()=>{n.$$.dirty[0]&524288&&t(52,i=[At.latest,At.edge]),n.$$.dirty[0]&1&&ut(),n.$$.dirty[2]&2048&&_t(ye),n.$$.dirty[0]&1048576&&(r=fe.filter(Z=>!Z.hidden).length),n.$$.dirty[0]&3145728&&t(87,h=HeSe.indexOf(Z.id)!==-1):tt),n.$$.dirty[0]&12582912&&t(86,_=Kt>=0&&KtZ.name.endsWith(".mzn")&&!Z.name.endsWith(".mzc.mzn")).map(Z=>Z.name)),n.$$.dirty[0]&1048576&&t(46,$=fe.filter(Z=>Z.name.endsWith(".dzn")||Z.name.endsWith(".json")).map(Z=>Z.name)),n.$$.dirty[0]&12582912&&Sn(),n.$$.dirty[2]&16777216&&t(45,x=_?_.stdFlags:[]),n.$$.dirty[2]&33554432&&we(h),n.$$.dirty[2]&536879104&&t(24,R={dark:!0,light:!1,auto:A}[oe]),n.$$.dirty[0]&16777216&&uu(R),n.$$.dirty[0]&8388608&&ce("solversChanged",{solvers:y})},[N,G,xe,lt,M,B,U,re,ae,ge,Ue,Ie,ke,Vt,Qt,pt,qt,$e,Ee,At,fe,He,Kt,y,R,Be,Fe,gi,xt,gt,zn,oi,Ht,Ct,ri,tr,tn,Jl,Qr,_r,eo,bn,Gr,Hr,m,x,$,c,a,o,l,s,i,C,Wt,Nr,zt,Ts,Hl,jr,Pi,J,Mn,ir,Rs,Qa,el,fu,_a,Pa,tl,cu,to,ye,Se,oe,H,ue,_t,St,Kl,hu,Ou,tt,gn,De,_,h,g,p,O,A,z,du,pu,Wa,xa,Ca,io,gu,Ta,il,Za,mu,Ra,Xa,no,Su,Aa,ro,so,Kr,Ya,Ua,bu,Ea,za,Ma,Da,$u,yu,vu,Va,wu,Qu,_u,ku,lo,Pu,Wu,xu,Cu,Tu,Tt,Pt,Zu,Ru,V]}class u8 extends $i{constructor(e){super(),bi(this,e,c8,f8,Oi,{showVersionSwitcher:4,showSolverDropdown:5,edgeMiniZinc:0,autoClearOutput:1,showTabs:6,canEditTabs:7,compilationEnabled:8,project:73,enabledSolvers:74,canEditSolverSettings:9,showShareButton:10,showDownloadButton:11,externalPlaygroundURL:12,splitterDirection:2,splitterSize:3,canSwitchOrientation:13,showClearOutput:14,showAutoClearOutput:15,showOutputSectionToggles:16,showOutputRightControls:17,theme:75,hideOutputOnStartup:76,autoFocus:77,loadProject:78,hasFiles:79,getProject:80,isDefaultSolver:81,isDefaultSolverConfig:82},null,[-1,-1,-1,-1,-1,-1])}get loadProject(){return this.$$.ctx[78]}get hasFiles(){return this.$$.ctx[79]}get getProject(){return this.$$.ctx[80]}get isDefaultSolver(){return this.$$.ctx[81]}get isDefaultSolverConfig(){return this.$$.ctx[82]}}function qb(n,e,t){const i=n.slice();return i[10]=e[t],i[12]=t,i}function Ib(n){let e;return{c(){e=k("p"),e.textContent="No recent projects.",v(e,"class","has-text-centered")},m(t,i){Y(t,e,i)},p:Qe,d(t){t&&X(e)}}}function Lb(n){let e,t,i=Nb(n[10])+"",r,s,l,o,a=n[10].solver+"",c,h,O,p=new Date(n[10].timestamp).toLocaleString()+"",g,m,$,y;function _(){return n[7](n[12])}return{c(){e=k("div"),t=k("div"),r=pe(i),s=L(),l=k("div"),o=k("div"),c=pe(a),h=L(),O=k("div"),g=pe(p),m=L(),v(l,"class","info is-size-7 svelte-wl1zgv"),v(e,"class","item svelte-wl1zgv"),ne(e,"has-background-primary",n[2]===n[12]),ne(e,"has-text-white",n[2]===n[12])},m(x,R){Y(x,e,R),Q(e,t),Q(t,r),Q(e,s),Q(e,l),Q(l,o),Q(o,c),Q(l,h),Q(l,O),Q(O,g),Q(e,m),$||(y=[le(e,"click",_),le(e,"dblclick",n[5])],$=!0)},p(x,R){n=x,R&2&&i!==(i=Nb(n[10])+"")&&Le(r,i),R&2&&a!==(a=n[10].solver+"")&&Le(c,a),R&2&&p!==(p=new Date(n[10].timestamp).toLocaleString()+"")&&Le(g,p),R&4&&ne(e,"has-background-primary",n[2]===n[12]),R&4&&ne(e,"has-text-white",n[2]===n[12])},d(x){x&&X(e),$=!1,Ft(y)}}}function h8(n){let e,t=st(n[1]),i=[];for(let s=0;si.name);return n.files.length>3&&t.push(`+${n.files.length-3} more…`),t.join(", ")}return n.files.map(t=>t.name).join(", ")}function p8(n,e,t){let i;const r=en();let{active:s=!1}=e,{projects:l=[]}=e,o=-1;function a(g){g||t(2,o=-1)}function c(){i&&r("accept",{project:l[o]})}const h=()=>r("cancel"),O=g=>t(2,o=g),p=()=>r("cancel");return n.$$set=g=>{"active"in g&&t(0,s=g.active),"projects"in g&&t(1,l=g.projects)},n.$$.update=()=>{n.$$.dirty&6&&t(3,i=o>=0&&o{const t=localStorage.getItem(yd);if(t&&t.length>0){ms=!0;try{e(i=>({...i,...JSON.parse(t)}))}catch(i){console.error(i)}ms=!1}window.addEventListener("storage",i=>{if(i.storageArea===localStorage&&i.key===yd&&i.newValue.length>0){ms=!0;try{e(r=>({...r,...JSON.parse(i.newValue)}))}catch(r){console.error(r)}ms=!1}})});Ns.subscribe(n=>{ms||(Object.keys(n.sessions).length>jb&&(ms=!0,Ns.update(e=>{const t=Object.keys(e.sessions).map(i=>({key:i,value:e.sessions[i]}));return t.sort((i,r)=>r.value.timestamp-i.value.timestamp),ms=!0,{...e,sessions:t.slice(0,jb).reduce((i,r)=>({...i,[r.key]:r.value}),{})}}),ms=!1),localStorage.setItem(yd,JSON.stringify(n)))});const{document:m8,window:Bb}=Gx;function S8(n){let e,t;return e=new g8({props:{projects:n[5],active:n[4]}}),e.$on("cancel",n[12]),e.$on("accept",n[13]),{c(){Ae(e.$$.fragment)},m(i,r){Re(e,i,r),t=!0},p(i,r){const s={};r&32&&(s.projects=i[5]),r&16&&(s.active=i[4]),e.$set(s)},i(i){t||(D(e.$$.fragment,i),t=!0)},o(i){j(e.$$.fragment,i),t=!1},d(i){Xe(e,i)}}}function b8(n){let e,t,i,r,s,l,o,a,c;return l=new wt({props:{icon:qy}}),{c(){e=k("div"),t=k("div"),i=k("div"),r=k("button"),s=k("span"),Ae(l.$$.fragment),v(s,"class","icon"),v(r,"class","button"),v(r,"title","Open recent project"),v(i,"class","control"),v(t,"class","field"),v(e,"class","navbar-item")},m(h,O){Y(h,e,O),Q(e,t),Q(t,i),Q(i,r),Q(r,s),Re(l,s,null),o=!0,a||(c=le(r,"click",n[11]),a=!0)},p:Qe,i(h){o||(D(l.$$.fragment,h),o=!0)},o(h){j(l.$$.fragment,h),o=!1},d(h){h&&X(e),Xe(l),a=!1,c()}}}function $8(n){let e,t,i,r,s,l,o,a;return i=new wt({props:{icon:qy}}),{c(){e=k("a"),t=k("span"),Ae(i.$$.fragment),r=L(),s=k("span"),s.textContent="Open recent project",v(t,"class","icon"),v(e,"class","navbar-item mobile-menu-item"),v(e,"href","javascript:void(0);")},m(c,h){Y(c,e,h),Q(e,t),Re(i,t,null),Q(e,r),Q(e,s),l=!0,o||(a=le(e,"click",n[10]),o=!0)},p:Qe,i(c){l||(D(i.$$.fragment,c),l=!0)},o(c){j(i.$$.fragment,c),l=!1},d(c){c&&X(e),Xe(i),o=!1,a()}}}function y8(n){let e,t,i,r;const s=[$8,b8],l=[];function o(a,c){return a[25]?0:1}return e=o(n),t=l[e]=s[e](n),{c(){t.c(),i=Gt()},m(a,c){l[e].m(a,c),Y(a,i,c),r=!0},p(a,c){let h=e;e=o(a),e===h?l[e].p(a,c):(Je(),j(l[h],1,1,()=>{l[h]=null}),et(),t=l[e],t?t.p(a,c):(t=l[e]=s[e](a),t.c()),D(t,1),t.m(i.parentNode,i))},i(a){r||(D(t),r=!0)},o(a){j(t),r=!1},d(a){a&&X(i),l[e].d(a)}}}function v8(n){let e,t,i,r,s,l,o,a,c;function h(m){n[15](m)}function O(m){n[16](m)}function p(m){n[17](m)}let g={project:n[3],$$slots:{"navbar-before-share-buttons":[y8,({isMobile:m})=>({25:m}),({isMobile:m})=>m?33554432:0],default:[S8]},$$scope:{ctx:n}};return n[1].autoClearOutput!==void 0&&(g.autoClearOutput=n[1].autoClearOutput),n[1].splitterDirection!==void 0&&(g.splitterDirection=n[1].splitterDirection),n[1].splitterSize!==void 0&&(g.splitterSize=n[1].splitterSize),i=new u8({props:g}),n[14](i),Et.push(()=>qo(i,"autoClearOutput",h)),Et.push(()=>qo(i,"splitterDirection",O)),Et.push(()=>qo(i,"splitterSize",p)),i.$on("solversChanged",n[18]),{c(){e=L(),t=k("div"),Ae(i.$$.fragment),v(t,"class","playground-app svelte-tuc1wl")},m(m,$){Y(m,e,$),Y(m,t,$),Re(i,t,null),o=!0,a||(c=[le(Bb,"beforeunload",n[7]),le(Bb,"hashchange",n[6]),le(m8,"visibilitychange",n[9])],a=!0)},p(m,[$]){const y={};$&8&&(y.project=m[3]),$&100663346&&(y.$$scope={dirty:$,ctx:m}),!r&&$&2&&(r=!0,y.autoClearOutput=m[1].autoClearOutput,Vo(()=>r=!1)),!s&&$&2&&(s=!0,y.splitterDirection=m[1].splitterDirection,Vo(()=>s=!1)),!l&&$&2&&(l=!0,y.splitterSize=m[1].splitterSize,Vo(()=>l=!1)),i.$set(y)},i(m){o||(D(i.$$.fragment,m),o=!0)},o(m){j(i.$$.fragment,m),o=!1},d(m){m&&(X(e),X(t)),n[14](null),Xe(i),a=!1,Ft(c)}}}const bO=`% Use this editor as a MiniZinc scratch book +`,Fb="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";function w8(n,e,t){let i,r;$O(n,Ns,U=>t(1,r=U));let s,l={files:[]},o=null,a=!1,c=[];function h(U,re){return!s||!re?[]:Object.entries(re.sessions).map(([ae,ye])=>{const Se=U.find(ge=>ge.id===ye.solverId);return{key:ae,files:ye.files,timestamp:ye.timestamp,solver:Se?Se.name:""}}).filter(ae=>ae.key!==sessionStorage.mznPlaygroundSession).sort((ae,ye)=>ye.timestamp-ae.timestamp)}function O(){const U=()=>Array(6).fill(0).map(()=>Fb[Math.floor(Math.random()*Fb.length)]).join("");let re=U();for(;re in r.sessions;)re=U();return re}function p(U){return U.solverId||(U.solver===0?U.solverId="org.minizinc.gecode_presolver":l.solver===1&&(U.solverId="org.minizinc.mip.coin-bc")),U}let g=!1;async function m(){const U=window.location.hash;if(U.length>0&&(g=!0,window.history.replaceState(void 0,void 0,window.location.pathname+window.location.search),g=!1),!g){if(U.startsWith("#project="))try{const re=decodeURIComponent(U.substring(9));y(O(),{...JSON.parse(re),timestamp:Date.now()});return}catch(re){console.error(re)}if(U.startsWith("#code="))try{const re=decodeURIComponent(U.substring(6));y(O(),{files:[{name:"Playground.mzn",contents:re,anchor:re.length}],timestamp:Date.now()});return}catch(re){console.error(re)}if(U.startsWith("#url="))try{const re=decodeURIComponent(U.substring(5));y(O(),await lQ(re));return}catch(re){console.error(re)}if(sessionStorage.mznPlaygroundSession&&r.sessions[sessionStorage.mznPlaygroundSession]){y(sessionStorage.mznPlaygroundSession,r.sessions[sessionStorage.mznPlaygroundSession]);return}l.files.length===0&&y(O(),{files:[{name:"Playground.mzn",contents:bO,anchor:bO.length}],timestamp:Date.now()})}}Hc(()=>m());function $(){if(sessionStorage.mznPlaygroundSession&&s.hasFiles())try{const U=s.getProject();if(!(sessionStorage.mznPlaygroundSession in r.sessions)&&s.isDefaultSolver()&&s.isDefaultSolverConfig()&&U.files.length===1&&U.files[0].name==="Playground.mzn"&&U.files[0].contents===bO)return;o=Date.now(),Fx(Ns,r.sessions[sessionStorage.mznPlaygroundSession]={...U,timestamp:o},r)}catch(U){console.error(U)}}function y(U,re){$();try{const ae=p(re);sessionStorage.mznPlaygroundSession=U,t(3,l=ae),o=re.timestamp}catch(ae){console.error(ae)}t(4,a=!1),t(5,i=h(c,r))}function _(U){o!==null&&sessionStorage.mznPlaygroundSession in U.sessions&&U.sessions[sessionStorage.mznPlaygroundSession].timestamp>o&&(sessionStorage.mznPlaygroundSession=O(),t(5,i=h(c,U)))}const x=()=>{document.hidden&&$()},R=()=>t(4,a=!0),A=()=>t(4,a=!0),C=()=>t(4,a=!1),z=U=>y(U.detail.project.key,r.sessions[U.detail.project.key]);function V(U){Et[U?"unshift":"push"](()=>{s=U,t(2,s)})}function M(U){n.$$.not_equal(r.autoClearOutput,U)&&(r.autoClearOutput=U,Ns.set(r))}function B(U){n.$$.not_equal(r.splitterDirection,U)&&(r.splitterDirection=U,Ns.set(r))}function N(U){n.$$.not_equal(r.splitterSize,U)&&(r.splitterSize=U,Ns.set(r))}const G=U=>t(0,c=U.detail.solvers);return n.$$.update=()=>{n.$$.dirty&3&&t(5,i=h(c,r)),n.$$.dirty&2&&_(r)},[c,r,s,l,a,i,m,$,y,x,R,A,C,z,V,M,B,N,G]}class Q8 extends $i{constructor(e){super(),bi(this,e,w8,v8,Oi,{})}}new Q8({target:document.getElementById("app")});export{Xo as c,x8 as g}; diff --git a/develop/assets/jszip.min-Bl2THA8X.js b/develop/assets/jszip.min-DrXWpbGW.js similarity index 99% rename from develop/assets/jszip.min-Bl2THA8X.js rename to develop/assets/jszip.min-DrXWpbGW.js index cfffe08..6ffc4b8 100644 --- a/develop/assets/jszip.min-Bl2THA8X.js +++ b/develop/assets/jszip.min-DrXWpbGW.js @@ -1,4 +1,4 @@ -import{g as At,c as bt}from"./index-BocD5m97.js";function vt(yt){throw new Error('Could not dynamically require "'+yt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var St={exports:{}};/*! +import{g as At,c as bt}from"./index-HAa2DkAb.js";function vt(yt){throw new Error('Could not dynamically require "'+yt+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var St={exports:{}};/*! JSZip v3.10.1 - A JavaScript class for generating and reading zip files diff --git a/develop/index.html b/develop/index.html index 5546566..6408c4b 100644 --- a/develop/index.html +++ b/develop/index.html @@ -5,7 +5,7 @@ MiniZinc Playground - +