diff --git a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobLogServiceImpl.java b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobLogServiceImpl.java index 3cfff2731..329826666 100644 --- a/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobLogServiceImpl.java +++ b/easy-retry-server/easy-retry-server-web/src/main/java/com/aizuda/easy/retry/server/web/service/impl/JobLogServiceImpl.java @@ -65,7 +65,8 @@ public class JobLogServiceImpl implements JobLogService { ) { jobLogResponseVO.setFinished(Boolean.TRUE); } - + jobLogResponseVO.setNextStartId(queryVO.getStartId()); + jobLogResponseVO.setFromIndex(0); return jobLogResponseVO; } diff --git a/frontend/public/lib/assets/bHlUn7xq.js b/frontend/public/lib/assets/jjGQgzj_.js similarity index 99% rename from frontend/public/lib/assets/bHlUn7xq.js rename to frontend/public/lib/assets/jjGQgzj_.js index f89dc4543..974758f4a 100644 --- a/frontend/public/lib/assets/bHlUn7xq.js +++ b/frontend/public/lib/assets/jjGQgzj_.js @@ -1,4 +1,4 @@ -var e,t,n=Object.getOwnPropertyNames,o=(e={"assets/bHlUn7xq.js"(e,t){function n(e,t){const n=Object.create(null),o=e.split(",");for(let r=0;r!!n[e.toLowerCase()]:e=>!!n[e]}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={},r=[],i=()=>{},l=()=>!1,a=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith("onUpdate:"),c=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,p=(e,t)=>d.call(e,t),h=Array.isArray,f=e=>"[object Map]"===S(e),g=e=>"[object Set]"===S(e),m=e=>"function"==typeof e,v=e=>"string"==typeof e,b=e=>"symbol"==typeof e,y=e=>null!==e&&"object"==typeof e,O=e=>(y(e)||m(e))&&m(e.then)&&m(e.catch),w=Object.prototype.toString,S=e=>w.call(e),x=e=>"[object Object]"===S(e),$=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,C=n(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),k=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-(\w)/g,T=k((e=>e.replace(P,((e,t)=>t?t.toUpperCase():"")))),M=/\B([A-Z])/g,I=k((e=>e.replace(M,"-$1").toLowerCase())),E=k((e=>e.charAt(0).toUpperCase()+e.slice(1))),A=k((e=>e?`on${E(e)}`:"")),D=(e,t)=>!Object.is(e,t),R=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},B=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let j;const N=()=>j||(j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function _(e){if(h(e)){const t={};for(let n=0;n{if(e){const n=e.split(L);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function W(e){let t="";if(v(e))t=e;else if(h(e))for(let n=0;nv(e)?e:null==e?"":h(e)||y(e)&&(e.toString===w||!m(e.toString))?JSON.stringify(e,Z,2):String(e),Z=(e,t)=>t&&t.__v_isRef?Z(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[U(t,o)+" =>"]=n,e)),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>U(e)))}:b(t)?U(t):!y(t)||h(t)||x(t)?t:String(t),U=(e,t="")=>{var n;return b(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let K;class G{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=K,!e&&K&&(this.index=(K.scopes||(K.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=K;try{return K=this,e()}finally{K=t}}}on(){K=this}off(){K=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},ne=e=>(e.w&ae)>0,oe=e=>(e.n&ae)>0,re=new WeakMap;let ie,le=0,ae=1;const se=Symbol(""),ce=Symbol("");class ue{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,function(e,t=K){t&&t.active&&t.effects.push(e)}(this,n)}run(){if(!this.active)return this.fn();let e=ie,t=pe;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=ie,ie=this,pe=!0,ae=1<<++le,le<=30?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o{("length"===n||!b(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(l.get(n)),t){case"add":h(e)?$(n)&&a.push(l.get("length")):(a.push(l.get(se)),f(e)&&a.push(l.get(ce)));break;case"delete":h(e)||(a.push(l.get(se)),f(e)&&a.push(l.get(ce)));break;case"set":f(e)&&a.push(l.get(se))}if(1===a.length)a[0]&&ye(a[0]);else{const e=[];for(const t of a)t&&e.push(...t);ye(te(e))}}function ye(e,t){const n=h(e)?e:[...e];for(const o of n)o.computed&&Oe(o);for(const o of n)o.computed||Oe(o)}function Oe(e,t){(e!==ie||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const we=n("__proto__,__v_isRef,__isVue"),Se=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(b)),xe=$e();function $e(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=dt(this);for(let t=0,r=this.length;t{e[t]=function(...e){fe();const n=dt(this)[t].apply(this,e);return ge(),n}})),e}function Ce(e){const t=dt(this);return me(t,0,e),t.hasOwnProperty(e)}class ke{constructor(e=!1,t=!1){this._isReadonly=e,this._shallow=t}get(e,t,n){const o=this._isReadonly,r=this._shallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(o?r?nt:tt:r?et:Je).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=h(e);if(!o){if(i&&p(xe,t))return Reflect.get(xe,t,n);if("hasOwnProperty"===t)return Ce}const l=Reflect.get(e,t,n);return(b(t)?Se.has(t):we(t))?l:(o||me(e,0,t),r?l:vt(l)?i&&$(t)?l:l.value:y(l)?o?it(l):rt(l):l)}}class Pe extends ke{constructor(e=!1){super(!1,e)}set(e,t,n,o){let r=e[t];if(st(r)&&vt(r)&&!vt(n))return!1;if(!this._shallow&&(ct(n)||st(n)||(r=dt(r),n=dt(n)),!h(e)&&vt(r)&&!vt(n)))return r.value=n,!0;const i=h(e)&&$(t)?Number(t)e,De=e=>Reflect.getPrototypeOf(e);function Re(e,t,n=!1,o=!1){const r=dt(e=e.__v_raw),i=dt(t);n||(D(t,i)&&me(r,0,t),me(r,0,i));const{has:l}=De(r),a=o?Ae:n?ft:ht;return l.call(r,t)?a(e.get(t)):l.call(r,i)?a(e.get(i)):void(e!==r&&e.get(t))}function ze(e,t=!1){const n=this.__v_raw,o=dt(n),r=dt(e);return t||(D(e,r)&&me(o,0,e),me(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function Be(e,t=!1){return e=e.__v_raw,!t&&me(dt(e),0,se),Reflect.get(e,"size",e)}function je(e){e=dt(e);const t=dt(this);return De(t).has.call(t,e)||(t.add(e),be(t,"add",e,e)),this}function Ne(e,t){t=dt(t);const n=dt(this),{has:o,get:r}=De(n);let i=o.call(n,e);i||(e=dt(e),i=o.call(n,e));const l=r.call(n,e);return n.set(e,t),i?D(t,l)&&be(n,"set",e,t):be(n,"add",e,t),this}function _e(e){const t=dt(this),{has:n,get:o}=De(t);let r=n.call(t,e);r||(e=dt(e),r=n.call(t,e)),o&&o.call(t,e);const i=t.delete(e);return r&&be(t,"delete",e,void 0),i}function Qe(){const e=dt(this),t=0!==e.size,n=e.clear();return t&&be(e,"clear",void 0,void 0),n}function Le(e,t){return function(n,o){const r=this,i=r.__v_raw,l=dt(i),a=t?Ae:e?ft:ht;return!e&&me(l,0,se),i.forEach(((e,t)=>n.call(o,a(e),a(t),r)))}}function He(e,t,n){return function(...o){const r=this.__v_raw,i=dt(r),l=f(i),a="entries"===e||e===Symbol.iterator&&l,s="keys"===e&&l,c=r[e](...o),u=n?Ae:t?ft:ht;return!t&&me(i,0,s?ce:se),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function Fe(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function We(){const e={get(e){return Re(this,e)},get size(){return Be(this)},has:ze,add:je,set:Ne,delete:_e,clear:Qe,forEach:Le(!1,!1)},t={get(e){return Re(this,e,!1,!0)},get size(){return Be(this)},has:ze,add:je,set:Ne,delete:_e,clear:Qe,forEach:Le(!1,!0)},n={get(e){return Re(this,e,!0)},get size(){return Be(this,!0)},has(e){return ze.call(this,e,!0)},add:Fe("add"),set:Fe("set"),delete:Fe("delete"),clear:Fe("clear"),forEach:Le(!0,!1)},o={get(e){return Re(this,e,!0,!0)},get size(){return Be(this,!0)},has(e){return ze.call(this,e,!0)},add:Fe("add"),set:Fe("set"),delete:Fe("delete"),clear:Fe("clear"),forEach:Le(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=He(r,!1,!1),n[r]=He(r,!0,!1),t[r]=He(r,!1,!0),o[r]=He(r,!0,!0)})),[e,n,t,o]}const[Xe,Ye,Ve,Ze]=We();function Ue(e,t){const n=t?e?Ze:Ve:e?Ye:Xe;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(p(n,o)&&o in t?n:t,o,r)}const Ke={get:Ue(!1,!1)},Ge={get:Ue(!1,!0)},qe={get:Ue(!0,!1)},Je=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap;function ot(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>S(e).slice(8,-1))(e))}function rt(e){return st(e)?e:lt(e,!1,Me,Ke,Je)}function it(e){return lt(e,!0,Ie,qe,tt)}function lt(e,t,n,o,r){if(!y(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const l=ot(e);if(0===l)return e;const a=new Proxy(e,2===l?o:n);return r.set(e,a),a}function at(e){return st(e)?at(e.__v_raw):!(!e||!e.__v_isReactive)}function st(e){return!(!e||!e.__v_isReadonly)}function ct(e){return!(!e||!e.__v_isShallow)}function ut(e){return at(e)||st(e)}function dt(e){const t=e&&e.__v_raw;return t?dt(t):e}function pt(e){return z(e,"__v_skip",!0),e}const ht=e=>y(e)?rt(e):e,ft=e=>y(e)?it(e):e;function gt(e){pe&&ie&&ve((e=dt(e)).dep||(e.dep=te()))}function mt(e,t){const n=(e=dt(e)).dep;n&&ye(n)}function vt(e){return!(!e||!0!==e.__v_isRef)}function bt(e){return Ot(e,!1)}function yt(e){return Ot(e,!0)}function Ot(e,t){return vt(e)?e:new wt(e,t)}class wt{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:dt(e),this._value=t?e:ht(e)}get value(){return gt(this),this._value}set value(e){const t=this.__v_isShallow||ct(e)||st(e);e=t?e:dt(e),D(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:ht(e),mt(this))}}function St(e){mt(e)}function xt(e){return vt(e)?e.value:e}const $t={get:(e,t,n)=>xt(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return vt(r)&&!vt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Ct(e){return at(e)?e:new Proxy(e,$t)}function kt(e){const t=h(e)?new Array(e.length):{};for(const n in e)t[n]=It(e,n);return t}class Pt{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=dt(this._object),t=this._key,null==(n=re.get(e))?void 0:n.get(t);var e,t,n}}class Tt{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Mt(e,t,n){return vt(e)?e:m(e)?new Tt(e):y(e)&&arguments.length>1?It(e,t,n):bt(e)}function It(e,t,n){const o=e[t];return vt(o)?o:new Pt(e,t,n)}class Et{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new ue(e,(()=>{this._dirty||(this._dirty=!0,mt(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=dt(this);return gt(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function At(e,t,n,o){let r;try{r=o?e(...o):e()}catch(i){Rt(i,t,n)}return r}function Dt(e,t,n,o){if(m(e)){const r=At(e,t,n,o);return r&&O(r)&&r.catch((e=>{Rt(e,t,n)})),r}const r=[];for(let i=0;i>>1,r=jt[o],i=Ut(r);iUt(e)-Ut(t))),Lt=0;Ltnull==e.id?1/0:e.id,Kt=(e,t)=>{const n=Ut(e)-Ut(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Gt(e){Bt=!1,zt=!0,jt.sort(Kt);try{for(Nt=0;Ntv(e)?e.trim():e))),t&&(i=n.map(B))}let s,c=r[s=A(t)]||r[s=A(T(t))];!c&&l&&(c=r[s=A(I(t))]),c&&Dt(c,e,6,i);const u=r[s+"Once"];if(u){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Dt(u,e,6,i)}}function Jt(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const i=e.emits;let l={},a=!1;if(!m(e)){const o=e=>{const n=Jt(e,t,!0);n&&(a=!0,c(l,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return i||a?(h(i)?i.forEach((e=>l[e]=null)):c(l,i),y(e)&&o.set(e,l),l):(y(e)&&o.set(e,null),null)}function en(e,t){return!(!e||!a(t))&&(t=t.slice(2).replace(/Once$/,""),p(e,t[0].toLowerCase()+t.slice(1))||p(e,I(t))||p(e,t))}let tn=null,nn=null;function on(e){const t=tn;return tn=e,nn=e&&e.type.__scopeId||null,t}function rn(e){nn=e}function ln(){nn=null}function an(e,t=tn,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&ur(-1);const r=on(t);let i;try{i=e(...n)}finally{on(r),o._d&&ur(1)}return i};return o._n=!0,o._c=!0,o._d=!0,o}function sn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:i,propsOptions:[l],slots:a,attrs:c,emit:u,render:d,renderCache:p,data:h,setupState:f,ctx:g,inheritAttrs:m}=e;let v,b;const y=on(e);try{if(4&n.shapeFlag){const e=r||o,t=e;v=$r(d.call(t,e,p,i,f,h,g)),b=c}else{const e=t;v=$r(e.length>1?e(i,{attrs:c,slots:a,emit:u}):e(i,null)),b=t.props?c:cn(c)}}catch(w){lr.length=0,Rt(w,e,1),v=Or(rr)}let O=v;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=O;e.length&&7&t&&(l&&e.some(s)&&(b=un(b,l)),O=wr(O,b))}return n.dirs&&(O=wr(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),v=O,on(y),v}const cn=e=>{let t;for(const n in e)("class"===n||"style"===n||a(n))&&((t||(t={}))[n]=e[n]);return t},un=(e,t)=>{const n={};for(const o in e)s(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function dn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;re.value,g=ct(e)):at(e)?(p=()=>e,r=!0):h(e)?(v=!0,g=e.some((e=>at(e)||ct(e))),p=()=>e.map((e=>vt(e)?e.value:at(e)?xn(e):m(e)?At(e,d,2):void 0))):p=m(e)?t?()=>At(e,d,2):()=>{if(!d||!d.isUnmounted)return f&&f(),Dt(e,d,3,[y])}:i,t&&r){const e=p;p=()=>xn(e())}let b,y=e=>{f=x.onStop=()=>{At(e,d,4),f=x.onStop=void 0}};if(Nr){if(y=i,t?n&&Dt(t,d,3,[p(),v?[]:void 0,y]):p(),"sync"!==l)return i;{const e=Yr();b=e.__watcherHandles||(e.__watcherHandles=[])}}let O=v?new Array(e.length).fill(bn):bn;const w=()=>{if(x.active)if(t){const e=x.run();(r||g||(v?e.some(((e,t)=>D(e,O[t]))):D(e,O)))&&(f&&f(),Dt(t,d,3,[e,O===bn?void 0:v&&O[0]===bn?[]:O,y]),O=e)}else x.run()};let S;w.allowRecurse=!!t,"sync"===l?S=w:"post"===l?S=()=>Yo(w,d&&d.suspense):(w.pre=!0,d&&(w.id=d.uid),S=()=>Xt(w));const x=new ue(p,S);t?n?w():O=x.run():"post"===l?Yo(x.run.bind(x),d&&d.suspense):x.run();const $=()=>{x.stop(),d&&d.scope&&u(d.scope.effects,x)};return b&&b.push($),$}function wn(e,t,n){const o=this.proxy,r=v(e)?e.includes(".")?Sn(o,e):()=>o[e]:e.bind(o,o);let i;m(t)?i=t:(i=t.handler,n=t);const l=Ir;zr(this);const a=On(r,i.bind(o),n);return l?zr(l):Br(),a}function Sn(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{xn(e,t)}));else if(x(e))for(const n in e)xn(e[n],t);return e}function $n(e,t){const n=tn;if(null===n)return e;const r=Hr(n)||n.proxy,i=e.dirs||(e.dirs=[]);for(let l=0;l{e.isMounted=!0})),Gn((()=>{e.isUnmounting=!0})),e}const Mn=[Function,Array],In={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Mn,onEnter:Mn,onAfterEnter:Mn,onEnterCancelled:Mn,onBeforeLeave:Mn,onLeave:Mn,onAfterLeave:Mn,onLeaveCancelled:Mn,onBeforeAppear:Mn,onAppear:Mn,onAfterAppear:Mn,onAppearCancelled:Mn},En={name:"BaseTransition",props:In,setup(e,{slots:t}){const n=Er(),o=Tn();let r;return()=>{const i=t.default&&jn(t.default(),!0);if(!i||!i.length)return;let l=i[0];if(i.length>1)for(const e of i)if(e.type!==rr){l=e;break}const a=dt(e),{mode:s}=a;if(o.isLeaving)return Rn(l);const c=zn(l);if(!c)return Rn(l);const u=Dn(c,a,o,n);Bn(c,u);const d=n.subTree,p=d&&zn(d);let h=!1;const{getTransitionKey:f}=c.type;if(f){const e=f();void 0===r?r=e:e!==r&&(r=e,h=!0)}if(p&&p.type!==rr&&(!gr(c,p)||h)){const e=Dn(p,a,o,n);if(Bn(p,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&n.update()},Rn(l);"in-out"===s&&c.type!==rr&&(e.delayLeave=(e,t,n)=>{An(o,p)[String(p.key)]=p,e[kn]=()=>{t(),e[kn]=void 0,delete u.delayedLeave},u.delayedLeave=n})}return l}}};function An(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Dn(e,t,n,o){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:s,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:p,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:m,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=t,O=String(e.key),w=An(n,e),S=(e,t)=>{e&&Dt(e,o,9,t)},x=(e,t)=>{const n=t[1];S(e,t),h(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},$={mode:i,persisted:l,beforeEnter(t){let o=a;if(!n.isMounted){if(!r)return;o=m||a}t[kn]&&t[kn](!0);const i=w[O];i&&gr(e,i)&&i.el[kn]&&i.el[kn](),S(o,[t])},enter(e){let t=s,o=c,i=u;if(!n.isMounted){if(!r)return;t=v||s,o=b||c,i=y||u}let l=!1;const a=e[Pn]=t=>{l||(l=!0,S(t?i:o,[e]),$.delayedLeave&&$.delayedLeave(),e[Pn]=void 0)};t?x(t,[e,a]):a()},leave(t,o){const r=String(e.key);if(t[Pn]&&t[Pn](!0),n.isUnmounting)return o();S(d,[t]);let i=!1;const l=t[kn]=n=>{i||(i=!0,o(),S(n?g:f,[t]),t[kn]=void 0,w[r]===e&&delete w[r])};w[r]=e,p?x(p,[t,l]):l()},clone:e=>Dn(e,t,n,o)};return $}function Rn(e){if(Qn(e))return(e=wr(e)).children=null,e}function zn(e){return Qn(e)?e.children?e.children[0]:void 0:e}function Bn(e,t){6&e.shapeFlag&&e.component?Bn(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function jn(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;i!!n[e.toLowerCase()]:e=>!!n[e]}!function(){const e=document.createElement("link").relList;if(!(e&&e.supports&&e.supports("modulepreload"))){for(const e of document.querySelectorAll('link[rel="modulepreload"]'))t(e);new MutationObserver((e=>{for(const n of e)if("childList"===n.type)for(const e of n.addedNodes)"LINK"===e.tagName&&"modulepreload"===e.rel&&t(e)})).observe(document,{childList:!0,subtree:!0})}function t(e){if(e.ep)return;e.ep=!0;const t=function(e){const t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),"use-credentials"===e.crossOrigin?t.credentials="include":"anonymous"===e.crossOrigin?t.credentials="omit":t.credentials="same-origin",t}(e);fetch(e.href,t)}}();const o={},r=[],i=()=>{},l=()=>!1,a=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&(e.charCodeAt(2)>122||e.charCodeAt(2)<97),s=e=>e.startsWith("onUpdate:"),c=Object.assign,u=(e,t)=>{const n=e.indexOf(t);n>-1&&e.splice(n,1)},d=Object.prototype.hasOwnProperty,p=(e,t)=>d.call(e,t),h=Array.isArray,f=e=>"[object Map]"===S(e),g=e=>"[object Set]"===S(e),m=e=>"function"==typeof e,v=e=>"string"==typeof e,b=e=>"symbol"==typeof e,y=e=>null!==e&&"object"==typeof e,O=e=>(y(e)||m(e))&&m(e.then)&&m(e.catch),w=Object.prototype.toString,S=e=>w.call(e),x=e=>"[object Object]"===S(e),$=e=>v(e)&&"NaN"!==e&&"-"!==e[0]&&""+parseInt(e,10)===e,C=n(",key,ref,ref_for,ref_key,onVnodeBeforeMount,onVnodeMounted,onVnodeBeforeUpdate,onVnodeUpdated,onVnodeBeforeUnmount,onVnodeUnmounted"),k=e=>{const t=Object.create(null);return n=>t[n]||(t[n]=e(n))},P=/-(\w)/g,T=k((e=>e.replace(P,((e,t)=>t?t.toUpperCase():"")))),M=/\B([A-Z])/g,I=k((e=>e.replace(M,"-$1").toLowerCase())),E=k((e=>e.charAt(0).toUpperCase()+e.slice(1))),A=k((e=>e?`on${E(e)}`:"")),D=(e,t)=>!Object.is(e,t),R=(e,t)=>{for(let n=0;n{Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:n})},B=e=>{const t=parseFloat(e);return isNaN(t)?e:t};let j;const N=()=>j||(j="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{});function _(e){if(h(e)){const t={};for(let n=0;n{if(e){const n=e.split(L);n.length>1&&(t[n[0].trim()]=n[1].trim())}})),t}function W(e){let t="";if(v(e))t=e;else if(h(e))for(let n=0;nv(e)?e:null==e?"":h(e)||y(e)&&(e.toString===w||!m(e.toString))?JSON.stringify(e,Z,2):String(e),Z=(e,t)=>t&&t.__v_isRef?Z(e,t.value):f(t)?{[`Map(${t.size})`]:[...t.entries()].reduce(((e,[t,n],o)=>(e[U(t,o)+" =>"]=n,e)),{})}:g(t)?{[`Set(${t.size})`]:[...t.values()].map((e=>U(e)))}:b(t)?U(t):!y(t)||h(t)||x(t)?t:String(t),U=(e,t="")=>{var n;return b(e)?`Symbol(${null!=(n=e.description)?n:t})`:e};let K;class G{constructor(e=!1){this.detached=e,this._active=!0,this.effects=[],this.cleanups=[],this.parent=K,!e&&K&&(this.index=(K.scopes||(K.scopes=[])).push(this)-1)}get active(){return this._active}run(e){if(this._active){const t=K;try{return K=this,e()}finally{K=t}}}on(){K=this}off(){K=this.parent}stop(e){if(this._active){let t,n;for(t=0,n=this.effects.length;t{const t=new Set(e);return t.w=0,t.n=0,t},ne=e=>(e.w&ae)>0,oe=e=>(e.n&ae)>0,re=new WeakMap;let ie,le=0,ae=1;const se=Symbol(""),ce=Symbol("");class ue{constructor(e,t=null,n){this.fn=e,this.scheduler=t,this.active=!0,this.deps=[],this.parent=void 0,function(e,t=K){t&&t.active&&t.effects.push(e)}(this,n)}run(){if(!this.active)return this.fn();let e=ie,t=pe;for(;e;){if(e===this)return;e=e.parent}try{return this.parent=ie,ie=this,pe=!0,ae=1<<++le,le<=30?(({deps:e})=>{if(e.length)for(let t=0;t{const{deps:t}=e;if(t.length){let n=0;for(let o=0;o{("length"===n||!b(n)&&n>=e)&&a.push(t)}))}else switch(void 0!==n&&a.push(l.get(n)),t){case"add":h(e)?$(n)&&a.push(l.get("length")):(a.push(l.get(se)),f(e)&&a.push(l.get(ce)));break;case"delete":h(e)||(a.push(l.get(se)),f(e)&&a.push(l.get(ce)));break;case"set":f(e)&&a.push(l.get(se))}if(1===a.length)a[0]&&ye(a[0]);else{const e=[];for(const t of a)t&&e.push(...t);ye(te(e))}}function ye(e,t){const n=h(e)?e:[...e];for(const o of n)o.computed&&Oe(o);for(const o of n)o.computed||Oe(o)}function Oe(e,t){(e!==ie||e.allowRecurse)&&(e.scheduler?e.scheduler():e.run())}const we=n("__proto__,__v_isRef,__isVue"),Se=new Set(Object.getOwnPropertyNames(Symbol).filter((e=>"arguments"!==e&&"caller"!==e)).map((e=>Symbol[e])).filter(b)),xe=$e();function $e(){const e={};return["includes","indexOf","lastIndexOf"].forEach((t=>{e[t]=function(...e){const n=dt(this);for(let t=0,r=this.length;t{e[t]=function(...e){fe();const n=dt(this)[t].apply(this,e);return ge(),n}})),e}function Ce(e){const t=dt(this);return me(t,0,e),t.hasOwnProperty(e)}class ke{constructor(e=!1,t=!1){this._isReadonly=e,this._shallow=t}get(e,t,n){const o=this._isReadonly,r=this._shallow;if("__v_isReactive"===t)return!o;if("__v_isReadonly"===t)return o;if("__v_isShallow"===t)return r;if("__v_raw"===t)return n===(o?r?nt:tt:r?et:Je).get(e)||Object.getPrototypeOf(e)===Object.getPrototypeOf(n)?e:void 0;const i=h(e);if(!o){if(i&&p(xe,t))return Reflect.get(xe,t,n);if("hasOwnProperty"===t)return Ce}const l=Reflect.get(e,t,n);return(b(t)?Se.has(t):we(t))?l:(o||me(e,0,t),r?l:vt(l)?i&&$(t)?l:l.value:y(l)?o?it(l):rt(l):l)}}class Pe extends ke{constructor(e=!1){super(!1,e)}set(e,t,n,o){let r=e[t];if(st(r)&&vt(r)&&!vt(n))return!1;if(!this._shallow&&(ct(n)||st(n)||(r=dt(r),n=dt(n)),!h(e)&&vt(r)&&!vt(n)))return r.value=n,!0;const i=h(e)&&$(t)?Number(t)e,De=e=>Reflect.getPrototypeOf(e);function Re(e,t,n=!1,o=!1){const r=dt(e=e.__v_raw),i=dt(t);n||(D(t,i)&&me(r,0,t),me(r,0,i));const{has:l}=De(r),a=o?Ae:n?ft:ht;return l.call(r,t)?a(e.get(t)):l.call(r,i)?a(e.get(i)):void(e!==r&&e.get(t))}function ze(e,t=!1){const n=this.__v_raw,o=dt(n),r=dt(e);return t||(D(e,r)&&me(o,0,e),me(o,0,r)),e===r?n.has(e):n.has(e)||n.has(r)}function Be(e,t=!1){return e=e.__v_raw,!t&&me(dt(e),0,se),Reflect.get(e,"size",e)}function je(e){e=dt(e);const t=dt(this);return De(t).has.call(t,e)||(t.add(e),be(t,"add",e,e)),this}function Ne(e,t){t=dt(t);const n=dt(this),{has:o,get:r}=De(n);let i=o.call(n,e);i||(e=dt(e),i=o.call(n,e));const l=r.call(n,e);return n.set(e,t),i?D(t,l)&&be(n,"set",e,t):be(n,"add",e,t),this}function _e(e){const t=dt(this),{has:n,get:o}=De(t);let r=n.call(t,e);r||(e=dt(e),r=n.call(t,e)),o&&o.call(t,e);const i=t.delete(e);return r&&be(t,"delete",e,void 0),i}function Qe(){const e=dt(this),t=0!==e.size,n=e.clear();return t&&be(e,"clear",void 0,void 0),n}function Le(e,t){return function(n,o){const r=this,i=r.__v_raw,l=dt(i),a=t?Ae:e?ft:ht;return!e&&me(l,0,se),i.forEach(((e,t)=>n.call(o,a(e),a(t),r)))}}function He(e,t,n){return function(...o){const r=this.__v_raw,i=dt(r),l=f(i),a="entries"===e||e===Symbol.iterator&&l,s="keys"===e&&l,c=r[e](...o),u=n?Ae:t?ft:ht;return!t&&me(i,0,s?ce:se),{next(){const{value:e,done:t}=c.next();return t?{value:e,done:t}:{value:a?[u(e[0]),u(e[1])]:u(e),done:t}},[Symbol.iterator](){return this}}}}function Fe(e){return function(...t){return"delete"!==e&&("clear"===e?void 0:this)}}function We(){const e={get(e){return Re(this,e)},get size(){return Be(this)},has:ze,add:je,set:Ne,delete:_e,clear:Qe,forEach:Le(!1,!1)},t={get(e){return Re(this,e,!1,!0)},get size(){return Be(this)},has:ze,add:je,set:Ne,delete:_e,clear:Qe,forEach:Le(!1,!0)},n={get(e){return Re(this,e,!0)},get size(){return Be(this,!0)},has(e){return ze.call(this,e,!0)},add:Fe("add"),set:Fe("set"),delete:Fe("delete"),clear:Fe("clear"),forEach:Le(!0,!1)},o={get(e){return Re(this,e,!0,!0)},get size(){return Be(this,!0)},has(e){return ze.call(this,e,!0)},add:Fe("add"),set:Fe("set"),delete:Fe("delete"),clear:Fe("clear"),forEach:Le(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach((r=>{e[r]=He(r,!1,!1),n[r]=He(r,!0,!1),t[r]=He(r,!1,!0),o[r]=He(r,!0,!0)})),[e,n,t,o]}const[Xe,Ye,Ve,Ze]=We();function Ue(e,t){const n=t?e?Ze:Ve:e?Ye:Xe;return(t,o,r)=>"__v_isReactive"===o?!e:"__v_isReadonly"===o?e:"__v_raw"===o?t:Reflect.get(p(n,o)&&o in t?n:t,o,r)}const Ke={get:Ue(!1,!1)},Ge={get:Ue(!1,!0)},qe={get:Ue(!0,!1)},Je=new WeakMap,et=new WeakMap,tt=new WeakMap,nt=new WeakMap;function ot(e){return e.__v_skip||!Object.isExtensible(e)?0:function(e){switch(e){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}((e=>S(e).slice(8,-1))(e))}function rt(e){return st(e)?e:lt(e,!1,Me,Ke,Je)}function it(e){return lt(e,!0,Ie,qe,tt)}function lt(e,t,n,o,r){if(!y(e))return e;if(e.__v_raw&&(!t||!e.__v_isReactive))return e;const i=r.get(e);if(i)return i;const l=ot(e);if(0===l)return e;const a=new Proxy(e,2===l?o:n);return r.set(e,a),a}function at(e){return st(e)?at(e.__v_raw):!(!e||!e.__v_isReactive)}function st(e){return!(!e||!e.__v_isReadonly)}function ct(e){return!(!e||!e.__v_isShallow)}function ut(e){return at(e)||st(e)}function dt(e){const t=e&&e.__v_raw;return t?dt(t):e}function pt(e){return z(e,"__v_skip",!0),e}const ht=e=>y(e)?rt(e):e,ft=e=>y(e)?it(e):e;function gt(e){pe&&ie&&ve((e=dt(e)).dep||(e.dep=te()))}function mt(e,t){const n=(e=dt(e)).dep;n&&ye(n)}function vt(e){return!(!e||!0!==e.__v_isRef)}function bt(e){return Ot(e,!1)}function yt(e){return Ot(e,!0)}function Ot(e,t){return vt(e)?e:new wt(e,t)}class wt{constructor(e,t){this.__v_isShallow=t,this.dep=void 0,this.__v_isRef=!0,this._rawValue=t?e:dt(e),this._value=t?e:ht(e)}get value(){return gt(this),this._value}set value(e){const t=this.__v_isShallow||ct(e)||st(e);e=t?e:dt(e),D(e,this._rawValue)&&(this._rawValue=e,this._value=t?e:ht(e),mt(this))}}function St(e){mt(e)}function xt(e){return vt(e)?e.value:e}const $t={get:(e,t,n)=>xt(Reflect.get(e,t,n)),set:(e,t,n,o)=>{const r=e[t];return vt(r)&&!vt(n)?(r.value=n,!0):Reflect.set(e,t,n,o)}};function Ct(e){return at(e)?e:new Proxy(e,$t)}function kt(e){const t=h(e)?new Array(e.length):{};for(const n in e)t[n]=It(e,n);return t}class Pt{constructor(e,t,n){this._object=e,this._key=t,this._defaultValue=n,this.__v_isRef=!0}get value(){const e=this._object[this._key];return void 0===e?this._defaultValue:e}set value(e){this._object[this._key]=e}get dep(){return e=dt(this._object),t=this._key,null==(n=re.get(e))?void 0:n.get(t);var e,t,n}}class Tt{constructor(e){this._getter=e,this.__v_isRef=!0,this.__v_isReadonly=!0}get value(){return this._getter()}}function Mt(e,t,n){return vt(e)?e:m(e)?new Tt(e):y(e)&&arguments.length>1?It(e,t,n):bt(e)}function It(e,t,n){const o=e[t];return vt(o)?o:new Pt(e,t,n)}class Et{constructor(e,t,n,o){this._setter=t,this.dep=void 0,this.__v_isRef=!0,this.__v_isReadonly=!1,this._dirty=!0,this.effect=new ue(e,(()=>{this._dirty||(this._dirty=!0,mt(this))})),this.effect.computed=this,this.effect.active=this._cacheable=!o,this.__v_isReadonly=n}get value(){const e=dt(this);return gt(e),!e._dirty&&e._cacheable||(e._dirty=!1,e._value=e.effect.run()),e._value}set value(e){this._setter(e)}}function At(e,t,n,o){let r;try{r=o?e(...o):e()}catch(i){Rt(i,t,n)}return r}function Dt(e,t,n,o){if(m(e)){const r=At(e,t,n,o);return r&&O(r)&&r.catch((e=>{Rt(e,t,n)})),r}const r=[];for(let i=0;i>>1,r=jt[o],i=Ut(r);iUt(e)-Ut(t))),Lt=0;Ltnull==e.id?1/0:e.id,Kt=(e,t)=>{const n=Ut(e)-Ut(t);if(0===n){if(e.pre&&!t.pre)return-1;if(t.pre&&!e.pre)return 1}return n};function Gt(e){Bt=!1,zt=!0,jt.sort(Kt);try{for(Nt=0;Ntv(e)?e.trim():e))),t&&(i=n.map(B))}let s,c=r[s=A(t)]||r[s=A(T(t))];!c&&l&&(c=r[s=A(I(t))]),c&&Dt(c,e,6,i);const u=r[s+"Once"];if(u){if(e.emitted){if(e.emitted[s])return}else e.emitted={};e.emitted[s]=!0,Dt(u,e,6,i)}}function Jt(e,t,n=!1){const o=t.emitsCache,r=o.get(e);if(void 0!==r)return r;const i=e.emits;let l={},a=!1;if(!m(e)){const o=e=>{const n=Jt(e,t,!0);n&&(a=!0,c(l,n))};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}return i||a?(h(i)?i.forEach((e=>l[e]=null)):c(l,i),y(e)&&o.set(e,l),l):(y(e)&&o.set(e,null),null)}function en(e,t){return!(!e||!a(t))&&(t=t.slice(2).replace(/Once$/,""),p(e,t[0].toLowerCase()+t.slice(1))||p(e,I(t))||p(e,t))}let tn=null,nn=null;function on(e){const t=tn;return tn=e,nn=e&&e.type.__scopeId||null,t}function rn(e){nn=e}function ln(){nn=null}function an(e,t=tn,n){if(!t)return e;if(e._n)return e;const o=(...n)=>{o._d&&ur(-1);const r=on(t);let i;try{i=e(...n)}finally{on(r),o._d&&ur(1)}return i};return o._n=!0,o._c=!0,o._d=!0,o}function sn(e){const{type:t,vnode:n,proxy:o,withProxy:r,props:i,propsOptions:[l],slots:a,attrs:c,emit:u,render:d,renderCache:p,data:h,setupState:f,ctx:g,inheritAttrs:m}=e;let v,b;const y=on(e);try{if(4&n.shapeFlag){const e=r||o,t=e;v=$r(d.call(t,e,p,i,f,h,g)),b=c}else{const e=t;v=$r(e.length>1?e(i,{attrs:c,slots:a,emit:u}):e(i,null)),b=t.props?c:cn(c)}}catch(w){lr.length=0,Rt(w,e,1),v=Or(rr)}let O=v;if(b&&!1!==m){const e=Object.keys(b),{shapeFlag:t}=O;e.length&&7&t&&(l&&e.some(s)&&(b=un(b,l)),O=wr(O,b))}return n.dirs&&(O=wr(O),O.dirs=O.dirs?O.dirs.concat(n.dirs):n.dirs),n.transition&&(O.transition=n.transition),v=O,on(y),v}const cn=e=>{let t;for(const n in e)("class"===n||"style"===n||a(n))&&((t||(t={}))[n]=e[n]);return t},un=(e,t)=>{const n={};for(const o in e)s(o)&&o.slice(9)in t||(n[o]=e[o]);return n};function dn(e,t,n){const o=Object.keys(t);if(o.length!==Object.keys(e).length)return!0;for(let r=0;re.value,g=ct(e)):at(e)?(p=()=>e,r=!0):h(e)?(v=!0,g=e.some((e=>at(e)||ct(e))),p=()=>e.map((e=>vt(e)?e.value:at(e)?xn(e):m(e)?At(e,d,2):void 0))):p=m(e)?t?()=>At(e,d,2):()=>{if(!d||!d.isUnmounted)return f&&f(),Dt(e,d,3,[y])}:i,t&&r){const e=p;p=()=>xn(e())}let b,y=e=>{f=x.onStop=()=>{At(e,d,4),f=x.onStop=void 0}};if(Nr){if(y=i,t?n&&Dt(t,d,3,[p(),v?[]:void 0,y]):p(),"sync"!==l)return i;{const e=Yr();b=e.__watcherHandles||(e.__watcherHandles=[])}}let O=v?new Array(e.length).fill(bn):bn;const w=()=>{if(x.active)if(t){const e=x.run();(r||g||(v?e.some(((e,t)=>D(e,O[t]))):D(e,O)))&&(f&&f(),Dt(t,d,3,[e,O===bn?void 0:v&&O[0]===bn?[]:O,y]),O=e)}else x.run()};let S;w.allowRecurse=!!t,"sync"===l?S=w:"post"===l?S=()=>Yo(w,d&&d.suspense):(w.pre=!0,d&&(w.id=d.uid),S=()=>Xt(w));const x=new ue(p,S);t?n?w():O=x.run():"post"===l?Yo(x.run.bind(x),d&&d.suspense):x.run();const $=()=>{x.stop(),d&&d.scope&&u(d.scope.effects,x)};return b&&b.push($),$}function wn(e,t,n){const o=this.proxy,r=v(e)?e.includes(".")?Sn(o,e):()=>o[e]:e.bind(o,o);let i;m(t)?i=t:(i=t.handler,n=t);const l=Ir;zr(this);const a=On(r,i.bind(o),n);return l?zr(l):Br(),a}function Sn(e,t){const n=t.split(".");return()=>{let t=e;for(let e=0;e{xn(e,t)}));else if(x(e))for(const n in e)xn(e[n],t);return e}function $n(e,t){const n=tn;if(null===n)return e;const r=Hr(n)||n.proxy,i=e.dirs||(e.dirs=[]);for(let l=0;l{e.isMounted=!0})),Gn((()=>{e.isUnmounting=!0})),e}const Mn=[Function,Array],In={mode:String,appear:Boolean,persisted:Boolean,onBeforeEnter:Mn,onEnter:Mn,onAfterEnter:Mn,onEnterCancelled:Mn,onBeforeLeave:Mn,onLeave:Mn,onAfterLeave:Mn,onLeaveCancelled:Mn,onBeforeAppear:Mn,onAppear:Mn,onAfterAppear:Mn,onAppearCancelled:Mn},En={name:"BaseTransition",props:In,setup(e,{slots:t}){const n=Er(),o=Tn();let r;return()=>{const i=t.default&&jn(t.default(),!0);if(!i||!i.length)return;let l=i[0];if(i.length>1)for(const e of i)if(e.type!==rr){l=e;break}const a=dt(e),{mode:s}=a;if(o.isLeaving)return Rn(l);const c=zn(l);if(!c)return Rn(l);const u=Dn(c,a,o,n);Bn(c,u);const d=n.subTree,p=d&&zn(d);let h=!1;const{getTransitionKey:f}=c.type;if(f){const e=f();void 0===r?r=e:e!==r&&(r=e,h=!0)}if(p&&p.type!==rr&&(!gr(c,p)||h)){const e=Dn(p,a,o,n);if(Bn(p,e),"out-in"===s)return o.isLeaving=!0,e.afterLeave=()=>{o.isLeaving=!1,!1!==n.update.active&&n.update()},Rn(l);"in-out"===s&&c.type!==rr&&(e.delayLeave=(e,t,n)=>{An(o,p)[String(p.key)]=p,e[kn]=()=>{t(),e[kn]=void 0,delete u.delayedLeave},u.delayedLeave=n})}return l}}};function An(e,t){const{leavingVNodes:n}=e;let o=n.get(t.type);return o||(o=Object.create(null),n.set(t.type,o)),o}function Dn(e,t,n,o){const{appear:r,mode:i,persisted:l=!1,onBeforeEnter:a,onEnter:s,onAfterEnter:c,onEnterCancelled:u,onBeforeLeave:d,onLeave:p,onAfterLeave:f,onLeaveCancelled:g,onBeforeAppear:m,onAppear:v,onAfterAppear:b,onAppearCancelled:y}=t,O=String(e.key),w=An(n,e),S=(e,t)=>{e&&Dt(e,o,9,t)},x=(e,t)=>{const n=t[1];S(e,t),h(e)?e.every((e=>e.length<=1))&&n():e.length<=1&&n()},$={mode:i,persisted:l,beforeEnter(t){let o=a;if(!n.isMounted){if(!r)return;o=m||a}t[kn]&&t[kn](!0);const i=w[O];i&&gr(e,i)&&i.el[kn]&&i.el[kn](),S(o,[t])},enter(e){let t=s,o=c,i=u;if(!n.isMounted){if(!r)return;t=v||s,o=b||c,i=y||u}let l=!1;const a=e[Pn]=t=>{l||(l=!0,S(t?i:o,[e]),$.delayedLeave&&$.delayedLeave(),e[Pn]=void 0)};t?x(t,[e,a]):a()},leave(t,o){const r=String(e.key);if(t[Pn]&&t[Pn](!0),n.isUnmounting)return o();S(d,[t]);let i=!1;const l=t[kn]=n=>{i||(i=!0,o(),S(n?g:f,[t]),t[kn]=void 0,w[r]===e&&delete w[r])};w[r]=e,p?x(p,[t,l]):l()},clone:e=>Dn(e,t,n,o)};return $}function Rn(e){if(Qn(e))return(e=wr(e)).children=null,e}function zn(e){return Qn(e)?e.children?e.children[0]:void 0:e}function Bn(e,t){6&e.shapeFlag&&e.component?Bn(e.component.subTree,t):128&e.shapeFlag?(e.ssContent.transition=t.clone(e.ssContent),e.ssFallback.transition=t.clone(e.ssFallback)):e.transition=t}function jn(e,t=!1,n){let o=[],r=0;for(let i=0;i1)for(let i=0;ic({name:e.name},t,{setup:e}))():e}const _n=e=>!!e.type.__asyncLoader,Qn=e=>e.type.__isKeepAlive;function Ln(e,t){Fn(e,"a",t)}function Hn(e,t){Fn(e,"da",t)}function Fn(e,t,n=Ir){const o=e.__wdc||(e.__wdc=()=>{let t=n;for(;t;){if(t.isDeactivated)return;t=t.parent}return e()});if(Xn(t,o,n),n){let e=n.parent;for(;e&&e.parent;)Qn(e.parent.vnode)&&Wn(o,t,n,e),e=e.parent}}function Wn(e,t,n,o){const r=Xn(t,e,o,!0);qn((()=>{u(o[t],r)}),n)}function Xn(e,t,n=Ir,o=!1){if(n){const r=n[e]||(n[e]=[]),i=t.__weh||(t.__weh=(...o)=>{if(n.isUnmounted)return;fe(),zr(n);const r=Dt(t,n,e,o);return Br(),ge(),r});return o?r.unshift(i):r.push(i),i}}const Yn=e=>(t,n=Ir)=>(!Nr||"sp"===e)&&Xn(e,((...e)=>t(...e)),n),Vn=Yn("bm"),Zn=Yn("m"),Un=Yn("bu"),Kn=Yn("u"),Gn=Yn("bum"),qn=Yn("um"),Jn=Yn("sp"),eo=Yn("rtg"),to=Yn("rtc");function no(e,t=Ir){Xn("ec",e,t)}function oo(e,t,n,o){let r;const i=n&&n[o];if(h(e)||v(e)){r=new Array(e.length);for(let n=0,o=e.length;nt(e,n,void 0,i&&i[n])));else{const n=Object.keys(e);r=new Array(n.length);for(let o=0,l=n.length;o{const t=o.fn(...e);return t&&(t.key=o.key),t}:o.fn)}return e}function io(e,t,n={},o,r){if(tn.isCE||tn.parent&&_n(tn.parent)&&tn.parent.isCE)return"default"!==t&&(n.name=t),Or("slot",n,o&&o());let i=e[t];i&&i._c&&(i._d=!1),sr();const l=i&&lo(i(n)),a=hr(nr,{key:n.key||l&&l.key||`_${t}`},l||(o?o():[]),l&&1===e._?64:-2);return!r&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function lo(e){return e.some((e=>!fr(e)||e.type!==rr&&!(e.type===nr&&!lo(e.children))))?e:null}const ao=e=>e?jr(e)?Hr(e)||e.proxy:ao(e.parent):null,so=c(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>ao(e.parent),$root:e=>ao(e.root),$emit:e=>e.emit,$options:e=>bo(e),$forceUpdate:e=>e.f||(e.f=()=>Xt(e.update)),$nextTick:e=>e.n||(e.n=Wt.bind(e.proxy)),$watch:e=>wn.bind(e)}),co=(e,t)=>e!==o&&!e.__isScriptSetup&&p(e,t),uo={get({_:e},t){const{ctx:n,setupState:r,data:i,props:l,accessCache:a,type:s,appContext:c}=e;let u;if("$"!==t[0]){const s=a[t];if(void 0!==s)switch(s){case 1:return r[t];case 2:return i[t];case 4:return n[t];case 3:return l[t]}else{if(co(r,t))return a[t]=1,r[t];if(i!==o&&p(i,t))return a[t]=2,i[t];if((u=e.propsOptions[0])&&p(u,t))return a[t]=3,l[t];if(n!==o&&p(n,t))return a[t]=4,n[t];fo&&(a[t]=0)}}const d=so[t];let h,f;return d?("$attrs"===t&&me(e,0,t),d(e)):(h=s.__cssModules)&&(h=h[t])?h:n!==o&&p(n,t)?(a[t]=4,n[t]):(f=c.config.globalProperties,p(f,t)?f[t]:void 0)},set({_:e},t,n){const{data:r,setupState:i,ctx:l}=e;return co(i,t)?(i[t]=n,!0):r!==o&&p(r,t)?(r[t]=n,!0):!(p(e.props,t)||"$"===t[0]&&t.slice(1)in e||(l[t]=n,0))},has({_:{data:e,setupState:t,accessCache:n,ctx:r,appContext:i,propsOptions:l}},a){let s;return!!n[a]||e!==o&&p(e,a)||co(t,a)||(s=l[0])&&p(s,a)||p(r,a)||p(so,a)||p(i.config.globalProperties,a)},defineProperty(e,t,n){return null!=n.get?e._.accessCache[t]=0:p(n,"value")&&this.set(e,t,n.value,null),Reflect.defineProperty(e,t,n)}};function po(){const e=Er();return e.setupContext||(e.setupContext=Lr(e))}function ho(e){return h(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}let fo=!0;function go(e){const t=bo(e),n=e.proxy,o=e.ctx;fo=!1,t.beforeCreate&&mo(t.beforeCreate,e,"bc");const{data:r,computed:l,methods:a,watch:s,provide:c,inject:u,created:d,beforeMount:p,mounted:f,beforeUpdate:g,updated:v,activated:b,deactivated:O,beforeDestroy:w,beforeUnmount:S,destroyed:x,unmounted:$,render:C,renderTracked:k,renderTriggered:P,errorCaptured:T,serverPrefetch:M,expose:I,inheritAttrs:E,components:A,directives:D,filters:R}=t;if(u&&function(e,t,n=i){h(e)&&(e=So(e));for(const o in e){const n=e[o];let r;r=y(n)?"default"in n?Eo(n.from||o,n.default,!0):Eo(n.from||o):Eo(n),vt(r)?Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get:()=>r.value,set:e=>r.value=e}):t[o]=r}}(u,o,null),a)for(const i in a){const e=a[i];m(e)&&(o[i]=e.bind(n))}if(r){const t=r.call(n,n);y(t)&&(e.data=rt(t))}if(fo=!0,l)for(const h in l){const e=l[h],t=m(e)?e.bind(n,n):m(e.get)?e.get.bind(n,n):i,r=!m(e)&&m(e.set)?e.set.bind(n):i,a=Fr({get:t,set:r});Object.defineProperty(o,h,{enumerable:!0,configurable:!0,get:()=>a.value,set:e=>a.value=e})}if(s)for(const i in s)vo(s[i],o,n,i);if(c){const e=m(c)?c.call(n):c;Reflect.ownKeys(e).forEach((t=>{Io(t,e[t])}))}function z(e,t){h(t)?t.forEach((t=>e(t.bind(n)))):t&&e(t.bind(n))}if(d&&mo(d,e,"c"),z(Vn,p),z(Zn,f),z(Un,g),z(Kn,v),z(Ln,b),z(Hn,O),z(no,T),z(to,k),z(eo,P),z(Gn,S),z(qn,$),z(Jn,M),h(I))if(I.length){const t=e.exposed||(e.exposed={});I.forEach((e=>{Object.defineProperty(t,e,{get:()=>n[e],set:t=>n[e]=t})}))}else e.exposed||(e.exposed={});C&&e.render===i&&(e.render=C),null!=E&&(e.inheritAttrs=E),A&&(e.components=A),D&&(e.directives=D)}function mo(e,t,n){Dt(h(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,n)}function vo(e,t,n,o){const r=o.includes(".")?Sn(n,o):()=>n[o];if(v(e)){const n=t[e];m(n)&&yn(r,n)}else if(m(e))yn(r,e.bind(n));else if(y(e))if(h(e))e.forEach((e=>vo(e,t,n,o)));else{const o=m(e.handler)?e.handler.bind(n):t[e.handler];m(o)&&yn(r,o,e)}}function bo(e){const t=e.type,{mixins:n,extends:o}=t,{mixins:r,optionsCache:i,config:{optionMergeStrategies:l}}=e.appContext,a=i.get(t);let s;return a?s=a:r.length||n||o?(s={},r.length&&r.forEach((e=>yo(s,e,l,!0))),yo(s,t,l)):s=t,y(t)&&i.set(t,s),s}function yo(e,t,n,o=!1){const{mixins:r,extends:i}=t;i&&yo(e,i,n,!0),r&&r.forEach((t=>yo(e,t,n,!0)));for(const l in t)if(o&&"expose"===l);else{const o=Oo[l]||n&&n[l];e[l]=o?o(e[l],t[l]):t[l]}return e}const Oo={data:wo,props:Co,emits:Co,methods:$o,computed:$o,beforeCreate:xo,created:xo,beforeMount:xo,mounted:xo,beforeUpdate:xo,updated:xo,beforeDestroy:xo,beforeUnmount:xo,destroyed:xo,unmounted:xo,activated:xo,deactivated:xo,errorCaptured:xo,serverPrefetch:xo,components:$o,directives:$o,watch:function(e,t){if(!e)return t;if(!t)return e;const n=c(Object.create(null),e);for(const o in t)n[o]=xo(e[o],t[o]);return n},provide:wo,inject:function(e,t){return $o(So(e),So(t))}};function wo(e,t){return t?e?function(){return c(m(e)?e.call(this,this):e,m(t)?t.call(this,this):t)}:t:e}function So(e){if(h(e)){const t={};for(let n=0;n(i.has(e)||(e&&m(e.install)?(i.add(e),e.install(a,...t)):m(e)&&(i.add(e),e(a,...t))),a),mixin:e=>(r.mixins.includes(e)||r.mixins.push(e),a),component:(e,t)=>t?(r.components[e]=t,a):r.components[e],directive:(e,t)=>t?(r.directives[e]=t,a):r.directives[e],mount(i,s,c){if(!l){const u=Or(n,o);return u.appContext=r,s&&t?t(u,i):e(u,i,c),l=!0,a._container=i,i.__vue_app__=a,Hr(u.component)||u.component.proxy}},unmount(){l&&(e(null,a._container),delete a._container.__vue_app__)},provide:(e,t)=>(r.provides[e]=t,a),runWithContext(e){Mo=a;try{return e()}finally{Mo=null}}};return a}}let Mo=null;function Io(e,t){if(Ir){let n=Ir.provides;const o=Ir.parent&&Ir.parent.provides;o===n&&(n=Ir.provides=Object.create(o)),n[e]=t}}function Eo(e,t,n=!1){const o=Ir||tn;if(o||Mo){const r=o?null==o.parent?o.vnode.appContext&&o.vnode.appContext.provides:o.parent.provides:Mo._context.provides;if(r&&e in r)return r[e];if(arguments.length>1)return n&&m(t)?t.call(o&&o.proxy):t}}function Ao(e,t,n,o=!1){const r={},i={};z(i,mr,1),e.propsDefaults=Object.create(null),Do(e,t,r,i);for(const l in e.propsOptions[0])l in r||(r[l]=void 0);n?e.props=o?r:lt(r,!1,Ee,Ge,et):e.type.props?e.props=r:e.props=i,e.attrs=i}function Do(e,t,n,r){const[i,l]=e.propsOptions;let a,s=!1;if(t)for(let o in t){if(C(o))continue;const c=t[o];let u;i&&p(i,u=T(o))?l&&l.includes(u)?(a||(a={}))[u]=c:n[u]=c:en(e.emitsOptions,o)||o in r&&c===r[o]||(r[o]=c,s=!0)}if(l){const t=dt(n),r=a||o;for(let o=0;o{d=!0;const[n,o]=zo(e,t,!0);c(s,n),o&&u.push(...o)};!n&&t.mixins.length&&t.mixins.forEach(o),e.extends&&o(e.extends),e.mixins&&e.mixins.forEach(o)}if(!a&&!d)return y(e)&&i.set(e,r),r;if(h(a))for(let r=0;r-1,n[1]=o<0||t-1||p(n,"default"))&&u.push(e)}}}const f=[s,u];return y(e)&&i.set(e,f),f}function Bo(e){return"$"!==e[0]}function jo(e){const t=e&&e.toString().match(/^\s*(function|class) (\w+)/);return t?t[2]:null===e?"null":""}function No(e,t){return jo(e)===jo(t)}function _o(e,t){return h(t)?t.findIndex((t=>No(t,e))):m(t)&&No(t,e)?0:-1}const Qo=e=>"_"===e[0]||"$stable"===e,Lo=e=>h(e)?e.map($r):[$r(e)],Ho=(e,t,n)=>{if(t._n)return t;const o=an(((...e)=>Lo(t(...e))),n);return o._c=!1,o},Fo=(e,t,n)=>{const o=e._ctx;for(const r in e){if(Qo(r))continue;const n=e[r];if(m(n))t[r]=Ho(0,n,o);else if(null!=n){const e=Lo(n);t[r]=()=>e}}},Wo=(e,t)=>{const n=Lo(t);e.slots.default=()=>n};function Xo(e,t,n,r,i=!1){if(h(e))return void e.forEach(((e,o)=>Xo(e,t&&(h(t)?t[o]:t),n,r,i)));if(_n(r)&&!i)return;const l=4&r.shapeFlag?Hr(r.component)||r.component.proxy:r.el,a=i?null:l,{i:s,r:c}=e,d=t&&t.r,f=s.refs===o?s.refs={}:s.refs,g=s.setupState;if(null!=d&&d!==c&&(v(d)?(f[d]=null,p(g,d)&&(g[d]=null)):vt(d)&&(d.value=null)),m(c))At(c,s,12,[a,f]);else{const t=v(c),o=vt(c);if(t||o){const r=()=>{if(e.f){const n=t?p(g,c)?g[c]:f[c]:c.value;i?h(n)&&u(n,l):h(n)?n.includes(l)||n.push(l):t?(f[c]=[l],p(g,c)&&(g[c]=f[c])):(c.value=[l],e.k&&(f[e.k]=c.value))}else t?(f[c]=a,p(g,c)&&(g[c]=a)):o&&(c.value=a,e.k&&(f[e.k]=a))};a?(r.id=-1,Yo(r,n)):r()}}}const Yo=function(e,t){var n;t&&t.pendingBranch?h(e)?t.effects.push(...e):t.effects.push(e):(h(n=e)?_t.push(...n):Qt&&Qt.includes(n,n.allowRecurse?Lt+1:Lt)||_t.push(n),Yt())};function Vo(e){return function(e,t){N().__VUE__=!0;const{insert:n,remove:l,patchProp:a,createElement:s,createText:u,createComment:d,setText:h,setElementText:f,parentNode:g,nextSibling:m,setScopeId:v=i,insertStaticContent:b}=e,y=(e,t,n,o=null,r=null,i=null,l=!1,a=null,s=!!t.dynamicChildren)=>{if(e===t)return;e&&!gr(e,t)&&(o=te(e),U(e,r,i,!0),e=null),-2===t.patchFlag&&(s=!1,t.dynamicChildren=null);const{type:c,ref:u,shapeFlag:d}=t;switch(c){case or:w(e,t,n,o);break;case rr:S(e,t,n,o);break;case ir:null==e&&x(t,n,o,l);break;case nr:_(e,t,n,o,r,i,l,a,s);break;default:1&d?P(e,t,n,o,r,i,l,a,s):6&d?Q(e,t,n,o,r,i,l,a,s):(64&d||128&d)&&c.process(e,t,n,o,r,i,l,a,s,oe)}null!=u&&r&&Xo(u,e&&e.ref,i,t||e,!t)},w=(e,t,o,r)=>{if(null==e)n(t.el=u(t.children),o,r);else{const n=t.el=e.el;t.children!==e.children&&h(n,t.children)}},S=(e,t,o,r)=>{null==e?n(t.el=d(t.children||""),o,r):t.el=e.el},x=(e,t,n,o)=>{[e.el,e.anchor]=b(e.children,t,n,o,e.el,e.anchor)},$=({el:e,anchor:t},o,r)=>{let i;for(;e&&e!==t;)i=m(e),n(e,o,r),e=i;n(t,o,r)},k=({el:e,anchor:t})=>{let n;for(;e&&e!==t;)n=m(e),l(e),e=n;l(t)},P=(e,t,n,o,r,i,l,a,s)=>{l=l||"svg"===t.type,null==e?M(t,n,o,r,i,l,a,s):D(e,t,r,i,l,a,s)},M=(e,t,o,r,i,l,c,u)=>{let d,p;const{type:h,props:g,shapeFlag:m,transition:v,dirs:b}=e;if(d=e.el=s(e.type,l,g&&g.is,g),8&m?f(d,e.children):16&m&&A(e.children,d,null,r,i,l&&"foreignObject"!==h,c,u),b&&Cn(e,null,r,"created"),E(d,e,e.scopeId,c,r),g){for(const t in g)"value"===t||C(t)||a(d,t,null,g[t],l,e.children,r,i,ee);"value"in g&&a(d,"value",null,g.value),(p=g.onVnodeBeforeMount)&&Pr(p,r,e)}b&&Cn(e,null,r,"beforeMount");const y=function(e,t){return(!e||e&&!e.pendingBranch)&&t&&!t.persisted}(i,v);y&&v.beforeEnter(d),n(d,t,o),((p=g&&g.onVnodeMounted)||y||b)&&Yo((()=>{p&&Pr(p,r,e),y&&v.enter(d),b&&Cn(e,null,r,"mounted")}),i)},E=(e,t,n,o,r)=>{if(n&&v(e,n),o)for(let i=0;i{for(let c=s;c{const c=t.el=e.el;let{patchFlag:u,dynamicChildren:d,dirs:p}=t;u|=16&e.patchFlag;const h=e.props||o,g=t.props||o;let m;n&&Zo(n,!1),(m=g.onVnodeBeforeUpdate)&&Pr(m,n,t,e),p&&Cn(t,e,n,"beforeUpdate"),n&&Zo(n,!0);const v=i&&"foreignObject"!==t.type;if(d?B(e.dynamicChildren,d,c,n,r,v,l):s||X(e,t,c,null,n,r,v,l,!1),u>0){if(16&u)j(c,t,h,g,n,r,i);else if(2&u&&h.class!==g.class&&a(c,"class",null,g.class,i),4&u&&a(c,"style",h.style,g.style,i),8&u){const o=t.dynamicProps;for(let t=0;t{m&&Pr(m,n,t,e),p&&Cn(t,e,n,"updated")}),r)},B=(e,t,n,o,r,i,l)=>{for(let a=0;a{if(n!==r){if(n!==o)for(const o in n)C(o)||o in r||a(e,o,n[o],null,s,t.children,i,l,ee);for(const o in r){if(C(o))continue;const c=r[o],u=n[o];c!==u&&"value"!==o&&a(e,o,u,c,s,t.children,i,l,ee)}"value"in r&&a(e,"value",n.value,r.value)}},_=(e,t,o,r,i,l,a,s,c)=>{const d=t.el=e?e.el:u(""),p=t.anchor=e?e.anchor:u("");let{patchFlag:h,dynamicChildren:f,slotScopeIds:g}=t;g&&(s=s?s.concat(g):g),null==e?(n(d,o,r),n(p,o,r),A(t.children,o,p,i,l,a,s,c)):h>0&&64&h&&f&&e.dynamicChildren?(B(e.dynamicChildren,f,o,i,l,a,s),(null!=t.key||i&&t===i.subTree)&&Uo(e,t,!0)):X(e,t,o,p,i,l,a,s,c)},Q=(e,t,n,o,r,i,l,a,s)=>{t.slotScopeIds=a,null==e?512&t.shapeFlag?r.ctx.activate(t,n,o,l,s):L(t,n,o,r,i,l,s):H(e,t,s)},L=(e,t,n,r,i,l,a)=>{const s=e.component=function(e,t,n){const r=e.type,i=(t?t.appContext:e.appContext)||Tr,l={uid:Mr++,vnode:e,type:r,parent:t,appContext:i,root:null,next:null,subTree:null,effect:null,update:null,scope:new G(!0),render:null,proxy:null,exposed:null,exposeProxy:null,withProxy:null,provides:t?t.provides:Object.create(i.provides),accessCache:null,renderCache:[],components:null,directives:null,propsOptions:zo(r,i),emitsOptions:Jt(r,i),emit:null,emitted:null,propsDefaults:o,inheritAttrs:r.inheritAttrs,ctx:o,data:o,props:o,attrs:o,slots:o,refs:o,setupState:o,setupContext:null,attrsProxy:null,slotsProxy:null,suspense:n,suspenseId:n?n.pendingId:0,asyncDep:null,asyncResolved:!1,isMounted:!1,isUnmounted:!1,isDeactivated:!1,bc:null,c:null,bm:null,m:null,bu:null,u:null,um:null,bum:null,da:null,a:null,rtg:null,rtc:null,ec:null,sp:null};return l.ctx={_:l},l.root=t?t.root:l,l.emit=qt.bind(null,l),e.ce&&e.ce(l),l}(e,r,i);if(Qn(e)&&(s.ctx.renderer=oe),function(e,t=!1){Nr=t;const{props:n,children:o}=e.vnode,r=jr(e);Ao(e,n,r,t),((e,t)=>{if(32&e.vnode.shapeFlag){const n=t._;n?(e.slots=dt(t),z(t,"_",n)):Fo(t,e.slots={})}else e.slots={},t&&Wo(e,t);z(e.slots,mr,1)})(e,o);r&&function(e,t){const n=e.type;e.accessCache=Object.create(null),e.proxy=pt(new Proxy(e.ctx,uo));const{setup:o}=n;if(o){const n=e.setupContext=o.length>1?Lr(e):null;zr(e),fe();const r=At(o,e,0,[e.props,n]);if(ge(),Br(),O(r)){if(r.then(Br,Br),t)return r.then((n=>{_r(e,n,t)})).catch((t=>{Rt(t,e,0)}));e.asyncDep=r}else _r(e,r,t)}else Qr(e)}(e,t);Nr=!1}(s),s.asyncDep){if(i&&i.registerDep(s,F),!e.el){const e=s.subTree=Or(rr);S(null,e,t,n)}}else F(s,e,t,n,i,l,a)},H=(e,t,n)=>{const o=t.component=e.component;if(function(e,t,n){const{props:o,children:r,component:i}=e,{props:l,children:a,patchFlag:s}=t,c=i.emitsOptions;if(t.dirs||t.transition)return!0;if(!(n&&s>=0))return!(!r&&!a||a&&a.$stable)||o!==l&&(o?!l||dn(o,l,c):!!l);if(1024&s)return!0;if(16&s)return o?dn(o,l,c):!!l;if(8&s){const e=t.dynamicProps;for(let t=0;tNt&&jt.splice(t,1)}(o.update),o.update()}else t.el=e.el,o.vnode=t},F=(e,t,n,o,r,i,l)=>{const a=()=>{if(e.isMounted){let t,{next:n,bu:o,u:a,parent:s,vnode:c}=e,u=n;Zo(e,!1),n?(n.el=c.el,W(e,n,l)):n=c,o&&R(o),(t=n.props&&n.props.onVnodeBeforeUpdate)&&Pr(t,s,n,c),Zo(e,!0);const d=sn(e),p=e.subTree;e.subTree=d,y(p,d,g(p.el),te(p),e,r,i),n.el=d.el,null===u&&function({vnode:e,parent:t},n){for(;t&&t.subTree===e;)(e=t.vnode).el=n,t=t.parent}(e,d.el),a&&Yo(a,r),(t=n.props&&n.props.onVnodeUpdated)&&Yo((()=>Pr(t,s,n,c)),r)}else{let l;const{el:a,props:s}=t,{bm:c,m:u,parent:d}=e,p=_n(t);if(Zo(e,!1),c&&R(c),!p&&(l=s&&s.onVnodeBeforeMount)&&Pr(l,d,t),Zo(e,!0),a&&ie){const n=()=>{e.subTree=sn(e),ie(a,e.subTree,e,r,null)};p?t.type.__asyncLoader().then((()=>!e.isUnmounted&&n())):n()}else{const l=e.subTree=sn(e);y(null,l,n,o,e,r,i),t.el=l.el}if(u&&Yo(u,r),!p&&(l=s&&s.onVnodeMounted)){const e=t;Yo((()=>Pr(l,d,e)),r)}(256&t.shapeFlag||d&&_n(d.vnode)&&256&d.vnode.shapeFlag)&&e.a&&Yo(e.a,r),e.isMounted=!0,t=n=o=null}},s=e.effect=new ue(a,(()=>Xt(c)),e.scope),c=e.update=()=>s.run();c.id=e.uid,Zo(e,!0),c()},W=(e,t,n)=>{t.component=e;const r=e.vnode.props;e.vnode=t,e.next=null,function(e,t,n,o){const{props:r,attrs:i,vnode:{patchFlag:l}}=e,a=dt(r),[s]=e.propsOptions;let c=!1;if(!(o||l>0)||16&l){let o;Do(e,t,r,i)&&(c=!0);for(const i in a)t&&(p(t,i)||(o=I(i))!==i&&p(t,o))||(s?!n||void 0===n[i]&&void 0===n[o]||(r[i]=Ro(s,a,i,void 0,e,!0)):delete r[i]);if(i!==a)for(const e in i)t&&p(t,e)||(delete i[e],c=!0)}else if(8&l){const n=e.vnode.dynamicProps;for(let o=0;o{const{vnode:r,slots:i}=e;let l=!0,a=o;if(32&r.shapeFlag){const e=t._;e?n&&1===e?l=!1:(c(i,t),n||1!==e||delete i._):(l=!t.$stable,Fo(t,i)),a=t}else t&&(Wo(e,t),a={default:1});if(l)for(const o in i)Qo(o)||null!=a[o]||delete i[o]})(e,t.children,n),fe(),Vt(e),ge()},X=(e,t,n,o,r,i,l,a,s=!1)=>{const c=e&&e.children,u=e?e.shapeFlag:0,d=t.children,{patchFlag:p,shapeFlag:h}=t;if(p>0){if(128&p)return void V(c,d,n,o,r,i,l,a,s);if(256&p)return void Y(c,d,n,o,r,i,l,a,s)}8&h?(16&u&&ee(c,r,i),d!==c&&f(n,d)):16&u?16&h?V(c,d,n,o,r,i,l,a,s):ee(c,r,i,!0):(8&u&&f(n,""),16&h&&A(d,n,o,r,i,l,a,s))},Y=(e,t,n,o,i,l,a,s,c)=>{t=t||r;const u=(e=e||r).length,d=t.length,p=Math.min(u,d);let h;for(h=0;hd?ee(e,i,l,!0,!1,p):A(t,n,o,i,l,a,s,c,p)},V=(e,t,n,o,i,l,a,s,c)=>{let u=0;const d=t.length;let p=e.length-1,h=d-1;for(;u<=p&&u<=h;){const o=e[u],r=t[u]=c?Cr(t[u]):$r(t[u]);if(!gr(o,r))break;y(o,r,n,null,i,l,a,s,c),u++}for(;u<=p&&u<=h;){const o=e[p],r=t[h]=c?Cr(t[h]):$r(t[h]);if(!gr(o,r))break;y(o,r,n,null,i,l,a,s,c),p--,h--}if(u>p){if(u<=h){const e=h+1,r=eh)for(;u<=p;)U(e[u],i,l,!0),u++;else{const f=u,g=u,m=new Map;for(u=g;u<=h;u++){const e=t[u]=c?Cr(t[u]):$r(t[u]);null!=e.key&&m.set(e.key,u)}let v,b=0;const O=h-g+1;let w=!1,S=0;const x=new Array(O);for(u=0;u=O){U(o,i,l,!0);continue}let r;if(null!=o.key)r=m.get(o.key);else for(v=g;v<=h;v++)if(0===x[v-g]&&gr(o,t[v])){r=v;break}void 0===r?U(o,i,l,!0):(x[r-g]=u+1,r>=S?S=r:w=!0,y(o,t[r],n,null,i,l,a,s,c),b++)}const $=w?function(e){const t=e.slice(),n=[0];let o,r,i,l,a;const s=e.length;for(o=0;o>1,e[n[a]]0&&(t[o]=n[i-1]),n[i]=o)}}for(i=n.length,l=n[i-1];i-- >0;)n[i]=l,l=t[l];return n}(x):r;for(v=$.length-1,u=O-1;u>=0;u--){const e=g+u,r=t[e],p=e+1{const{el:l,type:a,transition:s,children:c,shapeFlag:u}=e;if(6&u)Z(e.component.subTree,t,o,r);else if(128&u)e.suspense.move(t,o,r);else if(64&u)a.move(e,t,o,oe);else if(a!==nr)if(a!==ir)if(2!==r&&1&u&&s)if(0===r)s.beforeEnter(l),n(l,t,o),Yo((()=>s.enter(l)),i);else{const{leave:e,delayLeave:r,afterLeave:i}=s,a=()=>n(l,t,o),c=()=>{e(l,(()=>{a(),i&&i()}))};r?r(l,a,c):c()}else n(l,t,o);else $(e,t,o);else{n(l,t,o);for(let e=0;e{const{type:i,props:l,ref:a,children:s,dynamicChildren:c,shapeFlag:u,patchFlag:d,dirs:p}=e;if(null!=a&&Xo(a,null,n,e,!0),256&u)return void t.ctx.deactivate(e);const h=1&u&&p,f=!_n(e);let g;if(f&&(g=l&&l.onVnodeBeforeUnmount)&&Pr(g,t,e),6&u)J(e.component,n,o);else{if(128&u)return void e.suspense.unmount(n,o);h&&Cn(e,null,t,"beforeUnmount"),64&u?e.type.remove(e,t,n,r,oe,o):c&&(i!==nr||d>0&&64&d)?ee(c,t,n,!1,!0):(i===nr&&384&d||!r&&16&u)&&ee(s,t,n),o&&K(e)}(f&&(g=l&&l.onVnodeUnmounted)||h)&&Yo((()=>{g&&Pr(g,t,e),h&&Cn(e,null,t,"unmounted")}),n)},K=e=>{const{type:t,el:n,anchor:o,transition:r}=e;if(t===nr)return void q(n,o);if(t===ir)return void k(e);const i=()=>{l(n),r&&!r.persisted&&r.afterLeave&&r.afterLeave()};if(1&e.shapeFlag&&r&&!r.persisted){const{leave:t,delayLeave:o}=r,l=()=>t(n,i);o?o(e.el,i,l):l()}else i()},q=(e,t)=>{let n;for(;e!==t;)n=m(e),l(e),e=n;l(t)},J=(e,t,n)=>{const{bum:o,scope:r,update:i,subTree:l,um:a}=e;o&&R(o),r.stop(),i&&(i.active=!1,U(l,e,t,n)),a&&Yo(a,t),Yo((()=>{e.isUnmounted=!0}),t),t&&t.pendingBranch&&!t.isUnmounted&&e.asyncDep&&!e.asyncResolved&&e.suspenseId===t.pendingId&&(t.deps--,0===t.deps&&t.resolve())},ee=(e,t,n,o=!1,r=!1,i=0)=>{for(let l=i;l6&e.shapeFlag?te(e.component.subTree):128&e.shapeFlag?e.suspense.next():m(e.anchor||e.el),ne=(e,t,n)=>{null==e?t._vnode&&U(t._vnode,null,null,!0):y(t._vnode||null,e,t,null,null,null,n),Vt(),Zt(),t._vnode=e},oe={p:y,um:U,m:Z,r:K,mt:L,mc:A,pc:X,pbc:B,n:te,o:e};let re,ie;return t&&([re,ie]=t(oe)),{render:ne,hydrate:re,createApp:To(ne,re)}}(e)}function Zo({effect:e,update:t},n){e.allowRecurse=t.allowRecurse=n}function Uo(e,t,n=!1){const o=e.children,r=t.children;if(h(o)&&h(r))for(let i=0;ie&&(e.disabled||""===e.disabled),Go=e=>"undefined"!=typeof SVGElement&&e instanceof SVGElement,qo=(e,t)=>{const n=e&&e.to;return v(n)?t?t(n):null:n};function Jo(e,t,n,{o:{insert:o},m:r},i=2){0===i&&o(e.targetAnchor,t,n);const{el:l,anchor:a,shapeFlag:s,children:c,props:u}=e,d=2===i;if(d&&o(l,t,n),(!d||Ko(u))&&16&s)for(let p=0;p{16&b&&u(y,e,t,r,i,l,a,s)};v?m(n,c):d&&m(d,p)}else{t.el=e.el;const o=t.anchor=e.anchor,u=t.target=e.target,h=t.targetAnchor=e.targetAnchor,g=Ko(e.props),m=g?n:u,b=g?o:h;if(l=l||Go(u),O?(p(e.dynamicChildren,O,m,r,i,l,a),Uo(e,t,!0)):s||d(e,t,m,b,r,i,l,a,!1),v)g?t.props&&e.props&&t.props.to!==e.props.to&&(t.props.to=e.props.to):Jo(t,n,o,c,1);else if((t.props&&t.props.to)!==(e.props&&e.props.to)){const e=t.target=qo(t.props,f);e&&Jo(t,e,null,c,0)}else g&&Jo(t,u,h,c,1)}tr(t)},remove(e,t,n,o,{um:r,o:{remove:i}},l){const{shapeFlag:a,children:s,anchor:c,targetAnchor:u,target:d,props:p}=e;if(d&&i(u),l&&i(c),16&a){const e=l||!Ko(p);for(let o=0;o0?ar||r:null,lr.pop(),ar=lr[lr.length-1]||null,cr>0&&ar&&ar.push(e),e}function pr(e,t,n,o,r,i){return dr(yr(e,t,n,o,r,i,!0))}function hr(e,t,n,o,r){return dr(Or(e,t,n,o,r,!0))}function fr(e){return!!e&&!0===e.__v_isVNode}function gr(e,t){return e.type===t.type&&e.key===t.key}const mr="__vInternal",vr=({key:e})=>null!=e?e:null,br=({ref:e,ref_key:t,ref_for:n})=>("number"==typeof e&&(e=""+e),null!=e?v(e)||vt(e)||m(e)?{i:tn,r:e,k:t,f:!!n}:e:null);function yr(e,t=null,n=null,o=0,r=null,i=(e===nr?0:1),l=!1,a=!1){const s={__v_isVNode:!0,__v_skip:!0,type:e,props:t,key:t&&vr(t),ref:t&&br(t),scopeId:nn,slotScopeIds:null,children:n,component:null,suspense:null,ssContent:null,ssFallback:null,dirs:null,transition:null,el:null,anchor:null,target:null,targetAnchor:null,staticCount:0,shapeFlag:i,patchFlag:o,dynamicProps:r,dynamicChildren:null,appContext:null,ctx:tn};return a?(kr(s,n),128&i&&e.normalize(s)):n&&(s.shapeFlag|=v(n)?8:16),cr>0&&!l&&ar&&(s.patchFlag>0||6&i)&&32!==s.patchFlag&&ar.push(s),s}const Or=function(e,t=null,n=null,o=0,r=null,i=!1){if(e&&e!==fn||(e=rr),fr(e)){const o=wr(e,t,!0);return n&&kr(o,n),cr>0&&!i&&ar&&(6&o.shapeFlag?ar[ar.indexOf(e)]=o:ar.push(o)),o.patchFlag|=-2,o}var l;if(m(l=e)&&"__vccOpts"in l&&(e=e.__vccOpts),t){t=function(e){return e?ut(e)||mr in e?c({},e):e:null}(t);let{class:e,style:n}=t;e&&!v(e)&&(t.class=W(e)),y(n)&&(ut(n)&&!h(n)&&(n=c({},n)),t.style=_(n))}const a=v(e)?1:(e=>e.__isSuspense)(e)?128:(e=>e.__isTeleport)(e)?64:y(e)?4:m(e)?2:0;return yr(e,t,n,o,r,a,i,!0)};function wr(e,t,n=!1){const{props:o,ref:r,patchFlag:i,children:l}=e,s=t?function(...e){const t={};for(let n=0;nIr||tn;let Ar,Dr,Rr="__VUE_INSTANCE_SETTERS__";(Dr=N()[Rr])||(Dr=N()[Rr]=[]),Dr.push((e=>Ir=e)),Ar=e=>{Dr.length>1?Dr.forEach((t=>t(e))):Dr[0](e)};const zr=e=>{Ar(e),e.scope.on()},Br=()=>{Ir&&Ir.scope.off(),Ar(null)};function jr(e){return 4&e.vnode.shapeFlag}let Nr=!1;function _r(e,t,n){m(t)?e.type.__ssrInlineRender?e.ssrRender=t:e.render=t:y(t)&&(e.setupState=Ct(t)),Qr(e)}function Qr(e,t,n){const o=e.type;e.render||(e.render=o.render||i),zr(e),fe();try{go(e)}finally{ge(),Br()}}function Lr(e){const t=t=>{e.exposed=t||{}};return{get attrs(){return function(e){return e.attrsProxy||(e.attrsProxy=new Proxy(e.attrs,{get:(t,n)=>(me(e,0,"$attrs"),t[n])}))}(e)},slots:e.slots,emit:e.emit,expose:t}}function Hr(e){if(e.exposed)return e.exposeProxy||(e.exposeProxy=new Proxy(Ct(pt(e.exposed)),{get:(t,n)=>n in t?t[n]:n in so?so[n](e):void 0,has:(e,t)=>t in e||t in so}))}const Fr=(e,t)=>function(e,t,n=!1){let o,r;const l=m(e);return l?(o=e,r=i):(o=e.get,r=e.set),new Et(o,r,l||!r,n)}(e,0,Nr);function Wr(e,t,n){const o=arguments.length;return 2===o?y(t)&&!h(t)?fr(t)?Or(e,null,[t]):Or(e,t):Or(e,null,t):(o>3?n=Array.prototype.slice.call(arguments,2):3===o&&fr(n)&&(n=[n]),Or(e,t,n))}const Xr=Symbol.for("v-scx"),Yr=()=>Eo(Xr),Vr="3.3.11",Zr="undefined"!=typeof document?document:null,Ur=Zr&&Zr.createElement("template"),Kr={insert:(e,t,n)=>{t.insertBefore(e,n||null)},remove:e=>{const t=e.parentNode;t&&t.removeChild(e)},createElement:(e,t,n,o)=>{const r=t?Zr.createElementNS("http://www.w3.org/2000/svg",e):Zr.createElement(e,n?{is:n}:void 0);return"select"===e&&o&&null!=o.multiple&&r.setAttribute("multiple",o.multiple),r},createText:e=>Zr.createTextNode(e),createComment:e=>Zr.createComment(e),setText:(e,t)=>{e.nodeValue=t},setElementText:(e,t)=>{e.textContent=t},parentNode:e=>e.parentNode,nextSibling:e=>e.nextSibling,querySelector:e=>Zr.querySelector(e),setScopeId(e,t){e.setAttribute(t,"")},insertStaticContent(e,t,n,o,r,i){const l=n?n.previousSibling:t.lastChild;if(r&&(r===i||r.nextSibling))for(;t.insertBefore(r.cloneNode(!0),n),r!==i&&(r=r.nextSibling););else{Ur.innerHTML=o?`${e}`:e;const r=Ur.content;if(o){const e=r.firstChild;for(;e.firstChild;)r.appendChild(e.firstChild);r.removeChild(e)}t.insertBefore(r,n)}return[l?l.nextSibling:t.firstChild,n?n.previousSibling:t.lastChild]}},Gr="transition",qr="animation",Jr=Symbol("_vtc"),ei=(e,{slots:t})=>Wr(En,ii(e),t);ei.displayName="Transition";const ti={name:String,type:String,css:{type:Boolean,default:!0},duration:[String,Number,Object],enterFromClass:String,enterActiveClass:String,enterToClass:String,appearFromClass:String,appearActiveClass:String,appearToClass:String,leaveFromClass:String,leaveActiveClass:String,leaveToClass:String},ni=ei.props=c({},In,ti),oi=(e,t=[])=>{h(e)?e.forEach((e=>e(...t))):e&&e(...t)},ri=e=>!!e&&(h(e)?e.some((e=>e.length>1)):e.length>1);function ii(e){const t={};for(const c in e)c in ti||(t[c]=e[c]);if(!1===e.css)return t;const{name:n="v",type:o,duration:r,enterFromClass:i=`${n}-enter-from`,enterActiveClass:l=`${n}-enter-active`,enterToClass:a=`${n}-enter-to`,appearFromClass:s=i,appearActiveClass:u=l,appearToClass:d=a,leaveFromClass:p=`${n}-leave-from`,leaveActiveClass:h=`${n}-leave-active`,leaveToClass:f=`${n}-leave-to`}=e,g=function(e){if(null==e)return null;if(y(e))return[li(e.enter),li(e.leave)];{const t=li(e);return[t,t]}}(r),m=g&&g[0],v=g&&g[1],{onBeforeEnter:b,onEnter:O,onEnterCancelled:w,onLeave:S,onLeaveCancelled:x,onBeforeAppear:$=b,onAppear:C=O,onAppearCancelled:k=w}=t,P=(e,t,n)=>{si(e,t?d:a),si(e,t?u:l),n&&n()},T=(e,t)=>{e._isLeaving=!1,si(e,p),si(e,f),si(e,h),t&&t()},M=e=>(t,n)=>{const r=e?C:O,l=()=>P(t,e,n);oi(r,[t,l]),ci((()=>{si(t,e?s:i),ai(t,e?d:a),ri(r)||di(t,o,m,l)}))};return c(t,{onBeforeEnter(e){oi(b,[e]),ai(e,i),ai(e,l)},onBeforeAppear(e){oi($,[e]),ai(e,s),ai(e,u)},onEnter:M(!1),onAppear:M(!0),onLeave(e,t){e._isLeaving=!0;const n=()=>T(e,t);ai(e,p),gi(),ai(e,h),ci((()=>{e._isLeaving&&(si(e,p),ai(e,f),ri(S)||di(e,o,v,n))})),oi(S,[e,n])},onEnterCancelled(e){P(e,!1),oi(w,[e])},onAppearCancelled(e){P(e,!0),oi(k,[e])},onLeaveCancelled(e){T(e),oi(x,[e])}})}function li(e){const t=(e=>{const t=v(e)?Number(e):NaN;return isNaN(t)?e:t})(e);return t}function ai(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.add(t))),(e[Jr]||(e[Jr]=new Set)).add(t)}function si(e,t){t.split(/\s+/).forEach((t=>t&&e.classList.remove(t)));const n=e[Jr];n&&(n.delete(t),n.size||(e[Jr]=void 0))}function ci(e){requestAnimationFrame((()=>{requestAnimationFrame(e)}))}let ui=0;function di(e,t,n,o){const r=e._endId=++ui,i=()=>{r===e._endId&&o()};if(n)return setTimeout(i,n);const{type:l,timeout:a,propCount:s}=pi(e,t);if(!l)return o();const c=l+"end";let u=0;const d=()=>{e.removeEventListener(c,p),i()},p=t=>{t.target===e&&++u>=s&&d()};setTimeout((()=>{u(n[e]||"").split(", "),r=o(`${Gr}Delay`),i=o(`${Gr}Duration`),l=hi(r,i),a=o(`${qr}Delay`),s=o(`${qr}Duration`),c=hi(a,s);let u=null,d=0,p=0;return t===Gr?l>0&&(u=Gr,d=l,p=i.length):t===qr?c>0&&(u=qr,d=c,p=s.length):(d=Math.max(l,c),u=d>0?l>c?Gr:qr:null,p=u?u===Gr?i.length:s.length:0),{type:u,timeout:d,propCount:p,hasTransform:u===Gr&&/\b(transform|all)(,|$)/.test(o(`${Gr}Property`).toString())}}function hi(e,t){for(;e.lengthfi(t)+fi(e[n]))))}function fi(e){return"auto"===e?0:1e3*Number(e.slice(0,-1).replace(",","."))}function gi(){return document.body.offsetHeight}const mi=Symbol("_vod"),vi={beforeMount(e,{value:t},{transition:n}){e[mi]="none"===e.style.display?"":e.style.display,n&&t?n.beforeEnter(e):bi(e,t)},mounted(e,{value:t},{transition:n}){n&&t&&n.enter(e)},updated(e,{value:t,oldValue:n},{transition:o}){!t!=!n&&(o?t?(o.beforeEnter(e),bi(e,!0),o.enter(e)):o.leave(e,(()=>{bi(e,!1)})):bi(e,t))},beforeUnmount(e,{value:t}){bi(e,t)}};function bi(e,t){e.style.display=t?e[mi]:"none"}const yi=/\s*!important$/;function Oi(e,t,n){if(h(n))n.forEach((n=>Oi(e,t,n)));else if(null==n&&(n=""),t.startsWith("--"))e.setProperty(t,n);else{const o=function(e,t){const n=Si[t];if(n)return n;let o=T(t);if("filter"!==o&&o in e)return Si[t]=o;o=E(o);for(let r=0;r{if(e._vts){if(e._vts<=n.attached)return}else e._vts=Date.now();Dt(function(e,t){if(h(t)){const n=e.stopImmediatePropagation;return e.stopImmediatePropagation=()=>{n.call(e),e._stopped=!0},t.map((e=>t=>!t._stopped&&e&&e(t)))}return t}(e,n.value),t,5,[e])};return n.value=e,n.attached=Pi||(Ti.then((()=>Pi=0)),Pi=Date.now()),n}(o,r);!function(e,t,n,o){e.addEventListener(t,n,o)}(e,n,l,a)}else l&&(function(e,t,n,o){e.removeEventListener(t,n,o)}(e,n,l,a),i[t]=void 0)}}const ki=/(?:Once|Passive|Capture)$/;let Pi=0;const Ti=Promise.resolve(),Mi=e=>111===e.charCodeAt(0)&&110===e.charCodeAt(1)&&e.charCodeAt(2)>96&&e.charCodeAt(2)<123,Ii=new WeakMap,Ei=new WeakMap,Ai=Symbol("_moveCb"),Di=Symbol("_enterCb"),Ri={name:"TransitionGroup",props:c({},ni,{tag:String,moveClass:String}),setup(e,{slots:t}){const n=Er(),o=Tn();let r,i;return Kn((()=>{if(!r.length)return;const t=e.moveClass||`${e.name||"v"}-move`;if(!function(e,t,n){const o=e.cloneNode(),r=e[Jr];r&&r.forEach((e=>{e.split(/\s+/).forEach((e=>e&&o.classList.remove(e)))})),n.split(/\s+/).forEach((e=>e&&o.classList.add(e))),o.style.display="none";const i=1===t.nodeType?t:t.parentNode;i.appendChild(o);const{hasTransform:l}=pi(o);return i.removeChild(o),l}(r[0].el,n.vnode.el,t))return;r.forEach(Bi),r.forEach(ji);const o=r.filter(Ni);gi(),o.forEach((e=>{const n=e.el,o=n.style;ai(n,t),o.transform=o.webkitTransform=o.transitionDuration="";const r=n[Ai]=e=>{e&&e.target!==n||e&&!/transform$/.test(e.propertyName)||(n.removeEventListener("transitionend",r),n[Ai]=null,si(n,t))};n.addEventListener("transitionend",r)}))})),()=>{const l=dt(e),a=ii(l);let s=l.tag||nr;r=i,i=t.default?jn(t.default()):[];for(let e=0;ee.stopPropagation(),prevent:e=>e.preventDefault(),self:e=>e.target!==e.currentTarget,ctrl:e=>!e.ctrlKey,shift:e=>!e.shiftKey,alt:e=>!e.altKey,meta:e=>!e.metaKey,left:e=>"button"in e&&0!==e.button,middle:e=>"button"in e&&1!==e.button,right:e=>"button"in e&&2!==e.button,exact:(e,t)=>_i.some((n=>e[`${n}Key`]&&!t.includes(n)))},Li=(e,t)=>e._withMods||(e._withMods=(n,...o)=>{for(let e=0;e{"class"===t?function(e,t,n){const o=e[Jr];o&&(t=(t?[t,...o]:[...o]).join(" ")),null==t?e.removeAttribute("class"):n?e.setAttribute("class",t):e.className=t}(e,o,r):"style"===t?function(e,t,n){const o=e.style,r=v(n);if(n&&!r){if(t&&!v(t))for(const e in t)null==n[e]&&Oi(o,e,"");for(const e in n)Oi(o,e,n[e])}else{const i=o.display;r?t!==n&&(o.cssText=n):t&&e.removeAttribute("style"),mi in e&&(o.display=i)}}(e,n,o):a(t)?s(t)||Ci(e,t,0,o,l):("."===t[0]?(t=t.slice(1),1):"^"===t[0]?(t=t.slice(1),0):function(e,t,n,o){if(o)return"innerHTML"===t||"textContent"===t||!!(t in e&&Mi(t)&&m(n));if("spellcheck"===t||"draggable"===t||"translate"===t)return!1;if("form"===t)return!1;if("list"===t&&"INPUT"===e.tagName)return!1;if("type"===t&&"TEXTAREA"===e.tagName)return!1;if("width"===t||"height"===t){const t=e.tagName;if("IMG"===t||"VIDEO"===t||"CANVAS"===t||"SOURCE"===t)return!1}return(!Mi(t)||!v(n))&&t in e}(e,t,o,r))?function(e,t,n,o,r,i,l){if("innerHTML"===t||"textContent"===t)return o&&l(o,r,i),void(e[t]=null==n?"":n);const a=e.tagName;if("value"===t&&"PROGRESS"!==a&&!a.includes("-")){e._value=n;const o=null==n?"":n;return("OPTION"===a?e.getAttribute("value"):e.value)!==o&&(e.value=o),void(null==n&&e.removeAttribute(t))}let s=!1;if(""===n||null==n){const o=typeof e[t];"boolean"===o?n=Y(n):null==n&&"string"===o?(n="",s=!0):"number"===o&&(n=0,s=!0)}try{e[t]=n}catch(c){}s&&e.removeAttribute(t)}(e,t,o,i,l,c,u):("true-value"===t?e._trueValue=o:"false-value"===t&&(e._falseValue=o),function(e,t,n,o,r){if(o&&t.startsWith("xlink:"))null==n?e.removeAttributeNS(xi,t.slice(6,t.length)):e.setAttributeNS(xi,t,n);else{const o=X(t);null==n||o&&!Y(n)?e.removeAttribute(t):e.setAttribute(t,o?"":n)}}(e,t,o,r))}},Kr);let Fi;function Wi(){return Fi||(Fi=Vo(Hi))}const Xi=(...e)=>{Wi().render(...e)},Yi=(...e)=>{const t=Wi().createApp(...e),{mount:n}=t;return t.mount=e=>{const o=function(e){return v(e)?document.querySelector(e):e}(e);if(!o)return;const r=t._component;m(r)||r.render||r.template||(r.template=o.innerHTML),o.innerHTML="";const i=n(o,!1,o instanceof SVGElement);return o instanceof Element&&(o.removeAttribute("v-cloak"),o.setAttribute("data-v-app","")),i},t}; /*! * pinia v2.1.7 @@ -18,4 +18,4 @@ var p0,h0;!function(e){class t{static encodeText(n,o){const r=e.QrSegment.makeSe * Copyright (c) 2014-2017, Jon Schlinkert. * Released under the MIT License. */ -function b1(e){return"[object Object]"===Object.prototype.toString.call(e)}function y1(){return y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(r[n]=e[n]);return r}const w1={silent:!1,logLevel:"warn"},S1=["validator"],x1=Object.prototype,$1=x1.toString,C1=x1.hasOwnProperty,k1=/^\s*function (\w+)/;function P1(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(k1);return e?e[1]:""}return""}const T1=function(e){var t,n;return!1!==b1(e)&&(void 0===(t=e.constructor)||!1!==b1(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};let M1=e=>e;const I1=(e,t)=>C1.call(e,t),E1=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},A1=Array.isArray||function(e){return"[object Array]"===$1.call(e)},D1=e=>"[object Function]"===$1.call(e),R1=(e,t)=>T1(e)&&I1(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),z1=e=>T1(e)&&(I1(e,"type")||["_vueTypes_name","validator","default","required"].some((t=>I1(e,t))));function B1(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function j1(e,t,n=!1){let o,r=!0,i="";o=T1(e)?e:{type:e};const l=R1(o)?o._vueTypes_name+" - ":"";if(z1(o)&&null!==o.type){if(void 0===o.type||!0===o.type)return r;if(!o.required&&null==t)return r;A1(o.type)?(r=o.type.some((e=>!0===j1(e,t,!0))),i=o.type.map((e=>P1(e))).join(" or ")):(i=P1(o),r="Array"===i?A1(t):"Object"===i?T1(t):"String"===i||"Number"===i||"Boolean"===i||"Function"===i?function(e){if(null==e)return"";const t=e.constructor.toString().match(k1);return t?t[1].replace(/^Async/,""):""}(t)===i:t instanceof o.type)}if(!r){const e=`${l}value "${t}" should be of type "${i}"`;return!1===n?(M1(e),!1):e}if(I1(o,"validator")&&D1(o.validator)){const e=M1,i=[];if(M1=e=>{i.push(e)},r=o.validator(t),M1=e,!r){const e=(i.length>1?"* ":"")+i.join("\n* ");return i.length=0,!1===n?(M1(e),r):e}}return r}function N1(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(I1(this,"default")&&delete this.default,this):D1(e)||!0===j1(this,e,!0)?(this.default=A1(e)?()=>[...e]:T1(e)?()=>Object.assign({},e):e,this):(M1(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:o}=n;return D1(o)&&(n.validator=B1(o,n)),n}function _1(e,t){const n=N1(e,t);return Object.defineProperty(n,"validate",{value(e){return D1(this.validator)&&M1(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=B1(e,this),this}})}function Q1(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach((n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)})),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!T1(n))return o;const{validator:r}=n,i=O1(n,S1);if(D1(r)){let{validator:e}=o;e&&(e=null!==(a=(l=e).__original)&&void 0!==a?a:l),o.validator=B1(e?function(t){return e.call(this,t)&&r.call(this,t)}:r,o)}var l,a;return Object.assign(o,i)}function L1(e){return e.replace(/^(?!\s*$)/gm," ")}const H1=()=>_1("any",{}),F1=()=>_1("boolean",{type:Boolean}),W1=()=>_1("string",{type:String}),X1=()=>_1("number",{type:Number}),Y1=()=>_1("array",{type:Array}),V1=()=>_1("object",{type:Object});function Z1(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return N1(e.name||"<>",{type:null,validator(n){const o=e(n);return o||M1(`${this._vueTypes_name} - ${t}`),o}})}function U1(e){if(!A1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map((e=>"symbol"==typeof e?e.toString():e)).join('", "')}".`,n={validator(n){const o=-1!==e.indexOf(n);return o||M1(t),o}};if(-1===e.indexOf(null)){const t=e.reduce(((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e}),[]);t.length>0&&(n.type=t)}return N1("oneOf",n)}function K1(e){if(!A1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,o=[];for(let i=0;io.indexOf(e)===t));const r=!1===n&&o.length>0?o:null;return N1("oneOfType",t?{type:r,validator(t){const n=[],o=e.some((e=>{const o=j1(e,t,!0);return"string"==typeof o&&n.push(o),!0===o}));return o||M1(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${L1(n.join("\n"))}`),o}}:{type:r})}function G1(e){return N1("arrayOf",{type:Array,validator(t){let n="";const o=t.every((t=>(n=j1(e,t,!0),!0===n)));return o||M1(`arrayOf - value validation error:\n${L1(n)}`),o}})}function q1(e){return N1("instanceOf",{type:e})}function J1(e){return N1("objectOf",{type:Object,validator(t){let n="";const o=Object.keys(t).every((o=>(n=j1(e,t[o],!0),!0===n)));return o||M1(`objectOf - value validation error:\n${L1(n)}`),o}})}function e2(e){const t=Object.keys(e),n=t.filter((t=>{var n;return!(null===(n=e[t])||void 0===n||!n.required)})),o=N1("shape",{type:Object,validator(o){if(!T1(o))return!1;const r=Object.keys(o);if(n.length>0&&n.some((e=>-1===r.indexOf(e)))){const e=n.filter((e=>-1===r.indexOf(e)));return M1(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return r.every((n=>{if(-1===t.indexOf(n))return!0===this._vueTypes_isLoose||(M1(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const r=j1(e[n],o[n],!0);return"string"==typeof r&&M1(`shape - "${n}" property validation error:\n ${L1(r)}`),!0===r}))}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),o}const t2=["name","validate","getter"],n2=(()=>{var e;return(e=class{static get any(){return H1()}static get func(){return _1("function",{type:Function}).def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?F1():F1().def(this.defaults.bool)}static get string(){return W1().def(this.defaults.string)}static get number(){return X1().def(this.defaults.number)}static get array(){return Y1().def(this.defaults.array)}static get object(){return V1().def(this.defaults.object)}static get integer(){return N1("integer",{type:Number,validator(e){const t=E1(e);return!1===t&&M1(`integer - "${e}" is not an integer`),t}}).def(this.defaults.integer)}static get symbol(){return N1("symbol",{validator(e){const t="symbol"==typeof e;return!1===t&&M1(`symbol - invalid value "${e}"`),t}})}static get nullable(){return Object.defineProperty({type:null,validator(e){const t=null===e;return!1===t&&M1("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})}static extend(e){if(M1("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),A1(e))return e.forEach((e=>this.extend(e))),this;const{name:t,validate:n=!1,getter:o=!1}=e,r=O1(e,t2);if(I1(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:i}=r;if(R1(i))return delete r.type,Object.defineProperty(this,t,o?{get:()=>Q1(t,i,r)}:{value(...e){const n=Q1(t,i,r);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let l;return l=o?{get(){const e=Object.assign({},r);return n?_1(t,e):N1(t,e)},enumerable:!0}:{value(...e){const o=Object.assign({},r);let i;return i=n?_1(t,o):N1(t,o),o.validator&&(i.validator=o.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,l)}}).defaults={},e.sensibleDefaults=void 0,e.config=w1,e.custom=Z1,e.oneOf=U1,e.instanceOf=q1,e.oneOfType=K1,e.arrayOf=G1,e.objectOf=J1,e.shape=e2,e.utils={validate:(e,t)=>!0===j1(t,e,!0),toType:(e,t,n=!1)=>n?_1(e,t):N1(e,t)},e})();!function(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){(class extends n2{static get sensibleDefaults(){return y1({},this.defaults)}static set sensibleDefaults(t){this.defaults=!1!==t?y1({},!0!==t?t:e):{}}}).defaults=y1({},e)}();const o2=Nn({__name:"AntdIcon",props:{modelValue:H1(),size:W1(),color:W1()},setup(e){const t=Nn({props:{value:H1(),size:W1(),color:W1()},setup:e=>()=>{const{value:t}=e;return t?Wr(t,{style:{fontSize:e.size,color:e.color}},{}):null}});return(n,o)=>(sr(),hr(xt(t),{value:e.modelValue,size:e.size,color:e.color},null,8,["value","size","color"]))}});var r2=(e=>(e[e.SpEl=1]="SpEl",e[e.Aviator=2]="Aviator",e[e.QL=3]="QL",e))(r2||{}),i2=(e=>(e[e["CRON表达式"]=1]="CRON表达式",e[e["固定时间"]=2]="固定时间",e))(i2||{}),l2=(e=>(e[e["丢弃"]=1]="丢弃",e[e["覆盖"]=2]="覆盖",e[e["并行"]=3]="并行",e))(l2||{}),a2=(e=>(e[e["跳过"]=1]="跳过",e[e["阻塞"]=2]="阻塞",e))(a2||{}),s2=(e=>(e[e["关闭"]=0]="关闭",e[e["开启"]=1]="开启",e))(s2||{}),c2=(e=>(e[e.and=1]="and",e[e.or=2]="or",e))(c2||{}),u2=(e=>(e[e["application/json"]=1]="application/json",e[e["application/x-www-form-urlencoded"]=2]="application/x-www-form-urlencoded",e))(u2||{});const d2={1:{title:"待处理",name:"waiting",color:"#64a6ea",icon:u0},2:{title:"运行中",name:"running",color:"#1b7ee5",icon:Pj},3:{title:"成功",name:"success",color:"#087da1",icon:hx},4:{title:"失败",name:"fail",color:"#f52d80",icon:Tx},5:{title:"停止",name:"stop",color:"#ac2df5",icon:UJ},6:{title:"取消",name:"cancel",color:"#f5732d",icon:yJ},99:{title:"跳过",name:"skip",color:"#00000036",icon:$J}},p2={1:{name:"Java",color:"#d06892"}},h2={0:{name:"无",color:"#f5f5f5"},1:{name:"执行超时",color:"#64a6ea"},2:{name:"无客户端节点",color:"#1b7ee5"},3:{name:"任务已关闭",color:"#087da1"},4:{name:"任务丢弃",color:"#3a2f81"},5:{name:"任务被覆盖",color:"#c2238a"},6:{name:"无可执行任务项",color:"#23c28a"},7:{name:"任务执行期间发生非预期异常",color:"#bdc223"},8:{name:"手动停止",color:"#23c28a"},9:{name:"条件节点执行异常",color:"#23c28a"},10:{name:"任务中断",color:"#bdc223"},11:{name:"回调节点执行异常",color:"#bdc223"},12:{name:"无需处理",color:"#23c28a"},13:{name:"节点处理失败并跳过",color:"#3a2f81"}},f2={2:{name:"运行中",color:"#1b7ee5"},3:{name:"成功",color:"#087da1"},4:{name:"失败",color:"#f52d80"},5:{name:"停止",color:"#ac2df5"}},g2={DEBUG:{name:"DEBUG",color:"#2647cc"},INFO:{name:"INFO",color:"#5c962c"},WARN:{name:"WARN",color:"#da9816"},ERROR:{name:"ERROR",color:"#dc3f41"}},m2={0:{name:"关闭",color:"#dc3f41"},1:{name:"开启",color:"#1b7ee5"}},v2=(e=>{const t={};return Object.keys(e).forEach((n=>{const o=e[parseInt(n,10)];t[parseInt(n,10)]={name:o.title,color:o.color}})),t})(d2),b2=e=>(rn("data-v-f05e08cc"),e=e(),ln(),e),y2={class:"log"},O2={class:"scroller"},w2={class:"gutters"},S2=b2((()=>yr("div",{style:{"margin-top":"4px"}},null,-1))),x2={class:"gutter-element"},$2=b2((()=>yr("div",{style:{height:"25px"}},null,-1))),C2={class:"content"},k2={class:"text",style:{color:"#2db7f5"}},P2={class:"text",style:{color:"#00a3a3"}},T2={class:"text",style:{color:"#a771bf","font-weight":"500"}},M2=b2((()=>yr("div",{class:"text"},":",-1))),I2={class:"text",style:{"font-size":"16px"}},E2={style:{"text-align":"center",width:"100vh"}},A2=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},D2=A2(Nn({__name:"LogModal",props:{open:F1().def(!1),record:V1().def({}),modalValue:Y1().def([])},emits:["update:open"],setup(e,{emit:t}){const n=Wr(Wb,{style:{fontSize:"24px",color:"#d9d9d9"},spin:!0}),o=t,r=e,i=bt(!1),l=bt([]);yn((()=>r.open),(e=>{i.value=e}),{immediate:!0}),yn((()=>r.modalValue),(e=>{l.value=e}),{immediate:!0,deep:!0});let a=0;Zn((()=>{p(),a=setInterval((()=>{p()}),1e3)}));const s=()=>{clearInterval(a),o("update:open",!1)},c=bt(!1);let u=0,d=0;const p=()=>{c.value?clearInterval(a):v1(`/job/log/list?taskBatchId=${r.record.taskBatchId}&jobId=${r.record.jobId}&taskId=${r.record.id}&startId=${u}&fromIndex=${d}&size=50`).then((e=>{c.value=e.finished,u=e.nextStartId,d=e.fromIndex,e.message&&l.value.push(...e.message)})).catch((()=>{c.value=!0}))},h=e=>{const t=new Date(Number.parseInt(e.toString()));return`${t.getFullYear()}-${1===(t.getMonth()+1).toString().length?"0"+(t.getMonth()+1):(t.getMonth()+1).toString()}-${t.getDate()} ${t.getHours()}:${1===t.getMinutes().toString().length?"0"+t.getMinutes():t.getMinutes().toString()}:${1===t.getSeconds().toString().length?"0"+t.getSeconds():t.getSeconds().toString()}`};return(t,o)=>{const r=hn("a-flex"),a=hn("a-spin"),u=hn("a-modal");return sr(),hr(u,{open:i.value,"onUpdate:open":o[0]||(o[0]=e=>i.value=e),centered:"",width:"95%",footer:null,title:"日志详情",onCancel:s},{default:an((()=>[yr("div",y2,[yr("div",O2,[yr("div",w2,[S2,(sr(!0),pr(nr,null,oo(l.value,((e,t)=>(sr(),pr("div",{key:e.time_stamp},[yr("div",x2,V(t+1),1),$2])))),128))]),yr("div",C2,[(sr(!0),pr(nr,null,oo(e.modalValue,(e=>(sr(),pr("div",{class:"line",key:e.time_stamp},[Or(r,{gap:"small"},{default:an((()=>[yr("div",k2,V(h(e.time_stamp)),1),yr("div",{class:"text",style:_({color:xt(g2)[e.level].color})},V(4===e.level.length?e.level+"\t":e.level),5),yr("div",P2,"["+V(e.thread)+"]",1),yr("div",T2,V(e.location),1),M2])),_:2},1024),yr("div",I2,V(e.message),1)])))),128)),yr("div",E2,[Or(a,{indicator:xt(n),spinning:!c.value},null,8,["indicator","spinning"])])])])])])),_:1},8,["open"])}}}),[["__scopeId","data-v-f05e08cc"]]),R2={key:0},z2={style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},B2=(e=>(rn("data-v-25815c16"),e=e(),ln(),e))((()=>yr("span",{style:{"padding-left":"18px"}},"任务项列表",-1))),j2={style:{"padding-left":"6px"}},N2=["onClick"],_2={key:0},Q2=A2(Nn({__name:"DetailCard",props:{id:W1(),ids:Y1().def([]),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=po().slots,i=bd.PRESENTED_IMAGE_SIMPLE,l=m1(),a=bt(!1),s=bt(!1),c=bt(!1),u=bt(!1),d=bt(1),p=bt({}),h=bt([]),f=bt({current:1,defaultPageSize:10,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`});yn((()=>o.open),(e=>{a.value=e}),{immediate:!0});const g=bt([]);Zn((()=>{o.ids.length>1&&(document.querySelector(".ant-pagination-prev").title="上一个",document.querySelector(".ant-pagination-next").title="下一个"),g.value=o.ids,o.ids.length>0?(y(o.ids[0]),O(o.ids[0])):o.id&&(g.value=[o.id],b(o.id),O(o.id))}));const m=()=>{n("update:open",!1)},b=e=>{c.value=!0,v1(`/job/${e}`).then((e=>{p.value=e,c.value=!1}))},y=e=>{c.value=!0,v1(`/job/batch/${e}`).then((e=>{p.value=e,c.value=!1}))},O=(e,t=1)=>{u.value=!0,v1(`/job/task/list?groupName=${l.GROUP_NAME}&taskBatchId=${e}&page=${t}`).then((e=>{f.value.total=e.total,h.value=e.data,u.value=!1}))},w=bt({}),S=bt([{title:"日志",dataIndex:"log",width:"5%"},{title:"ID",dataIndex:"id",width:"10%"},{title:"组名称",dataIndex:"groupName"},{title:"地址",dataIndex:"clientInfo"},{title:"参数",dataIndex:"argsStr",ellipsis:!0},{title:"结果",dataIndex:"resultMessage",ellipsis:!0},{title:"状态",dataIndex:"taskStatus"},{title:"重试次数",dataIndex:"retryCount"},{title:"开始执行时间",dataIndex:"createDt",sorter:!0,width:"12%"}]);return(t,n)=>{const o=hn("a-descriptions-item"),l=hn("a-tag"),b=hn("a-descriptions"),y=hn("a-spin"),x=hn("a-button"),$=hn("a-table"),C=hn("a-tab-pane"),k=hn("a-tabs"),P=hn("a-empty"),T=hn("a-pagination"),M=hn("a-drawer");return sr(),pr(nr,null,[Or(M,{title:"任务批次详情",placement:"right",width:800,open:a.value,"onUpdate:open":n[2]||(n[2]=e=>a.value=e),"destroy-on-close":"",onClose:m},ro({default:an((()=>[g.value&&g.value.length>0?(sr(),pr("div",R2,[Or(k,{activeKey:d.value,"onUpdate:activeKey":n[0]||(n[0]=e=>d.value=e),animated:""},{renderTabBar:an((()=>[])),default:an((()=>[(sr(!0),pr(nr,null,oo(g.value,((e,n)=>(sr(),hr(C,{key:n+1,tab:e},{default:an((()=>[Or(y,{spinning:c.value},{default:an((()=>[Or(b,{bordered:"",column:2},{default:an((()=>[Or(o,{label:"组名称"},{default:an((()=>[Sr(V(p.value.groupName),1)])),_:1}),p.value.jobName?(sr(),hr(o,{key:0,label:"任务名称"},{default:an((()=>[Sr(V(p.value.jobName),1)])),_:1})):xr("",!0),p.value.nodeName?(sr(),hr(o,{key:1,label:"节点名称"},{default:an((()=>[Sr(V(p.value.nodeName),1)])),_:1})):xr("",!0),Or(o,{label:"状态"},{default:an((()=>[null!=p.value.taskBatchStatus?(sr(),hr(l,{key:0,color:xt(v2)[p.value.taskBatchStatus].color},{default:an((()=>[Sr(V(xt(v2)[p.value.taskBatchStatus].name),1)])),_:1},8,["color"])):xr("",!0),null!=p.value.jobStatus?(sr(),hr(l,{key:1,color:xt(m2)[p.value.jobStatus].color},{default:an((()=>[Sr(V(xt(m2)[p.value.jobStatus].name),1)])),_:1},8,["color"])):xr("",!0)])),_:1}),xt(r).default?xr("",!0):(sr(),hr(o,{key:2,label:"执行器类型"},{default:an((()=>[p.value.executorType?(sr(),hr(l,{key:0,color:xt(p2)[p.value.executorType].color},{default:an((()=>[Sr(V(xt(p2)[p.value.executorType].name),1)])),_:1},8,["color"])):xr("",!0)])),_:1})),Or(o,{label:"操作原因"},{default:an((()=>[void 0!==p.value.operationReason?(sr(),hr(l,{key:0,color:xt(h2)[p.value.operationReason].color,style:_(0===p.value.operationReason?{color:"#1e1e1e"}:{})},{default:an((()=>[Sr(V(xt(h2)[p.value.operationReason].name),1)])),_:1},8,["color","style"])):xr("",!0)])),_:1}),xt(r).default?xr("",!0):(sr(),hr(o,{key:3,label:"执行器名称",span:2},{default:an((()=>[Sr(V(p.value.executorInfo),1)])),_:1})),Or(o,{label:"开始执行时间"},{default:an((()=>[Sr(V(p.value.executionAt),1)])),_:1}),Or(o,{label:"创建时间"},{default:an((()=>[Sr(V(p.value.createDt),1)])),_:1})])),_:1})])),_:1},8,["spinning"]),io(t.$slots,"default",{},void 0,!0),yr("div",z2,[B2,yr("span",j2,[Or(x,{type:"text",icon:Wr(xt(e0)),onClick:t=>O(e)},null,8,["icon","onClick"])])]),Or($,{dataSource:h.value,columns:S.value,loading:u.value,scroll:{x:1200},"row-key":"id",onChange:t=>{return n=e,o=t,f.value=o,void O(n,o.current);var n,o},pagination:f.value},{bodyCell:an((({column:e,record:t,text:n})=>["log"===e.dataIndex?(sr(),pr("a",{key:0,onClick:e=>{return n=t,w.value=n,void(s.value=!0);var n}},"点击查看",8,N2)):xr("",!0),"taskStatus"===e.dataIndex?(sr(),pr(nr,{key:1},[n?(sr(),hr(l,{key:0,color:xt(f2)[n].color},{default:an((()=>[Sr(V(xt(f2)[n].name),1)])),_:2},1032,["color"])):xr("",!0)],64)):xr("",!0),"clientInfo"===e.dataIndex?(sr(),pr(nr,{key:2},[Sr(V(""!==n?n.split("@")[1]:""),1)],64)):xr("",!0)])),_:2},1032,["dataSource","columns","loading","onChange","pagination"])])),_:2},1032,["tab"])))),128))])),_:3},8,["activeKey"])])):(sr(),hr(P,{key:1,class:"empty",image:xt(i),description:"暂无数据"},null,8,["image"]))])),_:2},[e.ids&&e.ids.length>0?{name:"footer",fn:an((()=>[Or(T,{style:{"text-align":"center"},current:d.value,"onUpdate:current":n[1]||(n[1]=e=>d.value=e),total:e.ids.length,pageSize:1,hideOnSinglePage:""},{itemRender:an((({page:e,type:t,originalElement:n})=>{return["page"===t?(sr(),pr("a",_2,V(e),1)):(sr(),hr((o=n,v(o)?gn(pn,o,!1)||o:o||fn),{key:1}))];var o})),_:1},8,["current","total"])])),key:"0"}:void 0]),1032,["open"]),s.value&&w.value?(sr(),hr(D2,{key:0,open:s.value,"onUpdate:open":n[3]||(n[3]=e=>s.value=e),record:w.value},null,8,["open","record"])):xr("",!0)],64)}}}),[["__scopeId","data-v-25815c16"]]),L2=e=>(rn("data-v-74f467a1"),e=e(),ln(),e),H2={class:"add-node-btn-box"},F2={class:"add-node-btn"},W2={class:"add-node-popover-body"},X2={class:"icon"},Y2=L2((()=>yr("p",null,"任务节点",-1))),V2=L2((()=>yr("p",null,"决策节点",-1))),Z2=L2((()=>yr("p",null,"回调通知",-1))),U2=A2(Nn({__name:"AddNode",props:{modelValue:V1(),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e=>{let t={};1===e?t={nodeName:"任务节点",nodeType:1,conditionNodes:[{nodeName:"任务1",failStrategy:1,priorityLevel:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}],childNode:o.modelValue}:2===e?t={nodeName:"决策节点",nodeType:2,conditionNodes:[{nodeName:"条件1",priorityLevel:1,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1,defaultDecision:0}},{nodeName:"其他情况",priorityLevel:2,decision:{expressionType:1,nodeExpression:"#true",logicalCondition:1,defaultDecision:1}}],childNode:o.modelValue}:3===e&&(t={nodeName:"回调通知",nodeType:3,conditionNodes:[{nodeName:"回调通知",workflowNodeStatus:1,callback:{webhook:void 0,contentType:void 0,secret:void 0}}],childNode:o.modelValue}),n("update:modelValue",t)};return(t,n)=>{const o=hn("a-button"),i=hn("a-popover");return sr(),pr("div",H2,[yr("div",F2,[e.disabled?xr("",!0):(sr(),hr(i,{key:0,placement:"rightTop",trigger:"click","overlay-style":{width:"296px"}},{content:an((()=>[yr("div",W2,[yr("ul",X2,[yr("li",null,[Or(o,{shape:"circle",size:"large",onClick:n[0]||(n[0]=e=>r(1))},{default:an((()=>[Or(xt(i0),{style:{color:"#3296fa"}})])),_:1}),Y2]),yr("li",null,[Or(o,{shape:"circle",size:"large",onClick:n[1]||(n[1]=e=>r(2))},{default:an((()=>[Or(xt(WJ),{style:{color:"#15bc83"}})])),_:1}),V2]),yr("li",null,[Or(o,{shape:"circle",size:"large",onClick:n[2]||(n[2]=e=>r(3))},{default:an((()=>[Or(xt(TQ),{style:{color:"#935af6"}})])),_:1}),Z2])])])])),default:an((()=>[Or(o,{type:"primary",icon:Wr(xt(zI)),shape:"circle"},null,8,["icon"])])),_:1}))])])}}}),[["__scopeId","data-v-74f467a1"]]),K2=e=>{const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];"number"==typeof o&&t.push({name:n,value:o})}return t},G2=Nn({__name:"TaskDrawer",props:{open:F1().def(!1),len:X1().def(0),modelValue:V1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt(!1),l=bt({}),a=bt([]);Zn((()=>{a.value=r.JOB_LIST})),yn((()=>o.open),(e=>{i.value=e}),{immediate:!0}),yn((()=>o.modelValue),(e=>{l.value=e}),{immediate:!0,deep:!0});const s=()=>{n("update:modelValue",l.value)},c=bt(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",l.value)})).catch((()=>{MB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),i.value=!1},p={failStrategy:[{required:!0,message:"请选择失败策略",trigger:"change"}],workflowNodeStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(t,n)=>{const o=hn("a-typography-paragraph"),r=hn("a-select-option"),h=hn("a-select"),f=hn("a-form-item"),g=hn("a-radio"),m=hn("a-radio-group"),v=hn("a-form"),b=hn("a-button"),y=hn("a-drawer");return sr(),hr(y,{open:i.value,"onUpdate:open":n[5]||(n[5]=e=>i.value=e),"destroy-on-close":"",width:500,onClose:d},{title:an((()=>[Or(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:l.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>l.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:s},null,8,["content"])])),extra:an((()=>[Or(h,{value:l.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>l.value.priorityLevel=e),style:{width:"110px"}},{default:an((()=>[(sr(!0),pr(nr,null,oo(e.len,(e=>(sr(),hr(r,{key:e,value:e},{default:an((()=>[Sr("优先级 "+V(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:an((()=>[Or(b,{type:"primary",onClick:u},{default:an((()=>[Sr("保存")])),_:1}),Or(b,{style:{"margin-left":"12px"},onClick:d},{default:an((()=>[Sr("取消")])),_:1})])),default:an((()=>[Or(v,{ref_key:"formRef",ref:c,rules:p,layout:"vertical",model:l.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:an((()=>[Or(f,{name:["jobTask","jobId"],label:"所属任务",placeholder:"请选择任务",rules:[{required:!0,message:"请选择任务",trigger:"change"}]},{default:an((()=>[Or(h,{value:l.value.jobTask.jobId,"onUpdate:value":n[2]||(n[2]=e=>l.value.jobTask.jobId=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(a.value,(e=>(sr(),hr(r,{key:e.id,value:e.id},{default:an((()=>[Sr(V(e.jobName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(f,{name:"failStrategy",label:"失败策略"},{default:an((()=>[Or(m,{value:l.value.failStrategy,"onUpdate:value":n[3]||(n[3]=e=>l.value.failStrategy=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(a2)),(e=>(sr(),hr(g,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(f,{name:"workflowNodeStatus",label:"节点状态"},{default:an((()=>[Or(m,{value:l.value.workflowNodeStatus,"onUpdate:value":n[4]||(n[4]=e=>l.value.workflowNodeStatus=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(s2)),(e=>(sr(),hr(g,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),q2=Nn({__name:"TaskDetail",props:{modelValue:V1().def({}),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt(!1);yn((()=>o.open),(e=>{i.value=e}),{immediate:!0});const l=()=>{n("update:open",!1)},a=e=>{var t;return null==(t=r.JOB_LIST.find((t=>t.id===e)))?void 0:t.jobName};return(t,n)=>{const o=hn("a-descriptions-item"),r=hn("a-descriptions"),s=hn("a-drawer");return sr(),hr(s,{title:"任务详情",placement:"right",width:500,open:i.value,"onUpdate:open":n[0]||(n[0]=e=>i.value=e),"destroy-on-close":"",onClose:l},{default:an((()=>[Or(r,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(o,{label:"节点名称"},{default:an((()=>[Sr(V(e.modelValue.nodeName),1)])),_:1}),Or(o,{label:"任务 ID"},{default:an((()=>{var t;return[Sr(V(null==(t=e.modelValue.jobTask)?void 0:t.jobId),1)]})),_:1}),Or(o,{label:"任务名称"},{default:an((()=>{var t;return[Sr(V(a(null==(t=e.modelValue.jobTask)?void 0:t.jobId)),1)]})),_:1}),Or(o,{label:"失败策略"},{default:an((()=>[Sr(V(xt(a2)[e.modelValue.failStrategy]),1)])),_:1}),Or(o,{label:"工作流状态"},{default:an((()=>[Sr(V(xt(s2)[e.modelValue.workflowNodeStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),J2=e=>(rn("data-v-b84a7ebc"),e=e(),ln(),e),e3={class:"node-wrap"},t3={class:"branch-box"},n3={class:"condition-node"},o3={class:"condition-node-box"},r3=["onClick"],i3=["onClick"],l3={class:"title"},a3={class:"text",style:{color:"#3296fa"}},s3={class:"priority-title"},c3={class:"content",style:{"min-height":"81px"}},u3={key:0,class:"placeholder"},d3=J2((()=>yr("span",{class:"content_label"},"任务名称: ",-1))),p3=J2((()=>yr("span",{class:"content_label"},"失败策略: ",-1))),h3=J2((()=>yr("div",null,".........",-1))),f3=["onClick"],g3={key:1,class:"top-left-cover-line"},m3={key:2,class:"bottom-left-cover-line"},v3={key:3,class:"top-right-cover-line"},b3={key:4,class:"bottom-right-cover-line"},y3=A2(Nn({__name:"TaskNode",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt({}),l=bt({});yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{var e;const t=i.value.conditionNodes.length+1;null==(e=i.value.conditionNodes)||e.push({nodeName:"任务"+t,priorityLevel:t,failStrategy:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}),n("update:modelValue",i.value)},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},u=bt(0),d=bt(!1),p=bt({}),h=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&c(u.value,o-t),n("update:modelValue",i.value)},f=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus&&d2[e.taskBatchStatus]?d2[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover",g=bt(),m=bt(),v=bt(!1),b=bt([]),y=(e,t)=>{var n,l,a,s;m.value=[],2===r.TYPE?(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),(null==(l=e.jobTask)?void 0:l.jobId)&&(g.value=null==(a=e.jobTask)?void 0:a.jobId.toString()),v.value=!0):1===r.TYPE?b.value[t]=!0:(s=t,o.disabled||(u.value=s,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[s])),d.value=!0))};return(t,o)=>{const u=hn("a-button"),O=hn("a-badge"),w=hn("a-tooltip"),S=hn("a-popover");return sr(),pr("div",e3,[yr("div",t3,[e.disabled?xr("",!0):(sr(),hr(u,{key:0,class:"add-branch",primary:"",onClick:a},{default:an((()=>[Sr("添加任务")])),_:1})),(sr(!0),pr(nr,null,oo(i.value.conditionNodes,((o,a)=>(sr(),pr("div",{class:"col-box",key:a},[yr("div",n3,[yr("div",o3,[Or(S,{open:l.value[a]&&2===xt(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[a]=e},{content:an((()=>[])),default:an((()=>{var t,l,u,d;return[yr("div",{class:W(["auto-judge",f(o)]),style:{cursor:"pointer"},onClick:e=>y(o,a)},[0!=a?(sr(),pr("div",{key:0,class:"sort-left",onClick:Li((e=>c(a,-1)),["stop"])},[Or(xt(FD))],8,i3)):xr("",!0),yr("div",l3,[yr("span",a3,[Or(O,{status:"processing",color:1===o.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Sr(" "+V(o.nodeName),1)]),yr("span",s3,"优先级"+V(o.priorityLevel),1),e.disabled?xr("",!0):(sr(),hr(xt(ey),{key:0,class:"close",onClick:Li((e=>(e=>{var t;1===i.value.conditionNodes.length?(i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Wt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))):null==(t=i.value.conditionNodes)||t.splice(e,1)})(a)),["stop"])},null,8,["onClick"]))]),yr("div",c3,[(null==(t=o.jobTask)?void 0:t.jobId)?xr("",!0):(sr(),pr("div",u3,"请选择任务")),(null==(l=o.jobTask)?void 0:l.jobId)?(sr(),pr(nr,{key:1},[yr("div",null,[d3,Sr(" "+V(null==(u=o.jobTask)?void 0:u.jobName)+"("+V(null==(d=o.jobTask)?void 0:d.jobId)+")",1)]),yr("div",null,[p3,Sr(V(xt(a2)[o.failStrategy]),1)]),h3],64)):xr("",!0)]),a!=i.value.conditionNodes.length-1?(sr(),pr("div",{key:1,class:"sort-right",onClick:Li((e=>c(a)),["stop"])},[Or(xt(uk))],8,f3)):xr("",!0),2===xt(r).TYPE&&o.taskBatchStatus?(sr(),hr(w,{key:2},{title:an((()=>[Sr(V(xt(d2)[o.taskBatchStatus].title),1)])),default:an((()=>[Or(xt(o2),{class:"error-tip",color:xt(d2)[o.taskBatchStatus].color,size:"24px",onClick:Li((()=>{}),["stop"]),"model-value":xt(d2)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):xr("",!0)],10,r3)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Or(U2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?io(t.$slots,"default",{key:0,node:o},void 0,!0):xr("",!0),0==a?(sr(),pr("div",g3)):xr("",!0),0==a?(sr(),pr("div",m3)):xr("",!0),a==i.value.conditionNodes.length-1?(sr(),pr("div",v3)):xr("",!0),a==i.value.conditionNodes.length-1?(sr(),pr("div",b3)):xr("",!0),0!==xt(r).type&&b.value[a]?(sr(),hr(q2,{key:5,open:b.value[a],"onUpdate:open":e=>b.value[a]=e,modelValue:i.value.conditionNodes[a],"onUpdate:modelValue":e=>i.value.conditionNodes[a]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):xr("",!0)])))),128))]),i.value.conditionNodes.length>1?(sr(),hr(U2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):xr("",!0),0===xt(r).TYPE&&d.value?(sr(),hr(G2,{key:1,open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:p.value,"onUpdate:modelValue":o[2]||(o[2]=e=>p.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:h},null,8,["open","modelValue","len"])):xr("",!0),0!==xt(r).TYPE&&v.value?(sr(),hr(xt(Q2),{key:2,open:v.value,"onUpdate:open":o[4]||(o[4]=e=>v.value=e),id:g.value,ids:m.value},null,8,["open","id","ids"])):xr("",!0)])}}}),[["__scopeId","data-v-b84a7ebc"]]);class O3{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,n){[e,t]=M3(this,e,t);let o=[];return this.decompose(0,e,o,2),n.length&&n.decompose(0,n.length,o,3),this.decompose(t,this.length,o,1),S3.from(o,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=M3(this,e,t);let n=[];return this.decompose(e,t,n,0),S3.from(n,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),n=this.length-this.scanIdentical(e,-1),o=new C3(this),r=new C3(e);for(let i=t,l=t;;){if(o.next(i),r.next(i),i=0,o.lineBreak!=r.lineBreak||o.done!=r.done||o.value!=r.value)return!1;if(l+=o.value.length,o.done||l>=n)return!0}}iter(e=1){return new C3(this,e)}iterRange(e,t=this.length){return new k3(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let o=this.line(e).from;n=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new P3(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new w3(e):S3.from(w3.split(e,[])):O3.empty}}class w3 extends O3{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.text[r],l=o+i.length;if((t?n:l)>=e)return new T3(o,l,n,i);o=l+1,n++}}decompose(e,t,n,o){let r=e<=0&&t>=this.length?this:new w3($3(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&o){let e=n.pop(),t=x3(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new w3(t,e.length+r.length));else{let e=t.length>>1;n.push(new w3(t.slice(0,e)),new w3(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof w3))return super.replace(e,t,n);[e,t]=M3(this,e,t);let o=x3(this.text,x3(n.text,$3(this.text,0,e)),t),r=this.length+n.length-(t-e);return o.length<=32?new w3(o,r):S3.from(w3.split(o,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=M3(this,e,t);let o="";for(let r=0,i=0;r<=t&&ie&&i&&(o+=n),er&&(o+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],o=-1;for(let r of e)n.push(r),o+=r.length+1,32==n.length&&(t.push(new w3(n,o)),n=[],o=-1);return o>-1&&t.push(new w3(n,o)),t}}class S3 extends O3{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.children[r],l=o+i.length,a=n+i.lines-1;if((t?a:l)>=e)return i.lineInner(e,t,n,o);o=l+1,n=a+1}}decompose(e,t,n,o){for(let r=0,i=0;i<=t&&r=i){let r=o&((i<=e?1:0)|(a>=t?2:0));i>=e&&a<=t&&!r?n.push(l):l.decompose(e-i,t-i,n,r)}i=a+1}}replace(e,t,n){if([e,t]=M3(this,e,t),n.lines=r&&t<=l){let a=i.replace(e-r,t-r,n),s=this.lines-i.lines+a.lines;if(a.lines>4&&a.lines>s>>6){let r=this.children.slice();return r[o]=a,new S3(r,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=M3(this,e,t);let o="";for(let r=0,i=0;re&&r&&(o+=n),ei&&(o+=l.sliceString(e-i,t-i,n)),i=a+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof S3))return 0;let n=0,[o,r,i,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,r+=t){if(o==i||r==l)return n;let a=this.children[o],s=e.children[r];if(a!=s)return n+a.scanIdentical(s,t);n+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new w3(n,t)}let o=Math.max(32,n>>5),r=o<<1,i=o>>1,l=[],a=0,s=-1,c=[];function u(e){let t;if(e.lines>r&&e instanceof S3)for(let n of e.children)u(n);else e.lines>i&&(a>i||!a)?(d(),l.push(e)):e instanceof w3&&a&&(t=c[c.length-1])instanceof w3&&e.lines+t.lines<=32?(a+=e.lines,s+=e.length+1,c[c.length-1]=new w3(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>o&&d(),a+=e.lines,s+=e.length+1,c.push(e))}function d(){0!=a&&(l.push(1==c.length?c[0]:S3.from(c,s)),s=-1,a=c.length=0)}for(let p of e)u(p);return d(),1==l.length?l[0]:new S3(l,t)}}function x3(e,t,n=0,o=1e9){for(let r=0,i=0,l=!0;i=n&&(s>o&&(a=a.slice(0,o-r)),r0?1:(e instanceof w3?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,o=this.nodes[n],r=this.offsets[n],i=r>>1,l=o instanceof w3?o.text.length:o.children.length;if(i==(t>0?l:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(o instanceof w3){let r=o.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=o.children[i+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof w3?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class k3{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new C3(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}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 n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=n?o:t<0?o.slice(o.length-n):o.slice(0,n),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 P3{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(O3.prototype[Symbol.iterator]=function(){return this.iter()},C3.prototype[Symbol.iterator]=k3.prototype[Symbol.iterator]=P3.prototype[Symbol.iterator]=function(){return this});class T3{constructor(e,t,n,o){this.from=e,this.to=t,this.number=n,this.text=o}get length(){return this.to-this.from}}function M3(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let I3="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((e=>e?parseInt(e,36):1));for(let Xpe=1;Xpee)return I3[t-1]<=e;return!1}function A3(e){return e>=127462&&e<=127487}function D3(e,t,n=!0,o=!0){return(n?R3:z3)(e,t,o)}function R3(e,t,n){if(t==e.length)return t;t&&B3(e.charCodeAt(t))&&j3(e.charCodeAt(t-1))&&t--;let o=N3(e,t);for(t+=Q3(o);t=0&&A3(N3(e,o));)n++,o-=2;if(n%2==0)break;t+=2}}}return t}function z3(e,t,n){for(;t>0;){let o=R3(e,t-2,n);if(o=56320&&e<57344}function j3(e){return e>=55296&&e<56320}function N3(e,t){let n=e.charCodeAt(t);if(!j3(n)||t+1==e.length)return n;let o=e.charCodeAt(t+1);return B3(o)?o-56320+(n-55296<<10)+65536:n}function _3(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Q3(e){return e<65536?1:2}const L3=/\r\n?|\n/;var H3=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(H3||(H3={}));class F3{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-o);r+=l}else{if(n!=H3.Simple&&s>=e&&(n==H3.TrackDel&&oe||n==H3.TrackBefore&&oe))return null;if(s>e||s==e&&t<0&&!l)return e==o||t<0?r:r+a;r+=a}o=s}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return r}touchesRange(e,t=e){for(let n=0,o=0;n=0&&o<=t&&r>=e)return!(ot)||"cover";o=r}return!1}toString(){let e="";for(let t=0;t=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new F3(e)}static create(e){return new F3(e)}}class W3 extends F3{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 V3(this,((t,n,o,r,i)=>e=e.replace(o,o+(n-t),i)),!1),e}mapDesc(e,t=!1){return Z3(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let o=0,r=0;o=0){t[o]=l,t[o+1]=i;let a=o>>1;for(;n.length0&&Y3(n,t,r.text),r.forward(e),l+=e}let s=e[i++];for(;l>1].toJSON()))}return e}static of(e,t,n){let o=[],r=[],i=0,l=null;function a(e=!1){if(!e&&!o.length)return;il||e<0||l>t)throw new RangeError(`Invalid change range ${e} to ${l} (in doc of length ${t})`);let u=c?"string"==typeof c?O3.of(c.split(n||L3)):c:O3.empty,d=u.length;if(e==l&&0==d)return;ei&&X3(o,e-i,-1),X3(o,l-e,d),Y3(r,o,u),i=l}}(e),a(!l),l}static empty(e){return new W3(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let o=0;ot&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:o?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function Y3(e,t,n){if(0==n.length)return;let o=t.length-2>>1;if(o>1])),!(n||l==e.sections.length||e.sections[l+1]<0);)a=e.sections[l++],s=e.sections[l++];t(r,c,i,u,d),r=c,i=u}}}function Z3(e,t,n,o=!1){let r=[],i=o?[]:null,l=new K3(e),a=new K3(t);for(let s=-1;;)if(-1==l.ins&&-1==a.ins){let e=Math.min(l.len,a.len);X3(r,e,-1),l.forward(e),a.forward(e)}else if(a.ins>=0&&(l.ins<0||s==l.i||0==l.off&&(a.len=0&&s=0)){if(l.done&&a.done)return i?W3.createSet(r,i):F3.create(r);throw new Error("Mismatched change set lengths")}{let e=0,t=l.len;for(;t;)if(-1==a.ins){let n=Math.min(t,a.len);e+=n,t-=n,a.forward(n)}else{if(!(0==a.ins&&a.lene||l.ins>=0&&l.len>e)&&(a||o.length>t),i.forward2(e),l.forward(e)}}else X3(o,0,l.ins,a),r&&Y3(r,o,l.text),l.next()}}class K3{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?O3.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?O3.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class G3{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,o;return this.empty?n=o=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),n==this.from&&o==this.to?this:new G3(n,o,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return q3.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return q3.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return q3.range(e.anchor,e.head)}static create(e,t,n){return new G3(e,t,n)}}class q3{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:q3.create(this.ranges.map((n=>n.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)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new q3(e.ranges.map((e=>G3.fromJSON(e))),e.main)}static single(e,t=e){return new q3([q3.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,o=0;oe?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let o=1;on.head?q3.range(l,i):q3.range(i,l))}}return new q3(e,t)}}function J3(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let e4=0;class t4{constructor(e,t,n,o,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=o,this.id=e4++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new t4(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:n4),!!e.static,e.enables)}of(e){return new o4([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new o4(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new o4(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function n4(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class o4{constructor(e,t,n,o){this.dependencies=e,this.facet=t,this.type=n,this.value=o,this.id=e4++}dynamicSlot(e){var t;let n=this.value,o=this.facet.compareInput,r=this.id,i=e[r]>>1,l=2==this.type,a=!1,s=!1,c=[];for(let u of this.dependencies)"doc"==u?a=!0:"selection"==u?s=!0:0==(1&(null!==(t=e[u.id])&&void 0!==t?t:1))&&c.push(e[u.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(a&&t.docChanged||s&&(t.docChanged||t.selection)||i4(e,c)){let t=n(e);if(l?!r4(t,e.values[i],o):!o(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let a,s=t.config.address[r];if(null!=s){let r=O4(t,s);if(this.dependencies.every((n=>n instanceof t4?t.facet(n)===e.facet(n):!(n instanceof s4)||t.field(n,!1)==e.field(n,!1)))||(l?r4(a=n(e),r,o):o(a=n(e),r)))return e.values[i]=r,0}else a=n(e);return e.values[i]=a,1}}}}function r4(e,t,n){if(e.length!=t.length)return!1;for(let o=0;oe[t.id])),r=n.map((e=>e.type)),i=o.filter((e=>!(1&e))),l=e[t.id]>>1;function a(e){let n=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(a4).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let o=e.values[t],r=this.updateF(o,n);return this.compareF(o,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,a4.of({field:this,create:e})]}get extension(){return this}}const c4=4,u4=3,d4=2,p4=1;function h4(e){return t=>new g4(t,e)}const f4={highest:h4(0),high:h4(p4),default:h4(d4),low:h4(u4),lowest:h4(c4)};class g4{constructor(e,t){this.inner=e,this.prec=t}}class m4{of(e){return new v4(this,e)}reconfigure(e){return m4.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class v4{constructor(e,t){this.compartment=e,this.inner=t}}class b4{constructor(e,t,n,o,r,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=o,this.staticValues=r,this.facets=i,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let o=[],r=Object.create(null),i=new Map;for(let d of function(e,t,n){let o=[[],[],[],[],[]],r=new Map;function i(e,l){let a=r.get(e);if(null!=a){if(a<=l)return;let t=o[a].indexOf(e);t>-1&&o[a].splice(t,1),e instanceof v4&&n.delete(e.compartment)}if(r.set(e,l),Array.isArray(e))for(let t of e)i(t,l);else if(e instanceof v4){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let o=t.get(e.compartment)||e.inner;n.set(e.compartment,o),i(o,l)}else if(e instanceof g4)i(e.inner,e.prec);else if(e instanceof s4)o[l].push(e),e.provides&&i(e.provides,l);else if(e instanceof o4)o[l].push(e),e.facet.extensions&&i(e.facet.extensions,d4);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(t,l)}}return i(e,d4),o.reduce(((e,t)=>e.concat(t)))}(e,t,i))d instanceof s4?o.push(d):(r[d.facet.id]||(r[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],s=[];for(let d of o)l[d.id]=s.length<<1,s.push((e=>d.slot(e)));let c=null==n?void 0:n.config.facets;for(let d in r){let e=r[d],t=e[0].facet,o=c&&c[d]||[];if(e.every((e=>0==e.type)))if(l[t.id]=a.length<<1|1,n4(o,e))a.push(n.facet(t));else{let o=t.combine(e.map((e=>e.value)));a.push(n&&t.compare(o,n.facet(t))?n.facet(t):o)}else{for(let t of e)0==t.type?(l[t.id]=a.length<<1|1,a.push(t.value)):(l[t.id]=s.length<<1,s.push((e=>t.dynamicSlot(e))));l[t.id]=s.length<<1,s.push((n=>l4(n,t,e)))}}let u=s.map((e=>e(l)));return new b4(e,i,u,l,a,r)}}function y4(e,t){if(1&t)return 2;let n=t>>1,o=e.status[n];if(4==o)throw new Error("Cyclic dependency between fields and/or facets");if(2&o)return o;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function O4(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const w4=t4.define(),S4=t4.define({combine:e=>e.some((e=>e)),static:!0}),x4=t4.define({combine:e=>e.length?e[0]:void 0,static:!0}),$4=t4.define(),C4=t4.define(),k4=t4.define(),P4=t4.define({combine:e=>!!e.length&&e[0]});class T4{constructor(e,t){this.type=e,this.value=t}static define(){return new M4}}class M4{of(e){return new T4(this,e)}}class I4{constructor(e){this.map=e}of(e){return new E4(this,e)}}class E4{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new E4(this.type,t)}is(e){return this.type==e}static define(e={}){return new I4(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let o of e){let e=o.map(t);e&&n.push(e)}return n}}E4.reconfigure=E4.define(),E4.appendConfig=E4.define();class A4{constructor(e,t,n,o,r,i){this.startState=e,this.changes=t,this.selection=n,this.effects=o,this.annotations=r,this.scrollIntoView=i,this._doc=null,this._state=null,n&&J3(n,t.newLength),r.some((e=>e.type==A4.time))||(this.annotations=r.concat(A4.time.of(Date.now())))}static create(e,t,n,o,r,i){return new A4(e,t,n,o,r,i)}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(A4.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function D4(e,t){let n=[];for(let o=0,r=0;;){let i,l;if(o=e[o]))i=e[o++],l=e[o++];else{if(!(r=0;r--){let i=n[r](e);i&&Object.keys(i).length&&(o=R4(o,z4(t,i,e.changes.newLength),!0))}return o==e?e:A4.create(t,e.changes,e.selection,o.effects,o.annotations,o.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet($4)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:D4(n,t))}if(!0!==n){let o,r;if(!1===n)r=e.changes.invertedDesc,o=W3.empty(t.doc.length);else{let t=e.changes.filter(n);o=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=A4.create(t,o,e.selection&&e.selection.map(r),E4.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let o=t.facet(C4);for(let r=o.length-1;r>=0;r--){let n=o[r](e);e=n instanceof A4?n:Array.isArray(n)&&1==n.length&&n[0]instanceof A4?n[0]:B4(t,N4(n),!1)}return e}(r):r)}A4.time=T4.define(),A4.userEvent=T4.define(),A4.addToHistory=T4.define(),A4.remote=T4.define();const j4=[];function N4(e){return null==e?j4:Array.isArray(e)?e:[e]}var _4=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(_4||(_4={}));const Q4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let L4;try{L4=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Wpe){}function H4(e){return t=>{if(!/\S/.test(t))return _4.Space;if(function(e){if(L4)return L4.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||Q4.test(n)))return!0}return!1}(t))return _4.Word;for(let n=0;n-1)return _4.Word;return _4.Other}}class F4{constructor(e,t,n,o,r,i){this.config=e,this.doc=t,this.selection=n,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=r,i&&(i._state=this);for(let l=0;lr.set(t,e))),n=null),r.set(l.value.compartment,l.value.extension)):l.is(E4.reconfigure)?(n=null,o=l.value):l.is(E4.appendConfig)&&(n=null,o=N4(o).concat(l.value));n?t=e.startState.values.slice():(n=b4.resolve(o,r,this),t=new F4(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values);let i=e.startState.facet(S4)?e.newSelection:e.newSelection.asSingle();new F4(n,e.newDoc,i,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:q3.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),o=this.changes(n.changes),r=[n.range],i=N4(n.effects);for(let l=1;lt.spec.fromJSON(i,e))))}return F4.create({doc:e.doc,selection:q3.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=b4.resolve(e.extensions||[],new Map),n=e.doc instanceof O3?e.doc:O3.of((e.doc||"").split(t.staticFacet(F4.lineSeparator)||L3)),o=e.selection?e.selection instanceof q3?e.selection:q3.single(e.selection.anchor,e.selection.head):q3.single(0);return J3(o,n.length),t.staticFacet(S4)||(o=o.asSingle()),new F4(t,n,o,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(F4.tabSize)}get lineBreak(){return this.facet(F4.lineSeparator)||"\n"}get readOnly(){return this.facet(P4)}phrase(e,...t){for(let n of this.facet(F4.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let o=+(n||1);return!o||o>t.length?e:t[o-1]}))),e}languageDataAt(e,t,n=-1){let o=[];for(let r of this.facet(w4))for(let i of r(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&o.push(i[e]);return o}charCategorizer(e){return H4(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:o}=this.doc.lineAt(e),r=this.charCategorizer(e),i=e-n,l=e-n;for(;i>0;){let e=D3(t,i,!1);if(r(t.slice(e,i))!=_4.Word)break;i=e}for(;le.length?e[0]:4}),F4.lineSeparator=x4,F4.readOnly=P4,F4.phrases=t4.define({compare(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length==o.length&&n.every((n=>e[n]==t[n]))}}),F4.languageData=w4,F4.changeFilter=$4,F4.transactionFilter=C4,F4.transactionExtender=k4,m4.reconfigure=E4.define();class X4{eq(e){return this==e}range(e,t=e){return Y4.create(e,t,this)}}X4.prototype.startSide=X4.prototype.endSide=0,X4.prototype.point=!1,X4.prototype.mapMode=H3.TrackDel;let Y4=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,o){return new e(t,n,o)}};function V4(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Z4{constructor(e,t,n,o){this.from=e,this.to=t,this.value=n,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,o=0){let r=n?this.to:this.from;for(let i=o,l=r.length;;){if(i==l)return i;let o=i+l>>1,a=r[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==i)return a>=0?i:l;a>=0?l=o:i=o+1}}between(e,t,n,o){for(let r=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,r);rc||s==c&&u.startSide>0&&u.endSide<=0)continue;(c-s||u.endSide-u.startSide)<0||(i<0&&(i=s),u.point&&(l=Math.max(l,c-s)),n.push(u),o.push(s-i),r.push(c-i))}return{mapped:n.length?new Z4(o,r,n,l):null,pos:i}}}class U4{constructor(e,t,n,o){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=o}static create(e,t,n,o){return new U4(e,t,n,o)}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:n=!1,filterFrom:o=0,filterTo:r=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(V4)),this.isEmpty)return t.length?U4.of(t):this;let l=new q4(this,null,-1).goto(0),a=0,s=[],c=new K4;for(;l.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||s.push(e)}else 1==l.rangeIndex&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+i.length&&!1===i.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return J4.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return J4.from(e).goto(t)}static compare(e,t,n,o,r=-1){let i=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),l=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=G4(i,l,n),s=new t5(i,a,r),c=new t5(l,a,r);n.iterGaps(((e,t,n)=>n5(s,e,c,t,n,o))),n.empty&&0==n.length&&n5(s,0,c,0,0,o)}static eq(e,t,n=0,o){null==o&&(o=999999999);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),i=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=i.length)return!1;if(!r.length)return!0;let l=G4(r,i),a=new t5(r,l,0).goto(n),s=new t5(i,l,0).goto(n);for(;;){if(a.to!=s.to||!o5(a.active,s.active)||a.point&&(!s.point||!a.point.eq(s.point)))return!1;if(a.to>o)return!0;a.next(),s.next()}}static spans(e,t,n,o,r=-1){let i=new t5(e,null,r).goto(t),l=t,a=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),r=i.pointFroml&&(o.span(l,e,i.active,a),a=i.openEnd(e));if(i.to>n)return a+(i.point&&i.to>n?1:0);l=i.to,i.next()}}static of(e,t=!1){let n=new K4;for(let o of e instanceof Y4?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(V4);t=o}return e}(e):e)n.add(o.from,o.to,o.value);return n.finish()}}U4.empty=new U4([],[],null,-1),U4.empty.nextLayer=U4.empty;class K4{finishChunk(e){this.chunks.push(new Z4(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,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new K4)).add(e,t,n)}addInner(e,t,n){let o=e-this.lastTo||n.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(o<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.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 n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(U4.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=U4.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function G4(e,t,n){let o=new Map;for(let i of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&o.push(new q4(i,t,n,r));return 1==o.length?o[0]:new J4(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)e5(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)e5(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)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(),e5(this.heap,0)}}}function e5(e,t){for(let n=e[t];;){let o=1+(t<<1);if(o>=e.length)break;let r=e[o];if(o+1=0&&(r=e[o+1],o++),n.compare(r)<0)break;e[o]=n,e[t]=r,t=o}}class t5{constructor(e,t,n){this.minPoint=n,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=J4.from(e,t,n)}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){r5(this.active,e),r5(this.activeTo,e),r5(this.activeRank,e),this.minActive=l5(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:o,rank:r}=this.cursor;for(;t-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),n&&r5(n,o)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[t]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function n5(e,t,n,o,r,i){e.goto(t),n.goto(o);let l=o+r,a=o,s=o-t;for(;;){let t=e.to+s-n.to||e.endSide-n.endSide,o=t<0?e.to+s:n.to,r=Math.min(o,l);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&o5(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(a,r,e.point,n.point):r>a&&!o5(e.active,n.active)&&i.compareRange(a,r,e.active,n.active),o>l)break;a=o,t<=0&&e.next(),t>=0&&n.next()}}function o5(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;o--)e[o+1]=e[o];e[t]=n}function l5(e,t){let n=-1,o=1e9;for(let r=0;r=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=D3(e,r)}return!0===o?-1:e.length}const c5="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),u5="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),d5="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class p5{constructor(e,t){this.rules=[];let{finish:n}=t||{};function o(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,i,l){let a=[],s=/^@(\w+)\b/.exec(e[0]),c=s&&"keyframes"==s[1];if(s&&null==t)return i.push(e[0]+";");for(let n in t){let l=t[n];if(/&/.test(n))r(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),l,i);else if(l&&"object"==typeof l){if(!s)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(o(n),l,a,c)}else null!=l&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+l+";")}(a.length||c)&&i.push((!n||s||l?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let i in e)r(o(i),e[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=d5[c5]||1;return d5[c5]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let o=e[u5],r=n&&n.nonce;o?r&&o.setNonce(r):o=new f5(e,r),o.mount(Array.isArray(t)?t:[t])}}let h5=new Map;class f5{constructor(e,t){let n=e.ownerDocument||e,o=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let t=h5.get(n);if(t)return e.adoptedStyleSheets=[t.sheet,...e.adoptedStyleSheets],e[u5]=t;this.sheet=new o.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],h5.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let o=e.head||e;o.insertBefore(this.styleTag,o.firstChild)}this.modules=[],e[u5]=this}mount(e){let t=this.sheet,n=0,o=0;for(let r=0;r-1&&(this.modules.splice(l,1),o--,l=-1),-1==l){if(this.modules.splice(o++,0,i),t)for(let e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},v5="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),b5="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),y5=0;y5<10;y5++)g5[48+y5]=g5[96+y5]=String(y5);for(y5=1;y5<=24;y5++)g5[y5+111]="F"+y5;for(y5=65;y5<=90;y5++)g5[y5]=String.fromCharCode(y5+32),m5[y5]=String.fromCharCode(y5);for(var O5 in g5)m5.hasOwnProperty(O5)||(m5[O5]=g5[O5]);function w5(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function S5(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function x5(e,t){if(!t.anchorNode)return!1;try{return S5(e,t.anchorNode)}catch(Wpe){return!1}}function $5(e){return 3==e.nodeType?B5(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function C5(e,t,n,o){return!!n&&(P5(e,t,n,o,-1)||P5(e,t,n,o,1))}function k5(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function P5(e,t,n,o,r){for(;;){if(e==n&&t==o)return!0;if(t==(r<0?0:T5(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=k5(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?T5(e):0}}}function T5(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function M5(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function I5(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function E5(e,t){let n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(t.height-e.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}class A5{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:n}=e;this.set(t,Math.min(e.anchorOffset,t?T5(t):0),n,Math.min(e.focusOffset,n?T5(n):0))}set(e,t,n,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=o}}let D5,R5=null;function z5(e){if(e.setActive)return e.setActive();if(R5)return e.focus(R5);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==R5?{get preventScroll(){return R5={preventScroll:!0},!0}}:void 0),!R5){R5=!1;for(let e=0;eMath.max(1,e.scrollHeight-e.clientHeight-4)}class Q5{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Q5(e.parentNode,k5(e),t)}static after(e,t){return new Q5(e.parentNode,k5(e)+1,t)}}const L5=[];class H5{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 n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,o=this.dom,r=null;for(let i of this.children){if(7&i.flags){if(!i.dom&&(n=r?r.nextSibling:o.firstChild)){let e=H5.get(n);(!e||!e.parent&&e.canReuseDOM(i))&&i.reuseDOM(n)}i.sync(e,t),i.flags&=-8}if(n=r?r.nextSibling:o.firstChild,t&&!t.written&&t.node==o&&n!=i.dom&&(t.written=!0),i.dom.parentNode==o)for(;n&&n!=i.dom;)n=F5(n);else o.insertBefore(i.dom,n);r=i.dom}for(n=r?r.nextSibling:o.firstChild,n&&t&&t.node==o&&(t.written=!0);n;)n=F5(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let o=0==T5(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==o&&t.firstChild!=t.lastChild&&(o=e==t.firstChild?-1:1),e=t}n=o<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!H5.get(n);)n=n.nextSibling;if(!n)return this.length;for(let o=0,r=0;;o++){let e=this.children[o];if(e.dom==n)return r;r+=e.length+e.breakAfter}}domBoundsAround(e,t,n=0){let o=-1,r=-1,i=-1,l=-1;for(let a=0,s=n,c=n;at)return n.domBoundsAround(e,t,s);if(u>=e&&-1==o&&(o=a,r=s),s>t&&n.dom.parentNode==this.dom){i=a,l=c;break}c=u,s=u+n.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:i=0?this.children[i].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),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&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,n=L5){this.markDirty();for(let o=e;othis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function X5(e,t,n,o,r,i,l,a,s){let{children:c}=e,u=c.length?c[t]:null,d=i.length?i[i.length-1]:null,p=d?d.breakAfter:l;if(!(t==o&&u&&!l&&!p&&i.length<2&&u.merge(n,r,i.length?d:null,0==n,a,s))){if(o0&&(!l&&i.length&&u.merge(n,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(n2);var r8={mac:o8||/Mac/.test(V5.platform),windows:/Win/.test(V5.platform),linux:/Linux|X11/.test(V5.platform),ie:q5,ie_version:K5?Z5.documentMode||6:G5?+G5[1]:U5?+U5[1]:0,gecko:J5,gecko_version:J5?+(/Firefox\/(\d+)/.exec(V5.userAgent)||[0,0])[1]:0,chrome:!!e8,chrome_version:e8?+e8[1]:0,ios:o8,android:/Android\b/.test(V5.userAgent),webkit:t8,safari:n8,webkit_version:t8?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=Z5.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class i8 extends H5{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){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof i8)||this.length-(t-e)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new i8(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Q5(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let o=e.nodeValue.length;t>o&&(t=o);let r=t,i=t,l=0;0==t&&n<0||t==o&&n>=0?r8.chrome||r8.gecko||(t?(r--,l=1):i=0)?0:a.length-1];return r8.safari&&!l&&0==s.width&&(s=Array.prototype.find.call(a,(e=>e.width))||s),l?M5(s,l<0):s||null}(this.dom,e,t)}}class l8 extends H5{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let o of t)o.setParent(this)}setAttrs(e){if(N5(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)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof l8&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(o=r),n=i,r++}let i=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new l8(this.mark,t,i)}domAtPos(e){return c8(this,e)}coordsAt(e,t){return d8(this,e,t)}}class a8 extends H5{static create(e,t,n){return new a8(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=a8.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,n,o,r,i){return!(n&&(!(n instanceof a8&&this.widget.compare(n.widget))||e>0&&r<=0||t0)?Q5.before(this.dom):Q5.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let o=this.dom.getClientRects(),r=null;if(!o.length)return null;let i=this.side?this.side<0:e>0;for(let l=i?o.length-1:0;r=o[l],!(e>0?0==l:l==o.length-1||r.top0?Q5.before(this.dom):Q5.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return O3.empty}get isHidden(){return!0}}function c8(e,t){let n=e.dom,{children:o}=e,r=0;for(let i=0;ri&&t0;i--){let e=o[i-1];if(e.dom.parentNode==n)return e.domAtPos(e.length)}for(let i=r;i0&&t instanceof l8&&r.length&&(o=r[r.length-1])instanceof l8&&o.mark.eq(t.mark)?u8(o,t.children[0],n-1):(r.push(t),t.setParent(e)),e.length+=t.length}function d8(e,t,n){let o=null,r=-1,i=null,l=-1;!function e(t,a){for(let s=0,c=0;s=a&&(u.children.length?e(u,a-c):(!i||i.isHidden&&n>0)&&(d>a||c==d&&u.getSide()>0)?(i=u,l=a-c):(c-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let i of o)if(i!=n&&(-1==r.indexOf(i)||e[i]!==t[i]))return!1;return!0}function g8(e,t,n){let o=!1;if(t)for(let r in t)n&&r in n||(o=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(o=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return o}function m8(e){let t=Object.create(null);for(let n=0;n0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){f8(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){u8(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=p8(t,this.attrs||{})),n&&(this.attrs=p8({class:n},this.attrs||{}))}domAtPos(e){return c8(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(N5(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),void 0!==this.prevAttrs&&(g8(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let o=this.dom.lastChild;for(;o&&H5.get(o)instanceof l8;)o=o.lastChild;if(!(o&&this.length&&("BR"==o.nodeName||0!=(null===(n=H5.get(o))||void 0===n?void 0:n.isEditable)||r8.ios&&this.children.some((e=>e instanceof i8))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof i8)||/[^ -~]/.test(n.text))return null;let o=$5(n.dom);if(1!=o.length)return null;t+=o[0].width,e=o[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=d8(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight=t){if(r instanceof v8)return r;if(i>t)break}o=i+r.breakAfter}return null}}class b8 extends H5{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof b8&&this.widget.compare(n.widget))||e>0&&r<=0||t0)}}class y8{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,n){return null}get isHidden(){return!1}destroy(e){}}var O8=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(O8||(O8={}));class w8 extends X4{constructor(e,t,n,o){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=o}get heightRelevant(){return!1}static mark(e){return new S8(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new $8(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,o=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:i}=C8(e,o);t=(r?o?-3e8:-1:5e8)-1,n=1+(i?o?2e8:1:-6e8)}return new $8(e,t,n,o,e.widget||null,!0)}static line(e){return new x8(e)}static set(e,t=!1){return U4.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}w8.none=U4.empty;class S8 extends w8{constructor(e){let{start:t,end:n}=C8(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof S8&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&f8(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)}}S8.prototype.point=!1;class x8 extends w8{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof x8&&this.spec.class==e.spec.class&&f8(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)}}x8.prototype.mapMode=H3.TrackBefore,x8.prototype.point=!0;class $8 extends w8{constructor(e,t,n,o,r,i){super(t,n,r,e),this.block=o,this.isReplace=i,this.mapMode=o?t<=0?H3.TrackBefore:H3.TrackAfter:H3.TrackDel}get type(){return this.startSide!=this.endSide?O8.WidgetRange:this.startSide<=0?O8.WidgetBefore:O8.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof $8&&(t=this.widget,n=e.widget,t==n||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}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)}}function C8(e,t=!1){let{inclusiveStart:n,inclusiveEnd:o}=e;return null==n&&(n=e.inclusive),null==o&&(o=e.inclusive),{start:null!=n?n:t,end:null!=o?o:t}}function k8(e,t,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=e?n[r]=Math.max(n[r],t):n.push(e,t)}$8.prototype.point=!0;class P8{constructor(e,t,n,o){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=o,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(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof b8&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new v8),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(T8(new s8(-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 b8||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,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(n){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}this.text=t,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(T8(new i8(this.text.slice(this.textOff,this.textOff+o)),t),n),this.atCursorPos=!0,this.textOff+=o,e-=o,n=0}}span(e,t,n,o){this.buildText(t-e,n,o),this.pos=t,this.openStart<0&&(this.openStart=o)}point(e,t,n,o,r,i){if(this.disallowBlockEffectsFor[i]&&n instanceof $8){if(n.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 l=t-e;if(n instanceof $8)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new b8(n.widget||new M8("div"),l,n));else{let i=a8.create(n.widget||new M8("span"),l,l?0:n.startSide),a=this.atCursorPos&&!i.isEditable&&r<=o.length&&(e0),s=!i.isEditable&&(eo.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||i.isEditable||(this.pendingBuffer=0),this.flushBuffer(o),a&&(c.append(T8(new s8(1),o),r),r=o.length+Math.max(0,r-o.length)),c.append(T8(i,o),r),this.atCursorPos=s,this.pendingBuffer=s?eo.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,o,r){let i=new P8(e,t,n,r);return i.openEnd=U4.spans(o,t,n,i),i.openStart<0&&(i.openStart=i.openEnd),i.finish(i.openEnd),i}}function T8(e,t){for(let n of t)e=new l8(n,[e],e.length);return e}class M8 extends y8{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 I8=t4.define(),E8=t4.define(),A8=t4.define(),D8=t4.define(),R8=t4.define(),z8=t4.define(),B8=t4.define(),j8=t4.define({combine:e=>e.some((e=>e))}),N8=t4.define({combine:e=>e.some((e=>e))});class _8{constructor(e,t="nearest",n="nearest",o=5,r=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=o,this.xMargin=r,this.isSnapshot=i}map(e){return e.empty?this:new _8(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 _8(q3.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Q8=E4.define({map:(e,t)=>e.map(t)});function L8(e,t,n){let o=e.facet(D8);o.length?o[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)}const H8=t4.define({combine:e=>!e.length||e[0]});let F8=0;const W8=t4.define();class X8{constructor(e,t,n,o,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=o,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:o,provide:r,decorations:i}=t||{};return new X8(F8++,e,n,o,(e=>{let t=[W8.of(e)];return i&&t.push(U8.of((t=>{let n=t.plugin(e);return n?i(n):w8.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return X8.define((t=>new e(t)),t)}}class Y8{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(Fpe){if(L8(e.state,Fpe,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(Wpe){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(Fpe){L8(e.state,Fpe,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(Fpe){L8(e.state,Fpe,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const V8=t4.define(),Z8=t4.define(),U8=t4.define(),K8=t4.define(),G8=t4.define();function q8(e,t,n){let o=e.state.facet(G8);if(!o.length)return o;let r=o.map((t=>t instanceof Function?t(e):t)),i=[];return U4.spans(r,t,n,{point(){},span(e,t,n,o){let r=i;for(let i=n.length-1;i>=0;i--,o--){let l,a=n[i].spec.bidiIsolate;if(null!=a)if(o>0&&r.length&&(l=r[r.length-1]).to==e&&l.direction==a)l.to=t,r=l.inner;else{let n={from:e,to:t,direction:a,inner:[]};r.push(n),r=n.inner}}}}),i}const J8=t4.define();function e6(e){let t=0,n=0,o=0,r=0;for(let i of e.state.facet(J8)){let l=i(e);l&&(null!=l.left&&(t=Math.max(t,l.left)),null!=l.right&&(n=Math.max(n,l.right)),null!=l.top&&(o=Math.max(o,l.top)),null!=l.bottom&&(r=Math.max(r,l.bottom)))}return{left:t,right:n,top:o,bottom:r}}const t6=t4.define();class n6{constructor(e,t,n,o){this.fromA=e,this.toA=t,this.fromB=n,this.toB=o}join(e){return new n6(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,n=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>n.toA)){if(o.toAc)break;r+=2}if(!a)return n;new n6(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),i=a.toA,l=a.toB}}}class o6{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=W3.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let o=[];this.changes.iterChangedRanges(((e,t,n,r)=>o.push(new n6(e,t,n,r)))),this.changedRanges=o}static create(e,t,n){return new o6(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}var r6=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(r6||(r6={}));const i6=r6.LTR,l6=r6.RTL;function a6(e){let t=[];for(let n=0;n=t){if(l.level==n)return i;(r<0||(0!=o?o<0?l.fromt:e[r].level>l.level))&&(r=i)}}if(r<0)throw new RangeError("Index out of range");return r}}function f6(e,t){if(e.length!=t.length)return!1;for(let n=0;ns&&l.push(new h6(s,f.from,p)),v6(e,f.direction==i6!=!(p%2)?o+1:o,r,f.inner,f.from,f.to,l),s=f.to),h=f.to}else{if(h==n||(t?g6[h]!=a:g6[h]==a))break;h++}d?m6(e,s,h,o+1,r,d,l):st;){let n=!0,u=!1;if(!c||s>i[c-1].to){let e=g6[s-1];e!=a&&(n=!1,u=16==e)}let d=n||1!=a?null:[],p=n?o:o+1,h=s;e:for(;;)if(c&&h==i[c-1].to){if(u)break e;let f=i[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(g6[e-1]==a)break e;break}e=i[--n].from}d?d.push(f):(f.to=0;e-=3)if(d6[e+1]==-n){let t=d6[e+2],n=2&t?r:4&t?1&t?i:r:0;n&&(g6[l]=g6[d6[e]]=n),a=e;break}}else{if(189==d6.length)break;d6[a++]=l,d6[a++]=t,d6[a++]=s}else if(2==(o=g6[l])||1==o){let e=o==r;s=e?0:1;for(let t=a-3;t>=0;t-=3){let n=d6[t+2];if(2&n)break;if(e)d6[t+2]|=2;else{if(4&n)break;d6[t+2]|=4}}}}}(e,r,i,o,a),function(e,t,n,o){for(let r=0,i=o;r<=n.length;r++){let l=r?n[r-1].to:e,a=rs;)t==i&&(t=n[--o].from,i=o?n[o-1].to:e),g6[--t]=u;s=l}else i=l,s++}}}(r,i,o,a),m6(e,r,i,t,n,o,l)}function b6(e){return[new h6(0,e,0)]}let y6="";function O6(e,t,n,o,r){var i;let l=o.head-e.from,a=-1;if(0==l){if(!r||!e.length)return null;t[0].level!=n&&(l=t[0].side(!1,n),a=0)}else if(l==e.length){if(r)return null;let e=t[t.length-1];e.level!=n&&(l=e.side(!0,n),a=t.length-1)}a<0&&(a=h6.find(t,l,null!==(i=o.bidiLevel)&&void 0!==i?i:-1,o.assoc));let s=t[a];l==s.side(r,n)&&(s=t[a+=r?1:-1],l=s.side(!r,n));let c=r==(s.dir==n),u=D3(e.text,l,c);if(y6=e.text.slice(Math.min(l,u),Math.max(l,u)),u>s.from&&u0&&n.length&&(n.every((({fromA:e,toA:t})=>tthis.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 o=-1;this.view.inputState.composing>=0&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?o=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges(((e,o)=>{et.from&&(n=!0)})),n}(e.changes,this.hasComposition)||e.selectionSet||(o=e.state.selection.main.head));let r=o>-1?function(e,t,n){let o=x6(e,n);if(!o)return null;let{node:r,from:i,to:l}=o,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(o.from,o.to)!=a)return null;let s=t.invertedDesc,c=new n6(s.mapPos(i),s.mapPos(l),i,l),u=[];for(let d=r.parentNode;;d=d.parentNode){let t=H5.get(d);if(t instanceof l8)u.push({node:d,deco:t.mark});else{if(t instanceof v8||"DIV"==d.nodeName&&d.parentNode==e.contentDOM)return{range:c,text:r,marks:u,line:d};if(d==e.contentDOM)return null;u.push({node:d,deco:new S8({inclusive:!0,attributes:m8(d),tagName:d.tagName.toLowerCase()})})}}}(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:o}=this.hasComposition;n=new n6(t,o,e.changes.mapPos(t,-1),e.changes.mapPos(o,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(r8.ie||r8.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=function(e,t,n){let o=new C6;return U4.compare(e,t,n,o),o.changes}(this.decorations,this.updateDeco(),e.changes);return n=n6.extendWithRanges(n,i),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:o}=this.view;o.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=r8.chrome||r8.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||o.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?o[i]:null;if(!e)break;let t,l,a,s,{fromA:c,toA:u,fromB:d,toB:p}=e;if(n&&n.range.fromBd){let e=P8.build(this.view.state.doc,d,n.range.fromB,this.decorations,this.dynamicDecorationMap),o=P8.build(this.view.state.doc,n.range.toB,p,this.decorations,this.dynamicDecorationMap);l=e.breakAtStart,a=e.openStart,s=o.openEnd;let r=this.compositionView(n);o.breakAtStart?r.breakAfter=1:o.content.length&&r.merge(r.length,r.length,o.content[0],!1,o.openStart,0)&&(r.breakAfter=o.content[0].breakAfter,o.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),t=e.content.concat(r).concat(o.content)}else({content:t,breakAtStart:l,openStart:a,openEnd:s}=P8.build(this.view.state.doc,d,p,this.decorations,this.dynamicDecorationMap));let{i:h,off:f}=r.findPos(u,1),{i:g,off:m}=r.findPos(c,-1);X5(this,g,m,h,f,t,l,a,s)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new i8(e.text.nodeValue);t.flags|=8;for(let{deco:o}of e.marks)t=new l8(o,[t],t.length);let n=new v8;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let n=H5.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),o=this.children[n.i];t(e.line,o);for(let r=e.marks.length-1;r>=-1;r--)n=o.childPos(n.off,1),o=o.children[n.i],t(r>=0?e.marks[r].node:e.text,o)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,o=n==this.dom,r=!o&&x5(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(o||t||r))return;let i=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),s=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(r8.gecko&&l.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=s=new Q5(e,0),i=!0}var c;let u=this.view.observer.selectionRange;!i&&u.focusNode&&C5(a.node,a.offset,u.anchorNode,u.anchorOffset)&&C5(s.node,s.offset,u.focusNode,u.focusOffset)||(this.view.observer.ignore((()=>{r8.android&&r8.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=w5(this.view.root);if(e)if(l.empty){if(r8.gecko){let e=(t=a.node,o=a.offset,1!=t.nodeType?0:(o&&"false"==t.childNodes[o-1].contentEditable?1:0)|(ol.head&&([a,s]=[s,a]),t.setEnd(s.node,s.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,o;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,s)),this.impreciseAnchor=a.precise?null:new Q5(u.anchorNode,u.anchorOffset),this.impreciseHead=s.precise?null:new Q5(u.focusNode,u.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=w5(e.root),{anchorNode:o,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=v8.find(this,t.head);if(!i)return;let l=i.posAtStart;if(t.head==l||t.head==l+i.length)return;let a=this.coordsAt(t.head,-1),s=this.coordsAt(t.head,1);if(!a||!s||a.bottom>s.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(o,r)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let o=e.offset;!t&&o=0;o--){let e=H5.get(n.childNodes[o]);e instanceof v8&&(t=e.domAtPos(e.length))}return t?new Q5(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=H5.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;i--){let l=this.children[i],a=r-l.breakAfter,s=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof v8&&!(n instanceof v8&&t>=0))&&(n=l,o=s),r=s}return n?n.coordsAt(e-o,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),o=this.children[t];if(!(o instanceof v8))return null;for(;o.children.length;){let{i:e,off:t}=o.childPos(n,1);for(;;e++){if(e==o.children.length)return null;if((o=o.children[e]).length)break}n=t}if(!(o instanceof i8))return null;let r=D3(o.text,n);if(r==n)return null;let i=B5(o.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==r6.LTR;for(let s=0,c=0;co)break;if(s>=n){let n=e.dom.getBoundingClientRect();if(t.push(n.height),i){let t=e.dom.lastChild,o=t?$5(t):[];if(o.length){let e=o[o.length-1],t=a?e.right-n.left:n.right-e.left;t>l&&(l=t,this.minWidth=r,this.minWidthFrom=s,this.minWidthTo=u)}}}s=u+e.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?r6.RTL:r6.LTR}measureTextSize(){for(let r of this.children)if(r instanceof v8){let e=r.measureTextSize();if(e)return e}let e,t,n,o=document.createElement("div");return o.className="cm-line",o.style.width="99999px",o.style.position="absolute",o.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(o);let r=$5(o.firstChild)[0];e=o.getBoundingClientRect().height,t=r?r.width/27:7,n=r?r.height:e,o.remove()})),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new W5(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,o=0;;o++){let r=o==t.viewports.length?null:t.viewports[o],i=r?r.from-1:this.length;if(i>n){let o=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(w8.replace({widget:new S6(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!r)break;n=r.to+1}return w8.set(e)}updateDeco(){let e=this.view.state.facet(U8).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e));for(let t=e.length;tn.anchor?-1:1);if(!o)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,t.left),top:Math.min(o.top,t.top),right:Math.max(o.right,t.right),bottom:Math.max(o.bottom,t.bottom)});let r=e6(this.view),i={left:o.left-r.left,top:o.top-r.top,right:o.right+r.right,bottom:o.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,o,r,i,l,a){let s=e.ownerDocument,c=s.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,p=u==s.body,h=1,f=1;if(p)e=I5(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:h,scaleY:f}=E5(u,t)),e={left:t.left,right:t.left+u.clientWidth*h,top:t.top,bottom:t.top+u.clientHeight*f}}let g=0,m=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+m+l)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+l,n<0&&t.top-m0&&t.right>e.right+g&&(g=t.right-e.right+g+i)):t.right>e.right&&(g=t.right-e.right+i,n<0&&t.left0))break;o=o.childNodes[r-1],r=T5(o)}if(n>=0)for(let o=e,r=t;;){if(3==o.nodeType)return{node:o,offset:r};if(!(1==o.nodeType&&r=0))break;o=o.childNodes[r],r=0}return null}let C6=class{constructor(){this.changes=[]}compareRange(e,t){k8(e,t,this.changes)}comparePoint(e,t){k8(e,t,this.changes)}};function k6(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function P6(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function T6(e,t){return e.topt.top+1}function M6(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function E6(e,t,n){let o,r,i,l,a,s,c,u,d=!1;for(let h=e.firstChild;h;h=h.nextSibling){let e=$5(h);for(let p=0;pm||l==m&&i>g){o=h,r=f,i=g,l=m;let a=m?n0?p0)}0==g?n>f.bottom&&(!c||c.bottomf.top)&&(s=h,u=f):c&&T6(c,f)?c=I6(c,f.bottom):u&&T6(u,f)&&(u=M6(u,f.top))}}if(c&&c.bottom>=n?(o=a,r=c):u&&u.top<=n&&(o=s,r=u),!o)return{node:e,offset:0};let p=Math.max(r.left,Math.min(r.right,t));return 3==o.nodeType?A6(o,p,n):d&&"false"!=o.contentEditable?E6(o,p,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,o)+(t>=(r.left+r.right)/2?1:0)}}function A6(e,t,n){let o=e.nodeValue.length,r=-1,i=1e9,l=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u=(c.left+c.right)/2,o=n;if((r8.chrome||r8.gecko)&&B5(e,a).getBoundingClientRect().left==c.right&&(o=!n),u<=0)return{node:e,offset:a+(o?1:0)};r=a+(o?1:0),i=u}}}return{node:e,offset:r>-1?r:l>0?e.nodeValue.length:0}}function D6(e,t,n,o=-1){var r,i;let l,a=e.contentDOM.getBoundingClientRect(),s=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:d}=t,p=d-s;if(p<0)return 0;if(p>c)return e.state.doc.length;for(let O=e.viewState.heightOracle.textHeight/2,w=!1;l=e.elementAtHeight(p),l.type!=O8.Text;)for(;p=o>0?l.bottom+O:l.top-O,!(p>=0&&p<=c);){if(w)return n?null:0;w=!0,o=-o}d=s+p;let h=l.from;if(he.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:R6(e,a,l,u,d);let f=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:f,m=g.elementFromPoint(u,d);m&&!e.contentDOM.contains(m)&&(m=null),m||(u=Math.max(a.left+1,Math.min(a.right-1,u)),m=g.elementFromPoint(u,d),m&&!e.contentDOM.contains(m)&&(m=null));let v,b=-1;if(m&&0!=(null===(r=e.docView.nearest(m))||void 0===r?void 0:r.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,d);e&&({offsetNode:v,offset:b}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,d);t&&(({startContainer:v,startOffset:b}=t),(!e.contentDOM.contains(v)||r8.safari&&function(e,t,n){let o;if(3!=e.nodeType||t!=(o=e.nodeValue.length))return!1;for(let r=e.nextSibling;r;r=r.nextSibling)if(1!=r.nodeType||"BR"!=r.nodeName)return!1;return B5(e,o-1,o).getBoundingClientRect().left>n}(v,b,u)||r8.chrome&&function(e,t,n){if(0!=t)return!1;for(let r=e;;){let e=r.parentNode;if(!e||1!=e.nodeType||e.firstChild!=r)return!1;if(e.classList.contains("cm-line"))break;r=e}let o=1==e.nodeType?e.getBoundingClientRect():B5(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-o.left>5}(v,b,u))&&(v=void 0))}if(!v||!e.docView.dom.contains(v)){let t=v8.find(e.docView,h);if(!t)return p>l.top+l.height/2?l.to:l.from;({node:v,offset:b}=E6(t.dom,u,d))}let y=e.docView.nearest(v);if(!y)return null;if(y.isWidget&&1==(null===(i=y.dom)||void 0===i?void 0:i.nodeType)){let e=y.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((r-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let l=e.state.sliceDoc(n.from,n.to);return n.from+s5(l,i,e.state.tabSize)}function z6(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let o of n.type)if(o.to>t||o.to==t&&(o.to==n.to||o.type==O8.Text))return o;return n}function B6(e,t,n,o){let r=e.state.doc.lineAt(t.head),i=e.bidiSpans(r),l=e.textDirectionAt(r.from);for(let a=t,s=null;;){let t=O6(r,i,l,a,n),c=y6;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),i=e.bidiSpans(r),t=q3.cursor(n?r.from:r.to)}if(s){if(!s(c))return a}else{if(!o)return t;s=o(c)}a=t}}function j6(e,t,n){for(;;){let o=0;for(let r of e)r.between(t-1,t+1,((e,r,i)=>{if(t>e&&tt(e))),n.from,t.head>n.from?-1:1);return o==n.from?n:q3.cursor(o,onull)),r8.gecko&&(t=e.contentDOM.ownerDocument,d7.has(t)||(d7.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{}))))}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,o=t.target;o!=e.contentDOM;o=o.parentNode)if(!o||11==o.nodeType||(n=H5.get(o))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let o of e){let e=o.spec;if(e&&e.domEventHandlers)for(let t in e.domEventHandlers){let r=e.domEventHandlers[t];r&&n(t).handlers.push(Q6(o.value,r))}if(e&&e.domEventObservers)for(let t in e.domEventObservers){let r=e.domEventObservers[t];r&&n(t).observers.push(Q6(o.value,r))}}for(let o in Y6)n(o).handlers.push(Y6[o]);for(let o in V6)n(o).observers.push(V6[o]);return t}(e),n=this.handlers,o=this.view.contentDOM;for(let r in t)if("scroll"!=r){let e=!t[r].handlers.length,i=n[r];i&&e!=!i.handlers.length&&(o.removeEventListener(r,this.handleEvent),i=null),i||o.addEventListener(r,this.handleEvent,{passive:e})}for(let r in n)"scroll"==r||t[r]||o.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&Date.now()t.keyCode==e.keyCode)))&&!e.ctrlKey||H6.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(){let e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,j5(this.view.contentDOM,e.key,e.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(r8.safari&&!r8.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}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 Q6(e,t){return(n,o)=>{try{return t.call(e,o,n)}catch(Fpe){L8(n.state,Fpe)}}}const L6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],H6="dthko",F6=[16,17,18,20,91,92,224,225];function W6(e){return.7*Math.max(0,e)+8}class X6{constructor(e,t,n,o){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=function(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(1==n.nodeType){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else{if(11!=n.nodeType)break;n=n.host}return null}(e.contentDOM),this.atoms=e.state.facet(K8).map((t=>t(e)));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(F4.allowMultipleSelections)&&function(e,t){let n=e.state.facet(I8);return n.length?n[0](t):r8.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let o=w5(e.root);if(!o||0==o.rangeCount)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i=t.clientX&&e.top<=t.clientY&&e.bottom>=t.clientY)return!0}return!1}(e,t)||1!=i7(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t,n,o;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(n=this.startEvent,o=e,Math.max(Math.abs(n.clientX-o.clientX),Math.abs(n.clientY-o.clientY))<10))return;this.select(this.lastEvent=e);let r=0,i=0,l=(null===(t=this.scrollParent)||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=e6(this.view);e.clientX-a.left<=l.left+6?r=-W6(l.left-e.clientX):e.clientX+a.right>=l.right-6&&(r=W6(e.clientX-l.right)),e.clientY-a.top<=l.top+6?i=-W6(l.top-e.clientY):e.clientY+a.bottom>=l.bottom-6&&(i=W6(e.clientY-l.bottom)),this.setScrollSpeed(r,i)}up(e){null==this.dragging&&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),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent)),20)}}const Y6=Object.create(null),V6=Object.create(null),Z6=r8.ie&&r8.ie_version<15||r8.ios&&r8.webkit_version<604;function U6(e,t){let n,{state:o}=e,r=1,i=o.toText(t),l=i.lines==o.selection.ranges.length;if(null!=a7&&o.selection.ranges.every((e=>e.empty))&&a7==i.toString()){let e=-1;n=o.changeByRange((n=>{let a=o.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let s=o.toText((l?i.line(r++).text:t)+o.lineBreak);return{changes:{from:a.from,insert:s},range:q3.cursor(n.from+s.length)}}))}else n=l?o.changeByRange((e=>{let t=i.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:q3.cursor(e.from+t.length)}})):o.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function K6(e,t,n,o){if(1==o)return q3.cursor(t,n);if(2==o)return function(e,t,n=1){let o=e.charCategorizer(t),r=e.doc.lineAt(t),i=t-r.from;if(0==r.length)return q3.cursor(t);0==i?n=1:i==r.length&&(n=-1);let l=i,a=i;n<0?l=D3(r.text,i,!1):a=D3(r.text,i);let s=o(r.text.slice(l,a));for(;l>0;){let e=D3(r.text,l,!1);if(o(r.text.slice(e,l))!=s)break;l=e}for(;a{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},Y6.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&(e.inputState.lastEscPress=Date.now()),!1),V6.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},V6.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Y6.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of e.state.facet(A8))if(n=o(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=e7(e,t),o=i7(t),r=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),r=r.map(e.changes))},get(t,i,l){let a,s=e7(e,t),c=K6(e,s.pos,s.bias,o);if(n.pos!=s.pos&&!i){let t=K6(e,n.pos,n.bias,o),r=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=r1&&(a=function(e,t){for(let n=0;n=t)return q3.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(r,s.pos))?a:l?r.addRange(c):q3.create([c])}}}(e,t)),n){let o=!e.hasFocus;e.inputState.startMouseSelection(new X6(e,t,n,o)),o&&e.observer.ignore((()=>z5(e.contentDOM)));let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let G6=(e,t)=>e>=t.top&&e<=t.bottom,q6=(e,t,n)=>G6(t,n)&&e>=n.left&&e<=n.right;function J6(e,t,n,o){let r=v8.find(e.docView,t);if(!r)return 1;let i=t-r.posAtStart;if(0==i)return 1;if(i==r.length)return-1;let l=r.coordsAt(i,-1);if(l&&q6(n,o,l))return-1;let a=r.coordsAt(i,1);return a&&q6(n,o,a)?1:l&&G6(o,l)?-1:1}function e7(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:J6(e,n,t.clientX,t.clientY)}}const t7=r8.ie&&r8.ie_version<=11;let n7=null,o7=0,r7=0;function i7(e){if(!t7)return e.detail;let t=n7,n=r7;return n7=e,r7=Date.now(),o7=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(o7+1)%3:1}function l7(e,t,n,o){if(!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,l=o&&i&&function(e,t){let n=e.state.facet(E8);return n.length?n[0](t):r8.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,a={from:r,insert:n},s=e.state.changes(l?[l,a]:a);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(r,-1),head:s.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Y6.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let o=e.docView.nearest(t.target);if(o&&o.isWidget){let e=o.posAtStart,t=e+o.length;(e>=n.to||t<=n.from)&&(n=q3.range(e,t))}}let{inputState:o}=e;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1},Y6.dragend=e=>(e.inputState.draggedContent=null,!1),Y6.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&l7(e,t,o.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(o[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return l7(e,t,n,!0),!0}return!1},Y6.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=Z6?null:t.clipboardData;return n?(U6(e,n.getData("text/plain")||n.getData("text/uri-text")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),U6(e,n.value)}),50)}(e),!1)};let a7=null;Y6.copy=Y6.cut=(e,t)=>{let{text:n,ranges:o,linewise:r}=function(e){let t=[],n=[],o=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:o}of e.selection.ranges){let i=e.doc.lineAt(o);i.number>r&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),r=i.number}o=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:o}}(e.state);if(!n&&!r)return!1;a7=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=Z6?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=t,o.focus(),o.selectionEnd=t.length,o.selectionStart=0,setTimeout((()=>{o.remove(),e.focus()}),50)}(e,n),!1)};const s7=T4.define();function c7(e,t){let n=[];for(let o of e.facet(B8)){let r=o(e,t);r&&n.push(r)}return n?e.update({effects:n,annotations:s7.of(!0)}):null}function u7(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=c7(e.state,t);n?e.dispatch(n):e.update([])}}),10)}V6.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),u7(e)},V6.blur=e=>{e.observer.clearSelectionRange(),u7(e)},V6.compositionstart=V6.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0)},V6.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,r8.chrome&&r8.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50)},V6.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Y6.beforeinput=(e,t)=>{var n;let o;if(r8.chrome&&r8.android&&(o=L6.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return!1};const d7=new Set,p7=["pre-wrap","normal","pre-line","break-spaces"];class h7{constructor(e){this.lineWrapping=e,this.doc=O3.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}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 p7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=o,this.lineLength=r,a){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>v7&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return b7.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,o){let r=this,i=n.doc;for(let l=o.length-1;l>=0;l--){let{fromA:a,toA:s,fromB:c,toB:u}=o[l],d=r.lineAt(a,m7.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:r.lineAt(s,m7.ByPosNoHeight,n,0,0);for(u+=p.to-s,s=p.to;l>0&&d.from<=o[l-1].toA;)a=o[l-1].fromA,c=o[l-1].fromB,l--,a2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,o-=r.size}else{if(!(r>2*o))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(o=r&&i(this.blockAt(0,n,o,r))}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more&&this.setHeight(e,o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class O7 extends y7{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,o){return new g7(o,this.length,n,this.height,this.breaks)}replace(e,t,n){let o=n[0];return 1==n.length&&(o instanceof O7||o instanceof w7&&4&o.flags)&&Math.abs(this.length-o.length)<10?(o instanceof w7?o=new O7(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):b7.of(n)}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more?this.setHeight(e,o.heights[o.index++]):(n||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 w7 extends b7{constructor(e){super(e,0)}heightMetrics(e,t){let n,o=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-o+1,l=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(l=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:o,lastLine:r,perLine:n,perChar:l}}blockAt(e,t,n,o){let{firstLine:r,lastLine:i,perLine:l,perChar:a}=this.heightMetrics(t,o);if(t.lineWrapping){let r=o+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),i=t.doc.lineAt(r),s=l+i.length*a,c=Math.max(n,e-s/2);return new g7(i.from,i.length,c,s,0)}{let o=Math.max(0,Math.min(i-r,Math.floor((e-n)/l))),{from:a,length:s}=t.doc.line(r+o);return new g7(a,s,n+l*o,l,0)}}lineAt(e,t,n,o,r){if(t==m7.ByHeight)return this.blockAt(e,n,o,r);if(t==m7.ByPosNoHeight){let{from:t,to:o}=n.doc.lineAt(e);return new g7(t,o-t,0,0,0)}let{firstLine:i,perLine:l,perChar:a}=this.heightMetrics(n,r),s=n.doc.lineAt(e),c=l+s.length*a,u=s.number-i,d=o+l*u+a*(s.from-r-u);return new g7(s.from,s.length,Math.max(o,Math.min(d,o+this.height-c)),c,0)}forEachLine(e,t,n,o,r,i){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:s}=this.heightMetrics(n,r);for(let c=e,u=o;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-l;u+=a*n+s*(e-r-n)}let o=a+s*t.length;i(new g7(t.from,t.length,u,o,0)),u+=o,c=t.to+1}}replace(e,t,n){let o=this.length-t;if(o>0){let e=n[n.length-1];e instanceof w7?n[n.length-1]=new w7(e.length+o):n.push(null,new w7(o-1))}if(e>0){let t=n[0];t instanceof w7?n[0]=new w7(e+t.length):n.unshift(new w7(e-1),null)}return b7.of(n)}decomposeLeft(e,t){t.push(new w7(e-1),null)}decomposeRight(e,t){t.push(null,new w7(this.length-e-1))}updateHeight(e,t=0,n=!1,o){let r=t+this.length;if(o&&o.from<=t+this.length&&o.more){let n=[],i=Math.max(t,o.from),l=-1;for(o.from>t&&n.push(new w7(o.from-t-1).updateHeight(e,t));i<=r&&o.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let r=o.heights[o.index++];-1==l?l=r:Math.abs(r-l)>=v7&&(l=-2);let a=new O7(t,r);a.outdated=!1,n.push(a),i+=t+1}i<=r&&n.push(null,new w7(r-i).updateHeight(e,i));let a=b7.of(n);return(l<0||Math.abs(a.height-this.height)>=v7||Math.abs(l-this.heightMetrics(e,t).perLine)>=v7)&&(e.heightChanged=!0),a}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class S7 extends b7{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,o){let r=n+this.left.height;return el))return s;let c=t==m7.ByPosNoHeight?m7.ByPosNoHeight:m7.ByPos;return a?s.join(this.right.lineAt(l,c,n,i,l)):this.left.lineAt(l,c,n,o,r).join(s)}forEachLine(e,t,n,o,r,i){let l=o+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,i);else{let s=this.lineAt(a,m7.ByPos,n,o,r);e=e&&s.from<=t&&i(s),t>s.to&&this.right.forEachLine(s.to+1,t,n,l,a,i)}}replace(e,t,n){let o=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,n));let r=[];e>0&&this.decomposeLeft(e,r);let i=r.length;for(let l of n)r.push(l);if(e>0&&x7(r,i-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,o=n+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e2*t.size||t.size>2*e.size?b7.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,n=!1,o){let{left:r,right:i}=this,l=t+r.length+this.break,a=null;return o&&o.from<=t+r.length&&o.more?a=r=r.updateHeight(e,t,n,o):r.updateHeight(e,t,n),o&&o.from<=l+i.length&&o.more?a=i=i.updateHeight(e,l,n,o):i.updateHeight(e,l,n),a?this.balanced(r,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function x7(e,t){let n,o;null==e[t]&&(n=e[t-1])instanceof w7&&(o=e[t+1])instanceof w7&&e.splice(t-1,3,new w7(n.length+1+o.length))}class $7{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 e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof O7?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new O7(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=5)&&this.addLineDeco(o,r,i)}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 O7(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new w7(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof O7)return e;let t=new O7(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,n){let o=this.ensureLine();o.length+=n,o.collapsed+=n,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof O7||this.isCovered?(this.writtenTot.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=n.overflow){let n=t.getBoundingClientRect();i=Math.max(i,n.left),l=Math.min(l,n.right),a=Math.max(a,n.top),s=c==e.parentNode?n.bottom:Math.min(s,n.bottom)}c="absolute"==n.position||"fixed"==n.position?t.offsetParent:t.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:i-n.left,right:Math.max(i,l)-n.left,top:a-(n.top+t),bottom:Math.max(a,s)-(n.top+t)}}function P7(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class T7{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new h7(t),this.stateDeco=e.facet(U8).filter((e=>"function"!=typeof e)),this.heightMap=b7.empty().applyChanges(this.stateDeco,O3.empty,this.heightOracle.setDoc(e.doc),[new n6(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=w8.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let o=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>o>=e&&o<=t))){let{from:t,to:n}=this.lineBlockAt(o);e.push(new E7(t,n))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?z7:new B7(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(1==this.scaler.scale?e:j7(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(U8).filter((e=>"function"!=typeof e));let o=e.changedRanges,r=n6.extendWithRanges(o,function(e,t,n){let o=new C7;return U4.compare(e,t,n,o,0),o.changes}(n,this.stateDeco,e?e.changes:W3.empty(this.state.doc.length))),i=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=i&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let s=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),s&&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(N8)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),o=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?r6.RTL:r6.LTR;let i=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=i||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let s=0,c=0;if(l.width&&l.height){let{scaleX:e,scaleY:n}=E5(t,l);this.scaleX==e&&this.scaleY==n||(this.scaleX=e,this.scaleY=n,s|=8,i=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,s|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=8);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=_5(e.scrollDOM);let h=(this.printing?P7:k7)(t,this.paddingTop),f=h.top-this.pixelViewport.top,g=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=l.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,s|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(t)&&(i=!0),i||o.lineWrapping&&Math.abs(v-this.contentDOMWidth)>o.charWidth){let{lineHeight:n,charWidth:l,textHeight:a}=e.docView.measureTextSize();i=n>0&&o.refresh(r,n,l,a,v/l,t),i&&(e.docView.minWidth=0,s|=8)}f>0&&g>0?c=Math.max(f,g):f<0&&g<0&&(c=Math.min(f,g)),o.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?b7.empty().applyChanges(this.stateDeco,O3.empty,this.heightOracle,[new n6(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,i,new f7(n.from,r))}o.heightChanged&&(s|=2)}let b=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(2&s||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,r=this.heightOracle,{visibleTop:i,visibleBottom:l}=this,a=new E7(o.lineAt(i-1e3*n,m7.ByHeight,r,0,0).from,o.lineAt(l+1e3*(1-n),m7.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),l=o.lineAt(e,m7.ByPos,r,0,0);n="center"==t.y?(l.top+l.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e=l+Math.max(10,Math.min(n,250)))&&o>i-2e3&&r>1,i=o<<1;if(this.defaultTextDirection!=r6.LTR&&!n)return[];let l=[],a=(o,i,s,c)=>{if(i-oo&&ee.from>=s.from&&e.to<=s.to&&Math.abs(e.from-o)e.fromt))));if(!p){if(ie.from<=i&&e.to>=i))){let e=t.moveToLineBoundary(q3.cursor(i),!1,!0).head;e>o&&(i=e)}p=new T7(o,i,this.gapSize(s,o,i,c))}l.push(p)};for(let s of this.viewportLines){if(s.lengths.from&&a(s.from,t,s,e),re.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];U4.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||j7(this.heightMap.lineAt(e,m7.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return j7(this.heightMap.lineAt(this.scaler.fromDOM(e),m7.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 j7(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 E7{constructor(e,t){this.from=e,this.to=t}}function A7(e,t,n){let o=[],r=e,i=0;return U4.spans(n,e,t,{span(){},point(e,t){e>r&&(o.push({from:r,to:e}),i+=e-r),r=t}},20),r=1)return t[t.length-1].to;let o=Math.floor(e*n);for(let r=0;;r++){let{from:e,to:n}=t[r],i=n-e;if(o<=i)return e+o;o-=i}}function R7(e,t){let n=0;for(let{from:o,to:r}of e.ranges){if(t<=r){n+=t-o;break}n+=r-o}return n/e.total}const z7={toDOM:e=>e,fromDOM:e=>e,scale:1};class B7{constructor(e,t,n){let o=0,r=0,i=0;this.viewports=n.map((({from:n,to:r})=>{let i=t.lineAt(n,m7.ByPos,e,0,0).top,l=t.lineAt(r,m7.ByPos,e,0,0).bottom;return o+=l-i,{from:n,to:r,top:i,bottom:l,domTop:0,domBottom:0}})),this.scale=(7e6-o)/(t.height-o);for(let l of this.viewports)l.domTop=i+(l.top-r)*this.scale,i=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,o=0;;t++){let r=tj7(e,t))):e._content)}const N7=t4.define({combine:e=>e.join(" ")}),_7=t4.define({combine:e=>e.indexOf(!0)>-1}),Q7=p5.newName(),L7=p5.newName(),H7=p5.newName(),F7={"&light":"."+L7,"&dark":"."+H7};function W7(e,t,n){return new p5(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const X7=W7("."+Q7,{"&":{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"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",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"}},F7),Y7="￿";class V7{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(F4.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Y7}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let o=e;;){this.findPointBefore(n,o);let e=this.text.length;this.readNode(o);let r=o.nextSibling;if(r==t)break;let i=H5.get(o),l=H5.get(r);(i&&l?i.breakAfter:(i?i.breakAfter:U7(o))||U7(r)&&("BR"!=o.nodeName||o.cmIgnore)&&this.text.length>e)&&this.lineBreak(),o=r}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let r,i=-1,l=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(r=o.exec(t))&&(i=r.index,l=r[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),l>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=l-1);n=i+l}}readNode(e){if(e.cmIgnore)return;let t=H5.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Z7(e,n.node,n.offset)?t:0))}}function Z7(e,t,n){for(;;){if(!t||n-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=r||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new K7(n,o)),r==n&&i==o||t.push(new K7(r,i))),t}(e),n=new V7(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,o=2==e.length?e[1].pos:n;return n>-1&&o>-1?q3.single(n+t,o+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!S5(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),o=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!S5(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset);this.newSel=q3.single(o,n)}}}function q7(e,t){let n,{newSel:o}=t,r=e.state.selection.main,i=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=r.from,s=null;(8===i||r8.android&&t.text.length0&&a>0&&e.charCodeAt(l-1)==t.charCodeAt(a-1);)l--,a--;return"end"==o&&(n-=l+Math.max(0,i-Math.min(l,a))-i),l=l?i-n:0,a=i+(a-l),l=i):a=a?i-n:0,l=i+(l-a),a=i),{from:i,toA:l,toB:a}}(e.state.doc.sliceString(o,l,Y7),t.text,a-o,s);c&&(r8.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Y7+Y7&&c.toB--,n={from:o+c.from,to:o+c.toA,insert:O3.of(t.text.slice(c.from,c.toB).split(Y7))})}else o&&(!e.hasFocus&&e.state.facet(H8)||o.main.eq(r))&&(o=null);if(!n&&!o)return!1;if(!n&&t.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:(r8.mac||r8.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(o&&2==n.insert.length&&(o=q3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:O3.of([" "])}):r8.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(o&&(o=q3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:O3.of([" "])}),n){if(r8.ios&&e.inputState.flushIOSKey())return!0;if(r8.android&&(n.from==r.from&&n.to==r.to&&1==n.insert.length&&2==n.insert.lines&&j5(e.contentDOM,"Enter",13)||(n.from==r.from-1&&n.to==r.to&&0==n.insert.length||8==i&&n.insert.lengthr.head)&&j5(e.contentDOM,"Backspace",8)||n.from==r.from&&n.to==r.to+1&&0==n.insert.length&&j5(e.contentDOM,"Delete",46)))return!0;let t,l=n.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>t||(t=function(e,t,n){let o,r=e.state,i=r.selection.main;if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.fromt.to?r.sliceDoc(t.to,i.to):"";o=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+l))}else{let l=r.changes(t),a=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=i.to&&t.to>=i.to-10){let s,c=e.state.sliceDoc(t.from,t.to),u=n&&x6(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);s={from:u.from,to:u.to-e}}else s=e.state.doc.lineAt(i.head);let d=i.to-t.to,p=i.to-i.from;o=r.changeByRange((n=>{if(n.from==i.from&&n.to==i.to)return{changes:l,range:a||n.map(l)};let o=n.to-d,u=o-c.length;if(n.to-n.from!=p||e.state.sliceDoc(u,o)!=c||n.to>=s.from&&n.from<=s.to)return{range:n};let h=r.changes({from:u,to:o,insert:t.insert}),f=n.to-i.to;return{changes:h,range:a?q3.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(h)}}))}else o={changes:l,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:l,scrollIntoView:!0})}(e,n,o));return e.state.facet(z8).some((t=>t(e,n.from,n.to,l,a)))||e.dispatch(a()),!0}if(o&&!o.main.eq(r)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:t,userEvent:n}),!0}return!1}const J7={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},e9=r8.ie&&r8.ie_version<=11;class t9{constructor(e){this.view=e,this.active=!1,this.selectionRange=new A5,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 e of t)this.queue.push(e);(r8.ie&&r8.ie_version<=11||r8.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),e9&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.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((e=>{e.length>0&&e[e.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,n)=>t!=e[n])))){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:n}=this,o=this.selectionRange;if(n.state.facet(H8)?n.root.activeElement!=this.dom:!x5(n.dom,o))return;let r=o.anchorNode&&n.docView.nearest(o.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(r8.ie&&r8.ie_version<=11||r8.android&&r8.chrome)&&!n.state.selection.main.empty&&o.focusNode&&C5(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=r8.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e){let t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let o=t.startContainer,r=t.startOffset,i=t.endContainer,l=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return C5(a.node,a.offset,i,l)&&([o,r,i,l]=[i,l,o,r]),{anchorNode:o,anchorOffset:r,focusNode:i,focusOffset:l}}(this.view)||w5(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=x5(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&j5(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(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,n=-1,o=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(o=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:o}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),o=this.selectionChanged&&x5(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new G7(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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 n=this.view.state,o=q7(this.view,t);return this.view.state==n&&this.view.update([]),o}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=n9(t,e.previousSibling||e.target.previousSibling,-1),o=n9(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{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,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let o of this.scrollTargets)o.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 n9(e,t,n){for(;t;){let o=H5.get(t);if(o&&o.parent==e)return o;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}class o9{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.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach((e=>t(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new I7(e.state||F4.create(e)),e.scrollTo&&e.scrollTo.is(Q8)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(W8).map((e=>new Y8(e)));for(let n of this.plugins)n.update(this);this.observer=new t9(this),this.inputState=new _6(this),this.inputState.ensureHandlers(this.plugins),this.docView=new w6(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=1==e.length&&e[0]instanceof A4?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,o=!1,r=this.state;for(let d of e){if(d.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=d.state}if(this.destroyed)return void(this.viewState.state=r);let i=this.hasFocus,l=0,a=null;e.some((e=>e.annotation(s7)))?(this.inputState.notifiedFocused=i,l=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,a=c7(r,i),a||(l=1));let s=this.observer.delayedAndroidKey,c=null;if(s?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(F4.phrases)!=this.state.facet(F4.phrases))return this.setState(r);t=o6.create(this,r,e),t.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new _8(e.empty?e:q3.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(Q8)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=l9.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(t6)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(N7)!=t.state.facet(N7)&&(this.viewState.mustMeasureContent=!0),(n||o||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let d of this.state.facet(R8))try{d(t)}catch(Fpe){L8(this.state,Fpe,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!q7(this,c)&&s.force&&j5(this.contentDOM,s.key,s.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new I7(e),this.plugins=e.facet(W8).map((e=>new Y8(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new w6(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(W8),n=e.state.facet(W8);if(t!=n){let o=[];for(let r of n){let n=t.indexOf(r);if(n<0)o.push(new Y8(r));else{let t=this.plugins[n];t.mustUpdate=e,o.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,o=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:i}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(_5(n))r=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(o);r=e.from,i=e.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5)break;let a=[];4&l||([this.measureRequests,a]=[a,this.measureRequests]);let s=a.map((e=>{try{return e.read(this)}catch(Fpe){return L8(this.state,Fpe),i9}})),c=o6.create(this,this.state,[]),u=!1;c.flags|=l,t?t.flags|=l:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c));for(let e=0;e1||e<-1){o+=e,n.scrollTop=o/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(R8))l(t)}get themeClasses(){return Q7+" "+(this.state.facet(_7)?H7:L7)+" "+this.state.facet(N7)}updateAttrs(){let e=a9(this,V8,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(H8)?"true":"false",class:"cm-content",style:`${r8.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),a9(this,Z8,t);let n=this.observer.ignore((()=>{let n=g8(this.contentDOM,this.contentAttrs,t),o=g8(this.dom,this.editorAttrs,e);return n||o}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(o9.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(t6);let e=this.state.facet(o9.cspNonce);p5.mount(this.root,this.styleModules.concat(X7).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&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(null!=e.key)for(let t=0;tt.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,n){return N6(this,e,B6(this,e,t,n))}moveByGroup(e,t){return N6(this,e,B6(this,e,t,(t=>function(e,t,n){let o=e.state.charCategorizer(t),r=o(n);return e=>{let t=o(e);return r==_4.Space&&(r=t),r==t}}(this,e.head,t))))}moveToLineBoundary(e,t,n=!0){return function(e,t,n,o){let r=z6(e,t.head),i=o&&r.type==O8.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),o=e.textDirectionAt(r.from),l=e.posAtCoords({x:n==(o==r6.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=l)return q3.cursor(l,n?-1:1)}return q3.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return N6(this,e,function(e,t,n,o){let r=t.head,i=n?1:-1;if(r==(n?e.state.doc.length:0))return q3.cursor(r,t.assoc);let l,a=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-s.left),l=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(s.right-s.left,e.defaultCharacterWidth*(r-t.from))),l=(i<0?t.top:t.bottom)+u}let d=s.left+a,p=null!=o?o:e.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let t=l+(p+h)*i,n=D6(e,{x:d,y:t},!1,i);if(ts.bottom||(i<0?nr)){let o=e.docView.coordsForChar(n),r=!o||t0)}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(j8)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>r9)return b6(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||f6(r.isolates,t=q8(this,e.from,e.to))))return r.order;t||(t=q8(this,e.from,e.to));let o=function(e,t,n){if(!e)return[new h6(0,0,t==l6?1:0)];if(t==i6&&!n.length&&!p6.test(e))return b6(e.length);if(n.length)for(;e.length>g6.length;)g6[g6.length]=256;let o=[],r=t==i6?0:1;return v6(e,r,r,n,0,e.length,o),o}(e.text,n,t);return this.bidiCache.push(new l9(e.from,e.to,n,t,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||r8.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{z5(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Q8.of(new _8("number"==typeof e?q3.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Q8.of(new _8(q3.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return X8.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return X8.define((()=>({})),{eventObservers:e})}static theme(e,t){let n=p5.newName(),o=[N7.of(n),t6.of(W7(`.${n}`,e))];return t&&t.dark&&o.push(_7.of(!0)),o}static baseTheme(e){return f4.lowest(t6.of(W7("."+Q7,e,F7)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),o=n&&H5.get(n)||H5.get(e);return(null===(t=null==o?void 0:o.rootView)||void 0===t?void 0:t.view)||null}}o9.styleModule=t6,o9.inputHandler=z8,o9.focusChangeEffect=B8,o9.perLineTextDirection=j8,o9.exceptionSink=D8,o9.updateListener=R8,o9.editable=H8,o9.mouseSelectionStyle=A8,o9.dragMovesSelection=E8,o9.clickAddsSelectionRange=I8,o9.decorations=U8,o9.atomicRanges=K8,o9.bidiIsolatedRanges=G8,o9.scrollMargins=J8,o9.darkTheme=_7,o9.cspNonce=t4.define({combine:e=>e.length?e[0]:""}),o9.contentAttributes=Z8,o9.editorAttributes=V8,o9.lineWrapping=o9.contentAttributes.of({class:"cm-lineWrapping"}),o9.announce=E4.define();const r9=4096,i9={};class l9{constructor(e,t,n,o,r,i){this.from=e,this.to=t,this.dir=n,this.isolates=o,this.fresh=r,this.order=i}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let n=[],o=e.length?e[e.length-1].dir:r6.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=o[r],i="function"==typeof t?t(e):t;i&&p8(i,n)}return n}const s9=r8.mac?"mac":r8.windows?"win":r8.linux?"linux":"key";function c9(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const u9=f4.default(o9.domEventHandlers({keydown:(e,t)=>g9(h9(t.state),e,t,"editor")})),d9=t4.define({enables:u9}),p9=new WeakMap;function h9(e){let t=e.facet(d9),n=p9.get(t);return n||p9.set(t,n=function(e,t=s9){let n=Object.create(null),o=Object.create(null),r=(e,t)=>{let n=o[e];if(null==n)o[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,o,i,l,a)=>{var s,c;let u=n[e]||(n[e]=Object.create(null)),d=o.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let o,r,i,l,a=n[n.length-1];"Space"==a&&(a=" ");for(let s=0;s{let o=f9={view:t,prefix:n,scope:e};return setTimeout((()=>{f9==o&&(f9=null)}),4e3),!0}]})}let p=d.join(" ");r(p,!1);let h=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(s=u._any)||void 0===s?void 0:s.run)||void 0===c?void 0:c.slice())||[]});i&&h.run.push(i),l&&(h.preventDefault=!0),a&&(h.stopPropagation=!0)};for(let l of e){let e=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let t in e)e[t].run.push(l.any)}let o=l[t]||l.key;if(o)for(let t of e)i(t,o,l.run,l.preventDefault,l.stopPropagation),l.shift&&i(t,"Shift-"+o,l.shift,l.preventDefault,l.stopPropagation)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let f9=null;function g9(e,t,n,o){let r=function(e){var t=!(v5&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||b5&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?m5:g5)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=Q3(N3(r,0))==r.length&&" "!=r,l="",a=!1,s=!1,c=!1;f9&&f9.view==n&&f9.scope==o&&(l=f9.prefix+" ",F6.indexOf(t.keyCode)<0&&(s=!0,f9=null));let u,d,p=new Set,h=e=>{if(e){for(let o of e.run)if(!p.has(o)&&(p.add(o),o(n,t)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),s=!0)}return!1},f=e[o];return f&&(h(f[l+c9(r,t,!i)])?a=!0:i&&(t.altKey||t.metaKey||t.ctrlKey)&&!(r8.windows&&t.ctrlKey&&t.altKey)&&(u=g5[t.keyCode])&&u!=r?(h(f[l+c9(u,t,!0)])||t.shiftKey&&(d=m5[t.keyCode])!=r&&d!=u&&h(f[l+c9(d,t,!1)]))&&(a=!0):i&&t.shiftKey&&h(f[l+c9(r,t,!0)])&&(a=!0),!a&&h(f._any)&&(a=!0)),s&&(a=!0),a&&c&&t.stopPropagation(),a}class m9{constructor(e,t,n,o,r){this.className=e,this.left=t,this.top=n,this.width=o,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(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,n){if(n.empty){let o=e.coordsAtPos(n.head,n.assoc||1);if(!o)return[];let r=v9(e);return[new m9(t,o.left-r.left,o.top-r.top,null,o.bottom-o.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let o=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),i=e.textDirection==r6.LTR,l=e.contentDOM,a=l.getBoundingClientRect(),s=v9(e),c=l.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=a.right-(u?parseInt(u.paddingRight):0),h=z6(e,o),f=z6(e,r),g=h.type==O8.Text?h:null,m=f.type==O8.Text?f:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=b9(e,o,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=b9(e,r,m)),g&&m&&g.from==m.from)return b(y(n.from,n.to,g));{let t=g?y(n.from,null,g):O(h,!1),o=m?y(null,n.to,m):O(f,!0),r=[];return(g||h).to<(m||f).from-(g&&m?1:0)||h.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2c&&i.from=r)break;a>o&&s(Math.max(e,o),null==t&&e<=c,Math.min(a,r),null==n&&a>=u,l.dir)}if(o=i.to+1,o>=r)break}return 0==a.length&&s(c,null==t,u,null==n,e.textDirection),{top:r,bottom:l,horizontal:a}}function O(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function v9(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==r6.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function b9(e,t,n){let o=q3.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(o,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(o,!0,!0).from),type:O8.Text}}class y9{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(O9)!=e.state.facet(O9)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(O9);for(;t{return n=e,o=this.drawn[t],!(n.constructor==o.constructor&&n.eq(o));var n,o}))){let t=this.dom.firstChild,n=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[n].constructor&&o.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(o.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const O9=t4.define();function w9(e){return[X8.define((t=>new y9(t,e))),O9.of(e)]}const S9=!r8.ios,x9=t4.define({combine:e=>W4(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function $9(e={}){return[x9.of(e),k9,T9,I9,N8.of(!0)]}function C9(e){return e.startState.facet(x9)!=e.state.facet(x9)}const k9=w9({above:!0,markers(e){let{state:t}=e,n=t.facet(x9),o=[];for(let r of t.selection.ranges){let i=r==t.selection.main;if(r.empty?!i||S9:n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:q3.cursor(r.head,r.head>r.anchor?-1:1);for(let r of m9.forRange(e,t,n))o.push(r)}}return o},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=C9(e);return n&&P9(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){P9(t.state,e)},class:"cm-cursorLayer"});function P9(e,t){t.style.animationDuration=e.facet(x9).cursorBlinkRate+"ms"}const T9=w9({above:!1,markers:e=>e.state.selection.ranges.map((t=>t.empty?[]:m9.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t))),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||C9(e),class:"cm-selectionLayer"}),M9={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};S9&&(M9[".cm-line"].caretColor="transparent !important",M9[".cm-content"]={caretColor:"transparent !important"});const I9=f4.highest(o9.theme(M9)),E9=E4.define({map:(e,t)=>null==e?null:t.mapPos(e)}),A9=s4.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(E9)?t.value:e),e))}),D9=X8.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(A9);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(A9)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(A9),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let o=e.scrollDOM.getBoundingClientRect();return{left:n.left-o.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-o.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(A9)!=e&&this.view.dispatch({effects:E9.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function R9(e,t,n,o,r){t.lastIndex=0;for(let i,l=e.iterRange(n,o),a=n;!l.next().done;a+=l.value.length)if(!l.lineBreak)for(;i=t.exec(l.value);)r(a+i.index,i)}class z9{constructor(e){const{regexp:t,decoration:n,decorate:o,boundary:r,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,o)this.addMatch=(e,t,n,r)=>o(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,o,r)=>{let i=n(e,t,o);i&&r(o,o+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,o,r)=>r(o,o+e[0].length,n)}this.boundary=r,this.maxLength=i}createDeco(e){let t=new K4,n=t.add.bind(t);for(let{from:o,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let o=[];for(let{from:r,to:i}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),o.length&&o[o.length-1].to>=r?o[o.length-1].to=i:o.push({from:r,to:i});return o}(e,this.maxLength))R9(e.state.doc,this.regexp,o,r,((t,o)=>this.addMatch(o,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,o=-1;return e.docChanged&&e.changes.iterChanges(((t,r,i,l)=>{l>e.view.viewport.from&&i1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,t.map(e.changes),n,o):t}updateRange(e,t,n,o){for(let r of e.visibleRanges){let i=Math.max(r.from,n),l=Math.min(r.to,o);if(l>i){let n=e.state.doc.lineAt(i),o=n.ton.from;i--)if(this.boundary.test(n.text[i-1-n.from])){a=i;break}for(;lu.push(n.range(e,t));if(n==o)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,e,t,d)));t=t.update({filterFrom:a,filterTo:s,filter:(e,t)=>es,add:u})}}return t}}const B9=null!=/x/.unicode?"gu":"g",j9=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",B9),N9={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 _9=null;const Q9=t4.define({combine(e){let t=W4(e,{render:null,specialChars:j9,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==_9&&"undefined"!=typeof document&&document.body){let t=document.body.style;_9=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return _9||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,B9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,B9)),t}});function L9(e={}){return[Q9.of(e),H9||(H9=X8.fromClass(class{constructor(e){this.view=e,this.decorations=w8.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Q9)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new z9({regexp:e.specialChars,decoration:(t,n,o)=>{let{doc:r}=n.state,i=N3(t[0],0);if(9==i){let e=r.lineAt(o),t=n.state.tabSize,i=a5(e.text,t,o-e.from);return w8.replace({widget:new W9((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=w8.replace({widget:new F9(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Q9);e.startState.facet(Q9)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let H9=null;class F9 extends y8{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(n=this.code)>=32?"•":10==n?"␤":String.fromCharCode(9216+n);var n;let o=e.state.phrase("Control character")+" "+(N9[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,o,t);if(r)return r;let i=document.createElement("span");return i.textContent=t,i.title=o,i.setAttribute("aria-label",o),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class W9 extends y8{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const X9=w8.line({class:"cm-activeLine"}),Y9=X8.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let o of e.state.selection.ranges){let r=e.lineBlockAt(o.head);r.from>t&&(n.push(X9.range(r.from)),t=r.from)}return w8.set(n)}},{decorations:e=>e.decorations});class V9 extends y8{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?$5(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),o=M5(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return o.bottom-o.top>1.5*r?{left:o.left,right:o.right,top:o.top,bottom:o.top+r}:o}ignoreEvent(){return!1}}const Z9=2e3;function U9(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(n),r=n-o.from,i=r>Z9?-1:r==o.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):a5(o.text,e.state.tabSize,n-o.from);return{line:o.number,col:i,off:r}}function K9(e,t){let n=U9(e,t),o=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},o=o.map(e.changes)}},get(t,r,i){let l=U9(e,t);if(!l)return o;let a=function(e,t,n){let o=Math.min(t.line,n.line),r=Math.max(t.line,n.line),i=[];if(t.off>Z9||n.off>Z9||t.col<0||n.col<0){let l=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=o;t<=r;t++){let n=e.doc.line(t);n.length<=a&&i.push(q3.range(n.from+l,n.to+a))}}else{let l=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=o;t<=r;t++){let n=e.doc.line(t),o=s5(n.text,l,e.tabSize,!0);if(o<0)i.push(q3.cursor(n.to));else{let t=s5(n.text,a,e.tabSize);i.push(q3.range(n.from+o,n.from+t))}}}return i}(e.state,n,l);return a.length?i?q3.create(a.concat(o.ranges)):q3.create(a):o}}:null}function G9(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return o9.mouseSelectionStyle.of(((e,n)=>t(n)?K9(e,n):null))}const q9={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},J9={style:"cursor: crosshair"};function eee(e={}){let[t,n]=q9[e.key||"Alt"],o=X8.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[o,o9.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.isDown)?J9:null}))]}const tee="-10000px";class nee{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(n)}update(e,t){var n;let o=e.state.facet(this.facet),r=o.filter((e=>e));if(o===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],l=t?[]:null;for(let a=0;at[n]=e)),t.length=l.length),this.input=o,this.tooltips=r,this.tooltipViews=i,!0}}function oee(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const ree=t4.define({combine:e=>{var t,n,o;return{position:r8.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(o=e.find((e=>e.tooltipSpace)))||void 0===o?void 0:o.tooltipSpace)||oee}}}),iee=new WeakMap,lee=X8.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(ree);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new nee(e,cee,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.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 e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,o=e.state.facet(ree);if(o.position!=this.position&&!this.madeAbsolute){this.position=o.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(o.parent!=this.parent){this.parent&&this.container.remove(),this.parent=o.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=tee,t.dom.style.left="0px",this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),null===(e=n.destroy)||void 0===e||e.call(n);this.parent&&this.container.remove(),null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,o=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(r8.gecko)o=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==tee&&"0px"==e.style.left){let t=e.getBoundingClientRect();o=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(o||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,n=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(ree).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:o}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:n,space:o,scaleX:r,scaleY:i}=e,l=[];for(let a=0;a=Math.min(n.bottom,o.bottom)||d.rightMath.min(n.right,o.right)+.1){u.style.top=tee;continue}let h=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=h?7:0,g=p.right-p.left,m=null!==(t=iee.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||see,b=this.view.textDirection==r6.LTR,y=p.width>o.right-o.left?b?o.left:o.right-p.width:b?Math.min(d.left-(h?14:0)+v.x,o.right-g):Math.max(o.left,d.left-g+(h?14:0)-v.x),O=this.above[a];!s.strictSide&&(O?d.top-(p.bottom-p.top)-v.yo.bottom)&&O==o.bottom-d.bottom>d.top-o.top&&(O=this.above[a]=!O);let w=(O?d.top-o.top:o.bottom-d.bottom)-f;if(wy&&e.topS&&(S=O?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(S-e.parent.top)/i+"px",u.style.left=(y-e.parent.left)/r+"px"):(u.style.top=S/i+"px",u.style.left=y/r+"px"),h){let e=d.left+(b?v.x:-v.x)-(y+14-7);h.style.left=e/r+"px"}!0!==c.overlap&&l.push({left:y,top:S,right:x,bottom:S+m}),u.classList.toggle("cm-tooltip-above",O),u.classList.toggle("cm-tooltip-below",!O),c.positioned&&c.positioned(e.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 e of this.manager.tooltipViews)e.dom.style.top=tee}},{eventObservers:{scroll(){this.maybeMeasure()}}}),aee=o9.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:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),see={x:0,y:0},cee=t4.define({enables:[lee,aee]}),uee=t4.define();class dee{static create(e){return new dee(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new nee(e,uee,(e=>this.createHostedView(e)))}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)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let o=n[e];if(void 0!==o)if(void 0===t)t=o;else if(t!==o)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 pee=cee.compute([uee],(e=>{let t=e.facet(uee).filter((e=>e));return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:dee.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class hee{constructor(e,t,n,o,r){this.view=e,this.source=t,this.field=n,this.setHover=o,this.hoverTime=r,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;en.bottom||t.xn.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(o)).find((e=>e.from<=o&&e.to>=o)),l=i&&i.dir==r6.RTL?-1:1;r=t.x{this.pending==t&&(this.pending=null,n&&e.dispatch({effects:this.setHover.of(n)}))}),(t=>L8(e.state,t,"hover tooltip")))}else i&&e.dispatch({effects:this.setHover.of(i)})}get tooltip(){let e=this.view.plugin(lee),t=e?e.manager.tooltips.findIndex((e=>e.create==dee.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}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{active:n,tooltip:o}=this;if(n&&o&&!function(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-4&&t.clientX<=n.right+4&&t.clientY>=n.top-4&&t.clientY<=n.bottom+4}(o.dom,e)||this.pending){let{pos:o}=n||this.pending,r=null!==(t=null==n?void 0:n.end)&&void 0!==t?t:o;(o==r?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,o,r,i){let l=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(l.left>o||l.rightr||Math.min(l.bottom,a)=t&&s<=n}(this.view,o,r,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of(null)})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function fee(e,t={}){let n=E4.define(),o=s4.define({create:()=>null,update(e,o){if(e&&(t.hideOnChange&&(o.docChanged||o.selection)||t.hideOn&&t.hideOn(o,e)))return null;if(e&&o.docChanged){let t=o.changes.mapPos(e.pos,-1,H3.TrackDel);if(null==t)return null;let n=Object.assign(Object.create(null),e);n.pos=t,null!=e.end&&(n.end=o.changes.mapPos(e.end)),e=n}for(let t of o.effects)t.is(n)&&(e=t.value),t.is(mee)&&(e=null);return e},provide:e=>uee.from(e)});return[o,X8.define((r=>new hee(r,e,o,n,t.hoverTime||300))),pee]}function gee(e,t){let n=e.plugin(lee);if(!n)return null;let o=n.manager.tooltips.indexOf(t);return o<0?null:n.manager.tooltipViews[o]}const mee=E4.define(),vee=t4.define({combine(e){let t,n;for(let o of e)t=t||o.topContainer,n=n||o.bottomContainer;return{topContainer:t,bottomContainer:n}}});function bee(e,t){let n=e.plugin(yee),o=n?n.specs.indexOf(t):-1;return o>-1?n.panels[o]:null}const yee=X8.fromClass(class{constructor(e){this.input=e.state.facet(See),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(vee);this.top=new Oee(e,!0,t.topContainer),this.bottom=new Oee(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(vee);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Oee(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Oee(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(See);if(n!=this.input){let t=n.filter((e=>e)),o=[],r=[],i=[],l=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),l.push(t)):(t=this.panels[a],t.update&&t.update(e)),o.push(t),(t.top?r:i).push(t)}this.specs=t,this.panels=o,this.top.sync(r),this.bottom.sync(i);for(let e of l)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let o of this.panels)o.update&&o.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>o9.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class Oee{constructor(e,t,n){this.view=e,this.top=t,this.container=n,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(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));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 e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=wee(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=wee(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 wee(e){let t=e.nextSibling;return e.remove(),t}const See=t4.define({enables:yee});class xee extends X4{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}xee.prototype.elementClass="",xee.prototype.toDOM=void 0,xee.prototype.mapMode=H3.TrackBefore,xee.prototype.startSide=xee.prototype.endSide=-1,xee.prototype.point=!0;const $ee=t4.define(),Cee={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>U4.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},kee=t4.define();function Pee(e){return[Mee(),kee.of(Object.assign(Object.assign({},Cee),e))]}const Tee=t4.define({combine:e=>e.some((e=>e))});function Mee(e){let t=[Iee];return e&&!1===e.fixed&&t.push(Tee.of(!0)),t}const Iee=X8.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.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=e.state.facet(kee).map((t=>new Ree(e,t)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!e.state.facet(Tee),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,o=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(o<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Tee)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=U4.iter(this.view.state.facet($ee),this.view.viewport.from),o=[],r=this.gutters.map((e=>new Dee(e,this.view.viewport,-this.view.documentPadding.top)));for(let i of this.view.viewportLineBlocks)if(o.length&&(o=[]),Array.isArray(i.type)){let e=!0;for(let t of i.type)if(t.type==O8.Text&&e){Aee(n,o,t.from);for(let e of r)e.line(this.view,t,o);e=!1}else if(t.widget)for(let e of r)e.widget(this.view,t)}else if(i.type==O8.Text){Aee(n,o,i.from);for(let e of r)e.line(this.view,i,o)}else if(i.widget)for(let e of r)e.widget(this.view,i);for(let i of r)i.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(kee),n=e.state.facet(kee),o=e.docChanged||e.heightChanged||e.viewportChanged||!U4.eq(e.startState.facet($ee),e.state.facet($ee),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(o=!0);else{o=!0;let r=[];for(let o of n){let n=t.indexOf(o);n<0?r.push(new Ree(this.view,o)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return o}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>o9.scrollMargins.of((t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==r6.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null}))});function Eee(e){return Array.isArray(e)?e:[e]}function Aee(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class Dee{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=U4.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:o}=this,r=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==o.elements.length){let t=new zee(e,i,r,n);o.elements.push(t),o.dom.appendChild(t.dom)}else o.elements[this.i].update(e,i,r,n);this.height=t.bottom,this.i++}line(e,t,n){let o=[];Aee(this.cursor,o,t.from),n.length&&(o=o.concat(n));let r=this.gutter.config.lineMarker(e,t,o);r&&o.unshift(r);let i=this.gutter;(0!=o.length||i.config.renderEmptyElements)&&this.addElement(e,t,o)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Ree{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 n in t.domEventHandlers)this.dom.addEventListener(n,(o=>{let r,i=o.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=o.clientY;let l=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,l,o)&&o.preventDefault()}));this.markers=Eee(t.markers(e)),t.initialSpacer&&(this.spacer=new zee(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=Eee(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!U4.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class zee{constructor(e,t,n,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,o)}update(e,t,n,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;nW4(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let o in t){let e=n[o],r=t[o];n[o]=e?(t,n,o)=>e(t,n,o)||r(t,n,o):r}return n}})});class Nee extends xee{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function _ee(e,t){return e.state.facet(jee).formatNumber(t,e.state)}const Qee=kee.compute([jee],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Bee),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new Nee(_ee(e,e.state.doc.lineAt(t.from).number)),widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(jee)!=e.state.facet(jee),initialSpacer:e=>new Nee(_ee(e,Hee(e.state.doc.lines))),updateSpacer(e,t){let n=_ee(t.view,Hee(t.view.state.doc.lines));return n==e.number?e:new Nee(n)},domEventHandlers:e.facet(jee).domEventHandlers})));function Lee(e={}){return[jee.of(e),Mee(),Qee]}function Hee(e){let t=9;for(;t{let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.head).from;r>n&&(n=r,t.push(Fee.range(r)))}return U4.of(t)})),Xee=1024;let Yee=0,Vee=class{constructor(e,t){this.from=e,this.to=t}};class Zee{constructor(e={}){this.id=Yee++,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"function"!=typeof e&&(e=Gee.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Zee.closedBy=new Zee({deserialize:e=>e.split(" ")}),Zee.openedBy=new Zee({deserialize:e=>e.split(" ")}),Zee.group=new Zee({deserialize:e=>e.split(" ")}),Zee.contextHash=new Zee({perNode:!0}),Zee.lookAhead=new Zee({perNode:!0}),Zee.mounted=new Zee({perNode:!0});class Uee{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Zee.mounted.id]}}const Kee=Object.create(null);class Gee{constructor(e,t,n,o=0){this.name=e,this.props=t,this.id=n,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):Kee,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new Gee(e.name||"",t,e.id,n);if(e.props)for(let r of e.props)if(Array.isArray(r)||(r=r(o)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}return o}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Zee.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let o of n.split(" "))t[o]=e[n];return e=>{for(let n=e.prop(Zee.group),o=-1;o<(n?n.length:0);o++){let r=t[o<0?e.name:n[o]];if(r)return r}}}}Gee.none=new Gee("",Object.create(null),0,8);class qee{constructor(e){this.types=e;for(let t=0;t=t){let l=new cte(e.tree,e.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(ate(l,t,n,!1))}}return r?fte(r):o}(this,e,t)}iterate(e){let{enter:t,leave:n,from:o=0,to:r=this.length}=e,i=e.mode||0,l=(i&tte.IncludeAnonymous)>0;for(let a=this.cursor(i|tte.IncludeAnonymous);;){let e=!1;if(a.from<=r&&a.to>=o&&(!l&&a.type.isAnonymous||!1!==t(a))){if(a.firstChild())continue;e=!0}for(;e&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;e=!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:Ote(Gee.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new ote(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new ote(Gee.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:o,maxBufferLength:r=Xee,reused:i=[],minRepeatType:l=o.types.length}=e,a=Array.isArray(n)?new rte(n,n.length):n,s=o.types,c=0,u=0;function d(e,t,n,b,y,O){let{id:w,start:S,end:x,size:$}=a,C=u;for(;$<0;){if(a.next(),-1==$){let t=i[w];return n.push(t),void b.push(S-e)}if(-3==$)return void(c=w);if(-4==$)return void(u=w);throw new RangeError(`Unrecognized record size: ${$}`)}let k,P,T=s[w],M=S-e;if(x-S<=r&&(P=m(a.pos-t,y))){let t=new Uint16Array(P.size-P.skip),n=a.pos-P.size,r=t.length;for(;a.pos>n;)r=v(P.start,t,r);k=new ite(t,x-P.start,o),M=P.start-e}else{let e=a.pos-$;a.next();let t=[],n=[],o=w>=l?w:-1,i=0,s=x;for(;a.pos>e;)o>=0&&a.id==o&&a.size>=0?(a.end<=s-r&&(f(t,n,S,i,a.end,s,o,C),i=t.length,s=a.end),a.next()):O>2500?p(S,e,t,n):d(S,e,t,n,o,O+1);if(o>=0&&i>0&&i-1&&i>0){let e=h(T);k=Ote(T,t,n,0,t.length,0,x-S,e,e)}else k=g(T,t,n,x-S,C-x)}n.push(k),b.push(M)}function p(e,t,n,i){let l=[],s=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:o}=a;if(o>4)a.next();else{if(c>-1&&t=0;e-=3)t[n++]=l[e],t[n++]=l[e+1]-r,t[n++]=l[e+2]-r,t[n++]=n;n.push(new ite(t,l[2]-r,o)),i.push(r-e)}}function h(e){return(t,n,o)=>{let r,i,l=0,a=t.length-1;if(a>=0&&(r=t[a])instanceof ote){if(!a&&r.type==e&&r.length==o)return r;(i=r.prop(Zee.lookAhead))&&(l=n[a]+r.length+i)}return g(e,t,n,o,l)}}function f(e,t,n,r,i,l,a,s){let c=[],u=[];for(;e.length>r;)c.push(e.pop()),u.push(t.pop()+n-i);e.push(g(o.types[a],c,u,l-i,s-l)),t.push(i-n)}function g(e,t,n,o,r=0,i){if(c){let e=[Zee.contextHash,c];i=i?[e].concat(i):[e]}if(r>25){let e=[Zee.lookAhead,r];i=i?[e].concat(i):[e]}return new ote(e,t,n,o,i)}function m(e,t){let n=a.fork(),o=0,i=0,s=0,c=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=o,u.start=i,u.skip=s,s+=4,o+=4,n.next();continue}let a=n.pos-e;if(e<0||a=l?4:0,p=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=l&&(d+=4);n.next()}i=p,o+=e,s+=d}return(t<0||o==e)&&(u.size=o,u.start=i,u.skip=s),u.size>4?u:void 0}function v(e,t,n){let{id:o,start:r,end:i,size:s}=a;if(a.next(),s>=0&&o4){let o=a.pos-(s-4);for(;a.pos>o;)n=v(e,t,n)}t[--n]=l,t[--n]=i-e,t[--n]=r-e,t[--n]=o}else-3==s?c=o:-4==s&&(u=o);return n}let b=[],y=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,b,y,-1,0);let O=null!==(t=e.length)&&void 0!==t?t:b.length?y[0]+b[0].length:0;return new ote(s[e.topID],b.reverse(),y.reverse(),O)}(e)}}ote.empty=new ote(Gee.none,[],[],0);class rte{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 rte(this.buffer,this.index)}}class ite{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Gee.none}toString(){let e=[];for(let t=0;t0));a=i[a+3]);return l}slice(e,t,n){let o=this.buffer,r=new Uint16Array(t-e),i=0;for(let l=e,a=0;l=t&&nt;case 1:return n<=t&&o>t;case 2:return o>t;case 4:return!0}}function ate(e,t,n,o){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;e!=s;e+=t){let s=l[e],c=a[e]+i.from;if(lte(o,n,c,c+s.length))if(s instanceof ite){if(r&tte.ExcludeBuffers)continue;let l=s.findChild(0,s.buffer.length,t,n-c,o);if(l>-1)return new hte(new pte(i,s,e,c),null,l)}else if(r&tte.IncludeAnonymous||!s.type.isAnonymous||vte(s)){let l;if(!(r&tte.IgnoreMounts)&&(l=Uee.get(s))&&!l.overlay)return new cte(l.tree,c,e,i);let a=new cte(s,c,e,i);return r&tte.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?s.children.length-1:0,t,n,o)}}if(r&tte.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)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,n=0){let o;if(!(n&tte.IgnoreOverlays)&&(o=Uee.get(this._tree))&&o.overlay){let n=e-this.from;for(let{from:e,to:r}of o.overlay)if((t>0?e<=n:e=n:r>n))return new cte(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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 ute(e,t,n,o){let r=e.cursor(),i=[];if(!r.firstChild())return i;if(null!=n)for(;!r.type.is(n);)if(!r.nextSibling())return i;for(;;){if(null!=o&&r.type.is(o))return i;if(r.type.is(t)&&i.push(r.node),!r.nextSibling())return null==o?i:[]}}function dte(e,t,n=t.length-1){for(let o=e.parent;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}class pte{constructor(e,t,n,o){this.parent=e,this.buffer=t,this.index=n,this.start=o}}class hte extends ste{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,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new hte(this.context,this,r)}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,n=0){if(n&tte.ExcludeBuffers)return null;let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new hte(this.context,this,r)}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 hte(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 hte(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,o=this.index+4,r=n.buffer[this.index+3];if(r>o){let i=n.buffer[this.index+1];e.push(n.slice(o,r,i)),t.push(0)}return new ote(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function fte(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;in.from||o.to0){if(this.index-1)for(let o=t+e,r=e<0?-1:n._tree.children.length;o!=r;o+=e){let e=n._tree.children[o];if(this.mode&tte.IncludeAnonymous||e instanceof ite||!e.type.isAnonymous||vte(e))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 i=e;i;i=i._parent)if(i.index==o){if(o==this.index)return i;t=i,n=r+1;break e}o=this.stack[--r]}for(let o=n;o=0;r--){if(r<0)return dte(this.node,e,o);let i=n[t.buffer[this.stack[r]]];if(!i.isAnonymous){if(e[o]&&e[o]!=i.name)return!1;o--}}return!0}}function vte(e){return e.children.some((e=>e instanceof ite||!e.type.isAnonymous||vte(e)))}const bte=new WeakMap;function yte(e,t){if(!e.isAnonymous||t instanceof ite||t.type!=e)return 1;let n=bte.get(t);if(null==n){n=1;for(let o of t.children){if(o.type!=e||!(o instanceof ote)){n=1;break}n+=yte(e,o)}bte.set(t,n)}return n}function Ote(e,t,n,o,r,i,l,a,s){let c=0;for(let h=o;h=u)break;f+=t}if(c==r+1){if(f>u){let e=n[r];t(e.children,e.positions,0,e.children.length,o[r]+a);continue}d.push(n[r])}else{let t=o[c-1]+n[c-1].length-h;d.push(Ote(e,n,o,r,c,h,t,null,s))}p.push(h+a-i)}}(t,n,o,r,0),(a||s)(d,p,l)}class wte{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let o=this.map.get(e);o||this.map.set(e,o=new Map),o.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof hte?this.setBuffer(e.context.buffer,e.index,t):e instanceof cte&&this.map.set(e.tree,t)}get(e){return e instanceof hte?this.getBuffer(e.context.buffer,e.index):e instanceof cte?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 Ste{constructor(e,t,n,o,r=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=o,this.open=(r?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let o=[new Ste(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&o.push(r);return o}static applyChanges(e,t,n=128){if(!t.length)return e;let o=[],r=1,i=e.length?e[0]:null;for(let l=0,a=0,s=0;;l++){let c=l=n)for(;i&&i.from=t.from||u<=t.to||s){let e=Math.max(t.from,a)-s,n=Math.min(t.to,u)-s;t=e>=n?null:new Ste(e,n,t.tree,t.offset+s,l>0,!!c)}if(t&&o.push(t),i.to>u)break;i=rnew Vee(e.from,e.to))):[new Vee(0,0)]:[new Vee(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let o=this.startParse(e,t,n);for(;;){let e=o.advance();if(e)return e}}}class $te{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)}}new Zee({perNode:!0});let Cte=0;class kte{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=Cte++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new kte([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new Tte;return t=>t.modified.indexOf(e)>-1?t:Tte.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let Pte=0;class Tte{constructor(){this.instances=[],this.id=Pte++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>{return n.base==e&&(o=t,r=n.modified,o.length==r.length&&o.every(((e,t)=>e==r[t])));var o,r}));if(n)return n;let o=[],r=new kte(o,e,t);for(let l of t)l.instances.push(r);let i=function(e){let t=[[]];for(let n=0;nt.length-e.length))}(t);for(let l of e.set)if(!l.modified.length)for(let e of i)o.push(Tte.get(l,e));return r}}function Mte(e){let t=Object.create(null);for(let n in e){let o=e[n];Array.isArray(o)||(o=[o]);for(let e of n.split(" "))if(e){let n=[],r=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){r=1;break}let o=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!o)throw new RangeError("Invalid path: "+e);if(n.push("*"==o[0]?"":'"'==o[0][0]?JSON.parse(o[0]):o[0]),t+=o[0].length,t==e.length)break;let l=e[t++];if(t==e.length&&"!"==l){r=0;break}if("/"!=l)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let l=n.length-1,a=n[l];if(!a)throw new RangeError("Invalid path: "+e);let s=new Ete(o,r,l>0?n.slice(0,l):null);t[a]=s.sort(t[a])}}return Ite.add(t)}const Ite=new Zee;class Ete{constructor(e,t,n,o){this.tags=e,this.mode=t,this.context=n,this.next=o}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth{let t=r;for(let o of e)for(let e of o.set){let o=n[e.id];if(o){t=t?t+" "+o:o;break}}return t},scope:o}}function Dte(e,t,n,o=0,r=e.length){let i=new Rte(o,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),o,r,"",i.highlighters),i.flush(r)}Ete.empty=new Ete([],2,null);class Rte{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,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,n,o,r){let{type:i,from:l,to:a}=e;if(l>=n||a<=t)return;i.isTop&&(r=this.highlighters.filter((e=>!e.scope||e.scope(i))));let s=o,c=function(e){let t=e.type.prop(Ite);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||Ete.empty,u=function(e,t){let n=null;for(let o of e){let e=o.style(t);e&&(n=n?n+" "+e:e)}return n}(r,c.tags);if(u&&(s&&(s+=" "),s+=u,1==c.mode&&(o+=(o?" ":"")+u)),this.startSpan(Math.max(t,l),s),c.opaque)return;let d=e.tree&&e.tree.prop(Zee.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+l,1),c=this.highlighters.filter((e=>!e.scope||e.scope(d.tree.type))),u=e.firstChild();for(let p=0,h=l;;p++){let f=p=g)&&e.nextSibling()););if(!f||g>n)break;h=f.to+l,h>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+l),Math.min(n,h),"",c),this.startSpan(Math.min(n,h),s))}u&&e.parent()}else if(e.firstChild()){d&&(o="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,o,r),this.startSpan(Math.min(n,e.to),s)}}while(e.nextSibling());e.parent()}}}const zte=kte.define,Bte=zte(),jte=zte(),Nte=zte(jte),_te=zte(jte),Qte=zte(),Lte=zte(Qte),Hte=zte(Qte),Fte=zte(),Wte=zte(Fte),Xte=zte(),Yte=zte(),Vte=zte(),Zte=zte(Vte),Ute=zte(),Kte={comment:Bte,lineComment:zte(Bte),blockComment:zte(Bte),docComment:zte(Bte),name:jte,variableName:zte(jte),typeName:Nte,tagName:zte(Nte),propertyName:_te,attributeName:zte(_te),className:zte(jte),labelName:zte(jte),namespace:zte(jte),macroName:zte(jte),literal:Qte,string:Lte,docString:zte(Lte),character:zte(Lte),attributeValue:zte(Lte),number:Hte,integer:zte(Hte),float:zte(Hte),bool:zte(Qte),regexp:zte(Qte),escape:zte(Qte),color:zte(Qte),url:zte(Qte),keyword:Xte,self:zte(Xte),null:zte(Xte),atom:zte(Xte),unit:zte(Xte),modifier:zte(Xte),operatorKeyword:zte(Xte),controlKeyword:zte(Xte),definitionKeyword:zte(Xte),moduleKeyword:zte(Xte),operator:Yte,derefOperator:zte(Yte),arithmeticOperator:zte(Yte),logicOperator:zte(Yte),bitwiseOperator:zte(Yte),compareOperator:zte(Yte),updateOperator:zte(Yte),definitionOperator:zte(Yte),typeOperator:zte(Yte),controlOperator:zte(Yte),punctuation:Vte,separator:zte(Vte),bracket:Zte,angleBracket:zte(Zte),squareBracket:zte(Zte),paren:zte(Zte),brace:zte(Zte),content:Fte,heading:Wte,heading1:zte(Wte),heading2:zte(Wte),heading3:zte(Wte),heading4:zte(Wte),heading5:zte(Wte),heading6:zte(Wte),contentSeparator:zte(Fte),list:zte(Fte),quote:zte(Fte),emphasis:zte(Fte),strong:zte(Fte),link:zte(Fte),monospace:zte(Fte),strikethrough:zte(Fte),inserted:zte(),deleted:zte(),changed:zte(),invalid:zte(),meta:Ute,documentMeta:zte(Ute),annotation:zte(Ute),processingInstruction:zte(Ute),definition:kte.defineModifier(),constant:kte.defineModifier(),function:kte.defineModifier(),standard:kte.defineModifier(),local:kte.defineModifier(),special:kte.defineModifier()};var Gte;Ate([{tag:Kte.link,class:"tok-link"},{tag:Kte.heading,class:"tok-heading"},{tag:Kte.emphasis,class:"tok-emphasis"},{tag:Kte.strong,class:"tok-strong"},{tag:Kte.keyword,class:"tok-keyword"},{tag:Kte.atom,class:"tok-atom"},{tag:Kte.bool,class:"tok-bool"},{tag:Kte.url,class:"tok-url"},{tag:Kte.labelName,class:"tok-labelName"},{tag:Kte.inserted,class:"tok-inserted"},{tag:Kte.deleted,class:"tok-deleted"},{tag:Kte.literal,class:"tok-literal"},{tag:Kte.string,class:"tok-string"},{tag:Kte.number,class:"tok-number"},{tag:[Kte.regexp,Kte.escape,Kte.special(Kte.string)],class:"tok-string2"},{tag:Kte.variableName,class:"tok-variableName"},{tag:Kte.local(Kte.variableName),class:"tok-variableName tok-local"},{tag:Kte.definition(Kte.variableName),class:"tok-variableName tok-definition"},{tag:Kte.special(Kte.variableName),class:"tok-variableName2"},{tag:Kte.definition(Kte.propertyName),class:"tok-propertyName tok-definition"},{tag:Kte.typeName,class:"tok-typeName"},{tag:Kte.namespace,class:"tok-namespace"},{tag:Kte.className,class:"tok-className"},{tag:Kte.macroName,class:"tok-macroName"},{tag:Kte.propertyName,class:"tok-propertyName"},{tag:Kte.operator,class:"tok-operator"},{tag:Kte.comment,class:"tok-comment"},{tag:Kte.meta,class:"tok-meta"},{tag:Kte.invalid,class:"tok-invalid"},{tag:Kte.punctuation,class:"tok-punctuation"}]);const qte=new Zee;function Jte(e){return t4.define({combine:e?t=>t.concat(e):void 0})}const ene=new Zee;class tne{constructor(e,t,n=[],o=""){this.data=e,this.name=o,F4.prototype.hasOwnProperty("tree")||Object.defineProperty(F4.prototype,"tree",{get(){return rne(this)}}),this.parser=t,this.extension=[hne.of(this),F4.languageData.of(((e,t,n)=>{let o=nne(e,t,n),r=o.type.prop(qte);if(!r)return[];let i=e.facet(r),l=o.type.prop(ene);if(l){let r=o.resolve(t-o.from,n);for(let t of l)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(e,t,n=-1){return nne(e,t,n).type.prop(qte)==this.data}findRegions(e){let t=e.facet(hne);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],o=(e,t)=>{if(e.prop(qte)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(Zee.mounted);if(r){if(r.tree.prop(qte)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(r.overlay){let e=n.length;if(o(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;ne.isTop?t:void 0))]}),e.name)}configure(e,t){return new one(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function rne(e){let t=e.field(tne.state,!1);return t?t.tree:ote.empty}class ine{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 n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let lne=null;class ane{constructor(e,t,n=[],o,r,i,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=o,this.treeLen=r,this.viewport=i,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new ane(e,t,[],ote.empty,0,n,[],null)}startParse(){return this.parser.startParse(new ine(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=ote.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||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(Ste.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=lne;lne=this;try{return e()}finally{lne=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sne(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:o,treeLen:r,viewport:i,skipped:l}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,o,r)=>t.push({fromA:e,toA:n,fromB:o,toB:r}))),n=Ste.applyChanges(n,t),o=ote.empty,r=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){l=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),o=e.mapPos(t.to,-1);ne.from&&(this.fragments=sne(this.fragments,t,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t||(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 xte{createParse(t,n,o){let r=o[0].from,i=o[o.length-1].to;return{parsedPos:r,advance(){let t=lne;if(t){for(let e of o)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new ote(Gee.none,[],[],i-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return lne}}function sne(e,t,n){return Ste.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class cne{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),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new cne(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=ane.create(e.facet(hne).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new cne(n)}}tne.state=s4.define({create:cne.init,update(e,t){for(let n of t.effects)if(n.is(tne.setState))return n.value;return t.startState.facet(hne)!=t.state.facet(hne)?cne.init(t.state):e.apply(t)}});let une=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(une=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const dne="undefined"!=typeof navigator&&(null===(Gte=navigator.scheduling)||void 0===Gte?void 0:Gte.isInputPending)?()=>navigator.scheduling.isInputPending():null,pne=X8.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(tne.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(tne.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=une(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndo+1e3,a=r.context.work((()=>dne&&dne()||Date.now()>i),o+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:tne.setState.of(new cne(r.context))})),this.chunkBudget>0&&(!a||l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>L8(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),hne=t4.define({combine:e=>e.length?e[0]:null,enables:e=>[tne.state,pne,o9.contentAttributes.compute([e],(t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]});class fne{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const gne=t4.define(),mne=t4.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function vne(e){let t=e.facet(mne);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function bne(e,t){let n="",o=e.tabSize,r=e.facet(mne)[0];if("\t"==r){for(;t>=o;)n+="\t",t-=o;r=" "}for(let i=0;i=t?function(e,t,n){let o=t.resolveStack(n),r=o.node.enterUnfinishedNodesBefore(n);if(r!=o.node){let e=[];for(let t=r;t!=o.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)o={node:e[t],next:o}}return Sne(o,e,n)}(e,n,t):null}class One{constructor(e,t={}){this.state=e,this.options=t,this.unit=vne(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:r}=this.options;return null!=o&&o>=n.from&&o<=n.to?r&&o==e?{text:"",from:e}:(t<0?o-1&&(r+=i-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return a5(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:o}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(o);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const wne=new Zee;function Sne(e,t,n){for(let o=e;o;o=o.next){let e=xne(o.node);if(e)return e(Cne.create(t,n,o))}return 0}function xne(e){let t=e.type.prop(wne);if(t)return t;let n,o=e.firstChild;if(o&&(n=o.type.prop(Zee.closedBy))){let t=e.lastChild,o=t&&n.indexOf(t.name)>-1;return e=>Tne(e,!0,1,void 0,o&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?$ne:null}function $ne(){return 0}class Cne extends One{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Cne(e,t,n)}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 n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(kne(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Sne(this.context.next,this.base,this.pos)}}function kne(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Pne({closing:e,align:t=!0,units:n=1}){return o=>Tne(o,t,n,e)}function Tne(e,t,n,o,r){let i=e.textAfter,l=i.match(/^\s*/)[0].length,a=o&&i.slice(l,l+o.length)==o||r==e.pos+l,s=t?function(e){let t=e.node,n=t.childAfter(t.from),o=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),l=null==r||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let e=t.childAfter(a);if(!e||e==o)return null;if(!e.type.isSkipped)return e.from{let o=e&&e.test(n.textAfter);return n.baseIndent+(o?0:t*n.unit)}}const Ine=t4.define(),Ene=new Zee;function Ane(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Dne(e,t,n){for(let o of e.facet(Ine)){let r=o(e,t,n);if(r)return r}return function(e,t,n){let o=rne(e);if(o.lengthn)continue;if(r&&l.from=t&&o.to>n&&(r=o)}}return r}(e,t,n)}function Rne(e,t){let n=t.mapPos(e.from,1),o=t.mapPos(e.to,-1);return n>=o?void 0:{from:n,to:o}}const zne=E4.define({map:Rne}),Bne=E4.define({map:Rne});function jne(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const Nne=s4.define({create:()=>w8.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(zne)&&!Qne(e,n.value.from,n.value.to)){let{preparePlaceholder:o}=t.state.facet(Xne),r=o?w8.replace({widget:new Une(o(t.state,n.value))}):Zne;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Bne)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:o}=t.selection.main;e.between(o,o,((e,t)=>{eo&&(n=!0)})),n&&(e=e.update({filterFrom:o,filterTo:o,filter:(e,t)=>t<=o||e>=o}))}return e},provide:e=>o9.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!r||r.from>e)&&(r={from:e,to:t})})),r}function Qne(e,t,n){let o=!1;return e.between(t,t,((e,r)=>{e==t&&r==n&&(o=!0)})),o}function Lne(e,t){return e.field(Nne,!1)?t:t.concat(E4.appendConfig.of(Yne()))}function Hne(e,t,n=!0){let o=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return o9.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${o} ${e.state.phrase("to")} ${r}.`)}const Fne=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of jne(e)){let n=Dne(e.state,t.from,t.to);if(n)return e.dispatch({effects:Lne(e.state,[zne.of(n),Hne(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Nne,!1))return!1;let t=[];for(let n of jne(e)){let o=_ne(e.state,n.from,n.to);o&&t.push(Bne.of(o),Hne(e,o,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let o=0;o{let t=e.state.field(Nne,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(Bne.of({from:e,to:t}))})),e.dispatch({effects:n}),!0}}],Wne={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Xne=t4.define({combine:e=>W4(e,Wne)});function Yne(e){let t=[Nne,Jne];return e&&t.push(Xne.of(e)),t}function Vne(e,t){let{state:n}=e,o=n.facet(Xne),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),o=_ne(e.state,n.from,n.to);o&&e.dispatch({effects:Bne.of(o)}),t.preventDefault()};if(o.placeholderDOM)return o.placeholderDOM(e,r,t);let i=document.createElement("span");return i.textContent=o.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}const Zne=w8.replace({widget:new class extends y8{toDOM(e){return Vne(e,null)}}});class Une extends y8{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Vne(e,this.value)}}const Kne={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Gne extends xee{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 qne(e={}){let t=Object.assign(Object.assign({},Kne),e),n=new Gne(t,!0),o=new Gne(t,!1),r=X8.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(hne)!=e.state.facet(hne)||e.startState.field(Nne,!1)!=e.state.field(Nne,!1)||rne(e.startState)!=rne(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new K4;for(let r of e.viewportLineBlocks){let i=_ne(e.state,r.from,r.to)?o:Dne(e.state,r.from,r.to)?n:null;i&&t.add(r.from,r.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[r,Pee({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||U4.empty},initialSpacer:()=>new Gne(t,!1),domEventHandlers:Object.assign(Object.assign({},i),{click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let o=_ne(e.state,t.from,t.to);if(o)return e.dispatch({effects:Bne.of(o)}),!0;let r=Dne(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:zne.of(r)}),!0)}})}),Yne()]}const Jne=o9.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 eoe{constructor(e,t){let n;function o(e){let t=p5.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?o(t.all):void 0,i=t.scope;this.scope=i instanceof tne?e=>e.prop(qte)==i.data:i?e=>e==i:void 0,this.style=Ate(e.map((e=>({tag:e.tag,class:e.class||o(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=n?new p5(n):null,this.themeType=t.themeType}static define(e,t){return new eoe(e,t||{})}}const toe=t4.define(),noe=t4.define({combine:e=>e.length?[e[0]]:null});function ooe(e){let t=e.facet(toe);return t.length?t:e.facet(noe)}function roe(e,t){let n,o=[loe];return e instanceof eoe&&(e.module&&o.push(o9.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?o.push(noe.of(e)):n?o.push(toe.computeN([o9.darkTheme],(t=>t.facet(o9.darkTheme)==("dark"==n)?[e]:[]))):o.push(toe.of(e)),o}class ioe{constructor(e){this.markCache=Object.create(null),this.tree=rne(e.state),this.decorations=this.buildDeco(e,ooe(e.state))}update(e){let t=rne(e.state),n=ooe(e.state),o=n!=ooe(e.startState);t.length{n.add(e,t,this.markCache[o]||(this.markCache[o]=w8.mark({class:o})))}),o,r);return n.finish()}}const loe=f4.high(X8.fromClass(ioe,{decorations:e=>e.decorations})),aoe=eoe.define([{tag:Kte.meta,color:"#404740"},{tag:Kte.link,textDecoration:"underline"},{tag:Kte.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Kte.emphasis,fontStyle:"italic"},{tag:Kte.strong,fontWeight:"bold"},{tag:Kte.strikethrough,textDecoration:"line-through"},{tag:Kte.keyword,color:"#708"},{tag:[Kte.atom,Kte.bool,Kte.url,Kte.contentSeparator,Kte.labelName],color:"#219"},{tag:[Kte.literal,Kte.inserted],color:"#164"},{tag:[Kte.string,Kte.deleted],color:"#a11"},{tag:[Kte.regexp,Kte.escape,Kte.special(Kte.string)],color:"#e40"},{tag:Kte.definition(Kte.variableName),color:"#00f"},{tag:Kte.local(Kte.variableName),color:"#30a"},{tag:[Kte.typeName,Kte.namespace],color:"#085"},{tag:Kte.className,color:"#167"},{tag:[Kte.special(Kte.variableName),Kte.macroName],color:"#256"},{tag:Kte.definition(Kte.propertyName),color:"#00c"},{tag:Kte.comment,color:"#940"},{tag:Kte.invalid,color:"#f00"}]),soe=o9.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),coe="()[]{}",uoe=t4.define({combine:e=>W4(e,{afterCursor:!0,brackets:coe,maxScanDistance:1e4,renderMatch:hoe})}),doe=w8.mark({class:"cm-matchingBracket"}),poe=w8.mark({class:"cm-nonmatchingBracket"});function hoe(e){let t=[],n=e.matched?doe:poe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const foe=[s4.define({create:()=>w8.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],o=t.state.facet(uoe);for(let r of t.state.selection.ranges){if(!r.empty)continue;let e=yoe(t.state,r.head,-1,o)||r.head>0&&yoe(t.state,r.head-1,1,o)||o.afterCursor&&(yoe(t.state,r.head,1,o)||r.heado9.decorations.from(e)}),soe];function goe(e={}){return[uoe.of(e),foe]}const moe=new Zee;function voe(e,t,n){let o=e.prop(t<0?Zee.openedBy:Zee.closedBy);if(o)return o;if(1==e.name.length){let o=n.indexOf(e.name);if(o>-1&&o%2==(t<0?1:0))return[n[o+t]]}return null}function boe(e){let t=e.type.prop(moe);return t?t(e.node):e}function yoe(e,t,n,o={}){let r=o.maxScanDistance||1e4,i=o.brackets||coe,l=rne(e),a=l.resolveInner(t,n);for(let s=a;s;s=s.parent){let e=voe(s.type,n,i);if(e&&s.from0?t>=o.from&&to.from&&t<=o.to))return Ooe(0,0,n,s,o,e,i)}}return function(e,t,n,o,r,i,l){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=l.indexOf(a);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let p=0;!u.next().done&&p<=i;){let e=u.value;n<0&&(p+=e.length);let i=t+p*n;for(let t=n>0?0:e.length-1,a=n>0?e.length:-1;t!=a;t+=n){let a=l.indexOf(e[t]);if(!(a<0||o.resolveInner(i+t,1).type!=r))if(a%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:i+t,to:i+t+1},matched:a>>1==s>>1};d--}}n>0&&(p+=e.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,l,a.type,r,i)}function Ooe(e,t,n,o,r,i,l){let a=o.parent,s={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do{if(n<0?u.to<=o.from:u.from>=o.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from-1||xoe.push(e)}function Poe(e,t){let n=[];for(let a of t.split(" ")){let t=[];for(let n of a.split(".")){let o=e[n]||Kte[n];o?"function"==typeof o?t.length?t=t.map(o):koe(n):t.length?koe(n):t=Array.isArray(o)?o:[o]:koe(n)}for(let e of t)n.push(e)}if(!n.length)return 0;let o=t.replace(/ /g,"_"),r=o+" "+n.map((e=>e.id)),i=$oe[r];if(i)return i.id;let l=$oe[r]=Gee.define({id:Soe.length,name:o,props:[Mte({[o]:n})]});return Soe.push(l),l.id}function Toe(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(o(n.update(r)),!0)}}const Moe=Toe(Roe,0),Ioe=Toe(Doe,0),Eoe=Toe(((e,t)=>Doe(e,t,function(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),r=n.to<=o.to?o:e.doc.lineAt(n.to),i=t.length-1;i>=0&&t[i].to>o.from?t[i].to=r.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return t}(t))),0);function Aoe(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function Doe(e,t,n=t.selection.ranges){let o=n.map((e=>Aoe(t,e.from).block));if(!o.every((e=>e)))return null;let r=n.map(((e,n)=>function(e,{open:t,close:n},o,r){let i,l,a=e.sliceDoc(o-50,o),s=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(s)[0].length,d=a.length-c;if(a.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:o-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-o<=100?i=l=e.sliceDoc(o,r):(i=e.sliceDoc(o,o+50),l=e.sliceDoc(r-50,r));let p=/^\s*/.exec(i)[0].length,h=/\s*$/.exec(l)[0].length,f=l.length-h-n.length;return i.slice(p,p+t.length)==t&&l.slice(f,f+n.length)==n?{open:{pos:o+p+t.length,margin:/\s/.test(i.charAt(p+t.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(l.charAt(f-1))?1:0}}:null}(t,o[n],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>r[t]?[]:[{from:e.from,insert:o[t].open+" "},{from:e.to,insert:" "+o[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,n=0;nr&&(i==l||l>s.from)){r=s.from;let e=/^\s*/.exec(s.text)[0].length,t=e==s.length,i=s.text.slice(e,e+a.length)==a?e:-1;ee.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:r,indent:i,empty:l,single:a}of o)!a&&l||e.push({from:t.from+i,insert:r+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&o.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:r}of o)if(n>=0){let o=t.from+n,i=o+r.length;" "==t.text[i-t.from]&&i++,e.push({from:o,to:i})}return{changes:e}}return null}const zoe=T4.define(),Boe=T4.define(),joe=t4.define(),Noe=t4.define({combine:e=>W4(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,o)=>e(n,o)||t(n,o)})}),_oe=s4.define({create:()=>tre.empty,update(e,t){let n=t.state.facet(Noe),o=t.annotation(zoe);if(o){let r=Yoe.fromTransaction(t,o.selection),i=o.side,l=0==i?e.undone:e.done;return l=r?Voe(l,l.length,n.minDepth,r):Koe(l,t.startState.selection),new tre(0==i?o.rest:l,0==i?l:o.rest)}let r=t.annotation(Boe);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(A4.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=Yoe.fromTransaction(t),l=t.annotation(A4.time),a=t.annotation(A4.userEvent);return i?e=e.addChanges(i,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new tre(e.done.map(Yoe.fromJSON),e.undone.map(Yoe.fromJSON))});function Qoe(e={}){return[_oe,Noe.of(e),o9.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?Hoe:"historyRedo"==e.inputType?Foe:null;return!!n&&(e.preventDefault(),n(t))}})]}function Loe(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let r=n.field(_oe,!1);if(!r)return!1;let i=r.pop(e,n,t);return!!i&&(o(i),!0)}}const Hoe=Loe(0,!1),Foe=Loe(1,!1),Woe=Loe(0,!0),Xoe=Loe(1,!0);class Yoe{constructor(e,t,n,o,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=o,this.selectionsAfter=r}setSelAfter(e){return new Yoe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new Yoe(e.changes&&W3.fromJSON(e.changes),[],e.mapped&&F3.fromJSON(e.mapped),e.startSelection&&q3.fromJSON(e.startSelection),e.selectionsAfter.map(q3.fromJSON))}static fromTransaction(e,t){let n=Uoe;for(let o of e.startState.facet(joe)){let t=o(e);t.length&&(n=n.concat(t))}return!n.length&&e.changes.empty?null:new Yoe(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Uoe)}static selection(e){return new Yoe(void 0,Uoe,void 0,void 0,e)}}function Voe(e,t,n,o){let r=t+1>n+20?t-n-1:0,i=e.slice(r,t);return i.push(o),i}function Zoe(e,t){return e.length?t.length?e.concat(t):e:t}const Uoe=[];function Koe(e,t){if(e.length){let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),Voe(e,e.length-1,1e9,n.setSelAfter(o)))}return[Yoe.selection([t])]}function Goe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function qoe(e,t){if(!e.length)return e;let n=e.length,o=Uoe;for(;n;){let r=Joe(e[n-1],t,o);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,o=r.selectionsAfter}return o.length?[Yoe.selection(o)]:Uoe}function Joe(e,t,n){let o=Zoe(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):Uoe,n);if(!e.changes)return Yoe.selection(o);let r=e.changes.map(t),i=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(i):i;return new Yoe(r,E4.mapEffects(e.effects,t),l,e.startSelection.map(i),o)}const ere=/^(input\.type|delete)($|\.)/;class tre{constructor(e,t,n=0,o=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new tre(this.done,this.undone):this}addChanges(e,t,n,o,r){let i=this.done,l=i[i.length-1];return i=l&&l.changes&&!l.changes.empty&&e.changes&&(!n||ere.test(n))&&(!l.selectionsAfter.length&&t-this.prevTimen.push(e,t))),t.iterChangedRanges(((e,t,r,i)=>{for(let l=0;l=e&&r<=t&&(o=!0)}})),o}(l.changes,e.changes))||"input.type.compose"==n)?Voe(i,i.length-1,o.minDepth,new Yoe(e.changes.compose(l.changes),Zoe(e.effects,l.effects),l.mapped,l.startSelection,Uoe)):Voe(i,i.length,o.minDepth,e),new tre(i,Uoe,t,n)}addSelection(e,t,n,o){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Uoe;return r.length>0&&t-this.prevTimee.empty!=l.ranges[t].empty)).length)?this:new tre(Koe(this.done,e),this.undone,t,n);var i,l}addMapping(e){return new tre(qoe(this.done,e),qoe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let o=0==e?this.done:this.undone;if(0==o.length)return null;let r=o[o.length-1],i=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:zoe.of({side:e,rest:Goe(o),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==o.length?Uoe:o.slice(0,o.length-1);return r.mapped&&(n=qoe(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:zoe.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}tre.empty=new tre(Uoe,Uoe);const nre=[{key:"Mod-z",run:Hoe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Foe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Foe,preventDefault:!0},{key:"Mod-u",run:Woe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Xoe,preventDefault:!0}];function ore(e,t){return q3.create(e.ranges.map(t),e.mainIndex)}function rre(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ire({state:e,dispatch:t},n){let o=ore(e.selection,n);return!o.eq(e.selection)&&(t(rre(e,o)),!0)}function lre(e,t){return q3.cursor(t?e.to:e.from)}function are(e,t){return ire(e,(n=>n.empty?e.moveByChar(n,t):lre(n,t)))}function sre(e){return e.textDirectionAt(e.state.selection.main.head)==r6.LTR}const cre=e=>are(e,!sre(e)),ure=e=>are(e,sre(e));function dre(e,t){return ire(e,(n=>n.empty?e.moveByGroup(n,t):lre(n,t)))}function pre(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function hre(e,t,n){let o,r,i=rne(e).resolveInner(t.head),l=n?Zee.closedBy:Zee.openedBy;for(let a=t.head;;){let t=n?i.childAfter(a):i.childBefore(a);if(!t)break;pre(e,t,l)?i=t:a=n?t.to:t.from}return r=i.type.prop(l)&&(o=n?yoe(e,i.from,1):yoe(e,i.to,-1))&&o.matched?n?o.end.to:o.end.from:n?i.to:i.from,q3.cursor(r,n?-1:1)}function fre(e,t){return ire(e,(n=>{if(!n.empty)return lre(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)}))}const gre=e=>fre(e,!1),mre=e=>fre(e,!0);function vre(e){let t,n=e.scrollDOM.clientHeightn.empty?e.moveVertically(n,t,o.height):lre(n,t)));if(i.eq(r.selection))return!1;if(o.selfScroll){let t=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+o.marginTop,s=l.bottom-o.marginBottom;t&&t.top>a&&t.bottombre(e,!1),Ore=e=>bre(e,!0);function wre(e,t,n){let o=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?o.to:o.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==o.from&&o.length){let n=/^\s*/.exec(e.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;n&&t.head!=o.from+n&&(r=q3.cursor(o.from+n))}return r}function Sre(e,t){let n=ore(e.state.selection,(e=>{let n=t(e);return q3.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(e.state.selection)&&(e.dispatch(rre(e.state,n)),!0)}function xre(e,t){return Sre(e,(n=>e.moveByChar(n,t)))}const $re=e=>xre(e,!sre(e)),Cre=e=>xre(e,sre(e));function kre(e,t){return Sre(e,(n=>e.moveByGroup(n,t)))}function Pre(e,t){return Sre(e,(n=>e.moveVertically(n,t)))}const Tre=e=>Pre(e,!1),Mre=e=>Pre(e,!0);function Ire(e,t){return Sre(e,(n=>e.moveVertically(n,t,vre(e).height)))}const Ere=e=>Ire(e,!1),Are=e=>Ire(e,!0),Dre=({state:e,dispatch:t})=>(t(rre(e,{anchor:0})),!0),Rre=({state:e,dispatch:t})=>(t(rre(e,{anchor:e.doc.length})),!0),zre=({state:e,dispatch:t})=>(t(rre(e,{anchor:e.selection.main.anchor,head:0})),!0),Bre=({state:e,dispatch:t})=>(t(rre(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function jre(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:o}=e,r=o.changeByRange((o=>{let{from:r,to:i}=o;if(r==i){let l=t(o);lr&&(n="delete.forward",l=Nre(e,l,!0)),r=Math.min(r,l),i=Math.max(i,l)}else r=Nre(e,r,!1),i=Nre(e,i,!0);return r==i?{range:o}:{changes:{from:r,to:i},range:q3.cursor(r,rt(e))))o.between(t,t,((e,o)=>{et&&(t=n?o:e)}));return t}const _re=(e,t)=>jre(e,(n=>{let o,r,i=n.from,{state:l}=e,a=l.doc.lineAt(i);if(!t&&i>a.from&&i_re(e,!1),Lre=e=>_re(e,!0),Hre=(e,t)=>jre(e,(n=>{let o=n.head,{state:r}=e,i=r.doc.lineAt(o),l=r.charCategorizer(o);for(let e=null;;){if(o==(t?i.to:i.from)){o==n.head&&i.number!=(t?r.doc.lines:1)&&(o+=t?1:-1);break}let a=D3(i.text,o-i.from,t)+i.from,s=i.text.slice(Math.min(o,a)-i.from,Math.max(o,a)-i.from),c=l(s);if(null!=e&&c!=e)break;" "==s&&o==n.head||(e=c),o=a}return o})),Fre=e=>Hre(e,!1);function Wre(e){let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.from),i=e.doc.lineAt(o.to);if(o.empty||o.to!=i.from||(i=e.doc.lineAt(o.to-1)),n>=r.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(o)}else t.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return t}function Xre(e,t,n){if(e.readOnly)return!1;let o=[],r=[];for(let i of Wre(e)){if(n?i.to==e.doc.length:0==i.from)continue;let t=e.doc.lineAt(n?i.to+1:i.from-1),l=t.length+1;if(n){o.push({from:i.to,to:t.to},{from:i.from,insert:t.text+e.lineBreak});for(let t of i.ranges)r.push(q3.range(Math.min(e.doc.length,t.anchor+l),Math.min(e.doc.length,t.head+l)))}else{o.push({from:t.from,to:i.from},{from:i.to,insert:e.lineBreak+t.text});for(let e of i.ranges)r.push(q3.range(e.anchor-l,e.head-l))}}return!!o.length&&(t(e.update({changes:o,scrollIntoView:!0,selection:q3.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Yre(e,t,n){if(e.readOnly)return!1;let o=[];for(let r of Wre(e))n?o.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):o.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:o,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Vre=Zre(!1);function Zre(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let o=t.changeByRange((n=>{let{from:o,to:r}=n,i=t.doc.lineAt(o),l=!e&&o==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,o=rne(e).resolveInner(t),r=o.childBefore(t),i=o.childAfter(t);return r&&i&&r.to<=t&&i.from>=t&&(n=r.type.prop(Zee.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,o);e&&(o=r=(r<=i.to?i:t.doc.lineAt(r)).to);let a=new One(t,{simulateBreak:o,simulateDoubleBreak:!!l}),s=yne(a,o);for(null==s&&(s=a5(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));ri.from&&o{let r=[];for(let l=o.from;l<=o.to;){let i=e.doc.lineAt(l);i.number>n&&(o.empty||o.to>i.from)&&(t(i,r,o),n=i.number),l=i.to+1}let i=e.changes(r);return{changes:r,range:q3.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}}))}const Kre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ure(e,((t,n)=>{n.push({from:t.from,insert:e.facet(mne)})})),{userEvent:"input.indent"})),!0),Gre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ure(e,((t,n)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let r=a5(o,e.tabSize),i=0,l=bne(e,Math.max(0,r-vne(e)));for(;iire(e,(t=>hre(e.state,t,!sre(e)))),shift:e=>Sre(e,(t=>hre(e.state,t,!sre(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>ire(e,(t=>hre(e.state,t,sre(e)))),shift:e=>Sre(e,(t=>hre(e.state,t,sre(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Xre(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Yre(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Xre(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Yre(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,o=null;return n.ranges.length>1?o=q3.create([n.main]):n.main.empty||(o=q3.create([q3.cursor(n.main.head)])),!!o&&(t(rre(e,o)),!0)}},{key:"Mod-Enter",run:Zre(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=Wre(e).map((({from:t,to:n})=>q3.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:q3.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=ore(e.selection,(t=>{var n;for(let o=rne(e).resolveStack(t.from,1);o;o=o.next){let{node:e}=o;if((e.from=t.to||e.to>t.to&&e.from<=t.from)&&(null===(n=e.parent)||void 0===n?void 0:n.parent))return q3.range(e.to,e.from)}return t}));return t(rre(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:Gre},{key:"Mod-]",run:Kre},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new One(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=Ure(e,((t,r,i)=>{let l=yne(o,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let a=/^\s*/.exec(t.text)[0],s=bne(e,l);(a!=s||i.from{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Wre(t).map((({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0))).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let o=!1,r=ore(e.selection,(t=>{let r=yoe(e,t.head,-1)||yoe(e,t.head,1)||t.head>0&&yoe(e,t.head-1,1)||t.head{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=Aoe(e.state,n.from);return o.line?Moe(e):!!o.block&&Eoe(e)}},{key:"Alt-A",run:Ioe}].concat([{key:"ArrowLeft",run:cre,shift:$re,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>dre(e,!sre(e)),shift:e=>kre(e,!sre(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>ire(e,(t=>wre(e,t,!sre(e)))),shift:e=>Sre(e,(t=>wre(e,t,!sre(e)))),preventDefault:!0},{key:"ArrowRight",run:ure,shift:Cre,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>dre(e,sre(e)),shift:e=>kre(e,sre(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>ire(e,(t=>wre(e,t,sre(e)))),shift:e=>Sre(e,(t=>wre(e,t,sre(e)))),preventDefault:!0},{key:"ArrowUp",run:gre,shift:Tre,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Dre,shift:zre},{mac:"Ctrl-ArrowUp",run:yre,shift:Ere},{key:"ArrowDown",run:mre,shift:Mre,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Rre,shift:Bre},{mac:"Ctrl-ArrowDown",run:Ore,shift:Are},{key:"PageUp",run:yre,shift:Ere},{key:"PageDown",run:Ore,shift:Are},{key:"Home",run:e=>ire(e,(t=>wre(e,t,!1))),shift:e=>Sre(e,(t=>wre(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:Dre,shift:zre},{key:"End",run:e=>ire(e,(t=>wre(e,t,!0))),shift:e=>Sre(e,(t=>wre(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:Rre,shift:Bre},{key:"Enter",run:Vre},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Qre,shift:Qre},{key:"Delete",run:Lre},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Fre},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Hre(e,!0)},{mac:"Mod-Backspace",run:e=>jre(e,(t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>jre(e,(t=>{let n=e.moveToLineBoundary(t,!0).head;return t.headire(e,(t=>q3.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>Sre(e,(t=>q3.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>ire(e,(t=>q3.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>Sre(e,(t=>q3.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:Lre},{key:"Ctrl-h",run:Qre},{key:"Ctrl-k",run:e=>jre(e,(t=>{let n=e.lineBlockAt(t.head).to;return t.head{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:O3.of(["",""])},range:q3.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,o=e.doc.lineAt(n),r=n==o.from?n-1:D3(o.text,n-o.from,!1)+o.from,i=n==o.to?n+1:D3(o.text,n-o.from,!0)+o.from;return{changes:{from:r,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(r,n))},range:q3.cursor(i)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Ore}].map((e=>({mac:e.key,run:e.run,shift:e.shift}))))),Jre={key:"Tab",run:Kre,shift:Gre};function eie(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var r=n[o];"string"==typeof r?e.setAttribute(o,r):null!=r&&(e[o]=r)}t++}for(;te.normalize("NFKD"):e=>e;class oie{constructor(e,t,n=0,o=e.length,r,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,o),this.bufferStart=n,this.normalize=r?e=>r(nie(e)):nie,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 N3(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=_3(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Q3(e);let o=this.normalize(t);for(let r=0,i=n;;r++){let e=o.charCodeAt(r),l=this.match(e,i);if(r==o.length-1){if(l)return this.value=l,this;break}i==n&&rthis.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 n=this.curLineStart+t.index,o=n+t[0].length;if(this.matchPos=uie(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,o,t)))return this.value={from:n,to:o,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||o.to<=t){let o=new sie(t,e.sliceString(t,n));return aie.set(e,o),o}if(o.from==t&&o.to==n)return o;let{text:r,from:i}=o;return i>t&&(r=e.sliceString(t,i)+r,i=t),o.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 e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=uie(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=sie.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function uie(e,t){if(t>=e.length)return t;let n,o=e.lineAt(t);for(;t=56320&&n<57344;)t++;return t}function die(e){let t=eie("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:o}=e,r=o.doc.lineAt(o.selection.main.head),[,i,l,a,s]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&s){let e=u/100;i&&(e=e*("-"==i?-1:1)+r.number/o.doc.lines),u=Math.round(o.doc.lines*e)}else l&&i&&(u=u*("-"==i?-1:1)+r.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,u))),p=q3.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[pie.of(!1),o9.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:eie("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:pie.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},eie("label",e.state.phrase("Go to line"),": ",t)," ",eie("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(lie.prototype[Symbol.iterator]=cie.prototype[Symbol.iterator]=function(){return this});const pie=E4.define(),hie=s4.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(pie)&&(e=n.value);return e},provide:e=>See.from(e,(e=>e?die:null))}),fie=o9.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),gie={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},mie=t4.define({combine:e=>W4(e,gie,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function vie(e){let t=[Sie,wie];return e&&t.push(mie.of(e)),t}const bie=w8.mark({class:"cm-selectionMatch"}),yie=w8.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Oie(e,t,n,o){return!(0!=n&&e(t.sliceDoc(n-1,n))==_4.Word||o!=t.doc.length&&e(t.sliceDoc(o,o+1))==_4.Word)}const wie=X8.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(mie),{state:n}=e,o=n.selection;if(o.ranges.length>1)return w8.none;let r,i=o.main,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return w8.none;let e=n.wordAt(i.head);if(!e)return w8.none;l=n.charCategorizer(i.head),r=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e200)return w8.none;if(t.wholeWords){if(r=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!Oie(l,n,i.from,i.to)||!function(e,t,n,o){return e(t.sliceDoc(n,n+1))==_4.Word&&e(t.sliceDoc(o-1,o))==_4.Word}(l,n,i.from,i.to))return w8.none}else if(r=n.sliceDoc(i.from,i.to).trim(),!r)return w8.none}let a=[];for(let s of e.visibleRanges){let e=new oie(n.doc,r,s.from,s.to);for(;!e.next().done;){let{from:o,to:r}=e.value;if((!l||Oie(l,n,o,r))&&(i.empty&&o<=i.from&&r>=i.to?a.push(yie.range(o,r)):(o>=i.to||r<=i.from)&&a.push(bie.range(o,r)),a.length>t.maxMatches))return w8.none}}return w8.set(a)}},{decorations:e=>e.decorations}),Sie=o9.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),xie=t4.define({combine:e=>W4(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new qie(e),scrollToMatch:e=>o9.scrollIntoView(e)})});class $ie{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||function(e){try{return new RegExp(e,iie),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\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 Eie(this):new Pie(this)}getCursor(e,t=0,n){let o=e.doc?e:F4.create({doc:e});return null==n&&(n=o.doc.length),this.regexp?Tie(this,o,t,n):kie(this,o,t,n)}}class Cie{constructor(e){this.spec=e}}function kie(e,t,n,o){return new oie(t.doc,e.unquoted,n,o,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,i=t.charCategorizer(t.selection.main.head),(e,t,n,o)=>((o>e||o+n.length=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=kie(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}function Tie(e,t,n,o){return new lie(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(Mie(n.input,n.index))!=_4.Word||r(Iie(n.input,n.index))!=_4.Word)&&(r(Iie(n.input,n.index+n[0].length))!=_4.Word||r(Mie(n.input,n.index+n[0].length))!=_4.Word)):void 0},n,o);var r}function Mie(e,t){return e.slice(D3(e,t,!1),t)}function Iie(e,t){return e.slice(t,D3(e,t))}class Eie extends Cie{nextMatch(e,t,n){let o=Tie(this.spec,e,n,e.doc.length).next();return o.done&&(o=Tie(this.spec,e,0,t).next()),o.done?null:o.value}prevMatchInRange(e,t,n){for(let o=1;;o++){let r=Math.max(t,n-1e4*o),i=Tie(this.spec,e,r,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=Tie(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}const Aie=E4.define(),Die=E4.define(),Rie=s4.define({create:e=>new zie(Yie(e).create(),null),update(e,t){for(let n of t.effects)n.is(Aie)?e=new zie(n.value.create(),e.panel):n.is(Die)&&(e=new zie(e.query,n.value?Xie:null));return e},provide:e=>See.from(e,(e=>e.panel))});class zie{constructor(e,t){this.query=e,this.panel=t}}const Bie=w8.mark({class:"cm-searchMatch"}),jie=w8.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Nie=X8.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Rie))}update(e){let t=e.state.field(Rie);(t!=e.startState.field(Rie)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return w8.none;let{view:n}=this,o=new K4;for(let r=0,i=n.visibleRanges,l=i.length;ri[r+1].from-500;)a=i[++r].to;e.highlight(n.state,t,a,((e,t)=>{let r=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));o.add(e,t,r?jie:Bie)}))}return o.finish()}},{decorations:e=>e.decorations});function _ie(e){return t=>{let n=t.state.field(Rie,!1);return n&&n.query.spec.valid?e(t,n):Uie(t)}}const Qie=_ie(((e,{query:t})=>{let{to:n}=e.state.selection.main,o=t.nextMatch(e.state,n,n);if(!o)return!1;let r=q3.single(o.from,o.to),i=e.state.facet(xie);return e.dispatch({selection:r,effects:[tle(e,o),i.scrollToMatch(r.main,e)],userEvent:"select.search"}),Zie(e),!0})),Lie=_ie(((e,{query:t})=>{let{state:n}=e,{from:o}=n.selection.main,r=t.prevMatch(n,o,o);if(!r)return!1;let i=q3.single(r.from,r.to),l=e.state.facet(xie);return e.dispatch({selection:i,effects:[tle(e,r),l.scrollToMatch(i.main,e)],userEvent:"select.search"}),Zie(e),!0})),Hie=_ie(((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:q3.create(n.map((e=>q3.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),Fie=_ie(((e,{query:t})=>{let{state:n}=e,{from:o,to:r}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,o,o);if(!i)return!1;let l,a,s=[],c=[];if(i.from==o&&i.to==r&&(a=n.toText(t.getReplacement(i)),s.push({from:i.from,to:i.to,insert:a}),i=t.nextMatch(n,i.from,i.to),c.push(o9.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(o).number)+"."))),i){let t=0==s.length||s[0].from>=i.to?0:i.to-i.from-a.length;l=q3.single(i.from-t,i.to-t),c.push(tle(e,i)),c.push(n.facet(xie).scrollToMatch(l.main,e))}return e.dispatch({changes:s,selection:l,effects:c,userEvent:"input.replace"}),!0})),Wie=_ie(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map((e=>{let{from:n,to:o}=e;return{from:n,to:o,insert:t.getReplacement(e)}}));if(!n.length)return!1;let o=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:o9.announce.of(o),userEvent:"input.replace.all"}),!0}));function Xie(e){return e.state.facet(xie).createPanel(e)}function Yie(e,t){var n,o,r,i,l;let a=e.selection.main,s=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!s)return t;let c=e.facet(xie);return new $ie({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(o=null==t?void 0:t.caseSensitive)&&void 0!==o?o:c.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(l=null==t?void 0:t.wholeWord)&&void 0!==l?l:c.wholeWord})}function Vie(e){let t=bee(e,Xie);return t&&t.dom.querySelector("[main-field]")}function Zie(e){let t=Vie(e);t&&t==e.root.activeElement&&t.select()}const Uie=e=>{let t=e.state.field(Rie,!1);if(t&&t.panel){let n=Vie(e);if(n&&n!=e.root.activeElement){let o=Yie(e.state,t.query.spec);o.valid&&e.dispatch({effects:Aie.of(o)}),n.focus(),n.select()}}else e.dispatch({effects:[Die.of(!0),t?Aie.of(Yie(e.state,t.query.spec)):E4.appendConfig.of(ole)]});return!0},Kie=e=>{let t=e.state.field(Rie,!1);if(!t||!t.panel)return!1;let n=bee(e,Xie);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Die.of(!1)}),!0},Gie=[{key:"Mod-f",run:Uie,scope:"editor search-panel"},{key:"F3",run:Qie,shift:Lie,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Qie,shift:Lie,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Kie,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:o,to:r}=n.main,i=[],l=0;for(let a=new oie(e.doc,e.sliceDoc(o,r));!a.next().done;){if(i.length>1e3)return!1;a.value.from==o&&(l=i.length),i.push(q3.range(a.value.from,a.value.to))}return t(e.update({selection:q3.create(i,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=bee(e,die);if(!t){let n=[pie.of(!0)];null==e.state.field(hie,!1)&&n.push(E4.appendConfig.of([hie,fie])),e.dispatch({effects:n}),t=bee(e,die)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,o=q3.create(n.ranges.map((t=>e.wordAt(t.head)||q3.cursor(t.head))),n.mainIndex);return!o.eq(n)&&(t(e.update({selection:o})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let r=function(e,t){let{main:n,ranges:o}=e.selection,r=e.wordAt(n.head),i=r&&r.from==n.from&&r.to==n.to;for(let l=!1,a=new oie(e.doc,t,o[o.length-1].to);;){if(a.next(),!a.done){if(l&&o.some((e=>e.from==a.value.from)))continue;if(i){let t=e.wordAt(a.value.from);if(!t||t.from!=a.value.from||t.to!=a.value.to)continue}return a.value}if(l)return null;a=new oie(e.doc,t,0,Math.max(0,o[o.length-1].from-1)),l=!0}}(e,o);return!!r&&(t(e.update({selection:e.selection.addRange(q3.range(r.from,r.to),!1),effects:o9.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class qie{constructor(e){this.view=e;let t=this.query=e.state.field(Rie).query.spec;function n(e,t,n){return eie("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=eie("input",{value:t.search,placeholder:Jie(e,"Find"),"aria-label":Jie(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=eie("input",{value:t.replace,placeholder:Jie(e,"Replace"),"aria-label":Jie(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=eie("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=eie("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=eie("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=eie("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>Qie(e)),[Jie(e,"next")]),n("prev",(()=>Lie(e)),[Jie(e,"previous")]),n("select",(()=>Hie(e)),[Jie(e,"all")]),eie("label",null,[this.caseField,Jie(e,"match case")]),eie("label",null,[this.reField,Jie(e,"regexp")]),eie("label",null,[this.wordField,Jie(e,"by word")]),...e.state.readOnly?[]:[eie("br"),this.replaceField,n("replace",(()=>Fie(e)),[Jie(e,"replace")]),n("replaceAll",(()=>Wie(e)),[Jie(e,"replace all")])],eie("button",{name:"close",onclick:()=>Kie(e),"aria-label":Jie(e,"close"),type:"button"},["×"])])}commit(){let e=new $ie({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:Aie.of(e)}))}keydown(e){var t,n,o;t=this.view,n=e,o="search-panel",g9(h9(t.state),n,t,o)?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Lie:Qie)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),Fie(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Aie)&&!e.value.eq(this.query)&&this.setQuery(e.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(xie).top}}function Jie(e,t){return e.state.phrase(t)}const ele=/[\s\.,:;?!]/;function tle(e,{from:t,to:n}){let o=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,i=Math.max(o.from,t-30),l=Math.min(r,n+30),a=e.state.sliceDoc(i,l);if(i!=o.from)for(let s=0;s<30;s++)if(!ele.test(a[s+1])&&ele.test(a[s])){a=a.slice(s);break}if(l!=r)for(let s=a.length-1;s>a.length-30;s--)if(!ele.test(a[s-1])&&ele.test(a[s])){a=a.slice(0,s);break}return o9.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${o.number}.`)}const nle=o9.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"}}),ole=[Rie,f4.low(Nie),nle];class rle{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=rne(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),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),r=o.search(cle(e,!1));return r<0?null:{from:n+r,to:this.pos,text:o.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function ile(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function lle(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,o]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let r=e.matchBefore(o);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}class ale{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}}function sle(e){return e.selection.main.from}function cle(e,t){var n;let{source:o}=e,r=t&&"^"!=o[0],i="$"!=o[o.length-1];return r||i?new RegExp(`${r?"^":""}(?:${o})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const ule=T4.define(),dle=new WeakMap;function ple(e){if(!Array.isArray(e))return e;let t=dle.get(e);return t||dle.set(e,t=lle(e)),t}const hle=E4.define(),fle=E4.define();class gle{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&&o<=57||o>=97&&o<=122?2:o>=65&&o<=90?1:0:(s=_3(o))!=s.toLowerCase()?1:s!=s.toUpperCase()?2:0;(!v||1==b&&g||0==y&&0!=b)&&(t[u]==o||n[u]==o&&(d=!0)?i[u++]=v:i.length&&(m=!1)),y=b,v+=Q3(o)}return u==a&&0==i[0]&&m?this.result((d?-200:0)-100,i,e):p==a&&0==h?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):p==a?this.ret(-900-e.length,[h,f]):u==a?this.result((d?-200:0)-100-700+(m?0:-1100),i,e):2!=t.length&&this.result((o[0]?-700:0)-200-1100,o,e)}result(e,t,n){let o=[],r=0;for(let i of t){let e=i+(this.astral?Q3(N3(n,i)):1);r&&o[r-1]==i?o[r-1]=e:(o[r++]=i,o[r++]=e)}return this.ret(e-n.length,o)}}const mle=t4.define({combine:e=>W4(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:ble,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)=>n=>vle(e(n),t(n)),optionClass:(e,t)=>n=>vle(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})});function vle(e,t){return e?t?e+" "+t:e:t}function ble(e,t,n,o,r,i){let l,a,s=e.textDirection==r6.RTL,c=s,u=!1,d="top",p=t.left-r.left,h=r.right-t.right,f=o.right-o.left,g=o.bottom-o.top;if(c&&p=g||e>t.top?l=n.bottom-t.top:(d="bottom",l=t.bottom-n.top)}return{style:`${d}: ${l/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${a/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":c?"left":"right")}}function yle(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}class Ole{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:r,selected:i}=o.open,l=e.state.facet(mle);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,o){let r=document.createElement("span");r.className="cm-completionLabel";let i=e.displayLabel||e.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(i.slice(l,e)));let n=r.appendChild(document.createElement("span"));n.appendChild(document.createTextNode(i.slice(e,t))),n.className="cm-completionMatchedText",l=t}return le.position-t.position)).map((e=>e.render))}(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=yle(r.length,i,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(n=>{let{options:o}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(mle).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:fle.of(null)})})),this.showOptions(r,o.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 n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:r,selected:i,disabled:l}=n.open;o.open&&o.open.options==r||(this.range=yle(r.length,i,e.state.facet(mle).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=(null===(t=o.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);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=yle(t.options.length,t.selected,this.view.state.facet(mle).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:o}=n;if(!o)return;let r="string"==typeof o?document.createTextNode(o):o(n);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)})).catch((e=>L8(this.view.state,e,"completion info"))):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:o}=e;n.appendChild(t),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,o=this.range.from;n;n=n.nextSibling,o++)"LI"==n.nodeName&&n.id?o==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):o--;return t&&function(e,t){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.height/e.offsetHeight;o.topn.bottom&&(e.scrollTop+=(o.bottom-n.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return o.top>Math.min(r.bottom,t.bottom)-10||o.bottomn.from||0==n.from)&&(r=e,"string"!=typeof s&&s.header?o.appendChild(s.header(s)):o.appendChild(document.createElement("completion-section")).textContent=e)}const c=o.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(l);u&&(c.className=u);for(let e of this.optionContent){let t=e(l,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.tonew Ole(n,e,t)}function Sle(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class xle{constructor(e,t,n,o,r,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=r,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new xle(this.options,kle(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,r){let i=function(e,t){let n=[],o=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){o||(o=[]);let e="string"==typeof t?t:t.name;o.some((t=>t.name==e))||o.push("string"==typeof t?{name:e}:t)}};for(let s of e)if(s.hasResult()){let e=s.result.getMatch;if(!1===s.result.filter)for(let t of s.result.options)r(new ale(t,s.source,e?e(t):[],1e9-n.length));else{let n=new gle(t.sliceDoc(s.from,s.to));for(let t of s.result.options)if(n.match(t.label)){let o=t.displayLabel?e?e(t,n.matched):[]:n.matched;r(new ale(t,s.source,o,n.score+(t.boost||0)))}}}if(o){let e=Object.create(null),t=0,r=(e,t)=>{var n,o;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(o=t.rank)&&void 0!==o?o:1e9)||(e.namet.score-e.score||a(e.completion,t.completion)))){let e=s.completion;!l||l.label!=e.label||l.detail!=e.detail||null!=l.type&&null!=e.type&&l.type!=e.type||l.apply!=e.apply||l.boost!=e.boost?i.push(s):Sle(s.completion)>Sle(l)&&(i[i.length-1]=s),l=s.completion}return i}(e,t);if(!i.length)return o&&e.some((e=>1==e.state))?new xle(o.options,o.attrs,o.tooltip,o.timestamp,o.selected,!0):null;let l=t.facet(mle).selectOnOpen?0:-1;if(o&&o.selected!=l&&-1!=o.selected){let e=o.options[o.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:zle,above:r.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new xle(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class $le{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new $le(Ple,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(mle),o=(n.override||t.languageDataAt("autocomplete",sle(t)).map(ple)).map((t=>(this.active.find((e=>e.source==t))||new Mle(t,this.active.some((e=>0!=e.state))?1:0)).update(e,n)));o.length==this.active.length&&o.every(((e,t)=>e==this.active[t]))&&(o=this.active);let r=this.open;r&&e.docChanged&&(r=r.map(e.changes)),e.selection||o.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n1==e.state))&&(r=null),!r&&o.every((e=>1!=e.state))&&o.some((e=>e.hasResult()))&&(o=o.map((e=>e.hasResult()?new Mle(e.source,0):e)));for(let i of e.effects)i.is(Ale)&&(r=r&&r.setSelected(i.value,this.id));return o==this.active&&r==this.open?this:new $le(o,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Cle}}const Cle={"aria-autocomplete":"list"};function kle(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const Ple=[];function Tle(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class Mle{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=Tle(e),o=this;n?o=o.handleUserEvent(e,n,t):e.docChanged?o=o.handleChange(e):e.selection&&0!=o.state&&(o=new Mle(o.source,0));for(let r of e.effects)if(r.is(hle))o=new Mle(o.source,1,r.value?sle(e.state):-1);else if(r.is(fle))o=new Mle(o.source,0);else if(r.is(Ele))for(let e of r.value)e.source==o.source&&(o=e);return o}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new Mle(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(sle(e.startState))?new Mle(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Mle(this.source,this.state,e.mapPos(this.explicitPos))}}class Ile extends Mle{constructor(e,t,n,o,r){super(e,2,t),this.result=n,this.from=o,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var o;let r=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),l=sle(e.state);if((this.explicitPos<0?l<=r:li||"delete"==t&&sle(e.startState)==this.from)return new Mle(this.source,"input"==t&&n.activateOnTyping?1:0);let a,s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,o){if(!e)return!1;let r=t.sliceDoc(n,o);return"function"==typeof e?e(r,n,o,t):cle(e,!0).test(r)}(this.result.validFor,e.state,r,i)?new Ile(this.source,s,this.result,r,i):this.result.update&&(a=this.result.update(this.result,r,i,new rle(e.state,l,s>=0)))?new Ile(this.source,s,a,a.from,null!==(o=a.to)&&void 0!==o?o:sle(e.state)):new Mle(this.source,1,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Mle(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Ile(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const Ele=E4.define({map:(e,t)=>e.map((e=>e.map(t)))}),Ale=E4.define(),Dle=s4.define({create:()=>$le.start(),update:(e,t)=>e.update(t),provide:e=>[cee.from(e,(e=>e.tooltip)),o9.contentAttributes.from(e,(e=>e.attrs))]});function Rle(e,t){const n=t.completion.apply||t.completion.label;let o=e.state.field(Dle).active.find((e=>e.source==t.source));return o instanceof Ile&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,o){let{main:r}=e.selection,i=n-r.from,l=o-r.from;return Object.assign(Object.assign({},e.changeByRange((a=>a!=r&&n!=o&&e.sliceDoc(a.from+i,a.from+l)!=e.sliceDoc(n,o)?{range:a}:{changes:{from:a.from+i,to:o==r.from?a.to:a.from+l,insert:t},range:q3.cursor(a.from+i+t.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,o.from,o.to)),{annotations:ule.of(t.completion)})):n(e,t.completion,o.from,o.to),!0)}const zle=wle(Dle,Rle);function Ble(e,t="option"){return n=>{let o=n.state.field(Dle,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp-1?o.open.selected+i*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:Ale.of(a)}),!0}}class jle{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Nle=X8.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(Dle).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(Dle);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Dle)==t)return;let n=e.transactions.some((e=>(e.selection||e.docChanged)&&!Tle(e)));for(let o=0;o50&&Date.now()-t.time>1e3){for(let e of t.context.abortListeners)try{e()}catch(Fpe){L8(this.view.state,Fpe)}t.context.abortListeners=null,this.running.splice(o--,1)}else t.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let o of e.transactions)"input"==Tle(o)?this.composing=2:2==this.composing&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(Dle);for(let n of t.active)1!=n.state||this.running.some((e=>e.active.source==n.source))||this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=sle(t),o=new rle(t,n,e.explicitPos==n),r=new jle(e,o);this.running.push(r),Promise.resolve(e.source(o)).then((e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:fle.of(null)}),L8(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(mle).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(mle);for(let o=0;oe.source==r.active.source));if(i&&1==i.state)if(null==r.done){let e=new Mle(r.active.source,0);for(let t of r.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(i)}t.length&&this.view.dispatch({effects:Ele.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Dle,!1);if(t&&t.tooltip&&this.view.state.facet(mle).closeOnBlur){let n=t.open&&gee(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||this.view.dispatch({effects:fle.of(null)})}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:hle.of(!1)})),20),this.composing=0}}}),_le=o9.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 Qle{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}}class Lle{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,H3.TrackDel),n=e.mapPos(this.to,1,H3.TrackDel);return null==t||null==n?null:new Lle(this.field,t,n)}}class Hle{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],r=e.doc.lineAt(t),i=/^\s*/.exec(r.text)[0];for(let l of this.lines){if(n.length){let n=i,r=/^\t*/.exec(l)[0].length;for(let t=0;tnew Lle(e.field,o[e.line]+e.from,o[e.line]+e.to)))}}static parse(e){let t,n=[],o=[],r=[];for(let i of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(i);){let e=t[1]?+t[1]:null,l=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}r.push(new Qle(a,o.length,t.index,t.index+l.length)),i=i.slice(0,t.index)+l+i.slice(t.index+t[0].length)}for(let e;e=/\\([{}])/.exec(i);){i=i.slice(0,e.index)+e[1]+i.slice(e.index+e[0].length);for(let t of r)t.line==o.length&&t.from>e.index&&(t.from--,t.to--)}o.push(i)}return new Hle(o,r)}}let Fle=w8.widget({widget:new class extends y8{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),Wle=w8.mark({class:"cm-snippetField"});class Xle{constructor(e,t){this.ranges=e,this.active=t,this.deco=w8.set(e.map((e=>(e.from==e.to?Fle:Wle).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new Xle(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const Yle=E4.define({map:(e,t)=>e&&e.map(t)}),Vle=E4.define(),Zle=s4.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(Yle))return n.value;if(n.is(Vle)&&e)return new Xle(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>o9.decorations.from(e,(e=>e?e.deco:w8.none))});function Ule(e,t){return q3.create(e.filter((e=>e.field==t)).map((e=>q3.range(e.from,e.to))))}function Kle(e){let t=Hle.parse(e);return(e,n,o,r)=>{let{text:i,ranges:l}=t.instantiate(e.state,o),a={changes:{from:o,to:r,insert:O3.of(i)},scrollIntoView:!0,annotations:n?ule.of(n):void 0};if(l.length&&(a.selection=Ule(l,0)),l.length>1){let t=new Xle(l,0),n=a.effects=[Yle.of(t)];void 0===e.state.field(Zle,!1)&&n.push(E4.appendConfig.of([Zle,eae,nae,_le]))}e.dispatch(e.state.update(a))}}function Gle(e){return({state:t,dispatch:n})=>{let o=t.field(Zle,!1);if(!o||e<0&&0==o.active)return!1;let r=o.active+e,i=e>0&&!o.ranges.some((t=>t.field==r+e));return n(t.update({selection:Ule(o.ranges,r),effects:Yle.of(i?null:new Xle(o.ranges,r)),scrollIntoView:!0})),!0}}const qle=[{key:"Tab",run:Gle(1),shift:Gle(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(Zle,!1)&&(t(e.update({effects:Yle.of(null)})),!0)}],Jle=t4.define({combine:e=>e.length?e[0]:qle}),eae=f4.highest(d9.compute([Jle],(e=>e.facet(Jle))));function tae(e,t){return Object.assign(Object.assign({},t),{apply:Kle(e)})}const nae=o9.domEventHandlers({mousedown(e,t){let n,o=t.state.field(Zle,!1);if(!o||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=o.ranges.find((e=>e.from<=n&&e.to>=n));return!(!r||r.field==o.active||(t.dispatch({selection:Ule(o.ranges,r.field),effects:Yle.of(o.ranges.some((e=>e.field>r.field))?new Xle(o.ranges,r.field):null),scrollIntoView:!0}),0))}}),oae={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},rae=E4.define({map(e,t){let n=t.mapPos(e,-1,H3.TrackAfter);return null==n?void 0:n}}),iae=new class extends X4{};iae.startSide=1,iae.endSide=-1;const lae=s4.define({create:()=>U4.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(rae)&&(e=e.update({add:[iae.range(n.value,n.value+1)]}));return e}}),aae="()[]{}<>";function sae(e){for(let t=0;t<8;t+=2)if(aae.charCodeAt(t)==e)return aae.charAt(t+1);return _3(e<128?e:e+1)}function cae(e,t){return e.languageDataAt("closeBrackets",t)[0]||oae}const uae="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),dae=o9.inputHandler.of(((e,t,n,o)=>{if((uae?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(o.length>2||2==o.length&&1==Q3(N3(o,0))||t!=r.from||n!=r.to)return!1;let i=function(e,t){let n=cae(e,e.selection.main.head),o=n.brackets||oae.brackets;for(let r of o){let i=sae(N3(r,0));if(t==r)return i==r?vae(e,r,o.indexOf(r+r+r)>-1,n):gae(e,r,i,n.before||oae.before);if(t==i&&hae(e,e.selection.main.from))return mae(e,0,i)}return null}(e.state,o);return!!i&&(e.dispatch(i),!0)})),pae=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=cae(e,e.selection.main.head).brackets||oae.brackets,o=null,r=e.changeByRange((t=>{if(t.empty){let o=function(e,t){let n=e.sliceString(t-2,t);return Q3(N3(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let r of n)if(r==o&&fae(e.doc,t.head)==sae(N3(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:q3.cursor(t.head-r.length)}}return{range:o=t}}));return o||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!o}}];function hae(e,t){let n=!1;return e.field(lae).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function fae(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Q3(N3(n,0)))}function gae(e,t,n,o){let r=null,i=e.changeByRange((i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:rae.of(i.to+t.length),range:q3.range(i.anchor+t.length,i.head+t.length)};let l=fae(e.doc,i.head);return!l||/\s/.test(l)||o.indexOf(l)>-1?{changes:{insert:t+n,from:i.head},effects:rae.of(i.head+t.length),range:q3.cursor(i.head+t.length)}:{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function mae(e,t,n){let o=null,r=e.changeByRange((t=>t.empty&&fae(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:q3.cursor(t.head+n.length)}:o={range:t}));return o?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function vae(e,t,n,o){let r=o.stringPrefixes||oae.stringPrefixes,i=null,l=e.changeByRange((o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:t,from:o.to}],effects:rae.of(o.to+t.length),range:q3.range(o.anchor+t.length,o.head+t.length)};let l,a=o.head,s=fae(e.doc,a);if(s==t){if(bae(e,a))return{changes:{insert:t+t,from:a},effects:rae.of(a+t.length),range:q3.cursor(a+t.length)};if(hae(e,a)){let o=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+o.length,insert:o},range:q3.cursor(a+o.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=yae(e,a-2*t.length,r))>-1&&bae(e,l))return{changes:{insert:t+t+t+t,from:a},effects:rae.of(a+t.length),range:q3.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=_4.Word&&yae(e,a,r)>-1&&!function(e,t,n,o){let r=rne(e).resolveInner(t,-1),i=o.reduce(((e,t)=>Math.max(e,t.length)),0);for(let l=0;l<5;l++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+i)),a=l.indexOf(n);if(!a||a>-1&&o.indexOf(l.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let s=r.to==t&&r.parent;if(!s)break;r=s}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:rae.of(a+t.length),range:q3.cursor(a+t.length)}}return{range:i=o}}));return i?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function bae(e,t){let n=rne(e).resolveInner(t+1);return n.parent&&n.from==t}function yae(e,t,n){let o=e.charCategorizer(t);if(o(e.sliceDoc(t-1,t))!=_4.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&o(e.sliceDoc(n-1,n))!=_4.Word)return n}return-1}function Oae(e={}){return[Dle,mle.of(e),Nle,Sae,_le]}const wae=[{key:"Ctrl-Space",run:e=>!!e.state.field(Dle,!1)&&(e.dispatch({effects:hle.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(Dle,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:fle.of(null)}),0))}},{key:"ArrowDown",run:Ble(!0)},{key:"ArrowUp",run:Ble(!1)},{key:"PageDown",run:Ble(!0,"page")},{key:"PageUp",run:Ble(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(Dle,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.facet(mle).defaultKeymap?[wae]:[])));class xae{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class $ae{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let o=e,r=n.facet(Nae).markerFilter;r&&(o=r(o));let i=w8.set(o.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?w8.widget({widget:new Fae(e),diagnostic:e}).range(e.from):w8.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new $ae(i,t,Cae(i))}}function Cae(e,t=null,n=0){let o=null;return e.between(n,1e9,((e,n,{spec:r})=>{if(!t||r.diagnostic==t)return o=new xae(e,n,r.diagnostic),!1})),o}function kae(e,t){let n=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(Tae)))&&!e.changes.touchesRange(n.from,n.to))}function Pae(e,t){return e.field(Eae,!1)?t:t.concat(E4.appendConfig.of(ose))}const Tae=E4.define(),Mae=E4.define(),Iae=E4.define(),Eae=s4.define({create:()=>new $ae(w8.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),o=null;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);o=Cae(n,e.selected.diagnostic,r)||Cae(n,null,r)}e=new $ae(n,e.panel,o)}for(let n of t.effects)n.is(Tae)?e=$ae.init(n.value,e.panel,t.state):n.is(Mae)?e=new $ae(e.diagnostics,n.value?Xae.open:null,e.selected):n.is(Iae)&&(e=new $ae(e.diagnostics,e.panel,n.value));return e},provide:e=>[See.from(e,(e=>e.panel)),o9.decorations.from(e,(e=>e.diagnostics))]}),Aae=w8.mark({class:"cm-lintRange cm-lintRange-active"});function Dae(e,t,n){let{diagnostics:o}=e.state.field(Eae),r=[],i=2e8,l=0;o.between(t-(n<0?1:0),t+(n>0?1:0),((e,o,{spec:a})=>{t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t({dom:Rae(e,r)})}:null}function Rae(e,t){return eie("ul",{class:"cm-tooltip-lint"},t.map((t=>Hae(e,t,!1))))}const zae=e=>{let t=e.state.field(Eae,!1);return!(!t||!t.panel||(e.dispatch({effects:Mae.of(!1)}),0))},Bae=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Eae,!1);t&&t.panel||e.dispatch({effects:Pae(e.state,[Mae.of(!0)])});let n=bee(e,Xae.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Eae,!1);if(!t)return!1;let n=e.state.selection.main,o=t.diagnostics.iter(n.to+1);return!(!o.value&&(o=t.diagnostics.iter(0),!o.value||o.from==n.from&&o.to==n.to)||(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),0))}}],jae=X8.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Nae);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view))))).then((t=>{let n=t.reduce(((e,t)=>e.concat(t)));this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:Pae(e,[Tae.of(t)])}}(this.view.state,n))}),(e=>{L8(this.view.state,e)}))}}update(e){let t=e.state.facet(Nae);(e.docChanged||t!=e.startState.facet(Nae)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Nae=t4.define({combine:e=>Object.assign({sources:e.map((e=>e.source))},W4(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function _ae(e,t={}){return[Nae.of({source:e,config:t}),jae,ose]}function Qae(e){let t=e.plugin(jae);t&&t.force()}function Lae(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;ee.toLowerCase()==o.toLowerCase()))){t.push(o);continue e}}t.push("")}return t}function Hae(e,t,n){var o;let r=n?Lae(t.actions):[];return eie("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},eie("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(o=t.actions)||void 0===o?void 0:o.map(((n,o)=>{let i=!1,l=o=>{if(o.preventDefault(),i)return;i=!0;let r=Cae(e.state.field(Eae).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:a}=n,s=r[o]?a.indexOf(r[o]):-1,c=s<0?a:[a.slice(0,s),eie("u",a.slice(s,s+1)),a.slice(s+1)];return eie("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${a}${s<0?"":` (access key "${r[o]})"`}.`},c)})),t.source&&eie("div",{class:"cm-diagnosticSource"},t.source))}class Fae extends y8{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return eie("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Wae{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Hae(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Xae{constructor(e){this.view=e,this.items=[],this.list=eie("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)zae(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],o=Lae(n.actions);for(let r=0;r{for(let t=0;tzae(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Eae).selected;if(!e)return-1;for(let t=0;t{let a,s=-1;for(let t=n;tn&&(this.items.splice(n,s-n),o=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.topt.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Cae(this.view.state.field(Eae).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Iae.of(t)})}static open(e){return new Xae(e)}}function Yae(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function Vae(e){return Yae(``,'width="6" height="3"')}const Zae=o9.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:Vae("#d11")},".cm-lintRange-warning":{backgroundImage:Vae("orange")},".cm-lintRange-info":{backgroundImage:Vae("#999")},".cm-lintRange-hint":{backgroundImage:Vae("#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}}});function Uae(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}class Kae extends xee{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>Uae(e)function(e,t,n){function o(){let o=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(o.from)&&e.dispatch({effects:ese.of({pos:o.from,above:!1,create:()=>({dom:Rae(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=o=>{let r=t.getBoundingClientRect();if(!(o.clientX>r.left-10&&o.clientXr.top-10&&o.clientY{clearTimeout(i),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(i),i=setTimeout(o,r)}}(e,t,n)),t}}function Gae(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let o=[];for(let r in n)o.push(new Kae(n[r]).range(+r));return U4.of(o,!0)}const qae=Pee({class:"cm-gutter-lint",markers:e=>e.state.field(Jae)}),Jae=s4.define({create:()=>U4.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(rse).markerFilter;for(let o of t.effects)if(o.is(Tae)){let r=o.value;n&&(r=n(r||[])),e=Gae(t.state.doc,r.slice(0))}return e}}),ese=E4.define(),tse=s4.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=kae(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce(((e,t)=>t.is(ese)?t.value:e),e)),provide:e=>cee.from(e)}),nse=o9.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Yae('')},".cm-lint-marker-warning":{content:Yae('')},".cm-lint-marker-error":{content:Yae('')}}),ose=[Eae,o9.decorations.compute([Eae],(e=>{let{selected:t,panel:n}=e.field(Eae);return t&&n&&t.from!=t.to?w8.set([Aae.range(t.from,t.to)]):w8.none})),fee(Dae,{hideOn:kae}),Zae],rse=t4.define({combine:e=>W4(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function ise(e={}){return[rse.of(e),Jae,qae,nse,tse]}const lse=(()=>[Lee(),Wee,L9(),Qoe(),qne(),$9(),[A9,D9],F4.allowMultipleSelections.of(!0),F4.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:o}=e.newSelection.main,r=n.lineAt(o);if(o>r.from+200)return e;let i=n.sliceString(r.from,o);if(!t.some((e=>e.test(i))))return e;let{state:l}=e,a=-1,s=[];for(let{head:c}of l.selection.ranges){let e=l.doc.lineAt(c);if(e.from==a)continue;a=e.from;let t=yne(l,e.from);if(null==t)continue;let n=/^\s*/.exec(e.text)[0],o=bne(l,t);n!=o&&s.push({from:e.from,to:e.from+n.length,insert:o})}return s.length?[e,{changes:s,sequential:!0}]:e})),roe(aoe,{fallback:!0}),goe(),[dae,lae],Oae(),G9(),eee(),Y9,vie(),d9.of([...pae,...qre,...Gie,...nre,...Fne,...wae,...Bae])])(),ase=(()=>[L9(),Qoe(),$9(),roe(aoe,{fallback:!0}),d9.of([...qre,...nre])])();function sse(e,t={},n){const{props:o,domProps:r,on:i,...l}=t;return Wr(e,{...l,...o,...r,...i?(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):{})(i):{}},n)}var cse=Nn({name:"CodeMirror",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:""},theme:{type:Object,default:()=>{}},dark:{type:Boolean,default:!1},basic:{type:Boolean,default:!1},minimal:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},allowMultipleSelections:{type:Boolean,default:!1},tabSize:{type:Number,default:void 0},lineSeparator:{type:String,default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,defalt:!1},gutterConfig:{type:Object,default:()=>{}},tag:{type:String,default:"div"}},emits:{"update:modelValue":e=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,t){const n=bt(),o=bt(e.modelValue),r=yt(new o9),i=Fr({get:()=>r.value.hasFocus,set:e=>{e&&r.value.focus()}}),l=Fr({get:()=>r.value.state.selection,set:e=>r.value.dispatch({selection:e})}),a=Fr({get:()=>r.value.state.selection.main.head,set:e=>r.value.dispatch({selection:{anchor:e}})}),s=Fr({get:()=>r.value.state.toJSON(),set:e=>r.value.setState(F4.fromJSON(e))}),c=bt(0),u=bt(0),d=Fr((()=>{const n=new m4,o=new m4;return[e.basic?lse:void 0,e.minimal&&!e.basic?ase:void 0,o9.updateListener.of((n=>{t.emit("focus",r.value.hasFocus),c.value=r.value.state.doc.length,!n.changes.empty&&n.docChanged&&(e.linter&&(e.forceLinting&&Qae(r.value),u.value=e.linter(r.value).length),t.emit("update",n))})),o9.theme(e.theme,{dark:e.dark}),e.wrap?o9.lineWrapping:void 0,e.tab?d9.of([Jre]):void 0,F4.allowMultipleSelections.of(e.allowMultipleSelections),e.tabSize?o.of(F4.tabSize.of(e.tabSize)):void 0,e.phrases?F4.phrases.of(e.phrases):void 0,F4.readOnly.of(e.readonly),o9.editable.of(!e.disabled),e.lineSeparator?F4.lineSeparator.of(e.lineSeparator):void 0,e.lang?n.of(e.lang):void 0,e.linter?_ae(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?ise(e.gutterConfig):void 0,e.placeholder?(i=e.placeholder,X8.fromClass(class{constructor(e){this.view=e,this.placeholder=i?w8.set([w8.widget({widget:new V9(i),side:1}).range(0)]):w8.none}get decorations(){return this.view.state.doc.length?w8.none:this.placeholder}},{decorations:e=>e.decorations})):void 0,...e.extensions].filter((e=>!!e));var i}));yn(d,(e=>{var t;null==(t=r.value)||t.dispatch({effects:E4.reconfigure.of(e)})}),{immediate:!0}),yn((()=>e.modelValue),(async t=>{r.value.composing||r.value.state.doc.toJSON().join(e.lineSeparator??"\n")===t||r.value.dispatch({changes:{from:0,to:r.value.state.doc.length,insert:t},selection:r.value.state.selection,scrollIntoView:!0})}),{immediate:!0}),Zn((async()=>{let e=o.value;n.value&&(n.value.childNodes[0]&&(o.value,e=n.value.childNodes[0].innerText.trim()),r.value=new o9({parent:n.value,state:F4.create({doc:e,extensions:d.value}),dispatch:e=>{r.value.update([e]),!e.changes.empty&&e.docChanged&&(t.emit("update:modelValue",e.state.doc.toString()),t.emit("change",e.state))}}),await Wt(),t.emit("ready",{view:r.value,state:r.value.state,container:n.value}))})),qn((()=>{r.value.destroy(),t.emit("destroy")}));const p={editor:n,view:r,cursor:a,selection:l,focus:i,length:c,json:s,diagnosticCount:u,dom:r.value.contentDOM,lint:()=>{e.linter&&r.value&&(e.forceLinting&&Qae(r.value),u.value=function(e){let t=e.field(Eae,!1);return t?t.diagnostics.size:0}(r.value.state))},forceReconfigure:()=>{var e,t;null==(e=r.value)||e.dispatch({effects:E4.reconfigure.of([])}),null==(t=r.value)||t.dispatch({effects:E4.appendConfig.of(d.value)})},getRange:(e,t)=>r.value.state.sliceDoc(e,t),getLine:e=>r.value.state.doc.line(e+1).text,lineCount:()=>r.value.state.doc.lines,getCursor:()=>r.value.state.selection.main.head,listSelections:()=>{let e;return null!==(e=r.value.state.selection.ranges)&&void 0!==e?e:[]},getSelection:()=>{let e;return null!==(e=r.value.state.sliceDoc(r.value.state.selection.main.from,r.value.state.selection.main.to))&&void 0!==e?e:""},getSelections:()=>{const e=r.value.state;return e?e.selection.ranges.map((t=>e.sliceDoc(t.from,t.to))):[]},somethingSelected:()=>r.value.state.selection.ranges.some((e=>!e.empty)),replaceRange:(e,t,n)=>r.value.dispatch({changes:{from:t,to:n,insert:e}}),replaceSelection:e=>r.value.dispatch(r.value.state.replaceSelection(e)),setCursor:e=>r.value.dispatch({selection:{anchor:e}}),setSelection:(e,t)=>r.value.dispatch({selection:{anchor:e,head:t}}),setSelections:(e,t)=>r.value.dispatch({selection:q3.create(e,t)}),extendSelectionsBy:e=>r.value.dispatch({selection:q3.create(l.value.ranges.map((t=>t.extend(e(t)))))})};return t.expose(p),p},render(){return sse(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?sse("aside",{style:"display: none;","aria-hidden":"true"},"function"==typeof(e=this.$slots.default)?e():e):void 0);var e}});const use="#e06c75",dse="#abb2bf",pse="#7d8799",hse="#d19a66",fse="#2c313a",gse="#282c34",mse="#353a42",vse="#528bff",bse=[o9.theme({"&":{color:dse,backgroundColor:gse},".cm-content":{caretColor:vse},".cm-cursor, .cm-dropCursor":{borderLeftColor:vse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:dse},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:gse,color:pse,border:"none"},".cm-activeLineGutter":{backgroundColor:fse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:mse},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:mse,borderBottomColor:mse},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:fse,color:dse}}},{dark:!0}),roe(eoe.define([{tag:Kte.keyword,color:"#c678dd"},{tag:[Kte.name,Kte.deleted,Kte.character,Kte.propertyName,Kte.macroName],color:use},{tag:[Kte.function(Kte.variableName),Kte.labelName],color:"#61afef"},{tag:[Kte.color,Kte.constant(Kte.name),Kte.standard(Kte.name)],color:hse},{tag:[Kte.definition(Kte.name),Kte.separator],color:dse},{tag:[Kte.typeName,Kte.className,Kte.number,Kte.changed,Kte.annotation,Kte.modifier,Kte.self,Kte.namespace],color:"#e5c07b"},{tag:[Kte.operator,Kte.operatorKeyword,Kte.url,Kte.escape,Kte.regexp,Kte.link,Kte.special(Kte.string)],color:"#56b6c2"},{tag:[Kte.meta,Kte.comment],color:pse},{tag:Kte.strong,fontWeight:"bold"},{tag:Kte.emphasis,fontStyle:"italic"},{tag:Kte.strikethrough,textDecoration:"line-through"},{tag:Kte.link,color:pse,textDecoration:"underline"},{tag:Kte.heading,fontWeight:"bold",color:use},{tag:[Kte.atom,Kte.bool,Kte.special(Kte.variableName)],color:hse},{tag:[Kte.processingInstruction,Kte.string,Kte.inserted],color:"#98c379"},{tag:Kte.invalid,color:"#ffffff"}]))];var yse={};class Ose{constructor(e,t,n,o,r,i,l,a,s,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=o,this.pos=r,this.score=i,this.buffer=l,this.bufferBase=a,this.curContext=s,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let o=e.parser.context;return new Ose(e,[],t,n,n,0,[],0,o?new wse(o,o.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 n=e>>19,o=65535&e,{parser:r}=this.p,i=r.dynamicPrecedence(o);if(i&&(this.score+=i),0==n)return this.pushState(r.getGoto(this.state,o,!0),this.reducePos),o=2e3&&!(null===(t=this.p.parser.nodeSet.types[o])||void 0===t?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=s):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(o,a)}storeNode(e,t,n,o=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[o-4]&&e.buffer[o-1]>-1){if(t==n)return;if(e.buffer[o-2]>=t)return void(e.buffer[o-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,o>4&&(o-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=o}else this.buffer.push(e,t,n,o)}shift(e,t,n,o){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:i}=this.p;(o>this.pos||t<=i.maxNode)&&(this.pos=o,i.stateFlag(r,1)||(this.reducePos=o)),this.pushState(r,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,o,4)}else this.pos=o,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,o,4)}apply(e,t,n,o){65536&e?this.reduce(e):this.shift(e,t,n,o)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(n,o,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 n=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new Ose(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Sse(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(0==(65536&n))return!0;t.reduce(n)}}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 n=[];for(let o,r=0;r1&t&&e==o))||n.push(t[e],o)}t=n}let n=[];for(let o=0;o>19,o=65535&t,r=this.stack.length-3*n;if(r<0||e.getGoto(this.stack[r],o,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}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=[],n=(o,r)=>{if(!t.includes(o))return t.push(o),e.allActions(o,(t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let o=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],o,!1)>=0)return n<<19|65536|o}}else{let e=n(t,r+1);if(null!=e)return e}}))};return n(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(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!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 wse{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Sse{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}}class xse{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new xse(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(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,0==this.index&&this.maybeNext()}fork(){return new xse(this.stack,this.pos,this.index)}}function $se(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let o=0,r=0;o=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),i+=r,n)break;i*=46}n?n[r++]=i:n=new t(i)}return n}class Cse{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const kse=new Cse;class Pse{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=kse,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 n=this.range,o=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(o==this.ranges.length-1)return null;let e=this.ranges[++o];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t,n,o=this.chunkOff+e;if(o>=0&&o=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=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=kse,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 n="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(n+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return n}}class Tse{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Ese(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Tse.prototype.contextual=Tse.prototype.fallback=Tse.prototype.extend=!1;class Mse{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?$se(e):e}token(e,t){let n=e.pos,o=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(Ese(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||o++,null==r)break;e.reset(r,e.token)}o&&(e.reset(n,e.token),e.acceptToken(this.elseToken,o))}}Mse.prototype.contextual=Tse.prototype.fallback=Tse.prototype.extend=!1;class Ise{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ese(e,t,n,o,r,i){let l=0,a=1<0){let n=e[d];if(s.allows(n)&&(-1==t.token.value||t.token.value==n||Dse(n,t.token.value,r,i))){t.acceptToken(n);break}}let o=t.next,c=0,u=e[l+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c>1,i=n+r+(r<<1),a=e[i],s=e[i+1]||65536;if(o=s)){l=e[i+2],t.advance();continue e}c=r+1}}break}l=e[n+3*u-1]}}function Ase(e,t,n){for(let o,r=t;65535!=(o=e[r]);r++)if(o==n)return r-t;return-1}function Dse(e,t,n,o){let r=Ase(n,o,t);return r<0||Ase(n,o,e)t)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,t-25)):Math.min(e.length,Math.max(o.from+1,t+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:e.length}}class jse{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?Bse(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Bse(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=i,null;if(r instanceof ote){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+r.length}}}class Nse{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new Cse))}getActions(e){let t=0,n=null,{parser:o}=e.p,{tokenizers:r}=o,i=o.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let s=0;sc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!o.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new Cse,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Cse,{pos:n,p:o}=e;return t.start=n,t.end=Math.min(n+1,o.stream.end),t.value=n==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,n){let o=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(o,e),n),e.value>-1){let{parser:t}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,n,o){for(let r=0;r4*e.bufferLength?new jse(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,o=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;io)r.push(l);else{if(this.advanceStack(l,r,n))continue;{e||(e=[],t=[]),e.push(l);let n=this.tokens.getMainToken(l);t.push(n.value,n.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>o))&&this.recovering--}else if(r.length>1){e:for(let e=0;e500&&o.buffer.length>500){if(!((t.score-o.score||t.buffer.length-o.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(n--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let i=1;ithis.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let i=this.fragments.nodeAt(o);i;){let o=this.parser.nodeSet.types[i.type.id]==i.type?r.getGoto(e.state,i.type.id):-1;if(o>-1&&i.length&&(!t||(i.prop(Zee.contextHash)||0)==n))return e.useNode(i,o),!0;if(!(i instanceof ote)||0==i.children.length||i.positions[0]>0)break;let l=i.children[0];if(!(l instanceof ote&&0==i.positions[0]))break;i=l}}let i=r.stateSlot(e.state,4);if(i>0)return e.reduce(i),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;ao?t.push(u):n.push(u)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Qse(e,t),!0}}runRecovery(e,t,n){let o=null,r=!1;for(let i=0;i ":"";if(l.deadEnd){if(r)continue;if(r=!0,l.restart(),this.advanceFully(l,n))continue}let u=l.split(),d=c;for(let e=0;u.forceReduce()&&e<10&&!this.advanceFully(u,n);e++)Rse&&(d=this.stackID(u)+" -> ");for(let e of l.recoverByInsert(a))this.advanceFully(e,n);this.stream.end>l.pos?(s==l.pos&&(s++,a=0),l.recoverByDelete(a,s),Qse(l,n)):(!o||o.scoree;class Fse extends xte{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[t][1])),o=[];for(let l=0;l=0)r(n,e,l[t++]);else{let o=l[t+-n];for(let i=-n;i>0;i--)r(l[t++],e,o);t++}}}this.nodeSet=new qee(t.map(((t,r)=>Gee.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:o[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Xee;let i=$se(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l"number"==typeof e?new Tse(i,e):e)),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,n){let o=new _se(this,e,t,n);for(let r of this.wrappers)o=r(o,e,t,n);return o}getGoto(e,t,n=!1){let o=this.goto;if(t>=o[0])return-1;for(let r=o[t+1];;){let t=o[r++],i=1&t,l=o[r++];if(i&&n)return l;for(let n=r+(t>>1);r0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let n=this.stateSlot(e,4),o=n?t(n):void 0;for(let r=this.stateSlot(e,1);null==o;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=Wse(this.data,r+2)}o=t(Wse(this.data,r+1))}return o}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=Wse(this.data,n+2)}if(0==(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(Fse.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,o)=>{let r=e.specializers.find((e=>e.from==n.external));if(!r)return n;let i=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[o]=Xse(i),i}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(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 null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let o=null;for(let r=0;re.external(n,o)<<1|t}return e.get}const Yse=[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],Vse=new class{constructor(e){this.start=e.start,this.shift=e.shift||Hse,this.reduce=e.reduce||Hse,this.reuse=e.reuse||Hse,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:!1,shift:(e,t)=>3==t||4==t||311==t?e:312==t,strict:!1}),Zse=new Ise(((e,t)=>{let{next:n}=e;(125==n||-1==n||t.context)&&e.acceptToken(309)}),{contextual:!0,fallback:!0}),Use=new Ise(((e,t)=>{let n,{next:o}=e;Yse.indexOf(o)>-1||(47!=o||47!=(n=e.peek(1))&&42!=n)&&(125==o||59==o||-1==o||t.context||e.acceptToken(308))}),{contextual:!0}),Kse=new Ise(((e,t)=>{let{next:n}=e;if((43==n||45==n)&&(e.advance(),n==e.next)){e.advance();let n=!t.context&&t.canShift(1);e.acceptToken(n?1:2)}}),{contextual:!0}),Gse=Mte({"get set async static":Kte.modifier,"for while do if else switch try catch finally return throw break continue default case":Kte.controlKeyword,"in of await yield void typeof delete instanceof":Kte.operatorKeyword,"let var const using function class extends":Kte.definitionKeyword,"import export from":Kte.moduleKeyword,"with debugger as new":Kte.keyword,TemplateString:Kte.special(Kte.string),super:Kte.atom,BooleanLiteral:Kte.bool,this:Kte.self,null:Kte.null,Star:Kte.modifier,VariableName:Kte.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Kte.function(Kte.variableName),VariableDefinition:Kte.definition(Kte.variableName),Label:Kte.labelName,PropertyName:Kte.propertyName,PrivatePropertyName:Kte.special(Kte.propertyName),"CallExpression/MemberExpression/PropertyName":Kte.function(Kte.propertyName),"FunctionDeclaration/VariableDefinition":Kte.function(Kte.definition(Kte.variableName)),"ClassDeclaration/VariableDefinition":Kte.definition(Kte.className),PropertyDefinition:Kte.definition(Kte.propertyName),PrivatePropertyDefinition:Kte.definition(Kte.special(Kte.propertyName)),UpdateOp:Kte.updateOperator,"LineComment Hashbang":Kte.lineComment,BlockComment:Kte.blockComment,Number:Kte.number,String:Kte.string,Escape:Kte.escape,ArithOp:Kte.arithmeticOperator,LogicOp:Kte.logicOperator,BitOp:Kte.bitwiseOperator,CompareOp:Kte.compareOperator,RegExp:Kte.regexp,Equals:Kte.definitionOperator,Arrow:Kte.function(Kte.punctuation),": Spread":Kte.punctuation,"( )":Kte.paren,"[ ]":Kte.squareBracket,"{ }":Kte.brace,"InterpolationStart InterpolationEnd":Kte.special(Kte.brace),".":Kte.derefOperator,", ;":Kte.separator,"@":Kte.meta,TypeName:Kte.typeName,TypeDefinition:Kte.definition(Kte.typeName),"type enum interface implements namespace module declare":Kte.definitionKeyword,"abstract global Privacy readonly override":Kte.modifier,"is keyof unique infer":Kte.operatorKeyword,JSXAttributeValue:Kte.attributeValue,JSXText:Kte.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Kte.angleBracket,"JSXIdentifier JSXNameSpacedName":Kte.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Kte.attributeName,"JSXBuiltin/JSXIdentifier":Kte.standard(Kte.tagName)}),qse={__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},Jse={__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},ece={__proto__:null,"<":139},tce=Fse.deserialize({version:14,states:"$RQSO'#CcO>cQSO'#HZO>kQSO'#HaO>kQSO'#HcO`QUO'#HeO>kQSO'#HgO>kQSO'#HjO>pQSO'#HpO>uQ(C]O'#HvO%[QUO'#HxO?QQ(C]O'#HzO?]Q(C]O'#H|O9kQ(C[O'#IOO?hQ(CjO'#CgO@jQWO'#DgQOQSOOO%[QUO'#D}OAQQSO'#EQO:RQ,UO'#EhOA]QSO'#EhOAhQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Jm'#JmO%[QUO'#JmOOQO'#Jq'#JqOOQO'#Ia'#IaOBhQWO'#EaOOQ(CW'#E`'#E`OCdQ(C`O'#EaOCnQWO'#ETOOQO'#Jp'#JpODSQWO'#JqOEaQWO'#ETOCnQWO'#EaPEnO?MpO'#C`POOO)CDt)CDtOOOO'#IW'#IWOEyOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFXO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFgO07`O,59vOOQ(CY,59v,59vOFuQUO'#I[OGYQSO'#JkOI[QbO'#JkO+}QUO'#JkOIcQSO,59|OIyQSO'#EjOJWQSO'#JyOJcQSO'#JxOJcQSO'#JxOJkQSO,5;WOJpQSO'#JwOOQ(CY,5:X,5:XOJwQUO,5:XOLxQ(CjO,5:cOMiQSO,5:kONSQ(C[O'#JvONZQSO'#JuO9ZQSO'#JuONoQSO'#JuONwQSO,5;VON|QSO'#JuO!#UQbO'#JjOOQ(CY'#Cg'#CgO%[QUO'#EPO!#tQ`O,5:pOOQO'#Jr'#JrOOQO-ElOOQQ'#J_'#J_OOQQ,5>m,5>mOOQQ-EpQSO'#HPO9aQSO'#HRO!CgQSO'#HRO:RQ,UO'#HTO!ClQSO'#HTOOQQ,5=i,5=iO!CqQSO'#HUO!DSQSO'#CmO!DXQSO,58}O!DcQSO,58}O!FhQUO,58}OOQQ,58},58}O!FxQ(C[O,58}O%[QUO,58}O!ITQUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!IkQSO,5=uO`QUO,5={O`QUO,5=}O!IpQSO,5>PO`QUO,5>RO!IuQSO,5>UO!IzQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9kQ(C[O,5>dOOQQ,5>f,5>fO!NUQSO,5>fOOQQ,5>h,5>hO!NUQSO,5>hOOQQ,5>j,5>jO!NZQWO'#DYO%[QUO'#JmO!NxQWO'#JmO# gQWO'#DhO# xQWO'#DhO#$ZQUO'#DhO#$bQSO'#JlO#$jQSO,5:RO#$oQSO'#EnO#$}QSO'#JzO#%VQSO,5;XO#%[QWO'#DhO#%iQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#%pQSO,5:lO>pQSO,5;SO!@}QWO,5;SO!AVQ,UO,5;SO:RQ,UO,5;SO#%xQSO,5@XO#%}Q!LQO,5:pOOQO-E<_-E<_O#'TQ(C`O,5:{OCnQWO,5:oO#'_QWO,5:oOCnQWO,5:{O!@rQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#'lQ(C[O,5:{O#'wQ(C[O,5:{O!@}QWO,5:oOOQO,5;R,5;RO#(VQ(C[O,5:{POOO'#IU'#IUP#(kO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#)VQUO'#I[OOQO-EpQ(CjO1G0yO#>wQ(CjO1G0yO#@oQ(CjO1G0yO#CoQ$IUO'#CgO#EmQ$IUO1G1[O#EtQ$IUO'#JjO!,lQSO1G1bO#FUQ(CjO,5?SOOQ(CW-EkQSO1G3kO$1UQUO1G3mO$5YQUO'#HlOOQQ1G3p1G3pO$5gQSO'#HrO>pQSO'#HtOOQQ1G3v1G3vO$5oQUO1G3vO9kQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9kQ(C[O1G4QO9kQ(C[O1G4SO$9vQSO,5@XO!*fQUO,5;YO9ZQSO,5;YO>pQSO,5:SO!*fQUO,5:SO!@}QWO,5:SO$9{Q$IUO,5:SOOQO,5;Y,5;YO$:VQWO'#I]O$:mQSO,5@WOOQ(CY1G/m1G/mO$:uQWO'#IcO$;PQSO,5@fOOQ(CW1G0s1G0sO# xQWO,5:SOOQO'#I`'#I`O$;XQWO,5:nOOQ(CY,5:n,5:nO#%sQSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>pQSO1G0nO!@}QWO1G0nO!AVQ,UO1G0nOOQ(CW1G5s1G5sO!@rQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$;`Q(C[O1G0gO$;kQ(C[O1G0gO!@}QWO1G0ZOCnQWO1G0ZO$;yQ(C[O1G0gOOQO1G0Z1G0ZO$<_Q(CjO1G0gPOOO-EvO$<{QSO1G5qO$=TQSO1G6OO$=]QbO1G6PO9ZQSO,5>|O$=gQ(CjO1G5|O%[QUO1G5|O$=wQ(C[O1G5|O$>YQSO1G5{O$>YQSO1G5{O9ZQSO1G5{O$>bQSO,5?PO9ZQSO,5?POOQO,5?P,5?PO$>vQSO,5?PO$'TQSO,5?POOQO-EWOOQQ,5>W,5>WO%[QUO'#HmO%6UQSO'#HoOOQQ,5>^,5>^O9ZQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%6ZQWO1G5sO%6oQ$IUO1G0tO%6yQSO1G0tOOQO1G/n1G/nO%7UQ$IUO1G/nO>pQSO1G/nO!*fQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EpQSO7+&YO!@}QWO7+&YOOQO7+%u7+%uO$<_Q(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%7`Q(C[O7+&RO!@rQ(C[O7+%uO!@}QWO7+%uO%7kQ(C[O7+&RO%7yQ(CjO7++hO%[QUO7++hO%8ZQSO7++gO%8ZQSO7++gOOQO1G4k1G4kO9ZQSO1G4kO%8cQSO1G4kOOQO7+%z7+%zO#%sQSO<xOOQO-E<[-E<[O%DoQbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%DyQSO1G5uOOQ(CY<XOOQQ,5>Z,5>ZO&4ZQSO1G3xO9ZQSO7+&`O!*fQUO7+&`OOQO7+%Y7+%YO&4`Q$IUO1G6PO>pQSO7+%YOOQ(CY<pQSO<qQbO1G4eO&>{Q$IUO7+&ZO&APQ$IUO,5=QO&CWQ$IUO,5=SO&ChQ$IUO,5=QO&CxQ$IUO,5=SO&DYQ$IUO,59oO&F]Q$IUO,5pQSO7+)dO'%_QSO<{AN>{O%[QUOAN?XOOQO<a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#IpP#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r 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:371,context:Vse,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:[Gse],skippedNodes:[0,3,4,270],repeatNodeCount:37,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$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'}p(Q!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j(Q!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Q!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'}pOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'}pOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'}p(Q!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'}p(Q!b's(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(O#S$e&j't(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'}p(Q!b't(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'}p(Q!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'}p(Q!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'}p(Q!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'|$(n$e&j(Q!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j(Q!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j(Q!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ(Q!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t(Q!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'}p(Q!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS(Q!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'}pOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'}pOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'}p(Q!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j(Q!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(Q!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(Q!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(Q!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j(Q!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'}p(Q!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'}p(Q!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#qse[e]||-1},{term:334,get:e=>Jse[e]||-1},{term:68,get:e=>ece[e]||-1}],tokenPrec:14574}),nce=[tae("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),tae("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),tae("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),tae("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),tae("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),tae("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),tae("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),tae("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),tae("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),tae('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),tae('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],oce=nce.concat([tae("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),tae("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),tae("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),rce=new wte,ice=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function lce(e){return(t,n)=>{let o=t.node.getChild("VariableDefinition");return o&&n(o,e),!0}}const ace=["FunctionDeclaration"],sce={FunctionDeclaration:lce("function"),ClassDeclaration:lce("class"),ClassExpression:()=>!0,EnumDeclaration:lce("constant"),TypeAliasDeclaration:lce("type"),NamespaceDeclaration:lce("namespace"),VariableDefinition(e,t){e.matchContext(ace)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function cce(e,t){let n=rce.get(t);if(n)return n;let o=[],r=!0;function i(t,n){let r=e.sliceString(t.from,t.to);o.push({label:r,type:n})}return t.cursor(tte.IncludeAnonymous).iterate((t=>{if(r)r=!1;else if(t.name){let e=sce[t.name];if(e&&e(t,i)||ice.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of cce(e,t.node))o.push(n);return!1}})),rce.set(t,o),o}const uce=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,dce=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function pce(e){let t=rne(e.state).resolveInner(e.pos,-1);if(dce.indexOf(t.name)>-1)return null;let n="VariableName"==t.name||t.to-t.from<20&&uce.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let o=[];for(let r=t;r;r=r.parent)ice.has(r.name)&&(o=o.concat(cce(e.state.doc,r)));return{options:o,from:n?t.from:e.pos,validFor:uce}}const hce=one.define({name:"javascript",parser:tce.configure({props:[wne.add({IfStatement:Mne({except:/^\s*({|else\b)/}),TryStatement:Mne({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:e=>e.baseIndent,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),o=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:o?1:2)*e.unit},Block:Pne({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Mne({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),Ene.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to({from:e.from+2,to:e.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),fce={test:e=>/^JSX/.test(e.name),facet:Jte({commentTokens:{block:{open:"{/*",close:"*/}"}}})},gce=hce.configure({dialect:"ts"},"typescript"),mce=hce.configure({dialect:"jsx",props:[ene.add((e=>e.isTop?[fce]:void 0))]}),vce=hce.configure({dialect:"jsx ts",props:[ene.add((e=>e.isTop?[fce]:void 0))]},"typescript");let bce=e=>({label:e,type:"keyword"});const yce="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(bce),Oce=yce.concat(["declare","implements","private","protected","public"].map(bce));function wce(e={}){let t=e.jsx?e.typescript?vce:mce:e.typescript?gce:hce,n=e.typescript?oce.concat(Oce):nce.concat(yce);return new fne(t,[hce.data.of({autocomplete:(o=dce,r=lle(n),e=>{for(let t=rne(e.state).resolveInner(e.pos,-1);t;t=t.parent){if(o.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return r(e)})}),hce.data.of({autocomplete:pce}),e.jsx?$ce:[]]);var o,r}function Sce(e,t,n=e.length){for(let o=null==t?void 0:t.firstChild;o;o=o.nextSibling)if("JSXIdentifier"==o.name||"JSXBuiltin"==o.name||"JSXNamespacedName"==o.name||"JSXMemberExpression"==o.name)return e.sliceString(o.from,Math.min(o.to,n));return""}const xce="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),$ce=o9.inputHandler.of(((e,t,n,o,r)=>{if((xce?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||">"!=o&&"/"!=o||!hce.isActiveAt(e.state,t,-1))return!1;let i=r(),{state:l}=i,a=l.changeByRange((e=>{var t;let n,{head:r}=e,i=rne(l).resolveInner(r-1,-1);if("JSXStartTag"==i.name&&(i=i.parent),l.doc.sliceString(r-1,r)!=o||"JSXAttributeValue"==i.name&&i.to>r);else{if(">"==o&&"JSXFragmentTag"==i.name)return{range:e,changes:{from:r,insert:""}};if("/"==o&&"JSXStartCloseTag"==i.name){let e=i.parent,o=e.parent;if(o&&e.from==r-2&&((n=Sce(l.doc,o.firstChild,r))||"JSXFragmentTag"==(null===(t=o.firstChild)||void 0===t?void 0:t.name))){let e=`${n}>`;return{range:q3.cursor(r+e.length,-1),changes:{from:r,insert:e}}}}else if(">"==o){let t=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(i);if(t&&!/^\/?>|^<\//.test(l.doc.sliceString(r,r+2))&&(n=Sce(l.doc,t,r)))return{range:e,changes:{from:r,insert:``}}}}return{range:e}}));return!a.changes.empty&&(e.dispatch([i,l.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),Cce=A2(Nn({__name:"BranchDrawer",props:{open:F1().def(!1),len:X1().def(0),modelValue:V1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1),i=bt({}),l=bt({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"500px",overflowY:"auto",overflowX:"hidden"}});yn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{n("update:modelValue",i.value)},s=bt(),c=()=>{var e;null==(e=s.value)||e.validate().then((()=>{u(),n("save",i.value)})).catch((()=>{MB.warning("请检查表单信息")}))},u=()=>{n("update:open",!1),r.value=!1};return(t,n)=>{const o=hn("a-typography-paragraph"),d=hn("a-select-option"),p=hn("a-select"),h=hn("a-radio"),f=hn("a-radio-group"),g=hn("a-form-item"),m=hn("a-form"),v=hn("a-button"),b=hn("a-drawer");return sr(),hr(b,{open:r.value,"onUpdate:open":n[5]||(n[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:u},{title:an((()=>[Or(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:a},{editableEnterIcon:an((()=>[Sr(V(null))])),_:1},8,["content"])])),extra:an((()=>[Or(p,{value:i.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>i.value.priorityLevel=e),style:{width:"110px"}},{default:an((()=>[(sr(!0),pr(nr,null,oo(e.len-1,(e=>(sr(),hr(d,{key:e,value:e},{default:an((()=>[Sr("优先级 "+V(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:an((()=>[Or(v,{type:"primary",onClick:c},{default:an((()=>[Sr("保存")])),_:1}),Or(v,{style:{"margin-left":"12px"},onClick:u},{default:an((()=>[Sr("取消")])),_:1})])),default:an((()=>[Or(m,{layout:"vertical",ref_key:"formRef",ref:s,model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:an((()=>[Or(g,{name:["decision","logicalCondition"],label:"判定逻辑",rules:[{required:!0,message:"请选择判定逻辑",trigger:"change"}]},{default:an((()=>[Or(f,{value:i.value.decision.logicalCondition,"onUpdate:value":n[2]||(n[2]=e=>i.value.decision.logicalCondition=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(c2)),(e=>(sr(),hr(h,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(g,{name:["decision","expressionType"],label:"表达式类型",rules:[{required:!0,message:"请选择表达式类型",trigger:"change"}]},{default:an((()=>[Or(f,{value:i.value.decision.expressionType,"onUpdate:value":n[3]||(n[3]=e=>i.value.decision.expressionType=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(r2)),(e=>(sr(),hr(h,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(g,{name:["decision","nodeExpression"],label:"条件表达式",rules:[{required:!0,message:"请填写条件表达式",trigger:"change"}]},{default:an((()=>[Or(xt(cse),{modelValue:i.value.decision.nodeExpression,"onUpdate:modelValue":n[4]||(n[4]=e=>i.value.decision.nodeExpression=e),theme:l.value,basic:"",lang:xt(wce)(),extensions:[xt(bse)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),[["__scopeId","data-v-6ec5cf8c"]]),kce=A2(Nn({__name:"BranchDesc",props:{modelValue:V1().def({})},setup(e){const t=e,n=bt("");Zn((()=>{var e;Wt((()=>{r()})),(null==(e=t.modelValue.decision)?void 0:e.nodeExpression)&&(n.value=t.modelValue.decision.nodeExpression)}));const o=bt({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"520px",overflowY:"auto",overflowX:"hidden"}}),r=()=>{const e=document.getElementById("branch-desc"),t=null==e?void 0:e.querySelector(".ant-descriptions-view"),n=null==t?void 0:t.querySelector("tbody"),o=document.createElement("tr");o.className="ant-descriptions-row";const r=document.createElement("th");r.className="ant-descriptions-item-label",r.innerHTML="条件表达式",r.setAttribute("colspan","4"),o.appendChild(r),null==n||n.insertBefore(o,null==n?void 0:n.childNodes[3]);const i=(null==n?void 0:n.getElementsByClassName("ant-descriptions-row"))[3];i.childNodes[2].remove();const l=i.querySelector(".ant-descriptions-item-content");l.setAttribute("style","padding: 0"),null==l||l.setAttribute("colspan","4")};return(t,r)=>{const i=hn("a-descriptions-item"),l=hn("a-descriptions");return sr(),hr(l,{id:"branch-desc",column:2,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(i,{label:"节点名称",span:2},{default:an((()=>[Sr(V(e.modelValue.nodeName),1)])),_:1}),Or(i,{label:"判定逻辑"},{default:an((()=>{var t;return[Sr(V(xt(c2)[null==(t=e.modelValue.decision)?void 0:t.logicalCondition]),1)]})),_:1}),Or(i,{label:"表达式类型"},{default:an((()=>{var t;return[Sr(V(xt(r2)[null==(t=e.modelValue.decision)?void 0:t.expressionType]),1)]})),_:1}),Or(i,{label:"条件表达式",span:2},{default:an((()=>[Or(xt(cse),{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=e=>n.value=e),readonly:"",disabled:"",theme:o.value,basic:"",lang:xt(wce)(),extensions:[xt(bse)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-dc9046db"]]),Pce=Nn({__name:"BranchDetail",props:{modelValue:V1().def({}),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1);yn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=hn("a-drawer");return sr(),hr(o,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:an((()=>[Or(kce,{"model-value":e.modelValue},null,8,["model-value"])])),_:1},8,["open"])}}}),Tce={class:"branch-wrap"},Mce={class:"branch-box-wrap"},Ice={class:"branch-box"},Ece={class:"condition-node"},Ace={class:"condition-node-box"},Dce=["onClick"],Rce=["onClick"],zce={class:"title"},Bce={class:"node-title"},jce={class:"priority-title"},Nce={class:"content"},_ce=["innerHTML"],Qce={key:1,class:"placeholder"},Lce=["onClick"],Hce={key:1,class:"top-left-cover-line"},Fce={key:2,class:"bottom-left-cover-line"},Wce={key:3,class:"top-right-cover-line"},Xce={key:4,class:"bottom-right-cover-line"},Yce=(e=>(rn("data-v-affb0f89"),e=e(),ln(),e))((()=>yr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[yr("span",{style:{"padding-left":"18px"}},"决策节点详情")],-1))),Vce=A2(Nn({__name:"BranchNode",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt({});yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{const e=i.value.conditionNodes.length;i.value.conditionNodes.splice(-1,0,{nodeName:"条件"+e,priorityLevel:e,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1}}),i.value.conditionNodes[e].priorityLevel=e+1},a=(e,t)=>{e.childNode?a(e.childNode,t):e.childNode=t},s=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},c=(e,t)=>{const{nodeName:n,decision:o}=e.conditionNodes[t],{logicalCondition:r,expressionType:i,nodeExpression:l}=o;return l?"其他情况"!==n?`${c2[r]}\n${r2[i]}\n${l}`:"如存在未满足其他分支条件的情况,则进入此分支":"其他情况"===n?"如存在未满足其他分支条件的情况,则进入此分支":void 0},u=bt(0),d=bt(!1),p=bt([]),h=bt({}),f=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&s(u.value,o-t),n("update:modelValue",i.value)},g=bt([]),m=bt(""),v=bt([]),b=(e,t)=>{var n,l;if(v.value=[],"其他情况"!==e.nodeName)if(2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=v.value)||t.push(e.id):e.jobId&&(m.value=e.jobId.toString())})),0===v.value.length)return void(p.value[t]=!0);g.value[t]=!0}else 1===r.TYPE?p.value[t]=!0:(l=t,o.disabled||l===i.value.conditionNodes.length-1?0!==r.TYPE&&(p.value[l]=!0):(u.value=l,h.value=JSON.parse(JSON.stringify(i.value.conditionNodes[l])),d.value=!0))},y=e=>o.disabled?2===r.TYPE?"其他情况"===e.nodeName?`node-disabled node-error node-error-${e.taskBatchStatus?d2[e.taskBatchStatus].name:"default"}`:`node-error node-error-${e.taskBatchStatus?d2[e.taskBatchStatus].name:"default"}`:"其他情况"===e.nodeName?"node-disabled":"node-error":"其他情况"===e.nodeName?"node-disabled":"auto-judge-def auto-judge-hover";return(t,o)=>{const u=hn("a-button"),O=hn("a-badge"),w=hn("a-tooltip");return sr(),pr("div",Tce,[yr("div",Mce,[yr("div",Ice,[e.disabled?xr("",!0):(sr(),hr(u,{key:0,class:"add-branch",primary:"",onClick:l},{default:an((()=>[Sr("添加条件")])),_:1})),(sr(!0),pr(nr,null,oo(i.value.conditionNodes,((o,l)=>(sr(),pr("div",{class:"col-box",key:l},[yr("div",Ece,[yr("div",Ace,[yr("div",{class:W(["auto-judge",y(o)]),onClick:e=>b(o,l)},[0!==l?(sr(),pr("div",{key:0,class:"sort-left",onClick:Li((e=>s(l,-1)),["stop"])},[Or(xt(FD))],8,Rce)):xr("",!0),yr("div",zce,[yr("span",Bce,[Or(O,{status:"processing",color:"#52c41a"}),Sr(" "+V(o.nodeName)+" ",1),"其他情况"===o.nodeName?(sr(),hr(w,{key:0},{title:an((()=>[Sr(" 该分支为系统默认创建,与其他分支互斥。只有当其他分支都无法运行时,才会运行该分支。 ")])),default:an((()=>[Or(xt(xx),{style:{"margin-left":"3px"}})])),_:1})):xr("",!0)]),yr("span",jce,"优先级"+V(o.priorityLevel),1),e.disabled?xr("",!0):(sr(),hr(xt(ey),{key:0,class:"close",onClick:Li((e=>{return t=l,null==(o=i.value.conditionNodes)||o.splice(t,1),void(1===i.value.conditionNodes.length&&(i.value.childNode&&(i.value.conditionNodes[0].childNode?a(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Wt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))));var t,o}),["stop"])},null,8,["onClick"]))]),yr("div",Nce,[c(i.value,l)?(sr(),pr("span",{key:0,innerHTML:c(i.value,l)},null,8,_ce)):(sr(),pr("span",Qce," 请设置条件 "))]),l!==i.value.conditionNodes.length-2?(sr(),pr("div",{key:1,class:"sort-right",onClick:Li((e=>s(l)),["stop"])},[Or(xt(uk))],8,Lce)):xr("",!0),2===xt(r).TYPE&&o.taskBatchStatus?(sr(),hr(w,{key:2},{title:an((()=>[Sr(V(xt(d2)[o.taskBatchStatus].title),1)])),default:an((()=>[Or(xt(o2),{class:"error-tip",color:xt(d2)[o.taskBatchStatus].color,size:"24px",onClick:Li((()=>{}),["stop"]),"model-value":xt(d2)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):xr("",!0)],10,Dce),Or(U2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?io(t.$slots,"default",{key:0,node:o},void 0,!0):xr("",!0),0==l?(sr(),pr("div",Hce)):xr("",!0),0==l?(sr(),pr("div",Fce)):xr("",!0),l==i.value.conditionNodes.length-1?(sr(),pr("div",Wce)):xr("",!0),l==i.value.conditionNodes.length-1?(sr(),pr("div",Xce)):xr("",!0),0!==xt(r).type&&p.value[l]?(sr(),hr(Pce,{key:5,open:p.value[l],"onUpdate:open":e=>p.value[l]=e,modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):xr("",!0),0!==xt(r).TYPE&&g.value[l]?(sr(),hr(xt(Q2),{key:6,open:g.value[l],"onUpdate:open":e=>g.value[l]=e,id:m.value,ids:v.value},{default:an((()=>[Yce,Or(kce,{modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["open","onUpdate:open","id","ids"])):xr("",!0)])))),128))]),Or(U2,{disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])]),Or(Cce,{open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:h.value,"onUpdate:modelValue":o[2]||(o[2]=e=>h.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:f},null,8,["open","modelValue","len"])])}}}),[["__scopeId","data-v-affb0f89"]]),Zce=Nn({__name:"CallbackDrawer",props:{open:F1().def(!1),len:X1().def(0),modelValue:V1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1),i=bt({});yn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{n("update:modelValue",i.value)},a=bt(),s=()=>{var e;null==(e=a.value)||e.validate().then((()=>{c(),n("save",i.value)})).catch((()=>{MB.warning("请检查表单信息")}))},c=()=>{n("update:open",!1),r.value=!1};return(e,t)=>{const n=hn("a-typography-paragraph"),o=hn("a-input"),u=hn("a-form-item"),d=hn("a-select-option"),p=hn("a-select"),h=hn("a-radio"),f=hn("a-radio-group"),g=hn("a-form"),m=hn("a-button"),v=hn("a-drawer");return sr(),hr(v,{open:r.value,"onUpdate:open":t[5]||(t[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:c},{title:an((()=>[Or(n,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":t[0]||(t[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:l},null,8,["content"])])),footer:an((()=>[Or(m,{type:"primary",onClick:s},{default:an((()=>[Sr("保存")])),_:1}),Or(m,{style:{"margin-left":"12px"},onClick:c},{default:an((()=>[Sr("取消")])),_:1})])),default:an((()=>[Or(g,{ref_key:"formRef",ref:a,layout:"vertical",model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:an((()=>[Or(u,{name:["callback","webhook"],label:"webhook",rules:[{required:!0,message:"请输入 webhook",trigger:"change"}]},{default:an((()=>[Or(o,{value:i.value.callback.webhook,"onUpdate:value":t[1]||(t[1]=e=>i.value.callback.webhook=e),placeholder:"请输入 webhook"},null,8,["value"])])),_:1}),Or(u,{name:["callback","contentType"],label:"请求类型",rules:[{required:!0,message:"请选择请求类型",trigger:"change"}]},{default:an((()=>[Or(p,{value:i.value.callback.contentType,"onUpdate:value":t[2]||(t[2]=e=>i.value.callback.contentType=e),placeholder:"请选择请求类型"},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(u2)),(e=>(sr(),hr(d,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(u,{name:["callback","secret"],label:"秘钥",rules:[{required:!0,message:"请输入秘钥",trigger:"change"}]},{default:an((()=>[Or(o,{value:i.value.callback.secret,"onUpdate:value":t[3]||(t[3]=e=>i.value.callback.secret=e),placeholder:"请输入秘钥"},null,8,["value"])])),_:1}),Or(u,{name:"workflowNodeStatus",label:"工作流状态",rules:[{required:!0,message:"请选择工作流状态",trigger:"change"}]},{default:an((()=>[Or(f,{value:i.value.workflowNodeStatus,"onUpdate:value":t[4]||(t[4]=e=>i.value.workflowNodeStatus=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(s2)),(e=>(sr(),hr(h,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),Uce=Nn({__name:"CallbackDetail",props:{modelValue:V1().def({}),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1);yn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=hn("a-descriptions-item"),l=hn("a-descriptions"),a=hn("a-drawer");return sr(),hr(a,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:an((()=>[Or(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(o,{label:"节点名称"},{default:an((()=>[Sr(V(e.modelValue.nodeName),1)])),_:1}),Or(o,{label:"webhook"},{default:an((()=>{var t;return[Sr(V(null==(t=e.modelValue.callback)?void 0:t.webhook),1)]})),_:1}),Or(o,{label:"请求类型"},{default:an((()=>{var t;return[Sr(V(xt(u2)[null==(t=e.modelValue.callback)?void 0:t.contentType]),1)]})),_:1}),Or(o,{label:"密钥"},{default:an((()=>{var t;return[Sr(V(null==(t=e.modelValue.callback)?void 0:t.secret),1)]})),_:1})])),_:1})])),_:1},8,["open"])}}}),Kce=e=>(rn("data-v-2d8dbc99"),e=e(),ln(),e),Gce={class:"node-wrap"},qce={class:"branch-box"},Jce={class:"condition-node",style:{"min-height":"230px"}},eue={class:"condition-node-box",style:{"padding-top":"0"}},tue={class:"popover"},nue=Kce((()=>yr("span",null,"重试",-1))),oue=Kce((()=>yr("span",null,"忽略",-1))),rue=["onClick"],iue={class:"title"},lue={class:"text",style:{color:"#935af6"}},aue={class:"content",style:{"min-height":"81px"}},sue={key:0,class:"placeholder"},cue={style:{display:"flex","justify-content":"space-between"}},uue=Kce((()=>yr("span",{class:"content_label"},"Webhook:",-1))),due=Kce((()=>yr("span",{class:"content_label"},"请求类型: ",-1))),pue=Kce((()=>yr("div",null,".........",-1))),hue={key:1,class:"top-left-cover-line"},fue={key:2,class:"bottom-left-cover-line"},gue={key:3,class:"top-right-cover-line"},mue={key:4,class:"bottom-right-cover-line"},vue=Kce((()=>yr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[yr("span",{style:{"padding-left":"18px"}},"回调节点详情")],-1))),bue=A2(Nn({__name:"CallbackNode",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt({}),l=bt({});yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Wt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=bt(0),u=bt(!1),d=bt(!1),p=bt({}),h=e=>{i.value.conditionNodes[c.value]=e,n("update:modelValue",i.value)},f=bt(!1),g=bt(""),m=bt([]),v=(e,t)=>{var n,o;if(m.value=[],2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),0===m.value.length)return void(d.value=!0);f.value=!0}else 1===r.TYPE?d.value=!0:(o=t,0===r.TYPE?(c.value=o,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[o])),u.value=!0):d.value=!0)},b=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus?d2[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover";return(t,n)=>{const o=hn("a-divider"),s=hn("a-button"),c=hn("a-badge"),y=hn("a-typography-text"),O=hn("a-tooltip"),w=hn("a-popover"),S=hn("a-descriptions-item"),x=hn("a-descriptions");return sr(),pr("div",Gce,[yr("div",qce,[(sr(!0),pr(nr,null,oo(i.value.conditionNodes,((n,u)=>(sr(),pr("div",{class:"col-box",key:u},[yr("div",Jce,[yr("div",eue,[Or(w,{open:l.value[u]&&2===xt(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[u]=e},{content:an((()=>[yr("div",tue,[Or(o,{type:"vertical"}),Or(s,{type:"text",class:"popover-item"},{default:an((()=>[Or(xt(RJ)),nue])),_:1}),Or(o,{type:"vertical"}),Or(s,{type:"text",class:"popover-item"},{default:an((()=>[Or(xt(fJ)),oue])),_:1})])])),default:an((()=>{var t,o;return[yr("div",{class:W(["auto-judge",b(n)]),onClick:e=>v(n,u)},[yr("div",iue,[yr("span",lue,[Or(c,{status:"processing",color:1===n.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Sr(" "+V(n.nodeName),1)]),e.disabled?xr("",!0):(sr(),hr(xt(ey),{key:0,class:"close",onClick:Li(a,["stop"])}))]),yr("div",aue,[(null==(t=n.callback)?void 0:t.webhook)?xr("",!0):(sr(),pr("div",sue,"请配置回调通知")),(null==(o=n.callback)?void 0:o.webhook)?(sr(),pr(nr,{key:1},[yr("div",cue,[uue,Or(y,{style:{width:"116px"},ellipsis:"",content:n.callback.webhook},null,8,["content"])]),yr("div",null,[due,Sr(" "+V(xt(u2)[n.callback.contentType]),1)]),pue],64)):xr("",!0)]),2===xt(r).TYPE&&n.taskBatchStatus?(sr(),hr(O,{key:0},{title:an((()=>[Sr(V(xt(d2)[n.taskBatchStatus].title),1)])),default:an((()=>[Or(xt(o2),{class:"error-tip",color:xt(d2)[n.taskBatchStatus].color,size:"24px",onClick:Li((()=>{}),["stop"]),"model-value":xt(d2)[n.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):xr("",!0)],10,rue)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Or(U2,{disabled:e.disabled,modelValue:n.childNode,"onUpdate:modelValue":e=>n.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),n.childNode?io(t.$slots,"default",{key:0,node:n},void 0,!0):xr("",!0),0==u?(sr(),pr("div",hue)):xr("",!0),0==u?(sr(),pr("div",fue)):xr("",!0),u==i.value.conditionNodes.length-1?(sr(),pr("div",gue)):xr("",!0),u==i.value.conditionNodes.length-1?(sr(),pr("div",mue)):xr("",!0)])))),128))]),i.value.conditionNodes.length>1?(sr(),hr(U2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):xr("",!0),0!==xt(r).type?(sr(),hr(Uce,{key:1,open:d.value,"onUpdate:open":n[1]||(n[1]=e=>d.value=e),modelValue:i.value.conditionNodes[0],"onUpdate:modelValue":n[2]||(n[2]=e=>i.value.conditionNodes[0]=e)},null,8,["open","modelValue"])):xr("",!0),Or(Zce,{open:u.value,"onUpdate:open":n[3]||(n[3]=e=>u.value=e),modelValue:p.value,"onUpdate:modelValue":n[4]||(n[4]=e=>p.value=e),onSave:h},null,8,["open","modelValue"]),0!==xt(r).TYPE&&f.value?(sr(),hr(xt(Q2),{key:2,open:f.value,"onUpdate:open":n[5]||(n[5]=e=>f.value=e),id:g.value,ids:m.value},{default:an((()=>[vue,Or(x,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(S,{label:"节点名称"},{default:an((()=>[Sr(V(i.value.conditionNodes[0].nodeName),1)])),_:1}),Or(S,{label:"webhook"},{default:an((()=>{var e;return[Sr(V(null==(e=i.value.conditionNodes[0].callback)?void 0:e.webhook),1)]})),_:1}),Or(S,{label:"请求类型"},{default:an((()=>{var e;return[Sr(V(xt(u2)[null==(e=i.value.conditionNodes[0].callback)?void 0:e.contentType]),1)]})),_:1}),Or(S,{label:"密钥"},{default:an((()=>{var e;return[Sr(V(null==(e=i.value.conditionNodes[0].callback)?void 0:e.secret),1)]})),_:1})])),_:1})])),_:1},8,["open","id","ids"])):xr("",!0)])}}}),[["__scopeId","data-v-2d8dbc99"]]),yue=Nn({__name:"NodeWrap",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=bt({});return yn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),yn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>{const o=hn("node-wrap",!0);return sr(),pr(nr,null,[1==r.value.nodeType?(sr(),hr(y3,{key:0,modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},{default:an((t=>[t.node?(sr(),hr(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):xr("",!0)])),_:1},8,["modelValue","disabled"])):xr("",!0),2==r.value.nodeType?(sr(),hr(Vce,{key:1,modelValue:r.value,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value=e),disabled:e.disabled},{default:an((t=>[t.node?(sr(),hr(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):xr("",!0)])),_:1},8,["modelValue","disabled"])):xr("",!0),3==r.value.nodeType?(sr(),hr(bue,{key:2,modelValue:r.value,"onUpdate:modelValue":n[2]||(n[2]=e=>r.value=e),disabled:e.disabled},{default:an((t=>[t.node?(sr(),hr(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):xr("",!0)])),_:1},8,["modelValue","disabled"])):xr("",!0),r.value.childNode?(sr(),hr(o,{key:3,modelValue:r.value.childNode,"onUpdate:modelValue":n[3]||(n[3]=e=>r.value.childNode=e),disabled:e.disabled},null,8,["modelValue","disabled"])):xr("",!0)],64)}}}),Oue="*",wue="/",Sue="-",xue=",",$ue="?",Cue="L",kue="W",Pue="#",Tue="",Mue="LW",Iue=(new Date).getFullYear();function Eue(e){return"number"==typeof e||/^\d+(\.\d+)?$/.test(e)}const{hasOwnProperty:Aue}=Object.prototype;function Due(e,t){return Object.keys(t).forEach((n=>{!function(e,t,n){const o=t[n];(function(e){return null!=e})(o)&&(Aue.call(e,n)&&function(e){return null!==e&&"object"==typeof e}(o)?e[n]=Due(Object(e[n]),t[n]):e[n]=o)}(e,t,n)})),e}const Rue={common:{from:"从",fromThe:"从第",start:"开始",every:"每",between:"在",and:"到",end:"之间的",specified:"固定的",symbolTip:"通配符支持",valTip:"值为",nearest:"最近的",current:"本",nth:"第",index:"个",placeholder:"请选择",placeholderMulti:"请选择(支持多选)",help:"帮助",wordNumError:"格式不正确,必须有6或7位",reverse:"反向解析",reset:"重置",tagError:"表达式不正确",numError:"含有非法数字",use:"使用",inputPlaceholder:"Cron表达式"},custom:{unspecified:"不固定",workDay:"工作日",lastTh:"倒数第",lastOne:"最后一个",latestWorkday:"最后一个工作日",empty:"不配置"},second:{title:"秒",val:"0 1 2...59"},minute:{title:"分",val:"0 1 2...59"},hour:{title:"时",val:"0 1 2...23"},dayOfMonth:{timeUnit:"日",title:"日",val:"1 2...31"},month:{title:"月",val:"1 2...12,或12个月的缩写(JAN ... DEC)"},dayOfWeek:{timeUnit:"日",title:"周",val:"1 2...7或星期的缩写(SUN ... SAT)",SUN:"星期天",MON:"星期一",TUE:"星期二",WED:"星期三",THU:"星期四",FRI:"星期五",SAT:"星期六"},year:{title:"年",val:Iue+" ... 2099"},period:{startError:"开始格式不符",cycleError:"循环格式不符"},range:{lowerError:"下限格式不符",upperError:"上限格式不符",lowerBiggerThanUpperError:"下限不能比上限大"},weekDay:{weekDayNumError:"周数格式不符",nthError:"天数格式不符"},app:{title:"基于Vue&Element-ui实现的Cron表达式生成器",next10FireTimes:"最近10次执行时刻"},daysOfWeekOptions:[{label:"星期天",value:1},{label:"星期一",value:2},{label:"星期二",value:3},{label:"星期三",value:4},{label:"星期四",value:5},{label:"星期五",value:6},{label:"星期六",value:7}]},zue=bt("zh-CN"),Bue=rt({"zh-CN":Rue}),jue={messages:()=>Bue[zue.value],use(e,t){zue.value=e,this.add({[e]:t})},add(e={}){Due(Bue,e)}},Nue=jue.messages(),_ue={class:"cron-body-row"},Que={class:"symbol"},Lue=A2(Nn({components:{Radio:NM},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:Oue},tag:{type:String,default:Oue},onChange:{type:Function}},setup:e=>({Message:Nue,change:function(){e.onChange&&e.onChange({tag:Oue,type:Oue})},EVERY:Oue})}),[["render",function(e,t,n,o,r,i){const l=hn("Radio");return sr(),pr("div",_ue,[Or(l,{checked:e.type===e.EVERY,onClick:e.change},{default:an((()=>[yr("span",Que,V(e.EVERY),1),Sr(V(e.Message.common.every)+V(e.timeUnit),1)])),_:1},8,["checked","onClick"])])}]]),Hue=jue.messages(),Fue={class:"cron-body-row"},Wue={class:"symbol"},Xue=A2(Nn({components:{Radio:NM,InputNumber:wL},props:{startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:wue},tag:{type:String,default:wue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(0);n.value`${n.value}${wue}${o.value}`));function i(t){if(e.type!==wue)return;const r=t.split(wue);2===r.length?(r[0]===Oue&&(r[0]=0),!Eue(r[0])||parseInt(r[0])e.startConfig.max?MB.error(`${Hue.period.startError}:${r[0]}`):!Eue(r[1])||parseInt(r[1])e.cycleConfig.max?MB.error(`${Hue.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1]))):MB.error(`${Hue.common.tagError}:${t}`)}return Zn((()=>{i(e.tag)})),yn((()=>e.tag),(e=>{i(e)}),{deep:!0}),yn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Hue,type_:t,start:n,cycle:o,tag_:r,PERIOD:wue,change:function(){e.onChange&&e.onChange({type:wue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=hn("InputNumber"),a=hn("Radio");return sr(),pr("div",Fue,[Or(a,{checked:e.type===e.PERIOD,onChange:e.change},{default:an((()=>[yr("span",Wue,V(e.tag_),1),Sr(" "+V(e.Message.common.fromThe)+" ",1),Or(l,{size:"small",value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),min:e.startConfig.min,step:e.startConfig.step,max:e.startConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit)+V(e.Message.common.start)+V(e.Message.common.every)+" ",1),Or(l,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Yue=jue.messages(),Vue={class:"cron-body-row"},Zue={class:"symbol"},Uue=A2(Nn({components:{Radio:NM,InputNumber:wL},props:{upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Sue},tag:{type:String,default:Sue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(0);o.value`${o.value}${Sue}${n.value}`));function l(t){if(e.type!==Sue)return;const r=t.split(Sue);2===r.length&&(r[0]===Sue&&(r[0]=0),!Eue(r[0])||parseInt(r[0])e.lowerConfig.max||!Eue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Zn((()=>{l(e.tag)})),yn((()=>e.tag),(e=>{l(e)}),{deep:!0}),yn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Yue,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:Sue,change:function(){e.onChange&&e.onChange({type:Sue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("InputNumber"),a=hn("Radio");return sr(),pr("div",Vue,[Or(a,{checked:e.type===e.RANGE,onChange:e.change},{default:an((()=>[yr("span",Zue,V(e.tag_),1),Sr(" "+V(e.Message.common.between)+" ",1),Or(l,{size:"small",value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),min:e.lowerConfig.min,step:e.lowerConfig.step,max:e.upper_,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit)+V(e.Message.common.and)+" ",1),Or(l,{size:"small",value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),min:e.lower,step:e.upperConfig.step,max:e.upperConfig.max,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.Message.common.end)+V(e.Message.common.every)+V(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Kue=jue.messages(),Gue=Nn({components:{Radio:NM,ASelect:ex,Tooltip:I$},props:{nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:xue},tag:{type:String,default:xue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=Fr((()=>{let e="";if(o.value&&o.value.length){o.value.sort();for(let t=0;t{Eue(t)&&parseInt(t)>=parseInt(e.nums[0].value)&&parseInt(t)<=parseInt(e.nums[e.nums.length-1].value)&&o.value.push(parseInt(t))}))}}return Zn((()=>{i()})),yn((()=>e.tag),(()=>i()),{deep:!0}),yn((()=>e.type),(()=>i()),{deep:!0}),{Message:Kue,type_:t,tag_:n,open:r,FIXED:xue,change:function(){e.onChange&&e.onChange({type:xue,tag:n.value||xue})},numArray:o,changeTag:i}}}),que={class:"cron-body-row"},Jue=yr("span",{class:"symbol"},",",-1),ede=A2(Gue,[["render",function(e,t,n,o,r,i){const l=hn("Tooltip"),a=hn("Radio"),s=hn("ASelect");return sr(),pr("div",que,[Or(a,{checked:e.type===e.FIXED,onChange:e.change},{default:an((()=>[Or(l,{title:e.tag_},{default:an((()=>[Jue])),_:1},8,["title"]),Sr(" "+V(e.Message.common.specified),1)])),_:1},8,["checked","onChange"]),Or(s,{size:"small",mode:"tags",placeholder:e.Message.common.placeholder,style:{width:"300px"},options:e.nums,disabled:e.type!==e.FIXED,value:e.numArray,"onUpdate:value":t[0]||(t[0]=t=>e.numArray=t),onChange:e.change},null,8,["placeholder","options","disabled","value","onChange"])])}]]),tde={watch:{tag(e){this.resolveTag(e)}},mounted(){this.resolveTag(this.tag)},methods:{resolveTag(e){null==e&&(e=Tue);let t=null;(e=this.resolveCustom(e))===Tue?t=Tue:e===$ue?t=$ue:e===Oue?t=Oue:e===Mue&&(t=Mue),null==t&&(t=e.startsWith("L-")||e.endsWith(Cue)?Cue:e.endsWith(kue)&&e.length>1?kue:e.indexOf(Pue)>0?Pue:e.indexOf(wue)>0?wue:e.indexOf(Sue)>0?Sue:xue),this.type_=t,this.tag_=e},resolveCustom:e=>e}},nde=jue.messages(),ode=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Oue),a=bt(e.tag);return{Message:nde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.second.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),rde=jue.messages(),ide=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Oue),a=bt(e.tag);return{Message:rde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.minute.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),lde=jue.messages(),ade=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:23},n={min:1,step:1,max:23},o={min:0,step:1,max:23},r={min:0,step:1,max:23},i=[];for(let s=0;s<24;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Oue),a=bt(e.tag);return{Message:lde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.hour.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),sde=jue.messages(),cde={class:"cron-body-row"},ude={class:"symbol"},dde=A2(Nn({components:{Radio:NM},props:{type:{type:String,default:$ue},tag:{type:String,default:$ue},onChange:{type:Function}},setup:e=>({Message:sde,change:function(){e.onChange&&e.onChange({tag:$ue,type:$ue})},UNFIXED:$ue})}),[["render",function(e,t,n,o,r,i){const l=hn("Radio");return sr(),pr("div",cde,[Or(l,{checked:e.type===e.UNFIXED,onClick:e.change},{default:an((()=>[yr("span",ude,V(e.UNFIXED),1),Sr(V(e.Message.custom.unspecified),1)])),_:1},8,["checked","onClick"])])}]]),pde=jue.messages(),hde={class:"cron-body-row"},fde={class:"symbol"},gde=A2(Nn({components:{Radio:NM,InputNumber:wL},props:{lastConfig:{type:Object,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Cue},tag:{type:String,default:Cue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=Fr((()=>1===n.value?Cue:"L-"+(n.value-1)));function r(t){if(e.type!==Cue)return;if(t===Cue)return void(n.value=1);const o=t.substring(2);Eue(o)&&parseInt(o)>=e.lastConfig.min&&parseInt(o)<=e.lastConfig.max?n.value=parseInt(o)+1:MB.error(pde.common.numError+":"+o)}return Zn((()=>{r(e.tag)})),yn((()=>e.tag),(e=>{r(e)}),{deep:!0}),yn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:pde,type_:t,tag_:o,LAST:Cue,lastNum:n,change:function(){e.onChange&&e.onChange({type:Cue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=hn("InputNumber"),a=hn("Radio");return sr(),pr("div",hde,[Or(a,{checked:e.type===e.LAST,onChange:e.change},{default:an((()=>[yr("span",fde,V(e.tag_),1),Sr(" "+V(e.Message.common.current)+V(e.targetTimeUnit)+V(e.Message.custom.lastTh)+" ",1),Or(l,{size:"small",value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),min:e.lastConfig.min,step:e.lastConfig.step,max:e.lastConfig.max,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),mde=jue.messages(),vde={class:"cron-body-row"},bde={class:"symbol"},yde=A2(Nn({components:{Radio:NM,InputNumber:wL},props:{targetTimeUnit:{type:String,default:null},startDateConfig:{type:Object,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:kue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(1),r=Fr((()=>`${n.value}${kue}`));function i(t){if(e.type!==kue)return;const o=t.substring(0,t.length-1);!Eue(o)||parseInt(o)e.startDateConfig.max?MB.error(`${mde.common.numError}:${o}`):n.value=parseInt(o)}return Zn((()=>{i(e.tag)})),yn((()=>e.tag),(e=>{i(e)}),{deep:!0}),yn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:mde,type_:t,startDate:n,weekDayNum:o,tag_:r,WORK_DAY:kue,change:function(){e.onChange&&e.onChange({type:kue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("InputNumber");return sr(),pr("div",vde,[Or(l,{checked:e.type===e.WORK_DAY,onChange:e.change},{default:an((()=>[yr("span",bde,V(e.tag_),1),Sr(" "+V(e.Message.common.every)+V(e.targetTimeUnit),1)])),_:1},8,["checked","onChange"]),Or(a,{size:"small",value:e.startDate,"onUpdate:value":t[0]||(t[0]=t=>e.startDate=t),min:e.startDateConfig.min,step:e.startDateConfig.step,max:e.startDateConfig.max,disabled:e.type!==e.WORK_DAY,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit)+V(e.Message.common.nearest)+V(e.Message.custom.workDay),1)])}]]),Ode=jue.messages(),wde={class:"cron-body-row"},Sde={class:"symbol"},xde=A2(Nn({components:{Radio:NM},props:{targetTimeUnit:{type:String,default:null},type:{type:String,default:Mue},tag:{type:String,default:Mue},onChange:{type:Function}},setup:e=>({Message:Ode,change:function(){e.onChange&&e.onChange({tag:Mue,type:Mue})},LAST_WORK_DAY:Mue})}),[["render",function(e,t,n,o,r,i){const l=hn("Radio");return sr(),pr("div",wde,[Or(l,{checked:e.type===e.LAST_WORK_DAY,onClick:e.change},{default:an((()=>[yr("span",Sde,V(e.LAST_WORK_DAY),1),Sr(" "+V(e.Message.common.current)+V(e.targetTimeUnit)+V(e.Message.custom.latestWorkday),1)])),_:1},8,["checked","onClick"])])}]]),$de=jue.messages(),Cde=31,kde=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede,UnFixed:dde,Last:gde,WorkDay:yde,LastWorkDay:xde},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:Cde},n={min:1,step:1,max:Cde},o={min:1,step:1,max:Cde},r={min:1,step:1,max:Cde},i={min:1,step:1,max:Cde},l=[];for(let c=1;c<32;c++){const e={label:c.toString(),value:c};l.push(e)}const a=bt(Oue),s=bt(e.tag);return{Message:$de,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,lastConfig:i,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed"),u=hn("UnFixed"),d=hn("Last"),p=hn("WorkDay"),h=hn("LastWorkDay");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Or(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Or(d,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"last-config":e.lastConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","last-config","onChange"]),Or(p,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","start-date-config","onChange"]),Or(h,{type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["type","tag","target-time-unit","start-date-config","onChange"])],64)}]]),Pde=jue.messages(),Tde=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:12},n={min:1,step:1,max:12},o={min:1,step:1,max:12},r={min:1,step:1,max:12},i=[];for(let s=1;s<13;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Oue),a=bt(e.tag);return{Message:Pde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.month.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Mde=jue.messages(),Ide={class:"cron-body-row"},Ede={class:"symbol"},Ade=A2(Nn({components:{Radio:NM},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:Tue},tag:{type:String,default:Tue},onChange:{type:Function}},setup:e=>({Message:Mde,change:function(){e.onChange&&e.onChange({tag:Tue,type:Tue})},EMPTY:Tue})}),[["render",function(e,t,n,o,r,i){const l=hn("Radio");return sr(),pr("div",Ide,[Or(l,{checked:e.type===e.EMPTY,onClick:e.change},{default:an((()=>[yr("span",Ede,V(e.Message.custom.empty),1)])),_:1},8,["checked","onClick"])])}]]),Dde=jue.messages(),Rde=Iue,zde=2099,Bde=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede,Empty:Ade},mixins:[tde],props:{tag:{type:String,default:Tue},onChange:{type:Function}},setup(e){const t={min:Rde,step:1,max:zde},n={min:1,step:1,max:zde},o={min:Rde,step:1,max:zde},r={min:Rde,step:1,max:zde},i=[];for(let s=Rde;s<2100;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Tue),a=bt(e.tag);return{Message:Dde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed"),u=hn("Empty");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.year.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Or(u,{type:e.type_,tag:e.tag_,onChange:e.change},null,8,["type","tag","onChange"])],64)}]]),jde=jue.messages(),Nde={class:"cron-body-row"},_de={class:"symbol"},Qde=A2(Nn({components:{Radio:NM,InputNumber:wL,ASelect:ex},props:{nums:{type:Array,default:null},startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:wue},tag:{type:String,default:wue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(1),r=Fr((()=>`${n.value}${wue}${o.value}`));function i(t){if(e.type!==wue)return;const r=t.split(wue);2===r.length?!Eue(r[0])||parseInt(r[0])e.startConfig.max?MB.error(`${jde.period.startError}:${r[0]}`):!Eue(r[1])||parseInt(r[1])e.cycleConfig.max?MB.error(`${jde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):MB.error(`${jde.common.tagError}:${t}`)}return Zn((()=>{i(e.tag)})),yn((()=>e.tag),(e=>{i(e)}),{deep:!0}),yn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:jde,type_:t,start:n,cycle:o,tag_:r,PERIOD:wue,change:function(){e.onChange&&e.onChange({type:wue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("ASelect"),s=hn("InputNumber");return sr(),pr("div",Nde,[Or(l,{checked:e.type===e.PERIOD,onChange:e.change},{default:an((()=>[yr("span",_de,V(e.tag_),1),Sr(" "+V(e.Message.common.from),1)])),_:1},8,["checked","onChange"]),Or(a,{size:"small",style:{width:"100px"},value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Sr(" "+V(e.Message.common.start)+V(e.Message.common.every)+" ",1),Or(s,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit),1)])}]]),Lde=jue.messages(),Hde=ex.Option,Fde={class:"cron-body-row"},Wde={class:"symbol"},Xde=A2(Nn({components:{Radio:NM,ASelect:ex,AOption:Hde},props:{nums:{type:Array,default:null},upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Sue},tag:{type:String,default:Sue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(0);o.value`${o.value}${Sue}${n.value}`));function l(t){if(e.type!==Sue)return;const r=t.split(Sue);2===r.length&&(r[0]===Sue&&(r[0]=0),!Eue(r[0])||parseInt(r[0])e.lowerConfig.max||!Eue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Zn((()=>{l(e.tag)})),yn((()=>e.tag),(e=>{l(e)}),{deep:!0}),yn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Lde,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:Sue,change:function(){e.onChange&&e.onChange({type:Sue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("AOption"),s=hn("ASelect");return sr(),pr("div",Fde,[Or(l,{checked:e.type===e.RANGE,onChange:e.change},{default:an((()=>[yr("span",Wde,V(e.tag_),1),Sr(" "+V(e.Message.common.between),1)])),_:1},8,["checked","onChange"]),Or(s,{size:"small",style:{width:"100px"},value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},{default:an((()=>[(sr(!0),pr(nr,null,oo(e.nums,(t=>(sr(),hr(a,{key:t.value,value:t.value,disabled:Number(t.value)>e.upper_},{default:an((()=>[Sr(V(t.label),1)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value","placeholder","disabled","onChange"]),Sr(" "+V(e.timeUnit)+V(e.Message.common.and)+" ",1),Or(s,{size:"small",style:{width:"100px"},value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Sr(" "+V(e.Message.common.end)+V(e.Message.common.every)+V(e.timeUnit),1)])}]]),Yde=jue.messages(),Vde={class:"cron-body-row"},Zde={class:"symbol"},Ude=A2(Nn({components:{Radio:NM,ASelect:ex},props:{nums:{type:Array,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Cue},tag:{type:String,default:Cue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=Fr((()=>(n.value>=1&&n.value<7?n.value:"")+Cue));function r(t){if(e.type!==Cue)return;if(t===Cue)return void(n.value=7);const o=t.substring(0,t.length-1);Eue(o)&&parseInt(o)>=parseInt(e.nums[0].value)&&parseInt(o)<=parseInt(e.nums[e.nums.length-1].value)?n.value=parseInt(o):MB.error(Yde.common.numError+":"+o)}return Zn((()=>{r(e.tag)})),yn((()=>e.tag),(e=>{r(e)}),{deep:!0}),yn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:Yde,type_:t,tag_:o,LAST:Cue,lastNum:n,change:function(){e.onChange&&e.onChange({type:Cue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("ASelect");return sr(),pr("div",Vde,[Or(l,{checked:e.type===e.LAST,onChange:e.change},{default:an((()=>[yr("span",Zde,V(e.tag_),1),Sr(" "+V(e.Message.common.current)+V(e.targetTimeUnit)+V(e.Message.custom.lastTh),1)])),_:1},8,["checked","onChange"]),Or(a,{size:"small",style:{width:"100px"},value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Kde=jue.messages(),Gde={class:"cron-body-row"},qde={class:"symbol"},Jde=A2(Nn({components:{Radio:NM,InputNumber:wL,ASelect:ex},props:{targetTimeUnit:{type:String,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Pue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(1),r=Fr((()=>`${n.value}${Pue}${o.value}`));function i(t){if(e.type!==Pue)return;const r=t.split(Pue);2===r.length?!Eue(r[0])||parseInt(r[0])parseInt(e.nums[e.nums.length-1].value)?MB.error(`${Kde.period.startError}:${r[0]}`):!Eue(r[1])||parseInt(r[1])<1||parseInt(r[1])>5?MB.error(`${Kde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):MB.error(`${Kde.common.tagError}:${t}`)}return Zn((()=>{i(e.tag)})),yn((()=>e.tag),(e=>{i(e)}),{deep:!0}),yn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Kde,type_:t,nth:n,weekDayNum:o,tag_:r,WEEK_DAY:Pue,change:function(){e.onChange&&e.onChange({type:Pue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("InputNumber"),s=hn("ASelect");return sr(),pr("div",Gde,[Or(l,{checked:e.type===e.WEEK_DAY,onChange:e.change},{default:an((()=>[yr("span",qde,V(e.tag_),1),Sr(" "+V(e.Message.common.current)+V(e.targetTimeUnit)+V(e.Message.common.nth),1)])),_:1},8,["checked","onChange"]),Or(a,{size:"small",value:e.nth,"onUpdate:value":t[0]||(t[0]=t=>e.nth=t),min:1,step:1,max:5,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","disabled","onChange"]),Sr(" "+V(e.Message.common.index)+" ",1),Or(s,{size:"small",style:{width:"100px"},value:e.weekDayNum,"onUpdate:value":t[1]||(t[1]=t=>e.weekDayNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),epe=jue.messages(),tpe=A2(Nn({components:{Every:Lue,Period:Qde,Range:Xde,Fixed:ede,UnFixed:dde,Last:Ude,WeekDay:Jde},mixins:[tde],props:{tag:{type:String,default:$ue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:7},n={min:1,step:1,max:7},o={min:1,step:1,max:7},r={min:1,step:1,max:7},i={min:1,step:1,max:7},l=epe.daysOfWeekOptions,a=bt(Oue),s=bt(e.tag);return{Message:epe,startConfig:t,cycleConfig:o,lowerConfig:r,upperConfig:i,startDateConfig:n,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed"),u=hn("UnFixed"),d=hn("Last"),p=hn("WeekDay");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.dayOfWeek.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Or(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Or(d,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,"last-config":e.startDateConfig,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","last-config","onChange"]),Or(p,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","onChange"])],64)}]]),npe=jue.messages(),ope=Nn({name:"VueCron",components:{AInput:l_,Popover:z$,Card:AE,Seconds:ode,Minutes:ide,Hours:ade,Days:kde,Months:Tde,Years:Bde,WeekDays:tpe,CalendarOutlined:Sj},props:{value:{type:String,default:"* * * * * ? *"}},setup(e,{emit:t}){const n=bt(""),o=bt([]),r=[{key:"seconds",tab:npe.second.title},{key:"minutes",tab:npe.minute.title},{key:"hours",tab:npe.hour.title},{key:"days",tab:npe.dayOfMonth.title},{key:"months",tab:npe.month.title},{key:"weekdays",tab:npe.dayOfWeek.title},{key:"years",tab:npe.year.title}],i=rt({second:Oue,minute:Oue,hour:Oue,dayOfMonth:Oue,month:Oue,dayOfWeek:$ue,year:Tue}),l=bt("seconds");function a(e){const o=e.trim().split(" ");if(!e||e.trim().length<11||6!==o.length&&7!==o.length){const e="* * * * * ?";return n.value=e,s(e),MB.error(npe.common.tagError),t("update:value",e),void t("change",e)}s(e),i.second=o[0],i.minute=o[1],i.hour=o[2],i.dayOfMonth=o[3],i.month=o[4],i.dayOfWeek=o[5],i.year=7===o.length?o[6]:""}function s(e){v1(`/job/cron?cron=${e}`).then((e=>{if(o.value=e,0===o.value.length){const e="* * * * * ?";n.value=e,s(e),t("update:value",e),t("change",e)}}))}return yn((()=>e.value),(e=>{a(e),n.value=e}),{immediate:!0}),{cronStr:n,list:o,tabList:r,activeTabKey:l,tag:i,changeTime:a,timeChange:function(e,n){const o={...i};o[e]=n,"dayOfWeek"===e&&"*"!==n&&"?"!==n?o.dayOfMonth="?":"dayOfMonth"===e&&"*"!==n&&"?"!==n&&(o.dayOfWeek="?");let r=[];r.push(o.second),r.push(o.minute),r.push(o.hour),r.push(o.dayOfMonth),r.push(o.month),r.push(o.dayOfWeek),r.push(o.year),s(r.join(" ").trim()),t("update:value",r.join(" ").trim()),t("change",r.join(" ").trim())}}}}),rpe={key:0},ipe={key:1},lpe={key:2},ape={key:3},spe={key:4},cpe={key:5},upe={key:6},dpe={style:{display:"flex","align-items":"center","justify-content":"space-between"}},ppe=yr("span",{style:{width:"150px","font-weight":"600"}},"CRON 表达式: ",-1),hpe=yr("div",{style:{margin:"20px 0","border-left":"#1677ff 5px solid","font-size":"medium","font-weight":"bold"}},"    近5次的运行时间: ",-1),fpe=A2(ope,[["render",function(e,t,n,o,r,i){const l=hn("AInput"),a=hn("CalendarOutlined"),s=hn("Seconds"),c=hn("Minutes"),u=hn("Hours"),d=hn("Days"),p=hn("Months"),h=hn("WeekDays"),f=hn("Years"),g=hn("a-tab-pane"),m=hn("a-tabs"),v=hn("a-divider"),b=hn("a-input"),y=hn("a-button"),O=hn("Card"),w=hn("Popover");return sr(),hr(w,{placement:"bottom",trigger:"click"},{content:an((()=>[Or(O,{size:"small"},{default:an((()=>[Or(m,{activeKey:e.activeTabKey,"onUpdate:activeKey":t[7]||(t[7]=t=>e.activeTabKey=t),type:"card"},{default:an((()=>[(sr(!0),pr(nr,null,oo(e.tabList,(n=>(sr(),hr(g,{key:n.key},{tab:an((()=>[yr("span",null,[Or(a),Sr(" "+V(n.tab),1)])])),default:an((()=>["seconds"===e.activeTabKey?(sr(),pr("div",rpe,[Or(s,{tag:e.tag.second,onChange:t[0]||(t[0]=t=>e.timeChange("second",t.tag))},null,8,["tag"])])):"minutes"===e.activeTabKey?(sr(),pr("div",ipe,[Or(c,{tag:e.tag.minute,onChange:t[1]||(t[1]=t=>e.timeChange("minute",t.tag))},null,8,["tag"])])):"hours"===e.activeTabKey?(sr(),pr("div",lpe,[Or(u,{tag:e.tag.hour,onChange:t[2]||(t[2]=t=>e.timeChange("hour",t.tag))},null,8,["tag"])])):"days"===e.activeTabKey?(sr(),pr("div",ape,[Or(d,{tag:e.tag.dayOfMonth,onChange:t[3]||(t[3]=t=>e.timeChange("dayOfMonth",t.tag))},null,8,["tag"])])):"months"===e.activeTabKey?(sr(),pr("div",spe,[Or(p,{tag:e.tag.month,onChange:t[4]||(t[4]=t=>e.timeChange("month",t.tag))},null,8,["tag"])])):"weekdays"===e.activeTabKey?(sr(),pr("div",cpe,[Or(h,{tag:e.tag.dayOfWeek,onChange:t[5]||(t[5]=t=>e.timeChange("dayOfWeek",t.tag))},null,8,["tag"])])):"years"===e.activeTabKey?(sr(),pr("div",upe,[Or(f,{tag:e.tag.year,onChange:t[6]||(t[6]=t=>e.timeChange("year",t.tag))},null,8,["tag"])])):xr("",!0)])),_:2},1024)))),128))])),_:1},8,["activeKey"]),Or(v),yr("div",dpe,[ppe,Or(b,{value:e.cronStr,"onUpdate:value":t[8]||(t[8]=t=>e.cronStr=t)},null,8,["value"]),Or(y,{type:"primary",style:{"margin-left":"16px"},onClick:t[9]||(t[9]=t=>e.changeTime(e.cronStr))},{default:an((()=>[Sr("保存")])),_:1})]),Or(v),hpe,(sr(!0),pr(nr,null,oo(e.list,((e,t)=>(sr(),pr("div",{key:e,style:{"margin-top":"10px"}},"第"+V(t+1)+"次: "+V(e),1)))),128))])),_:1})])),default:an((()=>[Or(l,{readonly:"",value:e.value},null,8,["value"])])),_:1})}]]),gpe=Nn({__name:"StartDrawer",props:{open:F1().def(!1),modelValue:V1().def({})},emits:["update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=m1();let i="";const l=bt(!1),a=bt({}),s=bt([]);yn((()=>o.open),(e=>{l.value=e}),{immediate:!0}),yn((()=>o.modelValue),(e=>{a.value=e,i=e.workflowName?e.workflowName:e.groupName?e.groupName:"请选择组"}),{immediate:!0,deep:!0});const c=bt(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",a.value)})).catch((()=>{MB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),l.value=!1};Zn((()=>{Wt((()=>{p()}))}));const p=()=>{v1("/group/all/group-name/list").then((e=>{s.value=e}))},h=e=>{1===e?a.value.triggerInterval="* * * * * ?":2===e&&(a.value.triggerInterval="60")},f={groupName:[{required:!0,message:"请选择组",trigger:"change"}],triggerType:[{required:!0,message:"请选择触发类型",trigger:"change"}],triggerInterval:[{required:!0,message:"请输入触发间隔",trigger:"change"}],executorTimeout:[{required:!0,message:"请输入执行超时时间",trigger:"change"}],blockStrategy:[{required:!0,message:"请选择阻塞策略",trigger:"change"}],workflowStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(e,t)=>{const n=hn("a-input"),o=hn("a-form-item"),p=hn("a-select-option"),g=hn("a-select"),m=hn("a-col"),v=hn("a-input-number"),b=hn("a-form-item-rest"),y=hn("a-row"),O=hn("a-radio"),w=hn("a-radio-group"),S=hn("a-textarea"),x=hn("a-form"),$=hn("a-button"),C=hn("a-drawer");return sr(),hr(C,{open:l.value,"onUpdate:open":t[9]||(t[9]=e=>l.value=e),title:xt(i),"destroy-on-close":"",width:610,onClose:d},{footer:an((()=>[Or($,{type:"primary",onClick:u},{default:an((()=>[Sr("保存")])),_:1}),Or($,{style:{"margin-left":"12px"},onClick:d},{default:an((()=>[Sr("取消")])),_:1})])),default:an((()=>[Or(x,{ref_key:"formRef",ref:c,layout:"vertical",model:a.value,rules:f,"label-align":"left","label-col":{style:{width:"100px"}}},{default:an((()=>[Or(o,{name:"workflowName",label:"工作流名称"},{default:an((()=>[Or(n,{value:a.value.workflowName,"onUpdate:value":t[0]||(t[0]=e=>a.value.workflowName=e),placeholder:"请输入工作流名称"},null,8,["value"])])),_:1}),Or(o,{name:"groupName",label:"组名称"},{default:an((()=>[Or(g,{ref:"select",value:a.value.groupName,"onUpdate:value":t[1]||(t[1]=e=>a.value.groupName=e),placeholder:"请选择组",disabled:0===xt(r).TYPE&&xt(r).ID},{default:an((()=>[(sr(!0),pr(nr,null,oo(s.value,(e=>(sr(),hr(p,{key:e,value:e},{default:an((()=>[Sr(V(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value","disabled"])])),_:1}),Or(y,{gutter:24},{default:an((()=>[Or(m,{span:8},{default:an((()=>[Or(o,{name:"triggerType",label:"触发类型"},{default:an((()=>[Or(g,{ref:"select",value:a.value.triggerType,"onUpdate:value":t[2]||(t[2]=e=>a.value.triggerType=e),placeholder:"请选择触发类型",onChange:h},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(i2)),(e=>(sr(),hr(p,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1}),Or(m,{span:16},{default:an((()=>[Or(o,{name:"triggerInterval",label:"触发间隔"},{default:an((()=>[Or(b,null,{default:an((()=>[1===a.value.triggerType?(sr(),hr(xt(fpe),{key:0,value:a.value.triggerInterval,"onUpdate:value":t[3]||(t[3]=e=>a.value.triggerInterval=e)},null,8,["value"])):(sr(),hr(v,{key:1,addonAfter:"秒",style:{width:"-webkit-fill-available"},value:a.value.triggerInterval,"onUpdate:value":t[4]||(t[4]=e=>a.value.triggerInterval=e),placeholder:"请输入触发间隔"},null,8,["value"]))])),_:1})])),_:1})])),_:1})])),_:1}),Or(y,{gutter:24},{default:an((()=>[Or(m,{span:8},{default:an((()=>[Or(o,{name:"executorTimeout",label:"执行超时时间"},{default:an((()=>[Or(v,{addonAfter:"秒",value:a.value.executorTimeout,"onUpdate:value":t[5]||(t[5]=e=>a.value.executorTimeout=e),placeholder:"请输入超时时间"},null,8,["value"])])),_:1})])),_:1}),Or(m,{span:16},{default:an((()=>[Or(o,{name:"blockStrategy",label:"阻塞策略"},{default:an((()=>[Or(w,{value:a.value.blockStrategy,"onUpdate:value":t[6]||(t[6]=e=>a.value.blockStrategy=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(l2)),(e=>(sr(),hr(O,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1})])),_:1}),Or(o,{name:"workflowStatus",label:"节点状态"},{default:an((()=>[Or(w,{value:a.value.workflowStatus,"onUpdate:value":t[7]||(t[7]=e=>a.value.workflowStatus=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(s2)),(e=>(sr(),hr(O,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(o,{name:"description",label:"描述"},{default:an((()=>[Or(S,{value:a.value.description,"onUpdate:value":t[8]||(t[8]=e=>a.value.description=e),"auto-size":{minRows:5},placeholder:"请输入描述"},null,8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open","title"])}}}),mpe=Nn({__name:"StartDetail",props:{modelValue:V1().def({}),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1);yn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=hn("a-descriptions-item"),l=hn("a-descriptions"),a=hn("a-drawer");return sr(),hr(a,{title:"工作流详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:an((()=>[Or(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(o,{label:"工作流名称"},{default:an((()=>[Sr(V(e.modelValue.workflowName),1)])),_:1}),Or(o,{label:"组名称"},{default:an((()=>[Sr(V(e.modelValue.groupName),1)])),_:1}),Or(o,{label:"触发类型"},{default:an((()=>[Sr(V(xt(i2)[e.modelValue.triggerType]),1)])),_:1}),Or(o,{label:"触发间隔"},{default:an((()=>[Sr(V(e.modelValue.triggerInterval)+" "+V(2===e.modelValue.triggerType?"秒":null),1)])),_:1}),Or(o,{label:"执行超时时间"},{default:an((()=>[Sr(V(e.modelValue.executorTimeout)+" 秒 ",1)])),_:1}),Or(o,{label:"阻塞策略"},{default:an((()=>[Sr(V(xt(l2)[e.modelValue.blockStrategy]),1)])),_:1}),Or(o,{label:"工作流状态"},{default:an((()=>[Sr(V(xt(s2)[e.modelValue.workflowStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),vpe=e=>(rn("data-v-730a9c91"),e=e(),ln(),e),bpe={class:"node-wrap"},ype={class:"title",style:{background:"#ffffff"}},Ope={class:"text",style:{color:"#ff943e"}},wpe={key:0,class:"content"},Spe=vpe((()=>yr("span",{class:"content_label"},"组名称: ",-1))),xpe=vpe((()=>yr("span",{class:"content_label"},"阻塞策略: ",-1))),$pe=vpe((()=>yr("div",null,".........",-1))),Cpe={key:1,class:"content"},kpe=[vpe((()=>yr("span",{class:"placeholder"}," 请配置工作流 ",-1)))],Ppe=A2(Nn({__name:"StartNode",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=bt({}),i=bt({});yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0}),yn((()=>i.value),(e=>{n("update:modelValue",e)}));const l=m1();yn((()=>i.value.groupName),(e=>{e&&(l.setGroupName(e),v1(`/job/list?groupName=${e}`).then((e=>{l.setJobList(e)})))}),{immediate:!0});const a=bt(!1),s=bt(!1),c=e=>{i.value=e},u=()=>{0===l.TYPE?(r.value=JSON.parse(JSON.stringify(i.value)),a.value=!0):s.value=!0};return(t,n)=>{const o=hn("a-badge"),d=hn("a-typography-text"),p=hn("a-tooltip");return sr(),pr("div",bpe,[yr("div",{class:W([e.disabled?"start-node-disabled":"node-wrap-box-hover","node-wrap-box start-node node-error-success"]),onClick:u},[yr("div",ype,[yr("span",Ope,[Or(o,{status:"processing",color:1===i.value.workflowStatus?"#52c41a":"#ff000d"},null,8,["color"]),Sr(" "+V(i.value.workflowName?i.value.workflowName:"请选择组"),1)])]),i.value.groupName?(sr(),pr("div",wpe,[yr("div",null,[Spe,Or(d,{style:{width:"135px"},ellipsis:"",content:i.value.groupName},null,8,["content"])]),yr("div",null,[xpe,Sr(V(xt(l2)[i.value.blockStrategy]),1)]),$pe])):(sr(),pr("div",Cpe,kpe)),2===xt(l).TYPE?(sr(),hr(p,{key:2},{title:an((()=>[Sr(V(xt(d2)[3].title),1)])),default:an((()=>[Or(xt(o2),{class:"error-tip",color:xt(d2)[3].color,size:"24px",onClick:Li((()=>{}),["stop"]),"model-value":xt(d2)[3].icon},null,8,["color","model-value"])])),_:1})):xr("",!0)],2),Or(U2,{disabled:e.disabled,modelValue:i.value.nodeConfig,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.nodeConfig=e)},null,8,["disabled","modelValue"]),0!==xt(l).TYPE?(sr(),hr(mpe,{key:0,open:s.value,"onUpdate:open":n[1]||(n[1]=e=>s.value=e),modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e)},null,8,["open","modelValue"])):xr("",!0),Or(gpe,{open:a.value,"onUpdate:open":n[3]||(n[3]=e=>a.value=e),modelValue:r.value,"onUpdate:modelValue":n[4]||(n[4]=e=>r.value=e),onSave:c},null,8,["open","modelValue"])])}}}),[["__scopeId","data-v-730a9c91"]]),Tpe={class:"workflow-design"},Mpe={class:"box-scale"},Ipe=yr("div",{class:"end-node"},[yr("div",{class:"end-node-circle"}),yr("div",{class:"end-node-text"},"流程结束")],-1),Epe=Nn({__name:"WorkFlow",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=bt({});return yn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),yn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>(sr(),pr("div",Tpe,[yr("div",Mpe,[Or(Ppe,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},null,8,["modelValue","disabled"]),r.value.nodeConfig?(sr(),hr(yue,{key:0,modelValue:r.value.nodeConfig,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value.nodeConfig=e),disabled:e.disabled},null,8,["modelValue","disabled"])):xr("",!0),Ipe])]))}}),Ape={style:{width:"calc(100vw - 16px)",height:"calc(100vh - 48px)"}},Dpe={class:"header"},Rpe={key:0,class:"buttons"},zpe={style:{overflow:"auto",width:"100vw",height:"calc(100vh - 48px)"}},Bpe=A2(Nn({__name:"App",setup(e){const t=e=>{const t={},n=window.location.href.split("?")[1];return n&&n.split("&").forEach((e=>{const n=e.split("=")[1],o=e.split("=")[0];t[o]=n})),t[e]},n=m1(),o=bt(100);let r=t("id");const i=localStorage.getItem("Access-Token"),l=localStorage.getItem("app_namespace"),a="xkjIc2ZHZ0"===t("x1c2Hdd6"),s="kaxC8Iml"===t("x1c2Hdd6")||a,c="wA4wN1nZ"===t("x1c2Hdd6");Zn((()=>{if(n.clear(),!["D7Rzd7Oe","kaxC8Iml","xkjIc2ZHZ0","wA4wN1nZ"].includes(t("x1c2Hdd6")))return u.value=!0,void MB.error({content:"未知错误,请联系管理员",duration:0});n.setId(c?"":r),n.setToken(i),n.setNameSpaceId(l),n.setType(s?a?2:1:0),d.value=s,r&&"undefined"!==r&&(a?m():g())}));const u=bt(!1),d=bt(!1),p=bt({workflowStatus:1,blockStrategy:1,description:void 0,executorTimeout:60}),h=()=>{"undefined"===r||c?(p.value.id=void 0,v1("/workflow","post",p.value).then((()=>{window.parent.postMessage({code:"SV5ucvLBhvFkOftb",data:JSON.stringify(p.value)})}))):v1("/workflow","put",p.value).then((()=>{window.parent.postMessage({code:"8Rr3XPtVVAHfduQg",data:JSON.stringify(p.value)})}))},f=()=>{window.parent.postMessage({code:"kb4DO9h6WIiqFhbp"})},g=()=>{u.value=!0,v1(`/workflow/${r}`).then((e=>{p.value=e})).finally((()=>{u.value=!1}))},m=()=>{u.value=!0,v1(`/workflow/batch/${r}`).then((e=>{p.value=e})).finally((()=>{u.value=!1}))},v=e=>{o.value+=10*e,o.value<=10?o.value=10:o.value>=300&&(o.value=300)};return(e,t)=>{const n=hn("a-button"),r=hn("a-tooltip"),i=hn("a-affix"),l=hn("a-spin");return sr(),pr("div",Ape,[Or(i,{"offset-top":0},{default:an((()=>[yr("div",Dpe,[yr("div",null,[Or(r,{title:"缩小"},{default:an((()=>[Or(n,{type:"primary",icon:Wr(xt(MJ)),onClick:t[0]||(t[0]=e=>v(-1))},null,8,["icon"])])),_:1}),Sr(" "+V(o.value)+"% ",1),Or(r,{title:"放大"},{default:an((()=>[Or(n,{type:"primary",icon:Wr(xt(zI)),onClick:t[1]||(t[1]=e=>v(1))},null,8,["icon"])])),_:1})]),d.value?xr("",!0):(sr(),pr("div",Rpe,[Or(n,{type:"primary",siz:"large",onClick:h},{default:an((()=>[Sr("保存")])),_:1}),Or(n,{siz:"large",style:{"margin-left":"16px"},onClick:f},{default:an((()=>[Sr("取消")])),_:1})]))])])),_:1}),yr("div",zpe,[Or(l,{spinning:u.value},{default:an((()=>[Or(xt(Epe),{class:"work-flow",modelValue:p.value,"onUpdate:modelValue":t[2]||(t[2]=e=>p.value=e),disabled:d.value,style:_([{"transform-origin":"0 0"},`transform: scale(${o.value/100})`])},null,8,["modelValue","disabled","style"])])),_:1},8,["spinning"])])])}}}),[["__scopeId","data-v-940979b4"]]);function jpe(e,t){var n;return e="object"==typeof(n=e)&&null!==n?e:Object.create(null),new Proxy(e,{get:(e,n,o)=>"key"===n?Reflect.get(e,n,o):Reflect.get(e,n,o)||Reflect.get(t,n,o)})}function Npe(e,{storage:t,serializer:n,key:o,debug:r}){try{const r=null==t?void 0:t.getItem(o);r&&e.$patch(null==n?void 0:n.deserialize(r))}catch(i){}}function _pe(e,{storage:t,serializer:n,key:o,paths:r,debug:i}){try{const i=Array.isArray(r)?function(e,t){return t.reduce(((t,n)=>{const o=n.split(".");return function(e,t,n){return t.slice(0,-1).reduce(((e,t)=>/^(__proto__)$/.test(t)?{}:e[t]=e[t]||{}),e)[t[t.length-1]]=n,e}(t,o,function(e,t){return t.reduce(((e,t)=>null==e?void 0:e[t]),e)}(e,o))}),{})}(e,r):e;t.setItem(o,n.serialize(i))}catch(l){}}var Qpe=function(e={}){return t=>{const{auto:n=!1}=e,{options:{persist:o=n},store:r,pinia:i}=t;if(!o)return;if(!(r.$id in i.state.value)){const e=i._s.get(r.$id.replace("__hot:",""));return void(e&&Promise.resolve().then((()=>e.$persist())))}const l=(Array.isArray(o)?o.map((t=>jpe(t,e))):[jpe(o,e)]).map((({storage:t=localStorage,beforeRestore:n=null,afterRestore:o=null,serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},key:l=r.$id,paths:a=null,debug:s=!1})=>{var c;return{storage:t,beforeRestore:n,afterRestore:o,serializer:i,key:(null!=(c=e.key)?c:e=>e)("string"==typeof l?l:l(r.$id)),paths:a,debug:s}}));r.$persist=()=>{l.forEach((e=>{_pe(r.$state,e)}))},r.$hydrate=({runHooks:e=!0}={})=>{l.forEach((n=>{const{beforeRestore:o,afterRestore:i}=n;e&&(null==o||o(t)),Npe(r,n),e&&(null==i||i(t))}))},l.forEach((e=>{const{beforeRestore:n,afterRestore:o}=e;null==n||n(t),Npe(r,e),null==o||o(t),r.$subscribe(((t,n)=>{_pe(n,e)}),{detached:!0})}))}}();const Lpe=function(){const e=q(!0),t=e.run((()=>bt({})));let n=[],o=[];const r=pt({install(e){Zi(r),r._a=e,e.provide(Ui,r),e.config.globalProperties.$pinia=r,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}();Lpe.use(Qpe);const Hpe=Yi(Bpe);Hpe.use(g1),Hpe.use(Lpe),Hpe.mount("#app")}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports});export default o(); +function b1(e){return"[object Object]"===Object.prototype.toString.call(e)}function y1(){return y1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0||(r[n]=e[n]);return r}const w1={silent:!1,logLevel:"warn"},S1=["validator"],x1=Object.prototype,$1=x1.toString,C1=x1.hasOwnProperty,k1=/^\s*function (\w+)/;function P1(e){var t;const n=null!==(t=null==e?void 0:e.type)&&void 0!==t?t:e;if(n){const e=n.toString().match(k1);return e?e[1]:""}return""}const T1=function(e){var t,n;return!1!==b1(e)&&(void 0===(t=e.constructor)||!1!==b1(n=t.prototype)&&!1!==n.hasOwnProperty("isPrototypeOf"))};let M1=e=>e;const I1=(e,t)=>C1.call(e,t),E1=Number.isInteger||function(e){return"number"==typeof e&&isFinite(e)&&Math.floor(e)===e},A1=Array.isArray||function(e){return"[object Array]"===$1.call(e)},D1=e=>"[object Function]"===$1.call(e),R1=(e,t)=>T1(e)&&I1(e,"_vueTypes_name")&&(!t||e._vueTypes_name===t),z1=e=>T1(e)&&(I1(e,"type")||["_vueTypes_name","validator","default","required"].some((t=>I1(e,t))));function B1(e,t){return Object.defineProperty(e.bind(t),"__original",{value:e})}function j1(e,t,n=!1){let o,r=!0,i="";o=T1(e)?e:{type:e};const l=R1(o)?o._vueTypes_name+" - ":"";if(z1(o)&&null!==o.type){if(void 0===o.type||!0===o.type)return r;if(!o.required&&null==t)return r;A1(o.type)?(r=o.type.some((e=>!0===j1(e,t,!0))),i=o.type.map((e=>P1(e))).join(" or ")):(i=P1(o),r="Array"===i?A1(t):"Object"===i?T1(t):"String"===i||"Number"===i||"Boolean"===i||"Function"===i?function(e){if(null==e)return"";const t=e.constructor.toString().match(k1);return t?t[1].replace(/^Async/,""):""}(t)===i:t instanceof o.type)}if(!r){const e=`${l}value "${t}" should be of type "${i}"`;return!1===n?(M1(e),!1):e}if(I1(o,"validator")&&D1(o.validator)){const e=M1,i=[];if(M1=e=>{i.push(e)},r=o.validator(t),M1=e,!r){const e=(i.length>1?"* ":"")+i.join("\n* ");return i.length=0,!1===n?(M1(e),r):e}}return r}function N1(e,t){const n=Object.defineProperties(t,{_vueTypes_name:{value:e,writable:!0},isRequired:{get(){return this.required=!0,this}},def:{value(e){return void 0===e?this.type===Boolean||Array.isArray(this.type)&&this.type.includes(Boolean)?void(this.default=void 0):(I1(this,"default")&&delete this.default,this):D1(e)||!0===j1(this,e,!0)?(this.default=A1(e)?()=>[...e]:T1(e)?()=>Object.assign({},e):e,this):(M1(`${this._vueTypes_name} - invalid default value: "${e}"`),this)}}}),{validator:o}=n;return D1(o)&&(n.validator=B1(o,n)),n}function _1(e,t){const n=N1(e,t);return Object.defineProperty(n,"validate",{value(e){return D1(this.validator)&&M1(`${this._vueTypes_name} - calling .validate() will overwrite the current custom validator function. Validator info:\n${JSON.stringify(this)}`),this.validator=B1(e,this),this}})}function Q1(e,t,n){const o=function(e){const t={};return Object.getOwnPropertyNames(e).forEach((n=>{t[n]=Object.getOwnPropertyDescriptor(e,n)})),Object.defineProperties({},t)}(t);if(o._vueTypes_name=e,!T1(n))return o;const{validator:r}=n,i=O1(n,S1);if(D1(r)){let{validator:e}=o;e&&(e=null!==(a=(l=e).__original)&&void 0!==a?a:l),o.validator=B1(e?function(t){return e.call(this,t)&&r.call(this,t)}:r,o)}var l,a;return Object.assign(o,i)}function L1(e){return e.replace(/^(?!\s*$)/gm," ")}const H1=()=>_1("any",{}),F1=()=>_1("boolean",{type:Boolean}),W1=()=>_1("string",{type:String}),X1=()=>_1("number",{type:Number}),Y1=()=>_1("array",{type:Array}),V1=()=>_1("object",{type:Object});function Z1(e,t="custom validation failed"){if("function"!=typeof e)throw new TypeError("[VueTypes error]: You must provide a function as argument");return N1(e.name||"<>",{type:null,validator(n){const o=e(n);return o||M1(`${this._vueTypes_name} - ${t}`),o}})}function U1(e){if(!A1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument.");const t=`oneOf - value should be one of "${e.map((e=>"symbol"==typeof e?e.toString():e)).join('", "')}".`,n={validator(n){const o=-1!==e.indexOf(n);return o||M1(t),o}};if(-1===e.indexOf(null)){const t=e.reduce(((e,t)=>{if(null!=t){const n=t.constructor;-1===e.indexOf(n)&&e.push(n)}return e}),[]);t.length>0&&(n.type=t)}return N1("oneOf",n)}function K1(e){if(!A1(e))throw new TypeError("[VueTypes error]: You must provide an array as argument");let t=!1,n=!1,o=[];for(let i=0;io.indexOf(e)===t));const r=!1===n&&o.length>0?o:null;return N1("oneOfType",t?{type:r,validator(t){const n=[],o=e.some((e=>{const o=j1(e,t,!0);return"string"==typeof o&&n.push(o),!0===o}));return o||M1(`oneOfType - provided value does not match any of the ${n.length} passed-in validators:\n${L1(n.join("\n"))}`),o}}:{type:r})}function G1(e){return N1("arrayOf",{type:Array,validator(t){let n="";const o=t.every((t=>(n=j1(e,t,!0),!0===n)));return o||M1(`arrayOf - value validation error:\n${L1(n)}`),o}})}function q1(e){return N1("instanceOf",{type:e})}function J1(e){return N1("objectOf",{type:Object,validator(t){let n="";const o=Object.keys(t).every((o=>(n=j1(e,t[o],!0),!0===n)));return o||M1(`objectOf - value validation error:\n${L1(n)}`),o}})}function e2(e){const t=Object.keys(e),n=t.filter((t=>{var n;return!(null===(n=e[t])||void 0===n||!n.required)})),o=N1("shape",{type:Object,validator(o){if(!T1(o))return!1;const r=Object.keys(o);if(n.length>0&&n.some((e=>-1===r.indexOf(e)))){const e=n.filter((e=>-1===r.indexOf(e)));return M1(1===e.length?`shape - required property "${e[0]}" is not defined.`:`shape - required properties "${e.join('", "')}" are not defined.`),!1}return r.every((n=>{if(-1===t.indexOf(n))return!0===this._vueTypes_isLoose||(M1(`shape - shape definition does not include a "${n}" property. Allowed keys: "${t.join('", "')}".`),!1);const r=j1(e[n],o[n],!0);return"string"==typeof r&&M1(`shape - "${n}" property validation error:\n ${L1(r)}`),!0===r}))}});return Object.defineProperty(o,"_vueTypes_isLoose",{writable:!0,value:!1}),Object.defineProperty(o,"loose",{get(){return this._vueTypes_isLoose=!0,this}}),o}const t2=["name","validate","getter"],n2=(()=>{var e;return(e=class{static get any(){return H1()}static get func(){return _1("function",{type:Function}).def(this.defaults.func)}static get bool(){return void 0===this.defaults.bool?F1():F1().def(this.defaults.bool)}static get string(){return W1().def(this.defaults.string)}static get number(){return X1().def(this.defaults.number)}static get array(){return Y1().def(this.defaults.array)}static get object(){return V1().def(this.defaults.object)}static get integer(){return N1("integer",{type:Number,validator(e){const t=E1(e);return!1===t&&M1(`integer - "${e}" is not an integer`),t}}).def(this.defaults.integer)}static get symbol(){return N1("symbol",{validator(e){const t="symbol"==typeof e;return!1===t&&M1(`symbol - invalid value "${e}"`),t}})}static get nullable(){return Object.defineProperty({type:null,validator(e){const t=null===e;return!1===t&&M1("nullable - value should be null"),t}},"_vueTypes_name",{value:"nullable"})}static extend(e){if(M1("VueTypes.extend is deprecated. Use the ES6+ method instead. See https://dwightjack.github.io/vue-types/advanced/extending-vue-types.html#extending-namespaced-validators-in-es6 for details."),A1(e))return e.forEach((e=>this.extend(e))),this;const{name:t,validate:n=!1,getter:o=!1}=e,r=O1(e,t2);if(I1(this,t))throw new TypeError(`[VueTypes error]: Type "${t}" already defined`);const{type:i}=r;if(R1(i))return delete r.type,Object.defineProperty(this,t,o?{get:()=>Q1(t,i,r)}:{value(...e){const n=Q1(t,i,r);return n.validator&&(n.validator=n.validator.bind(n,...e)),n}});let l;return l=o?{get(){const e=Object.assign({},r);return n?_1(t,e):N1(t,e)},enumerable:!0}:{value(...e){const o=Object.assign({},r);let i;return i=n?_1(t,o):N1(t,o),o.validator&&(i.validator=o.validator.bind(i,...e)),i},enumerable:!0},Object.defineProperty(this,t,l)}}).defaults={},e.sensibleDefaults=void 0,e.config=w1,e.custom=Z1,e.oneOf=U1,e.instanceOf=q1,e.oneOfType=K1,e.arrayOf=G1,e.objectOf=J1,e.shape=e2,e.utils={validate:(e,t)=>!0===j1(t,e,!0),toType:(e,t,n=!1)=>n?_1(e,t):N1(e,t)},e})();!function(e={func:()=>{},bool:!0,string:"",number:0,array:()=>[],object:()=>({}),integer:0}){(class extends n2{static get sensibleDefaults(){return y1({},this.defaults)}static set sensibleDefaults(t){this.defaults=!1!==t?y1({},!0!==t?t:e):{}}}).defaults=y1({},e)}();const o2=Nn({__name:"AntdIcon",props:{modelValue:H1(),size:W1(),color:W1()},setup(e){const t=Nn({props:{value:H1(),size:W1(),color:W1()},setup:e=>()=>{const{value:t}=e;return t?Wr(t,{style:{fontSize:e.size,color:e.color}},{}):null}});return(n,o)=>(sr(),hr(xt(t),{value:e.modelValue,size:e.size,color:e.color},null,8,["value","size","color"]))}});var r2=(e=>(e[e.SpEl=1]="SpEl",e[e.Aviator=2]="Aviator",e[e.QL=3]="QL",e))(r2||{}),i2=(e=>(e[e["CRON表达式"]=1]="CRON表达式",e[e["固定时间"]=2]="固定时间",e))(i2||{}),l2=(e=>(e[e["丢弃"]=1]="丢弃",e[e["覆盖"]=2]="覆盖",e[e["并行"]=3]="并行",e))(l2||{}),a2=(e=>(e[e["跳过"]=1]="跳过",e[e["阻塞"]=2]="阻塞",e))(a2||{}),s2=(e=>(e[e["关闭"]=0]="关闭",e[e["开启"]=1]="开启",e))(s2||{}),c2=(e=>(e[e.and=1]="and",e[e.or=2]="or",e))(c2||{}),u2=(e=>(e[e["application/json"]=1]="application/json",e[e["application/x-www-form-urlencoded"]=2]="application/x-www-form-urlencoded",e))(u2||{});const d2={1:{title:"待处理",name:"waiting",color:"#64a6ea",icon:u0},2:{title:"运行中",name:"running",color:"#1b7ee5",icon:Pj},3:{title:"成功",name:"success",color:"#087da1",icon:hx},4:{title:"失败",name:"fail",color:"#f52d80",icon:Tx},5:{title:"停止",name:"stop",color:"#ac2df5",icon:UJ},6:{title:"取消",name:"cancel",color:"#f5732d",icon:yJ},99:{title:"跳过",name:"skip",color:"#00000036",icon:$J}},p2={1:{name:"Java",color:"#d06892"}},h2={0:{name:"无",color:"#f5f5f5"},1:{name:"执行超时",color:"#64a6ea"},2:{name:"无客户端节点",color:"#1b7ee5"},3:{name:"任务已关闭",color:"#087da1"},4:{name:"任务丢弃",color:"#3a2f81"},5:{name:"任务被覆盖",color:"#c2238a"},6:{name:"无可执行任务项",color:"#23c28a"},7:{name:"任务执行期间发生非预期异常",color:"#bdc223"},8:{name:"手动停止",color:"#23c28a"},9:{name:"条件节点执行异常",color:"#23c28a"},10:{name:"任务中断",color:"#bdc223"},11:{name:"回调节点执行异常",color:"#bdc223"},12:{name:"无需处理",color:"#23c28a"},13:{name:"节点处理失败并跳过",color:"#3a2f81"}},f2={2:{name:"运行中",color:"#1b7ee5"},3:{name:"成功",color:"#087da1"},4:{name:"失败",color:"#f52d80"},5:{name:"停止",color:"#ac2df5"}},g2={DEBUG:{name:"DEBUG",color:"#2647cc"},INFO:{name:"INFO",color:"#5c962c"},WARN:{name:"WARN",color:"#da9816"},ERROR:{name:"ERROR",color:"#dc3f41"}},m2={0:{name:"关闭",color:"#dc3f41"},1:{name:"开启",color:"#1b7ee5"}},v2=(e=>{const t={};return Object.keys(e).forEach((n=>{const o=e[parseInt(n,10)];t[parseInt(n,10)]={name:o.title,color:o.color}})),t})(d2),b2=e=>(rn("data-v-22637821"),e=e(),ln(),e),y2={class:"log"},O2={class:"scroller"},w2={class:"gutters"},S2=b2((()=>yr("div",{style:{"margin-top":"4px"}},null,-1))),x2={class:"gutter-element"},$2=b2((()=>yr("div",{style:{height:"25px"}},null,-1))),C2={class:"content"},k2={class:"text",style:{color:"#2db7f5"}},P2={class:"text",style:{color:"#00a3a3"}},T2={class:"text",style:{color:"#a771bf","font-weight":"500"}},M2=b2((()=>yr("div",{class:"text"},":",-1))),I2={class:"text",style:{"font-size":"16px"}},E2={style:{"text-align":"center",width:"100vh"}},A2=(e,t)=>{const n=e.__vccOpts||e;for(const[o,r]of t)n[o]=r;return n},D2=A2(Nn({__name:"LogModal",props:{open:F1().def(!1),record:V1().def({}),modalValue:Y1().def([])},emits:["update:open"],setup(e,{emit:t}){const n=Wr(Wb,{style:{fontSize:"24px",color:"#d9d9d9"},spin:!0}),o=t,r=e,i=bt(!1),l=bt([]);yn((()=>r.open),(e=>{i.value=e}),{immediate:!0}),yn((()=>r.modalValue),(e=>{l.value=e}),{immediate:!0,deep:!0});let a=0;Zn((()=>{p(),a=setInterval((()=>{p()}),1e3)}));const s=()=>{clearInterval(a),o("update:open",!1)},c=bt(!1);let u=0,d=0;const p=()=>{c.value?clearInterval(a):v1(`/job/log/list?taskBatchId=${r.record.taskBatchId}&jobId=${r.record.jobId}&taskId=${r.record.id}&startId=${u}&fromIndex=${d}&size=50`).then((e=>{c.value=e.finished,u=e.nextStartId,d=e.fromIndex,e.message&&l.value.push(...e.message)})).catch((()=>{c.value=!0}))},h=e=>{const t=new Date(Number.parseInt(e.toString()));return`${t.getFullYear()}-${1===(t.getMonth()+1).toString().length?"0"+(t.getMonth()+1):(t.getMonth()+1).toString()}-${t.getDate()} ${t.getHours()}:${1===t.getMinutes().toString().length?"0"+t.getMinutes():t.getMinutes().toString()}:${1===t.getSeconds().toString().length?"0"+t.getSeconds():t.getSeconds().toString()}`};return(t,o)=>{const r=hn("a-flex"),a=hn("a-spin"),u=hn("a-modal");return sr(),hr(u,{open:i.value,"onUpdate:open":o[0]||(o[0]=e=>i.value=e),centered:"",width:"95%",footer:null,title:"日志详情",onCancel:s},{default:an((()=>[yr("div",y2,[yr("div",O2,[yr("div",w2,[S2,(sr(!0),pr(nr,null,oo(l.value,((e,t)=>(sr(),pr("div",{key:e.time_stamp},[yr("div",x2,V(t+1),1),$2])))),128))]),yr("div",C2,[(sr(!0),pr(nr,null,oo(e.modalValue,(e=>(sr(),pr("div",{class:"line",key:e.time_stamp},[Or(r,{gap:"small"},{default:an((()=>[yr("div",k2,V(h(e.time_stamp)),1),yr("div",{class:"text",style:_({color:xt(g2)[e.level].color})},V(4===e.level.length?e.level+"\t":e.level),5),yr("div",P2,"["+V(e.thread)+"]",1),yr("div",T2,V(e.location),1),M2])),_:2},1024),yr("div",I2,V(e.message),1)])))),128)),yr("div",E2,[Or(a,{indicator:xt(n),spinning:!c.value},null,8,["indicator","spinning"])])])])])])),_:1},8,["open"])}}}),[["__scopeId","data-v-22637821"]]),R2={key:0},z2={style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},B2=(e=>(rn("data-v-b13db394"),e=e(),ln(),e))((()=>yr("span",{style:{"padding-left":"18px"}},"任务项列表",-1))),j2={style:{"padding-left":"6px"}},N2=["onClick"],_2={key:0},Q2=A2(Nn({__name:"DetailCard",props:{id:W1(),ids:Y1().def([]),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=po().slots,i=bd.PRESENTED_IMAGE_SIMPLE,l=m1(),a=bt(!1),s=bt(!1),c=bt(!1),u=bt(!1),d=bt(1),p=bt({}),h=bt([]),f=bt({current:1,defaultPageSize:10,pageSize:10,total:0,showSizeChanger:!1,showQuickJumper:!1,showTotal:e=>`共 ${e} 条`});yn((()=>o.open),(e=>{a.value=e}),{immediate:!0});const g=bt([]);Zn((()=>{o.ids.length>1&&(document.querySelector(".ant-pagination-prev").title="上一个",document.querySelector(".ant-pagination-next").title="下一个"),g.value=o.ids,o.ids.length>0?(y(o.ids[0]),O(o.ids[0])):o.id&&(g.value=[o.id],b(o.id),O(o.id))}));const m=()=>{n("update:open",!1)},b=e=>{c.value=!0,v1(`/job/${e}`).then((e=>{p.value=e,c.value=!1}))},y=e=>{c.value=!0,v1(`/job/batch/${e}`).then((e=>{p.value=e,c.value=!1}))},O=(e,t=1)=>{u.value=!0,v1(`/job/task/list?groupName=${l.GROUP_NAME}&taskBatchId=${e}&page=${t}`).then((e=>{f.value.total=e.total,h.value=e.data,u.value=!1}))},w=bt({}),S=bt([{title:"日志",dataIndex:"log",width:"5%"},{title:"ID",dataIndex:"id",width:"10%"},{title:"组名称",dataIndex:"groupName"},{title:"地址",dataIndex:"clientInfo"},{title:"参数",dataIndex:"argsStr",ellipsis:!0},{title:"结果",dataIndex:"resultMessage",ellipsis:!0},{title:"状态",dataIndex:"taskStatus"},{title:"重试次数",dataIndex:"retryCount"},{title:"开始执行时间",dataIndex:"createDt",sorter:!0,width:"12%"}]);return(t,n)=>{const o=hn("a-descriptions-item"),l=hn("a-tag"),b=hn("a-descriptions"),y=hn("a-spin"),x=hn("a-button"),$=hn("a-table"),C=hn("a-tab-pane"),k=hn("a-tabs"),P=hn("a-empty"),T=hn("a-pagination"),M=hn("a-drawer");return sr(),pr(nr,null,[Or(M,{title:"任务批次详情",placement:"right",width:800,open:a.value,"onUpdate:open":n[2]||(n[2]=e=>a.value=e),"destroy-on-close":"",onClose:m},ro({default:an((()=>[g.value&&g.value.length>0?(sr(),pr("div",R2,[Or(k,{activeKey:d.value,"onUpdate:activeKey":n[0]||(n[0]=e=>d.value=e),animated:""},{renderTabBar:an((()=>[])),default:an((()=>[(sr(!0),pr(nr,null,oo(g.value,((e,n)=>(sr(),hr(C,{key:n+1,tab:e},{default:an((()=>[Or(y,{spinning:c.value},{default:an((()=>[Or(b,{bordered:"",column:2},{default:an((()=>[Or(o,{label:"组名称"},{default:an((()=>[Sr(V(p.value.groupName),1)])),_:1}),p.value.jobName?(sr(),hr(o,{key:0,label:"任务名称"},{default:an((()=>[Sr(V(p.value.jobName),1)])),_:1})):xr("",!0),p.value.nodeName?(sr(),hr(o,{key:1,label:"节点名称"},{default:an((()=>[Sr(V(p.value.nodeName),1)])),_:1})):xr("",!0),Or(o,{label:"状态"},{default:an((()=>[null!=p.value.taskBatchStatus?(sr(),hr(l,{key:0,color:xt(v2)[p.value.taskBatchStatus].color},{default:an((()=>[Sr(V(xt(v2)[p.value.taskBatchStatus].name),1)])),_:1},8,["color"])):xr("",!0),null!=p.value.jobStatus?(sr(),hr(l,{key:1,color:xt(m2)[p.value.jobStatus].color},{default:an((()=>[Sr(V(xt(m2)[p.value.jobStatus].name),1)])),_:1},8,["color"])):xr("",!0)])),_:1}),xt(r).default?xr("",!0):(sr(),hr(o,{key:2,label:"执行器类型"},{default:an((()=>[p.value.executorType?(sr(),hr(l,{key:0,color:xt(p2)[p.value.executorType].color},{default:an((()=>[Sr(V(xt(p2)[p.value.executorType].name),1)])),_:1},8,["color"])):xr("",!0)])),_:1})),Or(o,{label:"操作原因"},{default:an((()=>[void 0!==p.value.operationReason?(sr(),hr(l,{key:0,color:xt(h2)[p.value.operationReason].color,style:_(0===p.value.operationReason?{color:"#1e1e1e"}:{})},{default:an((()=>[Sr(V(xt(h2)[p.value.operationReason].name),1)])),_:1},8,["color","style"])):xr("",!0)])),_:1}),xt(r).default?xr("",!0):(sr(),hr(o,{key:3,label:"执行器名称",span:2},{default:an((()=>[Sr(V(p.value.executorInfo),1)])),_:1})),Or(o,{label:"开始执行时间"},{default:an((()=>[Sr(V(p.value.executionAt),1)])),_:1}),Or(o,{label:"创建时间"},{default:an((()=>[Sr(V(p.value.createDt),1)])),_:1})])),_:1})])),_:1},8,["spinning"]),io(t.$slots,"default",{},void 0,!0),yr("div",z2,[B2,yr("span",j2,[Or(x,{type:"text",icon:Wr(xt(e0)),onClick:t=>O(e)},null,8,["icon","onClick"])])]),Or($,{dataSource:h.value,columns:S.value,loading:u.value,scroll:{x:1200},"row-key":"id",onChange:t=>{return n=e,o=t,f.value=o,void O(n,o.current);var n,o},pagination:f.value},{bodyCell:an((({column:e,record:t,text:n})=>["log"===e.dataIndex?(sr(),pr("a",{key:0,onClick:e=>{return n=t,w.value=n,void(s.value=!0);var n}},"点击查看",8,N2)):xr("",!0),"taskStatus"===e.dataIndex?(sr(),pr(nr,{key:1},[n?(sr(),hr(l,{key:0,color:xt(f2)[n].color},{default:an((()=>[Sr(V(xt(f2)[n].name),1)])),_:2},1032,["color"])):xr("",!0)],64)):xr("",!0),"clientInfo"===e.dataIndex?(sr(),pr(nr,{key:2},[Sr(V(""!==n?n.split("@")[1]:""),1)],64)):xr("",!0)])),_:2},1032,["dataSource","columns","loading","onChange","pagination"])])),_:2},1032,["tab"])))),128))])),_:3},8,["activeKey"])])):(sr(),hr(P,{key:1,class:"empty",image:xt(i),description:"暂无数据"},null,8,["image"]))])),_:2},[e.ids&&e.ids.length>0?{name:"footer",fn:an((()=>[Or(T,{style:{"text-align":"center"},current:d.value,"onUpdate:current":n[1]||(n[1]=e=>d.value=e),total:e.ids.length,pageSize:1,hideOnSinglePage:""},{itemRender:an((({page:e,type:t,originalElement:n})=>{return["page"===t?(sr(),pr("a",_2,V(e),1)):(sr(),hr((o=n,v(o)?gn(pn,o,!1)||o:o||fn),{key:1}))];var o})),_:1},8,["current","total"])])),key:"0"}:void 0]),1032,["open"]),s.value&&w.value?(sr(),hr(D2,{key:0,open:s.value,"onUpdate:open":n[3]||(n[3]=e=>s.value=e),record:w.value},null,8,["open","record"])):xr("",!0)],64)}}}),[["__scopeId","data-v-b13db394"]]),L2=e=>(rn("data-v-74f467a1"),e=e(),ln(),e),H2={class:"add-node-btn-box"},F2={class:"add-node-btn"},W2={class:"add-node-popover-body"},X2={class:"icon"},Y2=L2((()=>yr("p",null,"任务节点",-1))),V2=L2((()=>yr("p",null,"决策节点",-1))),Z2=L2((()=>yr("p",null,"回调通知",-1))),U2=A2(Nn({__name:"AddNode",props:{modelValue:V1(),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=e=>{let t={};1===e?t={nodeName:"任务节点",nodeType:1,conditionNodes:[{nodeName:"任务1",failStrategy:1,priorityLevel:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}],childNode:o.modelValue}:2===e?t={nodeName:"决策节点",nodeType:2,conditionNodes:[{nodeName:"条件1",priorityLevel:1,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1,defaultDecision:0}},{nodeName:"其他情况",priorityLevel:2,decision:{expressionType:1,nodeExpression:"#true",logicalCondition:1,defaultDecision:1}}],childNode:o.modelValue}:3===e&&(t={nodeName:"回调通知",nodeType:3,conditionNodes:[{nodeName:"回调通知",workflowNodeStatus:1,callback:{webhook:void 0,contentType:void 0,secret:void 0}}],childNode:o.modelValue}),n("update:modelValue",t)};return(t,n)=>{const o=hn("a-button"),i=hn("a-popover");return sr(),pr("div",H2,[yr("div",F2,[e.disabled?xr("",!0):(sr(),hr(i,{key:0,placement:"rightTop",trigger:"click","overlay-style":{width:"296px"}},{content:an((()=>[yr("div",W2,[yr("ul",X2,[yr("li",null,[Or(o,{shape:"circle",size:"large",onClick:n[0]||(n[0]=e=>r(1))},{default:an((()=>[Or(xt(i0),{style:{color:"#3296fa"}})])),_:1}),Y2]),yr("li",null,[Or(o,{shape:"circle",size:"large",onClick:n[1]||(n[1]=e=>r(2))},{default:an((()=>[Or(xt(WJ),{style:{color:"#15bc83"}})])),_:1}),V2]),yr("li",null,[Or(o,{shape:"circle",size:"large",onClick:n[2]||(n[2]=e=>r(3))},{default:an((()=>[Or(xt(TQ),{style:{color:"#935af6"}})])),_:1}),Z2])])])])),default:an((()=>[Or(o,{type:"primary",icon:Wr(xt(zI)),shape:"circle"},null,8,["icon"])])),_:1}))])])}}}),[["__scopeId","data-v-74f467a1"]]),K2=e=>{const t=[];for(const n in e)if(Object.prototype.hasOwnProperty.call(e,n)){const o=e[n];"number"==typeof o&&t.push({name:n,value:o})}return t},G2=Nn({__name:"TaskDrawer",props:{open:F1().def(!1),len:X1().def(0),modelValue:V1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt(!1),l=bt({}),a=bt([]);Zn((()=>{a.value=r.JOB_LIST})),yn((()=>o.open),(e=>{i.value=e}),{immediate:!0}),yn((()=>o.modelValue),(e=>{l.value=e}),{immediate:!0,deep:!0});const s=()=>{n("update:modelValue",l.value)},c=bt(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",l.value)})).catch((()=>{MB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),i.value=!1},p={failStrategy:[{required:!0,message:"请选择失败策略",trigger:"change"}],workflowNodeStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(t,n)=>{const o=hn("a-typography-paragraph"),r=hn("a-select-option"),h=hn("a-select"),f=hn("a-form-item"),g=hn("a-radio"),m=hn("a-radio-group"),v=hn("a-form"),b=hn("a-button"),y=hn("a-drawer");return sr(),hr(y,{open:i.value,"onUpdate:open":n[5]||(n[5]=e=>i.value=e),"destroy-on-close":"",width:500,onClose:d},{title:an((()=>[Or(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:l.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>l.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:s},null,8,["content"])])),extra:an((()=>[Or(h,{value:l.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>l.value.priorityLevel=e),style:{width:"110px"}},{default:an((()=>[(sr(!0),pr(nr,null,oo(e.len,(e=>(sr(),hr(r,{key:e,value:e},{default:an((()=>[Sr("优先级 "+V(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:an((()=>[Or(b,{type:"primary",onClick:u},{default:an((()=>[Sr("保存")])),_:1}),Or(b,{style:{"margin-left":"12px"},onClick:d},{default:an((()=>[Sr("取消")])),_:1})])),default:an((()=>[Or(v,{ref_key:"formRef",ref:c,rules:p,layout:"vertical",model:l.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:an((()=>[Or(f,{name:["jobTask","jobId"],label:"所属任务",placeholder:"请选择任务",rules:[{required:!0,message:"请选择任务",trigger:"change"}]},{default:an((()=>[Or(h,{value:l.value.jobTask.jobId,"onUpdate:value":n[2]||(n[2]=e=>l.value.jobTask.jobId=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(a.value,(e=>(sr(),hr(r,{key:e.id,value:e.id},{default:an((()=>[Sr(V(e.jobName),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(f,{name:"failStrategy",label:"失败策略"},{default:an((()=>[Or(m,{value:l.value.failStrategy,"onUpdate:value":n[3]||(n[3]=e=>l.value.failStrategy=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(a2)),(e=>(sr(),hr(g,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(f,{name:"workflowNodeStatus",label:"节点状态"},{default:an((()=>[Or(m,{value:l.value.workflowNodeStatus,"onUpdate:value":n[4]||(n[4]=e=>l.value.workflowNodeStatus=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(s2)),(e=>(sr(),hr(g,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),q2=Nn({__name:"TaskDetail",props:{modelValue:V1().def({}),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt(!1);yn((()=>o.open),(e=>{i.value=e}),{immediate:!0});const l=()=>{n("update:open",!1)},a=e=>{var t;return null==(t=r.JOB_LIST.find((t=>t.id===e)))?void 0:t.jobName};return(t,n)=>{const o=hn("a-descriptions-item"),r=hn("a-descriptions"),s=hn("a-drawer");return sr(),hr(s,{title:"任务详情",placement:"right",width:500,open:i.value,"onUpdate:open":n[0]||(n[0]=e=>i.value=e),"destroy-on-close":"",onClose:l},{default:an((()=>[Or(r,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(o,{label:"节点名称"},{default:an((()=>[Sr(V(e.modelValue.nodeName),1)])),_:1}),Or(o,{label:"任务 ID"},{default:an((()=>{var t;return[Sr(V(null==(t=e.modelValue.jobTask)?void 0:t.jobId),1)]})),_:1}),Or(o,{label:"任务名称"},{default:an((()=>{var t;return[Sr(V(a(null==(t=e.modelValue.jobTask)?void 0:t.jobId)),1)]})),_:1}),Or(o,{label:"失败策略"},{default:an((()=>[Sr(V(xt(a2)[e.modelValue.failStrategy]),1)])),_:1}),Or(o,{label:"工作流状态"},{default:an((()=>[Sr(V(xt(s2)[e.modelValue.workflowNodeStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),J2=e=>(rn("data-v-b84a7ebc"),e=e(),ln(),e),e3={class:"node-wrap"},t3={class:"branch-box"},n3={class:"condition-node"},o3={class:"condition-node-box"},r3=["onClick"],i3=["onClick"],l3={class:"title"},a3={class:"text",style:{color:"#3296fa"}},s3={class:"priority-title"},c3={class:"content",style:{"min-height":"81px"}},u3={key:0,class:"placeholder"},d3=J2((()=>yr("span",{class:"content_label"},"任务名称: ",-1))),p3=J2((()=>yr("span",{class:"content_label"},"失败策略: ",-1))),h3=J2((()=>yr("div",null,".........",-1))),f3=["onClick"],g3={key:1,class:"top-left-cover-line"},m3={key:2,class:"bottom-left-cover-line"},v3={key:3,class:"top-right-cover-line"},b3={key:4,class:"bottom-right-cover-line"},y3=A2(Nn({__name:"TaskNode",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt({}),l=bt({});yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{var e;const t=i.value.conditionNodes.length+1;null==(e=i.value.conditionNodes)||e.push({nodeName:"任务"+t,priorityLevel:t,failStrategy:1,workflowNodeStatus:1,jobTask:{jobId:void 0}}),n("update:modelValue",i.value)},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},u=bt(0),d=bt(!1),p=bt({}),h=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&c(u.value,o-t),n("update:modelValue",i.value)},f=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus&&d2[e.taskBatchStatus]?d2[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover",g=bt(),m=bt(),v=bt(!1),b=bt([]),y=(e,t)=>{var n,l,a,s;m.value=[],2===r.TYPE?(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),(null==(l=e.jobTask)?void 0:l.jobId)&&(g.value=null==(a=e.jobTask)?void 0:a.jobId.toString()),v.value=!0):1===r.TYPE?b.value[t]=!0:(s=t,o.disabled||(u.value=s,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[s])),d.value=!0))};return(t,o)=>{const u=hn("a-button"),O=hn("a-badge"),w=hn("a-tooltip"),S=hn("a-popover");return sr(),pr("div",e3,[yr("div",t3,[e.disabled?xr("",!0):(sr(),hr(u,{key:0,class:"add-branch",primary:"",onClick:a},{default:an((()=>[Sr("添加任务")])),_:1})),(sr(!0),pr(nr,null,oo(i.value.conditionNodes,((o,a)=>(sr(),pr("div",{class:"col-box",key:a},[yr("div",n3,[yr("div",o3,[Or(S,{open:l.value[a]&&2===xt(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[a]=e},{content:an((()=>[])),default:an((()=>{var t,l,u,d;return[yr("div",{class:W(["auto-judge",f(o)]),style:{cursor:"pointer"},onClick:e=>y(o,a)},[0!=a?(sr(),pr("div",{key:0,class:"sort-left",onClick:Li((e=>c(a,-1)),["stop"])},[Or(xt(FD))],8,i3)):xr("",!0),yr("div",l3,[yr("span",a3,[Or(O,{status:"processing",color:1===o.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Sr(" "+V(o.nodeName),1)]),yr("span",s3,"优先级"+V(o.priorityLevel),1),e.disabled?xr("",!0):(sr(),hr(xt(ey),{key:0,class:"close",onClick:Li((e=>(e=>{var t;1===i.value.conditionNodes.length?(i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Wt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))):null==(t=i.value.conditionNodes)||t.splice(e,1)})(a)),["stop"])},null,8,["onClick"]))]),yr("div",c3,[(null==(t=o.jobTask)?void 0:t.jobId)?xr("",!0):(sr(),pr("div",u3,"请选择任务")),(null==(l=o.jobTask)?void 0:l.jobId)?(sr(),pr(nr,{key:1},[yr("div",null,[d3,Sr(" "+V(null==(u=o.jobTask)?void 0:u.jobName)+"("+V(null==(d=o.jobTask)?void 0:d.jobId)+")",1)]),yr("div",null,[p3,Sr(V(xt(a2)[o.failStrategy]),1)]),h3],64)):xr("",!0)]),a!=i.value.conditionNodes.length-1?(sr(),pr("div",{key:1,class:"sort-right",onClick:Li((e=>c(a)),["stop"])},[Or(xt(uk))],8,f3)):xr("",!0),2===xt(r).TYPE&&o.taskBatchStatus?(sr(),hr(w,{key:2},{title:an((()=>[Sr(V(xt(d2)[o.taskBatchStatus].title),1)])),default:an((()=>[Or(xt(o2),{class:"error-tip",color:xt(d2)[o.taskBatchStatus].color,size:"24px",onClick:Li((()=>{}),["stop"]),"model-value":xt(d2)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):xr("",!0)],10,r3)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Or(U2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?io(t.$slots,"default",{key:0,node:o},void 0,!0):xr("",!0),0==a?(sr(),pr("div",g3)):xr("",!0),0==a?(sr(),pr("div",m3)):xr("",!0),a==i.value.conditionNodes.length-1?(sr(),pr("div",v3)):xr("",!0),a==i.value.conditionNodes.length-1?(sr(),pr("div",b3)):xr("",!0),0!==xt(r).type&&b.value[a]?(sr(),hr(q2,{key:5,open:b.value[a],"onUpdate:open":e=>b.value[a]=e,modelValue:i.value.conditionNodes[a],"onUpdate:modelValue":e=>i.value.conditionNodes[a]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):xr("",!0)])))),128))]),i.value.conditionNodes.length>1?(sr(),hr(U2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):xr("",!0),0===xt(r).TYPE&&d.value?(sr(),hr(G2,{key:1,open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:p.value,"onUpdate:modelValue":o[2]||(o[2]=e=>p.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:h},null,8,["open","modelValue","len"])):xr("",!0),0!==xt(r).TYPE&&v.value?(sr(),hr(xt(Q2),{key:2,open:v.value,"onUpdate:open":o[4]||(o[4]=e=>v.value=e),id:g.value,ids:m.value},null,8,["open","id","ids"])):xr("",!0)])}}}),[["__scopeId","data-v-b84a7ebc"]]);class O3{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,n){[e,t]=M3(this,e,t);let o=[];return this.decompose(0,e,o,2),n.length&&n.decompose(0,n.length,o,3),this.decompose(t,this.length,o,1),S3.from(o,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=M3(this,e,t);let n=[];return this.decompose(e,t,n,0),S3.from(n,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),n=this.length-this.scanIdentical(e,-1),o=new C3(this),r=new C3(e);for(let i=t,l=t;;){if(o.next(i),r.next(i),i=0,o.lineBreak!=r.lineBreak||o.done!=r.done||o.value!=r.value)return!1;if(l+=o.value.length,o.done||l>=n)return!0}}iter(e=1){return new C3(this,e)}iterRange(e,t=this.length){return new k3(this,e,t)}iterLines(e,t){let n;if(null==e)n=this.iter();else{null==t&&(t=this.lines+1);let o=this.line(e).from;n=this.iterRange(o,Math.max(o,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new P3(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(0==e.length)throw new RangeError("A document must have at least one line");return 1!=e.length||e[0]?e.length<=32?new w3(e):S3.from(w3.split(e,[])):O3.empty}}class w3 extends O3{constructor(e,t=function(e){let t=-1;for(let n of e)t+=n.length+1;return t}(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.text[r],l=o+i.length;if((t?n:l)>=e)return new T3(o,l,n,i);o=l+1,n++}}decompose(e,t,n,o){let r=e<=0&&t>=this.length?this:new w3($3(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(1&o){let e=n.pop(),t=x3(r.text,e.text.slice(),0,r.length);if(t.length<=32)n.push(new w3(t,e.length+r.length));else{let e=t.length>>1;n.push(new w3(t.slice(0,e)),new w3(t.slice(e)))}}else n.push(r)}replace(e,t,n){if(!(n instanceof w3))return super.replace(e,t,n);[e,t]=M3(this,e,t);let o=x3(this.text,x3(n.text,$3(this.text,0,e)),t),r=this.length+n.length-(t-e);return o.length<=32?new w3(o,r):S3.from(w3.split(o,[]),r)}sliceString(e,t=this.length,n="\n"){[e,t]=M3(this,e,t);let o="";for(let r=0,i=0;r<=t&&ie&&i&&(o+=n),er&&(o+=l.slice(Math.max(0,e-r),t-r)),r=a+1}return o}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],o=-1;for(let r of e)n.push(r),o+=r.length+1,32==n.length&&(t.push(new w3(n,o)),n=[],o=-1);return o>-1&&t.push(new w3(n,o)),t}}class S3 extends O3{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,o){for(let r=0;;r++){let i=this.children[r],l=o+i.length,a=n+i.lines-1;if((t?a:l)>=e)return i.lineInner(e,t,n,o);o=l+1,n=a+1}}decompose(e,t,n,o){for(let r=0,i=0;i<=t&&r=i){let r=o&((i<=e?1:0)|(a>=t?2:0));i>=e&&a<=t&&!r?n.push(l):l.decompose(e-i,t-i,n,r)}i=a+1}}replace(e,t,n){if([e,t]=M3(this,e,t),n.lines=r&&t<=l){let a=i.replace(e-r,t-r,n),s=this.lines-i.lines+a.lines;if(a.lines>4&&a.lines>s>>6){let r=this.children.slice();return r[o]=a,new S3(r,this.length-(t-e)+n.length)}return super.replace(r,l,a)}r=l+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n="\n"){[e,t]=M3(this,e,t);let o="";for(let r=0,i=0;re&&r&&(o+=n),ei&&(o+=l.sliceString(e-i,t-i,n)),i=a+1}return o}flatten(e){for(let t of this.children)t.flatten(e)}scanIdentical(e,t){if(!(e instanceof S3))return 0;let n=0,[o,r,i,l]=t>0?[0,0,this.children.length,e.children.length]:[this.children.length-1,e.children.length-1,-1,-1];for(;;o+=t,r+=t){if(o==i||r==l)return n;let a=this.children[o],s=e.children[r];if(a!=s)return n+a.scanIdentical(s,t);n+=a.length+1}}static from(e,t=e.reduce(((e,t)=>e+t.length+1),-1)){let n=0;for(let p of e)n+=p.lines;if(n<32){let n=[];for(let t of e)t.flatten(n);return new w3(n,t)}let o=Math.max(32,n>>5),r=o<<1,i=o>>1,l=[],a=0,s=-1,c=[];function u(e){let t;if(e.lines>r&&e instanceof S3)for(let n of e.children)u(n);else e.lines>i&&(a>i||!a)?(d(),l.push(e)):e instanceof w3&&a&&(t=c[c.length-1])instanceof w3&&e.lines+t.lines<=32?(a+=e.lines,s+=e.length+1,c[c.length-1]=new w3(t.text.concat(e.text),t.length+1+e.length)):(a+e.lines>o&&d(),a+=e.lines,s+=e.length+1,c.push(e))}function d(){0!=a&&(l.push(1==c.length?c[0]:S3.from(c,s)),s=-1,a=c.length=0)}for(let p of e)u(p);return d(),1==l.length?l[0]:new S3(l,t)}}function x3(e,t,n=0,o=1e9){for(let r=0,i=0,l=!0;i=n&&(s>o&&(a=a.slice(0,o-r)),r0?1:(e instanceof w3?e.text.length:e.children.length)<<1]}nextInner(e,t){for(this.done=this.lineBreak=!1;;){let n=this.nodes.length-1,o=this.nodes[n],r=this.offsets[n],i=r>>1,l=o instanceof w3?o.text.length:o.children.length;if(i==(t>0?l:0)){if(0==n)return this.done=!0,this.value="",this;t>0&&this.offsets[n-1]++,this.nodes.pop(),this.offsets.pop()}else if((1&r)==(t>0?0:1)){if(this.offsets[n]+=t,0==e)return this.lineBreak=!0,this.value="\n",this;e--}else if(o instanceof w3){let r=o.text[i+(t<0?-1:0)];if(this.offsets[n]+=t,r.length>Math.max(0,e))return this.value=0==e?r:t>0?r.slice(e):r.slice(0,r.length-e),this;e-=r.length}else{let r=o.children[i+(t<0?-1:0)];e>r.length?(e-=r.length,this.offsets[n]+=t):(t<0&&this.offsets[n]--,this.nodes.push(r),this.offsets.push(t>0?1:(r instanceof w3?r.text.length:r.children.length)<<1))}}}next(e=0){return e<0&&(this.nextInner(-e,-this.dir),e=this.value.length),this.nextInner(e,this.dir)}}class k3{constructor(e,t,n){this.value="",this.done=!1,this.cursor=new C3(e,t>n?-1:1),this.pos=t>n?e.length:0,this.from=Math.min(t,n),this.to=Math.max(t,n)}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 n=t<0?this.pos-this.from:this.to-this.pos;e>n&&(e=n),n-=e;let{value:o}=this.cursor.next(e);return this.pos+=(o.length+e)*t,this.value=o.length<=n?o:t<0?o.slice(o.length-n):o.slice(0,n),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 P3{constructor(e){this.inner=e,this.afterBreak=!0,this.value="",this.done=!1}next(e=0){let{done:t,lineBreak:n,value:o}=this.inner.next(e);return t&&this.afterBreak?(this.value="",this.afterBreak=!1):t?(this.done=!0,this.value=""):n?this.afterBreak?this.value="":(this.afterBreak=!0,this.next()):(this.value=o,this.afterBreak=!1),this}get lineBreak(){return!1}}"undefined"!=typeof Symbol&&(O3.prototype[Symbol.iterator]=function(){return this.iter()},C3.prototype[Symbol.iterator]=k3.prototype[Symbol.iterator]=P3.prototype[Symbol.iterator]=function(){return this});class T3{constructor(e,t,n,o){this.from=e,this.to=t,this.number=n,this.text=o}get length(){return this.to-this.from}}function M3(e,t,n){return[t=Math.max(0,Math.min(e.length,t)),Math.max(t,Math.min(e.length,n))]}let I3="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((e=>e?parseInt(e,36):1));for(let Xpe=1;Xpee)return I3[t-1]<=e;return!1}function A3(e){return e>=127462&&e<=127487}function D3(e,t,n=!0,o=!0){return(n?R3:z3)(e,t,o)}function R3(e,t,n){if(t==e.length)return t;t&&B3(e.charCodeAt(t))&&j3(e.charCodeAt(t-1))&&t--;let o=N3(e,t);for(t+=Q3(o);t=0&&A3(N3(e,o));)n++,o-=2;if(n%2==0)break;t+=2}}}return t}function z3(e,t,n){for(;t>0;){let o=R3(e,t-2,n);if(o=56320&&e<57344}function j3(e){return e>=55296&&e<56320}function N3(e,t){let n=e.charCodeAt(t);if(!j3(n)||t+1==e.length)return n;let o=e.charCodeAt(t+1);return B3(o)?o-56320+(n-55296<<10)+65536:n}function _3(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}function Q3(e){return e<65536?1:2}const L3=/\r\n?|\n/;var H3=function(e){return e[e.Simple=0]="Simple",e[e.TrackDel=1]="TrackDel",e[e.TrackBefore=2]="TrackBefore",e[e.TrackAfter=3]="TrackAfter",e}(H3||(H3={}));class F3{constructor(e){this.sections=e}get length(){let e=0;for(let t=0;te)return r+(e-o);r+=l}else{if(n!=H3.Simple&&s>=e&&(n==H3.TrackDel&&oe||n==H3.TrackBefore&&oe))return null;if(s>e||s==e&&t<0&&!l)return e==o||t<0?r:r+a;r+=a}o=s}if(e>o)throw new RangeError(`Position ${e} is out of range for changeset of length ${o}`);return r}touchesRange(e,t=e){for(let n=0,o=0;n=0&&o<=t&&r>=e)return!(ot)||"cover";o=r}return!1}toString(){let e="";for(let t=0;t=0?":"+o:"")}return e}toJSON(){return this.sections}static fromJSON(e){if(!Array.isArray(e)||e.length%2||e.some((e=>"number"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeDesc");return new F3(e)}static create(e){return new F3(e)}}class W3 extends F3{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 V3(this,((t,n,o,r,i)=>e=e.replace(o,o+(n-t),i)),!1),e}mapDesc(e,t=!1){return Z3(this,e,t,!0)}invert(e){let t=this.sections.slice(),n=[];for(let o=0,r=0;o=0){t[o]=l,t[o+1]=i;let a=o>>1;for(;n.length0&&Y3(n,t,r.text),r.forward(e),l+=e}let s=e[i++];for(;l>1].toJSON()))}return e}static of(e,t,n){let o=[],r=[],i=0,l=null;function a(e=!1){if(!e&&!o.length)return;il||e<0||l>t)throw new RangeError(`Invalid change range ${e} to ${l} (in doc of length ${t})`);let u=c?"string"==typeof c?O3.of(c.split(n||L3)):c:O3.empty,d=u.length;if(e==l&&0==d)return;ei&&X3(o,e-i,-1),X3(o,l-e,d),Y3(r,o,u),i=l}}(e),a(!l),l}static empty(e){return new W3(e?[e,-1]:[],[])}static fromJSON(e){if(!Array.isArray(e))throw new RangeError("Invalid JSON representation of ChangeSet");let t=[],n=[];for(let o=0;ot&&"string"!=typeof e)))throw new RangeError("Invalid JSON representation of ChangeSet");if(1==r.length)t.push(r[0],0);else{for(;n.length=0&&n<=0&&n==e[r+1]?e[r]+=t:0==t&&0==e[r]?e[r+1]+=n:o?(e[r]+=t,e[r+1]+=n):e.push(t,n)}function Y3(e,t,n){if(0==n.length)return;let o=t.length-2>>1;if(o>1])),!(n||l==e.sections.length||e.sections[l+1]<0);)a=e.sections[l++],s=e.sections[l++];t(r,c,i,u,d),r=c,i=u}}}function Z3(e,t,n,o=!1){let r=[],i=o?[]:null,l=new K3(e),a=new K3(t);for(let s=-1;;)if(-1==l.ins&&-1==a.ins){let e=Math.min(l.len,a.len);X3(r,e,-1),l.forward(e),a.forward(e)}else if(a.ins>=0&&(l.ins<0||s==l.i||0==l.off&&(a.len=0&&s=0)){if(l.done&&a.done)return i?W3.createSet(r,i):F3.create(r);throw new Error("Mismatched change set lengths")}{let e=0,t=l.len;for(;t;)if(-1==a.ins){let n=Math.min(t,a.len);e+=n,t-=n,a.forward(n)}else{if(!(0==a.ins&&a.lene||l.ins>=0&&l.len>e)&&(a||o.length>t),i.forward2(e),l.forward(e)}}else X3(o,0,l.ins,a),r&&Y3(r,o,l.text),l.next()}}class K3{constructor(e){this.set=e,this.i=0,this.next()}next(){let{sections:e}=this.set;this.i>1;return t>=e.length?O3.empty:e[t]}textBit(e){let{inserted:t}=this.set,n=this.i-2>>1;return n>=t.length&&!e?O3.empty:t[n].slice(this.off,null==e?void 0:this.off+e)}forward(e){e==this.len?this.next():(this.len-=e,this.off+=e)}forward2(e){-1==this.ins?this.forward(e):e==this.ins?this.next():(this.ins-=e,this.off+=e)}}class G3{constructor(e,t,n){this.from=e,this.to=t,this.flags=n}get anchor(){return 32&this.flags?this.to:this.from}get head(){return 32&this.flags?this.from:this.to}get empty(){return this.from==this.to}get assoc(){return 8&this.flags?-1:16&this.flags?1:0}get bidiLevel(){let e=7&this.flags;return 7==e?null:e}get goalColumn(){let e=this.flags>>6;return 16777215==e?void 0:e}map(e,t=-1){let n,o;return this.empty?n=o=e.mapPos(this.from,t):(n=e.mapPos(this.from,1),o=e.mapPos(this.to,-1)),n==this.from&&o==this.to?this:new G3(n,o,this.flags)}extend(e,t=e){if(e<=this.anchor&&t>=this.anchor)return q3.range(e,t);let n=Math.abs(e-this.anchor)>Math.abs(t-this.anchor)?e:t;return q3.range(this.anchor,n)}eq(e){return this.anchor==e.anchor&&this.head==e.head}toJSON(){return{anchor:this.anchor,head:this.head}}static fromJSON(e){if(!e||"number"!=typeof e.anchor||"number"!=typeof e.head)throw new RangeError("Invalid JSON representation for SelectionRange");return q3.range(e.anchor,e.head)}static create(e,t,n){return new G3(e,t,n)}}class q3{constructor(e,t){this.ranges=e,this.mainIndex=t}map(e,t=-1){return e.empty?this:q3.create(this.ranges.map((n=>n.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)||"number"!=typeof e.main||e.main>=e.ranges.length)throw new RangeError("Invalid JSON representation for EditorSelection");return new q3(e.ranges.map((e=>G3.fromJSON(e))),e.main)}static single(e,t=e){return new q3([q3.range(e,t)],0)}static create(e,t=0){if(0==e.length)throw new RangeError("A selection needs at least one range");for(let n=0,o=0;oe?8:0)|r)}static normalized(e,t=0){let n=e[t];e.sort(((e,t)=>e.from-t.from)),t=e.indexOf(n);for(let o=1;on.head?q3.range(l,i):q3.range(i,l))}}return new q3(e,t)}}function J3(e,t){for(let n of e.ranges)if(n.to>t)throw new RangeError("Selection points outside of document")}let e4=0;class t4{constructor(e,t,n,o,r){this.combine=e,this.compareInput=t,this.compare=n,this.isStatic=o,this.id=e4++,this.default=e([]),this.extensions="function"==typeof r?r(this):r}get reader(){return this}static define(e={}){return new t4(e.combine||(e=>e),e.compareInput||((e,t)=>e===t),e.compare||(e.combine?(e,t)=>e===t:n4),!!e.static,e.enables)}of(e){return new o4([],this,0,e)}compute(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new o4(e,this,1,t)}computeN(e,t){if(this.isStatic)throw new Error("Can't compute a static facet");return new o4(e,this,2,t)}from(e,t){return t||(t=e=>e),this.compute([e],(n=>t(n.field(e))))}}function n4(e,t){return e==t||e.length==t.length&&e.every(((e,n)=>e===t[n]))}class o4{constructor(e,t,n,o){this.dependencies=e,this.facet=t,this.type=n,this.value=o,this.id=e4++}dynamicSlot(e){var t;let n=this.value,o=this.facet.compareInput,r=this.id,i=e[r]>>1,l=2==this.type,a=!1,s=!1,c=[];for(let u of this.dependencies)"doc"==u?a=!0:"selection"==u?s=!0:0==(1&(null!==(t=e[u.id])&&void 0!==t?t:1))&&c.push(e[u.id]);return{create:e=>(e.values[i]=n(e),1),update(e,t){if(a&&t.docChanged||s&&(t.docChanged||t.selection)||i4(e,c)){let t=n(e);if(l?!r4(t,e.values[i],o):!o(t,e.values[i]))return e.values[i]=t,1}return 0},reconfigure:(e,t)=>{let a,s=t.config.address[r];if(null!=s){let r=O4(t,s);if(this.dependencies.every((n=>n instanceof t4?t.facet(n)===e.facet(n):!(n instanceof s4)||t.field(n,!1)==e.field(n,!1)))||(l?r4(a=n(e),r,o):o(a=n(e),r)))return e.values[i]=r,0}else a=n(e);return e.values[i]=a,1}}}}function r4(e,t,n){if(e.length!=t.length)return!1;for(let o=0;oe[t.id])),r=n.map((e=>e.type)),i=o.filter((e=>!(1&e))),l=e[t.id]>>1;function a(e){let n=[];for(let t=0;te===t),e);return e.provide&&(t.provides=e.provide(t)),t}create(e){let t=e.facet(a4).find((e=>e.field==this));return((null==t?void 0:t.create)||this.createF)(e)}slot(e){let t=e[this.id]>>1;return{create:e=>(e.values[t]=this.create(e),1),update:(e,n)=>{let o=e.values[t],r=this.updateF(o,n);return this.compareF(o,r)?0:(e.values[t]=r,1)},reconfigure:(e,n)=>null!=n.config.address[this.id]?(e.values[t]=n.field(this),0):(e.values[t]=this.create(e),1)}}init(e){return[this,a4.of({field:this,create:e})]}get extension(){return this}}const c4=4,u4=3,d4=2,p4=1;function h4(e){return t=>new g4(t,e)}const f4={highest:h4(0),high:h4(p4),default:h4(d4),low:h4(u4),lowest:h4(c4)};class g4{constructor(e,t){this.inner=e,this.prec=t}}class m4{of(e){return new v4(this,e)}reconfigure(e){return m4.reconfigure.of({compartment:this,extension:e})}get(e){return e.config.compartments.get(this)}}class v4{constructor(e,t){this.compartment=e,this.inner=t}}class b4{constructor(e,t,n,o,r,i){for(this.base=e,this.compartments=t,this.dynamicSlots=n,this.address=o,this.staticValues=r,this.facets=i,this.statusTemplate=[];this.statusTemplate.length>1]}static resolve(e,t,n){let o=[],r=Object.create(null),i=new Map;for(let d of function(e,t,n){let o=[[],[],[],[],[]],r=new Map;function i(e,l){let a=r.get(e);if(null!=a){if(a<=l)return;let t=o[a].indexOf(e);t>-1&&o[a].splice(t,1),e instanceof v4&&n.delete(e.compartment)}if(r.set(e,l),Array.isArray(e))for(let t of e)i(t,l);else if(e instanceof v4){if(n.has(e.compartment))throw new RangeError("Duplicate use of compartment in extensions");let o=t.get(e.compartment)||e.inner;n.set(e.compartment,o),i(o,l)}else if(e instanceof g4)i(e.inner,e.prec);else if(e instanceof s4)o[l].push(e),e.provides&&i(e.provides,l);else if(e instanceof o4)o[l].push(e),e.facet.extensions&&i(e.facet.extensions,d4);else{let t=e.extension;if(!t)throw new Error(`Unrecognized extension value in extension set (${e}). This sometimes happens because multiple instances of @codemirror/state are loaded, breaking instanceof checks.`);i(t,l)}}return i(e,d4),o.reduce(((e,t)=>e.concat(t)))}(e,t,i))d instanceof s4?o.push(d):(r[d.facet.id]||(r[d.facet.id]=[])).push(d);let l=Object.create(null),a=[],s=[];for(let d of o)l[d.id]=s.length<<1,s.push((e=>d.slot(e)));let c=null==n?void 0:n.config.facets;for(let d in r){let e=r[d],t=e[0].facet,o=c&&c[d]||[];if(e.every((e=>0==e.type)))if(l[t.id]=a.length<<1|1,n4(o,e))a.push(n.facet(t));else{let o=t.combine(e.map((e=>e.value)));a.push(n&&t.compare(o,n.facet(t))?n.facet(t):o)}else{for(let t of e)0==t.type?(l[t.id]=a.length<<1|1,a.push(t.value)):(l[t.id]=s.length<<1,s.push((e=>t.dynamicSlot(e))));l[t.id]=s.length<<1,s.push((n=>l4(n,t,e)))}}let u=s.map((e=>e(l)));return new b4(e,i,u,l,a,r)}}function y4(e,t){if(1&t)return 2;let n=t>>1,o=e.status[n];if(4==o)throw new Error("Cyclic dependency between fields and/or facets");if(2&o)return o;e.status[n]=4;let r=e.computeSlot(e,e.config.dynamicSlots[n]);return e.status[n]=2|r}function O4(e,t){return 1&t?e.config.staticValues[t>>1]:e.values[t>>1]}const w4=t4.define(),S4=t4.define({combine:e=>e.some((e=>e)),static:!0}),x4=t4.define({combine:e=>e.length?e[0]:void 0,static:!0}),$4=t4.define(),C4=t4.define(),k4=t4.define(),P4=t4.define({combine:e=>!!e.length&&e[0]});class T4{constructor(e,t){this.type=e,this.value=t}static define(){return new M4}}class M4{of(e){return new T4(this,e)}}class I4{constructor(e){this.map=e}of(e){return new E4(this,e)}}class E4{constructor(e,t){this.type=e,this.value=t}map(e){let t=this.type.map(this.value,e);return void 0===t?void 0:t==this.value?this:new E4(this.type,t)}is(e){return this.type==e}static define(e={}){return new I4(e.map||(e=>e))}static mapEffects(e,t){if(!e.length)return e;let n=[];for(let o of e){let e=o.map(t);e&&n.push(e)}return n}}E4.reconfigure=E4.define(),E4.appendConfig=E4.define();class A4{constructor(e,t,n,o,r,i){this.startState=e,this.changes=t,this.selection=n,this.effects=o,this.annotations=r,this.scrollIntoView=i,this._doc=null,this._state=null,n&&J3(n,t.newLength),r.some((e=>e.type==A4.time))||(this.annotations=r.concat(A4.time.of(Date.now())))}static create(e,t,n,o,r,i){return new A4(e,t,n,o,r,i)}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(A4.userEvent);return!(!t||!(t==e||t.length>e.length&&t.slice(0,e.length)==e&&"."==t[e.length]))}}function D4(e,t){let n=[];for(let o=0,r=0;;){let i,l;if(o=e[o]))i=e[o++],l=e[o++];else{if(!(r=0;r--){let i=n[r](e);i&&Object.keys(i).length&&(o=R4(o,z4(t,i,e.changes.newLength),!0))}return o==e?e:A4.create(t,e.changes,e.selection,o.effects,o.annotations,o.scrollIntoView)}(n?function(e){let t=e.startState,n=!0;for(let r of t.facet($4)){let t=r(e);if(!1===t){n=!1;break}Array.isArray(t)&&(n=!0===n?t:D4(n,t))}if(!0!==n){let o,r;if(!1===n)r=e.changes.invertedDesc,o=W3.empty(t.doc.length);else{let t=e.changes.filter(n);o=t.changes,r=t.filtered.mapDesc(t.changes).invertedDesc}e=A4.create(t,o,e.selection&&e.selection.map(r),E4.mapEffects(e.effects,r),e.annotations,e.scrollIntoView)}let o=t.facet(C4);for(let r=o.length-1;r>=0;r--){let n=o[r](e);e=n instanceof A4?n:Array.isArray(n)&&1==n.length&&n[0]instanceof A4?n[0]:B4(t,N4(n),!1)}return e}(r):r)}A4.time=T4.define(),A4.userEvent=T4.define(),A4.addToHistory=T4.define(),A4.remote=T4.define();const j4=[];function N4(e){return null==e?j4:Array.isArray(e)?e:[e]}var _4=function(e){return e[e.Word=0]="Word",e[e.Space=1]="Space",e[e.Other=2]="Other",e}(_4||(_4={}));const Q4=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/;let L4;try{L4=new RegExp("[\\p{Alphabetic}\\p{Number}_]","u")}catch(Wpe){}function H4(e){return t=>{if(!/\S/.test(t))return _4.Space;if(function(e){if(L4)return L4.test(e);for(let t=0;t"€"&&(n.toUpperCase()!=n.toLowerCase()||Q4.test(n)))return!0}return!1}(t))return _4.Word;for(let n=0;n-1)return _4.Word;return _4.Other}}class F4{constructor(e,t,n,o,r,i){this.config=e,this.doc=t,this.selection=n,this.values=o,this.status=e.statusTemplate.slice(),this.computeSlot=r,i&&(i._state=this);for(let l=0;lr.set(t,e))),n=null),r.set(l.value.compartment,l.value.extension)):l.is(E4.reconfigure)?(n=null,o=l.value):l.is(E4.appendConfig)&&(n=null,o=N4(o).concat(l.value));n?t=e.startState.values.slice():(n=b4.resolve(o,r,this),t=new F4(n,this.doc,this.selection,n.dynamicSlots.map((()=>null)),((e,t)=>t.reconfigure(e,this)),null).values);let i=e.startState.facet(S4)?e.newSelection:e.newSelection.asSingle();new F4(n,e.newDoc,i,t,((t,n)=>n.update(t,e)),e)}replaceSelection(e){return"string"==typeof e&&(e=this.toText(e)),this.changeByRange((t=>({changes:{from:t.from,to:t.to,insert:e},range:q3.cursor(t.from+e.length)})))}changeByRange(e){let t=this.selection,n=e(t.ranges[0]),o=this.changes(n.changes),r=[n.range],i=N4(n.effects);for(let l=1;lt.spec.fromJSON(i,e))))}return F4.create({doc:e.doc,selection:q3.fromJSON(e.selection),extensions:t.extensions?o.concat([t.extensions]):o})}static create(e={}){let t=b4.resolve(e.extensions||[],new Map),n=e.doc instanceof O3?e.doc:O3.of((e.doc||"").split(t.staticFacet(F4.lineSeparator)||L3)),o=e.selection?e.selection instanceof q3?e.selection:q3.single(e.selection.anchor,e.selection.head):q3.single(0);return J3(o,n.length),t.staticFacet(S4)||(o=o.asSingle()),new F4(t,n,o,t.dynamicSlots.map((()=>null)),((e,t)=>t.create(e)),null)}get tabSize(){return this.facet(F4.tabSize)}get lineBreak(){return this.facet(F4.lineSeparator)||"\n"}get readOnly(){return this.facet(P4)}phrase(e,...t){for(let n of this.facet(F4.phrases))if(Object.prototype.hasOwnProperty.call(n,e)){e=n[e];break}return t.length&&(e=e.replace(/\$(\$|\d*)/g,((e,n)=>{if("$"==n)return"$";let o=+(n||1);return!o||o>t.length?e:t[o-1]}))),e}languageDataAt(e,t,n=-1){let o=[];for(let r of this.facet(w4))for(let i of r(this,t,n))Object.prototype.hasOwnProperty.call(i,e)&&o.push(i[e]);return o}charCategorizer(e){return H4(this.languageDataAt("wordChars",e).join(""))}wordAt(e){let{text:t,from:n,length:o}=this.doc.lineAt(e),r=this.charCategorizer(e),i=e-n,l=e-n;for(;i>0;){let e=D3(t,i,!1);if(r(t.slice(e,i))!=_4.Word)break;i=e}for(;le.length?e[0]:4}),F4.lineSeparator=x4,F4.readOnly=P4,F4.phrases=t4.define({compare(e,t){let n=Object.keys(e),o=Object.keys(t);return n.length==o.length&&n.every((n=>e[n]==t[n]))}}),F4.languageData=w4,F4.changeFilter=$4,F4.transactionFilter=C4,F4.transactionExtender=k4,m4.reconfigure=E4.define();class X4{eq(e){return this==e}range(e,t=e){return Y4.create(e,t,this)}}X4.prototype.startSide=X4.prototype.endSide=0,X4.prototype.point=!1,X4.prototype.mapMode=H3.TrackDel;let Y4=class e{constructor(e,t,n){this.from=e,this.to=t,this.value=n}static create(t,n,o){return new e(t,n,o)}};function V4(e,t){return e.from-t.from||e.value.startSide-t.value.startSide}class Z4{constructor(e,t,n,o){this.from=e,this.to=t,this.value=n,this.maxPoint=o}get length(){return this.to[this.to.length-1]}findIndex(e,t,n,o=0){let r=n?this.to:this.from;for(let i=o,l=r.length;;){if(i==l)return i;let o=i+l>>1,a=r[o]-e||(n?this.value[o].endSide:this.value[o].startSide)-t;if(o==i)return a>=0?i:l;a>=0?l=o:i=o+1}}between(e,t,n,o){for(let r=this.findIndex(t,-1e9,!0),i=this.findIndex(n,1e9,!1,r);rc||s==c&&u.startSide>0&&u.endSide<=0)continue;(c-s||u.endSide-u.startSide)<0||(i<0&&(i=s),u.point&&(l=Math.max(l,c-s)),n.push(u),o.push(s-i),r.push(c-i))}return{mapped:n.length?new Z4(o,r,n,l):null,pos:i}}}class U4{constructor(e,t,n,o){this.chunkPos=e,this.chunk=t,this.nextLayer=n,this.maxPoint=o}static create(e,t,n,o){return new U4(e,t,n,o)}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:n=!1,filterFrom:o=0,filterTo:r=this.length}=e,i=e.filter;if(0==t.length&&!i)return this;if(n&&(t=t.slice().sort(V4)),this.isEmpty)return t.length?U4.of(t):this;let l=new q4(this,null,-1).goto(0),a=0,s=[],c=new K4;for(;l.value||a=0){let e=t[a++];c.addInner(e.from,e.to,e.value)||s.push(e)}else 1==l.rangeIndex&&l.chunkIndexthis.chunkEnd(l.chunkIndex)||rl.to||r=r&&e<=r+i.length&&!1===i.between(r,e-r,t-r,n))return}this.nextLayer.between(e,t,n)}}iter(e=0){return J4.from([this]).goto(e)}get isEmpty(){return this.nextLayer==this}static iter(e,t=0){return J4.from(e).goto(t)}static compare(e,t,n,o,r=-1){let i=e.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),l=t.filter((e=>e.maxPoint>0||!e.isEmpty&&e.maxPoint>=r)),a=G4(i,l,n),s=new t5(i,a,r),c=new t5(l,a,r);n.iterGaps(((e,t,n)=>n5(s,e,c,t,n,o))),n.empty&&0==n.length&&n5(s,0,c,0,0,o)}static eq(e,t,n=0,o){null==o&&(o=999999999);let r=e.filter((e=>!e.isEmpty&&t.indexOf(e)<0)),i=t.filter((t=>!t.isEmpty&&e.indexOf(t)<0));if(r.length!=i.length)return!1;if(!r.length)return!0;let l=G4(r,i),a=new t5(r,l,0).goto(n),s=new t5(i,l,0).goto(n);for(;;){if(a.to!=s.to||!o5(a.active,s.active)||a.point&&(!s.point||!a.point.eq(s.point)))return!1;if(a.to>o)return!0;a.next(),s.next()}}static spans(e,t,n,o,r=-1){let i=new t5(e,null,r).goto(t),l=t,a=i.openStart;for(;;){let e=Math.min(i.to,n);if(i.point){let n=i.activeForPoint(i.to),r=i.pointFroml&&(o.span(l,e,i.active,a),a=i.openEnd(e));if(i.to>n)return a+(i.point&&i.to>n?1:0);l=i.to,i.next()}}static of(e,t=!1){let n=new K4;for(let o of e instanceof Y4?[e]:t?function(e){if(e.length>1)for(let t=e[0],n=1;n0)return e.slice().sort(V4);t=o}return e}(e):e)n.add(o.from,o.to,o.value);return n.finish()}}U4.empty=new U4([],[],null,-1),U4.empty.nextLayer=U4.empty;class K4{finishChunk(e){this.chunks.push(new Z4(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,n){this.addInner(e,t,n)||(this.nextLayer||(this.nextLayer=new K4)).add(e,t,n)}addInner(e,t,n){let o=e-this.lastTo||n.startSide-this.last.endSide;if(o<=0&&(e-this.lastFrom||n.startSide-this.last.startSide)<0)throw new Error("Ranges must be added sorted by `from` position and `startSide`");return!(o<0||(250==this.from.length&&this.finishChunk(!0),this.chunkStart<0&&(this.chunkStart=e),this.from.push(e-this.chunkStart),this.to.push(t-this.chunkStart),this.last=n,this.lastFrom=e,this.lastTo=t,this.value.push(n),n.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 n=t.value.length-1;return this.last=t.value[n],this.lastFrom=t.from[n]+e,this.lastTo=t.to[n]+e,!0}finish(){return this.finishInner(U4.empty)}finishInner(e){if(this.from.length&&this.finishChunk(!1),0==this.chunks.length)return e;let t=U4.create(this.chunkPos,this.chunks,this.nextLayer?this.nextLayer.finishInner(e):e,this.setMaxPoint);return this.from=null,t}}function G4(e,t,n){let o=new Map;for(let i of e)for(let e=0;e=this.minPoint)break}}}setRangeIndex(e){if(e==this.layer.chunk[this.chunkIndex].value.length){if(this.chunkIndex++,this.skip)for(;this.chunkIndex=n&&o.push(new q4(i,t,n,r));return 1==o.length?o[0]:new J4(o)}get startSide(){return this.value?this.value.startSide:0}goto(e,t=-1e9){for(let n of this.heap)n.goto(e,t);for(let n=this.heap.length>>1;n>=0;n--)e5(this.heap,n);return this.next(),this}forward(e,t){for(let n of this.heap)n.forward(e,t);for(let n=this.heap.length>>1;n>=0;n--)e5(this.heap,n);(this.to-e||this.value.endSide-t)<0&&this.next()}next(){if(0==this.heap.length)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(),e5(this.heap,0)}}}function e5(e,t){for(let n=e[t];;){let o=1+(t<<1);if(o>=e.length)break;let r=e[o];if(o+1=0&&(r=e[o+1],o++),n.compare(r)<0)break;e[o]=n,e[t]=r,t=o}}class t5{constructor(e,t,n){this.minPoint=n,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=J4.from(e,t,n)}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){r5(this.active,e),r5(this.activeTo,e),r5(this.activeRank,e),this.minActive=l5(this.active,this.activeTo)}addActive(e){let t=0,{value:n,to:o,rank:r}=this.cursor;for(;t-1&&(this.activeTo[o]-this.cursor.from||this.active[o].endSide-this.cursor.startSide)<0){if(this.activeTo[o]>e){this.to=this.activeTo[o],this.endSide=this.active[o].endSide;break}this.removeActive(o),n&&r5(n,o)}else{if(!this.cursor.value){this.to=this.endSide=1e9;break}if(this.cursor.from>e){this.to=this.cursor.from,this.endSide=this.cursor.startSide;break}{let e=this.cursor.value;if(e.point){if(!(t&&this.cursor.to==this.to&&this.cursor.from=0&&n[t]=0&&!(this.activeRank[n]e||this.activeTo[n]==e&&this.active[n].endSide>=this.point.endSide)&&t.push(this.active[n]);return t.reverse()}openEnd(e){let t=0;for(let n=this.activeTo.length-1;n>=0&&this.activeTo[n]>e;n--)t++;return t}}function n5(e,t,n,o,r,i){e.goto(t),n.goto(o);let l=o+r,a=o,s=o-t;for(;;){let t=e.to+s-n.to||e.endSide-n.endSide,o=t<0?e.to+s:n.to,r=Math.min(o,l);if(e.point||n.point?e.point&&n.point&&(e.point==n.point||e.point.eq(n.point))&&o5(e.activeForPoint(e.to),n.activeForPoint(n.to))||i.comparePoint(a,r,e.point,n.point):r>a&&!o5(e.active,n.active)&&i.compareRange(a,r,e.active,n.active),o>l)break;a=o,t<=0&&e.next(),t>=0&&n.next()}}function o5(e,t){if(e.length!=t.length)return!1;for(let n=0;n=t;o--)e[o+1]=e[o];e[t]=n}function l5(e,t){let n=-1,o=1e9;for(let r=0;r=t)return r;if(r==e.length)break;i+=9==e.charCodeAt(r)?n-i%n:1,r=D3(e,r)}return!0===o?-1:e.length}const c5="undefined"==typeof Symbol?"__ͼ":Symbol.for("ͼ"),u5="undefined"==typeof Symbol?"__styleSet"+Math.floor(1e8*Math.random()):Symbol("styleSet"),d5="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:{};class p5{constructor(e,t){this.rules=[];let{finish:n}=t||{};function o(e){return/^@/.test(e)?[e]:e.split(/,\s*/)}function r(e,t,i,l){let a=[],s=/^@(\w+)\b/.exec(e[0]),c=s&&"keyframes"==s[1];if(s&&null==t)return i.push(e[0]+";");for(let n in t){let l=t[n];if(/&/.test(n))r(n.split(/,\s*/).map((t=>e.map((e=>t.replace(/&/,e))))).reduce(((e,t)=>e.concat(t))),l,i);else if(l&&"object"==typeof l){if(!s)throw new RangeError("The value of a property ("+n+") should be a primitive value.");r(o(n),l,a,c)}else null!=l&&a.push(n.replace(/_.*/,"").replace(/[A-Z]/g,(e=>"-"+e.toLowerCase()))+": "+l+";")}(a.length||c)&&i.push((!n||s||l?e:e.map(n)).join(", ")+" {"+a.join(" ")+"}")}for(let i in e)r(o(i),e[i],this.rules)}getRules(){return this.rules.join("\n")}static newName(){let e=d5[c5]||1;return d5[c5]=e+1,"ͼ"+e.toString(36)}static mount(e,t,n){let o=e[u5],r=n&&n.nonce;o?r&&o.setNonce(r):o=new f5(e,r),o.mount(Array.isArray(t)?t:[t])}}let h5=new Map;class f5{constructor(e,t){let n=e.ownerDocument||e,o=n.defaultView;if(!e.head&&e.adoptedStyleSheets&&o.CSSStyleSheet){let t=h5.get(n);if(t)return e.adoptedStyleSheets=[t.sheet,...e.adoptedStyleSheets],e[u5]=t;this.sheet=new o.CSSStyleSheet,e.adoptedStyleSheets=[this.sheet,...e.adoptedStyleSheets],h5.set(n,this)}else{this.styleTag=n.createElement("style"),t&&this.styleTag.setAttribute("nonce",t);let o=e.head||e;o.insertBefore(this.styleTag,o.firstChild)}this.modules=[],e[u5]=this}mount(e){let t=this.sheet,n=0,o=0;for(let r=0;r-1&&(this.modules.splice(l,1),o--,l=-1),-1==l){if(this.modules.splice(o++,0,i),t)for(let e=0;e",191:"?",192:"~",219:"{",220:"|",221:"}",222:'"'},v5="undefined"!=typeof navigator&&/Mac/.test(navigator.platform),b5="undefined"!=typeof navigator&&/MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent),y5=0;y5<10;y5++)g5[48+y5]=g5[96+y5]=String(y5);for(y5=1;y5<=24;y5++)g5[y5+111]="F"+y5;for(y5=65;y5<=90;y5++)g5[y5]=String.fromCharCode(y5+32),m5[y5]=String.fromCharCode(y5);for(var O5 in g5)m5.hasOwnProperty(O5)||(m5[O5]=g5[O5]);function w5(e){let t;return t=11==e.nodeType?e.getSelection?e:e.ownerDocument:e,t.getSelection()}function S5(e,t){return!!t&&(e==t||e.contains(1!=t.nodeType?t.parentNode:t))}function x5(e,t){if(!t.anchorNode)return!1;try{return S5(e,t.anchorNode)}catch(Wpe){return!1}}function $5(e){return 3==e.nodeType?B5(e,0,e.nodeValue.length).getClientRects():1==e.nodeType?e.getClientRects():[]}function C5(e,t,n,o){return!!n&&(P5(e,t,n,o,-1)||P5(e,t,n,o,1))}function k5(e){for(var t=0;;t++)if(!(e=e.previousSibling))return t}function P5(e,t,n,o,r){for(;;){if(e==n&&t==o)return!0;if(t==(r<0?0:T5(e))){if("DIV"==e.nodeName)return!1;let n=e.parentNode;if(!n||1!=n.nodeType)return!1;t=k5(e)+(r<0?0:1),e=n}else{if(1!=e.nodeType)return!1;if(1==(e=e.childNodes[t+(r<0?-1:0)]).nodeType&&"false"==e.contentEditable)return!1;t=r<0?T5(e):0}}}function T5(e){return 3==e.nodeType?e.nodeValue.length:e.childNodes.length}function M5(e,t){let n=t?e.left:e.right;return{left:n,right:n,top:e.top,bottom:e.bottom}}function I5(e){return{left:0,right:e.innerWidth,top:0,bottom:e.innerHeight}}function E5(e,t){let n=t.width/e.offsetWidth,o=t.height/e.offsetHeight;return(n>.995&&n<1.005||!isFinite(n)||Math.abs(t.width-e.offsetWidth)<1)&&(n=1),(o>.995&&o<1.005||!isFinite(o)||Math.abs(t.height-e.offsetHeight)<1)&&(o=1),{scaleX:n,scaleY:o}}class A5{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:n}=e;this.set(t,Math.min(e.anchorOffset,t?T5(t):0),n,Math.min(e.focusOffset,n?T5(n):0))}set(e,t,n,o){this.anchorNode=e,this.anchorOffset=t,this.focusNode=n,this.focusOffset=o}}let D5,R5=null;function z5(e){if(e.setActive)return e.setActive();if(R5)return e.focus(R5);let t=[];for(let n=e;n&&(t.push(n,n.scrollTop,n.scrollLeft),n!=n.ownerDocument);n=n.parentNode);if(e.focus(null==R5?{get preventScroll(){return R5={preventScroll:!0},!0}}:void 0),!R5){R5=!1;for(let e=0;eMath.max(1,e.scrollHeight-e.clientHeight-4)}class Q5{constructor(e,t,n=!0){this.node=e,this.offset=t,this.precise=n}static before(e,t){return new Q5(e.parentNode,k5(e),t)}static after(e,t){return new Q5(e.parentNode,k5(e)+1,t)}}const L5=[];class H5{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 n of this.children){if(n==e)return t;t+=n.length+n.breakAfter}throw new RangeError("Invalid child in posBefore")}posAfter(e){return this.posBefore(e)+e.length}sync(e,t){if(2&this.flags){let n,o=this.dom,r=null;for(let i of this.children){if(7&i.flags){if(!i.dom&&(n=r?r.nextSibling:o.firstChild)){let e=H5.get(n);(!e||!e.parent&&e.canReuseDOM(i))&&i.reuseDOM(n)}i.sync(e,t),i.flags&=-8}if(n=r?r.nextSibling:o.firstChild,t&&!t.written&&t.node==o&&n!=i.dom&&(t.written=!0),i.dom.parentNode==o)for(;n&&n!=i.dom;)n=F5(n);else o.insertBefore(i.dom,n);r=i.dom}for(n=r?r.nextSibling:o.firstChild,n&&t&&t.node==o&&(t.written=!0);n;)n=F5(n)}else if(1&this.flags)for(let n of this.children)7&n.flags&&(n.sync(e,t),n.flags&=-8)}reuseDOM(e){}localPosFromDOM(e,t){let n;if(e==this.dom)n=this.dom.childNodes[t];else{let o=0==T5(e)?0:0==t?-1:1;for(;;){let t=e.parentNode;if(t==this.dom)break;0==o&&t.firstChild!=t.lastChild&&(o=e==t.firstChild?-1:1),e=t}n=o<0?e:e.nextSibling}if(n==this.dom.firstChild)return 0;for(;n&&!H5.get(n);)n=n.nextSibling;if(!n)return this.length;for(let o=0,r=0;;o++){let e=this.children[o];if(e.dom==n)return r;r+=e.length+e.breakAfter}}domBoundsAround(e,t,n=0){let o=-1,r=-1,i=-1,l=-1;for(let a=0,s=n,c=n;at)return n.domBoundsAround(e,t,s);if(u>=e&&-1==o&&(o=a,r=s),s>t&&n.dom.parentNode==this.dom){i=a,l=c;break}c=u,s=u+n.breakAfter}return{from:r,to:l<0?n+this.length:l,startDOM:(o?this.children[o-1].dom.nextSibling:null)||this.dom.firstChild,endDOM:i=0?this.children[i].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),1&t.flags)return;t.flags|=1,e=!1}}setParent(e){this.parent!=e&&(this.parent=e,7&this.flags&&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,n=L5){this.markDirty();for(let o=e;othis.pos||e==this.pos&&(t>0||0==this.i||this.children[this.i-1].breakAfter))return this.off=e-this.pos,this;let n=this.children[--this.i];this.pos-=n.length+n.breakAfter}}}function X5(e,t,n,o,r,i,l,a,s){let{children:c}=e,u=c.length?c[t]:null,d=i.length?i[i.length-1]:null,p=d?d.breakAfter:l;if(!(t==o&&u&&!l&&!p&&i.length<2&&u.merge(n,r,i.length?d:null,0==n,a,s))){if(o0&&(!l&&i.length&&u.merge(n,u.length,i[0],!1,a,0)?u.breakAfter=i.shift().breakAfter:(n2);var r8={mac:o8||/Mac/.test(V5.platform),windows:/Win/.test(V5.platform),linux:/Linux|X11/.test(V5.platform),ie:q5,ie_version:K5?Z5.documentMode||6:G5?+G5[1]:U5?+U5[1]:0,gecko:J5,gecko_version:J5?+(/Firefox\/(\d+)/.exec(V5.userAgent)||[0,0])[1]:0,chrome:!!e8,chrome_version:e8?+e8[1]:0,ios:o8,android:/Android\b/.test(V5.userAgent),webkit:t8,safari:n8,webkit_version:t8?+(/\bAppleWebKit\/(\d+)/.exec(navigator.userAgent)||[0,0])[1]:0,tabSize:null!=Z5.documentElement.style.tabSize?"tab-size":"-moz-tab-size"};class i8 extends H5{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){3==e.nodeType&&this.createDOM(e)}merge(e,t,n){return!(8&this.flags||n&&(!(n instanceof i8)||this.length-(t-e)+n.length>256||8&n.flags)||(this.text=this.text.slice(0,e)+(n?n.text:"")+this.text.slice(t),this.markDirty(),0))}split(e){let t=new i8(this.text.slice(e));return this.text=this.text.slice(0,e),this.markDirty(),t.flags|=8&this.flags,t}localPosFromDOM(e,t){return e==this.dom?t:t?this.text.length:0}domAtPos(e){return new Q5(this.dom,e)}domBoundsAround(e,t,n){return{from:n,to:n+this.length,startDOM:this.dom,endDOM:this.dom.nextSibling}}coordsAt(e,t){return function(e,t,n){let o=e.nodeValue.length;t>o&&(t=o);let r=t,i=t,l=0;0==t&&n<0||t==o&&n>=0?r8.chrome||r8.gecko||(t?(r--,l=1):i=0)?0:a.length-1];return r8.safari&&!l&&0==s.width&&(s=Array.prototype.find.call(a,(e=>e.width))||s),l?M5(s,l<0):s||null}(this.dom,e,t)}}class l8 extends H5{constructor(e,t=[],n=0){super(),this.mark=e,this.children=t,this.length=n;for(let o of t)o.setParent(this)}setAttrs(e){if(N5(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)&&!(8&(this.flags|e.flags))}reuseDOM(e){e.nodeName==this.mark.tagName.toUpperCase()&&(this.setDOM(e),this.flags|=6)}sync(e,t){this.dom?4&this.flags&&this.setAttrs(this.dom):this.setDOM(this.setAttrs(document.createElement(this.mark.tagName))),super.sync(e,t)}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof l8&&n.mark.eq(this.mark))||e&&r<=0||te&&t.push(n=e&&(o=r),n=i,r++}let i=this.length-e;return this.length=e,o>-1&&(this.children.length=o,this.markDirty()),new l8(this.mark,t,i)}domAtPos(e){return c8(this,e)}coordsAt(e,t){return d8(this,e,t)}}class a8 extends H5{static create(e,t,n){return new a8(e,t,n)}constructor(e,t,n){super(),this.widget=e,this.length=t,this.side=n,this.prevWidget=null}split(e){let t=a8.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,n,o,r,i){return!(n&&(!(n instanceof a8&&this.widget.compare(n.widget))||e>0&&r<=0||t0)?Q5.before(this.dom):Q5.after(this.dom,e==this.length)}domBoundsAround(){return null}coordsAt(e,t){let n=this.widget.coordsAt(this.dom,e,t);if(n)return n;let o=this.dom.getClientRects(),r=null;if(!o.length)return null;let i=this.side?this.side<0:e>0;for(let l=i?o.length-1:0;r=o[l],!(e>0?0==l:l==o.length-1||r.top0?Q5.before(this.dom):Q5.after(this.dom)}localPosFromDOM(){return 0}domBoundsAround(){return null}coordsAt(e){return this.dom.getBoundingClientRect()}get overrideDOMText(){return O3.empty}get isHidden(){return!0}}function c8(e,t){let n=e.dom,{children:o}=e,r=0;for(let i=0;ri&&t0;i--){let e=o[i-1];if(e.dom.parentNode==n)return e.domAtPos(e.length)}for(let i=r;i0&&t instanceof l8&&r.length&&(o=r[r.length-1])instanceof l8&&o.mark.eq(t.mark)?u8(o,t.children[0],n-1):(r.push(t),t.setParent(e)),e.length+=t.length}function d8(e,t,n){let o=null,r=-1,i=null,l=-1;!function e(t,a){for(let s=0,c=0;s=a&&(u.children.length?e(u,a-c):(!i||i.isHidden&&n>0)&&(d>a||c==d&&u.getSide()>0)?(i=u,l=a-c):(c-1?1:0)!=r.length-(n&&r.indexOf(n)>-1?1:0))return!1;for(let i of o)if(i!=n&&(-1==r.indexOf(i)||e[i]!==t[i]))return!1;return!0}function g8(e,t,n){let o=!1;if(t)for(let r in t)n&&r in n||(o=!0,"style"==r?e.style.cssText="":e.removeAttribute(r));if(n)for(let r in n)t&&t[r]==n[r]||(o=!0,"style"==r?e.style.cssText=n[r]:e.setAttribute(r,n[r]));return o}function m8(e){let t=Object.create(null);for(let n=0;n0&&0==this.children[n-1].length;)this.children[--n].destroy();return this.children.length=n,this.markDirty(),this.length=e,t}transferDOM(e){this.dom&&(this.markDirty(),e.setDOM(this.dom),e.prevAttrs=void 0===this.prevAttrs?this.attrs:this.prevAttrs,this.prevAttrs=void 0,this.dom=null)}setDeco(e){f8(this.attrs,e)||(this.dom&&(this.prevAttrs=this.attrs,this.markDirty()),this.attrs=e)}append(e,t){u8(this,e,t)}addLineDeco(e){let t=e.spec.attributes,n=e.spec.class;t&&(this.attrs=p8(t,this.attrs||{})),n&&(this.attrs=p8({class:n},this.attrs||{}))}domAtPos(e){return c8(this,e)}reuseDOM(e){"DIV"==e.nodeName&&(this.setDOM(e),this.flags|=6)}sync(e,t){var n;this.dom?4&this.flags&&(N5(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),void 0!==this.prevAttrs&&(g8(this.dom,this.prevAttrs,this.attrs),this.dom.classList.add("cm-line"),this.prevAttrs=void 0),super.sync(e,t);let o=this.dom.lastChild;for(;o&&H5.get(o)instanceof l8;)o=o.lastChild;if(!(o&&this.length&&("BR"==o.nodeName||0!=(null===(n=H5.get(o))||void 0===n?void 0:n.isEditable)||r8.ios&&this.children.some((e=>e instanceof i8))))){let e=document.createElement("BR");e.cmIgnore=!0,this.dom.appendChild(e)}}measureTextSize(){if(0==this.children.length||this.length>20)return null;let e,t=0;for(let n of this.children){if(!(n instanceof i8)||/[^ -~]/.test(n.text))return null;let o=$5(n.dom);if(1!=o.length)return null;t+=o[0].width,e=o[0].height}return t?{lineHeight:this.dom.getBoundingClientRect().height,charWidth:t/this.length,textHeight:e}:null}coordsAt(e,t){let n=d8(this,e,t);if(!this.children.length&&n&&this.parent){let{heightOracle:e}=this.parent.view.viewState,t=n.bottom-n.top;if(Math.abs(t-e.lineHeight)<2&&e.textHeight=t){if(r instanceof v8)return r;if(i>t)break}o=i+r.breakAfter}return null}}class b8 extends H5{constructor(e,t,n){super(),this.widget=e,this.length=t,this.deco=n,this.breakAfter=0,this.prevWidget=null}merge(e,t,n,o,r,i){return!(n&&(!(n instanceof b8&&this.widget.compare(n.widget))||e>0&&r<=0||t0)}}class y8{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,n){return null}get isHidden(){return!1}destroy(e){}}var O8=function(e){return e[e.Text=0]="Text",e[e.WidgetBefore=1]="WidgetBefore",e[e.WidgetAfter=2]="WidgetAfter",e[e.WidgetRange=3]="WidgetRange",e}(O8||(O8={}));class w8 extends X4{constructor(e,t,n,o){super(),this.startSide=e,this.endSide=t,this.widget=n,this.spec=o}get heightRelevant(){return!1}static mark(e){return new S8(e)}static widget(e){let t=Math.max(-1e4,Math.min(1e4,e.side||0)),n=!!e.block;return t+=n&&!e.inlineOrder?t>0?3e8:-4e8:t>0?1e8:-1e8,new $8(e,t,t,n,e.widget||null,!1)}static replace(e){let t,n,o=!!e.block;if(e.isBlockGap)t=-5e8,n=4e8;else{let{start:r,end:i}=C8(e,o);t=(r?o?-3e8:-1:5e8)-1,n=1+(i?o?2e8:1:-6e8)}return new $8(e,t,n,o,e.widget||null,!0)}static line(e){return new x8(e)}static set(e,t=!1){return U4.of(e,t)}hasHeight(){return!!this.widget&&this.widget.estimatedHeight>-1}}w8.none=U4.empty;class S8 extends w8{constructor(e){let{start:t,end:n}=C8(e);super(t?-1:5e8,n?1:-6e8,null,e),this.tagName=e.tagName||"span",this.class=e.class||"",this.attrs=e.attributes||null}eq(e){var t,n;return this==e||e instanceof S8&&this.tagName==e.tagName&&(this.class||(null===(t=this.attrs)||void 0===t?void 0:t.class))==(e.class||(null===(n=e.attrs)||void 0===n?void 0:n.class))&&f8(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)}}S8.prototype.point=!1;class x8 extends w8{constructor(e){super(-2e8,-2e8,null,e)}eq(e){return e instanceof x8&&this.spec.class==e.spec.class&&f8(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)}}x8.prototype.mapMode=H3.TrackBefore,x8.prototype.point=!0;class $8 extends w8{constructor(e,t,n,o,r,i){super(t,n,r,e),this.block=o,this.isReplace=i,this.mapMode=o?t<=0?H3.TrackBefore:H3.TrackAfter:H3.TrackDel}get type(){return this.startSide!=this.endSide?O8.WidgetRange:this.startSide<=0?O8.WidgetBefore:O8.WidgetAfter}get heightRelevant(){return this.block||!!this.widget&&(this.widget.estimatedHeight>=5||this.widget.lineBreaks>0)}eq(e){return e instanceof $8&&(t=this.widget,n=e.widget,t==n||!!(t&&n&&t.compare(n)))&&this.block==e.block&&this.startSide==e.startSide&&this.endSide==e.endSide;var t,n}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)}}function C8(e,t=!1){let{inclusiveStart:n,inclusiveEnd:o}=e;return null==n&&(n=e.inclusive),null==o&&(o=e.inclusive),{start:null!=n?n:t,end:null!=o?o:t}}function k8(e,t,n,o=0){let r=n.length-1;r>=0&&n[r]+o>=e?n[r]=Math.max(n[r],t):n.push(e,t)}$8.prototype.point=!0;class P8{constructor(e,t,n,o){this.doc=e,this.pos=t,this.end=n,this.disallowBlockEffectsFor=o,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(0==this.content.length)return!this.breakAtStart&&this.doc.lineAt(this.pos).from!=this.pos;let e=this.content[this.content.length-1];return!(e.breakAfter||e instanceof b8&&e.deco.endSide<0)}getLine(){return this.curLine||(this.content.push(this.curLine=new v8),this.atCursorPos=!0),this.curLine}flushBuffer(e=this.bufferMarks){this.pendingBuffer&&(this.curLine.append(T8(new s8(-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 b8||this.getLine()}buildText(e,t,n){for(;e>0;){if(this.textOff==this.text.length){let{value:t,lineBreak:n,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(n){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}this.text=t,this.textOff=0}let o=Math.min(this.text.length-this.textOff,e,512);this.flushBuffer(t.slice(t.length-n)),this.getLine().append(T8(new i8(this.text.slice(this.textOff,this.textOff+o)),t),n),this.atCursorPos=!0,this.textOff+=o,e-=o,n=0}}span(e,t,n,o){this.buildText(t-e,n,o),this.pos=t,this.openStart<0&&(this.openStart=o)}point(e,t,n,o,r,i){if(this.disallowBlockEffectsFor[i]&&n instanceof $8){if(n.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 l=t-e;if(n instanceof $8)if(n.block)n.startSide>0&&!this.posCovered()&&this.getLine(),this.addBlockWidget(new b8(n.widget||new M8("div"),l,n));else{let i=a8.create(n.widget||new M8("span"),l,l?0:n.startSide),a=this.atCursorPos&&!i.isEditable&&r<=o.length&&(e0),s=!i.isEditable&&(eo.length||n.startSide<=0),c=this.getLine();2!=this.pendingBuffer||a||i.isEditable||(this.pendingBuffer=0),this.flushBuffer(o),a&&(c.append(T8(new s8(1),o),r),r=o.length+Math.max(0,r-o.length)),c.append(T8(i,o),r),this.atCursorPos=s,this.pendingBuffer=s?eo.length?1:2:0,this.pendingBuffer&&(this.bufferMarks=o.slice())}else this.doc.lineAt(this.pos).from==this.pos&&this.getLine().addLineDeco(n);l&&(this.textOff+l<=this.text.length?this.textOff+=l:(this.skip+=l-(this.text.length-this.textOff),this.text="",this.textOff=0),this.pos=t),this.openStart<0&&(this.openStart=r)}static build(e,t,n,o,r){let i=new P8(e,t,n,r);return i.openEnd=U4.spans(o,t,n,i),i.openStart<0&&(i.openStart=i.openEnd),i.finish(i.openEnd),i}}function T8(e,t){for(let n of t)e=new l8(n,[e],e.length);return e}class M8 extends y8{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 I8=t4.define(),E8=t4.define(),A8=t4.define(),D8=t4.define(),R8=t4.define(),z8=t4.define(),B8=t4.define(),j8=t4.define({combine:e=>e.some((e=>e))}),N8=t4.define({combine:e=>e.some((e=>e))});class _8{constructor(e,t="nearest",n="nearest",o=5,r=5,i=!1){this.range=e,this.y=t,this.x=n,this.yMargin=o,this.xMargin=r,this.isSnapshot=i}map(e){return e.empty?this:new _8(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 _8(q3.cursor(e.doc.length),this.y,this.x,this.yMargin,this.xMargin,this.isSnapshot)}}const Q8=E4.define({map:(e,t)=>e.map(t)});function L8(e,t,n){let o=e.facet(D8);o.length?o[0](t):window.onerror&&window.onerror(String(t),n,void 0,void 0,t)}const H8=t4.define({combine:e=>!e.length||e[0]});let F8=0;const W8=t4.define();class X8{constructor(e,t,n,o,r){this.id=e,this.create=t,this.domEventHandlers=n,this.domEventObservers=o,this.extension=r(this)}static define(e,t){const{eventHandlers:n,eventObservers:o,provide:r,decorations:i}=t||{};return new X8(F8++,e,n,o,(e=>{let t=[W8.of(e)];return i&&t.push(U8.of((t=>{let n=t.plugin(e);return n?i(n):w8.none}))),r&&t.push(r(e)),t}))}static fromClass(e,t){return X8.define((t=>new e(t)),t)}}class Y8{constructor(e){this.spec=e,this.mustUpdate=null,this.value=null}update(e){if(this.value){if(this.mustUpdate){let e=this.mustUpdate;if(this.mustUpdate=null,this.value.update)try{this.value.update(e)}catch(Fpe){if(L8(e.state,Fpe,"CodeMirror plugin crashed"),this.value.destroy)try{this.value.destroy()}catch(Wpe){}this.deactivate()}}}else if(this.spec)try{this.value=this.spec.create(e)}catch(Fpe){L8(e.state,Fpe,"CodeMirror plugin crashed"),this.deactivate()}return this}destroy(e){var t;if(null===(t=this.value)||void 0===t?void 0:t.destroy)try{this.value.destroy()}catch(Fpe){L8(e.state,Fpe,"CodeMirror plugin crashed")}}deactivate(){this.spec=this.value=null}}const V8=t4.define(),Z8=t4.define(),U8=t4.define(),K8=t4.define(),G8=t4.define();function q8(e,t,n){let o=e.state.facet(G8);if(!o.length)return o;let r=o.map((t=>t instanceof Function?t(e):t)),i=[];return U4.spans(r,t,n,{point(){},span(e,t,n,o){let r=i;for(let i=n.length-1;i>=0;i--,o--){let l,a=n[i].spec.bidiIsolate;if(null!=a)if(o>0&&r.length&&(l=r[r.length-1]).to==e&&l.direction==a)l.to=t,r=l.inner;else{let n={from:e,to:t,direction:a,inner:[]};r.push(n),r=n.inner}}}}),i}const J8=t4.define();function e6(e){let t=0,n=0,o=0,r=0;for(let i of e.state.facet(J8)){let l=i(e);l&&(null!=l.left&&(t=Math.max(t,l.left)),null!=l.right&&(n=Math.max(n,l.right)),null!=l.top&&(o=Math.max(o,l.top)),null!=l.bottom&&(r=Math.max(r,l.bottom)))}return{left:t,right:n,top:o,bottom:r}}const t6=t4.define();class n6{constructor(e,t,n,o){this.fromA=e,this.toA=t,this.fromB=n,this.toB=o}join(e){return new n6(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,n=this;for(;t>0;t--){let o=e[t-1];if(!(o.fromA>n.toA)){if(o.toAc)break;r+=2}if(!a)return n;new n6(a.fromA,a.toA,a.fromB,a.toB).addToSet(n),i=a.toA,l=a.toB}}}class o6{constructor(e,t,n){this.view=e,this.state=t,this.transactions=n,this.flags=0,this.startState=e.state,this.changes=W3.empty(this.startState.doc.length);for(let r of n)this.changes=this.changes.compose(r.changes);let o=[];this.changes.iterChangedRanges(((e,t,n,r)=>o.push(new n6(e,t,n,r)))),this.changedRanges=o}static create(e,t,n){return new o6(e,t,n)}get viewportChanged(){return(4&this.flags)>0}get heightChanged(){return(2&this.flags)>0}get geometryChanged(){return this.docChanged||(10&this.flags)>0}get focusChanged(){return(1&this.flags)>0}get docChanged(){return!this.changes.empty}get selectionSet(){return this.transactions.some((e=>e.selection))}get empty(){return 0==this.flags&&0==this.transactions.length}}var r6=function(e){return e[e.LTR=0]="LTR",e[e.RTL=1]="RTL",e}(r6||(r6={}));const i6=r6.LTR,l6=r6.RTL;function a6(e){let t=[];for(let n=0;n=t){if(l.level==n)return i;(r<0||(0!=o?o<0?l.fromt:e[r].level>l.level))&&(r=i)}}if(r<0)throw new RangeError("Index out of range");return r}}function f6(e,t){if(e.length!=t.length)return!1;for(let n=0;ns&&l.push(new h6(s,f.from,p)),v6(e,f.direction==i6!=!(p%2)?o+1:o,r,f.inner,f.from,f.to,l),s=f.to),h=f.to}else{if(h==n||(t?g6[h]!=a:g6[h]==a))break;h++}d?m6(e,s,h,o+1,r,d,l):st;){let n=!0,u=!1;if(!c||s>i[c-1].to){let e=g6[s-1];e!=a&&(n=!1,u=16==e)}let d=n||1!=a?null:[],p=n?o:o+1,h=s;e:for(;;)if(c&&h==i[c-1].to){if(u)break e;let f=i[--c];if(!n)for(let e=f.from,n=c;;){if(e==t)break e;if(!n||i[n-1].to!=e){if(g6[e-1]==a)break e;break}e=i[--n].from}d?d.push(f):(f.to=0;e-=3)if(d6[e+1]==-n){let t=d6[e+2],n=2&t?r:4&t?1&t?i:r:0;n&&(g6[l]=g6[d6[e]]=n),a=e;break}}else{if(189==d6.length)break;d6[a++]=l,d6[a++]=t,d6[a++]=s}else if(2==(o=g6[l])||1==o){let e=o==r;s=e?0:1;for(let t=a-3;t>=0;t-=3){let n=d6[t+2];if(2&n)break;if(e)d6[t+2]|=2;else{if(4&n)break;d6[t+2]|=4}}}}}(e,r,i,o,a),function(e,t,n,o){for(let r=0,i=o;r<=n.length;r++){let l=r?n[r-1].to:e,a=rs;)t==i&&(t=n[--o].from,i=o?n[o-1].to:e),g6[--t]=u;s=l}else i=l,s++}}}(r,i,o,a),m6(e,r,i,t,n,o,l)}function b6(e){return[new h6(0,e,0)]}let y6="";function O6(e,t,n,o,r){var i;let l=o.head-e.from,a=-1;if(0==l){if(!r||!e.length)return null;t[0].level!=n&&(l=t[0].side(!1,n),a=0)}else if(l==e.length){if(r)return null;let e=t[t.length-1];e.level!=n&&(l=e.side(!0,n),a=t.length-1)}a<0&&(a=h6.find(t,l,null!==(i=o.bidiLevel)&&void 0!==i?i:-1,o.assoc));let s=t[a];l==s.side(r,n)&&(s=t[a+=r?1:-1],l=s.side(!r,n));let c=r==(s.dir==n),u=D3(e.text,l,c);if(y6=e.text.slice(Math.min(l,u),Math.max(l,u)),u>s.from&&u0&&n.length&&(n.every((({fromA:e,toA:t})=>tthis.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 o=-1;this.view.inputState.composing>=0&&((null===(t=this.domChanged)||void 0===t?void 0:t.newSel)?o=this.domChanged.newSel.head:function(e,t){let n=!1;return t&&e.iterChangedRanges(((e,o)=>{et.from&&(n=!0)})),n}(e.changes,this.hasComposition)||e.selectionSet||(o=e.state.selection.main.head));let r=o>-1?function(e,t,n){let o=x6(e,n);if(!o)return null;let{node:r,from:i,to:l}=o,a=r.nodeValue;if(/[\n\r]/.test(a))return null;if(e.state.doc.sliceString(o.from,o.to)!=a)return null;let s=t.invertedDesc,c=new n6(s.mapPos(i),s.mapPos(l),i,l),u=[];for(let d=r.parentNode;;d=d.parentNode){let t=H5.get(d);if(t instanceof l8)u.push({node:d,deco:t.mark});else{if(t instanceof v8||"DIV"==d.nodeName&&d.parentNode==e.contentDOM)return{range:c,text:r,marks:u,line:d};if(d==e.contentDOM)return null;u.push({node:d,deco:new S8({inclusive:!0,attributes:m8(d),tagName:d.tagName.toLowerCase()})})}}}(this.view,e.changes,o):null;if(this.domChanged=null,this.hasComposition){this.markedForComposition.clear();let{from:t,to:o}=this.hasComposition;n=new n6(t,o,e.changes.mapPos(t,-1),e.changes.mapPos(o,1)).addToSet(n.slice())}this.hasComposition=r?{from:r.range.fromB,to:r.range.toB}:null,(r8.ie||r8.chrome)&&!r&&e&&e.state.doc.lines!=e.startState.doc.lines&&(this.forceSelection=!0);let i=function(e,t,n){let o=new C6;return U4.compare(e,t,n,o),o.changes}(this.decorations,this.updateDeco(),e.changes);return n=n6.extendWithRanges(n,i),!!(7&this.flags||0!=n.length)&&(this.updateInner(n,e.startState.doc.length,r),e.transactions.length&&(this.lastUpdate=Date.now()),!0)}updateInner(e,t,n){this.view.viewState.mustMeasureContent=!0,this.updateChildren(e,t,n);let{observer:o}=this.view;o.ignore((()=>{this.dom.style.height=this.view.viewState.contentHeight/this.view.scaleY+"px",this.dom.style.flexBasis=this.minWidth?this.minWidth+"px":"";let e=r8.chrome||r8.ios?{node:o.selectionRange.focusNode,written:!1}:void 0;this.sync(this.view,e),this.flags&=-8,e&&(e.written||o.selectionRange.focusNode!=e.node)&&(this.forceSelection=!0),this.dom.style.height=""})),this.markedForComposition.forEach((e=>e.flags&=-9));let r=[];if(this.view.viewport.from||this.view.viewport.to=0?o[i]:null;if(!e)break;let t,l,a,s,{fromA:c,toA:u,fromB:d,toB:p}=e;if(n&&n.range.fromBd){let e=P8.build(this.view.state.doc,d,n.range.fromB,this.decorations,this.dynamicDecorationMap),o=P8.build(this.view.state.doc,n.range.toB,p,this.decorations,this.dynamicDecorationMap);l=e.breakAtStart,a=e.openStart,s=o.openEnd;let r=this.compositionView(n);o.breakAtStart?r.breakAfter=1:o.content.length&&r.merge(r.length,r.length,o.content[0],!1,o.openStart,0)&&(r.breakAfter=o.content[0].breakAfter,o.content.shift()),e.content.length&&r.merge(0,0,e.content[e.content.length-1],!0,0,e.openEnd)&&e.content.pop(),t=e.content.concat(r).concat(o.content)}else({content:t,breakAtStart:l,openStart:a,openEnd:s}=P8.build(this.view.state.doc,d,p,this.decorations,this.dynamicDecorationMap));let{i:h,off:f}=r.findPos(u,1),{i:g,off:m}=r.findPos(c,-1);X5(this,g,m,h,f,t,l,a,s)}n&&this.fixCompositionDOM(n)}compositionView(e){let t=new i8(e.text.nodeValue);t.flags|=8;for(let{deco:o}of e.marks)t=new l8(o,[t],t.length);let n=new v8;return n.append(t,0),n}fixCompositionDOM(e){let t=(e,t)=>{t.flags|=8|(t.children.some((e=>7&e.flags))?1:0),this.markedForComposition.add(t);let n=H5.get(e);n&&n!=t&&(n.dom=null),t.setDOM(e)},n=this.childPos(e.range.fromB,1),o=this.children[n.i];t(e.line,o);for(let r=e.marks.length-1;r>=-1;r--)n=o.childPos(n.off,1),o=o.children[n.i],t(r>=0?e.marks[r].node:e.text,o)}updateSelection(e=!1,t=!1){!e&&this.view.observer.selectionRange.focusNode||this.view.observer.readSelectionRange();let n=this.view.root.activeElement,o=n==this.dom,r=!o&&x5(this.dom,this.view.observer.selectionRange)&&!(n&&this.dom.contains(n));if(!(o||t||r))return;let i=this.forceSelection;this.forceSelection=!1;let l=this.view.state.selection.main,a=this.moveToLine(this.domAtPos(l.anchor)),s=l.empty?a:this.moveToLine(this.domAtPos(l.head));if(r8.gecko&&l.empty&&!this.hasComposition&&1==(c=a).node.nodeType&&c.node.firstChild&&(0==c.offset||"false"==c.node.childNodes[c.offset-1].contentEditable)&&(c.offset==c.node.childNodes.length||"false"==c.node.childNodes[c.offset].contentEditable)){let e=document.createTextNode("");this.view.observer.ignore((()=>a.node.insertBefore(e,a.node.childNodes[a.offset]||null))),a=s=new Q5(e,0),i=!0}var c;let u=this.view.observer.selectionRange;!i&&u.focusNode&&C5(a.node,a.offset,u.anchorNode,u.anchorOffset)&&C5(s.node,s.offset,u.focusNode,u.focusOffset)||(this.view.observer.ignore((()=>{r8.android&&r8.chrome&&this.dom.contains(u.focusNode)&&function(e,t){for(let n=e;n&&n!=t;n=n.assignedSlot||n.parentNode)if(1==n.nodeType&&"false"==n.contentEditable)return!0;return!1}(u.focusNode,this.dom)&&(this.dom.blur(),this.dom.focus({preventScroll:!0}));let e=w5(this.view.root);if(e)if(l.empty){if(r8.gecko){let e=(t=a.node,o=a.offset,1!=t.nodeType?0:(o&&"false"==t.childNodes[o-1].contentEditable?1:0)|(ol.head&&([a,s]=[s,a]),t.setEnd(s.node,s.offset),t.setStart(a.node,a.offset),e.removeAllRanges(),e.addRange(t)}var t,o;r&&this.view.root.activeElement==this.dom&&(this.dom.blur(),n&&n.focus())})),this.view.observer.setSelectionRange(a,s)),this.impreciseAnchor=a.precise?null:new Q5(u.anchorNode,u.anchorOffset),this.impreciseHead=s.precise?null:new Q5(u.focusNode,u.focusOffset)}enforceCursorAssoc(){if(this.hasComposition)return;let{view:e}=this,t=e.state.selection.main,n=w5(e.root),{anchorNode:o,anchorOffset:r}=e.observer.selectionRange;if(!(n&&t.empty&&t.assoc&&n.modify))return;let i=v8.find(this,t.head);if(!i)return;let l=i.posAtStart;if(t.head==l||t.head==l+i.length)return;let a=this.coordsAt(t.head,-1),s=this.coordsAt(t.head,1);if(!a||!s||a.bottom>s.top)return;let c=this.domAtPos(t.head+t.assoc);n.collapse(c.node,c.offset),n.modify("move",t.assoc<0?"forward":"backward","lineboundary"),e.observer.readSelectionRange();let u=e.observer.selectionRange;e.docView.posFromDOM(u.anchorNode,u.anchorOffset)!=t.from&&n.collapse(o,r)}moveToLine(e){let t,n=this.dom;if(e.node!=n)return e;for(let o=e.offset;!t&&o=0;o--){let e=H5.get(n.childNodes[o]);e instanceof v8&&(t=e.domAtPos(e.length))}return t?new Q5(t.node,t.offset,!0):e}nearest(e){for(let t=e;t;){let e=H5.get(t);if(e&&e.rootView==this)return e;t=t.parentNode}return null}posFromDOM(e,t){let n=this.nearest(e);if(!n)throw new RangeError("Trying to find position for a DOM position outside of the document");return n.localPosFromDOM(e,t)+n.posAtStart}domAtPos(e){let{i:t,off:n}=this.childCursor().findPos(e,-1);for(;t=0;i--){let l=this.children[i],a=r-l.breakAfter,s=a-l.length;if(ae||l.covers(1))&&(!n||l instanceof v8&&!(n instanceof v8&&t>=0))&&(n=l,o=s),r=s}return n?n.coordsAt(e-o,t):null}coordsForChar(e){let{i:t,off:n}=this.childPos(e,1),o=this.children[t];if(!(o instanceof v8))return null;for(;o.children.length;){let{i:e,off:t}=o.childPos(n,1);for(;;e++){if(e==o.children.length)return null;if((o=o.children[e]).length)break}n=t}if(!(o instanceof i8))return null;let r=D3(o.text,n);if(r==n)return null;let i=B5(o.dom,n,r).getClientRects();for(let l=0;lMath.max(this.view.scrollDOM.clientWidth,this.minWidth)+1,l=-1,a=this.view.textDirection==r6.LTR;for(let s=0,c=0;co)break;if(s>=n){let n=e.dom.getBoundingClientRect();if(t.push(n.height),i){let t=e.dom.lastChild,o=t?$5(t):[];if(o.length){let e=o[o.length-1],t=a?e.right-n.left:n.right-e.left;t>l&&(l=t,this.minWidth=r,this.minWidthFrom=s,this.minWidthTo=u)}}}s=u+e.breakAfter}return t}textDirectionAt(e){let{i:t}=this.childPos(e,1);return"rtl"==getComputedStyle(this.children[t].dom).direction?r6.RTL:r6.LTR}measureTextSize(){for(let r of this.children)if(r instanceof v8){let e=r.measureTextSize();if(e)return e}let e,t,n,o=document.createElement("div");return o.className="cm-line",o.style.width="99999px",o.style.position="absolute",o.textContent="abc def ghi jkl mno pqr stu",this.view.observer.ignore((()=>{this.dom.appendChild(o);let r=$5(o.firstChild)[0];e=o.getBoundingClientRect().height,t=r?r.width/27:7,n=r?r.height:e,o.remove()})),{lineHeight:e,charWidth:t,textHeight:n}}childCursor(e=this.length){let t=this.children.length;return t&&(e-=this.children[--t].length),new W5(this.children,e,t)}computeBlockGapDeco(){let e=[],t=this.view.viewState;for(let n=0,o=0;;o++){let r=o==t.viewports.length?null:t.viewports[o],i=r?r.from-1:this.length;if(i>n){let o=(t.lineBlockAt(i).bottom-t.lineBlockAt(n).top)/this.view.scaleY;e.push(w8.replace({widget:new S6(o),block:!0,inclusive:!0,isBlockGap:!0}).range(n,i))}if(!r)break;n=r.to+1}return w8.set(e)}updateDeco(){let e=this.view.state.facet(U8).map(((e,t)=>(this.dynamicDecorationMap[t]="function"==typeof e)?e(this.view):e));for(let t=e.length;tn.anchor?-1:1);if(!o)return;!n.empty&&(t=this.coordsAt(n.anchor,n.anchor>n.head?-1:1))&&(o={left:Math.min(o.left,t.left),top:Math.min(o.top,t.top),right:Math.max(o.right,t.right),bottom:Math.max(o.bottom,t.bottom)});let r=e6(this.view),i={left:o.left-r.left,top:o.top-r.top,right:o.right+r.right,bottom:o.bottom+r.bottom},{offsetWidth:l,offsetHeight:a}=this.view.scrollDOM;!function(e,t,n,o,r,i,l,a){let s=e.ownerDocument,c=s.defaultView||window;for(let u=e,d=!1;u&&!d;)if(1==u.nodeType){let e,p=u==s.body,h=1,f=1;if(p)e=I5(c);else{if(/^(fixed|sticky)$/.test(getComputedStyle(u).position)&&(d=!0),u.scrollHeight<=u.clientHeight&&u.scrollWidth<=u.clientWidth){u=u.assignedSlot||u.parentNode;continue}let t=u.getBoundingClientRect();({scaleX:h,scaleY:f}=E5(u,t)),e={left:t.left,right:t.left+u.clientWidth*h,top:t.top,bottom:t.top+u.clientHeight*f}}let g=0,m=0;if("nearest"==r)t.top0&&t.bottom>e.bottom+m&&(m=t.bottom-e.bottom+m+l)):t.bottom>e.bottom&&(m=t.bottom-e.bottom+l,n<0&&t.top-m0&&t.right>e.right+g&&(g=t.right-e.right+g+i)):t.right>e.right&&(g=t.right-e.right+i,n<0&&t.left0))break;o=o.childNodes[r-1],r=T5(o)}if(n>=0)for(let o=e,r=t;;){if(3==o.nodeType)return{node:o,offset:r};if(!(1==o.nodeType&&r=0))break;o=o.childNodes[r],r=0}return null}let C6=class{constructor(){this.changes=[]}compareRange(e,t){k8(e,t,this.changes)}comparePoint(e,t){k8(e,t,this.changes)}};function k6(e,t){return t.left>e?t.left-e:Math.max(0,e-t.right)}function P6(e,t){return t.top>e?t.top-e:Math.max(0,e-t.bottom)}function T6(e,t){return e.topt.top+1}function M6(e,t){return te.bottom?{top:e.top,left:e.left,right:e.right,bottom:t}:e}function E6(e,t,n){let o,r,i,l,a,s,c,u,d=!1;for(let h=e.firstChild;h;h=h.nextSibling){let e=$5(h);for(let p=0;pm||l==m&&i>g){o=h,r=f,i=g,l=m;let a=m?n0?p0)}0==g?n>f.bottom&&(!c||c.bottomf.top)&&(s=h,u=f):c&&T6(c,f)?c=I6(c,f.bottom):u&&T6(u,f)&&(u=M6(u,f.top))}}if(c&&c.bottom>=n?(o=a,r=c):u&&u.top<=n&&(o=s,r=u),!o)return{node:e,offset:0};let p=Math.max(r.left,Math.min(r.right,t));return 3==o.nodeType?A6(o,p,n):d&&"false"!=o.contentEditable?E6(o,p,n):{node:e,offset:Array.prototype.indexOf.call(e.childNodes,o)+(t>=(r.left+r.right)/2?1:0)}}function A6(e,t,n){let o=e.nodeValue.length,r=-1,i=1e9,l=0;for(let a=0;an?c.top-n:n-c.bottom)-1;if(c.left-1<=t&&c.right+1>=t&&u=(c.left+c.right)/2,o=n;if((r8.chrome||r8.gecko)&&B5(e,a).getBoundingClientRect().left==c.right&&(o=!n),u<=0)return{node:e,offset:a+(o?1:0)};r=a+(o?1:0),i=u}}}return{node:e,offset:r>-1?r:l>0?e.nodeValue.length:0}}function D6(e,t,n,o=-1){var r,i;let l,a=e.contentDOM.getBoundingClientRect(),s=a.top+e.viewState.paddingTop,{docHeight:c}=e.viewState,{x:u,y:d}=t,p=d-s;if(p<0)return 0;if(p>c)return e.state.doc.length;for(let O=e.viewState.heightOracle.textHeight/2,w=!1;l=e.elementAtHeight(p),l.type!=O8.Text;)for(;p=o>0?l.bottom+O:l.top-O,!(p>=0&&p<=c);){if(w)return n?null:0;w=!0,o=-o}d=s+p;let h=l.from;if(he.viewport.to)return e.viewport.to==e.state.doc.length?e.state.doc.length:n?null:R6(e,a,l,u,d);let f=e.dom.ownerDocument,g=e.root.elementFromPoint?e.root:f,m=g.elementFromPoint(u,d);m&&!e.contentDOM.contains(m)&&(m=null),m||(u=Math.max(a.left+1,Math.min(a.right-1,u)),m=g.elementFromPoint(u,d),m&&!e.contentDOM.contains(m)&&(m=null));let v,b=-1;if(m&&0!=(null===(r=e.docView.nearest(m))||void 0===r?void 0:r.isEditable))if(f.caretPositionFromPoint){let e=f.caretPositionFromPoint(u,d);e&&({offsetNode:v,offset:b}=e)}else if(f.caretRangeFromPoint){let t=f.caretRangeFromPoint(u,d);t&&(({startContainer:v,startOffset:b}=t),(!e.contentDOM.contains(v)||r8.safari&&function(e,t,n){let o;if(3!=e.nodeType||t!=(o=e.nodeValue.length))return!1;for(let r=e.nextSibling;r;r=r.nextSibling)if(1!=r.nodeType||"BR"!=r.nodeName)return!1;return B5(e,o-1,o).getBoundingClientRect().left>n}(v,b,u)||r8.chrome&&function(e,t,n){if(0!=t)return!1;for(let r=e;;){let e=r.parentNode;if(!e||1!=e.nodeType||e.firstChild!=r)return!1;if(e.classList.contains("cm-line"))break;r=e}let o=1==e.nodeType?e.getBoundingClientRect():B5(e,0,Math.max(e.nodeValue.length,1)).getBoundingClientRect();return n-o.left>5}(v,b,u))&&(v=void 0))}if(!v||!e.docView.dom.contains(v)){let t=v8.find(e.docView,h);if(!t)return p>l.top+l.height/2?l.to:l.from;({node:v,offset:b}=E6(t.dom,u,d))}let y=e.docView.nearest(v);if(!y)return null;if(y.isWidget&&1==(null===(i=y.dom)||void 0===i?void 0:i.nodeType)){let e=y.dom.getBoundingClientRect();return t.y1.5*e.defaultLineHeight){let t=e.viewState.heightOracle.textHeight;i+=Math.floor((r-n.top-.5*(e.defaultLineHeight-t))/t)*e.viewState.heightOracle.lineLength}let l=e.state.sliceDoc(n.from,n.to);return n.from+s5(l,i,e.state.tabSize)}function z6(e,t){let n=e.lineBlockAt(t);if(Array.isArray(n.type))for(let o of n.type)if(o.to>t||o.to==t&&(o.to==n.to||o.type==O8.Text))return o;return n}function B6(e,t,n,o){let r=e.state.doc.lineAt(t.head),i=e.bidiSpans(r),l=e.textDirectionAt(r.from);for(let a=t,s=null;;){let t=O6(r,i,l,a,n),c=y6;if(!t){if(r.number==(n?e.state.doc.lines:1))return a;c="\n",r=e.state.doc.line(r.number+(n?1:-1)),i=e.bidiSpans(r),t=q3.cursor(n?r.from:r.to)}if(s){if(!s(c))return a}else{if(!o)return t;s=o(c)}a=t}}function j6(e,t,n){for(;;){let o=0;for(let r of e)r.between(t-1,t+1,((e,r,i)=>{if(t>e&&tt(e))),n.from,t.head>n.from?-1:1);return o==n.from?n:q3.cursor(o,onull)),r8.gecko&&(t=e.contentDOM.ownerDocument,d7.has(t)||(d7.add(t),t.addEventListener("copy",(()=>{})),t.addEventListener("cut",(()=>{}))))}handleEvent(e){(function(e,t){if(!t.bubbles)return!0;if(t.defaultPrevented)return!1;for(let n,o=t.target;o!=e.contentDOM;o=o.parentNode)if(!o||11==o.nodeType||(n=H5.get(o))&&n.ignoreEvent(t))return!1;return!0})(this.view,e)&&!this.ignoreDuringComposition(e)&&("keydown"==e.type&&this.keydown(e)||this.runHandlers(e.type,e))}runHandlers(e,t){let n=this.handlers[e];if(n){for(let e of n.observers)e(this.view,t);for(let e of n.handlers){if(t.defaultPrevented)break;if(e(this.view,t)){t.preventDefault();break}}}}ensureHandlers(e){let t=function(e){let t=Object.create(null);function n(e){return t[e]||(t[e]={observers:[],handlers:[]})}for(let o of e){let e=o.spec;if(e&&e.domEventHandlers)for(let t in e.domEventHandlers){let r=e.domEventHandlers[t];r&&n(t).handlers.push(Q6(o.value,r))}if(e&&e.domEventObservers)for(let t in e.domEventObservers){let r=e.domEventObservers[t];r&&n(t).observers.push(Q6(o.value,r))}}for(let o in Y6)n(o).handlers.push(Y6[o]);for(let o in V6)n(o).observers.push(V6[o]);return t}(e),n=this.handlers,o=this.view.contentDOM;for(let r in t)if("scroll"!=r){let e=!t[r].handlers.length,i=n[r];i&&e!=!i.handlers.length&&(o.removeEventListener(r,this.handleEvent),i=null),i||o.addEventListener(r,this.handleEvent,{passive:e})}for(let r in n)"scroll"==r||t[r]||o.removeEventListener(r,this.handleEvent);this.handlers=t}keydown(e){if(this.lastKeyCode=e.keyCode,this.lastKeyTime=Date.now(),9==e.keyCode&&Date.now()t.keyCode==e.keyCode)))&&!e.ctrlKey||H6.indexOf(e.key)>-1&&e.ctrlKey&&!e.shiftKey)?(229!=e.keyCode&&this.view.observer.forceFlush(),!1):(this.pendingIOSKey=t||e,setTimeout((()=>this.flushIOSKey()),250),!0)}flushIOSKey(){let e=this.pendingIOSKey;return!!e&&(this.pendingIOSKey=void 0,j5(this.view.contentDOM,e.key,e.keyCode))}ignoreDuringComposition(e){return!!/^key/.test(e.type)&&(this.composing>0||!!(r8.safari&&!r8.ios&&this.compositionPendingKey&&Date.now()-this.compositionEndedAt<100)&&(this.compositionPendingKey=!1,!0))}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 Q6(e,t){return(n,o)=>{try{return t.call(e,o,n)}catch(Fpe){L8(n.state,Fpe)}}}const L6=[{key:"Backspace",keyCode:8,inputType:"deleteContentBackward"},{key:"Enter",keyCode:13,inputType:"insertParagraph"},{key:"Enter",keyCode:13,inputType:"insertLineBreak"},{key:"Delete",keyCode:46,inputType:"deleteContentForward"}],H6="dthko",F6=[16,17,18,20,91,92,224,225];function W6(e){return.7*Math.max(0,e)+8}class X6{constructor(e,t,n,o){this.view=e,this.startEvent=t,this.style=n,this.mustSelect=o,this.scrollSpeed={x:0,y:0},this.scrolling=-1,this.lastEvent=t,this.scrollParent=function(e){let t=e.ownerDocument;for(let n=e.parentNode;n&&n!=t.body;)if(1==n.nodeType){if(n.scrollHeight>n.clientHeight||n.scrollWidth>n.clientWidth)return n;n=n.assignedSlot||n.parentNode}else{if(11!=n.nodeType)break;n=n.host}return null}(e.contentDOM),this.atoms=e.state.facet(K8).map((t=>t(e)));let r=e.contentDOM.ownerDocument;r.addEventListener("mousemove",this.move=this.move.bind(this)),r.addEventListener("mouseup",this.up=this.up.bind(this)),this.extend=t.shiftKey,this.multiple=e.state.facet(F4.allowMultipleSelections)&&function(e,t){let n=e.state.facet(I8);return n.length?n[0](t):r8.mac?t.metaKey:t.ctrlKey}(e,t),this.dragging=!(!function(e,t){let{main:n}=e.state.selection;if(n.empty)return!1;let o=w5(e.root);if(!o||0==o.rangeCount)return!0;let r=o.getRangeAt(0).getClientRects();for(let i=0;i=t.clientX&&e.top<=t.clientY&&e.bottom>=t.clientY)return!0}return!1}(e,t)||1!=i7(t))&&null}start(e){!1===this.dragging&&this.select(e)}move(e){var t,n,o;if(0==e.buttons)return this.destroy();if(this.dragging||null==this.dragging&&(n=this.startEvent,o=e,Math.max(Math.abs(n.clientX-o.clientX),Math.abs(n.clientY-o.clientY))<10))return;this.select(this.lastEvent=e);let r=0,i=0,l=(null===(t=this.scrollParent)||void 0===t?void 0:t.getBoundingClientRect())||{left:0,top:0,right:this.view.win.innerWidth,bottom:this.view.win.innerHeight},a=e6(this.view);e.clientX-a.left<=l.left+6?r=-W6(l.left-e.clientX):e.clientX+a.right>=l.right-6&&(r=W6(e.clientX-l.right)),e.clientY-a.top<=l.top+6?i=-W6(l.top-e.clientY):e.clientY+a.bottom>=l.bottom-6&&(i=W6(e.clientY-l.bottom)),this.setScrollSpeed(r,i)}up(e){null==this.dragging&&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),!1===this.dragging&&this.select(this.lastEvent)}skipAtoms(e){let t=null;for(let n=0;nthis.select(this.lastEvent)),20)}}const Y6=Object.create(null),V6=Object.create(null),Z6=r8.ie&&r8.ie_version<15||r8.ios&&r8.webkit_version<604;function U6(e,t){let n,{state:o}=e,r=1,i=o.toText(t),l=i.lines==o.selection.ranges.length;if(null!=a7&&o.selection.ranges.every((e=>e.empty))&&a7==i.toString()){let e=-1;n=o.changeByRange((n=>{let a=o.doc.lineAt(n.from);if(a.from==e)return{range:n};e=a.from;let s=o.toText((l?i.line(r++).text:t)+o.lineBreak);return{changes:{from:a.from,insert:s},range:q3.cursor(n.from+s.length)}}))}else n=l?o.changeByRange((e=>{let t=i.line(r++);return{changes:{from:e.from,to:e.to,insert:t.text},range:q3.cursor(e.from+t.length)}})):o.replaceSelection(i);e.dispatch(n,{userEvent:"input.paste",scrollIntoView:!0})}function K6(e,t,n,o){if(1==o)return q3.cursor(t,n);if(2==o)return function(e,t,n=1){let o=e.charCategorizer(t),r=e.doc.lineAt(t),i=t-r.from;if(0==r.length)return q3.cursor(t);0==i?n=1:i==r.length&&(n=-1);let l=i,a=i;n<0?l=D3(r.text,i,!1):a=D3(r.text,i);let s=o(r.text.slice(l,a));for(;l>0;){let e=D3(r.text,l,!1);if(o(r.text.slice(e,l))!=s)break;l=e}for(;a{e.inputState.lastScrollTop=e.scrollDOM.scrollTop,e.inputState.lastScrollLeft=e.scrollDOM.scrollLeft},Y6.keydown=(e,t)=>(e.inputState.setSelectionOrigin("select"),27==t.keyCode&&(e.inputState.lastEscPress=Date.now()),!1),V6.touchstart=(e,t)=>{e.inputState.lastTouchTime=Date.now(),e.inputState.setSelectionOrigin("select.pointer")},V6.touchmove=e=>{e.inputState.setSelectionOrigin("select.pointer")},Y6.mousedown=(e,t)=>{if(e.observer.flush(),e.inputState.lastTouchTime>Date.now()-2e3)return!1;let n=null;for(let o of e.state.facet(A8))if(n=o(e,t),n)break;if(n||0!=t.button||(n=function(e,t){let n=e7(e,t),o=i7(t),r=e.state.selection;return{update(e){e.docChanged&&(n.pos=e.changes.mapPos(n.pos),r=r.map(e.changes))},get(t,i,l){let a,s=e7(e,t),c=K6(e,s.pos,s.bias,o);if(n.pos!=s.pos&&!i){let t=K6(e,n.pos,n.bias,o),r=Math.min(t.from,c.from),i=Math.max(t.to,c.to);c=r1&&(a=function(e,t){for(let n=0;n=t)return q3.create(e.ranges.slice(0,n).concat(e.ranges.slice(n+1)),e.mainIndex==n?0:e.mainIndex-(e.mainIndex>n?1:0))}return null}(r,s.pos))?a:l?r.addRange(c):q3.create([c])}}}(e,t)),n){let o=!e.hasFocus;e.inputState.startMouseSelection(new X6(e,t,n,o)),o&&e.observer.ignore((()=>z5(e.contentDOM)));let r=e.inputState.mouseSelection;if(r)return r.start(t),!1===r.dragging}return!1};let G6=(e,t)=>e>=t.top&&e<=t.bottom,q6=(e,t,n)=>G6(t,n)&&e>=n.left&&e<=n.right;function J6(e,t,n,o){let r=v8.find(e.docView,t);if(!r)return 1;let i=t-r.posAtStart;if(0==i)return 1;if(i==r.length)return-1;let l=r.coordsAt(i,-1);if(l&&q6(n,o,l))return-1;let a=r.coordsAt(i,1);return a&&q6(n,o,a)?1:l&&G6(o,l)?-1:1}function e7(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1);return{pos:n,bias:J6(e,n,t.clientX,t.clientY)}}const t7=r8.ie&&r8.ie_version<=11;let n7=null,o7=0,r7=0;function i7(e){if(!t7)return e.detail;let t=n7,n=r7;return n7=e,r7=Date.now(),o7=!t||n>Date.now()-400&&Math.abs(t.clientX-e.clientX)<2&&Math.abs(t.clientY-e.clientY)<2?(o7+1)%3:1}function l7(e,t,n,o){if(!n)return;let r=e.posAtCoords({x:t.clientX,y:t.clientY},!1),{draggedContent:i}=e.inputState,l=o&&i&&function(e,t){let n=e.state.facet(E8);return n.length?n[0](t):r8.mac?!t.altKey:!t.ctrlKey}(e,t)?{from:i.from,to:i.to}:null,a={from:r,insert:n},s=e.state.changes(l?[l,a]:a);e.focus(),e.dispatch({changes:s,selection:{anchor:s.mapPos(r,-1),head:s.mapPos(r,1)},userEvent:l?"move.drop":"input.drop"}),e.inputState.draggedContent=null}Y6.dragstart=(e,t)=>{let{selection:{main:n}}=e.state;if(t.target.draggable){let o=e.docView.nearest(t.target);if(o&&o.isWidget){let e=o.posAtStart,t=e+o.length;(e>=n.to||t<=n.from)&&(n=q3.range(e,t))}}let{inputState:o}=e;return o.mouseSelection&&(o.mouseSelection.dragging=!0),o.draggedContent=n,t.dataTransfer&&(t.dataTransfer.setData("Text",e.state.sliceDoc(n.from,n.to)),t.dataTransfer.effectAllowed="copyMove"),!1},Y6.dragend=e=>(e.inputState.draggedContent=null,!1),Y6.drop=(e,t)=>{if(!t.dataTransfer)return!1;if(e.state.readOnly)return!0;let n=t.dataTransfer.files;if(n&&n.length){let o=Array(n.length),r=0,i=()=>{++r==n.length&&l7(e,t,o.filter((e=>null!=e)).join(e.state.lineBreak),!1)};for(let e=0;e{/[\x00-\x08\x0e-\x1f]{2}/.test(t.result)||(o[e]=t.result),i()},t.readAsText(n[e])}return!0}{let n=t.dataTransfer.getData("Text");if(n)return l7(e,t,n,!0),!0}return!1},Y6.paste=(e,t)=>{if(e.state.readOnly)return!0;e.observer.flush();let n=Z6?null:t.clipboardData;return n?(U6(e,n.getData("text/plain")||n.getData("text/uri-text")),!0):(function(e){let t=e.dom.parentNode;if(!t)return;let n=t.appendChild(document.createElement("textarea"));n.style.cssText="position: fixed; left: -10000px; top: 10px",n.focus(),setTimeout((()=>{e.focus(),n.remove(),U6(e,n.value)}),50)}(e),!1)};let a7=null;Y6.copy=Y6.cut=(e,t)=>{let{text:n,ranges:o,linewise:r}=function(e){let t=[],n=[],o=!1;for(let r of e.selection.ranges)r.empty||(t.push(e.sliceDoc(r.from,r.to)),n.push(r));if(!t.length){let r=-1;for(let{from:o}of e.selection.ranges){let i=e.doc.lineAt(o);i.number>r&&(t.push(i.text),n.push({from:i.from,to:Math.min(e.doc.length,i.to+1)})),r=i.number}o=!0}return{text:t.join(e.lineBreak),ranges:n,linewise:o}}(e.state);if(!n&&!r)return!1;a7=r?n:null,"cut"!=t.type||e.state.readOnly||e.dispatch({changes:o,scrollIntoView:!0,userEvent:"delete.cut"});let i=Z6?null:t.clipboardData;return i?(i.clearData(),i.setData("text/plain",n),!0):(function(e,t){let n=e.dom.parentNode;if(!n)return;let o=n.appendChild(document.createElement("textarea"));o.style.cssText="position: fixed; left: -10000px; top: 10px",o.value=t,o.focus(),o.selectionEnd=t.length,o.selectionStart=0,setTimeout((()=>{o.remove(),e.focus()}),50)}(e,n),!1)};const s7=T4.define();function c7(e,t){let n=[];for(let o of e.facet(B8)){let r=o(e,t);r&&n.push(r)}return n?e.update({effects:n,annotations:s7.of(!0)}):null}function u7(e){setTimeout((()=>{let t=e.hasFocus;if(t!=e.inputState.notifiedFocused){let n=c7(e.state,t);n?e.dispatch(n):e.update([])}}),10)}V6.focus=e=>{e.inputState.lastFocusTime=Date.now(),e.scrollDOM.scrollTop||!e.inputState.lastScrollTop&&!e.inputState.lastScrollLeft||(e.scrollDOM.scrollTop=e.inputState.lastScrollTop,e.scrollDOM.scrollLeft=e.inputState.lastScrollLeft),u7(e)},V6.blur=e=>{e.observer.clearSelectionRange(),u7(e)},V6.compositionstart=V6.compositionupdate=e=>{null==e.inputState.compositionFirstChange&&(e.inputState.compositionFirstChange=!0),e.inputState.composing<0&&(e.inputState.composing=0)},V6.compositionend=e=>{e.inputState.composing=-1,e.inputState.compositionEndedAt=Date.now(),e.inputState.compositionPendingKey=!0,e.inputState.compositionPendingChange=e.observer.pendingRecords().length>0,e.inputState.compositionFirstChange=null,r8.chrome&&r8.android?e.observer.flushSoon():e.inputState.compositionPendingChange?Promise.resolve().then((()=>e.observer.flush())):setTimeout((()=>{e.inputState.composing<0&&e.docView.hasComposition&&e.update([])}),50)},V6.contextmenu=e=>{e.inputState.lastContextMenu=Date.now()},Y6.beforeinput=(e,t)=>{var n;let o;if(r8.chrome&&r8.android&&(o=L6.find((e=>e.inputType==t.inputType)))&&(e.observer.delayAndroidKey(o.key,o.keyCode),"Backspace"==o.key||"Delete"==o.key)){let t=(null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0;setTimeout((()=>{var n;((null===(n=window.visualViewport)||void 0===n?void 0:n.height)||0)>t+10&&e.hasFocus&&(e.contentDOM.blur(),e.focus())}),100)}return!1};const d7=new Set,p7=["pre-wrap","normal","pre-line","break-spaces"];class h7{constructor(e){this.lineWrapping=e,this.doc=O3.empty,this.heightSamples={},this.lineHeight=14,this.charWidth=7,this.textHeight=14,this.lineLength=30,this.heightChanged=!1}heightForGap(e,t){let n=this.doc.lineAt(t).number-this.doc.lineAt(e).number+1;return this.lineWrapping&&(n+=Math.max(0,Math.ceil((t-e-n*this.lineLength*.5)/this.lineLength))),this.lineHeight*n}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 p7.indexOf(e)>-1!=this.lineWrapping}mustRefreshForHeights(e){let t=!1;for(let n=0;n-1,a=Math.round(t)!=Math.round(this.lineHeight)||this.lineWrapping!=l;if(this.lineWrapping=l,this.lineHeight=t,this.charWidth=n,this.textHeight=o,this.lineLength=r,a){this.heightSamples={};for(let e=0;e0}set outdated(e){this.flags=(e?2:0)|-3&this.flags}setHeight(e,t){this.height!=t&&(Math.abs(this.height-t)>v7&&(e.heightChanged=!0),this.height=t)}replace(e,t,n){return b7.of(n)}decomposeLeft(e,t){t.push(this)}decomposeRight(e,t){t.push(this)}applyChanges(e,t,n,o){let r=this,i=n.doc;for(let l=o.length-1;l>=0;l--){let{fromA:a,toA:s,fromB:c,toB:u}=o[l],d=r.lineAt(a,m7.ByPosNoHeight,n.setDoc(t),0,0),p=d.to>=s?d:r.lineAt(s,m7.ByPosNoHeight,n,0,0);for(u+=p.to-s,s=p.to;l>0&&d.from<=o[l-1].toA;)a=o[l-1].fromA,c=o[l-1].fromB,l--,a2*r){let r=e[t-1];r.break?e.splice(--t,1,r.left,null,r.right):e.splice(--t,1,r.left,r.right),n+=1+r.break,o-=r.size}else{if(!(r>2*o))break;{let t=e[n];t.break?e.splice(n,1,t.left,null,t.right):e.splice(n,1,t.left,t.right),n+=2+t.break,r-=t.size}}else if(o=r&&i(this.blockAt(0,n,o,r))}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more&&this.setHeight(e,o.heights[o.index++]),this.outdated=!1,this}toString(){return`block(${this.length})`}}class O7 extends y7{constructor(e,t){super(e,t,null),this.collapsed=0,this.widgetHeight=0,this.breaks=0}blockAt(e,t,n,o){return new g7(o,this.length,n,this.height,this.breaks)}replace(e,t,n){let o=n[0];return 1==n.length&&(o instanceof O7||o instanceof w7&&4&o.flags)&&Math.abs(this.length-o.length)<10?(o instanceof w7?o=new O7(o.length,this.height):o.height=this.height,this.outdated||(o.outdated=!1),o):b7.of(n)}updateHeight(e,t=0,n=!1,o){return o&&o.from<=t&&o.more?this.setHeight(e,o.heights[o.index++]):(n||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 w7 extends b7{constructor(e){super(e,0)}heightMetrics(e,t){let n,o=e.doc.lineAt(t).number,r=e.doc.lineAt(t+this.length).number,i=r-o+1,l=0;if(e.lineWrapping){let t=Math.min(this.height,e.lineHeight*i);n=t/i,this.length>i+1&&(l=(this.height-t)/(this.length-i-1))}else n=this.height/i;return{firstLine:o,lastLine:r,perLine:n,perChar:l}}blockAt(e,t,n,o){let{firstLine:r,lastLine:i,perLine:l,perChar:a}=this.heightMetrics(t,o);if(t.lineWrapping){let r=o+Math.round(Math.max(0,Math.min(1,(e-n)/this.height))*this.length),i=t.doc.lineAt(r),s=l+i.length*a,c=Math.max(n,e-s/2);return new g7(i.from,i.length,c,s,0)}{let o=Math.max(0,Math.min(i-r,Math.floor((e-n)/l))),{from:a,length:s}=t.doc.line(r+o);return new g7(a,s,n+l*o,l,0)}}lineAt(e,t,n,o,r){if(t==m7.ByHeight)return this.blockAt(e,n,o,r);if(t==m7.ByPosNoHeight){let{from:t,to:o}=n.doc.lineAt(e);return new g7(t,o-t,0,0,0)}let{firstLine:i,perLine:l,perChar:a}=this.heightMetrics(n,r),s=n.doc.lineAt(e),c=l+s.length*a,u=s.number-i,d=o+l*u+a*(s.from-r-u);return new g7(s.from,s.length,Math.max(o,Math.min(d,o+this.height-c)),c,0)}forEachLine(e,t,n,o,r,i){e=Math.max(e,r),t=Math.min(t,r+this.length);let{firstLine:l,perLine:a,perChar:s}=this.heightMetrics(n,r);for(let c=e,u=o;c<=t;){let t=n.doc.lineAt(c);if(c==e){let n=t.number-l;u+=a*n+s*(e-r-n)}let o=a+s*t.length;i(new g7(t.from,t.length,u,o,0)),u+=o,c=t.to+1}}replace(e,t,n){let o=this.length-t;if(o>0){let e=n[n.length-1];e instanceof w7?n[n.length-1]=new w7(e.length+o):n.push(null,new w7(o-1))}if(e>0){let t=n[0];t instanceof w7?n[0]=new w7(e+t.length):n.unshift(new w7(e-1),null)}return b7.of(n)}decomposeLeft(e,t){t.push(new w7(e-1),null)}decomposeRight(e,t){t.push(null,new w7(this.length-e-1))}updateHeight(e,t=0,n=!1,o){let r=t+this.length;if(o&&o.from<=t+this.length&&o.more){let n=[],i=Math.max(t,o.from),l=-1;for(o.from>t&&n.push(new w7(o.from-t-1).updateHeight(e,t));i<=r&&o.more;){let t=e.doc.lineAt(i).length;n.length&&n.push(null);let r=o.heights[o.index++];-1==l?l=r:Math.abs(r-l)>=v7&&(l=-2);let a=new O7(t,r);a.outdated=!1,n.push(a),i+=t+1}i<=r&&n.push(null,new w7(r-i).updateHeight(e,i));let a=b7.of(n);return(l<0||Math.abs(a.height-this.height)>=v7||Math.abs(l-this.heightMetrics(e,t).perLine)>=v7)&&(e.heightChanged=!0),a}return(n||this.outdated)&&(this.setHeight(e,e.heightForGap(t,t+this.length)),this.outdated=!1),this}toString(){return`gap(${this.length})`}}class S7 extends b7{constructor(e,t,n){super(e.length+t+n.length,e.height+n.height,t|(e.outdated||n.outdated?2:0)),this.left=e,this.right=n,this.size=e.size+n.size}get break(){return 1&this.flags}blockAt(e,t,n,o){let r=n+this.left.height;return el))return s;let c=t==m7.ByPosNoHeight?m7.ByPosNoHeight:m7.ByPos;return a?s.join(this.right.lineAt(l,c,n,i,l)):this.left.lineAt(l,c,n,o,r).join(s)}forEachLine(e,t,n,o,r,i){let l=o+this.left.height,a=r+this.left.length+this.break;if(this.break)e=a&&this.right.forEachLine(e,t,n,l,a,i);else{let s=this.lineAt(a,m7.ByPos,n,o,r);e=e&&s.from<=t&&i(s),t>s.to&&this.right.forEachLine(s.to+1,t,n,l,a,i)}}replace(e,t,n){let o=this.left.length+this.break;if(tthis.left.length)return this.balanced(this.left,this.right.replace(e-o,t-o,n));let r=[];e>0&&this.decomposeLeft(e,r);let i=r.length;for(let l of n)r.push(l);if(e>0&&x7(r,i-1),t=n&&t.push(null)),e>n&&this.right.decomposeLeft(e-n,t)}decomposeRight(e,t){let n=this.left.length,o=n+this.break;if(e>=o)return this.right.decomposeRight(e-o,t);e2*t.size||t.size>2*e.size?b7.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,n=!1,o){let{left:r,right:i}=this,l=t+r.length+this.break,a=null;return o&&o.from<=t+r.length&&o.more?a=r=r.updateHeight(e,t,n,o):r.updateHeight(e,t,n),o&&o.from<=l+i.length&&o.more?a=i=i.updateHeight(e,l,n,o):i.updateHeight(e,l,n),a?this.balanced(r,i):(this.height=this.left.height+this.right.height,this.outdated=!1,this)}toString(){return this.left+(this.break?" ":"-")+this.right}}function x7(e,t){let n,o;null==e[t]&&(n=e[t-1])instanceof w7&&(o=e[t+1])instanceof w7&&e.splice(t-1,3,new w7(n.length+1+o.length))}class $7{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 e=Math.min(t,this.lineEnd),n=this.nodes[this.nodes.length-1];n instanceof O7?n.length+=e-this.pos:(e>this.pos||!this.isCovered)&&this.nodes.push(new O7(e-this.pos,-1)),this.writtenTo=e,t>e&&(this.nodes.push(null),this.writtenTo++,this.lineStart=-1)}this.pos=t}point(e,t,n){if(e=5)&&this.addLineDeco(o,r,i)}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 O7(this.pos-e,-1)),this.writtenTo=this.pos}blankContent(e,t){let n=new w7(t-e);return this.oracle.doc.lineAt(e).to==t&&(n.flags|=4),n}ensureLine(){this.enterLine();let e=this.nodes.length?this.nodes[this.nodes.length-1]:null;if(e instanceof O7)return e;let t=new O7(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,n){let o=this.ensureLine();o.length+=n,o.collapsed+=n,o.widgetHeight=Math.max(o.widgetHeight,e),o.breaks+=t,this.writtenTo=this.pos=this.pos+n}finish(e){let t=0==this.nodes.length?null:this.nodes[this.nodes.length-1];!(this.lineStart>-1)||t instanceof O7||this.isCovered?(this.writtenTot.clientHeight||t.scrollWidth>t.clientWidth)&&"visible"!=n.overflow){let n=t.getBoundingClientRect();i=Math.max(i,n.left),l=Math.min(l,n.right),a=Math.max(a,n.top),s=c==e.parentNode?n.bottom:Math.min(s,n.bottom)}c="absolute"==n.position||"fixed"==n.position?t.offsetParent:t.parentNode}else{if(11!=c.nodeType)break;c=c.host}return{left:i-n.left,right:Math.max(i,l)-n.left,top:a-(n.top+t),bottom:Math.max(a,s)-(n.top+t)}}function P7(e,t){let n=e.getBoundingClientRect();return{left:0,right:n.right-n.left,top:t,bottom:n.bottom-(n.top+t)}}class T7{constructor(e,t,n){this.from=e,this.to=t,this.size=n}static same(e,t){if(e.length!=t.length)return!1;for(let n=0;n"function"!=typeof e&&"cm-lineWrapping"==e.class));this.heightOracle=new h7(t),this.stateDeco=e.facet(U8).filter((e=>"function"!=typeof e)),this.heightMap=b7.empty().applyChanges(this.stateDeco,O3.empty,this.heightOracle.setDoc(e.doc),[new n6(0,0,0,e.doc.length)]),this.viewport=this.getViewport(0,null),this.updateViewportLines(),this.updateForViewport(),this.lineGaps=this.ensureLineGaps([]),this.lineGapDeco=w8.set(this.lineGaps.map((e=>e.draw(this,!1)))),this.computeVisibleRanges()}updateForViewport(){let e=[this.viewport],{main:t}=this.state.selection;for(let n=0;n<=1;n++){let o=n?t.head:t.anchor;if(!e.some((({from:e,to:t})=>o>=e&&o<=t))){let{from:t,to:n}=this.lineBlockAt(o);e.push(new E7(t,n))}}this.viewports=e.sort(((e,t)=>e.from-t.from)),this.scaler=this.heightMap.height<=7e6?z7:new B7(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(1==this.scaler.scale?e:j7(e,this.scaler))}))}update(e,t=null){this.state=e.state;let n=this.stateDeco;this.stateDeco=this.state.facet(U8).filter((e=>"function"!=typeof e));let o=e.changedRanges,r=n6.extendWithRanges(o,function(e,t,n){let o=new C7;return U4.compare(e,t,n,o,0),o.changes}(n,this.stateDeco,e?e.changes:W3.empty(this.state.doc.length))),i=this.heightMap.height,l=this.scrolledToBottom?null:this.scrollAnchorAt(this.scrollTop);this.heightMap=this.heightMap.applyChanges(this.stateDeco,e.startState.doc,this.heightOracle.setDoc(this.state.doc),r),this.heightMap.height!=i&&(e.flags|=2),l?(this.scrollAnchorPos=e.changes.mapPos(l.from,-1),this.scrollAnchorHeight=l.top):(this.scrollAnchorPos=-1,this.scrollAnchorHeight=this.heightMap.height);let a=r.length?this.mapViewport(this.viewport,e.changes):this.viewport;(t&&(t.range.heada.to)||!this.viewportIsAppropriate(a))&&(a=this.getViewport(0,t));let s=!e.changes.empty||2&e.flags||a.from!=this.viewport.from||a.to!=this.viewport.to;this.viewport=a,this.updateForViewport(),s&&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(N8)&&(this.mustEnforceCursorAssoc=!0)}measure(e){let t=e.contentDOM,n=window.getComputedStyle(t),o=this.heightOracle,r=n.whiteSpace;this.defaultTextDirection="rtl"==n.direction?r6.RTL:r6.LTR;let i=this.heightOracle.mustRefreshForWrapping(r),l=t.getBoundingClientRect(),a=i||this.mustMeasureContent||this.contentDOMHeight!=l.height;this.contentDOMHeight=l.height,this.mustMeasureContent=!1;let s=0,c=0;if(l.width&&l.height){let{scaleX:e,scaleY:n}=E5(t,l);this.scaleX==e&&this.scaleY==n||(this.scaleX=e,this.scaleY=n,s|=8,i=a=!0)}let u=(parseInt(n.paddingTop)||0)*this.scaleY,d=(parseInt(n.paddingBottom)||0)*this.scaleY;this.paddingTop==u&&this.paddingBottom==d||(this.paddingTop=u,this.paddingBottom=d,s|=10),this.editorWidth!=e.scrollDOM.clientWidth&&(o.lineWrapping&&(a=!0),this.editorWidth=e.scrollDOM.clientWidth,s|=8);let p=e.scrollDOM.scrollTop*this.scaleY;this.scrollTop!=p&&(this.scrollAnchorHeight=-1,this.scrollTop=p),this.scrolledToBottom=_5(e.scrollDOM);let h=(this.printing?P7:k7)(t,this.paddingTop),f=h.top-this.pixelViewport.top,g=h.bottom-this.pixelViewport.bottom;this.pixelViewport=h;let m=this.pixelViewport.bottom>this.pixelViewport.top&&this.pixelViewport.right>this.pixelViewport.left;if(m!=this.inView&&(this.inView=m,m&&(a=!0)),!this.inView&&!this.scrollTarget)return 0;let v=l.width;if(this.contentDOMWidth==v&&this.editorHeight==e.scrollDOM.clientHeight||(this.contentDOMWidth=l.width,this.editorHeight=e.scrollDOM.clientHeight,s|=8),a){let t=e.docView.measureVisibleLineHeights(this.viewport);if(o.mustRefreshForHeights(t)&&(i=!0),i||o.lineWrapping&&Math.abs(v-this.contentDOMWidth)>o.charWidth){let{lineHeight:n,charWidth:l,textHeight:a}=e.docView.measureTextSize();i=n>0&&o.refresh(r,n,l,a,v/l,t),i&&(e.docView.minWidth=0,s|=8)}f>0&&g>0?c=Math.max(f,g):f<0&&g<0&&(c=Math.min(f,g)),o.heightChanged=!1;for(let n of this.viewports){let r=n.from==this.viewport.from?t:e.docView.measureVisibleLineHeights(n);this.heightMap=(i?b7.empty().applyChanges(this.stateDeco,O3.empty,this.heightOracle,[new n6(0,0,0,e.state.doc.length)]):this.heightMap).updateHeight(o,0,i,new f7(n.from,r))}o.heightChanged&&(s|=2)}let b=!this.viewportIsAppropriate(this.viewport,c)||this.scrollTarget&&(this.scrollTarget.range.headthis.viewport.to);return b&&(this.viewport=this.getViewport(c,this.scrollTarget)),this.updateForViewport(),(2&s||b)&&this.updateViewportLines(),(this.lineGaps.length||this.viewport.to-this.viewport.from>4e3)&&this.updateLineGaps(this.ensureLineGaps(i?[]:this.lineGaps,e)),s|=this.computeVisibleRanges(),this.mustEnforceCursorAssoc&&(this.mustEnforceCursorAssoc=!1,e.docView.enforceCursorAssoc()),s}get visibleTop(){return this.scaler.fromDOM(this.pixelViewport.top)}get visibleBottom(){return this.scaler.fromDOM(this.pixelViewport.bottom)}getViewport(e,t){let n=.5-Math.max(-.5,Math.min(.5,e/1e3/2)),o=this.heightMap,r=this.heightOracle,{visibleTop:i,visibleBottom:l}=this,a=new E7(o.lineAt(i-1e3*n,m7.ByHeight,r,0,0).from,o.lineAt(l+1e3*(1-n),m7.ByHeight,r,0,0).to);if(t){let{head:e}=t.range;if(ea.to){let n,i=Math.min(this.editorHeight,this.pixelViewport.bottom-this.pixelViewport.top),l=o.lineAt(e,m7.ByPos,r,0,0);n="center"==t.y?(l.top+l.bottom)/2-i/2:"start"==t.y||"nearest"==t.y&&e=l+Math.max(10,Math.min(n,250)))&&o>i-2e3&&r>1,i=o<<1;if(this.defaultTextDirection!=r6.LTR&&!n)return[];let l=[],a=(o,i,s,c)=>{if(i-oo&&ee.from>=s.from&&e.to<=s.to&&Math.abs(e.from-o)e.fromt))));if(!p){if(ie.from<=i&&e.to>=i))){let e=t.moveToLineBoundary(q3.cursor(i),!1,!0).head;e>o&&(i=e)}p=new T7(o,i,this.gapSize(s,o,i,c))}l.push(p)};for(let s of this.viewportLines){if(s.lengths.from&&a(s.from,t,s,e),re.draw(this,this.heightOracle.lineWrapping)))))}computeVisibleRanges(){let e=this.stateDeco;this.lineGaps.length&&(e=e.concat(this.lineGapDeco));let t=[];U4.spans(e,this.viewport.from,this.viewport.to,{span(e,n){t.push({from:e,to:n})},point(){}},20);let n=t.length!=this.visibleRanges.length||this.visibleRanges.some(((e,n)=>e.from!=t[n].from||e.to!=t[n].to));return this.visibleRanges=t,n?4:0}lineBlockAt(e){return e>=this.viewport.from&&e<=this.viewport.to&&this.viewportLines.find((t=>t.from<=e&&t.to>=e))||j7(this.heightMap.lineAt(e,m7.ByPos,this.heightOracle,0,0),this.scaler)}lineBlockAtHeight(e){return j7(this.heightMap.lineAt(this.scaler.fromDOM(e),m7.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 j7(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 E7{constructor(e,t){this.from=e,this.to=t}}function A7(e,t,n){let o=[],r=e,i=0;return U4.spans(n,e,t,{span(){},point(e,t){e>r&&(o.push({from:r,to:e}),i+=e-r),r=t}},20),r=1)return t[t.length-1].to;let o=Math.floor(e*n);for(let r=0;;r++){let{from:e,to:n}=t[r],i=n-e;if(o<=i)return e+o;o-=i}}function R7(e,t){let n=0;for(let{from:o,to:r}of e.ranges){if(t<=r){n+=t-o;break}n+=r-o}return n/e.total}const z7={toDOM:e=>e,fromDOM:e=>e,scale:1};class B7{constructor(e,t,n){let o=0,r=0,i=0;this.viewports=n.map((({from:n,to:r})=>{let i=t.lineAt(n,m7.ByPos,e,0,0).top,l=t.lineAt(r,m7.ByPos,e,0,0).bottom;return o+=l-i,{from:n,to:r,top:i,bottom:l,domTop:0,domBottom:0}})),this.scale=(7e6-o)/(t.height-o);for(let l of this.viewports)l.domTop=i+(l.top-r)*this.scale,i=l.domBottom=l.domTop+(l.bottom-l.top),r=l.bottom}toDOM(e){for(let t=0,n=0,o=0;;t++){let r=tj7(e,t))):e._content)}const N7=t4.define({combine:e=>e.join(" ")}),_7=t4.define({combine:e=>e.indexOf(!0)>-1}),Q7=p5.newName(),L7=p5.newName(),H7=p5.newName(),F7={"&light":"."+L7,"&dark":"."+H7};function W7(e,t,n){return new p5(t,{finish:t=>/&/.test(t)?t.replace(/&\w*/,(t=>{if("&"==t)return e;if(!n||!n[t])throw new RangeError(`Unsupported selector: ${t}`);return n[t]})):e+" "+t})}const X7=W7("."+Q7,{"&":{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"},".cm-announced":{position:"fixed",top:"-10000px"},"@media print":{".cm-announced":{display:"none"}},"&light .cm-activeLine":{backgroundColor:"#cceeff44"},"&dark .cm-activeLine":{backgroundColor:"#99eeff33"},"&light .cm-specialChar":{color:"red"},"&dark .cm-specialChar":{color:"#f78"},".cm-gutters":{flexShrink:0,display:"flex",height:"100%",boxSizing:"border-box",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"}},F7),Y7="￿";class V7{constructor(e,t){this.points=e,this.text="",this.lineSeparator=t.facet(F4.lineSeparator)}append(e){this.text+=e}lineBreak(){this.text+=Y7}readRange(e,t){if(!e)return this;let n=e.parentNode;for(let o=e;;){this.findPointBefore(n,o);let e=this.text.length;this.readNode(o);let r=o.nextSibling;if(r==t)break;let i=H5.get(o),l=H5.get(r);(i&&l?i.breakAfter:(i?i.breakAfter:U7(o))||U7(r)&&("BR"!=o.nodeName||o.cmIgnore)&&this.text.length>e)&&this.lineBreak(),o=r}return this.findPointBefore(n,t),this}readTextNode(e){let t=e.nodeValue;for(let n of this.points)n.node==e&&(n.pos=this.text.length+Math.min(n.offset,t.length));for(let n=0,o=this.lineSeparator?null:/\r\n?|\n/g;;){let r,i=-1,l=1;if(this.lineSeparator?(i=t.indexOf(this.lineSeparator,n),l=this.lineSeparator.length):(r=o.exec(t))&&(i=r.index,l=r[0].length),this.append(t.slice(n,i<0?t.length:i)),i<0)break;if(this.lineBreak(),l>1)for(let t of this.points)t.node==e&&t.pos>this.text.length&&(t.pos-=l-1);n=i+l}}readNode(e){if(e.cmIgnore)return;let t=H5.get(e),n=t&&t.overrideDOMText;if(null!=n){this.findPointInside(e,n.length);for(let e=n.iter();!e.next().done;)e.lineBreak?this.lineBreak():this.append(e.value)}else 3==e.nodeType?this.readTextNode(e):"BR"==e.nodeName?e.nextSibling&&this.lineBreak():1==e.nodeType&&this.readRange(e.firstChild,null)}findPointBefore(e,t){for(let n of this.points)n.node==e&&e.childNodes[n.offset]==t&&(n.pos=this.text.length)}findPointInside(e,t){for(let n of this.points)(3==e.nodeType?n.node==e:e.contains(n.node))&&(n.pos=this.text.length+(Z7(e,n.node,n.offset)?t:0))}}function Z7(e,t,n){for(;;){if(!t||n-1)this.newSel=null;else if(t>-1&&(this.bounds=e.docView.domBoundsAround(t,n,0))){let t=r||i?[]:function(e){let t=[];if(e.root.activeElement!=e.contentDOM)return t;let{anchorNode:n,anchorOffset:o,focusNode:r,focusOffset:i}=e.observer.selectionRange;return n&&(t.push(new K7(n,o)),r==n&&i==o||t.push(new K7(r,i))),t}(e),n=new V7(t,e.state);n.readRange(this.bounds.startDOM,this.bounds.endDOM),this.text=n.text,this.newSel=function(e,t){if(0==e.length)return null;let n=e[0].pos,o=2==e.length?e[1].pos:n;return n>-1&&o>-1?q3.single(n+t,o+t):null}(t,this.bounds.from)}else{let t=e.observer.selectionRange,n=r&&r.node==t.focusNode&&r.offset==t.focusOffset||!S5(e.contentDOM,t.focusNode)?e.state.selection.main.head:e.docView.posFromDOM(t.focusNode,t.focusOffset),o=i&&i.node==t.anchorNode&&i.offset==t.anchorOffset||!S5(e.contentDOM,t.anchorNode)?e.state.selection.main.anchor:e.docView.posFromDOM(t.anchorNode,t.anchorOffset);this.newSel=q3.single(o,n)}}}function q7(e,t){let n,{newSel:o}=t,r=e.state.selection.main,i=e.inputState.lastKeyTime>Date.now()-100?e.inputState.lastKeyCode:-1;if(t.bounds){let{from:o,to:l}=t.bounds,a=r.from,s=null;(8===i||r8.android&&t.text.length0&&a>0&&e.charCodeAt(l-1)==t.charCodeAt(a-1);)l--,a--;return"end"==o&&(n-=l+Math.max(0,i-Math.min(l,a))-i),l=l?i-n:0,a=i+(a-l),l=i):a=a?i-n:0,l=i+(l-a),a=i),{from:i,toA:l,toB:a}}(e.state.doc.sliceString(o,l,Y7),t.text,a-o,s);c&&(r8.chrome&&13==i&&c.toB==c.from+2&&t.text.slice(c.from,c.toB)==Y7+Y7&&c.toB--,n={from:o+c.from,to:o+c.toA,insert:O3.of(t.text.slice(c.from,c.toB).split(Y7))})}else o&&(!e.hasFocus&&e.state.facet(H8)||o.main.eq(r))&&(o=null);if(!n&&!o)return!1;if(!n&&t.typeOver&&!r.empty&&o&&o.main.empty?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,r.to)}:n&&n.from>=r.from&&n.to<=r.to&&(n.from!=r.from||n.to!=r.to)&&r.to-r.from-(n.to-n.from)<=4?n={from:r.from,to:r.to,insert:e.state.doc.slice(r.from,n.from).append(n.insert).append(e.state.doc.slice(n.to,r.to))}:(r8.mac||r8.android)&&n&&n.from==n.to&&n.from==r.head-1&&/^\. ?$/.test(n.insert.toString())&&"off"==e.contentDOM.getAttribute("autocorrect")?(o&&2==n.insert.length&&(o=q3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:O3.of([" "])}):r8.chrome&&n&&n.from==n.to&&n.from==r.head&&"\n "==n.insert.toString()&&e.lineWrapping&&(o&&(o=q3.single(o.main.anchor-1,o.main.head-1)),n={from:r.from,to:r.to,insert:O3.of([" "])}),n){if(r8.ios&&e.inputState.flushIOSKey())return!0;if(r8.android&&(n.from==r.from&&n.to==r.to&&1==n.insert.length&&2==n.insert.lines&&j5(e.contentDOM,"Enter",13)||(n.from==r.from-1&&n.to==r.to&&0==n.insert.length||8==i&&n.insert.lengthr.head)&&j5(e.contentDOM,"Backspace",8)||n.from==r.from&&n.to==r.to+1&&0==n.insert.length&&j5(e.contentDOM,"Delete",46)))return!0;let t,l=n.insert.toString();e.inputState.composing>=0&&e.inputState.composing++;let a=()=>t||(t=function(e,t,n){let o,r=e.state,i=r.selection.main;if(t.from>=i.from&&t.to<=i.to&&t.to-t.from>=(i.to-i.from)/3&&(!n||n.main.empty&&n.main.from==t.from+t.insert.length)&&e.inputState.composing<0){let n=i.fromt.to?r.sliceDoc(t.to,i.to):"";o=r.replaceSelection(e.state.toText(n+t.insert.sliceString(0,void 0,e.state.lineBreak)+l))}else{let l=r.changes(t),a=n&&n.main.to<=l.newLength?n.main:void 0;if(r.selection.ranges.length>1&&e.inputState.composing>=0&&t.to<=i.to&&t.to>=i.to-10){let s,c=e.state.sliceDoc(t.from,t.to),u=n&&x6(e,n.main.head);if(u){let e=t.insert.length-(t.to-t.from);s={from:u.from,to:u.to-e}}else s=e.state.doc.lineAt(i.head);let d=i.to-t.to,p=i.to-i.from;o=r.changeByRange((n=>{if(n.from==i.from&&n.to==i.to)return{changes:l,range:a||n.map(l)};let o=n.to-d,u=o-c.length;if(n.to-n.from!=p||e.state.sliceDoc(u,o)!=c||n.to>=s.from&&n.from<=s.to)return{range:n};let h=r.changes({from:u,to:o,insert:t.insert}),f=n.to-i.to;return{changes:h,range:a?q3.range(Math.max(0,a.anchor+f),Math.max(0,a.head+f)):n.map(h)}}))}else o={changes:l,selection:a&&r.selection.replaceRange(a)}}let l="input.type";return(e.composing||e.inputState.compositionPendingChange&&e.inputState.compositionEndedAt>Date.now()-50)&&(e.inputState.compositionPendingChange=!1,l+=".compose",e.inputState.compositionFirstChange&&(l+=".start",e.inputState.compositionFirstChange=!1)),r.update(o,{userEvent:l,scrollIntoView:!0})}(e,n,o));return e.state.facet(z8).some((t=>t(e,n.from,n.to,l,a)))||e.dispatch(a()),!0}if(o&&!o.main.eq(r)){let t=!1,n="select";return e.inputState.lastSelectionTime>Date.now()-50&&("select"==e.inputState.lastSelectionOrigin&&(t=!0),n=e.inputState.lastSelectionOrigin),e.dispatch({selection:o,scrollIntoView:t,userEvent:n}),!0}return!1}const J7={childList:!0,characterData:!0,subtree:!0,attributes:!0,characterDataOldValue:!0},e9=r8.ie&&r8.ie_version<=11;class t9{constructor(e){this.view=e,this.active=!1,this.selectionRange=new A5,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 e of t)this.queue.push(e);(r8.ie&&r8.ie_version<=11||r8.ios&&e.composing)&&t.some((e=>"childList"==e.type&&e.removedNodes.length||"characterData"==e.type&&e.oldValue.length>e.target.nodeValue.length))?this.flushSoon():this.flush()})),e9&&(this.onCharData=e=>{this.queue.push({target:e.target,type:"characterData",oldValue:e.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),"function"==typeof ResizeObserver&&(this.resizeScroll=new ResizeObserver((()=>{var e;(null===(e=this.view.docView)||void 0===e?void 0:e.lastUpdate){this.parentCheck<0&&(this.parentCheck=setTimeout(this.listenForScroll.bind(this),1e3)),e.length>0&&e[e.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((e=>{e.length>0&&e[e.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,n)=>t!=e[n])))){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:n}=this,o=this.selectionRange;if(n.state.facet(H8)?n.root.activeElement!=this.dom:!x5(n.dom,o))return;let r=o.anchorNode&&n.docView.nearest(o.anchorNode);r&&r.ignoreEvent(e)?t||(this.selectionChanged=!1):(r8.ie&&r8.ie_version<=11||r8.android&&r8.chrome)&&!n.state.selection.main.empty&&o.focusNode&&C5(o.focusNode,o.focusOffset,o.anchorNode,o.anchorOffset)?this.flushSoon():this.flush(!1)}readSelectionRange(){let{view:e}=this,t=r8.safari&&11==e.root.nodeType&&function(e){let t=e.activeElement;for(;t&&t.shadowRoot;)t=t.shadowRoot.activeElement;return t}(this.dom.ownerDocument)==this.dom&&function(e){let t=null;function n(e){e.preventDefault(),e.stopImmediatePropagation(),t=e.getTargetRanges()[0]}if(e.contentDOM.addEventListener("beforeinput",n,!0),e.dom.ownerDocument.execCommand("indent"),e.contentDOM.removeEventListener("beforeinput",n,!0),!t)return null;let o=t.startContainer,r=t.startOffset,i=t.endContainer,l=t.endOffset,a=e.docView.domAtPos(e.state.selection.main.anchor);return C5(a.node,a.offset,i,l)&&([o,r,i,l]=[i,l,o,r]),{anchorNode:o,anchorOffset:r,focusNode:i,focusOffset:l}}(this.view)||w5(e.root);if(!t||this.selectionRange.eq(t))return!1;let n=x5(this.dom,t);return n&&!this.selectionChanged&&e.inputState.lastFocusTime>Date.now()-200&&e.inputState.lastTouchTime{let e=this.delayedAndroidKey;e&&(this.clearDelayedAndroidKey(),this.view.inputState.lastKeyCode=e.keyCode,this.view.inputState.lastKeyTime=Date.now(),!this.flush()&&e.force&&j5(this.dom,e.key,e.keyCode))};this.flushingAndroidKey=this.view.win.requestAnimationFrame(e)}this.delayedAndroidKey&&"Enter"!=e||(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,n=-1,o=!1;for(let r of e){let e=this.readMutation(r);e&&(e.typeOver&&(o=!0),-1==t?({from:t,to:n}=e):(t=Math.min(e.from,t),n=Math.max(e.to,n)))}return{from:t,to:n,typeOver:o}}readChange(){let{from:e,to:t,typeOver:n}=this.processRecords(),o=this.selectionChanged&&x5(this.dom,this.selectionRange);if(e<0&&!o)return null;e>-1&&(this.lastChange=Date.now()),this.view.inputState.lastFocusTime=0,this.selectionChanged=!1;let r=new G7(this.view,e,t,n);return this.view.docView.domChanged={newSel:r.newSel?r.newSel.main:null},r}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 n=this.view.state,o=q7(this.view,t);return this.view.state==n&&this.view.update([]),o}readMutation(e){let t=this.view.docView.nearest(e.target);if(!t||t.ignoreMutation(e))return null;if(t.markDirty("attributes"==e.type),"attributes"==e.type&&(t.flags|=4),"childList"==e.type){let n=n9(t,e.previousSibling||e.target.previousSibling,-1),o=n9(t,e.nextSibling||e.target.nextSibling,1);return{from:n?t.posAfter(n):t.posAtStart,to:o?t.posBefore(o):t.posAtEnd,typeOver:!1}}return"characterData"==e.type?{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,n;this.stop(),null===(e=this.intersection)||void 0===e||e.disconnect(),null===(t=this.gapIntersection)||void 0===t||t.disconnect(),null===(n=this.resizeScroll)||void 0===n||n.disconnect();for(let o of this.scrollTargets)o.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 n9(e,t,n){for(;t;){let o=H5.get(t);if(o&&o.parent==e)return o;let r=t.parentNode;t=r!=e.dom?r:n>0?t.nextSibling:t.previousSibling}return null}class o9{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.className="cm-announced",this.announceDOM.setAttribute("aria-live","polite"),this.dom=document.createElement("div"),this.dom.appendChild(this.announceDOM),this.dom.appendChild(this.scrollDOM),e.parent&&e.parent.appendChild(this.dom);let{dispatch:t}=e;this.dispatchTransactions=e.dispatchTransactions||t&&(e=>e.forEach((e=>t(e,this))))||(e=>this.update(e)),this.dispatch=this.dispatch.bind(this),this._root=e.root||function(e){for(;e;){if(e&&(9==e.nodeType||11==e.nodeType&&e.host))return e;e=e.assignedSlot||e.parentNode}return null}(e.parent)||document,this.viewState=new I7(e.state||F4.create(e)),e.scrollTo&&e.scrollTo.is(Q8)&&(this.viewState.scrollTarget=e.scrollTo.value.clip(this.viewState.state)),this.plugins=this.state.facet(W8).map((e=>new Y8(e)));for(let n of this.plugins)n.update(this);this.observer=new t9(this),this.inputState=new _6(this),this.inputState.ensureHandlers(this.plugins),this.docView=new w6(this),this.mountStyles(),this.updateAttrs(),this.updateState=0,this.requestMeasure()}dispatch(...e){let t=1==e.length&&e[0]instanceof A4?e:1==e.length&&Array.isArray(e[0])?e[0]:[this.state.update(...e)];this.dispatchTransactions(t,this)}update(e){if(0!=this.updateState)throw new Error("Calls to EditorView.update are not allowed while an update is in progress");let t,n=!1,o=!1,r=this.state;for(let d of e){if(d.startState!=r)throw new RangeError("Trying to update state with a transaction that doesn't start from the previous state.");r=d.state}if(this.destroyed)return void(this.viewState.state=r);let i=this.hasFocus,l=0,a=null;e.some((e=>e.annotation(s7)))?(this.inputState.notifiedFocused=i,l=1):i!=this.inputState.notifiedFocused&&(this.inputState.notifiedFocused=i,a=c7(r,i),a||(l=1));let s=this.observer.delayedAndroidKey,c=null;if(s?(this.observer.clearDelayedAndroidKey(),c=this.observer.readChange(),(c&&!this.state.doc.eq(r.doc)||!this.state.selection.eq(r.selection))&&(c=null)):this.observer.clear(),r.facet(F4.phrases)!=this.state.facet(F4.phrases))return this.setState(r);t=o6.create(this,r,e),t.flags|=l;let u=this.viewState.scrollTarget;try{this.updateState=2;for(let t of e){if(u&&(u=u.map(t.changes)),t.scrollIntoView){let{main:e}=t.state.selection;u=new _8(e.empty?e:q3.cursor(e.head,e.head>e.anchor?-1:1))}for(let e of t.effects)e.is(Q8)&&(u=e.value.clip(this.state))}this.viewState.update(t,u),this.bidiCache=l9.update(this.bidiCache,t.changes),t.empty||(this.updatePlugins(t),this.inputState.update(t)),n=this.docView.update(t),this.state.facet(t6)!=this.styleModules&&this.mountStyles(),o=this.updateAttrs(),this.showAnnouncements(e),this.docView.updateSelection(n,e.some((e=>e.isUserEvent("select.pointer"))))}finally{this.updateState=0}if(t.startState.facet(N7)!=t.state.facet(N7)&&(this.viewState.mustMeasureContent=!0),(n||o||u||this.viewState.mustEnforceCursorAssoc||this.viewState.mustMeasureContent)&&this.requestMeasure(),!t.empty)for(let d of this.state.facet(R8))try{d(t)}catch(Fpe){L8(this.state,Fpe,"update listener")}(a||c)&&Promise.resolve().then((()=>{a&&this.state==a.startState&&this.dispatch(a),c&&!q7(this,c)&&s.force&&j5(this.contentDOM,s.key,s.keyCode)}))}setState(e){if(0!=this.updateState)throw new Error("Calls to EditorView.setState are not allowed while an update is in progress");if(this.destroyed)return void(this.viewState.state=e);this.updateState=2;let t=this.hasFocus;try{for(let e of this.plugins)e.destroy(this);this.viewState=new I7(e),this.plugins=e.facet(W8).map((e=>new Y8(e))),this.pluginMap.clear();for(let e of this.plugins)e.update(this);this.docView.destroy(),this.docView=new w6(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(W8),n=e.state.facet(W8);if(t!=n){let o=[];for(let r of n){let n=t.indexOf(r);if(n<0)o.push(new Y8(r));else{let t=this.plugins[n];t.mustUpdate=e,o.push(t)}}for(let t of this.plugins)t.mustUpdate!=e&&t.destroy(this);this.plugins=o,this.pluginMap.clear()}else for(let o of this.plugins)o.mustUpdate=e;for(let o=0;o-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.observer.delayedAndroidKey)return this.measureScheduled=-1,void this.requestMeasure();this.measureScheduled=0,e&&this.observer.forceFlush();let t=null,n=this.scrollDOM,o=n.scrollTop*this.scaleY,{scrollAnchorPos:r,scrollAnchorHeight:i}=this.viewState;Math.abs(o-this.viewState.scrollTop)>1&&(i=-1),this.viewState.scrollAnchorHeight=-1;try{for(let e=0;;e++){if(i<0)if(_5(n))r=-1,i=this.viewState.heightMap.height;else{let e=this.viewState.scrollAnchorAt(o);r=e.from,i=e.top}this.updateState=1;let l=this.viewState.measure(this);if(!l&&!this.measureRequests.length&&null==this.viewState.scrollTarget)break;if(e>5)break;let a=[];4&l||([this.measureRequests,a]=[a,this.measureRequests]);let s=a.map((e=>{try{return e.read(this)}catch(Fpe){return L8(this.state,Fpe),i9}})),c=o6.create(this,this.state,[]),u=!1;c.flags|=l,t?t.flags|=l:t=c,this.updateState=2,c.empty||(this.updatePlugins(c),this.inputState.update(c),this.updateAttrs(),u=this.docView.update(c));for(let e=0;e1||e<-1){o+=e,n.scrollTop=o/this.scaleY,i=-1;continue}}}break}}}finally{this.updateState=0,this.measureScheduled=-1}if(t&&!t.empty)for(let l of this.state.facet(R8))l(t)}get themeClasses(){return Q7+" "+(this.state.facet(_7)?H7:L7)+" "+this.state.facet(N7)}updateAttrs(){let e=a9(this,V8,{class:"cm-editor"+(this.hasFocus?" cm-focused ":" ")+this.themeClasses}),t={spellcheck:"false",autocorrect:"off",autocapitalize:"off",translate:"no",contenteditable:this.state.facet(H8)?"true":"false",class:"cm-content",style:`${r8.tabSize}: ${this.state.tabSize}`,role:"textbox","aria-multiline":"true"};this.state.readOnly&&(t["aria-readonly"]="true"),a9(this,Z8,t);let n=this.observer.ignore((()=>{let n=g8(this.contentDOM,this.contentAttrs,t),o=g8(this.dom,this.editorAttrs,e);return n||o}));return this.editorAttrs=e,this.contentAttrs=t,n}showAnnouncements(e){let t=!0;for(let n of e)for(let e of n.effects)e.is(o9.announce)&&(t&&(this.announceDOM.textContent=""),t=!1,this.announceDOM.appendChild(document.createElement("div")).textContent=e.value)}mountStyles(){this.styleModules=this.state.facet(t6);let e=this.state.facet(o9.cspNonce);p5.mount(this.root,this.styleModules.concat(X7).reverse(),e?{nonce:e}:void 0)}readMeasured(){if(2==this.updateState)throw new Error("Reading the editor layout isn't allowed during an update");0==this.updateState&&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(null!=e.key)for(let t=0;tt.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,n){return N6(this,e,B6(this,e,t,n))}moveByGroup(e,t){return N6(this,e,B6(this,e,t,(t=>function(e,t,n){let o=e.state.charCategorizer(t),r=o(n);return e=>{let t=o(e);return r==_4.Space&&(r=t),r==t}}(this,e.head,t))))}moveToLineBoundary(e,t,n=!0){return function(e,t,n,o){let r=z6(e,t.head),i=o&&r.type==O8.Text&&(e.lineWrapping||r.widgetLineBreaks)?e.coordsAtPos(t.assoc<0&&t.head>r.from?t.head-1:t.head):null;if(i){let t=e.dom.getBoundingClientRect(),o=e.textDirectionAt(r.from),l=e.posAtCoords({x:n==(o==r6.LTR)?t.right-1:t.left+1,y:(i.top+i.bottom)/2});if(null!=l)return q3.cursor(l,n?-1:1)}return q3.cursor(n?r.to:r.from,n?-1:1)}(this,e,t,n)}moveVertically(e,t,n){return N6(this,e,function(e,t,n,o){let r=t.head,i=n?1:-1;if(r==(n?e.state.doc.length:0))return q3.cursor(r,t.assoc);let l,a=t.goalColumn,s=e.contentDOM.getBoundingClientRect(),c=e.coordsAtPos(r,t.assoc||-1),u=e.documentTop;if(c)null==a&&(a=c.left-s.left),l=i<0?c.top:c.bottom;else{let t=e.viewState.lineBlockAt(r);null==a&&(a=Math.min(s.right-s.left,e.defaultCharacterWidth*(r-t.from))),l=(i<0?t.top:t.bottom)+u}let d=s.left+a,p=null!=o?o:e.viewState.heightOracle.textHeight>>1;for(let h=0;;h+=10){let t=l+(p+h)*i,n=D6(e,{x:d,y:t},!1,i);if(ts.bottom||(i<0?nr)){let o=e.docView.coordsForChar(n),r=!o||t0)}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(j8)||ethis.viewport.to?this.textDirection:(this.readMeasured(),this.docView.textDirectionAt(e))}get lineWrapping(){return this.viewState.heightOracle.lineWrapping}bidiSpans(e){if(e.length>r9)return b6(e.length);let t,n=this.textDirectionAt(e.from);for(let r of this.bidiCache)if(r.from==e.from&&r.dir==n&&(r.fresh||f6(r.isolates,t=q8(this,e.from,e.to))))return r.order;t||(t=q8(this,e.from,e.to));let o=function(e,t,n){if(!e)return[new h6(0,0,t==l6?1:0)];if(t==i6&&!n.length&&!p6.test(e))return b6(e.length);if(n.length)for(;e.length>g6.length;)g6[g6.length]=256;let o=[],r=t==i6?0:1;return v6(e,r,r,n,0,e.length,o),o}(e.text,n,t);return this.bidiCache.push(new l9(e.from,e.to,n,t,!0,o)),o}get hasFocus(){var e;return(this.dom.ownerDocument.hasFocus()||r8.safari&&(null===(e=this.inputState)||void 0===e?void 0:e.lastContextMenu)>Date.now()-3e4)&&this.root.activeElement==this.contentDOM}focus(){this.observer.ignore((()=>{z5(this.contentDOM),this.docView.updateSelection()}))}setRoot(e){this._root!=e&&(this._root=e,this.observer.setWindow((9==e.nodeType?e:e.ownerDocument).defaultView||window),this.mountStyles())}destroy(){for(let e of this.plugins)e.destroy(this);this.plugins=[],this.inputState.destroy(),this.docView.destroy(),this.dom.remove(),this.observer.destroy(),this.measureScheduled>-1&&this.win.cancelAnimationFrame(this.measureScheduled),this.destroyed=!0}static scrollIntoView(e,t={}){return Q8.of(new _8("number"==typeof e?q3.cursor(e):e,t.y,t.x,t.yMargin,t.xMargin))}scrollSnapshot(){let{scrollTop:e,scrollLeft:t}=this.scrollDOM,n=this.viewState.scrollAnchorAt(e);return Q8.of(new _8(q3.cursor(n.from),"start","start",n.top-e,t,!0))}static domEventHandlers(e){return X8.define((()=>({})),{eventHandlers:e})}static domEventObservers(e){return X8.define((()=>({})),{eventObservers:e})}static theme(e,t){let n=p5.newName(),o=[N7.of(n),t6.of(W7(`.${n}`,e))];return t&&t.dark&&o.push(_7.of(!0)),o}static baseTheme(e){return f4.lowest(t6.of(W7("."+Q7,e,F7)))}static findFromDOM(e){var t;let n=e.querySelector(".cm-content"),o=n&&H5.get(n)||H5.get(e);return(null===(t=null==o?void 0:o.rootView)||void 0===t?void 0:t.view)||null}}o9.styleModule=t6,o9.inputHandler=z8,o9.focusChangeEffect=B8,o9.perLineTextDirection=j8,o9.exceptionSink=D8,o9.updateListener=R8,o9.editable=H8,o9.mouseSelectionStyle=A8,o9.dragMovesSelection=E8,o9.clickAddsSelectionRange=I8,o9.decorations=U8,o9.atomicRanges=K8,o9.bidiIsolatedRanges=G8,o9.scrollMargins=J8,o9.darkTheme=_7,o9.cspNonce=t4.define({combine:e=>e.length?e[0]:""}),o9.contentAttributes=Z8,o9.editorAttributes=V8,o9.lineWrapping=o9.contentAttributes.of({class:"cm-lineWrapping"}),o9.announce=E4.define();const r9=4096,i9={};class l9{constructor(e,t,n,o,r,i){this.from=e,this.to=t,this.dir=n,this.isolates=o,this.fresh=r,this.order=i}static update(e,t){if(t.empty&&!e.some((e=>e.fresh)))return e;let n=[],o=e.length?e[e.length-1].dir:r6.LTR;for(let r=Math.max(0,e.length-10);r=0;r--){let t=o[r],i="function"==typeof t?t(e):t;i&&p8(i,n)}return n}const s9=r8.mac?"mac":r8.windows?"win":r8.linux?"linux":"key";function c9(e,t,n){return t.altKey&&(e="Alt-"+e),t.ctrlKey&&(e="Ctrl-"+e),t.metaKey&&(e="Meta-"+e),!1!==n&&t.shiftKey&&(e="Shift-"+e),e}const u9=f4.default(o9.domEventHandlers({keydown:(e,t)=>g9(h9(t.state),e,t,"editor")})),d9=t4.define({enables:u9}),p9=new WeakMap;function h9(e){let t=e.facet(d9),n=p9.get(t);return n||p9.set(t,n=function(e,t=s9){let n=Object.create(null),o=Object.create(null),r=(e,t)=>{let n=o[e];if(null==n)o[e]=t;else if(n!=t)throw new Error("Key binding "+e+" is used both as a regular binding and as a multi-stroke prefix")},i=(e,o,i,l,a)=>{var s,c;let u=n[e]||(n[e]=Object.create(null)),d=o.split(/ (?!$)/).map((e=>function(e,t){const n=e.split(/-(?!$)/);let o,r,i,l,a=n[n.length-1];"Space"==a&&(a=" ");for(let s=0;s{let o=f9={view:t,prefix:n,scope:e};return setTimeout((()=>{f9==o&&(f9=null)}),4e3),!0}]})}let p=d.join(" ");r(p,!1);let h=u[p]||(u[p]={preventDefault:!1,stopPropagation:!1,run:(null===(c=null===(s=u._any)||void 0===s?void 0:s.run)||void 0===c?void 0:c.slice())||[]});i&&h.run.push(i),l&&(h.preventDefault=!0),a&&(h.stopPropagation=!0)};for(let l of e){let e=l.scope?l.scope.split(" "):["editor"];if(l.any)for(let t of e){let e=n[t]||(n[t]=Object.create(null));e._any||(e._any={preventDefault:!1,stopPropagation:!1,run:[]});for(let t in e)e[t].run.push(l.any)}let o=l[t]||l.key;if(o)for(let t of e)i(t,o,l.run,l.preventDefault,l.stopPropagation),l.shift&&i(t,"Shift-"+o,l.shift,l.preventDefault,l.stopPropagation)}return n}(t.reduce(((e,t)=>e.concat(t)),[]))),n}let f9=null;function g9(e,t,n,o){let r=function(e){var t=!(v5&&e.metaKey&&e.shiftKey&&!e.ctrlKey&&!e.altKey||b5&&e.shiftKey&&e.key&&1==e.key.length||"Unidentified"==e.key)&&e.key||(e.shiftKey?m5:g5)[e.keyCode]||e.key||"Unidentified";return"Esc"==t&&(t="Escape"),"Del"==t&&(t="Delete"),"Left"==t&&(t="ArrowLeft"),"Up"==t&&(t="ArrowUp"),"Right"==t&&(t="ArrowRight"),"Down"==t&&(t="ArrowDown"),t}(t),i=Q3(N3(r,0))==r.length&&" "!=r,l="",a=!1,s=!1,c=!1;f9&&f9.view==n&&f9.scope==o&&(l=f9.prefix+" ",F6.indexOf(t.keyCode)<0&&(s=!0,f9=null));let u,d,p=new Set,h=e=>{if(e){for(let o of e.run)if(!p.has(o)&&(p.add(o),o(n,t)))return e.stopPropagation&&(c=!0),!0;e.preventDefault&&(e.stopPropagation&&(c=!0),s=!0)}return!1},f=e[o];return f&&(h(f[l+c9(r,t,!i)])?a=!0:i&&(t.altKey||t.metaKey||t.ctrlKey)&&!(r8.windows&&t.ctrlKey&&t.altKey)&&(u=g5[t.keyCode])&&u!=r?(h(f[l+c9(u,t,!0)])||t.shiftKey&&(d=m5[t.keyCode])!=r&&d!=u&&h(f[l+c9(d,t,!1)]))&&(a=!0):i&&t.shiftKey&&h(f[l+c9(r,t,!0)])&&(a=!0),!a&&h(f._any)&&(a=!0)),s&&(a=!0),a&&c&&t.stopPropagation(),a}class m9{constructor(e,t,n,o,r){this.className=e,this.left=t,this.top=n,this.width=o,this.height=r}draw(){let e=document.createElement("div");return e.className=this.className,this.adjust(e),e}update(e,t){return t.className==this.className&&(this.adjust(e),!0)}adjust(e){e.style.left=this.left+"px",e.style.top=this.top+"px",null!=this.width&&(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,n){if(n.empty){let o=e.coordsAtPos(n.head,n.assoc||1);if(!o)return[];let r=v9(e);return[new m9(t,o.left-r.left,o.top-r.top,null,o.bottom-o.top)]}return function(e,t,n){if(n.to<=e.viewport.from||n.from>=e.viewport.to)return[];let o=Math.max(n.from,e.viewport.from),r=Math.min(n.to,e.viewport.to),i=e.textDirection==r6.LTR,l=e.contentDOM,a=l.getBoundingClientRect(),s=v9(e),c=l.querySelector(".cm-line"),u=c&&window.getComputedStyle(c),d=a.left+(u?parseInt(u.paddingLeft)+Math.min(0,parseInt(u.textIndent)):0),p=a.right-(u?parseInt(u.paddingRight):0),h=z6(e,o),f=z6(e,r),g=h.type==O8.Text?h:null,m=f.type==O8.Text?f:null;if(g&&(e.lineWrapping||h.widgetLineBreaks)&&(g=b9(e,o,g)),m&&(e.lineWrapping||f.widgetLineBreaks)&&(m=b9(e,r,m)),g&&m&&g.from==m.from)return b(y(n.from,n.to,g));{let t=g?y(n.from,null,g):O(h,!1),o=m?y(null,n.to,m):O(f,!0),r=[];return(g||h).to<(m||f).from-(g&&m?1:0)||h.widgetLineBreaks>1&&t.bottom+e.defaultLineHeight/2c&&i.from=r)break;a>o&&s(Math.max(e,o),null==t&&e<=c,Math.min(a,r),null==n&&a>=u,l.dir)}if(o=i.to+1,o>=r)break}return 0==a.length&&s(c,null==t,u,null==n,e.textDirection),{top:r,bottom:l,horizontal:a}}function O(e,t){let n=a.top+(t?e.top:e.bottom);return{top:n,bottom:n,horizontal:[]}}}(e,t,n)}}function v9(e){let t=e.scrollDOM.getBoundingClientRect();return{left:(e.textDirection==r6.LTR?t.left:t.right-e.scrollDOM.clientWidth*e.scaleX)-e.scrollDOM.scrollLeft*e.scaleX,top:t.top-e.scrollDOM.scrollTop*e.scaleY}}function b9(e,t,n){let o=q3.cursor(t);return{from:Math.max(n.from,e.moveToLineBoundary(o,!1,!0).from),to:Math.min(n.to,e.moveToLineBoundary(o,!0,!0).from),type:O8.Text}}class y9{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(O9)!=e.state.facet(O9)&&this.setOrder(e.state),(this.layer.update(e,this.dom)||e.geometryChanged)&&(this.scale(),e.view.requestMeasure(this.measureReq))}setOrder(e){let t=0,n=e.facet(O9);for(;t{return n=e,o=this.drawn[t],!(n.constructor==o.constructor&&n.eq(o));var n,o}))){let t=this.dom.firstChild,n=0;for(let o of e)o.update&&t&&o.constructor&&this.drawn[n].constructor&&o.update(t,this.drawn[n])?(t=t.nextSibling,n++):this.dom.insertBefore(o.draw(),t);for(;t;){let e=t.nextSibling;t.remove(),t=e}this.drawn=e}}destroy(){this.layer.destroy&&this.layer.destroy(this.dom,this.view),this.dom.remove()}}const O9=t4.define();function w9(e){return[X8.define((t=>new y9(t,e))),O9.of(e)]}const S9=!r8.ios,x9=t4.define({combine:e=>W4(e,{cursorBlinkRate:1200,drawRangeCursor:!0},{cursorBlinkRate:(e,t)=>Math.min(e,t),drawRangeCursor:(e,t)=>e||t})});function $9(e={}){return[x9.of(e),k9,T9,I9,N8.of(!0)]}function C9(e){return e.startState.facet(x9)!=e.state.facet(x9)}const k9=w9({above:!0,markers(e){let{state:t}=e,n=t.facet(x9),o=[];for(let r of t.selection.ranges){let i=r==t.selection.main;if(r.empty?!i||S9:n.drawRangeCursor){let t=i?"cm-cursor cm-cursor-primary":"cm-cursor cm-cursor-secondary",n=r.empty?r:q3.cursor(r.head,r.head>r.anchor?-1:1);for(let r of m9.forRange(e,t,n))o.push(r)}}return o},update(e,t){e.transactions.some((e=>e.selection))&&(t.style.animationName="cm-blink"==t.style.animationName?"cm-blink2":"cm-blink");let n=C9(e);return n&&P9(e.state,t),e.docChanged||e.selectionSet||n},mount(e,t){P9(t.state,e)},class:"cm-cursorLayer"});function P9(e,t){t.style.animationDuration=e.facet(x9).cursorBlinkRate+"ms"}const T9=w9({above:!1,markers:e=>e.state.selection.ranges.map((t=>t.empty?[]:m9.forRange(e,"cm-selectionBackground",t))).reduce(((e,t)=>e.concat(t))),update:(e,t)=>e.docChanged||e.selectionSet||e.viewportChanged||C9(e),class:"cm-selectionLayer"}),M9={".cm-line":{"& ::selection":{backgroundColor:"transparent !important"},"&::selection":{backgroundColor:"transparent !important"}}};S9&&(M9[".cm-line"].caretColor="transparent !important",M9[".cm-content"]={caretColor:"transparent !important"});const I9=f4.highest(o9.theme(M9)),E9=E4.define({map:(e,t)=>null==e?null:t.mapPos(e)}),A9=s4.define({create:()=>null,update:(e,t)=>(null!=e&&(e=t.changes.mapPos(e)),t.effects.reduce(((e,t)=>t.is(E9)?t.value:e),e))}),D9=X8.fromClass(class{constructor(e){this.view=e,this.cursor=null,this.measureReq={read:this.readPos.bind(this),write:this.drawCursor.bind(this)}}update(e){var t;let n=e.state.field(A9);null==n?null!=this.cursor&&(null===(t=this.cursor)||void 0===t||t.remove(),this.cursor=null):(this.cursor||(this.cursor=this.view.scrollDOM.appendChild(document.createElement("div")),this.cursor.className="cm-dropCursor"),(e.startState.field(A9)!=n||e.docChanged||e.geometryChanged)&&this.view.requestMeasure(this.measureReq))}readPos(){let{view:e}=this,t=e.state.field(A9),n=null!=t&&e.coordsAtPos(t);if(!n)return null;let o=e.scrollDOM.getBoundingClientRect();return{left:n.left-o.left+e.scrollDOM.scrollLeft*e.scaleX,top:n.top-o.top+e.scrollDOM.scrollTop*e.scaleY,height:n.bottom-n.top}}drawCursor(e){if(this.cursor){let{scaleX:t,scaleY:n}=this.view;e?(this.cursor.style.left=e.left/t+"px",this.cursor.style.top=e.top/n+"px",this.cursor.style.height=e.height/n+"px"):this.cursor.style.left="-100000px"}}destroy(){this.cursor&&this.cursor.remove()}setDropPos(e){this.view.state.field(A9)!=e&&this.view.dispatch({effects:E9.of(e)})}},{eventObservers:{dragover(e){this.setDropPos(this.view.posAtCoords({x:e.clientX,y:e.clientY}))},dragleave(e){e.target!=this.view.contentDOM&&this.view.contentDOM.contains(e.relatedTarget)||this.setDropPos(null)},dragend(){this.setDropPos(null)},drop(){this.setDropPos(null)}}});function R9(e,t,n,o,r){t.lastIndex=0;for(let i,l=e.iterRange(n,o),a=n;!l.next().done;a+=l.value.length)if(!l.lineBreak)for(;i=t.exec(l.value);)r(a+i.index,i)}class z9{constructor(e){const{regexp:t,decoration:n,decorate:o,boundary:r,maxLength:i=1e3}=e;if(!t.global)throw new RangeError("The regular expression given to MatchDecorator should have its 'g' flag set");if(this.regexp=t,o)this.addMatch=(e,t,n,r)=>o(r,n,n+e[0].length,e,t);else if("function"==typeof n)this.addMatch=(e,t,o,r)=>{let i=n(e,t,o);i&&r(o,o+e[0].length,i)};else{if(!n)throw new RangeError("Either 'decorate' or 'decoration' should be provided to MatchDecorator");this.addMatch=(e,t,o,r)=>r(o,o+e[0].length,n)}this.boundary=r,this.maxLength=i}createDeco(e){let t=new K4,n=t.add.bind(t);for(let{from:o,to:r}of function(e,t){let n=e.visibleRanges;if(1==n.length&&n[0].from==e.viewport.from&&n[0].to==e.viewport.to)return n;let o=[];for(let{from:r,to:i}of n)r=Math.max(e.state.doc.lineAt(r).from,r-t),i=Math.min(e.state.doc.lineAt(i).to,i+t),o.length&&o[o.length-1].to>=r?o[o.length-1].to=i:o.push({from:r,to:i});return o}(e,this.maxLength))R9(e.state.doc,this.regexp,o,r,((t,o)=>this.addMatch(o,e,t,n)));return t.finish()}updateDeco(e,t){let n=1e9,o=-1;return e.docChanged&&e.changes.iterChanges(((t,r,i,l)=>{l>e.view.viewport.from&&i1e3?this.createDeco(e.view):o>-1?this.updateRange(e.view,t.map(e.changes),n,o):t}updateRange(e,t,n,o){for(let r of e.visibleRanges){let i=Math.max(r.from,n),l=Math.min(r.to,o);if(l>i){let n=e.state.doc.lineAt(i),o=n.ton.from;i--)if(this.boundary.test(n.text[i-1-n.from])){a=i;break}for(;lu.push(n.range(e,t));if(n==o)for(this.regexp.lastIndex=a-n.from;(c=this.regexp.exec(n.text))&&c.indexthis.addMatch(n,e,t,d)));t=t.update({filterFrom:a,filterTo:s,filter:(e,t)=>es,add:u})}}return t}}const B9=null!=/x/.unicode?"gu":"g",j9=new RegExp("[\0-\b\n--Ÿ­؜​‎‏\u2028\u2029‭‮⁦⁧⁩\ufeff-]",B9),N9={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 _9=null;const Q9=t4.define({combine(e){let t=W4(e,{render:null,specialChars:j9,addSpecialChars:null});return(t.replaceTabs=!function(){var e;if(null==_9&&"undefined"!=typeof document&&document.body){let t=document.body.style;_9=null!=(null!==(e=t.tabSize)&&void 0!==e?e:t.MozTabSize)}return _9||!1}())&&(t.specialChars=new RegExp("\t|"+t.specialChars.source,B9)),t.addSpecialChars&&(t.specialChars=new RegExp(t.specialChars.source+"|"+t.addSpecialChars.source,B9)),t}});function L9(e={}){return[Q9.of(e),H9||(H9=X8.fromClass(class{constructor(e){this.view=e,this.decorations=w8.none,this.decorationCache=Object.create(null),this.decorator=this.makeDecorator(e.state.facet(Q9)),this.decorations=this.decorator.createDeco(e)}makeDecorator(e){return new z9({regexp:e.specialChars,decoration:(t,n,o)=>{let{doc:r}=n.state,i=N3(t[0],0);if(9==i){let e=r.lineAt(o),t=n.state.tabSize,i=a5(e.text,t,o-e.from);return w8.replace({widget:new W9((t-i%t)*this.view.defaultCharacterWidth/this.view.scaleX)})}return this.decorationCache[i]||(this.decorationCache[i]=w8.replace({widget:new F9(e,i)}))},boundary:e.replaceTabs?void 0:/[^]/})}update(e){let t=e.state.facet(Q9);e.startState.facet(Q9)!=t?(this.decorator=this.makeDecorator(t),this.decorations=this.decorator.createDeco(e.view)):this.decorations=this.decorator.updateDeco(e,this.decorations)}},{decorations:e=>e.decorations}))]}let H9=null;class F9 extends y8{constructor(e,t){super(),this.options=e,this.code=t}eq(e){return e.code==this.code}toDOM(e){let t=(n=this.code)>=32?"•":10==n?"␤":String.fromCharCode(9216+n);var n;let o=e.state.phrase("Control character")+" "+(N9[this.code]||"0x"+this.code.toString(16)),r=this.options.render&&this.options.render(this.code,o,t);if(r)return r;let i=document.createElement("span");return i.textContent=t,i.title=o,i.setAttribute("aria-label",o),i.className="cm-specialChar",i}ignoreEvent(){return!1}}class W9 extends y8{constructor(e){super(),this.width=e}eq(e){return e.width==this.width}toDOM(){let e=document.createElement("span");return e.textContent="\t",e.className="cm-tab",e.style.width=this.width+"px",e}ignoreEvent(){return!1}}const X9=w8.line({class:"cm-activeLine"}),Y9=X8.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.docChanged||e.selectionSet)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=-1,n=[];for(let o of e.state.selection.ranges){let r=e.lineBlockAt(o.head);r.from>t&&(n.push(X9.range(r.from)),t=r.from)}return w8.set(n)}},{decorations:e=>e.decorations});class V9 extends y8{constructor(e){super(),this.content=e}toDOM(){let e=document.createElement("span");return e.className="cm-placeholder",e.style.pointerEvents="none",e.appendChild("string"==typeof this.content?document.createTextNode(this.content):this.content),"string"==typeof this.content?e.setAttribute("aria-label","placeholder "+this.content):e.setAttribute("aria-hidden","true"),e}coordsAt(e){let t=e.firstChild?$5(e.firstChild):[];if(!t.length)return null;let n=window.getComputedStyle(e.parentNode),o=M5(t[0],"rtl"!=n.direction),r=parseInt(n.lineHeight);return o.bottom-o.top>1.5*r?{left:o.left,right:o.right,top:o.top,bottom:o.top+r}:o}ignoreEvent(){return!1}}const Z9=2e3;function U9(e,t){let n=e.posAtCoords({x:t.clientX,y:t.clientY},!1),o=e.state.doc.lineAt(n),r=n-o.from,i=r>Z9?-1:r==o.length?function(e,t){let n=e.coordsAtPos(e.viewport.from);return n?Math.round(Math.abs((n.left-t)/e.defaultCharacterWidth)):-1}(e,t.clientX):a5(o.text,e.state.tabSize,n-o.from);return{line:o.number,col:i,off:r}}function K9(e,t){let n=U9(e,t),o=e.state.selection;return n?{update(e){if(e.docChanged){let t=e.changes.mapPos(e.startState.doc.line(n.line).from),r=e.state.doc.lineAt(t);n={line:r.number,col:n.col,off:Math.min(n.off,r.length)},o=o.map(e.changes)}},get(t,r,i){let l=U9(e,t);if(!l)return o;let a=function(e,t,n){let o=Math.min(t.line,n.line),r=Math.max(t.line,n.line),i=[];if(t.off>Z9||n.off>Z9||t.col<0||n.col<0){let l=Math.min(t.off,n.off),a=Math.max(t.off,n.off);for(let t=o;t<=r;t++){let n=e.doc.line(t);n.length<=a&&i.push(q3.range(n.from+l,n.to+a))}}else{let l=Math.min(t.col,n.col),a=Math.max(t.col,n.col);for(let t=o;t<=r;t++){let n=e.doc.line(t),o=s5(n.text,l,e.tabSize,!0);if(o<0)i.push(q3.cursor(n.to));else{let t=s5(n.text,a,e.tabSize);i.push(q3.range(n.from+o,n.from+t))}}}return i}(e.state,n,l);return a.length?i?q3.create(a.concat(o.ranges)):q3.create(a):o}}:null}function G9(e){let t=(null==e?void 0:e.eventFilter)||(e=>e.altKey&&0==e.button);return o9.mouseSelectionStyle.of(((e,n)=>t(n)?K9(e,n):null))}const q9={Alt:[18,e=>!!e.altKey],Control:[17,e=>!!e.ctrlKey],Shift:[16,e=>!!e.shiftKey],Meta:[91,e=>!!e.metaKey]},J9={style:"cursor: crosshair"};function eee(e={}){let[t,n]=q9[e.key||"Alt"],o=X8.fromClass(class{constructor(e){this.view=e,this.isDown=!1}set(e){this.isDown!=e&&(this.isDown=e,this.view.update([]))}},{eventObservers:{keydown(e){this.set(e.keyCode==t||n(e))},keyup(e){e.keyCode!=t&&n(e)||this.set(!1)},mousemove(e){this.set(n(e))}}});return[o,o9.contentAttributes.of((e=>{var t;return(null===(t=e.plugin(o))||void 0===t?void 0:t.isDown)?J9:null}))]}const tee="-10000px";class nee{constructor(e,t,n){this.facet=t,this.createTooltipView=n,this.input=e.state.facet(t),this.tooltips=this.input.filter((e=>e)),this.tooltipViews=this.tooltips.map(n)}update(e,t){var n;let o=e.state.facet(this.facet),r=o.filter((e=>e));if(o===this.input){for(let t of this.tooltipViews)t.update&&t.update(e);return!1}let i=[],l=t?[]:null;for(let a=0;at[n]=e)),t.length=l.length),this.input=o,this.tooltips=r,this.tooltipViews=i,!0}}function oee(e){let{win:t}=e;return{top:0,left:0,bottom:t.innerHeight,right:t.innerWidth}}const ree=t4.define({combine:e=>{var t,n,o;return{position:r8.ios?"absolute":(null===(t=e.find((e=>e.position)))||void 0===t?void 0:t.position)||"fixed",parent:(null===(n=e.find((e=>e.parent)))||void 0===n?void 0:n.parent)||null,tooltipSpace:(null===(o=e.find((e=>e.tooltipSpace)))||void 0===o?void 0:o.tooltipSpace)||oee}}}),iee=new WeakMap,lee=X8.fromClass(class{constructor(e){this.view=e,this.above=[],this.inView=!0,this.madeAbsolute=!1,this.lastTransaction=0,this.measureTimeout=-1;let t=e.state.facet(ree);this.position=t.position,this.parent=t.parent,this.classes=e.themeClasses,this.createContainer(),this.measureReq={read:this.readMeasure.bind(this),write:this.writeMeasure.bind(this),key:this},this.manager=new nee(e,cee,(e=>this.createTooltip(e))),this.intersectionObserver="function"==typeof IntersectionObserver?new IntersectionObserver((e=>{Date.now()>this.lastTransaction-50&&e.length>0&&e[e.length-1].intersectionRatio<1&&this.measureSoon()}),{threshold:[1]}):null,this.observeIntersection(),e.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 e of this.manager.tooltipViews)this.intersectionObserver.observe(e.dom)}}measureSoon(){this.measureTimeout<0&&(this.measureTimeout=setTimeout((()=>{this.measureTimeout=-1,this.maybeMeasure()}),50))}update(e){e.transactions.length&&(this.lastTransaction=Date.now());let t=this.manager.update(e,this.above);t&&this.observeIntersection();let n=t||e.geometryChanged,o=e.state.facet(ree);if(o.position!=this.position&&!this.madeAbsolute){this.position=o.position;for(let e of this.manager.tooltipViews)e.dom.style.position=this.position;n=!0}if(o.parent!=this.parent){this.parent&&this.container.remove(),this.parent=o.parent,this.createContainer();for(let e of this.manager.tooltipViews)this.container.appendChild(e.dom);n=!0}else this.parent&&this.view.themeClasses!=this.classes&&(this.classes=this.container.className=this.view.themeClasses);n&&this.maybeMeasure()}createTooltip(e){let t=e.create(this.view);if(t.dom.classList.add("cm-tooltip"),e.arrow&&!t.dom.querySelector(".cm-tooltip > .cm-tooltip-arrow")){let e=document.createElement("div");e.className="cm-tooltip-arrow",t.dom.appendChild(e)}return t.dom.style.position=this.position,t.dom.style.top=tee,t.dom.style.left="0px",this.container.appendChild(t.dom),t.mount&&t.mount(this.view),t}destroy(){var e,t;this.view.win.removeEventListener("resize",this.measureSoon);for(let n of this.manager.tooltipViews)n.dom.remove(),null===(e=n.destroy)||void 0===e||e.call(n);this.parent&&this.container.remove(),null===(t=this.intersectionObserver)||void 0===t||t.disconnect(),clearTimeout(this.measureTimeout)}readMeasure(){let e=this.view.dom.getBoundingClientRect(),t=1,n=1,o=!1;if("fixed"==this.position&&this.manager.tooltipViews.length){let{dom:e}=this.manager.tooltipViews[0];if(r8.gecko)o=e.offsetParent!=this.container.ownerDocument.body;else if(e.style.top==tee&&"0px"==e.style.left){let t=e.getBoundingClientRect();o=Math.abs(t.top+1e4)>1||Math.abs(t.left)>1}}if(o||"absolute"==this.position)if(this.parent){let e=this.parent.getBoundingClientRect();e.width&&e.height&&(t=e.width/this.parent.offsetWidth,n=e.height/this.parent.offsetHeight)}else({scaleX:t,scaleY:n}=this.view.viewState);return{editor:e,parent:this.parent?this.container.getBoundingClientRect():e,pos:this.manager.tooltips.map(((e,t)=>{let n=this.manager.tooltipViews[t];return n.getCoords?n.getCoords(e.pos):this.view.coordsAtPos(e.pos)})),size:this.manager.tooltipViews.map((({dom:e})=>e.getBoundingClientRect())),space:this.view.state.facet(ree).tooltipSpace(this.view),scaleX:t,scaleY:n,makeAbsolute:o}}writeMeasure(e){var t;if(e.makeAbsolute){this.madeAbsolute=!0,this.position="absolute";for(let e of this.manager.tooltipViews)e.dom.style.position="absolute"}let{editor:n,space:o,scaleX:r,scaleY:i}=e,l=[];for(let a=0;a=Math.min(n.bottom,o.bottom)||d.rightMath.min(n.right,o.right)+.1){u.style.top=tee;continue}let h=s.arrow?c.dom.querySelector(".cm-tooltip-arrow"):null,f=h?7:0,g=p.right-p.left,m=null!==(t=iee.get(c))&&void 0!==t?t:p.bottom-p.top,v=c.offset||see,b=this.view.textDirection==r6.LTR,y=p.width>o.right-o.left?b?o.left:o.right-p.width:b?Math.min(d.left-(h?14:0)+v.x,o.right-g):Math.max(o.left,d.left-g+(h?14:0)-v.x),O=this.above[a];!s.strictSide&&(O?d.top-(p.bottom-p.top)-v.yo.bottom)&&O==o.bottom-d.bottom>d.top-o.top&&(O=this.above[a]=!O);let w=(O?d.top-o.top:o.bottom-d.bottom)-f;if(wy&&e.topS&&(S=O?e.top-m-2-f:e.bottom+f+2);if("absolute"==this.position?(u.style.top=(S-e.parent.top)/i+"px",u.style.left=(y-e.parent.left)/r+"px"):(u.style.top=S/i+"px",u.style.left=y/r+"px"),h){let e=d.left+(b?v.x:-v.x)-(y+14-7);h.style.left=e/r+"px"}!0!==c.overlap&&l.push({left:y,top:S,right:x,bottom:S+m}),u.classList.toggle("cm-tooltip-above",O),u.classList.toggle("cm-tooltip-below",!O),c.positioned&&c.positioned(e.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 e of this.manager.tooltipViews)e.dom.style.top=tee}},{eventObservers:{scroll(){this.maybeMeasure()}}}),aee=o9.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:"14px",position:"absolute",zIndex:-1,overflow:"hidden","&:before, &:after":{content:"''",position:"absolute",width:0,height:0,borderLeft:"7px solid transparent",borderRight:"7px solid transparent"},".cm-tooltip-above &":{bottom:"-7px","&:before":{borderTop:"7px solid #bbb"},"&:after":{borderTop:"7px solid #f5f5f5",bottom:"1px"}},".cm-tooltip-below &":{top:"-7px","&:before":{borderBottom:"7px solid #bbb"},"&:after":{borderBottom:"7px solid #f5f5f5",top:"1px"}}},"&dark .cm-tooltip .cm-tooltip-arrow":{"&:before":{borderTopColor:"#333338",borderBottomColor:"#333338"},"&:after":{borderTopColor:"transparent",borderBottomColor:"transparent"}}}),see={x:0,y:0},cee=t4.define({enables:[lee,aee]}),uee=t4.define();class dee{static create(e){return new dee(e)}constructor(e){this.view=e,this.mounted=!1,this.dom=document.createElement("div"),this.dom.classList.add("cm-tooltip-hover"),this.manager=new nee(e,uee,(e=>this.createHostedView(e)))}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)null===(e=t.destroy)||void 0===e||e.call(t)}passProp(e){let t;for(let n of this.manager.tooltipViews){let o=n[e];if(void 0!==o)if(void 0===t)t=o;else if(t!==o)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 pee=cee.compute([uee],(e=>{let t=e.facet(uee).filter((e=>e));return 0===t.length?null:{pos:Math.min(...t.map((e=>e.pos))),end:Math.max(...t.map((e=>{var t;return null!==(t=e.end)&&void 0!==t?t:e.pos}))),create:dee.create,above:t[0].above,arrow:t.some((e=>e.arrow))}}));class hee{constructor(e,t,n,o,r){this.view=e,this.source=t,this.field=n,this.setHover=o,this.hoverTime=r,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;en.bottom||t.xn.right+e.defaultCharacterWidth)return;let i=e.bidiSpans(e.state.doc.lineAt(o)).find((e=>e.from<=o&&e.to>=o)),l=i&&i.dir==r6.RTL?-1:1;r=t.x{this.pending==t&&(this.pending=null,n&&e.dispatch({effects:this.setHover.of(n)}))}),(t=>L8(e.state,t,"hover tooltip")))}else i&&e.dispatch({effects:this.setHover.of(i)})}get tooltip(){let e=this.view.plugin(lee),t=e?e.manager.tooltips.findIndex((e=>e.create==dee.create)):-1;return t>-1?e.manager.tooltipViews[t]:null}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{active:n,tooltip:o}=this;if(n&&o&&!function(e,t){let n=e.getBoundingClientRect();return t.clientX>=n.left-4&&t.clientX<=n.right+4&&t.clientY>=n.top-4&&t.clientY<=n.bottom+4}(o.dom,e)||this.pending){let{pos:o}=n||this.pending,r=null!==(t=null==n?void 0:n.end)&&void 0!==t?t:o;(o==r?this.view.posAtCoords(this.lastMove)==o:function(e,t,n,o,r,i){let l=e.scrollDOM.getBoundingClientRect(),a=e.documentTop+e.documentPadding.top+e.contentHeight;if(l.left>o||l.rightr||Math.min(l.bottom,a)=t&&s<=n}(this.view,o,r,e.clientX,e.clientY))||(this.view.dispatch({effects:this.setHover.of(null)}),this.pending=null)}}mouseleave(e){clearTimeout(this.hoverTimeout),this.hoverTimeout=-1;let{active:t}=this;if(t){let{tooltip:t}=this;t&&t.dom.contains(e.relatedTarget)?this.watchTooltipLeave(t.dom):this.view.dispatch({effects:this.setHover.of(null)})}}watchTooltipLeave(e){let t=n=>{e.removeEventListener("mouseleave",t),this.active&&!this.view.dom.contains(n.relatedTarget)&&this.view.dispatch({effects:this.setHover.of(null)})};e.addEventListener("mouseleave",t)}destroy(){clearTimeout(this.hoverTimeout),this.view.dom.removeEventListener("mouseleave",this.mouseleave),this.view.dom.removeEventListener("mousemove",this.mousemove)}}function fee(e,t={}){let n=E4.define(),o=s4.define({create:()=>null,update(e,o){if(e&&(t.hideOnChange&&(o.docChanged||o.selection)||t.hideOn&&t.hideOn(o,e)))return null;if(e&&o.docChanged){let t=o.changes.mapPos(e.pos,-1,H3.TrackDel);if(null==t)return null;let n=Object.assign(Object.create(null),e);n.pos=t,null!=e.end&&(n.end=o.changes.mapPos(e.end)),e=n}for(let t of o.effects)t.is(n)&&(e=t.value),t.is(mee)&&(e=null);return e},provide:e=>uee.from(e)});return[o,X8.define((r=>new hee(r,e,o,n,t.hoverTime||300))),pee]}function gee(e,t){let n=e.plugin(lee);if(!n)return null;let o=n.manager.tooltips.indexOf(t);return o<0?null:n.manager.tooltipViews[o]}const mee=E4.define(),vee=t4.define({combine(e){let t,n;for(let o of e)t=t||o.topContainer,n=n||o.bottomContainer;return{topContainer:t,bottomContainer:n}}});function bee(e,t){let n=e.plugin(yee),o=n?n.specs.indexOf(t):-1;return o>-1?n.panels[o]:null}const yee=X8.fromClass(class{constructor(e){this.input=e.state.facet(See),this.specs=this.input.filter((e=>e)),this.panels=this.specs.map((t=>t(e)));let t=e.state.facet(vee);this.top=new Oee(e,!0,t.topContainer),this.bottom=new Oee(e,!1,t.bottomContainer),this.top.sync(this.panels.filter((e=>e.top))),this.bottom.sync(this.panels.filter((e=>!e.top)));for(let n of this.panels)n.dom.classList.add("cm-panel"),n.mount&&n.mount()}update(e){let t=e.state.facet(vee);this.top.container!=t.topContainer&&(this.top.sync([]),this.top=new Oee(e.view,!0,t.topContainer)),this.bottom.container!=t.bottomContainer&&(this.bottom.sync([]),this.bottom=new Oee(e.view,!1,t.bottomContainer)),this.top.syncClasses(),this.bottom.syncClasses();let n=e.state.facet(See);if(n!=this.input){let t=n.filter((e=>e)),o=[],r=[],i=[],l=[];for(let n of t){let t,a=this.specs.indexOf(n);a<0?(t=n(e.view),l.push(t)):(t=this.panels[a],t.update&&t.update(e)),o.push(t),(t.top?r:i).push(t)}this.specs=t,this.panels=o,this.top.sync(r),this.bottom.sync(i);for(let e of l)e.dom.classList.add("cm-panel"),e.mount&&e.mount()}else for(let o of this.panels)o.update&&o.update(e)}destroy(){this.top.sync([]),this.bottom.sync([])}},{provide:e=>o9.scrollMargins.of((t=>{let n=t.plugin(e);return n&&{top:n.top.scrollMargin(),bottom:n.bottom.scrollMargin()}}))});class Oee{constructor(e,t,n){this.view=e,this.top=t,this.container=n,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(0==this.panels.length)return void(this.dom&&(this.dom.remove(),this.dom=void 0));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 e=this.container||this.view.dom;e.insertBefore(this.dom,this.top?e.firstChild:null)}let e=this.dom.firstChild;for(let t of this.panels)if(t.dom.parentNode==this.dom){for(;e!=t.dom;)e=wee(e);e=e.nextSibling}else this.dom.insertBefore(t.dom,e);for(;e;)e=wee(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 wee(e){let t=e.nextSibling;return e.remove(),t}const See=t4.define({enables:yee});class xee extends X4{compare(e){return this==e||this.constructor==e.constructor&&this.eq(e)}eq(e){return!1}destroy(e){}}xee.prototype.elementClass="",xee.prototype.toDOM=void 0,xee.prototype.mapMode=H3.TrackBefore,xee.prototype.startSide=xee.prototype.endSide=-1,xee.prototype.point=!0;const $ee=t4.define(),Cee={class:"",renderEmptyElements:!1,elementStyle:"",markers:()=>U4.empty,lineMarker:()=>null,widgetMarker:()=>null,lineMarkerChange:null,initialSpacer:null,updateSpacer:null,domEventHandlers:{}},kee=t4.define();function Pee(e){return[Mee(),kee.of(Object.assign(Object.assign({},Cee),e))]}const Tee=t4.define({combine:e=>e.some((e=>e))});function Mee(e){let t=[Iee];return e&&!1===e.fixed&&t.push(Tee.of(!0)),t}const Iee=X8.fromClass(class{constructor(e){this.view=e,this.prevViewport=e.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=e.state.facet(kee).map((t=>new Ree(e,t)));for(let t of this.gutters)this.dom.appendChild(t.dom);this.fixed=!e.state.facet(Tee),this.fixed&&(this.dom.style.position="sticky"),this.syncGutters(!1),e.scrollDOM.insertBefore(this.dom,e.contentDOM)}update(e){if(this.updateGutters(e)){let t=this.prevViewport,n=e.view.viewport,o=Math.min(t.to,n.to)-Math.max(t.from,n.from);this.syncGutters(o<.8*(n.to-n.from))}e.geometryChanged&&(this.dom.style.minHeight=this.view.contentHeight+"px"),this.view.state.facet(Tee)!=!this.fixed&&(this.fixed=!this.fixed,this.dom.style.position=this.fixed?"sticky":""),this.prevViewport=e.view.viewport}syncGutters(e){let t=this.dom.nextSibling;e&&this.dom.remove();let n=U4.iter(this.view.state.facet($ee),this.view.viewport.from),o=[],r=this.gutters.map((e=>new Dee(e,this.view.viewport,-this.view.documentPadding.top)));for(let i of this.view.viewportLineBlocks)if(o.length&&(o=[]),Array.isArray(i.type)){let e=!0;for(let t of i.type)if(t.type==O8.Text&&e){Aee(n,o,t.from);for(let e of r)e.line(this.view,t,o);e=!1}else if(t.widget)for(let e of r)e.widget(this.view,t)}else if(i.type==O8.Text){Aee(n,o,i.from);for(let e of r)e.line(this.view,i,o)}else if(i.widget)for(let e of r)e.widget(this.view,i);for(let i of r)i.finish();e&&this.view.scrollDOM.insertBefore(this.dom,t)}updateGutters(e){let t=e.startState.facet(kee),n=e.state.facet(kee),o=e.docChanged||e.heightChanged||e.viewportChanged||!U4.eq(e.startState.facet($ee),e.state.facet($ee),e.view.viewport.from,e.view.viewport.to);if(t==n)for(let r of this.gutters)r.update(e)&&(o=!0);else{o=!0;let r=[];for(let o of n){let n=t.indexOf(o);n<0?r.push(new Ree(this.view,o)):(this.gutters[n].update(e),r.push(this.gutters[n]))}for(let e of this.gutters)e.dom.remove(),r.indexOf(e)<0&&e.destroy();for(let e of r)this.dom.appendChild(e.dom);this.gutters=r}return o}destroy(){for(let e of this.gutters)e.destroy();this.dom.remove()}},{provide:e=>o9.scrollMargins.of((t=>{let n=t.plugin(e);return n&&0!=n.gutters.length&&n.fixed?t.textDirection==r6.LTR?{left:n.dom.offsetWidth*t.scaleX}:{right:n.dom.offsetWidth*t.scaleX}:null}))});function Eee(e){return Array.isArray(e)?e:[e]}function Aee(e,t,n){for(;e.value&&e.from<=n;)e.from==n&&t.push(e.value),e.next()}class Dee{constructor(e,t,n){this.gutter=e,this.height=n,this.i=0,this.cursor=U4.iter(e.markers,t.from)}addElement(e,t,n){let{gutter:o}=this,r=(t.top-this.height)/e.scaleY,i=t.height/e.scaleY;if(this.i==o.elements.length){let t=new zee(e,i,r,n);o.elements.push(t),o.dom.appendChild(t.dom)}else o.elements[this.i].update(e,i,r,n);this.height=t.bottom,this.i++}line(e,t,n){let o=[];Aee(this.cursor,o,t.from),n.length&&(o=o.concat(n));let r=this.gutter.config.lineMarker(e,t,o);r&&o.unshift(r);let i=this.gutter;(0!=o.length||i.config.renderEmptyElements)&&this.addElement(e,t,o)}widget(e,t){let n=this.gutter.config.widgetMarker(e,t.widget,t);n&&this.addElement(e,t,[n])}finish(){let e=this.gutter;for(;e.elements.length>this.i;){let t=e.elements.pop();e.dom.removeChild(t.dom),t.destroy()}}}class Ree{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 n in t.domEventHandlers)this.dom.addEventListener(n,(o=>{let r,i=o.target;if(i!=this.dom&&this.dom.contains(i)){for(;i.parentNode!=this.dom;)i=i.parentNode;let e=i.getBoundingClientRect();r=(e.top+e.bottom)/2}else r=o.clientY;let l=e.lineBlockAtHeight(r-e.documentTop);t.domEventHandlers[n](e,l,o)&&o.preventDefault()}));this.markers=Eee(t.markers(e)),t.initialSpacer&&(this.spacer=new zee(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=Eee(this.config.markers(e.view)),this.spacer&&this.config.updateSpacer){let t=this.config.updateSpacer(this.spacer.markers[0],e);t!=this.spacer.markers[0]&&this.spacer.update(e.view,0,0,[t])}let n=e.view.viewport;return!U4.eq(this.markers,t,n.from,n.to)||!!this.config.lineMarkerChange&&this.config.lineMarkerChange(e)}destroy(){for(let e of this.elements)e.destroy()}}class zee{constructor(e,t,n,o){this.height=-1,this.above=0,this.markers=[],this.dom=document.createElement("div"),this.dom.className="cm-gutterElement",this.update(e,t,n,o)}update(e,t,n,o){this.height!=t&&(this.height=t,this.dom.style.height=t+"px"),this.above!=n&&(this.dom.style.marginTop=(this.above=n)?n+"px":""),function(e,t){if(e.length!=t.length)return!1;for(let n=0;nW4(e,{formatNumber:String,domEventHandlers:{}},{domEventHandlers(e,t){let n=Object.assign({},e);for(let o in t){let e=n[o],r=t[o];n[o]=e?(t,n,o)=>e(t,n,o)||r(t,n,o):r}return n}})});class Nee extends xee{constructor(e){super(),this.number=e}eq(e){return this.number==e.number}toDOM(){return document.createTextNode(this.number)}}function _ee(e,t){return e.state.facet(jee).formatNumber(t,e.state)}const Qee=kee.compute([jee],(e=>({class:"cm-lineNumbers",renderEmptyElements:!1,markers:e=>e.state.facet(Bee),lineMarker:(e,t,n)=>n.some((e=>e.toDOM))?null:new Nee(_ee(e,e.state.doc.lineAt(t.from).number)),widgetMarker:()=>null,lineMarkerChange:e=>e.startState.facet(jee)!=e.state.facet(jee),initialSpacer:e=>new Nee(_ee(e,Hee(e.state.doc.lines))),updateSpacer(e,t){let n=_ee(t.view,Hee(t.view.state.doc.lines));return n==e.number?e:new Nee(n)},domEventHandlers:e.facet(jee).domEventHandlers})));function Lee(e={}){return[jee.of(e),Mee(),Qee]}function Hee(e){let t=9;for(;t{let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.head).from;r>n&&(n=r,t.push(Fee.range(r)))}return U4.of(t)})),Xee=1024;let Yee=0,Vee=class{constructor(e,t){this.from=e,this.to=t}};class Zee{constructor(e={}){this.id=Yee++,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"function"!=typeof e&&(e=Gee.match(e)),t=>{let n=e(t);return void 0===n?null:[this,n]}}}Zee.closedBy=new Zee({deserialize:e=>e.split(" ")}),Zee.openedBy=new Zee({deserialize:e=>e.split(" ")}),Zee.group=new Zee({deserialize:e=>e.split(" ")}),Zee.contextHash=new Zee({perNode:!0}),Zee.lookAhead=new Zee({perNode:!0}),Zee.mounted=new Zee({perNode:!0});class Uee{constructor(e,t,n){this.tree=e,this.overlay=t,this.parser=n}static get(e){return e&&e.props&&e.props[Zee.mounted.id]}}const Kee=Object.create(null);class Gee{constructor(e,t,n,o=0){this.name=e,this.props=t,this.id=n,this.flags=o}static define(e){let t=e.props&&e.props.length?Object.create(null):Kee,n=(e.top?1:0)|(e.skipped?2:0)|(e.error?4:0)|(null==e.name?8:0),o=new Gee(e.name||"",t,e.id,n);if(e.props)for(let r of e.props)if(Array.isArray(r)||(r=r(o)),r){if(r[0].perNode)throw new RangeError("Can't store a per-node prop on a node type");t[r[0].id]=r[1]}return o}prop(e){return this.props[e.id]}get isTop(){return(1&this.flags)>0}get isSkipped(){return(2&this.flags)>0}get isError(){return(4&this.flags)>0}get isAnonymous(){return(8&this.flags)>0}is(e){if("string"==typeof e){if(this.name==e)return!0;let t=this.prop(Zee.group);return!!t&&t.indexOf(e)>-1}return this.id==e}static match(e){let t=Object.create(null);for(let n in e)for(let o of n.split(" "))t[o]=e[n];return e=>{for(let n=e.prop(Zee.group),o=-1;o<(n?n.length:0);o++){let r=t[o<0?e.name:n[o]];if(r)return r}}}}Gee.none=new Gee("",Object.create(null),0,8);class qee{constructor(e){this.types=e;for(let t=0;t=t){let l=new cte(e.tree,e.overlay[0].from+i.from,-1,i);(r||(r=[o])).push(ate(l,t,n,!1))}}return r?fte(r):o}(this,e,t)}iterate(e){let{enter:t,leave:n,from:o=0,to:r=this.length}=e,i=e.mode||0,l=(i&tte.IncludeAnonymous)>0;for(let a=this.cursor(i|tte.IncludeAnonymous);;){let e=!1;if(a.from<=r&&a.to>=o&&(!l&&a.type.isAnonymous||!1!==t(a))){if(a.firstChild())continue;e=!0}for(;e&&n&&(l||!a.type.isAnonymous)&&n(a),!a.nextSibling();){if(!a.parent())return;e=!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:Ote(Gee.none,this.children,this.positions,0,this.children.length,0,this.length,((e,t,n)=>new ote(this.type,e,t,n,this.propValues)),e.makeTree||((e,t,n)=>new ote(Gee.none,e,t,n)))}static build(e){return function(e){var t;let{buffer:n,nodeSet:o,maxBufferLength:r=Xee,reused:i=[],minRepeatType:l=o.types.length}=e,a=Array.isArray(n)?new rte(n,n.length):n,s=o.types,c=0,u=0;function d(e,t,n,b,y,O){let{id:w,start:S,end:x,size:$}=a,C=u;for(;$<0;){if(a.next(),-1==$){let t=i[w];return n.push(t),void b.push(S-e)}if(-3==$)return void(c=w);if(-4==$)return void(u=w);throw new RangeError(`Unrecognized record size: ${$}`)}let k,P,T=s[w],M=S-e;if(x-S<=r&&(P=m(a.pos-t,y))){let t=new Uint16Array(P.size-P.skip),n=a.pos-P.size,r=t.length;for(;a.pos>n;)r=v(P.start,t,r);k=new ite(t,x-P.start,o),M=P.start-e}else{let e=a.pos-$;a.next();let t=[],n=[],o=w>=l?w:-1,i=0,s=x;for(;a.pos>e;)o>=0&&a.id==o&&a.size>=0?(a.end<=s-r&&(f(t,n,S,i,a.end,s,o,C),i=t.length,s=a.end),a.next()):O>2500?p(S,e,t,n):d(S,e,t,n,o,O+1);if(o>=0&&i>0&&i-1&&i>0){let e=h(T);k=Ote(T,t,n,0,t.length,0,x-S,e,e)}else k=g(T,t,n,x-S,C-x)}n.push(k),b.push(M)}function p(e,t,n,i){let l=[],s=0,c=-1;for(;a.pos>t;){let{id:e,start:t,end:n,size:o}=a;if(o>4)a.next();else{if(c>-1&&t=0;e-=3)t[n++]=l[e],t[n++]=l[e+1]-r,t[n++]=l[e+2]-r,t[n++]=n;n.push(new ite(t,l[2]-r,o)),i.push(r-e)}}function h(e){return(t,n,o)=>{let r,i,l=0,a=t.length-1;if(a>=0&&(r=t[a])instanceof ote){if(!a&&r.type==e&&r.length==o)return r;(i=r.prop(Zee.lookAhead))&&(l=n[a]+r.length+i)}return g(e,t,n,o,l)}}function f(e,t,n,r,i,l,a,s){let c=[],u=[];for(;e.length>r;)c.push(e.pop()),u.push(t.pop()+n-i);e.push(g(o.types[a],c,u,l-i,s-l)),t.push(i-n)}function g(e,t,n,o,r=0,i){if(c){let e=[Zee.contextHash,c];i=i?[e].concat(i):[e]}if(r>25){let e=[Zee.lookAhead,r];i=i?[e].concat(i):[e]}return new ote(e,t,n,o,i)}function m(e,t){let n=a.fork(),o=0,i=0,s=0,c=n.end-r,u={size:0,start:0,skip:0};e:for(let r=n.pos-e;n.pos>r;){let e=n.size;if(n.id==t&&e>=0){u.size=o,u.start=i,u.skip=s,s+=4,o+=4,n.next();continue}let a=n.pos-e;if(e<0||a=l?4:0,p=n.start;for(n.next();n.pos>a;){if(n.size<0){if(-3!=n.size)break e;d+=4}else n.id>=l&&(d+=4);n.next()}i=p,o+=e,s+=d}return(t<0||o==e)&&(u.size=o,u.start=i,u.skip=s),u.size>4?u:void 0}function v(e,t,n){let{id:o,start:r,end:i,size:s}=a;if(a.next(),s>=0&&o4){let o=a.pos-(s-4);for(;a.pos>o;)n=v(e,t,n)}t[--n]=l,t[--n]=i-e,t[--n]=r-e,t[--n]=o}else-3==s?c=o:-4==s&&(u=o);return n}let b=[],y=[];for(;a.pos>0;)d(e.start||0,e.bufferStart||0,b,y,-1,0);let O=null!==(t=e.length)&&void 0!==t?t:b.length?y[0]+b[0].length:0;return new ote(s[e.topID],b.reverse(),y.reverse(),O)}(e)}}ote.empty=new ote(Gee.none,[],[],0);class rte{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 rte(this.buffer,this.index)}}class ite{constructor(e,t,n){this.buffer=e,this.length=t,this.set=n}get type(){return Gee.none}toString(){let e=[];for(let t=0;t0));a=i[a+3]);return l}slice(e,t,n){let o=this.buffer,r=new Uint16Array(t-e),i=0;for(let l=e,a=0;l=t&&nt;case 1:return n<=t&&o>t;case 2:return o>t;case 4:return!0}}function ate(e,t,n,o){for(var r;e.from==e.to||(n<1?e.from>=t:e.from>t)||(n>-1?e.to<=t:e.to0?l.length:-1;e!=s;e+=t){let s=l[e],c=a[e]+i.from;if(lte(o,n,c,c+s.length))if(s instanceof ite){if(r&tte.ExcludeBuffers)continue;let l=s.findChild(0,s.buffer.length,t,n-c,o);if(l>-1)return new hte(new pte(i,s,e,c),null,l)}else if(r&tte.IncludeAnonymous||!s.type.isAnonymous||vte(s)){let l;if(!(r&tte.IgnoreMounts)&&(l=Uee.get(s))&&!l.overlay)return new cte(l.tree,c,e,i);let a=new cte(s,c,e,i);return r&tte.IncludeAnonymous||!a.type.isAnonymous?a:a.nextChild(t<0?s.children.length-1:0,t,n,o)}}if(r&tte.IncludeAnonymous||!i.type.isAnonymous)return null;if(e=i.index>=0?i.index+t:t<0?-1:i._parent._tree.children.length,i=i._parent,!i)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,n=0){let o;if(!(n&tte.IgnoreOverlays)&&(o=Uee.get(this._tree))&&o.overlay){let n=e-this.from;for(let{from:e,to:r}of o.overlay)if((t>0?e<=n:e=n:r>n))return new cte(o.tree,o.overlay[0].from+this.from,-1,this)}return this.nextChild(0,1,e,t,n)}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 ute(e,t,n,o){let r=e.cursor(),i=[];if(!r.firstChild())return i;if(null!=n)for(;!r.type.is(n);)if(!r.nextSibling())return i;for(;;){if(null!=o&&r.type.is(o))return i;if(r.type.is(t)&&i.push(r.node),!r.nextSibling())return null==o?i:[]}}function dte(e,t,n=t.length-1){for(let o=e.parent;n>=0;o=o.parent){if(!o)return!1;if(!o.type.isAnonymous){if(t[n]&&t[n]!=o.name)return!1;n--}}return!0}class pte{constructor(e,t,n,o){this.parent=e,this.buffer=t,this.index=n,this.start=o}}class hte extends ste{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,n){super(),this.context=e,this._parent=t,this.index=n,this.type=e.buffer.set.types[e.buffer.buffer[n]]}child(e,t,n){let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],e,t-this.context.start,n);return r<0?null:new hte(this.context,this,r)}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,n=0){if(n&tte.ExcludeBuffers)return null;let{buffer:o}=this.context,r=o.findChild(this.index+4,o.buffer[this.index+3],t>0?1:-1,e-this.context.start,t);return r<0?null:new hte(this.context,this,r)}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 hte(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 hte(this.context,this._parent,e.findChild(t,this.index,-1,0,4))}get tree(){return null}toTree(){let e=[],t=[],{buffer:n}=this.context,o=this.index+4,r=n.buffer[this.index+3];if(r>o){let i=n.buffer[this.index+1];e.push(n.slice(o,r,i)),t.push(0)}return new ote(this.type,e,t,this.to-this.from)}toString(){return this.context.buffer.childString(this.index)}}function fte(e){if(!e.length)return null;let t=0,n=e[0];for(let i=1;in.from||o.to0){if(this.index-1)for(let o=t+e,r=e<0?-1:n._tree.children.length;o!=r;o+=e){let e=n._tree.children[o];if(this.mode&tte.IncludeAnonymous||e instanceof ite||!e.type.isAnonymous||vte(e))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 i=e;i;i=i._parent)if(i.index==o){if(o==this.index)return i;t=i,n=r+1;break e}o=this.stack[--r]}for(let o=n;o=0;r--){if(r<0)return dte(this.node,e,o);let i=n[t.buffer[this.stack[r]]];if(!i.isAnonymous){if(e[o]&&e[o]!=i.name)return!1;o--}}return!0}}function vte(e){return e.children.some((e=>e instanceof ite||!e.type.isAnonymous||vte(e)))}const bte=new WeakMap;function yte(e,t){if(!e.isAnonymous||t instanceof ite||t.type!=e)return 1;let n=bte.get(t);if(null==n){n=1;for(let o of t.children){if(o.type!=e||!(o instanceof ote)){n=1;break}n+=yte(e,o)}bte.set(t,n)}return n}function Ote(e,t,n,o,r,i,l,a,s){let c=0;for(let h=o;h=u)break;f+=t}if(c==r+1){if(f>u){let e=n[r];t(e.children,e.positions,0,e.children.length,o[r]+a);continue}d.push(n[r])}else{let t=o[c-1]+n[c-1].length-h;d.push(Ote(e,n,o,r,c,h,t,null,s))}p.push(h+a-i)}}(t,n,o,r,0),(a||s)(d,p,l)}class wte{constructor(){this.map=new WeakMap}setBuffer(e,t,n){let o=this.map.get(e);o||this.map.set(e,o=new Map),o.set(t,n)}getBuffer(e,t){let n=this.map.get(e);return n&&n.get(t)}set(e,t){e instanceof hte?this.setBuffer(e.context.buffer,e.index,t):e instanceof cte&&this.map.set(e.tree,t)}get(e){return e instanceof hte?this.getBuffer(e.context.buffer,e.index):e instanceof cte?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 Ste{constructor(e,t,n,o,r=!1,i=!1){this.from=e,this.to=t,this.tree=n,this.offset=o,this.open=(r?1:0)|(i?2:0)}get openStart(){return(1&this.open)>0}get openEnd(){return(2&this.open)>0}static addTree(e,t=[],n=!1){let o=[new Ste(0,e.length,e,0,!1,n)];for(let r of t)r.to>e.length&&o.push(r);return o}static applyChanges(e,t,n=128){if(!t.length)return e;let o=[],r=1,i=e.length?e[0]:null;for(let l=0,a=0,s=0;;l++){let c=l=n)for(;i&&i.from=t.from||u<=t.to||s){let e=Math.max(t.from,a)-s,n=Math.min(t.to,u)-s;t=e>=n?null:new Ste(e,n,t.tree,t.offset+s,l>0,!!c)}if(t&&o.push(t),i.to>u)break;i=rnew Vee(e.from,e.to))):[new Vee(0,0)]:[new Vee(0,e.length)],this.createParse(e,t||[],n)}parse(e,t,n){let o=this.startParse(e,t,n);for(;;){let e=o.advance();if(e)return e}}}class $te{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)}}new Zee({perNode:!0});let Cte=0;class kte{constructor(e,t,n){this.set=e,this.base=t,this.modified=n,this.id=Cte++}static define(e){if(null==e?void 0:e.base)throw new Error("Can not derive from a modified tag");let t=new kte([],null,[]);if(t.set.push(t),e)for(let n of e.set)t.set.push(n);return t}static defineModifier(){let e=new Tte;return t=>t.modified.indexOf(e)>-1?t:Tte.get(t.base||t,t.modified.concat(e).sort(((e,t)=>e.id-t.id)))}}let Pte=0;class Tte{constructor(){this.instances=[],this.id=Pte++}static get(e,t){if(!t.length)return e;let n=t[0].instances.find((n=>{return n.base==e&&(o=t,r=n.modified,o.length==r.length&&o.every(((e,t)=>e==r[t])));var o,r}));if(n)return n;let o=[],r=new kte(o,e,t);for(let l of t)l.instances.push(r);let i=function(e){let t=[[]];for(let n=0;nt.length-e.length))}(t);for(let l of e.set)if(!l.modified.length)for(let e of i)o.push(Tte.get(l,e));return r}}function Mte(e){let t=Object.create(null);for(let n in e){let o=e[n];Array.isArray(o)||(o=[o]);for(let e of n.split(" "))if(e){let n=[],r=2,i=e;for(let t=0;;){if("..."==i&&t>0&&t+3==e.length){r=1;break}let o=/^"(?:[^"\\]|\\.)*?"|[^\/!]+/.exec(i);if(!o)throw new RangeError("Invalid path: "+e);if(n.push("*"==o[0]?"":'"'==o[0][0]?JSON.parse(o[0]):o[0]),t+=o[0].length,t==e.length)break;let l=e[t++];if(t==e.length&&"!"==l){r=0;break}if("/"!=l)throw new RangeError("Invalid path: "+e);i=e.slice(t)}let l=n.length-1,a=n[l];if(!a)throw new RangeError("Invalid path: "+e);let s=new Ete(o,r,l>0?n.slice(0,l):null);t[a]=s.sort(t[a])}}return Ite.add(t)}const Ite=new Zee;class Ete{constructor(e,t,n,o){this.tags=e,this.mode=t,this.context=n,this.next=o}get opaque(){return 0==this.mode}get inherit(){return 1==this.mode}sort(e){return!e||e.depth{let t=r;for(let o of e)for(let e of o.set){let o=n[e.id];if(o){t=t?t+" "+o:o;break}}return t},scope:o}}function Dte(e,t,n,o=0,r=e.length){let i=new Rte(o,Array.isArray(t)?t:[t],n);i.highlightRange(e.cursor(),o,r,"",i.highlighters),i.flush(r)}Ete.empty=new Ete([],2,null);class Rte{constructor(e,t,n){this.at=e,this.highlighters=t,this.span=n,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,n,o,r){let{type:i,from:l,to:a}=e;if(l>=n||a<=t)return;i.isTop&&(r=this.highlighters.filter((e=>!e.scope||e.scope(i))));let s=o,c=function(e){let t=e.type.prop(Ite);for(;t&&t.context&&!e.matchContext(t.context);)t=t.next;return t||null}(e)||Ete.empty,u=function(e,t){let n=null;for(let o of e){let e=o.style(t);e&&(n=n?n+" "+e:e)}return n}(r,c.tags);if(u&&(s&&(s+=" "),s+=u,1==c.mode&&(o+=(o?" ":"")+u)),this.startSpan(Math.max(t,l),s),c.opaque)return;let d=e.tree&&e.tree.prop(Zee.mounted);if(d&&d.overlay){let i=e.node.enter(d.overlay[0].from+l,1),c=this.highlighters.filter((e=>!e.scope||e.scope(d.tree.type))),u=e.firstChild();for(let p=0,h=l;;p++){let f=p=g)&&e.nextSibling()););if(!f||g>n)break;h=f.to+l,h>t&&(this.highlightRange(i.cursor(),Math.max(t,f.from+l),Math.min(n,h),"",c),this.startSpan(Math.min(n,h),s))}u&&e.parent()}else if(e.firstChild()){d&&(o="");do{if(!(e.to<=t)){if(e.from>=n)break;this.highlightRange(e,t,n,o,r),this.startSpan(Math.min(n,e.to),s)}}while(e.nextSibling());e.parent()}}}const zte=kte.define,Bte=zte(),jte=zte(),Nte=zte(jte),_te=zte(jte),Qte=zte(),Lte=zte(Qte),Hte=zte(Qte),Fte=zte(),Wte=zte(Fte),Xte=zte(),Yte=zte(),Vte=zte(),Zte=zte(Vte),Ute=zte(),Kte={comment:Bte,lineComment:zte(Bte),blockComment:zte(Bte),docComment:zte(Bte),name:jte,variableName:zte(jte),typeName:Nte,tagName:zte(Nte),propertyName:_te,attributeName:zte(_te),className:zte(jte),labelName:zte(jte),namespace:zte(jte),macroName:zte(jte),literal:Qte,string:Lte,docString:zte(Lte),character:zte(Lte),attributeValue:zte(Lte),number:Hte,integer:zte(Hte),float:zte(Hte),bool:zte(Qte),regexp:zte(Qte),escape:zte(Qte),color:zte(Qte),url:zte(Qte),keyword:Xte,self:zte(Xte),null:zte(Xte),atom:zte(Xte),unit:zte(Xte),modifier:zte(Xte),operatorKeyword:zte(Xte),controlKeyword:zte(Xte),definitionKeyword:zte(Xte),moduleKeyword:zte(Xte),operator:Yte,derefOperator:zte(Yte),arithmeticOperator:zte(Yte),logicOperator:zte(Yte),bitwiseOperator:zte(Yte),compareOperator:zte(Yte),updateOperator:zte(Yte),definitionOperator:zte(Yte),typeOperator:zte(Yte),controlOperator:zte(Yte),punctuation:Vte,separator:zte(Vte),bracket:Zte,angleBracket:zte(Zte),squareBracket:zte(Zte),paren:zte(Zte),brace:zte(Zte),content:Fte,heading:Wte,heading1:zte(Wte),heading2:zte(Wte),heading3:zte(Wte),heading4:zte(Wte),heading5:zte(Wte),heading6:zte(Wte),contentSeparator:zte(Fte),list:zte(Fte),quote:zte(Fte),emphasis:zte(Fte),strong:zte(Fte),link:zte(Fte),monospace:zte(Fte),strikethrough:zte(Fte),inserted:zte(),deleted:zte(),changed:zte(),invalid:zte(),meta:Ute,documentMeta:zte(Ute),annotation:zte(Ute),processingInstruction:zte(Ute),definition:kte.defineModifier(),constant:kte.defineModifier(),function:kte.defineModifier(),standard:kte.defineModifier(),local:kte.defineModifier(),special:kte.defineModifier()};var Gte;Ate([{tag:Kte.link,class:"tok-link"},{tag:Kte.heading,class:"tok-heading"},{tag:Kte.emphasis,class:"tok-emphasis"},{tag:Kte.strong,class:"tok-strong"},{tag:Kte.keyword,class:"tok-keyword"},{tag:Kte.atom,class:"tok-atom"},{tag:Kte.bool,class:"tok-bool"},{tag:Kte.url,class:"tok-url"},{tag:Kte.labelName,class:"tok-labelName"},{tag:Kte.inserted,class:"tok-inserted"},{tag:Kte.deleted,class:"tok-deleted"},{tag:Kte.literal,class:"tok-literal"},{tag:Kte.string,class:"tok-string"},{tag:Kte.number,class:"tok-number"},{tag:[Kte.regexp,Kte.escape,Kte.special(Kte.string)],class:"tok-string2"},{tag:Kte.variableName,class:"tok-variableName"},{tag:Kte.local(Kte.variableName),class:"tok-variableName tok-local"},{tag:Kte.definition(Kte.variableName),class:"tok-variableName tok-definition"},{tag:Kte.special(Kte.variableName),class:"tok-variableName2"},{tag:Kte.definition(Kte.propertyName),class:"tok-propertyName tok-definition"},{tag:Kte.typeName,class:"tok-typeName"},{tag:Kte.namespace,class:"tok-namespace"},{tag:Kte.className,class:"tok-className"},{tag:Kte.macroName,class:"tok-macroName"},{tag:Kte.propertyName,class:"tok-propertyName"},{tag:Kte.operator,class:"tok-operator"},{tag:Kte.comment,class:"tok-comment"},{tag:Kte.meta,class:"tok-meta"},{tag:Kte.invalid,class:"tok-invalid"},{tag:Kte.punctuation,class:"tok-punctuation"}]);const qte=new Zee;function Jte(e){return t4.define({combine:e?t=>t.concat(e):void 0})}const ene=new Zee;class tne{constructor(e,t,n=[],o=""){this.data=e,this.name=o,F4.prototype.hasOwnProperty("tree")||Object.defineProperty(F4.prototype,"tree",{get(){return rne(this)}}),this.parser=t,this.extension=[hne.of(this),F4.languageData.of(((e,t,n)=>{let o=nne(e,t,n),r=o.type.prop(qte);if(!r)return[];let i=e.facet(r),l=o.type.prop(ene);if(l){let r=o.resolve(t-o.from,n);for(let t of l)if(t.test(r,e)){let n=e.facet(t.facet);return"replace"==t.type?n:n.concat(i)}}return i}))].concat(n)}isActiveAt(e,t,n=-1){return nne(e,t,n).type.prop(qte)==this.data}findRegions(e){let t=e.facet(hne);if((null==t?void 0:t.data)==this.data)return[{from:0,to:e.doc.length}];if(!t||!t.allowsNesting)return[];let n=[],o=(e,t)=>{if(e.prop(qte)==this.data)return void n.push({from:t,to:t+e.length});let r=e.prop(Zee.mounted);if(r){if(r.tree.prop(qte)==this.data){if(r.overlay)for(let e of r.overlay)n.push({from:e.from+t,to:e.to+t});else n.push({from:t,to:t+e.length});return}if(r.overlay){let e=n.length;if(o(r.tree,r.overlay[0].from+t),n.length>e)return}}for(let n=0;ne.isTop?t:void 0))]}),e.name)}configure(e,t){return new one(this.data,this.parser.configure(e),t||this.name)}get allowsNesting(){return this.parser.hasWrappers()}}function rne(e){let t=e.field(tne.state,!1);return t?t.tree:ote.empty}class ine{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 n=this.cursorPos-this.string.length;return e=this.cursorPos?this.doc.sliceString(e,t):this.string.slice(e-n,t-n)}}let lne=null;class ane{constructor(e,t,n=[],o,r,i,l,a){this.parser=e,this.state=t,this.fragments=n,this.tree=o,this.treeLen=r,this.viewport=i,this.skipped=l,this.scheduleOn=a,this.parse=null,this.tempSkipped=[]}static create(e,t,n){return new ane(e,t,[],ote.empty,0,n,[],null)}startParse(){return this.parser.startParse(new ine(this.state.doc),this.fragments)}work(e,t){return null!=t&&t>=this.state.doc.length&&(t=void 0),this.tree!=ote.empty&&this.isDone(null!=t?t:this.state.doc.length)?(this.takeTree(),!0):this.withContext((()=>{var n;if("number"==typeof e){let t=Date.now()+e;e=()=>Date.now()>t}for(this.parse||(this.parse=this.startParse()),null!=t&&(null==this.parse.stoppedAt||this.parse.stoppedAt>t)&&t=this.treeLen&&((null==this.parse.stoppedAt||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(Ste.addTree(this.tree,this.fragments,!0)),this.parse=null)}withContext(e){let t=lne;lne=this;try{return e()}finally{lne=t}}withoutTempSkipped(e){for(let t;t=this.tempSkipped.pop();)e=sne(e,t.from,t.to);return e}changes(e,t){let{fragments:n,tree:o,treeLen:r,viewport:i,skipped:l}=this;if(this.takeTree(),!e.empty){let t=[];if(e.iterChangedRanges(((e,n,o,r)=>t.push({fromA:e,toA:n,fromB:o,toB:r}))),n=Ste.applyChanges(n,t),o=ote.empty,r=0,i={from:e.mapPos(i.from,-1),to:e.mapPos(i.to,1)},this.skipped.length){l=[];for(let t of this.skipped){let n=e.mapPos(t.from,1),o=e.mapPos(t.to,-1);ne.from&&(this.fragments=sne(this.fragments,t,o),this.skipped.splice(n--,1))}return!(this.skipped.length>=t||(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 xte{createParse(t,n,o){let r=o[0].from,i=o[o.length-1].to;return{parsedPos:r,advance(){let t=lne;if(t){for(let e of o)t.tempSkipped.push(e);e&&(t.scheduleOn=t.scheduleOn?Promise.all([t.scheduleOn,e]):e)}return this.parsedPos=i,new ote(Gee.none,[],[],i-r)},stoppedAt:null,stopAt(){}}}}}isDone(e){e=Math.min(e,this.state.doc.length);let t=this.fragments;return this.treeLen>=e&&t.length&&0==t[0].from&&t[0].to>=e}static get(){return lne}}function sne(e,t,n){return Ste.applyChanges(e,[{fromA:t,toA:n,fromB:t,toB:n}])}class cne{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),n=this.context.treeLen==e.startState.doc.length?void 0:Math.max(e.changes.mapPos(this.context.treeLen),t.viewport.to);return t.work(20,n)||t.takeTree(),new cne(t)}static init(e){let t=Math.min(3e3,e.doc.length),n=ane.create(e.facet(hne).parser,e,{from:0,to:t});return n.work(20,t)||n.takeTree(),new cne(n)}}tne.state=s4.define({create:cne.init,update(e,t){for(let n of t.effects)if(n.is(tne.setState))return n.value;return t.startState.facet(hne)!=t.state.facet(hne)?cne.init(t.state):e.apply(t)}});let une=e=>{let t=setTimeout((()=>e()),500);return()=>clearTimeout(t)};"undefined"!=typeof requestIdleCallback&&(une=e=>{let t=-1,n=setTimeout((()=>{t=requestIdleCallback(e,{timeout:400})}),100);return()=>t<0?clearTimeout(n):cancelIdleCallback(t)});const dne="undefined"!=typeof navigator&&(null===(Gte=navigator.scheduling)||void 0===Gte?void 0:Gte.isInputPending)?()=>navigator.scheduling.isInputPending():null,pne=X8.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(tne.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(tne.state);t.tree==t.context.tree&&t.context.isDone(e.doc.length)||(this.working=une(this.work))}work(e){this.working=null;let t=Date.now();if(this.chunkEndo+1e3,a=r.context.work((()=>dne&&dne()||Date.now()>i),o+(l?0:1e5));this.chunkBudget-=Date.now()-t,(a||this.chunkBudget<=0)&&(r.context.takeTree(),this.view.dispatch({effects:tne.setState.of(new cne(r.context))})),this.chunkBudget>0&&(!a||l)&&this.scheduleWork(),this.checkAsyncSchedule(r.context)}checkAsyncSchedule(e){e.scheduleOn&&(this.workScheduled++,e.scheduleOn.then((()=>this.scheduleWork())).catch((e=>L8(this.view.state,e))).then((()=>this.workScheduled--)),e.scheduleOn=null)}destroy(){this.working&&this.working()}isWorking(){return!!(this.working||this.workScheduled>0)}},{eventHandlers:{focus(){this.scheduleWork()}}}),hne=t4.define({combine:e=>e.length?e[0]:null,enables:e=>[tne.state,pne,o9.contentAttributes.compute([e],(t=>{let n=t.facet(e);return n&&n.name?{"data-language":n.name}:{}}))]});class fne{constructor(e,t=[]){this.language=e,this.support=t,this.extension=[e,t]}}const gne=t4.define(),mne=t4.define({combine:e=>{if(!e.length)return" ";let t=e[0];if(!t||/\S/.test(t)||Array.from(t).some((e=>e!=t[0])))throw new Error("Invalid indent unit: "+JSON.stringify(e[0]));return t}});function vne(e){let t=e.facet(mne);return 9==t.charCodeAt(0)?e.tabSize*t.length:t.length}function bne(e,t){let n="",o=e.tabSize,r=e.facet(mne)[0];if("\t"==r){for(;t>=o;)n+="\t",t-=o;r=" "}for(let i=0;i=t?function(e,t,n){let o=t.resolveStack(n),r=o.node.enterUnfinishedNodesBefore(n);if(r!=o.node){let e=[];for(let t=r;t!=o.node;t=t.parent)e.push(t);for(let t=e.length-1;t>=0;t--)o={node:e[t],next:o}}return Sne(o,e,n)}(e,n,t):null}class One{constructor(e,t={}){this.state=e,this.options=t,this.unit=vne(e)}lineAt(e,t=1){let n=this.state.doc.lineAt(e),{simulateBreak:o,simulateDoubleBreak:r}=this.options;return null!=o&&o>=n.from&&o<=n.to?r&&o==e?{text:"",from:e}:(t<0?o-1&&(r+=i-this.countColumn(n,n.search(/\S|$/))),r}countColumn(e,t=e.length){return a5(e,this.state.tabSize,t)}lineIndent(e,t=1){let{text:n,from:o}=this.lineAt(e,t),r=this.options.overrideIndentation;if(r){let e=r(o);if(e>-1)return e}return this.countColumn(n,n.search(/\S|$/))}get simulatedBreak(){return this.options.simulateBreak||null}}const wne=new Zee;function Sne(e,t,n){for(let o=e;o;o=o.next){let e=xne(o.node);if(e)return e(Cne.create(t,n,o))}return 0}function xne(e){let t=e.type.prop(wne);if(t)return t;let n,o=e.firstChild;if(o&&(n=o.type.prop(Zee.closedBy))){let t=e.lastChild,o=t&&n.indexOf(t.name)>-1;return e=>Tne(e,!0,1,void 0,o&&!function(e){return e.pos==e.options.simulateBreak&&e.options.simulateDoubleBreak}(e)?t.from:void 0)}return null==e.parent?$ne:null}function $ne(){return 0}class Cne extends One{constructor(e,t,n){super(e.state,e.options),this.base=e,this.pos=t,this.context=n}get node(){return this.context.node}static create(e,t,n){return new Cne(e,t,n)}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 n=e.resolve(t.from);for(;n.parent&&n.parent.from==n.from;)n=n.parent;if(kne(n,e))break;t=this.state.doc.lineAt(n.from)}return this.lineIndent(t.from)}continue(){return Sne(this.context.next,this.base,this.pos)}}function kne(e,t){for(let n=t;n;n=n.parent)if(e==n)return!0;return!1}function Pne({closing:e,align:t=!0,units:n=1}){return o=>Tne(o,t,n,e)}function Tne(e,t,n,o,r){let i=e.textAfter,l=i.match(/^\s*/)[0].length,a=o&&i.slice(l,l+o.length)==o||r==e.pos+l,s=t?function(e){let t=e.node,n=t.childAfter(t.from),o=t.lastChild;if(!n)return null;let r=e.options.simulateBreak,i=e.state.doc.lineAt(n.from),l=null==r||r<=i.from?i.to:Math.min(i.to,r);for(let a=n.to;;){let e=t.childAfter(a);if(!e||e==o)return null;if(!e.type.isSkipped)return e.from{let o=e&&e.test(n.textAfter);return n.baseIndent+(o?0:t*n.unit)}}const Ine=t4.define(),Ene=new Zee;function Ane(e){let t=e.lastChild;return t&&t.to==e.to&&t.type.isError}function Dne(e,t,n){for(let o of e.facet(Ine)){let r=o(e,t,n);if(r)return r}return function(e,t,n){let o=rne(e);if(o.lengthn)continue;if(r&&l.from=t&&o.to>n&&(r=o)}}return r}(e,t,n)}function Rne(e,t){let n=t.mapPos(e.from,1),o=t.mapPos(e.to,-1);return n>=o?void 0:{from:n,to:o}}const zne=E4.define({map:Rne}),Bne=E4.define({map:Rne});function jne(e){let t=[];for(let{head:n}of e.state.selection.ranges)t.some((e=>e.from<=n&&e.to>=n))||t.push(e.lineBlockAt(n));return t}const Nne=s4.define({create:()=>w8.none,update(e,t){e=e.map(t.changes);for(let n of t.effects)if(n.is(zne)&&!Qne(e,n.value.from,n.value.to)){let{preparePlaceholder:o}=t.state.facet(Xne),r=o?w8.replace({widget:new Une(o(t.state,n.value))}):Zne;e=e.update({add:[r.range(n.value.from,n.value.to)]})}else n.is(Bne)&&(e=e.update({filter:(e,t)=>n.value.from!=e||n.value.to!=t,filterFrom:n.value.from,filterTo:n.value.to}));if(t.selection){let n=!1,{head:o}=t.selection.main;e.between(o,o,((e,t)=>{eo&&(n=!0)})),n&&(e=e.update({filterFrom:o,filterTo:o,filter:(e,t)=>t<=o||e>=o}))}return e},provide:e=>o9.decorations.from(e),toJSON(e,t){let n=[];return e.between(0,t.doc.length,((e,t)=>{n.push(e,t)})),n},fromJSON(e){if(!Array.isArray(e)||e.length%2)throw new RangeError("Invalid JSON for fold state");let t=[];for(let n=0;n{(!r||r.from>e)&&(r={from:e,to:t})})),r}function Qne(e,t,n){let o=!1;return e.between(t,t,((e,r)=>{e==t&&r==n&&(o=!0)})),o}function Lne(e,t){return e.field(Nne,!1)?t:t.concat(E4.appendConfig.of(Yne()))}function Hne(e,t,n=!0){let o=e.state.doc.lineAt(t.from).number,r=e.state.doc.lineAt(t.to).number;return o9.announce.of(`${e.state.phrase(n?"Folded lines":"Unfolded lines")} ${o} ${e.state.phrase("to")} ${r}.`)}const Fne=[{key:"Ctrl-Shift-[",mac:"Cmd-Alt-[",run:e=>{for(let t of jne(e)){let n=Dne(e.state,t.from,t.to);if(n)return e.dispatch({effects:Lne(e.state,[zne.of(n),Hne(e,n)])}),!0}return!1}},{key:"Ctrl-Shift-]",mac:"Cmd-Alt-]",run:e=>{if(!e.state.field(Nne,!1))return!1;let t=[];for(let n of jne(e)){let o=_ne(e.state,n.from,n.to);o&&t.push(Bne.of(o),Hne(e,o,!1))}return t.length&&e.dispatch({effects:t}),t.length>0}},{key:"Ctrl-Alt-[",run:e=>{let{state:t}=e,n=[];for(let o=0;o{let t=e.state.field(Nne,!1);if(!t||!t.size)return!1;let n=[];return t.between(0,e.state.doc.length,((e,t)=>{n.push(Bne.of({from:e,to:t}))})),e.dispatch({effects:n}),!0}}],Wne={placeholderDOM:null,preparePlaceholder:null,placeholderText:"…"},Xne=t4.define({combine:e=>W4(e,Wne)});function Yne(e){let t=[Nne,Jne];return e&&t.push(Xne.of(e)),t}function Vne(e,t){let{state:n}=e,o=n.facet(Xne),r=t=>{let n=e.lineBlockAt(e.posAtDOM(t.target)),o=_ne(e.state,n.from,n.to);o&&e.dispatch({effects:Bne.of(o)}),t.preventDefault()};if(o.placeholderDOM)return o.placeholderDOM(e,r,t);let i=document.createElement("span");return i.textContent=o.placeholderText,i.setAttribute("aria-label",n.phrase("folded code")),i.title=n.phrase("unfold"),i.className="cm-foldPlaceholder",i.onclick=r,i}const Zne=w8.replace({widget:new class extends y8{toDOM(e){return Vne(e,null)}}});class Une extends y8{constructor(e){super(),this.value=e}eq(e){return this.value==e.value}toDOM(e){return Vne(e,this.value)}}const Kne={openText:"⌄",closedText:"›",markerDOM:null,domEventHandlers:{},foldingChanged:()=>!1};class Gne extends xee{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 qne(e={}){let t=Object.assign(Object.assign({},Kne),e),n=new Gne(t,!0),o=new Gne(t,!1),r=X8.fromClass(class{constructor(e){this.from=e.viewport.from,this.markers=this.buildMarkers(e)}update(e){(e.docChanged||e.viewportChanged||e.startState.facet(hne)!=e.state.facet(hne)||e.startState.field(Nne,!1)!=e.state.field(Nne,!1)||rne(e.startState)!=rne(e.state)||t.foldingChanged(e))&&(this.markers=this.buildMarkers(e.view))}buildMarkers(e){let t=new K4;for(let r of e.viewportLineBlocks){let i=_ne(e.state,r.from,r.to)?o:Dne(e.state,r.from,r.to)?n:null;i&&t.add(r.from,r.from,i)}return t.finish()}}),{domEventHandlers:i}=t;return[r,Pee({class:"cm-foldGutter",markers(e){var t;return(null===(t=e.plugin(r))||void 0===t?void 0:t.markers)||U4.empty},initialSpacer:()=>new Gne(t,!1),domEventHandlers:Object.assign(Object.assign({},i),{click:(e,t,n)=>{if(i.click&&i.click(e,t,n))return!0;let o=_ne(e.state,t.from,t.to);if(o)return e.dispatch({effects:Bne.of(o)}),!0;let r=Dne(e.state,t.from,t.to);return!!r&&(e.dispatch({effects:zne.of(r)}),!0)}})}),Yne()]}const Jne=o9.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 eoe{constructor(e,t){let n;function o(e){let t=p5.newName();return(n||(n=Object.create(null)))["."+t]=e,t}this.specs=e;const r="string"==typeof t.all?t.all:t.all?o(t.all):void 0,i=t.scope;this.scope=i instanceof tne?e=>e.prop(qte)==i.data:i?e=>e==i:void 0,this.style=Ate(e.map((e=>({tag:e.tag,class:e.class||o(Object.assign({},e,{tag:null}))}))),{all:r}).style,this.module=n?new p5(n):null,this.themeType=t.themeType}static define(e,t){return new eoe(e,t||{})}}const toe=t4.define(),noe=t4.define({combine:e=>e.length?[e[0]]:null});function ooe(e){let t=e.facet(toe);return t.length?t:e.facet(noe)}function roe(e,t){let n,o=[loe];return e instanceof eoe&&(e.module&&o.push(o9.styleModule.of(e.module)),n=e.themeType),(null==t?void 0:t.fallback)?o.push(noe.of(e)):n?o.push(toe.computeN([o9.darkTheme],(t=>t.facet(o9.darkTheme)==("dark"==n)?[e]:[]))):o.push(toe.of(e)),o}class ioe{constructor(e){this.markCache=Object.create(null),this.tree=rne(e.state),this.decorations=this.buildDeco(e,ooe(e.state))}update(e){let t=rne(e.state),n=ooe(e.state),o=n!=ooe(e.startState);t.length{n.add(e,t,this.markCache[o]||(this.markCache[o]=w8.mark({class:o})))}),o,r);return n.finish()}}const loe=f4.high(X8.fromClass(ioe,{decorations:e=>e.decorations})),aoe=eoe.define([{tag:Kte.meta,color:"#404740"},{tag:Kte.link,textDecoration:"underline"},{tag:Kte.heading,textDecoration:"underline",fontWeight:"bold"},{tag:Kte.emphasis,fontStyle:"italic"},{tag:Kte.strong,fontWeight:"bold"},{tag:Kte.strikethrough,textDecoration:"line-through"},{tag:Kte.keyword,color:"#708"},{tag:[Kte.atom,Kte.bool,Kte.url,Kte.contentSeparator,Kte.labelName],color:"#219"},{tag:[Kte.literal,Kte.inserted],color:"#164"},{tag:[Kte.string,Kte.deleted],color:"#a11"},{tag:[Kte.regexp,Kte.escape,Kte.special(Kte.string)],color:"#e40"},{tag:Kte.definition(Kte.variableName),color:"#00f"},{tag:Kte.local(Kte.variableName),color:"#30a"},{tag:[Kte.typeName,Kte.namespace],color:"#085"},{tag:Kte.className,color:"#167"},{tag:[Kte.special(Kte.variableName),Kte.macroName],color:"#256"},{tag:Kte.definition(Kte.propertyName),color:"#00c"},{tag:Kte.comment,color:"#940"},{tag:Kte.invalid,color:"#f00"}]),soe=o9.baseTheme({"&.cm-focused .cm-matchingBracket":{backgroundColor:"#328c8252"},"&.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bb555544"}}),coe="()[]{}",uoe=t4.define({combine:e=>W4(e,{afterCursor:!0,brackets:coe,maxScanDistance:1e4,renderMatch:hoe})}),doe=w8.mark({class:"cm-matchingBracket"}),poe=w8.mark({class:"cm-nonmatchingBracket"});function hoe(e){let t=[],n=e.matched?doe:poe;return t.push(n.range(e.start.from,e.start.to)),e.end&&t.push(n.range(e.end.from,e.end.to)),t}const foe=[s4.define({create:()=>w8.none,update(e,t){if(!t.docChanged&&!t.selection)return e;let n=[],o=t.state.facet(uoe);for(let r of t.state.selection.ranges){if(!r.empty)continue;let e=yoe(t.state,r.head,-1,o)||r.head>0&&yoe(t.state,r.head-1,1,o)||o.afterCursor&&(yoe(t.state,r.head,1,o)||r.heado9.decorations.from(e)}),soe];function goe(e={}){return[uoe.of(e),foe]}const moe=new Zee;function voe(e,t,n){let o=e.prop(t<0?Zee.openedBy:Zee.closedBy);if(o)return o;if(1==e.name.length){let o=n.indexOf(e.name);if(o>-1&&o%2==(t<0?1:0))return[n[o+t]]}return null}function boe(e){let t=e.type.prop(moe);return t?t(e.node):e}function yoe(e,t,n,o={}){let r=o.maxScanDistance||1e4,i=o.brackets||coe,l=rne(e),a=l.resolveInner(t,n);for(let s=a;s;s=s.parent){let e=voe(s.type,n,i);if(e&&s.from0?t>=o.from&&to.from&&t<=o.to))return Ooe(0,0,n,s,o,e,i)}}return function(e,t,n,o,r,i,l){let a=n<0?e.sliceDoc(t-1,t):e.sliceDoc(t,t+1),s=l.indexOf(a);if(s<0||s%2==0!=n>0)return null;let c={from:n<0?t-1:t,to:n>0?t+1:t},u=e.doc.iterRange(t,n>0?e.doc.length:0),d=0;for(let p=0;!u.next().done&&p<=i;){let e=u.value;n<0&&(p+=e.length);let i=t+p*n;for(let t=n>0?0:e.length-1,a=n>0?e.length:-1;t!=a;t+=n){let a=l.indexOf(e[t]);if(!(a<0||o.resolveInner(i+t,1).type!=r))if(a%2==0==n>0)d++;else{if(1==d)return{start:c,end:{from:i+t,to:i+t+1},matched:a>>1==s>>1};d--}}n>0&&(p+=e.length)}return u.done?{start:c,matched:!1}:null}(e,t,n,l,a.type,r,i)}function Ooe(e,t,n,o,r,i,l){let a=o.parent,s={from:r.from,to:r.to},c=0,u=null==a?void 0:a.cursor();if(u&&(n<0?u.childBefore(o.from):u.childAfter(o.to)))do{if(n<0?u.to<=o.from:u.from>=o.to){if(0==c&&i.indexOf(u.type.name)>-1&&u.from-1||xoe.push(e)}function Poe(e,t){let n=[];for(let a of t.split(" ")){let t=[];for(let n of a.split(".")){let o=e[n]||Kte[n];o?"function"==typeof o?t.length?t=t.map(o):koe(n):t.length?koe(n):t=Array.isArray(o)?o:[o]:koe(n)}for(let e of t)n.push(e)}if(!n.length)return 0;let o=t.replace(/ /g,"_"),r=o+" "+n.map((e=>e.id)),i=$oe[r];if(i)return i.id;let l=$oe[r]=Gee.define({id:Soe.length,name:o,props:[Mte({[o]:n})]});return Soe.push(l),l.id}function Toe(e,t){return({state:n,dispatch:o})=>{if(n.readOnly)return!1;let r=e(t,n);return!!r&&(o(n.update(r)),!0)}}const Moe=Toe(Roe,0),Ioe=Toe(Doe,0),Eoe=Toe(((e,t)=>Doe(e,t,function(e){let t=[];for(let n of e.selection.ranges){let o=e.doc.lineAt(n.from),r=n.to<=o.to?o:e.doc.lineAt(n.to),i=t.length-1;i>=0&&t[i].to>o.from?t[i].to=r.to:t.push({from:o.from+/^\s*/.exec(o.text)[0].length,to:r.to})}return t}(t))),0);function Aoe(e,t){let n=e.languageDataAt("commentTokens",t);return n.length?n[0]:{}}function Doe(e,t,n=t.selection.ranges){let o=n.map((e=>Aoe(t,e.from).block));if(!o.every((e=>e)))return null;let r=n.map(((e,n)=>function(e,{open:t,close:n},o,r){let i,l,a=e.sliceDoc(o-50,o),s=e.sliceDoc(r,r+50),c=/\s*$/.exec(a)[0].length,u=/^\s*/.exec(s)[0].length,d=a.length-c;if(a.slice(d-t.length,d)==t&&s.slice(u,u+n.length)==n)return{open:{pos:o-c,margin:c&&1},close:{pos:r+u,margin:u&&1}};r-o<=100?i=l=e.sliceDoc(o,r):(i=e.sliceDoc(o,o+50),l=e.sliceDoc(r-50,r));let p=/^\s*/.exec(i)[0].length,h=/\s*$/.exec(l)[0].length,f=l.length-h-n.length;return i.slice(p,p+t.length)==t&&l.slice(f,f+n.length)==n?{open:{pos:o+p+t.length,margin:/\s/.test(i.charAt(p+t.length))?1:0},close:{pos:r-h-n.length,margin:/\s/.test(l.charAt(f-1))?1:0}}:null}(t,o[n],e.from,e.to)));if(2!=e&&!r.every((e=>e)))return{changes:t.changes(n.map(((e,t)=>r[t]?[]:[{from:e.from,insert:o[t].open+" "},{from:e.to,insert:" "+o[t].close}])))};if(1!=e&&r.some((e=>e))){let e=[];for(let t,n=0;nr&&(i==l||l>s.from)){r=s.from;let e=/^\s*/.exec(s.text)[0].length,t=e==s.length,i=s.text.slice(e,e+a.length)==a?e:-1;ee.comment<0&&(!e.empty||e.single)))){let e=[];for(let{line:t,token:r,indent:i,empty:l,single:a}of o)!a&&l||e.push({from:t.from+i,insert:r+" "});let n=t.changes(e);return{changes:n,selection:t.selection.map(n,1)}}if(1!=e&&o.some((e=>e.comment>=0))){let e=[];for(let{line:t,comment:n,token:r}of o)if(n>=0){let o=t.from+n,i=o+r.length;" "==t.text[i-t.from]&&i++,e.push({from:o,to:i})}return{changes:e}}return null}const zoe=T4.define(),Boe=T4.define(),joe=t4.define(),Noe=t4.define({combine:e=>W4(e,{minDepth:100,newGroupDelay:500,joinToEvent:(e,t)=>t},{minDepth:Math.max,newGroupDelay:Math.min,joinToEvent:(e,t)=>(n,o)=>e(n,o)||t(n,o)})}),_oe=s4.define({create:()=>tre.empty,update(e,t){let n=t.state.facet(Noe),o=t.annotation(zoe);if(o){let r=Yoe.fromTransaction(t,o.selection),i=o.side,l=0==i?e.undone:e.done;return l=r?Voe(l,l.length,n.minDepth,r):Koe(l,t.startState.selection),new tre(0==i?o.rest:l,0==i?l:o.rest)}let r=t.annotation(Boe);if("full"!=r&&"before"!=r||(e=e.isolate()),!1===t.annotation(A4.addToHistory))return t.changes.empty?e:e.addMapping(t.changes.desc);let i=Yoe.fromTransaction(t),l=t.annotation(A4.time),a=t.annotation(A4.userEvent);return i?e=e.addChanges(i,l,a,n,t):t.selection&&(e=e.addSelection(t.startState.selection,l,a,n.newGroupDelay)),"full"!=r&&"after"!=r||(e=e.isolate()),e},toJSON:e=>({done:e.done.map((e=>e.toJSON())),undone:e.undone.map((e=>e.toJSON()))}),fromJSON:e=>new tre(e.done.map(Yoe.fromJSON),e.undone.map(Yoe.fromJSON))});function Qoe(e={}){return[_oe,Noe.of(e),o9.domEventHandlers({beforeinput(e,t){let n="historyUndo"==e.inputType?Hoe:"historyRedo"==e.inputType?Foe:null;return!!n&&(e.preventDefault(),n(t))}})]}function Loe(e,t){return function({state:n,dispatch:o}){if(!t&&n.readOnly)return!1;let r=n.field(_oe,!1);if(!r)return!1;let i=r.pop(e,n,t);return!!i&&(o(i),!0)}}const Hoe=Loe(0,!1),Foe=Loe(1,!1),Woe=Loe(0,!0),Xoe=Loe(1,!0);class Yoe{constructor(e,t,n,o,r){this.changes=e,this.effects=t,this.mapped=n,this.startSelection=o,this.selectionsAfter=r}setSelAfter(e){return new Yoe(this.changes,this.effects,this.mapped,this.startSelection,e)}toJSON(){var e,t,n;return{changes:null===(e=this.changes)||void 0===e?void 0:e.toJSON(),mapped:null===(t=this.mapped)||void 0===t?void 0:t.toJSON(),startSelection:null===(n=this.startSelection)||void 0===n?void 0:n.toJSON(),selectionsAfter:this.selectionsAfter.map((e=>e.toJSON()))}}static fromJSON(e){return new Yoe(e.changes&&W3.fromJSON(e.changes),[],e.mapped&&F3.fromJSON(e.mapped),e.startSelection&&q3.fromJSON(e.startSelection),e.selectionsAfter.map(q3.fromJSON))}static fromTransaction(e,t){let n=Uoe;for(let o of e.startState.facet(joe)){let t=o(e);t.length&&(n=n.concat(t))}return!n.length&&e.changes.empty?null:new Yoe(e.changes.invert(e.startState.doc),n,void 0,t||e.startState.selection,Uoe)}static selection(e){return new Yoe(void 0,Uoe,void 0,void 0,e)}}function Voe(e,t,n,o){let r=t+1>n+20?t-n-1:0,i=e.slice(r,t);return i.push(o),i}function Zoe(e,t){return e.length?t.length?e.concat(t):e:t}const Uoe=[];function Koe(e,t){if(e.length){let n=e[e.length-1],o=n.selectionsAfter.slice(Math.max(0,n.selectionsAfter.length-200));return o.length&&o[o.length-1].eq(t)?e:(o.push(t),Voe(e,e.length-1,1e9,n.setSelAfter(o)))}return[Yoe.selection([t])]}function Goe(e){let t=e[e.length-1],n=e.slice();return n[e.length-1]=t.setSelAfter(t.selectionsAfter.slice(0,t.selectionsAfter.length-1)),n}function qoe(e,t){if(!e.length)return e;let n=e.length,o=Uoe;for(;n;){let r=Joe(e[n-1],t,o);if(r.changes&&!r.changes.empty||r.effects.length){let t=e.slice(0,n);return t[n-1]=r,t}t=r.mapped,n--,o=r.selectionsAfter}return o.length?[Yoe.selection(o)]:Uoe}function Joe(e,t,n){let o=Zoe(e.selectionsAfter.length?e.selectionsAfter.map((e=>e.map(t))):Uoe,n);if(!e.changes)return Yoe.selection(o);let r=e.changes.map(t),i=t.mapDesc(e.changes,!0),l=e.mapped?e.mapped.composeDesc(i):i;return new Yoe(r,E4.mapEffects(e.effects,t),l,e.startSelection.map(i),o)}const ere=/^(input\.type|delete)($|\.)/;class tre{constructor(e,t,n=0,o=void 0){this.done=e,this.undone=t,this.prevTime=n,this.prevUserEvent=o}isolate(){return this.prevTime?new tre(this.done,this.undone):this}addChanges(e,t,n,o,r){let i=this.done,l=i[i.length-1];return i=l&&l.changes&&!l.changes.empty&&e.changes&&(!n||ere.test(n))&&(!l.selectionsAfter.length&&t-this.prevTimen.push(e,t))),t.iterChangedRanges(((e,t,r,i)=>{for(let l=0;l=e&&r<=t&&(o=!0)}})),o}(l.changes,e.changes))||"input.type.compose"==n)?Voe(i,i.length-1,o.minDepth,new Yoe(e.changes.compose(l.changes),Zoe(e.effects,l.effects),l.mapped,l.startSelection,Uoe)):Voe(i,i.length,o.minDepth,e),new tre(i,Uoe,t,n)}addSelection(e,t,n,o){let r=this.done.length?this.done[this.done.length-1].selectionsAfter:Uoe;return r.length>0&&t-this.prevTimee.empty!=l.ranges[t].empty)).length)?this:new tre(Koe(this.done,e),this.undone,t,n);var i,l}addMapping(e){return new tre(qoe(this.done,e),qoe(this.undone,e),this.prevTime,this.prevUserEvent)}pop(e,t,n){let o=0==e?this.done:this.undone;if(0==o.length)return null;let r=o[o.length-1],i=r.selectionsAfter[0]||t.selection;if(n&&r.selectionsAfter.length)return t.update({selection:r.selectionsAfter[r.selectionsAfter.length-1],annotations:zoe.of({side:e,rest:Goe(o),selection:i}),userEvent:0==e?"select.undo":"select.redo",scrollIntoView:!0});if(r.changes){let n=1==o.length?Uoe:o.slice(0,o.length-1);return r.mapped&&(n=qoe(n,r.mapped)),t.update({changes:r.changes,selection:r.startSelection,effects:r.effects,annotations:zoe.of({side:e,rest:n,selection:i}),filter:!1,userEvent:0==e?"undo":"redo",scrollIntoView:!0})}return null}}tre.empty=new tre(Uoe,Uoe);const nre=[{key:"Mod-z",run:Hoe,preventDefault:!0},{key:"Mod-y",mac:"Mod-Shift-z",run:Foe,preventDefault:!0},{linux:"Ctrl-Shift-z",run:Foe,preventDefault:!0},{key:"Mod-u",run:Woe,preventDefault:!0},{key:"Alt-u",mac:"Mod-Shift-u",run:Xoe,preventDefault:!0}];function ore(e,t){return q3.create(e.ranges.map(t),e.mainIndex)}function rre(e,t){return e.update({selection:t,scrollIntoView:!0,userEvent:"select"})}function ire({state:e,dispatch:t},n){let o=ore(e.selection,n);return!o.eq(e.selection)&&(t(rre(e,o)),!0)}function lre(e,t){return q3.cursor(t?e.to:e.from)}function are(e,t){return ire(e,(n=>n.empty?e.moveByChar(n,t):lre(n,t)))}function sre(e){return e.textDirectionAt(e.state.selection.main.head)==r6.LTR}const cre=e=>are(e,!sre(e)),ure=e=>are(e,sre(e));function dre(e,t){return ire(e,(n=>n.empty?e.moveByGroup(n,t):lre(n,t)))}function pre(e,t,n){if(t.type.prop(n))return!0;let o=t.to-t.from;return o&&(o>2||/[^\s,.;:]/.test(e.sliceDoc(t.from,t.to)))||t.firstChild}function hre(e,t,n){let o,r,i=rne(e).resolveInner(t.head),l=n?Zee.closedBy:Zee.openedBy;for(let a=t.head;;){let t=n?i.childAfter(a):i.childBefore(a);if(!t)break;pre(e,t,l)?i=t:a=n?t.to:t.from}return r=i.type.prop(l)&&(o=n?yoe(e,i.from,1):yoe(e,i.to,-1))&&o.matched?n?o.end.to:o.end.from:n?i.to:i.from,q3.cursor(r,n?-1:1)}function fre(e,t){return ire(e,(n=>{if(!n.empty)return lre(n,t);let o=e.moveVertically(n,t);return o.head!=n.head?o:e.moveToLineBoundary(n,t)}))}const gre=e=>fre(e,!1),mre=e=>fre(e,!0);function vre(e){let t,n=e.scrollDOM.clientHeightn.empty?e.moveVertically(n,t,o.height):lre(n,t)));if(i.eq(r.selection))return!1;if(o.selfScroll){let t=e.coordsAtPos(r.selection.main.head),l=e.scrollDOM.getBoundingClientRect(),a=l.top+o.marginTop,s=l.bottom-o.marginBottom;t&&t.top>a&&t.bottombre(e,!1),Ore=e=>bre(e,!0);function wre(e,t,n){let o=e.lineBlockAt(t.head),r=e.moveToLineBoundary(t,n);if(r.head==t.head&&r.head!=(n?o.to:o.from)&&(r=e.moveToLineBoundary(t,n,!1)),!n&&r.head==o.from&&o.length){let n=/^\s*/.exec(e.state.sliceDoc(o.from,Math.min(o.from+100,o.to)))[0].length;n&&t.head!=o.from+n&&(r=q3.cursor(o.from+n))}return r}function Sre(e,t){let n=ore(e.state.selection,(e=>{let n=t(e);return q3.range(e.anchor,n.head,n.goalColumn,n.bidiLevel||void 0)}));return!n.eq(e.state.selection)&&(e.dispatch(rre(e.state,n)),!0)}function xre(e,t){return Sre(e,(n=>e.moveByChar(n,t)))}const $re=e=>xre(e,!sre(e)),Cre=e=>xre(e,sre(e));function kre(e,t){return Sre(e,(n=>e.moveByGroup(n,t)))}function Pre(e,t){return Sre(e,(n=>e.moveVertically(n,t)))}const Tre=e=>Pre(e,!1),Mre=e=>Pre(e,!0);function Ire(e,t){return Sre(e,(n=>e.moveVertically(n,t,vre(e).height)))}const Ere=e=>Ire(e,!1),Are=e=>Ire(e,!0),Dre=({state:e,dispatch:t})=>(t(rre(e,{anchor:0})),!0),Rre=({state:e,dispatch:t})=>(t(rre(e,{anchor:e.doc.length})),!0),zre=({state:e,dispatch:t})=>(t(rre(e,{anchor:e.selection.main.anchor,head:0})),!0),Bre=({state:e,dispatch:t})=>(t(rre(e,{anchor:e.selection.main.anchor,head:e.doc.length})),!0);function jre(e,t){if(e.state.readOnly)return!1;let n="delete.selection",{state:o}=e,r=o.changeByRange((o=>{let{from:r,to:i}=o;if(r==i){let l=t(o);lr&&(n="delete.forward",l=Nre(e,l,!0)),r=Math.min(r,l),i=Math.max(i,l)}else r=Nre(e,r,!1),i=Nre(e,i,!0);return r==i?{range:o}:{changes:{from:r,to:i},range:q3.cursor(r,rt(e))))o.between(t,t,((e,o)=>{et&&(t=n?o:e)}));return t}const _re=(e,t)=>jre(e,(n=>{let o,r,i=n.from,{state:l}=e,a=l.doc.lineAt(i);if(!t&&i>a.from&&i_re(e,!1),Lre=e=>_re(e,!0),Hre=(e,t)=>jre(e,(n=>{let o=n.head,{state:r}=e,i=r.doc.lineAt(o),l=r.charCategorizer(o);for(let e=null;;){if(o==(t?i.to:i.from)){o==n.head&&i.number!=(t?r.doc.lines:1)&&(o+=t?1:-1);break}let a=D3(i.text,o-i.from,t)+i.from,s=i.text.slice(Math.min(o,a)-i.from,Math.max(o,a)-i.from),c=l(s);if(null!=e&&c!=e)break;" "==s&&o==n.head||(e=c),o=a}return o})),Fre=e=>Hre(e,!1);function Wre(e){let t=[],n=-1;for(let o of e.selection.ranges){let r=e.doc.lineAt(o.from),i=e.doc.lineAt(o.to);if(o.empty||o.to!=i.from||(i=e.doc.lineAt(o.to-1)),n>=r.number){let e=t[t.length-1];e.to=i.to,e.ranges.push(o)}else t.push({from:r.from,to:i.to,ranges:[o]});n=i.number+1}return t}function Xre(e,t,n){if(e.readOnly)return!1;let o=[],r=[];for(let i of Wre(e)){if(n?i.to==e.doc.length:0==i.from)continue;let t=e.doc.lineAt(n?i.to+1:i.from-1),l=t.length+1;if(n){o.push({from:i.to,to:t.to},{from:i.from,insert:t.text+e.lineBreak});for(let t of i.ranges)r.push(q3.range(Math.min(e.doc.length,t.anchor+l),Math.min(e.doc.length,t.head+l)))}else{o.push({from:t.from,to:i.from},{from:i.to,insert:e.lineBreak+t.text});for(let e of i.ranges)r.push(q3.range(e.anchor-l,e.head-l))}}return!!o.length&&(t(e.update({changes:o,scrollIntoView:!0,selection:q3.create(r,e.selection.mainIndex),userEvent:"move.line"})),!0)}function Yre(e,t,n){if(e.readOnly)return!1;let o=[];for(let r of Wre(e))n?o.push({from:r.from,insert:e.doc.slice(r.from,r.to)+e.lineBreak}):o.push({from:r.to,insert:e.lineBreak+e.doc.slice(r.from,r.to)});return t(e.update({changes:o,scrollIntoView:!0,userEvent:"input.copyline"})),!0}const Vre=Zre(!1);function Zre(e){return({state:t,dispatch:n})=>{if(t.readOnly)return!1;let o=t.changeByRange((n=>{let{from:o,to:r}=n,i=t.doc.lineAt(o),l=!e&&o==r&&function(e,t){if(/\(\)|\[\]|\{\}/.test(e.sliceDoc(t-1,t+1)))return{from:t,to:t};let n,o=rne(e).resolveInner(t),r=o.childBefore(t),i=o.childAfter(t);return r&&i&&r.to<=t&&i.from>=t&&(n=r.type.prop(Zee.closedBy))&&n.indexOf(i.name)>-1&&e.doc.lineAt(r.to).from==e.doc.lineAt(i.from).from&&!/\S/.test(e.sliceDoc(r.to,i.from))?{from:r.to,to:i.from}:null}(t,o);e&&(o=r=(r<=i.to?i:t.doc.lineAt(r)).to);let a=new One(t,{simulateBreak:o,simulateDoubleBreak:!!l}),s=yne(a,o);for(null==s&&(s=a5(/^\s*/.exec(t.doc.lineAt(o).text)[0],t.tabSize));ri.from&&o{let r=[];for(let l=o.from;l<=o.to;){let i=e.doc.lineAt(l);i.number>n&&(o.empty||o.to>i.from)&&(t(i,r,o),n=i.number),l=i.to+1}let i=e.changes(r);return{changes:r,range:q3.range(i.mapPos(o.anchor,1),i.mapPos(o.head,1))}}))}const Kre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ure(e,((t,n)=>{n.push({from:t.from,insert:e.facet(mne)})})),{userEvent:"input.indent"})),!0),Gre=({state:e,dispatch:t})=>!e.readOnly&&(t(e.update(Ure(e,((t,n)=>{let o=/^\s*/.exec(t.text)[0];if(!o)return;let r=a5(o,e.tabSize),i=0,l=bne(e,Math.max(0,r-vne(e)));for(;iire(e,(t=>hre(e.state,t,!sre(e)))),shift:e=>Sre(e,(t=>hre(e.state,t,!sre(e))))},{key:"Alt-ArrowRight",mac:"Ctrl-ArrowRight",run:e=>ire(e,(t=>hre(e.state,t,sre(e)))),shift:e=>Sre(e,(t=>hre(e.state,t,sre(e))))},{key:"Alt-ArrowUp",run:({state:e,dispatch:t})=>Xre(e,t,!1)},{key:"Shift-Alt-ArrowUp",run:({state:e,dispatch:t})=>Yre(e,t,!1)},{key:"Alt-ArrowDown",run:({state:e,dispatch:t})=>Xre(e,t,!0)},{key:"Shift-Alt-ArrowDown",run:({state:e,dispatch:t})=>Yre(e,t,!0)},{key:"Escape",run:({state:e,dispatch:t})=>{let n=e.selection,o=null;return n.ranges.length>1?o=q3.create([n.main]):n.main.empty||(o=q3.create([q3.cursor(n.main.head)])),!!o&&(t(rre(e,o)),!0)}},{key:"Mod-Enter",run:Zre(!0)},{key:"Alt-l",mac:"Ctrl-l",run:({state:e,dispatch:t})=>{let n=Wre(e).map((({from:t,to:n})=>q3.range(t,Math.min(n+1,e.doc.length))));return t(e.update({selection:q3.create(n),userEvent:"select"})),!0}},{key:"Mod-i",run:({state:e,dispatch:t})=>{let n=ore(e.selection,(t=>{var n;for(let o=rne(e).resolveStack(t.from,1);o;o=o.next){let{node:e}=o;if((e.from=t.to||e.to>t.to&&e.from<=t.from)&&(null===(n=e.parent)||void 0===n?void 0:n.parent))return q3.range(e.to,e.from)}return t}));return t(rre(e,n)),!0},preventDefault:!0},{key:"Mod-[",run:Gre},{key:"Mod-]",run:Kre},{key:"Mod-Alt-\\",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=Object.create(null),o=new One(e,{overrideIndentation:e=>{let t=n[e];return null==t?-1:t}}),r=Ure(e,((t,r,i)=>{let l=yne(o,t.from);if(null==l)return;/\S/.test(t.text)||(l=0);let a=/^\s*/.exec(t.text)[0],s=bne(e,l);(a!=s||i.from{if(e.state.readOnly)return!1;let{state:t}=e,n=t.changes(Wre(t).map((({from:e,to:n})=>(e>0?e--:ne.moveVertically(t,!0))).map(n);return e.dispatch({changes:n,selection:o,scrollIntoView:!0,userEvent:"delete.line"}),!0}},{key:"Shift-Mod-\\",run:({state:e,dispatch:t})=>function(e,t,n){let o=!1,r=ore(e.selection,(t=>{let r=yoe(e,t.head,-1)||yoe(e,t.head,1)||t.head>0&&yoe(e,t.head-1,1)||t.head{let{state:t}=e,n=t.doc.lineAt(t.selection.main.from),o=Aoe(e.state,n.from);return o.line?Moe(e):!!o.block&&Eoe(e)}},{key:"Alt-A",run:Ioe}].concat([{key:"ArrowLeft",run:cre,shift:$re,preventDefault:!0},{key:"Mod-ArrowLeft",mac:"Alt-ArrowLeft",run:e=>dre(e,!sre(e)),shift:e=>kre(e,!sre(e)),preventDefault:!0},{mac:"Cmd-ArrowLeft",run:e=>ire(e,(t=>wre(e,t,!sre(e)))),shift:e=>Sre(e,(t=>wre(e,t,!sre(e)))),preventDefault:!0},{key:"ArrowRight",run:ure,shift:Cre,preventDefault:!0},{key:"Mod-ArrowRight",mac:"Alt-ArrowRight",run:e=>dre(e,sre(e)),shift:e=>kre(e,sre(e)),preventDefault:!0},{mac:"Cmd-ArrowRight",run:e=>ire(e,(t=>wre(e,t,sre(e)))),shift:e=>Sre(e,(t=>wre(e,t,sre(e)))),preventDefault:!0},{key:"ArrowUp",run:gre,shift:Tre,preventDefault:!0},{mac:"Cmd-ArrowUp",run:Dre,shift:zre},{mac:"Ctrl-ArrowUp",run:yre,shift:Ere},{key:"ArrowDown",run:mre,shift:Mre,preventDefault:!0},{mac:"Cmd-ArrowDown",run:Rre,shift:Bre},{mac:"Ctrl-ArrowDown",run:Ore,shift:Are},{key:"PageUp",run:yre,shift:Ere},{key:"PageDown",run:Ore,shift:Are},{key:"Home",run:e=>ire(e,(t=>wre(e,t,!1))),shift:e=>Sre(e,(t=>wre(e,t,!1))),preventDefault:!0},{key:"Mod-Home",run:Dre,shift:zre},{key:"End",run:e=>ire(e,(t=>wre(e,t,!0))),shift:e=>Sre(e,(t=>wre(e,t,!0))),preventDefault:!0},{key:"Mod-End",run:Rre,shift:Bre},{key:"Enter",run:Vre},{key:"Mod-a",run:({state:e,dispatch:t})=>(t(e.update({selection:{anchor:0,head:e.doc.length},userEvent:"select"})),!0)},{key:"Backspace",run:Qre,shift:Qre},{key:"Delete",run:Lre},{key:"Mod-Backspace",mac:"Alt-Backspace",run:Fre},{key:"Mod-Delete",mac:"Alt-Delete",run:e=>Hre(e,!0)},{mac:"Mod-Backspace",run:e=>jre(e,(t=>{let n=e.moveToLineBoundary(t,!1).head;return t.head>n?n:Math.max(0,t.head-1)}))},{mac:"Mod-Delete",run:e=>jre(e,(t=>{let n=e.moveToLineBoundary(t,!0).head;return t.headire(e,(t=>q3.cursor(e.lineBlockAt(t.head).from,1))),shift:e=>Sre(e,(t=>q3.cursor(e.lineBlockAt(t.head).from)))},{key:"Ctrl-e",run:e=>ire(e,(t=>q3.cursor(e.lineBlockAt(t.head).to,-1))),shift:e=>Sre(e,(t=>q3.cursor(e.lineBlockAt(t.head).to)))},{key:"Ctrl-d",run:Lre},{key:"Ctrl-h",run:Qre},{key:"Ctrl-k",run:e=>jre(e,(t=>{let n=e.lineBlockAt(t.head).to;return t.head{if(e.readOnly)return!1;let n=e.changeByRange((e=>({changes:{from:e.from,to:e.to,insert:O3.of(["",""])},range:q3.cursor(e.from)})));return t(e.update(n,{scrollIntoView:!0,userEvent:"input"})),!0}},{key:"Ctrl-t",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=e.changeByRange((t=>{if(!t.empty||0==t.from||t.from==e.doc.length)return{range:t};let n=t.from,o=e.doc.lineAt(n),r=n==o.from?n-1:D3(o.text,n-o.from,!1)+o.from,i=n==o.to?n+1:D3(o.text,n-o.from,!0)+o.from;return{changes:{from:r,to:i,insert:e.doc.slice(n,i).append(e.doc.slice(r,n))},range:q3.cursor(i)}}));return!n.changes.empty&&(t(e.update(n,{scrollIntoView:!0,userEvent:"move.character"})),!0)}},{key:"Ctrl-v",run:Ore}].map((e=>({mac:e.key,run:e.run,shift:e.shift}))))),Jre={key:"Tab",run:Kre,shift:Gre};function eie(){var e=arguments[0];"string"==typeof e&&(e=document.createElement(e));var t=1,n=arguments[1];if(n&&"object"==typeof n&&null==n.nodeType&&!Array.isArray(n)){for(var o in n)if(Object.prototype.hasOwnProperty.call(n,o)){var r=n[o];"string"==typeof r?e.setAttribute(o,r):null!=r&&(e[o]=r)}t++}for(;te.normalize("NFKD"):e=>e;class oie{constructor(e,t,n=0,o=e.length,r,i){this.test=i,this.value={from:0,to:0},this.done=!1,this.matches=[],this.buffer="",this.bufferPos=0,this.iter=e.iterRange(n,o),this.bufferStart=n,this.normalize=r?e=>r(nie(e)):nie,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 N3(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=_3(e),n=this.bufferStart+this.bufferPos;this.bufferPos+=Q3(e);let o=this.normalize(t);for(let r=0,i=n;;r++){let e=o.charCodeAt(r),l=this.match(e,i);if(r==o.length-1){if(l)return this.value=l,this;break}i==n&&rthis.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 n=this.curLineStart+t.index,o=n+t[0].length;if(this.matchPos=uie(this.text,o+(n==o?1:0)),n==this.curLineStart+this.curLine.length&&this.nextLine(),(nthis.value.to)&&(!this.test||this.test(n,o,t)))return this.value={from:n,to:o,match:t},this;e=this.matchPos-this.curLineStart}else{if(!(this.curLineStart+this.curLine.length=n||o.to<=t){let o=new sie(t,e.sliceString(t,n));return aie.set(e,o),o}if(o.from==t&&o.to==n)return o;let{text:r,from:i}=o;return i>t&&(r=e.sliceString(t,i)+r,i=t),o.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 e=this.flat.from+t.index,n=e+t[0].length;if((this.flat.to>=this.to||t.index+t[0].length<=this.flat.text.length-10)&&(!this.test||this.test(e,n,t)))return this.value={from:e,to:n,match:t},this.matchPos=uie(this.text,n+(e==n?1:0)),this}if(this.flat.to==this.to)return this.done=!0,this;this.flat=sie.get(this.text,this.flat.from,this.chunkEnd(this.flat.from+2*this.flat.text.length))}}}function uie(e,t){if(t>=e.length)return t;let n,o=e.lineAt(t);for(;t=56320&&n<57344;)t++;return t}function die(e){let t=eie("input",{class:"cm-textfield",name:"line",value:String(e.state.doc.lineAt(e.state.selection.main.head).number)});function n(){let n=/^([+-])?(\d+)?(:\d+)?(%)?$/.exec(t.value);if(!n)return;let{state:o}=e,r=o.doc.lineAt(o.selection.main.head),[,i,l,a,s]=n,c=a?+a.slice(1):0,u=l?+l:r.number;if(l&&s){let e=u/100;i&&(e=e*("-"==i?-1:1)+r.number/o.doc.lines),u=Math.round(o.doc.lines*e)}else l&&i&&(u=u*("-"==i?-1:1)+r.number);let d=o.doc.line(Math.max(1,Math.min(o.doc.lines,u))),p=q3.cursor(d.from+Math.max(0,Math.min(c,d.length)));e.dispatch({effects:[pie.of(!1),o9.scrollIntoView(p.from,{y:"center"})],selection:p}),e.focus()}return{dom:eie("form",{class:"cm-gotoLine",onkeydown:t=>{27==t.keyCode?(t.preventDefault(),e.dispatch({effects:pie.of(!1)}),e.focus()):13==t.keyCode&&(t.preventDefault(),n())},onsubmit:e=>{e.preventDefault(),n()}},eie("label",e.state.phrase("Go to line"),": ",t)," ",eie("button",{class:"cm-button",type:"submit"},e.state.phrase("go")))}}"undefined"!=typeof Symbol&&(lie.prototype[Symbol.iterator]=cie.prototype[Symbol.iterator]=function(){return this});const pie=E4.define(),hie=s4.define({create:()=>!0,update(e,t){for(let n of t.effects)n.is(pie)&&(e=n.value);return e},provide:e=>See.from(e,(e=>e?die:null))}),fie=o9.baseTheme({".cm-panel.cm-gotoLine":{padding:"2px 6px 4px","& label":{fontSize:"80%"}}}),gie={highlightWordAroundCursor:!1,minSelectionLength:1,maxMatches:100,wholeWords:!1},mie=t4.define({combine:e=>W4(e,gie,{highlightWordAroundCursor:(e,t)=>e||t,minSelectionLength:Math.min,maxMatches:Math.min})});function vie(e){let t=[Sie,wie];return e&&t.push(mie.of(e)),t}const bie=w8.mark({class:"cm-selectionMatch"}),yie=w8.mark({class:"cm-selectionMatch cm-selectionMatch-main"});function Oie(e,t,n,o){return!(0!=n&&e(t.sliceDoc(n-1,n))==_4.Word||o!=t.doc.length&&e(t.sliceDoc(o,o+1))==_4.Word)}const wie=X8.fromClass(class{constructor(e){this.decorations=this.getDeco(e)}update(e){(e.selectionSet||e.docChanged||e.viewportChanged)&&(this.decorations=this.getDeco(e.view))}getDeco(e){let t=e.state.facet(mie),{state:n}=e,o=n.selection;if(o.ranges.length>1)return w8.none;let r,i=o.main,l=null;if(i.empty){if(!t.highlightWordAroundCursor)return w8.none;let e=n.wordAt(i.head);if(!e)return w8.none;l=n.charCategorizer(i.head),r=n.sliceDoc(e.from,e.to)}else{let e=i.to-i.from;if(e200)return w8.none;if(t.wholeWords){if(r=n.sliceDoc(i.from,i.to),l=n.charCategorizer(i.head),!Oie(l,n,i.from,i.to)||!function(e,t,n,o){return e(t.sliceDoc(n,n+1))==_4.Word&&e(t.sliceDoc(o-1,o))==_4.Word}(l,n,i.from,i.to))return w8.none}else if(r=n.sliceDoc(i.from,i.to).trim(),!r)return w8.none}let a=[];for(let s of e.visibleRanges){let e=new oie(n.doc,r,s.from,s.to);for(;!e.next().done;){let{from:o,to:r}=e.value;if((!l||Oie(l,n,o,r))&&(i.empty&&o<=i.from&&r>=i.to?a.push(yie.range(o,r)):(o>=i.to||r<=i.from)&&a.push(bie.range(o,r)),a.length>t.maxMatches))return w8.none}}return w8.set(a)}},{decorations:e=>e.decorations}),Sie=o9.baseTheme({".cm-selectionMatch":{backgroundColor:"#99ff7780"},".cm-searchMatch .cm-selectionMatch":{backgroundColor:"transparent"}}),xie=t4.define({combine:e=>W4(e,{top:!1,caseSensitive:!1,literal:!1,regexp:!1,wholeWord:!1,createPanel:e=>new qie(e),scrollToMatch:e=>o9.scrollIntoView(e)})});class $ie{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||function(e){try{return new RegExp(e,iie),!0}catch(t){return!1}}(this.search)),this.unquoted=this.unquote(this.search),this.wholeWord=!!e.wholeWord}unquote(e){return this.literal?e:e.replace(/\\([nrt\\])/g,((e,t)=>"n"==t?"\n":"r"==t?"\r":"t"==t?"\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 Eie(this):new Pie(this)}getCursor(e,t=0,n){let o=e.doc?e:F4.create({doc:e});return null==n&&(n=o.doc.length),this.regexp?Tie(this,o,t,n):kie(this,o,t,n)}}class Cie{constructor(e){this.spec=e}}function kie(e,t,n,o){return new oie(t.doc,e.unquoted,n,o,e.caseSensitive?void 0:e=>e.toLowerCase(),e.wholeWord?(r=t.doc,i=t.charCategorizer(t.selection.main.head),(e,t,n,o)=>((o>e||o+n.length=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=kie(this.spec,e,Math.max(0,t-this.spec.unquoted.length),Math.min(n+this.spec.unquoted.length,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}function Tie(e,t,n,o){return new lie(t.doc,e.search,{ignoreCase:!e.caseSensitive,test:e.wholeWord?(r=t.charCategorizer(t.selection.main.head),(e,t,n)=>!n[0].length||(r(Mie(n.input,n.index))!=_4.Word||r(Iie(n.input,n.index))!=_4.Word)&&(r(Iie(n.input,n.index+n[0].length))!=_4.Word||r(Mie(n.input,n.index+n[0].length))!=_4.Word)):void 0},n,o);var r}function Mie(e,t){return e.slice(D3(e,t,!1),t)}function Iie(e,t){return e.slice(t,D3(e,t))}class Eie extends Cie{nextMatch(e,t,n){let o=Tie(this.spec,e,n,e.doc.length).next();return o.done&&(o=Tie(this.spec,e,0,t).next()),o.done?null:o.value}prevMatchInRange(e,t,n){for(let o=1;;o++){let r=Math.max(t,n-1e4*o),i=Tie(this.spec,e,r,n),l=null;for(;!i.next().done;)l=i.value;if(l&&(r==t||l.from>r+10))return l;if(r==t)return null}}prevMatch(e,t,n){return this.prevMatchInRange(e,0,t)||this.prevMatchInRange(e,n,e.doc.length)}getReplacement(e){return this.spec.unquote(this.spec.replace).replace(/\$([$&\d+])/g,((t,n)=>"$"==n?"$":"&"==n?e.match[0]:"0"!=n&&+n=t)return null;o.push(n.value)}return o}highlight(e,t,n,o){let r=Tie(this.spec,e,Math.max(0,t-250),Math.min(n+250,e.doc.length));for(;!r.next().done;)o(r.value.from,r.value.to)}}const Aie=E4.define(),Die=E4.define(),Rie=s4.define({create:e=>new zie(Yie(e).create(),null),update(e,t){for(let n of t.effects)n.is(Aie)?e=new zie(n.value.create(),e.panel):n.is(Die)&&(e=new zie(e.query,n.value?Xie:null));return e},provide:e=>See.from(e,(e=>e.panel))});class zie{constructor(e,t){this.query=e,this.panel=t}}const Bie=w8.mark({class:"cm-searchMatch"}),jie=w8.mark({class:"cm-searchMatch cm-searchMatch-selected"}),Nie=X8.fromClass(class{constructor(e){this.view=e,this.decorations=this.highlight(e.state.field(Rie))}update(e){let t=e.state.field(Rie);(t!=e.startState.field(Rie)||e.docChanged||e.selectionSet||e.viewportChanged)&&(this.decorations=this.highlight(t))}highlight({query:e,panel:t}){if(!t||!e.spec.valid)return w8.none;let{view:n}=this,o=new K4;for(let r=0,i=n.visibleRanges,l=i.length;ri[r+1].from-500;)a=i[++r].to;e.highlight(n.state,t,a,((e,t)=>{let r=n.state.selection.ranges.some((n=>n.from==e&&n.to==t));o.add(e,t,r?jie:Bie)}))}return o.finish()}},{decorations:e=>e.decorations});function _ie(e){return t=>{let n=t.state.field(Rie,!1);return n&&n.query.spec.valid?e(t,n):Uie(t)}}const Qie=_ie(((e,{query:t})=>{let{to:n}=e.state.selection.main,o=t.nextMatch(e.state,n,n);if(!o)return!1;let r=q3.single(o.from,o.to),i=e.state.facet(xie);return e.dispatch({selection:r,effects:[tle(e,o),i.scrollToMatch(r.main,e)],userEvent:"select.search"}),Zie(e),!0})),Lie=_ie(((e,{query:t})=>{let{state:n}=e,{from:o}=n.selection.main,r=t.prevMatch(n,o,o);if(!r)return!1;let i=q3.single(r.from,r.to),l=e.state.facet(xie);return e.dispatch({selection:i,effects:[tle(e,r),l.scrollToMatch(i.main,e)],userEvent:"select.search"}),Zie(e),!0})),Hie=_ie(((e,{query:t})=>{let n=t.matchAll(e.state,1e3);return!(!n||!n.length||(e.dispatch({selection:q3.create(n.map((e=>q3.range(e.from,e.to)))),userEvent:"select.search.matches"}),0))})),Fie=_ie(((e,{query:t})=>{let{state:n}=e,{from:o,to:r}=n.selection.main;if(n.readOnly)return!1;let i=t.nextMatch(n,o,o);if(!i)return!1;let l,a,s=[],c=[];if(i.from==o&&i.to==r&&(a=n.toText(t.getReplacement(i)),s.push({from:i.from,to:i.to,insert:a}),i=t.nextMatch(n,i.from,i.to),c.push(o9.announce.of(n.phrase("replaced match on line $",n.doc.lineAt(o).number)+"."))),i){let t=0==s.length||s[0].from>=i.to?0:i.to-i.from-a.length;l=q3.single(i.from-t,i.to-t),c.push(tle(e,i)),c.push(n.facet(xie).scrollToMatch(l.main,e))}return e.dispatch({changes:s,selection:l,effects:c,userEvent:"input.replace"}),!0})),Wie=_ie(((e,{query:t})=>{if(e.state.readOnly)return!1;let n=t.matchAll(e.state,1e9).map((e=>{let{from:n,to:o}=e;return{from:n,to:o,insert:t.getReplacement(e)}}));if(!n.length)return!1;let o=e.state.phrase("replaced $ matches",n.length)+".";return e.dispatch({changes:n,effects:o9.announce.of(o),userEvent:"input.replace.all"}),!0}));function Xie(e){return e.state.facet(xie).createPanel(e)}function Yie(e,t){var n,o,r,i,l;let a=e.selection.main,s=a.empty||a.to>a.from+100?"":e.sliceDoc(a.from,a.to);if(t&&!s)return t;let c=e.facet(xie);return new $ie({search:(null!==(n=null==t?void 0:t.literal)&&void 0!==n?n:c.literal)?s:s.replace(/\n/g,"\\n"),caseSensitive:null!==(o=null==t?void 0:t.caseSensitive)&&void 0!==o?o:c.caseSensitive,literal:null!==(r=null==t?void 0:t.literal)&&void 0!==r?r:c.literal,regexp:null!==(i=null==t?void 0:t.regexp)&&void 0!==i?i:c.regexp,wholeWord:null!==(l=null==t?void 0:t.wholeWord)&&void 0!==l?l:c.wholeWord})}function Vie(e){let t=bee(e,Xie);return t&&t.dom.querySelector("[main-field]")}function Zie(e){let t=Vie(e);t&&t==e.root.activeElement&&t.select()}const Uie=e=>{let t=e.state.field(Rie,!1);if(t&&t.panel){let n=Vie(e);if(n&&n!=e.root.activeElement){let o=Yie(e.state,t.query.spec);o.valid&&e.dispatch({effects:Aie.of(o)}),n.focus(),n.select()}}else e.dispatch({effects:[Die.of(!0),t?Aie.of(Yie(e.state,t.query.spec)):E4.appendConfig.of(ole)]});return!0},Kie=e=>{let t=e.state.field(Rie,!1);if(!t||!t.panel)return!1;let n=bee(e,Xie);return n&&n.dom.contains(e.root.activeElement)&&e.focus(),e.dispatch({effects:Die.of(!1)}),!0},Gie=[{key:"Mod-f",run:Uie,scope:"editor search-panel"},{key:"F3",run:Qie,shift:Lie,scope:"editor search-panel",preventDefault:!0},{key:"Mod-g",run:Qie,shift:Lie,scope:"editor search-panel",preventDefault:!0},{key:"Escape",run:Kie,scope:"editor search-panel"},{key:"Mod-Shift-l",run:({state:e,dispatch:t})=>{let n=e.selection;if(n.ranges.length>1||n.main.empty)return!1;let{from:o,to:r}=n.main,i=[],l=0;for(let a=new oie(e.doc,e.sliceDoc(o,r));!a.next().done;){if(i.length>1e3)return!1;a.value.from==o&&(l=i.length),i.push(q3.range(a.value.from,a.value.to))}return t(e.update({selection:q3.create(i,l),userEvent:"select.search.matches"})),!0}},{key:"Mod-Alt-g",run:e=>{let t=bee(e,die);if(!t){let n=[pie.of(!0)];null==e.state.field(hie,!1)&&n.push(E4.appendConfig.of([hie,fie])),e.dispatch({effects:n}),t=bee(e,die)}return t&&t.dom.querySelector("input").select(),!0}},{key:"Mod-d",run:({state:e,dispatch:t})=>{let{ranges:n}=e.selection;if(n.some((e=>e.from===e.to)))return(({state:e,dispatch:t})=>{let{selection:n}=e,o=q3.create(n.ranges.map((t=>e.wordAt(t.head)||q3.cursor(t.head))),n.mainIndex);return!o.eq(n)&&(t(e.update({selection:o})),!0)})({state:e,dispatch:t});let o=e.sliceDoc(n[0].from,n[0].to);if(e.selection.ranges.some((t=>e.sliceDoc(t.from,t.to)!=o)))return!1;let r=function(e,t){let{main:n,ranges:o}=e.selection,r=e.wordAt(n.head),i=r&&r.from==n.from&&r.to==n.to;for(let l=!1,a=new oie(e.doc,t,o[o.length-1].to);;){if(a.next(),!a.done){if(l&&o.some((e=>e.from==a.value.from)))continue;if(i){let t=e.wordAt(a.value.from);if(!t||t.from!=a.value.from||t.to!=a.value.to)continue}return a.value}if(l)return null;a=new oie(e.doc,t,0,Math.max(0,o[o.length-1].from-1)),l=!0}}(e,o);return!!r&&(t(e.update({selection:e.selection.addRange(q3.range(r.from,r.to),!1),effects:o9.scrollIntoView(r.to)})),!0)},preventDefault:!0}];class qie{constructor(e){this.view=e;let t=this.query=e.state.field(Rie).query.spec;function n(e,t,n){return eie("button",{class:"cm-button",name:e,onclick:t,type:"button"},n)}this.commit=this.commit.bind(this),this.searchField=eie("input",{value:t.search,placeholder:Jie(e,"Find"),"aria-label":Jie(e,"Find"),class:"cm-textfield",name:"search",form:"","main-field":"true",onchange:this.commit,onkeyup:this.commit}),this.replaceField=eie("input",{value:t.replace,placeholder:Jie(e,"Replace"),"aria-label":Jie(e,"Replace"),class:"cm-textfield",name:"replace",form:"",onchange:this.commit,onkeyup:this.commit}),this.caseField=eie("input",{type:"checkbox",name:"case",form:"",checked:t.caseSensitive,onchange:this.commit}),this.reField=eie("input",{type:"checkbox",name:"re",form:"",checked:t.regexp,onchange:this.commit}),this.wordField=eie("input",{type:"checkbox",name:"word",form:"",checked:t.wholeWord,onchange:this.commit}),this.dom=eie("div",{onkeydown:e=>this.keydown(e),class:"cm-search"},[this.searchField,n("next",(()=>Qie(e)),[Jie(e,"next")]),n("prev",(()=>Lie(e)),[Jie(e,"previous")]),n("select",(()=>Hie(e)),[Jie(e,"all")]),eie("label",null,[this.caseField,Jie(e,"match case")]),eie("label",null,[this.reField,Jie(e,"regexp")]),eie("label",null,[this.wordField,Jie(e,"by word")]),...e.state.readOnly?[]:[eie("br"),this.replaceField,n("replace",(()=>Fie(e)),[Jie(e,"replace")]),n("replaceAll",(()=>Wie(e)),[Jie(e,"replace all")])],eie("button",{name:"close",onclick:()=>Kie(e),"aria-label":Jie(e,"close"),type:"button"},["×"])])}commit(){let e=new $ie({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:Aie.of(e)}))}keydown(e){var t,n,o;t=this.view,n=e,o="search-panel",g9(h9(t.state),n,t,o)?e.preventDefault():13==e.keyCode&&e.target==this.searchField?(e.preventDefault(),(e.shiftKey?Lie:Qie)(this.view)):13==e.keyCode&&e.target==this.replaceField&&(e.preventDefault(),Fie(this.view))}update(e){for(let t of e.transactions)for(let e of t.effects)e.is(Aie)&&!e.value.eq(this.query)&&this.setQuery(e.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(xie).top}}function Jie(e,t){return e.state.phrase(t)}const ele=/[\s\.,:;?!]/;function tle(e,{from:t,to:n}){let o=e.state.doc.lineAt(t),r=e.state.doc.lineAt(n).to,i=Math.max(o.from,t-30),l=Math.min(r,n+30),a=e.state.sliceDoc(i,l);if(i!=o.from)for(let s=0;s<30;s++)if(!ele.test(a[s+1])&&ele.test(a[s])){a=a.slice(s);break}if(l!=r)for(let s=a.length-1;s>a.length-30;s--)if(!ele.test(a[s-1])&&ele.test(a[s])){a=a.slice(0,s);break}return o9.announce.of(`${e.state.phrase("current match")}. ${a} ${e.state.phrase("on line")} ${o.number}.`)}const nle=o9.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"}}),ole=[Rie,f4.low(Nie),nle];class rle{constructor(e,t,n){this.state=e,this.pos=t,this.explicit=n,this.abortListeners=[]}tokenBefore(e){let t=rne(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),n=Math.max(t.from,this.pos-250),o=t.text.slice(n-t.from,this.pos-t.from),r=o.search(cle(e,!1));return r<0?null:{from:n+r,to:this.pos,text:o.slice(r)}}get aborted(){return null==this.abortListeners}addEventListener(e,t){"abort"==e&&this.abortListeners&&this.abortListeners.push(t)}}function ile(e){let t=Object.keys(e).join(""),n=/\w/.test(t);return n&&(t=t.replace(/\w/g,"")),`[${n?"\\w":""}${t.replace(/[^\w\s]/g,"\\$&")}]`}function lle(e){let t=e.map((e=>"string"==typeof e?{label:e}:e)),[n,o]=t.every((e=>/^\w+$/.test(e.label)))?[/\w*$/,/\w+$/]:function(e){let t=Object.create(null),n=Object.create(null);for(let{label:r}of e){t[r[0]]=!0;for(let e=1;e{let r=e.matchBefore(o);return r||e.explicit?{from:r?r.from:e.pos,options:t,validFor:n}:null}}class ale{constructor(e,t,n,o){this.completion=e,this.source=t,this.match=n,this.score=o}}function sle(e){return e.selection.main.from}function cle(e,t){var n;let{source:o}=e,r=t&&"^"!=o[0],i="$"!=o[o.length-1];return r||i?new RegExp(`${r?"^":""}(?:${o})${i?"$":""}`,null!==(n=e.flags)&&void 0!==n?n:e.ignoreCase?"i":""):e}const ule=T4.define(),dle=new WeakMap;function ple(e){if(!Array.isArray(e))return e;let t=dle.get(e);return t||dle.set(e,t=lle(e)),t}const hle=E4.define(),fle=E4.define();class gle{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&&o<=57||o>=97&&o<=122?2:o>=65&&o<=90?1:0:(s=_3(o))!=s.toLowerCase()?1:s!=s.toUpperCase()?2:0;(!v||1==b&&g||0==y&&0!=b)&&(t[u]==o||n[u]==o&&(d=!0)?i[u++]=v:i.length&&(m=!1)),y=b,v+=Q3(o)}return u==a&&0==i[0]&&m?this.result((d?-200:0)-100,i,e):p==a&&0==h?this.ret(-200-e.length+(f==e.length?0:-100),[0,f]):l>-1?this.ret(-700-e.length,[l,l+this.pattern.length]):p==a?this.ret(-900-e.length,[h,f]):u==a?this.result((d?-200:0)-100-700+(m?0:-1100),i,e):2!=t.length&&this.result((o[0]?-700:0)-200-1100,o,e)}result(e,t,n){let o=[],r=0;for(let i of t){let e=i+(this.astral?Q3(N3(n,i)):1);r&&o[r-1]==i?o[r-1]=e:(o[r++]=i,o[r++]=e)}return this.ret(e-n.length,o)}}const mle=t4.define({combine:e=>W4(e,{activateOnTyping:!0,selectOnOpen:!0,override:null,closeOnBlur:!0,maxRenderedOptions:100,defaultKeymap:!0,tooltipClass:()=>"",optionClass:()=>"",aboveCursor:!1,icons:!0,addToOptions:[],positionInfo:ble,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)=>n=>vle(e(n),t(n)),optionClass:(e,t)=>n=>vle(e(n),t(n)),addToOptions:(e,t)=>e.concat(t)})});function vle(e,t){return e?t?e+" "+t:e:t}function ble(e,t,n,o,r,i){let l,a,s=e.textDirection==r6.RTL,c=s,u=!1,d="top",p=t.left-r.left,h=r.right-t.right,f=o.right-o.left,g=o.bottom-o.top;if(c&&p=g||e>t.top?l=n.bottom-t.top:(d="bottom",l=t.bottom-n.top)}return{style:`${d}: ${l/((t.bottom-t.top)/i.offsetHeight)}px; max-width: ${a/((t.right-t.left)/i.offsetWidth)}px`,class:"cm-completionInfo-"+(u?s?"left-narrow":"right-narrow":c?"left":"right")}}function yle(e,t,n){if(e<=n)return{from:0,to:e};if(t<0&&(t=0),t<=e>>1){let e=Math.floor(t/n);return{from:e*n,to:(e+1)*n}}let o=Math.floor((e-t)/n);return{from:e-(o+1)*n,to:e-o*n}}class Ole{constructor(e,t,n){this.view=e,this.stateField=t,this.applyCompletion=n,this.info=null,this.infoDestroy=null,this.placeInfoReq={read:()=>this.measureInfo(),write:e=>this.placeInfo(e),key:this},this.space=null,this.currentClass="";let o=e.state.field(t),{options:r,selected:i}=o.open,l=e.state.facet(mle);this.optionContent=function(e){let t=e.addToOptions.slice();return e.icons&&t.push({render(e){let t=document.createElement("div");return t.classList.add("cm-completionIcon"),e.type&&t.classList.add(...e.type.split(/\s+/g).map((e=>"cm-completionIcon-"+e))),t.setAttribute("aria-hidden","true"),t},position:20}),t.push({render(e,t,n,o){let r=document.createElement("span");r.className="cm-completionLabel";let i=e.displayLabel||e.label,l=0;for(let a=0;al&&r.appendChild(document.createTextNode(i.slice(l,e)));let n=r.appendChild(document.createElement("span"));n.appendChild(document.createTextNode(i.slice(e,t))),n.className="cm-completionMatchedText",l=t}return le.position-t.position)).map((e=>e.render))}(l),this.optionClass=l.optionClass,this.tooltipClass=l.tooltipClass,this.range=yle(r.length,i,l.maxRenderedOptions),this.dom=document.createElement("div"),this.dom.className="cm-tooltip-autocomplete",this.updateTooltipClass(e.state),this.dom.addEventListener("mousedown",(n=>{let{options:o}=e.state.field(t).open;for(let t,r=n.target;r&&r!=this.dom;r=r.parentNode)if("LI"==r.nodeName&&(t=/-(\d+)$/.exec(r.id))&&+t[1]{let n=e.state.field(this.stateField,!1);n&&n.tooltip&&e.state.facet(mle).closeOnBlur&&t.relatedTarget!=e.contentDOM&&e.dispatch({effects:fle.of(null)})})),this.showOptions(r,o.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 n=e.state.field(this.stateField),o=e.startState.field(this.stateField);if(this.updateTooltipClass(e.state),n!=o){let{options:r,selected:i,disabled:l}=n.open;o.open&&o.open.options==r||(this.range=yle(r.length,i,e.state.facet(mle).maxRenderedOptions),this.showOptions(r,n.id)),this.updateSel(),l!=(null===(t=o.open)||void 0===t?void 0:t.disabled)&&this.dom.classList.toggle("cm-tooltip-autocomplete-disabled",!!l)}}updateTooltipClass(e){let t=this.tooltipClass(e);if(t!=this.currentClass){for(let e of this.currentClass.split(" "))e&&this.dom.classList.remove(e);for(let e of t.split(" "))e&&this.dom.classList.add(e);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=yle(t.options.length,t.selected,this.view.state.facet(mle).maxRenderedOptions),this.showOptions(t.options,e.id)),this.updateSelectedOption(t.selected)){this.destroyInfo();let{completion:n}=t.options[t.selected],{info:o}=n;if(!o)return;let r="string"==typeof o?document.createTextNode(o):o(n);if(!r)return;"then"in r?r.then((t=>{t&&this.view.state.field(this.stateField,!1)==e&&this.addInfoPane(t,n)})).catch((e=>L8(this.view.state,e,"completion info"))):this.addInfoPane(r,n)}}addInfoPane(e,t){this.destroyInfo();let n=this.info=document.createElement("div");if(n.className="cm-tooltip cm-completionInfo",null!=e.nodeType)n.appendChild(e),this.infoDestroy=null;else{let{dom:t,destroy:o}=e;n.appendChild(t),this.infoDestroy=o||null}this.dom.appendChild(n),this.view.requestMeasure(this.placeInfoReq)}updateSelectedOption(e){let t=null;for(let n=this.list.firstChild,o=this.range.from;n;n=n.nextSibling,o++)"LI"==n.nodeName&&n.id?o==e?n.hasAttribute("aria-selected")||(n.setAttribute("aria-selected","true"),t=n):n.hasAttribute("aria-selected")&&n.removeAttribute("aria-selected"):o--;return t&&function(e,t){let n=e.getBoundingClientRect(),o=t.getBoundingClientRect(),r=n.height/e.offsetHeight;o.topn.bottom&&(e.scrollTop+=(o.bottom-n.bottom)/r)}(this.list,t),t}measureInfo(){let e=this.dom.querySelector("[aria-selected]");if(!e||!this.info)return null;let t=this.dom.getBoundingClientRect(),n=this.info.getBoundingClientRect(),o=e.getBoundingClientRect(),r=this.space;if(!r){let e=this.dom.ownerDocument.defaultView||window;r={left:0,top:0,right:e.innerWidth,bottom:e.innerHeight}}return o.top>Math.min(r.bottom,t.bottom)-10||o.bottomn.from||0==n.from)&&(r=e,"string"!=typeof s&&s.header?o.appendChild(s.header(s)):o.appendChild(document.createElement("completion-section")).textContent=e)}const c=o.appendChild(document.createElement("li"));c.id=t+"-"+i,c.setAttribute("role","option");let u=this.optionClass(l);u&&(c.className=u);for(let e of this.optionContent){let t=e(l,this.view.state,this.view,a);t&&c.appendChild(t)}}return n.from&&o.classList.add("cm-completionListIncompleteTop"),n.tonew Ole(n,e,t)}function Sle(e){return 100*(e.boost||0)+(e.apply?10:0)+(e.info?5:0)+(e.type?1:0)}class xle{constructor(e,t,n,o,r,i){this.options=e,this.attrs=t,this.tooltip=n,this.timestamp=o,this.selected=r,this.disabled=i}setSelected(e,t){return e==this.selected||e>=this.options.length?this:new xle(this.options,kle(t,e),this.tooltip,this.timestamp,e,this.disabled)}static build(e,t,n,o,r){let i=function(e,t){let n=[],o=null,r=e=>{n.push(e);let{section:t}=e.completion;if(t){o||(o=[]);let e="string"==typeof t?t:t.name;o.some((t=>t.name==e))||o.push("string"==typeof t?{name:e}:t)}};for(let s of e)if(s.hasResult()){let e=s.result.getMatch;if(!1===s.result.filter)for(let t of s.result.options)r(new ale(t,s.source,e?e(t):[],1e9-n.length));else{let n=new gle(t.sliceDoc(s.from,s.to));for(let t of s.result.options)if(n.match(t.label)){let o=t.displayLabel?e?e(t,n.matched):[]:n.matched;r(new ale(t,s.source,o,n.score+(t.boost||0)))}}}if(o){let e=Object.create(null),t=0,r=(e,t)=>{var n,o;return(null!==(n=e.rank)&&void 0!==n?n:1e9)-(null!==(o=t.rank)&&void 0!==o?o:1e9)||(e.namet.score-e.score||a(e.completion,t.completion)))){let e=s.completion;!l||l.label!=e.label||l.detail!=e.detail||null!=l.type&&null!=e.type&&l.type!=e.type||l.apply!=e.apply||l.boost!=e.boost?i.push(s):Sle(s.completion)>Sle(l)&&(i[i.length-1]=s),l=s.completion}return i}(e,t);if(!i.length)return o&&e.some((e=>1==e.state))?new xle(o.options,o.attrs,o.tooltip,o.timestamp,o.selected,!0):null;let l=t.facet(mle).selectOnOpen?0:-1;if(o&&o.selected!=l&&-1!=o.selected){let e=o.options[o.selected].completion;for(let t=0;tt.hasResult()?Math.min(e,t.from):e),1e8),create:zle,above:r.aboveCursor},o?o.timestamp:Date.now(),l,!1)}map(e){return new xle(this.options,this.attrs,Object.assign(Object.assign({},this.tooltip),{pos:e.mapPos(this.tooltip.pos)}),this.timestamp,this.selected,this.disabled)}}class $le{constructor(e,t,n){this.active=e,this.id=t,this.open=n}static start(){return new $le(Ple,"cm-ac-"+Math.floor(2e6*Math.random()).toString(36),null)}update(e){let{state:t}=e,n=t.facet(mle),o=(n.override||t.languageDataAt("autocomplete",sle(t)).map(ple)).map((t=>(this.active.find((e=>e.source==t))||new Mle(t,this.active.some((e=>0!=e.state))?1:0)).update(e,n)));o.length==this.active.length&&o.every(((e,t)=>e==this.active[t]))&&(o=this.active);let r=this.open;r&&e.docChanged&&(r=r.map(e.changes)),e.selection||o.some((t=>t.hasResult()&&e.changes.touchesRange(t.from,t.to)))||!function(e,t){if(e==t)return!0;for(let n=0,o=0;;){for(;n1==e.state))&&(r=null),!r&&o.every((e=>1!=e.state))&&o.some((e=>e.hasResult()))&&(o=o.map((e=>e.hasResult()?new Mle(e.source,0):e)));for(let i of e.effects)i.is(Ale)&&(r=r&&r.setSelected(i.value,this.id));return o==this.active&&r==this.open?this:new $le(o,this.id,r)}get tooltip(){return this.open?this.open.tooltip:null}get attrs(){return this.open?this.open.attrs:Cle}}const Cle={"aria-autocomplete":"list"};function kle(e,t){let n={"aria-autocomplete":"list","aria-haspopup":"listbox","aria-controls":e};return t>-1&&(n["aria-activedescendant"]=e+"-"+t),n}const Ple=[];function Tle(e){return e.isUserEvent("input.type")?"input":e.isUserEvent("delete.backward")?"delete":null}class Mle{constructor(e,t,n=-1){this.source=e,this.state=t,this.explicitPos=n}hasResult(){return!1}update(e,t){let n=Tle(e),o=this;n?o=o.handleUserEvent(e,n,t):e.docChanged?o=o.handleChange(e):e.selection&&0!=o.state&&(o=new Mle(o.source,0));for(let r of e.effects)if(r.is(hle))o=new Mle(o.source,1,r.value?sle(e.state):-1);else if(r.is(fle))o=new Mle(o.source,0);else if(r.is(Ele))for(let e of r.value)e.source==o.source&&(o=e);return o}handleUserEvent(e,t,n){return"delete"!=t&&n.activateOnTyping?new Mle(this.source,1):this.map(e.changes)}handleChange(e){return e.changes.touchesRange(sle(e.startState))?new Mle(this.source,0):this.map(e.changes)}map(e){return e.empty||this.explicitPos<0?this:new Mle(this.source,this.state,e.mapPos(this.explicitPos))}}class Ile extends Mle{constructor(e,t,n,o,r){super(e,2,t),this.result=n,this.from=o,this.to=r}hasResult(){return!0}handleUserEvent(e,t,n){var o;let r=e.changes.mapPos(this.from),i=e.changes.mapPos(this.to,1),l=sle(e.state);if((this.explicitPos<0?l<=r:li||"delete"==t&&sle(e.startState)==this.from)return new Mle(this.source,"input"==t&&n.activateOnTyping?1:0);let a,s=this.explicitPos<0?-1:e.changes.mapPos(this.explicitPos);return function(e,t,n,o){if(!e)return!1;let r=t.sliceDoc(n,o);return"function"==typeof e?e(r,n,o,t):cle(e,!0).test(r)}(this.result.validFor,e.state,r,i)?new Ile(this.source,s,this.result,r,i):this.result.update&&(a=this.result.update(this.result,r,i,new rle(e.state,l,s>=0)))?new Ile(this.source,s,a,a.from,null!==(o=a.to)&&void 0!==o?o:sle(e.state)):new Mle(this.source,1,s)}handleChange(e){return e.changes.touchesRange(this.from,this.to)?new Mle(this.source,0):this.map(e.changes)}map(e){return e.empty?this:new Ile(this.source,this.explicitPos<0?-1:e.mapPos(this.explicitPos),this.result,e.mapPos(this.from),e.mapPos(this.to,1))}}const Ele=E4.define({map:(e,t)=>e.map((e=>e.map(t)))}),Ale=E4.define(),Dle=s4.define({create:()=>$le.start(),update:(e,t)=>e.update(t),provide:e=>[cee.from(e,(e=>e.tooltip)),o9.contentAttributes.from(e,(e=>e.attrs))]});function Rle(e,t){const n=t.completion.apply||t.completion.label;let o=e.state.field(Dle).active.find((e=>e.source==t.source));return o instanceof Ile&&("string"==typeof n?e.dispatch(Object.assign(Object.assign({},function(e,t,n,o){let{main:r}=e.selection,i=n-r.from,l=o-r.from;return Object.assign(Object.assign({},e.changeByRange((a=>a!=r&&n!=o&&e.sliceDoc(a.from+i,a.from+l)!=e.sliceDoc(n,o)?{range:a}:{changes:{from:a.from+i,to:o==r.from?a.to:a.from+l,insert:t},range:q3.cursor(a.from+i+t.length)}))),{scrollIntoView:!0,userEvent:"input.complete"})}(e.state,n,o.from,o.to)),{annotations:ule.of(t.completion)})):n(e,t.completion,o.from,o.to),!0)}const zle=wle(Dle,Rle);function Ble(e,t="option"){return n=>{let o=n.state.field(Dle,!1);if(!o||!o.open||o.open.disabled||Date.now()-o.open.timestamp-1?o.open.selected+i*(e?1:-1):e?0:l-1;return a<0?a="page"==t?0:l-1:a>=l&&(a="page"==t?l-1:0),n.dispatch({effects:Ale.of(a)}),!0}}class jle{constructor(e,t){this.active=e,this.context=t,this.time=Date.now(),this.updates=[],this.done=void 0}}const Nle=X8.fromClass(class{constructor(e){this.view=e,this.debounceUpdate=-1,this.running=[],this.debounceAccept=-1,this.composing=0;for(let t of e.state.field(Dle).active)1==t.state&&this.startQuery(t)}update(e){let t=e.state.field(Dle);if(!e.selectionSet&&!e.docChanged&&e.startState.field(Dle)==t)return;let n=e.transactions.some((e=>(e.selection||e.docChanged)&&!Tle(e)));for(let o=0;o50&&Date.now()-t.time>1e3){for(let e of t.context.abortListeners)try{e()}catch(Fpe){L8(this.view.state,Fpe)}t.context.abortListeners=null,this.running.splice(o--,1)}else t.updates.push(...e.transactions)}if(this.debounceUpdate>-1&&clearTimeout(this.debounceUpdate),this.debounceUpdate=t.active.some((e=>1==e.state&&!this.running.some((t=>t.active.source==e.source))))?setTimeout((()=>this.startUpdate()),50):-1,0!=this.composing)for(let o of e.transactions)"input"==Tle(o)?this.composing=2:2==this.composing&&o.selection&&(this.composing=3)}startUpdate(){this.debounceUpdate=-1;let{state:e}=this.view,t=e.field(Dle);for(let n of t.active)1!=n.state||this.running.some((e=>e.active.source==n.source))||this.startQuery(n)}startQuery(e){let{state:t}=this.view,n=sle(t),o=new rle(t,n,e.explicitPos==n),r=new jle(e,o);this.running.push(r),Promise.resolve(e.source(o)).then((e=>{r.context.aborted||(r.done=e||null,this.scheduleAccept())}),(e=>{this.view.dispatch({effects:fle.of(null)}),L8(this.view.state,e)}))}scheduleAccept(){this.running.every((e=>void 0!==e.done))?this.accept():this.debounceAccept<0&&(this.debounceAccept=setTimeout((()=>this.accept()),this.view.state.facet(mle).updateSyncTime))}accept(){var e;this.debounceAccept>-1&&clearTimeout(this.debounceAccept),this.debounceAccept=-1;let t=[],n=this.view.state.facet(mle);for(let o=0;oe.source==r.active.source));if(i&&1==i.state)if(null==r.done){let e=new Mle(r.active.source,0);for(let t of r.updates)e=e.update(t,n);1!=e.state&&t.push(e)}else this.startQuery(i)}t.length&&this.view.dispatch({effects:Ele.of(t)})}},{eventHandlers:{blur(e){let t=this.view.state.field(Dle,!1);if(t&&t.tooltip&&this.view.state.facet(mle).closeOnBlur){let n=t.open&&gee(this.view,t.open.tooltip);n&&n.dom.contains(e.relatedTarget)||this.view.dispatch({effects:fle.of(null)})}},compositionstart(){this.composing=1},compositionend(){3==this.composing&&setTimeout((()=>this.view.dispatch({effects:hle.of(!1)})),20),this.composing=0}}}),_le=o9.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 Qle{constructor(e,t,n,o){this.field=e,this.line=t,this.from=n,this.to=o}}class Lle{constructor(e,t,n){this.field=e,this.from=t,this.to=n}map(e){let t=e.mapPos(this.from,-1,H3.TrackDel),n=e.mapPos(this.to,1,H3.TrackDel);return null==t||null==n?null:new Lle(this.field,t,n)}}class Hle{constructor(e,t){this.lines=e,this.fieldPositions=t}instantiate(e,t){let n=[],o=[t],r=e.doc.lineAt(t),i=/^\s*/.exec(r.text)[0];for(let l of this.lines){if(n.length){let n=i,r=/^\t*/.exec(l)[0].length;for(let t=0;tnew Lle(e.field,o[e.line]+e.from,o[e.line]+e.to)))}}static parse(e){let t,n=[],o=[],r=[];for(let i of e.split(/\r\n?|\n/)){for(;t=/[#$]\{(?:(\d+)(?::([^}]*))?|([^}]*))\}/.exec(i);){let e=t[1]?+t[1]:null,l=t[2]||t[3]||"",a=-1;for(let t=0;t=a&&e.field++}r.push(new Qle(a,o.length,t.index,t.index+l.length)),i=i.slice(0,t.index)+l+i.slice(t.index+t[0].length)}for(let e;e=/\\([{}])/.exec(i);){i=i.slice(0,e.index)+e[1]+i.slice(e.index+e[0].length);for(let t of r)t.line==o.length&&t.from>e.index&&(t.from--,t.to--)}o.push(i)}return new Hle(o,r)}}let Fle=w8.widget({widget:new class extends y8{toDOM(){let e=document.createElement("span");return e.className="cm-snippetFieldPosition",e}ignoreEvent(){return!1}}}),Wle=w8.mark({class:"cm-snippetField"});class Xle{constructor(e,t){this.ranges=e,this.active=t,this.deco=w8.set(e.map((e=>(e.from==e.to?Fle:Wle).range(e.from,e.to))))}map(e){let t=[];for(let n of this.ranges){let o=n.map(e);if(!o)return null;t.push(o)}return new Xle(t,this.active)}selectionInsideField(e){return e.ranges.every((e=>this.ranges.some((t=>t.field==this.active&&t.from<=e.from&&t.to>=e.to))))}}const Yle=E4.define({map:(e,t)=>e&&e.map(t)}),Vle=E4.define(),Zle=s4.define({create:()=>null,update(e,t){for(let n of t.effects){if(n.is(Yle))return n.value;if(n.is(Vle)&&e)return new Xle(e.ranges,n.value)}return e&&t.docChanged&&(e=e.map(t.changes)),e&&t.selection&&!e.selectionInsideField(t.selection)&&(e=null),e},provide:e=>o9.decorations.from(e,(e=>e?e.deco:w8.none))});function Ule(e,t){return q3.create(e.filter((e=>e.field==t)).map((e=>q3.range(e.from,e.to))))}function Kle(e){let t=Hle.parse(e);return(e,n,o,r)=>{let{text:i,ranges:l}=t.instantiate(e.state,o),a={changes:{from:o,to:r,insert:O3.of(i)},scrollIntoView:!0,annotations:n?ule.of(n):void 0};if(l.length&&(a.selection=Ule(l,0)),l.length>1){let t=new Xle(l,0),n=a.effects=[Yle.of(t)];void 0===e.state.field(Zle,!1)&&n.push(E4.appendConfig.of([Zle,eae,nae,_le]))}e.dispatch(e.state.update(a))}}function Gle(e){return({state:t,dispatch:n})=>{let o=t.field(Zle,!1);if(!o||e<0&&0==o.active)return!1;let r=o.active+e,i=e>0&&!o.ranges.some((t=>t.field==r+e));return n(t.update({selection:Ule(o.ranges,r),effects:Yle.of(i?null:new Xle(o.ranges,r)),scrollIntoView:!0})),!0}}const qle=[{key:"Tab",run:Gle(1),shift:Gle(-1)},{key:"Escape",run:({state:e,dispatch:t})=>!!e.field(Zle,!1)&&(t(e.update({effects:Yle.of(null)})),!0)}],Jle=t4.define({combine:e=>e.length?e[0]:qle}),eae=f4.highest(d9.compute([Jle],(e=>e.facet(Jle))));function tae(e,t){return Object.assign(Object.assign({},t),{apply:Kle(e)})}const nae=o9.domEventHandlers({mousedown(e,t){let n,o=t.state.field(Zle,!1);if(!o||null==(n=t.posAtCoords({x:e.clientX,y:e.clientY})))return!1;let r=o.ranges.find((e=>e.from<=n&&e.to>=n));return!(!r||r.field==o.active||(t.dispatch({selection:Ule(o.ranges,r.field),effects:Yle.of(o.ranges.some((e=>e.field>r.field))?new Xle(o.ranges,r.field):null),scrollIntoView:!0}),0))}}),oae={brackets:["(","[","{","'",'"'],before:")]}:;>",stringPrefixes:[]},rae=E4.define({map(e,t){let n=t.mapPos(e,-1,H3.TrackAfter);return null==n?void 0:n}}),iae=new class extends X4{};iae.startSide=1,iae.endSide=-1;const lae=s4.define({create:()=>U4.empty,update(e,t){if(e=e.map(t.changes),t.selection){let n=t.state.doc.lineAt(t.selection.main.head);e=e.update({filter:e=>e>=n.from&&e<=n.to})}for(let n of t.effects)n.is(rae)&&(e=e.update({add:[iae.range(n.value,n.value+1)]}));return e}}),aae="()[]{}<>";function sae(e){for(let t=0;t<8;t+=2)if(aae.charCodeAt(t)==e)return aae.charAt(t+1);return _3(e<128?e:e+1)}function cae(e,t){return e.languageDataAt("closeBrackets",t)[0]||oae}const uae="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),dae=o9.inputHandler.of(((e,t,n,o)=>{if((uae?e.composing:e.compositionStarted)||e.state.readOnly)return!1;let r=e.state.selection.main;if(o.length>2||2==o.length&&1==Q3(N3(o,0))||t!=r.from||n!=r.to)return!1;let i=function(e,t){let n=cae(e,e.selection.main.head),o=n.brackets||oae.brackets;for(let r of o){let i=sae(N3(r,0));if(t==r)return i==r?vae(e,r,o.indexOf(r+r+r)>-1,n):gae(e,r,i,n.before||oae.before);if(t==i&&hae(e,e.selection.main.from))return mae(e,0,i)}return null}(e.state,o);return!!i&&(e.dispatch(i),!0)})),pae=[{key:"Backspace",run:({state:e,dispatch:t})=>{if(e.readOnly)return!1;let n=cae(e,e.selection.main.head).brackets||oae.brackets,o=null,r=e.changeByRange((t=>{if(t.empty){let o=function(e,t){let n=e.sliceString(t-2,t);return Q3(N3(n,0))==n.length?n:n.slice(1)}(e.doc,t.head);for(let r of n)if(r==o&&fae(e.doc,t.head)==sae(N3(r,0)))return{changes:{from:t.head-r.length,to:t.head+r.length},range:q3.cursor(t.head-r.length)}}return{range:o=t}}));return o||t(e.update(r,{scrollIntoView:!0,userEvent:"delete.backward"})),!o}}];function hae(e,t){let n=!1;return e.field(lae).between(0,e.doc.length,(e=>{e==t&&(n=!0)})),n}function fae(e,t){let n=e.sliceString(t,t+2);return n.slice(0,Q3(N3(n,0)))}function gae(e,t,n,o){let r=null,i=e.changeByRange((i=>{if(!i.empty)return{changes:[{insert:t,from:i.from},{insert:n,from:i.to}],effects:rae.of(i.to+t.length),range:q3.range(i.anchor+t.length,i.head+t.length)};let l=fae(e.doc,i.head);return!l||/\s/.test(l)||o.indexOf(l)>-1?{changes:{insert:t+n,from:i.head},effects:rae.of(i.head+t.length),range:q3.cursor(i.head+t.length)}:{range:r=i}}));return r?null:e.update(i,{scrollIntoView:!0,userEvent:"input.type"})}function mae(e,t,n){let o=null,r=e.changeByRange((t=>t.empty&&fae(e.doc,t.head)==n?{changes:{from:t.head,to:t.head+n.length,insert:n},range:q3.cursor(t.head+n.length)}:o={range:t}));return o?null:e.update(r,{scrollIntoView:!0,userEvent:"input.type"})}function vae(e,t,n,o){let r=o.stringPrefixes||oae.stringPrefixes,i=null,l=e.changeByRange((o=>{if(!o.empty)return{changes:[{insert:t,from:o.from},{insert:t,from:o.to}],effects:rae.of(o.to+t.length),range:q3.range(o.anchor+t.length,o.head+t.length)};let l,a=o.head,s=fae(e.doc,a);if(s==t){if(bae(e,a))return{changes:{insert:t+t,from:a},effects:rae.of(a+t.length),range:q3.cursor(a+t.length)};if(hae(e,a)){let o=n&&e.sliceDoc(a,a+3*t.length)==t+t+t?t+t+t:t;return{changes:{from:a,to:a+o.length,insert:o},range:q3.cursor(a+o.length)}}}else{if(n&&e.sliceDoc(a-2*t.length,a)==t+t&&(l=yae(e,a-2*t.length,r))>-1&&bae(e,l))return{changes:{insert:t+t+t+t,from:a},effects:rae.of(a+t.length),range:q3.cursor(a+t.length)};if(e.charCategorizer(a)(s)!=_4.Word&&yae(e,a,r)>-1&&!function(e,t,n,o){let r=rne(e).resolveInner(t,-1),i=o.reduce(((e,t)=>Math.max(e,t.length)),0);for(let l=0;l<5;l++){let l=e.sliceDoc(r.from,Math.min(r.to,r.from+n.length+i)),a=l.indexOf(n);if(!a||a>-1&&o.indexOf(l.slice(0,a))>-1){let t=r.firstChild;for(;t&&t.from==r.from&&t.to-t.from>n.length+a;){if(e.sliceDoc(t.to-n.length,t.to)==n)return!1;t=t.firstChild}return!0}let s=r.to==t&&r.parent;if(!s)break;r=s}return!1}(e,a,t,r))return{changes:{insert:t+t,from:a},effects:rae.of(a+t.length),range:q3.cursor(a+t.length)}}return{range:i=o}}));return i?null:e.update(l,{scrollIntoView:!0,userEvent:"input.type"})}function bae(e,t){let n=rne(e).resolveInner(t+1);return n.parent&&n.from==t}function yae(e,t,n){let o=e.charCategorizer(t);if(o(e.sliceDoc(t-1,t))!=_4.Word)return t;for(let r of n){let n=t-r.length;if(e.sliceDoc(n,t)==r&&o(e.sliceDoc(n-1,n))!=_4.Word)return n}return-1}function Oae(e={}){return[Dle,mle.of(e),Nle,Sae,_le]}const wae=[{key:"Ctrl-Space",run:e=>!!e.state.field(Dle,!1)&&(e.dispatch({effects:hle.of(!0)}),!0)},{key:"Escape",run:e=>{let t=e.state.field(Dle,!1);return!(!t||!t.active.some((e=>0!=e.state))||(e.dispatch({effects:fle.of(null)}),0))}},{key:"ArrowDown",run:Ble(!0)},{key:"ArrowUp",run:Ble(!1)},{key:"PageDown",run:Ble(!0,"page")},{key:"PageUp",run:Ble(!1,"page")},{key:"Enter",run:e=>{let t=e.state.field(Dle,!1);return!(e.state.readOnly||!t||!t.open||t.open.selected<0||t.open.disabled||Date.now()-t.open.timestampe.facet(mle).defaultKeymap?[wae]:[])));class xae{constructor(e,t,n){this.from=e,this.to=t,this.diagnostic=n}}class $ae{constructor(e,t,n){this.diagnostics=e,this.panel=t,this.selected=n}static init(e,t,n){let o=e,r=n.facet(Nae).markerFilter;r&&(o=r(o));let i=w8.set(o.map((e=>e.from==e.to||e.from==e.to-1&&n.doc.lineAt(e.from).to==e.from?w8.widget({widget:new Fae(e),diagnostic:e}).range(e.from):w8.mark({attributes:{class:"cm-lintRange cm-lintRange-"+e.severity+(e.markClass?" "+e.markClass:"")},diagnostic:e}).range(e.from,e.to))),!0);return new $ae(i,t,Cae(i))}}function Cae(e,t=null,n=0){let o=null;return e.between(n,1e9,((e,n,{spec:r})=>{if(!t||r.diagnostic==t)return o=new xae(e,n,r.diagnostic),!1})),o}function kae(e,t){let n=e.startState.doc.lineAt(t.pos);return!(!e.effects.some((e=>e.is(Tae)))&&!e.changes.touchesRange(n.from,n.to))}function Pae(e,t){return e.field(Eae,!1)?t:t.concat(E4.appendConfig.of(ose))}const Tae=E4.define(),Mae=E4.define(),Iae=E4.define(),Eae=s4.define({create:()=>new $ae(w8.none,null,null),update(e,t){if(t.docChanged){let n=e.diagnostics.map(t.changes),o=null;if(e.selected){let r=t.changes.mapPos(e.selected.from,1);o=Cae(n,e.selected.diagnostic,r)||Cae(n,null,r)}e=new $ae(n,e.panel,o)}for(let n of t.effects)n.is(Tae)?e=$ae.init(n.value,e.panel,t.state):n.is(Mae)?e=new $ae(e.diagnostics,n.value?Xae.open:null,e.selected):n.is(Iae)&&(e=new $ae(e.diagnostics,e.panel,n.value));return e},provide:e=>[See.from(e,(e=>e.panel)),o9.decorations.from(e,(e=>e.diagnostics))]}),Aae=w8.mark({class:"cm-lintRange cm-lintRange-active"});function Dae(e,t,n){let{diagnostics:o}=e.state.field(Eae),r=[],i=2e8,l=0;o.between(t-(n<0?1:0),t+(n>0?1:0),((e,o,{spec:a})=>{t>=e&&t<=o&&(e==o||(t>e||n>0)&&(t({dom:Rae(e,r)})}:null}function Rae(e,t){return eie("ul",{class:"cm-tooltip-lint"},t.map((t=>Hae(e,t,!1))))}const zae=e=>{let t=e.state.field(Eae,!1);return!(!t||!t.panel||(e.dispatch({effects:Mae.of(!1)}),0))},Bae=[{key:"Mod-Shift-m",run:e=>{let t=e.state.field(Eae,!1);t&&t.panel||e.dispatch({effects:Pae(e.state,[Mae.of(!0)])});let n=bee(e,Xae.open);return n&&n.dom.querySelector(".cm-panel-lint ul").focus(),!0},preventDefault:!0},{key:"F8",run:e=>{let t=e.state.field(Eae,!1);if(!t)return!1;let n=e.state.selection.main,o=t.diagnostics.iter(n.to+1);return!(!o.value&&(o=t.diagnostics.iter(0),!o.value||o.from==n.from&&o.to==n.to)||(e.dispatch({selection:{anchor:o.from,head:o.to},scrollIntoView:!0}),0))}}],jae=X8.fromClass(class{constructor(e){this.view=e,this.timeout=-1,this.set=!0;let{delay:t}=e.state.facet(Nae);this.lintTime=Date.now()+t,this.run=this.run.bind(this),this.timeout=setTimeout(this.run,t)}run(){let e=Date.now();if(ePromise.resolve(e(this.view))))).then((t=>{let n=t.reduce(((e,t)=>e.concat(t)));this.view.state.doc==e.doc&&this.view.dispatch(function(e,t){return{effects:Pae(e,[Tae.of(t)])}}(this.view.state,n))}),(e=>{L8(this.view.state,e)}))}}update(e){let t=e.state.facet(Nae);(e.docChanged||t!=e.startState.facet(Nae)||t.needsRefresh&&t.needsRefresh(e))&&(this.lintTime=Date.now()+t.delay,this.set||(this.set=!0,this.timeout=setTimeout(this.run,t.delay)))}force(){this.set&&(this.lintTime=Date.now(),this.run())}destroy(){clearTimeout(this.timeout)}}),Nae=t4.define({combine:e=>Object.assign({sources:e.map((e=>e.source))},W4(e.map((e=>e.config)),{delay:750,markerFilter:null,tooltipFilter:null,needsRefresh:null},{needsRefresh:(e,t)=>e?t?n=>e(n)||t(n):e:t}))});function _ae(e,t={}){return[Nae.of({source:e,config:t}),jae,ose]}function Qae(e){let t=e.plugin(jae);t&&t.force()}function Lae(e){let t=[];if(e)e:for(let{name:n}of e){for(let e=0;ee.toLowerCase()==o.toLowerCase()))){t.push(o);continue e}}t.push("")}return t}function Hae(e,t,n){var o;let r=n?Lae(t.actions):[];return eie("li",{class:"cm-diagnostic cm-diagnostic-"+t.severity},eie("span",{class:"cm-diagnosticText"},t.renderMessage?t.renderMessage():t.message),null===(o=t.actions)||void 0===o?void 0:o.map(((n,o)=>{let i=!1,l=o=>{if(o.preventDefault(),i)return;i=!0;let r=Cae(e.state.field(Eae).diagnostics,t);r&&n.apply(e,r.from,r.to)},{name:a}=n,s=r[o]?a.indexOf(r[o]):-1,c=s<0?a:[a.slice(0,s),eie("u",a.slice(s,s+1)),a.slice(s+1)];return eie("button",{type:"button",class:"cm-diagnosticAction",onclick:l,onmousedown:l,"aria-label":` Action: ${a}${s<0?"":` (access key "${r[o]})"`}.`},c)})),t.source&&eie("div",{class:"cm-diagnosticSource"},t.source))}class Fae extends y8{constructor(e){super(),this.diagnostic=e}eq(e){return e.diagnostic==this.diagnostic}toDOM(){return eie("span",{class:"cm-lintPoint cm-lintPoint-"+this.diagnostic.severity})}}class Wae{constructor(e,t){this.diagnostic=t,this.id="item_"+Math.floor(4294967295*Math.random()).toString(16),this.dom=Hae(e,t,!0),this.dom.id=this.id,this.dom.setAttribute("role","option")}}class Xae{constructor(e){this.view=e,this.items=[],this.list=eie("ul",{tabIndex:0,role:"listbox","aria-label":this.view.state.phrase("Diagnostics"),onkeydown:t=>{if(27==t.keyCode)zae(this.view),this.view.focus();else if(38==t.keyCode||33==t.keyCode)this.moveSelection((this.selectedIndex-1+this.items.length)%this.items.length);else if(40==t.keyCode||34==t.keyCode)this.moveSelection((this.selectedIndex+1)%this.items.length);else if(36==t.keyCode)this.moveSelection(0);else if(35==t.keyCode)this.moveSelection(this.items.length-1);else if(13==t.keyCode)this.view.focus();else{if(!(t.keyCode>=65&&t.keyCode<=90&&this.selectedIndex>=0))return;{let{diagnostic:n}=this.items[this.selectedIndex],o=Lae(n.actions);for(let r=0;r{for(let t=0;tzae(this.view)},"×")),this.update()}get selectedIndex(){let e=this.view.state.field(Eae).selected;if(!e)return-1;for(let t=0;t{let a,s=-1;for(let t=n;tn&&(this.items.splice(n,s-n),o=!0)),t&&a.diagnostic==t.diagnostic?a.dom.hasAttribute("aria-selected")||(a.dom.setAttribute("aria-selected","true"),r=a):a.dom.hasAttribute("aria-selected")&&a.dom.removeAttribute("aria-selected"),n++}));n({sel:r.dom.getBoundingClientRect(),panel:this.list.getBoundingClientRect()}),write:({sel:e,panel:t})=>{let n=t.height/this.list.offsetHeight;e.topt.bottom&&(this.list.scrollTop+=(e.bottom-t.bottom)/n)}})):this.selectedIndex<0&&this.list.removeAttribute("aria-activedescendant"),o&&this.sync()}sync(){let e=this.list.firstChild;function t(){let t=e;e=t.nextSibling,t.remove()}for(let n of this.items)if(n.dom.parentNode==this.list){for(;e!=n.dom;)t();e=n.dom.nextSibling}else this.list.insertBefore(n.dom,e);for(;e;)t()}moveSelection(e){if(this.selectedIndex<0)return;let t=Cae(this.view.state.field(Eae).diagnostics,this.items[e].diagnostic);t&&this.view.dispatch({selection:{anchor:t.from,head:t.to},scrollIntoView:!0,effects:Iae.of(t)})}static open(e){return new Xae(e)}}function Yae(e,t='viewBox="0 0 40 40"'){return`url('data:image/svg+xml,${encodeURIComponent(e)}')`}function Vae(e){return Yae(``,'width="6" height="3"')}const Zae=o9.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:Vae("#d11")},".cm-lintRange-warning":{backgroundImage:Vae("orange")},".cm-lintRange-info":{backgroundImage:Vae("#999")},".cm-lintRange-hint":{backgroundImage:Vae("#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}}});function Uae(e){return"error"==e?4:"warning"==e?3:"info"==e?2:1}class Kae extends xee{constructor(e){super(),this.diagnostics=e,this.severity=e.reduce(((e,t)=>Uae(e)function(e,t,n){function o(){let o=e.elementAtHeight(t.getBoundingClientRect().top+5-e.documentTop);e.coordsAtPos(o.from)&&e.dispatch({effects:ese.of({pos:o.from,above:!1,create:()=>({dom:Rae(e,n),getCoords:()=>t.getBoundingClientRect()})})}),t.onmouseout=t.onmousemove=null,function(e,t){let n=o=>{let r=t.getBoundingClientRect();if(!(o.clientX>r.left-10&&o.clientXr.top-10&&o.clientY{clearTimeout(i),t.onmouseout=t.onmousemove=null},t.onmousemove=()=>{clearTimeout(i),i=setTimeout(o,r)}}(e,t,n)),t}}function Gae(e,t){let n=Object.create(null);for(let r of t){let t=e.lineAt(r.from);(n[t.from]||(n[t.from]=[])).push(r)}let o=[];for(let r in n)o.push(new Kae(n[r]).range(+r));return U4.of(o,!0)}const qae=Pee({class:"cm-gutter-lint",markers:e=>e.state.field(Jae)}),Jae=s4.define({create:()=>U4.empty,update(e,t){e=e.map(t.changes);let n=t.state.facet(rse).markerFilter;for(let o of t.effects)if(o.is(Tae)){let r=o.value;n&&(r=n(r||[])),e=Gae(t.state.doc,r.slice(0))}return e}}),ese=E4.define(),tse=s4.define({create:()=>null,update:(e,t)=>(e&&t.docChanged&&(e=kae(t,e)?null:Object.assign(Object.assign({},e),{pos:t.changes.mapPos(e.pos)})),t.effects.reduce(((e,t)=>t.is(ese)?t.value:e),e)),provide:e=>cee.from(e)}),nse=o9.baseTheme({".cm-gutter-lint":{width:"1.4em","& .cm-gutterElement":{padding:".2em"}},".cm-lint-marker":{width:"1em",height:"1em"},".cm-lint-marker-info":{content:Yae('')},".cm-lint-marker-warning":{content:Yae('')},".cm-lint-marker-error":{content:Yae('')}}),ose=[Eae,o9.decorations.compute([Eae],(e=>{let{selected:t,panel:n}=e.field(Eae);return t&&n&&t.from!=t.to?w8.set([Aae.range(t.from,t.to)]):w8.none})),fee(Dae,{hideOn:kae}),Zae],rse=t4.define({combine:e=>W4(e,{hoverTime:300,markerFilter:null,tooltipFilter:null})});function ise(e={}){return[rse.of(e),Jae,qae,nse,tse]}const lse=(()=>[Lee(),Wee,L9(),Qoe(),qne(),$9(),[A9,D9],F4.allowMultipleSelections.of(!0),F4.transactionFilter.of((e=>{if(!e.docChanged||!e.isUserEvent("input.type")&&!e.isUserEvent("input.complete"))return e;let t=e.startState.languageDataAt("indentOnInput",e.startState.selection.main.head);if(!t.length)return e;let n=e.newDoc,{head:o}=e.newSelection.main,r=n.lineAt(o);if(o>r.from+200)return e;let i=n.sliceString(r.from,o);if(!t.some((e=>e.test(i))))return e;let{state:l}=e,a=-1,s=[];for(let{head:c}of l.selection.ranges){let e=l.doc.lineAt(c);if(e.from==a)continue;a=e.from;let t=yne(l,e.from);if(null==t)continue;let n=/^\s*/.exec(e.text)[0],o=bne(l,t);n!=o&&s.push({from:e.from,to:e.from+n.length,insert:o})}return s.length?[e,{changes:s,sequential:!0}]:e})),roe(aoe,{fallback:!0}),goe(),[dae,lae],Oae(),G9(),eee(),Y9,vie(),d9.of([...pae,...qre,...Gie,...nre,...Fne,...wae,...Bae])])(),ase=(()=>[L9(),Qoe(),$9(),roe(aoe,{fallback:!0}),d9.of([...qre,...nre])])();function sse(e,t={},n){const{props:o,domProps:r,on:i,...l}=t;return Wr(e,{...l,...o,...r,...i?(e=>e?Object.entries(e).reduce(((e,[t,n])=>({...e,[t=`on${t=t.charAt(0).toUpperCase()+t.slice(1)}`]:n})),{}):{})(i):{}},n)}var cse=Nn({name:"CodeMirror",model:{prop:"modelValue",event:"update:modelValue"},props:{modelValue:{type:String,default:""},theme:{type:Object,default:()=>{}},dark:{type:Boolean,default:!1},basic:{type:Boolean,default:!1},minimal:{type:Boolean,default:!1},placeholder:{type:String,default:void 0},wrap:{type:Boolean,default:!1},tab:{type:Boolean,default:!1},allowMultipleSelections:{type:Boolean,default:!1},tabSize:{type:Number,default:void 0},lineSeparator:{type:String,default:void 0},readonly:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},extensions:{type:Array,default:()=>[]},phrases:{type:Object,default:()=>{}},lang:{type:Object,default:()=>{}},linter:{type:Function,default:void 0},linterConfig:{type:Object,default:()=>({})},forceLinting:{type:Boolean,default:!1},gutter:{type:Boolean,defalt:!1},gutterConfig:{type:Object,default:()=>{}},tag:{type:String,default:"div"}},emits:{"update:modelValue":e=>!0,update:e=>!0,ready:e=>!0,focus:e=>!0,change:e=>!0,destroy:()=>!0},setup(e,t){const n=bt(),o=bt(e.modelValue),r=yt(new o9),i=Fr({get:()=>r.value.hasFocus,set:e=>{e&&r.value.focus()}}),l=Fr({get:()=>r.value.state.selection,set:e=>r.value.dispatch({selection:e})}),a=Fr({get:()=>r.value.state.selection.main.head,set:e=>r.value.dispatch({selection:{anchor:e}})}),s=Fr({get:()=>r.value.state.toJSON(),set:e=>r.value.setState(F4.fromJSON(e))}),c=bt(0),u=bt(0),d=Fr((()=>{const n=new m4,o=new m4;return[e.basic?lse:void 0,e.minimal&&!e.basic?ase:void 0,o9.updateListener.of((n=>{t.emit("focus",r.value.hasFocus),c.value=r.value.state.doc.length,!n.changes.empty&&n.docChanged&&(e.linter&&(e.forceLinting&&Qae(r.value),u.value=e.linter(r.value).length),t.emit("update",n))})),o9.theme(e.theme,{dark:e.dark}),e.wrap?o9.lineWrapping:void 0,e.tab?d9.of([Jre]):void 0,F4.allowMultipleSelections.of(e.allowMultipleSelections),e.tabSize?o.of(F4.tabSize.of(e.tabSize)):void 0,e.phrases?F4.phrases.of(e.phrases):void 0,F4.readOnly.of(e.readonly),o9.editable.of(!e.disabled),e.lineSeparator?F4.lineSeparator.of(e.lineSeparator):void 0,e.lang?n.of(e.lang):void 0,e.linter?_ae(e.linter,e.linterConfig):void 0,e.linter&&e.gutter?ise(e.gutterConfig):void 0,e.placeholder?(i=e.placeholder,X8.fromClass(class{constructor(e){this.view=e,this.placeholder=i?w8.set([w8.widget({widget:new V9(i),side:1}).range(0)]):w8.none}get decorations(){return this.view.state.doc.length?w8.none:this.placeholder}},{decorations:e=>e.decorations})):void 0,...e.extensions].filter((e=>!!e));var i}));yn(d,(e=>{var t;null==(t=r.value)||t.dispatch({effects:E4.reconfigure.of(e)})}),{immediate:!0}),yn((()=>e.modelValue),(async t=>{r.value.composing||r.value.state.doc.toJSON().join(e.lineSeparator??"\n")===t||r.value.dispatch({changes:{from:0,to:r.value.state.doc.length,insert:t},selection:r.value.state.selection,scrollIntoView:!0})}),{immediate:!0}),Zn((async()=>{let e=o.value;n.value&&(n.value.childNodes[0]&&(o.value,e=n.value.childNodes[0].innerText.trim()),r.value=new o9({parent:n.value,state:F4.create({doc:e,extensions:d.value}),dispatch:e=>{r.value.update([e]),!e.changes.empty&&e.docChanged&&(t.emit("update:modelValue",e.state.doc.toString()),t.emit("change",e.state))}}),await Wt(),t.emit("ready",{view:r.value,state:r.value.state,container:n.value}))})),qn((()=>{r.value.destroy(),t.emit("destroy")}));const p={editor:n,view:r,cursor:a,selection:l,focus:i,length:c,json:s,diagnosticCount:u,dom:r.value.contentDOM,lint:()=>{e.linter&&r.value&&(e.forceLinting&&Qae(r.value),u.value=function(e){let t=e.field(Eae,!1);return t?t.diagnostics.size:0}(r.value.state))},forceReconfigure:()=>{var e,t;null==(e=r.value)||e.dispatch({effects:E4.reconfigure.of([])}),null==(t=r.value)||t.dispatch({effects:E4.appendConfig.of(d.value)})},getRange:(e,t)=>r.value.state.sliceDoc(e,t),getLine:e=>r.value.state.doc.line(e+1).text,lineCount:()=>r.value.state.doc.lines,getCursor:()=>r.value.state.selection.main.head,listSelections:()=>{let e;return null!==(e=r.value.state.selection.ranges)&&void 0!==e?e:[]},getSelection:()=>{let e;return null!==(e=r.value.state.sliceDoc(r.value.state.selection.main.from,r.value.state.selection.main.to))&&void 0!==e?e:""},getSelections:()=>{const e=r.value.state;return e?e.selection.ranges.map((t=>e.sliceDoc(t.from,t.to))):[]},somethingSelected:()=>r.value.state.selection.ranges.some((e=>!e.empty)),replaceRange:(e,t,n)=>r.value.dispatch({changes:{from:t,to:n,insert:e}}),replaceSelection:e=>r.value.dispatch(r.value.state.replaceSelection(e)),setCursor:e=>r.value.dispatch({selection:{anchor:e}}),setSelection:(e,t)=>r.value.dispatch({selection:{anchor:e,head:t}}),setSelections:(e,t)=>r.value.dispatch({selection:q3.create(e,t)}),extendSelectionsBy:e=>r.value.dispatch({selection:q3.create(l.value.ranges.map((t=>t.extend(e(t)))))})};return t.expose(p),p},render(){return sse(this.$props.tag,{ref:"editor",class:"vue-codemirror"},this.$slots.default?sse("aside",{style:"display: none;","aria-hidden":"true"},"function"==typeof(e=this.$slots.default)?e():e):void 0);var e}});const use="#e06c75",dse="#abb2bf",pse="#7d8799",hse="#d19a66",fse="#2c313a",gse="#282c34",mse="#353a42",vse="#528bff",bse=[o9.theme({"&":{color:dse,backgroundColor:gse},".cm-content":{caretColor:vse},".cm-cursor, .cm-dropCursor":{borderLeftColor:vse},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:"#3E4451"},".cm-panels":{backgroundColor:"#21252b",color:dse},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:gse,color:pse,border:"none"},".cm-activeLineGutter":{backgroundColor:fse},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:mse},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:mse,borderBottomColor:mse},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:fse,color:dse}}},{dark:!0}),roe(eoe.define([{tag:Kte.keyword,color:"#c678dd"},{tag:[Kte.name,Kte.deleted,Kte.character,Kte.propertyName,Kte.macroName],color:use},{tag:[Kte.function(Kte.variableName),Kte.labelName],color:"#61afef"},{tag:[Kte.color,Kte.constant(Kte.name),Kte.standard(Kte.name)],color:hse},{tag:[Kte.definition(Kte.name),Kte.separator],color:dse},{tag:[Kte.typeName,Kte.className,Kte.number,Kte.changed,Kte.annotation,Kte.modifier,Kte.self,Kte.namespace],color:"#e5c07b"},{tag:[Kte.operator,Kte.operatorKeyword,Kte.url,Kte.escape,Kte.regexp,Kte.link,Kte.special(Kte.string)],color:"#56b6c2"},{tag:[Kte.meta,Kte.comment],color:pse},{tag:Kte.strong,fontWeight:"bold"},{tag:Kte.emphasis,fontStyle:"italic"},{tag:Kte.strikethrough,textDecoration:"line-through"},{tag:Kte.link,color:pse,textDecoration:"underline"},{tag:Kte.heading,fontWeight:"bold",color:use},{tag:[Kte.atom,Kte.bool,Kte.special(Kte.variableName)],color:hse},{tag:[Kte.processingInstruction,Kte.string,Kte.inserted],color:"#98c379"},{tag:Kte.invalid,color:"#ffffff"}]))];var yse={};class Ose{constructor(e,t,n,o,r,i,l,a,s,c=0,u){this.p=e,this.stack=t,this.state=n,this.reducePos=o,this.pos=r,this.score=i,this.buffer=l,this.bufferBase=a,this.curContext=s,this.lookAhead=c,this.parent=u}toString(){return`[${this.stack.filter(((e,t)=>t%3==0)).concat(this.state)}]@${this.pos}${this.score?"!"+this.score:""}`}static start(e,t,n=0){let o=e.parser.context;return new Ose(e,[],t,n,n,0,[],0,o?new wse(o,o.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 n=e>>19,o=65535&e,{parser:r}=this.p,i=r.dynamicPrecedence(o);if(i&&(this.score+=i),0==n)return this.pushState(r.getGoto(this.state,o,!0),this.reducePos),o=2e3&&!(null===(t=this.p.parser.nodeSet.types[o])||void 0===t?void 0:t.isAnonymous)&&(a==this.p.lastBigReductionStart?(this.p.bigReductionCount++,this.p.lastBigReductionSize=s):this.p.lastBigReductionSizel;)this.stack.pop();this.reduceContext(o,a)}storeNode(e,t,n,o=4,r=!1){if(0==e&&(!this.stack.length||this.stack[this.stack.length-1]0&&0==e.buffer[o-4]&&e.buffer[o-1]>-1){if(t==n)return;if(e.buffer[o-2]>=t)return void(e.buffer[o-2]=n)}}if(r&&this.pos!=n){let r=this.buffer.length;if(r>0&&0!=this.buffer[r-4])for(;r>0&&this.buffer[r-2]>n;)this.buffer[r]=this.buffer[r-4],this.buffer[r+1]=this.buffer[r-3],this.buffer[r+2]=this.buffer[r-2],this.buffer[r+3]=this.buffer[r-1],r-=4,o>4&&(o-=4);this.buffer[r]=e,this.buffer[r+1]=t,this.buffer[r+2]=n,this.buffer[r+3]=o}else this.buffer.push(e,t,n,o)}shift(e,t,n,o){if(131072&e)this.pushState(65535&e,this.pos);else if(0==(262144&e)){let r=e,{parser:i}=this.p;(o>this.pos||t<=i.maxNode)&&(this.pos=o,i.stateFlag(r,1)||(this.reducePos=o)),this.pushState(r,n),this.shiftContext(t,n),t<=i.maxNode&&this.buffer.push(t,n,o,4)}else this.pos=o,this.shiftContext(t,n),t<=this.p.parser.maxNode&&this.buffer.push(t,n,o,4)}apply(e,t,n,o){65536&e?this.reduce(e):this.shift(e,t,n,o)}useNode(e,t){let n=this.p.reused.length-1;(n<0||this.p.reused[n]!=e)&&(this.p.reused.push(e),n++);let o=this.pos;this.reducePos=this.pos=o+e.length,this.pushState(t,o),this.buffer.push(n,o,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 n=e.buffer.slice(t),o=e.bufferBase+t;for(;e&&o==e.bufferBase;)e=e.parent;return new Ose(this.p,this.stack.slice(),this.state,this.reducePos,this.pos,this.score,n,o,this.curContext,this.lookAhead,e)}recoverByDelete(e,t){let n=e<=this.p.parser.maxNode;n&&this.storeNode(e,this.pos,t,4),this.storeNode(0,this.pos,t,n?8:4),this.pos=this.reducePos=t,this.score-=190}canShift(e){for(let t=new Sse(this);;){let n=this.p.parser.stateSlot(t.state,4)||this.p.parser.hasAction(t.state,e);if(0==n)return!1;if(0==(65536&n))return!0;t.reduce(n)}}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 n=[];for(let o,r=0;r1&t&&e==o))||n.push(t[e],o)}t=n}let n=[];for(let o=0;o>19,o=65535&t,r=this.stack.length-3*n;if(r<0||e.getGoto(this.stack[r],o,!1)<0){let e=this.findForcedReduction();if(null==e)return!1;t=e}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=[],n=(o,r)=>{if(!t.includes(o))return t.push(o),e.allActions(o,(t=>{if(393216&t);else if(65536&t){let n=(t>>19)-r;if(n>1){let o=65535&t,r=this.stack.length-3*n;if(r>=0&&e.getGoto(this.stack[r],o,!1)>=0)return n<<19|65536|o}}else{let e=n(t,r+1);if(null!=e)return e}}))};return n(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(3!=this.stack.length)return!1;let{parser:e}=this.p;return 65535==e.data[e.stateSlot(this.state,1)]&&!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 wse{constructor(e,t){this.tracker=e,this.context=t,this.hash=e.strict?e.hash(t):0}}class Sse{constructor(e){this.start=e,this.state=e.state,this.stack=e.stack,this.base=this.stack.length}reduce(e){let t=65535&e,n=e>>19;0==n?(this.stack==this.start.stack&&(this.stack=this.stack.slice()),this.stack.push(this.state,0,0),this.base+=3):this.base-=3*(n-1);let o=this.start.p.parser.getGoto(this.stack[this.base-3],t,!0);this.state=o}}class xse{constructor(e,t,n){this.stack=e,this.pos=t,this.index=n,this.buffer=e.buffer,0==this.index&&this.maybeNext()}static create(e,t=e.bufferBase+e.buffer.length){return new xse(e,t,t-e.bufferBase)}maybeNext(){let e=this.stack.parent;null!=e&&(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,0==this.index&&this.maybeNext()}fork(){return new xse(this.stack,this.pos,this.index)}}function $se(e,t=Uint16Array){if("string"!=typeof e)return e;let n=null;for(let o=0,r=0;o=92&&t--,t>=34&&t--;let r=t-32;if(r>=46&&(r-=46,n=!0),i+=r,n)break;i*=46}n?n[r++]=i:n=new t(i)}return n}class Cse{constructor(){this.start=-1,this.value=-1,this.end=-1,this.extended=-1,this.lookAhead=0,this.mask=0,this.context=0}}const kse=new Cse;class Pse{constructor(e,t){this.input=e,this.ranges=t,this.chunk="",this.chunkOff=0,this.chunk2="",this.chunk2Pos=0,this.next=-1,this.token=kse,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 n=this.range,o=this.rangeIndex,r=this.pos+e;for(;rn.to:r>=n.to;){if(o==this.ranges.length-1)return null;let e=this.ranges[++o];r+=e.from-n.to,n=e}return r}clipPos(e){if(e>=this.range.from&&ee)return Math.max(e,t.from);return this.end}peek(e){let t,n,o=this.chunkOff+e;if(o>=0&&o=this.chunk2Pos&&to.to&&(this.chunk2=this.chunk2.slice(0,o.to-t)),n=this.chunk2.charCodeAt(0)}}return t>=this.token.lookAhead&&(this.token.lookAhead=t+1),n}acceptToken(e,t=0){let n=t?this.resolveOffset(t,-1):this.pos;if(null==n||n=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=kse,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 n="";for(let o of this.ranges){if(o.from>=t)break;o.to>e&&(n+=this.input.read(Math.max(o.from,e),Math.min(o.to,t)))}return n}}class Tse{constructor(e,t){this.data=e,this.id=t}token(e,t){let{parser:n}=t.p;Ese(this.data,e,t,this.id,n.data,n.tokenPrecTable)}}Tse.prototype.contextual=Tse.prototype.fallback=Tse.prototype.extend=!1;class Mse{constructor(e,t,n){this.precTable=t,this.elseToken=n,this.data="string"==typeof e?$se(e):e}token(e,t){let n=e.pos,o=0;for(;;){let n=e.next<0,r=e.resolveOffset(1,1);if(Ese(this.data,e,t,0,this.data,this.precTable),e.token.value>-1)break;if(null==this.elseToken)return;if(n||o++,null==r)break;e.reset(r,e.token)}o&&(e.reset(n,e.token),e.acceptToken(this.elseToken,o))}}Mse.prototype.contextual=Tse.prototype.fallback=Tse.prototype.extend=!1;class Ise{constructor(e,t={}){this.token=e,this.contextual=!!t.contextual,this.fallback=!!t.fallback,this.extend=!!t.extend}}function Ese(e,t,n,o,r,i){let l=0,a=1<0){let n=e[d];if(s.allows(n)&&(-1==t.token.value||t.token.value==n||Dse(n,t.token.value,r,i))){t.acceptToken(n);break}}let o=t.next,c=0,u=e[l+2];if(!(t.next<0&&u>c&&65535==e[n+3*u-3])){for(;c>1,i=n+r+(r<<1),a=e[i],s=e[i+1]||65536;if(o=s)){l=e[i+2],t.advance();continue e}c=r+1}}break}l=e[n+3*u-1]}}function Ase(e,t,n){for(let o,r=t;65535!=(o=e[r]);r++)if(o==n)return r-t;return-1}function Dse(e,t,n,o){let r=Ase(n,o,t);return r<0||Ase(n,o,e)t)&&!o.type.isError)return n<0?Math.max(0,Math.min(o.to-1,t-25)):Math.min(e.length,Math.max(o.from+1,t+25));if(n<0?o.prevSibling():o.nextSibling())break;if(!o.parent())return n<0?0:e.length}}class jse{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?Bse(e.tree,e.from+e.offset,1)-e.offset:e.from,this.safeTo=e.openEnd?Bse(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=i,null;if(r instanceof ote){if(i==e){if(i=Math.max(this.safeFrom,e)&&(this.trees.push(r),this.start.push(i),this.index.push(0))}else this.index[t]++,this.nextStart=i+r.length}}}class Nse{constructor(e,t){this.stream=t,this.tokens=[],this.mainToken=null,this.actions=[],this.tokens=e.tokenizers.map((e=>new Cse))}getActions(e){let t=0,n=null,{parser:o}=e.p,{tokenizers:r}=o,i=o.stateSlot(e.state,3),l=e.curContext?e.curContext.hash:0,a=0;for(let s=0;sc.end+25&&(a=Math.max(c.lookAhead,a)),0!=c.value)){let r=t;if(c.extended>-1&&(t=this.addActions(e,c.extended,c.end,t)),t=this.addActions(e,c.value,c.end,t),!o.extend&&(n=c,t>r))break}}for(;this.actions.length>t;)this.actions.pop();return a&&e.setLookAhead(a),n||e.pos!=this.stream.end||(n=new Cse,n.value=e.p.parser.eofTerm,n.start=n.end=e.pos,t=this.addActions(e,n.value,n.end,t)),this.mainToken=n,this.actions}getMainToken(e){if(this.mainToken)return this.mainToken;let t=new Cse,{pos:n,p:o}=e;return t.start=n,t.end=Math.min(n+1,o.stream.end),t.value=n==o.stream.end?o.parser.eofTerm:0,t}updateCachedToken(e,t,n){let o=this.stream.clipPos(n.pos);if(t.token(this.stream.reset(o,e),n),e.value>-1){let{parser:t}=n.p;for(let o=0;o=0&&n.p.parser.dialect.allows(r>>1)){0==(1&r)?e.value=r>>1:e.extended=r>>1;break}}}else e.value=0,e.end=this.stream.clipPos(o+1)}putAction(e,t,n,o){for(let r=0;r4*e.bufferLength?new jse(n,e.nodeSet):null}get parsedPos(){return this.minStackPos}advance(){let e,t,n=this.stacks,o=this.minStackPos,r=this.stacks=[];if(this.bigReductionCount>300&&1==n.length){let[e]=n;for(;e.forceReduce()&&e.stack.length&&e.stack[e.stack.length-2]>=this.lastBigReductionStart;);this.bigReductionCount=this.lastBigReductionSize=0}for(let i=0;io)r.push(l);else{if(this.advanceStack(l,r,n))continue;{e||(e=[],t=[]),e.push(l);let n=this.tokens.getMainToken(l);t.push(n.value,n.end)}}break}}if(!r.length){let t=e&&function(e){let t=null;for(let n of e){let e=n.p.stoppedAt;(n.pos==n.p.stream.end||null!=e&&n.pos>e)&&n.p.parser.stateFlag(n.state,2)&&(!t||t.scorethis.stoppedAt?e[0]:this.runRecovery(e,t,r);if(n)return this.stackToTree(n.forceAll())}if(this.recovering){let e=1==this.recovering?1:3*this.recovering;if(r.length>e)for(r.sort(((e,t)=>t.score-e.score));r.length>e;)r.pop();r.some((e=>e.reducePos>o))&&this.recovering--}else if(r.length>1){e:for(let e=0;e500&&o.buffer.length>500){if(!((t.score-o.score||t.buffer.length-o.buffer.length)>0)){r.splice(e--,1);continue e}r.splice(n--,1)}}}r.length>12&&r.splice(12,r.length-12)}this.minStackPos=r[0].pos;for(let i=1;ithis.stoppedAt)return e.forceReduce()?e:null;if(this.fragments){let t=e.curContext&&e.curContext.tracker.strict,n=t?e.curContext.hash:0;for(let i=this.fragments.nodeAt(o);i;){let o=this.parser.nodeSet.types[i.type.id]==i.type?r.getGoto(e.state,i.type.id):-1;if(o>-1&&i.length&&(!t||(i.prop(Zee.contextHash)||0)==n))return e.useNode(i,o),!0;if(!(i instanceof ote)||0==i.children.length||i.positions[0]>0)break;let l=i.children[0];if(!(l instanceof ote&&0==i.positions[0]))break;i=l}}let i=r.stateSlot(e.state,4);if(i>0)return e.reduce(i),!0;if(e.stack.length>=8400)for(;e.stack.length>6e3&&e.forceReduce(););let l=this.tokens.getActions(e);for(let a=0;ao?t.push(u):n.push(u)}return!1}advanceFully(e,t){let n=e.pos;for(;;){if(!this.advanceStack(e,null,null))return!1;if(e.pos>n)return Qse(e,t),!0}}runRecovery(e,t,n){let o=null,r=!1;for(let i=0;i ":"";if(l.deadEnd){if(r)continue;if(r=!0,l.restart(),this.advanceFully(l,n))continue}let u=l.split(),d=c;for(let e=0;u.forceReduce()&&e<10&&!this.advanceFully(u,n);e++)Rse&&(d=this.stackID(u)+" -> ");for(let e of l.recoverByInsert(a))this.advanceFully(e,n);this.stream.end>l.pos?(s==l.pos&&(s++,a=0),l.recoverByDelete(a,s),Qse(l,n)):(!o||o.scoree;class Fse extends xte{constructor(e){if(super(),this.wrappers=[],14!=e.version)throw new RangeError(`Parser version (${e.version}) doesn't match runtime version (14)`);let t=e.nodeNames.split(" ");this.minRepeatTerm=t.length;for(let l=0;le.topRules[t][1])),o=[];for(let l=0;l=0)r(n,e,l[t++]);else{let o=l[t+-n];for(let i=-n;i>0;i--)r(l[t++],e,o);t++}}}this.nodeSet=new qee(t.map(((t,r)=>Gee.define({name:r>=this.minRepeatTerm?void 0:t,id:r,props:o[r],top:n.indexOf(r)>-1,error:0==r,skipped:e.skippedNodes&&e.skippedNodes.indexOf(r)>-1})))),e.propSources&&(this.nodeSet=this.nodeSet.extend(...e.propSources)),this.strict=!1,this.bufferLength=Xee;let i=$se(e.tokenData);this.context=e.context,this.specializerSpecs=e.specialized||[],this.specialized=new Uint16Array(this.specializerSpecs.length);for(let l=0;l"number"==typeof e?new Tse(i,e):e)),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,n){let o=new _se(this,e,t,n);for(let r of this.wrappers)o=r(o,e,t,n);return o}getGoto(e,t,n=!1){let o=this.goto;if(t>=o[0])return-1;for(let r=o[t+1];;){let t=o[r++],i=1&t,l=o[r++];if(i&&n)return l;for(let n=r+(t>>1);r0}validAction(e,t){return!!this.allActions(e,(e=>e==t||null))}allActions(e,t){let n=this.stateSlot(e,4),o=n?t(n):void 0;for(let r=this.stateSlot(e,1);null==o;r+=3){if(65535==this.data[r]){if(1!=this.data[r+1])break;r=Wse(this.data,r+2)}o=t(Wse(this.data,r+1))}return o}nextStates(e){let t=[];for(let n=this.stateSlot(e,1);;n+=3){if(65535==this.data[n]){if(1!=this.data[n+1])break;n=Wse(this.data,n+2)}if(0==(1&this.data[n+2])){let e=this.data[n+1];t.some(((t,n)=>1&n&&t==e))||t.push(this.data[n],e)}}return t}configure(e){let t=Object.assign(Object.create(Fse.prototype),this);if(e.props&&(t.nodeSet=this.nodeSet.extend(...e.props)),e.top){let n=this.topRules[e.top];if(!n)throw new RangeError(`Invalid top rule name ${e.top}`);t.top=n}return e.tokenizers&&(t.tokenizers=this.tokenizers.map((t=>{let n=e.tokenizers.find((e=>e.from==t));return n?n.to:t}))),e.specializers&&(t.specializers=this.specializers.slice(),t.specializerSpecs=this.specializerSpecs.map(((n,o)=>{let r=e.specializers.find((e=>e.from==n.external));if(!r)return n;let i=Object.assign(Object.assign({},n),{external:r.to});return t.specializers[o]=Xse(i),i}))),e.contextTracker&&(t.context=e.contextTracker),e.dialect&&(t.dialect=this.parseDialect(e.dialect)),null!=e.strict&&(t.strict=e.strict),e.wrap&&(t.wrappers=t.wrappers.concat(e.wrap)),null!=e.bufferLength&&(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 null==t?0:t[e]||0}parseDialect(e){let t=Object.keys(this.dialects),n=t.map((()=>!1));if(e)for(let r of e.split(" ")){let e=t.indexOf(r);e>=0&&(n[e]=!0)}let o=null;for(let r=0;re.external(n,o)<<1|t}return e.get}const Yse=[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],Vse=new class{constructor(e){this.start=e.start,this.shift=e.shift||Hse,this.reduce=e.reduce||Hse,this.reuse=e.reuse||Hse,this.hash=e.hash||(()=>0),this.strict=!1!==e.strict}}({start:!1,shift:(e,t)=>3==t||4==t||311==t?e:312==t,strict:!1}),Zse=new Ise(((e,t)=>{let{next:n}=e;(125==n||-1==n||t.context)&&e.acceptToken(309)}),{contextual:!0,fallback:!0}),Use=new Ise(((e,t)=>{let n,{next:o}=e;Yse.indexOf(o)>-1||(47!=o||47!=(n=e.peek(1))&&42!=n)&&(125==o||59==o||-1==o||t.context||e.acceptToken(308))}),{contextual:!0}),Kse=new Ise(((e,t)=>{let{next:n}=e;if((43==n||45==n)&&(e.advance(),n==e.next)){e.advance();let n=!t.context&&t.canShift(1);e.acceptToken(n?1:2)}}),{contextual:!0}),Gse=Mte({"get set async static":Kte.modifier,"for while do if else switch try catch finally return throw break continue default case":Kte.controlKeyword,"in of await yield void typeof delete instanceof":Kte.operatorKeyword,"let var const using function class extends":Kte.definitionKeyword,"import export from":Kte.moduleKeyword,"with debugger as new":Kte.keyword,TemplateString:Kte.special(Kte.string),super:Kte.atom,BooleanLiteral:Kte.bool,this:Kte.self,null:Kte.null,Star:Kte.modifier,VariableName:Kte.variableName,"CallExpression/VariableName TaggedTemplateExpression/VariableName":Kte.function(Kte.variableName),VariableDefinition:Kte.definition(Kte.variableName),Label:Kte.labelName,PropertyName:Kte.propertyName,PrivatePropertyName:Kte.special(Kte.propertyName),"CallExpression/MemberExpression/PropertyName":Kte.function(Kte.propertyName),"FunctionDeclaration/VariableDefinition":Kte.function(Kte.definition(Kte.variableName)),"ClassDeclaration/VariableDefinition":Kte.definition(Kte.className),PropertyDefinition:Kte.definition(Kte.propertyName),PrivatePropertyDefinition:Kte.definition(Kte.special(Kte.propertyName)),UpdateOp:Kte.updateOperator,"LineComment Hashbang":Kte.lineComment,BlockComment:Kte.blockComment,Number:Kte.number,String:Kte.string,Escape:Kte.escape,ArithOp:Kte.arithmeticOperator,LogicOp:Kte.logicOperator,BitOp:Kte.bitwiseOperator,CompareOp:Kte.compareOperator,RegExp:Kte.regexp,Equals:Kte.definitionOperator,Arrow:Kte.function(Kte.punctuation),": Spread":Kte.punctuation,"( )":Kte.paren,"[ ]":Kte.squareBracket,"{ }":Kte.brace,"InterpolationStart InterpolationEnd":Kte.special(Kte.brace),".":Kte.derefOperator,", ;":Kte.separator,"@":Kte.meta,TypeName:Kte.typeName,TypeDefinition:Kte.definition(Kte.typeName),"type enum interface implements namespace module declare":Kte.definitionKeyword,"abstract global Privacy readonly override":Kte.modifier,"is keyof unique infer":Kte.operatorKeyword,JSXAttributeValue:Kte.attributeValue,JSXText:Kte.content,"JSXStartTag JSXStartCloseTag JSXSelfCloseEndTag JSXEndTag":Kte.angleBracket,"JSXIdentifier JSXNameSpacedName":Kte.tagName,"JSXAttribute/JSXIdentifier JSXAttribute/JSXNameSpacedName":Kte.attributeName,"JSXBuiltin/JSXIdentifier":Kte.standard(Kte.tagName)}),qse={__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},Jse={__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},ece={__proto__:null,"<":139},tce=Fse.deserialize({version:14,states:"$RQSO'#CcO>cQSO'#HZO>kQSO'#HaO>kQSO'#HcO`QUO'#HeO>kQSO'#HgO>kQSO'#HjO>pQSO'#HpO>uQ(C]O'#HvO%[QUO'#HxO?QQ(C]O'#HzO?]Q(C]O'#H|O9kQ(C[O'#IOO?hQ(CjO'#CgO@jQWO'#DgQOQSOOO%[QUO'#D}OAQQSO'#EQO:RQ,UO'#EhOA]QSO'#EhOAhQ`O'#F`OOQQ'#Ce'#CeOOQ(CW'#Dl'#DlOOQ(CW'#Jm'#JmO%[QUO'#JmOOQO'#Jq'#JqOOQO'#Ia'#IaOBhQWO'#EaOOQ(CW'#E`'#E`OCdQ(C`O'#EaOCnQWO'#ETOOQO'#Jp'#JpODSQWO'#JqOEaQWO'#ETOCnQWO'#EaPEnO?MpO'#C`POOO)CDt)CDtOOOO'#IW'#IWOEyOpO,59SOOQ(CY,59S,59SOOOO'#IX'#IXOFXO!bO,59SO%[QUO'#D^OOOO'#IZ'#IZOFgO07`O,59vOOQ(CY,59v,59vOFuQUO'#I[OGYQSO'#JkOI[QbO'#JkO+}QUO'#JkOIcQSO,59|OIyQSO'#EjOJWQSO'#JyOJcQSO'#JxOJcQSO'#JxOJkQSO,5;WOJpQSO'#JwOOQ(CY,5:X,5:XOJwQUO,5:XOLxQ(CjO,5:cOMiQSO,5:kONSQ(C[O'#JvONZQSO'#JuO9ZQSO'#JuONoQSO'#JuONwQSO,5;VON|QSO'#JuO!#UQbO'#JjOOQ(CY'#Cg'#CgO%[QUO'#EPO!#tQ`O,5:pOOQO'#Jr'#JrOOQO-ElOOQQ'#J_'#J_OOQQ,5>m,5>mOOQQ-EpQSO'#HPO9aQSO'#HRO!CgQSO'#HRO:RQ,UO'#HTO!ClQSO'#HTOOQQ,5=i,5=iO!CqQSO'#HUO!DSQSO'#CmO!DXQSO,58}O!DcQSO,58}O!FhQUO,58}OOQQ,58},58}O!FxQ(C[O,58}O%[QUO,58}O!ITQUO'#H]OOQQ'#H^'#H^OOQQ'#H_'#H_O`QUO,5=uO!IkQSO,5=uO`QUO,5={O`QUO,5=}O!IpQSO,5>PO`QUO,5>RO!IuQSO,5>UO!IzQUO,5>[OOQQ,5>b,5>bO%[QUO,5>bO9kQ(C[O,5>dOOQQ,5>f,5>fO!NUQSO,5>fOOQQ,5>h,5>hO!NUQSO,5>hOOQQ,5>j,5>jO!NZQWO'#DYO%[QUO'#JmO!NxQWO'#JmO# gQWO'#DhO# xQWO'#DhO#$ZQUO'#DhO#$bQSO'#JlO#$jQSO,5:RO#$oQSO'#EnO#$}QSO'#JzO#%VQSO,5;XO#%[QWO'#DhO#%iQWO'#ESOOQ(CY,5:l,5:lO%[QUO,5:lO#%pQSO,5:lO>pQSO,5;SO!@}QWO,5;SO!AVQ,UO,5;SO:RQ,UO,5;SO#%xQSO,5@XO#%}Q!LQO,5:pOOQO-E<_-E<_O#'TQ(C`O,5:{OCnQWO,5:oO#'_QWO,5:oOCnQWO,5:{O!@rQ(C[O,5:oOOQ(CW'#Ed'#EdOOQO,5:{,5:{O%[QUO,5:{O#'lQ(C[O,5:{O#'wQ(C[O,5:{O!@}QWO,5:oOOQO,5;R,5;RO#(VQ(C[O,5:{POOO'#IU'#IUP#(kO?MpO,58zPOOO,58z,58zOOOO-EvO+}QUO,5>vOOQO,5>|,5>|O#)VQUO'#I[OOQO-EpQ(CjO1G0yO#>wQ(CjO1G0yO#@oQ(CjO1G0yO#CoQ$IUO'#CgO#EmQ$IUO1G1[O#EtQ$IUO'#JjO!,lQSO1G1bO#FUQ(CjO,5?SOOQ(CW-EkQSO1G3kO$1UQUO1G3mO$5YQUO'#HlOOQQ1G3p1G3pO$5gQSO'#HrO>pQSO'#HtOOQQ1G3v1G3vO$5oQUO1G3vO9kQ(C[O1G3|OOQQ1G4O1G4OOOQ(CW'#GX'#GXO9kQ(C[O1G4QO9kQ(C[O1G4SO$9vQSO,5@XO!*fQUO,5;YO9ZQSO,5;YO>pQSO,5:SO!*fQUO,5:SO!@}QWO,5:SO$9{Q$IUO,5:SOOQO,5;Y,5;YO$:VQWO'#I]O$:mQSO,5@WOOQ(CY1G/m1G/mO$:uQWO'#IcO$;PQSO,5@fOOQ(CW1G0s1G0sO# xQWO,5:SOOQO'#I`'#I`O$;XQWO,5:nOOQ(CY,5:n,5:nO#%sQSO1G0WOOQ(CY1G0W1G0WO%[QUO1G0WOOQ(CY1G0n1G0nO>pQSO1G0nO!@}QWO1G0nO!AVQ,UO1G0nOOQ(CW1G5s1G5sO!@rQ(C[O1G0ZOOQO1G0g1G0gO%[QUO1G0gO$;`Q(C[O1G0gO$;kQ(C[O1G0gO!@}QWO1G0ZOCnQWO1G0ZO$;yQ(C[O1G0gOOQO1G0Z1G0ZO$<_Q(CjO1G0gPOOO-EvO$<{QSO1G5qO$=TQSO1G6OO$=]QbO1G6PO9ZQSO,5>|O$=gQ(CjO1G5|O%[QUO1G5|O$=wQ(C[O1G5|O$>YQSO1G5{O$>YQSO1G5{O9ZQSO1G5{O$>bQSO,5?PO9ZQSO,5?POOQO,5?P,5?PO$>vQSO,5?PO$'TQSO,5?POOQO-EWOOQQ,5>W,5>WO%[QUO'#HmO%6UQSO'#HoOOQQ,5>^,5>^O9ZQSO,5>^OOQQ,5>`,5>`OOQQ7+)b7+)bOOQQ7+)h7+)hOOQQ7+)l7+)lOOQQ7+)n7+)nO%6ZQWO1G5sO%6oQ$IUO1G0tO%6yQSO1G0tOOQO1G/n1G/nO%7UQ$IUO1G/nO>pQSO1G/nO!*fQUO'#DhOOQO,5>w,5>wOOQO-E},5>}OOQO-EpQSO7+&YO!@}QWO7+&YOOQO7+%u7+%uO$<_Q(CjO7+&ROOQO7+&R7+&RO%[QUO7+&RO%7`Q(C[O7+&RO!@rQ(C[O7+%uO!@}QWO7+%uO%7kQ(C[O7+&RO%7yQ(CjO7++hO%[QUO7++hO%8ZQSO7++gO%8ZQSO7++gOOQO1G4k1G4kO9ZQSO1G4kO%8cQSO1G4kOOQO7+%z7+%zO#%sQSO<xOOQO-E<[-E<[O%DoQbO,5>yO%[QUO,5>yOOQO-E<]-E<]O%DyQSO1G5uOOQ(CY<XOOQQ,5>Z,5>ZO&4ZQSO1G3xO9ZQSO7+&`O!*fQUO7+&`OOQO7+%Y7+%YO&4`Q$IUO1G6PO>pQSO7+%YOOQ(CY<pQSO<qQbO1G4eO&>{Q$IUO7+&ZO&APQ$IUO,5=QO&CWQ$IUO,5=SO&ChQ$IUO,5=QO&CxQ$IUO,5=SO&DYQ$IUO,59oO&F]Q$IUO,5pQSO7+)dO'%_QSO<{AN>{O%[QUOAN?XOOQO<a#@O#@^#@d#Ax#BW#Cr#DQ#DW#D^#Dd#Dn#Dt#Dz#EU#Eh#EnPPPPPPPPPP#EtPPPPPPP#Fi#IpP#KP#KW#K`PPPP$!d$%Z$+r$+u$+x$,q$,t$,w$-O$-WPP$-^$-b$.Y$/X$/]$/qPP$/u$/{$0PP$0S$0W$0Z$1P$1h$2P$2T$2W$2Z$2a$2d$2h$2lR!{RoqOXst!Z#c%j&m&o&p&r,h,m1w1zY!uQ'Z-Y1[5]Q%pvQ%xyQ&P|Q&e!VS'R!e-QQ'a!iS'g!r!xS*c$|*hQ+f%yQ+s&RQ,X&_Q-W'YQ-b'bQ-j'hQ/|*jQ1f,YR;Y:g%OdOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$a$e%j%p%}&f&i&m&o&p&r&v'O']'m'}(P(V(^(r(v(z)y+O+S,e,h,m-^-f-t-z.l.s0[0a0q1_1o1p1r1t1w1z1|2m2s3Z5Y5d5t5u5x6]7w7|8]8gS#p]:d!r)[$[$m'S)n,y,|.{2]3p5W6S9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]Q*u%ZQ+k%{Q,Z&bQ,b&jQ.c;QQ0h+^Q0l+`Q0w+lQ1n,`Q2{.[Q4v0rQ5k1gQ6i3PQ6u;RQ7h4wR8m6j&|kOPWXYZstuvw!Z!`!g!o#R#V#Y#c#n#t#x#{$O$P$Q$R$S$T$U$V$W$X$Y$[$a$e$m%j%p%}&f&i&j&m&o&p&r&v'O'S']'m'}(P(V(^(r(v(z)n)y+O+S+^,e,h,m,y,|-^-f-t-z.[.l.s.{0[0a0q1_1o1p1r1t1w1z1|2]2m2s3P3Z3p5W5Y5d5t5u5x6S6]6j7w7|8]8g9W9i:c:f:g:j:k:l:m:n:o:p:q:r:s:t:u:v:w:{;Y;Z;[;^;e;f;o;p<]t!nQ!r!u!x!y'R'Y'Z'g'h'i-Q-W-Y-j1[5]5_$v$si#u#w$c$d$x${%O%Q%[%]%a)u){)}*P*R*Y*`*p*q+]+`+w+z.Z.i/Z/j/k/m0Q0S0^1R1U1^3O3x4S4[4f4n4p5c6g7T7^7y8j8w9[9n:O:W:y:z:|:};O;P;S;T;U;V;W;X;_;`;a;b;c;d;g;h;i;j;k;l;m;n;q;r 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:371,context:Vse,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:[Gse],skippedNodes:[0,3,4,270],repeatNodeCount:37,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$JU$AZ$JU$KVEr$KV$KW$AZ$KW&FUEr&FU&FV$AZ&FV;'SEr;'S;=`I|<%l?HTEr?HT?HU$AZ?HUOEr(n%d_$e&j'}p(Q!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z&j&hT$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c&j&zP;=`<%l&c'|'U]$e&j(Q!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!b(SU(Q!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}!b(iP;=`<%l'}'|(oP;=`<%l&}'[(y]$e&j'}pOY(rYZ&cZr(rrs&cs!^(r!^!_)r!_#O(r#O#P&c#P#o(r#o#p)r#p;'S(r;'S;=`*a<%lO(rp)wU'}pOY)rZr)rs#O)r#P;'S)r;'S;=`*Z<%lO)rp*^P;=`<%l)r'[*dP;=`<%l(r#S*nX'}p(Q!bOY*gZr*grs'}sw*gwx)rx#O*g#P;'S*g;'S;=`+Z<%lO*g#S+^P;=`<%l*g(n+dP;=`<%l%Z(CS+rq$e&j'}p(Q!b's(;dOX%ZXY+gYZ&cZ[+g[p%Zpq+gqr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p$f%Z$f$g+g$g#BY%Z#BY#BZ+g#BZ$IS%Z$IS$I_+g$I_$JT%Z$JT$JU+g$JU$KV%Z$KV$KW+g$KW&FU%Z&FU&FV+g&FV;'S%Z;'S;=`+a<%l?HT%Z?HT?HU+g?HUO%Z(CS.ST(O#S$e&j't(;dO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c(CS.n_$e&j'}p(Q!b't(;dOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#`/x`$e&j!m$Ip'}p(Q!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`0z!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S1V`#r$Id$e&j'}p(Q!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_!`2X!`#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z%#S2d_#r$Id$e&j'}p(Q!bOY%ZYZ&cZr%Zrs&}sw%Zwx(rx!^%Z!^!_*g!_#O%Z#O#P&c#P#o%Z#o#p*g#p;'S%Z;'S;=`+a<%lO%Z$2b3l_'|$(n$e&j(Q!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k*r4r_$e&j(Q!bOY4kYZ5qZr4krs7nsw4kwx5qx!^4k!^!_8p!_#O4k#O#P5q#P#o4k#o#p8p#p;'S4k;'S;=`:X<%lO4k)`5vX$e&jOr5qrs6cs!^5q!^!_6y!_#o5q#o#p6y#p;'S5q;'S;=`7h<%lO5q)`6jT$`#t$e&jO!^&c!_#o&c#p;'S&c;'S;=`&w<%lO&c#t6|TOr6yrs7]s;'S6y;'S;=`7b<%lO6y#t7bO$`#t#t7eP;=`<%l6y)`7kP;=`<%l5q*r7w]$`#t$e&j(Q!bOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}%W8uZ(Q!bOY8pYZ6yZr8prs9hsw8pwx6yx#O8p#O#P6y#P;'S8p;'S;=`:R<%lO8p%W9oU$`#t(Q!bOY'}Zw'}x#O'}#P;'S'};'S;=`(f<%lO'}%W:UP;=`<%l8p*r:[P;=`<%l4k#%|:hh$e&j'}p(Q!bOY%ZYZ&cZq%Zqr`#P#o`x!^=^!^!_?q!_#O=^#O#P>`#P#o=^#o#p?q#p;'S=^;'S;=`@h<%lO=^&n>gXUS$e&jOY>`YZ&cZ!^>`!^!_?S!_#o>`#o#p?S#p;'S>`;'S;=`?k<%lO>`S?XSUSOY?SZ;'S?S;'S;=`?e<%lO?SS?hP;=`<%l?S&n?nP;=`<%l>`!f?xWUS(Q!bOY?qZw?qwx?Sx#O?q#O#P?S#P;'S?q;'S;=`@b<%lO?q!f@eP;=`<%l?q(Q@kP;=`<%l=^'`@w]US$e&j'}pOY@nYZ&cZr@nrs>`s!^@n!^!_Ap!_#O@n#O#P>`#P#o@n#o#pAp#p;'S@n;'S;=`Bg<%lO@ntAwWUS'}pOYApZrAprs?Ss#OAp#O#P?S#P;'SAp;'S;=`Ba<%lOAptBdP;=`<%lAp'`BjP;=`<%l@n#WBvYUS'}p(Q!bOYBmZrBmrs?qswBmwxApx#OBm#O#P?S#P;'SBm;'S;=`Cf<%lOBm#WCiP;=`<%lBm(rCoP;=`<%lQ^$e&j!SSOY!=yYZ&cZ!P!=y!P!Q!>|!Q!^!=y!^!_!@Y!_!}!=y!}#O!Bw#O#P!Dj#P#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!?Ta$e&j!SSO!^&c!_#Z&c#Z#[!>|#[#]&c#]#^!>|#^#a&c#a#b!>|#b#g&c#g#h!>|#h#i&c#i#j!>|#j#m&c#m#n!>|#n#o&c#p;'S&c;'S;=`&w<%lO&cS!@_X!SSOY!@YZ!P!@Y!P!Q!@z!Q!}!@Y!}#O!Ac#O#P!Bb#P;'S!@Y;'S;=`!Bq<%lO!@YS!APU!SS#Z#[!@z#]#^!@z#a#b!@z#g#h!@z#i#j!@z#m#n!@zS!AfVOY!AcZ#O!Ac#O#P!A{#P#Q!@Y#Q;'S!Ac;'S;=`!B[<%lO!AcS!BOSOY!AcZ;'S!Ac;'S;=`!B[<%lO!AcS!B_P;=`<%l!AcS!BeSOY!@YZ;'S!@Y;'S;=`!Bq<%lO!@YS!BtP;=`<%l!@Y&n!B|[$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#O!Bw#O#P!Cr#P#Q!=y#Q#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!CwX$e&jOY!BwYZ&cZ!^!Bw!^!_!Ac!_#o!Bw#o#p!Ac#p;'S!Bw;'S;=`!Dd<%lO!Bw&n!DgP;=`<%l!Bw&n!DoX$e&jOY!=yYZ&cZ!^!=y!^!_!@Y!_#o!=y#o#p!@Y#p;'S!=y;'S;=`!E[<%lO!=y&n!E_P;=`<%l!=y(Q!Eki$e&j(Q!b!SSOY&}YZ&cZw&}wx&cx!^&}!^!_'}!_#O&}#O#P&c#P#Z&}#Z#[!Eb#[#]&}#]#^!Eb#^#a&}#a#b!Eb#b#g&}#g#h!Eb#h#i&}#i#j!Eb#j#m&}#m#n!Eb#n#o&}#o#p'}#p;'S&};'S;=`(l<%lO&}!f!GaZ(Q!b!SSOY!GYZw!GYwx!@Yx!P!GY!P!Q!HS!Q!}!GY!}#O!Ic#O#P!Bb#P;'S!GY;'S;=`!JZ<%lO!GY!f!HZb(Q!b!SSOY'}Zw'}x#O'}#P#Z'}#Z#[!HS#[#]'}#]#^!HS#^#a'}#a#b!HS#b#g'}#g#h!HS#h#i'}#i#j!HS#j#m'}#m#n!HS#n;'S'};'S;=`(f<%lO'}!f!IhX(Q!bOY!IcZw!Icwx!Acx#O!Ic#O#P!A{#P#Q!GY#Q;'S!Ic;'S;=`!JT<%lO!Ic!f!JWP;=`<%l!Ic!f!J^P;=`<%l!GY(Q!Jh^$e&j(Q!bOY!JaYZ&cZw!Jawx!Bwx!^!Ja!^!_!Ic!_#O!Ja#O#P!Cr#P#Q!Q#V#X%Z#X#Y!4|#Y#b%Z#b#c#Zd$e&j'}p(Q!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'}p(Q!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#qse[e]||-1},{term:334,get:e=>Jse[e]||-1},{term:68,get:e=>ece[e]||-1}],tokenPrec:14574}),nce=[tae("function ${name}(${params}) {\n\t${}\n}",{label:"function",detail:"definition",type:"keyword"}),tae("for (let ${index} = 0; ${index} < ${bound}; ${index}++) {\n\t${}\n}",{label:"for",detail:"loop",type:"keyword"}),tae("for (let ${name} of ${collection}) {\n\t${}\n}",{label:"for",detail:"of loop",type:"keyword"}),tae("do {\n\t${}\n} while (${})",{label:"do",detail:"loop",type:"keyword"}),tae("while (${}) {\n\t${}\n}",{label:"while",detail:"loop",type:"keyword"}),tae("try {\n\t${}\n} catch (${error}) {\n\t${}\n}",{label:"try",detail:"/ catch block",type:"keyword"}),tae("if (${}) {\n\t${}\n}",{label:"if",detail:"block",type:"keyword"}),tae("if (${}) {\n\t${}\n} else {\n\t${}\n}",{label:"if",detail:"/ else block",type:"keyword"}),tae("class ${name} {\n\tconstructor(${params}) {\n\t\t${}\n\t}\n}",{label:"class",detail:"definition",type:"keyword"}),tae('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),tae('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],oce=nce.concat([tae("interface ${name} {\n\t${}\n}",{label:"interface",detail:"definition",type:"keyword"}),tae("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),tae("enum ${name} {\n\t${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),rce=new wte,ice=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function lce(e){return(t,n)=>{let o=t.node.getChild("VariableDefinition");return o&&n(o,e),!0}}const ace=["FunctionDeclaration"],sce={FunctionDeclaration:lce("function"),ClassDeclaration:lce("class"),ClassExpression:()=>!0,EnumDeclaration:lce("constant"),TypeAliasDeclaration:lce("type"),NamespaceDeclaration:lce("namespace"),VariableDefinition(e,t){e.matchContext(ace)||t(e,"variable")},TypeDefinition(e,t){t(e,"type")},__proto__:null};function cce(e,t){let n=rce.get(t);if(n)return n;let o=[],r=!0;function i(t,n){let r=e.sliceString(t.from,t.to);o.push({label:r,type:n})}return t.cursor(tte.IncludeAnonymous).iterate((t=>{if(r)r=!1;else if(t.name){let e=sce[t.name];if(e&&e(t,i)||ice.has(t.name))return!1}else if(t.to-t.from>8192){for(let n of cce(e,t.node))o.push(n);return!1}})),rce.set(t,o),o}const uce=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,dce=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName",".","?."];function pce(e){let t=rne(e.state).resolveInner(e.pos,-1);if(dce.indexOf(t.name)>-1)return null;let n="VariableName"==t.name||t.to-t.from<20&&uce.test(e.state.sliceDoc(t.from,t.to));if(!n&&!e.explicit)return null;let o=[];for(let r=t;r;r=r.parent)ice.has(r.name)&&(o=o.concat(cce(e.state.doc,r)));return{options:o,from:n?t.from:e.pos,validFor:uce}}const hce=one.define({name:"javascript",parser:tce.configure({props:[wne.add({IfStatement:Mne({except:/^\s*({|else\b)/}),TryStatement:Mne({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:e=>e.baseIndent,SwitchBody:e=>{let t=e.textAfter,n=/^\s*\}/.test(t),o=/^\s*(case|default)\b/.test(t);return e.baseIndent+(n?0:o?1:2)*e.unit},Block:Pne({closing:"}"}),ArrowFunction:e=>e.baseIndent+e.unit,"TemplateString BlockComment":()=>null,"Statement Property":Mne({except:/^{/}),JSXElement(e){let t=/^\s*<\//.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},JSXEscape(e){let t=/\s*\}/.test(e.textAfter);return e.lineIndent(e.node.from)+(t?0:e.unit)},"JSXOpenTag JSXSelfClosingTag":e=>e.column(e.node.from)+e.unit}),Ene.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":function(e){let t=e.firstChild,n=e.lastChild;return t&&t.to({from:e.from+2,to:e.to-2})})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),fce={test:e=>/^JSX/.test(e.name),facet:Jte({commentTokens:{block:{open:"{/*",close:"*/}"}}})},gce=hce.configure({dialect:"ts"},"typescript"),mce=hce.configure({dialect:"jsx",props:[ene.add((e=>e.isTop?[fce]:void 0))]}),vce=hce.configure({dialect:"jsx ts",props:[ene.add((e=>e.isTop?[fce]:void 0))]},"typescript");let bce=e=>({label:e,type:"keyword"});const yce="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(bce),Oce=yce.concat(["declare","implements","private","protected","public"].map(bce));function wce(e={}){let t=e.jsx?e.typescript?vce:mce:e.typescript?gce:hce,n=e.typescript?oce.concat(Oce):nce.concat(yce);return new fne(t,[hce.data.of({autocomplete:(o=dce,r=lle(n),e=>{for(let t=rne(e.state).resolveInner(e.pos,-1);t;t=t.parent){if(o.indexOf(t.name)>-1)return null;if(t.type.isTop)break}return r(e)})}),hce.data.of({autocomplete:pce}),e.jsx?$ce:[]]);var o,r}function Sce(e,t,n=e.length){for(let o=null==t?void 0:t.firstChild;o;o=o.nextSibling)if("JSXIdentifier"==o.name||"JSXBuiltin"==o.name||"JSXNamespacedName"==o.name||"JSXMemberExpression"==o.name)return e.sliceString(o.from,Math.min(o.to,n));return""}const xce="object"==typeof navigator&&/Android\b/.test(navigator.userAgent),$ce=o9.inputHandler.of(((e,t,n,o,r)=>{if((xce?e.composing:e.compositionStarted)||e.state.readOnly||t!=n||">"!=o&&"/"!=o||!hce.isActiveAt(e.state,t,-1))return!1;let i=r(),{state:l}=i,a=l.changeByRange((e=>{var t;let n,{head:r}=e,i=rne(l).resolveInner(r-1,-1);if("JSXStartTag"==i.name&&(i=i.parent),l.doc.sliceString(r-1,r)!=o||"JSXAttributeValue"==i.name&&i.to>r);else{if(">"==o&&"JSXFragmentTag"==i.name)return{range:e,changes:{from:r,insert:""}};if("/"==o&&"JSXStartCloseTag"==i.name){let e=i.parent,o=e.parent;if(o&&e.from==r-2&&((n=Sce(l.doc,o.firstChild,r))||"JSXFragmentTag"==(null===(t=o.firstChild)||void 0===t?void 0:t.name))){let e=`${n}>`;return{range:q3.cursor(r+e.length,-1),changes:{from:r,insert:e}}}}else if(">"==o){let t=function(e){for(;;){if("JSXOpenTag"==e.name||"JSXSelfClosingTag"==e.name||"JSXFragmentTag"==e.name)return e;if("JSXEscape"==e.name||!e.parent)return null;e=e.parent}}(i);if(t&&!/^\/?>|^<\//.test(l.doc.sliceString(r,r+2))&&(n=Sce(l.doc,t,r)))return{range:e,changes:{from:r,insert:``}}}}return{range:e}}));return!a.changes.empty&&(e.dispatch([i,l.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)})),Cce=A2(Nn({__name:"BranchDrawer",props:{open:F1().def(!1),len:X1().def(0),modelValue:V1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1),i=bt({}),l=bt({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"500px",overflowY:"auto",overflowX:"hidden"}});yn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{n("update:modelValue",i.value)},s=bt(),c=()=>{var e;null==(e=s.value)||e.validate().then((()=>{u(),n("save",i.value)})).catch((()=>{MB.warning("请检查表单信息")}))},u=()=>{n("update:open",!1),r.value=!1};return(t,n)=>{const o=hn("a-typography-paragraph"),d=hn("a-select-option"),p=hn("a-select"),h=hn("a-radio"),f=hn("a-radio-group"),g=hn("a-form-item"),m=hn("a-form"),v=hn("a-button"),b=hn("a-drawer");return sr(),hr(b,{open:r.value,"onUpdate:open":n[5]||(n[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:u},{title:an((()=>[Or(o,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":n[0]||(n[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:a},{editableEnterIcon:an((()=>[Sr(V(null))])),_:1},8,["content"])])),extra:an((()=>[Or(p,{value:i.value.priorityLevel,"onUpdate:value":n[1]||(n[1]=e=>i.value.priorityLevel=e),style:{width:"110px"}},{default:an((()=>[(sr(!0),pr(nr,null,oo(e.len-1,(e=>(sr(),hr(d,{key:e,value:e},{default:an((()=>[Sr("优先级 "+V(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),footer:an((()=>[Or(v,{type:"primary",onClick:c},{default:an((()=>[Sr("保存")])),_:1}),Or(v,{style:{"margin-left":"12px"},onClick:u},{default:an((()=>[Sr("取消")])),_:1})])),default:an((()=>[Or(m,{layout:"vertical",ref_key:"formRef",ref:s,model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:an((()=>[Or(g,{name:["decision","logicalCondition"],label:"判定逻辑",rules:[{required:!0,message:"请选择判定逻辑",trigger:"change"}]},{default:an((()=>[Or(f,{value:i.value.decision.logicalCondition,"onUpdate:value":n[2]||(n[2]=e=>i.value.decision.logicalCondition=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(c2)),(e=>(sr(),hr(h,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(g,{name:["decision","expressionType"],label:"表达式类型",rules:[{required:!0,message:"请选择表达式类型",trigger:"change"}]},{default:an((()=>[Or(f,{value:i.value.decision.expressionType,"onUpdate:value":n[3]||(n[3]=e=>i.value.decision.expressionType=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(r2)),(e=>(sr(),hr(h,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(g,{name:["decision","nodeExpression"],label:"条件表达式",rules:[{required:!0,message:"请填写条件表达式",trigger:"change"}]},{default:an((()=>[Or(xt(cse),{modelValue:i.value.decision.nodeExpression,"onUpdate:modelValue":n[4]||(n[4]=e=>i.value.decision.nodeExpression=e),theme:l.value,basic:"",lang:xt(wce)(),extensions:[xt(bse)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),[["__scopeId","data-v-5d000a58"]]),kce=A2(Nn({__name:"BranchDesc",props:{modelValue:V1().def({})},setup(e){const t=e,n=bt("");Zn((()=>{var e;Wt((()=>{r()})),(null==(e=t.modelValue.decision)?void 0:e.nodeExpression)&&(n.value=t.modelValue.decision.nodeExpression)}));const o=bt({".cm-line":{fontSize:"18px"},".cm-scroller":{height:"520px",overflowY:"auto",overflowX:"hidden"}}),r=()=>{const e=document.getElementById("branch-desc"),t=null==e?void 0:e.querySelector(".ant-descriptions-view"),n=null==t?void 0:t.querySelector("tbody"),o=document.createElement("tr");o.className="ant-descriptions-row";const r=document.createElement("th");r.className="ant-descriptions-item-label",r.innerHTML="条件表达式",r.setAttribute("colspan","4"),o.appendChild(r),null==n||n.insertBefore(o,null==n?void 0:n.childNodes[3]);const i=(null==n?void 0:n.getElementsByClassName("ant-descriptions-row"))[3];i.childNodes[2].remove();const l=i.querySelector(".ant-descriptions-item-content");l.setAttribute("style","padding: 0"),null==l||l.setAttribute("colspan","4")};return(t,r)=>{const i=hn("a-descriptions-item"),l=hn("a-descriptions");return sr(),hr(l,{id:"branch-desc",column:2,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(i,{label:"节点名称",span:2},{default:an((()=>[Sr(V(e.modelValue.nodeName),1)])),_:1}),Or(i,{label:"判定逻辑"},{default:an((()=>{var t;return[Sr(V(xt(c2)[null==(t=e.modelValue.decision)?void 0:t.logicalCondition]),1)]})),_:1}),Or(i,{label:"表达式类型"},{default:an((()=>{var t;return[Sr(V(xt(r2)[null==(t=e.modelValue.decision)?void 0:t.expressionType]),1)]})),_:1}),Or(i,{label:"条件表达式",span:2},{default:an((()=>[Or(xt(cse),{modelValue:n.value,"onUpdate:modelValue":r[0]||(r[0]=e=>n.value=e),readonly:"",disabled:"",theme:o.value,basic:"",lang:xt(wce)(),extensions:[xt(bse)]},null,8,["modelValue","theme","lang","extensions"])])),_:1})])),_:1})}}}),[["__scopeId","data-v-15066d64"]]),Pce=Nn({__name:"BranchDetail",props:{modelValue:V1().def({}),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1);yn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=hn("a-drawer");return sr(),hr(o,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:an((()=>[Or(kce,{"model-value":e.modelValue},null,8,["model-value"])])),_:1},8,["open"])}}}),Tce={class:"branch-wrap"},Mce={class:"branch-box-wrap"},Ice={class:"branch-box"},Ece={class:"condition-node"},Ace={class:"condition-node-box"},Dce=["onClick"],Rce=["onClick"],zce={class:"title"},Bce={class:"node-title"},jce={class:"priority-title"},Nce={class:"content"},_ce=["innerHTML"],Qce={key:1,class:"placeholder"},Lce=["onClick"],Hce={key:1,class:"top-left-cover-line"},Fce={key:2,class:"bottom-left-cover-line"},Wce={key:3,class:"top-right-cover-line"},Xce={key:4,class:"bottom-right-cover-line"},Yce=(e=>(rn("data-v-3f41e4f2"),e=e(),ln(),e))((()=>yr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[yr("span",{style:{"padding-left":"18px"}},"决策节点详情")],-1))),Vce=A2(Nn({__name:"BranchNode",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt({});yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{const e=i.value.conditionNodes.length;i.value.conditionNodes.splice(-1,0,{nodeName:"条件"+e,priorityLevel:e,decision:{expressionType:1,nodeExpression:void 0,logicalCondition:1}}),i.value.conditionNodes[e].priorityLevel=e+1},a=(e,t)=>{e.childNode?a(e.childNode,t):e.childNode=t},s=(e,t=1)=>{var o;i.value.conditionNodes[e]=i.value.conditionNodes.splice(e+t,1,i.value.conditionNodes[e])[0],null==(o=i.value.conditionNodes)||o.map(((e,t)=>{e.priorityLevel=t+1})),n("update:modelValue",i.value)},c=(e,t)=>{const{nodeName:n,decision:o}=e.conditionNodes[t],{logicalCondition:r,expressionType:i,nodeExpression:l}=o;return l?"其他情况"!==n?`${c2[r]}\n${r2[i]}\n${l}`:"如存在未满足其他分支条件的情况,则进入此分支":"其他情况"===n?"如存在未满足其他分支条件的情况,则进入此分支":void 0},u=bt(0),d=bt(!1),p=bt([]),h=bt({}),f=e=>{const t=i.value.conditionNodes[u.value].priorityLevel,o=e.priorityLevel;i.value.conditionNodes[u.value]=e,t!==o&&s(u.value,o-t),n("update:modelValue",i.value)},g=bt([]),m=bt(""),v=bt([]),b=(e,t)=>{var n,l;if(v.value=[],"其他情况"!==e.nodeName)if(2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=v.value)||t.push(e.id):e.jobId&&(m.value=e.jobId.toString())})),0===v.value.length)return void(p.value[t]=!0);g.value[t]=!0}else 1===r.TYPE?p.value[t]=!0:(l=t,o.disabled||l===i.value.conditionNodes.length-1?0!==r.TYPE&&(p.value[l]=!0):(u.value=l,h.value=JSON.parse(JSON.stringify(i.value.conditionNodes[l])),d.value=!0))},y=e=>o.disabled?2===r.TYPE?"其他情况"===e.nodeName?`node-disabled node-error node-error-${e.taskBatchStatus?d2[e.taskBatchStatus].name:"default"}`:`node-error node-error-${e.taskBatchStatus?d2[e.taskBatchStatus].name:"default"}`:"其他情况"===e.nodeName?"node-disabled":"node-error":"其他情况"===e.nodeName?"node-disabled":"auto-judge-def auto-judge-hover";return(t,o)=>{const u=hn("a-button"),O=hn("a-badge"),w=hn("a-tooltip");return sr(),pr("div",Tce,[yr("div",Mce,[yr("div",Ice,[e.disabled?xr("",!0):(sr(),hr(u,{key:0,class:"add-branch",primary:"",onClick:l},{default:an((()=>[Sr("添加条件")])),_:1})),(sr(!0),pr(nr,null,oo(i.value.conditionNodes,((o,l)=>(sr(),pr("div",{class:"col-box",key:l},[yr("div",Ece,[yr("div",Ace,[yr("div",{class:W(["auto-judge",y(o)]),onClick:e=>b(o,l)},[0!==l?(sr(),pr("div",{key:0,class:"sort-left",onClick:Li((e=>s(l,-1)),["stop"])},[Or(xt(FD))],8,Rce)):xr("",!0),yr("div",zce,[yr("span",Bce,[Or(O,{status:"processing",color:"#52c41a"}),Sr(" "+V(o.nodeName)+" ",1),"其他情况"===o.nodeName?(sr(),hr(w,{key:0},{title:an((()=>[Sr(" 该分支为系统默认创建,与其他分支互斥。只有当其他分支都无法运行时,才会运行该分支。 ")])),default:an((()=>[Or(xt(xx),{style:{"margin-left":"3px"}})])),_:1})):xr("",!0)]),yr("span",jce,"优先级"+V(o.priorityLevel),1),e.disabled?xr("",!0):(sr(),hr(xt(ey),{key:0,class:"close",onClick:Li((e=>{return t=l,null==(o=i.value.conditionNodes)||o.splice(t,1),void(1===i.value.conditionNodes.length&&(i.value.childNode&&(i.value.conditionNodes[0].childNode?a(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Wt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))));var t,o}),["stop"])},null,8,["onClick"]))]),yr("div",Nce,[c(i.value,l)?(sr(),pr("span",{key:0,innerHTML:c(i.value,l)},null,8,_ce)):(sr(),pr("span",Qce," 请设置条件 "))]),l!==i.value.conditionNodes.length-2?(sr(),pr("div",{key:1,class:"sort-right",onClick:Li((e=>s(l)),["stop"])},[Or(xt(uk))],8,Lce)):xr("",!0),2===xt(r).TYPE&&o.taskBatchStatus?(sr(),hr(w,{key:2},{title:an((()=>[Sr(V(xt(d2)[o.taskBatchStatus].title),1)])),default:an((()=>[Or(xt(o2),{class:"error-tip",color:xt(d2)[o.taskBatchStatus].color,size:"24px",onClick:Li((()=>{}),["stop"]),"model-value":xt(d2)[o.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):xr("",!0)],10,Dce),Or(U2,{disabled:e.disabled,modelValue:o.childNode,"onUpdate:modelValue":e=>o.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),o.childNode?io(t.$slots,"default",{key:0,node:o},void 0,!0):xr("",!0),0==l?(sr(),pr("div",Hce)):xr("",!0),0==l?(sr(),pr("div",Fce)):xr("",!0),l==i.value.conditionNodes.length-1?(sr(),pr("div",Wce)):xr("",!0),l==i.value.conditionNodes.length-1?(sr(),pr("div",Xce)):xr("",!0),0!==xt(r).type&&p.value[l]?(sr(),hr(Pce,{key:5,open:p.value[l],"onUpdate:open":e=>p.value[l]=e,modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["open","onUpdate:open","modelValue","onUpdate:modelValue"])):xr("",!0),0!==xt(r).TYPE&&g.value[l]?(sr(),hr(xt(Q2),{key:6,open:g.value[l],"onUpdate:open":e=>g.value[l]=e,id:m.value,ids:v.value},{default:an((()=>[Yce,Or(kce,{modelValue:i.value.conditionNodes[l],"onUpdate:modelValue":e=>i.value.conditionNodes[l]=e},null,8,["modelValue","onUpdate:modelValue"])])),_:2},1032,["open","onUpdate:open","id","ids"])):xr("",!0)])))),128))]),Or(U2,{disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":o[0]||(o[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])]),Or(Cce,{open:d.value,"onUpdate:open":o[1]||(o[1]=e=>d.value=e),modelValue:h.value,"onUpdate:modelValue":o[2]||(o[2]=e=>h.value=e),len:i.value.conditionNodes.length,"onUpdate:len":o[3]||(o[3]=e=>i.value.conditionNodes.length=e),onSave:f},null,8,["open","modelValue","len"])])}}}),[["__scopeId","data-v-3f41e4f2"]]),Zce=Nn({__name:"CallbackDrawer",props:{open:F1().def(!1),len:X1().def(0),modelValue:V1().def({})},emits:["update:modelValue","update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1),i=bt({});yn((()=>o.open),(e=>{r.value=e}),{immediate:!0}),yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const l=()=>{n("update:modelValue",i.value)},a=bt(),s=()=>{var e;null==(e=a.value)||e.validate().then((()=>{c(),n("save",i.value)})).catch((()=>{MB.warning("请检查表单信息")}))},c=()=>{n("update:open",!1),r.value=!1};return(e,t)=>{const n=hn("a-typography-paragraph"),o=hn("a-input"),u=hn("a-form-item"),d=hn("a-select-option"),p=hn("a-select"),h=hn("a-radio"),f=hn("a-radio-group"),g=hn("a-form"),m=hn("a-button"),v=hn("a-drawer");return sr(),hr(v,{open:r.value,"onUpdate:open":t[5]||(t[5]=e=>r.value=e),"destroy-on-close":"",width:500,onClose:c},{title:an((()=>[Or(n,{style:{margin:"0",width:"412px"},ellipsis:"",content:i.value.nodeName,"onUpdate:content":t[0]||(t[0]=e=>i.value.nodeName=e),editable:{tooltip:!1,maxlength:64},onOnEnd:l},null,8,["content"])])),footer:an((()=>[Or(m,{type:"primary",onClick:s},{default:an((()=>[Sr("保存")])),_:1}),Or(m,{style:{"margin-left":"12px"},onClick:c},{default:an((()=>[Sr("取消")])),_:1})])),default:an((()=>[Or(g,{ref_key:"formRef",ref:a,layout:"vertical",model:i.value,"label-align":"left","label-col":{style:{width:"100px"}}},{default:an((()=>[Or(u,{name:["callback","webhook"],label:"webhook",rules:[{required:!0,message:"请输入 webhook",trigger:"change"}]},{default:an((()=>[Or(o,{value:i.value.callback.webhook,"onUpdate:value":t[1]||(t[1]=e=>i.value.callback.webhook=e),placeholder:"请输入 webhook"},null,8,["value"])])),_:1}),Or(u,{name:["callback","contentType"],label:"请求类型",rules:[{required:!0,message:"请选择请求类型",trigger:"change"}]},{default:an((()=>[Or(p,{value:i.value.callback.contentType,"onUpdate:value":t[2]||(t[2]=e=>i.value.callback.contentType=e),placeholder:"请选择请求类型"},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(u2)),(e=>(sr(),hr(d,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(u,{name:["callback","secret"],label:"秘钥",rules:[{required:!0,message:"请输入秘钥",trigger:"change"}]},{default:an((()=>[Or(o,{value:i.value.callback.secret,"onUpdate:value":t[3]||(t[3]=e=>i.value.callback.secret=e),placeholder:"请输入秘钥"},null,8,["value"])])),_:1}),Or(u,{name:"workflowNodeStatus",label:"工作流状态",rules:[{required:!0,message:"请选择工作流状态",trigger:"change"}]},{default:an((()=>[Or(f,{value:i.value.workflowNodeStatus,"onUpdate:value":t[4]||(t[4]=e=>i.value.workflowNodeStatus=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(s2)),(e=>(sr(),hr(h,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open"])}}}),Uce=Nn({__name:"CallbackDetail",props:{modelValue:V1().def({}),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1);yn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=hn("a-descriptions-item"),l=hn("a-descriptions"),a=hn("a-drawer");return sr(),hr(a,{title:"决策详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:an((()=>[Or(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(o,{label:"节点名称"},{default:an((()=>[Sr(V(e.modelValue.nodeName),1)])),_:1}),Or(o,{label:"webhook"},{default:an((()=>{var t;return[Sr(V(null==(t=e.modelValue.callback)?void 0:t.webhook),1)]})),_:1}),Or(o,{label:"请求类型"},{default:an((()=>{var t;return[Sr(V(xt(u2)[null==(t=e.modelValue.callback)?void 0:t.contentType]),1)]})),_:1}),Or(o,{label:"密钥"},{default:an((()=>{var t;return[Sr(V(null==(t=e.modelValue.callback)?void 0:t.secret),1)]})),_:1})])),_:1})])),_:1},8,["open"])}}}),Kce=e=>(rn("data-v-714c9e92"),e=e(),ln(),e),Gce={class:"node-wrap"},qce={class:"branch-box"},Jce={class:"condition-node",style:{"min-height":"230px"}},eue={class:"condition-node-box",style:{"padding-top":"0"}},tue={class:"popover"},nue=Kce((()=>yr("span",null,"重试",-1))),oue=Kce((()=>yr("span",null,"忽略",-1))),rue=["onClick"],iue={class:"title"},lue={class:"text",style:{color:"#935af6"}},aue={class:"content",style:{"min-height":"81px"}},sue={key:0,class:"placeholder"},cue={style:{display:"flex","justify-content":"space-between"}},uue=Kce((()=>yr("span",{class:"content_label"},"Webhook:",-1))),due=Kce((()=>yr("span",{class:"content_label"},"请求类型: ",-1))),pue=Kce((()=>yr("div",null,".........",-1))),hue={key:1,class:"top-left-cover-line"},fue={key:2,class:"bottom-left-cover-line"},gue={key:3,class:"top-right-cover-line"},mue={key:4,class:"bottom-right-cover-line"},vue=Kce((()=>yr("div",{style:{margin:"20px 0","border-left":"#f5222d 5px solid","font-size":"medium","font-weight":"bold"}},[yr("span",{style:{"padding-left":"18px"}},"回调节点详情")],-1))),bue=A2(Nn({__name:"CallbackNode",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=m1(),i=bt({}),l=bt({});yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0});const a=()=>{i.value.childNode&&(i.value.conditionNodes[0].childNode?s(i.value.conditionNodes[0].childNode,i.value.childNode):i.value.conditionNodes[0].childNode=i.value.childNode),Wt((()=>{n("update:modelValue",i.value.conditionNodes[0].childNode)}))},s=(e,t)=>{e.childNode?s(e.childNode,t):e.childNode=t},c=bt(0),u=bt(!1),d=bt(!1),p=bt({}),h=e=>{i.value.conditionNodes[c.value]=e,n("update:modelValue",i.value)},f=bt(!1),g=bt(""),m=bt([]),v=(e,t)=>{var n,o;if(m.value=[],2===r.TYPE){if(null==(n=e.jobBatchList)||n.forEach((e=>{var t;e.id?null==(t=m.value)||t.push(e.id):e.jobId&&(g.value=e.jobId.toString())})),0===m.value.length)return void(d.value=!0);f.value=!0}else 1===r.TYPE?d.value=!0:(o=t,0===r.TYPE?(c.value=o,p.value=JSON.parse(JSON.stringify(i.value.conditionNodes[o])),u.value=!0):d.value=!0)},b=e=>o.disabled?2===r.TYPE?`node-error node-error-${e.taskBatchStatus?d2[e.taskBatchStatus].name:"default"}`:"node-error":"auto-judge-def auto-judge-hover";return(t,n)=>{const o=hn("a-divider"),s=hn("a-button"),c=hn("a-badge"),y=hn("a-typography-text"),O=hn("a-tooltip"),w=hn("a-popover"),S=hn("a-descriptions-item"),x=hn("a-descriptions");return sr(),pr("div",Gce,[yr("div",qce,[(sr(!0),pr(nr,null,oo(i.value.conditionNodes,((n,u)=>(sr(),pr("div",{class:"col-box",key:u},[yr("div",Jce,[yr("div",eue,[Or(w,{open:l.value[u]&&2===xt(r).TYPE,getPopupContainer:e=>e.parentNode,onOpenChange:e=>l.value[u]=e},{content:an((()=>[yr("div",tue,[Or(o,{type:"vertical"}),Or(s,{type:"text",class:"popover-item"},{default:an((()=>[Or(xt(RJ)),nue])),_:1}),Or(o,{type:"vertical"}),Or(s,{type:"text",class:"popover-item"},{default:an((()=>[Or(xt(fJ)),oue])),_:1})])])),default:an((()=>{var t,o;return[yr("div",{class:W(["auto-judge",b(n)]),onClick:e=>v(n,u)},[yr("div",iue,[yr("span",lue,[Or(c,{status:"processing",color:1===n.workflowNodeStatus?"#52c41a":"#ff4d4f"},null,8,["color"]),Sr(" "+V(n.nodeName),1)]),e.disabled?xr("",!0):(sr(),hr(xt(ey),{key:0,class:"close",onClick:Li(a,["stop"])}))]),yr("div",aue,[(null==(t=n.callback)?void 0:t.webhook)?xr("",!0):(sr(),pr("div",sue,"请配置回调通知")),(null==(o=n.callback)?void 0:o.webhook)?(sr(),pr(nr,{key:1},[yr("div",cue,[uue,Or(y,{style:{width:"116px"},ellipsis:"",content:n.callback.webhook},null,8,["content"])]),yr("div",null,[due,Sr(" "+V(xt(u2)[n.callback.contentType]),1)]),pue],64)):xr("",!0)]),2===xt(r).TYPE&&n.taskBatchStatus?(sr(),hr(O,{key:0},{title:an((()=>[Sr(V(xt(d2)[n.taskBatchStatus].title),1)])),default:an((()=>[Or(xt(o2),{class:"error-tip",color:xt(d2)[n.taskBatchStatus].color,size:"24px",onClick:Li((()=>{}),["stop"]),"model-value":xt(d2)[n.taskBatchStatus].icon},null,8,["color","model-value"])])),_:2},1024)):xr("",!0)],10,rue)]})),_:2},1032,["open","getPopupContainer","onOpenChange"]),Or(U2,{disabled:e.disabled,modelValue:n.childNode,"onUpdate:modelValue":e=>n.childNode=e},null,8,["disabled","modelValue","onUpdate:modelValue"])])]),n.childNode?io(t.$slots,"default",{key:0,node:n},void 0,!0):xr("",!0),0==u?(sr(),pr("div",hue)):xr("",!0),0==u?(sr(),pr("div",fue)):xr("",!0),u==i.value.conditionNodes.length-1?(sr(),pr("div",gue)):xr("",!0),u==i.value.conditionNodes.length-1?(sr(),pr("div",mue)):xr("",!0)])))),128))]),i.value.conditionNodes.length>1?(sr(),hr(U2,{key:0,disabled:e.disabled,modelValue:i.value.childNode,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.childNode=e)},null,8,["disabled","modelValue"])):xr("",!0),0!==xt(r).type?(sr(),hr(Uce,{key:1,open:d.value,"onUpdate:open":n[1]||(n[1]=e=>d.value=e),modelValue:i.value.conditionNodes[0],"onUpdate:modelValue":n[2]||(n[2]=e=>i.value.conditionNodes[0]=e)},null,8,["open","modelValue"])):xr("",!0),Or(Zce,{open:u.value,"onUpdate:open":n[3]||(n[3]=e=>u.value=e),modelValue:p.value,"onUpdate:modelValue":n[4]||(n[4]=e=>p.value=e),onSave:h},null,8,["open","modelValue"]),0!==xt(r).TYPE&&f.value?(sr(),hr(xt(Q2),{key:2,open:f.value,"onUpdate:open":n[5]||(n[5]=e=>f.value=e),id:g.value,ids:m.value},{default:an((()=>[vue,Or(x,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(S,{label:"节点名称"},{default:an((()=>[Sr(V(i.value.conditionNodes[0].nodeName),1)])),_:1}),Or(S,{label:"webhook"},{default:an((()=>{var e;return[Sr(V(null==(e=i.value.conditionNodes[0].callback)?void 0:e.webhook),1)]})),_:1}),Or(S,{label:"请求类型"},{default:an((()=>{var e;return[Sr(V(xt(u2)[null==(e=i.value.conditionNodes[0].callback)?void 0:e.contentType]),1)]})),_:1}),Or(S,{label:"密钥"},{default:an((()=>{var e;return[Sr(V(null==(e=i.value.conditionNodes[0].callback)?void 0:e.secret),1)]})),_:1})])),_:1})])),_:1},8,["open","id","ids"])):xr("",!0)])}}}),[["__scopeId","data-v-714c9e92"]]),yue=Nn({__name:"NodeWrap",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=bt({});return yn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),yn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>{const o=hn("node-wrap",!0);return sr(),pr(nr,null,[1==r.value.nodeType?(sr(),hr(y3,{key:0,modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},{default:an((t=>[t.node?(sr(),hr(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):xr("",!0)])),_:1},8,["modelValue","disabled"])):xr("",!0),2==r.value.nodeType?(sr(),hr(Vce,{key:1,modelValue:r.value,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value=e),disabled:e.disabled},{default:an((t=>[t.node?(sr(),hr(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):xr("",!0)])),_:1},8,["modelValue","disabled"])):xr("",!0),3==r.value.nodeType?(sr(),hr(bue,{key:2,modelValue:r.value,"onUpdate:modelValue":n[2]||(n[2]=e=>r.value=e),disabled:e.disabled},{default:an((t=>[t.node?(sr(),hr(o,{key:0,modelValue:t.node.childNode,"onUpdate:modelValue":e=>t.node.childNode=e,disabled:e.disabled},null,8,["modelValue","onUpdate:modelValue","disabled"])):xr("",!0)])),_:1},8,["modelValue","disabled"])):xr("",!0),r.value.childNode?(sr(),hr(o,{key:3,modelValue:r.value.childNode,"onUpdate:modelValue":n[3]||(n[3]=e=>r.value.childNode=e),disabled:e.disabled},null,8,["modelValue","disabled"])):xr("",!0)],64)}}}),Oue="*",wue="/",Sue="-",xue=",",$ue="?",Cue="L",kue="W",Pue="#",Tue="",Mue="LW",Iue=(new Date).getFullYear();function Eue(e){return"number"==typeof e||/^\d+(\.\d+)?$/.test(e)}const{hasOwnProperty:Aue}=Object.prototype;function Due(e,t){return Object.keys(t).forEach((n=>{!function(e,t,n){const o=t[n];(function(e){return null!=e})(o)&&(Aue.call(e,n)&&function(e){return null!==e&&"object"==typeof e}(o)?e[n]=Due(Object(e[n]),t[n]):e[n]=o)}(e,t,n)})),e}const Rue={common:{from:"从",fromThe:"从第",start:"开始",every:"每",between:"在",and:"到",end:"之间的",specified:"固定的",symbolTip:"通配符支持",valTip:"值为",nearest:"最近的",current:"本",nth:"第",index:"个",placeholder:"请选择",placeholderMulti:"请选择(支持多选)",help:"帮助",wordNumError:"格式不正确,必须有6或7位",reverse:"反向解析",reset:"重置",tagError:"表达式不正确",numError:"含有非法数字",use:"使用",inputPlaceholder:"Cron表达式"},custom:{unspecified:"不固定",workDay:"工作日",lastTh:"倒数第",lastOne:"最后一个",latestWorkday:"最后一个工作日",empty:"不配置"},second:{title:"秒",val:"0 1 2...59"},minute:{title:"分",val:"0 1 2...59"},hour:{title:"时",val:"0 1 2...23"},dayOfMonth:{timeUnit:"日",title:"日",val:"1 2...31"},month:{title:"月",val:"1 2...12,或12个月的缩写(JAN ... DEC)"},dayOfWeek:{timeUnit:"日",title:"周",val:"1 2...7或星期的缩写(SUN ... SAT)",SUN:"星期天",MON:"星期一",TUE:"星期二",WED:"星期三",THU:"星期四",FRI:"星期五",SAT:"星期六"},year:{title:"年",val:Iue+" ... 2099"},period:{startError:"开始格式不符",cycleError:"循环格式不符"},range:{lowerError:"下限格式不符",upperError:"上限格式不符",lowerBiggerThanUpperError:"下限不能比上限大"},weekDay:{weekDayNumError:"周数格式不符",nthError:"天数格式不符"},app:{title:"基于Vue&Element-ui实现的Cron表达式生成器",next10FireTimes:"最近10次执行时刻"},daysOfWeekOptions:[{label:"星期天",value:1},{label:"星期一",value:2},{label:"星期二",value:3},{label:"星期三",value:4},{label:"星期四",value:5},{label:"星期五",value:6},{label:"星期六",value:7}]},zue=bt("zh-CN"),Bue=rt({"zh-CN":Rue}),jue={messages:()=>Bue[zue.value],use(e,t){zue.value=e,this.add({[e]:t})},add(e={}){Due(Bue,e)}},Nue=jue.messages(),_ue={class:"cron-body-row"},Que={class:"symbol"},Lue=A2(Nn({components:{Radio:NM},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:Oue},tag:{type:String,default:Oue},onChange:{type:Function}},setup:e=>({Message:Nue,change:function(){e.onChange&&e.onChange({tag:Oue,type:Oue})},EVERY:Oue})}),[["render",function(e,t,n,o,r,i){const l=hn("Radio");return sr(),pr("div",_ue,[Or(l,{checked:e.type===e.EVERY,onClick:e.change},{default:an((()=>[yr("span",Que,V(e.EVERY),1),Sr(V(e.Message.common.every)+V(e.timeUnit),1)])),_:1},8,["checked","onClick"])])}]]),Hue=jue.messages(),Fue={class:"cron-body-row"},Wue={class:"symbol"},Xue=A2(Nn({components:{Radio:NM,InputNumber:wL},props:{startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:wue},tag:{type:String,default:wue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(0);n.value`${n.value}${wue}${o.value}`));function i(t){if(e.type!==wue)return;const r=t.split(wue);2===r.length?(r[0]===Oue&&(r[0]=0),!Eue(r[0])||parseInt(r[0])e.startConfig.max?MB.error(`${Hue.period.startError}:${r[0]}`):!Eue(r[1])||parseInt(r[1])e.cycleConfig.max?MB.error(`${Hue.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1]))):MB.error(`${Hue.common.tagError}:${t}`)}return Zn((()=>{i(e.tag)})),yn((()=>e.tag),(e=>{i(e)}),{deep:!0}),yn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Hue,type_:t,start:n,cycle:o,tag_:r,PERIOD:wue,change:function(){e.onChange&&e.onChange({type:wue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=hn("InputNumber"),a=hn("Radio");return sr(),pr("div",Fue,[Or(a,{checked:e.type===e.PERIOD,onChange:e.change},{default:an((()=>[yr("span",Wue,V(e.tag_),1),Sr(" "+V(e.Message.common.fromThe)+" ",1),Or(l,{size:"small",value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),min:e.startConfig.min,step:e.startConfig.step,max:e.startConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit)+V(e.Message.common.start)+V(e.Message.common.every)+" ",1),Or(l,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Yue=jue.messages(),Vue={class:"cron-body-row"},Zue={class:"symbol"},Uue=A2(Nn({components:{Radio:NM,InputNumber:wL},props:{upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Sue},tag:{type:String,default:Sue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(0);o.value`${o.value}${Sue}${n.value}`));function l(t){if(e.type!==Sue)return;const r=t.split(Sue);2===r.length&&(r[0]===Sue&&(r[0]=0),!Eue(r[0])||parseInt(r[0])e.lowerConfig.max||!Eue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Zn((()=>{l(e.tag)})),yn((()=>e.tag),(e=>{l(e)}),{deep:!0}),yn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Yue,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:Sue,change:function(){e.onChange&&e.onChange({type:Sue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("InputNumber"),a=hn("Radio");return sr(),pr("div",Vue,[Or(a,{checked:e.type===e.RANGE,onChange:e.change},{default:an((()=>[yr("span",Zue,V(e.tag_),1),Sr(" "+V(e.Message.common.between)+" ",1),Or(l,{size:"small",value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),min:e.lowerConfig.min,step:e.lowerConfig.step,max:e.upper_,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit)+V(e.Message.common.and)+" ",1),Or(l,{size:"small",value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),min:e.lower,step:e.upperConfig.step,max:e.upperConfig.max,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.Message.common.end)+V(e.Message.common.every)+V(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),Kue=jue.messages(),Gue=Nn({components:{Radio:NM,ASelect:ex,Tooltip:I$},props:{nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:xue},tag:{type:String,default:xue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=Fr((()=>{let e="";if(o.value&&o.value.length){o.value.sort();for(let t=0;t{Eue(t)&&parseInt(t)>=parseInt(e.nums[0].value)&&parseInt(t)<=parseInt(e.nums[e.nums.length-1].value)&&o.value.push(parseInt(t))}))}}return Zn((()=>{i()})),yn((()=>e.tag),(()=>i()),{deep:!0}),yn((()=>e.type),(()=>i()),{deep:!0}),{Message:Kue,type_:t,tag_:n,open:r,FIXED:xue,change:function(){e.onChange&&e.onChange({type:xue,tag:n.value||xue})},numArray:o,changeTag:i}}}),que={class:"cron-body-row"},Jue=yr("span",{class:"symbol"},",",-1),ede=A2(Gue,[["render",function(e,t,n,o,r,i){const l=hn("Tooltip"),a=hn("Radio"),s=hn("ASelect");return sr(),pr("div",que,[Or(a,{checked:e.type===e.FIXED,onChange:e.change},{default:an((()=>[Or(l,{title:e.tag_},{default:an((()=>[Jue])),_:1},8,["title"]),Sr(" "+V(e.Message.common.specified),1)])),_:1},8,["checked","onChange"]),Or(s,{size:"small",mode:"tags",placeholder:e.Message.common.placeholder,style:{width:"300px"},options:e.nums,disabled:e.type!==e.FIXED,value:e.numArray,"onUpdate:value":t[0]||(t[0]=t=>e.numArray=t),onChange:e.change},null,8,["placeholder","options","disabled","value","onChange"])])}]]),tde={watch:{tag(e){this.resolveTag(e)}},mounted(){this.resolveTag(this.tag)},methods:{resolveTag(e){null==e&&(e=Tue);let t=null;(e=this.resolveCustom(e))===Tue?t=Tue:e===$ue?t=$ue:e===Oue?t=Oue:e===Mue&&(t=Mue),null==t&&(t=e.startsWith("L-")||e.endsWith(Cue)?Cue:e.endsWith(kue)&&e.length>1?kue:e.indexOf(Pue)>0?Pue:e.indexOf(wue)>0?wue:e.indexOf(Sue)>0?Sue:xue),this.type_=t,this.tag_=e},resolveCustom:e=>e}},nde=jue.messages(),ode=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Oue),a=bt(e.tag);return{Message:nde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.second.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.second.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),rde=jue.messages(),ide=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:59},n={min:1,step:1,max:59},o={min:0,step:1,max:59},r={min:0,step:1,max:59},i=[];for(let s=0;s<60;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Oue),a=bt(e.tag);return{Message:rde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.minute.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.minute.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),lde=jue.messages(),ade=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:0,step:1,max:23},n={min:1,step:1,max:23},o={min:0,step:1,max:23},r={min:0,step:1,max:23},i=[];for(let s=0;s<24;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Oue),a=bt(e.tag);return{Message:lde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.hour.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.hour.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),sde=jue.messages(),cde={class:"cron-body-row"},ude={class:"symbol"},dde=A2(Nn({components:{Radio:NM},props:{type:{type:String,default:$ue},tag:{type:String,default:$ue},onChange:{type:Function}},setup:e=>({Message:sde,change:function(){e.onChange&&e.onChange({tag:$ue,type:$ue})},UNFIXED:$ue})}),[["render",function(e,t,n,o,r,i){const l=hn("Radio");return sr(),pr("div",cde,[Or(l,{checked:e.type===e.UNFIXED,onClick:e.change},{default:an((()=>[yr("span",ude,V(e.UNFIXED),1),Sr(V(e.Message.custom.unspecified),1)])),_:1},8,["checked","onClick"])])}]]),pde=jue.messages(),hde={class:"cron-body-row"},fde={class:"symbol"},gde=A2(Nn({components:{Radio:NM,InputNumber:wL},props:{lastConfig:{type:Object,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Cue},tag:{type:String,default:Cue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=Fr((()=>1===n.value?Cue:"L-"+(n.value-1)));function r(t){if(e.type!==Cue)return;if(t===Cue)return void(n.value=1);const o=t.substring(2);Eue(o)&&parseInt(o)>=e.lastConfig.min&&parseInt(o)<=e.lastConfig.max?n.value=parseInt(o)+1:MB.error(pde.common.numError+":"+o)}return Zn((()=>{r(e.tag)})),yn((()=>e.tag),(e=>{r(e)}),{deep:!0}),yn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:pde,type_:t,tag_:o,LAST:Cue,lastNum:n,change:function(){e.onChange&&e.onChange({type:Cue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=hn("InputNumber"),a=hn("Radio");return sr(),pr("div",hde,[Or(a,{checked:e.type===e.LAST,onChange:e.change},{default:an((()=>[yr("span",fde,V(e.tag_),1),Sr(" "+V(e.Message.common.current)+V(e.targetTimeUnit)+V(e.Message.custom.lastTh)+" ",1),Or(l,{size:"small",value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),min:e.lastConfig.min,step:e.lastConfig.step,max:e.lastConfig.max,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit),1)])),_:1},8,["checked","onChange"])])}]]),mde=jue.messages(),vde={class:"cron-body-row"},bde={class:"symbol"},yde=A2(Nn({components:{Radio:NM,InputNumber:wL},props:{targetTimeUnit:{type:String,default:null},startDateConfig:{type:Object,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:kue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(1),r=Fr((()=>`${n.value}${kue}`));function i(t){if(e.type!==kue)return;const o=t.substring(0,t.length-1);!Eue(o)||parseInt(o)e.startDateConfig.max?MB.error(`${mde.common.numError}:${o}`):n.value=parseInt(o)}return Zn((()=>{i(e.tag)})),yn((()=>e.tag),(e=>{i(e)}),{deep:!0}),yn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:mde,type_:t,startDate:n,weekDayNum:o,tag_:r,WORK_DAY:kue,change:function(){e.onChange&&e.onChange({type:kue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("InputNumber");return sr(),pr("div",vde,[Or(l,{checked:e.type===e.WORK_DAY,onChange:e.change},{default:an((()=>[yr("span",bde,V(e.tag_),1),Sr(" "+V(e.Message.common.every)+V(e.targetTimeUnit),1)])),_:1},8,["checked","onChange"]),Or(a,{size:"small",value:e.startDate,"onUpdate:value":t[0]||(t[0]=t=>e.startDate=t),min:e.startDateConfig.min,step:e.startDateConfig.step,max:e.startDateConfig.max,disabled:e.type!==e.WORK_DAY,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit)+V(e.Message.common.nearest)+V(e.Message.custom.workDay),1)])}]]),Ode=jue.messages(),wde={class:"cron-body-row"},Sde={class:"symbol"},xde=A2(Nn({components:{Radio:NM},props:{targetTimeUnit:{type:String,default:null},type:{type:String,default:Mue},tag:{type:String,default:Mue},onChange:{type:Function}},setup:e=>({Message:Ode,change:function(){e.onChange&&e.onChange({tag:Mue,type:Mue})},LAST_WORK_DAY:Mue})}),[["render",function(e,t,n,o,r,i){const l=hn("Radio");return sr(),pr("div",wde,[Or(l,{checked:e.type===e.LAST_WORK_DAY,onClick:e.change},{default:an((()=>[yr("span",Sde,V(e.LAST_WORK_DAY),1),Sr(" "+V(e.Message.common.current)+V(e.targetTimeUnit)+V(e.Message.custom.latestWorkday),1)])),_:1},8,["checked","onClick"])])}]]),$de=jue.messages(),Cde=31,kde=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede,UnFixed:dde,Last:gde,WorkDay:yde,LastWorkDay:xde},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:Cde},n={min:1,step:1,max:Cde},o={min:1,step:1,max:Cde},r={min:1,step:1,max:Cde},i={min:1,step:1,max:Cde},l=[];for(let c=1;c<32;c++){const e={label:c.toString(),value:c};l.push(e)}const a=bt(Oue),s=bt(e.tag);return{Message:$de,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,lastConfig:i,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed"),u=hn("UnFixed"),d=hn("Last"),p=hn("WorkDay"),h=hn("LastWorkDay");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Or(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Or(d,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"last-config":e.lastConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","last-config","onChange"]),Or(p,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["time-unit","type","tag","target-time-unit","start-date-config","onChange"]),Or(h,{type:e.type_,tag:e.tag_,"target-time-unit":e.Message.month.title,"start-date-config":e.startConfig,onChange:e.change},null,8,["type","tag","target-time-unit","start-date-config","onChange"])],64)}]]),Pde=jue.messages(),Tde=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede},mixins:[tde],props:{tag:{type:String,default:Oue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:12},n={min:1,step:1,max:12},o={min:1,step:1,max:12},r={min:1,step:1,max:12},i=[];for(let s=1;s<13;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Oue),a=bt(e.tag);return{Message:Pde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.month.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"])],64)}]]),Mde=jue.messages(),Ide={class:"cron-body-row"},Ede={class:"symbol"},Ade=A2(Nn({components:{Radio:NM},props:{timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:Tue},tag:{type:String,default:Tue},onChange:{type:Function}},setup:e=>({Message:Mde,change:function(){e.onChange&&e.onChange({tag:Tue,type:Tue})},EMPTY:Tue})}),[["render",function(e,t,n,o,r,i){const l=hn("Radio");return sr(),pr("div",Ide,[Or(l,{checked:e.type===e.EMPTY,onClick:e.change},{default:an((()=>[yr("span",Ede,V(e.Message.custom.empty),1)])),_:1},8,["checked","onClick"])])}]]),Dde=jue.messages(),Rde=Iue,zde=2099,Bde=A2(Nn({components:{Every:Lue,Period:Xue,Range:Uue,Fixed:ede,Empty:Ade},mixins:[tde],props:{tag:{type:String,default:Tue},onChange:{type:Function}},setup(e){const t={min:Rde,step:1,max:zde},n={min:1,step:1,max:zde},o={min:Rde,step:1,max:zde},r={min:Rde,step:1,max:zde},i=[];for(let s=Rde;s<2100;s++){const e={label:s.toString(),value:s};i.push(e)}const l=bt(Tue),a=bt(e.tag);return{Message:Dde,startConfig:t,cycleConfig:n,lowerConfig:o,upperConfig:r,nums:i,type_:l,tag_:a,change:function(t){l.value=t.type,a.value=t.tag,e.onChange&&e.onChange({type:l.value,tag:a.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed"),u=hn("Empty");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.year.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.year.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Or(u,{type:e.type_,tag:e.tag_,onChange:e.change},null,8,["type","tag","onChange"])],64)}]]),jde=jue.messages(),Nde={class:"cron-body-row"},_de={class:"symbol"},Qde=A2(Nn({components:{Radio:NM,InputNumber:wL,ASelect:ex},props:{nums:{type:Array,default:null},startConfig:{type:Object,default:null},cycleConfig:{type:Object,default:null},timeUnit:{type:String,default:null},symbol:{type:String,default:null},type:{type:String,default:wue},tag:{type:String,default:wue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(1),r=Fr((()=>`${n.value}${wue}${o.value}`));function i(t){if(e.type!==wue)return;const r=t.split(wue);2===r.length?!Eue(r[0])||parseInt(r[0])e.startConfig.max?MB.error(`${jde.period.startError}:${r[0]}`):!Eue(r[1])||parseInt(r[1])e.cycleConfig.max?MB.error(`${jde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):MB.error(`${jde.common.tagError}:${t}`)}return Zn((()=>{i(e.tag)})),yn((()=>e.tag),(e=>{i(e)}),{deep:!0}),yn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:jde,type_:t,start:n,cycle:o,tag_:r,PERIOD:wue,change:function(){e.onChange&&e.onChange({type:wue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("ASelect"),s=hn("InputNumber");return sr(),pr("div",Nde,[Or(l,{checked:e.type===e.PERIOD,onChange:e.change},{default:an((()=>[yr("span",_de,V(e.tag_),1),Sr(" "+V(e.Message.common.from),1)])),_:1},8,["checked","onChange"]),Or(a,{size:"small",style:{width:"100px"},value:e.start,"onUpdate:value":t[0]||(t[0]=t=>e.start=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Sr(" "+V(e.Message.common.start)+V(e.Message.common.every)+" ",1),Or(s,{size:"small",value:e.cycle,"onUpdate:value":t[1]||(t[1]=t=>e.cycle=t),min:e.cycleConfig.min,step:e.cycleConfig.step,max:e.cycleConfig.max,disabled:e.type!==e.PERIOD,onChange:e.change},null,8,["value","min","step","max","disabled","onChange"]),Sr(" "+V(e.timeUnit),1)])}]]),Lde=jue.messages(),Hde=ex.Option,Fde={class:"cron-body-row"},Wde={class:"symbol"},Xde=A2(Nn({components:{Radio:NM,ASelect:ex,AOption:Hde},props:{nums:{type:Array,default:null},upper:{type:Number,default:1},lowerConfig:{type:Object,default:null},upperConfig:{type:Object,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Sue},tag:{type:String,default:Sue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(0);o.value`${o.value}${Sue}${n.value}`));function l(t){if(e.type!==Sue)return;const r=t.split(Sue);2===r.length&&(r[0]===Sue&&(r[0]=0),!Eue(r[0])||parseInt(r[0])e.lowerConfig.max||!Eue(r[1])||parseInt(r[1])e.upperConfig.max||(o.value=parseInt(r[0]),n.value=parseInt(r[1])))}return Zn((()=>{l(e.tag)})),yn((()=>e.tag),(e=>{l(e)}),{deep:!0}),yn((()=>e.type),(()=>{l(e.tag)}),{deep:!0}),{Message:Lde,type_:t,lower:o,cycle:r,tag_:i,upper_:n,RANGE:Sue,change:function(){e.onChange&&e.onChange({type:Sue,tag:i.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("AOption"),s=hn("ASelect");return sr(),pr("div",Fde,[Or(l,{checked:e.type===e.RANGE,onChange:e.change},{default:an((()=>[yr("span",Wde,V(e.tag_),1),Sr(" "+V(e.Message.common.between),1)])),_:1},8,["checked","onChange"]),Or(s,{size:"small",style:{width:"100px"},value:e.lower,"onUpdate:value":t[0]||(t[0]=t=>e.lower=t),placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},{default:an((()=>[(sr(!0),pr(nr,null,oo(e.nums,(t=>(sr(),hr(a,{key:t.value,value:t.value,disabled:Number(t.value)>e.upper_},{default:an((()=>[Sr(V(t.label),1)])),_:2},1032,["value","disabled"])))),128))])),_:1},8,["value","placeholder","disabled","onChange"]),Sr(" "+V(e.timeUnit)+V(e.Message.common.and)+" ",1),Or(s,{size:"small",style:{width:"100px"},value:e.upper_,"onUpdate:value":t[1]||(t[1]=t=>e.upper_=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.RANGE,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"]),Sr(" "+V(e.Message.common.end)+V(e.Message.common.every)+V(e.timeUnit),1)])}]]),Yde=jue.messages(),Vde={class:"cron-body-row"},Zde={class:"symbol"},Ude=A2(Nn({components:{Radio:NM,ASelect:ex},props:{nums:{type:Array,default:null},targetTimeUnit:{type:String,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Cue},tag:{type:String,default:Cue},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=Fr((()=>(n.value>=1&&n.value<7?n.value:"")+Cue));function r(t){if(e.type!==Cue)return;if(t===Cue)return void(n.value=7);const o=t.substring(0,t.length-1);Eue(o)&&parseInt(o)>=parseInt(e.nums[0].value)&&parseInt(o)<=parseInt(e.nums[e.nums.length-1].value)?n.value=parseInt(o):MB.error(Yde.common.numError+":"+o)}return Zn((()=>{r(e.tag)})),yn((()=>e.tag),(e=>{r(e)}),{deep:!0}),yn((()=>e.type),(()=>{r(e.tag)}),{deep:!0}),{Message:Yde,type_:t,tag_:o,LAST:Cue,lastNum:n,change:function(){e.onChange&&e.onChange({type:Cue,tag:o.value})},changeTag:r}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("ASelect");return sr(),pr("div",Vde,[Or(l,{checked:e.type===e.LAST,onChange:e.change},{default:an((()=>[yr("span",Zde,V(e.tag_),1),Sr(" "+V(e.Message.common.current)+V(e.targetTimeUnit)+V(e.Message.custom.lastTh),1)])),_:1},8,["checked","onChange"]),Or(a,{size:"small",style:{width:"100px"},value:e.lastNum,"onUpdate:value":t[0]||(t[0]=t=>e.lastNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.LAST,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),Kde=jue.messages(),Gde={class:"cron-body-row"},qde={class:"symbol"},Jde=A2(Nn({components:{Radio:NM,InputNumber:wL,ASelect:ex},props:{targetTimeUnit:{type:String,default:null},nums:{type:Array,default:null},timeUnit:{type:String,default:null},type:{type:String,default:Pue},tag:{type:String,default:""},onChange:{type:Function}},setup(e){const t=bt(e.type),n=bt(1),o=bt(1),r=Fr((()=>`${n.value}${Pue}${o.value}`));function i(t){if(e.type!==Pue)return;const r=t.split(Pue);2===r.length?!Eue(r[0])||parseInt(r[0])parseInt(e.nums[e.nums.length-1].value)?MB.error(`${Kde.period.startError}:${r[0]}`):!Eue(r[1])||parseInt(r[1])<1||parseInt(r[1])>5?MB.error(`${Kde.period.cycleError}:${r[1]}`):(n.value=parseInt(r[0]),o.value=parseInt(r[1])):MB.error(`${Kde.common.tagError}:${t}`)}return Zn((()=>{i(e.tag)})),yn((()=>e.tag),(e=>{i(e)}),{deep:!0}),yn((()=>e.type),(()=>{i(e.tag)}),{deep:!0}),{Message:Kde,type_:t,nth:n,weekDayNum:o,tag_:r,WEEK_DAY:Pue,change:function(){e.onChange&&e.onChange({type:Pue,tag:r.value})},changeTag:i}}}),[["render",function(e,t,n,o,r,i){const l=hn("Radio"),a=hn("InputNumber"),s=hn("ASelect");return sr(),pr("div",Gde,[Or(l,{checked:e.type===e.WEEK_DAY,onChange:e.change},{default:an((()=>[yr("span",qde,V(e.tag_),1),Sr(" "+V(e.Message.common.current)+V(e.targetTimeUnit)+V(e.Message.common.nth),1)])),_:1},8,["checked","onChange"]),Or(a,{size:"small",value:e.nth,"onUpdate:value":t[0]||(t[0]=t=>e.nth=t),min:1,step:1,max:5,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","disabled","onChange"]),Sr(" "+V(e.Message.common.index)+" ",1),Or(s,{size:"small",style:{width:"100px"},value:e.weekDayNum,"onUpdate:value":t[1]||(t[1]=t=>e.weekDayNum=t),options:e.nums,placeholder:e.Message.common.placeholder,disabled:e.type!==e.WEEK_DAY,onChange:e.change},null,8,["value","options","placeholder","disabled","onChange"])])}]]),epe=jue.messages(),tpe=A2(Nn({components:{Every:Lue,Period:Qde,Range:Xde,Fixed:ede,UnFixed:dde,Last:Ude,WeekDay:Jde},mixins:[tde],props:{tag:{type:String,default:$ue},onChange:{type:Function}},setup(e){const t={min:1,step:1,max:7},n={min:1,step:1,max:7},o={min:1,step:1,max:7},r={min:1,step:1,max:7},i={min:1,step:1,max:7},l=epe.daysOfWeekOptions,a=bt(Oue),s=bt(e.tag);return{Message:epe,startConfig:t,cycleConfig:o,lowerConfig:r,upperConfig:i,startDateConfig:n,nums:l,type_:a,tag_:s,change:function(t){a.value=t.type,s.value=t.tag,e.onChange&&e.onChange({type:a.value,tag:s.value})}}}}),[["render",function(e,t,n,o,r,i){const l=hn("Every"),a=hn("Period"),s=hn("Range"),c=hn("Fixed"),u=hn("UnFixed"),d=hn("Last"),p=hn("WeekDay");return sr(),pr(nr,null,[Or(l,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,onChange:e.change},null,8,["time-unit","type","onChange"]),Or(a,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"start-config":e.startConfig,"cycle-config":e.cycleConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","start-config","cycle-config","onChange"]),Or(s,{"time-unit":e.Message.dayOfMonth.title,type:e.type_,tag:e.tag_,nums:e.nums,"lower-config":e.lowerConfig,"upper-config":e.upperConfig,onChange:e.change},null,8,["time-unit","type","tag","nums","lower-config","upper-config","onChange"]),Or(c,{"time-unit":e.Message.dayOfWeek.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","type","tag","nums","onChange"]),Or(u,{type:e.type_,nums:e.nums,onChange:e.change},null,8,["type","nums","onChange"]),Or(d,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,"last-config":e.startDateConfig,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","last-config","onChange"]),Or(p,{"time-unit":e.Message.dayOfWeek.title,"target-time-unit":e.Message.month.title,type:e.type_,tag:e.tag_,nums:e.nums,onChange:e.change},null,8,["time-unit","target-time-unit","type","tag","nums","onChange"])],64)}]]),npe=jue.messages(),ope=Nn({name:"VueCron",components:{AInput:l_,Popover:z$,Card:AE,Seconds:ode,Minutes:ide,Hours:ade,Days:kde,Months:Tde,Years:Bde,WeekDays:tpe,CalendarOutlined:Sj},props:{value:{type:String,default:"* * * * * ? *"}},setup(e,{emit:t}){const n=bt(""),o=bt([]),r=[{key:"seconds",tab:npe.second.title},{key:"minutes",tab:npe.minute.title},{key:"hours",tab:npe.hour.title},{key:"days",tab:npe.dayOfMonth.title},{key:"months",tab:npe.month.title},{key:"weekdays",tab:npe.dayOfWeek.title},{key:"years",tab:npe.year.title}],i=rt({second:Oue,minute:Oue,hour:Oue,dayOfMonth:Oue,month:Oue,dayOfWeek:$ue,year:Tue}),l=bt("seconds");function a(e){const o=e.trim().split(" ");if(!e||e.trim().length<11||6!==o.length&&7!==o.length){const e="* * * * * ?";return n.value=e,s(e),MB.error(npe.common.tagError),t("update:value",e),void t("change",e)}s(e),i.second=o[0],i.minute=o[1],i.hour=o[2],i.dayOfMonth=o[3],i.month=o[4],i.dayOfWeek=o[5],i.year=7===o.length?o[6]:""}function s(e){v1(`/job/cron?cron=${e}`).then((e=>{if(o.value=e,0===o.value.length){const e="* * * * * ?";n.value=e,s(e),t("update:value",e),t("change",e)}}))}return yn((()=>e.value),(e=>{a(e),n.value=e}),{immediate:!0}),{cronStr:n,list:o,tabList:r,activeTabKey:l,tag:i,changeTime:a,timeChange:function(e,n){const o={...i};o[e]=n,"dayOfWeek"===e&&"*"!==n&&"?"!==n?o.dayOfMonth="?":"dayOfMonth"===e&&"*"!==n&&"?"!==n&&(o.dayOfWeek="?");let r=[];r.push(o.second),r.push(o.minute),r.push(o.hour),r.push(o.dayOfMonth),r.push(o.month),r.push(o.dayOfWeek),r.push(o.year),s(r.join(" ").trim()),t("update:value",r.join(" ").trim()),t("change",r.join(" ").trim())}}}}),rpe={key:0},ipe={key:1},lpe={key:2},ape={key:3},spe={key:4},cpe={key:5},upe={key:6},dpe={style:{display:"flex","align-items":"center","justify-content":"space-between"}},ppe=yr("span",{style:{width:"150px","font-weight":"600"}},"CRON 表达式: ",-1),hpe=yr("div",{style:{margin:"20px 0","border-left":"#1677ff 5px solid","font-size":"medium","font-weight":"bold"}},"    近5次的运行时间: ",-1),fpe=A2(ope,[["render",function(e,t,n,o,r,i){const l=hn("AInput"),a=hn("CalendarOutlined"),s=hn("Seconds"),c=hn("Minutes"),u=hn("Hours"),d=hn("Days"),p=hn("Months"),h=hn("WeekDays"),f=hn("Years"),g=hn("a-tab-pane"),m=hn("a-tabs"),v=hn("a-divider"),b=hn("a-input"),y=hn("a-button"),O=hn("Card"),w=hn("Popover");return sr(),hr(w,{placement:"bottom",trigger:"click"},{content:an((()=>[Or(O,{size:"small"},{default:an((()=>[Or(m,{activeKey:e.activeTabKey,"onUpdate:activeKey":t[7]||(t[7]=t=>e.activeTabKey=t),type:"card"},{default:an((()=>[(sr(!0),pr(nr,null,oo(e.tabList,(n=>(sr(),hr(g,{key:n.key},{tab:an((()=>[yr("span",null,[Or(a),Sr(" "+V(n.tab),1)])])),default:an((()=>["seconds"===e.activeTabKey?(sr(),pr("div",rpe,[Or(s,{tag:e.tag.second,onChange:t[0]||(t[0]=t=>e.timeChange("second",t.tag))},null,8,["tag"])])):"minutes"===e.activeTabKey?(sr(),pr("div",ipe,[Or(c,{tag:e.tag.minute,onChange:t[1]||(t[1]=t=>e.timeChange("minute",t.tag))},null,8,["tag"])])):"hours"===e.activeTabKey?(sr(),pr("div",lpe,[Or(u,{tag:e.tag.hour,onChange:t[2]||(t[2]=t=>e.timeChange("hour",t.tag))},null,8,["tag"])])):"days"===e.activeTabKey?(sr(),pr("div",ape,[Or(d,{tag:e.tag.dayOfMonth,onChange:t[3]||(t[3]=t=>e.timeChange("dayOfMonth",t.tag))},null,8,["tag"])])):"months"===e.activeTabKey?(sr(),pr("div",spe,[Or(p,{tag:e.tag.month,onChange:t[4]||(t[4]=t=>e.timeChange("month",t.tag))},null,8,["tag"])])):"weekdays"===e.activeTabKey?(sr(),pr("div",cpe,[Or(h,{tag:e.tag.dayOfWeek,onChange:t[5]||(t[5]=t=>e.timeChange("dayOfWeek",t.tag))},null,8,["tag"])])):"years"===e.activeTabKey?(sr(),pr("div",upe,[Or(f,{tag:e.tag.year,onChange:t[6]||(t[6]=t=>e.timeChange("year",t.tag))},null,8,["tag"])])):xr("",!0)])),_:2},1024)))),128))])),_:1},8,["activeKey"]),Or(v),yr("div",dpe,[ppe,Or(b,{value:e.cronStr,"onUpdate:value":t[8]||(t[8]=t=>e.cronStr=t)},null,8,["value"]),Or(y,{type:"primary",style:{"margin-left":"16px"},onClick:t[9]||(t[9]=t=>e.changeTime(e.cronStr))},{default:an((()=>[Sr("保存")])),_:1})]),Or(v),hpe,(sr(!0),pr(nr,null,oo(e.list,((e,t)=>(sr(),pr("div",{key:e,style:{"margin-top":"10px"}},"第"+V(t+1)+"次: "+V(e),1)))),128))])),_:1})])),default:an((()=>[Or(l,{readonly:"",value:e.value},null,8,["value"])])),_:1})}]]),gpe=Nn({__name:"StartDrawer",props:{open:F1().def(!1),modelValue:V1().def({})},emits:["update:open","save"],setup(e,{emit:t}){const n=t,o=e,r=m1();let i="";const l=bt(!1),a=bt({}),s=bt([]);yn((()=>o.open),(e=>{l.value=e}),{immediate:!0}),yn((()=>o.modelValue),(e=>{a.value=e,i=e.workflowName?e.workflowName:e.groupName?e.groupName:"请选择组"}),{immediate:!0,deep:!0});const c=bt(),u=()=>{var e;null==(e=c.value)||e.validate().then((()=>{d(),n("save",a.value)})).catch((()=>{MB.warning("请检查表单信息")}))},d=()=>{n("update:open",!1),l.value=!1};Zn((()=>{Wt((()=>{p()}))}));const p=()=>{v1("/group/all/group-name/list").then((e=>{s.value=e}))},h=e=>{1===e?a.value.triggerInterval="* * * * * ?":2===e&&(a.value.triggerInterval="60")},f={groupName:[{required:!0,message:"请选择组",trigger:"change"}],triggerType:[{required:!0,message:"请选择触发类型",trigger:"change"}],triggerInterval:[{required:!0,message:"请输入触发间隔",trigger:"change"}],executorTimeout:[{required:!0,message:"请输入执行超时时间",trigger:"change"}],blockStrategy:[{required:!0,message:"请选择阻塞策略",trigger:"change"}],workflowStatus:[{required:!0,message:"请选择工作流状态",trigger:"change"}]};return(e,t)=>{const n=hn("a-input"),o=hn("a-form-item"),p=hn("a-select-option"),g=hn("a-select"),m=hn("a-col"),v=hn("a-input-number"),b=hn("a-form-item-rest"),y=hn("a-row"),O=hn("a-radio"),w=hn("a-radio-group"),S=hn("a-textarea"),x=hn("a-form"),$=hn("a-button"),C=hn("a-drawer");return sr(),hr(C,{open:l.value,"onUpdate:open":t[9]||(t[9]=e=>l.value=e),title:xt(i),"destroy-on-close":"",width:610,onClose:d},{footer:an((()=>[Or($,{type:"primary",onClick:u},{default:an((()=>[Sr("保存")])),_:1}),Or($,{style:{"margin-left":"12px"},onClick:d},{default:an((()=>[Sr("取消")])),_:1})])),default:an((()=>[Or(x,{ref_key:"formRef",ref:c,layout:"vertical",model:a.value,rules:f,"label-align":"left","label-col":{style:{width:"100px"}}},{default:an((()=>[Or(o,{name:"workflowName",label:"工作流名称"},{default:an((()=>[Or(n,{value:a.value.workflowName,"onUpdate:value":t[0]||(t[0]=e=>a.value.workflowName=e),placeholder:"请输入工作流名称"},null,8,["value"])])),_:1}),Or(o,{name:"groupName",label:"组名称"},{default:an((()=>[Or(g,{ref:"select",value:a.value.groupName,"onUpdate:value":t[1]||(t[1]=e=>a.value.groupName=e),placeholder:"请选择组",disabled:0===xt(r).TYPE&&void 0!==xt(r).ID&&null!==xt(r).ID&&""!==xt(r).ID&&"undefined"!==xt(r).ID},{default:an((()=>[(sr(!0),pr(nr,null,oo(s.value,(e=>(sr(),hr(p,{key:e,value:e},{default:an((()=>[Sr(V(e),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value","disabled"])])),_:1}),Or(y,{gutter:24},{default:an((()=>[Or(m,{span:8},{default:an((()=>[Or(o,{name:"triggerType",label:"触发类型"},{default:an((()=>[Or(g,{ref:"select",value:a.value.triggerType,"onUpdate:value":t[2]||(t[2]=e=>a.value.triggerType=e),placeholder:"请选择触发类型",onChange:h},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(i2)),(e=>(sr(),hr(p,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1}),Or(m,{span:16},{default:an((()=>[Or(o,{name:"triggerInterval",label:"触发间隔"},{default:an((()=>[Or(b,null,{default:an((()=>[1===a.value.triggerType?(sr(),hr(xt(fpe),{key:0,value:a.value.triggerInterval,"onUpdate:value":t[3]||(t[3]=e=>a.value.triggerInterval=e)},null,8,["value"])):(sr(),hr(v,{key:1,addonAfter:"秒",style:{width:"-webkit-fill-available"},value:a.value.triggerInterval,"onUpdate:value":t[4]||(t[4]=e=>a.value.triggerInterval=e),placeholder:"请输入触发间隔"},null,8,["value"]))])),_:1})])),_:1})])),_:1})])),_:1}),Or(y,{gutter:24},{default:an((()=>[Or(m,{span:8},{default:an((()=>[Or(o,{name:"executorTimeout",label:"执行超时时间"},{default:an((()=>[Or(v,{addonAfter:"秒",value:a.value.executorTimeout,"onUpdate:value":t[5]||(t[5]=e=>a.value.executorTimeout=e),placeholder:"请输入超时时间"},null,8,["value"])])),_:1})])),_:1}),Or(m,{span:16},{default:an((()=>[Or(o,{name:"blockStrategy",label:"阻塞策略"},{default:an((()=>[Or(w,{value:a.value.blockStrategy,"onUpdate:value":t[6]||(t[6]=e=>a.value.blockStrategy=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(l2)),(e=>(sr(),hr(O,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1})])),_:1})])),_:1}),Or(o,{name:"workflowStatus",label:"节点状态"},{default:an((()=>[Or(w,{value:a.value.workflowStatus,"onUpdate:value":t[7]||(t[7]=e=>a.value.workflowStatus=e)},{default:an((()=>[(sr(!0),pr(nr,null,oo(xt(K2)(xt(s2)),(e=>(sr(),hr(O,{key:e.value,value:e.value},{default:an((()=>[Sr(V(e.name),1)])),_:2},1032,["value"])))),128))])),_:1},8,["value"])])),_:1}),Or(o,{name:"description",label:"描述"},{default:an((()=>[Or(S,{value:a.value.description,"onUpdate:value":t[8]||(t[8]=e=>a.value.description=e),"auto-size":{minRows:5},placeholder:"请输入描述"},null,8,["value"])])),_:1})])),_:1},8,["model"])])),_:1},8,["open","title"])}}}),mpe=Nn({__name:"StartDetail",props:{modelValue:V1().def({}),open:F1().def(!1)},emits:["update:open"],setup(e,{emit:t}){const n=t,o=e,r=bt(!1);yn((()=>o.open),(e=>{r.value=e}),{immediate:!0});const i=()=>{n("update:open",!1)};return(t,n)=>{const o=hn("a-descriptions-item"),l=hn("a-descriptions"),a=hn("a-drawer");return sr(),hr(a,{title:"工作流详情",placement:"right",width:500,open:r.value,"onUpdate:open":n[0]||(n[0]=e=>r.value=e),"destroy-on-close":"",onClose:i},{default:an((()=>[Or(l,{column:1,bordered:"",labelStyle:{width:"120px"}},{default:an((()=>[Or(o,{label:"工作流名称"},{default:an((()=>[Sr(V(e.modelValue.workflowName),1)])),_:1}),Or(o,{label:"组名称"},{default:an((()=>[Sr(V(e.modelValue.groupName),1)])),_:1}),Or(o,{label:"触发类型"},{default:an((()=>[Sr(V(xt(i2)[e.modelValue.triggerType]),1)])),_:1}),Or(o,{label:"触发间隔"},{default:an((()=>[Sr(V(e.modelValue.triggerInterval)+" "+V(2===e.modelValue.triggerType?"秒":null),1)])),_:1}),Or(o,{label:"执行超时时间"},{default:an((()=>[Sr(V(e.modelValue.executorTimeout)+" 秒 ",1)])),_:1}),Or(o,{label:"阻塞策略"},{default:an((()=>[Sr(V(xt(l2)[e.modelValue.blockStrategy]),1)])),_:1}),Or(o,{label:"工作流状态"},{default:an((()=>[Sr(V(xt(s2)[e.modelValue.workflowStatus]),1)])),_:1})])),_:1})])),_:1},8,["open"])}}}),vpe=e=>(rn("data-v-c07f8c3a"),e=e(),ln(),e),bpe={class:"node-wrap"},ype={class:"title",style:{background:"#ffffff"}},Ope={class:"text",style:{color:"#ff943e"}},wpe={key:0,class:"content"},Spe=vpe((()=>yr("span",{class:"content_label"},"组名称: ",-1))),xpe=vpe((()=>yr("span",{class:"content_label"},"阻塞策略: ",-1))),$pe=vpe((()=>yr("div",null,".........",-1))),Cpe={key:1,class:"content"},kpe=[vpe((()=>yr("span",{class:"placeholder"}," 请配置工作流 ",-1)))],Ppe=A2(Nn({__name:"StartNode",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=bt({}),i=bt({});yn((()=>o.modelValue),(e=>{i.value=e}),{immediate:!0,deep:!0}),yn((()=>i.value),(e=>{n("update:modelValue",e)}));const l=m1();yn((()=>i.value.groupName),(e=>{e&&(l.setGroupName(e),v1(`/job/list?groupName=${e}`).then((e=>{l.setJobList(e)})))}),{immediate:!0});const a=bt(!1),s=bt(!1),c=e=>{i.value=e},u=()=>{0===l.TYPE?(r.value=JSON.parse(JSON.stringify(i.value)),a.value=!0):s.value=!0};return(t,n)=>{const o=hn("a-badge"),d=hn("a-typography-text"),p=hn("a-tooltip");return sr(),pr("div",bpe,[yr("div",{class:W([e.disabled?"start-node-disabled":"node-wrap-box-hover","node-wrap-box start-node node-error-success"]),onClick:u},[yr("div",ype,[yr("span",Ope,[Or(o,{status:"processing",color:1===i.value.workflowStatus?"#52c41a":"#ff000d"},null,8,["color"]),Sr(" "+V(i.value.workflowName?i.value.workflowName:"请选择组"),1)])]),i.value.groupName?(sr(),pr("div",wpe,[yr("div",null,[Spe,Or(d,{style:{width:"135px"},ellipsis:"",content:i.value.groupName},null,8,["content"])]),yr("div",null,[xpe,Sr(V(xt(l2)[i.value.blockStrategy]),1)]),$pe])):(sr(),pr("div",Cpe,kpe)),2===xt(l).TYPE?(sr(),hr(p,{key:2},{title:an((()=>[Sr(V(xt(d2)[3].title),1)])),default:an((()=>[Or(xt(o2),{class:"error-tip",color:xt(d2)[3].color,size:"24px",onClick:Li((()=>{}),["stop"]),"model-value":xt(d2)[3].icon},null,8,["color","model-value"])])),_:1})):xr("",!0)],2),Or(U2,{disabled:e.disabled,modelValue:i.value.nodeConfig,"onUpdate:modelValue":n[0]||(n[0]=e=>i.value.nodeConfig=e)},null,8,["disabled","modelValue"]),0!==xt(l).TYPE?(sr(),hr(mpe,{key:0,open:s.value,"onUpdate:open":n[1]||(n[1]=e=>s.value=e),modelValue:i.value,"onUpdate:modelValue":n[2]||(n[2]=e=>i.value=e)},null,8,["open","modelValue"])):xr("",!0),Or(gpe,{open:a.value,"onUpdate:open":n[3]||(n[3]=e=>a.value=e),modelValue:r.value,"onUpdate:modelValue":n[4]||(n[4]=e=>r.value=e),onSave:c},null,8,["open","modelValue"])])}}}),[["__scopeId","data-v-c07f8c3a"]]),Tpe={class:"workflow-design"},Mpe={class:"box-scale"},Ipe=yr("div",{class:"end-node"},[yr("div",{class:"end-node-circle"}),yr("div",{class:"end-node-text"},"流程结束")],-1),Epe=Nn({__name:"WorkFlow",props:{modelValue:V1().def({}),disabled:F1().def(!1)},emits:["update:modelValue"],setup(e,{emit:t}){const n=t,o=e,r=bt({});return yn((()=>o.modelValue),(e=>{r.value=e}),{immediate:!0,deep:!0}),yn((()=>r.value),(e=>{n("update:modelValue",e)})),(t,n)=>(sr(),pr("div",Tpe,[yr("div",Mpe,[Or(Ppe,{modelValue:r.value,"onUpdate:modelValue":n[0]||(n[0]=e=>r.value=e),disabled:e.disabled},null,8,["modelValue","disabled"]),r.value.nodeConfig?(sr(),hr(yue,{key:0,modelValue:r.value.nodeConfig,"onUpdate:modelValue":n[1]||(n[1]=e=>r.value.nodeConfig=e),disabled:e.disabled},null,8,["modelValue","disabled"])):xr("",!0),Ipe])]))}}),Ape={style:{width:"calc(100vw - 16px)",height:"calc(100vh - 48px)"}},Dpe={class:"header"},Rpe={key:0,class:"buttons"},zpe={style:{overflow:"auto",width:"100vw",height:"calc(100vh - 48px)"}},Bpe=A2(Nn({__name:"App",setup(e){const t=e=>{const t={},n=window.location.href.split("?")[1];return n&&n.split("&").forEach((e=>{const n=e.split("=")[1],o=e.split("=")[0];t[o]=n})),t[e]},n=m1(),o=bt(100);let r=t("id");const i=localStorage.getItem("Access-Token"),l=localStorage.getItem("app_namespace"),a="xkjIc2ZHZ0"===t("x1c2Hdd6"),s="kaxC8Iml"===t("x1c2Hdd6")||a,c="wA4wN1nZ"===t("x1c2Hdd6");Zn((()=>{if(n.clear(),!["D7Rzd7Oe","kaxC8Iml","xkjIc2ZHZ0","wA4wN1nZ"].includes(t("x1c2Hdd6")))return u.value=!0,void MB.error({content:"未知错误,请联系管理员",duration:0});n.setToken(i),n.setNameSpaceId(l),n.setType(s?a?2:1:0),d.value=s,r&&"undefined"!==r&&(n.setId(c?"":r),a?m():g())}));const u=bt(!1),d=bt(!1),p=bt({workflowStatus:1,blockStrategy:1,description:void 0,executorTimeout:60}),h=()=>{"undefined"===r||c?(p.value.id=void 0,v1("/workflow","post",p.value).then((()=>{window.parent.postMessage({code:"SV5ucvLBhvFkOftb",data:JSON.stringify(p.value)})}))):v1("/workflow","put",p.value).then((()=>{window.parent.postMessage({code:"8Rr3XPtVVAHfduQg",data:JSON.stringify(p.value)})}))},f=()=>{window.parent.postMessage({code:"kb4DO9h6WIiqFhbp"})},g=()=>{u.value=!0,v1(`/workflow/${r}`).then((e=>{p.value=e})).finally((()=>{u.value=!1}))},m=()=>{u.value=!0,v1(`/workflow/batch/${r}`).then((e=>{p.value=e})).finally((()=>{u.value=!1}))},v=e=>{o.value+=10*e,o.value<=10?o.value=10:o.value>=300&&(o.value=300)};return(e,t)=>{const n=hn("a-button"),r=hn("a-tooltip"),i=hn("a-affix"),l=hn("a-spin");return sr(),pr("div",Ape,[Or(i,{"offset-top":0},{default:an((()=>[yr("div",Dpe,[yr("div",null,[Or(r,{title:"缩小"},{default:an((()=>[Or(n,{type:"primary",icon:Wr(xt(MJ)),onClick:t[0]||(t[0]=e=>v(-1))},null,8,["icon"])])),_:1}),Sr(" "+V(o.value)+"% ",1),Or(r,{title:"放大"},{default:an((()=>[Or(n,{type:"primary",icon:Wr(xt(zI)),onClick:t[1]||(t[1]=e=>v(1))},null,8,["icon"])])),_:1})]),d.value?xr("",!0):(sr(),pr("div",Rpe,[Or(n,{type:"primary",siz:"large",onClick:h},{default:an((()=>[Sr("保存")])),_:1}),Or(n,{siz:"large",style:{"margin-left":"16px"},onClick:f},{default:an((()=>[Sr("取消")])),_:1})]))])])),_:1}),yr("div",zpe,[Or(l,{spinning:u.value},{default:an((()=>[Or(xt(Epe),{class:"work-flow",modelValue:p.value,"onUpdate:modelValue":t[2]||(t[2]=e=>p.value=e),disabled:d.value,style:_([{"transform-origin":"0 0"},`transform: scale(${o.value/100})`])},null,8,["modelValue","disabled","style"])])),_:1},8,["spinning"])])])}}}),[["__scopeId","data-v-f015920a"]]);function jpe(e,t){var n;return e="object"==typeof(n=e)&&null!==n?e:Object.create(null),new Proxy(e,{get:(e,n,o)=>"key"===n?Reflect.get(e,n,o):Reflect.get(e,n,o)||Reflect.get(t,n,o)})}function Npe(e,{storage:t,serializer:n,key:o,debug:r}){try{const r=null==t?void 0:t.getItem(o);r&&e.$patch(null==n?void 0:n.deserialize(r))}catch(i){}}function _pe(e,{storage:t,serializer:n,key:o,paths:r,debug:i}){try{const i=Array.isArray(r)?function(e,t){return t.reduce(((t,n)=>{const o=n.split(".");return function(e,t,n){return t.slice(0,-1).reduce(((e,t)=>/^(__proto__)$/.test(t)?{}:e[t]=e[t]||{}),e)[t[t.length-1]]=n,e}(t,o,function(e,t){return t.reduce(((e,t)=>null==e?void 0:e[t]),e)}(e,o))}),{})}(e,r):e;t.setItem(o,n.serialize(i))}catch(l){}}var Qpe=function(e={}){return t=>{const{auto:n=!1}=e,{options:{persist:o=n},store:r,pinia:i}=t;if(!o)return;if(!(r.$id in i.state.value)){const e=i._s.get(r.$id.replace("__hot:",""));return void(e&&Promise.resolve().then((()=>e.$persist())))}const l=(Array.isArray(o)?o.map((t=>jpe(t,e))):[jpe(o,e)]).map((({storage:t=localStorage,beforeRestore:n=null,afterRestore:o=null,serializer:i={serialize:JSON.stringify,deserialize:JSON.parse},key:l=r.$id,paths:a=null,debug:s=!1})=>{var c;return{storage:t,beforeRestore:n,afterRestore:o,serializer:i,key:(null!=(c=e.key)?c:e=>e)("string"==typeof l?l:l(r.$id)),paths:a,debug:s}}));r.$persist=()=>{l.forEach((e=>{_pe(r.$state,e)}))},r.$hydrate=({runHooks:e=!0}={})=>{l.forEach((n=>{const{beforeRestore:o,afterRestore:i}=n;e&&(null==o||o(t)),Npe(r,n),e&&(null==i||i(t))}))},l.forEach((e=>{const{beforeRestore:n,afterRestore:o}=e;null==n||n(t),Npe(r,e),null==o||o(t),r.$subscribe(((t,n)=>{_pe(n,e)}),{detached:!0})}))}}();const Lpe=function(){const e=q(!0),t=e.run((()=>bt({})));let n=[],o=[];const r=pt({install(e){Zi(r),r._a=e,e.provide(Ui,r),e.config.globalProperties.$pinia=r,o.forEach((e=>n.push(e))),o=[]},use(e){return this._a?n.push(e):o.push(e),this},_p:n,_a:null,_e:e,_s:new Map,state:t});return r}();Lpe.use(Qpe);const Hpe=Yi(Bpe);Hpe.use(g1),Hpe.use(Lpe),Hpe.mount("#app")}},function(){return t||(0,e[n(e)[0]])((t={exports:{}}).exports,t),t.exports});export default o(); diff --git a/frontend/public/lib/assets/RrmFkNrR.css b/frontend/public/lib/assets/psiNPyrX.css similarity index 85% rename from frontend/public/lib/assets/RrmFkNrR.css rename to frontend/public/lib/assets/psiNPyrX.css index 678476049..7fa0acfb0 100644 --- a/frontend/public/lib/assets/RrmFkNrR.css +++ b/frontend/public/lib/assets/psiNPyrX.css @@ -1 +1 @@ -.log[data-v-f05e08cc]{height:80vh;color:#abb2bf;background-color:#282c34;position:relative!important;box-sizing:border-box;display:flex!important;flex-direction:column}.log .scroller[data-v-f05e08cc]{height:100%;overflow:auto;display:flex!important;align-items:flex-start!important;font-family:monospace;line-height:1.4;position:relative;z-index:0}.log .scroller .gutters[data-v-f05e08cc]{min-height:108px;position:sticky;background-color:#1e1f22;color:#7d8799;border:none;flex-shrink:0;display:flex;flex-direction:column;height:100%;box-sizing:border-box;inset-inline-start:0;z-index:200}.log .scroller .gutters .gutter-element[data-v-f05e08cc]{height:25px;font-size:14px;padding:0 8px 0 5px;min-width:20px;text-align:right;white-space:nowrap;box-sizing:border-box;color:#7d8799;display:flex;align-items:center;justify-content:flex-end}.log .scroller .content[data-v-f05e08cc]{-moz-tab-size:4;tab-size:4;caret-color:transparent!important;margin:0;flex-grow:2;flex-shrink:0;white-space:pre;word-wrap:normal;box-sizing:border-box;min-height:100%;padding:4px 8px;outline:none;color:#bcbec4}.log .scroller .content .line[data-v-f05e08cc]{height:25px;caret-color:transparent!important;font-size:16px;display:contents;padding:0 2px 0 6px}.log .scroller .content .line .text[data-v-f05e08cc]{font-size:16px;height:25px}.empty[data-v-25815c16]{display:flex;justify-content:center;align-items:center;height:calc(100% - 88px)}.icon[data-v-74f467a1]{margin:0;padding:0;display:flex;flex-wrap:wrap}.icon .anticon[data-v-74f467a1]{font-size:22px;justify-content:center;align-items:center}.icon p[data-v-74f467a1]{margin-bottom:0}.popover[data-v-b84a7ebc]{display:flex;align-items:center;justify-content:space-around}.popover .popover-item[data-v-b84a7ebc]{height:42px;display:flex;font-size:13px;align-items:center;justify-content:center;flex-direction:column;text-align:center}.popover .popover-item span[data-v-b84a7ebc]{margin-inline-start:0}.popover .popover-item .anticon[data-v-b84a7ebc]{font-size:22px;justify-content:center;align-items:center}.drawer-title[data-v-6ec5cf8c]{display:flex;align-items:center;justify-content:space-between}.cm-scroller::-webkit-scrollbar{width:8px;height:8px}.cm-scroller::-webkit-scrollbar-thumb{background:#9c9c9c9c;-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,.3)}.cm-scroller::-webkit-scrollbar-track{background:#282c34}.th[data-v-dc9046db],.th[data-v-affb0f89]{padding:16px 24px;color:#000000e0;font-weight:400;font-size:14px;line-height:1.57142857;text-align:start;box-sizing:border-box;background-color:#00000005;border-inline-end:1px solid rgba(5,5,5,.06)}.auto-judge[data-v-affb0f89]{white-space:pre}.top-tips[data-v-affb0f89]{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;color:#646a73}.or-branch-link-tip[data-v-affb0f89]{margin:10px 0;color:#646a73}.condition-group-editor[data-v-affb0f89]{-webkit-user-select:none;user-select:none;border-radius:4px;border:1px solid #e4e5e7;position:relative;margin-bottom:16px}.condition-group-editor .branch-delete-icon[data-v-affb0f89]{font-size:18px}.condition-group-editor .header[data-v-affb0f89]{background-color:#f4f6f8;padding:0 12px;font-size:14px;color:#171e31;height:36px;display:flex;align-items:center}.condition-group-editor .header span[data-v-affb0f89]{flex:1}.condition-group-editor .main-content[data-v-affb0f89]{padding:0 12px}.condition-group-editor .main-content .condition-relation[data-v-affb0f89]{color:#9ca2a9;align-items:center;height:36px;display:flex;justify-content:space-between;padding:0 2px}.condition-group-editor .main-content .condition-content-box[data-v-affb0f89]{display:flex;justify-content:space-between;align-items:center}.condition-group-editor .main-content .condition-content-box div[data-v-affb0f89]{width:100%;min-width:120px}.condition-group-editor .main-content .condition-content-box div[data-v-affb0f89]:not(:first-child){margin-left:16px}.condition-group-editor .main-content .cell-box div[data-v-affb0f89]{padding:16px 0;width:100%;min-width:120px;color:#909399;font-size:14px;font-weight:600;text-align:center}.condition-group-editor .main-content .condition-content[data-v-affb0f89]{display:flex;flex-direction:column}.condition-group-editor .main-content .condition-content[data-v-affb0f89] .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.condition-group-editor .main-content .condition-content .content[data-v-affb0f89]{flex:1;padding:0 0 4px;display:flex;align-items:center;min-height:31.6px;flex-wrap:wrap}.condition-group-editor .sub-content[data-v-affb0f89]{padding:12px}.node-disabled[data-v-affb0f89]{color:#8f959e}.node-disabled .content[data-v-affb0f89]{white-space:normal;word-break:break-word}.node-disabled .title .node-title[data-v-affb0f89]{color:#8f959e!important}.node-disabled[data-v-affb0f89]:hover{cursor:default}.popover[data-v-2d8dbc99]{display:flex;align-items:center;justify-content:space-around}.popover .popover-item[data-v-2d8dbc99]{height:42px;display:flex;font-size:13px;align-items:center;justify-content:center;flex-direction:column;text-align:center}.popover .popover-item span[data-v-2d8dbc99]{margin-inline-start:0}.popover .popover-item .anticon[data-v-2d8dbc99]{font-size:22px;justify-content:center;align-items:center}.cron-body-row{margin-bottom:8px}.cron-body-row .symbol{color:#1677ff;margin-right:6px}.content[data-v-730a9c91]{line-height:136%}.workflow-design{width:100%}.workflow-design .box-scale{display:inline-block;position:relative;width:100%;align-items:flex-start;justify-content:center;flex-wrap:wrap;min-width:min-content}.content_label{font-weight:700}.workflow-design .node-wrap{display:inline-flex;width:100%;flex-flow:column wrap;justify-content:flex-start;align-items:center;padding:0;position:relative;z-index:1}.workflow-design .node-wrap-box{display:inline-flex;flex-direction:column;position:relative;width:220px;min-height:72px;flex-shrink:0;background:#fff;border-radius:4px;cursor:pointer;box-shadow:0 2px 5px #0000001a}.workflow-design .node-wrap-box:before{content:"";position:absolute;top:-12px;left:50%;transform:translate(-50%);width:0px;border-style:solid;border-width:8px 6px 4px;border-color:#cacaca transparent transparent}.workflow-design .start-node-disabled{border:1px solid #00000036;box-shadow:0 2px 5px #00000036}.workflow-design .node-wrap-box.start-node:before{content:none}.workflow-design .node-wrap-box .title{height:24px;line-height:24px;margin-top:8px;padding-left:16px;padding-right:30px;border-radius:4px 4px 0 0;position:relative;display:flex;align-items:center}.workflow-design .node-wrap-box .title .text{padding-left:5px;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .node-wrap-box .title .icon{margin-right:5px}.workflow-design .node-wrap-box .title .close{font-size:15px;position:absolute;top:50%;transform:translateY(-50%);right:10px;display:none}.workflow-design .node-wrap-box .content{position:relative;padding:13px 15px 15px}.workflow-design .node-wrap-box .content .placeholder{color:#999}.workflow-design .node-wrap-box-hover:hover .close{display:block}.workflow-design .add-node-btn-box{width:240px;display:inline-flex;flex-shrink:0;position:relative;z-index:1}.workflow-design .add-node-btn-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .add-node-btn{-webkit-user-select:none;user-select:none;width:240px;padding:32px 0;display:flex;justify-content:center;flex-shrink:0;flex-grow:1}.workflow-design .add-branch{justify-content:center;padding:0 10px;position:absolute;top:-16px;left:50%;transform:translate(-50%);transform-origin:center center;z-index:1;display:inline-flex;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:500;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;border-radius:20px;padding:8px 15px!important;color:#67c23a;background-color:#f0f9eb;border:1px solid #dcdfe6;border-color:#b3e19d}.workflow-design .add-branch:hover{color:#fff;border-color:#b3e19d;background-color:#67c23a}.workflow-design .branch-wrap{display:inline-flex;width:100%}.workflow-design .branch-box-wrap{display:flex;flex-flow:column wrap;align-items:center;min-height:270px;width:100%;flex-shrink:0}.workflow-design .col-box{display:inline-flex;flex-direction:column;align-items:center;position:relative}.workflow-design .branch-box{display:flex;overflow:visible;min-height:180px;height:auto;border-bottom:2px solid #ccc;border-top:2px solid #ccc;position:relative}.workflow-design .branch-box .col-box{background-color:#f0f2f5}.workflow-design .branch-box .col-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:0;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .condition-node{display:inline-flex;flex-direction:column;min-height:280px}.workflow-design .condition-node-box{padding-top:30px;padding-right:50px;padding-left:50px;justify-content:center;align-items:center;flex-grow:1;position:relative;display:inline-flex;flex-direction:column}.workflow-design .condition-node-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .auto-judge{position:relative;width:220px;min-height:72px;background:#fff;border-radius:4px;padding:15px;cursor:pointer;box-shadow:0 2px 5px #0000001a}.workflow-design .auto-judge:before{content:"";position:absolute;top:-12px;left:50%;transform:translate(-50%);width:0px;border-style:solid;border-width:8px 6px 4px;border-color:#cacaca transparent transparent;background:#efefef}.workflow-design .auto-judge .title{line-height:16px}.workflow-design .auto-judge .title .text{width:139px;display:block;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .auto-judge .title .node-title{width:130px;color:#15bc83;display:block;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .auto-judge .title .close{font-size:15px;position:absolute;top:15px;right:15px;color:#999;display:none}.workflow-design .auto-judge .title .priority-title{position:absolute;top:15px;right:15px;color:#999}.workflow-design .auto-judge .content{line-height:136%;position:relative;padding-top:15px;min-height:59px}.workflow-design .auto-judge .content .placeholder{color:#999}.workflow-design .auto-judge-hover:hover .close{display:block}.workflow-design .auto-judge-hover:hover .priority-title{display:none}.workflow-design .top-left-cover-line,.workflow-design .top-right-cover-line{position:absolute;height:3px;width:50%;background-color:#f0f2f5;top:-2px}.workflow-design .bottom-left-cover-line,.workflow-design .bottom-right-cover-line{position:absolute;height:3px;width:50%;background-color:#f0f2f5;bottom:-2px}.workflow-design .top-left-cover-line{left:-1px}.workflow-design .top-right-cover-line{right:-1px}.workflow-design .bottom-left-cover-line{left:-1px}.workflow-design .bottom-right-cover-line{right:-1px}.workflow-design .end-node{border-radius:50%;font-size:14px;color:#191f2566;text-align:left}.workflow-design .end-node-circle{width:10px;height:10px;margin:auto;border-radius:50%;background:#ccc}.workflow-design .end-node-text{margin-top:5px;text-align:center}.workflow-design .auto-judge-hover:hover .sort-left,.workflow-design .auto-judge-hover:hover .sort-right{display:flex}.workflow-design .auto-judge .sort-left{position:absolute;top:0;bottom:0;z-index:1;left:0;display:none;justify-content:center;align-items:center;flex-direction:column}.workflow-design .auto-judge .sort-right{position:absolute;top:0;bottom:0;z-index:1;right:0;display:none;justify-content:center;align-items:center;flex-direction:column}.workflow-design .auto-judge .sort-left:hover,.workflow-design .auto-judge .sort-right:hover{background:#eee}.workflow-design .auto-judge:after{pointer-events:none;content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;border-radius:4px;transition:all .1s}.workflow-design .auto-judge-def:hover:after{border:1px solid #3296fa;box-shadow:0 0 6px #3296fa4d}.workflow-design .node-wrap-box:after{pointer-events:none;content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;border-radius:4px;transition:all .1s}.workflow-design .node-wrap-box-hover:hover:after{border:1px solid #3296fa;box-shadow:0 0 6px #3296fa4d}.workflow-design .node-error-skip:after,.workflow-design .node-error-default:after{border:1px solid #00000036;box-shadow:0 0 10px #00000069}.workflow-design .node-error-waiting:after{border:1px solid #64a6ea;box-shadow:0 0 6px #64a6ea}.workflow-design .node-error-running:after{border:1px solid #1b7ee5;box-shadow:0 0 6px #1b7ee5}.workflow-design .node-error-success:after{border:1px solid #087da1;box-shadow:0 0 6px #087da1}.workflow-design .node-error-fail:after{border:1px solid #f52d80;box-shadow:0 0 6px #f52d80}.workflow-design .node-error-stop:after{border:1px solid #ac2df5;box-shadow:0 0 6px #ac2df5}.workflow-design .node-error-cancel:after{border:1px solid #f5732d;box-shadow:0 0 6px #f5732d}.workflow-design .error-tip{cursor:default;position:absolute;top:0;right:0;transform:translate(150%);font-size:24px}.tags-list{margin-top:15px;width:100%}.add-node-popover-body li{display:inline-block;width:80px;text-align:center;padding:10px 0}.add-node-popover-body li i{border:1px solid var(--el-border-color-light);width:40px;height:40px;border-radius:50%;text-align:center;line-height:38px;font-size:18px;cursor:pointer}.add-node-popover-body li i:hover{border:1px solid #3296fa;background:#3296fa;color:#fff!important}.add-node-popover-body li p{font-size:12px;margin-top:5px}.node-wrap-drawer__title{padding-right:40px}.node-wrap-drawer__title label{cursor:pointer}.node-wrap-drawer__title label:hover{border-bottom:1px dashed #409eff}.node-wrap-drawer__title .node-wrap-drawer__title-edit{color:#409eff;margin-left:10px;vertical-align:middle}.dark .workflow-design .node-wrap-box,.dark .workflow-design .auto-judge{background:#2b2b2b}.dark .workflow-design .col-box{background:var(--el-bg-color)}.dark .workflow-design .top-left-cover-line,.dark .workflow-design .top-right-cover-line,.dark .workflow-design .bottom-left-cover-line,.dark .workflow-design .bottom-right-cover-line{background-color:var(--el-bg-color)}.dark .workflow-design .node-wrap-box:before,.dark .workflow-design .auto-judge:before{background-color:var(--el-bg-color)}.dark .workflow-design .branch-box .add-branch{background:var(--el-bg-color)}.dark .workflow-design .end-node .end-node-text{color:#ccc}.dark .workflow-design .auto-judge .sort-left:hover,.dark .workflow-design .auto-judge .sort-right:hover{background:var(--el-bg-color)}.header[data-v-940979b4]{display:flex;justify-content:space-between;align-items:center;width:100vw;box-shadow:0 1px 4px #00152914;background-color:#fff;box-sizing:border-box;padding:8px 16px}body{background-color:#f0f2f5}body .work-flow{margin-top:16px}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6} +.log[data-v-22637821]{height:80vh;color:#abb2bf;background-color:#282c34;position:relative!important;box-sizing:border-box;display:flex!important;flex-direction:column}.log .scroller[data-v-22637821]{height:100%;overflow:auto;display:flex!important;align-items:flex-start!important;font-family:monospace;line-height:1.4;position:relative;z-index:0}.log .scroller .gutters[data-v-22637821]{min-height:108px;position:sticky;background-color:#1e1f22;color:#7d8799;border:none;flex-shrink:0;display:flex;flex-direction:column;height:100%;box-sizing:border-box;inset-inline-start:0;z-index:200}.log .scroller .gutters .gutter-element[data-v-22637821]{height:25px;font-size:14px;padding:0 8px 0 5px;min-width:20px;text-align:right;white-space:nowrap;box-sizing:border-box;color:#7d8799;display:flex;align-items:center;justify-content:flex-end}.log .scroller .content[data-v-22637821]{-moz-tab-size:4;tab-size:4;caret-color:transparent!important;margin:0;flex-grow:2;flex-shrink:0;white-space:pre;word-wrap:normal;box-sizing:border-box;min-height:100%;padding:4px 8px;outline:none;color:#bcbec4}.log .scroller .content .line[data-v-22637821]{height:25px;caret-color:transparent!important;font-size:16px;display:contents;padding:0 2px 0 6px}.log .scroller .content .line .text[data-v-22637821]{font-size:16px;height:25px}.empty[data-v-b13db394]{display:flex;justify-content:center;align-items:center;height:calc(100% - 88px)}.icon[data-v-74f467a1]{margin:0;padding:0;display:flex;flex-wrap:wrap}.icon .anticon[data-v-74f467a1]{font-size:22px;justify-content:center;align-items:center}.icon p[data-v-74f467a1]{margin-bottom:0}.popover[data-v-b84a7ebc]{display:flex;align-items:center;justify-content:space-around}.popover .popover-item[data-v-b84a7ebc]{height:42px;display:flex;font-size:13px;align-items:center;justify-content:center;flex-direction:column;text-align:center}.popover .popover-item span[data-v-b84a7ebc]{margin-inline-start:0}.popover .popover-item .anticon[data-v-b84a7ebc]{font-size:22px;justify-content:center;align-items:center}.drawer-title[data-v-5d000a58]{display:flex;align-items:center;justify-content:space-between}.cm-scroller::-webkit-scrollbar{width:8px;height:8px}.cm-scroller::-webkit-scrollbar-thumb{background:#9c9c9c9c;-webkit-box-shadow:inset 0 0 3px rgba(0,0,0,.3)}.cm-scroller::-webkit-scrollbar-track{background:#282c34}.th[data-v-15066d64],.th[data-v-3f41e4f2]{padding:16px 24px;color:#000000e0;font-weight:400;font-size:14px;line-height:1.57142857;text-align:start;box-sizing:border-box;background-color:#00000005;border-inline-end:1px solid rgba(5,5,5,.06)}.auto-judge[data-v-3f41e4f2]{white-space:pre}.top-tips[data-v-3f41e4f2]{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px;color:#646a73}.or-branch-link-tip[data-v-3f41e4f2]{margin:10px 0;color:#646a73}.condition-group-editor[data-v-3f41e4f2]{-webkit-user-select:none;user-select:none;border-radius:4px;border:1px solid #e4e5e7;position:relative;margin-bottom:16px}.condition-group-editor .branch-delete-icon[data-v-3f41e4f2]{font-size:18px}.condition-group-editor .header[data-v-3f41e4f2]{background-color:#f4f6f8;padding:0 12px;font-size:14px;color:#171e31;height:36px;display:flex;align-items:center}.condition-group-editor .header span[data-v-3f41e4f2]{flex:1}.condition-group-editor .main-content[data-v-3f41e4f2]{padding:0 12px}.condition-group-editor .main-content .condition-relation[data-v-3f41e4f2]{color:#9ca2a9;align-items:center;height:36px;display:flex;justify-content:space-between;padding:0 2px}.condition-group-editor .main-content .condition-content-box[data-v-3f41e4f2]{display:flex;justify-content:space-between;align-items:center}.condition-group-editor .main-content .condition-content-box div[data-v-3f41e4f2]{width:100%;min-width:120px}.condition-group-editor .main-content .condition-content-box div[data-v-3f41e4f2]:not(:first-child){margin-left:16px}.condition-group-editor .main-content .cell-box div[data-v-3f41e4f2]{padding:16px 0;width:100%;min-width:120px;color:#909399;font-size:14px;font-weight:600;text-align:center}.condition-group-editor .main-content .condition-content[data-v-3f41e4f2]{display:flex;flex-direction:column}.condition-group-editor .main-content .condition-content[data-v-3f41e4f2] .el-input__wrapper{border-top-left-radius:0;border-bottom-left-radius:0}.condition-group-editor .main-content .condition-content .content[data-v-3f41e4f2]{flex:1;padding:0 0 4px;display:flex;align-items:center;min-height:31.6px;flex-wrap:wrap}.condition-group-editor .sub-content[data-v-3f41e4f2]{padding:12px}.node-disabled[data-v-3f41e4f2]{color:#8f959e}.node-disabled .content[data-v-3f41e4f2]{white-space:normal;word-break:break-word}.node-disabled .title .node-title[data-v-3f41e4f2]{color:#8f959e!important}.node-disabled[data-v-3f41e4f2]:hover{cursor:default}.popover[data-v-714c9e92]{display:flex;align-items:center;justify-content:space-around}.popover .popover-item[data-v-714c9e92]{height:42px;display:flex;font-size:13px;align-items:center;justify-content:center;flex-direction:column;text-align:center}.popover .popover-item span[data-v-714c9e92]{margin-inline-start:0}.popover .popover-item .anticon[data-v-714c9e92]{font-size:22px;justify-content:center;align-items:center}.cron-body-row{margin-bottom:8px}.cron-body-row .symbol{color:#1677ff;margin-right:6px}.content[data-v-c07f8c3a]{line-height:136%}.workflow-design{width:100%}.workflow-design .box-scale{display:inline-block;position:relative;width:100%;align-items:flex-start;justify-content:center;flex-wrap:wrap;min-width:min-content}.content_label{font-weight:700}.workflow-design .node-wrap{display:inline-flex;width:100%;flex-flow:column wrap;justify-content:flex-start;align-items:center;padding:0;position:relative;z-index:1}.workflow-design .node-wrap-box{display:inline-flex;flex-direction:column;position:relative;width:220px;min-height:72px;flex-shrink:0;background:#fff;border-radius:4px;cursor:pointer;box-shadow:0 2px 5px #0000001a}.workflow-design .node-wrap-box:before{content:"";position:absolute;top:-12px;left:50%;transform:translate(-50%);width:0px;border-style:solid;border-width:8px 6px 4px;border-color:#cacaca transparent transparent}.workflow-design .start-node-disabled{border:1px solid #00000036;box-shadow:0 2px 5px #00000036}.workflow-design .node-wrap-box.start-node:before{content:none}.workflow-design .node-wrap-box .title{height:24px;line-height:24px;margin-top:8px;padding-left:16px;padding-right:30px;border-radius:4px 4px 0 0;position:relative;display:flex;align-items:center}.workflow-design .node-wrap-box .title .text{padding-left:5px;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .node-wrap-box .title .icon{margin-right:5px}.workflow-design .node-wrap-box .title .close{font-size:15px;position:absolute;top:50%;transform:translateY(-50%);right:10px;display:none}.workflow-design .node-wrap-box .content{position:relative;padding:13px 15px 15px}.workflow-design .node-wrap-box .content .placeholder{color:#999}.workflow-design .node-wrap-box-hover:hover .close{display:block}.workflow-design .add-node-btn-box{width:240px;display:inline-flex;flex-shrink:0;position:relative;z-index:1}.workflow-design .add-node-btn-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:-1;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .add-node-btn{-webkit-user-select:none;user-select:none;width:240px;padding:32px 0;display:flex;justify-content:center;flex-shrink:0;flex-grow:1}.workflow-design .add-branch{justify-content:center;padding:0 10px;position:absolute;top:-16px;left:50%;transform:translate(-50%);transform-origin:center center;z-index:1;display:inline-flex;align-items:center;line-height:1;height:32px;white-space:nowrap;cursor:pointer;text-align:center;box-sizing:border-box;outline:0;transition:.1s;font-weight:500;font-size:14px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;vertical-align:middle;border-radius:20px;padding:8px 15px!important;color:#67c23a;background-color:#f0f9eb;border:1px solid #dcdfe6;border-color:#b3e19d}.workflow-design .add-branch:hover{color:#fff;border-color:#b3e19d;background-color:#67c23a}.workflow-design .branch-wrap{display:inline-flex;width:100%}.workflow-design .branch-box-wrap{display:flex;flex-flow:column wrap;align-items:center;min-height:270px;width:100%;flex-shrink:0}.workflow-design .col-box{display:inline-flex;flex-direction:column;align-items:center;position:relative}.workflow-design .branch-box{display:flex;overflow:visible;min-height:180px;height:auto;border-bottom:2px solid #ccc;border-top:2px solid #ccc;position:relative}.workflow-design .branch-box .col-box{background-color:#f0f2f5}.workflow-design .branch-box .col-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;z-index:0;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .condition-node{display:inline-flex;flex-direction:column;min-height:280px}.workflow-design .condition-node-box{padding-top:30px;padding-right:50px;padding-left:50px;justify-content:center;align-items:center;flex-grow:1;position:relative;display:inline-flex;flex-direction:column}.workflow-design .condition-node-box:before{content:"";position:absolute;top:0;left:0;right:0;bottom:0;margin:auto;width:2px;height:100%;background-color:#cacaca}.workflow-design .auto-judge{position:relative;width:220px;min-height:72px;background:#fff;border-radius:4px;padding:15px;cursor:pointer;box-shadow:0 2px 5px #0000001a}.workflow-design .auto-judge:before{content:"";position:absolute;top:-12px;left:50%;transform:translate(-50%);width:0px;border-style:solid;border-width:8px 6px 4px;border-color:#cacaca transparent transparent;background:#efefef}.workflow-design .auto-judge .title{line-height:16px}.workflow-design .auto-judge .title .text{width:139px;display:block;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .auto-judge .title .node-title{width:130px;color:#15bc83;display:block;text-overflow:ellipsis;overflow:hidden;word-break:break-all;white-space:nowrap}.workflow-design .auto-judge .title .close{font-size:15px;position:absolute;top:15px;right:15px;color:#999;display:none}.workflow-design .auto-judge .title .priority-title{position:absolute;top:15px;right:15px;color:#999}.workflow-design .auto-judge .content{line-height:136%;position:relative;padding-top:15px;min-height:59px}.workflow-design .auto-judge .content .placeholder{color:#999}.workflow-design .auto-judge-hover:hover .close{display:block}.workflow-design .auto-judge-hover:hover .priority-title{display:none}.workflow-design .top-left-cover-line,.workflow-design .top-right-cover-line{position:absolute;height:3px;width:50%;background-color:#f0f2f5;top:-2px}.workflow-design .bottom-left-cover-line,.workflow-design .bottom-right-cover-line{position:absolute;height:3px;width:50%;background-color:#f0f2f5;bottom:-2px}.workflow-design .top-left-cover-line{left:-1px}.workflow-design .top-right-cover-line{right:-1px}.workflow-design .bottom-left-cover-line{left:-1px}.workflow-design .bottom-right-cover-line{right:-1px}.workflow-design .end-node{border-radius:50%;font-size:14px;color:#191f2566;text-align:left}.workflow-design .end-node-circle{width:10px;height:10px;margin:auto;border-radius:50%;background:#ccc}.workflow-design .end-node-text{margin-top:5px;text-align:center}.workflow-design .auto-judge-hover:hover .sort-left,.workflow-design .auto-judge-hover:hover .sort-right{display:flex}.workflow-design .auto-judge .sort-left{position:absolute;top:0;bottom:0;z-index:1;left:0;display:none;justify-content:center;align-items:center;flex-direction:column}.workflow-design .auto-judge .sort-right{position:absolute;top:0;bottom:0;z-index:1;right:0;display:none;justify-content:center;align-items:center;flex-direction:column}.workflow-design .auto-judge .sort-left:hover,.workflow-design .auto-judge .sort-right:hover{background:#eee}.workflow-design .auto-judge:after{pointer-events:none;content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;border-radius:4px;transition:all .1s}.workflow-design .auto-judge-def:hover:after{border:1px solid #3296fa;box-shadow:0 0 6px #3296fa4d}.workflow-design .node-wrap-box:after{pointer-events:none;content:"";position:absolute;top:0;bottom:0;left:0;right:0;z-index:2;border-radius:4px;transition:all .1s}.workflow-design .node-wrap-box-hover:hover:after{border:1px solid #3296fa;box-shadow:0 0 6px #3296fa4d}.workflow-design .node-error-skip:after,.workflow-design .node-error-default:after{border:1px solid #00000036;box-shadow:0 0 10px #00000069}.workflow-design .node-error-waiting:after{border:1px solid #64a6ea;box-shadow:0 0 6px #64a6ea}.workflow-design .node-error-running:after{border:1px solid #1b7ee5;box-shadow:0 0 6px #1b7ee5}.workflow-design .node-error-success:after{border:1px solid #087da1;box-shadow:0 0 6px #087da1}.workflow-design .node-error-fail:after{border:1px solid #f52d80;box-shadow:0 0 6px #f52d80}.workflow-design .node-error-stop:after{border:1px solid #ac2df5;box-shadow:0 0 6px #ac2df5}.workflow-design .node-error-cancel:after{border:1px solid #f5732d;box-shadow:0 0 6px #f5732d}.workflow-design .error-tip{cursor:default;position:absolute;top:0;right:0;transform:translate(150%);font-size:24px}.tags-list{margin-top:15px;width:100%}.add-node-popover-body li{display:inline-block;width:80px;text-align:center;padding:10px 0}.add-node-popover-body li i{border:1px solid var(--el-border-color-light);width:40px;height:40px;border-radius:50%;text-align:center;line-height:38px;font-size:18px;cursor:pointer}.add-node-popover-body li i:hover{border:1px solid #3296fa;background:#3296fa;color:#fff!important}.add-node-popover-body li p{font-size:12px;margin-top:5px}.node-wrap-drawer__title{padding-right:40px}.node-wrap-drawer__title label{cursor:pointer}.node-wrap-drawer__title label:hover{border-bottom:1px dashed #409eff}.node-wrap-drawer__title .node-wrap-drawer__title-edit{color:#409eff;margin-left:10px;vertical-align:middle}.dark .workflow-design .node-wrap-box,.dark .workflow-design .auto-judge{background:#2b2b2b}.dark .workflow-design .col-box{background:var(--el-bg-color)}.dark .workflow-design .top-left-cover-line,.dark .workflow-design .top-right-cover-line,.dark .workflow-design .bottom-left-cover-line,.dark .workflow-design .bottom-right-cover-line{background-color:var(--el-bg-color)}.dark .workflow-design .node-wrap-box:before,.dark .workflow-design .auto-judge:before{background-color:var(--el-bg-color)}.dark .workflow-design .branch-box .add-branch{background:var(--el-bg-color)}.dark .workflow-design .end-node .end-node-text{color:#ccc}.dark .workflow-design .auto-judge .sort-left:hover,.dark .workflow-design .auto-judge .sort-right:hover{background:var(--el-bg-color)}.header[data-v-f015920a]{display:flex;justify-content:space-between;align-items:center;width:100vw;box-shadow:0 1px 4px #00152914;background-color:#fff;box-sizing:border-box;padding:8px 16px}body{background-color:#f0f2f5}body .work-flow{margin-top:16px}html,body{width:100%;height:100%}input::-ms-clear,input::-ms-reveal{display:none}*,*:before,*:after{box-sizing:border-box}html{font-family:sans-serif;line-height:1.15;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;-ms-overflow-style:scrollbar;-webkit-tap-highlight-color:rgba(0,0,0,0)}@-ms-viewport{width:device-width}body{margin:0}[tabindex="-1"]:focus{outline:none}hr{box-sizing:content-box;height:0;overflow:visible}h1,h2,h3,h4,h5,h6{margin-top:0;margin-bottom:.5em;font-weight:500}p{margin-top:0;margin-bottom:1em}abbr[title],abbr[data-original-title]{-webkit-text-decoration:underline dotted;text-decoration:underline;text-decoration:underline dotted;border-bottom:0;cursor:help}address{margin-bottom:1em;font-style:normal;line-height:inherit}input[type=text],input[type=password],input[type=number],textarea{-webkit-appearance:none}ol,ul,dl{margin-top:0;margin-bottom:1em}ol ol,ul ul,ol ul,ul ol{margin-bottom:0}dt{font-weight:500}dd{margin-bottom:.5em;margin-left:0}blockquote{margin:0 0 1em}dfn{font-style:italic}b,strong{font-weight:bolder}small{font-size:80%}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}pre,code,kbd,samp{font-size:1em;font-family:SFMono-Regular,Consolas,Liberation Mono,Menlo,Courier,monospace}pre{margin-top:0;margin-bottom:1em;overflow:auto}figure{margin:0 0 1em}img{vertical-align:middle;border-style:none}a,area,button,[role=button],input:not([type=range]),label,select,summary,textarea{touch-action:manipulation}table{border-collapse:collapse}caption{padding-top:.75em;padding-bottom:.3em;text-align:left;caption-side:bottom}input,button,select,optgroup,textarea{margin:0;color:inherit;font-size:inherit;font-family:inherit;line-height:inherit}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{padding:0;border-style:none}input[type=radio],input[type=checkbox]{box-sizing:border-box;padding:0}input[type=date],input[type=time],input[type=datetime-local],input[type=month]{-webkit-appearance:listbox}textarea{overflow:auto;resize:vertical}fieldset{min-width:0;margin:0;padding:0;border:0}legend{display:block;width:100%;max-width:100%;margin-bottom:.5em;padding:0;color:inherit;font-size:1.5em;line-height:inherit;white-space:normal}progress{vertical-align:baseline}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{outline-offset:-2px;-webkit-appearance:none}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{font:inherit;-webkit-appearance:button}output{display:inline-block}summary{display:list-item}template{display:none}[hidden]{display:none!important}mark{padding:.2em;background-color:#feffe6} diff --git a/frontend/public/lib/index.html b/frontend/public/lib/index.html index 3b2f683aa..3809cd946 100644 --- a/frontend/public/lib/index.html +++ b/frontend/public/lib/index.html @@ -1,16 +1,16 @@ - - - - - - - Easy Retry - - - - - -
- - - + + + + + + + Easy Retry + + + + + +
+ + + diff --git a/frontend/src/views/job/JobBatchInfo.vue b/frontend/src/views/job/JobBatchInfo.vue index 905adcf58..1a36691d6 100644 --- a/frontend/src/views/job/JobBatchInfo.vue +++ b/frontend/src/views/job/JobBatchInfo.vue @@ -99,7 +99,9 @@ export default { this.jobBatchInfo = res.data this.queryParam = { groupName: this.jobBatchInfo.groupName, - taskBatchId: id + taskBatchId: id, + startId: 0, + fromIndex: 0 } this.$refs.JobTaskListRef.refreshTable(this.queryParam) }) diff --git a/frontend/src/views/job/JobTaskList.vue b/frontend/src/views/job/JobTaskList.vue index d76aff093..0ab021da9 100644 --- a/frontend/src/views/job/JobTaskList.vue +++ b/frontend/src/views/job/JobTaskList.vue @@ -130,7 +130,10 @@ export default { // 高级搜索 展开/关闭 advanced: false, // 查询参数 - queryParam: {}, + queryParam: { + startId: 0, + fromIndex: 0 + }, data: [], logData: [], taskStatus: enums.taskStatus, @@ -236,7 +239,9 @@ export default { await this.fetchLog({ taskBatchId: record.taskBatchId, jobId: record.jobId, - taskId: record.id + taskId: record.id, + startId: 0, + fromIndex: 0 }, record) this.$forceUpdate() }